@etsoo/appscript 1.3.29 → 1.3.30

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.
@@ -3,6 +3,7 @@ import { DataTypes } from '@etsoo/shared';
3
3
  import { IApp } from '../app/IApp';
4
4
  import { IActionResult } from '../result/IActionResult';
5
5
  import { BaseApi } from './BaseApi';
6
+ import { AuditLineDto, AuditLinePayload } from './dto/AuditLineDto';
6
7
  import { QueryRQ } from './rq/QueryRQ';
7
8
  import { TiplistRQ } from './rq/TiplistRQ';
8
9
  /**
@@ -46,6 +47,13 @@ export declare class EntityApi<T extends IApp = IApp> extends BaseApi<T> {
46
47
  * @returns Result
47
48
  */
48
49
  protected queryBase<T extends DataTypes.IdType, RQ extends QueryRQ<T>, R extends object>(rq: RQ, payload?: IApiPayload<R[]>, queryKey?: string): Promise<R[] | undefined>;
50
+ /**
51
+ * Query audit history
52
+ * @param rq Request data
53
+ * @param payload Payload
54
+ * @returns Result
55
+ */
56
+ protected queryAuditBase<T extends DataTypes.IdType, R extends QueryRQ<T>>(rq: R, payload?: AuditLinePayload): Promise<AuditLineDto[] | undefined>;
49
57
  /**
50
58
  * Read
51
59
  * @param id Id
@@ -50,6 +50,15 @@ class EntityApi extends BaseApi_1.BaseApi {
50
50
  queryBase(rq, payload, queryKey = '') {
51
51
  return this.api.post(`${this.flag}/Query${queryKey}`, rq, payload);
52
52
  }
53
+ /**
54
+ * Query audit history
55
+ * @param rq Request data
56
+ * @param payload Payload
57
+ * @returns Result
58
+ */
59
+ queryAuditBase(rq, payload) {
60
+ return this.api.post(`${this.flag}/QueryAudit`, rq, payload);
61
+ }
53
62
  /**
54
63
  * Read
55
64
  * @param id Id
@@ -0,0 +1,24 @@
1
+ import { IApiPayload } from '@etsoo/restclient';
2
+ /**
3
+ * Audit line data
4
+ */
5
+ export declare type AuditLineDto = {
6
+ id: number;
7
+ creation: Date;
8
+ user: string;
9
+ action: string;
10
+ changes?: AuditLineChangesDto;
11
+ oldData?: Record<string, unknown>;
12
+ newData?: Record<string, unknown>;
13
+ };
14
+ /**
15
+ * Audit line changes data
16
+ */
17
+ export declare type AuditLineChangesDto = {
18
+ oldData: Record<string, unknown>;
19
+ newData: Record<string, unknown>;
20
+ };
21
+ /**
22
+ * Audit line API payload
23
+ */
24
+ export declare type AuditLinePayload = IApiPayload<AuditLineDto[]>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -16,6 +16,7 @@ export * from './business/EntityStatus';
16
16
  export * from './business/ProductUnit';
17
17
  export * from './business/RepeatOption';
18
18
  export * from './def/ListItem';
19
+ export * from './erp/dto/AuditLineDto';
19
20
  export * from './erp/dto/CurrencyDto';
20
21
  export * from './erp/dto/ExchangeRateDto';
21
22
  export * from './erp/dto/ExchangeRateHistoryDto';
package/lib/cjs/index.js CHANGED
@@ -39,6 +39,7 @@ __exportStar(require("./business/RepeatOption"), exports);
39
39
  // def
40
40
  __exportStar(require("./def/ListItem"), exports);
41
41
  // erp dto
42
+ __exportStar(require("./erp/dto/AuditLineDto"), exports);
42
43
  __exportStar(require("./erp/dto/CurrencyDto"), exports);
43
44
  __exportStar(require("./erp/dto/ExchangeRateDto"), exports);
44
45
  __exportStar(require("./erp/dto/ExchangeRateHistoryDto"), exports);
@@ -3,6 +3,7 @@ import { DataTypes } from '@etsoo/shared';
3
3
  import { IApp } from '../app/IApp';
4
4
  import { IActionResult } from '../result/IActionResult';
5
5
  import { BaseApi } from './BaseApi';
6
+ import { AuditLineDto, AuditLinePayload } from './dto/AuditLineDto';
6
7
  import { QueryRQ } from './rq/QueryRQ';
7
8
  import { TiplistRQ } from './rq/TiplistRQ';
8
9
  /**
@@ -46,6 +47,13 @@ export declare class EntityApi<T extends IApp = IApp> extends BaseApi<T> {
46
47
  * @returns Result
47
48
  */
48
49
  protected queryBase<T extends DataTypes.IdType, RQ extends QueryRQ<T>, R extends object>(rq: RQ, payload?: IApiPayload<R[]>, queryKey?: string): Promise<R[] | undefined>;
