@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.
Files changed (190) hide show
  1. package/dist/browser/connection/connection.enum.js +12 -0
  2. package/dist/browser/connection/connection.operation.js +101 -0
  3. package/dist/browser/connection/connection.presentation.js +99 -0
  4. package/dist/browser/connection/connection.schema.js +48 -0
  5. package/dist/browser/connection/index.js +104 -0
  6. package/dist/browser/docs/index.js +104 -0
  7. package/dist/browser/docs/integration-hub.docblock.js +104 -0
  8. package/dist/browser/events.js +211 -0
  9. package/dist/browser/example.js +42 -0
  10. package/dist/browser/handlers/index.js +246 -0
  11. package/dist/browser/handlers/integration.handlers.js +246 -0
  12. package/dist/browser/index.js +1595 -0
  13. package/dist/browser/integration/index.js +92 -0
  14. package/dist/browser/integration/integration.enum.js +12 -0
  15. package/dist/browser/integration/integration.operations.js +89 -0
  16. package/dist/browser/integration/integration.presentation.js +117 -0
  17. package/dist/browser/integration/integration.schema.js +42 -0
  18. package/dist/browser/integration-hub.capability.js +40 -0
  19. package/dist/browser/integration-hub.feature.js +114 -0
  20. package/dist/browser/seeders/index.js +60 -0
  21. package/dist/browser/sync/index.js +332 -0
  22. package/dist/browser/sync/sync.enum.js +26 -0
  23. package/dist/browser/sync/sync.operations.js +321 -0
  24. package/dist/browser/sync/sync.presentation.js +298 -0
  25. package/dist/browser/sync/sync.schema.js +154 -0
  26. package/dist/browser/sync-engine/index.js +186 -0
  27. package/dist/browser/tests/operations.test-spec.js +85 -0
  28. package/dist/browser/ui/IntegrationDashboard.js +369 -0
  29. package/dist/browser/ui/hooks/index.js +57 -0
  30. package/dist/browser/ui/hooks/useIntegrationData.js +54 -0
  31. package/dist/browser/ui/index.js +644 -0
  32. package/dist/browser/ui/renderers/index.js +273 -0
  33. package/dist/browser/ui/renderers/integration.markdown.js +273 -0
  34. package/dist/connection/connection.enum.d.ts +1 -6
  35. package/dist/connection/connection.enum.d.ts.map +1 -1
  36. package/dist/connection/connection.enum.js +11 -15
  37. package/dist/connection/connection.operation.d.ts +78 -84
  38. package/dist/connection/connection.operation.d.ts.map +1 -1
  39. package/dist/connection/connection.operation.js +99 -60
  40. package/dist/connection/connection.presentation.d.ts +2 -7
  41. package/dist/connection/connection.presentation.d.ts.map +1 -1
  42. package/dist/connection/connection.presentation.js +96 -56
  43. package/dist/connection/connection.schema.d.ts +54 -59
  44. package/dist/connection/connection.schema.d.ts.map +1 -1
  45. package/dist/connection/connection.schema.js +46 -73
  46. package/dist/connection/index.d.ts +7 -4
  47. package/dist/connection/index.d.ts.map +1 -0
  48. package/dist/connection/index.js +104 -4
  49. package/dist/docs/index.d.ts +2 -1
  50. package/dist/docs/index.d.ts.map +1 -0
  51. package/dist/docs/index.js +105 -1
  52. package/dist/docs/integration-hub.docblock.d.ts +2 -1
  53. package/dist/docs/integration-hub.docblock.d.ts.map +1 -0
  54. package/dist/docs/integration-hub.docblock.js +45 -56
  55. package/dist/events.d.ts +137 -143
  56. package/dist/events.d.ts.map +1 -1
  57. package/dist/events.js +210 -287
  58. package/dist/example.d.ts +2 -6
  59. package/dist/example.d.ts.map +1 -1
  60. package/dist/example.js +41 -55
  61. package/dist/handlers/index.d.ts +2 -2
  62. package/dist/handlers/index.d.ts.map +1 -0
  63. package/dist/handlers/index.js +247 -3
  64. package/dist/handlers/integration.handlers.d.ts +114 -113
  65. package/dist/handlers/integration.handlers.d.ts.map +1 -1
  66. package/dist/handlers/integration.handlers.js +232 -267
  67. package/dist/index.d.ts +12 -19
  68. package/dist/index.d.ts.map +1 -0
  69. package/dist/index.js +1596 -20
  70. package/dist/integration/index.d.ts +7 -4
  71. package/dist/integration/index.d.ts.map +1 -0
  72. package/dist/integration/index.js +92 -4
  73. package/dist/integration/integration.enum.d.ts +1 -6
  74. package/dist/integration/integration.enum.d.ts.map +1 -1
  75. package/dist/integration/integration.enum.js +11 -15
  76. package/dist/integration/integration.operations.d.ts +74 -80
  77. package/dist/integration/integration.operations.d.ts.map +1 -1
  78. package/dist/integration/integration.operations.js +87 -54
  79. package/dist/integration/integration.presentation.d.ts +3 -8
  80. package/dist/integration/integration.presentation.d.ts.map +1 -1
  81. package/dist/integration/integration.presentation.js +114 -73
  82. package/dist/integration/integration.schema.d.ts +54 -59
  83. package/dist/integration/integration.schema.d.ts.map +1 -1
  84. package/dist/integration/integration.schema.js +40 -73
  85. package/dist/integration-hub.capability.d.ts +3 -8
  86. package/dist/integration-hub.capability.d.ts.map +1 -1
  87. package/dist/integration-hub.capability.js +41 -38
  88. package/dist/integration-hub.feature.d.ts +1 -6
  89. package/dist/integration-hub.feature.d.ts.map +1 -1
  90. package/dist/integration-hub.feature.js +113 -242
  91. package/dist/node/connection/connection.enum.js +12 -0
  92. package/dist/node/connection/connection.operation.js +101 -0
  93. package/dist/node/connection/connection.presentation.js +99 -0
  94. package/dist/node/connection/connection.schema.js +48 -0
  95. package/dist/node/connection/index.js +104 -0
  96. package/dist/node/docs/index.js +104 -0
  97. package/dist/node/docs/integration-hub.docblock.js +104 -0
  98. package/dist/node/events.js +211 -0
  99. package/dist/node/example.js +42 -0
  100. package/dist/node/handlers/index.js +246 -0
  101. package/dist/node/handlers/integration.handlers.js +246 -0
  102. package/dist/node/index.js +1595 -0
  103. package/dist/node/integration/index.js +92 -0
  104. package/dist/node/integration/integration.enum.js +12 -0
  105. package/dist/node/integration/integration.operations.js +89 -0
  106. package/dist/node/integration/integration.presentation.js +117 -0
  107. package/dist/node/integration/integration.schema.js +42 -0
  108. package/dist/node/integration-hub.capability.js +40 -0
  109. package/dist/node/integration-hub.feature.js +114 -0
  110. package/dist/node/seeders/index.js +60 -0
  111. package/dist/node/sync/index.js +332 -0
  112. package/dist/node/sync/sync.enum.js +26 -0
  113. package/dist/node/sync/sync.operations.js +321 -0
  114. package/dist/node/sync/sync.presentation.js +298 -0
  115. package/dist/node/sync/sync.schema.js +154 -0
  116. package/dist/node/sync-engine/index.js +186 -0
  117. package/dist/node/tests/operations.test-spec.js +85 -0
  118. package/dist/node/ui/IntegrationDashboard.js +369 -0
  119. package/dist/node/ui/hooks/index.js +57 -0
  120. package/dist/node/ui/hooks/useIntegrationData.js +54 -0
  121. package/dist/node/ui/index.js +644 -0
  122. package/dist/node/ui/renderers/index.js +273 -0
  123. package/dist/node/ui/renderers/integration.markdown.js +273 -0
  124. package/dist/seeders/index.d.ts +4 -8
  125. package/dist/seeders/index.d.ts.map +1 -1
  126. package/dist/seeders/index.js +54 -52
  127. package/dist/sync/index.d.ts +7 -4
  128. package/dist/sync/index.d.ts.map +1 -0
  129. package/dist/sync/index.js +332 -4
  130. package/dist/sync/sync.enum.d.ts +3 -8
  131. package/dist/sync/sync.enum.d.ts.map +1 -1
  132. package/dist/sync/sync.enum.js +23 -31
  133. package/dist/sync/sync.operations.d.ts +413 -419
  134. package/dist/sync/sync.operations.d.ts.map +1 -1
  135. package/dist/sync/sync.operations.js +316 -197
  136. package/dist/sync/sync.presentation.d.ts +6 -11
  137. package/dist/sync/sync.presentation.d.ts.map +1 -1
  138. package/dist/sync/sync.presentation.js +291 -160
  139. package/dist/sync/sync.schema.d.ts +317 -322
  140. package/dist/sync/sync.schema.d.ts.map +1 -1
  141. package/dist/sync/sync.schema.js +146 -295
  142. package/dist/sync-engine/index.d.ts +88 -91
  143. package/dist/sync-engine/index.d.ts.map +1 -1
  144. package/dist/sync-engine/index.js +181 -142
  145. package/dist/tests/operations.test-spec.d.ts +3 -8
  146. package/dist/tests/operations.test-spec.d.ts.map +1 -1
  147. package/dist/tests/operations.test-spec.js +82 -90
  148. package/dist/ui/IntegrationDashboard.d.ts +1 -6
  149. package/dist/ui/IntegrationDashboard.d.ts.map +1 -1
  150. package/dist/ui/IntegrationDashboard.js +365 -261
  151. package/dist/ui/hooks/index.d.ts +2 -2
  152. package/dist/ui/hooks/index.d.ts.map +1 -0
  153. package/dist/ui/hooks/index.js +57 -4
  154. package/dist/ui/hooks/useIntegrationData.d.ts +16 -20
  155. package/dist/ui/hooks/useIntegrationData.d.ts.map +1 -1
  156. package/dist/ui/hooks/useIntegrationData.js +51 -55
  157. package/dist/ui/index.d.ts +7 -6
  158. package/dist/ui/index.d.ts.map +1 -0
  159. package/dist/ui/index.js +644 -5
  160. package/dist/ui/renderers/index.d.ts +2 -2
  161. package/dist/ui/renderers/index.d.ts.map +1 -0
  162. package/dist/ui/renderers/index.js +274 -3
  163. package/dist/ui/renderers/integration.markdown.d.ts +13 -14
  164. package/dist/ui/renderers/integration.markdown.d.ts.map +1 -1
  165. package/dist/ui/renderers/integration.markdown.js +268 -264
  166. package/package.json +360 -71
  167. package/dist/connection/connection.enum.js.map +0 -1
  168. package/dist/connection/connection.operation.js.map +0 -1
  169. package/dist/connection/connection.presentation.js.map +0 -1
  170. package/dist/connection/connection.schema.js.map +0 -1
  171. package/dist/docs/integration-hub.docblock.js.map +0 -1
  172. package/dist/events.js.map +0 -1
  173. package/dist/example.js.map +0 -1
  174. package/dist/handlers/integration.handlers.js.map +0 -1
  175. package/dist/integration/integration.enum.js.map +0 -1
  176. package/dist/integration/integration.operations.js.map +0 -1
  177. package/dist/integration/integration.presentation.js.map +0 -1
  178. package/dist/integration/integration.schema.js.map +0 -1
  179. package/dist/integration-hub.capability.js.map +0 -1
  180. package/dist/integration-hub.feature.js.map +0 -1
  181. package/dist/seeders/index.js.map +0 -1
  182. package/dist/sync/sync.enum.js.map +0 -1
  183. package/dist/sync/sync.operations.js.map +0 -1
  184. package/dist/sync/sync.presentation.js.map +0 -1
  185. package/dist/sync/sync.schema.js.map +0 -1
  186. package/dist/sync-engine/index.js.map +0 -1
  187. package/dist/tests/operations.test-spec.js.map +0 -1
  188. package/dist/ui/IntegrationDashboard.js.map +0 -1
  189. package/dist/ui/hooks/useIntegrationData.js.map +0 -1
  190. package/dist/ui/renderers/integration.markdown.js.map +0 -1
