@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.
@@ -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),