@contractspec/example.integration-hub 1.57.0 → 1.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/connection/connection.enum.js +12 -0
- package/dist/browser/connection/connection.operation.js +101 -0
- package/dist/browser/connection/connection.presentation.js +99 -0
- package/dist/browser/connection/connection.schema.js +48 -0
- package/dist/browser/connection/index.js +104 -0
- package/dist/browser/docs/index.js +104 -0
- package/dist/browser/docs/integration-hub.docblock.js +104 -0
- package/dist/browser/events.js +211 -0
- package/dist/browser/example.js +42 -0
- package/dist/browser/handlers/index.js +246 -0
- package/dist/browser/handlers/integration.handlers.js +246 -0
- package/dist/browser/index.js +1595 -0
- package/dist/browser/integration/index.js +92 -0
- package/dist/browser/integration/integration.enum.js +12 -0
- package/dist/browser/integration/integration.operations.js +89 -0
- package/dist/browser/integration/integration.presentation.js +117 -0
- package/dist/browser/integration/integration.schema.js +42 -0
- package/dist/browser/integration-hub.capability.js +40 -0
- package/dist/browser/integration-hub.feature.js +114 -0
- package/dist/browser/seeders/index.js +60 -0
- package/dist/browser/sync/index.js +332 -0
- package/dist/browser/sync/sync.enum.js +26 -0
- package/dist/browser/sync/sync.operations.js +321 -0
- package/dist/browser/sync/sync.presentation.js +298 -0
- package/dist/browser/sync/sync.schema.js +154 -0
- package/dist/browser/sync-engine/index.js +186 -0
- package/dist/browser/tests/operations.test-spec.js +85 -0
- package/dist/browser/ui/IntegrationDashboard.js +369 -0
- package/dist/browser/ui/hooks/index.js +57 -0
- package/dist/browser/ui/hooks/useIntegrationData.js +54 -0
- package/dist/browser/ui/index.js +644 -0
- package/dist/browser/ui/renderers/index.js +273 -0
- package/dist/browser/ui/renderers/integration.markdown.js +273 -0
- package/dist/connection/connection.enum.d.ts +1 -6
- package/dist/connection/connection.enum.d.ts.map +1 -1
- package/dist/connection/connection.enum.js +11 -15
- package/dist/connection/connection.operation.d.ts +78 -84
- package/dist/connection/connection.operation.d.ts.map +1 -1
- package/dist/connection/connection.operation.js +99 -60
- package/dist/connection/connection.presentation.d.ts +2 -7
- package/dist/connection/connection.presentation.d.ts.map +1 -1
- package/dist/connection/connection.presentation.js +96 -56
- package/dist/connection/connection.schema.d.ts +54 -59
- package/dist/connection/connection.schema.d.ts.map +1 -1
- package/dist/connection/connection.schema.js +46 -73
- package/dist/connection/index.d.ts +7 -4
- package/dist/connection/index.d.ts.map +1 -0
- package/dist/connection/index.js +104 -4
- package/dist/docs/index.d.ts +2 -1
- package/dist/docs/index.d.ts.map +1 -0
- package/dist/docs/index.js +105 -1
- package/dist/docs/integration-hub.docblock.d.ts +2 -1
- package/dist/docs/integration-hub.docblock.d.ts.map +1 -0
- package/dist/docs/integration-hub.docblock.js +45 -56
- package/dist/events.d.ts +137 -143
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +210 -287
- package/dist/example.d.ts +2 -6
- package/dist/example.d.ts.map +1 -1
- package/dist/example.js +41 -55
- package/dist/handlers/index.d.ts +2 -2
- package/dist/handlers/index.d.ts.map +1 -0
- package/dist/handlers/index.js +247 -3
- package/dist/handlers/integration.handlers.d.ts +114 -113
- package/dist/handlers/integration.handlers.d.ts.map +1 -1
- package/dist/handlers/integration.handlers.js +232 -267
- package/dist/index.d.ts +12 -19
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1596 -20
- package/dist/integration/index.d.ts +7 -4
- package/dist/integration/index.d.ts.map +1 -0
- package/dist/integration/index.js +92 -4
- package/dist/integration/integration.enum.d.ts +1 -6
- package/dist/integration/integration.enum.d.ts.map +1 -1
- package/dist/integration/integration.enum.js +11 -15
- package/dist/integration/integration.operations.d.ts +74 -80
- package/dist/integration/integration.operations.d.ts.map +1 -1
- package/dist/integration/integration.operations.js +87 -54
- package/dist/integration/integration.presentation.d.ts +3 -8
- package/dist/integration/integration.presentation.d.ts.map +1 -1
- package/dist/integration/integration.presentation.js +114 -73
- package/dist/integration/integration.schema.d.ts +54 -59
- package/dist/integration/integration.schema.d.ts.map +1 -1
- package/dist/integration/integration.schema.js +40 -73
- package/dist/integration-hub.capability.d.ts +3 -8
- package/dist/integration-hub.capability.d.ts.map +1 -1
- package/dist/integration-hub.capability.js +41 -38
- package/dist/integration-hub.feature.d.ts +1 -6
- package/dist/integration-hub.feature.d.ts.map +1 -1
- package/dist/integration-hub.feature.js +113 -242
- package/dist/node/connection/connection.enum.js +12 -0
- package/dist/node/connection/connection.operation.js +101 -0
- package/dist/node/connection/connection.presentation.js +99 -0
- package/dist/node/connection/connection.schema.js +48 -0
- package/dist/node/connection/index.js +104 -0
- package/dist/node/docs/index.js +104 -0
- package/dist/node/docs/integration-hub.docblock.js +104 -0
- package/dist/node/events.js +211 -0
- package/dist/node/example.js +42 -0
- package/dist/node/handlers/index.js +246 -0
- package/dist/node/handlers/integration.handlers.js +246 -0
- package/dist/node/index.js +1595 -0
- package/dist/node/integration/index.js +92 -0
- package/dist/node/integration/integration.enum.js +12 -0
- package/dist/node/integration/integration.operations.js +89 -0
- package/dist/node/integration/integration.presentation.js +117 -0
- package/dist/node/integration/integration.schema.js +42 -0
- package/dist/node/integration-hub.capability.js +40 -0
- package/dist/node/integration-hub.feature.js +114 -0
- package/dist/node/seeders/index.js +60 -0
- package/dist/node/sync/index.js +332 -0
- package/dist/node/sync/sync.enum.js +26 -0
- package/dist/node/sync/sync.operations.js +321 -0
- package/dist/node/sync/sync.presentation.js +298 -0
- package/dist/node/sync/sync.schema.js +154 -0
- package/dist/node/sync-engine/index.js +186 -0
- package/dist/node/tests/operations.test-spec.js +85 -0
- package/dist/node/ui/IntegrationDashboard.js +369 -0
- package/dist/node/ui/hooks/index.js +57 -0
- package/dist/node/ui/hooks/useIntegrationData.js +54 -0
- package/dist/node/ui/index.js +644 -0
- package/dist/node/ui/renderers/index.js +273 -0
- package/dist/node/ui/renderers/integration.markdown.js +273 -0
- package/dist/seeders/index.d.ts +4 -8
- package/dist/seeders/index.d.ts.map +1 -1
- package/dist/seeders/index.js +54 -52
- package/dist/sync/index.d.ts +7 -4
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/sync/index.js +332 -4
- package/dist/sync/sync.enum.d.ts +3 -8
- package/dist/sync/sync.enum.d.ts.map +1 -1
- package/dist/sync/sync.enum.js +23 -31
- package/dist/sync/sync.operations.d.ts +413 -419
- package/dist/sync/sync.operations.d.ts.map +1 -1
- package/dist/sync/sync.operations.js +316 -197
- package/dist/sync/sync.presentation.d.ts +6 -11
- package/dist/sync/sync.presentation.d.ts.map +1 -1
- package/dist/sync/sync.presentation.js +291 -160
- package/dist/sync/sync.schema.d.ts +317 -322
- package/dist/sync/sync.schema.d.ts.map +1 -1
- package/dist/sync/sync.schema.js +146 -295
- package/dist/sync-engine/index.d.ts +88 -91
- package/dist/sync-engine/index.d.ts.map +1 -1
- package/dist/sync-engine/index.js +181 -142
- package/dist/tests/operations.test-spec.d.ts +3 -8
- package/dist/tests/operations.test-spec.d.ts.map +1 -1
- package/dist/tests/operations.test-spec.js +82 -90
- package/dist/ui/IntegrationDashboard.d.ts +1 -6
- package/dist/ui/IntegrationDashboard.d.ts.map +1 -1
- package/dist/ui/IntegrationDashboard.js +365 -261
- package/dist/ui/hooks/index.d.ts +2 -2
- package/dist/ui/hooks/index.d.ts.map +1 -0
- package/dist/ui/hooks/index.js +57 -4
- package/dist/ui/hooks/useIntegrationData.d.ts +16 -20
- package/dist/ui/hooks/useIntegrationData.d.ts.map +1 -1
- package/dist/ui/hooks/useIntegrationData.js +51 -55
- package/dist/ui/index.d.ts +7 -6
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +644 -5
- package/dist/ui/renderers/index.d.ts +2 -2
- package/dist/ui/renderers/index.d.ts.map +1 -0
- package/dist/ui/renderers/index.js +274 -3
- package/dist/ui/renderers/integration.markdown.d.ts +13 -14
- package/dist/ui/renderers/integration.markdown.d.ts.map +1 -1
- package/dist/ui/renderers/integration.markdown.js +268 -264
- package/package.json +360 -71
- package/dist/connection/connection.enum.js.map +0 -1
- package/dist/connection/connection.operation.js.map +0 -1
- package/dist/connection/connection.presentation.js.map +0 -1
- package/dist/connection/connection.schema.js.map +0 -1
- package/dist/docs/integration-hub.docblock.js.map +0 -1
- package/dist/events.js.map +0 -1
- package/dist/example.js.map +0 -1
- package/dist/handlers/integration.handlers.js.map +0 -1
- package/dist/integration/integration.enum.js.map +0 -1
- package/dist/integration/integration.operations.js.map +0 -1
- package/dist/integration/integration.presentation.js.map +0 -1
- package/dist/integration/integration.schema.js.map +0 -1
- package/dist/integration-hub.capability.js.map +0 -1
- package/dist/integration-hub.feature.js.map +0 -1
- package/dist/seeders/index.js.map +0 -1
- package/dist/sync/sync.enum.js.map +0 -1
- package/dist/sync/sync.operations.js.map +0 -1
- package/dist/sync/sync.presentation.js.map +0 -1
- package/dist/sync/sync.schema.js.map +0 -1
- package/dist/sync-engine/index.js.map +0 -1
- package/dist/tests/operations.test-spec.js.map +0 -1
- package/dist/ui/IntegrationDashboard.js.map +0 -1
- package/dist/ui/hooks/useIntegrationData.js.map +0 -1
- package/dist/ui/renderers/integration.markdown.js.map +0 -1
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export {
|
|
1
|
+
/**
|
|
2
|
+
* Integration domain - Integration management.
|
|
3
|
+
*/
|
|
4
|
+
export { IntegrationStatusEnum } from './integration.enum';
|
|
5
|
+
export { IntegrationModel, CreateIntegrationInputModel, } from './integration.schema';
|
|
6
|
+
export { CreateIntegrationContract } from './integration.operations';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/integration/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EACL,gBAAgB,EAChB,2BAA2B,GAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -1,5 +1,93 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
1
|
+
// @bun
|
|
2
|
+
// src/integration/integration.enum.ts
|
|
3
|
+
import { defineEnum } from "@contractspec/lib.schema";
|
|
4
|
+
var IntegrationStatusEnum = defineEnum("IntegrationStatus", [
|
|
5
|
+
"DRAFT",
|
|
6
|
+
"ACTIVE",
|
|
7
|
+
"PAUSED",
|
|
8
|
+
"ERROR",
|
|
9
|
+
"ARCHIVED"
|
|
10
|
+
]);
|
|
4
11
|
|
|
5
|
-
|
|
12
|
+
// src/integration/integration.schema.ts
|
|
13
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
14
|
+
var IntegrationModel = defineSchemaModel({
|
|
15
|
+
name: "IntegrationModel",
|
|
16
|
+
fields: {
|
|
17
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
18
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
19
|
+
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
20
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
21
|
+
provider: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
22
|
+
status: { type: IntegrationStatusEnum, isOptional: false },
|
|
23
|
+
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
var CreateIntegrationInputModel = defineSchemaModel({
|
|
27
|
+
name: "CreateIntegrationInput",
|
|
28
|
+
fields: {
|
|
29
|
+
name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
30
|
+
slug: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
31
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
32
|
+
provider: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
33
|
+
config: { type: ScalarTypeEnum.JSON(), isOptional: true },
|
|
34
|
+
featureFlagKey: {
|
|
35
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
36
|
+
isOptional: true
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// src/integration/integration.operations.ts
|
|
42
|
+
import { defineCommand } from "@contractspec/lib.contracts/operations";
|
|
43
|
+
var CreateIntegrationContract = defineCommand({
|
|
44
|
+
meta: {
|
|
45
|
+
key: "integration.create",
|
|
46
|
+
version: "1.0.0",
|
|
47
|
+
stability: "stable",
|
|
48
|
+
owners: ["@example.integration-hub"],
|
|
49
|
+
tags: ["integration", "create"],
|
|
50
|
+
description: "Create a new integration.",
|
|
51
|
+
goal: "Allow users to set up integrations with external systems.",
|
|
52
|
+
context: "Integration setup."
|
|
53
|
+
},
|
|
54
|
+
io: { input: CreateIntegrationInputModel, output: IntegrationModel },
|
|
55
|
+
policy: { auth: "user" },
|
|
56
|
+
sideEffects: {
|
|
57
|
+
emits: [
|
|
58
|
+
{
|
|
59
|
+
key: "integration.created",
|
|
60
|
+
version: "1.0.0",
|
|
61
|
+
when: "Integration created",
|
|
62
|
+
payload: IntegrationModel
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
audit: ["integration.created"]
|
|
66
|
+
},
|
|
67
|
+
acceptance: {
|
|
68
|
+
scenarios: [
|
|
69
|
+
{
|
|
70
|
+
key: "create-integration-happy-path",
|
|
71
|
+
given: ["User is admin"],
|
|
72
|
+
when: ["User defines new integration type"],
|
|
73
|
+
then: [
|
|
74
|
+
"Integration definition is created",
|
|
75
|
+
"IntegrationCreated event is emitted"
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
examples: [
|
|
80
|
+
{
|
|
81
|
+
key: "create-slack",
|
|
82
|
+
input: { name: "Slack", category: "communication", authType: "oauth2" },
|
|
83
|
+
output: { id: "slack", status: "active" }
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
export {
|
|
89
|
+
IntegrationStatusEnum,
|
|
90
|
+
IntegrationModel,
|
|
91
|
+
CreateIntegrationInputModel,
|
|
92
|
+
CreateIntegrationContract
|
|
93
|
+
};
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import * as _contractspec_lib_schema0 from "@contractspec/lib.schema";
|
|
2
|
-
|
|
3
|
-
//#region src/integration/integration.enum.d.ts
|
|
4
1
|
/**
|
|
5
2
|
* Integration status enum.
|
|
6
3
|
*/
|
|
7
|
-
declare const IntegrationStatusEnum:
|
|
8
|
-
//#endregion
|
|
9
|
-
export { IntegrationStatusEnum };
|
|
4
|
+
export declare const IntegrationStatusEnum: import("@contractspec/lib.schema").EnumType<[string, string, string, string, string]>;
|
|
10
5
|
//# sourceMappingURL=integration.enum.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration.enum.d.ts","
|
|
1
|
+
{"version":3,"file":"integration.enum.d.ts","sourceRoot":"","sources":["../../src/integration/integration.enum.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,qBAAqB,uFAMhC,CAAC"}
|
|
@@ -1,17 +1,13 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/integration/integration.enum.ts
|
|
1
3
|
import { defineEnum } from "@contractspec/lib.schema";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"DRAFT",
|
|
9
|
-
"ACTIVE",
|
|
10
|
-
"PAUSED",
|
|
11
|
-
"ERROR",
|
|
12
|
-
"ARCHIVED"
|
|
4
|
+
var IntegrationStatusEnum = defineEnum("IntegrationStatus", [
|
|
5
|
+
"DRAFT",
|
|
6
|
+
"ACTIVE",
|
|
7
|
+
"PAUSED",
|
|
8
|
+
"ERROR",
|
|
9
|
+
"ARCHIVED"
|
|
13
10
|
]);
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
//# sourceMappingURL=integration.enum.js.map
|
|
11
|
+
export {
|
|
12
|
+
IntegrationStatusEnum
|
|
13
|
+
};
|
|
@@ -1,99 +1,93 @@
|
|
|
1
|
-
import * as _contractspec_lib_contracts0 from "@contractspec/lib.contracts";
|
|
2
|
-
import * as _contractspec_lib_schema0 from "@contractspec/lib.schema";
|
|
3
|
-
|
|
4
|
-
//#region src/integration/integration.operations.d.ts
|
|
5
1
|
/**
|
|
6
2
|
* Create a new integration.
|
|
7
3
|
*/
|
|
8
|
-
declare const CreateIntegrationContract:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}>,
|
|
34
|
-
id: {
|
|
35
|
-
type: _contractspec_lib_schema0.FieldType<string, string>;
|
|
36
|
-
isOptional: false;
|
|
37
|
-
};
|
|
38
|
-
name: {
|
|
39
|
-
type: _contractspec_lib_schema0.FieldType<string, string>;
|
|
40
|
-
isOptional: false;
|
|
41
|
-
};
|
|
42
|
-
slug: {
|
|
43
|
-
type: _contractspec_lib_schema0.FieldType<string, string>;
|
|
44
|
-
isOptional: false;
|
|
45
|
-
};
|
|
46
|
-
description: {
|
|
47
|
-
type: _contractspec_lib_schema0.FieldType<string, string>;
|
|
48
|
-
isOptional: true;
|
|
49
|
-
};
|
|
50
|
-
provider: {
|
|
51
|
-
type: _contractspec_lib_schema0.FieldType<string, string>;
|
|
52
|
-
isOptional: false;
|
|
53
|
-
};
|
|
54
|
-
status: {
|
|
55
|
-
type: _contractspec_lib_schema0.EnumType<[string, string, string, string, string]>;
|
|
56
|
-
isOptional: false;
|
|
57
|
-
};
|
|
58
|
-
createdAt: {
|
|
59
|
-
type: _contractspec_lib_schema0.FieldType<Date, string>;
|
|
60
|
-
isOptional: false;
|
|
61
|
-
};
|
|
62
|
-
}>, {
|
|
63
|
-
key: string;
|
|
64
|
-
version: string;
|
|
65
|
-
when: string;
|
|
66
|
-
payload: _contractspec_lib_schema0.SchemaModel<{
|
|
4
|
+
export declare const CreateIntegrationContract: import("@contractspec/lib.contracts").OperationSpec<import("@contractspec/lib.schema").SchemaModel<{
|
|
5
|
+
name: {
|
|
6
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
7
|
+
isOptional: false;
|
|
8
|
+
};
|
|
9
|
+
slug: {
|
|
10
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
11
|
+
isOptional: false;
|
|
12
|
+
};
|
|
13
|
+
description: {
|
|
14
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
15
|
+
isOptional: true;
|
|
16
|
+
};
|
|
17
|
+
provider: {
|
|
18
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
19
|
+
isOptional: false;
|
|
20
|
+
};
|
|
21
|
+
config: {
|
|
22
|
+
type: import("@contractspec/lib.schema").FieldType<unknown, unknown>;
|
|
23
|
+
isOptional: true;
|
|
24
|
+
};
|
|
25
|
+
featureFlagKey: {
|
|
26
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
27
|
+
isOptional: true;
|
|
28
|
+
};
|
|
29
|
+
}>, import("@contractspec/lib.schema").SchemaModel<{
|
|
67
30
|
id: {
|
|
68
|
-
|
|
69
|
-
|
|
31
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
32
|
+
isOptional: false;
|
|
70
33
|
};
|
|
71
34
|
name: {
|
|
72
|
-
|
|
73
|
-
|
|
35
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
36
|
+
isOptional: false;
|
|
74
37
|
};
|
|
75
38
|
slug: {
|
|
76
|
-
|
|
77
|
-
|
|
39
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
40
|
+
isOptional: false;
|
|
78
41
|
};
|
|
79
42
|
description: {
|
|
80
|
-
|
|
81
|
-
|
|
43
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
44
|
+
isOptional: true;
|
|
82
45
|
};
|
|
83
46
|
provider: {
|
|
84
|
-
|
|
85
|
-
|
|
47
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
48
|
+
isOptional: false;
|
|
86
49
|
};
|
|
87
50
|
status: {
|
|
88
|
-
|
|
89
|
-
|
|
51
|
+
type: import("@contractspec/lib.schema").EnumType<[string, string, string, string, string]>;
|
|
52
|
+
isOptional: false;
|
|
90
53
|
};
|
|
91
54
|
createdAt: {
|
|
92
|
-
|
|
93
|
-
|
|
55
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
56
|
+
isOptional: false;
|
|
94
57
|
};
|
|
95
|
-
|
|
58
|
+
}>, {
|
|
59
|
+
key: string;
|
|
60
|
+
version: string;
|
|
61
|
+
when: string;
|
|
62
|
+
payload: import("@contractspec/lib.schema").SchemaModel<{
|
|
63
|
+
id: {
|
|
64
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
65
|
+
isOptional: false;
|
|
66
|
+
};
|
|
67
|
+
name: {
|
|
68
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
69
|
+
isOptional: false;
|
|
70
|
+
};
|
|
71
|
+
slug: {
|
|
72
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
73
|
+
isOptional: false;
|
|
74
|
+
};
|
|
75
|
+
description: {
|
|
76
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
77
|
+
isOptional: true;
|
|
78
|
+
};
|
|
79
|
+
provider: {
|
|
80
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
81
|
+
isOptional: false;
|
|
82
|
+
};
|
|
83
|
+
status: {
|
|
84
|
+
type: import("@contractspec/lib.schema").EnumType<[string, string, string, string, string]>;
|
|
85
|
+
isOptional: false;
|
|
86
|
+
};
|
|
87
|
+
createdAt: {
|
|
88
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
89
|
+
isOptional: false;
|
|
90
|
+
};
|
|
91
|
+
}>;
|
|
96
92
|
}[]>;
|
|
97
|
-
//#endregion
|
|
98
|
-
export { CreateIntegrationContract };
|
|
99
93
|
//# sourceMappingURL=integration.operations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration.operations.d.ts","
|
|
1
|
+
{"version":3,"file":"integration.operations.d.ts","sourceRoot":"","sources":["../../src/integration/integration.operations.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA4CpC,CAAC"}
|
|
@@ -1,57 +1,90 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// @bun
|
|
2
|
+
// src/integration/integration.enum.ts
|
|
3
|
+
import { defineEnum } from "@contractspec/lib.schema";
|
|
4
|
+
var IntegrationStatusEnum = defineEnum("IntegrationStatus", [
|
|
5
|
+
"DRAFT",
|
|
6
|
+
"ACTIVE",
|
|
7
|
+
"PAUSED",
|
|
8
|
+
"ERROR",
|
|
9
|
+
"ARCHIVED"
|
|
10
|
+
]);
|
|
3
11
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
audit: ["integration.created"]
|
|
32
|
-
},
|
|
33
|
-
acceptance: {
|
|
34
|
-
scenarios: [{
|
|
35
|
-
key: "create-integration-happy-path",
|
|
36
|
-
given: ["User is admin"],
|
|
37
|
-
when: ["User defines new integration type"],
|
|
38
|
-
then: ["Integration definition is created", "IntegrationCreated event is emitted"]
|
|
39
|
-
}],
|
|
40
|
-
examples: [{
|
|
41
|
-
key: "create-slack",
|
|
42
|
-
input: {
|
|
43
|
-
name: "Slack",
|
|
44
|
-
category: "communication",
|
|
45
|
-
authType: "oauth2"
|
|
46
|
-
},
|
|
47
|
-
output: {
|
|
48
|
-
id: "slack",
|
|
49
|
-
status: "active"
|
|
50
|
-
}
|
|
51
|
-
}]
|
|
52
|
-
}
|
|
12
|
+
// src/integration/integration.schema.ts
|
|
13
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
14
|
+
var IntegrationModel = defineSchemaModel({
|
|
15
|
+
name: "IntegrationModel",
|
|
16
|
+
fields: {
|
|
17
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
18
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
19
|
+
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
20
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
21
|
+
provider: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
22
|
+
status: { type: IntegrationStatusEnum, isOptional: false },
|
|
23
|
+
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
var CreateIntegrationInputModel = defineSchemaModel({
|
|
27
|
+
name: "CreateIntegrationInput",
|
|
28
|
+
fields: {
|
|
29
|
+
name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
30
|
+
slug: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
31
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
32
|
+
provider: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
33
|
+
config: { type: ScalarTypeEnum.JSON(), isOptional: true },
|
|
34
|
+
featureFlagKey: {
|
|
35
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
36
|
+
isOptional: true
|
|
37
|
+
}
|
|
38
|
+
}
|
|
53
39
|
});
|
|
54
40
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
41
|
+
// src/integration/integration.operations.ts
|
|
42
|
+
import { defineCommand } from "@contractspec/lib.contracts/operations";
|
|
43
|
+
var CreateIntegrationContract = defineCommand({
|
|
44
|
+
meta: {
|
|
45
|
+
key: "integration.create",
|
|
46
|
+
version: "1.0.0",
|
|
47
|
+
stability: "stable",
|
|
48
|
+
owners: ["@example.integration-hub"],
|
|
49
|
+
tags: ["integration", "create"],
|
|
50
|
+
description: "Create a new integration.",
|
|
51
|
+
goal: "Allow users to set up integrations with external systems.",
|
|
52
|
+
context: "Integration setup."
|
|
53
|
+
},
|
|
54
|
+
io: { input: CreateIntegrationInputModel, output: IntegrationModel },
|
|
55
|
+
policy: { auth: "user" },
|
|
56
|
+
sideEffects: {
|
|
57
|
+
emits: [
|
|
58
|
+
{
|
|
59
|
+
key: "integration.created",
|
|
60
|
+
version: "1.0.0",
|
|
61
|
+
when: "Integration created",
|
|
62
|
+
payload: IntegrationModel
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
audit: ["integration.created"]
|
|
66
|
+
},
|
|
67
|
+
acceptance: {
|
|
68
|
+
scenarios: [
|
|
69
|
+
{
|
|
70
|
+
key: "create-integration-happy-path",
|
|
71
|
+
given: ["User is admin"],
|
|
72
|
+
when: ["User defines new integration type"],
|
|
73
|
+
then: [
|
|
74
|
+
"Integration definition is created",
|
|
75
|
+
"IntegrationCreated event is emitted"
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
examples: [
|
|
80
|
+
{
|
|
81
|
+
key: "create-slack",
|
|
82
|
+
input: { name: "Slack", category: "communication", authType: "oauth2" },
|
|
83
|
+
output: { id: "slack", status: "active" }
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
export {
|
|
89
|
+
CreateIntegrationContract
|
|
90
|
+
};
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
declare const IntegrationListPresentation: _contractspec_lib_contracts0.PresentationSpec;
|
|
5
|
-
declare const IntegrationDetailPresentation: _contractspec_lib_contracts0.PresentationSpec;
|
|
6
|
-
declare const IntegrationHealthPresentation: _contractspec_lib_contracts0.PresentationSpec;
|
|
7
|
-
//#endregion
|
|
8
|
-
export { IntegrationDetailPresentation, IntegrationHealthPresentation, IntegrationListPresentation };
|
|
1
|
+
export declare const IntegrationListPresentation: import("@contractspec/lib.contracts").PresentationSpec;
|
|
2
|
+
export declare const IntegrationDetailPresentation: import("@contractspec/lib.contracts").PresentationSpec;
|
|
3
|
+
export declare const IntegrationHealthPresentation: import("@contractspec/lib.contracts").PresentationSpec;
|
|
9
4
|
//# sourceMappingURL=integration.presentation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration.presentation.d.ts","
|
|
1
|
+
{"version":3,"file":"integration.presentation.d.ts","sourceRoot":"","sources":["../../src/integration/integration.presentation.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,2BAA2B,wDAuBtC,CAAC;AAEH,eAAO,MAAM,6BAA6B,wDAuBxC,CAAC;AAEH,eAAO,MAAM,6BAA6B,wDAsBxC,CAAC"}
|