@etsoo/materialui 1.0.50 → 1.0.52

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.
@@ -1,5 +1,5 @@
1
- import { IAppSettings, IUser, RefreshTokenProps } from '@etsoo/appscript';
2
- import { IPageData, RefreshTokenRQ } from '@etsoo/react';
1
+ import { IAppSettings, IUser, RefreshTokenProps, RefreshTokenRQ } from '@etsoo/appscript';
2
+ import { IPageData } from '@etsoo/react';
3
3
  import { ReactApp } from './ReactApp';
4
4
  /**
5
5
  * Common independent application
@@ -0,0 +1,35 @@
1
+ import { IApi } from '@etsoo/appscript';
2
+ import { IServiceUser } from './IServiceUser';
3
+ import { ReactAppType } from './ReactApp';
4
+ /**
5
+ * Service application interface
6
+ */
7
+ export interface IServiceApp extends ReactAppType {
8
+ /**
9
+ * Service API
10
+ */
11
+ readonly serviceApi: IApi;
12
+ /**
13
+ * Service user
14
+ */
15
+ readonly serviceUser?: IServiceUser;
16
+ /**
17
+ * Load SmartERP core
18
+ */
19
+ loadSmartERP(): void;
20
+ /**
21
+ * Service decrypt message
22
+ * @param messageEncrypted Encrypted message
23
+ * @param passphrase Secret passphrase
24
+ * @returns Pure text
25
+ */
26
+ serviceDecrypt(messageEncrypted: string, passphrase?: string): string | undefined;
27
+ /**
28
+ * Service encrypt message
29
+ * @param message Message
30
+ * @param passphrase Secret passphrase
31
+ * @param iterations Iterations, 1000 times, 1 - 99
32
+ * @returns Result
33
+ */
34
+ serviceEncrypt(message: string, passphrase?: string, iterations?: number): string | undefined;
35
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
- import { IApi, RefreshTokenProps } from '@etsoo/appscript';
2
- import { RefreshTokenRQ } from '@etsoo/react';
1
+ import { IApi, RefreshTokenProps, RefreshTokenRQ } from '@etsoo/appscript';
2
+ import { IServiceApp } from './IServiceApp';
3
3
  import { IServiceAppSettings } from './IServiceAppSettings';
4
4
  import { IServicePageData } from './IServicePage';
5
5
  import { IServiceUser } from './IServiceUser';
@@ -11,7 +11,7 @@ import { ReactApp } from './ReactApp';
11
11
  * Use the acess token to the service api, get a service access token
12
12
  * Use the new acess token and refresh token to login
13
13
  */
14
- export declare class ServiceApp<U extends IServiceUser = IServiceUser, P extends IServicePageData = IServicePageData, S extends IServiceAppSettings = IServiceAppSettings> extends ReactApp<S, ISmartERPUser, P> {
14
+ export declare class ServiceApp<U extends IServiceUser = IServiceUser, P extends IServicePageData = IServicePageData, S extends IServiceAppSettings = IServiceAppSettings> extends ReactApp<S, ISmartERPUser, P> implements IServiceApp {
15
15
  /**
16
16
  * Service API
17
17
  */
package/lib/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './app/CommonApp';
2
+ export * from './app/IServiceApp';
2
3
  export * from './app/IServiceAppSettings';
3
4
  export * from './app/IServicePage';
4
5
  export * from './app/IServiceUser';
package/lib/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './app/CommonApp';
2
+ export * from './app/IServiceApp';
2
3
  export * from './app/IServiceAppSettings';
3
4
  export * from './app/IServicePage';
4
5
  export * from './app/IServiceUser';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.0.50",
3
+ "version": "1.0.52",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -51,10 +51,10 @@
51
51
  "@emotion/css": "^11.10.0",
52
52
  "@emotion/react": "^11.10.4",
53
53
  "@emotion/styled": "^11.10.4",
54
- "@etsoo/appscript": "^1.3.7",
54
+ "@etsoo/appscript": "^1.3.9",
55
55
  "@etsoo/notificationbase": "^1.1.12",
56
- "@etsoo/react": "^1.6.17",
57
- "@etsoo/shared": "^1.1.60",
56
+ "@etsoo/react": "^1.6.19",
57
+ "@etsoo/shared": "^1.1.65",
58
58
  "@mui/icons-material": "^5.10.9",
59
59
  "@mui/material": "^5.10.9",
60
60
  "@types/pica": "^9.0.1",
@@ -4,9 +4,10 @@ import {
4
4
  IAppSettings,
5
5
  IUser,
6
6
  RefreshTokenProps,
7
- RefreshTokenResult
7
+ RefreshTokenResult,
8
+ RefreshTokenRQ
8
9
  } from '@etsoo/appscript';
9
- import { CoreConstants, IPageData, RefreshTokenRQ } from '@etsoo/react';
10
+ import { CoreConstants, IPageData } from '@etsoo/react';
10
11
  import { ReactApp } from './ReactApp';
11
12
 
12
13
  /**
@@ -0,0 +1,47 @@
1
+ import { IApi } from '@etsoo/appscript';
2
+ import { IServiceUser } from './IServiceUser';
3
+ import { ReactAppType } from './ReactApp';
4
+
5
+ /**
6
+ * Service application interface
7
+ */
8
+ export interface IServiceApp extends ReactAppType {
9
+ /**
10
+ * Service API
11
+ */
12
+ readonly serviceApi: IApi;
13
+
14
+ /**
15
+ * Service user
16
+ */
17
+ readonly serviceUser?: IServiceUser;
18
+
19
+ /**
20
+ * Load SmartERP core
21
+ */
22
+ loadSmartERP(): void;
23
+
24
+ /**
25
+ * Service decrypt message
26
+ * @param messageEncrypted Encrypted message
27
+ * @param passphrase Secret passphrase
28
+ * @returns Pure text
29
+ */
30
+ serviceDecrypt(
31
+ messageEncrypted: string,
32
+ passphrase?: string
33
+ ): string | undefined;
34
+
35
+ /**
36
+ * Service encrypt message
37
+ * @param message Message
38
+ * @param passphrase Secret passphrase
39
+ * @param iterations Iterations, 1000 times, 1 - 99
40
+ * @returns Result
41
+ */
42
+ serviceEncrypt(
43
+ message: string,
44
+ passphrase?: string,
45
+ iterations?: number
46
+ ): string | undefined;
47
+ }
@@ -5,10 +5,12 @@ import {
5
5
  IApi,
6
6
  IApiPayload,
7
7
  RefreshTokenProps,
8
- RefreshTokenResult
8
+ RefreshTokenResult,
9
+ RefreshTokenRQ
9
10
  } from '@etsoo/appscript';
10
- import { CoreConstants, RefreshTokenRQ } from '@etsoo/react';
11
+ import { CoreConstants } from '@etsoo/react';
11
12
  import { DomUtils } from '@etsoo/shared';
13
+ import { IServiceApp } from './IServiceApp';
12
14
  import { IServiceAppSettings } from './IServiceAppSettings';
13
15
  import { IServicePageData } from './IServicePage';
14
16
  import { IServiceUser, ServiceLoginResult } from './IServiceUser';
@@ -22,10 +24,13 @@ import { ReactApp } from './ReactApp';
22
24
  * Use the new acess token and refresh token to login
23
25
  */
24
26
  export class ServiceApp<
25
- U extends IServiceUser = IServiceUser,
26
- P extends IServicePageData = IServicePageData,
27
- S extends IServiceAppSettings = IServiceAppSettings
28
- > extends ReactApp<S, ISmartERPUser, P> {
27
+ U extends IServiceUser = IServiceUser,
28
+ P extends IServicePageData = IServicePageData,
29
+ S extends IServiceAppSettings = IServiceAppSettings
30
+ >
31
+ extends ReactApp<S, ISmartERPUser, P>
32
+ implements IServiceApp
33
+ {
29
34
  /**
30
35
  * Service API
31
36
  */
@@ -329,11 +334,7 @@ export class ServiceApp<
329
334
  * @param refreshToken Refresh token
330
335
  * @param serviceUser Service user
331
336
  */
332
- userLoginEx(
333
- user: ISmartERPUser,
334
- refreshToken: string,
335
- serviceUser: U
336
- ): void {
337
+ userLoginEx(user: ISmartERPUser, refreshToken: string, serviceUser: U) {
337
338
  // Service user login
338
339
  this.servicePassphrase =
339
340
  this.decrypt(
package/src/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './app/CommonApp';
2
+ export * from './app/IServiceApp';
2
3
  export * from './app/IServiceAppSettings';
3
4
  export * from './app/IServicePage';
4
5
  export * from './app/IServiceUser';