@etsoo/appscript 1.3.7 → 1.3.8

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.
Files changed (99) hide show
  1. package/README.md +2 -14
  2. package/__tests__/app/CoreApp.ts +11 -0
  3. package/lib/cjs/app/CoreApp.d.ts +1 -1
  4. package/lib/cjs/erp/AddressApi.d.ts +1 -1
  5. package/lib/cjs/erp/AddressApi.js +2 -2
  6. package/lib/cjs/erp/BaseApi.d.ts +5 -3
  7. package/lib/cjs/erp/BaseApi.js +3 -1
  8. package/lib/cjs/erp/EntityApi.d.ts +78 -0
  9. package/lib/cjs/erp/EntityApi.js +91 -0
  10. package/lib/cjs/erp/OrgApi.d.ts +32 -5
  11. package/lib/cjs/erp/OrgApi.js +30 -12
  12. package/lib/cjs/erp/PublicApi.js +5 -5
  13. package/lib/cjs/{dto → erp/dto}/IdLabelDto.d.ts +0 -0
  14. package/lib/cjs/{dto → erp/dto}/IdLabelDto.js +0 -0
  15. package/lib/cjs/{dto → erp/dto}/IdLabelPrimaryDto.d.ts +0 -0
  16. package/lib/cjs/{dto → erp/dto}/IdLabelPrimaryDto.js +0 -0
  17. package/lib/cjs/{dto → erp/dto}/InitCallDto.d.ts +0 -0
  18. package/lib/cjs/{dto → erp/dto}/InitCallDto.js +0 -0
  19. package/lib/cjs/erp/dto/OrgQueryDto.d.ts +21 -0
  20. package/lib/cjs/{rq/LoginIdRQ.js → erp/dto/OrgQueryDto.js} +0 -0
  21. package/lib/cjs/erp/rq/OrgListRQ.d.ts +10 -0
  22. package/lib/cjs/{rq/LoginRQ.js → erp/rq/OrgListRQ.js} +0 -0
  23. package/lib/cjs/erp/rq/OrgQueryRQ.d.ts +14 -0
  24. package/lib/cjs/{rq/QueryRQ.js → erp/rq/OrgQueryRQ.js} +0 -0
  25. package/lib/cjs/erp/rq/OrgRQ.d.ts +25 -0
  26. package/lib/cjs/{rq/TiplistRQ.js → erp/rq/OrgRQ.js} +0 -0
  27. package/lib/cjs/{rq → erp/rq}/QueryRQ.d.ts +0 -0
  28. package/lib/cjs/erp/rq/QueryRQ.js +2 -0
  29. package/lib/cjs/erp/rq/RefreshTokenRQ.d.ts +29 -0
  30. package/lib/cjs/erp/rq/RefreshTokenRQ.js +2 -0
  31. package/lib/cjs/{rq → erp/rq}/TiplistRQ.d.ts +0 -0
  32. package/lib/cjs/erp/rq/TiplistRQ.js +2 -0
  33. package/lib/cjs/i18n/en-US.json +1 -0
  34. package/lib/cjs/i18n/zh-CN.json +1 -0
  35. package/lib/cjs/i18n/zh-HK.json +1 -0
  36. package/lib/cjs/index.d.ts +7 -7
  37. package/lib/cjs/index.js +10 -10
  38. package/lib/mjs/app/CoreApp.d.ts +1 -1
  39. package/lib/mjs/erp/AddressApi.d.ts +1 -1
  40. package/lib/mjs/erp/AddressApi.js +2 -2
  41. package/lib/mjs/erp/BaseApi.d.ts +5 -3
  42. package/lib/mjs/erp/BaseApi.js +3 -1
  43. package/lib/mjs/erp/EntityApi.d.ts +78 -0
  44. package/lib/mjs/erp/EntityApi.js +87 -0
  45. package/lib/mjs/erp/OrgApi.d.ts +32 -5
  46. package/lib/mjs/erp/OrgApi.js +30 -12
  47. package/lib/mjs/erp/PublicApi.js +5 -5
  48. package/lib/mjs/{dto → erp/dto}/IdLabelDto.d.ts +0 -0
  49. package/lib/mjs/{dto → erp/dto}/IdLabelDto.js +0 -0
  50. package/lib/mjs/{dto → erp/dto}/IdLabelPrimaryDto.d.ts +0 -0
  51. package/lib/mjs/{dto → erp/dto}/IdLabelPrimaryDto.js +0 -0
  52. package/lib/mjs/{dto → erp/dto}/InitCallDto.d.ts +0 -0
  53. package/lib/mjs/{dto → erp/dto}/InitCallDto.js +0 -0
  54. package/lib/mjs/erp/dto/OrgQueryDto.d.ts +21 -0
  55. package/lib/mjs/{rq/LoginIdRQ.js → erp/dto/OrgQueryDto.js} +0 -0
  56. package/lib/mjs/erp/rq/OrgListRQ.d.ts +10 -0
  57. package/lib/mjs/{rq/LoginRQ.js → erp/rq/OrgListRQ.js} +0 -0
  58. package/lib/mjs/erp/rq/OrgQueryRQ.d.ts +14 -0
  59. package/lib/mjs/{rq/QueryRQ.js → erp/rq/OrgQueryRQ.js} +0 -0
  60. package/lib/mjs/erp/rq/OrgRQ.d.ts +25 -0
  61. package/lib/mjs/{rq/TiplistRQ.js → erp/rq/OrgRQ.js} +0 -0
  62. package/lib/mjs/{rq → erp/rq}/QueryRQ.d.ts +0 -0
  63. package/lib/mjs/erp/rq/QueryRQ.js +1 -0
  64. package/lib/mjs/erp/rq/RefreshTokenRQ.d.ts +29 -0
  65. package/lib/mjs/erp/rq/RefreshTokenRQ.js +1 -0
  66. package/lib/mjs/{rq → erp/rq}/TiplistRQ.d.ts +0 -0
  67. package/lib/mjs/erp/rq/TiplistRQ.js +1 -0
  68. package/lib/mjs/i18n/en-US.json +1 -0
  69. package/lib/mjs/i18n/zh-CN.json +1 -0
  70. package/lib/mjs/i18n/zh-HK.json +1 -0
  71. package/lib/mjs/index.d.ts +7 -7
  72. package/lib/mjs/index.js +10 -10
  73. package/package.json +2 -2
  74. package/src/app/CoreApp.ts +1 -1
  75. package/src/erp/AddressApi.ts +3 -3
  76. package/src/erp/BaseApi.ts +3 -2
  77. package/src/erp/EntityApi.ts +142 -0
  78. package/src/erp/OrgApi.ts +66 -19
  79. package/src/erp/PublicApi.ts +5 -7
  80. package/src/{dto → erp/dto}/IdLabelDto.ts +0 -0
  81. package/src/{dto → erp/dto}/IdLabelPrimaryDto.ts +0 -0
  82. package/src/{dto → erp/dto}/InitCallDto.ts +0 -0
  83. package/src/erp/dto/OrgQueryDto.ts +24 -0
  84. package/src/erp/rq/OrgListRQ.ts +11 -0
  85. package/src/erp/rq/OrgQueryRQ.ts +16 -0
  86. package/src/erp/rq/OrgRQ.ts +29 -0
  87. package/src/{rq → erp/rq}/QueryRQ.ts +0 -0
  88. package/src/erp/rq/RefreshTokenRQ.ts +34 -0
  89. package/src/{rq → erp/rq}/TiplistRQ.ts +0 -0
  90. package/src/i18n/en-US.json +1 -0
  91. package/src/i18n/zh-CN.json +1 -0
  92. package/src/i18n/zh-HK.json +1 -0
  93. package/src/index.ts +11 -12
  94. package/lib/cjs/rq/LoginIdRQ.d.ts +0 -17
  95. package/lib/cjs/rq/LoginRQ.d.ts +0 -22
  96. package/lib/mjs/rq/LoginIdRQ.d.ts +0 -17
  97. package/lib/mjs/rq/LoginRQ.d.ts +0 -22
  98. package/src/rq/LoginIdRQ.ts +0 -19
  99. package/src/rq/LoginRQ.ts +0 -26
