@htilabs/platform-common-models 0.64.0 → 0.66.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
@@ -2,7 +2,7 @@ export { A as ACCOMMODATION_LABELS, a as ACCOMMODATION_OPTIONS, b as ACTIVE_CVC_
2
2
  export { ActiveServiceStateKey, DeprecatedServiceStateKey, IC48Catalog, IC48CatalogMeta, IC48Category, IC48CategoryCrosswalk, IC48CrisisServiceId, IC48DerivationServiceId, IC_48_BY_CODE, IC_48_BY_ID, IC_48_CATEGORIES, IC_48_CRISIS_SERVICES, IC_48_DERIVATION_SERVICES, IC_48_SERVICE_CATALOG, SERVICE_MECHANISM_CANONICAL, SERVICE_MECHANISM_CANONICAL_CODE, SERVICE_MECHANISM_REFERRAL_KEY, SERVICE_STAMP, SERVICE_STAMP_LEGACY_IDS, SERVICE_STAMP_ORDER, SERVICE_STAMP_PICKERS, SERVICE_STAMP_PRIORITY, SERVICE_STAMP_WORDS, SERVICE_STATE_DEPRECATED_KEYS, SERVICE_STATE_STAMP_CROSSWALK, ServiceChangeClaimWords, ServiceChangeClaimWordsInput, ServiceChangeNameKind, ServiceChangeNameResolver, ServiceMechanismCanonicalCode, ServiceStamp, ServiceStateForStampsOptions, SubstantiveServiceMechanismKey, UnrecognizedServiceMechanismError, UnrecognizedServiceStampError, WHY_NOT_BUCKETS, WHY_NOT_CODES, WHY_NOT_REPORTING_AXES, WhyNotCode, WhyNotLevel, WhyNotReportingAxis, canonicalServiceState, getIC48AncestorCategories, getIC48CategoryByCode, getIC48CategoryById, getIC48ChildCategories, getIC48Label, getIC48ParentCategory, getIC48SelectableCategories, getIC48TopicCategories, getIC48TopicForCategory, isDeprecatedServiceState, isNeverPickableServiceMechanism, isServiceStamp, normalizeServiceMechanismKeys, normalizeServiceStampId, normalizeServiceStamps, normalizeWhyNotCode, requireServiceMechanismKey, serviceChangeClaimWords, serviceChangeTypeKeyOf, serviceMechanismKeyForCanonicalCode, serviceStampForState, serviceStateForStamps, serviceStateStatusLabel, whyNotBucketOf, whyNotByCode, whyNotCodeReportingAxis, whyNotLeavesOf, whyNotReportingAxis, whyNotSecondaryOptions } from './constants/index.cjs';
3
3
  export { D as DEFAULT_BOUND_STATE, a as DEFAULT_BOUND_STATE_DISPLAY, b as DEFAULT_BOUND_STATE_LABELS, c as DEFAULT_BOUND_STATE_VALUES, d as DefaultBoundStateValue, F as FUNCTION_STATUS, e as FUNCTION_STATUS_LABELS, f as FUNCTION_STATUS_VALUES, g as FunctionStatusValue, P as PERMISSION_STATE, h as PERMISSION_STATE_DISPLAY, i as PERMISSION_STATE_LABELS, j as PERMISSION_STATE_VALUES, k as PLATFORM_TOOL, l as PLATFORM_TOOL_LABELS, m as PLATFORM_TOOL_VALUES, n as PermissionStateValue, o as PlatformToolValue, R as ROLE_LEVEL, p as ROLE_LEVEL_LABELS, q as ROLE_LEVEL_VALUES, r as RoleLevelValue, S as SHARE_VIEW, s as SHARE_VIEW_LABELS, t as SHARE_VIEW_VALUES, u as ShareViewValue } from './platform-auth-DJO-r9Pf.cjs';
4
4
  export { A as AGENCY_TYPE_KEYS, a as AgencyTypeKey, H as HEALTHCARE_ORG_TYPE_KEYS, L as LAW_ENFORCEMENT_ORG_TYPE_KEYS, b as LEGACY_NUMERIC_TO_REFERRAL_ENTITY_KEY, c as LEGAL_ORG_TYPE_KEYS, d as LegacyNumericReferralEntity, N as NO_SECTOR_ORG_TYPE_KEYS, O as ORG_TYPE_HEADING_KEYS, e as ORG_TYPE_KEYS, f as ORG_TYPE_NONPICKABLE_LEAF_KEYS, g as ORG_TYPE_PARENT_KEY, h as ORG_TYPE_SELECTABLE_KEYS, i as OrgTypeHeadingKey, j as OrgTypeKey, k as OrgTypeSelectableKey, R as REPORT_AUTHORITY_ORG_TYPE_KEYS, V as VICTIM_SERVING_ORG_TYPE_KEYS, l as isAgencyTypeKey, m as isHealthcareOrgType, n as isLawEnforcementOrgType, o as isLegalOrgType, p as isOrgTypeKey, q as isReportAuthorityOrgType, r as isVictimServingOrgType, s as orgTypeAncestry, t as orgTypeCanonicalCode, u as orgTypeDefaultSessionRole, v as orgTypeDefaultSessionRoleOrNull, w as orgTypeDefaultVsp, x as orgTypeEnumConstant, y as orgTypeLabel, z as orgTypeSector, B as resolveAgencyTypeKey, C as resolveOrgTypeKey, D as resolveOrgTypeKeyFromLegacyNumeric, E as resolveReferralEntityKeyFromLegacyNumeric } from './org-type-D_FG4KdN.cjs';
5
- export { AddOrganizationProgramsFieldOptions, Address, Demographics, Email, ORGANIZATION_PROGRAM_VALIDATED_UPDATE_OPS, OrganizationProgram, PersonName, Phone, TEAM_MODEL_NAME, TeamDirectoryFields, addOrgRecordFields, addOrganizationProgramsField, addTeamDirectoryFields, addressSchema, buildOrganizationProgramSchema, buildOrganizationProgramsFieldDefinition, demographicsSchema, emailSchema, orgAsBuiltSchemaDefinition, orgRecordSchemaDefinition, organizationProgramSchemaDefinition, organizationSchemaIssues, personNameSchema, phoneSchema, teamDirectorySchemaDefinition } from './schemas/index.cjs';
5
+ export { AddOrganizationProgramsFieldOptions, Address, Demographics, Email, ORGANIZATION_PROGRAM_VALIDATED_UPDATE_OPS, ORG_KEY_INDEX_NAME, ORG_KEY_INDEX_OPTIONS, ORG_KEY_INDEX_SPEC, OrganizationProgram, PersonName, Phone, TEAM_MODEL_NAME, TeamDirectoryFields, addOrgRecordFields, addOrganizationProgramsField, addTeamDirectoryFields, addressSchema, buildOrganizationProgramSchema, buildOrganizationProgramsFieldDefinition, demographicsSchema, emailSchema, orgAsBuiltSchemaDefinition, orgRecordSchemaDefinition, organizationProgramSchemaDefinition, organizationSchemaIssues, personNameSchema, phoneSchema, teamDirectorySchemaDefinition } from './schemas/index.cjs';
6
6
  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-BLeRivoF.cjs';
7
7
  export { A as AGENCY_ORG_TYPE_VALIDATED_UPDATE_OPS, a as AddAgencyOrgTypeFieldsOptions, 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';
8
8
  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, e as compileCvcEntryModel, f as compileCvcRegistryModel, 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-Bj-s0nZy.cjs';
@@ -14,6 +14,7 @@ export { CalendarDate, CalendarDateLike, DOB_MIN_YEAR, DobLike, PartialDob, Part
14
14
  export { AuthzFunctionRow, AuthzRoleOverrides, AuthzRoleRow, AuthzStateMap, AuthzTeamPolicy, AuthzTier1StateMap, CORE_FUNCTION_DEFAULT_BOUNDS, CORE_FUNCTION_DEFAULT_BOUNDS_SOT_VERSION, CORE_FUNCTION_NOTES, CORE_FUNCTION_NOTES_SOT_VERSION, CaseViewingAccess, CoreFunctionNotes, FunctionDoorInput, FunctionDoorState, FunctionLabelLookup, FunctionRefusal, GoverningViewingPolicy, RecordViewingDecision, RecordViewingReason, ResolveEffectiveFunctionsInput, StoredViewingWhitelist, VIEWING_LEVEL_FUNCTIONS, VIEWING_POLICY_SPECIES, VIEWING_POLICY_VOCABULARIES, ViewingContext, ViewingLevel, ViewingPolicyGoverning, ViewingPolicyNone, ViewingPolicyQuery, ViewingPolicyRef, ViewingPolicyScopeResolver, ViewingPolicyScopeVocab, ViewingPolicyUnavailable, ViewingPolicyUnavailableReason, ViewingPolicyVocabulary, ViewingRecord, ViewingScopeResolver, ViewingSurface, canonicalRoleCode, caseSurfacesAsStub, caseSurfacesOn, caseViewingAccess, codebookDefaultBound, coreFunctionNotes, explainFunctionRefusal, functionDoor, isCanonEvaluableFunction, recordViewing, resolveEffectiveFunctions, resolveEffectiveViewingLevel, resolveViewingPolicy, selectActingTeamId, teamViewingLevelFromPolicy, unavailableViewingPolicy, viewingComponentOpen, viewingLevelFromFunctions, viewingPolicyVocabulary, viewingRowVisible, viewingWhitelistFromPolicy } from './authz/index.cjs';
15
15
  export { AccountSharePurposePolicy, EffectiveSharingCeiling, EffectiveSharingCeilingInputs, FiredShare, 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_EVENT, SHARE_LEVEL_LABEL, SHARE_PLATFORM_STATE_LABEL, SHARE_POSTURE_RANK, SHARE_REPORTING_PURPOSES, SHARE_TRIGGER_EVENTS, SHARING_CEILING_DEFAULT_ROW_KEY, SHARING_CEILING_EXTERNAL_ROW_KEY, SHARING_CEILING_SCOPE_VERSION, ShareAttachmentIndex, ShareCategoryEntry, ShareDefaultScopeOptions, ShareEvent, ShareLevel, ShareListener, ShareNamedPolicy, SharePlatformDefault, SharePlatformState, SharePolicyAssignment, SharePolicyDoc, SharePosture, ShareRecipient, ShareResolution, ShareResolveInput, ShareTeamRowLike, ShareTriggerEventCode, SharingCeilingAllowed, SharingCeilingCellLike, SharingCeilingRung, SharingCeilingScope, SharingPlatformStarter, SharingPurposeLists, SharingScopeCeiling, SharingScopeEdits, accountSharePurposePolicy, attachmentIndexFromPolicies, ceilingCoverage, derivePlatformDefault, effectiveCeiling, fireShareEvent, firedShareKey, hasOwnScopeContent, intersectSharingCeilingLists, isCeilingCoverageRow, isPermittedByCeiling, isSharingPurposeDisabled, liveCategories, maskSelectionToCeiling, matchTeamRow, platformDefaultFor, policyIsShareListener, resolveShare, rowsExpandedByCeiling, rowsOutsideCeiling, rowsOverCeiling, scopeListCovers, scopeListStrictlyCovers, scopeRowWithinCeiling, shareDefaultScopeFor, shareListenersFor, shareRowCeiling, shareTriggerLabel, 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
+ export { O as ORG_KEY_PATTERN, i as isOrgKey, m as mintOrgKey } from './orgRecord-B4-ELaZ_.cjs';
17
18
  export { CodebookCatalog, CodebookCatalogEntry, accommodationTypeSot, actionStepCompletionStatusSot, actionStepTypeSot, activityTypeSot, adminRolesSot, administeringJurisdictionSot, ageBinReportingSot, announcementAudienceScopeSot, announcementResponseTypeSot, assertionDomainSot, assertionStatusSot, basisQuickPicksSot, birthCountryReportingSot, carCorrectionReasonSot, caseShareStateSot, checkInActivitySot, checkInPhaseSot, childBehavioralConcernsSot, childChangeTypeSot, childCustodyArrangementSot, citizenshipSot, codebookCodesOf, 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, recordRemovalReasonSot, referenceLinkTypeSot, referralEntityCategorySot, referralOriginSot, relationshipConcernSot, relationshipDynamicsSot, relationshipStatusCurrentSot, relationshipTiesSot, resolveCodebookCode, resolveCodebookGateAnswer, 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, vehicleBodyTypeSot, vehicleColorSot, verificationMethodSot, verificationStatusSot, veteranStatusSot, victimAbuseTypesSot, victimStatusFamilySot, visaTypeSot, whyNotsSot } from './cvcs/index.cjs';
18
19
  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';
19
20
  import 'mongoose';
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ export { A as ACCOMMODATION_LABELS, a as ACCOMMODATION_OPTIONS, b as ACTIVE_CVC_
2
2
  export { ActiveServiceStateKey, DeprecatedServiceStateKey, IC48Catalog, IC48CatalogMeta, IC48Category, IC48CategoryCrosswalk, IC48CrisisServiceId, IC48DerivationServiceId, IC_48_BY_CODE, IC_48_BY_ID, IC_48_CATEGORIES, IC_48_CRISIS_SERVICES, IC_48_DERIVATION_SERVICES, IC_48_SERVICE_CATALOG, SERVICE_MECHANISM_CANONICAL, SERVICE_MECHANISM_CANONICAL_CODE, SERVICE_MECHANISM_REFERRAL_KEY, SERVICE_STAMP, SERVICE_STAMP_LEGACY_IDS, SERVICE_STAMP_ORDER, SERVICE_STAMP_PICKERS, SERVICE_STAMP_PRIORITY, SERVICE_STAMP_WORDS, SERVICE_STATE_DEPRECATED_KEYS, SERVICE_STATE_STAMP_CROSSWALK, ServiceChangeClaimWords, ServiceChangeClaimWordsInput, ServiceChangeNameKind, ServiceChangeNameResolver, ServiceMechanismCanonicalCode, ServiceStamp, ServiceStateForStampsOptions, SubstantiveServiceMechanismKey, UnrecognizedServiceMechanismError, UnrecognizedServiceStampError, WHY_NOT_BUCKETS, WHY_NOT_CODES, WHY_NOT_REPORTING_AXES, WhyNotCode, WhyNotLevel, WhyNotReportingAxis, canonicalServiceState, getIC48AncestorCategories, getIC48CategoryByCode, getIC48CategoryById, getIC48ChildCategories, getIC48Label, getIC48ParentCategory, getIC48SelectableCategories, getIC48TopicCategories, getIC48TopicForCategory, isDeprecatedServiceState, isNeverPickableServiceMechanism, isServiceStamp, normalizeServiceMechanismKeys, normalizeServiceStampId, normalizeServiceStamps, normalizeWhyNotCode, requireServiceMechanismKey, serviceChangeClaimWords, serviceChangeTypeKeyOf, serviceMechanismKeyForCanonicalCode, serviceStampForState, serviceStateForStamps, serviceStateStatusLabel, whyNotBucketOf, whyNotByCode, whyNotCodeReportingAxis, whyNotLeavesOf, whyNotReportingAxis, whyNotSecondaryOptions } from './constants/index.js';
3
3
  export { D as DEFAULT_BOUND_STATE, a as DEFAULT_BOUND_STATE_DISPLAY, b as DEFAULT_BOUND_STATE_LABELS, c as DEFAULT_BOUND_STATE_VALUES, d as DefaultBoundStateValue, F as FUNCTION_STATUS, e as FUNCTION_STATUS_LABELS, f as FUNCTION_STATUS_VALUES, g as FunctionStatusValue, P as PERMISSION_STATE, h as PERMISSION_STATE_DISPLAY, i as PERMISSION_STATE_LABELS, j as PERMISSION_STATE_VALUES, k as PLATFORM_TOOL, l as PLATFORM_TOOL_LABELS, m as PLATFORM_TOOL_VALUES, n as PermissionStateValue, o as PlatformToolValue, R as ROLE_LEVEL, p as ROLE_LEVEL_LABELS, q as ROLE_LEVEL_VALUES, r as RoleLevelValue, S as SHARE_VIEW, s as SHARE_VIEW_LABELS, t as SHARE_VIEW_VALUES, u as ShareViewValue } from './platform-auth-DJO-r9Pf.js';
4
4
  export { A as AGENCY_TYPE_KEYS, a as AgencyTypeKey, H as HEALTHCARE_ORG_TYPE_KEYS, L as LAW_ENFORCEMENT_ORG_TYPE_KEYS, b as LEGACY_NUMERIC_TO_REFERRAL_ENTITY_KEY, c as LEGAL_ORG_TYPE_KEYS, d as LegacyNumericReferralEntity, N as NO_SECTOR_ORG_TYPE_KEYS, O as ORG_TYPE_HEADING_KEYS, e as ORG_TYPE_KEYS, f as ORG_TYPE_NONPICKABLE_LEAF_KEYS, g as ORG_TYPE_PARENT_KEY, h as ORG_TYPE_SELECTABLE_KEYS, i as OrgTypeHeadingKey, j as OrgTypeKey, k as OrgTypeSelectableKey, R as REPORT_AUTHORITY_ORG_TYPE_KEYS, V as VICTIM_SERVING_ORG_TYPE_KEYS, l as isAgencyTypeKey, m as isHealthcareOrgType, n as isLawEnforcementOrgType, o as isLegalOrgType, p as isOrgTypeKey, q as isReportAuthorityOrgType, r as isVictimServingOrgType, s as orgTypeAncestry, t as orgTypeCanonicalCode, u as orgTypeDefaultSessionRole, v as orgTypeDefaultSessionRoleOrNull, w as orgTypeDefaultVsp, x as orgTypeEnumConstant, y as orgTypeLabel, z as orgTypeSector, B as resolveAgencyTypeKey, C as resolveOrgTypeKey, D as resolveOrgTypeKeyFromLegacyNumeric, E as resolveReferralEntityKeyFromLegacyNumeric } from './org-type-BYQb9Qzq.js';
5
- export { AddOrganizationProgramsFieldOptions, Address, Demographics, Email, ORGANIZATION_PROGRAM_VALIDATED_UPDATE_OPS, OrganizationProgram, PersonName, Phone, TEAM_MODEL_NAME, TeamDirectoryFields, addOrgRecordFields, addOrganizationProgramsField, addTeamDirectoryFields, addressSchema, buildOrganizationProgramSchema, buildOrganizationProgramsFieldDefinition, demographicsSchema, emailSchema, orgAsBuiltSchemaDefinition, orgRecordSchemaDefinition, organizationProgramSchemaDefinition, organizationSchemaIssues, personNameSchema, phoneSchema, teamDirectorySchemaDefinition } from './schemas/index.js';
5
+ export { AddOrganizationProgramsFieldOptions, Address, Demographics, Email, ORGANIZATION_PROGRAM_VALIDATED_UPDATE_OPS, ORG_KEY_INDEX_NAME, ORG_KEY_INDEX_OPTIONS, ORG_KEY_INDEX_SPEC, OrganizationProgram, PersonName, Phone, TEAM_MODEL_NAME, TeamDirectoryFields, addOrgRecordFields, addOrganizationProgramsField, addTeamDirectoryFields, addressSchema, buildOrganizationProgramSchema, buildOrganizationProgramsFieldDefinition, demographicsSchema, emailSchema, orgAsBuiltSchemaDefinition, orgRecordSchemaDefinition, organizationProgramSchemaDefinition, organizationSchemaIssues, personNameSchema, phoneSchema, teamDirectorySchemaDefinition } from './schemas/index.js';
6
6
  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-BLeRivoF.js';
7
7
  export { A as AGENCY_ORG_TYPE_VALIDATED_UPDATE_OPS, a as AddAgencyOrgTypeFieldsOptions, 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';
8
8
  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, e as compileCvcEntryModel, f as compileCvcRegistryModel, 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-DvAypMJV.js';
@@ -14,6 +14,7 @@ export { CalendarDate, CalendarDateLike, DOB_MIN_YEAR, DobLike, PartialDob, Part
14
14
  export { AuthzFunctionRow, AuthzRoleOverrides, AuthzRoleRow, AuthzStateMap, AuthzTeamPolicy, AuthzTier1StateMap, CORE_FUNCTION_DEFAULT_BOUNDS, CORE_FUNCTION_DEFAULT_BOUNDS_SOT_VERSION, CORE_FUNCTION_NOTES, CORE_FUNCTION_NOTES_SOT_VERSION, CaseViewingAccess, CoreFunctionNotes, FunctionDoorInput, FunctionDoorState, FunctionLabelLookup, FunctionRefusal, GoverningViewingPolicy, RecordViewingDecision, RecordViewingReason, ResolveEffectiveFunctionsInput, StoredViewingWhitelist, VIEWING_LEVEL_FUNCTIONS, VIEWING_POLICY_SPECIES, VIEWING_POLICY_VOCABULARIES, ViewingContext, ViewingLevel, ViewingPolicyGoverning, ViewingPolicyNone, ViewingPolicyQuery, ViewingPolicyRef, ViewingPolicyScopeResolver, ViewingPolicyScopeVocab, ViewingPolicyUnavailable, ViewingPolicyUnavailableReason, ViewingPolicyVocabulary, ViewingRecord, ViewingScopeResolver, ViewingSurface, canonicalRoleCode, caseSurfacesAsStub, caseSurfacesOn, caseViewingAccess, codebookDefaultBound, coreFunctionNotes, explainFunctionRefusal, functionDoor, isCanonEvaluableFunction, recordViewing, resolveEffectiveFunctions, resolveEffectiveViewingLevel, resolveViewingPolicy, selectActingTeamId, teamViewingLevelFromPolicy, unavailableViewingPolicy, viewingComponentOpen, viewingLevelFromFunctions, viewingPolicyVocabulary, viewingRowVisible, viewingWhitelistFromPolicy } from './authz/index.js';
15
15
  export { AccountSharePurposePolicy, EffectiveSharingCeiling, EffectiveSharingCeilingInputs, FiredShare, 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_EVENT, SHARE_LEVEL_LABEL, SHARE_PLATFORM_STATE_LABEL, SHARE_POSTURE_RANK, SHARE_REPORTING_PURPOSES, SHARE_TRIGGER_EVENTS, SHARING_CEILING_DEFAULT_ROW_KEY, SHARING_CEILING_EXTERNAL_ROW_KEY, SHARING_CEILING_SCOPE_VERSION, ShareAttachmentIndex, ShareCategoryEntry, ShareDefaultScopeOptions, ShareEvent, ShareLevel, ShareListener, ShareNamedPolicy, SharePlatformDefault, SharePlatformState, SharePolicyAssignment, SharePolicyDoc, SharePosture, ShareRecipient, ShareResolution, ShareResolveInput, ShareTeamRowLike, ShareTriggerEventCode, SharingCeilingAllowed, SharingCeilingCellLike, SharingCeilingRung, SharingCeilingScope, SharingPlatformStarter, SharingPurposeLists, SharingScopeCeiling, SharingScopeEdits, accountSharePurposePolicy, attachmentIndexFromPolicies, ceilingCoverage, derivePlatformDefault, effectiveCeiling, fireShareEvent, firedShareKey, hasOwnScopeContent, intersectSharingCeilingLists, isCeilingCoverageRow, isPermittedByCeiling, isSharingPurposeDisabled, liveCategories, maskSelectionToCeiling, matchTeamRow, platformDefaultFor, policyIsShareListener, resolveShare, rowsExpandedByCeiling, rowsOutsideCeiling, rowsOverCeiling, scopeListCovers, scopeListStrictlyCovers, scopeRowWithinCeiling, shareDefaultScopeFor, shareListenersFor, shareRowCeiling, shareTriggerLabel, 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
+ export { O as ORG_KEY_PATTERN, i as isOrgKey, m as mintOrgKey } from './orgRecord-h3Z-V23F.js';
17
18
  export { CodebookCatalog, CodebookCatalogEntry, accommodationTypeSot, actionStepCompletionStatusSot, actionStepTypeSot, activityTypeSot, adminRolesSot, administeringJurisdictionSot, ageBinReportingSot, announcementAudienceScopeSot, announcementResponseTypeSot, assertionDomainSot, assertionStatusSot, basisQuickPicksSot, birthCountryReportingSot, carCorrectionReasonSot, caseShareStateSot, checkInActivitySot, checkInPhaseSot, childBehavioralConcernsSot, childChangeTypeSot, childCustodyArrangementSot, citizenshipSot, codebookCodesOf, 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, recordRemovalReasonSot, referenceLinkTypeSot, referralEntityCategorySot, referralOriginSot, relationshipConcernSot, relationshipDynamicsSot, relationshipStatusCurrentSot, relationshipTiesSot, resolveCodebookCode, resolveCodebookGateAnswer, 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, vehicleBodyTypeSot, vehicleColorSot, verificationMethodSot, verificationStatusSot, veteranStatusSot, victimAbuseTypesSot, victimStatusFamilySot, visaTypeSot, whyNotsSot } from './cvcs/index.js';
18
19
  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';
19
20
  import 'mongoose';
package/dist/index.js CHANGED
@@ -17770,6 +17770,7 @@ function isLiveOrganizationProgram(row) {
17770
17770
  // src/orgDirectory/orgRecord.ts
17771
17771
  var ORG_REVIEW_STATUS_VALUES = PROGRAM_REVIEW_STATUS_VALUES;
17772
17772
  var ORG_RECORD_FIELD_NAMES = Object.freeze([
17773
+ "key",
17773
17774
  "legalName",
17774
17775
  "commonName",
17775
17776
  "shortName",
@@ -17819,6 +17820,17 @@ var ORGANIZATION_ENVELOPE_KEYS = Object.freeze([
17819
17820
  "updatedUser",
17820
17821
  "updatedTime"
17821
17822
  ]);
17823
+ var ORG_KEY_PATTERN = /^[a-z0-9][a-z0-9_-]{0,119}$/;
17824
+ function isOrgKey(value) {
17825
+ return typeof value === "string" && ORG_KEY_PATTERN.test(value);
17826
+ }
17827
+ function mintOrgKey(id) {
17828
+ const hex = (typeof id === "string" ? id : id.toHexString()).trim().toLowerCase();
17829
+ if (!/^[0-9a-f]{24}$/.test(hex)) {
17830
+ throw new Error("mintOrgKey: needs the organization's 24-hex _id");
17831
+ }
17832
+ return `org-${hex}`;
17833
+ }
17822
17834
  var line = (max) => z.string().trim().min(1).max(max).nullable();
17823
17835
  var ORG_VSP_TWO_STEP_MESSAGE = "vspPrivateNonprofit is step 2 of the HMIS VSP two-step and requires vsp: true";
17824
17836
  var OrgIdentityWriteSchema = z.object({
@@ -17839,12 +17851,50 @@ var OrgVspWriteSchema = z.object({
17839
17851
 
17840
17852
  // src/schemas/organization.ts
17841
17853
  var HEX_24 = /^[0-9a-fA-F]{24}$/;
17854
+ var ORG_KEY_INDEX_NAME = "org_key_unique";
17855
+ var ORG_KEY_INDEX_SPEC = Object.freeze({ key: 1 });
17856
+ var ORG_KEY_INDEX_OPTIONS = Object.freeze({
17857
+ name: ORG_KEY_INDEX_NAME,
17858
+ unique: true,
17859
+ partialFilterExpression: Object.freeze({ key: Object.freeze({ $type: "string" }) })
17860
+ });
17842
17861
  function isStoredDirectoryId(value) {
17843
17862
  if (value == null) return true;
17844
17863
  if (typeof value === "string") return value.trim() !== "";
17845
17864
  return typeof value === "object" && typeof value.toHexString === "function" && HEX_24.test(value.toHexString());
17846
17865
  }
17847
17866
  var orgRecordSchemaDefinition = {
17867
+ /**
17868
+ * The Org's identifier (the UDD `id`): the same value in every database.
17869
+ * Never taken from a request body.
17870
+ *
17871
+ * `immutable` means the model stores a key only while it is creating the
17872
+ * row. Measured on Mongoose 9.3.1 against MongoDB (the fill's test file
17873
+ * holds each line):
17874
+ *
17875
+ * - `new Model({ key }).save()` and `Model.create({ key })` store it.
17876
+ * - An upsert stores it when the upsert inserts the row (`$setOnInsert`, or
17877
+ * `$set`, which Mongoose moves to `$setOnInsert`); on a row that already
17878
+ * exists the upsert leaves `key` as it was.
17879
+ * - On a row that already exists, `doc.key = …; doc.save()` and
17880
+ * `updateOne` / `findOneAndUpdate` with `$set: { key }` do NOT write it,
17881
+ * and do not report an error. That holds whether the row has a key or has
17882
+ * none yet, so a model cannot give an old row its first key either.
17883
+ *
17884
+ * So an app stores `key: mintOrgKey(_id)` where it creates the
17885
+ * organization (`new Model().save()`, `create()`, or `$setOnInsert` on an
17886
+ * upsert). Rows that already exist get theirs from the registry fill's key
17887
+ * sheet, which writes with the plain MongoDB driver.
17888
+ */
17889
+ key: {
17890
+ type: String,
17891
+ trim: true,
17892
+ immutable: true,
17893
+ validate: {
17894
+ validator: (value) => value == null || isOrgKey(value),
17895
+ message: "key must be a lower-case slug (a-z, 0-9, _ and -)"
17896
+ }
17897
+ },
17848
17898
  /** The canonical reporting name (HMIS, funders). Readers fall back to `name`. */
17849
17899
  legalName: { type: String, trim: true },
17850
17900
  /** The name people use, when it differs from `name`. */
@@ -17893,6 +17943,13 @@ var orgAsBuiltSchemaDefinition = {
17893
17943
  };
17894
17944
  function addOrgRecordFields(schema, options = {}) {
17895
17945
  schema.add(orgRecordSchemaDefinition);
17946
+ schema.index(
17947
+ { ...ORG_KEY_INDEX_SPEC },
17948
+ {
17949
+ ...ORG_KEY_INDEX_OPTIONS,
17950
+ partialFilterExpression: { key: { ...ORG_KEY_INDEX_OPTIONS.partialFilterExpression.key } }
17951
+ }
17952
+ );
17896
17953
  for (const key of ORG_AS_BUILT_FIELD_NAMES) {
17897
17954
  if (schema.pathType(key) === "adhocOrUndefined") {
17898
17955
  schema.add({ [key]: orgAsBuiltSchemaDefinition[key] });
@@ -17901,6 +17958,7 @@ function addOrgRecordFields(schema, options = {}) {
17901
17958
  return installVspTwoStepHooks(schema, options);
17902
17959
  }
17903
17960
  var EXPECTED_INSTANCE = {
17961
+ key: "String",
17904
17962
  legalName: "String",
17905
17963
  commonName: "String",
17906
17964
  shortName: "String",
@@ -73802,6 +73860,10 @@ export {
73802
73860
  NeedsAssessmentChangeTypeKeys,
73803
73861
  NeedsResidentialAgainKeys,
73804
73862
  ORGANIZATION_PROGRAM_VALIDATED_UPDATE_OPS,
73863
+ ORG_KEY_INDEX_NAME,
73864
+ ORG_KEY_INDEX_OPTIONS,
73865
+ ORG_KEY_INDEX_SPEC,
73866
+ ORG_KEY_PATTERN,
73805
73867
  ORG_TYPE_FIELD_NAMES,
73806
73868
  ORG_TYPE_HEADING_KEYS,
73807
73869
  ORG_TYPE_KEYS,
@@ -74155,6 +74217,7 @@ export {
74155
74217
  isLgbtqOrientation,
74156
74218
  isLiveOrganizationProgram,
74157
74219
  isNeverPickableServiceMechanism,
74220
+ isOrgKey,
74158
74221
  isOrgTypeKey,
74159
74222
  isPermittedByCeiling,
74160
74223
  isProgramReviewStatus,
@@ -74188,6 +74251,7 @@ export {
74188
74251
  militaryBranch_v1_0_0_default as militaryBranchSot,
74189
74252
  militaryStatus_v1_0_0_default as militaryStatusSot,
74190
74253
  minorAdultStatus_v1_0_0_default as minorAdultStatusSot,
74254
+ mintOrgKey,
74191
74255
  mirrorOrgTypeFields,
74192
74256
  nameType_v1_0_0_default as nameTypeSot,
74193
74257
  needsAssessmentChangeType_v1_0_0_default as needsAssessmentChangeTypeSot,