@livechat/developer-studio-api 2.3.29 → 2.3.30

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 CHANGED
@@ -2102,6 +2102,9 @@ declare const api: {
2102
2102
  sessions: {
2103
2103
  readonly deleteSessions: (authorization?: PlatformAccountsClientInstanceAuthorization | undefined) => Promise<axios.AxiosResponse<void>>;
2104
2104
  };
2105
+ token: {
2106
+ exchangeCode(code: string, clientId: string, clientSecret: string, redirectUrl: string): Promise<axios.AxiosResponse<AuthorizeData>>;
2107
+ };
2105
2108
  };
2106
2109
  billing: {
2107
2110
  account: {
package/dist/index.d.ts CHANGED
@@ -2102,6 +2102,9 @@ declare const api: {
2102
2102
  sessions: {
2103
2103
  readonly deleteSessions: (authorization?: PlatformAccountsClientInstanceAuthorization | undefined) => Promise<axios.AxiosResponse<void>>;
2104
2104
  };
2105
+ token: {
2106
+ exchangeCode(code: string, clientId: string, clientSecret: string, redirectUrl: string): Promise<axios.AxiosResponse<AuthorizeData>>;
2107
+ };
2105
2108
  };
2106
2109
  billing: {
2107
2110
  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.29",
3
+ "version": "2.3.30",
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,8 +17,8 @@
17
17
  "@types/node": "^17.0.12",
18
18
  "tsup": "^7.1.0",
19
19
  "typescript": "^5.1.6",
20
- "config": "0.0.1",
21
20
  "eslint-config-custom": "0.0.2",
21
+ "config": "0.0.1",
22
22
  "tsconfig": "0.0.1"
23
23
  },
24
24
  "scripts": {