@htilabs/platform-common-models 0.23.0 → 0.25.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 +104 -0
- package/dist/authz/index.cjs +143 -12
- package/dist/authz/index.cjs.map +1 -1
- package/dist/authz/index.d.cts +121 -12
- package/dist/authz/index.d.ts +121 -12
- package/dist/authz/index.js +136 -12
- package/dist/authz/index.js.map +1 -1
- package/dist/constants/index.cjs +30 -0
- 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 +26 -0
- package/dist/constants/index.js.map +1 -1
- package/dist/{cvcEntry-0BIB9sen.d.cts → cvcEntry-Asg7mxjB.d.cts} +12 -9
- package/dist/{cvcEntry-0BIB9sen.d.ts → cvcEntry-Asg7mxjB.d.ts} +12 -9
- package/dist/{index-CDoqrfc1.d.ts → index-ClTjjJ_S.d.ts} +1 -1
- package/dist/{index-Zu_mOJRn.d.cts → index-Pt82NxQg.d.cts} +1 -1
- package/dist/index.cjs +604 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -5
- package/dist/index.d.ts +7 -5
- package/dist/index.js +577 -15
- package/dist/index.js.map +1 -1
- package/dist/information-scope/index.d.cts +3 -350
- package/dist/information-scope/index.d.ts +3 -350
- package/dist/informationScopeResolver-BzYu97DE.d.cts +351 -0
- package/dist/informationScopeResolver-BzYu97DE.d.ts +351 -0
- package/dist/models/index.cjs +26 -1
- package/dist/models/index.cjs.map +1 -1
- package/dist/models/index.d.cts +2 -2
- package/dist/models/index.d.ts +2 -2
- package/dist/models/index.js +26 -1
- package/dist/models/index.js.map +1 -1
- package/dist/{platform-auth-B49Ly57B.d.cts → platform-auth-DJO-r9Pf.d.cts} +48 -1
- package/dist/{platform-auth-B49Ly57B.d.ts → platform-auth-DJO-r9Pf.d.ts} +48 -1
- package/dist/schemas/index.cjs +26 -1
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +25 -25
- package/dist/schemas/index.d.ts +25 -25
- package/dist/schemas/index.js +26 -1
- package/dist/schemas/index.js.map +1 -1
- package/dist/services/index.cjs +26 -1
- package/dist/services/index.cjs.map +1 -1
- package/dist/services/index.d.cts +2 -1
- package/dist/services/index.d.ts +2 -1
- package/dist/services/index.js +26 -1
- package/dist/services/index.js.map +1 -1
- package/dist/sharing-ceiling/index.cjs +497 -0
- package/dist/sharing-ceiling/index.cjs.map +1 -0
- package/dist/sharing-ceiling/index.d.cts +318 -0
- package/dist/sharing-ceiling/index.d.ts +318 -0
- package/dist/sharing-ceiling/index.js +451 -0
- package/dist/sharing-ceiling/index.js.map +1 -0
- package/dist/types/index.d.cts +11 -3
- package/dist/types/index.d.ts +11 -3
- package/dist/validation/index.cjs +22 -0
- package/dist/validation/index.cjs.map +1 -1
- package/dist/validation/index.js +22 -0
- package/dist/validation/index.js.map +1 -1
- package/package.json +7 -1
- package/src/__sot__/README.md +2 -1
- package/src/__sot__/coreFunctionFields.ts +88 -4
- package/src/__sot__/coreFunctions.pin.json +1040 -113
- package/src/__sot__/sharingStarter.pin.json +229 -0
- package/src/__tests__/authz-resolve.test.ts +115 -31
- package/src/__tests__/core-function-default-bounds.test.ts +374 -0
- package/src/__tests__/core-functions-case-close.test.ts +82 -0
- package/src/__tests__/sharing-starter-canon.test.ts +178 -0
- package/src/authz/defaultBounds.ts +69 -0
- package/src/authz/index.ts +12 -3
- package/src/authz/resolveEffectiveFunctions.ts +69 -29
- package/src/constants/platform-auth.ts +60 -0
- package/src/generated/coreFunctionDefaultBounds.ts +109 -0
- package/src/generated/sharingPlatformStarter.ts +165 -0
- package/src/index.ts +5 -0
- package/src/schemas/platform-role.ts +4 -1
- package/src/sharingCeiling/__tests__/sharingCeiling.test.ts +678 -0
- package/src/sharingCeiling/chain.ts +269 -0
- package/src/sharingCeiling/coverage.ts +346 -0
- package/src/sharingCeiling/index.ts +14 -0
- package/src/sharingCeiling/starter.ts +89 -0
- package/src/types/platform-auth.ts +9 -2
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @htilabs/platform-common-models — the platform sharing starter (co-2sx)
|
|
3
|
+
*
|
|
4
|
+
* AUTO-GENERATED FILE — DO NOT EDIT BY HAND.
|
|
5
|
+
* Regenerate with:
|
|
6
|
+
* `python3 scripts/gen-sharing-starter.py <prototype root> <platform-prototype root>`.
|
|
7
|
+
*
|
|
8
|
+
* Canon (read from git objects at origin/main):
|
|
9
|
+
* - htilabstech/prototype HTI-LEADS-PAVE-Thread-prototype.html @ d85f05b7
|
|
10
|
+
* `HTI_SHARE_PLATFORM_STARTER` L326475-L326543
|
|
11
|
+
* (scopeVersion · scopeByPurpose · counterpartyOverrides);
|
|
12
|
+
* - htilabstech/platform-prototype src/data.js @ a6f1f3a5 (the contract of
|
|
13
|
+
* record, GDR § 5.79): `data.sharing.scopeByPurpose` /
|
|
14
|
+
* `counterpartyOverrides` L38170-L38190, and the
|
|
15
|
+
* platform purpose rows `sharing.purposes[].enabled`
|
|
16
|
+
* L32450-L32531;
|
|
17
|
+
* - htilabstech/prototype docs/share-roi/information_scope_v4.fields.csv @ d85f05b7: the distinct
|
|
18
|
+
* `row_v4` homes of its 517 fields (`fieldHomeRows`; the sentinel
|
|
19
|
+
* "rides with its record" is not a row and is left out).
|
|
20
|
+
* The two starter copies are equal (the generator refuses otherwise). GATE M
|
|
21
|
+
* (`src/__tests__/sharing-starter-canon.test.ts`) holds this module equal to
|
|
22
|
+
* `src/__sot__/sharingStarter.pin.json` and every code to a live, non-floor
|
|
23
|
+
* CVC-236 v4 row.
|
|
24
|
+
*
|
|
25
|
+
* CANON GAP: `counterpartyOverrides` is keyed by canon's DEMONSTRATION partner
|
|
26
|
+
* ids (palomar, okcpd, legal_aid_ok). No registry agency carries them, so the
|
|
27
|
+
* seeded-partner rung binds on no real data until the platform maps them.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/** Where this data was taken from (provenance, not compared by `--check`). */
|
|
31
|
+
export const SHARING_PLATFORM_STARTER_SOURCE = {
|
|
32
|
+
"monolith": {
|
|
33
|
+
"repo": "htilabstech/prototype",
|
|
34
|
+
"file": "HTI-LEADS-PAVE-Thread-prototype.html",
|
|
35
|
+
"sha": "d85f05b7",
|
|
36
|
+
"lines": [
|
|
37
|
+
326475,
|
|
38
|
+
326543
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
"mirror": {
|
|
42
|
+
"repo": "htilabstech/platform-prototype",
|
|
43
|
+
"file": "src/data.js",
|
|
44
|
+
"sha": "a6f1f3a5",
|
|
45
|
+
"starterLines": [
|
|
46
|
+
38170,
|
|
47
|
+
38190
|
|
48
|
+
],
|
|
49
|
+
"purposeLines": [
|
|
50
|
+
32450,
|
|
51
|
+
32531
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
"fieldPlacements": {
|
|
55
|
+
"repo": "htilabstech/prototype",
|
|
56
|
+
"file": "docs/share-roi/information_scope_v4.fields.csv",
|
|
57
|
+
"sha": "d85f05b7"
|
|
58
|
+
}
|
|
59
|
+
} as const;
|
|
60
|
+
|
|
61
|
+
// <generated-data>
|
|
62
|
+
export const SHARING_PLATFORM_STARTER_DATA = {
|
|
63
|
+
scopeVersion: 4,
|
|
64
|
+
scopeByPurpose: {
|
|
65
|
+
"referral": ["identifying", "contact", "services", "system", "summary_needs_assessment"],
|
|
66
|
+
"case_collaboration": ["identifying", "risk", "contact", "services", "notes", "system", "summary_initial_screen", "summary_lap", "summary_danger_assessment", "summary_stalking_assessment", "summary_injury_and_strangulation", "summary_ae_intake", "summary_tra", "summary_needs_assessment"],
|
|
67
|
+
"deconfliction": ["identifying", "system"],
|
|
68
|
+
"mandatory_reporting": ["identifying", "risk", "contact", "services", "notes", "system", "summary_initial_screen", "summary_lap", "summary_danger_assessment", "summary_stalking_assessment", "summary_injury_and_strangulation", "summary_ae_intake", "summary_tra", "summary_needs_assessment", "offenders.identifying", "offenders.risk", "relationships_household", "family"],
|
|
69
|
+
"discretionary_share": ["identifying", "system"],
|
|
70
|
+
"authority_reporting": ["identifying", "risk", "system", "summary_initial_screen", "summary_lap", "summary_danger_assessment", "summary_stalking_assessment", "summary_injury_and_strangulation", "summary_ae_intake", "summary_tra", "offenders.identifying", "offenders.risk", "relationships_household", "family"],
|
|
71
|
+
"automatic_account_share": ["identifying", "system"],
|
|
72
|
+
"records_request": ["identifying", "system"],
|
|
73
|
+
},
|
|
74
|
+
counterpartyOverrides: {
|
|
75
|
+
"palomar": {
|
|
76
|
+
"case_collaboration": ["identifying", "risk", "contact", "services", "notes", "health_accommodation", "system", "summary_initial_screen", "summary_lap", "summary_danger_assessment", "summary_stalking_assessment", "summary_injury_and_strangulation", "summary_ae_intake", "summary_tra", "summary_mental_health_screen", "summary_behavioral_health_intake", "summary_trauma_and_coping_screen", "summary_needs_assessment"],
|
|
77
|
+
},
|
|
78
|
+
"okcpd": {
|
|
79
|
+
"mandatory_reporting": ["identifying", "risk", "contact", "services", "notes", "system", "summary_initial_screen", "summary_lap", "summary_danger_assessment", "summary_stalking_assessment", "summary_injury_and_strangulation", "summary_ae_intake", "summary_tra", "summary_needs_assessment", "offenders.identifying", "offenders.risk", "relationships_household", "family"],
|
|
80
|
+
"referral": ["identifying", "contact", "services", "system", "summary_needs_assessment"],
|
|
81
|
+
},
|
|
82
|
+
"legal_aid_ok": {
|
|
83
|
+
"referral": ["identifying", "contact", "services", "notes", "system", "summary_needs_assessment"],
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
purposeEnabled: {
|
|
87
|
+
"referral": true,
|
|
88
|
+
"case_collaboration": true,
|
|
89
|
+
"deconfliction": true,
|
|
90
|
+
"mandatory_reporting": true,
|
|
91
|
+
"discretionary_share": true,
|
|
92
|
+
"authority_reporting": true,
|
|
93
|
+
"automatic_account_share": true,
|
|
94
|
+
"records_request": false,
|
|
95
|
+
},
|
|
96
|
+
fieldHomeRows: [
|
|
97
|
+
"accommodation_needs",
|
|
98
|
+
"ad_content",
|
|
99
|
+
"additional_ids",
|
|
100
|
+
"addresses",
|
|
101
|
+
"case_attachments",
|
|
102
|
+
"case_determinations",
|
|
103
|
+
"case_lifecycle",
|
|
104
|
+
"case_notes",
|
|
105
|
+
"commercial_activity",
|
|
106
|
+
"contact_info",
|
|
107
|
+
"demographics",
|
|
108
|
+
"derived_risk_signals",
|
|
109
|
+
"dob",
|
|
110
|
+
"encounter_location",
|
|
111
|
+
"family.health_accommodation",
|
|
112
|
+
"family.identifying",
|
|
113
|
+
"family.risk",
|
|
114
|
+
"full_ae_intake",
|
|
115
|
+
"full_behavioral_health_intake",
|
|
116
|
+
"full_danger_assessment",
|
|
117
|
+
"full_findings",
|
|
118
|
+
"full_hope_scale",
|
|
119
|
+
"full_ida",
|
|
120
|
+
"full_initial_screen",
|
|
121
|
+
"full_injury_and_strangulation",
|
|
122
|
+
"full_lap",
|
|
123
|
+
"full_mental_health_screen",
|
|
124
|
+
"full_needs_assessment",
|
|
125
|
+
"full_stalking_assessment",
|
|
126
|
+
"full_tra",
|
|
127
|
+
"full_trauma_and_coping_screen",
|
|
128
|
+
"health_status",
|
|
129
|
+
"identifying",
|
|
130
|
+
"immigration_applications",
|
|
131
|
+
"immigration_status",
|
|
132
|
+
"instruments",
|
|
133
|
+
"names",
|
|
134
|
+
"network_membership",
|
|
135
|
+
"object_identity_attributes",
|
|
136
|
+
"offenders.risk",
|
|
137
|
+
"others.risk",
|
|
138
|
+
"persona_links",
|
|
139
|
+
"phone_identifiers",
|
|
140
|
+
"plans_goals",
|
|
141
|
+
"priorities_safety",
|
|
142
|
+
"relationships_household",
|
|
143
|
+
"screen_indicators",
|
|
144
|
+
"service_history",
|
|
145
|
+
"session_summary",
|
|
146
|
+
"summary_ae_intake",
|
|
147
|
+
"summary_behavioral_health_intake",
|
|
148
|
+
"summary_danger_assessment",
|
|
149
|
+
"summary_findings",
|
|
150
|
+
"summary_hope_scale",
|
|
151
|
+
"summary_ida",
|
|
152
|
+
"summary_initial_screen",
|
|
153
|
+
"summary_injury_and_strangulation",
|
|
154
|
+
"summary_lap",
|
|
155
|
+
"summary_mental_health_screen",
|
|
156
|
+
"summary_needs_assessment",
|
|
157
|
+
"summary_stalking_assessment",
|
|
158
|
+
"summary_tra",
|
|
159
|
+
"summary_trauma_and_coping_screen",
|
|
160
|
+
"system",
|
|
161
|
+
"system_involvement",
|
|
162
|
+
"victimization",
|
|
163
|
+
],
|
|
164
|
+
} as const;
|
|
165
|
+
// </generated-data>
|
package/src/index.ts
CHANGED
|
@@ -56,6 +56,11 @@ export * from "./services/index.js";
|
|
|
56
56
|
// consumers import it from the `@htilabs/platform-common-models/authz` subpath.
|
|
57
57
|
export * from "./authz/index.js";
|
|
58
58
|
|
|
59
|
+
// Inter-Agency Sharing ceiling on the CVC-236 v4 tree (pure; no mongoose, no
|
|
60
|
+
// I/O). Browser consumers import it from the
|
|
61
|
+
// `@htilabs/platform-common-models/sharing-ceiling` subpath.
|
|
62
|
+
export * from "./sharingCeiling/index.js";
|
|
63
|
+
|
|
59
64
|
// ─── CVC validation surface (Zod schemas + inferred types) ──────────────────
|
|
60
65
|
// Per co-am3.7 (Phase 1.7) bead: re-export the Zod schemas, plus the inferred
|
|
61
66
|
// scalar types and `CvcDomain`. The Zod-inferred entry shape is exposed via
|
|
@@ -52,7 +52,10 @@ export const platformRoleSchemaDefinition = {
|
|
|
52
52
|
type: Boolean,
|
|
53
53
|
default: false,
|
|
54
54
|
},
|
|
55
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* Dynamic map of functionCode → DefaultBoundStateValue (a PERMISSION_STATE
|
|
57
|
+
* value or the codebook's `NA`); an unlisted function is unbound.
|
|
58
|
+
*/
|
|
56
59
|
functions: {
|
|
57
60
|
type: Schema.Types.Mixed,
|
|
58
61
|
default: {},
|