keycloak-api 0.1.0 → 0.2.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "keycloak-api",
3
- "version": "0.1.0",
4
- "description": "keycloak API client for Node.js",
3
+ "version": "0.2.1",
4
+ "description": "keycloak auto-generated type-safe API client",
5
5
  "author": "SferaDev",
6
6
  "license": "ISC",
7
7
  "bugs": {
@@ -31,6 +31,6 @@
31
31
  "scripts": {
32
32
  "tsc": "tsc --noEmit",
33
33
  "build": "unbuild",
34
- "generate": "openapi-codegen admin"
34
+ "generate": "openapi-codegen admin && openapi-codegen account"
35
35
  }
36
36
  }
@@ -0,0 +1,677 @@
1
+ openapi: 3.0.2
2
+ info:
3
+ title: Keycloak Account API
4
+ version: 1.0.0
5
+ components:
6
+ securitySchemes:
7
+ access_token:
8
+ type: http
9
+ scheme: bearer
10
+ bearerFormat: ''
11
+ schemas:
12
+ OrganizationRepresentation:
13
+ type: object
14
+ properties:
15
+ id:
16
+ type: string
17
+ name:
18
+ type: string
19
+ alias:
20
+ type: string
21
+ description:
22
+ type: string
23
+ enabled:
24
+ type: boolean
25
+ domains:
26
+ type: array
27
+ items:
28
+ type: string
29
+ GroupRepresentation:
30
+ type: object
31
+ properties:
32
+ access:
33
+ type: object
34
+ additionalProperties: true
35
+ attributes:
36
+ type: object
37
+ additionalProperties: true
38
+ clientRoles:
39
+ type: object
40
+ additionalProperties: true
41
+ id:
42
+ type: string
43
+ name:
44
+ type: string
45
+ path:
46
+ type: string
47
+ realmRoles:
48
+ type: array
49
+ items:
50
+ type: string
51
+ subGroups:
52
+ type: array
53
+ items:
54
+ $ref: '#/components/schemas/GroupRepresentation'
55
+ ClientRepresentation:
56
+ type: object
57
+ properties:
58
+ clientId:
59
+ type: string
60
+ clientName:
61
+ type: string
62
+ description:
63
+ type: string
64
+ userConsentRequired:
65
+ type: boolean
66
+ inUse:
67
+ type: boolean
68
+ offlineAccess:
69
+ type: boolean
70
+ rootUrl:
71
+ type: string
72
+ baseUrl:
73
+ type: string
74
+ effectiveUrl:
75
+ type: string
76
+ logoUri:
77
+ type: string
78
+ policyUri:
79
+ type: string
80
+ tosUri:
81
+ type: string
82
+ consent:
83
+ $ref: '#/components/schemas/ConsentRepresentation'
84
+ ConsentRepresentation:
85
+ type: object
86
+ properties:
87
+ createdDate:
88
+ type: number
89
+ lastUpdatedDate:
90
+ type: number
91
+ grantedScopes:
92
+ type: array
93
+ items:
94
+ $ref: '#/components/schemas/ConsentScopeRepresentation'
95
+ ConsentScopeRepresentation:
96
+ type: object
97
+ properties:
98
+ id:
99
+ type: string
100
+ name:
101
+ type: string
102
+ displayText:
103
+ type: string
104
+ LinkedAccountRepresentation:
105
+ type: object
106
+ properties:
107
+ connected:
108
+ type: boolean
109
+ social:
110
+ type: boolean
111
+ providerAlias:
112
+ type: string
113
+ providerName:
114
+ type: string
115
+ displayName:
116
+ type: string
117
+ linkedUsername:
118
+ type: string
119
+ AccountLinkUriRepresentation:
120
+ type: object
121
+ properties:
122
+ accountLinkUri:
123
+ type: string
124
+ nonce:
125
+ type: string
126
+ hash:
127
+ type: string
128
+ AccountRepresentation:
129
+ type: object
130
+ properties:
131
+ id:
132
+ type: string
133
+ username:
134
+ type: string
135
+ firstName:
136
+ type: string
137
+ lastName:
138
+ type: string
139
+ email:
140
+ type: string
141
+ emailVerified:
142
+ type: boolean
143
+ userProfileMetadata:
144
+ $ref: '#/components/schemas/UserProfileMetadataRepresentation'
145
+ attributes:
146
+ $ref: '#/components/schemas/UserProfileAttributesRepresentation'
147
+ UserProfileMetadataRepresentation:
148
+ type: object
149
+ properties:
150
+ attributes:
151
+ type: array
152
+ items:
153
+ $ref: '#/components/schemas/UserProfileMetadataAttributeRepresentation'
154
+ UserProfileAttributesRepresentation:
155
+ type: object
156
+ properties:
157
+ locale:
158
+ type: array
159
+ items:
160
+ type: string
161
+ UserProfileMetadataAttributeRepresentation:
162
+ type: object
163
+ properties:
164
+ name:
165
+ type: string
166
+ displayName:
167
+ type: string
168
+ required:
169
+ type: boolean
170
+ readOnly:
171
+ type: boolean
172
+ validators:
173
+ type: object
174
+ CredentialRepresentation:
175
+ type: object
176
+ properties:
177
+ type:
178
+ type: string
179
+ category:
180
+ type: string
181
+ displayName:
182
+ type: string
183
+ helpText:
184
+ type: string
185
+ iconCssClass:
186
+ type: string
187
+ updateAction:
188
+ type: string
189
+ removeable:
190
+ type: boolean
191
+ userCredentialMetadatas:
192
+ type: array
193
+ items:
194
+ $ref: '#/components/schemas/UserCredentialMetadataRepresentation'
195
+ UserCredentialMetadataRepresentation:
196
+ type: object
197
+ properties:
198
+ credential:
199
+ $ref: '#/components/schemas/CredentialMetadataRepresentation'
200
+ CredentialMetadataRepresentation:
201
+ type: object
202
+ properties:
203
+ id:
204
+ type: string
205
+ type:
206
+ type: string
207
+ userLabel:
208
+ type: string
209
+ createdDate:
210
+ type: string
211
+ credentialData:
212
+ type: object
213
+ SessionRepresentation:
214
+ type: object
215
+ properties:
216
+ id:
217
+ type: string
218
+ ipAddress:
219
+ type: string
220
+ started:
221
+ type: number
222
+ lastAccess:
223
+ type: number
224
+ expires:
225
+ type: number
226
+ browser:
227
+ type: string
228
+ current:
229
+ type: boolean
230
+ clients:
231
+ type: array
232
+ items:
233
+ $ref: '#/components/schemas/ClientRepresentation'
234
+ DeviceRepresentation:
235
+ type: object
236
+ properties:
237
+ id:
238
+ type: string
239
+ ipAddress:
240
+ type: string
241
+ os:
242
+ type: string
243
+ osVersion:
244
+ type: string
245
+ browser:
246
+ type: string
247
+ device:
248
+ type: string
249
+ lastAccess:
250
+ type: number
251
+ current:
252
+ type: boolean
253
+ mobile:
254
+ type: boolean
255
+ sessions:
256
+ type: array
257
+ items:
258
+ $ref: '#/components/schemas/SessionRepresentation'
259
+ security:
260
+ - access_token: []
261
+ paths:
262
+ /{realm}/account/:
263
+ parameters:
264
+ - in: path
265
+ name: realm
266
+ description: realm name
267
+ required: true
268
+ schema:
269
+ type: string
270
+ style: simple
271
+ get:
272
+ tags:
273
+ - Account
274
+ summary: Get account
275
+ description: Get user details for currently logged in user
276
+ operationId: getAccount
277
+ parameters:
278
+ - name: userProfileMetadata
279
+ in: query
280
+ schema:
281
+ type: boolean
282
+ responses:
283
+ 200:
284
+ description: success
285
+ content:
286
+ application/json:
287
+ schema:
288
+ $ref: '#/components/schemas/AccountRepresentation'
289
+ post:
290
+ tags:
291
+ - Account
292
+ summary: Update account
293
+ operationId: updateAccount
294
+ requestBody:
295
+ content:
296
+ application/json:
297
+ schema:
298
+ $ref: '#/components/schemas/AccountRepresentation'
299
+ required: true
300
+ responses:
301
+ 204:
302
+ description: success
303
+ /{realm}/account/applications:
304
+ parameters:
305
+ - in: path
306
+ name: realm
307
+ description: realm name
308
+ required: true
309
+ schema:
310
+ type: string
311
+ style: simple
312
+ get:
313
+ parameters:
314
+ - name: name
315
+ in: query
316
+ schema:
317
+ type: string
318
+ tags:
319
+ - Account
320
+ summary: Get applications
321
+ operationId: getApplications
322
+ responses:
323
+ 200:
324
+ description: success
325
+ content:
326
+ application/json:
327
+ schema:
328
+ type: array
329
+ items:
330
+ $ref: '#/components/schemas/ClientRepresentation'
331
+ /{realm}/account/applications/{clientId}/consent:
332
+ parameters:
333
+ - in: path
334
+ name: realm
335
+ description: realm name
336
+ required: true
337
+ schema:
338
+ type: string
339
+ style: simple
340
+ - in: path
341
+ name: clientId
342
+ description: client id
343
+ required: true
344
+ schema:
345
+ type: string
346
+ style: simple
347
+ get:
348
+ tags:
349
+ - Account
350
+ summary: Get consent
351
+ operationId: getConsent
352
+ responses:
353
+ 200:
354
+ description: success
355
+ content:
356
+ application/json:
357
+ schema:
358
+ $ref: '#/components/schemas/ConsentRepresentation'
359
+ post:
360
+ tags:
361
+ - Account
362
+ summary: Create consent
363
+ operationId: createConsent
364
+ responses:
365
+ 200:
366
+ description: success
367
+ content:
368
+ application/json:
369
+ schema:
370
+ $ref: '#/components/schemas/ConsentRepresentation'
371
+ put:
372
+ tags:
373
+ - Account
374
+ summary: Update consent
375
+ operationId: updateConsent
376
+ responses:
377
+ 200:
378
+ description: success
379
+ content:
380
+ application/json:
381
+ schema:
382
+ $ref: '#/components/schemas/ConsentRepresentation'
383
+ delete:
384
+ tags:
385
+ - Account
386
+ summary: Delete consent
387
+ operationId: deleteConsent
388
+ responses:
389
+ 204:
390
+ description: Deleted
391
+ /{realm}/account/credentials:
392
+ parameters:
393
+ - in: path
394
+ name: realm
395
+ description: realm name
396
+ required: true
397
+ schema:
398
+ type: string
399
+ style: simple
400
+ get:
401
+ tags:
402
+ - Account
403
+ summary: Get credentials
404
+ description: Get credentials for currently logged in user
405
+ operationId: getCredentials
406
+ parameters:
407
+ - name: type
408
+ in: query
409
+ schema:
410
+ type: string
411
+ - name: user-credentials
412
+ in: query
413
+ schema:
414
+ type: boolean
415
+ responses:
416
+ 200:
417
+ description: success
418
+ content:
419
+ application/json:
420
+ schema:
421
+ type: array
422
+ items:
423
+ $ref: '#/components/schemas/CredentialRepresentation'
424
+ /{realm}/account/credentials/{credentialId}:
425
+ parameters:
426
+ - in: path
427
+ name: realm
428
+ description: realm name
429
+ required: true
430
+ schema:
431
+ type: string
432
+ style: simple
433
+ - in: path
434
+ name: credentialId
435
+ description: Credential ID
436
+ required: true
437
+ schema:
438
+ type: string
439
+ style: simple
440
+ delete:
441
+ tags:
442
+ - Account
443
+ summary: Delete the credential
444
+ operationId: deleteCredential
445
+ responses:
446
+ 204:
447
+ description: success
448
+ /{realm}/account/credentials/{credentialId}/label:
449
+ parameters:
450
+ - in: path
451
+ name: realm
452
+ description: realm name
453
+ required: true
454
+ schema:
455
+ type: string
456
+ style: simple
457
+ - in: path
458
+ name: credentialId
459
+ description: Credential ID
460
+ required: true
461
+ schema:
462
+ type: string
463
+ style: simple
464
+ put:
465
+ tags:
466
+ - Account
467
+ summary: Update a user label of specified credential of current user
468
+ operationId: updateCredentialLabel
469
+ requestBody:
470
+ content:
471
+ application/json:
472
+ schema:
473
+ type: string
474
+ responses:
475
+ 204:
476
+ description: No Content
477
+ /{realm}/account/sessions:
478
+ parameters:
479
+ - in: path
480
+ name: realm
481
+ description: realm name
482
+ required: true
483
+ schema:
484
+ type: string
485
+ style: simple
486
+ get:
487
+ tags:
488
+ - Account
489
+ summary: Get sessions
490
+ description: Get sessions for currently logged in user
491
+ operationId: getSessions
492
+ responses:
493
+ 200:
494
+ description: success
495
+ content:
496
+ application/json:
497
+ schema:
498
+ type: array
499
+ items:
500
+ $ref: '#/components/schemas/SessionRepresentation'
501
+ delete:
502
+ tags:
503
+ - Account
504
+ summary: Delete current session
505
+ operationId: deleteCurrentSession
506
+ responses:
507
+ 204:
508
+ description: success
509
+ /{realm}/account/sessions/devices:
510
+ parameters:
511
+ - in: path
512
+ name: realm
513
+ description: realm name
514
+ required: true
515
+ schema:
516
+ type: string
517
+ style: simple
518
+ get:
519
+ tags:
520
+ - Account
521
+ summary: Get devices
522
+ description: Get devices for currently logged in user
523
+ operationId: getDevices
524
+ responses:
525
+ 200:
526
+ description: success
527
+ content:
528
+ application/json:
529
+ schema:
530
+ type: array
531
+ items:
532
+ $ref: '#/components/schemas/DeviceRepresentation'
533
+ /{realm}/account/sessions/{sessionId}:
534
+ parameters:
535
+ - in: path
536
+ name: realm
537
+ description: realm name
538
+ required: true
539
+ schema:
540
+ type: string
541
+ style: simple
542
+ - in: path
543
+ name: sessionId
544
+ description: Session ID
545
+ required: true
546
+ schema:
547
+ type: string
548
+ style: simple
549
+ delete:
550
+ tags:
551
+ - Account
552
+ summary: Delete the session
553
+ operationId: deleteSession
554
+ responses:
555
+ 204:
556
+ description: success
557
+ /{realm}/account/linked-accounts:
558
+ parameters:
559
+ - in: path
560
+ name: realm
561
+ description: realm name
562
+ required: true
563
+ schema:
564
+ type: string
565
+ style: simple
566
+ get:
567
+ tags:
568
+ - Account
569
+ summary: Get linked accounts
570
+ description: Get linked accounts for currently logged in user
571
+ operationId: getLinkedAccounts
572
+ responses:
573
+ 200:
574
+ description: success
575
+ content:
576
+ application/json:
577
+ schema:
578
+ type: array
579
+ items:
580
+ $ref: '#/components/schemas/LinkedAccountRepresentation'
581
+ /{realm}/account/linked-accounts/{providerId}:
582
+ parameters:
583
+ - in: path
584
+ name: realm
585
+ description: realm name
586
+ required: true
587
+ schema:
588
+ type: string
589
+ style: simple
590
+ - in: path
591
+ name: providerId
592
+ description: Provider ID
593
+ required: true
594
+ schema:
595
+ type: string
596
+ style: simple
597
+ get:
598
+ tags:
599
+ - Account
600
+ summary: Build account linking URI
601
+ description: Build account linking URI
602
+ operationId: buildLinkingUri
603
+ parameters:
604
+ - in: query
605
+ name: redirectUri
606
+ description: Redirect URI to return to after account linking
607
+ required: true
608
+ schema:
609
+ type: string
610
+ responses:
611
+ 200:
612
+ description: success
613
+ content:
614
+ application/json:
615
+ schema:
616
+ $ref: '#/components/schemas/AccountLinkUriRepresentation'
617
+ delete:
618
+ tags:
619
+ - Account
620
+ summary: Delete the linked provider
621
+ operationId: deleteLinkedProvider
622
+ responses:
623
+ 204:
624
+ description: success
625
+ /{realm}/account/groups:
626
+ parameters:
627
+ - in: path
628
+ name: realm
629
+ description: realm name
630
+ required: true
631
+ schema:
632
+ type: string
633
+ style: simple
634
+ get:
635
+ parameters:
636
+ - name: briefRepresentation
637
+ in: query
638
+ schema:
639
+ default: true
640
+ type: boolean
641
+ tags:
642
+ - Account
643
+ summary: Get groups that this user is a member of
644
+ operationId: getGroups
645
+ responses:
646
+ 200:
647
+ description: success
648
+ content:
649
+ application/json:
650
+ schema:
651
+ type: array
652
+ items:
653
+ $ref: '#/components/schemas/GroupRepresentation'
654
+ /{realm}/account/organizations:
655
+ parameters:
656
+ - in: path
657
+ name: realm
658
+ description: realm name
659
+ required: true
660
+ schema:
661
+ type: string
662
+ style: simple
663
+ get:
664
+ tags:
665
+ - Account
666
+ summary: Get organizations
667
+ description: Get organizations for currently logged in user
668
+ operationId: getOrganizations
669
+ responses:
670
+ 200:
671
+ description: success
672
+ content:
673
+ application/json:
674
+ schema:
675
+ type: array
676
+ items:
677
+ $ref: '#/components/schemas/OrganizationRepresentation'