@htilabs/platform-common-models 0.14.0 → 0.17.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 (39) 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 +184 -40
  4. package/dist/cvcs/index.cjs.map +1 -1
  5. package/dist/cvcs/index.d.cts +191 -41
  6. package/dist/cvcs/index.d.ts +191 -41
  7. package/dist/cvcs/index.js +184 -40
  8. package/dist/cvcs/index.js.map +1 -1
  9. package/dist/enums/index.cjs +3 -1
  10. package/dist/enums/index.cjs.map +1 -1
  11. package/dist/enums/index.d.cts +8 -6
  12. package/dist/enums/index.d.ts +8 -6
  13. package/dist/enums/index.js +3 -1
  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 +187 -41
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.cts +2 -2
  20. package/dist/index.d.ts +2 -2
  21. package/dist/index.js +187 -41
  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.d.cts +11 -11
  26. package/dist/schemas/index.d.ts +11 -11
  27. package/package.json +27 -26
  28. package/src/__tests__/__snapshots__/cvc-sot.snap +5 -5
  29. package/src/__tests__/core-functions-canon.test.ts +53 -0
  30. package/src/__tests__/core-information-scope-invariant.test.ts +298 -19
  31. package/src/__tests__/cvc-sot-snapshot.test.ts +19 -12
  32. package/src/__tests__/cvc-status-parser.test.ts +1 -1
  33. package/src/__tests__/cvc-structural.test.ts +3 -3
  34. package/src/__tests__/location-type-routing-invariant.test.ts +1 -1
  35. package/src/cvcs/{coreFunctions.v1.0.0.json → coreFunctions.v1.1.0.json} +11 -2
  36. package/src/cvcs/{coreInformationScope.v1.0.0.json → coreInformationScope.v1.1.0.json} +113 -22
  37. package/src/cvcs/index.ts +3 -3
  38. package/src/cvcs/{roiScope.v1.0.0.json → roiScope.v1.2.0.json} +51 -7
  39. package/src/generated/cvc-enums.ts +8 -6
@@ -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';
@@ -1,6 +1,6 @@
1
1
  import * as mongoose from 'mongoose';
2
2
  import { InferRawDocType, Schema } from 'mongoose';
3
- export { C as Choice, a as CvcEntry, b as CvcRegistry, F as Form, c as FormSectionRef, G as Guidance, L as Layout, P as PlatformFunction, d as PlatformRole, Q as Question, S as ScoringCondition, e as ScoringRecommendation, f as ScoringRule, g as ScoringThreshold, h as Section, i as SectionQuestionRef, V as VisibilityRule, j as buildCvcEntrySchema, k as buildCvcRegistrySchema, l as buildFormSchema, m as buildPlatformFunctionSchema, n as buildPlatformRoleSchema, o as buildQuestionSchema, p as buildScoringRuleSchema, q as buildSectionSchema, r as choiceSchema, s as cvcEntrySchemaDefinition, t as cvcEntrySchemaOptions, u as cvcRegistrySchemaDefinition, v as cvcRegistrySchemaOptions, w as formSchemaDefinition, x as formSchemaOptions, y as formSectionRefSchema, z as guidanceSchema, A as layoutSchema, B as platformFunctionSchemaDefinition, D as platformFunctionSchemaOptions, E as platformRoleSchemaDefinition, H as platformRoleSchemaOptions, I as questionSchemaDefinition, J as questionSchemaOptions, K as scoringConditionSchema, M as scoringRecommendationSchema, N as scoringRuleSchemaDefinition, O as scoringRuleSchemaOptions, R as scoringThresholdSchema, T as sectionQuestionRefSchema, U as sectionSchemaDefinition, W as sectionSchemaOptions, X as visibilityRuleSchema } from '../cvcEntry-0BIB9sen.cjs';
3
+ export { C as Choice, a as CvcEntry, b as CvcRegistry, F as Form, c as FormSectionRef, G as Guidance, L as Layout, P as PlatformFunction, d as PlatformRole, Q as Question, S as ScoringCondition, e as ScoringRecommendation, f as ScoringRule, g as ScoringThreshold, h as Section, i as SectionQuestionRef, V as VisibilityRule, j as buildCvcEntrySchema, k as buildCvcRegistrySchema, l as buildFormSchema, m as buildPlatformFunctionSchema, n as buildPlatformRoleSchema, o as buildQuestionSchema, p as buildScoringRuleSchema, q as buildSectionSchema, r as choiceSchema, s as cvcEntrySchemaDefinition, t as cvcEntrySchemaOptions, u as cvcRegistrySchemaDefinition, v as cvcRegistrySchemaOptions, w as formSchemaDefinition, x as formSchemaOptions, y as formSectionRefSchema, z as guidanceSchema, A as layoutSchema, B as platformFunctionSchemaDefinition, D as platformFunctionSchemaOptions, E as platformRoleSchemaDefinition, H as platformRoleSchemaOptions, I as questionSchemaDefinition, J as questionSchemaOptions, K as scoringConditionSchema, M as scoringRecommendationSchema, N as scoringRuleSchemaDefinition, O as scoringRuleSchemaOptions, R as scoringThresholdSchema, T as sectionQuestionRefSchema, U as sectionSchemaDefinition, W as sectionSchemaOptions, X as visibilityRuleSchema } from '../cvcEntry-ctHTp2df.cjs';
4
4
 
