@etsoo/smarterp-core 1.0.0
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/.github/workflows/main.yml +60 -0
- package/LICENSE +21 -0
- package/README.md +17 -0
- package/__tests__/OrgApi.ts +132 -0
- package/__tests__/PublicApi.ts +130 -0
- package/__tests__/UserApi.ts +29 -0
- package/__tests__/app/TestApp.ts +138 -0
- package/__tests__/tsconfig.json +18 -0
- package/babel.config.json +11 -0
- package/lib/cjs/AppApi.d.ts +48 -0
- package/lib/cjs/AppApi.js +54 -0
- package/lib/cjs/CoreApp.d.ts +58 -0
- package/lib/cjs/CoreApp.js +68 -0
- package/lib/cjs/MemberApi.d.ts +38 -0
- package/lib/cjs/MemberApi.js +45 -0
- package/lib/cjs/OrgApi.d.ts +95 -0
- package/lib/cjs/OrgApi.js +110 -0
- package/lib/cjs/PublicApi.d.ts +105 -0
- package/lib/cjs/PublicApi.js +143 -0
- package/lib/cjs/UserApi.d.ts +53 -0
- package/lib/cjs/UserApi.js +68 -0
- package/lib/cjs/dto/IdentityType.d.ts +21 -0
- package/lib/cjs/dto/IdentityType.js +25 -0
- package/lib/cjs/dto/app/AppData.d.ts +31 -0
- package/lib/cjs/dto/app/AppData.js +2 -0
- package/lib/cjs/dto/app/AppListDto.d.ts +6 -0
- package/lib/cjs/dto/app/AppListDto.js +2 -0
- package/lib/cjs/dto/app/AppPurchasedQueryData.d.ts +28 -0
- package/lib/cjs/dto/app/AppPurchasedQueryData.js +2 -0
- package/lib/cjs/dto/app/AppQueryData.d.ts +42 -0
- package/lib/cjs/dto/app/AppQueryData.js +2 -0
- package/lib/cjs/dto/member/MemberListDto.d.ts +6 -0
- package/lib/cjs/dto/member/MemberListDto.js +2 -0
- package/lib/cjs/dto/member/MemberQueryDto.d.ts +35 -0
- package/lib/cjs/dto/member/MemberQueryDto.js +2 -0
- package/lib/cjs/dto/org/OrgGetMyData.d.ts +21 -0
- package/lib/cjs/dto/org/OrgGetMyData.js +2 -0
- package/lib/cjs/dto/org/OrgListDto.d.ts +6 -0
- package/lib/cjs/dto/org/OrgListDto.js +2 -0
- package/lib/cjs/dto/org/OrgQueryDto.d.ts +39 -0
- package/lib/cjs/dto/org/OrgQueryDto.js +2 -0
- package/lib/cjs/dto/org/OrgReadDto.d.ts +47 -0
- package/lib/cjs/dto/org/OrgReadDto.js +2 -0
- package/lib/cjs/dto/org/OrgUpdateReadDto.d.ts +39 -0
- package/lib/cjs/dto/org/OrgUpdateReadDto.js +2 -0
- package/lib/cjs/dto/public/CurrencyItem.d.ts +31 -0
- package/lib/cjs/dto/public/CurrencyItem.js +2 -0
- package/lib/cjs/dto/public/PlaceCommon.d.ts +43 -0
- package/lib/cjs/dto/public/PlaceCommon.js +2 -0
- package/lib/cjs/dto/public/PlaceLocation.d.ts +14 -0
- package/lib/cjs/dto/public/PlaceLocation.js +2 -0
- package/lib/cjs/dto/public/RegionData.d.ts +36 -0
- package/lib/cjs/dto/public/RegionData.js +2 -0
- package/lib/cjs/dto/user/AuditHistoryDto.d.ts +26 -0
- package/lib/cjs/dto/user/AuditHistoryDto.js +2 -0
- package/lib/cjs/dto/user/DeviceListDto.d.ts +8 -0
- package/lib/cjs/dto/user/DeviceListDto.js +2 -0
- package/lib/cjs/i18n/CoreCulture.d.ts +44 -0
- package/lib/cjs/i18n/CoreCulture.js +52 -0
- package/lib/cjs/i18n/en.json +40 -0
- package/lib/cjs/i18n/zh-Hans.json +40 -0
- package/lib/cjs/i18n/zh-Hant.json +40 -0
- package/lib/cjs/index.d.ts +39 -0
- package/lib/cjs/index.js +59 -0
- package/lib/cjs/rq/app/AppGetMyRQ.d.ts +19 -0
- package/lib/cjs/rq/app/AppGetMyRQ.js +2 -0
- package/lib/cjs/rq/app/AppListRQ.d.ts +18 -0
- package/lib/cjs/rq/app/AppListRQ.js +2 -0
- package/lib/cjs/rq/app/AppPurchasedQueryRQ.d.ts +17 -0
- package/lib/cjs/rq/app/AppPurchasedQueryRQ.js +2 -0
- package/lib/cjs/rq/app/AppQueryRQ.d.ts +6 -0
- package/lib/cjs/rq/app/AppQueryRQ.js +2 -0
- package/lib/cjs/rq/member/MemberListRQ.d.ts +18 -0
- package/lib/cjs/rq/member/MemberListRQ.js +2 -0
- package/lib/cjs/rq/member/MemberQueryRQ.d.ts +10 -0
- package/lib/cjs/rq/member/MemberQueryRQ.js +2 -0
- package/lib/cjs/rq/org/OrgCreateRQ.d.ts +37 -0
- package/lib/cjs/rq/org/OrgCreateRQ.js +2 -0
- package/lib/cjs/rq/org/OrgGetMyRQ.d.ts +11 -0
- package/lib/cjs/rq/org/OrgGetMyRQ.js +2 -0
- package/lib/cjs/rq/org/OrgListRQ.d.ts +12 -0
- package/lib/cjs/rq/org/OrgListRQ.js +2 -0
- package/lib/cjs/rq/org/OrgQueryRQ.d.ts +11 -0
- package/lib/cjs/rq/org/OrgQueryRQ.js +2 -0
- package/lib/cjs/rq/org/OrgUpdateRQ.d.ts +37 -0
- package/lib/cjs/rq/org/OrgUpdateRQ.js +2 -0
- package/lib/cjs/rq/public/CreateBarcodeRQ.d.ts +56 -0
- package/lib/cjs/rq/public/CreateBarcodeRQ.js +2 -0
- package/lib/cjs/rq/public/PinyinRQ.d.ts +38 -0
- package/lib/cjs/rq/public/PinyinRQ.js +21 -0
- package/lib/cjs/rq/public/PlaceQueryRQ.d.ts +58 -0
- package/lib/cjs/rq/public/PlaceQueryRQ.js +21 -0
- package/lib/cjs/rq/user/AuditHistoryRQ.d.ts +19 -0
- package/lib/cjs/rq/user/AuditHistoryRQ.js +2 -0
- package/lib/mjs/AppApi.d.ts +48 -0
- package/lib/mjs/AppApi.js +50 -0
- package/lib/mjs/CoreApp.d.ts +58 -0
- package/lib/mjs/CoreApp.js +64 -0
- package/lib/mjs/MemberApi.d.ts +38 -0
- package/lib/mjs/MemberApi.js +41 -0
- package/lib/mjs/OrgApi.d.ts +95 -0
- package/lib/mjs/OrgApi.js +106 -0
- package/lib/mjs/PublicApi.d.ts +105 -0
- package/lib/mjs/PublicApi.js +139 -0
- package/lib/mjs/UserApi.d.ts +53 -0
- package/lib/mjs/UserApi.js +64 -0
- package/lib/mjs/dto/IdentityType.d.ts +21 -0
- package/lib/mjs/dto/IdentityType.js +22 -0
- package/lib/mjs/dto/app/AppData.d.ts +31 -0
- package/lib/mjs/dto/app/AppData.js +1 -0
- package/lib/mjs/dto/app/AppListDto.d.ts +6 -0
- package/lib/mjs/dto/app/AppListDto.js +1 -0
- package/lib/mjs/dto/app/AppPurchasedQueryData.d.ts +28 -0
- package/lib/mjs/dto/app/AppPurchasedQueryData.js +1 -0
- package/lib/mjs/dto/app/AppQueryData.d.ts +42 -0
- package/lib/mjs/dto/app/AppQueryData.js +1 -0
- package/lib/mjs/dto/member/MemberListDto.d.ts +6 -0
- package/lib/mjs/dto/member/MemberListDto.js +1 -0
- package/lib/mjs/dto/member/MemberQueryDto.d.ts +35 -0
- package/lib/mjs/dto/member/MemberQueryDto.js +1 -0
- package/lib/mjs/dto/org/OrgGetMyData.d.ts +21 -0
- package/lib/mjs/dto/org/OrgGetMyData.js +1 -0
- package/lib/mjs/dto/org/OrgListDto.d.ts +6 -0
- package/lib/mjs/dto/org/OrgListDto.js +1 -0
- package/lib/mjs/dto/org/OrgQueryDto.d.ts +39 -0
- package/lib/mjs/dto/org/OrgQueryDto.js +1 -0
- package/lib/mjs/dto/org/OrgReadDto.d.ts +47 -0
- package/lib/mjs/dto/org/OrgReadDto.js +1 -0
- package/lib/mjs/dto/org/OrgUpdateReadDto.d.ts +39 -0
- package/lib/mjs/dto/org/OrgUpdateReadDto.js +1 -0
- package/lib/mjs/dto/public/CurrencyItem.d.ts +31 -0
- package/lib/mjs/dto/public/CurrencyItem.js +1 -0
- package/lib/mjs/dto/public/PlaceCommon.d.ts +43 -0
- package/lib/mjs/dto/public/PlaceCommon.js +1 -0
- package/lib/mjs/dto/public/PlaceLocation.d.ts +14 -0
- package/lib/mjs/dto/public/PlaceLocation.js +1 -0
- package/lib/mjs/dto/public/RegionData.d.ts +36 -0
- package/lib/mjs/dto/public/RegionData.js +1 -0
- package/lib/mjs/dto/user/AuditHistoryDto.d.ts +26 -0
- package/lib/mjs/dto/user/AuditHistoryDto.js +1 -0
- package/lib/mjs/dto/user/DeviceListDto.d.ts +8 -0
- package/lib/mjs/dto/user/DeviceListDto.js +1 -0
- package/lib/mjs/i18n/CoreCulture.d.ts +44 -0
- package/lib/mjs/i18n/CoreCulture.js +49 -0
- package/lib/mjs/i18n/en.json +40 -0
- package/lib/mjs/i18n/zh-Hans.json +40 -0
- package/lib/mjs/i18n/zh-Hant.json +40 -0
- package/lib/mjs/index.d.ts +39 -0
- package/lib/mjs/index.js +43 -0
- package/lib/mjs/rq/app/AppGetMyRQ.d.ts +19 -0
- package/lib/mjs/rq/app/AppGetMyRQ.js +1 -0
- package/lib/mjs/rq/app/AppListRQ.d.ts +18 -0
- package/lib/mjs/rq/app/AppListRQ.js +1 -0
- package/lib/mjs/rq/app/AppPurchasedQueryRQ.d.ts +17 -0
- package/lib/mjs/rq/app/AppPurchasedQueryRQ.js +1 -0
- package/lib/mjs/rq/app/AppQueryRQ.d.ts +6 -0
- package/lib/mjs/rq/app/AppQueryRQ.js +1 -0
- package/lib/mjs/rq/member/MemberListRQ.d.ts +18 -0
- package/lib/mjs/rq/member/MemberListRQ.js +1 -0
- package/lib/mjs/rq/member/MemberQueryRQ.d.ts +10 -0
- package/lib/mjs/rq/member/MemberQueryRQ.js +1 -0
- package/lib/mjs/rq/org/OrgCreateRQ.d.ts +37 -0
- package/lib/mjs/rq/org/OrgCreateRQ.js +1 -0
- package/lib/mjs/rq/org/OrgGetMyRQ.d.ts +11 -0
- package/lib/mjs/rq/org/OrgGetMyRQ.js +1 -0
- package/lib/mjs/rq/org/OrgListRQ.d.ts +12 -0
- package/lib/mjs/rq/org/OrgListRQ.js +1 -0
- package/lib/mjs/rq/org/OrgQueryRQ.d.ts +11 -0
- package/lib/mjs/rq/org/OrgQueryRQ.js +1 -0
- package/lib/mjs/rq/org/OrgUpdateRQ.d.ts +37 -0
- package/lib/mjs/rq/org/OrgUpdateRQ.js +1 -0
- package/lib/mjs/rq/public/CreateBarcodeRQ.d.ts +56 -0
- package/lib/mjs/rq/public/CreateBarcodeRQ.js +1 -0
- package/lib/mjs/rq/public/PinyinRQ.d.ts +38 -0
- package/lib/mjs/rq/public/PinyinRQ.js +18 -0
- package/lib/mjs/rq/public/PlaceQueryRQ.d.ts +58 -0
- package/lib/mjs/rq/public/PlaceQueryRQ.js +18 -0
- package/lib/mjs/rq/user/AuditHistoryRQ.d.ts +19 -0
- package/lib/mjs/rq/user/AuditHistoryRQ.js +1 -0
- package/package.json +75 -0
- package/src/AppApi.ts +66 -0
- package/src/CoreApp.ts +75 -0
- package/src/MemberApi.ts +51 -0
- package/src/OrgApi.ts +134 -0
- package/src/PublicApi.ts +183 -0
- package/src/UserApi.ts +77 -0
- package/src/dto/IdentityType.ts +23 -0
- package/src/dto/app/AppData.ts +35 -0
- package/src/dto/app/AppListDto.ts +7 -0
- package/src/dto/app/AppPurchasedQueryData.ts +32 -0
- package/src/dto/app/AppQueryData.ts +49 -0
- package/src/dto/member/MemberListDto.ts +7 -0
- package/src/dto/member/MemberQueryDto.ts +43 -0
- package/src/dto/org/OrgGetMyData.ts +23 -0
- package/src/dto/org/OrgListDto.ts +7 -0
- package/src/dto/org/OrgQueryDto.ts +47 -0
- package/src/dto/org/OrgReadDto.ts +57 -0
- package/src/dto/org/OrgUpdateReadDto.ts +47 -0
- package/src/dto/public/CurrencyItem.ts +35 -0
- package/src/dto/public/PlaceCommon.ts +52 -0
- package/src/dto/public/PlaceLocation.ts +15 -0
- package/src/dto/public/RegionData.ts +41 -0
- package/src/dto/user/AuditHistoryDto.ts +30 -0
- package/src/dto/user/DeviceListDto.ts +8 -0
- package/src/i18n/CoreCulture.ts +84 -0
- package/src/i18n/en.json +40 -0
- package/src/i18n/zh-Hans.json +40 -0
- package/src/i18n/zh-Hant.json +40 -0
- package/src/index.ts +54 -0
- package/src/rq/app/AppGetMyRQ.ts +21 -0
- package/src/rq/app/AppListRQ.ts +20 -0
- package/src/rq/app/AppPurchasedQueryRQ.ts +19 -0
- package/src/rq/app/AppQueryRQ.ts +7 -0
- package/src/rq/member/MemberListRQ.ts +21 -0
- package/src/rq/member/MemberQueryRQ.ts +11 -0
- package/src/rq/org/OrgCreateRQ.ts +43 -0
- package/src/rq/org/OrgGetMyRQ.ts +11 -0
- package/src/rq/org/OrgListRQ.ts +13 -0
- package/src/rq/org/OrgQueryRQ.ts +12 -0
- package/src/rq/org/OrgUpdateRQ.ts +43 -0
- package/src/rq/public/CreateBarcodeRQ.ts +65 -0
- package/src/rq/public/PinyinRQ.ts +43 -0
- package/src/rq/public/PlaceQueryRQ.ts +67 -0
- package/src/rq/user/AuditHistoryRQ.ts +22 -0
- package/tsconfig.cjs.json +19 -0
- package/tsconfig.json +19 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
2
|
+
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
|
|
3
|
+
# https://docs.github.com/en/actions/language-and-framework-guides/publishing-nodejs-packages
|
|
4
|
+
|
|
5
|
+
# Description
|
|
6
|
+
name: Node.js Package
|
|
7
|
+
|
|
8
|
+
# Event to trigger the action
|
|
9
|
+
on:
|
|
10
|
+
[push]
|
|
11
|
+
# release:
|
|
12
|
+
# types: [created]
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
# Publish to NPM
|
|
16
|
+
publish-npm:
|
|
17
|
+
# Condition: previous build is successful
|
|
18
|
+
# needs: Any previous jobs
|
|
19
|
+
|
|
20
|
+
# Operation system
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
|
|
23
|
+
steps:
|
|
24
|
+
# https://github.com/actions/checkout, This action checks-out your repository under $GITHUB_WORKSPACE
|
|
25
|
+
# so your workflow can access it.
|
|
26
|
+
- uses: actions/checkout@v4
|
|
27
|
+
|
|
28
|
+
# Set up your GitHub Actions workflow with a specific version of node.js
|
|
29
|
+
# Setup .npmrc file to publish to npm
|
|
30
|
+
- uses: actions/setup-node@v4
|
|
31
|
+
with:
|
|
32
|
+
node-version: "20.x"
|
|
33
|
+
registry-url: "https://registry.npmjs.org"
|
|
34
|
+
|
|
35
|
+
# Named after Continuous Integration, installs dependencies directly from package-lock.json
|
|
36
|
+
# ci vs install
|
|
37
|
+
- run: npm install
|
|
38
|
+
|
|
39
|
+
# Make sure pass the test without any exception
|
|
40
|
+
- run: npm test
|
|
41
|
+
|
|
42
|
+
# Build the package
|
|
43
|
+
- run: npm run build
|
|
44
|
+
|
|
45
|
+
# Check if the package is already published
|
|
46
|
+
- name: Check publish status
|
|
47
|
+
id: check
|
|
48
|
+
uses: tehpsalmist/npm-publish-status-action@v1
|
|
49
|
+
|
|
50
|
+
# Publish to npm
|
|
51
|
+
# For scoped package, make it public for free service
|
|
52
|
+
- name: Publish if necessary
|
|
53
|
+
id: publish
|
|
54
|
+
if: ${{ steps.check.outputs.exists == '0' }} # package version doesn't yet exist, ship it!
|
|
55
|
+
run: npm publish --access public
|
|
56
|
+
env:
|
|
57
|
+
NODE_AUTH_TOKEN: ${{ secrets.ETSOONpmToken }}
|
|
58
|
+
- name: Report publish status
|
|
59
|
+
if: ${{ steps.check.outputs.exists == '1' }}
|
|
60
|
+
run: 'echo "package version already exists on npm registry"'
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2004-2024 ETSOO ® (亿速思维 ®), https://etsoo.com, https://etsoo.nz
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { Utils } from "@etsoo/shared";
|
|
2
|
+
import { isLocalTest, TestApp } from "./app/TestApp";
|
|
3
|
+
import { EntityStatus } from "@etsoo/appscript";
|
|
4
|
+
import { OrgApi } from "../src/OrgApi";
|
|
5
|
+
import { OrgCreateRQ } from "../src/rq/org/OrgCreateRQ";
|
|
6
|
+
|
|
7
|
+
if (isLocalTest) {
|
|
8
|
+
const app = new TestApp();
|
|
9
|
+
app.changeCulture(app.settings.cultures[0]);
|
|
10
|
+
|
|
11
|
+
// Simulate logined
|
|
12
|
+
app.authorize(
|
|
13
|
+
"eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGVuYyNrdy1hZXMyNTYiLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIiwidHlwIjoiSldUIiwiY3R5IjoiSldUIn0.dtsirpxAaX-pHgFrSRp9bTEvkFkphcihoOC9Mj-hgNEY9fvgSrb4-NkaQxiw1KIIXdct_2wXeHe4-vcWOrkpABANtf6LHdJo.vk9wrjb6DIw0f9xLAj-3AQ.CwEV20n7LhwalIx3a3WDQkJjMAHW1Bn6VJGMjfckNVBZv0G_xcWZbo5Gg2CF4vdUjH6pqAH5IhuMmRqlkeCYwuF5d_rQVI_kLtmvgpAJoqYhU3-J_XqPrLpdWXPQ-V84lzngTAJlIX4On6JP_ZRTWLZDGxiiC1Tg_6GlWU3EUX2kcMBb03NWGczHaPS5-ivp4L9CntqaEOOK35cWQx6oZyp0KmwM6KjoY3ard5SLUofF10DqBwto6KqNAeZnLjBnJV_j9dX-si5FalrGrTV09KtjSMeXd7Rp3VfC5BRge5zSx5CecEzk_yt50GdYjvDRYj31whyVx0bVLKH9Pyz1OsHLDfolVpSRRIk-1UuaZz-5WfKcUrE6EWB-Mykn5Mxiyo7CxlhHOnEkUAJ5wdYGiRdVkk04HA8YdOxBRHUZzB44nrUVIWEYtWu8KddQTkWhYOCNc4OdCBweuiO_TEt2haxEsUmyuRZ0PgoVg-B8ZUXz0ot79GNQcd8ZYoaaap8WYhvMod8lw-e-HH7fABlCoAsIx8xt4aMGOD1iVgXFTnJ4qD9x5suZczHqj4BoeoKkgg1Lil_jG_3cADxIRPmReWqeOrrA6f54PjBd5kdSNNv72axxW3AfbZaOYQ-n7zzQjWUgKZnMnu4N2NXCkis8JvHCfVi3jgUO3jeGp6vVlPoaCbFXXMiKKL1bkhRXZT47uglPi4zD2tRqKOEzGMPpB4d0X_tZVt_lPRvbLFjUNUVikQGA3nD_9c5B5QfI4olFjA6H4eUN7b74R4HcVIr6hNBvDKGXeTJBmoopu4fGMAysCJ_ybUcJxWXldoy6nFTZjJ2QllbLLqdYuCvxYlTo3Z4nODna6NW18QcSXIIHj3U6H6VIDkXBnjArkvsgj_0uvqW_zyZNj_JIONAuwZYfDC6gsjbzV7llp53d3o3-xFhOBvxUibFTPvY39E-X_-crww6flp_tDyndlzBoVYMhybhnRLQy-PpO4dZQhzr2sdHpsF57Fj7SecXwbAtcQdKp.C6VZunr9ohscx6vVMVmRQnG37pWumGCHMLO0jJmLQXo"
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
const api = new OrgApi(app);
|
|
17
|
+
|
|
18
|
+
test("Test for create, delete", async () => {
|
|
19
|
+
const guid = Utils.newGUID().slice(0, 20);
|
|
20
|
+
const random = Date.now() % 2 == 0;
|
|
21
|
+
const rq: OrgCreateRQ = random
|
|
22
|
+
? {
|
|
23
|
+
name: `青岛亿速思维网络科技有限公司`,
|
|
24
|
+
brand: "亿速思维",
|
|
25
|
+
pin: guid
|
|
26
|
+
}
|
|
27
|
+
: {
|
|
28
|
+
name: `上海亿商网络科技有限公司`,
|
|
29
|
+
brand: "亿商",
|
|
30
|
+
pin: guid
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const result = await api.create(rq);
|
|
34
|
+
|
|
35
|
+
expect(result).not.toBeNull();
|
|
36
|
+
if (result == null) return;
|
|
37
|
+
|
|
38
|
+
const id = result.data?.id;
|
|
39
|
+
expect(id).toBeGreaterThan(0);
|
|
40
|
+
if (id == null) return;
|
|
41
|
+
|
|
42
|
+
// Update
|
|
43
|
+
const updateResult = await api.update({
|
|
44
|
+
id,
|
|
45
|
+
brand: "已更改",
|
|
46
|
+
changedFields: ["brand"]
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
expect(updateResult?.ok).toBeTruthy();
|
|
50
|
+
|
|
51
|
+
// Delete
|
|
52
|
+
const deleteResult = await api.delete(id);
|
|
53
|
+
|
|
54
|
+
expect(deleteResult?.ok).toBeTruthy();
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
test("Test for query zero return", async () => {
|
|
58
|
+
const result = await api.query({
|
|
59
|
+
keyword: "亿速",
|
|
60
|
+
enabled: true,
|
|
61
|
+
//id: 1001,
|
|
62
|
+
//ids: [1002, 1003, 1004],
|
|
63
|
+
status: EntityStatus.Approved,
|
|
64
|
+
excludedIds: [1, 2, 3],
|
|
65
|
+
queryPaging: {
|
|
66
|
+
keysets: ["青岛亿速", 1100],
|
|
67
|
+
batchSize: 5,
|
|
68
|
+
orderBy: [{ field: "name" }]
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
expect(result).not.toBeNull();
|
|
73
|
+
if (result == null) return;
|
|
74
|
+
expect(result.length).toBe(0);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
test("Test for query several returns", async () => {
|
|
78
|
+
const result = await api.query({
|
|
79
|
+
keyword: "亿速",
|
|
80
|
+
enabled: true,
|
|
81
|
+
excludedIds: [1, 2, 3],
|
|
82
|
+
queryPaging: {
|
|
83
|
+
keysets: ["青岛亿速", 1100],
|
|
84
|
+
batchSize: 5,
|
|
85
|
+
orderBy: [{ field: "name" }, { field: "id", desc: true, unique: true }]
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
expect(result).not.toBeNull();
|
|
90
|
+
if (result == null) return;
|
|
91
|
+
|
|
92
|
+
expect(result.length).toBeGreaterThan(0);
|
|
93
|
+
|
|
94
|
+
const first = result[0];
|
|
95
|
+
|
|
96
|
+
// Read for view
|
|
97
|
+
const readResult = await api.read(first.id);
|
|
98
|
+
expect(readResult?.ownerName).not.toBeNull();
|
|
99
|
+
expect(readResult?.name).toBe(first.name);
|
|
100
|
+
|
|
101
|
+
// Read for update
|
|
102
|
+
const updateReadResult = await api.updateRead(first.id);
|
|
103
|
+
expect(updateReadResult?.name).not.toBeNull();
|
|
104
|
+
expect(updateReadResult?.name).toBe(first.name);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
test("Test for list", async () => {
|
|
108
|
+
const result = await api.list({
|
|
109
|
+
keyword: "亿速",
|
|
110
|
+
enabled: true,
|
|
111
|
+
excludedIds: [1, 2, 3],
|
|
112
|
+
queryPaging: 2
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
expect(result).not.toBeNull();
|
|
116
|
+
if (result == null) return;
|
|
117
|
+
|
|
118
|
+
expect(result.length).toBeGreaterThan(0);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
test("Test for request token", async () => {
|
|
122
|
+
const result = await api.requestToken();
|
|
123
|
+
expect(result).not.toBeNull();
|
|
124
|
+
if (result == null) return;
|
|
125
|
+
|
|
126
|
+
expect(result.name).not.toBeNull();
|
|
127
|
+
});
|
|
128
|
+
} else {
|
|
129
|
+
test("Skip the test", () => {
|
|
130
|
+
expect(true).toBeTruthy();
|
|
131
|
+
});
|
|
132
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { isLocalTest, TestApp } from "./app/TestApp";
|
|
2
|
+
import { PublicApi } from "../src/PublicApi";
|
|
3
|
+
import { PinyinFormatType } from "../src/rq/public/PinyinRQ";
|
|
4
|
+
import { ApiProvider } from "../src/rq/public/PlaceQueryRQ";
|
|
5
|
+
|
|
6
|
+
const app = new TestApp();
|
|
7
|
+
app.changeCulture(app.settings.cultures[0]);
|
|
8
|
+
|
|
9
|
+
const api = new PublicApi(app);
|
|
10
|
+
|
|
11
|
+
test("Test for getCurrencyLabel", () => {
|
|
12
|
+
expect(api.getCurrencyLabel("USD")).toBe("美元");
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test("Test for getUnitLabel", () => {
|
|
16
|
+
expect(api.getUnitLabel(12, true)).toBe("每年");
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
test("Test for repeatOptions", () => {
|
|
20
|
+
const options = api.repeatOptions(["MONTH", "QUATER", "YEAR"]);
|
|
21
|
+
expect(options[2]).toStrictEqual({ id: 12, label: "每年" });
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
if (isLocalTest) {
|
|
25
|
+
test("Test for createBarcode", async () => {
|
|
26
|
+
const result = await api.createBarcode({
|
|
27
|
+
content: "123456789",
|
|
28
|
+
type: "CODE_128",
|
|
29
|
+
width: 200,
|
|
30
|
+
height: 80,
|
|
31
|
+
backgroundText: "#ff0000",
|
|
32
|
+
noPadding: true
|
|
33
|
+
});
|
|
34
|
+
expect(result?.startsWith("data:image/png;base64")).toBeTruthy();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test("Test for mobileQRCode", async () => {
|
|
38
|
+
const result = await api.mobileQRCode("123", "http://localhost");
|
|
39
|
+
expect(result?.startsWith("data:image/png;base64")).toBeTruthy();
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
test("Test for getCurrencies all", async () => {
|
|
43
|
+
const result = await api.getCurrencies();
|
|
44
|
+
|
|
45
|
+
expect(result).not.toBeNull();
|
|
46
|
+
if (result == null) return;
|
|
47
|
+
|
|
48
|
+
expect(result.length).toBeGreaterThan(20);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
test("Test for getCurrencies", async () => {
|
|
52
|
+
const result = await api.getCurrencies(["CNY", "USD", "NZD"]);
|
|
53
|
+
|
|
54
|
+
expect(result).not.toBeNull();
|
|
55
|
+
if (result == null) return;
|
|
56
|
+
|
|
57
|
+
expect(result.length).toBe(3);
|
|
58
|
+
expect(result[0].id).toBe("CNY");
|
|
59
|
+
expect(result[2].id).toBe("NZD");
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test("Test for getPinyin", async () => {
|
|
63
|
+
const input = "重庆爱好真好重";
|
|
64
|
+
const results = await Promise.all([
|
|
65
|
+
api.getPinyin({
|
|
66
|
+
input,
|
|
67
|
+
format: PinyinFormatType.Full
|
|
68
|
+
}),
|
|
69
|
+
api.getPinyin({
|
|
70
|
+
input,
|
|
71
|
+
format: PinyinFormatType.Tone
|
|
72
|
+
}),
|
|
73
|
+
api.getPinyin({
|
|
74
|
+
input,
|
|
75
|
+
format: PinyinFormatType.Initial
|
|
76
|
+
})
|
|
77
|
+
]);
|
|
78
|
+
expect(results[0]).toBe("Chong Qing Ai Hao Zhen Hao Zhong");
|
|
79
|
+
expect(results[1]).toBe("Chong2 Qing4 Ai4 Hao4 Zhen1 Hao3 Zhong4");
|
|
80
|
+
expect(results[2]).toBe("CQAHZHZ");
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
test("Test for getRegions", async () => {
|
|
84
|
+
const result = await api.getRegions(["CN", "US", "NZ"]);
|
|
85
|
+
|
|
86
|
+
expect(result).not.toBeNull();
|
|
87
|
+
if (result == null) return;
|
|
88
|
+
|
|
89
|
+
expect(result.length).toBe(3);
|
|
90
|
+
expect(result[0].id).toBe("CN");
|
|
91
|
+
expect(result[2].id).toBe("NZ");
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
test("Test for CN queryPlace", async () => {
|
|
95
|
+
const result = await api.queryPlace({
|
|
96
|
+
query: "山东省青岛李沧清溪路88号玫瑰庭院10号楼二单元501室",
|
|
97
|
+
region: "CN"
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
expect(result).not.toBeNull();
|
|
101
|
+
if (result == null) return;
|
|
102
|
+
|
|
103
|
+
const first = result.filter((x) => x.district === "李沧区")[0];
|
|
104
|
+
expect(first.region).toBe("CN");
|
|
105
|
+
expect(first.state).toBe("山东省");
|
|
106
|
+
expect(first.city).toBe("青岛市");
|
|
107
|
+
expect(first.formattedAddress).toBe(
|
|
108
|
+
"山东省青岛市李沧区清溪路88号玫瑰庭院10号楼二单元501室"
|
|
109
|
+
);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
test("Test for world queryPlace", async () => {
|
|
113
|
+
const result = await api.queryPlace({
|
|
114
|
+
query: "14A Cranbrook Place, Glendowie, Auckland 1071",
|
|
115
|
+
provider: ApiProvider.Google
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
expect(result).not.toBeNull();
|
|
119
|
+
if (result == null) return;
|
|
120
|
+
|
|
121
|
+
const first = result[0];
|
|
122
|
+
expect(first.region).toBe("NZ");
|
|
123
|
+
expect(first.state).toBe("Auckland");
|
|
124
|
+
expect(first.city).toBe("Auckland");
|
|
125
|
+
expect(first.district).toBe("Glendowie");
|
|
126
|
+
expect(first.formattedAddress).toBe(
|
|
127
|
+
"14A Cranbrook Place, Glendowie, Auckland 1071, New Zealand"
|
|
128
|
+
);
|
|
129
|
+
});
|
|
130
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { isLocalTest, TestApp } from "./app/TestApp";
|
|
2
|
+
import { UserApi } from "../src";
|
|
3
|
+
|
|
4
|
+
if (isLocalTest) {
|
|
5
|
+
const app = new TestApp();
|
|
6
|
+
app.changeCulture(app.settings.cultures[0]);
|
|
7
|
+
|
|
8
|
+
// Simulate logined
|
|
9
|
+
app.authorize(
|
|
10
|
+
"eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGVuYyNrdy1hZXMyNTYiLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIiwidHlwIjoiSldUIiwiY3R5IjoiSldUIn0.dtsirpxAaX-pHgFrSRp9bTEvkFkphcihoOC9Mj-hgNEY9fvgSrb4-NkaQxiw1KIIXdct_2wXeHe4-vcWOrkpABANtf6LHdJo.vk9wrjb6DIw0f9xLAj-3AQ.CwEV20n7LhwalIx3a3WDQkJjMAHW1Bn6VJGMjfckNVBZv0G_xcWZbo5Gg2CF4vdUjH6pqAH5IhuMmRqlkeCYwuF5d_rQVI_kLtmvgpAJoqYhU3-J_XqPrLpdWXPQ-V84lzngTAJlIX4On6JP_ZRTWLZDGxiiC1Tg_6GlWU3EUX2kcMBb03NWGczHaPS5-ivp4L9CntqaEOOK35cWQx6oZyp0KmwM6KjoY3ard5SLUofF10DqBwto6KqNAeZnLjBnJV_j9dX-si5FalrGrTV09KtjSMeXd7Rp3VfC5BRge5zSx5CecEzk_yt50GdYjvDRYj31whyVx0bVLKH9Pyz1OsHLDfolVpSRRIk-1UuaZz-5WfKcUrE6EWB-Mykn5Mxiyo7CxlhHOnEkUAJ5wdYGiRdVkk04HA8YdOxBRHUZzB44nrUVIWEYtWu8KddQTkWhYOCNc4OdCBweuiO_TEt2haxEsUmyuRZ0PgoVg-B8ZUXz0ot79GNQcd8ZYoaaap8WYhvMod8lw-e-HH7fABlCoAsIx8xt4aMGOD1iVgXFTnJ4qD9x5suZczHqj4BoeoKkgg1Lil_jG_3cADxIRPmReWqeOrrA6f54PjBd5kdSNNv72axxW3AfbZaOYQ-n7zzQjWUgKZnMnu4N2NXCkis8JvHCfVi3jgUO3jeGp6vVlPoaCbFXXMiKKL1bkhRXZT47uglPi4zD2tRqKOEzGMPpB4d0X_tZVt_lPRvbLFjUNUVikQGA3nD_9c5B5QfI4olFjA6H4eUN7b74R4HcVIr6hNBvDKGXeTJBmoopu4fGMAysCJ_ybUcJxWXldoy6nFTZjJ2QllbLLqdYuCvxYlTo3Z4nODna6NW18QcSXIIHj3U6H6VIDkXBnjArkvsgj_0uvqW_zyZNj_JIONAuwZYfDC6gsjbzV7llp53d3o3-xFhOBvxUibFTPvY39E-X_-crww6flp_tDyndlzBoVYMhybhnRLQy-PpO4dZQhzr2sdHpsF57Fj7SecXwbAtcQdKp.C6VZunr9ohscx6vVMVmRQnG37pWumGCHMLO0jJmLQXo"
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
const api = new UserApi(app);
|
|
14
|
+
|
|
15
|
+
test("Test for getCurrentApps", async () => {
|
|
16
|
+
const result = await api.getCurrentApps();
|
|
17
|
+
expect(result).not.toBeNull();
|
|
18
|
+
if (result == null) return;
|
|
19
|
+
|
|
20
|
+
const core = result.find((a) => a.id === 1);
|
|
21
|
+
expect(core).not.toBeNull();
|
|
22
|
+
|
|
23
|
+
expect(core?.name).toBe("司友云ERP主控制台");
|
|
24
|
+
});
|
|
25
|
+
} else {
|
|
26
|
+
test("Skip the test", () => {
|
|
27
|
+
expect(true).toBeTruthy();
|
|
28
|
+
});
|
|
29
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
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
|
+
ExternalSettings,
|
|
14
|
+
IAppSettings,
|
|
15
|
+
InitCallResultData,
|
|
16
|
+
IUser
|
|
17
|
+
} from "@etsoo/appscript";
|
|
18
|
+
import { DataTypes, DomUtils, Utils, WindowStorage } from "@etsoo/shared";
|
|
19
|
+
import { CoreCulture } from "../../src";
|
|
20
|
+
|
|
21
|
+
// Detected country or region
|
|
22
|
+
const { detectedCountry } = DomUtils;
|
|
23
|
+
|
|
24
|
+
// Detected culture
|
|
25
|
+
const { detectedCulture } = DomUtils;
|
|
26
|
+
|
|
27
|
+
// Supported cultures
|
|
28
|
+
const supportedCultures: DataTypes.CultureDefinition[] = [
|
|
29
|
+
CoreCulture.zhHans({}),
|
|
30
|
+
CoreCulture.en({})
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
// Supported regions
|
|
34
|
+
const supportedRegions = ["CN"];
|
|
35
|
+
|
|
36
|
+
// Class implementation for tests
|
|
37
|
+
class NotificationTest extends Notification<any, NotificationCallProps> {
|
|
38
|
+
render(props: NotificationRenderProps, className?: string, options?: any) {
|
|
39
|
+
throw new Error("Method not implemented.");
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
class NotificationContainerTest extends NotificationContainer<
|
|
44
|
+
any,
|
|
45
|
+
NotificationCallProps
|
|
46
|
+
> {
|
|
47
|
+
protected addRaw(
|
|
48
|
+
data: INotificaseBase<any, NotificationCallProps>
|
|
49
|
+
): INotification<any, NotificationCallProps> {
|
|
50
|
+
return new NotificationTest(data.type, data.content);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Container
|
|
55
|
+
var container = new NotificationContainerTest((update) => {});
|
|
56
|
+
|
|
57
|
+
// Is local test (integration test)
|
|
58
|
+
// Make sure your local environment is ready
|
|
59
|
+
export const isLocalTest = process.env.NODE_ENV === "local";
|
|
60
|
+
|
|
61
|
+
// Test application class
|
|
62
|
+
export class TestApp extends CoreApp<
|
|
63
|
+
IUser,
|
|
64
|
+
IAppSettings,
|
|
65
|
+
{},
|
|
66
|
+
NotificationCallProps
|
|
67
|
+
> {
|
|
68
|
+
/**
|
|
69
|
+
* Constructor
|
|
70
|
+
* @param settings Settings
|
|
71
|
+
* @param name Application name
|
|
72
|
+
*/
|
|
73
|
+
constructor() {
|
|
74
|
+
super(
|
|
75
|
+
ExternalSettings.format({
|
|
76
|
+
/**
|
|
77
|
+
* Endpoint of the API service
|
|
78
|
+
*/
|
|
79
|
+
endpoint: "http://{hostname}:9000/api/",
|
|
80
|
+
|
|
81
|
+
endpoints: {
|
|
82
|
+
core: {
|
|
83
|
+
endpoint: "https://{hostname}:9001/api/",
|
|
84
|
+
webUrl: ""
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* App root url
|
|
90
|
+
*/
|
|
91
|
+
homepage: "/cms",
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Web url of the cloud
|
|
95
|
+
*/
|
|
96
|
+
webUrl: "https://localhost",
|
|
97
|
+
|
|
98
|
+
// Detected culture
|
|
99
|
+
detectedCulture,
|
|
100
|
+
|
|
101
|
+
// Supported cultures
|
|
102
|
+
cultures: supportedCultures,
|
|
103
|
+
|
|
104
|
+
// Supported regions
|
|
105
|
+
regions: supportedRegions,
|
|
106
|
+
|
|
107
|
+
// Browser's time zone
|
|
108
|
+
timeZone: Utils.getTimeZone(),
|
|
109
|
+
|
|
110
|
+
// Current country or region
|
|
111
|
+
currentRegion: AddressUtils.getRegion(
|
|
112
|
+
supportedRegions,
|
|
113
|
+
detectedCountry,
|
|
114
|
+
detectedCulture
|
|
115
|
+
),
|
|
116
|
+
|
|
117
|
+
// Current culture
|
|
118
|
+
currentCulture: DomUtils.getCulture(
|
|
119
|
+
supportedCultures,
|
|
120
|
+
detectedCulture
|
|
121
|
+
)![0]
|
|
122
|
+
}),
|
|
123
|
+
createClient(),
|
|
124
|
+
container,
|
|
125
|
+
new WindowStorage(),
|
|
126
|
+
"SmartERP"
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
freshCountdownUI(callback?: () => PromiseLike<unknown>): void {
|
|
131
|
+
throw new Error("Method not implemented.");
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
initCallUpdateLocal(data: InitCallResultData, timestamp: number) {
|
|
135
|
+
this.initCallUpdate(data, timestamp);
|
|
136
|
+
return this.passphrase;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "Node10",
|
|
6
|
+
"allowJs": false,
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"esModuleInterop": true,
|
|
9
|
+
"allowSyntheticDefaultImports": true,
|
|
10
|
+
"strict": true,
|
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
"declaration": true
|
|
16
|
+
},
|
|
17
|
+
"include": [".."]
|
|
18
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { IApi, IApiPayload } from "@etsoo/restclient";
|
|
2
|
+
import { EntityApi, IApp } from "@etsoo/appscript";
|
|
3
|
+
import { AppGetMyRQ } from "./rq/app/AppGetMyRQ";
|
|
4
|
+
import { AppQueryData } from "./dto/app/AppQueryData";
|
|
5
|
+
import { AppListRQ } from "./rq/app/AppListRQ";
|
|
6
|
+
import { AppListDto } from "./dto/app/AppListDto";
|
|
7
|
+
import { AppQueryRQ } from "./rq/app/AppQueryRQ";
|
|
8
|
+
import { AppPurchasedQueryRQ } from "./rq/app/AppPurchasedQueryRQ";
|
|
9
|
+
import { AppPurchasedQueryData } from "./dto/app/AppPurchasedQueryData";
|
|
10
|
+
/**
|
|
11
|
+
* Application API
|
|
12
|
+
*/
|
|
13
|
+
export declare class AppApi extends EntityApi {
|
|
14
|
+
/**
|
|
15
|
+
* Constructor
|
|
16
|
+
* @param app Application
|
|
17
|
+
* @param api API
|
|
18
|
+
*/
|
|
19
|
+
constructor(app: IApp, api?: IApi);
|
|
20
|
+
/**
|
|
21
|
+
* Get user's latest accessed applications
|
|
22
|
+
* @param rq Request data
|
|
23
|
+
* @param payload Payload
|
|
24
|
+
* @returns Result
|
|
25
|
+
*/
|
|
26
|
+
getMy(rq: AppGetMyRQ, payload?: IApiPayload<AppQueryData[]>): Promise<AppQueryData[] | undefined>;
|
|
27
|
+
/**
|
|
28
|
+
* List
|
|
29
|
+
* @param rq Request data
|
|
30
|
+
* @param payload Payload
|
|
31
|
+
* @returns Result
|
|
32
|
+
*/
|
|
33
|
+
list(rq: AppListRQ, payload: IApiPayload<AppListDto[]>): Promise<AppListDto[] | undefined>;
|
|
34
|
+
/**
|
|
35
|
+
* Query
|
|
36
|
+
* @param rq Request data
|
|
37
|
+
* @param payload Payload
|
|
38
|
+
* @returns Result
|
|
39
|
+
*/
|
|
40
|
+
query(rq: AppQueryRQ, payload?: IApiPayload<AppQueryData[]>): Promise<AppQueryData[] | undefined>;
|
|
41
|
+
/**
|
|
42
|
+
* Query purchased applications JSON data
|
|
43
|
+
* @param rq Request data
|
|
44
|
+
* @param payload Payload
|
|
45
|
+
* @returns Result
|
|
46
|
+
*/
|
|
47
|
+
queryPurchased(rq: AppPurchasedQueryRQ, payload?: IApiPayload<AppPurchasedQueryData[]>): Promise<AppPurchasedQueryData[] | undefined>;
|
|
48
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppApi = void 0;
|
|
4
|
+
const appscript_1 = require("@etsoo/appscript");
|
|
5
|
+
/**
|
|
6
|
+
* Application API
|
|
7
|
+
*/
|
|
8
|
+
class AppApi extends appscript_1.EntityApi {
|
|
9
|
+
/**
|
|
10
|
+
* Constructor
|
|
11
|
+
* @param app Application
|
|
12
|
+
* @param api API
|
|
13
|
+
*/
|
|
14
|
+
constructor(app, api = app.api) {
|
|
15
|
+
super("App", app, api);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Get user's latest accessed applications
|
|
19
|
+
* @param rq Request data
|
|
20
|
+
* @param payload Payload
|
|
21
|
+
* @returns Result
|
|
22
|
+
*/
|
|
23
|
+
getMy(rq, payload) {
|
|
24
|
+
return this.api.post(`${this.flag}/GetMy`, rq, payload);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* List
|
|
28
|
+
* @param rq Request data
|
|
29
|
+
* @param payload Payload
|
|
30
|
+
* @returns Result
|
|
31
|
+
*/
|
|
32
|
+
list(rq, payload) {
|
|
33
|
+
return this.listBase(rq, payload);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Query
|
|
37
|
+
* @param rq Request data
|
|
38
|
+
* @param payload Payload
|
|
39
|
+
* @returns Result
|
|
40
|
+
*/
|
|
41
|
+
query(rq, payload) {
|
|
42
|
+
return this.queryBase(rq, payload);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Query purchased applications JSON data
|
|
46
|
+
* @param rq Request data
|
|
47
|
+
* @param payload Payload
|
|
48
|
+
* @returns Result
|
|
49
|
+
*/
|
|
50
|
+
queryPurchased(rq, payload) {
|
|
51
|
+
return this.queryBase(rq, payload);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.AppApi = AppApi;
|