@livechat/developer-studio-api 3.4.4 → 3.4.5
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 +28 -28
- package/dist/index.mjs +28 -28
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2644,65 +2644,65 @@ adapterClientInstance.interceptors.response.use(
|
|
|
2644
2644
|
}
|
|
2645
2645
|
);
|
|
2646
2646
|
function getAdapterClientConfig(options = {}) {
|
|
2647
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q
|
|
2647
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q;
|
|
2648
2648
|
const currentHeaders = adapterClientInstance.defaults.headers;
|
|
2649
2649
|
const headers = {
|
|
2650
2650
|
platform: {
|
|
2651
|
-
token: (
|
|
2651
|
+
token: (_c = currentHeaders.Authorization) != null ? _c : ((_a = options.platform) == null ? void 0 : _a.token) ? `${(_b = options.platform.tokenType) != null ? _b : "Bearer"} ${options.platform.token}` : void 0
|
|
2652
2652
|
},
|
|
2653
2653
|
integrations: {
|
|
2654
2654
|
github: {
|
|
2655
|
-
app: (
|
|
2656
|
-
oauth: (
|
|
2655
|
+
app: (_e = currentHeaders["x-adapter-github-app-token"]) != null ? _e : (_d = options.github) == null ? void 0 : _d.appToken,
|
|
2656
|
+
oauth: (_g = currentHeaders["x-adapter-github-oauth-token"]) != null ? _g : (_f = options.github) == null ? void 0 : _f.oauthToken
|
|
2657
2657
|
},
|
|
2658
|
-
netlify: (
|
|
2659
|
-
vercel: (
|
|
2660
|
-
planetscale: (
|
|
2661
|
-
neon: (
|
|
2662
|
-
mailchimp: (
|
|
2663
|
-
mailchimpServer: (
|
|
2664
|
-
shopify: (
|
|
2665
|
-
shopifyShop: (
|
|
2666
|
-
hubspot: (
|
|
2667
|
-
bigcommerce: (
|
|
2668
|
-
bigcommerceShop: (
|
|
2669
|
-
text: (
|
|
2658
|
+
netlify: (_i = currentHeaders["x-adapter-netlify-token"]) != null ? _i : (_h = options.netlify) == null ? void 0 : _h.token,
|
|
2659
|
+
vercel: (_k = currentHeaders["x-adapter-vercel-token"]) != null ? _k : (_j = options.vercel) == null ? void 0 : _j.token,
|
|
2660
|
+
planetscale: (_m = currentHeaders["x-adapter-planetscale-token"]) != null ? _m : (_l = options.planetscale) == null ? void 0 : _l.token,
|
|
2661
|
+
neon: (_o = currentHeaders["x-adapter-neon-token"]) != null ? _o : (_n = options.neon) == null ? void 0 : _n.token,
|
|
2662
|
+
mailchimp: (_q = currentHeaders["x-adapter-mailchimp-token"]) != null ? _q : (_p = options.mailchimp) == null ? void 0 : _p.token,
|
|
2663
|
+
mailchimpServer: (_s = currentHeaders["x-adapter-mailchimp-server"]) != null ? _s : (_r = options.mailchimp) == null ? void 0 : _r.server,
|
|
2664
|
+
shopify: (_u = currentHeaders["x-adapter-shopify-token"]) != null ? _u : (_t = options.shopify) == null ? void 0 : _t.token,
|
|
2665
|
+
shopifyShop: (_w = currentHeaders["x-adapter-shopify-shop"]) != null ? _w : (_v = options.shopify) == null ? void 0 : _v.shop,
|
|
2666
|
+
hubspot: (_y = currentHeaders["x-adapter-hubspot-token"]) != null ? _y : (_x = options.hubspot) == null ? void 0 : _x.token,
|
|
2667
|
+
bigcommerce: (_A = currentHeaders["x-adapter-bigcommerce-token"]) != null ? _A : (_z = options.bigcommerce) == null ? void 0 : _z.token,
|
|
2668
|
+
bigcommerceShop: (_C = currentHeaders["x-adapter-bigcommerce-shop"]) != null ? _C : (_B = options.bigcommerce) == null ? void 0 : _B.shop,
|
|
2669
|
+
text: (_E = currentHeaders["x-adapter-text-token"]) != null ? _E : (_D = options.text) == null ? void 0 : _D.token
|
|
2670
2670
|
}
|
|
2671
2671
|
};
|
|
2672
2672
|
if (currentHeaders.Authorization) {
|
|
2673
|
-
currentHeaders["X-Region"] = (
|
|
2673
|
+
currentHeaders["X-Region"] = (_F = getRegion(currentHeaders.Authorization)) != null ? _F : void 0;
|
|
2674
2674
|
}
|
|
2675
|
-
if (((
|
|
2675
|
+
if (((_G = options.ensureAuthorizationToken) == null ? void 0 : _G.platform) && !headers.platform.token) {
|
|
2676
2676
|
throw new UnauthorizeApiError("accounts");
|
|
2677
2677
|
}
|
|
2678
|
-
if (((
|
|
2678
|
+
if (((_H = options.ensureAuthorizationToken) == null ? void 0 : _H.github) && (!headers.integrations.github.app || !headers.integrations.github.oauth)) {
|
|
2679
2679
|
throw new UnauthorizeApiError("github");
|
|
2680
2680
|
}
|
|
2681
|
-
if (((
|
|
2681
|
+
if (((_I = options.ensureAuthorizationToken) == null ? void 0 : _I.vercel) && !headers.integrations.vercel) {
|
|
2682
2682
|
throw new UnauthorizeApiError("vercel");
|
|
2683
2683
|
}
|
|
2684
|
-
if (((
|
|
2684
|
+
if (((_J = options.ensureAuthorizationToken) == null ? void 0 : _J.netlify) && !headers.integrations.netlify) {
|
|
2685
2685
|
throw new UnauthorizeApiError("netlify");
|
|
2686
2686
|
}
|
|
2687
|
-
if (((
|
|
2687
|
+
if (((_K = options.ensureAuthorizationToken) == null ? void 0 : _K.planetscale) && !headers.integrations.planetscale) {
|
|
2688
2688
|
throw new UnauthorizeApiError("planetscale");
|
|
2689
2689
|
}
|
|
2690
|
-
if (((
|
|
2690
|
+
if (((_L = options.ensureAuthorizationToken) == null ? void 0 : _L.neon) && !headers.integrations.neon) {
|
|
2691
2691
|
throw new UnauthorizeApiError("neon");
|
|
2692
2692
|
}
|
|
2693
|
-
if (((
|
|
2693
|
+
if (((_M = options.ensureAuthorizationToken) == null ? void 0 : _M.mailchimp) && (!headers.integrations.mailchimp || !headers.integrations.mailchimpServer)) {
|
|
2694
2694
|
throw new UnauthorizeApiError("mailchimp");
|
|
2695
2695
|
}
|
|
2696
|
-
if (((
|
|
2696
|
+
if (((_N = options.ensureAuthorizationToken) == null ? void 0 : _N.shopify) && (!headers.integrations.shopify || !headers.integrations.shopifyShop)) {
|
|
2697
2697
|
throw new UnauthorizeApiError("shopify");
|
|
2698
2698
|
}
|
|
2699
|
-
if (((
|
|
2699
|
+
if (((_O = options.ensureAuthorizationToken) == null ? void 0 : _O.hubspot) && !headers.integrations.hubspot) {
|
|
2700
2700
|
throw new UnauthorizeApiError("hubspot");
|
|
2701
2701
|
}
|
|
2702
|
-
if (((
|
|
2702
|
+
if (((_P = options.ensureAuthorizationToken) == null ? void 0 : _P.bigcommerce) && (!headers.integrations.bigcommerce || !headers.integrations.bigcommerceShop)) {
|
|
2703
2703
|
throw new UnauthorizeApiError("bigcommerce");
|
|
2704
2704
|
}
|
|
2705
|
-
if (((
|
|
2705
|
+
if (((_Q = options.ensureAuthorizationToken) == null ? void 0 : _Q.text) && !headers.integrations.text) {
|
|
2706
2706
|
throw new UnauthorizeApiError("text");
|
|
2707
2707
|
}
|
|
2708
2708
|
return {
|
package/dist/index.mjs
CHANGED
|
@@ -2505,65 +2505,65 @@ adapterClientInstance.interceptors.response.use(
|
|
|
2505
2505
|
}
|
|
2506
2506
|
);
|
|
2507
2507
|
function getAdapterClientConfig(options = {}) {
|
|
2508
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q
|
|
2508
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q;
|
|
2509
2509
|
const currentHeaders = adapterClientInstance.defaults.headers;
|
|
2510
2510
|
const headers = {
|
|
2511
2511
|
platform: {
|
|
2512
|
-
token: (
|
|
2512
|
+
token: (_c = currentHeaders.Authorization) != null ? _c : ((_a = options.platform) == null ? void 0 : _a.token) ? `${(_b = options.platform.tokenType) != null ? _b : "Bearer"} ${options.platform.token}` : void 0
|
|
2513
2513
|
},
|
|
2514
2514
|
integrations: {
|
|
2515
2515
|
github: {
|
|
2516
|
-
app: (
|
|
2517
|
-
oauth: (
|
|
2516
|
+
app: (_e = currentHeaders["x-adapter-github-app-token"]) != null ? _e : (_d = options.github) == null ? void 0 : _d.appToken,
|
|
2517
|
+
oauth: (_g = currentHeaders["x-adapter-github-oauth-token"]) != null ? _g : (_f = options.github) == null ? void 0 : _f.oauthToken
|
|
2518
2518
|
},
|
|
2519
|
-
netlify: (
|
|
2520
|
-
vercel: (
|
|
2521
|
-
planetscale: (
|
|
2522
|
-
neon: (
|
|
2523
|
-
mailchimp: (
|
|
2524
|
-
mailchimpServer: (
|
|
2525
|
-
shopify: (
|
|
2526
|
-
shopifyShop: (
|
|
2527
|
-
hubspot: (
|
|
2528
|
-
bigcommerce: (
|
|
2529
|
-
bigcommerceShop: (
|
|
2530
|
-
text: (
|
|
2519
|
+
netlify: (_i = currentHeaders["x-adapter-netlify-token"]) != null ? _i : (_h = options.netlify) == null ? void 0 : _h.token,
|
|
2520
|
+
vercel: (_k = currentHeaders["x-adapter-vercel-token"]) != null ? _k : (_j = options.vercel) == null ? void 0 : _j.token,
|
|
2521
|
+
planetscale: (_m = currentHeaders["x-adapter-planetscale-token"]) != null ? _m : (_l = options.planetscale) == null ? void 0 : _l.token,
|
|
2522
|
+
neon: (_o = currentHeaders["x-adapter-neon-token"]) != null ? _o : (_n = options.neon) == null ? void 0 : _n.token,
|
|
2523
|
+
mailchimp: (_q = currentHeaders["x-adapter-mailchimp-token"]) != null ? _q : (_p = options.mailchimp) == null ? void 0 : _p.token,
|
|
2524
|
+
mailchimpServer: (_s = currentHeaders["x-adapter-mailchimp-server"]) != null ? _s : (_r = options.mailchimp) == null ? void 0 : _r.server,
|
|
2525
|
+
shopify: (_u = currentHeaders["x-adapter-shopify-token"]) != null ? _u : (_t = options.shopify) == null ? void 0 : _t.token,
|
|
2526
|
+
shopifyShop: (_w = currentHeaders["x-adapter-shopify-shop"]) != null ? _w : (_v = options.shopify) == null ? void 0 : _v.shop,
|
|
2527
|
+
hubspot: (_y = currentHeaders["x-adapter-hubspot-token"]) != null ? _y : (_x = options.hubspot) == null ? void 0 : _x.token,
|
|
2528
|
+
bigcommerce: (_A = currentHeaders["x-adapter-bigcommerce-token"]) != null ? _A : (_z = options.bigcommerce) == null ? void 0 : _z.token,
|
|
2529
|
+
bigcommerceShop: (_C = currentHeaders["x-adapter-bigcommerce-shop"]) != null ? _C : (_B = options.bigcommerce) == null ? void 0 : _B.shop,
|
|
2530
|
+
text: (_E = currentHeaders["x-adapter-text-token"]) != null ? _E : (_D = options.text) == null ? void 0 : _D.token
|
|
2531
2531
|
}
|
|
2532
2532
|
};
|
|
2533
2533
|
if (currentHeaders.Authorization) {
|
|
2534
|
-
currentHeaders["X-Region"] = (
|
|
2534
|
+
currentHeaders["X-Region"] = (_F = getRegion(currentHeaders.Authorization)) != null ? _F : void 0;
|
|
2535
2535
|
}
|
|
2536
|
-
if (((
|
|
2536
|
+
if (((_G = options.ensureAuthorizationToken) == null ? void 0 : _G.platform) && !headers.platform.token) {
|
|
2537
2537
|
throw new UnauthorizeApiError("accounts");
|
|
2538
2538
|
}
|
|
2539
|
-
if (((
|
|
2539
|
+
if (((_H = options.ensureAuthorizationToken) == null ? void 0 : _H.github) && (!headers.integrations.github.app || !headers.integrations.github.oauth)) {
|
|
2540
2540
|
throw new UnauthorizeApiError("github");
|
|
2541
2541
|
}
|
|
2542
|
-
if (((
|
|
2542
|
+
if (((_I = options.ensureAuthorizationToken) == null ? void 0 : _I.vercel) && !headers.integrations.vercel) {
|
|
2543
2543
|
throw new UnauthorizeApiError("vercel");
|
|
2544
2544
|
}
|
|
2545
|
-
if (((
|
|
2545
|
+
if (((_J = options.ensureAuthorizationToken) == null ? void 0 : _J.netlify) && !headers.integrations.netlify) {
|
|
2546
2546
|
throw new UnauthorizeApiError("netlify");
|
|
2547
2547
|
}
|
|
2548
|
-
if (((
|
|
2548
|
+
if (((_K = options.ensureAuthorizationToken) == null ? void 0 : _K.planetscale) && !headers.integrations.planetscale) {
|
|
2549
2549
|
throw new UnauthorizeApiError("planetscale");
|
|
2550
2550
|
}
|
|
2551
|
-
if (((
|
|
2551
|
+
if (((_L = options.ensureAuthorizationToken) == null ? void 0 : _L.neon) && !headers.integrations.neon) {
|
|
2552
2552
|
throw new UnauthorizeApiError("neon");
|
|
2553
2553
|
}
|
|
2554
|
-
if (((
|
|
2554
|
+
if (((_M = options.ensureAuthorizationToken) == null ? void 0 : _M.mailchimp) && (!headers.integrations.mailchimp || !headers.integrations.mailchimpServer)) {
|
|
2555
2555
|
throw new UnauthorizeApiError("mailchimp");
|
|
2556
2556
|
}
|
|
2557
|
-
if (((
|
|
2557
|
+
if (((_N = options.ensureAuthorizationToken) == null ? void 0 : _N.shopify) && (!headers.integrations.shopify || !headers.integrations.shopifyShop)) {
|
|
2558
2558
|
throw new UnauthorizeApiError("shopify");
|
|
2559
2559
|
}
|
|
2560
|
-
if (((
|
|
2560
|
+
if (((_O = options.ensureAuthorizationToken) == null ? void 0 : _O.hubspot) && !headers.integrations.hubspot) {
|
|
2561
2561
|
throw new UnauthorizeApiError("hubspot");
|
|
2562
2562
|
}
|
|
2563
|
-
if (((
|
|
2563
|
+
if (((_P = options.ensureAuthorizationToken) == null ? void 0 : _P.bigcommerce) && (!headers.integrations.bigcommerce || !headers.integrations.bigcommerceShop)) {
|
|
2564
2564
|
throw new UnauthorizeApiError("bigcommerce");
|
|
2565
2565
|
}
|
|
2566
|
-
if (((
|
|
2566
|
+
if (((_Q = options.ensureAuthorizationToken) == null ? void 0 : _Q.text) && !headers.integrations.text) {
|
|
2567
2567
|
throw new UnauthorizeApiError("text");
|
|
2568
2568
|
}
|
|
2569
2569
|
return {
|