@metriport/shared 0.13.3 → 0.13.5-alpha.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.
Files changed (137) hide show
  1. package/dist/common/__tests__/npi.d.ts +7 -0
  2. package/dist/common/__tests__/npi.d.ts.map +1 -0
  3. package/dist/common/__tests__/npi.js +32 -0
  4. package/dist/common/__tests__/npi.js.map +1 -0
  5. package/dist/common/__tests__/validate-npi.test.d.ts +2 -0
  6. package/dist/common/__tests__/validate-npi.test.d.ts.map +1 -0
  7. package/dist/common/__tests__/validate-npi.test.js +24 -0
  8. package/dist/common/__tests__/validate-npi.test.js.map +1 -0
  9. package/dist/common/date.d.ts +3 -2
  10. package/dist/common/date.d.ts.map +1 -1
  11. package/dist/common/date.js +11 -5
  12. package/dist/common/date.js.map +1 -1
  13. package/dist/common/error.d.ts +3 -3
  14. package/dist/common/error.js +3 -3
  15. package/dist/common/filter-map.d.ts +11 -0
  16. package/dist/common/filter-map.d.ts.map +1 -0
  17. package/dist/common/filter-map.js +17 -0
  18. package/dist/common/filter-map.js.map +1 -0
  19. package/dist/common/xml-parser.d.ts +3 -0
  20. package/dist/common/xml-parser.d.ts.map +1 -0
  21. package/dist/common/xml-parser.js +17 -0
  22. package/dist/common/xml-parser.js.map +1 -0
  23. package/dist/domain/address/__tests__/normalize-zip.test.js +109 -30
  24. package/dist/domain/address/__tests__/normalize-zip.test.js.map +1 -1
  25. package/dist/domain/address/__tests__/state.test.d.ts +2 -0
  26. package/dist/domain/address/__tests__/state.test.d.ts.map +1 -0
  27. package/dist/domain/address/__tests__/state.test.js +40 -0
  28. package/dist/domain/address/__tests__/state.test.js.map +1 -0
  29. package/dist/domain/address/__tests__/territory.test.d.ts +2 -0
  30. package/dist/domain/address/__tests__/territory.test.d.ts.map +1 -0
  31. package/dist/domain/address/__tests__/territory.test.js +35 -0
  32. package/dist/domain/address/__tests__/territory.test.js.map +1 -0
  33. package/dist/domain/address/index.d.ts +6 -0
  34. package/dist/domain/address/index.d.ts.map +1 -0
  35. package/dist/domain/address/index.js +21 -0
  36. package/dist/domain/address/index.js.map +1 -0
  37. package/dist/domain/address/state.d.ts +1 -3
  38. package/dist/domain/address/state.d.ts.map +1 -1
  39. package/dist/domain/address/state.js +57 -61
  40. package/dist/domain/address/state.js.map +1 -1
  41. package/dist/domain/address/territory.d.ts +10 -0
  42. package/dist/domain/address/territory.d.ts.map +1 -0
  43. package/dist/domain/address/territory.js +32 -0
  44. package/dist/domain/address/territory.js.map +1 -0
  45. package/dist/domain/address/zip.d.ts +5 -2
  46. package/dist/domain/address/zip.d.ts.map +1 -1
  47. package/dist/domain/address/zip.js +45 -5
  48. package/dist/domain/address/zip.js.map +1 -1
  49. package/dist/domain/contact/__tests__/email.test.d.ts +2 -0
  50. package/dist/domain/contact/__tests__/email.test.d.ts.map +1 -0
  51. package/dist/domain/contact/__tests__/email.test.js +39 -0
  52. package/dist/domain/contact/__tests__/email.test.js.map +1 -0
  53. package/dist/domain/contact/__tests__/phone.test.js +28 -0
  54. package/dist/domain/contact/__tests__/phone.test.js.map +1 -1
  55. package/dist/domain/contact/email.d.ts +1 -0
  56. package/dist/domain/contact/email.d.ts.map +1 -1
  57. package/dist/domain/contact/email.js +5 -1
  58. package/dist/domain/contact/email.js.map +1 -1
  59. package/dist/domain/contact/phone.d.ts +2 -0
  60. package/dist/domain/contact/phone.d.ts.map +1 -1
  61. package/dist/domain/contact/phone.js +13 -1
  62. package/dist/domain/contact/phone.js.map +1 -1
  63. package/dist/domain/patient/patient-import.d.ts +131 -0
  64. package/dist/domain/patient/patient-import.d.ts.map +1 -0
  65. package/dist/domain/patient/patient-import.js +32 -0
  66. package/dist/domain/patient/patient-import.js.map +1 -0
  67. package/dist/domain/patient/patient.d.ts +23 -0
  68. package/dist/domain/patient/patient.d.ts.map +1 -0
  69. package/dist/domain/patient/patient.js +14 -0
  70. package/dist/domain/patient/patient.js.map +1 -0
  71. package/dist/error/metriport-error.d.ts +1 -1
  72. package/dist/error/metriport-error.d.ts.map +1 -1
  73. package/dist/index.d.ts +11 -7
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +16 -12
  76. package/dist/index.js.map +1 -1
  77. package/dist/interface/external/athenahealth/appointment.d.ts +50 -0
  78. package/dist/interface/external/athenahealth/appointment.d.ts.map +1 -0
  79. package/dist/interface/external/athenahealth/appointment.js +18 -0
  80. package/dist/interface/external/athenahealth/appointment.js.map +1 -0
  81. package/dist/interface/external/athenahealth/cx-mapping.d.ts +10 -0
  82. package/dist/interface/external/athenahealth/cx-mapping.d.ts.map +1 -0
  83. package/dist/interface/external/athenahealth/cx-mapping.js +8 -0
  84. package/dist/interface/external/athenahealth/cx-mapping.js.map +1 -0
  85. package/dist/interface/external/athenahealth/department.d.ts +27 -0
  86. package/dist/interface/external/athenahealth/department.d.ts.map +1 -0
  87. package/dist/interface/external/athenahealth/department.js +11 -0
  88. package/dist/interface/external/athenahealth/department.js.map +1 -0
  89. package/dist/interface/external/athenahealth/index.d.ts +6 -0
  90. package/dist/interface/external/athenahealth/index.d.ts.map +1 -1
  91. package/dist/interface/external/athenahealth/index.js +6 -0
  92. package/dist/interface/external/athenahealth/index.js.map +1 -1
  93. package/dist/interface/external/athenahealth/jwt-token.d.ts +5 -0
  94. package/dist/interface/external/athenahealth/jwt-token.d.ts.map +1 -0
  95. package/dist/interface/external/athenahealth/jwt-token.js +3 -0
  96. package/dist/interface/external/athenahealth/jwt-token.js.map +1 -0
  97. package/dist/interface/external/athenahealth/medication.d.ts +38 -0
  98. package/dist/interface/external/athenahealth/medication.d.ts.map +1 -0
  99. package/dist/interface/external/athenahealth/medication.js +15 -0
  100. package/dist/interface/external/athenahealth/medication.js.map +1 -0
  101. package/dist/interface/external/athenahealth/patient.d.ts +277 -8
  102. package/dist/interface/external/athenahealth/patient.d.ts.map +1 -1
  103. package/dist/interface/external/athenahealth/patient.js +8 -1
  104. package/dist/interface/external/athenahealth/patient.js.map +1 -1
  105. package/dist/interface/external/athenahealth/subscription.d.ts +10 -0
  106. package/dist/interface/external/athenahealth/subscription.d.ts.map +1 -0
  107. package/dist/interface/external/athenahealth/subscription.js +8 -0
  108. package/dist/interface/external/athenahealth/subscription.js.map +1 -0
  109. package/dist/interface/internal/consolidated.d.ts +2 -2
  110. package/dist/medical/fhir/bundle.d.ts +3 -0
  111. package/dist/medical/fhir/bundle.d.ts.map +1 -1
  112. package/dist/medical/fhir/bundle.js +21 -0
  113. package/dist/medical/fhir/bundle.js.map +1 -1
  114. package/dist/medical/webhook/webhook-request.d.ts +25 -25
  115. package/dist/net/error.d.ts.map +1 -1
  116. package/dist/net/error.js +1 -0
  117. package/dist/net/error.js.map +1 -1
  118. package/dist/net/retry.d.ts.map +1 -1
  119. package/dist/net/retry.js +3 -1
  120. package/dist/net/retry.js.map +1 -1
  121. package/package.json +2 -2
  122. package/dist/common/__tests__/normalize-zip.test.d.ts +0 -2
  123. package/dist/common/__tests__/normalize-zip.test.d.ts.map +0 -1
  124. package/dist/common/__tests__/normalize-zip.test.js +0 -38
  125. package/dist/common/__tests__/normalize-zip.test.js.map +0 -1
  126. package/dist/common/normalize-zip.d.ts +0 -10
  127. package/dist/common/normalize-zip.d.ts.map +0 -1
  128. package/dist/common/normalize-zip.js +0 -30
  129. package/dist/common/normalize-zip.js.map +0 -1
  130. package/dist/net/__tests__/file-downloader.d.ts +0 -2
  131. package/dist/net/__tests__/file-downloader.d.ts.map +0 -1
  132. package/dist/net/__tests__/file-downloader.js +0 -66
  133. package/dist/net/__tests__/file-downloader.js.map +0 -1
  134. package/dist/net/file-downloader.d.ts +0 -22
  135. package/dist/net/file-downloader.d.ts.map +0 -1
  136. package/dist/net/file-downloader.js +0 -67
  137. package/dist/net/file-downloader.js.map +0 -1
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Generates a valid NPI number that passes the validateNPI() function.
3
+ *
4
+ * @returns A valid 10-digit NPI number as a string.
5
+ */
6
+ export declare function makeNPI(): string;
7
+ //# sourceMappingURL=npi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"npi.d.ts","sourceRoot":"","sources":["../../../src/common/__tests__/npi.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,OAAO,IAAI,MAAM,CAyBhC"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeNPI = void 0;
4
+ /**
5
+ * Generates a valid NPI number that passes the validateNPI() function.
6
+ *
7
+ * @returns A valid 10-digit NPI number as a string.
8
+ */
9
+ function makeNPI() {
10
+ const digits = [];
11
+ // Generate the first 9 digits
12
+ digits.push(Math.random() < 0.5 ? 1 : 2); // First digit is either 1 or 2
13
+ for (let i = 1; i < 9; i++) {
14
+ digits.push(Math.floor(Math.random() * 10));
15
+ }
16
+ let sum = 24; // Account for NPI prefix (80840)
17
+ let shouldDouble = true;
18
+ digits.forEach(digit => {
19
+ if (shouldDouble) {
20
+ digit *= 2;
21
+ if (digit > 9)
22
+ digit -= 9;
23
+ }
24
+ sum += digit;
25
+ shouldDouble = !shouldDouble;
26
+ });
27
+ const checkDigit = (10 - (sum % 10)) % 10;
28
+ digits.push(checkDigit);
29
+ return digits.join("");
30
+ }
31
+ exports.makeNPI = makeNPI;
32
+ //# sourceMappingURL=npi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"npi.js","sourceRoot":"","sources":["../../../src/common/__tests__/npi.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,SAAgB,OAAO;IACrB,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,8BAA8B;IAC9B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,+BAA+B;IACzE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;QAC1B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;KAC7C;IAED,IAAI,GAAG,GAAG,EAAE,CAAC,CAAC,iCAAiC;IAC/C,IAAI,YAAY,GAAG,IAAI,CAAC;IAExB,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACrB,IAAI,YAAY,EAAE;YAChB,KAAK,IAAI,CAAC,CAAC;YACX,IAAI,KAAK,GAAG,CAAC;gBAAE,KAAK,IAAI,CAAC,CAAC;SAC3B;QACD,GAAG,IAAI,KAAK,CAAC;QACb,YAAY,GAAG,CAAC,YAAY,CAAC;IAC/B,CAAC,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;IAC1C,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAExB,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzB,CAAC;AAzBD,0BAyBC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=validate-npi.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-npi.test.d.ts","sourceRoot":"","sources":["../../../src/common/__tests__/validate-npi.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const validate_npi_1 = require("../validate-npi");
4
+ const npi_1 = require("./npi");
5
+ describe("validate-npi", () => {
6
+ describe("returns true when it gets valid NPI number", () => {
7
+ for (let i = 0; i < 10; i++) {
8
+ const npi = (0, npi_1.makeNPI)();
9
+ it(npi, async () => {
10
+ expect((0, validate_npi_1.validateNPI)(npi)).toBeTruthy();
11
+ });
12
+ }
13
+ });
14
+ it("returns false when it gets empty string", async () => {
15
+ expect((0, validate_npi_1.validateNPI)("")).toBeFalsy();
16
+ });
17
+ it("returns false when it gets undefined", async () => {
18
+ expect((0, validate_npi_1.validateNPI)(undefined)).toBeFalsy();
19
+ });
20
+ it("returns false when it gets invalid 10 digit string", async () => {
21
+ expect((0, validate_npi_1.validateNPI)(String(1123123123))).toBeFalsy();
22
+ });
23
+ });
24
+ //# sourceMappingURL=validate-npi.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-npi.test.js","sourceRoot":"","sources":["../../../src/common/__tests__/validate-npi.test.ts"],"names":[],"mappings":";;AAAA,kDAA8C;AAC9C,+BAAgC;AAEhC,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,QAAQ,CAAC,4CAA4C,EAAE,GAAG,EAAE;QAC1D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;YAC3B,MAAM,GAAG,GAAG,IAAA,aAAO,GAAE,CAAC;YACtB,EAAE,CAAC,GAAG,EAAE,KAAK,IAAI,EAAE;gBACjB,MAAM,CAAC,IAAA,0BAAW,EAAC,GAAG,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;YACxC,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yCAAyC,EAAE,KAAK,IAAI,EAAE;QACvD,MAAM,CAAC,IAAA,0BAAW,EAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;IACtC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sCAAsC,EAAE,KAAK,IAAI,EAAE;QACpD,MAAM,CAAC,IAAA,0BAAW,EAAC,SAA8B,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;IAClE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oDAAoD,EAAE,KAAK,IAAI,EAAE;QAClE,MAAM,CAAC,IAAA,0BAAW,EAAC,MAAM,CAAC,UAAa,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;IACzD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,8 +1,9 @@
1
- import dayjs from "dayjs";
1
+ import dayjs, { ConfigType } from "dayjs";
2
2
  import { z } from "zod";
