@etsoo/appscript 1.2.20 → 1.2.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.
@@ -232,6 +232,13 @@ export interface ICoreApp<S extends IAppSettings, N, C extends NotificationCallP
232
232
  * @returns Cached token
233
233
  */
234
234
  getCacheToken(): string | undefined;
235
+ /**
236
+ * Get entity status label
237
+ * @param data Input data
238
+ */
239
+ getEntityStatusLabel<D extends {
240
+ entityStatus?: number;
241
+ }>(data: D): string;
235
242
  /**
236
243
  * Get all regions
237
244
  * @returns Regions
@@ -621,6 +628,13 @@ export declare abstract class CoreApp<S extends IAppSettings, N, C extends Notif
621
628
  * @returns Regions
622
629
  */
623
630
  getRegions(): AddressRegion[];
631
+ /**
632
+ * Get entity status label
633
+ * @param data Input data
634
+ */
635
+ getEntityStatusLabel<D extends {
636
+ entityStatus?: number;
637
+ }>(data: D): string;
624
638
  /**
625
639
  * Get refresh token from response headers
626
640
  * @param rawResponse Raw response from API call
@@ -7,6 +7,7 @@ const shared_1 = require("@etsoo/shared");
7
7
  const crypto_js_1 = require("crypto-js");
8
8
  const AddressRegion_1 = require("../address/AddressRegion");
9
9
  const AddressUtils_1 = require("../address/AddressUtils");
10
+ const BusinessUtils_1 = require("../business/BusinessUtils");
10
11
  const ActionResultError_1 = require("../result/ActionResultError");
11
12
  /**
12
13
  * Core application
@@ -715,6 +716,15 @@ class CoreApp {
715
716
  return AddressRegion_1.AddressRegion.getById(id);
716
717
  });
717
718
  }
719
+ /**
720
+ * Get entity status label
721
+ * @param data Input data
722
+ */
723
+ getEntityStatusLabel(data) {
724
+ if (data == null || data.entityStatus == null)
725
+ return '';
726
+ return BusinessUtils_1.BusinessUtils.getEntityStatusLabel(data.entityStatus, this.labelDelegate);
727
+ }
718
728
  /**
719
729
  * Get refresh token from response headers
720
730
  * @param rawResponse Raw response from API call
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Standard entity status enum
3
3
  * com.etsoo.SmartERP.Dto.EntityStatus
4
+ * Labels also included within i18n
4
5
  */