5
5
  declare const addressSchema: Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
6
6
  _id: false;
@@ -28,9 +28,9 @@ declare const addressSchema: Schema<any, mongoose.Model<any, any, any, any, any,
28
28
  placeId?: string | null | undefined;
29
29
  }, {
30
30
  id: string;
31
- }, Omit<mongoose.DefaultSchemaOptions, "_id"> & {
31
+ }, mongoose.MergeType<mongoose.DefaultSchemaOptions, {
32
32
  _id: false;
33
- }> & Omit<{
33
+ }>> & Omit<{
34
34
  formattedAddress?: string | null | undefined;
35
35
  street?: string | null | undefined;
36
36
  city?: string | null | undefined;
@@ -90,9 +90,9 @@ declare const personNameSchema: Schema<any, mongoose.Model<any, any, any, any, a
90
90
  isMononym?: boolean | null | undefined;
91
91
  }, {
92
92
  id: string;
93
- }, Omit<mongoose.DefaultSchemaOptions, "_id"> & {
93
+ }, mongoose.MergeType<mongoose.DefaultSchemaOptions, {
94
94
  _id: false;
95
- }> & Omit<{
95
+ }>> & Omit<{
96
96
  alias?: boolean | null | undefined;
97
97
  firstName?: string | null | undefined;
98
98
  lastName?: string | null | undefined;
@@ -140,9 +140,9 @@ declare const phoneSchema: Schema<any, mongoose.Model<any, any, any, any, any, a
140
140
  dataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
141
141
  }, {
142
142
  id: string;
143
- }, Omit<mongoose.DefaultSchemaOptions, "_id"> & {
143
+ }, mongoose.MergeType<mongoose.DefaultSchemaOptions, {
144
144
  _id: false;
145
- }> & Omit<{
145
+ }>> & Omit<{
146
146
  number?: string | null | undefined;
147
147
  type?: string | null | undefined;
148
148
  safeToContact?: boolean | null | undefined;
@@ -176,9 +176,9 @@ declare const emailSchema: Schema<any, mongoose.Model<any, any, any, any, any, a
176
176
  address?: string | null | undefined;
177
177
  }, {
178
178
  id: string;
179
- }, Omit<mongoose.DefaultSchemaOptions, "_id"> & {
179
+ }, mongoose.MergeType<mongoose.DefaultSchemaOptions, {
180
180
  _id: false;
181
- }> & Omit<{
181
+ }>> & Omit<{
182
182
  type?: string | null | undefined;
183
183
  safeToContact?: boolean | null | undefined;
184
184
  address?: string | null | undefined;
@@ -250,9 +250,9 @@ declare const demographicsSchema: Schema<any, mongoose.Model<any, any, any, any,
250
250
  ethnicityDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
251
251
  }, {
252
252
  id: string;
253
- }, Omit<mongoose.DefaultSchemaOptions, "_id"> & {
253
+ }, mongoose.MergeType<mongoose.DefaultSchemaOptions, {
254
254
  _id: false;
255
- }> & Omit<{
255
+ }>> & Omit<{
256
256
  race: number[];
257
257
  ethnicity: number[];
258
258
  accommodations: string[];
@@ -1,6 +1,6 @@
1
1
  import * as mongoose from 'mongoose';
2
2
  import { InferRawDocType, Schema } from 'mongoose';
3
- export { C as Choice, a as CvcEntry, b as CvcRegistry, F as Form, c as FormSectionRef, G as Guidance, L as Layout, P as PlatformFunction, d as PlatformRole, Q as Question, S as ScoringCondition, e as ScoringRecommendation, f as ScoringRule, g as ScoringThreshold, h as Section, i as SectionQuestionRef, V as VisibilityRule, j as buildCvcEntrySchema, k as buildCvcRegistrySchema, l as buildFormSchema, m as buildPlatformFunctionSchema, n as buildPlatformRoleSchema, o as buildQuestionSchema, p as buildScoringRuleSchema, q as buildSectionSchema, r as choiceSchema, s as cvcEntrySchemaDefinition, t as cvcEntrySchemaOptions, u as cvcRegistrySchemaDefinition, v as cvcRegistrySchemaOptions, w as formSchemaDefinition, x as formSchemaOptions, y as formSectionRefSchema, z as guidanceSchema, A as layoutSchema, B as platformFunctionSchemaDefinition, D as platformFunctionSchemaOptions, E as platformRoleSchemaDefinition, H as platformRoleSchemaOptions, I as questionSchemaDefinition, J as questionSchemaOptions, K as scoringConditionSchema, M as scoringRecommendationSchema, N as scoringRuleSchemaDefinition, O as scoringRuleSchemaOptions, R as scoringThresholdSchema, T as sectionQuestionRefSchema, U as sectionSchemaDefinition, W as sectionSchemaOptions, X as visibilityRuleSchema } from '../cvcEntry-0BIB9sen.js';
3
+ export { C as Choice, a as CvcEntry, b as CvcRegistry, F as Form, c as FormSectionRef, G as Guidance, L as Layout, P as PlatformFunction, d as PlatformRole, Q as Question, S as ScoringCondition, e as ScoringRecommendation, f as ScoringRule, g as ScoringThreshold, h as Section, i as SectionQuestionRef, V as VisibilityRule, j as buildCvcEntrySchema, k as buildCvcRegistrySchema, l as buildFormSchema, m as buildPlatformFunctionSchema, n as buildPlatformRoleSchema, o as buildQuestionSchema, p as buildScoringRuleSchema, q as buildSectionSchema, r as choiceSchema, s as cvcEntrySchemaDefinition, t as cvcEntrySchemaOptions, u as cvcRegistrySchemaDefinition, v as cvcRegistrySchemaOptions, w as formSchemaDefinition, x as formSchemaOptions, y as formSectionRefSchema, z as guidanceSchema, A as layoutSchema, B as platformFunctionSchemaDefinition, D as platformFunctionSchemaOptions, E as platformRoleSchemaDefinition, H as platformRoleSchemaOptions, I as questionSchemaDefinition, J as questionSchemaOptions, K as scoringConditionSchema, M as scoringRecommendationSchema, N as scoringRuleSchemaDefinition, O as scoringRuleSchemaOptions, R as scoringThresholdSchema, T as sectionQuestionRefSchema, U as sectionSchemaDefinition, W as sectionSchemaOptions, X as visibilityRuleSchema } from '../cvcEntry-ctHTp2df.js';
4
4
 
5
5
  declare const addressSchema: Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
6
6
  _id: false;
@@ -28,9 +28,9 @@ declare const addressSchema: Schema<any, mongoose.Model<any, any, any, any, any,
28
28
  placeId?: string | null | undefined;
29
29
  }, {
30
30
  id: string;
31
- }, Omit<mongoose.DefaultSchemaOptions, "_id"> & {
31
+ }, mongoose.MergeType<mongoose.DefaultSchemaOptions, {
32
32
  _id: false;
33
- }> & Omit<{
33
+ }>> & Omit<{
34
34
  formattedAddress?: string | null | undefined;
35
35
  street?: string | null | undefined;
36
36
  city?: string | null | undefined;
@@ -90,9 +90,9 @@ declare const personNameSchema: Schema<any, mongoose.Model<any, any, any, any, a
90
90
  isMononym?: boolean | null | undefined;
91
91
  }, {
92
92
  id: string;
93
- }, Omit<mongoose.DefaultSchemaOptions, "_id"> & {
93
+ }, mongoose.MergeType<mongoose.DefaultSchemaOptions, {
94
94
  _id: false;
95
- }> & Omit<{
95
+ }>> & Omit<{
96
96
  alias?: boolean | null | undefined;
97
97
  firstName?: string | null | undefined;
98
98
  lastName?: string | null | undefined;
@@ -140,9 +140,9 @@ declare const phoneSchema: Schema<any, mongoose.Model<any, any, any, any, any, a
140
140
  dataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
141
141
  }, {
142
142
  id: string;
143
- }, Omit<mongoose.DefaultSchemaOptions, "_id"> & {
143
+ }, mongoose.MergeType<mongoose.DefaultSchemaOptions, {
144
144
  _id: false;
145
- }> & Omit<{
145
+ }>> & Omit<{
146
146
  number?: string | null | undefined;
147
147
  type?: string | null | undefined;
148
148
  safeToContact?: boolean | null | undefined;
@@ -176,9 +176,9 @@ declare const emailSchema: Schema<any, mongoose.Model<any, any, any, any, any, a
176
176
  address?: string | null | undefined;
177
177
  }, {
178
178
  id: string;
179
- }, Omit<mongoose.DefaultSchemaOptions, "_id"> & {
179
+ }, mongoose.MergeType<mongoose.DefaultSchemaOptions, {
180
180
  _id: false;
181
- }> & Omit<{
181
+ }>> & Omit<{
182
182
  type?: string | null | undefined;
183
183
  safeToContact?: boolean | null | undefined;
184
184
  address?: string | null | undefined;
@@ -250,9 +250,9 @@ declare const demographicsSchema: Schema<any, mongoose.Model<any, any, any, any,
250
250
  ethnicityDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
251
251
  }, {
252
252
  id: string;
253
- }, Omit<mongoose.DefaultSchemaOptions, "_id"> & {
253
+ }, mongoose.MergeType<mongoose.DefaultSchemaOptions, {
254
254
  _id: false;
255
- }> & Omit<{
255
+ }>> & Omit<{
256
256
  race: number[];
257
257
  ethnicity: number[];
258
258
  accommodations: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@htilabs/platform-common-models",
3
- "version": "0.14.0",
3
+ "version": "0.17.0",
4
4
  "description": "Shared constants, types, and models for HTI Labs applications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -67,6 +67,31 @@
67
67
  "dist",
68
68
  "src"
69
69
  ],