3
3
  export declare const ISO_DATE = "YYYY-MM-DD";
4
4
  export declare function isValidISODate(date: string): boolean;
5
5
  export declare const optionalDateSchema: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | null | undefined, string | null | undefined>;
6
6
  export declare const dateSchema: z.ZodEffects<z.ZodString, string, string>;
7
- export declare const elapsedTimeFromNow: (date?: Date, format?: dayjs.UnitTypeLong) => number;
7
+ export declare function elapsedTimeFromNow(date?: Date, format?: dayjs.UnitTypeLong): number;
8
+ export declare function buildDayjs(date?: ConfigType, format?: string, strict?: boolean): dayjs.Dayjs;
8
9
  //# sourceMappingURL=date.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../src/common/date.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAqB,CAAC,EAAE,MAAM,KAAK,CAAC;AAE3C,eAAO,MAAM,QAAQ,eAAe,CAAC;AAErC,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEpD;AAOD,eAAO,MAAM,kBAAkB,+GAIiB,CAAC;AAEjD,eAAO,MAAM,UAAU,2CAA0D,CAAC;AAElF,eAAO,MAAM,kBAAkB,UACtB,IAAI,WACH,MAAM,YAAY,KACzB,MAEF,CAAC"}
1
+ {"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../src/common/date.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAqB,CAAC,EAAE,MAAM,KAAK,CAAC;AAI3C,eAAO,MAAM,QAAQ,eAAe,CAAC;AAErC,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEpD;AAOD,eAAO,MAAM,kBAAkB,+GAIiB,CAAC;AAEjD,eAAO,MAAM,UAAU,2CAA0D,CAAC;AAElF,wBAAgB,kBAAkB,CAChC,IAAI,CAAC,EAAE,IAAI,EACX,MAAM,GAAE,KAAK,CAAC,YAA4B,GACzC,MAAM,CAER;AAED,wBAAgB,UAAU,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC,KAAK,CAE5F"}
@@ -3,12 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.elapsedTimeFromNow = exports.dateSchema = exports.optionalDateSchema = exports.isValidISODate = exports.ISO_DATE = void 0;
6
+ exports.buildDayjs = exports.elapsedTimeFromNow = exports.dateSchema = exports.optionalDateSchema = exports.isValidISODate = exports.ISO_DATE = void 0;
7
7
  const dayjs_1 = __importDefault(require("dayjs"));