@@ -1,107 +1,101 @@
1
- import * as _contractspec_lib_contracts0 from "@contractspec/lib.contracts";
2
- import * as _contractspec_lib_schema0 from "@contractspec/lib.schema";
3
-
4
- //#region src/connection/connection.operation.d.ts
5
1
  /**
6
2
  * Create a connection to an external system.
7
3
  */
8
- declare const CreateConnectionContract: _contractspec_lib_contracts0.OperationSpec<_contractspec_lib_schema0.SchemaModel<{
9
- integrationId: {
10
- type: _contractspec_lib_schema0.FieldType<string, string>;
11
- isOptional: false;
12
- };
13
- name: {
14
- type: _contractspec_lib_schema0.FieldType<string, string>;
15
- isOptional: false;
16
- };
17
- authType: {
18
- type: _contractspec_lib_schema0.FieldType<string, string>;
19
- isOptional: false;
20
- };
21
- credentials: {
22
- type: _contractspec_lib_schema0.FieldType<unknown, unknown>;
23
- isOptional: true;
24
- };
25
- }>, _contractspec_lib_schema0.SchemaModel<{
26
- id: {
27
- type: _contractspec_lib_schema0.FieldType<string, string>;
28
- isOptional: false;
29
- };
30
- integrationId: {
31
- type: _contractspec_lib_schema0.FieldType<string, string>;
32
- isOptional: false;
33
- };
34
- name: {
35
- type: _contractspec_lib_schema0.FieldType<string, string>;
36
- isOptional: false;
37
- };
38
- status: {
39
- type: _contractspec_lib_schema0.EnumType<[string, string, string, string, string]>;
40
- isOptional: false;
41
- };
42
- authType: {
43
- type: _contractspec_lib_schema0.FieldType<string, string>;
44
- isOptional: false;
45
- };
46
- externalAccountName: {
47
- type: _contractspec_lib_schema0.FieldType<string, string>;
48
- isOptional: true;
49
- };
50
- connectedAt: {
51
- type: _contractspec_lib_schema0.FieldType<Date, string>;
52
- isOptional: true;
53
- };
54
- lastHealthCheck: {
55
- type: _contractspec_lib_schema0.FieldType<Date, string>;
56
- isOptional: true;
57
- };
58
- healthStatus: {
59
- type: _contractspec_lib_schema0.FieldType<string, string>;
60
- isOptional: true;
61
- };
62
- }>, {
63
- key: string;
64
- version: string;
65
- when: string;
66
- payload: _contractspec_lib_schema0.SchemaModel<{
4
+ export declare const CreateConnectionContract: import("@contractspec/lib.contracts").OperationSpec<import("@contractspec/lib.schema").SchemaModel<{
5
+ integrationId: {
6
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
7
+ isOptional: false;
8
+ };
9
+ name: {
10
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
11
+ isOptional: false;
12
+ };
13
+ authType: {
14
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
15
+ isOptional: false;
16
+ };
17
+ credentials: {
18
+ type: import("@contractspec/lib.schema").FieldType<unknown, unknown>;
19
+ isOptional: true;
20
+ };
21
+ }>, import("@contractspec/lib.schema").SchemaModel<{
67
22
  id: {
68
- type: _contractspec_lib_schema0.FieldType<string, string>;
69
- isOptional: false;
23
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
24
+ isOptional: false;
70
25
  };
71
26
  integrationId: {
72
- type: _contractspec_lib_schema0.FieldType<string, string>;
73
- isOptional: false;
27
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
28
+ isOptional: false;
74
29
  };
75
30
  name: {
76
- type: _contractspec_lib_schema0.FieldType<string, string>;
77
- isOptional: false;
31
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
32
+ isOptional: false;
78
33
  };
79
34
  status: {
80
- type: _contractspec_lib_schema0.EnumType<[string, string, string, string, string]>;
81
- isOptional: false;
35
+ type: import("@contractspec/lib.schema").EnumType<[string, string, string, string, string]>;
36
+ isOptional: false;
82
37
  };
83
38
  authType: {
84
- type: _contractspec_lib_schema0.FieldType<string, string>;
85
- isOptional: false;
39
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
40
+ isOptional: false;
86
41
  };
87
42
  externalAccountName: {
88
- type: _contractspec_lib_schema0.FieldType<string, string>;
89
- isOptional: true;
43
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
44
+ isOptional: true;
90
45
  };
91
46
  connectedAt: {
92
- type: _contractspec_lib_schema0.FieldType<Date, string>;
93
- isOptional: true;
47
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
48
+ isOptional: true;
94
49
  };
95
50
  lastHealthCheck: {
96
- type: _contractspec_lib_schema0.FieldType<Date, string>;
97
- isOptional: true;
51
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
52
+ isOptional: true;
98
53
  };
99
54
  healthStatus: {
100
- type: _contractspec_lib_schema0.FieldType<string, string>;
101
- isOptional: true;
55
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
56
+ isOptional: true;
102
57
  };
103
- }>;
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
+ integrationId: {
68
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
69
+ isOptional: false;
70
+ };
71
+ name: {
72
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
73
+ isOptional: false;
74
+ };
75
+ status: {
76
+ type: import("@contractspec/lib.schema").EnumType<[string, string, string, string, string]>;
77
+ isOptional: false;
78
+ };
79
+ authType: {
80
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
81
+ isOptional: false;
82
+ };
83
+ externalAccountName: {
84
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
85
+ isOptional: true;
86
+ };
87
+ connectedAt: {
88
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
89
+ isOptional: true;
90
+ };
91
+ lastHealthCheck: {
92
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
93
+ isOptional: true;
94
+ };
95
+ healthStatus: {
96
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
97
+ isOptional: true;
98
+ };
99
+ }>;
104
100
  }[]>;
