@pactosigna/schemas 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -6,10 +6,10 @@ import {
6
6
  inferDocumentType
7
7
  } from "./chunk-XP2LBTDS.js";
8
8
 
9
- // ../shared/dist/schemas/index.js
10
- import { z as z24 } from "zod";
9
+ // ../contracts/dist/commonSchemas.js
10
+ import { z as z2 } from "zod";
11
11
 
12
- // ../shared/dist/schemas/common-enums.js
12
+ // ../contracts/dist/domain-schemas/common-enums.js
13
13
  import { z } from "zod";
14
14
  var RegulatoryFrameworkSchema = z.enum([
15
15
  "ISO_13485",
@@ -105,9 +105,224 @@ var LinkTypeSchema = z.enum([
105
105
  var AcceptabilityStatusSchema = z.enum(["acceptable", "review_required", "unacceptable"]);
106
106
  var DepartmentRoleSchema = z.enum(["manager", "member"]);
107
107
 
108
- // ../shared/dist/schemas/risk.js
109
- import { z as z2 } from "zod";
110
- var RiskDocumentStatusSchema = z2.enum([
108
+ // ../contracts/dist/commonSchemas.js
109
+ var ErrorResponseSchema = z2.object({
110
+ error: z2.string(),
111
+ code: z2.string().optional(),
112
+ details: z2.record(z2.unknown()).optional()
113
+ });
114
+ var PaginationParamsSchema = z2.object({
115
+ limit: z2.coerce.number().min(1).max(100).optional().default(50),
116
+ offset: z2.coerce.number().min(0).optional().default(0)
117
+ });
118
+
119
+ // ../contracts/dist/identity/requests.js
120
+ import { z as z3 } from "zod";
121
+ var RegulatoryFrameworkSchema2 = z3.enum([
122
+ "ISO_13485",
123
+ "IEC_62304",
124
+ "FDA_21_CFR_820",
125
+ "QMSR",
126
+ "EU_MDR",
127
+ "ISO_14971",
128
+ "AI_ACT"
129
+ ]);
130
+ var RoleSchema = z3.enum(["admin", "member", "auditor"]);
131
+ var DepartmentRoleSchema2 = z3.enum(["manager", "member"]);
132
+ var AuditorTypeSchema = z3.enum(["internal", "external"]);
133
+ var ReviewerRuleSchema = z3.object({
134
+ documentType: z3.string(),
135
+ requiredDepartments: z3.array(z3.string()),
136
+ finalApproverDepartment: z3.string()
137
+ });
138
+ var CreateOrganizationRequestSchema = z3.object({
139
+ name: z3.string().min(3).max(100),
140
+ frameworks: z3.array(RegulatoryFrameworkSchema2).min(1),
141
+ department: z3.string().min(1)
142
+ });
143
+ var ChecklistTemplateItemSchema = z3.object({
144
+ id: z3.string().min(1),
145
+ label: z3.string().min(1).max(500),
146
+ sortOrder: z3.number().int().nonnegative()
147
+ });
148
+ var UpdateOrganizationSettingsRequestSchema = z3.object({
149
+ name: z3.string().min(1).optional(),
150
+ frameworks: z3.array(RegulatoryFrameworkSchema2).optional(),
151
+ departments: z3.array(z3.string()).optional(),
152
+ reviewerRules: z3.array(ReviewerRuleSchema).optional(),
153
+ releaseChecklistTemplate: z3.array(ChecklistTemplateItemSchema).max(30).optional()
154
+ });
155
+ var UpdateMemberRequestSchema = z3.object({
156
+ department: z3.string().optional(),
157
+ role: RoleSchema.optional(),
158
+ departmentRole: DepartmentRoleSchema2.optional()
159
+ });
160
+ var InviteUserRequestSchema = z3.object({
161
+ email: z3.string().email(),
162
+ department: z3.string().min(1),
163
+ role: RoleSchema,
164
+ departmentRole: DepartmentRoleSchema2.optional(),
165
+ auditorType: AuditorTypeSchema.optional(),
166
+ accessExpiresAt: z3.string().datetime().optional()
167
+ }).superRefine((data, ctx) => {
168
+ if (data.role === "auditor" && !data.auditorType) {
169
+ ctx.addIssue({
170
+ code: z3.ZodIssueCode.custom,
171
+ message: "auditorType is required when role is auditor",
172
+ path: ["auditorType"]
173
+ });
174
+ }
175
+ if (data.role !== "auditor" && data.auditorType) {
176
+ ctx.addIssue({
177
+ code: z3.ZodIssueCode.custom,
178
+ message: "auditorType is only valid for auditor role",
179
+ path: ["auditorType"]
180
+ });
181
+ }
182
+ if (data.role !== "auditor" && data.accessExpiresAt) {
183
+ ctx.addIssue({
184
+ code: z3.ZodIssueCode.custom,
185
+ message: "accessExpiresAt is only valid for auditor role",
186
+ path: ["accessExpiresAt"]
187
+ });
188
+ }
189
+ });
190
+ var AcceptInviteRequestSchema = z3.object({
191
+ token: z3.string().min(1)
192
+ });
193
+ var UpdateProfileRequestSchema = z3.object({
194
+ displayName: z3.string().min(1).max(100).optional()
195
+ });
196
+ var OrgIdParamSchema = z3.object({
197
+ orgId: z3.string().min(1)
198
+ });
199
+ var MemberIdParamSchema = z3.object({
200
+ orgId: z3.string().min(1),
201
+ memberId: z3.string().min(1)
202
+ });
203
+ var InviteIdParamSchema = z3.object({
204
+ orgId: z3.string().min(1),
205
+ inviteId: z3.string().min(1)
206
+ });
207
+
208
+ // ../contracts/dist/identity/responses.js
209
+ import { z as z5 } from "zod";
210
+
211
+ // ../contracts/dist/billing/responses.js
212
+ import { z as z4 } from "zod";
213
+ var SubscriptionStatusSchema = z4.enum([
214
+ "active",
215
+ "trialing",
216
+ "past_due",
217
+ "canceled",
218
+ "incomplete"
219
+ ]);
220
+ var SubscriptionResponseSchema = z4.object({
221
+ status: SubscriptionStatusSchema,
222
+ currentPeriodEnd: z4.string(),
223
+ cancelAtPeriodEnd: z4.boolean()
224
+ });
225
+ var CreateCheckoutSessionResponseSchema = z4.object({
226
+ checkoutUrl: z4.string().url()
227
+ });
228
+ var CreatePortalSessionResponseSchema = z4.object({
229
+ portalUrl: z4.string().url()
230
+ });
231
+
232
+ // ../contracts/dist/identity/responses.js
233
+ var MemberStatusSchema = z5.enum(["active", "suspended", "removed"]);
234
+ var InviteStatusSchema = z5.enum(["pending", "accepted", "expired", "revoked"]);
235
+ var MemberResponseSchema = z5.object({
236
+ id: z5.string(),
237
+ email: z5.string().email(),
238
+ emailVerified: z5.boolean(),
239
+ displayName: z5.string(),
240
+ department: z5.string(),
241
+ departmentRole: DepartmentRoleSchema2.optional(),
242
+ role: RoleSchema,
243
+ auditorType: AuditorTypeSchema.optional(),
244
+ accessExpiresAt: z5.string().optional(),
245
+ // ISO date (for external auditors)
246
+ status: MemberStatusSchema,
247
+ joinedAt: z5.string()
248
+ // ISO date
249
+ });
250
+ var InviteResponseSchema = z5.object({
251
+ id: z5.string(),
252
+ email: z5.string().email(),
253
+ department: z5.string(),
254
+ role: RoleSchema,
255
+ status: InviteStatusSchema,
256
+ expiresAt: z5.string(),
257
+ // ISO date
258
+ createdAt: z5.string()
259
+ // ISO date
260
+ });
261
+ var OrganizationResponseSchema = z5.object({
262
+ id: z5.string(),
263
+ name: z5.string(),
264
+ role: RoleSchema,
265
+ department: z5.string(),
266
+ gitHubAppInstallationId: z5.number().optional(),
267
+ gitHubOrgName: z5.string().optional(),
268
+ subscription: SubscriptionResponseSchema.optional()
269
+ });
270
+ var OrganizationSettingsResponseSchema = z5.object({
271
+ frameworks: z5.array(z5.string()),
272
+ departments: z5.array(z5.string()),
273
+ defaultSafetyClass: SafetyClassSchema,
274
+ reviewerRules: z5.array(ReviewerRuleSchema),
275
+ releaseChecklistTemplate: z5.array(ChecklistTemplateItemSchema).optional()
276
+ });
277
+ var CreateOrganizationResponseSchema = z5.object({
278
+ organizationId: z5.string()
279
+ });
280
+ var GetOrganizationsResponseSchema = z5.object({
281
+ organizations: z5.array(OrganizationResponseSchema)
282
+ });
283
+ var GetMembersResponseSchema = z5.object({
284
+ members: z5.array(MemberResponseSchema)
285
+ });
286
+ var GetInvitesResponseSchema = z5.object({
287
+ invites: z5.array(InviteResponseSchema)
288
+ });
289
+ var AcceptInviteResponseSchema = z5.object({
290
+ organizationId: z5.string(),
291
+ organizationName: z5.string()
292
+ });
293
+ var PendingInviteResponseSchema = z5.object({
294
+ id: z5.string(),
295
+ organizationId: z5.string(),
296
+ organizationName: z5.string(),
297
+ invitedByName: z5.string(),
298
+ role: RoleSchema,
299
+ department: z5.string(),
300
+ createdAt: z5.string(),
301
+ expiresAt: z5.string()
302
+ });
303
+ var GetPendingInvitesResponseSchema = z5.object({
304
+ invites: z5.array(PendingInviteResponseSchema)
305
+ });
306
+ var SuccessResponseSchema = z5.object({
307
+ success: z5.boolean()
308
+ });
309
+ var ValidateInviteResponseSchema = z5.object({
310
+ organizationName: z5.string(),
311
+ status: InviteStatusSchema
312
+ });
313
+ var CreateInviteResponseSchema = z5.object({
314
+ inviteId: z5.string()
315
+ });
316
+
317
+ // ../contracts/dist/identity/legal-requests.js
318
+ import { z as z29 } from "zod";
319
+
320
+ // ../contracts/dist/domain-schemas/index.js
321
+ import { z as z28 } from "zod";
322
+
323
+ // ../contracts/dist/domain-schemas/risk.js
324
+ import { z as z6 } from "zod";
325
+ var RiskDocumentStatusSchema = z6.enum([
111
326
  "draft",
112
327
  "in_review",
113
328
  "approved",
@@ -115,12 +330,12 @@ var RiskDocumentStatusSchema = z2.enum([
115
330
  "archived",
116
331
  "example"
117
332
  ]);
118
- var MitigationTargetSchema = z2.enum([
333
+ var MitigationTargetSchema = z6.enum([
119
334
  "sequence_probability",
120
335
  "harm_probability",
121
336
  "severity"
122
337
  ]);
123
- var RiskGapCodeSchema = z2.enum([
338
+ var RiskGapCodeSchema = z6.enum([
124
339
  "hazard_no_situation",
125
340
  "situation_no_harm",
126
341
  "hazard_not_analyzed",
@@ -139,31 +354,31 @@ var RiskGapCodeSchema = z2.enum([
139
354
  "haz_invalid_category",
140
355
  "category_not_approved"
141
356
  ]);
142
- var RiskGapSeveritySchema = z2.enum(["error", "warning"]);
143
- var MitigationSchema = z2.object({
144
- control: z2.string().min(1),
357
+ var RiskGapSeveritySchema = z6.enum(["error", "warning"]);
358
+ var MitigationSchema = z6.object({
359
+ control: z6.string().min(1),
145
360
  reduces: MitigationTargetSchema,
146
- for_harm: z2.string().optional()
147
- });
148
- var HarmAssessmentSchema = z2.object({
149
- harm: z2.string().min(1),
150
- inherent_probability: z2.number().int().min(1).max(5).optional(),
151
- inherent_exploitability: z2.number().int().min(1).max(5).optional(),
152
- residual_probability: z2.number().int().min(1).max(5).optional(),
153
- residual_exploitability: z2.number().int().min(1).max(5).optional(),
154
- residual_severity_override: z2.number().int().min(1).max(5).optional()
155
- });
156
- var RiskEntryFrontmatterSchema = z2.object({
157
- type: z2.enum(["software_risk", "usability_risk", "security_risk"]),
158
- id: z2.string().min(1),
159
- title: z2.string().min(1),
361
+ for_harm: z6.string().optional()
362
+ });
363
+ var HarmAssessmentSchema = z6.object({
364
+ harm: z6.string().min(1),
365
+ inherent_probability: z6.number().int().min(1).max(5).optional(),
366
+ inherent_exploitability: z6.number().int().min(1).max(5).optional(),
367
+ residual_probability: z6.number().int().min(1).max(5).optional(),
368
+ residual_exploitability: z6.number().int().min(1).max(5).optional(),
369
+ residual_severity_override: z6.number().int().min(1).max(5).optional()
370
+ });
371
+ var RiskEntryFrontmatterSchema = z6.object({
372
+ type: z6.enum(["software_risk", "usability_risk", "security_risk"]),
373
+ id: z6.string().min(1),
374
+ title: z6.string().min(1),
160
375
  status: RiskDocumentStatusSchema,
161
- analyzes: z2.string().min(1),
162
- hazardous_situation: z2.string().min(1),
163
- harm_assessments: z2.array(HarmAssessmentSchema).min(1),
164
- mitigations: z2.array(MitigationSchema).optional(),
165
- cvss_score: z2.number().min(0).max(10).optional(),
166
- cvss_vector: z2.string().regex(/^CVSS:3\.[01]\/AV:[NALP]\/AC:[LH]\/PR:[NLH]\/UI:[NR]\/S:[UC]\/C:[NLH]\/I:[NLH]\/A:[NLH]$/).optional()
376
+ analyzes: z6.string().min(1),
377
+ hazardous_situation: z6.string().min(1),
378
+ harm_assessments: z6.array(HarmAssessmentSchema).min(1),
379
+ mitigations: z6.array(MitigationSchema).optional(),
380
+ cvss_score: z6.number().min(0).max(10).optional(),
381
+ cvss_vector: z6.string().regex(/^CVSS:3\.[01]\/AV:[NALP]\/AC:[LH]\/PR:[NLH]\/UI:[NR]\/S:[UC]\/C:[NLH]\/I:[NLH]\/A:[NLH]$/).optional()
167
382
  }).refine((data) => {
168
383
  if (data.type === "security_risk") {
169
384
  return data.harm_assessments.every((ha) => ha.inherent_exploitability != null);
@@ -172,242 +387,118 @@ var RiskEntryFrontmatterSchema = z2.object({
172
387
  }, {
173
388
  message: "Security risks must use inherent_exploitability; software/usability risks must use inherent_probability"
174
389
  });
175
- var HazardFrontmatterSchema = z2.object({
176
- type: z2.enum(["haz_soe_software", "haz_soe_security"]),
177
- id: z2.string().min(1),
178
- title: z2.string().min(1),
390
+ var HazardFrontmatterSchema = z6.object({
391
+ type: z6.enum(["haz_soe_software", "haz_soe_security"]),
392
+ id: z6.string().min(1),
393
+ title: z6.string().min(1),
179
394
  status: RiskDocumentStatusSchema,
180
- leads_to: z2.array(z2.string()).optional(),
395
+ leads_to: z6.array(z6.string()).optional(),
181
396
  // sFMEA fields
182
- failure_mode: z2.string().optional(),
183
- cause: z2.string().optional(),
184
- detection_method: z2.string().optional(),
397
+ failure_mode: z6.string().optional(),
398
+ cause: z6.string().optional(),
399
+ detection_method: z6.string().optional(),
185
400
  // STRIDE fields
186
- threat_category: z2.string().optional(),
187
- attack_vector: z2.string().optional(),
401
+ threat_category: z6.string().optional(),
402
+ attack_vector: z6.string().optional(),
188
403
  // Hazard category reference (HC-xxx)
189
- hazard_category: z2.string().optional()
404
+ hazard_category: z6.string().optional()
190
405
  });
191
- var HazardCategoryFrontmatterSchema = z2.object({
192
- type: z2.literal("hazard_category"),
193
- id: z2.string().min(1),
194
- title: z2.string().min(1),
406
+ var HazardCategoryFrontmatterSchema = z6.object({
407
+ type: z6.literal("hazard_category"),
408
+ id: z6.string().min(1),
409
+ title: z6.string().min(1),
195
410
  status: RiskDocumentStatusSchema,
196
- source: z2.string().optional()
411
+ source: z6.string().optional()
197
412
  });
198
- var HazardousSituationFrontmatterSchema = z2.object({
199
- type: z2.literal("hazardous_situation"),
200
- id: z2.string().min(1),
201
- title: z2.string().min(1),
413
+ var HazardousSituationFrontmatterSchema = z6.object({
414
+ type: z6.literal("hazardous_situation"),
415
+ id: z6.string().min(1),
416
+ title: z6.string().min(1),
202
417
  status: RiskDocumentStatusSchema,
203
- results_in: z2.array(z2.string()).optional()
418
+ results_in: z6.array(z6.string()).optional()
204
419
  });
205
- var HarmFrontmatterSchema = z2.object({
206
- type: z2.literal("harm"),
207
- id: z2.string().min(1),
208
- title: z2.string().min(1),
420
+ var HarmFrontmatterSchema = z6.object({
421
+ type: z6.literal("harm"),
422
+ id: z6.string().min(1),
423
+ title: z6.string().min(1),
209
424
  status: RiskDocumentStatusSchema,
210
- severity: z2.number().int().min(1).max(5),
211
- category: z2.string().optional()
212
- });
213
- var RiskMatrixConfigSchema = z2.object({
214
- version: z2.number(),
215
- labels: z2.object({
216
- severity: z2.array(z2.string()).length(5),
217
- probability: z2.array(z2.string()).length(5),
218
- exploitability: z2.array(z2.string()).length(5).optional()
425
+ severity: z6.number().int().min(1).max(5),
426
+ category: z6.string().optional()
427
+ });
428
+ var RiskMatrixConfigSchema = z6.object({
429
+ version: z6.number(),
430
+ labels: z6.object({
431
+ severity: z6.array(z6.string()).length(5),
432
+ probability: z6.array(z6.string()).length(5),
433
+ exploitability: z6.array(z6.string()).length(5).optional()
219
434
  }),
220
- acceptability: z2.object({
221
- unacceptable: z2.array(z2.tuple([z2.number(), z2.number()])),
222
- review_required: z2.array(z2.tuple([z2.number(), z2.number()])).optional()
435
+ acceptability: z6.object({
436
+ unacceptable: z6.array(z6.tuple([z6.number(), z6.number()])),
437
+ review_required: z6.array(z6.tuple([z6.number(), z6.number()])).optional()
223
438
  }),
224
- overrides: z2.record(z2.object({
225
- unacceptable: z2.array(z2.tuple([z2.number(), z2.number()])),
226
- review_required: z2.array(z2.tuple([z2.number(), z2.number()])).optional()
439
+ overrides: z6.record(z6.object({
440
+ unacceptable: z6.array(z6.tuple([z6.number(), z6.number()])),
441
+ review_required: z6.array(z6.tuple([z6.number(), z6.number()])).optional()
227
442
  })).optional()
228
443
  });
229
444
 
230
- // ../shared/dist/schemas/usability.js
231
- import { z as z3 } from "zod";
232
- var UsabilityPlanFrontmatterSchema = z3.object({
233
- type: z3.literal("usability_plan"),
234
- id: z3.string().min(1),
235
- title: z3.string().min(1),
236
- status: RiskDocumentStatusSchema,
237
- author: z3.string().optional(),
238
- reviewers: z3.array(z3.string()).optional(),
239
- approvers: z3.array(z3.string()).optional()
240
- });
241
- var UseSpecificationFrontmatterSchema = z3.object({
242
- type: z3.literal("use_specification"),
243
- id: z3.string().min(1),
244
- title: z3.string().min(1),
245
- status: RiskDocumentStatusSchema,
246
- user_group: z3.string().min(1),
247
- author: z3.string().optional(),
248
- reviewers: z3.array(z3.string()).optional(),
249
- approvers: z3.array(z3.string()).optional()
250
- });
251
- var TaskAnalysisFrontmatterSchema = z3.object({
252
- type: z3.literal("task_analysis"),
253
- id: z3.string().min(1),
254
- title: z3.string().min(1),
255
- status: RiskDocumentStatusSchema,
256
- user_group: z3.string().min(1),
257
- critical_task: z3.boolean(),
258
- author: z3.string().optional(),
259
- reviewers: z3.array(z3.string()).optional(),
260
- approvers: z3.array(z3.string()).optional()
261
- });
262
- var UsabilityEvaluationFrontmatterSchema = z3.object({
263
- type: z3.literal("usability_evaluation"),
264
- id: z3.string().min(1),
265
- title: z3.string().min(1),
266
- status: RiskDocumentStatusSchema,
267
- result: z3.enum(["pass", "fail", "pass_with_findings"]).optional(),
268
- author: z3.string().optional(),
269
- reviewers: z3.array(z3.string()).optional(),
270
- approvers: z3.array(z3.string()).optional()
271
- });
272
- var SummativeEvaluationFrontmatterSchema = z3.object({
273
- type: z3.literal("summative_evaluation"),
274
- id: z3.string().min(1),
275
- title: z3.string().min(1),
276
- status: RiskDocumentStatusSchema,
277
- result: z3.enum(["pass", "fail", "pass_with_findings"]).optional(),
278
- author: z3.string().optional(),
279
- reviewers: z3.array(z3.string()).optional(),
280
- approvers: z3.array(z3.string()).optional()
281
- });
282
-
283
- // ../shared/dist/schemas/risk-management-plan.js
284
- import { z as z4 } from "zod";
285
- var RiskManagementPlanFrontmatterSchema = z4.object({
286
- type: z4.literal("risk_management_plan"),
287
- id: z4.string().min(1),
288
- title: z4.string().min(1),
445
+ // ../contracts/dist/domain-schemas/usability.js
446
+ import { z as z7 } from "zod";
447
+ var UsabilityPlanFrontmatterSchema = z7.object({
448
+ type: z7.literal("usability_plan"),
449
+ id: z7.string().min(1),
450
+ title: z7.string().min(1),
289
451
  status: RiskDocumentStatusSchema,
290
- author: z4.string().optional(),
291
- reviewers: z4.array(z4.string()).optional(),
292
- approvers: z4.array(z4.string()).optional()
452
+ author: z7.string().optional(),
453
+ reviewers: z7.array(z7.string()).optional(),
454
+ approvers: z7.array(z7.string()).optional()
293
455
  });
294
-
295
- // ../shared/dist/schemas/software-lifecycle.js
296
- import { z as z5 } from "zod";
297
- var SoftwareDevelopmentPlanFrontmatterSchema = z5.object({
298
- type: z5.literal("software_development_plan"),
299
- id: z5.string().min(1),
300
- title: z5.string().min(1),
301
- status: RiskDocumentStatusSchema,
302
- author: z5.string().optional(),
303
- reviewers: z5.array(z5.string()).optional(),
304
- approvers: z5.array(z5.string()).optional()
305
- });
306
- var SoftwareMaintenancePlanFrontmatterSchema = z5.object({
307
- type: z5.literal("software_maintenance_plan"),
308
- id: z5.string().min(1),
309
- title: z5.string().min(1),
310
- status: RiskDocumentStatusSchema,
311
- author: z5.string().optional(),
312
- reviewers: z5.array(z5.string()).optional(),
313
- approvers: z5.array(z5.string()).optional()
314
- });
315
- var SoupRegisterFrontmatterSchema = z5.object({
316
- type: z5.literal("soup_register"),
317
- id: z5.string().min(1),
318
- title: z5.string().min(1),
319
- status: RiskDocumentStatusSchema,
320
- author: z5.string().optional(),
321
- reviewers: z5.array(z5.string()).optional(),
322
- approvers: z5.array(z5.string()).optional()
323
- });
324
- var SoftwareTestPlanFrontmatterSchema = z5.object({
325
- type: z5.literal("software_test_plan"),
326
- id: z5.string().min(1),
327
- title: z5.string().min(1),
456
+ var UseSpecificationFrontmatterSchema = z7.object({
457
+ type: z7.literal("use_specification"),
458
+ id: z7.string().min(1),
459
+ title: z7.string().min(1),
328
460
  status: RiskDocumentStatusSchema,
329
- author: z5.string().optional(),
330
- reviewers: z5.array(z5.string()).optional(),
331
- approvers: z5.array(z5.string()).optional()
332
- });
333
-
334
- // ../shared/dist/schemas/architecture.js
335
- import { z as z6 } from "zod";
336
- var SoftwareItemTypeSchema = z6.enum(["system", "subsystem", "component", "unit"]);
337
- var SegregationSchema = z6.object({
338
- mechanism: z6.string().min(1),
339
- rationale: z6.string().min(1)
461
+ user_group: z7.string().min(1),
462
+ author: z7.string().optional(),
463
+ reviewers: z7.array(z7.string()).optional(),
464
+ approvers: z7.array(z7.string()).optional()
340
465
  });
341
- var ArchitectureFrontmatterSchema = z6.object({
342
- id: z6.string().min(1),
343
- title: z6.string().min(1),
344
- type: z6.literal("architecture"),
466
+ var TaskAnalysisFrontmatterSchema = z7.object({
467
+ type: z7.literal("task_analysis"),
468
+ id: z7.string().min(1),
469
+ title: z7.string().min(1),
345
470
  status: RiskDocumentStatusSchema,
346
- software_item_type: SoftwareItemTypeSchema.optional(),
347
- parent_item: z6.string().optional(),
348
- safety_class: z6.enum(["A", "B", "C"]).optional(),
349
- segregation: SegregationSchema.optional(),
350
- author: z6.string().optional(),
351
- reviewers: z6.array(z6.string()).optional(),
352
- approvers: z6.array(z6.string()).optional()
471
+ user_group: z7.string().min(1),
472
+ critical_task: z7.boolean(),
473
+ author: z7.string().optional(),
474
+ reviewers: z7.array(z7.string()).optional(),
475
+ approvers: z7.array(z7.string()).optional()
353
476
  });
354
- var DetailedDesignFrontmatterSchema = z6.object({
355
- id: z6.string().min(1),
356
- title: z6.string().min(1),
357
- type: z6.literal("detailed_design"),
477
+ var UsabilityEvaluationFrontmatterSchema = z7.object({
478
+ type: z7.literal("usability_evaluation"),
479
+ id: z7.string().min(1),
480
+ title: z7.string().min(1),
358
481
  status: RiskDocumentStatusSchema,
359
- software_item_type: SoftwareItemTypeSchema.optional(),
360
- parent_item: z6.string().optional(),
361
- safety_class: z6.enum(["A", "B", "C"]).optional(),
362
- segregation: SegregationSchema.optional(),
363
- author: z6.string().optional(),
364
- reviewers: z6.array(z6.string()).optional(),
365
- approvers: z6.array(z6.string()).optional()
482
+ result: z7.enum(["pass", "fail", "pass_with_findings"]).optional(),
483
+ author: z7.string().optional(),
484
+ reviewers: z7.array(z7.string()).optional(),
485
+ approvers: z7.array(z7.string()).optional()
366
486
  });
367
-
368
- // ../shared/dist/schemas/anomaly.js
369
- import { z as z7 } from "zod";
370
- var AnomalyCategorySchema = z7.enum([
371
- "bug",
372
- "security_vulnerability",
373
- "regression",
374
- "performance"
375
- ]);
376
- var AnomalySeveritySchema = z7.enum(["critical", "major", "minor"]);
377
- var AnomalyDispositionSchema = z7.enum([
378
- "open",
379
- "investigating",
380
- "resolved",
381
- "deferred",
382
- "will_not_fix"
383
- ]);
384
- var AnomalyFrontmatterSchema = z7.object({
385
- type: z7.literal("anomaly"),
487
+ var SummativeEvaluationFrontmatterSchema = z7.object({
488
+ type: z7.literal("summative_evaluation"),
386
489
  id: z7.string().min(1),
387
490
  title: z7.string().min(1),
388
491
  status: RiskDocumentStatusSchema,
389
- category: AnomalyCategorySchema,
390
- severity: AnomalySeveritySchema,
391
- disposition: AnomalyDispositionSchema,
392
- affected_version: z7.string().optional(),
492
+ result: z7.enum(["pass", "fail", "pass_with_findings"]).optional(),
393
493
  author: z7.string().optional(),
394
494
  reviewers: z7.array(z7.string()).optional(),
395
495
  approvers: z7.array(z7.string()).optional()
396
496
  });
397
497
 
398
- // ../shared/dist/schemas/cybersecurity.js
498
+ // ../contracts/dist/domain-schemas/risk-management-plan.js
399
499
  import { z as z8 } from "zod";
400
- var CybersecurityPlanFrontmatterSchema = z8.object({
401
- type: z8.literal("cybersecurity_plan"),
402
- id: z8.string().min(1),
403
- title: z8.string().min(1),
404
- status: RiskDocumentStatusSchema,
405
- author: z8.string().optional(),
406
- reviewers: z8.array(z8.string()).optional(),
407
- approvers: z8.array(z8.string()).optional()
408
- });
409
- var SbomFrontmatterSchema = z8.object({
410
- type: z8.literal("sbom"),
500
+ var RiskManagementPlanFrontmatterSchema = z8.object({
501
+ type: z8.literal("risk_management_plan"),
411
502
  id: z8.string().min(1),
412
503
  title: z8.string().min(1),
413
504
  status: RiskDocumentStatusSchema,
@@ -416,10 +507,28 @@ var SbomFrontmatterSchema = z8.object({
416
507
  approvers: z8.array(z8.string()).optional()
417
508
  });
418
509
 
419
- // ../shared/dist/schemas/clinical.js
510
+ // ../contracts/dist/domain-schemas/software-lifecycle.js
420
511
  import { z as z9 } from "zod";
421
- var ClinicalEvaluationPlanFrontmatterSchema = z9.object({
422
- type: z9.literal("clinical_evaluation_plan"),
512
+ var SoftwareDevelopmentPlanFrontmatterSchema = z9.object({
513
+ type: z9.literal("software_development_plan"),
514
+ id: z9.string().min(1),
515
+ title: z9.string().min(1),
516
+ status: RiskDocumentStatusSchema,
517
+ author: z9.string().optional(),
518
+ reviewers: z9.array(z9.string()).optional(),
519
+ approvers: z9.array(z9.string()).optional()
520
+ });
521
+ var SoftwareMaintenancePlanFrontmatterSchema = z9.object({
522
+ type: z9.literal("software_maintenance_plan"),
523
+ id: z9.string().min(1),
524
+ title: z9.string().min(1),
525
+ status: RiskDocumentStatusSchema,
526
+ author: z9.string().optional(),
527
+ reviewers: z9.array(z9.string()).optional(),
528
+ approvers: z9.array(z9.string()).optional()
529
+ });
530
+ var SoupRegisterFrontmatterSchema = z9.object({
531
+ type: z9.literal("soup_register"),
423
532
  id: z9.string().min(1),
424
533
  title: z9.string().min(1),
425
534
  status: RiskDocumentStatusSchema,
@@ -427,8 +536,8 @@ var ClinicalEvaluationPlanFrontmatterSchema = z9.object({
427
536
  reviewers: z9.array(z9.string()).optional(),
428
537
  approvers: z9.array(z9.string()).optional()
429
538
  });
430
- var ClinicalEvaluationReportFrontmatterSchema = z9.object({
431
- type: z9.literal("clinical_evaluation_report"),
539
+ var SoftwareTestPlanFrontmatterSchema = z9.object({
540
+ type: z9.literal("software_test_plan"),
432
541
  id: z9.string().min(1),
433
542
  title: z9.string().min(1),
434
543
  status: RiskDocumentStatusSchema,
@@ -437,55 +546,74 @@ var ClinicalEvaluationReportFrontmatterSchema = z9.object({
437
546
  approvers: z9.array(z9.string()).optional()
438
547
  });
439
548
 
440
- // ../shared/dist/schemas/post-market.js
549
+ // ../contracts/dist/domain-schemas/architecture.js
441
550
  import { z as z10 } from "zod";
442
- var PostMarketSurveillancePlanFrontmatterSchema = z10.object({
443
- type: z10.literal("post_market_surveillance_plan"),
551
+ var SoftwareItemTypeSchema = z10.enum(["system", "subsystem", "component", "unit"]);
552
+ var SegregationSchema = z10.object({
553
+ mechanism: z10.string().min(1),
554
+ rationale: z10.string().min(1)
555
+ });
556
+ var ArchitectureFrontmatterSchema = z10.object({
444
557
  id: z10.string().min(1),
445
558
  title: z10.string().min(1),
559
+ type: z10.literal("architecture"),
446
560
  status: RiskDocumentStatusSchema,
561
+ software_item_type: SoftwareItemTypeSchema.optional(),
562
+ parent_item: z10.string().optional(),
563
+ safety_class: z10.enum(["A", "B", "C"]).optional(),
564
+ segregation: SegregationSchema.optional(),
447
565
  author: z10.string().optional(),
448
566
  reviewers: z10.array(z10.string()).optional(),
449
567
  approvers: z10.array(z10.string()).optional()
450
568
  });
451
- var PostMarketFeedbackCategorySchema = z10.enum([
452
- "complaint",
453
- "field_observation",
454
- "clinical_followup",
455
- "trend_report"
456
- ]);
457
- var PostMarketFeedbackSeveritySchema = z10.enum(["low", "medium", "high", "critical"]);
458
- var PostMarketFeedbackFrontmatterSchema = z10.object({
459
- type: z10.literal("post_market_feedback"),
569
+ var DetailedDesignFrontmatterSchema = z10.object({
460
570
  id: z10.string().min(1),
461
571
  title: z10.string().min(1),
572
+ type: z10.literal("detailed_design"),
462
573
  status: RiskDocumentStatusSchema,
463
- category: PostMarketFeedbackCategorySchema,
464
- severity: PostMarketFeedbackSeveritySchema,
465
- device: z10.string().optional(),
466
- reporting_period: z10.string().optional(),
574
+ software_item_type: SoftwareItemTypeSchema.optional(),
575
+ parent_item: z10.string().optional(),
576
+ safety_class: z10.enum(["A", "B", "C"]).optional(),
577
+ segregation: SegregationSchema.optional(),
467
578
  author: z10.string().optional(),
468
579
  reviewers: z10.array(z10.string()).optional(),
469
580
  approvers: z10.array(z10.string()).optional()
470
581
  });
471
582
 
472
- // ../shared/dist/schemas/labeling.js
583
+ // ../contracts/dist/domain-schemas/anomaly.js
473
584
  import { z as z11 } from "zod";
474
- var LabelingFrontmatterSchema = z11.object({
475
- type: z11.literal("labeling"),
585
+ var AnomalyCategorySchema = z11.enum([
586
+ "bug",
587
+ "security_vulnerability",
588
+ "regression",
589
+ "performance"
590
+ ]);
591
+ var AnomalySeveritySchema = z11.enum(["critical", "major", "minor"]);
592
+ var AnomalyDispositionSchema = z11.enum([
593
+ "open",
594
+ "investigating",
595
+ "resolved",
596
+ "deferred",
597
+ "will_not_fix"
598
+ ]);
599
+ var AnomalyFrontmatterSchema = z11.object({
600
+ type: z11.literal("anomaly"),
476
601
  id: z11.string().min(1),
477
602
  title: z11.string().min(1),
478
603
  status: RiskDocumentStatusSchema,
479
- label_type: z11.enum(["ifu", "product_label", "packaging_label"]).optional(),
604
+ category: AnomalyCategorySchema,
605
+ severity: AnomalySeveritySchema,
606
+ disposition: AnomalyDispositionSchema,
607
+ affected_version: z11.string().optional(),
480
608
  author: z11.string().optional(),
481
609
  reviewers: z11.array(z11.string()).optional(),
482
610
  approvers: z11.array(z11.string()).optional()
483
611
  });
484
612
 
485
- // ../shared/dist/schemas/product.js
613
+ // ../contracts/dist/domain-schemas/cybersecurity.js
486
614
  import { z as z12 } from "zod";
487
- var ProductDevelopmentPlanFrontmatterSchema = z12.object({
488
- type: z12.literal("product_development_plan"),
615
+ var CybersecurityPlanFrontmatterSchema = z12.object({
616
+ type: z12.literal("cybersecurity_plan"),
489
617
  id: z12.string().min(1),
490
618
  title: z12.string().min(1),
491
619
  status: RiskDocumentStatusSchema,
@@ -493,8 +621,8 @@ var ProductDevelopmentPlanFrontmatterSchema = z12.object({
493
621
  reviewers: z12.array(z12.string()).optional(),
494
622
  approvers: z12.array(z12.string()).optional()
495
623
  });
496
- var IntendedUseFrontmatterSchema = z12.object({
497
- type: z12.literal("intended_use"),
624
+ var SbomFrontmatterSchema = z12.object({
625
+ type: z12.literal("sbom"),
498
626
  id: z12.string().min(1),
499
627
  title: z12.string().min(1),
500
628
  status: RiskDocumentStatusSchema,
@@ -503,31 +631,118 @@ var IntendedUseFrontmatterSchema = z12.object({
503
631
  approvers: z12.array(z12.string()).optional()
504
632
  });
505
633
 
506
- // ../shared/dist/schemas/user-need.js
634
+ // ../contracts/dist/domain-schemas/clinical.js
507
635
  import { z as z13 } from "zod";
508
- var UserNeedPrioritySchema = z13.enum(["must_have", "should_have", "nice_to_have"]);
509
- var UserNeedFrontmatterSchema = z13.object({
636
+ var ClinicalEvaluationPlanFrontmatterSchema = z13.object({
637
+ type: z13.literal("clinical_evaluation_plan"),
638
+ id: z13.string().min(1),
639
+ title: z13.string().min(1),
640
+ status: RiskDocumentStatusSchema,
641
+ author: z13.string().optional(),
642
+ reviewers: z13.array(z13.string()).optional(),
643
+ approvers: z13.array(z13.string()).optional()
644
+ });
645
+ var ClinicalEvaluationReportFrontmatterSchema = z13.object({
646
+ type: z13.literal("clinical_evaluation_report"),
510
647
  id: z13.string().min(1),
511
648
  title: z13.string().min(1),
512
649
  status: RiskDocumentStatusSchema,
650
+ author: z13.string().optional(),
651
+ reviewers: z13.array(z13.string()).optional(),
652
+ approvers: z13.array(z13.string()).optional()
653
+ });
654
+
655
+ // ../contracts/dist/domain-schemas/post-market.js
656
+ import { z as z14 } from "zod";
657
+ var PostMarketSurveillancePlanFrontmatterSchema = z14.object({
658
+ type: z14.literal("post_market_surveillance_plan"),
659
+ id: z14.string().min(1),
660
+ title: z14.string().min(1),
661
+ status: RiskDocumentStatusSchema,
662
+ author: z14.string().optional(),
663
+ reviewers: z14.array(z14.string()).optional(),
664
+ approvers: z14.array(z14.string()).optional()
665
+ });
666
+ var PostMarketFeedbackCategorySchema = z14.enum([
667
+ "complaint",
668
+ "field_observation",
669
+ "clinical_followup",
670
+ "trend_report"
671
+ ]);
672
+ var PostMarketFeedbackSeveritySchema = z14.enum(["low", "medium", "high", "critical"]);
673
+ var PostMarketFeedbackFrontmatterSchema = z14.object({
674
+ type: z14.literal("post_market_feedback"),
675
+ id: z14.string().min(1),
676
+ title: z14.string().min(1),
677
+ status: RiskDocumentStatusSchema,
678
+ category: PostMarketFeedbackCategorySchema,
679
+ severity: PostMarketFeedbackSeveritySchema,
680
+ device: z14.string().optional(),
681
+ reporting_period: z14.string().optional(),
682
+ author: z14.string().optional(),
683
+ reviewers: z14.array(z14.string()).optional(),
684
+ approvers: z14.array(z14.string()).optional()
685
+ });
686
+
687
+ // ../contracts/dist/domain-schemas/labeling.js
688
+ import { z as z15 } from "zod";
689
+ var LabelingFrontmatterSchema = z15.object({
690
+ type: z15.literal("labeling"),
691
+ id: z15.string().min(1),
692
+ title: z15.string().min(1),
693
+ status: RiskDocumentStatusSchema,
694
+ label_type: z15.enum(["ifu", "product_label", "packaging_label"]).optional(),
695
+ author: z15.string().optional(),
696
+ reviewers: z15.array(z15.string()).optional(),
697
+ approvers: z15.array(z15.string()).optional()
698
+ });
699
+
700
+ // ../contracts/dist/domain-schemas/product.js
701
+ import { z as z16 } from "zod";
702
+ var ProductDevelopmentPlanFrontmatterSchema = z16.object({
703
+ type: z16.literal("product_development_plan"),
704
+ id: z16.string().min(1),
705
+ title: z16.string().min(1),
706
+ status: RiskDocumentStatusSchema,
707
+ author: z16.string().optional(),
708
+ reviewers: z16.array(z16.string()).optional(),
709
+ approvers: z16.array(z16.string()).optional()
710
+ });
711
+ var IntendedUseFrontmatterSchema = z16.object({
712
+ type: z16.literal("intended_use"),
713
+ id: z16.string().min(1),
714
+ title: z16.string().min(1),
715
+ status: RiskDocumentStatusSchema,
716
+ author: z16.string().optional(),
717
+ reviewers: z16.array(z16.string()).optional(),
718
+ approvers: z16.array(z16.string()).optional()
719
+ });
720
+
721
+ // ../contracts/dist/domain-schemas/user-need.js
722
+ import { z as z17 } from "zod";
723
+ var UserNeedPrioritySchema = z17.enum(["must_have", "should_have", "nice_to_have"]);
724
+ var UserNeedFrontmatterSchema = z17.object({
725
+ id: z17.string().min(1),
726
+ title: z17.string().min(1),
727
+ status: RiskDocumentStatusSchema,
513
728
  /** Validated if present — ensures frontmatter doesn't misidentify the document type */
514
- type: z13.literal("user_need").optional(),
729
+ type: z17.literal("user_need").optional(),
515
730
  /** The user role or stakeholder (e.g., "Quality Manager", "Developer") */
516
- stakeholder: z13.string().optional(),
731
+ stakeholder: z17.string().optional(),
517
732
  /** MoSCoW priority classification */
518
733
  priority: UserNeedPrioritySchema.optional(),
519
734
  /** Where this need originated (e.g., "ISO 13485 §7.3", "user interview") */
520
- source: z13.string().optional(),
735
+ source: z17.string().optional(),
521
736
  /** IDs of product requirements derived from this need */
522
- derives: z13.array(z13.string()).optional(),
523
- author: z13.string().optional(),
524
- reviewers: z13.array(z13.string()).optional(),
525
- approvers: z13.array(z13.string()).optional()
737
+ derives: z17.array(z17.string()).optional(),
738
+ author: z17.string().optional(),
739
+ reviewers: z17.array(z17.string()).optional(),
740
+ approvers: z17.array(z17.string()).optional()
526
741
  });
527
742
 
528
- // ../shared/dist/schemas/requirement.js
529
- import { z as z14 } from "zod";
530
- var RequirementTypeSchema = z14.enum([
743
+ // ../contracts/dist/domain-schemas/requirement.js
744
+ import { z as z18 } from "zod";
745
+ var RequirementTypeSchema = z18.enum([
531
746
  "functional",
532
747
  "interface",
533
748
  "performance",
@@ -536,8 +751,8 @@ var RequirementTypeSchema = z14.enum([
536
751
  "safety",
537
752
  "regulatory"
538
753
  ]);
539
- var RequirementFormatSchema = z14.enum(["standard", "user_story"]);
540
- var RequirementFulfillmentTypeSchema = z14.enum([
754
+ var RequirementFormatSchema = z18.enum(["standard", "user_story"]);
755
+ var RequirementFulfillmentTypeSchema = z18.enum([
541
756
  "software",
542
757
  "labeling",
543
758
  "clinical",
@@ -545,9 +760,9 @@ var RequirementFulfillmentTypeSchema = z14.enum([
545
760
  "regulatory_doc",
546
761
  "process"
547
762
  ]);
548
- var RequirementFrontmatterSchema = z14.object({
549
- id: z14.string().min(1),
550
- title: z14.string().min(1),
763
+ var RequirementFrontmatterSchema = z18.object({
764
+ id: z18.string().min(1),
765
+ title: z18.string().min(1),
551
766
  status: RiskDocumentStatusSchema,
552
767
  /** IEC 62304 §5.2.2 — requirement classification (required for SRS, optional for PRS) */
553
768
  req_type: RequirementTypeSchema.optional(),
@@ -555,72 +770,72 @@ var RequirementFrontmatterSchema = z14.object({
555
770
  format: RequirementFormatSchema.optional(),
556
771
  /** ISO 13485 §7.3.3 — how this PRS design input is fulfilled (PRS only, defaults to 'software') */
557
772
  fulfillment_type: RequirementFulfillmentTypeSchema.optional(),
558
- author: z14.string().optional(),
559
- reviewers: z14.array(z14.string()).optional(),
560
- approvers: z14.array(z14.string()).optional(),
773
+ author: z18.string().optional(),
774
+ reviewers: z18.array(z18.string()).optional(),
775
+ approvers: z18.array(z18.string()).optional(),
561
776
  /** Upstream traceability — IDs of documents this requirement traces from (e.g., UN for PRS, PRS for SRS) */
562
- traces_from: z14.array(z14.string()).optional(),
777
+ traces_from: z18.array(z18.string()).optional(),
563
778
  /** Downstream traceability — IDs of documents this requirement traces to (e.g., SRS for PRS) */
564
- traces_to: z14.array(z14.string()).optional()
779
+ traces_to: z18.array(z18.string()).optional()
565
780
  });
566
781
 
567
- // ../shared/dist/schemas/test-documents.js
568
- import { z as z15 } from "zod";
569
- var TestProtocolFrontmatterSchema = z15.object({
570
- type: z15.literal("test_protocol"),
571
- id: z15.string().min(1),
572
- title: z15.string().min(1),
782
+ // ../contracts/dist/domain-schemas/test-documents.js
783
+ import { z as z19 } from "zod";
784
+ var TestProtocolFrontmatterSchema = z19.object({
785
+ type: z19.literal("test_protocol"),
786
+ id: z19.string().min(1),
787
+ title: z19.string().min(1),
573
788
  status: RiskDocumentStatusSchema,
574
- author: z15.string().optional(),
575
- reviewers: z15.array(z15.string()).optional(),
576
- approvers: z15.array(z15.string()).optional()
789
+ author: z19.string().optional(),
790
+ reviewers: z19.array(z19.string()).optional(),
791
+ approvers: z19.array(z19.string()).optional()
577
792
  });
578
- var TestPhaseSchema = z15.enum(["verification", "production"]);
579
- var TestReportFrontmatterSchema = z15.object({
580
- type: z15.literal("test_report"),
581
- id: z15.string().min(1),
582
- title: z15.string().min(1),
793
+ var TestPhaseSchema = z19.enum(["verification", "production"]);
794
+ var TestReportFrontmatterSchema = z19.object({
795
+ type: z19.literal("test_report"),
796
+ id: z19.string().min(1),
797
+ title: z19.string().min(1),
583
798
  status: RiskDocumentStatusSchema,
584
- author: z15.string().optional(),
585
- reviewers: z15.array(z15.string()).optional(),
586
- approvers: z15.array(z15.string()).optional(),
587
- release_version: z15.string().optional(),
799
+ author: z19.string().optional(),
800
+ reviewers: z19.array(z19.string()).optional(),
801
+ approvers: z19.array(z19.string()).optional(),
802
+ release_version: z19.string().optional(),
588
803
  test_phase: TestPhaseSchema.optional()
589
804
  });
590
805
 
591
- // ../shared/dist/schemas/repo-config.js
592
- import { z as z16 } from "zod";
593
- var ReleaseReviewConfigSchema = z16.object({
594
- required_departments: z16.array(z16.string().min(1)).min(1),
595
- final_approver: z16.string().min(1)
596
- });
597
- var RepoConfigSchema = z16.object({
598
- device: z16.object({
599
- name: z16.string().min(1),
600
- safety_class: z16.enum(["A", "B", "C"]),
601
- classification: z16.object({
602
- eu: z16.string().optional(),
603
- us: z16.string().optional()
806
+ // ../contracts/dist/domain-schemas/repo-config.js
807
+ import { z as z20 } from "zod";
808
+ var ReleaseReviewConfigSchema = z20.object({
809
+ required_departments: z20.array(z20.string().min(1)).min(1),
810
+ final_approver: z20.string().min(1)
811
+ });
812
+ var RepoConfigSchema = z20.object({
813
+ device: z20.object({
814
+ name: z20.string().min(1),
815
+ safety_class: z20.enum(["A", "B", "C"]),
816
+ classification: z20.object({
817
+ eu: z20.string().optional(),
818
+ us: z20.string().optional()
604
819
  }).optional(),
605
- udi_device_identifier: z16.string().optional()
820
+ udi_device_identifier: z20.string().optional()
606
821
  }),
607
822
  release_review: ReleaseReviewConfigSchema.optional()
608
823
  });
609
824
 
610
- // ../shared/dist/schemas/qms-device.js
611
- import { z as z17 } from "zod";
612
- var OwnerTypeSchema = z17.enum(["qms", "device"]);
613
- var DocumentSnapshotSchema = z17.object({
614
- documentId: z17.string(),
615
- commitSha: z17.string(),
616
- documentPath: z17.string(),
617
- documentTitle: z17.string(),
618
- documentType: z17.string(),
619
- previousReleasedCommitSha: z17.string().optional(),
620
- changeType: z17.enum(["added", "modified", "unchanged"]),
621
- changeDescription: z17.string().optional()
622
- });
623
- var QmsDocumentTypeSchema = z17.enum([
825
+ // ../contracts/dist/domain-schemas/qms-device.js
826
+ import { z as z21 } from "zod";
827
+ var OwnerTypeSchema = z21.enum(["qms", "device"]);
828
+ var DocumentSnapshotSchema = z21.object({
829
+ documentId: z21.string(),
830
+ commitSha: z21.string(),
831
+ documentPath: z21.string(),
832
+ documentTitle: z21.string(),
833
+ documentType: z21.string(),
834
+ previousReleasedCommitSha: z21.string().optional(),
835
+ changeType: z21.enum(["added", "modified", "unchanged"]),
836
+ changeDescription: z21.string().optional()
837
+ });
838
+ var QmsDocumentTypeSchema = z21.enum([
624
839
  "sop",
625
840
  "policy",
626
841
  "work_instruction",
@@ -629,7 +844,7 @@ var QmsDocumentTypeSchema = z17.enum([
629
844
  "audit_report",
630
845
  "management_review"
631
846
  ]);
632
- var DeviceDocumentTypeSchema = z17.enum([
847
+ var DeviceDocumentTypeSchema = z21.enum([
633
848
  "user_need",
634
849
  "requirement",
635
850
  "architecture",
@@ -681,68 +896,68 @@ var DeviceDocumentTypeSchema = z17.enum([
681
896
  "software_test_plan"
682
897
  ]);
683
898
 
684
- // ../shared/dist/schemas/change-management.js
685
- import { z as z18 } from "zod";
686
- var ReleasePlanFrontmatterSchema = z18.object({
687
- id: z18.string().min(1),
688
- title: z18.string().min(1),
689
- type: z18.literal("release_plan").optional(),
690
- status: z18.string().optional(),
691
- author: z18.string().optional(),
692
- reviewers: z18.array(z18.string()).optional(),
693
- approvers: z18.array(z18.string()).optional(),
694
- version: z18.string().optional(),
695
- target_date: z18.string().optional(),
696
- applicable_plans: z18.array(z18.string()).optional()
697
- });
698
- var SuspectedLinkDispositionSchema = z18.enum(["included_in_release", "not_impacted"]);
699
- var SuspectedLinkNeighborSchema = z18.object({
700
- document: z18.string().min(1),
701
- direction: z18.enum(["upstream", "downstream"]),
899
+ // ../contracts/dist/domain-schemas/change-management.js
900
+ import { z as z22 } from "zod";
901
+ var ReleasePlanFrontmatterSchema = z22.object({
902
+ id: z22.string().min(1),
903
+ title: z22.string().min(1),
904
+ type: z22.literal("release_plan").optional(),
905
+ status: z22.string().optional(),
906
+ author: z22.string().optional(),
907
+ reviewers: z22.array(z22.string()).optional(),
908
+ approvers: z22.array(z22.string()).optional(),
909
+ version: z22.string().optional(),
910
+ target_date: z22.string().optional(),
911
+ applicable_plans: z22.array(z22.string()).optional()
912
+ });
913
+ var SuspectedLinkDispositionSchema = z22.enum(["included_in_release", "not_impacted"]);
914
+ var SuspectedLinkNeighborSchema = z22.object({
915
+ document: z22.string().min(1),
916
+ direction: z22.enum(["upstream", "downstream"]),
702
917
  disposition: SuspectedLinkDispositionSchema,
703
918
  /** Required when disposition is 'not_impacted' */
704
- rationale: z18.string().min(1).optional()
919
+ rationale: z22.string().min(1).optional()
705
920
  });
706
- var SuspectedLinkGroupSchema = z18.object({
707
- triggered_by: z18.string().min(1),
708
- neighbors: z18.array(SuspectedLinkNeighborSchema).min(1)
921
+ var SuspectedLinkGroupSchema = z22.object({
922
+ triggered_by: z22.string().min(1),
923
+ neighbors: z22.array(SuspectedLinkNeighborSchema).min(1)
709
924
  });
710
- var DesignReviewFrontmatterSchema = z18.object({
711
- id: z18.string().min(1),
712
- title: z18.string().min(1),
713
- type: z18.literal("design_review").optional(),
714
- status: z18.string().optional(),
715
- author: z18.string().optional(),
716
- reviewers: z18.array(z18.string()).optional(),
717
- approvers: z18.array(z18.string()).optional(),
925
+ var DesignReviewFrontmatterSchema = z22.object({
926
+ id: z22.string().min(1),
927
+ title: z22.string().min(1),
928
+ type: z22.literal("design_review").optional(),
929
+ status: z22.string().optional(),
930
+ author: z22.string().optional(),
931
+ reviewers: z22.array(z22.string()).optional(),
932
+ approvers: z22.array(z22.string()).optional(),
718
933
  /** Optional link to a Release Plan document (e.g. "RP-001") */
719
- release_plan: z18.string().optional(),
934
+ release_plan: z22.string().optional(),
720
935
  /** Acknowledged suspected links — one-up/one-down neighbor analysis */
721
- suspected_links: z18.array(SuspectedLinkGroupSchema).optional()
936
+ suspected_links: z22.array(SuspectedLinkGroupSchema).optional()
722
937
  });
723
- var ReleaseNotesAudienceSchema = z18.enum(["customer", "technical"]);
724
- var ReleaseNotesFrontmatterSchema = z18.object({
725
- id: z18.string().min(1),
726
- title: z18.string().min(1),
727
- type: z18.literal("release_notes").optional(),
938
+ var ReleaseNotesAudienceSchema = z22.enum(["customer", "technical"]);
939
+ var ReleaseNotesFrontmatterSchema = z22.object({
940
+ id: z22.string().min(1),
941
+ title: z22.string().min(1),
942
+ type: z22.literal("release_notes").optional(),
728
943
  status: RiskDocumentStatusSchema,
729
- author: z18.string().optional(),
730
- reviewers: z18.array(z18.string()).optional(),
731
- approvers: z18.array(z18.string()).optional(),
944
+ author: z22.string().optional(),
945
+ reviewers: z22.array(z22.string()).optional(),
946
+ approvers: z22.array(z22.string()).optional(),
732
947
  audience: ReleaseNotesAudienceSchema,
733
- release_version: z18.string().min(1)
948
+ release_version: z22.string().min(1)
734
949
  });
735
950
 
736
- // ../shared/dist/schemas/retention-policy.js
737
- import { z as z19 } from "zod";
738
- var RetentionPolicySchema = z19.object({
951
+ // ../contracts/dist/domain-schemas/retention-policy.js
952
+ import { z as z23 } from "zod";
953
+ var RetentionPolicySchema = z23.object({
739
954
  /** Default retention period in years for all record types */
740
- defaultPeriodYears: z19.number().int().min(1).max(30).default(10),
955
+ defaultPeriodYears: z23.number().int().min(1).max(30).default(10),
741
956
  /**
742
957
  * Optional per-record-type overrides (e.g., { "release": 15, "signature": 20 }).
743
958
  * Keys are record type identifiers; values are retention periods in years.
744
959
  */
745
- byRecordType: z19.record(z19.string(), z19.number().int().min(1).max(30)).optional()
960
+ byRecordType: z23.record(z23.string(), z23.number().int().min(1).max(30)).optional()
746
961
  });
747
962
  function isWithinRetentionPeriod(createdAt, retentionYears, now = /* @__PURE__ */ new Date()) {
748
963
  const retentionEnd = new Date(createdAt);
@@ -757,143 +972,143 @@ function getEffectiveRetentionYears(policy, recordType) {
757
972
  return policy.byRecordType?.[recordType] ?? policy.defaultPeriodYears;
758
973
  }
759
974
 
760
- // ../shared/dist/schemas/audit.js
761
- import { z as z20 } from "zod";
762
- var AuditFindingClassificationSchema = z20.enum(["observation", "minor_nc", "major_nc"]);
763
- var AuditStatusSchema = z20.enum(["planned", "in_progress", "completed", "cancelled"]);
764
- var PlannedAuditEntrySchema = z20.object({
765
- audit_id: z20.string().min(1),
766
- process_area: z20.string().min(1),
767
- clause: z20.string().optional(),
768
- planned_date: z20.string().min(1),
769
- auditor: z20.string().min(1),
975
+ // ../contracts/dist/domain-schemas/audit.js
976
+ import { z as z24 } from "zod";
977
+ var AuditFindingClassificationSchema = z24.enum(["observation", "minor_nc", "major_nc"]);
978
+ var AuditStatusSchema = z24.enum(["planned", "in_progress", "completed", "cancelled"]);
979
+ var PlannedAuditEntrySchema = z24.object({
980
+ audit_id: z24.string().min(1),
981
+ process_area: z24.string().min(1),
982
+ clause: z24.string().optional(),
983
+ planned_date: z24.string().min(1),
984
+ auditor: z24.string().min(1),
770
985
  status: AuditStatusSchema
771
986
  });
772
- var AuditScheduleFrontmatterSchema = z20.object({
773
- id: z20.string().min(1),
774
- title: z20.string().min(1),
775
- type: z20.literal("audit_schedule").optional(),
776
- status: z20.string().optional(),
777
- author: z20.string().optional(),
778
- reviewers: z20.array(z20.string()).optional(),
779
- approvers: z20.array(z20.string()).optional(),
780
- cycle_year: z20.number().int().min(2e3).max(2100),
781
- audits: z20.array(PlannedAuditEntrySchema).min(1)
782
- });
783
- var AuditFindingSchema = z20.object({
784
- finding_id: z20.string().min(1),
987
+ var AuditScheduleFrontmatterSchema = z24.object({
988
+ id: z24.string().min(1),
989
+ title: z24.string().min(1),
990
+ type: z24.literal("audit_schedule").optional(),
991
+ status: z24.string().optional(),
992
+ author: z24.string().optional(),
993
+ reviewers: z24.array(z24.string()).optional(),
994
+ approvers: z24.array(z24.string()).optional(),
995
+ cycle_year: z24.number().int().min(2e3).max(2100),
996
+ audits: z24.array(PlannedAuditEntrySchema).min(1)
997
+ });
998
+ var AuditFindingSchema = z24.object({
999
+ finding_id: z24.string().min(1),
785
1000
  classification: AuditFindingClassificationSchema,
786
- description: z20.string().min(1),
787
- capa_id: z20.string().optional()
788
- });
789
- var AuditReportFrontmatterSchema = z20.object({
790
- id: z20.string().min(1),
791
- title: z20.string().min(1),
792
- type: z20.literal("audit_report").optional(),
793
- status: z20.string().optional(),
794
- author: z20.string().optional(),
795
- reviewers: z20.array(z20.string()).optional(),
796
- approvers: z20.array(z20.string()).optional(),
797
- audit_date: z20.string().min(1),
798
- audit_id: z20.string().optional(),
799
- process_area: z20.string().min(1),
800
- clause: z20.string().optional(),
801
- auditor: z20.string().min(1),
802
- findings: z20.array(AuditFindingSchema),
803
- findings_major: z20.number().int().min(0).optional(),
804
- findings_minor: z20.number().int().min(0).optional(),
805
- findings_observations: z20.number().int().min(0).optional()
806
- });
807
-
808
- // ../shared/dist/schemas/management-review.js
809
- import { z as z21 } from "zod";
810
- var ManagementReviewAttendeeSchema = z21.object({
811
- name: z21.string().min(1),
812
- role: z21.string().min(1)
813
- });
814
- var ManagementReviewFrontmatterSchema = z21.object({
815
- id: z21.string().min(1),
816
- title: z21.string().min(1),
817
- type: z21.literal("management_review").optional(),
818
- version: z21.string().optional(),
819
- status: z21.enum(["draft", "scheduled", "completed"]).optional(),
820
- review_date: z21.string().min(1),
821
- review_period: z21.object({
822
- from: z21.string().min(1),
823
- to: z21.string().min(1)
1001
+ description: z24.string().min(1),
1002
+ capa_id: z24.string().optional()
1003
+ });
1004
+ var AuditReportFrontmatterSchema = z24.object({
1005
+ id: z24.string().min(1),
1006
+ title: z24.string().min(1),
1007
+ type: z24.literal("audit_report").optional(),
1008
+ status: z24.string().optional(),
1009
+ author: z24.string().optional(),
1010
+ reviewers: z24.array(z24.string()).optional(),
1011
+ approvers: z24.array(z24.string()).optional(),
1012
+ audit_date: z24.string().min(1),
1013
+ audit_id: z24.string().optional(),
1014
+ process_area: z24.string().min(1),
1015
+ clause: z24.string().optional(),
1016
+ auditor: z24.string().min(1),
1017
+ findings: z24.array(AuditFindingSchema),
1018
+ findings_major: z24.number().int().min(0).optional(),
1019
+ findings_minor: z24.number().int().min(0).optional(),
1020
+ findings_observations: z24.number().int().min(0).optional()
1021
+ });
1022
+
1023
+ // ../contracts/dist/domain-schemas/management-review.js
1024
+ import { z as z25 } from "zod";
1025
+ var ManagementReviewAttendeeSchema = z25.object({
1026
+ name: z25.string().min(1),
1027
+ role: z25.string().min(1)
1028
+ });
1029
+ var ManagementReviewFrontmatterSchema = z25.object({
1030
+ id: z25.string().min(1),
1031
+ title: z25.string().min(1),
1032
+ type: z25.literal("management_review").optional(),
1033
+ version: z25.string().optional(),
1034
+ status: z25.enum(["draft", "scheduled", "completed"]).optional(),
1035
+ review_date: z25.string().min(1),
1036
+ review_period: z25.object({
1037
+ from: z25.string().min(1),
1038
+ to: z25.string().min(1)
824
1039
  }),
825
- attendees: z21.array(ManagementReviewAttendeeSchema).min(1),
826
- data_snapshot_date: z21.string().optional(),
827
- next_review_date: z21.string().optional()
1040
+ attendees: z25.array(ManagementReviewAttendeeSchema).min(1),
1041
+ data_snapshot_date: z25.string().optional(),
1042
+ next_review_date: z25.string().optional()
828
1043
  });
829
1044
 
830
- // ../shared/dist/schemas/frameworks.js
831
- import { z as z22 } from "zod";
832
- var FrameworkScopeSchema = z22.enum(["qms", "device", "both"]);
833
- var MappingRelationshipSchema = z22.enum(["equivalent", "partial", "related", "supersedes"]);
834
- var FrameworkDefinitionSeedSchema = z22.object({
1045
+ // ../contracts/dist/domain-schemas/frameworks.js
1046
+ import { z as z26 } from "zod";
1047
+ var FrameworkScopeSchema = z26.enum(["qms", "device", "both"]);
1048
+ var MappingRelationshipSchema = z26.enum(["equivalent", "partial", "related", "supersedes"]);
1049
+ var FrameworkDefinitionSeedSchema = z26.object({
835
1050
  id: RegulatoryFrameworkSchema,
836
- name: z22.string().min(1),
837
- version: z22.string().min(1),
1051
+ name: z26.string().min(1),
1052
+ version: z26.string().min(1),
838
1053
  scope: FrameworkScopeSchema,
839
- url: z22.string().url().nullable(),
840
- active: z22.boolean().default(true)
1054
+ url: z26.string().url().nullable(),
1055
+ active: z26.boolean().default(true)
841
1056
  });
842
- var ClauseBase = z22.object({
843
- clauseNumber: z22.string().min(1),
844
- title: z22.string().min(1)
1057
+ var ClauseBase = z26.object({
1058
+ clauseNumber: z26.string().min(1),
1059
+ title: z26.string().min(1)
845
1060
  });
846
1061
  function buildClauseSchema(remainingDepth) {
847
1062
  if (remainingDepth <= 0) {
848
1063
  return ClauseBase.strict();
849
1064
  }
850
1065
  return ClauseBase.extend({
851
- children: z22.array(z22.lazy(() => buildClauseSchema(remainingDepth - 1))).optional()
1066
+ children: z26.array(z26.lazy(() => buildClauseSchema(remainingDepth - 1))).optional()
852
1067
  });
853
1068
  }
854
1069
  var FrameworkClauseSeedSchema = buildClauseSchema(5);
855
- var FrameworkMappingSeedSchema = z22.object({
856
- sourceClause: z22.string().min(1),
1070
+ var FrameworkMappingSeedSchema = z26.object({
1071
+ sourceClause: z26.string().min(1),
857
1072
  targetFramework: RegulatoryFrameworkSchema,
858
- targetClause: z22.string().min(1),
1073
+ targetClause: z26.string().min(1),
859
1074
  relationship: MappingRelationshipSchema,
860
- notes: z22.string().nullable().default(null)
1075
+ notes: z26.string().nullable().default(null)
861
1076
  });
862
- var MappingFileSeedSchema = z22.object({
1077
+ var MappingFileSeedSchema = z26.object({
863
1078
  sourceFramework: RegulatoryFrameworkSchema,
864
- mappings: z22.array(FrameworkMappingSeedSchema)
1079
+ mappings: z26.array(FrameworkMappingSeedSchema)
865
1080
  });
866
- var EvidenceSourceSchema = z22.enum(["documents", "training_records"]);
867
- var EvidenceRuleConditionsSeedSchema = z22.object({
1081
+ var EvidenceSourceSchema = z26.enum(["documents", "training_records"]);
1082
+ var EvidenceRuleConditionsSeedSchema = z26.object({
868
1083
  evidenceSource: EvidenceSourceSchema.optional(),
869
1084
  documentType: DocumentTypeSchema.optional(),
870
1085
  linkType: LinkTypeSchema.optional(),
871
- status: z22.string().optional(),
872
- minCount: z22.number().int().positive().optional()
1086
+ status: z26.string().optional(),
1087
+ minCount: z26.number().int().positive().optional()
873
1088
  });
874
- var EvidenceRuleSeedSchema = z22.object({
875
- clauseId: z22.string().min(1),
876
- description: z22.string().min(1),
1089
+ var EvidenceRuleSeedSchema = z26.object({
1090
+ clauseId: z26.string().min(1),
1091
+ description: z26.string().min(1),
877
1092
  conditions: EvidenceRuleConditionsSeedSchema,
878
- weight: z22.number().min(0).max(1)
1093
+ weight: z26.number().min(0).max(1)
879
1094
  });
880
- var EvidenceRulesFileSeedSchema = z22.object({
1095
+ var EvidenceRulesFileSeedSchema = z26.object({
881
1096
  frameworkId: RegulatoryFrameworkSchema,
882
- rules: z22.array(EvidenceRuleSeedSchema)
1097
+ rules: z26.array(EvidenceRuleSeedSchema)
883
1098
  });
884
1099
  var FrameworkFileSeedSchema = FrameworkDefinitionSeedSchema.extend({
885
- clauses: z22.array(FrameworkClauseSeedSchema)
1100
+ clauses: z26.array(FrameworkClauseSeedSchema)
886
1101
  });
887
1102
 
888
- // ../shared/dist/schemas/legal.js
889
- import { z as z23 } from "zod";
890
- var LegalDocumentTypeSchema = z23.enum(["tos", "privacy-policy", "billing-terms"]);
891
- var LegalDocumentVersionSchema = z23.string().regex(/^\d{4}-\d{2}-\d{2}$/, {
1103
+ // ../contracts/dist/domain-schemas/legal.js
1104
+ import { z as z27 } from "zod";
1105
+ var LegalDocumentTypeSchema = z27.enum(["tos", "privacy-policy", "billing-terms"]);
1106
+ var LegalDocumentVersionSchema = z27.string().regex(/^\d{4}-\d{2}-\d{2}$/, {
892
1107
  message: "Version must be in YYYY-MM-DD format"
893
1108
  });
894
1109
 
895
- // ../shared/dist/schemas/index.js
896
- var GateOverrideCategorySchema = z24.enum([
1110
+ // ../contracts/dist/domain-schemas/index.js
1111
+ var GateOverrideCategorySchema = z28.enum([
897
1112
  "unverified_requirements",
898
1113
  "unanalyzed_requirements",
899
1114
  "error_risk_gaps",
@@ -910,19 +1125,19 @@ var GateOverrideCategorySchema = z24.enum([
910
1125
  "missing_deployment_references",
911
1126
  "missing_smoke_test_evidence"
912
1127
  ]);
913
- var MemberRoleSchema = z24.enum(["admin", "member"]);
914
- var MemberStatusSchema = z24.enum(["active", "suspended", "removed"]);
915
- var EmailAddressSchema = z24.object({
916
- value: z24.string().email(),
917
- verified: z24.boolean()
1128
+ var MemberRoleSchema = z28.enum(["admin", "member"]);
1129
+ var MemberStatusSchema2 = z28.enum(["active", "suspended", "removed"]);
1130
+ var EmailAddressSchema = z28.object({
1131
+ value: z28.string().email(),
1132
+ verified: z28.boolean()
918
1133
  });
919
- var ReviewerRuleSchema = z24.object({
1134
+ var ReviewerRuleSchema2 = z28.object({
920
1135
  documentType: DocumentTypeSchema,
921
- requiredDepartments: z24.array(z24.string()),
922
- finalApproverDepartment: z24.string()
1136
+ requiredDepartments: z28.array(z28.string()),
1137
+ finalApproverDepartment: z28.string()
923
1138
  });
924
- var SyncStatusSchema = z24.enum(["active", "paused", "error"]);
925
- var AuditActionSchema = z24.enum([
1139
+ var SyncStatusSchema = z28.enum(["active", "paused", "error"]);
1140
+ var AuditActionSchema = z28.enum([
926
1141
  // Organization
927
1142
  "organization.created",
928
1143
  "organization.settings_updated",
@@ -1087,7 +1302,7 @@ var AuditActionSchema = z24.enum([
1087
1302
  // Audit
1088
1303
  "audit_log.exported"
1089
1304
  ]);
1090
- var ResourceTypeSchema = z24.enum([
1305
+ var ResourceTypeSchema = z28.enum([
1091
1306
  "organization",
1092
1307
  "member",
1093
1308
  "invite",
@@ -1119,185 +1334,3036 @@ var ResourceTypeSchema = z24.enum([
1119
1334
  "audit_log",
1120
1335
  "risk_matrix"
1121
1336
  ]);
1122
- var ReleaseTypeSchema = z24.enum(["qms", "device", "combined"]);
1123
- var ReleaseStatusSchema = z24.enum(["draft", "in_review", "approved", "published"]);
1124
- var SignatureTypeSchema = z24.enum(["author", "dept_reviewer", "final_approver", "trainee"]);
1125
- var ChangeTypeSchema = z24.enum(["added", "modified", "deleted"]);
1126
- var SigningRequestStatusSchema = z24.enum([
1337
+ var ReleaseTypeSchema = z28.enum(["qms", "device", "combined"]);
1338
+ var ReleaseStatusSchema = z28.enum(["draft", "in_review", "approved", "published"]);
1339
+ var SignatureTypeSchema = z28.enum(["author", "dept_reviewer", "final_approver", "trainee"]);
1340
+ var ChangeTypeSchema = z28.enum(["added", "modified", "deleted"]);
1341
+ var SigningRequestStatusSchema = z28.enum([
1127
1342
  "sent",
1128
1343
  "partially_signed",
1129
1344
  "completed",
1130
1345
  "expired",
1131
1346
  "cancelled"
1132
1347
  ]);
1133
- var SignerStatusSchema = z24.enum(["pending", "viewed", "signed", "declined"]);
1134
- var FieldTypeSchema = z24.enum(["signature", "initials", "date"]);
1348
+ var SignerStatusSchema = z28.enum(["pending", "viewed", "signed", "declined"]);
1349
+ var FieldTypeSchema = z28.enum(["signature", "initials", "date"]);
1135
1350
 
1136
- // ../shared/dist/constants/risk-matrix.js
1137
- var RISK_DOCUMENT_TYPES = [
1138
- "software_risk",
1139
- "usability_risk",
1140
- "security_risk"
1141
- ];
1142
- var HAZARD_DOCUMENT_TYPES = ["haz_soe_software", "haz_soe_security"];
1143
- var ALL_RISK_RELATED_DOCUMENT_TYPES = [
1144
- ...RISK_DOCUMENT_TYPES,
1145
- ...HAZARD_DOCUMENT_TYPES,
1146
- "hazardous_situation",
1147
- "harm"
1148
- ];
1351
+ // ../contracts/dist/identity/legal-requests.js
1352
+ var LegalAcceptRequestSchema = z29.object({
1353
+ documentType: LegalDocumentTypeSchema,
1354
+ documentVersion: LegalDocumentVersionSchema,
1355
+ organizationId: z29.string().optional()
1356
+ }).superRefine((data, ctx) => {
1357
+ if (data.documentType === "billing-terms" && !data.organizationId) {
1358
+ ctx.addIssue({
1359
+ code: z29.ZodIssueCode.custom,
1360
+ message: "organizationId is required for billing-terms",
1361
+ path: ["organizationId"]
1362
+ });
1363
+ }
1364
+ });
1365
+ var LegalHistoryQuerySchema = z29.object({
1366
+ pageToken: z29.string().optional(),
1367
+ limit: z29.coerce.number().min(1).max(100).default(20)
1368
+ });
1149
1369
 
1150
- // ../shared/dist/constants/document-types.js
1151
- var QMS_DOCUMENT_TYPES = [
1152
- "sop",
1153
- "policy",
1154
- "work_instruction",
1155
- "supplier",
1156
- // Internal audit management (ISO 13485 §8.2.2)
1157
- "audit_schedule",
1158
- "audit_report",
1159
- // Management review (ISO 13485 §5.6)
1160
- "management_review"
1161
- ];
1162
- var DEVICE_DOCUMENT_TYPES = [
1163
- "user_need",
1164
- "requirement",
1165
- "architecture",
1166
- "detailed_design",
1167
- "test_protocol",
1168
- "test_report",
1169
- "usability_risk",
1370
+ // ../contracts/dist/identity/legal-responses.js
1371
+ import { z as z30 } from "zod";
1372
+ var LegalAcceptResponseSchema = z30.object({
1373
+ acceptanceId: z30.string(),
1374
+ acceptedAt: z30.string()
1375
+ });
1376
+ var DocumentStatusSchema2 = z30.object({
1377
+ accepted: z30.boolean(),
1378
+ acceptedVersion: z30.string().optional(),
1379
+ currentVersion: z30.string()
1380
+ });
1381
+ var LegalStatusResponseSchema = z30.object({
1382
+ tos: DocumentStatusSchema2,
1383
+ privacyPolicy: DocumentStatusSchema2,
1384
+ billingTerms: z30.record(z30.string(), DocumentStatusSchema2)
1385
+ });
1386
+ var LegalHistoryResponseSchema = z30.object({
1387
+ acceptances: z30.array(z30.object({
1388
+ id: z30.string(),
1389
+ documentType: LegalDocumentTypeSchema,
1390
+ documentVersion: z30.string(),
1391
+ organizationId: z30.string().optional(),
1392
+ acceptedAt: z30.string()
1393
+ })),
1394
+ nextPageToken: z30.string().optional()
1395
+ });
1396
+
1397
+ // ../contracts/dist/repositories/requests.js
1398
+ import { z as z31 } from "zod";
1399
+ var RepositoryTypeSchema = z31.enum(["qms", "device"]);
1400
+ var SyncStatusSchema2 = z31.enum(["active", "paused", "error"]);
1401
+ var ConnectRepositoryRequestSchema = z31.object({
1402
+ organizationId: z31.string().min(1),
1403
+ gitHubRepoFullName: z31.string().min(1),
1404
+ gitHubRepoId: z31.number().int().positive()
1405
+ });
1406
+ var RepositoryIdParamSchema = z31.object({
1407
+ repositoryId: z31.string().min(1)
1408
+ });
1409
+ var OrgRepositoryParamSchema = z31.object({
1410
+ orgId: z31.string().min(1),
1411
+ repositoryId: z31.string().min(1)
1412
+ });
1413
+ var OrgIdQuerySchema = z31.object({
1414
+ organizationId: z31.string().min(1)
1415
+ });
1416
+ var OwnerTypeSchema2 = z31.enum(["qms", "device"]);
1417
+ var AssignRepositoryRequestSchema = z31.object({
1418
+ ownerType: OwnerTypeSchema2,
1419
+ ownerId: z31.string().min(1)
1420
+ });
1421
+ var TriggerSyncRequestSchema = z31.object({
1422
+ organizationId: z31.string().min(1)
1423
+ });
1424
+ var SyncEventParamSchema = z31.object({
1425
+ repositoryId: z31.string().min(1),
1426
+ syncEventId: z31.string().min(1)
1427
+ });
1428
+
1429
+ // ../contracts/dist/repositories/responses.js
1430
+ import { z as z32 } from "zod";
1431
+ var DocumentCountsSchema = z32.record(z32.string(), z32.number());
1432
+ var LinkCountsSchema = z32.record(z32.string(), z32.number());
1433
+ var RepositorySnapshotSchema = z32.object({
1434
+ documentCounts: DocumentCountsSchema,
1435
+ linkCounts: LinkCountsSchema,
1436
+ totalDocuments: z32.number(),
1437
+ totalLinks: z32.number()
1438
+ });
1439
+ var BaseFieldsSchema = z32.object({
1440
+ id: z32.string(),
1441
+ organizationId: z32.string(),
1442
+ ownerType: z32.enum(["qms", "device"]).nullable(),
1443
+ ownerId: z32.string().nullable(),
1444
+ gitHubRepoFullName: z32.string(),
1445
+ gitHubRepoId: z32.number(),
1446
+ syncStatus: SyncStatusSchema2,
1447
+ lastSyncedAt: z32.string().optional(),
1448
+ // ISO date
1449
+ lastSyncCommitSha: z32.string().optional(),
1450
+ connectedAt: z32.string(),
1451
+ // ISO date
1452
+ connectedBy: z32.string(),
1453
+ snapshot: RepositorySnapshotSchema.optional()
1454
+ });
1455
+ var UnassignedRepositoryResponseSchema = BaseFieldsSchema.extend({
1456
+ type: z32.literal("unassigned")
1457
+ });
1458
+ var QmsRepositoryResponseSchema = BaseFieldsSchema.extend({
1459
+ type: z32.literal("qms")
1460
+ });
1461
+ var DeviceRepositoryResponseSchema = BaseFieldsSchema.extend({
1462
+ type: z32.literal("device"),
1463
+ deviceName: z32.string(),
1464
+ safetyClass: SafetyClassSchema,
1465
+ configManaged: z32.boolean().optional()
1466
+ });
1467
+ var RepositoryResponseSchema = z32.discriminatedUnion("type", [
1468
+ UnassignedRepositoryResponseSchema,
1469
+ QmsRepositoryResponseSchema,
1470
+ DeviceRepositoryResponseSchema
1471
+ ]);
1472
+ var BaseRepositoryResponseSchema = BaseFieldsSchema.extend({
1473
+ type: z32.enum(["unassigned", "qms", "device"])
1474
+ });
1475
+ var GitHubRepositoryResponseSchema = z32.object({
1476
+ id: z32.number(),
1477
+ fullName: z32.string(),
1478
+ name: z32.string(),
1479
+ private: z32.boolean(),
1480
+ defaultBranch: z32.string()
1481
+ });
1482
+ var ConnectRepositoryResponseSchema = z32.object({
1483
+ repositoryId: z32.string()
1484
+ });
1485
+ var GetRepositoriesResponseSchema = z32.object({
1486
+ repositories: z32.array(RepositoryResponseSchema)
1487
+ });
1488
+ var ListGitHubReposResponseSchema = z32.object({
1489
+ repositories: z32.array(GitHubRepositoryResponseSchema)
1490
+ });
1491
+ var TriggerSyncResponseSchema = z32.object({
1492
+ syncEventId: z32.string()
1493
+ });
1494
+ var SyncEventStatusSchema = z32.enum([
1495
+ "pending",
1496
+ "in_progress",
1497
+ "completed",
1498
+ "completed_with_errors",
1499
+ "failed"
1500
+ ]);
1501
+ var SyncTriggerSchema = z32.enum(["manual", "webhook", "scheduled"]);
1502
+ var SyncEventResultSchema = z32.object({
1503
+ documentsCreated: z32.number(),
1504
+ documentsUpdated: z32.number(),
1505
+ documentsRemoved: z32.number(),
1506
+ linksCreated: z32.number(),
1507
+ linksRemoved: z32.number(),
1508
+ errors: z32.array(z32.string()),
1509
+ commitSha: z32.string(),
1510
+ repoConfig: z32.object({
1511
+ device: z32.object({
1512
+ name: z32.string(),
1513
+ safety_class: z32.enum(["A", "B", "C"]),
1514
+ classification: z32.object({
1515
+ eu: z32.string().optional(),
1516
+ us: z32.string().optional()
1517
+ }).optional()
1518
+ })
1519
+ }).optional()
1520
+ });
1521
+ var SyncEventResponseSchema = z32.object({
1522
+ id: z32.string(),
1523
+ status: SyncEventStatusSchema,
1524
+ trigger: SyncTriggerSchema,
1525
+ createdAt: z32.string(),
1526
+ // ISO date
1527
+ createdBy: z32.string(),
1528
+ startedAt: z32.string().optional(),
1529
+ completedAt: z32.string().optional(),
1530
+ error: z32.string().optional(),
1531
+ result: SyncEventResultSchema.optional()
1532
+ });
1533
+ var GetSyncEventResponseSchema = z32.object({
1534
+ syncEvent: SyncEventResponseSchema
1535
+ });
1536
+
1537
+ // ../contracts/dist/risks/requests.js
1538
+ import { z as z33 } from "zod";
1539
+ var RiskTypeSchema = z33.enum(["software_risk", "usability_risk", "security_risk"]);
1540
+ var GetRiskMatrixQuerySchema = z33.object({
1541
+ organizationId: z33.string().min(1),
1542
+ repositoryId: z33.string().optional(),
1543
+ type: RiskTypeSchema.optional()
1544
+ });
1545
+ var GetRiskGapsQuerySchema = z33.object({
1546
+ organizationId: z33.string().min(1),
1547
+ repositoryId: z33.string().optional(),
1548
+ type: RiskTypeSchema.optional()
1549
+ });
1550
+ var GetRiskListQuerySchema = z33.object({
1551
+ organizationId: z33.string().min(1),
1552
+ repositoryId: z33.string().optional(),
1553
+ type: RiskTypeSchema.optional(),
1554
+ limit: z33.coerce.number().min(1).max(100).optional().default(50)
1555
+ });
1556
+
1557
+ // ../contracts/dist/risks/responses.js
1558
+ import { z as z34 } from "zod";
1559
+ var RiskValueSchema = z34.number().int().min(1).max(5);
1560
+ var RiskDocumentTypeSchema = z34.enum([
1170
1561
  "software_risk",
1562
+ "usability_risk",
1171
1563
  "security_risk",
1172
- "hazardous_situation",
1173
- "harm",
1174
1564
  "haz_soe_software",
1175
1565
  "haz_soe_security",
1176
- "hazard_category",
1177
- // Usability engineering (IEC 62366)
1178
- "usability_plan",
1179
- "use_specification",
1180
- "task_analysis",
1181
- "usability_evaluation",
1182
- "summative_evaluation",
1183
- // Risk management (ISO 14971)
1184
- "risk_management_plan",
1185
- // Software lifecycle (IEC 62304)
1186
- "software_development_plan",
1187
- "software_maintenance_plan",
1188
- "soup_register",
1189
- // Problem resolution (IEC 62304 §9)
1190
- "anomaly",
1191
- // Cybersecurity (IEC 81001-5-1)
1192
- "cybersecurity_plan",
1193
- "sbom",
1194
- // Clinical (MDR / FDA)
1195
- "clinical_evaluation_plan",
1196
- "clinical_evaluation_report",
1197
- // Post-market surveillance (MDR Art. 83)
1198
- "post_market_surveillance_plan",
1199
- "post_market_feedback",
1200
- // Labeling (MDR Annex I)
1201
- "labeling",
1202
- // Product (ISO 13485 §7.3)
1203
- "product_development_plan",
1204
- "intended_use",
1205
- // Release management (IEC 62304 §5.7)
1206
- "release_plan",
1207
- // Change management (ISO 13485 §7.3.5)
1208
- "design_review",
1209
- "release_notes",
1210
- // Software test plan (IEC 62304 §5.7)
1211
- "software_test_plan"
1212
- ];
1213
- var CHANGE_DOCUMENT_TYPES = ["design_review", "release_plan"];
1214
- function isChangeDocumentType(type) {
1215
- return CHANGE_DOCUMENT_TYPES.includes(type);
1216
- }
1217
- function isQmsDocumentType(type) {
1218
- return QMS_DOCUMENT_TYPES.includes(type);
1219
- }
1220
- function isDeviceDocumentType(type) {
1221
- return DEVICE_DOCUMENT_TYPES.includes(type);
1222
- }
1566
+ "hazardous_situation",
1567
+ "harm",
1568
+ "hazard_category"
1569
+ ]);
1570
+ var HarmAssessmentEntrySchema = z34.object({
1571
+ harm: z34.string(),
1572
+ harmTitle: z34.string().optional(),
1573
+ harmSeverity: RiskValueSchema,
1574
+ inherentProbability: RiskValueSchema,
1575
+ residualProbability: RiskValueSchema,
1576
+ residualSeverityOverride: RiskValueSchema.optional(),
1577
+ residualSeverity: RiskValueSchema,
1578
+ inherentAcceptability: AcceptabilityStatusSchema,
1579
+ residualAcceptability: AcceptabilityStatusSchema
1580
+ });
1581
+ var RiskEntrySchema = z34.object({
1582
+ id: z34.string(),
1583
+ type: RiskDocumentTypeSchema,
1584
+ harmAssessments: z34.array(HarmAssessmentEntrySchema),
1585
+ worstInherentSeverity: RiskValueSchema.optional(),
1586
+ worstInherentProbability: RiskValueSchema.optional(),
1587
+ worstResidualSeverity: RiskValueSchema.optional(),
1588
+ worstResidualProbability: RiskValueSchema.optional(),
1589
+ worstAcceptability: AcceptabilityStatusSchema.optional(),
1590
+ cvssScore: z34.number().min(0).max(10).optional(),
1591
+ cvssVector: z34.string().optional()
1592
+ });
1593
+ var RiskMatrixResponseSchema = z34.object({
1594
+ inherent: z34.array(z34.array(z34.number())),
1595
+ residual: z34.array(z34.array(z34.number())),
1596
+ acceptability: z34.array(z34.array(AcceptabilityStatusSchema)),
1597
+ summary: z34.object({
1598
+ total: z34.number(),
1599
+ acceptable: z34.number(),
1600
+ reviewRequired: z34.number(),
1601
+ unacceptable: z34.number()
1602
+ }),
1603
+ labels: z34.object({
1604
+ severity: z34.array(z34.string()),
1605
+ probability: z34.array(z34.string())
1606
+ })
1607
+ });
1608
+ var RiskGapSchema = z34.object({
1609
+ code: z34.string(),
1610
+ severity: z34.enum(["error", "warning"]),
1611
+ documentId: z34.string(),
1612
+ documentTitle: z34.string(),
1613
+ message: z34.string(),
1614
+ repositoryId: z34.string().optional(),
1615
+ repositoryName: z34.string().optional()
1616
+ });
1617
+ var RiskGapsResponseSchema = z34.object({
1618
+ gaps: z34.array(RiskGapSchema),
1619
+ byType: z34.record(z34.array(RiskGapSchema))
1620
+ });
1621
+ var RiskListItemSchema = z34.object({
1622
+ id: z34.string(),
1623
+ documentId: z34.string(),
1624
+ title: z34.string(),
1625
+ type: RiskDocumentTypeSchema,
1626
+ harmAssessmentCount: z34.number().int().min(0),
1627
+ worstInherentSeverity: RiskValueSchema.optional(),
1628
+ worstInherentProbability: RiskValueSchema.optional(),
1629
+ worstResidualSeverity: RiskValueSchema.optional(),
1630
+ worstResidualProbability: RiskValueSchema.optional(),
1631
+ worstAcceptability: AcceptabilityStatusSchema.optional(),
1632
+ mitigationsCount: z34.number().int().min(0),
1633
+ hasRiskBenefit: z34.boolean(),
1634
+ cvssScore: z34.number().min(0).max(10).optional(),
1635
+ cvssVector: z34.string().optional()
1636
+ });
1637
+ var RiskListResponseSchema = z34.object({
1638
+ risks: z34.array(RiskListItemSchema),
1639
+ total: z34.number()
1640
+ });
1223
1641
 
1224
- // ../shared/dist/constants/index.js
1225
- var DOCUMENT_TYPES = {
1226
- user_need: "User Need",
1227
- requirement: "Requirement",
1228
- architecture: "Architecture",
1229
- detailed_design: "Detailed Design",
1230
- test_protocol: "Test Protocol",
1231
- test_report: "Test Report",
1232
- sop: "SOP",
1233
- work_instruction: "Work Instruction",
1234
- policy: "Policy",
1235
- usability_risk: "Usability Risk",
1236
- software_risk: "Software Risk",
1237
- security_risk: "Security Risk",
1238
- // Risk document types
1239
- haz_soe_software: "Hazard (Software)",
1240
- haz_soe_security: "Hazard (Security)",
1241
- hazardous_situation: "Hazardous Situation",
1242
- harm: "Harm",
1243
- hazard_category: "Hazard Category",
1244
- // Usability engineering (IEC 62366)
1245
- usability_plan: "Usability Plan",
1246
- use_specification: "Use Specification",
1247
- task_analysis: "Task Analysis",
1248
- usability_evaluation: "Usability Evaluation",
1249
- summative_evaluation: "Summative Evaluation",
1250
- // Risk management (ISO 14971)
1251
- risk_management_plan: "Risk Management Plan",
1252
- // Software lifecycle (IEC 62304)
1253
- software_development_plan: "Software Development Plan",
1254
- software_maintenance_plan: "Software Maintenance Plan",
1255
- soup_register: "SOUP Register",
1256
- // Problem resolution (IEC 62304 §9)
1257
- anomaly: "Anomaly",
1258
- // Cybersecurity (IEC 81001-5-1)
1259
- cybersecurity_plan: "Cybersecurity Plan",
1260
- sbom: "SBOM",
1261
- // Clinical (MDR / FDA)
1262
- clinical_evaluation_plan: "Clinical Evaluation Plan",
1263
- clinical_evaluation_report: "Clinical Evaluation Report",
1264
- // Post-market surveillance (MDR Art. 83)
1265
- post_market_surveillance_plan: "Post-Market Surveillance Plan",
1266
- post_market_feedback: "Post-Market Feedback",
1267
- // Labeling (MDR Annex I)
1268
- labeling: "Labeling",
1269
- // Product (ISO 13485 §7.3)
1270
- product_development_plan: "Product Development Plan",
1271
- intended_use: "Intended Use",
1272
- // Release management (IEC 62304 §5.7)
1273
- release_plan: "Release Plan",
1274
- // Change management (ISO 13485 §7.3.5)
1275
- design_review: "Design Review",
1276
- release_notes: "Release Notes",
1277
- // Supplier management (ISO 13485 §7.4)
1278
- supplier: "Supplier",
1279
- // Internal audit management (ISO 13485 §8.2.2)
1280
- audit_schedule: "Audit Schedule",
1281
- audit_report: "Audit Report",
1282
- // Management review (ISO 13485 §5.6)
1283
- management_review: "Management Review",
1284
- // Software test plan (IEC 62304 §5.7)
1285
- software_test_plan: "Software Test Plan"
1286
- };
1287
- var LINK_TYPES = {
1288
- derives_from: "Derives From",
1289
- implements: "Implements",
1290
- verified_by: "Verified By",
1291
- mitigates: "Mitigates",
1292
- parent_of: "Parent Of",
1293
- related_to: "Related To",
1294
- // New risk link types
1295
- leads_to: "Leads To",
1296
- results_in: "Results In",
1297
- analyzes: "Analyzes"
1298
- };
1299
- var REQUIRED_SECTIONS = {
1300
- user_need: ["Purpose", "Stakeholder", "User Needs"],
1642
+ // ../contracts/dist/documents/requests.js
1643
+ import { z as z35 } from "zod";
1644
+ var DocumentSourceTypeSchema = z35.enum([
1645
+ "markdown",
1646
+ "pdf"
1647
+ ]);
1648
+ var ChangeTypeSchema2 = z35.enum(["added", "modified", "removed"]);
1649
+ var GetDocumentsQuerySchema = z35.object({
1650
+ organizationId: z35.string().min(1),
1651
+ repositoryId: z35.string().min(1).optional(),
1652
+ docType: DocumentTypeSchema.optional(),
1653
+ status: DocumentStatusSchema.optional(),
1654
+ searchQuery: z35.string().optional(),
1655
+ limit: z35.coerce.number().int().positive().max(200).default(50),
1656
+ offset: z35.coerce.number().int().nonnegative().default(0)
1657
+ });
1658
+ var GetDocumentQuerySchema = z35.object({
1659
+ organizationId: z35.string().min(1),
1660
+ includeChangelog: z35.string().transform((v) => v === "true").pipe(z35.boolean()).default("false")
1661
+ });
1662
+ var GetDocumentContentQuerySchema = z35.object({
1663
+ organizationId: z35.string().min(1),
1664
+ commitSha: z35.string().min(1).optional()
1665
+ });
1666
+ var GetTraceabilityMatrixQuerySchema = z35.object({
1667
+ organizationId: z35.string().min(1),
1668
+ repositoryId: z35.string().min(1).optional(),
1669
+ sourceType: DocumentTypeSchema,
1670
+ targetType: DocumentTypeSchema,
1671
+ linkType: LinkTypeSchema,
1672
+ statusFilter: z35.string().transform((v) => v.split(",").filter(Boolean)).pipe(z35.array(DocumentStatusSchema)).optional()
1673
+ });
1674
+ var GetGapsQuerySchema = z35.object({
1675
+ organizationId: z35.string().min(1),
1676
+ repositoryId: z35.string().min(1).optional(),
1677
+ docTypes: z35.string().transform((v) => v.split(",").filter(Boolean)).pipe(z35.array(DocumentTypeSchema)).optional()
1678
+ });
1679
+ var GetDeviceTraceabilityMatrixQuerySchema = z35.object({
1680
+ sourceType: DocumentTypeSchema,
1681
+ targetType: DocumentTypeSchema,
1682
+ linkType: LinkTypeSchema,
1683
+ statusFilter: z35.string().transform((v) => v.split(",").filter(Boolean)).pipe(z35.array(DocumentStatusSchema)).optional()
1684
+ });
1685
+ var GetDeviceGapsQuerySchema = z35.object({
1686
+ docTypes: z35.string().transform((v) => v.split(",").filter(Boolean)).pipe(z35.array(DocumentTypeSchema)).optional()
1687
+ });
1688
+ var DocumentIdParamSchema = z35.object({
1689
+ documentId: z35.string().min(1)
1690
+ });
1691
+
1692
+ // ../contracts/dist/documents/responses.js
1693
+ import { z as z36 } from "zod";
1694
+ var ChangelogEntryResponseSchema = z36.object({
1695
+ id: z36.string(),
1696
+ changeType: ChangeTypeSchema2,
1697
+ commitSha: z36.string(),
1698
+ previousCommitSha: z36.string().optional(),
1699
+ changedBy: z36.string().optional(),
1700
+ changedByEmail: z36.string().optional(),
1701
+ changedAt: z36.string(),
1702
+ // ISO datetime
1703
+ pullRequestNumber: z36.number().optional(),
1704
+ pullRequestTitle: z36.string().optional(),
1705
+ releaseId: z36.string().optional(),
1706
+ releaseName: z36.string().optional(),
1707
+ changeSummary: z36.string().optional()
1708
+ });
1709
+ var LinkResponseSchema = z36.object({
1710
+ id: z36.string(),
1711
+ sourceDocumentId: z36.string(),
1712
+ targetDocumentId: z36.string(),
1713
+ linkType: LinkTypeSchema,
1714
+ sourceDocPath: z36.string(),
1715
+ targetDocPath: z36.string(),
1716
+ sourceRepositoryId: z36.string(),
1717
+ targetRepositoryId: z36.string().optional(),
1718
+ rationale: z36.string().optional()
1719
+ });
1720
+ var DocumentSummaryResponseSchema = z36.object({
1721
+ id: z36.string(),
1722
+ documentId: z36.string(),
1723
+ title: z36.string(),
1724
+ docType: DocumentTypeSchema,
1725
+ status: DocumentStatusSchema,
1726
+ sourceType: DocumentSourceTypeSchema,
1727
+ path: z36.string(),
1728
+ repositoryId: z36.string(),
1729
+ repositoryName: z36.string(),
1730
+ repositoryType: z36.enum(["qms", "device"]),
1731
+ lastSyncedAt: z36.string(),
1732
+ // ISO datetime
1733
+ metadata: z36.record(z36.string(), z36.unknown()).optional()
1734
+ });
1735
+ var DocumentDetailResponseSchema = DocumentSummaryResponseSchema.extend({
1736
+ metadata: z36.record(z36.string(), z36.unknown()),
1737
+ currentCommitSha: z36.string(),
1738
+ sourcePath: z36.string().nullable(),
1739
+ changelog: z36.array(ChangelogEntryResponseSchema).optional(),
1740
+ incomingLinks: z36.array(LinkResponseSchema).optional(),
1741
+ outgoingLinks: z36.array(LinkResponseSchema).optional()
1742
+ });
1743
+ var DocumentContentResponseSchema = z36.object({
1744
+ content: z36.string(),
1745
+ commitSha: z36.string(),
1746
+ path: z36.string(),
1747
+ githubUrl: z36.string()
1748
+ });
1749
+ var GetDocumentsResponseSchema = z36.object({
1750
+ documents: z36.array(DocumentSummaryResponseSchema),
1751
+ total: z36.number(),
1752
+ limit: z36.number(),
1753
+ offset: z36.number()
1754
+ });
1755
+ var TraceabilityRowSchema = z36.object({
1756
+ sourceId: z36.string(),
1757
+ sourceDocumentId: z36.string(),
1758
+ sourceTitle: z36.string(),
1759
+ sourcePath: z36.string(),
1760
+ linked: z36.boolean(),
1761
+ targetIds: z36.array(z36.string()),
1762
+ targetDocumentIds: z36.array(z36.string()),
1763
+ targetTitles: z36.array(z36.string())
1764
+ });
1765
+ var TraceabilityMatrixResponseSchema = z36.object({
1766
+ sourceType: DocumentTypeSchema,
1767
+ targetType: DocumentTypeSchema,
1768
+ linkType: LinkTypeSchema,
1769
+ coveragePercent: z36.number(),
1770
+ totalSources: z36.number(),
1771
+ coveredSources: z36.number(),
1772
+ rows: z36.array(TraceabilityRowSchema)
1773
+ });
1774
+ var GapItemSchema = z36.object({
1775
+ documentId: z36.string(),
1776
+ documentTitle: z36.string(),
1777
+ documentPath: z36.string(),
1778
+ docType: DocumentTypeSchema,
1779
+ missingLinkType: LinkTypeSchema,
1780
+ expectedTargetType: DocumentTypeSchema
1781
+ });
1782
+ var GapsResponseSchema = z36.object({
1783
+ totalGaps: z36.number(),
1784
+ gaps: z36.array(GapItemSchema)
1785
+ });
1786
+ var ComponentResponseSchema = z36.object({
1787
+ id: z36.string(),
1788
+ componentName: z36.string(),
1789
+ version: z36.string(),
1790
+ license: z36.string().optional(),
1791
+ safetyRiskClass: z36.string().optional(),
1792
+ purpose: z36.string().optional(),
1793
+ verification: z36.string().optional(),
1794
+ cveStatus: z36.string().optional(),
1795
+ category: z36.string().optional(),
1796
+ supplierId: z36.string().optional(),
1797
+ sourceFormat: z36.enum(["markdown_table", "cyclonedx", "spdx"]),
1798
+ purl: z36.string().optional()
1799
+ });
1800
+ var GetComponentsResponseSchema = z36.array(ComponentResponseSchema);
1801
+
1802
+ // ../contracts/dist/documents/signoff.js
1803
+ import { z as z37 } from "zod";
1804
+ var DocumentSignoffObligationSchema = z37.object({
1805
+ obligationId: z37.string(),
1806
+ role: z37.enum(["author", "reviewer", "approver"]),
1807
+ department: z37.string(),
1808
+ status: z37.enum(["pending", "fulfilled"]),
1809
+ fulfilledByUserId: z37.string().optional(),
1810
+ fulfilledByUserEmail: z37.string().optional(),
1811
+ fulfilledByUserDisplayName: z37.string().optional(),
1812
+ fulfilledAt: z37.string().optional(),
1813
+ signatureId: z37.string().optional()
1814
+ });
1815
+ var DocumentSignoffStatusResponseSchema = z37.object({
1816
+ documentId: z37.string(),
1817
+ commitSha: z37.string(),
1818
+ obligations: z37.array(DocumentSignoffObligationSchema),
1819
+ progress: z37.object({
1820
+ total: z37.number(),
1821
+ fulfilled: z37.number(),
1822
+ isComplete: z37.boolean()
1823
+ })
1824
+ });
1825
+ var DocumentExportResponseSchema = z37.object({
1826
+ message: z37.string()
1827
+ });
1828
+
1829
+ // ../contracts/dist/documents/compiled.js
1830
+ import { z as z38 } from "zod";
1831
+ var CompiledDocumentPresetSchema = z38.enum(["srs", "prs", "dmr", "risk"]);
1832
+ var CompiledDocumentQuerySchema = z38.object({
1833
+ organizationId: z38.string().min(1),
1834
+ repositoryId: z38.string().min(1).optional(),
1835
+ docType: DocumentTypeSchema.optional(),
1836
+ category: z38.string().optional(),
1837
+ status: DocumentStatusSchema.optional(),
1838
+ preset: CompiledDocumentPresetSchema.optional()
1839
+ }).refine((data) => data.preset || data.docType, {
1840
+ message: "Either preset or docType must be provided"
1841
+ });
1842
+ var CompiledTableOfContentsEntrySchema = z38.object({
1843
+ documentId: z38.string(),
1844
+ title: z38.string(),
1845
+ anchor: z38.string()
1846
+ });
1847
+ var CompiledDocumentItemSchema = z38.object({
1848
+ documentId: z38.string(),
1849
+ title: z38.string(),
1850
+ docType: DocumentTypeSchema,
1851
+ status: DocumentStatusSchema,
1852
+ path: z38.string(),
1853
+ content: z38.string(),
1854
+ anchor: z38.string()
1855
+ });
1856
+ var CompiledDocumentResponseSchema = z38.object({
1857
+ title: z38.string(),
1858
+ generatedAt: z38.string(),
1859
+ documentCount: z38.number(),
1860
+ tableOfContents: z38.array(CompiledTableOfContentsEntrySchema),
1861
+ documents: z38.array(CompiledDocumentItemSchema)
1862
+ });
1863
+
1864
+ // ../contracts/dist/releases/requests.js
1865
+ import { z as z39 } from "zod";
1866
+ var ReleaseTypeSchema2 = z39.enum(["qms", "device"]);
1867
+ var ReleaseStatusSchema2 = z39.enum(["draft", "in_review", "approved", "published"]);
1868
+ var SignatureTypeSchema2 = z39.enum([
1869
+ "author",
1870
+ "reviewer",
1871
+ "approver",
1872
+ "dept_reviewer",
1873
+ "final_approver",
1874
+ "trainee",
1875
+ "trainer"
1876
+ ]);
1877
+ var ReleaseChangeTypeSchema = z39.enum(["added", "modified", "removed"]);
1878
+ var ListReleasesQuerySchema = z39.object({
1879
+ organizationId: z39.string().min(1),
1880
+ status: ReleaseStatusSchema2.optional(),
1881
+ type: ReleaseTypeSchema2.optional(),
1882
+ deviceId: z39.string().optional(),
1883
+ limit: z39.coerce.number().int().positive().max(100).default(50),
1884
+ offset: z39.coerce.number().int().nonnegative().default(0)
1885
+ });
1886
+ var GetReleaseQuerySchema = z39.object({
1887
+ organizationId: z39.string().min(1),
1888
+ includeSignatures: z39.string().transform((v) => v === "true").pipe(z39.boolean()).default("false"),
1889
+ includeSnapshot: z39.string().transform((v) => v === "true").pipe(z39.boolean()).default("false")
1890
+ });
1891
+ var GetSignaturesQuerySchema = z39.object({
1892
+ organizationId: z39.string().min(1)
1893
+ });
1894
+ var GetChangedDocumentsQuerySchema = z39.object({
1895
+ organizationId: z39.string().min(1),
1896
+ type: ReleaseTypeSchema2,
1897
+ deviceId: z39.string().optional()
1898
+ });
1899
+ var ReleaseIdParamSchema = z39.object({
1900
+ releaseId: z39.string().min(1)
1901
+ });
1902
+ var DHRMarketEntrySchema = z39.object({
1903
+ country: z39.string().min(1),
1904
+ clinicalEvaluation: z39.boolean()
1905
+ });
1906
+ var DHRTestEvidenceEntrySchema = z39.object({
1907
+ label: z39.string().min(1),
1908
+ url: z39.string().url()
1909
+ });
1910
+ var DHRMetadataSchema = z39.object({
1911
+ markets: z39.array(DHRMarketEntrySchema).default([]),
1912
+ udi: z39.string().nullable().default(null),
1913
+ automatedTestEvidence: z39.array(DHRTestEvidenceEntrySchema).default([])
1914
+ });
1915
+ var DeploymentReferenceTypeSchema = z39.enum([
1916
+ "artifact",
1917
+ "pipeline",
1918
+ "deployment",
1919
+ "other"
1920
+ ]);
1921
+ var DeploymentReferenceSchema = z39.object({
1922
+ label: z39.string().min(1).max(200),
1923
+ url: z39.string().url(),
1924
+ type: DeploymentReferenceTypeSchema
1925
+ });
1926
+ var CreateReleaseRequestSchema = z39.object({
1927
+ organizationId: z39.string().min(1),
1928
+ name: z39.string().min(1).max(200),
1929
+ description: z39.string().max(2e3).optional(),
1930
+ type: ReleaseTypeSchema2,
1931
+ deviceId: z39.string().optional(),
1932
+ releasePlanDocumentId: z39.string().min(1).optional(),
1933
+ designReviewId: z39.string().min(1).optional(),
1934
+ releaseNotesDocumentId: z39.string().min(1).optional(),
1935
+ deviationNotes: z39.string().max(5e3).optional(),
1936
+ dhr: DHRMetadataSchema.optional(),
1937
+ reason: z39.string().max(500).optional()
1938
+ }).strict();
1939
+ var UpdateReleaseRequestSchema = z39.object({
1940
+ organizationId: z39.string().min(1),
1941
+ name: z39.string().min(1).max(200).optional(),
1942
+ description: z39.string().max(2e3).optional(),
1943
+ releasePlanDocumentId: z39.string().min(1).nullable().optional(),
1944
+ designReviewId: z39.string().min(1).nullable().optional(),
1945
+ releaseNotesDocumentId: z39.string().min(1).nullable().optional(),
1946
+ deviationNotes: z39.string().max(5e3).optional(),
1947
+ dhr: DHRMetadataSchema.nullable().optional(),
1948
+ deploymentReferences: z39.array(DeploymentReferenceSchema).optional(),
1949
+ smokeTestEvidence: z39.array(DHRTestEvidenceEntrySchema).optional(),
1950
+ reason: z39.string().max(500).optional()
1951
+ }).strict();
1952
+ var AddSignatureRequestSchema = z39.object({
1953
+ organizationId: z39.string().min(1),
1954
+ obligationId: z39.string().min(1),
1955
+ meaning: z39.string().min(1).max(500),
1956
+ /** Fresh Firebase ID token for per-signature re-authentication (Part 11 §11.200) */
1957
+ idToken: z39.string().min(1).optional(),
1958
+ /** Part 11: ID of the ERSD version the signer accepted */
1959
+ ersdDisclosureId: z39.string().min(1),
1960
+ /** Part 11: ISO date string when the signer accepted the ERSD */
1961
+ ersdAcceptedAt: z39.string().datetime()
1962
+ }).strict();
1963
+ var SubmitReleaseRequestSchema = z39.object({
1964
+ organizationId: z39.string().min(1),
1965
+ reason: z39.string().max(500).optional()
1966
+ });
1967
+ var WithdrawReleaseRequestSchema = z39.object({
1968
+ organizationId: z39.string().min(1),
1969
+ reason: z39.string().max(500).optional()
1970
+ });
1971
+ var PublishReleaseRequestSchema = z39.object({
1972
+ organizationId: z39.string().min(1),
1973
+ reason: z39.string().max(500).optional()
1974
+ });
1975
+ var DeleteReleaseQuerySchema = z39.object({
1976
+ organizationId: z39.string().min(1)
1977
+ });
1978
+ var UpdateChecklistItemParamSchema = z39.object({
1979
+ releaseId: z39.string().min(1),
1980
+ templateItemId: z39.string().min(1)
1981
+ });
1982
+ var UpdateChecklistItemRequestSchema = z39.object({
1983
+ organizationId: z39.string().min(1),
1984
+ checked: z39.boolean(),
1985
+ evidence: z39.string().max(2e3).optional()
1986
+ }).strict();
1987
+ var GateOverrideCategoryParamSchema = z39.object({
1988
+ releaseId: z39.string().min(1),
1989
+ category: GateOverrideCategorySchema
1990
+ });
1991
+ var AddGateOverrideRequestSchema = z39.object({
1992
+ organizationId: z39.string().min(1),
1993
+ category: GateOverrideCategorySchema,
1994
+ justification: z39.string().min(20).max(2e3)
1995
+ }).strict();
1996
+ var RemoveGateOverrideQuerySchema = z39.object({
1997
+ organizationId: z39.string().min(1)
1998
+ });
1999
+
2000
+ // ../contracts/dist/releases/responses.js
2001
+ import { z as z40 } from "zod";
2002
+ var ReleaseChangeResponseSchema = z40.object({
2003
+ repositoryId: z40.string(),
2004
+ documentId: z40.string(),
2005
+ documentPath: z40.string(),
2006
+ documentTitle: z40.string(),
2007
+ documentType: z40.string(),
2008
+ commitSha: z40.string(),
2009
+ changeType: ReleaseChangeTypeSchema
2010
+ });
2011
+ var SignatureResponseSchema = z40.object({
2012
+ id: z40.string(),
2013
+ releaseId: z40.string(),
2014
+ obligationId: z40.string(),
2015
+ userId: z40.string(),
2016
+ userEmail: z40.string(),
2017
+ userDisplayName: z40.string(),
2018
+ userDepartment: z40.string(),
2019
+ signatureType: SignatureTypeSchema2,
2020
+ meaning: z40.string(),
2021
+ timestamp: z40.string(),
2022
+ // ISO datetime
2023
+ signedCommitShas: z40.array(z40.string())
2024
+ });
2025
+ var SigningObligationRoleSchema = z40.enum(["author", "reviewer", "approver"]);
2026
+ var SigningObligationStatusSchema = z40.enum(["pending", "fulfilled"]);
2027
+ var SigningObligationResponseSchema = z40.object({
2028
+ obligationId: z40.string(),
2029
+ role: SigningObligationRoleSchema,
2030
+ department: z40.string(),
2031
+ documentIds: z40.array(z40.string()),
2032
+ status: SigningObligationStatusSchema,
2033
+ fulfilledBySignatureId: z40.string().optional(),
2034
+ fulfilledAt: z40.string().optional()
2035
+ });
2036
+ var SigningObligationsSummarySchema = z40.object({
2037
+ total: z40.number(),
2038
+ fulfilled: z40.number(),
2039
+ pending: z40.number()
2040
+ });
2041
+ var SnapshotLinkSchema = z40.object({
2042
+ sourceDocumentId: z40.string(),
2043
+ targetDocumentId: z40.string(),
2044
+ linkType: z40.string()
2045
+ });
2046
+ var RiskMatrixCellSchema = z40.object({
2047
+ count: z40.number(),
2048
+ acceptability: z40.enum(["acceptable", "review_required", "unacceptable"])
2049
+ });
2050
+ var SnapshotGapSchema = z40.object({
2051
+ code: z40.string(),
2052
+ severity: z40.enum(["error", "warning"]),
2053
+ documentId: z40.string(),
2054
+ documentTitle: z40.string(),
2055
+ message: z40.string()
2056
+ });
2057
+ var SnapshotTraceabilityChainEntrySchema = z40.object({
2058
+ hazardId: z40.string(),
2059
+ hazardTitle: z40.string(),
2060
+ situationId: z40.string(),
2061
+ situationTitle: z40.string(),
2062
+ harmId: z40.string(),
2063
+ harmTitle: z40.string(),
2064
+ riskId: z40.string(),
2065
+ riskTitle: z40.string(),
2066
+ riskType: z40.string(),
2067
+ inherentSeverity: z40.number(),
2068
+ inherentProbability: z40.number(),
2069
+ residualSeverity: z40.number(),
2070
+ residualProbability: z40.number(),
2071
+ acceptability: z40.string(),
2072
+ controls: z40.array(z40.string()),
2073
+ cvssScore: z40.number().optional(),
2074
+ cvssVector: z40.string().optional()
2075
+ });
2076
+ var SnapshotPlanReferenceSchema = z40.object({
2077
+ documentId: z40.string(),
2078
+ title: z40.string(),
2079
+ commitSha: z40.string(),
2080
+ safetyClass: z40.string(),
2081
+ postProductionReference: z40.string().optional()
2082
+ });
2083
+ var ComponentSnapshotEntryResponseSchema = z40.object({
2084
+ componentName: z40.string(),
2085
+ version: z40.string(),
2086
+ license: z40.string().optional(),
2087
+ safetyRiskClass: z40.string().optional(),
2088
+ sourceFormat: z40.enum(["markdown_table", "cyclonedx", "spdx"])
2089
+ });
2090
+ var ReleaseSnapshotResponseSchema = z40.object({
2091
+ traceabilityLinks: z40.array(SnapshotLinkSchema),
2092
+ traceabilityCoverage: z40.number(),
2093
+ riskMatrix: z40.object({
2094
+ inherent: z40.array(z40.array(z40.number())),
2095
+ residual: z40.array(z40.array(z40.number())),
2096
+ acceptability: z40.array(z40.array(z40.enum(["acceptable", "review_required", "unacceptable"]))),
2097
+ summary: z40.object({
2098
+ total: z40.number(),
2099
+ acceptable: z40.number(),
2100
+ reviewRequired: z40.number(),
2101
+ unacceptable: z40.number()
2102
+ })
2103
+ }),
2104
+ gaps: z40.array(SnapshotGapSchema),
2105
+ gapsSummary: z40.object({
2106
+ errorCount: z40.number(),
2107
+ warningCount: z40.number()
2108
+ }),
2109
+ riskTraceabilityChain: z40.array(SnapshotTraceabilityChainEntrySchema).optional(),
2110
+ riskManagementPlan: SnapshotPlanReferenceSchema.optional(),
2111
+ componentSnapshots: z40.record(z40.array(ComponentSnapshotEntryResponseSchema)).optional()
2112
+ });
2113
+ var DHRMarketEntryResponseSchema = z40.object({
2114
+ country: z40.string(),
2115
+ clinicalEvaluation: z40.boolean()
2116
+ });
2117
+ var DHRTestEvidenceEntryResponseSchema = z40.object({
2118
+ label: z40.string(),
2119
+ url: z40.string()
2120
+ });
2121
+ var DHRMetadataResponseSchema = z40.object({
2122
+ markets: z40.array(DHRMarketEntryResponseSchema),
2123
+ udi: z40.string().nullable(),
2124
+ automatedTestEvidence: z40.array(DHRTestEvidenceEntryResponseSchema)
2125
+ });
2126
+ var DeploymentReferenceResponseSchema = z40.object({
2127
+ label: z40.string(),
2128
+ url: z40.string(),
2129
+ type: z40.string()
2130
+ });
2131
+ var GateOverrideResponseSchema = z40.object({
2132
+ category: z40.string(),
2133
+ justification: z40.string(),
2134
+ gapDocumentIds: z40.array(z40.string()),
2135
+ gapCount: z40.number(),
2136
+ createdBy: z40.string(),
2137
+ createdByEmail: z40.string(),
2138
+ createdByDepartment: z40.string(),
2139
+ createdAt: z40.string()
2140
+ });
2141
+ var ReleaseChecklistItemResponseSchema = z40.object({
2142
+ templateItemId: z40.string(),
2143
+ label: z40.string(),
2144
+ checked: z40.boolean(),
2145
+ evidence: z40.string().optional(),
2146
+ updatedBy: z40.string().optional(),
2147
+ updatedAt: z40.string().optional()
2148
+ });
2149
+ var ReleaseDocumentManifestEntrySchema = z40.object({
2150
+ documentId: z40.string(),
2151
+ title: z40.string(),
2152
+ type: z40.string(),
2153
+ path: z40.string(),
2154
+ commitSha: z40.string()
2155
+ });
2156
+ var ReleaseSummaryResponseSchema = z40.object({
2157
+ id: z40.string(),
2158
+ name: z40.string(),
2159
+ description: z40.string().optional(),
2160
+ type: ReleaseTypeSchema2,
2161
+ deviceId: z40.string().optional(),
2162
+ status: ReleaseStatusSchema2,
2163
+ changesCount: z40.number(),
2164
+ signaturesCount: z40.number(),
2165
+ obligationsSummary: SigningObligationsSummarySchema,
2166
+ createdBy: z40.string(),
2167
+ createdAt: z40.string(),
2168
+ // ISO datetime
2169
+ submittedForReviewAt: z40.string().optional(),
2170
+ approvedAt: z40.string().optional(),
2171
+ publishedAt: z40.string().optional(),
2172
+ obligationsDerivedAt: z40.string().optional(),
2173
+ obligationsDerivationVersion: z40.number().optional(),
2174
+ obligationsInputHash: z40.string().optional(),
2175
+ releasePlanDocumentId: z40.string().optional(),
2176
+ designReviewId: z40.string().optional(),
2177
+ releaseNotesDocumentId: z40.string().optional(),
2178
+ deviationNotes: z40.string().optional(),
2179
+ dhr: DHRMetadataResponseSchema.optional(),
2180
+ version: z40.string().optional()
2181
+ });
2182
+ var ReleaseDetailResponseSchema = ReleaseSummaryResponseSchema.extend({
2183
+ changes: z40.array(ReleaseChangeResponseSchema),
2184
+ signingObligations: z40.array(SigningObligationResponseSchema),
2185
+ signatures: z40.array(SignatureResponseSchema).optional(),
2186
+ snapshot: ReleaseSnapshotResponseSchema.optional(),
2187
+ checklist: z40.array(ReleaseChecklistItemResponseSchema).optional(),
2188
+ releaseCommitSha: z40.string().optional(),
2189
+ previousReleaseId: z40.string().optional(),
2190
+ previousReleaseCommitSha: z40.string().optional(),
2191
+ deploymentReferences: z40.array(DeploymentReferenceResponseSchema).optional(),
2192
+ smokeTestEvidence: z40.array(z40.object({ label: z40.string(), url: z40.string() })).optional(),
2193
+ gateOverrides: z40.array(GateOverrideResponseSchema).default([]),
2194
+ documentManifest: z40.array(ReleaseDocumentManifestEntrySchema).optional()
2195
+ });
2196
+ var ListReleasesResponseSchema = z40.object({
2197
+ releases: z40.array(ReleaseSummaryResponseSchema),
2198
+ total: z40.number(),
2199
+ limit: z40.number(),
2200
+ offset: z40.number()
2201
+ });
2202
+ var GetSignaturesResponseSchema = z40.object({
2203
+ signatures: z40.array(SignatureResponseSchema)
2204
+ });
2205
+ var ChangedDocumentResponseSchema = z40.object({
2206
+ documentId: z40.string(),
2207
+ repositoryId: z40.string(),
2208
+ documentPath: z40.string(),
2209
+ documentTitle: z40.string(),
2210
+ documentType: z40.string(),
2211
+ currentCommitSha: z40.string(),
2212
+ previousCommitSha: z40.string().optional(),
2213
+ changeType: ReleaseChangeTypeSchema
2214
+ });
2215
+ var GetChangedDocumentsResponseSchema = z40.object({
2216
+ changes: z40.array(ChangedDocumentResponseSchema),
2217
+ previousReleaseId: z40.string().optional(),
2218
+ previousReleaseName: z40.string().optional()
2219
+ });
2220
+ var CreateReleaseResponseSchema = z40.object({
2221
+ id: z40.string(),
2222
+ release: ReleaseDetailResponseSchema
2223
+ });
2224
+ var ReleaseStatusChangeResponseSchema = z40.object({
2225
+ success: z40.boolean(),
2226
+ release: ReleaseDetailResponseSchema
2227
+ });
2228
+ var AddSignatureResponseSchema = z40.object({
2229
+ signature: SignatureResponseSchema,
2230
+ releaseStatus: ReleaseStatusSchema2,
2231
+ isAutoApproved: z40.boolean()
2232
+ });
2233
+
2234
+ // ../contracts/dist/releases/comparison.js
2235
+ import { z as z41 } from "zod";
2236
+ var ComparisonChangeTypeSchema = z41.enum(["added", "modified", "removed", "unchanged"]);
2237
+ var GetReleaseComparisonQuerySchema = z41.object({
2238
+ organizationId: z41.string().min(1),
2239
+ baseReleaseId: z41.string().min(1).optional()
2240
+ });
2241
+ var ComparisonReleaseInfoSchema = z41.object({
2242
+ id: z41.string(),
2243
+ name: z41.string(),
2244
+ publishedAt: z41.string().nullable()
2245
+ });
2246
+ var ComparisonCommitRefSchema = z41.object({
2247
+ commitSha: z41.string()
2248
+ });
2249
+ var ReleaseComparisonChangeSchema = z41.object({
2250
+ documentId: z41.string(),
2251
+ documentTitle: z41.string(),
2252
+ documentType: z41.string(),
2253
+ documentPath: z41.string(),
2254
+ changeType: ComparisonChangeTypeSchema,
2255
+ target: ComparisonCommitRefSchema.nullable(),
2256
+ base: ComparisonCommitRefSchema.nullable()
2257
+ });
2258
+ var ComparisonSummarySchema = z41.object({
2259
+ added: z41.number(),
2260
+ modified: z41.number(),
2261
+ removed: z41.number(),
2262
+ unchanged: z41.number()
2263
+ });
2264
+ var BaselineOptionSchema = z41.object({
2265
+ id: z41.string(),
2266
+ name: z41.string(),
2267
+ publishedAt: z41.string()
2268
+ });
2269
+ var ReleaseComparisonResponseSchema = z41.object({
2270
+ targetRelease: ComparisonReleaseInfoSchema,
2271
+ baseRelease: ComparisonReleaseInfoSchema.nullable(),
2272
+ changes: z41.array(ReleaseComparisonChangeSchema),
2273
+ summary: ComparisonSummarySchema,
2274
+ fallback: z41.boolean(),
2275
+ baselineOptions: z41.array(BaselineOptionSchema)
2276
+ });
2277
+
2278
+ // ../contracts/dist/qms/requests.js
2279
+ import { z as z42 } from "zod";
2280
+ var CreateQmsRequestSchema = z42.object({
2281
+ organizationId: z42.string().min(1),
2282
+ repositoryId: z42.string().min(1),
2283
+ name: z42.string().min(1).max(100)
2284
+ });
2285
+ var UpdateQmsRequestSchema = z42.object({
2286
+ name: z42.string().min(1).max(100).optional()
2287
+ });
2288
+ var QmsIdParamSchema = z42.object({
2289
+ orgId: z42.string().min(1),
2290
+ qmsId: z42.string().min(1)
2291
+ });
2292
+
2293
+ // ../contracts/dist/qms/responses.js
2294
+ import { z as z43 } from "zod";
2295
+ var QmsResponseSchema = z43.object({
2296
+ id: z43.string(),
2297
+ organizationId: z43.string(),
2298
+ repositoryId: z43.string(),
2299
+ name: z43.string(),
2300
+ createdAt: z43.string(),
2301
+ createdBy: z43.string()
2302
+ });
2303
+
2304
+ // ../contracts/dist/devices/requests.js
2305
+ import { z as z44 } from "zod";
2306
+ var CreateDeviceRequestSchema = z44.object({
2307
+ organizationId: z44.string().min(1),
2308
+ repositoryId: z44.string().min(1),
2309
+ name: z44.string().min(1).max(100),
2310
+ safetyClass: SafetyClassSchema
2311
+ });
2312
+ var UpdateDeviceRequestSchema = z44.object({
2313
+ name: z44.string().min(1).max(100).optional(),
2314
+ safetyClass: SafetyClassSchema.optional()
2315
+ });
2316
+ var DeviceIdParamSchema = z44.object({
2317
+ orgId: z44.string().min(1),
2318
+ deviceId: z44.string().min(1)
2319
+ });
2320
+ var DeviceListQuerySchema = z44.object({
2321
+ organizationId: z44.string().min(1)
2322
+ });
2323
+
2324
+ // ../contracts/dist/devices/responses.js
2325
+ import { z as z45 } from "zod";
2326
+ var DeviceResponseSchema = z45.object({
2327
+ id: z45.string(),
2328
+ organizationId: z45.string(),
2329
+ repositoryId: z45.string(),
2330
+ name: z45.string(),
2331
+ safetyClass: SafetyClassSchema,
2332
+ createdAt: z45.string(),
2333
+ createdBy: z45.string()
2334
+ });
2335
+
2336
+ // ../contracts/dist/dco/requests.js
2337
+ import { z as z46 } from "zod";
2338
+ var DCODocumentChangeTypeSchema = z46.enum(["new", "revision", "obsolete"]);
2339
+ var DCOStatusSchema = z46.enum(["draft", "pending_signatures", "approved", "effective"]);
2340
+ var DCOScopeSchema = z46.enum(["release", "documents", "maintenance"]);
2341
+ var DCODocumentEntrySchema = z46.object({
2342
+ documentId: z46.string().min(1),
2343
+ repositoryId: z46.string().min(1),
2344
+ commitSha: z46.string().min(1),
2345
+ changeType: DCODocumentChangeTypeSchema,
2346
+ changeDescription: z46.string().min(1).max(2e3)
2347
+ });
2348
+ var CreateDCORequestSchema = z46.object({
2349
+ title: z46.string().min(1).max(200),
2350
+ description: z46.string().min(1).max(5e3),
2351
+ scope: DCOScopeSchema,
2352
+ effectiveDate: z46.string().datetime(),
2353
+ documents: z46.array(DCODocumentEntrySchema).min(1),
2354
+ /** Required when scope='release' */
2355
+ releaseId: z46.string().min(1).optional()
2356
+ }).superRefine((data, ctx) => {
2357
+ if (data.scope === "release" && !data.releaseId) {
2358
+ ctx.addIssue({
2359
+ code: z46.ZodIssueCode.custom,
2360
+ message: 'releaseId is required when scope is "release"',
2361
+ path: ["releaseId"]
2362
+ });
2363
+ }
2364
+ });
2365
+ var UpdateDCORequestSchema = z46.object({
2366
+ title: z46.string().min(1).max(200).optional(),
2367
+ description: z46.string().min(1).max(5e3).optional(),
2368
+ effectiveDate: z46.string().datetime().optional(),
2369
+ documents: z46.array(DCODocumentEntrySchema).min(1).optional()
2370
+ });
2371
+ var SubmitDCORequestSchema = z46.object({
2372
+ departments: z46.array(z46.string().min(1)).min(1, "At least one department must be specified")
2373
+ });
2374
+ var FulfillDCOObligationRequestSchema = z46.object({
2375
+ obligationId: z46.string().min(1),
2376
+ meaning: z46.string().min(1).max(500),
2377
+ /** Fresh ID token from re-authentication (Part 11 §11.200 compliance) */
2378
+ idToken: z46.string().min(1),
2379
+ /** Part 11: ID of the ERSD version the signer accepted */
2380
+ ersdDisclosureId: z46.string().min(1),
2381
+ /** Part 11: ISO date string when the signer accepted the ERSD */
2382
+ ersdAcceptedAt: z46.string().datetime()
2383
+ });
2384
+ var DCOIdParamSchema = z46.object({
2385
+ orgId: z46.string().min(1),
2386
+ qmsId: z46.string().min(1),
2387
+ dcoId: z46.string().min(1)
2388
+ });
2389
+ var QmsDCOParamSchema = z46.object({
2390
+ orgId: z46.string().min(1),
2391
+ qmsId: z46.string().min(1)
2392
+ });
2393
+ var DCOListQuerySchema = PaginationParamsSchema.extend({
2394
+ status: DCOStatusSchema.optional(),
2395
+ scope: DCOScopeSchema.optional()
2396
+ });
2397
+
2398
+ // ../contracts/dist/dco/responses.js
2399
+ import { z as z47 } from "zod";
2400
+ var RevisionAssignmentSchema = z47.object({
2401
+ documentId: z47.string(),
2402
+ revisionNumber: z47.number()
2403
+ });
2404
+ var DCOSigningObligationSchema = z47.object({
2405
+ obligationId: z47.string(),
2406
+ department: z47.string(),
2407
+ status: z47.enum(["pending", "fulfilled"]),
2408
+ meaning: z47.string().optional(),
2409
+ fulfilledBySignatureId: z47.string().optional(),
2410
+ fulfilledAt: z47.string().optional()
2411
+ });
2412
+ var DCOResponseSchema = z47.object({
2413
+ id: z47.string(),
2414
+ organizationId: z47.string(),
2415
+ qmsId: z47.string(),
2416
+ dcoNumber: z47.string(),
2417
+ title: z47.string(),
2418
+ description: z47.string(),
2419
+ scope: DCOScopeSchema,
2420
+ releaseId: z47.string().optional(),
2421
+ documents: z47.array(DCODocumentEntrySchema),
2422
+ status: DCOStatusSchema,
2423
+ effectiveDate: z47.string(),
2424
+ createdAt: z47.string(),
2425
+ createdBy: z47.string(),
2426
+ approvedAt: z47.string().optional(),
2427
+ effectiveAt: z47.string().optional(),
2428
+ revisionAssignments: z47.array(RevisionAssignmentSchema),
2429
+ signingObligations: z47.array(DCOSigningObligationSchema)
2430
+ });
2431
+ var DCOListResponseSchema = z47.object({
2432
+ items: z47.array(DCOResponseSchema),
2433
+ total: z47.number(),
2434
+ limit: z47.number(),
2435
+ offset: z47.number()
2436
+ });
2437
+ var DocumentRevisionResponseSchema = z47.object({
2438
+ id: z47.string(),
2439
+ revisionNumber: z47.number(),
2440
+ dcoId: z47.string(),
2441
+ dcoNumber: z47.string(),
2442
+ releaseId: z47.string().optional(),
2443
+ releaseName: z47.string().optional(),
2444
+ commitSha: z47.string(),
2445
+ changeType: DCODocumentChangeTypeSchema,
2446
+ changeDescription: z47.string(),
2447
+ effectiveAt: z47.string(),
2448
+ effectiveBy: z47.string()
2449
+ });
2450
+ var RequestDCOExportResponseSchema = z47.object({
2451
+ message: z47.string(),
2452
+ estimatedMinutes: z47.number()
2453
+ });
2454
+
2455
+ // ../contracts/dist/capas/requests.js
2456
+ import { z as z48 } from "zod";
2457
+
2458
+ // ../contracts/dist/domain-types/capa.js
2459
+ var CAPA_STATUSES = [
2460
+ "open",
2461
+ "investigation",
2462
+ "implementation",
2463
+ "verification",
2464
+ "closed",
2465
+ "cancelled"
2466
+ ];
2467
+ var CAPA_CLASSIFICATIONS = ["corrective", "preventive"];
2468
+ var CAPA_PRIORITIES = ["low", "medium", "high", "critical"];
2469
+ var CAPA_SOURCE_TYPES = [
2470
+ "nonconformance",
2471
+ "complaint",
2472
+ "audit_finding",
2473
+ "observation",
2474
+ "other"
2475
+ ];
2476
+ var CAPA_ACTION_STATUSES = ["pending", "in_progress", "completed"];
2477
+
2478
+ // ../contracts/dist/capas/requests.js
2479
+ var CapaStatusSchema = z48.enum(CAPA_STATUSES);
2480
+ var CapaClassificationSchema = z48.enum(CAPA_CLASSIFICATIONS);
2481
+ var CapaPrioritySchema = z48.enum(CAPA_PRIORITIES);
2482
+ var CapaSourceTypeSchema = z48.enum(CAPA_SOURCE_TYPES);
2483
+ var CapaActionStatusSchema = z48.enum(CAPA_ACTION_STATUSES);
2484
+ var QmsCapaParamSchema = z48.object({
2485
+ orgId: z48.string().min(1),
2486
+ qmsId: z48.string().min(1)
2487
+ });
2488
+ var CapaIdParamSchema = z48.object({
2489
+ orgId: z48.string().min(1),
2490
+ qmsId: z48.string().min(1),
2491
+ capaId: z48.string().min(1)
2492
+ });
2493
+ var CapaActionIdParamSchema = z48.object({
2494
+ orgId: z48.string().min(1),
2495
+ qmsId: z48.string().min(1),
2496
+ capaId: z48.string().min(1),
2497
+ actionId: z48.string().min(1)
2498
+ });
2499
+ var CreateCapaRequestSchema = z48.object({
2500
+ classification: CapaClassificationSchema,
2501
+ priority: CapaPrioritySchema,
2502
+ title: z48.string().min(1).max(200),
2503
+ description: z48.string().min(1).max(5e3),
2504
+ sourceType: CapaSourceTypeSchema,
2505
+ sourceDescription: z48.string().min(1).max(2e3),
2506
+ sourceId: z48.string().max(200).optional(),
2507
+ dueDate: z48.string().datetime().optional(),
2508
+ affectedDocumentIds: z48.array(z48.string().min(1)).default([]),
2509
+ affectedDeviceIds: z48.array(z48.string().min(1)).default([])
2510
+ });
2511
+ var UpdateCapaRequestSchema = z48.object({
2512
+ title: z48.string().min(1).max(200).optional(),
2513
+ description: z48.string().min(1).max(5e3).optional(),
2514
+ priority: CapaPrioritySchema.optional(),
2515
+ rootCauseDescription: z48.string().max(5e3).optional(),
2516
+ verificationDescription: z48.string().max(5e3).optional(),
2517
+ affectedDocumentIds: z48.array(z48.string().min(1)).optional(),
2518
+ affectedDeviceIds: z48.array(z48.string().min(1)).optional(),
2519
+ dueDate: z48.string().datetime().nullable().optional()
2520
+ });
2521
+ var CloseCapaRequestSchema = z48.object({
2522
+ signatureId: z48.string().min(1)
2523
+ });
2524
+ var AddCapaActionRequestSchema = z48.object({
2525
+ description: z48.string().min(1).max(2e3),
2526
+ assigneeId: z48.string().min(1),
2527
+ dueDate: z48.string().datetime(),
2528
+ notes: z48.string().max(2e3).optional()
2529
+ });
2530
+ var UpdateCapaActionRequestSchema = z48.object({
2531
+ description: z48.string().min(1).max(2e3).optional(),
2532
+ assigneeId: z48.string().min(1).optional(),
2533
+ dueDate: z48.string().datetime().optional(),
2534
+ status: CapaActionStatusSchema.optional(),
2535
+ notes: z48.string().max(2e3).optional()
2536
+ });
2537
+ var CapaListQuerySchema = PaginationParamsSchema.extend({
2538
+ status: CapaStatusSchema.optional(),
2539
+ classification: CapaClassificationSchema.optional(),
2540
+ priority: CapaPrioritySchema.optional()
2541
+ });
2542
+
2543
+ // ../contracts/dist/capas/responses.js
2544
+ import { z as z49 } from "zod";
2545
+ var CapaActionResponseSchema = z49.object({
2546
+ id: z49.string(),
2547
+ description: z49.string(),
2548
+ assigneeId: z49.string(),
2549
+ assigneeEmail: z49.string(),
2550
+ dueDate: z49.string(),
2551
+ status: CapaActionStatusSchema,
2552
+ completedAt: z49.string().optional(),
2553
+ notes: z49.string().optional()
2554
+ });
2555
+ var CapaResponseSchema = z49.object({
2556
+ id: z49.string(),
2557
+ qmsId: z49.string(),
2558
+ organizationId: z49.string(),
2559
+ capaNumber: z49.string(),
2560
+ classification: CapaClassificationSchema,
2561
+ priority: CapaPrioritySchema,
2562
+ title: z49.string(),
2563
+ description: z49.string(),
2564
+ sourceType: CapaSourceTypeSchema,
2565
+ sourceId: z49.string().optional(),
2566
+ sourceDescription: z49.string(),
2567
+ rootCauseDescription: z49.string().optional(),
2568
+ verificationDescription: z49.string().optional(),
2569
+ affectedDocumentIds: z49.array(z49.string()),
2570
+ affectedDeviceIds: z49.array(z49.string()),
2571
+ actions: z49.array(CapaActionResponseSchema),
2572
+ status: CapaStatusSchema,
2573
+ createdAt: z49.string(),
2574
+ createdBy: z49.string(),
2575
+ investigationStartedAt: z49.string().optional(),
2576
+ implementationStartedAt: z49.string().optional(),
2577
+ verificationStartedAt: z49.string().optional(),
2578
+ closedAt: z49.string().optional(),
2579
+ closedBy: z49.string().optional(),
2580
+ cancelledAt: z49.string().optional(),
2581
+ cancelledBy: z49.string().optional(),
2582
+ dueDate: z49.string().optional()
2583
+ });
2584
+ var CapaListResponseSchema = z49.object({
2585
+ items: z49.array(CapaResponseSchema),
2586
+ total: z49.number(),
2587
+ limit: z49.number(),
2588
+ offset: z49.number()
2589
+ });
2590
+
2591
+ // ../contracts/dist/complaints/requests.js
2592
+ import { z as z50 } from "zod";
2593
+
2594
+ // ../contracts/dist/domain-types/complaint.js
2595
+ var COMPLAINT_STATUSES = [
2596
+ "open",
2597
+ "investigating",
2598
+ "resolved",
2599
+ "closed",
2600
+ "cancelled"
2601
+ ];
2602
+ var COMPLAINT_SEVERITIES = ["low", "medium", "high", "critical"];
2603
+ var COMPLAINT_CATEGORIES = [
2604
+ "quality",
2605
+ "safety",
2606
+ "performance",
2607
+ "usability",
2608
+ "other"
2609
+ ];
2610
+ var COMPLAINT_SOURCES = ["customer", "internal", "regulatory", "distributor"];
2611
+
2612
+ // ../contracts/dist/complaints/requests.js
2613
+ var ComplaintStatusSchema = z50.enum(COMPLAINT_STATUSES);
2614
+ var ComplaintSeveritySchema = z50.enum(COMPLAINT_SEVERITIES);
2615
+ var ComplaintCategorySchema = z50.enum(COMPLAINT_CATEGORIES);
2616
+ var ComplaintSourceSchema = z50.enum(COMPLAINT_SOURCES);
2617
+ var QmsComplaintParamSchema = z50.object({
2618
+ orgId: z50.string().min(1),
2619
+ qmsId: z50.string().min(1)
2620
+ });
2621
+ var ComplaintIdParamSchema = z50.object({
2622
+ orgId: z50.string().min(1),
2623
+ qmsId: z50.string().min(1),
2624
+ complaintId: z50.string().min(1)
2625
+ });
2626
+ var ComplainantSchema = z50.object({
2627
+ name: z50.string().min(1).max(200),
2628
+ email: z50.string().email().optional(),
2629
+ phone: z50.string().max(50).optional(),
2630
+ organization: z50.string().max(200).optional()
2631
+ });
2632
+ var CreateComplaintRequestSchema = z50.object({
2633
+ title: z50.string().min(1).max(200),
2634
+ description: z50.string().min(1).max(5e3),
2635
+ severity: ComplaintSeveritySchema,
2636
+ category: ComplaintCategorySchema,
2637
+ source: ComplaintSourceSchema,
2638
+ receivedDate: z50.string().datetime(),
2639
+ complainant: ComplainantSchema,
2640
+ reportable: z50.boolean(),
2641
+ reportabilityJustification: z50.string().max(5e3).optional(),
2642
+ affectedDeviceIds: z50.array(z50.string().min(1)).default([]),
2643
+ affectedDocumentIds: z50.array(z50.string().min(1)).default([]),
2644
+ assigneeId: z50.string().min(1).optional(),
2645
+ dueDate: z50.string().datetime().optional()
2646
+ });
2647
+ var UpdateComplaintRequestSchema = z50.object({
2648
+ title: z50.string().min(1).max(200).optional(),
2649
+ description: z50.string().min(1).max(5e3).optional(),
2650
+ severity: ComplaintSeveritySchema.optional(),
2651
+ category: ComplaintCategorySchema.optional(),
2652
+ source: ComplaintSourceSchema.optional(),
2653
+ reportable: z50.boolean().optional(),
2654
+ reportabilityJustification: z50.string().max(5e3).optional(),
2655
+ investigationSummary: z50.string().max(5e3).optional(),
2656
+ rootCauseDescription: z50.string().max(5e3).optional(),
2657
+ resolutionDescription: z50.string().max(5e3).optional(),
2658
+ affectedDeviceIds: z50.array(z50.string().min(1)).optional(),
2659
+ affectedDocumentIds: z50.array(z50.string().min(1)).optional(),
2660
+ assigneeId: z50.string().min(1).nullable().optional(),
2661
+ dueDate: z50.string().datetime().nullable().optional()
2662
+ });
2663
+ var ResolveComplaintRequestSchema = z50.object({
2664
+ resolutionDescription: z50.string().min(1).max(5e3)
2665
+ });
2666
+ var CloseComplaintRequestSchema = z50.object({
2667
+ signatureId: z50.string().min(1)
2668
+ });
2669
+ var CancelComplaintRequestSchema = z50.object({
2670
+ reason: z50.string().min(1).max(5e3)
2671
+ });
2672
+ var ComplaintListQuerySchema = PaginationParamsSchema.extend({
2673
+ status: ComplaintStatusSchema.optional(),
2674
+ severity: ComplaintSeveritySchema.optional(),
2675
+ category: ComplaintCategorySchema.optional(),
2676
+ source: ComplaintSourceSchema.optional()
2677
+ });
2678
+
2679
+ // ../contracts/dist/complaints/responses.js
2680
+ import { z as z51 } from "zod";
2681
+ var ComplaintResponseSchema = z51.object({
2682
+ id: z51.string(),
2683
+ qmsId: z51.string(),
2684
+ organizationId: z51.string(),
2685
+ complaintNumber: z51.string(),
2686
+ title: z51.string(),
2687
+ description: z51.string(),
2688
+ status: ComplaintStatusSchema,
2689
+ severity: ComplaintSeveritySchema,
2690
+ category: ComplaintCategorySchema,
2691
+ source: ComplaintSourceSchema,
2692
+ receivedDate: z51.string(),
2693
+ complainant: ComplainantSchema,
2694
+ reportable: z51.boolean(),
2695
+ reportabilityJustification: z51.string().optional(),
2696
+ investigationSummary: z51.string().optional(),
2697
+ rootCauseDescription: z51.string().optional(),
2698
+ resolutionDescription: z51.string().optional(),
2699
+ affectedDeviceIds: z51.array(z51.string()),
2700
+ affectedDocumentIds: z51.array(z51.string()),
2701
+ linkedCapaId: z51.string().optional(),
2702
+ assigneeId: z51.string().optional(),
2703
+ assigneeEmail: z51.string().optional(),
2704
+ dueDate: z51.string().optional(),
2705
+ createdAt: z51.string(),
2706
+ createdBy: z51.string(),
2707
+ investigationStartedAt: z51.string().optional(),
2708
+ resolvedAt: z51.string().optional(),
2709
+ resolvedBy: z51.string().optional(),
2710
+ closedAt: z51.string().optional(),
2711
+ closedBy: z51.string().optional(),
2712
+ cancellationReason: z51.string().optional(),
2713
+ cancelledAt: z51.string().optional(),
2714
+ cancelledBy: z51.string().optional()
2715
+ });
2716
+ var ComplaintListResponseSchema = z51.object({
2717
+ items: z51.array(ComplaintResponseSchema),
2718
+ total: z51.number(),
2719
+ limit: z51.number(),
2720
+ offset: z51.number()
2721
+ });
2722
+ var EscalateToCapaResponseSchema = z51.object({
2723
+ capaId: z51.string()
2724
+ });
2725
+
2726
+ // ../contracts/dist/nonconformances/requests.js
2727
+ import { z as z52 } from "zod";
2728
+
2729
+ // ../contracts/dist/domain-types/nonconformance.js
2730
+ var NC_STATUSES = [
2731
+ "reported",
2732
+ "investigation",
2733
+ "disposition",
2734
+ "closed",
2735
+ "cancelled"
2736
+ ];
2737
+ var NC_SEVERITIES = ["minor", "major", "critical"];
2738
+ var NC_DISPOSITIONS = [
2739
+ "use_as_is",
2740
+ "rework",
2741
+ "scrap",
2742
+ "return_to_supplier",
2743
+ "concession"
2744
+ ];
2745
+ var NC_SOURCE_TYPES = [
2746
+ "product",
2747
+ "process",
2748
+ "supplier",
2749
+ "audit_finding",
2750
+ "complaint",
2751
+ "other"
2752
+ ];
2753
+
2754
+ // ../contracts/dist/nonconformances/requests.js
2755
+ var NcStatusSchema = z52.enum(NC_STATUSES);
2756
+ var NcSeveritySchema = z52.enum(NC_SEVERITIES);
2757
+ var NcDispositionSchema = z52.enum(NC_DISPOSITIONS);
2758
+ var NcSourceTypeSchema = z52.enum(NC_SOURCE_TYPES);
2759
+ var QmsNcParamSchema = z52.object({
2760
+ orgId: z52.string().min(1),
2761
+ qmsId: z52.string().min(1)
2762
+ });
2763
+ var NcIdParamSchema = z52.object({
2764
+ orgId: z52.string().min(1),
2765
+ qmsId: z52.string().min(1),
2766
+ ncId: z52.string().min(1)
2767
+ });
2768
+ var CreateNcRequestSchema = z52.object({
2769
+ severity: NcSeveritySchema,
2770
+ sourceType: NcSourceTypeSchema,
2771
+ title: z52.string().min(1).max(200),
2772
+ description: z52.string().min(1).max(5e3),
2773
+ dueDate: z52.string().datetime().optional(),
2774
+ affectedDocumentIds: z52.array(z52.string().min(1)).default([]),
2775
+ affectedDeviceIds: z52.array(z52.string().min(1)).default([])
2776
+ });
2777
+ var UpdateNcRequestSchema = z52.object({
2778
+ title: z52.string().min(1).max(200).optional(),
2779
+ description: z52.string().min(1).max(5e3).optional(),
2780
+ severity: NcSeveritySchema.optional(),
2781
+ investigationDescription: z52.string().max(5e3).optional(),
2782
+ affectedDocumentIds: z52.array(z52.string().min(1)).optional(),
2783
+ affectedDeviceIds: z52.array(z52.string().min(1)).optional(),
2784
+ dueDate: z52.string().datetime().nullable().optional()
2785
+ });
2786
+ var SetDispositionRequestSchema = z52.object({
2787
+ disposition: NcDispositionSchema,
2788
+ justification: z52.string().min(1).max(5e3)
2789
+ });
2790
+ var ApproveConcessionRequestSchema = z52.object({
2791
+ signatureId: z52.string().min(1)
2792
+ });
2793
+ var NcListQuerySchema = PaginationParamsSchema.extend({
2794
+ status: NcStatusSchema.optional(),
2795
+ severity: NcSeveritySchema.optional(),
2796
+ sourceType: NcSourceTypeSchema.optional()
2797
+ });
2798
+
2799
+ // ../contracts/dist/nonconformances/responses.js
2800
+ import { z as z53 } from "zod";
2801
+ var NcResponseSchema = z53.object({
2802
+ id: z53.string(),
2803
+ qmsId: z53.string(),
2804
+ organizationId: z53.string(),
2805
+ ncNumber: z53.string(),
2806
+ severity: NcSeveritySchema,
2807
+ sourceType: NcSourceTypeSchema,
2808
+ title: z53.string(),
2809
+ description: z53.string(),
2810
+ investigationDescription: z53.string().optional(),
2811
+ disposition: NcDispositionSchema.optional(),
2812
+ dispositionJustification: z53.string().optional(),
2813
+ concessionSignatureId: z53.string().optional(),
2814
+ affectedDocumentIds: z53.array(z53.string()),
2815
+ affectedDeviceIds: z53.array(z53.string()),
2816
+ linkedCapaId: z53.string().optional(),
2817
+ status: NcStatusSchema,
2818
+ createdAt: z53.string(),
2819
+ createdBy: z53.string(),
2820
+ investigationStartedAt: z53.string().optional(),
2821
+ investigationStartedBy: z53.string().optional(),
2822
+ dispositionSetAt: z53.string().optional(),
2823
+ dispositionSetBy: z53.string().optional(),
2824
+ closedAt: z53.string().optional(),
2825
+ closedBy: z53.string().optional(),
2826
+ cancelledAt: z53.string().optional(),
2827
+ cancelledBy: z53.string().optional(),
2828
+ dueDate: z53.string().optional()
2829
+ });
2830
+ var NcListResponseSchema = z53.object({
2831
+ items: z53.array(NcResponseSchema),
2832
+ total: z53.number(),
2833
+ limit: z53.number(),
2834
+ offset: z53.number()
2835
+ });
2836
+
2837
+ // ../contracts/dist/signatures/requests.js
2838
+ import { z as z54 } from "zod";
2839
+ var DocumentSignatureTypeSchema = z54.enum([
2840
+ "author",
2841
+ "reviewer",
2842
+ "approver",
2843
+ "dept_reviewer",
2844
+ "final_approver",
2845
+ "trainee",
2846
+ "trainer"
2847
+ ]);
2848
+ var SignatureCaptureContextSchema = z54.discriminatedUnion("type", [
2849
+ z54.object({
2850
+ type: z54.literal("release"),
2851
+ id: z54.string().min(1)
2852
+ }),
2853
+ z54.object({
2854
+ type: z54.literal("design_review"),
2855
+ id: z54.string().min(1)
2856
+ }),
2857
+ z54.object({
2858
+ type: z54.literal("dco"),
2859
+ id: z54.string().min(1)
2860
+ }),
2861
+ z54.object({
2862
+ type: z54.literal("document_signoff"),
2863
+ id: z54.string().min(1)
2864
+ }),
2865
+ z54.object({
2866
+ type: z54.literal("nonconformance"),
2867
+ id: z54.string().min(1)
2868
+ }),
2869
+ z54.object({
2870
+ type: z54.literal("complaint"),
2871
+ id: z54.string().min(1)
2872
+ }),
2873
+ z54.object({
2874
+ type: z54.literal("training_completion"),
2875
+ id: z54.string().min(1)
2876
+ }),
2877
+ z54.object({
2878
+ type: z54.literal("training_signoff"),
2879
+ id: z54.string().min(1)
2880
+ })
2881
+ ]);
2882
+ var CreateDocumentSignatureRequestSchema = z54.object({
2883
+ signatureType: DocumentSignatureTypeSchema,
2884
+ meaning: z54.string().min(1).max(500),
2885
+ capturedDuring: SignatureCaptureContextSchema,
2886
+ reason: z54.string().max(500).optional(),
2887
+ /** Fresh Firebase ID token for per-signature re-authentication (Part 11 §11.200) */
2888
+ idToken: z54.string().min(1).optional(),
2889
+ /** Part 11: ID of the ERSD version the signer accepted */
2890
+ ersdDisclosureId: z54.string().min(1),
2891
+ /** Part 11: ISO date string when the signer accepted the ERSD */
2892
+ ersdAcceptedAt: z54.string().datetime()
2893
+ });
2894
+ var SignatureDocumentCommitParamSchema = z54.object({
2895
+ orgId: z54.string().min(1),
2896
+ docId: z54.string().min(1),
2897
+ commitSha: z54.string().min(1)
2898
+ });
2899
+ var SignatureDocumentIdParamSchema = z54.object({
2900
+ orgId: z54.string().min(1),
2901
+ docId: z54.string().min(1)
2902
+ });
2903
+
2904
+ // ../contracts/dist/signatures/responses.js
2905
+ import { z as z55 } from "zod";
2906
+ var DocumentSignatureResponseSchema = z55.object({
2907
+ id: z55.string(),
2908
+ organizationId: z55.string(),
2909
+ documentId: z55.string(),
2910
+ commitSha: z55.string(),
2911
+ userId: z55.string(),
2912
+ userEmail: z55.string(),
2913
+ userDisplayName: z55.string(),
2914
+ userDepartment: z55.string(),
2915
+ signatureType: DocumentSignatureTypeSchema,
2916
+ meaning: z55.string(),
2917
+ contentHash: z55.string().optional(),
2918
+ timestamp: z55.string(),
2919
+ capturedDuring: SignatureCaptureContextSchema
2920
+ });
2921
+ var DocumentSignaturesListResponseSchema = z55.object({
2922
+ signatures: z55.array(DocumentSignatureResponseSchema)
2923
+ });
2924
+ var DocumentSignatureHistoryItemSchema = z55.object({
2925
+ commitSha: z55.string(),
2926
+ signatures: z55.array(DocumentSignatureResponseSchema)
2927
+ });
2928
+ var DocumentSignatureHistoryResponseSchema = z55.object({
2929
+ documentId: z55.string(),
2930
+ history: z55.array(DocumentSignatureHistoryItemSchema)
2931
+ });
2932
+ var CreateDocumentSignatureResponseSchema = z55.object({
2933
+ signatureId: z55.string()
2934
+ });
2935
+
2936
+ // ../contracts/dist/github/webhooks.js
2937
+ import { z as z56 } from "zod";
2938
+ var GitHubCommitAuthorSchema = z56.object({
2939
+ email: z56.string(),
2940
+ name: z56.string()
2941
+ });
2942
+ var GitHubPushCommitSchema = z56.object({
2943
+ id: z56.string(),
2944
+ message: z56.string(),
2945
+ author: GitHubCommitAuthorSchema,
2946
+ added: z56.array(z56.string()),
2947
+ modified: z56.array(z56.string()),
2948
+ removed: z56.array(z56.string())
2949
+ });
2950
+ var GitHubWebhookRepositorySchema = z56.object({
2951
+ id: z56.number(),
2952
+ full_name: z56.string()
2953
+ });
2954
+ var GitHubInstallationSchema = z56.object({
2955
+ id: z56.number()
2956
+ });
2957
+ var GitHubAccountSchema = z56.object({
2958
+ login: z56.string(),
2959
+ type: z56.string()
2960
+ });
2961
+ var GitHubPushEventSchema = z56.object({
2962
+ ref: z56.string(),
2963
+ before: z56.string(),
2964
+ after: z56.string(),
2965
+ repository: GitHubWebhookRepositorySchema,
2966
+ installation: GitHubInstallationSchema.optional(),
2967
+ commits: z56.array(GitHubPushCommitSchema)
2968
+ });
2969
+ var GitHubInstallationEventSchema = z56.object({
2970
+ action: z56.enum(["created", "deleted", "suspend", "unsuspend"]),
2971
+ installation: z56.object({
2972
+ id: z56.number(),
2973
+ account: GitHubAccountSchema
2974
+ }),
2975
+ repositories: z56.array(z56.object({
2976
+ id: z56.number(),
2977
+ full_name: z56.string()
2978
+ })).optional()
2979
+ });
2980
+ var GitHubInstallationRepositoriesEventSchema = z56.object({
2981
+ action: z56.enum(["added", "removed"]),
2982
+ installation: z56.object({
2983
+ id: z56.number(),
2984
+ account: GitHubAccountSchema
2985
+ }),
2986
+ repositories_added: z56.array(z56.object({
2987
+ id: z56.number(),
2988
+ full_name: z56.string()
2989
+ })),
2990
+ repositories_removed: z56.array(z56.object({
2991
+ id: z56.number(),
2992
+ full_name: z56.string()
2993
+ }))
2994
+ });
2995
+ var GitHubWebhookHeadersSchema = z56.object({
2996
+ "x-github-event": z56.string(),
2997
+ "x-github-delivery": z56.string(),
2998
+ "x-hub-signature-256": z56.string().optional()
2999
+ });
3000
+
3001
+ // ../contracts/dist/github/requests.js
3002
+ import { z as z57 } from "zod";
3003
+ var CompleteGitHubInstallationRequestSchema = z57.object({
3004
+ organizationId: z57.string().min(1),
3005
+ installationId: z57.number().int().positive()
3006
+ });
3007
+ var ListGitHubRepositoriesRequestSchema = z57.object({
3008
+ organizationId: z57.string().min(1)
3009
+ });
3010
+
3011
+ // ../contracts/dist/github/responses.js
3012
+ import { z as z58 } from "zod";
3013
+ var GitHubInstallationRepoSchema = z58.object({
3014
+ id: z58.number(),
3015
+ full_name: z58.string(),
3016
+ name: z58.string(),
3017
+ owner: z58.string(),
3018
+ default_branch: z58.string()
3019
+ });
3020
+ var ListGitHubRepositoriesResponseSchema = z58.object({
3021
+ repositories: z58.array(GitHubInstallationRepoSchema),
3022
+ installed: z58.boolean(),
3023
+ gitHubOrgName: z58.string().optional()
3024
+ });
3025
+ var CompleteGitHubInstallationResponseSchema = z58.object({
3026
+ success: z58.boolean()
3027
+ });
3028
+
3029
+ // ../contracts/dist/training/requests.js
3030
+ import { z as z59 } from "zod";
3031
+ var TrainingTypeSchema = z59.enum(["quiz", "acknowledge", "instructor_led"]);
3032
+ var TrainingStatusSchema = z59.enum(["pending", "in_progress", "completed", "overdue"]);
3033
+ var TrainingOrgParamSchema = z59.object({
3034
+ orgId: z59.string().min(1)
3035
+ });
3036
+ var TrainingTaskParamSchema = z59.object({
3037
+ orgId: z59.string().min(1),
3038
+ taskId: z59.string().min(1)
3039
+ });
3040
+ var MyTrainingQuerySchema = z59.object({
3041
+ status: TrainingStatusSchema.optional(),
3042
+ documentId: z59.string().optional()
3043
+ });
3044
+ var TrainingDashboardQuerySchema = z59.object({
3045
+ status: TrainingStatusSchema.optional(),
3046
+ memberId: z59.string().optional(),
3047
+ documentId: z59.string().optional()
3048
+ });
3049
+ var StartTrainingRequestSchema = z59.object({});
3050
+ var SubmitQuizRequestSchema = z59.object({
3051
+ sessionId: z59.string().min(1),
3052
+ answers: z59.record(z59.string(), z59.union([z59.number(), z59.array(z59.number()), z59.boolean()]))
3053
+ });
3054
+ var AcknowledgeTrainingRequestSchema = z59.object({
3055
+ meaning: z59.string().min(1).max(500)
3056
+ });
3057
+ var BatchSignoffRequestSchema = z59.object({
3058
+ taskIds: z59.array(z59.string().min(1)).min(1),
3059
+ evidenceUrl: z59.string().url(),
3060
+ evidenceHash: z59.string().min(1),
3061
+ meaning: z59.string().min(1).max(500)
3062
+ });
3063
+ var QuizOptionSchema = z59.object({
3064
+ text: z59.string().min(1),
3065
+ correct: z59.boolean().optional(),
3066
+ explanation: z59.string().optional()
3067
+ });
3068
+ var QuizQuestionSchema = z59.object({
3069
+ type: z59.enum(["single-choice", "multi-choice", "true-false"]),
3070
+ text: z59.string().min(1),
3071
+ options: z59.array(QuizOptionSchema).optional(),
3072
+ correct: z59.boolean().optional(),
3073
+ explanation: z59.string().optional()
3074
+ });
3075
+ var QuizDefinitionSchema = z59.object({
3076
+ passingScore: z59.number().min(0).max(100).optional(),
3077
+ questions: z59.array(QuizQuestionSchema).min(1)
3078
+ });
3079
+ var CreateTrainingTaskRequestSchema = z59.object({
3080
+ memberId: z59.string().min(1),
3081
+ documentId: z59.string().min(1),
3082
+ documentVersion: z59.string().min(1),
3083
+ trainingType: TrainingTypeSchema,
3084
+ dueDays: z59.number().int().positive().optional(),
3085
+ /** Required for quiz-type training. Stored server-side for scoring. */
3086
+ quizDefinition: QuizDefinitionSchema.optional()
3087
+ });
3088
+ var UpdateTrainingSettingsRequestSchema = z59.object({
3089
+ defaultDueDays: z59.number().int().positive().optional(),
3090
+ passingScorePercent: z59.number().int().min(0).max(100).optional()
3091
+ });
3092
+ var BulkAssignTrainingRequestSchema = z59.object({
3093
+ department: z59.string().min(1),
3094
+ documentId: z59.string().min(1),
3095
+ documentVersion: z59.string().min(1),
3096
+ trainingType: TrainingTypeSchema,
3097
+ dueDays: z59.number().int().positive().optional()
3098
+ });
3099
+
3100
+ // ../contracts/dist/training/responses.js
3101
+ import { z as z60 } from "zod";
3102
+ var TrainingTaskResponseSchema = z60.object({
3103
+ id: z60.string(),
3104
+ organizationId: z60.string(),
3105
+ memberId: z60.string(),
3106
+ memberName: z60.string(),
3107
+ memberEmail: z60.string(),
3108
+ documentId: z60.string(),
3109
+ documentTitle: z60.string(),
3110
+ documentVersion: z60.string(),
3111
+ trainingType: TrainingTypeSchema,
3112
+ status: TrainingStatusSchema,
3113
+ dueDate: z60.string(),
3114
+ createdAt: z60.string(),
3115
+ startedAt: z60.string().optional(),
3116
+ completedAt: z60.string().optional(),
3117
+ quizScore: z60.number().optional(),
3118
+ signatureId: z60.string().optional(),
3119
+ evidenceUrl: z60.string().optional()
3120
+ });
3121
+ var QuizOptionResponseSchema = z60.object({
3122
+ text: z60.string()
3123
+ });
3124
+ var QuizQuestionTypeSchema = z60.enum(["single_choice", "multiple_choice", "true_false"]);
3125
+ var QuizQuestionResponseSchema = z60.object({
3126
+ type: QuizQuestionTypeSchema,
3127
+ text: z60.string(),
3128
+ options: z60.array(QuizOptionResponseSchema).optional()
3129
+ });
3130
+ var QuizSessionResponseSchema = z60.object({
3131
+ sessionId: z60.string(),
3132
+ questions: z60.array(QuizQuestionResponseSchema),
3133
+ questionCount: z60.number(),
3134
+ passingScore: z60.number(),
3135
+ savedAnswers: z60.record(z60.string(), z60.union([z60.number(), z60.array(z60.number()), z60.boolean()])).optional()
3136
+ });
3137
+ var QuizResultResponseSchema = z60.object({
3138
+ passed: z60.boolean(),
3139
+ score: z60.number(),
3140
+ passingScore: z60.number(),
3141
+ correctCount: z60.number(),
3142
+ totalCount: z60.number(),
3143
+ explanations: z60.record(z60.string(), z60.string()),
3144
+ signatureRequired: z60.boolean()
3145
+ });
3146
+ var TrainingStatsResponseSchema = z60.object({
3147
+ pending: z60.number(),
3148
+ inProgress: z60.number(),
3149
+ completed: z60.number(),
3150
+ overdue: z60.number(),
3151
+ completionRate: z60.number()
3152
+ });
3153
+ var TrainingDashboardResponseSchema = z60.object({
3154
+ stats: TrainingStatsResponseSchema,
3155
+ tasks: z60.array(TrainingTaskResponseSchema)
3156
+ });
3157
+ var TrainingSettingsResponseSchema = z60.object({
3158
+ defaultDueDays: z60.number(),
3159
+ passingScorePercent: z60.number()
3160
+ });
3161
+ var BulkAssignTrainingResponseSchema = z60.object({
3162
+ createdCount: z60.number(),
3163
+ skippedCount: z60.number(),
3164
+ memberNames: z60.array(z60.string())
3165
+ });
3166
+ var SigningEligibilityResponseSchema = z60.object({
3167
+ eligible: z60.boolean(),
3168
+ hasIncompleteTraining: z60.boolean()
3169
+ });
3170
+
3171
+ // ../contracts/dist/signing-requests/requests.js
3172
+ import { z as z61 } from "zod";
3173
+ var SigningFieldSchema = z61.object({
3174
+ id: z61.string().min(1),
3175
+ type: FieldTypeSchema,
3176
+ assignedSignerEmail: z61.string().email(),
3177
+ /** 1-based page index within the PDF document. */
3178
+ page: z61.number().int().positive(),
3179
+ /** Field left edge as a percentage of the page width (0–100). */
3180
+ x: z61.number().min(0).max(100),
3181
+ /** Field top edge as a percentage of the page height (0–100). */
3182
+ y: z61.number().min(0).max(100),
3183
+ /** Field width as a percentage of the page width (0–100). */
3184
+ width: z61.number().min(0).max(100),
3185
+ /** Field height as a percentage of the page height (0–100). */
3186
+ height: z61.number().min(0).max(100)
3187
+ });
3188
+ var SigningDocumentInputSchema = z61.object({
3189
+ fileName: z61.string().min(1),
3190
+ storagePath: z61.string().startsWith("signing-uploads/"),
3191
+ fileHash: z61.string().min(1),
3192
+ pageCount: z61.number().int().positive(),
3193
+ fields: z61.array(SigningFieldSchema).min(1)
3194
+ });
3195
+ var SignerInputSchema = z61.object({
3196
+ name: z61.string().min(1).max(200),
3197
+ email: z61.string().email(),
3198
+ meaning: z61.string().min(1).max(500)
3199
+ });
3200
+ var SigningRequestIdParamSchema = z61.object({
3201
+ signingRequestId: z61.string().min(1)
3202
+ });
3203
+ var ListSigningRequestsQuerySchema = z61.object({
3204
+ organizationId: z61.string().min(1),
3205
+ status: SigningRequestStatusSchema.optional(),
3206
+ limit: z61.coerce.number().int().positive().max(100).default(50),
3207
+ offset: z61.coerce.number().int().nonnegative().default(0)
3208
+ });
3209
+ var GetSigningRequestQuerySchema = z61.object({
3210
+ organizationId: z61.string().min(1)
3211
+ });
3212
+ var CreateSigningRequestSchema = z61.object({
3213
+ organizationId: z61.string().min(1),
3214
+ title: z61.string().min(1).max(200),
3215
+ description: z61.string().max(2e3).optional(),
3216
+ meaning: z61.string().min(1).max(500),
3217
+ expiresAt: z61.string().datetime(),
3218
+ signingDocuments: z61.array(SigningDocumentInputSchema).min(1),
3219
+ signers: z61.array(SignerInputSchema).min(1)
3220
+ });
3221
+ var CancelSigningRequestSchema = z61.object({
3222
+ organizationId: z61.string().min(1)
3223
+ });
3224
+ var RemindSignersSchema = z61.object({
3225
+ organizationId: z61.string().min(1)
3226
+ });
3227
+ var GetSigningCeremonyParamSchema = z61.object({
3228
+ token: z61.string().min(1)
3229
+ });
3230
+ var RequestVerificationCodeSchema = z61.object({
3231
+ token: z61.string().min(1)
3232
+ });
3233
+ var CompleteSigningCeremonySchema = z61.object({
3234
+ token: z61.string().min(1),
3235
+ verificationCode: z61.string().length(6),
3236
+ signatureImagePath: z61.string().startsWith("data:"),
3237
+ initialsImagePath: z61.string().startsWith("data:").optional(),
3238
+ fieldValues: z61.array(z61.object({
3239
+ fieldId: z61.string().min(1),
3240
+ type: FieldTypeSchema,
3241
+ value: z61.string().min(1).refine((v) => v.startsWith("data:") || /^\d{4}-\d{2}-\d{2}/.test(v), {
3242
+ message: "Value must be a data URL or a date string"
3243
+ })
3244
+ })).min(1),
3245
+ /** Part 11: ID of the ERSD version the signer accepted — required, 400 if missing */
3246
+ ersdDisclosureId: z61.string().min(1),
3247
+ /** Part 11: ISO timestamp when the signer accepted the ERSD — required, 400 if missing */
3248
+ ersdAcceptedAt: z61.string().datetime()
3249
+ });
3250
+
3251
+ // ../contracts/dist/signing-requests/responses.js
3252
+ import { z as z62 } from "zod";
3253
+ var SigningFieldResponseSchema = z62.object({
3254
+ id: z62.string(),
3255
+ type: FieldTypeSchema,
3256
+ assignedSignerEmail: z62.string(),
3257
+ page: z62.number(),
3258
+ x: z62.number(),
3259
+ y: z62.number(),
3260
+ width: z62.number(),
3261
+ height: z62.number()
3262
+ });
3263
+ var SigningDocumentResponseSchema = z62.object({
3264
+ fileName: z62.string(),
3265
+ storagePath: z62.string(),
3266
+ fileHash: z62.string(),
3267
+ pageCount: z62.number(),
3268
+ uploadedAt: z62.string(),
3269
+ fields: z62.array(SigningFieldResponseSchema)
3270
+ });
3271
+ var SignerResponseSchema = z62.object({
3272
+ name: z62.string(),
3273
+ email: z62.string(),
3274
+ meaning: z62.string(),
3275
+ status: SignerStatusSchema,
3276
+ signedAt: z62.string().optional()
3277
+ });
3278
+ var SigningAuditEntryResponseSchema = z62.object({
3279
+ id: z62.string(),
3280
+ eventType: z62.string(),
3281
+ actor: z62.string(),
3282
+ timestamp: z62.string(),
3283
+ details: z62.record(z62.unknown()).optional()
3284
+ });
3285
+ var SigningRequestSummaryResponseSchema = z62.object({
3286
+ id: z62.string(),
3287
+ title: z62.string(),
3288
+ status: SigningRequestStatusSchema,
3289
+ meaning: z62.string(),
3290
+ signerCount: z62.number(),
3291
+ signedCount: z62.number(),
3292
+ createdAt: z62.string(),
3293
+ expiresAt: z62.string()
3294
+ });
3295
+ var SigningRequestDetailResponseSchema = SigningRequestSummaryResponseSchema.extend({
3296
+ description: z62.string().optional(),
3297
+ createdBy: z62.string(),
3298
+ createdByEmail: z62.string(),
3299
+ signingDocuments: z62.array(SigningDocumentResponseSchema),
3300
+ signers: z62.array(SignerResponseSchema),
3301
+ auditTrail: z62.array(SigningAuditEntryResponseSchema)
3302
+ });
3303
+ var ListSigningRequestsResponseSchema = z62.object({
3304
+ signingRequests: z62.array(SigningRequestSummaryResponseSchema),
3305
+ total: z62.number()
3306
+ });
3307
+ var CeremonyDocumentResponseSchema = SigningDocumentResponseSchema.omit({
3308
+ storagePath: true
3309
+ });
3310
+ var CeremonyERSDResponseSchema = z62.object({
3311
+ id: z62.string(),
3312
+ content: z62.string(),
3313
+ version: z62.string()
3314
+ });
3315
+ var SigningCeremonyResponseSchema = z62.object({
3316
+ organizationName: z62.string(),
3317
+ title: z62.string(),
3318
+ description: z62.string().optional(),
3319
+ meaning: z62.string(),
3320
+ signerName: z62.string(),
3321
+ signerEmail: z62.string(),
3322
+ status: z62.enum(["ready", "already_signed", "expired", "cancelled"]),
3323
+ signingDocuments: z62.array(CeremonyDocumentResponseSchema),
3324
+ /** Only fields assigned to this signer */
3325
+ fields: z62.array(SigningFieldResponseSchema),
3326
+ /** Part 11: Electronic Record and Signature Disclosure — must be accepted before signing */
3327
+ ersd: CeremonyERSDResponseSchema
3328
+ });
3329
+ var DownloadSignedPdfResponseSchema = z62.object({
3330
+ downloadUrl: z62.string().url()
3331
+ });
3332
+
3333
+ // ../contracts/dist/notifications/requests.js
3334
+ import { z as z63 } from "zod";
3335
+ var NotificationTypeSchema = z63.enum([
3336
+ "training_assigned",
3337
+ "training_overdue",
3338
+ "release_submitted_for_review",
3339
+ "release_published",
3340
+ "signature_requested",
3341
+ "capa_overdue",
3342
+ "nc_overdue",
3343
+ "complaint_overdue",
3344
+ "action_overdue",
3345
+ "objective_threshold_breach",
3346
+ "review_due_soon",
3347
+ "review_auto_drafted",
3348
+ "review_overdue"
3349
+ ]);
3350
+ var NotificationOrgParamSchema = z63.object({
3351
+ orgId: z63.string().min(1)
3352
+ });
3353
+ var NotificationIdParamSchema = z63.object({
3354
+ orgId: z63.string().min(1),
3355
+ notificationId: z63.string().min(1)
3356
+ });
3357
+ var NotificationQuerySchema = z63.object({
3358
+ unreadOnly: z63.enum(["true", "false"]).optional(),
3359
+ type: NotificationTypeSchema.optional(),
3360
+ limit: z63.coerce.number().int().positive().max(100).optional()
3361
+ });
3362
+
3363
+ // ../contracts/dist/notifications/responses.js
3364
+ import { z as z64 } from "zod";
3365
+ var NotificationResponseSchema = z64.object({
3366
+ id: z64.string(),
3367
+ type: NotificationTypeSchema,
3368
+ title: z64.string(),
3369
+ body: z64.string(),
3370
+ resourceType: z64.string(),
3371
+ resourceId: z64.string(),
3372
+ deepLink: z64.string(),
3373
+ read: z64.boolean(),
3374
+ createdAt: z64.string()
3375
+ });
3376
+ var NotificationListResponseSchema = z64.object({
3377
+ notifications: z64.array(NotificationResponseSchema),
3378
+ unreadCount: z64.number()
3379
+ });
3380
+
3381
+ // ../contracts/dist/billing/requests.js
3382
+ import { z as z65 } from "zod";
3383
+ var CreateCheckoutSessionRequestSchema = z65.object({
3384
+ organizationId: z65.string().min(1)
3385
+ });
3386
+ var CreatePortalSessionRequestSchema = z65.object({
3387
+ organizationId: z65.string().min(1)
3388
+ });
3389
+
3390
+ // ../contracts/dist/quality-metrics/responses.js
3391
+ import { z as z66 } from "zod";
3392
+ var MonthlyCountSchema = z66.object({
3393
+ month: z66.string(),
3394
+ // 'YYYY-MM'
3395
+ opened: z66.number(),
3396
+ closed: z66.number()
3397
+ });
3398
+ var CapaMetricsSchema = z66.object({
3399
+ total: z66.number(),
3400
+ byStatus: z66.record(z66.string(), z66.number()),
3401
+ overdue: z66.number(),
3402
+ avgCycleTimeDays: z66.number().nullable(),
3403
+ trend: z66.array(MonthlyCountSchema)
3404
+ });
3405
+ var NcMetricsSchema = z66.object({
3406
+ total: z66.number(),
3407
+ byStatus: z66.record(z66.string(), z66.number()),
3408
+ bySeverity: z66.record(z66.string(), z66.number()),
3409
+ overdue: z66.number(),
3410
+ avgCycleTimeDays: z66.number().nullable(),
3411
+ trend: z66.array(MonthlyCountSchema)
3412
+ });
3413
+ var ComplaintMetricsSchema = z66.object({
3414
+ total: z66.number(),
3415
+ byStatus: z66.record(z66.string(), z66.number()),
3416
+ bySeverity: z66.record(z66.string(), z66.number()),
3417
+ overdue: z66.number(),
3418
+ reportableCount: z66.number(),
3419
+ avgCycleTimeDays: z66.number().nullable(),
3420
+ trend: z66.array(MonthlyCountSchema)
3421
+ });
3422
+ var TrainingMetricsSchema = z66.object({
3423
+ totalTasks: z66.number(),
3424
+ complianceRate: z66.number(),
3425
+ // 0-100
3426
+ byStatus: z66.record(z66.string(), z66.number()),
3427
+ overdue: z66.number()
3428
+ });
3429
+ var ReleaseMetricsSchema = z66.object({
3430
+ total: z66.number(),
3431
+ byStatus: z66.record(z66.string(), z66.number()),
3432
+ avgCycleTimeDays: z66.number().nullable()
3433
+ });
3434
+ var AuditMetricsSchema = z66.object({
3435
+ totalSchedules: z66.number(),
3436
+ totalReports: z66.number(),
3437
+ findingsMajor: z66.number(),
3438
+ findingsMinor: z66.number(),
3439
+ findingsObservations: z66.number()
3440
+ });
3441
+ var QualityMetricsResponseSchema = z66.object({
3442
+ generatedAt: z66.string(),
3443
+ period: z66.object({
3444
+ from: z66.string(),
3445
+ to: z66.string()
3446
+ }),
3447
+ capas: CapaMetricsSchema,
3448
+ nonconformances: NcMetricsSchema,
3449
+ complaints: ComplaintMetricsSchema,
3450
+ training: TrainingMetricsSchema,
3451
+ releases: ReleaseMetricsSchema,
3452
+ audits: AuditMetricsSchema
3453
+ });
3454
+ var QualityMetricsQuerySchema = z66.object({
3455
+ period: z66.enum(["30d", "90d", "365d"]).optional().default("90d")
3456
+ });
3457
+
3458
+ // ../contracts/dist/api-keys/requests.js
3459
+ import { z as z67 } from "zod";
3460
+ var ApiKeyOrgParamSchema = z67.object({
3461
+ orgId: z67.string().min(1)
3462
+ });
3463
+ var ApiKeyIdParamSchema = z67.object({
3464
+ orgId: z67.string().min(1),
3465
+ apiKeyId: z67.string().min(1)
3466
+ });
3467
+ var CreateApiKeyRequestSchema = z67.object({
3468
+ name: z67.string().min(1).max(100)
3469
+ });
3470
+
3471
+ // ../contracts/dist/api-keys/responses.js
3472
+ import { z as z68 } from "zod";
3473
+ var ApiKeyResponseSchema = z68.object({
3474
+ id: z68.string(),
3475
+ name: z68.string(),
3476
+ prefix: z68.string(),
3477
+ createdAt: z68.string(),
3478
+ lastUsedAt: z68.string().nullable(),
3479
+ createdBy: z68.string(),
3480
+ createdByEmail: z68.string()
3481
+ });
3482
+ var CreateApiKeyResponseSchema = z68.object({
3483
+ id: z68.string(),
3484
+ name: z68.string(),
3485
+ key: z68.string(),
3486
+ prefix: z68.string(),
3487
+ createdAt: z68.string()
3488
+ });
3489
+ var ApiKeyListResponseSchema = z68.object({
3490
+ keys: z68.array(ApiKeyResponseSchema)
3491
+ });
3492
+
3493
+ // ../contracts/dist/compliance/requests.js
3494
+ import { z as z69 } from "zod";
3495
+ var CompliancePackageStatusEnum = z69.enum([
3496
+ "pending",
3497
+ "in_progress",
3498
+ "completed",
3499
+ "failed"
3500
+ ]);
3501
+ var CompliancePackageSectionEnum = z69.enum([
3502
+ "system_description",
3503
+ "electronic_signatures",
3504
+ "audit_trails",
3505
+ "access_controls",
3506
+ "change_control",
3507
+ "dhr_attestation",
3508
+ "compiled_documents"
3509
+ ]);
3510
+ var ComplianceOrgParamSchema = z69.object({
3511
+ orgId: z69.string().min(1)
3512
+ });
3513
+ var CompliancePackageParamSchema = z69.object({
3514
+ orgId: z69.string().min(1),
3515
+ packageId: z69.string().min(1)
3516
+ });
3517
+ var GenerateCompliancePackageRequestSchema = z69.object({
3518
+ /** Safety class determines which sections and depth of evidence to include */
3519
+ safetyClass: SafetyClassSchema,
3520
+ /** Sections to include; defaults to all if omitted */
3521
+ sections: z69.array(CompliancePackageSectionEnum).min(1).optional(),
3522
+ /** Optional date range filter for audit trail entries */
3523
+ auditTrailFrom: z69.string().datetime().optional(),
3524
+ auditTrailTo: z69.string().datetime().optional(),
3525
+ /** Optional release ID to scope signatures and change control to a specific release */
3526
+ releaseId: z69.string().optional()
3527
+ });
3528
+
3529
+ // ../contracts/dist/compliance/responses.js
3530
+ import { z as z70 } from "zod";
3531
+ var CompliancePackageResponseSchema = z70.object({
3532
+ id: z70.string(),
3533
+ organizationId: z70.string(),
3534
+ status: CompliancePackageStatusEnum,
3535
+ safetyClass: SafetyClassSchema,
3536
+ sections: z70.array(CompliancePackageSectionEnum),
3537
+ /** Requesting member info */
3538
+ requestedById: z70.string(),
3539
+ requestedByName: z70.string(),
3540
+ requestedAt: z70.string(),
3541
+ /** Completion timestamps */
3542
+ completedAt: z70.string().optional(),
3543
+ /** Expiry for the download URL */
3544
+ downloadExpiresAt: z70.string().optional(),
3545
+ /** Error message — only present when status is 'failed' */
3546
+ errorMessage: z70.string().optional(),
3547
+ /** Optional scoping filters used during generation */
3548
+ releaseId: z70.string().optional(),
3549
+ auditTrailFrom: z70.string().optional(),
3550
+ auditTrailTo: z70.string().optional()
3551
+ });
3552
+ var CompliancePackageListResponseSchema = z70.object({
3553
+ packages: z70.array(CompliancePackageResponseSchema)
3554
+ });
3555
+ var ValidationPackageResponseSchema = z70.object({
3556
+ downloadUrl: z70.string().url(),
3557
+ version: z70.string(),
3558
+ lastUpdated: z70.string()
3559
+ });
3560
+
3561
+ // ../contracts/dist/compliance/readiness.js
3562
+ import { z as z71 } from "zod";
3563
+ var ReadinessSeveritySchema = z71.enum(["error", "warning", "info"]);
3564
+ var ReadinessItemSchema = z71.object({
3565
+ severity: ReadinessSeveritySchema,
3566
+ message: z71.string(),
3567
+ documentId: z71.string().optional(),
3568
+ releaseId: z71.string().optional(),
3569
+ action: z71.string()
3570
+ });
3571
+ var ReadinessDimensionSchema = z71.object({
3572
+ name: z71.string(),
3573
+ score: z71.number().min(0).max(100),
3574
+ weight: z71.number().min(0).max(1),
3575
+ details: z71.string(),
3576
+ items: z71.array(ReadinessItemSchema)
3577
+ });
3578
+ var ComplianceReadinessResponseSchema = z71.object({
3579
+ overallScore: z71.number().min(0).max(100),
3580
+ calculatedAt: z71.string(),
3581
+ dimensions: z71.array(ReadinessDimensionSchema)
3582
+ });
3583
+
3584
+ // ../contracts/dist/actions/requests.js
3585
+ import { z as z72 } from "zod";
3586
+
3587
+ // ../contracts/dist/domain-types/action.js
3588
+ var ACTION_STATUSES = ["open", "in_progress", "completed", "cancelled"];
3589
+ var ACTION_PRIORITIES = ["low", "medium", "high", "critical"];
3590
+ var ACTION_SOURCE_TYPES = [
3591
+ "capa",
3592
+ "nonconformance",
3593
+ "complaint",
3594
+ "management_review",
3595
+ "custom_review",
3596
+ "audit_finding",
3597
+ "quality_objective"
3598
+ ];
3599
+
3600
+ // ../contracts/dist/actions/requests.js
3601
+ var ActionSourceSchema = z72.object({
3602
+ type: z72.enum(ACTION_SOURCE_TYPES),
3603
+ id: z72.string().min(1),
3604
+ displayNumber: z72.string().optional()
3605
+ });
3606
+ var CreateActionRequestSchema = z72.object({
3607
+ title: z72.string().min(1).max(200),
3608
+ description: z72.string().min(1).max(5e3),
3609
+ source: ActionSourceSchema,
3610
+ assigneeDepartment: z72.string().min(1),
3611
+ assigneeDepartmentRole: z72.enum(["manager", "member"]),
3612
+ assigneeId: z72.string().optional(),
3613
+ priority: z72.enum(ACTION_PRIORITIES),
3614
+ dueDate: z72.string().datetime()
3615
+ });
3616
+ var UpdateActionRequestSchema = z72.object({
3617
+ title: z72.string().min(1).max(200).optional(),
3618
+ description: z72.string().min(1).max(5e3).optional(),
3619
+ assigneeDepartment: z72.string().min(1).optional(),
3620
+ assigneeDepartmentRole: z72.enum(["manager", "member"]).optional(),
3621
+ assigneeId: z72.string().nullable().optional(),
3622
+ priority: z72.enum(ACTION_PRIORITIES).optional(),
3623
+ dueDate: z72.string().datetime().optional(),
3624
+ notes: z72.string().max(5e3).optional()
3625
+ });
3626
+ var ListActionsQuerySchema = z72.object({
3627
+ sourceType: z72.enum(ACTION_SOURCE_TYPES).optional(),
3628
+ sourceId: z72.string().optional(),
3629
+ status: z72.enum(ACTION_STATUSES).optional(),
3630
+ assigneeDepartment: z72.string().optional(),
3631
+ priority: z72.enum(ACTION_PRIORITIES).optional(),
3632
+ page: z72.coerce.number().int().positive().default(1),
3633
+ limit: z72.coerce.number().int().positive().max(100).default(20)
3634
+ });
3635
+ var CompleteActionRequestSchema = z72.object({
3636
+ notes: z72.string().max(5e3).optional()
3637
+ });
3638
+ var QmsActionParamSchema = z72.object({
3639
+ orgId: z72.string().min(1),
3640
+ qmsId: z72.string().min(1)
3641
+ });
3642
+ var ActionIdParamSchema = z72.object({
3643
+ orgId: z72.string().min(1),
3644
+ qmsId: z72.string().min(1),
3645
+ actionId: z72.string().min(1)
3646
+ });
3647
+
3648
+ // ../contracts/dist/actions/responses.js
3649
+ import { z as z73 } from "zod";
3650
+ var ActionResponseSchema = z73.object({
3651
+ id: z73.string(),
3652
+ actionNumber: z73.string(),
3653
+ title: z73.string(),
3654
+ description: z73.string(),
3655
+ source: z73.object({
3656
+ type: z73.enum(ACTION_SOURCE_TYPES),
3657
+ id: z73.string(),
3658
+ displayNumber: z73.string().optional()
3659
+ }),
3660
+ assigneeDepartment: z73.string(),
3661
+ assigneeDepartmentRole: z73.enum(["manager", "member"]),
3662
+ assigneeId: z73.string().nullable(),
3663
+ priority: z73.enum(ACTION_PRIORITIES),
3664
+ dueDate: z73.string(),
3665
+ status: z73.enum(ACTION_STATUSES),
3666
+ isOverdue: z73.boolean(),
3667
+ completedAt: z73.string().nullable(),
3668
+ completedBy: z73.string().nullable(),
3669
+ notes: z73.string().nullable(),
3670
+ createdAt: z73.string(),
3671
+ createdBy: z73.string(),
3672
+ updatedAt: z73.string()
3673
+ });
3674
+ var ListActionsResponseSchema = z73.object({
3675
+ items: z73.array(ActionResponseSchema),
3676
+ total: z73.number(),
3677
+ page: z73.number(),
3678
+ limit: z73.number(),
3679
+ hasMore: z73.boolean()
3680
+ });
3681
+
3682
+ // ../contracts/dist/quality-objectives/requests.js
3683
+ import { z as z74 } from "zod";
3684
+
3685
+ // ../contracts/dist/domain-types/quality-objective.js
3686
+ var OBJECTIVE_TYPES = ["auto", "manual"];
3687
+ var OBJECTIVE_STATUSES = ["on_track", "at_risk", "off_target", "not_started"];
3688
+ var OBJECTIVE_DIRECTIONS = ["above", "below"];
3689
+ var OBJECTIVE_CADENCES = ["monthly", "quarterly", "annual"];
3690
+ var AUTO_METRIC_SOURCES = [
3691
+ "capa.avgCycleTimeDays",
3692
+ "capa.overdueCount",
3693
+ "capa.openCount",
3694
+ "nonconformance.avgCycleTimeDays",
3695
+ "nonconformance.overdueCount",
3696
+ "nonconformance.openCount",
3697
+ "complaint.avgCycleTimeDays",
3698
+ "complaint.overdueCount",
3699
+ "complaint.reportableCount",
3700
+ "training.complianceRate",
3701
+ "training.overdueCount",
3702
+ "release.avgCycleTimeDays",
3703
+ "audit.findingsMajor",
3704
+ "audit.findingsMinor"
3705
+ ];
3706
+
3707
+ // ../contracts/dist/quality-objectives/requests.js
3708
+ var AlertRecipientSchema = z74.object({
3709
+ department: z74.string().min(1),
3710
+ departmentRole: z74.enum(["manager", "member"])
3711
+ });
3712
+ var CreateQualityObjectiveRequestSchema = z74.object({
3713
+ title: z74.string().min(1).max(200),
3714
+ description: z74.string().min(1).max(5e3),
3715
+ type: z74.enum(OBJECTIVE_TYPES),
3716
+ metricSource: z74.enum(AUTO_METRIC_SOURCES).optional(),
3717
+ unit: z74.string().min(1).max(50),
3718
+ target: z74.number(),
3719
+ direction: z74.enum(OBJECTIVE_DIRECTIONS),
3720
+ warningThreshold: z74.number(),
3721
+ ownerDepartment: z74.string().min(1),
3722
+ ownerDepartmentRole: z74.enum(["manager", "member"]),
3723
+ alertRecipients: z74.array(AlertRecipientSchema).default([]),
3724
+ reviewCadence: z74.enum(OBJECTIVE_CADENCES),
3725
+ effectiveDate: z74.string().datetime(),
3726
+ targetDate: z74.string().datetime().optional()
3727
+ });
3728
+ var UpdateQualityObjectiveRequestSchema = z74.object({
3729
+ title: z74.string().min(1).max(200).optional(),
3730
+ description: z74.string().min(1).max(5e3).optional(),
3731
+ unit: z74.string().min(1).max(50).optional(),
3732
+ target: z74.number().optional(),
3733
+ direction: z74.enum(OBJECTIVE_DIRECTIONS).optional(),
3734
+ warningThreshold: z74.number().optional(),
3735
+ ownerDepartment: z74.string().min(1).optional(),
3736
+ ownerDepartmentRole: z74.enum(["manager", "member"]).optional(),
3737
+ alertRecipients: z74.array(AlertRecipientSchema).optional(),
3738
+ reviewCadence: z74.enum(OBJECTIVE_CADENCES).optional(),
3739
+ targetDate: z74.string().datetime().nullable().optional()
3740
+ });
3741
+ var RecordObjectiveValueRequestSchema = z74.object({
3742
+ value: z74.number(),
3743
+ note: z74.string().max(1e3).optional()
3744
+ });
3745
+ var ListQualityObjectivesQuerySchema = z74.object({
3746
+ type: z74.enum(OBJECTIVE_TYPES).optional(),
3747
+ status: z74.enum(OBJECTIVE_STATUSES).optional(),
3748
+ isActive: z74.enum(["true", "false"]).transform((v) => v === "true").optional(),
3749
+ page: z74.coerce.number().int().positive().default(1),
3750
+ limit: z74.coerce.number().int().positive().max(100).default(20)
3751
+ });
3752
+ var QmsObjectiveParamSchema = z74.object({
3753
+ orgId: z74.string().min(1),
3754
+ qmsId: z74.string().min(1)
3755
+ });
3756
+ var ObjectiveIdParamSchema = z74.object({
3757
+ orgId: z74.string().min(1),
3758
+ qmsId: z74.string().min(1),
3759
+ objectiveId: z74.string().min(1)
3760
+ });
3761
+
3762
+ // ../contracts/dist/quality-objectives/responses.js
3763
+ import { z as z75 } from "zod";
3764
+ var QualityObjectiveSnapshotResponseSchema = z75.object({
3765
+ id: z75.string(),
3766
+ value: z75.number(),
3767
+ status: z75.enum(OBJECTIVE_STATUSES),
3768
+ source: z75.enum(["auto", "manual", "review"]),
3769
+ reviewId: z75.string().nullable(),
3770
+ capturedAt: z75.string(),
3771
+ capturedBy: z75.string().nullable()
3772
+ });
3773
+ var QualityObjectiveResponseSchema = z75.object({
3774
+ id: z75.string(),
3775
+ objectiveNumber: z75.string(),
3776
+ title: z75.string(),
3777
+ description: z75.string(),
3778
+ type: z75.enum(OBJECTIVE_TYPES),
3779
+ metricSource: z75.enum(AUTO_METRIC_SOURCES).nullable(),
3780
+ unit: z75.string(),
3781
+ target: z75.number(),
3782
+ direction: z75.enum(OBJECTIVE_DIRECTIONS),
3783
+ warningThreshold: z75.number(),
3784
+ currentValue: z75.number().nullable(),
3785
+ currentValueUpdatedAt: z75.string().nullable(),
3786
+ status: z75.enum(OBJECTIVE_STATUSES),
3787
+ ownerDepartment: z75.string(),
3788
+ ownerDepartmentRole: z75.enum(["manager", "member"]),
3789
+ alertRecipients: z75.array(z75.object({
3790
+ department: z75.string(),
3791
+ departmentRole: z75.enum(["manager", "member"])
3792
+ })),
3793
+ reviewCadence: z75.enum(OBJECTIVE_CADENCES),
3794
+ effectiveDate: z75.string(),
3795
+ targetDate: z75.string().nullable(),
3796
+ isActive: z75.boolean(),
3797
+ createdAt: z75.string(),
3798
+ createdBy: z75.string(),
3799
+ updatedAt: z75.string(),
3800
+ // Optional: included when fetching detail with snapshots
3801
+ recentSnapshots: z75.array(QualityObjectiveSnapshotResponseSchema).optional()
3802
+ });
3803
+ var ListQualityObjectivesResponseSchema = z75.object({
3804
+ items: z75.array(QualityObjectiveResponseSchema),
3805
+ total: z75.number(),
3806
+ page: z75.number(),
3807
+ limit: z75.number(),
3808
+ hasMore: z75.boolean()
3809
+ });
3810
+
3811
+ // ../contracts/dist/review-types/requests.js
3812
+ import { z as z76 } from "zod";
3813
+
3814
+ // ../contracts/dist/domain-types/quality-review.js
3815
+ var REVIEW_STATUSES = [
3816
+ "scheduled",
3817
+ "draft",
3818
+ "in_progress",
3819
+ "completed",
3820
+ "cancelled"
3821
+ ];
3822
+ var REVIEW_CADENCES = ["monthly", "quarterly", "semi_annual", "annual"];
3823
+ var REVIEW_DATA_SOURCES = [
3824
+ "capas",
3825
+ "nonconformances",
3826
+ "complaints",
3827
+ "training",
3828
+ "releases",
3829
+ "audits"
3830
+ ];
3831
+
3832
+ // ../contracts/dist/review-types/requests.js
3833
+ var CreateReviewTypeRequestSchema = z76.object({
3834
+ name: z76.string().min(1).max(200),
3835
+ dataSources: z76.array(z76.enum(REVIEW_DATA_SOURCES)).min(1),
3836
+ requiredSections: z76.array(z76.string().min(1)).default([]),
3837
+ ownerDepartment: z76.string().min(1),
3838
+ ownerDepartmentRole: z76.enum(["manager", "member"]),
3839
+ cadence: z76.enum(REVIEW_CADENCES),
3840
+ advanceNotificationDays: z76.number().int().min(1).max(30).default(7),
3841
+ includeObjectives: z76.boolean().default(false)
3842
+ });
3843
+ var UpdateReviewTypeRequestSchema = z76.object({
3844
+ name: z76.string().min(1).max(200).optional(),
3845
+ dataSources: z76.array(z76.enum(REVIEW_DATA_SOURCES)).min(1).optional(),
3846
+ requiredSections: z76.array(z76.string().min(1)).optional(),
3847
+ ownerDepartment: z76.string().min(1).optional(),
3848
+ ownerDepartmentRole: z76.enum(["manager", "member"]).optional(),
3849
+ cadence: z76.enum(REVIEW_CADENCES).optional(),
3850
+ advanceNotificationDays: z76.number().int().min(1).max(30).optional(),
3851
+ includeObjectives: z76.boolean().optional()
3852
+ });
3853
+ var QmsReviewTypeParamSchema = z76.object({
3854
+ orgId: z76.string().min(1),
3855
+ qmsId: z76.string().min(1)
3856
+ });
3857
+ var ReviewTypeIdParamSchema = z76.object({
3858
+ orgId: z76.string().min(1),
3859
+ qmsId: z76.string().min(1),
3860
+ reviewTypeId: z76.string().min(1)
3861
+ });
3862
+
3863
+ // ../contracts/dist/review-types/responses.js
3864
+ import { z as z77 } from "zod";
3865
+ var ReviewTypeResponseSchema = z77.object({
3866
+ id: z77.string(),
3867
+ name: z77.string(),
3868
+ isBuiltIn: z77.boolean(),
3869
+ dataSources: z77.array(z77.enum(REVIEW_DATA_SOURCES)),
3870
+ requiredSections: z77.array(z77.string()),
3871
+ ownerDepartment: z77.string(),
3872
+ ownerDepartmentRole: z77.enum(["manager", "member"]),
3873
+ cadence: z77.enum(REVIEW_CADENCES),
3874
+ advanceNotificationDays: z77.number(),
3875
+ includeObjectives: z77.boolean(),
3876
+ isActive: z77.boolean(),
3877
+ createdAt: z77.string(),
3878
+ updatedAt: z77.string()
3879
+ });
3880
+ var ListReviewTypesResponseSchema = z77.object({
3881
+ items: z77.array(ReviewTypeResponseSchema)
3882
+ });
3883
+
3884
+ // ../contracts/dist/quality-reviews/requests.js
3885
+ import { z as z78 } from "zod";
3886
+ var CreateQualityReviewRequestSchema = z78.object({
3887
+ reviewTypeId: z78.string().min(1),
3888
+ title: z78.string().min(1).max(200),
3889
+ scheduledDate: z78.string().datetime(),
3890
+ reviewPeriod: z78.object({
3891
+ from: z78.string().datetime(),
3892
+ to: z78.string().datetime()
3893
+ })
3894
+ });
3895
+ var AddDecisionRequestSchema = z78.object({
3896
+ description: z78.string().min(1).max(2e3),
3897
+ decidedBy: z78.string().min(1)
3898
+ });
3899
+ var AddAttendeeRequestSchema = z78.object({
3900
+ memberId: z78.string().min(1),
3901
+ name: z78.string().min(1),
3902
+ department: z78.string().min(1),
3903
+ role: z78.string().min(1)
3904
+ });
3905
+ var UpdateReviewNotesRequestSchema = z78.object({
3906
+ notes: z78.string().max(1e4)
3907
+ });
3908
+ var ListQualityReviewsQuerySchema = z78.object({
3909
+ reviewTypeId: z78.string().optional(),
3910
+ status: z78.enum(REVIEW_STATUSES).optional(),
3911
+ page: z78.coerce.number().int().positive().default(1),
3912
+ limit: z78.coerce.number().int().positive().max(100).default(20)
3913
+ });
3914
+ var QmsReviewParamSchema = z78.object({
3915
+ orgId: z78.string().min(1),
3916
+ qmsId: z78.string().min(1)
3917
+ });
3918
+ var ReviewIdParamSchema = z78.object({
3919
+ orgId: z78.string().min(1),
3920
+ qmsId: z78.string().min(1),
3921
+ reviewId: z78.string().min(1)
3922
+ });
3923
+
3924
+ // ../contracts/dist/quality-reviews/responses.js
3925
+ import { z as z79 } from "zod";
3926
+ var MonthlyTrendSchema = z79.object({
3927
+ month: z79.string(),
3928
+ opened: z79.number(),
3929
+ closed: z79.number()
3930
+ });
3931
+ var ReviewDataSnapshotSchema = z79.object({
3932
+ capas: z79.object({
3933
+ total: z79.number(),
3934
+ open: z79.number(),
3935
+ overdue: z79.number(),
3936
+ avgCycleTimeDays: z79.number().nullable(),
3937
+ trend: z79.array(MonthlyTrendSchema)
3938
+ }).optional(),
3939
+ nonconformances: z79.object({
3940
+ total: z79.number(),
3941
+ open: z79.number(),
3942
+ overdue: z79.number(),
3943
+ avgCycleTimeDays: z79.number().nullable(),
3944
+ bySeverity: z79.record(z79.string(), z79.number()),
3945
+ trend: z79.array(MonthlyTrendSchema)
3946
+ }).optional(),
3947
+ complaints: z79.object({
3948
+ total: z79.number(),
3949
+ open: z79.number(),
3950
+ overdue: z79.number(),
3951
+ reportableCount: z79.number(),
3952
+ trend: z79.array(MonthlyTrendSchema)
3953
+ }).optional(),
3954
+ training: z79.object({
3955
+ totalTasks: z79.number(),
3956
+ complianceRate: z79.number(),
3957
+ overdue: z79.number()
3958
+ }).optional(),
3959
+ releases: z79.object({
3960
+ total: z79.number(),
3961
+ avgCycleTimeDays: z79.number().nullable()
3962
+ }).optional(),
3963
+ audits: z79.object({
3964
+ totalFindings: z79.number(),
3965
+ major: z79.number(),
3966
+ minor: z79.number(),
3967
+ observations: z79.number()
3968
+ }).optional()
3969
+ });
3970
+ var ReviewObjectiveSnapshotSchema = z79.object({
3971
+ objectiveId: z79.string(),
3972
+ title: z79.string(),
3973
+ target: z79.number(),
3974
+ value: z79.number().nullable(),
3975
+ status: z79.string(),
3976
+ direction: z79.string(),
3977
+ unit: z79.string()
3978
+ });
3979
+ var ReviewDecisionSchema = z79.object({
3980
+ description: z79.string(),
3981
+ decidedBy: z79.string()
3982
+ });
3983
+ var ReviewAttendeeSchema = z79.object({
3984
+ memberId: z79.string(),
3985
+ name: z79.string(),
3986
+ department: z79.string(),
3987
+ role: z79.string()
3988
+ });
3989
+ var QualityReviewResponseSchema = z79.object({
3990
+ id: z79.string(),
3991
+ reviewNumber: z79.string(),
3992
+ title: z79.string(),
3993
+ reviewTypeId: z79.string(),
3994
+ reviewTypeName: z79.string(),
3995
+ status: z79.enum(REVIEW_STATUSES),
3996
+ scheduledDate: z79.string(),
3997
+ conductedDate: z79.string().nullable(),
3998
+ reviewPeriod: z79.object({
3999
+ from: z79.string(),
4000
+ to: z79.string()
4001
+ }),
4002
+ ownerDepartment: z79.string(),
4003
+ ownerDepartmentRole: z79.enum(["manager", "member"]),
4004
+ dataSources: z79.array(z79.enum(REVIEW_DATA_SOURCES)),
4005
+ attendees: z79.array(ReviewAttendeeSchema),
4006
+ dataSnapshot: ReviewDataSnapshotSchema,
4007
+ objectiveSnapshots: z79.array(ReviewObjectiveSnapshotSchema),
4008
+ decisions: z79.array(ReviewDecisionSchema),
4009
+ notes: z79.string().nullable(),
4010
+ completedAt: z79.string().nullable(),
4011
+ completedBy: z79.string().nullable(),
4012
+ createdAt: z79.string(),
4013
+ createdBy: z79.string(),
4014
+ updatedAt: z79.string()
4015
+ });
4016
+ var ListQualityReviewsResponseSchema = z79.object({
4017
+ items: z79.array(QualityReviewResponseSchema),
4018
+ total: z79.number(),
4019
+ page: z79.number(),
4020
+ limit: z79.number(),
4021
+ hasMore: z79.boolean()
4022
+ });
4023
+
4024
+ // ../contracts/dist/quality-findings/responses.js
4025
+ import { z as z80 } from "zod";
4026
+ var QUALITY_FINDING_CODES = [
4027
+ "review_overdue",
4028
+ "action_overdue",
4029
+ "objective_off_target",
4030
+ "review_actions_incomplete"
4031
+ ];
4032
+ var QUALITY_FINDING_SEVERITIES = ["error", "warning"];
4033
+ var QualityFindingSchema = z80.object({
4034
+ code: z80.enum(QUALITY_FINDING_CODES),
4035
+ severity: z80.enum(QUALITY_FINDING_SEVERITIES),
4036
+ entityId: z80.string(),
4037
+ entityTitle: z80.string(),
4038
+ message: z80.string(),
4039
+ metadata: z80.record(z80.unknown()).optional()
4040
+ });
4041
+ var QualityFindingsResponseSchema = z80.object({
4042
+ findings: z80.array(QualityFindingSchema),
4043
+ summary: z80.object({
4044
+ errorCount: z80.number(),
4045
+ warningCount: z80.number(),
4046
+ overdueActions: z80.number(),
4047
+ overdueReviews: z80.number(),
4048
+ offTargetObjectives: z80.number(),
4049
+ incompleteReviewActions: z80.number()
4050
+ })
4051
+ });
4052
+
4053
+ // ../contracts/dist/frameworks/requests.js
4054
+ import { z as z81 } from "zod";
4055
+ var GetFrameworksQuerySchema = z81.object({
4056
+ scope: FrameworkScopeSchema.optional()
4057
+ });
4058
+ var GetFrameworkParamsSchema = z81.object({
4059
+ frameworkId: RegulatoryFrameworkSchema
4060
+ });
4061
+ var GetClauseMappingsParamsSchema = z81.object({
4062
+ frameworkId: RegulatoryFrameworkSchema,
4063
+ clauseId: z81.string().min(1)
4064
+ });
4065
+ var GetCrosswalkQuerySchema = z81.object({
4066
+ targetFrameworkId: RegulatoryFrameworkSchema
4067
+ });
4068
+ var GetQmsComplianceParamsSchema = z81.object({
4069
+ orgId: z81.string().min(1)
4070
+ });
4071
+ var GetQmsComplianceQuerySchema = z81.object({
4072
+ repositoryId: z81.string().min(1)
4073
+ });
4074
+ var GetDeviceComplianceParamsSchema = z81.object({
4075
+ orgId: z81.string().min(1),
4076
+ deviceId: z81.string().min(1)
4077
+ });
4078
+ var GetDeviceFrameworkComplianceParamsSchema = z81.object({
4079
+ orgId: z81.string().min(1),
4080
+ deviceId: z81.string().min(1),
4081
+ frameworkId: RegulatoryFrameworkSchema
4082
+ });
4083
+
4084
+ // ../contracts/dist/frameworks/responses.js
4085
+ import { z as z82 } from "zod";
4086
+ var FrameworkSummarySchema = z82.object({
4087
+ id: RegulatoryFrameworkSchema,
4088
+ name: z82.string(),
4089
+ version: z82.string(),
4090
+ scope: FrameworkScopeSchema,
4091
+ url: z82.string().nullable(),
4092
+ active: z82.boolean(),
4093
+ clauseCount: z82.number().int().nonnegative()
4094
+ });
4095
+ var FrameworksListResponseSchema = z82.object({
4096
+ frameworks: z82.array(FrameworkSummarySchema)
4097
+ });
4098
+ var ClauseNodeSchema = z82.lazy(() => z82.object({
4099
+ id: z82.string(),
4100
+ frameworkId: RegulatoryFrameworkSchema,
4101
+ clauseNumber: z82.string(),
4102
+ title: z82.string(),
4103
+ parentClauseId: z82.string().nullable(),
4104
+ depth: z82.number().int().nonnegative(),
4105
+ sortOrder: z82.number().int().nonnegative(),
4106
+ children: z82.array(ClauseNodeSchema)
4107
+ }));
4108
+ var FrameworkDetailResponseSchema = z82.object({
4109
+ id: RegulatoryFrameworkSchema,
4110
+ name: z82.string(),
4111
+ version: z82.string(),
4112
+ scope: FrameworkScopeSchema,
4113
+ url: z82.string().nullable(),
4114
+ active: z82.boolean(),
4115
+ clauses: z82.array(ClauseNodeSchema)
4116
+ });
4117
+ var ClauseMappingSchema = z82.object({
4118
+ clauseId: z82.string(),
4119
+ mappedFrameworkId: RegulatoryFrameworkSchema,
4120
+ mappedFrameworkName: z82.string(),
4121
+ mappedClauseId: z82.string(),
4122
+ mappedClauseTitle: z82.string(),
4123
+ relationship: MappingRelationshipSchema,
4124
+ notes: z82.string().nullable()
4125
+ });
4126
+ var ClauseMappingsResponseSchema = z82.object({
4127
+ clauseId: z82.string(),
4128
+ frameworkId: RegulatoryFrameworkSchema,
4129
+ mappings: z82.array(ClauseMappingSchema)
4130
+ });
4131
+ var CrosswalkResponseSchema = z82.object({
4132
+ sourceFrameworkId: RegulatoryFrameworkSchema,
4133
+ targetFrameworkId: RegulatoryFrameworkSchema,
4134
+ mappings: z82.array(ClauseMappingSchema)
4135
+ });
4136
+ var FrameworkCoverageSchema = z82.object({
4137
+ frameworkId: RegulatoryFrameworkSchema,
4138
+ frameworkName: z82.string(),
4139
+ totalClauses: z82.number().int().nonnegative(),
4140
+ coveredClauses: z82.number().int().nonnegative(),
4141
+ coveragePercent: z82.number().min(0).max(100),
4142
+ scope: FrameworkScopeSchema
4143
+ });
4144
+ var ComplianceSummaryResponseSchema = z82.object({
4145
+ organizationId: z82.string(),
4146
+ frameworks: z82.array(FrameworkCoverageSchema),
4147
+ overallCoveragePercent: z82.number().min(0).max(100)
4148
+ });
4149
+ var EvidenceItemSchema = z82.object({
4150
+ documentId: z82.string(),
4151
+ documentTitle: z82.string(),
4152
+ /** Document type. Optional — omitted for non-document evidence (e.g. training records). */
4153
+ docType: DocumentTypeSchema.optional(),
4154
+ linkType: LinkTypeSchema.optional(),
4155
+ status: z82.string()
4156
+ });
4157
+ var ClauseComplianceSchema = z82.object({
4158
+ clauseId: z82.string(),
4159
+ clauseNumber: z82.string(),
4160
+ clauseTitle: z82.string(),
4161
+ covered: z82.boolean(),
4162
+ /** Compliance score 0..1 based on weighted evidence rules */
4163
+ score: z82.number().min(0).max(1),
4164
+ evidence: z82.array(EvidenceItemSchema)
4165
+ });
4166
+ var FrameworkComplianceResponseSchema = z82.object({
4167
+ frameworkId: RegulatoryFrameworkSchema,
4168
+ frameworkName: z82.string(),
4169
+ totalClauses: z82.number().int().nonnegative(),
4170
+ coveredClauses: z82.number().int().nonnegative(),
4171
+ coveragePercent: z82.number().min(0).max(100),
4172
+ clauses: z82.array(ClauseComplianceSchema)
4173
+ });
4174
+
4175
+ // ../contracts/dist/frameworks/evidence.js
4176
+ import { z as z83 } from "zod";
4177
+ var ClauseEvidenceStatusSchema = z83.enum(["covered", "partial", "missing"]);
4178
+ var ClauseEvidenceItemSchema = z83.object({
4179
+ type: z83.string(),
4180
+ label: z83.string(),
4181
+ count: z83.number().int().nonnegative(),
4182
+ status: ClauseEvidenceStatusSchema
4183
+ });
4184
+ var ClauseEvidenceNodeSchema = z83.object({
4185
+ clauseId: z83.string(),
4186
+ clauseNumber: z83.string(),
4187
+ clauseTitle: z83.string(),
4188
+ status: ClauseEvidenceStatusSchema,
4189
+ evidenceCount: z83.number().int().nonnegative(),
4190
+ evidence: z83.array(ClauseEvidenceItemSchema)
4191
+ });
4192
+ var FrameworkEvidenceResponseSchema = z83.object({
4193
+ frameworkId: RegulatoryFrameworkSchema,
4194
+ frameworkName: z83.string(),
4195
+ totalClauses: z83.number().int().nonnegative(),
4196
+ coveredClauses: z83.number().int().nonnegative(),
4197
+ partialClauses: z83.number().int().nonnegative(),
4198
+ missingClauses: z83.number().int().nonnegative(),
4199
+ clauses: z83.array(ClauseEvidenceNodeSchema)
4200
+ });
4201
+
4202
+ // ../contracts/dist/domain-constants/risk-matrix.js
4203
+ var RISK_DOCUMENT_TYPES = [
4204
+ "software_risk",
4205
+ "usability_risk",
4206
+ "security_risk"
4207
+ ];
4208
+ var HAZARD_DOCUMENT_TYPES = ["haz_soe_software", "haz_soe_security"];
4209
+ var ALL_RISK_RELATED_DOCUMENT_TYPES = [
4210
+ ...RISK_DOCUMENT_TYPES,
4211
+ ...HAZARD_DOCUMENT_TYPES,
4212
+ "hazardous_situation",
4213
+ "harm"
4214
+ ];
4215
+
4216
+ // ../contracts/dist/domain-constants/document-types.js
4217
+ var QMS_DOCUMENT_TYPES = [
4218
+ "sop",
4219
+ "policy",
4220
+ "work_instruction",
4221
+ "supplier",
4222
+ // Internal audit management (ISO 13485 §8.2.2)
4223
+ "audit_schedule",
4224
+ "audit_report",
4225
+ // Management review (ISO 13485 §5.6)
4226
+ "management_review"
4227
+ ];
4228
+ var DEVICE_DOCUMENT_TYPES = [
4229
+ "user_need",
4230
+ "requirement",
4231
+ "architecture",
4232
+ "detailed_design",
4233
+ "test_protocol",
4234
+ "test_report",
4235
+ "usability_risk",
4236
+ "software_risk",
4237
+ "security_risk",
4238
+ "hazardous_situation",
4239
+ "harm",
4240
+ "haz_soe_software",
4241
+ "haz_soe_security",
4242
+ "hazard_category",
4243
+ // Usability engineering (IEC 62366)
4244
+ "usability_plan",
4245
+ "use_specification",
4246
+ "task_analysis",
4247
+ "usability_evaluation",
4248
+ "summative_evaluation",
4249
+ // Risk management (ISO 14971)
4250
+ "risk_management_plan",
4251
+ // Software lifecycle (IEC 62304)
4252
+ "software_development_plan",
4253
+ "software_maintenance_plan",
4254
+ "soup_register",
4255
+ // Problem resolution (IEC 62304 §9)
4256
+ "anomaly",
4257
+ // Cybersecurity (IEC 81001-5-1)
4258
+ "cybersecurity_plan",
4259
+ "sbom",
4260
+ // Clinical (MDR / FDA)
4261
+ "clinical_evaluation_plan",
4262
+ "clinical_evaluation_report",
4263
+ // Post-market surveillance (MDR Art. 83)
4264
+ "post_market_surveillance_plan",
4265
+ "post_market_feedback",
4266
+ // Labeling (MDR Annex I)
4267
+ "labeling",
4268
+ // Product (ISO 13485 §7.3)
4269
+ "product_development_plan",
4270
+ "intended_use",
4271
+ // Release management (IEC 62304 §5.7)
4272
+ "release_plan",
4273
+ // Change management (ISO 13485 §7.3.5)
4274
+ "design_review",
4275
+ "release_notes",
4276
+ // Software test plan (IEC 62304 §5.7)
4277
+ "software_test_plan"
4278
+ ];
4279
+ var CHANGE_DOCUMENT_TYPES = ["design_review", "release_plan"];
4280
+ function isChangeDocumentType(type) {
4281
+ return CHANGE_DOCUMENT_TYPES.includes(type);
4282
+ }
4283
+ function isQmsDocumentType(type) {
4284
+ return QMS_DOCUMENT_TYPES.includes(type);
4285
+ }
4286
+ function isDeviceDocumentType(type) {
4287
+ return DEVICE_DOCUMENT_TYPES.includes(type);
4288
+ }
4289
+
4290
+ // ../contracts/dist/domain-constants/index.js
4291
+ var DOCUMENT_TYPES = {
4292
+ user_need: "User Need",
4293
+ requirement: "Requirement",
4294
+ architecture: "Architecture",
4295
+ detailed_design: "Detailed Design",
4296
+ test_protocol: "Test Protocol",
4297
+ test_report: "Test Report",
4298
+ sop: "SOP",
4299
+ work_instruction: "Work Instruction",
4300
+ policy: "Policy",
4301
+ usability_risk: "Usability Risk",
4302
+ software_risk: "Software Risk",
4303
+ security_risk: "Security Risk",
4304
+ // Risk document types
4305
+ haz_soe_software: "Hazard (Software)",
4306
+ haz_soe_security: "Hazard (Security)",
4307
+ hazardous_situation: "Hazardous Situation",
4308
+ harm: "Harm",
4309
+ hazard_category: "Hazard Category",
4310
+ // Usability engineering (IEC 62366)
4311
+ usability_plan: "Usability Plan",
4312
+ use_specification: "Use Specification",
4313
+ task_analysis: "Task Analysis",
4314
+ usability_evaluation: "Usability Evaluation",
4315
+ summative_evaluation: "Summative Evaluation",
4316
+ // Risk management (ISO 14971)
4317
+ risk_management_plan: "Risk Management Plan",
4318
+ // Software lifecycle (IEC 62304)
4319
+ software_development_plan: "Software Development Plan",
4320
+ software_maintenance_plan: "Software Maintenance Plan",
4321
+ soup_register: "SOUP Register",
4322
+ // Problem resolution (IEC 62304 §9)
4323
+ anomaly: "Anomaly",
4324
+ // Cybersecurity (IEC 81001-5-1)
4325
+ cybersecurity_plan: "Cybersecurity Plan",
4326
+ sbom: "SBOM",
4327
+ // Clinical (MDR / FDA)
4328
+ clinical_evaluation_plan: "Clinical Evaluation Plan",
4329
+ clinical_evaluation_report: "Clinical Evaluation Report",
4330
+ // Post-market surveillance (MDR Art. 83)
4331
+ post_market_surveillance_plan: "Post-Market Surveillance Plan",
4332
+ post_market_feedback: "Post-Market Feedback",
4333
+ // Labeling (MDR Annex I)
4334
+ labeling: "Labeling",
4335
+ // Product (ISO 13485 §7.3)
4336
+ product_development_plan: "Product Development Plan",
4337
+ intended_use: "Intended Use",
4338
+ // Release management (IEC 62304 §5.7)
4339
+ release_plan: "Release Plan",
4340
+ // Change management (ISO 13485 §7.3.5)
4341
+ design_review: "Design Review",
4342
+ release_notes: "Release Notes",
4343
+ // Supplier management (ISO 13485 §7.4)
4344
+ supplier: "Supplier",
4345
+ // Internal audit management (ISO 13485 §8.2.2)
4346
+ audit_schedule: "Audit Schedule",
4347
+ audit_report: "Audit Report",
4348
+ // Management review (ISO 13485 §5.6)
4349
+ management_review: "Management Review",
4350
+ // Software test plan (IEC 62304 §5.7)
4351
+ software_test_plan: "Software Test Plan"
4352
+ };
4353
+ var LINK_TYPES = {
4354
+ derives_from: "Derives From",
4355
+ implements: "Implements",
4356
+ verified_by: "Verified By",
4357
+ mitigates: "Mitigates",
4358
+ parent_of: "Parent Of",
4359
+ related_to: "Related To",
4360
+ // New risk link types
4361
+ leads_to: "Leads To",
4362
+ results_in: "Results In",
4363
+ analyzes: "Analyzes"
4364
+ };
4365
+ var REQUIRED_SECTIONS = {
4366
+ user_need: ["Purpose", "Stakeholder", "User Needs"],
1301
4367
  architecture: ["Purpose"],
1302
4368
  release_plan: ["Scope", "Applicable Plans", "Release-Specific Criteria", "Known Anomalies"],
1303
4369
  design_review: ["Review Scope", "Attendees", "Findings", "Actions", "Conclusion"],
@@ -1308,16 +4374,16 @@ var REQUIRED_SECTIONS = {
1308
4374
  hazard_category: ["Description", "Examples", "Applicable Standards"]
1309
4375
  };
1310
4376
 
1311
- // ../shared/dist/validators/permissions.js
1312
- import { z as z25 } from "zod";
1313
- var MemberPermissionsSchema = z25.object({
1314
- canSign: z25.boolean(),
1315
- canApprove: z25.boolean(),
1316
- canCreateRelease: z25.boolean(),
1317
- canPublishRelease: z25.boolean(),
1318
- canManageMembers: z25.boolean(),
1319
- canViewAuditLog: z25.boolean(),
1320
- canExport: z25.boolean()
4377
+ // ../contracts/dist/domain-validators/permissions.js
4378
+ import { z as z84 } from "zod";
4379
+ var MemberPermissionsSchema = z84.object({
4380
+ canSign: z84.boolean(),
4381
+ canApprove: z84.boolean(),
4382
+ canCreateRelease: z84.boolean(),
4383
+ canPublishRelease: z84.boolean(),
4384
+ canManageMembers: z84.boolean(),
4385
+ canViewAuditLog: z84.boolean(),
4386
+ canExport: z84.boolean()
1321
4387
  });
1322
4388
 
1323
4389
  // src/schema-map.ts
@@ -1610,7 +4676,7 @@ export {
1610
4676
  ProductDevelopmentPlanFrontmatterSchema,
1611
4677
  QMS_DOCUMENT_TYPES,
1612
4678
  REQUIRED_SECTIONS,
1613
- RegulatoryFrameworkSchema,
4679
+ RegulatoryFrameworkSchema2 as RegulatoryFrameworkSchema,
1614
4680
  ReleaseNotesAudienceSchema,
1615
4681
  ReleaseNotesFrontmatterSchema,
1616
4682
  ReleasePlanFrontmatterSchema,