@contractspec/example.integration-hub 3.8.8 → 3.8.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/connection/connection.enum.js +1 -29
- package/dist/connection/connection.operation.js +1 -124
- package/dist/connection/connection.presentation.js +1 -125
- package/dist/connection/connection.schema.js +1 -71
- package/dist/connection/index.js +1 -127
- package/dist/docs/index.js +5 -49
- package/dist/docs/integration-hub.docblock.js +5 -49
- package/dist/events.js +1 -211
- package/dist/example.js +1 -42
- package/dist/handlers/index.js +5 -292
- package/dist/handlers/integration.handlers.js +5 -292
- package/dist/index.js +8 -2355
- package/dist/integration/index.js +1 -92
- package/dist/integration/integration.enum.js +1 -12
- package/dist/integration/integration.operations.js +1 -89
- package/dist/integration/integration.presentation.js +1 -120
- package/dist/integration/integration.schema.js +1 -42
- package/dist/integration-hub.capability.js +1 -43
- package/dist/integration-hub.feature.js +1 -330
- package/dist/mcp-example.js +1 -154
- package/dist/node/connection/connection.enum.js +1 -29
- package/dist/node/connection/connection.operation.js +1 -124
- package/dist/node/connection/connection.presentation.js +1 -125
- package/dist/node/connection/connection.schema.js +1 -71
- package/dist/node/connection/index.js +1 -127
- package/dist/node/docs/index.js +5 -49
- package/dist/node/docs/integration-hub.docblock.js +5 -49
- package/dist/node/events.js +1 -211
- package/dist/node/example.js +1 -42
- package/dist/node/handlers/index.js +5 -292
- package/dist/node/handlers/integration.handlers.js +5 -292
- package/dist/node/index.js +8 -2355
- package/dist/node/integration/index.js +1 -92
- package/dist/node/integration/integration.enum.js +1 -12
- package/dist/node/integration/integration.operations.js +1 -89
- package/dist/node/integration/integration.presentation.js +1 -120
- package/dist/node/integration/integration.schema.js +1 -42
- package/dist/node/integration-hub.capability.js +1 -43
- package/dist/node/integration-hub.feature.js +1 -330
- package/dist/node/mcp-example.js +1 -154
- package/dist/node/run-mcp.js +1 -159
- package/dist/node/seeders/index.js +6 -60
- package/dist/node/sync/index.js +1 -332
- package/dist/node/sync/sync.enum.js +1 -26
- package/dist/node/sync/sync.operations.js +1 -321
- package/dist/node/sync/sync.presentation.js +1 -301
- package/dist/node/sync/sync.schema.js +1 -154
- package/dist/node/sync-engine/index.js +1 -186
- package/dist/node/tests/operations.test-spec.js +1 -85
- package/dist/node/ui/IntegrationDashboard.js +1 -886
- package/dist/node/ui/IntegrationDashboard.visualizations.js +1 -250
- package/dist/node/ui/IntegrationHubChat.js +1 -34
- package/dist/node/ui/hooks/index.js +1 -57
- package/dist/node/ui/hooks/useIntegrationData.js +1 -54
- package/dist/node/ui/index.js +4 -1173
- package/dist/node/ui/renderers/index.js +4 -484
- package/dist/node/ui/renderers/integration.markdown.js +4 -484
- package/dist/node/ui/tables/ConnectionsTable.js +1 -211
- package/dist/node/ui/tables/IntegrationTables.js +1 -361
- package/dist/node/ui/tables/SyncConfigsTable.js +1 -230
- package/dist/node/ui/tables/integration-table.shared.js +1 -84
- package/dist/node/visualizations/catalog.js +1 -137
- package/dist/node/visualizations/index.js +1 -211
- package/dist/node/visualizations/selectors.js +1 -204
- package/dist/run-mcp.js +1 -159
- package/dist/seeders/index.js +6 -60
- package/dist/sync/index.js +1 -332
- package/dist/sync/sync.enum.js +1 -26
- package/dist/sync/sync.operations.js +1 -321
- package/dist/sync/sync.presentation.js +1 -301
- package/dist/sync/sync.schema.js +1 -154
- package/dist/sync-engine/index.js +1 -186
- package/dist/tests/operations.test-spec.js +1 -85
- package/dist/ui/IntegrationDashboard.js +1 -886
- package/dist/ui/IntegrationDashboard.visualizations.js +1 -250
- package/dist/ui/IntegrationHubChat.js +1 -34
- package/dist/ui/hooks/index.js +1 -57
- package/dist/ui/hooks/useIntegrationData.js +1 -54
- package/dist/ui/index.js +4 -1173
- package/dist/ui/renderers/index.js +4 -484
- package/dist/ui/renderers/integration.markdown.js +4 -484
- package/dist/ui/tables/ConnectionsTable.js +1 -211
- package/dist/ui/tables/IntegrationTables.js +1 -361
- package/dist/ui/tables/SyncConfigsTable.js +1 -230
- package/dist/ui/tables/integration-table.shared.js +1 -84
- package/dist/visualizations/catalog.js +1 -137
- package/dist/visualizations/index.js +1 -211
- package/dist/visualizations/selectors.js +1 -204
- package/package.json +14 -14
|
@@ -1,322 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import { defineEnum } from "@contractspec/lib.schema";
|
|
4
|
-
var SyncDirectionEnum = defineEnum("SyncDirection", [
|
|
5
|
-
"INBOUND",
|
|
6
|
-
"OUTBOUND",
|
|
7
|
-
"BIDIRECTIONAL"
|
|
8
|
-
]);
|
|
9
|
-
var SyncStatusEnum = defineEnum("SyncStatus", [
|
|
10
|
-
"PENDING",
|
|
11
|
-
"RUNNING",
|
|
12
|
-
"COMPLETED",
|
|
13
|
-
"FAILED",
|
|
14
|
-
"CANCELLED"
|
|
15
|
-
]);
|
|
16
|
-
var MappingTypeEnum = defineEnum("MappingType", [
|
|
17
|
-
"DIRECT",
|
|
18
|
-
"TRANSFORM",
|
|
19
|
-
"LOOKUP",
|
|
20
|
-
"CONSTANT",
|
|
21
|
-
"COMPUTED"
|
|
22
|
-
]);
|
|
23
|
-
|
|
24
|
-
// src/sync/sync.schema.ts
|
|
25
|
-
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
26
|
-
var FieldMappingModel = defineSchemaModel({
|
|
27
|
-
name: "FieldMappingModel",
|
|
28
|
-
fields: {
|
|
29
|
-
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
30
|
-
sourceField: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
31
|
-
targetField: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
32
|
-
mappingType: { type: MappingTypeEnum, isOptional: false },
|
|
33
|
-
transformExpression: {
|
|
34
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
35
|
-
isOptional: true
|
|
36
|
-
},
|
|
37
|
-
isRequired: { type: ScalarTypeEnum.Boolean(), isOptional: false }
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
var SyncConfigModel = defineSchemaModel({
|
|
41
|
-
name: "SyncConfigModel",
|
|
42
|
-
fields: {
|
|
43
|
-
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
44
|
-
integrationId: {
|
|
45
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
46
|
-
isOptional: false
|
|
47
|
-
},
|
|
48
|
-
connectionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
49
|
-
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
50
|
-
direction: { type: SyncDirectionEnum, isOptional: false },
|
|
51
|
-
sourceObject: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
52
|
-
targetObject: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
53
|
-
scheduleEnabled: { type: ScalarTypeEnum.Boolean(), isOptional: false },
|
|
54
|
-
scheduleCron: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
55
|
-
isActive: { type: ScalarTypeEnum.Boolean(), isOptional: false },
|
|
56
|
-
lastSyncAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
57
|
-
fieldMappings: { type: FieldMappingModel, isArray: true, isOptional: true }
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
var SyncRunModel = defineSchemaModel({
|
|
61
|
-
name: "SyncRunModel",
|
|
62
|
-
fields: {
|
|
63
|
-
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
64
|
-
syncConfigId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
65
|
-
status: { type: SyncStatusEnum, isOptional: false },
|
|
66
|
-
direction: { type: SyncDirectionEnum, isOptional: false },
|
|
67
|
-
trigger: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
68
|
-
recordsProcessed: {
|
|
69
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
70
|
-
isOptional: false
|
|
71
|
-
},
|
|
72
|
-
recordsCreated: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
73
|
-
recordsUpdated: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
74
|
-
recordsFailed: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
75
|
-
errorMessage: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
76
|
-
startedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
77
|
-
completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
78
|
-
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
var CreateSyncConfigInputModel = defineSchemaModel({
|
|
82
|
-
name: "CreateSyncConfigInput",
|
|
83
|
-
fields: {
|
|
84
|
-
integrationId: {
|
|
85
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
86
|
-
isOptional: false
|
|
87
|
-
},
|
|
88
|
-
connectionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
89
|
-
name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
90
|
-
direction: { type: SyncDirectionEnum, isOptional: false },
|
|
91
|
-
sourceObject: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
92
|
-
targetObject: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
93
|
-
scheduleEnabled: { type: ScalarTypeEnum.Boolean(), isOptional: true },
|
|
94
|
-
scheduleCron: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
var AddFieldMappingInputModel = defineSchemaModel({
|
|
98
|
-
name: "AddFieldMappingInput",
|
|
99
|
-
fields: {
|
|
100
|
-
syncConfigId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
101
|
-
sourceField: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
102
|
-
targetField: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
103
|
-
mappingType: { type: MappingTypeEnum, isOptional: false },
|
|
104
|
-
transformExpression: {
|
|
105
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
106
|
-
isOptional: true
|
|
107
|
-
},
|
|
108
|
-
lookupConfig: { type: ScalarTypeEnum.JSON(), isOptional: true },
|
|
109
|
-
constantValue: { type: ScalarTypeEnum.JSON(), isOptional: true },
|
|
110
|
-
isRequired: { type: ScalarTypeEnum.Boolean(), isOptional: true },
|
|
111
|
-
defaultValue: { type: ScalarTypeEnum.JSON(), isOptional: true }
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
var TriggerSyncInputModel = defineSchemaModel({
|
|
115
|
-
name: "TriggerSyncInput",
|
|
116
|
-
fields: {
|
|
117
|
-
syncConfigId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
118
|
-
direction: { type: SyncDirectionEnum, isOptional: true },
|
|
119
|
-
fullSync: { type: ScalarTypeEnum.Boolean(), isOptional: true }
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
var ListSyncRunsInputModel = defineSchemaModel({
|
|
123
|
-
name: "ListSyncRunsInput",
|
|
124
|
-
fields: {
|
|
125
|
-
syncConfigId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
126
|
-
status: { type: SyncStatusEnum, isOptional: true },
|
|
127
|
-
limit: {
|
|
128
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
129
|
-
isOptional: true,
|
|
130
|
-
defaultValue: 20
|
|
131
|
-
},
|
|
132
|
-
offset: {
|
|
133
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
134
|
-
isOptional: true,
|
|
135
|
-
defaultValue: 0
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
var ListSyncRunsOutputModel = defineSchemaModel({
|
|
140
|
-
name: "ListSyncRunsOutput",
|
|
141
|
-
fields: {
|
|
142
|
-
runs: { type: SyncRunModel, isArray: true, isOptional: false },
|
|
143
|
-
total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false }
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
// src/sync/sync.operations.ts
|
|
148
|
-
import {
|
|
149
|
-
defineCommand,
|
|
150
|
-
defineQuery
|
|
151
|
-
} from "@contractspec/lib.contracts-spec/operations";
|
|
152
|
-
var OWNERS = ["@example.integration-hub"];
|
|
153
|
-
var CreateSyncConfigContract = defineCommand({
|
|
154
|
-
meta: {
|
|
155
|
-
key: "integration.syncConfig.create",
|
|
156
|
-
version: "1.0.0",
|
|
157
|
-
stability: "stable",
|
|
158
|
-
owners: [...OWNERS],
|
|
159
|
-
tags: ["integration", "sync", "config", "create"],
|
|
160
|
-
description: "Create a sync configuration.",
|
|
161
|
-
goal: "Define how data should be synchronized.",
|
|
162
|
-
context: "Sync setup."
|
|
163
|
-
},
|
|
164
|
-
io: { input: CreateSyncConfigInputModel, output: SyncConfigModel },
|
|
165
|
-
policy: { auth: "user" },
|
|
166
|
-
sideEffects: {
|
|
167
|
-
emits: [
|
|
168
|
-
{
|
|
169
|
-
key: "integration.syncConfig.created",
|
|
170
|
-
version: "1.0.0",
|
|
171
|
-
when: "Sync config created",
|
|
172
|
-
payload: SyncConfigModel
|
|
173
|
-
}
|
|
174
|
-
],
|
|
175
|
-
audit: ["integration.syncConfig.created"]
|
|
176
|
-
},
|
|
177
|
-
acceptance: {
|
|
178
|
-
scenarios: [
|
|
179
|
-
{
|
|
180
|
-
key: "create-sync-happy-path",
|
|
181
|
-
given: ["User is authenticated"],
|
|
182
|
-
when: ["User creates sync config"],
|
|
183
|
-
then: ["Sync config is created", "SyncConfigCreated event is emitted"]
|
|
184
|
-
}
|
|
185
|
-
],
|
|
186
|
-
examples: [
|
|
187
|
-
{
|
|
188
|
-
key: "create-contact-sync",
|
|
189
|
-
input: {
|
|
190
|
-
name: "Contacts Sync",
|
|
191
|
-
sourceConnectionId: "conn-1",
|
|
192
|
-
targetConnectionId: "conn-2"
|
|
193
|
-
},
|
|
194
|
-
output: { id: "sync-123", status: "active" }
|
|
195
|
-
}
|
|
196
|
-
]
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
var AddFieldMappingContract = defineCommand({
|
|
200
|
-
meta: {
|
|
201
|
-
key: "integration.fieldMapping.add",
|
|
202
|
-
version: "1.0.0",
|
|
203
|
-
stability: "stable",
|
|
204
|
-
owners: [...OWNERS],
|
|
205
|
-
tags: ["integration", "mapping", "field"],
|
|
206
|
-
description: "Add a field mapping to a sync config.",
|
|
207
|
-
goal: "Map fields between systems.",
|
|
208
|
-
context: "Mapping configuration."
|
|
209
|
-
},
|
|
210
|
-
io: { input: AddFieldMappingInputModel, output: FieldMappingModel },
|
|
211
|
-
policy: { auth: "user" },
|
|
212
|
-
sideEffects: {
|
|
213
|
-
emits: [
|
|
214
|
-
{
|
|
215
|
-
key: "integration.fieldMapping.added",
|
|
216
|
-
version: "1.0.0",
|
|
217
|
-
when: "Mapping added",
|
|
218
|
-
payload: FieldMappingModel
|
|
219
|
-
}
|
|
220
|
-
]
|
|
221
|
-
},
|
|
222
|
-
acceptance: {
|
|
223
|
-
scenarios: [
|
|
224
|
-
{
|
|
225
|
-
key: "add-mapping-happy-path",
|
|
226
|
-
given: ["Sync config exists"],
|
|
227
|
-
when: ["User adds field mapping"],
|
|
228
|
-
then: ["Mapping is added", "FieldMappingAdded event is emitted"]
|
|
229
|
-
}
|
|
230
|
-
],
|
|
231
|
-
examples: [
|
|
232
|
-
{
|
|
233
|
-
key: "map-email",
|
|
234
|
-
input: {
|
|
235
|
-
syncConfigId: "sync-123",
|
|
236
|
-
sourceField: "email",
|
|
237
|
-
targetField: "user_email"
|
|
238
|
-
},
|
|
239
|
-
output: { id: "map-456", type: "string" }
|
|
240
|
-
}
|
|
241
|
-
]
|
|
242
|
-
}
|
|
243
|
-
});
|
|
244
|
-
var TriggerSyncContract = defineCommand({
|
|
245
|
-
meta: {
|
|
246
|
-
key: "integration.sync.trigger",
|
|
247
|
-
version: "1.0.0",
|
|
248
|
-
stability: "stable",
|
|
249
|
-
owners: [...OWNERS],
|
|
250
|
-
tags: ["integration", "sync", "trigger"],
|
|
251
|
-
description: "Trigger a manual sync.",
|
|
252
|
-
goal: "Start data synchronization.",
|
|
253
|
-
context: "Manual sync or webhook trigger."
|
|
254
|
-
},
|
|
255
|
-
io: { input: TriggerSyncInputModel, output: SyncRunModel },
|
|
256
|
-
policy: { auth: "user" },
|
|
257
|
-
sideEffects: {
|
|
258
|
-
emits: [
|
|
259
|
-
{
|
|
260
|
-
key: "integration.sync.started",
|
|
261
|
-
version: "1.0.0",
|
|
262
|
-
when: "Sync starts",
|
|
263
|
-
payload: SyncRunModel
|
|
264
|
-
}
|
|
265
|
-
],
|
|
266
|
-
audit: ["integration.sync.triggered"]
|
|
267
|
-
},
|
|
268
|
-
acceptance: {
|
|
269
|
-
scenarios: [
|
|
270
|
-
{
|
|
271
|
-
key: "trigger-sync-happy-path",
|
|
272
|
-
given: ["Sync config exists"],
|
|
273
|
-
when: ["User triggers sync"],
|
|
274
|
-
then: ["Sync run starts", "SyncStarted event is emitted"]
|
|
275
|
-
}
|
|
276
|
-
],
|
|
277
|
-
examples: [
|
|
278
|
-
{
|
|
279
|
-
key: "manual-trigger",
|
|
280
|
-
input: { syncConfigId: "sync-123" },
|
|
281
|
-
output: { id: "run-789", status: "pending" }
|
|
282
|
-
}
|
|
283
|
-
]
|
|
284
|
-
}
|
|
285
|
-
});
|
|
286
|
-
var ListSyncRunsContract = defineQuery({
|
|
287
|
-
meta: {
|
|
288
|
-
key: "integration.syncRun.list",
|
|
289
|
-
version: "1.0.0",
|
|
290
|
-
stability: "stable",
|
|
291
|
-
owners: [...OWNERS],
|
|
292
|
-
tags: ["integration", "sync", "run", "list"],
|
|
293
|
-
description: "List sync run history.",
|
|
294
|
-
goal: "View sync history and status.",
|
|
295
|
-
context: "Sync monitoring."
|
|
296
|
-
},
|
|
297
|
-
io: { input: ListSyncRunsInputModel, output: ListSyncRunsOutputModel },
|
|
298
|
-
policy: { auth: "user" },
|
|
299
|
-
acceptance: {
|
|
300
|
-
scenarios: [
|
|
301
|
-
{
|
|
302
|
-
key: "list-runs-happy-path",
|
|
303
|
-
given: ["User has access to syncs"],
|
|
304
|
-
when: ["User lists sync runs"],
|
|
305
|
-
then: ["List of runs is returned"]
|
|
306
|
-
}
|
|
307
|
-
],
|
|
308
|
-
examples: [
|
|
309
|
-
{
|
|
310
|
-
key: "list-recent",
|
|
311
|
-
input: { limit: 10 },
|
|
312
|
-
output: { items: [], total: 50 }
|
|
313
|
-
}
|
|
314
|
-
]
|
|
315
|
-
}
|
|
316
|
-
});
|
|
317
|
-
export {
|
|
318
|
-
TriggerSyncContract,
|
|
319
|
-
ListSyncRunsContract,
|
|
320
|
-
CreateSyncConfigContract,
|
|
321
|
-
AddFieldMappingContract
|
|
322
|
-
};
|
|
2
|
+
import{defineEnum as O}from"@contractspec/lib.schema";var U=O("SyncDirection",["INBOUND","OUTBOUND","BIDIRECTIONAL"]),P=O("SyncStatus",["PENDING","RUNNING","COMPLETED","FAILED","CANCELLED"]),x=O("MappingType",["DIRECT","TRANSFORM","LOOKUP","CONSTANT","COMPUTED"]);import{defineSchemaModel as D,ScalarTypeEnum as N}from"@contractspec/lib.schema";var A=D({name:"FieldMappingModel",fields:{id:{type:N.String_unsecure(),isOptional:!1},sourceField:{type:N.String_unsecure(),isOptional:!1},targetField:{type:N.String_unsecure(),isOptional:!1},mappingType:{type:x,isOptional:!1},transformExpression:{type:N.String_unsecure(),isOptional:!0},isRequired:{type:N.Boolean(),isOptional:!1}}}),B=D({name:"SyncConfigModel",fields:{id:{type:N.String_unsecure(),isOptional:!1},integrationId:{type:N.String_unsecure(),isOptional:!1},connectionId:{type:N.String_unsecure(),isOptional:!1},name:{type:N.String_unsecure(),isOptional:!1},direction:{type:U,isOptional:!1},sourceObject:{type:N.String_unsecure(),isOptional:!1},targetObject:{type:N.String_unsecure(),isOptional:!1},scheduleEnabled:{type:N.Boolean(),isOptional:!1},scheduleCron:{type:N.String_unsecure(),isOptional:!0},isActive:{type:N.Boolean(),isOptional:!1},lastSyncAt:{type:N.DateTime(),isOptional:!0},fieldMappings:{type:A,isArray:!0,isOptional:!0}}}),I=D({name:"SyncRunModel",fields:{id:{type:N.String_unsecure(),isOptional:!1},syncConfigId:{type:N.String_unsecure(),isOptional:!1},status:{type:P,isOptional:!1},direction:{type:U,isOptional:!1},trigger:{type:N.String_unsecure(),isOptional:!1},recordsProcessed:{type:N.Int_unsecure(),isOptional:!1},recordsCreated:{type:N.Int_unsecure(),isOptional:!1},recordsUpdated:{type:N.Int_unsecure(),isOptional:!1},recordsFailed:{type:N.Int_unsecure(),isOptional:!1},errorMessage:{type:N.String_unsecure(),isOptional:!0},startedAt:{type:N.DateTime(),isOptional:!0},completedAt:{type:N.DateTime(),isOptional:!0},createdAt:{type:N.DateTime(),isOptional:!1}}}),K=D({name:"CreateSyncConfigInput",fields:{integrationId:{type:N.String_unsecure(),isOptional:!1},connectionId:{type:N.String_unsecure(),isOptional:!1},name:{type:N.NonEmptyString(),isOptional:!1},direction:{type:U,isOptional:!1},sourceObject:{type:N.NonEmptyString(),isOptional:!1},targetObject:{type:N.NonEmptyString(),isOptional:!1},scheduleEnabled:{type:N.Boolean(),isOptional:!0},scheduleCron:{type:N.String_unsecure(),isOptional:!0}}}),j=D({name:"AddFieldMappingInput",fields:{syncConfigId:{type:N.String_unsecure(),isOptional:!1},sourceField:{type:N.NonEmptyString(),isOptional:!1},targetField:{type:N.NonEmptyString(),isOptional:!1},mappingType:{type:x,isOptional:!1},transformExpression:{type:N.String_unsecure(),isOptional:!0},lookupConfig:{type:N.JSON(),isOptional:!0},constantValue:{type:N.JSON(),isOptional:!0},isRequired:{type:N.Boolean(),isOptional:!0},defaultValue:{type:N.JSON(),isOptional:!0}}}),k=D({name:"TriggerSyncInput",fields:{syncConfigId:{type:N.String_unsecure(),isOptional:!1},direction:{type:U,isOptional:!0},fullSync:{type:N.Boolean(),isOptional:!0}}}),q=D({name:"ListSyncRunsInput",fields:{syncConfigId:{type:N.String_unsecure(),isOptional:!1},status:{type:P,isOptional:!0},limit:{type:N.Int_unsecure(),isOptional:!0,defaultValue:20},offset:{type:N.Int_unsecure(),isOptional:!0,defaultValue:0}}}),v=D({name:"ListSyncRunsOutput",fields:{runs:{type:I,isArray:!0,isOptional:!1},total:{type:N.Int_unsecure(),isOptional:!1}}});import{defineCommand as G,defineQuery as w}from"@contractspec/lib.contracts-spec/operations";var L=["@example.integration-hub"],Z=G({meta:{key:"integration.syncConfig.create",version:"1.0.0",stability:"stable",owners:[...L],tags:["integration","sync","config","create"],description:"Create a sync configuration.",goal:"Define how data should be synchronized.",context:"Sync setup."},io:{input:K,output:B},policy:{auth:"user"},sideEffects:{emits:[{key:"integration.syncConfig.created",version:"1.0.0",when:"Sync config created",payload:B}],audit:["integration.syncConfig.created"]},acceptance:{scenarios:[{key:"create-sync-happy-path",given:["User is authenticated"],when:["User creates sync config"],then:["Sync config is created","SyncConfigCreated event is emitted"]}],examples:[{key:"create-contact-sync",input:{name:"Contacts Sync",sourceConnectionId:"conn-1",targetConnectionId:"conn-2"},output:{id:"sync-123",status:"active"}}]}}),_=G({meta:{key:"integration.fieldMapping.add",version:"1.0.0",stability:"stable",owners:[...L],tags:["integration","mapping","field"],description:"Add a field mapping to a sync config.",goal:"Map fields between systems.",context:"Mapping configuration."},io:{input:j,output:A},policy:{auth:"user"},sideEffects:{emits:[{key:"integration.fieldMapping.added",version:"1.0.0",when:"Mapping added",payload:A}]},acceptance:{scenarios:[{key:"add-mapping-happy-path",given:["Sync config exists"],when:["User adds field mapping"],then:["Mapping is added","FieldMappingAdded event is emitted"]}],examples:[{key:"map-email",input:{syncConfigId:"sync-123",sourceField:"email",targetField:"user_email"},output:{id:"map-456",type:"string"}}]}}),$=G({meta:{key:"integration.sync.trigger",version:"1.0.0",stability:"stable",owners:[...L],tags:["integration","sync","trigger"],description:"Trigger a manual sync.",goal:"Start data synchronization.",context:"Manual sync or webhook trigger."},io:{input:k,output:I},policy:{auth:"user"},sideEffects:{emits:[{key:"integration.sync.started",version:"1.0.0",when:"Sync starts",payload:I}],audit:["integration.sync.triggered"]},acceptance:{scenarios:[{key:"trigger-sync-happy-path",given:["Sync config exists"],when:["User triggers sync"],then:["Sync run starts","SyncStarted event is emitted"]}],examples:[{key:"manual-trigger",input:{syncConfigId:"sync-123"},output:{id:"run-789",status:"pending"}}]}}),Q=w({meta:{key:"integration.syncRun.list",version:"1.0.0",stability:"stable",owners:[...L],tags:["integration","sync","run","list"],description:"List sync run history.",goal:"View sync history and status.",context:"Sync monitoring."},io:{input:q,output:v},policy:{auth:"user"},acceptance:{scenarios:[{key:"list-runs-happy-path",given:["User has access to syncs"],when:["User lists sync runs"],then:["List of runs is returned"]}],examples:[{key:"list-recent",input:{limit:10},output:{items:[],total:50}}]}});export{$ as TriggerSyncContract,Q as ListSyncRunsContract,Z as CreateSyncConfigContract,_ as AddFieldMappingContract};
|
|
@@ -1,302 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import { defineEnum } from "@contractspec/lib.schema";
|
|
4
|
-
var SyncDirectionEnum = defineEnum("SyncDirection", [
|
|
5
|
-
"INBOUND",
|
|
6
|
-
"OUTBOUND",
|
|
7
|
-
"BIDIRECTIONAL"
|
|
8
|
-
]);
|
|
9
|
-
var SyncStatusEnum = defineEnum("SyncStatus", [
|
|
10
|
-
"PENDING",
|
|
11
|
-
"RUNNING",
|
|
12
|
-
"COMPLETED",
|
|
13
|
-
"FAILED",
|
|
14
|
-
"CANCELLED"
|
|
15
|
-
]);
|
|
16
|
-
var MappingTypeEnum = defineEnum("MappingType", [
|
|
17
|
-
"DIRECT",
|
|
18
|
-
"TRANSFORM",
|
|
19
|
-
"LOOKUP",
|
|
20
|
-
"CONSTANT",
|
|
21
|
-
"COMPUTED"
|
|
22
|
-
]);
|
|
23
|
-
|
|
24
|
-
// src/sync/sync.schema.ts
|
|
25
|
-
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
26
|
-
var FieldMappingModel = defineSchemaModel({
|
|
27
|
-
name: "FieldMappingModel",
|
|
28
|
-
fields: {
|
|
29
|
-
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
30
|
-
sourceField: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
31
|
-
targetField: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
32
|
-
mappingType: { type: MappingTypeEnum, isOptional: false },
|
|
33
|
-
transformExpression: {
|
|
34
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
35
|
-
isOptional: true
|
|
36
|
-
},
|
|
37
|
-
isRequired: { type: ScalarTypeEnum.Boolean(), isOptional: false }
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
var SyncConfigModel = defineSchemaModel({
|
|
41
|
-
name: "SyncConfigModel",
|
|
42
|
-
fields: {
|
|
43
|
-
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
44
|
-
integrationId: {
|
|
45
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
46
|
-
isOptional: false
|
|
47
|
-
},
|
|
48
|
-
connectionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
49
|
-
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
50
|
-
direction: { type: SyncDirectionEnum, isOptional: false },
|
|
51
|
-
sourceObject: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
52
|
-
targetObject: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
53
|
-
scheduleEnabled: { type: ScalarTypeEnum.Boolean(), isOptional: false },
|
|
54
|
-
scheduleCron: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
55
|
-
isActive: { type: ScalarTypeEnum.Boolean(), isOptional: false },
|
|
56
|
-
lastSyncAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
57
|
-
fieldMappings: { type: FieldMappingModel, isArray: true, isOptional: true }
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
var SyncRunModel = defineSchemaModel({
|
|
61
|
-
name: "SyncRunModel",
|
|
62
|
-
fields: {
|
|
63
|
-
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
64
|
-
syncConfigId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
65
|
-
status: { type: SyncStatusEnum, isOptional: false },
|
|
66
|
-
direction: { type: SyncDirectionEnum, isOptional: false },
|
|
67
|
-
trigger: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
68
|
-
recordsProcessed: {
|
|
69
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
70
|
-
isOptional: false
|
|
71
|
-
},
|
|
72
|
-
recordsCreated: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
73
|
-
recordsUpdated: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
74
|
-
recordsFailed: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
75
|
-
errorMessage: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
76
|
-
startedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
77
|
-
completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
78
|
-
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
var CreateSyncConfigInputModel = defineSchemaModel({
|
|
82
|
-
name: "CreateSyncConfigInput",
|
|
83
|
-
fields: {
|
|
84
|
-
integrationId: {
|
|
85
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
86
|
-
isOptional: false
|
|
87
|
-
},
|
|
88
|
-
connectionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
89
|
-
name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
90
|
-
direction: { type: SyncDirectionEnum, isOptional: false },
|
|
91
|
-
sourceObject: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
92
|
-
targetObject: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
93
|
-
scheduleEnabled: { type: ScalarTypeEnum.Boolean(), isOptional: true },
|
|
94
|
-
scheduleCron: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
var AddFieldMappingInputModel = defineSchemaModel({
|
|
98
|
-
name: "AddFieldMappingInput",
|
|
99
|
-
fields: {
|
|
100
|
-
syncConfigId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
101
|
-
sourceField: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
102
|
-
targetField: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
103
|
-
mappingType: { type: MappingTypeEnum, isOptional: false },
|
|
104
|
-
transformExpression: {
|
|
105
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
106
|
-
isOptional: true
|
|
107
|
-
},
|
|
108
|
-
lookupConfig: { type: ScalarTypeEnum.JSON(), isOptional: true },
|
|
109
|
-
constantValue: { type: ScalarTypeEnum.JSON(), isOptional: true },
|
|
110
|
-
isRequired: { type: ScalarTypeEnum.Boolean(), isOptional: true },
|
|
111
|
-
defaultValue: { type: ScalarTypeEnum.JSON(), isOptional: true }
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
var TriggerSyncInputModel = defineSchemaModel({
|
|
115
|
-
name: "TriggerSyncInput",
|
|
116
|
-
fields: {
|
|
117
|
-
syncConfigId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
118
|
-
direction: { type: SyncDirectionEnum, isOptional: true },
|
|
119
|
-
fullSync: { type: ScalarTypeEnum.Boolean(), isOptional: true }
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
var ListSyncRunsInputModel = defineSchemaModel({
|
|
123
|
-
name: "ListSyncRunsInput",
|
|
124
|
-
fields: {
|
|
125
|
-
syncConfigId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
126
|
-
status: { type: SyncStatusEnum, isOptional: true },
|
|
127
|
-
limit: {
|
|
128
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
129
|
-
isOptional: true,
|
|
130
|
-
defaultValue: 20
|
|
131
|
-
},
|
|
132
|
-
offset: {
|
|
133
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
134
|
-
isOptional: true,
|
|
135
|
-
defaultValue: 0
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
var ListSyncRunsOutputModel = defineSchemaModel({
|
|
140
|
-
name: "ListSyncRunsOutput",
|
|
141
|
-
fields: {
|
|
142
|
-
runs: { type: SyncRunModel, isArray: true, isOptional: false },
|
|
143
|
-
total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false }
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
// src/sync/sync.presentation.ts
|
|
148
|
-
import {
|
|
149
|
-
definePresentation,
|
|
150
|
-
StabilityEnum
|
|
151
|
-
} from "@contractspec/lib.contracts-spec";
|
|
152
|
-
var SyncConfigListPresentation = definePresentation({
|
|
153
|
-
meta: {
|
|
154
|
-
key: "integration.syncConfig.list",
|
|
155
|
-
version: "1.0.0",
|
|
156
|
-
title: "Sync Config List",
|
|
157
|
-
description: "List of sync configurations",
|
|
158
|
-
domain: "integration",
|
|
159
|
-
owners: ["@integration-team"],
|
|
160
|
-
tags: ["integration", "sync", "config", "list"],
|
|
161
|
-
stability: StabilityEnum.Experimental,
|
|
162
|
-
goal: "Show users their current sync configurations.",
|
|
163
|
-
context: "Management view for data synchronization."
|
|
164
|
-
},
|
|
165
|
-
source: {
|
|
166
|
-
type: "component",
|
|
167
|
-
framework: "react",
|
|
168
|
-
componentKey: "SyncConfigList",
|
|
169
|
-
props: SyncConfigModel
|
|
170
|
-
},
|
|
171
|
-
targets: ["react", "markdown"],
|
|
172
|
-
policy: {
|
|
173
|
-
flags: ["integration.sync.enabled"]
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
var SyncConfigEditorPresentation = definePresentation({
|
|
177
|
-
meta: {
|
|
178
|
-
key: "integration.syncConfig.editor",
|
|
179
|
-
version: "1.0.0",
|
|
180
|
-
title: "Sync Config Editor",
|
|
181
|
-
description: "Editor for sync configuration settings",
|
|
182
|
-
domain: "integration",
|
|
183
|
-
owners: ["@integration-team"],
|
|
184
|
-
tags: ["integration", "sync", "config", "editor"],
|
|
185
|
-
stability: StabilityEnum.Experimental,
|
|
186
|
-
goal: "Allow users to configure schedule, filters, and settings for a sync.",
|
|
187
|
-
context: "Configuration interface for sync jobs."
|
|
188
|
-
},
|
|
189
|
-
source: {
|
|
190
|
-
type: "component",
|
|
191
|
-
framework: "react",
|
|
192
|
-
componentKey: "SyncConfigEditor",
|
|
193
|
-
props: SyncConfigModel
|
|
194
|
-
},
|
|
195
|
-
targets: ["react"],
|
|
196
|
-
policy: {
|
|
197
|
-
flags: ["integration.sync.enabled"]
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
var FieldMappingEditorPresentation = definePresentation({
|
|
201
|
-
meta: {
|
|
202
|
-
key: "integration.fieldMapping.editor",
|
|
203
|
-
version: "1.0.0",
|
|
204
|
-
title: "Field Mapping Editor",
|
|
205
|
-
description: "Visual field mapping editor",
|
|
206
|
-
domain: "integration",
|
|
207
|
-
owners: ["@integration-team"],
|
|
208
|
-
tags: ["integration", "field-mapping", "editor"],
|
|
209
|
-
stability: StabilityEnum.Experimental,
|
|
210
|
-
goal: "Allow users to map source fields to target fields visually.",
|
|
211
|
-
context: "Schema mapping tool for data consistency."
|
|
212
|
-
},
|
|
213
|
-
source: {
|
|
214
|
-
type: "component",
|
|
215
|
-
framework: "react",
|
|
216
|
-
componentKey: "FieldMappingEditor",
|
|
217
|
-
props: FieldMappingModel
|
|
218
|
-
},
|
|
219
|
-
targets: ["react"],
|
|
220
|
-
policy: {
|
|
221
|
-
flags: ["integration.sync.enabled"]
|
|
222
|
-
}
|
|
223
|
-
});
|
|
224
|
-
var SyncRunListPresentation = definePresentation({
|
|
225
|
-
meta: {
|
|
226
|
-
key: "integration.syncRun.viewList",
|
|
227
|
-
version: "1.0.0",
|
|
228
|
-
title: "Sync Run History",
|
|
229
|
-
description: "History of sync runs",
|
|
230
|
-
domain: "integration",
|
|
231
|
-
owners: ["@integration-team"],
|
|
232
|
-
tags: ["integration", "sync", "runs", "history"],
|
|
233
|
-
stability: StabilityEnum.Experimental,
|
|
234
|
-
goal: "Provide a historical log of all sync attempts and their results.",
|
|
235
|
-
context: "Audit and troubleshooting view for sync jobs."
|
|
236
|
-
},
|
|
237
|
-
source: {
|
|
238
|
-
type: "component",
|
|
239
|
-
framework: "react",
|
|
240
|
-
componentKey: "SyncRunList",
|
|
241
|
-
props: SyncRunModel
|
|
242
|
-
},
|
|
243
|
-
targets: ["react", "markdown"],
|
|
244
|
-
policy: {
|
|
245
|
-
flags: ["integration.sync.enabled"]
|
|
246
|
-
}
|
|
247
|
-
});
|
|
248
|
-
var SyncRunDetailPresentation = definePresentation({
|
|
249
|
-
meta: {
|
|
250
|
-
key: "integration.syncRun.detail",
|
|
251
|
-
version: "1.0.0",
|
|
252
|
-
title: "Sync Run Details",
|
|
253
|
-
description: "Detailed view of a sync run with logs",
|
|
254
|
-
domain: "integration",
|
|
255
|
-
owners: ["@integration-team"],
|
|
256
|
-
tags: ["integration", "sync", "run", "detail"],
|
|
257
|
-
stability: StabilityEnum.Experimental,
|
|
258
|
-
goal: "Show granular details and logs for a specific sync run.",
|
|
259
|
-
context: "Detailed troubleshooting view."
|
|
260
|
-
},
|
|
261
|
-
source: {
|
|
262
|
-
type: "component",
|
|
263
|
-
framework: "react",
|
|
264
|
-
componentKey: "SyncRunDetail",
|
|
265
|
-
props: SyncRunModel
|
|
266
|
-
},
|
|
267
|
-
targets: ["react", "markdown"],
|
|
268
|
-
policy: {
|
|
269
|
-
flags: ["integration.sync.enabled"]
|
|
270
|
-
}
|
|
271
|
-
});
|
|
272
|
-
var SyncActivityPresentation = definePresentation({
|
|
273
|
-
meta: {
|
|
274
|
-
key: "integration.sync.activity",
|
|
275
|
-
version: "1.0.0",
|
|
276
|
-
title: "Sync Activity Monitor",
|
|
277
|
-
description: "Real-time sync activity monitor",
|
|
278
|
-
domain: "integration",
|
|
279
|
-
owners: ["@integration-team"],
|
|
280
|
-
tags: ["integration", "sync", "activity", "realtime"],
|
|
281
|
-
stability: StabilityEnum.Experimental,
|
|
282
|
-
goal: "Monitor live data flow and sync performance.",
|
|
283
|
-
context: "Real-time operations monitor."
|
|
284
|
-
},
|
|
285
|
-
source: {
|
|
286
|
-
type: "component",
|
|
287
|
-
framework: "react",
|
|
288
|
-
componentKey: "SyncActivity"
|
|
289
|
-
},
|
|
290
|
-
targets: ["react", "markdown"],
|
|
291
|
-
policy: {
|
|
292
|
-
flags: ["integration.sync.enabled"]
|
|
293
|
-
}
|
|
294
|
-
});
|
|
295
|
-
export {
|
|
296
|
-
SyncRunListPresentation,
|
|
297
|
-
SyncRunDetailPresentation,
|
|
298
|
-
SyncConfigListPresentation,
|
|
299
|
-
SyncConfigEditorPresentation,
|
|
300
|
-
SyncActivityPresentation,
|
|
301
|
-
FieldMappingEditorPresentation
|
|
302
|
-
};
|
|
2
|
+
import{defineEnum as A}from"@contractspec/lib.schema";var L=A("SyncDirection",["INBOUND","OUTBOUND","BIDIRECTIONAL"]),C=A("SyncStatus",["PENDING","RUNNING","COMPLETED","FAILED","CANCELLED"]),x=A("MappingType",["DIRECT","TRANSFORM","LOOKUP","CONSTANT","COMPUTED"]);import{defineSchemaModel as O,ScalarTypeEnum as N}from"@contractspec/lib.schema";var B=O({name:"FieldMappingModel",fields:{id:{type:N.String_unsecure(),isOptional:!1},sourceField:{type:N.String_unsecure(),isOptional:!1},targetField:{type:N.String_unsecure(),isOptional:!1},mappingType:{type:x,isOptional:!1},transformExpression:{type:N.String_unsecure(),isOptional:!0},isRequired:{type:N.Boolean(),isOptional:!1}}}),G=O({name:"SyncConfigModel",fields:{id:{type:N.String_unsecure(),isOptional:!1},integrationId:{type:N.String_unsecure(),isOptional:!1},connectionId:{type:N.String_unsecure(),isOptional:!1},name:{type:N.String_unsecure(),isOptional:!1},direction:{type:L,isOptional:!1},sourceObject:{type:N.String_unsecure(),isOptional:!1},targetObject:{type:N.String_unsecure(),isOptional:!1},scheduleEnabled:{type:N.Boolean(),isOptional:!1},scheduleCron:{type:N.String_unsecure(),isOptional:!0},isActive:{type:N.Boolean(),isOptional:!1},lastSyncAt:{type:N.DateTime(),isOptional:!0},fieldMappings:{type:B,isArray:!0,isOptional:!0}}}),U=O({name:"SyncRunModel",fields:{id:{type:N.String_unsecure(),isOptional:!1},syncConfigId:{type:N.String_unsecure(),isOptional:!1},status:{type:C,isOptional:!1},direction:{type:L,isOptional:!1},trigger:{type:N.String_unsecure(),isOptional:!1},recordsProcessed:{type:N.Int_unsecure(),isOptional:!1},recordsCreated:{type:N.Int_unsecure(),isOptional:!1},recordsUpdated:{type:N.Int_unsecure(),isOptional:!1},recordsFailed:{type:N.Int_unsecure(),isOptional:!1},errorMessage:{type:N.String_unsecure(),isOptional:!0},startedAt:{type:N.DateTime(),isOptional:!0},completedAt:{type:N.DateTime(),isOptional:!0},createdAt:{type:N.DateTime(),isOptional:!1}}}),q=O({name:"CreateSyncConfigInput",fields:{integrationId:{type:N.String_unsecure(),isOptional:!1},connectionId:{type:N.String_unsecure(),isOptional:!1},name:{type:N.NonEmptyString(),isOptional:!1},direction:{type:L,isOptional:!1},sourceObject:{type:N.NonEmptyString(),isOptional:!1},targetObject:{type:N.NonEmptyString(),isOptional:!1},scheduleEnabled:{type:N.Boolean(),isOptional:!0},scheduleCron:{type:N.String_unsecure(),isOptional:!0}}}),v=O({name:"AddFieldMappingInput",fields:{syncConfigId:{type:N.String_unsecure(),isOptional:!1},sourceField:{type:N.NonEmptyString(),isOptional:!1},targetField:{type:N.NonEmptyString(),isOptional:!1},mappingType:{type:x,isOptional:!1},transformExpression:{type:N.String_unsecure(),isOptional:!0},lookupConfig:{type:N.JSON(),isOptional:!0},constantValue:{type:N.JSON(),isOptional:!0},isRequired:{type:N.Boolean(),isOptional:!0},defaultValue:{type:N.JSON(),isOptional:!0}}}),w=O({name:"TriggerSyncInput",fields:{syncConfigId:{type:N.String_unsecure(),isOptional:!1},direction:{type:L,isOptional:!0},fullSync:{type:N.Boolean(),isOptional:!0}}}),z=O({name:"ListSyncRunsInput",fields:{syncConfigId:{type:N.String_unsecure(),isOptional:!1},status:{type:C,isOptional:!0},limit:{type:N.Int_unsecure(),isOptional:!0,defaultValue:20},offset:{type:N.Int_unsecure(),isOptional:!0,defaultValue:0}}}),F=O({name:"ListSyncRunsOutput",fields:{runs:{type:U,isArray:!0,isOptional:!1},total:{type:N.Int_unsecure(),isOptional:!1}}});import{definePresentation as I,StabilityEnum as D}from"@contractspec/lib.contracts-spec";var V=I({meta:{key:"integration.syncConfig.list",version:"1.0.0",title:"Sync Config List",description:"List of sync configurations",domain:"integration",owners:["@integration-team"],tags:["integration","sync","config","list"],stability:D.Experimental,goal:"Show users their current sync configurations.",context:"Management view for data synchronization."},source:{type:"component",framework:"react",componentKey:"SyncConfigList",props:G},targets:["react","markdown"],policy:{flags:["integration.sync.enabled"]}}),W=I({meta:{key:"integration.syncConfig.editor",version:"1.0.0",title:"Sync Config Editor",description:"Editor for sync configuration settings",domain:"integration",owners:["@integration-team"],tags:["integration","sync","config","editor"],stability:D.Experimental,goal:"Allow users to configure schedule, filters, and settings for a sync.",context:"Configuration interface for sync jobs."},source:{type:"component",framework:"react",componentKey:"SyncConfigEditor",props:G},targets:["react"],policy:{flags:["integration.sync.enabled"]}}),X=I({meta:{key:"integration.fieldMapping.editor",version:"1.0.0",title:"Field Mapping Editor",description:"Visual field mapping editor",domain:"integration",owners:["@integration-team"],tags:["integration","field-mapping","editor"],stability:D.Experimental,goal:"Allow users to map source fields to target fields visually.",context:"Schema mapping tool for data consistency."},source:{type:"component",framework:"react",componentKey:"FieldMappingEditor",props:B},targets:["react"],policy:{flags:["integration.sync.enabled"]}}),Y=I({meta:{key:"integration.syncRun.viewList",version:"1.0.0",title:"Sync Run History",description:"History of sync runs",domain:"integration",owners:["@integration-team"],tags:["integration","sync","runs","history"],stability:D.Experimental,goal:"Provide a historical log of all sync attempts and their results.",context:"Audit and troubleshooting view for sync jobs."},source:{type:"component",framework:"react",componentKey:"SyncRunList",props:U},targets:["react","markdown"],policy:{flags:["integration.sync.enabled"]}}),Z=I({meta:{key:"integration.syncRun.detail",version:"1.0.0",title:"Sync Run Details",description:"Detailed view of a sync run with logs",domain:"integration",owners:["@integration-team"],tags:["integration","sync","run","detail"],stability:D.Experimental,goal:"Show granular details and logs for a specific sync run.",context:"Detailed troubleshooting view."},source:{type:"component",framework:"react",componentKey:"SyncRunDetail",props:U},targets:["react","markdown"],policy:{flags:["integration.sync.enabled"]}}),_=I({meta:{key:"integration.sync.activity",version:"1.0.0",title:"Sync Activity Monitor",description:"Real-time sync activity monitor",domain:"integration",owners:["@integration-team"],tags:["integration","sync","activity","realtime"],stability:D.Experimental,goal:"Monitor live data flow and sync performance.",context:"Real-time operations monitor."},source:{type:"component",framework:"react",componentKey:"SyncActivity"},targets:["react","markdown"],policy:{flags:["integration.sync.enabled"]}});export{Y as SyncRunListPresentation,Z as SyncRunDetailPresentation,V as SyncConfigListPresentation,W as SyncConfigEditorPresentation,_ as SyncActivityPresentation,X as FieldMappingEditorPresentation};
|