ServerConfig.ts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. export class ServerConfig {
  2. public configData;
  3. constructor(configData: IConfig) {
  4. this.configData=configData;
  5. }
  6. public static load(obj: any) :IConfig{
  7. return {
  8. manufacturerName:obj.manufacturerName||"",
  9. productName:obj.productName||"",
  10. softwareVersion:obj.softwareVersion||"",
  11. applicationUri:obj.applicationUri||"",
  12. productUri:obj.productUri||"",
  13. applicationName:obj.applicationName||"",
  14. allowAnonymous:obj.allowAnonymous||false,
  15. dynamics:obj.dynamics||[],
  16. nodesets:obj.nodesets||[],
  17. } as IConfig;
  18. }
  19. }
  20. export interface IMappingEntry {
  21. path: string;
  22. read: string;
  23. write: string;
  24. }
  25. export interface IComponentEntry {
  26. "ident": string,
  27. "namespaceUri": string,
  28. "nodeClass": string,
  29. "typeNodeId": string,
  30. "mandatory": IComponentEntry[]
  31. "optionals": IComponentEntry[]
  32. }
  33. export interface IDynamicConfig {
  34. "ident": string
  35. "namespaceUri": string
  36. "parentNodeId": string
  37. "checkInterval": number
  38. "nodeClass": string
  39. "typeNodeId": string
  40. "name": string
  41. "startIndex": number,
  42. "mandatory": IComponentEntry[]
  43. "optionals": IComponentEntry[]
  44. "nodeVersionId": string
  45. }
  46. export interface IConfig{
  47. "manufacturerName": string
  48. "productName": string
  49. "softwareVersion": string
  50. "applicationUri": string
  51. "productUri": string
  52. "applicationName": string
  53. "allowAnonymous": boolean,
  54. "nodesets": string[],
  55. "mapping": IMappingEntry[]
  56. "dynamics": IDynamicConfig[]
  57. }