@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 +1 @@
1
- {"version":3,"file":"sync.schema.d.ts","names":[],"sources":["../../src/sync/sync.schema.ts"],"mappings":";;;;;;cAUa,iBAAA,4BAAiB,WAAA;;UAa5B,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW,eAAA,4BAAe,WAAA;;UAmB1B,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW,YAAA,4BAAY,WAAA;;UAoBvB,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW,0BAAA,4BAA0B,WAAA;;UAerC,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW,yBAAA,4BAAyB,WAAA;;UAgBpC,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW,qBAAA,4BAAqB,WAAA;;UAOhC,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;cAKW,sBAAA,4BAAsB,WAAA;;UAgBjC,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;cAKW,uBAAA,4BAAuB,WAAA;;;;cAMlC,yBAAA,CAAA,SAAA"}
1
+ {"version":3,"file":"sync.schema.d.ts","sourceRoot":"","sources":["../../src/sync/sync.schema.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;EAa5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmB1B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBvB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAerC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBpC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;EAOhC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;EAgBjC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMlC,CAAC"}
@@ -1,304 +1,155 @@
1
- import { MappingTypeEnum, SyncDirectionEnum, SyncStatusEnum } from "./sync.enum.js";
2
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
1
+ // @bun
2
+ // src/sync/sync.enum.ts
3
+ import { defineEnum } from "@contractspec/lib.schema";
4
+ var SyncDirectionEnum = defineEnum("SyncDirection", [
5
+ "INBOUND",
6
+ "OUTBOUND",
7
+ "BIDIRECTIONAL"
8
+ ]);
9
+ var SyncStatusEnum = defineEnum("SyncStatus", [
10
+ "PENDING",
11
+ "RUNNING",
12
+ "COMPLETED",
13
+ "FAILED",
14
+ "CANCELLED"
15
+ ]);
16
+ var MappingTypeEnum = defineEnum("MappingType", [
17
+ "DIRECT",
18
+ "TRANSFORM",
19
+ "LOOKUP",
20
+ "CONSTANT",
21
+ "COMPUTED"
22
+ ]);
3
23
 
4
- //#region src/sync/sync.schema.ts
5
- /**
6
- * A field mapping configuration.
7
- */
8
- const FieldMappingModel = defineSchemaModel({
9
- name: "FieldMappingModel",
10
- fields: {
11
- id: {
12
- type: ScalarTypeEnum.String_unsecure(),
13
- isOptional: false
14
- },
15
- sourceField: {
16
- type: ScalarTypeEnum.String_unsecure(),
17
- isOptional: false
18
- },
19
- targetField: {
20
- type: ScalarTypeEnum.String_unsecure(),
21
- isOptional: false
22
- },
23
- mappingType: {
24
- type: MappingTypeEnum,
25
- isOptional: false
26
- },
27
- transformExpression: {
28
- type: ScalarTypeEnum.String_unsecure(),
29
- isOptional: true
30
- },
31
- isRequired: {
32
- type: ScalarTypeEnum.Boolean(),
33
- isOptional: false
34
- }
35
- }
24
+ // src/sync/sync.schema.ts
25
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
26
+ var FieldMappingModel = defineSchemaModel({
27
+ name: "FieldMappingModel",
28
+ fields: {
29
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
30
+ sourceField: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
31
+ targetField: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
32
+ mappingType: { type: MappingTypeEnum, isOptional: false },
33
+ transformExpression: {
34
+ type: ScalarTypeEnum.String_unsecure(),
35
+ isOptional: true
36
+ },
37
+ isRequired: { type: ScalarTypeEnum.Boolean(), isOptional: false }
38
+ }
36
39
  });
37
- /**
38
- * A sync configuration.
39
- */
40
- const SyncConfigModel = defineSchemaModel({
41
- name: "SyncConfigModel",
42
- fields: {
43
- id: {
44
- type: ScalarTypeEnum.String_unsecure(),
45
- isOptional: false
46
- },
47
- integrationId: {
48
- type: ScalarTypeEnum.String_unsecure(),
49
- isOptional: false
50
- },
51
- connectionId: {
52
- type: ScalarTypeEnum.String_unsecure(),
53
- isOptional: false
54
- },
55
- name: {
56
- type: ScalarTypeEnum.String_unsecure(),
57
- isOptional: false
58
- },
59
- direction: {
60
- type: SyncDirectionEnum,
61
- isOptional: false
62
- },
63
- sourceObject: {
64
- type: ScalarTypeEnum.String_unsecure(),
65
- isOptional: false
66
- },
67
- targetObject: {
68
- type: ScalarTypeEnum.String_unsecure(),
69
- isOptional: false
70
- },
71
- scheduleEnabled: {
72
- type: ScalarTypeEnum.Boolean(),
73
- isOptional: false
74
- },
75
- scheduleCron: {
76
- type: ScalarTypeEnum.String_unsecure(),
77
- isOptional: true
78
- },
79
- isActive: {
80
- type: ScalarTypeEnum.Boolean(),
81
- isOptional: false
82
- },
83
- lastSyncAt: {
84
- type: ScalarTypeEnum.DateTime(),
85
- isOptional: true
86
- },
87
- fieldMappings: {
88
- type: FieldMappingModel,
89
- isArray: true,
90
- isOptional: true
91
- }
92
- }
40
+ var SyncConfigModel = defineSchemaModel({
41
+ name: "SyncConfigModel",
42
+ fields: {
43
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
44
+ integrationId: {
45
+ type: ScalarTypeEnum.String_unsecure(),
46
+ isOptional: false
47
+ },
48
+ connectionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
49
+ name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
50
+ direction: { type: SyncDirectionEnum, isOptional: false },
51
+ sourceObject: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
52
+ targetObject: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
53
+ scheduleEnabled: { type: ScalarTypeEnum.Boolean(), isOptional: false },
54
+ scheduleCron: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
55
+ isActive: { type: ScalarTypeEnum.Boolean(), isOptional: false },
56
+ lastSyncAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
57
+ fieldMappings: { type: FieldMappingModel, isArray: true, isOptional: true }
58
+ }
93
59
  });
94
- /**
95
- * A sync run.
96
- */
97
- const SyncRunModel = defineSchemaModel({
98
- name: "SyncRunModel",
99
- fields: {
100
- id: {
101
- type: ScalarTypeEnum.String_unsecure(),
102
- isOptional: false
103
- },
104
- syncConfigId: {
105
- type: ScalarTypeEnum.String_unsecure(),
106
- isOptional: false
107
- },
108
- status: {
109
- type: SyncStatusEnum,
110
- isOptional: false
111
- },
112
- direction: {
113
- type: SyncDirectionEnum,
114
- isOptional: false
115
- },
116
- trigger: {
117
- type: ScalarTypeEnum.String_unsecure(),
118
- isOptional: false
119
- },
120
- recordsProcessed: {
121
- type: ScalarTypeEnum.Int_unsecure(),
122
- isOptional: false
123
- },
124
- recordsCreated: {
125
- type: ScalarTypeEnum.Int_unsecure(),
126
- isOptional: false
127
- },
128
- recordsUpdated: {
129
- type: ScalarTypeEnum.Int_unsecure(),
130
- isOptional: false
131
- },
132
- recordsFailed: {
133
- type: ScalarTypeEnum.Int_unsecure(),
134
- isOptional: false
135
- },
136
- errorMessage: {
137
- type: ScalarTypeEnum.String_unsecure(),
138
- isOptional: true
139
- },
140
- startedAt: {
141
- type: ScalarTypeEnum.DateTime(),
142
- isOptional: true
143
- },
144
- completedAt: {
145
- type: ScalarTypeEnum.DateTime(),
146
- isOptional: true
147
- },
148
- createdAt: {
149
- type: ScalarTypeEnum.DateTime(),
150
- isOptional: false
151
- }
152
- }
60
+ var SyncRunModel = defineSchemaModel({
61
+ name: "SyncRunModel",
62
+ fields: {
63
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
64
+ syncConfigId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
65
+ status: { type: SyncStatusEnum, isOptional: false },
66
+ direction: { type: SyncDirectionEnum, isOptional: false },
67
+ trigger: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
68
+ recordsProcessed: {
69
+ type: ScalarTypeEnum.Int_unsecure(),
70
+ isOptional: false
71
+ },
72
+ recordsCreated: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
73
+ recordsUpdated: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
74
+ recordsFailed: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
75
+ errorMessage: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
76
+ startedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
77
+ completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
78
+ createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
79
+ }
153
80
  });
154
- /**
155
- * Input for creating a sync config.
156
- */
157
- const CreateSyncConfigInputModel = defineSchemaModel({
158
- name: "CreateSyncConfigInput",
159
- fields: {
160
- integrationId: {
161
- type: ScalarTypeEnum.String_unsecure(),
162
- isOptional: false
163
- },
164
- connectionId: {
165
- type: ScalarTypeEnum.String_unsecure(),
166
- isOptional: false
167
- },
168
- name: {
169
- type: ScalarTypeEnum.NonEmptyString(),
170
- isOptional: false
171
- },
172
- direction: {
173
- type: SyncDirectionEnum,
174
- isOptional: false
175
- },
176
- sourceObject: {
177
- type: ScalarTypeEnum.NonEmptyString(),
178
- isOptional: false
179
- },
180
- targetObject: {
181
- type: ScalarTypeEnum.NonEmptyString(),
182
- isOptional: false
183
- },
184
- scheduleEnabled: {
185
- type: ScalarTypeEnum.Boolean(),
186
- isOptional: true
187
- },
188
- scheduleCron: {
189
- type: ScalarTypeEnum.String_unsecure(),
190
- isOptional: true
191
- }
192
- }
81
+ var CreateSyncConfigInputModel = defineSchemaModel({
82
+ name: "CreateSyncConfigInput",
83
+ fields: {
84
+ integrationId: {
85
+ type: ScalarTypeEnum.String_unsecure(),
86
+ isOptional: false
87
+ },
88
+ connectionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
89
+ name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
90
+ direction: { type: SyncDirectionEnum, isOptional: false },
91
+ sourceObject: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
92
+ targetObject: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
93
+ scheduleEnabled: { type: ScalarTypeEnum.Boolean(), isOptional: true },
94
+ scheduleCron: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
95
+ }
193
96
  });
194
- /**
195
- * Input for adding a field mapping.
196
- */
197
- const AddFieldMappingInputModel = defineSchemaModel({
198
- name: "AddFieldMappingInput",
199
- fields: {
200
- syncConfigId: {
201
- type: ScalarTypeEnum.String_unsecure(),
202
- isOptional: false
203
- },
204
- sourceField: {
205
- type: ScalarTypeEnum.NonEmptyString(),
206
- isOptional: false
207
- },
208
- targetField: {
209
- type: ScalarTypeEnum.NonEmptyString(),
210
- isOptional: false
211
- },
212
- mappingType: {
213
- type: MappingTypeEnum,
214
- isOptional: false
215
- },
216
- transformExpression: {
217
- type: ScalarTypeEnum.String_unsecure(),
218
- isOptional: true
219
- },
220
- lookupConfig: {
221
- type: ScalarTypeEnum.JSON(),
222
- isOptional: true
223
- },
224
- constantValue: {
225
- type: ScalarTypeEnum.JSON(),
226
- isOptional: true
227
- },
228
- isRequired: {
229
- type: ScalarTypeEnum.Boolean(),
230
- isOptional: true
231
- },
232
- defaultValue: {
233
- type: ScalarTypeEnum.JSON(),
234
- isOptional: true
235
- }
236
- }
97
+ var AddFieldMappingInputModel = defineSchemaModel({
98
+ name: "AddFieldMappingInput",
99
+ fields: {
100
+ syncConfigId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
101
+ sourceField: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
102
+ targetField: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
103
+ mappingType: { type: MappingTypeEnum, isOptional: false },
104
+ transformExpression: {
105
+ type: ScalarTypeEnum.String_unsecure(),
106
+ isOptional: true
107
+ },
108
+ lookupConfig: { type: ScalarTypeEnum.JSON(), isOptional: true },
109
+ constantValue: { type: ScalarTypeEnum.JSON(), isOptional: true },
110
+ isRequired: { type: ScalarTypeEnum.Boolean(), isOptional: true },
111
+ defaultValue: { type: ScalarTypeEnum.JSON(), isOptional: true }
112
+ }
237
113
  });
238
- /**
239
- * Input for triggering a sync.
240
- */
241
- const TriggerSyncInputModel = defineSchemaModel({
242
- name: "TriggerSyncInput",
243
- fields: {
244
- syncConfigId: {
245
- type: ScalarTypeEnum.String_unsecure(),
246
- isOptional: false
247
- },
248
- direction: {
249
- type: SyncDirectionEnum,
250
- isOptional: true
251
- },
252
- fullSync: {
253
- type: ScalarTypeEnum.Boolean(),
254
- isOptional: true
255
- }
256
- }
114
+ var TriggerSyncInputModel = defineSchemaModel({
115
+ name: "TriggerSyncInput",
116
+ fields: {
117
+ syncConfigId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
118
+ direction: { type: SyncDirectionEnum, isOptional: true },
119
+ fullSync: { type: ScalarTypeEnum.Boolean(), isOptional: true }
120
+ }
257
121
  });
258
- /**
259
- * Input for listing sync runs.
260
- */
261
- const ListSyncRunsInputModel = defineSchemaModel({
262
- name: "ListSyncRunsInput",
263
- fields: {
264
- syncConfigId: {
265
- type: ScalarTypeEnum.String_unsecure(),
266
- isOptional: false
267
- },
268
- status: {
269
- type: SyncStatusEnum,
270
- isOptional: true
271
- },
272
- limit: {
273
- type: ScalarTypeEnum.Int_unsecure(),
274
- isOptional: true,
275
- defaultValue: 20
276
- },
277
- offset: {
278
- type: ScalarTypeEnum.Int_unsecure(),
279
- isOptional: true,
280
- defaultValue: 0
281
- }
282
- }
122
+ var ListSyncRunsInputModel = defineSchemaModel({
123
+ name: "ListSyncRunsInput",
124
+ fields: {
125
+ syncConfigId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
126
+ status: { type: SyncStatusEnum, isOptional: true },
127
+ limit: {
128
+ type: ScalarTypeEnum.Int_unsecure(),
129
+ isOptional: true,
130
+ defaultValue: 20
131
+ },
132
+ offset: {
133
+ type: ScalarTypeEnum.Int_unsecure(),
134
+ isOptional: true,
135
+ defaultValue: 0
136
+ }
137
+ }
283
138
  });
284
- /**
285
- * Output for listing sync runs.
286
- */
287
- const ListSyncRunsOutputModel = defineSchemaModel({
288
- name: "ListSyncRunsOutput",
289
- fields: {
290
- runs: {
291
- type: SyncRunModel,
292
- isArray: true,
293
- isOptional: false
294
- },
295
- total: {
296
- type: ScalarTypeEnum.Int_unsecure(),
297
- isOptional: false
298
- }
299
- }
139
+ var ListSyncRunsOutputModel = defineSchemaModel({
140
+ name: "ListSyncRunsOutput",
141
+ fields: {
142
+ runs: { type: SyncRunModel, isArray: true, isOptional: false },
143
+ total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false }
144
+ }
300
145
  });
301
-
302
- //#endregion
303
- export { AddFieldMappingInputModel, CreateSyncConfigInputModel, FieldMappingModel, ListSyncRunsInputModel, ListSyncRunsOutputModel, SyncConfigModel, SyncRunModel, TriggerSyncInputModel };
304
- //# sourceMappingURL=sync.schema.js.map
146
+ export {
147
+ TriggerSyncInputModel,
148
+ SyncRunModel,
149
+ SyncConfigModel,
150
+ ListSyncRunsOutputModel,
151
+ ListSyncRunsInputModel,
152
+ FieldMappingModel,
153
+ CreateSyncConfigInputModel,
154
+ AddFieldMappingInputModel
155
+ };
@@ -1,109 +1,106 @@
1
- //#region src/sync-engine/index.d.ts
2
1
  /**
3
2
  * Sync Engine
4
3
  *
5
4
  * Core sync logic for the Integration Hub.
6
5
  */
7
- interface FieldMapping {
8
- sourceField: string;
9
- targetField: string;
10
- mappingType: 'DIRECT' | 'TRANSFORM' | 'LOOKUP' | 'CONSTANT' | 'COMPUTED';
11
- transformExpression?: string;
12
- lookupConfig?: LookupConfig;
13
- constantValue?: unknown;
14
- isRequired: boolean;
15
- defaultValue?: unknown;
6
+ export interface FieldMapping {
7
+ sourceField: string;
8
+ targetField: string;
9
+ mappingType: 'DIRECT' | 'TRANSFORM' | 'LOOKUP' | 'CONSTANT' | 'COMPUTED';
10
+ transformExpression?: string;
11
+ lookupConfig?: LookupConfig;
12
+ constantValue?: unknown;
13
+ isRequired: boolean;
14
+ defaultValue?: unknown;
16
15
  }
17
- interface LookupConfig {
18
- sourceObject: string;
19
- lookupField: string;
20
- returnField: string;
16
+ export interface LookupConfig {
17
+ sourceObject: string;
18
+ lookupField: string;
19
+ returnField: string;
21
20
  }
22
- interface SyncConfig {
23
- id: string;
24
- direction: 'INBOUND' | 'OUTBOUND' | 'BIDIRECTIONAL';
25
- sourceObject: string;
26
- targetObject: string;
27
- fieldMappings: FieldMapping[];
28
- createNew: boolean;
29
- updateExisting: boolean;
30
- deleteRemoved: boolean;
31
- sourceFilter?: Record<string, unknown>;
32
- }
33
- interface SyncContext {
34
- runId: string;
35
- config: SyncConfig;
36
- connection: {
21
+ export interface SyncConfig {
37
22
  id: string;
38
- authType: string;
39
- credentials?: Record<string, unknown>;
40
- };
23
+ direction: 'INBOUND' | 'OUTBOUND' | 'BIDIRECTIONAL';
24
+ sourceObject: string;
25
+ targetObject: string;
26
+ fieldMappings: FieldMapping[];
27
+ createNew: boolean;
28
+ updateExisting: boolean;
29
+ deleteRemoved: boolean;
30
+ sourceFilter?: Record<string, unknown>;
41
31
  }
42
- interface SyncResult {
43
- success: boolean;
44
- recordsProcessed: number;
45
- recordsCreated: number;
46
- recordsUpdated: number;
47
- recordsDeleted: number;
48
- recordsFailed: number;
49
- recordsSkipped: number;
50
- errors: SyncError[];
32
+ export interface SyncContext {
33
+ runId: string;
34
+ config: SyncConfig;
35
+ connection: {
36
+ id: string;
37
+ authType: string;
38
+ credentials?: Record<string, unknown>;
39
+ };
51
40
  }
52
- interface SyncError {
53
- recordId?: string;
54
- field?: string;
55
- message: string;
56
- code: string;
41
+ export interface SyncResult {
42
+ success: boolean;
43
+ recordsProcessed: number;
44
+ recordsCreated: number;
45
+ recordsUpdated: number;
46
+ recordsDeleted: number;
47
+ recordsFailed: number;
48
+ recordsSkipped: number;
49
+ errors: SyncError[];
57
50
  }
58
- interface SourceRecord {
59
- id: string;
60
- data: Record<string, unknown>;
61
- checksum?: string;
51
+ export interface SyncError {
52
+ recordId?: string;
53
+ field?: string;
54
+ message: string;
55
+ code: string;
62
56
  }
63
- interface TargetRecord {
64
- id: string;
65
- data: Record<string, unknown>;
66
- checksum?: string;
57
+ export interface SourceRecord {
58
+ id: string;
59
+ data: Record<string, unknown>;
60
+ checksum?: string;
67
61
  }
68
- interface ISyncEngine {
69
- /**
70
- * Execute a sync operation.
71
- */
72
- sync(context: SyncContext): Promise<SyncResult>;
73
- /**
74
- * Transform a source record to target format.
75
- */
76
- transformRecord(sourceRecord: SourceRecord, mappings: FieldMapping[], context: SyncContext): TargetRecord;
77
- /**
78
- * Validate a transformed record.
79
- */
80
- validateRecord(record: TargetRecord, mappings: FieldMapping[]): {
81
- valid: boolean;
82
- errors: SyncError[];
83
- };
62
+ export interface TargetRecord {
63
+ id: string;
64
+ data: Record<string, unknown>;
65
+ checksum?: string;
84
66
  }
85
- interface IFieldTransformer {
86
- transform(value: unknown, expression: string): unknown;
67
+ export interface ISyncEngine {
68
+ /**
69
+ * Execute a sync operation.
70
+ */
71
+ sync(context: SyncContext): Promise<SyncResult>;
72
+ /**
73
+ * Transform a source record to target format.
74
+ */
75
+ transformRecord(sourceRecord: SourceRecord, mappings: FieldMapping[], context: SyncContext): TargetRecord;
76
+ /**
77
+ * Validate a transformed record.
78
+ */
79
+ validateRecord(record: TargetRecord, mappings: FieldMapping[]): {
80
+ valid: boolean;
81
+ errors: SyncError[];
82
+ };
87
83
  }
88
- declare class BasicFieldTransformer implements IFieldTransformer {
89
- transform(value: unknown, expression: string): unknown;
84
+ export interface IFieldTransformer {
85
+ transform(value: unknown, expression: string): unknown;
90
86
  }
91
- declare class BasicSyncEngine implements ISyncEngine {
92
- private transformer;
93
- constructor(transformer?: IFieldTransformer);
94
- sync(_context: SyncContext): Promise<SyncResult>;
95
- transformRecord(sourceRecord: SourceRecord, mappings: FieldMapping[], _context: SyncContext): TargetRecord;
96
- validateRecord(record: TargetRecord, mappings: FieldMapping[]): {
97
- valid: boolean;
98
- errors: SyncError[];
99
- };
100
- private getNestedValue;
101
- private setNestedValue;
102
- private evaluateComputed;
87
+ export declare class BasicFieldTransformer implements IFieldTransformer {
88
+ transform(value: unknown, expression: string): unknown;
89
+ }
90
+ export declare class BasicSyncEngine implements ISyncEngine {
91
+ private transformer;
92
+ constructor(transformer?: IFieldTransformer);
93
+ sync(_context: SyncContext): Promise<SyncResult>;
94
+ transformRecord(sourceRecord: SourceRecord, mappings: FieldMapping[], _context: SyncContext): TargetRecord;
95
+ validateRecord(record: TargetRecord, mappings: FieldMapping[]): {
96
+ valid: boolean;
97
+ errors: SyncError[];
98
+ };
99
+ private getNestedValue;
100
+ private setNestedValue;
101
+ private evaluateComputed;
103
102
  }
104
- declare function createSyncEngine(transformer?: IFieldTransformer): ISyncEngine;
105
- declare function computeChecksum(data: Record<string, unknown>): string;
106
- declare function hasChanges(sourceChecksum: string | undefined, targetChecksum: string | undefined): boolean;
107
- //#endregion
108
- export { BasicFieldTransformer, BasicSyncEngine, FieldMapping, IFieldTransformer, ISyncEngine, LookupConfig, SourceRecord, SyncConfig, SyncContext, SyncError, SyncResult, TargetRecord, computeChecksum, createSyncEngine, hasChanges };
103
+ export declare function createSyncEngine(transformer?: IFieldTransformer): ISyncEngine;
104
+ export declare function computeChecksum(data: Record<string, unknown>): string;
105
+ export declare function hasChanges(sourceChecksum: string | undefined, targetChecksum: string | undefined): boolean;
109
106
  //# sourceMappingURL=index.d.ts.map