@claritylabs/cl-sdk 3.2.12 → 3.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/application.js.map +1 -1
- package/dist/application.mjs.map +1 -1
- package/dist/index.d.mts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.js +6 -32
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -31
- package/dist/index.mjs.map +1 -1
- package/dist/storage-sqlite.js.map +1 -1
- package/dist/storage-sqlite.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2246,7 +2246,6 @@ var POLICY_TYPE_TEXT_PATTERNS = [
|
|
|
2246
2246
|
{ type: "identity_theft", pattern: /\bidentity\s+theft\b/i },
|
|
2247
2247
|
{ type: "title", pattern: /\btitle\s+insurance\b/i }
|
|
2248
2248
|
];
|
|
2249
|
-
var POLICY_TYPES_FROM_COVERAGES_WARNING = "Policy types augmented from extracted coverage labels.";
|
|
2250
2249
|
function normalizeWhitespace(value) {
|
|
2251
2250
|
return value.replace(/\s+/g, " ").trim();
|
|
2252
2251
|
}
|
|
@@ -2284,36 +2283,16 @@ function inferPolicyTypesFromOperationalCoverages(coverages) {
|
|
|
2284
2283
|
}
|
|
2285
2284
|
return inferred.slice(0, 6);
|
|
2286
2285
|
}
|
|
2287
|
-
function mergePolicyTypes(base, additions) {
|
|
2288
|
-
const merged = [
|
|
2289
|
-
...base.filter((type) => type !== "other"),
|
|
2290
|
-
...additions.filter((type) => type !== "other")
|
|
2291
|
-
];
|
|
2292
|
-
const unique = [...new Set(merged)].slice(0, 6);
|
|
2293
|
-
return unique.length ? unique : base;
|
|
2294
|
-
}
|
|
2295
2286
|
function resolveOperationalProfilePolicyTypes(params) {
|
|
2296
2287
|
const inferred = inferPolicyTypesFromOperationalCoverages(params.coverages ?? []);
|
|
2297
|
-
const controlled = normalizeOperationalPolicyTypes(params.profileTypes);
|
|
2298
|
-
if (hasSpecificPolicyType(controlled)) {
|
|
2299
|
-
const policyTypes = mergePolicyTypes(controlled, inferred);
|
|
2300
|
-
return {
|
|
2301
|
-
policyTypes,
|
|
2302
|
-
source: policyTypes.length > controlled.filter((type) => type !== "other").length ? "profile_augmented" : "profile"
|
|
2303
|
-
};
|
|
2304
|
-
}
|
|
2305
|
-
const existingControlled = normalizeOperationalPolicyTypes(params.existingTypes);
|
|
2306
|
-
if (hasSpecificPolicyType(existingControlled)) {
|
|
2307
|
-
const policyTypes = mergePolicyTypes(existingControlled, inferred);
|
|
2308
|
-
return {
|
|
2309
|
-
policyTypes,
|
|
2310
|
-
source: policyTypes.length > existingControlled.filter((type) => type !== "other").length ? "existing_augmented" : "existing"
|
|
2311
|
-
};
|
|
2312
|
-
}
|
|
2313
2288
|
if (inferred.length > 0) {
|
|
2314
|
-
return { policyTypes: inferred, source: "
|
|
2289
|
+
return { policyTypes: inferred, source: "coverage" };
|
|
2315
2290
|
}
|
|
2316
|
-
|
|
2291
|
+
const controlled = normalizeOperationalPolicyTypes(params.profileTypes);
|
|
2292
|
+
if (hasSpecificPolicyType(controlled)) return { policyTypes: controlled, source: "profile_hint" };
|
|
2293
|
+
const existingControlled = normalizeOperationalPolicyTypes(params.existingTypes);
|
|
2294
|
+
if (hasSpecificPolicyType(existingControlled)) return { policyTypes: existingControlled, source: "existing_hint" };
|
|
2295
|
+
return { policyTypes: controlled, source: "default" };
|
|
2317
2296
|
}
|
|
2318
2297
|
|
|
2319
2298
|
// src/source/ids.ts
|
|
@@ -3723,9 +3702,6 @@ function mergeOperationalProfile(base, candidate, validNodeIds, validSpanIds) {
|
|
|
3723
3702
|
existingTypes: base.policyTypes,
|
|
3724
3703
|
coverages
|
|
3725
3704
|
});
|
|
3726
|
-
if (resolvedPolicyTypes.source === "profile_augmented" || resolvedPolicyTypes.source === "existing_augmented" || resolvedPolicyTypes.source === "inferred") {
|
|
3727
|
-
warnings.push(POLICY_TYPES_FROM_COVERAGES_WARNING);
|
|
3728
|
-
}
|
|
3729
3705
|
return PolicyOperationalProfileSchema.parse({
|
|
3730
3706
|
...base,
|
|
3731
3707
|
documentType: candidate.documentType === "policy" ? "policy" : base.documentType,
|
|
@@ -12806,7 +12782,6 @@ export {
|
|
|
12806
12782
|
POLICY_SECTION_TYPES,
|
|
12807
12783
|
POLICY_TERM_TYPES,
|
|
12808
12784
|
POLICY_TYPES,
|
|
12809
|
-
POLICY_TYPES_FROM_COVERAGES_WARNING,
|
|
12810
12785
|
ParsedAnswerSchema,
|
|
12811
12786
|
PaymentInstallmentSchema,
|
|
12812
12787
|
PaymentPlanSchema,
|