@polaris-auth/client 0.0.0-stage → 0.7.0

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/dist/admin.js ADDED
@@ -0,0 +1,63 @@
1
+ /** The `admin` plugin's routes as methods of `client.admin`. */
2
+ export function admin(client) {
3
+ return {
4
+ /** POST /admin/users/{id}/ban: Ban a user */
5
+ banUser: (...init) => client.POST("/admin/users/{id}/ban", ...init),
6
+ /** POST /admin/organizations/{id}/drains: Create an audit drain */
7
+ createDrain: (...init) => client.POST("/admin/organizations/{id}/drains", ...init),
8
+ /** POST /admin/grants: Grant an admin role */
9
+ createGrant: (...init) => client.POST("/admin/grants", ...init),
10
+ /** POST /admin/keys: Create an API key */
11
+ createKey: (...init) => client.POST("/admin/keys", ...init),
12
+ /** DELETE /admin/organizations/{id}/drains/{drainId}: Delete an audit drain */
13
+ deleteDrain: (...init) => client.DELETE("/admin/organizations/{id}/drains/{drainId}", ...init),
14
+ /** DELETE /admin/grants/{id}: Revoke an admin grant */
15
+ deleteGrant: (...init) => client.DELETE("/admin/grants/{id}", ...init),
16
+ /** DELETE /admin/keys/{id}: Delete an API key */
17
+ deleteKey: (...init) => client.DELETE("/admin/keys/{id}", ...init),
18
+ /** DELETE /admin/organizations/{id}: Delete an organization */
19
+ deleteOrganization: (...init) => client.DELETE("/admin/organizations/{id}", ...init),
20
+ /** DELETE /admin/users/{id}: Delete a user */
21
+ deleteUser: (...init) => client.DELETE("/admin/users/{id}", ...init),
22
+ /** POST /admin/users/{id}/impersonate: Impersonate a user */
23
+ impersonateUser: (...init) => client.POST("/admin/users/{id}/impersonate", ...init),
24
+ /** GET /admin/organizations/{id}/drains: List an organization's audit drains */
25
+ listDrains: (...init) => client.GET("/admin/organizations/{id}/drains", ...init),
26
+ /** GET /admin/users/{id}/mfa: List a user's MFA factors */
27
+ listFactors: (...init) => client.GET("/admin/users/{id}/mfa", ...init),
28
+ /** GET /admin/grants: List the admin grants */
29
+ listGrants: (...init) => client.GET("/admin/grants", ...init),
30
+ /** GET /admin/keys: List the API keys */
31
+ listKeys: (...init) => client.GET("/admin/keys", ...init),
32
+ /** GET /admin/organizations: List the organizations */
33
+ listOrganizations: (...init) => client.GET("/admin/organizations", ...init),
34
+ /** GET /admin/users/{id}/sessions: List a user's sessions */
35
+ listSessions: (...init) => client.GET("/admin/users/{id}/sessions", ...init),
36
+ /** GET /admin/users: List the users */
37
+ listUsers: (...init) => client.GET("/admin/users", ...init),
38
+ /** GET /admin/audit: Query the audit trail */
39
+ queryAudit: (...init) => client.GET("/admin/audit", ...init),
40
+ /** GET /admin/organizations/{id}: Read an organization */
41
+ readOrganization: (...init) => client.GET("/admin/organizations/{id}", ...init),
42
+ /** GET /admin/users/{id}: Read a user */
43
+ readUser: (...init) => client.GET("/admin/users/{id}", ...init),
44
+ /** DELETE /admin/users/{id}/mfa/{factorId}: Remove an MFA factor */
45
+ removeFactor: (...init) => client.DELETE("/admin/users/{id}/mfa/{factorId}", ...init),
46
+ /** DELETE /admin/users/{id}/mfa: Reset a user's MFA */
47
+ resetMfa: (...init) => client.DELETE("/admin/users/{id}/mfa", ...init),
48
+ /** DELETE /admin/users/{id}/sessions: Revoke every session */
49
+ revokeAllSessions: (...init) => client.DELETE("/admin/users/{id}/sessions", ...init),
50
+ /** DELETE /admin/users/{id}/sessions/{sessionId}: Revoke a session */
51
+ revokeSession: (...init) => client.DELETE("/admin/users/{id}/sessions/{sessionId}", ...init),
52
+ /** POST /admin/users/{id}/password: Set a user's password */
53
+ setPassword: (...init) => client.POST("/admin/users/{id}/password", ...init),
54
+ /** GET /admin/stats: Read the instance statistics */
55
+ stats: (...init) => client.GET("/admin/stats", ...init),
56
+ /** POST /admin/organizations/{id}/drains/{drainId}/test: Test an audit drain */
57
+ testDrain: (...init) => client.POST("/admin/organizations/{id}/drains/{drainId}/test", ...init),
58
+ /** POST /admin/users/{id}/unban: Unban a user */
59
+ unbanUser: (...init) => client.POST("/admin/users/{id}/unban", ...init),
60
+ /** PATCH /admin/organizations/{id}/members/{userId}/roles: Set a member's roles */
61
+ updateMemberRoles: (...init) => client.PATCH("/admin/organizations/{id}/members/{userId}/roles", ...init),
62
+ };
63
+ }
@@ -0,0 +1,513 @@
1
+ import type { Client } from "openapi-fetch";
2
+ import type { paths } from "./schema.js";
3
+ import type { Init } from "./namespace.js";
4
+ /** The `anonymous` plugin's routes as methods of `client.anonymous`. */
5
+ export declare function anonymous(client: Client<paths>): {
6
+ /** POST /anonymous/convert: Convert the guest into an account */
7
+ convert: (init_0: {
8
+ params?: {
9
+ query?: never;
10
+ header?: never;
11
+ path?: never;
12
+ cookie?: never;
13
+ };
14
+ } & {
15
+ body: {
16
+ access_token: string;
17
+ } & {};
18
+ } & {
19
+ baseUrl?: string;
20
+ querySerializer?: import("openapi-fetch").QuerySerializerOptions | import("openapi-fetch").QuerySerializer<{
21
+ parameters: {
22
+ query?: never;
23
+ header?: never;
24
+ path?: never;
25
+ cookie?: never;
26
+ };
27
+ requestBody: {
28
+ content: {
29
+ "application/json": {
30
+ access_token: string;
31
+ };
32
+ };
33
+ };
34
+ responses: {
35
+ 200: {
36
+ headers: {
37
+ [name: string]: unknown;
38
+ };
39
+ content: {
40
+ "application/json": {
41
+ data: {
42
+ guest_id: string;
43
+ user_id: string;
44
+ status: string;
45
+ };
46
+ };
47
+ };
48
+ };
49
+ 401: {
50
+ headers: {
51
+ [name: string]: unknown;
52
+ };
53
+ content: {
54
+ "application/problem+json": import("./schema.js").components["schemas"]["Problem"];
55
+ };
56
+ };
57
+ 403: {
58
+ headers: {
59
+ [name: string]: unknown;
60
+ };
61
+ content: {
62
+ "application/problem+json": import("./schema.js").components["schemas"]["Problem"];
63
+ };
64
+ };
65
+ 422: {
66
+ headers: {
67
+ [name: string]: unknown;
68
+ };
69
+ content: {
70
+ "application/problem+json": import("./schema.js").components["schemas"]["Problem"];
71
+ };
72
+ };
73
+ };
74
+ }>;
75
+ bodySerializer?: import("openapi-fetch").BodySerializer<{
76
+ parameters: {
77
+ query?: never;
78
+ header?: never;
79
+ path?: never;
80
+ cookie?: never;
81
+ };
82
+ requestBody: {
83
+ content: {
84
+ "application/json": {
85
+ access_token: string;
86
+ };
87
+ };
88
+ };
89
+ responses: {
90
+ 200: {
91
+ headers: {
92
+ [name: string]: unknown;
93
+ };
94
+ content: {
95
+ "application/json": {
96
+ data: {
97
+ guest_id: string;
98
+ user_id: string;
99
+ status: string;
100
+ };
101
+ };
102
+ };
103
+ };
104
+ 401: {
105
+ headers: {
106
+ [name: string]: unknown;
107
+ };
108
+ content: {
109
+ "application/problem+json": import("./schema.js").components["schemas"]["Problem"];
110
+ };
111
+ };
112
+ 403: {
113
+ headers: {
114
+ [name: string]: unknown;
115
+ };
116
+ content: {
117
+ "application/problem+json": import("./schema.js").components["schemas"]["Problem"];
118
+ };
119
+ };
120
+ 422: {
121
+ headers: {
122
+ [name: string]: unknown;
123
+ };
124
+ content: {
125
+ "application/problem+json": import("./schema.js").components["schemas"]["Problem"];
126
+ };
127
+ };
128
+ };
129
+ }>;
130
+ pathSerializer?: import("openapi-fetch").PathSerializer;
131
+ parseAs?: import("openapi-fetch").ParseAs;
132
+ fetch?: import("openapi-fetch").ClientOptions["fetch"];
133
+ headers?: import("openapi-fetch").HeadersOptions;
134
+ middleware?: import("openapi-fetch").Middleware[];
135
+ } & Omit<RequestInit, "body" | "headers"> & {
136
+ [key: string]: unknown;
137
+ }) => Promise<import("openapi-fetch").FetchResponse<{
138
+ parameters: {
139
+ query?: never;
140
+ header?: never;
141
+ path?: never;
142
+ cookie?: never;
143
+ };
144
+ requestBody: {
145
+ content: {
146
+ "application/json": {
147
+ access_token: string;
148
+ };
149
+ };
150
+ };
151
+ responses: {
152
+ 200: {
153
+ headers: {
154
+ [name: string]: unknown;
155
+ };
156
+ content: {
157
+ "application/json": {
158
+ data: {
159
+ guest_id: string;
160
+ user_id: string;
161
+ status: string;
162
+ };
163
+ };
164
+ };
165
+ };
166
+ 401: {
167
+ headers: {
168
+ [name: string]: unknown;
169
+ };
170
+ content: {
171
+ "application/problem+json": import("./schema.js").components["schemas"]["Problem"];
172
+ };
173
+ };
174
+ 403: {
175
+ headers: {
176
+ [name: string]: unknown;
177
+ };
178
+ content: {
179
+ "application/problem+json": import("./schema.js").components["schemas"]["Problem"];
180
+ };
181
+ };
182
+ 422: {
183
+ headers: {
184
+ [name: string]: unknown;
185
+ };
186
+ content: {
187
+ "application/problem+json": import("./schema.js").components["schemas"]["Problem"];
188
+ };
189
+ };
190
+ };
191
+ }, {
192
+ params?: {
193
+ query?: never;
194
+ header?: never;
195
+ path?: never;
196
+ cookie?: never;
197
+ };
198
+ } & {
199
+ body: {
200
+ access_token: string;
201
+ } & {};
202
+ } & {
203
+ baseUrl?: string;
204
+ querySerializer?: import("openapi-fetch").QuerySerializerOptions | import("openapi-fetch").QuerySerializer<{
205
+ parameters: {
206
+ query?: never;
207
+ header?: never;
208
+ path?: never;
209
+ cookie?: never;
210
+ };
211
+ requestBody: {
212
+ content: {
213
+ "application/json": {
214
+ access_token: string;
215
+ };
216
+ };
217
+ };
218
+ responses: {
219
+ 200: {
220
+ headers: {
221
+ [name: string]: unknown;
222
+ };
223
+ content: {
224
+ "application/json": {
225
+ data: {
226
+ guest_id: string;
227
+ user_id: string;
228
+ status: string;
229
+ };
230
+ };
231
+ };
232
+ };
233
+ 401: {
234
+ headers: {
235
+ [name: string]: unknown;
236
+ };
237
+ content: {
238
+ "application/problem+json": import("./schema.js").components["schemas"]["Problem"];
239
+ };
240
+ };
241
+ 403: {
242
+ headers: {
243
+ [name: string]: unknown;
244
+ };
245
+ content: {
246
+ "application/problem+json": import("./schema.js").components["schemas"]["Problem"];
247
+ };
248
+ };
249
+ 422: {
250
+ headers: {
251
+ [name: string]: unknown;
252
+ };
253
+ content: {
254
+ "application/problem+json": import("./schema.js").components["schemas"]["Problem"];
255
+ };
256
+ };
257
+ };
258
+ }>;
259
+ bodySerializer?: import("openapi-fetch").BodySerializer<{
260
+ parameters: {
261
+ query?: never;
262
+ header?: never;
263
+ path?: never;
264
+ cookie?: never;
265
+ };
266
+ requestBody: {
267
+ content: {
268
+ "application/json": {
269
+ access_token: string;
270
+ };
271
+ };
272
+ };
273
+ responses: {
274
+ 200: {
275
+ headers: {
276
+ [name: string]: unknown;
277
+ };
278
+ content: {
279
+ "application/json": {
280
+ data: {
281
+ guest_id: string;
282
+ user_id: string;
283
+ status: string;
284
+ };
285
+ };
286
+ };
287
+ };
288
+ 401: {
289
+ headers: {
290
+ [name: string]: unknown;
291
+ };
292
+ content: {
293
+ "application/problem+json": import("./schema.js").components["schemas"]["Problem"];
294
+ };
295
+ };
296
+ 403: {
297
+ headers: {
298
+ [name: string]: unknown;
299
+ };
300
+ content: {
301
+ "application/problem+json": import("./schema.js").components["schemas"]["Problem"];
302
+ };
303
+ };
304
+ 422: {
305
+ headers: {
306
+ [name: string]: unknown;
307
+ };
308
+ content: {
309
+ "application/problem+json": import("./schema.js").components["schemas"]["Problem"];
310
+ };
311
+ };
312
+ };
313
+ }>;
314
+ pathSerializer?: import("openapi-fetch").PathSerializer;
315
+ parseAs?: import("openapi-fetch").ParseAs;
316
+ fetch?: import("openapi-fetch").ClientOptions["fetch"];
317
+ headers?: import("openapi-fetch").HeadersOptions;
318
+ middleware?: import("openapi-fetch").Middleware[];
319
+ } & Omit<RequestInit, "body" | "headers">, `${string}/${string}`>>;
320
+ /** POST /anonymous/sign-in: Sign in as a guest */
321
+ signIn: (init_0?: ({
322
+ params?: {
323
+ query?: never;
324
+ header?: never;
325
+ path?: never;
326
+ cookie?: never;
327
+ };
328
+ } & {
329
+ body?: undefined;
330
+ } & {
331
+ baseUrl?: string;
332
+ querySerializer?: import("openapi-fetch").QuerySerializerOptions | import("openapi-fetch").QuerySerializer<{
333
+ parameters: {
334
+ query?: never;
335
+ header?: never;
336
+ path?: never;
337
+ cookie?: never;
338
+ };
339
+ requestBody?: never;
340
+ responses: {
341
+ 201: {
342
+ headers: {
343
+ [name: string]: unknown;
344
+ };
345
+ content: {
346
+ "application/json": {
347
+ data: {
348
+ access_token: string;
349
+ token_type: string;
350
+ expires_in: number;
351
+ refresh_token: string;
352
+ user: {
353
+ id: string;
354
+ email: string;
355
+ email_verified: boolean;
356
+ };
357
+ };
358
+ };
359
+ };
360
+ };
361
+ };
362
+ }>;
363
+ bodySerializer?: import("openapi-fetch").BodySerializer<{
364
+ parameters: {
365
+ query?: never;
366
+ header?: never;
367
+ path?: never;
368
+ cookie?: never;
369
+ };
370
+ requestBody?: never;
371
+ responses: {
372
+ 201: {
373
+ headers: {
374
+ [name: string]: unknown;
375
+ };
376
+ content: {
377
+ "application/json": {
378
+ data: {
379
+ access_token: string;
380
+ token_type: string;
381
+ expires_in: number;
382
+ refresh_token: string;
383
+ user: {
384
+ id: string;
385
+ email: string;
386
+ email_verified: boolean;
387
+ };
388
+ };
389
+ };
390
+ };
391
+ };
392
+ };
393
+ }>;
394
+ pathSerializer?: import("openapi-fetch").PathSerializer;
395
+ parseAs?: import("openapi-fetch").ParseAs;
396
+ fetch?: import("openapi-fetch").ClientOptions["fetch"];
397
+ headers?: import("openapi-fetch").HeadersOptions;
398
+ middleware?: import("openapi-fetch").Middleware[];
399
+ } & Omit<RequestInit, "body" | "headers"> & {
400
+ [key: string]: unknown;
401
+ }) | undefined) => Promise<import("openapi-fetch").FetchResponse<{
402
+ parameters: {
403
+ query?: never;
404
+ header?: never;
405
+ path?: never;
406
+ cookie?: never;
407
+ };
408
+ requestBody?: never;
409
+ responses: {
410
+ 201: {
411
+ headers: {
412
+ [name: string]: unknown;
413
+ };
414
+ content: {
415
+ "application/json": {
416
+ data: {
417
+ access_token: string;
418
+ token_type: string;
419
+ expires_in: number;
420
+ refresh_token: string;
421
+ user: {
422
+ id: string;
423
+ email: string;
424
+ email_verified: boolean;
425
+ };
426
+ };
427
+ };
428
+ };
429
+ };
430
+ };
431
+ }, ({
432
+ params?: {
433
+ query?: never;
434
+ header?: never;
435
+ path?: never;
436
+ cookie?: never;
437
+ };
438
+ } & {
439
+ body?: undefined;
440
+ } & {
441
+ baseUrl?: string;
442
+ querySerializer?: import("openapi-fetch").QuerySerializerOptions | import("openapi-fetch").QuerySerializer<{
443
+ parameters: {
444
+ query?: never;
445
+ header?: never;
446
+ path?: never;
447
+ cookie?: never;
448
+ };
449
+ requestBody?: never;
450
+ responses: {
451
+ 201: {
452
+ headers: {
453
+ [name: string]: unknown;
454
+ };
455
+ content: {
456
+ "application/json": {
457
+ data: {
458
+ access_token: string;
459
+ token_type: string;
460
+ expires_in: number;
461
+ refresh_token: string;
462
+ user: {
463
+ id: string;
464
+ email: string;
465
+ email_verified: boolean;
466
+ };
467
+ };
468
+ };
469
+ };
470
+ };
471
+ };
472
+ }>;
473
+ bodySerializer?: import("openapi-fetch").BodySerializer<{
474
+ parameters: {
475
+ query?: never;
476
+ header?: never;
477
+ path?: never;
478
+ cookie?: never;
479
+ };
480
+ requestBody?: never;
481
+ responses: {
482
+ 201: {
483
+ headers: {
484
+ [name: string]: unknown;
485
+ };
486
+ content: {
487
+ "application/json": {
488
+ data: {
489
+ access_token: string;
490
+ token_type: string;
491
+ expires_in: number;
492
+ refresh_token: string;
493
+ user: {
494
+ id: string;
495
+ email: string;
496
+ email_verified: boolean;
497
+ };
498
+ };
499
+ };
500
+ };
501
+ };
502
+ };
503
+ }>;
504
+ pathSerializer?: import("openapi-fetch").PathSerializer;
505
+ parseAs?: import("openapi-fetch").ParseAs;
506
+ fetch?: import("openapi-fetch").ClientOptions["fetch"];
507
+ headers?: import("openapi-fetch").HeadersOptions;
508
+ middleware?: import("openapi-fetch").Middleware[];
509
+ } & Omit<RequestInit, "body" | "headers"> & {
510
+ [key: string]: unknown;
511
+ }) | undefined, `${string}/${string}`>>;
512
+ };
513
+ export type AnonymousApi = ReturnType<typeof anonymous>;
@@ -0,0 +1,9 @@
1
+ /** The `anonymous` plugin's routes as methods of `client.anonymous`. */
2
+ export function anonymous(client) {
3
+ return {
4
+ /** POST /anonymous/convert: Convert the guest into an account */
5
+ convert: (...init) => client.POST("/anonymous/convert", ...init),
6
+ /** POST /anonymous/sign-in: Sign in as a guest */
7
+ signIn: (...init) => client.POST("/anonymous/sign-in", ...init),
8
+ };
9
+ }