@livechat/developer-studio-api 2.3.25 → 2.3.27
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 +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +33 -1
- package/dist/index.mjs +33 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -2101,6 +2101,9 @@ declare const api: {
|
|
|
2101
2101
|
sessions: {
|
|
2102
2102
|
readonly deleteSessions: (authorization?: PlatformAccountsClientInstanceAuthorization | undefined) => Promise<axios.AxiosResponse<void>>;
|
|
2103
2103
|
};
|
|
2104
|
+
token: {
|
|
2105
|
+
exchangeCode(code: string, clientId: string, clientSecret: string, redirectUrl: string): Promise<axios.AxiosResponse<AuthorizeData>>;
|
|
2106
|
+
};
|
|
2104
2107
|
};
|
|
2105
2108
|
billing: {
|
|
2106
2109
|
account: {
|
package/dist/index.d.ts
CHANGED
|
@@ -2101,6 +2101,9 @@ declare const api: {
|
|
|
2101
2101
|
sessions: {
|
|
2102
2102
|
readonly deleteSessions: (authorization?: PlatformAccountsClientInstanceAuthorization | undefined) => Promise<axios.AxiosResponse<void>>;
|
|
2103
2103
|
};
|
|
2104
|
+
token: {
|
|
2105
|
+
exchangeCode(code: string, clientId: string, clientSecret: string, redirectUrl: string): Promise<axios.AxiosResponse<AuthorizeData>>;
|
|
2106
|
+
};
|
|
2104
2107
|
};
|
|
2105
2108
|
billing: {
|
|
2106
2109
|
account: {
|
package/dist/index.js
CHANGED
|
@@ -3376,6 +3376,37 @@ var platformAccountsSessionsApi = {
|
|
|
3376
3376
|
}
|
|
3377
3377
|
};
|
|
3378
3378
|
|
|
3379
|
+
// src/apis/platform/accounts/token/api.ts
|
|
3380
|
+
var platformAccountsTokenApi = {
|
|
3381
|
+
exchangeCode(code, clientId, clientSecret, redirectUrl) {
|
|
3382
|
+
return __async(this, null, function* () {
|
|
3383
|
+
const data = new URLSearchParams({
|
|
3384
|
+
code,
|
|
3385
|
+
client_id: clientId,
|
|
3386
|
+
client_secret: clientSecret,
|
|
3387
|
+
redirect_uri: redirectUrl
|
|
3388
|
+
});
|
|
3389
|
+
try {
|
|
3390
|
+
return yield platformAccountsClientInstance.post(
|
|
3391
|
+
`/v2/token`,
|
|
3392
|
+
data,
|
|
3393
|
+
{
|
|
3394
|
+
headers: {
|
|
3395
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
3396
|
+
}
|
|
3397
|
+
}
|
|
3398
|
+
);
|
|
3399
|
+
} catch (error) {
|
|
3400
|
+
if (error instanceof Error) {
|
|
3401
|
+
throw new Error(`Couldn't exchange code for token. [${error.message}]`);
|
|
3402
|
+
} else {
|
|
3403
|
+
throw error;
|
|
3404
|
+
}
|
|
3405
|
+
}
|
|
3406
|
+
});
|
|
3407
|
+
}
|
|
3408
|
+
};
|
|
3409
|
+
|
|
3379
3410
|
// src/apis/platform/accounts/api.ts
|
|
3380
3411
|
var platformAccountsApi = {
|
|
3381
3412
|
account: platformAccountsAccountApi,
|
|
@@ -3384,7 +3415,8 @@ var platformAccountsApi = {
|
|
|
3384
3415
|
organization: platformAccountsOrganizationApi,
|
|
3385
3416
|
products: platformAccountsProductsApi,
|
|
3386
3417
|
scopes: platformAccountsScopesApi,
|
|
3387
|
-
sessions: platformAccountsSessionsApi
|
|
3418
|
+
sessions: platformAccountsSessionsApi,
|
|
3419
|
+
token: platformAccountsTokenApi
|
|
3388
3420
|
};
|
|
3389
3421
|
|
|
3390
3422
|
// src/apis/platform/dps/instance.ts
|
package/dist/index.mjs
CHANGED
|
@@ -3285,6 +3285,37 @@ var platformAccountsSessionsApi = {
|
|
|
3285
3285
|
}
|
|
3286
3286
|
};
|
|
3287
3287
|
|
|
3288
|
+
// src/apis/platform/accounts/token/api.ts
|
|
3289
|
+
var platformAccountsTokenApi = {
|
|
3290
|
+
exchangeCode(code, clientId, clientSecret, redirectUrl) {
|
|
3291
|
+
return __async(this, null, function* () {
|
|
3292
|
+
const data = new URLSearchParams({
|
|
3293
|
+
code,
|
|
3294
|
+
client_id: clientId,
|
|
3295
|
+
client_secret: clientSecret,
|
|
3296
|
+
redirect_uri: redirectUrl
|
|
3297
|
+
});
|
|
3298
|
+
try {
|
|
3299
|
+
return yield platformAccountsClientInstance.post(
|
|
3300
|
+
`/v2/token`,
|
|
3301
|
+
data,
|
|
3302
|
+
{
|
|
3303
|
+
headers: {
|
|
3304
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
3305
|
+
}
|
|
3306
|
+
}
|
|
3307
|
+
);
|
|
3308
|
+
} catch (error) {
|
|
3309
|
+
if (error instanceof Error) {
|
|
3310
|
+
throw new Error(`Couldn't exchange code for token. [${error.message}]`);
|
|
3311
|
+
} else {
|
|
3312
|
+
throw error;
|
|
3313
|
+
}
|
|
3314
|
+
}
|
|
3315
|
+
});
|
|
3316
|
+
}
|
|
3317
|
+
};
|
|
3318
|
+
|
|
3288
3319
|
// src/apis/platform/accounts/api.ts
|
|
3289
3320
|
var platformAccountsApi = {
|
|
3290
3321
|
account: platformAccountsAccountApi,
|
|
@@ -3293,7 +3324,8 @@ var platformAccountsApi = {
|
|
|
3293
3324
|
organization: platformAccountsOrganizationApi,
|
|
3294
3325
|
products: platformAccountsProductsApi,
|
|
3295
3326
|
scopes: platformAccountsScopesApi,
|
|
3296
|
-
sessions: platformAccountsSessionsApi
|
|
3327
|
+
sessions: platformAccountsSessionsApi,
|
|
3328
|
+
token: platformAccountsTokenApi
|
|
3297
3329
|
};
|
|
3298
3330
|
|
|
3299
3331
|
// src/apis/platform/dps/instance.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livechat/developer-studio-api",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.27",
|
|
4
4
|
"description": "This project is API for LiveChat Developer Studio.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"@types/node": "^17.0.12",
|
|
18
18
|
"tsup": "^7.1.0",
|
|
19
19
|
"typescript": "^5.1.6",
|
|
20
|
-
"
|
|
20
|
+
"config": "0.0.1",
|
|
21
21
|
"tsconfig": "0.0.1",
|
|
22
|
-
"config": "0.0.
|
|
22
|
+
"eslint-config-custom": "0.0.2"
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
|
25
25
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|