@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.
- package/.turbo/turbo-build.log +4 -0
- package/CHANGELOG.md +1 -0
- package/LICENSE +21 -0
- package/README.md +253 -0
- package/dist/engine/clean-connector-engine.d.ts +81 -0
- package/dist/engine/clean-connector-engine.d.ts.map +1 -0
- package/dist/engine/clean-connector-engine.js +350 -0
- package/dist/engine/clean-connector-engine.js.map +1 -0
- package/dist/engine/connector-engine-impl.d.ts +73 -0
- package/dist/engine/connector-engine-impl.d.ts.map +1 -0
- package/dist/engine/connector-engine-impl.js +332 -0
- package/dist/engine/connector-engine-impl.js.map +1 -0
- package/dist/engine/connector-engine.d.ts +54 -0
- package/dist/engine/connector-engine.d.ts.map +1 -0
- package/dist/engine/connector-engine.js +694 -0
- package/dist/engine/connector-engine.js.map +1 -0
- package/dist/engine/index.d.ts +7 -0
- package/dist/engine/index.d.ts.map +1 -0
- package/dist/engine/index.js +10 -0
- package/dist/engine/index.js.map +1 -0
- package/dist/engine/routing-engine.d.ts +26 -0
- package/dist/engine/routing-engine.d.ts.map +1 -0
- package/dist/engine/routing-engine.js +329 -0
- package/dist/engine/routing-engine.js.map +1 -0
- package/dist/examples/booking-connector-example.d.ts +7 -0
- package/dist/examples/booking-connector-example.d.ts.map +1 -0
- package/dist/examples/booking-connector-example.js +221 -0
- package/dist/examples/booking-connector-example.js.map +1 -0
- package/dist/examples/dynamic-methods-example.d.ts +7 -0
- package/dist/examples/dynamic-methods-example.d.ts.map +1 -0
- package/dist/examples/dynamic-methods-example.js +163 -0
- package/dist/examples/dynamic-methods-example.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/types/base-plugin.d.ts +170 -0
- package/dist/types/base-plugin.d.ts.map +1 -0
- package/dist/types/base-plugin.js +68 -0
- package/dist/types/base-plugin.js.map +1 -0
- package/dist/types/connector-plugin.d.ts +22 -0
- package/dist/types/connector-plugin.d.ts.map +1 -0
- package/dist/types/connector-plugin.js +11 -0
- package/dist/types/connector-plugin.js.map +1 -0
- package/dist/types/engine.d.ts +223 -0
- package/dist/types/engine.d.ts.map +1 -0
- package/dist/types/engine.js +7 -0
- package/dist/types/engine.js.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +9 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/operation-groups.d.ts +78 -0
- package/dist/types/operation-groups.d.ts.map +1 -0
- package/dist/types/operation-groups.js +60 -0
- package/dist/types/operation-groups.js.map +1 -0
- package/dist/types/routing-config.d.ts +116 -0
- package/dist/types/routing-config.d.ts.map +1 -0
- package/dist/types/routing-config.js +6 -0
- package/dist/types/routing-config.js.map +1 -0
- package/dist/utils/create-connector-engine.d.ts +31 -0
- package/dist/utils/create-connector-engine.d.ts.map +1 -0
- package/dist/utils/create-connector-engine.js +30 -0
- package/dist/utils/create-connector-engine.js.map +1 -0
- package/examples/booking-example.ts +168 -0
- package/examples/booking-test.ts +231 -0
- package/hyperswitch-example.ts +263 -0
- package/jest.config.js +2 -0
- package/package.json +54 -0
- package/src/engine/clean-connector-engine.ts +726 -0
- package/src/engine/index.ts +13 -0
- package/src/engine/routing-engine.ts +394 -0
- package/src/index.ts +32 -0
- package/src/types/connector-plugin.ts +34 -0
- package/src/types/index.ts +5 -0
- package/src/types/routing-config.ts +196 -0
- package/tsconfig.json +3 -0
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Type-Safe Connector Engine
|
|
4
|
+
* @description ETO Framework core connector engine with compile-time type safety
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ConnectorEngine = ConnectorEngine;
|
|
8
|
+
const workflows_sdk_1 = require("@etohq/framework/workflows-sdk");
|
|
9
|
+
// ===== TYPE-SAFE CONNECTOR ENGINE IMPLEMENTATION =====
|
|
10
|
+
class ConnectorEngineImpl {
|
|
11
|
+
constructor(connectorTypes) {
|
|
12
|
+
this.connectorTypes = connectorTypes;
|
|
13
|
+
this.connectors = new Map();
|
|
14
|
+
this.plugins = new Map();
|
|
15
|
+
this.generatedWorkflows = new Map();
|
|
16
|
+
this.selectionStrategy = "round_robin";
|
|
17
|
+
this.pluginRegistry = this.createPluginRegistry();
|
|
18
|
+
this.generateDynamicMethods();
|
|
19
|
+
}
|
|
20
|
+
setSelectionStrategy(strategy) {
|
|
21
|
+
this.selectionStrategy = strategy;
|
|
22
|
+
}
|
|
23
|
+
getConnectors() {
|
|
24
|
+
return Array.from(this.connectors.values());
|
|
25
|
+
}
|
|
26
|
+
getConnector(connectorId) {
|
|
27
|
+
return this.connectors.get(connectorId) || null;
|
|
28
|
+
}
|
|
29
|
+
// ===== DYNAMIC METHOD GENERATION =====
|
|
30
|
+
generateDynamicMethods() {
|
|
31
|
+
for (const [connectorType, operations] of Object.entries(this.connectorTypes)) {
|
|
32
|
+
for (const operationName of Object.keys(operations)) {
|
|
33
|
+
const methodName = `execute${this.capitalize(connectorType)}${this.capitalize(operationName)}`;
|
|
34
|
+
this[methodName] = (input, options) => {
|
|
35
|
+
// Select connector based on options or auto-select
|
|
36
|
+
const connectorId = options?.connectorId ||
|
|
37
|
+
this.selectConnector(connectorType, operationName, options?.selection);
|
|
38
|
+
// Get the workflow from registry
|
|
39
|
+
// createWorkflow already returns a properly typed ReturnWorkflow
|
|
40
|
+
const workflow = this.getWorkflow(connectorType, operationName, connectorId);
|
|
41
|
+
// Return the workflow directly - it's already a complete ReturnWorkflow
|
|
42
|
+
// The workflow function, run(), runAsStep(), etc. are all provided by createWorkflow
|
|
43
|
+
return workflow;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
capitalize(str) {
|
|
49
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
50
|
+
}
|
|
51
|
+
// ===== CONNECTOR LIFECYCLE =====
|
|
52
|
+
async installConnector(provider, config) {
|
|
53
|
+
const plugin = this.plugins.get(provider);
|
|
54
|
+
if (!plugin) {
|
|
55
|
+
throw new Error(`Plugin not found for provider: ${provider}`);
|
|
56
|
+
}
|
|
57
|
+
await plugin.initialize(config);
|
|
58
|
+
this.connectors.set(config.connector_id, config);
|
|
59
|
+
// Generate workflows for this connector
|
|
60
|
+
this.generateWorkflowsForConnector(config.connector_id, provider, plugin);
|
|
61
|
+
return config.connector_id;
|
|
62
|
+
}
|
|
63
|
+
registerPlugin(provider, plugin) {
|
|
64
|
+
this.plugins.set(provider, plugin);
|
|
65
|
+
}
|
|
66
|
+
async uninstallConnector(connectorId) {
|
|
67
|
+
const config = this.connectors.get(connectorId);
|
|
68
|
+
if (!config) {
|
|
69
|
+
throw new Error(`Connector not found: ${connectorId}`);
|
|
70
|
+
}
|
|
71
|
+
const plugin = this.plugins.get(config.provider);
|
|
72
|
+
if (plugin) {
|
|
73
|
+
await plugin.destroy();
|
|
74
|
+
}
|
|
75
|
+
this.connectors.delete(connectorId);
|
|
76
|
+
// Remove generated workflows
|
|
77
|
+
for (const [key] of this.generatedWorkflows) {
|
|
78
|
+
if (key.includes(connectorId)) {
|
|
79
|
+
this.generatedWorkflows.delete(key);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
// ===== CONNECTOR SELECTION =====
|
|
84
|
+
selectConnector(connectorType, operation, criteria) {
|
|
85
|
+
const availableConnectors = Array.from(this.connectors.values()).filter((connector) => {
|
|
86
|
+
if (!connector.enabled)
|
|
87
|
+
return false;
|
|
88
|
+
const plugin = this.plugins.get(connector.provider);
|
|
89
|
+
if (!plugin)
|
|
90
|
+
return false;
|
|
91
|
+
// Check if plugin supports the operation
|
|
92
|
+
if (this.isTypedPlugin(plugin)) {
|
|
93
|
+
const operations = plugin.getSupportedOperations();
|
|
94
|
+
if (!operations[operation])
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
// Apply selection criteria
|
|
98
|
+
if (criteria?.preferredProviders &&
|
|
99
|
+
!criteria.preferredProviders.includes(connector.provider)) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
if (criteria?.excludeProviders &&
|
|
103
|
+
criteria.excludeProviders.includes(connector.provider)) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
if (criteria?.region &&
|
|
107
|
+
connector.metadata?.region !== criteria.region) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
if (criteria?.requireCapabilities) {
|
|
111
|
+
for (const capability of criteria.requireCapabilities) {
|
|
112
|
+
if (!connector.capabilities[capability]) {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return true;
|
|
118
|
+
});
|
|
119
|
+
if (availableConnectors.length === 0) {
|
|
120
|
+
throw new Error(`No available connectors for ${connectorType}.${operation}`);
|
|
121
|
+
}
|
|
122
|
+
// Apply selection strategy
|
|
123
|
+
switch (this.selectionStrategy) {
|
|
124
|
+
case "round_robin":
|
|
125
|
+
return availableConnectors[Math.floor(Math.random() * availableConnectors.length)].connector_id;
|
|
126
|
+
case "priority":
|
|
127
|
+
// todo fix
|
|
128
|
+
return availableConnectors[0].connector_id;
|
|
129
|
+
default:
|
|
130
|
+
return availableConnectors[0].connector_id;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
// ===== WORKFLOW GENERATION =====
|
|
134
|
+
generateWorkflowsForConnector(connectorId, provider, plugin) {
|
|
135
|
+
for (const [connectorType, operations] of Object.entries(this.connectorTypes)) {
|
|
136
|
+
for (const operationName of Object.keys(operations)) {
|
|
137
|
+
// Check if plugin supports this operation
|
|
138
|
+
if (this.pluginSupportsOperation(plugin, operationName)) {
|
|
139
|
+
const workflowKey = `${connectorType}-${connectorId}-${operationName}`;
|
|
140
|
+
const workflow = this.createWorkflowForOperation(connectorId, provider, connectorType, operationName, plugin);
|
|
141
|
+
this.generatedWorkflows.set(workflowKey, workflow);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
createWorkflowForOperation(connectorId, provider, connectorType, operationName, plugin) {
|
|
147
|
+
// Create ETO step for this operation
|
|
148
|
+
const step = (0, workflows_sdk_1.createStep)(`${provider}-${operationName}`, async (input, { container }) => {
|
|
149
|
+
const config = this.connectors.get(connectorId);
|
|
150
|
+
if (!config) {
|
|
151
|
+
throw new Error(`Connector not found: ${connectorId}`);
|
|
152
|
+
}
|
|
153
|
+
let result;
|
|
154
|
+
if (this.isTypedPlugin(plugin)) {
|
|
155
|
+
result = await plugin.executeOperation(config, operationName, input.data);
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
// Fallback for non-typed plugins
|
|
159
|
+
const pluginMethod = plugin[operationName];
|
|
160
|
+
if (typeof pluginMethod === "function") {
|
|
161
|
+
const rawResult = await pluginMethod.call(plugin, config, input.data);
|
|
162
|
+
result = {
|
|
163
|
+
success: true,
|
|
164
|
+
data: rawResult,
|
|
165
|
+
metadata: {
|
|
166
|
+
connectorId,
|
|
167
|
+
provider: config.provider,
|
|
168
|
+
executionTime: 0,
|
|
169
|
+
timestamp: new Date(),
|
|
170
|
+
retryCount: 0,
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
throw new Error(`Operation ${operationName} not supported by plugin ${provider}`);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
if (!result.success) {
|
|
179
|
+
throw new Error(result.error?.message || `Operation ${operationName} failed`);
|
|
180
|
+
}
|
|
181
|
+
return new workflows_sdk_1.StepResponse(result.data, {
|
|
182
|
+
connectorId,
|
|
183
|
+
operation: operationName,
|
|
184
|
+
result: result.data,
|
|
185
|
+
});
|
|
186
|
+
}, async (compensationData, { container }) => {
|
|
187
|
+
// Auto-generated compensation
|
|
188
|
+
console.log(`Compensating ${provider}-${operationName}:`, compensationData);
|
|
189
|
+
// Check if plugin has custom compensation
|
|
190
|
+
const compensationFn = plugin[`${operationName}_compensate`];
|
|
191
|
+
if (compensationFn && typeof compensationFn === "function") {
|
|
192
|
+
await compensationFn.call(plugin, compensationData, { container });
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
// Create ETO workflow that wraps the step
|
|
196
|
+
const workflow = (0, workflows_sdk_1.createWorkflow)(`${provider}-${operationName}-workflow`, (input) => {
|
|
197
|
+
const config = this.connectors.get(connectorId);
|
|
198
|
+
const stepInput = {
|
|
199
|
+
config,
|
|
200
|
+
data: input,
|
|
201
|
+
};
|
|
202
|
+
const result = step(stepInput);
|
|
203
|
+
return new workflows_sdk_1.WorkflowResponse(result);
|
|
204
|
+
});
|
|
205
|
+
return workflow;
|
|
206
|
+
}
|
|
207
|
+
// ===== WORKFLOW ACCESS =====
|
|
208
|
+
getWorkflow(connectorType, operation, connectorId) {
|
|
209
|
+
const selectedConnectorId = connectorId || this.selectConnector(connectorType, operation);
|
|
210
|
+
const workflowKey = `${connectorType}-${selectedConnectorId}-${operation}`;
|
|
211
|
+
const workflow = this.generatedWorkflows.get(workflowKey);
|
|
212
|
+
if (!workflow) {
|
|
213
|
+
throw new Error(`Workflow not found for ${connectorType}.${operation} with connector ${selectedConnectorId}`);
|
|
214
|
+
}
|
|
215
|
+
return workflow;
|
|
216
|
+
}
|
|
217
|
+
// ===== HEALTH MONITORING =====
|
|
218
|
+
async getSystemHealth() {
|
|
219
|
+
const connectors = {};
|
|
220
|
+
let healthyCount = 0;
|
|
221
|
+
let totalCount = 0;
|
|
222
|
+
for (const [connectorId, config] of this.connectors) {
|
|
223
|
+
totalCount++;
|
|
224
|
+
const plugin = this.plugins.get(config.provider);
|
|
225
|
+
if (plugin) {
|
|
226
|
+
try {
|
|
227
|
+
connectors[connectorId] = await plugin.healthCheck();
|
|
228
|
+
if (connectors[connectorId].status === "healthy") {
|
|
229
|
+
healthyCount++;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
catch (error) {
|
|
233
|
+
connectors[connectorId] = {
|
|
234
|
+
status: "unhealthy",
|
|
235
|
+
lastChecked: new Date(),
|
|
236
|
+
errors: [error.message],
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
connectors[connectorId] = {
|
|
242
|
+
status: "unhealthy",
|
|
243
|
+
lastChecked: new Date(),
|
|
244
|
+
errors: ["Plugin not found"],
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
let overall = "healthy";
|
|
249
|
+
if (healthyCount === 0 && totalCount > 0) {
|
|
250
|
+
overall = "unhealthy";
|
|
251
|
+
}
|
|
252
|
+
else if (healthyCount < totalCount) {
|
|
253
|
+
overall = "degraded";
|
|
254
|
+
}
|
|
255
|
+
return { overall, connectors };
|
|
256
|
+
}
|
|
257
|
+
// ===== UTILITY METHODS =====
|
|
258
|
+
isTypedPlugin(plugin) {
|
|
259
|
+
return "getSupportedOperations" in plugin && "executeOperation" in plugin;
|
|
260
|
+
}
|
|
261
|
+
pluginSupportsOperation(plugin, operationName) {
|
|
262
|
+
if (this.isTypedPlugin(plugin)) {
|
|
263
|
+
const operations = plugin.getSupportedOperations();
|
|
264
|
+
return operationName in operations;
|
|
265
|
+
}
|
|
266
|
+
// For non-typed plugins, check if method exists
|
|
267
|
+
return typeof plugin[operationName] === "function";
|
|
268
|
+
}
|
|
269
|
+
createPluginRegistry() {
|
|
270
|
+
const registry = new Map();
|
|
271
|
+
return {
|
|
272
|
+
registerPlugin: (pluginType, provider, factory) => {
|
|
273
|
+
if (!registry.has(pluginType)) {
|
|
274
|
+
registry.set(pluginType, new Map());
|
|
275
|
+
}
|
|
276
|
+
registry.get(pluginType).set(provider, factory);
|
|
277
|
+
},
|
|
278
|
+
getPlugin: (pluginType, provider) => {
|
|
279
|
+
return registry.get(pluginType)?.get(provider) || null;
|
|
280
|
+
},
|
|
281
|
+
listPlugins: (pluginType) => {
|
|
282
|
+
const result = [];
|
|
283
|
+
if (pluginType) {
|
|
284
|
+
const providers = registry.get(pluginType);
|
|
285
|
+
if (providers) {
|
|
286
|
+
for (const [provider, factory] of providers) {
|
|
287
|
+
result.push({ pluginType, provider, factory });
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
for (const [type, providers] of registry) {
|
|
293
|
+
for (const [provider, factory] of providers) {
|
|
294
|
+
result.push({ pluginType: type, provider, factory });
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
return result;
|
|
299
|
+
},
|
|
300
|
+
register: function (name, plugin) {
|
|
301
|
+
throw new Error("Function not implemented.");
|
|
302
|
+
},
|
|
303
|
+
unregister: function (name) {
|
|
304
|
+
throw new Error("Function not implemented.");
|
|
305
|
+
},
|
|
306
|
+
get: function (name) {
|
|
307
|
+
throw new Error("Function not implemented.");
|
|
308
|
+
},
|
|
309
|
+
list: function () {
|
|
310
|
+
throw new Error("Function not implemented.");
|
|
311
|
+
},
|
|
312
|
+
has: function (name) {
|
|
313
|
+
throw new Error("Function not implemented.");
|
|
314
|
+
},
|
|
315
|
+
validate: function (plugin) {
|
|
316
|
+
throw new Error("Function not implemented.");
|
|
317
|
+
},
|
|
318
|
+
getOperations: function (pluginName) {
|
|
319
|
+
throw new Error("Function not implemented.");
|
|
320
|
+
},
|
|
321
|
+
getPluginInfo: function (name) {
|
|
322
|
+
throw new Error("Function not implemented.");
|
|
323
|
+
},
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
// ===== CONFIGURATION =====
|
|
328
|
+
// ===== TYPE-SAFE CONNECTOR ENGINE FACTORY =====
|
|
329
|
+
function ConnectorEngine(connectorTypes) {
|
|
330
|
+
return new ConnectorEngineImpl(connectorTypes);
|
|
331
|
+
}
|
|
332
|
+
//# sourceMappingURL=connector-engine-impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connector-engine-impl.js","sourceRoot":"","sources":["../../src/engine/connector-engine-impl.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAmkBM,0CAAe;AAhjBxB,kEAOuC;AA0DvC,wDAAwD;AAExD,MAAM,mBAAmB;IASvB,YAAoB,cAA+B;QAA/B,mBAAc,GAAd,cAAc,CAAiB;QAN3C,eAAU,GAAsC,IAAI,GAAG,EAAE,CAAA;QACzD,YAAO,GAAqC,IAAI,GAAG,EAAE,CAAA;QAErD,uBAAkB,GAAqB,IAAI,GAAG,EAAE,CAAA;QAChD,sBAAiB,GAA+B,aAAa,CAAA;QAGnE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAA;QACjD,IAAI,CAAC,sBAAsB,EAAE,CAAA;IAC/B,CAAC;IACD,oBAAoB,CAAC,QAAoC;QACvD,IAAI,CAAC,iBAAiB,GAAG,QAAQ,CAAA;IACnC,CAAC;IACD,aAAa;QACX,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAA;IAC7C,CAAC;IACD,YAAY,CAAC,WAAwB;QACnC,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,IAAI,CAAA;IACjD,CAAC;IAED,wCAAwC;IAEhC,sBAAsB;QAC5B,KAAK,MAAM,CAAC,aAAa,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CACtD,IAAI,CAAC,cAAc,CACpB,EAAE,CAAC;YACF,KAAK,MAAM,aAAa,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;gBACpD,MAAM,UAAU,GAAG,UAAU,IAAI,CAAC,UAAU,CAC1C,aAAa,CACd,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAGnC;gBAAC,IAAY,CAAC,UAAU,CAAC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AC,CAAA;YAC9C,CAAC;YACD,aAAa,EAAE,UAAU,IAAY;gBAQnC,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAA;YAC9C,CAAC;SACF,CAAA;IACH,CAAC;CACF;AACD,4BAA4B;AAE5B,iDAAiD;AAEjD,SAAS,eAAe,CACtB,cAA+B;IAG/B,OAAO,IAAI,mBAAmB,CAC5B,cAAc,CAEyB,CAAA;AAC3C,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Universal Connector Engine
|
|
3
|
+
* @description Plugin-first connector engine with operation groups and full type safety
|
|
4
|
+
*/
|
|
5
|
+
import { BaseConnectorPlugin } from "../types/base-plugin";
|
|
6
|
+
import { OperationGroupsConfig, OperationGroupResult, ExtractGroupNames, ExtractGroupOperations, InferOperationGroupInput, InferOperationGroupOutput } from "../types/operation-groups";
|
|
7
|
+
import { EtoContainer, Context } from "@etohq/framework/types";
|
|
8
|
+
export interface PluginConfiguration {
|
|
9
|
+
[domainName: string]: BaseConnectorPlugin;
|
|
10
|
+
}
|
|
11
|
+
interface StepDefinition<TInput = unknown, TOutput = unknown> {
|
|
12
|
+
stepId: string;
|
|
13
|
+
run(input: TInput, context: {
|
|
14
|
+
container: EtoContainer;
|
|
15
|
+
}): Promise<TOutput>;
|
|
16
|
+
}
|
|
17
|
+
export interface PluginRegistry {
|
|
18
|
+
register(name: string, plugin: BaseConnectorPlugin): void;
|
|
19
|
+
get(name: string): BaseConnectorPlugin | undefined;
|
|
20
|
+
list(): string[];
|
|
21
|
+
validate(plugin: BaseConnectorPlugin): boolean;
|
|
22
|
+
getOperations(pluginName: string): string[];
|
|
23
|
+
}
|
|
24
|
+
export declare function ConnectorEngine<TPlugins extends PluginConfiguration, TOperationGroups extends OperationGroupsConfig = {}>(plugins: TPlugins, operationGroups?: TOperationGroups): void;
|
|
25
|
+
type GroupMethods = TOperationGroups extends OperationGroupsConfig ? {
|
|
26
|
+
[GroupName in ExtractGroupNames<TOperationGroups>]: {
|
|
27
|
+
[Operation in ExtractGroupOperations<TOperationGroups, GroupName> as `execute${Capitalize<GroupName & string>}${Capitalize<Operation & string>}`]: <TInput extends InferOperationGroupInput<InferredConnectorTypes, TOperationGroups, GroupName, Operation>, TOutput extends InferOperationGroupOutput<InferredConnectorTypes, TOperationGroups, GroupName, Operation>>(input: TInput, sharedContext?: Context) => Promise<OperationGroupResult<TOutput>>;
|
|
28
|
+
}[ExtractGroupOperations<TOperationGroups, GroupName>];
|
|
29
|
+
} : as;
|
|
30
|
+
declare class ConnectorEngineImpl implements DomainMethods, GroupMethods {
|
|
31
|
+
private readonly plugins;
|
|
32
|
+
private readonly operationGroups;
|
|
33
|
+
private readonly pluginRegistry;
|
|
34
|
+
constructor();
|
|
35
|
+
private generateDynamicMethods;
|
|
36
|
+
private generateDomainMethods;
|
|
37
|
+
private generateGroupMethods;
|
|
38
|
+
executeDomainOperation<TInput = unknown, TOutput = unknown>(domain: keyof TPlugins, operation: string, input: TInput, sharedContext?: Context): Promise<TOutput>;
|
|
39
|
+
executeGroupOperation<TInput = unknown, TOutput = unknown>(groupId: keyof TOperationGroups, operation: string, input: TInput, sharedContext?: Context): Promise<OperationGroupResult<TOutput>>;
|
|
40
|
+
private generateEtoStyleMethods;
|
|
41
|
+
private generatePluginMethods;
|
|
42
|
+
private generateOperationGroupMethods;
|
|
43
|
+
private getGroupMethodName;
|
|
44
|
+
private executeSingleOperation;
|
|
45
|
+
private executeOperationGroup;
|
|
46
|
+
getPluginRegistry(): PluginRegistry;
|
|
47
|
+
getGeneratedMethods(): {
|
|
48
|
+
domainMethods: string[];
|
|
49
|
+
groupMethods: string[];
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export { ConnectorEngineImpl as UniversalConnectorEngine };
|
|
53
|
+
export type { PluginConfiguration, PluginRegistry, WorkflowDefinition, StepDefinition, OperationGroupsConfig, OperationGroupResult };
|
|
54
|
+
//# sourceMappingURL=connector-engine.d.ts.map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