@nsshunt/stsoauth2plugin 1.0.114 → 1.0.116

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.
@@ -25,6 +25,7 @@ import { ClientStorageFactory, ClientStorageType } from "@nsshunt/stsvueutils";
25
25
  import { defineStore } from "pinia";
26
26
  import { STSInstrumentControllerPluginKey, Gauge } from "@nsshunt/stsobservability";
27
27
  import axios from "axios";
28
+ import http from "node:http";
28
29
  import https from "node:https";
29
30
  const STSOAuth2ManagerPluginKey = Symbol();
30
31
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
@@ -1995,10 +1996,10 @@ function commonjsRequire(path2) {
1995
1996
  throw new Error('Could not dynamically require "' + path2 + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
1996
1997
  }
1997
1998
  var core = { exports: {} };
1998
- const http = {};
1999
+ const __viteBrowserExternal = {};
1999
2000
  const fs$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2000
2001
  __proto__: null,
2001
- default: http
2002
+ default: __viteBrowserExternal
2002
2003
  }, Symbol.toStringTag, { value: "Module" }));
2003
2004
  const require$$3 = /* @__PURE__ */ getAugmentedNamespace(fs$1);
2004
2005
  var hasRequiredCore;
@@ -5089,20 +5090,39 @@ class STSAxiosConfig {
5089
5090
  __privateSet2(this, _timeout, timeout);
5090
5091
  }
5091
5092
  }
5093
+ withCookies(cookies) {
5094
+ if (!__privateGet2(this, _headers)) {
5095
+ __privateSet2(this, _headers, {});
5096
+ }
5097
+ __privateGet2(this, _headers)["Cookie"] = cookies.join("; ");
5098
+ return this;
5099
+ }
5092
5100
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5093
5101
  withData(data) {
5094
5102
  __privateSet2(this, _data, data);
5095
5103
  return this;
5096
5104
  }
5097
5105
  // 'Content-Type': 'application/json'
5106
+ withAuthHeaders(accesssToken, stsUserId) {
5107
+ if (!__privateGet2(this, _headers)) {
5108
+ __privateSet2(this, _headers, {});
5109
+ }
5110
+ __privateGet2(this, _headers)["Content-Type"] = "application/json";
5111
+ __privateGet2(this, _headers)["Authorization"] = "Bearer " + accesssToken;
5112
+ if (stsUserId) {
5113
+ __privateGet2(this, _headers)["x-sts_user_id"] = stsUserId;
5114
+ }
5115
+ return this;
5116
+ }
5098
5117
  withHeaders(headers) {
5099
5118
  __privateSet2(this, _headers, headers);
5100
5119
  return this;
5101
5120
  }
5102
5121
  withDefaultHeaders() {
5103
- __privateSet2(this, _headers, {
5104
- "Content-Type": "application/json"
5105
- });
5122
+ if (!__privateGet2(this, _headers)) {
5123
+ __privateSet2(this, _headers, {});
5124
+ }
5125
+ __privateGet2(this, _headers)["Content-Type"] = "application/json";
5106
5126
  return this;
5107
5127
  }
5108
5128
  withCredentials() {