@contractspec/example.integration-hub 1.46.1 → 1.48.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.
- package/dist/connection/connection.enum.d.ts +2 -2
- package/dist/connection/connection.operation.d.ts +27 -27
- package/dist/connection/connection.operation.d.ts.map +1 -1
- package/dist/connection/connection.presentation.d.ts +3 -3
- package/dist/connection/connection.presentation.d.ts.map +1 -1
- package/dist/connection/connection.presentation.js +5 -5
- package/dist/connection/connection.presentation.js.map +1 -1
- package/dist/connection/connection.schema.d.ts +16 -16
- package/dist/example.d.ts +2 -2
- package/dist/example.d.ts.map +1 -1
- package/dist/example.js +4 -2
- package/dist/example.js.map +1 -1
- package/dist/handlers/index.d.ts +2 -0
- package/dist/handlers/index.js +3 -0
- package/dist/handlers/integration.handlers.d.ts +130 -0
- package/dist/handlers/integration.handlers.d.ts.map +1 -0
- package/dist/handlers/integration.handlers.js +282 -0
- package/dist/handlers/integration.handlers.js.map +1 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.js +6 -1
- package/dist/integration/integration.operations.d.ts +25 -25
- package/dist/integration/integration.operations.d.ts.map +1 -1
- package/dist/integration/integration.presentation.d.ts +4 -4
- package/dist/integration/integration.presentation.d.ts.map +1 -1
- package/dist/integration/integration.presentation.js +7 -7
- package/dist/integration/integration.presentation.js.map +1 -1
- package/dist/integration/integration.schema.d.ts +16 -16
- package/dist/integration/integration.schema.d.ts.map +1 -1
- package/dist/integration-hub.capability.d.ts +9 -0
- package/dist/integration-hub.capability.d.ts.map +1 -0
- package/dist/integration-hub.capability.js +38 -0
- package/dist/integration-hub.capability.js.map +1 -0
- package/dist/integration-hub.feature.d.ts +2 -3
- package/dist/integration-hub.feature.d.ts.map +1 -1
- package/dist/integration-hub.feature.js +7 -2
- package/dist/integration-hub.feature.js.map +1 -1
- package/dist/seeders/index.d.ts +10 -0
- package/dist/seeders/index.d.ts.map +1 -0
- package/dist/seeders/index.js +19 -0
- package/dist/seeders/index.js.map +1 -0
- package/dist/sync/sync.operations.d.ts +5 -5
- package/dist/sync/sync.presentation.d.ts +7 -7
- package/dist/sync/sync.presentation.d.ts.map +1 -1
- package/dist/sync/sync.presentation.js +13 -13
- package/dist/sync/sync.presentation.js.map +1 -1
- package/dist/sync-engine/index.js.map +1 -1
- package/dist/tests/operations.test-spec.d.ts +9 -0
- package/dist/tests/operations.test-spec.d.ts.map +1 -0
- package/dist/tests/operations.test-spec.js +94 -0
- package/dist/tests/operations.test-spec.js.map +1 -0
- package/dist/ui/IntegrationDashboard.d.ts +7 -0
- package/dist/ui/IntegrationDashboard.d.ts.map +1 -0
- package/dist/ui/IntegrationDashboard.js +266 -0
- package/dist/ui/IntegrationDashboard.js.map +1 -0
- package/dist/ui/hooks/index.d.ts +2 -0
- package/dist/ui/hooks/index.js +5 -0
- package/dist/ui/hooks/useIntegrationData.d.ts +23 -0
- package/dist/ui/hooks/useIntegrationData.d.ts.map +1 -0
- package/dist/ui/hooks/useIntegrationData.js +59 -0
- package/dist/ui/hooks/useIntegrationData.js.map +1 -0
- package/dist/ui/index.d.ts +6 -0
- package/dist/ui/index.js +6 -0
- package/dist/ui/renderers/index.d.ts +2 -0
- package/dist/ui/renderers/index.js +3 -0
- package/dist/ui/renderers/integration.markdown.d.ts +28 -0
- package/dist/ui/renderers/integration.markdown.d.ts.map +1 -0
- package/dist/ui/renderers/integration.markdown.js +256 -0
- package/dist/ui/renderers/integration.markdown.js.map +1 -0
- package/package.json +24 -8
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _contractspec_lib_schema105 from "@contractspec/lib.schema";
|
|
2
2
|
|
|
3
3
|
//#region src/integration/integration.schema.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* An integration with an external system.
|
|
6
6
|
*/
|
|
7
|
-
declare const IntegrationModel:
|
|
7
|
+
declare const IntegrationModel: _contractspec_lib_schema105.SchemaModel<{
|
|
8
8
|
id: {
|
|
9
|
-
type:
|
|
9
|
+
type: _contractspec_lib_schema105.FieldType<string, string>;
|
|
10
10
|
isOptional: false;
|
|
11
11
|
};
|
|
12
12
|
name: {
|
|
13
|
-
type:
|
|
13
|
+
type: _contractspec_lib_schema105.FieldType<string, string>;
|
|
14
14
|
isOptional: false;
|
|
15
15
|
};
|
|
16
16
|
slug: {
|
|
17
|
-
type:
|
|
17
|
+
type: _contractspec_lib_schema105.FieldType<string, string>;
|
|
18
18
|
isOptional: false;
|
|
19
19
|
};
|
|
20
20
|
description: {
|
|
21
|
-
type:
|
|
21
|
+
type: _contractspec_lib_schema105.FieldType<string, string>;
|
|
22
22
|
isOptional: true;
|
|
23
23
|
};
|
|
24
24
|
provider: {
|
|
25
|
-
type:
|
|
25
|
+
type: _contractspec_lib_schema105.FieldType<string, string>;
|
|
26
26
|
isOptional: false;
|
|
27
27
|
};
|
|
28
28
|
status: {
|
|
29
|
-
type:
|
|
29
|
+
type: _contractspec_lib_schema105.EnumType<[string, string, string, string, string]>;
|
|
30
30
|
isOptional: false;
|
|
31
31
|
};
|
|
32
32
|
createdAt: {
|
|
33
|
-
type:
|
|
33
|
+
type: _contractspec_lib_schema105.FieldType<Date, string>;
|
|
34
34
|
isOptional: false;
|
|
35
35
|
};
|
|
36
36
|
}>;
|
|
37
37
|
/**
|
|
38
38
|
* Input for creating an integration.
|
|
39
39
|
*/
|
|
40
|
-
declare const CreateIntegrationInputModel:
|
|
40
|
+
declare const CreateIntegrationInputModel: _contractspec_lib_schema105.SchemaModel<{
|
|
41
41
|
name: {
|
|
42
|
-
type:
|
|
42
|
+
type: _contractspec_lib_schema105.FieldType<string, string>;
|
|
43
43
|
isOptional: false;
|
|
44
44
|
};
|
|
45
45
|
slug: {
|
|
46
|
-
type:
|
|
46
|
+
type: _contractspec_lib_schema105.FieldType<string, string>;
|
|
47
47
|
isOptional: false;
|
|
48
48
|
};
|
|
49
49
|
description: {
|
|
50
|
-
type:
|
|
50
|
+
type: _contractspec_lib_schema105.FieldType<string, string>;
|
|
51
51
|
isOptional: true;
|
|
52
52
|
};
|
|
53
53
|
provider: {
|
|
54
|
-
type:
|
|
54
|
+
type: _contractspec_lib_schema105.FieldType<string, string>;
|
|
55
55
|
isOptional: false;
|
|
56
56
|
};
|
|
57
57
|
config: {
|
|
58
|
-
type:
|
|
58
|
+
type: _contractspec_lib_schema105.FieldType<unknown, unknown>;
|
|
59
59
|
isOptional: true;
|
|
60
60
|
};
|
|
61
61
|
featureFlagKey: {
|
|
62
|
-
type:
|
|
62
|
+
type: _contractspec_lib_schema105.FieldType<string, string>;
|
|
63
63
|
isOptional: true;
|
|
64
64
|
};
|
|
65
65
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration.schema.d.ts","names":[],"sources":["../../src/integration/integration.schema.ts"],"sourcesContent":[],"mappings":";;;;;;AAMa,cAAA,gBAWX,
|
|
1
|
+
{"version":3,"file":"integration.schema.d.ts","names":[],"sources":["../../src/integration/integration.schema.ts"],"sourcesContent":[],"mappings":";;;;;;AAMa,cAAA,gBAWX,8BAX2B,WAW3B,CAAA;EAAA,EAAA,EAAA;UAAA,2BAAA,CAAA;;;;;;;;IAX2B,IAAA,uCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAgBhB,UAAA,EAAA,KAAA;EAaX,CAAA;;;;;;+CAbsC,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;;;;;;;;;;cAA3B,yDAA2B;;UAatC,2BAAA,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as _contractspec_lib_contracts9 from "@contractspec/lib.contracts";
|
|
2
|
+
|
|
3
|
+
//#region src/integration-hub.capability.d.ts
|
|
4
|
+
declare const IntegrationCapability: _contractspec_lib_contracts9.CapabilitySpec;
|
|
5
|
+
declare const SyncCapability: _contractspec_lib_contracts9.CapabilitySpec;
|
|
6
|
+
declare const EtlCapability: _contractspec_lib_contracts9.CapabilitySpec;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { EtlCapability, IntegrationCapability, SyncCapability };
|
|
9
|
+
//# sourceMappingURL=integration-hub.capability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-hub.capability.d.ts","names":[],"sources":["../src/integration-hub.capability.ts"],"sourcesContent":[],"mappings":";;;cAEa,uBAUX,4BAAA,CAVgC;cAYrB,gBAUX,4BAAA,CAVyB;cAYd,eAUX,4BAAA,CAVwB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { StabilityEnum, defineCapability } from "@contractspec/lib.contracts";
|
|
2
|
+
|
|
3
|
+
//#region src/integration-hub.capability.ts
|
|
4
|
+
const IntegrationCapability = defineCapability({ meta: {
|
|
5
|
+
key: "integration",
|
|
6
|
+
version: "1.0.0",
|
|
7
|
+
kind: "integration",
|
|
8
|
+
stability: StabilityEnum.Experimental,
|
|
9
|
+
description: "Third-party integration connections",
|
|
10
|
+
owners: ["platform.core"],
|
|
11
|
+
tags: ["integration", "connections"]
|
|
12
|
+
} });
|
|
13
|
+
const SyncCapability = defineCapability({ meta: {
|
|
14
|
+
key: "sync",
|
|
15
|
+
version: "1.0.0",
|
|
16
|
+
kind: "api",
|
|
17
|
+
stability: StabilityEnum.Experimental,
|
|
18
|
+
description: "Data synchronization between systems",
|
|
19
|
+
owners: ["platform.core"],
|
|
20
|
+
tags: ["sync", "data"]
|
|
21
|
+
} });
|
|
22
|
+
const EtlCapability = defineCapability({ meta: {
|
|
23
|
+
key: "etl",
|
|
24
|
+
version: "1.0.0",
|
|
25
|
+
kind: "api",
|
|
26
|
+
stability: StabilityEnum.Experimental,
|
|
27
|
+
description: "Extract, transform, load data pipelines",
|
|
28
|
+
owners: ["platform.core"],
|
|
29
|
+
tags: [
|
|
30
|
+
"etl",
|
|
31
|
+
"data",
|
|
32
|
+
"pipeline"
|
|
33
|
+
]
|
|
34
|
+
} });
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
export { EtlCapability, IntegrationCapability, SyncCapability };
|
|
38
|
+
//# sourceMappingURL=integration-hub.capability.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-hub.capability.js","names":[],"sources":["../src/integration-hub.capability.ts"],"sourcesContent":["import { defineCapability, StabilityEnum } from '@contractspec/lib.contracts';\n\nexport const IntegrationCapability = defineCapability({\n meta: {\n key: 'integration',\n version: '1.0.0',\n kind: 'integration',\n stability: StabilityEnum.Experimental,\n description: 'Third-party integration connections',\n owners: ['platform.core'],\n tags: ['integration', 'connections'],\n },\n});\n\nexport const SyncCapability = defineCapability({\n meta: {\n key: 'sync',\n version: '1.0.0',\n kind: 'api',\n stability: StabilityEnum.Experimental,\n description: 'Data synchronization between systems',\n owners: ['platform.core'],\n tags: ['sync', 'data'],\n },\n});\n\nexport const EtlCapability = defineCapability({\n meta: {\n key: 'etl',\n version: '1.0.0',\n kind: 'api',\n stability: StabilityEnum.Experimental,\n description: 'Extract, transform, load data pipelines',\n owners: ['platform.core'],\n tags: ['etl', 'data', 'pipeline'],\n },\n});\n"],"mappings":";;;AAEA,MAAa,wBAAwB,iBAAiB,EACpD,MAAM;CACJ,KAAK;CACL,SAAS;CACT,MAAM;CACN,WAAW,cAAc;CACzB,aAAa;CACb,QAAQ,CAAC,gBAAgB;CACzB,MAAM,CAAC,eAAe,cAAc;CACrC,EACF,CAAC;AAEF,MAAa,iBAAiB,iBAAiB,EAC7C,MAAM;CACJ,KAAK;CACL,SAAS;CACT,MAAM;CACN,WAAW,cAAc;CACzB,aAAa;CACb,QAAQ,CAAC,gBAAgB;CACzB,MAAM,CAAC,QAAQ,OAAO;CACvB,EACF,CAAC;AAEF,MAAa,gBAAgB,iBAAiB,EAC5C,MAAM;CACJ,KAAK;CACL,SAAS;CACT,MAAM;CACN,WAAW,cAAc;CACzB,aAAa;CACb,QAAQ,CAAC,gBAAgB;CACzB,MAAM;EAAC;EAAO;EAAQ;EAAW;CAClC,EACF,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as _contractspec_lib_contracts12 from "@contractspec/lib.contracts";
|
|
2
2
|
|
|
3
3
|
//#region src/integration-hub.feature.d.ts
|
|
4
|
-
|
|
5
|
-
declare const IntegrationHubFeature: FeatureModuleSpec;
|
|
4
|
+
declare const IntegrationHubFeature: _contractspec_lib_contracts12.FeatureModuleSpec;
|
|
6
5
|
//#endregion
|
|
7
6
|
export { IntegrationHubFeature };
|
|
8
7
|
//# sourceMappingURL=integration-hub.feature.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-hub.feature.d.ts","names":[],"sources":["../src/integration-hub.feature.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"integration-hub.feature.d.ts","names":[],"sources":["../src/integration-hub.feature.ts"],"sourcesContent":[],"mappings":";;;cAKa,uBAmHX,6BAAA,CAnHgC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import { defineFeature } from "@contractspec/lib.contracts";
|
|
2
|
+
|
|
1
3
|
//#region src/integration-hub.feature.ts
|
|
2
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Integration Hub Feature Module Specification
|
|
6
|
+
*/
|
|
7
|
+
const IntegrationHubFeature = defineFeature({
|
|
3
8
|
meta: {
|
|
4
9
|
key: "integration-hub",
|
|
5
10
|
version: "1.0.0",
|
|
@@ -232,7 +237,7 @@ const IntegrationHubFeature = {
|
|
|
232
237
|
}
|
|
233
238
|
]
|
|
234
239
|
}
|
|
235
|
-
};
|
|
240
|
+
});
|
|
236
241
|
|
|
237
242
|
//#endregion
|
|
238
243
|
export { IntegrationHubFeature };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-hub.feature.js","names":[
|
|
1
|
+
{"version":3,"file":"integration-hub.feature.js","names":[],"sources":["../src/integration-hub.feature.ts"],"sourcesContent":["/**\n * Integration Hub Feature Module Specification\n */\nimport { defineFeature } from '@contractspec/lib.contracts';\n\nexport const IntegrationHubFeature = defineFeature({\n meta: {\n key: 'integration-hub',\n version: '1.0.0',\n title: 'Integration Hub',\n description:\n 'Connect and sync data with external systems through configurable integrations',\n domain: 'integration',\n owners: ['@integration-team'],\n tags: ['integration', 'sync', 'etl', 'connectors'],\n stability: 'experimental',\n },\n\n operations: [\n { key: 'integration.create', version: '1.0.0' },\n { key: 'integration.connection.create', version: '1.0.0' },\n { key: 'integration.syncConfig.create', version: '1.0.0' },\n { key: 'integration.fieldMapping.add', version: '1.0.0' },\n { key: 'integration.sync.trigger', version: '1.0.0' },\n { key: 'integration.syncRun.list', version: '1.0.0' },\n ],\n\n events: [\n { key: 'integration.created', version: '1.0.0' },\n { key: 'integration.connection.created', version: '1.0.0' },\n { key: 'integration.connection.statusChanged', version: '1.0.0' },\n { key: 'integration.syncConfig.created', version: '1.0.0' },\n { key: 'integration.sync.started', version: '1.0.0' },\n { key: 'integration.sync.completed', version: '1.0.0' },\n { key: 'integration.sync.failed', version: '1.0.0' },\n { key: 'integration.record.synced', version: '1.0.0' },\n { key: 'integration.fieldMapping.added', version: '1.0.0' },\n ],\n\n presentations: [\n { key: 'integration.list', version: '1.0.0' },\n { key: 'integration.detail', version: '1.0.0' },\n { key: 'integration.connection.list', version: '1.0.0' },\n { key: 'integration.connection.setup', version: '1.0.0' },\n { key: 'integration.syncConfig.list', version: '1.0.0' },\n { key: 'integration.syncConfig.editor', version: '1.0.0' },\n { key: 'integration.fieldMapping.editor', version: '1.0.0' },\n { key: 'integration.syncRun.list', version: '1.0.0' },\n { key: 'integration.syncRun.detail', version: '1.0.0' },\n { key: 'integration.health', version: '1.0.0' },\n { key: 'integration.sync.activity', version: '1.0.0' },\n ],\n\n opToPresentation: [\n {\n op: { key: 'integration.syncConfig.create', version: '1.0.0' },\n pres: { key: 'integration.syncConfig.editor', version: '1.0.0' },\n },\n {\n op: { key: 'integration.fieldMapping.add', version: '1.0.0' },\n pres: { key: 'integration.fieldMapping.editor', version: '1.0.0' },\n },\n {\n op: { key: 'integration.syncRun.list', version: '1.0.0' },\n pres: { key: 'integration.syncRun.list', version: '1.0.0' },\n },\n ],\n\n presentationsTargets: [\n {\n key: 'integration.list',\n version: '1.0.0',\n targets: ['react', 'markdown'],\n },\n {\n key: 'integration.detail',\n version: '1.0.0',\n targets: ['react', 'markdown'],\n },\n {\n key: 'integration.syncConfig.list',\n version: '1.0.0',\n targets: ['react', 'markdown'],\n },\n {\n key: 'integration.syncConfig.editor',\n version: '1.0.0',\n targets: ['react'],\n },\n {\n key: 'integration.fieldMapping.editor',\n version: '1.0.0',\n targets: ['react'],\n },\n {\n key: 'integration.syncRun.list',\n version: '1.0.0',\n targets: ['react', 'markdown'],\n },\n {\n key: 'integration.syncRun.detail',\n version: '1.0.0',\n targets: ['react', 'markdown'],\n },\n ],\n\n capabilities: {\n requires: [\n { key: 'identity', version: '1.0.0' },\n { key: 'audit-trail', version: '1.0.0' },\n { key: 'feature-flags', version: '1.0.0' },\n { key: 'jobs', version: '1.0.0' },\n { key: 'files', version: '1.0.0' },\n ],\n provides: [\n { key: 'integration', version: '1.0.0' },\n { key: 'sync', version: '1.0.0' },\n { key: 'etl', version: '1.0.0' },\n ],\n },\n});\n"],"mappings":";;;;;;AAKA,MAAa,wBAAwB,cAAc;CACjD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aACE;EACF,QAAQ;EACR,QAAQ,CAAC,oBAAoB;EAC7B,MAAM;GAAC;GAAe;GAAQ;GAAO;GAAa;EAClD,WAAW;EACZ;CAED,YAAY;EACV;GAAE,KAAK;GAAsB,SAAS;GAAS;EAC/C;GAAE,KAAK;GAAiC,SAAS;GAAS;EAC1D;GAAE,KAAK;GAAiC,SAAS;GAAS;EAC1D;GAAE,KAAK;GAAgC,SAAS;GAAS;EACzD;GAAE,KAAK;GAA4B,SAAS;GAAS;EACrD;GAAE,KAAK;GAA4B,SAAS;GAAS;EACtD;CAED,QAAQ;EACN;GAAE,KAAK;GAAuB,SAAS;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S,CAAC,SAAS,WAAW;GAC/B;EACD;GACE,KAAK;GACL,SAAS;GACT,SAAS,CAAC,QAAQ;GACnB;EACD;GACE,KAAK;GACL,SAAS;GACT,SAAS,CAAC,QAAQ;GACnB;EACD;GACE,KAAK;GACL,SAAS;GACT,SAAS,CAAC,SAAS,WAAW;GAC/B;EACD;GACE,KAAK;GACL,SAAS;GACT,SAAS,CAAC,SAAS,WAAW;GAC/B;EACF;CAED,cAAc;EACZ,UAAU;GACR;IAAE,KAAK;IAAY,SAAS;IAAS;GACrC;IAAE,KAAK;IAAe,SAAS;IAAS;GACxC;IAAE,KAAK;IAAiB,SAAS;IAAS;GAC1C;IAAE,KAAK;IAAQ,SAAS;IAAS;GACjC;IAAE,KAAK;IAAS,SAAS;IAAS;GACnC;EACD,UAAU;GACR;IAAE,KAAK;IAAe,SAAS;IAAS;GACxC;IAAE,KAAK;IAAQ,SAAS;IAAS;GACjC;IAAE,KAAK;IAAO,SAAS;IAAS;GACjC;EACF;CACF,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DatabasePort } from "@contractspec/lib.runtime-sandbox";
|
|
2
|
+
|
|
3
|
+
//#region src/seeders/index.d.ts
|
|
4
|
+
declare function seedIntegrationHub(params: {
|
|
5
|
+
projectId: string;
|
|
6
|
+
db: DatabasePort;
|
|
7
|
+
}): Promise<void>;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { seedIntegrationHub };
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/seeders/index.ts"],"sourcesContent":[],"mappings":";;;iBAEsB,kBAAA;;EAAA,EAAA,EAEhB,YAFgB;IAGrB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/seeders/index.ts
|
|
2
|
+
async function seedIntegrationHub(params) {
|
|
3
|
+
const { projectId, db } = params;
|
|
4
|
+
if ((await db.query(`SELECT COUNT(*) as count FROM integration WHERE "projectId" = $1`, [projectId])).rows[0]?.count > 0) return;
|
|
5
|
+
await db.execute(`INSERT INTO integration (id, "projectId", "organizationId", name, description, type, status)
|
|
6
|
+
VALUES ($1, $2, $3, $4, $5, $6, $7)`, [
|
|
7
|
+
"int_1",
|
|
8
|
+
projectId,
|
|
9
|
+
"org_demo",
|
|
10
|
+
"Salesforce",
|
|
11
|
+
"Salesforce CRM integration",
|
|
12
|
+
"CRM",
|
|
13
|
+
"ACTIVE"
|
|
14
|
+
]);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { seedIntegrationHub };
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/seeders/index.ts"],"sourcesContent":["import type { DatabasePort } from '@contractspec/lib.runtime-sandbox';\n\nexport async function seedIntegrationHub(params: {\n projectId: string;\n db: DatabasePort;\n}) {\n const { projectId, db } = params;\n\n const existing = await db.query(\n `SELECT COUNT(*) as count FROM integration WHERE \"projectId\" = $1`,\n [projectId]\n );\n if ((existing.rows[0]?.count as number) > 0) return;\n\n await db.execute(\n `INSERT INTO integration (id, \"projectId\", \"organizationId\", name, description, type, status)\n VALUES ($1, $2, $3, $4, $5, $6, $7)`,\n [\n 'int_1',\n projectId,\n 'org_demo',\n 'Salesforce',\n 'Salesforce CRM integration',\n 'CRM',\n 'ACTIVE',\n ]\n );\n}\n"],"mappings":";AAEA,eAAsB,mBAAmB,QAGtC;CACD,MAAM,EAAE,WAAW,OAAO;AAM1B,MAJiB,MAAM,GAAG,MACxB,oEACA,CAAC,UAAU,CACZ,EACa,KAAK,IAAI,QAAmB,EAAG;AAE7C,OAAM,GAAG,QACP;2CAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _contractspec_lib_contracts20 from "@contractspec/lib.contracts";
|
|
2
2
|
import * as _contractspec_lib_schema123 from "@contractspec/lib.schema";
|
|
3
3
|
|
|
4
4
|
//#region src/sync/sync.operations.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Create a sync configuration.
|
|
7
7
|
*/
|
|
8
|
-
declare const CreateSyncConfigContract:
|
|
8
|
+
declare const CreateSyncConfigContract: _contractspec_lib_contracts20.OperationSpec<_contractspec_lib_schema123.SchemaModel<{
|
|
9
9
|
integrationId: {
|
|
10
10
|
type: _contractspec_lib_schema123.FieldType<string, string>;
|
|
11
11
|
isOptional: false;
|
|
@@ -197,7 +197,7 @@ declare const CreateSyncConfigContract: _contractspec_lib_contracts10.OperationS
|
|
|
197
197
|
/**
|
|
198
198
|
* Add a field mapping to a sync config.
|
|
199
199
|
*/
|
|
200
|
-
declare const AddFieldMappingContract:
|
|
200
|
+
declare const AddFieldMappingContract: _contractspec_lib_contracts20.OperationSpec<_contractspec_lib_schema123.SchemaModel<{
|
|
201
201
|
syncConfigId: {
|
|
202
202
|
type: _contractspec_lib_schema123.FieldType<string, string>;
|
|
203
203
|
isOptional: false;
|
|
@@ -293,7 +293,7 @@ declare const AddFieldMappingContract: _contractspec_lib_contracts10.OperationSp
|
|
|
293
293
|
/**
|
|
294
294
|
* Trigger a manual sync.
|
|
295
295
|
*/
|
|
296
|
-
declare const TriggerSyncContract:
|
|
296
|
+
declare const TriggerSyncContract: _contractspec_lib_contracts20.OperationSpec<_contractspec_lib_schema123.SchemaModel<{
|
|
297
297
|
syncConfigId: {
|
|
298
298
|
type: _contractspec_lib_schema123.FieldType<string, string>;
|
|
299
299
|
isOptional: false;
|
|
@@ -421,7 +421,7 @@ declare const TriggerSyncContract: _contractspec_lib_contracts10.OperationSpec<_
|
|
|
421
421
|
/**
|
|
422
422
|
* List sync run history.
|
|
423
423
|
*/
|
|
424
|
-
declare const ListSyncRunsContract:
|
|
424
|
+
declare const ListSyncRunsContract: _contractspec_lib_contracts20.OperationSpec<_contractspec_lib_schema123.SchemaModel<{
|
|
425
425
|
syncConfigId: {
|
|
426
426
|
type: _contractspec_lib_schema123.FieldType<string, string>;
|
|
427
427
|
isOptional: false;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as _contractspec_lib_contracts24 from "@contractspec/lib.contracts";
|
|
2
2
|
|
|
3
3
|
//#region src/sync/sync.presentation.d.ts
|
|
4
|
-
declare const SyncConfigListPresentation: PresentationSpec;
|
|
5
|
-
declare const SyncConfigEditorPresentation: PresentationSpec;
|
|
6
|
-
declare const FieldMappingEditorPresentation: PresentationSpec;
|
|
7
|
-
declare const SyncRunListPresentation: PresentationSpec;
|
|
8
|
-
declare const SyncRunDetailPresentation: PresentationSpec;
|
|
9
|
-
declare const SyncActivityPresentation: PresentationSpec;
|
|
4
|
+
declare const SyncConfigListPresentation: _contractspec_lib_contracts24.PresentationSpec;
|
|
5
|
+
declare const SyncConfigEditorPresentation: _contractspec_lib_contracts24.PresentationSpec;
|
|
6
|
+
declare const FieldMappingEditorPresentation: _contractspec_lib_contracts24.PresentationSpec;
|
|
7
|
+
declare const SyncRunListPresentation: _contractspec_lib_contracts24.PresentationSpec;
|
|
8
|
+
declare const SyncRunDetailPresentation: _contractspec_lib_contracts24.PresentationSpec;
|
|
9
|
+
declare const SyncActivityPresentation: _contractspec_lib_contracts24.PresentationSpec;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { FieldMappingEditorPresentation, SyncActivityPresentation, SyncConfigEditorPresentation, SyncConfigListPresentation, SyncRunDetailPresentation, SyncRunListPresentation };
|
|
12
12
|
//# sourceMappingURL=sync.presentation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.presentation.d.ts","names":[],"sources":["../../src/sync/sync.presentation.ts"],"sourcesContent":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"sync.presentation.d.ts","names":[],"sources":["../../src/sync/sync.presentation.ts"],"sourcesContent":[],"mappings":";;;cAOa,4BAuBX,6BAAA,CAvBqC;cAyB1B,8BAuBX,6BAAA,CAvBuC;cAyB5B,gCAuBX,6BAAA,CAvByC;AAlD9B,cA2EA,uBApDX,EA2EA,6BAAA,CAvBkC,gBApDlC;AAEW,cA2EA,yBApDX,EA2EA,6BAAA,CAvBoC,gBApDpC;AAEW,cA2EA,wBApDX,EA0EA,6BAAA,CAtBmC,gBApDnC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FieldMappingModel, SyncConfigModel, SyncRunModel } from "./sync.schema.js";
|
|
2
|
-
import { StabilityEnum } from "@contractspec/lib.contracts";
|
|
2
|
+
import { StabilityEnum, definePresentation } from "@contractspec/lib.contracts";
|
|
3
3
|
|
|
4
4
|
//#region src/sync/sync.presentation.ts
|
|
5
|
-
const SyncConfigListPresentation = {
|
|
5
|
+
const SyncConfigListPresentation = definePresentation({
|
|
6
6
|
meta: {
|
|
7
7
|
key: "integration.syncConfig.list",
|
|
8
8
|
version: "1.0.0",
|
|
@@ -28,8 +28,8 @@ const SyncConfigListPresentation = {
|
|
|
28
28
|
},
|
|
29
29
|
targets: ["react", "markdown"],
|
|
30
30
|
policy: { flags: ["integration.sync.enabled"] }
|
|
31
|
-
};
|
|
32
|
-
const SyncConfigEditorPresentation = {
|
|
31
|
+
});
|
|
32
|
+
const SyncConfigEditorPresentation = definePresentation({
|
|
33
33
|
meta: {
|
|
34
34
|
key: "integration.syncConfig.editor",
|
|
35
35
|
version: "1.0.0",
|
|
@@ -55,8 +55,8 @@ const SyncConfigEditorPresentation = {
|
|
|
55
55
|
},
|
|
56
56
|
targets: ["react"],
|
|
57
57
|
policy: { flags: ["integration.sync.enabled"] }
|
|
58
|
-
};
|
|
59
|
-
const FieldMappingEditorPresentation = {
|
|
58
|
+
});
|
|
59
|
+
const FieldMappingEditorPresentation = definePresentation({
|
|
60
60
|
meta: {
|
|
61
61
|
key: "integration.fieldMapping.editor",
|
|
62
62
|
version: "1.0.0",
|
|
@@ -81,8 +81,8 @@ const FieldMappingEditorPresentation = {
|
|
|
81
81
|
},
|
|
82
82
|
targets: ["react"],
|
|
83
83
|
policy: { flags: ["integration.sync.enabled"] }
|
|
84
|
-
};
|
|
85
|
-
const SyncRunListPresentation = {
|
|
84
|
+
});
|
|
85
|
+
const SyncRunListPresentation = definePresentation({
|
|
86
86
|
meta: {
|
|
87
87
|
key: "integration.syncRun.list",
|
|
88
88
|
version: "1.0.0",
|
|
@@ -108,8 +108,8 @@ const SyncRunListPresentation = {
|
|
|
108
108
|
},
|
|
109
109
|
targets: ["react", "markdown"],
|
|
110
110
|
policy: { flags: ["integration.sync.enabled"] }
|
|
111
|
-
};
|
|
112
|
-
const SyncRunDetailPresentation = {
|
|
111
|
+
});
|
|
112
|
+
const SyncRunDetailPresentation = definePresentation({
|
|
113
113
|
meta: {
|
|
114
114
|
key: "integration.syncRun.detail",
|
|
115
115
|
version: "1.0.0",
|
|
@@ -135,8 +135,8 @@ const SyncRunDetailPresentation = {
|
|
|
135
135
|
},
|
|
136
136
|
targets: ["react", "markdown"],
|
|
137
137
|
policy: { flags: ["integration.sync.enabled"] }
|
|
138
|
-
};
|
|
139
|
-
const SyncActivityPresentation = {
|
|
138
|
+
});
|
|
139
|
+
const SyncActivityPresentation = definePresentation({
|
|
140
140
|
meta: {
|
|
141
141
|
key: "integration.sync.activity",
|
|
142
142
|
version: "1.0.0",
|
|
@@ -161,7 +161,7 @@ const SyncActivityPresentation = {
|
|
|
161
161
|
},
|
|
162
162
|
targets: ["react", "markdown"],
|
|
163
163
|
policy: { flags: ["integration.sync.enabled"] }
|
|
164
|
-
};
|
|
164
|
+
});
|
|
165
165
|
|
|
166
166
|
//#endregion
|
|
167
167
|
export { FieldMappingEditorPresentation, SyncActivityPresentation, SyncConfigEditorPresentation, SyncConfigListPresentation, SyncRunDetailPresentation, SyncRunListPresentation };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.presentation.js","names":[
|
|
1
|
+
{"version":3,"file":"sync.presentation.js","names":[],"sources":["../../src/sync/sync.presentation.ts"],"sourcesContent":["import { definePresentation, StabilityEnum } from '@contractspec/lib.contracts';\nimport {\n SyncConfigModel,\n SyncRunModel,\n FieldMappingModel,\n} from './sync.schema';\n\nexport const SyncConfigListPresentation = definePresentation({\n meta: {\n key: 'integration.syncConfig.list',\n version: '1.0.0',\n title: 'Sync Config List',\n description: 'List of sync configurations',\n domain: 'integration',\n owners: ['@integration-team'],\n tags: ['integration', 'sync', 'config', 'list'],\n stability: StabilityEnum.Experimental,\n goal: 'Show users their current sync configurations.',\n context: 'Management view for data synchronization.',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'SyncConfigList',\n props: SyncConfigModel,\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['integration.sync.enabled'],\n },\n});\n\nexport const SyncConfigEditorPresentation = definePresentation({\n meta: {\n key: 'integration.syncConfig.editor',\n version: '1.0.0',\n title: 'Sync Config Editor',\n description: 'Editor for sync configuration settings',\n domain: 'integration',\n owners: ['@integration-team'],\n tags: ['integration', 'sync', 'config', 'editor'],\n stability: StabilityEnum.Experimental,\n goal: 'Allow users to configure schedule, filters, and settings for a sync.',\n context: 'Configuration interface for sync jobs.',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'SyncConfigEditor',\n props: SyncConfigModel,\n },\n targets: ['react'],\n policy: {\n flags: ['integration.sync.enabled'],\n },\n});\n\nexport const FieldMappingEditorPresentation = definePresentation({\n meta: {\n key: 'integration.fieldMapping.editor',\n version: '1.0.0',\n title: 'Field Mapping Editor',\n description: 'Visual field mapping editor',\n domain: 'integration',\n owners: ['@integration-team'],\n tags: ['integration', 'field-mapping', 'editor'],\n stability: StabilityEnum.Experimental,\n goal: 'Allow users to map source fields to target fields visually.',\n context: 'Schema mapping tool for data consistency.',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'FieldMappingEditor',\n props: FieldMappingModel,\n },\n targets: ['react'],\n policy: {\n flags: ['integration.sync.enabled'],\n },\n});\n\nexport const SyncRunListPresentation = definePresentation({\n meta: {\n key: 'integration.syncRun.list',\n version: '1.0.0',\n title: 'Sync Run History',\n description: 'History of sync runs',\n domain: 'integration',\n owners: ['@integration-team'],\n tags: ['integration', 'sync', 'runs', 'history'],\n stability: StabilityEnum.Experimental,\n goal: 'Provide a historical log of all sync attempts and their results.',\n context: 'Audit and troubleshooting view for sync jobs.',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'SyncRunList',\n props: SyncRunModel,\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['integration.sync.enabled'],\n },\n});\n\nexport const SyncRunDetailPresentation = definePresentation({\n meta: {\n key: 'integration.syncRun.detail',\n version: '1.0.0',\n title: 'Sync Run Details',\n description: 'Detailed view of a sync run with logs',\n domain: 'integration',\n owners: ['@integration-team'],\n tags: ['integration', 'sync', 'run', 'detail'],\n stability: StabilityEnum.Experimental,\n goal: 'Show granular details and logs for a specific sync run.',\n context: 'Detailed troubleshooting view.',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'SyncRunDetail',\n props: SyncRunModel,\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['integration.sync.enabled'],\n },\n});\n\nexport const SyncActivityPresentation = definePresentation({\n meta: {\n key: 'integration.sync.activity',\n version: '1.0.0',\n title: 'Sync Activity Monitor',\n description: 'Real-time sync activity monitor',\n domain: 'integration',\n owners: ['@integration-team'],\n tags: ['integration', 'sync', 'activity', 'realtime'],\n stability: StabilityEnum.Experimental,\n goal: 'Monitor live data flow and sync performance.',\n context: 'Real-time operations monitor.',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'SyncActivity',\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['integration.sync.enabled'],\n },\n});\n"],"mappings":";;;;AAOA,MAAa,6BAA6B,mBAAmB;CAC3D,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,oBAAoB;EAC7B,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WAAW;CAC9B,QAAQ,EACN,OAAO,CAAC,2BAA2B,EACpC;CACF,CAAC;AAEF,MAAa,4BAA4B,mBAAmB;CAC1D,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,oBAAoB;EAC7B,MAAM;GAAC;GAAe;GAAQ;GAAO;GAAS;EAC9C,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO;EACR;CACD,SAAS,CAAC,SAAS,WAAW;CAC9B,QAAQ,EACN,OAAO,CAAC,2BAA2B,EACpC;CACF,CAAC;AAEF,MAAa,2BAA2B,mBAAmB;CACzD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,oBAAoB;EAC7B,MAAM;GAAC;GAAe;GAAQ;GAAY;GAAW;EACrD,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACf;CACD,SAAS,CAAC,SAAS,WAAW;CAC9B,QAAQ,EACN,OAAO,CAAC,2BAA2B,EACpC;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["targetData: Record<string, unknown>","value: unknown","sourceValue: unknown","errors: SyncError[]","current: unknown"],"sources":["../../src/sync-engine/index.ts"],"sourcesContent":["/**\n * Sync Engine\n *\n * Core sync logic for the Integration Hub.\n */\n\n// ============ Types ============\n\nexport interface FieldMapping {\n sourceField: string;\n targetField: string;\n mappingType: 'DIRECT' | 'TRANSFORM' | 'LOOKUP' | 'CONSTANT' | 'COMPUTED';\n transformExpression?: string;\n lookupConfig?: LookupConfig;\n constantValue?: unknown;\n isRequired: boolean;\n defaultValue?: unknown;\n}\n\nexport interface LookupConfig {\n sourceObject: string;\n lookupField: string;\n returnField: string;\n}\n\nexport interface SyncConfig {\n id: string;\n direction: 'INBOUND' | 'OUTBOUND' | 'BIDIRECTIONAL';\n sourceObject: string;\n targetObject: string;\n fieldMappings: FieldMapping[];\n createNew: boolean;\n updateExisting: boolean;\n deleteRemoved: boolean;\n sourceFilter?: Record<string, unknown>;\n}\n\nexport interface SyncContext {\n runId: string;\n config: SyncConfig;\n connection: {\n id: string;\n authType: string;\n credentials?: Record<string, unknown>;\n };\n}\n\nexport interface SyncResult {\n success: boolean;\n recordsProcessed: number;\n recordsCreated: number;\n recordsUpdated: number;\n recordsDeleted: number;\n recordsFailed: number;\n recordsSkipped: number;\n errors: SyncError[];\n}\n\nexport interface SyncError {\n recordId?: string;\n field?: string;\n message: string;\n code: string;\n}\n\nexport interface SourceRecord {\n id: string;\n data: Record<string, unknown>;\n checksum?: string;\n}\n\nexport interface TargetRecord {\n id: string;\n data: Record<string, unknown>;\n checksum?: string;\n}\n\n// ============ Sync Engine Interface ============\n\nexport interface ISyncEngine {\n /**\n * Execute a sync operation.\n */\n sync(context: SyncContext): Promise<SyncResult>;\n\n /**\n * Transform a source record to target format.\n */\n transformRecord(\n sourceRecord: SourceRecord,\n mappings: FieldMapping[],\n context: SyncContext\n ): TargetRecord;\n\n /**\n * Validate a transformed record.\n */\n validateRecord(\n record: TargetRecord,\n mappings: FieldMapping[]\n ): { valid: boolean; errors: SyncError[] };\n}\n\n// ============ Field Transformer ============\n\nexport interface IFieldTransformer {\n transform(value: unknown, expression: string): unknown;\n}\n\nexport class BasicFieldTransformer implements IFieldTransformer {\n transform(value: unknown, expression: string): unknown {\n // Simple expression evaluation\n // In production, use a proper expression language\n try {\n if (expression.startsWith('uppercase')) {\n return typeof value === 'string' ? value.toUpperCase() : value;\n }\n if (expression.startsWith('lowercase')) {\n return typeof value === 'string' ? value.toLowerCase() : value;\n }\n if (expression.startsWith('trim')) {\n return typeof value === 'string' ? value.trim() : value;\n }\n if (expression.startsWith('default:')) {\n const defaultVal = expression.replace('default:', '');\n return value ?? JSON.parse(defaultVal);\n }\n if (expression.startsWith('concat:')) {\n const separator = expression.replace('concat:', '') || ' ';\n if (Array.isArray(value)) {\n return value.join(separator);\n }\n return value;\n }\n if (expression.startsWith('split:')) {\n const separator = expression.replace('split:', '') || ',';\n if (typeof value === 'string') {\n return value.split(separator);\n }\n return value;\n }\n if (expression.startsWith('number')) {\n return Number(value);\n }\n if (expression.startsWith('boolean')) {\n return Boolean(value);\n }\n if (expression.startsWith('string')) {\n return String(value);\n }\n\n // Return as-is if no transformation matches\n return value;\n } catch {\n return value;\n }\n }\n}\n\n// ============ Basic Sync Engine ============\n\nexport class BasicSyncEngine implements ISyncEngine {\n private transformer: IFieldTransformer;\n\n constructor(transformer?: IFieldTransformer) {\n this.transformer = transformer ?? new BasicFieldTransformer();\n }\n\n async sync(_context: SyncContext): Promise<SyncResult> {\n const result: SyncResult = {\n success: true,\n recordsProcessed: 0,\n recordsCreated: 0,\n recordsUpdated: 0,\n recordsDeleted: 0,\n recordsFailed: 0,\n recordsSkipped: 0,\n errors: [],\n };\n\n // In a real implementation, this would:\n // 1. Fetch records from source\n // 2. Transform each record\n // 3. Validate each record\n // 4. Upsert to target\n // 5. Track sync records for deduplication\n\n return result;\n }\n\n transformRecord(\n sourceRecord: SourceRecord,\n mappings: FieldMapping[],\n _context: SyncContext\n ): TargetRecord {\n const targetData: Record<string, unknown> = {};\n\n for (const mapping of mappings) {\n let value: unknown;\n let sourceValue: unknown;\n\n switch (mapping.mappingType) {\n case 'DIRECT':\n value = this.getNestedValue(sourceRecord.data, mapping.sourceField);\n break;\n\n case 'TRANSFORM':\n sourceValue = this.getNestedValue(\n sourceRecord.data,\n mapping.sourceField\n );\n value = mapping.transformExpression\n ? this.transformer.transform(\n sourceValue,\n mapping.transformExpression\n )\n : sourceValue;\n break;\n\n case 'CONSTANT':\n value = mapping.constantValue;\n break;\n\n case 'LOOKUP':\n // In production, this would fetch from a lookup table\n value = this.getNestedValue(sourceRecord.data, mapping.sourceField);\n break;\n\n case 'COMPUTED':\n // In production, this would evaluate a computed expression\n value = mapping.transformExpression\n ? this.evaluateComputed(\n sourceRecord.data,\n mapping.transformExpression\n )\n : null;\n break;\n\n default:\n value = this.getNestedValue(sourceRecord.data, mapping.sourceField);\n }\n\n // Apply default value if needed\n if (value === undefined || value === null) {\n value = mapping.defaultValue;\n }\n\n // Set the target field\n this.setNestedValue(targetData, mapping.targetField, value);\n }\n\n return {\n id: sourceRecord.id,\n data: targetData,\n };\n }\n\n validateRecord(\n record: TargetRecord,\n mappings: FieldMapping[]\n ): { valid: boolean; errors: SyncError[] } {\n const errors: SyncError[] = [];\n\n for (const mapping of mappings) {\n if (mapping.isRequired) {\n const value = this.getNestedValue(record.data, mapping.targetField);\n if (value === undefined || value === null) {\n errors.push({\n recordId: record.id,\n field: mapping.targetField,\n message: `Required field ${mapping.targetField} is missing`,\n code: 'REQUIRED_FIELD_MISSING',\n });\n }\n }\n }\n\n return {\n valid: errors.length === 0,\n errors,\n };\n }\n\n private getNestedValue(obj: Record<string, unknown>, path: string): unknown {\n const parts = path.split('.');\n let current: unknown = obj;\n\n for (const part of parts) {\n if (current === null || current === undefined) {\n return undefined;\n }\n current = (current as Record<string, unknown>)[part];\n }\n\n return current;\n }\n\n private setNestedValue(\n obj: Record<string, unknown>,\n path: string,\n value: unknown\n ): void {\n const parts = path.split('.');\n let current = obj;\n\n for (let i = 0; i < parts.length - 1; i++) {\n const part = parts[i];\n if (part === undefined) continue;\n if (!(part in current)) {\n current[part] = {};\n }\n current = current[part] as Record<string, unknown>;\n }\n\n const lastPart = parts[parts.length - 1];\n if (lastPart !== undefined) {\n current[lastPart] = value;\n }\n }\n\n private evaluateComputed(\n data: Record<string, unknown>,\n expression: string\n ): unknown {\n // Simple computed field evaluation\n // In production, use a proper expression evaluator\n try {\n // Support simple field references like ${field.path}\n const result = expression.replace(/\\$\\{([^}]+)\\}/g, (_, path) => {\n const value = this.getNestedValue(data, path);\n return String(value ?? '');\n });\n return result;\n } catch {\n return null;\n }\n }\n}\n\n// ============ Factory ============\n\nexport function createSyncEngine(transformer?: IFieldTransformer): ISyncEngine {\n return new BasicSyncEngine(transformer);\n}\n\n// ============ Checksum Utilities ============\n\nexport function computeChecksum(data: Record<string, unknown>): string {\n // Simple checksum based on JSON serialization\n // In production, use a proper hash function\n const str = JSON.stringify(data, Object.keys(data).sort());\n let hash = 0;\n for (let i = 0; i < str.length; i++) {\n const char = str.charCodeAt(i);\n hash = (hash << 5) - hash + char;\n hash = hash & hash;\n }\n return hash.toString(16);\n}\n\nexport function hasChanges(\n sourceChecksum: string | undefined,\n targetChecksum: string | undefined\n): boolean {\n if (!sourceChecksum || !targetChecksum) {\n return true;\n }\n return sourceChecksum !== targetChecksum;\n}\n"],"mappings":";AA6GA,IAAa,wBAAb,MAAgE;CAC9D,UAAU,OAAgB,YAA6B;AAGrD,MAAI;AACF,OAAI,WAAW,WAAW,YAAY,CACpC,QAAO,OAAO,UAAU,WAAW,MAAM,aAAa,GAAG;AAE3D,OAAI,WAAW,WAAW,YAAY,CACpC,QAAO,OAAO,UAAU,WAAW,MAAM,aAAa,GAAG;AAE3D,OAAI,WAAW,WAAW,OAAO,CAC/B,QAAO,OAAO,UAAU,WAAW,MAAM,MAAM,GAAG;AAEpD,OAAI,WAAW,WAAW,WAAW,EAAE;IACrC,MAAM,aAAa,WAAW,QAAQ,YAAY,GAAG;AACrD,WAAO,SAAS,KAAK,MAAM,WAAW;;AAExC,OAAI,WAAW,WAAW,UAAU,EAAE;IACpC,MAAM,YAAY,WAAW,QAAQ,WAAW,GAAG,IAAI;AACvD,QAAI,MAAM,QAAQ,MAAM,CACtB,QAAO,MAAM,KAAK,UAAU;AAE9B,WAAO;;AAET,OAAI,WAAW,WAAW,SAAS,EAAE;IACnC,MAAM,YAAY,WAAW,QAAQ,UAAU,GAAG,IAAI;AACtD,QAAI,OAAO,UAAU,SACnB,QAAO,MAAM,MAAM,UAAU;AAE/B,WAAO;;AAET,OAAI,WAAW,WAAW,SAAS,CACjC,QAAO,OA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EACnC,MAAM,OAAO,IAAI,WAAW,EAAE;AAC9B,UAAQ,QAAQ,KAAK,OAAO;AAC5B,SAAO,OAAO;;AAEhB,QAAO,KAAK,SAAS,GAAG;;AAG1B,SAAgB,WACd,gBACA,gBACS;AACT,KAAI,CAAC,kBAAkB,CAAC,eACtB,QAAO;AAET,QAAO,mBAAmB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/sync-engine/index.ts"],"sourcesContent":["/**\n * Sync Engine\n *\n * Core sync logic for the Integration Hub.\n */\n\n// ============ Types ============\n\nexport interface FieldMapping {\n sourceField: string;\n targetField: string;\n mappingType: 'DIRECT' | 'TRANSFORM' | 'LOOKUP' | 'CONSTANT' | 'COMPUTED';\n transformExpression?: string;\n lookupConfig?: LookupConfig;\n constantValue?: unknown;\n isRequired: boolean;\n defaultValue?: unknown;\n}\n\nexport interface LookupConfig {\n sourceObject: string;\n lookupField: string;\n returnField: string;\n}\n\nexport interface SyncConfig {\n id: string;\n direction: 'INBOUND' | 'OUTBOUND' | 'BIDIRECTIONAL';\n sourceObject: string;\n targetObject: string;\n fieldMappings: FieldMapping[];\n createNew: boolean;\n updateExisting: boolean;\n deleteRemoved: boolean;\n sourceFilter?: Record<string, unknown>;\n}\n\nexport interface SyncContext {\n runId: string;\n config: SyncConfig;\n connection: {\n id: string;\n authType: string;\n credentials?: Record<string, unknown>;\n };\n}\n\nexport interface SyncResult {\n success: boolean;\n recordsProcessed: number;\n recordsCreated: number;\n recordsUpdated: number;\n recordsDeleted: number;\n recordsFailed: number;\n recordsSkipped: number;\n errors: SyncError[];\n}\n\nexport interface SyncError {\n recordId?: string;\n field?: string;\n message: string;\n code: string;\n}\n\nexport interface SourceRecord {\n id: string;\n data: Record<string, unknown>;\n checksum?: string;\n}\n\nexport interface TargetRecord {\n id: string;\n data: Record<string, unknown>;\n checksum?: string;\n}\n\n// ============ Sync Engine Interface ============\n\nexport interface ISyncEngine {\n /**\n * Execute a sync operation.\n */\n sync(context: SyncContext): Promise<SyncResult>;\n\n /**\n * Transform a source record to target format.\n */\n transformRecord(\n sourceRecord: SourceRecord,\n mappings: FieldMapping[],\n context: SyncContext\n ): TargetRecord;\n\n /**\n * Validate a transformed record.\n */\n validateRecord(\n record: TargetRecord,\n mappings: FieldMapping[]\n ): { valid: boolean; errors: SyncError[] };\n}\n\n// ============ Field Transformer ============\n\nexport interface IFieldTransformer {\n transform(value: unknown, expression: string): unknown;\n}\n\nexport class BasicFieldTransformer implements IFieldTransformer {\n transform(value: unknown, expression: string): unknown {\n // Simple expression evaluation\n // In production, use a proper expression language\n try {\n if (expression.startsWith('uppercase')) {\n return typeof value === 'string' ? value.toUpperCase() : value;\n }\n if (expression.startsWith('lowercase')) {\n return typeof value === 'string' ? value.toLowerCase() : value;\n }\n if (expression.startsWith('trim')) {\n return typeof value === 'string' ? value.trim() : value;\n }\n if (expression.startsWith('default:')) {\n const defaultVal = expression.replace('default:', '');\n return value ?? JSON.parse(defaultVal);\n }\n if (expression.startsWith('concat:')) {\n const separator = expression.replace('concat:', '') || ' ';\n if (Array.isArray(value)) {\n return value.join(separator);\n }\n return value;\n }\n if (expression.startsWith('split:')) {\n const separator = expression.replace('split:', '') || ',';\n if (typeof value === 'string') {\n return value.split(separator);\n }\n return value;\n }\n if (expression.startsWith('number')) {\n return Number(value);\n }\n if (expression.startsWith('boolean')) {\n return Boolean(value);\n }\n if (expression.startsWith('string')) {\n return String(value);\n }\n\n // Return as-is if no transformation matches\n return value;\n } catch {\n return value;\n }\n }\n}\n\n// ============ Basic Sync Engine ============\n\nexport class BasicSyncEngine implements ISyncEngine {\n private transformer: IFieldTransformer;\n\n constructor(transformer?: IFieldTransformer) {\n this.transformer = transformer ?? new BasicFieldTransformer();\n }\n\n async sync(_context: SyncContext): Promise<SyncResult> {\n const result: SyncResult = {\n success: true,\n recordsProcessed: 0,\n recordsCreated: 0,\n recordsUpdated: 0,\n recordsDeleted: 0,\n recordsFailed: 0,\n recordsSkipped: 0,\n errors: [],\n };\n\n // In a real implementation, this would:\n // 1. Fetch records from source\n // 2. Transform each record\n // 3. Validate each record\n // 4. Upsert to target\n // 5. Track sync records for deduplication\n\n return result;\n }\n\n transformRecord(\n sourceRecord: SourceRecord,\n mappings: FieldMapping[],\n _context: SyncContext\n ): TargetRecord {\n const targetData: Record<string, unknown> = {};\n\n for (const mapping of mappings) {\n let value: unknown;\n let sourceValue: unknown;\n\n switch (mapping.mappingType) {\n case 'DIRECT':\n value = this.getNestedValue(sourceRecord.data, mapping.sourceField);\n break;\n\n case 'TRANSFORM':\n sourceValue = this.getNestedValue(\n sourceRecord.data,\n mapping.sourceField\n );\n value = mapping.transformExpression\n ? this.transformer.transform(\n sourceValue,\n mapping.transformExpression\n )\n : sourceValue;\n break;\n\n case 'CONSTANT':\n value = mapping.constantValue;\n break;\n\n case 'LOOKUP':\n // In production, this would fetch from a lookup table\n value = this.getNestedValue(sourceRecord.data, mapping.sourceField);\n break;\n\n case 'COMPUTED':\n // In production, this would evaluate a computed expression\n value = mapping.transformExpression\n ? this.evaluateComputed(\n sourceRecord.data,\n mapping.transformExpression\n )\n : null;\n break;\n\n default:\n value = this.getNestedValue(sourceRecord.data, mapping.sourceField);\n }\n\n // Apply default value if needed\n if (value === undefined || value === null) {\n value = mapping.defaultValue;\n }\n\n // Set the target field\n this.setNestedValue(targetData, mapping.targetField, value);\n }\n\n return {\n id: sourceRecord.id,\n data: targetData,\n };\n }\n\n validateRecord(\n record: TargetRecord,\n mappings: FieldMapping[]\n ): { valid: boolean; errors: SyncError[] } {\n const errors: SyncError[] = [];\n\n for (const mapping of mappings) {\n if (mapping.isRequired) {\n const value = this.getNestedValue(record.data, mapping.targetField);\n if (value === undefined || value === null) {\n errors.push({\n recordId: record.id,\n field: mapping.targetField,\n message: `Required field ${mapping.targetField} is missing`,\n code: 'REQUIRED_FIELD_MISSING',\n });\n }\n }\n }\n\n return {\n valid: errors.length === 0,\n errors,\n };\n }\n\n private getNestedValue(obj: Record<string, unknown>, path: string): unknown {\n const parts = path.split('.');\n let current: unknown = obj;\n\n for (const part of parts) {\n if (current === null || current === undefined) {\n return undefined;\n }\n current = (current as Record<string, unknown>)[part];\n }\n\n return current;\n }\n\n private setNestedValue(\n obj: Record<string, unknown>,\n path: string,\n value: unknown\n ): void {\n const parts = path.split('.');\n let current = obj;\n\n for (let i = 0; i < parts.length - 1; i++) {\n const part = parts[i];\n if (part === undefined) continue;\n if (!(part in current)) {\n current[part] = {};\n }\n current = current[part] as Record<string, unknown>;\n }\n\n const lastPart = parts[parts.length - 1];\n if (lastPart !== undefined) {\n current[lastPart] = value;\n }\n }\n\n private evaluateComputed(\n data: Record<string, unknown>,\n expression: string\n ): unknown {\n // Simple computed field evaluation\n // In production, use a proper expression evaluator\n try {\n // Support simple field references like ${field.path}\n const result = expression.replace(/\\$\\{([^}]+)\\}/g, (_, path) => {\n const value = this.getNestedValue(data, path);\n return String(value ?? '');\n });\n return result;\n } catch {\n return null;\n }\n }\n}\n\n// ============ Factory ============\n\nexport function createSyncEngine(transformer?: IFieldTransformer): ISyncEngine {\n return new BasicSyncEngine(transformer);\n}\n\n// ============ Checksum Utilities ============\n\nexport function computeChecksum(data: Record<string, unknown>): string {\n // Simple checksum based on JSON serialization\n // In production, use a proper hash function\n const str = JSON.stringify(data, Object.keys(data).sort());\n let hash = 0;\n for (let i = 0; i < str.length; i++) {\n const char = str.charCodeAt(i);\n hash = (hash << 5) - hash + char;\n hash = hash & hash;\n }\n return hash.toString(16);\n}\n\nexport function hasChanges(\n sourceChecksum: string | undefined,\n targetChecksum: string | undefined\n): boolean {\n if (!sourceChecksum || !targetChecksum) {\n return true;\n }\n return sourceChecksum !== targetChecksum;\n}\n"],"mappings":";AA6GA,IAAa,wBAAb,MAAgE;CAC9D,UAAU,OAAgB,YAA6B;AAGrD,MAAI;AACF,OAAI,WAAW,WAAW,YAAY,CACpC,QAAO,OAAO,UAAU,WAAW,MAAM,aAAa,GAAG;AAE3D,OAAI,WAAW,WAAW,YAAY,CACpC,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SAAS,OAAW;AACxB,OAAI,EAAE,QAAQ,SACZ,SAAQ,QAAQ,EAAE;AAEpB,aAAU,QAAQ;;EAGpB,MAAM,WAAW,MAAM,MAAM,SAAS;AACtC,MAAI,aAAa,OACf,SAAQ,YAAY;;CAIxB,AAAQ,iBACN,MACA,YACS;AAGT,MAAI;AAMF,UAJe,WAAW,QAAQ,mBAAmB,GAAG,SAAS;IAC/D,MAAM,QAAQ,KAAK,eAAe,MAAM,KAAK;AAC7C,WAAO,OAAO,SAAS,GAAG;KAC1B;UAEI;AACN,UAAO;;;;AAOb,SAAgB,iBAAiB,aAA8C;AAC7E,QAAO,IAAI,gBAAgB,YAAY;;AAKzC,SAAgB,gBAAgB,MAAuC;CAGrE,MAAM,MAAM,KAAK,UAAU,MAAM,OAAO,KAAK,KAAK,CAAC,MAAM,CAAC;CAC1D,IAAI,OAAO;AACX,MAAK,IAAI,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;EACnC,MAAM,OAAO,IAAI,WAAW,EAAE;AAC9B,UAAQ,QAAQ,KAAK,OAAO;AAC5B,SAAO,OAAO;;AAEhB,QAAO,KAAK,SAAS,GAAG;;AAG1B,SAAgB,WACd,gBACA,gBACS;AACT,KAAI,CAAC,kBAAkB,CAAC,eACtB,QAAO;AAET,QAAO,mBAAmB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as _contractspec_lib_contracts30 from "@contractspec/lib.contracts";
|
|
2
|
+
|
|
3
|
+
//#region src/tests/operations.test-spec.d.ts
|
|
4
|
+
declare const SyncConfigCreateTest: _contractspec_lib_contracts30.TestSpec;
|
|
5
|
+
declare const FieldMappingAddTest: _contractspec_lib_contracts30.TestSpec;
|
|
6
|
+
declare const SyncRunListTest: _contractspec_lib_contracts30.TestSpec;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { FieldMappingAddTest, SyncConfigCreateTest, SyncRunListTest };
|
|
9
|
+
//# sourceMappingURL=operations.test-spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.test-spec.d.ts","names":[],"sources":["../../src/tests/operations.test-spec.ts"],"sourcesContent":[],"mappings":";;;cAEa,sBAyBX,6BAAA,CAzB+B;cA2BpB,qBAyBX,6BAAA,CAzB8B;cA2BnB,iBAyBX,6BAAA,CAzB0B"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { defineTestSpec } from "@contractspec/lib.contracts";
|
|
2
|
+
|
|
3
|
+
//#region src/tests/operations.test-spec.ts
|
|
4
|
+
const SyncConfigCreateTest = defineTestSpec({
|
|
5
|
+
meta: {
|
|
6
|
+
key: "integration.syncConfig.create.test",
|
|
7
|
+
version: "1.0.0",
|
|
8
|
+
stability: "experimental",
|
|
9
|
+
owners: ["@example.integration-hub"],
|
|
10
|
+
description: "Test for creating sync config",
|
|
11
|
+
tags: ["test"]
|
|
12
|
+
},
|
|
13
|
+
target: {
|
|
14
|
+
type: "operation",
|
|
15
|
+
operation: {
|
|
16
|
+
key: "integration.syncConfig.create",
|
|
17
|
+
version: "1.0.0"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
scenarios: [{
|
|
21
|
+
key: "success",
|
|
22
|
+
when: { operation: { key: "integration.syncConfig.create" } },
|
|
23
|
+
then: [{
|
|
24
|
+
type: "expectOutput",
|
|
25
|
+
match: {}
|
|
26
|
+
}]
|
|
27
|
+
}, {
|
|
28
|
+
key: "error",
|
|
29
|
+
when: { operation: { key: "integration.syncConfig.create" } },
|
|
30
|
+
then: [{ type: "expectError" }]
|
|
31
|
+
}]
|
|
32
|
+
});
|
|
33
|
+
const FieldMappingAddTest = defineTestSpec({
|
|
34
|
+
meta: {
|
|
35
|
+
key: "integration.fieldMapping.add.test",
|
|
36
|
+
version: "1.0.0",
|
|
37
|
+
stability: "experimental",
|
|
38
|
+
owners: ["@example.integration-hub"],
|
|
39
|
+
description: "Test for adding field mapping",
|
|
40
|
+
tags: ["test"]
|
|
41
|
+
},
|
|
42
|
+
target: {
|
|
43
|
+
type: "operation",
|
|
44
|
+
operation: {
|
|
45
|
+
key: "integration.fieldMapping.add",
|
|
46
|
+
version: "1.0.0"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
scenarios: [{
|
|
50
|
+
key: "success",
|
|
51
|
+
when: { operation: { key: "integration.fieldMapping.add" } },
|
|
52
|
+
then: [{
|
|
53
|
+
type: "expectOutput",
|
|
54
|
+
match: {}
|
|
55
|
+
}]
|
|
56
|
+
}, {
|
|
57
|
+
key: "error",
|
|
58
|
+
when: { operation: { key: "integration.fieldMapping.add" } },
|
|
59
|
+
then: [{ type: "expectError" }]
|
|
60
|
+
}]
|
|
61
|
+
});
|
|
62
|
+
const SyncRunListTest = defineTestSpec({
|
|
63
|
+
meta: {
|
|
64
|
+
key: "integration.syncRun.list.test",
|
|
65
|
+
version: "1.0.0",
|
|
66
|
+
stability: "experimental",
|
|
67
|
+
owners: ["@example.integration-hub"],
|
|
68
|
+
description: "Test for listing sync runs",
|
|
69
|
+
tags: ["test"]
|
|
70
|
+
},
|
|
71
|
+
target: {
|
|
72
|
+
type: "operation",
|
|
73
|
+
operation: {
|
|
74
|
+
key: "integration.syncRun.list",
|
|
75
|
+
version: "1.0.0"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
scenarios: [{
|
|
79
|
+
key: "success",
|
|
80
|
+
when: { operation: { key: "integration.syncRun.list" } },
|
|
81
|
+
then: [{
|
|
82
|
+
type: "expectOutput",
|
|
83
|
+
match: {}
|
|
84
|
+
}]
|
|
85
|
+
}, {
|
|
86
|
+
key: "error",
|
|
87
|
+
when: { operation: { key: "integration.syncRun.list" } },
|
|
88
|
+
then: [{ type: "expectError" }]
|
|
89
|
+
}]
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
//#endregion
|
|
93
|
+
export { FieldMappingAddTest, SyncConfigCreateTest, SyncRunListTest };
|
|
94
|
+
//# sourceMappingURL=operations.test-spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.test-spec.js","names":[],"sources":["../../src/tests/operations.test-spec.ts"],"sourcesContent":["import { defineTestSpec } from '@contractspec/lib.contracts';\n\nexport const SyncConfigCreateTest = defineTestSpec({\n meta: {\n key: 'integration.syncConfig.create.test',\n version: '1.0.0',\n stability: 'experimental',\n owners: ['@example.integration-hub'],\n description: 'Test for creating sync config',\n tags: ['test'],\n },\n target: {\n type: 'operation',\n operation: { key: 'integration.syncConfig.create', version: '1.0.0' },\n },\n scenarios: [\n {\n key: 'success',\n when: { operation: { key: 'integration.syncConfig.create' } },\n then: [{ type: 'expectOutput', match: {} }],\n },\n {\n key: 'error',\n when: { operation: { key: 'integration.syncConfig.create' } },\n then: [{ type: 'expectError' }],\n },\n ],\n});\n\nexport const FieldMappingAddTest = defineTestSpec({\n meta: {\n key: 'integration.fieldMapping.add.test',\n version: '1.0.0',\n stability: 'experimental',\n owners: ['@example.integration-hub'],\n description: 'Test for adding field mapping',\n tags: ['test'],\n },\n target: {\n type: 'operation',\n operation: { key: 'integration.fieldMapping.add', version: '1.0.0' },\n },\n scenarios: [\n {\n key: 'success',\n when: { operation: { key: 'integration.fieldMapping.add' } },\n then: [{ type: 'expectOutput', match: {} }],\n },\n {\n key: 'error',\n when: { operation: { key: 'integration.fieldMapping.add' } },\n then: [{ type: 'expectError' }],\n },\n ],\n});\n\nexport const SyncRunListTest = defineTestSpec({\n meta: {\n key: 'integration.syncRun.list.test',\n version: '1.0.0',\n stability: 'experimental',\n owners: ['@example.integration-hub'],\n description: 'Test for listing sync runs',\n tags: ['test'],\n },\n target: {\n type: 'operation',\n operation: { key: 'integration.syncRun.list', version: '1.0.0' },\n },\n scenarios: [\n {\n key: 'success',\n when: { operation: { key: 'integration.syncRun.list' } },\n then: [{ type: 'expectOutput', match: {} }],\n },\n {\n key: 'error',\n when: { operation: { key: 'integration.syncRun.list' } },\n then: [{ type: 'expectError' }],\n },\n ],\n});\n"],"mappings":";;;AAEA,MAAa,uBAAuB,eA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