@claritylabs/cl-sdk 3.2.13 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -14
- package/dist/application.d.mts +1 -1
- package/dist/application.d.ts +1 -1
- package/dist/application.js +461 -402
- package/dist/application.js.map +1 -1
- package/dist/application.mjs +461 -402
- package/dist/application.mjs.map +1 -1
- package/dist/{index-WjheX6Dt.d.mts → index-BzrY6OMD.d.mts} +584 -261
- package/dist/{index-WjheX6Dt.d.ts → index-BzrY6OMD.d.ts} +584 -261
- package/dist/index.d.mts +103 -94
- package/dist/index.d.ts +103 -94
- package/dist/index.js +2281 -1800
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2266 -1795
- package/dist/index.mjs.map +1 -1
- package/dist/storage-sqlite.d.mts +188 -188
- package/dist/storage-sqlite.d.ts +188 -188
- package/dist/storage-sqlite.js +461 -402
- package/dist/storage-sqlite.js.map +1 -1
- package/dist/storage-sqlite.mjs +461 -402
- package/dist/storage-sqlite.mjs.map +1 -1
- package/package.json +1 -1
package/dist/storage-sqlite.mjs
CHANGED
|
@@ -262,8 +262,291 @@ function createSqliteMemoryStore(db, embed) {
|
|
|
262
262
|
}
|
|
263
263
|
|
|
264
264
|
// src/source/schemas.ts
|
|
265
|
+
import { z as z2 } from "zod";
|
|
266
|
+
|
|
267
|
+
// src/schemas/lines-of-business.ts
|
|
265
268
|
import { z } from "zod";
|
|
266
|
-
var
|
|
269
|
+
var ACORD_LOB_CODES = [
|
|
270
|
+
"AAPPL",
|
|
271
|
+
"AGLIA",
|
|
272
|
+
"AGPP",
|
|
273
|
+
"AGPR",
|
|
274
|
+
"AIRC",
|
|
275
|
+
"AIRPFB",
|
|
276
|
+
"APKG",
|
|
277
|
+
"APKGE",
|
|
278
|
+
"APROD",
|
|
279
|
+
"ARVP",
|
|
280
|
+
"AUTO",
|
|
281
|
+
"AUTOB",
|
|
282
|
+
"AUTOP",
|
|
283
|
+
"AVPKG",
|
|
284
|
+
"BANDM",
|
|
285
|
+
"BLANK",
|
|
286
|
+
"BMISC",
|
|
287
|
+
"BOAT",
|
|
288
|
+
"BOP",
|
|
289
|
+
"BOPGL",
|
|
290
|
+
"BOPPR",
|
|
291
|
+
"CAVN",
|
|
292
|
+
"CEQFL",
|
|
293
|
+
"CFIRE",
|
|
294
|
+
"CFRM",
|
|
295
|
+
"CGL",
|
|
296
|
+
"COMAR",
|
|
297
|
+
"COMR",
|
|
298
|
+
"CONTR",
|
|
299
|
+
"CPKGE",
|
|
300
|
+
"CPMP",
|
|
301
|
+
"CRIME",
|
|
302
|
+
"DFIRE",
|
|
303
|
+
"DISAB",
|
|
304
|
+
"DO",
|
|
305
|
+
"EDP",
|
|
306
|
+
"EL",
|
|
307
|
+
"EO",
|
|
308
|
+
"EPLI",
|
|
309
|
+
"EQ",
|
|
310
|
+
"EQPFL",
|
|
311
|
+
"EXLIA",
|
|
312
|
+
"FIDTY",
|
|
313
|
+
"FIDUC",
|
|
314
|
+
"FINEA",
|
|
315
|
+
"FLOOD",
|
|
316
|
+
"GARAG",
|
|
317
|
+
"GL",
|
|
318
|
+
"GLASS",
|
|
319
|
+
"HANG",
|
|
320
|
+
"HBB",
|
|
321
|
+
"HOME",
|
|
322
|
+
"INBR",
|
|
323
|
+
"INMAR",
|
|
324
|
+
"INMRC",
|
|
325
|
+
"INMRP",
|
|
326
|
+
"JUDCL",
|
|
327
|
+
"KIDRA",
|
|
328
|
+
"LL",
|
|
329
|
+
"MHOME",
|
|
330
|
+
"MMAL",
|
|
331
|
+
"Motorcycle",
|
|
332
|
+
"MTRTK",
|
|
333
|
+
"OLIB",
|
|
334
|
+
"PHYS",
|
|
335
|
+
"PKG",
|
|
336
|
+
"PL",
|
|
337
|
+
"PLMSC",
|
|
338
|
+
"PPKGE",
|
|
339
|
+
"PROP",
|
|
340
|
+
"PROPC",
|
|
341
|
+
"PUBOF",
|
|
342
|
+
"RECV",
|
|
343
|
+
"SCHPR",
|
|
344
|
+
"SIGNS",
|
|
345
|
+
"SMP",
|
|
346
|
+
"SURE",
|
|
347
|
+
"TRANS",
|
|
348
|
+
"TRUCK",
|
|
349
|
+
"UMBRC",
|
|
350
|
+
"UMBRL",
|
|
351
|
+
"UMBRP",
|
|
352
|
+
"UN",
|
|
353
|
+
"WCMA",
|
|
354
|
+
"WIND",
|
|
355
|
+
"WORK",
|
|
356
|
+
"WORKP",
|
|
357
|
+
"WORKV"
|
|
358
|
+
];
|
|
359
|
+
var AcordLobCodeSchema = z.enum(ACORD_LOB_CODES);
|
|
360
|
+
var ACORD_LOB_LABELS = {
|
|
361
|
+
AAPPL: "Aircraft / Aerial Applicator",
|
|
362
|
+
AGLIA: "Agricultural Liability",
|
|
363
|
+
AGPP: "Agricultural Personal Property",
|
|
364
|
+
AGPR: "Agricultural Property",
|
|
365
|
+
AIRC: "Aircraft",
|
|
366
|
+
AIRPFB: "Airport / Fixed Base Operator",
|
|
367
|
+
APKG: "Agricultural Package",
|
|
368
|
+
APKGE: "Agricultural Package (Extended)",
|
|
369
|
+
APROD: "Agricultural Products",
|
|
370
|
+
ARVP: "Recreational Vehicle Package",
|
|
371
|
+
AUTO: "Automobile",
|
|
372
|
+
AUTOB: "Business Auto",
|
|
373
|
+
AUTOP: "Personal Auto",
|
|
374
|
+
AVPKG: "Aviation Package",
|
|
375
|
+
BANDM: "Boiler & Machinery",
|
|
376
|
+
BLANK: "Blanket",
|
|
377
|
+
BMISC: "Business Miscellaneous",
|
|
378
|
+
BOAT: "Boat",
|
|
379
|
+
BOP: "Businessowners Policy",
|
|
380
|
+
BOPGL: "BOP - General Liability",
|
|
381
|
+
BOPPR: "BOP - Property",
|
|
382
|
+
CAVN: "Commercial Aviation",
|
|
383
|
+
CEQFL: "Contractors Equipment Floater",
|
|
384
|
+
CFIRE: "Commercial Fire",
|
|
385
|
+
CFRM: "Commercial Farm",
|
|
386
|
+
CGL: "Commercial General Liability",
|
|
387
|
+
COMAR: "Commercial Marine / Ocean Marine",
|
|
388
|
+
COMR: "Commercial (misc.)",
|
|
389
|
+
CONTR: "Contractors",
|
|
390
|
+
CPKGE: "Commercial Package",
|
|
391
|
+
CPMP: "Commercial Package (multi-peril)",
|
|
392
|
+
CRIME: "Crime",
|
|
393
|
+
DFIRE: "Dwelling Fire",
|
|
394
|
+
DISAB: "Disability",
|
|
395
|
+
DO: "Directors & Officers Liability",
|
|
396
|
+
EDP: "Electronic Data Processing",
|
|
397
|
+
EL: "Employers Liability",
|
|
398
|
+
EO: "Errors & Omissions",
|
|
399
|
+
EPLI: "Employment Practices Liability",
|
|
400
|
+
EQ: "Earthquake",
|
|
401
|
+
EQPFL: "Equipment Floater",
|
|
402
|
+
EXLIA: "Excess Liability",
|
|
403
|
+
FIDTY: "Fidelity",
|
|
404
|
+
FIDUC: "Fiduciary Liability",
|
|
405
|
+
FINEA: "Fine Arts",
|
|
406
|
+
FLOOD: "Flood",
|
|
407
|
+
GARAG: "Garage",
|
|
408
|
+
GL: "General Liability",
|
|
409
|
+
GLASS: "Glass",
|
|
410
|
+
HANG: "Hangar (Aviation)",
|
|
411
|
+
HBB: "Home-Based Business",
|
|
412
|
+
HOME: "Homeowners",
|
|
413
|
+
INBR: "Inland Marine - Brokers",
|
|
414
|
+
INMAR: "Inland Marine",
|
|
415
|
+
INMRC: "Inland Marine - Commercial",
|
|
416
|
+
INMRP: "Inland Marine - Personal",
|
|
417
|
+
JUDCL: "Judicial Bonds",
|
|
418
|
+
KIDRA: "Kidnap & Ransom",
|
|
419
|
+
LL: "Liquor Liability",
|
|
420
|
+
MHOME: "Mobile Home",
|
|
421
|
+
MMAL: "Medical Malpractice",
|
|
422
|
+
Motorcycle: "Motorcycle",
|
|
423
|
+
MTRTK: "Motor Truck Cargo",
|
|
424
|
+
OLIB: "Other Liability",
|
|
425
|
+
PHYS: "Physical Damage",
|
|
426
|
+
PKG: "Package",
|
|
427
|
+
PL: "Professional Liability",
|
|
428
|
+
PLMSC: "Personal Lines Miscellaneous",
|
|
429
|
+
PPKGE: "Personal Package",
|
|
430
|
+
PROP: "Property",
|
|
431
|
+
PROPC: "Property - Commercial",
|
|
432
|
+
PUBOF: "Public Officials Liability",
|
|
433
|
+
RECV: "Recreational Vehicle",
|
|
434
|
+
SCHPR: "Scheduled Property",
|
|
435
|
+
SIGNS: "Signs",
|
|
436
|
+
SMP: "Special Multi-Peril",
|
|
437
|
+
SURE: "Surety",
|
|
438
|
+
TRANS: "Transportation",
|
|
439
|
+
TRUCK: "Trucking",
|
|
440
|
+
UMBRC: "Umbrella - Commercial",
|
|
441
|
+
UMBRL: "Umbrella",
|
|
442
|
+
UMBRP: "Umbrella - Personal",
|
|
443
|
+
UN: "Unspecified / Unknown",
|
|
444
|
+
WCMA: "Workers Comp - Monopolistic/State",
|
|
445
|
+
WIND: "Wind",
|
|
446
|
+
WORK: "Workers Compensation",
|
|
447
|
+
WORKP: "Workers Compensation (Personal/Package)",
|
|
448
|
+
WORKV: "Workers Compensation (Voluntary)"
|
|
449
|
+
};
|
|
450
|
+
var LEGACY_POLICY_TYPE_TO_LOB = {
|
|
451
|
+
general_liability: ["CGL"],
|
|
452
|
+
commercial_property: ["PROPC"],
|
|
453
|
+
commercial_auto: ["AUTOB"],
|
|
454
|
+
non_owned_auto: ["AUTOB"],
|
|
455
|
+
workers_comp: ["WORK"],
|
|
456
|
+
umbrella: ["UMBRC"],
|
|
457
|
+
excess_liability: ["EXLIA"],
|
|
458
|
+
professional_liability: ["EO"],
|
|
459
|
+
cyber: ["OLIB"],
|
|
460
|
+
epli: ["EPLI"],
|
|
461
|
+
directors_officers: ["DO"],
|
|
462
|
+
fiduciary_liability: ["FIDUC"],
|
|
463
|
+
crime_fidelity: ["CRIME"],
|
|
464
|
+
inland_marine: ["INMRC"],
|
|
465
|
+
builders_risk: ["INMRC"],
|
|
466
|
+
environmental: ["OLIB"],
|
|
467
|
+
ocean_marine: ["COMAR"],
|
|
468
|
+
surety: ["SURE"],
|
|
469
|
+
product_liability: ["OLIB"],
|
|
470
|
+
bop: ["BOP"],
|
|
471
|
+
management_liability_package: ["DO", "EPLI", "FIDUC"],
|
|
472
|
+
property: ["PROP"],
|
|
473
|
+
homeowners_ho3: ["HOME"],
|
|
474
|
+
homeowners_ho5: ["HOME"],
|
|
475
|
+
renters_ho4: ["HOME"],
|
|
476
|
+
condo_ho6: ["HOME"],
|
|
477
|
+
dwelling_fire: ["DFIRE"],
|
|
478
|
+
mobile_home: ["MHOME"],
|
|
479
|
+
personal_auto: ["AUTOP"],
|
|
480
|
+
personal_umbrella: ["UMBRP"],
|
|
481
|
+
flood_nfip: ["FLOOD"],
|
|
482
|
+
flood_private: ["FLOOD"],
|
|
483
|
+
earthquake: ["EQ"],
|
|
484
|
+
personal_inland_marine: ["INMRP"],
|
|
485
|
+
watercraft: ["BOAT"],
|
|
486
|
+
recreational_vehicle: ["RECV"],
|
|
487
|
+
farm_ranch: ["CFRM"],
|
|
488
|
+
life: ["UN"],
|
|
489
|
+
critical_illness: ["DISAB"],
|
|
490
|
+
disability: ["DISAB"],
|
|
491
|
+
long_term_care: ["UN"],
|
|
492
|
+
pet: ["UN"],
|
|
493
|
+
travel: ["UN"],
|
|
494
|
+
identity_theft: ["UN"],
|
|
495
|
+
title: ["UN"],
|
|
496
|
+
other: ["UN"],
|
|
497
|
+
unknown: ["UN"],
|
|
498
|
+
auto: ["AUTOB"],
|
|
499
|
+
crime: ["CRIME"],
|
|
500
|
+
crim: ["CRIME"],
|
|
501
|
+
fiduciary: ["FIDUC"],
|
|
502
|
+
d_and_o: ["DO"],
|
|
503
|
+
d_o: ["DO"],
|
|
504
|
+
homeowners: ["HOME"],
|
|
505
|
+
renters: ["HOME"],
|
|
506
|
+
flood: ["FLOOD"],
|
|
507
|
+
boat: ["BOAT"],
|
|
508
|
+
motorcycle: ["Motorcycle"]
|
|
509
|
+
};
|
|
510
|
+
function hasOwn(object, key) {
|
|
511
|
+
return Object.prototype.hasOwnProperty.call(object, key);
|
|
512
|
+
}
|
|
513
|
+
function canonicalLegacyKey(value) {
|
|
514
|
+
return value.trim().toLowerCase().replace(/&/g, " and ").replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "").replace(/_+/g, "_");
|
|
515
|
+
}
|
|
516
|
+
function isLobCode(value) {
|
|
517
|
+
return typeof value === "string" && hasOwn(ACORD_LOB_LABELS, value);
|
|
518
|
+
}
|
|
519
|
+
function toLobCodes(values) {
|
|
520
|
+
const source = values?.filter((value) => typeof value === "string" && value.trim()) ?? [];
|
|
521
|
+
if (source.length === 0) return ["UN"];
|
|
522
|
+
const codes = [];
|
|
523
|
+
for (const value of source) {
|
|
524
|
+
const trimmed = value.trim();
|
|
525
|
+
if (isLobCode(trimmed)) {
|
|
526
|
+
codes.push(trimmed);
|
|
527
|
+
continue;
|
|
528
|
+
}
|
|
529
|
+
if (trimmed.toUpperCase() === "CRIM") {
|
|
530
|
+
codes.push("CRIME");
|
|
531
|
+
continue;
|
|
532
|
+
}
|
|
533
|
+
const mapped = LEGACY_POLICY_TYPE_TO_LOB[canonicalLegacyKey(trimmed)];
|
|
534
|
+
if (mapped) {
|
|
535
|
+
codes.push(...mapped);
|
|
536
|
+
continue;
|
|
537
|
+
}
|
|
538
|
+
const upper = trimmed.toUpperCase();
|
|
539
|
+
if (isLobCode(upper)) {
|
|
540
|
+
codes.push(upper);
|
|
541
|
+
continue;
|
|
542
|
+
}
|
|
543
|
+
codes.push("UN");
|
|
544
|
+
}
|
|
545
|
+
return Array.from(new Set(codes));
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
// src/source/schemas.ts
|
|
549
|
+
var SourceSpanKindSchema = z2.enum([
|
|
267
550
|
"pdf_text",
|
|
268
551
|
"pdf_image",
|
|
269
552
|
"html",
|
|
@@ -271,7 +554,7 @@ var SourceSpanKindSchema = z.enum([
|
|
|
271
554
|
"plain_text",
|
|
272
555
|
"structured_field"
|
|
273
556
|
]);
|
|
274
|
-
var SourceSpanUnitSchema =
|
|
557
|
+
var SourceSpanUnitSchema = z2.enum([
|
|
275
558
|
"page",
|
|
276
559
|
"section",
|
|
277
560
|
"table",
|
|
@@ -280,78 +563,78 @@ var SourceSpanUnitSchema = z.enum([
|
|
|
280
563
|
"key_value",
|
|
281
564
|
"text"
|
|
282
565
|
]);
|
|
283
|
-
var SourceKindSchema =
|
|
566
|
+
var SourceKindSchema = z2.enum([
|
|
284
567
|
"policy_pdf",
|
|
285
568
|
"application_pdf",
|
|
286
569
|
"email",
|
|
287
570
|
"attachment",
|
|
288
571
|
"manual_note"
|
|
289
572
|
]);
|
|
290
|
-
var SourceSpanBBoxSchema =
|
|
291
|
-
page:
|
|
292
|
-
x:
|
|
293
|
-
y:
|
|
294
|
-
width:
|
|
295
|
-
height:
|
|
573
|
+
var SourceSpanBBoxSchema = z2.object({
|
|
574
|
+
page: z2.number().int().positive(),
|
|
575
|
+
x: z2.number(),
|
|
576
|
+
y: z2.number(),
|
|
577
|
+
width: z2.number(),
|
|
578
|
+
height: z2.number()
|
|
296
579
|
});
|
|
297
|
-
var SourceSpanLocationSchema =
|
|
298
|
-
page:
|
|
299
|
-
startPage:
|
|
300
|
-
endPage:
|
|
301
|
-
charStart:
|
|
302
|
-
charEnd:
|
|
303
|
-
lineStart:
|
|
304
|
-
lineEnd:
|
|
305
|
-
fieldPath:
|
|
580
|
+
var SourceSpanLocationSchema = z2.object({
|
|
581
|
+
page: z2.number().int().positive().optional(),
|
|
582
|
+
startPage: z2.number().int().positive().optional(),
|
|
583
|
+
endPage: z2.number().int().positive().optional(),
|
|
584
|
+
charStart: z2.number().int().nonnegative().optional(),
|
|
585
|
+
charEnd: z2.number().int().nonnegative().optional(),
|
|
586
|
+
lineStart: z2.number().int().positive().optional(),
|
|
587
|
+
lineEnd: z2.number().int().positive().optional(),
|
|
588
|
+
fieldPath: z2.string().optional()
|
|
306
589
|
});
|
|
307
|
-
var SourceSpanTableLocationSchema =
|
|
308
|
-
tableId:
|
|
309
|
-
rowIndex:
|
|
310
|
-
columnIndex:
|
|
311
|
-
columnName:
|
|
312
|
-
rowSpanId:
|
|
313
|
-
tableSpanId:
|
|
314
|
-
isHeader:
|
|
590
|
+
var SourceSpanTableLocationSchema = z2.object({
|
|
591
|
+
tableId: z2.string().optional(),
|
|
592
|
+
rowIndex: z2.number().int().nonnegative().optional(),
|
|
593
|
+
columnIndex: z2.number().int().nonnegative().optional(),
|
|
594
|
+
columnName: z2.string().optional(),
|
|
595
|
+
rowSpanId: z2.string().optional(),
|
|
596
|
+
tableSpanId: z2.string().optional(),
|
|
597
|
+
isHeader: z2.boolean().optional()
|
|
315
598
|
});
|
|
316
|
-
var SourceSpanSchema =
|
|
317
|
-
id:
|
|
318
|
-
documentId:
|
|
599
|
+
var SourceSpanSchema = z2.object({
|
|
600
|
+
id: z2.string().min(1),
|
|
601
|
+
documentId: z2.string().min(1),
|
|
319
602
|
sourceKind: SourceKindSchema.optional(),
|
|
320
|
-
chunkId:
|
|
603
|
+
chunkId: z2.string().optional(),
|
|
321
604
|
kind: SourceSpanKindSchema,
|
|
322
|
-
text:
|
|
323
|
-
hash:
|
|
324
|
-
textHash:
|
|
325
|
-
pageStart:
|
|
326
|
-
pageEnd:
|
|
327
|
-
sectionId:
|
|
328
|
-
formNumber:
|
|
605
|
+
text: z2.string(),
|
|
606
|
+
hash: z2.string().min(1),
|
|
607
|
+
textHash: z2.string().optional(),
|
|
608
|
+
pageStart: z2.number().int().positive().optional(),
|
|
609
|
+
pageEnd: z2.number().int().positive().optional(),
|
|
610
|
+
sectionId: z2.string().optional(),
|
|
611
|
+
formNumber: z2.string().optional(),
|
|
329
612
|
sourceUnit: SourceSpanUnitSchema.optional(),
|
|
330
|
-
parentSpanId:
|
|
613
|
+
parentSpanId: z2.string().optional(),
|
|
331
614
|
table: SourceSpanTableLocationSchema.optional(),
|
|
332
|
-
bbox:
|
|
615
|
+
bbox: z2.array(SourceSpanBBoxSchema).optional(),
|
|
333
616
|
location: SourceSpanLocationSchema.optional(),
|
|
334
|
-
metadata:
|
|
617
|
+
metadata: z2.record(z2.string(), z2.string()).optional()
|
|
335
618
|
});
|
|
336
|
-
var SourceSpanRefSchema =
|
|
337
|
-
sourceSpanId:
|
|
338
|
-
documentId:
|
|
339
|
-
chunkId:
|
|
340
|
-
quote:
|
|
341
|
-
hash:
|
|
619
|
+
var SourceSpanRefSchema = z2.object({
|
|
620
|
+
sourceSpanId: z2.string().min(1),
|
|
621
|
+
documentId: z2.string().min(1).optional(),
|
|
622
|
+
chunkId: z2.string().optional(),
|
|
623
|
+
quote: z2.string().optional(),
|
|
624
|
+
hash: z2.string().optional(),
|
|
342
625
|
location: SourceSpanLocationSchema.optional()
|
|
343
626
|
});
|
|
344
|
-
var SourceChunkSchema =
|
|
345
|
-
id:
|
|
346
|
-
documentId:
|
|
347
|
-
sourceSpanIds:
|
|
348
|
-
text:
|
|
349
|
-
textHash:
|
|
350
|
-
pageStart:
|
|
351
|
-
pageEnd:
|
|
352
|
-
metadata:
|
|
627
|
+
var SourceChunkSchema = z2.object({
|
|
628
|
+
id: z2.string().min(1),
|
|
629
|
+
documentId: z2.string().min(1),
|
|
630
|
+
sourceSpanIds: z2.array(z2.string().min(1)),
|
|
631
|
+
text: z2.string(),
|
|
632
|
+
textHash: z2.string().min(1),
|
|
633
|
+
pageStart: z2.number().int().positive().optional(),
|
|
634
|
+
pageEnd: z2.number().int().positive().optional(),
|
|
635
|
+
metadata: z2.record(z2.string(), z2.string()).default({})
|
|
353
636
|
});
|
|
354
|
-
var DocumentSourceNodeKindSchema =
|
|
637
|
+
var DocumentSourceNodeKindSchema = z2.enum([
|
|
355
638
|
"document",
|
|
356
639
|
"page_group",
|
|
357
640
|
"page",
|
|
@@ -365,31 +648,65 @@ var DocumentSourceNodeKindSchema = z.enum([
|
|
|
365
648
|
"table_cell",
|
|
366
649
|
"text"
|
|
367
650
|
]);
|
|
368
|
-
var DocumentSourceNodeSchema =
|
|
369
|
-
id:
|
|
370
|
-
documentId:
|
|
371
|
-
parentId:
|
|
651
|
+
var DocumentSourceNodeSchema = z2.object({
|
|
652
|
+
id: z2.string().min(1),
|
|
653
|
+
documentId: z2.string().min(1),
|
|
654
|
+
parentId: z2.string().optional(),
|
|
372
655
|
kind: DocumentSourceNodeKindSchema,
|
|
373
|
-
title:
|
|
374
|
-
description:
|
|
375
|
-
textExcerpt:
|
|
376
|
-
sourceSpanIds:
|
|
377
|
-
pageStart:
|
|
378
|
-
pageEnd:
|
|
379
|
-
bbox:
|
|
380
|
-
order:
|
|
381
|
-
path:
|
|
382
|
-
metadata:
|
|
656
|
+
title: z2.string(),
|
|
657
|
+
description: z2.string(),
|
|
658
|
+
textExcerpt: z2.string().optional(),
|
|
659
|
+
sourceSpanIds: z2.array(z2.string().min(1)),
|
|
660
|
+
pageStart: z2.number().int().positive().optional(),
|
|
661
|
+
pageEnd: z2.number().int().positive().optional(),
|
|
662
|
+
bbox: z2.array(SourceSpanBBoxSchema).optional(),
|
|
663
|
+
order: z2.number().int().nonnegative(),
|
|
664
|
+
path: z2.string(),
|
|
665
|
+
metadata: z2.record(z2.string(), z2.unknown()).optional()
|
|
383
666
|
});
|
|
384
|
-
var SourceBackedValueSchema =
|
|
385
|
-
value:
|
|
386
|
-
normalizedValue:
|
|
387
|
-
confidence:
|
|
388
|
-
sourceNodeIds:
|
|
389
|
-
sourceSpanIds:
|
|
667
|
+
var SourceBackedValueSchema = z2.object({
|
|
668
|
+
value: z2.string(),
|
|
669
|
+
normalizedValue: z2.string().optional(),
|
|
670
|
+
confidence: z2.enum(["low", "medium", "high"]).default("medium"),
|
|
671
|
+
sourceNodeIds: z2.array(z2.string().min(1)).default([]),
|
|
672
|
+
sourceSpanIds: z2.array(z2.string().min(1)).default([])
|
|
673
|
+
});
|
|
674
|
+
var OperationalAddressSchema = z2.object({
|
|
675
|
+
street1: z2.string().optional(),
|
|
676
|
+
street2: z2.string().optional(),
|
|
677
|
+
city: z2.string().optional(),
|
|
678
|
+
state: z2.string().optional(),
|
|
679
|
+
zip: z2.string().optional(),
|
|
680
|
+
country: z2.string().optional(),
|
|
681
|
+
formatted: z2.string().optional()
|
|
682
|
+
});
|
|
683
|
+
var OperationalDeclarationFactSchema = z2.object({
|
|
684
|
+
field: z2.enum([
|
|
685
|
+
"namedInsured",
|
|
686
|
+
"mailingAddress",
|
|
687
|
+
"dba",
|
|
688
|
+
"entityType",
|
|
689
|
+
"taxId",
|
|
690
|
+
"additionalNamedInsured",
|
|
691
|
+
"policyNumber",
|
|
692
|
+
"insurer",
|
|
693
|
+
"broker",
|
|
694
|
+
"effectiveDate",
|
|
695
|
+
"expirationDate",
|
|
696
|
+
"premium",
|
|
697
|
+
"other"
|
|
698
|
+
]),
|
|
699
|
+
label: z2.string().optional(),
|
|
700
|
+
value: z2.string(),
|
|
701
|
+
normalizedValue: z2.string().optional(),
|
|
702
|
+
valueKind: z2.enum(["string", "number", "date", "money", "address", "list", "unknown"]).default("string"),
|
|
703
|
+
address: OperationalAddressSchema.optional(),
|
|
704
|
+
confidence: z2.enum(["low", "medium", "high"]).default("medium"),
|
|
705
|
+
sourceNodeIds: z2.array(z2.string().min(1)).default([]),
|
|
706
|
+
sourceSpanIds: z2.array(z2.string().min(1)).default([])
|
|
390
707
|
});
|
|
391
|
-
var OperationalCoverageTermSchema =
|
|
392
|
-
kind:
|
|
708
|
+
var OperationalCoverageTermSchema = z2.object({
|
|
709
|
+
kind: z2.enum([
|
|
393
710
|
"each_claim_limit",
|
|
394
711
|
"each_occurrence_limit",
|
|
395
712
|
"each_loss_limit",
|
|
@@ -401,334 +718,76 @@ var OperationalCoverageTermSchema = z.object({
|
|
|
401
718
|
"premium",
|
|
402
719
|
"other"
|
|
403
720
|
]).default("other"),
|
|
404
|
-
label:
|
|
405
|
-
value:
|
|
406
|
-
amount:
|
|
407
|
-
appliesTo:
|
|
408
|
-
sourceNodeIds:
|
|
409
|
-
sourceSpanIds:
|
|
410
|
-
});
|
|
411
|
-
var OperationalCoverageLineSchema = z.object({
|
|
412
|
-
name: z.string(),
|
|
413
|
-
coverageCode: z.string().optional(),
|
|
414
|
-
limit: z.string().optional(),
|
|
415
|
-
deductible: z.string().optional(),
|
|
416
|
-
premium: z.string().optional(),
|
|
417
|
-
retroactiveDate: z.string().optional(),
|
|
418
|
-
formNumber: z.string().optional(),
|
|
419
|
-
sectionRef: z.string().optional(),
|
|
420
|
-
endorsementNumber: z.string().optional(),
|
|
421
|
-
limits: z.array(OperationalCoverageTermSchema).default([]),
|
|
422
|
-
sourceNodeIds: z.array(z.string().min(1)).default([]),
|
|
423
|
-
sourceSpanIds: z.array(z.string().min(1)).default([])
|
|
721
|
+
label: z2.string(),
|
|
722
|
+
value: z2.string(),
|
|
723
|
+
amount: z2.number().optional(),
|
|
724
|
+
appliesTo: z2.string().optional(),
|
|
725
|
+
sourceNodeIds: z2.array(z2.string().min(1)).default([]),
|
|
726
|
+
sourceSpanIds: z2.array(z2.string().min(1)).default([])
|
|
424
727
|
});
|
|
425
|
-
var
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
728
|
+
var OperationalCoverageLineSchema = z2.object({
|
|
729
|
+
name: z2.string(),
|
|
730
|
+
coverageCode: z2.string().optional(),
|
|
731
|
+
limit: z2.string().optional(),
|
|
732
|
+
deductible: z2.string().optional(),
|
|
733
|
+
premium: z2.string().optional(),
|
|
734
|
+
retroactiveDate: z2.string().optional(),
|
|
735
|
+
formNumber: z2.string().optional(),
|
|
736
|
+
sectionRef: z2.string().optional(),
|
|
737
|
+
endorsementNumber: z2.string().optional(),
|
|
738
|
+
limits: z2.array(OperationalCoverageTermSchema).default([]),
|
|
739
|
+
sourceNodeIds: z2.array(z2.string().min(1)).default([]),
|
|
740
|
+
sourceSpanIds: z2.array(z2.string().min(1)).default([])
|
|
430
741
|
});
|
|
431
|
-
var
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
sourceSpanIds: z.array(z.string().min(1)).default([])
|
|
742
|
+
var OperationalPartySchema = z2.object({
|
|
743
|
+
role: z2.string(),
|
|
744
|
+
name: z2.string(),
|
|
745
|
+
sourceNodeIds: z2.array(z2.string().min(1)).default([]),
|
|
746
|
+
sourceSpanIds: z2.array(z2.string().min(1)).default([])
|
|
437
747
|
});
|
|
438
|
-
var
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
broker: SourceBackedValueSchema.optional(),
|
|
445
|
-
effectiveDate: SourceBackedValueSchema.optional(),
|
|
446
|
-
expirationDate: SourceBackedValueSchema.optional(),
|
|
447
|
-
retroactiveDate: SourceBackedValueSchema.optional(),
|
|
448
|
-
premium: SourceBackedValueSchema.optional(),
|
|
449
|
-
coverages: z.array(OperationalCoverageLineSchema).default([]),
|
|
450
|
-
parties: z.array(OperationalPartySchema).default([]),
|
|
451
|
-
endorsementSupport: z.array(OperationalEndorsementSupportSchema).default([]),
|
|
452
|
-
sourceNodeIds: z.array(z.string().min(1)).default([]),
|
|
453
|
-
sourceSpanIds: z.array(z.string().min(1)).default([]),
|
|
454
|
-
warnings: z.array(z.string()).default([])
|
|
748
|
+
var OperationalEndorsementSupportSchema = z2.object({
|
|
749
|
+
kind: z2.string(),
|
|
750
|
+
status: z2.enum(["supported", "excluded", "requires_review"]),
|
|
751
|
+
summary: z2.string(),
|
|
752
|
+
sourceNodeIds: z2.array(z2.string().min(1)).default([]),
|
|
753
|
+
sourceSpanIds: z2.array(z2.string().min(1)).default([])
|
|
455
754
|
});
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
"
|
|
468
|
-
"
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
"flood_nfip",
|
|
493
|
-
"flood_private",
|
|
494
|
-
"earthquake",
|
|
495
|
-
"personal_inland_marine",
|
|
496
|
-
"watercraft",
|
|
497
|
-
"recreational_vehicle",
|
|
498
|
-
"farm_ranch",
|
|
499
|
-
"life",
|
|
500
|
-
"critical_illness",
|
|
501
|
-
"disability",
|
|
502
|
-
"long_term_care",
|
|
503
|
-
"pet",
|
|
504
|
-
"travel",
|
|
505
|
-
"identity_theft",
|
|
506
|
-
"title",
|
|
507
|
-
"other"
|
|
508
|
-
]);
|
|
509
|
-
var POLICY_TYPES = PolicyTypeSchema.options;
|
|
510
|
-
var EndorsementTypeSchema = z2.enum([
|
|
511
|
-
"additional_insured",
|
|
512
|
-
"waiver_of_subrogation",
|
|
513
|
-
"primary_noncontributory",
|
|
514
|
-
"blanket_additional_insured",
|
|
515
|
-
"loss_payee",
|
|
516
|
-
"mortgage_holder",
|
|
517
|
-
"broadening",
|
|
518
|
-
"restriction",
|
|
519
|
-
"exclusion",
|
|
520
|
-
"amendatory",
|
|
521
|
-
"notice_of_cancellation",
|
|
522
|
-
"designated_premises",
|
|
523
|
-
"classification_change",
|
|
524
|
-
"schedule_update",
|
|
525
|
-
"deductible_change",
|
|
526
|
-
"limit_change",
|
|
527
|
-
"territorial_extension",
|
|
528
|
-
"other"
|
|
529
|
-
]);
|
|
530
|
-
var ENDORSEMENT_TYPES = EndorsementTypeSchema.options;
|
|
531
|
-
var ConditionTypeSchema = z2.enum([
|
|
532
|
-
"duties_after_loss",
|
|
533
|
-
"notice_requirements",
|
|
534
|
-
"other_insurance",
|
|
535
|
-
"cancellation",
|
|
536
|
-
"nonrenewal",
|
|
537
|
-
"transfer_of_rights",
|
|
538
|
-
"liberalization",
|
|
539
|
-
"arbitration",
|
|
540
|
-
"concealment_fraud",
|
|
541
|
-
"examination_under_oath",
|
|
542
|
-
"legal_action",
|
|
543
|
-
"loss_payment",
|
|
544
|
-
"appraisal",
|
|
545
|
-
"mortgage_holders",
|
|
546
|
-
"policy_territory",
|
|
547
|
-
"separation_of_insureds",
|
|
548
|
-
"other"
|
|
549
|
-
]);
|
|
550
|
-
var CONDITION_TYPES = ConditionTypeSchema.options;
|
|
551
|
-
var PolicySectionTypeSchema = z2.enum([
|
|
552
|
-
"declarations",
|
|
553
|
-
"insuring_agreement",
|
|
554
|
-
"policy_form",
|
|
555
|
-
"endorsement",
|
|
556
|
-
"application",
|
|
557
|
-
"exclusion",
|
|
558
|
-
"condition",
|
|
559
|
-
"definition",
|
|
560
|
-
"schedule",
|
|
561
|
-
"notice",
|
|
562
|
-
"regulatory",
|
|
563
|
-
"other"
|
|
564
|
-
]);
|
|
565
|
-
var POLICY_SECTION_TYPES = PolicySectionTypeSchema.options;
|
|
566
|
-
var QuoteSectionTypeSchema = z2.enum([
|
|
567
|
-
"terms_summary",
|
|
568
|
-
"premium_indication",
|
|
569
|
-
"underwriting_condition",
|
|
570
|
-
"subjectivity",
|
|
571
|
-
"coverage_summary",
|
|
572
|
-
"exclusion",
|
|
573
|
-
"other"
|
|
574
|
-
]);
|
|
575
|
-
var QUOTE_SECTION_TYPES = QuoteSectionTypeSchema.options;
|
|
576
|
-
var CoverageFormSchema = z2.enum(["occurrence", "claims_made", "accident"]);
|
|
577
|
-
var COVERAGE_FORMS = CoverageFormSchema.options;
|
|
578
|
-
var PolicyTermTypeSchema = z2.enum(["fixed", "continuous"]);
|
|
579
|
-
var POLICY_TERM_TYPES = PolicyTermTypeSchema.options;
|
|
580
|
-
var CoverageTriggerSchema = z2.enum(["occurrence", "claims_made", "accident"]);
|
|
581
|
-
var COVERAGE_TRIGGERS = CoverageTriggerSchema.options;
|
|
582
|
-
var LimitTypeSchema = z2.enum([
|
|
583
|
-
"per_occurrence",
|
|
584
|
-
"per_claim",
|
|
585
|
-
"aggregate",
|
|
586
|
-
"per_person",
|
|
587
|
-
"per_accident",
|
|
588
|
-
"statutory",
|
|
589
|
-
"blanket",
|
|
590
|
-
"scheduled"
|
|
591
|
-
]);
|
|
592
|
-
var LIMIT_TYPES = LimitTypeSchema.options;
|
|
593
|
-
var DeductibleTypeSchema = z2.enum([
|
|
594
|
-
"per_occurrence",
|
|
595
|
-
"per_claim",
|
|
596
|
-
"aggregate",
|
|
597
|
-
"percentage",
|
|
598
|
-
"waiting_period"
|
|
599
|
-
]);
|
|
600
|
-
var DEDUCTIBLE_TYPES = DeductibleTypeSchema.options;
|
|
601
|
-
var ValuationMethodSchema = z2.enum([
|
|
602
|
-
"replacement_cost",
|
|
603
|
-
"actual_cash_value",
|
|
604
|
-
"agreed_value",
|
|
605
|
-
"functional_replacement"
|
|
606
|
-
]);
|
|
607
|
-
var VALUATION_METHODS = ValuationMethodSchema.options;
|
|
608
|
-
var DefenseCostTreatmentSchema = z2.enum(["inside_limits", "outside_limits", "supplementary"]);
|
|
609
|
-
var DEFENSE_COST_TREATMENTS = DefenseCostTreatmentSchema.options;
|
|
610
|
-
var EntityTypeSchema = z2.enum([
|
|
611
|
-
"corporation",
|
|
612
|
-
"llc",
|
|
613
|
-
"partnership",
|
|
614
|
-
"sole_proprietor",
|
|
615
|
-
"joint_venture",
|
|
616
|
-
"trust",
|
|
617
|
-
"nonprofit",
|
|
618
|
-
"municipality",
|
|
619
|
-
"individual",
|
|
620
|
-
"married_couple",
|
|
621
|
-
"other"
|
|
622
|
-
]);
|
|
623
|
-
var ENTITY_TYPES = EntityTypeSchema.options;
|
|
624
|
-
var AdmittedStatusSchema = z2.enum(["admitted", "non_admitted", "surplus_lines"]);
|
|
625
|
-
var ADMITTED_STATUSES = AdmittedStatusSchema.options;
|
|
626
|
-
var AuditTypeSchema = z2.enum([
|
|
627
|
-
"annual",
|
|
628
|
-
"semi_annual",
|
|
629
|
-
"quarterly",
|
|
630
|
-
"monthly",
|
|
631
|
-
"self",
|
|
632
|
-
"physical",
|
|
633
|
-
"none"
|
|
634
|
-
]);
|
|
635
|
-
var AUDIT_TYPES = AuditTypeSchema.options;
|
|
636
|
-
var EndorsementPartyRoleSchema = z2.enum([
|
|
637
|
-
"additional_insured",
|
|
638
|
-
"loss_payee",
|
|
639
|
-
"mortgage_holder",
|
|
640
|
-
"certificate_holder",
|
|
641
|
-
"notice_recipient",
|
|
642
|
-
"other"
|
|
643
|
-
]);
|
|
644
|
-
var ENDORSEMENT_PARTY_ROLES = EndorsementPartyRoleSchema.options;
|
|
645
|
-
var ClaimStatusSchema = z2.enum(["open", "closed", "reopened"]);
|
|
646
|
-
var CLAIM_STATUSES = ClaimStatusSchema.options;
|
|
647
|
-
var SubjectivityCategorySchema = z2.enum(["pre_binding", "post_binding", "information"]);
|
|
648
|
-
var SUBJECTIVITY_CATEGORIES = SubjectivityCategorySchema.options;
|
|
649
|
-
var DocumentTypeSchema = z2.enum(["policy", "quote", "binder", "endorsement", "certificate"]);
|
|
650
|
-
var DOCUMENT_TYPES = DocumentTypeSchema.options;
|
|
651
|
-
var ChunkTypeSchema = z2.enum([
|
|
652
|
-
"declarations",
|
|
653
|
-
"coverage_form",
|
|
654
|
-
"endorsement",
|
|
655
|
-
"schedule",
|
|
656
|
-
"conditions",
|
|
657
|
-
"mixed"
|
|
658
|
-
]);
|
|
659
|
-
var CHUNK_TYPES = ChunkTypeSchema.options;
|
|
660
|
-
var RatingBasisTypeSchema = z2.enum([
|
|
661
|
-
"payroll",
|
|
662
|
-
"revenue",
|
|
663
|
-
"area",
|
|
664
|
-
"units",
|
|
665
|
-
"vehicle_count",
|
|
666
|
-
"employee_count",
|
|
667
|
-
"per_capita",
|
|
668
|
-
"dwelling_value",
|
|
669
|
-
"vehicle_value",
|
|
670
|
-
"contents_value",
|
|
671
|
-
"other"
|
|
672
|
-
]);
|
|
673
|
-
var RATING_BASIS_TYPES = RatingBasisTypeSchema.options;
|
|
674
|
-
var VehicleCoverageTypeSchema = z2.enum([
|
|
675
|
-
"liability",
|
|
676
|
-
"collision",
|
|
677
|
-
"comprehensive",
|
|
678
|
-
"uninsured_motorist",
|
|
679
|
-
"underinsured_motorist",
|
|
680
|
-
"medical_payments",
|
|
681
|
-
"hired_auto",
|
|
682
|
-
"non_owned_auto",
|
|
683
|
-
"cargo",
|
|
684
|
-
"physical_damage"
|
|
685
|
-
]);
|
|
686
|
-
var VEHICLE_COVERAGE_TYPES = VehicleCoverageTypeSchema.options;
|
|
687
|
-
var HomeownersFormTypeSchema = z2.enum(["HO-3", "HO-5", "HO-4", "HO-6", "HO-7", "HO-8"]);
|
|
688
|
-
var HOMEOWNERS_FORM_TYPES = HomeownersFormTypeSchema.options;
|
|
689
|
-
var DwellingFireFormTypeSchema = z2.enum(["DP-1", "DP-2", "DP-3"]);
|
|
690
|
-
var DWELLING_FIRE_FORM_TYPES = DwellingFireFormTypeSchema.options;
|
|
691
|
-
var FloodZoneSchema = z2.enum(["A", "AE", "AH", "AO", "AR", "V", "VE", "B", "C", "X", "D"]);
|
|
692
|
-
var FLOOD_ZONES = FloodZoneSchema.options;
|
|
693
|
-
var ConstructionTypeSchema = z2.enum(["frame", "masonry", "superior", "mixed", "other"]);
|
|
694
|
-
var CONSTRUCTION_TYPES = ConstructionTypeSchema.options;
|
|
695
|
-
var RoofTypeSchema = z2.enum(["asphalt_shingle", "tile", "metal", "slate", "flat", "wood_shake", "other"]);
|
|
696
|
-
var ROOF_TYPES = RoofTypeSchema.options;
|
|
697
|
-
var FoundationTypeSchema = z2.enum(["basement", "crawl_space", "slab", "pier", "other"]);
|
|
698
|
-
var FOUNDATION_TYPES = FoundationTypeSchema.options;
|
|
699
|
-
var PersonalAutoUsageSchema = z2.enum(["pleasure", "commute", "business", "farm"]);
|
|
700
|
-
var PERSONAL_AUTO_USAGES = PersonalAutoUsageSchema.options;
|
|
701
|
-
var LossSettlementSchema = z2.enum([
|
|
702
|
-
"replacement_cost",
|
|
703
|
-
"actual_cash_value",
|
|
704
|
-
"extended_replacement_cost",
|
|
705
|
-
"guaranteed_replacement_cost"
|
|
706
|
-
]);
|
|
707
|
-
var LOSS_SETTLEMENTS = LossSettlementSchema.options;
|
|
708
|
-
var BoatTypeSchema = z2.enum(["sailboat", "powerboat", "pontoon", "jet_ski", "kayak_canoe", "yacht", "other"]);
|
|
709
|
-
var BOAT_TYPES = BoatTypeSchema.options;
|
|
710
|
-
var RVTypeSchema = z2.enum(["rv_motorhome", "travel_trailer", "atv", "snowmobile", "golf_cart", "dirt_bike", "other"]);
|
|
711
|
-
var RV_TYPES = RVTypeSchema.options;
|
|
712
|
-
var ScheduledItemCategorySchema = z2.enum([
|
|
713
|
-
"jewelry",
|
|
714
|
-
"fine_art",
|
|
715
|
-
"musical_instruments",
|
|
716
|
-
"silverware",
|
|
717
|
-
"furs",
|
|
718
|
-
"cameras",
|
|
719
|
-
"collectibles",
|
|
720
|
-
"firearms",
|
|
721
|
-
"golf_equipment",
|
|
722
|
-
"other"
|
|
723
|
-
]);
|
|
724
|
-
var SCHEDULED_ITEM_CATEGORIES = ScheduledItemCategorySchema.options;
|
|
725
|
-
var TitlePolicyTypeSchema = z2.enum(["owners", "lenders"]);
|
|
726
|
-
var TITLE_POLICY_TYPES = TitlePolicyTypeSchema.options;
|
|
727
|
-
var PetSpeciesSchema = z2.enum(["dog", "cat", "other"]);
|
|
728
|
-
var PET_SPECIES = PetSpeciesSchema.options;
|
|
729
|
-
|
|
730
|
-
// src/source/policy-types.ts
|
|
731
|
-
var POLICY_TYPE_KEYS = new Set(POLICY_TYPES);
|
|
755
|
+
function legacyOperationalProfileInput(value) {
|
|
756
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return value;
|
|
757
|
+
const record = value;
|
|
758
|
+
if ("linesOfBusiness" in record) return value;
|
|
759
|
+
if (!("policyTypes" in record)) return value;
|
|
760
|
+
return {
|
|
761
|
+
...record,
|
|
762
|
+
linesOfBusiness: record.policyTypes
|
|
763
|
+
};
|
|
764
|
+
}
|
|
765
|
+
var OperationalLinesOfBusinessSchema = z2.preprocess(
|
|
766
|
+
(value) => Array.isArray(value) ? toLobCodes(value.filter((item) => typeof item === "string")) : void 0,
|
|
767
|
+
z2.array(AcordLobCodeSchema).default(["UN"])
|
|
768
|
+
);
|
|
769
|
+
var PolicyOperationalProfileSchema = z2.preprocess(
|
|
770
|
+
legacyOperationalProfileInput,
|
|
771
|
+
z2.object({
|
|
772
|
+
documentType: z2.enum(["policy", "quote"]).default("policy"),
|
|
773
|
+
linesOfBusiness: OperationalLinesOfBusinessSchema,
|
|
774
|
+
policyNumber: SourceBackedValueSchema.optional(),
|
|
775
|
+
namedInsured: SourceBackedValueSchema.optional(),
|
|
776
|
+
insurer: SourceBackedValueSchema.optional(),
|
|
777
|
+
broker: SourceBackedValueSchema.optional(),
|
|
778
|
+
effectiveDate: SourceBackedValueSchema.optional(),
|
|
779
|
+
expirationDate: SourceBackedValueSchema.optional(),
|
|
780
|
+
retroactiveDate: SourceBackedValueSchema.optional(),
|
|
781
|
+
premium: SourceBackedValueSchema.optional(),
|
|
782
|
+
declarationFacts: z2.array(OperationalDeclarationFactSchema).default([]),
|
|
783
|
+
coverages: z2.array(OperationalCoverageLineSchema).default([]),
|
|
784
|
+
parties: z2.array(OperationalPartySchema).default([]),
|
|
785
|
+
endorsementSupport: z2.array(OperationalEndorsementSupportSchema).default([]),
|
|
786
|
+
sourceNodeIds: z2.array(z2.string().min(1)).default([]),
|
|
787
|
+
sourceSpanIds: z2.array(z2.string().min(1)).default([]),
|
|
788
|
+
warnings: z2.array(z2.string()).default([])
|
|
789
|
+
})
|
|
790
|
+
);
|
|
732
791
|
|
|
733
792
|
// src/source/retrieval.ts
|
|
734
793
|
function evidenceTieBreakId(evidence) {
|