@etsoo/appscript 1.6.11 → 1.6.12

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.
@@ -71,8 +71,8 @@ export declare class AuthApi extends BaseApi {
71
71
  * @param tokenKey Refresh token key
72
72
  * @returns Result
73
73
  */
74
- login<T extends IUser, A extends AuthRequest | undefined>(rq: LoginInputRQ, auth: A, payload?: IApiPayload<IActionResult<A extends undefined ? T : LoginInputAuthResult>>, tokenKey?: string): Promise<[
75
- IActionResult<A extends undefined ? T : LoginInputAuthResult> | undefined,
74
+ login<T extends IUser>(rq: LoginInputRQ, payload?: IApiPayload<IActionResult<T | LoginInputAuthResult>>, tokenKey?: string): Promise<[
75
+ IActionResult<T | LoginInputAuthResult> | undefined,
76
76
  string | null
77
77
  ]>;
78
78
  /**
@@ -88,13 +88,12 @@ class AuthApi extends BaseApi_1.BaseApi {
88
88
  * @param tokenKey Refresh token key
89
89
  * @returns Result
90
90
  */
91
- async login(rq, auth, payload, tokenKey) {
91
+ async login(rq, payload, tokenKey) {
92
92
  // Default values
93
93
  payload ?? (payload = {});
94
94
  tokenKey ?? (tokenKey = AuthApi.HeaderTokenField);
95
95
  const data = {
96
96
  ...rq,
97
- auth,
98
97
  deviceId: this.app.deviceId,
99
98
  region: this.app.region,
100
99
  timeZone: this.app.getTimeZone()
@@ -12,6 +12,10 @@ export type LoginInputRQ = LoginIdInputRQ & {
12
12
  * Organization
13
13
  */
14
14
  org?: number;
15
+ /**
16
+ * Authorization request data
17
+ */
18
+ auth?: AuthRequest;
15
19
  };
16
20
  /**
17
21
  * Login input auth result
@@ -25,9 +29,4 @@ export type LoginInputAuthResult = {
25
29
  /**
26
30
  * Login request data
27
31
  */
28
- export type LoginRQ = LoginIdRQ & LoginInputRQ & {
29
- /**
30
- * Authorization request data
31
- */
32
- auth?: AuthRequest;
33
- };
32
+ export type LoginRQ = LoginIdRQ & LoginInputRQ;
@@ -71,8 +71,8 @@ export declare class AuthApi extends BaseApi {
71
71
  * @param tokenKey Refresh token key
72
72
  * @returns Result
73
73
  */
74
- login<T extends IUser, A extends AuthRequest | undefined>(rq: LoginInputRQ, auth: A, payload?: IApiPayload<IActionResult<A extends undefined ? T : LoginInputAuthResult>>, tokenKey?: string): Promise<[
75
- IActionResult<A extends undefined ? T : LoginInputAuthResult> | undefined,
74
+ login<T extends IUser>(rq: LoginInputRQ, payload?: IApiPayload<IActionResult<T | LoginInputAuthResult>>, tokenKey?: string): Promise<[
75
+ IActionResult<T | LoginInputAuthResult> | undefined,
76
76
  string | null
77
77
  ]>;
78
78
  /**
@@ -85,13 +85,12 @@ export class AuthApi extends BaseApi {
85
85
  * @param tokenKey Refresh token key
86
86
  * @returns Result
87
87
  */
88
- async login(rq, auth, payload, tokenKey) {
88
+ async login(rq, payload, tokenKey) {
89
89
  // Default values
90
90
  payload ?? (payload = {});
91
91
  tokenKey ?? (tokenKey = AuthApi.HeaderTokenField);
92
92
  const data = {
93
93
  ...rq,
94
- auth,
95
94
  deviceId: this.app.deviceId,
96
95
  region: this.app.region,
97
96
  timeZone: this.app.getTimeZone()
@@ -12,6 +12,10 @@ export type LoginInputRQ = LoginIdInputRQ & {
12
12
  * Organization
13
13
  */
14
14
  org?: number;
15
+ /**
16
+ * Authorization request data
17
+ */
18
+ auth?: AuthRequest;
15
19
  };
16
20
  /**
17
21
  * Login input auth result
@@ -25,9 +29,4 @@ export type LoginInputAuthResult = {
25
29
  /**
26
30
  * Login request data
27
31
  */
28
- export type LoginRQ = LoginIdRQ & LoginInputRQ & {
29
- /**
30
- * Authorization request data
31
- */
32
- auth?: AuthRequest;
33
- };
32
+ export type LoginRQ = LoginIdRQ & LoginInputRQ;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.6.11",
3
+ "version": "1.6.12",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -125,18 +125,12 @@ export class AuthApi extends BaseApi {
125
125
  * @param tokenKey Refresh token key
126
126
  * @returns Result
127
127
  */
128
- async login<T extends IUser, A extends AuthRequest | undefined>(
128
+ async login<T extends IUser>(
129
129
  rq: LoginInputRQ,
130
- auth: A,
131
- payload?: IApiPayload<
132
- IActionResult<A extends undefined ? T : LoginInputAuthResult>
133
- >,
130
+ payload?: IApiPayload<IActionResult<T | LoginInputAuthResult>>,
134
131
  tokenKey?: string
135
132
  ): Promise<
136
- [
137
- IActionResult<A extends undefined ? T : LoginInputAuthResult> | undefined,
138
- string | null
139
- ]
133
+ [IActionResult<T | LoginInputAuthResult> | undefined, string | null]
140
134
  > {
141
135
  // Default values
142
136
  payload ??= {};
@@ -144,7 +138,6 @@ export class AuthApi extends BaseApi {
144
138
 
145
139
  const data: LoginRQ = {
146
140
  ...rq,
147
- auth,
148
141
  deviceId: this.app.deviceId,
149
142
  region: this.app.region,
150
143
  timeZone: this.app.getTimeZone()
@@ -14,6 +14,11 @@ export type LoginInputRQ = LoginIdInputRQ & {
14
14
  * Organization
15
15
  */
16
16
  org?: number;
17
+
18
+ /**
19
+ * Authorization request data
20
+ */
21
+ auth?: AuthRequest;
17
22
  };
18
23
 
19
24
  /**
@@ -29,10 +34,4 @@ export type LoginInputAuthResult = {
29
34
  /**
30
35
  * Login request data
31
36
  */
32
- export type LoginRQ = LoginIdRQ &
33
- LoginInputRQ & {
34
- /**
35
- * Authorization request data
36
- */
37
- auth?: AuthRequest;
38
- };
37
+ export type LoginRQ = LoginIdRQ & LoginInputRQ;