@metriport/commonwell-sdk 4.0.1 → 4.0.2
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.
|
@@ -11,7 +11,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.downloadFile = void 0;
|
|
13
13
|
const axios_1 = require("axios");
|
|
14
|
-
const httpStatus = require("http-status");
|
|
15
14
|
const stream = require("stream");
|
|
16
15
|
const util = require("util");
|
|
17
16
|
const pipeline = util.promisify(stream.pipeline);
|
|
@@ -19,18 +18,11 @@ function downloadFile({ url, outputStream, client, headers, }) {
|
|
|
19
18
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
19
|
const config = {
|
|
21
20
|
responseType: "stream",
|
|
22
|
-
validateStatus: null,
|
|
23
21
|
headers,
|
|
24
22
|
};
|
|
25
23
|
const response = yield (client !== null && client !== void 0 ? client : axios_1.default).get(url, config);
|
|
26
24
|
yield pipeline(response.data, outputStream);
|
|
27
|
-
|
|
28
|
-
if (httpStatus[`${status}_CLASS`] === httpStatus.classes.SUCCESSFUL)
|
|
29
|
-
return true;
|
|
30
|
-
const msg = `Failed to download, status ${status}: ${response.statusText}`;
|
|
31
|
-
console.log(`${msg}`);
|
|
32
|
-
console.log({ url, headers, client });
|
|
33
|
-
throw new Error(msg);
|
|
25
|
+
return true;
|
|
34
26
|
});
|
|
35
27
|
}
|
|
36
28
|
exports.downloadFile = downloadFile;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileDownload.js","sourceRoot":"","sources":["../../src/common/fileDownload.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iCAAiE;AACjE,
|
|
1
|
+
{"version":3,"file":"fileDownload.js","sourceRoot":"","sources":["../../src/common/fileDownload.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iCAAiE;AACjE,iCAAiC;AACjC,6BAA6B;AAE7B,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAEjD,SAAsB,YAAY,CAAC,EACjC,GAAG,EACH,YAAY,EACZ,MAAM,EACN,OAAO,GAQR;;QACC,MAAM,MAAM,GAAuB;YACjC,YAAY,EAAE,QAAQ;YACtB,OAAO;SACR,CAAC;QACF,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,eAAK,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAC1D,MAAM,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QAC5C,OAAO,IAAI,CAAC;IACd,CAAC;CAAA;AApBD,oCAoBC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metriport/commonwell-sdk",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"description": "SDK to simplify CommonWell API integration - by Metriport Inc.",
|
|
5
5
|
"author": "Metriport Inc. <contact@metriport.com>",
|
|
6
6
|
"homepage": "https://metriport.com/",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"@types/jsonwebtoken": "^9.0.0",
|
|
45
45
|
"@types/node": "^18.11.18"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "f2fa583df030d1fe359893014e09329751b4785b"
|
|
48
48
|
}
|