@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.
@@ -1,6 +1,6 @@
1
1
  (function(global, factory) {
2
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("axios"), require("@nsshunt/stsutils"), require("node:https")) : typeof define === "function" && define.amd ? define(["exports", "axios", "@nsshunt/stsutils", "node:https"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global["@nsshunt/stsfhirclient"] = {}, global.axios, global.stsutils, global.https));
3
- })(this, function(exports2, axios, stsutils, https) {
2
+ typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("axios"), require("@nsshunt/stsutils"), require("node:http"), require("node:https")) : typeof define === "function" && define.amd ? define(["exports", "axios", "@nsshunt/stsutils", "node:http", "node:https"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global["@nsshunt/stsfhirclient"] = {}, global.axios, global.stsutils, global.http, global.https));
3
+ })(this, function(exports2, axios, stsutils, http, https) {
4
4
  "use strict";var __defProp = Object.defineProperty;
5
5
  var __typeError = (msg) => {
6
6
  throw TypeError(msg);
@@ -1558,10 +1558,10 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
1558
1558
  StatusCodes2[StatusCodes2["INSUFFICIENT_STORAGE"] = 507] = "INSUFFICIENT_STORAGE";
1559
1559
  StatusCodes2[StatusCodes2["NETWORK_AUTHENTICATION_REQUIRED"] = 511] = "NETWORK_AUTHENTICATION_REQUIRED";
1560
1560
  })(StatusCodes || (StatusCodes = {}));
1561
- const http = {};
1561
+ const __viteBrowserExternal = {};
1562
1562
  const fs$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1563
1563
  __proto__: null,
1564
- default: http
1564
+ default: __viteBrowserExternal
1565
1565
  }, Symbol.toStringTag, { value: "Module" }));
1566
1566
  var main$1 = { exports: {} };
1567
1567
  const require$$3 = /* @__PURE__ */ getAugmentedNamespace(fs$1);
@@ -3692,13 +3692,6 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
3692
3692
  _SetupResetInterval = /* @__PURE__ */ new WeakMap();
3693
3693
  _GetAgentOptions = /* @__PURE__ */ new WeakMap();
3694
3694
  class STSAxiosConfig {
3695
- /*
3696
- headers = {
3697
- 'Content-Type': 'application/json',
3698
- 'Authorization': 'Bearer ' + accesss_token,
3699
- 'x-sts_user_id': DUMMY_USER
3700
- }
3701
- */
3702
3695
  constructor(url, method, headers, timeout) {
3703
3696
  __privateAdd2(this, _url);
3704
3697
  __privateAdd2(this, _method);
@@ -3716,6 +3709,13 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
3716
3709
  __privateSet2(this, _timeout, timeout);
3717
3710
  }
3718
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
+ }
3719
3719
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3720
3720
  withData(data) {
3721
3721
  __privateSet2(this, _data, data);
@@ -3723,10 +3723,11 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
3723
3723
  }
3724
3724
  // 'Content-Type': 'application/json'
3725
3725
  withAuthHeaders(accesssToken, stsUserId) {
3726
- __privateSet2(this, _headers, {
3727
- "Content-Type": "application/json",
3728
- "Authorization": "Bearer " + accesssToken
3729
- });
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;
3730
3731
  if (stsUserId) {
3731
3732
  __privateGet2(this, _headers)["x-sts_user_id"] = stsUserId;
3732
3733
  }
@@ -3737,9 +3738,10 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
3737
3738
  return this;
3738
3739
  }
3739
3740
  withDefaultHeaders() {
3740
- __privateSet2(this, _headers, {
3741
- "Content-Type": "application/json"
3742
- });
3741
+ if (!__privateGet2(this, _headers)) {
3742
+ __privateSet2(this, _headers, {});
3743
+ }
3744
+ __privateGet2(this, _headers)["Content-Type"] = "application/json";
3743
3745
  return this;
3744
3746
  }
3745
3747
  withCredentials() {