@@ -16,15 +16,19 @@ 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 './dto/IdLabelDto';
20
- export * from './dto/IdLabelPrimaryDto';
21
- export * from './dto/InitCallDto';
22
19
  export * from './erp/dto/CurrencyDto';
23
20
  export * from './erp/dto/ExchangeRateDto';
24
21
  export * from './erp/dto/ExchangeRateHistoryDto';
22
+ export * from './erp/dto/IdLabelDto';
23
+ export * from './erp/dto/IdLabelPrimaryDto';
24
+ export * from './erp/dto/InitCallDto';
25
25
  export * from './erp/dto/PublicProductDto';
26
+ export * from './erp/rq/QueryRQ';
27
+ export * from './erp/rq/RefreshTokenRQ';
28
+ export * from './erp/rq/TiplistRQ';
26
29
  export * from './erp/AddressApi';
27
30
  export * from './erp/BaseApi';
31
+ export * from './erp/EntityApi';
28
32
  export * from './erp/OrgApi';
29
33
  export * from './erp/PublicApi';
30
34
  export * from './i18n/enUS';
@@ -36,10 +40,6 @@ export * from './result/ActionResult';
36
40
  export * from './result/ActionResultError';
37
41
  export * from './result/IActionResult';
38
42
  export * from './result/InitCallResult';
