@htilabs/platform-common-models 0.23.0 → 0.24.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.
Files changed (61) hide show
  1. package/README.md +39 -0
  2. package/dist/authz/index.cjs +143 -12
  3. package/dist/authz/index.cjs.map +1 -1
  4. package/dist/authz/index.d.cts +121 -12
  5. package/dist/authz/index.d.ts +121 -12
  6. package/dist/authz/index.js +136 -12
  7. package/dist/authz/index.js.map +1 -1
  8. package/dist/constants/index.cjs +30 -0
  9. package/dist/constants/index.cjs.map +1 -1
  10. package/dist/constants/index.d.cts +1 -1
  11. package/dist/constants/index.d.ts +1 -1
  12. package/dist/constants/index.js +26 -0
  13. package/dist/constants/index.js.map +1 -1
  14. package/dist/{cvcEntry-0BIB9sen.d.cts → cvcEntry-BqAGctqK.d.cts} +4 -1
  15. package/dist/{cvcEntry-0BIB9sen.d.ts → cvcEntry-BqAGctqK.d.ts} +4 -1
  16. package/dist/{index-Zu_mOJRn.d.cts → index-BTqHP4DM.d.cts} +1 -1
  17. package/dist/{index-CDoqrfc1.d.ts → index-Dr6GBCoY.d.ts} +1 -1
  18. package/dist/index.cjs +147 -13
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.cts +4 -4
  21. package/dist/index.d.ts +4 -4
  22. package/dist/index.js +140 -13
  23. package/dist/index.js.map +1 -1
  24. package/dist/models/index.cjs +26 -1
  25. package/dist/models/index.cjs.map +1 -1
  26. package/dist/models/index.d.cts +2 -2
  27. package/dist/models/index.d.ts +2 -2
  28. package/dist/models/index.js +26 -1
  29. package/dist/models/index.js.map +1 -1
  30. package/dist/{platform-auth-B49Ly57B.d.cts → platform-auth-DJO-r9Pf.d.cts} +48 -1
  31. package/dist/{platform-auth-B49Ly57B.d.ts → platform-auth-DJO-r9Pf.d.ts} +48 -1
  32. package/dist/schemas/index.cjs +26 -1
  33. package/dist/schemas/index.cjs.map +1 -1
  34. package/dist/schemas/index.d.cts +1 -1
  35. package/dist/schemas/index.d.ts +1 -1
  36. package/dist/schemas/index.js +26 -1
  37. package/dist/schemas/index.js.map +1 -1
  38. package/dist/services/index.cjs +26 -1
  39. package/dist/services/index.cjs.map +1 -1
  40. package/dist/services/index.js +26 -1
  41. package/dist/services/index.js.map +1 -1
  42. package/dist/types/index.d.cts +11 -3
  43. package/dist/types/index.d.ts +11 -3
  44. package/dist/validation/index.cjs +22 -0
  45. package/dist/validation/index.cjs.map +1 -1
  46. package/dist/validation/index.js +22 -0
  47. package/dist/validation/index.js.map +1 -1
  48. package/package.json +1 -1
  49. package/src/__sot__/README.md +1 -1
  50. package/src/__sot__/coreFunctionFields.ts +88 -4
  51. package/src/__sot__/coreFunctions.pin.json +1040 -113
  52. package/src/__tests__/authz-resolve.test.ts +115 -31
  53. package/src/__tests__/core-function-default-bounds.test.ts +374 -0
  54. package/src/__tests__/core-functions-case-close.test.ts +82 -0
  55. package/src/authz/defaultBounds.ts +69 -0
  56. package/src/authz/index.ts +12 -3
  57. package/src/authz/resolveEffectiveFunctions.ts +69 -29
  58. package/src/constants/platform-auth.ts +60 -0
  59. package/src/generated/coreFunctionDefaultBounds.ts +109 -0
  60. package/src/schemas/platform-role.ts +4 -1
  61. package/src/types/platform-auth.ts +9 -2
@@ -1,5 +1,6 @@
1
1
  export { j as AccommodationValue, m as AgeBinReportingValue, n as AppScopeValue, o as ApparentAgeValue, cw as DataQualityValue, cD as FormStatusValue, cE as FormTypeValue, cF as IC13Category, cH as IC13Value, cI as IC22Value, cJ as IC23Value, cK as IC24Value, cL as IC25Value, cM as IC49ReferralOutcomeValue, cN as IC49ReferralVerificationValue, cO as IC49Value, cP as IC4Value, cR as IC56Value, cS as IC57Value, cU as IC58Value, cV as IC59Value, cW as IC5Value, dM as IncidentInvolvementRoleValue, dN as IncidentParticipationRoleValue, dO as InteractionTypeValue, dR as MinorAdultStatusValue, dZ as PersonDisplayCategoryValue, d_ as PersonRoleValue, d$ as PersonTypeValue, e5 as QuestionFormatValue, e6 as QuickStartTemplateId, ef as RecordStateValue, eh as RelationshipConcernValue, ei as RelationshipDynamicValue, ep as SessionStateValue, eq as SubmissionStateValue, eu as UserStatusValue } from '../ic-DpKrdgQP.cjs';
2
- import { k as PlatformToolValue, c as FunctionStatusValue, n as RoleLevelValue, q as ShareViewValue, j as PermissionStateValue } from '../platform-auth-B49Ly57B.cjs';
2
+ import { o as PlatformToolValue, g as FunctionStatusValue, r as RoleLevelValue, u as ShareViewValue, d as DefaultBoundStateValue } from '../platform-auth-DJO-r9Pf.cjs';
3
+ export { n as PermissionStateValue } from '../platform-auth-DJO-r9Pf.cjs';
3
4
 
