@etsoo/appscript 1.5.62 → 1.5.64
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.
- package/README.md +97 -71
- package/__tests__/app/CoreApp.ts +9 -276
- package/__tests__/app/TestApp.ts +136 -0
- package/babel.config.json +8 -8
- package/lib/{mjs/erp → cjs/api}/AuthApi.d.ts +12 -5
- package/lib/cjs/{erp → api}/AuthApi.js +8 -0
- package/lib/{mjs/erp → cjs/api}/EntityApi.d.ts +1 -10
- package/lib/cjs/{erp → api}/EntityApi.js +0 -9
- package/lib/cjs/api/dto/AntiforgeryRequestToken.d.ts +21 -0
- package/lib/{mjs/erp → cjs/api}/dto/AuditLineDto.d.ts +1 -1
- package/lib/cjs/{erp → api}/dto/PinDto.d.ts +1 -1
- package/{src/erp/dto/ResultPayload.ts → lib/cjs/api/dto/ResultPayload.d.ts} +9 -4
- package/lib/{mjs/erp → cjs/api}/rq/QueryPagingData.d.ts +7 -7
- package/lib/{mjs/erp/rq/TiplistRQ.d.ts → cjs/api/rq/QueryRQ.d.ts} +8 -4
- package/lib/cjs/api/rq/StatusQueryRQ.d.ts +17 -0
- package/lib/cjs/api/rq/UpdateModel.d.ts +18 -0
- package/lib/cjs/app/CoreApp.d.ts +10 -3
- package/lib/cjs/app/CoreApp.js +13 -5
- package/lib/cjs/app/IApp.d.ts +2 -2
- package/lib/cjs/business/EntityStatus.d.ts +1 -1
- package/lib/cjs/business/EntityStatus.js +1 -1
- package/lib/cjs/i18n/en.json +2 -0
- package/lib/cjs/i18n/zh-Hans.json +2 -0
- package/lib/cjs/i18n/zh-Hant.json +2 -0
- package/lib/cjs/index.d.ts +69 -87
- package/lib/cjs/index.js +28 -48
- package/lib/{cjs/erp → mjs/api}/AuthApi.d.ts +12 -5
- package/lib/mjs/{erp → api}/AuthApi.js +8 -0
- package/lib/{cjs/erp → mjs/api}/EntityApi.d.ts +1 -10
- package/lib/mjs/{erp → api}/EntityApi.js +0 -9
- package/lib/mjs/api/dto/AntiforgeryRequestToken.d.ts +21 -0
- package/lib/{cjs/erp → mjs/api}/dto/AuditLineDto.d.ts +1 -1
- package/lib/mjs/{erp → api}/dto/PinDto.d.ts +1 -1
- package/lib/{cjs/erp → mjs/api}/dto/ResultPayload.d.ts +9 -1
- package/lib/{cjs/erp → mjs/api}/rq/QueryPagingData.d.ts +7 -7
- package/lib/{cjs/erp/rq/TiplistRQ.d.ts → mjs/api/rq/QueryRQ.d.ts} +8 -4
- package/lib/mjs/api/rq/StatusQueryRQ.d.ts +17 -0
- package/lib/mjs/api/rq/UpdateModel.d.ts +18 -0
- package/lib/mjs/app/CoreApp.d.ts +10 -3
- package/lib/mjs/app/CoreApp.js +13 -5
- package/lib/mjs/app/IApp.d.ts +2 -2
- package/lib/mjs/business/EntityStatus.d.ts +1 -1
- package/lib/mjs/business/EntityStatus.js +1 -1
- package/lib/mjs/i18n/en.json +2 -0
- package/lib/mjs/i18n/zh-Hans.json +2 -0
- package/lib/mjs/i18n/zh-Hant.json +2 -0
- package/lib/mjs/index.d.ts +69 -87
- package/lib/mjs/index.js +69 -89
- package/package.json +72 -69
- package/src/{erp → api}/AuthApi.ts +16 -6
- package/src/{erp → api}/EntityApi.ts +1 -17
- package/src/api/dto/AntiforgeryRequestToken.ts +23 -0
- package/src/api/dto/AuditLineDto.ts +27 -0
- package/src/api/dto/PinDto.ts +71 -0
- package/{lib/mjs/erp/dto/ResultPayload.d.ts → src/api/dto/ResultPayload.ts} +19 -1
- package/src/{erp → api}/rq/QueryPagingData.ts +7 -7
- package/src/{erp/rq/TiplistRQ.ts → api/rq/QueryRQ.ts} +9 -4
- package/src/api/rq/StatusQueryRQ.ts +19 -0
- package/src/api/rq/UpdateModel.ts +20 -0
- package/src/app/CoreApp.ts +17 -8
- package/src/app/IApp.ts +2 -2
- package/src/business/EntityStatus.ts +1 -1
- package/src/i18n/en.json +2 -0
- package/src/i18n/zh-Hans.json +2 -0
- package/src/i18n/zh-Hant.json +2 -0
- package/src/index.ts +79 -99
- package/tsconfig.cjs.json +17 -17
- package/tsconfig.json +17 -17
- package/.eslintignore +0 -3
- package/.eslintrc.json +0 -29
- package/.prettierignore +0 -5
- package/.prettierrc +0 -6
- package/lib/cjs/erp/AddressApi.d.ts +0 -127
- package/lib/cjs/erp/AddressApi.js +0 -230
- package/lib/cjs/erp/MemberApi.d.ts +0 -22
- package/lib/cjs/erp/MemberApi.js +0 -26
- package/lib/cjs/erp/OrgApi.d.ts +0 -74
- package/lib/cjs/erp/OrgApi.js +0 -94
- package/lib/cjs/erp/PublicApi.d.ts +0 -127
- package/lib/cjs/erp/PublicApi.js +0 -212
- package/lib/cjs/erp/dto/CurrencyDto.d.ts +0 -6
- package/lib/cjs/erp/dto/ExchangeRateDto.d.ts +0 -13
- package/lib/cjs/erp/dto/ExchangeRateHistoryDto.d.ts +0 -8
- package/lib/cjs/erp/dto/OrgDto.d.ts +0 -33
- package/lib/cjs/erp/dto/OrgDto.js +0 -2
- package/lib/cjs/erp/dto/OrgQueryDto.d.ts +0 -21
- package/lib/cjs/erp/dto/OrgQueryDto.js +0 -2
- package/lib/cjs/erp/dto/OrgViewDto.d.ts +0 -63
- package/lib/cjs/erp/dto/OrgViewDto.js +0 -2
- package/lib/cjs/erp/dto/PlaceParsedDto.d.ts +0 -50
- package/lib/cjs/erp/dto/PlaceParsedDto.js +0 -2
- package/lib/cjs/erp/dto/ResponseActionMessageDto.d.ts +0 -14
- package/lib/cjs/erp/dto/ResponseActionMessageDto.js +0 -2
- package/lib/cjs/erp/rq/MemberListRQ.d.ts +0 -5
- package/lib/cjs/erp/rq/MemberListRQ.js +0 -2
- package/lib/cjs/erp/rq/OrgListRQ.d.ts +0 -10
- package/lib/cjs/erp/rq/OrgListRQ.js +0 -2
- package/lib/cjs/erp/rq/OrgQueryRQ.d.ts +0 -14
- package/lib/cjs/erp/rq/OrgQueryRQ.js +0 -2
- package/lib/cjs/erp/rq/ParsePinRQ.d.ts +0 -14
- package/lib/cjs/erp/rq/ParsePinRQ.js +0 -2
- package/lib/cjs/erp/rq/PlaceParseRQ.d.ts +0 -25
- package/lib/cjs/erp/rq/PlaceParseRQ.js +0 -2
- package/lib/cjs/erp/rq/PlaceQueryRQ.d.ts +0 -58
- package/lib/cjs/erp/rq/PlaceQueryRQ.js +0 -21
- package/lib/cjs/erp/rq/QueryRQ.d.ts +0 -16
- package/lib/cjs/erp/rq/RegionsRQ.d.ts +0 -22
- package/lib/cjs/erp/rq/RegionsRQ.js +0 -2
- package/lib/cjs/erp/rq/SendActionMessageRQ.d.ts +0 -26
- package/lib/cjs/erp/rq/SendActionMessageRQ.js +0 -2
- package/lib/cjs/erp/rq/TiplistRQ.js +0 -2
- package/lib/mjs/erp/AddressApi.d.ts +0 -127
- package/lib/mjs/erp/AddressApi.js +0 -226
- package/lib/mjs/erp/MemberApi.d.ts +0 -22
- package/lib/mjs/erp/MemberApi.js +0 -22
- package/lib/mjs/erp/OrgApi.d.ts +0 -74
- package/lib/mjs/erp/OrgApi.js +0 -90
- package/lib/mjs/erp/PublicApi.d.ts +0 -127
- package/lib/mjs/erp/PublicApi.js +0 -208
- package/lib/mjs/erp/dto/CurrencyDto.d.ts +0 -6
- package/lib/mjs/erp/dto/ExchangeRateDto.d.ts +0 -13
- package/lib/mjs/erp/dto/ExchangeRateHistoryDto.d.ts +0 -8
- package/lib/mjs/erp/dto/OrgDto.d.ts +0 -33
- package/lib/mjs/erp/dto/OrgDto.js +0 -1
- package/lib/mjs/erp/dto/OrgQueryDto.d.ts +0 -21
- package/lib/mjs/erp/dto/OrgQueryDto.js +0 -1
- package/lib/mjs/erp/dto/OrgViewDto.d.ts +0 -63
- package/lib/mjs/erp/dto/OrgViewDto.js +0 -1
- package/lib/mjs/erp/dto/PlaceParsedDto.d.ts +0 -50
- package/lib/mjs/erp/dto/PlaceParsedDto.js +0 -1
- package/lib/mjs/erp/dto/ResponseActionMessageDto.d.ts +0 -14
- package/lib/mjs/erp/dto/ResponseActionMessageDto.js +0 -1
- package/lib/mjs/erp/rq/MemberListRQ.d.ts +0 -5
- package/lib/mjs/erp/rq/MemberListRQ.js +0 -1
- package/lib/mjs/erp/rq/OrgListRQ.d.ts +0 -10
- package/lib/mjs/erp/rq/OrgListRQ.js +0 -1
- package/lib/mjs/erp/rq/OrgQueryRQ.d.ts +0 -14
- package/lib/mjs/erp/rq/OrgQueryRQ.js +0 -1
- package/lib/mjs/erp/rq/ParsePinRQ.d.ts +0 -14
- package/lib/mjs/erp/rq/ParsePinRQ.js +0 -1
- package/lib/mjs/erp/rq/PlaceParseRQ.d.ts +0 -25
- package/lib/mjs/erp/rq/PlaceParseRQ.js +0 -1
- package/lib/mjs/erp/rq/PlaceQueryRQ.d.ts +0 -58
- package/lib/mjs/erp/rq/PlaceQueryRQ.js +0 -18
- package/lib/mjs/erp/rq/QueryRQ.d.ts +0 -16
- package/lib/mjs/erp/rq/RegionsRQ.d.ts +0 -22
- package/lib/mjs/erp/rq/RegionsRQ.js +0 -1
- package/lib/mjs/erp/rq/SendActionMessageRQ.d.ts +0 -26
- package/lib/mjs/erp/rq/SendActionMessageRQ.js +0 -1
- package/lib/mjs/erp/rq/TiplistRQ.js +0 -1
- package/src/erp/AddressApi.ts +0 -310
- package/src/erp/MemberApi.ts +0 -28
- package/src/erp/OrgApi.ts +0 -136
- package/src/erp/PublicApi.ts +0 -282
- package/src/erp/dto/AuditLineDto.ts +0 -27
- package/src/erp/dto/CurrencyDto.ts +0 -7
- package/src/erp/dto/ExchangeRateDto.ts +0 -14
- package/src/erp/dto/ExchangeRateHistoryDto.ts +0 -9
- package/src/erp/dto/OrgDto.ts +0 -39
- package/src/erp/dto/OrgQueryDto.ts +0 -24
- package/src/erp/dto/OrgViewDto.ts +0 -78
- package/src/erp/dto/PinDto.ts +0 -71
- package/src/erp/dto/PlaceParsedDto.ts +0 -58
- package/src/erp/dto/ResponseActionMessageDto.ts +0 -16
- package/src/erp/rq/MemberListRQ.ts +0 -6
- package/src/erp/rq/OrgListRQ.ts +0 -11
- package/src/erp/rq/OrgQueryRQ.ts +0 -16
- package/src/erp/rq/ParsePinRQ.ts +0 -15
- package/src/erp/rq/PlaceParseRQ.ts +0 -28
- package/src/erp/rq/PlaceQueryRQ.ts +0 -67
- package/src/erp/rq/QueryRQ.ts +0 -18
- package/src/erp/rq/RegionsRQ.ts +0 -26
- package/src/erp/rq/SendActionMessageRQ.ts +0 -29
- package/lib/cjs/{erp → api}/BaseApi.d.ts +0 -0
- package/lib/cjs/{erp → api}/BaseApi.js +0 -0
- package/lib/cjs/{erp/dto/ApiRefreshTokenDto.js → api/dto/AntiforgeryRequestToken.js} +0 -0
- package/lib/cjs/{erp → api}/dto/ApiRefreshTokenDto.d.ts +0 -0
- package/lib/cjs/{erp/dto/AuditLineDto.js → api/dto/ApiRefreshTokenDto.js} +0 -0
- package/lib/cjs/{erp/dto/CurrencyDto.js → api/dto/AuditLineDto.js} +0 -0
- package/lib/cjs/{erp → api}/dto/IdLabelDto.d.ts +0 -0
- package/lib/cjs/{erp → api}/dto/IdLabelDto.js +0 -0
- package/lib/cjs/{erp → api}/dto/IdLabelPrimaryDto.d.ts +0 -0
- package/lib/cjs/{erp → api}/dto/IdLabelPrimaryDto.js +0 -0
- package/lib/cjs/{erp → api}/dto/InitCallDto.d.ts +0 -0
- package/lib/cjs/{erp → api}/dto/InitCallDto.js +0 -0
- package/lib/cjs/{erp → api}/dto/PinDto.js +0 -0
- package/lib/cjs/{erp → api}/dto/ResultPayload.js +0 -0
- package/lib/cjs/{erp → api}/rq/ApiRefreshTokenRQ.d.ts +0 -0
- package/lib/cjs/{erp → api}/rq/ApiRefreshTokenRQ.js +0 -0
- package/lib/cjs/{erp → api}/rq/AuthRequest.d.ts +0 -0
- package/lib/cjs/{erp → api}/rq/AuthRequest.js +0 -0
- package/lib/cjs/{erp → api}/rq/GetLogInUrlRQ.d.ts +0 -0
- package/lib/cjs/{erp → api}/rq/GetLogInUrlRQ.js +0 -0
- package/lib/cjs/{erp → api}/rq/LoginIdRQ.d.ts +0 -0
- package/lib/cjs/{erp → api}/rq/LoginIdRQ.js +0 -0
- package/lib/cjs/{erp → api}/rq/LoginRQ.d.ts +1 -1
- package/lib/cjs/{erp → api}/rq/LoginRQ.js +0 -0
- package/lib/cjs/{erp → api}/rq/MergeRQ.d.ts +0 -0
- package/lib/cjs/{erp → api}/rq/MergeRQ.js +0 -0
- package/lib/cjs/{erp → api}/rq/QueryPagingData.js +0 -0
- package/lib/cjs/{erp → api}/rq/QueryRQ.js +0 -0
- package/lib/cjs/{erp → api}/rq/RefreshTokenRQ.d.ts +0 -0
- package/lib/cjs/{erp → api}/rq/RefreshTokenRQ.js +0 -0
- package/lib/cjs/{erp → api}/rq/ResetPasswordRQ.d.ts +0 -0
- package/lib/cjs/{erp → api}/rq/ResetPasswordRQ.js +0 -0
- package/lib/cjs/{erp → api}/rq/SignoutRQ.d.ts +0 -0
- package/lib/cjs/{erp → api}/rq/SignoutRQ.js +0 -0
- package/lib/cjs/{erp/dto/ExchangeRateDto.js → api/rq/StatusQueryRQ.js} +0 -0
- package/lib/cjs/{erp → api}/rq/SwitchOrgRQ.d.ts +0 -0
- package/lib/cjs/{erp → api}/rq/SwitchOrgRQ.js +0 -0
- package/lib/cjs/{erp → api}/rq/TokenRQ.d.ts +0 -0
- package/lib/cjs/{erp → api}/rq/TokenRQ.js +0 -0
- package/lib/cjs/{erp/dto/ExchangeRateHistoryDto.js → api/rq/UpdateModel.js} +0 -0
- package/lib/cjs/{erp → api}/rq/UpdateStatusRQ.d.ts +0 -0
- package/lib/cjs/{erp → api}/rq/UpdateStatusRQ.js +0 -0
- package/lib/mjs/{erp → api}/BaseApi.d.ts +0 -0
- package/lib/mjs/{erp → api}/BaseApi.js +0 -0
- package/lib/mjs/{erp/dto/ApiRefreshTokenDto.js → api/dto/AntiforgeryRequestToken.js} +0 -0
- package/lib/mjs/{erp → api}/dto/ApiRefreshTokenDto.d.ts +0 -0
- package/lib/mjs/{erp/dto/AuditLineDto.js → api/dto/ApiRefreshTokenDto.js} +0 -0
- package/lib/mjs/{erp/dto/CurrencyDto.js → api/dto/AuditLineDto.js} +0 -0
- package/lib/mjs/{erp → api}/dto/IdLabelDto.d.ts +0 -0
- package/lib/mjs/{erp → api}/dto/IdLabelDto.js +0 -0
- package/lib/mjs/{erp → api}/dto/IdLabelPrimaryDto.d.ts +0 -0
- package/lib/mjs/{erp → api}/dto/IdLabelPrimaryDto.js +0 -0
- package/lib/mjs/{erp → api}/dto/InitCallDto.d.ts +0 -0
- package/lib/mjs/{erp → api}/dto/InitCallDto.js +0 -0
- package/lib/mjs/{erp → api}/dto/PinDto.js +0 -0
- package/lib/mjs/{erp → api}/dto/ResultPayload.js +0 -0
- package/lib/mjs/{erp → api}/rq/ApiRefreshTokenRQ.d.ts +0 -0
- package/lib/mjs/{erp → api}/rq/ApiRefreshTokenRQ.js +0 -0
- package/lib/mjs/{erp → api}/rq/AuthRequest.d.ts +0 -0
- package/lib/mjs/{erp → api}/rq/AuthRequest.js +0 -0
- package/lib/mjs/{erp → api}/rq/GetLogInUrlRQ.d.ts +0 -0
- package/lib/mjs/{erp → api}/rq/GetLogInUrlRQ.js +0 -0
- package/lib/mjs/{erp → api}/rq/LoginIdRQ.d.ts +0 -0
- package/lib/mjs/{erp → api}/rq/LoginIdRQ.js +0 -0
- package/lib/mjs/{erp → api}/rq/LoginRQ.d.ts +1 -1
- package/lib/mjs/{erp → api}/rq/LoginRQ.js +0 -0
- package/lib/mjs/{erp → api}/rq/MergeRQ.d.ts +0 -0
- package/lib/mjs/{erp → api}/rq/MergeRQ.js +0 -0
- package/lib/mjs/{erp → api}/rq/QueryPagingData.js +0 -0
- package/lib/mjs/{erp → api}/rq/QueryRQ.js +0 -0
- package/lib/mjs/{erp → api}/rq/RefreshTokenRQ.d.ts +0 -0
- package/lib/mjs/{erp → api}/rq/RefreshTokenRQ.js +0 -0
- package/lib/mjs/{erp → api}/rq/ResetPasswordRQ.d.ts +0 -0
- package/lib/mjs/{erp → api}/rq/ResetPasswordRQ.js +0 -0
- package/lib/mjs/{erp → api}/rq/SignoutRQ.d.ts +0 -0
- package/lib/mjs/{erp → api}/rq/SignoutRQ.js +0 -0
- package/lib/mjs/{erp/dto/ExchangeRateDto.js → api/rq/StatusQueryRQ.js} +0 -0
- package/lib/mjs/{erp → api}/rq/SwitchOrgRQ.d.ts +0 -0
- package/lib/mjs/{erp → api}/rq/SwitchOrgRQ.js +0 -0
- package/lib/mjs/{erp → api}/rq/TokenRQ.d.ts +0 -0
- package/lib/mjs/{erp → api}/rq/TokenRQ.js +0 -0
- package/lib/mjs/{erp/dto/ExchangeRateHistoryDto.js → api/rq/UpdateModel.js} +0 -0
- package/lib/mjs/{erp → api}/rq/UpdateStatusRQ.d.ts +0 -0
- package/lib/mjs/{erp → api}/rq/UpdateStatusRQ.js +0 -0
- package/src/{erp → api}/BaseApi.ts +0 -0
- package/src/{erp → api}/dto/ApiRefreshTokenDto.ts +0 -0
- package/src/{erp → api}/dto/IdLabelDto.ts +0 -0
- package/src/{erp → api}/dto/IdLabelPrimaryDto.ts +0 -0
- package/src/{erp → api}/dto/InitCallDto.ts +0 -0
- package/src/{erp → api}/rq/ApiRefreshTokenRQ.ts +0 -0
- package/src/{erp → api}/rq/AuthRequest.ts +0 -0
- package/src/{erp → api}/rq/GetLogInUrlRQ.ts +0 -0
- package/src/{erp → api}/rq/LoginIdRQ.ts +0 -0
- package/src/{erp → api}/rq/LoginRQ.ts +1 -1
- /package/src/{erp → api}/rq/MergeRQ.ts +0 -0
- /package/src/{erp → api}/rq/RefreshTokenRQ.ts +0 -0
- /package/src/{erp → api}/rq/ResetPasswordRQ.ts +0 -0
- /package/src/{erp → api}/rq/SignoutRQ.ts +0 -0
- /package/src/{erp → api}/rq/SwitchOrgRQ.ts +0 -0
- /package/src/{erp → api}/rq/TokenRQ.ts +0 -0
- /package/src/{erp → api}/rq/UpdateStatusRQ.ts +0 -0
package/lib/cjs/erp/PublicApi.js
DELETED
|
@@ -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,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,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,63 +0,0 @@
|
|
|
1
|
-
import { EntityStatus } from '../../business/EntityStatus';
|
|
2
|
-
export type OrgViewDto = {
|
|
3
|
-
/**
|
|
4
|
-
* Id
|
|
5
|
-
*/
|
|
6
|
-
id: number;
|
|
7
|
-
/**
|
|
8
|
-
* Entity id
|
|
9
|
-
*/
|
|
10
|
-
entityId: number;
|
|
11
|
-
/**
|
|
12
|
-
* Trade as
|
|
13
|
-
*/
|
|
14
|
-
tradeAs?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Brand, like ETSOO
|
|
17
|
-
*/
|
|
18
|
-
brand?: string;
|
|
19
|
-
/**
|
|
20
|
-
* Name, like ETSOO NZ LIMITED
|
|
21
|
-
*/
|
|
22
|
-
name: string;
|
|
23
|
-
/**
|
|
24
|
-
* Country or region id, like CN = China
|
|
25
|
-
*/
|
|
26
|
-
regionId?: string;
|
|
27
|
-
/**
|
|
28
|
-
* State id
|
|
29
|
-
*/
|
|
30
|
-
stateId?: string;
|
|
31
|
-
/**
|
|
32
|
-
* City id
|
|
33
|
-
*/
|
|
34
|
-
cityId?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Identifier id
|
|
37
|
-
*/
|
|
38
|
-
identifier?: string;
|
|
39
|
-
/**
|
|
40
|
-
* Avatar or logo
|
|
41
|
-
*/
|
|
42
|
-
avatar?: string;
|
|
43
|
-
/**
|
|
44
|
-
* Corporate or personal
|
|
45
|
-
*/
|
|
46
|
-
corporate?: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Expiry time
|
|
49
|
-
*/
|
|
50
|
-
expiry?: string | Date;
|
|
51
|
-
/**
|
|
52
|
-
* Entity status
|
|
53
|
-
*/
|
|
54
|
-
entityStatus: EntityStatus;
|
|
55
|
-
/**
|
|
56
|
-
* Parent organization id
|
|
57
|
-
*/
|
|
58
|
-
parentId?: number;
|
|
59
|
-
/**
|
|
60
|
-
* Creation
|
|
61
|
-
*/
|
|
62
|
-
creation: string | Date;
|
|
63
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Parsed place data
|
|
3
|
-
*/
|
|
4
|
-
export type PlaceParsedDto = {
|
|
5
|
-
/**
|
|
6
|
-
* Language
|
|
7
|
-
* 语言
|
|
8
|
-
*/
|
|
9
|
-
language: string;
|
|
10
|
-
/**
|
|
11
|
-
* Region or country name, like China
|
|
12
|
-
* 地区或国家名称,如中国
|
|
13
|
-
*/
|
|
14
|
-
region?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Region id
|
|
17
|
-
* 地区编号
|
|
18
|
-
*/
|
|
19
|
-
regionId?: string;
|
|
20
|
-
/**
|
|
21
|
-
* State or province
|
|
22
|
-
* 州 / 省
|
|
23
|
-
*/
|
|
24
|
-
state?: string;
|
|
25
|
-
/**
|
|
26
|
-
* State or province id
|
|
27
|
-
* 州 / 省编号
|
|
28
|
-
*/
|
|
29
|
-
stateId?: string;
|
|
30
|
-
/**
|
|
31
|
-
* City
|
|
32
|
-
* 城市
|
|
33
|
-
*/
|
|
34
|
-
city?: string;
|
|
35
|
-
/**
|
|
36
|
-
* City id
|
|
37
|
-
* 城市编号
|
|
38
|
-
*/
|
|
39
|
-
cityId?: number;
|
|
40
|
-
/**
|
|
41
|
-
* District
|
|
42
|
-
* 区县
|
|
43
|
-
*/
|
|
44
|
-
district?: string;
|
|
45
|
-
/**
|
|
46
|
-
* District id
|
|
47
|
-
* 区县编号
|
|
48
|
-
*/
|
|
49
|
-
districtId?: number;
|
|
50
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Parse place request data
|
|
3
|
-
*/
|
|
4
|
-
export type PlaceParseRQ = {
|
|
5
|
-
/**
|
|
6
|
-
* Region or country name, like China
|
|
7
|
-
* 地区或国家名称,如中国
|
|
8
|
-
*/
|
|
9
|
-
region?: string;
|
|
10
|
-
/**
|
|
11
|
-
* State or province
|
|
12
|
-
* 州 / 省
|
|
13
|
-
*/
|
|
14
|
-
state?: string;
|
|
15
|
-
/**
|
|
16
|
-
* City
|
|
17
|
-
* 城市
|
|
18
|
-
*/
|
|
19
|
-
city?: string;
|
|
20
|
-
/**
|
|
21
|
-
* District
|
|
22
|
-
* 区县
|
|
23
|
-
*/
|
|
24
|
-
district?: string;
|
|
25
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { AddressLocation } from '../../address/AddressLocation';
|
|
2
|
-
/**
|
|
3
|
-
* Place query output type
|
|
4
|
-
* 地址查询输出类型
|
|
5
|
-
*/
|
|
6
|
-
export declare enum PlaceQueryOutput {
|
|
7
|
-
JSON = 0,
|
|
8
|
-
XML = 1
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Place query API provider
|
|
12
|
-
* 地址查询接口供应商
|
|
13
|
-
*/
|
|
14
|
-
export declare enum PlaceQueryProvider {
|
|
15
|
-
Google = 0,
|
|
16
|
-
Baidu = 1
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Place query request data
|
|
20
|
-
* 地址查询请求数据
|
|
21
|
-
*/
|
|
22
|
-
export type PlaceQueryRQ = {
|
|
23
|
-
/**
|
|
24
|
-
* Query address
|
|
25
|
-
* 查询地址
|
|
26
|
-
*/
|
|
27
|
-
query: string;
|
|
28
|
-
/**
|
|
29
|
-
* Output type
|
|
30
|
-
* 输出类型
|
|
31
|
-
*/
|
|
32
|
-
output?: PlaceQueryOutput;
|
|
33
|
-
/**
|
|
34
|
-
* API provider
|
|
35
|
-
* 接口供应商
|
|
36
|
-
*/
|
|
37
|
-
provider?: PlaceQueryProvider;
|
|
38
|
-
/**
|
|
39
|
-
* Language
|
|
40
|
-
* 语言
|
|
41
|
-
*/
|
|
42
|
-
language?: string;
|
|
43
|
-
/**
|
|
44
|
-
* Limited region / country id, like CN
|
|
45
|
-
* 限定的地区获国家编号
|
|
46
|
-
*/
|
|
47
|
-
region?: string;
|
|
48
|
-
/**
|
|
49
|
-
* Center location
|
|
50
|
-
* 中心位置
|
|
51
|
-
*/
|
|
52
|
-
location?: AddressLocation;
|
|
53
|
-
/**
|
|
54
|
-
* Circle radius
|
|
55
|
-
* 方圆半径
|
|
56
|
-
*/
|
|
57
|
-
radius?: number;
|
|
58
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PlaceQueryProvider = exports.PlaceQueryOutput = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Place query output type
|
|
6
|
-
* 地址查询输出类型
|
|
7
|
-
*/
|
|
8
|
-
var PlaceQueryOutput;
|
|
9
|
-
(function (PlaceQueryOutput) {
|
|
10
|
-
PlaceQueryOutput[PlaceQueryOutput["JSON"] = 0] = "JSON";
|
|
11
|
-
PlaceQueryOutput[PlaceQueryOutput["XML"] = 1] = "XML";
|
|
12
|
-
})(PlaceQueryOutput || (exports.PlaceQueryOutput = PlaceQueryOutput = {}));
|
|
13
|
-
/**
|
|
14
|
-
* Place query API provider
|
|
15
|
-
* 地址查询接口供应商
|
|
16
|
-
*/
|
|
17
|
-
var PlaceQueryProvider;
|
|
18
|
-
(function (PlaceQueryProvider) {
|
|
19
|
-
PlaceQueryProvider[PlaceQueryProvider["Google"] = 0] = "Google";
|
|
20
|
-
PlaceQueryProvider[PlaceQueryProvider["Baidu"] = 1] = "Baidu";
|
|
21
|
-
})(PlaceQueryProvider || (exports.PlaceQueryProvider = PlaceQueryProvider = {}));
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { IdType } from '@etsoo/shared';
|
|
2
|
-
import { QueryPagingData } from './QueryPagingData';
|
|
3
|
-
/**
|
|
4
|
-
* Query request data
|
|
5
|
-
* com.etsoo.CoreFramework.Models.QueryRQ
|
|
6
|
-
*/
|
|
7
|
-
export type QueryRQ<T extends IdType = number> = {
|
|
8
|
-
/**
|
|
9
|
-
* Number id
|
|
10
|
-
*/
|
|
11
|
-
id?: T;
|
|
12
|
-
/**
|
|
13
|
-
* Query paging data
|
|
14
|
-
*/
|
|
15
|
-
queryPaging?: QueryPagingData;
|
|
16
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export type RegionsRQ = {
|
|
2
|
-
/**
|
|
3
|
-
* Country id
|
|
4
|
-
*/
|
|
5
|
-
id?: string;
|
|
6
|
-
/**
|
|
7
|
-
* Favored country ids from top to bottom
|
|
8
|
-
*/
|
|
9
|
-
favoredIds?: string[];
|
|
10
|
-
/**
|
|
11
|
-
* Items count to query
|
|
12
|
-
*/
|
|
13
|
-
items?: number;
|
|
14
|
-
/**
|
|
15
|
-
* Filter keyword
|
|
16
|
-
*/
|
|
17
|
-
keyword?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Cultrue
|
|
20
|
-
*/
|
|
21
|
-
culture?: string;
|
|
22
|
-
};
|