39
- export * from './rq/LoginIdRQ';
40
- export * from './rq/LoginRQ';
41
- export * from './rq/QueryRQ';
42
- export * from './rq/TiplistRQ';
43
43
  export * from './state/Culture';
44
44
  export * from './state/State';
45
45
  export * from './state/User';
package/lib/mjs/index.js CHANGED
@@ -21,17 +21,22 @@ export * from './business/ProductUnit';
21
21
  export * from './business/RepeatOption';
22
22
  // def
23
23
  export * from './def/ListItem';
24
- // dto
25
- export * from './dto/IdLabelDto';
26
- export * from './dto/IdLabelPrimaryDto';
27
- export * from './dto/InitCallDto';
28
- // erp
24
+ // erp dto
29
25
  export * from './erp/dto/CurrencyDto';
30
26
  export * from './erp/dto/ExchangeRateDto';
31
27
  export * from './erp/dto/ExchangeRateHistoryDto';
28
+ export * from './erp/dto/IdLabelDto';
29
+ export * from './erp/dto/IdLabelPrimaryDto';
30
+ export * from './erp/dto/InitCallDto';
32
31
  export * from './erp/dto/PublicProductDto';
32
+ // erp rq
33
+ export * from './erp/rq/QueryRQ';
34
+ export * from './erp/rq/RefreshTokenRQ';
35
+ export * from './erp/rq/TiplistRQ';
36
+ // erp api
33
37
  export * from './erp/AddressApi';
34
38
  export * from './erp/BaseApi';
39
+ export * from './erp/EntityApi';
35
40
  export * from './erp/OrgApi';
36
41
  export * from './erp/PublicApi';
37
42
  // i18n
@@ -45,11 +50,6 @@ export * from './result/ActionResult';
45
50
  export * from './result/ActionResultError';
46
51
  export * from './result/IActionResult';
47
52
  export * from './result/InitCallResult';
48
- // rq
49
- export * from './rq/LoginIdRQ';
50
- export * from './rq/LoginRQ';
51
- export * from './rq/QueryRQ';
52
- export * from './rq/TiplistRQ';
53
53
  // state
54
54
  export * from './state/Culture';
55
55
  export * from './state/State';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.3.7",
3
+ "version": "1.3.8",
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.12",
56
56
  "@etsoo/restclient": "^1.0.74",
