@livechat/developer-studio-api 3.0.57 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +128 -24
- package/dist/index.d.ts +128 -24
- package/dist/index.js +225 -148
- package/dist/index.mjs +223 -147
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -44,7 +44,7 @@ import axios2 from "axios";
|
|
|
44
44
|
// src/apis/integrations/github/instance.ts
|
|
45
45
|
import axios from "axios";
|
|
46
46
|
|
|
47
|
-
// src/types/errors
|
|
47
|
+
// src/types/api/errors.ts
|
|
48
48
|
var ApiErrorBase = class extends Error {
|
|
49
49
|
constructor(message, data, code) {
|
|
50
50
|
super(message);
|
|
@@ -70,6 +70,90 @@ var UnauthorizeApiError = class extends Error {
|
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
+
// src/types/api/client.ts
|
|
74
|
+
var ApiClient = class {
|
|
75
|
+
constructor(config, authorization) {
|
|
76
|
+
this.config = config;
|
|
77
|
+
this.authorization = authorization;
|
|
78
|
+
}
|
|
79
|
+
updateConfig(config) {
|
|
80
|
+
this.config = __spreadValues(__spreadValues({}, this.config), config);
|
|
81
|
+
}
|
|
82
|
+
updateAuthorization(authorization) {
|
|
83
|
+
this.authorization = __spreadValues(__spreadValues({}, this.authorization), authorization);
|
|
84
|
+
}
|
|
85
|
+
fetch(url, customConfig, customOptions) {
|
|
86
|
+
return __async(this, null, function* () {
|
|
87
|
+
var _a, _b, _c;
|
|
88
|
+
const authorization = (_a = customConfig == null ? void 0 : customConfig.authorization) != null ? _a : this.authorization;
|
|
89
|
+
if ((customConfig == null ? void 0 : customConfig.ensureAuthorization) && !authorization) {
|
|
90
|
+
throw new this.UnauthorizedError();
|
|
91
|
+
}
|
|
92
|
+
const options = __spreadValues(__spreadValues({}, this.options), customOptions);
|
|
93
|
+
const response = yield fetch(`${this.config.baseURL}${url}`, __spreadProps(__spreadValues({}, options), {
|
|
94
|
+
headers: __spreadValues(__spreadValues({}, options.headers), authorization ? {
|
|
95
|
+
Authorization: `${(_b = authorization.tokenType) != null ? _b : "Bearer"} ${authorization.token}`
|
|
96
|
+
} : void 0)
|
|
97
|
+
}));
|
|
98
|
+
if (!response.ok) {
|
|
99
|
+
const errorData = yield response.json();
|
|
100
|
+
const error = new this.Error(
|
|
101
|
+
(_c = customConfig == null ? void 0 : customConfig.customErrorMessage) != null ? _c : response.statusText,
|
|
102
|
+
errorData,
|
|
103
|
+
response.status
|
|
104
|
+
);
|
|
105
|
+
if (response.status === 401) {
|
|
106
|
+
throw new this.UnauthorizedError();
|
|
107
|
+
}
|
|
108
|
+
throw error;
|
|
109
|
+
}
|
|
110
|
+
const data = yield response.json();
|
|
111
|
+
return __spreadProps(__spreadValues({}, response), {
|
|
112
|
+
data
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
get(url, config, options) {
|
|
117
|
+
return __async(this, null, function* () {
|
|
118
|
+
return this.fetch(url, config, __spreadProps(__spreadValues({}, options), {
|
|
119
|
+
method: "GET"
|
|
120
|
+
}));
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
post(url, body, customConfig, customOptions) {
|
|
124
|
+
return __async(this, null, function* () {
|
|
125
|
+
return this.fetch(url, customConfig, __spreadProps(__spreadValues({}, customOptions), {
|
|
126
|
+
method: "POST",
|
|
127
|
+
body: JSON.stringify(body)
|
|
128
|
+
}));
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
patch(url, body, customConfig, customOptions) {
|
|
132
|
+
return __async(this, null, function* () {
|
|
133
|
+
return this.fetch(url, customConfig, __spreadProps(__spreadValues({}, customOptions), {
|
|
134
|
+
method: "PATCH",
|
|
135
|
+
body: JSON.stringify(body)
|
|
136
|
+
}));
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
put(url, body, customConfig, customOptions) {
|
|
140
|
+
return __async(this, null, function* () {
|
|
141
|
+
return this.fetch(url, customConfig, __spreadProps(__spreadValues({}, customOptions), {
|
|
142
|
+
method: "PUT",
|
|
143
|
+
body: JSON.stringify(body)
|
|
144
|
+
}));
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
delete(url, body, config, options) {
|
|
148
|
+
return __async(this, null, function* () {
|
|
149
|
+
return this.fetch(url, config, __spreadProps(__spreadValues({}, options), {
|
|
150
|
+
method: "DELETE",
|
|
151
|
+
body: JSON.stringify(body)
|
|
152
|
+
}));
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
|
|
73
157
|
// src/apis/integrations/github/instance.ts
|
|
74
158
|
var githubClientInstance = axios.create({
|
|
75
159
|
baseURL: "https://api.github.com",
|
|
@@ -3304,32 +3388,32 @@ var productsApi = {
|
|
|
3304
3388
|
};
|
|
3305
3389
|
|
|
3306
3390
|
// src/apis/platform/accounts/instance.ts
|
|
3307
|
-
import axios16 from "axios";
|
|
3308
3391
|
var AccountsApiError = class extends ApiErrorBase {
|
|
3309
3392
|
constructor() {
|
|
3310
3393
|
super(...arguments);
|
|
3311
3394
|
this.name = "accounts";
|
|
3312
3395
|
}
|
|
3313
3396
|
};
|
|
3314
|
-
var
|
|
3397
|
+
var UnauthorizeAccountsApiError = class extends UnauthorizeApiError {
|
|
3398
|
+
constructor(message) {
|
|
3399
|
+
super("accounts", message);
|
|
3400
|
+
}
|
|
3401
|
+
};
|
|
3402
|
+
var AccountApiClient = class extends ApiClient {
|
|
3403
|
+
constructor() {
|
|
3404
|
+
super(...arguments);
|
|
3405
|
+
this.UnauthorizedError = UnauthorizeAccountsApiError;
|
|
3406
|
+
this.Error = AccountsApiError;
|
|
3407
|
+
this.options = {
|
|
3408
|
+
headers: {
|
|
3409
|
+
"Content-Type": "application/json"
|
|
3410
|
+
}
|
|
3411
|
+
};
|
|
3412
|
+
}
|
|
3413
|
+
};
|
|
3414
|
+
var platformAccountsClientInstance = new AccountApiClient({
|
|
3315
3415
|
baseURL: "https://accounts.labs.livechatinc.com"
|
|
3316
3416
|
});
|
|
3317
|
-
platformAccountsClientInstance.interceptors.response.use(
|
|
3318
|
-
(response) => response,
|
|
3319
|
-
(error) => {
|
|
3320
|
-
var _a, _b, _c, _d;
|
|
3321
|
-
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
3322
|
-
return Promise.reject(new UnauthorizeApiError("accounts"));
|
|
3323
|
-
}
|
|
3324
|
-
return Promise.reject(
|
|
3325
|
-
new AccountsApiError(
|
|
3326
|
-
error.message,
|
|
3327
|
-
(_b = error.response) == null ? void 0 : _b.data,
|
|
3328
|
-
(_d = (_c = error.response) == null ? void 0 : _c.status) != null ? _d : 400
|
|
3329
|
-
)
|
|
3330
|
-
);
|
|
3331
|
-
}
|
|
3332
|
-
);
|
|
3333
3417
|
function getPlatformAccountsClientAuthorization(req) {
|
|
3334
3418
|
if (req.headers instanceof Headers) {
|
|
3335
3419
|
return {
|
|
@@ -3340,42 +3424,24 @@ function getPlatformAccountsClientAuthorization(req) {
|
|
|
3340
3424
|
token: req.headers["x-adapter-platform-token"]
|
|
3341
3425
|
};
|
|
3342
3426
|
}
|
|
3343
|
-
function getPlatformAccountsClientConfig(options = {}) {
|
|
3344
|
-
var _a;
|
|
3345
|
-
const defaultAuthorization = platformAccountsClientInstance.defaults.headers.Authorization;
|
|
3346
|
-
const headers = {
|
|
3347
|
-
authorization: (_a = options.token ? `Bearer ${options.token}` : void 0) != null ? _a : defaultAuthorization
|
|
3348
|
-
};
|
|
3349
|
-
return {
|
|
3350
|
-
headers: __spreadValues({}, headers.authorization ? { Authorization: headers.authorization } : {})
|
|
3351
|
-
};
|
|
3352
|
-
}
|
|
3353
3427
|
function initPlatformAccountsClient(baseUrl, token) {
|
|
3354
3428
|
if (baseUrl) {
|
|
3355
|
-
platformAccountsClientInstance.
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
return config;
|
|
3359
|
-
},
|
|
3360
|
-
(error) => Promise.reject(error)
|
|
3361
|
-
);
|
|
3362
|
-
}
|
|
3363
|
-
if (token) {
|
|
3364
|
-
platformAccountsClientInstance.defaults.headers.Authorization = `Bearer ${token}`;
|
|
3365
|
-
} else {
|
|
3366
|
-
delete platformAccountsClientInstance.defaults.headers.Authorization;
|
|
3429
|
+
platformAccountsClientInstance.updateConfig({
|
|
3430
|
+
baseURL: baseUrl
|
|
3431
|
+
});
|
|
3367
3432
|
}
|
|
3433
|
+
platformAccountsClientInstance.updateAuthorization({
|
|
3434
|
+
token
|
|
3435
|
+
});
|
|
3368
3436
|
}
|
|
3369
3437
|
|
|
3370
3438
|
// src/apis/platform/accounts/accounts/api.ts
|
|
3371
3439
|
var platformAccountsAccountApi = {
|
|
3372
3440
|
getAccounts(authorization) {
|
|
3373
3441
|
return __async(this, null, function* () {
|
|
3374
|
-
return platformAccountsClientInstance.get(
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
).catch((error) => {
|
|
3378
|
-
throw error.withCustomMessage("Accounts couldn't be fetched.");
|
|
3442
|
+
return platformAccountsClientInstance.get(`/v2/accounts`, {
|
|
3443
|
+
authorization,
|
|
3444
|
+
customErrorMessage: "Accounts couldn't be fetched."
|
|
3379
3445
|
});
|
|
3380
3446
|
});
|
|
3381
3447
|
},
|
|
@@ -3383,20 +3449,22 @@ var platformAccountsAccountApi = {
|
|
|
3383
3449
|
return __async(this, null, function* () {
|
|
3384
3450
|
return platformAccountsClientInstance.get(
|
|
3385
3451
|
`/v2/accounts/${accountId}`,
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3452
|
+
{
|
|
3453
|
+
authorization,
|
|
3454
|
+
customErrorMessage: "Account couldn't be fetched."
|
|
3455
|
+
}
|
|
3456
|
+
);
|
|
3390
3457
|
});
|
|
3391
3458
|
},
|
|
3392
3459
|
getMeAccount(authorization) {
|
|
3393
3460
|
return __async(this, null, function* () {
|
|
3394
3461
|
return platformAccountsClientInstance.get(
|
|
3395
3462
|
`/v2/accounts/me`,
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3463
|
+
{
|
|
3464
|
+
authorization,
|
|
3465
|
+
customErrorMessage: "Me account couldn't be fetched."
|
|
3466
|
+
}
|
|
3467
|
+
);
|
|
3400
3468
|
});
|
|
3401
3469
|
}
|
|
3402
3470
|
};
|
|
@@ -3407,30 +3475,29 @@ var platformAccountsClientApi = {
|
|
|
3407
3475
|
return __async(this, null, function* () {
|
|
3408
3476
|
return platformAccountsClientInstance.get(
|
|
3409
3477
|
`/v2/clients`,
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3478
|
+
{
|
|
3479
|
+
authorization,
|
|
3480
|
+
customErrorMessage: "Clients couldn't be fetched."
|
|
3481
|
+
}
|
|
3482
|
+
);
|
|
3414
3483
|
});
|
|
3415
3484
|
},
|
|
3416
3485
|
getClient(clientId, authorization) {
|
|
3417
3486
|
return __async(this, null, function* () {
|
|
3418
3487
|
return platformAccountsClientInstance.get(
|
|
3419
3488
|
`/v2/clients/${clientId}`,
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3489
|
+
{
|
|
3490
|
+
authorization,
|
|
3491
|
+
customErrorMessage: "Client couldn't be fetched."
|
|
3492
|
+
}
|
|
3493
|
+
);
|
|
3424
3494
|
});
|
|
3425
3495
|
},
|
|
3426
3496
|
createClient(payload, authorization) {
|
|
3427
3497
|
return __async(this, null, function* () {
|
|
3428
|
-
return platformAccountsClientInstance.post(
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
getPlatformAccountsClientConfig(authorization)
|
|
3432
|
-
).catch((error) => {
|
|
3433
|
-
throw error.withCustomMessage("Client couldn't be created.");
|
|
3498
|
+
return platformAccountsClientInstance.post(`/v2/clients`, payload, {
|
|
3499
|
+
authorization,
|
|
3500
|
+
customErrorMessage: "Client couldn't be created."
|
|
3434
3501
|
});
|
|
3435
3502
|
});
|
|
3436
3503
|
},
|
|
@@ -3439,20 +3506,23 @@ var platformAccountsClientApi = {
|
|
|
3439
3506
|
return platformAccountsClientInstance.patch(
|
|
3440
3507
|
`/v2/clients/${clientId}`,
|
|
3441
3508
|
payload,
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3509
|
+
{
|
|
3510
|
+
authorization,
|
|
3511
|
+
customErrorMessage: "Client couldn't be updated."
|
|
3512
|
+
}
|
|
3513
|
+
);
|
|
3446
3514
|
});
|
|
3447
3515
|
},
|
|
3448
3516
|
deleteClient(clientId, authorization) {
|
|
3449
3517
|
return __async(this, null, function* () {
|
|
3450
3518
|
return platformAccountsClientInstance.delete(
|
|
3451
3519
|
`/v2/clients/${clientId}`,
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3520
|
+
void 0,
|
|
3521
|
+
{
|
|
3522
|
+
authorization,
|
|
3523
|
+
customErrorMessage: "Clients couldn't be deleted."
|
|
3524
|
+
}
|
|
3525
|
+
);
|
|
3456
3526
|
});
|
|
3457
3527
|
},
|
|
3458
3528
|
updateClientScopes(clientId, scopes, authorization) {
|
|
@@ -3463,31 +3533,35 @@ var platformAccountsClientApi = {
|
|
|
3463
3533
|
scope: scope.scope,
|
|
3464
3534
|
required: scope.required
|
|
3465
3535
|
})),
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3536
|
+
{
|
|
3537
|
+
authorization,
|
|
3538
|
+
customErrorMessage: "Client scopes couldn't be updated."
|
|
3539
|
+
}
|
|
3540
|
+
);
|
|
3470
3541
|
});
|
|
3471
3542
|
},
|
|
3472
3543
|
deleteClientScopes(clientId, scopes, authorization) {
|
|
3473
3544
|
return __async(this, null, function* () {
|
|
3474
|
-
return platformAccountsClientInstance.delete(
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3545
|
+
return platformAccountsClientInstance.delete(
|
|
3546
|
+
`/v2/clients/${clientId}/scopes`,
|
|
3547
|
+
{
|
|
3548
|
+
data: scopes.map((scope) => ({
|
|
3549
|
+
scope: scope.scope,
|
|
3550
|
+
required: scope.required
|
|
3551
|
+
}))
|
|
3552
|
+
},
|
|
3553
|
+
{
|
|
3554
|
+
authorization,
|
|
3555
|
+
customErrorMessage: "Client scopes couldn't be deleted."
|
|
3556
|
+
}
|
|
3557
|
+
);
|
|
3482
3558
|
});
|
|
3483
3559
|
},
|
|
3484
3560
|
getInfo(authorization) {
|
|
3485
3561
|
return __async(this, null, function* () {
|
|
3486
|
-
return platformAccountsClientInstance.get(
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
).catch((error) => {
|
|
3490
|
-
throw error.withCustomMessage("Client info couldn't be fetched.");
|
|
3562
|
+
return platformAccountsClientInstance.get(`/v2/info`, {
|
|
3563
|
+
authorization,
|
|
3564
|
+
customErrorMessage: "Client info couldn't be fetched."
|
|
3491
3565
|
});
|
|
3492
3566
|
});
|
|
3493
3567
|
}
|
|
@@ -3499,20 +3573,22 @@ var platformAccountsOrganizationApi = {
|
|
|
3499
3573
|
return __async(this, null, function* () {
|
|
3500
3574
|
return platformAccountsClientInstance.get(
|
|
3501
3575
|
`/v2/organizations`,
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3576
|
+
{
|
|
3577
|
+
authorization,
|
|
3578
|
+
customErrorMessage: "Organizations couldn't be fetched."
|
|
3579
|
+
}
|
|
3580
|
+
);
|
|
3506
3581
|
});
|
|
3507
3582
|
},
|
|
3508
3583
|
getMyOrganization(authorization) {
|
|
3509
3584
|
return __async(this, null, function* () {
|
|
3510
3585
|
return platformAccountsClientInstance.get(
|
|
3511
3586
|
`/v2/organizations/my`,
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3587
|
+
{
|
|
3588
|
+
authorization,
|
|
3589
|
+
customErrorMessage: "My organization couldn't be fetched."
|
|
3590
|
+
}
|
|
3591
|
+
);
|
|
3516
3592
|
});
|
|
3517
3593
|
}
|
|
3518
3594
|
};
|
|
@@ -3521,10 +3597,9 @@ var platformAccountsOrganizationApi = {
|
|
|
3521
3597
|
var platformAccountsPersonalAccessTokenApi = {
|
|
3522
3598
|
getPersonalAccessTokens(authorization) {
|
|
3523
3599
|
return __async(this, null, function* () {
|
|
3524
|
-
return platformAccountsClientInstance.get(`/v2/personal_token`,
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
);
|
|
3600
|
+
return platformAccountsClientInstance.get(`/v2/personal_token`, {
|
|
3601
|
+
authorization,
|
|
3602
|
+
customErrorMessage: "Personal Access Tokens couldn't be fetched."
|
|
3528
3603
|
});
|
|
3529
3604
|
});
|
|
3530
3605
|
},
|
|
@@ -3536,24 +3611,23 @@ var platformAccountsPersonalAccessTokenApi = {
|
|
|
3536
3611
|
name,
|
|
3537
3612
|
scope: scopes.map((item) => item.name).filter((el) => el).join(",")
|
|
3538
3613
|
},
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
});
|
|
3614
|
+
{
|
|
3615
|
+
authorization,
|
|
3616
|
+
customErrorMessage: "Personal Access Token couldn't be created."
|
|
3617
|
+
}
|
|
3618
|
+
);
|
|
3545
3619
|
});
|
|
3546
3620
|
},
|
|
3547
3621
|
deletePersonalAccessToken(id, authorization) {
|
|
3548
3622
|
return __async(this, null, function* () {
|
|
3549
3623
|
return platformAccountsClientInstance.delete(
|
|
3550
3624
|
`/v2/personal_token/${id}`,
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
"Personal Access Tokens couldn't be deleted."
|
|
3555
|
-
|
|
3556
|
-
|
|
3625
|
+
void 0,
|
|
3626
|
+
{
|
|
3627
|
+
authorization,
|
|
3628
|
+
customErrorMessage: "Personal Access Tokens couldn't be deleted."
|
|
3629
|
+
}
|
|
3630
|
+
);
|
|
3557
3631
|
});
|
|
3558
3632
|
}
|
|
3559
3633
|
};
|
|
@@ -3564,10 +3638,8 @@ var platformAccountsProductsApi = {
|
|
|
3564
3638
|
return __async(this, null, function* () {
|
|
3565
3639
|
return platformAccountsClientInstance.get(
|
|
3566
3640
|
`/v2/organizations/my/products`,
|
|
3567
|
-
|
|
3568
|
-
)
|
|
3569
|
-
throw error.withCustomMessage("Products couldn't be fetched.");
|
|
3570
|
-
});
|
|
3641
|
+
{ authorization, customErrorMessage: "Products couldn't be fetched." }
|
|
3642
|
+
);
|
|
3571
3643
|
});
|
|
3572
3644
|
},
|
|
3573
3645
|
updateOrganizationProducts(payload, authorization) {
|
|
@@ -3575,10 +3647,8 @@ var platformAccountsProductsApi = {
|
|
|
3575
3647
|
return platformAccountsClientInstance.post(
|
|
3576
3648
|
`/v2/organizations/my/products`,
|
|
3577
3649
|
payload,
|
|
3578
|
-
|
|
3579
|
-
)
|
|
3580
|
-
throw error.withCustomMessage("Products couldn't be updated.");
|
|
3581
|
-
});
|
|
3650
|
+
{ authorization, customErrorMessage: "Products couldn't be updated." }
|
|
3651
|
+
);
|
|
3582
3652
|
});
|
|
3583
3653
|
}
|
|
3584
3654
|
};
|
|
@@ -3587,11 +3657,9 @@ var platformAccountsProductsApi = {
|
|
|
3587
3657
|
var platformAccountsScopesApi = {
|
|
3588
3658
|
getScopes(authorization) {
|
|
3589
3659
|
return __async(this, null, function* () {
|
|
3590
|
-
return platformAccountsClientInstance.get(
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
).catch((error) => {
|
|
3594
|
-
throw error.withCustomMessage("Scopes couldn't be fetched.");
|
|
3660
|
+
return platformAccountsClientInstance.get(`/v2/scopes`, {
|
|
3661
|
+
authorization,
|
|
3662
|
+
customErrorMessage: "Scopes couldn't be fetched."
|
|
3595
3663
|
});
|
|
3596
3664
|
});
|
|
3597
3665
|
}
|
|
@@ -3603,10 +3671,12 @@ var platformAccountsSessionsApi = {
|
|
|
3603
3671
|
return __async(this, null, function* () {
|
|
3604
3672
|
return platformAccountsClientInstance.delete(
|
|
3605
3673
|
`/v2/sessions`,
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3674
|
+
void 0,
|
|
3675
|
+
{
|
|
3676
|
+
authorization,
|
|
3677
|
+
customErrorMessage: "Sessions couldn't be fetched."
|
|
3678
|
+
}
|
|
3679
|
+
);
|
|
3610
3680
|
});
|
|
3611
3681
|
}
|
|
3612
3682
|
};
|
|
@@ -3622,13 +3692,18 @@ var platformAccountsTokenApi = {
|
|
|
3622
3692
|
client_secret: clientSecret,
|
|
3623
3693
|
redirect_uri: redirectUrl
|
|
3624
3694
|
});
|
|
3625
|
-
return platformAccountsClientInstance.post(
|
|
3626
|
-
|
|
3627
|
-
|
|
3695
|
+
return platformAccountsClientInstance.post(
|
|
3696
|
+
`/v2/token`,
|
|
3697
|
+
data,
|
|
3698
|
+
{
|
|
3699
|
+
customErrorMessage: "Couldn't exchange code for token."
|
|
3700
|
+
},
|
|
3701
|
+
{
|
|
3702
|
+
headers: {
|
|
3703
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
3704
|
+
}
|
|
3628
3705
|
}
|
|
3629
|
-
|
|
3630
|
-
throw error.withCustomMessage("Couldn't exchange code for token.");
|
|
3631
|
-
});
|
|
3706
|
+
);
|
|
3632
3707
|
});
|
|
3633
3708
|
}
|
|
3634
3709
|
};
|
|
@@ -3646,14 +3721,14 @@ var platformAccountsApi = {
|
|
|
3646
3721
|
};
|
|
3647
3722
|
|
|
3648
3723
|
// src/apis/platform/dps/instance.ts
|
|
3649
|
-
import
|
|
3724
|
+
import axios16 from "axios";
|
|
3650
3725
|
var DpsApiError = class extends ApiErrorBase {
|
|
3651
3726
|
constructor() {
|
|
3652
3727
|
super(...arguments);
|
|
3653
3728
|
this.name = "dps";
|
|
3654
3729
|
}
|
|
3655
3730
|
};
|
|
3656
|
-
var platformDpsClientInstance =
|
|
3731
|
+
var platformDpsClientInstance = axios16.create({
|
|
3657
3732
|
baseURL: "https://dev-platform.labs.livechatinc.com"
|
|
3658
3733
|
});
|
|
3659
3734
|
platformDpsClientInstance.interceptors.response.use(
|
|
@@ -5218,7 +5293,7 @@ var platformDpsApi = {
|
|
|
5218
5293
|
};
|
|
5219
5294
|
|
|
5220
5295
|
// src/apis/platform/adapter/instance.ts
|
|
5221
|
-
import
|
|
5296
|
+
import axios17 from "axios";
|
|
5222
5297
|
var REGION2 = {
|
|
5223
5298
|
FRA: "fra",
|
|
5224
5299
|
DAL: "dal",
|
|
@@ -5238,7 +5313,7 @@ var AdapterApiError = class extends ApiErrorBase {
|
|
|
5238
5313
|
this.name = "adapter";
|
|
5239
5314
|
}
|
|
5240
5315
|
};
|
|
5241
|
-
var platformAdapterClientInstance =
|
|
5316
|
+
var platformAdapterClientInstance = axios17.create({
|
|
5242
5317
|
baseURL: "https://platform.labs.text.com/console-adapter/api",
|
|
5243
5318
|
headers: {
|
|
5244
5319
|
"Content-Type": "application/json"
|
|
@@ -5931,8 +6006,8 @@ var WorkflowDefinitionTaskType = {
|
|
|
5931
6006
|
};
|
|
5932
6007
|
|
|
5933
6008
|
// src/apis/platform/billing/instance.ts
|
|
5934
|
-
import
|
|
5935
|
-
var platformBillingClientInstance =
|
|
6009
|
+
import axios18 from "axios";
|
|
6010
|
+
var platformBillingClientInstance = axios18.create({
|
|
5936
6011
|
baseURL: "https://billing.labs.livechatinc.com"
|
|
5937
6012
|
});
|
|
5938
6013
|
function getPlatformBillingClientAuthorization(req) {
|
|
@@ -6423,6 +6498,7 @@ export {
|
|
|
6423
6498
|
API_NOTIFICATIONS,
|
|
6424
6499
|
AccountsApiError,
|
|
6425
6500
|
AdapterApiError,
|
|
6501
|
+
ApiClient,
|
|
6426
6502
|
ApiErrorBase,
|
|
6427
6503
|
DpsApiError,
|
|
6428
6504
|
LivechatApiError,
|
|
@@ -6431,6 +6507,7 @@ export {
|
|
|
6431
6507
|
ShopifyApiError,
|
|
6432
6508
|
ShopifyEvents,
|
|
6433
6509
|
TextLivechatEvents,
|
|
6510
|
+
UnauthorizeAccountsApiError,
|
|
6434
6511
|
UnauthorizeApiError,
|
|
6435
6512
|
WorkflowDefinitionTaskType,
|
|
6436
6513
|
allAppTemplates,
|
|
@@ -6457,7 +6534,6 @@ export {
|
|
|
6457
6534
|
getPlanetScaleClientAuthorization,
|
|
6458
6535
|
getPlanetScaleClientConfig,
|
|
6459
6536
|
getPlatformAccountsClientAuthorization,
|
|
6460
|
-
getPlatformAccountsClientConfig,
|
|
6461
6537
|
getPlatformAdapterClientAuthorization,
|
|
6462
6538
|
getPlatformAdapterClientConfig,
|
|
6463
6539
|
getPlatformAdapterClientDefaultConfig,
|