@contractspec/example.integration-hub 1.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +156 -0
  3. package/dist/connection/connection.enum.d.ts +10 -0
  4. package/dist/connection/connection.enum.d.ts.map +1 -0
  5. package/dist/connection/connection.enum.js +17 -0
  6. package/dist/connection/connection.enum.js.map +1 -0
  7. package/dist/connection/connection.operation.d.ts +107 -0
  8. package/dist/connection/connection.operation.d.ts.map +1 -0
  9. package/dist/connection/connection.operation.js +63 -0
  10. package/dist/connection/connection.operation.js.map +1 -0
  11. package/dist/connection/connection.presentation.d.ts +8 -0
  12. package/dist/connection/connection.presentation.d.ts.map +1 -0
  13. package/dist/connection/connection.presentation.js +60 -0
  14. package/dist/connection/connection.presentation.js.map +1 -0
  15. package/dist/connection/connection.schema.d.ts +68 -0
  16. package/dist/connection/connection.schema.d.ts.map +1 -0
  17. package/dist/connection/connection.schema.js +76 -0
  18. package/dist/connection/connection.schema.js.map +1 -0
  19. package/dist/connection/index.d.ts +4 -0
  20. package/dist/connection/index.js +5 -0
  21. package/dist/docs/index.d.ts +1 -0
  22. package/dist/docs/index.js +1 -0
  23. package/dist/docs/integration-hub.docblock.d.ts +1 -0
  24. package/dist/docs/integration-hub.docblock.js +115 -0
  25. package/dist/docs/integration-hub.docblock.js.map +1 -0
  26. package/dist/events.d.ts +153 -0
  27. package/dist/events.d.ts.map +1 -0
  28. package/dist/events.js +289 -0
  29. package/dist/events.js.map +1 -0
  30. package/dist/example.d.ts +40 -0
  31. package/dist/example.d.ts.map +1 -0
  32. package/dist/example.js +51 -0
  33. package/dist/example.js.map +1 -0
  34. package/dist/index.d.ts +14 -0
  35. package/dist/index.js +15 -0
  36. package/dist/integration/index.d.ts +4 -0
  37. package/dist/integration/index.js +5 -0
  38. package/dist/integration/integration.enum.d.ts +10 -0
  39. package/dist/integration/integration.enum.d.ts.map +1 -0
  40. package/dist/integration/integration.enum.js +17 -0
  41. package/dist/integration/integration.enum.js.map +1 -0
  42. package/dist/integration/integration.operations.d.ts +99 -0
  43. package/dist/integration/integration.operations.d.ts.map +1 -0
  44. package/dist/integration/integration.operations.js +57 -0
  45. package/dist/integration/integration.operations.js.map +1 -0
  46. package/dist/integration/integration.presentation.d.ts +9 -0
  47. package/dist/integration/integration.presentation.d.ts.map +1 -0
  48. package/dist/integration/integration.presentation.js +77 -0
  49. package/dist/integration/integration.presentation.js.map +1 -0
  50. package/dist/integration/integration.schema.d.ts +68 -0
  51. package/dist/integration/integration.schema.d.ts.map +1 -0
  52. package/dist/integration/integration.schema.js +76 -0
  53. package/dist/integration/integration.schema.js.map +1 -0
  54. package/dist/integration-hub.feature.d.ts +8 -0
  55. package/dist/integration-hub.feature.d.ts.map +1 -0
  56. package/dist/integration-hub.feature.js +239 -0
  57. package/dist/integration-hub.feature.js.map +1 -0
  58. package/dist/sync/index.d.ts +4 -0
  59. package/dist/sync/index.js +5 -0
  60. package/dist/sync/sync.enum.d.ts +18 -0
  61. package/dist/sync/sync.enum.d.ts.map +1 -0
  62. package/dist/sync/sync.enum.js +35 -0
  63. package/dist/sync/sync.enum.js.map +1 -0
  64. package/dist/sync/sync.operations.d.ts +509 -0
  65. package/dist/sync/sync.operations.d.ts.map +1 -0
  66. package/dist/sync/sync.operations.js +203 -0
  67. package/dist/sync/sync.operations.js.map +1 -0
  68. package/dist/sync/sync.presentation.d.ts +12 -0
  69. package/dist/sync/sync.presentation.d.ts.map +1 -0
  70. package/dist/sync/sync.presentation.js +168 -0
  71. package/dist/sync/sync.presentation.js.map +1 -0
  72. package/dist/sync/sync.schema.d.ts +356 -0
  73. package/dist/sync/sync.schema.d.ts.map +1 -0
  74. package/dist/sync/sync.schema.js +304 -0
  75. package/dist/sync/sync.schema.js.map +1 -0
  76. package/dist/sync-engine/index.d.ts +109 -0
  77. package/dist/sync-engine/index.d.ts.map +1 -0
  78. package/dist/sync-engine/index.js +148 -0
  79. package/dist/sync-engine/index.js.map +1 -0
  80. package/package.json +103 -0
