@deepintel-ltd/buildlink-api-contracts 0.2.23

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 (278) hide show
  1. package/README.md +27 -0
  2. package/contracts/auth.d.ts +3641 -0
  3. package/contracts/auth.d.ts.map +1 -0
  4. package/contracts/auth.js +266 -0
  5. package/contracts/auth.js.map +1 -0
  6. package/contracts/billing.d.ts +2167 -0
  7. package/contracts/billing.d.ts.map +1 -0
  8. package/contracts/billing.js +55 -0
  9. package/contracts/billing.js.map +1 -0
  10. package/contracts/boq.d.ts +1214 -0
  11. package/contracts/boq.d.ts.map +1 -0
  12. package/contracts/boq.js +31 -0
  13. package/contracts/boq.js.map +1 -0
  14. package/contracts/budget.d.ts +10677 -0
  15. package/contracts/budget.d.ts.map +1 -0
  16. package/contracts/budget.js +599 -0
  17. package/contracts/budget.js.map +1 -0
  18. package/contracts/commercial.d.ts +1475 -0
  19. package/contracts/commercial.d.ts.map +1 -0
  20. package/contracts/commercial.js +40 -0
  21. package/contracts/commercial.js.map +1 -0
  22. package/contracts/communication.d.ts +5389 -0
  23. package/contracts/communication.d.ts.map +1 -0
  24. package/contracts/communication.js +255 -0
  25. package/contracts/communication.js.map +1 -0
  26. package/contracts/contractor-ledger.d.ts +1293 -0
  27. package/contracts/contractor-ledger.d.ts.map +1 -0
  28. package/contracts/contractor-ledger.js +41 -0
  29. package/contracts/contractor-ledger.js.map +1 -0
  30. package/contracts/daily-logs.d.ts +9132 -0
  31. package/contracts/daily-logs.d.ts.map +1 -0
  32. package/contracts/daily-logs.js +188 -0
  33. package/contracts/daily-logs.js.map +1 -0
  34. package/contracts/deficiencies.d.ts +11786 -0
  35. package/contracts/deficiencies.d.ts.map +1 -0
  36. package/contracts/deficiencies.js +312 -0
  37. package/contracts/deficiencies.js.map +1 -0
  38. package/contracts/directory.d.ts +3116 -0
  39. package/contracts/directory.d.ts.map +1 -0
  40. package/contracts/directory.js +117 -0
  41. package/contracts/directory.js.map +1 -0
  42. package/contracts/documents.d.ts +4944 -0
  43. package/contracts/documents.d.ts.map +1 -0
  44. package/contracts/documents.js +251 -0
  45. package/contracts/documents.js.map +1 -0
  46. package/contracts/drawings.d.ts +10552 -0
  47. package/contracts/drawings.d.ts.map +1 -0
  48. package/contracts/drawings.js +321 -0
  49. package/contracts/drawings.js.map +1 -0
  50. package/contracts/hub.d.ts +1174 -0
  51. package/contracts/hub.d.ts.map +1 -0
  52. package/contracts/hub.js +42 -0
  53. package/contracts/hub.js.map +1 -0
  54. package/contracts/index.d.ts +128 -0
  55. package/contracts/index.d.ts.map +1 -0
  56. package/contracts/index.js +119 -0
  57. package/contracts/index.js.map +1 -0
  58. package/contracts/integrations.d.ts +4163 -0
  59. package/contracts/integrations.d.ts.map +1 -0
  60. package/contracts/integrations.js +326 -0
  61. package/contracts/integrations.js.map +1 -0
  62. package/contracts/maps.d.ts +4911 -0
  63. package/contracts/maps.d.ts.map +1 -0
  64. package/contracts/maps.js +276 -0
  65. package/contracts/maps.js.map +1 -0
  66. package/contracts/meetings.d.ts +4194 -0
  67. package/contracts/meetings.d.ts.map +1 -0
  68. package/contracts/meetings.js +115 -0
  69. package/contracts/meetings.js.map +1 -0
  70. package/contracts/monitoring.d.ts +2749 -0
  71. package/contracts/monitoring.d.ts.map +1 -0
  72. package/contracts/monitoring.js +289 -0
  73. package/contracts/monitoring.js.map +1 -0
  74. package/contracts/packages.d.ts +1470 -0
  75. package/contracts/packages.d.ts.map +1 -0
  76. package/contracts/packages.js +74 -0
  77. package/contracts/packages.js.map +1 -0
  78. package/contracts/projects.d.ts +6281 -0
  79. package/contracts/projects.d.ts.map +1 -0
  80. package/contracts/projects.js +448 -0
  81. package/contracts/projects.js.map +1 -0
  82. package/contracts/proof.d.ts +962 -0
  83. package/contracts/proof.d.ts.map +1 -0
  84. package/contracts/proof.js +34 -0
  85. package/contracts/proof.js.map +1 -0
  86. package/contracts/qaqc.d.ts +1184 -0
  87. package/contracts/qaqc.d.ts.map +1 -0
  88. package/contracts/qaqc.js +35 -0
  89. package/contracts/qaqc.js.map +1 -0
  90. package/contracts/rbac.d.ts +5227 -0
  91. package/contracts/rbac.d.ts.map +1 -0
  92. package/contracts/rbac.js +357 -0
  93. package/contracts/rbac.js.map +1 -0
  94. package/contracts/reports.d.ts +8468 -0
  95. package/contracts/reports.d.ts.map +1 -0
  96. package/contracts/reports.js +377 -0
  97. package/contracts/reports.js.map +1 -0
  98. package/contracts/resources.d.ts +15870 -0
  99. package/contracts/resources.d.ts.map +1 -0
  100. package/contracts/resources.js +869 -0
  101. package/contracts/resources.js.map +1 -0
  102. package/contracts/rfi-submittal.d.ts +2545 -0
  103. package/contracts/rfi-submittal.d.ts.map +1 -0
  104. package/contracts/rfi-submittal.js +159 -0
  105. package/contracts/rfi-submittal.js.map +1 -0
  106. package/contracts/safety.d.ts +7162 -0
  107. package/contracts/safety.d.ts.map +1 -0
  108. package/contracts/safety.js +519 -0
  109. package/contracts/safety.js.map +1 -0
  110. package/contracts/schedule.d.ts +9456 -0
  111. package/contracts/schedule.d.ts.map +1 -0
  112. package/contracts/schedule.js +460 -0
  113. package/contracts/schedule.js.map +1 -0
  114. package/contracts/spec-equal.d.ts +841 -0
  115. package/contracts/spec-equal.d.ts.map +1 -0
  116. package/contracts/spec-equal.js +28 -0
  117. package/contracts/spec-equal.js.map +1 -0
  118. package/contracts/specifications.d.ts +15478 -0
  119. package/contracts/specifications.d.ts.map +1 -0
  120. package/contracts/specifications.js +521 -0
  121. package/contracts/specifications.js.map +1 -0
  122. package/contracts/tasks.d.ts +11037 -0
  123. package/contracts/tasks.d.ts.map +1 -0
  124. package/contracts/tasks.js +693 -0
  125. package/contracts/tasks.js.map +1 -0
  126. package/contracts/timecards.d.ts +3130 -0
  127. package/contracts/timecards.d.ts.map +1 -0
  128. package/contracts/timecards.js +133 -0
  129. package/contracts/timecards.js.map +1 -0
  130. package/contracts/transmittals.d.ts +3921 -0
  131. package/contracts/transmittals.d.ts.map +1 -0
  132. package/contracts/transmittals.js +156 -0
  133. package/contracts/transmittals.js.map +1 -0
  134. package/contracts/valuations.d.ts +3266 -0
  135. package/contracts/valuations.d.ts.map +1 -0
  136. package/contracts/valuations.js +116 -0
  137. package/contracts/valuations.js.map +1 -0
  138. package/package.json +216 -0
  139. package/schemas/auth.d.ts +449 -0
  140. package/schemas/auth.d.ts.map +1 -0
  141. package/schemas/auth.js +103 -0
  142. package/schemas/auth.js.map +1 -0
  143. package/schemas/billing.d.ts +710 -0
  144. package/schemas/billing.d.ts.map +1 -0
  145. package/schemas/billing.js +82 -0
  146. package/schemas/billing.js.map +1 -0
  147. package/schemas/boq.d.ts +385 -0
  148. package/schemas/boq.d.ts.map +1 -0
  149. package/schemas/boq.js +49 -0
  150. package/schemas/boq.js.map +1 -0
  151. package/schemas/budget.d.ts +737 -0
  152. package/schemas/budget.d.ts.map +1 -0
  153. package/schemas/budget.js +272 -0
  154. package/schemas/budget.js.map +1 -0
  155. package/schemas/commercial.d.ts +358 -0
  156. package/schemas/commercial.d.ts.map +1 -0
  157. package/schemas/commercial.js +36 -0
  158. package/schemas/commercial.js.map +1 -0
  159. package/schemas/common.d.ts +865 -0
  160. package/schemas/common.d.ts.map +1 -0
  161. package/schemas/common.js +193 -0
  162. package/schemas/common.js.map +1 -0
  163. package/schemas/communication.d.ts +884 -0
  164. package/schemas/communication.d.ts.map +1 -0
  165. package/schemas/communication.js +245 -0
  166. package/schemas/communication.js.map +1 -0
  167. package/schemas/contractor-ledger.d.ts +364 -0
  168. package/schemas/contractor-ledger.d.ts.map +1 -0
  169. package/schemas/contractor-ledger.js +36 -0
  170. package/schemas/contractor-ledger.js.map +1 -0
  171. package/schemas/cursor-pagination.d.ts +258 -0
  172. package/schemas/cursor-pagination.d.ts.map +1 -0
  173. package/schemas/cursor-pagination.js +84 -0
  174. package/schemas/cursor-pagination.js.map +1 -0
  175. package/schemas/daily-logs.d.ts +2339 -0
  176. package/schemas/daily-logs.d.ts.map +1 -0
  177. package/schemas/daily-logs.js +235 -0
  178. package/schemas/daily-logs.js.map +1 -0
  179. package/schemas/deficiencies.d.ts +2496 -0
  180. package/schemas/deficiencies.d.ts.map +1 -0
  181. package/schemas/deficiencies.js +338 -0
  182. package/schemas/deficiencies.js.map +1 -0
  183. package/schemas/directory.d.ts +783 -0
  184. package/schemas/directory.d.ts.map +1 -0
  185. package/schemas/directory.js +122 -0
  186. package/schemas/directory.js.map +1 -0
  187. package/schemas/documents.d.ts +202 -0
  188. package/schemas/documents.d.ts.map +1 -0
  189. package/schemas/documents.js +76 -0
  190. package/schemas/documents.js.map +1 -0
  191. package/schemas/drawings.d.ts +2042 -0
  192. package/schemas/drawings.d.ts.map +1 -0
  193. package/schemas/drawings.js +350 -0
  194. package/schemas/drawings.js.map +1 -0
  195. package/schemas/hub.d.ts +288 -0
  196. package/schemas/hub.d.ts.map +1 -0
  197. package/schemas/hub.js +32 -0
  198. package/schemas/hub.js.map +1 -0
  199. package/schemas/integrations.d.ts +508 -0
  200. package/schemas/integrations.d.ts.map +1 -0
  201. package/schemas/integrations.js +119 -0
  202. package/schemas/integrations.js.map +1 -0
  203. package/schemas/maps.d.ts +793 -0
  204. package/schemas/maps.d.ts.map +1 -0
  205. package/schemas/maps.js +118 -0
  206. package/schemas/maps.js.map +1 -0
  207. package/schemas/meetings.d.ts +888 -0
  208. package/schemas/meetings.d.ts.map +1 -0
  209. package/schemas/meetings.js +138 -0
  210. package/schemas/meetings.js.map +1 -0
  211. package/schemas/packages.d.ts +236 -0
  212. package/schemas/packages.d.ts.map +1 -0
  213. package/schemas/packages.js +53 -0
  214. package/schemas/packages.js.map +1 -0
  215. package/schemas/projects.d.ts +306 -0
  216. package/schemas/projects.d.ts.map +1 -0
  217. package/schemas/projects.js +92 -0
  218. package/schemas/projects.js.map +1 -0
  219. package/schemas/proof.d.ts +210 -0
  220. package/schemas/proof.d.ts.map +1 -0
  221. package/schemas/proof.js +26 -0
  222. package/schemas/proof.js.map +1 -0
  223. package/schemas/qaqc.d.ts +235 -0
  224. package/schemas/qaqc.d.ts.map +1 -0
  225. package/schemas/qaqc.js +47 -0
  226. package/schemas/qaqc.js.map +1 -0
  227. package/schemas/rbac.d.ts +730 -0
  228. package/schemas/rbac.d.ts.map +1 -0
  229. package/schemas/rbac.js +230 -0
  230. package/schemas/rbac.js.map +1 -0
  231. package/schemas/reports.d.ts +5729 -0
  232. package/schemas/reports.d.ts.map +1 -0
  233. package/schemas/reports.js +589 -0
  234. package/schemas/reports.js.map +1 -0
  235. package/schemas/resources.d.ts +5190 -0
  236. package/schemas/resources.d.ts.map +1 -0
  237. package/schemas/resources.js +678 -0
  238. package/schemas/resources.js.map +1 -0
  239. package/schemas/rfi.d.ts +877 -0
  240. package/schemas/rfi.d.ts.map +1 -0
  241. package/schemas/rfi.js +84 -0
  242. package/schemas/rfi.js.map +1 -0
  243. package/schemas/safety.d.ts +1080 -0
  244. package/schemas/safety.d.ts.map +1 -0
  245. package/schemas/safety.js +237 -0
  246. package/schemas/safety.js.map +1 -0
  247. package/schemas/schedule.d.ts +4657 -0
  248. package/schemas/schedule.d.ts.map +1 -0
  249. package/schemas/schedule.js +441 -0
  250. package/schemas/schedule.js.map +1 -0
  251. package/schemas/spec-equal.d.ts +162 -0
  252. package/schemas/spec-equal.d.ts.map +1 -0
  253. package/schemas/spec-equal.js +29 -0
  254. package/schemas/spec-equal.js.map +1 -0
  255. package/schemas/specifications.d.ts +5241 -0
  256. package/schemas/specifications.d.ts.map +1 -0
  257. package/schemas/specifications.js +426 -0
  258. package/schemas/specifications.js.map +1 -0
  259. package/schemas/submittal.d.ts +867 -0
  260. package/schemas/submittal.d.ts.map +1 -0
  261. package/schemas/submittal.js +87 -0
  262. package/schemas/submittal.js.map +1 -0
  263. package/schemas/tasks.d.ts +610 -0
  264. package/schemas/tasks.d.ts.map +1 -0
  265. package/schemas/tasks.js +133 -0
  266. package/schemas/tasks.js.map +1 -0
  267. package/schemas/timecards.d.ts +618 -0
  268. package/schemas/timecards.d.ts.map +1 -0
  269. package/schemas/timecards.js +80 -0
  270. package/schemas/timecards.js.map +1 -0
  271. package/schemas/transmittals.d.ts +662 -0
  272. package/schemas/transmittals.d.ts.map +1 -0
  273. package/schemas/transmittals.js +132 -0
  274. package/schemas/transmittals.js.map +1 -0
  275. package/schemas/valuations.d.ts +713 -0
  276. package/schemas/valuations.d.ts.map +1 -0
  277. package/schemas/valuations.js +116 -0
  278. package/schemas/valuations.js.map +1 -0
