@etsoo/appscript 1.5.62 → 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.
- package/__tests__/app/CoreApp.ts +9 -276
- package/__tests__/app/TestApp.ts +136 -0
- 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/{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 +67 -87
- package/lib/cjs/index.js +26 -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/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 +67 -87
- package/lib/mjs/index.js +67 -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/{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 +77 -99
- 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/AuditLineDto.d.ts +0 -24
- 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/ExchangeRateHistoryDto.js +0 -2
- 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/PinDto.d.ts +0 -61
- package/lib/cjs/erp/dto/PinDto.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/AuditLineDto.d.ts +0 -24
- 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/ExchangeRateHistoryDto.js +0 -1
- 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/PinDto.d.ts +0 -61
- package/lib/mjs/erp/dto/PinDto.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 → 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/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/CurrencyDto.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/ExchangeRateDto.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 → 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/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/CurrencyDto.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/ExchangeRateDto.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
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { AddressContinent } from '../address/AddressContinent';
|
|
2
|
-
import { AddressRegion, AddressRegionDb } from '../address/AddressRegion';
|
|
3
|
-
import { AddressState } from '../address/AddressState';
|
|
4
|
-
import { IdLabelConditional } from './dto/IdLabelDto';
|
|
5
|
-
import { BaseApi } from './BaseApi';
|
|
6
|
-
import { IApiPayload } from '@etsoo/restclient';
|
|
7
|
-
import { RegionsRQ } from './rq/RegionsRQ';
|
|
8
|
-
import { AddressCity } from '../address/AddressCity';
|
|
9
|
-
import { AddressDistrict } from '../address/AddressDistrict';
|
|
10
|
-
import { PlaceQueryRQ } from './rq/PlaceQueryRQ';
|
|
11
|
-
import { AddressAutocomplete } from '../address/AddressAutocomplete';
|
|
12
|
-
import { AddressPlace } from '../address/AddressPlace';
|
|
13
|
-
import { PlaceParseRQ } from './rq/PlaceParseRQ';
|
|
14
|
-
import { PlaceParsedDto } from './dto/PlaceParsedDto';
|
|
15
|
-
/**
|
|
16
|
-
* Address Api
|
|
17
|
-
*/
|
|
18
|
-
export declare class AddressApi extends BaseApi {
|
|
19
|
-
/**
|
|
20
|
-
* Place autocomplete
|
|
21
|
-
* @param rq Request data
|
|
22
|
-
* @param payload Payload
|
|
23
|
-
* @returns Result
|
|
24
|
-
*/
|
|
25
|
-
autocomplete(rq: PlaceQueryRQ, payload?: IApiPayload<AddressAutocomplete[]>): Promise<AddressAutocomplete[] | undefined>;
|
|
26
|
-
/**
|
|
27
|
-
* Get all continents
|
|
28
|
-
* @param isNumberKey Is number key or key as id
|
|
29
|
-
* @param includeAntarctica Include Antarctica or not
|
|
30
|
-
* @returns Continents
|
|
31
|
-
*/
|
|
32
|
-
continents<T extends boolean>(isNumberKey?: T, includeAntarctica?: boolean): IdLabelConditional<T>;
|
|
33
|
-
/**
|
|
34
|
-
* Get continent label
|
|
35
|
-
* @param id Region id
|
|
36
|
-
* @returns Label
|
|
37
|
-
*/
|
|
38
|
-
getContinentLabel(id: AddressContinent | string): string;
|
|
39
|
-
/**
|
|
40
|
-
* Get region by id
|
|
41
|
-
* @param id Region id
|
|
42
|
-
* @returns Result
|
|
43
|
-
*/
|
|
44
|
-
getRegion(id?: string): Promise<AddressRegionDb | AddressRegion | undefined>;
|
|
45
|
-
/**
|
|
46
|
-
* Get region label
|
|
47
|
-
* @param id Region id
|
|
48
|
-
* @returns Label
|
|
49
|
-
*/
|
|
50
|
-
getRegionLabel(id: string): string;
|
|
51
|
-
/**
|
|
52
|
-
* Get all regions
|
|
53
|
-
* @param rq Rquest data
|
|
54
|
-
*/
|
|
55
|
-
getRegions(rq?: RegionsRQ): Promise<AddressRegionDb[] | undefined>;
|
|
56
|
-
/**
|
|
57
|
-
* Get region's currency, current region's currency as default
|
|
58
|
-
* @param regionId Region id
|
|
59
|
-
* @returns Result
|
|
60
|
-
*/
|
|
61
|
-
regionCurrency(regionId?: string): "AUD" | "CAD" | "CNY" | "EUR" | "GBP" | "HKD" | "JPY" | "NZD" | "SGD" | "USD";
|
|
62
|
-
/**
|
|
63
|
-
* Get local region by id
|
|
64
|
-
* @param id Region id
|
|
65
|
-
* @returns Result
|
|
66
|
-
*/
|
|
67
|
-
region(id?: string): AddressRegion | undefined;
|
|
68
|
-
/**
|
|
69
|
-
* Get all local regions
|
|
70
|
-
*/
|
|
71
|
-
regions(): AddressRegion[];
|
|
72
|
-
/**
|
|
73
|
-
* Get all local regions limited to favored ids
|
|
74
|
-
* @param favoredIds Favored ids
|
|
75
|
-
*/
|
|
76
|
-
regions(favoredIds: string[]): AddressRegion[];
|
|
77
|
-
/**
|
|
78
|
-
* Get state list
|
|
79
|
-
* @param regionId Region id
|
|
80
|
-
* @param favoredIds Favored ids
|
|
81
|
-
* @param payload Payload
|
|
82
|
-
* @param culture Culture
|
|
83
|
-
* @returns Result
|
|
84
|
-
*/
|
|
85
|
-
states(regionId: string, favoredIds?: string[], payload?: IApiPayload<AddressState[]>, culture?: string): Promise<AddressState[] | undefined>;
|
|
86
|
-
/**
|
|
87
|
-
* Get city list
|
|
88
|
-
* @param stateId State id
|
|
89
|
-
* @param favoredIds Favored ids
|
|
90
|
-
* @param payload Payload
|
|
91
|
-
* @param culture Culture
|
|
92
|
-
*
|
|
93
|
-
* @returns Result
|
|
94
|
-
*/
|
|
95
|
-
cities(stateId: string, favoredIds?: number[], payload?: IApiPayload<AddressCity[]>, culture?: string): Promise<AddressCity[] | undefined>;
|
|
96
|
-
/**
|
|
97
|
-
* Get district list
|
|
98
|
-
* @param cityId City id
|
|
99
|
-
* @param favoredIds Favored ids
|
|
100
|
-
* @param payload Payload
|
|
101
|
-
* @param culture Culture
|
|
102
|
-
* @returns Result
|
|
103
|
-
*/
|
|
104
|
-
districts(cityId: number, favoredIds?: number[], payload?: IApiPayload<AddressDistrict[]>, culture?: string): Promise<AddressDistrict[] | undefined>;
|
|
105
|
-
/**
|
|
106
|
-
* Get place details
|
|
107
|
-
* @param placeId Place id
|
|
108
|
-
* @param language Language
|
|
109
|
-
* @param payload Payload
|
|
110
|
-
* @returns Result
|
|
111
|
-
*/
|
|
112
|
-
GetPlaceDetails(placeId: string, language?: string, payload?: IApiPayload<AddressPlace>): Promise<AddressPlace | undefined>;
|
|
113
|
-
/**
|
|
114
|
-
* Parse place
|
|
115
|
-
* @param rq Request data
|
|
116
|
-
* @param payload Payload
|
|
117
|
-
* @returns Result
|
|
118
|
-
*/
|
|
119
|
-
parsePlace(rq: PlaceParseRQ, payload?: IApiPayload<PlaceParsedDto>): Promise<PlaceParsedDto | undefined>;
|
|
120
|
-
/**
|
|
121
|
-
* Place autocomplete
|
|
122
|
-
* @param rq Request data
|
|
123
|
-
* @param payload Payload
|
|
124
|
-
* @returns Result
|
|
125
|
-
*/
|
|
126
|
-
searchPlace(rq: PlaceQueryRQ, payload?: IApiPayload<AddressPlace[]>): Promise<AddressPlace[] | undefined>;
|
|
127
|
-
}
|
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AddressApi = void 0;
|
|
4
|
-
const shared_1 = require("@etsoo/shared");
|
|
5
|
-
const AddressContinent_1 = require("../address/AddressContinent");
|
|
6
|
-
const AddressRegion_1 = require("../address/AddressRegion");
|
|
7
|
-
const BaseApi_1 = require("./BaseApi");
|
|
8
|
-
const cachedRegions = {};
|
|
9
|
-
/**
|
|
10
|
-
* Address Api
|
|
11
|
-
*/
|
|
12
|
-
class AddressApi extends BaseApi_1.BaseApi {
|
|
13
|
-
/**
|
|
14
|
-
* Place autocomplete
|
|
15
|
-
* @param rq Request data
|
|
16
|
-
* @param payload Payload
|
|
17
|
-
* @returns Result
|
|
18
|
-
*/
|
|
19
|
-
autocomplete(rq, payload) {
|
|
20
|
-
if (rq.query === '')
|
|
21
|
-
return Promise.resolve(undefined);
|
|
22
|
-
rq.language ?? (rq.language = this.app.culture);
|
|
23
|
-
return this.api.post('Address/Autocomplete', rq, payload);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Get all continents
|
|
27
|
-
* @param isNumberKey Is number key or key as id
|
|
28
|
-
* @param includeAntarctica Include Antarctica or not
|
|
29
|
-
* @returns Continents
|
|
30
|
-
*/
|
|
31
|
-
continents(isNumberKey = false, includeAntarctica = false) {
|
|
32
|
-
return shared_1.DataTypes.getEnumKeys(AddressContinent_1.AddressContinent)
|
|
33
|
-
.filter((item) => includeAntarctica || item !== 'AN')
|
|
34
|
-
.map((key) => ({
|
|
35
|
-
id: isNumberKey
|
|
36
|
-
? shared_1.DataTypes.getEnumByKey(AddressContinent_1.AddressContinent, key)
|
|
37
|
-
: key.toString(),
|
|
38
|
-
label: this.getContinentLabel(key)
|
|
39
|
-
}));
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Get continent label
|
|
43
|
-
* @param id Region id
|
|
44
|
-
* @returns Label
|
|
45
|
-
*/
|
|
46
|
-
getContinentLabel(id) {
|
|
47
|
-
return this.app.get('continent' + id) ?? id;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Get region by id
|
|
51
|
-
* @param id Region id
|
|
52
|
-
* @returns Result
|
|
53
|
-
*/
|
|
54
|
-
async getRegion(id) {
|
|
55
|
-
if (!id)
|
|
56
|
-
return this.app.defaultRegion;
|
|
57
|
-
const regions = await this.getRegions({ id });
|
|
58
|
-
if (regions == null || regions.length === 0)
|
|
59
|
-
return undefined;
|
|
60
|
-
return regions[0];
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Get region label
|
|
64
|
-
* @param id Region id
|
|
65
|
-
* @returns Label
|
|
66
|
-
*/
|
|
67
|
-
getRegionLabel(id) {
|
|
68
|
-
// Local defined region label
|
|
69
|
-
let label = this.app.getRegionLabel(id);
|
|
70
|
-
if (label === id) {
|
|
71
|
-
// Cache data, make sure called getRegions first
|
|
72
|
-
const regions = cachedRegions[this.app.culture];
|
|
73
|
-
const region = regions?.find((region) => region.id === id);
|
|
74
|
-
if (region)
|
|
75
|
-
return region.label;
|
|
76
|
-
}
|
|
77
|
-
return label;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Get all regions
|
|
81
|
-
* @param rq Rquest data
|
|
82
|
-
*/
|
|
83
|
-
async getRegions(rq) {
|
|
84
|
-
const culture = rq?.culture ?? this.app.culture;
|
|
85
|
-
let regions = cachedRegions[culture];
|
|
86
|
-
if (regions == null) {
|
|
87
|
-
regions = await this.api.get(`Address/RegionList?language=${culture}`, undefined, { defaultValue: [], showLoading: false });
|
|
88
|
-
if (regions == null)
|
|
89
|
-
return undefined;
|
|
90
|
-
cachedRegions[culture] = regions;
|
|
91
|
-
}
|
|
92
|
-
const { id, favoredIds = [], items = 8, keyword } = rq ?? {};
|
|
93
|
-
// Id first
|
|
94
|
-
if (id) {
|
|
95
|
-
return regions.filter((region) => region.id === id);
|
|
96
|
-
}
|
|
97
|
-
// Keyword filter
|
|
98
|
-
if (keyword)
|
|
99
|
-
regions = regions.filter((region) => region.label.includes(keyword) ||
|
|
100
|
-
region.py?.includes(keyword.toUpperCase()) ||
|
|
101
|
-
region.id === keyword.toUpperCase());
|
|
102
|
-
// Order by favoredIds
|
|
103
|
-
if (favoredIds.length > 0) {
|
|
104
|
-
regions = shared_1.Utils.sortByFieldFavor([...regions], 'id', favoredIds);
|
|
105
|
-
}
|
|
106
|
-
// Return the top items
|
|
107
|
-
return regions.slice(0, items);
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Get region's currency, current region's currency as default
|
|
111
|
-
* @param regionId Region id
|
|
112
|
-
* @returns Result
|
|
113
|
-
*/
|
|
114
|
-
regionCurrency(regionId) {
|
|
115
|
-
const region = (regionId
|
|
116
|
-
? this.regions().find((region) => region.id === regionId)
|
|
117
|
-
: null) ?? this.app.settings.currentRegion;
|
|
118
|
-
return region.currency;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Get local region by id
|
|
122
|
-
* @param id Region id
|
|
123
|
-
* @returns Result
|
|
124
|
-
*/
|
|
125
|
-
region(id) {
|
|
126
|
-
if (!id)
|
|
127
|
-
return this.app.defaultRegion;
|
|
128
|
-
return this.regions().find((region) => region.id === id);
|
|
129
|
-
}
|
|
130
|
-
regions(p) {
|
|
131
|
-
const items = p == null || p.length === 0
|
|
132
|
-
? AddressRegion_1.AddressRegion.all
|
|
133
|
-
: AddressRegion_1.AddressRegion.all.filter((ad) => p.includes(ad.id));
|
|
134
|
-
return items.map((region) => ({
|
|
135
|
-
...region,
|
|
136
|
-
label: this.app.getRegionLabel(region.id)
|
|
137
|
-
}));
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Get state list
|
|
141
|
-
* @param regionId Region id
|
|
142
|
-
* @param favoredIds Favored ids
|
|
143
|
-
* @param payload Payload
|
|
144
|
-
* @param culture Culture
|
|
145
|
-
* @returns Result
|
|
146
|
-
*/
|
|
147
|
-
async states(regionId, favoredIds = [], payload, culture) {
|
|
148
|
-
if (regionId === '')
|
|
149
|
-
return Promise.resolve(undefined);
|
|
150
|
-
payload ?? (payload = { defaultValue: [], showLoading: false });
|
|
151
|
-
culture ?? (culture = this.app.culture);
|
|
152
|
-
var items = await this.api.get(`Address/StateList?regionId=${regionId}&language=${culture}`, undefined, payload);
|
|
153
|
-
if (items == null || favoredIds.length === 0)
|
|
154
|
-
return items;
|
|
155
|
-
return shared_1.Utils.sortByFieldFavor(items, 'id', favoredIds);
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Get city list
|
|
159
|
-
* @param stateId State id
|
|
160
|
-
* @param favoredIds Favored ids
|
|
161
|
-
* @param payload Payload
|
|
162
|
-
* @param culture Culture
|
|
163
|
-
*
|
|
164
|
-
* @returns Result
|
|
165
|
-
*/
|
|
166
|
-
async cities(stateId, favoredIds = [], payload, culture) {
|
|
167
|
-
if (stateId === '')
|
|
168
|
-
return Promise.resolve(undefined);
|
|
169
|
-
payload ?? (payload = { defaultValue: [], showLoading: false });
|
|
170
|
-
culture ?? (culture = this.app.culture);
|
|
171
|
-
const items = await this.api.get(`Address/CityList?stateId=${stateId}&language=${culture}`, undefined, payload);
|
|
172
|
-
if (items == null || favoredIds.length === 0)
|
|
173
|
-
return items;
|
|
174
|
-
return shared_1.Utils.sortByFieldFavor(items, 'id', favoredIds);
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* Get district list
|
|
178
|
-
* @param cityId City id
|
|
179
|
-
* @param favoredIds Favored ids
|
|
180
|
-
* @param payload Payload
|
|
181
|
-
* @param culture Culture
|
|
182
|
-
* @returns Result
|
|
183
|
-
*/
|
|
184
|
-
async districts(cityId, favoredIds = [], payload, culture) {
|
|
185
|
-
if (cityId < 1)
|
|
186
|
-
return Promise.resolve(undefined);
|
|
187
|
-
payload ?? (payload = { defaultValue: [], showLoading: false });
|
|
188
|
-
culture ?? (culture = this.app.culture);
|
|
189
|
-
const items = await this.api.get(`Address/DistrictList?cityId=${cityId}&language=${culture}`, undefined, payload);
|
|
190
|
-
if (items == null || favoredIds.length === 0)
|
|
191
|
-
return items;
|
|
192
|
-
return shared_1.Utils.sortByFieldFavor(items, 'id', favoredIds);
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Get place details
|
|
196
|
-
* @param placeId Place id
|
|
197
|
-
* @param language Language
|
|
198
|
-
* @param payload Payload
|
|
199
|
-
* @returns Result
|
|
200
|
-
*/
|
|
201
|
-
GetPlaceDetails(placeId, language, payload) {
|
|
202
|
-
if (placeId === '')
|
|
203
|
-
return Promise.resolve(undefined);
|
|
204
|
-
language ?? (language = this.app.culture);
|
|
205
|
-
const url = `Address/GetPlaceDetails/${placeId}/${language}`;
|
|
206
|
-
return this.api.get(url, undefined, payload);
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Parse place
|
|
210
|
-
* @param rq Request data
|
|
211
|
-
* @param payload Payload
|
|
212
|
-
* @returns Result
|
|
213
|
-
*/
|
|
214
|
-
parsePlace(rq, payload) {
|
|
215
|
-
return this.api.post('Address/ParsePlace', rq, payload);
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* Place autocomplete
|
|
219
|
-
* @param rq Request data
|
|
220
|
-
* @param payload Payload
|
|
221
|
-
* @returns Result
|
|
222
|
-
*/
|
|
223
|
-
searchPlace(rq, payload) {
|
|
224
|
-
if (rq.query === '')
|
|
225
|
-
return Promise.resolve(undefined);
|
|
226
|
-
rq.language ?? (rq.language = this.app.culture);
|
|
227
|
-
return this.api.post('Address/SearchPlace', rq, payload);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
exports.AddressApi = AddressApi;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { IApiPayload } from '@etsoo/restclient';
|
|
2
|
-
import { ListType1 } from '@etsoo/shared';
|
|
3
|
-
import { IApp } from '../app/IApp';
|
|
4
|
-
import { EntityApi } from './EntityApi';
|
|
5
|
-
import { MemberListRQ } from './rq/MemberListRQ';
|
|
6
|
-
/**
|
|
7
|
-
* Member API
|
|
8
|
-
*/
|
|
9
|
-
export declare class MemberApi extends EntityApi {
|
|
10
|
-
/**
|
|
11
|
-
* Constructor
|
|
12
|
-
* @param app Application
|
|
13
|
-
*/
|
|
14
|
-
constructor(app: IApp);
|
|
15
|
-
/**
|
|
16
|
-
* List
|
|
17
|
-
* @param rq Request data
|
|
18
|
-
* @param payload Payload
|
|
19
|
-
* @returns Result
|
|
20
|
-
*/
|
|
21
|
-
list(rq: MemberListRQ, payload: IApiPayload<ListType1[]>): Promise<ListType1[] | undefined>;
|
|
22
|
-
}
|
package/lib/cjs/erp/MemberApi.js
DELETED
|
@@ -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;
|
package/lib/cjs/erp/OrgApi.d.ts
DELETED
|
@@ -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
|
-
}
|
package/lib/cjs/erp/OrgApi.js
DELETED
|
@@ -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
|
-
}
|