@contractspec/example.integration-hub 1.57.0 → 1.58.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/browser/connection/connection.enum.js +12 -0
- package/dist/browser/connection/connection.operation.js +101 -0
- package/dist/browser/connection/connection.presentation.js +99 -0
- package/dist/browser/connection/connection.schema.js +48 -0
- package/dist/browser/connection/index.js +104 -0
- package/dist/browser/docs/index.js +104 -0
- package/dist/browser/docs/integration-hub.docblock.js +104 -0
- package/dist/browser/events.js +211 -0
- package/dist/browser/example.js +42 -0
- package/dist/browser/handlers/index.js +246 -0
- package/dist/browser/handlers/integration.handlers.js +246 -0
- package/dist/browser/index.js +1595 -0
- package/dist/browser/integration/index.js +92 -0
- package/dist/browser/integration/integration.enum.js +12 -0
- package/dist/browser/integration/integration.operations.js +89 -0
- package/dist/browser/integration/integration.presentation.js +117 -0
- package/dist/browser/integration/integration.schema.js +42 -0
- package/dist/browser/integration-hub.capability.js +40 -0
- package/dist/browser/integration-hub.feature.js +114 -0
- package/dist/browser/seeders/index.js +60 -0
- package/dist/browser/sync/index.js +332 -0
- package/dist/browser/sync/sync.enum.js +26 -0
- package/dist/browser/sync/sync.operations.js +321 -0
- package/dist/browser/sync/sync.presentation.js +298 -0
- package/dist/browser/sync/sync.schema.js +154 -0
- package/dist/browser/sync-engine/index.js +186 -0
- package/dist/browser/tests/operations.test-spec.js +85 -0
- package/dist/browser/ui/IntegrationDashboard.js +369 -0
- package/dist/browser/ui/hooks/index.js +57 -0
- package/dist/browser/ui/hooks/useIntegrationData.js +54 -0
- package/dist/browser/ui/index.js +644 -0
- package/dist/browser/ui/renderers/index.js +273 -0
- package/dist/browser/ui/renderers/integration.markdown.js +273 -0
- package/dist/connection/connection.enum.d.ts +1 -6
- package/dist/connection/connection.enum.d.ts.map +1 -1
- package/dist/connection/connection.enum.js +11 -15
- package/dist/connection/connection.operation.d.ts +78 -84
- package/dist/connection/connection.operation.d.ts.map +1 -1
- package/dist/connection/connection.operation.js +99 -60
- package/dist/connection/connection.presentation.d.ts +2 -7
- package/dist/connection/connection.presentation.d.ts.map +1 -1
- package/dist/connection/connection.presentation.js +96 -56
- package/dist/connection/connection.schema.d.ts +54 -59
- package/dist/connection/connection.schema.d.ts.map +1 -1
- package/dist/connection/connection.schema.js +46 -73
- package/dist/connection/index.d.ts +7 -4
- package/dist/connection/index.d.ts.map +1 -0
- package/dist/connection/index.js +104 -4
- package/dist/docs/index.d.ts +2 -1
- package/dist/docs/index.d.ts.map +1 -0
- package/dist/docs/index.js +105 -1
- package/dist/docs/integration-hub.docblock.d.ts +2 -1
- package/dist/docs/integration-hub.docblock.d.ts.map +1 -0
- package/dist/docs/integration-hub.docblock.js +45 -56
- package/dist/events.d.ts +137 -143
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +210 -287
- package/dist/example.d.ts +2 -6
- package/dist/example.d.ts.map +1 -1
- package/dist/example.js +41 -55
- package/dist/handlers/index.d.ts +2 -2
- package/dist/handlers/index.d.ts.map +1 -0
- package/dist/handlers/index.js +247 -3
- package/dist/handlers/integration.handlers.d.ts +114 -113
- package/dist/handlers/integration.handlers.d.ts.map +1 -1
- package/dist/handlers/integration.handlers.js +232 -267
- package/dist/index.d.ts +12 -19
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1596 -20
- package/dist/integration/index.d.ts +7 -4
- package/dist/integration/index.d.ts.map +1 -0
- package/dist/integration/index.js +92 -4
- package/dist/integration/integration.enum.d.ts +1 -6
- package/dist/integration/integration.enum.d.ts.map +1 -1
- package/dist/integration/integration.enum.js +11 -15
- package/dist/integration/integration.operations.d.ts +74 -80
- package/dist/integration/integration.operations.d.ts.map +1 -1
- package/dist/integration/integration.operations.js +87 -54
- package/dist/integration/integration.presentation.d.ts +3 -8
- package/dist/integration/integration.presentation.d.ts.map +1 -1
- package/dist/integration/integration.presentation.js +114 -73
- package/dist/integration/integration.schema.d.ts +54 -59
- package/dist/integration/integration.schema.d.ts.map +1 -1
- package/dist/integration/integration.schema.js +40 -73
- package/dist/integration-hub.capability.d.ts +3 -8
- package/dist/integration-hub.capability.d.ts.map +1 -1
- package/dist/integration-hub.capability.js +41 -38
- package/dist/integration-hub.feature.d.ts +1 -6
- package/dist/integration-hub.feature.d.ts.map +1 -1
- package/dist/integration-hub.feature.js +113 -242
- package/dist/node/connection/connection.enum.js +12 -0
- package/dist/node/connection/connection.operation.js +101 -0
- package/dist/node/connection/connection.presentation.js +99 -0
- package/dist/node/connection/connection.schema.js +48 -0
- package/dist/node/connection/index.js +104 -0
- package/dist/node/docs/index.js +104 -0
- package/dist/node/docs/integration-hub.docblock.js +104 -0
- package/dist/node/events.js +211 -0
- package/dist/node/example.js +42 -0
- package/dist/node/handlers/index.js +246 -0
- package/dist/node/handlers/integration.handlers.js +246 -0
- package/dist/node/index.js +1595 -0
- package/dist/node/integration/index.js +92 -0
- package/dist/node/integration/integration.enum.js +12 -0
- package/dist/node/integration/integration.operations.js +89 -0
- package/dist/node/integration/integration.presentation.js +117 -0
- package/dist/node/integration/integration.schema.js +42 -0
- package/dist/node/integration-hub.capability.js +40 -0
- package/dist/node/integration-hub.feature.js +114 -0
- package/dist/node/seeders/index.js +60 -0
- package/dist/node/sync/index.js +332 -0
- package/dist/node/sync/sync.enum.js +26 -0
- package/dist/node/sync/sync.operations.js +321 -0
- package/dist/node/sync/sync.presentation.js +298 -0
- package/dist/node/sync/sync.schema.js +154 -0
- package/dist/node/sync-engine/index.js +186 -0
- package/dist/node/tests/operations.test-spec.js +85 -0
- package/dist/node/ui/IntegrationDashboard.js +369 -0
- package/dist/node/ui/hooks/index.js +57 -0
- package/dist/node/ui/hooks/useIntegrationData.js +54 -0
- package/dist/node/ui/index.js +644 -0
- package/dist/node/ui/renderers/index.js +273 -0
- package/dist/node/ui/renderers/integration.markdown.js +273 -0
- package/dist/seeders/index.d.ts +4 -8
- package/dist/seeders/index.d.ts.map +1 -1
- package/dist/seeders/index.js +54 -52
- package/dist/sync/index.d.ts +7 -4
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/sync/index.js +332 -4
- package/dist/sync/sync.enum.d.ts +3 -8
- package/dist/sync/sync.enum.d.ts.map +1 -1
- package/dist/sync/sync.enum.js +23 -31
- package/dist/sync/sync.operations.d.ts +413 -419
- package/dist/sync/sync.operations.d.ts.map +1 -1
- package/dist/sync/sync.operations.js +316 -197
- package/dist/sync/sync.presentation.d.ts +6 -11
- package/dist/sync/sync.presentation.d.ts.map +1 -1
- package/dist/sync/sync.presentation.js +291 -160
- package/dist/sync/sync.schema.d.ts +317 -322
- package/dist/sync/sync.schema.d.ts.map +1 -1
- package/dist/sync/sync.schema.js +146 -295
- package/dist/sync-engine/index.d.ts +88 -91
- package/dist/sync-engine/index.d.ts.map +1 -1
- package/dist/sync-engine/index.js +181 -142
- package/dist/tests/operations.test-spec.d.ts +3 -8
- package/dist/tests/operations.test-spec.d.ts.map +1 -1
- package/dist/tests/operations.test-spec.js +82 -90
- package/dist/ui/IntegrationDashboard.d.ts +1 -6
- package/dist/ui/IntegrationDashboard.d.ts.map +1 -1
- package/dist/ui/IntegrationDashboard.js +365 -261
- package/dist/ui/hooks/index.d.ts +2 -2
- package/dist/ui/hooks/index.d.ts.map +1 -0
- package/dist/ui/hooks/index.js +57 -4
- package/dist/ui/hooks/useIntegrationData.d.ts +16 -20
- package/dist/ui/hooks/useIntegrationData.d.ts.map +1 -1
- package/dist/ui/hooks/useIntegrationData.js +51 -55
- package/dist/ui/index.d.ts +7 -6
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +644 -5
- package/dist/ui/renderers/index.d.ts +2 -2
- package/dist/ui/renderers/index.d.ts.map +1 -0
- package/dist/ui/renderers/index.js +274 -3
- package/dist/ui/renderers/integration.markdown.d.ts +13 -14
- package/dist/ui/renderers/integration.markdown.d.ts.map +1 -1
- package/dist/ui/renderers/integration.markdown.js +268 -264
- package/package.json +360 -71
- package/dist/connection/connection.enum.js.map +0 -1
- package/dist/connection/connection.operation.js.map +0 -1
- package/dist/connection/connection.presentation.js.map +0 -1
- package/dist/connection/connection.schema.js.map +0 -1
- package/dist/docs/integration-hub.docblock.js.map +0 -1
- package/dist/events.js.map +0 -1
- package/dist/example.js.map +0 -1
- package/dist/handlers/integration.handlers.js.map +0 -1
- package/dist/integration/integration.enum.js.map +0 -1
- package/dist/integration/integration.operations.js.map +0 -1
- package/dist/integration/integration.presentation.js.map +0 -1
- package/dist/integration/integration.schema.js.map +0 -1
- package/dist/integration-hub.capability.js.map +0 -1
- package/dist/integration-hub.feature.js.map +0 -1
- package/dist/seeders/index.js.map +0 -1
- package/dist/sync/sync.enum.js.map +0 -1
- package/dist/sync/sync.operations.js.map +0 -1
- package/dist/sync/sync.presentation.js.map +0 -1
- package/dist/sync/sync.schema.js.map +0 -1
- package/dist/sync-engine/index.js.map +0 -1
- package/dist/tests/operations.test-spec.js.map +0 -1
- package/dist/ui/IntegrationDashboard.js.map +0 -1
- package/dist/ui/hooks/useIntegrationData.js.map +0 -1
- package/dist/ui/renderers/integration.markdown.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.schema.d.ts","
|
|
1
|
+
{"version":3,"file":"sync.schema.d.ts","sourceRoot":"","sources":["../../src/sync/sync.schema.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;EAa5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmB1B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBvB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAerC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBpC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;EAOhC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;EAgBjC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMlC,CAAC"}
|
package/dist/sync/sync.schema.js
CHANGED
|
@@ -1,304 +1,155 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// @bun
|
|
2
|
+
// src/sync/sync.enum.ts
|
|
3
|
+
import { defineEnum } from "@contractspec/lib.schema";
|
|
4
|
+
var SyncDirectionEnum = defineEnum("SyncDirection", [
|
|
5
|
+
"INBOUND",
|
|
6
|
+
"OUTBOUND",
|
|
7
|
+
"BIDIRECTIONAL"
|
|
8
|
+
]);
|
|
9
|
+
var SyncStatusEnum = defineEnum("SyncStatus", [
|
|
10
|
+
"PENDING",
|
|
11
|
+
"RUNNING",
|
|
12
|
+
"COMPLETED",
|
|
13
|
+
"FAILED",
|
|
14
|
+
"CANCELLED"
|
|
15
|
+
]);
|
|
16
|
+
var MappingTypeEnum = defineEnum("MappingType", [
|
|
17
|
+
"DIRECT",
|
|
18
|
+
"TRANSFORM",
|
|
19
|
+
"LOOKUP",
|
|
20
|
+
"CONSTANT",
|
|
21
|
+
"COMPUTED"
|
|
22
|
+
]);
|
|
3
23
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
targetField: {
|
|
20
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
21
|
-
isOptional: false
|
|
22
|
-
},
|
|
23
|
-
mappingType: {
|
|
24
|
-
type: MappingTypeEnum,
|
|
25
|
-
isOptional: false
|
|
26
|
-
},
|
|
27
|
-
transformExpression: {
|
|
28
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
29
|
-
isOptional: true
|
|
30
|
-
},
|
|
31
|
-
isRequired: {
|
|
32
|
-
type: ScalarTypeEnum.Boolean(),
|
|
33
|
-
isOptional: false
|
|
34
|
-
}
|
|
35
|
-
}
|
|
24
|
+
// src/sync/sync.schema.ts
|
|
25
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
26
|
+
var FieldMappingModel = defineSchemaModel({
|
|
27
|
+
name: "FieldMappingModel",
|
|
28
|
+
fields: {
|
|
29
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
30
|
+
sourceField: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
31
|
+
targetField: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
32
|
+
mappingType: { type: MappingTypeEnum, isOptional: false },
|
|
33
|
+
transformExpression: {
|
|
34
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
35
|
+
isOptional: true
|
|
36
|
+
},
|
|
37
|
+
isRequired: { type: ScalarTypeEnum.Boolean(), isOptional: false }
|
|
38
|
+
}
|
|
36
39
|
});
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
57
|
-
isOptional: false
|
|
58
|
-
},
|
|
59
|
-
direction: {
|
|
60
|
-
type: SyncDirectionEnum,
|
|
61
|
-
isOptional: false
|
|
62
|
-
},
|
|
63
|
-
sourceObject: {
|
|
64
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
65
|
-
isOptional: false
|
|
66
|
-
},
|
|
67
|
-
targetObject: {
|
|
68
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
69
|
-
isOptional: false
|
|
70
|
-
},
|
|
71
|
-
scheduleEnabled: {
|
|
72
|
-
type: ScalarTypeEnum.Boolean(),
|
|
73
|
-
isOptional: false
|
|
74
|
-
},
|
|
75
|
-
scheduleCron: {
|
|
76
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
77
|
-
isOptional: true
|
|
78
|
-
},
|
|
79
|
-
isActive: {
|
|
80
|
-
type: ScalarTypeEnum.Boolean(),
|
|
81
|
-
isOptional: false
|
|
82
|
-
},
|
|
83
|
-
lastSyncAt: {
|
|
84
|
-
type: ScalarTypeEnum.DateTime(),
|
|
85
|
-
isOptional: true
|
|
86
|
-
},
|
|
87
|
-
fieldMappings: {
|
|
88
|
-
type: FieldMappingModel,
|
|
89
|
-
isArray: true,
|
|
90
|
-
isOptional: true
|
|
91
|
-
}
|
|
92
|
-
}
|
|
40
|
+
var SyncConfigModel = defineSchemaModel({
|
|
41
|
+
name: "SyncConfigModel",
|
|
42
|
+
fields: {
|
|
43
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
44
|
+
integrationId: {
|
|
45
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
46
|
+
isOptional: false
|
|
47
|
+
},
|
|
48
|
+
connectionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
49
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
50
|
+
direction: { type: SyncDirectionEnum, isOptional: false },
|
|
51
|
+
sourceObject: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
52
|
+
targetObject: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
53
|
+
scheduleEnabled: { type: ScalarTypeEnum.Boolean(), isOptional: false },
|
|
54
|
+
scheduleCron: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
55
|
+
isActive: { type: ScalarTypeEnum.Boolean(), isOptional: false },
|
|
56
|
+
lastSyncAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
57
|
+
fieldMappings: { type: FieldMappingModel, isArray: true, isOptional: true }
|
|
58
|
+
}
|
|
93
59
|
});
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
isOptional: false
|
|
115
|
-
},
|
|
116
|
-
trigger: {
|
|
117
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
118
|
-
isOptional: false
|
|
119
|
-
},
|
|
120
|
-
recordsProcessed: {
|
|
121
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
122
|
-
isOptional: false
|
|
123
|
-
},
|
|
124
|
-
recordsCreated: {
|
|
125
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
126
|
-
isOptional: false
|
|
127
|
-
},
|
|
128
|
-
recordsUpdated: {
|
|
129
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
130
|
-
isOptional: false
|
|
131
|
-
},
|
|
132
|
-
recordsFailed: {
|
|
133
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
134
|
-
isOptional: false
|
|
135
|
-
},
|
|
136
|
-
errorMessage: {
|
|
137
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
138
|
-
isOptional: true
|
|
139
|
-
},
|
|
140
|
-
startedAt: {
|
|
141
|
-
type: ScalarTypeEnum.DateTime(),
|
|
142
|
-
isOptional: true
|
|
143
|
-
},
|
|
144
|
-
completedAt: {
|
|
145
|
-
type: ScalarTypeEnum.DateTime(),
|
|
146
|
-
isOptional: true
|
|
147
|
-
},
|
|
148
|
-
createdAt: {
|
|
149
|
-
type: ScalarTypeEnum.DateTime(),
|
|
150
|
-
isOptional: false
|
|
151
|
-
}
|
|
152
|
-
}
|
|
60
|
+
var SyncRunModel = defineSchemaModel({
|
|
61
|
+
name: "SyncRunModel",
|
|
62
|
+
fields: {
|
|
63
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
64
|
+
syncConfigId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
65
|
+
status: { type: SyncStatusEnum, isOptional: false },
|
|
66
|
+
direction: { type: SyncDirectionEnum, isOptional: false },
|
|
67
|
+
trigger: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
68
|
+
recordsProcessed: {
|
|
69
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
70
|
+
isOptional: false
|
|
71
|
+
},
|
|
72
|
+
recordsCreated: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
73
|
+
recordsUpdated: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
74
|
+
recordsFailed: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
75
|
+
errorMessage: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
76
|
+
startedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
77
|
+
completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
78
|
+
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
79
|
+
}
|
|
153
80
|
});
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
type: ScalarTypeEnum.NonEmptyString(),
|
|
170
|
-
isOptional: false
|
|
171
|
-
},
|
|
172
|
-
direction: {
|
|
173
|
-
type: SyncDirectionEnum,
|
|
174
|
-
isOptional: false
|
|
175
|
-
},
|
|
176
|
-
sourceObject: {
|
|
177
|
-
type: ScalarTypeEnum.NonEmptyString(),
|
|
178
|
-
isOptional: false
|
|
179
|
-
},
|
|
180
|
-
targetObject: {
|
|
181
|
-
type: ScalarTypeEnum.NonEmptyString(),
|
|
182
|
-
isOptional: false
|
|
183
|
-
},
|
|
184
|
-
scheduleEnabled: {
|
|
185
|
-
type: ScalarTypeEnum.Boolean(),
|
|
186
|
-
isOptional: true
|
|
187
|
-
},
|
|
188
|
-
scheduleCron: {
|
|
189
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
190
|
-
isOptional: true
|
|
191
|
-
}
|
|
192
|
-
}
|
|
81
|
+
var CreateSyncConfigInputModel = defineSchemaModel({
|
|
82
|
+
name: "CreateSyncConfigInput",
|
|
83
|
+
fields: {
|
|
84
|
+
integrationId: {
|
|
85
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
86
|
+
isOptional: false
|
|
87
|
+
},
|
|
88
|
+
connectionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
89
|
+
name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
90
|
+
direction: { type: SyncDirectionEnum, isOptional: false },
|
|
91
|
+
sourceObject: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
92
|
+
targetObject: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
93
|
+
scheduleEnabled: { type: ScalarTypeEnum.Boolean(), isOptional: true },
|
|
94
|
+
scheduleCron: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
|
|
95
|
+
}
|
|
193
96
|
});
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
isOptional: false
|
|
211
|
-
},
|
|
212
|
-
mappingType: {
|
|
213
|
-
type: MappingTypeEnum,
|
|
214
|
-
isOptional: false
|
|
215
|
-
},
|
|
216
|
-
transformExpression: {
|
|
217
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
218
|
-
isOptional: true
|
|
219
|
-
},
|
|
220
|
-
lookupConfig: {
|
|
221
|
-
type: ScalarTypeEnum.JSON(),
|
|
222
|
-
isOptional: true
|
|
223
|
-
},
|
|
224
|
-
constantValue: {
|
|
225
|
-
type: ScalarTypeEnum.JSON(),
|
|
226
|
-
isOptional: true
|
|
227
|
-
},
|
|
228
|
-
isRequired: {
|
|
229
|
-
type: ScalarTypeEnum.Boolean(),
|
|
230
|
-
isOptional: true
|
|
231
|
-
},
|
|
232
|
-
defaultValue: {
|
|
233
|
-
type: ScalarTypeEnum.JSON(),
|
|
234
|
-
isOptional: true
|
|
235
|
-
}
|
|
236
|
-
}
|
|
97
|
+
var AddFieldMappingInputModel = defineSchemaModel({
|
|
98
|
+
name: "AddFieldMappingInput",
|
|
99
|
+
fields: {
|
|
100
|
+
syncConfigId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
101
|
+
sourceField: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
102
|
+
targetField: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
103
|
+
mappingType: { type: MappingTypeEnum, isOptional: false },
|
|
104
|
+
transformExpression: {
|
|
105
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
106
|
+
isOptional: true
|
|
107
|
+
},
|
|
108
|
+
lookupConfig: { type: ScalarTypeEnum.JSON(), isOptional: true },
|
|
109
|
+
constantValue: { type: ScalarTypeEnum.JSON(), isOptional: true },
|
|
110
|
+
isRequired: { type: ScalarTypeEnum.Boolean(), isOptional: true },
|
|
111
|
+
defaultValue: { type: ScalarTypeEnum.JSON(), isOptional: true }
|
|
112
|
+
}
|
|
237
113
|
});
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
246
|
-
isOptional: false
|
|
247
|
-
},
|
|
248
|
-
direction: {
|
|
249
|
-
type: SyncDirectionEnum,
|
|
250
|
-
isOptional: true
|
|
251
|
-
},
|
|
252
|
-
fullSync: {
|
|
253
|
-
type: ScalarTypeEnum.Boolean(),
|
|
254
|
-
isOptional: true
|
|
255
|
-
}
|
|
256
|
-
}
|
|
114
|
+
var TriggerSyncInputModel = defineSchemaModel({
|
|
115
|
+
name: "TriggerSyncInput",
|
|
116
|
+
fields: {
|
|
117
|
+
syncConfigId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
118
|
+
direction: { type: SyncDirectionEnum, isOptional: true },
|
|
119
|
+
fullSync: { type: ScalarTypeEnum.Boolean(), isOptional: true }
|
|
120
|
+
}
|
|
257
121
|
});
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
isOptional: true,
|
|
275
|
-
defaultValue: 20
|
|
276
|
-
},
|
|
277
|
-
offset: {
|
|
278
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
279
|
-
isOptional: true,
|
|
280
|
-
defaultValue: 0
|
|
281
|
-
}
|
|
282
|
-
}
|
|
122
|
+
var ListSyncRunsInputModel = defineSchemaModel({
|
|
123
|
+
name: "ListSyncRunsInput",
|
|
124
|
+
fields: {
|
|
125
|
+
syncConfigId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
126
|
+
status: { type: SyncStatusEnum, isOptional: true },
|
|
127
|
+
limit: {
|
|
128
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
129
|
+
isOptional: true,
|
|
130
|
+
defaultValue: 20
|
|
131
|
+
},
|
|
132
|
+
offset: {
|
|
133
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
134
|
+
isOptional: true,
|
|
135
|
+
defaultValue: 0
|
|
136
|
+
}
|
|
137
|
+
}
|
|
283
138
|
});
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
runs: {
|
|
291
|
-
type: SyncRunModel,
|
|
292
|
-
isArray: true,
|
|
293
|
-
isOptional: false
|
|
294
|
-
},
|
|
295
|
-
total: {
|
|
296
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
297
|
-
isOptional: false
|
|
298
|
-
}
|
|
299
|
-
}
|
|
139
|
+
var ListSyncRunsOutputModel = defineSchemaModel({
|
|
140
|
+
name: "ListSyncRunsOutput",
|
|
141
|
+
fields: {
|
|
142
|
+
runs: { type: SyncRunModel, isArray: true, isOptional: false },
|
|
143
|
+
total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false }
|
|
144
|
+
}
|
|
300
145
|
});
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
146
|
+
export {
|
|
147
|
+
TriggerSyncInputModel,
|
|
148
|
+
SyncRunModel,
|
|
149
|
+
SyncConfigModel,
|
|
150
|
+
ListSyncRunsOutputModel,
|
|
151
|
+
ListSyncRunsInputModel,
|
|
152
|
+
FieldMappingModel,
|
|
153
|
+
CreateSyncConfigInputModel,
|
|
154
|
+
AddFieldMappingInputModel
|
|
155
|
+
};
|
|
@@ -1,109 +1,106 @@
|
|
|
1
|
-
//#region src/sync-engine/index.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Sync Engine
|
|
4
3
|
*
|
|
5
4
|
* Core sync logic for the Integration Hub.
|
|
6
5
|
*/
|
|
7
|
-
interface FieldMapping {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
export interface FieldMapping {
|
|
7
|
+
sourceField: string;
|
|
8
|
+
targetField: string;
|
|
9
|
+
mappingType: 'DIRECT' | 'TRANSFORM' | 'LOOKUP' | 'CONSTANT' | 'COMPUTED';
|
|
10
|
+
transformExpression?: string;
|
|
11
|
+
lookupConfig?: LookupConfig;
|
|
12
|
+
constantValue?: unknown;
|
|
13
|
+
isRequired: boolean;
|
|
14
|
+
defaultValue?: unknown;
|
|
16
15
|
}
|
|
17
|
-
interface LookupConfig {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
export interface LookupConfig {
|
|
17
|
+
sourceObject: string;
|
|
18
|
+
lookupField: string;
|
|
19
|
+
returnField: string;
|
|
21
20
|
}
|
|
22
|
-
interface SyncConfig {
|
|
23
|
-
id: string;
|
|
24
|
-
direction: 'INBOUND' | 'OUTBOUND' | 'BIDIRECTIONAL';
|
|
25
|
-
sourceObject: string;
|
|
26
|
-
targetObject: string;
|
|
27
|
-
fieldMappings: FieldMapping[];
|
|
28
|
-
createNew: boolean;
|
|
29
|
-
updateExisting: boolean;
|
|
30
|
-
deleteRemoved: boolean;
|
|
31
|
-
sourceFilter?: Record<string, unknown>;
|
|
32
|
-
}
|
|
33
|
-
interface SyncContext {
|
|
34
|
-
runId: string;
|
|
35
|
-
config: SyncConfig;
|
|
36
|
-
connection: {
|
|
21
|
+
export interface SyncConfig {
|
|
37
22
|
id: string;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
23
|
+
direction: 'INBOUND' | 'OUTBOUND' | 'BIDIRECTIONAL';
|
|
24
|
+
sourceObject: string;
|
|
25
|
+
targetObject: string;
|
|
26
|
+
fieldMappings: FieldMapping[];
|
|
27
|
+
createNew: boolean;
|
|
28
|
+
updateExisting: boolean;
|
|
29
|
+
deleteRemoved: boolean;
|
|
30
|
+
sourceFilter?: Record<string, unknown>;
|
|
41
31
|
}
|
|
42
|
-
interface
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
errors: SyncError[];
|
|
32
|
+
export interface SyncContext {
|
|
33
|
+
runId: string;
|
|
34
|
+
config: SyncConfig;
|
|
35
|
+
connection: {
|
|
36
|
+
id: string;
|
|
37
|
+
authType: string;
|
|
38
|
+
credentials?: Record<string, unknown>;
|
|
39
|
+
};
|
|
51
40
|
}
|
|
52
|
-
interface
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
41
|
+
export interface SyncResult {
|
|
42
|
+
success: boolean;
|
|
43
|
+
recordsProcessed: number;
|
|
44
|
+
recordsCreated: number;
|
|
45
|
+
recordsUpdated: number;
|
|
46
|
+
recordsDeleted: number;
|
|
47
|
+
recordsFailed: number;
|
|
48
|
+
recordsSkipped: number;
|
|
49
|
+
errors: SyncError[];
|
|
57
50
|
}
|
|
58
|
-
interface
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
51
|
+
export interface SyncError {
|
|
52
|
+
recordId?: string;
|
|
53
|
+
field?: string;
|
|
54
|
+
message: string;
|
|
55
|
+
code: string;
|
|
62
56
|
}
|
|
63
|
-
interface
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
57
|
+
export interface SourceRecord {
|
|
58
|
+
id: string;
|
|
59
|
+
data: Record<string, unknown>;
|
|
60
|
+
checksum?: string;
|
|
67
61
|
}
|
|
68
|
-
interface
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
sync(context: SyncContext): Promise<SyncResult>;
|
|
73
|
-
/**
|
|
74
|
-
* Transform a source record to target format.
|
|
75
|
-
*/
|
|
76
|
-
transformRecord(sourceRecord: SourceRecord, mappings: FieldMapping[], context: SyncContext): TargetRecord;
|
|
77
|
-
/**
|
|
78
|
-
* Validate a transformed record.
|
|
79
|
-
*/
|
|
80
|
-
validateRecord(record: TargetRecord, mappings: FieldMapping[]): {
|
|
81
|
-
valid: boolean;
|
|
82
|
-
errors: SyncError[];
|
|
83
|
-
};
|
|
62
|
+
export interface TargetRecord {
|
|
63
|
+
id: string;
|
|
64
|
+
data: Record<string, unknown>;
|
|
65
|
+
checksum?: string;
|
|
84
66
|
}
|
|
85
|
-
interface
|
|
86
|
-
|
|
67
|
+
export interface ISyncEngine {
|
|
68
|
+
/**
|
|
69
|
+
* Execute a sync operation.
|
|
70
|
+
*/
|
|
71
|
+
sync(context: SyncContext): Promise<SyncResult>;
|
|
72
|
+
/**
|
|
73
|
+
* Transform a source record to target format.
|
|
74
|
+
*/
|
|
75
|
+
transformRecord(sourceRecord: SourceRecord, mappings: FieldMapping[], context: SyncContext): TargetRecord;
|
|
76
|
+
/**
|
|
77
|
+
* Validate a transformed record.
|
|
78
|
+
*/
|
|
79
|
+
validateRecord(record: TargetRecord, mappings: FieldMapping[]): {
|
|
80
|
+
valid: boolean;
|
|
81
|
+
errors: SyncError[];
|
|
82
|
+
};
|
|
87
83
|
}
|
|
88
|
-
|
|
89
|
-
|
|
84
|
+
export interface IFieldTransformer {
|
|
85
|
+
transform(value: unknown, expression: string): unknown;
|
|
90
86
|
}
|
|
91
|
-
declare class
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
87
|
+
export declare class BasicFieldTransformer implements IFieldTransformer {
|
|
88
|
+
transform(value: unknown, expression: string): unknown;
|
|
89
|
+
}
|
|
90
|
+
export declare class BasicSyncEngine implements ISyncEngine {
|
|
91
|
+
private transformer;
|
|
92
|
+
constructor(transformer?: IFieldTransformer);
|
|
93
|
+
sync(_context: SyncContext): Promise<SyncResult>;
|
|
94
|
+
transformRecord(sourceRecord: SourceRecord, mappings: FieldMapping[], _context: SyncContext): TargetRecord;
|
|
95
|
+
validateRecord(record: TargetRecord, mappings: FieldMapping[]): {
|
|
96
|
+
valid: boolean;
|
|
97
|
+
errors: SyncError[];
|
|
98
|
+
};
|
|
99
|
+
private getNestedValue;
|
|
100
|
+
private setNestedValue;
|
|
101
|
+
private evaluateComputed;
|
|
103
102
|
}
|
|
104
|
-
declare function createSyncEngine(transformer?: IFieldTransformer): ISyncEngine;
|
|
105
|
-
declare function computeChecksum(data: Record<string, unknown>): string;
|
|
106
|
-
declare function hasChanges(sourceChecksum: string | undefined, targetChecksum: string | undefined): boolean;
|
|
107
|
-
//#endregion
|
|
108
|
-
export { BasicFieldTransformer, BasicSyncEngine, FieldMapping, IFieldTransformer, ISyncEngine, LookupConfig, SourceRecord, SyncConfig, SyncContext, SyncError, SyncResult, TargetRecord, computeChecksum, createSyncEngine, hasChanges };
|
|
103
|
+
export declare function createSyncEngine(transformer?: IFieldTransformer): ISyncEngine;
|
|
104
|
+
export declare function computeChecksum(data: Record<string, unknown>): string;
|
|
105
|
+
export declare function hasChanges(sourceChecksum: string | undefined, targetChecksum: string | undefined): boolean;
|
|
109
106
|
//# sourceMappingURL=index.d.ts.map
|