@etsoo/appscript 1.3.7 → 1.3.9

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 +29 -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 +29 -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 +34 -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/cjs/index.js CHANGED
@@ -38,17 +38,22 @@ __exportStar(require("./business/ProductUnit"), exports);
38
38
  __exportStar(require("./business/RepeatOption"), exports);
39
39
  // def
40
40
  __exportStar(require("./def/ListItem"), exports);
41
- // dto
42
- __exportStar(require("./dto/IdLabelDto"), exports);
43
- __exportStar(require("./dto/IdLabelPrimaryDto"), exports);
44
- __exportStar(require("./dto/InitCallDto"), exports);
45
- // erp
41
+ // erp dto
46
42
  __exportStar(require("./erp/dto/CurrencyDto"), exports);
47
43
  __exportStar(require("./erp/dto/ExchangeRateDto"), exports);
48
44
  __exportStar(require("./erp/dto/ExchangeRateHistoryDto"), exports);
45
+ __exportStar(require("./erp/dto/IdLabelDto"), exports);
46
+ __exportStar(require("./erp/dto/IdLabelPrimaryDto"), exports);
47
+ __exportStar(require("./erp/dto/InitCallDto"), exports);
49
48
  __exportStar(require("./erp/dto/PublicProductDto"), exports);
49
+ // erp rq
50
+ __exportStar(require("./erp/rq/QueryRQ"), exports);
51
+ __exportStar(require("./erp/rq/RefreshTokenRQ"), exports);
52
+ __exportStar(require("./erp/rq/TiplistRQ"), exports);
53
+ // erp api
50
54
  __exportStar(require("./erp/AddressApi"), exports);
51
55
  __exportStar(require("./erp/BaseApi"), exports);
56
+ __exportStar(require("./erp/EntityApi"), exports);
52
57
  __exportStar(require("./erp/OrgApi"), exports);
53
58
  __exportStar(require("./erp/PublicApi"), exports);
54
59
  // i18n
@@ -64,11 +69,6 @@ __exportStar(require("./result/ActionResult"), exports);
64
69
  __exportStar(require("./result/ActionResultError"), exports);
65
70
  __exportStar(require("./result/IActionResult"), exports);
66
71
  __exportStar(require("./result/InitCallResult"), exports);
67
- // rq
68
- __exportStar(require("./rq/LoginIdRQ"), exports);
69
- __exportStar(require("./rq/LoginRQ"), exports);
70
- __exportStar(require("./rq/QueryRQ"), exports);
71
- __exportStar(require("./rq/TiplistRQ"), exports);
72
72
  // state
73
73
  __exportStar(require("./state/Culture"), exports);
74
74
  __exportStar(require("./state/State"), exports);
@@ -2,7 +2,7 @@ import { INotifier, NotificationAlign, NotificationCallProps, NotificationConten
2
2
  import { ApiDataError, IApi, IPData } from '@etsoo/restclient';
3
3
  import { DataTypes, DateUtils, IStorage, ListType, ListType1 } from '@etsoo/shared';
4
4
  import { AddressRegion } from '../address/AddressRegion';
5
- import { InitCallDto } from '../dto/InitCallDto';
5
+ import { InitCallDto } from '../erp/dto/InitCallDto';
6
6
  import { IActionResult } from '../result/IActionResult';
7
7
  import { InitCallResult, InitCallResultData } from '../result/InitCallResult';
8
8
  import { IUser } from '../state/User';
@@ -1,7 +1,7 @@
1
1
  import { AddressContinent } from '../address/AddressContinent';
2
2
  import { AddressRegion, AddressRegionDb } from '../address/AddressRegion';
3
3
  import { AddressState } from '../address/AddressState';
4
- import { IdLabelConditional } from '../dto/IdLabelDto';
4
+ import { IdLabelConditional } from './dto/IdLabelDto';
5
5
  import { BaseApi } from './BaseApi';
6
6
  /**
7
7
  * Address Api
@@ -41,7 +41,7 @@ export class AddressApi extends BaseApi {
41
41
  });
42
42
  }
43
43
  else {
44
- return (await this.app.api.get(`Address/RegionList?language=${this.app.culture}`, undefined, { defaultValue: [] }));
44
+ return (await this.api.get(`Address/RegionList?language=${this.app.culture}`, undefined, { defaultValue: [] }));
45
45
  }
46
46
  }
47
47
  /**
@@ -50,6 +50,6 @@ export class AddressApi extends BaseApi {
50
50
  * @returns Result
51
51
  */
52
52
  states(regionId) {
53
- return this.app.api.get(`Address/StateList?regionId=${regionId}&language=${this.app.culture}`, undefined, { defaultValue: [] });
53
+ return this.api.get(`Address/StateList?regionId=${regionId}&language=${this.app.culture}`, undefined, { defaultValue: [] });
54
54
  }
55
55
  }
