@nsshunt/stsfhirclient 1.0.21 → 1.0.23

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,6 +11,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
11
11
  var _options2, _DUMMY_USER, _invokeMethods, _maxRetries, _sleepDuration, _NoRetryStatusCodes, _stsfhirapiroot, _agentManager2, _LogDebugMessage, _LogErrorMessage, _HandleError, _InvokeResourceAPI, _TestMode, ___InvokeResourceAPI;
12
12
  import axios from "axios";
13
13
  import { Sleep } from "@nsshunt/stsutils";
14
+ import http from "node:http";
14
15
  import https from "node:https";
15
16
  var byteToHex = [];
16
17
  for (var i = 0; i < 256; ++i) {
@@ -1557,10 +1558,10 @@ var StatusCodes;
1557
1558
  StatusCodes2[StatusCodes2["INSUFFICIENT_STORAGE"] = 507] = "INSUFFICIENT_STORAGE";
1558
1559
  StatusCodes2[StatusCodes2["NETWORK_AUTHENTICATION_REQUIRED"] = 511] = "NETWORK_AUTHENTICATION_REQUIRED";
1559
1560
  })(StatusCodes || (StatusCodes = {}));
1560
- const http = {};
1561
+ const __viteBrowserExternal = {};
1561
1562
  const fs$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1562
1563
  __proto__: null,
1563
- default: http
1564
+ default: __viteBrowserExternal
1564
1565
  }, Symbol.toStringTag, { value: "Module" }));
1565
1566
  var main$1 = { exports: {} };
1566
1567
  const require$$3 = /* @__PURE__ */ getAugmentedNamespace(fs$1);
@@ -3691,13 +3692,6 @@ _requestCount = /* @__PURE__ */ new WeakMap();
3691
3692
  _SetupResetInterval = /* @__PURE__ */ new WeakMap();
3692
3693
  _GetAgentOptions = /* @__PURE__ */ new WeakMap();
3693
3694
  class STSAxiosConfig {
3694
- /*
3695
- headers = {
3696
- 'Content-Type': 'application/json',
3697
- 'Authorization': 'Bearer ' + accesss_token,
3698
- 'x-sts_user_id': DUMMY_USER
3699
- }
3700
- */
3701
3695
  constructor(url, method, headers, timeout) {
3702
3696
  __privateAdd2(this, _url);
3703
3697
  __privateAdd2(this, _method);
@@ -3715,6 +3709,13 @@ class STSAxiosConfig {
3715
3709
  __privateSet2(this, _timeout, timeout);
3716
3710
  }
3717
3711
  }
3712
+ withCookies(cookies) {
3713
+ if (!__privateGet2(this, _headers)) {
3714
+ __privateSet2(this, _headers, {});
3715
+ }
3716
+ __privateGet2(this, _headers)["Cookie"] = cookies.join("; ");
3717
+ return this;
3718
+ }
3718
3719
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3719
3720
  withData(data) {
3720
3721
  __privateSet2(this, _data, data);
@@ -3722,10 +3723,11 @@ class STSAxiosConfig {
3722
3723
  }
3723
3724
  // 'Content-Type': 'application/json'
3724
3725
  withAuthHeaders(accesssToken, stsUserId) {
3725
- __privateSet2(this, _headers, {
3726
- "Content-Type": "application/json",
3727
- "Authorization": "Bearer " + accesssToken
3728
- });
3726
+ if (!__privateGet2(this, _headers)) {
3727
+ __privateSet2(this, _headers, {});
3728
+ }
3729
+ __privateGet2(this, _headers)["Content-Type"] = "application/json";
3730
+ __privateGet2(this, _headers)["Authorization"] = "Bearer " + accesssToken;
3729
3731
  if (stsUserId) {
3730
3732
  __privateGet2(this, _headers)["x-sts_user_id"] = stsUserId;
3731
3733
  }
@@ -3736,9 +3738,10 @@ class STSAxiosConfig {
3736
3738
  return this;
3737
3739
  }
3738
3740
  withDefaultHeaders() {
3739
- __privateSet2(this, _headers, {
3740
- "Content-Type": "application/json"
3741
- });
3741
+ if (!__privateGet2(this, _headers)) {
3742
+ __privateSet2(this, _headers, {});
3743
+ }
3744
+ __privateGet2(this, _headers)["Content-Type"] = "application/json";
3742
3745
  return this;
3743
3746
  }
3744
3747
  withCredentials() {