keycloak-api 1.0.0 → 1.0.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.
- package/README.md +79 -0
- package/dist/account/components.cjs +110 -229
- package/dist/account/components.d.mts +70 -614
- package/dist/account/components.d.mts.map +1 -1
- package/dist/account/components.mjs +110 -229
- package/dist/account/schemas.cjs +71 -270
- package/dist/account/schemas.d.mts +166 -76
- package/dist/account/schemas.d.mts.map +1 -1
- package/dist/account/schemas.mjs +1 -183
- package/dist/account/types.d.mts +314 -737
- package/dist/account/types.d.mts.map +1 -1
- package/dist/admin/components.cjs +3130 -4734
- package/dist/admin/components.d.mts +1661 -8240
- package/dist/admin/components.d.mts.map +1 -1
- package/dist/admin/components.mjs +3131 -4723
- package/dist/admin/schemas.cjs +1875 -7511
- package/dist/admin/schemas.d.mts +22930 -7610
- package/dist/admin/schemas.d.mts.map +1 -1
- package/dist/admin/schemas.mjs +1 -4790
- package/dist/admin/types.cjs +13 -57
- package/dist/admin/types.d.mts +10887 -21855
- package/dist/admin/types.d.mts.map +1 -1
- package/dist/admin/types.mjs +1 -49
- package/dist/fetcher-aq8636lm.cjs +65 -0
- package/dist/fetcher-caoilmfh.d.ts +38 -0
- package/dist/fetcher-caoilmfh.d.ts.map +1 -0
- package/dist/fetcher-letfyywe.js +65 -0
- package/dist/index.cjs +19 -18758
- package/dist/index.d.ts +45097 -45932
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +8 -18727
- package/dist/schemas-ckfznbee.js +340 -0
- package/dist/schemas-f1u0t5ee.cjs +430 -0
- package/dist/schemas-g9c8wc66.cjs +10203 -0
- package/dist/schemas-pbtpxjsr.js +8309 -0
- package/dist/types-6yzhv6is.cjs +73 -0
- package/dist/types-iyze6mys.js +63 -0
- package/package.json +4 -4
package/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# keycloak-api
|
|
2
|
+
|
|
3
|
+
Auto-generated, fully typed client for the [Keycloak Admin and Account REST APIs](https://www.keycloak.org/docs-api/latest/rest-api/index.html).
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Fully typed** - every endpoint, parameter and response is generated from the official OpenAPI specs
|
|
8
|
+
- **Admin and Account APIs** - separate clients for the two Keycloak surfaces
|
|
9
|
+
- **Tree-shakable** - only the operations you import end up in your bundle
|
|
10
|
+
- **Runtime agnostic** - uses the global `fetch`, or bring your own implementation
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install keycloak-api
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Quick Start
|
|
19
|
+
|
|
20
|
+
Keycloak is self-hosted, so both clients require the `baseUrl` of your server. Endpoints are addressed
|
|
21
|
+
as `"<METHOD> <path>"`.
|
|
22
|
+
|
|
23
|
+
### Admin API
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import { KeycloakAdminApi } from "keycloak-api";
|
|
27
|
+
|
|
28
|
+
const admin = new KeycloakAdminApi({
|
|
29
|
+
baseUrl: "https://keycloak.example.com",
|
|
30
|
+
token: process.env.KEYCLOAK_TOKEN ?? null,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const realms = await admin.request("GET /admin/realms", {});
|
|
34
|
+
const realm = await admin.request("GET /admin/realms/{realm}", {
|
|
35
|
+
pathParams: { realm: "master" },
|
|
36
|
+
});
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Account API
|
|
40
|
+
|
|
41
|
+
The Account API is scoped to a single realm, passed at construction time.
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
import { KeycloakAccountApi } from "keycloak-api";
|
|
45
|
+
|
|
46
|
+
const account = new KeycloakAccountApi({
|
|
47
|
+
baseUrl: "https://keycloak.example.com",
|
|
48
|
+
realm: "master",
|
|
49
|
+
token: process.env.KEYCLOAK_TOKEN ?? null,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const me = await account.request("GET /account/", {});
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Custom fetch
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
const admin = new KeycloakAdminApi({
|
|
59
|
+
baseUrl: "https://keycloak.example.com",
|
|
60
|
+
token: process.env.KEYCLOAK_TOKEN ?? null,
|
|
61
|
+
fetch: myFetchImplementation,
|
|
62
|
+
});
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Entrypoints
|
|
66
|
+
|
|
67
|
+
| Import | Contents |
|
|
68
|
+
| --- | --- |
|
|
69
|
+
| `keycloak-api` | both client classes, plus admin/account operations, schemas and types |
|
|
70
|
+
| `keycloak-api/admin/components` | admin operations grouped by tag and by path |
|
|
71
|
+
| `keycloak-api/admin/schemas` | Zod schemas for admin operations |
|
|
72
|
+
| `keycloak-api/admin/types` | TypeScript types for admin operations |
|
|
73
|
+
| `keycloak-api/account/components` | account operations grouped by tag and by path |
|
|
74
|
+
| `keycloak-api/account/schemas` | Zod schemas for account operations |
|
|
75
|
+
| `keycloak-api/account/types` | TypeScript types for account operations |
|
|
76
|
+
|
|
77
|
+
## License
|
|
78
|
+
|
|
79
|
+
ISC
|
|
@@ -1,392 +1,273 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
return value !== null && value !== undefined;
|
|
5
|
-
}
|
|
6
|
-
function compactObject(obj) {
|
|
7
|
-
return Object.fromEntries(Object.entries(obj).filter(([, value])=>notEmpty(value)));
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
async function client({ url, method, body, headers, pathParams, queryParams, signal, baseUrl = "", token = null, fetchImpl = fetch }) {
|
|
11
|
-
try {
|
|
12
|
-
const requestHeaders = compactObject({
|
|
13
|
-
"Content-Type": "application/json",
|
|
14
|
-
Authorization: token ? `Bearer ${token}` : undefined,
|
|
15
|
-
Accept: "application/json",
|
|
16
|
-
...headers
|
|
17
|
-
});
|
|
18
|
-
/**
|
|
19
|
-
* As the fetch API is being used, when multipart/form-data is specified
|
|
20
|
-
* the Content-Type header must be deleted so that the browser can set
|
|
21
|
-
* the correct boundary.
|
|
22
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/FormData/Using_FormData_Objects#sending_files_using_a_formdata_object
|
|
23
|
-
*/ if (requestHeaders["Content-Type"]?.toLowerCase().includes("multipart/form-data")) {
|
|
24
|
-
delete requestHeaders["Content-Type"];
|
|
25
|
-
}
|
|
26
|
-
const payload = body instanceof FormData ? body : requestHeaders["Content-Type"] === "application/json" ? JSON.stringify(body) : body;
|
|
27
|
-
const fullUrl = `${baseUrl}${resolveUrl(url, queryParams, pathParams)}`;
|
|
28
|
-
const response = await fetchImpl(fullUrl, {
|
|
29
|
-
signal,
|
|
30
|
-
method: method.toUpperCase(),
|
|
31
|
-
body: payload,
|
|
32
|
-
headers: requestHeaders
|
|
33
|
-
});
|
|
34
|
-
if (!response.ok) {
|
|
35
|
-
let error;
|
|
36
|
-
try {
|
|
37
|
-
error = await response.json();
|
|
38
|
-
} catch (e) {
|
|
39
|
-
error = {
|
|
40
|
-
status: "unknown",
|
|
41
|
-
payload: e instanceof Error ? `Unexpected error (${e.message})` : "Unexpected error"
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
throw error;
|
|
45
|
-
}
|
|
46
|
-
if (response.headers?.get("content-type")?.includes("json")) {
|
|
47
|
-
return await response.json();
|
|
48
|
-
} else {
|
|
49
|
-
// if it is not a json response, assume it is a blob and cast it to TData
|
|
50
|
-
return await response.text();
|
|
51
|
-
}
|
|
52
|
-
} catch (e) {
|
|
53
|
-
const errorObject = {
|
|
54
|
-
name: "unknown",
|
|
55
|
-
message: e instanceof Error ? `Network error (${e.message})` : "Network error",
|
|
56
|
-
stack: e
|
|
57
|
-
};
|
|
58
|
-
throw errorObject;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
const resolveUrl = (url, queryParams = {}, pathParams = {})=>{
|
|
62
|
-
let query = new URLSearchParams(queryParams).toString();
|
|
63
|
-
if (query) query = `?${query}`;
|
|
64
|
-
return url.replace(/\{\w*\}/g, (key)=>pathParams[key.slice(1, -1)] ?? "") + query;
|
|
65
|
-
};
|
|
3
|
+
var fetcher = require('../fetcher-aq8636lm.cjs');
|
|
66
4
|
|
|
67
5
|
/**
|
|
68
|
-
* @summary Get account
|
|
69
6
|
* @description Get user details for currently logged in user
|
|
70
|
-
* @
|
|
71
|
-
|
|
72
|
-
|
|
7
|
+
* @summary Get account
|
|
8
|
+
* {@link /account/}
|
|
9
|
+
*/ async function getAccount({ queryParams, config = {} }) {
|
|
10
|
+
const { client: request = fetcher.client, ...requestConfig } = config;
|
|
73
11
|
const data = await request({
|
|
74
12
|
method: "GET",
|
|
75
13
|
url: `/account/`,
|
|
76
14
|
queryParams,
|
|
77
|
-
...requestConfig
|
|
78
|
-
headers: {
|
|
79
|
-
...requestConfig.headers
|
|
80
|
-
}
|
|
15
|
+
...requestConfig
|
|
81
16
|
});
|
|
82
17
|
return data;
|
|
83
18
|
}
|
|
84
19
|
/**
|
|
85
20
|
* @summary Update account
|
|
86
|
-
* @link /account/
|
|
87
|
-
*/ async function updateAccount({ body, config
|
|
88
|
-
const { client: request = client, ...requestConfig } = config
|
|
21
|
+
* {@link /account/}
|
|
22
|
+
*/ async function updateAccount({ body, config = {} }) {
|
|
23
|
+
const { client: request = fetcher.client, ...requestConfig } = config;
|
|
89
24
|
const data = await request({
|
|
90
25
|
method: "POST",
|
|
91
26
|
url: `/account/`,
|
|
92
|
-
body
|
|
93
|
-
...requestConfig
|
|
94
|
-
headers: {
|
|
95
|
-
...requestConfig.headers
|
|
96
|
-
}
|
|
27
|
+
body,
|
|
28
|
+
...requestConfig
|
|
97
29
|
});
|
|
98
30
|
return data;
|
|
99
31
|
}
|
|
100
32
|
/**
|
|
101
33
|
* @summary Get applications
|
|
102
|
-
* @link /account/applications
|
|
103
|
-
*/ async function getApplications({ queryParams, config
|
|
104
|
-
const { client: request = client, ...requestConfig } = config
|
|
34
|
+
* {@link /account/applications}
|
|
35
|
+
*/ async function getApplications({ queryParams, config = {} }) {
|
|
36
|
+
const { client: request = fetcher.client, ...requestConfig } = config;
|
|
105
37
|
const data = await request({
|
|
106
38
|
method: "GET",
|
|
107
39
|
url: `/account/applications`,
|
|
108
40
|
queryParams,
|
|
109
|
-
...requestConfig
|
|
110
|
-
headers: {
|
|
111
|
-
...requestConfig.headers
|
|
112
|
-
}
|
|
41
|
+
...requestConfig
|
|
113
42
|
});
|
|
114
43
|
return data;
|
|
115
44
|
}
|
|
116
45
|
/**
|
|
117
46
|
* @summary Get consent
|
|
118
|
-
* @link /account/applications
|
|
119
|
-
*/ async function getConsent({ pathParams, config
|
|
120
|
-
const { client: request = client, ...requestConfig } = config
|
|
121
|
-
if (!
|
|
47
|
+
* {@link /account/applications/:clientId/consent}
|
|
48
|
+
*/ async function getConsent({ pathParams: { clientId }, config = {} }) {
|
|
49
|
+
const { client: request = fetcher.client, ...requestConfig } = config;
|
|
50
|
+
if (!clientId) {
|
|
122
51
|
throw new Error(`Missing required path parameter: clientId`);
|
|
123
52
|
}
|
|
124
53
|
const data = await request({
|
|
125
54
|
method: "GET",
|
|
126
|
-
url: `/account/applications/${
|
|
127
|
-
...requestConfig
|
|
128
|
-
headers: {
|
|
129
|
-
...requestConfig.headers
|
|
130
|
-
}
|
|
55
|
+
url: `/account/applications/${clientId}/consent`,
|
|
56
|
+
...requestConfig
|
|
131
57
|
});
|
|
132
58
|
return data;
|
|
133
59
|
}
|
|
134
60
|
/**
|
|
135
61
|
* @summary Create consent
|
|
136
|
-
* @link /account/applications
|
|
137
|
-
*/ async function createConsent({ pathParams, config
|
|
138
|
-
const { client: request = client, ...requestConfig } = config
|
|
139
|
-
if (!
|
|
62
|
+
* {@link /account/applications/:clientId/consent}
|
|
63
|
+
*/ async function createConsent({ pathParams: { clientId }, config = {} }) {
|
|
64
|
+
const { client: request = fetcher.client, ...requestConfig } = config;
|
|
65
|
+
if (!clientId) {
|
|
140
66
|
throw new Error(`Missing required path parameter: clientId`);
|
|
141
67
|
}
|
|
142
68
|
const data = await request({
|
|
143
69
|
method: "POST",
|
|
144
|
-
url: `/account/applications/${
|
|
145
|
-
...requestConfig
|
|
146
|
-
headers: {
|
|
147
|
-
...requestConfig.headers
|
|
148
|
-
}
|
|
70
|
+
url: `/account/applications/${clientId}/consent`,
|
|
71
|
+
...requestConfig
|
|
149
72
|
});
|
|
150
73
|
return data;
|
|
151
74
|
}
|
|
152
75
|
/**
|
|
153
76
|
* @summary Update consent
|
|
154
|
-
* @link /account/applications
|
|
155
|
-
*/ async function updateConsent({ pathParams, config
|
|
156
|
-
const { client: request = client, ...requestConfig } = config
|
|
157
|
-
if (!
|
|
77
|
+
* {@link /account/applications/:clientId/consent}
|
|
78
|
+
*/ async function updateConsent({ pathParams: { clientId }, config = {} }) {
|
|
79
|
+
const { client: request = fetcher.client, ...requestConfig } = config;
|
|
80
|
+
if (!clientId) {
|
|
158
81
|
throw new Error(`Missing required path parameter: clientId`);
|
|
159
82
|
}
|
|
160
83
|
const data = await request({
|
|
161
84
|
method: "PUT",
|
|
162
|
-
url: `/account/applications/${
|
|
163
|
-
...requestConfig
|
|
164
|
-
headers: {
|
|
165
|
-
...requestConfig.headers
|
|
166
|
-
}
|
|
85
|
+
url: `/account/applications/${clientId}/consent`,
|
|
86
|
+
...requestConfig
|
|
167
87
|
});
|
|
168
88
|
return data;
|
|
169
89
|
}
|
|
170
90
|
/**
|
|
171
91
|
* @summary Delete consent
|
|
172
|
-
* @link /account/applications
|
|
173
|
-
*/ async function deleteConsent({ pathParams, config
|
|
174
|
-
const { client: request = client, ...requestConfig } = config
|
|
175
|
-
if (!
|
|
92
|
+
* {@link /account/applications/:clientId/consent}
|
|
93
|
+
*/ async function deleteConsent({ pathParams: { clientId }, config = {} }) {
|
|
94
|
+
const { client: request = fetcher.client, ...requestConfig } = config;
|
|
95
|
+
if (!clientId) {
|
|
176
96
|
throw new Error(`Missing required path parameter: clientId`);
|
|
177
97
|
}
|
|
178
98
|
const data = await request({
|
|
179
99
|
method: "DELETE",
|
|
180
|
-
url: `/account/applications/${
|
|
181
|
-
...requestConfig
|
|
182
|
-
headers: {
|
|
183
|
-
...requestConfig.headers
|
|
184
|
-
}
|
|
100
|
+
url: `/account/applications/${clientId}/consent`,
|
|
101
|
+
...requestConfig
|
|
185
102
|
});
|
|
186
103
|
return data;
|
|
187
104
|
}
|
|
188
105
|
/**
|
|
189
|
-
* @summary Get credentials
|
|
190
106
|
* @description Get credentials for currently logged in user
|
|
191
|
-
* @
|
|
192
|
-
|
|
193
|
-
|
|
107
|
+
* @summary Get credentials
|
|
108
|
+
* {@link /account/credentials}
|
|
109
|
+
*/ async function getCredentials({ queryParams, config = {} }) {
|
|
110
|
+
const { client: request = fetcher.client, ...requestConfig } = config;
|
|
194
111
|
const data = await request({
|
|
195
112
|
method: "GET",
|
|
196
113
|
url: `/account/credentials`,
|
|
197
114
|
queryParams,
|
|
198
|
-
...requestConfig
|
|
199
|
-
headers: {
|
|
200
|
-
...requestConfig.headers
|
|
201
|
-
}
|
|
115
|
+
...requestConfig
|
|
202
116
|
});
|
|
203
117
|
return data;
|
|
204
118
|
}
|
|
205
119
|
/**
|
|
206
120
|
* @summary Delete the credential
|
|
207
|
-
* @link /account/credentials
|
|
208
|
-
*/ async function deleteCredential({ pathParams, config
|
|
209
|
-
const { client: request = client, ...requestConfig } = config
|
|
210
|
-
if (!
|
|
121
|
+
* {@link /account/credentials/:credentialId}
|
|
122
|
+
*/ async function deleteCredential({ pathParams: { credentialId }, config = {} }) {
|
|
123
|
+
const { client: request = fetcher.client, ...requestConfig } = config;
|
|
124
|
+
if (!credentialId) {
|
|
211
125
|
throw new Error(`Missing required path parameter: credentialId`);
|
|
212
126
|
}
|
|
213
127
|
const data = await request({
|
|
214
128
|
method: "DELETE",
|
|
215
|
-
url: `/account/credentials/${
|
|
216
|
-
...requestConfig
|
|
217
|
-
headers: {
|
|
218
|
-
...requestConfig.headers
|
|
219
|
-
}
|
|
129
|
+
url: `/account/credentials/${credentialId}`,
|
|
130
|
+
...requestConfig
|
|
220
131
|
});
|
|
221
132
|
return data;
|
|
222
133
|
}
|
|
223
134
|
/**
|
|
224
135
|
* @summary Update a user label of specified credential of current user
|
|
225
|
-
* @link /account/credentials
|
|
226
|
-
*/ async function updateCredentialLabel({ pathParams, body, config
|
|
227
|
-
const { client: request = client, ...requestConfig } = config
|
|
228
|
-
if (!
|
|
136
|
+
* {@link /account/credentials/:credentialId/label}
|
|
137
|
+
*/ async function updateCredentialLabel({ pathParams: { credentialId }, body, config = {} }) {
|
|
138
|
+
const { client: request = fetcher.client, ...requestConfig } = config;
|
|
139
|
+
if (!credentialId) {
|
|
229
140
|
throw new Error(`Missing required path parameter: credentialId`);
|
|
230
141
|
}
|
|
231
142
|
const data = await request({
|
|
232
143
|
method: "PUT",
|
|
233
|
-
url: `/account/credentials/${
|
|
234
|
-
body
|
|
235
|
-
...requestConfig
|
|
236
|
-
headers: {
|
|
237
|
-
...requestConfig.headers
|
|
238
|
-
}
|
|
144
|
+
url: `/account/credentials/${credentialId}/label`,
|
|
145
|
+
body,
|
|
146
|
+
...requestConfig
|
|
239
147
|
});
|
|
240
148
|
return data;
|
|
241
149
|
}
|
|
242
150
|
/**
|
|
243
|
-
* @summary Get sessions
|
|
244
151
|
* @description Get sessions for currently logged in user
|
|
245
|
-
* @
|
|
246
|
-
|
|
247
|
-
|
|
152
|
+
* @summary Get sessions
|
|
153
|
+
* {@link /account/sessions}
|
|
154
|
+
*/ async function getSessions({ config = {} }) {
|
|
155
|
+
const { client: request = fetcher.client, ...requestConfig } = config;
|
|
248
156
|
const data = await request({
|
|
249
157
|
method: "GET",
|
|
250
158
|
url: `/account/sessions`,
|
|
251
|
-
...requestConfig
|
|
252
|
-
headers: {
|
|
253
|
-
...requestConfig.headers
|
|
254
|
-
}
|
|
159
|
+
...requestConfig
|
|
255
160
|
});
|
|
256
161
|
return data;
|
|
257
162
|
}
|
|
258
163
|
/**
|
|
259
164
|
* @summary Delete current session
|
|
260
|
-
* @link /account/sessions
|
|
261
|
-
*/ async function deleteCurrentSession({ config
|
|
262
|
-
const { client: request = client, ...requestConfig } = config
|
|
165
|
+
* {@link /account/sessions}
|
|
166
|
+
*/ async function deleteCurrentSession({ config = {} }) {
|
|
167
|
+
const { client: request = fetcher.client, ...requestConfig } = config;
|
|
263
168
|
const data = await request({
|
|
264
169
|
method: "DELETE",
|
|
265
170
|
url: `/account/sessions`,
|
|
266
|
-
...requestConfig
|
|
267
|
-
headers: {
|
|
268
|
-
...requestConfig.headers
|
|
269
|
-
}
|
|
171
|
+
...requestConfig
|
|
270
172
|
});
|
|
271
173
|
return data;
|
|
272
174
|
}
|
|
273
175
|
/**
|
|
274
|
-
* @summary Get devices
|
|
275
176
|
* @description Get devices for currently logged in user
|
|
276
|
-
* @
|
|
277
|
-
|
|
278
|
-
|
|
177
|
+
* @summary Get devices
|
|
178
|
+
* {@link /account/sessions/devices}
|
|
179
|
+
*/ async function getDevices({ config = {} }) {
|
|
180
|
+
const { client: request = fetcher.client, ...requestConfig } = config;
|
|
279
181
|
const data = await request({
|
|
280
182
|
method: "GET",
|
|
281
183
|
url: `/account/sessions/devices`,
|
|
282
|
-
...requestConfig
|
|
283
|
-
headers: {
|
|
284
|
-
...requestConfig.headers
|
|
285
|
-
}
|
|
184
|
+
...requestConfig
|
|
286
185
|
});
|
|
287
186
|
return data;
|
|
288
187
|
}
|
|
289
188
|
/**
|
|
290
189
|
* @summary Delete the session
|
|
291
|
-
* @link /account/sessions
|
|
292
|
-
*/ async function deleteSession({ pathParams, config
|
|
293
|
-
const { client: request = client, ...requestConfig } = config
|
|
294
|
-
if (!
|
|
190
|
+
* {@link /account/sessions/:sessionId}
|
|
191
|
+
*/ async function deleteSession({ pathParams: { sessionId }, config = {} }) {
|
|
192
|
+
const { client: request = fetcher.client, ...requestConfig } = config;
|
|
193
|
+
if (!sessionId) {
|
|
295
194
|
throw new Error(`Missing required path parameter: sessionId`);
|
|
296
195
|
}
|
|
297
196
|
const data = await request({
|
|
298
197
|
method: "DELETE",
|
|
299
|
-
url: `/account/sessions/${
|
|
300
|
-
...requestConfig
|
|
301
|
-
headers: {
|
|
302
|
-
...requestConfig.headers
|
|
303
|
-
}
|
|
198
|
+
url: `/account/sessions/${sessionId}`,
|
|
199
|
+
...requestConfig
|
|
304
200
|
});
|
|
305
201
|
return data;
|
|
306
202
|
}
|
|
307
203
|
/**
|
|
308
|
-
* @summary Get linked accounts
|
|
309
204
|
* @description Get linked accounts for currently logged in user
|
|
310
|
-
* @
|
|
311
|
-
|
|
312
|
-
|
|
205
|
+
* @summary Get linked accounts
|
|
206
|
+
* {@link /account/linked-accounts}
|
|
207
|
+
*/ async function getLinkedAccounts({ config = {} }) {
|
|
208
|
+
const { client: request = fetcher.client, ...requestConfig } = config;
|
|
313
209
|
const data = await request({
|
|
314
210
|
method: "GET",
|
|
315
211
|
url: `/account/linked-accounts`,
|
|
316
|
-
...requestConfig
|
|
317
|
-
headers: {
|
|
318
|
-
...requestConfig.headers
|
|
319
|
-
}
|
|
212
|
+
...requestConfig
|
|
320
213
|
});
|
|
321
214
|
return data;
|
|
322
215
|
}
|
|
323
216
|
/**
|
|
324
|
-
* @summary Build account linking URI
|
|
325
217
|
* @description Build account linking URI
|
|
326
|
-
* @
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
218
|
+
* @summary Build account linking URI
|
|
219
|
+
* {@link /account/linked-accounts/:providerId}
|
|
220
|
+
*/ async function buildLinkingUri({ pathParams: { providerId }, queryParams, config = {} }) {
|
|
221
|
+
const { client: request = fetcher.client, ...requestConfig } = config;
|
|
222
|
+
if (!providerId) {
|
|
330
223
|
throw new Error(`Missing required path parameter: providerId`);
|
|
331
224
|
}
|
|
332
225
|
const data = await request({
|
|
333
226
|
method: "GET",
|
|
334
|
-
url: `/account/linked-accounts/${
|
|
227
|
+
url: `/account/linked-accounts/${providerId}`,
|
|
335
228
|
queryParams,
|
|
336
|
-
...requestConfig
|
|
337
|
-
headers: {
|
|
338
|
-
...requestConfig.headers
|
|
339
|
-
}
|
|
229
|
+
...requestConfig
|
|
340
230
|
});
|
|
341
231
|
return data;
|
|
342
232
|
}
|
|
343
233
|
/**
|
|
344
234
|
* @summary Delete the linked provider
|
|
345
|
-
* @link /account/linked-accounts
|
|
346
|
-
*/ async function deleteLinkedProvider({ pathParams, config
|
|
347
|
-
const { client: request = client, ...requestConfig } = config
|
|
348
|
-
if (!
|
|
235
|
+
* {@link /account/linked-accounts/:providerId}
|
|
236
|
+
*/ async function deleteLinkedProvider({ pathParams: { providerId }, config = {} }) {
|
|
237
|
+
const { client: request = fetcher.client, ...requestConfig } = config;
|
|
238
|
+
if (!providerId) {
|
|
349
239
|
throw new Error(`Missing required path parameter: providerId`);
|
|
350
240
|
}
|
|
351
241
|
const data = await request({
|
|
352
242
|
method: "DELETE",
|
|
353
|
-
url: `/account/linked-accounts/${
|
|
354
|
-
...requestConfig
|
|
355
|
-
headers: {
|
|
356
|
-
...requestConfig.headers
|
|
357
|
-
}
|
|
243
|
+
url: `/account/linked-accounts/${providerId}`,
|
|
244
|
+
...requestConfig
|
|
358
245
|
});
|
|
359
246
|
return data;
|
|
360
247
|
}
|
|
361
248
|
/**
|
|
362
249
|
* @summary Get groups that this user is a member of
|
|
363
|
-
* @link /account/groups
|
|
364
|
-
*/ async function getGroups({ queryParams, config
|
|
365
|
-
const { client: request = client, ...requestConfig } = config
|
|
250
|
+
* {@link /account/groups}
|
|
251
|
+
*/ async function getGroups({ queryParams, config = {} }) {
|
|
252
|
+
const { client: request = fetcher.client, ...requestConfig } = config;
|
|
366
253
|
const data = await request({
|
|
367
254
|
method: "GET",
|
|
368
255
|
url: `/account/groups`,
|
|
369
256
|
queryParams,
|
|
370
|
-
...requestConfig
|
|
371
|
-
headers: {
|
|
372
|
-
...requestConfig.headers
|
|
373
|
-
}
|
|
257
|
+
...requestConfig
|
|
374
258
|
});
|
|
375
259
|
return data;
|
|
376
260
|
}
|
|
377
261
|
/**
|
|
378
|
-
* @summary Get organizations
|
|
379
262
|
* @description Get organizations for currently logged in user
|
|
380
|
-
* @
|
|
381
|
-
|
|
382
|
-
|
|
263
|
+
* @summary Get organizations
|
|
264
|
+
* {@link /account/organizations}
|
|
265
|
+
*/ async function getOrganizations({ config = {} }) {
|
|
266
|
+
const { client: request = fetcher.client, ...requestConfig } = config;
|
|
383
267
|
const data = await request({
|
|
384
268
|
method: "GET",
|
|
385
269
|
url: `/account/organizations`,
|
|
386
|
-
...requestConfig
|
|
387
|
-
headers: {
|
|
388
|
-
...requestConfig.headers
|
|
389
|
-
}
|
|
270
|
+
...requestConfig
|
|
390
271
|
});
|
|
391
272
|
return data;
|
|
392
273
|
}
|
|
@@ -412,7 +293,7 @@ const operationsByPath = {
|
|
|
412
293
|
"GET /account/organizations": getOrganizations
|
|
413
294
|
};
|
|
414
295
|
const operationsByTag = {
|
|
415
|
-
|
|
296
|
+
account: {
|
|
416
297
|
getAccount,
|
|
417
298
|
updateAccount,
|
|
418
299
|
getApplications,
|
|
@@ -435,8 +316,8 @@ const operationsByTag = {
|
|
|
435
316
|
}
|
|
436
317
|
};
|
|
437
318
|
const tagDictionary = {
|
|
438
|
-
|
|
439
|
-
|
|
319
|
+
account: {
|
|
320
|
+
GET: [
|
|
440
321
|
"getAccount",
|
|
441
322
|
"getApplications",
|
|
442
323
|
"getConsent",
|
|
@@ -448,15 +329,15 @@ const tagDictionary = {
|
|
|
448
329
|
"getGroups",
|
|
449
330
|
"getOrganizations"
|
|
450
331
|
],
|
|
451
|
-
|
|
332
|
+
POST: [
|
|
452
333
|
"updateAccount",
|
|
453
334
|
"createConsent"
|
|
454
335
|
],
|
|
455
|
-
|
|
336
|
+
PUT: [
|
|
456
337
|
"updateConsent",
|
|
457
338
|
"updateCredentialLabel"
|
|
458
339
|
],
|
|
459
|
-
|
|
340
|
+
DELETE: [
|
|
460
341
|
"deleteConsent",
|
|
461
342
|
"deleteCredential",
|
|
462
343
|
"deleteCurrentSession",
|