70
+ "scripts": {
71
+ "build": "tsup",
72
+ "dev": "tsup --watch",
73
+ "typecheck": "tsc --noEmit && tsc --noEmit -p scripts/tsconfig.json",
74
+ "lint": "eslint src --ext .ts",
75
+ "lint:fix": "eslint src --ext .ts --fix",
76
+ "test": "vitest run",
77
+ "test:watch": "vitest",
78
+ "test:snapshot": "UPDATE_SNAPSHOT=1 vitest run",
79
+ "clean": "rm -rf dist",
80
+ "codegen:cvc": "tsx scripts/codegen-cvc-enums.ts",
81
+ "codegen:cvc:check": "tsx scripts/codegen-cvc-enums.ts --check",
82
+ "import:cvcs": "node scripts/import-prototype-cvcs.mjs",
83
+ "sot:pins": "tsx scripts/sot-pins.ts",
84
+ "sot:pins:check": "tsx scripts/sot-pins.ts --check",
85
+ "gate:cvc": "vitest run src/__tests__/cvc-drift-gate.test.ts",
86
+ "bridge:codebook": "tsx scripts/codebook-bridge.ts",
87
+ "bridge:codebook:check": "tsx scripts/codebook-bridge.ts --check",
88
+ "test:bridge": "node --import tsx --test scripts/codebook-bridge.test.ts",
89
+ "seed:cvc": "tsx scripts/seed-cvc.ts",
90
+ "seed:cvc:all": "tsx scripts/seed-all-cvcs.ts",
91
+ "test:seed": "node --import tsx --test scripts/seed-cvc.test.ts",
92
+ "test:guard": "node --import tsx --test scripts/lib/confirmTargetDb.test.ts",
93
+ "prepublishOnly": "npm run build"
94
+ },
70
95
  "keywords": [
71
96
  "hti",
72
97
  "platform-common",
@@ -101,29 +126,5 @@
101
126
  },
