@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.
Files changed (82) hide show
  1. package/README.md +104 -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-Asg7mxjB.d.cts} +12 -9
  15. package/dist/{cvcEntry-0BIB9sen.d.ts → cvcEntry-Asg7mxjB.d.ts} +12 -9
  16. package/dist/{index-CDoqrfc1.d.ts → index-ClTjjJ_S.d.ts} +1 -1
  17. package/dist/{index-Zu_mOJRn.d.cts → index-Pt82NxQg.d.cts} +1 -1
  18. package/dist/index.cjs +604 -15
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.cts +7 -5
  21. package/dist/index.d.ts +7 -5
  22. package/dist/index.js +577 -15
  23. package/dist/index.js.map +1 -1
  24. package/dist/information-scope/index.d.cts +3 -350
  25. package/dist/information-scope/index.d.ts +3 -350
  26. package/dist/informationScopeResolver-BzYu97DE.d.cts +351 -0
  27. package/dist/informationScopeResolver-BzYu97DE.d.ts +351 -0
  28. package/dist/models/index.cjs +26 -1
  29. package/dist/models/index.cjs.map +1 -1
  30. package/dist/models/index.d.cts +2 -2
  31. package/dist/models/index.d.ts +2 -2
  32. package/dist/models/index.js +26 -1
  33. package/dist/models/index.js.map +1 -1
  34. package/dist/{platform-auth-B49Ly57B.d.cts → platform-auth-DJO-r9Pf.d.cts} +48 -1
  35. package/dist/{platform-auth-B49Ly57B.d.ts → platform-auth-DJO-r9Pf.d.ts} +48 -1
  36. package/dist/schemas/index.cjs +26 -1
  37. package/dist/schemas/index.cjs.map +1 -1
  38. package/dist/schemas/index.d.cts +25 -25
  39. package/dist/schemas/index.d.ts +25 -25
  40. package/dist/schemas/index.js +26 -1
  41. package/dist/schemas/index.js.map +1 -1
  42. package/dist/services/index.cjs +26 -1
  43. package/dist/services/index.cjs.map +1 -1
  44. package/dist/services/index.d.cts +2 -1
  45. package/dist/services/index.d.ts +2 -1
  46. package/dist/services/index.js +26 -1
  47. package/dist/services/index.js.map +1 -1
  48. package/dist/sharing-ceiling/index.cjs +497 -0
  49. package/dist/sharing-ceiling/index.cjs.map +1 -0
  50. package/dist/sharing-ceiling/index.d.cts +318 -0
  51. package/dist/sharing-ceiling/index.d.ts +318 -0
  52. package/dist/sharing-ceiling/index.js +451 -0
  53. package/dist/sharing-ceiling/index.js.map +1 -0
  54. package/dist/types/index.d.cts +11 -3
  55. package/dist/types/index.d.ts +11 -3
  56. package/dist/validation/index.cjs +22 -0
  57. package/dist/validation/index.cjs.map +1 -1
  58. package/dist/validation/index.js +22 -0
  59. package/dist/validation/index.js.map +1 -1
  60. package/package.json +7 -1
  61. package/src/__sot__/README.md +2 -1
  62. package/src/__sot__/coreFunctionFields.ts +88 -4
  63. package/src/__sot__/coreFunctions.pin.json +1040 -113
  64. package/src/__sot__/sharingStarter.pin.json +229 -0
  65. package/src/__tests__/authz-resolve.test.ts +115 -31
  66. package/src/__tests__/core-function-default-bounds.test.ts +374 -0
  67. package/src/__tests__/core-functions-case-close.test.ts +82 -0
  68. package/src/__tests__/sharing-starter-canon.test.ts +178 -0
  69. package/src/authz/defaultBounds.ts +69 -0
  70. package/src/authz/index.ts +12 -3
  71. package/src/authz/resolveEffectiveFunctions.ts +69 -29
  72. package/src/constants/platform-auth.ts +60 -0
  73. package/src/generated/coreFunctionDefaultBounds.ts +109 -0
  74. package/src/generated/sharingPlatformStarter.ts +165 -0
  75. package/src/index.ts +5 -0
  76. package/src/schemas/platform-role.ts +4 -1
  77. package/src/sharingCeiling/__tests__/sharingCeiling.test.ts +678 -0
  78. package/src/sharingCeiling/chain.ts +269 -0
  79. package/src/sharingCeiling/coverage.ts +346 -0
  80. package/src/sharingCeiling/index.ts +14 -0
  81. package/src/sharingCeiling/starter.ts +89 -0
  82. package/src/types/platform-auth.ts +9 -2
