@etohq/connector-engine 1.5.1-alpha.4

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 (77) hide show
  1. package/.turbo/turbo-build.log +4 -0
  2. package/CHANGELOG.md +1 -0
  3. package/LICENSE +21 -0
  4. package/README.md +253 -0
  5. package/dist/engine/clean-connector-engine.d.ts +81 -0
  6. package/dist/engine/clean-connector-engine.d.ts.map +1 -0
  7. package/dist/engine/clean-connector-engine.js +350 -0
  8. package/dist/engine/clean-connector-engine.js.map +1 -0
  9. package/dist/engine/connector-engine-impl.d.ts +73 -0
  10. package/dist/engine/connector-engine-impl.d.ts.map +1 -0
  11. package/dist/engine/connector-engine-impl.js +332 -0
  12. package/dist/engine/connector-engine-impl.js.map +1 -0
  13. package/dist/engine/connector-engine.d.ts +54 -0
  14. package/dist/engine/connector-engine.d.ts.map +1 -0
  15. package/dist/engine/connector-engine.js +694 -0
  16. package/dist/engine/connector-engine.js.map +1 -0
  17. package/dist/engine/index.d.ts +7 -0
  18. package/dist/engine/index.d.ts.map +1 -0
  19. package/dist/engine/index.js +10 -0
  20. package/dist/engine/index.js.map +1 -0
  21. package/dist/engine/routing-engine.d.ts +26 -0
  22. package/dist/engine/routing-engine.d.ts.map +1 -0
  23. package/dist/engine/routing-engine.js +329 -0
  24. package/dist/engine/routing-engine.js.map +1 -0
  25. package/dist/examples/booking-connector-example.d.ts +7 -0
  26. package/dist/examples/booking-connector-example.d.ts.map +1 -0
  27. package/dist/examples/booking-connector-example.js +221 -0
  28. package/dist/examples/booking-connector-example.js.map +1 -0
  29. package/dist/examples/dynamic-methods-example.d.ts +7 -0
  30. package/dist/examples/dynamic-methods-example.d.ts.map +1 -0
  31. package/dist/examples/dynamic-methods-example.js +163 -0
  32. package/dist/examples/dynamic-methods-example.js.map +1 -0
  33. package/dist/index.d.ts +9 -0
  34. package/dist/index.d.ts.map +1 -0
  35. package/dist/index.js +14 -0
  36. package/dist/index.js.map +1 -0
  37. package/dist/types/base-plugin.d.ts +170 -0
  38. package/dist/types/base-plugin.d.ts.map +1 -0
  39. package/dist/types/base-plugin.js +68 -0
  40. package/dist/types/base-plugin.js.map +1 -0
  41. package/dist/types/connector-plugin.d.ts +22 -0
  42. package/dist/types/connector-plugin.d.ts.map +1 -0
  43. package/dist/types/connector-plugin.js +11 -0
  44. package/dist/types/connector-plugin.js.map +1 -0
  45. package/dist/types/engine.d.ts +223 -0
  46. package/dist/types/engine.d.ts.map +1 -0
  47. package/dist/types/engine.js +7 -0
  48. package/dist/types/engine.js.map +1 -0
  49. package/dist/types/index.d.ts +5 -0
  50. package/dist/types/index.d.ts.map +1 -0
  51. package/dist/types/index.js +9 -0
  52. package/dist/types/index.js.map +1 -0
  53. package/dist/types/operation-groups.d.ts +78 -0
  54. package/dist/types/operation-groups.d.ts.map +1 -0
  55. package/dist/types/operation-groups.js +60 -0
  56. package/dist/types/operation-groups.js.map +1 -0
  57. package/dist/types/routing-config.d.ts +116 -0
  58. package/dist/types/routing-config.d.ts.map +1 -0
  59. package/dist/types/routing-config.js +6 -0
  60. package/dist/types/routing-config.js.map +1 -0
  61. package/dist/utils/create-connector-engine.d.ts +31 -0
  62. package/dist/utils/create-connector-engine.d.ts.map +1 -0
  63. package/dist/utils/create-connector-engine.js +30 -0
  64. package/dist/utils/create-connector-engine.js.map +1 -0
  65. package/examples/booking-example.ts +168 -0
  66. package/examples/booking-test.ts +231 -0
  67. package/hyperswitch-example.ts +263 -0
  68. package/jest.config.js +2 -0
  69. package/package.json +54 -0
  70. package/src/engine/clean-connector-engine.ts +726 -0
  71. package/src/engine/index.ts +13 -0
  72. package/src/engine/routing-engine.ts +394 -0
  73. package/src/index.ts +32 -0
  74. package/src/types/connector-plugin.ts +34 -0
  75. package/src/types/index.ts +5 -0
  76. package/src/types/routing-config.ts +196 -0
  77. package/tsconfig.json +3 -0
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ /**
3
+ * @fileoverview Base Plugin Interface
4
+ * @description Enhanced base interface with operation types and container context
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.AbstractConnectorPlugin = exports.PluginType = void 0;
8
+ // ===== PLUGIN TYPES =====
9
+ var PluginType;
10
+ (function (PluginType) {
11
+ PluginType["PAYMENT"] = "payment";
12
+ PluginType["NOTIFICATION"] = "notification";
13
+ PluginType["CALENDAR"] = "calendar";
14
+ PluginType["VIDEO"] = "video";
15
+ PluginType["STORAGE"] = "storage";
16
+ PluginType["ANALYTICS"] = "analytics";
17
+ PluginType["RESOURCE"] = "resource";
18
+ PluginType["CUSTOM"] = "custom";
19
+ })(PluginType || (exports.PluginType = PluginType = {}));
20
+ // ===== ENHANCED BASE PLUGIN =====
21
+ class AbstractConnectorPlugin {
22
+ constructor() {
23
+ this.config = null;
24
+ this.initialized = false;
25
+ }
26
+ async initialize(config) {
27
+ this.config = config;
28
+ this.initialized = true;
29
+ }
30
+ async destroy() {
31
+ this.config = null;
32
+ this.initialized = false;
33
+ }
34
+ async healthCheck() {
35
+ return {
36
+ status: this.initialized ? 'healthy' : 'unhealthy',
37
+ message: this.initialized ? 'Plugin is initialized' : 'Plugin not initialized',
38
+ lastChecked: new Date()
39
+ };
40
+ }
41
+ ensureInitialized() {
42
+ if (!this.initialized || !this.config) {
43
+ throw new Error(`Plugin ${this.getName()} is not initialized`);
44
+ }
45
+ }
46
+ getConfig() {
47
+ this.ensureInitialized();
48
+ return this.config;
49
+ }
50
+ }
51
+ exports.AbstractConnectorPlugin = AbstractConnectorPlugin;
52
+ createPlugin(config, engine_1.ConnectorConfig);
53
+ TPlugin;
54
+ getSupportedProviders();
55
+ string[];
56
+ getPluginType();
57
+ string;
58
+ // ===== PLUGIN TYPES =====
59
+ (function (PluginType) {
60
+ PluginType["PAYMENT"] = "payment";
61
+ PluginType["NOTIFICATION"] = "notification";
62
+ PluginType["CALENDAR"] = "calendar";
63
+ PluginType["VIDEO"] = "video";
64
+ PluginType["STORAGE"] = "storage";
65
+ PluginType["RESOURCE"] = "resource";
66
+ PluginType["BOOKING"] = "booking";
67
+ })(PluginType || (exports.PluginType = PluginType = {}));
68
+ //# sourceMappingURL=base-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-plugin.js","sourceRoot":"","sources":["../../src/types/base-plugin.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAkHH,2BAA2B;AAE3B,IAAY,UASX;AATD,WAAY,UAAU;IACpB,iCAAmB,CAAA;IACnB,2CAA6B,CAAA;IAC7B,mCAAqB,CAAA;IACrB,6BAAe,CAAA;IACf,iCAAmB,CAAA;IACnB,qCAAuB,CAAA;IACvB,mCAAqB,CAAA;IACrB,+BAAiB,CAAA;AACnB,CAAC,EATW,UAAU,0BAAV,UAAU,QASrB;AAoCD,mCAAmC;AAEnC,MAAsB,uBAAuB;IAA7C;QACY,WAAM,GAA2B,IAAI,CAAC;QACtC,gBAAW,GAAG,KAAK,CAAC;IAkChC,CAAC;IA5BC,KAAK,CAAC,UAAU,CAAC,MAAuB;QACtC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,OAAO;QACX,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,WAAW;QACf,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW;YAClD,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,wBAAwB;YAC9E,WAAW,EAAE,IAAI,IAAI,EAAE;SACxB,CAAC;IACJ,CAAC;IAES,iBAAiB;QACzB,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,UAAU,IAAI,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;IAES,SAAS;QACjB,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC,MAAO,CAAC;IACtB,CAAC;CACF;AApCD,0DAoCC;AACC,YAAY,CAAC,MAAM,EAAE,wBAAe,CAAC,CAAA;AAAE,OAAO,CAAC;AAC/C,qBAAqB,EAAE,CAAA;AAAE,MAAM,CAAC,CAAC,CAAC;AAClC,aAAa,EAAE,CAAA;AAAE,MAAM,CAAC;AA+C1B,2BAA2B;AAE3B,WAAY,UAAU;IACpB,iCAAmB,CAAA;IACnB,2CAA6B,CAAA;IAC7B,mCAAqB,CAAA;IACrB,6BAAe,CAAA;IACf,iCAAmB,CAAA;IACnB,mCAAqB,CAAA;IACrB,iCAAmB,CAAA;AACrB,CAAC,EARW,UAAU,0BAAV,UAAU,QAQrB"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @fileoverview Clean Connector Plugin Design - First Principles
3
+ */
4
+ export interface OperationType {
5
+ input: any;
6
+ output: any;
7
+ }
8
+ export interface ConnectorPlugin<TOperations extends Record<string, OperationType> = Record<string, OperationType>> {
9
+ getName(): string;
10
+ getVersion(): string;
11
+ operations: {
12
+ [K in keyof TOperations]: (input: TOperations[K]['input'], config: any) => Promise<TOperations[K]['output']>;
13
+ };
14
+ }
15
+ export declare abstract class AbstractConnectorPlugin<TOperations extends Record<string, OperationType> = Record<string, OperationType>> implements ConnectorPlugin<TOperations> {
16
+ abstract getName(): string;
17
+ abstract getVersion(): string;
18
+ abstract operations: {
19
+ [K in keyof TOperations]: (input: TOperations[K]['input'], config: any) => Promise<TOperations[K]['output']>;
20
+ };
21
+ }
22
+ //# sourceMappingURL=connector-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connector-plugin.d.ts","sourceRoot":"","sources":["../../src/types/connector-plugin.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,GAAG,CAAC;IACX,MAAM,EAAE,GAAG,CAAC;CACb;AAGD,MAAM,WAAW,eAAe,CAAC,WAAW,SAAS,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;IAChH,OAAO,IAAI,MAAM,CAAC;IAClB,UAAU,IAAI,MAAM,CAAC;IAGrB,UAAU,EAAE;SACT,CAAC,IAAI,MAAM,WAAW,GAAG,CACxB,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9B,MAAM,EAAE,GAAG,KACR,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;KACvC,CAAC;CACH;AAGD,8BAAsB,uBAAuB,CAAC,WAAW,SAAS,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAC7H,YAAW,eAAe,CAAC,WAAW,CAAC;IAEvC,QAAQ,CAAC,OAAO,IAAI,MAAM;IAC1B,QAAQ,CAAC,UAAU,IAAI,MAAM;IAC7B,QAAQ,CAAC,UAAU,EAAE;SAClB,CAAC,IAAI,MAAM,WAAW,GAAG,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;KAC7G,CAAC;CACH"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ /**
3
+ * @fileoverview Clean Connector Plugin Design - First Principles
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.AbstractConnectorPlugin = void 0;
7
+ // ===== ABSTRACT BASE =====
8
+ class AbstractConnectorPlugin {
9
+ }
10
+ exports.AbstractConnectorPlugin = AbstractConnectorPlugin;
11
+ //# sourceMappingURL=connector-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connector-plugin.js","sourceRoot":"","sources":["../../src/types/connector-plugin.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAsBH,4BAA4B;AAC5B,MAAsB,uBAAuB;CAQ5C;AARD,0DAQC"}
@@ -0,0 +1,223 @@
1
+ /**
2
+ * @fileoverview Core Engine Types
3
+ * @description Core interfaces for the ETO Framework Connector Engine
4
+ */
5
+ export type ConnectorID = string;
6
+ export type TaskID = string;
7
+ export type WorkflowID = string;
8
+ export type PluginName = string;
9
+ export interface ConnectorConfig {
10
+ connector_id: ConnectorID;
11
+ provider: string;
12
+ name: string;
13
+ config: Record<string, unknown>;
14
+ capabilities: ConnectorCapabilities;
15
+ enabled: boolean;
16
+ metadata?: Record<string, unknown>;
17
+ }
18
+ export interface ConnectorCapabilities {
19
+ health_check: boolean;
20
+ webhook_handling: boolean;
21
+ [capability: string]: boolean;
22
+ }
23
+ export interface ExecutionOptions {
24
+ connectorId?: ConnectorID;
25
+ selection?: ConnectorSelectionCriteria;
26
+ metadata?: Record<string, unknown>;
27
+ timeout?: number;
28
+ retries?: number;
29
+ priority?: number;
30
+ }
31
+ export interface ConnectorSelectionCriteria {
32
+ preferredProviders?: string[];
33
+ excludeProviders?: string[];
34
+ region?: string;
35
+ requireCapabilities?: string[];
36
+ [criteria: string]: unknown;
37
+ }
38
+ export type ConnectorSelectionStrategy = "round_robin" | "random" | "priority" | "least_loaded" | "fastest_response" | "custom";
39
+ export interface ConnectorResponse<T = unknown> {
40
+ success: boolean;
41
+ data?: T;
42
+ error?: ConnectorError;
43
+ metadata: {
44
+ connectorId: ConnectorID;
45
+ provider: string;
46
+ executionTime: number;
47
+ timestamp: Date;
48
+ retryCount?: number;
49
+ };
50
+ }
51
+ export interface ConnectorError {
52
+ code: string;
53
+ message: string;
54
+ details?: Record<string, unknown>;
55
+ retryable: boolean;
56
+ category: 'network' | 'authentication' | 'authorization' | 'validation' | 'rate_limit' | 'server_error' | 'unknown';
57
+ }
58
+ export interface PluginHealthStatus {
59
+ status: 'healthy' | 'degraded' | 'unhealthy';
60
+ message?: string;
61
+ lastChecked: Date;
62
+ responseTime?: number;
63
+ details?: Record<string, unknown>;
64
+ }
65
+ export interface SystemHealthStatus {
66
+ overall: 'healthy' | 'degraded' | 'unhealthy';
67
+ plugins: Record<string, PluginHealthStatus>;
68
+ timestamp: Date;
69
+ uptime: number;
70
+ }
71
+ export interface ConnectorMetrics {
72
+ connectorId: ConnectorID;
73
+ provider: string;
74
+ totalRequests: number;
75
+ successfulRequests: number;
76
+ failedRequests: number;
77
+ averageResponseTime: number;
78
+ lastRequestTime?: Date;
79
+ errorRate: number;
80
+ availability: number;
81
+ }
82
+ export interface OperationMetrics {
83
+ operationName: string;
84
+ domain: string;
85
+ totalExecutions: number;
86
+ successfulExecutions: number;
87
+ failedExecutions: number;
88
+ averageExecutionTime: number;
89
+ lastExecutionTime?: Date;
90
+ errorsByType: Record<string, number>;
91
+ }
92
+ export interface WebhookConfig {
93
+ url: string;
94
+ secret?: string;
95
+ events: string[];
96
+ headers?: Record<string, string>;
97
+ retries?: number;
98
+ timeout?: number;
99
+ }
100
+ export interface WebhookPayload {
101
+ id: string;
102
+ event: string;
103
+ timestamp: Date;
104
+ data: unknown;
105
+ source: {
106
+ connectorId: ConnectorID;
107
+ provider: string;
108
+ };
109
+ signature?: string;
110
+ }
111
+ export interface RateLimitConfig {
112
+ requestsPerSecond?: number;
113
+ requestsPerMinute?: number;
114
+ requestsPerHour?: number;
115
+ requestsPerDay?: number;
116
+ burstLimit?: number;
117
+ strategy: 'token_bucket' | 'sliding_window' | 'fixed_window';
118
+ }
119
+ export interface RateLimitStatus {
120
+ remaining: number;
121
+ resetTime: Date;
122
+ limit: number;
123
+ retryAfter?: number;
124
+ }
125
+ export interface CircuitBreakerConfig {
126
+ failureThreshold: number;
127
+ recoveryTimeout: number;
128
+ monitoringPeriod: number;
129
+ halfOpenMaxCalls: number;
130
+ }
131
+ export interface CircuitBreakerStatus {
132
+ state: 'closed' | 'open' | 'half_open';
133
+ failureCount: number;
134
+ lastFailureTime?: Date;
135
+ nextAttemptTime?: Date;
136
+ }
137
+ export interface RetryConfig {
138
+ maxAttempts: number;
139
+ baseDelay: number;
140
+ maxDelay: number;
141
+ backoffMultiplier: number;
142
+ jitter: boolean;
143
+ retryableErrors: string[];
144
+ }
145
+ export interface CacheConfig {
146
+ enabled: boolean;
147
+ ttl: number;
148
+ maxSize: number;
149
+ strategy: 'lru' | 'fifo' | 'ttl';
150
+ }
151
+ export interface CacheEntry<T = unknown> {
152
+ key: string;
153
+ value: T;
154
+ timestamp: Date;
155
+ ttl: number;
156
+ hits: number;
157
+ }
158
+ export interface AuditLog {
159
+ id: string;
160
+ timestamp: Date;
161
+ connectorId: ConnectorID;
162
+ operation: string;
163
+ input: unknown;
164
+ output?: unknown;
165
+ error?: ConnectorError;
166
+ executionTime: number;
167
+ userId?: string;
168
+ metadata?: Record<string, unknown>;
169
+ }
170
+ export interface LogLevel {
171
+ level: 'debug' | 'info' | 'warn' | 'error';
172
+ message: string;
173
+ timestamp: Date;
174
+ context?: Record<string, unknown>;
175
+ }
176
+ export interface PluginLifecycleEvents {
177
+ onInitialize?: (config: ConnectorConfig) => Promise<void>;
178
+ onDestroy?: () => Promise<void>;
179
+ onConfigUpdate?: (newConfig: ConnectorConfig) => Promise<void>;
180
+ onHealthCheck?: () => Promise<PluginHealthStatus>;
181
+ }
182
+ export interface ConnectorEngineConfig {
183
+ plugins: Record<string, unknown>;
184
+ operationGroups?: Record<string, unknown>;
185
+ defaultTimeout: number;
186
+ defaultRetries: number;
187
+ healthCheckInterval: number;
188
+ metricsEnabled: boolean;
189
+ auditEnabled: boolean;
190
+ caching: CacheConfig;
191
+ rateLimiting?: RateLimitConfig;
192
+ circuitBreaker?: CircuitBreakerConfig;
193
+ }
194
+ export type ConnectorSelectionStrategy = "round_robin" | "first_available" | "weighted" | "custom";
195
+ export interface PluginHealthStatus {
196
+ status: 'healthy' | 'degraded' | 'unhealthy';
197
+ lastChecked: Date;
198
+ details?: any;
199
+ errors?: string[];
200
+ }
201
+ export interface WorkflowContext {
202
+ executionId: string;
203
+ stepId?: string;
204
+ metadata?: Record<string, any>;
205
+ }
206
+ export interface ConnectorError {
207
+ code: string;
208
+ message: string;
209
+ details?: any;
210
+ retryable?: boolean;
211
+ }
212
+ export interface ConnectorResponse<T = any> {
213
+ success: boolean;
214
+ data?: T;
215
+ error?: ConnectorError;
216
+ metadata?: {
217
+ connectorId: ConnectorID;
218
+ provider: string;
219
+ executionTime?: number;
220
+ requestId?: string;
221
+ };
222
+ }
223
+ //# sourceMappingURL=engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/types/engine.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AACjC,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAC5B,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAChC,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAIhC,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,WAAW,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,YAAY,EAAE,qBAAqB,CAAC;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,qBAAqB;IAEpC,YAAY,EAAE,OAAO,CAAC;IACtB,gBAAgB,EAAE,OAAO,CAAC;IAG1B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B;AAID,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,SAAS,CAAC,EAAE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AC;CACrB;AAED,MAAM,WAAW,iBAAiB,CAAC,CAAC,GAAG,GAAG;IACxC,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,QAAQ,CAAC,EAAE;QACT,WAAW,EAAE,WAAW,CAAC;QACzB,QAAQ,EAAE,MAAM,CAAC;QACjB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * @fileoverview Core Engine Types
4
+ * @description Core interfaces for the ETO Framework Connector Engine
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=engine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.js","sourceRoot":"","sources":["../../src/types/engine.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @fileoverview Clean Connector Engine Types
3
+ */
4
+ export { type ConnectorPlugin, type OperationType, AbstractConnectorPlugin } from "./connector-plugin";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,aAAa,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ /**
3
+ * @fileoverview Clean Connector Engine Types
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.AbstractConnectorPlugin = void 0;
7
+ var connector_plugin_1 = require("./connector-plugin");
8
+ Object.defineProperty(exports, "AbstractConnectorPlugin", { enumerable: true, get: function () { return connector_plugin_1.AbstractConnectorPlugin; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,uDAAuG;AAApD,2HAAA,uBAAuB,OAAA"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * @fileoverview Operation Groups Types
3
+ * @description Types for operation group configuration in connector engine
4
+ */
5
+ export interface OperationGroupsConfig {
6
+ [groupName: string]: {
7
+ domains: string[];
8
+ operations: string[];
9
+ options: {
10
+ behavior: 'execute_all' | 'route_by_domain' | 'first_success';
11
+ connectorId?: string;
12
+ priority?: number;
13
+ timeout?: number;
14
+ retries?: number;
15
+ };
16
+ };
17
+ }
18
+ export interface OperationGroupExecutionOptions {
19
+ behavior: 'execute_all' | 'route_by_domain' | 'first_success';
20
+ connectorId?: string;
21
+ priority?: number;
22
+ timeout?: number;
23
+ retries?: number;
24
+ }
25
+ export interface OperationGroupResult<T = unknown> {
26
+ groupName: string;
27
+ executedDomains: string[];
28
+ results: Record<string, T>;
29
+ metadata: {
30
+ behavior: string;
31
+ connectorId?: string;
32
+ executionTime: number;
33
+ errors?: Record<string, Error>;
34
+ domainSource?: 'input' | 'options' | 'group_default';
35
+ };
36
+ }
37
+ export type ExtractGroupNames<T extends OperationGroupsConfig> = keyof T;
38
+ export type ExtractGroupOperations<T extends OperationGroupsConfig, K extends keyof T> = T[K]['operations'][number];
39
+ export type ExtractGroupDomains<T extends OperationGroupsConfig, K extends keyof T> = T[K]['domains'][number];
40
+ export type InferOperationGroupInput<TInferredConnectorTypes extends Record<string, Record<string, {
41
+ input: unknown;
42
+ output: unknown;
43
+ }>>, TOperationGroups extends OperationGroupsConfig, TGroupName extends keyof TOperationGroups, TOperation extends string> = TOperationGroups[TGroupName]['options']['behavior'] extends 'route_by_domain' ? {
44
+ domain?: ExtractGroupDomains<TOperationGroups, TGroupName>;
45
+ } & UnionToIntersection<{
46
+ [Domain in ExtractGroupDomains<TOperationGroups, TGroupName>]: Domain extends keyof TInferredConnectorTypes ? TOperation extends keyof TInferredConnectorTypes[Domain] ? TInferredConnectorTypes[Domain][TOperation]['input'] : unknown : unknown;
47
+ }[ExtractGroupDomains<TOperationGroups, TGroupName>]> : UnionToIntersection<{
48
+ [Domain in ExtractGroupDomains<TOperationGroups, TGroupName>]: Domain extends keyof TInferredConnectorTypes ? TOperation extends keyof TInferredConnectorTypes[Domain] ? TInferredConnectorTypes[Domain][TOperation]['input'] : unknown : unknown;
49
+ }[ExtractGroupDomains<TOperationGroups, TGroupName>]>;
50
+ export type InferOperationGroupOutput<TInferredConnectorTypes extends Record<string, Record<string, {
51
+ input: unknown;
52
+ output: unknown;
53
+ }>>, TOperationGroups extends OperationGroupsConfig, TGroupName extends keyof TOperationGroups, TOperation extends string> = OperationGroupResult<UnionToIntersection<{
54
+ [Domain in ExtractGroupDomains<TOperationGroups, TGroupName>]: Domain extends keyof TInferredConnectorTypes ? TOperation extends keyof TInferredConnectorTypes[Domain] ? TInferredConnectorTypes[Domain][TOperation]['output'] : unknown : unknown;
55
+ }[ExtractGroupDomains<TOperationGroups, TGroupName>]>>;
56
+ type UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
57
+ export interface OperationGroupBuilder<T extends OperationGroupsConfig = {}> {
58
+ addGroup<TGroupName extends string, TDomains extends readonly string[], TOperations extends readonly string[]>(groupName: TGroupName, config: {
59
+ domains: TDomains;
60
+ operations: TOperations;
61
+ options: OperationGroupExecutionOptions;
62
+ }): OperationGroupBuilder<T & Record<TGroupName, {
63
+ domains: TDomains[number][];
64
+ operations: TOperations[number][];
65
+ options: OperationGroupExecutionOptions;
66
+ }>>;
67
+ build(): T;
68
+ }
69
+ export declare function createOperationGroupBuilder(): OperationGroupBuilder<{}>;
70
+ export interface OperationGroupValidationResult {
71
+ valid: boolean;
72
+ errors: string[];
73
+ warnings: string[];
74
+ }
75
+ export declare function validateOperationGroups<T extends OperationGroupsConfig>(groups: T, availableDomains: string[], domainOperations: Record<string, string[]>): OperationGroupValidationResult;
76
+ export type InferOperationGroupOutput<TInferredConnectorTypes extends Record<string, any>, TOperationGroups extends OperationGroupsConfig, TGroupName extends keyof TOperationGroups, TOperation extends string> = TOperationGroups[TGroupName]['options']['behavior'] extends 'route_by_domain' ? any : OperationGroupResult<any>;
77
+ export {};
78
+ //# sourceMappingURL=operation-groups.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-groups.d.ts","sourceRoot":"","sources":["../../src/types/operation-groups.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,WAAW,qBAAqB;IACpC,CAAC,SAAS,EAAE,MAAM,GAAG;QACnB,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB,UAAU,EAAE,MAAM,EAAE,CAAC;QACrB,OAAO,EAAE;YACP,QAAQ,EAAE,aAAa,GAAG,iBAAiB,GAAG,eAAe,CAAC;YAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;YAClB,OAAO,CAAC,EAAE,MAAM,CAAC;YACjB,OAAO,CAAC,EAAE,MAAM,CAAC;SAClB,CAAC;KACH,CAAC;CACH;AAID,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,EAAE,aAAa,GAAG,iBAAiB,GAAG,eAAe,CAAC;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAID,MAAM,WAAW,oBAAoB,CAAC,CAAC,GAAG,OAAO;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC3B,QAAQ,EAAE;QACR,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,aAAa,EAAE,MAAM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 -0,0 +1,60 @@
1
+ "use strict";
2
+ /**
3
+ * @fileoverview Operation Groups Types
4
+ * @description Types for operation group configuration in connector engine
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.createOperationGroupBuilder = createOperationGroupBuilder;
8
+ exports.validateOperationGroups = validateOperationGroups;
9
+ function createOperationGroupBuilder() {
10
+ const groups = {};
11
+ return {
12
+ addGroup(groupName, config) {
13
+ groups[groupName] = config;
14
+ return this;
15
+ },
16
+ build() {
17
+ return groups;
18
+ }
19
+ };
20
+ }
21
+ function validateOperationGroups(groups, availableDomains, domainOperations) {
22
+ const errors = [];
23
+ const warnings = [];
24
+ for (const [groupName, groupConfig] of Object.entries(groups)) {
25
+ // Validate domains
26
+ for (const domain of groupConfig.domains) {
27
+ if (!availableDomains.includes(domain)) {
28
+ errors.push(`Group '${groupName}' references unknown domain '${domain}'`);
29
+ }
30
+ }
31
+ // Validate operations
32
+ for (const domain of groupConfig.domains) {
33
+ if (domainOperations[domain]) {
34
+ for (const operation of groupConfig.operations) {
35
+ if (!domainOperations[domain].includes(operation)) {
36
+ errors.push(`Group '${groupName}' references unknown operation '${operation}' for domain '${domain}'`);
37
+ }
38
+ }
39
+ }
40
+ }
41
+ // Validate behavior-specific requirements
42
+ if (groupConfig.options.behavior === 'route_by_domain' && groupConfig.domains.length === 1) {
43
+ warnings.push(`Group '${groupName}' uses 'route_by_domain' behavior with only one domain`);
44
+ }
45
+ if (groupConfig.options.behavior === 'first_success' && groupConfig.domains.length === 1) {
46
+ warnings.push(`Group '${groupName}' uses 'first_success' behavior with only one domain`);
47
+ }
48
+ }
49
+ return {
50
+ valid: errors.length === 0,
51
+ errors,
52
+ warnings
53
+ };
54
+ }
55
+ {
56
+ domain ? : ExtractGroupDomains; // ✅ Optional domain
57
+ }
58
+ & (UnionToIntersection);
59
+ UnionToIntersection;
60
+ //# sourceMappingURL=operation-groups.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-groups.js","sourceRoot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ACH,CAAC;QACH,CAAC;QAED,0CAA0C;QAC1C,IAAI,WAAW,CAAC,OAAO,CAAC,QAAQ,KAAK,iBAAiB,IAAI,WAAW,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3F,QAAQ,CAAC,IAAI,CAAC,UAAU,SAAS,wDAAwD,CAAC,CAAC;QAC7F,CAAC;QAED,IAAI,WAAW,CAAC,OAAO,CAAC,QAAQ,KAAK,eAAe,IAAI,WAAW,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzF,QAAQ,CAAC,IAAI,CAAC,UAAU,SAAS,sDAAsD,CAAC,CAAC;QAC3F,CAAC;IACH,CAAC;IAED,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC;QAC1B,MAAM;QACN,QAAQ;KACT,CAAC;AACJ,CAAC;AAEG,CAAC;IACC,MAAM,CAAA,CAAC,CAAA,CAAA,CAAC,CAAC,mBAAiD,CAAC,CAAC,oBAAoB;AAClF,CAAC;AAAC,AAAD,IAAG,mBAQH,CAAA,CAAA;AAED,mBAQC,CAAC"}
@@ -0,0 +1,116 @@
1
+ /**
2
+ * @fileoverview Generic Routing Configuration (Not Payment-Specific)
3
+ */
4
+ export interface RoutingContext {
5
+ operation?: string;
6
+ domain?: string;
7
+ region?: string;
8
+ country?: string;
9
+ userId?: string;
10
+ tenantId?: string;
11
+ priority?: 'low' | 'normal' | 'high';
12
+ resourceType?: string;
13
+ resourceSize?: number;
14
+ metadata?: Record<string, any>;
15
+ forceConnector?: string;
16
+ skipRouting?: boolean;
17
+ }
18
+ export interface RoutingRule {
19
+ name: string;
20
+ description?: string;
21
+ conditions: {
22
+ resourceType?: string[];
23
+ resourceSize?: {
24
+ min?: number;
25
+ max?: number;
26
+ };
27
+ region?: string[];
28
+ country?: string[];
29
+ tenantId?: string[];
30
+ priority?: string[];
31
+ timeOfDay?: {
32
+ start?: string;
33
+ end?: string;
34
+ };
35
+ dayOfWeek?: string[];
36
+ customFields?: Record<string, any>;
37
+ metadata?: Record<string, any>;
38
+ };
39
+ connectors: ConnectorChoice[];
40
+ enabled: boolean;
41
+ created_at: string;
42
+ modified_at: string;
43
+ }
44
+ export interface ConnectorChoice {
45
+ connector: string;
46
+ merchant_connector_id?: string;
47
+ priority?: number;
48
+ weight?: number;
49
+ maxConcurrency?: number;
50
+ maxResourceSize?: number;
51
+ supportedRegions?: string[];
52
+ supportedCountries?: string[];
53
+ }
54
+ export type RoutingAlgorithm = 'priority' | 'volume_split' | 'advanced' | 'cost_optimization' | 'performance' | 'load_balancing' | 'region_based';
55
+ export interface RoutingConfig {
56
+ profile_id: string;
57
+ name: string;
58
+ description?: string;
59
+ algorithm: {
60
+ type: RoutingAlgorithm;
61
+ data: RoutingRule[];
62
+ };
63
+ fallback_routing?: {
64
+ enabled: boolean;
65
+ connectors: string[];
66
+ };
67
+ circuit_breaker?: {
68
+ failure_threshold: number;
69
+ recovery_time_seconds: number;
70
+ max_retries: number;
71
+ };
72
+ created_at: string;
73
+ modified_at: string;
74
+ version: number;
75
+ }
76
+ export interface ConnectorMetrics {
77
+ connector_name: string;
78
+ success_rate: number;
79
+ total_requests: number;
80
+ successful_requests: number;
81
+ failed_requests: number;
82
+ total_volume?: number;
83
+ successful_payments?: number;
84
+ failed_payments?: number;
85
+ total_amount_processed?: number;
86
+ avg_ticket_size?: number;
87
+ avg_response_time_ms: number;
88
+ p95_response_time_ms: number;
89
+ total_resources_processed: number;
90
+ avg_resource_size: number;
91
+ window_start: string;
92
+ window_end: string;
93
+ circuit_breaker_status: 'closed' | 'open' | 'half_open';
94
+ consecutive_failures: number;
95
+ last_failure_time?: string;
96
+ }
97
+ export interface RoutingDecision {
98
+ selected_connector: string;
99
+ merchant_connector_id?: string;
100
+ algorithm_used: RoutingAlgorithm;
101
+ rule_applied?: string;
102
+ fallback_used: boolean;
103
+ decision_timestamp: string;
104
+ routing_profile_id: string;
105
+ alternative_connectors: string[];
106
+ }
107
+ export interface RoutingEngine {
108
+ route(context: RoutingContext, config: RoutingConfig): Promise<RoutingDecision>;
109
+ updateMetrics(connectorId: string, success: boolean, responseTime: number, resourceSize?: number): Promise<void>;
110
+ getConnectorHealth(connectorId: string): Promise<ConnectorMetrics>;
111
+ validateConfig(config: RoutingConfig): Promise<{
112
+ valid: boolean;
113
+ errors: string[];
114
+ }>;
115
+ }
116
+ //# sourceMappingURL=routing-config.d.ts.map