@etsoo/materialui 1.0.51 → 1.0.53

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.
@@ -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,4 +1,5 @@
1
1
  import { IApi, RefreshTokenProps, RefreshTokenRQ } from '@etsoo/appscript';
2
+ import { IServiceApp } from './IServiceApp';
2
3
  import { IServiceAppSettings } from './IServiceAppSettings';
3
4
  import { IServicePageData } from './IServicePage';
4
5
  import { IServiceUser } from './IServiceUser';
@@ -10,7 +11,7 @@ import { ReactApp } from './ReactApp';
10
11
  * Use the acess token to the service api, get a service access token
11
12
  * Use the new acess token and refresh token to login
12
13
  */
13
- 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 {
14
15
  /**
15
16
  * Service API
16
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.51",
3
+ "version": "1.0.53",
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.8",
55
- "@etsoo/notificationbase": "^1.1.12",
56
- "@etsoo/react": "^1.6.18",
57
- "@etsoo/shared": "^1.1.62",
54
+ "@etsoo/appscript": "^1.3.10",
55
+ "@etsoo/notificationbase": "^1.1.13",
56
+ "@etsoo/react": "^1.6.20",
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",
@@ -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
+ }
@@ -10,6 +10,7 @@ import {
10
10
  } from '@etsoo/appscript';
11
11
  import { CoreConstants } from '@etsoo/react';
12
12
  import { DomUtils } from '@etsoo/shared';
13
+ import { IServiceApp } from './IServiceApp';
13
14
  import { IServiceAppSettings } from './IServiceAppSettings';
14
15
  import { IServicePageData } from './IServicePage';
15
16
  import { IServiceUser, ServiceLoginResult } from './IServiceUser';
@@ -23,10 +24,13 @@ import { ReactApp } from './ReactApp';
23
24
  * Use the new acess token and refresh token to login
24
25
  */
25
26
  export class ServiceApp<
26
- U extends IServiceUser = IServiceUser,
27
- P extends IServicePageData = IServicePageData,
28
- S extends IServiceAppSettings = IServiceAppSettings
29
- > 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
+ {
30
34
  /**
31
35
  * Service API
32
36
  */
@@ -330,11 +334,7 @@ export class ServiceApp<
330
334
  * @param refreshToken Refresh token
331
335
  * @param serviceUser Service user
332
336
  */
333
- userLoginEx(
334
- user: ISmartERPUser,
335
- refreshToken: string,
336
- serviceUser: U
337
- ): void {
337
+ userLoginEx(user: ISmartERPUser, refreshToken: string, serviceUser: U) {
338
338
  // Service user login
339
339
  this.servicePassphrase =
340
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';