50
+ /**
51
+ * Query audit history
52
+ * @param rq Request data
53
+ * @param payload Payload
54
+ * @returns Result
55
+ */
56
+ protected queryAuditBase<T extends DataTypes.IdType, R extends QueryRQ<T>>(rq: R, payload?: AuditLinePayload): Promise<AuditLineDto[] | undefined>;
49
57
  /**
50
58
  * Read
51
59
  * @param id Id
@@ -47,6 +47,15 @@ export class EntityApi extends BaseApi {
47
47
  queryBase(rq, payload, queryKey = '') {
48
48
  return this.api.post(`${this.flag}/Query${queryKey}`, rq, payload);
49
49
  }
50
+ /**
51
+ * Query audit history
52
+ * @param rq Request data
53
+ * @param payload Payload
54
+ * @returns Result
55
+ */
56
+ queryAuditBase(rq, payload) {
57
+ return this.api.post(`${this.flag}/QueryAudit`, rq, payload);
58
+ }
50
59
  /**
51
60
  * Read
52
61
  * @param id Id
@@ -0,0 +1,24 @@
1
+ import { IApiPayload } from '@etsoo/restclient';
2
+ /**
3
+ * Audit line data
4
+ */
5
+ export declare type AuditLineDto = {
6
+ id: number;
7
+ creation: Date;
8
+ user: string;
9
+ action: string;
10
+ changes?: AuditLineChangesDto;
11
+ oldData?: Record<string, unknown>;
12
+ newData?: Record<string, unknown>;
13
+ };
14
+ /**
15
+ * Audit line changes data
16
+ */
17
+ export declare type AuditLineChangesDto = {
18
+ oldData: Record<string, unknown>;
19
+ newData: Record<string, unknown>;
20
+ };
21
+ /**
22
+ * Audit line API payload
23
+ */
24
+ export declare type AuditLinePayload = IApiPayload<AuditLineDto[]>;
@@ -0,0 +1 @@
1
+ export {};
@@ -16,6 +16,7 @@ export * from './business/EntityStatus';
16
16
  export * from './business/ProductUnit';
17
17
  export * from './business/RepeatOption';
18
18
  export * from './def/ListItem';
19
+ export * from './erp/dto/AuditLineDto';
19
20
  export * from './erp/dto/CurrencyDto';
20
21
  export * from './erp/dto/ExchangeRateDto';
21
22
  export * from './erp/dto/ExchangeRateHistoryDto';
package/lib/mjs/index.js CHANGED
@@ -22,6 +22,7 @@ export * from './business/RepeatOption';
22
22
  // def
23
23
  export * from './def/ListItem';
24
24
  // erp dto
25
+ export * from './erp/dto/AuditLineDto';
25
26
  export * from './erp/dto/CurrencyDto';
26
27
  export * from './erp/dto/ExchangeRateDto';
27
28
  export * from './erp/dto/ExchangeRateHistoryDto';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.3.29",
3
+ "version": "1.3.30",
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.14",
56
56
  "@etsoo/restclient": "^1.0.76",
57
- "@etsoo/shared": "^1.1.73",
57
+ "@etsoo/shared": "^1.1.75",
58
58
  "@types/crypto-js": "^4.1.1",
59
59
  "crypto-js": "^4.1.1"
60
60
  },
@@ -70,8 +70,8 @@
70
70
  "eslint": "^8.27.0",
71
71
  "eslint-config-airbnb-base": "^15.0.0",
72
72
  "eslint-plugin-import": "^2.26.0",
73
- "jest": "^29.3.0",
74
- "jest-environment-jsdom": "^29.3.0",
73
+ "jest": "^29.3.1",
74
+ "jest-environment-jsdom": "^29.3.1",
75
75
  "ts-jest": "^29.0.3",
76
76
  "typescript": "^4.8.4"
77
77
  }
@@ -3,6 +3,7 @@ import { DataTypes } from '@etsoo/shared';
3
3
  import { IApp } from '../app/IApp';
4
4
  import { IActionResult } from '../result/IActionResult';
5
5
  import { BaseApi } from './BaseApi';
6
+ import { AuditLineDto, AuditLinePayload } from './dto/AuditLineDto';
6
7
  import { QueryRQ } from './rq/QueryRQ';
7
8
  import { TiplistRQ } from './rq/TiplistRQ';
8
9
 
@@ -89,6 +90,19 @@ export class EntityApi<T extends IApp = IApp> extends BaseApi<T> {
89
90
  return this.api.post(`${this.flag}/Query${queryKey}`, rq, payload);
90
91
  }
91
92
 
93
+ /**
94
+ * Query audit history
95
+ * @param rq Request data
96
+ * @param payload Payload
97
+ * @returns Result
98
+ */
99
+ protected queryAuditBase<T extends DataTypes.IdType, R extends QueryRQ<T>>(
100
+ rq: R,
101
+ payload?: AuditLinePayload
102
+ ) {
103
+ return this.api.post(`${this.flag}/QueryAudit`, rq, payload);
104
+ }
105
+
92
106
  /**
93
107
  * Read
94
108
  * @param id Id
@@ -0,0 +1,27 @@
1
+ import { IApiPayload } from '@etsoo/restclient';
2
+
3
+ /**
4
+ * Audit line data
5
+ */
6
+ export type AuditLineDto = {
7
+ id: number;
8
+ creation: Date;
9
+ user: string;
10
+ action: string;
11
+ changes?: AuditLineChangesDto;
12
+ oldData?: Record<string, unknown>;
13
+ newData?: Record<string, unknown>;
14
+ };
15
+
16
+ /**
17
+ * Audit line changes data
18
+ */
19
+ export type AuditLineChangesDto = {
20
+ oldData: Record<string, unknown>;
21
+ newData: Record<string, unknown>;
22
+ };
23
+
24
+ /**
25
+ * Audit line API payload
26
+ */
27
+ export type AuditLinePayload = IApiPayload<AuditLineDto[]>;
package/src/index.ts CHANGED
@@ -27,6 +27,7 @@ export * from './business/RepeatOption';
27
27
  export * from './def/ListItem';
28
28
 
29
29
  // erp dto
30
+ export * from './erp/dto/AuditLineDto';
30
31
  export * from './erp/dto/CurrencyDto';
31
32
  export * from './erp/dto/ExchangeRateDto';
32
33
  export * from './erp/dto/ExchangeRateHistoryDto';