@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/README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# AppScript
|
|
2
|
+
|
|
2
3
|
**TypeScript application scripts shared by different frameworks.**
|
|
3
4
|
|
|
4
5
|
## Installing
|
|
@@ -16,120 +17,145 @@ $ yarn add @etsoo/appscript
|
|
|
16
17
|
```
|
|
17
18
|
|
|
18
19
|
## Client data security framework
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
20
|
+
|
|
21
|
+
- CoreApp, constructor, reads deviceId from session storage
|
|
22
|
+
- restore, when deviceId is empty, try to restore from persisted storage, get the passphrase (encryption / decription) or remove all data keys
|
|
23
|
+
- initCall (everytime the application running), if passphrase is there, just return, otherwise read from serverside
|
|
24
|
+
- device updated will cause validataion failure. Please call initCall(undefined, true);
|
|
23
25
|
|
|
24
26
|
## Structure
|
|
25
27
|
|
|
26
28
|
### address - Address (region) related
|
|
27
29
|
|
|
28
|
-
#### AddressContinent.ts
|
|
29
|
-
|
|
30
|
+
#### AddressContinent.ts
|
|
31
|
+
|
|
32
|
+
- AddressContinent - Continent Enum
|
|
33
|
+
|
|
34
|
+
#### AddressRegion.ts
|
|
30
35
|
|
|
31
|
-
|
|
32
|
-
-
|
|
33
|
-
- AddressRegion - Address or region
|
|
36
|
+
- IAddressRegion - Country or region interface
|
|
37
|
+
- AddressRegion - Address or region
|
|
34
38
|
|
|
35
|
-
#### AddressUtils.ts
|
|
36
|
-
|
|
39
|
+
#### AddressUtils.ts
|
|
40
|
+
|
|
41
|
+
- getRegion - Get region from regions and detected region and language
|
|
37
42
|
|
|
38
43
|
### app - Application related
|
|
39
44
|
|
|
40
|
-
#### AppSettings.ts
|
|
41
|
-
|
|
45
|
+
#### AppSettings.ts
|
|
46
|
+
|
|
47
|
+
- IAppSettings - App settings interface
|
|
48
|
+
|
|
49
|
+
#### CoreApp.ts
|
|
42
50
|
|
|
43
|
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
- CoreApp - Core application
|
|
51
|
+
- IDetectIPCallback - Detect IP callback interface
|
|
52
|
+
- ICoreApp - Core application interface
|
|
53
|
+
- CoreApp - Core application
|
|
47
54
|
|
|
48
|
-
#### ExternalSettings.ts
|
|
49
|
-
- IExternalSettings - External settings items
|
|
50
|
-
- IExternalSettingsHost - External settings host passed by external script
|
|
55
|
+
#### ExternalSettings.ts
|
|
51
56
|
|
|
52
|
-
|
|
53
|
-
-
|
|
57
|
+
- IExternalSettings - External settings items
|
|
58
|
+
- IExternalSettingsHost - External settings host passed by external script
|
|
59
|
+
|
|
60
|
+
#### UserRole.ts
|
|
61
|
+
|
|
62
|
+
- Standard user roles
|
|
54
63
|
|
|
55
64
|
### bridges - Works with Electron
|
|
56
65
|
|
|
57
|
-
#### BridgeUtils.ts
|
|
58
|
-
|
|
66
|
+
#### BridgeUtils.ts
|
|
67
|
+
|
|
68
|
+
- BridgeUtils - Bridge utils
|
|
59
69
|
|
|
60
|
-
#### FlutterHost.ts
|
|
61
|
-
- FlutterHost - Flutter JavaScript Host
|
|
70
|
+
#### FlutterHost.ts
|
|
62
71
|
|
|
63
|
-
|
|
64
|
-
|
|
72
|
+
- FlutterHost - Flutter JavaScript Host
|
|
73
|
+
|
|
74
|
+
#### IBridgeHost.ts
|
|
75
|
+
|
|
76
|
+
- IBridgeHost - Bridge host interface
|
|
65
77
|
|
|
66
78
|
### business - Business logics
|
|
67
79
|
|
|
68
|
-
#### BusinessTax.ts
|
|
69
|
-
|
|
70
|
-
-
|
|
80
|
+
#### BusinessTax.ts
|
|
81
|
+
|
|
82
|
+
- IBusinessTax - Business tax interface
|
|
83
|
+
- BusinessTax - Business tax
|
|
71
84
|
|
|
72
|
-
#### BusinessUtils.ts
|
|
73
|
-
- getCurrencies - Get currency collection
|
|
74
|
-
- getEntityStatusLabel - Get entity status's label
|
|
75
|
-
- getEntityStatus - Get entity status collection
|
|
76
|
-
- getUnitLabel - Get product unit's label
|
|
77
|
-
- getUnits - Get all product units
|
|
78
|
-
- getRepeatOptions - Get all repeat options
|
|
85
|
+
#### BusinessUtils.ts
|
|
79
86
|
|
|
80
|
-
|
|
81
|
-
-
|
|
87
|
+
- getCurrencies - Get currency collection
|
|
88
|
+
- getEntityStatusLabel - Get entity status's label
|
|
89
|
+
- getEntityStatus - Get entity status collection
|
|
90
|
+
- getUnitLabel - Get product unit's label
|
|
91
|
+
- getUnits - Get all product units
|
|
92
|
+
- getRepeatOptions - Get all repeat options
|
|
82
93
|
|
|
83
|
-
####
|
|
84
|
-
- ProductUnit - Product units enum
|
|
94
|
+
#### EntityStatus.ts
|
|
85
95
|
|
|
86
|
-
|
|
87
|
-
|
|
96
|
+
- EntityStatus - Standard entity status enum
|
|
97
|
+
|
|
98
|
+
#### ProductUnit.ts
|
|
99
|
+
|
|
100
|
+
- ProductUnit - Product units enum
|
|
101
|
+
|
|
102
|
+
#### RepeatOption.ts
|
|
103
|
+
|
|
104
|
+
- RepeatOption - Repeat options
|
|
88
105
|
|
|
89
106
|
### custom - Custom dynamic component rendering
|
|
90
107
|
|
|
91
|
-
#### CustomFieldData.ts
|
|
92
|
-
|
|
93
|
-
-
|
|
108
|
+
#### CustomFieldData.ts
|
|
109
|
+
|
|
110
|
+
- CustomFieldSpace - Custom field space (12 columns)
|
|
111
|
+
- CustomFieldData - Custom field data
|
|
94
112
|
|
|
95
113
|
### def - Type definition
|
|
96
114
|
|
|
97
|
-
#### ListItem.ts
|
|
98
|
-
|
|
115
|
+
#### ListItem.ts
|
|
116
|
+
|
|
117
|
+
- ListItem - List item definition
|
|
99
118
|
|
|
100
119
|
### i18n - Multiple cultures
|
|
101
120
|
|
|
102
121
|
### result - API action result
|
|
103
122
|
|
|
104
|
-
#### ActionResult.ts
|
|
105
|
-
|
|
123
|
+
#### ActionResult.ts
|
|
124
|
+
|
|
125
|
+
- ActionResult - API call action result extends IActionResult
|
|
106
126
|
|
|
107
|
-
#### ActionResultError.ts
|
|
108
|
-
- ActionResultError - Action result to error type
|
|
127
|
+
#### ActionResultError.ts
|
|
109
128
|
|
|
110
|
-
|
|
111
|
-
- IResultData - Result data interface
|
|
112
|
-
- IdResultData - extends IResultData for 'id' included return data
|
|
113
|
-
- IResultErrors - Result errors interface
|
|
114
|
-
- IActionResult - Action result interface
|
|
115
|
-
- ActionResultId - Action result with id data
|
|
129
|
+
- ActionResultError - Action result to error type
|
|
116
130
|
|
|
117
|
-
####
|
|
118
|
-
|
|
119
|
-
-
|
|
131
|
+
#### IActionResult.ts
|
|
132
|
+
|
|
133
|
+
- IResultData - Result data interface
|
|
134
|
+
- IdResultData - extends IResultData for 'id' included return data
|
|
135
|
+
- IResultErrors - Result errors interface
|
|
136
|
+
- IActionResult - Action result interface
|
|
137
|
+
- ActionResultId - Action result with id data
|
|
138
|
+
|
|
139
|
+
#### InitCallResultData.ts
|
|
140
|
+
|
|
141
|
+
- InitCallResultData - Init call result data
|
|
142
|
+
- InitCallResult - Init call result
|
|
120
143
|
|
|
121
144
|
### erp - SmartERP APIs
|
|
122
145
|
|
|
123
146
|
### state - State management
|
|
124
147
|
|
|
125
|
-
#### Culture.ts
|
|
126
|
-
|
|
127
|
-
-
|
|
148
|
+
#### Culture.ts
|
|
149
|
+
|
|
150
|
+
- ICulture - Culture resources state, simple i18n solution
|
|
151
|
+
- ICultureGet - Culture get delegate
|
|
152
|
+
|
|
153
|
+
#### State.ts
|
|
154
|
+
|
|
155
|
+
- IState - state interface.
|
|
156
|
+
- IAction - state action interface
|
|
128
157
|
|
|
129
|
-
####
|
|
130
|
-
- IState - state interface.
|
|
131
|
-
- IAction - state action interface
|
|
158
|
+
#### User.ts
|
|
132
159
|
|
|
133
|
-
|
|
134
|
-
-
|
|
135
|
-
- IUser - extends IState for user state
|
|
160
|
+
- IUserData - User basic data.
|
|
161
|
+
- IUser - extends IState for user state
|
package/__tests__/app/CoreApp.ts
CHANGED
|
@@ -1,174 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
NotificationCallProps,
|
|
6
|
-
NotificationContainer,
|
|
7
|
-
NotificationRenderProps
|
|
8
|
-
} from '@etsoo/notificationbase';
|
|
9
|
-
import {
|
|
10
|
-
ApiAuthorizationScheme,
|
|
11
|
-
ApiDataError,
|
|
12
|
-
ApiMethod,
|
|
13
|
-
createClient
|
|
14
|
-
} from '@etsoo/restclient';
|
|
15
|
-
import {
|
|
16
|
-
DataTypes,
|
|
17
|
-
DomUtils,
|
|
18
|
-
IActionResult,
|
|
19
|
-
Utils,
|
|
20
|
-
WindowStorage
|
|
21
|
-
} from '@etsoo/shared';
|
|
22
|
-
import {
|
|
23
|
-
AddressApi,
|
|
24
|
-
en,
|
|
25
|
-
EntityStatus,
|
|
26
|
-
ExternalSettings,
|
|
27
|
-
IUser,
|
|
28
|
-
OrgApi,
|
|
29
|
-
PublicApi,
|
|
30
|
-
UserRole,
|
|
31
|
-
zhHans
|
|
32
|
-
} from '../../src';
|
|
33
|
-
import { AddressUtils } from '../../src/address/AddressUtils';
|
|
34
|
-
import { IAppSettings } from '../../src/app/AppSettings';
|
|
35
|
-
import { CoreApp } from '../../src/app/CoreApp';
|
|
36
|
-
import { InitCallResultData } from '../../src/result/InitCallResult';
|
|
37
|
-
|
|
38
|
-
// Detected country or region
|
|
39
|
-
const { detectedCountry } = DomUtils;
|
|
40
|
-
|
|
41
|
-
// Detected culture
|
|
42
|
-
const { detectedCulture } = DomUtils;
|
|
43
|
-
|
|
44
|
-
// Supported cultures
|
|
45
|
-
const supportedCultures: DataTypes.CultureDefinition[] = [zhHans({}), en({})];
|
|
46
|
-
|
|
47
|
-
// Supported regions
|
|
48
|
-
const supportedRegions = ['CN'];
|
|
49
|
-
|
|
50
|
-
// Class implementation for tests
|
|
51
|
-
class NotificationTest extends Notification<any, NotificationCallProps> {
|
|
52
|
-
render(props: NotificationRenderProps, className?: string, options?: any) {
|
|
53
|
-
throw new Error('Method not implemented.');
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
class NotificationContainerTest extends NotificationContainer<
|
|
58
|
-
any,
|
|
59
|
-
NotificationCallProps
|
|
60
|
-
> {
|
|
61
|
-
protected addRaw(
|
|
62
|
-
data: INotificaseBase<any, NotificationCallProps>
|
|
63
|
-
): INotification<any, NotificationCallProps> {
|
|
64
|
-
return new NotificationTest(data.type, data.content);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// Container
|
|
69
|
-
var container = new NotificationContainerTest((update) => {});
|
|
1
|
+
import { ApiDataError, ApiMethod } from '@etsoo/restclient';
|
|
2
|
+
import { DataTypes, IActionResult } from '@etsoo/shared';
|
|
3
|
+
import { EntityStatus, UserRole } from '../../src';
|
|
4
|
+
import { TestApp } from './TestApp';
|
|
70
5
|
|
|
71
6
|
// Arrange
|
|
72
|
-
class CoreAppTest extends CoreApp<
|
|
73
|
-
IUser,
|
|
74
|
-
IAppSettings,
|
|
75
|
-
{},
|
|
76
|
-
NotificationCallProps
|
|
77
|
-
> {
|
|
78
|
-
/**
|
|
79
|
-
* Constructor
|
|
80
|
-
* @param settings Settings
|
|
81
|
-
* @param name Application name
|
|
82
|
-
*/
|
|
83
|
-
constructor() {
|
|
84
|
-
super(
|
|
85
|
-
ExternalSettings.format({
|
|
86
|
-
/**
|
|
87
|
-
* Endpoint of the API service
|
|
88
|
-
*/
|
|
89
|
-
endpoint: 'http://{hostname}/com.etsoo.SmartERPApi/api/',
|
|
90
|
-
|
|
91
|
-
endpoints: {
|
|
92
|
-
core: {
|
|
93
|
-
endpoint: 'http://{hostname}:9001/api/',
|
|
94
|
-
webUrl: ''
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* App root url
|
|
100
|
-
*/
|
|
101
|
-
homepage: '/cms',
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Web url of the cloud
|
|
105
|
-
*/
|
|
106
|
-
webUrl: 'http://localhost',
|
|
107
|
-
|
|
108
|
-
// Detected culture
|
|
109
|
-
detectedCulture,
|
|
110
|
-
|
|
111
|
-
// Supported cultures
|
|
112
|
-
cultures: supportedCultures,
|
|
113
|
-
|
|
114
|
-
// Supported regions
|
|
115
|
-
regions: supportedRegions,
|
|
116
|
-
|
|
117
|
-
// Browser's time zone
|
|
118
|
-
timeZone: Utils.getTimeZone(),
|
|
119
|
-
|
|
120
|
-
// Current country or region
|
|
121
|
-
currentRegion: AddressUtils.getRegion(
|
|
122
|
-
supportedRegions,
|
|
123
|
-
detectedCountry,
|
|
124
|
-
detectedCulture
|
|
125
|
-
),
|
|
126
|
-
|
|
127
|
-
// Current culture
|
|
128
|
-
currentCulture: DomUtils.getCulture(
|
|
129
|
-
supportedCultures,
|
|
130
|
-
detectedCulture
|
|
131
|
-
)![0]
|
|
132
|
-
}),
|
|
133
|
-
createClient(),
|
|
134
|
-
container,
|
|
135
|
-
new WindowStorage(),
|
|
136
|
-
'SmartERP'
|
|
137
|
-
);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
freshCountdownUI(callback?: () => PromiseLike<unknown>): void {
|
|
141
|
-
throw new Error('Method not implemented.');
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
initCallUpdateLocal(data: InitCallResultData, timestamp: number) {
|
|
145
|
-
this.initCallUpdate(data, timestamp);
|
|
146
|
-
return this.passphrase;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
7
|
// Mixins example
|
|
151
|
-
function EnhanceApp<TBase extends DataTypes.MConstructor<
|
|
8
|
+
function EnhanceApp<TBase extends DataTypes.MConstructor<TestApp>>(
|
|
152
9
|
Base: TBase
|
|
153
10
|
) {
|
|
154
|
-
return class extends Base {
|
|
155
|
-
readonly addressApi = new AddressApi(this);
|
|
156
|
-
readonly publicApi = new PublicApi(this);
|
|
157
|
-
readonly orgApi = new OrgApi(this);
|
|
158
|
-
};
|
|
11
|
+
return class extends Base {};
|
|
159
12
|
}
|
|
160
13
|
|
|
161
|
-
const appClass = EnhanceApp(
|
|
14
|
+
const appClass = EnhanceApp(TestApp);
|
|
162
15
|
const app = new appClass();
|
|
163
16
|
app.changeCulture(app.settings.cultures[0]);
|
|
164
17
|
|
|
165
18
|
test('Test for domain replacement', () => {
|
|
166
|
-
expect(app.settings.endpoint).toBe(
|
|
167
|
-
'http://localhost/com.etsoo.SmartERPApi/api/'
|
|
168
|
-
);
|
|
19
|
+
expect(app.settings.endpoint).toBe('http://localhost:9000/api/');
|
|
169
20
|
|
|
170
21
|
expect(app.settings.endpoints?.core.endpoint).toBe(
|
|
171
|
-
'
|
|
22
|
+
'https://localhost:9001/api/'
|
|
172
23
|
);
|
|
173
24
|
});
|
|
174
25
|
|
|
@@ -335,121 +186,3 @@ test('Tests for isValidPassword', () => {
|
|
|
335
186
|
expect(app.isValidPassword('abcd3')).toBeFalsy();
|
|
336
187
|
expect(app.isValidPassword('1234abcd')).toBeTruthy();
|
|
337
188
|
});
|
|
338
|
-
|
|
339
|
-
test('Tests for addressApi', async () => {
|
|
340
|
-
const regions = app.addressApi.regions();
|
|
341
|
-
const cn = regions.find((r) => r.id === 'CN');
|
|
342
|
-
expect(cn?.label).toBe('中国大陆');
|
|
343
|
-
|
|
344
|
-
const favoredRegions = app.addressApi.regions(['US', 'CA']);
|
|
345
|
-
expect(favoredRegions.length).toBe(2);
|
|
346
|
-
expect(favoredRegions.find((region) => region.id === 'US')?.label).toBe(
|
|
347
|
-
'美国'
|
|
348
|
-
);
|
|
349
|
-
|
|
350
|
-
const region = app.addressApi.region('US');
|
|
351
|
-
expect(region?.label).toBe('美国');
|
|
352
|
-
const regionFailed = app.addressApi.region('ABC');
|
|
353
|
-
expect(regionFailed).toBeUndefined();
|
|
354
|
-
|
|
355
|
-
/*
|
|
356
|
-
const results1 = await app.addressApi.autocomplete({
|
|
357
|
-
query: '青岛市玫瑰庭院',
|
|
358
|
-
region: 'CN',
|
|
359
|
-
language: 'zh-CN'
|
|
360
|
-
});
|
|
361
|
-
|
|
362
|
-
const results2 = await app.addressApi.autocomplete({
|
|
363
|
-
query: '青岛市玫瑰庭院',
|
|
364
|
-
language: 'zh-CN'
|
|
365
|
-
});
|
|
366
|
-
|
|
367
|
-
const results1 = await app.addressApi.searchPlace({
|
|
368
|
-
query: '青岛市玫瑰庭院',
|
|
369
|
-
region: 'CN',
|
|
370
|
-
language: 'zh-CN'
|
|
371
|
-
});
|
|
372
|
-
|
|
373
|
-
const result = await app.addressApi.parsePlace({
|
|
374
|
-
city: '青岛',
|
|
375
|
-
district: '市南'
|
|
376
|
-
});
|
|
377
|
-
|
|
378
|
-
const result = await app.addressApi.GetPlaceDetails(
|
|
379
|
-
'ChIJczySyo1qljUR1Jnq4Uqak2I',
|
|
380
|
-
'zh-CN'
|
|
381
|
-
);
|
|
382
|
-
|
|
383
|
-
const results2 = await app.addressApi.searchPlace({
|
|
384
|
-
query: '青岛市玫瑰庭院',
|
|
385
|
-
language: 'zh-CN'
|
|
386
|
-
});
|
|
387
|
-
|
|
388
|
-
const cities = await app.addressApi.cities('CNHN');
|
|
389
|
-
console.log(cities);
|
|
390
|
-
|
|
391
|
-
const districts = await app.addressApi.districts(1181);
|
|
392
|
-
console.log(districts);
|
|
393
|
-
*/
|
|
394
|
-
});
|
|
395
|
-
|
|
396
|
-
/*
|
|
397
|
-
test('Tests for addressApi Async', async () => {
|
|
398
|
-
const regions = await app.addressApi.getRegions({
|
|
399
|
-
items: 3,
|
|
400
|
-
favoredIds: ['US', 'AU', 'CA', 'NZ']
|
|
401
|
-
});
|
|
402
|
-
expect(regions?.length).toBe(3);
|
|
403
|
-
expect(regions![2].id).toBe('CA');
|
|
404
|
-
});
|
|
405
|
-
*/
|
|
406
|
-
|
|
407
|
-
test('Tests for addressApi.continents', () => {
|
|
408
|
-
const continents1 = app.addressApi.continents();
|
|
409
|
-
const continents2 = app.addressApi.continents(true, true);
|
|
410
|
-
expect(continents1.length).toBe(6);
|
|
411
|
-
expect(continents1.some((item) => item.id === 'AN')).toBeFalsy();
|
|
412
|
-
expect(continents2.length).toBe(7);
|
|
413
|
-
expect(continents2[0].id).toBe(1);
|
|
414
|
-
});
|
|
415
|
-
|
|
416
|
-
test('Tests for publicApi', async () => {
|
|
417
|
-
expect(app.publicApi.getUnitLabel(12, true)).toBe('每年');
|
|
418
|
-
|
|
419
|
-
const options = app.publicApi.repeatOptions(['MONTH', 'QUATER', 'YEAR']);
|
|
420
|
-
expect(options[2]).toStrictEqual({ id: 12, label: '每年' });
|
|
421
|
-
|
|
422
|
-
const currencies = app.publicApi.currencies(['NZD', 'AUD', 'USD']);
|
|
423
|
-
expect(currencies.length).toBe(3);
|
|
424
|
-
expect(currencies[1].id).toBe('AUD');
|
|
425
|
-
|
|
426
|
-
const currencies1 = app.publicApi.currencies(true);
|
|
427
|
-
expect(currencies1.length >= 10).toBeTruthy();
|
|
428
|
-
|
|
429
|
-
expect(app.publicApi.getCurrencyLabel('USD')).toBe('美元');
|
|
430
|
-
|
|
431
|
-
const defaultExchangeRate = await app.publicApi.exchangeRate('CNY', {
|
|
432
|
-
showLoading: false
|
|
433
|
-
});
|
|
434
|
-
expect(defaultExchangeRate?.exchangeRate).toBe(100);
|
|
435
|
-
|
|
436
|
-
const url = app.publicApi.getOrgAvatar(1);
|
|
437
|
-
expect(url).toBe(
|
|
438
|
-
'http://localhost/com.etsoo.SmartERPApi/api/Storage/OrgAvatar/1'
|
|
439
|
-
);
|
|
440
|
-
|
|
441
|
-
/*
|
|
442
|
-
const amount1 = await app.publicApi.exchangeAmount(1000, 'NZD', 'CNY');
|
|
443
|
-
const amount2 = await app.publicApi.exchangeAmount(100, 'NZD', 'USD');
|
|
444
|
-
console.log(amount1, amount2);
|
|
445
|
-
|
|
446
|
-
const orgs = await app.orgApi.list();
|
|
447
|
-
console.log(orgs);
|
|
448
|
-
|
|
449
|
-
const orgsQuery = await app.orgApi.query({ currentPage: 1, batchSize: 2 });
|
|
450
|
-
console.log(orgsQuery);
|
|
451
|
-
|
|
452
|
-
const cultures = await app.publicApi.supportedCultures();
|
|
453
|
-
expect(cultures?.some((culture) => culture.id === 'zh-Hans')).toBeTruthy();
|
|
454
|
-
*/
|
|
455
|
-
});
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import {
|
|
2
|
+
INotificaseBase,
|
|
3
|
+
INotification,
|
|
4
|
+
Notification,
|
|
5
|
+
NotificationCallProps,
|
|
6
|
+
NotificationContainer,
|
|
7
|
+
NotificationRenderProps
|
|
8
|
+
} from '@etsoo/notificationbase';
|
|
9
|
+
import {
|
|
10
|
+
AddressUtils,
|
|
11
|
+
CoreApp,
|
|
12
|
+
createClient,
|
|
13
|
+
en,
|
|
14
|
+
ExternalSettings,
|
|
15
|
+
IAppSettings,
|
|
16
|
+
InitCallResultData,
|
|
17
|
+
IUser,
|
|
18
|
+
zhHans
|
|
19
|
+
} from '../../src';
|
|
20
|
+
import { DataTypes, DomUtils, Utils, WindowStorage } from '@etsoo/shared';
|
|
21
|
+
|
|
22
|
+
// Detected country or region
|
|
23
|
+
const { detectedCountry } = DomUtils;
|
|
24
|
+
|
|
25
|
+
// Detected culture
|
|
26
|
+
const { detectedCulture } = DomUtils;
|
|
27
|
+
|
|
28
|
+
// Supported cultures
|
|
29
|
+
const supportedCultures: DataTypes.CultureDefinition[] = [zhHans({}), en({})];
|
|
30
|
+
|
|
31
|
+
// Supported regions
|
|
32
|
+
const supportedRegions = ['CN'];
|
|
33
|
+
|
|
34
|
+
// Class implementation for tests
|
|
35
|
+
class NotificationTest extends Notification<any, NotificationCallProps> {
|
|
36
|
+
render(props: NotificationRenderProps, className?: string, options?: any) {
|
|
37
|
+
throw new Error('Method not implemented.');
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
class NotificationContainerTest extends NotificationContainer<
|
|
42
|
+
any,
|
|
43
|
+
NotificationCallProps
|
|
44
|
+
> {
|
|
45
|
+
protected addRaw(
|
|
46
|
+
data: INotificaseBase<any, NotificationCallProps>
|
|
47
|
+
): INotification<any, NotificationCallProps> {
|
|
48
|
+
return new NotificationTest(data.type, data.content);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Container
|
|
53
|
+
var container = new NotificationContainerTest((update) => {});
|
|
54
|
+
|
|
55
|
+
// Is local test (integration test)
|
|
56
|
+
// Make sure your local environment is ready
|
|
57
|
+
export const isLocalTest = process.env.NODE_ENV === 'local';
|
|
58
|
+
|
|
59
|
+
// Test application class
|
|
60
|
+
export class TestApp extends CoreApp<
|
|
61
|
+
IUser,
|
|
62
|
+
IAppSettings,
|
|
63
|
+
{},
|
|
64
|
+
NotificationCallProps
|
|
65
|
+
> {
|
|
66
|
+
/**
|
|
67
|
+
* Constructor
|
|
68
|
+
* @param settings Settings
|
|
69
|
+
* @param name Application name
|
|
70
|
+
*/
|
|
71
|
+
constructor() {
|
|
72
|
+
super(
|
|
73
|
+
ExternalSettings.format({
|
|
74
|
+
/**
|
|
75
|
+
* Endpoint of the API service
|
|
76
|
+
*/
|
|
77
|
+
endpoint: 'http://{hostname}:9000/api/',
|
|
78
|
+
|
|
79
|
+
endpoints: {
|
|
80
|
+
core: {
|
|
81
|
+
endpoint: 'https://{hostname}:9001/api/',
|
|
82
|
+
webUrl: ''
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* App root url
|
|
88
|
+
*/
|
|
89
|
+
homepage: '/cms',
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Web url of the cloud
|
|
93
|
+
*/
|
|
94
|
+
webUrl: 'https://localhost',
|
|
95
|
+
|
|
96
|
+
// Detected culture
|
|
97
|
+
detectedCulture,
|
|
98
|
+
|
|
99
|
+
// Supported cultures
|
|
100
|
+
cultures: supportedCultures,
|
|
101
|
+
|
|
102
|
+
// Supported regions
|
|
103
|
+
regions: supportedRegions,
|
|
104
|
+
|
|
105
|
+
// Browser's time zone
|
|
106
|
+
timeZone: Utils.getTimeZone(),
|
|
107
|
+
|
|
108
|
+
// Current country or region
|
|
109
|
+
currentRegion: AddressUtils.getRegion(
|
|
110
|
+
supportedRegions,
|
|
111
|
+
detectedCountry,
|
|
112
|
+
detectedCulture
|
|
113
|
+
),
|
|
114
|
+
|
|
115
|
+
// Current culture
|
|
116
|
+
currentCulture: DomUtils.getCulture(
|
|
117
|
+
supportedCultures,
|
|
118
|
+
detectedCulture
|
|
119
|
+
)![0]
|
|
120
|
+
}),
|
|
121
|
+
createClient(),
|
|
122
|
+
container,
|
|
123
|
+
new WindowStorage(),
|
|
124
|
+
'SmartERP'
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
freshCountdownUI(callback?: () => PromiseLike<unknown>): void {
|
|
129
|
+
throw new Error('Method not implemented.');
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
initCallUpdateLocal(data: InitCallResultData, timestamp: number) {
|
|
133
|
+
this.initCallUpdate(data, timestamp);
|
|
134
|
+
return this.passphrase;
|
|
135
|
+
}
|
|
136
|
+
}
|
package/babel.config.json
CHANGED