@livechat/developer-studio-api 5.2.0-generator-beta-v1.0 → 5.3.0-beta.v1
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/chunk-WMWSKU4M.mjs +9833 -0
- package/dist/events-DAbR7Qk8.d.mts +13050 -0
- package/dist/events-DAbR7Qk8.d.ts +13050 -0
- package/dist/index.d.mts +474 -13490
- package/dist/index.d.ts +474 -13490
- package/dist/index.js +480 -467
- package/dist/index.mjs +194 -9627
- package/dist/workflow-contracts.d.mts +5 -0
- package/dist/workflow-contracts.d.ts +5 -0
- package/dist/workflow-contracts.js +2277 -0
- package/dist/workflow-contracts.mjs +52 -0
- package/package.json +17 -3
package/dist/index.js
CHANGED
|
@@ -152,7 +152,6 @@ __export(src_exports, {
|
|
|
152
152
|
cdpCustomerEventMessageZod: () => cdpCustomerEventMessageZod,
|
|
153
153
|
consoleClientInstance: () => consoleClientInstance,
|
|
154
154
|
dpsClientInstance: () => dpsClientInstance,
|
|
155
|
-
enrichWorkflowTrigger: () => enrichWorkflowTrigger,
|
|
156
155
|
extractTokenFromAuthorizationHeader: () => extractTokenFromAuthorizationHeader,
|
|
157
156
|
getAdapterClientConfig: () => getAdapterClientConfig,
|
|
158
157
|
getAdapterClientDefaultConfig: () => getAdapterClientDefaultConfig,
|
|
@@ -226,7 +225,6 @@ __export(src_exports, {
|
|
|
226
225
|
integrationSubscriptionZods: () => integrationSubscriptionZods,
|
|
227
226
|
isFilter: () => isFilter,
|
|
228
227
|
isFilterGroup: () => isFilterGroup,
|
|
229
|
-
isWorkflowBaseHttpTaskCore: () => isWorkflowBaseHttpTaskCore,
|
|
230
228
|
livechatClientInstance: () => livechatClientInstance,
|
|
231
229
|
mailchimpClientInstance: () => mailchimpClientInstance,
|
|
232
230
|
mailchimpEventsZods: () => mailchimpEventsZods,
|
|
@@ -877,7 +875,7 @@ var textCustomerEventsZods = {
|
|
|
877
875
|
properties: import_zod7.z.array(
|
|
878
876
|
import_zod7.z.object({
|
|
879
877
|
id: import_zod7.z.string().min(1),
|
|
880
|
-
to: import_zod7.z.union([import_zod7.z.string(), import_zod7.z.number(), import_zod7.z.boolean()]).
|
|
878
|
+
to: import_zod7.z.union([import_zod7.z.string(), import_zod7.z.number(), import_zod7.z.boolean()]).nullish()
|
|
881
879
|
})
|
|
882
880
|
).optional()
|
|
883
881
|
})
|
|
@@ -994,8 +992,8 @@ var textHelpDeskEventsZods = {
|
|
|
994
992
|
customFields: import_zod8.z.array(
|
|
995
993
|
import_zod8.z.object({
|
|
996
994
|
id: import_zod8.z.string().min(1),
|
|
997
|
-
from: import_zod8.z.string().min(1).
|
|
998
|
-
to: import_zod8.z.string().min(1).
|
|
995
|
+
from: import_zod8.z.string().min(1).nullish(),
|
|
996
|
+
to: import_zod8.z.string().min(1).nullish()
|
|
999
997
|
})
|
|
1000
998
|
).optional()
|
|
1001
999
|
}).extend(baseFiltersZod.shape),
|
|
@@ -2264,11 +2262,35 @@ var hubspotApi = {
|
|
|
2264
2262
|
}
|
|
2265
2263
|
};
|
|
2266
2264
|
|
|
2265
|
+
// src/apis/integrations/klaviyo/api.ts
|
|
2266
|
+
var import_axios7 = __toESM(require("axios"));
|
|
2267
|
+
var KLAVIYO_API_REVISION = "2025-07-15";
|
|
2268
|
+
var klaviyoApi = {
|
|
2269
|
+
getAccount(_0) {
|
|
2270
|
+
return __async(this, arguments, function* ({ token }) {
|
|
2271
|
+
var _a, _b, _c, _d;
|
|
2272
|
+
const { data } = yield import_axios7.default.get(
|
|
2273
|
+
"https://a.klaviyo.com/api/accounts/",
|
|
2274
|
+
{
|
|
2275
|
+
headers: {
|
|
2276
|
+
Authorization: `Bearer ${token}`,
|
|
2277
|
+
revision: KLAVIYO_API_REVISION
|
|
2278
|
+
}
|
|
2279
|
+
}
|
|
2280
|
+
);
|
|
2281
|
+
const contactInformationEmail = (_d = (_c = (_b = (_a = data.data) == null ? void 0 : _a[0]) == null ? void 0 : _b.attributes) == null ? void 0 : _c.contact_information) == null ? void 0 : _d.default_sender_email;
|
|
2282
|
+
return {
|
|
2283
|
+
email: contactInformationEmail
|
|
2284
|
+
};
|
|
2285
|
+
});
|
|
2286
|
+
}
|
|
2287
|
+
};
|
|
2288
|
+
|
|
2267
2289
|
// src/apis/integrations/mailchimp/api.ts
|
|
2268
|
-
var
|
|
2290
|
+
var import_axios9 = __toESM(require("axios"));
|
|
2269
2291
|
|
|
2270
2292
|
// src/apis/integrations/mailchimp/instance.ts
|
|
2271
|
-
var
|
|
2293
|
+
var import_axios8 = __toESM(require("axios"));
|
|
2272
2294
|
function getMailchimpClientAuthorization(req, authorization) {
|
|
2273
2295
|
var _a, _b;
|
|
2274
2296
|
const headerPrefix = "x-adapter-mailchimp";
|
|
@@ -2298,7 +2320,7 @@ var MailchimpApiError = class extends ApiErrorBase {
|
|
|
2298
2320
|
}
|
|
2299
2321
|
};
|
|
2300
2322
|
var getMailchimpClientUrl = (server) => `https://${server}.api.mailchimp.com/3.0`;
|
|
2301
|
-
var mailchimpClientInstance =
|
|
2323
|
+
var mailchimpClientInstance = import_axios8.default.create({
|
|
2302
2324
|
headers: {
|
|
2303
2325
|
"Content-Type": "application/json"
|
|
2304
2326
|
}
|
|
@@ -2307,7 +2329,7 @@ mailchimpClientInstance.interceptors.response.use(
|
|
|
2307
2329
|
(r) => r,
|
|
2308
2330
|
(error) => {
|
|
2309
2331
|
var _a, _b, _c, _d;
|
|
2310
|
-
if (
|
|
2332
|
+
if (import_axios8.default.isAxiosError(error)) {
|
|
2311
2333
|
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
2312
2334
|
throw new UnauthorizeApiError("mailchimp");
|
|
2313
2335
|
}
|
|
@@ -2412,7 +2434,7 @@ var mailchimpApi = {
|
|
|
2412
2434
|
redirect_uri: redirectUri,
|
|
2413
2435
|
grant_type: "authorization_code"
|
|
2414
2436
|
});
|
|
2415
|
-
const tokenResponse = yield
|
|
2437
|
+
const tokenResponse = yield import_axios9.default.post(
|
|
2416
2438
|
"https://login.mailchimp.com/oauth2/token",
|
|
2417
2439
|
data,
|
|
2418
2440
|
{
|
|
@@ -2432,7 +2454,7 @@ var mailchimpApi = {
|
|
|
2432
2454
|
getMetadata(_0) {
|
|
2433
2455
|
return __async(this, arguments, function* ({ token }) {
|
|
2434
2456
|
var _a, _b, _c, _d;
|
|
2435
|
-
const { data } = yield
|
|
2457
|
+
const { data } = yield import_axios9.default.get("https://login.mailchimp.com/oauth2/metadata", {
|
|
2436
2458
|
headers: {
|
|
2437
2459
|
"Content-Type": "application/json",
|
|
2438
2460
|
Authorization: `OAuth ${token}`
|
|
@@ -2448,11 +2470,11 @@ var mailchimpApi = {
|
|
|
2448
2470
|
};
|
|
2449
2471
|
|
|
2450
2472
|
// src/apis/integrations/neon/api.ts
|
|
2451
|
-
var
|
|
2473
|
+
var import_axios11 = __toESM(require("axios"));
|
|
2452
2474
|
|
|
2453
2475
|
// src/apis/integrations/neon/instance.ts
|
|
2454
|
-
var
|
|
2455
|
-
var neonClientInstance =
|
|
2476
|
+
var import_axios10 = __toESM(require("axios"));
|
|
2477
|
+
var neonClientInstance = import_axios10.default.create({
|
|
2456
2478
|
baseURL: "https://console.neon.tech/api/v2",
|
|
2457
2479
|
headers: {
|
|
2458
2480
|
"Content-Type": "application/json"
|
|
@@ -2462,7 +2484,7 @@ neonClientInstance.interceptors.response.use(
|
|
|
2462
2484
|
(r) => r,
|
|
2463
2485
|
(error) => {
|
|
2464
2486
|
var _a;
|
|
2465
|
-
if (
|
|
2487
|
+
if (import_axios10.default.isAxiosError(error)) {
|
|
2466
2488
|
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
2467
2489
|
throw new UnauthorizeApiError("neon");
|
|
2468
2490
|
}
|
|
@@ -2739,7 +2761,7 @@ var neonApi = {
|
|
|
2739
2761
|
redirect_uri: redirectUri,
|
|
2740
2762
|
grant_type: "authorization_code"
|
|
2741
2763
|
});
|
|
2742
|
-
const response = yield
|
|
2764
|
+
const response = yield import_axios11.default.post(
|
|
2743
2765
|
"https://oauth2.neon.tech/oauth2/token",
|
|
2744
2766
|
data,
|
|
2745
2767
|
{
|
|
@@ -2764,7 +2786,7 @@ var neonApi = {
|
|
|
2764
2786
|
client_secret: clientSecret,
|
|
2765
2787
|
grant_type: "refresh_token"
|
|
2766
2788
|
});
|
|
2767
|
-
const response = yield
|
|
2789
|
+
const response = yield import_axios11.default.post("https://oauth2.neon.tech/oauth2/token", data, {
|
|
2768
2790
|
headers: {
|
|
2769
2791
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
2770
2792
|
}
|
|
@@ -2779,13 +2801,13 @@ var neonApi = {
|
|
|
2779
2801
|
};
|
|
2780
2802
|
|
|
2781
2803
|
// src/apis/integrations/netlify/api.ts
|
|
2782
|
-
var
|
|
2804
|
+
var import_axios14 = __toESM(require("axios"));
|
|
2783
2805
|
|
|
2784
2806
|
// src/apis/integrations/netlify/account/api.ts
|
|
2785
|
-
var
|
|
2807
|
+
var import_axios13 = require("axios");
|
|
2786
2808
|
|
|
2787
2809
|
// src/apis/integrations/netlify/instance.ts
|
|
2788
|
-
var
|
|
2810
|
+
var import_axios12 = __toESM(require("axios"));
|
|
2789
2811
|
function getNetlifyClientAuthorization(req, headerPrefix = "x-adapter-netlify-token") {
|
|
2790
2812
|
if (req.headers instanceof Headers) {
|
|
2791
2813
|
return {
|
|
@@ -2796,7 +2818,7 @@ function getNetlifyClientAuthorization(req, headerPrefix = "x-adapter-netlify-to
|
|
|
2796
2818
|
token: req.headers[`${headerPrefix}-token`]
|
|
2797
2819
|
};
|
|
2798
2820
|
}
|
|
2799
|
-
var netlifyClientInstance =
|
|
2821
|
+
var netlifyClientInstance = import_axios12.default.create({
|
|
2800
2822
|
baseURL: "https://api.netlify.com/api/v1",
|
|
2801
2823
|
headers: {
|
|
2802
2824
|
"Content-Type": "application/json"
|
|
@@ -2806,7 +2828,7 @@ netlifyClientInstance.interceptors.response.use(
|
|
|
2806
2828
|
(r) => r,
|
|
2807
2829
|
(error) => {
|
|
2808
2830
|
var _a;
|
|
2809
|
-
if (
|
|
2831
|
+
if (import_axios12.default.isAxiosError(error)) {
|
|
2810
2832
|
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
2811
2833
|
throw new UnauthorizeApiError("netlify");
|
|
2812
2834
|
}
|
|
@@ -2861,7 +2883,7 @@ var netlifyAccountApi = {
|
|
|
2861
2883
|
targetAccountId = yield this.getAccount(authorization);
|
|
2862
2884
|
}
|
|
2863
2885
|
if (!targetAccountId) {
|
|
2864
|
-
throw new
|
|
2886
|
+
throw new import_axios13.AxiosError("No account", "404");
|
|
2865
2887
|
}
|
|
2866
2888
|
const { data: envs } = yield netlifyClientInstance.get(
|
|
2867
2889
|
`/accounts/${encodeURIComponent(
|
|
@@ -2881,7 +2903,7 @@ var netlifyAccountApi = {
|
|
|
2881
2903
|
targetAccountId = yield this.getAccount(authorization);
|
|
2882
2904
|
}
|
|
2883
2905
|
if (!targetAccountId) {
|
|
2884
|
-
throw new
|
|
2906
|
+
throw new import_axios13.AxiosError("No account", "404");
|
|
2885
2907
|
}
|
|
2886
2908
|
const { data: envs } = yield netlifyClientInstance.get(
|
|
2887
2909
|
`/accounts/${encodeURIComponent(
|
|
@@ -2902,7 +2924,7 @@ var netlifyAccountApi = {
|
|
|
2902
2924
|
targetAccountId = yield this.getAccount(authorization);
|
|
2903
2925
|
}
|
|
2904
2926
|
if (!targetAccountId) {
|
|
2905
|
-
throw new
|
|
2927
|
+
throw new import_axios13.AxiosError("No account", "404");
|
|
2906
2928
|
}
|
|
2907
2929
|
if (!targetEnvs) {
|
|
2908
2930
|
const response = yield netlifyClientInstance.get(
|
|
@@ -2954,7 +2976,7 @@ var netlifyAccountApi = {
|
|
|
2954
2976
|
targetAccountId = yield this.getAccount(authorization);
|
|
2955
2977
|
}
|
|
2956
2978
|
if (!targetAccountId) {
|
|
2957
|
-
throw new
|
|
2979
|
+
throw new import_axios13.AxiosError("No account", "404");
|
|
2958
2980
|
}
|
|
2959
2981
|
yield netlifyClientInstance.delete(
|
|
2960
2982
|
`/accounts/${encodeURIComponent(
|
|
@@ -3271,7 +3293,7 @@ var netlifyApi = {
|
|
|
3271
3293
|
redirect_uri: redirectUri,
|
|
3272
3294
|
grant_type: "authorization_code"
|
|
3273
3295
|
});
|
|
3274
|
-
const response = yield
|
|
3296
|
+
const response = yield import_axios14.default.post(
|
|
3275
3297
|
"https://api.netlify.com/oauth/token",
|
|
3276
3298
|
data,
|
|
3277
3299
|
{
|
|
@@ -3289,11 +3311,11 @@ var netlifyApi = {
|
|
|
3289
3311
|
};
|
|
3290
3312
|
|
|
3291
3313
|
// src/apis/integrations/openai/api.ts
|
|
3292
|
-
var
|
|
3314
|
+
var import_axios15 = __toESM(require("axios"));
|
|
3293
3315
|
var openaiApi = {
|
|
3294
3316
|
verifyToken(token) {
|
|
3295
3317
|
return __async(this, null, function* () {
|
|
3296
|
-
const response = yield
|
|
3318
|
+
const response = yield import_axios15.default.get("https://api.openai.com/v1/models", {
|
|
3297
3319
|
headers: {
|
|
3298
3320
|
Authorization: `Bearer ${token}`
|
|
3299
3321
|
}
|
|
@@ -3304,11 +3326,11 @@ var openaiApi = {
|
|
|
3304
3326
|
};
|
|
3305
3327
|
|
|
3306
3328
|
// src/apis/integrations/planetscale/api.ts
|
|
3307
|
-
var
|
|
3329
|
+
var import_axios17 = __toESM(require("axios"));
|
|
3308
3330
|
|
|
3309
3331
|
// src/apis/integrations/planetscale/instance.ts
|
|
3310
|
-
var
|
|
3311
|
-
var planetScaleClientInstance =
|
|
3332
|
+
var import_axios16 = __toESM(require("axios"));
|
|
3333
|
+
var planetScaleClientInstance = import_axios16.default.create({
|
|
3312
3334
|
baseURL: "https://api.planetscale.com",
|
|
3313
3335
|
headers: {
|
|
3314
3336
|
"Content-Type": "application/json"
|
|
@@ -3318,7 +3340,7 @@ planetScaleClientInstance.interceptors.response.use(
|
|
|
3318
3340
|
(r) => r,
|
|
3319
3341
|
(error) => {
|
|
3320
3342
|
var _a;
|
|
3321
|
-
if (
|
|
3343
|
+
if (import_axios16.default.isAxiosError(error)) {
|
|
3322
3344
|
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
3323
3345
|
throw new UnauthorizeApiError("planetscale");
|
|
3324
3346
|
}
|
|
@@ -3533,7 +3555,7 @@ var planetscaleApi = {
|
|
|
3533
3555
|
redirect_uri: redirectUrl,
|
|
3534
3556
|
grant_type: "authorization_code"
|
|
3535
3557
|
});
|
|
3536
|
-
const response = yield
|
|
3558
|
+
const response = yield import_axios17.default.post(
|
|
3537
3559
|
`https://api.planetscale.com/v1/organizations/${encodeURIComponent(
|
|
3538
3560
|
organization
|
|
3539
3561
|
)}/oauth-applications/${encodeURIComponent(applicationId)}/token`,
|
|
@@ -3555,14 +3577,14 @@ var planetscaleApi = {
|
|
|
3555
3577
|
};
|
|
3556
3578
|
|
|
3557
3579
|
// src/apis/integrations/salesforce/api.ts
|
|
3558
|
-
var
|
|
3580
|
+
var import_axios18 = __toESM(require("axios"));
|
|
3559
3581
|
var salesforceApi = {
|
|
3560
3582
|
getUserInfo(_0) {
|
|
3561
3583
|
return __async(this, arguments, function* ({
|
|
3562
3584
|
token,
|
|
3563
3585
|
loginUrl
|
|
3564
3586
|
}) {
|
|
3565
|
-
const { data } = yield
|
|
3587
|
+
const { data } = yield import_axios18.default.get(
|
|
3566
3588
|
`${loginUrl}/services/oauth2/userinfo`,
|
|
3567
3589
|
{
|
|
3568
3590
|
headers: {
|
|
@@ -3584,10 +3606,10 @@ var salesforceApi = {
|
|
|
3584
3606
|
};
|
|
3585
3607
|
|
|
3586
3608
|
// src/apis/integrations/shopify/api.ts
|
|
3587
|
-
var
|
|
3609
|
+
var import_axios20 = __toESM(require("axios"));
|
|
3588
3610
|
|
|
3589
3611
|
// src/apis/integrations/shopify/instance.ts
|
|
3590
|
-
var
|
|
3612
|
+
var import_axios19 = __toESM(require("axios"));
|
|
3591
3613
|
function getShopifyClientAuthorization(req, authorization) {
|
|
3592
3614
|
var _a, _b;
|
|
3593
3615
|
const headerPrefix = "x-adapter-shopify";
|
|
@@ -3616,12 +3638,12 @@ var ShopifyApiError = class extends ApiErrorBase {
|
|
|
3616
3638
|
this.name = "shopify";
|
|
3617
3639
|
}
|
|
3618
3640
|
};
|
|
3619
|
-
var shopifyClientInstance =
|
|
3641
|
+
var shopifyClientInstance = import_axios19.default.create();
|
|
3620
3642
|
shopifyClientInstance.interceptors.response.use(
|
|
3621
3643
|
(r) => r,
|
|
3622
3644
|
(error) => {
|
|
3623
3645
|
var _a, _b, _c, _d;
|
|
3624
|
-
if (
|
|
3646
|
+
if (import_axios19.default.isAxiosError(error)) {
|
|
3625
3647
|
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
3626
3648
|
throw new UnauthorizeApiError("shopify");
|
|
3627
3649
|
}
|
|
@@ -3725,7 +3747,7 @@ var shopifyApi = {
|
|
|
3725
3747
|
redirect_uri: redirectUri,
|
|
3726
3748
|
grant_type: "authorization_code"
|
|
3727
3749
|
});
|
|
3728
|
-
const response = yield
|
|
3750
|
+
const response = yield import_axios20.default.post(
|
|
3729
3751
|
`https://${encodeURIComponent(
|
|
3730
3752
|
shop
|
|
3731
3753
|
)}.myshopify.com/admin/oauth/access_token`,
|
|
@@ -3745,7 +3767,7 @@ var shopifyApi = {
|
|
|
3745
3767
|
};
|
|
3746
3768
|
|
|
3747
3769
|
// src/apis/integrations/slack/instance.ts
|
|
3748
|
-
var
|
|
3770
|
+
var import_axios21 = __toESM(require("axios"));
|
|
3749
3771
|
var SlackApiError = class extends ApiErrorBase {
|
|
3750
3772
|
constructor() {
|
|
3751
3773
|
super(...arguments);
|
|
@@ -3771,7 +3793,7 @@ function getSlackClientAuthorization(req, authorization) {
|
|
|
3771
3793
|
token: req.headers[`${headerPrefix}-token`]
|
|
3772
3794
|
};
|
|
3773
3795
|
}
|
|
3774
|
-
var slackClientInstance =
|
|
3796
|
+
var slackClientInstance = import_axios21.default.create({
|
|
3775
3797
|
baseURL: "https://slack.com/api",
|
|
3776
3798
|
headers: {
|
|
3777
3799
|
"Content-Type": "application/json"
|
|
@@ -3790,7 +3812,7 @@ slackClientInstance.interceptors.response.use(
|
|
|
3790
3812
|
},
|
|
3791
3813
|
(error) => {
|
|
3792
3814
|
var _a, _b, _c, _d;
|
|
3793
|
-
if (
|
|
3815
|
+
if (import_axios21.default.isAxiosError(error)) {
|
|
3794
3816
|
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
3795
3817
|
throw new UnauthorizeApiError("slack");
|
|
3796
3818
|
}
|
|
@@ -3874,7 +3896,7 @@ var slackApi = {
|
|
|
3874
3896
|
};
|
|
3875
3897
|
|
|
3876
3898
|
// src/apis/integrations/text/instance.ts
|
|
3877
|
-
var
|
|
3899
|
+
var import_axios22 = __toESM(require("axios"));
|
|
3878
3900
|
function getTextClientAuthorization(req, authorization) {
|
|
3879
3901
|
var _a;
|
|
3880
3902
|
const headerPrefix = "x-adapter-text";
|
|
@@ -3903,14 +3925,14 @@ var TextApiError = class extends ApiErrorBase {
|
|
|
3903
3925
|
this.name = "text";
|
|
3904
3926
|
}
|
|
3905
3927
|
};
|
|
3906
|
-
var textClientInstance =
|
|
3928
|
+
var textClientInstance = import_axios22.default.create({
|
|
3907
3929
|
baseURL: "https://api.labs.text.com"
|
|
3908
3930
|
});
|
|
3909
3931
|
textClientInstance.interceptors.response.use(
|
|
3910
3932
|
(r) => r,
|
|
3911
3933
|
(error) => {
|
|
3912
3934
|
var _a, _b, _c, _d;
|
|
3913
|
-
if (
|
|
3935
|
+
if (import_axios22.default.isAxiosError(error)) {
|
|
3914
3936
|
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
3915
3937
|
throw new UnauthorizeApiError("text");
|
|
3916
3938
|
}
|
|
@@ -4485,11 +4507,6 @@ var WorkflowExecutionTaskStatus = /* @__PURE__ */ ((WorkflowExecutionTaskStatus2
|
|
|
4485
4507
|
return WorkflowExecutionTaskStatus2;
|
|
4486
4508
|
})(WorkflowExecutionTaskStatus || {});
|
|
4487
4509
|
|
|
4488
|
-
// src/apis/integrations/text/platform/workflow/workflows/_contracts/dtos/tasks/http.ts
|
|
4489
|
-
function isWorkflowBaseHttpTaskCore(task) {
|
|
4490
|
-
return task.name === WorkflowTaskType.http;
|
|
4491
|
-
}
|
|
4492
|
-
|
|
4493
4510
|
// src/apis/integrations/text/platform/workflow/workflows/_contracts/dtos/tasks/switch/variants/condition.ts
|
|
4494
4511
|
var WorkflowConditionTaskLogic = /* @__PURE__ */ ((WorkflowConditionTaskLogic2) => {
|
|
4495
4512
|
WorkflowConditionTaskLogic2["AND"] = "AND";
|
|
@@ -4801,404 +4818,91 @@ function getWorkflowApiCrmConfig(authorization) {
|
|
|
4801
4818
|
});
|
|
4802
4819
|
}
|
|
4803
4820
|
|
|
4804
|
-
// src/apis/integrations/
|
|
4805
|
-
var
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
getWorkflowExecutions: (id, queryParams) => enrichUrlWithQueryParams(
|
|
4812
|
-
getUrl3(["workflows", id, "executions"]),
|
|
4813
|
-
queryParams
|
|
4814
|
-
),
|
|
4815
|
-
getWorkflowExecution: (id, executionId) => getUrl3(["workflows", id, "executions", executionId]),
|
|
4816
|
-
getWorkflowIntrospection: (id) => getUrl3(["workflows", id, "metadata"])
|
|
4817
|
-
};
|
|
4818
|
-
var textPlatformWorkflowsInternalCrmApi = {
|
|
4819
|
-
meta: {
|
|
4820
|
-
urls: urls4
|
|
4821
|
-
},
|
|
4822
|
-
getOrganizations(queryParams, authorization) {
|
|
4823
|
-
return __async(this, null, function* () {
|
|
4824
|
-
const { data: organizations } = yield textClientInstance.get(
|
|
4825
|
-
urls4.getOrganizations(queryParams),
|
|
4826
|
-
getWorkflowApiCrmConfig(authorization)
|
|
4827
|
-
);
|
|
4828
|
-
return organizations;
|
|
4829
|
-
});
|
|
4830
|
-
},
|
|
4831
|
-
getOrganization(organizationId, authorization) {
|
|
4832
|
-
return __async(this, null, function* () {
|
|
4833
|
-
const { data: organization } = yield textClientInstance.get(
|
|
4834
|
-
urls4.getOrganization(organizationId),
|
|
4835
|
-
getWorkflowApiCrmConfig(authorization)
|
|
4836
|
-
);
|
|
4837
|
-
return organization;
|
|
4838
|
-
});
|
|
4839
|
-
},
|
|
4840
|
-
getWorkflows(queryParams, authorization) {
|
|
4841
|
-
return __async(this, null, function* () {
|
|
4842
|
-
const { data: workflows } = yield textClientInstance.get(urls4.getWorkflows(queryParams), getWorkflowApiCrmConfig(authorization));
|
|
4843
|
-
workflows.data = workflows.data.map(enrichWorkflowTrigger);
|
|
4844
|
-
return workflows;
|
|
4845
|
-
});
|
|
4846
|
-
},
|
|
4847
|
-
getWorkflow(workflowId, authorization) {
|
|
4848
|
-
return __async(this, null, function* () {
|
|
4849
|
-
const searchParams = new URLSearchParams();
|
|
4850
|
-
const query = searchParams.toString();
|
|
4851
|
-
const { data: workflow } = yield textClientInstance.get(
|
|
4852
|
-
`${urls4.getWorkflow(workflowId)}${query ? `?${query}` : ""}`,
|
|
4853
|
-
getWorkflowApiCrmConfig(authorization)
|
|
4854
|
-
);
|
|
4855
|
-
return enrichWorkflowTrigger(workflow);
|
|
4856
|
-
});
|
|
4857
|
-
},
|
|
4858
|
-
getWorkflowExecutions(workflowId, queryParams, authorization) {
|
|
4859
|
-
return __async(this, null, function* () {
|
|
4860
|
-
const { data: executions } = yield textClientInstance.get(
|
|
4861
|
-
urls4.getWorkflowExecutions(workflowId, queryParams),
|
|
4862
|
-
getWorkflowApiCrmConfig(authorization)
|
|
4863
|
-
);
|
|
4864
|
-
return executions;
|
|
4865
|
-
});
|
|
4866
|
-
},
|
|
4867
|
-
getWorkflowExecution(workflowId, executionId, authorization) {
|
|
4868
|
-
return __async(this, null, function* () {
|
|
4869
|
-
const { data: execution } = yield textClientInstance.get(
|
|
4870
|
-
urls4.getWorkflowExecution(workflowId, executionId),
|
|
4871
|
-
getWorkflowApiCrmConfig(authorization)
|
|
4872
|
-
);
|
|
4873
|
-
return execution;
|
|
4874
|
-
});
|
|
4875
|
-
},
|
|
4876
|
-
getWorkflowIntrospection(workflowId, version, authorization) {
|
|
4877
|
-
return __async(this, null, function* () {
|
|
4878
|
-
const searchParams = new URLSearchParams();
|
|
4879
|
-
if (version) {
|
|
4880
|
-
searchParams.append("version", `${version}`);
|
|
4881
|
-
}
|
|
4882
|
-
const query = searchParams.toString();
|
|
4883
|
-
const { data: introspection } = yield textClientInstance.get(
|
|
4884
|
-
`${urls4.getWorkflowIntrospection(workflowId)}${query ? `?${query}` : ""}`,
|
|
4885
|
-
getWorkflowApiCrmConfig(authorization)
|
|
4886
|
-
);
|
|
4887
|
-
return {
|
|
4888
|
-
tasks: introspection
|
|
4889
|
-
};
|
|
4890
|
-
});
|
|
4891
|
-
}
|
|
4892
|
-
};
|
|
4893
|
-
|
|
4894
|
-
// src/apis/integrations/text/platform/workflow/workflows/internal/api.ts
|
|
4895
|
-
var textPlatformWorkflowsInternalApi = {
|
|
4896
|
-
crm: textPlatformWorkflowsInternalCrmApi
|
|
4897
|
-
};
|
|
4898
|
-
|
|
4899
|
-
// src/apis/integrations/text/platform/workflow/workflows/api.ts
|
|
4900
|
-
var enrichWorkflowTrigger = (workflow) => {
|
|
4901
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4902
|
-
if (((_a = workflow.trigger) == null ? void 0 : _a.type) === WorkflowTriggerType.webhook) {
|
|
4903
|
-
workflow.trigger.name = (_c = workflow.trigger.sub_type) != null ? _c : `${workflow.trigger.webhook.source}-${(_b = workflow.trigger.webhook.event) == null ? void 0 : _b.name}`;
|
|
4821
|
+
// src/apis/integrations/vercel/instance.ts
|
|
4822
|
+
var import_axios23 = __toESM(require("axios"));
|
|
4823
|
+
function getVercelClientAuthorization(req, headerPrefix = "x-adapter-vercel") {
|
|
4824
|
+
if (req.headers instanceof Headers) {
|
|
4825
|
+
return {
|
|
4826
|
+
token: req.headers.get(`${headerPrefix}-token`)
|
|
4827
|
+
};
|
|
4904
4828
|
}
|
|
4905
|
-
|
|
4906
|
-
|
|
4829
|
+
return {
|
|
4830
|
+
token: req.headers[`${headerPrefix}-token`]
|
|
4831
|
+
};
|
|
4832
|
+
}
|
|
4833
|
+
var vercelClientInstance = import_axios23.default.create({
|
|
4834
|
+
baseURL: "https://api.vercel.com"
|
|
4835
|
+
});
|
|
4836
|
+
vercelClientInstance.interceptors.response.use(
|
|
4837
|
+
(r) => r,
|
|
4838
|
+
(error) => {
|
|
4839
|
+
var _a, _b;
|
|
4840
|
+
if (import_axios23.default.isAxiosError(error)) {
|
|
4841
|
+
if (((_a = error.response) == null ? void 0 : _a.status) === 401 || ((_b = error.response) == null ? void 0 : _b.status) === 403) {
|
|
4842
|
+
throw new UnauthorizeApiError("vercel");
|
|
4843
|
+
}
|
|
4844
|
+
}
|
|
4845
|
+
throw error;
|
|
4907
4846
|
}
|
|
4908
|
-
|
|
4909
|
-
|
|
4847
|
+
);
|
|
4848
|
+
function getVercelClientConfig(options = {}) {
|
|
4849
|
+
var _a;
|
|
4850
|
+
const currentHeaders = vercelClientInstance.defaults.headers;
|
|
4851
|
+
const config = {
|
|
4852
|
+
authorization: (_a = options.token ? `Bearer ${options.token}` : void 0) != null ? _a : currentHeaders.Authorization
|
|
4853
|
+
};
|
|
4854
|
+
if (options.ensureAuthorizationToken && !config.authorization) {
|
|
4855
|
+
throw new UnauthorizeApiError("vercel");
|
|
4910
4856
|
}
|
|
4911
|
-
|
|
4912
|
-
|
|
4857
|
+
return {
|
|
4858
|
+
headers: __spreadValues({}, config.authorization ? { Authorization: config.authorization } : {})
|
|
4859
|
+
};
|
|
4860
|
+
}
|
|
4861
|
+
function initVercelClient(token) {
|
|
4862
|
+
if (token) {
|
|
4863
|
+
updateVercelClient(token);
|
|
4913
4864
|
}
|
|
4914
|
-
|
|
4915
|
-
|
|
4865
|
+
}
|
|
4866
|
+
function updateVercelClient(token) {
|
|
4867
|
+
const headers = vercelClientInstance.defaults.headers;
|
|
4868
|
+
if (token) {
|
|
4869
|
+
headers.Authorization = `Bearer ${token}`;
|
|
4870
|
+
} else {
|
|
4871
|
+
delete headers.Authorization;
|
|
4916
4872
|
}
|
|
4917
|
-
|
|
4918
|
-
|
|
4873
|
+
}
|
|
4874
|
+
|
|
4875
|
+
// src/apis/platform/accounts/instance.ts
|
|
4876
|
+
var AccountsApiError = class extends ApiErrorBase {
|
|
4877
|
+
constructor() {
|
|
4878
|
+
super(...arguments);
|
|
4879
|
+
this.name = "accounts";
|
|
4919
4880
|
}
|
|
4920
|
-
return workflow;
|
|
4921
4881
|
};
|
|
4922
|
-
var
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
var urls5 = {
|
|
4927
|
-
getWorkflows: (queryParams) => enrichUrlWithQueryParams(getUrl4([], "v1.0" /* V1 */), queryParams),
|
|
4928
|
-
createWorkflow: () => getUrl4(),
|
|
4929
|
-
getWorkflow: (id) => getUrl4([id], "v1.0" /* V1 */),
|
|
4930
|
-
updateWorkflow: (id) => getUrl4([id]),
|
|
4931
|
-
deleteWorkflow: (id) => getUrl4([id]),
|
|
4932
|
-
createWorkflowDraft: (id) => getUrl4([id, "draft"]),
|
|
4933
|
-
publishWorkflowDraft: (id) => getUrl4([id, "publish"]),
|
|
4934
|
-
toggleWorkflowActivation: (id) => getUrl4([id, "activation"]),
|
|
4935
|
-
executeWorkflow: (id) => getUrl4([id, "executions"]),
|
|
4936
|
-
getWorkflowExecutions: (id, queryParams) => enrichUrlWithQueryParams(
|
|
4937
|
-
getUrl4([id, "executions"], "v1.0" /* V1 */),
|
|
4938
|
-
queryParams
|
|
4939
|
-
),
|
|
4940
|
-
getWorkflowExecution: (id, executionId) => getUrl4([id, "executions", executionId], "v1.0" /* V1 */),
|
|
4941
|
-
getWorkflowIntrospection: (id) => getUrl4([id, "metadata"], "v1.0" /* V1 */),
|
|
4942
|
-
introspectWorkflowTask: (id) => getUrl4([id, "run_task"], "v1.0" /* V1 */)
|
|
4882
|
+
var UnauthorizeAccountsApiError = class extends UnauthorizeApiError {
|
|
4883
|
+
constructor(message) {
|
|
4884
|
+
super("accounts", message);
|
|
4885
|
+
}
|
|
4943
4886
|
};
|
|
4944
|
-
var
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
urls5.getWorkflows(queryParams),
|
|
4953
|
-
getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
4954
|
-
ensureAuthorizationToken: true
|
|
4955
|
-
}))
|
|
4956
|
-
);
|
|
4957
|
-
workflows.data = workflows.data.map(enrichWorkflowTrigger);
|
|
4958
|
-
return workflows;
|
|
4959
|
-
});
|
|
4960
|
-
},
|
|
4961
|
-
getWorkflow(workflowId, version, authorization) {
|
|
4962
|
-
return __async(this, null, function* () {
|
|
4963
|
-
const searchParams = new URLSearchParams();
|
|
4964
|
-
if (version) {
|
|
4965
|
-
searchParams.append("version", `${version}`);
|
|
4887
|
+
var AccountApiClient = class extends ApiClient {
|
|
4888
|
+
constructor() {
|
|
4889
|
+
super(...arguments);
|
|
4890
|
+
this.UnauthorizedError = UnauthorizeAccountsApiError;
|
|
4891
|
+
this.Error = AccountsApiError;
|
|
4892
|
+
this.options = {
|
|
4893
|
+
headers: {
|
|
4894
|
+
"Content-Type": "application/json"
|
|
4966
4895
|
}
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
createWorkflow(payload, authorization) {
|
|
4978
|
-
return __async(this, null, function* () {
|
|
4979
|
-
return textClientInstance.post(
|
|
4980
|
-
urls5.createWorkflow(),
|
|
4981
|
-
__spreadProps(__spreadValues({}, payload), {
|
|
4982
|
-
trigger: payload.trigger || {}
|
|
4983
|
-
}),
|
|
4984
|
-
getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
4985
|
-
ensureAuthorizationToken: true
|
|
4986
|
-
}))
|
|
4987
|
-
);
|
|
4988
|
-
});
|
|
4989
|
-
},
|
|
4990
|
-
updateWorkflow(workflowId, payload, authorization) {
|
|
4991
|
-
return __async(this, null, function* () {
|
|
4992
|
-
return textClientInstance.put(
|
|
4993
|
-
urls5.updateWorkflow(workflowId),
|
|
4994
|
-
__spreadProps(__spreadValues({}, payload), {
|
|
4995
|
-
trigger: payload.trigger || {}
|
|
4996
|
-
}),
|
|
4997
|
-
getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
4998
|
-
ensureAuthorizationToken: true
|
|
4999
|
-
}))
|
|
5000
|
-
);
|
|
5001
|
-
});
|
|
5002
|
-
},
|
|
5003
|
-
deleteWorkflow(workflowId, authorization) {
|
|
5004
|
-
return __async(this, null, function* () {
|
|
5005
|
-
return textClientInstance.delete(urls5.deleteWorkflow(workflowId), __spreadValues({}, getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
5006
|
-
ensureAuthorizationToken: true
|
|
5007
|
-
}))));
|
|
5008
|
-
});
|
|
5009
|
-
},
|
|
5010
|
-
createWorkflowDraft(workflowId, payload, authorization) {
|
|
5011
|
-
return __async(this, null, function* () {
|
|
5012
|
-
return textClientInstance.post(
|
|
5013
|
-
urls5.createWorkflowDraft(workflowId),
|
|
5014
|
-
__spreadProps(__spreadValues({}, payload), {
|
|
5015
|
-
trigger: payload.trigger || {}
|
|
5016
|
-
}),
|
|
5017
|
-
getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
5018
|
-
ensureAuthorizationToken: true
|
|
5019
|
-
}))
|
|
5020
|
-
);
|
|
5021
|
-
});
|
|
5022
|
-
},
|
|
5023
|
-
publishWorkflowDraft(workflowId, authorization) {
|
|
5024
|
-
return __async(this, null, function* () {
|
|
5025
|
-
return textClientInstance.post(
|
|
5026
|
-
urls5.publishWorkflowDraft(workflowId),
|
|
5027
|
-
getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
5028
|
-
ensureAuthorizationToken: true
|
|
5029
|
-
}))
|
|
5030
|
-
);
|
|
5031
|
-
});
|
|
5032
|
-
},
|
|
5033
|
-
toggleWorkflowActivation(workflowId, isActive, authorization) {
|
|
5034
|
-
return __async(this, null, function* () {
|
|
5035
|
-
return textClientInstance.put(
|
|
5036
|
-
urls5.toggleWorkflowActivation(workflowId),
|
|
5037
|
-
{
|
|
5038
|
-
active: isActive
|
|
5039
|
-
},
|
|
5040
|
-
getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
5041
|
-
ensureAuthorizationToken: true
|
|
5042
|
-
}))
|
|
5043
|
-
);
|
|
5044
|
-
});
|
|
5045
|
-
},
|
|
5046
|
-
executeWorkflow(workflowId, input, authorization) {
|
|
5047
|
-
return __async(this, null, function* () {
|
|
5048
|
-
const { data: execution } = yield textClientInstance.post(
|
|
5049
|
-
urls5.executeWorkflow(workflowId),
|
|
5050
|
-
{
|
|
5051
|
-
input
|
|
5052
|
-
},
|
|
5053
|
-
getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
5054
|
-
ensureAuthorizationToken: true
|
|
5055
|
-
}))
|
|
5056
|
-
);
|
|
5057
|
-
return execution;
|
|
5058
|
-
});
|
|
5059
|
-
},
|
|
5060
|
-
getWorkflowExecutions(workflowId, queryParams, authorization) {
|
|
5061
|
-
return __async(this, null, function* () {
|
|
5062
|
-
const { data: executions } = yield textClientInstance.get(
|
|
5063
|
-
urls5.getWorkflowExecutions(workflowId, queryParams),
|
|
5064
|
-
getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
5065
|
-
ensureAuthorizationToken: true
|
|
5066
|
-
}))
|
|
5067
|
-
);
|
|
5068
|
-
return executions;
|
|
5069
|
-
});
|
|
5070
|
-
},
|
|
5071
|
-
getWorkflowExecution(workflowId, executionId, authorization) {
|
|
5072
|
-
return __async(this, null, function* () {
|
|
5073
|
-
const { data: execution } = yield textClientInstance.get(
|
|
5074
|
-
urls5.getWorkflowExecution(workflowId, executionId),
|
|
5075
|
-
getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
5076
|
-
ensureAuthorizationToken: true
|
|
5077
|
-
}))
|
|
5078
|
-
);
|
|
5079
|
-
return execution;
|
|
5080
|
-
});
|
|
5081
|
-
},
|
|
5082
|
-
getWorkflowIntrospection(workflowId, version, authorization) {
|
|
5083
|
-
return __async(this, null, function* () {
|
|
5084
|
-
const searchParams = new URLSearchParams();
|
|
5085
|
-
if (version) {
|
|
5086
|
-
searchParams.append("version", `${version}`);
|
|
5087
|
-
}
|
|
5088
|
-
const query = searchParams.toString();
|
|
5089
|
-
const { data: introspection } = yield textClientInstance.get(
|
|
5090
|
-
`${urls5.getWorkflowIntrospection(workflowId)}${query ? `?${query}` : ""}`,
|
|
5091
|
-
getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
5092
|
-
ensureAuthorizationToken: true
|
|
5093
|
-
}))
|
|
5094
|
-
);
|
|
5095
|
-
return {
|
|
5096
|
-
tasks: introspection
|
|
5097
|
-
};
|
|
5098
|
-
});
|
|
5099
|
-
},
|
|
5100
|
-
introspectWorkflowTask(workflowId, payload, authorization) {
|
|
5101
|
-
return __async(this, null, function* () {
|
|
5102
|
-
const response = yield textClientInstance.post(
|
|
5103
|
-
urls5.introspectWorkflowTask(workflowId),
|
|
5104
|
-
{
|
|
5105
|
-
task_reference_name: payload.taskReferenceName,
|
|
5106
|
-
input_parameters: payload.inputParameters
|
|
5107
|
-
},
|
|
5108
|
-
getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
5109
|
-
ensureAuthorizationToken: true
|
|
5110
|
-
}))
|
|
5111
|
-
);
|
|
5112
|
-
return response.data;
|
|
5113
|
-
});
|
|
5114
|
-
}
|
|
5115
|
-
};
|
|
5116
|
-
|
|
5117
|
-
// src/apis/integrations/vercel/instance.ts
|
|
5118
|
-
var import_axios22 = __toESM(require("axios"));
|
|
5119
|
-
function getVercelClientAuthorization(req, headerPrefix = "x-adapter-vercel") {
|
|
5120
|
-
if (req.headers instanceof Headers) {
|
|
5121
|
-
return {
|
|
5122
|
-
token: req.headers.get(`${headerPrefix}-token`)
|
|
5123
|
-
};
|
|
5124
|
-
}
|
|
5125
|
-
return {
|
|
5126
|
-
token: req.headers[`${headerPrefix}-token`]
|
|
5127
|
-
};
|
|
5128
|
-
}
|
|
5129
|
-
var vercelClientInstance = import_axios22.default.create({
|
|
5130
|
-
baseURL: "https://api.vercel.com"
|
|
5131
|
-
});
|
|
5132
|
-
vercelClientInstance.interceptors.response.use(
|
|
5133
|
-
(r) => r,
|
|
5134
|
-
(error) => {
|
|
5135
|
-
var _a, _b;
|
|
5136
|
-
if (import_axios22.default.isAxiosError(error)) {
|
|
5137
|
-
if (((_a = error.response) == null ? void 0 : _a.status) === 401 || ((_b = error.response) == null ? void 0 : _b.status) === 403) {
|
|
5138
|
-
throw new UnauthorizeApiError("vercel");
|
|
5139
|
-
}
|
|
5140
|
-
}
|
|
5141
|
-
throw error;
|
|
5142
|
-
}
|
|
5143
|
-
);
|
|
5144
|
-
function getVercelClientConfig(options = {}) {
|
|
5145
|
-
var _a;
|
|
5146
|
-
const currentHeaders = vercelClientInstance.defaults.headers;
|
|
5147
|
-
const config = {
|
|
5148
|
-
authorization: (_a = options.token ? `Bearer ${options.token}` : void 0) != null ? _a : currentHeaders.Authorization
|
|
5149
|
-
};
|
|
5150
|
-
if (options.ensureAuthorizationToken && !config.authorization) {
|
|
5151
|
-
throw new UnauthorizeApiError("vercel");
|
|
5152
|
-
}
|
|
5153
|
-
return {
|
|
5154
|
-
headers: __spreadValues({}, config.authorization ? { Authorization: config.authorization } : {})
|
|
5155
|
-
};
|
|
5156
|
-
}
|
|
5157
|
-
function initVercelClient(token) {
|
|
5158
|
-
if (token) {
|
|
5159
|
-
updateVercelClient(token);
|
|
5160
|
-
}
|
|
5161
|
-
}
|
|
5162
|
-
function updateVercelClient(token) {
|
|
5163
|
-
const headers = vercelClientInstance.defaults.headers;
|
|
5164
|
-
if (token) {
|
|
5165
|
-
headers.Authorization = `Bearer ${token}`;
|
|
5166
|
-
} else {
|
|
5167
|
-
delete headers.Authorization;
|
|
5168
|
-
}
|
|
5169
|
-
}
|
|
5170
|
-
|
|
5171
|
-
// src/apis/platform/accounts/instance.ts
|
|
5172
|
-
var AccountsApiError = class extends ApiErrorBase {
|
|
5173
|
-
constructor() {
|
|
5174
|
-
super(...arguments);
|
|
5175
|
-
this.name = "accounts";
|
|
5176
|
-
}
|
|
5177
|
-
};
|
|
5178
|
-
var UnauthorizeAccountsApiError = class extends UnauthorizeApiError {
|
|
5179
|
-
constructor(message) {
|
|
5180
|
-
super("accounts", message);
|
|
5181
|
-
}
|
|
5182
|
-
};
|
|
5183
|
-
var AccountApiClient = class extends ApiClient {
|
|
5184
|
-
constructor() {
|
|
5185
|
-
super(...arguments);
|
|
5186
|
-
this.UnauthorizedError = UnauthorizeAccountsApiError;
|
|
5187
|
-
this.Error = AccountsApiError;
|
|
5188
|
-
this.options = {
|
|
5189
|
-
headers: {
|
|
5190
|
-
"Content-Type": "application/json"
|
|
5191
|
-
}
|
|
5192
|
-
};
|
|
5193
|
-
}
|
|
5194
|
-
};
|
|
5195
|
-
var platformAccountsClientInstance = new AccountApiClient({
|
|
5196
|
-
baseURL: "https://accounts.labs.livechatinc.com"
|
|
5197
|
-
});
|
|
5198
|
-
function initPlatformAccountsClient(baseUrl, token) {
|
|
5199
|
-
if (baseUrl) {
|
|
5200
|
-
platformAccountsClientInstance.updateConfig({
|
|
5201
|
-
baseURL: baseUrl
|
|
4896
|
+
};
|
|
4897
|
+
}
|
|
4898
|
+
};
|
|
4899
|
+
var platformAccountsClientInstance = new AccountApiClient({
|
|
4900
|
+
baseURL: "https://accounts.labs.livechatinc.com"
|
|
4901
|
+
});
|
|
4902
|
+
function initPlatformAccountsClient(baseUrl, token) {
|
|
4903
|
+
if (baseUrl) {
|
|
4904
|
+
platformAccountsClientInstance.updateConfig({
|
|
4905
|
+
baseURL: baseUrl
|
|
5202
4906
|
});
|
|
5203
4907
|
}
|
|
5204
4908
|
platformAccountsClientInstance.updateAuthorization({
|
|
@@ -5207,8 +4911,8 @@ function initPlatformAccountsClient(baseUrl, token) {
|
|
|
5207
4911
|
}
|
|
5208
4912
|
|
|
5209
4913
|
// src/apis/platform/billing/instance.ts
|
|
5210
|
-
var
|
|
5211
|
-
var billingClientInstance =
|
|
4914
|
+
var import_axios24 = __toESM(require("axios"));
|
|
4915
|
+
var billingClientInstance = import_axios24.default.create({
|
|
5212
4916
|
baseURL: "https://billing.labs.livechatinc.com"
|
|
5213
4917
|
});
|
|
5214
4918
|
function getBillingClientConfig(options = {}) {
|
|
@@ -5275,7 +4979,7 @@ var cdpCustomerEventMessageZod = import_zod12.z.discriminatedUnion("type", [
|
|
|
5275
4979
|
]);
|
|
5276
4980
|
|
|
5277
4981
|
// src/apis/platform/console/instance.ts
|
|
5278
|
-
var
|
|
4982
|
+
var import_axios25 = __toESM(require("axios"));
|
|
5279
4983
|
var REGION = {
|
|
5280
4984
|
FRA: "fra",
|
|
5281
4985
|
DAL: "dal",
|
|
@@ -5305,7 +5009,7 @@ var ConsoleApiError = class _ConsoleApiError extends ApiErrorBase {
|
|
|
5305
5009
|
);
|
|
5306
5010
|
}
|
|
5307
5011
|
};
|
|
5308
|
-
var consoleClientInstance =
|
|
5012
|
+
var consoleClientInstance = import_axios25.default.create({
|
|
5309
5013
|
baseURL: "https://platform.labs.text.com/console/api",
|
|
5310
5014
|
headers: {
|
|
5311
5015
|
"Content-Type": "application/json"
|
|
@@ -5484,14 +5188,14 @@ var getAppAutoReviewPayload = (value) => {
|
|
|
5484
5188
|
};
|
|
5485
5189
|
|
|
5486
5190
|
// src/apis/platform/dps/instance.ts
|
|
5487
|
-
var
|
|
5191
|
+
var import_axios26 = __toESM(require("axios"));
|
|
5488
5192
|
var DpsApiError = class extends ApiErrorBase {
|
|
5489
5193
|
constructor() {
|
|
5490
5194
|
super(...arguments);
|
|
5491
5195
|
this.name = "dps";
|
|
5492
5196
|
}
|
|
5493
5197
|
};
|
|
5494
|
-
var dpsClientInstance =
|
|
5198
|
+
var dpsClientInstance = import_axios26.default.create({
|
|
5495
5199
|
baseURL: "https://dev-platform.labs.livechatinc.com"
|
|
5496
5200
|
});
|
|
5497
5201
|
dpsClientInstance.interceptors.response.use(
|
|
@@ -5540,14 +5244,14 @@ function initDpsClient(baseUrl, token) {
|
|
|
5540
5244
|
}
|
|
5541
5245
|
|
|
5542
5246
|
// src/apis/products/helpdesk/instance.ts
|
|
5543
|
-
var
|
|
5247
|
+
var import_axios27 = __toESM(require("axios"));
|
|
5544
5248
|
var HelpDeskApiError = class extends ApiErrorBase {
|
|
5545
5249
|
constructor() {
|
|
5546
5250
|
super(...arguments);
|
|
5547
5251
|
this.name = "helpdesk";
|
|
5548
5252
|
}
|
|
5549
5253
|
};
|
|
5550
|
-
var helpdeskClientInstance =
|
|
5254
|
+
var helpdeskClientInstance = import_axios27.default.create({
|
|
5551
5255
|
baseURL: "https://api.labs.helpdesk.com"
|
|
5552
5256
|
});
|
|
5553
5257
|
helpdeskClientInstance.interceptors.response.use(
|
|
@@ -5646,7 +5350,7 @@ var LivechatWebhookSystemMessages = /* @__PURE__ */ ((LivechatWebhookSystemMessa
|
|
|
5646
5350
|
})(LivechatWebhookSystemMessages || {});
|
|
5647
5351
|
|
|
5648
5352
|
// src/apis/products/livechat/instance.ts
|
|
5649
|
-
var
|
|
5353
|
+
var import_axios28 = __toESM(require("axios"));
|
|
5650
5354
|
var REGION2 = {
|
|
5651
5355
|
FRA: "fra",
|
|
5652
5356
|
DAL: "dal",
|
|
@@ -5666,7 +5370,7 @@ var LivechatApiError = class extends ApiErrorBase {
|
|
|
5666
5370
|
this.name = "livechat";
|
|
5667
5371
|
}
|
|
5668
5372
|
};
|
|
5669
|
-
var livechatClientInstance =
|
|
5373
|
+
var livechatClientInstance = import_axios28.default.create({
|
|
5670
5374
|
baseURL: "https://api.labs.livechatinc.com"
|
|
5671
5375
|
});
|
|
5672
5376
|
livechatClientInstance.interceptors.response.use(
|
|
@@ -5831,7 +5535,7 @@ var integrationSubscriptionRequestZods = {
|
|
|
5831
5535
|
};
|
|
5832
5536
|
|
|
5833
5537
|
// src/apis/text-intelligence/workflows/adapter/instance.ts
|
|
5834
|
-
var
|
|
5538
|
+
var import_axios29 = __toESM(require("axios"));
|
|
5835
5539
|
var REGION3 = {
|
|
5836
5540
|
FRA: "fra",
|
|
5837
5541
|
DAL: "dal",
|
|
@@ -5861,7 +5565,7 @@ var AdapterApiError = class _AdapterApiError extends ApiErrorBase {
|
|
|
5861
5565
|
);
|
|
5862
5566
|
}
|
|
5863
5567
|
};
|
|
5864
|
-
var adapterClientInstance =
|
|
5568
|
+
var adapterClientInstance = import_axios29.default.create({
|
|
5865
5569
|
baseURL: "https://platform.labs.text.com/console-adapter/api",
|
|
5866
5570
|
headers: {
|
|
5867
5571
|
"Content-Type": "application/json"
|
|
@@ -6022,7 +5726,7 @@ function updateAdapterClient(tokens) {
|
|
|
6022
5726
|
}
|
|
6023
5727
|
|
|
6024
5728
|
// src/apis/text-intelligence/workflows/workflow/instance.ts
|
|
6025
|
-
var
|
|
5729
|
+
var import_axios30 = __toESM(require("axios"));
|
|
6026
5730
|
var REGION4 = {
|
|
6027
5731
|
FRA: "fra",
|
|
6028
5732
|
DAL: "dal",
|
|
@@ -6052,7 +5756,7 @@ var WorkflowsApiError = class _WorkflowsApiError extends ApiErrorBase {
|
|
|
6052
5756
|
);
|
|
6053
5757
|
}
|
|
6054
5758
|
};
|
|
6055
|
-
var workflowsClientInstance =
|
|
5759
|
+
var workflowsClientInstance = import_axios30.default.create({
|
|
6056
5760
|
baseURL: "https://platform.labs.text.com/workflows/api",
|
|
6057
5761
|
headers: {
|
|
6058
5762
|
"Content-Type": "application/json"
|
|
@@ -6154,22 +5858,22 @@ var textPlatformWorkflowsResourcesApi = {
|
|
|
6154
5858
|
};
|
|
6155
5859
|
|
|
6156
5860
|
// src/apis/integrations/text/platform/workflow/templates/api.ts
|
|
6157
|
-
var
|
|
5861
|
+
var getUrl3 = (segments = [], version) => buildUrlFromSegments(
|
|
6158
5862
|
segments,
|
|
6159
5863
|
`/workflow_platform/${version ? `${version}/` : ""}workflows/templates`
|
|
6160
5864
|
);
|
|
6161
|
-
var
|
|
6162
|
-
getList: (queryParams) => enrichUrlWithQueryParams(
|
|
6163
|
-
get: (templateId) =>
|
|
5865
|
+
var urls4 = {
|
|
5866
|
+
getList: (queryParams) => enrichUrlWithQueryParams(getUrl3([], "v1.0" /* V1 */), queryParams),
|
|
5867
|
+
get: (templateId) => getUrl3([templateId], "v1.0" /* V1 */)
|
|
6164
5868
|
};
|
|
6165
5869
|
var textPlatformWorkflowsTemplatesApi = {
|
|
6166
5870
|
meta: {
|
|
6167
|
-
urls:
|
|
5871
|
+
urls: urls4
|
|
6168
5872
|
},
|
|
6169
5873
|
getList(queryParams, authorization) {
|
|
6170
5874
|
return __async(this, null, function* () {
|
|
6171
5875
|
return textClientInstance.get(
|
|
6172
|
-
|
|
5876
|
+
urls4.getList(queryParams),
|
|
6173
5877
|
getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
6174
5878
|
ensureAuthorizationToken: true
|
|
6175
5879
|
}))
|
|
@@ -6186,7 +5890,7 @@ var textPlatformWorkflowsTemplatesApi = {
|
|
|
6186
5890
|
get(templateId, authorization) {
|
|
6187
5891
|
return __async(this, null, function* () {
|
|
6188
5892
|
return textClientInstance.get(
|
|
6189
|
-
|
|
5893
|
+
urls4.get(templateId),
|
|
6190
5894
|
getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
6191
5895
|
ensureAuthorizationToken: true
|
|
6192
5896
|
}))
|
|
@@ -6202,6 +5906,316 @@ var textPlatformWorkflowsTemplatesApi = {
|
|
|
6202
5906
|
}
|
|
6203
5907
|
};
|
|
6204
5908
|
|
|
5909
|
+
// src/apis/integrations/text/platform/workflow/workflows/internal/crm/api.ts
|
|
5910
|
+
var getUrl4 = (segments = []) => buildUrlFromSegments(segments, "/internal/crm");
|
|
5911
|
+
var urls5 = {
|
|
5912
|
+
getOrganizations: (queryParams) => enrichUrlWithQueryParams(getUrl4(["stats"]), queryParams),
|
|
5913
|
+
getOrganization: (organizationId) => getUrl4(["stats", organizationId]),
|
|
5914
|
+
getWorkflows: (queryParams) => enrichUrlWithQueryParams(getUrl4(["workflows"]), queryParams),
|
|
5915
|
+
getWorkflow: (id) => getUrl4(["workflows", id]),
|
|
5916
|
+
getWorkflowExecutions: (id, queryParams) => enrichUrlWithQueryParams(
|
|
5917
|
+
getUrl4(["workflows", id, "executions"]),
|
|
5918
|
+
queryParams
|
|
5919
|
+
),
|
|
5920
|
+
getWorkflowExecution: (id, executionId) => getUrl4(["workflows", id, "executions", executionId]),
|
|
5921
|
+
getWorkflowIntrospection: (id) => getUrl4(["workflows", id, "metadata"])
|
|
5922
|
+
};
|
|
5923
|
+
var textPlatformWorkflowsInternalCrmApi = {
|
|
5924
|
+
meta: {
|
|
5925
|
+
urls: urls5
|
|
5926
|
+
},
|
|
5927
|
+
getOrganizations(queryParams, authorization) {
|
|
5928
|
+
return __async(this, null, function* () {
|
|
5929
|
+
const { data: organizations } = yield textClientInstance.get(
|
|
5930
|
+
urls5.getOrganizations(queryParams),
|
|
5931
|
+
getWorkflowApiCrmConfig(authorization)
|
|
5932
|
+
);
|
|
5933
|
+
return organizations;
|
|
5934
|
+
});
|
|
5935
|
+
},
|
|
5936
|
+
getOrganization(organizationId, authorization) {
|
|
5937
|
+
return __async(this, null, function* () {
|
|
5938
|
+
const { data: organization } = yield textClientInstance.get(
|
|
5939
|
+
urls5.getOrganization(organizationId),
|
|
5940
|
+
getWorkflowApiCrmConfig(authorization)
|
|
5941
|
+
);
|
|
5942
|
+
return organization;
|
|
5943
|
+
});
|
|
5944
|
+
},
|
|
5945
|
+
getWorkflows(queryParams, authorization) {
|
|
5946
|
+
return __async(this, null, function* () {
|
|
5947
|
+
const { data: workflows } = yield textClientInstance.get(urls5.getWorkflows(queryParams), getWorkflowApiCrmConfig(authorization));
|
|
5948
|
+
workflows.data = workflows.data.map(enrichWorkflowTrigger);
|
|
5949
|
+
return workflows;
|
|
5950
|
+
});
|
|
5951
|
+
},
|
|
5952
|
+
getWorkflow(workflowId, authorization) {
|
|
5953
|
+
return __async(this, null, function* () {
|
|
5954
|
+
const searchParams = new URLSearchParams();
|
|
5955
|
+
const query = searchParams.toString();
|
|
5956
|
+
const { data: workflow } = yield textClientInstance.get(
|
|
5957
|
+
`${urls5.getWorkflow(workflowId)}${query ? `?${query}` : ""}`,
|
|
5958
|
+
getWorkflowApiCrmConfig(authorization)
|
|
5959
|
+
);
|
|
5960
|
+
return enrichWorkflowTrigger(workflow);
|
|
5961
|
+
});
|
|
5962
|
+
},
|
|
5963
|
+
getWorkflowExecutions(workflowId, queryParams, authorization) {
|
|
5964
|
+
return __async(this, null, function* () {
|
|
5965
|
+
const { data: executions } = yield textClientInstance.get(
|
|
5966
|
+
urls5.getWorkflowExecutions(workflowId, queryParams),
|
|
5967
|
+
getWorkflowApiCrmConfig(authorization)
|
|
5968
|
+
);
|
|
5969
|
+
return executions;
|
|
5970
|
+
});
|
|
5971
|
+
},
|
|
5972
|
+
getWorkflowExecution(workflowId, executionId, authorization) {
|
|
5973
|
+
return __async(this, null, function* () {
|
|
5974
|
+
const { data: execution } = yield textClientInstance.get(
|
|
5975
|
+
urls5.getWorkflowExecution(workflowId, executionId),
|
|
5976
|
+
getWorkflowApiCrmConfig(authorization)
|
|
5977
|
+
);
|
|
5978
|
+
return execution;
|
|
5979
|
+
});
|
|
5980
|
+
},
|
|
5981
|
+
getWorkflowIntrospection(workflowId, version, authorization) {
|
|
5982
|
+
return __async(this, null, function* () {
|
|
5983
|
+
const searchParams = new URLSearchParams();
|
|
5984
|
+
if (version) {
|
|
5985
|
+
searchParams.append("version", `${version}`);
|
|
5986
|
+
}
|
|
5987
|
+
const query = searchParams.toString();
|
|
5988
|
+
const { data: introspection } = yield textClientInstance.get(
|
|
5989
|
+
`${urls5.getWorkflowIntrospection(workflowId)}${query ? `?${query}` : ""}`,
|
|
5990
|
+
getWorkflowApiCrmConfig(authorization)
|
|
5991
|
+
);
|
|
5992
|
+
return {
|
|
5993
|
+
tasks: introspection
|
|
5994
|
+
};
|
|
5995
|
+
});
|
|
5996
|
+
}
|
|
5997
|
+
};
|
|
5998
|
+
|
|
5999
|
+
// src/apis/integrations/text/platform/workflow/workflows/internal/api.ts
|
|
6000
|
+
var textPlatformWorkflowsInternalApi = {
|
|
6001
|
+
crm: textPlatformWorkflowsInternalCrmApi
|
|
6002
|
+
};
|
|
6003
|
+
|
|
6004
|
+
// src/apis/integrations/text/platform/workflow/workflows/api.ts
|
|
6005
|
+
var enrichWorkflowTrigger = (workflow) => {
|
|
6006
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
6007
|
+
if (((_a = workflow.trigger) == null ? void 0 : _a.type) === WorkflowTriggerType.webhook) {
|
|
6008
|
+
workflow.trigger.name = (_c = workflow.trigger.sub_type) != null ? _c : `${workflow.trigger.webhook.source}-${(_b = workflow.trigger.webhook.event) == null ? void 0 : _b.name}`;
|
|
6009
|
+
}
|
|
6010
|
+
if (((_d = workflow.trigger) == null ? void 0 : _d.type) === WorkflowTriggerType.webhookManual) {
|
|
6011
|
+
workflow.trigger.name = "webhook_manual";
|
|
6012
|
+
}
|
|
6013
|
+
if (((_e = workflow.trigger) == null ? void 0 : _e.type) === WorkflowTriggerType.manual) {
|
|
6014
|
+
workflow.trigger.name = "manual";
|
|
6015
|
+
}
|
|
6016
|
+
if (((_f = workflow.trigger) == null ? void 0 : _f.type) === WorkflowTriggerType.agent) {
|
|
6017
|
+
workflow.trigger.name = "ai_agent";
|
|
6018
|
+
}
|
|
6019
|
+
if (((_g = workflow.trigger) == null ? void 0 : _g.type) === WorkflowTriggerType.recurring) {
|
|
6020
|
+
workflow.trigger.name = "scheduled";
|
|
6021
|
+
}
|
|
6022
|
+
return workflow;
|
|
6023
|
+
};
|
|
6024
|
+
var getUrl5 = (segments = [], version) => buildUrlFromSegments(
|
|
6025
|
+
segments,
|
|
6026
|
+
`/workflow_platform/${version ? `${version}/` : ""}workflows`
|
|
6027
|
+
);
|
|
6028
|
+
var urls6 = {
|
|
6029
|
+
getWorkflows: (queryParams) => enrichUrlWithQueryParams(getUrl5([], "v1.0" /* V1 */), queryParams),
|
|
6030
|
+
createWorkflow: () => getUrl5(),
|
|
6031
|
+
getWorkflow: (id) => getUrl5([id], "v1.0" /* V1 */),
|
|
6032
|
+
updateWorkflow: (id) => getUrl5([id]),
|
|
6033
|
+
deleteWorkflow: (id) => getUrl5([id]),
|
|
6034
|
+
createWorkflowDraft: (id) => getUrl5([id, "draft"]),
|
|
6035
|
+
publishWorkflowDraft: (id) => getUrl5([id, "publish"]),
|
|
6036
|
+
toggleWorkflowActivation: (id) => getUrl5([id, "activation"]),
|
|
6037
|
+
executeWorkflow: (id) => getUrl5([id, "executions"]),
|
|
6038
|
+
getWorkflowExecutions: (id, queryParams) => enrichUrlWithQueryParams(
|
|
6039
|
+
getUrl5([id, "executions"], "v1.0" /* V1 */),
|
|
6040
|
+
queryParams
|
|
6041
|
+
),
|
|
6042
|
+
getWorkflowExecution: (id, executionId) => getUrl5([id, "executions", executionId], "v1.0" /* V1 */),
|
|
6043
|
+
getWorkflowIntrospection: (id) => getUrl5([id, "metadata"], "v1.0" /* V1 */),
|
|
6044
|
+
introspectWorkflowTask: (id) => getUrl5([id, "run_task"], "v1.0" /* V1 */)
|
|
6045
|
+
};
|
|
6046
|
+
var textPlatformWorkflowsApi = {
|
|
6047
|
+
internal: textPlatformWorkflowsInternalApi,
|
|
6048
|
+
meta: {
|
|
6049
|
+
urls: urls6
|
|
6050
|
+
},
|
|
6051
|
+
getWorkflows(queryParams, authorization) {
|
|
6052
|
+
return __async(this, null, function* () {
|
|
6053
|
+
const { data: workflows } = yield textClientInstance.get(
|
|
6054
|
+
urls6.getWorkflows(queryParams),
|
|
6055
|
+
getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
6056
|
+
ensureAuthorizationToken: true
|
|
6057
|
+
}))
|
|
6058
|
+
);
|
|
6059
|
+
workflows.data = workflows.data.map(enrichWorkflowTrigger);
|
|
6060
|
+
return workflows;
|
|
6061
|
+
});
|
|
6062
|
+
},
|
|
6063
|
+
getWorkflow(workflowId, version, authorization) {
|
|
6064
|
+
return __async(this, null, function* () {
|
|
6065
|
+
const searchParams = new URLSearchParams();
|
|
6066
|
+
if (version) {
|
|
6067
|
+
searchParams.append("version", `${version}`);
|
|
6068
|
+
}
|
|
6069
|
+
const query = searchParams.toString();
|
|
6070
|
+
const { data: workflow } = yield textClientInstance.get(
|
|
6071
|
+
`${urls6.getWorkflow(workflowId)}${query ? `?${query}` : ""}`,
|
|
6072
|
+
getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
6073
|
+
ensureAuthorizationToken: true
|
|
6074
|
+
}))
|
|
6075
|
+
);
|
|
6076
|
+
return enrichWorkflowTrigger(workflow);
|
|
6077
|
+
});
|
|
6078
|
+
},
|
|
6079
|
+
createWorkflow(payload, authorization) {
|
|
6080
|
+
return __async(this, null, function* () {
|
|
6081
|
+
return textClientInstance.post(
|
|
6082
|
+
urls6.createWorkflow(),
|
|
6083
|
+
__spreadProps(__spreadValues({}, payload), {
|
|
6084
|
+
trigger: payload.trigger || {}
|
|
6085
|
+
}),
|
|
6086
|
+
getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
6087
|
+
ensureAuthorizationToken: true
|
|
6088
|
+
}))
|
|
6089
|
+
);
|
|
6090
|
+
});
|
|
6091
|
+
},
|
|
6092
|
+
updateWorkflow(workflowId, payload, authorization) {
|
|
6093
|
+
return __async(this, null, function* () {
|
|
6094
|
+
return textClientInstance.put(
|
|
6095
|
+
urls6.updateWorkflow(workflowId),
|
|
6096
|
+
__spreadProps(__spreadValues({}, payload), {
|
|
6097
|
+
trigger: payload.trigger || {}
|
|
6098
|
+
}),
|
|
6099
|
+
getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
6100
|
+
ensureAuthorizationToken: true
|
|
6101
|
+
}))
|
|
6102
|
+
);
|
|
6103
|
+
});
|
|
6104
|
+
},
|
|
6105
|
+
deleteWorkflow(workflowId, authorization) {
|
|
6106
|
+
return __async(this, null, function* () {
|
|
6107
|
+
return textClientInstance.delete(urls6.deleteWorkflow(workflowId), __spreadValues({}, getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
6108
|
+
ensureAuthorizationToken: true
|
|
6109
|
+
}))));
|
|
6110
|
+
});
|
|
6111
|
+
},
|
|
6112
|
+
createWorkflowDraft(workflowId, payload, authorization) {
|
|
6113
|
+
return __async(this, null, function* () {
|
|
6114
|
+
return textClientInstance.post(
|
|
6115
|
+
urls6.createWorkflowDraft(workflowId),
|
|
6116
|
+
__spreadProps(__spreadValues({}, payload), {
|
|
6117
|
+
trigger: payload.trigger || {}
|
|
6118
|
+
}),
|
|
6119
|
+
getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
6120
|
+
ensureAuthorizationToken: true
|
|
6121
|
+
}))
|
|
6122
|
+
);
|
|
6123
|
+
});
|
|
6124
|
+
},
|
|
6125
|
+
publishWorkflowDraft(workflowId, authorization) {
|
|
6126
|
+
return __async(this, null, function* () {
|
|
6127
|
+
return textClientInstance.post(
|
|
6128
|
+
urls6.publishWorkflowDraft(workflowId),
|
|
6129
|
+
getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
6130
|
+
ensureAuthorizationToken: true
|
|
6131
|
+
}))
|
|
6132
|
+
);
|
|
6133
|
+
});
|
|
6134
|
+
},
|
|
6135
|
+
toggleWorkflowActivation(workflowId, isActive, authorization) {
|
|
6136
|
+
return __async(this, null, function* () {
|
|
6137
|
+
return textClientInstance.put(
|
|
6138
|
+
urls6.toggleWorkflowActivation(workflowId),
|
|
6139
|
+
{
|
|
6140
|
+
active: isActive
|
|
6141
|
+
},
|
|
6142
|
+
getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
6143
|
+
ensureAuthorizationToken: true
|
|
6144
|
+
}))
|
|
6145
|
+
);
|
|
6146
|
+
});
|
|
6147
|
+
},
|
|
6148
|
+
executeWorkflow(workflowId, input, authorization) {
|
|
6149
|
+
return __async(this, null, function* () {
|
|
6150
|
+
const { data: execution } = yield textClientInstance.post(
|
|
6151
|
+
urls6.executeWorkflow(workflowId),
|
|
6152
|
+
{
|
|
6153
|
+
input
|
|
6154
|
+
},
|
|
6155
|
+
getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
6156
|
+
ensureAuthorizationToken: true
|
|
6157
|
+
}))
|
|
6158
|
+
);
|
|
6159
|
+
return execution;
|
|
6160
|
+
});
|
|
6161
|
+
},
|
|
6162
|
+
getWorkflowExecutions(workflowId, queryParams, authorization) {
|
|
6163
|
+
return __async(this, null, function* () {
|
|
6164
|
+
const { data: executions } = yield textClientInstance.get(
|
|
6165
|
+
urls6.getWorkflowExecutions(workflowId, queryParams),
|
|
6166
|
+
getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
6167
|
+
ensureAuthorizationToken: true
|
|
6168
|
+
}))
|
|
6169
|
+
);
|
|
6170
|
+
return executions;
|
|
6171
|
+
});
|
|
6172
|
+
},
|
|
6173
|
+
getWorkflowExecution(workflowId, executionId, authorization) {
|
|
6174
|
+
return __async(this, null, function* () {
|
|
6175
|
+
const { data: execution } = yield textClientInstance.get(
|
|
6176
|
+
urls6.getWorkflowExecution(workflowId, executionId),
|
|
6177
|
+
getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
6178
|
+
ensureAuthorizationToken: true
|
|
6179
|
+
}))
|
|
6180
|
+
);
|
|
6181
|
+
return execution;
|
|
6182
|
+
});
|
|
6183
|
+
},
|
|
6184
|
+
getWorkflowIntrospection(workflowId, version, authorization) {
|
|
6185
|
+
return __async(this, null, function* () {
|
|
6186
|
+
const searchParams = new URLSearchParams();
|
|
6187
|
+
if (version) {
|
|
6188
|
+
searchParams.append("version", `${version}`);
|
|
6189
|
+
}
|
|
6190
|
+
const query = searchParams.toString();
|
|
6191
|
+
const { data: introspection } = yield textClientInstance.get(
|
|
6192
|
+
`${urls6.getWorkflowIntrospection(workflowId)}${query ? `?${query}` : ""}`,
|
|
6193
|
+
getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
6194
|
+
ensureAuthorizationToken: true
|
|
6195
|
+
}))
|
|
6196
|
+
);
|
|
6197
|
+
return {
|
|
6198
|
+
tasks: introspection
|
|
6199
|
+
};
|
|
6200
|
+
});
|
|
6201
|
+
},
|
|
6202
|
+
introspectWorkflowTask(workflowId, payload, authorization) {
|
|
6203
|
+
return __async(this, null, function* () {
|
|
6204
|
+
const response = yield textClientInstance.post(
|
|
6205
|
+
urls6.introspectWorkflowTask(workflowId),
|
|
6206
|
+
{
|
|
6207
|
+
task_reference_name: payload.taskReferenceName,
|
|
6208
|
+
input_parameters: payload.inputParameters
|
|
6209
|
+
},
|
|
6210
|
+
getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
6211
|
+
ensureAuthorizationToken: true
|
|
6212
|
+
}))
|
|
6213
|
+
);
|
|
6214
|
+
return response.data;
|
|
6215
|
+
});
|
|
6216
|
+
}
|
|
6217
|
+
};
|
|
6218
|
+
|
|
6205
6219
|
// src/apis/integrations/text/platform/workflow/api.ts
|
|
6206
6220
|
var textPlatformWorkflowApi = {
|
|
6207
6221
|
workflows: textPlatformWorkflowsApi,
|
|
@@ -6301,7 +6315,7 @@ var textApi = {
|
|
|
6301
6315
|
};
|
|
6302
6316
|
|
|
6303
6317
|
// src/apis/integrations/vercel/api.ts
|
|
6304
|
-
var
|
|
6318
|
+
var import_axios31 = __toESM(require("axios"));
|
|
6305
6319
|
|
|
6306
6320
|
// src/apis/integrations/vercel/deploy/api.ts
|
|
6307
6321
|
var vercelDeployApi = {
|
|
@@ -6565,7 +6579,7 @@ var vercelApi = {
|
|
|
6565
6579
|
client_secret: clientSecret,
|
|
6566
6580
|
redirect_uri: redirectUrl
|
|
6567
6581
|
});
|
|
6568
|
-
const response = yield
|
|
6582
|
+
const response = yield import_axios31.default.post("https://api.vercel.com/v2/oauth/access_token", data, {
|
|
6569
6583
|
headers: {
|
|
6570
6584
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
6571
6585
|
}
|
|
@@ -6594,7 +6608,8 @@ var integrationsApi = {
|
|
|
6594
6608
|
openai: openaiApi,
|
|
6595
6609
|
text: textApi,
|
|
6596
6610
|
slack: slackApi,
|
|
6597
|
-
salesforce: salesforceApi
|
|
6611
|
+
salesforce: salesforceApi,
|
|
6612
|
+
klaviyo: klaviyoApi
|
|
6598
6613
|
};
|
|
6599
6614
|
|
|
6600
6615
|
// src/apis/platform/accounts/accounts/api.ts
|
|
@@ -9934,7 +9949,6 @@ function initApi(config, tokens) {
|
|
|
9934
9949
|
cdpCustomerEventMessageZod,
|
|
9935
9950
|
consoleClientInstance,
|
|
9936
9951
|
dpsClientInstance,
|
|
9937
|
-
enrichWorkflowTrigger,
|
|
9938
9952
|
extractTokenFromAuthorizationHeader,
|
|
9939
9953
|
getAdapterClientConfig,
|
|
9940
9954
|
getAdapterClientDefaultConfig,
|
|
@@ -10008,7 +10022,6 @@ function initApi(config, tokens) {
|
|
|
10008
10022
|
integrationSubscriptionZods,
|
|
10009
10023
|
isFilter,
|
|
10010
10024
|
isFilterGroup,
|
|
10011
|
-
isWorkflowBaseHttpTaskCore,
|
|
10012
10025
|
livechatClientInstance,
|
|
10013
10026
|
mailchimpClientInstance,
|
|
10014
10027
|
mailchimpEventsZods,
|