@contractspec/example.integration-hub 0.0.0-canary-20260113170453

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 (116) 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 +7 -0
  31. package/dist/example.d.ts.map +1 -0
  32. package/dist/example.js +58 -0
  33. package/dist/example.js.map +1 -0
  34. package/dist/handlers/index.d.ts +2 -0
  35. package/dist/handlers/index.js +3 -0
  36. package/dist/handlers/integration.handlers.d.ts +130 -0
  37. package/dist/handlers/integration.handlers.d.ts.map +1 -0
  38. package/dist/handlers/integration.handlers.js +282 -0
  39. package/dist/handlers/integration.handlers.js.map +1 -0
  40. package/dist/index.d.ts +19 -0
  41. package/dist/index.js +20 -0
  42. package/dist/integration/index.d.ts +4 -0
  43. package/dist/integration/index.js +5 -0
  44. package/dist/integration/integration.enum.d.ts +10 -0
  45. package/dist/integration/integration.enum.d.ts.map +1 -0
  46. package/dist/integration/integration.enum.js +17 -0
  47. package/dist/integration/integration.enum.js.map +1 -0
  48. package/dist/integration/integration.operations.d.ts +99 -0
  49. package/dist/integration/integration.operations.d.ts.map +1 -0
  50. package/dist/integration/integration.operations.js +57 -0
  51. package/dist/integration/integration.operations.js.map +1 -0
  52. package/dist/integration/integration.presentation.d.ts +9 -0
  53. package/dist/integration/integration.presentation.d.ts.map +1 -0
  54. package/dist/integration/integration.presentation.js +77 -0
  55. package/dist/integration/integration.presentation.js.map +1 -0
  56. package/dist/integration/integration.schema.d.ts +68 -0
  57. package/dist/integration/integration.schema.d.ts.map +1 -0
  58. package/dist/integration/integration.schema.js +76 -0
  59. package/dist/integration/integration.schema.js.map +1 -0
  60. package/dist/integration-hub.capability.d.ts +9 -0
  61. package/dist/integration-hub.capability.d.ts.map +1 -0
  62. package/dist/integration-hub.capability.js +38 -0
  63. package/dist/integration-hub.capability.js.map +1 -0
  64. package/dist/integration-hub.feature.d.ts +7 -0
  65. package/dist/integration-hub.feature.d.ts.map +1 -0
  66. package/dist/integration-hub.feature.js +244 -0
  67. package/dist/integration-hub.feature.js.map +1 -0
  68. package/dist/seeders/index.d.ts +10 -0
  69. package/dist/seeders/index.d.ts.map +1 -0
  70. package/dist/seeders/index.js +19 -0
  71. package/dist/seeders/index.js.map +1 -0
  72. package/dist/sync/index.d.ts +4 -0
  73. package/dist/sync/index.js +5 -0
  74. package/dist/sync/sync.enum.d.ts +18 -0
  75. package/dist/sync/sync.enum.d.ts.map +1 -0
  76. package/dist/sync/sync.enum.js +35 -0
  77. package/dist/sync/sync.enum.js.map +1 -0
  78. package/dist/sync/sync.operations.d.ts +509 -0
  79. package/dist/sync/sync.operations.d.ts.map +1 -0
  80. package/dist/sync/sync.operations.js +203 -0
  81. package/dist/sync/sync.operations.js.map +1 -0
  82. package/dist/sync/sync.presentation.d.ts +12 -0
  83. package/dist/sync/sync.presentation.d.ts.map +1 -0
  84. package/dist/sync/sync.presentation.js +168 -0
  85. package/dist/sync/sync.presentation.js.map +1 -0
  86. package/dist/sync/sync.schema.d.ts +356 -0
  87. package/dist/sync/sync.schema.d.ts.map +1 -0
  88. package/dist/sync/sync.schema.js +304 -0
  89. package/dist/sync/sync.schema.js.map +1 -0
  90. package/dist/sync-engine/index.d.ts +109 -0
  91. package/dist/sync-engine/index.d.ts.map +1 -0
  92. package/dist/sync-engine/index.js +148 -0
  93. package/dist/sync-engine/index.js.map +1 -0
  94. package/dist/tests/operations.test-spec.d.ts +9 -0
  95. package/dist/tests/operations.test-spec.d.ts.map +1 -0
  96. package/dist/tests/operations.test-spec.js +94 -0
  97. package/dist/tests/operations.test-spec.js.map +1 -0
  98. package/dist/ui/IntegrationDashboard.d.ts +7 -0
  99. package/dist/ui/IntegrationDashboard.d.ts.map +1 -0
  100. package/dist/ui/IntegrationDashboard.js +266 -0
  101. package/dist/ui/IntegrationDashboard.js.map +1 -0
  102. package/dist/ui/hooks/index.d.ts +2 -0
  103. package/dist/ui/hooks/index.js +5 -0
  104. package/dist/ui/hooks/useIntegrationData.d.ts +23 -0
  105. package/dist/ui/hooks/useIntegrationData.d.ts.map +1 -0
  106. package/dist/ui/hooks/useIntegrationData.js +59 -0
  107. package/dist/ui/hooks/useIntegrationData.js.map +1 -0
  108. package/dist/ui/index.d.ts +6 -0
  109. package/dist/ui/index.js +6 -0
  110. package/dist/ui/renderers/index.d.ts +2 -0
  111. package/dist/ui/renderers/index.js +3 -0
  112. package/dist/ui/renderers/integration.markdown.d.ts +28 -0
  113. package/dist/ui/renderers/integration.markdown.d.ts.map +1 -0
  114. package/dist/ui/renderers/integration.markdown.js +256 -0
  115. package/dist/ui/renderers/integration.markdown.js.map +1 -0
  116. package/package.json +111 -0
