@etsoo/appscript 1.4.8 → 1.4.9
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 +8 -2
- package/lib/cjs/app/CoreApp.js +18 -1
- package/lib/cjs/app/IApp.d.ts +6 -2
- package/lib/mjs/app/CoreApp.d.ts +8 -2
- package/lib/mjs/app/CoreApp.js +18 -1
- package/lib/mjs/app/IApp.d.ts +6 -2
- package/package.json +1 -1
- package/src/app/CoreApp.ts +20 -3
- package/src/app/IApp.ts +7 -2
package/lib/cjs/app/CoreApp.d.ts
CHANGED
|
@@ -60,9 +60,9 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
60
60
|
*/
|
|
61
61
|
readonly storage: IStorage;
|
|
62
62
|
/**
|
|
63
|
-
*
|
|
63
|
+
* Pending actions
|
|
64
64
|
*/
|
|
65
|
-
|
|
65
|
+
readonly pendings: (() => any)[];
|
|
66
66
|
private _culture;
|
|
67
67
|
/**
|
|
68
68
|
* Culture, like zh-CN
|
|
@@ -110,6 +110,12 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
110
110
|
*/
|
|
111
111
|
get authorized(): boolean;
|
|
112
112
|
private set authorized(value);
|
|
113
|
+
private _isReady;
|
|
114
|
+
/**
|
|
115
|
+
* Is the app ready
|
|
116
|
+
*/
|
|
117
|
+
get isReady(): boolean;
|
|
118
|
+
private set isReady(value);
|
|
113
119
|
private _isTryingLogin;
|
|
114
120
|
/**
|
|
115
121
|
* Last called with token refresh
|
package/lib/cjs/app/CoreApp.js
CHANGED
|
@@ -96,6 +96,15 @@ class CoreApp {
|
|
|
96
96
|
set authorized(value) {
|
|
97
97
|
this._authorized = value;
|
|
98
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* Is the app ready
|
|
101
|
+
*/
|
|
102
|
+
get isReady() {
|
|
103
|
+
return this._isReady;
|
|
104
|
+
}
|
|
105
|
+
set isReady(value) {
|
|
106
|
+
this._isReady = value;
|
|
107
|
+
}
|
|
99
108
|
/**
|
|
100
109
|
* Get persisted fields
|
|
101
110
|
*/
|
|
@@ -117,7 +126,12 @@ class CoreApp {
|
|
|
117
126
|
*/
|
|
118
127
|
constructor(settings, api, notifier, storage, name) {
|
|
119
128
|
var _a;
|
|
129
|
+
/**
|
|
130
|
+
* Pending actions
|
|
131
|
+
*/
|
|
132
|
+
this.pendings = [];
|
|
120
133
|
this._authorized = false;
|
|
134
|
+
this._isReady = false;
|
|
121
135
|
this._isTryingLogin = false;
|
|
122
136
|
/**
|
|
123
137
|
* Last called with token refresh
|
|
@@ -473,7 +487,6 @@ class CoreApp {
|
|
|
473
487
|
authorize(token, refreshToken) {
|
|
474
488
|
var _a;
|
|
475
489
|
// State, when token is null, means logout
|
|
476
|
-
this.accessToken = token;
|
|
477
490
|
this.authorized = token != null;
|
|
478
491
|
// Token
|
|
479
492
|
this.api.authorize(this.settings.authScheme, token);
|
|
@@ -1208,8 +1221,12 @@ class CoreApp {
|
|
|
1208
1221
|
* Setup callback
|
|
1209
1222
|
*/
|
|
1210
1223
|
setup() {
|
|
1224
|
+
// Ready
|
|
1225
|
+
this.isReady = true;
|
|
1211
1226
|
// Restore
|
|
1212
1227
|
this.restore();
|
|
1228
|
+
// Pending actions
|
|
1229
|
+
this.pendings.forEach((p) => p());
|
|
1213
1230
|
}
|
|
1214
1231
|
/**
|
|
1215
1232
|
* Signout
|
package/lib/cjs/app/IApp.d.ts
CHANGED
|
@@ -109,14 +109,18 @@ export interface IApp {
|
|
|
109
109
|
* Is current authorized
|
|
110
110
|
*/
|
|
111
111
|
readonly authorized: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Is the app ready
|
|
114
|
+
*/
|
|
115
|
+
readonly isReady: boolean;
|
|
112
116
|
/**
|
|
113
117
|
* Application name
|
|
114
118
|
*/
|
|
115
119
|
readonly name: string;
|
|
116
120
|
/**
|
|
117
|
-
*
|
|
121
|
+
* Pending actions
|
|
118
122
|
*/
|
|
119
|
-
|
|
123
|
+
readonly pendings: (() => any)[];
|
|
120
124
|
/**
|
|
121
125
|
* IP data
|
|
122
126
|
*/
|
package/lib/mjs/app/CoreApp.d.ts
CHANGED
|
@@ -60,9 +60,9 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
60
60
|
*/
|
|
61
61
|
readonly storage: IStorage;
|
|
62
62
|
/**
|
|
63
|
-
*
|
|
63
|
+
* Pending actions
|
|
64
64
|
*/
|
|
65
|
-
|
|
65
|
+
readonly pendings: (() => any)[];
|
|
66
66
|
private _culture;
|
|
67
67
|
/**
|
|
68
68
|
* Culture, like zh-CN
|
|
@@ -110,6 +110,12 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
110
110
|
*/
|
|
111
111
|
get authorized(): boolean;
|
|
112
112
|
private set authorized(value);
|
|
113
|
+
private _isReady;
|
|
114
|
+
/**
|
|
115
|
+
* Is the app ready
|
|
116
|
+
*/
|
|
117
|
+
get isReady(): boolean;
|
|
118
|
+
private set isReady(value);
|
|
113
119
|
private _isTryingLogin;
|
|
114
120
|
/**
|
|
115
121
|
* Last called with token refresh
|
package/lib/mjs/app/CoreApp.js
CHANGED
|
@@ -70,6 +70,15 @@ export class CoreApp {
|
|
|
70
70
|
set authorized(value) {
|
|
71
71
|
this._authorized = value;
|
|
72
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Is the app ready
|
|
75
|
+
*/
|
|
76
|
+
get isReady() {
|
|
77
|
+
return this._isReady;
|
|
78
|
+
}
|
|
79
|
+
set isReady(value) {
|
|
80
|
+
this._isReady = value;
|
|
81
|
+
}
|
|
73
82
|
/**
|
|
74
83
|
* Get persisted fields
|
|
75
84
|
*/
|
|
@@ -91,7 +100,12 @@ export class CoreApp {
|
|
|
91
100
|
*/
|
|
92
101
|
constructor(settings, api, notifier, storage, name) {
|
|
93
102
|
var _a;
|
|
103
|
+
/**
|
|
104
|
+
* Pending actions
|
|
105
|
+
*/
|
|
106
|
+
this.pendings = [];
|
|
94
107
|
this._authorized = false;
|
|
108
|
+
this._isReady = false;
|
|
95
109
|
this._isTryingLogin = false;
|
|
96
110
|
/**
|
|
97
111
|
* Last called with token refresh
|
|
@@ -447,7 +461,6 @@ export class CoreApp {
|
|
|
447
461
|
authorize(token, refreshToken) {
|
|
448
462
|
var _a;
|
|
449
463
|
// State, when token is null, means logout
|
|
450
|
-
this.accessToken = token;
|
|
451
464
|
this.authorized = token != null;
|
|
452
465
|
// Token
|
|
453
466
|
this.api.authorize(this.settings.authScheme, token);
|
|
@@ -1182,8 +1195,12 @@ export class CoreApp {
|
|
|
1182
1195
|
* Setup callback
|
|
1183
1196
|
*/
|
|
1184
1197
|
setup() {
|
|
1198
|
+
// Ready
|
|
1199
|
+
this.isReady = true;
|
|
1185
1200
|
// Restore
|
|
1186
1201
|
this.restore();
|
|
1202
|
+
// Pending actions
|
|
1203
|
+
this.pendings.forEach((p) => p());
|
|
1187
1204
|
}
|
|
1188
1205
|
/**
|
|
1189
1206
|
* Signout
|
package/lib/mjs/app/IApp.d.ts
CHANGED
|
@@ -109,14 +109,18 @@ export interface IApp {
|
|
|
109
109
|
* Is current authorized
|
|
110
110
|
*/
|
|
111
111
|
readonly authorized: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Is the app ready
|
|
114
|
+
*/
|
|
115
|
+
readonly isReady: boolean;
|
|
112
116
|
/**
|
|
113
117
|
* Application name
|
|
114
118
|
*/
|
|
115
119
|
readonly name: string;
|
|
116
120
|
/**
|
|
117
|
-
*
|
|
121
|
+
* Pending actions
|
|
118
122
|
*/
|
|
119
|
-
|
|
123
|
+
readonly pendings: (() => any)[];
|
|
120
124
|
/**
|
|
121
125
|
* IP data
|
|
122
126
|
*/
|
package/package.json
CHANGED
package/src/app/CoreApp.ts
CHANGED
|
@@ -114,9 +114,9 @@ export abstract class CoreApp<
|
|
|
114
114
|
readonly storage: IStorage;
|
|
115
115
|
|
|
116
116
|
/**
|
|
117
|
-
*
|
|
117
|
+
* Pending actions
|
|
118
118
|
*/
|
|
119
|
-
|
|
119
|
+
readonly pendings: (() => any)[] = [];
|
|
120
120
|
|
|
121
121
|
private _culture!: string;
|
|
122
122
|
/**
|
|
@@ -199,6 +199,18 @@ export abstract class CoreApp<
|
|
|
199
199
|
this._authorized = value;
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
+
private _isReady: boolean = false;
|
|
203
|
+
/**
|
|
204
|
+
* Is the app ready
|
|
205
|
+
*/
|
|
206
|
+
get isReady() {
|
|
207
|
+
return this._isReady;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
private set isReady(value: boolean) {
|
|
211
|
+
this._isReady = value;
|
|
212
|
+
}
|
|
213
|
+
|
|
202
214
|
private _isTryingLogin = false;
|
|
203
215
|
|
|
204
216
|
/**
|
|
@@ -683,7 +695,6 @@ export abstract class CoreApp<
|
|
|
683
695
|
*/
|
|
684
696
|
authorize(token?: string, refreshToken?: string) {
|
|
685
697
|
// State, when token is null, means logout
|
|
686
|
-
this.accessToken = token;
|
|
687
698
|
this.authorized = token != null;
|
|
688
699
|
|
|
689
700
|
// Token
|
|
@@ -1548,8 +1559,14 @@ export abstract class CoreApp<
|
|
|
1548
1559
|
* Setup callback
|
|
1549
1560
|
*/
|
|
1550
1561
|
setup() {
|
|
1562
|
+
// Ready
|
|
1563
|
+
this.isReady = true;
|
|
1564
|
+
|
|
1551
1565
|
// Restore
|
|
1552
1566
|
this.restore();
|
|
1567
|
+
|
|
1568
|
+
// Pending actions
|
|
1569
|
+
this.pendings.forEach((p) => p());
|
|
1553
1570
|
}
|
|
1554
1571
|
|
|
1555
1572
|
/**
|
package/src/app/IApp.ts
CHANGED
|
@@ -151,15 +151,20 @@ export interface IApp {
|
|
|
151
151
|
*/
|
|
152
152
|
readonly authorized: boolean;
|
|
153
153
|
|
|
154
|
+
/**
|
|
155
|
+
* Is the app ready
|
|
156
|
+
*/
|
|
157
|
+
readonly isReady: boolean;
|
|
158
|
+
|
|
154
159
|
/**
|
|
155
160
|
* Application name
|
|
156
161
|
*/
|
|
157
162
|
readonly name: string;
|
|
158
163
|
|
|
159
164
|
/**
|
|
160
|
-
*
|
|
165
|
+
* Pending actions
|
|
161
166
|
*/
|
|
162
|
-
|
|
167
|
+
readonly pendings: (() => any)[];
|
|
163
168
|
|
|
164
169
|
/**
|
|
165
170
|
* IP data
|