5
6
  export declare enum EntityStatus {
6
7
  /**
@@ -4,6 +4,7 @@ exports.EntityStatus = void 0;
4
4
  /**
5
5
  * Standard entity status enum
6
6
  * com.etsoo.SmartERP.Dto.EntityStatus
7
+ * Labels also included within i18n
7
8
  */
8
9
  var EntityStatus;
9
10
  (function (EntityStatus) {
@@ -12,6 +12,7 @@
12
12
  "creation": "Creation",
13
13
  "currency": "Currency",
14
14
  "delete": "Delete",
15
+ "deleteConfirm": "Are you sure you want to permanently delete this {0}?",
15
16
  "description": "Description",
16
17
  "done": "Done",
17
18
  "edit": "Edit",
@@ -63,7 +64,13 @@
63
64
  "showIt": "Show it",
64
65
  "signout": "Sign out",
65
66
  "smartERP": "SmartERP",
67
+ "sortTip": "Drag and drop items to sort",
66
68
  "status": "Status",
69
+ "statusArchived": "Archived",
70
+ "statusDeleted": "Deleted",
71
+ "statusFlaged": "Flaged",
72
+ "statusNormal": "Normla",
73
+ "statusInactivated": "Inactivated",
67
74
  "submit": "Submit",
68
75
  "success": "Success",
69
76
  "timeDifferenceInvalid": "The time difference between the device and the server is {0}, which exceeds the limit of {1} seconds. Please adjust the device time. If it is abnormal, please inform the administrator",
@@ -12,12 +12,13 @@
12
12
  "creation": "登记时间",
13
13
  "currency": "币种",
14
14
  "delete": "删除",
15
+ "deleteConfirm": "确定要永久删除此{0}吗?",
15
16
  "description": "描述",
16
17
  "done": "完成",
17
18
  "edit": "修改",
18
19
  "email": "电子邮箱",
19
20
  "emailAddresses": "电子邮箱",
20
- "enabled": "启用",
21
+ "enabled": "已启用",
21
22
  "etsoo": "亿速思维",
22
23
  "expiry": "到期时间",
23
24
  "failed": "操作失败",
@@ -63,7 +64,13 @@
63
64
  "showIt": "显示",
64
65
  "signout": "退出",
65
66
  "smartERP": "司友云ERP",
67
+ "sortTip": "拖拽项目进行排序",
66
68
  "status": "状态",
69
+ "statusArchived": "已归档",
70
+ "statusDeleted": "已删除",
71
+ "statusFlaged": "已标记",
72
+ "statusNormal": "正常",
73
+ "statusInactivated": "已停用",
67
74
  "submit": "提交",
68
75
  "success": "成功",
69
76
  "timeDifferenceInvalid": "设备时间和服务器时间差为{0},超过{1}秒的限制,请调整设备时间,如果异常请告知管理员",
@@ -12,12 +12,13 @@
12
12
  "creation": "登記時間",
13
13
  "currency": "幣種",
14
14
  "delete": "刪除",
15
+ "deleteConfirm": "確定要永久刪除此{0}嗎?",
15
16
  "description": "描述",
16
17
  "done": "完成",
17
18
  "edit": "修改",
18
19
  "email": "電子郵箱",
19
20
  "emailAddresses": "電子郵箱",
20
- "enabled": "啟用",
21
+ "enabled": "已啟用",
21
22
  "etsoo": "億速思維",
22
23
  "expiry": "到期時間",
23
24
  "failed": "操作失敗",
@@ -63,7 +64,13 @@
63
64
  "showIt": "顯示",
64
65
  "signout": "退出",
65
66
  "smartERP": "司友雲ERP",
67
+ "sortTip": "拖拽項目進行排序",
66
68
  "status": "狀態",
69
+ "statusArchived": "已歸檔",
70
+ "statusDeleted": "已刪除",
71
+ "statusFlaged": "已標記",
72
+ "statusNormal": "正常",
73
+ "statusInactivated": "已停用",
67
74
  "submit": "提交",
68
75
  "success": "成功",
69
76
  "timeDifferenceInvalid": "設備時間和服務器時間差為{0},超過{1}秒的限制,請調整設備時間,如果異常請告知管理員",
@@ -232,6 +232,13 @@ export interface ICoreApp<S extends IAppSettings, N, C extends NotificationCallP
232
232
  * @returns Cached token
233
233
  */
234
234
  getCacheToken(): string | undefined;
235
+ /**
236
+ * Get entity status label
237
+ * @param data Input data
238
+ */
239
+ getEntityStatusLabel<D extends {
240
+ entityStatus?: number;
241
+ }>(data: D): string;
235
242
  /**
236
243
  * Get all regions
237
244
  * @returns Regions
@@ -621,6 +628,13 @@ export declare abstract class CoreApp<S extends IAppSettings, N, C extends Notif
621
628
  * @returns Regions
622
629
  */
623
630
  getRegions(): AddressRegion[];
631
+ /**
632
+ * Get entity status label
633
+ * @param data Input data
634
+ */
635
+ getEntityStatusLabel<D extends {
636
+ entityStatus?: number;
637
+ }>(data: D): string;
624
638
  /**
625
639
  * Get refresh token from response headers
626
640
  * @param rawResponse Raw response from API call
@@ -4,6 +4,7 @@ import { DateUtils, DomUtils, NumberUtils, Utils } from '@etsoo/shared';
4
4
  import { AES, algo, enc, HmacSHA512, lib, mode, pad, PBKDF2, SHA3 } from 'crypto-js';
5
5
  import { AddressRegion } from '../address/AddressRegion';
6
6
  import { AddressUtils } from '../address/AddressUtils';
7
+ import { BusinessUtils } from '../business/BusinessUtils';
7
8
  import { ActionResultError } from '../result/ActionResultError';
8
9
  /**
9
10
  * Core application
@@ -712,6 +713,15 @@ export class CoreApp {
712
713
  return AddressRegion.getById(id);
713
714
  });
714
715
  }
716
+ /**
717
+ * Get entity status label
718
+ * @param data Input data
719
+ */
720
+ getEntityStatusLabel(data) {
721
+ if (data == null || data.entityStatus == null)
722
+ return '';
723
+ return BusinessUtils.getEntityStatusLabel(data.entityStatus, this.labelDelegate);
724
+ }
715
725
  /**
716
726
  * Get refresh token from response headers
717
727
  * @param rawResponse Raw response from API call
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Standard entity status enum
3
3
  * com.etsoo.SmartERP.Dto.EntityStatus
4
+ * Labels also included within i18n
4
5
  */
5
6
  export declare enum EntityStatus {
6
7
  /**
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Standard entity status enum
3
3
  * com.etsoo.SmartERP.Dto.EntityStatus
4
+ * Labels also included within i18n
4
5
  */
5
6
  export var EntityStatus;
6
7
  (function (EntityStatus) {
@@ -12,6 +12,7 @@
12
12
  "creation": "Creation",
13
13
  "currency": "Currency",
14
14
  "delete": "Delete",
15
+ "deleteConfirm": "Are you sure you want to permanently delete this {0}?",
15
16
  "description": "Description",
16
17
  "done": "Done",
17
18
  "edit": "Edit",
@@ -63,7 +64,13 @@
63
64
  "showIt": "Show it",
64
65
  "signout": "Sign out",
65
66
  "smartERP": "SmartERP",
67
+ "sortTip": "Drag and drop items to sort",
66
68
  "status": "Status",
69
+ "statusArchived": "Archived",
70
+ "statusDeleted": "Deleted",
71
+ "statusFlaged": "Flaged",
72
+ "statusNormal": "Normla",
73
+ "statusInactivated": "Inactivated",
67
74
  "submit": "Submit",
68
75
  "success": "Success",
69
76
  "timeDifferenceInvalid": "The time difference between the device and the server is {0}, which exceeds the limit of {1} seconds. Please adjust the device time. If it is abnormal, please inform the administrator",
@@ -12,12 +12,13 @@
12
12
  "creation": "登记时间",
13
13
  "currency": "币种",
14
14
  "delete": "删除",
15
+ "deleteConfirm": "确定要永久删除此{0}吗?",
15
16
  "description": "描述",
16
17
  "done": "完成",
17
18
  "edit": "修改",
18
19
  "email": "电子邮箱",
19
20
  "emailAddresses": "电子邮箱",
20
- "enabled": "启用",
21
+ "enabled": "已启用",
21
22
  "etsoo": "亿速思维",
22
23
  "expiry": "到期时间",
23
24
  "failed": "操作失败",
@@ -63,7 +64,13 @@
63
64
  "showIt": "显示",
64
65
  "signout": "退出",
65
66
  "smartERP": "司友云ERP",
67
+ "sortTip": "拖拽项目进行排序",
66
68
  "status": "状态",
69
+ "statusArchived": "已归档",
70
+ "statusDeleted": "已删除",
71
+ "statusFlaged": "已标记",
72
+ "statusNormal": "正常",
73
+ "statusInactivated": "已停用",
67
74
  "submit": "提交",
68
75
  "success": "成功",
69
76
  "timeDifferenceInvalid": "设备时间和服务器时间差为{0},超过{1}秒的限制,请调整设备时间,如果异常请告知管理员",
@@ -12,12 +12,13 @@
12
12
  "creation": "登記時間",
13
13
  "currency": "幣種",
14
14
  "delete": "刪除",
15
+ "deleteConfirm": "確定要永久刪除此{0}嗎?",
15
16
  "description": "描述",
16
17
  "done": "完成",
17
18
  "edit": "修改",
18
19
  "email": "電子郵箱",
19
20
  "emailAddresses": "電子郵箱",
20
- "enabled": "啟用",
21
+ "enabled": "已啟用",
21
22
  "etsoo": "億速思維",
22
23
  "expiry": "到期時間",
23
24
  "failed": "操作失敗",
@@ -63,7 +64,13 @@
63
64
  "showIt": "顯示",
64
65
  "signout": "退出",
65
66
  "smartERP": "司友雲ERP",
67
+ "sortTip": "拖拽項目進行排序",
66
68
  "status": "狀態",
69
+ "statusArchived": "已歸檔",
70
+ "statusDeleted": "已刪除",
71
+ "statusFlaged": "已標記",
72
+ "statusNormal": "正常",
73
+ "statusInactivated": "已停用",
67
74
  "submit": "提交",
68
75
  "success": "成功",
69
76
  "timeDifferenceInvalid": "設備時間和服務器時間差為{0},超過{1}秒的限制,請調整設備時間,如果異常請告知管理員",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.2.20",
3
+ "version": "1.2.24",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -54,23 +54,23 @@
54
54
  "dependencies": {
55
55
  "@etsoo/notificationbase": "^1.1.0",
56
56
  "@etsoo/restclient": "^1.0.64",
57
- "@etsoo/shared": "^1.1.0",
57
+ "@etsoo/shared": "^1.1.3",
58
58
  "@types/crypto-js": "^4.1.0",
59
59
  "crypto-js": "^4.1.1"
60
60
  },
61
61
  "devDependencies": {
62
- "@babel/cli": "^7.16.7",
62
+ "@babel/cli": "^7.16.8",
63
63
  "@babel/core": "^7.16.7",
64
- "@babel/plugin-transform-runtime": "^7.16.7",
65
- "@babel/preset-env": "^7.16.7",
66
- "@babel/runtime-corejs3": "^7.16.7",
64
+ "@babel/plugin-transform-runtime": "^7.16.8",
65
+ "@babel/preset-env": "^7.16.8",
66
+ "@babel/runtime-corejs3": "^7.16.8",
67
67
  "@types/jest": "^27.4.0",
68
- "@typescript-eslint/eslint-plugin": "^5.9.0",
69
- "@typescript-eslint/parser": "^5.9.0",
68
+ "@typescript-eslint/eslint-plugin": "^5.9.1",
69
+ "@typescript-eslint/parser": "^5.9.1",
70
70
  "eslint": "^8.6.0",
71
71
  "eslint-config-airbnb-base": "^15.0.0",
72
72
  "eslint-plugin-import": "^2.25.4",
73
- "jest": "^27.4.5",
73
+ "jest": "^27.4.7",
74
74
  "ts-jest": "^27.1.2",
75
75
  "typescript": "^4.5.4"
76
76
  }
@@ -29,6 +29,7 @@ import {
29
29
  } from 'crypto-js';
30
30
  import { AddressRegion } from '../address/AddressRegion';
31
31
  import { AddressUtils } from '../address/AddressUtils';
32
+ import { BusinessUtils } from '../business/BusinessUtils';
32
33
  import { IdLabelDto } from '../dto/IdLabelDto';
33
34
  import { InitCallDto } from '../dto/InitCallDto';
34
35
  import { ActionResultError } from '../result/ActionResultError';
@@ -330,6 +331,12 @@ export interface ICoreApp<
330
331
  */
331
332
  getCacheToken(): string | undefined;
332
333
 
334
+ /**
335
+ * Get entity status label
336
+ * @param data Input data
337
+ */
338
+ getEntityStatusLabel<D extends { entityStatus?: number }>(data: D): string;
339
+
333
340
  /**
334
341
  * Get all regions
335
342
  * @returns Regions
@@ -1386,6 +1393,18 @@ export abstract class CoreApp<
1386
1393
  });
1387
1394
  }
1388
1395
 
1396
+ /**
1397
+ * Get entity status label
1398
+ * @param data Input data
1399
+ */
1400
+ getEntityStatusLabel<D extends { entityStatus?: number }>(data: D) {
1401
+ if (data == null || data.entityStatus == null) return '';
1402
+ return BusinessUtils.getEntityStatusLabel(
1403
+ data.entityStatus,
1404
+ this.labelDelegate
1405
+ );
1406
+ }
1407
+
1389
1408
  /**
1390
1409
  * Get refresh token from response headers
1391
1410
  * @param rawResponse Raw response from API call
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Standard entity status enum
3
3
  * com.etsoo.SmartERP.Dto.EntityStatus
4
+ * Labels also included within i18n
4
5
  */
5
6
  export enum EntityStatus {
6
7
  /**
@@ -12,6 +12,7 @@
12
12
  "creation": "Creation",
13
13
  "currency": "Currency",
14
14
  "delete": "Delete",
15
+ "deleteConfirm": "Are you sure you want to permanently delete this {0}?",
15
16
  "description": "Description",
16
17
  "done": "Done",
17
18
  "edit": "Edit",
@@ -63,7 +64,13 @@
63
64
  "showIt": "Show it",
64
65
  "signout": "Sign out",
65
66
  "smartERP": "SmartERP",
67
+ "sortTip": "Drag and drop items to sort",
66
68
  "status": "Status",
69
+ "statusArchived": "Archived",
70
+ "statusDeleted": "Deleted",
71
+ "statusFlaged": "Flaged",
72
+ "statusNormal": "Normla",
73
+ "statusInactivated": "Inactivated",
67
74
  "submit": "Submit",
68
75
  "success": "Success",
69
76
  "timeDifferenceInvalid": "The time difference between the device and the server is {0}, which exceeds the limit of {1} seconds. Please adjust the device time. If it is abnormal, please inform the administrator",
@@ -12,12 +12,13 @@
12
12
  "creation": "登记时间",
13
13
  "currency": "币种",
14
14
  "delete": "删除",
15
+ "deleteConfirm": "确定要永久删除此{0}吗?",
15
16
  "description": "描述",
16
17
  "done": "完成",
17
18
  "edit": "修改",
18
19
  "email": "电子邮箱",
19
20
  "emailAddresses": "电子邮箱",
20
- "enabled": "启用",
21
+ "enabled": "已启用",
21
22
  "etsoo": "亿速思维",
22
23
  "expiry": "到期时间",
23
24
  "failed": "操作失败",
@@ -63,7 +64,13 @@
63
64
  "showIt": "显示",
64
65
  "signout": "退出",
65
66
  "smartERP": "司友云ERP",
67
+ "sortTip": "拖拽项目进行排序",
66
68
  "status": "状态",
69
+ "statusArchived": "已归档",
70
+ "statusDeleted": "已删除",
71
+ "statusFlaged": "已标记",
72
+ "statusNormal": "正常",
73
+ "statusInactivated": "已停用",
67
74
  "submit": "提交",
68
75
  "success": "成功",
69
76
  "timeDifferenceInvalid": "设备时间和服务器时间差为{0},超过{1}秒的限制,请调整设备时间,如果异常请告知管理员",
@@ -12,12 +12,13 @@
12
12
  "creation": "登記時間",
13
13
  "currency": "幣種",
14
14
  "delete": "刪除",
15
+ "deleteConfirm": "確定要永久刪除此{0}嗎?",
15
16
  "description": "描述",
16
17
  "done": "完成",
17
18
  "edit": "修改",
18
19
  "email": "電子郵箱",
19
20
  "emailAddresses": "電子郵箱",
20
- "enabled": "啟用",
21
+ "enabled": "已啟用",
21
22
  "etsoo": "億速思維",
22
23
  "expiry": "到期時間",
23
24
  "failed": "操作失敗",
@@ -63,7 +64,13 @@
63
64
  "showIt": "顯示",
64
65
  "signout": "退出",
65
66
  "smartERP": "司友雲ERP",
67
+ "sortTip": "拖拽項目進行排序",
66
68
  "status": "狀態",
69
+ "statusArchived": "已歸檔",
70
+ "statusDeleted": "已刪除",
71
+ "statusFlaged": "已標記",
72
+ "statusNormal": "正常",
73
+ "statusInactivated": "已停用",
67
74
  "submit": "提交",
68
75
  "success": "成功",
69
76
  "timeDifferenceInvalid": "設備時間和服務器時間差為{0},超過{1}秒的限制,請調整設備時間,如果異常請告知管理員",