@htilabs/platform-common-models 0.12.1 → 0.12.3

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 (55) hide show
  1. package/dist/{cvcEntry-0BIB9sen.d.cts → cvcEntry-ctHTp2df.d.cts} +36 -36
  2. package/dist/{cvcEntry-0BIB9sen.d.ts → cvcEntry-ctHTp2df.d.ts} +36 -36
  3. package/dist/cvcs/index.cjs +245 -4
  4. package/dist/cvcs/index.cjs.map +1 -1
  5. package/dist/cvcs/index.d.cts +533 -274
  6. package/dist/cvcs/index.d.ts +533 -274
  7. package/dist/cvcs/index.js +244 -4
  8. package/dist/cvcs/index.js.map +1 -1
  9. package/dist/enums/index.cjs +17 -0
  10. package/dist/enums/index.cjs.map +1 -1
  11. package/dist/enums/index.d.cts +24 -3
  12. package/dist/enums/index.d.ts +24 -3
  13. package/dist/enums/index.js +16 -0
  14. package/dist/enums/index.js.map +1 -1
  15. package/dist/{index-CDoqrfc1.d.ts → index-4DiJrn7y.d.ts} +1 -1
  16. package/dist/{index-Zu_mOJRn.d.cts → index-qreOzXYS.d.cts} +1 -1
  17. package/dist/index.cjs +317 -11
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.cts +6 -6
  20. package/dist/index.d.ts +6 -6
  21. package/dist/index.js +310 -11
  22. package/dist/index.js.map +1 -1
  23. package/dist/models/index.d.cts +2 -2
  24. package/dist/models/index.d.ts +2 -2
  25. package/dist/schemas/index.cjs +41 -7
  26. package/dist/schemas/index.cjs.map +1 -1
  27. package/dist/schemas/index.d.cts +116 -12
  28. package/dist/schemas/index.d.ts +116 -12
  29. package/dist/schemas/index.js +38 -7
  30. package/dist/schemas/index.js.map +1 -1
  31. package/dist/{cvc-Cp4uWnAa.d.cts → team-C4LJ5Tex.d.cts} +36 -1
  32. package/dist/{cvc-Cp4uWnAa.d.ts → team-C4LJ5Tex.d.ts} +36 -1
  33. package/dist/validation/index.cjs +155 -0
  34. package/dist/validation/index.cjs.map +1 -1
  35. package/dist/validation/index.d.cts +1 -1
  36. package/dist/validation/index.d.ts +1 -1
  37. package/dist/validation/index.js +153 -0
  38. package/dist/validation/index.js.map +1 -1
  39. package/package.json +27 -26
  40. package/src/__tests__/__snapshots__/cvc-sot.snap +8 -0
  41. package/src/__tests__/core-information-scope-invariant.test.ts +125 -2
  42. package/src/__tests__/cvc-drift-gate.test.ts +18 -0
  43. package/src/__tests__/cvc-sot-snapshot.test.ts +17 -0
  44. package/src/__tests__/cvc-structural.test.ts +5 -0
  45. package/src/__tests__/share-response-reason-invariant.test.ts +167 -0
  46. package/src/__tests__/team-directory-fields.test.ts +252 -0
  47. package/src/cvcs/coreInformationScope.v1.0.0.json +21 -4
  48. package/src/cvcs/index.ts +4 -0
  49. package/src/cvcs/shareResponseReason.v1.0.0.json +220 -0
  50. package/src/generated/cvc-enums.ts +25 -2
  51. package/src/index.ts +7 -0
  52. package/src/schemas/index.ts +8 -0
  53. package/src/schemas/team.ts +118 -0
  54. package/src/validation/index.ts +1 -0
  55. package/src/validation/team.ts +48 -0
@@ -1,3 +1,3 @@
1
- export { a as CvcEntry, b as CvcRegistry, F as Form, P as PlatformFunction, d as PlatformRole, Q as Question, f as ScoringRule, h as Section } from '../cvcEntry-0BIB9sen.cjs';
1
+ export { a as CvcEntry, b as CvcRegistry, F as Form, P as PlatformFunction, d as PlatformRole, Q as Question, f as ScoringRule, h as Section } from '../cvcEntry-ctHTp2df.cjs';
2
2
  import 'mongoose';
