@etsoo/appscript 1.6.14 → 1.6.16

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.
@@ -12,6 +12,7 @@ import { SignoutRQ } from "./rq/SignoutRQ";
12
12
  import { SwitchOrgRQ } from "./rq/SwitchOrgRQ";
13
13
  import { AuthRequest } from "./rq/AuthRequest";
14
14
  import { CheckUserIdentifierRQ } from "./rq/CheckUserIdentifierRQ";
15
+ import { AdminSupportRQ } from "./rq/AdminSupportRQ";
15
16
  /**
16
17
  * Authentication API
17
18
  */
@@ -20,6 +21,13 @@ export declare class AuthApi extends BaseApi {
20
21
  * Header token field name
21
22
  */
22
23
  static HeaderTokenField: string;
24
+ /**
25
+ * Admin support
26
+ * @param rq Request data
27
+ * @param payload Payload
28
+ * @returns Result
29
+ */
30
+ adminSupport(rq: AdminSupportRQ, payload?: IApiPayload<IActionResult<LoginInputAuthResult>>): Promise<IActionResult<LoginInputAuthResult> | undefined>;
23
31
  /**
24
32
  * API refresh token
25
33
  * @param rq Request data
@@ -7,6 +7,15 @@ const shared_1 = require("@etsoo/shared");
7
7
  * Authentication API
8
8
  */
9
9
  class AuthApi extends BaseApi_1.BaseApi {
10
+ /**
11
+ * Admin support
12
+ * @param rq Request data
13
+ * @param payload Payload
14
+ * @returns Result
15
+ */
16
+ adminSupport(rq, payload) {
17
+ return this.api.post("Auth/AdminSupport", rq, payload);
18
+ }
10
19
  /**
11
20
  * API refresh token
12
21
  * @param rq Request data
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Admin support request data
3
+ * 管理员支持请求数据
4
+ */
5
+ export type AdminSupportRQ = {
6
+ /**
7
+ * Target organization ID
8
+ * 目标机构编号
9
+ */
10
+ orgId: number;
11
+ /**
12
+ * Requester
13
+ * 请求人
14
+ */
15
+ requester: number;
16
+ /**
17
+ * Approver
18
+ * 批准人
19
+ */
20
+ approver: number;
21
+ /**
22
+ * Comment
23
+ * 备注
24
+ */
25
+ comment: string;
26
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1781,7 +1781,7 @@ class CoreApp {
1781
1781
  */
1782
1782
  async tryLogin(data) {
1783
1783
  // Check status
1784
- if (this._isTryingLogin)
1784
+ if (this._isTryingLogin || this.deviceId === "")
1785
1785
  return false;
1786
1786
  this._isTryingLogin = true;
1787
1787
  return true;
@@ -17,6 +17,7 @@ export * from "./api/dto/InitCallDto";
17
17
  export * from "./api/dto/PinDto";
18
18
  export * from "./api/dto/ResultPayload";
19
19
  export * from "./api/dto/UserIdentifierType";
20
+ export * from "./api/rq/AdminSupportRQ";
20
21
  export * from "./api/rq/ApiRefreshTokenRQ";
21
22
  export * from "./api/rq/AuthRequest";
22
23
  export * from "./api/rq/ChangePasswordRQ";
package/lib/cjs/index.js CHANGED
@@ -36,6 +36,7 @@ __exportStar(require("./api/dto/InitCallDto"), exports);
36
36
  __exportStar(require("./api/dto/PinDto"), exports);
37
37
  __exportStar(require("./api/dto/ResultPayload"), exports);
38
38
  __exportStar(require("./api/dto/UserIdentifierType"), exports);
39
+ __exportStar(require("./api/rq/AdminSupportRQ"), exports);
39
40
  __exportStar(require("./api/rq/ApiRefreshTokenRQ"), exports);
40
41
  __exportStar(require("./api/rq/AuthRequest"), exports);
41
42
  __exportStar(require("./api/rq/ChangePasswordRQ"), exports);
@@ -12,6 +12,7 @@ import { SignoutRQ } from "./rq/SignoutRQ";
12
12
  import { SwitchOrgRQ } from "./rq/SwitchOrgRQ";
13
13
  import { AuthRequest } from "./rq/AuthRequest";
14
14
  import { CheckUserIdentifierRQ } from "./rq/CheckUserIdentifierRQ";
15
+ import { AdminSupportRQ } from "./rq/AdminSupportRQ";
15
16
  /**
16
17
  * Authentication API
17
18
  */
@@ -20,6 +21,13 @@ export declare class AuthApi extends BaseApi {
20
21
  * Header token field name
21
22
  */
22
23
  static HeaderTokenField: string;
24
+ /**
25
+ * Admin support
26
+ * @param rq Request data
27
+ * @param payload Payload
28
+ * @returns Result
29
+ */
30
+ adminSupport(rq: AdminSupportRQ, payload?: IApiPayload<IActionResult<LoginInputAuthResult>>): Promise<IActionResult<LoginInputAuthResult> | undefined>;
23
31
  /**
24
32
  * API refresh token
25
33
  * @param rq Request data
@@ -4,6 +4,15 @@ import { ActionResult } from "@etsoo/shared";
4
4
  * Authentication API
5
5
  */
6
6
  export class AuthApi extends BaseApi {
7
+ /**
8
+ * Admin support
9
+ * @param rq Request data
10
+ * @param payload Payload
11
+ * @returns Result
12
+ */
13
+ adminSupport(rq, payload) {
14
+ return this.api.post("Auth/AdminSupport", rq, payload);
15
+ }
7
16
  /**
8
17
  * API refresh token
9
18
  * @param rq Request data
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Admin support request data
3
+ * 管理员支持请求数据
4
+ */
5
+ export type AdminSupportRQ = {
6
+ /**
7
+ * Target organization ID
8
+ * 目标机构编号
9
+ */
10
+ orgId: number;
11
+ /**
12
+ * Requester
13
+ * 请求人
14
+ */
15
+ requester: number;
16
+ /**
17
+ * Approver
18
+ * 批准人
19
+ */
20
+ approver: number;
21
+ /**
22
+ * Comment
23
+ * 备注
24
+ */
25
+ comment: string;
26
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1778,7 +1778,7 @@ export class CoreApp {
1778
1778
  */
1779
1779
  async tryLogin(data) {
1780
1780
  // Check status
1781
- if (this._isTryingLogin)
1781
+ if (this._isTryingLogin || this.deviceId === "")
1782
1782
  return false;
1783
1783
  this._isTryingLogin = true;
1784
1784
  return true;
@@ -17,6 +17,7 @@ export * from "./api/dto/InitCallDto";
17
17
  export * from "./api/dto/PinDto";
18
18
  export * from "./api/dto/ResultPayload";
19
19
  export * from "./api/dto/UserIdentifierType";
20
+ export * from "./api/rq/AdminSupportRQ";
20
21
  export * from "./api/rq/ApiRefreshTokenRQ";
21
22
  export * from "./api/rq/AuthRequest";
22
23
  export * from "./api/rq/ChangePasswordRQ";
package/lib/mjs/index.js CHANGED
@@ -19,6 +19,7 @@ export * from "./api/dto/InitCallDto";
19
19
  export * from "./api/dto/PinDto";
20
20
  export * from "./api/dto/ResultPayload";
21
21
  export * from "./api/dto/UserIdentifierType";
22
+ export * from "./api/rq/AdminSupportRQ";
22
23
  export * from "./api/rq/ApiRefreshTokenRQ";
23
24
  export * from "./api/rq/AuthRequest";
24
25
  export * from "./api/rq/ChangePasswordRQ";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.6.14",
3
+ "version": "1.6.16",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -16,6 +16,7 @@ import { SwitchOrgRQ } from "./rq/SwitchOrgRQ";
16
16
  import { AuthRequest } from "./rq/AuthRequest";
17
17
  import { ChangePasswordRQ } from "./rq/ChangePasswordRQ";
18
18
  import { CheckUserIdentifierRQ } from "./rq/CheckUserIdentifierRQ";
19
+ import { AdminSupportRQ } from "./rq/AdminSupportRQ";
19
20
 
20
21
  /**
21
22
  * Authentication API
@@ -26,6 +27,19 @@ export class AuthApi extends BaseApi {
26
27
  */
27
28
  static HeaderTokenField = "Etsoo-Refresh-Token";
28
29
 
30
+ /**
31
+ * Admin support
32
+ * @param rq Request data
33
+ * @param payload Payload
34
+ * @returns Result
35
+ */
36
+ adminSupport(
37
+ rq: AdminSupportRQ,
38
+ payload?: IApiPayload<IActionResult<LoginInputAuthResult>>
39
+ ) {
40
+ return this.api.post("Auth/AdminSupport", rq, payload);
41
+ }
42
+
29
43
  /**
30
44
  * API refresh token
31
45
  * @param rq Request data
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Admin support request data
3
+ * 管理员支持请求数据
4
+ */
5
+ export type AdminSupportRQ = {
6
+ /**
7
+ * Target organization ID
8
+ * 目标机构编号
9
+ */
10
+ orgId: number;
11
+
12
+ /**
13
+ * Requester
14
+ * 请求人
15
+ */
16
+ requester: number;
17
+
18
+ /**
19
+ * Approver
20
+ * 批准人
21
+ */
22
+ approver: number;
23
+
24
+ /**
25
+ * Comment
26
+ * 备注
27
+ */
28
+ comment: string;
29
+ };
@@ -2367,7 +2367,7 @@ export abstract class CoreApp<
2367
2367
  */
2368
2368
  async tryLogin(data?: AppTryLoginParams) {
2369
2369
  // Check status
2370
- if (this._isTryingLogin) return false;
2370
+ if (this._isTryingLogin || this.deviceId === "") return false;
2371
2371
  this._isTryingLogin = true;
2372
2372
 
2373
2373
  return true;
package/src/index.ts CHANGED
@@ -21,6 +21,7 @@ export * from "./api/dto/PinDto";
21
21
  export * from "./api/dto/ResultPayload";
22
22
  export * from "./api/dto/UserIdentifierType";
23
23
 
24
+ export * from "./api/rq/AdminSupportRQ";
24
25
  export * from "./api/rq/ApiRefreshTokenRQ";
25
26
  export * from "./api/rq/AuthRequest";
26
27
  export * from "./api/rq/ChangePasswordRQ";