@etsoo/appscript 1.5.61 → 1.5.63

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 (271) hide show
  1. package/__tests__/app/CoreApp.ts +9 -276
  2. package/__tests__/app/TestApp.ts +136 -0
  3. package/lib/{mjs/erp → cjs/api}/AuthApi.d.ts +12 -5
  4. package/lib/cjs/{erp → api}/AuthApi.js +8 -0
  5. package/lib/{mjs/erp → cjs/api}/EntityApi.d.ts +1 -10
  6. package/lib/cjs/{erp → api}/EntityApi.js +0 -9
  7. package/lib/cjs/api/dto/AntiforgeryRequestToken.d.ts +21 -0
  8. package/{src/erp/dto/ResultPayload.ts → lib/cjs/api/dto/ResultPayload.d.ts} +9 -4
  9. package/lib/{mjs/erp → cjs/api}/rq/QueryPagingData.d.ts +7 -7
  10. package/lib/{mjs/erp/rq/TiplistRQ.d.ts → cjs/api/rq/QueryRQ.d.ts} +8 -4
  11. package/lib/cjs/api/rq/StatusQueryRQ.d.ts +17 -0
  12. package/lib/cjs/api/rq/UpdateModel.d.ts +18 -0
  13. package/lib/cjs/app/CoreApp.d.ts +10 -3
  14. package/lib/cjs/app/CoreApp.js +13 -5
  15. package/lib/cjs/app/IApp.d.ts +2 -2
  16. package/lib/cjs/business/EntityStatus.d.ts +1 -1
  17. package/lib/cjs/business/EntityStatus.js +1 -1
  18. package/lib/cjs/i18n/en.json +2 -0
  19. package/lib/cjs/i18n/zh-Hans.json +2 -0
  20. package/lib/cjs/i18n/zh-Hant.json +2 -0
  21. package/lib/cjs/index.d.ts +67 -87
  22. package/lib/cjs/index.js +26 -48
  23. package/lib/cjs/state/User.d.ts +20 -0
  24. package/lib/{cjs/erp → mjs/api}/AuthApi.d.ts +12 -5
  25. package/lib/mjs/{erp → api}/AuthApi.js +8 -0
  26. package/lib/{cjs/erp → mjs/api}/EntityApi.d.ts +1 -10
  27. package/lib/mjs/{erp → api}/EntityApi.js +0 -9
  28. package/lib/mjs/api/dto/AntiforgeryRequestToken.d.ts +21 -0
  29. package/lib/{cjs/erp → mjs/api}/dto/ResultPayload.d.ts +9 -1
  30. package/lib/{cjs/erp → mjs/api}/rq/QueryPagingData.d.ts +7 -7
  31. package/lib/{cjs/erp/rq/TiplistRQ.d.ts → mjs/api/rq/QueryRQ.d.ts} +8 -4
  32. package/lib/mjs/api/rq/StatusQueryRQ.d.ts +17 -0
  33. package/lib/mjs/api/rq/UpdateModel.d.ts +18 -0
  34. package/lib/mjs/app/CoreApp.d.ts +10 -3
  35. package/lib/mjs/app/CoreApp.js +13 -5
  36. package/lib/mjs/app/IApp.d.ts +2 -2
  37. package/lib/mjs/business/EntityStatus.d.ts +1 -1
  38. package/lib/mjs/business/EntityStatus.js +1 -1
  39. package/lib/mjs/i18n/en.json +2 -0
  40. package/lib/mjs/i18n/zh-Hans.json +2 -0
  41. package/lib/mjs/i18n/zh-Hant.json +2 -0
  42. package/lib/mjs/index.d.ts +67 -87
  43. package/lib/mjs/index.js +67 -89
  44. package/lib/mjs/state/User.d.ts +20 -0
  45. package/package.json +72 -69
  46. package/src/{erp → api}/AuthApi.ts +16 -6
  47. package/src/{erp → api}/EntityApi.ts +1 -17
  48. package/src/api/dto/AntiforgeryRequestToken.ts +23 -0
  49. package/{lib/mjs/erp/dto/ResultPayload.d.ts → src/api/dto/ResultPayload.ts} +19 -1
  50. package/src/{erp → api}/rq/QueryPagingData.ts +7 -7
  51. package/src/{erp/rq/TiplistRQ.ts → api/rq/QueryRQ.ts} +9 -4
  52. package/src/api/rq/StatusQueryRQ.ts +19 -0
  53. package/src/api/rq/UpdateModel.ts +20 -0
  54. package/src/app/CoreApp.ts +17 -8
  55. package/src/app/IApp.ts +2 -2
  56. package/src/business/EntityStatus.ts +1 -1
  57. package/src/i18n/en.json +2 -0
  58. package/src/i18n/zh-Hans.json +2 -0
  59. package/src/i18n/zh-Hant.json +2 -0
  60. package/src/index.ts +77 -99
  61. package/src/state/User.ts +24 -0
  62. package/.eslintignore +0 -3
  63. package/.eslintrc.json +0 -29
  64. package/.prettierignore +0 -5
  65. package/.prettierrc +0 -6
  66. package/lib/cjs/erp/AddressApi.d.ts +0 -127
  67. package/lib/cjs/erp/AddressApi.js +0 -230
  68. package/lib/cjs/erp/MemberApi.d.ts +0 -22
  69. package/lib/cjs/erp/MemberApi.js +0 -26
  70. package/lib/cjs/erp/OrgApi.d.ts +0 -74
  71. package/lib/cjs/erp/OrgApi.js +0 -94
  72. package/lib/cjs/erp/PublicApi.d.ts +0 -127
  73. package/lib/cjs/erp/PublicApi.js +0 -212
  74. package/lib/cjs/erp/dto/AuditLineDto.d.ts +0 -24
  75. package/lib/cjs/erp/dto/CurrencyDto.d.ts +0 -6
  76. package/lib/cjs/erp/dto/ExchangeRateDto.d.ts +0 -13
  77. package/lib/cjs/erp/dto/ExchangeRateHistoryDto.d.ts +0 -8
  78. package/lib/cjs/erp/dto/ExchangeRateHistoryDto.js +0 -2
  79. package/lib/cjs/erp/dto/OrgDto.d.ts +0 -33
  80. package/lib/cjs/erp/dto/OrgDto.js +0 -2
  81. package/lib/cjs/erp/dto/OrgQueryDto.d.ts +0 -21
  82. package/lib/cjs/erp/dto/OrgQueryDto.js +0 -2
  83. package/lib/cjs/erp/dto/OrgViewDto.d.ts +0 -63
  84. package/lib/cjs/erp/dto/OrgViewDto.js +0 -2
  85. package/lib/cjs/erp/dto/PinDto.d.ts +0 -61
  86. package/lib/cjs/erp/dto/PinDto.js +0 -2
  87. package/lib/cjs/erp/dto/PlaceParsedDto.d.ts +0 -50
  88. package/lib/cjs/erp/dto/PlaceParsedDto.js +0 -2
  89. package/lib/cjs/erp/dto/ResponseActionMessageDto.d.ts +0 -14
  90. package/lib/cjs/erp/dto/ResponseActionMessageDto.js +0 -2
  91. package/lib/cjs/erp/rq/MemberListRQ.d.ts +0 -5
  92. package/lib/cjs/erp/rq/MemberListRQ.js +0 -2
  93. package/lib/cjs/erp/rq/OrgListRQ.d.ts +0 -10
  94. package/lib/cjs/erp/rq/OrgListRQ.js +0 -2
  95. package/lib/cjs/erp/rq/OrgQueryRQ.d.ts +0 -14
  96. package/lib/cjs/erp/rq/OrgQueryRQ.js +0 -2
  97. package/lib/cjs/erp/rq/ParsePinRQ.d.ts +0 -14
  98. package/lib/cjs/erp/rq/ParsePinRQ.js +0 -2
  99. package/lib/cjs/erp/rq/PlaceParseRQ.d.ts +0 -25
  100. package/lib/cjs/erp/rq/PlaceParseRQ.js +0 -2
  101. package/lib/cjs/erp/rq/PlaceQueryRQ.d.ts +0 -58
  102. package/lib/cjs/erp/rq/PlaceQueryRQ.js +0 -21
  103. package/lib/cjs/erp/rq/QueryRQ.d.ts +0 -16
  104. package/lib/cjs/erp/rq/RegionsRQ.d.ts +0 -22
  105. package/lib/cjs/erp/rq/RegionsRQ.js +0 -2
  106. package/lib/cjs/erp/rq/SendActionMessageRQ.d.ts +0 -26
  107. package/lib/cjs/erp/rq/SendActionMessageRQ.js +0 -2
  108. package/lib/cjs/erp/rq/TiplistRQ.js +0 -2
  109. package/lib/mjs/erp/AddressApi.d.ts +0 -127
  110. package/lib/mjs/erp/AddressApi.js +0 -226
  111. package/lib/mjs/erp/MemberApi.d.ts +0 -22
  112. package/lib/mjs/erp/MemberApi.js +0 -22
  113. package/lib/mjs/erp/OrgApi.d.ts +0 -74
  114. package/lib/mjs/erp/OrgApi.js +0 -90
  115. package/lib/mjs/erp/PublicApi.d.ts +0 -127
  116. package/lib/mjs/erp/PublicApi.js +0 -208
  117. package/lib/mjs/erp/dto/AuditLineDto.d.ts +0 -24
  118. package/lib/mjs/erp/dto/CurrencyDto.d.ts +0 -6
  119. package/lib/mjs/erp/dto/ExchangeRateDto.d.ts +0 -13
  120. package/lib/mjs/erp/dto/ExchangeRateHistoryDto.d.ts +0 -8
  121. package/lib/mjs/erp/dto/ExchangeRateHistoryDto.js +0 -1
  122. package/lib/mjs/erp/dto/OrgDto.d.ts +0 -33
  123. package/lib/mjs/erp/dto/OrgDto.js +0 -1
  124. package/lib/mjs/erp/dto/OrgQueryDto.d.ts +0 -21
  125. package/lib/mjs/erp/dto/OrgQueryDto.js +0 -1
  126. package/lib/mjs/erp/dto/OrgViewDto.d.ts +0 -63
  127. package/lib/mjs/erp/dto/OrgViewDto.js +0 -1
  128. package/lib/mjs/erp/dto/PinDto.d.ts +0 -61
  129. package/lib/mjs/erp/dto/PinDto.js +0 -1
  130. package/lib/mjs/erp/dto/PlaceParsedDto.d.ts +0 -50
  131. package/lib/mjs/erp/dto/PlaceParsedDto.js +0 -1
  132. package/lib/mjs/erp/dto/ResponseActionMessageDto.d.ts +0 -14
  133. package/lib/mjs/erp/dto/ResponseActionMessageDto.js +0 -1
  134. package/lib/mjs/erp/rq/MemberListRQ.d.ts +0 -5
  135. package/lib/mjs/erp/rq/MemberListRQ.js +0 -1
  136. package/lib/mjs/erp/rq/OrgListRQ.d.ts +0 -10
  137. package/lib/mjs/erp/rq/OrgListRQ.js +0 -1
  138. package/lib/mjs/erp/rq/OrgQueryRQ.d.ts +0 -14
  139. package/lib/mjs/erp/rq/OrgQueryRQ.js +0 -1
  140. package/lib/mjs/erp/rq/ParsePinRQ.d.ts +0 -14
  141. package/lib/mjs/erp/rq/ParsePinRQ.js +0 -1
  142. package/lib/mjs/erp/rq/PlaceParseRQ.d.ts +0 -25
  143. package/lib/mjs/erp/rq/PlaceParseRQ.js +0 -1
  144. package/lib/mjs/erp/rq/PlaceQueryRQ.d.ts +0 -58
  145. package/lib/mjs/erp/rq/PlaceQueryRQ.js +0 -18
  146. package/lib/mjs/erp/rq/QueryRQ.d.ts +0 -16
  147. package/lib/mjs/erp/rq/RegionsRQ.d.ts +0 -22
  148. package/lib/mjs/erp/rq/RegionsRQ.js +0 -1
  149. package/lib/mjs/erp/rq/SendActionMessageRQ.d.ts +0 -26
  150. package/lib/mjs/erp/rq/SendActionMessageRQ.js +0 -1
  151. package/lib/mjs/erp/rq/TiplistRQ.js +0 -1
  152. package/src/erp/AddressApi.ts +0 -310
  153. package/src/erp/MemberApi.ts +0 -28
  154. package/src/erp/OrgApi.ts +0 -136
  155. package/src/erp/PublicApi.ts +0 -282
  156. package/src/erp/dto/AuditLineDto.ts +0 -27
  157. package/src/erp/dto/CurrencyDto.ts +0 -7
  158. package/src/erp/dto/ExchangeRateDto.ts +0 -14
  159. package/src/erp/dto/ExchangeRateHistoryDto.ts +0 -9
  160. package/src/erp/dto/OrgDto.ts +0 -39
  161. package/src/erp/dto/OrgQueryDto.ts +0 -24
  162. package/src/erp/dto/OrgViewDto.ts +0 -78
  163. package/src/erp/dto/PinDto.ts +0 -71
  164. package/src/erp/dto/PlaceParsedDto.ts +0 -58
  165. package/src/erp/dto/ResponseActionMessageDto.ts +0 -16
  166. package/src/erp/rq/MemberListRQ.ts +0 -6
  167. package/src/erp/rq/OrgListRQ.ts +0 -11
  168. package/src/erp/rq/OrgQueryRQ.ts +0 -16
  169. package/src/erp/rq/ParsePinRQ.ts +0 -15
  170. package/src/erp/rq/PlaceParseRQ.ts +0 -28
  171. package/src/erp/rq/PlaceQueryRQ.ts +0 -67
  172. package/src/erp/rq/QueryRQ.ts +0 -18
  173. package/src/erp/rq/RegionsRQ.ts +0 -26
  174. package/src/erp/rq/SendActionMessageRQ.ts +0 -29
  175. package/lib/cjs/{erp → api}/BaseApi.d.ts +0 -0
  176. package/lib/cjs/{erp → api}/BaseApi.js +0 -0
  177. package/lib/cjs/{erp/dto/ApiRefreshTokenDto.js → api/dto/AntiforgeryRequestToken.js} +0 -0
  178. package/lib/cjs/{erp → api}/dto/ApiRefreshTokenDto.d.ts +0 -0
  179. package/lib/cjs/{erp/dto/AuditLineDto.js → api/dto/ApiRefreshTokenDto.js} +0 -0
  180. package/lib/cjs/{erp → api}/dto/IdLabelDto.d.ts +0 -0
  181. package/lib/cjs/{erp → api}/dto/IdLabelDto.js +0 -0
  182. package/lib/cjs/{erp → api}/dto/IdLabelPrimaryDto.d.ts +0 -0
  183. package/lib/cjs/{erp → api}/dto/IdLabelPrimaryDto.js +0 -0
  184. package/lib/cjs/{erp → api}/dto/InitCallDto.d.ts +0 -0
  185. package/lib/cjs/{erp → api}/dto/InitCallDto.js +0 -0
  186. package/lib/cjs/{erp → api}/dto/ResultPayload.js +0 -0
  187. package/lib/cjs/{erp → api}/rq/ApiRefreshTokenRQ.d.ts +0 -0
  188. package/lib/cjs/{erp → api}/rq/ApiRefreshTokenRQ.js +0 -0
  189. package/lib/cjs/{erp → api}/rq/AuthRequest.d.ts +0 -0
  190. package/lib/cjs/{erp → api}/rq/AuthRequest.js +0 -0
  191. package/lib/cjs/{erp → api}/rq/GetLogInUrlRQ.d.ts +0 -0
  192. package/lib/cjs/{erp → api}/rq/GetLogInUrlRQ.js +0 -0
  193. package/lib/cjs/{erp → api}/rq/LoginIdRQ.d.ts +0 -0
  194. package/lib/cjs/{erp → api}/rq/LoginIdRQ.js +0 -0
  195. package/lib/cjs/{erp → api}/rq/LoginRQ.d.ts +1 -1
  196. package/lib/cjs/{erp → api}/rq/LoginRQ.js +0 -0
  197. package/lib/cjs/{erp → api}/rq/MergeRQ.d.ts +0 -0
  198. package/lib/cjs/{erp → api}/rq/MergeRQ.js +0 -0
  199. package/lib/cjs/{erp → api}/rq/QueryPagingData.js +0 -0
  200. package/lib/cjs/{erp → api}/rq/QueryRQ.js +0 -0
  201. package/lib/cjs/{erp → api}/rq/RefreshTokenRQ.d.ts +0 -0
  202. package/lib/cjs/{erp → api}/rq/RefreshTokenRQ.js +0 -0
  203. package/lib/cjs/{erp → api}/rq/ResetPasswordRQ.d.ts +0 -0
  204. package/lib/cjs/{erp → api}/rq/ResetPasswordRQ.js +0 -0
  205. package/lib/cjs/{erp → api}/rq/SignoutRQ.d.ts +0 -0
  206. package/lib/cjs/{erp → api}/rq/SignoutRQ.js +0 -0
  207. package/lib/cjs/{erp/dto/CurrencyDto.js → api/rq/StatusQueryRQ.js} +0 -0
  208. package/lib/cjs/{erp → api}/rq/SwitchOrgRQ.d.ts +0 -0
  209. package/lib/cjs/{erp → api}/rq/SwitchOrgRQ.js +0 -0
  210. package/lib/cjs/{erp → api}/rq/TokenRQ.d.ts +0 -0
  211. package/lib/cjs/{erp → api}/rq/TokenRQ.js +0 -0
  212. package/lib/cjs/{erp/dto/ExchangeRateDto.js → api/rq/UpdateModel.js} +0 -0
  213. package/lib/cjs/{erp → api}/rq/UpdateStatusRQ.d.ts +0 -0
  214. package/lib/cjs/{erp → api}/rq/UpdateStatusRQ.js +0 -0
  215. package/lib/mjs/{erp → api}/BaseApi.d.ts +0 -0
  216. package/lib/mjs/{erp → api}/BaseApi.js +0 -0
  217. package/lib/mjs/{erp/dto/ApiRefreshTokenDto.js → api/dto/AntiforgeryRequestToken.js} +0 -0
  218. package/lib/mjs/{erp → api}/dto/ApiRefreshTokenDto.d.ts +0 -0
  219. package/lib/mjs/{erp/dto/AuditLineDto.js → api/dto/ApiRefreshTokenDto.js} +0 -0
  220. package/lib/mjs/{erp → api}/dto/IdLabelDto.d.ts +0 -0
  221. package/lib/mjs/{erp → api}/dto/IdLabelDto.js +0 -0
  222. package/lib/mjs/{erp → api}/dto/IdLabelPrimaryDto.d.ts +0 -0
  223. package/lib/mjs/{erp → api}/dto/IdLabelPrimaryDto.js +0 -0
  224. package/lib/mjs/{erp → api}/dto/InitCallDto.d.ts +0 -0
  225. package/lib/mjs/{erp → api}/dto/InitCallDto.js +0 -0
  226. package/lib/mjs/{erp → api}/dto/ResultPayload.js +0 -0
  227. package/lib/mjs/{erp → api}/rq/ApiRefreshTokenRQ.d.ts +0 -0
  228. package/lib/mjs/{erp → api}/rq/ApiRefreshTokenRQ.js +0 -0
  229. package/lib/mjs/{erp → api}/rq/AuthRequest.d.ts +0 -0
  230. package/lib/mjs/{erp → api}/rq/AuthRequest.js +0 -0
  231. package/lib/mjs/{erp → api}/rq/GetLogInUrlRQ.d.ts +0 -0
  232. package/lib/mjs/{erp → api}/rq/GetLogInUrlRQ.js +0 -0
  233. package/lib/mjs/{erp → api}/rq/LoginIdRQ.d.ts +0 -0
  234. package/lib/mjs/{erp → api}/rq/LoginIdRQ.js +0 -0
  235. package/lib/mjs/{erp → api}/rq/LoginRQ.d.ts +1 -1
  236. package/lib/mjs/{erp → api}/rq/LoginRQ.js +0 -0
  237. package/lib/mjs/{erp → api}/rq/MergeRQ.d.ts +0 -0
  238. package/lib/mjs/{erp → api}/rq/MergeRQ.js +0 -0
  239. package/lib/mjs/{erp → api}/rq/QueryPagingData.js +0 -0
  240. package/lib/mjs/{erp → api}/rq/QueryRQ.js +0 -0
  241. package/lib/mjs/{erp → api}/rq/RefreshTokenRQ.d.ts +0 -0
  242. package/lib/mjs/{erp → api}/rq/RefreshTokenRQ.js +0 -0
  243. package/lib/mjs/{erp → api}/rq/ResetPasswordRQ.d.ts +0 -0
  244. package/lib/mjs/{erp → api}/rq/ResetPasswordRQ.js +0 -0
  245. package/lib/mjs/{erp → api}/rq/SignoutRQ.d.ts +0 -0
  246. package/lib/mjs/{erp → api}/rq/SignoutRQ.js +0 -0
  247. package/lib/mjs/{erp/dto/CurrencyDto.js → api/rq/StatusQueryRQ.js} +0 -0
  248. package/lib/mjs/{erp → api}/rq/SwitchOrgRQ.d.ts +0 -0
  249. package/lib/mjs/{erp → api}/rq/SwitchOrgRQ.js +0 -0
  250. package/lib/mjs/{erp → api}/rq/TokenRQ.d.ts +0 -0
  251. package/lib/mjs/{erp → api}/rq/TokenRQ.js +0 -0
  252. package/lib/mjs/{erp/dto/ExchangeRateDto.js → api/rq/UpdateModel.js} +0 -0
  253. package/lib/mjs/{erp → api}/rq/UpdateStatusRQ.d.ts +0 -0
  254. package/lib/mjs/{erp → api}/rq/UpdateStatusRQ.js +0 -0
  255. package/src/{erp → api}/BaseApi.ts +0 -0
  256. package/src/{erp → api}/dto/ApiRefreshTokenDto.ts +0 -0
  257. package/src/{erp → api}/dto/IdLabelDto.ts +0 -0
  258. package/src/{erp → api}/dto/IdLabelPrimaryDto.ts +0 -0
  259. package/src/{erp → api}/dto/InitCallDto.ts +0 -0
  260. package/src/{erp → api}/rq/ApiRefreshTokenRQ.ts +0 -0
  261. package/src/{erp → api}/rq/AuthRequest.ts +0 -0
  262. package/src/{erp → api}/rq/GetLogInUrlRQ.ts +0 -0
  263. package/src/{erp → api}/rq/LoginIdRQ.ts +0 -0
  264. package/src/{erp → api}/rq/LoginRQ.ts +1 -1
  265. /package/src/{erp → api}/rq/MergeRQ.ts +0 -0
  266. /package/src/{erp → api}/rq/RefreshTokenRQ.ts +0 -0
  267. /package/src/{erp → api}/rq/ResetPasswordRQ.ts +0 -0
  268. /package/src/{erp → api}/rq/SignoutRQ.ts +0 -0
  269. /package/src/{erp → api}/rq/SwitchOrgRQ.ts +0 -0
  270. /package/src/{erp → api}/rq/TokenRQ.ts +0 -0
  271. /package/src/{erp → api}/rq/UpdateStatusRQ.ts +0 -0
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MemberApi = void 0;
4
- const EntityApi_1 = require("./EntityApi");
5
- /**
6
- * Member API
7
- */
8
- class MemberApi extends EntityApi_1.EntityApi {
9
- /**
10
- * Constructor
11
- * @param app Application
12
- */
13
- constructor(app) {
14
- super('Member', app);
15
- }
16
- /**
17
- * List
18
- * @param rq Request data
19
- * @param payload Payload
20
- * @returns Result
21
- */
22
- list(rq, payload) {
23
- return this.listBase(rq, payload);
24
- }
25
- }
26
- exports.MemberApi = MemberApi;
@@ -1,74 +0,0 @@
1
- import { IApiPayload } from '@etsoo/restclient';
2
- import { DataTypes, ListType } from '@etsoo/shared';
3
- import { IApp } from '../app/IApp';
4
- import { OrgDto } from './dto/OrgDto';
5
- import { OrgQueryDto } from './dto/OrgQueryDto';
6
- import { OrgViewDto } from './dto/OrgViewDto';
7
- import { IdResultPayload, StringIdResultPayload } from './dto/ResultPayload';
8
- import { EntityApi } from './EntityApi';
9
- import { OrgListRQ } from './rq/OrgListRQ';
10
- import { OrgQueryRQ } from './rq/OrgQueryRQ';
11
- import { SendActionMessageRQ } from './rq/SendActionMessageRQ';
12
- import { ApiService } from '../business/ApiService';
13
- /**
14
- * Organization API
15
- */
16
- export declare class OrgApi extends EntityApi {
17
- /**
18
- * Constructor
19
- * @param app Application
20
- */
21
- constructor(app: IApp);
22
- /**
23
- * Check API service's availability
24
- * @param api API service id
25
- * @param payload Payload
26
- * @returns Result
27
- */
28
- checkApiService(api: ApiService, payload?: StringIdResultPayload): Promise<import("@etsoo/shared").IdActionResult<string> | undefined>;
29
- /**
30
- * Get organization list
31
- * @param items Max items or request data
32
- * @param serviceId Service id
33
- * @param payload Payload
34
- * @returns Result
35
- */
36
- list(items?: number, serviceId?: number): Promise<ListType[] | undefined>;
37
- list(rq: OrgListRQ, payload?: IApiPayload<ListType[]>): Promise<ListType[] | undefined>;
38
- /**
39
- * Query
40
- * @param rq Request data
41
- * @param payload Payload
42
- * @returns Result
43
- */
44
- query(rq: OrgQueryRQ, payload?: IApiPayload<OrgQueryDto[]>): Promise<OrgQueryDto[] | undefined>;
45
- /**
46
- * Read
47
- * @param id Id
48
- * @param payload Payload
49
- * @param reload Reload data
50
- * @returns Result
51
- */
52
- read(id: number, payload?: IApiPayload<OrgViewDto>, reload?: boolean): Promise<OrgViewDto | undefined>;
53
- /**
54
- * Send action message
55
- * @param rq Request data
56
- * @param payload Payload
57
- * @returns Result
58
- */
59
- sendActionMessage(rq: SendActionMessageRQ, payload?: IApiPayload<void>): Promise<void | undefined>;
60
- /**
61
- * Update
62
- * @param data Modal data
63
- * @param payload Payload
64
- * @returns Result
65
- */
66
- update(data: DataTypes.AddOrEditType<OrgDto, true>, payload?: IdResultPayload): Promise<import("@etsoo/shared").IdActionResult | undefined>;
67
- /**
68
- * Read for update
69
- * @param id Id
70
- * @param payload Payload
71
- * @returns Result
72
- */
73
- updateRead(id: number, payload?: IApiPayload<OrgDto>): Promise<OrgDto | undefined>;
74
- }
@@ -1,94 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OrgApi = void 0;
4
- const EntityApi_1 = require("./EntityApi");
5
- const cachedOrgs = {};
6
- /**
7
- * Organization API
8
- */
9
- class OrgApi extends EntityApi_1.EntityApi {
10
- /**
11
- * Constructor
12
- * @param app Application
13
- */
14
- constructor(app) {
15
- super('Organization', app);
16
- }
17
- /**
18
- * Check API service's availability
19
- * @param api API service id
20
- * @param payload Payload
21
- * @returns Result
22
- */
23
- checkApiService(api, payload) {
24
- payload ?? (payload = { showLoading: false });
25
- return this.api.get(`${this.flag}/CheckApiService`, { api }, payload);
26
- }
27
- list(items, serviceId) {
28
- if (typeof items === 'object') {
29
- if (typeof serviceId === 'number')
30
- return undefined;
31
- return this.listBase(items, serviceId);
32
- }
33
- else {
34
- if (typeof serviceId === 'object')
35
- return undefined;
36
- return this.listBase({ queryPaging: items, serviceId }, { defaultValue: [], showLoading: false });
37
- }
38
- }
39
- /**
40
- * Query
41
- * @param rq Request data
42
- * @param payload Payload
43
- * @returns Result
44
- */
45
- query(rq, payload) {
46
- return this.queryBase(rq, payload);
47
- }
48
- /**
49
- * Read
50
- * @param id Id
51
- * @param payload Payload
52
- * @param reload Reload data
53
- * @returns Result
54
- */
55
- async read(id, payload, reload = false) {
56
- let data = cachedOrgs[id];
57
- if (data == null || reload) {
58
- data = await this.readBase(id, payload);
59
- if (data != null)
60
- cachedOrgs[id] = data;
61
- }
62
- return data;
63
- }
64
- /**
65
- * Send action message
66
- * @param rq Request data
67
- * @param payload Payload
68
- * @returns Result
69
- */
70
- sendActionMessage(rq, payload) {
71
- const appId = 'serviceId' in this.app.settings ? this.app.settings.serviceId : 0;
72
- payload ?? (payload = { showLoading: false });
73
- return this.api.post('System/SendActionMessage', { ...rq, appId }, payload);
74
- }
75
- /**
76
- * Update
77
- * @param data Modal data
78
- * @param payload Payload
79
- * @returns Result
80
- */
81
- update(data, payload) {
82
- return super.updateBase(data, payload);
83
- }
84
- /**
85
- * Read for update
86
- * @param id Id
87
- * @param payload Payload
88
- * @returns Result
89
- */
90
- updateRead(id, payload) {
91
- return super.updateReadBase(id, payload);
92
- }
93
- }
94
- exports.OrgApi = OrgApi;
@@ -1,127 +0,0 @@
1
- import { IApiPayload } from '@etsoo/restclient';
2
- import { ListType, ListType1 } from '@etsoo/shared';
3
- import { Currency } from '../business/Currency';
4
- import { ProductUnit } from '../business/ProductUnit';
5
- import { BaseApi } from './BaseApi';
6
- import { CurrencyDto } from './dto/CurrencyDto';
7
- import { ExchangeRateDto } from './dto/ExchangeRateDto';
8
- import { ExchangeRateHistoryDto } from './dto/ExchangeRateHistoryDto';
9
- import { PinDto } from './dto/PinDto';
10
- import { ParsePinRQ } from './rq/ParsePinRQ';
11
- /**
12
- * Public API
13
- */
14
- export declare class PublicApi extends BaseApi {
15
- /**
16
- * Default currency
17
- */
18
- defaultCurrency: string | Currency;
19
- /**
20
- * Asset units
21
- * @returns Result
22
- */
23
- assetUnits(): ListType[];
24
- /**
25
- * Asset string id units
26
- * @returns Result
27
- */
28
- assetStrUnits(): ListType1[];
29
- /**
30
- * Base units
31
- * @returns Result
32
- */
33
- baseUnits(): ListType1[];
34
- /**
35
- * Get currencies
36
- * @param names Limited currency names for local data, undefined will try to retrive remotely
37
- * @returns Result
38
- */
39
- currencies(): Promise<CurrencyDto[] | undefined>;
40
- currencies(names: string[] | Currency[] | boolean): ListType1[];
41
- /**
42
- * Get exchange amount
43
- * @param amount Amount
44
- * @param sourceCurrency Source currency
45
- * @param targetCurrency Target currency
46
- * @returns Result
47
- */
48
- exchangeAmount(amount: number, sourceCurrency: Currency | string, targetCurrency?: Currency | string): Promise<number | undefined>;
49
- /**
50
- * Get exchange rate
51
- * @param currency Currency
52
- * @param payload Payload
53
- * @param reload Reload data
54
- * @returns Result
55
- */
56
- exchangeRate(currency: Currency | string, payload?: IApiPayload<ExchangeRateDto>, reload?: boolean): Promise<ExchangeRateDto | undefined>;
57
- /**
58
- * Get exchange rate history
59
- * @param currencies Currencies
60
- * @param months Max months
61
- * @param payload Payload
62
- * @returns Result
63
- */
64
- exchangeRateHistory(currencies: (Currency | string)[], months?: number, payload?: IApiPayload<ExchangeRateHistoryDto[]>): Promise<ExchangeRateHistoryDto[] | undefined>;
65
- /**
66
- * Get organization's avatar URL
67
- * @param id Organization id
68
- * @returns Result
69
- */
70
- getOrgAvatar(id: number): string;
71
- /**
72
- * Get currency label
73
- * @param currency Currency
74
- * @returns Label
75
- */
76
- getCurrencyLabel(currency: Currency | string): string;
77
- /**
78
- * Get product unit's label
79
- * Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
80
- * @param unit Unit
81
- * @param isJoined Add the join label like 'per Kg' for Kg
82
- * @returns Label
83
- */
84
- getUnitLabel(unit: ProductUnit | number, isJoined?: boolean | string): string;
85
- private getUnitJoin;
86
- /**
87
- * Get mobile base64 QRCode
88
- * @param id User id
89
- * @param host Host URL
90
- * @param payload Payload
91
- */
92
- mobileQRCode(id?: string, host?: string, payload?: IApiPayload<string>): Promise<string | undefined>;
93
- /**
94
- * Parse Pin data
95
- * @param input Request data
96
- * @param payload Payload
97
- * @returns Result
98
- */
99
- parsePin(input: ParsePinRQ | string, payload?: IApiPayload<PinDto>): Promise<PinDto | undefined>;
100
- /**
101
- *
102
- * Get all repeat options
103
- * @param options Define the order and limit the items
104
- * @param isJoined Add the join label like 'per Kg' for Kg
105
- * @returns Units
106
- */
107
- repeatOptions(options?: string[], isJoined?: boolean): ListType[];
108
- /**
109
- * Get all supported cultures
110
- * @param payload Payload
111
- * @returns Result
112
- */
113
- supportedCultures(payload?: IApiPayload<ListType1[]>): Promise<ListType1[] | undefined>;
114
- /**
115
- * Get all product units
116
- * @returns Units
117
- */
118
- units(): ListType[];
119
- /**
120
- *
121
- * Get all product units
122
- * @param options Define the order and limit the items
123
- * @param isJoined Add the join label like 'per Kg' for Kg
124
- * @returns Units
125
- */
126
- units(options?: string[], isJoined?: boolean): ListType[];
127
- }
@@ -1,212 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PublicApi = void 0;
4
- const shared_1 = require("@etsoo/shared");
5
- const Currency_1 = require("../business/Currency");
6
- const ProductUnit_1 = require("../business/ProductUnit");
7
- const RepeatOption_1 = require("../business/RepeatOption");
8
- const BaseApi_1 = require("./BaseApi");
9
- const cachedCurrencyRates = {};
10
- const unitPrefix = 'unit';
11
- /**
12
- * Public API
13
- */
14
- class PublicApi extends BaseApi_1.BaseApi {
15
- constructor() {
16
- super(...arguments);
17
- /**
18
- * Default currency
19
- */
20
- this.defaultCurrency = this.app.defaultRegion.currency;
21
- }
22
- /**
23
- * Asset units
24
- * @returns Result
25
- */
26
- assetUnits() {
27
- return this.app.getEnumList(ProductUnit_1.AssetUnits, unitPrefix);
28
- }
29
- /**
30
- * Asset string id units
31
- * @returns Result
32
- */
33
- assetStrUnits() {
34
- return this.app.getEnumStrList(ProductUnit_1.AssetUnits, unitPrefix);
35
- }
36
- /**
37
- * Base units
38
- * @returns Result
39
- */
40
- baseUnits() {
41
- return this.app.getEnumStrList(ProductUnit_1.ProductUnit, unitPrefix);
42
- }
43
- currencies(names) {
44
- if (typeof names === 'boolean' && names) {
45
- return Currency_1.Currencies.map((name) => ({
46
- id: name,
47
- label: this.app.get(`currency${name}`) ?? name
48
- }));
49
- }
50
- if (Array.isArray(names)) {
51
- return names.map((name) => ({
52
- id: name,
53
- label: this.app.get(`currency${name}`) ?? name
54
- }));
55
- }
56
- return this.api.get('Public/GetCurrencies', undefined, {
57
- defaultValue: [],
58
- showLoading: false
59
- });
60
- }
61
- /**
62
- * Get exchange amount
63
- * @param amount Amount
64
- * @param sourceCurrency Source currency
65
- * @param targetCurrency Target currency
66
- * @returns Result
67
- */
68
- async exchangeAmount(amount, sourceCurrency, targetCurrency) {
69
- targetCurrency ?? (targetCurrency = this.app.defaultRegion.currency);
70
- const [sourceRate, targetRate] = await Promise.all([
71
- this.exchangeRate(sourceCurrency, {
72
- showLoading: false
73
- }),
74
- this.exchangeRate(targetCurrency, {
75
- showLoading: false
76
- })
77
- ]);
78
- if (sourceRate == null || targetRate == null)
79
- return undefined;
80
- const result = Math.round((1000 * amount * sourceRate.exchangeRate) /
81
- targetRate.exchangeRate) / 1000;
82
- return result;
83
- }
84
- /**
85
- * Get exchange rate
86
- * @param currency Currency
87
- * @param payload Payload
88
- * @param reload Reload data
89
- * @returns Result
90
- */
91
- async exchangeRate(currency, payload, reload = false) {
92
- let rate = cachedCurrencyRates[currency];
93
- if (rate == null || reload) {
94
- rate =
95
- currency === this.defaultCurrency
96
- ? { exchangeRate: 100, updateTime: new Date() }
97
- : await this.api.get(`Public/ExchangeRate/${currency}`, undefined, payload);
98
- if (rate == null)
99
- return undefined;
100
- cachedCurrencyRates[currency] = rate;
101
- }
102
- return rate;
103
- }
104
- /**
105
- * Get exchange rate history
106
- * @param currencies Currencies
107
- * @param months Max months
108
- * @param payload Payload
109
- * @returns Result
110
- */
111
- exchangeRateHistory(currencies, months, payload) {
112
- payload ?? (payload = { defaultValue: [] });
113
- return this.api.post('Public/ExchangeRateHistory', { currencies, months }, payload);
114
- }
115
- /**
116
- * Get organization's avatar URL
117
- * @param id Organization id
118
- * @returns Result
119
- */
120
- getOrgAvatar(id) {
121
- return `${this.api.baseUrl}Storage/OrgAvatar/${id}`;
122
- }
123
- /**
124
- * Get currency label
125
- * @param currency Currency
126
- * @returns Label
127
- */
128
- getCurrencyLabel(currency) {
129
- const c = `currency${currency}`;
130
- return this.app.get(c) ?? c;
131
- }
132
- /**
133
- * Get product unit's label
134
- * Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
135
- * @param unit Unit
136
- * @param isJoined Add the join label like 'per Kg' for Kg
137
- * @returns Label
138
- */
139
- getUnitLabel(unit, isJoined) {
140
- const key = ProductUnit_1.ProductUnit[unit];
141
- const label = this.app.get(unitPrefix + key) ?? key;
142
- const join = this.getUnitJoin(isJoined);
143
- if (join) {
144
- return join.format(label);
145
- }
146
- return label;
147
- }
148
- getUnitJoin(isJoined) {
149
- return typeof isJoined === 'string'
150
- ? this.app.get(isJoined) ?? isJoined
151
- : isJoined
152
- ? this.app.get('unitJoin')
153
- : undefined;
154
- }
155
- /**
156
- * Get mobile base64 QRCode
157
- * @param id User id
158
- * @param host Host URL
159
- * @param payload Payload
160
- */
161
- mobileQRCode(id, host, payload) {
162
- return this.api.post('Public/MobileQRCode', { id, host }, payload);
163
- }
164
- /**
165
- * Parse Pin data
166
- * @param input Request data
167
- * @param payload Payload
168
- * @returns Result
169
- */
170
- parsePin(input, payload) {
171
- const rq = typeof input === 'string' ? { pin: input } : input;
172
- rq.language ?? (rq.language = this.app.culture);
173
- return this.api.post('Public/ParsePin', rq, payload);
174
- }
175
- /**
176
- *
177
- * Get all repeat options
178
- * @param options Define the order and limit the items
179
- * @param isJoined Add the join label like 'per Kg' for Kg
180
- * @returns Units
181
- */
182
- repeatOptions(options, isJoined = true) {
183
- options ?? (options = shared_1.DataTypes.getEnumKeys(RepeatOption_1.RepeatOption));
184
- return this.units(options, isJoined);
185
- }
186
- /**
187
- * Get all supported cultures
188
- * @param payload Payload
189
- * @returns Result
190
- */
191
- supportedCultures(payload) {
192
- return this.api.get('Public/SupportedCultures', undefined, payload);
193
- }
194
- /**
195
- *
196
- * Get all product units
197
- * @param options Define the order and limit the items
198
- * @param isJoined Add the join label like 'per Kg' for Kg
199
- * @returns Units
200
- */
201
- units(options, isJoined) {
202
- options ?? (options = shared_1.DataTypes.getEnumKeys(ProductUnit_1.ProductUnit));
203
- return options.map((key) => {
204
- const id = shared_1.DataTypes.getEnumByKey(ProductUnit_1.ProductUnit, key);
205
- return {
206
- id,
207
- label: this.getUnitLabel(id, this.getUnitJoin(isJoined)).formatInitial(true)
208
- };
209
- });
210
- }
211
- }
212
- exports.PublicApi = PublicApi;
@@ -1,24 +0,0 @@
1
- import { IApiPayload } from '@etsoo/restclient';
2
- /**
3
- * Audit line data
4
- */
5
- export 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 type AuditLineChangesDto = {
18
- oldData: Record<string, unknown>;
19
- newData: Record<string, unknown>;
20
- };
21
- /**
22
- * Audit line API payload
23
- */
24
- export type AuditLinePayload = IApiPayload<AuditLineDto[]>;
@@ -1,6 +0,0 @@
1
- import { ListType1 } from '@etsoo/shared';
2
- import { ExchangeRateDto } from './ExchangeRateDto';
3
- /**
4
- * Currency data
5
- */
6
- export type CurrencyDto = ListType1 & ExchangeRateDto;
@@ -1,13 +0,0 @@
1
- /**
2
- * Exchange rate data
3
- */
4
- export type ExchangeRateDto = {
5
- /**
6
- * Exchange rate
7
- */
8
- exchangeRate: number;
9
- /**
10
- * Update time
11
- */
12
- updateTime: string | Date;
13
- };
@@ -1,8 +0,0 @@
1
- import { Currency } from '../../business/Currency';
2
- import { ExchangeRateDto } from './ExchangeRateDto';
3
- /**
4
- * Exchange rate history data
5
- */
6
- export type ExchangeRateHistoryDto = ExchangeRateDto & {
7
- id: Currency;
8
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,33 +0,0 @@
1
- /**
2
- * Organization data
3
- */
4
- export type OrgDto = {
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
- /**
30
- * Parent organization
31
- */
32
- parentId?: number;
33
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,21 +0,0 @@
1
- /**
2
- * Organization query data
3
- */
4
- export 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
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });