@etsoo/appscript 1.5.80 → 1.5.82

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.
@@ -96,5 +96,5 @@ export declare class AuthApi extends BaseApi {
96
96
  * @param tokenKey Refresh token key
97
97
  * @param payload Payload
98
98
  */
99
- switchOrg<T extends IUser>(rq: SwitchOrgRQ, payload?: IApiPayload<IActionResult<T>>, tokenKey?: string): Promise<(string | IActionResult<T> | null | undefined)[]>;
99
+ switchOrg<T extends IUser>(rq: SwitchOrgRQ, payload?: IApiPayload<IActionResult<T>>, tokenKey?: string): Promise<[IActionResult<T> | undefined, string | null]>;
100
100
  }
@@ -171,7 +171,7 @@ class AuthApi extends BaseApi_1.BaseApi {
171
171
  payload ?? (payload = {});
172
172
  tokenKey ?? (tokenKey = AuthApi.HeaderTokenField);
173
173
  // Call the API
174
- const result = await this.api.post("Auth/SwitchOrg", rq, payload);
174
+ const result = await this.api.put("Auth/SwitchOrg", rq, payload);
175
175
  // Get the refresh token
176
176
  const refreshToken = result?.ok
177
177
  ? this.app.getResponseToken(payload.response, tokenKey)
@@ -10,4 +10,8 @@ export type SwitchOrgRQ = {
10
10
  * From organization id
11
11
  */
12
12
  fromOrganizationId?: number;
13
+ /**
14
+ * Core system access token
15
+ */
16
+ token: string;
13
17
  };
@@ -96,5 +96,5 @@ export declare class AuthApi extends BaseApi {
96
96
  * @param tokenKey Refresh token key
97
97
  * @param payload Payload
98
98
  */
99
- switchOrg<T extends IUser>(rq: SwitchOrgRQ, payload?: IApiPayload<IActionResult<T>>, tokenKey?: string): Promise<(string | IActionResult<T> | null | undefined)[]>;
99
+ switchOrg<T extends IUser>(rq: SwitchOrgRQ, payload?: IApiPayload<IActionResult<T>>, tokenKey?: string): Promise<[IActionResult<T> | undefined, string | null]>;
100
100
  }
@@ -168,7 +168,7 @@ export class AuthApi extends BaseApi {
168
168
  payload ?? (payload = {});
169
169
  tokenKey ?? (tokenKey = AuthApi.HeaderTokenField);
170
170
  // Call the API
171
- const result = await this.api.post("Auth/SwitchOrg", rq, payload);
171
+ const result = await this.api.put("Auth/SwitchOrg", rq, payload);
172
172
  // Get the refresh token
173
173
  const refreshToken = result?.ok
174
174
  ? this.app.getResponseToken(payload.response, tokenKey)
@@ -10,4 +10,8 @@ export type SwitchOrgRQ = {
10
10
  * From organization id
11
11
  */
12
12
  fromOrganizationId?: number;
13
+ /**
14
+ * Core system access token
15
+ */
16
+ token: string;
13
17
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.5.80",
3
+ "version": "1.5.82",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -225,13 +225,13 @@ export class AuthApi extends BaseApi {
225
225
  rq: SwitchOrgRQ,
226
226
  payload?: IApiPayload<IActionResult<T>>,
227
227
  tokenKey?: string
228
- ) {
228
+ ): Promise<[IActionResult<T> | undefined, string | null]> {
229
229
  // Default values
230
230
  payload ??= {};
231
231
  tokenKey ??= AuthApi.HeaderTokenField;
232
232
 
233
233
  // Call the API
234
- const result = await this.api.post("Auth/SwitchOrg", rq, payload);
234
+ const result = await this.api.put("Auth/SwitchOrg", rq, payload);
235
235
 
236
236
  // Get the refresh token
237
237
  const refreshToken = result?.ok
@@ -11,4 +11,9 @@ export type SwitchOrgRQ = {
11
11
  * From organization id
12
12
  */
13
13
  fromOrganizationId?: number;
14
+
15
+ /**
16
+ * Core system access token
17
+ */
18
+ token: string;
14
19
  };