@emilgroup/partner-sdk 1.15.1-beta.1 → 1.16.0

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/README.md CHANGED
@@ -17,11 +17,11 @@ Although this package can be used in both TypeScript and JavaScript, it is inten
17
17
  Navigate to the folder of your consuming project and run one of the following commands:
18
18
 
19
19
  ```
20
- npm install @emilgroup/partner-sdk@1.15.1-beta.1 --save
20
+ npm install @emilgroup/partner-sdk@1.16.0 --save
21
21
  ```
22
22
  or
23
23
  ```
24
- yarn add @emilgroup/partner-sdk@1.15.1-beta.1
24
+ yarn add @emilgroup/partner-sdk@1.16.0
25
25
  ```
26
26
 
27
27
  And then you can import `PartnersApi`.
@@ -53,19 +53,15 @@ export const PartnersApiAxiosParamCreator = function (configuration?: Configurat
53
53
  /**
54
54
  * Creates or updates a partner from an account. Resolves the account by partner code if not provided. **Required Permissions** \"partner-management.partners.create\"
55
55
  * @summary Retrieve the create or update partner from account
56
- * @param {any} code Unique identifier for the object.
57
56
  * @param {CreateOrUpdatePartnerFromAccountRequestDto} createOrUpdatePartnerFromAccountRequestDto
58
57
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
59
58
  * @param {*} [options] Override http request option.
60
59
  * @throws {RequiredError}
61
60
  */
62
- createOrUpdatePartnerFromAccount: async (code: any, createOrUpdatePartnerFromAccountRequestDto: CreateOrUpdatePartnerFromAccountRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
63
- // verify required parameter 'code' is not null or undefined
64
- assertParamExists('createOrUpdatePartnerFromAccount', 'code', code)
61
+ createOrUpdatePartnerFromAccount: async (createOrUpdatePartnerFromAccountRequestDto: CreateOrUpdatePartnerFromAccountRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
65
62
  // verify required parameter 'createOrUpdatePartnerFromAccountRequestDto' is not null or undefined
66
63
  assertParamExists('createOrUpdatePartnerFromAccount', 'createOrUpdatePartnerFromAccountRequestDto', createOrUpdatePartnerFromAccountRequestDto)
67
- const localVarPath = `/partnerservice/v1/partners/create-or-update-partner-from-account`
68
- .replace(`{${"code"}}`, encodeURIComponent(String(code)));
64
+ const localVarPath = `/partnerservice/v1/partners/create-or-update-partner-from-account`;
69
65
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
70
66
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
71
67
  let baseOptions;
@@ -559,14 +555,13 @@ export const PartnersApiFp = function(configuration?: Configuration) {
559
555
  /**
560
556
  * Creates or updates a partner from an account. Resolves the account by partner code if not provided. **Required Permissions** \"partner-management.partners.create\"
561
557
  * @summary Retrieve the create or update partner from account
562
- * @param {any} code Unique identifier for the object.
563
558
  * @param {CreateOrUpdatePartnerFromAccountRequestDto} createOrUpdatePartnerFromAccountRequestDto
564
559
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
565
560
  * @param {*} [options] Override http request option.
566
561
  * @throws {RequiredError}
567
562
  */
568
- async createOrUpdatePartnerFromAccount(code: any, createOrUpdatePartnerFromAccountRequestDto: CreateOrUpdatePartnerFromAccountRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateOrUpdatePartnerFromAccountResponseClass>> {
569
- const localVarAxiosArgs = await localVarAxiosParamCreator.createOrUpdatePartnerFromAccount(code, createOrUpdatePartnerFromAccountRequestDto, authorization, options);
563
+ async createOrUpdatePartnerFromAccount(createOrUpdatePartnerFromAccountRequestDto: CreateOrUpdatePartnerFromAccountRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateOrUpdatePartnerFromAccountResponseClass>> {
564
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createOrUpdatePartnerFromAccount(createOrUpdatePartnerFromAccountRequestDto, authorization, options);
570
565
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
571
566
  },
572
567
  /**
@@ -694,14 +689,13 @@ export const PartnersApiFactory = function (configuration?: Configuration, baseP
694
689
  /**
695
690
  * Creates or updates a partner from an account. Resolves the account by partner code if not provided. **Required Permissions** \"partner-management.partners.create\"
696
691
  * @summary Retrieve the create or update partner from account
697
- * @param {any} code Unique identifier for the object.
698
692
  * @param {CreateOrUpdatePartnerFromAccountRequestDto} createOrUpdatePartnerFromAccountRequestDto
699
693
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
700
694
  * @param {*} [options] Override http request option.
701
695
  * @throws {RequiredError}
702
696
  */
703
- createOrUpdatePartnerFromAccount(code: any, createOrUpdatePartnerFromAccountRequestDto: CreateOrUpdatePartnerFromAccountRequestDto, authorization?: string, options?: any): AxiosPromise<CreateOrUpdatePartnerFromAccountResponseClass> {
704
- return localVarFp.createOrUpdatePartnerFromAccount(code, createOrUpdatePartnerFromAccountRequestDto, authorization, options).then((request) => request(axios, basePath));
697
+ createOrUpdatePartnerFromAccount(createOrUpdatePartnerFromAccountRequestDto: CreateOrUpdatePartnerFromAccountRequestDto, authorization?: string, options?: any): AxiosPromise<CreateOrUpdatePartnerFromAccountResponseClass> {
698
+ return localVarFp.createOrUpdatePartnerFromAccount(createOrUpdatePartnerFromAccountRequestDto, authorization, options).then((request) => request(axios, basePath));
705
699
  },
706
700
  /**
707
701
  * This will create a partner. **Required Permissions** \"partner-management.partners.create\"
@@ -816,13 +810,6 @@ export const PartnersApiFactory = function (configuration?: Configuration, baseP
816
810
  * @interface PartnersApiCreateOrUpdatePartnerFromAccountRequest
817
811
  */
818
812
  export interface PartnersApiCreateOrUpdatePartnerFromAccountRequest {
819
- /**
820
- * Unique identifier for the object.
821
- * @type {any}
822
- * @memberof PartnersApiCreateOrUpdatePartnerFromAccount
823
- */
824
- readonly code: any
825
-
826
813
  /**
827
814
  *
828
815
  * @type {CreateOrUpdatePartnerFromAccountRequestDto}
@@ -1134,7 +1121,7 @@ export class PartnersApi extends BaseAPI {
1134
1121
  * @memberof PartnersApi
1135
1122
  */
1136
1123
  public createOrUpdatePartnerFromAccount(requestParameters: PartnersApiCreateOrUpdatePartnerFromAccountRequest, options?: AxiosRequestConfig) {
1137
- return PartnersApiFp(this.configuration).createOrUpdatePartnerFromAccount(requestParameters.code, requestParameters.createOrUpdatePartnerFromAccountRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
1124
+ return PartnersApiFp(this.configuration).createOrUpdatePartnerFromAccount(requestParameters.createOrUpdatePartnerFromAccountRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
1138
1125
  }
1139
1126
 
1140
1127
  /**
package/base.ts CHANGED
@@ -37,6 +37,16 @@ export interface LoginClass {
37
37
  permissions: string;
38
38
  }
39
39
 
40
+ export interface SwitchWorkspaceRequest {
41
+ username: string;
42
+ targetWorkspace: string;
43
+ }
44
+
45
+ export interface SwitchWorkspaceResponseClass {
46
+ accessToken: string;
47
+ permissions: string;
48
+ }
49
+
40
50
  export enum Environment {
41
51
  Production = 'https://apiv2.emil.de',
42
52
  Test = 'https://apiv2-test.emil.de',
@@ -119,7 +129,7 @@ export class BaseAPI {
119
129
  return this.tokenData.permissions.split(',');
120
130
  }
121
131
 
122
- async authorize(username: string, password: string): Promise<void> {
132
+ async authorize(username: string, password: string, targetWorkspace?: string): Promise<void> {
123
133
  const options: AxiosRequestConfig = {
124
134
  method: 'POST',
125
135
  url: `${this.configuration.basePath}/authservice/v1/login`,
@@ -141,6 +151,40 @@ export class BaseAPI {
141
151
  this.tokenData.accessToken = accessToken;
142
152
  this.tokenData.permissions = permissions;
143
153
 
154
+ // Switch workspace if provided
155
+ if (targetWorkspace) {
156
+ await this.switchWorkspace(targetWorkspace);
157
+ } else {
158
+ // Only store if no workspace switch (since switchWorkspace will store after switching)
159
+ this.storeTokenData({
160
+ ...this.tokenData
161
+ });
162
+ }
163
+ }
164
+
165
+ async switchWorkspace(targetWorkspace: string): Promise<void> {
166
+ const options: AxiosRequestConfig = {
167
+ method: 'POST',
168
+ url: `${this.configuration.basePath}/authservice/v1/workspaces/switch`,
169
+ headers: {
170
+ 'Content-Type': 'application/json',
171
+ 'Authorization': `Bearer ${this.configuration.accessToken}`,
172
+ },
173
+ data: {
174
+ username: this.configuration.username,
175
+ targetWorkspace,
176
+ } as SwitchWorkspaceRequest,
177
+ withCredentials: true,
178
+ };
179
+
180
+ const response = await globalAxios.request<SwitchWorkspaceResponseClass>(options);
181
+
182
+ const { data: { accessToken, permissions } } = response;
183
+
184
+ this.configuration.accessToken = `Bearer ${accessToken}`;
185
+ this.tokenData.accessToken = accessToken;
186
+ this.tokenData.permissions = permissions;
187
+
144
188
  this.storeTokenData({
145
189
  ...this.tokenData
146
190
  });
@@ -32,13 +32,12 @@ export declare const PartnersApiAxiosParamCreator: (configuration?: Configuratio
32
32
  /**
33
33
  * Creates or updates a partner from an account. Resolves the account by partner code if not provided. **Required Permissions** \"partner-management.partners.create\"
34
34
  * @summary Retrieve the create or update partner from account
35
- * @param {any} code Unique identifier for the object.
36
35
  * @param {CreateOrUpdatePartnerFromAccountRequestDto} createOrUpdatePartnerFromAccountRequestDto
37
36
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
38
37
  * @param {*} [options] Override http request option.
39
38
  * @throws {RequiredError}
40
39
  */
41
- createOrUpdatePartnerFromAccount: (code: any, createOrUpdatePartnerFromAccountRequestDto: CreateOrUpdatePartnerFromAccountRequestDto, authorization?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
40
+ createOrUpdatePartnerFromAccount: (createOrUpdatePartnerFromAccountRequestDto: CreateOrUpdatePartnerFromAccountRequestDto, authorization?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
42
41
  /**
43
42
  * This will create a partner. **Required Permissions** \"partner-management.partners.create\"
44
43
  * @summary Create the partner
@@ -136,13 +135,12 @@ export declare const PartnersApiFp: (configuration?: Configuration) => {
136
135
  /**
137
136
  * Creates or updates a partner from an account. Resolves the account by partner code if not provided. **Required Permissions** \"partner-management.partners.create\"
138
137
  * @summary Retrieve the create or update partner from account
139
- * @param {any} code Unique identifier for the object.
140
138
  * @param {CreateOrUpdatePartnerFromAccountRequestDto} createOrUpdatePartnerFromAccountRequestDto
141
139
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
142
140
  * @param {*} [options] Override http request option.
143
141
  * @throws {RequiredError}
144
142
  */
145
- createOrUpdatePartnerFromAccount(code: any, createOrUpdatePartnerFromAccountRequestDto: CreateOrUpdatePartnerFromAccountRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateOrUpdatePartnerFromAccountResponseClass>>;
143
+ createOrUpdatePartnerFromAccount(createOrUpdatePartnerFromAccountRequestDto: CreateOrUpdatePartnerFromAccountRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateOrUpdatePartnerFromAccountResponseClass>>;
146
144
  /**
147
145
  * This will create a partner. **Required Permissions** \"partner-management.partners.create\"
148
146
  * @summary Create the partner
@@ -240,13 +238,12 @@ export declare const PartnersApiFactory: (configuration?: Configuration, basePat
240
238
  /**
241
239
  * Creates or updates a partner from an account. Resolves the account by partner code if not provided. **Required Permissions** \"partner-management.partners.create\"
242
240
  * @summary Retrieve the create or update partner from account
243
- * @param {any} code Unique identifier for the object.
244
241
  * @param {CreateOrUpdatePartnerFromAccountRequestDto} createOrUpdatePartnerFromAccountRequestDto
245
242
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
246
243
  * @param {*} [options] Override http request option.
247
244
  * @throws {RequiredError}
248
245
  */
249
- createOrUpdatePartnerFromAccount(code: any, createOrUpdatePartnerFromAccountRequestDto: CreateOrUpdatePartnerFromAccountRequestDto, authorization?: string, options?: any): AxiosPromise<CreateOrUpdatePartnerFromAccountResponseClass>;
246
+ createOrUpdatePartnerFromAccount(createOrUpdatePartnerFromAccountRequestDto: CreateOrUpdatePartnerFromAccountRequestDto, authorization?: string, options?: any): AxiosPromise<CreateOrUpdatePartnerFromAccountResponseClass>;
250
247
  /**
251
248
  * This will create a partner. **Required Permissions** \"partner-management.partners.create\"
252
249
  * @summary Create the partner
@@ -342,12 +339,6 @@ export declare const PartnersApiFactory: (configuration?: Configuration, basePat
342
339
  * @interface PartnersApiCreateOrUpdatePartnerFromAccountRequest
343
340
  */
344
341
  export interface PartnersApiCreateOrUpdatePartnerFromAccountRequest {
345
- /**
346
- * Unique identifier for the object.
347
- * @type {any}
348
- * @memberof PartnersApiCreateOrUpdatePartnerFromAccount
349
- */
350
- readonly code: any;
351
342
  /**
352
343
  *
353
344
  * @type {CreateOrUpdatePartnerFromAccountRequestDto}
@@ -95,25 +95,21 @@ var PartnersApiAxiosParamCreator = function (configuration) {
95
95
  /**
96
96
  * Creates or updates a partner from an account. Resolves the account by partner code if not provided. **Required Permissions** \"partner-management.partners.create\"
97
97
  * @summary Retrieve the create or update partner from account
98
- * @param {any} code Unique identifier for the object.
99
98
  * @param {CreateOrUpdatePartnerFromAccountRequestDto} createOrUpdatePartnerFromAccountRequestDto
100
99
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
101
100
  * @param {*} [options] Override http request option.
102
101
  * @throws {RequiredError}
103
102
  */
104
- createOrUpdatePartnerFromAccount: function (code, createOrUpdatePartnerFromAccountRequestDto, authorization, options) {
103
+ createOrUpdatePartnerFromAccount: function (createOrUpdatePartnerFromAccountRequestDto, authorization, options) {
105
104
  if (options === void 0) { options = {}; }
106
105
  return __awaiter(_this, void 0, void 0, function () {
107
106
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
108
107
  return __generator(this, function (_a) {
109
108
  switch (_a.label) {
110
109
  case 0:
111
- // verify required parameter 'code' is not null or undefined
112
- (0, common_1.assertParamExists)('createOrUpdatePartnerFromAccount', 'code', code);
113
110
  // verify required parameter 'createOrUpdatePartnerFromAccountRequestDto' is not null or undefined
114
111
  (0, common_1.assertParamExists)('createOrUpdatePartnerFromAccount', 'createOrUpdatePartnerFromAccountRequestDto', createOrUpdatePartnerFromAccountRequestDto);
115
- localVarPath = "/partnerservice/v1/partners/create-or-update-partner-from-account"
116
- .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
112
+ localVarPath = "/partnerservice/v1/partners/create-or-update-partner-from-account";
117
113
  localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
118
114
  if (configuration) {
119
115
  baseOptions = configuration.baseOptions;
@@ -609,18 +605,17 @@ var PartnersApiFp = function (configuration) {
609
605
  /**
610
606
  * Creates or updates a partner from an account. Resolves the account by partner code if not provided. **Required Permissions** \"partner-management.partners.create\"
611
607
  * @summary Retrieve the create or update partner from account
612
- * @param {any} code Unique identifier for the object.
613
608
  * @param {CreateOrUpdatePartnerFromAccountRequestDto} createOrUpdatePartnerFromAccountRequestDto
614
609
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
615
610
  * @param {*} [options] Override http request option.
616
611
  * @throws {RequiredError}
617
612
  */
618
- createOrUpdatePartnerFromAccount: function (code, createOrUpdatePartnerFromAccountRequestDto, authorization, options) {
613
+ createOrUpdatePartnerFromAccount: function (createOrUpdatePartnerFromAccountRequestDto, authorization, options) {
619
614
  return __awaiter(this, void 0, void 0, function () {
620
615
  var localVarAxiosArgs;
621
616
  return __generator(this, function (_a) {
622
617
  switch (_a.label) {
623
- case 0: return [4 /*yield*/, localVarAxiosParamCreator.createOrUpdatePartnerFromAccount(code, createOrUpdatePartnerFromAccountRequestDto, authorization, options)];
618
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.createOrUpdatePartnerFromAccount(createOrUpdatePartnerFromAccountRequestDto, authorization, options)];
624
619
  case 1:
625
620
  localVarAxiosArgs = _a.sent();
626
621
  return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
@@ -825,14 +820,13 @@ var PartnersApiFactory = function (configuration, basePath, axios) {
825
820
  /**
826
821
  * Creates or updates a partner from an account. Resolves the account by partner code if not provided. **Required Permissions** \"partner-management.partners.create\"
827
822
  * @summary Retrieve the create or update partner from account
828
- * @param {any} code Unique identifier for the object.
829
823
  * @param {CreateOrUpdatePartnerFromAccountRequestDto} createOrUpdatePartnerFromAccountRequestDto
830
824
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
831
825
  * @param {*} [options] Override http request option.
832
826
  * @throws {RequiredError}
833
827
  */
834
- createOrUpdatePartnerFromAccount: function (code, createOrUpdatePartnerFromAccountRequestDto, authorization, options) {
835
- return localVarFp.createOrUpdatePartnerFromAccount(code, createOrUpdatePartnerFromAccountRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
828
+ createOrUpdatePartnerFromAccount: function (createOrUpdatePartnerFromAccountRequestDto, authorization, options) {
829
+ return localVarFp.createOrUpdatePartnerFromAccount(createOrUpdatePartnerFromAccountRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
836
830
  },
837
831
  /**
838
832
  * This will create a partner. **Required Permissions** \"partner-management.partners.create\"
@@ -962,7 +956,7 @@ var PartnersApi = /** @class */ (function (_super) {
962
956
  */
963
957
  PartnersApi.prototype.createOrUpdatePartnerFromAccount = function (requestParameters, options) {
964
958
  var _this = this;
965
- return (0, exports.PartnersApiFp)(this.configuration).createOrUpdatePartnerFromAccount(requestParameters.code, requestParameters.createOrUpdatePartnerFromAccountRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
959
+ return (0, exports.PartnersApiFp)(this.configuration).createOrUpdatePartnerFromAccount(requestParameters.createOrUpdatePartnerFromAccountRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
966
960
  };
967
961
  /**
968
962
  * This will create a partner. **Required Permissions** \"partner-management.partners.create\"
package/dist/base.d.ts CHANGED
@@ -26,6 +26,14 @@ export interface LoginClass {
26
26
  accessToken: string;
27
27
  permissions: string;
28
28
  }
29
+ export interface SwitchWorkspaceRequest {
30
+ username: string;
31
+ targetWorkspace: string;
32
+ }
33
+ export interface SwitchWorkspaceResponseClass {
34
+ accessToken: string;
35
+ permissions: string;
36
+ }
29
37
  export declare enum Environment {
30
38
  Production = "https://apiv2.emil.de",
31
39
  Test = "https://apiv2-test.emil.de",
@@ -57,7 +65,8 @@ export declare class BaseAPI {
57
65
  selectEnvironment(env: Environment): void;
58
66
  selectBasePath(path: string): void;
59
67
  getPermissions(): Array<string>;
60
- authorize(username: string, password: string): Promise<void>;
68
+ authorize(username: string, password: string, targetWorkspace?: string): Promise<void>;
69
+ switchWorkspace(targetWorkspace: string): Promise<void>;
61
70
  refreshTokenInternal(): Promise<LoginClass>;
62
71
  private storeTokenData;
63
72
  loadTokenData(): void;
package/dist/base.js CHANGED
@@ -151,7 +151,7 @@ var BaseAPI = /** @class */ (function () {
151
151
  }
152
152
  return this.tokenData.permissions.split(',');
153
153
  };
154
- BaseAPI.prototype.authorize = function (username, password) {
154
+ BaseAPI.prototype.authorize = function (username, password, targetWorkspace) {
155
155
  return __awaiter(this, void 0, void 0, function () {
156
156
  var options, response, _a, accessToken, permissions;
157
157
  return __generator(this, function (_b) {
@@ -176,6 +176,46 @@ var BaseAPI = /** @class */ (function () {
176
176
  this.tokenData.username = username;
177
177
  this.tokenData.accessToken = accessToken;
178
178
  this.tokenData.permissions = permissions;
179
+ if (!targetWorkspace) return [3 /*break*/, 3];
180
+ return [4 /*yield*/, this.switchWorkspace(targetWorkspace)];
181
+ case 2:
182
+ _b.sent();
183
+ return [3 /*break*/, 4];
184
+ case 3:
185
+ // Only store if no workspace switch (since switchWorkspace will store after switching)
186
+ this.storeTokenData(__assign({}, this.tokenData));
187
+ _b.label = 4;
188
+ case 4: return [2 /*return*/];
189
+ }
190
+ });
191
+ });
192
+ };
193
+ BaseAPI.prototype.switchWorkspace = function (targetWorkspace) {
194
+ return __awaiter(this, void 0, void 0, function () {
195
+ var options, response, _a, accessToken, permissions;
196
+ return __generator(this, function (_b) {
197
+ switch (_b.label) {
198
+ case 0:
199
+ options = {
200
+ method: 'POST',
201
+ url: "".concat(this.configuration.basePath, "/authservice/v1/workspaces/switch"),
202
+ headers: {
203
+ 'Content-Type': 'application/json',
204
+ 'Authorization': "Bearer ".concat(this.configuration.accessToken),
205
+ },
206
+ data: {
207
+ username: this.configuration.username,
208
+ targetWorkspace: targetWorkspace,
209
+ },
210
+ withCredentials: true,
211
+ };
212
+ return [4 /*yield*/, axios_1.default.request(options)];
213
+ case 1:
214
+ response = _b.sent();
215
+ _a = response.data, accessToken = _a.accessToken, permissions = _a.permissions;
216
+ this.configuration.accessToken = "Bearer ".concat(accessToken);
217
+ this.tokenData.accessToken = accessToken;
218
+ this.tokenData.permissions = permissions;
179
219
  this.storeTokenData(__assign({}, this.tokenData));
180
220
  return [2 /*return*/];
181
221
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emilgroup/partner-sdk",
3
- "version": "1.15.1-beta.1",
3
+ "version": "1.16.0",
4
4
  "description": "OpenAPI client for @emilgroup/partner-sdk",
5
5
  "author": "OpenAPI-Generator Contributors",
6
6
  "keywords": [