@@ -2,11 +2,13 @@ import { IApp } from '../app/IApp';
2
2
  /**
3
3
  * SmartERP base API
4
4
  */
5
- export declare class BaseApi {
6
- protected app: IApp;
5
+ export declare class BaseApi<T extends IApp = IApp> {
6
+ protected app: T;
7
+ protected api: import("@etsoo/restclient").IApi<any>;
7
8
  /**
8
9
  * Constructor
9
10
  * @param app Application
11
+ * @param api API
10
12
  */
11
- constructor(app: IApp);
13
+ constructor(app: T, api?: import("@etsoo/restclient").IApi<any>);
12
14
  }
@@ -5,8 +5,10 @@ export class BaseApi {
5
5
  /**
6
6
  * Constructor
7
7
  * @param app Application
8
+ * @param api API
8
9
  */
9
- constructor(app) {
10
+ constructor(app, api = app.api) {
10
11
  this.app = app;
12
+ this.api = api;
11
13
  }
12
14
  }
@@ -0,0 +1,78 @@
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
+ * Entity API
10
+ * Follow com.etsoo.CoreFramework.Services.EntityServiceBase
11
+ */
12
+ export declare class EntityApi<T extends IApp = IApp> extends BaseApi<T> {
13
+ protected flag: string;
14
+ /**
15
+ * Constructor
16
+ * @param flag Identity flag, like 'Product' for product APIs
17
+ * @param app Application
18
+ */
19
+ constructor(flag: string, app: T, api?: IApi);
20
+ /**
21
+ * Create
22
+ * @param data Modal data
23
+ * @param payload Payload
24
+ * @returns Result
25
+ */
26
+ protected createBase<R extends IActionResult>(data: object, payload?: IApiPayload<R, any>): Promise<R | undefined>;
27
+ /**
28
+ * Delete
29
+ * @param id Id or ids
30
+ * @param payload Payload
31
+ */
32
+ protected deleteBase<R extends IActionResult>(id: DataTypes.IdType, payload?: IApiPayload<R, any>): R;
33
+ protected deleteBase<R extends IActionResult>(ids: DataTypes.IdType[], payload?: IApiPayload<R, any>): R;
34
+ /**
35
+ * List
36
+ * @param rq Request data
37
+ * @param payload Payload
38
+ * @returns Result
39
+ */
40
+ protected listBase<RQ extends TiplistRQ, R extends object>(rq: RQ, payload?: IApiPayload<R[], any>): Promise<R[] | undefined>;
41
+ /**
42
+ * Query
43
+ * @param rq Request data
44
+ * @param payload Payload
45
+ * @returns Result
46
+ */
47
+ protected queryBase<RQ extends QueryRQ, R extends object>(rq: RQ, payload?: IApiPayload<R[], any>): Promise<R[] | undefined>;
48
+ /**
49
+ * Read
50
+ * @param id Id
51
+ * @param payload Payload
52
+ * @returns Result
53
+ */
54
+ protected readBase<R extends object>(id: DataTypes.IdType, payload?: IApiPayload<R, any>): Promise<R | undefined>;
55
+ /**
56
+ * Sort
57
+ * @param items Items to sort
58
+ * @param payload Payload
59
+ * @returns Result
60
+ */
61
+ protected sortBase<RQ extends {
62
+ id: DataTypes.IdType;
63
+ }>(items: RQ[], payload?: IApiPayload<number, any>): Promise<number | undefined>;
64
+ /**
65
+ * Update
66
+ * @param data Modal data
67
+ * @param payload Payload
68
+ * @returns Result
69
+ */
70
+ protected updateBase<R extends IActionResult>(data: object, payload?: IApiPayload<R, any>): Promise<R | undefined>;
71
+ /**
72
+ * Read for update
73
+ * @param id Id
74
+ * @param payload Payload
75
+ * @returns Result
76
+ */
77
+ protected updateReadBase<R extends object>(id: DataTypes.IdType, payload?: IApiPayload<R, any>): Promise<R | undefined>;
78
+ }
@@ -0,0 +1,87 @@
1
+ import { BaseApi } from './BaseApi';
2
+ /**
3
+ * Entity API
4
+ * Follow com.etsoo.CoreFramework.Services.EntityServiceBase
5
+ */
6
+ export class EntityApi extends BaseApi {
7
+ /**
8
+ * Constructor
9
+ * @param flag Identity flag, like 'Product' for product APIs
10
+ * @param app Application
11
+ */
12
+ constructor(flag, app, api) {
13
+ super(app, api);
14
+ this.flag = flag;
15
+ }
16
+ /**
17
+ * Create
18
+ * @param data Modal data
19
+ * @param payload Payload
20
+ * @returns Result
21
+ */
22
+ createBase(data, payload) {
23
+ return this.api.put(`${this.flag}/Create`, data, payload);
24
+ }
25
+ deleteBase(id, payload) {
26
+ const query = Array.isArray(id)
27
+ ? '?' + id.map((item) => `ids=${item}`).join('&')
28
+ : id;
29
+ return this.api.delete(`${this.flag}/Delete/${query}`, undefined, payload);
30
+ }
31
+ /**
32
+ * List
33
+ * @param rq Request data
34
+ * @param payload Payload
35
+ * @returns Result
36
+ */
37
+ listBase(rq, payload) {
38
+ return this.api.post(`${this.flag}/List`, rq, payload);
39
+ }
40
+ /**
41
+ * Query
42
+ * @param rq Request data
43
+ * @param payload Payload
44
+ * @returns Result
45
+ */
46
+ queryBase(rq, payload) {
47
+ return this.api.post(`${this.flag}/Query`, rq, payload);
48
+ }
49
+ /**
50
+ * Read
51
+ * @param id Id
52
+ * @param payload Payload
53
+ * @returns Result
54
+ */
55
+ readBase(id, payload) {
56
+ return this.api.get(`${this.flag}/Read/${id}`, payload);
57
+ }
58
+ /**
59
+ * Sort
60
+ * @param items Items to sort
61
+ * @param payload Payload
62
+ * @returns Result
63
+ */
64
+ sortBase(items, payload) {
65
+ const rq = {};
66
+ items.forEach((item, index) => (rq[item.id] = index));
67
+ return this.api.put(`${this.flag}/Sort`, rq, payload);
68
+ }
69
+ /**
70
+ * Update
71
+ * @param data Modal data
72
+ * @param payload Payload
73
+ * @returns Result
74
+ */
75
+ updateBase(data, payload) {
76
+ return this.api.put(`${this.flag}/Update`, data, payload);
77
+ }
78
+ /**
79
+ * Read for update
80
+ * @param id Id
81
+ * @param payload Payload
82
+ * @returns Result
83
+ */
84
+ updateReadBase(id, payload) {
85
+ return this.api.get(`${this.flag}/UpdateRead/${id}`, payload);
86
+ }
87
+ }
@@ -1,20 +1,47 @@
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
  * Organization API
5
12
  */
6
- export declare class OrgApi extends BaseApi {
13
+ export declare class OrgApi extends EntityApi {
14
+ /**
15
+ * Constructor
16
+ * @param app Application
17
+ */
18
+ constructor(app: IApp);
7
19
  /**
8
20
  * Get organization list
9
- * @param items Max items
21
+ * @param items Max items or request data
10
22
  * @param serviceId Service id
11
23
  * @returns Result
12
24
  */
13
25
  list(items?: number, serviceId?: number): Promise<ListType[] | undefined>;
26
+ list(rq: OrgListRQ): Promise<ListType[] | undefined>;
27
+ /**
28
+ * Query
29
+ * @param rq Request data
30
+ * @param payload Payload
31
+ * @returns Result
32
+ */
33
+ query(rq: OrgQueryRQ, payload?: IApiPayload<OrgQueryDto[], any>): Promise<OrgQueryDto[] | undefined>;
14
34
  /**
15
35
  * Switch organization
16
36
  * @param id Organization id
17
37
  * @param serviceId Service id
18
38
  */
19
- switch(id: number, serviceId?: number): Promise<boolean | undefined>;
39
+ switch(id: number, serviceId?: number, payload?: IApiPayload<boolean, any>): Promise<boolean | undefined>;
40
+ /**
41
+ * Update
42
+ * @param data Modal data
43
+ * @param payload Payload
44
+ * @returns Result
45
+ */
46
+ update(data: DataTypes.AddOrEditType<OrgRQ, true>, payload?: IApiPayload<IdActionResult, any>): Promise<IdActionResult<number> | undefined>;
20
47
  }
@@ -1,33 +1,51 @@
1
- import { BaseApi } from './BaseApi';
1
+ import { EntityApi } from './EntityApi';
2
2
  /**
3
3
  * Organization API
4
4
  */
5
- export class OrgApi extends BaseApi {
5
+ export class OrgApi extends EntityApi {
6
6
  /**
7
- * Get organization list
8
- * @param items Max items
9
- * @param serviceId Service id
7
+ * Constructor
8
+ * @param app Application
9
+ */
10
+ constructor(app) {
11
+ super('Organization', app);
12
+ }
13
+ list(items, serviceId, payload) {
14
+ payload !== null && payload !== void 0 ? payload : (payload = { defaultValue: [], showLoading: false });
15
+ const rq = typeof items === 'object' ? items : { items, serviceId };
16
+ return this.listBase(rq, payload);
17
+ }
18
+ /**
19
+ * Query
20
+ * @param rq Request data
21
+ * @param payload Payload
10
22
  * @returns Result
11
23
  */
12
- list(items, serviceId) {
13
- return this.app.api.post('Organization/List', {
14
- items,
15
- serviceId
16
- }, { defaultValue: [], showLoading: false });
24
+ query(rq, payload) {
25
+ return this.queryBase(rq, payload);
17
26
  }
18
27
  /**
19
28
  * Switch organization
20
29
  * @param id Organization id
21
30
  * @param serviceId Service id
22
31
  */
23
- async switch(id, serviceId) {
32
+ async switch(id, serviceId, payload) {
24
33
  const result = await this.app.api.put('Organization/Switch', {
25
34
  id,
26
35
  serviceId,
27
36
  deviceId: this.app.deviceId
28
- });
37
+ }, payload);
29
38
  if (result)
30
39
  return await this.app.refreshToken();
31
40
  return result;
32
41
  }
42
+ /**
43
+ * Update
44
+ * @param data Modal data
45
+ * @param payload Payload
46
+ * @returns Result
47
+ */
48
+ update(data, payload) {
49
+ return super.updateBase(data, payload);
50
+ }
33
51
  }
@@ -13,7 +13,7 @@ export class PublicApi extends BaseApi {
13
13
  */
14
14
  async currencies(currencyNames) {
15
15
  if (currencyNames == null)
16
- return (await this.app.api.get('Public/GetCurrencies'));
16
+ return (await this.api.get('Public/GetCurrencies'));
17
17
  else
18
18
  return currencyNames.map((name) => {
19
19
  var _a;
@@ -29,7 +29,7 @@ export class PublicApi extends BaseApi {
29
29
  * @returns Result
30
30
  */
31
31
  exchangeRate(currency) {
32
- return this.app.api.get(`Public/ExchangeRate/${currency}`);
32
+ return this.api.get(`Public/ExchangeRate/${currency}`);
33
33
  }
34
34
  /**
35
35
  * Get exchange rate history
@@ -38,7 +38,7 @@ export class PublicApi extends BaseApi {
38
38
  * @returns Result
39
39
  */
40
40
  exchangeRateHistory(currencies, months) {
41
- return this.app.api.post('Public/ExchangeRateHistory', { currencies, months }, { defaultValue: [] });
41
+ return this.api.post('Public/ExchangeRateHistory', { currencies, months }, { defaultValue: [] });
42
42
  }
43
43
  /**
44
44
  * Get product unit's label
@@ -71,7 +71,7 @@ export class PublicApi extends BaseApi {
71
71
  * @param host Host URL
72
72
  */
73
73
  mobileQRCode(id, host) {
74
- return this.app.api.post('Public/MobileQRCode', { id, host });
74
+ return this.api.post('Public/MobileQRCode', { id, host });
75
75
  }
76
76
  /**
77
77
  * Get public and valid product data
@@ -81,7 +81,7 @@ export class PublicApi extends BaseApi {
81
81
  */
82
82
  product(id, culture) {
83
83
  culture = this.app.checkLanguage(culture);
84
- return this.app.api.post(`Public/Product/${id}/${culture}`);
84
+ return this.api.post(`Public/Product/${id}/${culture}`);
85
85
  }
86
86
  /**
87
87
  *
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Organization query data
3
+ */
4
+ export declare type OrgQueryDto = {
5
+ /**
6
+ * Id
7
+ */
8
+ id: number;
9
+ /**
10
+ * Brand, like ETSOO
11
+ */
12
+ brand?: string;
13
+ /**
14
+ * Name, like ETSOO NZ LIMITED
15
+ */
16
+ name: string;
17
+ /**
18
+ * Creation
19
+ */
20
+ creation: string | Date;
21
+ };
@@ -0,0 +1,10 @@
1
+ import { TiplistRQ } from './TiplistRQ';
2
+ /**
3
+ * Organization list request data
4
+ */
5
+ export declare type OrgListRQ = TiplistRQ & {
6
+ /**
7
+ * Service id
8
+ */
9
+ serviceId?: number;
10
+ };
File without changes
@@ -0,0 +1,14 @@
1
+ import { QueryRQ } from './QueryRQ';
2
+ /**
3
+ * Organization query request data
4
+ */
5
+ export declare type OrgQueryRQ = QueryRQ & {
6
+ /**
7
+ * Name
8
+ */
9
+ name?: string;
10
+ /**
11
+ * Parent organization id
12
+ */
13
+ parentId?: number;
14
+ };
File without changes
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Organization add/edit request data
3
+ */
4
+ export declare type OrgRQ = {
5
+ /**
6
+ * Id
7
+ */
8
+ id: number;
9
+ /**
10
+ * Region id
11
+ */
12
+ regionId: string;
13
+ /**
14
+ * Name
15
+ */
16
+ name: string;
17
+ /**
18
+ * Identifier
19
+ */
20
+ identifier: string;
21
+ /**
22
+ * Brand
23
+ */
24
+ brand?: string;
25
+ /**
26
+ * Trade as
27
+ */
28
+ tradeAs?: string;
29
+ };
File without changes
File without changes
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Refresh token request data
3
+ */
4
+ export declare type RefreshTokenRQ = {
5
+ /**
6
+ * Device id
7
+ */
8
+ deviceId: string;
9
+ /**
10
+ * Login password
11
+ */
12
+ pwd?: string;
13
+ /**
14
+ * Service device id
15
+ */
16
+ serviceDeviceId?: string;
17
+ /**
18
+ * Service id
19
+ */
20
+ serviceId?: number;
21
+ /**
22
+ * Service Uid
23
+ */
24
+ serviceUid?: string;
25
+ /**
26
+ * Time zone
27
+ */
28
+ timezone?: string;
29
+ };
@@ -0,0 +1 @@
1
+ export {};
File without changes
@@ -0,0 +1 @@
1
+ export {};
@@ -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": "中國大陸",