@etsoo/appscript 1.4.35 → 1.4.37
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 +11 -8
- package/lib/cjs/app/CoreApp.js +29 -28
- package/lib/cjs/app/IApp.d.ts +0 -12
- package/lib/cjs/index.d.ts +0 -1
- package/lib/cjs/index.js +0 -1
- package/lib/mjs/app/CoreApp.d.ts +11 -8
- package/lib/mjs/app/CoreApp.js +29 -28
- package/lib/mjs/app/IApp.d.ts +0 -12
- package/lib/mjs/index.d.ts +0 -1
- package/lib/mjs/index.js +0 -1
- package/package.json +1 -1
- package/src/app/CoreApp.ts +32 -35
- package/src/app/IApp.ts +0 -18
- package/src/index.ts +0 -1
- package/lib/cjs/app/IAppApi.d.ts +0 -24
- package/lib/cjs/app/IAppApi.js +0 -2
- package/lib/mjs/app/IAppApi.d.ts +0 -24
- package/lib/mjs/app/IAppApi.js +0 -1
- package/src/app/IAppApi.ts +0 -28
package/lib/cjs/app/CoreApp.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ import { IUser } from '../state/User';
|
|
|
10
10
|
import { IAppSettings } from './AppSettings';
|
|
11
11
|
import { IApp, IAppFields, IDetectIPCallback, NavigateOptions, RefreshTokenProps, RefreshTokenResult } from './IApp';
|
|
12
12
|
import { UserRole } from './UserRole';
|
|
13
|
-
import { IAppApi } from './IAppApi';
|
|
14
13
|
/**
|
|
15
14
|
* Core application interface
|
|
16
15
|
*/
|
|
@@ -180,6 +179,17 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
180
179
|
* @param api Api
|
|
181
180
|
*/
|
|
182
181
|
protected setApi(api: IApi): void;
|
|
182
|
+
/**
|
|
183
|
+
* Setup Api error handler
|
|
184
|
+
* @param api Api
|
|
185
|
+
* @param ignore401 Ignore 401 error try login
|
|
186
|
+
*/
|
|
187
|
+
protected setApiErrorHandler(api: IApi, ignore401?: boolean): void;
|
|
188
|
+
/**
|
|
189
|
+
* Setup Api loading
|
|
190
|
+
* @param api Api
|
|
191
|
+
*/
|
|
192
|
+
protected setApiLoading(api: IApi): void;
|
|
183
193
|
/**
|
|
184
194
|
* Api init call
|
|
185
195
|
* @param data Data
|
|
@@ -220,13 +230,6 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
220
230
|
* @param callback Callback
|
|
221
231
|
*/
|
|
222
232
|
alertResult(result: IActionResult | string, callback?: NotificationReturn<void>): void;
|
|
223
|
-
/**
|
|
224
|
-
* Service application API login
|
|
225
|
-
* @param appApi Service application API
|
|
226
|
-
* @param relogin Relogin try
|
|
227
|
-
* @param callback Callback
|
|
228
|
-
*/
|
|
229
|
-
apiLogin(appApi: IAppApi, relogin?: boolean, callback?: (result: RefreshTokenResult, successData?: string) => void): Promise<boolean>;
|
|
230
233
|
/**
|
|
231
234
|
* Authorize
|
|
232
235
|
* @param token New token
|
package/lib/cjs/app/CoreApp.js
CHANGED
|
@@ -290,25 +290,22 @@ class CoreApp {
|
|
|
290
290
|
// Base URL of the API
|
|
291
291
|
api.baseUrl = this.settings.endpoint;
|
|
292
292
|
// onRequest, show loading or not, rewrite the property to override default action
|
|
293
|
-
|
|
294
|
-
if (data.showLoading == null || data.showLoading) {
|
|
295
|
-
this.notifier.showLoading();
|
|
296
|
-
}
|
|
297
|
-
};
|
|
298
|
-
// onComplete, hide loading, rewrite the property to override default action
|
|
299
|
-
api.onComplete = (data) => {
|
|
300
|
-
if (data.showLoading == null || data.showLoading) {
|
|
301
|
-
this.notifier.hideLoading();
|
|
302
|
-
}
|
|
303
|
-
this.lastCalled = true;
|
|
304
|
-
};
|
|
293
|
+
this.setApiLoading(api);
|
|
305
294
|
// Global API error handler
|
|
295
|
+
this.setApiErrorHandler(api);
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Setup Api error handler
|
|
299
|
+
* @param api Api
|
|
300
|
+
* @param ignore401 Ignore 401 error try login
|
|
301
|
+
*/
|
|
302
|
+
setApiErrorHandler(api, ignore401 = false) {
|
|
306
303
|
api.onError = (error) => {
|
|
307
304
|
// Error code
|
|
308
305
|
const status = error.response
|
|
309
306
|
? api.transformResponse(error.response).status
|
|
310
307
|
: undefined;
|
|
311
|
-
if (status === 401) {
|
|
308
|
+
if (status === 401 && !ignore401) {
|
|
312
309
|
// When status is equal to 401, unauthorized, try login
|
|
313
310
|
this.tryLogin();
|
|
314
311
|
}
|
|
@@ -318,6 +315,25 @@ class CoreApp {
|
|
|
318
315
|
}
|
|
319
316
|
};
|
|
320
317
|
}
|
|
318
|
+
/**
|
|
319
|
+
* Setup Api loading
|
|
320
|
+
* @param api Api
|
|
321
|
+
*/
|
|
322
|
+
setApiLoading(api) {
|
|
323
|
+
// onRequest, show loading or not, rewrite the property to override default action
|
|
324
|
+
api.onRequest = (data) => {
|
|
325
|
+
if (data.showLoading == null || data.showLoading) {
|
|
326
|
+
this.notifier.showLoading();
|
|
327
|
+
}
|
|
328
|
+
};
|
|
329
|
+
// onComplete, hide loading, rewrite the property to override default action
|
|
330
|
+
api.onComplete = (data) => {
|
|
331
|
+
if (data.showLoading == null || data.showLoading) {
|
|
332
|
+
this.notifier.hideLoading();
|
|
333
|
+
}
|
|
334
|
+
this.lastCalled = true;
|
|
335
|
+
};
|
|
336
|
+
}
|
|
321
337
|
/**
|
|
322
338
|
* Api init call
|
|
323
339
|
* @param data Data
|
|
@@ -488,21 +504,6 @@ class CoreApp {
|
|
|
488
504
|
const message = typeof result === 'string' ? result : this.formatResult(result);
|
|
489
505
|
this.notifier.alert(message, callback);
|
|
490
506
|
}
|
|
491
|
-
/**
|
|
492
|
-
* Service application API login
|
|
493
|
-
* @param appApi Service application API
|
|
494
|
-
* @param relogin Relogin try
|
|
495
|
-
* @param callback Callback
|
|
496
|
-
*/
|
|
497
|
-
apiLogin(appApi, relogin = true, callback) {
|
|
498
|
-
return this.refreshToken({
|
|
499
|
-
callback,
|
|
500
|
-
data: appApi.getrefreshTokenData(),
|
|
501
|
-
relogin,
|
|
502
|
-
showLoading: false,
|
|
503
|
-
appApi
|
|
504
|
-
});
|
|
505
|
-
}
|
|
506
507
|
/**
|
|
507
508
|
* Authorize
|
|
508
509
|
* @param token New token
|
package/lib/cjs/app/IApp.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ import { IUser } from '../state/User';
|
|
|
7
7
|
import { IAppSettings } from './AppSettings';
|
|
8
8
|
import { UserRole } from './UserRole';
|
|
9
9
|
import { EntityStatus } from '../business/EntityStatus';
|
|
10
|
-
import { IAppApi } from './IAppApi';
|
|
11
10
|
/**
|
|
12
11
|
* Detect IP callback interface
|
|
13
12
|
*/
|
|
@@ -47,10 +46,6 @@ export interface RefreshTokenProps<D extends object> {
|
|
|
47
46
|
* Show loading bar or not
|
|
48
47
|
*/
|
|
49
48
|
showLoading?: boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Service application API
|
|
52
|
-
*/
|
|
53
|
-
appApi?: IAppApi;
|
|
54
49
|
}
|
|
55
50
|
/**
|
|
56
51
|
* App fields
|
|
@@ -158,13 +153,6 @@ export interface IApp {
|
|
|
158
153
|
* @param callback Callback
|
|
159
154
|
*/
|
|
160
155
|
alertResult(result: IActionResult | string, callback?: NotificationReturn<void>): void;
|
|
161
|
-
/**
|
|
162
|
-
* Service application API login
|
|
163
|
-
* @param appApi Service application API
|
|
164
|
-
* @param relogin Relogin try
|
|
165
|
-
* @param callback Callback
|
|
166
|
-
*/
|
|
167
|
-
apiLogin(appApi: IAppApi, relogin?: boolean, callback?: (result: RefreshTokenResult, successData?: string) => void): Promise<boolean>;
|
|
168
156
|
/**
|
|
169
157
|
* Authorize
|
|
170
158
|
* @param token New token
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ export * from './app/AppSettings';
|
|
|
12
12
|
export * from './app/CoreApp';
|
|
13
13
|
export * from './app/ExternalSettings';
|
|
14
14
|
export * from './app/IApp';
|
|
15
|
-
export * from './app/IAppApi';
|
|
16
15
|
export * from './app/UserRole';
|
|
17
16
|
export * from './bridges/BridgeUtils';
|
|
18
17
|
export * from './bridges/IBridgeHost';
|
package/lib/cjs/index.js
CHANGED
|
@@ -31,7 +31,6 @@ __exportStar(require("./app/AppSettings"), exports);
|
|
|
31
31
|
__exportStar(require("./app/CoreApp"), exports);
|
|
32
32
|
__exportStar(require("./app/ExternalSettings"), exports);
|
|
33
33
|
__exportStar(require("./app/IApp"), exports);
|
|
34
|
-
__exportStar(require("./app/IAppApi"), exports);
|
|
35
34
|
__exportStar(require("./app/UserRole"), exports);
|
|
36
35
|
// bridges
|
|
37
36
|
__exportStar(require("./bridges/BridgeUtils"), exports);
|
package/lib/mjs/app/CoreApp.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ import { IUser } from '../state/User';
|
|
|
10
10
|
import { IAppSettings } from './AppSettings';
|
|
11
11
|
import { IApp, IAppFields, IDetectIPCallback, NavigateOptions, RefreshTokenProps, RefreshTokenResult } from './IApp';
|
|
12
12
|
import { UserRole } from './UserRole';
|
|
13
|
-
import { IAppApi } from './IAppApi';
|
|
14
13
|
/**
|
|
15
14
|
* Core application interface
|
|
16
15
|
*/
|
|
@@ -180,6 +179,17 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
180
179
|
* @param api Api
|
|
181
180
|
*/
|
|
182
181
|
protected setApi(api: IApi): void;
|
|
182
|
+
/**
|
|
183
|
+
* Setup Api error handler
|
|
184
|
+
* @param api Api
|
|
185
|
+
* @param ignore401 Ignore 401 error try login
|
|
186
|
+
*/
|
|
187
|
+
protected setApiErrorHandler(api: IApi, ignore401?: boolean): void;
|
|
188
|
+
/**
|
|
189
|
+
* Setup Api loading
|
|
190
|
+
* @param api Api
|
|
191
|
+
*/
|
|
192
|
+
protected setApiLoading(api: IApi): void;
|
|
183
193
|
/**
|
|
184
194
|
* Api init call
|
|
185
195
|
* @param data Data
|
|
@@ -220,13 +230,6 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
220
230
|
* @param callback Callback
|
|
221
231
|
*/
|
|
222
232
|
alertResult(result: IActionResult | string, callback?: NotificationReturn<void>): void;
|
|
223
|
-
/**
|
|
224
|
-
* Service application API login
|
|
225
|
-
* @param appApi Service application API
|
|
226
|
-
* @param relogin Relogin try
|
|
227
|
-
* @param callback Callback
|
|
228
|
-
*/
|
|
229
|
-
apiLogin(appApi: IAppApi, relogin?: boolean, callback?: (result: RefreshTokenResult, successData?: string) => void): Promise<boolean>;
|
|
230
233
|
/**
|
|
231
234
|
* Authorize
|
|
232
235
|
* @param token New token
|
package/lib/mjs/app/CoreApp.js
CHANGED
|
@@ -264,25 +264,22 @@ export class CoreApp {
|
|
|
264
264
|
// Base URL of the API
|
|
265
265
|
api.baseUrl = this.settings.endpoint;
|
|
266
266
|
// onRequest, show loading or not, rewrite the property to override default action
|
|
267
|
-
|
|
268
|
-
if (data.showLoading == null || data.showLoading) {
|
|
269
|
-
this.notifier.showLoading();
|
|
270
|
-
}
|
|
271
|
-
};
|
|
272
|
-
// onComplete, hide loading, rewrite the property to override default action
|
|
273
|
-
api.onComplete = (data) => {
|
|
274
|
-
if (data.showLoading == null || data.showLoading) {
|
|
275
|
-
this.notifier.hideLoading();
|
|
276
|
-
}
|
|
277
|
-
this.lastCalled = true;
|
|
278
|
-
};
|
|
267
|
+
this.setApiLoading(api);
|
|
279
268
|
// Global API error handler
|
|
269
|
+
this.setApiErrorHandler(api);
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Setup Api error handler
|
|
273
|
+
* @param api Api
|
|
274
|
+
* @param ignore401 Ignore 401 error try login
|
|
275
|
+
*/
|
|
276
|
+
setApiErrorHandler(api, ignore401 = false) {
|
|
280
277
|
api.onError = (error) => {
|
|
281
278
|
// Error code
|
|
282
279
|
const status = error.response
|
|
283
280
|
? api.transformResponse(error.response).status
|
|
284
281
|
: undefined;
|
|
285
|
-
if (status === 401) {
|
|
282
|
+
if (status === 401 && !ignore401) {
|
|
286
283
|
// When status is equal to 401, unauthorized, try login
|
|
287
284
|
this.tryLogin();
|
|
288
285
|
}
|
|
@@ -292,6 +289,25 @@ export class CoreApp {
|
|
|
292
289
|
}
|
|
293
290
|
};
|
|
294
291
|
}
|
|
292
|
+
/**
|
|
293
|
+
* Setup Api loading
|
|
294
|
+
* @param api Api
|
|
295
|
+
*/
|
|
296
|
+
setApiLoading(api) {
|
|
297
|
+
// onRequest, show loading or not, rewrite the property to override default action
|
|
298
|
+
api.onRequest = (data) => {
|
|
299
|
+
if (data.showLoading == null || data.showLoading) {
|
|
300
|
+
this.notifier.showLoading();
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
// onComplete, hide loading, rewrite the property to override default action
|
|
304
|
+
api.onComplete = (data) => {
|
|
305
|
+
if (data.showLoading == null || data.showLoading) {
|
|
306
|
+
this.notifier.hideLoading();
|
|
307
|
+
}
|
|
308
|
+
this.lastCalled = true;
|
|
309
|
+
};
|
|
310
|
+
}
|
|
295
311
|
/**
|
|
296
312
|
* Api init call
|
|
297
313
|
* @param data Data
|
|
@@ -462,21 +478,6 @@ export class CoreApp {
|
|
|
462
478
|
const message = typeof result === 'string' ? result : this.formatResult(result);
|
|
463
479
|
this.notifier.alert(message, callback);
|
|
464
480
|
}
|
|
465
|
-
/**
|
|
466
|
-
* Service application API login
|
|
467
|
-
* @param appApi Service application API
|
|
468
|
-
* @param relogin Relogin try
|
|
469
|
-
* @param callback Callback
|
|
470
|
-
*/
|
|
471
|
-
apiLogin(appApi, relogin = true, callback) {
|
|
472
|
-
return this.refreshToken({
|
|
473
|
-
callback,
|
|
474
|
-
data: appApi.getrefreshTokenData(),
|
|
475
|
-
relogin,
|
|
476
|
-
showLoading: false,
|
|
477
|
-
appApi
|
|
478
|
-
});
|
|
479
|
-
}
|
|
480
481
|
/**
|
|
481
482
|
* Authorize
|
|
482
483
|
* @param token New token
|
package/lib/mjs/app/IApp.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ import { IUser } from '../state/User';
|
|
|
7
7
|
import { IAppSettings } from './AppSettings';
|
|
8
8
|
import { UserRole } from './UserRole';
|
|
9
9
|
import { EntityStatus } from '../business/EntityStatus';
|
|
10
|
-
import { IAppApi } from './IAppApi';
|
|
11
10
|
/**
|
|
12
11
|
* Detect IP callback interface
|
|
13
12
|
*/
|
|
@@ -47,10 +46,6 @@ export interface RefreshTokenProps<D extends object> {
|
|
|
47
46
|
* Show loading bar or not
|
|
48
47
|
*/
|
|
49
48
|
showLoading?: boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Service application API
|
|
52
|
-
*/
|
|
53
|
-
appApi?: IAppApi;
|
|
54
49
|
}
|
|
55
50
|
/**
|
|
56
51
|
* App fields
|
|
@@ -158,13 +153,6 @@ export interface IApp {
|
|
|
158
153
|
* @param callback Callback
|
|
159
154
|
*/
|
|
160
155
|
alertResult(result: IActionResult | string, callback?: NotificationReturn<void>): void;
|
|
161
|
-
/**
|
|
162
|
-
* Service application API login
|
|
163
|
-
* @param appApi Service application API
|
|
164
|
-
* @param relogin Relogin try
|
|
165
|
-
* @param callback Callback
|
|
166
|
-
*/
|
|
167
|
-
apiLogin(appApi: IAppApi, relogin?: boolean, callback?: (result: RefreshTokenResult, successData?: string) => void): Promise<boolean>;
|
|
168
156
|
/**
|
|
169
157
|
* Authorize
|
|
170
158
|
* @param token New token
|
package/lib/mjs/index.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ export * from './app/AppSettings';
|
|
|
12
12
|
export * from './app/CoreApp';
|
|
13
13
|
export * from './app/ExternalSettings';
|
|
14
14
|
export * from './app/IApp';
|
|
15
|
-
export * from './app/IAppApi';
|
|
16
15
|
export * from './app/UserRole';
|
|
17
16
|
export * from './bridges/BridgeUtils';
|
|
18
17
|
export * from './bridges/IBridgeHost';
|
package/lib/mjs/index.js
CHANGED
|
@@ -14,7 +14,6 @@ export * from './app/AppSettings';
|
|
|
14
14
|
export * from './app/CoreApp';
|
|
15
15
|
export * from './app/ExternalSettings';
|
|
16
16
|
export * from './app/IApp';
|
|
17
|
-
export * from './app/IAppApi';
|
|
18
17
|
export * from './app/UserRole';
|
|
19
18
|
// bridges
|
|
20
19
|
export * from './bridges/BridgeUtils';
|
package/package.json
CHANGED
package/src/app/CoreApp.ts
CHANGED
|
@@ -39,7 +39,6 @@ import {
|
|
|
39
39
|
} from './IApp';
|
|
40
40
|
import { UserRole } from './UserRole';
|
|
41
41
|
import type CryptoJS from 'crypto-js';
|
|
42
|
-
import { IAppApi } from './IAppApi';
|
|
43
42
|
|
|
44
43
|
type CJType = typeof CryptoJS;
|
|
45
44
|
let CJ: CJType;
|
|
@@ -447,28 +446,25 @@ export abstract class CoreApp<
|
|
|
447
446
|
api.baseUrl = this.settings.endpoint;
|
|
448
447
|
|
|
449
448
|
// onRequest, show loading or not, rewrite the property to override default action
|
|
450
|
-
|
|
451
|
-
if (data.showLoading == null || data.showLoading) {
|
|
452
|
-
this.notifier.showLoading();
|
|
453
|
-
}
|
|
454
|
-
};
|
|
455
|
-
|
|
456
|
-
// onComplete, hide loading, rewrite the property to override default action
|
|
457
|
-
api.onComplete = (data) => {
|
|
458
|
-
if (data.showLoading == null || data.showLoading) {
|
|
459
|
-
this.notifier.hideLoading();
|
|
460
|
-
}
|
|
461
|
-
this.lastCalled = true;
|
|
462
|
-
};
|
|
449
|
+
this.setApiLoading(api);
|
|
463
450
|
|
|
464
451
|
// Global API error handler
|
|
452
|
+
this.setApiErrorHandler(api);
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Setup Api error handler
|
|
457
|
+
* @param api Api
|
|
458
|
+
* @param ignore401 Ignore 401 error try login
|
|
459
|
+
*/
|
|
460
|
+
protected setApiErrorHandler(api: IApi, ignore401: boolean = false) {
|
|
465
461
|
api.onError = (error: ApiDataError) => {
|
|
466
462
|
// Error code
|
|
467
463
|
const status = error.response
|
|
468
464
|
? api.transformResponse(error.response).status
|
|
469
465
|
: undefined;
|
|
470
466
|
|
|
471
|
-
if (status === 401) {
|
|
467
|
+
if (status === 401 && !ignore401) {
|
|
472
468
|
// When status is equal to 401, unauthorized, try login
|
|
473
469
|
this.tryLogin();
|
|
474
470
|
} else {
|
|
@@ -478,6 +474,27 @@ export abstract class CoreApp<
|
|
|
478
474
|
};
|
|
479
475
|
}
|
|
480
476
|
|
|
477
|
+
/**
|
|
478
|
+
* Setup Api loading
|
|
479
|
+
* @param api Api
|
|
480
|
+
*/
|
|
481
|
+
protected setApiLoading(api: IApi) {
|
|
482
|
+
// onRequest, show loading or not, rewrite the property to override default action
|
|
483
|
+
api.onRequest = (data) => {
|
|
484
|
+
if (data.showLoading == null || data.showLoading) {
|
|
485
|
+
this.notifier.showLoading();
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
|
|
489
|
+
// onComplete, hide loading, rewrite the property to override default action
|
|
490
|
+
api.onComplete = (data) => {
|
|
491
|
+
if (data.showLoading == null || data.showLoading) {
|
|
492
|
+
this.notifier.hideLoading();
|
|
493
|
+
}
|
|
494
|
+
this.lastCalled = true;
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
|
|
481
498
|
/**
|
|
482
499
|
* Api init call
|
|
483
500
|
* @param data Data
|
|
@@ -701,26 +718,6 @@ export abstract class CoreApp<
|
|
|
701
718
|
this.notifier.alert(message, callback);
|
|
702
719
|
}
|
|
703
720
|
|
|
704
|
-
/**
|
|
705
|
-
* Service application API login
|
|
706
|
-
* @param appApi Service application API
|
|
707
|
-
* @param relogin Relogin try
|
|
708
|
-
* @param callback Callback
|
|
709
|
-
*/
|
|
710
|
-
apiLogin(
|
|
711
|
-
appApi: IAppApi,
|
|
712
|
-
relogin: boolean = true,
|
|
713
|
-
callback?: (result: RefreshTokenResult, successData?: string) => void
|
|
714
|
-
) {
|
|
715
|
-
return this.refreshToken({
|
|
716
|
-
callback,
|
|
717
|
-
data: appApi.getrefreshTokenData(),
|
|
718
|
-
relogin,
|
|
719
|
-
showLoading: false,
|
|
720
|
-
appApi
|
|
721
|
-
});
|
|
722
|
-
}
|
|
723
|
-
|
|
724
721
|
/**
|
|
725
722
|
* Authorize
|
|
726
723
|
* @param token New token
|
package/src/app/IApp.ts
CHANGED
|
@@ -19,7 +19,6 @@ import { IUser } from '../state/User';
|
|
|
19
19
|
import { IAppSettings } from './AppSettings';
|
|
20
20
|
import { UserRole } from './UserRole';
|
|
21
21
|
import { EntityStatus } from '../business/EntityStatus';
|
|
22
|
-
import { IAppApi } from './IAppApi';
|
|
23
22
|
|
|
24
23
|
/**
|
|
25
24
|
* Detect IP callback interface
|
|
@@ -70,11 +69,6 @@ export interface RefreshTokenProps<D extends object> {
|
|
|
70
69
|
* Show loading bar or not
|
|
71
70
|
*/
|
|
72
71
|
showLoading?: boolean;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Service application API
|
|
76
|
-
*/
|
|
77
|
-
appApi?: IAppApi;
|
|
78
72
|
}
|
|
79
73
|
|
|
80
74
|
/**
|
|
@@ -214,18 +208,6 @@ export interface IApp {
|
|
|
214
208
|
callback?: NotificationReturn<void>
|
|
215
209
|
): void;
|
|
216
210
|
|
|
217
|
-
/**
|
|
218
|
-
* Service application API login
|
|
219
|
-
* @param appApi Service application API
|
|
220
|
-
* @param relogin Relogin try
|
|
221
|
-
* @param callback Callback
|
|
222
|
-
*/
|
|
223
|
-
apiLogin(
|
|
224
|
-
appApi: IAppApi,
|
|
225
|
-
relogin?: boolean,
|
|
226
|
-
callback?: (result: RefreshTokenResult, successData?: string) => void
|
|
227
|
-
): Promise<boolean>;
|
|
228
|
-
|
|
229
211
|
/**
|
|
230
212
|
* Authorize
|
|
231
213
|
* @param token New token
|
package/src/index.ts
CHANGED
package/lib/cjs/app/IAppApi.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { IApi } from '@etsoo/restclient';
|
|
2
|
-
/**
|
|
3
|
-
* Service application API, Implement interface calls between different services
|
|
4
|
-
* 服务程序接口,实现不同服务之间的接口调用
|
|
5
|
-
*/
|
|
6
|
-
export interface IAppApi {
|
|
7
|
-
/**
|
|
8
|
-
* API
|
|
9
|
-
*/
|
|
10
|
-
readonly api: IApi<any>;
|
|
11
|
-
/**
|
|
12
|
-
* Service id
|
|
13
|
-
*/
|
|
14
|
-
readonly serviceId: number;
|
|
15
|
-
/**
|
|
16
|
-
* Authorize the API
|
|
17
|
-
* @param token Access token
|
|
18
|
-
*/
|
|
19
|
-
authorize(token: string): void;
|
|
20
|
-
/**
|
|
21
|
-
* Get refresh token data
|
|
22
|
-
*/
|
|
23
|
-
getrefreshTokenData(): Object;
|
|
24
|
-
}
|
package/lib/cjs/app/IAppApi.js
DELETED
package/lib/mjs/app/IAppApi.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { IApi } from '@etsoo/restclient';
|
|
2
|
-
/**
|
|
3
|
-
* Service application API, Implement interface calls between different services
|
|
4
|
-
* 服务程序接口,实现不同服务之间的接口调用
|
|
5
|
-
*/
|
|
6
|
-
export interface IAppApi {
|
|
7
|
-
/**
|
|
8
|
-
* API
|
|
9
|
-
*/
|
|
10
|
-
readonly api: IApi<any>;
|
|
11
|
-
/**
|
|
12
|
-
* Service id
|
|
13
|
-
*/
|
|
14
|
-
readonly serviceId: number;
|
|
15
|
-
/**
|
|
16
|
-
* Authorize the API
|
|
17
|
-
* @param token Access token
|
|
18
|
-
*/
|
|
19
|
-
authorize(token: string): void;
|
|
20
|
-
/**
|
|
21
|
-
* Get refresh token data
|
|
22
|
-
*/
|
|
23
|
-
getrefreshTokenData(): Object;
|
|
24
|
-
}
|
package/lib/mjs/app/IAppApi.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/src/app/IAppApi.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { IApi } from '@etsoo/restclient';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Service application API, Implement interface calls between different services
|
|
5
|
-
* 服务程序接口,实现不同服务之间的接口调用
|
|
6
|
-
*/
|
|
7
|
-
export interface IAppApi {
|
|
8
|
-
/**
|
|
9
|
-
* API
|
|
10
|
-
*/
|
|
11
|
-
readonly api: IApi<any>;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Service id
|
|
15
|
-
*/
|
|
16
|
-
readonly serviceId: number;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Authorize the API
|
|
20
|
-
* @param token Access token
|
|
21
|
-
*/
|
|
22
|
-
authorize(token: string): void;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Get refresh token data
|
|
26
|
-
*/
|
|
27
|
-
getrefreshTokenData(): Object;
|
|
28
|
-
}
|