@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/README.md +146 -0
- package/dist/index.cjs +70 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +64 -0
- package/dist/index.js.map +1 -1
- package/dist/org-directory/index.cjs +19 -0
- package/dist/org-directory/index.cjs.map +1 -1
- package/dist/org-directory/index.d.cts +6 -236
- package/dist/org-directory/index.d.ts +6 -236
- package/dist/org-directory/index.js +16 -0
- package/dist/org-directory/index.js.map +1 -1
- package/dist/orgRecord-B4-ELaZ_.d.cts +263 -0
- package/dist/orgRecord-h3Z-V23F.d.ts +263 -0
- package/dist/points-of-contact/index.cjs +6 -0
- package/dist/points-of-contact/index.cjs.map +1 -1
- package/dist/points-of-contact/index.js +6 -0
- package/dist/points-of-contact/index.js.map +1 -1
- package/dist/schemas/index.cjs +57 -0
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +52 -1
- package/dist/schemas/index.d.ts +52 -1
- package/dist/schemas/index.js +54 -0
- package/dist/schemas/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/root-org-key-exports.test.ts +24 -0
- package/src/index.ts +7 -0
- package/src/orgDirectory/__tests__/orgKey.test.ts +84 -0
- package/src/orgDirectory/orgRecord.ts +41 -3
- package/src/orgDirectory/rules.ts +4 -1
- package/src/schemas/index.ts +3 -0
- package/src/schemas/organization.ts +58 -0
|
@@ -756,6 +756,7 @@ function isListedOrganization(row) {
|
|
|
756
756
|
return active && row.reviewStatus !== ORG_REVIEW_STATUS.REJECTED;
|
|
757
757
|
}
|
|
758
758
|
var ORG_RECORD_FIELD_NAMES = Object.freeze([
|
|
759
|
+
"key",
|
|
759
760
|
"legalName",
|
|
760
761
|
"commonName",
|
|
761
762
|
"shortName",
|
|
@@ -805,6 +806,10 @@ var ORGANIZATION_ENVELOPE_KEYS = Object.freeze([
|
|
|
805
806
|
"updatedUser",
|
|
806
807
|
"updatedTime"
|
|
807
808
|
]);
|
|
809
|
+
var ORG_KEY_PATTERN = /^[a-z0-9][a-z0-9_-]{0,119}$/;
|
|
810
|
+
function isOrgKey(value) {
|
|
811
|
+
return typeof value === "string" && ORG_KEY_PATTERN.test(value);
|
|
812
|
+
}
|
|
808
813
|
var line = (max) => z3.string().trim().min(1).max(max).nullable();
|
|
809
814
|
var ORG_VSP_TWO_STEP_MESSAGE = "vspPrivateNonprofit is step 2 of the HMIS VSP two-step and requires vsp: true";
|
|
810
815
|
var OrgIdentityWriteSchema = z3.object({
|
|
@@ -889,6 +894,7 @@ function toDirectoryOrganizationView(raw) {
|
|
|
889
894
|
agencyId: directoryIdString(r.agencyId),
|
|
890
895
|
agencyScope: directoryIdString(r.agencyScope),
|
|
891
896
|
canonicalKey: text2(r.canonicalKey),
|
|
897
|
+
key: isOrgKey(r.key) ? r.key : null,
|
|
892
898
|
legalName: line2(r.legalName),
|
|
893
899
|
commonName: line2(r.commonName),
|
|
894
900
|
shortName: line2(r.shortName) ?? line2(r.acronym),
|