@emilgroup/auth-sdk 1.20.0 → 1.20.1-beta.1

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.
@@ -48,8 +48,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
48
48
  });
49
49
  };
50
50
  var __generator = (this && this.__generator) || function (thisArg, body) {
51
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
52
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
51
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
52
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
53
53
  function verb(n) { return function (v) { return step([n, v]); }; }
54
54
  function step(op) {
55
55
  if (f) throw new TypeError("Generator is already executing.");
@@ -74,6 +74,15 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
74
74
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
75
75
  }
76
76
  };
77
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
78
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
79
+ if (ar || !(i in from)) {
80
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
81
+ ar[i] = from[i];
82
+ }
83
+ }
84
+ return to.concat(ar || Array.prototype.slice.call(from));
85
+ };
77
86
  var __importDefault = (this && this.__importDefault) || function (mod) {
78
87
  return (mod && mod.__esModule) ? mod : { "default": mod };
79
88
  };
@@ -93,15 +102,19 @@ var DefaultApiAxiosParamCreator = function (configuration) {
93
102
  var _this = this;
94
103
  return {
95
104
  /**
96
- * Returns the health status of the auth service. This endpoint is used to monitor the operational status of the auth service. It typically returns a simple status indicator, such as \'UP\' or \'OK\', confirming that the service is operational and available.
105
+ * Returns the health status of the auth service. This endpoint is used to monitor the operational status of the auth service. It typically returns a simple status indicator, such as \'UP\' or \'OK\', confirming that the service is operational and available.
97
106
  * @summary Health Check
98
107
  * @param {*} [options] Override http request option.
99
108
  * @throws {RequiredError}
100
109
  */
101
- check: function (options) {
102
- if (options === void 0) { options = {}; }
103
- return __awaiter(_this, void 0, void 0, function () {
110
+ check: function () {
111
+ var args_1 = [];
112
+ for (var _i = 0; _i < arguments.length; _i++) {
113
+ args_1[_i] = arguments[_i];
114
+ }
115
+ return __awaiter(_this, __spreadArray([], args_1, true), void 0, function (options) {
104
116
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
117
+ if (options === void 0) { options = {}; }
105
118
  return __generator(this, function (_a) {
106
119
  localVarPath = "/authservice/health";
107
120
  localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
@@ -133,7 +146,7 @@ var DefaultApiFp = function (configuration) {
133
146
  var localVarAxiosParamCreator = (0, exports.DefaultApiAxiosParamCreator)(configuration);
134
147
  return {
135
148
  /**
136
- * Returns the health status of the auth service. This endpoint is used to monitor the operational status of the auth service. It typically returns a simple status indicator, such as \'UP\' or \'OK\', confirming that the service is operational and available.
149
+ * Returns the health status of the auth service. This endpoint is used to monitor the operational status of the auth service. It typically returns a simple status indicator, such as \'UP\' or \'OK\', confirming that the service is operational and available.
137
150
  * @summary Health Check
138
151
  * @param {*} [options] Override http request option.
139
152
  * @throws {RequiredError}
@@ -162,7 +175,7 @@ var DefaultApiFactory = function (configuration, basePath, axios) {
162
175
  var localVarFp = (0, exports.DefaultApiFp)(configuration);
163
176
  return {
164
177
  /**
165
- * Returns the health status of the auth service. This endpoint is used to monitor the operational status of the auth service. It typically returns a simple status indicator, such as \'UP\' or \'OK\', confirming that the service is operational and available.
178
+ * Returns the health status of the auth service. This endpoint is used to monitor the operational status of the auth service. It typically returns a simple status indicator, such as \'UP\' or \'OK\', confirming that the service is operational and available.
166
179
  * @summary Health Check
167
180
  * @param {*} [options] Override http request option.
168
181
  * @throws {RequiredError}
@@ -185,7 +198,7 @@ var DefaultApi = /** @class */ (function (_super) {
185
198
  return _super !== null && _super.apply(this, arguments) || this;
186
199
  }
187
200
  /**
188
- * Returns the health status of the auth service. This endpoint is used to monitor the operational status of the auth service. It typically returns a simple status indicator, such as \'UP\' or \'OK\', confirming that the service is operational and available.
201
+ * Returns the health status of the auth service. This endpoint is used to monitor the operational status of the auth service. It typically returns a simple status indicator, such as \'UP\' or \'OK\', confirming that the service is operational and available.
189
202
  * @summary Health Check
190
203
  * @param {*} [options] Override http request option.
191
204
  * @throws {RequiredError}
@@ -0,0 +1,117 @@
1
+ /**
2
+ * EMIL AuthService
3
+ * The EMIL AuthService API description
4
+ *
5
+ * The version of the OpenAPI document: 1.0
6
+ * Contact: kontakt@emil.de
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
13
+ import { Configuration } from '../configuration';
14
+ import { RequestArgs, BaseAPI } from '../base';
15
+ import { SwitchWorkspaceRequestWithoutRefreshTokenDto } from '../models';
16
+ /**
17
+ * WorkspacesApi - axios parameter creator
18
+ * @export
19
+ */
20
+ export declare const WorkspacesApiAxiosParamCreator: (configuration?: Configuration) => {
21
+ /**
22
+ *
23
+ * @param {*} [options] Override http request option.
24
+ * @throws {RequiredError}
25
+ */
26
+ listWorkspaces: (options?: AxiosRequestConfig) => Promise<RequestArgs>;
27
+ /**
28
+ *
29
+ * @param {SwitchWorkspaceRequestWithoutRefreshTokenDto} switchWorkspaceRequestWithoutRefreshTokenDto
30
+ * @param {string} [cookie] HTTP only cookie that was sent during login
31
+ * @param {*} [options] Override http request option.
32
+ * @throws {RequiredError}
33
+ */
34
+ switchWorkspace: (switchWorkspaceRequestWithoutRefreshTokenDto: SwitchWorkspaceRequestWithoutRefreshTokenDto, cookie?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
35
+ };
36
+ /**
37
+ * WorkspacesApi - functional programming interface
38
+ * @export
39
+ */
40
+ export declare const WorkspacesApiFp: (configuration?: Configuration) => {
41
+ /**
42
+ *
43
+ * @param {*} [options] Override http request option.
44
+ * @throws {RequiredError}
45
+ */
46
+ listWorkspaces(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
47
+ /**
48
+ *
49
+ * @param {SwitchWorkspaceRequestWithoutRefreshTokenDto} switchWorkspaceRequestWithoutRefreshTokenDto
50
+ * @param {string} [cookie] HTTP only cookie that was sent during login
51
+ * @param {*} [options] Override http request option.
52
+ * @throws {RequiredError}
53
+ */
54
+ switchWorkspace(switchWorkspaceRequestWithoutRefreshTokenDto: SwitchWorkspaceRequestWithoutRefreshTokenDto, cookie?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>>;
55
+ };
56
+ /**
57
+ * WorkspacesApi - factory interface
58
+ * @export
59
+ */
60
+ export declare const WorkspacesApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
61
+ /**
62
+ *
63
+ * @param {*} [options] Override http request option.
64
+ * @throws {RequiredError}
65
+ */
66
+ listWorkspaces(options?: any): AxiosPromise<void>;
67
+ /**
68
+ *
69
+ * @param {SwitchWorkspaceRequestWithoutRefreshTokenDto} switchWorkspaceRequestWithoutRefreshTokenDto
70
+ * @param {string} [cookie] HTTP only cookie that was sent during login
71
+ * @param {*} [options] Override http request option.
72
+ * @throws {RequiredError}
73
+ */
74
+ switchWorkspace(switchWorkspaceRequestWithoutRefreshTokenDto: SwitchWorkspaceRequestWithoutRefreshTokenDto, cookie?: string, options?: any): AxiosPromise<object>;
75
+ };
76
+ /**
77
+ * Request parameters for switchWorkspace operation in WorkspacesApi.
78
+ * @export
79
+ * @interface WorkspacesApiSwitchWorkspaceRequest
80
+ */
81
+ export interface WorkspacesApiSwitchWorkspaceRequest {
82
+ /**
83
+ *
84
+ * @type {SwitchWorkspaceRequestWithoutRefreshTokenDto}
85
+ * @memberof WorkspacesApiSwitchWorkspace
86
+ */
87
+ readonly switchWorkspaceRequestWithoutRefreshTokenDto: SwitchWorkspaceRequestWithoutRefreshTokenDto;
88
+ /**
89
+ * HTTP only cookie that was sent during login
90
+ * @type {string}
91
+ * @memberof WorkspacesApiSwitchWorkspace
92
+ */
93
+ readonly cookie?: string;
94
+ }
95
+ /**
96
+ * WorkspacesApi - object-oriented interface
97
+ * @export
98
+ * @class WorkspacesApi
99
+ * @extends {BaseAPI}
100
+ */
101
+ export declare class WorkspacesApi extends BaseAPI {
102
+ /**
103
+ *
104
+ * @param {*} [options] Override http request option.
105
+ * @throws {RequiredError}
106
+ * @memberof WorkspacesApi
107
+ */
108
+ listWorkspaces(options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any>>;
109
+ /**
110
+ *
111
+ * @param {WorkspacesApiSwitchWorkspaceRequest} requestParameters Request parameters.
112
+ * @param {*} [options] Override http request option.
113
+ * @throws {RequiredError}
114
+ * @memberof WorkspacesApi
115
+ */
116
+ switchWorkspace(requestParameters: WorkspacesApiSwitchWorkspaceRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<object, any>>;
117
+ }
@@ -0,0 +1,292 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * EMIL AuthService
6
+ * The EMIL AuthService API description
7
+ *
8
+ * The version of the OpenAPI document: 1.0
9
+ * Contact: kontakt@emil.de
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __extends = (this && this.__extends) || (function () {
16
+ var extendStatics = function (d, b) {
17
+ extendStatics = Object.setPrototypeOf ||
18
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
20
+ return extendStatics(d, b);
21
+ };
22
+ return function (d, b) {
23
+ if (typeof b !== "function" && b !== null)
24
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
25
+ extendStatics(d, b);
26
+ function __() { this.constructor = d; }
27
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
28
+ };
29
+ })();
30
+ var __assign = (this && this.__assign) || function () {
31
+ __assign = Object.assign || function(t) {
32
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
33
+ s = arguments[i];
34
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
35
+ t[p] = s[p];
36
+ }
37
+ return t;
38
+ };
39
+ return __assign.apply(this, arguments);
40
+ };
41
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
42
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
43
+ return new (P || (P = Promise))(function (resolve, reject) {
44
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
45
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
46
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
47
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
48
+ });
49
+ };
50
+ var __generator = (this && this.__generator) || function (thisArg, body) {
51
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
52
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
53
+ function verb(n) { return function (v) { return step([n, v]); }; }
54
+ function step(op) {
55
+ if (f) throw new TypeError("Generator is already executing.");
56
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
57
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
58
+ if (y = 0, t) op = [op[0] & 2, t.value];
59
+ switch (op[0]) {
60
+ case 0: case 1: t = op; break;
61
+ case 4: _.label++; return { value: op[1], done: false };
62
+ case 5: _.label++; y = op[1]; op = [0]; continue;
63
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
64
+ default:
65
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
66
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
67
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
68
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
69
+ if (t[2]) _.ops.pop();
70
+ _.trys.pop(); continue;
71
+ }
72
+ op = body.call(thisArg, _);
73
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
74
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
75
+ }
76
+ };
77
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
78
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
79
+ if (ar || !(i in from)) {
80
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
81
+ ar[i] = from[i];
82
+ }
83
+ }
84
+ return to.concat(ar || Array.prototype.slice.call(from));
85
+ };
86
+ var __importDefault = (this && this.__importDefault) || function (mod) {
87
+ return (mod && mod.__esModule) ? mod : { "default": mod };
88
+ };
89
+ Object.defineProperty(exports, "__esModule", { value: true });
90
+ exports.WorkspacesApi = exports.WorkspacesApiFactory = exports.WorkspacesApiFp = exports.WorkspacesApiAxiosParamCreator = void 0;
91
+ var axios_1 = __importDefault(require("axios"));
92
+ // Some imports not used depending on template conditions
93
+ // @ts-ignore
94
+ var common_1 = require("../common");
95
+ // @ts-ignore
96
+ var base_1 = require("../base");
97
+ /**
98
+ * WorkspacesApi - axios parameter creator
99
+ * @export
100
+ */
101
+ var WorkspacesApiAxiosParamCreator = function (configuration) {
102
+ var _this = this;
103
+ return {
104
+ /**
105
+ *
106
+ * @param {*} [options] Override http request option.
107
+ * @throws {RequiredError}
108
+ */
109
+ listWorkspaces: function () {
110
+ var args_1 = [];
111
+ for (var _i = 0; _i < arguments.length; _i++) {
112
+ args_1[_i] = arguments[_i];
113
+ }
114
+ return __awaiter(_this, __spreadArray([], args_1, true), void 0, function (options) {
115
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
116
+ if (options === void 0) { options = {}; }
117
+ return __generator(this, function (_a) {
118
+ localVarPath = "/authservice/v1/workspaces";
119
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
120
+ if (configuration) {
121
+ baseOptions = configuration.baseOptions;
122
+ baseAccessToken = configuration.accessToken;
123
+ }
124
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
125
+ localVarHeaderParameter = {};
126
+ localVarQueryParameter = {};
127
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
128
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
129
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
130
+ return [2 /*return*/, {
131
+ url: (0, common_1.toPathString)(localVarUrlObj),
132
+ options: localVarRequestOptions,
133
+ }];
134
+ });
135
+ });
136
+ },
137
+ /**
138
+ *
139
+ * @param {SwitchWorkspaceRequestWithoutRefreshTokenDto} switchWorkspaceRequestWithoutRefreshTokenDto
140
+ * @param {string} [cookie] HTTP only cookie that was sent during login
141
+ * @param {*} [options] Override http request option.
142
+ * @throws {RequiredError}
143
+ */
144
+ switchWorkspace: function (switchWorkspaceRequestWithoutRefreshTokenDto_1, cookie_1) {
145
+ var args_1 = [];
146
+ for (var _i = 2; _i < arguments.length; _i++) {
147
+ args_1[_i - 2] = arguments[_i];
148
+ }
149
+ return __awaiter(_this, __spreadArray([switchWorkspaceRequestWithoutRefreshTokenDto_1, cookie_1], args_1, true), void 0, function (switchWorkspaceRequestWithoutRefreshTokenDto, cookie, options) {
150
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
151
+ if (options === void 0) { options = {}; }
152
+ return __generator(this, function (_a) {
153
+ // verify required parameter 'switchWorkspaceRequestWithoutRefreshTokenDto' is not null or undefined
154
+ (0, common_1.assertParamExists)('switchWorkspace', 'switchWorkspaceRequestWithoutRefreshTokenDto', switchWorkspaceRequestWithoutRefreshTokenDto);
155
+ localVarPath = "/authservice/v1/workspaces/switch";
156
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
157
+ if (configuration) {
158
+ baseOptions = configuration.baseOptions;
159
+ baseAccessToken = configuration.accessToken;
160
+ }
161
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
162
+ localVarHeaderParameter = {};
163
+ localVarQueryParameter = {};
164
+ if (cookie !== undefined && cookie !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
165
+ localVarHeaderParameter['Cookie'] = String(cookie ? cookie : baseAccessToken);
166
+ }
167
+ localVarHeaderParameter['Content-Type'] = 'application/json';
168
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
169
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
170
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
171
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(switchWorkspaceRequestWithoutRefreshTokenDto, localVarRequestOptions, configuration);
172
+ return [2 /*return*/, {
173
+ url: (0, common_1.toPathString)(localVarUrlObj),
174
+ options: localVarRequestOptions,
175
+ }];
176
+ });
177
+ });
178
+ },
179
+ };
180
+ };
181
+ exports.WorkspacesApiAxiosParamCreator = WorkspacesApiAxiosParamCreator;
182
+ /**
183
+ * WorkspacesApi - functional programming interface
184
+ * @export
185
+ */
186
+ var WorkspacesApiFp = function (configuration) {
187
+ var localVarAxiosParamCreator = (0, exports.WorkspacesApiAxiosParamCreator)(configuration);
188
+ return {
189
+ /**
190
+ *
191
+ * @param {*} [options] Override http request option.
192
+ * @throws {RequiredError}
193
+ */
194
+ listWorkspaces: function (options) {
195
+ return __awaiter(this, void 0, void 0, function () {
196
+ var localVarAxiosArgs;
197
+ return __generator(this, function (_a) {
198
+ switch (_a.label) {
199
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.listWorkspaces(options)];
200
+ case 1:
201
+ localVarAxiosArgs = _a.sent();
202
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
203
+ }
204
+ });
205
+ });
206
+ },
207
+ /**
208
+ *
209
+ * @param {SwitchWorkspaceRequestWithoutRefreshTokenDto} switchWorkspaceRequestWithoutRefreshTokenDto
210
+ * @param {string} [cookie] HTTP only cookie that was sent during login
211
+ * @param {*} [options] Override http request option.
212
+ * @throws {RequiredError}
213
+ */
214
+ switchWorkspace: function (switchWorkspaceRequestWithoutRefreshTokenDto, cookie, options) {
215
+ return __awaiter(this, void 0, void 0, function () {
216
+ var localVarAxiosArgs;
217
+ return __generator(this, function (_a) {
218
+ switch (_a.label) {
219
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.switchWorkspace(switchWorkspaceRequestWithoutRefreshTokenDto, cookie, options)];
220
+ case 1:
221
+ localVarAxiosArgs = _a.sent();
222
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
223
+ }
224
+ });
225
+ });
226
+ },
227
+ };
228
+ };
229
+ exports.WorkspacesApiFp = WorkspacesApiFp;
230
+ /**
231
+ * WorkspacesApi - factory interface
232
+ * @export
233
+ */
234
+ var WorkspacesApiFactory = function (configuration, basePath, axios) {
235
+ var localVarFp = (0, exports.WorkspacesApiFp)(configuration);
236
+ return {
237
+ /**
238
+ *
239
+ * @param {*} [options] Override http request option.
240
+ * @throws {RequiredError}
241
+ */
242
+ listWorkspaces: function (options) {
243
+ return localVarFp.listWorkspaces(options).then(function (request) { return request(axios, basePath); });
244
+ },
245
+ /**
246
+ *
247
+ * @param {SwitchWorkspaceRequestWithoutRefreshTokenDto} switchWorkspaceRequestWithoutRefreshTokenDto
248
+ * @param {string} [cookie] HTTP only cookie that was sent during login
249
+ * @param {*} [options] Override http request option.
250
+ * @throws {RequiredError}
251
+ */
252
+ switchWorkspace: function (switchWorkspaceRequestWithoutRefreshTokenDto, cookie, options) {
253
+ return localVarFp.switchWorkspace(switchWorkspaceRequestWithoutRefreshTokenDto, cookie, options).then(function (request) { return request(axios, basePath); });
254
+ },
255
+ };
256
+ };
257
+ exports.WorkspacesApiFactory = WorkspacesApiFactory;
258
+ /**
259
+ * WorkspacesApi - object-oriented interface
260
+ * @export
261
+ * @class WorkspacesApi
262
+ * @extends {BaseAPI}
263
+ */
264
+ var WorkspacesApi = /** @class */ (function (_super) {
265
+ __extends(WorkspacesApi, _super);
266
+ function WorkspacesApi() {
267
+ return _super !== null && _super.apply(this, arguments) || this;
268
+ }
269
+ /**
270
+ *
271
+ * @param {*} [options] Override http request option.
272
+ * @throws {RequiredError}
273
+ * @memberof WorkspacesApi
274
+ */
275
+ WorkspacesApi.prototype.listWorkspaces = function (options) {
276
+ var _this = this;
277
+ return (0, exports.WorkspacesApiFp)(this.configuration).listWorkspaces(options).then(function (request) { return request(_this.axios, _this.basePath); });
278
+ };
279
+ /**
280
+ *
281
+ * @param {WorkspacesApiSwitchWorkspaceRequest} requestParameters Request parameters.
282
+ * @param {*} [options] Override http request option.
283
+ * @throws {RequiredError}
284
+ * @memberof WorkspacesApi
285
+ */
286
+ WorkspacesApi.prototype.switchWorkspace = function (requestParameters, options) {
287
+ var _this = this;
288
+ return (0, exports.WorkspacesApiFp)(this.configuration).switchWorkspace(requestParameters.switchWorkspaceRequestWithoutRefreshTokenDto, requestParameters.cookie, options).then(function (request) { return request(_this.axios, _this.basePath); });
289
+ };
290
+ return WorkspacesApi;
291
+ }(base_1.BaseAPI));
292
+ exports.WorkspacesApi = WorkspacesApi;
package/dist/api.d.ts CHANGED
@@ -11,3 +11,4 @@
11
11
  */
12
12
  export * from './api/authservice-api';
13
13
  export * from './api/default-api';
14
+ export * from './api/workspaces-api';
package/dist/api.js CHANGED
@@ -29,3 +29,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
30
  __exportStar(require("./api/authservice-api"), exports);
31
31
  __exportStar(require("./api/default-api"), exports);
32
+ __exportStar(require("./api/workspaces-api"), exports);
package/dist/base.js CHANGED
@@ -48,8 +48,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
48
48
  });
49
49
  };
50
50
  var __generator = (this && this.__generator) || function (thisArg, body) {
51
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
52
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
51
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
52
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
53
53
  function verb(n) { return function (v) { return step([n, v]); }; }
54
54
  function step(op) {
55
55
  if (f) throw new TypeError("Generator is already executing.");
@@ -78,7 +78,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
78
78
  return (mod && mod.__esModule) ? mod : { "default": mod };
79
79
  };
80
80
  Object.defineProperty(exports, "__esModule", { value: true });
81
- exports.RequiredError = exports.BaseAPI = exports.resetRetry = exports.Environment = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
81
+ exports.RequiredError = exports.BaseAPI = exports.Environment = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
82
+ exports.resetRetry = resetRetry;
82
83
  var configuration_1 = require("./configuration");
83
84
  var common_1 = require("./common");
84
85
  // Some imports not used depending on template conditions
@@ -102,13 +103,12 @@ var Environment;
102
103
  Environment["Staging"] = "https://apiv2-staging.emil.de";
103
104
  Environment["Development"] = "https://apiv2-dev.emil.de";
104
105
  Environment["ProductionZurich"] = "https://eu-central-2.apiv2.emil.de";
105
- })(Environment = exports.Environment || (exports.Environment = {}));
106
+ })(Environment || (exports.Environment = Environment = {}));
106
107
  var _retry_count = 0;
107
108
  var _retry = null;
108
109
  function resetRetry() {
109
110
  _retry_count = 0;
110
111
  }
111
- exports.resetRetry = resetRetry;
112
112
  var NETWORK_ERROR_MESSAGE = "Network Error";
113
113
  var TOKEN_DATA = 'APP_TOKEN';
114
114
  /**
package/dist/common.d.ts CHANGED
@@ -62,7 +62,7 @@ export declare const toPathString: (url: URL) => string;
62
62
  *
63
63
  * @export
64
64
  */
65
- export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T, any>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
65
+ export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
66
66
  /**
67
67
  * EMIL AuthService
68
68
  * The EMIL AuthService API description
package/dist/common.js CHANGED
@@ -33,8 +33,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
33
33
  });
34
34
  };
35
35
  var __generator = (this && this.__generator) || function (thisArg, body) {
36
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
37
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
36
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
37
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
38
38
  function verb(n) { return function (v) { return step([n, v]); }; }
39
39
  function step(op) {
40
40
  if (f) throw new TypeError("Generator is already executing.");
@@ -140,7 +140,7 @@ var setBearerAuthToObject = function (object, configuration) {
140
140
  _b.label = 4;
141
141
  case 4:
142
142
  accessToken = _a;
143
- object["Authorization"] = "Bearer " + accessToken;
143
+ object["Authorization"] = configuration.getBearerToken(accessToken);
144
144
  _b.label = 5;
145
145
  case 5: return [2 /*return*/];
146
146
  }
@@ -170,7 +170,7 @@ var setOAuthToObject = function (object, name, scopes, configuration) {
170
170
  _b.label = 4;
171
171
  case 4:
172
172
  localVarAccessTokenValue = _a;
173
- object["Authorization"] = "Bearer " + localVarAccessTokenValue;
173
+ object["Authorization"] = configuration.getBearerToken(localVarAccessTokenValue);
174
174
  _b.label = 5;
175
175
  case 5: return [2 /*return*/];
176
176
  }
@@ -80,4 +80,10 @@ export declare class Configuration {
80
80
  * @return True if the given MIME is JSON, false otherwise.
81
81
  */
82
82
  isJsonMime(mime: string): boolean;
83
+ /**
84
+ * Returns "Bearer" token.
85
+ * @param token - access token.
86
+ * @return Bearer token.
87
+ */
88
+ getBearerToken(token?: string): string;
83
89
  }
@@ -39,6 +39,14 @@ var Configuration = /** @class */ (function () {
39
39
  var jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
40
40
  return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
41
41
  };
42
+ /**
43
+ * Returns "Bearer" token.
44
+ * @param token - access token.
45
+ * @return Bearer token.
46
+ */
47
+ Configuration.prototype.getBearerToken = function (token) {
48
+ return ('' + token).startsWith("Bearer") ? token : "Bearer " + token;
49
+ };
42
50
  return Configuration;
43
51
  }());
44
52
  exports.Configuration = Configuration;
@@ -16,6 +16,7 @@ export * from './organization-class';
16
16
  export * from './refresh-token-dto';
17
17
  export * from './reset-password-request-dto';
18
18
  export * from './role-class';
19
+ export * from './switch-workspace-request-without-refresh-token-dto';
19
20
  export * from './user-class';
20
21
  export * from './verify-org-invitation-request-dto';
21
22
  export * from './verify-org-invitation-response-class';
@@ -32,6 +32,7 @@ __exportStar(require("./organization-class"), exports);
32
32
  __exportStar(require("./refresh-token-dto"), exports);
33
33
  __exportStar(require("./reset-password-request-dto"), exports);
34
34
  __exportStar(require("./role-class"), exports);
35
+ __exportStar(require("./switch-workspace-request-without-refresh-token-dto"), exports);
35
36
  __exportStar(require("./user-class"), exports);
36
37
  __exportStar(require("./verify-org-invitation-request-dto"), exports);
37
38
  __exportStar(require("./verify-org-invitation-response-class"), exports);
@@ -0,0 +1,30 @@
1
+ /**
2
+ * EMIL AuthService
3
+ * The EMIL AuthService API description
4
+ *
5
+ * The version of the OpenAPI document: 1.0
6
+ * Contact: kontakt@emil.de
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface SwitchWorkspaceRequestWithoutRefreshTokenDto
16
+ */
17
+ export interface SwitchWorkspaceRequestWithoutRefreshTokenDto {
18
+ /**
19
+ *
20
+ * @type {string}
21
+ * @memberof SwitchWorkspaceRequestWithoutRefreshTokenDto
22
+ */
23
+ 'username': string;
24
+ /**
25
+ *
26
+ * @type {string}
27
+ * @memberof SwitchWorkspaceRequestWithoutRefreshTokenDto
28
+ */
29
+ 'targetWorkspace': string;
30
+ }