@etsoo/smarterp-core 1.0.25 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2004-2024 ETSOO ® (亿速思维 ®), https://etsoo.com, https://etsoo.nz
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
@@ -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 = {
@@ -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(IdentityType_1.IdentityType, "id");
128
- return this.app.getEnumList(IdentityType_1.IdentityType, "id", (id, _key) => {
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 IdentityType_1 = require("../../dto/IdentityType");
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: IdentityType_1.IdentityType.User }, { showLoading: false }), position: "left", children: (data) => {
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
@@ -1,4 +1,4 @@
1
- import { IdentityType } from "../IdentityType";
1
+ import { IdentityType } from "@etsoo/appscript";
2
2
  import { AppUrl } from "./AppData";
3
3
  /**
4
4
  * Application query data
@@ -1,5 +1,4 @@
1
- import { EntityStatus } from "@etsoo/appscript";
2
- import { IdentityType } from "../IdentityType";
1
+ import { EntityStatus, IdentityType } from "@etsoo/appscript";
3
2
  import { AppUrl } from "./AppData";
4
3
  /**
5
4
  * App read data
@@ -1,5 +1,4 @@
1
- import { EntityStatus, UserRole } from "@etsoo/appscript";
2
- import { IdentityType } from "../IdentityType";
1
+ import { EntityStatus, IdentityType, UserRole } from "@etsoo/appscript";
3
2
  /**
4
3
  * Member read for view data
5
4
  * 读取成员查看数据
@@ -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
@@ -1,4 +1,4 @@
1
- import { IdentityType } from "../../dto/IdentityType";
1
+ import { IdentityType } from "@etsoo/appscript";
2
2
  /**
3
3
  * Get user's latest accessed applications request data
4
4
  * 获取用户最近访问的应用请求数据
@@ -1,5 +1,4 @@
1
- import { QueryRQ } from "@etsoo/appscript";
2
- import { IdentityType } from "../../dto/IdentityType";
1
+ import { IdentityType, QueryRQ } from "@etsoo/appscript";
3
2
  /**
4
3
  * Application list request data
5
4
  * 应用列表请求数据
@@ -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 = {
@@ -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 "../../dto/IdentityType";
7
+ import { IdentityType } from "@etsoo/appscript";
8
8
  export function AppSwitchPopover(props) {
9
9
  // Destruct
10
10
  const { appName } = props;
@@ -1,4 +1,4 @@
1
- import { IdentityType } from "../IdentityType";
1
+ import { IdentityType } from "@etsoo/appscript";
2
2
  import { AppUrl } from "./AppData";
3
3
  /**
4
4
  * Application query data
@@ -1,5 +1,4 @@
1
- import { EntityStatus } from "@etsoo/appscript";
2
- import { IdentityType } from "../IdentityType";
1
+ import { EntityStatus, IdentityType } from "@etsoo/appscript";
3
2
  import { AppUrl } from "./AppData";
4
3
  /**
5
4
  * App read data
@@ -1,5 +1,4 @@
1
- import { EntityStatus, UserRole } from "@etsoo/appscript";
2
- import { IdentityType } from "../IdentityType";
1
+ import { EntityStatus, IdentityType, UserRole } from "@etsoo/appscript";
3
2
  /**
4
3
  * Member read for view data
5
4
  * 读取成员查看数据
@@ -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
@@ -1,4 +1,4 @@
1
- import { IdentityType } from "../../dto/IdentityType";
1
+ import { IdentityType } from "@etsoo/appscript";
2
2
  /**
3
3
  * Get user's latest accessed applications request data
4
4
  * 获取用户最近访问的应用请求数据
@@ -1,5 +1,4 @@
1
- import { QueryRQ } from "@etsoo/appscript";
2
- import { IdentityType } from "../../dto/IdentityType";
1
+ import { IdentityType, QueryRQ } from "@etsoo/appscript";
3
2
  /**
4
3
  * Application list request data
5
4
  * 应用列表请求数据
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/smarterp-core",
3
- "version": "1.0.25",
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&&jest"
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.8"
53
+ "vitest": "^3.0.9"
54
54
  },
55
55
  "dependencies": {
56
- "@etsoo/appscript": "^1.6.18",
57
- "@etsoo/materialui": "^1.4.97",
58
- "@etsoo/react": "^1.8.32",
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.7",
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 { AuthApi, IApp, UserIdentifierType } from "@etsoo/appscript";
8
- import { IdentityType } from "./dto/IdentityType";
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
 
@@ -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;
@@ -1,4 +1,4 @@
1
- import { IdentityType } from "../IdentityType";
1
+ import { IdentityType } from "@etsoo/appscript";
2
2
  import { AppUrl } from "./AppData";
3
3
 
4
4
  /**
@@ -1,5 +1,4 @@
1
- import { EntityStatus } from "@etsoo/appscript";
2
- import { IdentityType } from "../IdentityType";
1
+ import { EntityStatus, IdentityType } from "@etsoo/appscript";
3
2
  import { AppUrl } from "./AppData";
4
3
 
5
4
  /**
@@ -1,5 +1,4 @@
1
- import { EntityStatus, UserRole } from "@etsoo/appscript";
2
- import { IdentityType } from "../IdentityType";
1
+ import { EntityStatus, IdentityType, UserRole } from "@etsoo/appscript";
3
2
 
4
3
  /**
5
4
  * Member read for view data
package/src/index.ts CHANGED
@@ -31,8 +31,6 @@ export * from "./dto/user/DeviceListDto";
31
31
  export * from "./dto/user/UserIdentifierData";
32
32
  export * from "./dto/user/UserUpdateReadDto";
33
33
 
34
- export * from "./dto/IdentityType";
35
-
36
34
  // i18n
37
35
  export * from "./i18n/CoreCulture";
38
36
 
@@ -1,4 +1,4 @@
1
- import { IdentityType } from "../../dto/IdentityType";
1
+ import { IdentityType } from "@etsoo/appscript";
2
2
 
3
3
  /**
4
4
  * Get user's latest accessed applications request data
@@ -1,5 +1,4 @@
1
- import { QueryRQ } from "@etsoo/appscript";
2
- import { IdentityType } from "../../dto/IdentityType";
1
+ import { IdentityType, QueryRQ } from "@etsoo/appscript";
3
2
 
4
3
  /**
5
4
  * Application list request data
@@ -1,21 +0,0 @@
1
- /**
2
- * Identity type
3
- * 标识类型
4
- */
5
- export declare enum IdentityType {
6
- /**
7
- * User
8
- * 用户
9
- */
10
- User = 1,
11
- /**
12
- * Customer
13
- * 客户
14
- */
15
- Customer = 2,
16
- /**
17
- * Supplier
18
- * 供应商
19
- */
20
- Supplier = 4
21
- }
@@ -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,21 +0,0 @@
1
- /**
2
- * Identity type
3
- * 标识类型
4
- */
5
- export declare enum IdentityType {
6
- /**
7
- * User
8
- * 用户
9
- */
10
- User = 1,
11
- /**
12
- * Customer
13
- * 客户
14
- */
15
- Customer = 2,
16
- /**
17
- * Supplier
18
- * 供应商
19
- */
20
- Supplier = 4
21
- }
@@ -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 = {}));
@@ -1,23 +0,0 @@
1
- /**
2
- * Identity type
3
- * 标识类型
4
- */
5
- export enum IdentityType {
6
- /**
7
- * User
8
- * 用户
9
- */
10
- User = 1,
11
-
12
- /**
13
- * Customer
14
- * 客户
15
- */
16
- Customer = 2,
17
-
18
- /**
19
- * Supplier
20
- * 供应商
21
- */
22
- Supplier = 4
23
- }