ServerConfig.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. "port": number,
  54. "maxConnections": number,
  55. "allowAnonymous": boolean,
  56. "nodesets": string[],
  57. "mapping": IMappingEntry[]
  58. "dynamics": IDynamicConfig[]
  59. }