@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,509 @@
1
+ import * as _contractspec_lib_contracts10 from "@contractspec/lib.contracts";
2
+ import * as _contractspec_lib_schema207 from "@contractspec/lib.schema";
3
+
4
+ //#region src/sync/sync.operations.d.ts
5
+ /**
6
+ * Create a sync configuration.
7
+ */
8
+ declare const CreateSyncConfigContract: _contractspec_lib_contracts10.OperationSpec<_contractspec_lib_schema207.SchemaModel<{
9
+ integrationId: {
10
+ type: _contractspec_lib_schema207.FieldType<string, string>;
11
+ isOptional: false;
12
+ };
13
+ connectionId: {
14
+ type: _contractspec_lib_schema207.FieldType<string, string>;
15
+ isOptional: false;
16
+ };
17
+ name: {
18
+ type: _contractspec_lib_schema207.FieldType<string, string>;
19
+ isOptional: false;
20
+ };
21
+ direction: {
22
+ type: _contractspec_lib_schema207.EnumType<[string, string, string]>;
23
+ isOptional: false;
24
+ };
25
+ sourceObject: {
26
+ type: _contractspec_lib_schema207.FieldType<string, string>;
27
+ isOptional: false;
28
+ };
29
+ targetObject: {
30
+ type: _contractspec_lib_schema207.FieldType<string, string>;
31
+ isOptional: false;
32
+ };
33
+ scheduleEnabled: {
34
+ type: _contractspec_lib_schema207.FieldType<boolean, boolean>;
35
+ isOptional: true;
36
+ };
37
+ scheduleCron: {
38
+ type: _contractspec_lib_schema207.FieldType<string, string>;
39
+ isOptional: true;
40
+ };
41
+ }>, _contractspec_lib_schema207.SchemaModel<{
42
+ id: {
43
+ type: _contractspec_lib_schema207.FieldType<string, string>;
44
+ isOptional: false;
45
+ };
46
+ integrationId: {
47
+ type: _contractspec_lib_schema207.FieldType<string, string>;
48
+ isOptional: false;
49
+ };
50
+ connectionId: {
51
+ type: _contractspec_lib_schema207.FieldType<string, string>;
52
+ isOptional: false;
53
+ };
54
+ name: {
55
+ type: _contractspec_lib_schema207.FieldType<string, string>;
56
+ isOptional: false;
57
+ };
58
+ direction: {
59
+ type: _contractspec_lib_schema207.EnumType<[string, string, string]>;
60
+ isOptional: false;
61
+ };
62
+ sourceObject: {
63
+ type: _contractspec_lib_schema207.FieldType<string, string>;
64
+ isOptional: false;
65
+ };
66
+ targetObject: {
67
+ type: _contractspec_lib_schema207.FieldType<string, string>;
68
+ isOptional: false;
69
+ };
70
+ scheduleEnabled: {
71
+ type: _contractspec_lib_schema207.FieldType<boolean, boolean>;
72
+ isOptional: false;
73
+ };
74
+ scheduleCron: {
75
+ type: _contractspec_lib_schema207.FieldType<string, string>;
76
+ isOptional: true;
77
+ };
78
+ isActive: {
79
+ type: _contractspec_lib_schema207.FieldType<boolean, boolean>;
80
+ isOptional: false;
81
+ };
82
+ lastSyncAt: {
83
+ type: _contractspec_lib_schema207.FieldType<Date, string>;
84
+ isOptional: true;
85
+ };
86
+ fieldMappings: {
87
+ type: _contractspec_lib_schema207.SchemaModel<{
88
+ id: {
89
+ type: _contractspec_lib_schema207.FieldType<string, string>;
90
+ isOptional: false;
91
+ };
92
+ sourceField: {
93
+ type: _contractspec_lib_schema207.FieldType<string, string>;
94
+ isOptional: false;
95
+ };
96
+ targetField: {
97
+ type: _contractspec_lib_schema207.FieldType<string, string>;
98
+ isOptional: false;
99
+ };
100
+ mappingType: {
101
+ type: _contractspec_lib_schema207.EnumType<[string, string, string, string, string]>;
102
+ isOptional: false;
103
+ };
104
+ transformExpression: {
105
+ type: _contractspec_lib_schema207.FieldType<string, string>;
106
+ isOptional: true;
107
+ };
108
+ isRequired: {
109
+ type: _contractspec_lib_schema207.FieldType<boolean, boolean>;
110
+ isOptional: false;
111
+ };
112
+ }>;
113
+ isArray: true;
114
+ isOptional: true;
115
+ };
116
+ }>, {
117
+ key: string;
118
+ version: number;
119
+ when: string;
120
+ payload: _contractspec_lib_schema207.SchemaModel<{
121
+ id: {
122
+ type: _contractspec_lib_schema207.FieldType<string, string>;
123
+ isOptional: false;
124
+ };
125
+ integrationId: {
126
+ type: _contractspec_lib_schema207.FieldType<string, string>;
127
+ isOptional: false;
128
+ };
129
+ connectionId: {
130
+ type: _contractspec_lib_schema207.FieldType<string, string>;
131
+ isOptional: false;
132
+ };
133
+ name: {
134
+ type: _contractspec_lib_schema207.FieldType<string, string>;
135
+ isOptional: false;
136
+ };
137
+ direction: {
138
+ type: _contractspec_lib_schema207.EnumType<[string, string, string]>;
139
+ isOptional: false;
140
+ };
141
+ sourceObject: {
142
+ type: _contractspec_lib_schema207.FieldType<string, string>;
143
+ isOptional: false;
144
+ };
145
+ targetObject: {
146
+ type: _contractspec_lib_schema207.FieldType<string, string>;
147
+ isOptional: false;
148
+ };
149
+ scheduleEnabled: {
150
+ type: _contractspec_lib_schema207.FieldType<boolean, boolean>;
151
+ isOptional: false;
152
+ };
153
+ scheduleCron: {
154
+ type: _contractspec_lib_schema207.FieldType<string, string>;
155
+ isOptional: true;
156
+ };
157
+ isActive: {
158
+ type: _contractspec_lib_schema207.FieldType<boolean, boolean>;
159
+ isOptional: false;
160
+ };
161
+ lastSyncAt: {
162
+ type: _contractspec_lib_schema207.FieldType<Date, string>;
163
+ isOptional: true;
164
+ };
165
+ fieldMappings: {
166
+ type: _contractspec_lib_schema207.SchemaModel<{
167
+ id: {
168
+ type: _contractspec_lib_schema207.FieldType<string, string>;
169
+ isOptional: false;
170
+ };
171
+ sourceField: {
172
+ type: _contractspec_lib_schema207.FieldType<string, string>;
173
+ isOptional: false;
174
+ };
175
+ targetField: {
176
+ type: _contractspec_lib_schema207.FieldType<string, string>;
177
+ isOptional: false;
178
+ };
179
+ mappingType: {
180
+ type: _contractspec_lib_schema207.EnumType<[string, string, string, string, string]>;
181
+ isOptional: false;
182
+ };
183
+ transformExpression: {
184
+ type: _contractspec_lib_schema207.FieldType<string, string>;
185
+ isOptional: true;
186
+ };
187
+ isRequired: {
188
+ type: _contractspec_lib_schema207.FieldType<boolean, boolean>;
189
+ isOptional: false;
190
+ };
191
+ }>;
192
+ isArray: true;
193
+ isOptional: true;
194
+ };
195
+ }>;
196
+ }[]>;
197
+ /**
198
+ * Add a field mapping to a sync config.
199
+ */
200
+ declare const AddFieldMappingContract: _contractspec_lib_contracts10.OperationSpec<_contractspec_lib_schema207.SchemaModel<{
201
+ syncConfigId: {
202
+ type: _contractspec_lib_schema207.FieldType<string, string>;
203
+ isOptional: false;
204
+ };
205
+ sourceField: {
206
+ type: _contractspec_lib_schema207.FieldType<string, string>;
207
+ isOptional: false;
208
+ };
209
+ targetField: {
210
+ type: _contractspec_lib_schema207.FieldType<string, string>;
211
+ isOptional: false;
212
+ };
213
+ mappingType: {
214
+ type: _contractspec_lib_schema207.EnumType<[string, string, string, string, string]>;
215
+ isOptional: false;
216
+ };
217
+ transformExpression: {
218
+ type: _contractspec_lib_schema207.FieldType<string, string>;
219
+ isOptional: true;
220
+ };
221
+ lookupConfig: {
222
+ type: _contractspec_lib_schema207.FieldType<unknown, unknown>;
223
+ isOptional: true;
224
+ };
225
+ constantValue: {
226
+ type: _contractspec_lib_schema207.FieldType<unknown, unknown>;
227
+ isOptional: true;
228
+ };
229
+ isRequired: {
230
+ type: _contractspec_lib_schema207.FieldType<boolean, boolean>;
231
+ isOptional: true;
232
+ };
233
+ defaultValue: {
234
+ type: _contractspec_lib_schema207.FieldType<unknown, unknown>;
235
+ isOptional: true;
236
+ };
237
+ }>, _contractspec_lib_schema207.SchemaModel<{
238
+ id: {
239
+ type: _contractspec_lib_schema207.FieldType<string, string>;
240
+ isOptional: false;
241
+ };
242
+ sourceField: {
243
+ type: _contractspec_lib_schema207.FieldType<string, string>;
244
+ isOptional: false;
245
+ };
246
+ targetField: {
247
+ type: _contractspec_lib_schema207.FieldType<string, string>;
248
+ isOptional: false;
249
+ };
250
+ mappingType: {
251
+ type: _contractspec_lib_schema207.EnumType<[string, string, string, string, string]>;
252
+ isOptional: false;
253
+ };
254
+ transformExpression: {
255
+ type: _contractspec_lib_schema207.FieldType<string, string>;
256
+ isOptional: true;
257
+ };
258
+ isRequired: {
259
+ type: _contractspec_lib_schema207.FieldType<boolean, boolean>;
260
+ isOptional: false;
261
+ };
262
+ }>, {
263
+ key: string;
264
+ version: number;
265
+ when: string;
266
+ payload: _contractspec_lib_schema207.SchemaModel<{
267
+ id: {
268
+ type: _contractspec_lib_schema207.FieldType<string, string>;
269
+ isOptional: false;
270
+ };
271
+ sourceField: {
272
+ type: _contractspec_lib_schema207.FieldType<string, string>;
273
+ isOptional: false;
274
+ };
275
+ targetField: {
276
+ type: _contractspec_lib_schema207.FieldType<string, string>;
277
+ isOptional: false;
278
+ };
279
+ mappingType: {
280
+ type: _contractspec_lib_schema207.EnumType<[string, string, string, string, string]>;
281
+ isOptional: false;
282
+ };
283
+ transformExpression: {
284
+ type: _contractspec_lib_schema207.FieldType<string, string>;
285
+ isOptional: true;
286
+ };
287
+ isRequired: {
288
+ type: _contractspec_lib_schema207.FieldType<boolean, boolean>;
289
+ isOptional: false;
290
+ };
291
+ }>;
292
+ }[]>;
293
+ /**
294
+ * Trigger a manual sync.
295
+ */
296
+ declare const TriggerSyncContract: _contractspec_lib_contracts10.OperationSpec<_contractspec_lib_schema207.SchemaModel<{
297
+ syncConfigId: {
298
+ type: _contractspec_lib_schema207.FieldType<string, string>;
299
+ isOptional: false;
300
+ };
301
+ direction: {
302
+ type: _contractspec_lib_schema207.EnumType<[string, string, string]>;
303
+ isOptional: true;
304
+ };
305
+ fullSync: {
306
+ type: _contractspec_lib_schema207.FieldType<boolean, boolean>;
307
+ isOptional: true;
308
+ };
309
+ }>, _contractspec_lib_schema207.SchemaModel<{
310
+ id: {
311
+ type: _contractspec_lib_schema207.FieldType<string, string>;
312
+ isOptional: false;
313
+ };
314
+ syncConfigId: {
315
+ type: _contractspec_lib_schema207.FieldType<string, string>;
316
+ isOptional: false;
317
+ };
318
+ status: {
319
+ type: _contractspec_lib_schema207.EnumType<[string, string, string, string, string]>;
320
+ isOptional: false;
321
+ };
322
+ direction: {
323
+ type: _contractspec_lib_schema207.EnumType<[string, string, string]>;
324
+ isOptional: false;
325
+ };
326
+ trigger: {
327
+ type: _contractspec_lib_schema207.FieldType<string, string>;
328
+ isOptional: false;
329
+ };
330
+ recordsProcessed: {
331
+ type: _contractspec_lib_schema207.FieldType<number, number>;
332
+ isOptional: false;
333
+ };
334
+ recordsCreated: {
335
+ type: _contractspec_lib_schema207.FieldType<number, number>;
336
+ isOptional: false;
337
+ };
338
+ recordsUpdated: {
339
+ type: _contractspec_lib_schema207.FieldType<number, number>;
340
+ isOptional: false;
341
+ };
342
+ recordsFailed: {
343
+ type: _contractspec_lib_schema207.FieldType<number, number>;
344
+ isOptional: false;
345
+ };
346
+ errorMessage: {
347
+ type: _contractspec_lib_schema207.FieldType<string, string>;
348
+ isOptional: true;
349
+ };
350
+ startedAt: {
351
+ type: _contractspec_lib_schema207.FieldType<Date, string>;
352
+ isOptional: true;
353
+ };
354
+ completedAt: {
355
+ type: _contractspec_lib_schema207.FieldType<Date, string>;
356
+ isOptional: true;
357
+ };
358
+ createdAt: {
359
+ type: _contractspec_lib_schema207.FieldType<Date, string>;
360
+ isOptional: false;
361
+ };
362
+ }>, {
363
+ key: string;
364
+ version: number;
365
+ when: string;
366
+ payload: _contractspec_lib_schema207.SchemaModel<{
367
+ id: {
368
+ type: _contractspec_lib_schema207.FieldType<string, string>;
369
+ isOptional: false;
370
+ };
371
+ syncConfigId: {
372
+ type: _contractspec_lib_schema207.FieldType<string, string>;
373
+ isOptional: false;
374
+ };
375
+ status: {
376
+ type: _contractspec_lib_schema207.EnumType<[string, string, string, string, string]>;
377
+ isOptional: false;
378
+ };
379
+ direction: {
380
+ type: _contractspec_lib_schema207.EnumType<[string, string, string]>;
381
+ isOptional: false;
382
+ };
383
+ trigger: {
384
+ type: _contractspec_lib_schema207.FieldType<string, string>;
385
+ isOptional: false;
386
+ };
387
+ recordsProcessed: {
388
+ type: _contractspec_lib_schema207.FieldType<number, number>;
389
+ isOptional: false;
390
+ };
391
+ recordsCreated: {
392
+ type: _contractspec_lib_schema207.FieldType<number, number>;
393
+ isOptional: false;
394
+ };
395
+ recordsUpdated: {
396
+ type: _contractspec_lib_schema207.FieldType<number, number>;
397
+ isOptional: false;
398
+ };
399
+ recordsFailed: {
400
+ type: _contractspec_lib_schema207.FieldType<number, number>;
401
+ isOptional: false;
402
+ };
403
+ errorMessage: {
404
+ type: _contractspec_lib_schema207.FieldType<string, string>;
405
+ isOptional: true;
406
+ };
407
+ startedAt: {
408
+ type: _contractspec_lib_schema207.FieldType<Date, string>;
409
+ isOptional: true;
410
+ };
411
+ completedAt: {
412
+ type: _contractspec_lib_schema207.FieldType<Date, string>;
413
+ isOptional: true;
414
+ };
415
+ createdAt: {
416
+ type: _contractspec_lib_schema207.FieldType<Date, string>;
417
+ isOptional: false;
418
+ };
419
+ }>;
420
+ }[]>;
421
+ /**
422
+ * List sync run history.
423
+ */
424
+ declare const ListSyncRunsContract: _contractspec_lib_contracts10.OperationSpec<_contractspec_lib_schema207.SchemaModel<{
425
+ syncConfigId: {
426
+ type: _contractspec_lib_schema207.FieldType<string, string>;
427
+ isOptional: false;
428
+ };
429
+ status: {
430
+ type: _contractspec_lib_schema207.EnumType<[string, string, string, string, string]>;
431
+ isOptional: true;
432
+ };
433
+ limit: {
434
+ type: _contractspec_lib_schema207.FieldType<number, number>;
435
+ isOptional: true;
436
+ defaultValue: number;
437
+ };
438
+ offset: {
439
+ type: _contractspec_lib_schema207.FieldType<number, number>;
440
+ isOptional: true;
441
+ defaultValue: number;
442
+ };
443
+ }>, _contractspec_lib_schema207.SchemaModel<{
444
+ runs: {
445
+ type: _contractspec_lib_schema207.SchemaModel<{
446
+ id: {
447
+ type: _contractspec_lib_schema207.FieldType<string, string>;
448
+ isOptional: false;
449
+ };
450
+ syncConfigId: {
451
+ type: _contractspec_lib_schema207.FieldType<string, string>;
452
+ isOptional: false;
453
+ };
454
+ status: {
455
+ type: _contractspec_lib_schema207.EnumType<[string, string, string, string, string]>;
456
+ isOptional: false;
457
+ };
458
+ direction: {
459
+ type: _contractspec_lib_schema207.EnumType<[string, string, string]>;
460
+ isOptional: false;
461
+ };
462
+ trigger: {
463
+ type: _contractspec_lib_schema207.FieldType<string, string>;
464
+ isOptional: false;
465
+ };
466
+ recordsProcessed: {
467
+ type: _contractspec_lib_schema207.FieldType<number, number>;
468
+ isOptional: false;
469
+ };
470
+ recordsCreated: {
471
+ type: _contractspec_lib_schema207.FieldType<number, number>;
472
+ isOptional: false;
473
+ };
474
+ recordsUpdated: {
475
+ type: _contractspec_lib_schema207.FieldType<number, number>;
476
+ isOptional: false;
477
+ };
478
+ recordsFailed: {
479
+ type: _contractspec_lib_schema207.FieldType<number, number>;
480
+ isOptional: false;
481
+ };
482
+ errorMessage: {
483
+ type: _contractspec_lib_schema207.FieldType<string, string>;
484
+ isOptional: true;
485
+ };
486
+ startedAt: {
487
+ type: _contractspec_lib_schema207.FieldType<Date, string>;
488
+ isOptional: true;
489
+ };
490
+ completedAt: {
491
+ type: _contractspec_lib_schema207.FieldType<Date, string>;
492
+ isOptional: true;
493
+ };
494
+ createdAt: {
495
+ type: _contractspec_lib_schema207.FieldType<Date, string>;
496
+ isOptional: false;
497
+ };
498
+ }>;
499
+ isArray: true;
500
+ isOptional: false;
501
+ };
502
+ total: {
503
+ type: _contractspec_lib_schema207.FieldType<number, number>;
504
+ isOptional: false;
505
+ };
506
+ }>, undefined>;
507
+ //#endregion
508
+ export { AddFieldMappingContract, CreateSyncConfigContract, ListSyncRunsContract, TriggerSyncContract };
509
+ //# sourceMappingURL=sync.operations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync.operations.d.ts","names":[],"sources":["../../src/sync/sync.operations.ts"],"sourcesContent":[],"mappings":";;;;;;;cAoBa,wDAAwB,0CAAA;EAAxB,aAAA,EAAA;IA6CX,IAAA,EAAA,2BAAA,CAAA,SAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;+CA7CmC,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;UAAA,2BAAA,CAAA;;;;;;;;;;;;;;;;8CAAA,CAAA,CAAA,MAAA,EAAA,MAAA,EAAA,MAAA,CAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EAkDxB,CAAA;EA4CX,YAAA,EAAA;;;;;;;;;+CA5CkC,CAAA,OAAA,EAAA,OAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;;;;;;;;;;;IAAA,IAAA,yCAAA,CAAA;MAiDvB,EAAA,EAAA;QAyCX,IAAA,uCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;QAzC8B,IAAA,uCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,CAAA;IA8CnB,YAAA,EAAA;MA8BX,IAAA,uCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;iDA9B+B,CAAA,MAAA,EAAA,MAAA,CAAA;MAAA,UAAA,EAAA,KAAA;;;;;;;;;;;;;;;;;;;iDAAA,CAAA,MAAA,EAAA,MAAA,CAAA;MAAA,UAAA,EAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA/FpB,uDAAuB,0CAAA;;UA4ClC,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA5CkC,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiDvB,mDAAmB,0CAAA;;UAyC9B,2BAAA,CAAA;;;;;;;;;;;;;UAzC8B,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA8CnB,oDAAoB,0CAAA;;UA8B/B,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;cA9B+B,2BAAA,CAAA"}
@@ -0,0 +1,203 @@
1
+ import { AddFieldMappingInputModel, CreateSyncConfigInputModel, FieldMappingModel, ListSyncRunsInputModel, ListSyncRunsOutputModel, SyncConfigModel, SyncRunModel, TriggerSyncInputModel } from "./sync.schema.js";
2
+ import { defineCommand, defineQuery } from "@contractspec/lib.contracts/operations";
3
+
4
+ //#region src/sync/sync.operations.ts
5
+ const OWNERS = ["@example.integration-hub"];
6
+ /**
7
+ * Create a sync configuration.
8
+ */
9
+ const CreateSyncConfigContract = defineCommand({
10
+ meta: {
11
+ key: "integration.syncConfig.create",
12
+ version: 1,
13
+ stability: "stable",
14
+ owners: [...OWNERS],
15
+ tags: [
16
+ "integration",
17
+ "sync",
18
+ "config",
19
+ "create"
20
+ ],
21
+ description: "Create a sync configuration.",
22
+ goal: "Define how data should be synchronized.",
23
+ context: "Sync setup."
24
+ },
25
+ io: {
26
+ input: CreateSyncConfigInputModel,
27
+ output: SyncConfigModel
28
+ },
29
+ policy: { auth: "user" },
30
+ sideEffects: {
31
+ emits: [{
32
+ key: "integration.syncConfig.created",
33
+ version: 1,
34
+ when: "Sync config created",
35
+ payload: SyncConfigModel
36
+ }],
37
+ audit: ["integration.syncConfig.created"]
38
+ },
39
+ acceptance: {
40
+ scenarios: [{
41
+ key: "create-sync-happy-path",
42
+ given: ["User is authenticated"],
43
+ when: ["User creates sync config"],
44
+ then: ["Sync config is created", "SyncConfigCreated event is emitted"]
45
+ }],
46
+ examples: [{
47
+ key: "create-contact-sync",
48
+ input: {
49
+ name: "Contacts Sync",
50
+ sourceConnectionId: "conn-1",
51
+ targetConnectionId: "conn-2"
52
+ },
53
+ output: {
54
+ id: "sync-123",
55
+ status: "active"
56
+ }
57
+ }]
58
+ }
59
+ });
60
+ /**
61
+ * Add a field mapping to a sync config.
62
+ */
63
+ const AddFieldMappingContract = defineCommand({
64
+ meta: {
65
+ key: "integration.fieldMapping.add",
66
+ version: 1,
67
+ stability: "stable",
68
+ owners: [...OWNERS],
69
+ tags: [
70
+ "integration",
71
+ "mapping",
72
+ "field"
73
+ ],
74
+ description: "Add a field mapping to a sync config.",
75
+ goal: "Map fields between systems.",
76
+ context: "Mapping configuration."
77
+ },
78
+ io: {
79
+ input: AddFieldMappingInputModel,
80
+ output: FieldMappingModel
81
+ },
82
+ policy: { auth: "user" },
83
+ sideEffects: { emits: [{
84
+ key: "integration.fieldMapping.added",
85
+ version: 1,
86
+ when: "Mapping added",
87
+ payload: FieldMappingModel
88
+ }] },
89
+ acceptance: {
90
+ scenarios: [{
91
+ key: "add-mapping-happy-path",
92
+ given: ["Sync config exists"],
93
+ when: ["User adds field mapping"],
94
+ then: ["Mapping is added", "FieldMappingAdded event is emitted"]
95
+ }],
96
+ examples: [{
97
+ key: "map-email",
98
+ input: {
99
+ syncConfigId: "sync-123",
100
+ sourceField: "email",
101
+ targetField: "user_email"
102
+ },
103
+ output: {
104
+ id: "map-456",
105
+ type: "string"
106
+ }
107
+ }]
108
+ }
109
+ });
110
+ /**
111
+ * Trigger a manual sync.
112
+ */
113
+ const TriggerSyncContract = defineCommand({
114
+ meta: {
115
+ key: "integration.sync.trigger",
116
+ version: 1,
117
+ stability: "stable",
118
+ owners: [...OWNERS],
119
+ tags: [
120
+ "integration",
121
+ "sync",
122
+ "trigger"
123
+ ],
124
+ description: "Trigger a manual sync.",
125
+ goal: "Start data synchronization.",
126
+ context: "Manual sync or webhook trigger."
127
+ },
128
+ io: {
129
+ input: TriggerSyncInputModel,
130
+ output: SyncRunModel
131
+ },
132
+ policy: { auth: "user" },
133
+ sideEffects: {
134
+ emits: [{
135
+ key: "integration.sync.started",
136
+ version: 1,
137
+ when: "Sync starts",
138
+ payload: SyncRunModel
139
+ }],
140
+ audit: ["integration.sync.triggered"]
141
+ },
142
+ acceptance: {
143
+ scenarios: [{
144
+ key: "trigger-sync-happy-path",
145
+ given: ["Sync config exists"],
146
+ when: ["User triggers sync"],
147
+ then: ["Sync run starts", "SyncStarted event is emitted"]
148
+ }],
149
+ examples: [{
150
+ key: "manual-trigger",
151
+ input: { syncConfigId: "sync-123" },
152
+ output: {
153
+ id: "run-789",
154
+ status: "pending"
155
+ }
156
+ }]
157
+ }
158
+ });
159
+ /**
160
+ * List sync run history.
161
+ */
162
+ const ListSyncRunsContract = defineQuery({
163
+ meta: {
164
+ key: "integration.syncRun.list",
165
+ version: 1,
166
+ stability: "stable",
167
+ owners: [...OWNERS],
168
+ tags: [
169
+ "integration",
170
+ "sync",
171
+ "run",
172
+ "list"
173
+ ],
174
+ description: "List sync run history.",
175
+ goal: "View sync history and status.",
176
+ context: "Sync monitoring."
177
+ },
178
+ io: {
179
+ input: ListSyncRunsInputModel,
180
+ output: ListSyncRunsOutputModel
181
+ },
182
+ policy: { auth: "user" },
183
+ acceptance: {
184
+ scenarios: [{
185
+ key: "list-runs-happy-path",
186
+ given: ["User has access to syncs"],
187
+ when: ["User lists sync runs"],
188
+ then: ["List of runs is returned"]
189
+ }],
190
+ examples: [{
191
+ key: "list-recent",
192
+ input: { limit: 10 },
193
+ output: {
194
+ items: [],
195
+ total: 50
196
+ }
197
+ }]
198
+ }
199
+ });
200
+
201
+ //#endregion
202
+ export { AddFieldMappingContract, CreateSyncConfigContract, ListSyncRunsContract, TriggerSyncContract };
203
+ //# sourceMappingURL=sync.operations.js.map