3
- export { C as CvcEntryDoc, a as CvcRegistryDoc, F as FormDoc, P as PlatformFunctionDoc, b as PlatformModels, c as PlatformRoleDoc, Q as QuestionDoc, S as ScoringRuleDoc, d as SectionDoc, g as createPlatformModels, h as cvcEntryModel, i as cvcRegistryModel, j as formModel, p as platformFunctionModel, k as platformRoleModel, q as questionModel, s as scoringRuleModel, l as sectionModel } from '../index-Zu_mOJRn.cjs';
3
+ export { C as CvcEntryDoc, a as CvcRegistryDoc, F as FormDoc, P as PlatformFunctionDoc, b as PlatformModels, c as PlatformRoleDoc, Q as QuestionDoc, S as ScoringRuleDoc, d as SectionDoc, g as createPlatformModels, h as cvcEntryModel, i as cvcRegistryModel, j as formModel, p as platformFunctionModel, k as platformRoleModel, q as questionModel, s as scoringRuleModel, l as sectionModel } from '../index-qreOzXYS.cjs';
@@ -1,3 +1,3 @@
1
- export { a as CvcEntry, b as CvcRegistry, F as Form, P as PlatformFunction, d as PlatformRole, Q as Question, f as ScoringRule, h as Section } from '../cvcEntry-0BIB9sen.js';
1
+ export { a as CvcEntry, b as CvcRegistry, F as Form, P as PlatformFunction, d as PlatformRole, Q as Question, f as ScoringRule, h as Section } from '../cvcEntry-ctHTp2df.js';
2
2
  import 'mongoose';
3
- export { C as CvcEntryDoc, a as CvcRegistryDoc, F as FormDoc, P as PlatformFunctionDoc, b as PlatformModels, c as PlatformRoleDoc, Q as QuestionDoc, S as ScoringRuleDoc, d as SectionDoc, g as createPlatformModels, h as cvcEntryModel, i as cvcRegistryModel, j as formModel, p as platformFunctionModel, k as platformRoleModel, q as questionModel, s as scoringRuleModel, l as sectionModel } from '../index-CDoqrfc1.js';
3
+ export { C as CvcEntryDoc, a as CvcRegistryDoc, F as FormDoc, P as PlatformFunctionDoc, b as PlatformModels, c as PlatformRoleDoc, Q as QuestionDoc, S as ScoringRuleDoc, d as SectionDoc, g as createPlatformModels, h as cvcEntryModel, i as cvcRegistryModel, j as formModel, p as platformFunctionModel, k as platformRoleModel, q as questionModel, s as scoringRuleModel, l as sectionModel } from '../index-4DiJrn7y.js';
@@ -20,6 +20,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/schemas/index.ts
21
21
  var schemas_exports = {};
