@livechat/developer-studio-api 2.3.33 → 2.3.34

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/index.js CHANGED
@@ -5018,7 +5018,7 @@ platformAdapterClientInstance.interceptors.response.use(
5018
5018
  }
5019
5019
  );
5020
5020
  function getPlatformAdapterClientConfig(options = {}) {
5021
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
5021
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
5022
5022
  const currentHeaders = platformAdapterClientInstance.defaults.headers;
5023
5023
  const headers = {
5024
5024
  platform: {
@@ -5035,22 +5035,25 @@ function getPlatformAdapterClientConfig(options = {}) {
5035
5035
  sentry: (_j = currentHeaders["sentry-token"]) != null ? _j : options.sentry
5036
5036
  }
5037
5037
  };
5038
- if (((_l = (_k = options.ensureAuthorizationToken) == null ? void 0 : _k.platform) == null ? void 0 : _l.dps) && !headers.platform.dps) {
5038
+ if (currentHeaders["platform-dps-token"]) {
5039
+ currentHeaders["X-Region"] = (_k = getRegion2(currentHeaders["platform-dps-token"])) != null ? _k : void 0;
5040
+ }
5041
+ if (((_m = (_l = options.ensureAuthorizationToken) == null ? void 0 : _l.platform) == null ? void 0 : _m.dps) && !headers.platform.dps) {
5039
5042
  throw new UnauthorizeApiError("dps");
5040
5043
  }
5041
- if (((_m = options.ensureAuthorizationToken) == null ? void 0 : _m.github) && (!headers.integrations.github.app || !headers.integrations.github.oauth)) {
5044
+ if (((_n = options.ensureAuthorizationToken) == null ? void 0 : _n.github) && (!headers.integrations.github.app || !headers.integrations.github.oauth)) {
5042
5045
  throw new UnauthorizeApiError("github");
5043
5046
  }
5044
- if (((_n = options.ensureAuthorizationToken) == null ? void 0 : _n.vercel) && !headers.integrations.vercel) {
5047
+ if (((_o = options.ensureAuthorizationToken) == null ? void 0 : _o.vercel) && !headers.integrations.vercel) {
5045
5048
  throw new UnauthorizeApiError("vercel");
5046
5049
  }
5047
- if (((_o = options.ensureAuthorizationToken) == null ? void 0 : _o.netlify) && !headers.integrations.netlify) {
5050
+ if (((_p = options.ensureAuthorizationToken) == null ? void 0 : _p.netlify) && !headers.integrations.netlify) {
5048
5051
  throw new UnauthorizeApiError("netlify");
5049
5052
  }
5050
- if (((_p = options.ensureAuthorizationToken) == null ? void 0 : _p.planetscale) && !headers.integrations.planetscale) {
5053
+ if (((_q = options.ensureAuthorizationToken) == null ? void 0 : _q.planetscale) && !headers.integrations.planetscale) {
5051
5054
  throw new UnauthorizeApiError("planetscale");
5052
5055
  }
5053
- if (((_q = options.ensureAuthorizationToken) == null ? void 0 : _q.sentry) && !headers.integrations.sentry) {
5056
+ if (((_r = options.ensureAuthorizationToken) == null ? void 0 : _r.sentry) && !headers.integrations.sentry) {
5054
5057
  throw new UnauthorizeApiError("sentry");
5055
5058
  }
5056
5059
  return {
@@ -5072,19 +5075,15 @@ function initPlatformAdapterClientInstance(baseUrl, tokens) {
5072
5075
  }
5073
5076
  }
5074
5077
  function updatePlatformAdapterClientInstance(tokens) {
5075
- var _a, _b, _c, _d;
5078
+ var _a, _b, _c;
5076
5079
  const headers = platformAdapterClientInstance.defaults.headers;
5077
- const region = ((_a = tokens == null ? void 0 : tokens.platform) == null ? void 0 : _a.dps) ? getRegion2(tokens.platform.dps) : void 0;
5078
- if (region) {
5079
- headers["X-Region"] = region;
5080
- }
5081
- if ((_b = tokens == null ? void 0 : tokens.platform) == null ? void 0 : _b.dps) {
5080
+ if ((_a = tokens == null ? void 0 : tokens.platform) == null ? void 0 : _a.dps) {
5082
5081
  headers["platform-dps-token"] = tokens.platform.dps;
5083
5082
  }
5084
- if ((_c = tokens == null ? void 0 : tokens.github) == null ? void 0 : _c.app) {
5083
+ if ((_b = tokens == null ? void 0 : tokens.github) == null ? void 0 : _b.app) {
5085
5084
  headers["github-app-token"] = tokens.github.app;
5086
5085
  }
5087
- if ((_d = tokens == null ? void 0 : tokens.github) == null ? void 0 : _d.oauth) {
5086
+ if ((_c = tokens == null ? void 0 : tokens.github) == null ? void 0 : _c.oauth) {
5088
5087
  headers["github-oauth-token"] = tokens.github.oauth;
5089
5088
  }
5090
5089
  if (tokens == null ? void 0 : tokens.netlify) {
package/dist/index.mjs CHANGED
@@ -4927,7 +4927,7 @@ platformAdapterClientInstance.interceptors.response.use(
4927
4927
  }
4928
4928
  );
4929
4929
  function getPlatformAdapterClientConfig(options = {}) {
4930
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
4930
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
4931
4931
  const currentHeaders = platformAdapterClientInstance.defaults.headers;
4932
4932
  const headers = {
4933
4933
  platform: {
@@ -4944,22 +4944,25 @@ function getPlatformAdapterClientConfig(options = {}) {
4944
4944
  sentry: (_j = currentHeaders["sentry-token"]) != null ? _j : options.sentry
4945
4945
  }
4946
4946
  };
4947
- if (((_l = (_k = options.ensureAuthorizationToken) == null ? void 0 : _k.platform) == null ? void 0 : _l.dps) && !headers.platform.dps) {
4947
+ if (currentHeaders["platform-dps-token"]) {
4948
+ currentHeaders["X-Region"] = (_k = getRegion2(currentHeaders["platform-dps-token"])) != null ? _k : void 0;
4949
+ }
4950
+ if (((_m = (_l = options.ensureAuthorizationToken) == null ? void 0 : _l.platform) == null ? void 0 : _m.dps) && !headers.platform.dps) {
4948
4951
  throw new UnauthorizeApiError("dps");
4949
4952
  }
4950
- if (((_m = options.ensureAuthorizationToken) == null ? void 0 : _m.github) && (!headers.integrations.github.app || !headers.integrations.github.oauth)) {
4953
+ if (((_n = options.ensureAuthorizationToken) == null ? void 0 : _n.github) && (!headers.integrations.github.app || !headers.integrations.github.oauth)) {
4951
4954
  throw new UnauthorizeApiError("github");
4952
4955
  }
4953
- if (((_n = options.ensureAuthorizationToken) == null ? void 0 : _n.vercel) && !headers.integrations.vercel) {
4956
+ if (((_o = options.ensureAuthorizationToken) == null ? void 0 : _o.vercel) && !headers.integrations.vercel) {
4954
4957
  throw new UnauthorizeApiError("vercel");
4955
4958
  }
4956
- if (((_o = options.ensureAuthorizationToken) == null ? void 0 : _o.netlify) && !headers.integrations.netlify) {
4959
+ if (((_p = options.ensureAuthorizationToken) == null ? void 0 : _p.netlify) && !headers.integrations.netlify) {
4957
4960
  throw new UnauthorizeApiError("netlify");
4958
4961
  }
4959
- if (((_p = options.ensureAuthorizationToken) == null ? void 0 : _p.planetscale) && !headers.integrations.planetscale) {
4962
+ if (((_q = options.ensureAuthorizationToken) == null ? void 0 : _q.planetscale) && !headers.integrations.planetscale) {
4960
4963
  throw new UnauthorizeApiError("planetscale");
4961
4964
  }
4962
- if (((_q = options.ensureAuthorizationToken) == null ? void 0 : _q.sentry) && !headers.integrations.sentry) {
4965
+ if (((_r = options.ensureAuthorizationToken) == null ? void 0 : _r.sentry) && !headers.integrations.sentry) {
4963
4966
  throw new UnauthorizeApiError("sentry");
4964
4967
  }
4965
4968
  return {
@@ -4981,19 +4984,15 @@ function initPlatformAdapterClientInstance(baseUrl, tokens) {
4981
4984
  }
4982
4985
  }
4983
4986
  function updatePlatformAdapterClientInstance(tokens) {
4984
- var _a, _b, _c, _d;
4987
+ var _a, _b, _c;
4985
4988
  const headers = platformAdapterClientInstance.defaults.headers;
4986
- const region = ((_a = tokens == null ? void 0 : tokens.platform) == null ? void 0 : _a.dps) ? getRegion2(tokens.platform.dps) : void 0;
4987
- if (region) {
4988
- headers["X-Region"] = region;
4989
- }
4990
- if ((_b = tokens == null ? void 0 : tokens.platform) == null ? void 0 : _b.dps) {
4989
+ if ((_a = tokens == null ? void 0 : tokens.platform) == null ? void 0 : _a.dps) {
4991
4990
  headers["platform-dps-token"] = tokens.platform.dps;
4992
4991
  }
4993
- if ((_c = tokens == null ? void 0 : tokens.github) == null ? void 0 : _c.app) {
4992
+ if ((_b = tokens == null ? void 0 : tokens.github) == null ? void 0 : _b.app) {
4994
4993
  headers["github-app-token"] = tokens.github.app;
4995
4994
  }
4996
- if ((_d = tokens == null ? void 0 : tokens.github) == null ? void 0 : _d.oauth) {
4995
+ if ((_c = tokens == null ? void 0 : tokens.github) == null ? void 0 : _c.oauth) {
4997
4996
  headers["github-oauth-token"] = tokens.github.oauth;
4998
4997
  }
4999
4998
  if (tokens == null ? void 0 : tokens.netlify) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livechat/developer-studio-api",
3
- "version": "2.3.33",
3
+ "version": "2.3.34",
4
4
  "description": "This project is API for LiveChat Developer Studio.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -18,8 +18,8 @@
18
18
  "tsup": "^7.1.0",
19
19
  "typescript": "^5.1.6",
20
20
  "config": "0.0.1",
21
- "tsconfig": "0.0.1",
22
- "eslint-config-custom": "0.0.2"
21
+ "eslint-config-custom": "0.0.2",
22
+ "tsconfig": "0.0.1"
23
23
  },
24
24
  "scripts": {
25
25
  "build": "tsup src/index.ts --format esm,cjs --dts",