@htilabs/platform-common-models 0.5.3-beta.4 → 0.7.0-beta.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 +44 -0
- package/dist/config/index.cjs +191 -0
- package/dist/config/index.cjs.map +1 -0
- package/dist/config/index.d.cts +101 -0
- package/dist/config/index.d.ts +101 -0
- package/dist/config/index.js +165 -0
- package/dist/config/index.js.map +1 -0
- package/dist/constants/index.cjs +46 -5
- package/dist/constants/index.cjs.map +1 -1
- package/dist/constants/index.d.cts +1 -1
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/index.js +42 -5
- package/dist/constants/index.js.map +1 -1
- package/dist/cvcs/index.cjs +6874 -2
- package/dist/cvcs/index.cjs.map +1 -1
- package/dist/cvcs/index.d.cts +7562 -66
- package/dist/cvcs/index.d.ts +7562 -66
- package/dist/cvcs/index.js +6833 -1
- package/dist/cvcs/index.js.map +1 -1
- package/dist/index.cjs +7742 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1009 -3
- package/dist/index.d.ts +1009 -3
- package/dist/index.js +7656 -6
- package/dist/index.js.map +1 -1
- package/dist/{platform-auth-CjC57132.d.cts → platform-auth-C97LpsRd.d.cts} +8 -4
- package/dist/{platform-auth-CjC57132.d.ts → platform-auth-C97LpsRd.d.ts} +8 -4
- package/dist/schemas/index.cjs +43 -6
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +4 -0
- package/dist/schemas/index.d.ts +4 -0
- package/dist/schemas/index.js +43 -6
- package/dist/schemas/index.js.map +1 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/package.json +9 -2
- package/src/__tests__/__snapshots__/cvc-sot.snap +160 -0
- package/src/__tests__/cvc-sot-snapshot.test.ts +319 -0
- package/src/__tests__/cvc-structural.test.ts +40 -0
- package/src/__tests__/runtime-contract-validator.test.ts +556 -0
- package/src/config/fixtures/valid.yaml +90 -0
- package/src/config/index.ts +352 -0
- package/src/constants/ic.ts +49 -6
- package/src/cvcs/administeringJurisdiction.v1.0.0.json +105 -0
- package/src/cvcs/ageBinReporting.v1.0.0.json +114 -0
- package/src/cvcs/contactInfoTypes.v1.0.0.json +250 -0
- package/src/cvcs/contactSafetyStatus.v1.0.0.json +69 -0
- package/src/cvcs/employmentStatus.v1.0.0.json +302 -0
- package/src/cvcs/enrollmentApplicationStatus.v1.0.0.json +123 -0
- package/src/cvcs/eyeColor.v1.0.0.json +114 -0
- package/src/cvcs/facilitatorEntityType.v1.0.0.json +141 -0
- package/src/cvcs/facilitatorLabelUsedInSource.v1.0.0.json +159 -0
- package/src/cvcs/facilitatorSubrole.v1.0.0.json +381 -0
- package/src/cvcs/frequencyCadence.v1.0.0.json +114 -0
- package/src/cvcs/genderIdentity.v1.0.0.json +128 -0
- package/src/cvcs/hairColor.v1.0.0.json +105 -0
- package/src/cvcs/hasTattoos.v1.0.0.json +69 -0
- package/src/cvcs/highestEducationLevelCompleted.v1.0.0.json +124 -0
- package/src/cvcs/hmisSex.v1.0.0.json +89 -0
- package/src/cvcs/homelessStatus.v1.0.0.json +98 -0
- package/src/cvcs/incomeBenefitsSources.v1.0.0.json +392 -0
- package/src/cvcs/index.ts +80 -0
- package/src/cvcs/juvenileJusticeEpisodeType.v1.0.0.json +96 -0
- package/src/cvcs/juvenileJusticeInvolvementStatus.v1.0.0.json +78 -0
- package/src/cvcs/locationType.v1.0.0.json +168 -0
- package/src/cvcs/maritalStatusLegal.v1.0.0.json +96 -0
- package/src/cvcs/militaryBranch.v1.0.0.json +85 -0
- package/src/cvcs/militaryStatus.v1.0.0.json +67 -0
- package/src/cvcs/nameType.v1.0.0.json +123 -0
- package/src/cvcs/offenderStatus.v1.0.0.json +96 -0
- package/src/cvcs/offenderStatusFamily.v1.0.0.json +87 -0
- package/src/cvcs/orientationIdentity.v1.0.0.json +97 -0
- package/src/cvcs/personRelationships.v1.0.0.json +924 -0
- package/src/cvcs/preferredContactMethod.v1.0.0.json +46 -0
- package/src/cvcs/pronouns.v1.0.0.json +87 -0
- package/src/cvcs/recencyBand.v1.0.0.json +124 -0
- package/src/cvcs/referralEntityCategory.v1.0.0.json +439 -0
- package/src/cvcs/relationshipStatusCurrent.v1.0.0.json +69 -0
- package/src/cvcs/relationshipTies.v1.0.0.json +291 -0
- package/src/cvcs/sexProviderSubrole.v1.0.0.json +78 -0
- package/src/cvcs/sharePurpose.v1.0.0.json +82 -0
- package/src/cvcs/smtType.v1.0.0.json +114 -0
- package/src/cvcs/tribes.v1.0.0.json +492 -0
- package/src/cvcs/victimStatusFamily.v1.0.0.json +96 -0
- package/src/generated/cvc-enums.ts +1048 -0
- package/src/index.ts +20 -0
- package/src/schemas/common.ts +4 -0
package/src/index.ts
CHANGED
|
@@ -88,3 +88,23 @@ export { compileModel as compileCvcEntryModel } from "./models/cvcEntryModel.js"
|
|
|
88
88
|
// filesystem access. See `./cvcs/index.ts` for the full list and naming.
|
|
89
89
|
|
|
90
90
|
export * from "./cvcs/index.js";
|
|
91
|
+
|
|
92
|
+
// ─── SOT-first CVC flat-array aliases ───────────────────────────────────────
|
|
93
|
+
// Legacy-shaped `CVC_<N>_VALUES` arrays for CVCs that are SOT-native (no
|
|
94
|
+
// ic.ts constants). Derived from the SOT JSON envelope's `entries` filtered
|
|
95
|
+
// to `selectable: true` so the SOT JSON remains the single source of truth
|
|
96
|
+
// AND the non-selectable `missingness_root` grouping code is excluded (it
|
|
97
|
+
// would otherwise fail schema enum validation on write).
|
|
98
|
+
|
|
99
|
+
import recencyBandSot from "./cvcs/recencyBand.v1.0.0.json" with { type: "json" };
|
|
100
|
+
import juvenileJusticeEpisodeTypeSot from "./cvcs/juvenileJusticeEpisodeType.v1.0.0.json" with { type: "json" };
|
|
101
|
+
|
|
102
|
+
const selectableCodes = (envelope: {
|
|
103
|
+
entries: ReadonlyArray<{ code: string; selectable: boolean }>;
|
|
104
|
+
}): string[] =>
|
|
105
|
+
envelope.entries.filter((e) => e.selectable).map((e) => e.code);
|
|
106
|
+
|
|
107
|
+
export const CVC_137_VALUES: string[] = selectableCodes(recencyBandSot);
|
|
108
|
+
export const CVC_197_VALUES: string[] = selectableCodes(
|
|
109
|
+
juvenileJusticeEpisodeTypeSot,
|
|
110
|
+
);
|
package/src/schemas/common.ts
CHANGED
|
@@ -42,6 +42,10 @@ export const personNameSchema = new Schema(
|
|
|
42
42
|
alias: Boolean,
|
|
43
43
|
isUnknown: Boolean,
|
|
44
44
|
isAnonymous: Boolean,
|
|
45
|
+
// Shape flag: this person has only one name (e.g., Madonna). A mononym
|
|
46
|
+
// can itself be legal, a nickname, a trade name, etc. — it's orthogonal
|
|
47
|
+
// to nameType, not a value of it.
|
|
48
|
+
isMononym: Boolean,
|
|
45
49
|
},
|
|
46
50
|
{ _id: false },
|
|
47
51
|
);
|