@dfns/sdk 0.4.1 → 0.4.2
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/baseAuthApi.d.ts +4 -2
- package/codegen/datamodel/Auth/types.d.ts +316 -1
- package/codegen/datamodel/Auth/types.js +33 -11
- package/codegen/datamodel/Foundations/types.d.ts +36 -0
- package/codegen/datamodel/Foundations/types.js +12 -4
- package/codegen/datamodel/Wallets/types.d.ts +6 -0
- package/codegen/datamodel/Wallets/types.js +12 -0
- package/dfnsApiClient.d.ts +3 -2
- package/dfnsApiClient.js +2 -2
- package/dfnsDelegatedApiClient.d.ts +2 -4
- package/dfnsDelegatedApiClient.js +2 -2
- package/generated/auth/client.d.ts +79 -0
- package/generated/auth/client.js +677 -0
- package/generated/auth/delegatedClient.d.ts +99 -0
- package/generated/auth/delegatedClient.js +1093 -0
- package/generated/auth/index.d.ts +3 -0
- package/generated/auth/index.js +19 -0
- package/generated/auth/types.d.ts +1983 -0
- package/generated/auth/types.js +2 -0
- package/generated/networks/types.d.ts +33 -7
- package/generated/permissions/types.d.ts +16 -26
- package/generated/wallets/types.d.ts +13 -1
- package/package.json +1 -1
- package/signer.d.ts +1 -2
- package/types/auth.d.ts +1 -0
- package/types/auth.js +17 -0
- package/utils/fetch.js +9 -1
|
@@ -0,0 +1,677 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthClient = void 0;
|
|
4
|
+
const fetch_1 = require("../../utils/fetch");
|
|
5
|
+
const url_1 = require("../../utils/url");
|
|
6
|
+
class AuthClient {
|
|
7
|
+
constructor(apiOptions) {
|
|
8
|
+
this.apiOptions = apiOptions;
|
|
9
|
+
}
|
|
10
|
+
async activateApplication(request) {
|
|
11
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/apps/:appId/activate', {
|
|
12
|
+
path: request ?? {},
|
|
13
|
+
query: {},
|
|
14
|
+
});
|
|
15
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
16
|
+
method: 'PUT',
|
|
17
|
+
body: {},
|
|
18
|
+
apiOptions: this.apiOptions,
|
|
19
|
+
});
|
|
20
|
+
return response.json();
|
|
21
|
+
}
|
|
22
|
+
async activateCredential(request) {
|
|
23
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/credentials/activate', {
|
|
24
|
+
path: request ?? {},
|
|
25
|
+
query: {},
|
|
26
|
+
});
|
|
27
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
28
|
+
method: 'PUT',
|
|
29
|
+
body: request.body,
|
|
30
|
+
apiOptions: this.apiOptions,
|
|
31
|
+
});
|
|
32
|
+
return response.json();
|
|
33
|
+
}
|
|
34
|
+
async activatePersonalAccessToken(request) {
|
|
35
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/pats/:tokenId/activate', {
|
|
36
|
+
path: request ?? {},
|
|
37
|
+
query: {},
|
|
38
|
+
});
|
|
39
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
40
|
+
method: 'PUT',
|
|
41
|
+
body: {},
|
|
42
|
+
apiOptions: this.apiOptions,
|
|
43
|
+
});
|
|
44
|
+
return response.json();
|
|
45
|
+
}
|
|
46
|
+
async activateServiceAccount(request) {
|
|
47
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/service-accounts/:serviceAccountId/activate', {
|
|
48
|
+
path: request ?? {},
|
|
49
|
+
query: {},
|
|
50
|
+
});
|
|
51
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
52
|
+
method: 'PUT',
|
|
53
|
+
body: {},
|
|
54
|
+
apiOptions: this.apiOptions,
|
|
55
|
+
});
|
|
56
|
+
return response.json();
|
|
57
|
+
}
|
|
58
|
+
async activateUser(request) {
|
|
59
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/users/:userId/activate', {
|
|
60
|
+
path: request ?? {},
|
|
61
|
+
query: {},
|
|
62
|
+
});
|
|
63
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
64
|
+
method: 'PUT',
|
|
65
|
+
body: {},
|
|
66
|
+
apiOptions: this.apiOptions,
|
|
67
|
+
});
|
|
68
|
+
return response.json();
|
|
69
|
+
}
|
|
70
|
+
async archiveApplication(request) {
|
|
71
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/apps/:appId', {
|
|
72
|
+
path: request ?? {},
|
|
73
|
+
query: {},
|
|
74
|
+
});
|
|
75
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
76
|
+
method: 'DELETE',
|
|
77
|
+
body: {},
|
|
78
|
+
apiOptions: this.apiOptions,
|
|
79
|
+
});
|
|
80
|
+
return response.json();
|
|
81
|
+
}
|
|
82
|
+
async archivePersonalAccessToken(request) {
|
|
83
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/pats/:tokenId', {
|
|
84
|
+
path: request ?? {},
|
|
85
|
+
query: {},
|
|
86
|
+
});
|
|
87
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
88
|
+
method: 'DELETE',
|
|
89
|
+
body: {},
|
|
90
|
+
apiOptions: this.apiOptions,
|
|
91
|
+
});
|
|
92
|
+
return response.json();
|
|
93
|
+
}
|
|
94
|
+
async archiveServiceAccount(request) {
|
|
95
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/service-accounts/:serviceAccountId', {
|
|
96
|
+
path: request ?? {},
|
|
97
|
+
query: {},
|
|
98
|
+
});
|
|
99
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
100
|
+
method: 'DELETE',
|
|
101
|
+
body: {},
|
|
102
|
+
apiOptions: this.apiOptions,
|
|
103
|
+
});
|
|
104
|
+
return response.json();
|
|
105
|
+
}
|
|
106
|
+
async archiveUser(request) {
|
|
107
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/users/:userId', {
|
|
108
|
+
path: request ?? {},
|
|
109
|
+
query: {},
|
|
110
|
+
});
|
|
111
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
112
|
+
method: 'DELETE',
|
|
113
|
+
body: {},
|
|
114
|
+
apiOptions: this.apiOptions,
|
|
115
|
+
});
|
|
116
|
+
return response.json();
|
|
117
|
+
}
|
|
118
|
+
async createApplication(request) {
|
|
119
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/apps', {
|
|
120
|
+
path: request ?? {},
|
|
121
|
+
query: {},
|
|
122
|
+
});
|
|
123
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
124
|
+
method: 'POST',
|
|
125
|
+
body: request.body,
|
|
126
|
+
apiOptions: this.apiOptions,
|
|
127
|
+
});
|
|
128
|
+
return response.json();
|
|
129
|
+
}
|
|
130
|
+
async createCredential(request) {
|
|
131
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/credentials', {
|
|
132
|
+
path: request ?? {},
|
|
133
|
+
query: {},
|
|
134
|
+
});
|
|
135
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
136
|
+
method: 'POST',
|
|
137
|
+
body: request.body,
|
|
138
|
+
apiOptions: this.apiOptions,
|
|
139
|
+
});
|
|
140
|
+
return response.json();
|
|
141
|
+
}
|
|
142
|
+
/** @deprecated, use createCredential instead */
|
|
143
|
+
async createUserCredential(request) {
|
|
144
|
+
return this.createCredential(request);
|
|
145
|
+
}
|
|
146
|
+
async createCredentialChallenge(request) {
|
|
147
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/credentials/init', {
|
|
148
|
+
path: request ?? {},
|
|
149
|
+
query: {},
|
|
150
|
+
});
|
|
151
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
152
|
+
method: 'POST',
|
|
153
|
+
body: request.body,
|
|
154
|
+
apiOptions: this.apiOptions,
|
|
155
|
+
});
|
|
156
|
+
return response.json();
|
|
157
|
+
}
|
|
158
|
+
/** @deprecated, use createCredentialChallenge instead */
|
|
159
|
+
async createUserCredentialChallenge(request) {
|
|
160
|
+
return this.createCredentialChallenge(request);
|
|
161
|
+
}
|
|
162
|
+
async createCredentialChallengeWithCode(request) {
|
|
163
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/credentials/code/init', {
|
|
164
|
+
path: request ?? {},
|
|
165
|
+
query: {},
|
|
166
|
+
});
|
|
167
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
168
|
+
method: 'POST',
|
|
169
|
+
body: request.body,
|
|
170
|
+
apiOptions: this.apiOptions,
|
|
171
|
+
});
|
|
172
|
+
return response.json();
|
|
173
|
+
}
|
|
174
|
+
async createCredentialCode(request) {
|
|
175
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/credentials/code', {
|
|
176
|
+
path: request ?? {},
|
|
177
|
+
query: {},
|
|
178
|
+
});
|
|
179
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
180
|
+
method: 'POST',
|
|
181
|
+
body: request.body,
|
|
182
|
+
apiOptions: this.apiOptions,
|
|
183
|
+
});
|
|
184
|
+
return response.json();
|
|
185
|
+
}
|
|
186
|
+
async createCredentialWithCode(request) {
|
|
187
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/credentials/code/verify', {
|
|
188
|
+
path: request ?? {},
|
|
189
|
+
query: {},
|
|
190
|
+
});
|
|
191
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
192
|
+
method: 'POST',
|
|
193
|
+
body: request.body,
|
|
194
|
+
apiOptions: this.apiOptions,
|
|
195
|
+
});
|
|
196
|
+
return response.json();
|
|
197
|
+
}
|
|
198
|
+
async createDelegatedRecoveryChallenge(request) {
|
|
199
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/recover/user/delegated', {
|
|
200
|
+
path: request ?? {},
|
|
201
|
+
query: {},
|
|
202
|
+
});
|
|
203
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
204
|
+
method: 'POST',
|
|
205
|
+
body: request.body,
|
|
206
|
+
apiOptions: this.apiOptions,
|
|
207
|
+
});
|
|
208
|
+
return response.json();
|
|
209
|
+
}
|
|
210
|
+
/** @deprecated, use createDelegatedRecoveryChallenge instead */
|
|
211
|
+
async createDelegatedUserRecovery(request) {
|
|
212
|
+
return this.createDelegatedRecoveryChallenge(request);
|
|
213
|
+
}
|
|
214
|
+
async createDelegatedRegistrationChallenge(request) {
|
|
215
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/registration/delegated', {
|
|
216
|
+
path: request ?? {},
|
|
217
|
+
query: {},
|
|
218
|
+
});
|
|
219
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
220
|
+
method: 'POST',
|
|
221
|
+
body: request.body,
|
|
222
|
+
apiOptions: this.apiOptions,
|
|
223
|
+
});
|
|
224
|
+
return response.json();
|
|
225
|
+
}
|
|
226
|
+
/** @deprecated, use createDelegatedRegistrationChallenge instead */
|
|
227
|
+
async createDelegatedUserRegistration(request) {
|
|
228
|
+
return this.createDelegatedRegistrationChallenge(request);
|
|
229
|
+
}
|
|
230
|
+
async createLoginChallenge(request) {
|
|
231
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/login/init', {
|
|
232
|
+
path: request ?? {},
|
|
233
|
+
query: {},
|
|
234
|
+
});
|
|
235
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
236
|
+
method: 'POST',
|
|
237
|
+
body: request.body,
|
|
238
|
+
apiOptions: this.apiOptions,
|
|
239
|
+
});
|
|
240
|
+
return response.json();
|
|
241
|
+
}
|
|
242
|
+
async createPersonalAccessToken(request) {
|
|
243
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/pats', {
|
|
244
|
+
path: request ?? {},
|
|
245
|
+
query: {},
|
|
246
|
+
});
|
|
247
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
248
|
+
method: 'POST',
|
|
249
|
+
body: request.body,
|
|
250
|
+
apiOptions: this.apiOptions,
|
|
251
|
+
});
|
|
252
|
+
return response.json();
|
|
253
|
+
}
|
|
254
|
+
async createRecoveryChallenge(request) {
|
|
255
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/recover/user/init', {
|
|
256
|
+
path: request ?? {},
|
|
257
|
+
query: {},
|
|
258
|
+
});
|
|
259
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
260
|
+
method: 'POST',
|
|
261
|
+
body: request.body,
|
|
262
|
+
apiOptions: this.apiOptions,
|
|
263
|
+
});
|
|
264
|
+
return response.json();
|
|
265
|
+
}
|
|
266
|
+
async createRegistrationChallenge(request) {
|
|
267
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/registration/init', {
|
|
268
|
+
path: request ?? {},
|
|
269
|
+
query: {},
|
|
270
|
+
});
|
|
271
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
272
|
+
method: 'POST',
|
|
273
|
+
body: request.body,
|
|
274
|
+
apiOptions: this.apiOptions,
|
|
275
|
+
});
|
|
276
|
+
return response.json();
|
|
277
|
+
}
|
|
278
|
+
async createServiceAccount(request) {
|
|
279
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/service-accounts', {
|
|
280
|
+
path: request ?? {},
|
|
281
|
+
query: {},
|
|
282
|
+
});
|
|
283
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
284
|
+
method: 'POST',
|
|
285
|
+
body: request.body,
|
|
286
|
+
apiOptions: this.apiOptions,
|
|
287
|
+
});
|
|
288
|
+
return response.json();
|
|
289
|
+
}
|
|
290
|
+
async createUser(request) {
|
|
291
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/users', {
|
|
292
|
+
path: request ?? {},
|
|
293
|
+
query: {},
|
|
294
|
+
});
|
|
295
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
296
|
+
method: 'POST',
|
|
297
|
+
body: request.body,
|
|
298
|
+
apiOptions: this.apiOptions,
|
|
299
|
+
});
|
|
300
|
+
return response.json();
|
|
301
|
+
}
|
|
302
|
+
async createUserActionChallenge(request) {
|
|
303
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/action/init', {
|
|
304
|
+
path: request ?? {},
|
|
305
|
+
query: {},
|
|
306
|
+
});
|
|
307
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
308
|
+
method: 'POST',
|
|
309
|
+
body: request.body,
|
|
310
|
+
apiOptions: this.apiOptions,
|
|
311
|
+
});
|
|
312
|
+
return response.json();
|
|
313
|
+
}
|
|
314
|
+
/** @deprecated, use createUserActionChallenge instead */
|
|
315
|
+
async createUserActionSignatureChallenge(request) {
|
|
316
|
+
return this.createUserActionChallenge(request);
|
|
317
|
+
}
|
|
318
|
+
async createUserActionSignature(request) {
|
|
319
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/action', {
|
|
320
|
+
path: request ?? {},
|
|
321
|
+
query: {},
|
|
322
|
+
});
|
|
323
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
324
|
+
method: 'POST',
|
|
325
|
+
body: request.body,
|
|
326
|
+
apiOptions: this.apiOptions,
|
|
327
|
+
});
|
|
328
|
+
return response.json();
|
|
329
|
+
}
|
|
330
|
+
async deactivateApplication(request) {
|
|
331
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/apps/:appId/deactivate', {
|
|
332
|
+
path: request ?? {},
|
|
333
|
+
query: {},
|
|
334
|
+
});
|
|
335
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
336
|
+
method: 'PUT',
|
|
337
|
+
body: {},
|
|
338
|
+
apiOptions: this.apiOptions,
|
|
339
|
+
});
|
|
340
|
+
return response.json();
|
|
341
|
+
}
|
|
342
|
+
async deactivateCredential(request) {
|
|
343
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/credentials/deactivate', {
|
|
344
|
+
path: request ?? {},
|
|
345
|
+
query: {},
|
|
346
|
+
});
|
|
347
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
348
|
+
method: 'PUT',
|
|
349
|
+
body: request.body,
|
|
350
|
+
apiOptions: this.apiOptions,
|
|
351
|
+
});
|
|
352
|
+
return response.json();
|
|
353
|
+
}
|
|
354
|
+
async deactivatePersonalAccessToken(request) {
|
|
355
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/pats/:tokenId/deactivate', {
|
|
356
|
+
path: request ?? {},
|
|
357
|
+
query: {},
|
|
358
|
+
});
|
|
359
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
360
|
+
method: 'PUT',
|
|
361
|
+
body: {},
|
|
362
|
+
apiOptions: this.apiOptions,
|
|
363
|
+
});
|
|
364
|
+
return response.json();
|
|
365
|
+
}
|
|
366
|
+
async deactivateServiceAccount(request) {
|
|
367
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/service-accounts/:serviceAccountId/deactivate', {
|
|
368
|
+
path: request ?? {},
|
|
369
|
+
query: {},
|
|
370
|
+
});
|
|
371
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
372
|
+
method: 'PUT',
|
|
373
|
+
body: {},
|
|
374
|
+
apiOptions: this.apiOptions,
|
|
375
|
+
});
|
|
376
|
+
return response.json();
|
|
377
|
+
}
|
|
378
|
+
async deactivateUser(request) {
|
|
379
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/users/:userId/deactivate', {
|
|
380
|
+
path: request ?? {},
|
|
381
|
+
query: {},
|
|
382
|
+
});
|
|
383
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
384
|
+
method: 'PUT',
|
|
385
|
+
body: {},
|
|
386
|
+
apiOptions: this.apiOptions,
|
|
387
|
+
});
|
|
388
|
+
return response.json();
|
|
389
|
+
}
|
|
390
|
+
async delegatedLogin(request) {
|
|
391
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/login/delegated', {
|
|
392
|
+
path: request ?? {},
|
|
393
|
+
query: {},
|
|
394
|
+
});
|
|
395
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
396
|
+
method: 'POST',
|
|
397
|
+
body: request.body,
|
|
398
|
+
apiOptions: this.apiOptions,
|
|
399
|
+
});
|
|
400
|
+
return response.json();
|
|
401
|
+
}
|
|
402
|
+
/** @deprecated, use delegatedLogin instead */
|
|
403
|
+
async createDelegatedUserLogin(request) {
|
|
404
|
+
return this.delegatedLogin(request);
|
|
405
|
+
}
|
|
406
|
+
async getApplication(request) {
|
|
407
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/apps/:appId', {
|
|
408
|
+
path: request ?? {},
|
|
409
|
+
query: {},
|
|
410
|
+
});
|
|
411
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
412
|
+
method: 'GET',
|
|
413
|
+
apiOptions: this.apiOptions,
|
|
414
|
+
});
|
|
415
|
+
return response.json();
|
|
416
|
+
}
|
|
417
|
+
async getPersonalAccessToken(request) {
|
|
418
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/pats/:tokenId', {
|
|
419
|
+
path: request ?? {},
|
|
420
|
+
query: {},
|
|
421
|
+
});
|
|
422
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
423
|
+
method: 'GET',
|
|
424
|
+
apiOptions: this.apiOptions,
|
|
425
|
+
});
|
|
426
|
+
return response.json();
|
|
427
|
+
}
|
|
428
|
+
async getServiceAccount(request) {
|
|
429
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/service-accounts/:serviceAccountId', {
|
|
430
|
+
path: request ?? {},
|
|
431
|
+
query: {},
|
|
432
|
+
});
|
|
433
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
434
|
+
method: 'GET',
|
|
435
|
+
apiOptions: this.apiOptions,
|
|
436
|
+
});
|
|
437
|
+
return response.json();
|
|
438
|
+
}
|
|
439
|
+
async getUser(request) {
|
|
440
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/users/:userId', {
|
|
441
|
+
path: request ?? {},
|
|
442
|
+
query: {},
|
|
443
|
+
});
|
|
444
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
445
|
+
method: 'GET',
|
|
446
|
+
apiOptions: this.apiOptions,
|
|
447
|
+
});
|
|
448
|
+
return response.json();
|
|
449
|
+
}
|
|
450
|
+
async listApplications() {
|
|
451
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/apps', {
|
|
452
|
+
path: {},
|
|
453
|
+
query: {},
|
|
454
|
+
});
|
|
455
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
456
|
+
method: 'GET',
|
|
457
|
+
apiOptions: this.apiOptions,
|
|
458
|
+
});
|
|
459
|
+
return response.json();
|
|
460
|
+
}
|
|
461
|
+
async listAvailableOrgs(request) {
|
|
462
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/login/orgs', {
|
|
463
|
+
path: request ?? {},
|
|
464
|
+
query: {},
|
|
465
|
+
});
|
|
466
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
467
|
+
method: 'POST',
|
|
468
|
+
body: request.body,
|
|
469
|
+
apiOptions: this.apiOptions,
|
|
470
|
+
});
|
|
471
|
+
return response.json();
|
|
472
|
+
}
|
|
473
|
+
async listCredentials() {
|
|
474
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/credentials', {
|
|
475
|
+
path: {},
|
|
476
|
+
query: {},
|
|
477
|
+
});
|
|
478
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
479
|
+
method: 'GET',
|
|
480
|
+
apiOptions: this.apiOptions,
|
|
481
|
+
});
|
|
482
|
+
return response.json();
|
|
483
|
+
}
|
|
484
|
+
/** @deprecated, use listCredentials instead */
|
|
485
|
+
async listUserCredentials() {
|
|
486
|
+
return this.listCredentials();
|
|
487
|
+
}
|
|
488
|
+
async listPersonalAccessTokens() {
|
|
489
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/pats', {
|
|
490
|
+
path: {},
|
|
491
|
+
query: {},
|
|
492
|
+
});
|
|
493
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
494
|
+
method: 'GET',
|
|
495
|
+
apiOptions: this.apiOptions,
|
|
496
|
+
});
|
|
497
|
+
return response.json();
|
|
498
|
+
}
|
|
499
|
+
async listServiceAccounts() {
|
|
500
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/service-accounts', {
|
|
501
|
+
path: {},
|
|
502
|
+
query: {},
|
|
503
|
+
});
|
|
504
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
505
|
+
method: 'GET',
|
|
506
|
+
apiOptions: this.apiOptions,
|
|
507
|
+
});
|
|
508
|
+
return response.json();
|
|
509
|
+
}
|
|
510
|
+
async listUsers(request) {
|
|
511
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/users', {
|
|
512
|
+
path: request ?? {},
|
|
513
|
+
query: request?.query ?? {},
|
|
514
|
+
});
|
|
515
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
516
|
+
method: 'GET',
|
|
517
|
+
apiOptions: this.apiOptions,
|
|
518
|
+
});
|
|
519
|
+
return response.json();
|
|
520
|
+
}
|
|
521
|
+
async login(request) {
|
|
522
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/login', {
|
|
523
|
+
path: request ?? {},
|
|
524
|
+
query: {},
|
|
525
|
+
});
|
|
526
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
527
|
+
method: 'POST',
|
|
528
|
+
body: request.body,
|
|
529
|
+
apiOptions: this.apiOptions,
|
|
530
|
+
});
|
|
531
|
+
return response.json();
|
|
532
|
+
}
|
|
533
|
+
async logout() {
|
|
534
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/logout', {
|
|
535
|
+
path: {},
|
|
536
|
+
query: {},
|
|
537
|
+
});
|
|
538
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
539
|
+
method: 'POST',
|
|
540
|
+
apiOptions: this.apiOptions,
|
|
541
|
+
});
|
|
542
|
+
return response.json();
|
|
543
|
+
}
|
|
544
|
+
async recover(request) {
|
|
545
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/recover/user', {
|
|
546
|
+
path: request ?? {},
|
|
547
|
+
query: {},
|
|
548
|
+
});
|
|
549
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
550
|
+
method: 'POST',
|
|
551
|
+
body: request.body,
|
|
552
|
+
apiOptions: this.apiOptions,
|
|
553
|
+
});
|
|
554
|
+
return response.json();
|
|
555
|
+
}
|
|
556
|
+
/** @deprecated, use recover instead */
|
|
557
|
+
async createUserRecovery(request) {
|
|
558
|
+
return this.recover(request);
|
|
559
|
+
}
|
|
560
|
+
async recreateDelegatedRegistrationChallenge(request) {
|
|
561
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/registration/delegated/restart', {
|
|
562
|
+
path: request ?? {},
|
|
563
|
+
query: {},
|
|
564
|
+
});
|
|
565
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
566
|
+
method: 'POST',
|
|
567
|
+
body: request.body,
|
|
568
|
+
apiOptions: this.apiOptions,
|
|
569
|
+
});
|
|
570
|
+
return response.json();
|
|
571
|
+
}
|
|
572
|
+
/** @deprecated, use recreateDelegatedRegistrationChallenge instead */
|
|
573
|
+
async restartDelegatedUserRegistration(request) {
|
|
574
|
+
return this.recreateDelegatedRegistrationChallenge(request);
|
|
575
|
+
}
|
|
576
|
+
async register(request) {
|
|
577
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/registration', {
|
|
578
|
+
path: request ?? {},
|
|
579
|
+
query: {},
|
|
580
|
+
});
|
|
581
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
582
|
+
method: 'POST',
|
|
583
|
+
body: request.body,
|
|
584
|
+
apiOptions: this.apiOptions,
|
|
585
|
+
});
|
|
586
|
+
return response.json();
|
|
587
|
+
}
|
|
588
|
+
/** @deprecated, use register instead */
|
|
589
|
+
async createUserRegistration(request) {
|
|
590
|
+
return this.register(request);
|
|
591
|
+
}
|
|
592
|
+
async registerEndUser(request) {
|
|
593
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/registration/enduser', {
|
|
594
|
+
path: request ?? {},
|
|
595
|
+
query: {},
|
|
596
|
+
});
|
|
597
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
598
|
+
method: 'POST',
|
|
599
|
+
body: request.body,
|
|
600
|
+
apiOptions: this.apiOptions,
|
|
601
|
+
});
|
|
602
|
+
return response.json();
|
|
603
|
+
}
|
|
604
|
+
async resendRegistrationCode(request) {
|
|
605
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/registration/code', {
|
|
606
|
+
path: request ?? {},
|
|
607
|
+
query: {},
|
|
608
|
+
});
|
|
609
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
610
|
+
method: 'PUT',
|
|
611
|
+
body: request.body,
|
|
612
|
+
apiOptions: this.apiOptions,
|
|
613
|
+
});
|
|
614
|
+
return response.json();
|
|
615
|
+
}
|
|
616
|
+
async sendRecoveryCode(request) {
|
|
617
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/recover/user/code', {
|
|
618
|
+
path: request ?? {},
|
|
619
|
+
query: {},
|
|
620
|
+
});
|
|
621
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
622
|
+
method: 'POST',
|
|
623
|
+
body: request.body,
|
|
624
|
+
apiOptions: this.apiOptions,
|
|
625
|
+
});
|
|
626
|
+
return response.json();
|
|
627
|
+
}
|
|
628
|
+
async updateApplication(request) {
|
|
629
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/apps/:appId', {
|
|
630
|
+
path: request ?? {},
|
|
631
|
+
query: {},
|
|
632
|
+
});
|
|
633
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
634
|
+
method: 'POST',
|
|
635
|
+
body: request.body,
|
|
636
|
+
apiOptions: this.apiOptions,
|
|
637
|
+
});
|
|
638
|
+
return response.json();
|
|
639
|
+
}
|
|
640
|
+
async updatePersonalAccessToken(request) {
|
|
641
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/pats/:tokenId', {
|
|
642
|
+
path: request ?? {},
|
|
643
|
+
query: {},
|
|
644
|
+
});
|
|
645
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
646
|
+
method: 'PUT',
|
|
647
|
+
body: request.body,
|
|
648
|
+
apiOptions: this.apiOptions,
|
|
649
|
+
});
|
|
650
|
+
return response.json();
|
|
651
|
+
}
|
|
652
|
+
async updateServiceAccount(request) {
|
|
653
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/service-accounts/:serviceAccountId', {
|
|
654
|
+
path: request ?? {},
|
|
655
|
+
query: {},
|
|
656
|
+
});
|
|
657
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
658
|
+
method: 'PUT',
|
|
659
|
+
body: request.body,
|
|
660
|
+
apiOptions: this.apiOptions,
|
|
661
|
+
});
|
|
662
|
+
return response.json();
|
|
663
|
+
}
|
|
664
|
+
async updateUser(request) {
|
|
665
|
+
const path = (0, url_1.buildPathAndQuery)('/auth/users/:userId', {
|
|
666
|
+
path: request ?? {},
|
|
667
|
+
query: {},
|
|
668
|
+
});
|
|
669
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
670
|
+
method: 'PUT',
|
|
671
|
+
body: request.body,
|
|
672
|
+
apiOptions: this.apiOptions,
|
|
673
|
+
});
|
|
674
|
+
return response.json();
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
exports.AuthClient = AuthClient;
|