@etsoo/appscript 1.3.22 → 1.3.24

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.
@@ -5,6 +5,10 @@ import { IApp } from '../app/IApp';
5
5
  export declare class BaseApi<T extends IApp = IApp> {
6
6
  protected app: T;
7
7
  protected api: import("@etsoo/restclient").IApi<any>;
8
+ /**
9
+ * API Last error
10
+ */
11
+ get lastError(): import("@etsoo/restclient").ApiDataError<any> | undefined;
8
12
  /**
9
13
  * Constructor
10
14
  * @param app Application
@@ -14,5 +14,11 @@ class BaseApi {
14
14
  this.app = app;
15
15
  this.api = api;
16
16
  }
17
+ /**
18
+ * API Last error
19
+ */
20
+ get lastError() {
21
+ return this.api.lastError;
22
+ }
17
23
  }
18
24
  exports.BaseApi = BaseApi;
@@ -40,7 +40,7 @@ export declare class PublicApi extends BaseApi {
40
40
  * @param isJoined Add the join label like 'per Kg' for Kg
41
41
  * @returns Label
42
42
  */
43
- getUnitLabel(unit: ProductUnit, isJoined?: boolean | string): string;
43
+ getUnitLabel(unit: ProductUnit | number, isJoined?: boolean | string): string;
44
44
  private getUnitJoin;
45
45
  /**
46
46
  * Get mobile base64 QRCode
@@ -5,6 +5,10 @@ import { IApp } from '../app/IApp';
5
5
  export declare class BaseApi<T extends IApp = IApp> {
6
6
  protected app: T;
7
7
  protected api: import("@etsoo/restclient").IApi<any>;
8
+ /**
9
+ * API Last error
10
+ */
11
+ get lastError(): import("@etsoo/restclient").ApiDataError<any> | undefined;
8
12
  /**
9
13
  * Constructor
10
14
  * @param app Application
@@ -11,4 +11,10 @@ export class BaseApi {
11
11
  this.app = app;
12
12
  this.api = api;
13
13
  }
14
+ /**
15
+ * API Last error
16
+ */
17
+ get lastError() {
18
+ return this.api.lastError;
19
+ }
14
20
  }
@@ -40,7 +40,7 @@ export declare class PublicApi extends BaseApi {
40
40
  * @param isJoined Add the join label like 'per Kg' for Kg
41
41
  * @returns Label
42
42
  */
43
- getUnitLabel(unit: ProductUnit, isJoined?: boolean | string): string;
43
+ getUnitLabel(unit: ProductUnit | number, isJoined?: boolean | string): string;
44
44
  private getUnitJoin;
45
45
  /**
46
46
  * Get mobile base64 QRCode
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.3.22",
3
+ "version": "1.3.24",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -54,7 +54,7 @@
54
54
  "dependencies": {
55
55
  "@etsoo/notificationbase": "^1.1.13",
56
56
  "@etsoo/restclient": "^1.0.75",
57
- "@etsoo/shared": "^1.1.66",
57
+ "@etsoo/shared": "^1.1.67",
58
58
  "@types/crypto-js": "^4.1.1",
59
59
  "crypto-js": "^4.1.1"
60
60
  },
@@ -4,6 +4,13 @@ import { IApp } from '../app/IApp';
4
4
  * SmartERP base API
5
5
  */
6
6
  export class BaseApi<T extends IApp = IApp> {
7
+ /**
8
+ * API Last error
9
+ */
10
+ get lastError() {
11
+ return this.api.lastError;
12
+ }
13
+
7
14
  /**
8
15
  * Constructor
9
16
  * @param app Application
@@ -85,7 +85,7 @@ export class PublicApi extends BaseApi {
85
85
  * @param isJoined Add the join label like 'per Kg' for Kg
86
86
  * @returns Label
87
87
  */
88
- getUnitLabel(unit: ProductUnit, isJoined?: boolean | string) {
88
+ getUnitLabel(unit: ProductUnit | number, isJoined?: boolean | string) {
89
89
  const key = ProductUnit[unit];
90
90
  const label = this.app.get('unit' + key) ?? key;
91
91
  const join = this.getUnitJoin(isJoined);