package/schemas/hub.js ADDED
@@ -0,0 +1,32 @@
1
+ import { z } from 'zod';
2
+ import { CuidSchema, DateTimeSchema } from './common';
3
+ export const HubTierSchema = z.enum(['BASIC', 'STANDARD', 'PREMIUM']);
4
+ export const HubEventTypeSchema = z.enum(['ALERT', 'TAMPER', 'HEARTBEAT', 'HOLD_RELEASE', 'DIARY_SYNC']);
5
+ export const HubSiteSchema = z.object({
6
+ id: CuidSchema, projectId: CuidSchema, companyId: CuidSchema,
7
+ name: z.string(), tier: HubTierSchema, tamperLocked: z.boolean(),
8
+ createdAt: DateTimeSchema, updatedAt: DateTimeSchema,
9
+ });
10
+ export const HubDeviceSchema = z.object({
11
+ id: CuidSchema, hubSiteId: CuidSchema, deviceKey: z.string(), label: z.string(),
12
+ lastSeenAt: DateTimeSchema.nullable().optional(), isOnline: z.boolean(), tamperFlag: z.boolean(),
13
+ createdAt: DateTimeSchema, updatedAt: DateTimeSchema,
14
+ });
15
+ export const HubEventSchema = z.object({
16
+ id: CuidSchema, hubSiteId: CuidSchema, deviceId: CuidSchema.nullable().optional(),
17
+ type: HubEventTypeSchema, payload: z.record(z.unknown()), createdAt: DateTimeSchema,
18
+ });
19
+ export const CreateHubSiteRequestSchema = z.object({
20
+ name: z.string().min(1).max(200), tier: HubTierSchema.default('BASIC'),
21
+ });
22
+ export const RegisterDeviceRequestSchema = z.object({
23
+ deviceKey: z.string().min(1).max(100), label: z.string().min(1).max(200),
24
+ });
25
+ export const RecordHubEventRequestSchema = z.object({
26
+ deviceId: CuidSchema.optional(), type: HubEventTypeSchema, payload: z.record(z.unknown()).default({}),
27
+ });
28
+ export const SetTamperRequestSchema = z.object({ tamperLocked: z.boolean() });
29
+ export const HubSiteResourceSchema = z.object({ type: z.literal('hub-sites'), id: z.string(), attributes: HubSiteSchema.omit({ id: true }) });
30
+ export const HubDeviceResourceSchema = z.object({ type: z.literal('hub-devices'), id: z.string(), attributes: HubDeviceSchema.omit({ id: true }) });
31
+ export const HubEventResourceSchema = z.object({ type: z.literal('hub-events'), id: z.string(), attributes: HubEventSchema.omit({ id: true }) });
32
+ //# sourceMappingURL=hub.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hub.js","sourceRoot":"","sources":["../../../src/schemas/hub.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,508 @@
1
+ import { z } from 'zod';
2
+ export declare const IntegrationTypeSchema: z.ZodEnum<["ACCOUNTING", "PROJECT_MANAGEMENT", "CRM", "HR", "DOCUMENT_STORAGE", "REPORTING", "API", "WEBHOOK"]>;
3
+ export declare const IntegrationStatusSchema: z.ZodEnum<["ACTIVE", "INACTIVE", "ERROR", "PENDING"]>;
4
+ export declare const SyncFrequencySchema: z.ZodEnum<["REAL_TIME", "HOURLY", "DAILY", "WEEKLY", "MANUAL"]>;
5
+ export declare const SyncLogStatusSchema: z.ZodEnum<["SUCCESS", "FAILED", "PARTIAL", "IN_PROGRESS"]>;
6
+ export declare const IntegrationSchema: z.ZodObject<{
7
+ id: z.ZodString;
8
+ name: z.ZodString;
9
+ type: z.ZodEnum<["ACCOUNTING", "PROJECT_MANAGEMENT", "CRM", "HR", "DOCUMENT_STORAGE", "REPORTING", "API", "WEBHOOK"]>;
10
+ status: z.ZodEnum<["ACTIVE", "INACTIVE", "ERROR", "PENDING"]>;
11
+ provider: z.ZodString;
12
+ description: z.ZodOptional<z.ZodString>;
13
+ configuration: z.ZodRecord<z.ZodString, z.ZodAny>;
14
+ credentials: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
15
+ lastSyncAt: z.ZodOptional<z.ZodString>;
16
+ lastErrorAt: z.ZodOptional<z.ZodString>;
17
+ lastErrorMessage: z.ZodOptional<z.ZodString>;
18
+ syncFrequency: z.ZodDefault<z.ZodEnum<["REAL_TIME", "HOURLY", "DAILY", "WEEKLY", "MANUAL"]>>;
19
+ isActive: z.ZodDefault<z.ZodBoolean>;
20
+ createdAt: z.ZodString;
21
+ updatedAt: z.ZodString;
22
+ }, "strip", z.ZodTypeAny, {
23
+ id: string;
24
+ createdAt: string;
25
+ updatedAt: string;
26
+ isActive: boolean;
27
+ type: "ACCOUNTING" | "PROJECT_MANAGEMENT" | "CRM" | "HR" | "DOCUMENT_STORAGE" | "REPORTING" | "API" | "WEBHOOK";
28
+ status: "ACTIVE" | "PENDING" | "INACTIVE" | "ERROR";
29
+ name: string;
30
+ provider: string;
31
+ configuration: Record<string, any>;
32
+ syncFrequency: "HOURLY" | "DAILY" | "WEEKLY" | "REAL_TIME" | "MANUAL";
33
+ description?: string | undefined;
34
+ credentials?: Record<string, string> | undefined;
35
+ lastSyncAt?: string | undefined;
36
+ lastErrorAt?: string | undefined;
37
+ lastErrorMessage?: string | undefined;
38
+ }, {
39
+ id: string;
40
+ createdAt: string;
41
+ updatedAt: string;
42
+ type: "ACCOUNTING" | "PROJECT_MANAGEMENT" | "CRM" | "HR" | "DOCUMENT_STORAGE" | "REPORTING" | "API" | "WEBHOOK";
43
+ status: "ACTIVE" | "PENDING" | "INACTIVE" | "ERROR";
44
+ name: string;
45
+ provider: string;
46
+ configuration: Record<string, any>;
47
+ isActive?: boolean | undefined;
48
+ description?: string | undefined;
49
+ credentials?: Record<string, string> | undefined;
50
+ lastSyncAt?: string | undefined;
51
+ lastErrorAt?: string | undefined;
52
+ lastErrorMessage?: string | undefined;
53
+ syncFrequency?: "HOURLY" | "DAILY" | "WEEKLY" | "REAL_TIME" | "MANUAL" | undefined;
54
+ }>;
55
+ export declare const WebhookSchema: z.ZodObject<{
56
+ id: z.ZodString;
57
+ name: z.ZodString;
58
+ url: z.ZodString;
59
+ events: z.ZodArray<z.ZodString, "many">;
60
+ isActive: z.ZodDefault<z.ZodBoolean>;
61
+ secret: z.ZodOptional<z.ZodString>;
62
+ lastTriggeredAt: z.ZodOptional<z.ZodString>;
63
+ failureCount: z.ZodDefault<z.ZodNumber>;
64
+ maxRetries: z.ZodDefault<z.ZodNumber>;
65
+ retryDelay: z.ZodDefault<z.ZodNumber>;
66
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
67
+ createdAt: z.ZodString;
68
+ updatedAt: z.ZodString;
69
+ }, "strip", z.ZodTypeAny, {
70
+ id: string;
71
+ createdAt: string;
72
+ updatedAt: string;
73
+ isActive: boolean;
74
+ name: string;
75
+ url: string;
76
+ events: string[];
77
+ failureCount: number;
78
+ maxRetries: number;
79
+ retryDelay: number;
80
+ secret?: string | undefined;
81
+ headers?: Record<string, string> | undefined;
82
+ lastTriggeredAt?: string | undefined;
83
+ }, {
84
+ id: string;
85
+ createdAt: string;
86
+ updatedAt: string;
87
+ name: string;
88
+ url: string;
89
+ events: string[];
90
+ isActive?: boolean | undefined;
91
+ secret?: string | undefined;
92
+ headers?: Record<string, string> | undefined;
93
+ lastTriggeredAt?: string | undefined;
94
+ failureCount?: number | undefined;
95
+ maxRetries?: number | undefined;
96
+ retryDelay?: number | undefined;
97
+ }>;
98
+ export declare const SyncLogSchema: z.ZodObject<{
99
+ id: z.ZodString;
100
+ integrationId: z.ZodString;
101
+ status: z.ZodEnum<["SUCCESS", "FAILED", "PARTIAL", "IN_PROGRESS"]>;
102
+ recordsProcessed: z.ZodDefault<z.ZodNumber>;
103
+ recordsSuccess: z.ZodDefault<z.ZodNumber>;
104
+ recordsFailed: z.ZodDefault<z.ZodNumber>;
105
+ startedAt: z.ZodString;
106
+ completedAt: z.ZodOptional<z.ZodString>;
107
+ duration: z.ZodOptional<z.ZodNumber>;
108
+ errorMessage: z.ZodOptional<z.ZodString>;
109
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
110
+ createdAt: z.ZodString;
111
+ }, "strip", z.ZodTypeAny, {
112
+ id: string;
113
+ createdAt: string;
114
+ status: "IN_PROGRESS" | "SUCCESS" | "FAILED" | "PARTIAL";
115
+ startedAt: string;
116
+ integrationId: string;
117
+ recordsProcessed: number;
118
+ recordsSuccess: number;
119
+ recordsFailed: number;
120
+ metadata?: Record<string, any> | undefined;
121
+ completedAt?: string | undefined;
122
+ duration?: number | undefined;
123
+ errorMessage?: string | undefined;
124
+ }, {
125
+ id: string;
126
+ createdAt: string;
127
+ status: "IN_PROGRESS" | "SUCCESS" | "FAILED" | "PARTIAL";
128
+ startedAt: string;
129
+ integrationId: string;
130
+ metadata?: Record<string, any> | undefined;
131
+ completedAt?: string | undefined;
132
+ recordsProcessed?: number | undefined;
133
+ recordsSuccess?: number | undefined;
134
+ recordsFailed?: number | undefined;
135
+ duration?: number | undefined;
136
+ errorMessage?: string | undefined;
137
+ }>;
138
+ export declare const CreateIntegrationRequestSchema: z.ZodObject<{
139
+ name: z.ZodString;
140
+ type: z.ZodEnum<["ACCOUNTING", "PROJECT_MANAGEMENT", "CRM", "HR", "DOCUMENT_STORAGE", "REPORTING", "API", "WEBHOOK"]>;
141
+ provider: z.ZodString;
142
+ description: z.ZodOptional<z.ZodString>;
143
+ configuration: z.ZodRecord<z.ZodString, z.ZodAny>;
144
+ credentials: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
145
+ syncFrequency: z.ZodDefault<z.ZodEnum<["REAL_TIME", "HOURLY", "DAILY", "WEEKLY", "MANUAL"]>>;
146
+ isActive: z.ZodDefault<z.ZodBoolean>;
147
+ }, "strip", z.ZodTypeAny, {
148
+ isActive: boolean;
149
+ type: "ACCOUNTING" | "PROJECT_MANAGEMENT" | "CRM" | "HR" | "DOCUMENT_STORAGE" | "REPORTING" | "API" | "WEBHOOK";
150
+ name: string;
151
+ provider: string;
152
+ configuration: Record<string, any>;
153
+ syncFrequency: "HOURLY" | "DAILY" | "WEEKLY" | "REAL_TIME" | "MANUAL";
154
+ description?: string | undefined;
155
+ credentials?: Record<string, string> | undefined;
156
+ }, {
157
+ type: "ACCOUNTING" | "PROJECT_MANAGEMENT" | "CRM" | "HR" | "DOCUMENT_STORAGE" | "REPORTING" | "API" | "WEBHOOK";
158
+ name: string;
159
+ provider: string;
160
+ configuration: Record<string, any>;
161
+ isActive?: boolean | undefined;
162
+ description?: string | undefined;
163
+ credentials?: Record<string, string> | undefined;
164
+ syncFrequency?: "HOURLY" | "DAILY" | "WEEKLY" | "REAL_TIME" | "MANUAL" | undefined;
165
+ }>;
166
+ export declare const UpdateIntegrationRequestSchema: z.ZodObject<{
167
+ name: z.ZodOptional<z.ZodString>;
168
+ description: z.ZodOptional<z.ZodString>;
169
+ configuration: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
170
+ credentials: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
171
+ syncFrequency: z.ZodOptional<z.ZodEnum<["REAL_TIME", "HOURLY", "DAILY", "WEEKLY", "MANUAL"]>>;
172
+ isActive: z.ZodOptional<z.ZodBoolean>;
173
+ }, "strip", z.ZodTypeAny, {
174
+ isActive?: boolean | undefined;
175
+ name?: string | undefined;
176
+ description?: string | undefined;
177
+ configuration?: Record<string, any> | undefined;
178
+ credentials?: Record<string, string> | undefined;
179
+ syncFrequency?: "HOURLY" | "DAILY" | "WEEKLY" | "REAL_TIME" | "MANUAL" | undefined;
180
+ }, {
181
+ isActive?: boolean | undefined;
182
+ name?: string | undefined;
183
+ description?: string | undefined;
184
+ configuration?: Record<string, any> | undefined;
185
+ credentials?: Record<string, string> | undefined;
186
+ syncFrequency?: "HOURLY" | "DAILY" | "WEEKLY" | "REAL_TIME" | "MANUAL" | undefined;
187
+ }>;
188
+ export declare const CreateWebhookRequestSchema: z.ZodObject<{
189
+ name: z.ZodString;
190
+ url: z.ZodString;
191
+ events: z.ZodArray<z.ZodString, "many">;
192
+ secret: z.ZodOptional<z.ZodString>;
193
+ maxRetries: z.ZodDefault<z.ZodNumber>;
194
+ retryDelay: z.ZodDefault<z.ZodNumber>;
195
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
196
+ isActive: z.ZodDefault<z.ZodBoolean>;
197
+ }, "strip", z.ZodTypeAny, {
198
+ isActive: boolean;
199
+ name: string;
200
+ url: string;
201
+ events: string[];
202
+ maxRetries: number;
203
+ retryDelay: number;
204
+ secret?: string | undefined;
205
+ headers?: Record<string, string> | undefined;
206
+ }, {
207
+ name: string;
208
+ url: string;
209
+ events: string[];
210
+ isActive?: boolean | undefined;
211
+ secret?: string | undefined;
212
+ headers?: Record<string, string> | undefined;
213
+ maxRetries?: number | undefined;
214
+ retryDelay?: number | undefined;
215
+ }>;
216
+ export declare const UpdateWebhookRequestSchema: z.ZodObject<{
217
+ name: z.ZodOptional<z.ZodString>;
218
+ url: z.ZodOptional<z.ZodString>;
219
+ events: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
220
+ secret: z.ZodOptional<z.ZodString>;
221
+ maxRetries: z.ZodOptional<z.ZodNumber>;
222
+ retryDelay: z.ZodOptional<z.ZodNumber>;
223
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
224
+ isActive: z.ZodOptional<z.ZodBoolean>;
225
+ }, "strip", z.ZodTypeAny, {
226
+ isActive?: boolean | undefined;
227
+ name?: string | undefined;
228
+ secret?: string | undefined;
229
+ headers?: Record<string, string> | undefined;
230
+ url?: string | undefined;
231
+ events?: string[] | undefined;
232
+ maxRetries?: number | undefined;
233
+ retryDelay?: number | undefined;
234
+ }, {
235
+ isActive?: boolean | undefined;
236
+ name?: string | undefined;
237
+ secret?: string | undefined;
238
+ headers?: Record<string, string> | undefined;
239
+ url?: string | undefined;
240
+ events?: string[] | undefined;
241
+ maxRetries?: number | undefined;
242
+ retryDelay?: number | undefined;
243
+ }>;
244
+ export declare const IntegrationResourceSchema: z.ZodObject<{
245
+ type: z.ZodLiteral<"integrations">;
246
+ id: z.ZodString;
247
+ attributes: z.ZodObject<{
248
+ id: z.ZodString;
249
+ name: z.ZodString;
250
+ type: z.ZodEnum<["ACCOUNTING", "PROJECT_MANAGEMENT", "CRM", "HR", "DOCUMENT_STORAGE", "REPORTING", "API", "WEBHOOK"]>;
251
+ status: z.ZodEnum<["ACTIVE", "INACTIVE", "ERROR", "PENDING"]>;
252
+ provider: z.ZodString;
253
+ description: z.ZodOptional<z.ZodString>;
254
+ configuration: z.ZodRecord<z.ZodString, z.ZodAny>;
255
+ credentials: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
256
+ lastSyncAt: z.ZodOptional<z.ZodString>;
257
+ lastErrorAt: z.ZodOptional<z.ZodString>;
258
+ lastErrorMessage: z.ZodOptional<z.ZodString>;
259
+ syncFrequency: z.ZodDefault<z.ZodEnum<["REAL_TIME", "HOURLY", "DAILY", "WEEKLY", "MANUAL"]>>;
260
+ isActive: z.ZodDefault<z.ZodBoolean>;
261
+ createdAt: z.ZodString;
262
+ updatedAt: z.ZodString;
263
+ }, "strip", z.ZodTypeAny, {
264
+ id: string;
265
+ createdAt: string;
266
+ updatedAt: string;
267
+ isActive: boolean;
268
+ type: "ACCOUNTING" | "PROJECT_MANAGEMENT" | "CRM" | "HR" | "DOCUMENT_STORAGE" | "REPORTING" | "API" | "WEBHOOK";
269
+ status: "ACTIVE" | "PENDING" | "INACTIVE" | "ERROR";
270
+ name: string;
271
+ provider: string;
272
+ configuration: Record<string, any>;
273
+ syncFrequency: "HOURLY" | "DAILY" | "WEEKLY" | "REAL_TIME" | "MANUAL";
274
+ description?: string | undefined;
275
+ credentials?: Record<string, string> | undefined;
276
+ lastSyncAt?: string | undefined;
277
+ lastErrorAt?: string | undefined;
278
+ lastErrorMessage?: string | undefined;
279
+ }, {
280
+ id: string;
281
+ createdAt: string;
282
+ updatedAt: string;
283
+ type: "ACCOUNTING" | "PROJECT_MANAGEMENT" | "CRM" | "HR" | "DOCUMENT_STORAGE" | "REPORTING" | "API" | "WEBHOOK";
284
+ status: "ACTIVE" | "PENDING" | "INACTIVE" | "ERROR";
285
+ name: string;
286
+ provider: string;
287
+ configuration: Record<string, any>;
288
+ isActive?: boolean | undefined;
289
+ description?: string | undefined;
290
+ credentials?: Record<string, string> | undefined;
291
+ lastSyncAt?: string | undefined;
292
+ lastErrorAt?: string | undefined;
293
+ lastErrorMessage?: string | undefined;
294
+ syncFrequency?: "HOURLY" | "DAILY" | "WEEKLY" | "REAL_TIME" | "MANUAL" | undefined;
295
+ }>;
296
+ }, "strip", z.ZodTypeAny, {
297
+ id: string;
298
+ type: "integrations";
299
+ attributes: {
300
+ id: string;
301
+ createdAt: string;
302
+ updatedAt: string;
303
+ isActive: boolean;
304
+ type: "ACCOUNTING" | "PROJECT_MANAGEMENT" | "CRM" | "HR" | "DOCUMENT_STORAGE" | "REPORTING" | "API" | "WEBHOOK";
305
+ status: "ACTIVE" | "PENDING" | "INACTIVE" | "ERROR";
306
+ name: string;
307
+ provider: string;
308
+ configuration: Record<string, any>;
309
+ syncFrequency: "HOURLY" | "DAILY" | "WEEKLY" | "REAL_TIME" | "MANUAL";
310
+ description?: string | undefined;
311
+ credentials?: Record<string, string> | undefined;
312
+ lastSyncAt?: string | undefined;
313
+ lastErrorAt?: string | undefined;
314
+ lastErrorMessage?: string | undefined;
315
+ };
316
+ }, {
317
+ id: string;
318
+ type: "integrations";
319
+ attributes: {
320
+ id: string;
321
+ createdAt: string;
322
+ updatedAt: string;
323
+ type: "ACCOUNTING" | "PROJECT_MANAGEMENT" | "CRM" | "HR" | "DOCUMENT_STORAGE" | "REPORTING" | "API" | "WEBHOOK";
324
+ status: "ACTIVE" | "PENDING" | "INACTIVE" | "ERROR";
325
+ name: string;
326
+ provider: string;
327
+ configuration: Record<string, any>;
328
+ isActive?: boolean | undefined;
329
+ description?: string | undefined;
330
+ credentials?: Record<string, string> | undefined;
331
+ lastSyncAt?: string | undefined;
332
+ lastErrorAt?: string | undefined;
333
+ lastErrorMessage?: string | undefined;
334
+ syncFrequency?: "HOURLY" | "DAILY" | "WEEKLY" | "REAL_TIME" | "MANUAL" | undefined;
335
+ };
336
+ }>;
337
+ export declare const WebhookResourceSchema: z.ZodObject<{
338
+ type: z.ZodLiteral<"webhooks">;
339
+ id: z.ZodString;
340
+ attributes: z.ZodObject<{
341
+ id: z.ZodString;
342
+ name: z.ZodString;
343
+ url: z.ZodString;
344
+ events: z.ZodArray<z.ZodString, "many">;
345
+ isActive: z.ZodDefault<z.ZodBoolean>;
346
+ secret: z.ZodOptional<z.ZodString>;
347
+ lastTriggeredAt: z.ZodOptional<z.ZodString>;
348
+ failureCount: z.ZodDefault<z.ZodNumber>;
349
+ maxRetries: z.ZodDefault<z.ZodNumber>;
350
+ retryDelay: z.ZodDefault<z.ZodNumber>;
351
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
352
+ createdAt: z.ZodString;
353
+ updatedAt: z.ZodString;
354
+ }, "strip", z.ZodTypeAny, {
355
+ id: string;
356
+ createdAt: string;
357
+ updatedAt: string;
358
+ isActive: boolean;
359
+ name: string;
360
+ url: string;
361
+ events: string[];
362
+ failureCount: number;
363
+ maxRetries: number;
364
+ retryDelay: number;
365
+ secret?: string | undefined;
366
+ headers?: Record<string, string> | undefined;
367
+ lastTriggeredAt?: string | undefined;
368
+ }, {
369
+ id: string;
370
+ createdAt: string;
371
+ updatedAt: string;
372
+ name: string;
373
+ url: string;
374
+ events: string[];
375
+ isActive?: boolean | undefined;
376
+ secret?: string | undefined;
377
+ headers?: Record<string, string> | undefined;
378
+ lastTriggeredAt?: string | undefined;
379
+ failureCount?: number | undefined;
380
+ maxRetries?: number | undefined;
381
+ retryDelay?: number | undefined;
382
+ }>;
383
+ }, "strip", z.ZodTypeAny, {
384
+ id: string;
385
+ type: "webhooks";
386
+ attributes: {
387
+ id: string;
388
+ createdAt: string;
389
+ updatedAt: string;
390
+ isActive: boolean;
391
+ name: string;
392
+ url: string;
393
+ events: string[];
394
+ failureCount: number;
395
+ maxRetries: number;
396
+ retryDelay: number;
397
+ secret?: string | undefined;
398
+ headers?: Record<string, string> | undefined;
399
+ lastTriggeredAt?: string | undefined;
400
+ };
401
+ }, {
402
+ id: string;
403
+ type: "webhooks";
404
+ attributes: {
405
+ id: string;
406
+ createdAt: string;
407
+ updatedAt: string;
408
+ name: string;
409
+ url: string;
410
+ events: string[];
411
+ isActive?: boolean | undefined;
412
+ secret?: string | undefined;
413
+ headers?: Record<string, string> | undefined;
414
+ lastTriggeredAt?: string | undefined;
415
+ failureCount?: number | undefined;
416
+ maxRetries?: number | undefined;
417
+ retryDelay?: number | undefined;
418
+ };
419
+ }>;
420
+ export declare const SyncLogResourceSchema: z.ZodObject<{
421
+ type: z.ZodLiteral<"sync-logs">;
422
+ id: z.ZodString;
423
+ attributes: z.ZodObject<{
424
+ id: z.ZodString;
425
+ integrationId: z.ZodString;
426
+ status: z.ZodEnum<["SUCCESS", "FAILED", "PARTIAL", "IN_PROGRESS"]>;
427
+ recordsProcessed: z.ZodDefault<z.ZodNumber>;
428
+ recordsSuccess: z.ZodDefault<z.ZodNumber>;
429
+ recordsFailed: z.ZodDefault<z.ZodNumber>;
430
+ startedAt: z.ZodString;
431
+ completedAt: z.ZodOptional<z.ZodString>;
432
+ duration: z.ZodOptional<z.ZodNumber>;
433
+ errorMessage: z.ZodOptional<z.ZodString>;
434
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
435
+ createdAt: z.ZodString;
436
+ }, "strip", z.ZodTypeAny, {
437
+ id: string;
438
+ createdAt: string;
439
+ status: "IN_PROGRESS" | "SUCCESS" | "FAILED" | "PARTIAL";
440
+ startedAt: string;
441
+ integrationId: string;
442
+ recordsProcessed: number;
443
+ recordsSuccess: number;
444
+ recordsFailed: number;
445
+ metadata?: Record<string, any> | undefined;
446
+ completedAt?: string | undefined;
447
+ duration?: number | undefined;
448
+ errorMessage?: string | undefined;
449
+ }, {
450
+ id: string;
451
+ createdAt: string;
452
+ status: "IN_PROGRESS" | "SUCCESS" | "FAILED" | "PARTIAL";
453
+ startedAt: string;
454
+ integrationId: string;
455
+ metadata?: Record<string, any> | undefined;
456
+ completedAt?: string | undefined;
457
+ recordsProcessed?: number | undefined;
458
+ recordsSuccess?: number | undefined;
459
+ recordsFailed?: number | undefined;
460
+ duration?: number | undefined;
461
+ errorMessage?: string | undefined;
462
+ }>;
463
+ }, "strip", z.ZodTypeAny, {
464
+ id: string;
465
+ type: "sync-logs";
466
+ attributes: {
467
+ id: string;
468
+ createdAt: string;
469
+ status: "IN_PROGRESS" | "SUCCESS" | "FAILED" | "PARTIAL";
470
+ startedAt: string;
471
+ integrationId: string;
472
+ recordsProcessed: number;
473
+ recordsSuccess: number;
474
+ recordsFailed: number;
475
+ metadata?: Record<string, any> | undefined;
476
+ completedAt?: string | undefined;
477
+ duration?: number | undefined;
478
+ errorMessage?: string | undefined;
479
+ };
480
+ }, {
481
+ id: string;
482
+ type: "sync-logs";
483
+ attributes: {
484
+ id: string;
485
+ createdAt: string;
486
+ status: "IN_PROGRESS" | "SUCCESS" | "FAILED" | "PARTIAL";
487
+ startedAt: string;
488
+ integrationId: string;
489
+ metadata?: Record<string, any> | undefined;
490
+ completedAt?: string | undefined;
491
+ recordsProcessed?: number | undefined;
492
+ recordsSuccess?: number | undefined;
493
+ recordsFailed?: number | undefined;
494
+ duration?: number | undefined;
495
+ errorMessage?: string | undefined;
496
+ };
497
+ }>;
498
+ export type Integration = z.infer<typeof IntegrationSchema>;
499
+ export type Webhook = z.infer<typeof WebhookSchema>;
500
+ export type SyncLog = z.infer<typeof SyncLogSchema>;
501
+ export type CreateIntegrationRequest = z.infer<typeof CreateIntegrationRequestSchema>;
502
+ export type UpdateIntegrationRequest = z.infer<typeof UpdateIntegrationRequestSchema>;
503
+ export type CreateWebhookRequest = z.infer<typeof CreateWebhookRequestSchema>;
504
+ export type UpdateWebhookRequest = z.infer<typeof UpdateWebhookRequestSchema>;
505
+ export type IntegrationResource = z.infer<typeof IntegrationResourceSchema>;
506
+ export type WebhookResource = z.infer<typeof WebhookResourceSchema>;
507
+ export type SyncLogResource = z.infer<typeof SyncLogResourceSchema>;
508
+ //# sourceMappingURL=integrations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../../src/schemas/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,qBAAqB,iHAShC,CAAC;AAEH,eAAO,MAAM,uBAAuB,uDAAqD,CAAC;AAE1F,eAAO,MAAM,mBAAmB,iEAA+D,CAAC;AAEhG,eAAO,MAAM,mBAAmB,4DAA0D,CAAC;AAI3F,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgB5B,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcxB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAaxB,CAAC;AAIH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;EASzC,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;EAOzC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;EASrC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;EASrC,CAAC;AAIH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIpC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIhC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIhC,CAAC;AAIH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACtF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACtF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -0,0 +1,119 @@
1
+ import { z } from 'zod';
2
+ import { CuidSchema } from './common';
3
+ // ===== ENUMS =====
4
+ export const IntegrationTypeSchema = z.enum([
5
+ 'ACCOUNTING',
6
+ 'PROJECT_MANAGEMENT',
7
+ 'CRM',
8
+ 'HR',
9
+ 'DOCUMENT_STORAGE',
10
+ 'REPORTING',
11
+ 'API',
12
+ 'WEBHOOK',
13
+ ]);
14
+ export const IntegrationStatusSchema = z.enum(['ACTIVE', 'INACTIVE', 'ERROR', 'PENDING']);
15
+ export const SyncFrequencySchema = z.enum(['REAL_TIME', 'HOURLY', 'DAILY', 'WEEKLY', 'MANUAL']);
16
+ export const SyncLogStatusSchema = z.enum(['SUCCESS', 'FAILED', 'PARTIAL', 'IN_PROGRESS']);
17
+ // ===== CORE SCHEMAS =====
18
+ export const IntegrationSchema = z.object({
19
+ id: CuidSchema,
20
+ name: z.string(),
21
+ type: IntegrationTypeSchema,
22
+ status: IntegrationStatusSchema,
23
+ provider: z.string(),
24
+ description: z.string().optional(),
25
+ configuration: z.record(z.any()),
26
+ credentials: z.record(z.string()).optional(),
27
+ lastSyncAt: z.string().datetime().optional(),
28
+ lastErrorAt: z.string().datetime().optional(),
29
+ lastErrorMessage: z.string().optional(),
30
+ syncFrequency: SyncFrequencySchema.default('DAILY'),
31
+ isActive: z.boolean().default(true),
32
+ createdAt: z.string().datetime(),
33
+ updatedAt: z.string().datetime(),
34
+ });
35
+ export const WebhookSchema = z.object({
36
+ id: CuidSchema,
37
+ name: z.string(),
38
+ url: z.string().url(),
39
+ events: z.array(z.string()),
40
+ isActive: z.boolean().default(true),
41
+ secret: z.string().optional(),
42
+ lastTriggeredAt: z.string().datetime().optional(),
43
+ failureCount: z.number().default(0),
44
+ maxRetries: z.number().default(3),
45
+ retryDelay: z.number().default(60),
46
+ headers: z.record(z.string()).optional(),
47
+ createdAt: z.string().datetime(),
48
+ updatedAt: z.string().datetime(),
49
+ });
50
+ export const SyncLogSchema = z.object({
51
+ id: CuidSchema,
52
+ integrationId: CuidSchema,
53
+ status: SyncLogStatusSchema,
54
+ recordsProcessed: z.number().default(0),
55
+ recordsSuccess: z.number().default(0),
56
+ recordsFailed: z.number().default(0),
57
+ startedAt: z.string().datetime(),
58
+ completedAt: z.string().datetime().optional(),
59
+ duration: z.number().optional(),
60
+ errorMessage: z.string().optional(),
61
+ metadata: z.record(z.any()).optional(),
62
+ createdAt: z.string().datetime(),
63
+ });
64
+ // ===== REQUEST SCHEMAS =====
65
+ export const CreateIntegrationRequestSchema = z.object({
66
+ name: z.string().min(1).max(200),
67
+ type: IntegrationTypeSchema,
68
+ provider: z.string().min(1).max(100),
69
+ description: z.string().max(500).optional(),
70
+ configuration: z.record(z.any()),
71
+ credentials: z.record(z.string()).optional(),
72
+ syncFrequency: SyncFrequencySchema.default('DAILY'),
73
+ isActive: z.boolean().default(true),
74
+ });
75
+ export const UpdateIntegrationRequestSchema = z.object({
76
+ name: z.string().min(1).max(200).optional(),
77
+ description: z.string().max(500).optional(),
78
+ configuration: z.record(z.any()).optional(),
79
+ credentials: z.record(z.string()).optional(),
80
+ syncFrequency: SyncFrequencySchema.optional(),
81
+ isActive: z.boolean().optional(),
82
+ });
83
+ export const CreateWebhookRequestSchema = z.object({
84
+ name: z.string().min(1).max(200),
85
+ url: z.string().url(),
86
+ events: z.array(z.string()).min(1),
87
+ secret: z.string().optional(),
88
+ maxRetries: z.number().min(0).max(10).default(3),
89
+ retryDelay: z.number().min(1).max(3600).default(60),
90
+ headers: z.record(z.string()).optional(),
91
+ isActive: z.boolean().default(true),
92
+ });
93
+ export const UpdateWebhookRequestSchema = z.object({
94
+ name: z.string().min(1).max(200).optional(),
95
+ url: z.string().url().optional(),
96
+ events: z.array(z.string()).min(1).optional(),
97
+ secret: z.string().optional(),
98
+ maxRetries: z.number().min(0).max(10).optional(),
99
+ retryDelay: z.number().min(1).max(3600).optional(),
100
+ headers: z.record(z.string()).optional(),
101
+ isActive: z.boolean().optional(),
102
+ });
103
+ // ===== JSON:API RESOURCE SCHEMAS =====
104
+ export const IntegrationResourceSchema = z.object({
105
+ type: z.literal('integrations'),
106
+ id: z.string(),
107
+ attributes: IntegrationSchema,
108
+ });
109
+ export const WebhookResourceSchema = z.object({
110
+ type: z.literal('webhooks'),
111
+ id: z.string(),
112
+ attributes: WebhookSchema,
113
+ });
114
+ export const SyncLogResourceSchema = z.object({
115
+ type: z.literal('sync-logs'),
116
+ id: z.string(),
117
+ attributes: SyncLogSchema,
118
+ });
119
+ //# sourceMappingURL=integrations.js.map