@metriport/shared 0.14.3 → 0.14.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.
@@ -0,0 +1,2 @@
1
+ export * from "./pagination";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./pagination"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B"}
@@ -0,0 +1,13 @@
1
+ export type ResponseMeta = {
2
+ prevPage?: string | null;
3
+ nextPage?: string | null;
4
+ itemsOnPage: number;
5
+ /** Indicates the total number of items in all pages; only available in the first page. */
6
+ itemsInTotal?: number;
7
+ };
8
+ export type PaginatedResponse<T, PropertyName extends string> = {
9
+ meta: ResponseMeta;
10
+ } & {
11
+ [P in PropertyName]: T[];
12
+ };
13
+ //# sourceMappingURL=pagination.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src/api/pagination.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,0FAA0F;IAC1F,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,CAAC,EAAE,YAAY,SAAS,MAAM,IAAI;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,GAAG;KACtF,CAAC,IAAI,YAAY,GAAG,CAAC,EAAE;CACzB,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=pagination.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../src/api/pagination.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"metriport-organization.d.ts","sourceRoot":"","sources":["../../src/common/metriport-organization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,eAAO,MAAM,qBAAqB,EAAE,YAmBnC,CAAC"}
1
+ {"version":3,"file":"metriport-organization.d.ts","sourceRoot":"","sources":["../../src/common/metriport-organization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,eAAO,MAAM,qBAAqB,EAAE,YAmBnC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.metriportOrganization = void 0;
4
+ // TODO move this to the shared/domain package
4
5
  exports.metriportOrganization = {
5
6
  resourceType: "Organization",
6
7
  name: "Metriport",
@@ -1 +1 @@
1
- {"version":3,"file":"metriport-organization.js","sourceRoot":"","sources":["../../src/common/metriport-organization.ts"],"names":[],"mappings":";;;AAEa,QAAA,qBAAqB,GAAiB;IACjD,YAAY,EAAE,cAAc;IAC5B,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE;QACP;YACE,IAAI,EAAE,CAAC,uBAAuB,CAAC;YAC/B,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,IAAI;YACX,UAAU,EAAE,OAAO;YACnB,OAAO,EAAE,IAAI;SACd;KACF;IACD,OAAO,EAAE;QACP;YACE,MAAM,EAAE,OAAO;YACf,KAAK,EAAE,iBAAiB;YACxB,GAAG,EAAE,MAAM;SACZ;KACF;CACF,CAAC"}
1
+ {"version":3,"file":"metriport-organization.js","sourceRoot":"","sources":["../../src/common/metriport-organization.ts"],"names":[],"mappings":";;;AAEA,8CAA8C;AACjC,QAAA,qBAAqB,GAAiB;IACjD,YAAY,EAAE,cAAc;IAC5B,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE;QACP;YACE,IAAI,EAAE,CAAC,uBAAuB,CAAC;YAC/B,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,IAAI;YACX,UAAU,EAAE,OAAO;YACnB,OAAO,EAAE,IAAI;SACd;KACF;IACD,OAAO,EAAE;QACP;YACE,MAAM,EAAE,OAAO;YACf,KAAK,EAAE,iBAAiB;YACxB,GAAG,EAAE,MAAM;SACZ;KACF;CACF,CAAC"}
@@ -1,27 +1,34 @@
1
+ import duration from "dayjs/plugin/duration";
1
2
  import { z } from "zod";
2
- export type RateLimitOperation = "patientQuery" | "documentQuery" | "consolidatedDataQuery";
3
- export type RateLimit = "operationsPerMinute";
4
- export declare const rateLimitEntrySchema: z.ZodObject<{
5
- cxId_operation: z.ZodString;
6
- operationsPerMinute: z.ZodNumber;
3
+ export declare const globalWindow: duration.Duration;
4
+ export declare const rateLimitPartitionKey = "cxIdAndOperationAndWindow";
5
+ export declare const rateLimitThresholdKey = "limitThreshold";
6
+ export type RateLimitWindow = typeof globalWindow;
7
+ export type RateLimitOperation = "patientCreateOrUpdate" | "documentQuery" | "consolidatedDataQuery";
8
+ export declare const rateLimitOperations: RateLimitOperation[];
9
+ export declare const rateLimitThresholdSchema: z.ZodObject<{
10
+ cxIdAndOperationAndWindow: z.ZodString;
11
+ limitThreshold: z.ZodNumber;
7
12
  }, "strip", z.ZodTypeAny, {
8
- cxId_operation: string;
9
- operationsPerMinute: number;
13
+ cxIdAndOperationAndWindow: string;
14
+ limitThreshold: number;
10
15
  }, {
11
- cxId_operation: string;
12
- operationsPerMinute: number;
16
+ cxIdAndOperationAndWindow: string;
17
+ limitThreshold: number;
13
18
  }>;
14
- export declare const trackingEntriesSchema: z.ZodArray<z.ZodObject<{
15
- cxId_operation: z.ZodString;
16
- numberOfOperation: z.ZodNumber;
17
- window_timestamp: z.ZodString;
19
+ export declare const rateLimitCountSchema: z.ZodObject<{
20
+ cxIdAndOperationAndWindow: z.ZodString;
21
+ totalHits: z.ZodNumber;
22
+ resetTime: z.ZodOptional<z.ZodNumber>;
18
23
  }, "strip", z.ZodTypeAny, {
19
- cxId_operation: string;
20
- numberOfOperation: number;
21
- window_timestamp: string;
24
+ cxIdAndOperationAndWindow: string;
25
+ totalHits: number;
26
+ resetTime?: number | undefined;
22
27
  }, {
23
- cxId_operation: string;
24
- numberOfOperation: number;
25
- window_timestamp: string;
26
- }>, "many">;
28
+ cxIdAndOperationAndWindow: string;
29
+ totalHits: number;
30
+ resetTime?: number | undefined;
31
+ }>;
32
+ export declare const errorMessageByOperation: Record<RateLimitOperation, string>;
33
+ export declare function getDefaultLimit(operation: RateLimitOperation): number;
27
34
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain/rate-limiting/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,kBAAkB,GAAG,cAAc,GAAG,eAAe,GAAG,uBAAuB,CAAC;AAE5F,MAAM,MAAM,SAAS,GAAG,qBAAqB,CAAC;AAE9C,eAAO,MAAM,oBAAoB;;;;;;;;;EAG/B,CAAC;AAQH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;WAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain/rate-limiting/index.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,YAAY,mBAA8B,CAAC;AACxD,eAAO,MAAM,qBAAqB,8BAA8B,CAAC;AACjE,eAAO,MAAM,qBAAqB,mBAAmB,CAAC;AAEtD,MAAM,MAAM,eAAe,GAAG,OAAO,YAAY,CAAC;AAClD,MAAM,MAAM,kBAAkB,GAC1B,uBAAuB,GACvB,eAAe,GACf,uBAAuB,CAAC;AAE5B,eAAO,MAAM,mBAAmB,sBAIP,CAAC;AAE1B,eAAO,MAAM,wBAAwB;;;;;;;;;EAGnC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;EAI/B,CAAC;AAEH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAItE,CAAC;AAEF,wBAAgB,eAAe,CAAC,SAAS,EAAE,kBAAkB,GAAG,MAAM,CAIrE"}
@@ -1,15 +1,46 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.trackingEntriesSchema = exports.rateLimitEntrySchema = void 0;
6
+ exports.getDefaultLimit = exports.errorMessageByOperation = exports.rateLimitCountSchema = exports.rateLimitThresholdSchema = exports.rateLimitOperations = exports.rateLimitThresholdKey = exports.rateLimitPartitionKey = exports.globalWindow = void 0;
7
+ const dayjs_1 = __importDefault(require("dayjs"));
8
+ const duration_1 = __importDefault(require("dayjs/plugin/duration"));
4
9
  const zod_1 = require("zod");
5
- exports.rateLimitEntrySchema = zod_1.z.object({
6
- cxId_operation: zod_1.z.string(),
7
- operationsPerMinute: zod_1.z.number(),
10
+ const metriport_error_1 = require("../../error/metriport-error");
11
+ dayjs_1.default.extend(duration_1.default);
12
+ exports.globalWindow = dayjs_1.default.duration(1, "minute");
13
+ exports.rateLimitPartitionKey = "cxIdAndOperationAndWindow";
14
+ exports.rateLimitThresholdKey = "limitThreshold";
15
+ exports.rateLimitOperations = [
16
+ "patientCreateOrUpdate",
17
+ "documentQuery",
18
+ "consolidatedDataQuery",
19
+ ];
20
+ exports.rateLimitThresholdSchema = zod_1.z.object({
21
+ [exports.rateLimitPartitionKey]: zod_1.z.string(),
22
+ [exports.rateLimitThresholdKey]: zod_1.z.number(),
8
23
  });
9
- const trackingEntrSchame = zod_1.z.object({
10
- cxId_operation: zod_1.z.string(),
11
- numberOfOperation: zod_1.z.number(),
12
- window_timestamp: zod_1.z.string(),
24
+ exports.rateLimitCountSchema = zod_1.z.object({
25
+ [exports.rateLimitPartitionKey]: zod_1.z.string(),
26
+ totalHits: zod_1.z.number(),
27
+ resetTime: zod_1.z.number().optional(), // https://express-rate-limit.mintlify.app/guides/creating-a-store
13
28
  });
14
- exports.trackingEntriesSchema = trackingEntrSchame.array();
29
+ exports.errorMessageByOperation = {
30
+ patientCreateOrUpdate: "Too many patient creates or updates, please try again later.",
31
+ documentQuery: "Too many patient document query starts, please try again later.",
32
+ consolidatedDataQuery: "Too many patient consolidated data query starts, please try again later.",
33
+ };
34
+ function getDefaultLimit(operation) {
35
+ const limit = defaultOperationLimits[operation];
36
+ if (!limit)
37
+ throw new metriport_error_1.MetriportError("Rate limit threshold not found", undefined, { operation });
38
+ return limit;
39
+ }
40
+ exports.getDefaultLimit = getDefaultLimit;
41
+ const defaultOperationLimits = {
42
+ patientCreateOrUpdate: 15,
43
+ documentQuery: 20,
44
+ consolidatedDataQuery: 120,
45
+ };
15
46
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/rate-limiting/index.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAMX,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE;IAC1B,mBAAmB,EAAE,OAAC,CAAC,MAAM,EAAE;CAChC,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IAClC,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE;IAC1B,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE;IAC7B,gBAAgB,EAAE,OAAC,CAAC,MAAM,EAAE;CAC7B,CAAC,CAAC;AAEU,QAAA,qBAAqB,GAAG,kBAAkB,CAAC,KAAK,EAAE,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/rate-limiting/index.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,qEAA6C;AAC7C,6BAAwB;AACxB,iEAA6D;AAE7D,eAAK,CAAC,MAAM,CAAC,kBAAQ,CAAC,CAAC;AAEV,QAAA,YAAY,GAAG,eAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;AAC3C,QAAA,qBAAqB,GAAG,2BAA2B,CAAC;AACpD,QAAA,qBAAqB,GAAG,gBAAgB,CAAC;AAQzC,QAAA,mBAAmB,GAAG;IACjC,uBAAuB;IACvB,eAAe;IACf,uBAAuB;CACA,CAAC;AAEb,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,CAAC,6BAAqB,CAAC,EAAE,OAAC,CAAC,MAAM,EAAE;IACnC,CAAC,6BAAqB,CAAC,EAAE,OAAC,CAAC,MAAM,EAAE;CACpC,CAAC,CAAC;AAEU,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,CAAC,6BAAqB,CAAC,EAAE,OAAC,CAAC,MAAM,EAAE;IACnC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,kEAAkE;CACrG,CAAC,CAAC;AAEU,QAAA,uBAAuB,GAAuC;IACzE,qBAAqB,EAAE,8DAA8D;IACrF,aAAa,EAAE,iEAAiE;IAChF,qBAAqB,EAAE,0EAA0E;CAClG,CAAC;AAEF,SAAgB,eAAe,CAAC,SAA6B;IAC3D,MAAM,KAAK,GAAG,sBAAsB,CAAC,SAAS,CAAC,CAAC;IAChD,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,gCAAc,CAAC,gCAAgC,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;IACjG,OAAO,KAAK,CAAC;AACf,CAAC;AAJD,0CAIC;AAED,MAAM,sBAAsB,GAExB;IACF,qBAAqB,EAAE,EAAE;IACzB,aAAa,EAAE,EAAE;IACjB,qBAAqB,EAAE,GAAG;CAC3B,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from "./api/index";
1
2
  export { toArray } from "./common/array";
2
3
  export { isTrue } from "./common/boolean";
3
4
  export { dateSchema, optionalDateSchema } from "./common/date";
@@ -26,10 +27,12 @@ export * from "./domain/gender";
26
27
  export { metriportCompanyDetails } from "./domain/metriport";
27
28
  export * from "./domain/patient/patient";
28
29
  export * from "./domain/patient/patient-import";
30
+ export * from "./domain/rate-limiting";
29
31
  export { BadRequestError } from "./error/bad-request";
30
32
  export { MetriportError } from "./error/metriport-error";
31
33
  export { NotFoundError } from "./error/not-found";
32
34
  export { errorToString } from "./error/shared";
35
+ export { TooManyRequestsError } from "./error/too-many-requests";
33
36
  export * from "./interface";
34
37
  export * as medical from "./medical";
35
38
  export * from "./net/error";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":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Ac,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
package/dist/index.js CHANGED
@@ -26,7 +26,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
26
26
  return result;
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.medical = exports.errorToString = exports.NotFoundError = exports.MetriportError = exports.BadRequestError = exports.metriportCompanyDetails = exports.validateNPI = exports.stringToBoolean = exports.toTitleCase = exports.sleep = exports.PurposeOfUse = exports.normalizeOid = exports.isValidUrl = exports.metriportOrganization = exports.emptyFunction = exports.getDomainFromEmailWithoutTld = exports.optionalDateSchema = exports.dateSchema = exports.isTrue = exports.toArray = void 0;
29
+ exports.medical = exports.TooManyRequestsError = exports.errorToString = exports.NotFoundError = exports.MetriportError = exports.BadRequestError = exports.metriportCompanyDetails = exports.validateNPI = exports.stringToBoolean = exports.toTitleCase = exports.sleep = exports.PurposeOfUse = exports.normalizeOid = exports.isValidUrl = exports.metriportOrganization = exports.emptyFunction = exports.getDomainFromEmailWithoutTld = exports.optionalDateSchema = exports.dateSchema = exports.isTrue = exports.toArray = void 0;
30
+ __exportStar(require("./api/index"), exports);
30
31
  var array_1 = require("./common/array");
31
32
  Object.defineProperty(exports, "toArray", { enumerable: true, get: function () { return array_1.toArray; } });
32
33
  var boolean_1 = require("./common/boolean");
@@ -70,6 +71,7 @@ var metriport_1 = require("./domain/metriport");
70
71
  Object.defineProperty(exports, "metriportCompanyDetails", { enumerable: true, get: function () { return metriport_1.metriportCompanyDetails; } });
71
72
  __exportStar(require("./domain/patient/patient"), exports);
72
73
  __exportStar(require("./domain/patient/patient-import"), exports);
74
+ __exportStar(require("./domain/rate-limiting"), exports);
73
75
  var bad_request_1 = require("./error/bad-request");
74
76
  Object.defineProperty(exports, "BadRequestError", { enumerable: true, get: function () { return bad_request_1.BadRequestError; } });
75
77
  var metriport_error_1 = require("./error/metriport-error");
@@ -78,6 +80,8 @@ var not_found_1 = require("./error/not-found");
78
80
  Object.defineProperty(exports, "NotFoundError", { enumerable: true, get: function () { return not_found_1.NotFoundError; } });
79
81
  var shared_1 = require("./error/shared");
80
82
  Object.defineProperty(exports, "errorToString", { enumerable: true, get: function () { return shared_1.errorToString; } });
83
+ var too_many_requests_1 = require("./error/too-many-requests");
84
+ Object.defineProperty(exports, "TooManyRequestsError", { enumerable: true, get: function () { return too_many_requests_1.TooManyRequestsError; } });
81
85
  __exportStar(require("./interface"), exports);
82
86
  exports.medical = __importStar(require("./medical"));
83
87
  __exportStar(require("./net/error"), exports);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAAyC;AAAhC,gGAAA,OAAO,OAAA;AAChB,4CAA0C;AAAjC,iGAAA,MAAM,OAAA;AACf,sCAA+D;AAAtD,kGAAA,UAAU,OAAA;AAAE,0GAAA,kBAAkB,OAAA;AACvC,wCAA8D;AAArD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a,OAAA;AACtB,0EAAwE;AAA/D,+HAAA,qBAAqB,OAAA;AAC9B,oCAA0C;AAAjC,iGAAA,UAAU,OAAA;AACnB,wDAAsD;AAA7C,6GAAA,YAAY,OAAA;AACrB,0DAAuD;AAA9C,8GAAA,YAAY,OAAA;AACrB,iDAA+B;AAC/B,wCAAuC;AAA9B,8FAAA,KAAK,OAAA;AACd,kDAAgC;AAChC,kDAAkD;AAAzC,yGAAA,WAAW,OAAA;AACpB,wCAA6D;AAAxC,wGAAA,eAAe,OAAA;AACpC,sDAAoD;AAA3C,2GAAA,WAAW,OAAA;AACpB,yDAAuC;AACvC,yDAAuC;AACvC,6DAA2C;AAC3C,uDAAqC;AACrC,yDAAuC;AACvC,yDAAuC;AACvC,+CAA6B;AAC7B,sDAAoC;AACpC,kDAAgC;AAChC,gDAA6D;AAApD,oHAAA,uBAAuB,OAAA;AAChC,2DAAyC;AACzC,kEAAgD;AAChD,yDAAuC;AACvC,mDAAsD;AAA7C,8GAAA,eAAe,OAAA;AACxB,2DAAyD;AAAhD,iHAAA,cAAc,OAAA;AACvB,+CAAkD;AAAzC,0GAAA,aAAa,OAAA;AACtB,yCAA+C;AAAtC,uGAAA,aAAa,OAAA;AACtB,+DAAiE;AAAxD,yHAAA,oBAAoB,OAAA;AAC7B,8CAA4B;AAC5B,qDAAqC;AACrC,8CAA4B;AAC5B,8CAA4B;AAC5B,4CAA0B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metriport/shared",
3
- "version": "0.14.3",
3
+ "version": "0.14.5-alpha.0",
4
4
  "description": "Common code shared across packages - by Metriport Inc.",
5
5
  "author": "Metriport Inc. <contact@metriport.com>",
6
6
  "homepage": "https://metriport.com/",
@@ -18,6 +18,7 @@
18
18
  ],
19
19
  "exports": {
20
20
  ".": "./dist/index.js",
21
+ "./api": "./dist/api/index.js",
21
22
  "./common/*": "./dist/common/*.js",
22
23
  "./interface/*": "./dist/interface/*.js",
23
24
  "./medical": "./dist/medical/index.js"
@@ -27,6 +28,12 @@
27
28
  "/": [
28
29
  "dist/index.d.ts"
29
30
  ],
31
+ "api": [
32
+ "dist/api/index.d.ts"
33
+ ],
34
+ "api/*": [
35
+ "dist/api/*"
36
+ ],
30
37
  "common/*": [
31
38
  "dist/common/*"
32
39
  ],
@@ -76,5 +83,5 @@
76
83
  "ts-jest": "29.1.1",
77
84
  "typescript": "^4.9.5"
78
85
  },
79
- "gitHead": "3bfb2bc7c4580d0ba079914e12f8a73f0e70c37b"
86
+ "gitHead": "2c563731f72117d67962405a6bfdfe8bf357a87f"
80
87
  }