8
+ const utc_1 = __importDefault(require("dayjs/plugin/utc"));
8
9
  const zod_1 = require("zod");
10
+ dayjs_1.default.extend(utc_1.default);
9
11
  exports.ISO_DATE = "YYYY-MM-DD";
10
12
  function isValidISODate(date) {
11
- return (0, dayjs_1.default)(date, exports.ISO_DATE, true).isValid();
13
+ return buildDayjs(date, exports.ISO_DATE, true).isValid();
12
14
  }
13
15
  exports.isValidISODate = isValidISODate;
14
16
  const isValidISODateOptional = (date) => date ? isValidISODate(date) : true;
@@ -19,8 +21,12 @@ exports.optionalDateSchema = zod_1.z
19
21
  .nullish()
20
22
  .refine(isValidISODateOptional, invalidIsoMsg);
21
23
  exports.dateSchema = zod_1.z.string().trim().refine(isValidISODate, invalidIsoMsg);
22
- const elapsedTimeFromNow = (date, format = "millisecond") => {
23
- return (0, dayjs_1.default)().diff((0, dayjs_1.default)(date), format);
24
- };
24
+ function elapsedTimeFromNow(date, format = "millisecond") {
25
+ return buildDayjs().diff(buildDayjs(date), format);
26
+ }
25
27
  exports.elapsedTimeFromNow = elapsedTimeFromNow;