105
- //#endregion
106
- export { CreateConnectionContract };
107
101
  //# sourceMappingURL=connection.operation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connection.operation.d.ts","names":[],"sources":["../../src/connection/connection.operation.ts"],"mappings":";;;;;;;cAWa,wBAAA,+BAAwB,aAAA,2BAAA,WAAA;;UAiDnC,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;UAjDmC,yBAAA,CAAA,SAAA"}
1
+ {"version":3,"file":"connection.operation.d.ts","sourceRoot":"","sources":["../../src/connection/connection.operation.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiDnC,CAAC"}
@@ -1,63 +1,102 @@
1
- import { ConnectionModel, CreateConnectionInputModel } from "./connection.schema.js";
2
- import { defineCommand } from "@contractspec/lib.contracts/operations";
1
+ // @bun
2
+ // src/connection/connection.enum.ts
3
+ import { defineEnum } from "@contractspec/lib.schema";
4
+ var ConnectionStatusEnum = defineEnum("ConnectionStatus", [
5
+ "PENDING",
6
+ "CONNECTED",
7
+ "DISCONNECTED",
8
+ "ERROR",
9
+ "EXPIRED"
10
+ ]);
3
11
 
4
- //#region src/connection/connection.operation.ts
5
- const OWNERS = ["@example.integration-hub"];
6
- /**
7
- * Create a connection to an external system.
8
- */
9
- const CreateConnectionContract = defineCommand({
10
- meta: {
11
- key: "integration.connection.create",
12
- version: "1.0.0",
13
- stability: "stable",
14
- owners: [...OWNERS],
15
- tags: [
16
- "integration",
17
- "connection",
18
- "create"
19
- ],
20
- description: "Create a connection to an external system.",
21
- goal: "Authenticate with external systems.",
22
- context: "Connection setup."
23
- },
24
- io: {
25
- input: CreateConnectionInputModel,
26
- output: ConnectionModel
27
- },
28
- policy: { auth: "user" },
29
- sideEffects: {
30
- emits: [{
31
- key: "integration.connection.created",
32
- version: "1.0.0",
33
- when: "Connection created",
34
- payload: ConnectionModel
35
- }],
36
- audit: ["integration.connection.created"]
37
- },
38
- acceptance: {
39
- scenarios: [{
40
- key: "create-connection-happy-path",
41
- given: ["User is authenticated"],
42
- when: ["User creates connection with valid credentials"],
43
- then: ["Connection is created", "ConnectionCreated event is emitted"]
44
- }],
45
- examples: [{
46
- key: "connect-crm",
47
- input: {
48
- name: "Salesforce Prod",
49
- integrationId: "salesforce",
50
- credentials: { clientId: "xxx" }
51
- },
52
- output: {
53
- id: "conn-123",
54
- status: "connected",
55
- connectedAt: "2025-01-01T12:00:00Z"
56
- }
57
- }]
58
- }
12
+ // src/connection/connection.schema.ts
13
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
14
+ var ConnectionModel = defineSchemaModel({
15
+ name: "ConnectionModel",
16
+ fields: {
17
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
18
+ integrationId: {
19
+ type: ScalarTypeEnum.String_unsecure(),
20
+ isOptional: false
21
+ },
22
+ name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
23
+ status: { type: ConnectionStatusEnum, isOptional: false },
24
+ authType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
25
+ externalAccountName: {
26
+ type: ScalarTypeEnum.String_unsecure(),
27
+ isOptional: true
28
+ },
29
+ connectedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
30
+ lastHealthCheck: { type: ScalarTypeEnum.DateTime(), isOptional: true },
31
+ healthStatus: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
32
+ }
33
+ });
34
+ var CreateConnectionInputModel = defineSchemaModel({
35
+ name: "CreateConnectionInput",
36
+ fields: {
37
+ integrationId: {
38
+ type: ScalarTypeEnum.String_unsecure(),
39
+ isOptional: false
40
+ },
41
+ name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
42
+ authType: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
43
+ credentials: { type: ScalarTypeEnum.JSON(), isOptional: true }
44
+ }
59
45
  });
60
46
 
61
- //#endregion
62
- export { CreateConnectionContract };
63
- //# sourceMappingURL=connection.operation.js.map
47
+ // src/connection/connection.operation.ts
48
+ import { defineCommand } from "@contractspec/lib.contracts/operations";
49
+ var OWNERS = ["@example.integration-hub"];
50
+ var CreateConnectionContract = defineCommand({
51
+ meta: {
52
+ key: "integration.connection.create",
53
+ version: "1.0.0",
54
+ stability: "stable",
55
+ owners: [...OWNERS],
56
+ tags: ["integration", "connection", "create"],
57
+ description: "Create a connection to an external system.",
58
+ goal: "Authenticate with external systems.",
59
+ context: "Connection setup."
60
+ },
61
+ io: { input: CreateConnectionInputModel, output: ConnectionModel },
62
+ policy: { auth: "user" },
63
+ sideEffects: {
64
+ emits: [
65
+ {
66
+ key: "integration.connection.created",
67
+ version: "1.0.0",
68
+ when: "Connection created",
69
+ payload: ConnectionModel
70
+ }
71
+ ],
72
+ audit: ["integration.connection.created"]
73
+ },
74
+ acceptance: {
75
+ scenarios: [
76
+ {
77
+ key: "create-connection-happy-path",
78
+ given: ["User is authenticated"],
79
+ when: ["User creates connection with valid credentials"],
80
+ then: ["Connection is created", "ConnectionCreated event is emitted"]
81
+ }
82
+ ],
83
+ examples: [
84
+ {
85
+ key: "connect-crm",
86
+ input: {
87
+ name: "Salesforce Prod",
88
+ integrationId: "salesforce",
89
+ credentials: { clientId: "xxx" }
90
+ },
91
+ output: {
92
+ id: "conn-123",
93
+ status: "connected",
94
+ connectedAt: "2025-01-01T12:00:00Z"
95
+ }
96
+ }
97
+ ]
98
+ }
99
+ });
100
+ export {
101
+ CreateConnectionContract
102
+ };
@@ -1,8 +1,3 @@
1
- import * as _contractspec_lib_contracts0 from "@contractspec/lib.contracts";
2
-
3
- //#region src/connection/connection.presentation.d.ts
4
- declare const ConnectionListPresentation: _contractspec_lib_contracts0.PresentationSpec;
5
- declare const ConnectionSetupPresentation: _contractspec_lib_contracts0.PresentationSpec;
6
- //#endregion
7
- export { ConnectionListPresentation, ConnectionSetupPresentation };
1
+ export declare const ConnectionListPresentation: import("@contractspec/lib.contracts").PresentationSpec;
2
+ export declare const ConnectionSetupPresentation: import("@contractspec/lib.contracts").PresentationSpec;
8
3
  //# sourceMappingURL=connection.presentation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connection.presentation.d.ts","names":[],"sources":["../../src/connection/connection.presentation.ts"],"mappings":";;;cAGa,0BAAA,EAuBX,4BAAA,CAvBqC,gBAAA;AAAA,cAyB1B,2BAAA,EAuBX,4BAAA,CAvBsC,gBAAA"}
1
+ {"version":3,"file":"connection.presentation.d.ts","sourceRoot":"","sources":["../../src/connection/connection.presentation.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,0BAA0B,wDAuBrC,CAAC;AAEH,eAAO,MAAM,2BAA2B,wDAuBtC,CAAC"}
@@ -1,60 +1,100 @@
1
- import { ConnectionModel } from "./connection.schema.js";
2
- import { StabilityEnum, definePresentation } from "@contractspec/lib.contracts";
1
+ // @bun
2
+ // src/connection/connection.enum.ts
3
+ import { defineEnum } from "@contractspec/lib.schema";
4
+ var ConnectionStatusEnum = defineEnum("ConnectionStatus", [
5
+ "PENDING",
6
+ "CONNECTED",
7
+ "DISCONNECTED",
8
+ "ERROR",
9
+ "EXPIRED"
10
+ ]);
3
11
 
4
- //#region src/connection/connection.presentation.ts
5
- const ConnectionListPresentation = definePresentation({
6
- meta: {
7
- key: "integration.connection.list",
8
- version: "1.0.0",
9
- title: "Connection List",
10
- description: "List of integration connections",
11
- domain: "integration",
12
- owners: ["@integration-team"],
13
- tags: [
14
- "integration",
15
- "connection",
16
- "list"
17
- ],
18
- stability: StabilityEnum.Experimental,
19
- goal: "Provide an overview of all established integration connections.",
20
- context: "The primary management view for integration hubs."
21
- },
22
- source: {
23
- type: "component",
24
- framework: "react",
25
- componentKey: "ConnectionList",
26
- props: ConnectionModel
27
- },
28
- targets: ["react", "markdown"],
29
- policy: { flags: ["integration.enabled"] }
12
+ // src/connection/connection.schema.ts
13
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
14
+ var ConnectionModel = defineSchemaModel({
15
+ name: "ConnectionModel",
16
+ fields: {
17
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
18
+ integrationId: {
19
+ type: ScalarTypeEnum.String_unsecure(),
20
+ isOptional: false
21
+ },
22
+ name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
23
+ status: { type: ConnectionStatusEnum, isOptional: false },
24
+ authType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
25
+ externalAccountName: {
26
+ type: ScalarTypeEnum.String_unsecure(),
27
+ isOptional: true
28
+ },
29
+ connectedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
30
+ lastHealthCheck: { type: ScalarTypeEnum.DateTime(), isOptional: true },
31
+ healthStatus: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
32
+ }
30
33
  });
31
- const ConnectionSetupPresentation = definePresentation({
32
- meta: {
33
- key: "integration.connection.setup",
34
- version: "1.0.0",
35
- title: "Connection Setup",
36
- description: "Setup wizard for creating integration connections",
37
- domain: "integration",
38
- owners: ["@integration-team"],
39
- tags: [
40
- "integration",
41
- "connection",
42
- "setup"
43
- ],
44
- stability: StabilityEnum.Experimental,
45
- goal: "Guide users through the multi-step process of connecting to a new integration.",
46
- context: "The onboarding flow for new integrations."
47
- },
48
- source: {
49
- type: "component",
50
- framework: "react",
51
- componentKey: "ConnectionSetup",
52
- props: ConnectionModel
53
- },
54
- targets: ["react"],
55
- policy: { flags: ["integration.enabled"] }
34
+ var CreateConnectionInputModel = defineSchemaModel({
35
+ name: "CreateConnectionInput",
36
+ fields: {
37
+ integrationId: {
38
+ type: ScalarTypeEnum.String_unsecure(),
39
+ isOptional: false
40
+ },
41
+ name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
42
+ authType: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
43
+ credentials: { type: ScalarTypeEnum.JSON(), isOptional: true }
44
+ }
56
45
  });
57
46
 
58
- //#endregion
59
- export { ConnectionListPresentation, ConnectionSetupPresentation };
60
- //# sourceMappingURL=connection.presentation.js.map
47
+ // src/connection/connection.presentation.ts
48
+ import { definePresentation, StabilityEnum } from "@contractspec/lib.contracts";
49
+ var ConnectionListPresentation = definePresentation({
50
+ meta: {
51
+ key: "integration.connection.list",
52
+ version: "1.0.0",
53
+ title: "Connection List",
54
+ description: "List of integration connections",
55
+ domain: "integration",
56
+ owners: ["@integration-team"],
57
+ tags: ["integration", "connection", "list"],
58
+ stability: StabilityEnum.Experimental,
59
+ goal: "Provide an overview of all established integration connections.",
60
+ context: "The primary management view for integration hubs."
61
+ },
62
+ source: {
63
+ type: "component",
64
+ framework: "react",
65
+ componentKey: "ConnectionList",
66
+ props: ConnectionModel
67
+ },
68
+ targets: ["react", "markdown"],
69
+ policy: {
70
+ flags: ["integration.enabled"]
71
+ }
72
+ });
73
+ var ConnectionSetupPresentation = definePresentation({
74
+ meta: {
75
+ key: "integration.connection.setup",
76
+ version: "1.0.0",
77
+ title: "Connection Setup",
78
+ description: "Setup wizard for creating integration connections",
79
+ domain: "integration",
80
+ owners: ["@integration-team"],
81
+ tags: ["integration", "connection", "setup"],
82
+ stability: StabilityEnum.Experimental,
83
+ goal: "Guide users through the multi-step process of connecting to a new integration.",
84
+ context: "The onboarding flow for new integrations."
85
+ },
86
+ source: {
87
+ type: "component",
88
+ framework: "react",
89
+ componentKey: "ConnectionSetup",
90
+ props: ConnectionModel
91
+ },
92
+ targets: ["react"],
93
+ policy: {
94
+ flags: ["integration.enabled"]
95
+ }
96
+ });
97
+ export {
98
+ ConnectionSetupPresentation,
99
+ ConnectionListPresentation
100
+ };
@@ -1,68 +1,63 @@
1
- import * as _contractspec_lib_schema0 from "@contractspec/lib.schema";
2
-
3
- //#region src/connection/connection.schema.d.ts
4
1
  /**
5
2
  * A connection to an external system.
6
3
  */
7
- declare const ConnectionModel: _contractspec_lib_schema0.SchemaModel<{
8
- id: {
9
- type: _contractspec_lib_schema0.FieldType<string, string>;
10
- isOptional: false;
11
- };
12
- integrationId: {
13
- type: _contractspec_lib_schema0.FieldType<string, string>;
14
- isOptional: false;
15
- };
16
- name: {
17
- type: _contractspec_lib_schema0.FieldType<string, string>;
18
- isOptional: false;
19
- };
20
- status: {
21
- type: _contractspec_lib_schema0.EnumType<[string, string, string, string, string]>;
22
- isOptional: false;
23
- };
24
- authType: {
25
- type: _contractspec_lib_schema0.FieldType<string, string>;
26
- isOptional: false;
27
- };
28
- externalAccountName: {
29
- type: _contractspec_lib_schema0.FieldType<string, string>;
30
- isOptional: true;
31
- };
32
- connectedAt: {
33
- type: _contractspec_lib_schema0.FieldType<Date, string>;
34
- isOptional: true;
35
- };
36
- lastHealthCheck: {
37
- type: _contractspec_lib_schema0.FieldType<Date, string>;
38
- isOptional: true;
39
- };
40
- healthStatus: {
41
- type: _contractspec_lib_schema0.FieldType<string, string>;
42
- isOptional: true;
43
- };
4
+ export declare const ConnectionModel: import("@contractspec/lib.schema").SchemaModel<{
5
+ id: {
6
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
7
+ isOptional: false;
8
+ };
9
+ integrationId: {
10
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
11
+ isOptional: false;
12
+ };
13
+ name: {
14
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
15
+ isOptional: false;
16
+ };
17
+ status: {
18
+ type: import("@contractspec/lib.schema").EnumType<[string, string, string, string, string]>;
19
+ isOptional: false;
20
+ };
21
+ authType: {
22
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
23
+ isOptional: false;
24
+ };
25
+ externalAccountName: {
26
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
27
+ isOptional: true;
28
+ };
29
+ connectedAt: {
30
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
31
+ isOptional: true;
32
+ };
33
+ lastHealthCheck: {
34
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
35
+ isOptional: true;
36
+ };
37
+ healthStatus: {
38
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
39
+ isOptional: true;
40
+ };
44
41
  }>;
45
42
  /**
46
43
  * Input for creating a connection.
47
44
  */
48
- declare const CreateConnectionInputModel: _contractspec_lib_schema0.SchemaModel<{
49
- integrationId: {
50
- type: _contractspec_lib_schema0.FieldType<string, string>;
51
- isOptional: false;
52
- };
53
- name: {
54
- type: _contractspec_lib_schema0.FieldType<string, string>;
55
- isOptional: false;
56
- };
57
- authType: {
58
- type: _contractspec_lib_schema0.FieldType<string, string>;
59
- isOptional: false;
60
- };
61
- credentials: {
62
- type: _contractspec_lib_schema0.FieldType<unknown, unknown>;
63
- isOptional: true;
64
- };
45
+ export declare const CreateConnectionInputModel: import("@contractspec/lib.schema").SchemaModel<{
46
+ integrationId: {
47
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
48
+ isOptional: false;
49
+ };
50
+ name: {
51
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
52
+ isOptional: false;
53
+ };
54
+ authType: {
55
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
56
+ isOptional: false;
57
+ };
58
+ credentials: {
59
+ type: import("@contractspec/lib.schema").FieldType<unknown, unknown>;
60
+ isOptional: true;
61
+ };
65
62
  }>;
66
- //#endregion
67
- export { ConnectionModel, CreateConnectionInputModel };
68
63
  //# sourceMappingURL=connection.schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connection.schema.d.ts","names":[],"sources":["../../src/connection/connection.schema.ts"],"mappings":";;;;;;cAMa,eAAA,4BAAe,WAAA;;UAmB1B,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW,0BAAA,4BAA0B,WAAA;;UAWrC,yBAAA,CAAA,SAAA"}
1
+ {"version":3,"file":"connection.schema.d.ts","sourceRoot":"","sources":["../../src/connection/connection.schema.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmB1B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;EAWrC,CAAC"}