@livechat/developer-studio-api 3.1.15 → 3.1.17

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
@@ -4059,7 +4059,7 @@ declare const api: {
4059
4059
  readonly getAccountInfo: (product: BillingProduct, authorization?: PlatformClientAuthorization | undefined) => Promise<axios.AxiosResponse<BillingAccountInfoDto, any>>;
4060
4060
  };
4061
4061
  invoices: {
4062
- readonly getInvoices: (authorization?: PlatformClientAuthorization | undefined) => Promise<axios.AxiosResponse<{
4062
+ readonly getInvoices: (product: BillingProduct, authorization?: PlatformClientAuthorization | undefined) => Promise<axios.AxiosResponse<{
4063
4063
  result: BillingInvoiceDto[];
4064
4064
  }, any>>;
4065
4065
  readonly downloadInvoices: (number: number, authorization?: PlatformClientAuthorization | undefined) => Promise<void>;
@@ -4551,6 +4551,9 @@ declare const api: {
4551
4551
  hook: {
4552
4552
  addBuildHooks(siteId: string, authorization?: NetlifyClientAuthorization | undefined): Promise<void>;
4553
4553
  };
4554
+ getToken(code: string, clientId: string, clientSecret: string, redirectUri: string): Promise<{
4555
+ token: string;
4556
+ }>;
4554
4557
  };
4555
4558
  vercel: {
4556
4559
  project: {
package/dist/index.d.ts CHANGED
@@ -4059,7 +4059,7 @@ declare const api: {
4059
4059
  readonly getAccountInfo: (product: BillingProduct, authorization?: PlatformClientAuthorization | undefined) => Promise<axios.AxiosResponse<BillingAccountInfoDto, any>>;
4060
4060
  };
4061
4061
  invoices: {
4062
- readonly getInvoices: (authorization?: PlatformClientAuthorization | undefined) => Promise<axios.AxiosResponse<{
4062
+ readonly getInvoices: (product: BillingProduct, authorization?: PlatformClientAuthorization | undefined) => Promise<axios.AxiosResponse<{
4063
4063
  result: BillingInvoiceDto[];
4064
4064
  }, any>>;
4065
4065
  readonly downloadInvoices: (number: number, authorization?: PlatformClientAuthorization | undefined) => Promise<void>;
@@ -4551,6 +4551,9 @@ declare const api: {
4551
4551
  hook: {
4552
4552
  addBuildHooks(siteId: string, authorization?: NetlifyClientAuthorization | undefined): Promise<void>;
4553
4553
  };
4554
+ getToken(code: string, clientId: string, clientSecret: string, redirectUri: string): Promise<{
4555
+ token: string;
4556
+ }>;
4554
4557
  };
4555
4558
  vercel: {
4556
4559
  project: {
package/dist/index.js CHANGED
@@ -746,6 +746,9 @@ var gitHubApi = {
746
746
  }
747
747
  };
748
748
 
749
+ // src/apis/integrations/netlify/api.ts
750
+ var import_axios6 = __toESM(require("axios"));
751
+
749
752
  // src/apis/integrations/netlify/account/api.ts
750
753
  var import_axios5 = require("axios");
751
754
 
@@ -1207,15 +1210,40 @@ var netlifyApi = {
1207
1210
  account: netlifyAccountApi,
1208
1211
  site: netlifySiteApi,
1209
1212
  key: netlifyKeyApi,
1210
- hook: netlifyHookApi
1213
+ hook: netlifyHookApi,
1214
+ getToken(code, clientId, clientSecret, redirectUri) {
1215
+ return __async(this, null, function* () {
1216
+ var _a;
1217
+ const data = new URLSearchParams({
1218
+ code,
1219
+ client_id: clientId,
1220
+ client_secret: clientSecret,
1221
+ redirect_uri: redirectUri,
1222
+ grant_type: "authorization_code"
1223
+ });
1224
+ const response = yield import_axios6.default.post(
1225
+ "https://api.netlify.com/oauth/token",
1226
+ data,
1227
+ {
1228
+ headers: {
1229
+ "Content-Type": "application/x-www-form-urlencoded"
1230
+ }
1231
+ }
1232
+ );
1233
+ const params = new URLSearchParams(response.data);
1234
+ return {
1235
+ token: (_a = params.get("access_token")) != null ? _a : ""
1236
+ };
1237
+ });
1238
+ }
1211
1239
  };
1212
1240
 
1213
1241
  // src/apis/integrations/planetscale/api.ts
1214
- var import_axios7 = __toESM(require("axios"));
1242
+ var import_axios8 = __toESM(require("axios"));
1215
1243
 
1216
1244
  // src/apis/integrations/planetscale/instance.ts
1217
- var import_axios6 = __toESM(require("axios"));
1218
- var planetScaleClientInstance = import_axios6.default.create({
1245
+ var import_axios7 = __toESM(require("axios"));
1246
+ var planetScaleClientInstance = import_axios7.default.create({
1219
1247
  baseURL: "https://api.planetscale.com",
1220
1248
  headers: {
1221
1249
  "Content-Type": "application/json"
@@ -1225,7 +1253,7 @@ planetScaleClientInstance.interceptors.response.use(
1225
1253
  (r) => r,
1226
1254
  (error) => {
1227
1255
  var _a;
1228
- if (import_axios6.default.isAxiosError(error)) {
1256
+ if (import_axios7.default.isAxiosError(error)) {
1229
1257
  if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
1230
1258
  throw new UnauthorizeApiError("planetscale");
1231
1259
  }
@@ -1426,7 +1454,7 @@ var planetscaleApi = {
1426
1454
  redirect_uri: redirectUrl,
1427
1455
  grant_type: "authorization_code"
1428
1456
  });
1429
- const response = yield import_axios7.default.post(
1457
+ const response = yield import_axios8.default.post(
1430
1458
  `https://api.planetscale.com/v1/organizations/${organization}/oauth-applications/${applicationId}/token`,
1431
1459
  data,
1432
1460
  {
@@ -1446,21 +1474,21 @@ var planetscaleApi = {
1446
1474
  };
1447
1475
 
1448
1476
  // src/apis/integrations/text/instance.ts
1449
- var import_axios8 = __toESM(require("axios"));
1477
+ var import_axios9 = __toESM(require("axios"));
1450
1478
  var TextApiError = class extends ApiErrorBase {
1451
1479
  constructor() {
1452
1480
  super(...arguments);
1453
1481
  this.name = "text";
1454
1482
  }
1455
1483
  };
1456
- var textClientInstance = import_axios8.default.create({
1484
+ var textClientInstance = import_axios9.default.create({
1457
1485
  baseURL: "https://api.labs.text.com"
1458
1486
  });
1459
1487
  textClientInstance.interceptors.response.use(
1460
1488
  (r) => r,
1461
1489
  (error) => {
1462
1490
  var _a, _b, _c, _d;
1463
- if (import_axios8.default.isAxiosError(error)) {
1491
+ if (import_axios9.default.isAxiosError(error)) {
1464
1492
  if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
1465
1493
  throw new UnauthorizeApiError("text");
1466
1494
  }
@@ -2098,18 +2126,18 @@ var textApi = {
2098
2126
  };
2099
2127
 
2100
2128
  // src/apis/integrations/vercel/api.ts
2101
- var import_axios10 = __toESM(require("axios"));
2129
+ var import_axios11 = __toESM(require("axios"));
2102
2130
 
2103
2131
  // src/apis/integrations/vercel/instance.ts
2104
- var import_axios9 = __toESM(require("axios"));
2105
- var vercelClientInstance = import_axios9.default.create({
2132
+ var import_axios10 = __toESM(require("axios"));
2133
+ var vercelClientInstance = import_axios10.default.create({
2106
2134
  baseURL: "https://api.vercel.com"
2107
2135
  });
2108
2136
  vercelClientInstance.interceptors.response.use(
2109
2137
  (r) => r,
2110
2138
  (error) => {
2111
2139
  var _a, _b;
2112
- if (import_axios9.default.isAxiosError(error)) {
2140
+ if (import_axios10.default.isAxiosError(error)) {
2113
2141
  if (((_a = error.response) == null ? void 0 : _a.status) === 401 || ((_b = error.response) == null ? void 0 : _b.status) === 403) {
2114
2142
  throw new UnauthorizeApiError("vercel");
2115
2143
  }
@@ -2403,7 +2431,7 @@ var vercelApi = {
2403
2431
  client_secret: clientSecret,
2404
2432
  redirect_uri: redirectUrl
2405
2433
  });
2406
- const response = yield import_axios10.default.post("https://api.vercel.com/v2/oauth/access_token", data, {
2434
+ const response = yield import_axios11.default.post("https://api.vercel.com/v2/oauth/access_token", data, {
2407
2435
  headers: {
2408
2436
  "Content-Type": "application/x-www-form-urlencoded"
2409
2437
  }
@@ -2419,11 +2447,11 @@ var vercelApi = {
2419
2447
  };
2420
2448
 
2421
2449
  // src/apis/integrations/neon/api.ts
2422
- var import_axios12 = __toESM(require("axios"));
2450
+ var import_axios13 = __toESM(require("axios"));
2423
2451
 
2424
2452
  // src/apis/integrations/neon/instance.ts
2425
- var import_axios11 = __toESM(require("axios"));
2426
- var neonClientInstance = import_axios11.default.create({
2453
+ var import_axios12 = __toESM(require("axios"));
2454
+ var neonClientInstance = import_axios12.default.create({
2427
2455
  baseURL: "https://console.neon.tech/api/v2",
2428
2456
  headers: {
2429
2457
  "Content-Type": "application/json"
@@ -2433,7 +2461,7 @@ neonClientInstance.interceptors.response.use(
2433
2461
  (r) => r,
2434
2462
  (error) => {
2435
2463
  var _a;
2436
- if (import_axios11.default.isAxiosError(error)) {
2464
+ if (import_axios12.default.isAxiosError(error)) {
2437
2465
  if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
2438
2466
  throw new UnauthorizeApiError("neon");
2439
2467
  }
@@ -2700,7 +2728,7 @@ var neonApi = {
2700
2728
  redirect_uri: redirectUri,
2701
2729
  grant_type: "authorization_code"
2702
2730
  });
2703
- const response = yield import_axios12.default.post(
2731
+ const response = yield import_axios13.default.post(
2704
2732
  "https://oauth2.neon.tech/oauth2/token",
2705
2733
  data,
2706
2734
  {
@@ -2725,7 +2753,7 @@ var neonApi = {
2725
2753
  client_secret: clientSecret,
2726
2754
  grant_type: "refresh_token"
2727
2755
  });
2728
- const response = yield import_axios12.default.post("https://oauth2.neon.tech/oauth2/token", data, {
2756
+ const response = yield import_axios13.default.post("https://oauth2.neon.tech/oauth2/token", data, {
2729
2757
  headers: {
2730
2758
  "Content-Type": "application/x-www-form-urlencoded"
2731
2759
  }
@@ -2740,10 +2768,10 @@ var neonApi = {
2740
2768
  };
2741
2769
 
2742
2770
  // src/apis/integrations/mailchimp/api.ts
2743
- var import_axios14 = __toESM(require("axios"));
2771
+ var import_axios15 = __toESM(require("axios"));
2744
2772
 
2745
2773
  // src/apis/integrations/mailchimp/instance.ts
2746
- var import_axios13 = __toESM(require("axios"));
2774
+ var import_axios14 = __toESM(require("axios"));
2747
2775
  var MailchimpApiError = class extends ApiErrorBase {
2748
2776
  constructor() {
2749
2777
  super(...arguments);
@@ -2751,7 +2779,7 @@ var MailchimpApiError = class extends ApiErrorBase {
2751
2779
  }
2752
2780
  };
2753
2781
  var getMailchimpClientUrl = (server) => `https://${server}.api.mailchimp.com/3.0`;
2754
- var mailchimpClientInstance = import_axios13.default.create({
2782
+ var mailchimpClientInstance = import_axios14.default.create({
2755
2783
  headers: {
2756
2784
  "Content-Type": "application/json"
2757
2785
  }
@@ -2760,7 +2788,7 @@ mailchimpClientInstance.interceptors.response.use(
2760
2788
  (r) => r,
2761
2789
  (error) => {
2762
2790
  var _a, _b, _c, _d;
2763
- if (import_axios13.default.isAxiosError(error)) {
2791
+ if (import_axios14.default.isAxiosError(error)) {
2764
2792
  if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
2765
2793
  throw new UnauthorizeApiError("mailchimp");
2766
2794
  }
@@ -2877,7 +2905,7 @@ var mailchimpApi = {
2877
2905
  redirect_uri: redirectUri,
2878
2906
  grant_type: "authorization_code"
2879
2907
  });
2880
- const tokenResponse = yield import_axios14.default.post(
2908
+ const tokenResponse = yield import_axios15.default.post(
2881
2909
  "https://login.mailchimp.com/oauth2/token",
2882
2910
  data,
2883
2911
  {
@@ -2898,7 +2926,7 @@ var mailchimpApi = {
2898
2926
  return __async(this, arguments, function* ({ token }) {
2899
2927
  const {
2900
2928
  data: { dc: server }
2901
- } = yield import_axios14.default.get(
2929
+ } = yield import_axios15.default.get(
2902
2930
  "https://login.mailchimp.com/oauth2/metadata",
2903
2931
  {
2904
2932
  headers: {
@@ -2915,22 +2943,22 @@ var mailchimpApi = {
2915
2943
  };
2916
2944
 
2917
2945
  // src/apis/integrations/shopify/api.ts
2918
- var import_axios16 = __toESM(require("axios"));
2946
+ var import_axios17 = __toESM(require("axios"));
2919
2947
 
2920
2948
  // src/apis/integrations/shopify/instance.ts
2921
- var import_axios15 = __toESM(require("axios"));
2949
+ var import_axios16 = __toESM(require("axios"));
2922
2950
  var ShopifyApiError = class extends ApiErrorBase {
2923
2951
  constructor() {
2924
2952
  super(...arguments);
2925
2953
  this.name = "shopify";
2926
2954
  }
2927
2955
  };
2928
- var shopifyClientInstance = import_axios15.default.create();
2956
+ var shopifyClientInstance = import_axios16.default.create();
2929
2957
  shopifyClientInstance.interceptors.response.use(
2930
2958
  (r) => r,
2931
2959
  (error) => {
2932
2960
  var _a, _b, _c, _d;
2933
- if (import_axios15.default.isAxiosError(error)) {
2961
+ if (import_axios16.default.isAxiosError(error)) {
2934
2962
  if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
2935
2963
  throw new UnauthorizeApiError("shopify");
2936
2964
  }
@@ -3046,7 +3074,7 @@ var shopifyApi = {
3046
3074
  redirect_uri: redirectUri,
3047
3075
  grant_type: "authorization_code"
3048
3076
  });
3049
- const response = yield import_axios16.default.post(
3077
+ const response = yield import_axios17.default.post(
3050
3078
  `https://${shop}.myshopify.com/admin/oauth/access_token`,
3051
3079
  data,
3052
3080
  {
@@ -3076,7 +3104,7 @@ var integrationsApi = {
3076
3104
  };
3077
3105
 
3078
3106
  // src/apis/products/livechat/instance.ts
3079
- var import_axios17 = __toESM(require("axios"));
3107
+ var import_axios18 = __toESM(require("axios"));
3080
3108
  var REGION = {
3081
3109
  FRA: "fra",
3082
3110
  DAL: "dal",
@@ -3096,7 +3124,7 @@ var LivechatApiError = class extends ApiErrorBase {
3096
3124
  this.name = "livechat";
3097
3125
  }
3098
3126
  };
3099
- var livechatClientInstance = import_axios17.default.create({
3127
+ var livechatClientInstance = import_axios18.default.create({
3100
3128
  baseURL: "https://api.labs.livechatinc.com"
3101
3129
  });
3102
3130
  livechatClientInstance.interceptors.response.use(
@@ -3994,14 +4022,14 @@ var platformAccountsApi = {
3994
4022
  };
3995
4023
 
3996
4024
  // src/apis/platform/dps/instance.ts
3997
- var import_axios18 = __toESM(require("axios"));
4025
+ var import_axios19 = __toESM(require("axios"));
3998
4026
  var DpsApiError = class extends ApiErrorBase {
3999
4027
  constructor() {
4000
4028
  super(...arguments);
4001
4029
  this.name = "dps";
4002
4030
  }
4003
4031
  };
4004
- var platformDpsClientInstance = import_axios18.default.create({
4032
+ var platformDpsClientInstance = import_axios19.default.create({
4005
4033
  baseURL: "https://dev-platform.labs.livechatinc.com"
4006
4034
  });
4007
4035
  platformDpsClientInstance.interceptors.response.use(
@@ -5566,7 +5594,7 @@ var platformDpsApi = {
5566
5594
  };
5567
5595
 
5568
5596
  // src/apis/platform/adapter/instance.ts
5569
- var import_axios19 = __toESM(require("axios"));
5597
+ var import_axios20 = __toESM(require("axios"));
5570
5598
  var REGION2 = {
5571
5599
  FRA: "fra",
5572
5600
  DAL: "dal",
@@ -5586,7 +5614,7 @@ var AdapterApiError = class extends ApiErrorBase {
5586
5614
  this.name = "adapter";
5587
5615
  }
5588
5616
  };
5589
- var platformAdapterClientInstance = import_axios19.default.create({
5617
+ var platformAdapterClientInstance = import_axios20.default.create({
5590
5618
  baseURL: "https://platform.labs.text.com/console-adapter/api",
5591
5619
  headers: {
5592
5620
  "Content-Type": "application/json"
@@ -6279,8 +6307,8 @@ var WorkflowDefinitionTaskType = {
6279
6307
  };
6280
6308
 
6281
6309
  // src/apis/platform/billing/instance.ts
6282
- var import_axios20 = __toESM(require("axios"));
6283
- var platformBillingClientInstance = import_axios20.default.create({
6310
+ var import_axios21 = __toESM(require("axios"));
6311
+ var platformBillingClientInstance = import_axios21.default.create({
6284
6312
  baseURL: "https://billing.labs.livechatinc.com"
6285
6313
  });
6286
6314
  function getPlatformBillingClientAuthorization(req) {
@@ -6763,10 +6791,13 @@ var platformBillingAccountApi = {
6763
6791
 
6764
6792
  // src/apis/platform/billing/invoices/api.ts
6765
6793
  var platformBillingInvoicesApi = {
6766
- getInvoices(authorization) {
6794
+ getInvoices(product, authorization) {
6767
6795
  return __async(this, null, function* () {
6768
6796
  try {
6769
- return yield platformBillingClientInstance.get(`/v1/invoices`, getPlatformBillingClientConfig(authorization));
6797
+ return yield platformBillingClientInstance.get(
6798
+ `/v2/invoices/${product}`,
6799
+ getPlatformBillingClientConfig(authorization)
6800
+ );
6770
6801
  } catch (error) {
6771
6802
  if (error instanceof Error) {
6772
6803
  throw new Error(`Invoices couldn't be fetched. [${error.message}]`);
package/dist/index.mjs CHANGED
@@ -615,6 +615,9 @@ var gitHubApi = {
615
615
  }
616
616
  };
617
617
 
618
+ // src/apis/integrations/netlify/api.ts
619
+ import axios4 from "axios";
620
+
618
621
  // src/apis/integrations/netlify/account/api.ts
619
622
  import { AxiosError as AxiosError2 } from "axios";
620
623
 
@@ -1076,15 +1079,40 @@ var netlifyApi = {
1076
1079
  account: netlifyAccountApi,
1077
1080
  site: netlifySiteApi,
1078
1081
  key: netlifyKeyApi,
1079
- hook: netlifyHookApi
1082
+ hook: netlifyHookApi,
1083
+ getToken(code, clientId, clientSecret, redirectUri) {
1084
+ return __async(this, null, function* () {
1085
+ var _a;
1086
+ const data = new URLSearchParams({
1087
+ code,
1088
+ client_id: clientId,
1089
+ client_secret: clientSecret,
1090
+ redirect_uri: redirectUri,
1091
+ grant_type: "authorization_code"
1092
+ });
1093
+ const response = yield axios4.post(
1094
+ "https://api.netlify.com/oauth/token",
1095
+ data,
1096
+ {
1097
+ headers: {
1098
+ "Content-Type": "application/x-www-form-urlencoded"
1099
+ }
1100
+ }
1101
+ );
1102
+ const params = new URLSearchParams(response.data);
1103
+ return {
1104
+ token: (_a = params.get("access_token")) != null ? _a : ""
1105
+ };
1106
+ });
1107
+ }
1080
1108
  };
1081
1109
 
1082
1110
  // src/apis/integrations/planetscale/api.ts
1083
- import axios5 from "axios";
1111
+ import axios6 from "axios";
1084
1112
 
1085
1113
  // src/apis/integrations/planetscale/instance.ts
1086
- import axios4 from "axios";
1087
- var planetScaleClientInstance = axios4.create({
1114
+ import axios5 from "axios";
1115
+ var planetScaleClientInstance = axios5.create({
1088
1116
  baseURL: "https://api.planetscale.com",
1089
1117
  headers: {
1090
1118
  "Content-Type": "application/json"
@@ -1094,7 +1122,7 @@ planetScaleClientInstance.interceptors.response.use(
1094
1122
  (r) => r,
1095
1123
  (error) => {
1096
1124
  var _a;
1097
- if (axios4.isAxiosError(error)) {
1125
+ if (axios5.isAxiosError(error)) {
1098
1126
  if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
1099
1127
  throw new UnauthorizeApiError("planetscale");
1100
1128
  }
@@ -1295,7 +1323,7 @@ var planetscaleApi = {
1295
1323
  redirect_uri: redirectUrl,
1296
1324
  grant_type: "authorization_code"
1297
1325
  });
1298
- const response = yield axios5.post(
1326
+ const response = yield axios6.post(
1299
1327
  `https://api.planetscale.com/v1/organizations/${organization}/oauth-applications/${applicationId}/token`,
1300
1328
  data,
1301
1329
  {
@@ -1315,21 +1343,21 @@ var planetscaleApi = {
1315
1343
  };
1316
1344
 
1317
1345
  // src/apis/integrations/text/instance.ts
1318
- import axios6 from "axios";
1346
+ import axios7 from "axios";
1319
1347
  var TextApiError = class extends ApiErrorBase {
1320
1348
  constructor() {
1321
1349
  super(...arguments);
1322
1350
  this.name = "text";
1323
1351
  }
1324
1352
  };
1325
- var textClientInstance = axios6.create({
1353
+ var textClientInstance = axios7.create({
1326
1354
  baseURL: "https://api.labs.text.com"
1327
1355
  });
1328
1356
  textClientInstance.interceptors.response.use(
1329
1357
  (r) => r,
1330
1358
  (error) => {
1331
1359
  var _a, _b, _c, _d;
1332
- if (axios6.isAxiosError(error)) {
1360
+ if (axios7.isAxiosError(error)) {
1333
1361
  if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
1334
1362
  throw new UnauthorizeApiError("text");
1335
1363
  }
@@ -1967,18 +1995,18 @@ var textApi = {
1967
1995
  };
1968
1996
 
1969
1997
  // src/apis/integrations/vercel/api.ts
1970
- import axios8 from "axios";
1998
+ import axios9 from "axios";
1971
1999
 
1972
2000
  // src/apis/integrations/vercel/instance.ts
1973
- import axios7 from "axios";
1974
- var vercelClientInstance = axios7.create({
2001
+ import axios8 from "axios";
2002
+ var vercelClientInstance = axios8.create({
1975
2003
  baseURL: "https://api.vercel.com"
1976
2004
  });
1977
2005
  vercelClientInstance.interceptors.response.use(
1978
2006
  (r) => r,
1979
2007
  (error) => {
1980
2008
  var _a, _b;
1981
- if (axios7.isAxiosError(error)) {
2009
+ if (axios8.isAxiosError(error)) {
1982
2010
  if (((_a = error.response) == null ? void 0 : _a.status) === 401 || ((_b = error.response) == null ? void 0 : _b.status) === 403) {
1983
2011
  throw new UnauthorizeApiError("vercel");
1984
2012
  }
@@ -2272,7 +2300,7 @@ var vercelApi = {
2272
2300
  client_secret: clientSecret,
2273
2301
  redirect_uri: redirectUrl
2274
2302
  });
2275
- const response = yield axios8.post("https://api.vercel.com/v2/oauth/access_token", data, {
2303
+ const response = yield axios9.post("https://api.vercel.com/v2/oauth/access_token", data, {
2276
2304
  headers: {
2277
2305
  "Content-Type": "application/x-www-form-urlencoded"
2278
2306
  }
@@ -2288,11 +2316,11 @@ var vercelApi = {
2288
2316
  };
2289
2317
 
2290
2318
  // src/apis/integrations/neon/api.ts
2291
- import axios10 from "axios";
2319
+ import axios11 from "axios";
2292
2320
 
2293
2321
  // src/apis/integrations/neon/instance.ts
2294
- import axios9 from "axios";
2295
- var neonClientInstance = axios9.create({
2322
+ import axios10 from "axios";
2323
+ var neonClientInstance = axios10.create({
2296
2324
  baseURL: "https://console.neon.tech/api/v2",
2297
2325
  headers: {
2298
2326
  "Content-Type": "application/json"
@@ -2302,7 +2330,7 @@ neonClientInstance.interceptors.response.use(
2302
2330
  (r) => r,
2303
2331
  (error) => {
2304
2332
  var _a;
2305
- if (axios9.isAxiosError(error)) {
2333
+ if (axios10.isAxiosError(error)) {
2306
2334
  if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
2307
2335
  throw new UnauthorizeApiError("neon");
2308
2336
  }
@@ -2569,7 +2597,7 @@ var neonApi = {
2569
2597
  redirect_uri: redirectUri,
2570
2598
  grant_type: "authorization_code"
2571
2599
  });
2572
- const response = yield axios10.post(
2600
+ const response = yield axios11.post(
2573
2601
  "https://oauth2.neon.tech/oauth2/token",
2574
2602
  data,
2575
2603
  {
@@ -2594,7 +2622,7 @@ var neonApi = {
2594
2622
  client_secret: clientSecret,
2595
2623
  grant_type: "refresh_token"
2596
2624
  });
2597
- const response = yield axios10.post("https://oauth2.neon.tech/oauth2/token", data, {
2625
+ const response = yield axios11.post("https://oauth2.neon.tech/oauth2/token", data, {
2598
2626
  headers: {
2599
2627
  "Content-Type": "application/x-www-form-urlencoded"
2600
2628
  }
@@ -2609,10 +2637,10 @@ var neonApi = {
2609
2637
  };
2610
2638
 
2611
2639
  // src/apis/integrations/mailchimp/api.ts
2612
- import axios12 from "axios";
2640
+ import axios13 from "axios";
2613
2641
 
2614
2642
  // src/apis/integrations/mailchimp/instance.ts
2615
- import axios11 from "axios";
2643
+ import axios12 from "axios";
2616
2644
  var MailchimpApiError = class extends ApiErrorBase {
2617
2645
  constructor() {
2618
2646
  super(...arguments);
@@ -2620,7 +2648,7 @@ var MailchimpApiError = class extends ApiErrorBase {
2620
2648
  }
2621
2649
  };
2622
2650
  var getMailchimpClientUrl = (server) => `https://${server}.api.mailchimp.com/3.0`;
2623
- var mailchimpClientInstance = axios11.create({
2651
+ var mailchimpClientInstance = axios12.create({
2624
2652
  headers: {
2625
2653
  "Content-Type": "application/json"
2626
2654
  }
@@ -2629,7 +2657,7 @@ mailchimpClientInstance.interceptors.response.use(
2629
2657
  (r) => r,
2630
2658
  (error) => {
2631
2659
  var _a, _b, _c, _d;
2632
- if (axios11.isAxiosError(error)) {
2660
+ if (axios12.isAxiosError(error)) {
2633
2661
  if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
2634
2662
  throw new UnauthorizeApiError("mailchimp");
2635
2663
  }
@@ -2746,7 +2774,7 @@ var mailchimpApi = {
2746
2774
  redirect_uri: redirectUri,
2747
2775
  grant_type: "authorization_code"
2748
2776
  });
2749
- const tokenResponse = yield axios12.post(
2777
+ const tokenResponse = yield axios13.post(
2750
2778
  "https://login.mailchimp.com/oauth2/token",
2751
2779
  data,
2752
2780
  {
@@ -2767,7 +2795,7 @@ var mailchimpApi = {
2767
2795
  return __async(this, arguments, function* ({ token }) {
2768
2796
  const {
2769
2797
  data: { dc: server }
2770
- } = yield axios12.get(
2798
+ } = yield axios13.get(
2771
2799
  "https://login.mailchimp.com/oauth2/metadata",
2772
2800
  {
2773
2801
  headers: {
@@ -2784,22 +2812,22 @@ var mailchimpApi = {
2784
2812
  };
2785
2813
 
2786
2814
  // src/apis/integrations/shopify/api.ts
2787
- import axios14 from "axios";
2815
+ import axios15 from "axios";
2788
2816
 
2789
2817
  // src/apis/integrations/shopify/instance.ts
2790
- import axios13 from "axios";
2818
+ import axios14 from "axios";
2791
2819
  var ShopifyApiError = class extends ApiErrorBase {
2792
2820
  constructor() {
2793
2821
  super(...arguments);
2794
2822
  this.name = "shopify";
2795
2823
  }
2796
2824
  };
2797
- var shopifyClientInstance = axios13.create();
2825
+ var shopifyClientInstance = axios14.create();
2798
2826
  shopifyClientInstance.interceptors.response.use(
2799
2827
  (r) => r,
2800
2828
  (error) => {
2801
2829
  var _a, _b, _c, _d;
2802
- if (axios13.isAxiosError(error)) {
2830
+ if (axios14.isAxiosError(error)) {
2803
2831
  if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
2804
2832
  throw new UnauthorizeApiError("shopify");
2805
2833
  }
@@ -2915,7 +2943,7 @@ var shopifyApi = {
2915
2943
  redirect_uri: redirectUri,
2916
2944
  grant_type: "authorization_code"
2917
2945
  });
2918
- const response = yield axios14.post(
2946
+ const response = yield axios15.post(
2919
2947
  `https://${shop}.myshopify.com/admin/oauth/access_token`,
2920
2948
  data,
2921
2949
  {
@@ -2945,7 +2973,7 @@ var integrationsApi = {
2945
2973
  };
2946
2974
 
2947
2975
  // src/apis/products/livechat/instance.ts
2948
- import axios15 from "axios";
2976
+ import axios16 from "axios";
2949
2977
  var REGION = {
2950
2978
  FRA: "fra",
2951
2979
  DAL: "dal",
@@ -2965,7 +2993,7 @@ var LivechatApiError = class extends ApiErrorBase {
2965
2993
  this.name = "livechat";
2966
2994
  }
2967
2995
  };
2968
- var livechatClientInstance = axios15.create({
2996
+ var livechatClientInstance = axios16.create({
2969
2997
  baseURL: "https://api.labs.livechatinc.com"
2970
2998
  });
2971
2999
  livechatClientInstance.interceptors.response.use(
@@ -3863,14 +3891,14 @@ var platformAccountsApi = {
3863
3891
  };
3864
3892
 
3865
3893
  // src/apis/platform/dps/instance.ts
3866
- import axios16 from "axios";
3894
+ import axios17 from "axios";
3867
3895
  var DpsApiError = class extends ApiErrorBase {
3868
3896
  constructor() {
3869
3897
  super(...arguments);
3870
3898
  this.name = "dps";
3871
3899
  }
3872
3900
  };
3873
- var platformDpsClientInstance = axios16.create({
3901
+ var platformDpsClientInstance = axios17.create({
3874
3902
  baseURL: "https://dev-platform.labs.livechatinc.com"
3875
3903
  });
3876
3904
  platformDpsClientInstance.interceptors.response.use(
@@ -5435,7 +5463,7 @@ var platformDpsApi = {
5435
5463
  };
5436
5464
 
5437
5465
  // src/apis/platform/adapter/instance.ts
5438
- import axios17 from "axios";
5466
+ import axios18 from "axios";
5439
5467
  var REGION2 = {
5440
5468
  FRA: "fra",
5441
5469
  DAL: "dal",
@@ -5455,7 +5483,7 @@ var AdapterApiError = class extends ApiErrorBase {
5455
5483
  this.name = "adapter";
5456
5484
  }
5457
5485
  };
5458
- var platformAdapterClientInstance = axios17.create({
5486
+ var platformAdapterClientInstance = axios18.create({
5459
5487
  baseURL: "https://platform.labs.text.com/console-adapter/api",
5460
5488
  headers: {
5461
5489
  "Content-Type": "application/json"
@@ -6148,8 +6176,8 @@ var WorkflowDefinitionTaskType = {
6148
6176
  };
6149
6177
 
6150
6178
  // src/apis/platform/billing/instance.ts
6151
- import axios18 from "axios";
6152
- var platformBillingClientInstance = axios18.create({
6179
+ import axios19 from "axios";
6180
+ var platformBillingClientInstance = axios19.create({
6153
6181
  baseURL: "https://billing.labs.livechatinc.com"
6154
6182
  });
6155
6183
  function getPlatformBillingClientAuthorization(req) {
@@ -6632,10 +6660,13 @@ var platformBillingAccountApi = {
6632
6660
 
6633
6661
  // src/apis/platform/billing/invoices/api.ts
6634
6662
  var platformBillingInvoicesApi = {
6635
- getInvoices(authorization) {
6663
+ getInvoices(product, authorization) {
6636
6664
  return __async(this, null, function* () {
6637
6665
  try {
6638
- return yield platformBillingClientInstance.get(`/v1/invoices`, getPlatformBillingClientConfig(authorization));
6666
+ return yield platformBillingClientInstance.get(
6667
+ `/v2/invoices/${product}`,
6668
+ getPlatformBillingClientConfig(authorization)
6669
+ );
6639
6670
  } catch (error) {
6640
6671
  if (error instanceof Error) {
6641
6672
  throw new Error(`Invoices couldn't be fetched. [${error.message}]`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livechat/developer-studio-api",
3
- "version": "3.1.15",
3
+ "version": "3.1.17",
4
4
  "description": "This project is API for LiveChat Developer Studio.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -20,8 +20,8 @@
20
20
  "@types/node": "^17.0.12",
21
21
  "tsup": "^7.1.0",
22
22
  "typescript": "^5.1.6",
23
- "eslint-config-custom": "0.0.8",
24
23
  "tsconfig": "0.0.1",
24
+ "eslint-config-custom": "0.0.8",
25
25
  "utils": "0.0.4"
26
26
  },
27
27
  "scripts": {