@claritylabs/cl-sdk 3.2.12 → 4.0.1
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 +426 -402
- package/dist/application.js.map +1 -1
- package/dist/application.mjs +426 -402
- package/dist/application.mjs.map +1 -1
- package/dist/{index-WjheX6Dt.d.mts → index-Cte-BzHF.d.mts} +356 -259
- package/dist/{index-WjheX6Dt.d.ts → index-Cte-BzHF.d.ts} +356 -259
- package/dist/index.d.mts +93 -85
- package/dist/index.d.ts +93 -85
- package/dist/index.js +2050 -1825
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2037 -1819
- 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 +426 -402
- package/dist/storage-sqlite.js.map +1 -1
- package/dist/storage-sqlite.mjs +426 -402
- package/dist/storage-sqlite.mjs.map +1 -1
- package/package.json +1 -1
package/dist/application.mjs
CHANGED
|
@@ -1065,8 +1065,291 @@ function isHighValueLookupField(field) {
|
|
|
1065
1065
|
}
|
|
1066
1066
|
|
|
1067
1067
|
// src/source/schemas.ts
|
|
1068
|
+
import { z as z3 } from "zod";
|
|
1069
|
+
|
|
1070
|
+
// src/schemas/lines-of-business.ts
|
|
1068
1071
|
import { z as z2 } from "zod";
|
|
1069
|
-
var
|
|
1072
|
+
var ACORD_LOB_CODES = [
|
|
1073
|
+
"AAPPL",
|
|
1074
|
+
"AGLIA",
|
|
1075
|
+
"AGPP",
|
|
1076
|
+
"AGPR",
|
|
1077
|
+
"AIRC",
|
|
1078
|
+
"AIRPFB",
|
|
1079
|
+
"APKG",
|
|
1080
|
+
"APKGE",
|
|
1081
|
+
"APROD",
|
|
1082
|
+
"ARVP",
|
|
1083
|
+
"AUTO",
|
|
1084
|
+
"AUTOB",
|
|
1085
|
+
"AUTOP",
|
|
1086
|
+
"AVPKG",
|
|
1087
|
+
"BANDM",
|
|
1088
|
+
"BLANK",
|
|
1089
|
+
"BMISC",
|
|
1090
|
+
"BOAT",
|
|
1091
|
+
"BOP",
|
|
1092
|
+
"BOPGL",
|
|
1093
|
+
"BOPPR",
|
|
1094
|
+
"CAVN",
|
|
1095
|
+
"CEQFL",
|
|
1096
|
+
"CFIRE",
|
|
1097
|
+
"CFRM",
|
|
1098
|
+
"CGL",
|
|
1099
|
+
"COMAR",
|
|
1100
|
+
"COMR",
|
|
1101
|
+
"CONTR",
|
|
1102
|
+
"CPKGE",
|
|
1103
|
+
"CPMP",
|
|
1104
|
+
"CRIME",
|
|
1105
|
+
"DFIRE",
|
|
1106
|
+
"DISAB",
|
|
1107
|
+
"DO",
|
|
1108
|
+
"EDP",
|
|
1109
|
+
"EL",
|
|
1110
|
+
"EO",
|
|
1111
|
+
"EPLI",
|
|
1112
|
+
"EQ",
|
|
1113
|
+
"EQPFL",
|
|
1114
|
+
"EXLIA",
|
|
1115
|
+
"FIDTY",
|
|
1116
|
+
"FIDUC",
|
|
1117
|
+
"FINEA",
|
|
1118
|
+
"FLOOD",
|
|
1119
|
+
"GARAG",
|
|
1120
|
+
"GL",
|
|
1121
|
+
"GLASS",
|
|
1122
|
+
"HANG",
|
|
1123
|
+
"HBB",
|
|
1124
|
+
"HOME",
|
|
1125
|
+
"INBR",
|
|
1126
|
+
"INMAR",
|
|
1127
|
+
"INMRC",
|
|
1128
|
+
"INMRP",
|
|
1129
|
+
"JUDCL",
|
|
1130
|
+
"KIDRA",
|
|
1131
|
+
"LL",
|
|
1132
|
+
"MHOME",
|
|
1133
|
+
"MMAL",
|
|
1134
|
+
"Motorcycle",
|
|
1135
|
+
"MTRTK",
|
|
1136
|
+
"OLIB",
|
|
1137
|
+
"PHYS",
|
|
1138
|
+
"PKG",
|
|
1139
|
+
"PL",
|
|
1140
|
+
"PLMSC",
|
|
1141
|
+
"PPKGE",
|
|
1142
|
+
"PROP",
|
|
1143
|
+
"PROPC",
|
|
1144
|
+
"PUBOF",
|
|
1145
|
+
"RECV",
|
|
1146
|
+
"SCHPR",
|
|
1147
|
+
"SIGNS",
|
|
1148
|
+
"SMP",
|
|
1149
|
+
"SURE",
|
|
1150
|
+
"TRANS",
|
|
1151
|
+
"TRUCK",
|
|
1152
|
+
"UMBRC",
|
|
1153
|
+
"UMBRL",
|
|
1154
|
+
"UMBRP",
|
|
1155
|
+
"UN",
|
|
1156
|
+
"WCMA",
|
|
1157
|
+
"WIND",
|
|
1158
|
+
"WORK",
|
|
1159
|
+
"WORKP",
|
|
1160
|
+
"WORKV"
|
|
1161
|
+
];
|
|
1162
|
+
var AcordLobCodeSchema = z2.enum(ACORD_LOB_CODES);
|
|
1163
|
+
var ACORD_LOB_LABELS = {
|
|
1164
|
+
AAPPL: "Aircraft / Aerial Applicator",
|
|
1165
|
+
AGLIA: "Agricultural Liability",
|
|
1166
|
+
AGPP: "Agricultural Personal Property",
|
|
1167
|
+
AGPR: "Agricultural Property",
|
|
1168
|
+
AIRC: "Aircraft",
|
|
1169
|
+
AIRPFB: "Airport / Fixed Base Operator",
|
|
1170
|
+
APKG: "Agricultural Package",
|
|
1171
|
+
APKGE: "Agricultural Package (Extended)",
|
|
1172
|
+
APROD: "Agricultural Products",
|
|
1173
|
+
ARVP: "Recreational Vehicle Package",
|
|
1174
|
+
AUTO: "Automobile",
|
|
1175
|
+
AUTOB: "Business Auto",
|
|
1176
|
+
AUTOP: "Personal Auto",
|
|
1177
|
+
AVPKG: "Aviation Package",
|
|
1178
|
+
BANDM: "Boiler & Machinery",
|
|
1179
|
+
BLANK: "Blanket",
|
|
1180
|
+
BMISC: "Business Miscellaneous",
|
|
1181
|
+
BOAT: "Boat",
|
|
1182
|
+
BOP: "Businessowners Policy",
|
|
1183
|
+
BOPGL: "BOP - General Liability",
|
|
1184
|
+
BOPPR: "BOP - Property",
|
|
1185
|
+
CAVN: "Commercial Aviation",
|
|
1186
|
+
CEQFL: "Contractors Equipment Floater",
|
|
1187
|
+
CFIRE: "Commercial Fire",
|
|
1188
|
+
CFRM: "Commercial Farm",
|
|
1189
|
+
CGL: "Commercial General Liability",
|
|
1190
|
+
COMAR: "Commercial Marine / Ocean Marine",
|
|
1191
|
+
COMR: "Commercial (misc.)",
|
|
1192
|
+
CONTR: "Contractors",
|
|
1193
|
+
CPKGE: "Commercial Package",
|
|
1194
|
+
CPMP: "Commercial Package (multi-peril)",
|
|
1195
|
+
CRIME: "Crime",
|
|
1196
|
+
DFIRE: "Dwelling Fire",
|
|
1197
|
+
DISAB: "Disability",
|
|
1198
|
+
DO: "Directors & Officers Liability",
|
|
1199
|
+
EDP: "Electronic Data Processing",
|
|
1200
|
+
EL: "Employers Liability",
|
|
1201
|
+
EO: "Errors & Omissions",
|
|
1202
|
+
EPLI: "Employment Practices Liability",
|
|
1203
|
+
EQ: "Earthquake",
|
|
1204
|
+
EQPFL: "Equipment Floater",
|
|
1205
|
+
EXLIA: "Excess Liability",
|
|
1206
|
+
FIDTY: "Fidelity",
|
|
1207
|
+
FIDUC: "Fiduciary Liability",
|
|
1208
|
+
FINEA: "Fine Arts",
|
|
1209
|
+
FLOOD: "Flood",
|
|
1210
|
+
GARAG: "Garage",
|
|
1211
|
+
GL: "General Liability",
|
|
1212
|
+
GLASS: "Glass",
|
|
1213
|
+
HANG: "Hangar (Aviation)",
|
|
1214
|
+
HBB: "Home-Based Business",
|
|
1215
|
+
HOME: "Homeowners",
|
|
1216
|
+
INBR: "Inland Marine - Brokers",
|
|
1217
|
+
INMAR: "Inland Marine",
|
|
1218
|
+
INMRC: "Inland Marine - Commercial",
|
|
1219
|
+
INMRP: "Inland Marine - Personal",
|
|
1220
|
+
JUDCL: "Judicial Bonds",
|
|
1221
|
+
KIDRA: "Kidnap & Ransom",
|
|
1222
|
+
LL: "Liquor Liability",
|
|
1223
|
+
MHOME: "Mobile Home",
|
|
1224
|
+
MMAL: "Medical Malpractice",
|
|
1225
|
+
Motorcycle: "Motorcycle",
|
|
1226
|
+
MTRTK: "Motor Truck Cargo",
|
|
1227
|
+
OLIB: "Other Liability",
|
|
1228
|
+
PHYS: "Physical Damage",
|
|
1229
|
+
PKG: "Package",
|
|
1230
|
+
PL: "Professional Liability",
|
|
1231
|
+
PLMSC: "Personal Lines Miscellaneous",
|
|
1232
|
+
PPKGE: "Personal Package",
|
|
1233
|
+
PROP: "Property",
|
|
1234
|
+
PROPC: "Property - Commercial",
|
|
1235
|
+
PUBOF: "Public Officials Liability",
|
|
1236
|
+
RECV: "Recreational Vehicle",
|
|
1237
|
+
SCHPR: "Scheduled Property",
|
|
1238
|
+
SIGNS: "Signs",
|
|
1239
|
+
SMP: "Special Multi-Peril",
|
|
1240
|
+
SURE: "Surety",
|
|
1241
|
+
TRANS: "Transportation",
|
|
1242
|
+
TRUCK: "Trucking",
|
|
1243
|
+
UMBRC: "Umbrella - Commercial",
|
|
1244
|
+
UMBRL: "Umbrella",
|
|
1245
|
+
UMBRP: "Umbrella - Personal",
|
|
1246
|
+
UN: "Unspecified / Unknown",
|
|
1247
|
+
WCMA: "Workers Comp - Monopolistic/State",
|
|
1248
|
+
WIND: "Wind",
|
|
1249
|
+
WORK: "Workers Compensation",
|
|
1250
|
+
WORKP: "Workers Compensation (Personal/Package)",
|
|
1251
|
+
WORKV: "Workers Compensation (Voluntary)"
|
|
1252
|
+
};
|
|
1253
|
+
var LEGACY_POLICY_TYPE_TO_LOB = {
|
|
1254
|
+
general_liability: ["CGL"],
|
|
1255
|
+
commercial_property: ["PROPC"],
|
|
1256
|
+
commercial_auto: ["AUTOB"],
|
|
1257
|
+
non_owned_auto: ["AUTOB"],
|
|
1258
|
+
workers_comp: ["WORK"],
|
|
1259
|
+
umbrella: ["UMBRC"],
|
|
1260
|
+
excess_liability: ["EXLIA"],
|
|
1261
|
+
professional_liability: ["EO"],
|
|
1262
|
+
cyber: ["OLIB"],
|
|
1263
|
+
epli: ["EPLI"],
|
|
1264
|
+
directors_officers: ["DO"],
|
|
1265
|
+
fiduciary_liability: ["FIDUC"],
|
|
1266
|
+
crime_fidelity: ["CRIME"],
|
|
1267
|
+
inland_marine: ["INMRC"],
|
|
1268
|
+
builders_risk: ["INMRC"],
|
|
1269
|
+
environmental: ["OLIB"],
|
|
1270
|
+
ocean_marine: ["COMAR"],
|
|
1271
|
+
surety: ["SURE"],
|
|
1272
|
+
product_liability: ["OLIB"],
|
|
1273
|
+
bop: ["BOP"],
|
|
1274
|
+
management_liability_package: ["DO", "EPLI", "FIDUC"],
|
|
1275
|
+
property: ["PROP"],
|
|
1276
|
+
homeowners_ho3: ["HOME"],
|
|
1277
|
+
homeowners_ho5: ["HOME"],
|
|
1278
|
+
renters_ho4: ["HOME"],
|
|
1279
|
+
condo_ho6: ["HOME"],
|
|
1280
|
+
dwelling_fire: ["DFIRE"],
|
|
1281
|
+
mobile_home: ["MHOME"],
|
|
1282
|
+
personal_auto: ["AUTOP"],
|
|
1283
|
+
personal_umbrella: ["UMBRP"],
|
|
1284
|
+
flood_nfip: ["FLOOD"],
|
|
1285
|
+
flood_private: ["FLOOD"],
|
|
1286
|
+
earthquake: ["EQ"],
|
|
1287
|
+
personal_inland_marine: ["INMRP"],
|
|
1288
|
+
watercraft: ["BOAT"],
|
|
1289
|
+
recreational_vehicle: ["RECV"],
|
|
1290
|
+
farm_ranch: ["CFRM"],
|
|
1291
|
+
life: ["UN"],
|
|
1292
|
+
critical_illness: ["DISAB"],
|
|
1293
|
+
disability: ["DISAB"],
|
|
1294
|
+
long_term_care: ["UN"],
|
|
1295
|
+
pet: ["UN"],
|
|
1296
|
+
travel: ["UN"],
|
|
1297
|
+
identity_theft: ["UN"],
|
|
1298
|
+
title: ["UN"],
|
|
1299
|
+
other: ["UN"],
|
|
1300
|
+
unknown: ["UN"],
|
|
1301
|
+
auto: ["AUTOB"],
|
|
1302
|
+
crime: ["CRIME"],
|
|
1303
|
+
crim: ["CRIME"],
|
|
1304
|
+
fiduciary: ["FIDUC"],
|
|
1305
|
+
d_and_o: ["DO"],
|
|
1306
|
+
d_o: ["DO"],
|
|
1307
|
+
homeowners: ["HOME"],
|
|
1308
|
+
renters: ["HOME"],
|
|
1309
|
+
flood: ["FLOOD"],
|
|
1310
|
+
boat: ["BOAT"],
|
|
1311
|
+
motorcycle: ["Motorcycle"]
|
|
1312
|
+
};
|
|
1313
|
+
function hasOwn(object, key) {
|
|
1314
|
+
return Object.prototype.hasOwnProperty.call(object, key);
|
|
1315
|
+
}
|
|
1316
|
+
function canonicalLegacyKey(value) {
|
|
1317
|
+
return value.trim().toLowerCase().replace(/&/g, " and ").replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "").replace(/_+/g, "_");
|
|
1318
|
+
}
|
|
1319
|
+
function isLobCode(value) {
|
|
1320
|
+
return typeof value === "string" && hasOwn(ACORD_LOB_LABELS, value);
|
|
1321
|
+
}
|
|
1322
|
+
function toLobCodes(values) {
|
|
1323
|
+
const source = values?.filter((value) => typeof value === "string" && value.trim()) ?? [];
|
|
1324
|
+
if (source.length === 0) return ["UN"];
|
|
1325
|
+
const codes = [];
|
|
1326
|
+
for (const value of source) {
|
|
1327
|
+
const trimmed = value.trim();
|
|
1328
|
+
if (isLobCode(trimmed)) {
|
|
1329
|
+
codes.push(trimmed);
|
|
1330
|
+
continue;
|
|
1331
|
+
}
|
|
1332
|
+
if (trimmed.toUpperCase() === "CRIM") {
|
|
1333
|
+
codes.push("CRIME");
|
|
1334
|
+
continue;
|
|
1335
|
+
}
|
|
1336
|
+
const mapped = LEGACY_POLICY_TYPE_TO_LOB[canonicalLegacyKey(trimmed)];
|
|
1337
|
+
if (mapped) {
|
|
1338
|
+
codes.push(...mapped);
|
|
1339
|
+
continue;
|
|
1340
|
+
}
|
|
1341
|
+
const upper = trimmed.toUpperCase();
|
|
1342
|
+
if (isLobCode(upper)) {
|
|
1343
|
+
codes.push(upper);
|
|
1344
|
+
continue;
|
|
1345
|
+
}
|
|
1346
|
+
codes.push("UN");
|
|
1347
|
+
}
|
|
1348
|
+
return Array.from(new Set(codes));
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
// src/source/schemas.ts
|
|
1352
|
+
var SourceSpanKindSchema = z3.enum([
|
|
1070
1353
|
"pdf_text",
|
|
1071
1354
|
"pdf_image",
|
|
1072
1355
|
"html",
|
|
@@ -1074,7 +1357,7 @@ var SourceSpanKindSchema = z2.enum([
|
|
|
1074
1357
|
"plain_text",
|
|
1075
1358
|
"structured_field"
|
|
1076
1359
|
]);
|
|
1077
|
-
var SourceSpanUnitSchema =
|
|
1360
|
+
var SourceSpanUnitSchema = z3.enum([
|
|
1078
1361
|
"page",
|
|
1079
1362
|
"section",
|
|
1080
1363
|
"table",
|
|
@@ -1083,78 +1366,78 @@ var SourceSpanUnitSchema = z2.enum([
|
|
|
1083
1366
|
"key_value",
|
|
1084
1367
|
"text"
|
|
1085
1368
|
]);
|
|
1086
|
-
var SourceKindSchema =
|
|
1369
|
+
var SourceKindSchema = z3.enum([
|
|
1087
1370
|
"policy_pdf",
|
|
1088
1371
|
"application_pdf",
|
|
1089
1372
|
"email",
|
|
1090
1373
|
"attachment",
|
|
1091
1374
|
"manual_note"
|
|
1092
1375
|
]);
|
|
1093
|
-
var SourceSpanBBoxSchema =
|
|
1094
|
-
page:
|
|
1095
|
-
x:
|
|
1096
|
-
y:
|
|
1097
|
-
width:
|
|
1098
|
-
height:
|
|
1376
|
+
var SourceSpanBBoxSchema = z3.object({
|
|
1377
|
+
page: z3.number().int().positive(),
|
|
1378
|
+
x: z3.number(),
|
|
1379
|
+
y: z3.number(),
|
|
1380
|
+
width: z3.number(),
|
|
1381
|
+
height: z3.number()
|
|
1099
1382
|
});
|
|
1100
|
-
var SourceSpanLocationSchema =
|
|
1101
|
-
page:
|
|
1102
|
-
startPage:
|
|
1103
|
-
endPage:
|
|
1104
|
-
charStart:
|
|
1105
|
-
charEnd:
|
|
1106
|
-
lineStart:
|
|
1107
|
-
lineEnd:
|
|
1108
|
-
fieldPath:
|
|
1383
|
+
var SourceSpanLocationSchema = z3.object({
|
|
1384
|
+
page: z3.number().int().positive().optional(),
|
|
1385
|
+
startPage: z3.number().int().positive().optional(),
|
|
1386
|
+
endPage: z3.number().int().positive().optional(),
|
|
1387
|
+
charStart: z3.number().int().nonnegative().optional(),
|
|
1388
|
+
charEnd: z3.number().int().nonnegative().optional(),
|
|
1389
|
+
lineStart: z3.number().int().positive().optional(),
|
|
1390
|
+
lineEnd: z3.number().int().positive().optional(),
|
|
1391
|
+
fieldPath: z3.string().optional()
|
|
1109
1392
|
});
|
|
1110
|
-
var SourceSpanTableLocationSchema =
|
|
1111
|
-
tableId:
|
|
1112
|
-
rowIndex:
|
|
1113
|
-
columnIndex:
|
|
1114
|
-
columnName:
|
|
1115
|
-
rowSpanId:
|
|
1116
|
-
tableSpanId:
|
|
1117
|
-
isHeader:
|
|
1393
|
+
var SourceSpanTableLocationSchema = z3.object({
|
|
1394
|
+
tableId: z3.string().optional(),
|
|
1395
|
+
rowIndex: z3.number().int().nonnegative().optional(),
|
|
1396
|
+
columnIndex: z3.number().int().nonnegative().optional(),
|
|
1397
|
+
columnName: z3.string().optional(),
|
|
1398
|
+
rowSpanId: z3.string().optional(),
|
|
1399
|
+
tableSpanId: z3.string().optional(),
|
|
1400
|
+
isHeader: z3.boolean().optional()
|
|
1118
1401
|
});
|
|
1119
|
-
var SourceSpanSchema =
|
|
1120
|
-
id:
|
|
1121
|
-
documentId:
|
|
1402
|
+
var SourceSpanSchema = z3.object({
|
|
1403
|
+
id: z3.string().min(1),
|
|
1404
|
+
documentId: z3.string().min(1),
|
|
1122
1405
|
sourceKind: SourceKindSchema.optional(),
|
|
1123
|
-
chunkId:
|
|
1406
|
+
chunkId: z3.string().optional(),
|
|
1124
1407
|
kind: SourceSpanKindSchema,
|
|
1125
|
-
text:
|
|
1126
|
-
hash:
|
|
1127
|
-
textHash:
|
|
1128
|
-
pageStart:
|
|
1129
|
-
pageEnd:
|
|
1130
|
-
sectionId:
|
|
1131
|
-
formNumber:
|
|
1408
|
+
text: z3.string(),
|
|
1409
|
+
hash: z3.string().min(1),
|
|
1410
|
+
textHash: z3.string().optional(),
|
|
1411
|
+
pageStart: z3.number().int().positive().optional(),
|
|
1412
|
+
pageEnd: z3.number().int().positive().optional(),
|
|
1413
|
+
sectionId: z3.string().optional(),
|
|
1414
|
+
formNumber: z3.string().optional(),
|
|
1132
1415
|
sourceUnit: SourceSpanUnitSchema.optional(),
|
|
1133
|
-
parentSpanId:
|
|
1416
|
+
parentSpanId: z3.string().optional(),
|
|
1134
1417
|
table: SourceSpanTableLocationSchema.optional(),
|
|
1135
|
-
bbox:
|
|
1418
|
+
bbox: z3.array(SourceSpanBBoxSchema).optional(),
|
|
1136
1419
|
location: SourceSpanLocationSchema.optional(),
|
|
1137
|
-
metadata:
|
|
1420
|
+
metadata: z3.record(z3.string(), z3.string()).optional()
|
|
1138
1421
|
});
|
|
1139
|
-
var SourceSpanRefSchema =
|
|
1140
|
-
sourceSpanId:
|
|
1141
|
-
documentId:
|
|
1142
|
-
chunkId:
|
|
1143
|
-
quote:
|
|
1144
|
-
hash:
|
|
1422
|
+
var SourceSpanRefSchema = z3.object({
|
|
1423
|
+
sourceSpanId: z3.string().min(1),
|
|
1424
|
+
documentId: z3.string().min(1).optional(),
|
|
1425
|
+
chunkId: z3.string().optional(),
|
|
1426
|
+
quote: z3.string().optional(),
|
|
1427
|
+
hash: z3.string().optional(),
|
|
1145
1428
|
location: SourceSpanLocationSchema.optional()
|
|
1146
1429
|
});
|
|
1147
|
-
var SourceChunkSchema =
|
|
1148
|
-
id:
|
|
1149
|
-
documentId:
|
|
1150
|
-
sourceSpanIds:
|
|
1151
|
-
text:
|
|
1152
|
-
textHash:
|
|
1153
|
-
pageStart:
|
|
1154
|
-
pageEnd:
|
|
1155
|
-
metadata:
|
|
1430
|
+
var SourceChunkSchema = z3.object({
|
|
1431
|
+
id: z3.string().min(1),
|
|
1432
|
+
documentId: z3.string().min(1),
|
|
1433
|
+
sourceSpanIds: z3.array(z3.string().min(1)),
|
|
1434
|
+
text: z3.string(),
|
|
1435
|
+
textHash: z3.string().min(1),
|
|
1436
|
+
pageStart: z3.number().int().positive().optional(),
|
|
1437
|
+
pageEnd: z3.number().int().positive().optional(),
|
|
1438
|
+
metadata: z3.record(z3.string(), z3.string()).default({})
|
|
1156
1439
|
});
|
|
1157
|
-
var DocumentSourceNodeKindSchema =
|
|
1440
|
+
var DocumentSourceNodeKindSchema = z3.enum([
|
|
1158
1441
|
"document",
|
|
1159
1442
|
"page_group",
|
|
1160
1443
|
"page",
|
|
@@ -1168,31 +1451,31 @@ var DocumentSourceNodeKindSchema = z2.enum([
|
|
|
1168
1451
|
"table_cell",
|
|
1169
1452
|
"text"
|
|
1170
1453
|
]);
|
|
1171
|
-
var DocumentSourceNodeSchema =
|
|
1172
|
-
id:
|
|
1173
|
-
documentId:
|
|
1174
|
-
parentId:
|
|
1454
|
+
var DocumentSourceNodeSchema = z3.object({
|
|
1455
|
+
id: z3.string().min(1),
|
|
1456
|
+
documentId: z3.string().min(1),
|
|
1457
|
+
parentId: z3.string().optional(),
|
|
1175
1458
|
kind: DocumentSourceNodeKindSchema,
|
|
1176
|
-
title:
|
|
1177
|
-
description:
|
|
1178
|
-
textExcerpt:
|
|
1179
|
-
sourceSpanIds:
|
|
1180
|
-
pageStart:
|
|
1181
|
-
pageEnd:
|
|
1182
|
-
bbox:
|
|
1183
|
-
order:
|
|
1184
|
-
path:
|
|
1185
|
-
metadata:
|
|
1459
|
+
title: z3.string(),
|
|
1460
|
+
description: z3.string(),
|
|
1461
|
+
textExcerpt: z3.string().optional(),
|
|
1462
|
+
sourceSpanIds: z3.array(z3.string().min(1)),
|
|
1463
|
+
pageStart: z3.number().int().positive().optional(),
|
|
1464
|
+
pageEnd: z3.number().int().positive().optional(),
|
|
1465
|
+
bbox: z3.array(SourceSpanBBoxSchema).optional(),
|
|
1466
|
+
order: z3.number().int().nonnegative(),
|
|
1467
|
+
path: z3.string(),
|
|
1468
|
+
metadata: z3.record(z3.string(), z3.unknown()).optional()
|
|
1186
1469
|
});
|
|
1187
|
-
var SourceBackedValueSchema =
|
|
1188
|
-
value:
|
|
1189
|
-
normalizedValue:
|
|
1190
|
-
confidence:
|
|
1191
|
-
sourceNodeIds:
|
|
1192
|
-
sourceSpanIds:
|
|
1470
|
+
var SourceBackedValueSchema = z3.object({
|
|
1471
|
+
value: z3.string(),
|
|
1472
|
+
normalizedValue: z3.string().optional(),
|
|
1473
|
+
confidence: z3.enum(["low", "medium", "high"]).default("medium"),
|
|
1474
|
+
sourceNodeIds: z3.array(z3.string().min(1)).default([]),
|
|
1475
|
+
sourceSpanIds: z3.array(z3.string().min(1)).default([])
|
|
1193
1476
|
});
|
|
1194
|
-
var OperationalCoverageTermSchema =
|
|
1195
|
-
kind:
|
|
1477
|
+
var OperationalCoverageTermSchema = z3.object({
|
|
1478
|
+
kind: z3.enum([
|
|
1196
1479
|
"each_claim_limit",
|
|
1197
1480
|
"each_occurrence_limit",
|
|
1198
1481
|
"each_loss_limit",
|
|
@@ -1204,334 +1487,75 @@ var OperationalCoverageTermSchema = z2.object({
|
|
|
1204
1487
|
"premium",
|
|
1205
1488
|
"other"
|
|
1206
1489
|
]).default("other"),
|
|
1207
|
-
label:
|
|
1208
|
-
value:
|
|
1209
|
-
amount:
|
|
1210
|
-
appliesTo:
|
|
1211
|
-
sourceNodeIds:
|
|
1212
|
-
sourceSpanIds:
|
|
1213
|
-
});
|
|
1214
|
-
var OperationalCoverageLineSchema = z2.object({
|
|
1215
|
-
name: z2.string(),
|
|
1216
|
-
coverageCode: z2.string().optional(),
|
|
1217
|
-
limit: z2.string().optional(),
|
|
1218
|
-
deductible: z2.string().optional(),
|
|
1219
|
-
premium: z2.string().optional(),
|
|
1220
|
-
retroactiveDate: z2.string().optional(),
|
|
1221
|
-
formNumber: z2.string().optional(),
|
|
1222
|
-
sectionRef: z2.string().optional(),
|
|
1223
|
-
endorsementNumber: z2.string().optional(),
|
|
1224
|
-
limits: z2.array(OperationalCoverageTermSchema).default([]),
|
|
1225
|
-
sourceNodeIds: z2.array(z2.string().min(1)).default([]),
|
|
1226
|
-
sourceSpanIds: z2.array(z2.string().min(1)).default([])
|
|
1490
|
+
label: z3.string(),
|
|
1491
|
+
value: z3.string(),
|
|
1492
|
+
amount: z3.number().optional(),
|
|
1493
|
+
appliesTo: z3.string().optional(),
|
|
1494
|
+
sourceNodeIds: z3.array(z3.string().min(1)).default([]),
|
|
1495
|
+
sourceSpanIds: z3.array(z3.string().min(1)).default([])
|
|
1227
1496
|
});
|
|
1228
|
-
var
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1497
|
+
var OperationalCoverageLineSchema = z3.object({
|
|
1498
|
+
name: z3.string(),
|
|
1499
|
+
coverageCode: z3.string().optional(),
|
|
1500
|
+
limit: z3.string().optional(),
|
|
1501
|
+
deductible: z3.string().optional(),
|
|
1502
|
+
premium: z3.string().optional(),
|
|
1503
|
+
retroactiveDate: z3.string().optional(),
|
|
1504
|
+
formNumber: z3.string().optional(),
|
|
1505
|
+
sectionRef: z3.string().optional(),
|
|
1506
|
+
endorsementNumber: z3.string().optional(),
|
|
1507
|
+
limits: z3.array(OperationalCoverageTermSchema).default([]),
|
|
1508
|
+
sourceNodeIds: z3.array(z3.string().min(1)).default([]),
|
|
1509
|
+
sourceSpanIds: z3.array(z3.string().min(1)).default([])
|
|
1233
1510
|
});
|
|
1234
|
-
var
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
sourceSpanIds: z2.array(z2.string().min(1)).default([])
|
|
1511
|
+
var OperationalPartySchema = z3.object({
|
|
1512
|
+
role: z3.string(),
|
|
1513
|
+
name: z3.string(),
|
|
1514
|
+
sourceNodeIds: z3.array(z3.string().min(1)).default([]),
|
|
1515
|
+
sourceSpanIds: z3.array(z3.string().min(1)).default([])
|
|
1240
1516
|
});
|
|
1241
|
-
var
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
broker: SourceBackedValueSchema.optional(),
|
|
1248
|
-
effectiveDate: SourceBackedValueSchema.optional(),
|
|
1249
|
-
expirationDate: SourceBackedValueSchema.optional(),
|
|
1250
|
-
retroactiveDate: SourceBackedValueSchema.optional(),
|
|
1251
|
-
premium: SourceBackedValueSchema.optional(),
|
|
1252
|
-
coverages: z2.array(OperationalCoverageLineSchema).default([]),
|
|
1253
|
-
parties: z2.array(OperationalPartySchema).default([]),
|
|
1254
|
-
endorsementSupport: z2.array(OperationalEndorsementSupportSchema).default([]),
|
|
1255
|
-
sourceNodeIds: z2.array(z2.string().min(1)).default([]),
|
|
1256
|
-
sourceSpanIds: z2.array(z2.string().min(1)).default([]),
|
|
1257
|
-
warnings: z2.array(z2.string()).default([])
|
|
1517
|
+
var OperationalEndorsementSupportSchema = z3.object({
|
|
1518
|
+
kind: z3.string(),
|
|
1519
|
+
status: z3.enum(["supported", "excluded", "requires_review"]),
|
|
1520
|
+
summary: z3.string(),
|
|
1521
|
+
sourceNodeIds: z3.array(z3.string().min(1)).default([]),
|
|
1522
|
+
sourceSpanIds: z3.array(z3.string().min(1)).default([])
|
|
1258
1523
|
});
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
"
|
|
1271
|
-
"
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
"personal_umbrella",
|
|
1295
|
-
"flood_nfip",
|
|
1296
|
-
"flood_private",
|
|
1297
|
-
"earthquake",
|
|
1298
|
-
"personal_inland_marine",
|
|
1299
|
-
"watercraft",
|
|
1300
|
-
"recreational_vehicle",
|
|
1301
|
-
"farm_ranch",
|
|
1302
|
-
"life",
|
|
1303
|
-
"critical_illness",
|
|
1304
|
-
"disability",
|
|
1305
|
-
"long_term_care",
|
|
1306
|
-
"pet",
|
|
1307
|
-
"travel",
|
|
1308
|
-
"identity_theft",
|
|
1309
|
-
"title",
|
|
1310
|
-
"other"
|
|
1311
|
-
]);
|
|
1312
|
-
var POLICY_TYPES = PolicyTypeSchema.options;
|
|
1313
|
-
var EndorsementTypeSchema = z3.enum([
|
|
1314
|
-
"additional_insured",
|
|
1315
|
-
"waiver_of_subrogation",
|
|
1316
|
-
"primary_noncontributory",
|
|
1317
|
-
"blanket_additional_insured",
|
|
1318
|
-
"loss_payee",
|
|
1319
|
-
"mortgage_holder",
|
|
1320
|
-
"broadening",
|
|
1321
|
-
"restriction",
|
|
1322
|
-
"exclusion",
|
|
1323
|
-
"amendatory",
|
|
1324
|
-
"notice_of_cancellation",
|
|
1325
|
-
"designated_premises",
|
|
1326
|
-
"classification_change",
|
|
1327
|
-
"schedule_update",
|
|
1328
|
-
"deductible_change",
|
|
1329
|
-
"limit_change",
|
|
1330
|
-
"territorial_extension",
|
|
1331
|
-
"other"
|
|
1332
|
-
]);
|
|
1333
|
-
var ENDORSEMENT_TYPES = EndorsementTypeSchema.options;
|
|
1334
|
-
var ConditionTypeSchema = z3.enum([
|
|
1335
|
-
"duties_after_loss",
|
|
1336
|
-
"notice_requirements",
|
|
1337
|
-
"other_insurance",
|
|
1338
|
-
"cancellation",
|
|
1339
|
-
"nonrenewal",
|
|
1340
|
-
"transfer_of_rights",
|
|
1341
|
-
"liberalization",
|
|
1342
|
-
"arbitration",
|
|
1343
|
-
"concealment_fraud",
|
|
1344
|
-
"examination_under_oath",
|
|
1345
|
-
"legal_action",
|
|
1346
|
-
"loss_payment",
|
|
1347
|
-
"appraisal",
|
|
1348
|
-
"mortgage_holders",
|
|
1349
|
-
"policy_territory",
|
|
1350
|
-
"separation_of_insureds",
|
|
1351
|
-
"other"
|
|
1352
|
-
]);
|
|
1353
|
-
var CONDITION_TYPES = ConditionTypeSchema.options;
|
|
1354
|
-
var PolicySectionTypeSchema = z3.enum([
|
|
1355
|
-
"declarations",
|
|
1356
|
-
"insuring_agreement",
|
|
1357
|
-
"policy_form",
|
|
1358
|
-
"endorsement",
|
|
1359
|
-
"application",
|
|
1360
|
-
"exclusion",
|
|
1361
|
-
"condition",
|
|
1362
|
-
"definition",
|
|
1363
|
-
"schedule",
|
|
1364
|
-
"notice",
|
|
1365
|
-
"regulatory",
|
|
1366
|
-
"other"
|
|
1367
|
-
]);
|
|
1368
|
-
var POLICY_SECTION_TYPES = PolicySectionTypeSchema.options;
|
|
1369
|
-
var QuoteSectionTypeSchema = z3.enum([
|
|
1370
|
-
"terms_summary",
|
|
1371
|
-
"premium_indication",
|
|
1372
|
-
"underwriting_condition",
|
|
1373
|
-
"subjectivity",
|
|
1374
|
-
"coverage_summary",
|
|
1375
|
-
"exclusion",
|
|
1376
|
-
"other"
|
|
1377
|
-
]);
|
|
1378
|
-
var QUOTE_SECTION_TYPES = QuoteSectionTypeSchema.options;
|
|
1379
|
-
var CoverageFormSchema = z3.enum(["occurrence", "claims_made", "accident"]);
|
|
1380
|
-
var COVERAGE_FORMS = CoverageFormSchema.options;
|
|
1381
|
-
var PolicyTermTypeSchema = z3.enum(["fixed", "continuous"]);
|
|
1382
|
-
var POLICY_TERM_TYPES = PolicyTermTypeSchema.options;
|
|
1383
|
-
var CoverageTriggerSchema = z3.enum(["occurrence", "claims_made", "accident"]);
|
|
1384
|
-
var COVERAGE_TRIGGERS = CoverageTriggerSchema.options;
|
|
1385
|
-
var LimitTypeSchema = z3.enum([
|
|
1386
|
-
"per_occurrence",
|
|
1387
|
-
"per_claim",
|
|
1388
|
-
"aggregate",
|
|
1389
|
-
"per_person",
|
|
1390
|
-
"per_accident",
|
|
1391
|
-
"statutory",
|
|
1392
|
-
"blanket",
|
|
1393
|
-
"scheduled"
|
|
1394
|
-
]);
|
|
1395
|
-
var LIMIT_TYPES = LimitTypeSchema.options;
|
|
1396
|
-
var DeductibleTypeSchema = z3.enum([
|
|
1397
|
-
"per_occurrence",
|
|
1398
|
-
"per_claim",
|
|
1399
|
-
"aggregate",
|
|
1400
|
-
"percentage",
|
|
1401
|
-
"waiting_period"
|
|
1402
|
-
]);
|
|
1403
|
-
var DEDUCTIBLE_TYPES = DeductibleTypeSchema.options;
|
|
1404
|
-
var ValuationMethodSchema = z3.enum([
|
|
1405
|
-
"replacement_cost",
|
|
1406
|
-
"actual_cash_value",
|
|
1407
|
-
"agreed_value",
|
|
1408
|
-
"functional_replacement"
|
|
1409
|
-
]);
|
|
1410
|
-
var VALUATION_METHODS = ValuationMethodSchema.options;
|
|
1411
|
-
var DefenseCostTreatmentSchema = z3.enum(["inside_limits", "outside_limits", "supplementary"]);
|
|
1412
|
-
var DEFENSE_COST_TREATMENTS = DefenseCostTreatmentSchema.options;
|
|
1413
|
-
var EntityTypeSchema = z3.enum([
|
|
1414
|
-
"corporation",
|
|
1415
|
-
"llc",
|
|
1416
|
-
"partnership",
|
|
1417
|
-
"sole_proprietor",
|
|
1418
|
-
"joint_venture",
|
|
1419
|
-
"trust",
|
|
1420
|
-
"nonprofit",
|
|
1421
|
-
"municipality",
|
|
1422
|
-
"individual",
|
|
1423
|
-
"married_couple",
|
|
1424
|
-
"other"
|
|
1425
|
-
]);
|
|
1426
|
-
var ENTITY_TYPES = EntityTypeSchema.options;
|
|
1427
|
-
var AdmittedStatusSchema = z3.enum(["admitted", "non_admitted", "surplus_lines"]);
|
|
1428
|
-
var ADMITTED_STATUSES = AdmittedStatusSchema.options;
|
|
1429
|
-
var AuditTypeSchema = z3.enum([
|
|
1430
|
-
"annual",
|
|
1431
|
-
"semi_annual",
|
|
1432
|
-
"quarterly",
|
|
1433
|
-
"monthly",
|
|
1434
|
-
"self",
|
|
1435
|
-
"physical",
|
|
1436
|
-
"none"
|
|
1437
|
-
]);
|
|
1438
|
-
var AUDIT_TYPES = AuditTypeSchema.options;
|
|
1439
|
-
var EndorsementPartyRoleSchema = z3.enum([
|
|
1440
|
-
"additional_insured",
|
|
1441
|
-
"loss_payee",
|
|
1442
|
-
"mortgage_holder",
|
|
1443
|
-
"certificate_holder",
|
|
1444
|
-
"notice_recipient",
|
|
1445
|
-
"other"
|
|
1446
|
-
]);
|
|
1447
|
-
var ENDORSEMENT_PARTY_ROLES = EndorsementPartyRoleSchema.options;
|
|
1448
|
-
var ClaimStatusSchema = z3.enum(["open", "closed", "reopened"]);
|
|
1449
|
-
var CLAIM_STATUSES = ClaimStatusSchema.options;
|
|
1450
|
-
var SubjectivityCategorySchema = z3.enum(["pre_binding", "post_binding", "information"]);
|
|
1451
|
-
var SUBJECTIVITY_CATEGORIES = SubjectivityCategorySchema.options;
|
|
1452
|
-
var DocumentTypeSchema = z3.enum(["policy", "quote", "binder", "endorsement", "certificate"]);
|
|
1453
|
-
var DOCUMENT_TYPES = DocumentTypeSchema.options;
|
|
1454
|
-
var ChunkTypeSchema = z3.enum([
|
|
1455
|
-
"declarations",
|
|
1456
|
-
"coverage_form",
|
|
1457
|
-
"endorsement",
|
|
1458
|
-
"schedule",
|
|
1459
|
-
"conditions",
|
|
1460
|
-
"mixed"
|
|
1461
|
-
]);
|
|
1462
|
-
var CHUNK_TYPES = ChunkTypeSchema.options;
|
|
1463
|
-
var RatingBasisTypeSchema = z3.enum([
|
|
1464
|
-
"payroll",
|
|
1465
|
-
"revenue",
|
|
1466
|
-
"area",
|
|
1467
|
-
"units",
|
|
1468
|
-
"vehicle_count",
|
|
1469
|
-
"employee_count",
|
|
1470
|
-
"per_capita",
|
|
1471
|
-
"dwelling_value",
|
|
1472
|
-
"vehicle_value",
|
|
1473
|
-
"contents_value",
|
|
1474
|
-
"other"
|
|
1475
|
-
]);
|
|
1476
|
-
var RATING_BASIS_TYPES = RatingBasisTypeSchema.options;
|
|
1477
|
-
var VehicleCoverageTypeSchema = z3.enum([
|
|
1478
|
-
"liability",
|
|
1479
|
-
"collision",
|
|
1480
|
-
"comprehensive",
|
|
1481
|
-
"uninsured_motorist",
|
|
1482
|
-
"underinsured_motorist",
|
|
1483
|
-
"medical_payments",
|
|
1484
|
-
"hired_auto",
|
|
1485
|
-
"non_owned_auto",
|
|
1486
|
-
"cargo",
|
|
1487
|
-
"physical_damage"
|
|
1488
|
-
]);
|
|
1489
|
-
var VEHICLE_COVERAGE_TYPES = VehicleCoverageTypeSchema.options;
|
|
1490
|
-
var HomeownersFormTypeSchema = z3.enum(["HO-3", "HO-5", "HO-4", "HO-6", "HO-7", "HO-8"]);
|
|
1491
|
-
var HOMEOWNERS_FORM_TYPES = HomeownersFormTypeSchema.options;
|
|
1492
|
-
var DwellingFireFormTypeSchema = z3.enum(["DP-1", "DP-2", "DP-3"]);
|
|
1493
|
-
var DWELLING_FIRE_FORM_TYPES = DwellingFireFormTypeSchema.options;
|
|
1494
|
-
var FloodZoneSchema = z3.enum(["A", "AE", "AH", "AO", "AR", "V", "VE", "B", "C", "X", "D"]);
|
|
1495
|
-
var FLOOD_ZONES = FloodZoneSchema.options;
|
|
1496
|
-
var ConstructionTypeSchema = z3.enum(["frame", "masonry", "superior", "mixed", "other"]);
|
|
1497
|
-
var CONSTRUCTION_TYPES = ConstructionTypeSchema.options;
|
|
1498
|
-
var RoofTypeSchema = z3.enum(["asphalt_shingle", "tile", "metal", "slate", "flat", "wood_shake", "other"]);
|
|
1499
|
-
var ROOF_TYPES = RoofTypeSchema.options;
|
|
1500
|
-
var FoundationTypeSchema = z3.enum(["basement", "crawl_space", "slab", "pier", "other"]);
|
|
1501
|
-
var FOUNDATION_TYPES = FoundationTypeSchema.options;
|
|
1502
|
-
var PersonalAutoUsageSchema = z3.enum(["pleasure", "commute", "business", "farm"]);
|
|
1503
|
-
var PERSONAL_AUTO_USAGES = PersonalAutoUsageSchema.options;
|
|
1504
|
-
var LossSettlementSchema = z3.enum([
|
|
1505
|
-
"replacement_cost",
|
|
1506
|
-
"actual_cash_value",
|
|
1507
|
-
"extended_replacement_cost",
|
|
1508
|
-
"guaranteed_replacement_cost"
|
|
1509
|
-
]);
|
|
1510
|
-
var LOSS_SETTLEMENTS = LossSettlementSchema.options;
|
|
1511
|
-
var BoatTypeSchema = z3.enum(["sailboat", "powerboat", "pontoon", "jet_ski", "kayak_canoe", "yacht", "other"]);
|
|
1512
|
-
var BOAT_TYPES = BoatTypeSchema.options;
|
|
1513
|
-
var RVTypeSchema = z3.enum(["rv_motorhome", "travel_trailer", "atv", "snowmobile", "golf_cart", "dirt_bike", "other"]);
|
|
1514
|
-
var RV_TYPES = RVTypeSchema.options;
|
|
1515
|
-
var ScheduledItemCategorySchema = z3.enum([
|
|
1516
|
-
"jewelry",
|
|
1517
|
-
"fine_art",
|
|
1518
|
-
"musical_instruments",
|
|
1519
|
-
"silverware",
|
|
1520
|
-
"furs",
|
|
1521
|
-
"cameras",
|
|
1522
|
-
"collectibles",
|
|
1523
|
-
"firearms",
|
|
1524
|
-
"golf_equipment",
|
|
1525
|
-
"other"
|
|
1526
|
-
]);
|
|
1527
|
-
var SCHEDULED_ITEM_CATEGORIES = ScheduledItemCategorySchema.options;
|
|
1528
|
-
var TitlePolicyTypeSchema = z3.enum(["owners", "lenders"]);
|
|
1529
|
-
var TITLE_POLICY_TYPES = TitlePolicyTypeSchema.options;
|
|
1530
|
-
var PetSpeciesSchema = z3.enum(["dog", "cat", "other"]);
|
|
1531
|
-
var PET_SPECIES = PetSpeciesSchema.options;
|
|
1532
|
-
|
|
1533
|
-
// src/source/policy-types.ts
|
|
1534
|
-
var POLICY_TYPE_KEYS = new Set(POLICY_TYPES);
|
|
1524
|
+
function legacyOperationalProfileInput(value) {
|
|
1525
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return value;
|
|
1526
|
+
const record = value;
|
|
1527
|
+
if ("linesOfBusiness" in record) return value;
|
|
1528
|
+
if (!("policyTypes" in record)) return value;
|
|
1529
|
+
return {
|
|
1530
|
+
...record,
|
|
1531
|
+
linesOfBusiness: record.policyTypes
|
|
1532
|
+
};
|
|
1533
|
+
}
|
|
1534
|
+
var OperationalLinesOfBusinessSchema = z3.preprocess(
|
|
1535
|
+
(value) => Array.isArray(value) ? toLobCodes(value.filter((item) => typeof item === "string")) : void 0,
|
|
1536
|
+
z3.array(AcordLobCodeSchema).default(["UN"])
|
|
1537
|
+
);
|
|
1538
|
+
var PolicyOperationalProfileSchema = z3.preprocess(
|
|
1539
|
+
legacyOperationalProfileInput,
|
|
1540
|
+
z3.object({
|
|
1541
|
+
documentType: z3.enum(["policy", "quote"]).default("policy"),
|
|
1542
|
+
linesOfBusiness: OperationalLinesOfBusinessSchema,
|
|
1543
|
+
policyNumber: SourceBackedValueSchema.optional(),
|
|
1544
|
+
namedInsured: SourceBackedValueSchema.optional(),
|
|
1545
|
+
insurer: SourceBackedValueSchema.optional(),
|
|
1546
|
+
broker: SourceBackedValueSchema.optional(),
|
|
1547
|
+
effectiveDate: SourceBackedValueSchema.optional(),
|
|
1548
|
+
expirationDate: SourceBackedValueSchema.optional(),
|
|
1549
|
+
retroactiveDate: SourceBackedValueSchema.optional(),
|
|
1550
|
+
premium: SourceBackedValueSchema.optional(),
|
|
1551
|
+
coverages: z3.array(OperationalCoverageLineSchema).default([]),
|
|
1552
|
+
parties: z3.array(OperationalPartySchema).default([]),
|
|
1553
|
+
endorsementSupport: z3.array(OperationalEndorsementSupportSchema).default([]),
|
|
1554
|
+
sourceNodeIds: z3.array(z3.string().min(1)).default([]),
|
|
1555
|
+
sourceSpanIds: z3.array(z3.string().min(1)).default([]),
|
|
1556
|
+
warnings: z3.array(z3.string()).default([])
|
|
1557
|
+
})
|
|
1558
|
+
);
|
|
1535
1559
|
|
|
1536
1560
|
// src/source/ids.ts
|
|
1537
1561
|
function normalizeText(text) {
|