@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.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: () => getRegion2,
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 import_axios24 = __toESM(require("axios"));
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 = import_axios24.default.create({
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 import_axios25 = __toESM(require("axios"));
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 = import_axios25.default.create({
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 import_axios26 = __toESM(require("axios"));
4036
- var REGION2 = {
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 supportedRegions2 = Object.values(REGION2);
4043
- var getRegion2 = (token) => {
4335
+ var supportedRegions3 = Object.values(REGION3);
4336
+ var getRegion3 = (token) => {
4044
4337
  const region = token.split(":")[0];
4045
- if (supportedRegions2.includes(region)) {
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 = import_axios26.default.create({
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 ? getRegion2(token) : void 0;
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 import_axios27 = __toESM(require("axios"));
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 import_axios27.default.post("https://api.vercel.com/v2/oauth/access_token", data, {
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/app/blocks/authorization/api.ts
5398
- var platformAdapterAppAuthorizationApi = {
5399
- get(appId, authorization) {
5400
- return __async(this, null, function* () {
5401
- return adapterClientInstance.get(
5402
- `/console/app/${encodeURIComponent(appId)}/blocks/authorization`,
5403
- getAdapterClientDefaultConfig(authorization)
5404
- );
5405
- });
5406
- },
5407
- add(payload, authorization) {
5408
- return __async(this, null, function* () {
5409
- return adapterClientInstance.post(
5410
- `/console/app/${encodeURIComponent(payload.appId)}/blocks/authorization`,
5411
- payload,
5412
- getAdapterClientDefaultConfig(authorization)
5413
- );
5414
- });
5415
- },
5416
- update(payload, authorization) {
5417
- return __async(this, null, function* () {
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/app/blocks/deployment/api.ts
5436
- var platformAdapterAppDeploymentApi = {
5437
- getAggregate(appId, authorization) {
5438
- return __async(this, null, function* () {
5439
- return adapterClientInstance.get(
5440
- `/console/app/${encodeURIComponent(appId)}/blocks/deployment/aggregate`,
5441
- getAdapterClientDefaultConfig(authorization)
5442
- );
5443
- });
5444
- },
5445
- get(appId, authorization) {
5446
- return __async(this, null, function* () {
5447
- return adapterClientInstance.get(
5448
- `/console/app/${encodeURIComponent(appId)}/blocks/deployment`,
5449
- getAdapterClientDefaultConfig(authorization)
5450
- );
5451
- });
5452
- },
5453
- link(payload, authorization) {
5454
- return __async(this, null, function* () {
5455
- return adapterClientInstance.put(
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/app/blocks/monetization/api.ts
5486
- var platformAdapterAppMonetizationApi = {
5487
- get(appId, authorization) {
5488
- return __async(this, null, function* () {
5489
- return adapterClientInstance.get(
5490
- `/console/app/${encodeURIComponent(appId)}/blocks/monetization`,
5491
- getAdapterClientDefaultConfig(authorization)
5492
- );
5493
- });
5494
- },
5495
- upsert(payload, authorization) {
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
- return adapterClientInstance.post(
5498
- `/console/app/${encodeURIComponent(payload.appId)}/blocks/monetization`,
5499
- payload,
5500
- getAdapterClientDefaultConfig(authorization)
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
- remove(payload, authorization) {
5886
+ getAccountInfo(product, authorization) {
5505
5887
  return __async(this, null, function* () {
5506
- return adapterClientInstance.delete(
5507
- `/console/app/${encodeURIComponent(payload.appId)}/blocks/monetization`,
5508
- getAdapterClientDefaultConfig(authorization)
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/adapter/app/blocks/properties/property/api.ts
5515
- var platformAdapterAppPropertyApi = {
5516
- get(appId, propertyId, authorization) {
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
- return adapterClientInstance.post(
5529
- `/console/app/${encodeURIComponent(
5530
- payload.appId
5531
- )}/blocks/properties/${encodeURIComponent(payload.propertyId)}`,
5532
- payload,
5533
- getAdapterClientDefaultConfig(authorization)
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
- remove(payload, authorization) {
5924
+ downloadInvoices(number, authorization) {
5538
5925
  return __async(this, null, function* () {
5539
- return adapterClientInstance.delete(
5540
- `/console/app/${encodeURIComponent(payload.appId)}/blocks/properties/${payload.propertyId}`,
5541
- getAdapterClientDefaultConfig(authorization)
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/adapter/app/blocks/properties/api.ts
5548
- var platformAdapterAppPropertiesApi = {
5549
- property: platformAdapterAppPropertyApi,
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 adapterClientInstance.get(
5553
- `/console/app/${encodeURIComponent(appId)}/blocks/properties`,
5554
- getAdapterClientDefaultConfig(authorization)
5966
+ return consoleClientInstance.get(
5967
+ `/app/${encodeURIComponent(appId)}/blocks/authorization`,
5968
+ getConsoleClientDefaultConfig(authorization)
5555
5969
  );
5556
5970
  });
5557
5971
  },
5558
- upsert(payload, authorization) {
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 adapterClientInstance.post(
5561
- `/console/app/${encodeURIComponent(payload.appId)}/blocks/properties`,
5983
+ return consoleClientInstance.put(
5984
+ `/app/${encodeURIComponent(payload.appId)}/blocks/authorization`,
5562
5985
  payload,
5563
- getAdapterClientDefaultConfig(authorization)
5986
+ getConsoleClientDefaultConfig(authorization)
5564
5987
  );
5565
5988
  });
5566
5989
  },
5567
5990
  remove(payload, authorization) {
5568
5991
  return __async(this, null, function* () {
5569
- return adapterClientInstance.delete(
5570
- `/console/app/${encodeURIComponent(payload.appId)}/blocks/properties`,
5571
- getAdapterClientDefaultConfig(authorization)
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/adapter/app/blocks/repository/api.ts
5578
- var platformAdapterAppRepositoryApi = {
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 adapterClientInstance.get(
5582
- `/console/app/${encodeURIComponent(appId)}/blocks/repository/aggregate`,
5583
- getAdapterClientDefaultConfig(authorization)
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 adapterClientInstance.get(
5590
- `/console/app/${encodeURIComponent(appId)}/blocks/repository`,
5591
- getAdapterClientDefaultConfig(authorization)
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 adapterClientInstance.put(
5598
- `/console/app/${encodeURIComponent(payload.appId)}/blocks/repository`,
6020
+ return consoleClientInstance.put(
6021
+ `/app/${encodeURIComponent(payload.appId)}/blocks/deployment`,
5599
6022
  payload,
5600
- getAdapterClientDefaultConfig(authorization)
6023
+ getConsoleClientDefaultConfig(authorization)
5601
6024
  );
5602
6025
  });
5603
6026
  },
5604
6027
  unlink(payload, authorization) {
5605
6028
  return __async(this, null, function* () {
5606
- return adapterClientInstance.delete(
5607
- `/console/app/${encodeURIComponent(
6029
+ return consoleClientInstance.delete(
6030
+ `/app/${encodeURIComponent(
5608
6031
  payload.appId
5609
- )}/blocks/repository?${new URLSearchParams(
6032
+ )}/blocks/deployment?${new URLSearchParams(
5610
6033
  payload
5611
6034
  ).toString()}`,
5612
- getAdapterClientDefaultConfig(authorization)
6035
+ getConsoleClientDefaultConfig(authorization)
5613
6036
  );
5614
6037
  });
5615
6038
  },
5616
6039
  upsert(payload, authorization) {
5617
6040
  return __async(this, null, function* () {
5618
- return adapterClientInstance.patch(
5619
- `/console/app/${encodeURIComponent(payload.appId)}/blocks/repository`,
6041
+ return consoleClientInstance.patch(
6042
+ `/app/${encodeURIComponent(payload.appId)}/blocks/deployment`,
5620
6043
  payload,
5621
- getAdapterClientDefaultConfig(authorization)
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/adapter/app/blocks/storage/api.ts
5639
- var platformAdapterAppStorageApi = {
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 adapterClientInstance.get(
5651
- `/console/app/${encodeURIComponent(appId)}/blocks/storage`,
5652
- getAdapterClientDefaultConfig(authorization)
6054
+ return consoleClientInstance.get(
6055
+ `/app/${encodeURIComponent(appId)}/blocks/monetization`,
6056
+ getConsoleClientDefaultConfig(authorization)
5653
6057
  );
5654
6058
  });
5655
6059
  },
5656
- link(payload, authorization) {
6060
+ upsert(payload, authorization) {
5657
6061
  return __async(this, null, function* () {
5658
- return adapterClientInstance.put(
5659
- `/console/app/${encodeURIComponent(payload.appId)}/blocks/storage`,
6062
+ return consoleClientInstance.post(
6063
+ `/app/${encodeURIComponent(payload.appId)}/blocks/monetization`,
5660
6064
  payload,
5661
- getAdapterClientDefaultConfig(authorization)
6065
+ getConsoleClientDefaultConfig(authorization)
5662
6066
  );
5663
6067
  });
5664
6068
  },
5665
- unlink(payload, authorization) {
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 adapterClientInstance.patch(
5680
- `/console/app/${encodeURIComponent(payload.appId)}/blocks/storage`,
5681
- payload,
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/adapter/app/blocks/widgets/widget/api.ts
5689
- var platformAdapterAppWidgetApi = {
5690
- get(appId, widgetId, authorization) {
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 adapterClientInstance.get(
5693
- `/console/app/${encodeURIComponent(
6083
+ return consoleClientInstance.get(
6084
+ `/app/${encodeURIComponent(
5694
6085
  appId
5695
- )}/blocks/widgets/${encodeURIComponent(widgetId)}`,
5696
- getAdapterClientDefaultConfig(authorization)
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 adapterClientInstance.post(
5703
- `/console/app/${encodeURIComponent(
6093
+ return consoleClientInstance.post(
6094
+ `/app/${encodeURIComponent(
5704
6095
  payload.appId
5705
- )}/blocks/widgets/${encodeURIComponent(payload.widgetId)}`,
6096
+ )}/blocks/properties/${encodeURIComponent(payload.propertyId)}`,
5706
6097
  payload,
5707
- getAdapterClientDefaultConfig(authorization)
6098
+ getConsoleClientDefaultConfig(authorization)
5708
6099
  );
5709
6100
  });
5710
6101
  },
5711
6102
  remove(payload, authorization) {
5712
6103
  return __async(this, null, function* () {
5713
- return adapterClientInstance.delete(
5714
- `/console/app/${encodeURIComponent(
5715
- payload.appId
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/adapter/app/blocks/widgets/api.ts
5724
- var platformAdapterAppWidgetsApi = {
5725
- widget: platformAdapterAppWidgetApi,
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 adapterClientInstance.get(
5729
- `/console/app/${encodeURIComponent(appId)}/blocks/widgets`,
5730
- getAdapterClientDefaultConfig(authorization)
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 adapterClientInstance.post(
5737
- `/console/app/${encodeURIComponent(payload.appId)}/blocks/widgets`,
6125
+ return consoleClientInstance.post(
6126
+ `/app/${encodeURIComponent(payload.appId)}/blocks/properties`,
5738
6127
  payload,
5739
- getAdapterClientDefaultConfig(authorization)
6128
+ getConsoleClientDefaultConfig(authorization)
5740
6129
  );
5741
6130
  });
5742
6131
  },
5743
6132
  remove(payload, authorization) {
5744
6133
  return __async(this, null, function* () {
5745
- return adapterClientInstance.delete(
5746
- `/console/app/${encodeURIComponent(payload.appId)}/blocks/widgets`,
5747
- getAdapterClientDefaultConfig(authorization)
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/adapter/app/blocks/api.ts
5754
- var platformAdapterAppBlocksApi = {
5755
- authorization: platformAdapterAppAuthorizationApi,
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 adapterClientInstance.get(
5769
- "/console/app/templates",
5770
- getAdapterClientDefaultConfig(authorization)
6146
+ return consoleClientInstance.get(
6147
+ `/app/${encodeURIComponent(appId)}/blocks/repository/aggregate`,
6148
+ getConsoleClientDefaultConfig(authorization)
5771
6149
  );
5772
6150
  });
5773
6151
  },
5774
- getRepositoryTemplates(authorization) {
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
- const response = yield adapterClientInstance.get(
5789
- `/console/app/${encodeURIComponent(appId)}/variables`,
5790
- __spreadValues({
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
- getVariable(appId, key, authorization) {
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
- yield adapterClientInstance.post(
5813
- `/console/app/${encodeURIComponent(appId)}/variables/${encodeURIComponent(
5814
- key
5815
- )}/sync`,
6162
+ return consoleClientInstance.put(
6163
+ `/app/${encodeURIComponent(payload.appId)}/blocks/repository`,
5816
6164
  payload,
5817
- getAdapterClientDefaultConfig(authorization)
6165
+ getConsoleClientDefaultConfig(authorization)
5818
6166
  );
5819
6167
  });
5820
6168
  },
5821
- createVariable(appId, data, authorization) {
6169
+ unlink(payload, authorization) {
5822
6170
  return __async(this, null, function* () {
5823
- yield adapterClientInstance.post(
5824
- `/console/app/${encodeURIComponent(appId)}/variables/${encodeURIComponent(
5825
- data.key
5826
- )}`,
5827
- data,
5828
- getAdapterClientDefaultConfig(authorization)
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
- editVariable(appId, data, authorization) {
6181
+ upsert(payload, authorization) {
5833
6182
  return __async(this, null, function* () {
5834
- yield adapterClientInstance.post(
5835
- `/console/app/${encodeURIComponent(appId)}/variables/${encodeURIComponent(
5836
- data.key
5837
- )}/edit`,
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
- deleteVariable(appId, key) {
6190
+ seed(payload, authorization) {
5844
6191
  return __async(this, null, function* () {
5845
- yield adapterClientInstance.delete(
5846
- `/console/app/${encodeURIComponent(appId)}/variables/${encodeURIComponent(
5847
- key
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/adapter/app/api.ts
5855
- var platformAdapterAppApi = {
5856
- blocks: platformAdapterAppBlocksApi,
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 adapterClientInstance.post(
5862
- `/console/app${payload.manifest.id ? `/${encodeURIComponent(payload.manifest.id)}` : ""}`,
5863
- payload,
5864
- getAdapterClientDefaultConfig(authorization)
6205
+ return consoleClientInstance.get(
6206
+ `/app/${encodeURIComponent(appId)}/blocks/storage/aggregate`,
6207
+ getConsoleClientDefaultConfig(authorization)
5865
6208
  );
5866
6209
  });
5867
6210
  },
5868
- pull(appId, authorization) {
6211
+ get(appId, authorization) {
5869
6212
  return __async(this, null, function* () {
5870
- return adapterClientInstance.get(
5871
- `/console/app/${encodeURIComponent(appId)}`,
5872
- getAdapterClientDefaultConfig(authorization)
6213
+ return consoleClientInstance.get(
6214
+ `/app/${encodeURIComponent(appId)}/blocks/storage`,
6215
+ getConsoleClientDefaultConfig(authorization)
5873
6216
  );
5874
6217
  });
5875
6218
  },
5876
- verify(payload, authorization) {
6219
+ link(payload, authorization) {
5877
6220
  return __async(this, null, function* () {
5878
- return adapterClientInstance.post(
5879
- `/console/app/${encodeURIComponent(payload.appId)}/verify`,
6221
+ return consoleClientInstance.put(
6222
+ `/app/${encodeURIComponent(payload.appId)}/blocks/storage`,
5880
6223
  payload,
5881
- getAdapterClientDefaultConfig(authorization)
6224
+ getConsoleClientDefaultConfig(authorization)
5882
6225
  );
5883
6226
  });
5884
6227
  },
5885
- status(sagaId, authorization) {
6228
+ unlink(payload, authorization) {
5886
6229
  return __async(this, null, function* () {
5887
- return adapterClientInstance.get(
5888
- "/console/app/status",
5889
- __spreadValues({
5890
- params: {
5891
- sagaId
5892
- }
5893
- }, getAdapterClientDefaultConfig(authorization))
5894
- );
5895
- });
5896
- }
5897
- };
5898
-
5899
- // src/apis/platform/adapter/integrations/bigcommerce/api.ts
5900
- var platformAdapterBigCommerceApi = {
5901
- events: {
5902
- subscribe(payload, authorization) {
5903
- return __async(this, null, function* () {
5904
- yield adapterClientInstance.post(
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/adapter/integrations/slack/api.ts
5996
- var platformAdapterSlackApi = {
5997
- events: {
5998
- subscribe(payload, authorization) {
5999
- return __async(this, null, function* () {
6000
- yield adapterClientInstance.post(
6001
- "/integrations/slack/events/subscribe",
6002
- payload,
6003
- getSlackClientConfig(authorization)
6004
- );
6005
- });
6006
- },
6007
- unsubscribe(payload, authorization) {
6008
- return __async(this, null, function* () {
6009
- yield adapterClientInstance.post(
6010
- "/integrations/slack/events/unsubscribe",
6011
- payload,
6012
- getSlackClientConfig(authorization)
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/adapter/integrations/text/api.ts
6020
- var platformAdapterTextApi = {
6021
- events: {
6022
- subscribe(payload, authorization) {
6023
- return __async(this, null, function* () {
6024
- yield adapterClientInstance.post(
6025
- "/integrations/text/events/subscribe",
6026
- payload,
6027
- getTextClientConfig(authorization)
6028
- );
6029
- });
6030
- },
6031
- unsubscribe(payload, authorization) {
6032
- return __async(this, null, function* () {
6033
- yield adapterClientInstance.post(
6034
- "/integrations/text/events/unsubscribe",
6035
- payload,
6036
- getTextClientConfig(authorization)
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/adapter/integrations/api.ts
6044
- var platformAdapterIntegrationsApi = {
6045
- mailchimp: platformAdapterMailchimpApi,
6046
- shopify: platformAdapterShopifyApi,
6047
- hubspot: platformAdapterHubspotApi,
6048
- slack: platformAdapterSlackApi,
6049
- bigcommerce: platformAdapterBigCommerceApi,
6050
- text: platformAdapterTextApi
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/adapter/api.ts
6054
- var platformAdapterApi = {
6055
- app: platformAdapterAppApi,
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 adapterClientInstance.post(
6060
- "/log",
6061
- payload,
6062
- getAdapterClientConfig(authorization)
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/billing/account/api.ts
6069
- var platformBillingAccountApi = {
6070
- getAccount(authorization) {
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
- try {
6073
- return yield billingClientInstance.get(
6074
- "/v3/account",
6075
- getBillingClientConfig(authorization)
6076
- );
6077
- } catch (error) {
6078
- if (error instanceof Error) {
6079
- throw new Error(`Account couldn't be fetched. [${error.message}]`);
6080
- } else {
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
- getAccountInfo(product, authorization) {
6362
+ getVariable(appId, key, authorization) {
6087
6363
  return __async(this, null, function* () {
6088
- try {
6089
- return yield billingClientInstance.get(
6090
- `/v3/account/${encodeURIComponent(product)}/billing_info`,
6091
- getBillingClientConfig(authorization)
6092
- );
6093
- } catch (error) {
6094
- if (error instanceof Error) {
6095
- throw new Error(
6096
- `Account billing info couldn't be fetched. [${error.message}]`
6097
- );
6098
- } else {
6099
- throw error;
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/billing/invoices/api.ts
6107
- var platformBillingInvoicesApi = {
6108
- getInvoices(product, authorization) {
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
- try {
6111
- return yield billingClientInstance.get(
6112
- `/v2/invoices/${encodeURIComponent(product)}`,
6113
- getBillingClientConfig(authorization)
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
- downloadInvoices(number, authorization) {
6427
+ pull(appId, authorization) {
6125
6428
  return __async(this, null, function* () {
6126
- try {
6127
- const response = yield billingClientInstance.request(__spreadValues({
6128
- url: `https://api.labs.livechatinc.com/v2/invoices/${encodeURIComponent(
6129
- number
6130
- )}`,
6131
- data: new URLSearchParams({
6132
- _method: "GET"
6133
- //gave the values directly for testing
6134
- }),
6135
- responseType: "blob"
6136
- }, getBillingClientConfig(authorization)));
6137
- const href = URL.createObjectURL(response.data);
6138
- const link = document.createElement("a");
6139
- link.href = href;
6140
- link.setAttribute("download", `invoice-${number}.pdf`);
6141
- document.body.appendChild(link);
6142
- link.click();
6143
- document.body.removeChild(link);
6144
- URL.revokeObjectURL(href);
6145
- } catch (error) {
6146
- if (error instanceof Error) {
6147
- throw new Error(`Invoice couldn't be downloaded. [${error.message}]`);
6148
- } else {
6149
- throw error;
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/billing/api.ts
6157
- var platformBillingApi = {
6158
- account: platformBillingAccountApi,
6159
- invoices: platformBillingInvoicesApi
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
- initLiveChatClient((_h = config.urls.products) == null ? void 0 : _h.livechat, (_i = tokens == null ? void 0 : tokens.platform) == null ? void 0 : _i.token);
8400
- initHelpDeskClient((_j = config.urls.products) == null ? void 0 : _j.helpdesk, (_k = tokens == null ? void 0 : tokens.platform) == null ? void 0 : _k.token);
8401
- initTextClient((_l = config.urls.integrations) == null ? void 0 : _l.text, (_m = tokens == null ? void 0 : tokens.platform) == null ? void 0 : _m.token);
8402
- initGithubClient((_n = tokens == null ? void 0 : tokens.github) == null ? void 0 : _n.appToken);
8403
- initNetlifyClient((_o = tokens == null ? void 0 : tokens.netlify) == null ? void 0 : _o.token);
8404
- initVercelClient((_p = tokens == null ? void 0 : tokens.vercel) == null ? void 0 : _p.token);
8405
- initNeonClient((_q = tokens == null ? void 0 : tokens.neon) == null ? void 0 : _q.token);
8406
- initPlanetScaleClient((_r = tokens == null ? void 0 : tokens.planetscale) == null ? void 0 : _r.token);
8407
- initMailchimpClient((_s = tokens == null ? void 0 : tokens.mailchimp) == null ? void 0 : _s.token, (_t = tokens == null ? void 0 : tokens.mailchimp) == null ? void 0 : _t.server);
8408
- initShopifyClient((_u = tokens == null ? void 0 : tokens.shopify) == null ? void 0 : _u.token, (_v = tokens == null ? void 0 : tokens.shopify) == null ? void 0 : _v.shop);
8409
- initBigCommerceClient((_w = tokens == null ? void 0 : tokens.bigcommerce) == null ? void 0 : _w.token, (_x = tokens == null ? void 0 : tokens.bigcommerce) == null ? void 0 : _x.shop);
8410
- initHubspotClient((_y = tokens == null ? void 0 : tokens.hubspot) == null ? void 0 : _y.token);
8411
- initSlackClient((_z = tokens == null ? void 0 : tokens.slack) == null ? void 0 : _z.token);
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,