22
22
  __export(schemas_exports, {
23
+ TEAM_MODEL_NAME: () => TEAM_MODEL_NAME,
24
+ addTeamDirectoryFields: () => addTeamDirectoryFields,
23
25
  addressSchema: () => addressSchema,
24
26
  buildCvcEntrySchema: () => buildCvcEntrySchema,
25
27
  buildCvcRegistrySchema: () => buildCvcRegistrySchema,
@@ -57,6 +59,7 @@ __export(schemas_exports, {
57
59
  sectionQuestionRefSchema: () => sectionQuestionRefSchema,
58
60
  sectionSchemaDefinition: () => sectionSchemaDefinition,
59
61
  sectionSchemaOptions: () => sectionSchemaOptions,
62
+ teamDirectorySchemaDefinition: () => teamDirectorySchemaDefinition,
60
63
  visibilityRuleSchema: () => visibilityRuleSchema
61
64
  });
62
65
  module.exports = __toCommonJS(schemas_exports);
@@ -4391,8 +4394,36 @@ function buildPlatformRoleSchema() {
4391
4394
  }
4392
4395
  var _platformRoleSchema = buildPlatformRoleSchema();
4393
4396
 
4394
- // src/schemas/cvcRegistry.ts
4397
+ // src/schemas/team.ts
4395
4398
  var import_mongoose8 = require("mongoose");
4399
+ var TEAM_MODEL_NAME = "Team";
4400
+ var teamDirectorySchemaDefinition = {
4401
+ /**
4402
+ * The platform apps this team works in, as {@link PLATFORM_TOOL} codes
4403
+ * (`"PAVE"`, `"THREAD"`, `"LEADS"`, ...). The referral preset only resolves
4404
+ * to a team whose `apps` includes `"PAVE"`.
4405
+ */
4406
+ apps: {
4407
+ type: [String],
4408
+ enum: [...PLATFORM_TOOL_VALUES],
4409
+ default: void 0
4410
+ },
4411
+ /**
4412
+ * The teams this team refers to, in priority order. The resolver takes the
4413
+ * first active target that works in PAVE and is not the sending team itself.
4414
+ */
4415
+ canReferTo: {
4416
+ type: [{ type: import_mongoose8.Schema.Types.ObjectId, ref: TEAM_MODEL_NAME }],
4417
+ default: void 0
4418
+ }
4419
+ };
4420
+ function addTeamDirectoryFields(schema) {
4421
+ schema.add(teamDirectorySchemaDefinition);
4422
+ return schema;
4423
+ }
4424
+
4425
+ // src/schemas/cvcRegistry.ts
4426
+ var import_mongoose9 = require("mongoose");
4396
4427
  var cvcRegistrySchemaDefinition = {
4397
4428
  // Versioning — semantic version of this registry bundle
4398
4429
  version: {
@@ -4412,7 +4443,7 @@ var cvcRegistrySchemaDefinition = {
4412
4443
  default: null
4413
4444
  },
4414
4445
  agencyId: {
4415
- type: import_mongoose8.Schema.Types.ObjectId,
4446
+ type: import_mongoose9.Schema.Types.ObjectId,
4416
4447
  default: null
4417
4448
  },
4418
4449
  // Lifecycle
@@ -4454,7 +4485,7 @@ var cvcRegistrySchemaDefinition = {
4454
4485
  // include / exclude lists from its base before applying its own overrides.
4455
4486
  // Indexed below so a base-version bump can find every dependent registry.
4456
4487
  basedOn: {
4457
- type: import_mongoose8.Schema.Types.ObjectId,
4488
+ type: import_mongoose9.Schema.Types.ObjectId,
4458
4489
  default: null
4459
4490
  }
4460
4491
  };
@@ -4463,7 +4494,7 @@ var cvcRegistrySchemaOptions = {
4463
4494
  collection: "cvc_registries"
4464
4495
  };
4465
4496
  function buildCvcRegistrySchema() {
4466
- const schema = new import_mongoose8.Schema(
4497
+ const schema = new import_mongoose9.Schema(
4467
4498
  cvcRegistrySchemaDefinition,
4468
4499
  cvcRegistrySchemaOptions
4469
4500
  );
@@ -4484,7 +4515,7 @@ function buildCvcRegistrySchema() {
4484
4515
  var _cvcRegistrySchema = buildCvcRegistrySchema();
4485
4516
 
4486
4517
  // src/schemas/cvcEntry.ts
4487
- var import_mongoose9 = require("mongoose");
4518
+ var import_mongoose10 = require("mongoose");
4488
4519
  var CVC_CODE_PATTERN = /^\d{3}(-\d{3}){6}$/;
4489
4520
  var CVC_KEY_PATTERN = /^[a-z][a-z0-9_]*$/;
4490
4521
  var cvcEntrySchemaDefinition = {
@@ -4550,7 +4581,7 @@ var cvcEntrySchemaDefinition = {
4550
4581
  // particular CVC family — e.g. `relevantMechanisms` on service_categories
4551
4582
  // entries (a cross-CVC reference into service_mechanisms by key).
4552
4583
  meta: {
4553
- type: import_mongoose9.Schema.Types.Mixed
4584
+ type: import_mongoose10.Schema.Types.Mixed
4554
4585
  }
4555
4586
  };
4556
4587
  var cvcEntrySchemaOptions = {
@@ -4561,7 +4592,7 @@ var cvcEntrySchemaOptions = {
4561
4592
  minimize: false
4562
4593
  };
4563
4594
  function buildCvcEntrySchema() {
4564
- const schema = new import_mongoose9.Schema(cvcEntrySchemaDefinition, cvcEntrySchemaOptions);
4595
+ const schema = new import_mongoose10.Schema(cvcEntrySchemaDefinition, cvcEntrySchemaOptions);
4565
4596
  schema.index(
4566
4597
  { domain: 1, version: 1, code: 1 },
4567
4598
  { unique: true }
@@ -4576,6 +4607,8 @@ function buildCvcEntrySchema() {
4576
4607
  var _cvcEntrySchema = buildCvcEntrySchema();
4577
4608
  // Annotate the CommonJS export names for ESM import in node:
4578
4609
  0 && (module.exports = {
4610
+ TEAM_MODEL_NAME,
4611
+ addTeamDirectoryFields,
4579
4612
  addressSchema,
4580
4613
  buildCvcEntrySchema,
4581
4614
  buildCvcRegistrySchema,
@@ -4613,6 +4646,7 @@ var _cvcEntrySchema = buildCvcEntrySchema();
4613
4646
  sectionQuestionRefSchema,
4614
4647
  sectionSchemaDefinition,
4615
4648
  sectionSchemaOptions,
4649
+ teamDirectorySchemaDefinition,
4616
4650
  visibilityRuleSchema
4617
4651
  });
4618
4652
  //# sourceMappingURL=index.cjs.map