102
127
  "engines": {
103
128
  "node": ">=18.0.0"
104
- },
105
- "scripts": {
106
- "build": "tsup",
107
- "dev": "tsup --watch",
108
- "typecheck": "tsc --noEmit && tsc --noEmit -p scripts/tsconfig.json",
109
- "lint": "eslint src --ext .ts",
110
- "lint:fix": "eslint src --ext .ts --fix",
111
- "test": "vitest run",
112
- "test:watch": "vitest",
113
- "test:snapshot": "UPDATE_SNAPSHOT=1 vitest run",
114
- "clean": "rm -rf dist",
115
- "codegen:cvc": "tsx scripts/codegen-cvc-enums.ts",
116
- "codegen:cvc:check": "tsx scripts/codegen-cvc-enums.ts --check",
117
- "import:cvcs": "node scripts/import-prototype-cvcs.mjs",
118
- "sot:pins": "tsx scripts/sot-pins.ts",
119
- "sot:pins:check": "tsx scripts/sot-pins.ts --check",
120
- "gate:cvc": "vitest run src/__tests__/cvc-drift-gate.test.ts",
121
- "bridge:codebook": "tsx scripts/codebook-bridge.ts",
122
- "bridge:codebook:check": "tsx scripts/codebook-bridge.ts --check",
123
- "test:bridge": "node --import tsx --test scripts/codebook-bridge.test.ts",
124
- "seed:cvc": "tsx scripts/seed-cvc.ts",
125
- "seed:cvc:all": "tsx scripts/seed-all-cvcs.ts",
126
- "test:seed": "node --import tsx --test scripts/seed-cvc.test.ts",
127
- "test:guard": "node --import tsx --test scripts/lib/confirmTargetDb.test.ts"
128
129
  }
