@metriport/shared 0.8.0 → 0.9.4

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 (65) hide show
  1. package/dist/common/date.d.ts +2 -1
  2. package/dist/common/date.d.ts.map +1 -1
  3. package/dist/common/date.js +5 -3
  4. package/dist/common/date.js.map +1 -1
  5. package/dist/common/file-downloader.d.ts +14 -0
  6. package/dist/common/file-downloader.d.ts.map +1 -0
  7. package/dist/common/file-downloader.js +63 -0
  8. package/dist/common/file-downloader.js.map +1 -0
  9. package/dist/common/net.d.ts +2 -0
  10. package/dist/common/net.d.ts.map +1 -0
  11. package/dist/common/net.js +16 -0
  12. package/dist/common/net.js.map +1 -0
  13. package/dist/common/stream.d.ts +6 -0
  14. package/dist/common/stream.d.ts.map +1 -0
  15. package/dist/common/stream.js +18 -0
  16. package/dist/common/stream.js.map +1 -0
  17. package/dist/common/uuid.d.ts +2 -0
  18. package/dist/common/uuid.d.ts.map +1 -0
  19. package/dist/common/uuid.js +5 -0
  20. package/dist/common/uuid.js.map +1 -0
  21. package/dist/index.d.ts +5 -1
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +19 -1
  24. package/dist/index.js.map +1 -1
  25. package/dist/medical/fhir/bundle.d.ts +5 -0
  26. package/dist/medical/fhir/bundle.d.ts.map +1 -0
  27. package/dist/medical/fhir/bundle.js +3 -0
  28. package/dist/medical/fhir/bundle.js.map +1 -0
  29. package/dist/medical/index.d.ts +4 -0
  30. package/dist/medical/index.d.ts.map +1 -0
  31. package/dist/medical/index.js +20 -0
  32. package/dist/medical/index.js.map +1 -0
  33. package/dist/medical/webhook/webhook-request.d.ts +464 -0
  34. package/dist/medical/webhook/webhook-request.d.ts.map +1 -0
  35. package/dist/medical/webhook/webhook-request.js +109 -0
  36. package/dist/medical/webhook/webhook-request.js.map +1 -0
  37. package/dist/medical/webhook/webhook-status-response.d.ts +7 -0
  38. package/dist/medical/webhook/webhook-status-response.d.ts.map +1 -0
  39. package/dist/medical/webhook/webhook-status-response.js +3 -0
  40. package/dist/medical/webhook/webhook-status-response.js.map +1 -0
  41. package/dist/net/__tests__/another.d.ts +1 -0
  42. package/dist/net/__tests__/another.d.ts.map +1 -0
  43. package/dist/net/__tests__/another.js +2 -0
  44. package/dist/net/__tests__/another.js.map +1 -0
  45. package/dist/net/__tests__/file-downloader.d.ts +2 -0
  46. package/dist/net/__tests__/file-downloader.d.ts.map +1 -0
  47. package/dist/net/__tests__/file-downloader.js +66 -0
  48. package/dist/net/__tests__/file-downloader.js.map +1 -0
  49. package/dist/net/file-downloader.d.ts +22 -0
  50. package/dist/net/file-downloader.d.ts.map +1 -0
  51. package/dist/net/file-downloader.js +67 -0
  52. package/dist/net/file-downloader.js.map +1 -0
  53. package/dist/net/net.d.ts +2 -0
  54. package/dist/net/net.d.ts.map +1 -0
  55. package/dist/net/net.js +16 -0
  56. package/dist/net/net.js.map +1 -0
  57. package/dist/net/stream.d.ts +6 -0
  58. package/dist/net/stream.d.ts.map +1 -0
  59. package/dist/net/stream.js +18 -0
  60. package/dist/net/stream.js.map +1 -0
  61. package/dist/net/url.d.ts +2 -0
  62. package/dist/net/url.d.ts.map +1 -0
  63. package/dist/net/url.js +16 -0
  64. package/dist/net/url.js.map +1 -0
  65. package/package.json +7 -3
