@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.
- package/LICENSE +21 -0
- package/README.md +156 -0
- package/dist/connection/connection.enum.d.ts +10 -0
- package/dist/connection/connection.enum.d.ts.map +1 -0
- package/dist/connection/connection.enum.js +17 -0
- package/dist/connection/connection.enum.js.map +1 -0
- package/dist/connection/connection.operation.d.ts +107 -0
- package/dist/connection/connection.operation.d.ts.map +1 -0
- package/dist/connection/connection.operation.js +63 -0
- package/dist/connection/connection.operation.js.map +1 -0
- package/dist/connection/connection.presentation.d.ts +8 -0
- package/dist/connection/connection.presentation.d.ts.map +1 -0
- package/dist/connection/connection.presentation.js +60 -0
- package/dist/connection/connection.presentation.js.map +1 -0
- package/dist/connection/connection.schema.d.ts +68 -0
- package/dist/connection/connection.schema.d.ts.map +1 -0
- package/dist/connection/connection.schema.js +76 -0
- package/dist/connection/connection.schema.js.map +1 -0
- package/dist/connection/index.d.ts +4 -0
- package/dist/connection/index.js +5 -0
- package/dist/docs/index.d.ts +1 -0
- package/dist/docs/index.js +1 -0
- package/dist/docs/integration-hub.docblock.d.ts +1 -0
- package/dist/docs/integration-hub.docblock.js +115 -0
- package/dist/docs/integration-hub.docblock.js.map +1 -0
- package/dist/events.d.ts +153 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +289 -0
- package/dist/events.js.map +1 -0
- package/dist/example.d.ts +7 -0
- package/dist/example.d.ts.map +1 -0
- package/dist/example.js +58 -0
- package/dist/example.js.map +1 -0
- package/dist/handlers/index.d.ts +2 -0
- package/dist/handlers/index.js +3 -0
- package/dist/handlers/integration.handlers.d.ts +130 -0
- package/dist/handlers/integration.handlers.d.ts.map +1 -0
- package/dist/handlers/integration.handlers.js +282 -0
- package/dist/handlers/integration.handlers.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +20 -0
- package/dist/integration/index.d.ts +4 -0
- package/dist/integration/index.js +5 -0
- package/dist/integration/integration.enum.d.ts +10 -0
- package/dist/integration/integration.enum.d.ts.map +1 -0
- package/dist/integration/integration.enum.js +17 -0
- package/dist/integration/integration.enum.js.map +1 -0
- package/dist/integration/integration.operations.d.ts +99 -0
- package/dist/integration/integration.operations.d.ts.map +1 -0
- package/dist/integration/integration.operations.js +57 -0
- package/dist/integration/integration.operations.js.map +1 -0
- package/dist/integration/integration.presentation.d.ts +9 -0
- package/dist/integration/integration.presentation.d.ts.map +1 -0
- package/dist/integration/integration.presentation.js +77 -0
- package/dist/integration/integration.presentation.js.map +1 -0
- package/dist/integration/integration.schema.d.ts +68 -0
- package/dist/integration/integration.schema.d.ts.map +1 -0
- package/dist/integration/integration.schema.js +76 -0
- package/dist/integration/integration.schema.js.map +1 -0
- package/dist/integration-hub.capability.d.ts +9 -0
- package/dist/integration-hub.capability.d.ts.map +1 -0
- package/dist/integration-hub.capability.js +38 -0
- package/dist/integration-hub.capability.js.map +1 -0
- package/dist/integration-hub.feature.d.ts +7 -0
- package/dist/integration-hub.feature.d.ts.map +1 -0
- package/dist/integration-hub.feature.js +244 -0
- package/dist/integration-hub.feature.js.map +1 -0
- package/dist/seeders/index.d.ts +10 -0
- package/dist/seeders/index.d.ts.map +1 -0
- package/dist/seeders/index.js +19 -0
- package/dist/seeders/index.js.map +1 -0
- package/dist/sync/index.d.ts +4 -0
- package/dist/sync/index.js +5 -0
- package/dist/sync/sync.enum.d.ts +18 -0
- package/dist/sync/sync.enum.d.ts.map +1 -0
- package/dist/sync/sync.enum.js +35 -0
- package/dist/sync/sync.enum.js.map +1 -0
- package/dist/sync/sync.operations.d.ts +509 -0
- package/dist/sync/sync.operations.d.ts.map +1 -0
- package/dist/sync/sync.operations.js +203 -0
- package/dist/sync/sync.operations.js.map +1 -0
- package/dist/sync/sync.presentation.d.ts +12 -0
- package/dist/sync/sync.presentation.d.ts.map +1 -0
- package/dist/sync/sync.presentation.js +168 -0
- package/dist/sync/sync.presentation.js.map +1 -0
- package/dist/sync/sync.schema.d.ts +356 -0
- package/dist/sync/sync.schema.d.ts.map +1 -0
- package/dist/sync/sync.schema.js +304 -0
- package/dist/sync/sync.schema.js.map +1 -0
- package/dist/sync-engine/index.d.ts +109 -0
- package/dist/sync-engine/index.d.ts.map +1 -0
- package/dist/sync-engine/index.js +148 -0
- package/dist/sync-engine/index.js.map +1 -0
- package/dist/tests/operations.test-spec.d.ts +9 -0
- package/dist/tests/operations.test-spec.d.ts.map +1 -0
- package/dist/tests/operations.test-spec.js +94 -0
- package/dist/tests/operations.test-spec.js.map +1 -0
- package/dist/ui/IntegrationDashboard.d.ts +7 -0
- package/dist/ui/IntegrationDashboard.d.ts.map +1 -0
- package/dist/ui/IntegrationDashboard.js +266 -0
- package/dist/ui/IntegrationDashboard.js.map +1 -0
- package/dist/ui/hooks/index.d.ts +2 -0
- package/dist/ui/hooks/index.js +5 -0
- package/dist/ui/hooks/useIntegrationData.d.ts +23 -0
- package/dist/ui/hooks/useIntegrationData.d.ts.map +1 -0
- package/dist/ui/hooks/useIntegrationData.js +59 -0
- package/dist/ui/hooks/useIntegrationData.js.map +1 -0
- package/dist/ui/index.d.ts +6 -0
- package/dist/ui/index.js +6 -0
- package/dist/ui/renderers/index.d.ts +2 -0
- package/dist/ui/renderers/index.js +3 -0
- package/dist/ui/renderers/integration.markdown.d.ts +28 -0
- package/dist/ui/renderers/integration.markdown.d.ts.map +1 -0
- package/dist/ui/renderers/integration.markdown.js +256 -0
- package/dist/ui/renderers/integration.markdown.js.map +1 -0
- package/package.json +111 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
|
|
2
|
+
|
|
3
|
+
//#region src/docs/integration-hub.docblock.ts
|
|
4
|
+
registerDocBlocks([
|
|
5
|
+
{
|
|
6
|
+
id: "docs.examples.integration-hub",
|
|
7
|
+
title: "Integration Hub",
|
|
8
|
+
summary: "Generic integration center with connectors, connections, sync configs, field mappings, and sync logs.",
|
|
9
|
+
kind: "reference",
|
|
10
|
+
visibility: "public",
|
|
11
|
+
route: "/docs/examples/integration-hub",
|
|
12
|
+
tags: [
|
|
13
|
+
"integrations",
|
|
14
|
+
"sync",
|
|
15
|
+
"etl",
|
|
16
|
+
"connectors"
|
|
17
|
+
],
|
|
18
|
+
body: `## Entities
|
|
19
|
+
|
|
20
|
+
- Integration, Connection, SyncConfig, FieldMapping, SyncLog.
|
|
21
|
+
- Sync engine config lives in \`src/sync-engine\` to map remote <-> local entities.
|
|
22
|
+
|
|
23
|
+
## Contracts
|
|
24
|
+
|
|
25
|
+
- \`integration.create\`, \`integration.connect\`, \`integration.configureSync\`, \`integration.mapFields\`, \`integration.runSync\`.
|
|
26
|
+
- Uses Jobs module for scheduled syncs and retries; Files module for payload archives.
|
|
27
|
+
|
|
28
|
+
## Events
|
|
29
|
+
|
|
30
|
+
- sync.started/completed/failed, connection.connected/disconnected, mapping.updated.
|
|
31
|
+
- Forward to Notifications and Audit for observability.
|
|
32
|
+
|
|
33
|
+
## UI / Presentations
|
|
34
|
+
|
|
35
|
+
- Dashboard, integration list, connection detail, sync config editor.
|
|
36
|
+
- Templates registered as \`integration-hub\` in Template Registry.
|
|
37
|
+
|
|
38
|
+
## Notes
|
|
39
|
+
|
|
40
|
+
- Providers remain agnostic; keep mappings declarative for safe regeneration.
|
|
41
|
+
- Feature flags can gate specific providers; metering can track sync volume.
|
|
42
|
+
`
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: "docs.examples.integration-hub.goal",
|
|
46
|
+
title: "Integration Hub — Goal",
|
|
47
|
+
summary: "Why this integration hub exists and what success looks like.",
|
|
48
|
+
kind: "goal",
|
|
49
|
+
visibility: "public",
|
|
50
|
+
route: "/docs/examples/integration-hub/goal",
|
|
51
|
+
tags: ["integrations", "goal"],
|
|
52
|
+
body: `## Why it matters
|
|
53
|
+
- Gives a regenerable, provider-agnostic integration hub with explicit mappings.
|
|
54
|
+
- Prevents drift between sync configs, mappings, and event/log outputs.
|
|
55
|
+
|
|
56
|
+
## Business/Product goal
|
|
57
|
+
- Model connectors, connections, sync jobs, and mappings with governance and retries.
|
|
58
|
+
- Support staged provider rollouts via Feature Flags and observability via Audit/Notifications.
|
|
59
|
+
|
|
60
|
+
## Success criteria
|
|
61
|
+
- Connections and mappings regenerate safely after spec edits.
|
|
62
|
+
- Sync events and logs provide auditability; payloads are stored and PII-scoped.`
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: "docs.examples.integration-hub.usage",
|
|
66
|
+
title: "Integration Hub — Usage",
|
|
67
|
+
summary: "How to configure connectors, mappings, and scheduled syncs.",
|
|
68
|
+
kind: "usage",
|
|
69
|
+
visibility: "public",
|
|
70
|
+
route: "/docs/examples/integration-hub/usage",
|
|
71
|
+
tags: ["integrations", "usage"],
|
|
72
|
+
body: `## Setup
|
|
73
|
+
1) Seed integrations/connections (if available) or create connector definitions.
|
|
74
|
+
2) Configure sync jobs with Jobs module; store payload archives via Files.
|
|
75
|
+
|
|
76
|
+
## Extend & regenerate
|
|
77
|
+
1) Add mapping fields or provider configs in the spec; include validation and PII paths.
|
|
78
|
+
2) Regenerate to align UI/API/events/logs; verify Notifications/Audit hooks.
|
|
79
|
+
3) Gate risky providers behind Feature Flags; meter sync volume if needed.
|
|
80
|
+
|
|
81
|
+
## Guardrails
|
|
82
|
+
- Keep mappings declarative; avoid hardcoded transforms.
|
|
83
|
+
- Emit events for sync lifecycle; persist logs for audit.
|
|
84
|
+
- Redact sensitive payload paths in presentations.`
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: "docs.examples.integration-hub.constraints",
|
|
88
|
+
title: "Integration Hub — Constraints & Safety",
|
|
89
|
+
summary: "Internal guidance for sync lifecycle, mappings, and regeneration safety.",
|
|
90
|
+
kind: "reference",
|
|
91
|
+
visibility: "internal",
|
|
92
|
+
route: "/docs/examples/integration-hub/constraints",
|
|
93
|
+
tags: [
|
|
94
|
+
"integrations",
|
|
95
|
+
"constraints",
|
|
96
|
+
"internal"
|
|
97
|
+
],
|
|
98
|
+
body: `## Constraints
|
|
99
|
+
- Mappings and sync states must remain declarative in spec; no hidden code transforms.
|
|
100
|
+
- Events to emit at minimum: sync.started, sync.completed, sync.failed; connection.connected/disconnected.
|
|
101
|
+
- Regeneration should not alter retry/backoff semantics without explicit spec change.
|
|
102
|
+
|
|
103
|
+
## PII & Payloads
|
|
104
|
+
- Treat payload archives as potentially sensitive; mark policy.pii paths.
|
|
105
|
+
- For MCP/web, avoid exposing raw credentials/tokens; store via provider adapters only.
|
|
106
|
+
|
|
107
|
+
## Verification
|
|
108
|
+
- Include fixtures for mapping changes and sync retries.
|
|
109
|
+
- Validate that scheduled jobs (cron) are spec-driven; Jobs module wiring intact.
|
|
110
|
+
- Ensure Audit/Notifications receive sync lifecycle events.`
|
|
111
|
+
}
|
|
112
|
+
]);
|
|
113
|
+
|
|
114
|
+
//#endregion
|
|
115
|
+
//# sourceMappingURL=integration-hub.docblock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-hub.docblock.js","names":[],"sources":["../../src/docs/integration-hub.docblock.ts"],"sourcesContent":["import type { DocBlock } from '@contractspec/lib.contracts/docs';\nimport { registerDocBlocks } from '@contractspec/lib.contracts/docs';\n\nconst integrationHubDocBlocks: DocBlock[] = [\n {\n id: 'docs.examples.integration-hub',\n title: 'Integration Hub',\n summary:\n 'Generic integration center with connectors, connections, sync configs, field mappings, and sync logs.',\n kind: 'reference',\n visibility: 'public',\n route: '/docs/examples/integration-hub',\n tags: ['integrations', 'sync', 'etl', 'connectors'],\n body: `## Entities\n\n- Integration, Connection, SyncConfig, FieldMapping, SyncLog.\n- Sync engine config lives in \\`src/sync-engine\\` to map remote <-> local entities.\n\n## Contracts\n\n- \\`integration.create\\`, \\`integration.connect\\`, \\`integration.configureSync\\`, \\`integration.mapFields\\`, \\`integration.runSync\\`.\n- Uses Jobs module for scheduled syncs and retries; Files module for payload archives.\n\n## Events\n\n- sync.started/completed/failed, connection.connected/disconnected, mapping.updated.\n- Forward to Notifications and Audit for observability.\n\n## UI / Presentations\n\n- Dashboard, integration list, connection detail, sync config editor.\n- Templates registered as \\`integration-hub\\` in Template Registry.\n\n## Notes\n\n- Providers remain agnostic; keep mappings declarative for safe regeneration.\n- Feature flags can gate specific providers; metering can track sync volume.\n`,\n },\n {\n id: 'docs.examples.integration-hub.goal',\n title: 'Integration Hub — Goal',\n summary: 'Why this integration hub exists and what success looks like.',\n kind: 'goal',\n visibility: 'public',\n route: '/docs/examples/integration-hub/goal',\n tags: ['integrations', 'goal'],\n body: `## Why it matters\n- Gives a regenerable, provider-agnostic integration hub with explicit mappings.\n- Prevents drift between sync configs, mappings, and event/log outputs.\n\n## Business/Product goal\n- Model connectors, connections, sync jobs, and mappings with governance and retries.\n- Support staged provider rollouts via Feature Flags and observability via Audit/Notifications.\n\n## Success criteria\n- Connections and mappings regenerate safely after spec edits.\n- Sync events and logs provide auditability; payloads are stored and PII-scoped.`,\n },\n {\n id: 'docs.examples.integration-hub.usage',\n title: 'Integration Hub — Usage',\n summary: 'How to configure connectors, mappings, and scheduled syncs.',\n kind: 'usage',\n visibility: 'public',\n route: '/docs/examples/integration-hub/usage',\n tags: ['integrations', 'usage'],\n body: `## Setup\n1) Seed integrations/connections (if available) or create connector definitions.\n2) Configure sync jobs with Jobs module; store payload archives via Files.\n\n## Extend & regenerate\n1) Add mapping fields or provider configs in the spec; include validation and PII paths.\n2) Regenerate to align UI/API/events/logs; verify Notifications/Audit hooks.\n3) Gate risky providers behind Feature Flags; meter sync volume if needed.\n\n## Guardrails\n- Keep mappings declarative; avoid hardcoded transforms.\n- Emit events for sync lifecycle; persist logs for audit.\n- Redact sensitive payload paths in presentations.`,\n },\n {\n id: 'docs.examples.integration-hub.constraints',\n title: 'Integration Hub — Constraints & Safety',\n summary:\n 'Internal guidance for sync lifecycle, mappings, and regeneration safety.',\n kind: 'reference',\n visibility: 'internal',\n route: '/docs/examples/integration-hub/constraints',\n tags: ['integrations', 'constraints', 'internal'],\n body: `## Constraints\n- Mappings and sync states must remain declarative in spec; no hidden code transforms.\n- Events to emit at minimum: sync.started, sync.completed, sync.failed; connection.connected/disconnected.\n- Regeneration should not alter retry/backoff semantics without explicit spec change.\n\n## PII & Payloads\n- Treat payload archives as potentially sensitive; mark policy.pii paths.\n- For MCP/web, avoid exposing raw credentials/tokens; store via provider adapters only.\n\n## Verification\n- Include fixtures for mapping changes and sync retries.\n- Validate that scheduled jobs (cron) are spec-driven; Jobs module wiring intact.\n- Ensure Audit/Notifications receive sync lifecycle events.`,\n },\n];\n\nregisterDocBlocks(integrationHubDocBlocks);\n"],"mappings":";;;AA0GA,kBAvG4C;CAC1C;EACE,IAAI;EACJ,OAAO;EACP,SACE;EACF,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM;GAAC;GAAgB;GAAQ;GAAO;GAAa;EACnD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;EAyBP;CACD;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM,CAAC,gBAAgB,OAAO;EAC9B,MAAM;;;;;;;;;;;EAWP;CACD;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM,CAAC,gBAAgB,QAAQ;EAC/B,MAAM;;;;;;;;;;;;;EAaP;CACD;EACE,IAAI;EACJ,OAAO;EACP,SACE;EACF,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM;GAAC;GAAgB;GAAe;GAAW;EACjD,MAAM;;;;;;;;;;;;;EAaP;CACF,CAEyC"}
|
package/dist/events.d.ts
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import * as _contractspec_lib_contracts0 from "@contractspec/lib.contracts";
|
|
2
|
+
import * as _contractspec_lib_schema0 from "@contractspec/lib.schema";
|
|
3
|
+
|
|
4
|
+
//#region src/events.d.ts
|
|
5
|
+
declare const IntegrationCreatedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
|
|
6
|
+
integrationId: {
|
|
7
|
+
type: _contractspec_lib_schema0.FieldType<string, string>;
|
|
8
|
+
isOptional: false;
|
|
9
|
+
};
|
|
10
|
+
type: {
|
|
11
|
+
type: _contractspec_lib_schema0.FieldType<string, string>;
|
|
12
|
+
isOptional: false;
|
|
13
|
+
};
|
|
14
|
+
createdAt: {
|
|
15
|
+
type: _contractspec_lib_schema0.FieldType<Date, string>;
|
|
16
|
+
isOptional: false;
|
|
17
|
+
};
|
|
18
|
+
}>>;
|
|
19
|
+
declare const ConnectionCreatedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
|
|
20
|
+
connectionId: {
|
|
21
|
+
type: _contractspec_lib_schema0.FieldType<string, string>;
|
|
22
|
+
isOptional: false;
|
|
23
|
+
};
|
|
24
|
+
integrationId: {
|
|
25
|
+
type: _contractspec_lib_schema0.FieldType<string, string>;
|
|
26
|
+
isOptional: false;
|
|
27
|
+
};
|
|
28
|
+
status: {
|
|
29
|
+
type: _contractspec_lib_schema0.FieldType<string, string>;
|
|
30
|
+
isOptional: false;
|
|
31
|
+
};
|
|
32
|
+
createdAt: {
|
|
33
|
+
type: _contractspec_lib_schema0.FieldType<Date, string>;
|
|
34
|
+
isOptional: false;
|
|
35
|
+
};
|
|
36
|
+
}>>;
|
|
37
|
+
declare const ConnectionStatusChangedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
|
|
38
|
+
connectionId: {
|
|
39
|
+
type: _contractspec_lib_schema0.FieldType<string, string>;
|
|
40
|
+
isOptional: false;
|
|
41
|
+
};
|
|
42
|
+
previousStatus: {
|
|
43
|
+
type: _contractspec_lib_schema0.FieldType<string, string>;
|
|
44
|
+
isOptional: false;
|
|
45
|
+
};
|
|
46
|
+
newStatus: {
|
|
47
|
+
type: _contractspec_lib_schema0.FieldType<string, string>;
|
|
48
|
+
isOptional: false;
|
|
49
|
+
};
|
|
50
|
+
changedAt: {
|
|
51
|
+
type: _contractspec_lib_schema0.FieldType<Date, string>;
|
|
52
|
+
isOptional: false;
|
|
53
|
+
};
|
|
54
|
+
}>>;
|
|
55
|
+
declare const SyncConfigCreatedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
|
|
56
|
+
syncConfigId: {
|
|
57
|
+
type: _contractspec_lib_schema0.FieldType<string, string>;
|
|
58
|
+
isOptional: false;
|
|
59
|
+
};
|
|
60
|
+
connectionId: {
|
|
61
|
+
type: _contractspec_lib_schema0.FieldType<string, string>;
|
|
62
|
+
isOptional: false;
|
|
63
|
+
};
|
|
64
|
+
createdAt: {
|
|
65
|
+
type: _contractspec_lib_schema0.FieldType<Date, string>;
|
|
66
|
+
isOptional: false;
|
|
67
|
+
};
|
|
68
|
+
}>>;
|
|
69
|
+
declare const SyncStartedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
|
|
70
|
+
syncRunId: {
|
|
71
|
+
type: _contractspec_lib_schema0.FieldType<string, string>;
|
|
72
|
+
isOptional: false;
|
|
73
|
+
};
|
|
74
|
+
syncConfigId: {
|
|
75
|
+
type: _contractspec_lib_schema0.FieldType<string, string>;
|
|
76
|
+
isOptional: false;
|
|
77
|
+
};
|
|
78
|
+
startedAt: {
|
|
79
|
+
type: _contractspec_lib_schema0.FieldType<Date, string>;
|
|
80
|
+
isOptional: false;
|
|
81
|
+
};
|
|
82
|
+
}>>;
|
|
83
|
+
declare const SyncCompletedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
|
|
84
|
+
syncRunId: {
|
|
85
|
+
type: _contractspec_lib_schema0.FieldType<string, string>;
|
|
86
|
+
isOptional: false;
|
|
87
|
+
};
|
|
88
|
+
syncConfigId: {
|
|
89
|
+
type: _contractspec_lib_schema0.FieldType<string, string>;
|
|
90
|
+
isOptional: false;
|
|
91
|
+
};
|
|
92
|
+
recordsProcessed: {
|
|
93
|
+
type: _contractspec_lib_schema0.FieldType<number, number>;
|
|
94
|
+
isOptional: false;
|
|
95
|
+
};
|
|
96
|
+
completedAt: {
|
|
97
|
+
type: _contractspec_lib_schema0.FieldType<Date, string>;
|
|
98
|
+
isOptional: false;
|
|
99
|
+
};
|
|
100
|
+
}>>;
|
|
101
|
+
declare const SyncFailedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
|
|
102
|
+
syncRunId: {
|
|
103
|
+
type: _contractspec_lib_schema0.FieldType<string, string>;
|
|
104
|
+
isOptional: false;
|
|
105
|
+
};
|
|
106
|
+
syncConfigId: {
|
|
107
|
+
type: _contractspec_lib_schema0.FieldType<string, string>;
|
|
108
|
+
isOptional: false;
|
|
109
|
+
};
|
|
110
|
+
error: {
|
|
111
|
+
type: _contractspec_lib_schema0.FieldType<string, string>;
|
|
112
|
+
isOptional: false;
|
|
113
|
+
};
|
|
114
|
+
failedAt: {
|
|
115
|
+
type: _contractspec_lib_schema0.FieldType<Date, string>;
|
|
116
|
+
isOptional: false;
|
|
117
|
+
};
|
|
118
|
+
}>>;
|
|
119
|
+
declare const RecordSyncedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
|
|
120
|
+
syncRunId: {
|
|
121
|
+
type: _contractspec_lib_schema0.FieldType<string, string>;
|
|
122
|
+
isOptional: false;
|
|
123
|
+
};
|
|
124
|
+
recordId: {
|
|
125
|
+
type: _contractspec_lib_schema0.FieldType<string, string>;
|
|
126
|
+
isOptional: false;
|
|
127
|
+
};
|
|
128
|
+
sourceId: {
|
|
129
|
+
type: _contractspec_lib_schema0.FieldType<string, string>;
|
|
130
|
+
isOptional: false;
|
|
131
|
+
};
|
|
132
|
+
targetId: {
|
|
133
|
+
type: _contractspec_lib_schema0.FieldType<string, string>;
|
|
134
|
+
isOptional: false;
|
|
135
|
+
};
|
|
136
|
+
}>>;
|
|
137
|
+
declare const FieldMappingAddedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
|
|
138
|
+
syncConfigId: {
|
|
139
|
+
type: _contractspec_lib_schema0.FieldType<string, string>;
|
|
140
|
+
isOptional: false;
|
|
141
|
+
};
|
|
142
|
+
sourceField: {
|
|
143
|
+
type: _contractspec_lib_schema0.FieldType<string, string>;
|
|
144
|
+
isOptional: false;
|
|
145
|
+
};
|
|
146
|
+
targetField: {
|
|
147
|
+
type: _contractspec_lib_schema0.FieldType<string, string>;
|
|
148
|
+
isOptional: false;
|
|
149
|
+
};
|
|
150
|
+
}>>;
|
|
151
|
+
//#endregion
|
|
152
|
+
export { ConnectionCreatedEvent, ConnectionStatusChangedEvent, FieldMappingAddedEvent, IntegrationCreatedEvent, RecordSyncedEvent, SyncCompletedEvent, SyncConfigCreatedEvent, SyncFailedEvent, SyncStartedEvent };
|
|
153
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","names":[],"sources":["../src/events.ts"],"sourcesContent":[],"mappings":";;;;cAiBa,yBAAuB,4BAAA,CAAA,oCAAA;;UAUlC,yBAAA,CAAA;;EAVW,CAAA;EAUX,IAAA,EAAA;;;;;IAVkC,IAAA,qCAAA,KAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EA2BvB,CAAA;CAUX,CAAA,CAAA;cAVW,wBAAsB,4BAAA,CAAA,oCAAA;;UAUjC,yBAAA,CAAA;;;EAViC,aAAA,EAAA;IAAA,IAAA,qCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IA0BtB,UAAA,EAAA,KAAA;EAUX,CAAA;;;;;;IAVuC,IAAA,qCAAA,KAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EAuB5B,CAAA;CAUX,CAAA,CAAA;cAjCW,8BAA4B,4BAAA,CAAA,oCAAA;;UAUvC,yBAAA,CAAA;;EAaiC,CAAA;EAAA,cAAA,EAAA;IAuBtB,IAAA,qCAUX,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;EAV2B,CAAA;EAAA,SAAA,EAAA;IA0BhB,IAAA,qCAUX,KAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;cA3DW,wBAAsB,4BAAA,CAAA,oCAAA;;UAUjC,yBAAA,CAAA,SAuC6B,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EAAA,CAAA;EAuBlB,YAAA,EAAA;IAUX,IAAA,qCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;EAV0B,CAAA;CAAA,CAAA,CAAA;AAuBf,cAxEA,gBAkFX,EAlF2B,4BAAA,CAAA,SAkF3B,2BAlF2B,WAkF3B,CAAA;EAAA,SAAA,EAAA;UAxEA,yBAAA,CAAA;;;;IA8D4B,IAAA,qCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EAsBjB,CAAA;EAUX,SAAA,EAAA;;;;CAViC,CAAA,CAAA;AAAA,cApEtB,kBAoEsB,EApEJ,4BAAA,CAAA,SAoEI,2BApEJ,WAoEI,CAAA;;UA1DjC,yBAAA,CAAA;;;;;;;;;;;;;;;;cAaW,iBAAe,4BAAA,CAAA,oCAAA;;UAU1B,yBAAA,CAAA;;;;;;;;;;;;;;;;cAaW,mBAAiB,4BAAA,CAAA,oCAAA;;UAU5B,yBAAA,CAAA;;;;;;;;;;;;;;;;cAYW,wBAAsB,4BAAA,CAAA,oCAAA;;UAUjC,yBAAA,CAAA"}
|
package/dist/events.js
ADDED
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import { defineEvent } from "@contractspec/lib.contracts";
|
|
2
|
+
import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
|
|
3
|
+
|
|
4
|
+
//#region src/events.ts
|
|
5
|
+
const IntegrationCreatedPayload = defineSchemaModel({
|
|
6
|
+
name: "IntegrationCreatedPayload",
|
|
7
|
+
description: "Payload when an integration is created",
|
|
8
|
+
fields: {
|
|
9
|
+
integrationId: {
|
|
10
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
11
|
+
isOptional: false
|
|
12
|
+
},
|
|
13
|
+
type: {
|
|
14
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
15
|
+
isOptional: false
|
|
16
|
+
},
|
|
17
|
+
createdAt: {
|
|
18
|
+
type: ScalarTypeEnum.DateTime(),
|
|
19
|
+
isOptional: false
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const IntegrationCreatedEvent = defineEvent({
|
|
24
|
+
meta: {
|
|
25
|
+
key: "integration.created",
|
|
26
|
+
version: "1.0.0",
|
|
27
|
+
description: "Fired when a new integration is created",
|
|
28
|
+
stability: "experimental",
|
|
29
|
+
owners: ["@integration-team"],
|
|
30
|
+
tags: ["integration"]
|
|
31
|
+
},
|
|
32
|
+
payload: IntegrationCreatedPayload
|
|
33
|
+
});
|
|
34
|
+
const ConnectionCreatedPayload = defineSchemaModel({
|
|
35
|
+
name: "ConnectionCreatedPayload",
|
|
36
|
+
description: "Payload when a connection is established",
|
|
37
|
+
fields: {
|
|
38
|
+
connectionId: {
|
|
39
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
40
|
+
isOptional: false
|
|
41
|
+
},
|
|
42
|
+
integrationId: {
|
|
43
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
44
|
+
isOptional: false
|
|
45
|
+
},
|
|
46
|
+
status: {
|
|
47
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
48
|
+
isOptional: false
|
|
49
|
+
},
|
|
50
|
+
createdAt: {
|
|
51
|
+
type: ScalarTypeEnum.DateTime(),
|
|
52
|
+
isOptional: false
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
const ConnectionCreatedEvent = defineEvent({
|
|
57
|
+
meta: {
|
|
58
|
+
key: "integration.connection.created",
|
|
59
|
+
version: "1.0.0",
|
|
60
|
+
description: "Fired when a new connection is established",
|
|
61
|
+
stability: "experimental",
|
|
62
|
+
owners: ["@integration-team"],
|
|
63
|
+
tags: ["integration", "connection"]
|
|
64
|
+
},
|
|
65
|
+
payload: ConnectionCreatedPayload
|
|
66
|
+
});
|
|
67
|
+
const ConnectionStatusChangedPayload = defineSchemaModel({
|
|
68
|
+
name: "ConnectionStatusChangedPayload",
|
|
69
|
+
description: "Payload when a connection status changes",
|
|
70
|
+
fields: {
|
|
71
|
+
connectionId: {
|
|
72
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
73
|
+
isOptional: false
|
|
74
|
+
},
|
|
75
|
+
previousStatus: {
|
|
76
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
77
|
+
isOptional: false
|
|
78
|
+
},
|
|
79
|
+
newStatus: {
|
|
80
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
81
|
+
isOptional: false
|
|
82
|
+
},
|
|
83
|
+
changedAt: {
|
|
84
|
+
type: ScalarTypeEnum.DateTime(),
|
|
85
|
+
isOptional: false
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
const ConnectionStatusChangedEvent = defineEvent({
|
|
90
|
+
meta: {
|
|
91
|
+
key: "integration.connection.statusChanged",
|
|
92
|
+
version: "1.0.0",
|
|
93
|
+
description: "Fired when a connection status changes",
|
|
94
|
+
stability: "experimental",
|
|
95
|
+
owners: ["@integration-team"],
|
|
96
|
+
tags: ["integration", "connection"]
|
|
97
|
+
},
|
|
98
|
+
payload: ConnectionStatusChangedPayload
|
|
99
|
+
});
|
|
100
|
+
const SyncConfigCreatedPayload = defineSchemaModel({
|
|
101
|
+
name: "SyncConfigCreatedPayload",
|
|
102
|
+
description: "Payload when a sync configuration is created",
|
|
103
|
+
fields: {
|
|
104
|
+
syncConfigId: {
|
|
105
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
106
|
+
isOptional: false
|
|
107
|
+
},
|
|
108
|
+
connectionId: {
|
|
109
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
110
|
+
isOptional: false
|
|
111
|
+
},
|
|
112
|
+
createdAt: {
|
|
113
|
+
type: ScalarTypeEnum.DateTime(),
|
|
114
|
+
isOptional: false
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
const SyncConfigCreatedEvent = defineEvent({
|
|
119
|
+
meta: {
|
|
120
|
+
key: "integration.syncConfig.created",
|
|
121
|
+
version: "1.0.0",
|
|
122
|
+
description: "Fired when a sync configuration is created",
|
|
123
|
+
stability: "experimental",
|
|
124
|
+
owners: ["@integration-team"],
|
|
125
|
+
tags: ["integration", "sync"]
|
|
126
|
+
},
|
|
127
|
+
payload: SyncConfigCreatedPayload
|
|
128
|
+
});
|
|
129
|
+
const SyncStartedPayload = defineSchemaModel({
|
|
130
|
+
name: "SyncStartedPayload",
|
|
131
|
+
description: "Payload when a sync run starts",
|
|
132
|
+
fields: {
|
|
133
|
+
syncRunId: {
|
|
134
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
135
|
+
isOptional: false
|
|
136
|
+
},
|
|
137
|
+
syncConfigId: {
|
|
138
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
139
|
+
isOptional: false
|
|
140
|
+
},
|
|
141
|
+
startedAt: {
|
|
142
|
+
type: ScalarTypeEnum.DateTime(),
|
|
143
|
+
isOptional: false
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
const SyncStartedEvent = defineEvent({
|
|
148
|
+
meta: {
|
|
149
|
+
key: "integration.sync.started",
|
|
150
|
+
version: "1.0.0",
|
|
151
|
+
description: "Fired when a sync run starts",
|
|
152
|
+
stability: "experimental",
|
|
153
|
+
owners: ["@integration-team"],
|
|
154
|
+
tags: ["integration", "sync"]
|
|
155
|
+
},
|
|
156
|
+
payload: SyncStartedPayload
|
|
157
|
+
});
|
|
158
|
+
const SyncCompletedPayload = defineSchemaModel({
|
|
159
|
+
name: "SyncCompletedPayload",
|
|
160
|
+
description: "Payload when a sync run completes successfully",
|
|
161
|
+
fields: {
|
|
162
|
+
syncRunId: {
|
|
163
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
164
|
+
isOptional: false
|
|
165
|
+
},
|
|
166
|
+
syncConfigId: {
|
|
167
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
168
|
+
isOptional: false
|
|
169
|
+
},
|
|
170
|
+
recordsProcessed: {
|
|
171
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
172
|
+
isOptional: false
|
|
173
|
+
},
|
|
174
|
+
completedAt: {
|
|
175
|
+
type: ScalarTypeEnum.DateTime(),
|
|
176
|
+
isOptional: false
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
const SyncCompletedEvent = defineEvent({
|
|
181
|
+
meta: {
|
|
182
|
+
key: "integration.sync.completed",
|
|
183
|
+
version: "1.0.0",
|
|
184
|
+
description: "Fired when a sync run completes successfully",
|
|
185
|
+
stability: "experimental",
|
|
186
|
+
owners: ["@integration-team"],
|
|
187
|
+
tags: ["integration", "sync"]
|
|
188
|
+
},
|
|
189
|
+
payload: SyncCompletedPayload
|
|
190
|
+
});
|
|
191
|
+
const SyncFailedPayload = defineSchemaModel({
|
|
192
|
+
name: "SyncFailedPayload",
|
|
193
|
+
description: "Payload when a sync run fails",
|
|
194
|
+
fields: {
|
|
195
|
+
syncRunId: {
|
|
196
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
197
|
+
isOptional: false
|
|
198
|
+
},
|
|
199
|
+
syncConfigId: {
|
|
200
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
201
|
+
isOptional: false
|
|
202
|
+
},
|
|
203
|
+
error: {
|
|
204
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
205
|
+
isOptional: false
|
|
206
|
+
},
|
|
207
|
+
failedAt: {
|
|
208
|
+
type: ScalarTypeEnum.DateTime(),
|
|
209
|
+
isOptional: false
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
const SyncFailedEvent = defineEvent({
|
|
214
|
+
meta: {
|
|
215
|
+
key: "integration.sync.failed",
|
|
216
|
+
version: "1.0.0",
|
|
217
|
+
description: "Fired when a sync run fails",
|
|
218
|
+
stability: "experimental",
|
|
219
|
+
owners: ["@integration-team"],
|
|
220
|
+
tags: ["integration", "sync"]
|
|
221
|
+
},
|
|
222
|
+
payload: SyncFailedPayload
|
|
223
|
+
});
|
|
224
|
+
const RecordSyncedPayload = defineSchemaModel({
|
|
225
|
+
name: "RecordSyncedPayload",
|
|
226
|
+
description: "Payload when a single record is synced",
|
|
227
|
+
fields: {
|
|
228
|
+
syncRunId: {
|
|
229
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
230
|
+
isOptional: false
|
|
231
|
+
},
|
|
232
|
+
recordId: {
|
|
233
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
234
|
+
isOptional: false
|
|
235
|
+
},
|
|
236
|
+
sourceId: {
|
|
237
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
238
|
+
isOptional: false
|
|
239
|
+
},
|
|
240
|
+
targetId: {
|
|
241
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
242
|
+
isOptional: false
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
const RecordSyncedEvent = defineEvent({
|
|
247
|
+
meta: {
|
|
248
|
+
key: "integration.record.synced",
|
|
249
|
+
version: "1.0.0",
|
|
250
|
+
description: "Fired when a single record is synced",
|
|
251
|
+
stability: "experimental",
|
|
252
|
+
owners: ["@integration-team"],
|
|
253
|
+
tags: ["integration", "sync"]
|
|
254
|
+
},
|
|
255
|
+
payload: RecordSyncedPayload
|
|
256
|
+
});
|
|
257
|
+
const FieldMappingAddedPayload = defineSchemaModel({
|
|
258
|
+
name: "FieldMappingAddedPayload",
|
|
259
|
+
description: "Payload when a field mapping is added to a sync config",
|
|
260
|
+
fields: {
|
|
261
|
+
syncConfigId: {
|
|
262
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
263
|
+
isOptional: false
|
|
264
|
+
},
|
|
265
|
+
sourceField: {
|
|
266
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
267
|
+
isOptional: false
|
|
268
|
+
},
|
|
269
|
+
targetField: {
|
|
270
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
271
|
+
isOptional: false
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
const FieldMappingAddedEvent = defineEvent({
|
|
276
|
+
meta: {
|
|
277
|
+
key: "integration.fieldMapping.added",
|
|
278
|
+
version: "1.0.0",
|
|
279
|
+
description: "Fired when a field mapping is added to a sync config",
|
|
280
|
+
stability: "experimental",
|
|
281
|
+
owners: ["@integration-team"],
|
|
282
|
+
tags: ["integration", "sync"]
|
|
283
|
+
},
|
|
284
|
+
payload: FieldMappingAddedPayload
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
//#endregion
|
|
288
|
+
export { ConnectionCreatedEvent, ConnectionStatusChangedEvent, FieldMappingAddedEvent, IntegrationCreatedEvent, RecordSyncedEvent, SyncCompletedEvent, SyncConfigCreatedEvent, SyncFailedEvent, SyncStartedEvent };
|
|
289
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","names":[],"sources":["../src/events.ts"],"sourcesContent":["import { defineEvent } from '@contractspec/lib.contracts';\nimport { ScalarTypeEnum, defineSchemaModel } from '@contractspec/lib.schema';\n\n// Integration events\nconst IntegrationCreatedPayload = defineSchemaModel({\n name: 'IntegrationCreatedPayload',\n description: 'Payload when an integration is created',\n fields: {\n integrationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n type: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nexport const IntegrationCreatedEvent = defineEvent({\n meta: {\n key: 'integration.created',\n version: '1.0.0',\n description: 'Fired when a new integration is created',\n stability: 'experimental',\n owners: ['@integration-team'],\n tags: ['integration'],\n },\n payload: IntegrationCreatedPayload,\n});\n\n// Connection events\nconst ConnectionCreatedPayload = defineSchemaModel({\n name: 'ConnectionCreatedPayload',\n description: 'Payload when a connection is established',\n fields: {\n connectionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n integrationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nexport const ConnectionCreatedEvent = defineEvent({\n meta: {\n key: 'integration.connection.created',\n version: '1.0.0',\n description: 'Fired when a new connection is established',\n stability: 'experimental',\n owners: ['@integration-team'],\n tags: ['integration', 'connection'],\n },\n payload: ConnectionCreatedPayload,\n});\n\nconst ConnectionStatusChangedPayload = defineSchemaModel({\n name: 'ConnectionStatusChangedPayload',\n description: 'Payload when a connection status changes',\n fields: {\n connectionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n previousStatus: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n newStatus: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n changedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nexport const ConnectionStatusChangedEvent = defineEvent({\n meta: {\n key: 'integration.connection.statusChanged',\n version: '1.0.0',\n description: 'Fired when a connection status changes',\n stability: 'experimental',\n owners: ['@integration-team'],\n tags: ['integration', 'connection'],\n },\n payload: ConnectionStatusChangedPayload,\n});\n\n// Sync config events\nconst SyncConfigCreatedPayload = defineSchemaModel({\n name: 'SyncConfigCreatedPayload',\n description: 'Payload when a sync configuration is created',\n fields: {\n syncConfigId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n connectionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nexport const SyncConfigCreatedEvent = defineEvent({\n meta: {\n key: 'integration.syncConfig.created',\n version: '1.0.0',\n description: 'Fired when a sync configuration is created',\n stability: 'experimental',\n owners: ['@integration-team'],\n tags: ['integration', 'sync'],\n },\n payload: SyncConfigCreatedPayload,\n});\n\n// Sync run events\nconst SyncStartedPayload = defineSchemaModel({\n name: 'SyncStartedPayload',\n description: 'Payload when a sync run starts',\n fields: {\n syncRunId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n syncConfigId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n startedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nexport const SyncStartedEvent = defineEvent({\n meta: {\n key: 'integration.sync.started',\n version: '1.0.0',\n description: 'Fired when a sync run starts',\n stability: 'experimental',\n owners: ['@integration-team'],\n tags: ['integration', 'sync'],\n },\n payload: SyncStartedPayload,\n});\n\nconst SyncCompletedPayload = defineSchemaModel({\n name: 'SyncCompletedPayload',\n description: 'Payload when a sync run completes successfully',\n fields: {\n syncRunId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n syncConfigId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n recordsProcessed: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: false,\n },\n completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nexport const SyncCompletedEvent = defineEvent({\n meta: {\n key: 'integration.sync.completed',\n version: '1.0.0',\n description: 'Fired when a sync run completes successfully',\n stability: 'experimental',\n owners: ['@integration-team'],\n tags: ['integration', 'sync'],\n },\n payload: SyncCompletedPayload,\n});\n\nconst SyncFailedPayload = defineSchemaModel({\n name: 'SyncFailedPayload',\n description: 'Payload when a sync run fails',\n fields: {\n syncRunId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n syncConfigId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n error: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n failedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nexport const SyncFailedEvent = defineEvent({\n meta: {\n key: 'integration.sync.failed',\n version: '1.0.0',\n description: 'Fired when a sync run fails',\n stability: 'experimental',\n owners: ['@integration-team'],\n tags: ['integration', 'sync'],\n },\n payload: SyncFailedPayload,\n});\n\nconst RecordSyncedPayload = defineSchemaModel({\n name: 'RecordSyncedPayload',\n description: 'Payload when a single record is synced',\n fields: {\n syncRunId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n recordId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n sourceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n targetId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const RecordSyncedEvent = defineEvent({\n meta: {\n key: 'integration.record.synced',\n version: '1.0.0',\n description: 'Fired when a single record is synced',\n stability: 'experimental',\n owners: ['@integration-team'],\n tags: ['integration', 'sync'],\n },\n payload: RecordSyncedPayload,\n});\n\nconst FieldMappingAddedPayload = defineSchemaModel({\n name: 'FieldMappingAddedPayload',\n description: 'Payload when a field mapping is added to a sync config',\n fields: {\n syncConfigId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n sourceField: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n targetField: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const FieldMappingAddedEvent = defineEvent({\n meta: {\n key: 'integration.fieldMapping.added',\n version: '1.0.0',\n description: 'Fired when a field mapping is added to a sync config',\n stability: 'experimental',\n owners: ['@integration-team'],\n tags: ['integration', 'sync'],\n },\n payload: FieldMappingAddedPayload,\n});\n"],"mappings":";;;;AAIA,MAAM,4BAA4B,kBAAkB;CAClD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,eAAe;GACb,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,MAAM;GAAE,MAAM,eA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AY;GAAO;EAC3E;CACF,CAAC;AAEF,MAAa,yBAAyB,YAAY;CAChD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aAAa;EACb,WAAW;EACX,QAAQ,CAAC,oBAAoB;EAC7B,MAAM,CAAC,eAAe,OAAO;EAC9B;CACD,SAAS;CACV,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"example.d.ts","names":[],"sources":["../src/example.ts"],"sourcesContent":[],"mappings":";;;cAEM,SAoCJ,4BAAA,CApCW"}
|
package/dist/example.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { defineExample } from "@contractspec/lib.contracts";
|
|
2
|
+
|
|
3
|
+
//#region src/example.ts
|
|
4
|
+
const example = defineExample({
|
|
5
|
+
meta: {
|
|
6
|
+
key: "integration-hub",
|
|
7
|
+
version: "1.0.0",
|
|
8
|
+
title: "Integration Hub",
|
|
9
|
+
description: "Provider-agnostic integration center with connectors, connections, field mappings, and sync logs.",
|
|
10
|
+
kind: "template",
|
|
11
|
+
visibility: "public",
|
|
12
|
+
stability: "experimental",
|
|
13
|
+
owners: ["@platform.core"],
|
|
14
|
+
tags: [
|
|
15
|
+
"integrations",
|
|
16
|
+
"sync",
|
|
17
|
+
"etl",
|
|
18
|
+
"connectors"
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
docs: {
|
|
22
|
+
rootDocId: "docs.examples.integration-hub",
|
|
23
|
+
goalDocId: "docs.examples.integration-hub.goal",
|
|
24
|
+
usageDocId: "docs.examples.integration-hub.usage",
|
|
25
|
+
constraintsDocId: "docs.examples.integration-hub.constraints"
|
|
26
|
+
},
|
|
27
|
+
entrypoints: {
|
|
28
|
+
packageName: "@contractspec/example.integration-hub",
|
|
29
|
+
feature: "./feature",
|
|
30
|
+
contracts: "./contracts",
|
|
31
|
+
presentations: "./presentations",
|
|
32
|
+
handlers: "./handlers",
|
|
33
|
+
docs: "./docs"
|
|
34
|
+
},
|
|
35
|
+
surfaces: {
|
|
36
|
+
templates: true,
|
|
37
|
+
sandbox: {
|
|
38
|
+
enabled: true,
|
|
39
|
+
modes: [
|
|
40
|
+
"playground",
|
|
41
|
+
"specs",
|
|
42
|
+
"builder",
|
|
43
|
+
"markdown",
|
|
44
|
+
"evolution"
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
studio: {
|
|
48
|
+
enabled: true,
|
|
49
|
+
installable: true
|
|
50
|
+
},
|
|
51
|
+
mcp: { enabled: true }
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
var example_default = example;
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
export { example_default as default };
|
|
58
|
+
//# sourceMappingURL=example.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"example.js","names":[],"sources":["../src/example.ts"],"sourcesContent":["import { defineExample } from '@contractspec/lib.contracts';\n\nconst example = defineExample({\n meta: {\n key: 'integration-hub',\n version: '1.0.0',\n title: 'Integration Hub',\n description:\n 'Provider-agnostic integration center with connectors, connections, field mappings, and sync logs.',\n kind: 'template',\n visibility: 'public',\n stability: 'experimental',\n owners: ['@platform.core'],\n tags: ['integrations', 'sync', 'etl', 'connectors'],\n },\n docs: {\n rootDocId: 'docs.examples.integration-hub',\n goalDocId: 'docs.examples.integration-hub.goal',\n usageDocId: 'docs.examples.integration-hub.usage',\n constraintsDocId: 'docs.examples.integration-hub.constraints',\n },\n entrypoints: {\n packageName: '@contractspec/example.integration-hub',\n feature: './feature',\n contracts: './contracts',\n presentations: './presentations',\n handlers: './handlers',\n docs: './docs',\n },\n surfaces: {\n templates: true,\n sandbox: {\n enabled: true,\n modes: ['playground', 'specs', 'builder', 'markdown', 'evolution'],\n },\n studio: { enabled: true, installable: true },\n mcp: { enabled: true },\n },\n});\n\nexport default example;\n"],"mappings":";;;AAEA,MAAM,UAAU,cAAc;CAC5B,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aACE;EACF,MAAM;EACN,YAAY;EACZ,WAAW;EACX,QAAQ,CAAC,iBAAiB;EAC1B,MAAM;GAAC;GAAgB;GAAQ;GAAO;GAAa;EACpD;CACD,MAAM;EACJ,WAAW;EACX,WAAW;EACX,YAAY;EACZ,kBAAkB;EACnB;CACD,aAAa;EACX,aAAa;EACb,SAAS;EACT,WAAW;EACX,eAAe;EACf,UAAU;EACV,MAAM;EACP;CACD,UAAU;EACR,WAAW;EACX,SAAS;GACP,SAAS;GACT,OAAO;IAAC;IAAc;IAAS;IAAW;IAAY;IAAY;GACnE;EACD,QAAQ;GAAE,SAAS;GAAM,aAAa;GAAM;EAC5C,KAAK,EAAE,SAAS,MAAM;EACvB;CACF,CAAC;AAEF,sBAAe"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { ConfigureSyncInput, ConnectServiceInput, Connection, CreateIntegrationInput, FieldMapping, Integration, IntegrationHandlers, ListConnectionsInput, ListConnectionsOutput, ListIntegrationsInput, ListIntegrationsOutput, ListSyncConfigsInput, ListSyncConfigsOutput, MapFieldsInput, SyncConfig, createIntegrationHandlers } from "./integration.handlers.js";
|
|
2
|
+
export { ConfigureSyncInput, ConnectServiceInput, Connection, CreateIntegrationInput, FieldMapping, Integration, IntegrationHandlers, ListConnectionsInput, ListConnectionsOutput, ListIntegrationsInput, ListIntegrationsOutput, ListSyncConfigsInput, ListSyncConfigsOutput, MapFieldsInput, SyncConfig, createIntegrationHandlers };
|