@etsoo/appscript 1.4.10 → 1.4.12

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.
@@ -151,6 +151,16 @@ test('Test for properties', () => {
151
151
  expect(app.settings.currentRegion.label).toBe('中国大陆');
152
152
  });
153
153
 
154
+ test('Test for formatAction', () => {
155
+ Object.assign(app.settings.currentCulture.resources, {
156
+ appName: '司友®云ERP'
157
+ });
158
+ expect(app.formatAction('修改', '客户A')).toBe('[司友®云ERP] 修改 - 客户A');
159
+ expect(app.formatAction('修改', '客户A', '企业')).toBe(
160
+ '[司友®云ERP] 修改 - 客户A, 企业'
161
+ );
162
+ });
163
+
154
164
  test('Tests for addRootUrl', () => {
155
165
  expect(app.addRootUrl('/home')).toBe('/cms/home');
156
166
  expect(app.addRootUrl('./home')).toBe('/cms/./home');
@@ -294,6 +294,14 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
294
294
  * @returns Enhanced passphrase
295
295
  */
296
296
  protected encryptionEnhance(passphrase: string, timestamp: string): string;
297
+ /**
298
+ * Format action
299
+ * @param action Action
300
+ * @param target Target name or title
301
+ * @param items More items
302
+ * @returns Result
303
+ */
304
+ formatAction(action: string, target: string, ...items: string[]): string;
297
305
  /**
298
306
  * Format date to string
299
307
  * @param input Input date
@@ -757,6 +757,17 @@ class CoreApp {
757
757
  passphrase += passphrase.length.toString();
758
758
  return passphrase;
759
759
  }
760
+ /**
761
+ * Format action
762
+ * @param action Action
763
+ * @param target Target name or title
764
+ * @param items More items
765
+ * @returns Result
766
+ */
767
+ formatAction(action, target, ...items) {
768
+ let more = items.join(', ');
769
+ return `[${this.get('appName')}] ${action} - ${target}${more ? `, ${more}` : more}`;
770
+ }
760
771
  /**
761
772
  * Format date to string
762
773
  * @param input Input date
@@ -233,6 +233,14 @@ export interface IApp {
233
233
  * @returns string
234
234
  */
235
235
  formatDate(input?: Date | string, options?: DateUtils.FormatOptions, timeZone?: string): string | undefined;
236
+ /**
237
+ * Format action
238
+ * @param action Action
239
+ * @param target Target name or title
240
+ * @param items More items
241
+ * @returns Result
242
+ */
243
+ formatAction(action: string, target: string, ...items: string[]): string;
236
244
  /**
237
245
  * Format error
238
246
  * @param error Error
@@ -0,0 +1,14 @@
1
+ import { SendActionMessageRQ } from '../rq/SendActionMessageRQ';
2
+ /**
3
+ * Action message response data
4
+ */
5
+ export type ResponseActionMessageDto = SendActionMessageRQ & {
6
+ /**
7
+ * User id
8
+ */
9
+ userId: number;
10
+ /**
11
+ * Creation
12
+ */
13
+ creation: string | Date;
14
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -37,6 +37,7 @@ export * from './erp/dto/OrgViewDto';
37
37
  export * from './erp/dto/PinDto';
38
38
  export * from './erp/dto/PlaceParsedDto';
39
39
  export * from './erp/dto/PublicProductDto';
40
+ export * from './erp/dto/ResponseActionMessageDto';
40
41
  export * from './erp/dto/ResultPayload';
41
42
  export * from './erp/rq/LoginIdRQ';
42
43
  export * from './erp/rq/LoginRQ';
package/lib/cjs/index.js CHANGED
@@ -60,6 +60,7 @@ __exportStar(require("./erp/dto/OrgViewDto"), exports);
60
60
  __exportStar(require("./erp/dto/PinDto"), exports);
61
61
  __exportStar(require("./erp/dto/PlaceParsedDto"), exports);
62
62
  __exportStar(require("./erp/dto/PublicProductDto"), exports);
63
+ __exportStar(require("./erp/dto/ResponseActionMessageDto"), exports);
63
64
  __exportStar(require("./erp/dto/ResultPayload"), exports);
64
65
  // erp rq
65
66
  __exportStar(require("./erp/rq/LoginIdRQ"), exports);
@@ -294,6 +294,14 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
294
294
  * @returns Enhanced passphrase
295
295
  */
296
296
  protected encryptionEnhance(passphrase: string, timestamp: string): string;
297
+ /**
298
+ * Format action
299
+ * @param action Action
300
+ * @param target Target name or title
301
+ * @param items More items
302
+ * @returns Result
303
+ */
304
+ formatAction(action: string, target: string, ...items: string[]): string;
297
305
  /**
298
306
  * Format date to string
299
307
  * @param input Input date
@@ -731,6 +731,17 @@ export class CoreApp {
731
731
  passphrase += passphrase.length.toString();
732
732
  return passphrase;
733
733
  }
734
+ /**
735
+ * Format action
736
+ * @param action Action
737
+ * @param target Target name or title
738
+ * @param items More items
739
+ * @returns Result
740
+ */
741
+ formatAction(action, target, ...items) {
742
+ let more = items.join(', ');
743
+ return `[${this.get('appName')}] ${action} - ${target}${more ? `, ${more}` : more}`;
744
+ }
734
745
  /**
735
746
  * Format date to string
736
747
  * @param input Input date
@@ -233,6 +233,14 @@ export interface IApp {
233
233
  * @returns string
234
234
  */
235
235
  formatDate(input?: Date | string, options?: DateUtils.FormatOptions, timeZone?: string): string | undefined;
236
+ /**
237
+ * Format action
238
+ * @param action Action
239
+ * @param target Target name or title
240
+ * @param items More items
241
+ * @returns Result
242
+ */
243
+ formatAction(action: string, target: string, ...items: string[]): string;
236
244
  /**
237
245
  * Format error
238
246
  * @param error Error
@@ -0,0 +1,14 @@
1
+ import { SendActionMessageRQ } from '../rq/SendActionMessageRQ';
2
+ /**
3
+ * Action message response data
4
+ */
5
+ export type ResponseActionMessageDto = SendActionMessageRQ & {
6
+ /**
7
+ * User id
8
+ */
9
+ userId: number;
10
+ /**
11
+ * Creation
12
+ */
13
+ creation: string | Date;
14
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -37,6 +37,7 @@ export * from './erp/dto/OrgViewDto';
37
37
  export * from './erp/dto/PinDto';
38
38
  export * from './erp/dto/PlaceParsedDto';
39
39
  export * from './erp/dto/PublicProductDto';
40
+ export * from './erp/dto/ResponseActionMessageDto';
40
41
  export * from './erp/dto/ResultPayload';
41
42
  export * from './erp/rq/LoginIdRQ';
42
43
  export * from './erp/rq/LoginRQ';
package/lib/mjs/index.js CHANGED
@@ -43,6 +43,7 @@ export * from './erp/dto/OrgViewDto';
43
43
  export * from './erp/dto/PinDto';
44
44
  export * from './erp/dto/PlaceParsedDto';
45
45
  export * from './erp/dto/PublicProductDto';
46
+ export * from './erp/dto/ResponseActionMessageDto';
46
47
  export * from './erp/dto/ResultPayload';
47
48
  // erp rq
48
49
  export * from './erp/rq/LoginIdRQ';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.4.10",
3
+ "version": "1.4.12",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -59,10 +59,10 @@
59
59
  },
60
60
  "devDependencies": {
61
61
  "@babel/cli": "^7.21.5",
62
- "@babel/core": "^7.21.8",
63
- "@babel/plugin-transform-runtime": "^7.21.4",
64
- "@babel/preset-env": "^7.21.5",
65
- "@babel/runtime-corejs3": "^7.21.5",
62
+ "@babel/core": "^7.22.1",
63
+ "@babel/plugin-transform-runtime": "^7.22.2",
64
+ "@babel/preset-env": "^7.22.2",
65
+ "@babel/runtime-corejs3": "^7.22.0",
66
66
  "@types/jest": "^29.5.1",
67
67
  "@types/crypto-js": "^4.1.1",
68
68
  "jest": "^29.5.0",
@@ -1025,6 +1025,20 @@ export abstract class CoreApp<
1025
1025
  return passphrase;
1026
1026
  }
1027
1027
 
1028
+ /**
1029
+ * Format action
1030
+ * @param action Action
1031
+ * @param target Target name or title
1032
+ * @param items More items
1033
+ * @returns Result
1034
+ */
1035
+ formatAction(action: string, target: string, ...items: string[]) {
1036
+ let more = items.join(', ');
1037
+ return `[${this.get('appName')}] ${action} - ${target}${
1038
+ more ? `, ${more}` : more
1039
+ }`;
1040
+ }
1041
+
1028
1042
  /**
1029
1043
  * Format date to string
1030
1044
  * @param input Input date
package/src/app/IApp.ts CHANGED
@@ -315,6 +315,15 @@ export interface IApp {
315
315
  timeZone?: string
316
316
  ): string | undefined;
317
317
 
318
+ /**
319
+ * Format action
320
+ * @param action Action
321
+ * @param target Target name or title
322
+ * @param items More items
323
+ * @returns Result
324
+ */
325
+ formatAction(action: string, target: string, ...items: string[]): string;
326
+
318
327
  /**
319
328
  * Format error
320
329
  * @param error Error
@@ -0,0 +1,16 @@
1
+ import { SendActionMessageRQ } from '../rq/SendActionMessageRQ';
2
+
3
+ /**
4
+ * Action message response data
5
+ */
6
+ export type ResponseActionMessageDto = SendActionMessageRQ & {
7
+ /**
8
+ * User id
9
+ */
10
+ userId: number;
11
+
12
+ /**
13
+ * Creation
14
+ */
15
+ creation: string | Date;
16
+ };
package/src/index.ts CHANGED
@@ -48,6 +48,7 @@ export * from './erp/dto/OrgViewDto';
48
48
  export * from './erp/dto/PinDto';
49
49
  export * from './erp/dto/PlaceParsedDto';
50
50
  export * from './erp/dto/PublicProductDto';
51
+ export * from './erp/dto/ResponseActionMessageDto';
51
52
  export * from './erp/dto/ResultPayload';
52
53
 
53
54
  // erp rq