@@ -0,0 +1,304 @@
1
+ import { MappingTypeEnum, SyncDirectionEnum, SyncStatusEnum } from "./sync.enum.js";
2
+ import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
3
+
4
+ //#region src/sync/sync.schema.ts
5
+ /**
6
+ * A field mapping configuration.
7
+ */
8
+ const FieldMappingModel = defineSchemaModel({
9
+ name: "FieldMappingModel",
10
+ fields: {
11
+ id: {
12
+ type: ScalarTypeEnum.String_unsecure(),
13
+ isOptional: false
14
+ },
15
+ sourceField: {
16
+ type: ScalarTypeEnum.String_unsecure(),
17
+ isOptional: false
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
+ }
36
+ });
37
+ /**
38
+ * A sync configuration.
39
+ */
40
+ const SyncConfigModel = defineSchemaModel({
41
+ name: "SyncConfigModel",
42
+ fields: {
43
+ id: {
44
+ type: ScalarTypeEnum.String_unsecure(),
45
+ isOptional: false
46
+ },
47
+ integrationId: {
48
+ type: ScalarTypeEnum.String_unsecure(),
49
+ isOptional: false
50
+ },
51
+ connectionId: {
52
+ type: ScalarTypeEnum.String_unsecure(),
53
+ isOptional: false
54
+ },
55
+ name: {
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
+ }
93
+ });
94
+ /**
95
+ * A sync run.
96
+ */
97
+ const SyncRunModel = defineSchemaModel({
98
+ name: "SyncRunModel",
99
+ fields: {
100
+ id: {
101
+ type: ScalarTypeEnum.String_unsecure(),
102
+ isOptional: false
103
+ },
104
+ syncConfigId: {
105
+ type: ScalarTypeEnum.String_unsecure(),
106
+ isOptional: false
107
+ },
108
+ status: {
109
+ type: SyncStatusEnum,
110
+ isOptional: false
111
+ },
112
+ direction: {
113
+ type: SyncDirectionEnum,
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
+ }
153
+ });
154
+ /**
155
+ * Input for creating a sync config.
156
+ */
157
+ const CreateSyncConfigInputModel = defineSchemaModel({
158
+ name: "CreateSyncConfigInput",
159
+ fields: {
160
+ integrationId: {
161
+ type: ScalarTypeEnum.String_unsecure(),
162
+ isOptional: false
163
+ },
164
+ connectionId: {
165
+ type: ScalarTypeEnum.String_unsecure(),
166
+ isOptional: false
167
+ },
168
+ name: {
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
+ }
193
+ });
194
+ /**
195
+ * Input for adding a field mapping.
196
+ */
197
+ const AddFieldMappingInputModel = defineSchemaModel({
198
+ name: "AddFieldMappingInput",
199
+ fields: {
200
+ syncConfigId: {
201
+ type: ScalarTypeEnum.String_unsecure(),
202
+ isOptional: false
203
+ },
204
+ sourceField: {
205
+ type: ScalarTypeEnum.NonEmptyString(),
206
+ isOptional: false
207
+ },
208
+ targetField: {
209
+ type: ScalarTypeEnum.NonEmptyString(),
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
+ }
237
+ });
238
+ /**
239
+ * Input for triggering a sync.
240
+ */
241
+ const TriggerSyncInputModel = defineSchemaModel({
242
+ name: "TriggerSyncInput",
243
+ fields: {
244
+ syncConfigId: {
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
+ }
257
+ });
258
+ /**
259
+ * Input for listing sync runs.
260
+ */
261
+ const ListSyncRunsInputModel = defineSchemaModel({
262
+ name: "ListSyncRunsInput",
263
+ fields: {
264
+ syncConfigId: {
265
+ type: ScalarTypeEnum.String_unsecure(),
266
+ isOptional: false
267
+ },
268
+ status: {
269
+ type: SyncStatusEnum,
270
+ isOptional: true
271
+ },
272
+ limit: {
273
+ type: ScalarTypeEnum.Int_unsecure(),
274
+ isOptional: true,
275
+ defaultValue: 20
276
+ },
277
+ offset: {
278
+ type: ScalarTypeEnum.Int_unsecure(),
279
+ isOptional: true,
280
+ defaultValue: 0
281
+ }
282
+ }
283
+ });
284
+ /**
285
+ * Output for listing sync runs.
286
+ */
287
+ const ListSyncRunsOutputModel = defineSchemaModel({
288
+ name: "ListSyncRunsOutput",
289
+ fields: {
290
+ runs: {
291
+ type: SyncRunModel,
292
+ isArray: true,
293
+ isOptional: false
294
+ },
295
+ total: {
296
+ type: ScalarTypeEnum.Int_unsecure(),
297
+ isOptional: false
298
+ }
299
+ }
300
+ });
301
+
302
+ //#endregion
303
+ export { AddFieldMappingInputModel, CreateSyncConfigInputModel, FieldMappingModel, ListSyncRunsInputModel, ListSyncRunsOutputModel, SyncConfigModel, SyncRunModel, TriggerSyncInputModel };
304
+ //# sourceMappingURL=sync.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync.schema.js","names":[],"sources":["../../src/sync/sync.schema.ts"],"sourcesContent":["import { defineSchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';\nimport {\n SyncDirectionEnum,\n SyncStatusEnum,\n MappingTypeEnum,\n} from './sync.enum';\n\n/**\n * A field mapping configuration.\n */\nexport const FieldMappingModel = defineSchemaModel({\n name: 'FieldMappingModel',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n sourceField: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n targetField: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n mappingType: { type: MappingTypeEnum, isOptional: false },\n transformExpression: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n isRequired: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n },\n});\n\n/**\n * A sync configuration.\n */\nexport const SyncConfigModel = defineSchemaModel({\n name: 'SyncConfigModel',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n integrationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n connectionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n direction: { type: SyncDirectionEnum, isOptional: false },\n sourceObject: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n targetObject: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n scheduleEnabled: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n scheduleCron: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n isActive: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n lastSyncAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n fieldMappings: { type: FieldMappingModel, isArray: true, isOptional: true },\n },\n});\n\n/**\n * A sync run.\n */\nexport const SyncRunModel = defineSchemaModel({\n name: 'SyncRunModel',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n syncConfigId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n status: { type: SyncStatusEnum, isOptional: false },\n direction: { type: SyncDirectionEnum, isOptional: false },\n trigger: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n recordsProcessed: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: false,\n },\n recordsCreated: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n recordsUpdated: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n recordsFailed: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n errorMessage: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n startedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n/**\n * Input for creating a sync config.\n */\nexport const CreateSyncConfigInputModel = defineSchemaModel({\n name: 'CreateSyncConfigInput',\n fields: {\n integrationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n connectionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n direction: { type: SyncDirectionEnum, isOptional: false },\n sourceObject: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n targetObject: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n scheduleEnabled: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n scheduleCron: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n\n/**\n * Input for adding a field mapping.\n */\nexport const AddFieldMappingInputModel = defineSchemaModel({\n name: 'AddFieldMappingInput',\n fields: {\n syncConfigId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n sourceField: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n targetField: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n mappingType: { type: MappingTypeEnum, isOptional: false },\n transformExpression: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n lookupConfig: { type: ScalarTypeEnum.JSON(), isOptional: true },\n constantValue: { type: ScalarTypeEnum.JSON(), isOptional: true },\n isRequired: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n defaultValue: { type: ScalarTypeEnum.JSON(), isOptional: true },\n },\n});\n\n/**\n * Input for triggering a sync.\n */\nexport const TriggerSyncInputModel = defineSchemaModel({\n name: 'TriggerSyncInput',\n fields: {\n syncConfigId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n direction: { type: SyncDirectionEnum, isOptional: true },\n fullSync: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n },\n});\n\n/**\n * Input for listing sync runs.\n */\nexport const ListSyncRunsInputModel = defineSchemaModel({\n name: 'ListSyncRunsInput',\n fields: {\n syncConfigId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n status: { type: SyncStatusEnum, isOptional: true },\n limit: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 20,\n },\n offset: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 0,\n },\n },\n});\n\n/**\n * Output for listing sync runs.\n */\nexport const ListSyncRunsOutputModel = defineSchemaModel({\n name: 'ListSyncRunsOutput',\n fields: {\n runs: { type: SyncRunModel, isArray: true, isOptional: false },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n },\n});\n"],"mappings":";;;;;;;AAUA,MAAa,oBAAoB,kBAAkB;CACjD,MAAM;CACN,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,aAAa;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC1E,aAAa;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC1E,aAAa;GAAE,MAAM;GAAiB,YAAY;GAAO;EACzD,qBAAqB;GACnB,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,YAAY;G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C/D,eAAe;GAAE,MAAM,eAAe,MAAM;GAAE,YAAY;GAAM;EAChE,YAAY;GAAE,MAAM,eAAe,SAAS;GAAE,YAAY;GAAM;EAChE,cAAc;GAAE,MAAM,eAAe,MAAM;GAAE,YAAY;GAAM;EAChE;CACF,CAAC;;;;AAKF,MAAa,wBAAwB,kBAAkB;CACrD,MAAM;CACN,QAAQ;EACN,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,WAAW;GAAE,MAAM;GAAmB,YAAY;GAAM;EACxD,UAAU;GAAE,MAAM,eAAe,SAAS;GAAE,YAAY;GAAM;EAC/D;CACF,CAAC;;;;AAKF,MAAa,yBAAyB,kBAAkB;CACtD,MAAM;CACN,QAAQ;EACN,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,QAAQ;GAAE,MAAM;GAAgB,YAAY;GAAM;EAClD,OAAO;GACL,MAAM,eAAe,cAAc;GACnC,YAAY;GACZ,cAAc;GACf;EACD,QAAQ;GACN,MAAM,eAAe,cAAc;GACnC,YAAY;GACZ,cAAc;GACf;EACF;CACF,CAAC;;;;AAKF,MAAa,0BAA0B,kBAAkB;CACvD,MAAM;CACN,QAAQ;EACN,MAAM;GAAE,MAAM;GAAc,SAAS;GAAM,YAAY;GAAO;EAC9D,OAAO;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAO;EAClE;CACF,CAAC"}
@@ -0,0 +1,109 @@
1
+ //#region src/sync-engine/index.d.ts
2
+ /**
3
+ * Sync Engine
4
+ *
5
+ * Core sync logic for the Integration Hub.
6
+ */
7
+ interface FieldMapping {
8
+ sourceField: string;
9
+ targetField: string;
10
+ mappingType: 'DIRECT' | 'TRANSFORM' | 'LOOKUP' | 'CONSTANT' | 'COMPUTED';
11
+ transformExpression?: string;
12
+ lookupConfig?: LookupConfig;
13
+ constantValue?: unknown;
14
+ isRequired: boolean;
15
+ defaultValue?: unknown;
16
+ }
17
+ interface LookupConfig {
18
+ sourceObject: string;
19
+ lookupField: string;
20
+ returnField: string;
21
+ }
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: {
37
+ id: string;
38
+ authType: string;
39
+ credentials?: Record<string, unknown>;
40
+ };
41
+ }
42
+ interface SyncResult {
43
+ success: boolean;
44
+ recordsProcessed: number;
45
+ recordsCreated: number;
46
+ recordsUpdated: number;
47
+ recordsDeleted: number;
48
+ recordsFailed: number;
49
+ recordsSkipped: number;
50
+ errors: SyncError[];
51
+ }
52
+ interface SyncError {
53
+ recordId?: string;
54
+ field?: string;
55
+ message: string;
56
+ code: string;
57
+ }
58
+ interface SourceRecord {
59
+ id: string;
60
+ data: Record<string, unknown>;
61
+ checksum?: string;
62
+ }
63
+ interface TargetRecord {
64
+ id: string;
65
+ data: Record<string, unknown>;
66
+ checksum?: string;
67
+ }
68
+ interface ISyncEngine {
69
+ /**
70
+ * Execute a sync operation.
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
+ };
84
+ }
85
+ interface IFieldTransformer {
86
+ transform(value: unknown, expression: string): unknown;
87
+ }
88
+ declare class BasicFieldTransformer implements IFieldTransformer {
89
+ transform(value: unknown, expression: string): unknown;
90
+ }
91
+ declare class BasicSyncEngine implements ISyncEngine {
92
+ private transformer;
93
+ constructor(transformer?: IFieldTransformer);
94
+ sync(_context: SyncContext): Promise<SyncResult>;
95
+ transformRecord(sourceRecord: SourceRecord, mappings: FieldMapping[], _context: SyncContext): TargetRecord;
96
+ validateRecord(record: TargetRecord, mappings: FieldMapping[]): {
97
+ valid: boolean;
98
+ errors: SyncError[];
99
+ };
100
+ private getNestedValue;
101
+ private setNestedValue;
102
+ private evaluateComputed;
103
+ }
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 };
109
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/sync-engine/index.ts"],"sourcesContent":[],"mappings":";;AAQA;AAWA;AAMA;AAYA;AAUiB,UAvCA,YAAA,CA+CP;EAGO,WAAA,EAAS,MAAA;EAOT,WAAA,EAAA,MAAY;EAMZ,WAAA,EAAA,QAAY,GAAA,WAEf,GAAA,QAAA,GAAA,UAAA,GAAA,UAAA;EAMG,mBAAW,CAAA,EAAA,MAAA;EAIZ,YAAA,CAAA,EAtEC,YAsED;EAAsB,aAAA,CAAA,EAAA,OAAA;EAAR,UAAA,EAAA,OAAA;EAMZ,YAAA,CAAA,EAAA,OAAA;;AAEL,UAxEI,YAAA,CAwEJ;EACR,YAAA,EAAA,MAAA;EAMO,WAAA,EAAA,MAAA;EACE,WAAA,EAAA,MAAA;;AAC0B,UA3EvB,UAAA,CA2EuB;EAKvB,EAAA,EAAA,MAAA;EAIJ,SAAA,EAAA,SAAA,GAAA,UAAsB,GAAW,eAAA;EAoDjC,YAAA,EAAA,MAAgB;EAGD,YAAA,EAAA,MAAA;EAIL,aAAA,EA1IN,YA0IM,EAAA;EAAsB,SAAA,EAAA,OAAA;EAAR,cAAA,EAAA,OAAA;EAuBnB,aAAA,EAAA,OAAA;EACJ,YAAA,CAAA,EA9JG,MA8JH,CAAA,MAAA,EAAA,OAAA,CAAA;;AAET,UA7JY,WAAA,CA6JZ;EAgEO,KAAA,EAAA,MAAA;EACE,MAAA,EA5NJ,UA4NI;EACiB,UAAA,EAAA;IAnGS,EAAA,EAAA,MAAA;IAAW,QAAA,EAAA,MAAA;IAoLnC,WAAA,CAAA,EA1SE,MA0Sc,CAAA,MAAe,EAAA,OAAA,CAAA;EAM/B,CAAA;AAahB;UAzTiB,UAAA;;;;;;;;UAQP;;UAGO,SAAA;;;;;;UAOA,YAAA;;QAET;;;UAIS,YAAA;;QAET;;;UAMS,WAAA;;;;gBAID,cAAc,QAAQ;;;;gCAMpB,wBACJ,yBACD,cACR;;;;yBAMO,wBACE;;YACiB;;;UAKd,iBAAA;;;cAIJ,qBAAA,YAAiC;;;cAoDjC,eAAA,YAA2B;;4BAGZ;iBAIL,cAAc,QAAQ;gCAuB3B,wBACJ,0BACA,cACT;yBAgEO,wBACE;;YACiB;;;;;;iBAiFf,gBAAA,eAA+B,oBAAoB;iBAMnD,eAAA,OAAsB;iBAatB,UAAA"}
@@ -0,0 +1,148 @@
1
+ //#region src/sync-engine/index.ts
2
+ var BasicFieldTransformer = class {
3
+ transform(value, expression) {
4
+ try {
5
+ if (expression.startsWith("uppercase")) return typeof value === "string" ? value.toUpperCase() : value;
6
+ if (expression.startsWith("lowercase")) return typeof value === "string" ? value.toLowerCase() : value;
7
+ if (expression.startsWith("trim")) return typeof value === "string" ? value.trim() : value;
8
+ if (expression.startsWith("default:")) {
9
+ const defaultVal = expression.replace("default:", "");
10
+ return value ?? JSON.parse(defaultVal);
11
+ }
12
+ if (expression.startsWith("concat:")) {
13
+ const separator = expression.replace("concat:", "") || " ";
14
+ if (Array.isArray(value)) return value.join(separator);
15
+ return value;
16
+ }
17
+ if (expression.startsWith("split:")) {
18
+ const separator = expression.replace("split:", "") || ",";
19
+ if (typeof value === "string") return value.split(separator);
20
+ return value;
21
+ }
22
+ if (expression.startsWith("number")) return Number(value);
23
+ if (expression.startsWith("boolean")) return Boolean(value);
24
+ if (expression.startsWith("string")) return String(value);
25
+ return value;
26
+ } catch {
27
+ return value;
28
+ }
29
+ }
30
+ };
31
+ var BasicSyncEngine = class {
32
+ transformer;
33
+ constructor(transformer) {
34
+ this.transformer = transformer ?? new BasicFieldTransformer();
35
+ }
36
+ async sync(_context) {
37
+ return {
38
+ success: true,
39
+ recordsProcessed: 0,
40
+ recordsCreated: 0,
41
+ recordsUpdated: 0,
42
+ recordsDeleted: 0,
43
+ recordsFailed: 0,
44
+ recordsSkipped: 0,
45
+ errors: []
46
+ };
47
+ }
48
+ transformRecord(sourceRecord, mappings, _context) {
49
+ const targetData = {};
50
+ for (const mapping of mappings) {
51
+ let value;
52
+ let sourceValue;
53
+ switch (mapping.mappingType) {
54
+ case "DIRECT":
55
+ value = this.getNestedValue(sourceRecord.data, mapping.sourceField);
56
+ break;
57
+ case "TRANSFORM":
58
+ sourceValue = this.getNestedValue(sourceRecord.data, mapping.sourceField);
59
+ value = mapping.transformExpression ? this.transformer.transform(sourceValue, mapping.transformExpression) : sourceValue;
60
+ break;
61
+ case "CONSTANT":
62
+ value = mapping.constantValue;
63
+ break;
64
+ case "LOOKUP":
65
+ value = this.getNestedValue(sourceRecord.data, mapping.sourceField);
66
+ break;
67
+ case "COMPUTED":
68
+ value = mapping.transformExpression ? this.evaluateComputed(sourceRecord.data, mapping.transformExpression) : null;
69
+ break;
70
+ default: value = this.getNestedValue(sourceRecord.data, mapping.sourceField);
71
+ }
72
+ if (value === void 0 || value === null) value = mapping.defaultValue;
73
+ this.setNestedValue(targetData, mapping.targetField, value);
74
+ }
75
+ return {
76
+ id: sourceRecord.id,
77
+ data: targetData
78
+ };
79
+ }
80
+ validateRecord(record, mappings) {
81
+ const errors = [];
82
+ for (const mapping of mappings) if (mapping.isRequired) {
83
+ const value = this.getNestedValue(record.data, mapping.targetField);
84
+ if (value === void 0 || value === null) errors.push({
85
+ recordId: record.id,
86
+ field: mapping.targetField,
87
+ message: `Required field ${mapping.targetField} is missing`,
88
+ code: "REQUIRED_FIELD_MISSING"
89
+ });
90
+ }
91
+ return {
92
+ valid: errors.length === 0,
93
+ errors
94
+ };
95
+ }
96
+ getNestedValue(obj, path) {
97
+ const parts = path.split(".");
98
+ let current = obj;
99
+ for (const part of parts) {
100
+ if (current === null || current === void 0) return;
101
+ current = current[part];
102
+ }
103
+ return current;
104
+ }
105
+ setNestedValue(obj, path, value) {
106
+ const parts = path.split(".");
107
+ let current = obj;
108
+ for (let i = 0; i < parts.length - 1; i++) {
109
+ const part = parts[i];
110
+ if (part === void 0) continue;
111
+ if (!(part in current)) current[part] = {};
112
+ current = current[part];
113
+ }
114
+ const lastPart = parts[parts.length - 1];
115
+ if (lastPart !== void 0) current[lastPart] = value;
116
+ }
117
+ evaluateComputed(data, expression) {
118
+ try {
119
+ return expression.replace(/\$\{([^}]+)\}/g, (_, path) => {
120
+ const value = this.getNestedValue(data, path);
121
+ return String(value ?? "");
122
+ });
123
+ } catch {
124
+ return null;
125
+ }
126
+ }
127
+ };
128
+ function createSyncEngine(transformer) {
129
+ return new BasicSyncEngine(transformer);
130
+ }
131
+ function computeChecksum(data) {
132
+ const str = JSON.stringify(data, Object.keys(data).sort());
133
+ let hash = 0;
134
+ for (let i = 0; i < str.length; i++) {
135
+ const char = str.charCodeAt(i);
136
+ hash = (hash << 5) - hash + char;
137
+ hash = hash & hash;
138
+ }
139
+ return hash.toString(16);
140
+ }
141
+ function hasChanges(sourceChecksum, targetChecksum) {
142
+ if (!sourceChecksum || !targetChecksum) return true;
143
+ return sourceChecksum !== targetChecksum;
144
+ }
145
+
146
+ //#endregion
147
+ export { BasicFieldTransformer, BasicSyncEngine, computeChecksum, createSyncEngine, hasChanges };
148
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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,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