@livechat/developer-studio-api 3.4.24 → 3.5.1
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 +2468 -1581
- package/dist/index.d.ts +2468 -1581
- package/dist/index.js +912 -627
- package/dist/index.mjs +896 -627
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -75,7 +75,9 @@ __export(src_exports, {
|
|
|
75
75
|
BigCommerceApiError: () => BigCommerceApiError,
|
|
76
76
|
BigCommerceEventNames: () => BigCommerceEventNames,
|
|
77
77
|
BigCommerceWebhookScopes: () => BigCommerceWebhookScopes,
|
|
78
|
+
ConsoleApiError: () => ConsoleApiError,
|
|
78
79
|
DpsApiError: () => DpsApiError,
|
|
80
|
+
GitHubWebhookActions: () => GitHubWebhookActions,
|
|
79
81
|
HelpDeskApiError: () => HelpDeskApiError,
|
|
80
82
|
HelpDeskWebhookEventType: () => HelpDeskWebhookEventType,
|
|
81
83
|
HubSpotWebhookEventTypes: () => HubSpotWebhookEventTypes,
|
|
@@ -116,31 +118,43 @@ __export(src_exports, {
|
|
|
116
118
|
bigcommerceEventsZods: () => bigcommerceEventsZods,
|
|
117
119
|
billingClientInstance: () => billingClientInstance,
|
|
118
120
|
buildUrlFromSegments: () => buildUrlFromSegments,
|
|
121
|
+
consoleClientInstance: () => consoleClientInstance,
|
|
119
122
|
dpsClientInstance: () => dpsClientInstance,
|
|
120
123
|
getAdapterClientConfig: () => getAdapterClientConfig,
|
|
121
124
|
getAdapterClientDefaultConfig: () => getAdapterClientDefaultConfig,
|
|
122
125
|
getAppAutoReviewPayload: () => getAppAutoReviewPayload,
|
|
126
|
+
getBigCommerceClientAuthorization: () => getBigCommerceClientAuthorization,
|
|
123
127
|
getBigCommerceClientConfig: () => getBigCommerceClientConfig,
|
|
124
128
|
getBigCommerceClientUrl: () => getBigCommerceClientUrl,
|
|
125
129
|
getBillingClientConfig: () => getBillingClientConfig,
|
|
130
|
+
getConsoleClientConfig: () => getConsoleClientConfig,
|
|
131
|
+
getConsoleClientDefaultConfig: () => getConsoleClientDefaultConfig,
|
|
126
132
|
getDpsClientConfig: () => getDpsClientConfig,
|
|
127
133
|
getEmptyAppAutoReview: () => getEmptyAppAutoReview,
|
|
134
|
+
getGitHubClientAuthorization: () => getGitHubClientAuthorization,
|
|
128
135
|
getGithubClientConfig: () => getGithubClientConfig,
|
|
129
136
|
getHelpDeskClientConfig: () => getHelpDeskClientConfig,
|
|
137
|
+
getHubspotClientAuthorization: () => getHubspotClientAuthorization,
|
|
130
138
|
getHubspotClientConfig: () => getHubspotClientConfig,
|
|
131
139
|
getIntegrationFlowUrl: () => getIntegrationFlowUrl,
|
|
132
140
|
getIntegrationFlowUrlForRedirection: () => getIntegrationFlowUrlForRedirection,
|
|
133
141
|
getLiveChatClientConfig: () => getLiveChatClientConfig,
|
|
142
|
+
getMailchimpClientAuthorization: () => getMailchimpClientAuthorization,
|
|
134
143
|
getMailchimpClientConfig: () => getMailchimpClientConfig,
|
|
135
144
|
getMailchimpClientUrl: () => getMailchimpClientUrl,
|
|
136
145
|
getNeonClientConfig: () => getNeonClientConfig,
|
|
146
|
+
getNetlifyClientAuthorization: () => getNetlifyClientAuthorization,
|
|
137
147
|
getNetlifyClientConfig: () => getNetlifyClientConfig,
|
|
138
148
|
getPlanetScaleClientConfig: () => getPlanetScaleClientConfig,
|
|
139
|
-
getRegion: () =>
|
|
149
|
+
getRegion: () => getRegion3,
|
|
150
|
+
getShopifyClientAuthorization: () => getShopifyClientAuthorization,
|
|
140
151
|
getShopifyClientConfig: () => getShopifyClientConfig,
|
|
141
152
|
getShopifyClientUrl: () => getShopifyClientUrl,
|
|
153
|
+
getSlackClientAuthorization: () => getSlackClientAuthorization,
|
|
142
154
|
getSlackClientConfig: () => getSlackClientConfig,
|
|
155
|
+
getTextClientAuthorization: () => getTextClientAuthorization,
|
|
143
156
|
getTextClientConfig: () => getTextClientConfig,
|
|
157
|
+
getVercelClientAuthorization: () => getVercelClientAuthorization,
|
|
144
158
|
getVercelClientConfig: () => getVercelClientConfig,
|
|
145
159
|
githubClientInstance: () => githubClientInstance,
|
|
146
160
|
helpdeskClientInstance: () => helpdeskClientInstance,
|
|
@@ -150,6 +164,7 @@ __export(src_exports, {
|
|
|
150
164
|
initApi: () => initApi,
|
|
151
165
|
initBigCommerceClient: () => initBigCommerceClient,
|
|
152
166
|
initBillingClient: () => initBillingClient,
|
|
167
|
+
initConsoleClient: () => initConsoleClient,
|
|
153
168
|
initDpsClient: () => initDpsClient,
|
|
154
169
|
initGithubClient: () => initGithubClient,
|
|
155
170
|
initHelpDeskClient: () => initHelpDeskClient,
|
|
@@ -182,6 +197,7 @@ __export(src_exports, {
|
|
|
182
197
|
textLivechatEventsZods: () => textLivechatEventsZods,
|
|
183
198
|
updateAdapterClient: () => updateAdapterClient,
|
|
184
199
|
updateBigCommerceClient: () => updateBigCommerceClient,
|
|
200
|
+
updateConsoleClient: () => updateConsoleClient,
|
|
185
201
|
updateGithubClient: () => updateGithubClient,
|
|
186
202
|
updateHubspotClient: () => updateHubspotClient,
|
|
187
203
|
updateMailchimpClient: () => updateMailchimpClient,
|
|
@@ -313,6 +329,18 @@ var UnauthorizeApiError = class extends Error {
|
|
|
313
329
|
};
|
|
314
330
|
|
|
315
331
|
// src/apis/integrations/bigcommerce/instance.ts
|
|
332
|
+
function getBigCommerceClientAuthorization(req, headerPrefix = "x-adapter-bigcommerce") {
|
|
333
|
+
if (req.headers instanceof Headers) {
|
|
334
|
+
return {
|
|
335
|
+
shop: req.headers.get(`${headerPrefix}-shop`),
|
|
336
|
+
token: req.headers.get(`${headerPrefix}-token`)
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
return {
|
|
340
|
+
shop: req.headers[`${headerPrefix}-shop`],
|
|
341
|
+
token: req.headers[`${headerPrefix}-token`]
|
|
342
|
+
};
|
|
343
|
+
}
|
|
316
344
|
var BigCommerceApiError = class extends ApiErrorBase {
|
|
317
345
|
constructor() {
|
|
318
346
|
super(...arguments);
|
|
@@ -451,6 +479,18 @@ var import_axios5 = __toESM(require("axios"));
|
|
|
451
479
|
|
|
452
480
|
// src/apis/integrations/github/instance.ts
|
|
453
481
|
var import_axios3 = __toESM(require("axios"));
|
|
482
|
+
function getGitHubClientAuthorization(req, headerPrefix = "x-adapter-github") {
|
|
483
|
+
if (req.headers instanceof Headers) {
|
|
484
|
+
return {
|
|
485
|
+
appToken: req.headers.get(`${headerPrefix}-app-token`),
|
|
486
|
+
oauthToken: req.headers.get(`${headerPrefix}-oauth-token`)
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
return {
|
|
490
|
+
appToken: req.headers[`${headerPrefix}-app-token`],
|
|
491
|
+
oauthToken: req.headers[`${headerPrefix}-oauth-token`]
|
|
492
|
+
};
|
|
493
|
+
}
|
|
454
494
|
var githubClientInstance = import_axios3.default.create({
|
|
455
495
|
baseURL: "https://api.github.com",
|
|
456
496
|
headers: {
|
|
@@ -904,6 +944,16 @@ var gitHubApi = {
|
|
|
904
944
|
|
|
905
945
|
// src/apis/integrations/hubspot/instance.ts
|
|
906
946
|
var import_axios6 = __toESM(require("axios"));
|
|
947
|
+
function getHubspotClientAuthorization(req, headerPrefix = "x-adapter-hubspot") {
|
|
948
|
+
if (req.headers instanceof Headers) {
|
|
949
|
+
return {
|
|
950
|
+
token: req.headers.get(`${headerPrefix}-token`)
|
|
951
|
+
};
|
|
952
|
+
}
|
|
953
|
+
return {
|
|
954
|
+
token: req.headers[`${headerPrefix}-token`]
|
|
955
|
+
};
|
|
956
|
+
}
|
|
907
957
|
var HubspotApiError = class extends ApiErrorBase {
|
|
908
958
|
constructor() {
|
|
909
959
|
super(...arguments);
|
|
@@ -1125,6 +1175,18 @@ var import_axios8 = __toESM(require("axios"));
|
|
|
1125
1175
|
|
|
1126
1176
|
// src/apis/integrations/mailchimp/instance.ts
|
|
1127
1177
|
var import_axios7 = __toESM(require("axios"));
|
|
1178
|
+
function getMailchimpClientAuthorization(req, headerPrefix = "x-adapter-mailchimp") {
|
|
1179
|
+
if (req.headers instanceof Headers) {
|
|
1180
|
+
return {
|
|
1181
|
+
server: req.headers.get(`${headerPrefix}-server`),
|
|
1182
|
+
token: req.headers.get(`${headerPrefix}-token`)
|
|
1183
|
+
};
|
|
1184
|
+
}
|
|
1185
|
+
return {
|
|
1186
|
+
server: req.headers[`${headerPrefix}-server`],
|
|
1187
|
+
token: req.headers[`${headerPrefix}-token`]
|
|
1188
|
+
};
|
|
1189
|
+
}
|
|
1128
1190
|
var MailchimpApiError = class extends ApiErrorBase {
|
|
1129
1191
|
constructor() {
|
|
1130
1192
|
super(...arguments);
|
|
@@ -1622,6 +1684,16 @@ var import_axios12 = require("axios");
|
|
|
1622
1684
|
|
|
1623
1685
|
// src/apis/integrations/netlify/instance.ts
|
|
1624
1686
|
var import_axios11 = __toESM(require("axios"));
|
|
1687
|
+
function getNetlifyClientAuthorization(req, headerPrefix = "x-adapter-netlify-token") {
|
|
1688
|
+
if (req.headers instanceof Headers) {
|
|
1689
|
+
return {
|
|
1690
|
+
token: req.headers.get(`${headerPrefix}-token`)
|
|
1691
|
+
};
|
|
1692
|
+
}
|
|
1693
|
+
return {
|
|
1694
|
+
token: req.headers[`${headerPrefix}-token`]
|
|
1695
|
+
};
|
|
1696
|
+
}
|
|
1625
1697
|
var netlifyClientInstance = import_axios11.default.create({
|
|
1626
1698
|
baseURL: "https://api.netlify.com/api/v1",
|
|
1627
1699
|
headers: {
|
|
@@ -2385,6 +2457,18 @@ var import_axios18 = __toESM(require("axios"));
|
|
|
2385
2457
|
|
|
2386
2458
|
// src/apis/integrations/shopify/instance.ts
|
|
2387
2459
|
var import_axios17 = __toESM(require("axios"));
|
|
2460
|
+
function getShopifyClientAuthorization(req, headerPrefix = "x-adapter-shopify") {
|
|
2461
|
+
if (req.headers instanceof Headers) {
|
|
2462
|
+
return {
|
|
2463
|
+
shop: req.headers.get(`${headerPrefix}-shop`),
|
|
2464
|
+
token: req.headers.get(`${headerPrefix}-token`)
|
|
2465
|
+
};
|
|
2466
|
+
}
|
|
2467
|
+
return {
|
|
2468
|
+
shop: req.headers[`${headerPrefix}-shop`],
|
|
2469
|
+
token: req.headers[`${headerPrefix}-token`]
|
|
2470
|
+
};
|
|
2471
|
+
}
|
|
2388
2472
|
var ShopifyApiError = class extends ApiErrorBase {
|
|
2389
2473
|
constructor() {
|
|
2390
2474
|
super(...arguments);
|
|
@@ -2527,6 +2611,16 @@ var SlackApiError = class extends ApiErrorBase {
|
|
|
2527
2611
|
this.name = "slack";
|
|
2528
2612
|
}
|
|
2529
2613
|
};
|
|
2614
|
+
function getSlackClientAuthorization(req, headerPrefix = "x-adapter-slack") {
|
|
2615
|
+
if (req.headers instanceof Headers) {
|
|
2616
|
+
return {
|
|
2617
|
+
token: req.headers.get(`${headerPrefix}-token`)
|
|
2618
|
+
};
|
|
2619
|
+
}
|
|
2620
|
+
return {
|
|
2621
|
+
token: req.headers[`${headerPrefix}-token`]
|
|
2622
|
+
};
|
|
2623
|
+
}
|
|
2530
2624
|
var slackClientInstance = import_axios19.default.create({
|
|
2531
2625
|
baseURL: "https://slack.com/api",
|
|
2532
2626
|
headers: {
|
|
@@ -2631,6 +2725,18 @@ var slackApi = {
|
|
|
2631
2725
|
|
|
2632
2726
|
// src/apis/integrations/text/instance.ts
|
|
2633
2727
|
var import_axios20 = __toESM(require("axios"));
|
|
2728
|
+
function getTextClientAuthorization(req, headerPrefix = "x-adapter-text") {
|
|
2729
|
+
if (req.headers instanceof Headers) {
|
|
2730
|
+
return {
|
|
2731
|
+
token: req.headers.get(`${headerPrefix}-token`),
|
|
2732
|
+
tokenType: "Bearer"
|
|
2733
|
+
};
|
|
2734
|
+
}
|
|
2735
|
+
return {
|
|
2736
|
+
token: req.headers[`${headerPrefix}-token`],
|
|
2737
|
+
tokenType: "Bearer"
|
|
2738
|
+
};
|
|
2739
|
+
}
|
|
2634
2740
|
var TextApiError = class extends ApiErrorBase {
|
|
2635
2741
|
constructor() {
|
|
2636
2742
|
super(...arguments);
|
|
@@ -2832,6 +2938,13 @@ var BigCommerceWebhookScopes = /* @__PURE__ */ ((BigCommerceWebhookScopes2) => {
|
|
|
2832
2938
|
return BigCommerceWebhookScopes2;
|
|
2833
2939
|
})(BigCommerceWebhookScopes || {});
|
|
2834
2940
|
|
|
2941
|
+
// src/apis/integrations/github/webhooks/_contracts/dtos/webhooks.ts
|
|
2942
|
+
var GitHubWebhookActions = /* @__PURE__ */ ((GitHubWebhookActions2) => {
|
|
2943
|
+
GitHubWebhookActions2["Unknown"] = "unknown";
|
|
2944
|
+
GitHubWebhookActions2["Deleted"] = "deleted";
|
|
2945
|
+
return GitHubWebhookActions2;
|
|
2946
|
+
})(GitHubWebhookActions || {});
|
|
2947
|
+
|
|
2835
2948
|
// src/apis/integrations/hubspot/webhooks/_contracts/dtos/webhooks.ts
|
|
2836
2949
|
var HubSpotWebhookEventTypes = /* @__PURE__ */ ((HubSpotWebhookEventTypes2) => {
|
|
2837
2950
|
HubSpotWebhookEventTypes2["ContactCreation"] = "contact.creation";
|
|
@@ -2907,6 +3020,16 @@ var WorkflowExecutionStatus = /* @__PURE__ */ ((WorkflowExecutionStatus2) => {
|
|
|
2907
3020
|
|
|
2908
3021
|
// src/apis/integrations/vercel/instance.ts
|
|
2909
3022
|
var import_axios21 = __toESM(require("axios"));
|
|
3023
|
+
function getVercelClientAuthorization(req, headerPrefix = "x-adapter-vercel") {
|
|
3024
|
+
if (req.headers instanceof Headers) {
|
|
3025
|
+
return {
|
|
3026
|
+
token: req.headers.get(`${headerPrefix}-token`)
|
|
3027
|
+
};
|
|
3028
|
+
}
|
|
3029
|
+
return {
|
|
3030
|
+
token: req.headers[`${headerPrefix}-token`]
|
|
3031
|
+
};
|
|
3032
|
+
}
|
|
2910
3033
|
var vercelClientInstance = import_axios21.default.create({
|
|
2911
3034
|
baseURL: "https://api.vercel.com"
|
|
2912
3035
|
});
|
|
@@ -3298,18 +3421,14 @@ var bigcommerceEventsZods = {
|
|
|
3298
3421
|
get unsubscribe() {
|
|
3299
3422
|
return this.source.and(
|
|
3300
3423
|
import_zod.z.object({
|
|
3301
|
-
event:
|
|
3302
|
-
name: this.eventName
|
|
3303
|
-
})
|
|
3424
|
+
event: this.event
|
|
3304
3425
|
})
|
|
3305
3426
|
);
|
|
3306
3427
|
},
|
|
3307
3428
|
get unsubscribeContent() {
|
|
3308
3429
|
return import_zod.z.object({
|
|
3309
3430
|
provider: this.provider,
|
|
3310
|
-
event:
|
|
3311
|
-
name: this.eventName
|
|
3312
|
-
})
|
|
3431
|
+
event: this.event
|
|
3313
3432
|
});
|
|
3314
3433
|
}
|
|
3315
3434
|
};
|
|
@@ -3362,18 +3481,14 @@ var hubspotEventsZods = {
|
|
|
3362
3481
|
get unsubscribe() {
|
|
3363
3482
|
return this.source.and(
|
|
3364
3483
|
import_zod2.z.object({
|
|
3365
|
-
event:
|
|
3366
|
-
name: this.eventName
|
|
3367
|
-
})
|
|
3484
|
+
event: this.event
|
|
3368
3485
|
})
|
|
3369
3486
|
);
|
|
3370
3487
|
},
|
|
3371
3488
|
get unsubscribeContent() {
|
|
3372
3489
|
return import_zod2.z.object({
|
|
3373
3490
|
provider: this.provider,
|
|
3374
|
-
event:
|
|
3375
|
-
name: this.eventName
|
|
3376
|
-
})
|
|
3491
|
+
event: this.event
|
|
3377
3492
|
});
|
|
3378
3493
|
}
|
|
3379
3494
|
};
|
|
@@ -3438,10 +3553,7 @@ var mailchimpEventsZods = {
|
|
|
3438
3553
|
get unsubscribeContent() {
|
|
3439
3554
|
return import_zod3.z.object({
|
|
3440
3555
|
provider: this.provider,
|
|
3441
|
-
event:
|
|
3442
|
-
listId: import_zod3.z.string(),
|
|
3443
|
-
name: this.eventName
|
|
3444
|
-
})
|
|
3556
|
+
event: this.event
|
|
3445
3557
|
});
|
|
3446
3558
|
}
|
|
3447
3559
|
};
|
|
@@ -3496,9 +3608,7 @@ var shopifyEventsZods = {
|
|
|
3496
3608
|
get unsubscribeContent() {
|
|
3497
3609
|
return import_zod4.z.object({
|
|
3498
3610
|
provider: this.provider,
|
|
3499
|
-
event:
|
|
3500
|
-
name: this.eventName
|
|
3501
|
-
})
|
|
3611
|
+
event: this.event
|
|
3502
3612
|
});
|
|
3503
3613
|
}
|
|
3504
3614
|
};
|
|
@@ -3562,9 +3672,7 @@ var slackEventsZods = {
|
|
|
3562
3672
|
get unsubscribeContent() {
|
|
3563
3673
|
return import_zod5.z.object({
|
|
3564
3674
|
provider: this.provider,
|
|
3565
|
-
event:
|
|
3566
|
-
name: this.eventName
|
|
3567
|
-
})
|
|
3675
|
+
event: this.event
|
|
3568
3676
|
});
|
|
3569
3677
|
}
|
|
3570
3678
|
};
|
|
@@ -3647,18 +3755,14 @@ var textHelpDeskEventsZods = {
|
|
|
3647
3755
|
get unsubscribe() {
|
|
3648
3756
|
return this.source.and(
|
|
3649
3757
|
import_zod6.z.object({
|
|
3650
|
-
event:
|
|
3651
|
-
name: this.eventName
|
|
3652
|
-
})
|
|
3758
|
+
event: this.event
|
|
3653
3759
|
})
|
|
3654
3760
|
);
|
|
3655
3761
|
},
|
|
3656
3762
|
get unsubscribeContent() {
|
|
3657
3763
|
return import_zod6.z.object({
|
|
3658
3764
|
provider: this.provider,
|
|
3659
|
-
event:
|
|
3660
|
-
name: this.eventName
|
|
3661
|
-
})
|
|
3765
|
+
event: this.event
|
|
3662
3766
|
});
|
|
3663
3767
|
}
|
|
3664
3768
|
};
|
|
@@ -3752,18 +3856,14 @@ var textLivechatEventsZods = {
|
|
|
3752
3856
|
get unsubscribe() {
|
|
3753
3857
|
return this.source.and(
|
|
3754
3858
|
import_zod7.z.object({
|
|
3755
|
-
event:
|
|
3756
|
-
name: this.eventName
|
|
3757
|
-
})
|
|
3859
|
+
event: this.event
|
|
3758
3860
|
})
|
|
3759
3861
|
);
|
|
3760
3862
|
},
|
|
3761
3863
|
get unsubscribeContent() {
|
|
3762
3864
|
return import_zod7.z.object({
|
|
3763
3865
|
provider: this.provider,
|
|
3764
|
-
event:
|
|
3765
|
-
name: this.eventName
|
|
3766
|
-
})
|
|
3866
|
+
event: this.event
|
|
3767
3867
|
});
|
|
3768
3868
|
}
|
|
3769
3869
|
};
|
|
@@ -3849,6 +3949,147 @@ function initBillingClient(baseUrl, token) {
|
|
|
3849
3949
|
}
|
|
3850
3950
|
}
|
|
3851
3951
|
|
|
3952
|
+
// src/apis/platform/console/instance.ts
|
|
3953
|
+
var import_axios24 = __toESM(require("axios"));
|
|
3954
|
+
var REGION2 = {
|
|
3955
|
+
FRA: "fra",
|
|
3956
|
+
DAL: "dal",
|
|
3957
|
+
FRA_A: "fra-a",
|
|
3958
|
+
FRA_B: "fra-b"
|
|
3959
|
+
};
|
|
3960
|
+
var supportedRegions2 = Object.values(REGION2);
|
|
3961
|
+
var getRegion2 = (token) => {
|
|
3962
|
+
const region = token.split(":")[0];
|
|
3963
|
+
if (supportedRegions2.includes(region)) {
|
|
3964
|
+
return region;
|
|
3965
|
+
}
|
|
3966
|
+
};
|
|
3967
|
+
var ConsoleApiError = class _ConsoleApiError extends ApiErrorBase {
|
|
3968
|
+
constructor() {
|
|
3969
|
+
super(...arguments);
|
|
3970
|
+
this.name = "console";
|
|
3971
|
+
}
|
|
3972
|
+
static notFound(message) {
|
|
3973
|
+
return new _ConsoleApiError(
|
|
3974
|
+
message != null ? message : "Not found",
|
|
3975
|
+
{
|
|
3976
|
+
errorCode: "not_found",
|
|
3977
|
+
errorMessage: "Not found"
|
|
3978
|
+
},
|
|
3979
|
+
404
|
|
3980
|
+
);
|
|
3981
|
+
}
|
|
3982
|
+
};
|
|
3983
|
+
var consoleClientInstance = import_axios24.default.create({
|
|
3984
|
+
baseURL: "https://platform.labs.text.com/console/api",
|
|
3985
|
+
headers: {
|
|
3986
|
+
"Content-Type": "application/json"
|
|
3987
|
+
}
|
|
3988
|
+
});
|
|
3989
|
+
consoleClientInstance.interceptors.response.use(
|
|
3990
|
+
(response) => response,
|
|
3991
|
+
(error) => {
|
|
3992
|
+
var _a, _b;
|
|
3993
|
+
const apiError = (_a = error.response) == null ? void 0 : _a.data;
|
|
3994
|
+
if ((apiError == null ? void 0 : apiError.kind) === "unauthorized") {
|
|
3995
|
+
return Promise.reject(new UnauthorizeApiError(apiError.source));
|
|
3996
|
+
} else if ((apiError == null ? void 0 : apiError.kind) === "error") {
|
|
3997
|
+
const data = (_b = error.response) == null ? void 0 : _b.data;
|
|
3998
|
+
return Promise.reject(
|
|
3999
|
+
new ConsoleApiError(data.message, data.data, data.code)
|
|
4000
|
+
);
|
|
4001
|
+
}
|
|
4002
|
+
return Promise.reject(error);
|
|
4003
|
+
}
|
|
4004
|
+
);
|
|
4005
|
+
function getConsoleClientConfig(options = {}) {
|
|
4006
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
4007
|
+
const currentHeaders = consoleClientInstance.defaults.headers;
|
|
4008
|
+
const headers = {
|
|
4009
|
+
platform: {
|
|
4010
|
+
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
|
|
4011
|
+
},
|
|
4012
|
+
integrations: {
|
|
4013
|
+
github: {
|
|
4014
|
+
app: (_e = currentHeaders["x-adapter-github-app-token"]) != null ? _e : (_d = options.github) == null ? void 0 : _d.appToken,
|
|
4015
|
+
oauth: (_g = currentHeaders["x-adapter-github-oauth-token"]) != null ? _g : (_f = options.github) == null ? void 0 : _f.oauthToken
|
|
4016
|
+
},
|
|
4017
|
+
netlify: (_i = currentHeaders["x-adapter-netlify-token"]) != null ? _i : (_h = options.netlify) == null ? void 0 : _h.token,
|
|
4018
|
+
vercel: (_k = currentHeaders["x-adapter-vercel-token"]) != null ? _k : (_j = options.vercel) == null ? void 0 : _j.token,
|
|
4019
|
+
planetscale: (_m = currentHeaders["x-adapter-planetscale-token"]) != null ? _m : (_l = options.planetscale) == null ? void 0 : _l.token,
|
|
4020
|
+
neon: (_o = currentHeaders["x-adapter-neon-token"]) != null ? _o : (_n = options.neon) == null ? void 0 : _n.token
|
|
4021
|
+
}
|
|
4022
|
+
};
|
|
4023
|
+
if (currentHeaders.Authorization) {
|
|
4024
|
+
currentHeaders["X-Region"] = (_p = getRegion2(currentHeaders.Authorization)) != null ? _p : void 0;
|
|
4025
|
+
}
|
|
4026
|
+
if (((_q = options.ensureAuthorizationToken) == null ? void 0 : _q.platform) && !headers.platform.token) {
|
|
4027
|
+
throw new UnauthorizeApiError("accounts");
|
|
4028
|
+
}
|
|
4029
|
+
if (((_r = options.ensureAuthorizationToken) == null ? void 0 : _r.github) && (!headers.integrations.github.app || !headers.integrations.github.oauth)) {
|
|
4030
|
+
throw new UnauthorizeApiError("github");
|
|
4031
|
+
}
|
|
4032
|
+
if (((_s = options.ensureAuthorizationToken) == null ? void 0 : _s.vercel) && !headers.integrations.vercel) {
|
|
4033
|
+
throw new UnauthorizeApiError("vercel");
|
|
4034
|
+
}
|
|
4035
|
+
if (((_t = options.ensureAuthorizationToken) == null ? void 0 : _t.netlify) && !headers.integrations.netlify) {
|
|
4036
|
+
throw new UnauthorizeApiError("netlify");
|
|
4037
|
+
}
|
|
4038
|
+
if (((_u = options.ensureAuthorizationToken) == null ? void 0 : _u.planetscale) && !headers.integrations.planetscale) {
|
|
4039
|
+
throw new UnauthorizeApiError("planetscale");
|
|
4040
|
+
}
|
|
4041
|
+
if (((_v = options.ensureAuthorizationToken) == null ? void 0 : _v.neon) && !headers.integrations.neon) {
|
|
4042
|
+
throw new UnauthorizeApiError("neon");
|
|
4043
|
+
}
|
|
4044
|
+
return {
|
|
4045
|
+
headers: __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, headers.platform.token ? { Authorization: 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 } : {})
|
|
4046
|
+
};
|
|
4047
|
+
}
|
|
4048
|
+
var getConsoleClientDefaultConfig = (authorization) => getConsoleClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
4049
|
+
ensureAuthorizationToken: {
|
|
4050
|
+
platform: true
|
|
4051
|
+
}
|
|
4052
|
+
}));
|
|
4053
|
+
function initConsoleClient(baseUrl, tokens) {
|
|
4054
|
+
if (baseUrl) {
|
|
4055
|
+
consoleClientInstance.interceptors.request.use(
|
|
4056
|
+
(config) => {
|
|
4057
|
+
config.baseURL = baseUrl;
|
|
4058
|
+
return config;
|
|
4059
|
+
},
|
|
4060
|
+
(error) => Promise.reject(error)
|
|
4061
|
+
);
|
|
4062
|
+
}
|
|
4063
|
+
if (tokens) {
|
|
4064
|
+
updateConsoleClient(tokens);
|
|
4065
|
+
}
|
|
4066
|
+
}
|
|
4067
|
+
function updateConsoleClient(tokens) {
|
|
4068
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4069
|
+
const headers = consoleClientInstance.defaults.headers;
|
|
4070
|
+
if ((_a = tokens == null ? void 0 : tokens.platform) == null ? void 0 : _a.token) {
|
|
4071
|
+
headers.Authorization = `${(_b = tokens.platform.tokenType) != null ? _b : "Bearer"} ${tokens.platform.token}`;
|
|
4072
|
+
}
|
|
4073
|
+
if ((_c = tokens == null ? void 0 : tokens.github) == null ? void 0 : _c.appToken) {
|
|
4074
|
+
headers["x-adapter-github-app-token"] = tokens.github.appToken;
|
|
4075
|
+
}
|
|
4076
|
+
if ((_d = tokens == null ? void 0 : tokens.github) == null ? void 0 : _d.oauthToken) {
|
|
4077
|
+
headers["x-adapter-github-oauth-token"] = tokens.github.oauthToken;
|
|
4078
|
+
}
|
|
4079
|
+
if ((_e = tokens == null ? void 0 : tokens.netlify) == null ? void 0 : _e.token) {
|
|
4080
|
+
headers["x-adapter-netlify-token"] = tokens.netlify.token;
|
|
4081
|
+
}
|
|
4082
|
+
if ((_f = tokens == null ? void 0 : tokens.vercel) == null ? void 0 : _f.token) {
|
|
4083
|
+
headers["x-adapter-vercel-token"] = tokens.vercel.token;
|
|
4084
|
+
}
|
|
4085
|
+
if ((_g = tokens == null ? void 0 : tokens.planetscale) == null ? void 0 : _g.token) {
|
|
4086
|
+
headers["x-adapter-planetscale-token"] = tokens.planetscale.token;
|
|
4087
|
+
}
|
|
4088
|
+
if ((_h = tokens == null ? void 0 : tokens.neon) == null ? void 0 : _h.token) {
|
|
4089
|
+
headers["x-adapter-neon-token"] = tokens.neon.token;
|
|
4090
|
+
}
|
|
4091
|
+
}
|
|
4092
|
+
|
|
3852
4093
|
// src/apis/platform/dps/applications/application/autoReview/_contracts/dtos/autoReview.ts
|
|
3853
4094
|
var getEmptyAppAutoReview = () => ({
|
|
3854
4095
|
isReviewed: false,
|
|
@@ -3918,14 +4159,14 @@ var getAppAutoReviewPayload = (value) => {
|
|
|
3918
4159
|
};
|
|
3919
4160
|
|
|
3920
4161
|
// src/apis/platform/dps/instance.ts
|
|
3921
|
-
var
|
|
4162
|
+
var import_axios25 = __toESM(require("axios"));
|
|
3922
4163
|
var DpsApiError = class extends ApiErrorBase {
|
|
3923
4164
|
constructor() {
|
|
3924
4165
|
super(...arguments);
|
|
3925
4166
|
this.name = "dps";
|
|
3926
4167
|
}
|
|
3927
4168
|
};
|
|
3928
|
-
var dpsClientInstance =
|
|
4169
|
+
var dpsClientInstance = import_axios25.default.create({
|
|
3929
4170
|
baseURL: "https://dev-platform.labs.livechatinc.com"
|
|
3930
4171
|
});
|
|
3931
4172
|
dpsClientInstance.interceptors.response.use(
|
|
@@ -3974,14 +4215,14 @@ function initDpsClient(baseUrl, token) {
|
|
|
3974
4215
|
}
|
|
3975
4216
|
|
|
3976
4217
|
// src/apis/products/helpdesk/instance.ts
|
|
3977
|
-
var
|
|
4218
|
+
var import_axios26 = __toESM(require("axios"));
|
|
3978
4219
|
var HelpDeskApiError = class extends ApiErrorBase {
|
|
3979
4220
|
constructor() {
|
|
3980
4221
|
super(...arguments);
|
|
3981
4222
|
this.name = "helpdesk";
|
|
3982
4223
|
}
|
|
3983
4224
|
};
|
|
3984
|
-
var helpdeskClientInstance =
|
|
4225
|
+
var helpdeskClientInstance = import_axios26.default.create({
|
|
3985
4226
|
baseURL: "https://api.labs.helpdesk.com"
|
|
3986
4227
|
});
|
|
3987
4228
|
helpdeskClientInstance.interceptors.response.use(
|
|
@@ -4069,17 +4310,17 @@ var LivechatWebhookSystemMessages = /* @__PURE__ */ ((LivechatWebhookSystemMessa
|
|
|
4069
4310
|
})(LivechatWebhookSystemMessages || {});
|
|
4070
4311
|
|
|
4071
4312
|
// src/apis/products/livechat/instance.ts
|
|
4072
|
-
var
|
|
4073
|
-
var
|
|
4313
|
+
var import_axios27 = __toESM(require("axios"));
|
|
4314
|
+
var REGION3 = {
|
|
4074
4315
|
FRA: "fra",
|
|
4075
4316
|
DAL: "dal",
|
|
4076
4317
|
FRA_A: "fra-a",
|
|
4077
4318
|
FRA_B: "fra-b"
|
|
4078
4319
|
};
|
|
4079
|
-
var
|
|
4080
|
-
var
|
|
4320
|
+
var supportedRegions3 = Object.values(REGION3);
|
|
4321
|
+
var getRegion3 = (token) => {
|
|
4081
4322
|
const region = token.split(":")[0];
|
|
4082
|
-
if (
|
|
4323
|
+
if (supportedRegions3.includes(region)) {
|
|
4083
4324
|
return region;
|
|
4084
4325
|
}
|
|
4085
4326
|
};
|
|
@@ -4089,7 +4330,7 @@ var LivechatApiError = class extends ApiErrorBase {
|
|
|
4089
4330
|
this.name = "livechat";
|
|
4090
4331
|
}
|
|
4091
4332
|
};
|
|
4092
|
-
var livechatClientInstance =
|
|
4333
|
+
var livechatClientInstance = import_axios27.default.create({
|
|
4093
4334
|
baseURL: "https://api.labs.livechatinc.com"
|
|
4094
4335
|
});
|
|
4095
4336
|
livechatClientInstance.interceptors.response.use(
|
|
@@ -4124,7 +4365,7 @@ function getLiveChatClientConfig(options = {}) {
|
|
|
4124
4365
|
};
|
|
4125
4366
|
}
|
|
4126
4367
|
function initLiveChatClient(baseUrl, token) {
|
|
4127
|
-
const region = token ?
|
|
4368
|
+
const region = token ? getRegion3(token) : void 0;
|
|
4128
4369
|
const headers = livechatClientInstance.defaults.headers;
|
|
4129
4370
|
if (baseUrl) {
|
|
4130
4371
|
livechatClientInstance.interceptors.request.use(
|
|
@@ -4485,7 +4726,8 @@ var urls = {
|
|
|
4485
4726
|
create: () => getUrl(),
|
|
4486
4727
|
update: (id) => getUrl([id]),
|
|
4487
4728
|
delete: (id) => getUrl([id]),
|
|
4488
|
-
connect: (id) => getUrl([id, "connection"])
|
|
4729
|
+
connect: (id) => getUrl([id, "connection"]),
|
|
4730
|
+
disconnect: (id) => getUrl([id, "disconnect"])
|
|
4489
4731
|
};
|
|
4490
4732
|
var textPlatformWorkflowsCredentialsApi = {
|
|
4491
4733
|
meta: {
|
|
@@ -4597,6 +4839,24 @@ var textPlatformWorkflowsCredentialsApi = {
|
|
|
4597
4839
|
throw error;
|
|
4598
4840
|
});
|
|
4599
4841
|
});
|
|
4842
|
+
},
|
|
4843
|
+
disconnect(id, authorization) {
|
|
4844
|
+
return __async(this, null, function* () {
|
|
4845
|
+
return textClientInstance.put(
|
|
4846
|
+
urls.disconnect(id),
|
|
4847
|
+
{},
|
|
4848
|
+
getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
4849
|
+
ensureAuthorizationToken: true
|
|
4850
|
+
}))
|
|
4851
|
+
).catch((error) => {
|
|
4852
|
+
if (error instanceof TextApiError) {
|
|
4853
|
+
throw error.withCustomMessage(
|
|
4854
|
+
`Couldn't disconnect to credentials. [${error.message}]`
|
|
4855
|
+
);
|
|
4856
|
+
}
|
|
4857
|
+
throw error;
|
|
4858
|
+
});
|
|
4859
|
+
});
|
|
4600
4860
|
}
|
|
4601
4861
|
};
|
|
4602
4862
|
|
|
@@ -4830,7 +5090,7 @@ var textApi = {
|
|
|
4830
5090
|
};
|
|
4831
5091
|
|
|
4832
5092
|
// src/apis/integrations/vercel/api.ts
|
|
4833
|
-
var
|
|
5093
|
+
var import_axios28 = __toESM(require("axios"));
|
|
4834
5094
|
|
|
4835
5095
|
// src/apis/integrations/vercel/deploy/api.ts
|
|
4836
5096
|
var vercelDeployApi = {
|
|
@@ -5090,7 +5350,7 @@ var vercelApi = {
|
|
|
5090
5350
|
client_secret: clientSecret,
|
|
5091
5351
|
redirect_uri: redirectUrl
|
|
5092
5352
|
});
|
|
5093
|
-
const response = yield
|
|
5353
|
+
const response = yield import_axios28.default.post("https://api.vercel.com/v2/oauth/access_token", data, {
|
|
5094
5354
|
headers: {
|
|
5095
5355
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
5096
5356
|
}
|
|
@@ -5431,769 +5691,767 @@ var platformAccountsApi = {
|
|
|
5431
5691
|
token: platformAccountsTokenApi
|
|
5432
5692
|
};
|
|
5433
5693
|
|
|
5434
|
-
// src/apis/platform/adapter/
|
|
5435
|
-
var
|
|
5436
|
-
|
|
5437
|
-
|
|
5438
|
-
return
|
|
5439
|
-
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5447
|
-
|
|
5448
|
-
|
|
5449
|
-
|
|
5450
|
-
|
|
5451
|
-
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
|
|
5455
|
-
return adapterClientInstance.put(
|
|
5456
|
-
`/console/app/${encodeURIComponent(payload.appId)}/blocks/authorization`,
|
|
5457
|
-
payload,
|
|
5458
|
-
getAdapterClientDefaultConfig(authorization)
|
|
5459
|
-
);
|
|
5460
|
-
});
|
|
5461
|
-
},
|
|
5462
|
-
remove(payload, authorization) {
|
|
5463
|
-
return __async(this, null, function* () {
|
|
5464
|
-
return adapterClientInstance.delete(
|
|
5465
|
-
`/console/app/${encodeURIComponent(payload.appId)}/blocks/authorization`,
|
|
5466
|
-
getAdapterClientDefaultConfig(authorization)
|
|
5467
|
-
);
|
|
5468
|
-
});
|
|
5694
|
+
// src/apis/platform/adapter/integrations/bigcommerce/api.ts
|
|
5695
|
+
var platformAdapterBigCommerceApi = {
|
|
5696
|
+
events: {
|
|
5697
|
+
subscribe(payload, authorization) {
|
|
5698
|
+
return __async(this, null, function* () {
|
|
5699
|
+
yield adapterClientInstance.post(
|
|
5700
|
+
"/integrations/bigcommerce/events/subscribe",
|
|
5701
|
+
payload,
|
|
5702
|
+
getBigCommerceClientConfig(authorization)
|
|
5703
|
+
);
|
|
5704
|
+
});
|
|
5705
|
+
},
|
|
5706
|
+
unsubscribe(payload, authorization) {
|
|
5707
|
+
return __async(this, null, function* () {
|
|
5708
|
+
yield adapterClientInstance.post(
|
|
5709
|
+
"/integrations/bigcommerce/events/unsubscribe",
|
|
5710
|
+
payload,
|
|
5711
|
+
getBigCommerceClientConfig(authorization)
|
|
5712
|
+
);
|
|
5713
|
+
});
|
|
5714
|
+
}
|
|
5469
5715
|
}
|
|
5470
5716
|
};
|
|
5471
5717
|
|
|
5472
|
-
// src/apis/platform/adapter/
|
|
5473
|
-
var
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
return
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5718
|
+
// src/apis/platform/adapter/integrations/hubspot/api.ts
|
|
5719
|
+
var platformAdapterHubspotApi = {
|
|
5720
|
+
events: {
|
|
5721
|
+
subscribe(payload, authorization) {
|
|
5722
|
+
return __async(this, null, function* () {
|
|
5723
|
+
yield adapterClientInstance.post(
|
|
5724
|
+
"/integrations/hubspot/events/subscribe",
|
|
5725
|
+
payload,
|
|
5726
|
+
getHubspotClientConfig(authorization)
|
|
5727
|
+
);
|
|
5728
|
+
});
|
|
5729
|
+
},
|
|
5730
|
+
unsubscribe(payload, authorization) {
|
|
5731
|
+
return __async(this, null, function* () {
|
|
5732
|
+
yield adapterClientInstance.post(
|
|
5733
|
+
"/integrations/hubspot/events/unsubscribe",
|
|
5734
|
+
payload,
|
|
5735
|
+
getHubspotClientConfig(authorization)
|
|
5736
|
+
);
|
|
5737
|
+
});
|
|
5738
|
+
}
|
|
5739
|
+
}
|
|
5740
|
+
};
|
|
5741
|
+
|
|
5742
|
+
// src/apis/platform/adapter/integrations/mailchimp/api.ts
|
|
5743
|
+
var platformAdapterMailchimpApi = {
|
|
5744
|
+
events: {
|
|
5745
|
+
subscribe(payload, authorization) {
|
|
5746
|
+
return __async(this, null, function* () {
|
|
5747
|
+
yield adapterClientInstance.post(
|
|
5748
|
+
"/integrations/mailchimp/events/subscribe",
|
|
5749
|
+
payload,
|
|
5750
|
+
getMailchimpClientConfig(authorization)
|
|
5751
|
+
);
|
|
5752
|
+
});
|
|
5753
|
+
},
|
|
5754
|
+
unsubscribe(payload, authorization) {
|
|
5755
|
+
return __async(this, null, function* () {
|
|
5756
|
+
yield adapterClientInstance.post(
|
|
5757
|
+
"/integrations/mailchimp/events/unsubscribe",
|
|
5758
|
+
payload,
|
|
5759
|
+
getMailchimpClientConfig(authorization)
|
|
5760
|
+
);
|
|
5761
|
+
});
|
|
5762
|
+
}
|
|
5763
|
+
}
|
|
5764
|
+
};
|
|
5765
|
+
|
|
5766
|
+
// src/apis/platform/adapter/integrations/shopify/api.ts
|
|
5767
|
+
var platformAdapterShopifyApi = {
|
|
5768
|
+
events: {
|
|
5769
|
+
subscribe(payload, authorization) {
|
|
5770
|
+
return __async(this, null, function* () {
|
|
5771
|
+
yield adapterClientInstance.post(
|
|
5772
|
+
"/integrations/shopify/events/subscribe",
|
|
5773
|
+
payload,
|
|
5774
|
+
getShopifyClientConfig(authorization)
|
|
5775
|
+
);
|
|
5776
|
+
});
|
|
5777
|
+
},
|
|
5778
|
+
unsubscribe(payload, authorization) {
|
|
5779
|
+
return __async(this, null, function* () {
|
|
5780
|
+
yield adapterClientInstance.post(
|
|
5781
|
+
"/integrations/shopify/events/unsubscribe",
|
|
5782
|
+
payload,
|
|
5783
|
+
getShopifyClientConfig(authorization)
|
|
5784
|
+
);
|
|
5785
|
+
});
|
|
5786
|
+
}
|
|
5787
|
+
}
|
|
5788
|
+
};
|
|
5789
|
+
|
|
5790
|
+
// src/apis/platform/adapter/integrations/slack/api.ts
|
|
5791
|
+
var platformAdapterSlackApi = {
|
|
5792
|
+
events: {
|
|
5793
|
+
subscribe(payload, authorization) {
|
|
5794
|
+
return __async(this, null, function* () {
|
|
5795
|
+
yield adapterClientInstance.post(
|
|
5796
|
+
"/integrations/slack/events/subscribe",
|
|
5797
|
+
payload,
|
|
5798
|
+
getSlackClientConfig(authorization)
|
|
5799
|
+
);
|
|
5800
|
+
});
|
|
5801
|
+
},
|
|
5802
|
+
unsubscribe(payload, authorization) {
|
|
5803
|
+
return __async(this, null, function* () {
|
|
5804
|
+
yield adapterClientInstance.post(
|
|
5805
|
+
"/integrations/slack/events/unsubscribe",
|
|
5806
|
+
payload,
|
|
5807
|
+
getSlackClientConfig(authorization)
|
|
5808
|
+
);
|
|
5809
|
+
});
|
|
5810
|
+
}
|
|
5811
|
+
}
|
|
5812
|
+
};
|
|
5813
|
+
|
|
5814
|
+
// src/apis/platform/adapter/integrations/text/api.ts
|
|
5815
|
+
var platformAdapterTextApi = {
|
|
5816
|
+
events: {
|
|
5817
|
+
subscribe(payload, authorization) {
|
|
5818
|
+
return __async(this, null, function* () {
|
|
5819
|
+
yield adapterClientInstance.post(
|
|
5820
|
+
"/integrations/text/events/subscribe",
|
|
5821
|
+
payload,
|
|
5822
|
+
getTextClientConfig(authorization)
|
|
5823
|
+
);
|
|
5824
|
+
});
|
|
5825
|
+
},
|
|
5826
|
+
unsubscribe(payload, authorization) {
|
|
5827
|
+
return __async(this, null, function* () {
|
|
5828
|
+
yield adapterClientInstance.post(
|
|
5829
|
+
"/integrations/text/events/unsubscribe",
|
|
5830
|
+
payload,
|
|
5831
|
+
getTextClientConfig(authorization)
|
|
5832
|
+
);
|
|
5833
|
+
});
|
|
5834
|
+
}
|
|
5835
|
+
}
|
|
5836
|
+
};
|
|
5837
|
+
|
|
5838
|
+
// src/apis/platform/adapter/integrations/api.ts
|
|
5839
|
+
var platformAdapterIntegrationsApi = {
|
|
5840
|
+
mailchimp: platformAdapterMailchimpApi,
|
|
5841
|
+
shopify: platformAdapterShopifyApi,
|
|
5842
|
+
hubspot: platformAdapterHubspotApi,
|
|
5843
|
+
slack: platformAdapterSlackApi,
|
|
5844
|
+
bigcommerce: platformAdapterBigCommerceApi,
|
|
5845
|
+
text: platformAdapterTextApi
|
|
5846
|
+
};
|
|
5847
|
+
|
|
5848
|
+
// src/apis/platform/adapter/api.ts
|
|
5849
|
+
var platformAdapterApi = {
|
|
5850
|
+
integrations: platformAdapterIntegrationsApi
|
|
5851
|
+
};
|
|
5852
|
+
|
|
5853
|
+
// src/apis/platform/billing/account/api.ts
|
|
5854
|
+
var platformBillingAccountApi = {
|
|
5855
|
+
getAccount(authorization) {
|
|
5500
5856
|
return __async(this, null, function* () {
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5857
|
+
try {
|
|
5858
|
+
return yield billingClientInstance.get(
|
|
5859
|
+
"/v3/account",
|
|
5860
|
+
getBillingClientConfig(authorization)
|
|
5861
|
+
);
|
|
5862
|
+
} catch (error) {
|
|
5863
|
+
if (error instanceof Error) {
|
|
5864
|
+
throw new Error(`Account couldn't be fetched. [${error.message}]`);
|
|
5865
|
+
} else {
|
|
5866
|
+
throw error;
|
|
5867
|
+
}
|
|
5868
|
+
}
|
|
5509
5869
|
});
|
|
5510
5870
|
},
|
|
5511
|
-
|
|
5871
|
+
getAccountInfo(product, authorization) {
|
|
5512
5872
|
return __async(this, null, function* () {
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5873
|
+
try {
|
|
5874
|
+
return yield billingClientInstance.get(
|
|
5875
|
+
`/v3/account/${encodeURIComponent(product)}/billing_info`,
|
|
5876
|
+
getBillingClientConfig(authorization)
|
|
5877
|
+
);
|
|
5878
|
+
} catch (error) {
|
|
5879
|
+
if (error instanceof Error) {
|
|
5880
|
+
throw new Error(
|
|
5881
|
+
`Account billing info couldn't be fetched. [${error.message}]`
|
|
5882
|
+
);
|
|
5883
|
+
} else {
|
|
5884
|
+
throw error;
|
|
5885
|
+
}
|
|
5886
|
+
}
|
|
5518
5887
|
});
|
|
5519
5888
|
}
|
|
5520
5889
|
};
|
|
5521
5890
|
|
|
5522
|
-
// src/apis/platform/
|
|
5523
|
-
var
|
|
5524
|
-
|
|
5525
|
-
return __async(this, null, function* () {
|
|
5526
|
-
return adapterClientInstance.get(
|
|
5527
|
-
`/console/app/${encodeURIComponent(appId)}/blocks/monetization`,
|
|
5528
|
-
getAdapterClientDefaultConfig(authorization)
|
|
5529
|
-
);
|
|
5530
|
-
});
|
|
5531
|
-
},
|
|
5532
|
-
upsert(payload, authorization) {
|
|
5891
|
+
// src/apis/platform/billing/invoices/api.ts
|
|
5892
|
+
var platformBillingInvoicesApi = {
|
|
5893
|
+
getInvoices(product, authorization) {
|
|
5533
5894
|
return __async(this, null, function* () {
|
|
5534
|
-
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
|
|
5538
|
-
|
|
5895
|
+
try {
|
|
5896
|
+
return yield billingClientInstance.get(
|
|
5897
|
+
`/v2/invoices/${encodeURIComponent(product)}`,
|
|
5898
|
+
getBillingClientConfig(authorization)
|
|
5899
|
+
);
|
|
5900
|
+
} catch (error) {
|
|
5901
|
+
if (error instanceof Error) {
|
|
5902
|
+
throw new Error(`Invoices couldn't be fetched. [${error.message}]`);
|
|
5903
|
+
} else {
|
|
5904
|
+
throw error;
|
|
5905
|
+
}
|
|
5906
|
+
}
|
|
5539
5907
|
});
|
|
5540
5908
|
},
|
|
5541
|
-
|
|
5909
|
+
downloadInvoices(number, authorization) {
|
|
5542
5910
|
return __async(this, null, function* () {
|
|
5543
|
-
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5911
|
+
try {
|
|
5912
|
+
const response = yield billingClientInstance.request(__spreadValues({
|
|
5913
|
+
url: `https://api.labs.livechatinc.com/v2/invoices/${encodeURIComponent(
|
|
5914
|
+
number
|
|
5915
|
+
)}`,
|
|
5916
|
+
data: new URLSearchParams({
|
|
5917
|
+
_method: "GET"
|
|
5918
|
+
//gave the values directly for testing
|
|
5919
|
+
}),
|
|
5920
|
+
responseType: "blob"
|
|
5921
|
+
}, getBillingClientConfig(authorization)));
|
|
5922
|
+
const href = URL.createObjectURL(response.data);
|
|
5923
|
+
const link = document.createElement("a");
|
|
5924
|
+
link.href = href;
|
|
5925
|
+
link.setAttribute("download", `invoice-${number}.pdf`);
|
|
5926
|
+
document.body.appendChild(link);
|
|
5927
|
+
link.click();
|
|
5928
|
+
document.body.removeChild(link);
|
|
5929
|
+
URL.revokeObjectURL(href);
|
|
5930
|
+
} catch (error) {
|
|
5931
|
+
if (error instanceof Error) {
|
|
5932
|
+
throw new Error(`Invoice couldn't be downloaded. [${error.message}]`);
|
|
5933
|
+
} else {
|
|
5934
|
+
throw error;
|
|
5935
|
+
}
|
|
5936
|
+
}
|
|
5547
5937
|
});
|
|
5548
5938
|
}
|
|
5549
5939
|
};
|
|
5550
5940
|
|
|
5551
|
-
// src/apis/platform/
|
|
5552
|
-
var
|
|
5553
|
-
|
|
5941
|
+
// src/apis/platform/billing/api.ts
|
|
5942
|
+
var platformBillingApi = {
|
|
5943
|
+
account: platformBillingAccountApi,
|
|
5944
|
+
invoices: platformBillingInvoicesApi
|
|
5945
|
+
};
|
|
5946
|
+
|
|
5947
|
+
// src/apis/platform/console/app/blocks/authorization/api.ts
|
|
5948
|
+
var platformConsoleAppAuthorizationApi = {
|
|
5949
|
+
get(appId, authorization) {
|
|
5554
5950
|
return __async(this, null, function* () {
|
|
5555
|
-
return
|
|
5556
|
-
`/
|
|
5557
|
-
|
|
5558
|
-
)}/blocks/properties/${encodeURIComponent(propertyId)}`,
|
|
5559
|
-
getAdapterClientDefaultConfig(authorization)
|
|
5951
|
+
return consoleClientInstance.get(
|
|
5952
|
+
`/app/${encodeURIComponent(appId)}/blocks/authorization`,
|
|
5953
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5560
5954
|
);
|
|
5561
5955
|
});
|
|
5562
5956
|
},
|
|
5563
|
-
|
|
5957
|
+
add(payload, authorization) {
|
|
5564
5958
|
return __async(this, null, function* () {
|
|
5565
|
-
return
|
|
5566
|
-
`/
|
|
5567
|
-
payload.appId
|
|
5568
|
-
)}/blocks/properties/${encodeURIComponent(payload.propertyId)}`,
|
|
5959
|
+
return consoleClientInstance.post(
|
|
5960
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/authorization`,
|
|
5569
5961
|
payload,
|
|
5570
|
-
|
|
5962
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5571
5963
|
);
|
|
5572
5964
|
});
|
|
5573
5965
|
},
|
|
5574
|
-
|
|
5575
|
-
return __async(this, null, function* () {
|
|
5576
|
-
return adapterClientInstance.delete(
|
|
5577
|
-
`/console/app/${encodeURIComponent(payload.appId)}/blocks/properties/${payload.propertyId}`,
|
|
5578
|
-
getAdapterClientDefaultConfig(authorization)
|
|
5579
|
-
);
|
|
5580
|
-
});
|
|
5581
|
-
}
|
|
5582
|
-
};
|
|
5583
|
-
|
|
5584
|
-
// src/apis/platform/adapter/app/blocks/properties/api.ts
|
|
5585
|
-
var platformAdapterAppPropertiesApi = {
|
|
5586
|
-
property: platformAdapterAppPropertyApi,
|
|
5587
|
-
get(appId, authorization) {
|
|
5588
|
-
return __async(this, null, function* () {
|
|
5589
|
-
return adapterClientInstance.get(
|
|
5590
|
-
`/console/app/${encodeURIComponent(appId)}/blocks/properties`,
|
|
5591
|
-
getAdapterClientDefaultConfig(authorization)
|
|
5592
|
-
);
|
|
5593
|
-
});
|
|
5594
|
-
},
|
|
5595
|
-
upsert(payload, authorization) {
|
|
5966
|
+
update(payload, authorization) {
|
|
5596
5967
|
return __async(this, null, function* () {
|
|
5597
|
-
return
|
|
5598
|
-
`/
|
|
5968
|
+
return consoleClientInstance.put(
|
|
5969
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/authorization`,
|
|
5599
5970
|
payload,
|
|
5600
|
-
|
|
5971
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5601
5972
|
);
|
|
5602
5973
|
});
|
|
5603
5974
|
},
|
|
5604
5975
|
remove(payload, authorization) {
|
|
5605
5976
|
return __async(this, null, function* () {
|
|
5606
|
-
return
|
|
5607
|
-
`/
|
|
5608
|
-
|
|
5977
|
+
return consoleClientInstance.delete(
|
|
5978
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/authorization`,
|
|
5979
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5609
5980
|
);
|
|
5610
5981
|
});
|
|
5611
5982
|
}
|
|
5612
5983
|
};
|
|
5613
5984
|
|
|
5614
|
-
// src/apis/platform/
|
|
5615
|
-
var
|
|
5985
|
+
// src/apis/platform/console/app/blocks/deployment/api.ts
|
|
5986
|
+
var platformConsoleAppDeploymentApi = {
|
|
5616
5987
|
getAggregate(appId, authorization) {
|
|
5617
5988
|
return __async(this, null, function* () {
|
|
5618
|
-
return
|
|
5619
|
-
`/
|
|
5620
|
-
|
|
5989
|
+
return consoleClientInstance.get(
|
|
5990
|
+
`/app/${encodeURIComponent(appId)}/blocks/deployment/aggregate`,
|
|
5991
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5621
5992
|
);
|
|
5622
5993
|
});
|
|
5623
5994
|
},
|
|
5624
5995
|
get(appId, authorization) {
|
|
5625
5996
|
return __async(this, null, function* () {
|
|
5626
|
-
return
|
|
5627
|
-
`/
|
|
5628
|
-
|
|
5997
|
+
return consoleClientInstance.get(
|
|
5998
|
+
`/app/${encodeURIComponent(appId)}/blocks/deployment`,
|
|
5999
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5629
6000
|
);
|
|
5630
6001
|
});
|
|
5631
6002
|
},
|
|
5632
6003
|
link(payload, authorization) {
|
|
5633
6004
|
return __async(this, null, function* () {
|
|
5634
|
-
return
|
|
5635
|
-
`/
|
|
6005
|
+
return consoleClientInstance.put(
|
|
6006
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/deployment`,
|
|
5636
6007
|
payload,
|
|
5637
|
-
|
|
6008
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5638
6009
|
);
|
|
5639
6010
|
});
|
|
5640
6011
|
},
|
|
5641
6012
|
unlink(payload, authorization) {
|
|
5642
6013
|
return __async(this, null, function* () {
|
|
5643
|
-
return
|
|
5644
|
-
`/
|
|
6014
|
+
return consoleClientInstance.delete(
|
|
6015
|
+
`/app/${encodeURIComponent(
|
|
5645
6016
|
payload.appId
|
|
5646
|
-
)}/blocks/
|
|
6017
|
+
)}/blocks/deployment?${new URLSearchParams(
|
|
5647
6018
|
payload
|
|
5648
6019
|
).toString()}`,
|
|
5649
|
-
|
|
6020
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5650
6021
|
);
|
|
5651
6022
|
});
|
|
5652
6023
|
},
|
|
5653
6024
|
upsert(payload, authorization) {
|
|
5654
6025
|
return __async(this, null, function* () {
|
|
5655
|
-
return
|
|
5656
|
-
`/
|
|
5657
|
-
payload,
|
|
5658
|
-
getAdapterClientDefaultConfig(authorization)
|
|
5659
|
-
);
|
|
5660
|
-
});
|
|
5661
|
-
},
|
|
5662
|
-
seed(payload, authorization) {
|
|
5663
|
-
return __async(this, null, function* () {
|
|
5664
|
-
return adapterClientInstance.post(
|
|
5665
|
-
`/console/app/${encodeURIComponent(
|
|
5666
|
-
payload.appId
|
|
5667
|
-
)}/blocks/repository/seed`,
|
|
6026
|
+
return consoleClientInstance.patch(
|
|
6027
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/deployment`,
|
|
5668
6028
|
payload,
|
|
5669
|
-
|
|
6029
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5670
6030
|
);
|
|
5671
6031
|
});
|
|
5672
6032
|
}
|
|
5673
6033
|
};
|
|
5674
6034
|
|
|
5675
|
-
// src/apis/platform/
|
|
5676
|
-
var
|
|
5677
|
-
getAggregate(appId, authorization) {
|
|
5678
|
-
return __async(this, null, function* () {
|
|
5679
|
-
return adapterClientInstance.get(
|
|
5680
|
-
`/console/app/${encodeURIComponent(appId)}/blocks/storage/aggregate`,
|
|
5681
|
-
getAdapterClientDefaultConfig(authorization)
|
|
5682
|
-
);
|
|
5683
|
-
});
|
|
5684
|
-
},
|
|
6035
|
+
// src/apis/platform/console/app/blocks/monetization/api.ts
|
|
6036
|
+
var platformConsoleAppMonetizationApi = {
|
|
5685
6037
|
get(appId, authorization) {
|
|
5686
6038
|
return __async(this, null, function* () {
|
|
5687
|
-
return
|
|
5688
|
-
`/
|
|
5689
|
-
|
|
6039
|
+
return consoleClientInstance.get(
|
|
6040
|
+
`/app/${encodeURIComponent(appId)}/blocks/monetization`,
|
|
6041
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5690
6042
|
);
|
|
5691
6043
|
});
|
|
5692
6044
|
},
|
|
5693
|
-
|
|
6045
|
+
upsert(payload, authorization) {
|
|
5694
6046
|
return __async(this, null, function* () {
|
|
5695
|
-
return
|
|
5696
|
-
`/
|
|
6047
|
+
return consoleClientInstance.post(
|
|
6048
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/monetization`,
|
|
5697
6049
|
payload,
|
|
5698
|
-
|
|
5699
|
-
);
|
|
5700
|
-
});
|
|
5701
|
-
},
|
|
5702
|
-
unlink(payload, authorization) {
|
|
5703
|
-
return __async(this, null, function* () {
|
|
5704
|
-
return adapterClientInstance.delete(
|
|
5705
|
-
`/console/app/${encodeURIComponent(
|
|
5706
|
-
payload.appId
|
|
5707
|
-
)}/blocks/storage?${new URLSearchParams(
|
|
5708
|
-
payload
|
|
5709
|
-
).toString()}`,
|
|
5710
|
-
getAdapterClientDefaultConfig(authorization)
|
|
6050
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5711
6051
|
);
|
|
5712
6052
|
});
|
|
5713
6053
|
},
|
|
5714
|
-
|
|
6054
|
+
remove(payload, authorization) {
|
|
5715
6055
|
return __async(this, null, function* () {
|
|
5716
|
-
return
|
|
5717
|
-
`/
|
|
5718
|
-
|
|
5719
|
-
getAdapterClientDefaultConfig(authorization)
|
|
6056
|
+
return consoleClientInstance.delete(
|
|
6057
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/monetization`,
|
|
6058
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5720
6059
|
);
|
|
5721
6060
|
});
|
|
5722
6061
|
}
|
|
5723
6062
|
};
|
|
5724
6063
|
|
|
5725
|
-
// src/apis/platform/
|
|
5726
|
-
var
|
|
5727
|
-
get(appId,
|
|
6064
|
+
// src/apis/platform/console/app/blocks/properties/property/api.ts
|
|
6065
|
+
var platformConsoleAppPropertyApi = {
|
|
6066
|
+
get(appId, propertyId, authorization) {
|
|
5728
6067
|
return __async(this, null, function* () {
|
|
5729
|
-
return
|
|
5730
|
-
`/
|
|
6068
|
+
return consoleClientInstance.get(
|
|
6069
|
+
`/app/${encodeURIComponent(
|
|
5731
6070
|
appId
|
|
5732
|
-
)}/blocks/
|
|
5733
|
-
|
|
6071
|
+
)}/blocks/properties/${encodeURIComponent(propertyId)}`,
|
|
6072
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5734
6073
|
);
|
|
5735
6074
|
});
|
|
5736
6075
|
},
|
|
5737
6076
|
upsert(payload, authorization) {
|
|
5738
6077
|
return __async(this, null, function* () {
|
|
5739
|
-
return
|
|
5740
|
-
`/
|
|
6078
|
+
return consoleClientInstance.post(
|
|
6079
|
+
`/app/${encodeURIComponent(
|
|
5741
6080
|
payload.appId
|
|
5742
|
-
)}/blocks/
|
|
6081
|
+
)}/blocks/properties/${encodeURIComponent(payload.propertyId)}`,
|
|
5743
6082
|
payload,
|
|
5744
|
-
|
|
6083
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5745
6084
|
);
|
|
5746
6085
|
});
|
|
5747
6086
|
},
|
|
5748
6087
|
remove(payload, authorization) {
|
|
5749
6088
|
return __async(this, null, function* () {
|
|
5750
|
-
return
|
|
5751
|
-
`/
|
|
5752
|
-
|
|
5753
|
-
)}/blocks/widgets/${encodeURIComponent(payload.widgetId)}`,
|
|
5754
|
-
getAdapterClientDefaultConfig(authorization)
|
|
6089
|
+
return consoleClientInstance.delete(
|
|
6090
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/properties/${payload.propertyId}`,
|
|
6091
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5755
6092
|
);
|
|
5756
6093
|
});
|
|
5757
6094
|
}
|
|
5758
6095
|
};
|
|
5759
6096
|
|
|
5760
|
-
// src/apis/platform/
|
|
5761
|
-
var
|
|
5762
|
-
|
|
6097
|
+
// src/apis/platform/console/app/blocks/properties/api.ts
|
|
6098
|
+
var platformConsoleAppPropertiesApi = {
|
|
6099
|
+
property: platformConsoleAppPropertyApi,
|
|
5763
6100
|
get(appId, authorization) {
|
|
5764
6101
|
return __async(this, null, function* () {
|
|
5765
|
-
return
|
|
5766
|
-
`/
|
|
5767
|
-
|
|
6102
|
+
return consoleClientInstance.get(
|
|
6103
|
+
`/app/${encodeURIComponent(appId)}/blocks/properties`,
|
|
6104
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5768
6105
|
);
|
|
5769
6106
|
});
|
|
5770
6107
|
},
|
|
5771
6108
|
upsert(payload, authorization) {
|
|
5772
6109
|
return __async(this, null, function* () {
|
|
5773
|
-
return
|
|
5774
|
-
`/
|
|
6110
|
+
return consoleClientInstance.post(
|
|
6111
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/properties`,
|
|
5775
6112
|
payload,
|
|
5776
|
-
|
|
6113
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5777
6114
|
);
|
|
5778
6115
|
});
|
|
5779
6116
|
},
|
|
5780
6117
|
remove(payload, authorization) {
|
|
5781
6118
|
return __async(this, null, function* () {
|
|
5782
|
-
return
|
|
5783
|
-
`/
|
|
5784
|
-
|
|
6119
|
+
return consoleClientInstance.delete(
|
|
6120
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/properties`,
|
|
6121
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5785
6122
|
);
|
|
5786
6123
|
});
|
|
5787
6124
|
}
|
|
5788
6125
|
};
|
|
5789
6126
|
|
|
5790
|
-
// src/apis/platform/
|
|
5791
|
-
var
|
|
5792
|
-
authorization
|
|
5793
|
-
monetization: platformAdapterAppMonetizationApi,
|
|
5794
|
-
repository: platformAdapterAppRepositoryApi,
|
|
5795
|
-
deployment: platformAdapterAppDeploymentApi,
|
|
5796
|
-
storage: platformAdapterAppStorageApi,
|
|
5797
|
-
properties: platformAdapterAppPropertiesApi,
|
|
5798
|
-
widgets: platformAdapterAppWidgetsApi
|
|
5799
|
-
};
|
|
5800
|
-
|
|
5801
|
-
// src/apis/platform/adapter/app/templates/api.ts
|
|
5802
|
-
var platformAdapterAppTemplatesApi = {
|
|
5803
|
-
getTemplates(authorization) {
|
|
5804
|
-
return __async(this, null, function* () {
|
|
5805
|
-
return adapterClientInstance.get(
|
|
5806
|
-
"/console/app/templates",
|
|
5807
|
-
getAdapterClientDefaultConfig(authorization)
|
|
5808
|
-
);
|
|
5809
|
-
});
|
|
5810
|
-
},
|
|
5811
|
-
getRepositoryTemplates(authorization) {
|
|
5812
|
-
return __async(this, null, function* () {
|
|
5813
|
-
return adapterClientInstance.get(
|
|
5814
|
-
"/console/app/templates/repository",
|
|
5815
|
-
getAdapterClientDefaultConfig(authorization)
|
|
5816
|
-
);
|
|
5817
|
-
});
|
|
5818
|
-
}
|
|
5819
|
-
};
|
|
5820
|
-
|
|
5821
|
-
// src/apis/platform/adapter/app/variables/api.ts
|
|
5822
|
-
var platformAdapterAppVariablesApi = {
|
|
5823
|
-
getVariables(appId, decrypted, authorization) {
|
|
6127
|
+
// src/apis/platform/console/app/blocks/repository/api.ts
|
|
6128
|
+
var platformConsoleAppRepositoryApi = {
|
|
6129
|
+
getAggregate(appId, authorization) {
|
|
5824
6130
|
return __async(this, null, function* () {
|
|
5825
|
-
|
|
5826
|
-
`/
|
|
5827
|
-
|
|
5828
|
-
params: {
|
|
5829
|
-
decrypted
|
|
5830
|
-
}
|
|
5831
|
-
}, getAdapterClientDefaultConfig(authorization))
|
|
6131
|
+
return consoleClientInstance.get(
|
|
6132
|
+
`/app/${encodeURIComponent(appId)}/blocks/repository/aggregate`,
|
|
6133
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5832
6134
|
);
|
|
5833
|
-
return response.data;
|
|
5834
6135
|
});
|
|
5835
6136
|
},
|
|
5836
|
-
|
|
6137
|
+
get(appId, authorization) {
|
|
5837
6138
|
return __async(this, null, function* () {
|
|
5838
|
-
|
|
5839
|
-
`/
|
|
5840
|
-
|
|
5841
|
-
)}`,
|
|
5842
|
-
getAdapterClientDefaultConfig(authorization)
|
|
6139
|
+
return consoleClientInstance.get(
|
|
6140
|
+
`/app/${encodeURIComponent(appId)}/blocks/repository`,
|
|
6141
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5843
6142
|
);
|
|
5844
|
-
return response.data;
|
|
5845
6143
|
});
|
|
5846
6144
|
},
|
|
5847
|
-
|
|
6145
|
+
link(payload, authorization) {
|
|
5848
6146
|
return __async(this, null, function* () {
|
|
5849
|
-
|
|
5850
|
-
`/
|
|
5851
|
-
key
|
|
5852
|
-
)}/sync`,
|
|
6147
|
+
return consoleClientInstance.put(
|
|
6148
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/repository`,
|
|
5853
6149
|
payload,
|
|
5854
|
-
|
|
6150
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5855
6151
|
);
|
|
5856
6152
|
});
|
|
5857
6153
|
},
|
|
5858
|
-
|
|
6154
|
+
unlink(payload, authorization) {
|
|
5859
6155
|
return __async(this, null, function* () {
|
|
5860
|
-
|
|
5861
|
-
`/
|
|
5862
|
-
|
|
5863
|
-
)}
|
|
5864
|
-
|
|
5865
|
-
|
|
6156
|
+
return consoleClientInstance.delete(
|
|
6157
|
+
`/app/${encodeURIComponent(
|
|
6158
|
+
payload.appId
|
|
6159
|
+
)}/blocks/repository?${new URLSearchParams(
|
|
6160
|
+
payload
|
|
6161
|
+
).toString()}`,
|
|
6162
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5866
6163
|
);
|
|
5867
6164
|
});
|
|
5868
6165
|
},
|
|
5869
|
-
|
|
6166
|
+
upsert(payload, authorization) {
|
|
5870
6167
|
return __async(this, null, function* () {
|
|
5871
|
-
|
|
5872
|
-
`/
|
|
5873
|
-
|
|
5874
|
-
)
|
|
5875
|
-
data,
|
|
5876
|
-
getAdapterClientDefaultConfig(authorization)
|
|
6168
|
+
return consoleClientInstance.patch(
|
|
6169
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/repository`,
|
|
6170
|
+
payload,
|
|
6171
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5877
6172
|
);
|
|
5878
6173
|
});
|
|
5879
6174
|
},
|
|
5880
|
-
|
|
6175
|
+
seed(payload, authorization) {
|
|
5881
6176
|
return __async(this, null, function* () {
|
|
5882
|
-
|
|
5883
|
-
`/
|
|
5884
|
-
|
|
5885
|
-
)
|
|
6177
|
+
return consoleClientInstance.post(
|
|
6178
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/repository/seed`,
|
|
6179
|
+
payload,
|
|
6180
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5886
6181
|
);
|
|
5887
6182
|
});
|
|
5888
6183
|
}
|
|
5889
6184
|
};
|
|
5890
6185
|
|
|
5891
|
-
// src/apis/platform/
|
|
5892
|
-
var
|
|
5893
|
-
|
|
5894
|
-
variables: platformAdapterAppVariablesApi,
|
|
5895
|
-
templates: platformAdapterAppTemplatesApi,
|
|
5896
|
-
push(payload, authorization) {
|
|
6186
|
+
// src/apis/platform/console/app/blocks/storage/api.ts
|
|
6187
|
+
var platformConsoleAppStorageApi = {
|
|
6188
|
+
getAggregate(appId, authorization) {
|
|
5897
6189
|
return __async(this, null, function* () {
|
|
5898
|
-
return
|
|
5899
|
-
`/
|
|
5900
|
-
|
|
5901
|
-
getAdapterClientDefaultConfig(authorization)
|
|
6190
|
+
return consoleClientInstance.get(
|
|
6191
|
+
`/app/${encodeURIComponent(appId)}/blocks/storage/aggregate`,
|
|
6192
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5902
6193
|
);
|
|
5903
6194
|
});
|
|
5904
6195
|
},
|
|
5905
|
-
|
|
6196
|
+
get(appId, authorization) {
|
|
5906
6197
|
return __async(this, null, function* () {
|
|
5907
|
-
return
|
|
5908
|
-
`/
|
|
5909
|
-
|
|
6198
|
+
return consoleClientInstance.get(
|
|
6199
|
+
`/app/${encodeURIComponent(appId)}/blocks/storage`,
|
|
6200
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5910
6201
|
);
|
|
5911
6202
|
});
|
|
5912
6203
|
},
|
|
5913
|
-
|
|
6204
|
+
link(payload, authorization) {
|
|
5914
6205
|
return __async(this, null, function* () {
|
|
5915
|
-
return
|
|
5916
|
-
`/
|
|
6206
|
+
return consoleClientInstance.put(
|
|
6207
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/storage`,
|
|
5917
6208
|
payload,
|
|
5918
|
-
|
|
6209
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5919
6210
|
);
|
|
5920
6211
|
});
|
|
5921
6212
|
},
|
|
5922
|
-
|
|
6213
|
+
unlink(payload, authorization) {
|
|
5923
6214
|
return __async(this, null, function* () {
|
|
5924
|
-
return
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
|
|
5931
|
-
);
|
|
5932
|
-
});
|
|
5933
|
-
}
|
|
5934
|
-
|
|
5935
|
-
|
|
5936
|
-
|
|
5937
|
-
|
|
5938
|
-
|
|
5939
|
-
|
|
5940
|
-
|
|
5941
|
-
|
|
5942
|
-
"/integrations/bigcommerce/events/subscribe",
|
|
5943
|
-
payload,
|
|
5944
|
-
getBigCommerceClientConfig(authorization)
|
|
5945
|
-
);
|
|
5946
|
-
});
|
|
5947
|
-
},
|
|
5948
|
-
unsubscribe(payload, authorization) {
|
|
5949
|
-
return __async(this, null, function* () {
|
|
5950
|
-
yield adapterClientInstance.post(
|
|
5951
|
-
"/integrations/bigcommerce/events/unsubscribe",
|
|
5952
|
-
payload,
|
|
5953
|
-
getBigCommerceClientConfig(authorization)
|
|
5954
|
-
);
|
|
5955
|
-
});
|
|
5956
|
-
}
|
|
5957
|
-
}
|
|
5958
|
-
};
|
|
5959
|
-
|
|
5960
|
-
// src/apis/platform/adapter/integrations/hubspot/api.ts
|
|
5961
|
-
var platformAdapterHubspotApi = {
|
|
5962
|
-
events: {
|
|
5963
|
-
subscribe(payload, authorization) {
|
|
5964
|
-
return __async(this, null, function* () {
|
|
5965
|
-
yield adapterClientInstance.post(
|
|
5966
|
-
"/integrations/hubspot/events/subscribe",
|
|
5967
|
-
payload,
|
|
5968
|
-
getHubspotClientConfig(authorization)
|
|
5969
|
-
);
|
|
5970
|
-
});
|
|
5971
|
-
},
|
|
5972
|
-
unsubscribe(payload, authorization) {
|
|
5973
|
-
return __async(this, null, function* () {
|
|
5974
|
-
yield adapterClientInstance.post(
|
|
5975
|
-
"/integrations/hubspot/events/unsubscribe",
|
|
5976
|
-
payload,
|
|
5977
|
-
getHubspotClientConfig(authorization)
|
|
5978
|
-
);
|
|
5979
|
-
});
|
|
5980
|
-
}
|
|
5981
|
-
}
|
|
5982
|
-
};
|
|
5983
|
-
|
|
5984
|
-
// src/apis/platform/adapter/integrations/mailchimp/api.ts
|
|
5985
|
-
var platformAdapterMailchimpApi = {
|
|
5986
|
-
events: {
|
|
5987
|
-
subscribe(payload, authorization) {
|
|
5988
|
-
return __async(this, null, function* () {
|
|
5989
|
-
yield adapterClientInstance.post(
|
|
5990
|
-
"/integrations/mailchimp/events/subscribe",
|
|
5991
|
-
payload,
|
|
5992
|
-
getMailchimpClientConfig(authorization)
|
|
5993
|
-
);
|
|
5994
|
-
});
|
|
5995
|
-
},
|
|
5996
|
-
unsubscribe(payload, authorization) {
|
|
5997
|
-
return __async(this, null, function* () {
|
|
5998
|
-
yield adapterClientInstance.post(
|
|
5999
|
-
"/integrations/mailchimp/events/unsubscribe",
|
|
6000
|
-
payload,
|
|
6001
|
-
getMailchimpClientConfig(authorization)
|
|
6002
|
-
);
|
|
6003
|
-
});
|
|
6004
|
-
}
|
|
6005
|
-
}
|
|
6006
|
-
};
|
|
6007
|
-
|
|
6008
|
-
// src/apis/platform/adapter/integrations/shopify/api.ts
|
|
6009
|
-
var platformAdapterShopifyApi = {
|
|
6010
|
-
events: {
|
|
6011
|
-
subscribe(payload, authorization) {
|
|
6012
|
-
return __async(this, null, function* () {
|
|
6013
|
-
yield adapterClientInstance.post(
|
|
6014
|
-
"/integrations/shopify/events/subscribe",
|
|
6015
|
-
payload,
|
|
6016
|
-
getShopifyClientConfig(authorization)
|
|
6017
|
-
);
|
|
6018
|
-
});
|
|
6019
|
-
},
|
|
6020
|
-
unsubscribe(payload, authorization) {
|
|
6021
|
-
return __async(this, null, function* () {
|
|
6022
|
-
yield adapterClientInstance.post(
|
|
6023
|
-
"/integrations/shopify/events/unsubscribe",
|
|
6024
|
-
payload,
|
|
6025
|
-
getShopifyClientConfig(authorization)
|
|
6026
|
-
);
|
|
6027
|
-
});
|
|
6028
|
-
}
|
|
6215
|
+
return consoleClientInstance.delete(
|
|
6216
|
+
`/app/${encodeURIComponent(
|
|
6217
|
+
payload.appId
|
|
6218
|
+
)}/blocks/storage?${new URLSearchParams(
|
|
6219
|
+
payload
|
|
6220
|
+
).toString()}`,
|
|
6221
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6222
|
+
);
|
|
6223
|
+
});
|
|
6224
|
+
},
|
|
6225
|
+
upsert(payload, authorization) {
|
|
6226
|
+
return __async(this, null, function* () {
|
|
6227
|
+
return consoleClientInstance.patch(
|
|
6228
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/storage`,
|
|
6229
|
+
payload,
|
|
6230
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6231
|
+
);
|
|
6232
|
+
});
|
|
6029
6233
|
}
|
|
6030
6234
|
};
|
|
6031
6235
|
|
|
6032
|
-
// src/apis/platform/
|
|
6033
|
-
var
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
return
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
payload
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6236
|
+
// src/apis/platform/console/app/blocks/widgets/widget/api.ts
|
|
6237
|
+
var platformConsoleAppWidgetApi = {
|
|
6238
|
+
get(appId, widgetId, authorization) {
|
|
6239
|
+
return __async(this, null, function* () {
|
|
6240
|
+
return consoleClientInstance.get(
|
|
6241
|
+
`/app/${encodeURIComponent(
|
|
6242
|
+
appId
|
|
6243
|
+
)}/blocks/widgets/${encodeURIComponent(widgetId)}`,
|
|
6244
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6245
|
+
);
|
|
6246
|
+
});
|
|
6247
|
+
},
|
|
6248
|
+
upsert(payload, authorization) {
|
|
6249
|
+
return __async(this, null, function* () {
|
|
6250
|
+
return consoleClientInstance.post(
|
|
6251
|
+
`/app/${encodeURIComponent(
|
|
6252
|
+
payload.appId
|
|
6253
|
+
)}/blocks/widgets/${encodeURIComponent(payload.widgetId)}`,
|
|
6254
|
+
payload,
|
|
6255
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6256
|
+
);
|
|
6257
|
+
});
|
|
6258
|
+
},
|
|
6259
|
+
remove(payload, authorization) {
|
|
6260
|
+
return __async(this, null, function* () {
|
|
6261
|
+
return consoleClientInstance.delete(
|
|
6262
|
+
`/app/${encodeURIComponent(
|
|
6263
|
+
payload.appId
|
|
6264
|
+
)}/blocks/widgets/${encodeURIComponent(payload.widgetId)}`,
|
|
6265
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6266
|
+
);
|
|
6267
|
+
});
|
|
6053
6268
|
}
|
|
6054
6269
|
};
|
|
6055
6270
|
|
|
6056
|
-
// src/apis/platform/
|
|
6057
|
-
var
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
return
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6271
|
+
// src/apis/platform/console/app/blocks/widgets/api.ts
|
|
6272
|
+
var platformConsoleAppWidgetsApi = {
|
|
6273
|
+
widget: platformConsoleAppWidgetApi,
|
|
6274
|
+
get(appId, authorization) {
|
|
6275
|
+
return __async(this, null, function* () {
|
|
6276
|
+
return consoleClientInstance.get(
|
|
6277
|
+
`/app/${encodeURIComponent(appId)}/blocks/widgets`,
|
|
6278
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6279
|
+
);
|
|
6280
|
+
});
|
|
6281
|
+
},
|
|
6282
|
+
upsert(payload, authorization) {
|
|
6283
|
+
return __async(this, null, function* () {
|
|
6284
|
+
return consoleClientInstance.post(
|
|
6285
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/widgets`,
|
|
6286
|
+
payload,
|
|
6287
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6288
|
+
);
|
|
6289
|
+
});
|
|
6290
|
+
},
|
|
6291
|
+
remove(payload, authorization) {
|
|
6292
|
+
return __async(this, null, function* () {
|
|
6293
|
+
return consoleClientInstance.delete(
|
|
6294
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/widgets`,
|
|
6295
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6296
|
+
);
|
|
6297
|
+
});
|
|
6077
6298
|
}
|
|
6078
6299
|
};
|
|
6079
6300
|
|
|
6080
|
-
// src/apis/platform/
|
|
6081
|
-
var
|
|
6082
|
-
|
|
6083
|
-
|
|
6084
|
-
|
|
6085
|
-
|
|
6086
|
-
|
|
6087
|
-
|
|
6301
|
+
// src/apis/platform/console/app/blocks/api.ts
|
|
6302
|
+
var platformConsoleAppBlocksApi = {
|
|
6303
|
+
authorization: platformConsoleAppAuthorizationApi,
|
|
6304
|
+
monetization: platformConsoleAppMonetizationApi,
|
|
6305
|
+
repository: platformConsoleAppRepositoryApi,
|
|
6306
|
+
deployment: platformConsoleAppDeploymentApi,
|
|
6307
|
+
storage: platformConsoleAppStorageApi,
|
|
6308
|
+
properties: platformConsoleAppPropertiesApi,
|
|
6309
|
+
widgets: platformConsoleAppWidgetsApi
|
|
6088
6310
|
};
|
|
6089
6311
|
|
|
6090
|
-
// src/apis/platform/
|
|
6091
|
-
var
|
|
6092
|
-
|
|
6093
|
-
integrations: platformAdapterIntegrationsApi,
|
|
6094
|
-
log(payload, authorization) {
|
|
6312
|
+
// src/apis/platform/console/app/templates/api.ts
|
|
6313
|
+
var platformConsoleAppTemplatesApi = {
|
|
6314
|
+
getTemplates(authorization) {
|
|
6095
6315
|
return __async(this, null, function* () {
|
|
6096
|
-
return
|
|
6097
|
-
"/
|
|
6098
|
-
|
|
6099
|
-
|
|
6316
|
+
return consoleClientInstance.get(
|
|
6317
|
+
"/app/templates",
|
|
6318
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6319
|
+
);
|
|
6320
|
+
});
|
|
6321
|
+
},
|
|
6322
|
+
getRepositoryTemplates(authorization) {
|
|
6323
|
+
return __async(this, null, function* () {
|
|
6324
|
+
return consoleClientInstance.get(
|
|
6325
|
+
"/app/templates/repository",
|
|
6326
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6100
6327
|
);
|
|
6101
6328
|
});
|
|
6102
6329
|
}
|
|
6103
6330
|
};
|
|
6104
6331
|
|
|
6105
|
-
// src/apis/platform/
|
|
6106
|
-
var
|
|
6107
|
-
|
|
6332
|
+
// src/apis/platform/console/app/variables/api.ts
|
|
6333
|
+
var platformConsoleAppVariablesApi = {
|
|
6334
|
+
getVariables(appId, decrypted, authorization) {
|
|
6108
6335
|
return __async(this, null, function* () {
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
|
|
6117
|
-
|
|
6118
|
-
throw error;
|
|
6119
|
-
}
|
|
6120
|
-
}
|
|
6336
|
+
const response = yield consoleClientInstance.get(
|
|
6337
|
+
`/app/${encodeURIComponent(appId)}/variables`,
|
|
6338
|
+
__spreadValues({
|
|
6339
|
+
params: {
|
|
6340
|
+
decrypted
|
|
6341
|
+
}
|
|
6342
|
+
}, getConsoleClientDefaultConfig(authorization))
|
|
6343
|
+
);
|
|
6344
|
+
return response.data;
|
|
6121
6345
|
});
|
|
6122
6346
|
},
|
|
6123
|
-
|
|
6347
|
+
getVariable(appId, key, authorization) {
|
|
6124
6348
|
return __async(this, null, function* () {
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
}
|
|
6136
|
-
|
|
6137
|
-
}
|
|
6138
|
-
|
|
6349
|
+
const response = yield consoleClientInstance.get(
|
|
6350
|
+
`/app/${encodeURIComponent(appId)}/variables/${encodeURIComponent(key)}`,
|
|
6351
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6352
|
+
);
|
|
6353
|
+
return response.data;
|
|
6354
|
+
});
|
|
6355
|
+
},
|
|
6356
|
+
syncVariable(appId, key, payload, authorization) {
|
|
6357
|
+
return __async(this, null, function* () {
|
|
6358
|
+
yield consoleClientInstance.post(
|
|
6359
|
+
`/app/${encodeURIComponent(appId)}/variables/${encodeURIComponent(
|
|
6360
|
+
key
|
|
6361
|
+
)}/sync`,
|
|
6362
|
+
payload,
|
|
6363
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6364
|
+
);
|
|
6365
|
+
});
|
|
6366
|
+
},
|
|
6367
|
+
createVariable(appId, data, authorization) {
|
|
6368
|
+
return __async(this, null, function* () {
|
|
6369
|
+
yield consoleClientInstance.post(
|
|
6370
|
+
`/app/${encodeURIComponent(appId)}/variables/${encodeURIComponent(
|
|
6371
|
+
data.key
|
|
6372
|
+
)}`,
|
|
6373
|
+
data,
|
|
6374
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6375
|
+
);
|
|
6376
|
+
});
|
|
6377
|
+
},
|
|
6378
|
+
editVariable(appId, data, authorization) {
|
|
6379
|
+
return __async(this, null, function* () {
|
|
6380
|
+
yield consoleClientInstance.post(
|
|
6381
|
+
`/app/${encodeURIComponent(appId)}/variables/${encodeURIComponent(
|
|
6382
|
+
data.key
|
|
6383
|
+
)}/edit`,
|
|
6384
|
+
data,
|
|
6385
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6386
|
+
);
|
|
6387
|
+
});
|
|
6388
|
+
},
|
|
6389
|
+
deleteVariable(appId, key) {
|
|
6390
|
+
return __async(this, null, function* () {
|
|
6391
|
+
yield consoleClientInstance.delete(
|
|
6392
|
+
`/app/${encodeURIComponent(appId)}/variables/${encodeURIComponent(key)}`
|
|
6393
|
+
);
|
|
6139
6394
|
});
|
|
6140
6395
|
}
|
|
6141
6396
|
};
|
|
6142
6397
|
|
|
6143
|
-
// src/apis/platform/
|
|
6144
|
-
var
|
|
6145
|
-
|
|
6398
|
+
// src/apis/platform/console/app/api.ts
|
|
6399
|
+
var platformConsoleAppApi = {
|
|
6400
|
+
blocks: platformConsoleAppBlocksApi,
|
|
6401
|
+
variables: platformConsoleAppVariablesApi,
|
|
6402
|
+
templates: platformConsoleAppTemplatesApi,
|
|
6403
|
+
push(payload, authorization) {
|
|
6146
6404
|
return __async(this, null, function* () {
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
} catch (error) {
|
|
6153
|
-
if (error instanceof Error) {
|
|
6154
|
-
throw new Error(`Invoices couldn't be fetched. [${error.message}]`);
|
|
6155
|
-
} else {
|
|
6156
|
-
throw error;
|
|
6157
|
-
}
|
|
6158
|
-
}
|
|
6405
|
+
return consoleClientInstance.post(
|
|
6406
|
+
`/app${payload.manifest.id ? `/${encodeURIComponent(payload.manifest.id)}` : ""}`,
|
|
6407
|
+
payload,
|
|
6408
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6409
|
+
);
|
|
6159
6410
|
});
|
|
6160
6411
|
},
|
|
6161
|
-
|
|
6412
|
+
pull(appId, authorization) {
|
|
6162
6413
|
return __async(this, null, function* () {
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
}
|
|
6414
|
+
return consoleClientInstance.get(
|
|
6415
|
+
`/app/${encodeURIComponent(appId)}`,
|
|
6416
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6417
|
+
);
|
|
6418
|
+
});
|
|
6419
|
+
},
|
|
6420
|
+
verify(payload, authorization) {
|
|
6421
|
+
return __async(this, null, function* () {
|
|
6422
|
+
return consoleClientInstance.post(
|
|
6423
|
+
`/app/${encodeURIComponent(payload.appId)}/verify`,
|
|
6424
|
+
payload,
|
|
6425
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6426
|
+
);
|
|
6427
|
+
});
|
|
6428
|
+
},
|
|
6429
|
+
status(sagaId, authorization) {
|
|
6430
|
+
return __async(this, null, function* () {
|
|
6431
|
+
return consoleClientInstance.get(
|
|
6432
|
+
"/app/status",
|
|
6433
|
+
__spreadValues({
|
|
6434
|
+
params: {
|
|
6435
|
+
sagaId
|
|
6436
|
+
}
|
|
6437
|
+
}, getConsoleClientDefaultConfig(authorization))
|
|
6438
|
+
);
|
|
6189
6439
|
});
|
|
6190
6440
|
}
|
|
6191
6441
|
};
|
|
6192
6442
|
|
|
6193
|
-
// src/apis/platform/
|
|
6194
|
-
var
|
|
6195
|
-
|
|
6196
|
-
|
|
6443
|
+
// src/apis/platform/console/api.ts
|
|
6444
|
+
var platformConsoleApi = {
|
|
6445
|
+
app: platformConsoleAppApi,
|
|
6446
|
+
log(payload, authorization) {
|
|
6447
|
+
return __async(this, null, function* () {
|
|
6448
|
+
return consoleClientInstance.post(
|
|
6449
|
+
"/log",
|
|
6450
|
+
payload,
|
|
6451
|
+
getConsoleClientConfig(authorization)
|
|
6452
|
+
);
|
|
6453
|
+
});
|
|
6454
|
+
}
|
|
6197
6455
|
};
|
|
6198
6456
|
|
|
6199
6457
|
// src/constants/app/templates/repository.ts
|
|
@@ -7712,6 +7970,7 @@ var platformApi = {
|
|
|
7712
7970
|
accounts: platformAccountsApi,
|
|
7713
7971
|
billing: platformBillingApi,
|
|
7714
7972
|
adapter: platformAdapterApi,
|
|
7973
|
+
console: platformConsoleApi,
|
|
7715
7974
|
dps: platformDpsApi
|
|
7716
7975
|
};
|
|
7717
7976
|
|
|
@@ -8412,7 +8671,7 @@ var api2 = {
|
|
|
8412
8671
|
isInitialized: false
|
|
8413
8672
|
};
|
|
8414
8673
|
function initApi(config, tokens) {
|
|
8415
|
-
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;
|
|
8674
|
+
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;
|
|
8416
8675
|
initPlatformAccountsClient(
|
|
8417
8676
|
(_a = config.urls.platform) == null ? void 0 : _a.accounts,
|
|
8418
8677
|
(_b = tokens == null ? void 0 : tokens.platform) == null ? void 0 : _b.token
|
|
@@ -8433,19 +8692,29 @@ function initApi(config, tokens) {
|
|
|
8433
8692
|
slack: tokens.slack
|
|
8434
8693
|
} : void 0
|
|
8435
8694
|
);
|
|
8436
|
-
|
|
8437
|
-
|
|
8438
|
-
|
|
8439
|
-
|
|
8440
|
-
|
|
8441
|
-
|
|
8442
|
-
|
|
8443
|
-
|
|
8444
|
-
|
|
8445
|
-
|
|
8446
|
-
|
|
8447
|
-
|
|
8448
|
-
|
|
8695
|
+
initConsoleClient(
|
|
8696
|
+
(_h = config.urls.platform) == null ? void 0 : _h.console,
|
|
8697
|
+
tokens ? {
|
|
8698
|
+
platform: tokens.platform,
|
|
8699
|
+
github: tokens.github,
|
|
8700
|
+
netlify: tokens.netlify,
|
|
8701
|
+
vercel: tokens.vercel,
|
|
8702
|
+
neon: tokens.neon
|
|
8703
|
+
} : void 0
|
|
8704
|
+
);
|
|
8705
|
+
initLiveChatClient((_i = config.urls.products) == null ? void 0 : _i.livechat, (_j = tokens == null ? void 0 : tokens.platform) == null ? void 0 : _j.token);
|
|
8706
|
+
initHelpDeskClient((_k = config.urls.products) == null ? void 0 : _k.helpdesk, (_l = tokens == null ? void 0 : tokens.platform) == null ? void 0 : _l.token);
|
|
8707
|
+
initTextClient((_m = config.urls.integrations) == null ? void 0 : _m.text, (_n = tokens == null ? void 0 : tokens.platform) == null ? void 0 : _n.token);
|
|
8708
|
+
initGithubClient((_o = tokens == null ? void 0 : tokens.github) == null ? void 0 : _o.appToken);
|
|
8709
|
+
initNetlifyClient((_p = tokens == null ? void 0 : tokens.netlify) == null ? void 0 : _p.token);
|
|
8710
|
+
initVercelClient((_q = tokens == null ? void 0 : tokens.vercel) == null ? void 0 : _q.token);
|
|
8711
|
+
initNeonClient((_r = tokens == null ? void 0 : tokens.neon) == null ? void 0 : _r.token);
|
|
8712
|
+
initPlanetScaleClient((_s = tokens == null ? void 0 : tokens.planetscale) == null ? void 0 : _s.token);
|
|
8713
|
+
initMailchimpClient((_t = tokens == null ? void 0 : tokens.mailchimp) == null ? void 0 : _t.token, (_u = tokens == null ? void 0 : tokens.mailchimp) == null ? void 0 : _u.server);
|
|
8714
|
+
initShopifyClient((_v = tokens == null ? void 0 : tokens.shopify) == null ? void 0 : _v.token, (_w = tokens == null ? void 0 : tokens.shopify) == null ? void 0 : _w.shop);
|
|
8715
|
+
initBigCommerceClient((_x = tokens == null ? void 0 : tokens.bigcommerce) == null ? void 0 : _x.token, (_y = tokens == null ? void 0 : tokens.bigcommerce) == null ? void 0 : _y.shop);
|
|
8716
|
+
initHubspotClient((_z = tokens == null ? void 0 : tokens.hubspot) == null ? void 0 : _z.token);
|
|
8717
|
+
initSlackClient((_A = tokens == null ? void 0 : tokens.slack) == null ? void 0 : _A.token);
|
|
8449
8718
|
api2.isInitialized = true;
|
|
8450
8719
|
}
|
|
8451
8720
|
|
|
@@ -8506,7 +8775,9 @@ function getIntegrationFlowUrl(name, flow, trigger, context, state, config) {
|
|
|
8506
8775
|
BigCommerceApiError,
|
|
8507
8776
|
BigCommerceEventNames,
|
|
8508
8777
|
BigCommerceWebhookScopes,
|
|
8778
|
+
ConsoleApiError,
|
|
8509
8779
|
DpsApiError,
|
|
8780
|
+
GitHubWebhookActions,
|
|
8510
8781
|
HelpDeskApiError,
|
|
8511
8782
|
HelpDeskWebhookEventType,
|
|
8512
8783
|
HubSpotWebhookEventTypes,
|
|
@@ -8547,31 +8818,43 @@ function getIntegrationFlowUrl(name, flow, trigger, context, state, config) {
|
|
|
8547
8818
|
bigcommerceEventsZods,
|
|
8548
8819
|
billingClientInstance,
|
|
8549
8820
|
buildUrlFromSegments,
|
|
8821
|
+
consoleClientInstance,
|
|
8550
8822
|
dpsClientInstance,
|
|
8551
8823
|
getAdapterClientConfig,
|
|
8552
8824
|
getAdapterClientDefaultConfig,
|
|
8553
8825
|
getAppAutoReviewPayload,
|
|
8826
|
+
getBigCommerceClientAuthorization,
|
|
8554
8827
|
getBigCommerceClientConfig,
|
|
8555
8828
|
getBigCommerceClientUrl,
|
|
8556
8829
|
getBillingClientConfig,
|
|
8830
|
+
getConsoleClientConfig,
|
|
8831
|
+
getConsoleClientDefaultConfig,
|
|
8557
8832
|
getDpsClientConfig,
|
|
8558
8833
|
getEmptyAppAutoReview,
|
|
8834
|
+
getGitHubClientAuthorization,
|
|
8559
8835
|
getGithubClientConfig,
|
|
8560
8836
|
getHelpDeskClientConfig,
|
|
8837
|
+
getHubspotClientAuthorization,
|
|
8561
8838
|
getHubspotClientConfig,
|
|
8562
8839
|
getIntegrationFlowUrl,
|
|
8563
8840
|
getIntegrationFlowUrlForRedirection,
|
|
8564
8841
|
getLiveChatClientConfig,
|
|
8842
|
+
getMailchimpClientAuthorization,
|
|
8565
8843
|
getMailchimpClientConfig,
|
|
8566
8844
|
getMailchimpClientUrl,
|
|
8567
8845
|
getNeonClientConfig,
|
|
8846
|
+
getNetlifyClientAuthorization,
|
|
8568
8847
|
getNetlifyClientConfig,
|
|
8569
8848
|
getPlanetScaleClientConfig,
|
|
8570
8849
|
getRegion,
|
|
8850
|
+
getShopifyClientAuthorization,
|
|
8571
8851
|
getShopifyClientConfig,
|
|
8572
8852
|
getShopifyClientUrl,
|
|
8853
|
+
getSlackClientAuthorization,
|
|
8573
8854
|
getSlackClientConfig,
|
|
8855
|
+
getTextClientAuthorization,
|
|
8574
8856
|
getTextClientConfig,
|
|
8857
|
+
getVercelClientAuthorization,
|
|
8575
8858
|
getVercelClientConfig,
|
|
8576
8859
|
githubClientInstance,
|
|
8577
8860
|
helpdeskClientInstance,
|
|
@@ -8581,6 +8864,7 @@ function getIntegrationFlowUrl(name, flow, trigger, context, state, config) {
|
|
|
8581
8864
|
initApi,
|
|
8582
8865
|
initBigCommerceClient,
|
|
8583
8866
|
initBillingClient,
|
|
8867
|
+
initConsoleClient,
|
|
8584
8868
|
initDpsClient,
|
|
8585
8869
|
initGithubClient,
|
|
8586
8870
|
initHelpDeskClient,
|
|
@@ -8613,6 +8897,7 @@ function getIntegrationFlowUrl(name, flow, trigger, context, state, config) {
|
|
|
8613
8897
|
textLivechatEventsZods,
|
|
8614
8898
|
updateAdapterClient,
|
|
8615
8899
|
updateBigCommerceClient,
|
|
8900
|
+
updateConsoleClient,
|
|
8616
8901
|
updateGithubClient,
|
|
8617
8902
|
updateHubspotClient,
|
|
8618
8903
|
updateMailchimpClient,
|