@etsoo/appscript 1.5.48 → 1.5.49

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.
@@ -600,6 +600,13 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
600
600
  * @param coreName Core system's name, default is 'core'
601
601
  */
602
602
  exchangeTokenAll(coreData: ApiRefreshTokenDto, coreName?: string): void;
603
+ /**
604
+ * API refresh token data
605
+ * @param api Current API
606
+ * @param token Refresh token
607
+ * @returns Result
608
+ */
609
+ protected apiRefreshTokenData(api: IApi, token: string): Promise<ApiRefreshTokenDto | undefined>;
603
610
  /**
604
611
  * API refresh token
605
612
  * @param api Current API
@@ -1488,14 +1488,14 @@ class CoreApp {
1488
1488
  }
1489
1489
  }
1490
1490
  /**
1491
- * API refresh token
1491
+ * API refresh token data
1492
1492
  * @param api Current API
1493
1493
  * @param token Refresh token
1494
1494
  * @returns Result
1495
1495
  */
1496
- async apiRefreshToken(api, token) {
1496
+ async apiRefreshTokenData(api, token) {
1497
1497
  // Call the API quietly, no loading bar and no error popup
1498
- const data = await new AuthApi_1.AuthApi(this).apiRefreshToken({ token }, {
1498
+ return new AuthApi_1.AuthApi(this).apiRefreshToken({ token }, {
1499
1499
  showLoading: false,
1500
1500
  onError: (error) => {
1501
1501
  console.error(`CoreApp.${api.name}.apiRefreshToken error`, error);
@@ -1503,6 +1503,16 @@ class CoreApp {
1503
1503
  return false;
1504
1504
  }
1505
1505
  });
1506
+ }
1507
+ /**
1508
+ * API refresh token
1509
+ * @param api Current API
1510
+ * @param token Refresh token
1511
+ * @returns Result
1512
+ */
1513
+ async apiRefreshToken(api, token) {
1514
+ // Call the API quietly, no loading bar and no error popup
1515
+ const data = await this.apiRefreshTokenData(api, token);
1506
1516
  if (data == null)
1507
1517
  return undefined;
1508
1518
  // Update the access token
@@ -600,6 +600,13 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
600
600
  * @param coreName Core system's name, default is 'core'
601
601
  */
602
602
  exchangeTokenAll(coreData: ApiRefreshTokenDto, coreName?: string): void;
603
+ /**
604
+ * API refresh token data
605
+ * @param api Current API
606
+ * @param token Refresh token
607
+ * @returns Result
608
+ */
609
+ protected apiRefreshTokenData(api: IApi, token: string): Promise<ApiRefreshTokenDto | undefined>;
603
610
  /**
604
611
  * API refresh token
605
612
  * @param api Current API
@@ -1485,14 +1485,14 @@ export class CoreApp {
1485
1485
  }
1486
1486
  }
1487
1487
  /**
1488
- * API refresh token
1488
+ * API refresh token data
1489
1489
  * @param api Current API
1490
1490
  * @param token Refresh token
1491
1491
  * @returns Result
1492
1492
  */
1493
- async apiRefreshToken(api, token) {
1493
+ async apiRefreshTokenData(api, token) {
1494
1494
  // Call the API quietly, no loading bar and no error popup
1495
- const data = await new AuthApi(this).apiRefreshToken({ token }, {
1495
+ return new AuthApi(this).apiRefreshToken({ token }, {
1496
1496
  showLoading: false,
1497
1497
  onError: (error) => {
1498
1498
  console.error(`CoreApp.${api.name}.apiRefreshToken error`, error);
@@ -1500,6 +1500,16 @@ export class CoreApp {
1500
1500
  return false;
1501
1501
  }
1502
1502
  });
1503
+ }
1504
+ /**
1505
+ * API refresh token
1506
+ * @param api Current API
1507
+ * @param token Refresh token
1508
+ * @returns Result
1509
+ */
1510
+ async apiRefreshToken(api, token) {
1511
+ // Call the API quietly, no loading bar and no error popup
1512
+ const data = await this.apiRefreshTokenData(api, token);
1503
1513
  if (data == null)
1504
1514
  return undefined;
1505
1515
  // Update the access token
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.5.48",
3
+ "version": "1.5.49",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -2046,17 +2046,17 @@ export abstract class CoreApp<
2046
2046
  }
2047
2047
 
2048
2048
  /**
2049
- * API refresh token
2049
+ * API refresh token data
2050
2050
  * @param api Current API
2051
2051
  * @param token Refresh token
2052
2052
  * @returns Result
2053
2053
  */
2054
- protected async apiRefreshToken(
2054
+ protected async apiRefreshTokenData(
2055
2055
  api: IApi,
2056
2056
  token: string
2057
- ): Promise<[string, number] | undefined> {
2057
+ ): Promise<ApiRefreshTokenDto | undefined> {
2058
2058
  // Call the API quietly, no loading bar and no error popup
2059
- const data = await new AuthApi(this).apiRefreshToken(
2059
+ return new AuthApi(this).apiRefreshToken(
2060
2060
  { token },
2061
2061
  {
2062
2062
  showLoading: false,
@@ -2071,6 +2071,20 @@ export abstract class CoreApp<
2071
2071
  }
2072
2072
  }
2073
2073
  );
2074
+ }
2075
+
2076
+ /**
2077
+ * API refresh token
2078
+ * @param api Current API
2079
+ * @param token Refresh token
2080
+ * @returns Result
2081
+ */
2082
+ protected async apiRefreshToken(
2083
+ api: IApi,
2084
+ token: string
2085
+ ): Promise<[string, number] | undefined> {
2086
+ // Call the API quietly, no loading bar and no error popup
2087
+ const data = await this.apiRefreshTokenData(api, token);
2074
2088
  if (data == null) return undefined;
2075
2089
 
2076
2090
  // Update the access token