129
- }
130
+ }
@@ -575,8 +575,8 @@
575
575
  "hash": "8f650b786261619b2468eb3982c6146c21fa2ee3b1aa4504aa1084ad82543548"
576
576
  },
577
577
  "core_functions": {
578
- "count": 81,
579
- "hash": "5ed3bb6231e610bd6646f0d37e4bb6474d0c66a8c1e9ff6912ee2c00d1ccf534"
578
+ "count": 82,
579
+ "hash": "2a9b7ed4af3c984d4818d7eb7a7997d9aa04cd0f74f22a48d80787282316be9c"
580
580
  },
581
581
  "needs_assessment_change_type": {
582
582
  "count": 13,
@@ -584,7 +584,7 @@
584
584
  },
585
585
  "roi_scope": {
586
586
  "count": 31,
587
- "hash": "079c1f421f0af3a3994b9735bd7df509de0a1b3aead22f6235b63a134210c33b"
587
+ "hash": "d6c1a419806b7ba629cdde796a1fe1e62084944142a78bb2b51fca96277156f6"
588
588
  },
589
589
  "roi_status": {
590
590
  "count": 9,
@@ -703,8 +703,8 @@
703
703
  "hash": "9d8972c65373a9981aab6b8749661659ecc632004e67bc9c2b3c88aa76f30977"
704
704
  },
