@claritylabs/cl-sdk 0.7.1 → 0.7.3
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/README.md +33 -4
- package/dist/index.d.mts +179 -168
- package/dist/index.d.ts +179 -168
- package/dist/index.js +1016 -962
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1015 -962
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -234,6 +234,7 @@ __export(index_exports, {
|
|
|
234
234
|
safeGenerateObject: () => safeGenerateObject,
|
|
235
235
|
sanitizeNulls: () => sanitizeNulls,
|
|
236
236
|
stripFences: () => stripFences,
|
|
237
|
+
toStrictSchema: () => toStrictSchema,
|
|
237
238
|
withRetry: () => withRetry
|
|
238
239
|
});
|
|
239
240
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -241,16 +242,22 @@ module.exports = __toCommonJS(index_exports);
|
|
|
241
242
|
// src/core/retry.ts
|
|
242
243
|
var MAX_RETRIES = 5;
|
|
243
244
|
var BASE_DELAY_MS = 2e3;
|
|
244
|
-
function
|
|
245
|
+
function isRetryableError(error) {
|
|
245
246
|
if (error instanceof Error) {
|
|
246
247
|
const msg = error.message.toLowerCase();
|
|
247
248
|
if (msg.includes("rate limit") || msg.includes("rate_limit") || msg.includes("too many requests")) {
|
|
248
249
|
return true;
|
|
249
250
|
}
|
|
251
|
+
if (msg.includes("grammar compilation timed out")) return true;
|
|
252
|
+
if (msg.includes("no output generated")) return true;
|
|
253
|
+
if (msg.includes("overloaded")) return true;
|
|
254
|
+
if (msg.includes("internal server error")) return true;
|
|
255
|
+
if (msg.includes("service unavailable")) return true;
|
|
256
|
+
if (msg.includes("gateway timeout")) return true;
|
|
250
257
|
}
|
|
251
258
|
if (typeof error === "object" && error !== null) {
|
|
252
259
|
const status = error.status ?? error.statusCode;
|
|
253
|
-
if (status === 429) return true;
|
|
260
|
+
if (status === 429 || status === 500 || status === 502 || status === 503 || status === 504) return true;
|
|
254
261
|
}
|
|
255
262
|
return false;
|
|
256
263
|
}
|
|
@@ -259,12 +266,12 @@ async function withRetry(fn, log) {
|
|
|
259
266
|
try {
|
|
260
267
|
return await fn();
|
|
261
268
|
} catch (error) {
|
|
262
|
-
if (!
|
|
269
|
+
if (!isRetryableError(error) || attempt >= MAX_RETRIES) {
|
|
263
270
|
throw error;
|
|
264
271
|
}
|
|
265
272
|
const jitter = Math.random() * 1e3;
|
|
266
273
|
const delay = BASE_DELAY_MS * Math.pow(2, attempt) + jitter;
|
|
267
|
-
await log?.(`
|
|
274
|
+
await log?.(`Retryable error, retrying in ${(delay / 1e3).toFixed(1)}s (attempt ${attempt + 1}/${MAX_RETRIES})...`);
|
|
268
275
|
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
269
276
|
}
|
|
270
277
|
}
|
|
@@ -311,14 +318,59 @@ function sanitizeNulls(obj) {
|
|
|
311
318
|
return obj;
|
|
312
319
|
}
|
|
313
320
|
|
|
321
|
+
// src/core/strict-schema.ts
|
|
322
|
+
var import_zod = require("zod");
|
|
323
|
+
function toStrictSchema(schema) {
|
|
324
|
+
const def = schema._zod?.def;
|
|
325
|
+
const typeName = def?.type ?? schema.type;
|
|
326
|
+
if (typeName === "object") {
|
|
327
|
+
const shape = schema.shape;
|
|
328
|
+
if (!shape) return schema;
|
|
329
|
+
const newShape = {};
|
|
330
|
+
for (const [key, value] of Object.entries(shape)) {
|
|
331
|
+
const field = value;
|
|
332
|
+
const fieldDef = field._zod?.def;
|
|
333
|
+
const fieldType = fieldDef?.type ?? field.type;
|
|
334
|
+
if (fieldType === "optional") {
|
|
335
|
+
const innerType = fieldDef?.innerType;
|
|
336
|
+
if (innerType) {
|
|
337
|
+
const transformed = toStrictSchema(innerType);
|
|
338
|
+
newShape[key] = import_zod.z.nullable(transformed);
|
|
339
|
+
} else {
|
|
340
|
+
newShape[key] = import_zod.z.nullable(field);
|
|
341
|
+
}
|
|
342
|
+
} else {
|
|
343
|
+
newShape[key] = toStrictSchema(field);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
return import_zod.z.object(newShape);
|
|
347
|
+
}
|
|
348
|
+
if (typeName === "array") {
|
|
349
|
+
const element = def?.element ?? schema.element;
|
|
350
|
+
if (element) {
|
|
351
|
+
return import_zod.z.array(toStrictSchema(element));
|
|
352
|
+
}
|
|
353
|
+
return schema;
|
|
354
|
+
}
|
|
355
|
+
if (typeName === "nullable") {
|
|
356
|
+
const innerType = def?.innerType;
|
|
357
|
+
if (innerType) {
|
|
358
|
+
return import_zod.z.nullable(toStrictSchema(innerType));
|
|
359
|
+
}
|
|
360
|
+
return schema;
|
|
361
|
+
}
|
|
362
|
+
return schema;
|
|
363
|
+
}
|
|
364
|
+
|
|
314
365
|
// src/core/safe-generate.ts
|
|
315
366
|
async function safeGenerateObject(generateObject, params, options) {
|
|
316
367
|
const maxRetries = options?.maxRetries ?? 1;
|
|
317
368
|
let lastError;
|
|
369
|
+
const strictParams = { ...params, schema: toStrictSchema(params.schema) };
|
|
318
370
|
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
319
371
|
try {
|
|
320
372
|
const result = await withRetry(
|
|
321
|
-
() => generateObject(
|
|
373
|
+
() => generateObject(strictParams),
|
|
322
374
|
options?.log
|
|
323
375
|
);
|
|
324
376
|
return result;
|
|
@@ -375,8 +427,8 @@ function createPipelineContext(opts) {
|
|
|
375
427
|
}
|
|
376
428
|
|
|
377
429
|
// src/schemas/enums.ts
|
|
378
|
-
var
|
|
379
|
-
var PolicyTypeSchema =
|
|
430
|
+
var import_zod2 = require("zod");
|
|
431
|
+
var PolicyTypeSchema = import_zod2.z.enum([
|
|
380
432
|
// Commercial lines
|
|
381
433
|
"general_liability",
|
|
382
434
|
"commercial_property",
|
|
@@ -423,7 +475,7 @@ var PolicyTypeSchema = import_zod.z.enum([
|
|
|
423
475
|
"other"
|
|
424
476
|
]);
|
|
425
477
|
var POLICY_TYPES = PolicyTypeSchema.options;
|
|
426
|
-
var EndorsementTypeSchema =
|
|
478
|
+
var EndorsementTypeSchema = import_zod2.z.enum([
|
|
427
479
|
"additional_insured",
|
|
428
480
|
"waiver_of_subrogation",
|
|
429
481
|
"primary_noncontributory",
|
|
@@ -444,7 +496,7 @@ var EndorsementTypeSchema = import_zod.z.enum([
|
|
|
444
496
|
"other"
|
|
445
497
|
]);
|
|
446
498
|
var ENDORSEMENT_TYPES = EndorsementTypeSchema.options;
|
|
447
|
-
var ConditionTypeSchema =
|
|
499
|
+
var ConditionTypeSchema = import_zod2.z.enum([
|
|
448
500
|
"duties_after_loss",
|
|
449
501
|
"notice_requirements",
|
|
450
502
|
"other_insurance",
|
|
@@ -464,7 +516,7 @@ var ConditionTypeSchema = import_zod.z.enum([
|
|
|
464
516
|
"other"
|
|
465
517
|
]);
|
|
466
518
|
var CONDITION_TYPES = ConditionTypeSchema.options;
|
|
467
|
-
var PolicySectionTypeSchema =
|
|
519
|
+
var PolicySectionTypeSchema = import_zod2.z.enum([
|
|
468
520
|
"declarations",
|
|
469
521
|
"insuring_agreement",
|
|
470
522
|
"policy_form",
|
|
@@ -479,7 +531,7 @@ var PolicySectionTypeSchema = import_zod.z.enum([
|
|
|
479
531
|
"other"
|
|
480
532
|
]);
|
|
481
533
|
var POLICY_SECTION_TYPES = PolicySectionTypeSchema.options;
|
|
482
|
-
var QuoteSectionTypeSchema =
|
|
534
|
+
var QuoteSectionTypeSchema = import_zod2.z.enum([
|
|
483
535
|
"terms_summary",
|
|
484
536
|
"premium_indication",
|
|
485
537
|
"underwriting_condition",
|
|
@@ -489,13 +541,13 @@ var QuoteSectionTypeSchema = import_zod.z.enum([
|
|
|
489
541
|
"other"
|
|
490
542
|
]);
|
|
491
543
|
var QUOTE_SECTION_TYPES = QuoteSectionTypeSchema.options;
|
|
492
|
-
var CoverageFormSchema =
|
|
544
|
+
var CoverageFormSchema = import_zod2.z.enum(["occurrence", "claims_made", "accident"]);
|
|
493
545
|
var COVERAGE_FORMS = CoverageFormSchema.options;
|
|
494
|
-
var PolicyTermTypeSchema =
|
|
546
|
+
var PolicyTermTypeSchema = import_zod2.z.enum(["fixed", "continuous"]);
|
|
495
547
|
var POLICY_TERM_TYPES = PolicyTermTypeSchema.options;
|
|
496
|
-
var CoverageTriggerSchema =
|
|
548
|
+
var CoverageTriggerSchema = import_zod2.z.enum(["occurrence", "claims_made", "accident"]);
|
|
497
549
|
var COVERAGE_TRIGGERS = CoverageTriggerSchema.options;
|
|
498
|
-
var LimitTypeSchema =
|
|
550
|
+
var LimitTypeSchema = import_zod2.z.enum([
|
|
499
551
|
"per_occurrence",
|
|
500
552
|
"per_claim",
|
|
501
553
|
"aggregate",
|
|
@@ -506,7 +558,7 @@ var LimitTypeSchema = import_zod.z.enum([
|
|
|
506
558
|
"scheduled"
|
|
507
559
|
]);
|
|
508
560
|
var LIMIT_TYPES = LimitTypeSchema.options;
|
|
509
|
-
var DeductibleTypeSchema =
|
|
561
|
+
var DeductibleTypeSchema = import_zod2.z.enum([
|
|
510
562
|
"per_occurrence",
|
|
511
563
|
"per_claim",
|
|
512
564
|
"aggregate",
|
|
@@ -514,16 +566,16 @@ var DeductibleTypeSchema = import_zod.z.enum([
|
|
|
514
566
|
"waiting_period"
|
|
515
567
|
]);
|
|
516
568
|
var DEDUCTIBLE_TYPES = DeductibleTypeSchema.options;
|
|
517
|
-
var ValuationMethodSchema =
|
|
569
|
+
var ValuationMethodSchema = import_zod2.z.enum([
|
|
518
570
|
"replacement_cost",
|
|
519
571
|
"actual_cash_value",
|
|
520
572
|
"agreed_value",
|
|
521
573
|
"functional_replacement"
|
|
522
574
|
]);
|
|
523
575
|
var VALUATION_METHODS = ValuationMethodSchema.options;
|
|
524
|
-
var DefenseCostTreatmentSchema =
|
|
576
|
+
var DefenseCostTreatmentSchema = import_zod2.z.enum(["inside_limits", "outside_limits", "supplementary"]);
|
|
525
577
|
var DEFENSE_COST_TREATMENTS = DefenseCostTreatmentSchema.options;
|
|
526
|
-
var EntityTypeSchema =
|
|
578
|
+
var EntityTypeSchema = import_zod2.z.enum([
|
|
527
579
|
"corporation",
|
|
528
580
|
"llc",
|
|
529
581
|
"partnership",
|
|
@@ -537,9 +589,9 @@ var EntityTypeSchema = import_zod.z.enum([
|
|
|
537
589
|
"other"
|
|
538
590
|
]);
|
|
539
591
|
var ENTITY_TYPES = EntityTypeSchema.options;
|
|
540
|
-
var AdmittedStatusSchema =
|
|
592
|
+
var AdmittedStatusSchema = import_zod2.z.enum(["admitted", "non_admitted", "surplus_lines"]);
|
|
541
593
|
var ADMITTED_STATUSES = AdmittedStatusSchema.options;
|
|
542
|
-
var AuditTypeSchema =
|
|
594
|
+
var AuditTypeSchema = import_zod2.z.enum([
|
|
543
595
|
"annual",
|
|
544
596
|
"semi_annual",
|
|
545
597
|
"quarterly",
|
|
@@ -549,7 +601,7 @@ var AuditTypeSchema = import_zod.z.enum([
|
|
|
549
601
|
"none"
|
|
550
602
|
]);
|
|
551
603
|
var AUDIT_TYPES = AuditTypeSchema.options;
|
|
552
|
-
var EndorsementPartyRoleSchema =
|
|
604
|
+
var EndorsementPartyRoleSchema = import_zod2.z.enum([
|
|
553
605
|
"additional_insured",
|
|
554
606
|
"loss_payee",
|
|
555
607
|
"mortgage_holder",
|
|
@@ -558,13 +610,13 @@ var EndorsementPartyRoleSchema = import_zod.z.enum([
|
|
|
558
610
|
"other"
|
|
559
611
|
]);
|
|
560
612
|
var ENDORSEMENT_PARTY_ROLES = EndorsementPartyRoleSchema.options;
|
|
561
|
-
var ClaimStatusSchema =
|
|
613
|
+
var ClaimStatusSchema = import_zod2.z.enum(["open", "closed", "reopened"]);
|
|
562
614
|
var CLAIM_STATUSES = ClaimStatusSchema.options;
|
|
563
|
-
var SubjectivityCategorySchema =
|
|
615
|
+
var SubjectivityCategorySchema = import_zod2.z.enum(["pre_binding", "post_binding", "information"]);
|
|
564
616
|
var SUBJECTIVITY_CATEGORIES = SubjectivityCategorySchema.options;
|
|
565
|
-
var DocumentTypeSchema =
|
|
617
|
+
var DocumentTypeSchema = import_zod2.z.enum(["policy", "quote", "binder", "endorsement", "certificate"]);
|
|
566
618
|
var DOCUMENT_TYPES = DocumentTypeSchema.options;
|
|
567
|
-
var ChunkTypeSchema =
|
|
619
|
+
var ChunkTypeSchema = import_zod2.z.enum([
|
|
568
620
|
"declarations",
|
|
569
621
|
"coverage_form",
|
|
570
622
|
"endorsement",
|
|
@@ -573,7 +625,7 @@ var ChunkTypeSchema = import_zod.z.enum([
|
|
|
573
625
|
"mixed"
|
|
574
626
|
]);
|
|
575
627
|
var CHUNK_TYPES = ChunkTypeSchema.options;
|
|
576
|
-
var RatingBasisTypeSchema =
|
|
628
|
+
var RatingBasisTypeSchema = import_zod2.z.enum([
|
|
577
629
|
"payroll",
|
|
578
630
|
"revenue",
|
|
579
631
|
"area",
|
|
@@ -587,7 +639,7 @@ var RatingBasisTypeSchema = import_zod.z.enum([
|
|
|
587
639
|
"other"
|
|
588
640
|
]);
|
|
589
641
|
var RATING_BASIS_TYPES = RatingBasisTypeSchema.options;
|
|
590
|
-
var VehicleCoverageTypeSchema =
|
|
642
|
+
var VehicleCoverageTypeSchema = import_zod2.z.enum([
|
|
591
643
|
"liability",
|
|
592
644
|
"collision",
|
|
593
645
|
"comprehensive",
|
|
@@ -600,32 +652,32 @@ var VehicleCoverageTypeSchema = import_zod.z.enum([
|
|
|
600
652
|
"physical_damage"
|
|
601
653
|
]);
|
|
602
654
|
var VEHICLE_COVERAGE_TYPES = VehicleCoverageTypeSchema.options;
|
|
603
|
-
var HomeownersFormTypeSchema =
|
|
655
|
+
var HomeownersFormTypeSchema = import_zod2.z.enum(["HO-3", "HO-5", "HO-4", "HO-6", "HO-7", "HO-8"]);
|
|
604
656
|
var HOMEOWNERS_FORM_TYPES = HomeownersFormTypeSchema.options;
|
|
605
|
-
var DwellingFireFormTypeSchema =
|
|
657
|
+
var DwellingFireFormTypeSchema = import_zod2.z.enum(["DP-1", "DP-2", "DP-3"]);
|
|
606
658
|
var DWELLING_FIRE_FORM_TYPES = DwellingFireFormTypeSchema.options;
|
|
607
|
-
var FloodZoneSchema =
|
|
659
|
+
var FloodZoneSchema = import_zod2.z.enum(["A", "AE", "AH", "AO", "AR", "V", "VE", "B", "C", "X", "D"]);
|
|
608
660
|
var FLOOD_ZONES = FloodZoneSchema.options;
|
|
609
|
-
var ConstructionTypeSchema =
|
|
661
|
+
var ConstructionTypeSchema = import_zod2.z.enum(["frame", "masonry", "superior", "mixed", "other"]);
|
|
610
662
|
var CONSTRUCTION_TYPES = ConstructionTypeSchema.options;
|
|
611
|
-
var RoofTypeSchema =
|
|
663
|
+
var RoofTypeSchema = import_zod2.z.enum(["asphalt_shingle", "tile", "metal", "slate", "flat", "wood_shake", "other"]);
|
|
612
664
|
var ROOF_TYPES = RoofTypeSchema.options;
|
|
613
|
-
var FoundationTypeSchema =
|
|
665
|
+
var FoundationTypeSchema = import_zod2.z.enum(["basement", "crawl_space", "slab", "pier", "other"]);
|
|
614
666
|
var FOUNDATION_TYPES = FoundationTypeSchema.options;
|
|
615
|
-
var PersonalAutoUsageSchema =
|
|
667
|
+
var PersonalAutoUsageSchema = import_zod2.z.enum(["pleasure", "commute", "business", "farm"]);
|
|
616
668
|
var PERSONAL_AUTO_USAGES = PersonalAutoUsageSchema.options;
|
|
617
|
-
var LossSettlementSchema =
|
|
669
|
+
var LossSettlementSchema = import_zod2.z.enum([
|
|
618
670
|
"replacement_cost",
|
|
619
671
|
"actual_cash_value",
|
|
620
672
|
"extended_replacement_cost",
|
|
621
673
|
"guaranteed_replacement_cost"
|
|
622
674
|
]);
|
|
623
675
|
var LOSS_SETTLEMENTS = LossSettlementSchema.options;
|
|
624
|
-
var BoatTypeSchema =
|
|
676
|
+
var BoatTypeSchema = import_zod2.z.enum(["sailboat", "powerboat", "pontoon", "jet_ski", "kayak_canoe", "yacht", "other"]);
|
|
625
677
|
var BOAT_TYPES = BoatTypeSchema.options;
|
|
626
|
-
var RVTypeSchema =
|
|
678
|
+
var RVTypeSchema = import_zod2.z.enum(["rv_motorhome", "travel_trailer", "atv", "snowmobile", "golf_cart", "dirt_bike", "other"]);
|
|
627
679
|
var RV_TYPES = RVTypeSchema.options;
|
|
628
|
-
var ScheduledItemCategorySchema =
|
|
680
|
+
var ScheduledItemCategorySchema = import_zod2.z.enum([
|
|
629
681
|
"jewelry",
|
|
630
682
|
"fine_art",
|
|
631
683
|
"musical_instruments",
|
|
@@ -638,691 +690,691 @@ var ScheduledItemCategorySchema = import_zod.z.enum([
|
|
|
638
690
|
"other"
|
|
639
691
|
]);
|
|
640
692
|
var SCHEDULED_ITEM_CATEGORIES = ScheduledItemCategorySchema.options;
|
|
641
|
-
var TitlePolicyTypeSchema =
|
|
693
|
+
var TitlePolicyTypeSchema = import_zod2.z.enum(["owners", "lenders"]);
|
|
642
694
|
var TITLE_POLICY_TYPES = TitlePolicyTypeSchema.options;
|
|
643
|
-
var PetSpeciesSchema =
|
|
695
|
+
var PetSpeciesSchema = import_zod2.z.enum(["dog", "cat", "other"]);
|
|
644
696
|
var PET_SPECIES = PetSpeciesSchema.options;
|
|
645
697
|
|
|
646
698
|
// src/schemas/shared.ts
|
|
647
|
-
var
|
|
648
|
-
var AddressSchema =
|
|
649
|
-
street1:
|
|
650
|
-
street2:
|
|
651
|
-
city:
|
|
652
|
-
state:
|
|
653
|
-
zip:
|
|
654
|
-
country:
|
|
699
|
+
var import_zod3 = require("zod");
|
|
700
|
+
var AddressSchema = import_zod3.z.object({
|
|
701
|
+
street1: import_zod3.z.string(),
|
|
702
|
+
street2: import_zod3.z.string().optional(),
|
|
703
|
+
city: import_zod3.z.string(),
|
|
704
|
+
state: import_zod3.z.string(),
|
|
705
|
+
zip: import_zod3.z.string(),
|
|
706
|
+
country: import_zod3.z.string().optional()
|
|
655
707
|
});
|
|
656
|
-
var ContactSchema =
|
|
657
|
-
name:
|
|
658
|
-
title:
|
|
659
|
-
type:
|
|
660
|
-
phone:
|
|
661
|
-
fax:
|
|
662
|
-
email:
|
|
708
|
+
var ContactSchema = import_zod3.z.object({
|
|
709
|
+
name: import_zod3.z.string().optional(),
|
|
710
|
+
title: import_zod3.z.string().optional(),
|
|
711
|
+
type: import_zod3.z.string().optional(),
|
|
712
|
+
phone: import_zod3.z.string().optional(),
|
|
713
|
+
fax: import_zod3.z.string().optional(),
|
|
714
|
+
email: import_zod3.z.string().optional(),
|
|
663
715
|
address: AddressSchema.optional(),
|
|
664
|
-
hours:
|
|
716
|
+
hours: import_zod3.z.string().optional()
|
|
665
717
|
});
|
|
666
|
-
var FormReferenceSchema =
|
|
667
|
-
formNumber:
|
|
668
|
-
editionDate:
|
|
669
|
-
title:
|
|
670
|
-
formType:
|
|
718
|
+
var FormReferenceSchema = import_zod3.z.object({
|
|
719
|
+
formNumber: import_zod3.z.string(),
|
|
720
|
+
editionDate: import_zod3.z.string().optional(),
|
|
721
|
+
title: import_zod3.z.string().optional(),
|
|
722
|
+
formType: import_zod3.z.enum(["coverage", "endorsement", "declarations", "application", "notice", "other"])
|
|
671
723
|
});
|
|
672
|
-
var TaxFeeItemSchema =
|
|
673
|
-
name:
|
|
674
|
-
amount:
|
|
675
|
-
type:
|
|
676
|
-
description:
|
|
724
|
+
var TaxFeeItemSchema = import_zod3.z.object({
|
|
725
|
+
name: import_zod3.z.string(),
|
|
726
|
+
amount: import_zod3.z.string(),
|
|
727
|
+
type: import_zod3.z.enum(["tax", "fee", "surcharge", "assessment"]).optional(),
|
|
728
|
+
description: import_zod3.z.string().optional()
|
|
677
729
|
});
|
|
678
|
-
var RatingBasisSchema =
|
|
730
|
+
var RatingBasisSchema = import_zod3.z.object({
|
|
679
731
|
type: RatingBasisTypeSchema,
|
|
680
|
-
amount:
|
|
681
|
-
description:
|
|
732
|
+
amount: import_zod3.z.string().optional(),
|
|
733
|
+
description: import_zod3.z.string().optional()
|
|
682
734
|
});
|
|
683
|
-
var SublimitSchema =
|
|
684
|
-
name:
|
|
685
|
-
limit:
|
|
686
|
-
appliesTo:
|
|
687
|
-
deductible:
|
|
735
|
+
var SublimitSchema = import_zod3.z.object({
|
|
736
|
+
name: import_zod3.z.string(),
|
|
737
|
+
limit: import_zod3.z.string(),
|
|
738
|
+
appliesTo: import_zod3.z.string().optional(),
|
|
739
|
+
deductible: import_zod3.z.string().optional()
|
|
688
740
|
});
|
|
689
|
-
var SharedLimitSchema =
|
|
690
|
-
description:
|
|
691
|
-
limit:
|
|
692
|
-
coverageParts:
|
|
741
|
+
var SharedLimitSchema = import_zod3.z.object({
|
|
742
|
+
description: import_zod3.z.string(),
|
|
743
|
+
limit: import_zod3.z.string(),
|
|
744
|
+
coverageParts: import_zod3.z.array(import_zod3.z.string())
|
|
693
745
|
});
|
|
694
|
-
var ExtendedReportingPeriodSchema =
|
|
695
|
-
basicDays:
|
|
696
|
-
supplementalYears:
|
|
697
|
-
supplementalPremium:
|
|
746
|
+
var ExtendedReportingPeriodSchema = import_zod3.z.object({
|
|
747
|
+
basicDays: import_zod3.z.number().optional(),
|
|
748
|
+
supplementalYears: import_zod3.z.number().optional(),
|
|
749
|
+
supplementalPremium: import_zod3.z.string().optional()
|
|
698
750
|
});
|
|
699
|
-
var NamedInsuredSchema =
|
|
700
|
-
name:
|
|
701
|
-
relationship:
|
|
751
|
+
var NamedInsuredSchema = import_zod3.z.object({
|
|
752
|
+
name: import_zod3.z.string(),
|
|
753
|
+
relationship: import_zod3.z.string().optional(),
|
|
702
754
|
address: AddressSchema.optional()
|
|
703
755
|
});
|
|
704
756
|
|
|
705
757
|
// src/schemas/coverage.ts
|
|
706
|
-
var
|
|
707
|
-
var CoverageSchema =
|
|
708
|
-
name:
|
|
709
|
-
limit:
|
|
710
|
-
deductible:
|
|
711
|
-
pageNumber:
|
|
712
|
-
sectionRef:
|
|
758
|
+
var import_zod4 = require("zod");
|
|
759
|
+
var CoverageSchema = import_zod4.z.object({
|
|
760
|
+
name: import_zod4.z.string(),
|
|
761
|
+
limit: import_zod4.z.string(),
|
|
762
|
+
deductible: import_zod4.z.string().optional(),
|
|
763
|
+
pageNumber: import_zod4.z.number().optional(),
|
|
764
|
+
sectionRef: import_zod4.z.string().optional()
|
|
713
765
|
});
|
|
714
|
-
var EnrichedCoverageSchema =
|
|
715
|
-
name:
|
|
716
|
-
coverageCode:
|
|
717
|
-
formNumber:
|
|
718
|
-
formEditionDate:
|
|
719
|
-
limit:
|
|
766
|
+
var EnrichedCoverageSchema = import_zod4.z.object({
|
|
767
|
+
name: import_zod4.z.string(),
|
|
768
|
+
coverageCode: import_zod4.z.string().optional(),
|
|
769
|
+
formNumber: import_zod4.z.string().optional(),
|
|
770
|
+
formEditionDate: import_zod4.z.string().optional(),
|
|
771
|
+
limit: import_zod4.z.string(),
|
|
720
772
|
limitType: LimitTypeSchema.optional(),
|
|
721
|
-
deductible:
|
|
773
|
+
deductible: import_zod4.z.string().optional(),
|
|
722
774
|
deductibleType: DeductibleTypeSchema.optional(),
|
|
723
|
-
sir:
|
|
724
|
-
sublimit:
|
|
725
|
-
coinsurance:
|
|
775
|
+
sir: import_zod4.z.string().optional(),
|
|
776
|
+
sublimit: import_zod4.z.string().optional(),
|
|
777
|
+
coinsurance: import_zod4.z.string().optional(),
|
|
726
778
|
valuation: ValuationMethodSchema.optional(),
|
|
727
|
-
territory:
|
|
779
|
+
territory: import_zod4.z.string().optional(),
|
|
728
780
|
trigger: CoverageTriggerSchema.optional(),
|
|
729
|
-
retroactiveDate:
|
|
730
|
-
included:
|
|
731
|
-
premium:
|
|
732
|
-
pageNumber:
|
|
733
|
-
sectionRef:
|
|
781
|
+
retroactiveDate: import_zod4.z.string().optional(),
|
|
782
|
+
included: import_zod4.z.boolean(),
|
|
783
|
+
premium: import_zod4.z.string().optional(),
|
|
784
|
+
pageNumber: import_zod4.z.number().optional(),
|
|
785
|
+
sectionRef: import_zod4.z.string().optional()
|
|
734
786
|
});
|
|
735
787
|
|
|
736
788
|
// src/schemas/endorsement.ts
|
|
737
|
-
var
|
|
738
|
-
var EndorsementPartySchema =
|
|
739
|
-
name:
|
|
789
|
+
var import_zod5 = require("zod");
|
|
790
|
+
var EndorsementPartySchema = import_zod5.z.object({
|
|
791
|
+
name: import_zod5.z.string(),
|
|
740
792
|
role: EndorsementPartyRoleSchema,
|
|
741
793
|
address: AddressSchema.optional(),
|
|
742
|
-
relationship:
|
|
743
|
-
scope:
|
|
794
|
+
relationship: import_zod5.z.string().optional(),
|
|
795
|
+
scope: import_zod5.z.string().optional()
|
|
744
796
|
});
|
|
745
|
-
var EndorsementSchema =
|
|
746
|
-
formNumber:
|
|
747
|
-
editionDate:
|
|
748
|
-
title:
|
|
797
|
+
var EndorsementSchema = import_zod5.z.object({
|
|
798
|
+
formNumber: import_zod5.z.string(),
|
|
799
|
+
editionDate: import_zod5.z.string().optional(),
|
|
800
|
+
title: import_zod5.z.string(),
|
|
749
801
|
endorsementType: EndorsementTypeSchema,
|
|
750
|
-
effectiveDate:
|
|
751
|
-
affectedCoverageParts:
|
|
752
|
-
namedParties:
|
|
753
|
-
keyTerms:
|
|
754
|
-
premiumImpact:
|
|
755
|
-
content:
|
|
756
|
-
pageStart:
|
|
757
|
-
pageEnd:
|
|
802
|
+
effectiveDate: import_zod5.z.string().optional(),
|
|
803
|
+
affectedCoverageParts: import_zod5.z.array(import_zod5.z.string()).optional(),
|
|
804
|
+
namedParties: import_zod5.z.array(EndorsementPartySchema).optional(),
|
|
805
|
+
keyTerms: import_zod5.z.array(import_zod5.z.string()).optional(),
|
|
806
|
+
premiumImpact: import_zod5.z.string().optional(),
|
|
807
|
+
content: import_zod5.z.string(),
|
|
808
|
+
pageStart: import_zod5.z.number(),
|
|
809
|
+
pageEnd: import_zod5.z.number().optional()
|
|
758
810
|
});
|
|
759
811
|
|
|
760
812
|
// src/schemas/exclusion.ts
|
|
761
|
-
var
|
|
762
|
-
var ExclusionSchema =
|
|
763
|
-
name:
|
|
764
|
-
formNumber:
|
|
765
|
-
excludedPerils:
|
|
766
|
-
isAbsolute:
|
|
767
|
-
exceptions:
|
|
768
|
-
buybackAvailable:
|
|
769
|
-
buybackEndorsement:
|
|
770
|
-
appliesTo:
|
|
771
|
-
content:
|
|
772
|
-
pageNumber:
|
|
813
|
+
var import_zod6 = require("zod");
|
|
814
|
+
var ExclusionSchema = import_zod6.z.object({
|
|
815
|
+
name: import_zod6.z.string(),
|
|
816
|
+
formNumber: import_zod6.z.string().optional(),
|
|
817
|
+
excludedPerils: import_zod6.z.array(import_zod6.z.string()).optional(),
|
|
818
|
+
isAbsolute: import_zod6.z.boolean().optional(),
|
|
819
|
+
exceptions: import_zod6.z.array(import_zod6.z.string()).optional(),
|
|
820
|
+
buybackAvailable: import_zod6.z.boolean().optional(),
|
|
821
|
+
buybackEndorsement: import_zod6.z.string().optional(),
|
|
822
|
+
appliesTo: import_zod6.z.array(import_zod6.z.string()).optional(),
|
|
823
|
+
content: import_zod6.z.string(),
|
|
824
|
+
pageNumber: import_zod6.z.number().optional()
|
|
773
825
|
});
|
|
774
826
|
|
|
775
827
|
// src/schemas/condition.ts
|
|
776
|
-
var
|
|
777
|
-
var ConditionKeyValueSchema =
|
|
778
|
-
key:
|
|
779
|
-
value:
|
|
828
|
+
var import_zod7 = require("zod");
|
|
829
|
+
var ConditionKeyValueSchema = import_zod7.z.object({
|
|
830
|
+
key: import_zod7.z.string(),
|
|
831
|
+
value: import_zod7.z.string()
|
|
780
832
|
});
|
|
781
|
-
var PolicyConditionSchema =
|
|
782
|
-
name:
|
|
833
|
+
var PolicyConditionSchema = import_zod7.z.object({
|
|
834
|
+
name: import_zod7.z.string(),
|
|
783
835
|
conditionType: ConditionTypeSchema,
|
|
784
|
-
content:
|
|
785
|
-
keyValues:
|
|
786
|
-
pageNumber:
|
|
836
|
+
content: import_zod7.z.string(),
|
|
837
|
+
keyValues: import_zod7.z.array(ConditionKeyValueSchema).optional(),
|
|
838
|
+
pageNumber: import_zod7.z.number().optional()
|
|
787
839
|
});
|
|
788
840
|
|
|
789
841
|
// src/schemas/parties.ts
|
|
790
|
-
var
|
|
791
|
-
var InsurerInfoSchema =
|
|
792
|
-
legalName:
|
|
793
|
-
naicNumber:
|
|
794
|
-
amBestRating:
|
|
795
|
-
amBestNumber:
|
|
842
|
+
var import_zod8 = require("zod");
|
|
843
|
+
var InsurerInfoSchema = import_zod8.z.object({
|
|
844
|
+
legalName: import_zod8.z.string(),
|
|
845
|
+
naicNumber: import_zod8.z.string().optional(),
|
|
846
|
+
amBestRating: import_zod8.z.string().optional(),
|
|
847
|
+
amBestNumber: import_zod8.z.string().optional(),
|
|
796
848
|
admittedStatus: AdmittedStatusSchema.optional(),
|
|
797
|
-
stateOfDomicile:
|
|
849
|
+
stateOfDomicile: import_zod8.z.string().optional()
|
|
798
850
|
});
|
|
799
|
-
var ProducerInfoSchema =
|
|
800
|
-
agencyName:
|
|
801
|
-
contactName:
|
|
802
|
-
licenseNumber:
|
|
803
|
-
phone:
|
|
804
|
-
email:
|
|
851
|
+
var ProducerInfoSchema = import_zod8.z.object({
|
|
852
|
+
agencyName: import_zod8.z.string(),
|
|
853
|
+
contactName: import_zod8.z.string().optional(),
|
|
854
|
+
licenseNumber: import_zod8.z.string().optional(),
|
|
855
|
+
phone: import_zod8.z.string().optional(),
|
|
856
|
+
email: import_zod8.z.string().optional(),
|
|
805
857
|
address: AddressSchema.optional()
|
|
806
858
|
});
|
|
807
859
|
|
|
808
860
|
// src/schemas/financial.ts
|
|
809
|
-
var
|
|
810
|
-
var PaymentInstallmentSchema =
|
|
811
|
-
dueDate:
|
|
812
|
-
amount:
|
|
813
|
-
description:
|
|
861
|
+
var import_zod9 = require("zod");
|
|
862
|
+
var PaymentInstallmentSchema = import_zod9.z.object({
|
|
863
|
+
dueDate: import_zod9.z.string(),
|
|
864
|
+
amount: import_zod9.z.string(),
|
|
865
|
+
description: import_zod9.z.string().optional()
|
|
814
866
|
});
|
|
815
|
-
var PaymentPlanSchema =
|
|
816
|
-
installments:
|
|
817
|
-
financeCharge:
|
|
867
|
+
var PaymentPlanSchema = import_zod9.z.object({
|
|
868
|
+
installments: import_zod9.z.array(PaymentInstallmentSchema),
|
|
869
|
+
financeCharge: import_zod9.z.string().optional()
|
|
818
870
|
});
|
|
819
|
-
var LocationPremiumSchema =
|
|
820
|
-
locationNumber:
|
|
821
|
-
premium:
|
|
822
|
-
description:
|
|
871
|
+
var LocationPremiumSchema = import_zod9.z.object({
|
|
872
|
+
locationNumber: import_zod9.z.number(),
|
|
873
|
+
premium: import_zod9.z.string(),
|
|
874
|
+
description: import_zod9.z.string().optional()
|
|
823
875
|
});
|
|
824
876
|
|
|
825
877
|
// src/schemas/loss-history.ts
|
|
826
|
-
var
|
|
827
|
-
var ClaimRecordSchema =
|
|
828
|
-
dateOfLoss:
|
|
829
|
-
claimNumber:
|
|
830
|
-
description:
|
|
878
|
+
var import_zod10 = require("zod");
|
|
879
|
+
var ClaimRecordSchema = import_zod10.z.object({
|
|
880
|
+
dateOfLoss: import_zod10.z.string(),
|
|
881
|
+
claimNumber: import_zod10.z.string().optional(),
|
|
882
|
+
description: import_zod10.z.string(),
|
|
831
883
|
status: ClaimStatusSchema,
|
|
832
|
-
paid:
|
|
833
|
-
reserved:
|
|
834
|
-
incurred:
|
|
835
|
-
claimant:
|
|
836
|
-
coverageLine:
|
|
884
|
+
paid: import_zod10.z.string().optional(),
|
|
885
|
+
reserved: import_zod10.z.string().optional(),
|
|
886
|
+
incurred: import_zod10.z.string().optional(),
|
|
887
|
+
claimant: import_zod10.z.string().optional(),
|
|
888
|
+
coverageLine: import_zod10.z.string().optional()
|
|
837
889
|
});
|
|
838
|
-
var LossSummarySchema =
|
|
839
|
-
period:
|
|
840
|
-
totalClaims:
|
|
841
|
-
totalIncurred:
|
|
842
|
-
totalPaid:
|
|
843
|
-
totalReserved:
|
|
844
|
-
lossRatio:
|
|
890
|
+
var LossSummarySchema = import_zod10.z.object({
|
|
891
|
+
period: import_zod10.z.string().optional(),
|
|
892
|
+
totalClaims: import_zod10.z.number().optional(),
|
|
893
|
+
totalIncurred: import_zod10.z.string().optional(),
|
|
894
|
+
totalPaid: import_zod10.z.string().optional(),
|
|
895
|
+
totalReserved: import_zod10.z.string().optional(),
|
|
896
|
+
lossRatio: import_zod10.z.string().optional()
|
|
845
897
|
});
|
|
846
|
-
var ExperienceModSchema =
|
|
847
|
-
factor:
|
|
848
|
-
effectiveDate:
|
|
849
|
-
state:
|
|
898
|
+
var ExperienceModSchema = import_zod10.z.object({
|
|
899
|
+
factor: import_zod10.z.number(),
|
|
900
|
+
effectiveDate: import_zod10.z.string().optional(),
|
|
901
|
+
state: import_zod10.z.string().optional()
|
|
850
902
|
});
|
|
851
903
|
|
|
852
904
|
// src/schemas/underwriting.ts
|
|
853
|
-
var
|
|
854
|
-
var EnrichedSubjectivitySchema =
|
|
855
|
-
description:
|
|
905
|
+
var import_zod11 = require("zod");
|
|
906
|
+
var EnrichedSubjectivitySchema = import_zod11.z.object({
|
|
907
|
+
description: import_zod11.z.string(),
|
|
856
908
|
category: SubjectivityCategorySchema.optional(),
|
|
857
|
-
dueDate:
|
|
858
|
-
status:
|
|
859
|
-
pageNumber:
|
|
909
|
+
dueDate: import_zod11.z.string().optional(),
|
|
910
|
+
status: import_zod11.z.enum(["open", "satisfied", "waived"]).optional(),
|
|
911
|
+
pageNumber: import_zod11.z.number().optional()
|
|
860
912
|
});
|
|
861
|
-
var EnrichedUnderwritingConditionSchema =
|
|
862
|
-
description:
|
|
863
|
-
category:
|
|
864
|
-
pageNumber:
|
|
913
|
+
var EnrichedUnderwritingConditionSchema = import_zod11.z.object({
|
|
914
|
+
description: import_zod11.z.string(),
|
|
915
|
+
category: import_zod11.z.string().optional(),
|
|
916
|
+
pageNumber: import_zod11.z.number().optional()
|
|
865
917
|
});
|
|
866
|
-
var BindingAuthoritySchema =
|
|
867
|
-
authorizedBy:
|
|
868
|
-
method:
|
|
869
|
-
expiration:
|
|
870
|
-
conditions:
|
|
918
|
+
var BindingAuthoritySchema = import_zod11.z.object({
|
|
919
|
+
authorizedBy: import_zod11.z.string().optional(),
|
|
920
|
+
method: import_zod11.z.string().optional(),
|
|
921
|
+
expiration: import_zod11.z.string().optional(),
|
|
922
|
+
conditions: import_zod11.z.array(import_zod11.z.string()).optional()
|
|
871
923
|
});
|
|
872
924
|
|
|
873
925
|
// src/schemas/declarations/index.ts
|
|
874
|
-
var
|
|
926
|
+
var import_zod15 = require("zod");
|
|
875
927
|
|
|
876
928
|
// src/schemas/declarations/personal.ts
|
|
877
|
-
var
|
|
929
|
+
var import_zod13 = require("zod");
|
|
878
930
|
|
|
879
931
|
// src/schemas/declarations/shared.ts
|
|
880
|
-
var
|
|
881
|
-
var EmployersLiabilityLimitsSchema =
|
|
882
|
-
eachAccident:
|
|
883
|
-
diseasePolicyLimit:
|
|
884
|
-
diseaseEachEmployee:
|
|
932
|
+
var import_zod12 = require("zod");
|
|
933
|
+
var EmployersLiabilityLimitsSchema = import_zod12.z.object({
|
|
934
|
+
eachAccident: import_zod12.z.string(),
|
|
935
|
+
diseasePolicyLimit: import_zod12.z.string(),
|
|
936
|
+
diseaseEachEmployee: import_zod12.z.string()
|
|
885
937
|
});
|
|
886
|
-
var LimitScheduleSchema =
|
|
887
|
-
perOccurrence:
|
|
888
|
-
generalAggregate:
|
|
889
|
-
productsCompletedOpsAggregate:
|
|
890
|
-
personalAdvertisingInjury:
|
|
891
|
-
eachEmployee:
|
|
892
|
-
fireDamage:
|
|
893
|
-
medicalExpense:
|
|
894
|
-
combinedSingleLimit:
|
|
895
|
-
bodilyInjuryPerPerson:
|
|
896
|
-
bodilyInjuryPerAccident:
|
|
897
|
-
propertyDamage:
|
|
898
|
-
eachOccurrenceUmbrella:
|
|
899
|
-
umbrellaAggregate:
|
|
900
|
-
umbrellaRetention:
|
|
901
|
-
statutory:
|
|
938
|
+
var LimitScheduleSchema = import_zod12.z.object({
|
|
939
|
+
perOccurrence: import_zod12.z.string().optional(),
|
|
940
|
+
generalAggregate: import_zod12.z.string().optional(),
|
|
941
|
+
productsCompletedOpsAggregate: import_zod12.z.string().optional(),
|
|
942
|
+
personalAdvertisingInjury: import_zod12.z.string().optional(),
|
|
943
|
+
eachEmployee: import_zod12.z.string().optional(),
|
|
944
|
+
fireDamage: import_zod12.z.string().optional(),
|
|
945
|
+
medicalExpense: import_zod12.z.string().optional(),
|
|
946
|
+
combinedSingleLimit: import_zod12.z.string().optional(),
|
|
947
|
+
bodilyInjuryPerPerson: import_zod12.z.string().optional(),
|
|
948
|
+
bodilyInjuryPerAccident: import_zod12.z.string().optional(),
|
|
949
|
+
propertyDamage: import_zod12.z.string().optional(),
|
|
950
|
+
eachOccurrenceUmbrella: import_zod12.z.string().optional(),
|
|
951
|
+
umbrellaAggregate: import_zod12.z.string().optional(),
|
|
952
|
+
umbrellaRetention: import_zod12.z.string().optional(),
|
|
953
|
+
statutory: import_zod12.z.boolean().optional(),
|
|
902
954
|
employersLiability: EmployersLiabilityLimitsSchema.optional(),
|
|
903
|
-
sublimits:
|
|
904
|
-
sharedLimits:
|
|
955
|
+
sublimits: import_zod12.z.array(SublimitSchema).optional(),
|
|
956
|
+
sharedLimits: import_zod12.z.array(SharedLimitSchema).optional(),
|
|
905
957
|
defenseCostTreatment: DefenseCostTreatmentSchema.optional()
|
|
906
958
|
});
|
|
907
|
-
var DeductibleScheduleSchema =
|
|
908
|
-
perClaim:
|
|
909
|
-
perOccurrence:
|
|
910
|
-
aggregateDeductible:
|
|
911
|
-
selfInsuredRetention:
|
|
912
|
-
corridorDeductible:
|
|
913
|
-
waitingPeriod:
|
|
914
|
-
appliesTo:
|
|
959
|
+
var DeductibleScheduleSchema = import_zod12.z.object({
|
|
960
|
+
perClaim: import_zod12.z.string().optional(),
|
|
961
|
+
perOccurrence: import_zod12.z.string().optional(),
|
|
962
|
+
aggregateDeductible: import_zod12.z.string().optional(),
|
|
963
|
+
selfInsuredRetention: import_zod12.z.string().optional(),
|
|
964
|
+
corridorDeductible: import_zod12.z.string().optional(),
|
|
965
|
+
waitingPeriod: import_zod12.z.string().optional(),
|
|
966
|
+
appliesTo: import_zod12.z.enum(["damages_only", "damages_and_defense", "defense_only"]).optional()
|
|
915
967
|
});
|
|
916
|
-
var InsuredLocationSchema =
|
|
917
|
-
number:
|
|
968
|
+
var InsuredLocationSchema = import_zod12.z.object({
|
|
969
|
+
number: import_zod12.z.number(),
|
|
918
970
|
address: AddressSchema,
|
|
919
|
-
description:
|
|
920
|
-
buildingValue:
|
|
921
|
-
contentsValue:
|
|
922
|
-
businessIncomeValue:
|
|
923
|
-
constructionType:
|
|
924
|
-
yearBuilt:
|
|
925
|
-
squareFootage:
|
|
926
|
-
protectionClass:
|
|
927
|
-
sprinklered:
|
|
928
|
-
alarmType:
|
|
929
|
-
occupancy:
|
|
971
|
+
description: import_zod12.z.string().optional(),
|
|
972
|
+
buildingValue: import_zod12.z.string().optional(),
|
|
973
|
+
contentsValue: import_zod12.z.string().optional(),
|
|
974
|
+
businessIncomeValue: import_zod12.z.string().optional(),
|
|
975
|
+
constructionType: import_zod12.z.string().optional(),
|
|
976
|
+
yearBuilt: import_zod12.z.number().optional(),
|
|
977
|
+
squareFootage: import_zod12.z.number().optional(),
|
|
978
|
+
protectionClass: import_zod12.z.string().optional(),
|
|
979
|
+
sprinklered: import_zod12.z.boolean().optional(),
|
|
980
|
+
alarmType: import_zod12.z.string().optional(),
|
|
981
|
+
occupancy: import_zod12.z.string().optional()
|
|
930
982
|
});
|
|
931
|
-
var VehicleCoverageSchema =
|
|
983
|
+
var VehicleCoverageSchema = import_zod12.z.object({
|
|
932
984
|
type: VehicleCoverageTypeSchema,
|
|
933
|
-
limit:
|
|
934
|
-
deductible:
|
|
935
|
-
included:
|
|
985
|
+
limit: import_zod12.z.string().optional(),
|
|
986
|
+
deductible: import_zod12.z.string().optional(),
|
|
987
|
+
included: import_zod12.z.boolean()
|
|
936
988
|
});
|
|
937
|
-
var InsuredVehicleSchema =
|
|
938
|
-
number:
|
|
939
|
-
year:
|
|
940
|
-
make:
|
|
941
|
-
model:
|
|
942
|
-
vin:
|
|
943
|
-
costNew:
|
|
944
|
-
statedValue:
|
|
945
|
-
garageLocation:
|
|
946
|
-
coverages:
|
|
947
|
-
radius:
|
|
948
|
-
vehicleType:
|
|
989
|
+
var InsuredVehicleSchema = import_zod12.z.object({
|
|
990
|
+
number: import_zod12.z.number(),
|
|
991
|
+
year: import_zod12.z.number(),
|
|
992
|
+
make: import_zod12.z.string(),
|
|
993
|
+
model: import_zod12.z.string(),
|
|
994
|
+
vin: import_zod12.z.string(),
|
|
995
|
+
costNew: import_zod12.z.string().optional(),
|
|
996
|
+
statedValue: import_zod12.z.string().optional(),
|
|
997
|
+
garageLocation: import_zod12.z.number().optional(),
|
|
998
|
+
coverages: import_zod12.z.array(VehicleCoverageSchema).optional(),
|
|
999
|
+
radius: import_zod12.z.string().optional(),
|
|
1000
|
+
vehicleType: import_zod12.z.string().optional()
|
|
949
1001
|
});
|
|
950
|
-
var ClassificationCodeSchema =
|
|
951
|
-
code:
|
|
952
|
-
description:
|
|
953
|
-
premiumBasis:
|
|
954
|
-
basisAmount:
|
|
955
|
-
rate:
|
|
956
|
-
premium:
|
|
957
|
-
locationNumber:
|
|
1002
|
+
var ClassificationCodeSchema = import_zod12.z.object({
|
|
1003
|
+
code: import_zod12.z.string(),
|
|
1004
|
+
description: import_zod12.z.string(),
|
|
1005
|
+
premiumBasis: import_zod12.z.string(),
|
|
1006
|
+
basisAmount: import_zod12.z.string().optional(),
|
|
1007
|
+
rate: import_zod12.z.string().optional(),
|
|
1008
|
+
premium: import_zod12.z.string().optional(),
|
|
1009
|
+
locationNumber: import_zod12.z.number().optional()
|
|
958
1010
|
});
|
|
959
|
-
var DwellingDetailsSchema =
|
|
1011
|
+
var DwellingDetailsSchema = import_zod12.z.object({
|
|
960
1012
|
constructionType: ConstructionTypeSchema.optional(),
|
|
961
|
-
yearBuilt:
|
|
962
|
-
squareFootage:
|
|
963
|
-
stories:
|
|
1013
|
+
yearBuilt: import_zod12.z.number().optional(),
|
|
1014
|
+
squareFootage: import_zod12.z.number().optional(),
|
|
1015
|
+
stories: import_zod12.z.number().optional(),
|
|
964
1016
|
roofType: RoofTypeSchema.optional(),
|
|
965
|
-
roofAge:
|
|
966
|
-
heatingType:
|
|
1017
|
+
roofAge: import_zod12.z.number().optional(),
|
|
1018
|
+
heatingType: import_zod12.z.enum(["central", "baseboard", "radiant", "space_heater", "heat_pump", "other"]).optional(),
|
|
967
1019
|
foundationType: FoundationTypeSchema.optional(),
|
|
968
|
-
plumbingType:
|
|
969
|
-
electricalType:
|
|
970
|
-
electricalAmps:
|
|
971
|
-
hasSwimmingPool:
|
|
972
|
-
poolType:
|
|
973
|
-
hasTrampoline:
|
|
974
|
-
hasDog:
|
|
975
|
-
dogBreed:
|
|
976
|
-
protectiveDevices:
|
|
977
|
-
distanceToFireStation:
|
|
978
|
-
distanceToHydrant:
|
|
979
|
-
fireProtectionClass:
|
|
1020
|
+
plumbingType: import_zod12.z.enum(["copper", "pex", "galvanized", "polybutylene", "cpvc", "other"]).optional(),
|
|
1021
|
+
electricalType: import_zod12.z.enum(["circuit_breaker", "fuse_box", "knob_and_tube", "other"]).optional(),
|
|
1022
|
+
electricalAmps: import_zod12.z.number().optional(),
|
|
1023
|
+
hasSwimmingPool: import_zod12.z.boolean().optional(),
|
|
1024
|
+
poolType: import_zod12.z.enum(["in_ground", "above_ground"]).optional(),
|
|
1025
|
+
hasTrampoline: import_zod12.z.boolean().optional(),
|
|
1026
|
+
hasDog: import_zod12.z.boolean().optional(),
|
|
1027
|
+
dogBreed: import_zod12.z.string().optional(),
|
|
1028
|
+
protectiveDevices: import_zod12.z.array(import_zod12.z.string()).optional(),
|
|
1029
|
+
distanceToFireStation: import_zod12.z.string().optional(),
|
|
1030
|
+
distanceToHydrant: import_zod12.z.string().optional(),
|
|
1031
|
+
fireProtectionClass: import_zod12.z.string().optional()
|
|
980
1032
|
});
|
|
981
|
-
var DriverRecordSchema =
|
|
982
|
-
name:
|
|
983
|
-
dateOfBirth:
|
|
984
|
-
licenseNumber:
|
|
985
|
-
licenseState:
|
|
986
|
-
relationship:
|
|
987
|
-
yearsLicensed:
|
|
988
|
-
gender:
|
|
989
|
-
maritalStatus:
|
|
990
|
-
goodStudentDiscount:
|
|
991
|
-
defensiveDriverDiscount:
|
|
992
|
-
violations:
|
|
993
|
-
date:
|
|
994
|
-
type:
|
|
995
|
-
description:
|
|
1033
|
+
var DriverRecordSchema = import_zod12.z.object({
|
|
1034
|
+
name: import_zod12.z.string(),
|
|
1035
|
+
dateOfBirth: import_zod12.z.string().optional(),
|
|
1036
|
+
licenseNumber: import_zod12.z.string().optional(),
|
|
1037
|
+
licenseState: import_zod12.z.string().optional(),
|
|
1038
|
+
relationship: import_zod12.z.enum(["named_insured", "spouse", "child", "other_household", "other"]).optional(),
|
|
1039
|
+
yearsLicensed: import_zod12.z.number().optional(),
|
|
1040
|
+
gender: import_zod12.z.string().optional(),
|
|
1041
|
+
maritalStatus: import_zod12.z.string().optional(),
|
|
1042
|
+
goodStudentDiscount: import_zod12.z.boolean().optional(),
|
|
1043
|
+
defensiveDriverDiscount: import_zod12.z.boolean().optional(),
|
|
1044
|
+
violations: import_zod12.z.array(import_zod12.z.object({
|
|
1045
|
+
date: import_zod12.z.string().optional(),
|
|
1046
|
+
type: import_zod12.z.string().optional(),
|
|
1047
|
+
description: import_zod12.z.string().optional()
|
|
996
1048
|
})).optional(),
|
|
997
|
-
accidents:
|
|
998
|
-
date:
|
|
999
|
-
atFault:
|
|
1000
|
-
description:
|
|
1001
|
-
amountPaid:
|
|
1049
|
+
accidents: import_zod12.z.array(import_zod12.z.object({
|
|
1050
|
+
date: import_zod12.z.string().optional(),
|
|
1051
|
+
atFault: import_zod12.z.boolean().optional(),
|
|
1052
|
+
description: import_zod12.z.string().optional(),
|
|
1053
|
+
amountPaid: import_zod12.z.string().optional()
|
|
1002
1054
|
})).optional(),
|
|
1003
|
-
sr22Required:
|
|
1055
|
+
sr22Required: import_zod12.z.boolean().optional()
|
|
1004
1056
|
});
|
|
1005
|
-
var PersonalVehicleDetailsSchema =
|
|
1006
|
-
number:
|
|
1007
|
-
year:
|
|
1008
|
-
make:
|
|
1009
|
-
model:
|
|
1010
|
-
vin:
|
|
1011
|
-
bodyType:
|
|
1057
|
+
var PersonalVehicleDetailsSchema = import_zod12.z.object({
|
|
1058
|
+
number: import_zod12.z.number().optional(),
|
|
1059
|
+
year: import_zod12.z.number().optional(),
|
|
1060
|
+
make: import_zod12.z.string().optional(),
|
|
1061
|
+
model: import_zod12.z.string().optional(),
|
|
1062
|
+
vin: import_zod12.z.string().optional(),
|
|
1063
|
+
bodyType: import_zod12.z.string().optional(),
|
|
1012
1064
|
garagingAddress: AddressSchema.optional(),
|
|
1013
1065
|
usage: PersonalAutoUsageSchema.optional(),
|
|
1014
|
-
annualMileage:
|
|
1015
|
-
odometerReading:
|
|
1016
|
-
driverAssignment:
|
|
1066
|
+
annualMileage: import_zod12.z.number().optional(),
|
|
1067
|
+
odometerReading: import_zod12.z.number().optional(),
|
|
1068
|
+
driverAssignment: import_zod12.z.string().optional(),
|
|
1017
1069
|
lienHolder: EndorsementPartySchema.optional(),
|
|
1018
|
-
collisionDeductible:
|
|
1019
|
-
comprehensiveDeductible:
|
|
1020
|
-
rentalReimbursement:
|
|
1021
|
-
towing:
|
|
1070
|
+
collisionDeductible: import_zod12.z.string().optional(),
|
|
1071
|
+
comprehensiveDeductible: import_zod12.z.string().optional(),
|
|
1072
|
+
rentalReimbursement: import_zod12.z.boolean().optional(),
|
|
1073
|
+
towing: import_zod12.z.boolean().optional()
|
|
1022
1074
|
});
|
|
1023
1075
|
|
|
1024
1076
|
// src/schemas/declarations/personal.ts
|
|
1025
|
-
var HomeownersDeclarationsSchema =
|
|
1026
|
-
line:
|
|
1077
|
+
var HomeownersDeclarationsSchema = import_zod13.z.object({
|
|
1078
|
+
line: import_zod13.z.literal("homeowners"),
|
|
1027
1079
|
formType: HomeownersFormTypeSchema,
|
|
1028
|
-
coverageA:
|
|
1029
|
-
coverageB:
|
|
1030
|
-
coverageC:
|
|
1031
|
-
coverageD:
|
|
1032
|
-
coverageE:
|
|
1033
|
-
coverageF:
|
|
1034
|
-
allPerilDeductible:
|
|
1035
|
-
windHailDeductible:
|
|
1036
|
-
hurricaneDeductible:
|
|
1080
|
+
coverageA: import_zod13.z.string().optional(),
|
|
1081
|
+
coverageB: import_zod13.z.string().optional(),
|
|
1082
|
+
coverageC: import_zod13.z.string().optional(),
|
|
1083
|
+
coverageD: import_zod13.z.string().optional(),
|
|
1084
|
+
coverageE: import_zod13.z.string().optional(),
|
|
1085
|
+
coverageF: import_zod13.z.string().optional(),
|
|
1086
|
+
allPerilDeductible: import_zod13.z.string().optional(),
|
|
1087
|
+
windHailDeductible: import_zod13.z.string().optional(),
|
|
1088
|
+
hurricaneDeductible: import_zod13.z.string().optional(),
|
|
1037
1089
|
lossSettlement: LossSettlementSchema.optional(),
|
|
1038
1090
|
dwelling: DwellingDetailsSchema,
|
|
1039
1091
|
mortgagee: EndorsementPartySchema.optional(),
|
|
1040
|
-
additionalMortgagees:
|
|
1092
|
+
additionalMortgagees: import_zod13.z.array(EndorsementPartySchema).optional()
|
|
1041
1093
|
});
|
|
1042
|
-
var PersonalAutoDeclarationsSchema =
|
|
1043
|
-
line:
|
|
1044
|
-
vehicles:
|
|
1045
|
-
drivers:
|
|
1046
|
-
liabilityLimits:
|
|
1047
|
-
bodilyInjuryPerPerson:
|
|
1048
|
-
bodilyInjuryPerAccident:
|
|
1049
|
-
propertyDamage:
|
|
1050
|
-
combinedSingleLimit:
|
|
1094
|
+
var PersonalAutoDeclarationsSchema = import_zod13.z.object({
|
|
1095
|
+
line: import_zod13.z.literal("personal_auto"),
|
|
1096
|
+
vehicles: import_zod13.z.array(PersonalVehicleDetailsSchema),
|
|
1097
|
+
drivers: import_zod13.z.array(DriverRecordSchema),
|
|
1098
|
+
liabilityLimits: import_zod13.z.object({
|
|
1099
|
+
bodilyInjuryPerPerson: import_zod13.z.string().optional(),
|
|
1100
|
+
bodilyInjuryPerAccident: import_zod13.z.string().optional(),
|
|
1101
|
+
propertyDamage: import_zod13.z.string().optional(),
|
|
1102
|
+
combinedSingleLimit: import_zod13.z.string().optional()
|
|
1051
1103
|
}).optional(),
|
|
1052
|
-
umLimits:
|
|
1053
|
-
bodilyInjuryPerPerson:
|
|
1054
|
-
bodilyInjuryPerAccident:
|
|
1104
|
+
umLimits: import_zod13.z.object({
|
|
1105
|
+
bodilyInjuryPerPerson: import_zod13.z.string().optional(),
|
|
1106
|
+
bodilyInjuryPerAccident: import_zod13.z.string().optional()
|
|
1055
1107
|
}).optional(),
|
|
1056
|
-
uimLimits:
|
|
1057
|
-
bodilyInjuryPerPerson:
|
|
1058
|
-
bodilyInjuryPerAccident:
|
|
1108
|
+
uimLimits: import_zod13.z.object({
|
|
1109
|
+
bodilyInjuryPerPerson: import_zod13.z.string().optional(),
|
|
1110
|
+
bodilyInjuryPerAccident: import_zod13.z.string().optional()
|
|
1059
1111
|
}).optional(),
|
|
1060
|
-
pipLimit:
|
|
1061
|
-
medPayLimit:
|
|
1112
|
+
pipLimit: import_zod13.z.string().optional(),
|
|
1113
|
+
medPayLimit: import_zod13.z.string().optional()
|
|
1062
1114
|
});
|
|
1063
|
-
var DwellingFireDeclarationsSchema =
|
|
1064
|
-
line:
|
|
1115
|
+
var DwellingFireDeclarationsSchema = import_zod13.z.object({
|
|
1116
|
+
line: import_zod13.z.literal("dwelling_fire"),
|
|
1065
1117
|
formType: DwellingFireFormTypeSchema,
|
|
1066
|
-
dwellingLimit:
|
|
1067
|
-
otherStructuresLimit:
|
|
1068
|
-
personalPropertyLimit:
|
|
1069
|
-
fairRentalValueLimit:
|
|
1070
|
-
liabilityLimit:
|
|
1071
|
-
medicalPaymentsLimit:
|
|
1072
|
-
deductible:
|
|
1118
|
+
dwellingLimit: import_zod13.z.string().optional(),
|
|
1119
|
+
otherStructuresLimit: import_zod13.z.string().optional(),
|
|
1120
|
+
personalPropertyLimit: import_zod13.z.string().optional(),
|
|
1121
|
+
fairRentalValueLimit: import_zod13.z.string().optional(),
|
|
1122
|
+
liabilityLimit: import_zod13.z.string().optional(),
|
|
1123
|
+
medicalPaymentsLimit: import_zod13.z.string().optional(),
|
|
1124
|
+
deductible: import_zod13.z.string().optional(),
|
|
1073
1125
|
dwelling: DwellingDetailsSchema
|
|
1074
1126
|
});
|
|
1075
|
-
var FloodDeclarationsSchema =
|
|
1076
|
-
line:
|
|
1077
|
-
programType:
|
|
1127
|
+
var FloodDeclarationsSchema = import_zod13.z.object({
|
|
1128
|
+
line: import_zod13.z.literal("flood"),
|
|
1129
|
+
programType: import_zod13.z.enum(["nfip", "private"]),
|
|
1078
1130
|
floodZone: FloodZoneSchema.optional(),
|
|
1079
|
-
communityNumber:
|
|
1080
|
-
communityRating:
|
|
1081
|
-
buildingCoverage:
|
|
1082
|
-
contentsCoverage:
|
|
1083
|
-
iccCoverage:
|
|
1084
|
-
deductible:
|
|
1085
|
-
waitingPeriodDays:
|
|
1086
|
-
elevationCertificate:
|
|
1087
|
-
elevationDifference:
|
|
1088
|
-
buildingDiagramNumber:
|
|
1089
|
-
basementOrEnclosure:
|
|
1090
|
-
postFirmConstruction:
|
|
1131
|
+
communityNumber: import_zod13.z.string().optional(),
|
|
1132
|
+
communityRating: import_zod13.z.number().optional(),
|
|
1133
|
+
buildingCoverage: import_zod13.z.string().optional(),
|
|
1134
|
+
contentsCoverage: import_zod13.z.string().optional(),
|
|
1135
|
+
iccCoverage: import_zod13.z.string().optional(),
|
|
1136
|
+
deductible: import_zod13.z.string().optional(),
|
|
1137
|
+
waitingPeriodDays: import_zod13.z.number().optional(),
|
|
1138
|
+
elevationCertificate: import_zod13.z.boolean().optional(),
|
|
1139
|
+
elevationDifference: import_zod13.z.string().optional(),
|
|
1140
|
+
buildingDiagramNumber: import_zod13.z.number().optional(),
|
|
1141
|
+
basementOrEnclosure: import_zod13.z.boolean().optional(),
|
|
1142
|
+
postFirmConstruction: import_zod13.z.boolean().optional()
|
|
1091
1143
|
});
|
|
1092
|
-
var EarthquakeDeclarationsSchema =
|
|
1093
|
-
line:
|
|
1094
|
-
dwellingCoverage:
|
|
1095
|
-
contentsCoverage:
|
|
1096
|
-
lossOfUseCoverage:
|
|
1097
|
-
deductiblePercent:
|
|
1098
|
-
retrofitDiscount:
|
|
1099
|
-
masonryVeneerCoverage:
|
|
1144
|
+
var EarthquakeDeclarationsSchema = import_zod13.z.object({
|
|
1145
|
+
line: import_zod13.z.literal("earthquake"),
|
|
1146
|
+
dwellingCoverage: import_zod13.z.string().optional(),
|
|
1147
|
+
contentsCoverage: import_zod13.z.string().optional(),
|
|
1148
|
+
lossOfUseCoverage: import_zod13.z.string().optional(),
|
|
1149
|
+
deductiblePercent: import_zod13.z.number().optional(),
|
|
1150
|
+
retrofitDiscount: import_zod13.z.boolean().optional(),
|
|
1151
|
+
masonryVeneerCoverage: import_zod13.z.boolean().optional()
|
|
1100
1152
|
});
|
|
1101
|
-
var PersonalUmbrellaDeclarationsSchema =
|
|
1102
|
-
line:
|
|
1103
|
-
perOccurrenceLimit:
|
|
1104
|
-
aggregateLimit:
|
|
1105
|
-
retainedLimit:
|
|
1106
|
-
underlyingPolicies:
|
|
1107
|
-
carrier:
|
|
1108
|
-
policyNumber:
|
|
1109
|
-
policyType:
|
|
1110
|
-
limits:
|
|
1153
|
+
var PersonalUmbrellaDeclarationsSchema = import_zod13.z.object({
|
|
1154
|
+
line: import_zod13.z.literal("personal_umbrella"),
|
|
1155
|
+
perOccurrenceLimit: import_zod13.z.string().optional(),
|
|
1156
|
+
aggregateLimit: import_zod13.z.string().optional(),
|
|
1157
|
+
retainedLimit: import_zod13.z.string().optional(),
|
|
1158
|
+
underlyingPolicies: import_zod13.z.array(import_zod13.z.object({
|
|
1159
|
+
carrier: import_zod13.z.string().optional(),
|
|
1160
|
+
policyNumber: import_zod13.z.string().optional(),
|
|
1161
|
+
policyType: import_zod13.z.string().optional(),
|
|
1162
|
+
limits: import_zod13.z.string().optional()
|
|
1111
1163
|
}))
|
|
1112
1164
|
});
|
|
1113
|
-
var PersonalArticlesDeclarationsSchema =
|
|
1114
|
-
line:
|
|
1115
|
-
scheduledItems:
|
|
1116
|
-
itemNumber:
|
|
1165
|
+
var PersonalArticlesDeclarationsSchema = import_zod13.z.object({
|
|
1166
|
+
line: import_zod13.z.literal("personal_articles"),
|
|
1167
|
+
scheduledItems: import_zod13.z.array(import_zod13.z.object({
|
|
1168
|
+
itemNumber: import_zod13.z.number().optional(),
|
|
1117
1169
|
category: ScheduledItemCategorySchema.optional(),
|
|
1118
|
-
description:
|
|
1119
|
-
appraisedValue:
|
|
1120
|
-
appraisalDate:
|
|
1170
|
+
description: import_zod13.z.string(),
|
|
1171
|
+
appraisedValue: import_zod13.z.string(),
|
|
1172
|
+
appraisalDate: import_zod13.z.string().optional()
|
|
1121
1173
|
})),
|
|
1122
|
-
blanketCoverage:
|
|
1123
|
-
deductible:
|
|
1124
|
-
worldwideCoverage:
|
|
1125
|
-
breakageCoverage:
|
|
1174
|
+
blanketCoverage: import_zod13.z.string().optional(),
|
|
1175
|
+
deductible: import_zod13.z.string().optional(),
|
|
1176
|
+
worldwideCoverage: import_zod13.z.boolean().optional(),
|
|
1177
|
+
breakageCoverage: import_zod13.z.boolean().optional()
|
|
1126
1178
|
});
|
|
1127
|
-
var WatercraftDeclarationsSchema =
|
|
1128
|
-
line:
|
|
1179
|
+
var WatercraftDeclarationsSchema = import_zod13.z.object({
|
|
1180
|
+
line: import_zod13.z.literal("watercraft"),
|
|
1129
1181
|
boatType: BoatTypeSchema.optional(),
|
|
1130
|
-
year:
|
|
1131
|
-
make:
|
|
1132
|
-
model:
|
|
1133
|
-
length:
|
|
1134
|
-
hullMaterial:
|
|
1135
|
-
hullValue:
|
|
1136
|
-
motorHorsepower:
|
|
1137
|
-
motorType:
|
|
1138
|
-
navigationLimits:
|
|
1139
|
-
layupPeriod:
|
|
1140
|
-
liabilityLimit:
|
|
1141
|
-
medicalPaymentsLimit:
|
|
1142
|
-
physicalDamageDeductible:
|
|
1143
|
-
uninsuredBoaterLimit:
|
|
1144
|
-
trailerCovered:
|
|
1145
|
-
trailerValue:
|
|
1182
|
+
year: import_zod13.z.number().optional(),
|
|
1183
|
+
make: import_zod13.z.string().optional(),
|
|
1184
|
+
model: import_zod13.z.string().optional(),
|
|
1185
|
+
length: import_zod13.z.string().optional(),
|
|
1186
|
+
hullMaterial: import_zod13.z.enum(["fiberglass", "aluminum", "wood", "steel", "inflatable", "other"]).optional(),
|
|
1187
|
+
hullValue: import_zod13.z.string().optional(),
|
|
1188
|
+
motorHorsepower: import_zod13.z.number().optional(),
|
|
1189
|
+
motorType: import_zod13.z.enum(["outboard", "inboard", "inboard_outboard", "jet"]).optional(),
|
|
1190
|
+
navigationLimits: import_zod13.z.string().optional(),
|
|
1191
|
+
layupPeriod: import_zod13.z.string().optional(),
|
|
1192
|
+
liabilityLimit: import_zod13.z.string().optional(),
|
|
1193
|
+
medicalPaymentsLimit: import_zod13.z.string().optional(),
|
|
1194
|
+
physicalDamageDeductible: import_zod13.z.string().optional(),
|
|
1195
|
+
uninsuredBoaterLimit: import_zod13.z.string().optional(),
|
|
1196
|
+
trailerCovered: import_zod13.z.boolean().optional(),
|
|
1197
|
+
trailerValue: import_zod13.z.string().optional()
|
|
1146
1198
|
});
|
|
1147
|
-
var RecreationalVehicleDeclarationsSchema =
|
|
1148
|
-
line:
|
|
1199
|
+
var RecreationalVehicleDeclarationsSchema = import_zod13.z.object({
|
|
1200
|
+
line: import_zod13.z.literal("recreational_vehicle"),
|
|
1149
1201
|
vehicleType: RVTypeSchema,
|
|
1150
|
-
year:
|
|
1151
|
-
make:
|
|
1152
|
-
model:
|
|
1153
|
-
vin:
|
|
1154
|
-
value:
|
|
1155
|
-
liabilityLimit:
|
|
1156
|
-
collisionDeductible:
|
|
1157
|
-
comprehensiveDeductible:
|
|
1158
|
-
personalEffectsCoverage:
|
|
1159
|
-
fullTimerCoverage:
|
|
1202
|
+
year: import_zod13.z.number().optional(),
|
|
1203
|
+
make: import_zod13.z.string().optional(),
|
|
1204
|
+
model: import_zod13.z.string().optional(),
|
|
1205
|
+
vin: import_zod13.z.string().optional(),
|
|
1206
|
+
value: import_zod13.z.string().optional(),
|
|
1207
|
+
liabilityLimit: import_zod13.z.string().optional(),
|
|
1208
|
+
collisionDeductible: import_zod13.z.string().optional(),
|
|
1209
|
+
comprehensiveDeductible: import_zod13.z.string().optional(),
|
|
1210
|
+
personalEffectsCoverage: import_zod13.z.string().optional(),
|
|
1211
|
+
fullTimerCoverage: import_zod13.z.boolean().optional()
|
|
1160
1212
|
});
|
|
1161
|
-
var FarmRanchDeclarationsSchema =
|
|
1162
|
-
line:
|
|
1163
|
-
dwellingCoverage:
|
|
1164
|
-
farmPersonalPropertyCoverage:
|
|
1165
|
-
farmLiabilityLimit:
|
|
1166
|
-
farmAutoIncluded:
|
|
1167
|
-
livestock:
|
|
1168
|
-
type:
|
|
1169
|
-
headCount:
|
|
1170
|
-
value:
|
|
1213
|
+
var FarmRanchDeclarationsSchema = import_zod13.z.object({
|
|
1214
|
+
line: import_zod13.z.literal("farm_ranch"),
|
|
1215
|
+
dwellingCoverage: import_zod13.z.string().optional(),
|
|
1216
|
+
farmPersonalPropertyCoverage: import_zod13.z.string().optional(),
|
|
1217
|
+
farmLiabilityLimit: import_zod13.z.string().optional(),
|
|
1218
|
+
farmAutoIncluded: import_zod13.z.boolean().optional(),
|
|
1219
|
+
livestock: import_zod13.z.array(import_zod13.z.object({
|
|
1220
|
+
type: import_zod13.z.string(),
|
|
1221
|
+
headCount: import_zod13.z.number(),
|
|
1222
|
+
value: import_zod13.z.string().optional()
|
|
1171
1223
|
})).optional(),
|
|
1172
|
-
equipmentSchedule:
|
|
1173
|
-
description:
|
|
1174
|
-
value:
|
|
1224
|
+
equipmentSchedule: import_zod13.z.array(import_zod13.z.object({
|
|
1225
|
+
description: import_zod13.z.string(),
|
|
1226
|
+
value: import_zod13.z.string()
|
|
1175
1227
|
})).optional(),
|
|
1176
|
-
acreage:
|
|
1228
|
+
acreage: import_zod13.z.number().optional(),
|
|
1177
1229
|
dwelling: DwellingDetailsSchema.optional()
|
|
1178
1230
|
});
|
|
1179
|
-
var TitleDeclarationsSchema =
|
|
1180
|
-
line:
|
|
1231
|
+
var TitleDeclarationsSchema = import_zod13.z.object({
|
|
1232
|
+
line: import_zod13.z.literal("title"),
|
|
1181
1233
|
policyType: TitlePolicyTypeSchema,
|
|
1182
|
-
policyAmount:
|
|
1183
|
-
legalDescription:
|
|
1234
|
+
policyAmount: import_zod13.z.string(),
|
|
1235
|
+
legalDescription: import_zod13.z.string().optional(),
|
|
1184
1236
|
propertyAddress: AddressSchema.optional(),
|
|
1185
|
-
effectiveDate:
|
|
1186
|
-
exceptions:
|
|
1187
|
-
number:
|
|
1188
|
-
description:
|
|
1237
|
+
effectiveDate: import_zod13.z.string().optional(),
|
|
1238
|
+
exceptions: import_zod13.z.array(import_zod13.z.object({
|
|
1239
|
+
number: import_zod13.z.number(),
|
|
1240
|
+
description: import_zod13.z.string()
|
|
1189
1241
|
})).optional(),
|
|
1190
|
-
underwriter:
|
|
1242
|
+
underwriter: import_zod13.z.string().optional()
|
|
1191
1243
|
});
|
|
1192
|
-
var PetDeclarationsSchema =
|
|
1193
|
-
line:
|
|
1244
|
+
var PetDeclarationsSchema = import_zod13.z.object({
|
|
1245
|
+
line: import_zod13.z.literal("pet"),
|
|
1194
1246
|
species: PetSpeciesSchema,
|
|
1195
|
-
breed:
|
|
1196
|
-
petName:
|
|
1197
|
-
age:
|
|
1198
|
-
annualLimit:
|
|
1199
|
-
perIncidentLimit:
|
|
1200
|
-
deductible:
|
|
1201
|
-
reimbursementPercent:
|
|
1202
|
-
waitingPeriodDays:
|
|
1203
|
-
preExistingConditionsExcluded:
|
|
1204
|
-
wellnessCoverage:
|
|
1247
|
+
breed: import_zod13.z.string().optional(),
|
|
1248
|
+
petName: import_zod13.z.string().optional(),
|
|
1249
|
+
age: import_zod13.z.number().optional(),
|
|
1250
|
+
annualLimit: import_zod13.z.string().optional(),
|
|
1251
|
+
perIncidentLimit: import_zod13.z.string().optional(),
|
|
1252
|
+
deductible: import_zod13.z.string().optional(),
|
|
1253
|
+
reimbursementPercent: import_zod13.z.number().optional(),
|
|
1254
|
+
waitingPeriodDays: import_zod13.z.number().optional(),
|
|
1255
|
+
preExistingConditionsExcluded: import_zod13.z.boolean().optional(),
|
|
1256
|
+
wellnessCoverage: import_zod13.z.boolean().optional()
|
|
1205
1257
|
});
|
|
1206
|
-
var TravelDeclarationsSchema =
|
|
1207
|
-
line:
|
|
1208
|
-
tripDepartureDate:
|
|
1209
|
-
tripReturnDate:
|
|
1210
|
-
destinations:
|
|
1211
|
-
travelers:
|
|
1212
|
-
name:
|
|
1213
|
-
age:
|
|
1258
|
+
var TravelDeclarationsSchema = import_zod13.z.object({
|
|
1259
|
+
line: import_zod13.z.literal("travel"),
|
|
1260
|
+
tripDepartureDate: import_zod13.z.string().optional(),
|
|
1261
|
+
tripReturnDate: import_zod13.z.string().optional(),
|
|
1262
|
+
destinations: import_zod13.z.array(import_zod13.z.string()).optional(),
|
|
1263
|
+
travelers: import_zod13.z.array(import_zod13.z.object({
|
|
1264
|
+
name: import_zod13.z.string(),
|
|
1265
|
+
age: import_zod13.z.number().optional()
|
|
1214
1266
|
})).optional(),
|
|
1215
|
-
tripCost:
|
|
1216
|
-
tripCancellationLimit:
|
|
1217
|
-
medicalLimit:
|
|
1218
|
-
evacuationLimit:
|
|
1219
|
-
baggageLimit:
|
|
1267
|
+
tripCost: import_zod13.z.string().optional(),
|
|
1268
|
+
tripCancellationLimit: import_zod13.z.string().optional(),
|
|
1269
|
+
medicalLimit: import_zod13.z.string().optional(),
|
|
1270
|
+
evacuationLimit: import_zod13.z.string().optional(),
|
|
1271
|
+
baggageLimit: import_zod13.z.string().optional()
|
|
1220
1272
|
});
|
|
1221
|
-
var IdentityTheftDeclarationsSchema =
|
|
1222
|
-
line:
|
|
1223
|
-
coverageLimit:
|
|
1224
|
-
expenseReimbursement:
|
|
1225
|
-
creditMonitoring:
|
|
1226
|
-
restorationServices:
|
|
1227
|
-
lostWagesLimit:
|
|
1273
|
+
var IdentityTheftDeclarationsSchema = import_zod13.z.object({
|
|
1274
|
+
line: import_zod13.z.literal("identity_theft"),
|
|
1275
|
+
coverageLimit: import_zod13.z.string().optional(),
|
|
1276
|
+
expenseReimbursement: import_zod13.z.string().optional(),
|
|
1277
|
+
creditMonitoring: import_zod13.z.boolean().optional(),
|
|
1278
|
+
restorationServices: import_zod13.z.boolean().optional(),
|
|
1279
|
+
lostWagesLimit: import_zod13.z.string().optional()
|
|
1228
1280
|
});
|
|
1229
1281
|
|
|
1230
1282
|
// src/schemas/declarations/commercial.ts
|
|
1231
|
-
var
|
|
1232
|
-
var GLDeclarationsSchema =
|
|
1233
|
-
line:
|
|
1283
|
+
var import_zod14 = require("zod");
|
|
1284
|
+
var GLDeclarationsSchema = import_zod14.z.object({
|
|
1285
|
+
line: import_zod14.z.literal("gl"),
|
|
1234
1286
|
coverageForm: CoverageFormSchema.optional(),
|
|
1235
|
-
perOccurrenceLimit:
|
|
1236
|
-
generalAggregate:
|
|
1237
|
-
productsCompletedOpsAggregate:
|
|
1238
|
-
personalAdvertisingInjury:
|
|
1239
|
-
fireDamage:
|
|
1240
|
-
medicalExpense:
|
|
1287
|
+
perOccurrenceLimit: import_zod14.z.string().optional(),
|
|
1288
|
+
generalAggregate: import_zod14.z.string().optional(),
|
|
1289
|
+
productsCompletedOpsAggregate: import_zod14.z.string().optional(),
|
|
1290
|
+
personalAdvertisingInjury: import_zod14.z.string().optional(),
|
|
1291
|
+
fireDamage: import_zod14.z.string().optional(),
|
|
1292
|
+
medicalExpense: import_zod14.z.string().optional(),
|
|
1241
1293
|
defenseCostTreatment: DefenseCostTreatmentSchema.optional(),
|
|
1242
|
-
deductible:
|
|
1243
|
-
classifications:
|
|
1244
|
-
retroactiveDate:
|
|
1294
|
+
deductible: import_zod14.z.string().optional(),
|
|
1295
|
+
classifications: import_zod14.z.array(ClassificationCodeSchema).optional(),
|
|
1296
|
+
retroactiveDate: import_zod14.z.string().optional()
|
|
1245
1297
|
});
|
|
1246
|
-
var CommercialPropertyDeclarationsSchema =
|
|
1247
|
-
line:
|
|
1248
|
-
causesOfLossForm:
|
|
1249
|
-
coinsurancePercent:
|
|
1298
|
+
var CommercialPropertyDeclarationsSchema = import_zod14.z.object({
|
|
1299
|
+
line: import_zod14.z.literal("commercial_property"),
|
|
1300
|
+
causesOfLossForm: import_zod14.z.enum(["basic", "broad", "special"]).optional(),
|
|
1301
|
+
coinsurancePercent: import_zod14.z.number().optional(),
|
|
1250
1302
|
valuationMethod: ValuationMethodSchema.optional(),
|
|
1251
|
-
locations:
|
|
1252
|
-
blanketLimit:
|
|
1253
|
-
businessIncomeLimit:
|
|
1254
|
-
extraExpenseLimit:
|
|
1303
|
+
locations: import_zod14.z.array(InsuredLocationSchema),
|
|
1304
|
+
blanketLimit: import_zod14.z.string().optional(),
|
|
1305
|
+
businessIncomeLimit: import_zod14.z.string().optional(),
|
|
1306
|
+
extraExpenseLimit: import_zod14.z.string().optional()
|
|
1255
1307
|
});
|
|
1256
|
-
var CommercialAutoDeclarationsSchema =
|
|
1257
|
-
line:
|
|
1258
|
-
vehicles:
|
|
1259
|
-
coveredAutoSymbols:
|
|
1260
|
-
liabilityLimit:
|
|
1261
|
-
umLimit:
|
|
1262
|
-
uimLimit:
|
|
1263
|
-
hiredAutoLiability:
|
|
1264
|
-
nonOwnedAutoLiability:
|
|
1308
|
+
var CommercialAutoDeclarationsSchema = import_zod14.z.object({
|
|
1309
|
+
line: import_zod14.z.literal("commercial_auto"),
|
|
1310
|
+
vehicles: import_zod14.z.array(InsuredVehicleSchema),
|
|
1311
|
+
coveredAutoSymbols: import_zod14.z.array(import_zod14.z.number()).optional(),
|
|
1312
|
+
liabilityLimit: import_zod14.z.string().optional(),
|
|
1313
|
+
umLimit: import_zod14.z.string().optional(),
|
|
1314
|
+
uimLimit: import_zod14.z.string().optional(),
|
|
1315
|
+
hiredAutoLiability: import_zod14.z.boolean().optional(),
|
|
1316
|
+
nonOwnedAutoLiability: import_zod14.z.boolean().optional()
|
|
1265
1317
|
});
|
|
1266
|
-
var WorkersCompDeclarationsSchema =
|
|
1267
|
-
line:
|
|
1268
|
-
coveredStates:
|
|
1269
|
-
classifications:
|
|
1318
|
+
var WorkersCompDeclarationsSchema = import_zod14.z.object({
|
|
1319
|
+
line: import_zod14.z.literal("workers_comp"),
|
|
1320
|
+
coveredStates: import_zod14.z.array(import_zod14.z.string()).optional(),
|
|
1321
|
+
classifications: import_zod14.z.array(ClassificationCodeSchema),
|
|
1270
1322
|
experienceMod: ExperienceModSchema.optional(),
|
|
1271
1323
|
employersLiability: EmployersLiabilityLimitsSchema.optional()
|
|
1272
1324
|
});
|
|
1273
|
-
var UmbrellaExcessDeclarationsSchema =
|
|
1274
|
-
line:
|
|
1275
|
-
perOccurrenceLimit:
|
|
1276
|
-
aggregateLimit:
|
|
1277
|
-
retention:
|
|
1278
|
-
underlyingPolicies:
|
|
1279
|
-
carrier:
|
|
1280
|
-
policyNumber:
|
|
1281
|
-
policyType:
|
|
1282
|
-
limits:
|
|
1325
|
+
var UmbrellaExcessDeclarationsSchema = import_zod14.z.object({
|
|
1326
|
+
line: import_zod14.z.literal("umbrella_excess"),
|
|
1327
|
+
perOccurrenceLimit: import_zod14.z.string().optional(),
|
|
1328
|
+
aggregateLimit: import_zod14.z.string().optional(),
|
|
1329
|
+
retention: import_zod14.z.string().optional(),
|
|
1330
|
+
underlyingPolicies: import_zod14.z.array(import_zod14.z.object({
|
|
1331
|
+
carrier: import_zod14.z.string().optional(),
|
|
1332
|
+
policyNumber: import_zod14.z.string().optional(),
|
|
1333
|
+
policyType: import_zod14.z.string().optional(),
|
|
1334
|
+
limits: import_zod14.z.string().optional()
|
|
1283
1335
|
}))
|
|
1284
1336
|
});
|
|
1285
|
-
var ProfessionalLiabilityDeclarationsSchema =
|
|
1286
|
-
line:
|
|
1287
|
-
perClaimLimit:
|
|
1288
|
-
aggregateLimit:
|
|
1289
|
-
retroactiveDate:
|
|
1337
|
+
var ProfessionalLiabilityDeclarationsSchema = import_zod14.z.object({
|
|
1338
|
+
line: import_zod14.z.literal("professional_liability"),
|
|
1339
|
+
perClaimLimit: import_zod14.z.string().optional(),
|
|
1340
|
+
aggregateLimit: import_zod14.z.string().optional(),
|
|
1341
|
+
retroactiveDate: import_zod14.z.string().optional(),
|
|
1290
1342
|
defenseCostTreatment: DefenseCostTreatmentSchema.optional(),
|
|
1291
1343
|
extendedReportingPeriod: ExtendedReportingPeriodSchema.optional()
|
|
1292
1344
|
});
|
|
1293
|
-
var CyberDeclarationsSchema =
|
|
1294
|
-
line:
|
|
1295
|
-
aggregateLimit:
|
|
1296
|
-
retroactiveDate:
|
|
1297
|
-
waitingPeriodHours:
|
|
1298
|
-
sublimits:
|
|
1299
|
-
coverageName:
|
|
1300
|
-
limit:
|
|
1345
|
+
var CyberDeclarationsSchema = import_zod14.z.object({
|
|
1346
|
+
line: import_zod14.z.literal("cyber"),
|
|
1347
|
+
aggregateLimit: import_zod14.z.string().optional(),
|
|
1348
|
+
retroactiveDate: import_zod14.z.string().optional(),
|
|
1349
|
+
waitingPeriodHours: import_zod14.z.number().optional(),
|
|
1350
|
+
sublimits: import_zod14.z.array(import_zod14.z.object({
|
|
1351
|
+
coverageName: import_zod14.z.string(),
|
|
1352
|
+
limit: import_zod14.z.string()
|
|
1301
1353
|
})).optional()
|
|
1302
1354
|
});
|
|
1303
|
-
var DODeclarationsSchema =
|
|
1304
|
-
line:
|
|
1305
|
-
sideALimit:
|
|
1306
|
-
sideBLimit:
|
|
1307
|
-
sideCLimit:
|
|
1308
|
-
sideARetention:
|
|
1309
|
-
sideBRetention:
|
|
1310
|
-
sideCRetention:
|
|
1311
|
-
continuityDate:
|
|
1355
|
+
var DODeclarationsSchema = import_zod14.z.object({
|
|
1356
|
+
line: import_zod14.z.literal("directors_officers"),
|
|
1357
|
+
sideALimit: import_zod14.z.string().optional(),
|
|
1358
|
+
sideBLimit: import_zod14.z.string().optional(),
|
|
1359
|
+
sideCLimit: import_zod14.z.string().optional(),
|
|
1360
|
+
sideARetention: import_zod14.z.string().optional(),
|
|
1361
|
+
sideBRetention: import_zod14.z.string().optional(),
|
|
1362
|
+
sideCRetention: import_zod14.z.string().optional(),
|
|
1363
|
+
continuityDate: import_zod14.z.string().optional()
|
|
1312
1364
|
});
|
|
1313
|
-
var CrimeDeclarationsSchema =
|
|
1314
|
-
line:
|
|
1315
|
-
formType:
|
|
1316
|
-
agreements:
|
|
1317
|
-
agreement:
|
|
1318
|
-
coverageName:
|
|
1319
|
-
limit:
|
|
1320
|
-
deductible:
|
|
1365
|
+
var CrimeDeclarationsSchema = import_zod14.z.object({
|
|
1366
|
+
line: import_zod14.z.literal("crime"),
|
|
1367
|
+
formType: import_zod14.z.enum(["discovery", "loss_sustained"]).optional(),
|
|
1368
|
+
agreements: import_zod14.z.array(import_zod14.z.object({
|
|
1369
|
+
agreement: import_zod14.z.string(),
|
|
1370
|
+
coverageName: import_zod14.z.string(),
|
|
1371
|
+
limit: import_zod14.z.string(),
|
|
1372
|
+
deductible: import_zod14.z.string()
|
|
1321
1373
|
}))
|
|
1322
1374
|
});
|
|
1323
1375
|
|
|
1324
1376
|
// src/schemas/declarations/index.ts
|
|
1325
|
-
var DeclarationsSchema =
|
|
1377
|
+
var DeclarationsSchema = import_zod15.z.discriminatedUnion("line", [
|
|
1326
1378
|
// Personal lines
|
|
1327
1379
|
HomeownersDeclarationsSchema,
|
|
1328
1380
|
PersonalAutoDeclarationsSchema,
|
|
@@ -1351,137 +1403,137 @@ var DeclarationsSchema = import_zod14.z.discriminatedUnion("line", [
|
|
|
1351
1403
|
]);
|
|
1352
1404
|
|
|
1353
1405
|
// src/schemas/document.ts
|
|
1354
|
-
var
|
|
1355
|
-
var SubsectionSchema =
|
|
1356
|
-
title:
|
|
1357
|
-
sectionNumber:
|
|
1358
|
-
pageNumber:
|
|
1359
|
-
content:
|
|
1406
|
+
var import_zod16 = require("zod");
|
|
1407
|
+
var SubsectionSchema = import_zod16.z.object({
|
|
1408
|
+
title: import_zod16.z.string(),
|
|
1409
|
+
sectionNumber: import_zod16.z.string().optional(),
|
|
1410
|
+
pageNumber: import_zod16.z.number().optional(),
|
|
1411
|
+
content: import_zod16.z.string()
|
|
1360
1412
|
});
|
|
1361
|
-
var SectionSchema =
|
|
1362
|
-
title:
|
|
1363
|
-
sectionNumber:
|
|
1364
|
-
pageStart:
|
|
1365
|
-
pageEnd:
|
|
1366
|
-
type:
|
|
1367
|
-
coverageType:
|
|
1368
|
-
content:
|
|
1369
|
-
subsections:
|
|
1413
|
+
var SectionSchema = import_zod16.z.object({
|
|
1414
|
+
title: import_zod16.z.string(),
|
|
1415
|
+
sectionNumber: import_zod16.z.string().optional(),
|
|
1416
|
+
pageStart: import_zod16.z.number(),
|
|
1417
|
+
pageEnd: import_zod16.z.number().optional(),
|
|
1418
|
+
type: import_zod16.z.string(),
|
|
1419
|
+
coverageType: import_zod16.z.string().optional(),
|
|
1420
|
+
content: import_zod16.z.string(),
|
|
1421
|
+
subsections: import_zod16.z.array(SubsectionSchema).optional()
|
|
1370
1422
|
});
|
|
1371
|
-
var SubjectivitySchema =
|
|
1372
|
-
description:
|
|
1373
|
-
category:
|
|
1423
|
+
var SubjectivitySchema = import_zod16.z.object({
|
|
1424
|
+
description: import_zod16.z.string(),
|
|
1425
|
+
category: import_zod16.z.string().optional()
|
|
1374
1426
|
});
|
|
1375
|
-
var UnderwritingConditionSchema =
|
|
1376
|
-
description:
|
|
1427
|
+
var UnderwritingConditionSchema = import_zod16.z.object({
|
|
1428
|
+
description: import_zod16.z.string()
|
|
1377
1429
|
});
|
|
1378
|
-
var PremiumLineSchema =
|
|
1379
|
-
line:
|
|
1380
|
-
amount:
|
|
1430
|
+
var PremiumLineSchema = import_zod16.z.object({
|
|
1431
|
+
line: import_zod16.z.string(),
|
|
1432
|
+
amount: import_zod16.z.string()
|
|
1381
1433
|
});
|
|
1382
1434
|
var BaseDocumentFields = {
|
|
1383
|
-
id:
|
|
1384
|
-
carrier:
|
|
1385
|
-
security:
|
|
1386
|
-
insuredName:
|
|
1387
|
-
premium:
|
|
1388
|
-
summary:
|
|
1389
|
-
policyTypes:
|
|
1390
|
-
coverages:
|
|
1391
|
-
sections:
|
|
1435
|
+
id: import_zod16.z.string(),
|
|
1436
|
+
carrier: import_zod16.z.string(),
|
|
1437
|
+
security: import_zod16.z.string().optional(),
|
|
1438
|
+
insuredName: import_zod16.z.string(),
|
|
1439
|
+
premium: import_zod16.z.string().optional(),
|
|
1440
|
+
summary: import_zod16.z.string().optional(),
|
|
1441
|
+
policyTypes: import_zod16.z.array(import_zod16.z.string()).optional(),
|
|
1442
|
+
coverages: import_zod16.z.array(CoverageSchema),
|
|
1443
|
+
sections: import_zod16.z.array(SectionSchema).optional(),
|
|
1392
1444
|
// Enriched fields (v1.2+)
|
|
1393
|
-
carrierLegalName:
|
|
1394
|
-
carrierNaicNumber:
|
|
1395
|
-
carrierAmBestRating:
|
|
1396
|
-
carrierAdmittedStatus:
|
|
1397
|
-
mga:
|
|
1398
|
-
underwriter:
|
|
1399
|
-
brokerAgency:
|
|
1400
|
-
brokerContactName:
|
|
1401
|
-
brokerLicenseNumber:
|
|
1402
|
-
priorPolicyNumber:
|
|
1403
|
-
programName:
|
|
1404
|
-
isRenewal:
|
|
1405
|
-
isPackage:
|
|
1406
|
-
insuredDba:
|
|
1445
|
+
carrierLegalName: import_zod16.z.string().optional(),
|
|
1446
|
+
carrierNaicNumber: import_zod16.z.string().optional(),
|
|
1447
|
+
carrierAmBestRating: import_zod16.z.string().optional(),
|
|
1448
|
+
carrierAdmittedStatus: import_zod16.z.string().optional(),
|
|
1449
|
+
mga: import_zod16.z.string().optional(),
|
|
1450
|
+
underwriter: import_zod16.z.string().optional(),
|
|
1451
|
+
brokerAgency: import_zod16.z.string().optional(),
|
|
1452
|
+
brokerContactName: import_zod16.z.string().optional(),
|
|
1453
|
+
brokerLicenseNumber: import_zod16.z.string().optional(),
|
|
1454
|
+
priorPolicyNumber: import_zod16.z.string().optional(),
|
|
1455
|
+
programName: import_zod16.z.string().optional(),
|
|
1456
|
+
isRenewal: import_zod16.z.boolean().optional(),
|
|
1457
|
+
isPackage: import_zod16.z.boolean().optional(),
|
|
1458
|
+
insuredDba: import_zod16.z.string().optional(),
|
|
1407
1459
|
insuredAddress: AddressSchema.optional(),
|
|
1408
1460
|
insuredEntityType: EntityTypeSchema.optional(),
|
|
1409
|
-
additionalNamedInsureds:
|
|
1410
|
-
insuredSicCode:
|
|
1411
|
-
insuredNaicsCode:
|
|
1412
|
-
insuredFein:
|
|
1413
|
-
enrichedCoverages:
|
|
1414
|
-
endorsements:
|
|
1415
|
-
exclusions:
|
|
1416
|
-
conditions:
|
|
1461
|
+
additionalNamedInsureds: import_zod16.z.array(NamedInsuredSchema).optional(),
|
|
1462
|
+
insuredSicCode: import_zod16.z.string().optional(),
|
|
1463
|
+
insuredNaicsCode: import_zod16.z.string().optional(),
|
|
1464
|
+
insuredFein: import_zod16.z.string().optional(),
|
|
1465
|
+
enrichedCoverages: import_zod16.z.array(EnrichedCoverageSchema).optional(),
|
|
1466
|
+
endorsements: import_zod16.z.array(EndorsementSchema).optional(),
|
|
1467
|
+
exclusions: import_zod16.z.array(ExclusionSchema).optional(),
|
|
1468
|
+
conditions: import_zod16.z.array(PolicyConditionSchema).optional(),
|
|
1417
1469
|
limits: LimitScheduleSchema.optional(),
|
|
1418
1470
|
deductibles: DeductibleScheduleSchema.optional(),
|
|
1419
|
-
locations:
|
|
1420
|
-
vehicles:
|
|
1421
|
-
classifications:
|
|
1422
|
-
formInventory:
|
|
1471
|
+
locations: import_zod16.z.array(InsuredLocationSchema).optional(),
|
|
1472
|
+
vehicles: import_zod16.z.array(InsuredVehicleSchema).optional(),
|
|
1473
|
+
classifications: import_zod16.z.array(ClassificationCodeSchema).optional(),
|
|
1474
|
+
formInventory: import_zod16.z.array(FormReferenceSchema).optional(),
|
|
1423
1475
|
declarations: DeclarationsSchema.optional(),
|
|
1424
1476
|
coverageForm: CoverageFormSchema.optional(),
|
|
1425
|
-
retroactiveDate:
|
|
1477
|
+
retroactiveDate: import_zod16.z.string().optional(),
|
|
1426
1478
|
extendedReportingPeriod: ExtendedReportingPeriodSchema.optional(),
|
|
1427
1479
|
insurer: InsurerInfoSchema.optional(),
|
|
1428
1480
|
producer: ProducerInfoSchema.optional(),
|
|
1429
|
-
claimsContacts:
|
|
1430
|
-
regulatoryContacts:
|
|
1431
|
-
thirdPartyAdministrators:
|
|
1432
|
-
additionalInsureds:
|
|
1433
|
-
lossPayees:
|
|
1434
|
-
mortgageHolders:
|
|
1435
|
-
taxesAndFees:
|
|
1436
|
-
totalCost:
|
|
1437
|
-
minimumPremium:
|
|
1438
|
-
depositPremium:
|
|
1481
|
+
claimsContacts: import_zod16.z.array(ContactSchema).optional(),
|
|
1482
|
+
regulatoryContacts: import_zod16.z.array(ContactSchema).optional(),
|
|
1483
|
+
thirdPartyAdministrators: import_zod16.z.array(ContactSchema).optional(),
|
|
1484
|
+
additionalInsureds: import_zod16.z.array(EndorsementPartySchema).optional(),
|
|
1485
|
+
lossPayees: import_zod16.z.array(EndorsementPartySchema).optional(),
|
|
1486
|
+
mortgageHolders: import_zod16.z.array(EndorsementPartySchema).optional(),
|
|
1487
|
+
taxesAndFees: import_zod16.z.array(TaxFeeItemSchema).optional(),
|
|
1488
|
+
totalCost: import_zod16.z.string().optional(),
|
|
1489
|
+
minimumPremium: import_zod16.z.string().optional(),
|
|
1490
|
+
depositPremium: import_zod16.z.string().optional(),
|
|
1439
1491
|
paymentPlan: PaymentPlanSchema.optional(),
|
|
1440
1492
|
auditType: AuditTypeSchema.optional(),
|
|
1441
|
-
ratingBasis:
|
|
1442
|
-
premiumByLocation:
|
|
1493
|
+
ratingBasis: import_zod16.z.array(RatingBasisSchema).optional(),
|
|
1494
|
+
premiumByLocation: import_zod16.z.array(LocationPremiumSchema).optional(),
|
|
1443
1495
|
lossSummary: LossSummarySchema.optional(),
|
|
1444
|
-
individualClaims:
|
|
1496
|
+
individualClaims: import_zod16.z.array(ClaimRecordSchema).optional(),
|
|
1445
1497
|
experienceMod: ExperienceModSchema.optional(),
|
|
1446
|
-
cancellationNoticeDays:
|
|
1447
|
-
nonrenewalNoticeDays:
|
|
1498
|
+
cancellationNoticeDays: import_zod16.z.number().optional(),
|
|
1499
|
+
nonrenewalNoticeDays: import_zod16.z.number().optional()
|
|
1448
1500
|
};
|
|
1449
|
-
var PolicyDocumentSchema =
|
|
1501
|
+
var PolicyDocumentSchema = import_zod16.z.object({
|
|
1450
1502
|
...BaseDocumentFields,
|
|
1451
|
-
type:
|
|
1452
|
-
policyNumber:
|
|
1453
|
-
effectiveDate:
|
|
1454
|
-
expirationDate:
|
|
1503
|
+
type: import_zod16.z.literal("policy"),
|
|
1504
|
+
policyNumber: import_zod16.z.string(),
|
|
1505
|
+
effectiveDate: import_zod16.z.string(),
|
|
1506
|
+
expirationDate: import_zod16.z.string().optional(),
|
|
1455
1507
|
policyTermType: PolicyTermTypeSchema.optional(),
|
|
1456
|
-
nextReviewDate:
|
|
1457
|
-
effectiveTime:
|
|
1508
|
+
nextReviewDate: import_zod16.z.string().optional(),
|
|
1509
|
+
effectiveTime: import_zod16.z.string().optional()
|
|
1458
1510
|
});
|
|
1459
|
-
var QuoteDocumentSchema =
|
|
1511
|
+
var QuoteDocumentSchema = import_zod16.z.object({
|
|
1460
1512
|
...BaseDocumentFields,
|
|
1461
|
-
type:
|
|
1462
|
-
quoteNumber:
|
|
1463
|
-
proposedEffectiveDate:
|
|
1464
|
-
proposedExpirationDate:
|
|
1465
|
-
quoteExpirationDate:
|
|
1466
|
-
subjectivities:
|
|
1467
|
-
underwritingConditions:
|
|
1468
|
-
premiumBreakdown:
|
|
1513
|
+
type: import_zod16.z.literal("quote"),
|
|
1514
|
+
quoteNumber: import_zod16.z.string(),
|
|
1515
|
+
proposedEffectiveDate: import_zod16.z.string().optional(),
|
|
1516
|
+
proposedExpirationDate: import_zod16.z.string().optional(),
|
|
1517
|
+
quoteExpirationDate: import_zod16.z.string().optional(),
|
|
1518
|
+
subjectivities: import_zod16.z.array(SubjectivitySchema).optional(),
|
|
1519
|
+
underwritingConditions: import_zod16.z.array(UnderwritingConditionSchema).optional(),
|
|
1520
|
+
premiumBreakdown: import_zod16.z.array(PremiumLineSchema).optional(),
|
|
1469
1521
|
// Enriched quote fields (v1.2+)
|
|
1470
|
-
enrichedSubjectivities:
|
|
1471
|
-
enrichedUnderwritingConditions:
|
|
1472
|
-
warrantyRequirements:
|
|
1473
|
-
lossControlRecommendations:
|
|
1522
|
+
enrichedSubjectivities: import_zod16.z.array(EnrichedSubjectivitySchema).optional(),
|
|
1523
|
+
enrichedUnderwritingConditions: import_zod16.z.array(EnrichedUnderwritingConditionSchema).optional(),
|
|
1524
|
+
warrantyRequirements: import_zod16.z.array(import_zod16.z.string()).optional(),
|
|
1525
|
+
lossControlRecommendations: import_zod16.z.array(import_zod16.z.string()).optional(),
|
|
1474
1526
|
bindingAuthority: BindingAuthoritySchema.optional()
|
|
1475
1527
|
});
|
|
1476
|
-
var InsuranceDocumentSchema =
|
|
1528
|
+
var InsuranceDocumentSchema = import_zod16.z.discriminatedUnion("type", [
|
|
1477
1529
|
PolicyDocumentSchema,
|
|
1478
1530
|
QuoteDocumentSchema
|
|
1479
1531
|
]);
|
|
1480
1532
|
|
|
1481
1533
|
// src/schemas/platform.ts
|
|
1482
|
-
var
|
|
1483
|
-
var PlatformSchema =
|
|
1484
|
-
var CommunicationIntentSchema =
|
|
1534
|
+
var import_zod17 = require("zod");
|
|
1535
|
+
var PlatformSchema = import_zod17.z.enum(["email", "chat", "sms", "slack", "discord"]);
|
|
1536
|
+
var CommunicationIntentSchema = import_zod17.z.enum(["direct", "mediated", "observed"]);
|
|
1485
1537
|
var PLATFORM_CONFIGS = {
|
|
1486
1538
|
email: {
|
|
1487
1539
|
supportsMarkdown: false,
|
|
@@ -1701,10 +1753,11 @@ async function runExtractor(params) {
|
|
|
1701
1753
|
[Document pages ${startPage}-${endPage} are provided as images above.]` : `${prompt}
|
|
1702
1754
|
|
|
1703
1755
|
[Document pages ${startPage}-${endPage} are provided as a PDF file above.]`;
|
|
1756
|
+
const strictSchema = toStrictSchema(schema);
|
|
1704
1757
|
const result = await withRetry(
|
|
1705
1758
|
() => generateObject({
|
|
1706
1759
|
prompt: fullPrompt,
|
|
1707
|
-
schema,
|
|
1760
|
+
schema: strictSchema,
|
|
1708
1761
|
maxTokens,
|
|
1709
1762
|
providerOptions
|
|
1710
1763
|
})
|
|
@@ -2783,11 +2836,11 @@ function getTemplate(policyType) {
|
|
|
2783
2836
|
}
|
|
2784
2837
|
|
|
2785
2838
|
// src/prompts/coordinator/classify.ts
|
|
2786
|
-
var
|
|
2787
|
-
var ClassifyResultSchema =
|
|
2788
|
-
documentType:
|
|
2789
|
-
policyTypes:
|
|
2790
|
-
confidence:
|
|
2839
|
+
var import_zod18 = require("zod");
|
|
2840
|
+
var ClassifyResultSchema = import_zod18.z.object({
|
|
2841
|
+
documentType: import_zod18.z.enum(["policy", "quote"]),
|
|
2842
|
+
policyTypes: import_zod18.z.array(PolicyTypeSchema),
|
|
2843
|
+
confidence: import_zod18.z.number()
|
|
2791
2844
|
});
|
|
2792
2845
|
function buildClassifyPrompt() {
|
|
2793
2846
|
return `You are classifying an insurance document. Examine the first few pages and determine:
|
|
@@ -2811,20 +2864,20 @@ Respond with JSON only.`;
|
|
|
2811
2864
|
}
|
|
2812
2865
|
|
|
2813
2866
|
// src/prompts/coordinator/plan.ts
|
|
2814
|
-
var
|
|
2815
|
-
var ExtractionTaskSchema =
|
|
2816
|
-
extractorName:
|
|
2817
|
-
startPage:
|
|
2818
|
-
endPage:
|
|
2819
|
-
description:
|
|
2867
|
+
var import_zod19 = require("zod");
|
|
2868
|
+
var ExtractionTaskSchema = import_zod19.z.object({
|
|
2869
|
+
extractorName: import_zod19.z.string(),
|
|
2870
|
+
startPage: import_zod19.z.number(),
|
|
2871
|
+
endPage: import_zod19.z.number(),
|
|
2872
|
+
description: import_zod19.z.string()
|
|
2820
2873
|
});
|
|
2821
|
-
var PageMapEntrySchema =
|
|
2822
|
-
section:
|
|
2823
|
-
pages:
|
|
2874
|
+
var PageMapEntrySchema = import_zod19.z.object({
|
|
2875
|
+
section: import_zod19.z.string(),
|
|
2876
|
+
pages: import_zod19.z.string()
|
|
2824
2877
|
});
|
|
2825
|
-
var ExtractionPlanSchema =
|
|
2826
|
-
tasks:
|
|
2827
|
-
pageMap:
|
|
2878
|
+
var ExtractionPlanSchema = import_zod19.z.object({
|
|
2879
|
+
tasks: import_zod19.z.array(ExtractionTaskSchema),
|
|
2880
|
+
pageMap: import_zod19.z.array(PageMapEntrySchema).optional()
|
|
2828
2881
|
});
|
|
2829
2882
|
function buildPlanPrompt(templateHints) {
|
|
2830
2883
|
return `You are planning the extraction of an insurance document. You have already classified this document. Now scan the full document and create a page map + extraction plan.
|
|
@@ -2865,15 +2918,15 @@ Respond with JSON only.`;
|
|
|
2865
2918
|
}
|
|
2866
2919
|
|
|
2867
2920
|
// src/prompts/coordinator/review.ts
|
|
2868
|
-
var
|
|
2869
|
-
var ReviewResultSchema =
|
|
2870
|
-
complete:
|
|
2871
|
-
missingFields:
|
|
2872
|
-
additionalTasks:
|
|
2873
|
-
extractorName:
|
|
2874
|
-
startPage:
|
|
2875
|
-
endPage:
|
|
2876
|
-
description:
|
|
2921
|
+
var import_zod20 = require("zod");
|
|
2922
|
+
var ReviewResultSchema = import_zod20.z.object({
|
|
2923
|
+
complete: import_zod20.z.boolean(),
|
|
2924
|
+
missingFields: import_zod20.z.array(import_zod20.z.string()),
|
|
2925
|
+
additionalTasks: import_zod20.z.array(import_zod20.z.object({
|
|
2926
|
+
extractorName: import_zod20.z.string(),
|
|
2927
|
+
startPage: import_zod20.z.number(),
|
|
2928
|
+
endPage: import_zod20.z.number(),
|
|
2929
|
+
description: import_zod20.z.string()
|
|
2877
2930
|
}))
|
|
2878
2931
|
});
|
|
2879
2932
|
function buildReviewPrompt(templateExpected, extractedKeys) {
|
|
@@ -2905,20 +2958,20 @@ Respond with JSON only.`;
|
|
|
2905
2958
|
}
|
|
2906
2959
|
|
|
2907
2960
|
// src/prompts/extractors/carrier-info.ts
|
|
2908
|
-
var
|
|
2909
|
-
var CarrierInfoSchema =
|
|
2910
|
-
carrierName:
|
|
2911
|
-
carrierLegalName:
|
|
2912
|
-
naicNumber:
|
|
2913
|
-
amBestRating:
|
|
2914
|
-
admittedStatus:
|
|
2915
|
-
mga:
|
|
2916
|
-
underwriter:
|
|
2917
|
-
policyNumber:
|
|
2918
|
-
effectiveDate:
|
|
2919
|
-
expirationDate:
|
|
2920
|
-
quoteNumber:
|
|
2921
|
-
proposedEffectiveDate:
|
|
2961
|
+
var import_zod21 = require("zod");
|
|
2962
|
+
var CarrierInfoSchema = import_zod21.z.object({
|
|
2963
|
+
carrierName: import_zod21.z.string().describe("Primary insurance company name for display"),
|
|
2964
|
+
carrierLegalName: import_zod21.z.string().optional().describe("Legal entity name of insurer"),
|
|
2965
|
+
naicNumber: import_zod21.z.string().optional().describe("NAIC company code"),
|
|
2966
|
+
amBestRating: import_zod21.z.string().optional().describe("AM Best rating, e.g. 'A+ XV'"),
|
|
2967
|
+
admittedStatus: import_zod21.z.enum(["admitted", "non_admitted", "surplus_lines"]).optional().describe("Admitted status of the carrier"),
|
|
2968
|
+
mga: import_zod21.z.string().optional().describe("Managing General Agent or Program Administrator name"),
|
|
2969
|
+
underwriter: import_zod21.z.string().optional().describe("Named individual underwriter"),
|
|
2970
|
+
policyNumber: import_zod21.z.string().optional().describe("Policy or quote reference number"),
|
|
2971
|
+
effectiveDate: import_zod21.z.string().optional().describe("Policy effective date (MM/DD/YYYY)"),
|
|
2972
|
+
expirationDate: import_zod21.z.string().optional().describe("Policy expiration date (MM/DD/YYYY)"),
|
|
2973
|
+
quoteNumber: import_zod21.z.string().optional().describe("Quote or proposal reference number"),
|
|
2974
|
+
proposedEffectiveDate: import_zod21.z.string().optional().describe("Proposed effective date for quotes (MM/DD/YYYY)")
|
|
2922
2975
|
});
|
|
2923
2976
|
function buildCarrierInfoPrompt() {
|
|
2924
2977
|
return `You are an expert insurance document analyst. Extract carrier and policy identification information from this document.
|
|
@@ -2938,18 +2991,18 @@ Return JSON only.`;
|
|
|
2938
2991
|
}
|
|
2939
2992
|
|
|
2940
2993
|
// src/prompts/extractors/named-insured.ts
|
|
2941
|
-
var
|
|
2942
|
-
var AddressSchema2 =
|
|
2943
|
-
street1:
|
|
2944
|
-
city:
|
|
2945
|
-
state:
|
|
2946
|
-
zip:
|
|
2994
|
+
var import_zod22 = require("zod");
|
|
2995
|
+
var AddressSchema2 = import_zod22.z.object({
|
|
2996
|
+
street1: import_zod22.z.string(),
|
|
2997
|
+
city: import_zod22.z.string(),
|
|
2998
|
+
state: import_zod22.z.string(),
|
|
2999
|
+
zip: import_zod22.z.string()
|
|
2947
3000
|
});
|
|
2948
|
-
var NamedInsuredSchema2 =
|
|
2949
|
-
insuredName:
|
|
2950
|
-
insuredDba:
|
|
3001
|
+
var NamedInsuredSchema2 = import_zod22.z.object({
|
|
3002
|
+
insuredName: import_zod22.z.string().describe("Name of primary named insured"),
|
|
3003
|
+
insuredDba: import_zod22.z.string().optional().describe("Doing-business-as name"),
|
|
2951
3004
|
insuredAddress: AddressSchema2.optional().describe("Primary insured mailing address"),
|
|
2952
|
-
insuredEntityType:
|
|
3005
|
+
insuredEntityType: import_zod22.z.enum([
|
|
2953
3006
|
"corporation",
|
|
2954
3007
|
"llc",
|
|
2955
3008
|
"partnership",
|
|
@@ -2962,13 +3015,13 @@ var NamedInsuredSchema2 = import_zod21.z.object({
|
|
|
2962
3015
|
"married_couple",
|
|
2963
3016
|
"other"
|
|
2964
3017
|
]).optional().describe("Legal entity type of the insured"),
|
|
2965
|
-
insuredFein:
|
|
2966
|
-
insuredSicCode:
|
|
2967
|
-
insuredNaicsCode:
|
|
2968
|
-
additionalNamedInsureds:
|
|
2969
|
-
|
|
2970
|
-
name:
|
|
2971
|
-
relationship:
|
|
3018
|
+
insuredFein: import_zod22.z.string().optional().describe("Federal Employer Identification Number"),
|
|
3019
|
+
insuredSicCode: import_zod22.z.string().optional().describe("SIC code"),
|
|
3020
|
+
insuredNaicsCode: import_zod22.z.string().optional().describe("NAICS code"),
|
|
3021
|
+
additionalNamedInsureds: import_zod22.z.array(
|
|
3022
|
+
import_zod22.z.object({
|
|
3023
|
+
name: import_zod22.z.string(),
|
|
3024
|
+
relationship: import_zod22.z.string().optional().describe("e.g. subsidiary, affiliate"),
|
|
2972
3025
|
address: AddressSchema2.optional()
|
|
2973
3026
|
})
|
|
2974
3027
|
).optional().describe("Additional named insureds listed on the policy")
|
|
@@ -2989,19 +3042,19 @@ Return JSON only.`;
|
|
|
2989
3042
|
}
|
|
2990
3043
|
|
|
2991
3044
|
// src/prompts/extractors/coverage-limits.ts
|
|
2992
|
-
var
|
|
2993
|
-
var CoverageLimitsSchema =
|
|
2994
|
-
coverages:
|
|
2995
|
-
|
|
2996
|
-
name:
|
|
2997
|
-
limit:
|
|
2998
|
-
deductible:
|
|
2999
|
-
coverageCode:
|
|
3000
|
-
formNumber:
|
|
3045
|
+
var import_zod23 = require("zod");
|
|
3046
|
+
var CoverageLimitsSchema = import_zod23.z.object({
|
|
3047
|
+
coverages: import_zod23.z.array(
|
|
3048
|
+
import_zod23.z.object({
|
|
3049
|
+
name: import_zod23.z.string().describe("Coverage name"),
|
|
3050
|
+
limit: import_zod23.z.string().describe("Coverage limit, e.g. '$1,000,000'"),
|
|
3051
|
+
deductible: import_zod23.z.string().optional().describe("Deductible amount"),
|
|
3052
|
+
coverageCode: import_zod23.z.string().optional().describe("Coverage code or class code"),
|
|
3053
|
+
formNumber: import_zod23.z.string().optional().describe("Associated form number, e.g. 'CG 00 01'")
|
|
3001
3054
|
})
|
|
3002
3055
|
).describe("All coverages with their limits"),
|
|
3003
|
-
coverageForm:
|
|
3004
|
-
retroactiveDate:
|
|
3056
|
+
coverageForm: import_zod23.z.enum(["occurrence", "claims_made", "accident"]).optional().describe("Primary coverage trigger type"),
|
|
3057
|
+
retroactiveDate: import_zod23.z.string().optional().describe("Retroactive date for claims-made policies (MM/DD/YYYY)")
|
|
3005
3058
|
});
|
|
3006
3059
|
function buildCoverageLimitsPrompt() {
|
|
3007
3060
|
return `You are an expert insurance document analyst. Extract all coverage limits and deductibles from this document.
|
|
@@ -3022,17 +3075,17 @@ Return JSON only.`;
|
|
|
3022
3075
|
}
|
|
3023
3076
|
|
|
3024
3077
|
// src/prompts/extractors/endorsements.ts
|
|
3025
|
-
var
|
|
3026
|
-
var EndorsementsSchema =
|
|
3027
|
-
endorsements:
|
|
3028
|
-
|
|
3029
|
-
formNumber:
|
|
3030
|
-
title:
|
|
3031
|
-
type:
|
|
3032
|
-
content:
|
|
3033
|
-
effectiveDate:
|
|
3034
|
-
premium:
|
|
3035
|
-
parties:
|
|
3078
|
+
var import_zod24 = require("zod");
|
|
3079
|
+
var EndorsementsSchema = import_zod24.z.object({
|
|
3080
|
+
endorsements: import_zod24.z.array(
|
|
3081
|
+
import_zod24.z.object({
|
|
3082
|
+
formNumber: import_zod24.z.string().optional().describe("Form number, e.g. 'CG 21 47'"),
|
|
3083
|
+
title: import_zod24.z.string().optional().describe("Endorsement title"),
|
|
3084
|
+
type: import_zod24.z.enum(["broadening", "restrictive", "informational"]).optional().describe("Effect type: broadening adds coverage, restrictive limits it"),
|
|
3085
|
+
content: import_zod24.z.string().optional().describe("Full verbatim text of the endorsement"),
|
|
3086
|
+
effectiveDate: import_zod24.z.string().optional().describe("Endorsement effective date"),
|
|
3087
|
+
premium: import_zod24.z.string().optional().describe("Additional premium or credit"),
|
|
3088
|
+
parties: import_zod24.z.array(import_zod24.z.string()).optional().describe("Named parties (additional insureds, loss payees, etc.)")
|
|
3036
3089
|
})
|
|
3037
3090
|
).describe("All endorsements found in the document")
|
|
3038
3091
|
});
|
|
@@ -3058,14 +3111,14 @@ Return JSON only.`;
|
|
|
3058
3111
|
}
|
|
3059
3112
|
|
|
3060
3113
|
// src/prompts/extractors/exclusions.ts
|
|
3061
|
-
var
|
|
3062
|
-
var ExclusionsSchema =
|
|
3063
|
-
exclusions:
|
|
3064
|
-
|
|
3065
|
-
title:
|
|
3066
|
-
content:
|
|
3067
|
-
formNumber:
|
|
3068
|
-
appliesTo:
|
|
3114
|
+
var import_zod25 = require("zod");
|
|
3115
|
+
var ExclusionsSchema = import_zod25.z.object({
|
|
3116
|
+
exclusions: import_zod25.z.array(
|
|
3117
|
+
import_zod25.z.object({
|
|
3118
|
+
title: import_zod25.z.string().describe("Exclusion title or short description"),
|
|
3119
|
+
content: import_zod25.z.string().optional().describe("Full verbatim exclusion text"),
|
|
3120
|
+
formNumber: import_zod25.z.string().optional().describe("Form number if part of a named endorsement"),
|
|
3121
|
+
appliesTo: import_zod25.z.string().optional().describe("Coverage type this exclusion applies to")
|
|
3069
3122
|
})
|
|
3070
3123
|
).describe("All exclusions found in the document")
|
|
3071
3124
|
});
|
|
@@ -3086,11 +3139,11 @@ Return JSON only.`;
|
|
|
3086
3139
|
}
|
|
3087
3140
|
|
|
3088
3141
|
// src/prompts/extractors/conditions.ts
|
|
3089
|
-
var
|
|
3090
|
-
var ConditionsSchema =
|
|
3091
|
-
conditions:
|
|
3092
|
-
|
|
3093
|
-
type:
|
|
3142
|
+
var import_zod26 = require("zod");
|
|
3143
|
+
var ConditionsSchema = import_zod26.z.object({
|
|
3144
|
+
conditions: import_zod26.z.array(
|
|
3145
|
+
import_zod26.z.object({
|
|
3146
|
+
type: import_zod26.z.enum([
|
|
3094
3147
|
"duties_after_loss",
|
|
3095
3148
|
"cooperation",
|
|
3096
3149
|
"cancellation",
|
|
@@ -3104,9 +3157,9 @@ var ConditionsSchema = import_zod25.z.object({
|
|
|
3104
3157
|
"liberalization",
|
|
3105
3158
|
"other"
|
|
3106
3159
|
]).optional().describe("Condition category"),
|
|
3107
|
-
title:
|
|
3108
|
-
content:
|
|
3109
|
-
noticeDays:
|
|
3160
|
+
title: import_zod26.z.string().describe("Condition title"),
|
|
3161
|
+
content: import_zod26.z.string().optional().describe("Full verbatim condition text"),
|
|
3162
|
+
noticeDays: import_zod26.z.number().optional().describe("Notice period in days if specified (e.g. cancellation notice)")
|
|
3110
3163
|
})
|
|
3111
3164
|
).describe("All policy conditions found in the document")
|
|
3112
3165
|
});
|
|
@@ -3131,28 +3184,28 @@ Return JSON only.`;
|
|
|
3131
3184
|
}
|
|
3132
3185
|
|
|
3133
3186
|
// src/prompts/extractors/premium-breakdown.ts
|
|
3134
|
-
var
|
|
3135
|
-
var PremiumBreakdownSchema =
|
|
3136
|
-
premium:
|
|
3137
|
-
totalCost:
|
|
3138
|
-
premiumBreakdown:
|
|
3139
|
-
|
|
3140
|
-
line:
|
|
3141
|
-
amount:
|
|
3187
|
+
var import_zod27 = require("zod");
|
|
3188
|
+
var PremiumBreakdownSchema = import_zod27.z.object({
|
|
3189
|
+
premium: import_zod27.z.string().optional().describe("Total premium amount, e.g. '$5,000'"),
|
|
3190
|
+
totalCost: import_zod27.z.string().optional().describe("Total cost including taxes and fees, e.g. '$5,250'"),
|
|
3191
|
+
premiumBreakdown: import_zod27.z.array(
|
|
3192
|
+
import_zod27.z.object({
|
|
3193
|
+
line: import_zod27.z.string().describe("Coverage line name"),
|
|
3194
|
+
amount: import_zod27.z.string().describe("Premium amount for this line")
|
|
3142
3195
|
})
|
|
3143
3196
|
).optional().describe("Per-coverage-line premium breakdown"),
|
|
3144
|
-
taxesAndFees:
|
|
3145
|
-
|
|
3146
|
-
name:
|
|
3147
|
-
amount:
|
|
3148
|
-
type:
|
|
3197
|
+
taxesAndFees: import_zod27.z.array(
|
|
3198
|
+
import_zod27.z.object({
|
|
3199
|
+
name: import_zod27.z.string().describe("Fee or tax name"),
|
|
3200
|
+
amount: import_zod27.z.string().describe("Dollar amount"),
|
|
3201
|
+
type: import_zod27.z.enum(["tax", "fee", "surcharge", "assessment"]).optional().describe("Fee category")
|
|
3149
3202
|
})
|
|
3150
3203
|
).optional().describe("Taxes, fees, surcharges, and assessments"),
|
|
3151
|
-
minimumPremium:
|
|
3152
|
-
depositPremium:
|
|
3153
|
-
paymentPlan:
|
|
3154
|
-
auditType:
|
|
3155
|
-
ratingBasis:
|
|
3204
|
+
minimumPremium: import_zod27.z.string().optional().describe("Minimum premium if stated"),
|
|
3205
|
+
depositPremium: import_zod27.z.string().optional().describe("Deposit premium if stated"),
|
|
3206
|
+
paymentPlan: import_zod27.z.string().optional().describe("Payment plan description"),
|
|
3207
|
+
auditType: import_zod27.z.enum(["annual", "semi_annual", "quarterly", "monthly", "final", "self"]).optional().describe("Premium audit type"),
|
|
3208
|
+
ratingBasis: import_zod27.z.string().optional().describe("Rating basis, e.g. payroll, revenue, area, units")
|
|
3156
3209
|
});
|
|
3157
3210
|
function buildPremiumBreakdownPrompt() {
|
|
3158
3211
|
return `You are an expert insurance document analyst. Extract all premium and cost information from this document.
|
|
@@ -3172,14 +3225,14 @@ Return JSON only.`;
|
|
|
3172
3225
|
}
|
|
3173
3226
|
|
|
3174
3227
|
// src/prompts/extractors/declarations.ts
|
|
3175
|
-
var
|
|
3176
|
-
var DeclarationsFieldSchema =
|
|
3177
|
-
field:
|
|
3178
|
-
value:
|
|
3179
|
-
section:
|
|
3228
|
+
var import_zod28 = require("zod");
|
|
3229
|
+
var DeclarationsFieldSchema = import_zod28.z.object({
|
|
3230
|
+
field: import_zod28.z.string().describe("Descriptive field name (e.g. 'policyNumber', 'effectiveDate', 'coverageALimit')"),
|
|
3231
|
+
value: import_zod28.z.string().describe("Extracted value exactly as it appears in the document"),
|
|
3232
|
+
section: import_zod28.z.string().optional().describe("Section or grouping this field belongs to (e.g. 'Coverage Limits', 'Vehicle Schedule')")
|
|
3180
3233
|
});
|
|
3181
|
-
var DeclarationsExtractSchema =
|
|
3182
|
-
fields:
|
|
3234
|
+
var DeclarationsExtractSchema = import_zod28.z.object({
|
|
3235
|
+
fields: import_zod28.z.array(DeclarationsFieldSchema).describe("All declarations page fields extracted as key-value pairs. Structure varies by line of business.")
|
|
3183
3236
|
});
|
|
3184
3237
|
function buildDeclarationsPrompt() {
|
|
3185
3238
|
return `You are an expert insurance document analyst. Extract all declarations page data from this document into a flexible key-value structure.
|
|
@@ -3219,21 +3272,21 @@ Preserve original values exactly as they appear. Return JSON only.`;
|
|
|
3219
3272
|
}
|
|
3220
3273
|
|
|
3221
3274
|
// src/prompts/extractors/loss-history.ts
|
|
3222
|
-
var
|
|
3223
|
-
var LossHistorySchema =
|
|
3224
|
-
lossSummary:
|
|
3225
|
-
individualClaims:
|
|
3226
|
-
|
|
3227
|
-
date:
|
|
3228
|
-
type:
|
|
3229
|
-
description:
|
|
3230
|
-
amountPaid:
|
|
3231
|
-
amountReserved:
|
|
3232
|
-
status:
|
|
3233
|
-
claimNumber:
|
|
3275
|
+
var import_zod29 = require("zod");
|
|
3276
|
+
var LossHistorySchema = import_zod29.z.object({
|
|
3277
|
+
lossSummary: import_zod29.z.string().optional().describe("Summary of loss history, e.g. '3 claims in past 5 years totaling $125,000'"),
|
|
3278
|
+
individualClaims: import_zod29.z.array(
|
|
3279
|
+
import_zod29.z.object({
|
|
3280
|
+
date: import_zod29.z.string().optional().describe("Date of loss or claim"),
|
|
3281
|
+
type: import_zod29.z.string().optional().describe("Type of claim, e.g. 'property damage', 'bodily injury'"),
|
|
3282
|
+
description: import_zod29.z.string().optional().describe("Brief description of the claim"),
|
|
3283
|
+
amountPaid: import_zod29.z.string().optional().describe("Amount paid"),
|
|
3284
|
+
amountReserved: import_zod29.z.string().optional().describe("Amount reserved"),
|
|
3285
|
+
status: import_zod29.z.enum(["open", "closed", "reopened"]).optional().describe("Claim status"),
|
|
3286
|
+
claimNumber: import_zod29.z.string().optional().describe("Claim reference number")
|
|
3234
3287
|
})
|
|
3235
3288
|
).optional().describe("Individual claim records"),
|
|
3236
|
-
experienceMod:
|
|
3289
|
+
experienceMod: import_zod29.z.string().optional().describe("Experience modification factor for workers comp, e.g. '0.85'")
|
|
3237
3290
|
});
|
|
3238
3291
|
function buildLossHistoryPrompt() {
|
|
3239
3292
|
return `You are an expert insurance document analyst. Extract all loss history and claims information from this document.
|
|
@@ -3250,18 +3303,18 @@ Return JSON only.`;
|
|
|
3250
3303
|
}
|
|
3251
3304
|
|
|
3252
3305
|
// src/prompts/extractors/sections.ts
|
|
3253
|
-
var
|
|
3254
|
-
var SubsectionSchema2 =
|
|
3255
|
-
title:
|
|
3256
|
-
sectionNumber:
|
|
3257
|
-
pageNumber:
|
|
3258
|
-
content:
|
|
3306
|
+
var import_zod30 = require("zod");
|
|
3307
|
+
var SubsectionSchema2 = import_zod30.z.object({
|
|
3308
|
+
title: import_zod30.z.string().describe("Subsection title"),
|
|
3309
|
+
sectionNumber: import_zod30.z.string().optional().describe("Subsection number"),
|
|
3310
|
+
pageNumber: import_zod30.z.number().optional().describe("Page number"),
|
|
3311
|
+
content: import_zod30.z.string().describe("Full verbatim text")
|
|
3259
3312
|
});
|
|
3260
|
-
var SectionsSchema =
|
|
3261
|
-
sections:
|
|
3262
|
-
|
|
3263
|
-
title:
|
|
3264
|
-
type:
|
|
3313
|
+
var SectionsSchema = import_zod30.z.object({
|
|
3314
|
+
sections: import_zod30.z.array(
|
|
3315
|
+
import_zod30.z.object({
|
|
3316
|
+
title: import_zod30.z.string().describe("Section title"),
|
|
3317
|
+
type: import_zod30.z.enum([
|
|
3265
3318
|
"declarations",
|
|
3266
3319
|
"insuring_agreement",
|
|
3267
3320
|
"policy_form",
|
|
@@ -3275,10 +3328,10 @@ var SectionsSchema = import_zod29.z.object({
|
|
|
3275
3328
|
"regulatory",
|
|
3276
3329
|
"other"
|
|
3277
3330
|
]).describe("Section type classification"),
|
|
3278
|
-
content:
|
|
3279
|
-
pageStart:
|
|
3280
|
-
pageEnd:
|
|
3281
|
-
subsections:
|
|
3331
|
+
content: import_zod30.z.string().describe("Full verbatim text of the section"),
|
|
3332
|
+
pageStart: import_zod30.z.number().describe("Starting page number"),
|
|
3333
|
+
pageEnd: import_zod30.z.number().optional().describe("Ending page number"),
|
|
3334
|
+
subsections: import_zod30.z.array(SubsectionSchema2).optional().describe("Subsections within this section")
|
|
3282
3335
|
})
|
|
3283
3336
|
).describe("All document sections")
|
|
3284
3337
|
});
|
|
@@ -3302,20 +3355,20 @@ Return JSON only.`;
|
|
|
3302
3355
|
}
|
|
3303
3356
|
|
|
3304
3357
|
// src/prompts/extractors/supplementary.ts
|
|
3305
|
-
var
|
|
3306
|
-
var ContactSchema2 =
|
|
3307
|
-
name:
|
|
3308
|
-
phone:
|
|
3309
|
-
email:
|
|
3310
|
-
address:
|
|
3311
|
-
type:
|
|
3358
|
+
var import_zod31 = require("zod");
|
|
3359
|
+
var ContactSchema2 = import_zod31.z.object({
|
|
3360
|
+
name: import_zod31.z.string().optional().describe("Organization or person name"),
|
|
3361
|
+
phone: import_zod31.z.string().optional().describe("Phone number"),
|
|
3362
|
+
email: import_zod31.z.string().optional().describe("Email address"),
|
|
3363
|
+
address: import_zod31.z.string().optional().describe("Mailing address"),
|
|
3364
|
+
type: import_zod31.z.string().optional().describe("Contact type, e.g. 'State Department of Insurance'")
|
|
3312
3365
|
});
|
|
3313
|
-
var SupplementarySchema =
|
|
3314
|
-
regulatoryContacts:
|
|
3315
|
-
claimsContacts:
|
|
3316
|
-
thirdPartyAdministrators:
|
|
3317
|
-
cancellationNoticeDays:
|
|
3318
|
-
nonrenewalNoticeDays:
|
|
3366
|
+
var SupplementarySchema = import_zod31.z.object({
|
|
3367
|
+
regulatoryContacts: import_zod31.z.array(ContactSchema2).optional().describe("Regulatory body contacts (state department of insurance, ombudsman)"),
|
|
3368
|
+
claimsContacts: import_zod31.z.array(ContactSchema2).optional().describe("Claims reporting contacts and instructions"),
|
|
3369
|
+
thirdPartyAdministrators: import_zod31.z.array(ContactSchema2).optional().describe("Third-party administrators for claims handling"),
|
|
3370
|
+
cancellationNoticeDays: import_zod31.z.number().optional().describe("Required notice period for cancellation in days"),
|
|
3371
|
+
nonrenewalNoticeDays: import_zod31.z.number().optional().describe("Required notice period for nonrenewal in days")
|
|
3319
3372
|
});
|
|
3320
3373
|
function buildSupplementaryPrompt() {
|
|
3321
3374
|
return `You are an expert insurance document analyst. Extract supplementary and regulatory information from this document.
|
|
@@ -3817,8 +3870,8 @@ Respond with JSON only:
|
|
|
3817
3870
|
}`;
|
|
3818
3871
|
|
|
3819
3872
|
// src/schemas/application.ts
|
|
3820
|
-
var
|
|
3821
|
-
var FieldTypeSchema =
|
|
3873
|
+
var import_zod32 = require("zod");
|
|
3874
|
+
var FieldTypeSchema = import_zod32.z.enum([
|
|
3822
3875
|
"text",
|
|
3823
3876
|
"numeric",
|
|
3824
3877
|
"currency",
|
|
@@ -3827,100 +3880,100 @@ var FieldTypeSchema = import_zod31.z.enum([
|
|
|
3827
3880
|
"table",
|
|
3828
3881
|
"declaration"
|
|
3829
3882
|
]);
|
|
3830
|
-
var ApplicationFieldSchema =
|
|
3831
|
-
id:
|
|
3832
|
-
label:
|
|
3833
|
-
section:
|
|
3883
|
+
var ApplicationFieldSchema = import_zod32.z.object({
|
|
3884
|
+
id: import_zod32.z.string(),
|
|
3885
|
+
label: import_zod32.z.string(),
|
|
3886
|
+
section: import_zod32.z.string(),
|
|
3834
3887
|
fieldType: FieldTypeSchema,
|
|
3835
|
-
required:
|
|
3836
|
-
options:
|
|
3837
|
-
columns:
|
|
3838
|
-
requiresExplanationIfYes:
|
|
3839
|
-
condition:
|
|
3840
|
-
dependsOn:
|
|
3841
|
-
whenValue:
|
|
3888
|
+
required: import_zod32.z.boolean(),
|
|
3889
|
+
options: import_zod32.z.array(import_zod32.z.string()).optional(),
|
|
3890
|
+
columns: import_zod32.z.array(import_zod32.z.string()).optional(),
|
|
3891
|
+
requiresExplanationIfYes: import_zod32.z.boolean().optional(),
|
|
3892
|
+
condition: import_zod32.z.object({
|
|
3893
|
+
dependsOn: import_zod32.z.string(),
|
|
3894
|
+
whenValue: import_zod32.z.string()
|
|
3842
3895
|
}).optional(),
|
|
3843
|
-
value:
|
|
3844
|
-
source:
|
|
3845
|
-
confidence:
|
|
3896
|
+
value: import_zod32.z.string().optional(),
|
|
3897
|
+
source: import_zod32.z.string().optional().describe("Where the value came from: auto-fill, user, lookup"),
|
|
3898
|
+
confidence: import_zod32.z.enum(["confirmed", "high", "medium", "low"]).optional()
|
|
3846
3899
|
});
|
|
3847
|
-
var ApplicationClassifyResultSchema =
|
|
3848
|
-
isApplication:
|
|
3849
|
-
confidence:
|
|
3850
|
-
applicationType:
|
|
3900
|
+
var ApplicationClassifyResultSchema = import_zod32.z.object({
|
|
3901
|
+
isApplication: import_zod32.z.boolean(),
|
|
3902
|
+
confidence: import_zod32.z.number().min(0).max(1),
|
|
3903
|
+
applicationType: import_zod32.z.string().nullable()
|
|
3851
3904
|
});
|
|
3852
|
-
var FieldExtractionResultSchema =
|
|
3853
|
-
fields:
|
|
3905
|
+
var FieldExtractionResultSchema = import_zod32.z.object({
|
|
3906
|
+
fields: import_zod32.z.array(ApplicationFieldSchema)
|
|
3854
3907
|
});
|
|
3855
|
-
var AutoFillMatchSchema =
|
|
3856
|
-
fieldId:
|
|
3857
|
-
value:
|
|
3858
|
-
confidence:
|
|
3859
|
-
contextKey:
|
|
3908
|
+
var AutoFillMatchSchema = import_zod32.z.object({
|
|
3909
|
+
fieldId: import_zod32.z.string(),
|
|
3910
|
+
value: import_zod32.z.string(),
|
|
3911
|
+
confidence: import_zod32.z.enum(["confirmed"]),
|
|
3912
|
+
contextKey: import_zod32.z.string()
|
|
3860
3913
|
});
|
|
3861
|
-
var AutoFillResultSchema =
|
|
3862
|
-
matches:
|
|
3914
|
+
var AutoFillResultSchema = import_zod32.z.object({
|
|
3915
|
+
matches: import_zod32.z.array(AutoFillMatchSchema)
|
|
3863
3916
|
});
|
|
3864
|
-
var QuestionBatchResultSchema =
|
|
3865
|
-
batches:
|
|
3917
|
+
var QuestionBatchResultSchema = import_zod32.z.object({
|
|
3918
|
+
batches: import_zod32.z.array(import_zod32.z.array(import_zod32.z.string()).describe("Array of field IDs in this batch"))
|
|
3866
3919
|
});
|
|
3867
|
-
var LookupRequestSchema =
|
|
3868
|
-
type:
|
|
3869
|
-
description:
|
|
3870
|
-
url:
|
|
3871
|
-
targetFieldIds:
|
|
3920
|
+
var LookupRequestSchema = import_zod32.z.object({
|
|
3921
|
+
type: import_zod32.z.string().describe("Type of lookup: 'records', 'website', 'policy'"),
|
|
3922
|
+
description: import_zod32.z.string(),
|
|
3923
|
+
url: import_zod32.z.string().optional(),
|
|
3924
|
+
targetFieldIds: import_zod32.z.array(import_zod32.z.string())
|
|
3872
3925
|
});
|
|
3873
|
-
var ReplyIntentSchema =
|
|
3874
|
-
primaryIntent:
|
|
3875
|
-
hasAnswers:
|
|
3876
|
-
questionText:
|
|
3877
|
-
questionFieldIds:
|
|
3878
|
-
lookupRequests:
|
|
3926
|
+
var ReplyIntentSchema = import_zod32.z.object({
|
|
3927
|
+
primaryIntent: import_zod32.z.enum(["answers_only", "question", "lookup_request", "mixed"]),
|
|
3928
|
+
hasAnswers: import_zod32.z.boolean(),
|
|
3929
|
+
questionText: import_zod32.z.string().optional(),
|
|
3930
|
+
questionFieldIds: import_zod32.z.array(import_zod32.z.string()).optional(),
|
|
3931
|
+
lookupRequests: import_zod32.z.array(LookupRequestSchema).optional()
|
|
3879
3932
|
});
|
|
3880
|
-
var ParsedAnswerSchema =
|
|
3881
|
-
fieldId:
|
|
3882
|
-
value:
|
|
3883
|
-
explanation:
|
|
3933
|
+
var ParsedAnswerSchema = import_zod32.z.object({
|
|
3934
|
+
fieldId: import_zod32.z.string(),
|
|
3935
|
+
value: import_zod32.z.string(),
|
|
3936
|
+
explanation: import_zod32.z.string().optional()
|
|
3884
3937
|
});
|
|
3885
|
-
var AnswerParsingResultSchema =
|
|
3886
|
-
answers:
|
|
3887
|
-
unanswered:
|
|
3938
|
+
var AnswerParsingResultSchema = import_zod32.z.object({
|
|
3939
|
+
answers: import_zod32.z.array(ParsedAnswerSchema),
|
|
3940
|
+
unanswered: import_zod32.z.array(import_zod32.z.string()).describe("Field IDs that were not answered")
|
|
3888
3941
|
});
|
|
3889
|
-
var LookupFillSchema =
|
|
3890
|
-
fieldId:
|
|
3891
|
-
value:
|
|
3892
|
-
source:
|
|
3942
|
+
var LookupFillSchema = import_zod32.z.object({
|
|
3943
|
+
fieldId: import_zod32.z.string(),
|
|
3944
|
+
value: import_zod32.z.string(),
|
|
3945
|
+
source: import_zod32.z.string().describe("Specific citable reference, e.g. 'GL Policy #POL-12345 (Hartford)'")
|
|
3893
3946
|
});
|
|
3894
|
-
var LookupFillResultSchema =
|
|
3895
|
-
fills:
|
|
3896
|
-
unfillable:
|
|
3897
|
-
explanation:
|
|
3947
|
+
var LookupFillResultSchema = import_zod32.z.object({
|
|
3948
|
+
fills: import_zod32.z.array(LookupFillSchema),
|
|
3949
|
+
unfillable: import_zod32.z.array(import_zod32.z.string()),
|
|
3950
|
+
explanation: import_zod32.z.string().optional()
|
|
3898
3951
|
});
|
|
3899
|
-
var FlatPdfPlacementSchema =
|
|
3900
|
-
fieldId:
|
|
3901
|
-
page:
|
|
3902
|
-
x:
|
|
3903
|
-
y:
|
|
3904
|
-
text:
|
|
3905
|
-
fontSize:
|
|
3906
|
-
isCheckmark:
|
|
3952
|
+
var FlatPdfPlacementSchema = import_zod32.z.object({
|
|
3953
|
+
fieldId: import_zod32.z.string(),
|
|
3954
|
+
page: import_zod32.z.number(),
|
|
3955
|
+
x: import_zod32.z.number().describe("Percentage from left edge (0-100)"),
|
|
3956
|
+
y: import_zod32.z.number().describe("Percentage from top edge (0-100)"),
|
|
3957
|
+
text: import_zod32.z.string(),
|
|
3958
|
+
fontSize: import_zod32.z.number().optional(),
|
|
3959
|
+
isCheckmark: import_zod32.z.boolean().optional()
|
|
3907
3960
|
});
|
|
3908
|
-
var AcroFormMappingSchema =
|
|
3909
|
-
fieldId:
|
|
3910
|
-
acroFormName:
|
|
3911
|
-
value:
|
|
3961
|
+
var AcroFormMappingSchema = import_zod32.z.object({
|
|
3962
|
+
fieldId: import_zod32.z.string(),
|
|
3963
|
+
acroFormName: import_zod32.z.string(),
|
|
3964
|
+
value: import_zod32.z.string()
|
|
3912
3965
|
});
|
|
3913
|
-
var ApplicationStateSchema =
|
|
3914
|
-
id:
|
|
3915
|
-
pdfBase64:
|
|
3916
|
-
title:
|
|
3917
|
-
applicationType:
|
|
3918
|
-
fields:
|
|
3919
|
-
batches:
|
|
3920
|
-
currentBatchIndex:
|
|
3921
|
-
status:
|
|
3922
|
-
createdAt:
|
|
3923
|
-
updatedAt:
|
|
3966
|
+
var ApplicationStateSchema = import_zod32.z.object({
|
|
3967
|
+
id: import_zod32.z.string(),
|
|
3968
|
+
pdfBase64: import_zod32.z.string().optional().describe("Original PDF, omitted after extraction"),
|
|
3969
|
+
title: import_zod32.z.string().optional(),
|
|
3970
|
+
applicationType: import_zod32.z.string().nullable().optional(),
|
|
3971
|
+
fields: import_zod32.z.array(ApplicationFieldSchema),
|
|
3972
|
+
batches: import_zod32.z.array(import_zod32.z.array(import_zod32.z.string())).optional(),
|
|
3973
|
+
currentBatchIndex: import_zod32.z.number().default(0),
|
|
3974
|
+
status: import_zod32.z.enum(["classifying", "extracting", "auto_filling", "batching", "collecting", "confirming", "mapping", "complete"]),
|
|
3975
|
+
createdAt: import_zod32.z.number(),
|
|
3976
|
+
updatedAt: import_zod32.z.number()
|
|
3924
3977
|
});
|
|
3925
3978
|
|
|
3926
3979
|
// src/application/agents/classifier.ts
|
|
@@ -4948,73 +5001,73 @@ Respond with the final answer, deduplicated citations array, overall confidence
|
|
|
4948
5001
|
}
|
|
4949
5002
|
|
|
4950
5003
|
// src/schemas/query.ts
|
|
4951
|
-
var
|
|
4952
|
-
var QueryIntentSchema =
|
|
5004
|
+
var import_zod33 = require("zod");
|
|
5005
|
+
var QueryIntentSchema = import_zod33.z.enum([
|
|
4953
5006
|
"policy_question",
|
|
4954
5007
|
"coverage_comparison",
|
|
4955
5008
|
"document_search",
|
|
4956
5009
|
"claims_inquiry",
|
|
4957
5010
|
"general_knowledge"
|
|
4958
5011
|
]);
|
|
4959
|
-
var SubQuestionSchema =
|
|
4960
|
-
question:
|
|
5012
|
+
var SubQuestionSchema = import_zod33.z.object({
|
|
5013
|
+
question: import_zod33.z.string().describe("Atomic sub-question to retrieve and answer independently"),
|
|
4961
5014
|
intent: QueryIntentSchema,
|
|
4962
|
-
chunkTypes:
|
|
4963
|
-
documentFilters:
|
|
4964
|
-
type:
|
|
4965
|
-
carrier:
|
|
4966
|
-
insuredName:
|
|
4967
|
-
policyNumber:
|
|
4968
|
-
quoteNumber:
|
|
5015
|
+
chunkTypes: import_zod33.z.array(import_zod33.z.string()).optional().describe("Chunk types to filter retrieval (e.g. coverage, endorsement, declaration)"),
|
|
5016
|
+
documentFilters: import_zod33.z.object({
|
|
5017
|
+
type: import_zod33.z.enum(["policy", "quote"]).optional(),
|
|
5018
|
+
carrier: import_zod33.z.string().optional(),
|
|
5019
|
+
insuredName: import_zod33.z.string().optional(),
|
|
5020
|
+
policyNumber: import_zod33.z.string().optional(),
|
|
5021
|
+
quoteNumber: import_zod33.z.string().optional()
|
|
4969
5022
|
}).optional().describe("Structured filters to narrow document lookup")
|
|
4970
5023
|
});
|
|
4971
|
-
var QueryClassifyResultSchema =
|
|
5024
|
+
var QueryClassifyResultSchema = import_zod33.z.object({
|
|
4972
5025
|
intent: QueryIntentSchema,
|
|
4973
|
-
subQuestions:
|
|
4974
|
-
requiresDocumentLookup:
|
|
4975
|
-
requiresChunkSearch:
|
|
4976
|
-
requiresConversationHistory:
|
|
5026
|
+
subQuestions: import_zod33.z.array(SubQuestionSchema).min(1).describe("Decomposed atomic sub-questions"),
|
|
5027
|
+
requiresDocumentLookup: import_zod33.z.boolean().describe("Whether structured document lookup is needed"),
|
|
5028
|
+
requiresChunkSearch: import_zod33.z.boolean().describe("Whether semantic chunk search is needed"),
|
|
5029
|
+
requiresConversationHistory: import_zod33.z.boolean().describe("Whether conversation history is relevant")
|
|
4977
5030
|
});
|
|
4978
|
-
var EvidenceItemSchema =
|
|
4979
|
-
source:
|
|
4980
|
-
chunkId:
|
|
4981
|
-
documentId:
|
|
4982
|
-
turnId:
|
|
4983
|
-
text:
|
|
4984
|
-
relevance:
|
|
4985
|
-
metadata:
|
|
5031
|
+
var EvidenceItemSchema = import_zod33.z.object({
|
|
5032
|
+
source: import_zod33.z.enum(["chunk", "document", "conversation"]),
|
|
5033
|
+
chunkId: import_zod33.z.string().optional(),
|
|
5034
|
+
documentId: import_zod33.z.string().optional(),
|
|
5035
|
+
turnId: import_zod33.z.string().optional(),
|
|
5036
|
+
text: import_zod33.z.string().describe("Text excerpt from the source"),
|
|
5037
|
+
relevance: import_zod33.z.number().min(0).max(1),
|
|
5038
|
+
metadata: import_zod33.z.array(import_zod33.z.object({ key: import_zod33.z.string(), value: import_zod33.z.string() })).optional()
|
|
4986
5039
|
});
|
|
4987
|
-
var RetrievalResultSchema =
|
|
4988
|
-
subQuestion:
|
|
4989
|
-
evidence:
|
|
5040
|
+
var RetrievalResultSchema = import_zod33.z.object({
|
|
5041
|
+
subQuestion: import_zod33.z.string(),
|
|
5042
|
+
evidence: import_zod33.z.array(EvidenceItemSchema)
|
|
4990
5043
|
});
|
|
4991
|
-
var CitationSchema =
|
|
4992
|
-
index:
|
|
4993
|
-
chunkId:
|
|
4994
|
-
documentId:
|
|
4995
|
-
documentType:
|
|
4996
|
-
field:
|
|
4997
|
-
quote:
|
|
4998
|
-
relevance:
|
|
5044
|
+
var CitationSchema = import_zod33.z.object({
|
|
5045
|
+
index: import_zod33.z.number().describe("Citation number [1], [2], etc."),
|
|
5046
|
+
chunkId: import_zod33.z.string().describe("Source chunk ID, e.g. doc-123:coverage:2"),
|
|
5047
|
+
documentId: import_zod33.z.string(),
|
|
5048
|
+
documentType: import_zod33.z.enum(["policy", "quote"]).optional(),
|
|
5049
|
+
field: import_zod33.z.string().optional().describe("Specific field path, e.g. coverages[0].deductible"),
|
|
5050
|
+
quote: import_zod33.z.string().describe("Exact text from source that supports the claim"),
|
|
5051
|
+
relevance: import_zod33.z.number().min(0).max(1)
|
|
4999
5052
|
});
|
|
5000
|
-
var SubAnswerSchema =
|
|
5001
|
-
subQuestion:
|
|
5002
|
-
answer:
|
|
5003
|
-
citations:
|
|
5004
|
-
confidence:
|
|
5005
|
-
needsMoreContext:
|
|
5053
|
+
var SubAnswerSchema = import_zod33.z.object({
|
|
5054
|
+
subQuestion: import_zod33.z.string(),
|
|
5055
|
+
answer: import_zod33.z.string(),
|
|
5056
|
+
citations: import_zod33.z.array(CitationSchema),
|
|
5057
|
+
confidence: import_zod33.z.number().min(0).max(1),
|
|
5058
|
+
needsMoreContext: import_zod33.z.boolean().describe("True if evidence was insufficient to answer fully")
|
|
5006
5059
|
});
|
|
5007
|
-
var VerifyResultSchema =
|
|
5008
|
-
approved:
|
|
5009
|
-
issues:
|
|
5010
|
-
retrySubQuestions:
|
|
5060
|
+
var VerifyResultSchema = import_zod33.z.object({
|
|
5061
|
+
approved: import_zod33.z.boolean().describe("Whether all sub-answers are adequately grounded"),
|
|
5062
|
+
issues: import_zod33.z.array(import_zod33.z.string()).describe("Specific grounding or consistency issues found"),
|
|
5063
|
+
retrySubQuestions: import_zod33.z.array(import_zod33.z.string()).optional().describe("Sub-questions that need additional retrieval or re-reasoning")
|
|
5011
5064
|
});
|
|
5012
|
-
var QueryResultSchema =
|
|
5013
|
-
answer:
|
|
5014
|
-
citations:
|
|
5065
|
+
var QueryResultSchema = import_zod33.z.object({
|
|
5066
|
+
answer: import_zod33.z.string(),
|
|
5067
|
+
citations: import_zod33.z.array(CitationSchema),
|
|
5015
5068
|
intent: QueryIntentSchema,
|
|
5016
|
-
confidence:
|
|
5017
|
-
followUp:
|
|
5069
|
+
confidence: import_zod33.z.number().min(0).max(1),
|
|
5070
|
+
followUp: import_zod33.z.string().optional().describe("Suggested follow-up question if applicable")
|
|
5018
5071
|
});
|
|
5019
5072
|
|
|
5020
5073
|
// src/query/retriever.ts
|
|
@@ -5896,6 +5949,7 @@ var AGENT_TOOLS = [
|
|
|
5896
5949
|
safeGenerateObject,
|
|
5897
5950
|
sanitizeNulls,
|
|
5898
5951
|
stripFences,
|
|
5952
|
+
toStrictSchema,
|
|
5899
5953
|
withRetry
|
|
5900
5954
|
});
|
|
5901
5955
|
//# sourceMappingURL=index.js.map
|