@livechat/developer-studio-api 3.4.23 → 3.5.0
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 +1370 -1246
- package/dist/index.d.ts +1370 -1246
- package/dist/index.js +931 -594
- package/dist/index.mjs +915 -594
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -75,6 +75,7 @@ __export(src_exports, {
|
|
|
75
75
|
BigCommerceApiError: () => BigCommerceApiError,
|
|
76
76
|
BigCommerceEventNames: () => BigCommerceEventNames,
|
|
77
77
|
BigCommerceWebhookScopes: () => BigCommerceWebhookScopes,
|
|
78
|
+
ConsoleApiError: () => ConsoleApiError,
|
|
78
79
|
DpsApiError: () => DpsApiError,
|
|
79
80
|
HelpDeskApiError: () => HelpDeskApiError,
|
|
80
81
|
HelpDeskWebhookEventType: () => HelpDeskWebhookEventType,
|
|
@@ -95,6 +96,7 @@ __export(src_exports, {
|
|
|
95
96
|
SlackApiError: () => SlackApiError,
|
|
96
97
|
SlackEventNames: () => SlackEventNames,
|
|
97
98
|
SlackEventTypes: () => SlackEventTypes,
|
|
99
|
+
SlackMessageEventSubTypes: () => SlackMessageEventSubTypes,
|
|
98
100
|
TextApiError: () => TextApiError,
|
|
99
101
|
TextHelpDeskEventNames: () => TextHelpDeskEventNames,
|
|
100
102
|
TextLivechatEventNames: () => TextLivechatEventNames,
|
|
@@ -115,31 +117,43 @@ __export(src_exports, {
|
|
|
115
117
|
bigcommerceEventsZods: () => bigcommerceEventsZods,
|
|
116
118
|
billingClientInstance: () => billingClientInstance,
|
|
117
119
|
buildUrlFromSegments: () => buildUrlFromSegments,
|
|
120
|
+
consoleClientInstance: () => consoleClientInstance,
|
|
118
121
|
dpsClientInstance: () => dpsClientInstance,
|
|
119
122
|
getAdapterClientConfig: () => getAdapterClientConfig,
|
|
120
123
|
getAdapterClientDefaultConfig: () => getAdapterClientDefaultConfig,
|
|
121
124
|
getAppAutoReviewPayload: () => getAppAutoReviewPayload,
|
|
125
|
+
getBigCommerceClientAuthorization: () => getBigCommerceClientAuthorization,
|
|
122
126
|
getBigCommerceClientConfig: () => getBigCommerceClientConfig,
|
|
123
127
|
getBigCommerceClientUrl: () => getBigCommerceClientUrl,
|
|
124
128
|
getBillingClientConfig: () => getBillingClientConfig,
|
|
129
|
+
getConsoleClientConfig: () => getConsoleClientConfig,
|
|
130
|
+
getConsoleClientDefaultConfig: () => getConsoleClientDefaultConfig,
|
|
125
131
|
getDpsClientConfig: () => getDpsClientConfig,
|
|
126
132
|
getEmptyAppAutoReview: () => getEmptyAppAutoReview,
|
|
133
|
+
getGitHubClientAuthorization: () => getGitHubClientAuthorization,
|
|
127
134
|
getGithubClientConfig: () => getGithubClientConfig,
|
|
128
135
|
getHelpDeskClientConfig: () => getHelpDeskClientConfig,
|
|
136
|
+
getHubspotClientAuthorization: () => getHubspotClientAuthorization,
|
|
129
137
|
getHubspotClientConfig: () => getHubspotClientConfig,
|
|
130
138
|
getIntegrationFlowUrl: () => getIntegrationFlowUrl,
|
|
131
139
|
getIntegrationFlowUrlForRedirection: () => getIntegrationFlowUrlForRedirection,
|
|
132
140
|
getLiveChatClientConfig: () => getLiveChatClientConfig,
|
|
141
|
+
getMailchimpClientAuthorization: () => getMailchimpClientAuthorization,
|
|
133
142
|
getMailchimpClientConfig: () => getMailchimpClientConfig,
|
|
134
143
|
getMailchimpClientUrl: () => getMailchimpClientUrl,
|
|
135
144
|
getNeonClientConfig: () => getNeonClientConfig,
|
|
145
|
+
getNetlifyClientAuthorization: () => getNetlifyClientAuthorization,
|
|
136
146
|
getNetlifyClientConfig: () => getNetlifyClientConfig,
|
|
137
147
|
getPlanetScaleClientConfig: () => getPlanetScaleClientConfig,
|
|
138
|
-
getRegion: () =>
|
|
148
|
+
getRegion: () => getRegion3,
|
|
149
|
+
getShopifyClientAuthorization: () => getShopifyClientAuthorization,
|
|
139
150
|
getShopifyClientConfig: () => getShopifyClientConfig,
|
|
140
151
|
getShopifyClientUrl: () => getShopifyClientUrl,
|
|
152
|
+
getSlackClientAuthorization: () => getSlackClientAuthorization,
|
|
141
153
|
getSlackClientConfig: () => getSlackClientConfig,
|
|
154
|
+
getTextClientAuthorization: () => getTextClientAuthorization,
|
|
142
155
|
getTextClientConfig: () => getTextClientConfig,
|
|
156
|
+
getVercelClientAuthorization: () => getVercelClientAuthorization,
|
|
143
157
|
getVercelClientConfig: () => getVercelClientConfig,
|
|
144
158
|
githubClientInstance: () => githubClientInstance,
|
|
145
159
|
helpdeskClientInstance: () => helpdeskClientInstance,
|
|
@@ -149,6 +163,7 @@ __export(src_exports, {
|
|
|
149
163
|
initApi: () => initApi,
|
|
150
164
|
initBigCommerceClient: () => initBigCommerceClient,
|
|
151
165
|
initBillingClient: () => initBillingClient,
|
|
166
|
+
initConsoleClient: () => initConsoleClient,
|
|
152
167
|
initDpsClient: () => initDpsClient,
|
|
153
168
|
initGithubClient: () => initGithubClient,
|
|
154
169
|
initHelpDeskClient: () => initHelpDeskClient,
|
|
@@ -181,6 +196,7 @@ __export(src_exports, {
|
|
|
181
196
|
textLivechatEventsZods: () => textLivechatEventsZods,
|
|
182
197
|
updateAdapterClient: () => updateAdapterClient,
|
|
183
198
|
updateBigCommerceClient: () => updateBigCommerceClient,
|
|
199
|
+
updateConsoleClient: () => updateConsoleClient,
|
|
184
200
|
updateGithubClient: () => updateGithubClient,
|
|
185
201
|
updateHubspotClient: () => updateHubspotClient,
|
|
186
202
|
updateMailchimpClient: () => updateMailchimpClient,
|
|
@@ -312,6 +328,18 @@ var UnauthorizeApiError = class extends Error {
|
|
|
312
328
|
};
|
|
313
329
|
|
|
314
330
|
// src/apis/integrations/bigcommerce/instance.ts
|
|
331
|
+
function getBigCommerceClientAuthorization(req, headerPrefix = "x-adapter-bigcommerce") {
|
|
332
|
+
if (req.headers instanceof Headers) {
|
|
333
|
+
return {
|
|
334
|
+
shop: req.headers.get(`${headerPrefix}-shop`),
|
|
335
|
+
token: req.headers.get(`${headerPrefix}-token`)
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
return {
|
|
339
|
+
shop: req.headers[`${headerPrefix}-shop`],
|
|
340
|
+
token: req.headers[`${headerPrefix}-token`]
|
|
341
|
+
};
|
|
342
|
+
}
|
|
315
343
|
var BigCommerceApiError = class extends ApiErrorBase {
|
|
316
344
|
constructor() {
|
|
317
345
|
super(...arguments);
|
|
@@ -450,6 +478,18 @@ var import_axios5 = __toESM(require("axios"));
|
|
|
450
478
|
|
|
451
479
|
// src/apis/integrations/github/instance.ts
|
|
452
480
|
var import_axios3 = __toESM(require("axios"));
|
|
481
|
+
function getGitHubClientAuthorization(req, headerPrefix = "x-adapter-github") {
|
|
482
|
+
if (req.headers instanceof Headers) {
|
|
483
|
+
return {
|
|
484
|
+
appToken: req.headers.get(`${headerPrefix}-app-token`),
|
|
485
|
+
oauthToken: req.headers.get(`${headerPrefix}-oauth-token`)
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
return {
|
|
489
|
+
appToken: req.headers[`${headerPrefix}-app-token`],
|
|
490
|
+
oauthToken: req.headers[`${headerPrefix}-oauth-token`]
|
|
491
|
+
};
|
|
492
|
+
}
|
|
453
493
|
var githubClientInstance = import_axios3.default.create({
|
|
454
494
|
baseURL: "https://api.github.com",
|
|
455
495
|
headers: {
|
|
@@ -903,6 +943,16 @@ var gitHubApi = {
|
|
|
903
943
|
|
|
904
944
|
// src/apis/integrations/hubspot/instance.ts
|
|
905
945
|
var import_axios6 = __toESM(require("axios"));
|
|
946
|
+
function getHubspotClientAuthorization(req, headerPrefix = "x-adapter-hubspot") {
|
|
947
|
+
if (req.headers instanceof Headers) {
|
|
948
|
+
return {
|
|
949
|
+
token: req.headers.get(`${headerPrefix}-token`)
|
|
950
|
+
};
|
|
951
|
+
}
|
|
952
|
+
return {
|
|
953
|
+
token: req.headers[`${headerPrefix}-token`]
|
|
954
|
+
};
|
|
955
|
+
}
|
|
906
956
|
var HubspotApiError = class extends ApiErrorBase {
|
|
907
957
|
constructor() {
|
|
908
958
|
super(...arguments);
|
|
@@ -1124,6 +1174,18 @@ var import_axios8 = __toESM(require("axios"));
|
|
|
1124
1174
|
|
|
1125
1175
|
// src/apis/integrations/mailchimp/instance.ts
|
|
1126
1176
|
var import_axios7 = __toESM(require("axios"));
|
|
1177
|
+
function getMailchimpClientAuthorization(req, headerPrefix = "x-adapter-mailchimp") {
|
|
1178
|
+
if (req.headers instanceof Headers) {
|
|
1179
|
+
return {
|
|
1180
|
+
server: req.headers.get(`${headerPrefix}-server`),
|
|
1181
|
+
token: req.headers.get(`${headerPrefix}-token`)
|
|
1182
|
+
};
|
|
1183
|
+
}
|
|
1184
|
+
return {
|
|
1185
|
+
server: req.headers[`${headerPrefix}-server`],
|
|
1186
|
+
token: req.headers[`${headerPrefix}-token`]
|
|
1187
|
+
};
|
|
1188
|
+
}
|
|
1127
1189
|
var MailchimpApiError = class extends ApiErrorBase {
|
|
1128
1190
|
constructor() {
|
|
1129
1191
|
super(...arguments);
|
|
@@ -1621,6 +1683,16 @@ var import_axios12 = require("axios");
|
|
|
1621
1683
|
|
|
1622
1684
|
// src/apis/integrations/netlify/instance.ts
|
|
1623
1685
|
var import_axios11 = __toESM(require("axios"));
|
|
1686
|
+
function getNetlifyClientAuthorization(req, headerPrefix = "x-adapter-netlify-token") {
|
|
1687
|
+
if (req.headers instanceof Headers) {
|
|
1688
|
+
return {
|
|
1689
|
+
token: req.headers.get(`${headerPrefix}-token`)
|
|
1690
|
+
};
|
|
1691
|
+
}
|
|
1692
|
+
return {
|
|
1693
|
+
token: req.headers[`${headerPrefix}-token`]
|
|
1694
|
+
};
|
|
1695
|
+
}
|
|
1624
1696
|
var netlifyClientInstance = import_axios11.default.create({
|
|
1625
1697
|
baseURL: "https://api.netlify.com/api/v1",
|
|
1626
1698
|
headers: {
|
|
@@ -2384,6 +2456,18 @@ var import_axios18 = __toESM(require("axios"));
|
|
|
2384
2456
|
|
|
2385
2457
|
// src/apis/integrations/shopify/instance.ts
|
|
2386
2458
|
var import_axios17 = __toESM(require("axios"));
|
|
2459
|
+
function getShopifyClientAuthorization(req, headerPrefix = "x-adapter-shopify") {
|
|
2460
|
+
if (req.headers instanceof Headers) {
|
|
2461
|
+
return {
|
|
2462
|
+
shop: req.headers.get(`${headerPrefix}-shop`),
|
|
2463
|
+
token: req.headers.get(`${headerPrefix}-token`)
|
|
2464
|
+
};
|
|
2465
|
+
}
|
|
2466
|
+
return {
|
|
2467
|
+
shop: req.headers[`${headerPrefix}-shop`],
|
|
2468
|
+
token: req.headers[`${headerPrefix}-token`]
|
|
2469
|
+
};
|
|
2470
|
+
}
|
|
2387
2471
|
var ShopifyApiError = class extends ApiErrorBase {
|
|
2388
2472
|
constructor() {
|
|
2389
2473
|
super(...arguments);
|
|
@@ -2526,6 +2610,16 @@ var SlackApiError = class extends ApiErrorBase {
|
|
|
2526
2610
|
this.name = "slack";
|
|
2527
2611
|
}
|
|
2528
2612
|
};
|
|
2613
|
+
function getSlackClientAuthorization(req, headerPrefix = "x-adapter-slack") {
|
|
2614
|
+
if (req.headers instanceof Headers) {
|
|
2615
|
+
return {
|
|
2616
|
+
token: req.headers.get(`${headerPrefix}-token`)
|
|
2617
|
+
};
|
|
2618
|
+
}
|
|
2619
|
+
return {
|
|
2620
|
+
token: req.headers[`${headerPrefix}-token`]
|
|
2621
|
+
};
|
|
2622
|
+
}
|
|
2529
2623
|
var slackClientInstance = import_axios19.default.create({
|
|
2530
2624
|
baseURL: "https://slack.com/api",
|
|
2531
2625
|
headers: {
|
|
@@ -2630,6 +2724,18 @@ var slackApi = {
|
|
|
2630
2724
|
|
|
2631
2725
|
// src/apis/integrations/text/instance.ts
|
|
2632
2726
|
var import_axios20 = __toESM(require("axios"));
|
|
2727
|
+
function getTextClientAuthorization(req, headerPrefix = "x-adapter-text") {
|
|
2728
|
+
if (req.headers instanceof Headers) {
|
|
2729
|
+
return {
|
|
2730
|
+
token: req.headers.get(`${headerPrefix}-token`),
|
|
2731
|
+
tokenType: "Bearer"
|
|
2732
|
+
};
|
|
2733
|
+
}
|
|
2734
|
+
return {
|
|
2735
|
+
token: req.headers[`${headerPrefix}-token`],
|
|
2736
|
+
tokenType: "Bearer"
|
|
2737
|
+
};
|
|
2738
|
+
}
|
|
2633
2739
|
var TextApiError = class extends ApiErrorBase {
|
|
2634
2740
|
constructor() {
|
|
2635
2741
|
super(...arguments);
|
|
@@ -2843,6 +2949,42 @@ var SlackEventTypes = /* @__PURE__ */ ((SlackEventTypes2) => {
|
|
|
2843
2949
|
SlackEventTypes2["MessagePosted"] = "message";
|
|
2844
2950
|
return SlackEventTypes2;
|
|
2845
2951
|
})(SlackEventTypes || {});
|
|
2952
|
+
var SlackMessageEventSubTypes = /* @__PURE__ */ ((SlackMessageEventSubTypes2) => {
|
|
2953
|
+
SlackMessageEventSubTypes2["AssistantAppThread"] = "assistant_app_thread";
|
|
2954
|
+
SlackMessageEventSubTypes2["BotMessage"] = "bot_message";
|
|
2955
|
+
SlackMessageEventSubTypes2["ChannelArchive"] = "channel_archive";
|
|
2956
|
+
SlackMessageEventSubTypes2["ChannelConvertToPrivate"] = "channel_convert_to_private";
|
|
2957
|
+
SlackMessageEventSubTypes2["ChannelConvertToPublic"] = "channel_convert_to_public";
|
|
2958
|
+
SlackMessageEventSubTypes2["ChannelJoin"] = "channel_join";
|
|
2959
|
+
SlackMessageEventSubTypes2["ChannelLeave"] = "channel_leave";
|
|
2960
|
+
SlackMessageEventSubTypes2["ChannelName"] = "channel_name";
|
|
2961
|
+
SlackMessageEventSubTypes2["ChannelPostingPermissions"] = "channel_posting_permissions";
|
|
2962
|
+
SlackMessageEventSubTypes2["ChannelPurpose"] = "channel_purpose";
|
|
2963
|
+
SlackMessageEventSubTypes2["ChannelTopic"] = "channel_topic";
|
|
2964
|
+
SlackMessageEventSubTypes2["ChannelUnarchive"] = "channel_unarchive";
|
|
2965
|
+
SlackMessageEventSubTypes2["DocumentMention"] = "document_mention";
|
|
2966
|
+
SlackMessageEventSubTypes2["EkmAccessDenied"] = "ekm_access_denied";
|
|
2967
|
+
SlackMessageEventSubTypes2["FileComment"] = "file_comment";
|
|
2968
|
+
SlackMessageEventSubTypes2["FileMention"] = "file_mention";
|
|
2969
|
+
SlackMessageEventSubTypes2["FileShare"] = "file_share";
|
|
2970
|
+
SlackMessageEventSubTypes2["GroupArchive"] = "group_archive";
|
|
2971
|
+
SlackMessageEventSubTypes2["GroupJoin"] = "group_join";
|
|
2972
|
+
SlackMessageEventSubTypes2["GroupLeave"] = "group_leave";
|
|
2973
|
+
SlackMessageEventSubTypes2["GroupName"] = "group_name";
|
|
2974
|
+
SlackMessageEventSubTypes2["GroupPurpose"] = "group_purpose";
|
|
2975
|
+
SlackMessageEventSubTypes2["GroupTopic"] = "group_topic";
|
|
2976
|
+
SlackMessageEventSubTypes2["GroupUnarchive"] = "group_unarchive";
|
|
2977
|
+
SlackMessageEventSubTypes2["MessageChanged"] = "message_changed";
|
|
2978
|
+
SlackMessageEventSubTypes2["MessageDeleted"] = "message_deleted";
|
|
2979
|
+
SlackMessageEventSubTypes2["MeMessage"] = "me_message";
|
|
2980
|
+
SlackMessageEventSubTypes2["MessageReplied"] = "message_replied";
|
|
2981
|
+
SlackMessageEventSubTypes2["PinnedItem"] = "pinned_item";
|
|
2982
|
+
SlackMessageEventSubTypes2["ReminderAdd"] = "reminder_add";
|
|
2983
|
+
SlackMessageEventSubTypes2["ReplyBroadcast"] = "reply_broadcast";
|
|
2984
|
+
SlackMessageEventSubTypes2["ThreadBroadcast"] = "thread_broadcast";
|
|
2985
|
+
SlackMessageEventSubTypes2["UnpinnedItem"] = "unpinned_item";
|
|
2986
|
+
return SlackMessageEventSubTypes2;
|
|
2987
|
+
})(SlackMessageEventSubTypes || {});
|
|
2846
2988
|
|
|
2847
2989
|
// src/apis/integrations/text/platform/workflow/workflows/_contracts/dtos/workflows.ts
|
|
2848
2990
|
var WorkflowTemplateCategory = /* @__PURE__ */ ((WorkflowTemplateCategory2) => {
|
|
@@ -2870,6 +3012,16 @@ var WorkflowExecutionStatus = /* @__PURE__ */ ((WorkflowExecutionStatus2) => {
|
|
|
2870
3012
|
|
|
2871
3013
|
// src/apis/integrations/vercel/instance.ts
|
|
2872
3014
|
var import_axios21 = __toESM(require("axios"));
|
|
3015
|
+
function getVercelClientAuthorization(req, headerPrefix = "x-adapter-vercel") {
|
|
3016
|
+
if (req.headers instanceof Headers) {
|
|
3017
|
+
return {
|
|
3018
|
+
token: req.headers.get(`${headerPrefix}-token`)
|
|
3019
|
+
};
|
|
3020
|
+
}
|
|
3021
|
+
return {
|
|
3022
|
+
token: req.headers[`${headerPrefix}-token`]
|
|
3023
|
+
};
|
|
3024
|
+
}
|
|
2873
3025
|
var vercelClientInstance = import_axios21.default.create({
|
|
2874
3026
|
baseURL: "https://api.vercel.com"
|
|
2875
3027
|
});
|
|
@@ -3812,6 +3964,147 @@ function initBillingClient(baseUrl, token) {
|
|
|
3812
3964
|
}
|
|
3813
3965
|
}
|
|
3814
3966
|
|
|
3967
|
+
// src/apis/platform/console/instance.ts
|
|
3968
|
+
var import_axios24 = __toESM(require("axios"));
|
|
3969
|
+
var REGION2 = {
|
|
3970
|
+
FRA: "fra",
|
|
3971
|
+
DAL: "dal",
|
|
3972
|
+
FRA_A: "fra-a",
|
|
3973
|
+
FRA_B: "fra-b"
|
|
3974
|
+
};
|
|
3975
|
+
var supportedRegions2 = Object.values(REGION2);
|
|
3976
|
+
var getRegion2 = (token) => {
|
|
3977
|
+
const region = token.split(":")[0];
|
|
3978
|
+
if (supportedRegions2.includes(region)) {
|
|
3979
|
+
return region;
|
|
3980
|
+
}
|
|
3981
|
+
};
|
|
3982
|
+
var ConsoleApiError = class _ConsoleApiError extends ApiErrorBase {
|
|
3983
|
+
constructor() {
|
|
3984
|
+
super(...arguments);
|
|
3985
|
+
this.name = "console";
|
|
3986
|
+
}
|
|
3987
|
+
static notFound(message) {
|
|
3988
|
+
return new _ConsoleApiError(
|
|
3989
|
+
message != null ? message : "Not found",
|
|
3990
|
+
{
|
|
3991
|
+
errorCode: "not_found",
|
|
3992
|
+
errorMessage: "Not found"
|
|
3993
|
+
},
|
|
3994
|
+
404
|
|
3995
|
+
);
|
|
3996
|
+
}
|
|
3997
|
+
};
|
|
3998
|
+
var consoleClientInstance = import_axios24.default.create({
|
|
3999
|
+
baseURL: "https://platform.labs.text.com/console/api",
|
|
4000
|
+
headers: {
|
|
4001
|
+
"Content-Type": "application/json"
|
|
4002
|
+
}
|
|
4003
|
+
});
|
|
4004
|
+
consoleClientInstance.interceptors.response.use(
|
|
4005
|
+
(response) => response,
|
|
4006
|
+
(error) => {
|
|
4007
|
+
var _a, _b;
|
|
4008
|
+
const apiError = (_a = error.response) == null ? void 0 : _a.data;
|
|
4009
|
+
if ((apiError == null ? void 0 : apiError.kind) === "unauthorized") {
|
|
4010
|
+
return Promise.reject(new UnauthorizeApiError(apiError.source));
|
|
4011
|
+
} else if ((apiError == null ? void 0 : apiError.kind) === "error") {
|
|
4012
|
+
const data = (_b = error.response) == null ? void 0 : _b.data;
|
|
4013
|
+
return Promise.reject(
|
|
4014
|
+
new ConsoleApiError(data.message, data.data, data.code)
|
|
4015
|
+
);
|
|
4016
|
+
}
|
|
4017
|
+
return Promise.reject(error);
|
|
4018
|
+
}
|
|
4019
|
+
);
|
|
4020
|
+
function getConsoleClientConfig(options = {}) {
|
|
4021
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
4022
|
+
const currentHeaders = consoleClientInstance.defaults.headers;
|
|
4023
|
+
const headers = {
|
|
4024
|
+
platform: {
|
|
4025
|
+
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
|
|
4026
|
+
},
|
|
4027
|
+
integrations: {
|
|
4028
|
+
github: {
|
|
4029
|
+
app: (_e = currentHeaders["x-adapter-github-app-token"]) != null ? _e : (_d = options.github) == null ? void 0 : _d.appToken,
|
|
4030
|
+
oauth: (_g = currentHeaders["x-adapter-github-oauth-token"]) != null ? _g : (_f = options.github) == null ? void 0 : _f.oauthToken
|
|
4031
|
+
},
|
|
4032
|
+
netlify: (_i = currentHeaders["x-adapter-netlify-token"]) != null ? _i : (_h = options.netlify) == null ? void 0 : _h.token,
|
|
4033
|
+
vercel: (_k = currentHeaders["x-adapter-vercel-token"]) != null ? _k : (_j = options.vercel) == null ? void 0 : _j.token,
|
|
4034
|
+
planetscale: (_m = currentHeaders["x-adapter-planetscale-token"]) != null ? _m : (_l = options.planetscale) == null ? void 0 : _l.token,
|
|
4035
|
+
neon: (_o = currentHeaders["x-adapter-neon-token"]) != null ? _o : (_n = options.neon) == null ? void 0 : _n.token
|
|
4036
|
+
}
|
|
4037
|
+
};
|
|
4038
|
+
if (currentHeaders.Authorization) {
|
|
4039
|
+
currentHeaders["X-Region"] = (_p = getRegion2(currentHeaders.Authorization)) != null ? _p : void 0;
|
|
4040
|
+
}
|
|
4041
|
+
if (((_q = options.ensureAuthorizationToken) == null ? void 0 : _q.platform) && !headers.platform.token) {
|
|
4042
|
+
throw new UnauthorizeApiError("accounts");
|
|
4043
|
+
}
|
|
4044
|
+
if (((_r = options.ensureAuthorizationToken) == null ? void 0 : _r.github) && (!headers.integrations.github.app || !headers.integrations.github.oauth)) {
|
|
4045
|
+
throw new UnauthorizeApiError("github");
|
|
4046
|
+
}
|
|
4047
|
+
if (((_s = options.ensureAuthorizationToken) == null ? void 0 : _s.vercel) && !headers.integrations.vercel) {
|
|
4048
|
+
throw new UnauthorizeApiError("vercel");
|
|
4049
|
+
}
|
|
4050
|
+
if (((_t = options.ensureAuthorizationToken) == null ? void 0 : _t.netlify) && !headers.integrations.netlify) {
|
|
4051
|
+
throw new UnauthorizeApiError("netlify");
|
|
4052
|
+
}
|
|
4053
|
+
if (((_u = options.ensureAuthorizationToken) == null ? void 0 : _u.planetscale) && !headers.integrations.planetscale) {
|
|
4054
|
+
throw new UnauthorizeApiError("planetscale");
|
|
4055
|
+
}
|
|
4056
|
+
if (((_v = options.ensureAuthorizationToken) == null ? void 0 : _v.neon) && !headers.integrations.neon) {
|
|
4057
|
+
throw new UnauthorizeApiError("neon");
|
|
4058
|
+
}
|
|
4059
|
+
return {
|
|
4060
|
+
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 } : {})
|
|
4061
|
+
};
|
|
4062
|
+
}
|
|
4063
|
+
var getConsoleClientDefaultConfig = (authorization) => getConsoleClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
4064
|
+
ensureAuthorizationToken: {
|
|
4065
|
+
platform: true
|
|
4066
|
+
}
|
|
4067
|
+
}));
|
|
4068
|
+
function initConsoleClient(baseUrl, tokens) {
|
|
4069
|
+
if (baseUrl) {
|
|
4070
|
+
consoleClientInstance.interceptors.request.use(
|
|
4071
|
+
(config) => {
|
|
4072
|
+
config.baseURL = baseUrl;
|
|
4073
|
+
return config;
|
|
4074
|
+
},
|
|
4075
|
+
(error) => Promise.reject(error)
|
|
4076
|
+
);
|
|
4077
|
+
}
|
|
4078
|
+
if (tokens) {
|
|
4079
|
+
updateConsoleClient(tokens);
|
|
4080
|
+
}
|
|
4081
|
+
}
|
|
4082
|
+
function updateConsoleClient(tokens) {
|
|
4083
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4084
|
+
const headers = consoleClientInstance.defaults.headers;
|
|
4085
|
+
if ((_a = tokens == null ? void 0 : tokens.platform) == null ? void 0 : _a.token) {
|
|
4086
|
+
headers.Authorization = `${(_b = tokens.platform.tokenType) != null ? _b : "Bearer"} ${tokens.platform.token}`;
|
|
4087
|
+
}
|
|
4088
|
+
if ((_c = tokens == null ? void 0 : tokens.github) == null ? void 0 : _c.appToken) {
|
|
4089
|
+
headers["x-adapter-github-app-token"] = tokens.github.appToken;
|
|
4090
|
+
}
|
|
4091
|
+
if ((_d = tokens == null ? void 0 : tokens.github) == null ? void 0 : _d.oauthToken) {
|
|
4092
|
+
headers["x-adapter-github-oauth-token"] = tokens.github.oauthToken;
|
|
4093
|
+
}
|
|
4094
|
+
if ((_e = tokens == null ? void 0 : tokens.netlify) == null ? void 0 : _e.token) {
|
|
4095
|
+
headers["x-adapter-netlify-token"] = tokens.netlify.token;
|
|
4096
|
+
}
|
|
4097
|
+
if ((_f = tokens == null ? void 0 : tokens.vercel) == null ? void 0 : _f.token) {
|
|
4098
|
+
headers["x-adapter-vercel-token"] = tokens.vercel.token;
|
|
4099
|
+
}
|
|
4100
|
+
if ((_g = tokens == null ? void 0 : tokens.planetscale) == null ? void 0 : _g.token) {
|
|
4101
|
+
headers["x-adapter-planetscale-token"] = tokens.planetscale.token;
|
|
4102
|
+
}
|
|
4103
|
+
if ((_h = tokens == null ? void 0 : tokens.neon) == null ? void 0 : _h.token) {
|
|
4104
|
+
headers["x-adapter-neon-token"] = tokens.neon.token;
|
|
4105
|
+
}
|
|
4106
|
+
}
|
|
4107
|
+
|
|
3815
4108
|
// src/apis/platform/dps/applications/application/autoReview/_contracts/dtos/autoReview.ts
|
|
3816
4109
|
var getEmptyAppAutoReview = () => ({
|
|
3817
4110
|
isReviewed: false,
|
|
@@ -3881,14 +4174,14 @@ var getAppAutoReviewPayload = (value) => {
|
|
|
3881
4174
|
};
|
|
3882
4175
|
|
|
3883
4176
|
// src/apis/platform/dps/instance.ts
|
|
3884
|
-
var
|
|
4177
|
+
var import_axios25 = __toESM(require("axios"));
|
|
3885
4178
|
var DpsApiError = class extends ApiErrorBase {
|
|
3886
4179
|
constructor() {
|
|
3887
4180
|
super(...arguments);
|
|
3888
4181
|
this.name = "dps";
|
|
3889
4182
|
}
|
|
3890
4183
|
};
|
|
3891
|
-
var dpsClientInstance =
|
|
4184
|
+
var dpsClientInstance = import_axios25.default.create({
|
|
3892
4185
|
baseURL: "https://dev-platform.labs.livechatinc.com"
|
|
3893
4186
|
});
|
|
3894
4187
|
dpsClientInstance.interceptors.response.use(
|
|
@@ -3937,14 +4230,14 @@ function initDpsClient(baseUrl, token) {
|
|
|
3937
4230
|
}
|
|
3938
4231
|
|
|
3939
4232
|
// src/apis/products/helpdesk/instance.ts
|
|
3940
|
-
var
|
|
4233
|
+
var import_axios26 = __toESM(require("axios"));
|
|
3941
4234
|
var HelpDeskApiError = class extends ApiErrorBase {
|
|
3942
4235
|
constructor() {
|
|
3943
4236
|
super(...arguments);
|
|
3944
4237
|
this.name = "helpdesk";
|
|
3945
4238
|
}
|
|
3946
4239
|
};
|
|
3947
|
-
var helpdeskClientInstance =
|
|
4240
|
+
var helpdeskClientInstance = import_axios26.default.create({
|
|
3948
4241
|
baseURL: "https://api.labs.helpdesk.com"
|
|
3949
4242
|
});
|
|
3950
4243
|
helpdeskClientInstance.interceptors.response.use(
|
|
@@ -4032,17 +4325,17 @@ var LivechatWebhookSystemMessages = /* @__PURE__ */ ((LivechatWebhookSystemMessa
|
|
|
4032
4325
|
})(LivechatWebhookSystemMessages || {});
|
|
4033
4326
|
|
|
4034
4327
|
// src/apis/products/livechat/instance.ts
|
|
4035
|
-
var
|
|
4036
|
-
var
|
|
4328
|
+
var import_axios27 = __toESM(require("axios"));
|
|
4329
|
+
var REGION3 = {
|
|
4037
4330
|
FRA: "fra",
|
|
4038
4331
|
DAL: "dal",
|
|
4039
4332
|
FRA_A: "fra-a",
|
|
4040
4333
|
FRA_B: "fra-b"
|
|
4041
4334
|
};
|
|
4042
|
-
var
|
|
4043
|
-
var
|
|
4335
|
+
var supportedRegions3 = Object.values(REGION3);
|
|
4336
|
+
var getRegion3 = (token) => {
|
|
4044
4337
|
const region = token.split(":")[0];
|
|
4045
|
-
if (
|
|
4338
|
+
if (supportedRegions3.includes(region)) {
|
|
4046
4339
|
return region;
|
|
4047
4340
|
}
|
|
4048
4341
|
};
|
|
@@ -4052,7 +4345,7 @@ var LivechatApiError = class extends ApiErrorBase {
|
|
|
4052
4345
|
this.name = "livechat";
|
|
4053
4346
|
}
|
|
4054
4347
|
};
|
|
4055
|
-
var livechatClientInstance =
|
|
4348
|
+
var livechatClientInstance = import_axios27.default.create({
|
|
4056
4349
|
baseURL: "https://api.labs.livechatinc.com"
|
|
4057
4350
|
});
|
|
4058
4351
|
livechatClientInstance.interceptors.response.use(
|
|
@@ -4087,7 +4380,7 @@ function getLiveChatClientConfig(options = {}) {
|
|
|
4087
4380
|
};
|
|
4088
4381
|
}
|
|
4089
4382
|
function initLiveChatClient(baseUrl, token) {
|
|
4090
|
-
const region = token ?
|
|
4383
|
+
const region = token ? getRegion3(token) : void 0;
|
|
4091
4384
|
const headers = livechatClientInstance.defaults.headers;
|
|
4092
4385
|
if (baseUrl) {
|
|
4093
4386
|
livechatClientInstance.interceptors.request.use(
|
|
@@ -4448,7 +4741,8 @@ var urls = {
|
|
|
4448
4741
|
create: () => getUrl(),
|
|
4449
4742
|
update: (id) => getUrl([id]),
|
|
4450
4743
|
delete: (id) => getUrl([id]),
|
|
4451
|
-
connect: (id) => getUrl([id, "connection"])
|
|
4744
|
+
connect: (id) => getUrl([id, "connection"]),
|
|
4745
|
+
disconnect: (id) => getUrl([id, "disconnect"])
|
|
4452
4746
|
};
|
|
4453
4747
|
var textPlatformWorkflowsCredentialsApi = {
|
|
4454
4748
|
meta: {
|
|
@@ -4560,6 +4854,24 @@ var textPlatformWorkflowsCredentialsApi = {
|
|
|
4560
4854
|
throw error;
|
|
4561
4855
|
});
|
|
4562
4856
|
});
|
|
4857
|
+
},
|
|
4858
|
+
disconnect(id, authorization) {
|
|
4859
|
+
return __async(this, null, function* () {
|
|
4860
|
+
return textClientInstance.put(
|
|
4861
|
+
urls.disconnect(id),
|
|
4862
|
+
{},
|
|
4863
|
+
getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
4864
|
+
ensureAuthorizationToken: true
|
|
4865
|
+
}))
|
|
4866
|
+
).catch((error) => {
|
|
4867
|
+
if (error instanceof TextApiError) {
|
|
4868
|
+
throw error.withCustomMessage(
|
|
4869
|
+
`Couldn't disconnect to credentials. [${error.message}]`
|
|
4870
|
+
);
|
|
4871
|
+
}
|
|
4872
|
+
throw error;
|
|
4873
|
+
});
|
|
4874
|
+
});
|
|
4563
4875
|
}
|
|
4564
4876
|
};
|
|
4565
4877
|
|
|
@@ -4793,7 +5105,7 @@ var textApi = {
|
|
|
4793
5105
|
};
|
|
4794
5106
|
|
|
4795
5107
|
// src/apis/integrations/vercel/api.ts
|
|
4796
|
-
var
|
|
5108
|
+
var import_axios28 = __toESM(require("axios"));
|
|
4797
5109
|
|
|
4798
5110
|
// src/apis/integrations/vercel/deploy/api.ts
|
|
4799
5111
|
var vercelDeployApi = {
|
|
@@ -5053,7 +5365,7 @@ var vercelApi = {
|
|
|
5053
5365
|
client_secret: clientSecret,
|
|
5054
5366
|
redirect_uri: redirectUrl
|
|
5055
5367
|
});
|
|
5056
|
-
const response = yield
|
|
5368
|
+
const response = yield import_axios28.default.post("https://api.vercel.com/v2/oauth/access_token", data, {
|
|
5057
5369
|
headers: {
|
|
5058
5370
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
5059
5371
|
}
|
|
@@ -5394,769 +5706,767 @@ var platformAccountsApi = {
|
|
|
5394
5706
|
token: platformAccountsTokenApi
|
|
5395
5707
|
};
|
|
5396
5708
|
|
|
5397
|
-
// src/apis/platform/adapter/
|
|
5398
|
-
var
|
|
5399
|
-
|
|
5400
|
-
|
|
5401
|
-
return
|
|
5402
|
-
|
|
5403
|
-
|
|
5404
|
-
|
|
5405
|
-
|
|
5406
|
-
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
return adapterClientInstance.put(
|
|
5419
|
-
`/console/app/${encodeURIComponent(payload.appId)}/blocks/authorization`,
|
|
5420
|
-
payload,
|
|
5421
|
-
getAdapterClientDefaultConfig(authorization)
|
|
5422
|
-
);
|
|
5423
|
-
});
|
|
5424
|
-
},
|
|
5425
|
-
remove(payload, authorization) {
|
|
5426
|
-
return __async(this, null, function* () {
|
|
5427
|
-
return adapterClientInstance.delete(
|
|
5428
|
-
`/console/app/${encodeURIComponent(payload.appId)}/blocks/authorization`,
|
|
5429
|
-
getAdapterClientDefaultConfig(authorization)
|
|
5430
|
-
);
|
|
5431
|
-
});
|
|
5709
|
+
// src/apis/platform/adapter/integrations/bigcommerce/api.ts
|
|
5710
|
+
var platformAdapterBigCommerceApi = {
|
|
5711
|
+
events: {
|
|
5712
|
+
subscribe(payload, authorization) {
|
|
5713
|
+
return __async(this, null, function* () {
|
|
5714
|
+
yield adapterClientInstance.post(
|
|
5715
|
+
"/integrations/bigcommerce/events/subscribe",
|
|
5716
|
+
payload,
|
|
5717
|
+
getBigCommerceClientConfig(authorization)
|
|
5718
|
+
);
|
|
5719
|
+
});
|
|
5720
|
+
},
|
|
5721
|
+
unsubscribe(payload, authorization) {
|
|
5722
|
+
return __async(this, null, function* () {
|
|
5723
|
+
yield adapterClientInstance.post(
|
|
5724
|
+
"/integrations/bigcommerce/events/unsubscribe",
|
|
5725
|
+
payload,
|
|
5726
|
+
getBigCommerceClientConfig(authorization)
|
|
5727
|
+
);
|
|
5728
|
+
});
|
|
5729
|
+
}
|
|
5432
5730
|
}
|
|
5433
5731
|
};
|
|
5434
5732
|
|
|
5435
|
-
// src/apis/platform/adapter/
|
|
5436
|
-
var
|
|
5437
|
-
|
|
5438
|
-
|
|
5439
|
-
return
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5447
|
-
|
|
5448
|
-
|
|
5449
|
-
|
|
5450
|
-
|
|
5451
|
-
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
|
|
5455
|
-
|
|
5456
|
-
`/console/app/${encodeURIComponent(payload.appId)}/blocks/deployment`,
|
|
5457
|
-
payload,
|
|
5458
|
-
getAdapterClientDefaultConfig(authorization)
|
|
5459
|
-
);
|
|
5460
|
-
});
|
|
5461
|
-
},
|
|
5462
|
-
unlink(payload, authorization) {
|
|
5463
|
-
return __async(this, null, function* () {
|
|
5464
|
-
return adapterClientInstance.delete(
|
|
5465
|
-
`/console/app/${encodeURIComponent(
|
|
5466
|
-
payload.appId
|
|
5467
|
-
)}/blocks/deployment?${new URLSearchParams(
|
|
5468
|
-
payload
|
|
5469
|
-
).toString()}`,
|
|
5470
|
-
getAdapterClientDefaultConfig(authorization)
|
|
5471
|
-
);
|
|
5472
|
-
});
|
|
5473
|
-
},
|
|
5474
|
-
upsert(payload, authorization) {
|
|
5475
|
-
return __async(this, null, function* () {
|
|
5476
|
-
return adapterClientInstance.patch(
|
|
5477
|
-
`/console/app/${encodeURIComponent(payload.appId)}/blocks/deployment`,
|
|
5478
|
-
payload,
|
|
5479
|
-
getAdapterClientDefaultConfig(authorization)
|
|
5480
|
-
);
|
|
5481
|
-
});
|
|
5733
|
+
// src/apis/platform/adapter/integrations/hubspot/api.ts
|
|
5734
|
+
var platformAdapterHubspotApi = {
|
|
5735
|
+
events: {
|
|
5736
|
+
subscribe(payload, authorization) {
|
|
5737
|
+
return __async(this, null, function* () {
|
|
5738
|
+
yield adapterClientInstance.post(
|
|
5739
|
+
"/integrations/hubspot/events/subscribe",
|
|
5740
|
+
payload,
|
|
5741
|
+
getHubspotClientConfig(authorization)
|
|
5742
|
+
);
|
|
5743
|
+
});
|
|
5744
|
+
},
|
|
5745
|
+
unsubscribe(payload, authorization) {
|
|
5746
|
+
return __async(this, null, function* () {
|
|
5747
|
+
yield adapterClientInstance.post(
|
|
5748
|
+
"/integrations/hubspot/events/unsubscribe",
|
|
5749
|
+
payload,
|
|
5750
|
+
getHubspotClientConfig(authorization)
|
|
5751
|
+
);
|
|
5752
|
+
});
|
|
5753
|
+
}
|
|
5482
5754
|
}
|
|
5483
5755
|
};
|
|
5484
5756
|
|
|
5485
|
-
// src/apis/platform/adapter/
|
|
5486
|
-
var
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
return
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5757
|
+
// src/apis/platform/adapter/integrations/mailchimp/api.ts
|
|
5758
|
+
var platformAdapterMailchimpApi = {
|
|
5759
|
+
events: {
|
|
5760
|
+
subscribe(payload, authorization) {
|
|
5761
|
+
return __async(this, null, function* () {
|
|
5762
|
+
yield adapterClientInstance.post(
|
|
5763
|
+
"/integrations/mailchimp/events/subscribe",
|
|
5764
|
+
payload,
|
|
5765
|
+
getMailchimpClientConfig(authorization)
|
|
5766
|
+
);
|
|
5767
|
+
});
|
|
5768
|
+
},
|
|
5769
|
+
unsubscribe(payload, authorization) {
|
|
5770
|
+
return __async(this, null, function* () {
|
|
5771
|
+
yield adapterClientInstance.post(
|
|
5772
|
+
"/integrations/mailchimp/events/unsubscribe",
|
|
5773
|
+
payload,
|
|
5774
|
+
getMailchimpClientConfig(authorization)
|
|
5775
|
+
);
|
|
5776
|
+
});
|
|
5777
|
+
}
|
|
5778
|
+
}
|
|
5779
|
+
};
|
|
5780
|
+
|
|
5781
|
+
// src/apis/platform/adapter/integrations/shopify/api.ts
|
|
5782
|
+
var platformAdapterShopifyApi = {
|
|
5783
|
+
events: {
|
|
5784
|
+
subscribe(payload, authorization) {
|
|
5785
|
+
return __async(this, null, function* () {
|
|
5786
|
+
yield adapterClientInstance.post(
|
|
5787
|
+
"/integrations/shopify/events/subscribe",
|
|
5788
|
+
payload,
|
|
5789
|
+
getShopifyClientConfig(authorization)
|
|
5790
|
+
);
|
|
5791
|
+
});
|
|
5792
|
+
},
|
|
5793
|
+
unsubscribe(payload, authorization) {
|
|
5794
|
+
return __async(this, null, function* () {
|
|
5795
|
+
yield adapterClientInstance.post(
|
|
5796
|
+
"/integrations/shopify/events/unsubscribe",
|
|
5797
|
+
payload,
|
|
5798
|
+
getShopifyClientConfig(authorization)
|
|
5799
|
+
);
|
|
5800
|
+
});
|
|
5801
|
+
}
|
|
5802
|
+
}
|
|
5803
|
+
};
|
|
5804
|
+
|
|
5805
|
+
// src/apis/platform/adapter/integrations/slack/api.ts
|
|
5806
|
+
var platformAdapterSlackApi = {
|
|
5807
|
+
events: {
|
|
5808
|
+
subscribe(payload, authorization) {
|
|
5809
|
+
return __async(this, null, function* () {
|
|
5810
|
+
yield adapterClientInstance.post(
|
|
5811
|
+
"/integrations/slack/events/subscribe",
|
|
5812
|
+
payload,
|
|
5813
|
+
getSlackClientConfig(authorization)
|
|
5814
|
+
);
|
|
5815
|
+
});
|
|
5816
|
+
},
|
|
5817
|
+
unsubscribe(payload, authorization) {
|
|
5818
|
+
return __async(this, null, function* () {
|
|
5819
|
+
yield adapterClientInstance.post(
|
|
5820
|
+
"/integrations/slack/events/unsubscribe",
|
|
5821
|
+
payload,
|
|
5822
|
+
getSlackClientConfig(authorization)
|
|
5823
|
+
);
|
|
5824
|
+
});
|
|
5825
|
+
}
|
|
5826
|
+
}
|
|
5827
|
+
};
|
|
5828
|
+
|
|
5829
|
+
// src/apis/platform/adapter/integrations/text/api.ts
|
|
5830
|
+
var platformAdapterTextApi = {
|
|
5831
|
+
events: {
|
|
5832
|
+
subscribe(payload, authorization) {
|
|
5833
|
+
return __async(this, null, function* () {
|
|
5834
|
+
yield adapterClientInstance.post(
|
|
5835
|
+
"/integrations/text/events/subscribe",
|
|
5836
|
+
payload,
|
|
5837
|
+
getTextClientConfig(authorization)
|
|
5838
|
+
);
|
|
5839
|
+
});
|
|
5840
|
+
},
|
|
5841
|
+
unsubscribe(payload, authorization) {
|
|
5842
|
+
return __async(this, null, function* () {
|
|
5843
|
+
yield adapterClientInstance.post(
|
|
5844
|
+
"/integrations/text/events/unsubscribe",
|
|
5845
|
+
payload,
|
|
5846
|
+
getTextClientConfig(authorization)
|
|
5847
|
+
);
|
|
5848
|
+
});
|
|
5849
|
+
}
|
|
5850
|
+
}
|
|
5851
|
+
};
|
|
5852
|
+
|
|
5853
|
+
// src/apis/platform/adapter/integrations/api.ts
|
|
5854
|
+
var platformAdapterIntegrationsApi = {
|
|
5855
|
+
mailchimp: platformAdapterMailchimpApi,
|
|
5856
|
+
shopify: platformAdapterShopifyApi,
|
|
5857
|
+
hubspot: platformAdapterHubspotApi,
|
|
5858
|
+
slack: platformAdapterSlackApi,
|
|
5859
|
+
bigcommerce: platformAdapterBigCommerceApi,
|
|
5860
|
+
text: platformAdapterTextApi
|
|
5861
|
+
};
|
|
5862
|
+
|
|
5863
|
+
// src/apis/platform/adapter/api.ts
|
|
5864
|
+
var platformAdapterApi = {
|
|
5865
|
+
integrations: platformAdapterIntegrationsApi
|
|
5866
|
+
};
|
|
5867
|
+
|
|
5868
|
+
// src/apis/platform/billing/account/api.ts
|
|
5869
|
+
var platformBillingAccountApi = {
|
|
5870
|
+
getAccount(authorization) {
|
|
5496
5871
|
return __async(this, null, function* () {
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
|
|
5872
|
+
try {
|
|
5873
|
+
return yield billingClientInstance.get(
|
|
5874
|
+
"/v3/account",
|
|
5875
|
+
getBillingClientConfig(authorization)
|
|
5876
|
+
);
|
|
5877
|
+
} catch (error) {
|
|
5878
|
+
if (error instanceof Error) {
|
|
5879
|
+
throw new Error(`Account couldn't be fetched. [${error.message}]`);
|
|
5880
|
+
} else {
|
|
5881
|
+
throw error;
|
|
5882
|
+
}
|
|
5883
|
+
}
|
|
5502
5884
|
});
|
|
5503
5885
|
},
|
|
5504
|
-
|
|
5886
|
+
getAccountInfo(product, authorization) {
|
|
5505
5887
|
return __async(this, null, function* () {
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5888
|
+
try {
|
|
5889
|
+
return yield billingClientInstance.get(
|
|
5890
|
+
`/v3/account/${encodeURIComponent(product)}/billing_info`,
|
|
5891
|
+
getBillingClientConfig(authorization)
|
|
5892
|
+
);
|
|
5893
|
+
} catch (error) {
|
|
5894
|
+
if (error instanceof Error) {
|
|
5895
|
+
throw new Error(
|
|
5896
|
+
`Account billing info couldn't be fetched. [${error.message}]`
|
|
5897
|
+
);
|
|
5898
|
+
} else {
|
|
5899
|
+
throw error;
|
|
5900
|
+
}
|
|
5901
|
+
}
|
|
5510
5902
|
});
|
|
5511
5903
|
}
|
|
5512
5904
|
};
|
|
5513
5905
|
|
|
5514
|
-
// src/apis/platform/
|
|
5515
|
-
var
|
|
5516
|
-
|
|
5517
|
-
return __async(this, null, function* () {
|
|
5518
|
-
return adapterClientInstance.get(
|
|
5519
|
-
`/console/app/${encodeURIComponent(
|
|
5520
|
-
appId
|
|
5521
|
-
)}/blocks/properties/${encodeURIComponent(propertyId)}`,
|
|
5522
|
-
getAdapterClientDefaultConfig(authorization)
|
|
5523
|
-
);
|
|
5524
|
-
});
|
|
5525
|
-
},
|
|
5526
|
-
upsert(payload, authorization) {
|
|
5906
|
+
// src/apis/platform/billing/invoices/api.ts
|
|
5907
|
+
var platformBillingInvoicesApi = {
|
|
5908
|
+
getInvoices(product, authorization) {
|
|
5527
5909
|
return __async(this, null, function* () {
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
|
|
5532
|
-
|
|
5533
|
-
|
|
5534
|
-
|
|
5910
|
+
try {
|
|
5911
|
+
return yield billingClientInstance.get(
|
|
5912
|
+
`/v2/invoices/${encodeURIComponent(product)}`,
|
|
5913
|
+
getBillingClientConfig(authorization)
|
|
5914
|
+
);
|
|
5915
|
+
} catch (error) {
|
|
5916
|
+
if (error instanceof Error) {
|
|
5917
|
+
throw new Error(`Invoices couldn't be fetched. [${error.message}]`);
|
|
5918
|
+
} else {
|
|
5919
|
+
throw error;
|
|
5920
|
+
}
|
|
5921
|
+
}
|
|
5535
5922
|
});
|
|
5536
5923
|
},
|
|
5537
|
-
|
|
5924
|
+
downloadInvoices(number, authorization) {
|
|
5538
5925
|
return __async(this, null, function* () {
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
|
|
5542
|
-
|
|
5926
|
+
try {
|
|
5927
|
+
const response = yield billingClientInstance.request(__spreadValues({
|
|
5928
|
+
url: `https://api.labs.livechatinc.com/v2/invoices/${encodeURIComponent(
|
|
5929
|
+
number
|
|
5930
|
+
)}`,
|
|
5931
|
+
data: new URLSearchParams({
|
|
5932
|
+
_method: "GET"
|
|
5933
|
+
//gave the values directly for testing
|
|
5934
|
+
}),
|
|
5935
|
+
responseType: "blob"
|
|
5936
|
+
}, getBillingClientConfig(authorization)));
|
|
5937
|
+
const href = URL.createObjectURL(response.data);
|
|
5938
|
+
const link = document.createElement("a");
|
|
5939
|
+
link.href = href;
|
|
5940
|
+
link.setAttribute("download", `invoice-${number}.pdf`);
|
|
5941
|
+
document.body.appendChild(link);
|
|
5942
|
+
link.click();
|
|
5943
|
+
document.body.removeChild(link);
|
|
5944
|
+
URL.revokeObjectURL(href);
|
|
5945
|
+
} catch (error) {
|
|
5946
|
+
if (error instanceof Error) {
|
|
5947
|
+
throw new Error(`Invoice couldn't be downloaded. [${error.message}]`);
|
|
5948
|
+
} else {
|
|
5949
|
+
throw error;
|
|
5950
|
+
}
|
|
5951
|
+
}
|
|
5543
5952
|
});
|
|
5544
5953
|
}
|
|
5545
5954
|
};
|
|
5546
5955
|
|
|
5547
|
-
// src/apis/platform/
|
|
5548
|
-
var
|
|
5549
|
-
|
|
5956
|
+
// src/apis/platform/billing/api.ts
|
|
5957
|
+
var platformBillingApi = {
|
|
5958
|
+
account: platformBillingAccountApi,
|
|
5959
|
+
invoices: platformBillingInvoicesApi
|
|
5960
|
+
};
|
|
5961
|
+
|
|
5962
|
+
// src/apis/platform/console/app/blocks/authorization/api.ts
|
|
5963
|
+
var platformConsoleAppAuthorizationApi = {
|
|
5550
5964
|
get(appId, authorization) {
|
|
5551
5965
|
return __async(this, null, function* () {
|
|
5552
|
-
return
|
|
5553
|
-
`/
|
|
5554
|
-
|
|
5966
|
+
return consoleClientInstance.get(
|
|
5967
|
+
`/app/${encodeURIComponent(appId)}/blocks/authorization`,
|
|
5968
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5555
5969
|
);
|
|
5556
5970
|
});
|
|
5557
5971
|
},
|
|
5558
|
-
|
|
5972
|
+
add(payload, authorization) {
|
|
5973
|
+
return __async(this, null, function* () {
|
|
5974
|
+
return consoleClientInstance.post(
|
|
5975
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/authorization`,
|
|
5976
|
+
payload,
|
|
5977
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5978
|
+
);
|
|
5979
|
+
});
|
|
5980
|
+
},
|
|
5981
|
+
update(payload, authorization) {
|
|
5559
5982
|
return __async(this, null, function* () {
|
|
5560
|
-
return
|
|
5561
|
-
`/
|
|
5983
|
+
return consoleClientInstance.put(
|
|
5984
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/authorization`,
|
|
5562
5985
|
payload,
|
|
5563
|
-
|
|
5986
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5564
5987
|
);
|
|
5565
5988
|
});
|
|
5566
5989
|
},
|
|
5567
5990
|
remove(payload, authorization) {
|
|
5568
5991
|
return __async(this, null, function* () {
|
|
5569
|
-
return
|
|
5570
|
-
`/
|
|
5571
|
-
|
|
5992
|
+
return consoleClientInstance.delete(
|
|
5993
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/authorization`,
|
|
5994
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5572
5995
|
);
|
|
5573
5996
|
});
|
|
5574
5997
|
}
|
|
5575
5998
|
};
|
|
5576
5999
|
|
|
5577
|
-
// src/apis/platform/
|
|
5578
|
-
var
|
|
6000
|
+
// src/apis/platform/console/app/blocks/deployment/api.ts
|
|
6001
|
+
var platformConsoleAppDeploymentApi = {
|
|
5579
6002
|
getAggregate(appId, authorization) {
|
|
5580
6003
|
return __async(this, null, function* () {
|
|
5581
|
-
return
|
|
5582
|
-
`/
|
|
5583
|
-
|
|
6004
|
+
return consoleClientInstance.get(
|
|
6005
|
+
`/app/${encodeURIComponent(appId)}/blocks/deployment/aggregate`,
|
|
6006
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5584
6007
|
);
|
|
5585
6008
|
});
|
|
5586
6009
|
},
|
|
5587
6010
|
get(appId, authorization) {
|
|
5588
6011
|
return __async(this, null, function* () {
|
|
5589
|
-
return
|
|
5590
|
-
`/
|
|
5591
|
-
|
|
6012
|
+
return consoleClientInstance.get(
|
|
6013
|
+
`/app/${encodeURIComponent(appId)}/blocks/deployment`,
|
|
6014
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5592
6015
|
);
|
|
5593
6016
|
});
|
|
5594
6017
|
},
|
|
5595
6018
|
link(payload, authorization) {
|
|
5596
6019
|
return __async(this, null, function* () {
|
|
5597
|
-
return
|
|
5598
|
-
`/
|
|
6020
|
+
return consoleClientInstance.put(
|
|
6021
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/deployment`,
|
|
5599
6022
|
payload,
|
|
5600
|
-
|
|
6023
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5601
6024
|
);
|
|
5602
6025
|
});
|
|
5603
6026
|
},
|
|
5604
6027
|
unlink(payload, authorization) {
|
|
5605
6028
|
return __async(this, null, function* () {
|
|
5606
|
-
return
|
|
5607
|
-
`/
|
|
6029
|
+
return consoleClientInstance.delete(
|
|
6030
|
+
`/app/${encodeURIComponent(
|
|
5608
6031
|
payload.appId
|
|
5609
|
-
)}/blocks/
|
|
6032
|
+
)}/blocks/deployment?${new URLSearchParams(
|
|
5610
6033
|
payload
|
|
5611
6034
|
).toString()}`,
|
|
5612
|
-
|
|
6035
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5613
6036
|
);
|
|
5614
6037
|
});
|
|
5615
6038
|
},
|
|
5616
6039
|
upsert(payload, authorization) {
|
|
5617
6040
|
return __async(this, null, function* () {
|
|
5618
|
-
return
|
|
5619
|
-
`/
|
|
6041
|
+
return consoleClientInstance.patch(
|
|
6042
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/deployment`,
|
|
5620
6043
|
payload,
|
|
5621
|
-
|
|
5622
|
-
);
|
|
5623
|
-
});
|
|
5624
|
-
},
|
|
5625
|
-
seed(payload, authorization) {
|
|
5626
|
-
return __async(this, null, function* () {
|
|
5627
|
-
return adapterClientInstance.post(
|
|
5628
|
-
`/console/app/${encodeURIComponent(
|
|
5629
|
-
payload.appId
|
|
5630
|
-
)}/blocks/repository/seed`,
|
|
5631
|
-
payload,
|
|
5632
|
-
getAdapterClientDefaultConfig(authorization)
|
|
6044
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5633
6045
|
);
|
|
5634
6046
|
});
|
|
5635
6047
|
}
|
|
5636
6048
|
};
|
|
5637
6049
|
|
|
5638
|
-
// src/apis/platform/
|
|
5639
|
-
var
|
|
5640
|
-
getAggregate(appId, authorization) {
|
|
5641
|
-
return __async(this, null, function* () {
|
|
5642
|
-
return adapterClientInstance.get(
|
|
5643
|
-
`/console/app/${encodeURIComponent(appId)}/blocks/storage/aggregate`,
|
|
5644
|
-
getAdapterClientDefaultConfig(authorization)
|
|
5645
|
-
);
|
|
5646
|
-
});
|
|
5647
|
-
},
|
|
6050
|
+
// src/apis/platform/console/app/blocks/monetization/api.ts
|
|
6051
|
+
var platformConsoleAppMonetizationApi = {
|
|
5648
6052
|
get(appId, authorization) {
|
|
5649
6053
|
return __async(this, null, function* () {
|
|
5650
|
-
return
|
|
5651
|
-
`/
|
|
5652
|
-
|
|
6054
|
+
return consoleClientInstance.get(
|
|
6055
|
+
`/app/${encodeURIComponent(appId)}/blocks/monetization`,
|
|
6056
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5653
6057
|
);
|
|
5654
6058
|
});
|
|
5655
6059
|
},
|
|
5656
|
-
|
|
6060
|
+
upsert(payload, authorization) {
|
|
5657
6061
|
return __async(this, null, function* () {
|
|
5658
|
-
return
|
|
5659
|
-
`/
|
|
6062
|
+
return consoleClientInstance.post(
|
|
6063
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/monetization`,
|
|
5660
6064
|
payload,
|
|
5661
|
-
|
|
6065
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5662
6066
|
);
|
|
5663
6067
|
});
|
|
5664
6068
|
},
|
|
5665
|
-
|
|
5666
|
-
return __async(this, null, function* () {
|
|
5667
|
-
return adapterClientInstance.delete(
|
|
5668
|
-
`/console/app/${encodeURIComponent(
|
|
5669
|
-
payload.appId
|
|
5670
|
-
)}/blocks/storage?${new URLSearchParams(
|
|
5671
|
-
payload
|
|
5672
|
-
).toString()}`,
|
|
5673
|
-
getAdapterClientDefaultConfig(authorization)
|
|
5674
|
-
);
|
|
5675
|
-
});
|
|
5676
|
-
},
|
|
5677
|
-
upsert(payload, authorization) {
|
|
6069
|
+
remove(payload, authorization) {
|
|
5678
6070
|
return __async(this, null, function* () {
|
|
5679
|
-
return
|
|
5680
|
-
`/
|
|
5681
|
-
|
|
5682
|
-
getAdapterClientDefaultConfig(authorization)
|
|
6071
|
+
return consoleClientInstance.delete(
|
|
6072
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/monetization`,
|
|
6073
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5683
6074
|
);
|
|
5684
6075
|
});
|
|
5685
6076
|
}
|
|
5686
6077
|
};
|
|
5687
6078
|
|
|
5688
|
-
// src/apis/platform/
|
|
5689
|
-
var
|
|
5690
|
-
get(appId,
|
|
6079
|
+
// src/apis/platform/console/app/blocks/properties/property/api.ts
|
|
6080
|
+
var platformConsoleAppPropertyApi = {
|
|
6081
|
+
get(appId, propertyId, authorization) {
|
|
5691
6082
|
return __async(this, null, function* () {
|
|
5692
|
-
return
|
|
5693
|
-
`/
|
|
6083
|
+
return consoleClientInstance.get(
|
|
6084
|
+
`/app/${encodeURIComponent(
|
|
5694
6085
|
appId
|
|
5695
|
-
)}/blocks/
|
|
5696
|
-
|
|
6086
|
+
)}/blocks/properties/${encodeURIComponent(propertyId)}`,
|
|
6087
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5697
6088
|
);
|
|
5698
6089
|
});
|
|
5699
6090
|
},
|
|
5700
6091
|
upsert(payload, authorization) {
|
|
5701
6092
|
return __async(this, null, function* () {
|
|
5702
|
-
return
|
|
5703
|
-
`/
|
|
6093
|
+
return consoleClientInstance.post(
|
|
6094
|
+
`/app/${encodeURIComponent(
|
|
5704
6095
|
payload.appId
|
|
5705
|
-
)}/blocks/
|
|
6096
|
+
)}/blocks/properties/${encodeURIComponent(payload.propertyId)}`,
|
|
5706
6097
|
payload,
|
|
5707
|
-
|
|
6098
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5708
6099
|
);
|
|
5709
6100
|
});
|
|
5710
6101
|
},
|
|
5711
6102
|
remove(payload, authorization) {
|
|
5712
6103
|
return __async(this, null, function* () {
|
|
5713
|
-
return
|
|
5714
|
-
`/
|
|
5715
|
-
|
|
5716
|
-
)}/blocks/widgets/${encodeURIComponent(payload.widgetId)}`,
|
|
5717
|
-
getAdapterClientDefaultConfig(authorization)
|
|
6104
|
+
return consoleClientInstance.delete(
|
|
6105
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/properties/${payload.propertyId}`,
|
|
6106
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5718
6107
|
);
|
|
5719
6108
|
});
|
|
5720
6109
|
}
|
|
5721
6110
|
};
|
|
5722
6111
|
|
|
5723
|
-
// src/apis/platform/
|
|
5724
|
-
var
|
|
5725
|
-
|
|
6112
|
+
// src/apis/platform/console/app/blocks/properties/api.ts
|
|
6113
|
+
var platformConsoleAppPropertiesApi = {
|
|
6114
|
+
property: platformConsoleAppPropertyApi,
|
|
5726
6115
|
get(appId, authorization) {
|
|
5727
6116
|
return __async(this, null, function* () {
|
|
5728
|
-
return
|
|
5729
|
-
`/
|
|
5730
|
-
|
|
6117
|
+
return consoleClientInstance.get(
|
|
6118
|
+
`/app/${encodeURIComponent(appId)}/blocks/properties`,
|
|
6119
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5731
6120
|
);
|
|
5732
6121
|
});
|
|
5733
6122
|
},
|
|
5734
6123
|
upsert(payload, authorization) {
|
|
5735
6124
|
return __async(this, null, function* () {
|
|
5736
|
-
return
|
|
5737
|
-
`/
|
|
6125
|
+
return consoleClientInstance.post(
|
|
6126
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/properties`,
|
|
5738
6127
|
payload,
|
|
5739
|
-
|
|
6128
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5740
6129
|
);
|
|
5741
6130
|
});
|
|
5742
6131
|
},
|
|
5743
6132
|
remove(payload, authorization) {
|
|
5744
6133
|
return __async(this, null, function* () {
|
|
5745
|
-
return
|
|
5746
|
-
`/
|
|
5747
|
-
|
|
6134
|
+
return consoleClientInstance.delete(
|
|
6135
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/properties`,
|
|
6136
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5748
6137
|
);
|
|
5749
6138
|
});
|
|
5750
6139
|
}
|
|
5751
6140
|
};
|
|
5752
6141
|
|
|
5753
|
-
// src/apis/platform/
|
|
5754
|
-
var
|
|
5755
|
-
authorization
|
|
5756
|
-
monetization: platformAdapterAppMonetizationApi,
|
|
5757
|
-
repository: platformAdapterAppRepositoryApi,
|
|
5758
|
-
deployment: platformAdapterAppDeploymentApi,
|
|
5759
|
-
storage: platformAdapterAppStorageApi,
|
|
5760
|
-
properties: platformAdapterAppPropertiesApi,
|
|
5761
|
-
widgets: platformAdapterAppWidgetsApi
|
|
5762
|
-
};
|
|
5763
|
-
|
|
5764
|
-
// src/apis/platform/adapter/app/templates/api.ts
|
|
5765
|
-
var platformAdapterAppTemplatesApi = {
|
|
5766
|
-
getTemplates(authorization) {
|
|
6142
|
+
// src/apis/platform/console/app/blocks/repository/api.ts
|
|
6143
|
+
var platformConsoleAppRepositoryApi = {
|
|
6144
|
+
getAggregate(appId, authorization) {
|
|
5767
6145
|
return __async(this, null, function* () {
|
|
5768
|
-
return
|
|
5769
|
-
|
|
5770
|
-
|
|
6146
|
+
return consoleClientInstance.get(
|
|
6147
|
+
`/app/${encodeURIComponent(appId)}/blocks/repository/aggregate`,
|
|
6148
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5771
6149
|
);
|
|
5772
6150
|
});
|
|
5773
6151
|
},
|
|
5774
|
-
|
|
5775
|
-
return __async(this, null, function* () {
|
|
5776
|
-
return adapterClientInstance.get(
|
|
5777
|
-
"/console/app/templates/repository",
|
|
5778
|
-
getAdapterClientDefaultConfig(authorization)
|
|
5779
|
-
);
|
|
5780
|
-
});
|
|
5781
|
-
}
|
|
5782
|
-
};
|
|
5783
|
-
|
|
5784
|
-
// src/apis/platform/adapter/app/variables/api.ts
|
|
5785
|
-
var platformAdapterAppVariablesApi = {
|
|
5786
|
-
getVariables(appId, decrypted, authorization) {
|
|
6152
|
+
get(appId, authorization) {
|
|
5787
6153
|
return __async(this, null, function* () {
|
|
5788
|
-
|
|
5789
|
-
`/
|
|
5790
|
-
|
|
5791
|
-
params: {
|
|
5792
|
-
decrypted
|
|
5793
|
-
}
|
|
5794
|
-
}, getAdapterClientDefaultConfig(authorization))
|
|
6154
|
+
return consoleClientInstance.get(
|
|
6155
|
+
`/app/${encodeURIComponent(appId)}/blocks/repository`,
|
|
6156
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5795
6157
|
);
|
|
5796
|
-
return response.data;
|
|
5797
6158
|
});
|
|
5798
6159
|
},
|
|
5799
|
-
|
|
5800
|
-
return __async(this, null, function* () {
|
|
5801
|
-
const response = yield adapterClientInstance.get(
|
|
5802
|
-
`/console/app/${encodeURIComponent(appId)}/variables/${encodeURIComponent(
|
|
5803
|
-
key
|
|
5804
|
-
)}`,
|
|
5805
|
-
getAdapterClientDefaultConfig(authorization)
|
|
5806
|
-
);
|
|
5807
|
-
return response.data;
|
|
5808
|
-
});
|
|
5809
|
-
},
|
|
5810
|
-
syncVariable(appId, key, payload, authorization) {
|
|
6160
|
+
link(payload, authorization) {
|
|
5811
6161
|
return __async(this, null, function* () {
|
|
5812
|
-
|
|
5813
|
-
`/
|
|
5814
|
-
key
|
|
5815
|
-
)}/sync`,
|
|
6162
|
+
return consoleClientInstance.put(
|
|
6163
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/repository`,
|
|
5816
6164
|
payload,
|
|
5817
|
-
|
|
6165
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5818
6166
|
);
|
|
5819
6167
|
});
|
|
5820
6168
|
},
|
|
5821
|
-
|
|
6169
|
+
unlink(payload, authorization) {
|
|
5822
6170
|
return __async(this, null, function* () {
|
|
5823
|
-
|
|
5824
|
-
`/
|
|
5825
|
-
|
|
5826
|
-
)}
|
|
5827
|
-
|
|
5828
|
-
|
|
6171
|
+
return consoleClientInstance.delete(
|
|
6172
|
+
`/app/${encodeURIComponent(
|
|
6173
|
+
payload.appId
|
|
6174
|
+
)}/blocks/repository?${new URLSearchParams(
|
|
6175
|
+
payload
|
|
6176
|
+
).toString()}`,
|
|
6177
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5829
6178
|
);
|
|
5830
6179
|
});
|
|
5831
6180
|
},
|
|
5832
|
-
|
|
6181
|
+
upsert(payload, authorization) {
|
|
5833
6182
|
return __async(this, null, function* () {
|
|
5834
|
-
|
|
5835
|
-
`/
|
|
5836
|
-
|
|
5837
|
-
)
|
|
5838
|
-
data,
|
|
5839
|
-
getAdapterClientDefaultConfig(authorization)
|
|
6183
|
+
return consoleClientInstance.patch(
|
|
6184
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/repository`,
|
|
6185
|
+
payload,
|
|
6186
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5840
6187
|
);
|
|
5841
6188
|
});
|
|
5842
6189
|
},
|
|
5843
|
-
|
|
6190
|
+
seed(payload, authorization) {
|
|
5844
6191
|
return __async(this, null, function* () {
|
|
5845
|
-
|
|
5846
|
-
`/
|
|
5847
|
-
|
|
5848
|
-
)
|
|
6192
|
+
return consoleClientInstance.post(
|
|
6193
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/repository/seed`,
|
|
6194
|
+
payload,
|
|
6195
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5849
6196
|
);
|
|
5850
6197
|
});
|
|
5851
6198
|
}
|
|
5852
6199
|
};
|
|
5853
6200
|
|
|
5854
|
-
// src/apis/platform/
|
|
5855
|
-
var
|
|
5856
|
-
|
|
5857
|
-
variables: platformAdapterAppVariablesApi,
|
|
5858
|
-
templates: platformAdapterAppTemplatesApi,
|
|
5859
|
-
push(payload, authorization) {
|
|
6201
|
+
// src/apis/platform/console/app/blocks/storage/api.ts
|
|
6202
|
+
var platformConsoleAppStorageApi = {
|
|
6203
|
+
getAggregate(appId, authorization) {
|
|
5860
6204
|
return __async(this, null, function* () {
|
|
5861
|
-
return
|
|
5862
|
-
`/
|
|
5863
|
-
|
|
5864
|
-
getAdapterClientDefaultConfig(authorization)
|
|
6205
|
+
return consoleClientInstance.get(
|
|
6206
|
+
`/app/${encodeURIComponent(appId)}/blocks/storage/aggregate`,
|
|
6207
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5865
6208
|
);
|
|
5866
6209
|
});
|
|
5867
6210
|
},
|
|
5868
|
-
|
|
6211
|
+
get(appId, authorization) {
|
|
5869
6212
|
return __async(this, null, function* () {
|
|
5870
|
-
return
|
|
5871
|
-
`/
|
|
5872
|
-
|
|
6213
|
+
return consoleClientInstance.get(
|
|
6214
|
+
`/app/${encodeURIComponent(appId)}/blocks/storage`,
|
|
6215
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5873
6216
|
);
|
|
5874
6217
|
});
|
|
5875
6218
|
},
|
|
5876
|
-
|
|
6219
|
+
link(payload, authorization) {
|
|
5877
6220
|
return __async(this, null, function* () {
|
|
5878
|
-
return
|
|
5879
|
-
`/
|
|
6221
|
+
return consoleClientInstance.put(
|
|
6222
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/storage`,
|
|
5880
6223
|
payload,
|
|
5881
|
-
|
|
6224
|
+
getConsoleClientDefaultConfig(authorization)
|
|
5882
6225
|
);
|
|
5883
6226
|
});
|
|
5884
6227
|
},
|
|
5885
|
-
|
|
6228
|
+
unlink(payload, authorization) {
|
|
5886
6229
|
return __async(this, null, function* () {
|
|
5887
|
-
return
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
);
|
|
5895
|
-
});
|
|
5896
|
-
}
|
|
5897
|
-
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
5901
|
-
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
5905
|
-
"/integrations/bigcommerce/events/subscribe",
|
|
5906
|
-
payload,
|
|
5907
|
-
getBigCommerceClientConfig(authorization)
|
|
5908
|
-
);
|
|
5909
|
-
});
|
|
5910
|
-
},
|
|
5911
|
-
unsubscribe(payload, authorization) {
|
|
5912
|
-
return __async(this, null, function* () {
|
|
5913
|
-
yield adapterClientInstance.post(
|
|
5914
|
-
"/integrations/bigcommerce/events/unsubscribe",
|
|
5915
|
-
payload,
|
|
5916
|
-
getBigCommerceClientConfig(authorization)
|
|
5917
|
-
);
|
|
5918
|
-
});
|
|
5919
|
-
}
|
|
5920
|
-
}
|
|
5921
|
-
};
|
|
5922
|
-
|
|
5923
|
-
// src/apis/platform/adapter/integrations/hubspot/api.ts
|
|
5924
|
-
var platformAdapterHubspotApi = {
|
|
5925
|
-
events: {
|
|
5926
|
-
subscribe(payload, authorization) {
|
|
5927
|
-
return __async(this, null, function* () {
|
|
5928
|
-
yield adapterClientInstance.post(
|
|
5929
|
-
"/integrations/hubspot/events/subscribe",
|
|
5930
|
-
payload,
|
|
5931
|
-
getHubspotClientConfig(authorization)
|
|
5932
|
-
);
|
|
5933
|
-
});
|
|
5934
|
-
},
|
|
5935
|
-
unsubscribe(payload, authorization) {
|
|
5936
|
-
return __async(this, null, function* () {
|
|
5937
|
-
yield adapterClientInstance.post(
|
|
5938
|
-
"/integrations/hubspot/events/unsubscribe",
|
|
5939
|
-
payload,
|
|
5940
|
-
getHubspotClientConfig(authorization)
|
|
5941
|
-
);
|
|
5942
|
-
});
|
|
5943
|
-
}
|
|
5944
|
-
}
|
|
5945
|
-
};
|
|
5946
|
-
|
|
5947
|
-
// src/apis/platform/adapter/integrations/mailchimp/api.ts
|
|
5948
|
-
var platformAdapterMailchimpApi = {
|
|
5949
|
-
events: {
|
|
5950
|
-
subscribe(payload, authorization) {
|
|
5951
|
-
return __async(this, null, function* () {
|
|
5952
|
-
yield adapterClientInstance.post(
|
|
5953
|
-
"/integrations/mailchimp/events/subscribe",
|
|
5954
|
-
payload,
|
|
5955
|
-
getMailchimpClientConfig(authorization)
|
|
5956
|
-
);
|
|
5957
|
-
});
|
|
5958
|
-
},
|
|
5959
|
-
unsubscribe(payload, authorization) {
|
|
5960
|
-
return __async(this, null, function* () {
|
|
5961
|
-
yield adapterClientInstance.post(
|
|
5962
|
-
"/integrations/mailchimp/events/unsubscribe",
|
|
5963
|
-
payload,
|
|
5964
|
-
getMailchimpClientConfig(authorization)
|
|
5965
|
-
);
|
|
5966
|
-
});
|
|
5967
|
-
}
|
|
5968
|
-
}
|
|
5969
|
-
};
|
|
5970
|
-
|
|
5971
|
-
// src/apis/platform/adapter/integrations/shopify/api.ts
|
|
5972
|
-
var platformAdapterShopifyApi = {
|
|
5973
|
-
events: {
|
|
5974
|
-
subscribe(payload, authorization) {
|
|
5975
|
-
return __async(this, null, function* () {
|
|
5976
|
-
yield adapterClientInstance.post(
|
|
5977
|
-
"/integrations/shopify/events/subscribe",
|
|
5978
|
-
payload,
|
|
5979
|
-
getShopifyClientConfig(authorization)
|
|
5980
|
-
);
|
|
5981
|
-
});
|
|
5982
|
-
},
|
|
5983
|
-
unsubscribe(payload, authorization) {
|
|
5984
|
-
return __async(this, null, function* () {
|
|
5985
|
-
yield adapterClientInstance.post(
|
|
5986
|
-
"/integrations/shopify/events/unsubscribe",
|
|
5987
|
-
payload,
|
|
5988
|
-
getShopifyClientConfig(authorization)
|
|
5989
|
-
);
|
|
5990
|
-
});
|
|
5991
|
-
}
|
|
6230
|
+
return consoleClientInstance.delete(
|
|
6231
|
+
`/app/${encodeURIComponent(
|
|
6232
|
+
payload.appId
|
|
6233
|
+
)}/blocks/storage?${new URLSearchParams(
|
|
6234
|
+
payload
|
|
6235
|
+
).toString()}`,
|
|
6236
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6237
|
+
);
|
|
6238
|
+
});
|
|
6239
|
+
},
|
|
6240
|
+
upsert(payload, authorization) {
|
|
6241
|
+
return __async(this, null, function* () {
|
|
6242
|
+
return consoleClientInstance.patch(
|
|
6243
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/storage`,
|
|
6244
|
+
payload,
|
|
6245
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6246
|
+
);
|
|
6247
|
+
});
|
|
5992
6248
|
}
|
|
5993
6249
|
};
|
|
5994
6250
|
|
|
5995
|
-
// src/apis/platform/
|
|
5996
|
-
var
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
return
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
payload
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6251
|
+
// src/apis/platform/console/app/blocks/widgets/widget/api.ts
|
|
6252
|
+
var platformConsoleAppWidgetApi = {
|
|
6253
|
+
get(appId, widgetId, authorization) {
|
|
6254
|
+
return __async(this, null, function* () {
|
|
6255
|
+
return consoleClientInstance.get(
|
|
6256
|
+
`/app/${encodeURIComponent(
|
|
6257
|
+
appId
|
|
6258
|
+
)}/blocks/widgets/${encodeURIComponent(widgetId)}`,
|
|
6259
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6260
|
+
);
|
|
6261
|
+
});
|
|
6262
|
+
},
|
|
6263
|
+
upsert(payload, authorization) {
|
|
6264
|
+
return __async(this, null, function* () {
|
|
6265
|
+
return consoleClientInstance.post(
|
|
6266
|
+
`/app/${encodeURIComponent(
|
|
6267
|
+
payload.appId
|
|
6268
|
+
)}/blocks/widgets/${encodeURIComponent(payload.widgetId)}`,
|
|
6269
|
+
payload,
|
|
6270
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6271
|
+
);
|
|
6272
|
+
});
|
|
6273
|
+
},
|
|
6274
|
+
remove(payload, authorization) {
|
|
6275
|
+
return __async(this, null, function* () {
|
|
6276
|
+
return consoleClientInstance.delete(
|
|
6277
|
+
`/app/${encodeURIComponent(
|
|
6278
|
+
payload.appId
|
|
6279
|
+
)}/blocks/widgets/${encodeURIComponent(payload.widgetId)}`,
|
|
6280
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6281
|
+
);
|
|
6282
|
+
});
|
|
6016
6283
|
}
|
|
6017
6284
|
};
|
|
6018
6285
|
|
|
6019
|
-
// src/apis/platform/
|
|
6020
|
-
var
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
return
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
|
|
6286
|
+
// src/apis/platform/console/app/blocks/widgets/api.ts
|
|
6287
|
+
var platformConsoleAppWidgetsApi = {
|
|
6288
|
+
widget: platformConsoleAppWidgetApi,
|
|
6289
|
+
get(appId, authorization) {
|
|
6290
|
+
return __async(this, null, function* () {
|
|
6291
|
+
return consoleClientInstance.get(
|
|
6292
|
+
`/app/${encodeURIComponent(appId)}/blocks/widgets`,
|
|
6293
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6294
|
+
);
|
|
6295
|
+
});
|
|
6296
|
+
},
|
|
6297
|
+
upsert(payload, authorization) {
|
|
6298
|
+
return __async(this, null, function* () {
|
|
6299
|
+
return consoleClientInstance.post(
|
|
6300
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/widgets`,
|
|
6301
|
+
payload,
|
|
6302
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6303
|
+
);
|
|
6304
|
+
});
|
|
6305
|
+
},
|
|
6306
|
+
remove(payload, authorization) {
|
|
6307
|
+
return __async(this, null, function* () {
|
|
6308
|
+
return consoleClientInstance.delete(
|
|
6309
|
+
`/app/${encodeURIComponent(payload.appId)}/blocks/widgets`,
|
|
6310
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6311
|
+
);
|
|
6312
|
+
});
|
|
6040
6313
|
}
|
|
6041
6314
|
};
|
|
6042
6315
|
|
|
6043
|
-
// src/apis/platform/
|
|
6044
|
-
var
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6316
|
+
// src/apis/platform/console/app/blocks/api.ts
|
|
6317
|
+
var platformConsoleAppBlocksApi = {
|
|
6318
|
+
authorization: platformConsoleAppAuthorizationApi,
|
|
6319
|
+
monetization: platformConsoleAppMonetizationApi,
|
|
6320
|
+
repository: platformConsoleAppRepositoryApi,
|
|
6321
|
+
deployment: platformConsoleAppDeploymentApi,
|
|
6322
|
+
storage: platformConsoleAppStorageApi,
|
|
6323
|
+
properties: platformConsoleAppPropertiesApi,
|
|
6324
|
+
widgets: platformConsoleAppWidgetsApi
|
|
6051
6325
|
};
|
|
6052
6326
|
|
|
6053
|
-
// src/apis/platform/
|
|
6054
|
-
var
|
|
6055
|
-
|
|
6056
|
-
integrations: platformAdapterIntegrationsApi,
|
|
6057
|
-
log(payload, authorization) {
|
|
6327
|
+
// src/apis/platform/console/app/templates/api.ts
|
|
6328
|
+
var platformConsoleAppTemplatesApi = {
|
|
6329
|
+
getTemplates(authorization) {
|
|
6058
6330
|
return __async(this, null, function* () {
|
|
6059
|
-
return
|
|
6060
|
-
"/
|
|
6061
|
-
|
|
6062
|
-
|
|
6331
|
+
return consoleClientInstance.get(
|
|
6332
|
+
"/app/templates",
|
|
6333
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6334
|
+
);
|
|
6335
|
+
});
|
|
6336
|
+
},
|
|
6337
|
+
getRepositoryTemplates(authorization) {
|
|
6338
|
+
return __async(this, null, function* () {
|
|
6339
|
+
return consoleClientInstance.get(
|
|
6340
|
+
"/app/templates/repository",
|
|
6341
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6063
6342
|
);
|
|
6064
6343
|
});
|
|
6065
6344
|
}
|
|
6066
6345
|
};
|
|
6067
6346
|
|
|
6068
|
-
// src/apis/platform/
|
|
6069
|
-
var
|
|
6070
|
-
|
|
6347
|
+
// src/apis/platform/console/app/variables/api.ts
|
|
6348
|
+
var platformConsoleAppVariablesApi = {
|
|
6349
|
+
getVariables(appId, decrypted, authorization) {
|
|
6071
6350
|
return __async(this, null, function* () {
|
|
6072
|
-
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6081
|
-
throw error;
|
|
6082
|
-
}
|
|
6083
|
-
}
|
|
6351
|
+
const response = yield consoleClientInstance.get(
|
|
6352
|
+
`/app/${encodeURIComponent(appId)}/variables`,
|
|
6353
|
+
__spreadValues({
|
|
6354
|
+
params: {
|
|
6355
|
+
decrypted
|
|
6356
|
+
}
|
|
6357
|
+
}, getConsoleClientDefaultConfig(authorization))
|
|
6358
|
+
);
|
|
6359
|
+
return response.data;
|
|
6084
6360
|
});
|
|
6085
6361
|
},
|
|
6086
|
-
|
|
6362
|
+
getVariable(appId, key, authorization) {
|
|
6087
6363
|
return __async(this, null, function* () {
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
}
|
|
6099
|
-
|
|
6100
|
-
}
|
|
6101
|
-
|
|
6364
|
+
const response = yield consoleClientInstance.get(
|
|
6365
|
+
`/app/${encodeURIComponent(appId)}/variables/${encodeURIComponent(key)}`,
|
|
6366
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6367
|
+
);
|
|
6368
|
+
return response.data;
|
|
6369
|
+
});
|
|
6370
|
+
},
|
|
6371
|
+
syncVariable(appId, key, payload, authorization) {
|
|
6372
|
+
return __async(this, null, function* () {
|
|
6373
|
+
yield consoleClientInstance.post(
|
|
6374
|
+
`/app/${encodeURIComponent(appId)}/variables/${encodeURIComponent(
|
|
6375
|
+
key
|
|
6376
|
+
)}/sync`,
|
|
6377
|
+
payload,
|
|
6378
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6379
|
+
);
|
|
6380
|
+
});
|
|
6381
|
+
},
|
|
6382
|
+
createVariable(appId, data, authorization) {
|
|
6383
|
+
return __async(this, null, function* () {
|
|
6384
|
+
yield consoleClientInstance.post(
|
|
6385
|
+
`/app/${encodeURIComponent(appId)}/variables/${encodeURIComponent(
|
|
6386
|
+
data.key
|
|
6387
|
+
)}`,
|
|
6388
|
+
data,
|
|
6389
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6390
|
+
);
|
|
6391
|
+
});
|
|
6392
|
+
},
|
|
6393
|
+
editVariable(appId, data, authorization) {
|
|
6394
|
+
return __async(this, null, function* () {
|
|
6395
|
+
yield consoleClientInstance.post(
|
|
6396
|
+
`/app/${encodeURIComponent(appId)}/variables/${encodeURIComponent(
|
|
6397
|
+
data.key
|
|
6398
|
+
)}/edit`,
|
|
6399
|
+
data,
|
|
6400
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6401
|
+
);
|
|
6402
|
+
});
|
|
6403
|
+
},
|
|
6404
|
+
deleteVariable(appId, key) {
|
|
6405
|
+
return __async(this, null, function* () {
|
|
6406
|
+
yield consoleClientInstance.delete(
|
|
6407
|
+
`/app/${encodeURIComponent(appId)}/variables/${encodeURIComponent(key)}`
|
|
6408
|
+
);
|
|
6102
6409
|
});
|
|
6103
6410
|
}
|
|
6104
6411
|
};
|
|
6105
6412
|
|
|
6106
|
-
// src/apis/platform/
|
|
6107
|
-
var
|
|
6108
|
-
|
|
6413
|
+
// src/apis/platform/console/app/api.ts
|
|
6414
|
+
var platformConsoleAppApi = {
|
|
6415
|
+
blocks: platformConsoleAppBlocksApi,
|
|
6416
|
+
variables: platformConsoleAppVariablesApi,
|
|
6417
|
+
templates: platformConsoleAppTemplatesApi,
|
|
6418
|
+
push(payload, authorization) {
|
|
6109
6419
|
return __async(this, null, function* () {
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
} catch (error) {
|
|
6116
|
-
if (error instanceof Error) {
|
|
6117
|
-
throw new Error(`Invoices couldn't be fetched. [${error.message}]`);
|
|
6118
|
-
} else {
|
|
6119
|
-
throw error;
|
|
6120
|
-
}
|
|
6121
|
-
}
|
|
6420
|
+
return consoleClientInstance.post(
|
|
6421
|
+
`/app${payload.manifest.id ? `/${encodeURIComponent(payload.manifest.id)}` : ""}`,
|
|
6422
|
+
payload,
|
|
6423
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6424
|
+
);
|
|
6122
6425
|
});
|
|
6123
6426
|
},
|
|
6124
|
-
|
|
6427
|
+
pull(appId, authorization) {
|
|
6125
6428
|
return __async(this, null, function* () {
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
}
|
|
6429
|
+
return consoleClientInstance.get(
|
|
6430
|
+
`/app/${encodeURIComponent(appId)}`,
|
|
6431
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6432
|
+
);
|
|
6433
|
+
});
|
|
6434
|
+
},
|
|
6435
|
+
verify(payload, authorization) {
|
|
6436
|
+
return __async(this, null, function* () {
|
|
6437
|
+
return consoleClientInstance.post(
|
|
6438
|
+
`/app/${encodeURIComponent(payload.appId)}/verify`,
|
|
6439
|
+
payload,
|
|
6440
|
+
getConsoleClientDefaultConfig(authorization)
|
|
6441
|
+
);
|
|
6442
|
+
});
|
|
6443
|
+
},
|
|
6444
|
+
status(sagaId, authorization) {
|
|
6445
|
+
return __async(this, null, function* () {
|
|
6446
|
+
return consoleClientInstance.get(
|
|
6447
|
+
"/app/status",
|
|
6448
|
+
__spreadValues({
|
|
6449
|
+
params: {
|
|
6450
|
+
sagaId
|
|
6451
|
+
}
|
|
6452
|
+
}, getConsoleClientDefaultConfig(authorization))
|
|
6453
|
+
);
|
|
6152
6454
|
});
|
|
6153
6455
|
}
|
|
6154
6456
|
};
|
|
6155
6457
|
|
|
6156
|
-
// src/apis/platform/
|
|
6157
|
-
var
|
|
6158
|
-
|
|
6159
|
-
|
|
6458
|
+
// src/apis/platform/console/api.ts
|
|
6459
|
+
var platformConsoleApi = {
|
|
6460
|
+
app: platformConsoleAppApi,
|
|
6461
|
+
log(payload, authorization) {
|
|
6462
|
+
return __async(this, null, function* () {
|
|
6463
|
+
return consoleClientInstance.post(
|
|
6464
|
+
"/log",
|
|
6465
|
+
payload,
|
|
6466
|
+
getConsoleClientConfig(authorization)
|
|
6467
|
+
);
|
|
6468
|
+
});
|
|
6469
|
+
}
|
|
6160
6470
|
};
|
|
6161
6471
|
|
|
6162
6472
|
// src/constants/app/templates/repository.ts
|
|
@@ -7675,6 +7985,7 @@ var platformApi = {
|
|
|
7675
7985
|
accounts: platformAccountsApi,
|
|
7676
7986
|
billing: platformBillingApi,
|
|
7677
7987
|
adapter: platformAdapterApi,
|
|
7988
|
+
console: platformConsoleApi,
|
|
7678
7989
|
dps: platformDpsApi
|
|
7679
7990
|
};
|
|
7680
7991
|
|
|
@@ -8375,7 +8686,7 @@ var api2 = {
|
|
|
8375
8686
|
isInitialized: false
|
|
8376
8687
|
};
|
|
8377
8688
|
function initApi(config, tokens) {
|
|
8378
|
-
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;
|
|
8689
|
+
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;
|
|
8379
8690
|
initPlatformAccountsClient(
|
|
8380
8691
|
(_a = config.urls.platform) == null ? void 0 : _a.accounts,
|
|
8381
8692
|
(_b = tokens == null ? void 0 : tokens.platform) == null ? void 0 : _b.token
|
|
@@ -8396,19 +8707,29 @@ function initApi(config, tokens) {
|
|
|
8396
8707
|
slack: tokens.slack
|
|
8397
8708
|
} : void 0
|
|
8398
8709
|
);
|
|
8399
|
-
|
|
8400
|
-
|
|
8401
|
-
|
|
8402
|
-
|
|
8403
|
-
|
|
8404
|
-
|
|
8405
|
-
|
|
8406
|
-
|
|
8407
|
-
|
|
8408
|
-
|
|
8409
|
-
|
|
8410
|
-
|
|
8411
|
-
|
|
8710
|
+
initConsoleClient(
|
|
8711
|
+
(_h = config.urls.platform) == null ? void 0 : _h.console,
|
|
8712
|
+
tokens ? {
|
|
8713
|
+
platform: tokens.platform,
|
|
8714
|
+
github: tokens.github,
|
|
8715
|
+
netlify: tokens.netlify,
|
|
8716
|
+
vercel: tokens.vercel,
|
|
8717
|
+
neon: tokens.neon
|
|
8718
|
+
} : void 0
|
|
8719
|
+
);
|
|
8720
|
+
initLiveChatClient((_i = config.urls.products) == null ? void 0 : _i.livechat, (_j = tokens == null ? void 0 : tokens.platform) == null ? void 0 : _j.token);
|
|
8721
|
+
initHelpDeskClient((_k = config.urls.products) == null ? void 0 : _k.helpdesk, (_l = tokens == null ? void 0 : tokens.platform) == null ? void 0 : _l.token);
|
|
8722
|
+
initTextClient((_m = config.urls.integrations) == null ? void 0 : _m.text, (_n = tokens == null ? void 0 : tokens.platform) == null ? void 0 : _n.token);
|
|
8723
|
+
initGithubClient((_o = tokens == null ? void 0 : tokens.github) == null ? void 0 : _o.appToken);
|
|
8724
|
+
initNetlifyClient((_p = tokens == null ? void 0 : tokens.netlify) == null ? void 0 : _p.token);
|
|
8725
|
+
initVercelClient((_q = tokens == null ? void 0 : tokens.vercel) == null ? void 0 : _q.token);
|
|
8726
|
+
initNeonClient((_r = tokens == null ? void 0 : tokens.neon) == null ? void 0 : _r.token);
|
|
8727
|
+
initPlanetScaleClient((_s = tokens == null ? void 0 : tokens.planetscale) == null ? void 0 : _s.token);
|
|
8728
|
+
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);
|
|
8729
|
+
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);
|
|
8730
|
+
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);
|
|
8731
|
+
initHubspotClient((_z = tokens == null ? void 0 : tokens.hubspot) == null ? void 0 : _z.token);
|
|
8732
|
+
initSlackClient((_A = tokens == null ? void 0 : tokens.slack) == null ? void 0 : _A.token);
|
|
8412
8733
|
api2.isInitialized = true;
|
|
8413
8734
|
}
|
|
8414
8735
|
|
|
@@ -8469,6 +8790,7 @@ function getIntegrationFlowUrl(name, flow, trigger, context, state, config) {
|
|
|
8469
8790
|
BigCommerceApiError,
|
|
8470
8791
|
BigCommerceEventNames,
|
|
8471
8792
|
BigCommerceWebhookScopes,
|
|
8793
|
+
ConsoleApiError,
|
|
8472
8794
|
DpsApiError,
|
|
8473
8795
|
HelpDeskApiError,
|
|
8474
8796
|
HelpDeskWebhookEventType,
|
|
@@ -8489,6 +8811,7 @@ function getIntegrationFlowUrl(name, flow, trigger, context, state, config) {
|
|
|
8489
8811
|
SlackApiError,
|
|
8490
8812
|
SlackEventNames,
|
|
8491
8813
|
SlackEventTypes,
|
|
8814
|
+
SlackMessageEventSubTypes,
|
|
8492
8815
|
TextApiError,
|
|
8493
8816
|
TextHelpDeskEventNames,
|
|
8494
8817
|
TextLivechatEventNames,
|
|
@@ -8509,31 +8832,43 @@ function getIntegrationFlowUrl(name, flow, trigger, context, state, config) {
|
|
|
8509
8832
|
bigcommerceEventsZods,
|
|
8510
8833
|
billingClientInstance,
|
|
8511
8834
|
buildUrlFromSegments,
|
|
8835
|
+
consoleClientInstance,
|
|
8512
8836
|
dpsClientInstance,
|
|
8513
8837
|
getAdapterClientConfig,
|
|
8514
8838
|
getAdapterClientDefaultConfig,
|
|
8515
8839
|
getAppAutoReviewPayload,
|
|
8840
|
+
getBigCommerceClientAuthorization,
|
|
8516
8841
|
getBigCommerceClientConfig,
|
|
8517
8842
|
getBigCommerceClientUrl,
|
|
8518
8843
|
getBillingClientConfig,
|
|
8844
|
+
getConsoleClientConfig,
|
|
8845
|
+
getConsoleClientDefaultConfig,
|
|
8519
8846
|
getDpsClientConfig,
|
|
8520
8847
|
getEmptyAppAutoReview,
|
|
8848
|
+
getGitHubClientAuthorization,
|
|
8521
8849
|
getGithubClientConfig,
|
|
8522
8850
|
getHelpDeskClientConfig,
|
|
8851
|
+
getHubspotClientAuthorization,
|
|
8523
8852
|
getHubspotClientConfig,
|
|
8524
8853
|
getIntegrationFlowUrl,
|
|
8525
8854
|
getIntegrationFlowUrlForRedirection,
|
|
8526
8855
|
getLiveChatClientConfig,
|
|
8856
|
+
getMailchimpClientAuthorization,
|
|
8527
8857
|
getMailchimpClientConfig,
|
|
8528
8858
|
getMailchimpClientUrl,
|
|
8529
8859
|
getNeonClientConfig,
|
|
8860
|
+
getNetlifyClientAuthorization,
|
|
8530
8861
|
getNetlifyClientConfig,
|
|
8531
8862
|
getPlanetScaleClientConfig,
|
|
8532
8863
|
getRegion,
|
|
8864
|
+
getShopifyClientAuthorization,
|
|
8533
8865
|
getShopifyClientConfig,
|
|
8534
8866
|
getShopifyClientUrl,
|
|
8867
|
+
getSlackClientAuthorization,
|
|
8535
8868
|
getSlackClientConfig,
|
|
8869
|
+
getTextClientAuthorization,
|
|
8536
8870
|
getTextClientConfig,
|
|
8871
|
+
getVercelClientAuthorization,
|
|
8537
8872
|
getVercelClientConfig,
|
|
8538
8873
|
githubClientInstance,
|
|
8539
8874
|
helpdeskClientInstance,
|
|
@@ -8543,6 +8878,7 @@ function getIntegrationFlowUrl(name, flow, trigger, context, state, config) {
|
|
|
8543
8878
|
initApi,
|
|
8544
8879
|
initBigCommerceClient,
|
|
8545
8880
|
initBillingClient,
|
|
8881
|
+
initConsoleClient,
|
|
8546
8882
|
initDpsClient,
|
|
8547
8883
|
initGithubClient,
|
|
8548
8884
|
initHelpDeskClient,
|
|
@@ -8575,6 +8911,7 @@ function getIntegrationFlowUrl(name, flow, trigger, context, state, config) {
|
|
|
8575
8911
|
textLivechatEventsZods,
|
|
8576
8912
|
updateAdapterClient,
|
|
8577
8913
|
updateBigCommerceClient,
|
|
8914
|
+
updateConsoleClient,
|
|
8578
8915
|
updateGithubClient,
|
|
8579
8916
|
updateHubspotClient,
|
|
8580
8917
|
updateMailchimpClient,
|