705
705
  "core_information_scope": {
706
- "count": 72,
707
- "hash": "9269401b4bcefccfffc490899bcd4c6faf021383ec6c5a0fda5680ed888eaf49"
706
+ "count": 73,
707
+ "hash": "a813257e3c42e30dfb2881e1718fff57bcfe8c358c4a81b17910cea17299c041"
708
708
  }
709
709
  }
710
710
  }
@@ -0,0 +1,53 @@
1
+ /**
2
+ * CORE FUNCTIONS (CVC-133) — v1.1.0 appends `note_open_departed_author`
3
+ *
4
+ * Canon added the Account Admin function on 2026-10-05 while building the
5
+ * Narrative notes Spec v2 (rule 10); its logic_notes mark the row as awaiting
6
+ * steward review (Crysta). `data/cvcs/core_functions.yaml` L68-93 @
7
+ * prototype 9ef79748 (unchanged at fed744f3). The SOT appends it at 133-078
8
+ * so every 1.0.0 code stays where it was; consumers gate on the key.
9
+ */
10
+
11
+ import { readFileSync } from "node:fs";
12
+ import path from "node:path";
13
+ import { fileURLToPath } from "node:url";
14
+
15
+ import { describe, it, expect } from "vitest";
16
+
17
+ import { CoreFunctionsKeys } from "../generated/cvc-enums.js";
18
+
19
+ const here = path.dirname(fileURLToPath(import.meta.url));
20
+ const cvcDir = path.join(here, "..", "cvcs");
21
+
22
+ interface Entry {
23
+ code: string;
24
+ key: string;
25
+ title: string;
26
+ selectable: boolean;
27
+ definition: string;
28
+ }
29
+
30
+ const sot = JSON.parse(
31
+ readFileSync(path.join(cvcDir, "coreFunctions.v1.1.0.json"), "utf8"),
32
+ ) as { version: string; entries: Entry[] };
33
+
34
+ describe("core_functions — note_open_departed_author (CVC-133 v1.1.0)", () => {
35
+ it("exports the key at its appended code", () => {
36
+ expect(CoreFunctionsKeys.note_open_departed_author).toBe("133-078-000-000-000-000-000");
37
+ });
38
+
39
+ it("carries canon's label and the PAVE + THREAD, admin-only posture", () => {
40
+ const row = sot.entries.find((e) => e.key === "note_open_departed_author");
41
+ expect(row?.title).toBe("Open a deactivated author's private notes");
42
+ expect(row?.selectable).toBe(true);
43
+ expect(row?.definition).toContain("Platform: PAVE, THREAD.");
44
+ expect(row?.definition).toContain("User-relevant: no. Admin-relevant: yes.");
45
+ });
46
+
47
+ it("is an append: it is the last entry and 1.0.0 is gone", () => {
48
+ expect(sot.version).toBe("1.1.0");
49
+ expect(sot.entries.at(-1)?.key).toBe("note_open_departed_author");
50
+ expect(sot.entries).toHaveLength(82);
51
+ expect(() => readFileSync(path.join(cvcDir, "coreFunctions.v1.0.0.json"))).toThrow();
52
+ });
53
+ });