28
+ function buildDayjs(date, format, strict) {
29
+ return dayjs_1.default.utc(date, format, strict);
30
+ }
31
+ exports.buildDayjs = buildDayjs;
26
32
  //# sourceMappingURL=date.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"date.js","sourceRoot":"","sources":["../../src/common/date.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,6BAA2C;AAE9B,QAAA,QAAQ,GAAG,YAAY,CAAC;AAErC,SAAgB,cAAc,CAAC,IAAY;IACzC,OAAO,IAAA,eAAK,EAAC,IAAI,EAAE,gBAAQ,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;AAC/C,CAAC;AAFD,wCAEC;AAED,MAAM,sBAAsB,GAAG,CAAC,IAA+B,EAAW,EAAE,CAC1E,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAErC,MAAM,aAAa,GAAsB,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAE5D,QAAA,kBAAkB,GAAG,OAAC;KAChC,MAAM,EAAE;KACR,IAAI,EAAE;KACN,OAAO,EAAE;KACT,MAAM,CAAC,sBAAsB,EAAE,aAAa,CAAC,CAAC;AAEpC,QAAA,UAAU,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC;AAE3E,MAAM,kBAAkB,GAAG,CAChC,IAAW,EACX,SAA6B,aAAa,EAClC,EAAE;IACV,OAAO,IAAA,eAAK,GAAE,CAAC,IAAI,CAAC,IAAA,eAAK,EAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;AAC3C,CAAC,CAAC;AALW,QAAA,kBAAkB,sBAK7B"}
