@etsoo/smarterp-core 1.0.25 → 1.0.27
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/LICENSE +1 -1
- package/__tests__/OrgApi.ts +0 -1
- package/__tests__/PublicApi.ts +0 -1
- package/lib/cjs/CoreApp.d.ts +2 -3
- package/lib/cjs/CoreApp.js +2 -3
- package/lib/cjs/components/app/AppSwitchPopover.js +2 -2
- package/lib/cjs/dto/app/AppQueryData.d.ts +1 -1
- package/lib/cjs/dto/app/AppReadDto.d.ts +1 -2
- package/lib/cjs/dto/member/MemberReadDto.d.ts +1 -2
- package/lib/cjs/i18n/en.json +1 -0
- package/lib/cjs/i18n/zh-Hans.json +1 -0
- package/lib/cjs/i18n/zh-Hant.json +1 -0
- package/lib/cjs/index.d.ts +0 -1
- package/lib/cjs/index.js +0 -1
- package/lib/cjs/rq/app/AppGetMyRQ.d.ts +1 -1
- package/lib/cjs/rq/app/AppListRQ.d.ts +1 -2
- package/lib/mjs/CoreApp.d.ts +2 -3
- package/lib/mjs/CoreApp.js +1 -2
- package/lib/mjs/components/app/AppSwitchPopover.js +1 -1
- package/lib/mjs/dto/app/AppQueryData.d.ts +1 -1
- package/lib/mjs/dto/app/AppReadDto.d.ts +1 -2
- package/lib/mjs/dto/member/MemberReadDto.d.ts +1 -2
- package/lib/mjs/i18n/en.json +1 -0
- package/lib/mjs/i18n/zh-Hans.json +1 -0
- package/lib/mjs/i18n/zh-Hant.json +1 -0
- package/lib/mjs/index.d.ts +0 -1
- package/lib/mjs/index.js +0 -1
- package/lib/mjs/rq/app/AppGetMyRQ.d.ts +1 -1
- package/lib/mjs/rq/app/AppListRQ.d.ts +1 -2
- package/package.json +10 -10
- package/src/CoreApp.ts +7 -3
- package/src/components/app/AppSwitchPopover.tsx +1 -2
- package/src/dto/app/AppQueryData.ts +1 -1
- package/src/dto/app/AppReadDto.ts +1 -2
- package/src/dto/member/MemberReadDto.ts +1 -2
- package/src/i18n/en.json +1 -0
- package/src/i18n/zh-Hans.json +1 -0
- package/src/i18n/zh-Hant.json +1 -0
- package/src/index.ts +0 -2
- package/src/rq/app/AppGetMyRQ.ts +1 -1
- package/src/rq/app/AppListRQ.ts +1 -2
- package/lib/cjs/dto/IdentityType.d.ts +0 -21
- package/lib/cjs/dto/IdentityType.js +0 -25
- package/lib/mjs/dto/IdentityType.d.ts +0 -21
- package/lib/mjs/dto/IdentityType.js +0 -22
- package/src/dto/IdentityType.ts +0 -23
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2004-
|
|
3
|
+
Copyright (c) 2004-2025 ETSOO ® (亿速思维 ®), https://etsoo.com, https://etsoo.nz
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/__tests__/OrgApi.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { isLocalTest, TestApp } from "./app/TestApp";
|
|
|
3
3
|
import { EntityStatus } from "@etsoo/appscript";
|
|
4
4
|
import { OrgApi } from "../src/OrgApi";
|
|
5
5
|
import { OrgCreateRQ } from "../src/rq/org/OrgCreateRQ";
|
|
6
|
-
import { OrgUpdateRQ } from "../src";
|
|
7
6
|
|
|
8
7
|
if (isLocalTest) {
|
|
9
8
|
const app = new TestApp();
|
package/__tests__/PublicApi.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { isLocalTest, TestApp } from "./app/TestApp";
|
|
|
2
2
|
import { PublicApi } from "../src/PublicApi";
|
|
3
3
|
import { PinyinFormatType } from "../src/rq/public/PinyinRQ";
|
|
4
4
|
import { ApiProvider } from "../src/rq/public/PlaceQueryRQ";
|
|
5
|
-
import { act } from "react";
|
|
6
5
|
|
|
7
6
|
const app = new TestApp();
|
|
8
7
|
|
package/lib/cjs/CoreApp.d.ts
CHANGED
|
@@ -4,8 +4,7 @@ import { OrgApi } from "./OrgApi";
|
|
|
4
4
|
import { AppApi } from "./AppApi";
|
|
5
5
|
import { PublicApi } from "./PublicApi";
|
|
6
6
|
import { UserApi } from "./UserApi";
|
|
7
|
-
import { AuthApi, IApp, UserIdentifierType } from "@etsoo/appscript";
|
|
8
|
-
import { IdentityType } from "./dto/IdentityType";
|
|
7
|
+
import { AuthApi, IApp, IdentityType, UserIdentifierType } from "@etsoo/appscript";
|
|
9
8
|
import { AuthCodeApi } from "./AuthCodeApi";
|
|
10
9
|
import { ListType } from "@etsoo/shared";
|
|
11
10
|
type AppData = {
|
|
@@ -22,7 +21,7 @@ export interface ICoreApp {
|
|
|
22
21
|
/**
|
|
23
22
|
* Application API
|
|
24
23
|
*/
|
|
25
|
-
appApi: AppApi;
|
|
24
|
+
readonly appApi: AppApi;
|
|
26
25
|
/**
|
|
27
26
|
* Authentication API
|
|
28
27
|
*/
|
package/lib/cjs/CoreApp.js
CHANGED
|
@@ -7,7 +7,6 @@ const AppApi_1 = require("./AppApi");
|
|
|
7
7
|
const PublicApi_1 = require("./PublicApi");
|
|
8
8
|
const UserApi_1 = require("./UserApi");
|
|
9
9
|
const appscript_1 = require("@etsoo/appscript");
|
|
10
|
-
const IdentityType_1 = require("./dto/IdentityType");
|
|
11
10
|
const AuthCodeApi_1 = require("./AuthCodeApi");
|
|
12
11
|
const shared_1 = require("@etsoo/shared");
|
|
13
12
|
/**
|
|
@@ -124,8 +123,8 @@ class CoreApp {
|
|
|
124
123
|
*/
|
|
125
124
|
getIdentities(identity) {
|
|
126
125
|
if (identity == null)
|
|
127
|
-
return this.app.getEnumList(
|
|
128
|
-
return this.app.getEnumList(
|
|
126
|
+
return this.app.getEnumList(appscript_1.IdentityType, "id");
|
|
127
|
+
return this.app.getEnumList(appscript_1.IdentityType, "id", (id, _key) => {
|
|
129
128
|
if ((id & identity) > 0)
|
|
130
129
|
return id;
|
|
131
130
|
});
|
|
@@ -10,7 +10,7 @@ const material_1 = require("@mui/material");
|
|
|
10
10
|
const react_router_dom_1 = require("react-router-dom");
|
|
11
11
|
const materialui_1 = require("@etsoo/materialui");
|
|
12
12
|
const ICoreServiceApp_1 = require("../../ICoreServiceApp");
|
|
13
|
-
const
|
|
13
|
+
const appscript_1 = require("@etsoo/appscript");
|
|
14
14
|
function AppSwitchPopover(props) {
|
|
15
15
|
// Destruct
|
|
16
16
|
const { appName } = props;
|
|
@@ -31,7 +31,7 @@ function AppSwitchPopover(props) {
|
|
|
31
31
|
ml: 0.5,
|
|
32
32
|
whiteSpace: "nowrap",
|
|
33
33
|
cursor: "pointer"
|
|
34
|
-
}, title: labels.switchApp, onClick: (e) => callback(e.currentTarget), children: appName })), loadData: () => app.core.appApi.getMy({ maxItems, identityType:
|
|
34
|
+
}, title: labels.switchApp, onClick: (e) => callback(e.currentTarget), children: appName })), loadData: () => app.core.appApi.getMy({ maxItems, identityType: appscript_1.IdentityType.User }, { showLoading: false }), position: "left", children: (data) => {
|
|
35
35
|
if (data == null)
|
|
36
36
|
return (0, jsx_runtime_1.jsx)(react_1.default.Fragment, {});
|
|
37
37
|
// Remove the current app
|
package/lib/cjs/i18n/en.json
CHANGED
package/lib/cjs/index.d.ts
CHANGED
|
@@ -24,7 +24,6 @@ export * from "./dto/user/AuditHistoryDto";
|
|
|
24
24
|
export * from "./dto/user/DeviceListDto";
|
|
25
25
|
export * from "./dto/user/UserIdentifierData";
|
|
26
26
|
export * from "./dto/user/UserUpdateReadDto";
|
|
27
|
-
export * from "./dto/IdentityType";
|
|
28
27
|
export * from "./i18n/CoreCulture";
|
|
29
28
|
export * from "./rq/app/AppBuyNewRQ";
|
|
30
29
|
export * from "./rq/app/AppBuyRQ";
|
package/lib/cjs/index.js
CHANGED
|
@@ -41,7 +41,6 @@ __exportStar(require("./dto/user/AuditHistoryDto"), exports);
|
|
|
41
41
|
__exportStar(require("./dto/user/DeviceListDto"), exports);
|
|
42
42
|
__exportStar(require("./dto/user/UserIdentifierData"), exports);
|
|
43
43
|
__exportStar(require("./dto/user/UserUpdateReadDto"), exports);
|
|
44
|
-
__exportStar(require("./dto/IdentityType"), exports);
|
|
45
44
|
// i18n
|
|
46
45
|
__exportStar(require("./i18n/CoreCulture"), exports);
|
|
47
46
|
// RQ
|
package/lib/mjs/CoreApp.d.ts
CHANGED
|
@@ -4,8 +4,7 @@ import { OrgApi } from "./OrgApi";
|
|
|
4
4
|
import { AppApi } from "./AppApi";
|
|
5
5
|
import { PublicApi } from "./PublicApi";
|
|
6
6
|
import { UserApi } from "./UserApi";
|
|
7
|
-
import { AuthApi, IApp, UserIdentifierType } from "@etsoo/appscript";
|
|
8
|
-
import { IdentityType } from "./dto/IdentityType";
|
|
7
|
+
import { AuthApi, IApp, IdentityType, UserIdentifierType } from "@etsoo/appscript";
|
|
9
8
|
import { AuthCodeApi } from "./AuthCodeApi";
|
|
10
9
|
import { ListType } from "@etsoo/shared";
|
|
11
10
|
type AppData = {
|
|
@@ -22,7 +21,7 @@ export interface ICoreApp {
|
|
|
22
21
|
/**
|
|
23
22
|
* Application API
|
|
24
23
|
*/
|
|
25
|
-
appApi: AppApi;
|
|
24
|
+
readonly appApi: AppApi;
|
|
26
25
|
/**
|
|
27
26
|
* Authentication API
|
|
28
27
|
*/
|
package/lib/mjs/CoreApp.js
CHANGED
|
@@ -3,8 +3,7 @@ import { OrgApi } from "./OrgApi";
|
|
|
3
3
|
import { AppApi } from "./AppApi";
|
|
4
4
|
import { PublicApi } from "./PublicApi";
|
|
5
5
|
import { UserApi } from "./UserApi";
|
|
6
|
-
import { AuthApi, UserIdentifierType } from "@etsoo/appscript";
|
|
7
|
-
import { IdentityType } from "./dto/IdentityType";
|
|
6
|
+
import { AuthApi, IdentityType, UserIdentifierType } from "@etsoo/appscript";
|
|
8
7
|
import { AuthCodeApi } from "./AuthCodeApi";
|
|
9
8
|
import { DataTypes } from "@etsoo/shared";
|
|
10
9
|
/**
|
|
@@ -4,7 +4,7 @@ import { Button, Stack, Typography } from "@mui/material";
|
|
|
4
4
|
import { useNavigate } from "react-router-dom";
|
|
5
5
|
import { ButtonPopover } from "@etsoo/materialui";
|
|
6
6
|
import { useRequiredAppContext } from "../../ICoreServiceApp";
|
|
7
|
-
import { IdentityType } from "
|
|
7
|
+
import { IdentityType } from "@etsoo/appscript";
|
|
8
8
|
export function AppSwitchPopover(props) {
|
|
9
9
|
// Destruct
|
|
10
10
|
const { appName } = props;
|
package/lib/mjs/i18n/en.json
CHANGED
package/lib/mjs/index.d.ts
CHANGED
|
@@ -24,7 +24,6 @@ export * from "./dto/user/AuditHistoryDto";
|
|
|
24
24
|
export * from "./dto/user/DeviceListDto";
|
|
25
25
|
export * from "./dto/user/UserIdentifierData";
|
|
26
26
|
export * from "./dto/user/UserUpdateReadDto";
|
|
27
|
-
export * from "./dto/IdentityType";
|
|
28
27
|
export * from "./i18n/CoreCulture";
|
|
29
28
|
export * from "./rq/app/AppBuyNewRQ";
|
|
30
29
|
export * from "./rq/app/AppBuyRQ";
|
package/lib/mjs/index.js
CHANGED
|
@@ -25,7 +25,6 @@ export * from "./dto/user/AuditHistoryDto";
|
|
|
25
25
|
export * from "./dto/user/DeviceListDto";
|
|
26
26
|
export * from "./dto/user/UserIdentifierData";
|
|
27
27
|
export * from "./dto/user/UserUpdateReadDto";
|
|
28
|
-
export * from "./dto/IdentityType";
|
|
29
28
|
// i18n
|
|
30
29
|
export * from "./i18n/CoreCulture";
|
|
31
30
|
// RQ
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/smarterp-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.27",
|
|
4
4
|
"description": "TypeScript APIs for SmartERP Core",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"scripts": {
|
|
21
21
|
"build": "tsc -p tsconfig.json && tsc -p tsconfig.cjs.json",
|
|
22
22
|
"test": "vitest",
|
|
23
|
-
"localtest": "set NODE_ENV=local&&
|
|
23
|
+
"localtest": "set NODE_ENV=local&&vitest"
|
|
24
24
|
},
|
|
25
25
|
"repository": {
|
|
26
26
|
"type": "git",
|
|
@@ -45,20 +45,20 @@
|
|
|
45
45
|
"@babel/plugin-transform-runtime": "^7.26.10",
|
|
46
46
|
"@babel/preset-env": "^7.26.9",
|
|
47
47
|
"@babel/runtime-corejs3": "^7.26.10",
|
|
48
|
-
"@types/react": "^18.3.
|
|
48
|
+
"@types/react": "^18.3.19",
|
|
49
49
|
"@types/react-dom": "^18.3.1",
|
|
50
50
|
"@vitejs/plugin-react": "^4.3.4",
|
|
51
51
|
"jsdom": "^26.0.0",
|
|
52
52
|
"typescript": "^5.8.2",
|
|
53
|
-
"vitest": "^3.0.
|
|
53
|
+
"vitest": "^3.0.9"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@etsoo/appscript": "^1.6.
|
|
57
|
-
"@etsoo/materialui": "^1.
|
|
58
|
-
"@etsoo/react": "^1.8.
|
|
59
|
-
"@etsoo/shared": "^1.2.
|
|
60
|
-
"@etsoo/toolpad": "^1.0.
|
|
61
|
-
"@mui/material": "^6.4.
|
|
56
|
+
"@etsoo/appscript": "^1.6.19",
|
|
57
|
+
"@etsoo/materialui": "^1.5.2",
|
|
58
|
+
"@etsoo/react": "^1.8.33",
|
|
59
|
+
"@etsoo/shared": "^1.2.63",
|
|
60
|
+
"@etsoo/toolpad": "^1.0.20",
|
|
61
|
+
"@mui/material": "^6.4.8",
|
|
62
62
|
"react": "^18.3.1",
|
|
63
63
|
"react-dom": "^18.3.1"
|
|
64
64
|
}
|
package/src/CoreApp.ts
CHANGED
|
@@ -4,8 +4,12 @@ import { OrgApi } from "./OrgApi";
|
|
|
4
4
|
import { AppApi } from "./AppApi";
|
|
5
5
|
import { PublicApi } from "./PublicApi";
|
|
6
6
|
import { UserApi } from "./UserApi";
|
|
7
|
-
import {
|
|
8
|
-
|
|
7
|
+
import {
|
|
8
|
+
AuthApi,
|
|
9
|
+
IApp,
|
|
10
|
+
IdentityType,
|
|
11
|
+
UserIdentifierType
|
|
12
|
+
} from "@etsoo/appscript";
|
|
9
13
|
import { AuthCodeApi } from "./AuthCodeApi";
|
|
10
14
|
import { DataTypes, ListType } from "@etsoo/shared";
|
|
11
15
|
|
|
@@ -19,7 +23,7 @@ export interface ICoreApp {
|
|
|
19
23
|
/**
|
|
20
24
|
* Application API
|
|
21
25
|
*/
|
|
22
|
-
appApi: AppApi;
|
|
26
|
+
readonly appApi: AppApi;
|
|
23
27
|
|
|
24
28
|
/**
|
|
25
29
|
* Authentication API
|
|
@@ -3,9 +3,8 @@ import { Button, Stack, Typography } from "@mui/material";
|
|
|
3
3
|
import { useNavigate } from "react-router-dom";
|
|
4
4
|
import { ButtonPopover } from "@etsoo/materialui";
|
|
5
5
|
import { useRequiredAppContext } from "../../ICoreServiceApp";
|
|
6
|
-
import { IdentityType } from "../../dto/IdentityType";
|
|
7
6
|
import { AppData } from "../../dto/app/AppData";
|
|
8
|
-
import { AuthRequest } from "@etsoo/appscript";
|
|
7
|
+
import { AuthRequest, IdentityType } from "@etsoo/appscript";
|
|
9
8
|
|
|
10
9
|
export type AppSwitchPopoverProps = {
|
|
11
10
|
appName: string;
|
package/src/i18n/en.json
CHANGED
package/src/i18n/zh-Hans.json
CHANGED
package/src/i18n/zh-Hant.json
CHANGED
package/src/index.ts
CHANGED
package/src/rq/app/AppGetMyRQ.ts
CHANGED
package/src/rq/app/AppListRQ.ts
CHANGED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IdentityType = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Identity type
|
|
6
|
-
* 标识类型
|
|
7
|
-
*/
|
|
8
|
-
var IdentityType;
|
|
9
|
-
(function (IdentityType) {
|
|
10
|
-
/**
|
|
11
|
-
* User
|
|
12
|
-
* 用户
|
|
13
|
-
*/
|
|
14
|
-
IdentityType[IdentityType["User"] = 1] = "User";
|
|
15
|
-
/**
|
|
16
|
-
* Customer
|
|
17
|
-
* 客户
|
|
18
|
-
*/
|
|
19
|
-
IdentityType[IdentityType["Customer"] = 2] = "Customer";
|
|
20
|
-
/**
|
|
21
|
-
* Supplier
|
|
22
|
-
* 供应商
|
|
23
|
-
*/
|
|
24
|
-
IdentityType[IdentityType["Supplier"] = 4] = "Supplier";
|
|
25
|
-
})(IdentityType || (exports.IdentityType = IdentityType = {}));
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Identity type
|
|
3
|
-
* 标识类型
|
|
4
|
-
*/
|
|
5
|
-
export var IdentityType;
|
|
6
|
-
(function (IdentityType) {
|
|
7
|
-
/**
|
|
8
|
-
* User
|
|
9
|
-
* 用户
|
|
10
|
-
*/
|
|
11
|
-
IdentityType[IdentityType["User"] = 1] = "User";
|
|
12
|
-
/**
|
|
13
|
-
* Customer
|
|
14
|
-
* 客户
|
|
15
|
-
*/
|
|
16
|
-
IdentityType[IdentityType["Customer"] = 2] = "Customer";
|
|
17
|
-
/**
|
|
18
|
-
* Supplier
|
|
19
|
-
* 供应商
|
|
20
|
-
*/
|
|
21
|
-
IdentityType[IdentityType["Supplier"] = 4] = "Supplier";
|
|
22
|
-
})(IdentityType || (IdentityType = {}));
|
package/src/dto/IdentityType.ts
DELETED