@@ -233,18 +233,18 @@ type SectionQuestionRef = InferRawDocType<typeof sectionQuestionRefSchema>;
233
233
  declare const guidanceSchema: Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
234
234
  _id: false;
235
235
  }, {
236
- type: "tip" | "warning" | "prompt";
237
236
  text: string;
238
- }, mongoose.Document<unknown, {}, {
239
237
  type: "tip" | "warning" | "prompt";
238
+ }, mongoose.Document<unknown, {}, {
240
239
  text: string;
240
+ type: "tip" | "warning" | "prompt";
241
241
  }, {
242
242
  id: string;
243
243
  }, Omit<mongoose.DefaultSchemaOptions, "_id"> & {
244
244
  _id: false;
245
245
  }> & Omit<{
246
- type: "tip" | "warning" | "prompt";
247
246
  text: string;
247
+ type: "tip" | "warning" | "prompt";
248
248
  } & {
249
249
  _id: mongoose.Types.ObjectId;
250
250
  } & {
@@ -252,8 +252,8 @@ declare const guidanceSchema: Schema<any, mongoose.Model<any, any, any, any, any
252
252
  }, "id"> & {
253
253
  id: string;
254
254
  }, unknown, {
255
- type: "tip" | "warning" | "prompt";
256
255
  text: string;
256
+ type: "tip" | "warning" | "prompt";
257
257
  } & {
258
258
  _id: mongoose.Types.ObjectId;
259
259
  } & {
@@ -294,18 +294,18 @@ declare const sectionSchemaDefinition: {
294
294
  type: Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
295
295
  _id: false;
296
296
  }, {
297
- type: "tip" | "warning" | "prompt";
298
297
  text: string;
299
- }, mongoose.Document<unknown, {}, {
300
298
  type: "tip" | "warning" | "prompt";
299
+ }, mongoose.Document<unknown, {}, {
301
300
  text: string;
301
+ type: "tip" | "warning" | "prompt";
302
302
  }, {
303
303
  id: string;
304
304
  }, Omit<mongoose.DefaultSchemaOptions, "_id"> & {
305
305
  _id: false;
306
306
  }> & Omit<{
307
- type: "tip" | "warning" | "prompt";
308
307
  text: string;
308
+ type: "tip" | "warning" | "prompt";
309
309
  } & {
310
310
  _id: mongoose.Types.ObjectId;
311
311
  } & {
@@ -313,8 +313,8 @@ declare const sectionSchemaDefinition: {
313
313
  }, "id"> & {
314
314
  id: string;
315
315
  }, unknown, {
316
- type: "tip" | "warning" | "prompt";
317
316
  text: string;
317
+ type: "tip" | "warning" | "prompt";
318
318
  } & {
319
319
  _id: mongoose.Types.ObjectId;
320
320
  } & {
@@ -1299,7 +1299,10 @@ declare const platformRoleSchemaDefinition: {
1299
1299
  type: BooleanConstructor;
1300
1300
  default: boolean;
1301
1301
  };
1302
- /** Dynamic map of functionCode → PermissionStateValue. */
1302
+ /**
1303
+ * Dynamic map of functionCode → DefaultBoundStateValue (a PERMISSION_STATE
1304
+ * value or the codebook's `NA`); an unlisted function is unbound.
1305
+ */
1303
1306
  functions: {
1304
1307
  type: typeof Schema.Types.Mixed;
1305
1308
  default: {};
@@ -233,18 +233,18 @@ type SectionQuestionRef = InferRawDocType<typeof sectionQuestionRefSchema>;
233
233
  declare const guidanceSchema: Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
234
234
  _id: false;
235
235
  }, {
236
- type: "tip" | "warning" | "prompt";
237
236
  text: string;
238
- }, mongoose.Document<unknown, {}, {
239
237
  type: "tip" | "warning" | "prompt";
238
+ }, mongoose.Document<unknown, {}, {
240
239
  text: string;
240
+ type: "tip" | "warning" | "prompt";
241
241
  }, {
242
242
  id: string;
243
243
  }, Omit<mongoose.DefaultSchemaOptions, "_id"> & {
244
244
  _id: false;
245
245
  }> & Omit<{
246
- type: "tip" | "warning" | "prompt";
247
246
  text: string;
247
+ type: "tip" | "warning" | "prompt";
248
248
  } & {
249
249
  _id: mongoose.Types.ObjectId;
250
250
  } & {
@@ -252,8 +252,8 @@ declare const guidanceSchema: Schema<any, mongoose.Model<any, any, any, any, any
252
252
  }, "id"> & {
253
253
  id: string;
254
254
  }, unknown, {
255
- type: "tip" | "warning" | "prompt";
256
255
  text: string;
256
+ type: "tip" | "warning" | "prompt";
257
257
  } & {
258
258
  _id: mongoose.Types.ObjectId;
259
259
  } & {
@@ -294,18 +294,18 @@ declare const sectionSchemaDefinition: {
294
294
  type: Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
295
295
  _id: false;
296
296
  }, {
297
- type: "tip" | "warning" | "prompt";
298
297
  text: string;
299
- }, mongoose.Document<unknown, {}, {
300
298
  type: "tip" | "warning" | "prompt";
299
+ }, mongoose.Document<unknown, {}, {
301
300
  text: string;
301
+ type: "tip" | "warning" | "prompt";
302
302
  }, {
303
303
  id: string;
304
304
  }, Omit<mongoose.DefaultSchemaOptions, "_id"> & {
305
305
  _id: false;
306
306
  }> & Omit<{
307
- type: "tip" | "warning" | "prompt";
308
307
  text: string;
308
+ type: "tip" | "warning" | "prompt";
309
309
  } & {
310
310
  _id: mongoose.Types.ObjectId;
311
311
  } & {
@@ -313,8 +313,8 @@ declare const sectionSchemaDefinition: {
313
313
  }, "id"> & {
314
314
  id: string;
315
315
  }, unknown, {
316
- type: "tip" | "warning" | "prompt";
317
316
  text: string;
317
+ type: "tip" | "warning" | "prompt";
318
318
  } & {
319
319
  _id: mongoose.Types.ObjectId;
320
320
  } & {
@@ -1299,7 +1299,10 @@ declare const platformRoleSchemaDefinition: {
1299
1299
  type: BooleanConstructor;
1300
1300
  default: boolean;
1301
1301
  };
1302
- /** Dynamic map of functionCode → PermissionStateValue. */
1302
+ /**
1303
+ * Dynamic map of functionCode → DefaultBoundStateValue (a PERMISSION_STATE
1304
+ * value or the codebook's `NA`); an unlisted function is unbound.
1305
+ */
1303
1306
  functions: {
1304
1307
  type: typeof Schema.Types.Mixed;
1305
1308
  default: {};
@@ -1,4 +1,4 @@
1
- import { F as Form, l as buildFormSchema, h as Section, q as buildSectionSchema, Q as Question, o as buildQuestionSchema, f as ScoringRule, p as buildScoringRuleSchema, P as PlatformFunction, m as buildPlatformFunctionSchema, d as PlatformRole, n as buildPlatformRoleSchema, b as CvcRegistry, k as buildCvcRegistrySchema, a as CvcEntry, j as buildCvcEntrySchema } from './cvcEntry-0BIB9sen.js';
1
+ import { F as Form, l as buildFormSchema, h as Section, q as buildSectionSchema, Q as Question, o as buildQuestionSchema, f as ScoringRule, p as buildScoringRuleSchema, P as PlatformFunction, m as buildPlatformFunctionSchema, d as PlatformRole, n as buildPlatformRoleSchema, b as CvcRegistry, k as buildCvcRegistrySchema, a as CvcEntry, j as buildCvcEntrySchema } from './cvcEntry-Asg7mxjB.js';
2
2
  import * as mongoose from 'mongoose';
3
3
  import { HydratedDocument, Connection, Model } from 'mongoose';
4
4
 
@@ -1,4 +1,4 @@
1
- import { F as Form, l as buildFormSchema, h as Section, q as buildSectionSchema, Q as Question, o as buildQuestionSchema, f as ScoringRule, p as buildScoringRuleSchema, P as PlatformFunction, m as buildPlatformFunctionSchema, d as PlatformRole, n as buildPlatformRoleSchema, b as CvcRegistry, k as buildCvcRegistrySchema, a as CvcEntry, j as buildCvcEntrySchema } from './cvcEntry-0BIB9sen.cjs';
1
+ import { F as Form, l as buildFormSchema, h as Section, q as buildSectionSchema, Q as Question, o as buildQuestionSchema, f as ScoringRule, p as buildScoringRuleSchema, P as PlatformFunction, m as buildPlatformFunctionSchema, d as PlatformRole, n as buildPlatformRoleSchema, b as CvcRegistry, k as buildCvcRegistrySchema, a as CvcEntry, j as buildCvcEntrySchema } from './cvcEntry-Asg7mxjB.cjs';
2
2
  import * as mongoose from 'mongoose';
3
3
  import { HydratedDocument, Connection, Model } from 'mongoose';
4
4