@livechat/developer-studio-api 3.0.52 → 3.0.54
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.d.mts +453 -32
- package/dist/index.d.ts +453 -32
- package/dist/index.js +322 -81
- package/dist/index.mjs +315 -81
- package/package.json +3 -2
package/dist/index.mjs
CHANGED
|
@@ -93,13 +93,13 @@ githubClientInstance.interceptors.response.use(
|
|
|
93
93
|
function getGitHubClientAuthorization(req) {
|
|
94
94
|
if (req.headers instanceof Headers) {
|
|
95
95
|
return {
|
|
96
|
-
appToken: req.headers.get("github-app-token"),
|
|
97
|
-
oauthToken: req.headers.get("github-oauth-token")
|
|
96
|
+
appToken: req.headers.get("x-adapter-github-app-token"),
|
|
97
|
+
oauthToken: req.headers.get("x-adapter-github-oauth-token")
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
100
|
return {
|
|
101
|
-
appToken: req.headers["github-app-token"],
|
|
102
|
-
oauthToken: req.headers["github-oauth-token"]
|
|
101
|
+
appToken: req.headers["x-adapter-github-app-token"],
|
|
102
|
+
oauthToken: req.headers["x-adapter-github-oauth-token"]
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
105
|
function getGithubClientConfig(options = {}) {
|
|
@@ -556,11 +556,11 @@ netlifyClientInstance.interceptors.response.use(
|
|
|
556
556
|
function getNetlifyClientAuthorization(req) {
|
|
557
557
|
if (req.headers instanceof Headers) {
|
|
558
558
|
return {
|
|
559
|
-
token: req.headers.get("netlify-token")
|
|
559
|
+
token: req.headers.get("x-adapter-netlify-token")
|
|
560
560
|
};
|
|
561
561
|
}
|
|
562
562
|
return {
|
|
563
|
-
token: req.headers["netlify-token"]
|
|
563
|
+
token: req.headers["x-adapter-netlify-token"]
|
|
564
564
|
};
|
|
565
565
|
}
|
|
566
566
|
function getNetlifyClientConfig(options = {}) {
|
|
@@ -1020,11 +1020,11 @@ planetScaleClientInstance.interceptors.response.use(
|
|
|
1020
1020
|
function getPlanetScaleClientAuthorization(req) {
|
|
1021
1021
|
if (req.headers instanceof Headers) {
|
|
1022
1022
|
return {
|
|
1023
|
-
token: req.headers.get("planetscale-token")
|
|
1023
|
+
token: req.headers.get("x-adapter-planetscale-token")
|
|
1024
1024
|
};
|
|
1025
1025
|
}
|
|
1026
1026
|
return {
|
|
1027
|
-
token: req.headers["planetscale-token"]
|
|
1027
|
+
token: req.headers["x-adapter-planetscale-token"]
|
|
1028
1028
|
};
|
|
1029
1029
|
}
|
|
1030
1030
|
function getPlanetScaleClientConfig(options = {}) {
|
|
@@ -1237,12 +1237,12 @@ var textClientInstance = axios6.create({
|
|
|
1237
1237
|
function getTextClientAuthorization(req) {
|
|
1238
1238
|
if (req.headers instanceof Headers) {
|
|
1239
1239
|
return {
|
|
1240
|
-
token: req.headers.get("platform-token"),
|
|
1240
|
+
token: req.headers.get("x-adapter-platform-token"),
|
|
1241
1241
|
tokenType: "Bearer"
|
|
1242
1242
|
};
|
|
1243
1243
|
}
|
|
1244
1244
|
return {
|
|
1245
|
-
token: req.headers["platform-token"],
|
|
1245
|
+
token: req.headers["x-adapter-platform-token"],
|
|
1246
1246
|
tokenType: "Bearer"
|
|
1247
1247
|
};
|
|
1248
1248
|
}
|
|
@@ -1756,11 +1756,11 @@ vercelClientInstance.interceptors.response.use(
|
|
|
1756
1756
|
function getVercelClientAuthorization(req) {
|
|
1757
1757
|
if (req.headers instanceof Headers) {
|
|
1758
1758
|
return {
|
|
1759
|
-
token: req.headers.get("vercel-token")
|
|
1759
|
+
token: req.headers.get("x-adapter-vercel-token")
|
|
1760
1760
|
};
|
|
1761
1761
|
}
|
|
1762
1762
|
return {
|
|
1763
|
-
token: req.headers["vercel-token"]
|
|
1763
|
+
token: req.headers["x-adapter-vercel-token"]
|
|
1764
1764
|
};
|
|
1765
1765
|
}
|
|
1766
1766
|
function getVercelClientConfig(options = {}) {
|
|
@@ -2080,11 +2080,11 @@ neonClientInstance.interceptors.response.use(
|
|
|
2080
2080
|
function getNeonClientAuthorization(req) {
|
|
2081
2081
|
if (req.headers instanceof Headers) {
|
|
2082
2082
|
return {
|
|
2083
|
-
token: req.headers.get("neon-token")
|
|
2083
|
+
token: req.headers.get("x-adapter-neon-token")
|
|
2084
2084
|
};
|
|
2085
2085
|
}
|
|
2086
2086
|
return {
|
|
2087
|
-
token: req.headers["neon-token"]
|
|
2087
|
+
token: req.headers["x-adapter-neon-token"]
|
|
2088
2088
|
};
|
|
2089
2089
|
}
|
|
2090
2090
|
function getNeonClientConfig(options = {}) {
|
|
@@ -2413,13 +2413,13 @@ mailchimpClientInstance.interceptors.response.use(
|
|
|
2413
2413
|
function getMailchimpClientAuthorization(req) {
|
|
2414
2414
|
if (req.headers instanceof Headers) {
|
|
2415
2415
|
return {
|
|
2416
|
-
server: req.headers.get("mailchimp-server"),
|
|
2417
|
-
token: req.headers.get("mailchimp-token")
|
|
2416
|
+
server: req.headers.get("x-adapter-mailchimp-server"),
|
|
2417
|
+
token: req.headers.get("x-adapter-mailchimp-token")
|
|
2418
2418
|
};
|
|
2419
2419
|
}
|
|
2420
2420
|
return {
|
|
2421
|
-
server: req.headers["mailchimp-server"],
|
|
2422
|
-
token: req.headers["mailchimp-token"]
|
|
2421
|
+
server: req.headers["x-adapter-mailchimp-server"],
|
|
2422
|
+
token: req.headers["x-adapter-mailchimp-token"]
|
|
2423
2423
|
};
|
|
2424
2424
|
}
|
|
2425
2425
|
function getMailchimpClientConfig(options = {}) {
|
|
@@ -2584,16 +2584,16 @@ var getShopifyClientUrl = (store) => `https://${store}.myshopify.com/admin/api/2
|
|
|
2584
2584
|
function getShopifyClientAuthorization(req) {
|
|
2585
2585
|
if (req.headers instanceof Headers) {
|
|
2586
2586
|
return {
|
|
2587
|
-
shop: req.headers.get("shopify-shop"),
|
|
2588
|
-
token: req.headers.get("shopify-token")
|
|
2587
|
+
shop: req.headers.get("x-adapter-shopify-shop"),
|
|
2588
|
+
token: req.headers.get("x-adapter-shopify-token")
|
|
2589
2589
|
};
|
|
2590
2590
|
}
|
|
2591
2591
|
return {
|
|
2592
|
-
shop: req.headers["shopify-shop"],
|
|
2593
|
-
token: req.headers["shopify-token"]
|
|
2592
|
+
shop: req.headers["x-adapter-shopify-shop"],
|
|
2593
|
+
token: req.headers["x-adapter-shopify-token"]
|
|
2594
2594
|
};
|
|
2595
2595
|
}
|
|
2596
|
-
function getShopifyClientConfig(options) {
|
|
2596
|
+
function getShopifyClientConfig(options = {}) {
|
|
2597
2597
|
var _a, _b;
|
|
2598
2598
|
const currentBaseUrl = shopifyClientInstance.defaults.baseURL;
|
|
2599
2599
|
const currentHeaders = shopifyClientInstance.defaults.headers;
|
|
@@ -2754,11 +2754,11 @@ livechatClientInstance.interceptors.response.use(
|
|
|
2754
2754
|
function getLiveChatClientAuthorization(req) {
|
|
2755
2755
|
if (req.headers instanceof Headers) {
|
|
2756
2756
|
return {
|
|
2757
|
-
token: req.headers.get("platform-token")
|
|
2757
|
+
token: req.headers.get("x-adapter-platform-token")
|
|
2758
2758
|
};
|
|
2759
2759
|
}
|
|
2760
2760
|
return {
|
|
2761
|
-
token: req.headers["platform-token"]
|
|
2761
|
+
token: req.headers["x-adapter-platform-token"]
|
|
2762
2762
|
};
|
|
2763
2763
|
}
|
|
2764
2764
|
function getLiveChatClientConfig(options = {}) {
|
|
@@ -3326,11 +3326,11 @@ platformAccountsClientInstance.interceptors.response.use(
|
|
|
3326
3326
|
function getPlatformAccountsClientAuthorization(req) {
|
|
3327
3327
|
if (req.headers instanceof Headers) {
|
|
3328
3328
|
return {
|
|
3329
|
-
token: req.headers.get("platform-token")
|
|
3329
|
+
token: req.headers.get("x-adapter-platform-token")
|
|
3330
3330
|
};
|
|
3331
3331
|
}
|
|
3332
3332
|
return {
|
|
3333
|
-
token: req.headers["platform-token"]
|
|
3333
|
+
token: req.headers["x-adapter-platform-token"]
|
|
3334
3334
|
};
|
|
3335
3335
|
}
|
|
3336
3336
|
function getPlatformAccountsClientConfig(options = {}) {
|
|
@@ -3668,12 +3668,12 @@ platformDpsClientInstance.interceptors.response.use(
|
|
|
3668
3668
|
function getPlatformDpsClientAuthorization(req) {
|
|
3669
3669
|
if (req.headers instanceof Headers) {
|
|
3670
3670
|
return {
|
|
3671
|
-
token: req.headers.get("platform-token"),
|
|
3671
|
+
token: req.headers.get("x-adapter-platform-token"),
|
|
3672
3672
|
tokenType: "Bearer"
|
|
3673
3673
|
};
|
|
3674
3674
|
}
|
|
3675
3675
|
return {
|
|
3676
|
-
token: req.headers["platform-token"],
|
|
3676
|
+
token: req.headers["x-adapter-platform-token"],
|
|
3677
3677
|
tokenType: "Bearer"
|
|
3678
3678
|
};
|
|
3679
3679
|
}
|
|
@@ -5257,61 +5257,61 @@ function getPlatformAdapterClientAuthorization(req) {
|
|
|
5257
5257
|
if (req.headers instanceof Headers) {
|
|
5258
5258
|
return {
|
|
5259
5259
|
platform: {
|
|
5260
|
-
token: req.headers.get("platform-token")
|
|
5260
|
+
token: req.headers.get("x-adapter-platform-token")
|
|
5261
5261
|
},
|
|
5262
5262
|
github: {
|
|
5263
|
-
appToken: req.headers.get("github-app-token"),
|
|
5264
|
-
oauthToken: req.headers.get("github-oauth-token")
|
|
5263
|
+
appToken: req.headers.get("x-adapter-github-app-token"),
|
|
5264
|
+
oauthToken: req.headers.get("x-adapter-github-oauth-token")
|
|
5265
5265
|
},
|
|
5266
5266
|
netlify: {
|
|
5267
|
-
token: req.headers.get("netlify-token")
|
|
5267
|
+
token: req.headers.get("x-adapter-netlify-token")
|
|
5268
5268
|
},
|
|
5269
5269
|
vercel: {
|
|
5270
|
-
token: req.headers.get("vercel-token")
|
|
5270
|
+
token: req.headers.get("x-adapter-vercel-token")
|
|
5271
5271
|
},
|
|
5272
5272
|
planetscale: {
|
|
5273
|
-
token: req.headers.get("planetscale-token")
|
|
5273
|
+
token: req.headers.get("x-adapter-planetscale-token")
|
|
5274
5274
|
},
|
|
5275
5275
|
neon: {
|
|
5276
|
-
token: req.headers.get("neon-token")
|
|
5276
|
+
token: req.headers.get("x-adapter-neon-token")
|
|
5277
5277
|
},
|
|
5278
5278
|
mailchimp: {
|
|
5279
|
-
token: req.headers.get("mailchimp-token"),
|
|
5280
|
-
server: req.headers.get("mailchimp-server")
|
|
5279
|
+
token: req.headers.get("x-adapter-mailchimp-token"),
|
|
5280
|
+
server: req.headers.get("x-adapter-mailchimp-server")
|
|
5281
5281
|
},
|
|
5282
5282
|
shopify: {
|
|
5283
|
-
token: req.headers.get("shopify-token"),
|
|
5284
|
-
shop: req.headers.get("shopify-shop")
|
|
5283
|
+
token: req.headers.get("x-adapter-shopify-token"),
|
|
5284
|
+
shop: req.headers.get("x-adapter-shopify-shop")
|
|
5285
5285
|
}
|
|
5286
5286
|
};
|
|
5287
5287
|
}
|
|
5288
5288
|
return {
|
|
5289
5289
|
platform: {
|
|
5290
|
-
token: req.headers["platform-token"]
|
|
5290
|
+
token: req.headers["x-adapter-platform-token"]
|
|
5291
5291
|
},
|
|
5292
5292
|
github: {
|
|
5293
|
-
appToken: req.headers["github-app-token"],
|
|
5294
|
-
oauthToken: req.headers["github-oauth-token"]
|
|
5293
|
+
appToken: req.headers["x-adapter-github-app-token"],
|
|
5294
|
+
oauthToken: req.headers["x-adapter-github-oauth-token"]
|
|
5295
5295
|
},
|
|
5296
5296
|
netlify: {
|
|
5297
|
-
token: req.headers["netlify-token"]
|
|
5297
|
+
token: req.headers["x-adapter-netlify-token"]
|
|
5298
5298
|
},
|
|
5299
5299
|
vercel: {
|
|
5300
|
-
token: req.headers["vercel-token"]
|
|
5300
|
+
token: req.headers["x-adapter-vercel-token"]
|
|
5301
5301
|
},
|
|
5302
5302
|
planetscale: {
|
|
5303
|
-
token: req.headers["planetscale-token"]
|
|
5303
|
+
token: req.headers["x-adapter-planetscale-token"]
|
|
5304
5304
|
},
|
|
5305
5305
|
neon: {
|
|
5306
|
-
token: req.headers["neon-token"]
|
|
5306
|
+
token: req.headers["x-adapter-neon-token"]
|
|
5307
5307
|
},
|
|
5308
5308
|
mailchimp: {
|
|
5309
|
-
token: req.headers["mailchimp-token"],
|
|
5310
|
-
server: req.headers["mailchimp-server"]
|
|
5309
|
+
token: req.headers["x-adapter-mailchimp-token"],
|
|
5310
|
+
server: req.headers["x-adapter-mailchimp-server"]
|
|
5311
5311
|
},
|
|
5312
5312
|
shopify: {
|
|
5313
|
-
token: req.headers["shopify-token"],
|
|
5314
|
-
shop: req.headers["shopify-shop"]
|
|
5313
|
+
token: req.headers["x-adapter-shopify-token"],
|
|
5314
|
+
shop: req.headers["x-adapter-shopify-shop"]
|
|
5315
5315
|
}
|
|
5316
5316
|
};
|
|
5317
5317
|
}
|
|
@@ -5320,25 +5320,25 @@ function getPlatformAdapterClientConfig(options = {}) {
|
|
|
5320
5320
|
const currentHeaders = platformAdapterClientInstance.defaults.headers;
|
|
5321
5321
|
const headers = {
|
|
5322
5322
|
platform: {
|
|
5323
|
-
token: (_b = currentHeaders["platform-token"]) != null ? _b : (_a = options.platform) == null ? void 0 : _a.token
|
|
5323
|
+
token: (_b = currentHeaders["x-adapter-platform-token"]) != null ? _b : (_a = options.platform) == null ? void 0 : _a.token
|
|
5324
5324
|
},
|
|
5325
5325
|
integrations: {
|
|
5326
5326
|
github: {
|
|
5327
|
-
app: (_d = currentHeaders["github-app-token"]) != null ? _d : (_c = options.github) == null ? void 0 : _c.appToken,
|
|
5328
|
-
oauth: (_f = currentHeaders["github-oauth-token"]) != null ? _f : (_e = options.github) == null ? void 0 : _e.oauthToken
|
|
5327
|
+
app: (_d = currentHeaders["x-adapter-github-app-token"]) != null ? _d : (_c = options.github) == null ? void 0 : _c.appToken,
|
|
5328
|
+
oauth: (_f = currentHeaders["x-adapter-github-oauth-token"]) != null ? _f : (_e = options.github) == null ? void 0 : _e.oauthToken
|
|
5329
5329
|
},
|
|
5330
|
-
netlify: (_h = currentHeaders["netlify-token"]) != null ? _h : (_g = options.netlify) == null ? void 0 : _g.token,
|
|
5331
|
-
vercel: (_j = currentHeaders["vercel-token"]) != null ? _j : (_i = options.vercel) == null ? void 0 : _i.token,
|
|
5332
|
-
planetscale: (_l = currentHeaders["planetscale-token"]) != null ? _l : (_k = options.planetscale) == null ? void 0 : _k.token,
|
|
5333
|
-
neon: (_n = currentHeaders["neon-token"]) != null ? _n : (_m = options.neon) == null ? void 0 : _m.token,
|
|
5334
|
-
mailchimp: (_p = currentHeaders["mailchimp-token"]) != null ? _p : (_o = options.mailchimp) == null ? void 0 : _o.token,
|
|
5335
|
-
mailchimpServer: (_r = currentHeaders["mailchimp-server"]) != null ? _r : (_q = options.mailchimp) == null ? void 0 : _q.server,
|
|
5336
|
-
shopify: (_t = currentHeaders["shopify-token"]) != null ? _t : (_s = options.shopify) == null ? void 0 : _s.token,
|
|
5337
|
-
shopifyShop: (_v = currentHeaders["shopify-shop"]) != null ? _v : (_u = options.shopify) == null ? void 0 : _u.shop
|
|
5330
|
+
netlify: (_h = currentHeaders["x-adapter-netlify-token"]) != null ? _h : (_g = options.netlify) == null ? void 0 : _g.token,
|
|
5331
|
+
vercel: (_j = currentHeaders["x-adapter-vercel-token"]) != null ? _j : (_i = options.vercel) == null ? void 0 : _i.token,
|
|
5332
|
+
planetscale: (_l = currentHeaders["x-adapter-planetscale-token"]) != null ? _l : (_k = options.planetscale) == null ? void 0 : _k.token,
|
|
5333
|
+
neon: (_n = currentHeaders["x-adapter-neon-token"]) != null ? _n : (_m = options.neon) == null ? void 0 : _m.token,
|
|
5334
|
+
mailchimp: (_p = currentHeaders["x-adapter-mailchimp-token"]) != null ? _p : (_o = options.mailchimp) == null ? void 0 : _o.token,
|
|
5335
|
+
mailchimpServer: (_r = currentHeaders["x-adapter-mailchimp-server"]) != null ? _r : (_q = options.mailchimp) == null ? void 0 : _q.server,
|
|
5336
|
+
shopify: (_t = currentHeaders["x-adapter-shopify-token"]) != null ? _t : (_s = options.shopify) == null ? void 0 : _s.token,
|
|
5337
|
+
shopifyShop: (_v = currentHeaders["x-adapter-shopify-shop"]) != null ? _v : (_u = options.shopify) == null ? void 0 : _u.shop
|
|
5338
5338
|
}
|
|
5339
5339
|
};
|
|
5340
|
-
if (currentHeaders["platform-token"]) {
|
|
5341
|
-
currentHeaders["X-Region"] = (_w = getRegion2(currentHeaders["platform-token"])) != null ? _w : void 0;
|
|
5340
|
+
if (currentHeaders["x-adapter-platform-token"]) {
|
|
5341
|
+
currentHeaders["X-Region"] = (_w = getRegion2(currentHeaders["x-adapter-platform-token"])) != null ? _w : void 0;
|
|
5342
5342
|
}
|
|
5343
5343
|
if (((_x = options.ensureAuthorizationToken) == null ? void 0 : _x.platform) && !headers.platform.token) {
|
|
5344
5344
|
throw new UnauthorizeApiError("accounts");
|
|
@@ -5365,7 +5365,7 @@ function getPlatformAdapterClientConfig(options = {}) {
|
|
|
5365
5365
|
throw new UnauthorizeApiError("shopify");
|
|
5366
5366
|
}
|
|
5367
5367
|
return {
|
|
5368
|
-
headers: __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, headers.platform.token ? { "platform-token": headers.platform.token } : {}), headers.integrations.github.app ? { "github-app-token": headers.integrations.github.app } : {}), headers.integrations.github.oauth ? { "github-oauth-token": headers.integrations.github.oauth } : {}), headers.integrations.netlify ? { "netlify-token": headers.integrations.netlify } : {}), headers.integrations.vercel ? { "vercel-token": headers.integrations.vercel } : {}), headers.integrations.planetscale ? { "planetscale-token": headers.integrations.planetscale } : {}), headers.integrations.neon ? { "neon-token": headers.integrations.neon } : {}), headers.integrations.mailchimp ? { "mailchimp-token": headers.integrations.mailchimp } : {}), headers.integrations.mailchimpServer ? { "mailchimp-server": headers.integrations.mailchimpServer } : {}), headers.integrations.shopify ? { "shopify-token": headers.integrations.shopify } : {}), headers.integrations.shopifyShop ? { "shopify-shop": headers.integrations.shopifyShop } : {})
|
|
5368
|
+
headers: __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, headers.platform.token ? { "x-adapter-platform-token": headers.platform.token } : {}), headers.integrations.github.app ? { "x-adapter-github-app-token": headers.integrations.github.app } : {}), headers.integrations.github.oauth ? { "x-adapter-github-oauth-token": headers.integrations.github.oauth } : {}), headers.integrations.netlify ? { "x-adapter-netlify-token": headers.integrations.netlify } : {}), headers.integrations.vercel ? { "x-adapter-vercel-token": headers.integrations.vercel } : {}), headers.integrations.planetscale ? { "x-adapter-planetscale-token": headers.integrations.planetscale } : {}), headers.integrations.neon ? { "x-adapter-neon-token": headers.integrations.neon } : {}), headers.integrations.mailchimp ? { "x-adapter-mailchimp-token": headers.integrations.mailchimp } : {}), headers.integrations.mailchimpServer ? { "x-adapter-mailchimp-server": headers.integrations.mailchimpServer } : {}), headers.integrations.shopify ? { "x-adapter-shopify-token": headers.integrations.shopify } : {}), headers.integrations.shopifyShop ? { "x-adapter-shopify-shop": headers.integrations.shopifyShop } : {})
|
|
5369
5369
|
};
|
|
5370
5370
|
}
|
|
5371
5371
|
var getPlatformAdapterClientDefaultConfig = (authorization) => getPlatformAdapterClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
@@ -5391,37 +5391,37 @@ function updatePlatformAdapterClient(tokens) {
|
|
|
5391
5391
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
5392
5392
|
const headers = platformAdapterClientInstance.defaults.headers;
|
|
5393
5393
|
if ((_a = tokens == null ? void 0 : tokens.platform) == null ? void 0 : _a.token) {
|
|
5394
|
-
headers["platform-token"] = tokens.platform.token;
|
|
5394
|
+
headers["x-adapter-platform-token"] = tokens.platform.token;
|
|
5395
5395
|
}
|
|
5396
5396
|
if ((_b = tokens == null ? void 0 : tokens.github) == null ? void 0 : _b.appToken) {
|
|
5397
|
-
headers["github-app-token"] = tokens.github.appToken;
|
|
5397
|
+
headers["x-adapter-github-app-token"] = tokens.github.appToken;
|
|
5398
5398
|
}
|
|
5399
5399
|
if ((_c = tokens == null ? void 0 : tokens.github) == null ? void 0 : _c.oauthToken) {
|
|
5400
|
-
headers["github-oauth-token"] = tokens.github.oauthToken;
|
|
5400
|
+
headers["x-adapter-github-oauth-token"] = tokens.github.oauthToken;
|
|
5401
5401
|
}
|
|
5402
5402
|
if ((_d = tokens == null ? void 0 : tokens.netlify) == null ? void 0 : _d.token) {
|
|
5403
|
-
headers["netlify-token"] = tokens.netlify.token;
|
|
5403
|
+
headers["x-adapter-netlify-token"] = tokens.netlify.token;
|
|
5404
5404
|
}
|
|
5405
5405
|
if ((_e = tokens == null ? void 0 : tokens.vercel) == null ? void 0 : _e.token) {
|
|
5406
|
-
headers["vercel-token"] = tokens.vercel.token;
|
|
5406
|
+
headers["x-adapter-vercel-token"] = tokens.vercel.token;
|
|
5407
5407
|
}
|
|
5408
5408
|
if ((_f = tokens == null ? void 0 : tokens.planetscale) == null ? void 0 : _f.token) {
|
|
5409
|
-
headers["planetscale-token"] = tokens.planetscale.token;
|
|
5409
|
+
headers["x-adapter-planetscale-token"] = tokens.planetscale.token;
|
|
5410
5410
|
}
|
|
5411
5411
|
if ((_g = tokens == null ? void 0 : tokens.neon) == null ? void 0 : _g.token) {
|
|
5412
|
-
headers["neon-token"] = tokens.neon.token;
|
|
5412
|
+
headers["x-adapter-neon-token"] = tokens.neon.token;
|
|
5413
5413
|
}
|
|
5414
5414
|
if ((_h = tokens == null ? void 0 : tokens.mailchimp) == null ? void 0 : _h.server) {
|
|
5415
|
-
headers["mailchimp-server"] = tokens.mailchimp.server;
|
|
5415
|
+
headers["x-adapter-mailchimp-server"] = tokens.mailchimp.server;
|
|
5416
5416
|
}
|
|
5417
5417
|
if ((_i = tokens == null ? void 0 : tokens.mailchimp) == null ? void 0 : _i.token) {
|
|
5418
|
-
headers["mailchimp-token"] = tokens.mailchimp.token;
|
|
5418
|
+
headers["x-adapter-mailchimp-token"] = tokens.mailchimp.token;
|
|
5419
5419
|
}
|
|
5420
5420
|
if ((_j = tokens == null ? void 0 : tokens.shopify) == null ? void 0 : _j.shop) {
|
|
5421
|
-
headers["shopify-shop"] = tokens.shopify.shop;
|
|
5421
|
+
headers["x-adapter-shopify-shop"] = tokens.shopify.shop;
|
|
5422
5422
|
}
|
|
5423
5423
|
if ((_k = tokens == null ? void 0 : tokens.shopify) == null ? void 0 : _k.token) {
|
|
5424
|
-
headers["shopify-token"] = tokens.shopify.token;
|
|
5424
|
+
headers["x-adapter-shopify-token"] = tokens.shopify.token;
|
|
5425
5425
|
}
|
|
5426
5426
|
}
|
|
5427
5427
|
|
|
@@ -5918,11 +5918,11 @@ var platformBillingClientInstance = axios19.create({
|
|
|
5918
5918
|
function getPlatformBillingClientAuthorization(req) {
|
|
5919
5919
|
if (req.headers instanceof Headers) {
|
|
5920
5920
|
return {
|
|
5921
|
-
token: req.headers.get("platform-token")
|
|
5921
|
+
token: req.headers.get("x-adapter-platform-token")
|
|
5922
5922
|
};
|
|
5923
5923
|
}
|
|
5924
5924
|
return {
|
|
5925
|
-
token: req.headers["platform-token"]
|
|
5925
|
+
token: req.headers["x-adapter-platform-token"]
|
|
5926
5926
|
};
|
|
5927
5927
|
}
|
|
5928
5928
|
function getPlatformBillingClientConfig(options = {}) {
|
|
@@ -5952,6 +5952,182 @@ function initPlatformBillingClient(baseUrl, token) {
|
|
|
5952
5952
|
}
|
|
5953
5953
|
}
|
|
5954
5954
|
|
|
5955
|
+
// src/apis/platform/adapter/integrations/_contracts/requests/events.ts
|
|
5956
|
+
import { z as z4 } from "zod";
|
|
5957
|
+
|
|
5958
|
+
// src/apis/platform/adapter/integrations/shopify/_contracts/dtos/events.ts
|
|
5959
|
+
var ShopifyEvents = /* @__PURE__ */ ((ShopifyEvents2) => {
|
|
5960
|
+
ShopifyEvents2["OrdersCreate"] = "orders/create";
|
|
5961
|
+
return ShopifyEvents2;
|
|
5962
|
+
})(ShopifyEvents || {});
|
|
5963
|
+
|
|
5964
|
+
// src/apis/platform/adapter/integrations/shopify/_contracts/requests/events.ts
|
|
5965
|
+
import { z } from "zod";
|
|
5966
|
+
var shopifyEventsZods = {
|
|
5967
|
+
event: z.nativeEnum(ShopifyEvents),
|
|
5968
|
+
get body() {
|
|
5969
|
+
return z.object({
|
|
5970
|
+
event: this.event
|
|
5971
|
+
});
|
|
5972
|
+
},
|
|
5973
|
+
get provider() {
|
|
5974
|
+
return z.object({
|
|
5975
|
+
provider: z.literal("shopify"),
|
|
5976
|
+
event: this.event
|
|
5977
|
+
});
|
|
5978
|
+
},
|
|
5979
|
+
get source() {
|
|
5980
|
+
return z.object({
|
|
5981
|
+
sourceName: z.enum(["apps", "workflows"]),
|
|
5982
|
+
sourceKey: z.string()
|
|
5983
|
+
});
|
|
5984
|
+
},
|
|
5985
|
+
get subscribe() {
|
|
5986
|
+
return this.source.and(this.body).and(
|
|
5987
|
+
z.object({
|
|
5988
|
+
callback: z.string()
|
|
5989
|
+
})
|
|
5990
|
+
);
|
|
5991
|
+
},
|
|
5992
|
+
get unsubscribe() {
|
|
5993
|
+
return this.source.and(this.body);
|
|
5994
|
+
}
|
|
5995
|
+
};
|
|
5996
|
+
|
|
5997
|
+
// src/apis/platform/adapter/integrations/mailchimp/_contracts/requests/events.ts
|
|
5998
|
+
import { z as z2 } from "zod";
|
|
5999
|
+
|
|
6000
|
+
// src/apis/platform/adapter/integrations/mailchimp/_contracts/dtos/events.ts
|
|
6001
|
+
var MailchimpEvents = /* @__PURE__ */ ((MailchimpEvents2) => {
|
|
6002
|
+
MailchimpEvents2["Subscribe"] = "subscribe";
|
|
6003
|
+
MailchimpEvents2["Unsubscribe"] = "unsubscribe";
|
|
6004
|
+
return MailchimpEvents2;
|
|
6005
|
+
})(MailchimpEvents || {});
|
|
6006
|
+
|
|
6007
|
+
// src/apis/platform/adapter/integrations/mailchimp/_contracts/requests/events.ts
|
|
6008
|
+
var mailchimpEventsZods = {
|
|
6009
|
+
event: z2.nativeEnum(MailchimpEvents),
|
|
6010
|
+
get body() {
|
|
6011
|
+
return z2.object({
|
|
6012
|
+
event: this.event,
|
|
6013
|
+
listId: z2.string()
|
|
6014
|
+
});
|
|
6015
|
+
},
|
|
6016
|
+
get provider() {
|
|
6017
|
+
return z2.object({
|
|
6018
|
+
provider: z2.literal("mailchimp"),
|
|
6019
|
+
event: this.event,
|
|
6020
|
+
listId: z2.string()
|
|
6021
|
+
});
|
|
6022
|
+
},
|
|
6023
|
+
get source() {
|
|
6024
|
+
return z2.object({
|
|
6025
|
+
sourceName: z2.enum(["apps", "workflows"]),
|
|
6026
|
+
sourceKey: z2.string()
|
|
6027
|
+
});
|
|
6028
|
+
},
|
|
6029
|
+
get subscribe() {
|
|
6030
|
+
return this.source.and(this.body).and(
|
|
6031
|
+
z2.object({
|
|
6032
|
+
callback: z2.string()
|
|
6033
|
+
})
|
|
6034
|
+
);
|
|
6035
|
+
},
|
|
6036
|
+
get unsubscribe() {
|
|
6037
|
+
return this.source.and(this.body);
|
|
6038
|
+
}
|
|
6039
|
+
};
|
|
6040
|
+
|
|
6041
|
+
// src/apis/platform/adapter/integrations/text/_contracts/dtos/events.ts
|
|
6042
|
+
var TextLivechatEvents = /* @__PURE__ */ ((TextLivechatEvents2) => {
|
|
6043
|
+
TextLivechatEvents2["IncomingChat"] = "incoming_chat";
|
|
6044
|
+
return TextLivechatEvents2;
|
|
6045
|
+
})(TextLivechatEvents || {});
|
|
6046
|
+
|
|
6047
|
+
// src/apis/platform/adapter/integrations/text/_contracts/requests/events.ts
|
|
6048
|
+
import { z as z3 } from "zod";
|
|
6049
|
+
var textLivechatEventsZods = {
|
|
6050
|
+
event: z3.nativeEnum(TextLivechatEvents),
|
|
6051
|
+
get body() {
|
|
6052
|
+
return z3.object({
|
|
6053
|
+
event: this.event
|
|
6054
|
+
});
|
|
6055
|
+
},
|
|
6056
|
+
get provider() {
|
|
6057
|
+
return z3.object({
|
|
6058
|
+
provider: z3.literal("text-livechat"),
|
|
6059
|
+
event: this.event
|
|
6060
|
+
});
|
|
6061
|
+
},
|
|
6062
|
+
get source() {
|
|
6063
|
+
return z3.object({
|
|
6064
|
+
sourceName: z3.enum(["apps", "workflows"]),
|
|
6065
|
+
sourceKey: z3.string()
|
|
6066
|
+
});
|
|
6067
|
+
},
|
|
6068
|
+
get subscribe() {
|
|
6069
|
+
return this.source.and(this.body).and(
|
|
6070
|
+
z3.object({
|
|
6071
|
+
callback: z3.string()
|
|
6072
|
+
})
|
|
6073
|
+
);
|
|
6074
|
+
},
|
|
6075
|
+
get unsubscribe() {
|
|
6076
|
+
return this.source.and(this.body);
|
|
6077
|
+
}
|
|
6078
|
+
};
|
|
6079
|
+
|
|
6080
|
+
// src/apis/platform/adapter/integrations/_contracts/requests/events.ts
|
|
6081
|
+
var integrationEventsZods = {
|
|
6082
|
+
sourceName: z4.enum(["apps", "workflows"]),
|
|
6083
|
+
providerName: z4.enum(["text-livechat", "mailchimp", "shopify"]),
|
|
6084
|
+
get source() {
|
|
6085
|
+
return z4.object({
|
|
6086
|
+
sourceName: this.sourceName,
|
|
6087
|
+
sourceKey: z4.string()
|
|
6088
|
+
});
|
|
6089
|
+
},
|
|
6090
|
+
provider: z4.discriminatedUnion("provider", [
|
|
6091
|
+
textLivechatEventsZods.provider,
|
|
6092
|
+
mailchimpEventsZods.provider,
|
|
6093
|
+
shopifyEventsZods.provider
|
|
6094
|
+
]),
|
|
6095
|
+
get subscribe() {
|
|
6096
|
+
return this.source.and(this.provider).and(
|
|
6097
|
+
z4.object({
|
|
6098
|
+
callback: z4.string()
|
|
6099
|
+
})
|
|
6100
|
+
);
|
|
6101
|
+
},
|
|
6102
|
+
get unsubscribe() {
|
|
6103
|
+
return this.source.and(this.provider);
|
|
6104
|
+
}
|
|
6105
|
+
};
|
|
6106
|
+
|
|
6107
|
+
// src/apis/platform/adapter/integrations/mailchimp/api.ts
|
|
6108
|
+
var platformAdapterMailchimpApi = {
|
|
6109
|
+
events: {
|
|
6110
|
+
subscribe(payload, authorization) {
|
|
6111
|
+
return __async(this, null, function* () {
|
|
6112
|
+
yield platformAdapterClientInstance.post(
|
|
6113
|
+
`/integrations/mailchimp/events/subscribe`,
|
|
6114
|
+
payload,
|
|
6115
|
+
getMailchimpClientConfig(authorization)
|
|
6116
|
+
);
|
|
6117
|
+
});
|
|
6118
|
+
},
|
|
6119
|
+
unsubscribe(payload, authorization) {
|
|
6120
|
+
return __async(this, null, function* () {
|
|
6121
|
+
yield platformAdapterClientInstance.post(
|
|
6122
|
+
`/integrations/mailchimp/events/unsubscribe`,
|
|
6123
|
+
payload,
|
|
6124
|
+
getMailchimpClientConfig(authorization)
|
|
6125
|
+
);
|
|
6126
|
+
});
|
|
6127
|
+
}
|
|
6128
|
+
}
|
|
6129
|
+
};
|
|
6130
|
+
|
|
5955
6131
|
// src/apis/platform/adapter/integrations/neon/api.ts
|
|
5956
6132
|
var platformAdapterNeonProxyApi = {
|
|
5957
6133
|
user(authorization) {
|
|
@@ -5989,15 +6165,66 @@ var platformAdapterNeonProxyApi = {
|
|
|
5989
6165
|
}
|
|
5990
6166
|
};
|
|
5991
6167
|
|
|
6168
|
+
// src/apis/platform/adapter/integrations/shopify/api.ts
|
|
6169
|
+
var platformAdapterShopifyApi = {
|
|
6170
|
+
events: {
|
|
6171
|
+
subscribe(payload, authorization) {
|
|
6172
|
+
return __async(this, null, function* () {
|
|
6173
|
+
yield platformAdapterClientInstance.post(
|
|
6174
|
+
`/integrations/shopify/events/subscribe`,
|
|
6175
|
+
payload,
|
|
6176
|
+
getShopifyClientConfig(authorization)
|
|
6177
|
+
);
|
|
6178
|
+
});
|
|
6179
|
+
},
|
|
6180
|
+
unsubscribe(payload, authorization) {
|
|
6181
|
+
return __async(this, null, function* () {
|
|
6182
|
+
yield platformAdapterClientInstance.post(
|
|
6183
|
+
`/integrations/shopify/events/unsubscribe`,
|
|
6184
|
+
payload,
|
|
6185
|
+
getShopifyClientConfig(authorization)
|
|
6186
|
+
);
|
|
6187
|
+
});
|
|
6188
|
+
}
|
|
6189
|
+
}
|
|
6190
|
+
};
|
|
6191
|
+
|
|
6192
|
+
// src/apis/platform/adapter/integrations/text/api.ts
|
|
6193
|
+
var platformAdapterTextApi = {
|
|
6194
|
+
events: {
|
|
6195
|
+
subscribe(payload, authorization) {
|
|
6196
|
+
return __async(this, null, function* () {
|
|
6197
|
+
yield platformAdapterClientInstance.post(
|
|
6198
|
+
`/integrations/text/events/subscribe`,
|
|
6199
|
+
payload,
|
|
6200
|
+
getTextClientConfig(authorization)
|
|
6201
|
+
);
|
|
6202
|
+
});
|
|
6203
|
+
},
|
|
6204
|
+
unsubscribe(payload, authorization) {
|
|
6205
|
+
return __async(this, null, function* () {
|
|
6206
|
+
yield platformAdapterClientInstance.post(
|
|
6207
|
+
`/integrations/text/events/unsubscribe`,
|
|
6208
|
+
payload,
|
|
6209
|
+
getTextClientConfig(authorization)
|
|
6210
|
+
);
|
|
6211
|
+
});
|
|
6212
|
+
}
|
|
6213
|
+
}
|
|
6214
|
+
};
|
|
6215
|
+
|
|
5992
6216
|
// src/apis/platform/adapter/integrations/api.ts
|
|
5993
|
-
var
|
|
5994
|
-
neon: platformAdapterNeonProxyApi
|
|
6217
|
+
var platformAdapterIntegrationsApi = {
|
|
6218
|
+
neon: platformAdapterNeonProxyApi,
|
|
6219
|
+
text: platformAdapterTextApi,
|
|
6220
|
+
mailchimp: platformAdapterMailchimpApi,
|
|
6221
|
+
shopify: platformAdapterShopifyApi
|
|
5995
6222
|
};
|
|
5996
6223
|
|
|
5997
6224
|
// src/apis/platform/adapter/api.ts
|
|
5998
6225
|
var platformAdapterApi = {
|
|
5999
6226
|
app: platformAdapterAppApi,
|
|
6000
|
-
|
|
6227
|
+
integrations: platformAdapterIntegrationsApi,
|
|
6001
6228
|
log(payload, authorization) {
|
|
6002
6229
|
return __async(this, null, function* () {
|
|
6003
6230
|
return platformAdapterClientInstance.post(
|
|
@@ -6178,7 +6405,10 @@ export {
|
|
|
6178
6405
|
DpsApiError,
|
|
6179
6406
|
LivechatApiError,
|
|
6180
6407
|
MailchimpApiError,
|
|
6408
|
+
MailchimpEvents,
|
|
6181
6409
|
ShopifyApiError,
|
|
6410
|
+
ShopifyEvents,
|
|
6411
|
+
TextLivechatEvents,
|
|
6182
6412
|
UnauthorizeApiError,
|
|
6183
6413
|
WorkflowDefinitionTaskType,
|
|
6184
6414
|
allAppTemplates,
|
|
@@ -6237,8 +6467,10 @@ export {
|
|
|
6237
6467
|
initShopifyClient,
|
|
6238
6468
|
initTextClient,
|
|
6239
6469
|
initVercelClient,
|
|
6470
|
+
integrationEventsZods,
|
|
6240
6471
|
livechatClientInstance,
|
|
6241
6472
|
mailchimpClientInstance,
|
|
6473
|
+
mailchimpEventsZods,
|
|
6242
6474
|
neonClientInstance,
|
|
6243
6475
|
netlifyClientInstance,
|
|
6244
6476
|
planetScaleClientInstance,
|
|
@@ -6247,7 +6479,9 @@ export {
|
|
|
6247
6479
|
platformBillingClientInstance,
|
|
6248
6480
|
platformDpsClientInstance,
|
|
6249
6481
|
shopifyClientInstance,
|
|
6482
|
+
shopifyEventsZods,
|
|
6250
6483
|
textClientInstance,
|
|
6484
|
+
textLivechatEventsZods,
|
|
6251
6485
|
updateGithubClient,
|
|
6252
6486
|
updateMailchimpClient,
|
|
6253
6487
|
updateNeonClient,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livechat/developer-studio-api",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.54",
|
|
4
4
|
"description": "This project is API for LiveChat Developer Studio.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@shopify/shopify-api": "^11.0.0",
|
|
15
15
|
"axios": "1.6.5",
|
|
16
|
-
"shopify-api-node": "^3.13.1"
|
|
16
|
+
"shopify-api-node": "^3.13.1",
|
|
17
|
+
"zod": "^3.23.8"
|
|
17
18
|
},
|
|
18
19
|
"devDependencies": {
|
|
19
20
|
"@types/node": "^17.0.12",
|