@htilabs/platform-common-models 0.47.0 → 0.48.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/dist/index.d.cts CHANGED
@@ -11,7 +11,7 @@ export { CvcRegistryService, CvcRegistryServiceOptions, EntryLoader, ICvcEntry,
11
11
  export { C as CreateInformationScopeResolverInput, I as INFORMATION_SCOPE_POLICY_VERSION_ROW_NOTE, a as INFORMATION_SCOPE_READABLE_VERSIONS, b as INFORMATION_SCOPE_SYSTEM_INFO, c as INFORMATION_SCOPE_VERSION, d as InformationScopeResolver, S as ScopeApp, e as ScopeApps, f as ScopeCodeReading, g as ScopeKindBranch, h as ScopeMigration, i as ScopeMigrationRule, j as ScopePersonKind, k as ScopeReadOptions, l as ScopeReading, m as ScopeReadingRule, n as ScopeReadingSubject, o as ScopeRetainedReading, p as ScopeRow, q as ScopeRowStatus, r as ScopeRowType, s as ScopeShareOptions, t as ScopeShareReason, u as ScopeShareVerdict, v as ScopeSpecialDataType, w as ScopeSubjectKind, x as StoredScopeList, y as createInformationScopeResolver, z as isScopeInstrumentRow, A as isScopeRestRow, B as isSelectableScopeRow, D as kindForPerson } from './informationScopeResolver-BzYu97DE.cjs';
12
12
  export { CoreInformationScopeSot, CoreInformationScopeSotEntry, CoreInformationScopeSotMigrationLine, scopeMigrationsFromSot, scopeRowsFromSot } from './information-scope/index.cjs';
13
13
  export { CalendarDate, CalendarDateLike, DOB_MIN_YEAR, DobLike, PartialDob, PartialDobLike, ageFromDob, ageInputFromStoredDob, calendarDateOf, normalizeDob } from './age/index.cjs';
14
- export { AuthzFunctionRow, AuthzRoleOverrides, AuthzRoleRow, AuthzStateMap, AuthzTeamPolicy, AuthzTier1StateMap, CORE_FUNCTION_DEFAULT_BOUNDS, CORE_FUNCTION_DEFAULT_BOUNDS_SOT_VERSION, ResolveEffectiveFunctionsInput, VIEWING_LEVEL_FUNCTIONS, ViewingLevel, codebookDefaultBound, isCanonEvaluableFunction, resolveEffectiveFunctions, resolveEffectiveViewingLevel, selectActingTeamId, viewingLevelFromFunctions } from './authz/index.cjs';
14
+ export { AuthzFunctionRow, AuthzRoleOverrides, AuthzRoleRow, AuthzStateMap, AuthzTeamPolicy, AuthzTier1StateMap, CORE_FUNCTION_DEFAULT_BOUNDS, CORE_FUNCTION_DEFAULT_BOUNDS_SOT_VERSION, FunctionDoorInput, FunctionDoorState, FunctionLabelLookup, ResolveEffectiveFunctionsInput, VIEWING_LEVEL_FUNCTIONS, ViewingLevel, canonicalRoleCode, codebookDefaultBound, functionDoor, isCanonEvaluableFunction, resolveEffectiveFunctions, resolveEffectiveViewingLevel, selectActingTeamId, viewingLevelFromFunctions } from './authz/index.cjs';
15
15
  export { AccountSharePurposePolicy, EffectiveSharingCeiling, EffectiveSharingCeilingInputs, HTI_SHARE_PLATFORM_PURPOSE_ENABLED, HTI_SHARE_PLATFORM_REQUIRED_BY_PURPOSE, HTI_SHARE_PLATFORM_STARTER, HTI_SHARE_PLATFORM_STARTER_SOURCE, INFORMATION_SCOPE_FIELD_HOME_ROWS, SHARE_LEVEL_LABEL, SHARE_PLATFORM_STATE_LABEL, SHARE_POSTURE_RANK, SHARE_REPORTING_PURPOSES, SHARING_CEILING_DEFAULT_ROW_KEY, SHARING_CEILING_EXTERNAL_ROW_KEY, SHARING_CEILING_SCOPE_VERSION, ShareAttachmentIndex, ShareCategoryEntry, ShareDefaultScopeOptions, ShareLevel, ShareNamedPolicy, SharePlatformDefault, SharePlatformState, SharePolicyAssignment, SharePolicyDoc, SharePosture, ShareRecipient, ShareResolution, ShareResolveInput, ShareTeamRowLike, SharingCeilingAllowed, SharingCeilingCellLike, SharingCeilingRung, SharingCeilingScope, SharingPlatformStarter, SharingPurposeLists, SharingScopeCeiling, SharingScopeEdits, accountSharePurposePolicy, attachmentIndexFromPolicies, ceilingCoverage, derivePlatformDefault, effectiveCeiling, hasOwnScopeContent, intersectSharingCeilingLists, isCeilingCoverageRow, isPermittedByCeiling, isSharingPurposeDisabled, liveCategories, maskSelectionToCeiling, matchTeamRow, platformDefaultFor, resolveShare, rowsExpandedByCeiling, rowsOutsideCeiling, rowsOverCeiling, scopeListCovers, scopeListStrictlyCovers, scopeRowWithinCeiling, shareDefaultScopeFor, shareRowCeiling, sharingCeilingCellList, sharingCeilingRowKey, sharingScopeEditsFromCells, systemCategoryOf } from './sharing-ceiling/index.cjs';
16
16
  export { A as AgencyOrgTypeFieldsInput, a as AgencyOrgTypeFieldsSchema, b as AgencyTypeKeyInput, c as AgencyTypeKeySchema, C as CvcCode, d as CvcCodeSchema, e as CvcDomain, f as CvcEntrySchema, g as CvcEnvelope, h as CvcEnvelopeSchema, i as CvcKey, j as CvcKeySchema, O as OrgTypeFieldsSchema, k as OrgTypeSelectableKeyInput, l as OrgTypeSelectableKeySchema, S as ServiceCategoryEntry, m as ServiceCategoryEntrySchema, n as SetOrgTypeInput, o as SetOrgTypeInputSchema, T as TeamApp, p as TeamAppSchema, q as TeamDirectoryFieldsInput, r as TeamDirectoryFieldsSchema, s as orgTypeFieldsShape, w as withOrgTypeFields } from './agency-8ufZJJDH.cjs';
17
17
  export { accommodationTypeSot, actionStepCompletionStatusSot, actionStepTypeSot, activityTypeSot, adminRolesSot, administeringJurisdictionSot, ageBinReportingSot, announcementAudienceScopeSot, announcementResponseTypeSot, assertionDomainSot, assertionStatusSot, basisQuickPicksSot, birthCountryReportingSot, carCorrectionReasonSot, caseShareStateSot, checkInActivitySot, checkInPhaseSot, childBehavioralConcernsSot, childChangeTypeSot, childCustodyArrangementSot, citizenshipSot, collectionContextSot, contactInfoTypesSot, contactInfoUseTypeSot, contactLinkTypeSot, contactSafetyStatusSot, coreDhStateSot, coreFunctionsSot, coreIndicatorsSot, coreInformationScopeSot, coreReferralOutcomeSot, countriesSot, createdBySystemSot, criminalOrgCategorySot, daIncidentArchiveReasonSot, daIncidentConfidenceSot, daIncidentDayApproxSot, daIncidentSeveritySot, determinationHelperCategoriesSot, determinationLevelSot, disabilityReportingSot, disabilitySubtypeSot, discretionLevelSot, emergencyContactCallReasonSot, emergencyContactPermissionsSot, emergencyExitCascadeSot, employmentStatusSot, englishProficiencySot, enrollmentApplicationStatusSot, exitProcessChecklistItemSot, exitReasonsSot, exploitationTypeSot, eyeColorSot, facialHairSot, facilitatorEntityTypeSot, facilitatorLabelUsedInSourceSot, facilitatorSubroleSot, frequencyCadenceSot, funderSot, genderIdentitySot, genderReportingSot, generalDisabilitySot, goalCategorySot, goalPrioritySot, goalStatusSot, goalWithdrawalReasonSot, hairColorSot, hasTattoosSot, highestEducationLevelCompletedSot, hivStatusSot, hmisCurrentLivingSituationSot, hmisProjectTypeSot, hmisRelationshipToHohSot, hmisSexSot, homelessStatusSot, hopeScaleCaptureContextSot, hopeScaleResponseOptionsSot, hopeScaleTierSot, housingSubsidyTypesSot, htTypeSot, identificationStatusSot, immigrationLegalStatusChangeTypeSot, incarcerationEpisodeTypeSot, incidentInvolvementRolesSot, incidentParticipationRolesSot, incomeBenefitsSourcesSot, inferenceTypeSot, investigativeRequestTypeSot, juvenileJusticeEpisodeTypeSot, juvenileJusticeInvolvementStatusSot, languagesSot, leReportStatusSot, legalActionTypeSot, livingSituationSot, locationTypeSot, maritalStatusLegalSot, mentalHealthStatusSot, messageReportReasonSot, midStayEventTypeSot, milestoneTypeSot, militaryBranchSot, militaryStatusSot, minorAdultStatusSot, nameTypeSot, needsAssessmentChangeTypeSot, needsResidentialAgainSot, offenderStatusFamilySot, offenderStatusSot, orientationIdentitySot, personRelationshipsSot, petExitReasonSot, petRelationshipBasisSot, poPetitionBasisSot, poStatusSot, poViolationStatusSot, preferredContactMethodSot, primaryLanguageSot, programEnrollmentChangeTypeSot, programSpecificCodeSot, pronounsSot, proofOfIdTypeSot, provenanceSourceIdSot, qualityFlagsSot, raceEthnicityReportingSot, raceEthnicitySot, radiusBucketSot, recencyBandSot, referenceLinkTypeSot, referralEntityCategorySot, referralOriginSot, relationshipConcernSot, relationshipDynamicsSot, relationshipStatusCurrentSot, relationshipTiesSot, returnedToAbuserStatusSot, riskCategorySot, riskIdentificationMilestoneSot, riskSeverityBandSot, roiMethodSot, roiScopeSot, roiStatusSot, roleContextSot, romanticRelationshipChangeTypeSot, rsvpResponseSot, serviceAudienceSot, serviceCategoriesSot, serviceDeliveryChangeTypeSot, serviceDeliveryChannelSot, serviceMechanismsSot, servicePlanClosureReasonSot, servicePlanReviewSnoozeReasonSot, serviceSourceSot, serviceStatesSot, sessionNoteVisibilitySot, sessionStateSot, sessionTemplateSot, severityFollowUpSot, sexProviderSubroleSot, shareCadenceSot, sharePurposeSot, shareResponseReasonSot, signatureMethodSot, signatureTypeSot, smtBodyLocationSot, smtNameRelationSot, smtSignificanceFlagsSot, smtTypeSot, sourceCategorySot, sourceInstrumentSot, sourceSubtypeSot, sourceSystemSot, specialNeedsDisabilitiesSot, subjectTypeSot, substanceUseStatusSot, suggestionSourceSot, supportStrengthSot, supportTopicSot, threadStatusSot, threadTypeSot, timeScopeSot, traffickingRelevantRoleSot, tribesSot, userRolesSot, verificationMethodSot, verificationStatusSot, veteranStatusSot, victimAbuseTypesSot, victimStatusFamilySot, visaTypeSot, whyNotsSot } from './cvcs/index.cjs';
package/dist/index.d.ts CHANGED
@@ -11,7 +11,7 @@ export { CvcRegistryService, CvcRegistryServiceOptions, EntryLoader, ICvcEntry,
11
11
  export { C as CreateInformationScopeResolverInput, I as INFORMATION_SCOPE_POLICY_VERSION_ROW_NOTE, a as INFORMATION_SCOPE_READABLE_VERSIONS, b as INFORMATION_SCOPE_SYSTEM_INFO, c as INFORMATION_SCOPE_VERSION, d as InformationScopeResolver, S as ScopeApp, e as ScopeApps, f as ScopeCodeReading, g as ScopeKindBranch, h as ScopeMigration, i as ScopeMigrationRule, j as ScopePersonKind, k as ScopeReadOptions, l as ScopeReading, m as ScopeReadingRule, n as ScopeReadingSubject, o as ScopeRetainedReading, p as ScopeRow, q as ScopeRowStatus, r as ScopeRowType, s as ScopeShareOptions, t as ScopeShareReason, u as ScopeShareVerdict, v as ScopeSpecialDataType, w as ScopeSubjectKind, x as StoredScopeList, y as createInformationScopeResolver, z as isScopeInstrumentRow, A as isScopeRestRow, B as isSelectableScopeRow, D as kindForPerson } from './informationScopeResolver-BzYu97DE.js';
12
12
  export { CoreInformationScopeSot, CoreInformationScopeSotEntry, CoreInformationScopeSotMigrationLine, scopeMigrationsFromSot, scopeRowsFromSot } from './information-scope/index.js';
13
13
  export { CalendarDate, CalendarDateLike, DOB_MIN_YEAR, DobLike, PartialDob, PartialDobLike, ageFromDob, ageInputFromStoredDob, calendarDateOf, normalizeDob } from './age/index.js';
14
- export { AuthzFunctionRow, AuthzRoleOverrides, AuthzRoleRow, AuthzStateMap, AuthzTeamPolicy, AuthzTier1StateMap, CORE_FUNCTION_DEFAULT_BOUNDS, CORE_FUNCTION_DEFAULT_BOUNDS_SOT_VERSION, ResolveEffectiveFunctionsInput, VIEWING_LEVEL_FUNCTIONS, ViewingLevel, codebookDefaultBound, isCanonEvaluableFunction, resolveEffectiveFunctions, resolveEffectiveViewingLevel, selectActingTeamId, viewingLevelFromFunctions } from './authz/index.js';
14
+ export { AuthzFunctionRow, AuthzRoleOverrides, AuthzRoleRow, AuthzStateMap, AuthzTeamPolicy, AuthzTier1StateMap, CORE_FUNCTION_DEFAULT_BOUNDS, CORE_FUNCTION_DEFAULT_BOUNDS_SOT_VERSION, FunctionDoorInput, FunctionDoorState, FunctionLabelLookup, ResolveEffectiveFunctionsInput, VIEWING_LEVEL_FUNCTIONS, ViewingLevel, canonicalRoleCode, codebookDefaultBound, functionDoor, isCanonEvaluableFunction, resolveEffectiveFunctions, resolveEffectiveViewingLevel, selectActingTeamId, viewingLevelFromFunctions } from './authz/index.js';
15
15
  export { AccountSharePurposePolicy, EffectiveSharingCeiling, EffectiveSharingCeilingInputs, HTI_SHARE_PLATFORM_PURPOSE_ENABLED, HTI_SHARE_PLATFORM_REQUIRED_BY_PURPOSE, HTI_SHARE_PLATFORM_STARTER, HTI_SHARE_PLATFORM_STARTER_SOURCE, INFORMATION_SCOPE_FIELD_HOME_ROWS, SHARE_LEVEL_LABEL, SHARE_PLATFORM_STATE_LABEL, SHARE_POSTURE_RANK, SHARE_REPORTING_PURPOSES, SHARING_CEILING_DEFAULT_ROW_KEY, SHARING_CEILING_EXTERNAL_ROW_KEY, SHARING_CEILING_SCOPE_VERSION, ShareAttachmentIndex, ShareCategoryEntry, ShareDefaultScopeOptions, ShareLevel, ShareNamedPolicy, SharePlatformDefault, SharePlatformState, SharePolicyAssignment, SharePolicyDoc, SharePosture, ShareRecipient, ShareResolution, ShareResolveInput, ShareTeamRowLike, SharingCeilingAllowed, SharingCeilingCellLike, SharingCeilingRung, SharingCeilingScope, SharingPlatformStarter, SharingPurposeLists, SharingScopeCeiling, SharingScopeEdits, accountSharePurposePolicy, attachmentIndexFromPolicies, ceilingCoverage, derivePlatformDefault, effectiveCeiling, hasOwnScopeContent, intersectSharingCeilingLists, isCeilingCoverageRow, isPermittedByCeiling, isSharingPurposeDisabled, liveCategories, maskSelectionToCeiling, matchTeamRow, platformDefaultFor, resolveShare, rowsExpandedByCeiling, rowsOutsideCeiling, rowsOverCeiling, scopeListCovers, scopeListStrictlyCovers, scopeRowWithinCeiling, shareDefaultScopeFor, shareRowCeiling, sharingCeilingCellList, sharingCeilingRowKey, sharingScopeEditsFromCells, systemCategoryOf } from './sharing-ceiling/index.js';
16
16
  export { A as AgencyOrgTypeFieldsInput, a as AgencyOrgTypeFieldsSchema, b as AgencyTypeKeyInput, c as AgencyTypeKeySchema, C as CvcCode, d as CvcCodeSchema, e as CvcDomain, f as CvcEntrySchema, g as CvcEnvelope, h as CvcEnvelopeSchema, i as CvcKey, j as CvcKeySchema, O as OrgTypeFieldsSchema, k as OrgTypeSelectableKeyInput, l as OrgTypeSelectableKeySchema, S as ServiceCategoryEntry, m as ServiceCategoryEntrySchema, n as SetOrgTypeInput, o as SetOrgTypeInputSchema, T as TeamApp, p as TeamAppSchema, q as TeamDirectoryFieldsInput, r as TeamDirectoryFieldsSchema, s as orgTypeFieldsShape, w as withOrgTypeFields } from './agency-CnVTwLeV.js';
17
17
  export { accommodationTypeSot, actionStepCompletionStatusSot, actionStepTypeSot, activityTypeSot, adminRolesSot, administeringJurisdictionSot, ageBinReportingSot, announcementAudienceScopeSot, announcementResponseTypeSot, assertionDomainSot, assertionStatusSot, basisQuickPicksSot, birthCountryReportingSot, carCorrectionReasonSot, caseShareStateSot, checkInActivitySot, checkInPhaseSot, childBehavioralConcernsSot, childChangeTypeSot, childCustodyArrangementSot, citizenshipSot, collectionContextSot, contactInfoTypesSot, contactInfoUseTypeSot, contactLinkTypeSot, contactSafetyStatusSot, coreDhStateSot, coreFunctionsSot, coreIndicatorsSot, coreInformationScopeSot, coreReferralOutcomeSot, countriesSot, createdBySystemSot, criminalOrgCategorySot, daIncidentArchiveReasonSot, daIncidentConfidenceSot, daIncidentDayApproxSot, daIncidentSeveritySot, determinationHelperCategoriesSot, determinationLevelSot, disabilityReportingSot, disabilitySubtypeSot, discretionLevelSot, emergencyContactCallReasonSot, emergencyContactPermissionsSot, emergencyExitCascadeSot, employmentStatusSot, englishProficiencySot, enrollmentApplicationStatusSot, exitProcessChecklistItemSot, exitReasonsSot, exploitationTypeSot, eyeColorSot, facialHairSot, facilitatorEntityTypeSot, facilitatorLabelUsedInSourceSot, facilitatorSubroleSot, frequencyCadenceSot, funderSot, genderIdentitySot, genderReportingSot, generalDisabilitySot, goalCategorySot, goalPrioritySot, goalStatusSot, goalWithdrawalReasonSot, hairColorSot, hasTattoosSot, highestEducationLevelCompletedSot, hivStatusSot, hmisCurrentLivingSituationSot, hmisProjectTypeSot, hmisRelationshipToHohSot, hmisSexSot, homelessStatusSot, hopeScaleCaptureContextSot, hopeScaleResponseOptionsSot, hopeScaleTierSot, housingSubsidyTypesSot, htTypeSot, identificationStatusSot, immigrationLegalStatusChangeTypeSot, incarcerationEpisodeTypeSot, incidentInvolvementRolesSot, incidentParticipationRolesSot, incomeBenefitsSourcesSot, inferenceTypeSot, investigativeRequestTypeSot, juvenileJusticeEpisodeTypeSot, juvenileJusticeInvolvementStatusSot, languagesSot, leReportStatusSot, legalActionTypeSot, livingSituationSot, locationTypeSot, maritalStatusLegalSot, mentalHealthStatusSot, messageReportReasonSot, midStayEventTypeSot, milestoneTypeSot, militaryBranchSot, militaryStatusSot, minorAdultStatusSot, nameTypeSot, needsAssessmentChangeTypeSot, needsResidentialAgainSot, offenderStatusFamilySot, offenderStatusSot, orientationIdentitySot, personRelationshipsSot, petExitReasonSot, petRelationshipBasisSot, poPetitionBasisSot, poStatusSot, poViolationStatusSot, preferredContactMethodSot, primaryLanguageSot, programEnrollmentChangeTypeSot, programSpecificCodeSot, pronounsSot, proofOfIdTypeSot, provenanceSourceIdSot, qualityFlagsSot, raceEthnicityReportingSot, raceEthnicitySot, radiusBucketSot, recencyBandSot, referenceLinkTypeSot, referralEntityCategorySot, referralOriginSot, relationshipConcernSot, relationshipDynamicsSot, relationshipStatusCurrentSot, relationshipTiesSot, returnedToAbuserStatusSot, riskCategorySot, riskIdentificationMilestoneSot, riskSeverityBandSot, roiMethodSot, roiScopeSot, roiStatusSot, roleContextSot, romanticRelationshipChangeTypeSot, rsvpResponseSot, serviceAudienceSot, serviceCategoriesSot, serviceDeliveryChangeTypeSot, serviceDeliveryChannelSot, serviceMechanismsSot, servicePlanClosureReasonSot, servicePlanReviewSnoozeReasonSot, serviceSourceSot, serviceStatesSot, sessionNoteVisibilitySot, sessionStateSot, sessionTemplateSot, severityFollowUpSot, sexProviderSubroleSot, shareCadenceSot, sharePurposeSot, shareResponseReasonSot, signatureMethodSot, signatureTypeSot, smtBodyLocationSot, smtNameRelationSot, smtSignificanceFlagsSot, smtTypeSot, sourceCategorySot, sourceInstrumentSot, sourceSubtypeSot, sourceSystemSot, specialNeedsDisabilitiesSot, subjectTypeSot, substanceUseStatusSot, suggestionSourceSot, supportStrengthSot, supportTopicSot, threadStatusSot, threadTypeSot, timeScopeSot, traffickingRelevantRoleSot, tribesSot, userRolesSot, verificationMethodSot, verificationStatusSot, veteranStatusSot, victimAbuseTypesSot, victimStatusFamilySot, visaTypeSot, whyNotsSot } from './cvcs/index.js';
package/dist/index.js CHANGED
@@ -15174,13 +15174,7 @@ var CORE_FUNCTIONS_EVALUABLE_KEYS = [
15174
15174
  "viewing_level_3_components"
15175
15175
  ];
15176
15176
 
15177
- // src/authz/resolveEffectiveFunctions.ts
15178
- var CANON_EVALUABLE = new Set(
15179
- CORE_FUNCTIONS_EVALUABLE_KEYS.filter((k) => Object.hasOwn(CoreFunctionsKeys, k))
15180
- );
15181
- function isCanonEvaluableFunction(code) {
15182
- return CANON_EVALUABLE.has(code);
15183
- }
15177
+ // src/authz/storedReads.ts
15184
15178
  var ABSENT = { kind: "absent" };
15185
15179
  var MALFORMED = { kind: "malformed" };
15186
15180
  function isPlainObject(v) {
@@ -15202,6 +15196,27 @@ function readState(map, code) {
15202
15196
  if (v === DEFAULT_BOUND_STATE.NA) return PERMISSION_STATE.NEVER;
15203
15197
  return typeof v === "string" && STATES.has(v) ? v : "malformed";
15204
15198
  }
15199
+ function tier1State(roleFunctions, code) {
15200
+ const listed = roleFunctions.kind === "map" ? readState(roleFunctions.map, code) : void 0;
15201
+ if (listed === void 0) return void 0;
15202
+ return listed === "malformed" ? PERMISSION_STATE.NEVER : listed;
15203
+ }
15204
+ function catalogRowCode(row) {
15205
+ if (!isPlainObject(row)) return null;
15206
+ const code = own(row, "code");
15207
+ const retired = own(row, "retired");
15208
+ if (typeof code !== "string") return null;
15209
+ if (retired !== void 0 && retired !== false) return null;
15210
+ return code;
15211
+ }
15212
+
15213
+ // src/authz/resolveEffectiveFunctions.ts
15214
+ var CANON_EVALUABLE = new Set(
15215
+ CORE_FUNCTIONS_EVALUABLE_KEYS.filter((k) => Object.hasOwn(CoreFunctionsKeys, k))
15216
+ );
15217
+ function isCanonEvaluableFunction(code) {
15218
+ return CANON_EVALUABLE.has(code);
15219
+ }
15205
15220
  function teamValueRestricts(map, code) {
15206
15221
  const gate = readState(map, code);
15207
15222
  return gate !== void 0 && gate !== PERMISSION_STATE.PREF_YES && gate !== PERMISSION_STATE.ALWAYS;
@@ -15269,12 +15284,8 @@ function resolveEffectiveFunctions(input) {
15269
15284
  if (heldCodes.length === 0) return [];
15270
15285
  const vocabulary = [];
15271
15286
  for (const fn of catalog) {
15272
- if (!isPlainObject(fn)) continue;
15273
- const code = own(fn, "code");
15274
- const retired = own(fn, "retired");
15275
- if (typeof code !== "string" || !isCanonEvaluableFunction(code)) continue;
15276
- if (retired !== void 0 && retired !== false) continue;
15277
- vocabulary.push(code);
15287
+ const code = catalogRowCode(fn);
15288
+ if (code !== null && isCanonEvaluableFunction(code)) vocabulary.push(code);
15278
15289
  }
15279
15290
  const agencyAll = readContainer(input.agencyOverrides);
15280
15291
  const team = compileTeamGate(input.teamPolicy);
@@ -15286,9 +15297,8 @@ function resolveEffectiveFunctions(input) {
15286
15297
  const agency = agencyAll.kind === "map" ? readContainer(own(agencyAll.map, roleCode)) : agencyAll;
15287
15298
  for (const fn of vocabulary) {
15288
15299
  if (granted.has(fn)) continue;
15289
- const listed = roleFunctions.kind === "map" ? readState(roleFunctions.map, fn) : void 0;
15290
- if (listed === void 0) continue;
15291
- const tier1 = listed === "malformed" ? PERMISSION_STATE.NEVER : listed;
15300
+ const tier1 = tier1State(roleFunctions, fn);
15301
+ if (tier1 === void 0) continue;
15292
15302
  let state = tier1;
15293
15303
  if (tier1 !== PERMISSION_STATE.ALWAYS && tier1 !== PERMISSION_STATE.NEVER) {
15294
15304
  const override = agency.kind === "malformed" ? "malformed" : agency.kind === "map" ? readState(agency.map, fn) : void 0;
@@ -15419,6 +15429,219 @@ function codebookDefaultBound(functionCode, roleCode) {
15419
15429
  return Object.hasOwn(roles, roleCode) ? roles[roleCode] : null;
15420
15430
  }
15421
15431
 
15432
+ // src/generated/authzBrowserTables.ts
15433
+ var CORE_FUNCTION_TITLES = {
15434
+ "agency_info_manage": "Edit own agency's profile",
15435
+ "announcement_publish": "Publish announcements",
15436
+ "api_key_manage": "Manage API keys",
15437
+ "assessments_conduct": "Conduct Assessments",
15438
+ "auth_model_manage_platform": "Manage platform authorization model",
15439
+ "case_assign_reassign": "Assign / reassign case ownership",
15440
+ "case_claim": "Claim inbound share (PAVE)",
15441
+ "case_close": "Close case",
15442
+ "case_collaborator_add": "Share / Add Users to a case",
15443
+ "case_edit": "Edit Cases (add intake, case notes, goals, services)",
15444
+ "case_needs_action_flag_manage": "Manage case escalation / needs-action flags",
15445
+ "case_reopen": "Case Re-open",
15446
+ "case_side_panel_use": "Utilize side panel for comments/notes and uploads",
15447
+ "case_status_manage": "Change case status",
15448
+ "case_transfer_bulk": "Bulk transfer cases (turnover)",
15449
+ "case_view": "View (agency) Cases",
15450
+ "case_visibility_manage": "Go dark / restore case visibility",
15451
+ "ci_periodic_review": "Review criminal intelligence record (periodic)",
15452
+ "ci_record_purge_or_retire": "Retire or purge criminal intelligence record",
15453
+ "ci_record_validate": "Validate criminal intelligence record",
15454
+ "ci_to_evidence_export_authorize": "Authorize criminal intelligence \u2192 evidence export",
15455
+ "deconfliction_alert_acknowledge": "Accept a deconfliction alert",
15456
+ "deconfliction_unmask": "Unmask a deconfliction",
15457
+ "determination_perform": "Perform Determinations",
15458
+ "disclose_external_request": "Request External Disclosure",
15459
+ "enrollment_manage": "Manage program enrollments",
15460
+ "exit_discharge_conduct": "Conduct program exit / discharge",
15461
+ "export_deidentified": "Export de-identified reports/datasets",
15462
+ "goals_plan_manage": "Create and manage plans, goals, action steps",
15463
+ "idb_record_create": "Create IDB record",
15464
+ "indicator_manual_add": "Add a manual indicator",
15465
+ "investigation_create_claim": "Create Investigation + Claim a Tip / Lead",
15466
+ "investigation_session_run": "Run an investigation session",
15467
+ "investigative_database_search": "Search account IDB",
15468
+ "investigative_request_send": "Submit an investigative request (Ask HTI)",
15469
+ "lead_create": "Create a Tip / Lead",
15470
+ "lead_publish": "Publish a Tip / Lead",
15471
+ "lead_route_assign": "Route / assign a lead to an agency",
15472
+ "lead_triage_manage": "Triage leads",
15473
+ "magic_link_share_send": "Send Magic Link Shares",
15474
+ "mandatory_report_send": "Send mandatory report",
15475
+ "member_account_report_generate": "Member Account Report generation",
15476
+ "member_onboarding_support": "Assist member onboarding (support)",
15477
+ "message_moderate": "Moderate messages",
15478
+ "message_send": "Send platform messages",
15479
+ "milestone_log": "Log investigative milestones",
15480
+ "needs_priorities_conduct": "Conduct needs assessment and immediate priorities",
15481
+ "network_corpus_access": "Access raw/worked machine-network corpus",
15482
+ "note_open_departed_author": "Open a deactivated author's private notes",
15483
+ "onboarding_config_sign_off": "Approve the configuration summary (Phase III sign-off)",
15484
+ "open_source_search": "Search across all open source information",
15485
+ "person_association_update": "Assign or update person\u2019s role, relationships, phone numbers or social media associations",
15486
+ "person_merge_manage": "Manage person identity merges",
15487
+ "platform_perm_modify": "Modify Platform Permissions",
15488
+ "profile_domain_edit": "Edit subject profile domains",
15489
+ "record_activity_view": "View a record's activity log",
15490
+ "record_print": "Export/Print",
15491
+ "referral_receive_external": "Receive External Referrals",
15492
+ "referral_receive_internal": "Receive Internal Referrals",
15493
+ "referral_send_external": "Refer External (Excluding VSP to LE)",
15494
+ "referral_send_internal": "Refer Internal",
15495
+ "roi_submit_manage": "Upload/Edit/Submit ROI",
15496
+ "role_assign": "Role Assignment",
15497
+ "roles_accounts_toggle": "Toggle Roles / Accounts",
15498
+ "sandbox_environment_manage": "Manage sandbox and testing environments",
15499
+ "screening_conduct": "Conduct Screenings",
15500
+ "screening_view": "View Victim/Abuse Screening Responses",
15501
+ "service_log_manage": "Log and manage service instances",
15502
+ "session_create": "Record creation (sessions, cases, etc.)",
15503
+ "share_config": "Sharing Configuration",
15504
+ "share_revoke": "Revoke an active share / ROI",
15505
+ "share_rule_approve_cross_agency": "Approve cross-agency sharing rules",
15506
+ "share_vsp_to_le": "VSP to LE Share",
15507
+ "srl_manage": "Manage the agency's Service Registry (SRL)",
15508
+ "supervisee_thread_view": "View supervisee threads",
15509
+ "support_ticket_triage": "Triage support tickets / bug reports",
15510
+ "system_diagnostics_view": "View system diagnostics and logs (support)",
15511
+ "team_config_manage": "Team structure & admin scoping (account-level)",
15512
+ "team_membership_manage": "Manage team membership",
15513
+ "team_share_narrowing": "Narrow a team's sharing",
15514
+ "team_workflow_config_manage": "Manage team workflow configuration",
15515
+ "training_gate_manage": "Manage training/certification gates (i.e. required modules for roles + teams)",
15516
+ "usr_manage": "User Management",
15517
+ "viewing_config_manage": "Configure internal viewing (Type A)",
15518
+ "viewing_level_1_search": "Non-owned case identity on search",
15519
+ "viewing_level_2_autocomplete": "Non-owned case identity in autocomplete",
15520
+ "viewing_level_3_components": "Non-owned case component access"
15521
+ };
15522
+ var CANON_ROLE_CODE_LIST = [
15523
+ "case_nav",
15524
+ "healthcare_provider_medical",
15525
+ "behavioral_health_provider",
15526
+ "crisis_response",
15527
+ "intel_analyst",
15528
+ "investigator",
15529
+ "le_liaison_vsp",
15530
+ "legal_advocate",
15531
+ "mandatory_reporter",
15532
+ "mdt_participant",
15533
+ "prosecutor_review",
15534
+ "public_reporter",
15535
+ "research_analytics",
15536
+ "screener",
15537
+ "volunteer",
15538
+ "PLT-ADM",
15539
+ "PLT-SUP",
15540
+ "MEM-ADM",
15541
+ "TEAM-ADM",
15542
+ "AUD",
15543
+ "DATA-ADM",
15544
+ "GOV-AUD",
15545
+ "CIRO",
15546
+ "SUP",
15547
+ "TRAIN-ADM"
15548
+ ];
15549
+ var ROLE_CODE_RE_KEYS = {
15550
+ "missingness_root": null,
15551
+ "unknown": null,
15552
+ "anonymous": null,
15553
+ "data_not_collected": null,
15554
+ "hotline_op": "crisis_response",
15555
+ "case_advocate": "case_nav",
15556
+ "leads_investigator": "investigator",
15557
+ "MISSINGNESS-ROOT": null,
15558
+ "UNKNOWN": null,
15559
+ "ANONYMOUS": null,
15560
+ "DATA-NOT-COLLECTED": null,
15561
+ "acct_adm": "MEM-ADM",
15562
+ "ACCT-ADM": "MEM-ADM"
15563
+ };
15564
+
15565
+ // src/authz/roleCodes.ts
15566
+ var CANON_ROLE_CODES = new Set(CANON_ROLE_CODE_LIST);
15567
+ var SOURCES = new Map(Object.entries(ROLE_CODE_RE_KEYS));
15568
+ function canonicalRoleCode(code) {
15569
+ if (typeof code !== "string") return null;
15570
+ if (CANON_ROLE_CODES.has(code)) return code;
15571
+ return SOURCES.has(code) ? SOURCES.get(code) ?? null : null;
15572
+ }
15573
+
15574
+ // src/authz/functionDoor.ts
15575
+ var NOT_OFFERED = Object.freeze({
15576
+ offered: false,
15577
+ allowed: false,
15578
+ reason: null
15579
+ });
15580
+ function labelFor(functionKey, lookup2) {
15581
+ let label;
15582
+ if (typeof lookup2 === "function") label = lookup2(functionKey);
15583
+ else if (lookup2 && Object.hasOwn(lookup2, functionKey)) label = lookup2[functionKey];
15584
+ if (typeof label === "string" && label.trim()) return label;
15585
+ return Object.hasOwn(CORE_FUNCTION_TITLES, functionKey) ? CORE_FUNCTION_TITLES[functionKey] : functionKey;
15586
+ }
15587
+ function drawsControl(state) {
15588
+ return state === PERMISSION_STATE.ALWAYS || state === PERMISSION_STATE.PREF_YES || state === PERMISSION_STATE.PREF_NO;
15589
+ }
15590
+ function indexRoleRows(rows) {
15591
+ const byCode = /* @__PURE__ */ new Map();
15592
+ if (!Array.isArray(rows)) return byCode;
15593
+ for (const r of rows) {
15594
+ const code = isPlainObject(r) ? own(r, "code") : void 0;
15595
+ if (isPlainObject(r) && typeof code === "string") byCode.set(code, r);
15596
+ }
15597
+ return byCode;
15598
+ }
15599
+ function liveRoleBound(rows, roleCode, functionKey) {
15600
+ const row = rows.get(roleCode);
15601
+ if (row === void 0) return false;
15602
+ const container = readContainer(own(row, "functions"));
15603
+ if (container.kind === "malformed") return false;
15604
+ return drawsControl(tier1State(container, functionKey));
15605
+ }
15606
+ function codebookRoleBound(roleCode, functionKey) {
15607
+ const bound = codebookDefaultBound(functionKey, roleCode);
15608
+ return bound !== DEFAULT_BOUND_STATE.NA && drawsControl(bound);
15609
+ }
15610
+ function functionDoor(input) {
15611
+ const { functionKey } = input;
15612
+ if (typeof functionKey !== "string" || !isCanonEvaluableFunction(functionKey)) {
15613
+ return { ...NOT_OFFERED };
15614
+ }
15615
+ let granted = false;
15616
+ for (const fn of input.effectiveFunctions) {
15617
+ if (fn === functionKey) {
15618
+ granted = true;
15619
+ break;
15620
+ }
15621
+ }
15622
+ if (granted) return { offered: true, allowed: true, reason: null };
15623
+ const functions = input.functions;
15624
+ if (functions !== void 0 && functions !== null) {
15625
+ const kept = Array.isArray(functions) && functions.some((row) => catalogRowCode(row) === functionKey);
15626
+ if (!kept) return { ...NOT_OFFERED };
15627
+ }
15628
+ const liveRows = input.roles;
15629
+ const live = liveRows !== void 0 && liveRows !== null ? indexRoleRows(liveRows) : null;
15630
+ const roleCodes = input.roleCodes;
15631
+ const bound = (Array.isArray(roleCodes) ? roleCodes : []).some((code) => {
15632
+ const canon = canonicalRoleCode(code);
15633
+ if (canon === null) return false;
15634
+ if (live === null) return codebookRoleBound(canon, functionKey);
15635
+ return liveRoleBound(live, canon, functionKey) || typeof code === "string" && code !== canon && liveRoleBound(live, code, functionKey);
15636
+ });
15637
+ if (!bound) return { ...NOT_OFFERED };
15638
+ return {
15639
+ offered: true,
15640
+ allowed: false,
15641
+ reason: `${labelFor(functionKey, input.label)} is not part of your roles`
15642
+ };
15643
+ }
15644
+
15422
15645
  // src/generated/sharingPlatformStarter.ts
15423
15646
  var SHARING_PLATFORM_STARTER_SOURCE = {
15424
15647
  "monolith": {
@@ -71449,6 +71672,7 @@ export {
71449
71672
  calendarDateOf,
71450
71673
  canonicalCoreIndicator,
71451
71674
  canonicalIncidentParticipationRole,
71675
+ canonicalRoleCode,
71452
71676
  canonicalServiceState,
71453
71677
  carCorrectionReason_v2_1_0_default as carCorrectionReasonSot,
71454
71678
  cascadeExclusions,
@@ -71519,6 +71743,7 @@ export {
71519
71743
  formSchemaOptions,
71520
71744
  formSectionRefSchema,
71521
71745
  frequencyCadence_v1_0_0_default as frequencyCadenceSot,
71746
+ functionDoor,
71522
71747
  funder_v1_0_0_default as funderSot,
71523
71748
  genderIdentity_v1_0_0_default as genderIdentitySot,
71524
71749
  genderReporting_v1_0_0_default as genderReportingSot,