@etsoo/smarterp-core 1.0.24 → 1.0.26
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/lib/cjs/CoreApp.d.ts +10 -12
- package/lib/cjs/CoreApp.js +3 -4
- package/lib/cjs/components/app/AppSwitchPopover.js +2 -2
- package/lib/cjs/dto/app/AppPurchasedQueryData.d.ts +4 -0
- 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/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 +10 -12
- package/lib/mjs/CoreApp.js +2 -3
- package/lib/mjs/components/app/AppSwitchPopover.js +1 -1
- package/lib/mjs/dto/app/AppPurchasedQueryData.d.ts +4 -0
- 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/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 +7 -7
- package/src/CoreApp.ts +13 -5
- package/src/components/app/AppSwitchPopover.tsx +1 -2
- package/src/dto/app/AppPurchasedQueryData.ts +5 -0
- 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/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/lib/cjs/CoreApp.d.ts
CHANGED
|
@@ -4,10 +4,15 @@ 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";
|
|
10
|
+
type AppData = {
|
|
11
|
+
id: number;
|
|
12
|
+
appId?: number;
|
|
13
|
+
name: string;
|
|
14
|
+
localName?: string;
|
|
15
|
+
};
|
|
11
16
|
/**
|
|
12
17
|
* Core application interface
|
|
13
18
|
* 核心应用程序接口
|
|
@@ -47,11 +52,7 @@ export interface ICoreApp {
|
|
|
47
52
|
* @param data App data
|
|
48
53
|
* @returns Name
|
|
49
54
|
*/
|
|
50
|
-
getAppName(data:
|
|
51
|
-
id: number;
|
|
52
|
-
name: string;
|
|
53
|
-
localName?: string;
|
|
54
|
-
}): string;
|
|
55
|
+
getAppName(data: AppData): string;
|
|
55
56
|
/**
|
|
56
57
|
* Get user identifier type label
|
|
57
58
|
* 获取用户标识类型标签
|
|
@@ -137,11 +138,7 @@ export declare class CoreApp implements ICoreApp {
|
|
|
137
138
|
* @param data App data
|
|
138
139
|
* @returns Name
|
|
139
140
|
*/
|
|
140
|
-
getAppName(data:
|
|
141
|
-
id: number;
|
|
142
|
-
name: string;
|
|
143
|
-
localName?: string;
|
|
144
|
-
}): string;
|
|
141
|
+
getAppName(data: AppData): string;
|
|
145
142
|
/**
|
|
146
143
|
* Get user identifier type label
|
|
147
144
|
* 获取用户标识类型标签
|
|
@@ -165,3 +162,4 @@ export declare class CoreApp implements ICoreApp {
|
|
|
165
162
|
*/
|
|
166
163
|
getIdentities(identity?: number): ListType[];
|
|
167
164
|
}
|
|
165
|
+
export {};
|
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
|
/**
|
|
@@ -90,7 +89,7 @@ class CoreApp {
|
|
|
90
89
|
* @returns Name
|
|
91
90
|
*/
|
|
92
91
|
getAppName(data) {
|
|
93
|
-
return data.localName ?? this.app.get(`app${data.id}`) ?? data.name;
|
|
92
|
+
return (data.localName ?? this.app.get(`app${data.appId ?? data.id}`) ?? data.name);
|
|
94
93
|
}
|
|
95
94
|
/**
|
|
96
95
|
* Get user identifier type label
|
|
@@ -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/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,10 +4,15 @@ 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";
|
|
10
|
+
type AppData = {
|
|
11
|
+
id: number;
|
|
12
|
+
appId?: number;
|
|
13
|
+
name: string;
|
|
14
|
+
localName?: string;
|
|
15
|
+
};
|
|
11
16
|
/**
|
|
12
17
|
* Core application interface
|
|
13
18
|
* 核心应用程序接口
|
|
@@ -47,11 +52,7 @@ export interface ICoreApp {
|
|
|
47
52
|
* @param data App data
|
|
48
53
|
* @returns Name
|
|
49
54
|
*/
|
|
50
|
-
getAppName(data:
|
|
51
|
-
id: number;
|
|
52
|
-
name: string;
|
|
53
|
-
localName?: string;
|
|
54
|
-
}): string;
|
|
55
|
+
getAppName(data: AppData): string;
|
|
55
56
|
/**
|
|
56
57
|
* Get user identifier type label
|
|
57
58
|
* 获取用户标识类型标签
|
|
@@ -137,11 +138,7 @@ export declare class CoreApp implements ICoreApp {
|
|
|
137
138
|
* @param data App data
|
|
138
139
|
* @returns Name
|
|
139
140
|
*/
|
|
140
|
-
getAppName(data:
|
|
141
|
-
id: number;
|
|
142
|
-
name: string;
|
|
143
|
-
localName?: string;
|
|
144
|
-
}): string;
|
|
141
|
+
getAppName(data: AppData): string;
|
|
145
142
|
/**
|
|
146
143
|
* Get user identifier type label
|
|
147
144
|
* 获取用户标识类型标签
|
|
@@ -165,3 +162,4 @@ export declare class CoreApp implements ICoreApp {
|
|
|
165
162
|
*/
|
|
166
163
|
getIdentities(identity?: number): ListType[];
|
|
167
164
|
}
|
|
165
|
+
export {};
|
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
|
/**
|
|
@@ -87,7 +86,7 @@ export class CoreApp {
|
|
|
87
86
|
* @returns Name
|
|
88
87
|
*/
|
|
89
88
|
getAppName(data) {
|
|
90
|
-
return data.localName ?? this.app.get(`app${data.id}`) ?? data.name;
|
|
89
|
+
return (data.localName ?? this.app.get(`app${data.appId ?? data.id}`) ?? data.name);
|
|
91
90
|
}
|
|
92
91
|
/**
|
|
93
92
|
* Get user identifier type label
|
|
@@ -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/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.26",
|
|
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",
|
|
@@ -50,15 +50,15 @@
|
|
|
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.4.
|
|
58
|
-
"@etsoo/react": "^1.8.
|
|
56
|
+
"@etsoo/appscript": "^1.6.19",
|
|
57
|
+
"@etsoo/materialui": "^1.4.99",
|
|
58
|
+
"@etsoo/react": "^1.8.33",
|
|
59
59
|
"@etsoo/shared": "^1.2.62",
|
|
60
60
|
"@etsoo/toolpad": "^1.0.19",
|
|
61
|
-
"@mui/material": "^6.4.
|
|
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,11 +4,17 @@ 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
|
|
|
16
|
+
type AppData = { id: number; appId?: number; name: string; localName?: string };
|
|
17
|
+
|
|
12
18
|
/**
|
|
13
19
|
* Core application interface
|
|
14
20
|
* 核心应用程序接口
|
|
@@ -55,7 +61,7 @@ export interface ICoreApp {
|
|
|
55
61
|
* @param data App data
|
|
56
62
|
* @returns Name
|
|
57
63
|
*/
|
|
58
|
-
getAppName(data:
|
|
64
|
+
getAppName(data: AppData): string;
|
|
59
65
|
|
|
60
66
|
/**
|
|
61
67
|
* Get user identifier type label
|
|
@@ -168,8 +174,10 @@ export class CoreApp implements ICoreApp {
|
|
|
168
174
|
* @param data App data
|
|
169
175
|
* @returns Name
|
|
170
176
|
*/
|
|
171
|
-
getAppName(data:
|
|
172
|
-
return
|
|
177
|
+
getAppName(data: AppData) {
|
|
178
|
+
return (
|
|
179
|
+
data.localName ?? this.app.get(`app${data.appId ?? data.id}`) ?? data.name
|
|
180
|
+
);
|
|
173
181
|
}
|
|
174
182
|
|
|
175
183
|
/**
|
|
@@ -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/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