4
5
  /**
5
6
  * @htilabs/platform-common-models — Platform Authorization Types
@@ -38,8 +39,15 @@ interface PlatformRoleDef {
38
39
  shareView: ShareViewValue | null;
39
40
  trainingRequirements: string | null;
40
41
  isHtiOnly: boolean;
41
- functions: Record<string, PermissionStateValue>;
42
+ /**
43
+ * Tier-1 state per function code. A PERMISSION_STATE value, or the codebook's
44
+ * `NA` ("Not relevant", since 0.24.0 — seeded from
45
+ * `CORE_FUNCTION_DEFAULT_BOUNDS`). An unlisted function is UNBOUND: the
46
+ * shared resolver treats the role as ineligible for it, and reads `NA` as
47
+ * NEVER. Label it with `DEFAULT_BOUND_STATE_LABELS` / `_DISPLAY`.
48
+ */
49
+ functions: Record<string, DefaultBoundStateValue>;
42
50
  sortOrder: number;
43
51
  }
44
52
 
45
- export { FunctionStatusValue, PermissionStateValue, type PlatformFunctionDef, type PlatformRoleDef, PlatformToolValue, RoleLevelValue, ShareViewValue };
53
+ export { FunctionStatusValue, type PlatformFunctionDef, type PlatformRoleDef, PlatformToolValue, RoleLevelValue, ShareViewValue };
@@ -1,5 +1,6 @@
1
1
  export { j as AccommodationValue, m as AgeBinReportingValue, n as AppScopeValue, o as ApparentAgeValue, cw as DataQualityValue, cD as FormStatusValue, cE as FormTypeValue, cF as IC13Category, cH as IC13Value, cI as IC22Value, cJ as IC23Value, cK as IC24Value, cL as IC25Value, cM as IC49ReferralOutcomeValue, cN as IC49ReferralVerificationValue, cO as IC49Value, cP as IC4Value, cR as IC56Value, cS as IC57Value, cU as IC58Value, cV as IC59Value, cW as IC5Value, dM as IncidentInvolvementRoleValue, dN as IncidentParticipationRoleValue, dO as InteractionTypeValue, dR as MinorAdultStatusValue, dZ as PersonDisplayCategoryValue, d_ as PersonRoleValue, d$ as PersonTypeValue, e5 as QuestionFormatValue, e6 as QuickStartTemplateId, ef as RecordStateValue, eh as RelationshipConcernValue, ei as RelationshipDynamicValue, ep as SessionStateValue, eq as SubmissionStateValue, eu as UserStatusValue } from '../ic-DpKrdgQP.js';
2
- import { k as PlatformToolValue, c as FunctionStatusValue, n as RoleLevelValue, q as ShareViewValue, j as PermissionStateValue } from '../platform-auth-B49Ly57B.js';
2
+ import { o as PlatformToolValue, g as FunctionStatusValue, r as RoleLevelValue, u as ShareViewValue, d as DefaultBoundStateValue } from '../platform-auth-DJO-r9Pf.js';
3
+ export { n as PermissionStateValue } from '../platform-auth-DJO-r9Pf.js';
3
4
 
4
5
  /**
5
6
  * @htilabs/platform-common-models — Platform Authorization Types
@@ -38,8 +39,15 @@ interface PlatformRoleDef {
38
39
  shareView: ShareViewValue | null;
39
40
  trainingRequirements: string | null;
40
41
  isHtiOnly: boolean;
41
- functions: Record<string, PermissionStateValue>;
42
+ /**
43
+ * Tier-1 state per function code. A PERMISSION_STATE value, or the codebook's
44
+ * `NA` ("Not relevant", since 0.24.0 — seeded from
45
+ * `CORE_FUNCTION_DEFAULT_BOUNDS`). An unlisted function is UNBOUND: the
46
+ * shared resolver treats the role as ineligible for it, and reads `NA` as
47
+ * NEVER. Label it with `DEFAULT_BOUND_STATE_LABELS` / `_DISPLAY`.
48
+ */
49
+ functions: Record<string, DefaultBoundStateValue>;
42
50
  sortOrder: number;
43
51
  }
44
52
 
45
- export { FunctionStatusValue, PermissionStateValue, type PlatformFunctionDef, type PlatformRoleDef, PlatformToolValue, RoleLevelValue, ShareViewValue };
53
+ export { FunctionStatusValue, type PlatformFunctionDef, type PlatformRoleDef, PlatformToolValue, RoleLevelValue, ShareViewValue };
@@ -367,6 +367,28 @@ var PERMISSION_STATE_DISPLAY = {
367
367
  icon: "\u{1F512}"
368
368
  }
369
369
  };
370
+ var DEFAULT_BOUND_STATE = {
371
+ ...PERMISSION_STATE,
372
+ /** Not relevant — canon's `not_applicable_roles` for this function. */
373
+ NA: "NA"
374
+ };
375
+ var DEFAULT_BOUND_STATE_VALUES = [
376
+ ...PERMISSION_STATE_VALUES,
377
+ DEFAULT_BOUND_STATE.NA
378
+ ];
379
+ var DEFAULT_BOUND_STATE_LABELS = {
380
+ ...PERMISSION_STATE_LABELS,
381
+ [DEFAULT_BOUND_STATE.NA]: "Not relevant"
382
+ };
383
+ var DEFAULT_BOUND_STATE_DISPLAY = {
384
+ ...PERMISSION_STATE_DISPLAY,
385
+ [DEFAULT_BOUND_STATE.NA]: {
386
+ label: "Not relevant",
387
+ color: "#616161",
388
+ bgColor: "#f5f5f5",
389
+ icon: "\u25CC"
390
+ }
391
+ };
370
392
  var SHARE_VIEW = {
371
393
  /** System metadata only (partial access). */
372
394
  SYS_INFO: "sys_info",