@nsshunt/stsfhirclient 1.0.69 → 1.0.70
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.
package/dist/stsfhirclient.mjs
CHANGED
|
@@ -8,7 +8,7 @@ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot
|
|
|
8
8
|
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
9
9
|
var __privateAdd = (obj, member, value2) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value2);
|
|
10
10
|
var __privateSet = (obj, member, value2, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value2) : member.set(obj, value2), value2);
|
|
11
|
-
var _socketUtils, _id, _options2, _clientName, _debug, _error, _info, _SetupWSSClient, _OnSocketConnected, _options3, _DUMMY_USER,
|
|
11
|
+
var _socketUtils, _id, _options2, _clientName, _debug, _error, _info, _SetupWSSClient, _OnSocketConnected, _options3, _DUMMY_USER, _stsfhirapiroot, _fhirSocketClient, _LogDebugMessage, _HandleError, _BuildQueryString, _InvokeResourceAPI;
|
|
12
12
|
import axios from "axios";
|
|
13
13
|
import { defaultLogger, Sleep, STSAxiosConfig } from "@nsshunt/stsutils";
|
|
14
14
|
const isNode$1 = Object.prototype.toString.call(typeof process !== "undefined" ? process : 0) === "[object process]";
|
|
@@ -5419,22 +5419,12 @@ class FhirClient {
|
|
|
5419
5419
|
__privateAdd(this, _options3);
|
|
5420
5420
|
__privateAdd(this, _DUMMY_USER, "USR_user01@stsmda.com.au");
|
|
5421
5421
|
//@@ needs to come from headers ??
|
|
5422
|
-
__privateAdd(this, _invokeMethods, {});
|
|
5423
|
-
__privateAdd(this, _maxRetries, 5);
|
|
5424
|
-
__privateAdd(this, _sleepDuration, [50, 100, 200, 500, 1e3, 2e3, 5e3]);
|
|
5425
|
-
__privateAdd(this, _NoRetryStatusCodes, [
|
|
5426
|
-
StatusCodes.NOT_FOUND,
|
|
5427
|
-
StatusCodes.CONFLICT
|
|
5428
|
-
]);
|
|
5429
5422
|
__privateAdd(this, _stsfhirapiroot, "/stsfhir/r5");
|
|
5430
5423
|
// Default value
|
|
5431
5424
|
__privateAdd(this, _fhirSocketClient);
|
|
5432
5425
|
__privateAdd(this, _LogDebugMessage, (message) => {
|
|
5433
5426
|
__privateGet(this, _options3).logger.debug(message);
|
|
5434
5427
|
});
|
|
5435
|
-
__privateAdd(this, _LogErrorMessage, (message) => {
|
|
5436
|
-
__privateGet(this, _options3).logger.error(message);
|
|
5437
|
-
});
|
|
5438
5428
|
__privateAdd(this, _HandleError, (error) => {
|
|
5439
5429
|
__privateGet(this, _LogDebugMessage).call(this, chalk.red(`HandleError(): Error: [${error}]`));
|
|
5440
5430
|
let responseCode = 500;
|
|
@@ -5449,18 +5439,6 @@ class FhirClient {
|
|
|
5449
5439
|
}
|
|
5450
5440
|
return responseCode;
|
|
5451
5441
|
});
|
|
5452
|
-
__privateAdd(this, _TestMode, (metaData, errorCb) => {
|
|
5453
|
-
const { id, url: url2, httpVerb, filters, retries } = metaData;
|
|
5454
|
-
if (retries < 1) {
|
|
5455
|
-
errorCb(401, new Error(`Testing Error Only. Error Code: [401], Message ID: [${id}, url: [${url2}], httpVerb: [${httpVerb}], filters: [${filters}], Retries: [${retries}]`));
|
|
5456
|
-
return true;
|
|
5457
|
-
}
|
|
5458
|
-
if (retries < 2) {
|
|
5459
|
-
errorCb(500, new Error(`Testing Error Only. Error Code: [500], Message ID: [${id}, url: [${url2}], httpVerb: [${httpVerb}], filters: [${filters}], Retries: [${retries}]`));
|
|
5460
|
-
return true;
|
|
5461
|
-
}
|
|
5462
|
-
return false;
|
|
5463
|
-
});
|
|
5464
5442
|
__privateAdd(this, _BuildQueryString, (baseUrl, queryParams) => {
|
|
5465
5443
|
const url2 = new URL(baseUrl);
|
|
5466
5444
|
const searchParams = new URLSearchParams(queryParams);
|
|
@@ -5482,6 +5460,7 @@ class FhirClient {
|
|
|
5482
5460
|
var _a;
|
|
5483
5461
|
console.warn(`Retry #${attempt} after ${delayMs}ms due to ${error.code || ((_a = error.response) == null ? void 0 : _a.status)}`);
|
|
5484
5462
|
}
|
|
5463
|
+
// Below works also ...
|
|
5485
5464
|
//stsAxiosConfig: requestConfig
|
|
5486
5465
|
});
|
|
5487
5466
|
return await api(url2, requestConfig.config);
|
|
@@ -5741,16 +5720,10 @@ class FhirClient {
|
|
|
5741
5720
|
}
|
|
5742
5721
|
_options3 = new WeakMap();
|
|
5743
5722
|
_DUMMY_USER = new WeakMap();
|
|
5744
|
-
_invokeMethods = new WeakMap();
|
|
5745
|
-
_maxRetries = new WeakMap();
|
|
5746
|
-
_sleepDuration = new WeakMap();
|
|
5747
|
-
_NoRetryStatusCodes = new WeakMap();
|
|
5748
5723
|
_stsfhirapiroot = new WeakMap();
|
|
5749
5724
|
_fhirSocketClient = new WeakMap();
|
|
5750
5725
|
_LogDebugMessage = new WeakMap();
|
|
5751
|
-
_LogErrorMessage = new WeakMap();
|
|
5752
5726
|
_HandleError = new WeakMap();
|
|
5753
|
-
_TestMode = new WeakMap();
|
|
5754
5727
|
_BuildQueryString = new WeakMap();
|
|
5755
5728
|
_InvokeResourceAPI = new WeakMap();
|
|
5756
5729
|
export {
|