1
+ {"version":3,"file":"date.js","sourceRoot":"","sources":["../../src/common/date.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0C;AAC1C,2DAAmC;AAEnC,6BAA2C;AAE3C,eAAK,CAAC,MAAM,CAAC,aAAG,CAAC,CAAC;AAEL,QAAA,QAAQ,GAAG,YAAY,CAAC;AAErC,SAAgB,cAAc,CAAC,IAAY;IACzC,OAAO,UAAU,CAAC,IAAI,EAAE,gBAAQ,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;AACpD,CAAC;AAFD,wCAEC;AAED,MAAM,sBAAsB,GAAG,CAAC,IAA+B,EAAW,EAAE,CAC1E,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAErC,MAAM,aAAa,GAAsB,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAE5D,QAAA,kBAAkB,GAAG,OAAC;KAChC,MAAM,EAAE;KACR,IAAI,EAAE;KACN,OAAO,EAAE;KACT,MAAM,CAAC,sBAAsB,EAAE,aAAa,CAAC,CAAC;AAEpC,QAAA,UAAU,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC;AAElF,SAAgB,kBAAkB,CAChC,IAAW,EACX,SAA6B,aAAa;IAE1C,OAAO,UAAU,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;AACrD,CAAC;AALD,gDAKC;AAED,SAAgB,UAAU,CAAC,IAAiB,EAAE,MAAe,EAAE,MAAgB;IAC7E,OAAO,eAAK,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AACzC,CAAC;AAFD,gCAEC"}
@@ -2,15 +2,15 @@ export type ErrorToStringOptions = {
2
2
  detailed: boolean;
3
3
  };
4
4
  /**
5
- * @deprecated User @metriport/shared/error/shared instead
5
+ * @deprecated Use `@metriport/shared/error/shared` instead
6
6
  */
7
7
  export declare function errorToString(err: unknown, options?: ErrorToStringOptions): string;
8
8
  /**
9
- * @deprecated User @metriport/shared/error/shared instead
9
+ * @deprecated Use `@metriport/shared/error/shared` instead
10
10
  */
11
11
  export declare function genericErrorToString(err: unknown): string;
12
12
  /**
13
- * @deprecated User @metriport/shared/error/shared instead
13
+ * @deprecated Use `@metriport/shared/error/shared` instead
14
14
  */
15
15
  export declare function detailedErrorToString(error: any): string;
16
16
  //# sourceMappingURL=error.d.ts.map
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.detailedErrorToString = exports.genericErrorToString = exports.errorToString = void 0;
4
4
  /**
5
- * @deprecated User @metriport/shared/error/shared instead
5
+ * @deprecated Use `@metriport/shared/error/shared` instead
6
6
  */
7
7
  function errorToString(err, options = { detailed: true }) {
8
8
  if (options.detailed) {
@@ -12,14 +12,14 @@ function errorToString(err, options = { detailed: true }) {
12
12
  }
13
13
  exports.errorToString = errorToString;
14
14
  /**
15
- * @deprecated User @metriport/shared/error/shared instead
15
+ * @deprecated Use `@metriport/shared/error/shared` instead
16
16
  */
17
17
  function genericErrorToString(err) {
18
18
  return err["message"] ?? String(err); // eslint-disable-line @typescript-eslint/no-explicit-any
19
19
  }
20
20
  exports.genericErrorToString = genericErrorToString;
21
21
  /**
22
- * @deprecated User @metriport/shared/error/shared instead
22
+ * @deprecated Use `@metriport/shared/error/shared` instead
23
23
  */
24
24
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
25
25
  function detailedErrorToString(error) {
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Used in .flatMap() to filter out undefined values.
3
+ *
4
+ * Example:
5
+ *
6
+ * const arr = [1, null, 3, undefined, 5];
7
+ * const filtered = arr.flatMap(filterTruthy);
8
+ * // filtered = [1, 3, 5]
9
+ */
10
+ export declare function filterTruthy<T>(o: T | undefined | null): T | [];
11
+ //# sourceMappingURL=filter-map.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter-map.d.ts","sourceRoot":"","sources":["../../src/common/filter-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,CAE/D"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.filterTruthy = void 0;
4
+ /**
5
+ * Used in .flatMap() to filter out undefined values.
6
+ *
7
+ * Example:
8
+ *
9
+ * const arr = [1, null, 3, undefined, 5];
10
+ * const filtered = arr.flatMap(filterTruthy);
11
+ * // filtered = [1, 3, 5]
12
+ */
13
+ function filterTruthy(o) {
14
+ return o ? o : [];
15
+ }
16
+ exports.filterTruthy = filterTruthy;
17
+ //# sourceMappingURL=filter-map.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter-map.js","sourceRoot":"","sources":["../../src/common/filter-map.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;GAQG;AACH,SAAgB,YAAY,CAAI,CAAuB;IACrD,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACpB,CAAC;AAFD,oCAEC"}
@@ -0,0 +1,3 @@
1
+ import { XMLParser, X2jOptionsOptional } from "fast-xml-parser";
2
+ export declare function createXMLParser(options?: X2jOptionsOptional): XMLParser;
3
+ //# sourceMappingURL=xml-parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xml-parser.d.ts","sourceRoot":"","sources":["../../src/common/xml-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAEhE,wBAAgB,eAAe,CAAC,OAAO,GAAE,kBAAuB,GAAG,SAAS,CAY3E"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createXMLParser = void 0;
4
+ const fast_xml_parser_1 = require("fast-xml-parser");
5
+ function createXMLParser(options = {}) {
6
+ const defaultOptions = {
7
+ numberParseOptions: {
8
+ hex: false,
9
+ leadingZeros: false,
10
+ },
11
+ };
12
+ // Merge the default options with the provided options
13
+ const mergedOptions = { ...defaultOptions, ...options };
14
+ return new fast_xml_parser_1.XMLParser(mergedOptions);
15
+ }
16
+ exports.createXMLParser = createXMLParser;
17
+ //# sourceMappingURL=xml-parser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xml-parser.js","sourceRoot":"","sources":["../../src/common/xml-parser.ts"],"names":[],"mappings":";;;AAAA,qDAAgE;AAEhE,SAAgB,eAAe,CAAC,UAA8B,EAAE;IAC9D,MAAM,cAAc,GAAuB;QACzC,kBAAkB,EAAE;YAClB,GAAG,EAAE,KAAK;YACV,YAAY,EAAE,KAAK;SACpB;KACF,CAAC;IAEF,sDAAsD;IACtD,MAAM,aAAa,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,OAAO,EAAE,CAAC;IAExD,OAAO,IAAI,2BAAS,CAAC,aAAa,CAAC,CAAC;AACtC,CAAC;AAZD,0CAYC"}
@@ -1,38 +1,117 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const faker_1 = require("@faker-js/faker");
3
4
  const zip_1 = require("../zip");
4
- describe("normalizeZipCode", () => {
5
- test("should handle short zip codes", () => {
6
- const input = "1234";
7
- const expectedOutput = "1234";
8
- expect((0, zip_1.normalizeZipCode)(input)).toBe(expectedOutput);
5
+ function getFiveDigitZip() {
6
+ return faker_1.faker.number.int({ min: 10000, max: 99999 }).toString();
7
+ }
8
+ describe("zip", () => {
9
+ describe("normalizeZipCode", () => {
10
+ test("should handle short zip codes", () => {
11
+ const input = "1234";
12
+ const expectedOutput = "1234";
13
+ expect((0, zip_1.normalizeZipCode)(input)).toBe(expectedOutput);
14
+ });
15
+ test("should return first 4 characters when zip code length is 9", () => {
16
+ const input = "1234-6677";
17
+ const expectedOutput = "1234";
18
+ expect((0, zip_1.normalizeZipCode)(input)).toBe(expectedOutput);
19
+ });
20
+ test("should return first 5 characters when zip code length is 10", () => {
21
+ const input = "12345-6677";
22
+ const expectedOutput = "12345";
23
+ expect((0, zip_1.normalizeZipCode)(input)).toBe(expectedOutput);
24
+ });
25
+ test("should return first 5 characters when zip code length is 5", () => {
26
+ const input = "54321";
27
+ const expectedOutput = "54321";
28
+ expect((0, zip_1.normalizeZipCode)(input)).toBe(expectedOutput);
29
+ });
30
+ test("should throw an error if zip contains non-digit and non-dash characters (length 9)", () => {
31
+ const input = "12345-667a";
32
+ expect(() => (0, zip_1.normalizeZipCode)(input)).toThrow();
33
+ });
34
+ test("should throw an error if zip contains non-digit and non-dash characters (length 5)", () => {
35
+ const input = "1234a";
36
+ expect(() => (0, zip_1.normalizeZipCode)(input)).toThrow();
37
+ });
38
+ test("should throw an error if zip is an empty string", () => {
39
+ const input = "";
40
+ expect(() => (0, zip_1.normalizeZipCode)(input)).toThrow();
41
+ });
9
42
  });
10
- test("should return first 4 characters when zip code length is 9", () => {
11
- const input = "1234-6677";
12
- const expectedOutput = "1234";
13
- expect((0, zip_1.normalizeZipCode)(input)).toBe(expectedOutput);
43
+ describe("normalizeZipCodeNew", () => {
44
+ it("returns the result of the normalizeFn param", () => {
45
+ const expectedOutput = getFiveDigitZip();
46
+ const normalizeFn = jest.fn(() => expectedOutput);
47
+ expect((0, zip_1.normalizeZipCodeNew)("54321", normalizeFn)).toBe(expectedOutput);
48
+ });
49
+ it("should throw an error if zip is an empty string", () => {
50
+ const normalizeFn = jest.fn(() => undefined);
51
+ expect(() => (0, zip_1.normalizeZipCodeNew)("54321", normalizeFn)).toThrow();
52
+ });
14
53
  });
15
- test("should return first 5 characters when zip code length is 10", () => {
16
- const input = "12345-6677";
17
- const expectedOutput = "12345";
18
- expect((0, zip_1.normalizeZipCode)(input)).toBe(expectedOutput);
19
- });
20
- test("should return first 5 characters when zip code length is 5", () => {
21
- const input = "54321";
22
- const expectedOutput = "54321";
23
- expect((0, zip_1.normalizeZipCode)(input)).toBe(expectedOutput);
24
- });
25
- test("should throw an error if zip contains non-digit and non-dash characters (length 9)", () => {
26
- const input = "12345-667a";
27
- expect(() => (0, zip_1.normalizeZipCode)(input)).toThrow();
28
- });
29
- test("should throw an error if zip contains non-digit and non-dash characters (length 5)", () => {
30
- const input = "1234a";
31
- expect(() => (0, zip_1.normalizeZipCode)(input)).toThrow();
32
- });
33
- test("should throw an error if zip is an empty string", () => {
34
- const input = "";
35
- expect(() => (0, zip_1.normalizeZipCode)(input)).toThrow();
54
+ describe("safe normalizeZipCodeNewSafe", () => {
55
+ it("should return undefined when it gets empty string", () => {
56
+ const input = "";
57
+ const expectedOutput = undefined;
58
+ expect((0, zip_1.normalizeZipCodeNewSafe)(input)).toBe(expectedOutput);
59
+ });
60
+ it("should return undefined when it gets space", () => {
61
+ const input = " ";
62
+ const expectedOutput = undefined;
63
+ expect((0, zip_1.normalizeZipCodeNewSafe)(input)).toBe(expectedOutput);
64
+ });
65
+ it("should handle 5 digits", () => {
66
+ const input = getFiveDigitZip();
67
+ const expectedOutput = input;
68
+ expect((0, zip_1.normalizeZipCodeNewSafe)(input)).toBe(expectedOutput);
69
+ });
70
+ it("should trim input prefix", () => {
71
+ const expectedOutput = getFiveDigitZip();
72
+ const input = " " + expectedOutput;
73
+ expect((0, zip_1.normalizeZipCodeNewSafe)(input)).toBe(expectedOutput);
74
+ });
75
+ it("should trim input suffix", () => {
76
+ const expectedOutput = getFiveDigitZip();
77
+ const input = expectedOutput + " ";
78
+ expect((0, zip_1.normalizeZipCodeNewSafe)(input)).toBe(expectedOutput);
79
+ });
80
+ it("should return undefined for zip codes that are too short", () => {
81
+ const input = "12";
82
+ expect((0, zip_1.normalizeZipCodeNewSafe)(input)).toBeUndefined();
83
+ });
84
+ it("should handle short zip codes", () => {
85
+ const input = "123";
86
+ const expectedOutput = "00123";
87
+ expect((0, zip_1.normalizeZipCodeNewSafe)(input)).toBe(expectedOutput);
88
+ });
89
+ it("should return padded first 4 characters when contains dash at position 4", () => {
90
+ const input = "1234-6677";
91
+ const expectedOutput = "01234";
92
+ expect((0, zip_1.normalizeZipCodeNewSafe)(input)).toBe(expectedOutput);
93
+ });
94
+ it("should return first 5 characters when zip code length is 10", () => {
95
+ const input = "12345-6677";
96
+ const expectedOutput = "12345";
97
+ expect((0, zip_1.normalizeZipCodeNewSafe)(input)).toBe(expectedOutput);
98
+ });
99
+ it("should return undefined if zip contains non-digit and non-dash characters (length 9)", () => {
100
+ const input = "12345-667a";
101
+ expect((0, zip_1.normalizeZipCodeNewSafe)(input)).toBeUndefined();
102
+ });
103
+ it("should return undefined if zip contains non-digit and non-dash characters (length 5)", () => {
104
+ const input = "1234a";
105
+ expect((0, zip_1.normalizeZipCodeNewSafe)(input)).toBeUndefined();
106
+ });
107
+ describe("examples from the wild", () => {
108
+ const tests = [{ input: "2468", expectedOutput: "02468" }];
109
+ for (const { input, expectedOutput } of tests) {
110
+ it(`should return ${expectedOutput} when input is ${input}`, () => {
111
+ expect((0, zip_1.normalizeZipCodeNewSafe)(input)).toBe(expectedOutput);
112
+ });
113
+ }
114
+ });
36
115
  });
37
116
  });
38
117
  //# sourceMappingURL=normalize-zip.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"normalize-zip.test.js","sourceRoot":"","sources":["../../../../src/domain/address/__tests__/normalize-zip.test.ts"],"names":[],"mappings":";;AAAA,gCAA0C;AAE1C,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,IAAI,CAAC,+BAA+B,EAAE,GAAG,EAAE;QACzC,MAAM,KAAK,GAAG,MAAM,CAAC;QACrB,MAAM,cAAc,GAAG,MAAM,CAAC;QAC9B,MAAM,CAAC,IAAA,sBAAgB,EAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,4DAA4D,EAAE,GAAG,EAAE;QACtE,MAAM,KAAK,GAAG,WAAW,CAAC;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Aa,EAAE,CAAC;QACzD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,sFAAsF,EAAE,GAAG,EAAE;YAC9F,MAAM,KAAK,GAAG,OAAO,CAAC;YACtB,MAAM,CAAC,IAAA,6BAAuB,EAAC,KAAK,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;QACzD,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;YACtC,MAAM,KAAK,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC,CAAC;YAC3D,KAAK,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,KAAK,EAAE;gBAC7C,EAAE,CAAC,iBAAiB,cAAc,kBAAkB,KAAK,EAAE,EAAE,GAAG,EAAE;oBAChE,MAAM,CAAC,IAAA,6BAAuB,EAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;gBAC9D,CAAC,CAAC,CAAC;aACJ;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=state.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.test.d.ts","sourceRoot":"","sources":["../../../../src/domain/address/__tests__/state.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const state_1 = require("../state");
4
+ describe("state", () => {
5
+ describe("normalizeStateSafe", () => {
6
+ it("should convert long name to USState", () => {
7
+ const input = "Arizona";
8
+ const expectedOutput = state_1.USState.AZ;
9
+ expect((0, state_1.normalizeStateSafe)(input)).toEqual(expectedOutput);
10
+ });
11
+ it("should convert long name case insentitive to USState", () => {
12
+ const input = "aRiZonA";
13
+ const expectedOutput = state_1.USState.AZ;
14
+ expect((0, state_1.normalizeStateSafe)(input)).toEqual(expectedOutput);
15
+ });
16
+ it("should convert District of Columbia to DC", () => {
17
+ const input = "District of Columbia";
18
+ const expectedOutput = state_1.USState.DC;
19
+ expect((0, state_1.normalizeStateSafe)(input)).toEqual(expectedOutput);
20
+ });
21
+ describe(`should convert to USState`, () => {
22
+ for (const usState of Object.values(state_1.USState)) {
23
+ it(usState, () => {
24
+ const input = usState;
25
+ const expectedOutput = usState;
26
+ expect((0, state_1.normalizeStateSafe)(input)).toEqual(expectedOutput);
27
+ });
28
+ }
29
+ });
30
+ it("should return undefined if can't match a US state", () => {
31
+ const input = "Ariz";
32
+ expect((0, state_1.normalizeStateSafe)(input)).toBeUndefined();
33
+ });
34
+ it("should return undefined if gets an empty string", () => {
35
+ const input = "";
36
+ expect((0, state_1.normalizeStateSafe)(input)).toBeUndefined();
37
+ });
38
+ });
39
+ });
40
+ //# sourceMappingURL=state.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.test.js","sourceRoot":"","sources":["../../../../src/domain/address/__tests__/state.test.ts"],"names":[],"mappings":";;AAAA,oCAAuD;AAEvD,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;IACrB,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;QAClC,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;YAC7C,MAAM,KAAK,GAAG,SAAS,CAAC;YACxB,MAAM,cAAc,GAAG,eAAO,CAAC,EAAE,CAAC;YAClC,MAAM,CAAC,IAAA,0BAAkB,EAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,sDAAsD,EAAE,GAAG,EAAE;YAC9D,MAAM,KAAK,GAAG,SAAS,CAAC;YACxB,MAAM,cAAc,GAAG,eAAO,CAAC,EAAE,CAAC;YAClC,MAAM,CAAC,IAAA,0BAAkB,EAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;YACnD,MAAM,KAAK,GAAG,sBAAsB,CAAC;YACrC,MAAM,cAAc,GAAG,eAAO,CAAC,EAAE,CAAC;YAClC,MAAM,CAAC,IAAA,0BAAkB,EAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;YACzC,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,eAAO,CAAC,EAAE;gBAC5C,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;oBACf,MAAM,KAAK,GAAG,OAAO,CAAC;oBACtB,MAAM,cAAc,GAAG,OAAO,CAAC;oBAC/B,MAAM,CAAC,IAAA,0BAAkB,EAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;gBAC5D,CAAC,CAAC,CAAC;aACJ;QACH,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;YAC3D,MAAM,KAAK,GAAG,MAAM,CAAC;YACrB,MAAM,CAAC,IAAA,0BAAkB,EAAC,KAAK,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;QACpD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;YACzD,MAAM,KAAK,GAAG,EAAE,CAAC;YACjB,MAAM,CAAC,IAAA,0BAAkB,EAAC,KAAK,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;QACpD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=territory.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"territory.test.d.ts","sourceRoot":"","sources":["../../../../src/domain/address/__tests__/territory.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const territory_1 = require("../territory");
4
+ describe("territory", () => {
5
+ describe("normalizeTerritorySafe", () => {
6
+ it("should convert long name to USTerritory", () => {
7
+ const input = "Guam";
8
+ const expectedOutput = territory_1.USTerritory.GU;
9
+ expect((0, territory_1.normalizeTerritorySafe)(input)).toEqual(expectedOutput);
10
+ });
11
+ it("should convert long name case insentitive to USTerritory", () => {
12
+ const input = "GuAm";
13
+ const expectedOutput = territory_1.USTerritory.GU;
14
+ expect((0, territory_1.normalizeTerritorySafe)(input)).toEqual(expectedOutput);
15
+ });
16
+ describe(`should convert to USTerritory`, () => {
17
+ for (const usTerritory of Object.values(territory_1.USTerritory)) {
18
+ it(usTerritory, () => {
19
+ const input = usTerritory;
20
+ const expectedOutput = usTerritory;
21
+ expect((0, territory_1.normalizeTerritorySafe)(input)).toEqual(expectedOutput);
22
+ });
23
+ }
24
+ });
25
+ it("should return undefined if can't match a US territory", () => {
26
+ const input = "Gua";
27
+ expect((0, territory_1.normalizeTerritorySafe)(input)).toBeUndefined();
28
+ });
29
+ it("should return undefined if gets an empty string", () => {
30
+ const input = "";
31
+ expect((0, territory_1.normalizeTerritorySafe)(input)).toBeUndefined();
32
+ });
33
+ });
34
+ });
35
+ //# sourceMappingURL=territory.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"territory.test.js","sourceRoot":"","sources":["../../../../src/domain/address/__tests__/territory.test.ts"],"names":[],"mappings":";;AAAA,4CAAmE;AAEnE,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;QACtC,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;YACjD,MAAM,KAAK,GAAG,MAAM,CAAC;YACrB,MAAM,cAAc,GAAG,uBAAW,CAAC,EAAE,CAAC;YACtC,MAAM,CAAC,IAAA,kCAAsB,EAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;QAChE,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,0DAA0D,EAAE,GAAG,EAAE;YAClE,MAAM,KAAK,GAAG,MAAM,CAAC;YACrB,MAAM,cAAc,GAAG,uBAAW,CAAC,EAAE,CAAC;YACtC,MAAM,CAAC,IAAA,kCAAsB,EAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;QAChE,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;YAC7C,KAAK,MAAM,WAAW,IAAI,MAAM,CAAC,MAAM,CAAC,uBAAW,CAAC,EAAE;gBACpD,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;oBACnB,MAAM,KAAK,GAAG,WAAW,CAAC;oBAC1B,MAAM,cAAc,GAAG,WAAW,CAAC;oBACnC,MAAM,CAAC,IAAA,kCAAsB,EAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;gBAChE,CAAC,CAAC,CAAC;aACJ;QACH,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,uDAAuD,EAAE,GAAG,EAAE;YAC/D,MAAM,KAAK,GAAG,KAAK,CAAC;YACpB,MAAM,CAAC,IAAA,kCAAsB,EAAC,KAAK,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;QACxD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;YACzD,MAAM,KAAK,GAAG,EAAE,CAAC;YACjB,MAAM,CAAC,IAAA,kCAAsB,EAAC,KAAK,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;QACxD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { USState } from "./state";
2
+ import { USTerritory } from "./territory";
3
+ export type USStateForAddress = USState | USTerritory;
4
+ export declare function normalizeUSStateForAddressSafe(value: string): USStateForAddress | undefined;
5
+ export declare function normalizeUSStateForAddress(value: string): USStateForAddress;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain/address/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,OAAO,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAA0B,WAAW,EAAE,MAAM,aAAa,CAAC;AAElE,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,WAAW,CAAC;AAEtD,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAE3F;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,iBAAiB,CAQ3E"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.normalizeUSStateForAddress = exports.normalizeUSStateForAddressSafe = void 0;
4
+ const bad_request_1 = require("../../error/bad-request");
5
+ const state_1 = require("./state");
6
+ const territory_1 = require("./territory");
7
+ function normalizeUSStateForAddressSafe(value) {
8
+ return (0, state_1.normalizeStateSafe)(value) ?? (0, territory_1.normalizeTerritorySafe)(value);
9
+ }
10
+ exports.normalizeUSStateForAddressSafe = normalizeUSStateForAddressSafe;
11
+ function normalizeUSStateForAddress(value) {
12
+ const state = (0, state_1.normalizeStateSafe)(value) ?? (0, territory_1.normalizeTerritorySafe)(value);
13
+ if (!state) {
14
+ throw new bad_request_1.BadRequestError("Invalid US state or territory", undefined, {
15
+ stateOrTerritory: value,
16
+ });
17
+ }
18
+ return state;
19
+ }
20
+ exports.normalizeUSStateForAddress = normalizeUSStateForAddress;
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/address/index.ts"],"names":[],"mappings":";;;AAAA,yDAA0D;AAC1D,mCAAsD;AACtD,2CAAkE;AAIlE,SAAgB,8BAA8B,CAAC,KAAa;IAC1D,OAAO,IAAA,0BAAkB,EAAC,KAAK,CAAC,IAAI,IAAA,kCAAsB,EAAC,KAAK,CAAC,CAAC;AACpE,CAAC;AAFD,wEAEC;AAED,SAAgB,0BAA0B,CAAC,KAAa;IACtD,MAAM,KAAK,GAAG,IAAA,0BAAkB,EAAC,KAAK,CAAC,IAAI,IAAA,kCAAsB,EAAC,KAAK,CAAC,CAAC;IACzE,IAAI,CAAC,KAAK,EAAE;QACV,MAAM,IAAI,6BAAe,CAAC,+BAA+B,EAAE,SAAS,EAAE;YACpE,gBAAgB,EAAE,KAAK;SACxB,CAAC,CAAC;KACJ;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AARD,gEAQC"}
@@ -53,7 +53,5 @@ export declare enum USState {
53
53
  WI = "WI",
54
54
  WY = "WY"
55
55
  }
56
- export declare const states: {
57
- [k in string]: USState;
58
- };
56
+ export declare const states: Record<USState, string>;
59
57
  //# sourceMappingURL=state.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/domain/address/state.ts"],"names":[],"mappings":"AAAA,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CASrE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAIrD;AAED,oBAAY,OAAO;IACjB,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;CACV;AAED,eAAO,MAAM,MAAM,EAAE;KAAG,CAAC,IAAI,MAAM,GAAG,OAAO;CAmD5C,CAAC"}
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/domain/address/state.ts"],"names":[],"mappings":"AAEA,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAQrE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAIrD;AAED,oBAAY,OAAO;IACjB,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;CACV;AAED,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAoD1C,CAAC"}