@serve.zone/dcrouter 11.14.0 → 11.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. package/dist_serve/bundle.js +5 -9
  2. package/dist_ts/00_commitinfo_data.d.ts +8 -0
  3. package/dist_ts/00_commitinfo_data.js +9 -0
  4. package/dist_ts/cache/classes.cache.cleaner.d.ts +47 -0
  5. package/dist_ts/cache/classes.cache.cleaner.js +130 -0
  6. package/dist_ts/cache/classes.cached.document.d.ts +76 -0
  7. package/dist_ts/cache/classes.cached.document.js +100 -0
  8. package/dist_ts/cache/classes.cachedb.d.ts +60 -0
  9. package/dist_ts/cache/classes.cachedb.js +126 -0
  10. package/dist_ts/cache/documents/classes.cached.email.d.ts +125 -0
  11. package/dist_ts/cache/documents/classes.cached.email.js +337 -0
  12. package/dist_ts/cache/documents/classes.cached.ip.reputation.d.ts +119 -0
  13. package/dist_ts/cache/documents/classes.cached.ip.reputation.js +323 -0
  14. package/dist_ts/cache/documents/index.d.ts +2 -0
  15. package/dist_ts/cache/documents/index.js +3 -0
  16. package/dist_ts/cache/index.d.ts +4 -0
  17. package/dist_ts/cache/index.js +7 -0
  18. package/dist_ts/classes.cert-provision-scheduler.d.ts +54 -0
  19. package/dist_ts/classes.cert-provision-scheduler.js +118 -0
  20. package/dist_ts/classes.dcrouter.d.ts +399 -0
  21. package/dist_ts/classes.dcrouter.js +1697 -0
  22. package/dist_ts/classes.storage-cert-manager.d.ts +18 -0
  23. package/dist_ts/classes.storage-cert-manager.js +43 -0
  24. package/dist_ts/config/classes.api-token-manager.d.ts +46 -0
  25. package/dist_ts/config/classes.api-token-manager.js +150 -0
  26. package/dist_ts/config/classes.route-config-manager.d.ts +38 -0
  27. package/dist_ts/config/classes.route-config-manager.js +257 -0
  28. package/dist_ts/config/index.d.ts +3 -0
  29. package/dist_ts/config/index.js +5 -0
  30. package/dist_ts/config/validator.d.ts +104 -0
  31. package/dist_ts/config/validator.js +152 -0
  32. package/dist_ts/errors/base.errors.d.ts +224 -0
  33. package/dist_ts/errors/base.errors.js +320 -0
  34. package/dist_ts/errors/error-handler.d.ts +98 -0
  35. package/dist_ts/errors/error-handler.js +282 -0
  36. package/dist_ts/errors/error.codes.d.ts +115 -0
  37. package/dist_ts/errors/error.codes.js +136 -0
  38. package/dist_ts/errors/index.d.ts +54 -0
  39. package/dist_ts/errors/index.js +136 -0
  40. package/dist_ts/errors/reputation.errors.d.ts +183 -0
  41. package/dist_ts/errors/reputation.errors.js +292 -0
  42. package/dist_ts/http3/http3-route-augmentation.d.ts +50 -0
  43. package/dist_ts/http3/http3-route-augmentation.js +98 -0
  44. package/dist_ts/http3/index.d.ts +1 -0
  45. package/dist_ts/http3/index.js +2 -0
  46. package/dist_ts/index.d.ts +8 -0
  47. package/dist_ts/index.js +29 -0
  48. package/dist_ts/logger.d.ts +21 -0
  49. package/dist_ts/logger.js +81 -0
  50. package/dist_ts/monitoring/classes.metricscache.d.ts +32 -0
  51. package/dist_ts/monitoring/classes.metricscache.js +63 -0
  52. package/dist_ts/monitoring/classes.metricsmanager.d.ts +184 -0
  53. package/dist_ts/monitoring/classes.metricsmanager.js +744 -0
  54. package/dist_ts/monitoring/index.d.ts +1 -0
  55. package/dist_ts/monitoring/index.js +2 -0
  56. package/dist_ts/opsserver/classes.opsserver.d.ts +38 -0
  57. package/dist_ts/opsserver/classes.opsserver.js +87 -0
  58. package/dist_ts/opsserver/handlers/admin.handler.d.ts +31 -0
  59. package/dist_ts/opsserver/handlers/admin.handler.js +180 -0
  60. package/dist_ts/opsserver/handlers/api-token.handler.d.ts +6 -0
  61. package/dist_ts/opsserver/handlers/api-token.handler.js +62 -0
  62. package/dist_ts/opsserver/handlers/certificate.handler.d.ts +32 -0
  63. package/dist_ts/opsserver/handlers/certificate.handler.js +421 -0
  64. package/dist_ts/opsserver/handlers/config.handler.d.ts +7 -0
  65. package/dist_ts/opsserver/handlers/config.handler.js +192 -0
  66. package/dist_ts/opsserver/handlers/email-ops.handler.d.ts +30 -0
  67. package/dist_ts/opsserver/handlers/email-ops.handler.js +227 -0
  68. package/dist_ts/opsserver/handlers/index.d.ts +12 -0
  69. package/dist_ts/opsserver/handlers/index.js +13 -0
  70. package/dist_ts/opsserver/handlers/logs.handler.d.ts +25 -0
  71. package/dist_ts/opsserver/handlers/logs.handler.js +256 -0
  72. package/dist_ts/opsserver/handlers/radius.handler.d.ts +6 -0
  73. package/dist_ts/opsserver/handlers/radius.handler.js +295 -0
  74. package/dist_ts/opsserver/handlers/remoteingress.handler.d.ts +6 -0
  75. package/dist_ts/opsserver/handlers/remoteingress.handler.js +156 -0
  76. package/dist_ts/opsserver/handlers/route-management.handler.d.ts +14 -0
  77. package/dist_ts/opsserver/handlers/route-management.handler.js +117 -0
  78. package/dist_ts/opsserver/handlers/security.handler.d.ts +9 -0
  79. package/dist_ts/opsserver/handlers/security.handler.js +233 -0
  80. package/dist_ts/opsserver/handlers/stats.handler.d.ts +11 -0
  81. package/dist_ts/opsserver/handlers/stats.handler.js +403 -0
  82. package/dist_ts/opsserver/handlers/vpn.handler.d.ts +6 -0
  83. package/dist_ts/opsserver/handlers/vpn.handler.js +197 -0
  84. package/dist_ts/opsserver/helpers/guards.d.ts +27 -0
  85. package/dist_ts/opsserver/helpers/guards.js +43 -0
  86. package/dist_ts/opsserver/index.d.ts +1 -0
  87. package/dist_ts/opsserver/index.js +2 -0
  88. package/dist_ts/paths.d.ts +26 -0
  89. package/dist_ts/paths.js +45 -0
  90. package/dist_ts/plugins.d.ts +81 -0
  91. package/dist_ts/plugins.js +115 -0
  92. package/dist_ts/radius/classes.accounting.manager.d.ts +231 -0
  93. package/dist_ts/radius/classes.accounting.manager.js +462 -0
  94. package/dist_ts/radius/classes.radius.server.d.ts +171 -0
  95. package/dist_ts/radius/classes.radius.server.js +386 -0
  96. package/dist_ts/radius/classes.vlan.manager.d.ts +128 -0
  97. package/dist_ts/radius/classes.vlan.manager.js +279 -0
  98. package/dist_ts/radius/index.d.ts +13 -0
  99. package/dist_ts/radius/index.js +14 -0
  100. package/dist_ts/remoteingress/classes.remoteingress-manager.d.ts +94 -0
  101. package/dist_ts/remoteingress/classes.remoteingress-manager.js +271 -0
  102. package/dist_ts/remoteingress/classes.tunnel-manager.d.ts +59 -0
  103. package/dist_ts/remoteingress/classes.tunnel-manager.js +165 -0
  104. package/dist_ts/remoteingress/index.d.ts +2 -0
  105. package/dist_ts/remoteingress/index.js +3 -0
  106. package/dist_ts/security/classes.contentscanner.d.ts +164 -0
  107. package/dist_ts/security/classes.contentscanner.js +642 -0
  108. package/dist_ts/security/classes.ipreputationchecker.d.ts +160 -0
  109. package/dist_ts/security/classes.ipreputationchecker.js +537 -0
  110. package/dist_ts/security/classes.securitylogger.d.ts +144 -0
  111. package/dist_ts/security/classes.securitylogger.js +235 -0
  112. package/dist_ts/security/index.d.ts +3 -0
  113. package/dist_ts/security/index.js +4 -0
  114. package/dist_ts/sms/classes.smsservice.d.ts +15 -0
  115. package/dist_ts/sms/classes.smsservice.js +72 -0
  116. package/dist_ts/sms/config/sms.config.d.ts +93 -0
  117. package/dist_ts/sms/config/sms.config.js +2 -0
  118. package/dist_ts/sms/config/sms.schema.d.ts +5 -0
  119. package/dist_ts/sms/config/sms.schema.js +121 -0
  120. package/dist_ts/sms/index.d.ts +1 -0
  121. package/dist_ts/sms/index.js +2 -0
  122. package/dist_ts/storage/classes.storagemanager.d.ts +83 -0
  123. package/dist_ts/storage/classes.storagemanager.js +348 -0
  124. package/dist_ts/storage/index.d.ts +1 -0
  125. package/dist_ts/storage/index.js +3 -0
  126. package/dist_ts/vpn/classes.vpn-manager.d.ts +129 -0
  127. package/dist_ts/vpn/classes.vpn-manager.js +329 -0
  128. package/dist_ts/vpn/index.d.ts +1 -0
  129. package/dist_ts/vpn/index.js +2 -0
  130. package/dist_ts_apiclient/classes.apitoken.d.ts +41 -0
  131. package/dist_ts_apiclient/classes.apitoken.js +115 -0
  132. package/dist_ts_apiclient/classes.certificate.d.ts +57 -0
  133. package/dist_ts_apiclient/classes.certificate.js +69 -0
  134. package/dist_ts_apiclient/classes.config.d.ts +7 -0
  135. package/dist_ts_apiclient/classes.config.js +11 -0
  136. package/dist_ts_apiclient/classes.dcrouterapiclient.d.ts +41 -0
  137. package/dist_ts_apiclient/classes.dcrouterapiclient.js +81 -0
  138. package/dist_ts_apiclient/classes.email.d.ts +30 -0
  139. package/dist_ts_apiclient/classes.email.js +52 -0
  140. package/dist_ts_apiclient/classes.logs.d.ts +21 -0
  141. package/dist_ts_apiclient/classes.logs.js +14 -0
  142. package/dist_ts_apiclient/classes.radius.d.ts +59 -0
  143. package/dist_ts_apiclient/classes.radius.js +95 -0
  144. package/dist_ts_apiclient/classes.remoteingress.d.ts +54 -0
  145. package/dist_ts_apiclient/classes.remoteingress.js +136 -0
  146. package/dist_ts_apiclient/classes.route.d.ts +42 -0
  147. package/dist_ts_apiclient/classes.route.js +154 -0
  148. package/dist_ts_apiclient/classes.stats.d.ts +47 -0
  149. package/dist_ts_apiclient/classes.stats.js +38 -0
  150. package/dist_ts_apiclient/index.d.ts +10 -0
  151. package/dist_ts_apiclient/index.js +14 -0
  152. package/dist_ts_apiclient/plugins.d.ts +3 -0
  153. package/dist_ts_apiclient/plugins.js +5 -0
  154. package/dist_ts_interfaces/data/remoteingress.d.ts +2 -0
  155. package/dist_ts_interfaces/data/vpn.d.ts +1 -2
  156. package/dist_ts_interfaces/requests/vpn.d.ts +1 -1
  157. package/dist_ts_web/00_commitinfo_data.d.ts +8 -0
  158. package/dist_ts_web/00_commitinfo_data.js +9 -0
  159. package/dist_ts_web/appstate.d.ts +238 -0
  160. package/dist_ts_web/appstate.js +1174 -0
  161. package/dist_ts_web/elements/index.d.ts +13 -0
  162. package/dist_ts_web/elements/index.js +14 -0
  163. package/dist_ts_web/elements/ops-dashboard.d.ts +23 -0
  164. package/dist_ts_web/elements/ops-dashboard.js +323 -0
  165. package/dist_ts_web/elements/ops-view-apitokens.d.ts +13 -0
  166. package/dist_ts_web/elements/ops-view-apitokens.js +371 -0
  167. package/dist_ts_web/elements/ops-view-certificates.d.ts +22 -0
  168. package/dist_ts_web/elements/ops-view-certificates.js +528 -0
  169. package/dist_ts_web/elements/ops-view-config.d.ts +19 -0
  170. package/dist_ts_web/elements/ops-view-config.js +339 -0
  171. package/dist_ts_web/elements/ops-view-emails.d.ts +21 -0
  172. package/dist_ts_web/elements/ops-view-emails.js +165 -0
  173. package/dist_ts_web/elements/ops-view-logs.d.ts +13 -0
  174. package/dist_ts_web/elements/ops-view-logs.js +159 -0
  175. package/dist_ts_web/elements/ops-view-network.d.ts +71 -0
  176. package/dist_ts_web/elements/ops-view-network.js +764 -0
  177. package/dist_ts_web/elements/ops-view-overview.d.ts +22 -0
  178. package/dist_ts_web/elements/ops-view-overview.js +456 -0
  179. package/dist_ts_web/elements/ops-view-remoteingress.d.ts +20 -0
  180. package/dist_ts_web/elements/ops-view-remoteingress.js +494 -0
  181. package/dist_ts_web/elements/ops-view-routes.d.ts +12 -0
  182. package/dist_ts_web/elements/ops-view-routes.js +404 -0
  183. package/dist_ts_web/elements/ops-view-security.d.ts +21 -0
  184. package/dist_ts_web/elements/ops-view-security.js +574 -0
  185. package/dist_ts_web/elements/ops-view-vpn.d.ts +14 -0
  186. package/dist_ts_web/elements/ops-view-vpn.js +365 -0
  187. package/dist_ts_web/elements/shared/css.d.ts +1 -0
  188. package/dist_ts_web/elements/shared/css.js +10 -0
  189. package/dist_ts_web/elements/shared/index.d.ts +2 -0
  190. package/dist_ts_web/elements/shared/index.js +3 -0
  191. package/dist_ts_web/elements/shared/ops-sectionheading.d.ts +5 -0
  192. package/dist_ts_web/elements/shared/ops-sectionheading.js +82 -0
  193. package/dist_ts_web/index.d.ts +1 -0
  194. package/dist_ts_web/index.js +10 -0
  195. package/dist_ts_web/plugins.d.ts +6 -0
  196. package/dist_ts_web/plugins.js +11 -0
  197. package/dist_ts_web/router.d.ts +19 -0
  198. package/dist_ts_web/router.js +91 -0
  199. package/package.json +2 -2
  200. package/ts/00_commitinfo_data.ts +1 -1
  201. package/ts/classes.dcrouter.ts +51 -20
  202. package/ts/config/classes.route-config-manager.ts +7 -6
  203. package/ts/opsserver/handlers/vpn.handler.ts +3 -5
  204. package/ts/vpn/classes.vpn-manager.ts +68 -19
  205. package/ts_web/00_commitinfo_data.ts +1 -1
  206. package/ts_web/appstate.ts +2 -2
  207. package/ts_web/elements/ops-view-vpn.ts +5 -9
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Validation result
3
+ */
4
+ export interface IValidationResult {
5
+ /**
6
+ * Whether the validation passed
7
+ */
8
+ valid: boolean;
9
+ /**
10
+ * Validation errors if any
11
+ */
12
+ errors?: string[];
13
+ /**
14
+ * Validated configuration (may include defaults)
15
+ */
16
+ config?: any;
17
+ }
18
+ /**
19
+ * Validation schema types
20
+ */
21
+ export type ValidationSchema = Record<string, {
22
+ /**
23
+ * Type of the value
24
+ */
25
+ type: 'string' | 'number' | 'boolean' | 'object' | 'array';
26
+ /**
27
+ * Whether the field is required
28
+ */
29
+ required?: boolean;
30
+ /**
31
+ * Default value if not specified
32
+ */
33
+ default?: any;
34
+ /**
35
+ * Minimum value (for numbers)
36
+ */
37
+ min?: number;
38
+ /**
39
+ * Maximum value (for numbers)
40
+ */
41
+ max?: number;
42
+ /**
43
+ * Minimum length (for strings or arrays)
44
+ */
45
+ minLength?: number;
46
+ /**
47
+ * Maximum length (for strings or arrays)
48
+ */
49
+ maxLength?: number;
50
+ /**
51
+ * Pattern to match (for strings)
52
+ */
53
+ pattern?: RegExp;
54
+ /**
55
+ * Allowed values (for strings, numbers)
56
+ */
57
+ enum?: any[];
58
+ /**
59
+ * Nested schema (for objects)
60
+ */
61
+ schema?: ValidationSchema;
62
+ /**
63
+ * Item schema (for arrays)
64
+ */
65
+ items?: {
66
+ type: 'string' | 'number' | 'boolean' | 'object';
67
+ schema?: ValidationSchema;
68
+ };
69
+ /**
70
+ * Custom validation function
71
+ */
72
+ validate?: (value: any) => boolean | string;
73
+ }>;
74
+ /**
75
+ * Configuration validator
76
+ * Validates configuration objects against schemas and provides default values
77
+ */
78
+ export declare class ConfigValidator {
79
+ /**
80
+ * Validate a configuration object against a schema
81
+ *
82
+ * @param config Configuration object to validate
83
+ * @param schema Validation schema
84
+ * @returns Validation result
85
+ */
86
+ static validate<T>(config: T, schema: ValidationSchema): IValidationResult;
87
+ /**
88
+ * Apply defaults to a configuration object based on a schema
89
+ *
90
+ * @param config Configuration object to apply defaults to
91
+ * @param schema Validation schema with defaults
92
+ * @returns Configuration with defaults applied
93
+ */
94
+ static applyDefaults<T>(config: T, schema: ValidationSchema): T;
95
+ /**
96
+ * Throw a validation error if the configuration is invalid
97
+ *
98
+ * @param config Configuration to validate
99
+ * @param schema Validation schema
100
+ * @returns Validated configuration with defaults
101
+ * @throws ValidationError if validation fails
102
+ */
103
+ static validateOrThrow<T>(config: T, schema: ValidationSchema): T;
104
+ }
@@ -0,0 +1,152 @@
1
+ import * as plugins from '../plugins.js';
2
+ import { ValidationError } from '../errors/base.errors.js';
3
+ /**
4
+ * Configuration validator
5
+ * Validates configuration objects against schemas and provides default values
6
+ */
7
+ export class ConfigValidator {
8
+ /**
9
+ * Validate a configuration object against a schema
10
+ *
11
+ * @param config Configuration object to validate
12
+ * @param schema Validation schema
13
+ * @returns Validation result
14
+ */
15
+ static validate(config, schema) {
16
+ const errors = [];
17
+ const validatedConfig = { ...config };
18
+ // Validate each field against the schema
19
+ for (const [key, rules] of Object.entries(schema)) {
20
+ const value = config[key];
21
+ // Check if required
22
+ if (rules.required && (value === undefined || value === null)) {
23
+ errors.push(`${key} is required`);
24
+ continue;
25
+ }
26
+ // If not present and not required, apply default if available
27
+ if ((value === undefined || value === null)) {
28
+ if (rules.default !== undefined) {
29
+ validatedConfig[key] = rules.default;
30
+ }
31
+ continue;
32
+ }
33
+ // Type validation
34
+ if (value !== undefined && value !== null) {
35
+ const valueType = Array.isArray(value) ? 'array' : typeof value;
36
+ if (valueType !== rules.type) {
37
+ errors.push(`${key} must be of type ${rules.type}, got ${valueType}`);
38
+ continue;
39
+ }
40
+ // Type-specific validations
41
+ switch (rules.type) {
42
+ case 'number':
43
+ if (rules.min !== undefined && value < rules.min) {
44
+ errors.push(`${key} must be at least ${rules.min}`);
45
+ }
46
+ if (rules.max !== undefined && value > rules.max) {
47
+ errors.push(`${key} must be at most ${rules.max}`);
48
+ }
49
+ break;
50
+ case 'string':
51
+ if (rules.minLength !== undefined && value.length < rules.minLength) {
52
+ errors.push(`${key} must be at least ${rules.minLength} characters`);
53
+ }
54
+ if (rules.maxLength !== undefined && value.length > rules.maxLength) {
55
+ errors.push(`${key} must be at most ${rules.maxLength} characters`);
56
+ }
57
+ if (rules.pattern && !rules.pattern.test(value)) {
58
+ errors.push(`${key} must match pattern ${rules.pattern}`);
59
+ }
60
+ break;
61
+ case 'array':
62
+ if (rules.minLength !== undefined && value.length < rules.minLength) {
63
+ errors.push(`${key} must have at least ${rules.minLength} items`);
64
+ }
65
+ if (rules.maxLength !== undefined && value.length > rules.maxLength) {
66
+ errors.push(`${key} must have at most ${rules.maxLength} items`);
67
+ }
68
+ if (rules.items && value.length > 0) {
69
+ for (let i = 0; i < value.length; i++) {
70
+ const itemType = Array.isArray(value[i]) ? 'array' : typeof value[i];
71
+ if (itemType !== rules.items.type) {
72
+ errors.push(`${key}[${i}] must be of type ${rules.items.type}, got ${itemType}`);
73
+ }
74
+ else if (rules.items.schema && itemType === 'object') {
75
+ const itemResult = this.validate(value[i], rules.items.schema);
76
+ if (!itemResult.valid) {
77
+ errors.push(...itemResult.errors.map(err => `${key}[${i}].${err}`));
78
+ }
79
+ }
80
+ }
81
+ }
82
+ break;
83
+ case 'object':
84
+ if (rules.schema) {
85
+ const nestedResult = this.validate(value, rules.schema);
86
+ if (!nestedResult.valid) {
87
+ errors.push(...nestedResult.errors.map(err => `${key}.${err}`));
88
+ }
89
+ validatedConfig[key] = nestedResult.config;
90
+ }
91
+ break;
92
+ }
93
+ // Enum validation
94
+ if (rules.enum && !rules.enum.includes(value)) {
95
+ errors.push(`${key} must be one of [${rules.enum.join(', ')}]`);
96
+ }
97
+ // Custom validation
98
+ if (rules.validate) {
99
+ const result = rules.validate(value);
100
+ if (result !== true) {
101
+ errors.push(typeof result === 'string' ? result : `${key} failed custom validation`);
102
+ }
103
+ }
104
+ }
105
+ }
106
+ return {
107
+ valid: errors.length === 0,
108
+ errors: errors.length > 0 ? errors : undefined,
109
+ config: validatedConfig
110
+ };
111
+ }
112
+ /**
113
+ * Apply defaults to a configuration object based on a schema
114
+ *
115
+ * @param config Configuration object to apply defaults to
116
+ * @param schema Validation schema with defaults
117
+ * @returns Configuration with defaults applied
118
+ */
119
+ static applyDefaults(config, schema) {
120
+ const result = { ...config };
121
+ for (const [key, rules] of Object.entries(schema)) {
122
+ if (result[key] === undefined && rules.default !== undefined) {
123
+ result[key] = rules.default;
124
+ }
125
+ // Apply defaults to nested objects
126
+ if (result[key] && rules.type === 'object' && rules.schema) {
127
+ result[key] = this.applyDefaults(result[key], rules.schema);
128
+ }
129
+ // Apply defaults to array items
130
+ if (result[key] && rules.type === 'array' && rules.items && rules.items.schema) {
131
+ result[key] = result[key].map(item => typeof item === 'object' ? this.applyDefaults(item, rules.items.schema) : item);
132
+ }
133
+ }
134
+ return result;
135
+ }
136
+ /**
137
+ * Throw a validation error if the configuration is invalid
138
+ *
139
+ * @param config Configuration to validate
140
+ * @param schema Validation schema
141
+ * @returns Validated configuration with defaults
142
+ * @throws ValidationError if validation fails
143
+ */
144
+ static validateOrThrow(config, schema) {
145
+ const result = this.validate(config, schema);
146
+ if (!result.valid) {
147
+ throw new ValidationError(`Configuration validation failed: ${result.errors.join(', ')}`, 'CONFIG_VALIDATION_ERROR', { data: { errors: result.errors } });
148
+ }
149
+ return result.config;
150
+ }
151
+ }
152
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFsaWRhdG9yLmpzIiwic291cmNlUm9vdCI6IiIsInNv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1FBRTdDLElBQUksQ0FBQyxNQUFNLENBQUMsS0FBSyxFQUFFLENBQUM7WUFDbEIsTUFBTSxJQUFJLGVBQWUsQ0FDdkIsb0NBQW9DLE1BQU0sQ0FBQyxNQUFPLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxFQUFFLEVBQy9ELHlCQUF5QixFQUN6QixFQUFFLElBQUksRUFBRSxFQUFFLE1BQU0sRUFBRSxNQUFNLENBQUMsTUFBTSxFQUFFLEVBQUUsQ0FDcEMsQ0FBQztRQUNKLENBQUM7UUFFRCxPQUFPLE1BQU0sQ0FBQyxNQUFNLENBQUM7SUFDdkIsQ0FBQztDQUNGIn0=
@@ -0,0 +1,224 @@
1
+ import { ErrorSeverity, ErrorCategory, ErrorRecoverability } from './error.codes.js';
2
+ /**
3
+ * Context information added to structured errors
4
+ */
5
+ export interface IErrorContext {
6
+ /** Component or service where the error occurred */
7
+ component?: string;
8
+ /** Operation that was being performed */
9
+ operation?: string;
10
+ /** Unique request ID if available */
11
+ requestId?: string;
12
+ /** Error occurred at timestamp */
13
+ timestamp?: number;
14
+ /** User-visible message (safe to display to end-users) */
15
+ userMessage?: string;
16
+ /** Additional structured data for debugging */
17
+ data?: Record<string, any>;
18
+ /** Related entity IDs if applicable */
19
+ entity?: {
20
+ type: string;
21
+ id: string | number;
22
+ };
23
+ /** Stack trace (if enabled in configuration) */
24
+ stack?: string;
25
+ /** Retry information if applicable */
26
+ retry?: {
27
+ /** Maximum number of retries allowed */
28
+ maxRetries?: number;
29
+ /** Current retry count */
30
+ currentRetry?: number;
31
+ /** Next retry timestamp */
32
+ nextRetryAt?: number;
33
+ /** Delay between retries (in ms) */
34
+ retryDelay?: number;
35
+ };
36
+ }
37
+ /**
38
+ * Base class for all errors in the Platform Service
39
+ * Adds structured error information, logging, and error tracking
40
+ */
41
+ export declare class PlatformError extends Error {
42
+ /** Error code identifying the specific error type */
43
+ readonly code: string;
44
+ /** Error severity level */
45
+ readonly severity: ErrorSeverity;
46
+ /** Error category for grouping related errors */
47
+ readonly category: ErrorCategory;
48
+ /** Whether the error can be recovered from automatically */
49
+ readonly recoverability: ErrorRecoverability;
50
+ /** Additional context information */
51
+ readonly context: IErrorContext;
52
+ /**
53
+ * Creates a new PlatformError
54
+ *
55
+ * @param message Error message
56
+ * @param code Error code from error.codes.ts
57
+ * @param severity Error severity level
58
+ * @param category Error category
59
+ * @param recoverability Error recoverability indication
60
+ * @param context Additional context information
61
+ */
62
+ constructor(message: string, code: string, severity?: ErrorSeverity, category?: ErrorCategory, recoverability?: ErrorRecoverability, context?: IErrorContext);
63
+ /**
64
+ * Logs the error using the platform logger
65
+ */
66
+ private logError;
67
+ /**
68
+ * Maps severity levels to log levels
69
+ */
70
+ private getLogLevelFromSeverity;
71
+ /**
72
+ * Returns a JSON representation of the error
73
+ */
74
+ toJSON(): Record<string, any>;
75
+ /**
76
+ * Creates an instance with retry information
77
+ *
78
+ * @param maxRetries Maximum number of retries
79
+ * @param currentRetry Current retry count
80
+ * @param retryDelay Delay between retries in ms
81
+ */
82
+ withRetry(maxRetries: number, currentRetry?: number, retryDelay?: number): PlatformError;
83
+ /**
84
+ * Protected method to create a new instance with updated context
85
+ * Subclasses can override this to handle their own constructor signatures
86
+ */
87
+ protected createWithContext(context: IErrorContext): PlatformError;
88
+ /**
89
+ * Checks if the error should be retried based on retry information
90
+ */
91
+ shouldRetry(): boolean;
92
+ /**
93
+ * Returns a user-friendly message that is safe to display to end users
94
+ */
95
+ getUserMessage(): string;
96
+ }
97
+ /**
98
+ * Error class for validation errors
99
+ */
100
+ export declare class ValidationError extends PlatformError {
101
+ /**
102
+ * Creates a new validation error
103
+ *
104
+ * @param message Error message
105
+ * @param code Error code
106
+ * @param context Additional context
107
+ */
108
+ constructor(message: string, code: string, context?: IErrorContext);
109
+ /**
110
+ * Creates a new instance with updated context
111
+ * Overrides the base implementation to handle ValidationError's constructor signature
112
+ */
113
+ protected createWithContext(context: IErrorContext): PlatformError;
114
+ }
115
+ /**
116
+ * Error class for configuration errors
117
+ */
118
+ export declare class ConfigurationError extends PlatformError {
119
+ /**
120
+ * Creates a new configuration error
121
+ *
122
+ * @param message Error message
123
+ * @param code Error code
124
+ * @param context Additional context
125
+ */
126
+ constructor(message: string, code: string, context?: IErrorContext);
127
+ /**
128
+ * Creates a new instance with updated context
129
+ * Overrides the base implementation to handle ConfigurationError's constructor signature
130
+ */
131
+ protected createWithContext(context: IErrorContext): PlatformError;
132
+ }
133
+ /**
134
+ * Error class for network-related errors
135
+ */
136
+ export declare class NetworkError extends PlatformError {
137
+ /**
138
+ * Creates a new network error
139
+ *
140
+ * @param message Error message
141
+ * @param code Error code
142
+ * @param context Additional context
143
+ */
144
+ constructor(message: string, code: string, context?: IErrorContext);
145
+ /**
146
+ * Creates a new instance with updated context
147
+ * Overrides the base implementation to handle NetworkError's constructor signature
148
+ */
149
+ protected createWithContext(context: IErrorContext): PlatformError;
150
+ }
151
+ /**
152
+ * Error class for resource availability errors (rate limits, quotas)
153
+ */
154
+ export declare class ResourceError extends PlatformError {
155
+ /**
156
+ * Creates a new resource error
157
+ *
158
+ * @param message Error message
159
+ * @param code Error code
160
+ * @param context Additional context
161
+ */
162
+ constructor(message: string, code: string, context?: IErrorContext);
163
+ /**
164
+ * Creates a new instance with updated context
165
+ * Overrides the base implementation to handle ResourceError's constructor signature
166
+ */
167
+ protected createWithContext(context: IErrorContext): PlatformError;
168
+ }
169
+ /**
170
+ * Error class for authentication/authorization errors
171
+ */
172
+ export declare class AuthenticationError extends PlatformError {
173
+ /**
174
+ * Creates a new authentication error
175
+ *
176
+ * @param message Error message
177
+ * @param code Error code
178
+ * @param context Additional context
179
+ */
180
+ constructor(message: string, code: string, context?: IErrorContext);
181
+ /**
182
+ * Creates a new instance with updated context
183
+ * Overrides the base implementation to handle AuthenticationError's constructor signature
184
+ */
185
+ protected createWithContext(context: IErrorContext): PlatformError;
186
+ }
187
+ /**
188
+ * Error class for operation errors (API calls, processing)
189
+ */
190
+ export declare class OperationError extends PlatformError {
191
+ /**
192
+ * Creates a new operation error
193
+ *
194
+ * @param message Error message
195
+ * @param code Error code
196
+ * @param context Additional context
197
+ */
198
+ constructor(message: string, code: string, context?: IErrorContext);
199
+ /**
200
+ * Creates a new instance with updated context
201
+ * Overrides the base implementation to handle OperationError's constructor signature
202
+ */
203
+ protected createWithContext(context: IErrorContext): PlatformError;
204
+ }
205
+ /**
206
+ * Error class for critical system errors
207
+ */
208
+ export declare class SystemError extends PlatformError {
209
+ /**
210
+ * Creates a new system error
211
+ *
212
+ * @param message Error message
213
+ * @param code Error code
214
+ * @param context Additional context
215
+ */
216
+ constructor(message: string, code: string, context?: IErrorContext);
217
+ }
218
+ /**
219
+ * Helper to get the appropriate error class based on error category
220
+ *
221
+ * @param category Error category
222
+ * @returns The appropriate error class
223
+ */
224
+ export declare function getErrorClassForCategory(category: ErrorCategory): any;