@htilabs/platform-common-models 0.60.0 → 0.62.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 +81 -0
- package/dist/authz/index.cjs +104 -0
- package/dist/authz/index.cjs.map +1 -1
- package/dist/authz/index.d.cts +21 -1
- package/dist/authz/index.d.ts +21 -1
- package/dist/authz/index.js +101 -0
- package/dist/authz/index.js.map +1 -1
- package/dist/{index-DvAypMJV.d.ts → index-Bh1zO_Vu.d.ts} +1 -1
- package/dist/{index-Bj-s0nZy.d.cts → index-XWSYon40.d.cts} +1 -1
- package/dist/index.cjs +185 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +182 -7
- package/dist/index.js.map +1 -1
- package/dist/models/index.d.cts +2 -2
- package/dist/models/index.d.ts +2 -2
- package/dist/schemas/index.d.cts +25 -25
- package/dist/schemas/index.d.ts +25 -25
- package/dist/sharing-ceiling/index.cjs +81 -7
- package/dist/sharing-ceiling/index.cjs.map +1 -1
- package/dist/sharing-ceiling/index.d.cts +64 -4
- package/dist/sharing-ceiling/index.d.ts +64 -4
- package/dist/sharing-ceiling/index.js +81 -7
- package/dist/sharing-ceiling/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/authz-resolve.test.ts +3 -0
- package/src/__tests__/core-function-notes.test.ts +35 -0
- package/src/authz/functionNotes.ts +20 -0
- package/src/authz/index.ts +1 -0
- package/src/generated/coreFunctionNotes.ts +107 -0
- package/src/sharingCeiling/__tests__/resolveShare.purposeRule.test.ts +836 -0
- package/src/sharingCeiling/index.ts +4 -0
- package/src/sharingCeiling/resolve.ts +219 -15
- package/dist/{cvcEntry-BLeRivoF.d.cts → cvcEntry-D787utvP.d.cts} +8 -8
- package/dist/{cvcEntry-BLeRivoF.d.ts → cvcEntry-D787utvP.d.ts} +8 -8
package/dist/models/index.d.cts
CHANGED
|
@@ -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-
|
|
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-D787utvP.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-
|
|
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-XWSYon40.cjs';
|
package/dist/models/index.d.ts
CHANGED
|
@@ -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-
|
|
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-D787utvP.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-
|
|
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-Bh1zO_Vu.js';
|
package/dist/schemas/index.d.cts
CHANGED
|
@@ -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-
|
|
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-D787utvP.cjs';
|
|
4
4
|
import { a as AddAgencyOrgTypeFieldsOptions } from '../agency-BXvE4yWu.cjs';
|
|
5
5
|
export { A as AGENCY_ORG_TYPE_VALIDATED_UPDATE_OPS, b as AgencyOrgTypeFields, O as ORG_TYPE_FIELD_NAMES, c as OrgTypeFieldName, d as OrgTypeFields, e as OrgTypeFieldsHolder, V as VSP_TWO_STEP_ISSUE, f as addAgencyOrgTypeFields, g as addOrgTypeFields, h as agencyOrgTypeSchemaDefinition, i as applyRunValidatorsIfUnset, j as installVspTwoStepHooks, m as mirrorOrgTypeFields, o as orgTypeFieldsDiffer, k as orgTypeSchemaDefinition, r as resolveEffectiveOrgType, l as resolveEffectiveOrgTypeFields, v as vspTwoStepHolds, n as vspTwoStepHoldsOnUpdate } from '../agency-BXvE4yWu.cjs';
|
|
6
6
|
export { P as PROGRAM_REVIEW_STATUS, a as PROGRAM_REVIEW_STATUS_VALUES, b as ProgramReviewStatus, i as isLiveOrganizationProgram, c as isProgramReviewStatus } from '../vocabulary-Cxhi9EGt.cjs';
|
|
@@ -137,12 +137,12 @@ declare const phoneSchema: Schema<any, mongoose.Model<any, any, any, any, any, a
|
|
|
137
137
|
number?: string | null | undefined;
|
|
138
138
|
type?: string | null | undefined;
|
|
139
139
|
safeToContact?: boolean | null | undefined;
|
|
140
|
-
dataQuality?: "
|
|
140
|
+
dataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
141
141
|
}, mongoose.Document<unknown, {}, {
|
|
142
142
|
number?: string | null | undefined;
|
|
143
143
|
type?: string | null | undefined;
|
|
144
144
|
safeToContact?: boolean | null | undefined;
|
|
145
|
-
dataQuality?: "
|
|
145
|
+
dataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
146
146
|
}, {
|
|
147
147
|
id: string;
|
|
148
148
|
}, mongoose.MergeType<mongoose.DefaultSchemaOptions, {
|
|
@@ -151,7 +151,7 @@ declare const phoneSchema: Schema<any, mongoose.Model<any, any, any, any, any, a
|
|
|
151
151
|
number?: string | null | undefined;
|
|
152
152
|
type?: string | null | undefined;
|
|
153
153
|
safeToContact?: boolean | null | undefined;
|
|
154
|
-
dataQuality?: "
|
|
154
|
+
dataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
155
155
|
} & {
|
|
156
156
|
_id: mongoose.Types.ObjectId;
|
|
157
157
|
} & {
|
|
@@ -162,7 +162,7 @@ declare const phoneSchema: Schema<any, mongoose.Model<any, any, any, any, any, a
|
|
|
162
162
|
number?: string | null | undefined;
|
|
163
163
|
type?: string | null | undefined;
|
|
164
164
|
safeToContact?: boolean | null | undefined;
|
|
165
|
-
dataQuality?: "
|
|
165
|
+
dataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
166
166
|
} & {
|
|
167
167
|
_id: mongoose.Types.ObjectId;
|
|
168
168
|
} & {
|
|
@@ -224,11 +224,11 @@ declare const demographicsSchema: Schema<any, mongoose.Model<any, any, any, any,
|
|
|
224
224
|
raceOtherText?: string | null | undefined;
|
|
225
225
|
genderOtherText?: string | null | undefined;
|
|
226
226
|
accommodationOtherText?: string | null | undefined;
|
|
227
|
-
ageDataQuality?: "
|
|
228
|
-
sexDataQuality?: "
|
|
229
|
-
genderDataQuality?: "
|
|
230
|
-
raceDataQuality?: "
|
|
231
|
-
ethnicityDataQuality?: "
|
|
227
|
+
ageDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
228
|
+
sexDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
229
|
+
genderDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
230
|
+
raceDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
231
|
+
ethnicityDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
232
232
|
}, mongoose.Document<unknown, {}, {
|
|
233
233
|
race: number[];
|
|
234
234
|
ethnicity: number[];
|
|
@@ -248,11 +248,11 @@ declare const demographicsSchema: Schema<any, mongoose.Model<any, any, any, any,
|
|
|
248
248
|
raceOtherText?: string | null | undefined;
|
|
249
249
|
genderOtherText?: string | null | undefined;
|
|
250
250
|
accommodationOtherText?: string | null | undefined;
|
|
251
|
-
ageDataQuality?: "
|
|
252
|
-
sexDataQuality?: "
|
|
253
|
-
genderDataQuality?: "
|
|
254
|
-
raceDataQuality?: "
|
|
255
|
-
ethnicityDataQuality?: "
|
|
251
|
+
ageDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
252
|
+
sexDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
253
|
+
genderDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
254
|
+
raceDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
255
|
+
ethnicityDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
256
256
|
}, {
|
|
257
257
|
id: string;
|
|
258
258
|
}, mongoose.MergeType<mongoose.DefaultSchemaOptions, {
|
|
@@ -276,11 +276,11 @@ declare const demographicsSchema: Schema<any, mongoose.Model<any, any, any, any,
|
|
|
276
276
|
raceOtherText?: string | null | undefined;
|
|
277
277
|
genderOtherText?: string | null | undefined;
|
|
278
278
|
accommodationOtherText?: string | null | undefined;
|
|
279
|
-
ageDataQuality?: "
|
|
280
|
-
sexDataQuality?: "
|
|
281
|
-
genderDataQuality?: "
|
|
282
|
-
raceDataQuality?: "
|
|
283
|
-
ethnicityDataQuality?: "
|
|
279
|
+
ageDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
280
|
+
sexDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
281
|
+
genderDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
282
|
+
raceDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
283
|
+
ethnicityDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
284
284
|
} & {
|
|
285
285
|
_id: mongoose.Types.ObjectId;
|
|
286
286
|
} & {
|
|
@@ -306,11 +306,11 @@ declare const demographicsSchema: Schema<any, mongoose.Model<any, any, any, any,
|
|
|
306
306
|
raceOtherText?: string | null | undefined;
|
|
307
307
|
genderOtherText?: string | null | undefined;
|
|
308
308
|
accommodationOtherText?: string | null | undefined;
|
|
309
|
-
ageDataQuality?: "
|
|
310
|
-
sexDataQuality?: "
|
|
311
|
-
genderDataQuality?: "
|
|
312
|
-
raceDataQuality?: "
|
|
313
|
-
ethnicityDataQuality?: "
|
|
309
|
+
ageDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
310
|
+
sexDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
311
|
+
genderDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
312
|
+
raceDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
313
|
+
ethnicityDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
314
314
|
} & {
|
|
315
315
|
_id: mongoose.Types.ObjectId;
|
|
316
316
|
} & {
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -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-
|
|
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-D787utvP.js';
|
|
4
4
|
import { a as AddAgencyOrgTypeFieldsOptions } from '../agency-NEW6NOGD.js';
|
|
5
5
|
export { A as AGENCY_ORG_TYPE_VALIDATED_UPDATE_OPS, b as AgencyOrgTypeFields, O as ORG_TYPE_FIELD_NAMES, c as OrgTypeFieldName, d as OrgTypeFields, e as OrgTypeFieldsHolder, V as VSP_TWO_STEP_ISSUE, f as addAgencyOrgTypeFields, g as addOrgTypeFields, h as agencyOrgTypeSchemaDefinition, i as applyRunValidatorsIfUnset, j as installVspTwoStepHooks, m as mirrorOrgTypeFields, o as orgTypeFieldsDiffer, k as orgTypeSchemaDefinition, r as resolveEffectiveOrgType, l as resolveEffectiveOrgTypeFields, v as vspTwoStepHolds, n as vspTwoStepHoldsOnUpdate } from '../agency-NEW6NOGD.js';
|
|
6
6
|
export { P as PROGRAM_REVIEW_STATUS, a as PROGRAM_REVIEW_STATUS_VALUES, b as ProgramReviewStatus, i as isLiveOrganizationProgram, c as isProgramReviewStatus } from '../vocabulary-Cxhi9EGt.js';
|
|
@@ -137,12 +137,12 @@ declare const phoneSchema: Schema<any, mongoose.Model<any, any, any, any, any, a
|
|
|
137
137
|
number?: string | null | undefined;
|
|
138
138
|
type?: string | null | undefined;
|
|
139
139
|
safeToContact?: boolean | null | undefined;
|
|
140
|
-
dataQuality?: "
|
|
140
|
+
dataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
141
141
|
}, mongoose.Document<unknown, {}, {
|
|
142
142
|
number?: string | null | undefined;
|
|
143
143
|
type?: string | null | undefined;
|
|
144
144
|
safeToContact?: boolean | null | undefined;
|
|
145
|
-
dataQuality?: "
|
|
145
|
+
dataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
146
146
|
}, {
|
|
147
147
|
id: string;
|
|
148
148
|
}, mongoose.MergeType<mongoose.DefaultSchemaOptions, {
|
|
@@ -151,7 +151,7 @@ declare const phoneSchema: Schema<any, mongoose.Model<any, any, any, any, any, a
|
|
|
151
151
|
number?: string | null | undefined;
|
|
152
152
|
type?: string | null | undefined;
|
|
153
153
|
safeToContact?: boolean | null | undefined;
|
|
154
|
-
dataQuality?: "
|
|
154
|
+
dataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
155
155
|
} & {
|
|
156
156
|
_id: mongoose.Types.ObjectId;
|
|
157
157
|
} & {
|
|
@@ -162,7 +162,7 @@ declare const phoneSchema: Schema<any, mongoose.Model<any, any, any, any, any, a
|
|
|
162
162
|
number?: string | null | undefined;
|
|
163
163
|
type?: string | null | undefined;
|
|
164
164
|
safeToContact?: boolean | null | undefined;
|
|
165
|
-
dataQuality?: "
|
|
165
|
+
dataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
166
166
|
} & {
|
|
167
167
|
_id: mongoose.Types.ObjectId;
|
|
168
168
|
} & {
|
|
@@ -224,11 +224,11 @@ declare const demographicsSchema: Schema<any, mongoose.Model<any, any, any, any,
|
|
|
224
224
|
raceOtherText?: string | null | undefined;
|
|
225
225
|
genderOtherText?: string | null | undefined;
|
|
226
226
|
accommodationOtherText?: string | null | undefined;
|
|
227
|
-
ageDataQuality?: "
|
|
228
|
-
sexDataQuality?: "
|
|
229
|
-
genderDataQuality?: "
|
|
230
|
-
raceDataQuality?: "
|
|
231
|
-
ethnicityDataQuality?: "
|
|
227
|
+
ageDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
228
|
+
sexDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
229
|
+
genderDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
230
|
+
raceDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
231
|
+
ethnicityDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
232
232
|
}, mongoose.Document<unknown, {}, {
|
|
233
233
|
race: number[];
|
|
234
234
|
ethnicity: number[];
|
|
@@ -248,11 +248,11 @@ declare const demographicsSchema: Schema<any, mongoose.Model<any, any, any, any,
|
|
|
248
248
|
raceOtherText?: string | null | undefined;
|
|
249
249
|
genderOtherText?: string | null | undefined;
|
|
250
250
|
accommodationOtherText?: string | null | undefined;
|
|
251
|
-
ageDataQuality?: "
|
|
252
|
-
sexDataQuality?: "
|
|
253
|
-
genderDataQuality?: "
|
|
254
|
-
raceDataQuality?: "
|
|
255
|
-
ethnicityDataQuality?: "
|
|
251
|
+
ageDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
252
|
+
sexDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
253
|
+
genderDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
254
|
+
raceDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
255
|
+
ethnicityDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
256
256
|
}, {
|
|
257
257
|
id: string;
|
|
258
258
|
}, mongoose.MergeType<mongoose.DefaultSchemaOptions, {
|
|
@@ -276,11 +276,11 @@ declare const demographicsSchema: Schema<any, mongoose.Model<any, any, any, any,
|
|
|
276
276
|
raceOtherText?: string | null | undefined;
|
|
277
277
|
genderOtherText?: string | null | undefined;
|
|
278
278
|
accommodationOtherText?: string | null | undefined;
|
|
279
|
-
ageDataQuality?: "
|
|
280
|
-
sexDataQuality?: "
|
|
281
|
-
genderDataQuality?: "
|
|
282
|
-
raceDataQuality?: "
|
|
283
|
-
ethnicityDataQuality?: "
|
|
279
|
+
ageDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
280
|
+
sexDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
281
|
+
genderDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
282
|
+
raceDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
283
|
+
ethnicityDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
284
284
|
} & {
|
|
285
285
|
_id: mongoose.Types.ObjectId;
|
|
286
286
|
} & {
|
|
@@ -306,11 +306,11 @@ declare const demographicsSchema: Schema<any, mongoose.Model<any, any, any, any,
|
|
|
306
306
|
raceOtherText?: string | null | undefined;
|
|
307
307
|
genderOtherText?: string | null | undefined;
|
|
308
308
|
accommodationOtherText?: string | null | undefined;
|
|
309
|
-
ageDataQuality?: "
|
|
310
|
-
sexDataQuality?: "
|
|
311
|
-
genderDataQuality?: "
|
|
312
|
-
raceDataQuality?: "
|
|
313
|
-
ethnicityDataQuality?: "
|
|
309
|
+
ageDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
310
|
+
sexDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
311
|
+
genderDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
312
|
+
raceDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
313
|
+
ethnicityDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
|
|
314
314
|
} & {
|
|
315
315
|
_id: mongoose.Types.ObjectId;
|
|
316
316
|
} & {
|
|
@@ -882,8 +882,31 @@ function resolveShare(input) {
|
|
|
882
882
|
};
|
|
883
883
|
}
|
|
884
884
|
}
|
|
885
|
+
let fork = null;
|
|
885
886
|
if (gov === null && !inside && purposeKnown && recipientKey !== null) {
|
|
886
887
|
gov = hit(cell(att.relationships, recipientKey), "relationship");
|
|
888
|
+
const rule = input.partnerPurposeRule;
|
|
889
|
+
const rulePosture2 = rule?.posture;
|
|
890
|
+
if (gov === null && recipient.kind === "partner" && // `__external__` stays scope-only (data.js L55333)
|
|
891
|
+
(rulePosture2 === "open" || rulePosture2 === "approval" || rulePosture2 === "blocked")) {
|
|
892
|
+
const partnerName = typeof rule?.partnerName === "string" && rule.partnerName !== "" ? rule.partnerName : recipientKey;
|
|
893
|
+
fork = {
|
|
894
|
+
policy: {
|
|
895
|
+
id: `pol-bp-${recipientKey}-${purpose}`,
|
|
896
|
+
name: `${purposeLabel} \u2014 ${partnerName} variant`,
|
|
897
|
+
purpose,
|
|
898
|
+
posture: rulePosture2,
|
|
899
|
+
infoScope: null,
|
|
900
|
+
cadences: null,
|
|
901
|
+
version: 1,
|
|
902
|
+
origin: { kind: "fork" },
|
|
903
|
+
edited: true
|
|
904
|
+
},
|
|
905
|
+
level: "relationship",
|
|
906
|
+
version: 1,
|
|
907
|
+
rulePath: `policies.partnerOverrides[${recipientKey}].byPurpose[${purpose}] (purpose-specific rule, reported as its fork)`
|
|
908
|
+
};
|
|
909
|
+
}
|
|
887
910
|
if (gov === null)
|
|
888
911
|
gov = hit(own2(att.agencyDefaults, purpose), "agency_default");
|
|
889
912
|
if (gov === null && pd !== null) {
|
|
@@ -905,18 +928,36 @@ function resolveShare(input) {
|
|
|
905
928
|
};
|
|
906
929
|
}
|
|
907
930
|
}
|
|
931
|
+
let defaultProjection = null;
|
|
932
|
+
let defaultItems = null;
|
|
933
|
+
if (fork !== null) {
|
|
934
|
+
if (gov !== null && gov.level === "agency_default" && gov.policy.edited === true) {
|
|
935
|
+
if (isStringList2(gov.policy.infoScope))
|
|
936
|
+
defaultProjection = [...gov.policy.infoScope];
|
|
937
|
+
const items = copyItems(gov.policy.infoScopeItems);
|
|
938
|
+
if (items !== null)
|
|
939
|
+
defaultItems = {
|
|
940
|
+
rows: items,
|
|
941
|
+
name: typeof gov.policy.name === "string" ? gov.policy.name : gov.policy.id
|
|
942
|
+
};
|
|
943
|
+
}
|
|
944
|
+
gov = fork;
|
|
945
|
+
}
|
|
946
|
+
const rulePosture = input.partnerPurposeRule?.posture;
|
|
947
|
+
const ruleAuthored = !inside && recipient.kind === "partner" && (rulePosture === "open" || rulePosture === "approval" || rulePosture === "blocked");
|
|
908
948
|
let tc = null;
|
|
909
949
|
if (teamId !== null && gov !== null) {
|
|
910
950
|
const t = hit(cell(att.teams, teamId), "team");
|
|
911
951
|
if (t !== null && t.policy.id !== gov.policy.id) tc = t;
|
|
912
952
|
}
|
|
913
|
-
const govNamed = gov === null ? null : named(gov);
|
|
953
|
+
const govNamed = gov === null ? null : fork !== null ? { ...named(gov), virtual: true } : named(gov);
|
|
914
954
|
const tcNamed = tc === null ? null : named(tc);
|
|
915
955
|
const rulePath = gov === null ? `no Platform default for purpose \u201C${purpose}\u201D \u2014 nothing governs (fails closed)` : tc === null ? gov.rulePath : `${gov.rulePath} \u2229 ${tc.rulePath} (the sending team's own policy is a ceiling \u2014 only what both allow)`;
|
|
916
|
-
let posture = input.relationshipPosture === "approval" || input.relationshipPosture === "blocked" ? input.relationshipPosture : "open";
|
|
956
|
+
let posture = ruleAuthored && rulePosture !== void 0 ? rulePosture : input.relationshipPosture === "approval" || input.relationshipPosture === "blocked" ? input.relationshipPosture : "open";
|
|
917
957
|
let postureSource = "relationship";
|
|
918
958
|
let posturePol = null;
|
|
919
|
-
if (
|
|
959
|
+
if (fork === null && // data.js L55391: a virtual policy's posture is never applied
|
|
960
|
+
govNamed?.posture && SHARE_POSTURE_RANK[govNamed.posture] > SHARE_POSTURE_RANK[posture]) {
|
|
920
961
|
posture = govNamed.posture;
|
|
921
962
|
postureSource = "policy";
|
|
922
963
|
posturePol = govNamed;
|
|
@@ -941,11 +982,22 @@ function resolveShare(input) {
|
|
|
941
982
|
} else if (posture === "blocked") {
|
|
942
983
|
const pol = posturePol;
|
|
943
984
|
const path = pol === null ? "relationship posture = blocked" : `sharingPurposePolicies[${pol.id}].posture=blocked (policy \u201C${pol.name}\u201D \u2014 ${pol.levelLabel})`;
|
|
944
|
-
|
|
985
|
+
const byRule = ruleAuthored && postureSource === "relationship";
|
|
986
|
+
if (report && byRule) {
|
|
987
|
+
reportCarveOut = {
|
|
988
|
+
note: "Partner is blocked for ordinary sharing \u2014 reachable for reports",
|
|
989
|
+
rulePath: `reports-never-blocked-at-partner-layer (Crysta ruling 2026-08-23; policies.partnerOverrides[${recipientKey}].byPurpose[${purpose}].sharingPosture=blocked does not bind a legal duty \u2014 who may send is a role/function question)`
|
|
990
|
+
};
|
|
991
|
+
} else if (report) {
|
|
945
992
|
reportCarveOut = {
|
|
946
993
|
note: pol === null ? "Blocked for ordinary sharing \u2014 reachable for reports (nothing at the partner layer extinguishes the duty)" : `The \u201C${pol.name}\u201D policy blocks ordinary sharing \u2014 reachable for reports`,
|
|
947
994
|
rulePath: path
|
|
948
995
|
};
|
|
996
|
+
} else if (byRule) {
|
|
997
|
+
excluded = {
|
|
998
|
+
reason: "Partner is blocked for this purpose by your account's sharing policy",
|
|
999
|
+
rulePath: `policies.partnerOverrides[${recipientKey}].byPurpose[${purpose}].sharingPosture=blocked (Share Partners \u2014 purpose-specific rule)`
|
|
1000
|
+
};
|
|
949
1001
|
} else {
|
|
950
1002
|
excluded = {
|
|
951
1003
|
reason: pol === null ? "Blocked for this purpose by the relationship" : `Blocked for this purpose by your account's \u201C${pol.name}\u201D policy`,
|
|
@@ -958,9 +1010,11 @@ function resolveShare(input) {
|
|
|
958
1010
|
const govList = govNamed?.infoScope ?? null;
|
|
959
1011
|
const polScopeBinds = gov !== null && Array.isArray(govList) && (level === "team_row" || level === "relationship" || level === "account_internal" || level === "inside_starter" || level === "agency_default" && gov.policy.edited === true);
|
|
960
1012
|
const legacy = legacyCeilingList(input.legacyCeiling);
|
|
961
|
-
const
|
|
962
|
-
|
|
963
|
-
|
|
1013
|
+
const projectionPath = `policies.sharingScopeEdits[__default__][${purpose}] (projected from your account default policy)`;
|
|
1014
|
+
const projOverLegacy = legacy !== null ? defaultProjection : null;
|
|
1015
|
+
const ceilingIsStarter = legacy === null && defaultProjection === null;
|
|
1016
|
+
let groupCeiling = legacy ?? defaultProjection ?? pdRaw;
|
|
1017
|
+
let ceilingPath = legacy !== null ? "sharingScopeEdits (the account's partner / default rule \u2014 the legacy cell chain)" : defaultProjection !== null ? projectionPath : pd === null ? "no Platform default" : `pol-starter-${purpose} v${pd.version} (Platform default \u2014 the starting scope for this purpose)`;
|
|
964
1018
|
if (ceilingIsStarter && polScopeBinds) {
|
|
965
1019
|
groupCeiling = null;
|
|
966
1020
|
ceilingPath = "";
|
|
@@ -1062,6 +1116,17 @@ function resolveShare(input) {
|
|
|
1062
1116
|
`Outside what the \u201C${govName}\u201D policy allows for this purpose`
|
|
1063
1117
|
);
|
|
1064
1118
|
}
|
|
1119
|
+
if (allowed && !req && projOverLegacy !== null && !scopeListCovers(scope, projOverLegacy, g)) {
|
|
1120
|
+
allowed = false;
|
|
1121
|
+
reason = "Outside the payload for this purpose";
|
|
1122
|
+
path = projectionPath;
|
|
1123
|
+
}
|
|
1124
|
+
if (allowed && !req && projOverLegacy !== null && !scopeListStrictlyCovers(scope, projOverLegacy, g)) {
|
|
1125
|
+
addExcluded(
|
|
1126
|
+
outside((r) => scopeListCovers(scope, projOverLegacy, g, r)),
|
|
1127
|
+
"Outside the payload for this purpose"
|
|
1128
|
+
);
|
|
1129
|
+
}
|
|
1065
1130
|
const govRows = polScopeBinds ? own2(govItems, g) : void 0;
|
|
1066
1131
|
if (allowed && !req && isStringList2(govRows)) {
|
|
1067
1132
|
const keep = new Set(govRows);
|
|
@@ -1071,6 +1136,15 @@ function resolveShare(input) {
|
|
|
1071
1136
|
`Outside what the \u201C${govName}\u201D policy allows for this purpose`
|
|
1072
1137
|
);
|
|
1073
1138
|
}
|
|
1139
|
+
const defRows = defaultItems === null ? void 0 : own2(defaultItems.rows, g);
|
|
1140
|
+
if (allowed && !req && isStringList2(defRows)) {
|
|
1141
|
+
const keep = new Set(defRows);
|
|
1142
|
+
const kept = (r) => keep.has(r) || scope.ancestorsOf(r).some((a) => a !== g && keep.has(a));
|
|
1143
|
+
addExcluded(
|
|
1144
|
+
outside(kept),
|
|
1145
|
+
`Outside what the \u201C${defaultItems?.name ?? ""}\u201D policy allows for this purpose`
|
|
1146
|
+
);
|
|
1147
|
+
}
|
|
1074
1148
|
if (allowed && !req && tcScope !== null && !scopeListCovers(scope, tcScope, g)) {
|
|
1075
1149
|
allowed = false;
|
|
1076
1150
|
reason = `Outside what your team's \u201C${tcNamed?.name}\u201D policy allows`;
|