@etsoo/materialui 1.2.32 → 1.2.34

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.
@@ -23,7 +23,7 @@ export interface IServiceApp extends ReactAppType {
23
23
  * @param passphrase Secret passphrase
24
24
  * @returns Pure text
25
25
  */
26
- serviceDecrypt(messageEncrypted: string, passphrase?: string): Promise<string | undefined>;
26
+ serviceDecrypt(messageEncrypted: string, passphrase?: string): string | undefined;
27
27
  /**
28
28
  * Service encrypt message
29
29
  * @param message Message
@@ -31,5 +31,5 @@ export interface IServiceApp extends ReactAppType {
31
31
  * @param iterations Iterations, 1000 times, 1 - 99
32
32
  * @returns Result
33
33
  */
34
- serviceEncrypt(message: string, passphrase?: string, iterations?: number): Promise<string | undefined>;
34
+ serviceEncrypt(message: string, passphrase?: string, iterations?: number): string | undefined;
35
35
  }
@@ -52,7 +52,7 @@ export declare class ServiceApp<U extends IServiceUser = IServiceUser, P extends
52
52
  * @param passphrase Secret passphrase
53
53
  * @returns Pure text
54
54
  */
55
- serviceDecrypt(messageEncrypted: string, passphrase?: string): Promise<string | undefined>;
55
+ serviceDecrypt(messageEncrypted: string, passphrase?: string): string | undefined;
56
56
  /**
57
57
  * Service encrypt message
58
58
  * @param message Message
@@ -60,7 +60,7 @@ export declare class ServiceApp<U extends IServiceUser = IServiceUser, P extends
60
60
  * @param iterations Iterations, 1000 times, 1 - 99
61
61
  * @returns Result
62
62
  */
63
- serviceEncrypt(message: string, passphrase?: string, iterations?: number): Promise<string>;
63
+ serviceEncrypt(message: string, passphrase?: string, iterations?: number): string;
64
64
  /**
65
65
  * Try login
66
66
  * @param data Additional data
@@ -110,7 +110,7 @@ export class ServiceApp extends ReactApp {
110
110
  const userData = result.data;
111
111
  // Use core system access token to service api to exchange service access token
112
112
  const serviceResult = await this.serviceApi.put("Auth/ExchangeToken", {
113
- token: this.encryptEnhanced(userData.token, this.settings.serviceId.toString())
113
+ token: await this.encryptEnhanced(userData.token, this.settings.serviceId.toString())
114
114
  }, {
115
115
  showLoading,
116
116
  onError: (error) => {
@@ -230,8 +230,10 @@ export class ServiceApp extends ReactApp {
230
230
  * @param serviceUser Service user
231
231
  */
232
232
  userLoginEx(user, refreshToken, serviceUser) {
233
+ var _a;
233
234
  // Service user login
234
- this.decrypt(serviceUser.servicePassphrase, this.settings.serviceId.toString()).then((result) => (this.servicePassphrase = result !== null && result !== void 0 ? result : ""));
235
+ this.servicePassphrase =
236
+ (_a = this.decrypt(serviceUser.servicePassphrase, this.settings.serviceId.toString())) !== null && _a !== void 0 ? _a : "";
235
237
  // Service user
236
238
  this.serviceUser = serviceUser;
237
239
  // Service API token
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.2.32",
3
+ "version": "1.2.34",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -50,9 +50,9 @@
50
50
  "@emotion/css": "^11.11.0",
51
51
  "@emotion/react": "^11.11.0",
52
52
  "@emotion/styled": "^11.11.0",
53
- "@etsoo/appscript": "^1.4.2",
53
+ "@etsoo/appscript": "^1.4.5",
54
54
  "@etsoo/notificationbase": "^1.1.25",
55
- "@etsoo/react": "^1.6.77",
55
+ "@etsoo/react": "^1.6.79",
56
56
  "@etsoo/shared": "^1.2.5",
57
57
  "@mui/icons-material": "^5.11.16",
58
58
  "@mui/material": "^5.12.3",
@@ -30,7 +30,7 @@ export interface IServiceApp extends ReactAppType {
30
30
  serviceDecrypt(
31
31
  messageEncrypted: string,
32
32
  passphrase?: string
33
- ): Promise<string | undefined>;
33
+ ): string | undefined;
34
34
 
35
35
  /**
36
36
  * Service encrypt message
@@ -43,5 +43,5 @@ export interface IServiceApp extends ReactAppType {
43
43
  message: string,
44
44
  passphrase?: string,
45
45
  iterations?: number
46
- ): Promise<string | undefined>;
46
+ ): string | undefined;
47
47
  }
@@ -167,7 +167,7 @@ export class ServiceApp<
167
167
  const serviceResult = await this.serviceApi.put<ServiceLoginResult<U>>(
168
168
  "Auth/ExchangeToken",
169
169
  {
170
- token: this.encryptEnhanced(
170
+ token: await this.encryptEnhanced(
171
171
  userData.token,
172
172
  this.settings.serviceId.toString()
173
173
  )
@@ -325,10 +325,11 @@ export class ServiceApp<
325
325
  */
326
326
  userLoginEx(user: ISmartERPUser, refreshToken: string, serviceUser: U) {
327
327
  // Service user login
328
- this.decrypt(
329
- serviceUser.servicePassphrase,
330
- this.settings.serviceId.toString()
331
- ).then((result) => (this.servicePassphrase = result ?? ""));
328
+ this.servicePassphrase =
329
+ this.decrypt(
330
+ serviceUser.servicePassphrase,
331
+ this.settings.serviceId.toString()
332
+ ) ?? "";
332
333
 
333
334
  // Service user
334
335
  this.serviceUser = serviceUser;