@etsoo/appscript 1.5.47 → 1.5.48
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/lib/cjs/app/CoreApp.d.ts +2 -2
- package/lib/cjs/app/CoreApp.js +2 -2
- package/lib/cjs/app/IApp.d.ts +14 -1
- package/lib/mjs/app/CoreApp.d.ts +2 -2
- package/lib/mjs/app/CoreApp.js +2 -2
- package/lib/mjs/app/IApp.d.ts +14 -1
- package/package.json +1 -1
- package/src/app/CoreApp.ts +4 -3
- package/src/app/IApp.ts +16 -1
package/lib/cjs/app/CoreApp.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { InitCallDto } from '../erp/dto/InitCallDto';
|
|
|
7
7
|
import { InitCallResult, InitCallResultData } from '../result/InitCallResult';
|
|
8
8
|
import { IUser } from '../state/User';
|
|
9
9
|
import { IAppSettings } from './AppSettings';
|
|
10
|
-
import { AppLoginParams, FormatResultCustomCallback, IApp, IAppFields, IDetectIPCallback, NavigateOptions, RefreshTokenProps } from './IApp';
|
|
10
|
+
import { AppLoginParams, AppTryLoginParams, FormatResultCustomCallback, IApp, IAppFields, IDetectIPCallback, NavigateOptions, RefreshTokenProps } from './IApp';
|
|
11
11
|
import { UserRole } from './UserRole';
|
|
12
12
|
import { ExternalEndpoint } from './ExternalSettings';
|
|
13
13
|
import { ApiRefreshTokenDto } from '../erp/dto/ApiRefreshTokenDto';
|
|
@@ -626,7 +626,7 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
626
626
|
* UI get involved while refreshToken not intended
|
|
627
627
|
* @param params Login parameters
|
|
628
628
|
*/
|
|
629
|
-
tryLogin(params?:
|
|
629
|
+
tryLogin(params?: AppTryLoginParams): Promise<boolean>;
|
|
630
630
|
/**
|
|
631
631
|
* Update embedded status
|
|
632
632
|
* @param embedded New embedded status
|
package/lib/cjs/app/CoreApp.js
CHANGED
|
@@ -1614,9 +1614,9 @@ class CoreApp {
|
|
|
1614
1614
|
async tryLogin(params) {
|
|
1615
1615
|
// Check status
|
|
1616
1616
|
if (this._isTryingLogin)
|
|
1617
|
-
return;
|
|
1617
|
+
return false;
|
|
1618
1618
|
this._isTryingLogin = true;
|
|
1619
|
-
|
|
1619
|
+
return true;
|
|
1620
1620
|
}
|
|
1621
1621
|
/**
|
|
1622
1622
|
* Update embedded status
|
package/lib/cjs/app/IApp.d.ts
CHANGED
|
@@ -57,6 +57,19 @@ export type AppLoginParams = DataTypes.SimpleObject & {
|
|
|
57
57
|
*/
|
|
58
58
|
showLoading?: boolean;
|
|
59
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* App try login parameters
|
|
62
|
+
*/
|
|
63
|
+
export type AppTryLoginParams = AppLoginParams & {
|
|
64
|
+
/**
|
|
65
|
+
* Callback on failure
|
|
66
|
+
*/
|
|
67
|
+
onFailure?: () => void;
|
|
68
|
+
/**
|
|
69
|
+
* Callback on success
|
|
70
|
+
*/
|
|
71
|
+
onSuccess?: () => void;
|
|
72
|
+
};
|
|
60
73
|
/**
|
|
61
74
|
* Refresh token props
|
|
62
75
|
*/
|
|
@@ -560,7 +573,7 @@ export interface IApp {
|
|
|
560
573
|
* UI get involved while refreshToken not intended
|
|
561
574
|
* @param params Login parameters
|
|
562
575
|
*/
|
|
563
|
-
tryLogin(params?: AppLoginParams): Promise<
|
|
576
|
+
tryLogin(params?: AppLoginParams): Promise<boolean>;
|
|
564
577
|
/**
|
|
565
578
|
* Update API token and expires
|
|
566
579
|
* @param name Api name
|
package/lib/mjs/app/CoreApp.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { InitCallDto } from '../erp/dto/InitCallDto';
|
|
|
7
7
|
import { InitCallResult, InitCallResultData } from '../result/InitCallResult';
|
|
8
8
|
import { IUser } from '../state/User';
|
|
9
9
|
import { IAppSettings } from './AppSettings';
|
|
10
|
-
import { AppLoginParams, FormatResultCustomCallback, IApp, IAppFields, IDetectIPCallback, NavigateOptions, RefreshTokenProps } from './IApp';
|
|
10
|
+
import { AppLoginParams, AppTryLoginParams, FormatResultCustomCallback, IApp, IAppFields, IDetectIPCallback, NavigateOptions, RefreshTokenProps } from './IApp';
|
|
11
11
|
import { UserRole } from './UserRole';
|
|
12
12
|
import { ExternalEndpoint } from './ExternalSettings';
|
|
13
13
|
import { ApiRefreshTokenDto } from '../erp/dto/ApiRefreshTokenDto';
|
|
@@ -626,7 +626,7 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
626
626
|
* UI get involved while refreshToken not intended
|
|
627
627
|
* @param params Login parameters
|
|
628
628
|
*/
|
|
629
|
-
tryLogin(params?:
|
|
629
|
+
tryLogin(params?: AppTryLoginParams): Promise<boolean>;
|
|
630
630
|
/**
|
|
631
631
|
* Update embedded status
|
|
632
632
|
* @param embedded New embedded status
|
package/lib/mjs/app/CoreApp.js
CHANGED
|
@@ -1611,9 +1611,9 @@ export class CoreApp {
|
|
|
1611
1611
|
async tryLogin(params) {
|
|
1612
1612
|
// Check status
|
|
1613
1613
|
if (this._isTryingLogin)
|
|
1614
|
-
return;
|
|
1614
|
+
return false;
|
|
1615
1615
|
this._isTryingLogin = true;
|
|
1616
|
-
|
|
1616
|
+
return true;
|
|
1617
1617
|
}
|
|
1618
1618
|
/**
|
|
1619
1619
|
* Update embedded status
|
package/lib/mjs/app/IApp.d.ts
CHANGED
|
@@ -57,6 +57,19 @@ export type AppLoginParams = DataTypes.SimpleObject & {
|
|
|
57
57
|
*/
|
|
58
58
|
showLoading?: boolean;
|
|
59
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* App try login parameters
|
|
62
|
+
*/
|
|
63
|
+
export type AppTryLoginParams = AppLoginParams & {
|
|
64
|
+
/**
|
|
65
|
+
* Callback on failure
|
|
66
|
+
*/
|
|
67
|
+
onFailure?: () => void;
|
|
68
|
+
/**
|
|
69
|
+
* Callback on success
|
|
70
|
+
*/
|
|
71
|
+
onSuccess?: () => void;
|
|
72
|
+
};
|
|
60
73
|
/**
|
|
61
74
|
* Refresh token props
|
|
62
75
|
*/
|
|
@@ -560,7 +573,7 @@ export interface IApp {
|
|
|
560
573
|
* UI get involved while refreshToken not intended
|
|
561
574
|
* @param params Login parameters
|
|
562
575
|
*/
|
|
563
|
-
tryLogin(params?: AppLoginParams): Promise<
|
|
576
|
+
tryLogin(params?: AppLoginParams): Promise<boolean>;
|
|
564
577
|
/**
|
|
565
578
|
* Update API token and expires
|
|
566
579
|
* @param name Api name
|
package/package.json
CHANGED
package/src/app/CoreApp.ts
CHANGED
|
@@ -34,6 +34,7 @@ import { IAppSettings } from './AppSettings';
|
|
|
34
34
|
import {
|
|
35
35
|
appFields,
|
|
36
36
|
AppLoginParams,
|
|
37
|
+
AppTryLoginParams,
|
|
37
38
|
FormatResultCustomCallback,
|
|
38
39
|
IApp,
|
|
39
40
|
IAppFields,
|
|
@@ -2199,12 +2200,12 @@ export abstract class CoreApp<
|
|
|
2199
2200
|
* UI get involved while refreshToken not intended
|
|
2200
2201
|
* @param params Login parameters
|
|
2201
2202
|
*/
|
|
2202
|
-
async tryLogin(params?:
|
|
2203
|
+
async tryLogin(params?: AppTryLoginParams) {
|
|
2203
2204
|
// Check status
|
|
2204
|
-
if (this._isTryingLogin) return;
|
|
2205
|
+
if (this._isTryingLogin) return false;
|
|
2205
2206
|
this._isTryingLogin = true;
|
|
2206
2207
|
|
|
2207
|
-
|
|
2208
|
+
return true;
|
|
2208
2209
|
}
|
|
2209
2210
|
|
|
2210
2211
|
/**
|
package/src/app/IApp.ts
CHANGED
|
@@ -83,6 +83,21 @@ export type AppLoginParams = DataTypes.SimpleObject & {
|
|
|
83
83
|
showLoading?: boolean;
|
|
84
84
|
};
|
|
85
85
|
|
|
86
|
+
/**
|
|
87
|
+
* App try login parameters
|
|
88
|
+
*/
|
|
89
|
+
export type AppTryLoginParams = AppLoginParams & {
|
|
90
|
+
/**
|
|
91
|
+
* Callback on failure
|
|
92
|
+
*/
|
|
93
|
+
onFailure?: () => void;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Callback on success
|
|
97
|
+
*/
|
|
98
|
+
onSuccess?: () => void;
|
|
99
|
+
};
|
|
100
|
+
|
|
86
101
|
/**
|
|
87
102
|
* Refresh token props
|
|
88
103
|
*/
|
|
@@ -757,7 +772,7 @@ export interface IApp {
|
|
|
757
772
|
* UI get involved while refreshToken not intended
|
|
758
773
|
* @param params Login parameters
|
|
759
774
|
*/
|
|
760
|
-
tryLogin(params?: AppLoginParams): Promise<
|
|
775
|
+
tryLogin(params?: AppLoginParams): Promise<boolean>;
|
|
761
776
|
|
|
762
777
|
/**
|
|
763
778
|
* Update API token and expires
|