57
- "@etsoo/shared": "^1.1.60",
57
+ "@etsoo/shared": "^1.1.62",
58
58
  "@types/crypto-js": "^4.1.1",
59
59
  "crypto-js": "^4.1.1"
60
60
  },
@@ -33,7 +33,7 @@ import { AddressRegion } from '../address/AddressRegion';
33
33
  import { AddressUtils } from '../address/AddressUtils';
34
34
  import { BridgeUtils } from '../bridges/BridgeUtils';
35
35
  import { EntityStatus } from '../business/EntityStatus';
36
- import { InitCallDto } from '../dto/InitCallDto';
36
+ import { InitCallDto } from '../erp/dto/InitCallDto';
37
37
  import { ActionResultError } from '../result/ActionResultError';
38
38
  import { IActionResult } from '../result/IActionResult';
39
39
  import { InitCallResult, InitCallResultData } from '../result/InitCallResult';
@@ -2,7 +2,7 @@ import { DataTypes } from '@etsoo/shared';
2
2
  import { AddressContinent } from '../address/AddressContinent';
3
3
  import { AddressRegion, AddressRegionDb } from '../address/AddressRegion';
4
4
  import { AddressState } from '../address/AddressState';
5
- import { IdLabelConditional } from '../dto/IdLabelDto';
5
+ import { IdLabelConditional } from './dto/IdLabelDto';
6
6
  import { BaseApi } from './BaseApi';
7
7
 
8
8
  /**
@@ -54,7 +54,7 @@ export class AddressApi extends BaseApi {
54
54
  return { ...region };
55
55
  });
56
56
  } else {
57
- return (await this.app.api.get<AddressRegionDb[]>(
57
+ return (await this.api.get<AddressRegionDb[]>(
58
58
  `Address/RegionList?language=${this.app.culture}`,
59
59
  undefined,
60
60
  { defaultValue: [] }
@@ -68,7 +68,7 @@ export class AddressApi extends BaseApi {
68
68
  * @returns Result
69
69
  */