@@ -0,0 +1,66 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ const fs = __importStar(require("fs"));
27
+ const file_downloader_1 = require("../file-downloader");
28
+ /**
29
+ * - Create a temporary folder with files to download
30
+ * - Create an HTTP server to serve the files:
31
+ * $ python3 -m http.server 8432
32
+ * - Update the `url` and `extension` constants with the name of the file to download
33
+ */
34
+ const url = "http://localhost:8432/file.png";
35
+ const extension = "png";
36
+ async function main1(fileName) {
37
+ console.log(`Downloading file from: ${url} directly into the filesystem...`);
38
+ const outputStream = fs.createWriteStream(fileName);
39
+ await (0, file_downloader_1.downloadToStream)({
40
+ url,
41
+ outputStream,
42
+ });
43
+ console.log(`Done`);
44
+ }
45
+ async function main2(fileName) {
46
+ console.log(`Downloading file from: ${url}...`);
47
+ const buf = await (0, file_downloader_1.downloadToMemory)({
48
+ url,
49
+ });
50
+ console.log(`Downloaded to buffer, storing on the filesystem...`);
51
+ fs.writeFileSync(fileName, buf);
52
+ console.log(`Done`);
53
+ }
54
+ async function main3(fileName) {
55
+ console.log(`Downloading file from: ${url}...`);
56
+ await (0, file_downloader_1.downloadToFile)({
57
+ url,
58
+ filePath: fileName,
59
+ });
60
+ console.log(`Done`);
61
+ }
62
+ const getFilename = (suffix) => `file_${suffix}.${extension}`;
63
+ main1(getFilename("from_stream"));
64
+ main2(getFilename("from_memory"));
65
+ main3(getFilename("direct"));
66
+ //# sourceMappingURL=file-downloader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-downloader.js","sourceRoot":"","sources":["../../../src/net/__tests__/file-downloader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,wDAAwF;AAExF;;;;;GAKG;AACH,MAAM,GAAG,GAAG,gCAAgC,CAAC;AAC7C,MAAM,SAAS,GAAG,KAAK,CAAC;AAExB,KAAK,UAAU,KAAK,CAAC,QAAgB;IACnC,OAAO,CAAC,GAAG,CAAC,0BAA0B,GAAG,kCAAkC,CAAC,CAAC;IAC7E,MAAM,YAAY,GAAG,EAAE,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IACpD,MAAM,IAAA,kCAAgB,EAAC;QACrB,GAAG;QACH,YAAY;KACb,CAAC,CAAC;IACH,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACtB,CAAC;AAED,KAAK,UAAU,KAAK,CAAC,QAAgB;IACnC,OAAO,CAAC,GAAG,CAAC,0BAA0B,GAAG,KAAK,CAAC,CAAC;IAChD,MAAM,GAAG,GAAG,MAAM,IAAA,kCAAgB,EAAC;QACjC,GAAG;KACJ,CAAC,CAAC;IACH,OAAO,CAAC,GAAG,CAAC,oDAAoD,CAAC,CAAC;IAClE,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAEhC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACtB,CAAC;AACD,KAAK,UAAU,KAAK,CAAC,QAAgB;IACnC,OAAO,CAAC,GAAG,CAAC,0BAA0B,GAAG,KAAK,CAAC,CAAC;IAChD,MAAM,IAAA,gCAAc,EAAC;QACnB,GAAG;QACH,QAAQ,EAAE,QAAQ;KACnB,CAAC,CAAC;IACH,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACtB,CAAC;AAED,MAAM,WAAW,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,QAAQ,MAAM,IAAI,SAAS,EAAE,CAAC;AAEtE,KAAK,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC;AAClC,KAAK,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC;AAClC,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,22 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import * as stream from "stream";
4
+ type BaseParams = {
5
+ headers?: {
6
+ [index: string]: string;
7
+ };
8
+ timeout?: number;
9
+ };
10
+ export type DownloadToStreamParams = BaseParams & {
11
+ url: string;
12
+ outputStream: stream.Writable;
13
+ };
14
+ export type DownloadToMemoryParams = Omit<DownloadToStreamParams, "outputStream">;
15
+ export type DownloadToFileParams = Omit<DownloadToStreamParams, "outputStream"> & {
16
+ filePath: string;
17
+ };
18
+ export declare function downloadToStream({ url, outputStream, ...configParams }: DownloadToStreamParams): Promise<boolean>;
19
+ export declare function downloadToMemory({ url, ...configParams }: DownloadToMemoryParams): Promise<Buffer>;
20
+ export declare function downloadToFile(params: DownloadToFileParams): Promise<void>;
21
+ export {};
22
+ //# sourceMappingURL=file-downloader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-downloader.d.ts","sourceRoot":"","sources":["../../src/net/file-downloader.ts"],"names":[],"mappings":";;AAEA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAKjC,KAAK,UAAU,GAAG;IAChB,OAAO,CAAC,EAAE;QACR,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;KACzB,CAAC;IACF,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,UAAU,GAAG;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,EAAE,cAAc,CAAC,CAAC;AAElF,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,sBAAsB,EAAE,cAAc,CAAC,GAAG;IAChF,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,wBAAsB,gBAAgB,CAAC,EACrC,GAAG,EACH,YAAY,EACZ,GAAG,YAAY,EAChB,EAAE,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC,CAK3C;AAED,wBAAsB,gBAAgB,CAAC,EACrC,GAAG,EACH,GAAG,YAAY,EAChB,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,CAI1C;AAED,wBAAsB,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAMhF"}
@@ -0,0 +1,67 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.downloadToFile = exports.downloadToMemory = exports.downloadToStream = void 0;
30
+ const axios_1 = __importDefault(require("axios"));
31
+ const fs = __importStar(require("fs"));
32
+ const stream = __importStar(require("stream"));
33
+ const util = __importStar(require("util"));
34
+ const pipeline = util.promisify(stream.pipeline);
35
+ async function downloadToStream({ url, outputStream, ...configParams }) {
36
+ const requestConfig = buildRequestConfig(configParams, "stream");
37
+ const response = await axios_1.default.get(url, requestConfig);
38
+ await pipeline(response.data, outputStream);
39
+ return true;
40
+ }
41
+ exports.downloadToStream = downloadToStream;
42
+ async function downloadToMemory({ url, ...configParams }) {
43
+ const requestConfig = buildRequestConfig(configParams, "arraybuffer");
44
+ const response = await axios_1.default.get(url, requestConfig);
45
+ return await response.data;
46
+ }
47
+ exports.downloadToMemory = downloadToMemory;
48
+ async function downloadToFile(params) {
49
+ const outputStream = fs.createWriteStream(params.filePath);
50
+ await downloadToStream({
51
+ ...params,
52
+ outputStream,
53
+ });
54
+ }
55
+ exports.downloadToFile = downloadToFile;
56
+ function buildRequestConfig({ timeout, headers }, responseType) {
57
+ const requestConfig = {
58
+ responseType,
59
+ ...(timeout ? { timeout } : undefined),
60
+ transitional: {
61
+ clarifyTimeoutError: true,
62
+ },
63
+ ...(headers && { headers }),
64
+ };
65
+ return requestConfig;
66
+ }
67
+ //# sourceMappingURL=file-downloader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-downloader.js","sourceRoot":"","sources":["../../src/net/file-downloader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAgE;AAChE,uCAAyB;AACzB,+CAAiC;AACjC,2CAA6B;AAE7B,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAoB1C,KAAK,UAAU,gBAAgB,CAAC,EACrC,GAAG,EACH,YAAY,EACZ,GAAG,YAAY,EACQ;IACvB,MAAM,aAAa,GAAG,kBAAkB,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IACjE,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,GAAG,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;IACrD,MAAM,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IAC5C,OAAO,IAAI,CAAC;AACd,CAAC;AATD,4CASC;AAEM,KAAK,UAAU,gBAAgB,CAAC,EACrC,GAAG,EACH,GAAG,YAAY,EACQ;IACvB,MAAM,aAAa,GAAG,kBAAkB,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;IACtE,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,GAAG,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;IACrD,OAAO,MAAM,QAAQ,CAAC,IAAI,CAAC;AAC7B,CAAC;AAPD,4CAOC;AAEM,KAAK,UAAU,cAAc,CAAC,MAA4B;IAC/D,MAAM,YAAY,GAAG,EAAE,CAAC,iBAAiB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC3D,MAAM,gBAAgB,CAAC;QACrB,GAAG,MAAM;QACT,YAAY;KACb,CAAC,CAAC;AACL,CAAC;AAND,wCAMC;AAED,SAAS,kBAAkB,CACzB,EAAE,OAAO,EAAE,OAAO,EAAc,EAChC,YAA0B;IAE1B,MAAM,aAAa,GAAuB;QACxC,YAAY;QACZ,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QACtC,YAAY,EAAE;YACZ,mBAAmB,EAAE,IAAI;SAC1B;QACD,GAAG,CAAC,OAAO,IAAI,EAAE,OAAO,EAAE,CAAC;KAC5B,CAAC;IACF,OAAO,aAAa,CAAC;AACvB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function isValidUrl(url: string | undefined): boolean;
2
+ //# sourceMappingURL=net.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"net.d.ts","sourceRoot":"","sources":["../../src/net/net.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAQ3D"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isValidUrl = void 0;
4
+ function isValidUrl(url) {
5
+ if (!url)
6
+ return false;
7
+ try {
8
+ new URL(url);
9
+ return true;
10
+ }
11
+ catch (e) {
12
+ return false;
13
+ }
14
+ }
15
+ exports.isValidUrl = isValidUrl;
16
+ //# sourceMappingURL=net.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"net.js","sourceRoot":"","sources":["../../src/net/net.ts"],"names":[],"mappings":";;;AAAA,SAAgB,UAAU,CAAC,GAAuB;IAChD,IAAI,CAAC,GAAG;QAAE,OAAO,KAAK,CAAC;IACvB,IAAI;QACF,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QACb,OAAO,IAAI,CAAC;KACb;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,KAAK,CAAC;KACd;AACH,CAAC;AARD,gCAQC"}
@@ -0,0 +1,6 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import * as stream from "stream";
4
+ export declare function streamToBuffer(stream: stream.Stream): Promise<Buffer>;
5
+ export declare function streamToString(stream: stream.Stream): Promise<String>;
6
+ //# sourceMappingURL=stream.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../src/net/stream.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAO3E;AAED,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAG3E"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.streamToString = exports.streamToBuffer = void 0;
4
+ async function streamToBuffer(stream) {
5
+ const buffers = Array();
6
+ return new Promise((resolve, reject) => {
7
+ stream.on("data", chunk => buffers.push(Buffer.from(chunk)));
8
+ stream.on("error", err => reject(err));
9
+ stream.on("end", () => resolve(Buffer.concat(buffers)));
10
+ });
11
+ }
12
+ exports.streamToBuffer = streamToBuffer;
13
+ async function streamToString(stream) {
14
+ const buffer = await streamToBuffer(stream);
15
+ return buffer.toString();
16
+ }
17
+ exports.streamToString = streamToString;
18
+ //# sourceMappingURL=stream.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream.js","sourceRoot":"","sources":["../../src/net/stream.ts"],"names":[],"mappings":";;;AAEO,KAAK,UAAU,cAAc,CAAC,MAAqB;IACxD,MAAM,OAAO,GAAG,KAAK,EAAO,CAAC;IAC7B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC7D,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QACvC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;AACL,CAAC;AAPD,wCAOC;AAEM,KAAK,UAAU,cAAc,CAAC,MAAqB;IACxD,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,MAAM,CAAC,CAAC;IAC5C,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;AAC3B,CAAC;AAHD,wCAGC"}
@@ -0,0 +1,2 @@
1
+ export declare function isValidUrl(url: string | undefined): boolean;
2
+ //# sourceMappingURL=url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../src/net/url.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAQ3D"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isValidUrl = void 0;
4
+ function isValidUrl(url) {
5
+ if (!url)
6
+ return false;
7
+ try {
8
+ new URL(url);
9
+ return true;
10
+ }
11
+ catch (e) {
12
+ return false;
13
+ }
14
+ }
15
+ exports.isValidUrl = isValidUrl;
16
+ //# sourceMappingURL=url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url.js","sourceRoot":"","sources":["../../src/net/url.ts"],"names":[],"mappings":";;;AAAA,SAAgB,UAAU,CAAC,GAAuB;IAChD,IAAI,CAAC,GAAG;QAAE,OAAO,KAAK,CAAC;IACvB,IAAI;QACF,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QACb,OAAO,IAAI,CAAC;KACb;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,KAAK,CAAC;KACd;AACH,CAAC;AARD,gCAQC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metriport/shared",
3
- "version": "0.8.0",
3
+ "version": "0.9.4",
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,7 +18,8 @@
18
18
  ],
19
19
  "exports": {
20
20
  ".": "./dist/index.js",
21
- "./common/*": "./dist/common/*.js"
21
+ "./common/*": "./dist/common/*.js",
22
+ "./medical": "./dist/medical/index.js"
22
23
  },
23
24
  "typesVersions": {
24
25
  "*": {
@@ -27,6 +28,9 @@
27
28
  ],
28
29
  "common/*": [
29
30
  "dist/common/*"
31
+ ],
32
+ "medical": [
33
+ "dist/medical/index.d.ts"
30
34
  ]
31
35
  }
32
36
  },
@@ -54,5 +58,5 @@
54
58
  "devDependencies": {
55
59
  "@faker-js/faker": "^8.0.2"
56
60
  },
57
- "gitHead": "5d65f4af80f79c8af06185ac7ef52e72d2c1df6d"
61
+ "gitHead": "43d9baebc754c51f9b1a4edd76f076a0ab65c285"
58
62
  }