@@ -0,0 +1,356 @@
1
+ import * as _contractspec_lib_schema247 from "@contractspec/lib.schema";
2
+
3
+ //#region src/sync/sync.schema.d.ts
4
+ /**
5
+ * A field mapping configuration.
6
+ */
7
+ declare const FieldMappingModel: _contractspec_lib_schema247.SchemaModel<{
8
+ id: {
9
+ type: _contractspec_lib_schema247.FieldType<string, string>;
10
+ isOptional: false;
11
+ };
12
+ sourceField: {
13
+ type: _contractspec_lib_schema247.FieldType<string, string>;
14
+ isOptional: false;
15
+ };
16
+ targetField: {
17
+ type: _contractspec_lib_schema247.FieldType<string, string>;
18
+ isOptional: false;
19
+ };
20
+ mappingType: {
21
+ type: _contractspec_lib_schema247.EnumType<[string, string, string, string, string]>;
22
+ isOptional: false;
23
+ };
24
+ transformExpression: {
25
+ type: _contractspec_lib_schema247.FieldType<string, string>;
26
+ isOptional: true;
27
+ };
28
+ isRequired: {
29
+ type: _contractspec_lib_schema247.FieldType<boolean, boolean>;
30
+ isOptional: false;
31
+ };
32
+ }>;
33
+ /**
34
+ * A sync configuration.
35
+ */
36
+ declare const SyncConfigModel: _contractspec_lib_schema247.SchemaModel<{
37
+ id: {
38
+ type: _contractspec_lib_schema247.FieldType<string, string>;
39
+ isOptional: false;
40
+ };
41
+ integrationId: {
42
+ type: _contractspec_lib_schema247.FieldType<string, string>;
43
+ isOptional: false;
44
+ };
45
+ connectionId: {
46
+ type: _contractspec_lib_schema247.FieldType<string, string>;
47
+ isOptional: false;
48
+ };
49
+ name: {
50
+ type: _contractspec_lib_schema247.FieldType<string, string>;
51
+ isOptional: false;
52
+ };
53
+ direction: {
54
+ type: _contractspec_lib_schema247.EnumType<[string, string, string]>;
55
+ isOptional: false;
56
+ };
57
+ sourceObject: {
58
+ type: _contractspec_lib_schema247.FieldType<string, string>;
59
+ isOptional: false;
60
+ };
61
+ targetObject: {
62
+ type: _contractspec_lib_schema247.FieldType<string, string>;
63
+ isOptional: false;
64
+ };
65
+ scheduleEnabled: {
66
+ type: _contractspec_lib_schema247.FieldType<boolean, boolean>;
67
+ isOptional: false;
68
+ };
69
+ scheduleCron: {
70
+ type: _contractspec_lib_schema247.FieldType<string, string>;
71
+ isOptional: true;
72
+ };
73
+ isActive: {
74
+ type: _contractspec_lib_schema247.FieldType<boolean, boolean>;
75
+ isOptional: false;
76
+ };
77
+ lastSyncAt: {
78
+ type: _contractspec_lib_schema247.FieldType<Date, string>;
79
+ isOptional: true;
80
+ };
81
+ fieldMappings: {
82
+ type: _contractspec_lib_schema247.SchemaModel<{
83
+ id: {
84
+ type: _contractspec_lib_schema247.FieldType<string, string>;
85
+ isOptional: false;
86
+ };
87
+ sourceField: {
88
+ type: _contractspec_lib_schema247.FieldType<string, string>;
89
+ isOptional: false;
90
+ };
91
+ targetField: {
92
+ type: _contractspec_lib_schema247.FieldType<string, string>;
93
+ isOptional: false;
94
+ };
95
+ mappingType: {
96
+ type: _contractspec_lib_schema247.EnumType<[string, string, string, string, string]>;
97
+ isOptional: false;
98
+ };
99
+ transformExpression: {
100
+ type: _contractspec_lib_schema247.FieldType<string, string>;
101
+ isOptional: true;
102
+ };
103
+ isRequired: {
104
+ type: _contractspec_lib_schema247.FieldType<boolean, boolean>;
105
+ isOptional: false;
106
+ };
107
+ }>;
108
+ isArray: true;
109
+ isOptional: true;
110
+ };
111
+ }>;
112
+ /**
113
+ * A sync run.
114
+ */
115
+ declare const SyncRunModel: _contractspec_lib_schema247.SchemaModel<{
116
+ id: {
117
+ type: _contractspec_lib_schema247.FieldType<string, string>;
118
+ isOptional: false;
119
+ };
120
+ syncConfigId: {
121
+ type: _contractspec_lib_schema247.FieldType<string, string>;
122
+ isOptional: false;
123
+ };
124
+ status: {
125
+ type: _contractspec_lib_schema247.EnumType<[string, string, string, string, string]>;
126
+ isOptional: false;
127
+ };
128
+ direction: {
129
+ type: _contractspec_lib_schema247.EnumType<[string, string, string]>;
130
+ isOptional: false;
131
+ };
132
+ trigger: {
133
+ type: _contractspec_lib_schema247.FieldType<string, string>;
134
+ isOptional: false;
135
+ };
136
+ recordsProcessed: {
137
+ type: _contractspec_lib_schema247.FieldType<number, number>;
138
+ isOptional: false;
139
+ };
140
+ recordsCreated: {
141
+ type: _contractspec_lib_schema247.FieldType<number, number>;
142
+ isOptional: false;
143
+ };
144
+ recordsUpdated: {
145
+ type: _contractspec_lib_schema247.FieldType<number, number>;
146
+ isOptional: false;
147
+ };
148
+ recordsFailed: {
149
+ type: _contractspec_lib_schema247.FieldType<number, number>;
150
+ isOptional: false;
151
+ };
152
+ errorMessage: {
153
+ type: _contractspec_lib_schema247.FieldType<string, string>;
154
+ isOptional: true;
155
+ };
156
+ startedAt: {
157
+ type: _contractspec_lib_schema247.FieldType<Date, string>;
158
+ isOptional: true;
159
+ };
160
+ completedAt: {
161
+ type: _contractspec_lib_schema247.FieldType<Date, string>;
162
+ isOptional: true;
163
+ };
164
+ createdAt: {
165
+ type: _contractspec_lib_schema247.FieldType<Date, string>;
166
+ isOptional: false;
167
+ };
168
+ }>;
169
+ /**
170
+ * Input for creating a sync config.
171
+ */
172
+ declare const CreateSyncConfigInputModel: _contractspec_lib_schema247.SchemaModel<{
173
+ integrationId: {
174
+ type: _contractspec_lib_schema247.FieldType<string, string>;
175
+ isOptional: false;
176
+ };
177
+ connectionId: {
178
+ type: _contractspec_lib_schema247.FieldType<string, string>;
179
+ isOptional: false;
180
+ };
181
+ name: {
182
+ type: _contractspec_lib_schema247.FieldType<string, string>;
183
+ isOptional: false;
184
+ };
185
+ direction: {
186
+ type: _contractspec_lib_schema247.EnumType<[string, string, string]>;
187
+ isOptional: false;
188
+ };
189
+ sourceObject: {
190
+ type: _contractspec_lib_schema247.FieldType<string, string>;
191
+ isOptional: false;
192
+ };
193
+ targetObject: {
194
+ type: _contractspec_lib_schema247.FieldType<string, string>;
195
+ isOptional: false;
196
+ };
197
+ scheduleEnabled: {
198
+ type: _contractspec_lib_schema247.FieldType<boolean, boolean>;
199
+ isOptional: true;
200
+ };
201
+ scheduleCron: {
202
+ type: _contractspec_lib_schema247.FieldType<string, string>;
203
+ isOptional: true;
204
+ };
205
+ }>;
206
+ /**
207
+ * Input for adding a field mapping.
208
+ */
209
+ declare const AddFieldMappingInputModel: _contractspec_lib_schema247.SchemaModel<{
210
+ syncConfigId: {
211
+ type: _contractspec_lib_schema247.FieldType<string, string>;
212
+ isOptional: false;
213
+ };
214
+ sourceField: {
215
+ type: _contractspec_lib_schema247.FieldType<string, string>;
216
+ isOptional: false;
217
+ };
218
+ targetField: {
219
+ type: _contractspec_lib_schema247.FieldType<string, string>;
220
+ isOptional: false;
221
+ };
222
+ mappingType: {
223
+ type: _contractspec_lib_schema247.EnumType<[string, string, string, string, string]>;
224
+ isOptional: false;
225
+ };
226
+ transformExpression: {
227
+ type: _contractspec_lib_schema247.FieldType<string, string>;
228
+ isOptional: true;
229
+ };
230
+ lookupConfig: {
231
+ type: _contractspec_lib_schema247.FieldType<unknown, unknown>;
232
+ isOptional: true;
233
+ };
234
+ constantValue: {
235
+ type: _contractspec_lib_schema247.FieldType<unknown, unknown>;
236
+ isOptional: true;
237
+ };
238
+ isRequired: {
239
+ type: _contractspec_lib_schema247.FieldType<boolean, boolean>;
240
+ isOptional: true;
241
+ };
242
+ defaultValue: {
243
+ type: _contractspec_lib_schema247.FieldType<unknown, unknown>;
244
+ isOptional: true;
245
+ };
246
+ }>;
247
+ /**
248
+ * Input for triggering a sync.
249
+ */
250
+ declare const TriggerSyncInputModel: _contractspec_lib_schema247.SchemaModel<{
251
+ syncConfigId: {
252
+ type: _contractspec_lib_schema247.FieldType<string, string>;
253
+ isOptional: false;
254
+ };
255
+ direction: {
256
+ type: _contractspec_lib_schema247.EnumType<[string, string, string]>;
257
+ isOptional: true;
258
+ };
259
+ fullSync: {
260
+ type: _contractspec_lib_schema247.FieldType<boolean, boolean>;
261
+ isOptional: true;
262
+ };
263
+ }>;
264
+ /**
265
+ * Input for listing sync runs.
266
+ */
267
+ declare const ListSyncRunsInputModel: _contractspec_lib_schema247.SchemaModel<{
268
+ syncConfigId: {
269
+ type: _contractspec_lib_schema247.FieldType<string, string>;
270
+ isOptional: false;
271
+ };
272
+ status: {
273
+ type: _contractspec_lib_schema247.EnumType<[string, string, string, string, string]>;
274
+ isOptional: true;
275
+ };
276
+ limit: {
277
+ type: _contractspec_lib_schema247.FieldType<number, number>;
278
+ isOptional: true;
279
+ defaultValue: number;
280
+ };
281
+ offset: {
282
+ type: _contractspec_lib_schema247.FieldType<number, number>;
283
+ isOptional: true;
284
+ defaultValue: number;
285
+ };
286
+ }>;
287
+ /**
288
+ * Output for listing sync runs.
289
+ */
290
+ declare const ListSyncRunsOutputModel: _contractspec_lib_schema247.SchemaModel<{
291
+ runs: {
292
+ type: _contractspec_lib_schema247.SchemaModel<{
293
+ id: {
294
+ type: _contractspec_lib_schema247.FieldType<string, string>;
295
+ isOptional: false;
296
+ };
297
+ syncConfigId: {
298
+ type: _contractspec_lib_schema247.FieldType<string, string>;
299
+ isOptional: false;
300
+ };
301
+ status: {
302
+ type: _contractspec_lib_schema247.EnumType<[string, string, string, string, string]>;
303
+ isOptional: false;
304
+ };
305
+ direction: {
306
+ type: _contractspec_lib_schema247.EnumType<[string, string, string]>;
307
+ isOptional: false;
308
+ };
309
+ trigger: {
310
+ type: _contractspec_lib_schema247.FieldType<string, string>;
311
+ isOptional: false;
312
+ };
313
+ recordsProcessed: {
314
+ type: _contractspec_lib_schema247.FieldType<number, number>;
315
+ isOptional: false;
316
+ };
317
+ recordsCreated: {
318
+ type: _contractspec_lib_schema247.FieldType<number, number>;
319
+ isOptional: false;
320
+ };
321
+ recordsUpdated: {
322
+ type: _contractspec_lib_schema247.FieldType<number, number>;
323
+ isOptional: false;
324
+ };
325
+ recordsFailed: {
326
+ type: _contractspec_lib_schema247.FieldType<number, number>;
327
+ isOptional: false;
328
+ };
329
+ errorMessage: {
330
+ type: _contractspec_lib_schema247.FieldType<string, string>;
331
+ isOptional: true;
332
+ };
333
+ startedAt: {
334
+ type: _contractspec_lib_schema247.FieldType<Date, string>;
335
+ isOptional: true;
336
+ };
337
+ completedAt: {
338
+ type: _contractspec_lib_schema247.FieldType<Date, string>;
339
+ isOptional: true;
340
+ };
341
+ createdAt: {
342
+ type: _contractspec_lib_schema247.FieldType<Date, string>;
343
+ isOptional: false;
344
+ };
345
+ }>;
346
+ isArray: true;
347
+ isOptional: false;
348
+ };
349
+ total: {
350
+ type: _contractspec_lib_schema247.FieldType<number, number>;
351
+ isOptional: false;
352
+ };
353
+ }>;
354
+ //#endregion
355
+ export { AddFieldMappingInputModel, CreateSyncConfigInputModel, FieldMappingModel, ListSyncRunsInputModel, ListSyncRunsOutputModel, SyncConfigModel, SyncRunModel, TriggerSyncInputModel };
356
+ //# sourceMappingURL=sync.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync.schema.d.ts","names":[],"sources":["../../src/sync/sync.schema.ts"],"sourcesContent":[],"mappings":";;;;;;AAUa,cAAA,iBAaX,8BAb4B,WAa5B,CAAA;EAAA,EAAA,EAAA;UAAA,2BAAA,CAAA;;;;;;EAb4B,CAAA;EAkBjB,WAAA,EAAA;IAmBX,IAAA,uCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;;;;;;;;;;;;cAnBW,eAAe,8BAAA,WAAA,CAAA;EAAA,EAAA,EAAA;IAwBf,IAAA,EALX,2BAAA,CAAA,SAyBA,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;;;;;;;;;;;;;EApBuB,CAAA;EAyBZ,YAAA,EAAA;IAeX,IAAA,uCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;+CAfqC,CAAA,OAAA,EAAA,OAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EAoB1B,CAAA;EAgBX,YAAA,EAAA;;;;;;;;;+CAhBoC,KAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,IAAA;EAqBzB,CAAA;EAOX,aAAA,EAAA;;;mDAPgC,CAAA,MAAA,EAAA,MAAA,CAAA;QAAA,UAAA,EAAA,KAAA;MAYrB,CAAA;MAgBX,WAAA,EAAA;;;;;QAhBiC,IAAA,uCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;QAqBtB,UAAA,EAAA,KAMX;MAAA,CAAA;;;;;;;;;;;;;;;;;;;;;cAzGW,0CAAY;;UAoBvB,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW,wDAA0B;;UAerC,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW,uDAAyB;;UAgBpC,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW,mDAAqB;;UAOhC,2BAAA,CAAA;;;;;;;;;;;;;;;cAKW,oDAAsB;;UAgBjC,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;cAKW,qDAAuB;;;;cAMlC,2BAAA,CAAA"}
@@ -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;GAAE,MAAM,eAAe,SAAS;GAAE,YAAY;GAAO;EAClE;CACF,CAAC;;;;AAKF,MAAa,kBAAkB,kBAAkB;CAC/C,MAAM;CACN,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,eAAe;GACb,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACnE,WAAW;GAAE,MAAM;GAAmB,YAAY;GAAO;EACzD,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,iBAAiB;GAAE,MAAM,eAAe,SAAS;GAAE,YAAY;GAAO;EACtE,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EAC1E,UAAU;GAAE,MAAM,eAAe,SAAS;GAAE,YAAY;GAAO;EA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