70
70
  states(regionId: string) {
71
- return this.app.api.get<AddressState[]>(
71
+ return this.api.get<AddressState[]>(
72
72
  `Address/StateList?regionId=${regionId}&language=${this.app.culture}`,
73
73
  undefined,
74
74
  { defaultValue: [] }
@@ -3,10 +3,11 @@ import { IApp } from '../app/IApp';
3
3
  /**
4
4
  * SmartERP base API
5
5
  */
6
- export class BaseApi {
6
+ export class BaseApi<T extends IApp = IApp> {
7
7
  /**
8
8
  * Constructor
9
9
  * @param app Application
10
+ * @param api API
10
11
  */
11
- constructor(protected app: IApp) {}
12
+ constructor(protected app: T, protected api = app.api) {}
12
13
  }
@@ -0,0 +1,142 @@
1
+ import { IApi, IApiPayload } from '@etsoo/restclient';
2
+ import { DataTypes } from '@etsoo/shared';
3
+ import { IApp } from '../app/IApp';
4
+ import { IActionResult } from '../result/IActionResult';
5
+ import { BaseApi } from './BaseApi';
6
+ import { QueryRQ } from './rq/QueryRQ';
7
+ import { TiplistRQ } from './rq/TiplistRQ';
8
+
9
+ /**
10
+ * Entity API
11
+ * Follow com.etsoo.CoreFramework.Services.EntityServiceBase
12
+ */
13
+ export class EntityApi<T extends IApp = IApp> extends BaseApi<T> {
14
+ /**
15
+ * Constructor
16
+ * @param flag Identity flag, like 'Product' for product APIs
17
+ * @param app Application
18
+ */
19
+ constructor(protected flag: string, app: T, api?: IApi) {
20
+ super(app, api);
21
+ }
22
+
23
+ /**
24
+ * Create
25
+ * @param data Modal data
26
+ * @param payload Payload
27
+ * @returns Result
28
+ */
29
+ protected createBase<R extends IActionResult>(
30
+ data: object,
31
+ payload?: IApiPayload<R, any>
32
+ ) {
33
+ return this.api.put<R>(`${this.flag}/Create`, data, payload);
34
+ }
35
+
36
+ /**
37
+ * Delete
38
+ * @param id Id or ids
39
+ * @param payload Payload
40
+ */
41
+ protected deleteBase<R extends IActionResult>(
42
+ id: DataTypes.IdType,
43
+ payload?: IApiPayload<R, any>
44
+ ): R;
45
+ protected deleteBase<R extends IActionResult>(
46
+ ids: DataTypes.IdType[],
47
+ payload?: IApiPayload<R, any>
48
+ ): R;
49
+ protected deleteBase<R extends IActionResult>(
50
+ id: DataTypes.IdType | DataTypes.IdType[],
51
+ payload?: IApiPayload<R, any>
52
+ ) {
53
+ const query = Array.isArray(id)
54
+ ? '?' + id.map((item) => `ids=${item}`).join('&')
55
+ : id;
56
+ return this.api.delete<R>(
57
+ `${this.flag}/Delete/${query}`,
58
+ undefined,
59
+ payload
60
+ );
61
+ }
62
+
63
+ /**
64
+ * List
65
+ * @param rq Request data
66
+ * @param payload Payload
67
+ * @returns Result
68
+ */
69
+ protected listBase<RQ extends TiplistRQ, R extends object>(
70
+ rq: RQ,
71
+ payload?: IApiPayload<R[], any>
72
+ ) {
73
+ return this.api.post<R[]>(`${this.flag}/List`, rq, payload);
74
+ }
75
+
76
+ /**
77
+ * Query
78
+ * @param rq Request data
79
+ * @param payload Payload
80
+ * @returns Result
81
+ */
82
+ protected queryBase<RQ extends QueryRQ, R extends object>(
83
+ rq: RQ,
84
+ payload?: IApiPayload<R[], any>
85
+ ) {
86
+ return this.api.post<R[]>(`${this.flag}/Query`, rq, payload);
87
+ }
88
+
89
+ /**
90
+ * Read
91
+ * @param id Id
92
+ * @param payload Payload
93
+ * @returns Result
94
+ */
95
+ protected readBase<R extends object>(
96
+ id: DataTypes.IdType,
97
+ payload?: IApiPayload<R, any>
98
+ ) {
99
+ return this.api.get<R>(`${this.flag}/Read/${id}`, payload);
100
+ }
101
+
102
+ /**
103
+ * Sort
104
+ * @param items Items to sort
105
+ * @param payload Payload
106
+ * @returns Result
107
+ */
108
+ protected sortBase<RQ extends { id: DataTypes.IdType }>(
109
+ items: RQ[],
110
+ payload?: IApiPayload<number, any>
111
+ ) {
112
+ const rq: Record<DataTypes.IdType, number> = {};
113
+ items.forEach((item, index) => (rq[item.id] = index));
114
+ return this.api.put<number>(`${this.flag}/Sort`, rq, payload);
115
+ }
116
+
117
+ /**
118
+ * Update
119
+ * @param data Modal data
120
+ * @param payload Payload
121
+ * @returns Result
122
+ */
123
+ protected updateBase<R extends IActionResult>(
124
+ data: object,
125
+ payload?: IApiPayload<R, any>
126
+ ) {
127
+ return this.api.put<R>(`${this.flag}/Update`, data, payload);
128
+ }
129
+
130
+ /**
131
+ * Read for update
132
+ * @param id Id
133
+ * @param payload Payload
134
+ * @returns Result
135
+ */
136
+ protected updateReadBase<R extends object>(
137
+ id: DataTypes.IdType,
138
+ payload?: IApiPayload<R, any>
139
+ ) {
140
+ return this.api.get<R>(`${this.flag}/UpdateRead/${id}`, payload);
141
+ }
142
+ }
package/src/erp/OrgApi.ts CHANGED
@@ -1,25 +1,51 @@
1
- import { ListType } from '@etsoo/shared';
2
- import { BaseApi } from './BaseApi';
1
+ import { IApiPayload } from '@etsoo/restclient';
2
+ import { DataTypes, ListType } from '@etsoo/shared';
3
+ import { IApp } from '../app/IApp';
4
+ import { IdActionResult } from '../result/IActionResult';
5
+ import { OrgQueryDto } from './dto/OrgQueryDto';
6
+ import { EntityApi } from './EntityApi';
7
+ import { OrgListRQ } from './rq/OrgListRQ';
8
+ import { OrgQueryRQ } from './rq/OrgQueryRQ';
9
+ import { OrgRQ } from './rq/OrgRQ';
3
10
 
4
11
  /**
5
12
  * Organization API
6
13
  */
7
- export class OrgApi extends BaseApi {
14
+ export class OrgApi extends EntityApi {
15
+ /**
16
+ * Constructor
17
+ * @param app Application
18
+ */
19
+ constructor(app: IApp) {
20
+ super('Organization', app);
21
+ }
22
+
8
23
  /**
9
24
  * Get organization list
10
- * @param items Max items
25
+ * @param items Max items or request data
11
26
  * @param serviceId Service id
12
27
  * @returns Result
13
28
  */
14
- list(items?: number, serviceId?: number) {
15
- return this.app.api.post<ListType[]>(
16
- 'Organization/List',
17
- {
18
- items,
19
- serviceId
20
- },
21
- { defaultValue: [], showLoading: false }
22
- );
29
+ list(items?: number, serviceId?: number): Promise<ListType[] | undefined>;
30
+ list(rq: OrgListRQ): Promise<ListType[] | undefined>;
31
+ list(
32
+ items?: number | OrgListRQ,
33
+ serviceId?: number,
34
+ payload?: IApiPayload<ListType[], any>
35
+ ) {
36
+ payload ??= { defaultValue: [], showLoading: false };
37
+ const rq = typeof items === 'object' ? items : { items, serviceId };
38
+ return this.listBase(rq, payload);
39
+ }
40
+
41
+ /**
42
+ * Query
43
+ * @param rq Request data
44
+ * @param payload Payload
45
+ * @returns Result
46
+ */
47
+ query(rq: OrgQueryRQ, payload?: IApiPayload<OrgQueryDto[], any>) {
48
+ return this.queryBase(rq, payload);
23
49
  }
24
50
 
25
51
  /**
@@ -27,13 +53,34 @@ export class OrgApi extends BaseApi {
27
53
  * @param id Organization id
28
54
  * @param serviceId Service id
29
55
  */
30
- async switch(id: number, serviceId?: number) {
31
- const result = await this.app.api.put<boolean>('Organization/Switch', {
32
- id,
33
- serviceId,
34
- deviceId: this.app.deviceId
35
- });
56
+ async switch(
57
+ id: number,
58
+ serviceId?: number,
59
+ payload?: IApiPayload<boolean, any>
60
+ ) {
61
+ const result = await this.app.api.put<boolean>(
62
+ 'Organization/Switch',
63
+ {
64
+ id,
65
+ serviceId,
66
+ deviceId: this.app.deviceId
67
+ },
68
+ payload
69
+ );
36
70
  if (result) return await this.app.refreshToken();
37
71
  return result;
38
72
  }
73
+
74
+ /**
75
+ * Update
76
+ * @param data Modal data
77
+ * @param payload Payload
78
+ * @returns Result
79
+ */
80
+ update(
81
+ data: DataTypes.AddOrEditType<OrgRQ, true>,
82
+ payload?: IApiPayload<IdActionResult, any>
83
+ ) {
84
+ return super.updateBase<IdActionResult>(data, payload);
85
+ }
39
86
  }
@@ -21,7 +21,7 @@ export class PublicApi extends BaseApi {
21
21
  currencyNames?: T
22
22
  ): Promise<T extends undefined ? CurrencyDto[] | undefined : ListType1[]> {
23
23
  if (currencyNames == null)
24
- return (await this.app.api.get<CurrencyDto[]>(
24
+ return (await this.api.get<CurrencyDto[]>(
25
25
  'Public/GetCurrencies'
26
26
  )) as any;
27
27
  else
@@ -37,9 +37,7 @@ export class PublicApi extends BaseApi {
37
37
  * @returns Result
38
38
  */
39
39
  exchangeRate(currency: Currency | string) {
40
- return this.app.api.get<ExchangeRateDto>(
41
- `Public/ExchangeRate/${currency}`
42
- );
40
+ return this.api.get<ExchangeRateDto>(`Public/ExchangeRate/${currency}`);
43
41
  }
44
42
 
45
43
  /**
@@ -49,7 +47,7 @@ export class PublicApi extends BaseApi {
49
47
  * @returns Result
50
48
  */
51
49
  exchangeRateHistory(currencies: (Currency | string)[], months?: number) {
52
- return this.app.api.post<ExchangeRateHistoryDto[]>(
50
+ return this.api.post<ExchangeRateHistoryDto[]>(
53
51
  'Public/ExchangeRateHistory',
54
52
  { currencies, months },
55
53
  { defaultValue: [] }
@@ -87,7 +85,7 @@ export class PublicApi extends BaseApi {
87
85
  * @param host Host URL
88
86
  */
89
87
  mobileQRCode(id?: string, host?: string) {
90
- return this.app.api.post<string>('Public/MobileQRCode', { id, host });
88
+ return this.api.post<string>('Public/MobileQRCode', { id, host });
91
89
  }
92
90
 
93
91
  /**
@@ -101,7 +99,7 @@ export class PublicApi extends BaseApi {
101
99
  culture?: string
102
100
  ): T extends number ? PublicProductDto : PublicOrgProductDto {
103
101
  culture = this.app.checkLanguage(culture);
104
- return this.app.api.post<PublicProductDto>(
102
+ return this.api.post<PublicProductDto>(
105
103
  `Public/Product/${id}/${culture}`
106
104
  ) as any;
107
105
  }
File without changes
File without changes
File without changes
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Organization query data
3
+ */
4
+ export type OrgQueryDto = {
5
+ /**
6
+ * Id
7
+ */
8
+ id: number;
9
+
10
+ /**
11
+ * Brand, like ETSOO
12
+ */
13
+ brand?: string;
14
+
15
+ /**
16
+ * Name, like ETSOO NZ LIMITED
17
+ */
18
+ name: string;
19
+
20
+ /**
21
+ * Creation
22
+ */
23
+ creation: string | Date;
24
+ };
@@ -0,0 +1,11 @@
1
+ import { TiplistRQ } from './TiplistRQ';
2
+
3
+ /**
4
+ * Organization list request data
5
+ */
6
+ export type OrgListRQ = TiplistRQ & {
7
+ /**
8
+ * Service id
9
+ */
10
+ serviceId?: number;
11
+ };
@@ -0,0 +1,16 @@
1
+ import { QueryRQ } from './QueryRQ';
2
+
3
+ /**
4
+ * Organization query request data
5
+ */
6
+ export type OrgQueryRQ = QueryRQ & {
7
+ /**
8
+ * Name
9
+ */
10
+ name?: string;
11
+
12
+ /**
13
+ * Parent organization id
14
+ */
15
+ parentId?: number;
16
+ };
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Organization add/edit request data
3
+ */
4
+ export type OrgRQ = {
5
+ /**
6
+ * Region id
7
+ */
8
+ regionId: string;
9
+
10
+ /**
11
+ * Name
12
+ */
13
+ name: string;
14
+
15
+ /**
16
+ * Identifier
17
+ */
18
+ identifier: string;
19
+
20
+ /**
21
+ * Brand
22
+ */
23
+ brand?: string;
24
+
25
+ /**
26
+ * Trade as
27
+ */
28
+ tradeAs?: string;
29
+ };
File without changes
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Refresh token request data
3
+ */
4
+ export type RefreshTokenRQ = {
5
+ /**
6
+ * Device id
7
+ */
8
+ deviceId: string;
9
+
10
+ /**
11
+ * Login password
12
+ */
13
+ pwd?: string;
14
+
15
+ /**
16
+ * Service device id
17
+ */
18
+ serviceDeviceId?: string;
19
+
20
+ /**
21
+ * Service id
22
+ */
23
+ serviceId?: number;
24
+
25
+ /**
26
+ * Service Uid
27
+ */
28
+ serviceUid?: string;
29
+
30
+ /**
31
+ * Time zone
32
+ */
33
+ timezone?: string;
34
+ };
File without changes
@@ -113,6 +113,7 @@
113
113
  "refresh": "Refresh",
114
114
  "refreshing": "Refreshing",
115
115
  "releaseToRefresh": "Release to refresh",
116
+ "region": "Country or region",
116
117
  "regionAU": "Australia",
117
118
  "regionCA": "Canada",
118
119
  "regionCN": "Mainland China",
@@ -112,6 +112,7 @@
112
112
  "record": "记录",
113
113
  "refresh": "刷新",
114
114
  "refreshing": "正在刷新",
115
+ "region": "国家或地区",
115
116
  "regionAU": "澳大利亚",
116
117
  "regionCA": "加拿大",
117
118
  "regionCN": "中国大陆",
@@ -112,6 +112,7 @@
112
112
  "record": "記錄",
113
113
  "refresh": "刷新",
114
114
  "refreshing": "正在刷新",
115
+ "region": "國家或地區",
115
116
  "regionAU": "澳大利亞",
116
117
  "regionCA": "加拿大",
117
118
  "regionCN": "中國大陸",
package/src/index.ts CHANGED
@@ -26,19 +26,24 @@ export * from './business/RepeatOption';
26
26
  // def
27
27
  export * from './def/ListItem';
28
28
 
29
- // dto
30
- export * from './dto/IdLabelDto';
31
- export * from './dto/IdLabelPrimaryDto';
32
- export * from './dto/InitCallDto';
33
-
34
- // erp
29
+ // erp dto
35
30
  export * from './erp/dto/CurrencyDto';
36
31
  export * from './erp/dto/ExchangeRateDto';
37
32
  export * from './erp/dto/ExchangeRateHistoryDto';
33
+ export * from './erp/dto/IdLabelDto';
34
+ export * from './erp/dto/IdLabelPrimaryDto';
35
+ export * from './erp/dto/InitCallDto';
38
36
  export * from './erp/dto/PublicProductDto';
39
37
 
38
+ // erp rq
39
+ export * from './erp/rq/QueryRQ';
40
+ export * from './erp/rq/RefreshTokenRQ';
41
+ export * from './erp/rq/TiplistRQ';
42
+
43
+ // erp api
40
44
  export * from './erp/AddressApi';
41
45
  export * from './erp/BaseApi';
46
+ export * from './erp/EntityApi';
42
47
  export * from './erp/OrgApi';
43
48
  export * from './erp/PublicApi';
44
49
 
@@ -57,12 +62,6 @@ export * from './result/ActionResultError';
57
62
  export * from './result/IActionResult';
58
63
  export * from './result/InitCallResult';
59
64
 
60
- // rq
61
- export * from './rq/LoginIdRQ';
62
- export * from './rq/LoginRQ';
63
- export * from './rq/QueryRQ';
64
- export * from './rq/TiplistRQ';
65
-
66
65
  // state
67
66
  export * from './state/Culture';
68
67
  export * from './state/State';
@@ -1,17 +0,0 @@
1
- /**
2
- * Login id request data
3
- */
4
- export declare type LoginIdRQ = {
5
- /**
6
- * Device id
7
- */
8
- deviceId: string;
9
- /**
10
- * Username, Email or mobile
11
- */
12
- id: string;
13
- /**
14
- * Country or region
15
- */
16
- region: string;
17
- };