@emilgroup/auth-sdk-node 1.17.2-beta.1 → 1.18.1-beta.19
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/.openapi-generator/FILES +5 -0
- package/README.md +2 -2
- package/api/default-api.ts +4 -4
- package/api/workspaces-api.ts +273 -0
- package/api.ts +2 -0
- package/base.ts +5 -3
- package/dist/api/authservice-api.d.ts +12 -12
- package/dist/api/authservice-api.js +38 -95
- package/dist/api/default-api.d.ts +5 -5
- package/dist/api/default-api.js +9 -22
- package/dist/api/workspaces-api.d.ts +153 -0
- package/dist/api/workspaces-api.js +321 -0
- package/dist/api.d.ts +1 -0
- package/dist/api.js +1 -0
- package/dist/base.d.ts +2 -2
- package/dist/base.js +17 -27
- package/dist/common.d.ts +1 -1
- package/dist/common.js +2 -2
- package/dist/models/index.d.ts +4 -0
- package/dist/models/index.js +4 -0
- package/dist/models/list-workspaces-response-class.d.ts +25 -0
- package/dist/models/list-workspaces-response-class.js +15 -0
- package/dist/models/switch-workspace-request-without-refresh-token-dto.d.ts +30 -0
- package/dist/models/switch-workspace-request-without-refresh-token-dto.js +15 -0
- package/dist/models/switch-workspace-response-class.d.ts +24 -0
- package/dist/models/switch-workspace-response-class.js +15 -0
- package/dist/models/user-class.d.ts +6 -0
- package/dist/models/workspace-class.d.ts +48 -0
- package/dist/models/workspace-class.js +15 -0
- package/models/index.ts +4 -0
- package/models/list-workspaces-response-class.ts +31 -0
- package/models/switch-workspace-request-without-refresh-token-dto.ts +36 -0
- package/models/switch-workspace-response-class.ts +30 -0
- package/models/user-class.ts +6 -0
- package/models/workspace-class.ts +54 -0
- package/package.json +4 -4
package/.openapi-generator/FILES
CHANGED
|
@@ -5,6 +5,7 @@ README.md
|
|
|
5
5
|
api.ts
|
|
6
6
|
api/authservice-api.ts
|
|
7
7
|
api/default-api.ts
|
|
8
|
+
api/workspaces-api.ts
|
|
8
9
|
base.ts
|
|
9
10
|
common.ts
|
|
10
11
|
configuration.ts
|
|
@@ -20,6 +21,7 @@ models/get-saml-login-link-request-dto.ts
|
|
|
20
21
|
models/index.ts
|
|
21
22
|
models/inline-response200.ts
|
|
22
23
|
models/inline-response503.ts
|
|
24
|
+
models/list-workspaces-response-class.ts
|
|
23
25
|
models/login-by-saml-request-dto.ts
|
|
24
26
|
models/login-class.ts
|
|
25
27
|
models/login-request-dto.ts
|
|
@@ -29,8 +31,11 @@ models/organization-class.ts
|
|
|
29
31
|
models/refresh-token-dto.ts
|
|
30
32
|
models/reset-password-request-dto.ts
|
|
31
33
|
models/role-class.ts
|
|
34
|
+
models/switch-workspace-request-without-refresh-token-dto.ts
|
|
35
|
+
models/switch-workspace-response-class.ts
|
|
32
36
|
models/user-class.ts
|
|
33
37
|
models/verify-org-invitation-request-dto.ts
|
|
34
38
|
models/verify-org-invitation-response-class.ts
|
|
39
|
+
models/workspace-class.ts
|
|
35
40
|
package.json
|
|
36
41
|
tsconfig.json
|
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/auth-sdk-node@1.
|
|
20
|
+
npm install @emilgroup/auth-sdk-node@1.18.1-beta.19 --save
|
|
21
21
|
```
|
|
22
22
|
or
|
|
23
23
|
```
|
|
24
|
-
yarn add @emilgroup/auth-sdk-node@1.
|
|
24
|
+
yarn add @emilgroup/auth-sdk-node@1.18.1-beta.19
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
And then you can import ``.
|
package/api/default-api.ts
CHANGED
|
@@ -35,7 +35,7 @@ const FormData = require('form-data');
|
|
|
35
35
|
export const DefaultApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
36
36
|
return {
|
|
37
37
|
/**
|
|
38
|
-
* Returns the health status of the auth service.
|
|
38
|
+
* 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.
|
|
39
39
|
* @summary Health Check
|
|
40
40
|
* @param {*} [options] Override http request option.
|
|
41
41
|
* @throws {RequiredError}
|
|
@@ -77,7 +77,7 @@ export const DefaultApiFp = function(configuration?: Configuration) {
|
|
|
77
77
|
const localVarAxiosParamCreator = DefaultApiAxiosParamCreator(configuration)
|
|
78
78
|
return {
|
|
79
79
|
/**
|
|
80
|
-
* Returns the health status of the auth service.
|
|
80
|
+
* 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.
|
|
81
81
|
* @summary Health Check
|
|
82
82
|
* @param {*} [options] Override http request option.
|
|
83
83
|
* @throws {RequiredError}
|
|
@@ -97,7 +97,7 @@ export const DefaultApiFactory = function (configuration?: Configuration, basePa
|
|
|
97
97
|
const localVarFp = DefaultApiFp(configuration)
|
|
98
98
|
return {
|
|
99
99
|
/**
|
|
100
|
-
* Returns the health status of the auth service.
|
|
100
|
+
* 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.
|
|
101
101
|
* @summary Health Check
|
|
102
102
|
* @param {*} [options] Override http request option.
|
|
103
103
|
* @throws {RequiredError}
|
|
@@ -116,7 +116,7 @@ export const DefaultApiFactory = function (configuration?: Configuration, basePa
|
|
|
116
116
|
*/
|
|
117
117
|
export class DefaultApi extends BaseAPI {
|
|
118
118
|
/**
|
|
119
|
-
* Returns the health status of the auth service.
|
|
119
|
+
* 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.
|
|
120
120
|
* @summary Health Check
|
|
121
121
|
* @param {*} [options] Override http request option.
|
|
122
122
|
* @throws {RequiredError}
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* EMIL AuthService
|
|
5
|
+
* The EMIL AuthService API description
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0
|
|
8
|
+
* Contact: kontakt@emil.de
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
17
|
+
import { Configuration } from '../configuration';
|
|
18
|
+
// Some imports not used depending on template conditions
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
import { ListWorkspacesResponseClass } from '../models';
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
import { SwitchWorkspaceRequestWithoutRefreshTokenDto } from '../models';
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
import { SwitchWorkspaceResponseClass } from '../models';
|
|
29
|
+
// URLSearchParams not necessarily used
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
import { URL, URLSearchParams } from 'url';
|
|
32
|
+
const FormData = require('form-data');
|
|
33
|
+
/**
|
|
34
|
+
* WorkspacesApi - axios parameter creator
|
|
35
|
+
* @export
|
|
36
|
+
*/
|
|
37
|
+
export const WorkspacesApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
38
|
+
return {
|
|
39
|
+
/**
|
|
40
|
+
* Returns a list of workspaces you have access to. Note that this endpoint does not support sorting or pagination.
|
|
41
|
+
* @summary List workspaces
|
|
42
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
43
|
+
* @param {*} [options] Override http request option.
|
|
44
|
+
* @throws {RequiredError}
|
|
45
|
+
*/
|
|
46
|
+
listWorkspaces: async (authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
47
|
+
const localVarPath = `/authservice/v1/workspaces`;
|
|
48
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
49
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
50
|
+
let baseOptions;
|
|
51
|
+
let baseAccessToken;
|
|
52
|
+
if (configuration) {
|
|
53
|
+
baseOptions = configuration.baseOptions;
|
|
54
|
+
baseAccessToken = configuration.accessToken;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
|
58
|
+
const localVarHeaderParameter = {} as any;
|
|
59
|
+
const localVarQueryParameter = {} as any;
|
|
60
|
+
|
|
61
|
+
// authentication bearer required
|
|
62
|
+
// http bearer authentication required
|
|
63
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
64
|
+
|
|
65
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
66
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
72
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
73
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
74
|
+
|
|
75
|
+
return {
|
|
76
|
+
url: toPathString(localVarUrlObj),
|
|
77
|
+
options: localVarRequestOptions,
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
/**
|
|
81
|
+
* Switch to a different workspace and get new access and refresh tokens.
|
|
82
|
+
* @summary Switch workspace
|
|
83
|
+
* @param {SwitchWorkspaceRequestWithoutRefreshTokenDto} switchWorkspaceRequestWithoutRefreshTokenDto
|
|
84
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
85
|
+
* @param {string} [cookie] HTTP only cookie that was sent during login
|
|
86
|
+
* @param {*} [options] Override http request option.
|
|
87
|
+
* @throws {RequiredError}
|
|
88
|
+
*/
|
|
89
|
+
switchWorkspace: async (switchWorkspaceRequestWithoutRefreshTokenDto: SwitchWorkspaceRequestWithoutRefreshTokenDto, authorization?: string, cookie?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
90
|
+
// verify required parameter 'switchWorkspaceRequestWithoutRefreshTokenDto' is not null or undefined
|
|
91
|
+
assertParamExists('switchWorkspace', 'switchWorkspaceRequestWithoutRefreshTokenDto', switchWorkspaceRequestWithoutRefreshTokenDto)
|
|
92
|
+
const localVarPath = `/authservice/v1/workspaces/switch`;
|
|
93
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
94
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
95
|
+
let baseOptions;
|
|
96
|
+
let baseAccessToken;
|
|
97
|
+
if (configuration) {
|
|
98
|
+
baseOptions = configuration.baseOptions;
|
|
99
|
+
baseAccessToken = configuration.accessToken;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
103
|
+
const localVarHeaderParameter = {} as any;
|
|
104
|
+
const localVarQueryParameter = {} as any;
|
|
105
|
+
|
|
106
|
+
// authentication bearer required
|
|
107
|
+
// http bearer authentication required
|
|
108
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
109
|
+
|
|
110
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
111
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (cookie !== undefined && cookie !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
115
|
+
localVarHeaderParameter['Cookie'] = String(cookie ? cookie : baseAccessToken);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
121
|
+
|
|
122
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
123
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
124
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
125
|
+
localVarRequestOptions.data = serializeDataIfNeeded(switchWorkspaceRequestWithoutRefreshTokenDto, localVarRequestOptions, configuration)
|
|
126
|
+
|
|
127
|
+
return {
|
|
128
|
+
url: toPathString(localVarUrlObj),
|
|
129
|
+
options: localVarRequestOptions,
|
|
130
|
+
};
|
|
131
|
+
},
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* WorkspacesApi - functional programming interface
|
|
137
|
+
* @export
|
|
138
|
+
*/
|
|
139
|
+
export const WorkspacesApiFp = function(configuration?: Configuration) {
|
|
140
|
+
const localVarAxiosParamCreator = WorkspacesApiAxiosParamCreator(configuration)
|
|
141
|
+
return {
|
|
142
|
+
/**
|
|
143
|
+
* Returns a list of workspaces you have access to. Note that this endpoint does not support sorting or pagination.
|
|
144
|
+
* @summary List workspaces
|
|
145
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
146
|
+
* @param {*} [options] Override http request option.
|
|
147
|
+
* @throws {RequiredError}
|
|
148
|
+
*/
|
|
149
|
+
async listWorkspaces(authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListWorkspacesResponseClass>> {
|
|
150
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.listWorkspaces(authorization, options);
|
|
151
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
152
|
+
},
|
|
153
|
+
/**
|
|
154
|
+
* Switch to a different workspace and get new access and refresh tokens.
|
|
155
|
+
* @summary Switch workspace
|
|
156
|
+
* @param {SwitchWorkspaceRequestWithoutRefreshTokenDto} switchWorkspaceRequestWithoutRefreshTokenDto
|
|
157
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
158
|
+
* @param {string} [cookie] HTTP only cookie that was sent during login
|
|
159
|
+
* @param {*} [options] Override http request option.
|
|
160
|
+
* @throws {RequiredError}
|
|
161
|
+
*/
|
|
162
|
+
async switchWorkspace(switchWorkspaceRequestWithoutRefreshTokenDto: SwitchWorkspaceRequestWithoutRefreshTokenDto, authorization?: string, cookie?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SwitchWorkspaceResponseClass>> {
|
|
163
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.switchWorkspace(switchWorkspaceRequestWithoutRefreshTokenDto, authorization, cookie, options);
|
|
164
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
165
|
+
},
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* WorkspacesApi - factory interface
|
|
171
|
+
* @export
|
|
172
|
+
*/
|
|
173
|
+
export const WorkspacesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
174
|
+
const localVarFp = WorkspacesApiFp(configuration)
|
|
175
|
+
return {
|
|
176
|
+
/**
|
|
177
|
+
* Returns a list of workspaces you have access to. Note that this endpoint does not support sorting or pagination.
|
|
178
|
+
* @summary List workspaces
|
|
179
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
180
|
+
* @param {*} [options] Override http request option.
|
|
181
|
+
* @throws {RequiredError}
|
|
182
|
+
*/
|
|
183
|
+
listWorkspaces(authorization?: string, options?: any): AxiosPromise<ListWorkspacesResponseClass> {
|
|
184
|
+
return localVarFp.listWorkspaces(authorization, options).then((request) => request(axios, basePath));
|
|
185
|
+
},
|
|
186
|
+
/**
|
|
187
|
+
* Switch to a different workspace and get new access and refresh tokens.
|
|
188
|
+
* @summary Switch workspace
|
|
189
|
+
* @param {SwitchWorkspaceRequestWithoutRefreshTokenDto} switchWorkspaceRequestWithoutRefreshTokenDto
|
|
190
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
191
|
+
* @param {string} [cookie] HTTP only cookie that was sent during login
|
|
192
|
+
* @param {*} [options] Override http request option.
|
|
193
|
+
* @throws {RequiredError}
|
|
194
|
+
*/
|
|
195
|
+
switchWorkspace(switchWorkspaceRequestWithoutRefreshTokenDto: SwitchWorkspaceRequestWithoutRefreshTokenDto, authorization?: string, cookie?: string, options?: any): AxiosPromise<SwitchWorkspaceResponseClass> {
|
|
196
|
+
return localVarFp.switchWorkspace(switchWorkspaceRequestWithoutRefreshTokenDto, authorization, cookie, options).then((request) => request(axios, basePath));
|
|
197
|
+
},
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Request parameters for listWorkspaces operation in WorkspacesApi.
|
|
203
|
+
* @export
|
|
204
|
+
* @interface WorkspacesApiListWorkspacesRequest
|
|
205
|
+
*/
|
|
206
|
+
export interface WorkspacesApiListWorkspacesRequest {
|
|
207
|
+
/**
|
|
208
|
+
* Bearer Token: provided by the login endpoint under the name accessToken.
|
|
209
|
+
* @type {string}
|
|
210
|
+
* @memberof WorkspacesApiListWorkspaces
|
|
211
|
+
*/
|
|
212
|
+
readonly authorization?: string
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Request parameters for switchWorkspace operation in WorkspacesApi.
|
|
217
|
+
* @export
|
|
218
|
+
* @interface WorkspacesApiSwitchWorkspaceRequest
|
|
219
|
+
*/
|
|
220
|
+
export interface WorkspacesApiSwitchWorkspaceRequest {
|
|
221
|
+
/**
|
|
222
|
+
*
|
|
223
|
+
* @type {SwitchWorkspaceRequestWithoutRefreshTokenDto}
|
|
224
|
+
* @memberof WorkspacesApiSwitchWorkspace
|
|
225
|
+
*/
|
|
226
|
+
readonly switchWorkspaceRequestWithoutRefreshTokenDto: SwitchWorkspaceRequestWithoutRefreshTokenDto
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Bearer Token: provided by the login endpoint under the name accessToken.
|
|
230
|
+
* @type {string}
|
|
231
|
+
* @memberof WorkspacesApiSwitchWorkspace
|
|
232
|
+
*/
|
|
233
|
+
readonly authorization?: string
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* HTTP only cookie that was sent during login
|
|
237
|
+
* @type {string}
|
|
238
|
+
* @memberof WorkspacesApiSwitchWorkspace
|
|
239
|
+
*/
|
|
240
|
+
readonly cookie?: string
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* WorkspacesApi - object-oriented interface
|
|
245
|
+
* @export
|
|
246
|
+
* @class WorkspacesApi
|
|
247
|
+
* @extends {BaseAPI}
|
|
248
|
+
*/
|
|
249
|
+
export class WorkspacesApi extends BaseAPI {
|
|
250
|
+
/**
|
|
251
|
+
* Returns a list of workspaces you have access to. Note that this endpoint does not support sorting or pagination.
|
|
252
|
+
* @summary List workspaces
|
|
253
|
+
* @param {WorkspacesApiListWorkspacesRequest} requestParameters Request parameters.
|
|
254
|
+
* @param {*} [options] Override http request option.
|
|
255
|
+
* @throws {RequiredError}
|
|
256
|
+
* @memberof WorkspacesApi
|
|
257
|
+
*/
|
|
258
|
+
public listWorkspaces(requestParameters: WorkspacesApiListWorkspacesRequest = {}, options?: AxiosRequestConfig) {
|
|
259
|
+
return WorkspacesApiFp(this.configuration).listWorkspaces(requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Switch to a different workspace and get new access and refresh tokens.
|
|
264
|
+
* @summary Switch workspace
|
|
265
|
+
* @param {WorkspacesApiSwitchWorkspaceRequest} requestParameters Request parameters.
|
|
266
|
+
* @param {*} [options] Override http request option.
|
|
267
|
+
* @throws {RequiredError}
|
|
268
|
+
* @memberof WorkspacesApi
|
|
269
|
+
*/
|
|
270
|
+
public switchWorkspace(requestParameters: WorkspacesApiSwitchWorkspaceRequest, options?: AxiosRequestConfig) {
|
|
271
|
+
return WorkspacesApiFp(this.configuration).switchWorkspace(requestParameters.switchWorkspaceRequestWithoutRefreshTokenDto, requestParameters.authorization, requestParameters.cookie, options).then((request) => request(this.axios, this.basePath));
|
|
272
|
+
}
|
|
273
|
+
}
|
package/api.ts
CHANGED
|
@@ -26,8 +26,10 @@ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObj
|
|
|
26
26
|
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base';
|
|
27
27
|
import { AuthserviceApi } from './api';
|
|
28
28
|
import { DefaultApi } from './api';
|
|
29
|
+
import { WorkspacesApi } from './api';
|
|
29
30
|
|
|
30
31
|
|
|
31
32
|
export * from './api/authservice-api';
|
|
32
33
|
export * from './api/default-api';
|
|
34
|
+
export * from './api/workspaces-api';
|
|
33
35
|
|
package/base.ts
CHANGED
|
@@ -44,6 +44,7 @@ export interface LoginClass {
|
|
|
44
44
|
permissions: string;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
|
|
47
48
|
export enum Environment {
|
|
48
49
|
Production = 'https://apiv2.emil.de',
|
|
49
50
|
Test = 'https://apiv2-test.emil.de',
|
|
@@ -94,13 +95,13 @@ export class BaseAPI {
|
|
|
94
95
|
this.attachInterceptor(axios);
|
|
95
96
|
}
|
|
96
97
|
|
|
97
|
-
async initialize(env: Environment = Environment.Production) {
|
|
98
|
+
async initialize(env: Environment = Environment.Production, targetWorkspace?: string) {
|
|
98
99
|
this.configuration.basePath = env;
|
|
99
100
|
|
|
100
101
|
await this.loadCredentials();
|
|
101
102
|
|
|
102
103
|
if (this.username) {
|
|
103
|
-
await this.authorize(this.username, this.password);
|
|
104
|
+
await this.authorize(this.username, this.password, targetWorkspace);
|
|
104
105
|
this.password = null; // to avoid keeping password loaded in memory.
|
|
105
106
|
}
|
|
106
107
|
}
|
|
@@ -150,7 +151,7 @@ export class BaseAPI {
|
|
|
150
151
|
this.configuration.basePath = env;
|
|
151
152
|
}
|
|
152
153
|
|
|
153
|
-
async authorize(username: string, password: string): Promise<void> {
|
|
154
|
+
async authorize(username: string, password: string, targetWorkspace?: string): Promise<void> {
|
|
154
155
|
const options: AxiosRequestConfig = {
|
|
155
156
|
method: 'POST',
|
|
156
157
|
url: `${this.configuration.basePath}/authservice/v1/login`,
|
|
@@ -170,6 +171,7 @@ export class BaseAPI {
|
|
|
170
171
|
|
|
171
172
|
const refreshToken = this.extractRefreshToken(response)
|
|
172
173
|
this.configuration.refreshToken = refreshToken;
|
|
174
|
+
|
|
173
175
|
}
|
|
174
176
|
|
|
175
177
|
async refreshTokenInternal(): Promise<string> {
|
|
@@ -510,7 +510,7 @@ export declare class AuthserviceApi extends BaseAPI {
|
|
|
510
510
|
* @throws {RequiredError}
|
|
511
511
|
* @memberof AuthserviceApi
|
|
512
512
|
*/
|
|
513
|
-
createOrgAndUser(requestParameters: AuthserviceApiCreateOrgAndUserRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateOrgAndUserResponseClass, any>>;
|
|
513
|
+
createOrgAndUser(requestParameters: AuthserviceApiCreateOrgAndUserRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateOrgAndUserResponseClass, any, {}>>;
|
|
514
514
|
/**
|
|
515
515
|
* Register a tenant user using the invite token sent to the tenant user\'s email address.
|
|
516
516
|
* @summary Register tenant user after invite
|
|
@@ -519,7 +519,7 @@ export declare class AuthserviceApi extends BaseAPI {
|
|
|
519
519
|
* @throws {RequiredError}
|
|
520
520
|
* @memberof AuthserviceApi
|
|
521
521
|
*/
|
|
522
|
-
createUser(requestParameters: AuthserviceApiCreateUserRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateUserResponseClass, any>>;
|
|
522
|
+
createUser(requestParameters: AuthserviceApiCreateUserRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateUserResponseClass, any, {}>>;
|
|
523
523
|
/**
|
|
524
524
|
* Send a tenant user a reset-password token via email.
|
|
525
525
|
* @summary Forgot password by tenant
|
|
@@ -528,7 +528,7 @@ export declare class AuthserviceApi extends BaseAPI {
|
|
|
528
528
|
* @throws {RequiredError}
|
|
529
529
|
* @memberof AuthserviceApi
|
|
530
530
|
*/
|
|
531
|
-
forgotPassword(requestParameters: AuthserviceApiForgotPasswordRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any>>;
|
|
531
|
+
forgotPassword(requestParameters: AuthserviceApiForgotPasswordRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}>>;
|
|
532
532
|
/**
|
|
533
533
|
* Get SAML login link configured for the tenant in cognito as well as tenant settings
|
|
534
534
|
* @summary Get SAML login link for tenant
|
|
@@ -537,7 +537,7 @@ export declare class AuthserviceApi extends BaseAPI {
|
|
|
537
537
|
* @throws {RequiredError}
|
|
538
538
|
* @memberof AuthserviceApi
|
|
539
539
|
*/
|
|
540
|
-
getSamlLoginLink(requestParameters: AuthserviceApiGetSamlLoginLinkRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any>>;
|
|
540
|
+
getSamlLoginLink(requestParameters: AuthserviceApiGetSamlLoginLinkRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}>>;
|
|
541
541
|
/**
|
|
542
542
|
* Get new access token, refresh token after successful login.
|
|
543
543
|
* @summary Login by tenant
|
|
@@ -546,7 +546,7 @@ export declare class AuthserviceApi extends BaseAPI {
|
|
|
546
546
|
* @throws {RequiredError}
|
|
547
547
|
* @memberof AuthserviceApi
|
|
548
548
|
*/
|
|
549
|
-
login(requestParameters: AuthserviceApiLoginRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<LoginClass, any>>;
|
|
549
|
+
login(requestParameters: AuthserviceApiLoginRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<LoginClass, any, {}>>;
|
|
550
550
|
/**
|
|
551
551
|
* Get new access token, refresh token after successful login. This api also creates a tenant user if user does not exist
|
|
552
552
|
* @summary Login by SAML idp provider such as ADFS
|
|
@@ -555,7 +555,7 @@ export declare class AuthserviceApi extends BaseAPI {
|
|
|
555
555
|
* @throws {RequiredError}
|
|
556
556
|
* @memberof AuthserviceApi
|
|
557
557
|
*/
|
|
558
|
-
loginBySaml(requestParameters: AuthserviceApiLoginBySamlRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<LoginClass, any>>;
|
|
558
|
+
loginBySaml(requestParameters: AuthserviceApiLoginBySamlRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<LoginClass, any, {}>>;
|
|
559
559
|
/**
|
|
560
560
|
* Sign tenant user out.
|
|
561
561
|
* @summary Logout tenant
|
|
@@ -564,7 +564,7 @@ export declare class AuthserviceApi extends BaseAPI {
|
|
|
564
564
|
* @throws {RequiredError}
|
|
565
565
|
* @memberof AuthserviceApi
|
|
566
566
|
*/
|
|
567
|
-
logout(requestParameters: AuthserviceApiLogoutRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any>>;
|
|
567
|
+
logout(requestParameters: AuthserviceApiLogoutRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}>>;
|
|
568
568
|
/**
|
|
569
569
|
* Get new access token, new refresh token.
|
|
570
570
|
* @summary Refresh token by tenant
|
|
@@ -573,7 +573,7 @@ export declare class AuthserviceApi extends BaseAPI {
|
|
|
573
573
|
* @throws {RequiredError}
|
|
574
574
|
* @memberof AuthserviceApi
|
|
575
575
|
*/
|
|
576
|
-
refreshToken(requestParameters: AuthserviceApiRefreshTokenRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<LoginClass, any>>;
|
|
576
|
+
refreshToken(requestParameters: AuthserviceApiRefreshTokenRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<LoginClass, any, {}>>;
|
|
577
577
|
/**
|
|
578
578
|
* Change tenant user\'s password using the token provided by the reset password endpoint.
|
|
579
579
|
* @summary Change password by tenant
|
|
@@ -582,7 +582,7 @@ export declare class AuthserviceApi extends BaseAPI {
|
|
|
582
582
|
* @throws {RequiredError}
|
|
583
583
|
* @memberof AuthserviceApi
|
|
584
584
|
*/
|
|
585
|
-
resetPassword(requestParameters: AuthserviceApiResetPasswordRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any>>;
|
|
585
|
+
resetPassword(requestParameters: AuthserviceApiResetPasswordRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}>>;
|
|
586
586
|
/**
|
|
587
587
|
* Verify the invite sent to the tenant user via email.
|
|
588
588
|
* @summary Verify tenant user\'s invite token
|
|
@@ -591,7 +591,7 @@ export declare class AuthserviceApi extends BaseAPI {
|
|
|
591
591
|
* @throws {RequiredError}
|
|
592
592
|
* @memberof AuthserviceApi
|
|
593
593
|
*/
|
|
594
|
-
verifyInvite(requestParameters: AuthserviceApiVerifyInviteRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any>>;
|
|
594
|
+
verifyInvite(requestParameters: AuthserviceApiVerifyInviteRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}>>;
|
|
595
595
|
/**
|
|
596
596
|
* Verifies token and returns necessary data for signing up as an organization.
|
|
597
597
|
* @summary Verify a organization\'s invitation token
|
|
@@ -600,7 +600,7 @@ export declare class AuthserviceApi extends BaseAPI {
|
|
|
600
600
|
* @throws {RequiredError}
|
|
601
601
|
* @memberof AuthserviceApi
|
|
602
602
|
*/
|
|
603
|
-
verifyOrgInvitation(requestParameters: AuthserviceApiVerifyOrgInvitationRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<VerifyOrgInvitationResponseClass, any>>;
|
|
603
|
+
verifyOrgInvitation(requestParameters: AuthserviceApiVerifyOrgInvitationRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<VerifyOrgInvitationResponseClass, any, {}>>;
|
|
604
604
|
/**
|
|
605
605
|
* Verify the reset password token that is sent by calling the \'forgot password\' endpoint.
|
|
606
606
|
* @summary Verify tenant reset password token
|
|
@@ -609,5 +609,5 @@ export declare class AuthserviceApi extends BaseAPI {
|
|
|
609
609
|
* @throws {RequiredError}
|
|
610
610
|
* @memberof AuthserviceApi
|
|
611
611
|
*/
|
|
612
|
-
verifyResetPasswordToken(requestParameters: AuthserviceApiVerifyResetPasswordTokenRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any>>;
|
|
612
|
+
verifyResetPasswordToken(requestParameters: AuthserviceApiVerifyResetPasswordTokenRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}>>;
|
|
613
613
|
}
|