@nsshunt/stsfhirclient 1.0.20 → 1.0.22

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.
@@ -3709,20 +3709,39 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
3709
3709
  __privateSet2(this, _timeout, timeout);
3710
3710
  }
3711
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
+ }
3712
3719
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3713
3720
  withData(data) {
3714
3721
  __privateSet2(this, _data, data);
3715
3722
  return this;
3716
3723
  }
3717
3724
  // 'Content-Type': 'application/json'
3725
+ withAuthHeaders(accesssToken, stsUserId) {
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;
3731
+ if (stsUserId) {
3732
+ __privateGet2(this, _headers)["x-sts_user_id"] = stsUserId;
3733
+ }
3734
+ return this;
3735
+ }
3718
3736
  withHeaders(headers) {
3719
3737
  __privateSet2(this, _headers, headers);
3720
3738
  return this;
3721
3739
  }
3722
3740
  withDefaultHeaders() {
3723
- __privateSet2(this, _headers, {
3724
- "Content-Type": "application/json"
3725
- });
3741
+ if (!__privateGet2(this, _headers)) {
3742
+ __privateSet2(this, _headers, {});
3743
+ }
3744
+ __privateGet2(this, _headers)["Content-Type"] = "application/json";
3726
3745
  return this;
3727
3746
  }
3728
3747
  withCredentials() {
@@ -3909,11 +3928,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
3909
3928
  }
3910
3929
  }
3911
3930
  const accessToken = await __privateGet(this, _options2).GetAccessToken();
3912
- const requestConfig = new STSAxiosConfig(url, httpVerb).withHeaders({
3913
- "Content-Type": "application/json",
3914
- "Authorization": `Bearer ${accessToken}`,
3915
- "x-sts_user_id": __privateGet(this, _DUMMY_USER)
3916
- }).withData(filters ? filters : domainResource ? domainResource : void 0);
3931
+ const requestConfig = new STSAxiosConfig(url, httpVerb).withAuthHeaders(accessToken, __privateGet(this, _DUMMY_USER)).withData(filters ? filters : domainResource ? domainResource : void 0);
3917
3932
  if (isNode && __privateGet(this, _agentManager2)) {
3918
3933
  requestConfig.withAgentManager(__privateGet(this, _agentManager2));
3919
3934
  }
@@ -4013,9 +4028,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
4013
4028
  __publicField(this, "GetLatency", async () => {
4014
4029
  const url = `${__privateGet(this, _options2).fhirEndpoint}${__privateGet(this, _stsfhirapiroot)}/latency`;
4015
4030
  try {
4016
- const requestConfig = new STSAxiosConfig(url, "get", {
4017
- "Content-Type": "application/json"
4018
- });
4031
+ const requestConfig = new STSAxiosConfig(url, "get").withDefaultHeaders();
4019
4032
  if (isNode && __privateGet(this, _agentManager2)) {
4020
4033
  requestConfig.withAgentManager(__privateGet(this, _agentManager2));
4021
4034
  }