@authsome/ui-core 1.6.2 → 1.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/index.js CHANGED
@@ -1,10 +1,33 @@
1
1
  // src/generated/api-client.ts
2
+ function stripTrailingSlashes(url) {
3
+ let end = url.length;
4
+ while (end > 0 && url.charCodeAt(end - 1) === 47) {
5
+ end--;
6
+ }
7
+ return url.slice(0, end);
8
+ }
9
+ function encodeForm(body) {
10
+ const params = new URLSearchParams();
11
+ for (const [key, value] of Object.entries(body)) {
12
+ if (value === void 0 || value === null) {
13
+ continue;
14
+ }
15
+ if (Array.isArray(value)) {
16
+ for (const element of value) {
17
+ params.append(key, String(element));
18
+ }
19
+ continue;
20
+ }
21
+ params.set(key, String(value));
22
+ }
23
+ return params.toString();
24
+ }
2
25
  var AuthClient = class {
3
26
  baseURL;
4
27
  publishableKey;
5
28
  fetchFn;
6
29
  constructor(config) {
7
- this.baseURL = config.baseURL.replace(/\/+$/, "");
30
+ this.baseURL = stripTrailingSlashes(config.baseURL);
8
31
  this.publishableKey = config.publishableKey;
9
32
  this.fetchFn = config.fetch ?? globalThis.fetch.bind(globalThis);
10
33
  }
@@ -47,7 +70,7 @@ var AuthClient = class {
47
70
  * OpenID Connect Discovery
48
71
  * GET /.well-known/openid-configuration
49
72
  */
50
- async oidcDiscovery(token) {
73
+ async oidcDiscoveryPrefixed(token) {
51
74
  const path = "/.well-known/openid-configuration";
52
75
  return this.request(
53
76
  "GET",
@@ -73,12 +96,12 @@ var AuthClient = class {
73
96
  * Create SCIM Group
74
97
  * POST /scim/v2/Groups
75
98
  */
76
- async scimCreateGroup(body, token) {
99
+ async scimCreateGroup(token) {
77
100
  const path = "/scim/v2/Groups";
78
101
  return this.request(
79
102
  "POST",
80
103
  path,
81
- body,
104
+ void 0,
82
105
  token
83
106
  );
84
107
  }
@@ -99,12 +122,12 @@ var AuthClient = class {
99
122
  * Replace SCIM Group
100
123
  * PUT /scim/v2/Groups/{groupId}
101
124
  */
102
- async scimReplaceGroup(groupId, body, token) {
125
+ async scimReplaceGroup(groupId, token) {
103
126
  const path = `/scim/v2/Groups/${groupId}`;
104
127
  return this.request(
105
128
  "PUT",
106
129
  path,
107
- body,
130
+ void 0,
108
131
  token
109
132
  );
110
133
  }
@@ -112,12 +135,12 @@ var AuthClient = class {
112
135
  * Patch SCIM Group
113
136
  * PATCH /scim/v2/Groups/{groupId}
114
137
  */
115
- async scimPatchGroup(groupId, body, token) {
138
+ async scimPatchGroup(groupId, token) {
116
139
  const path = `/scim/v2/Groups/${groupId}`;
117
140
  return this.request(
118
141
  "PATCH",
119
142
  path,
120
- body,
143
+ void 0,
121
144
  token
122
145
  );
123
146
  }
@@ -125,12 +148,12 @@ var AuthClient = class {
125
148
  * Delete SCIM Group
126
149
  * DELETE /scim/v2/Groups/{groupId}
127
150
  */
128
- async scimDeleteGroup(groupId, body, token) {
151
+ async scimDeleteGroup(groupId, token) {
129
152
  const path = `/scim/v2/Groups/${groupId}`;
130
153
  return this.request(
131
154
  "DELETE",
132
155
  path,
133
- body,
156
+ void 0,
134
157
  token
135
158
  );
136
159
  }
@@ -190,12 +213,12 @@ var AuthClient = class {
190
213
  * Create SCIM User
191
214
  * POST /scim/v2/Users
192
215
  */
193
- async scimCreateUser(body, token) {
216
+ async scimCreateUser(token) {
194
217
  const path = "/scim/v2/Users";
195
218
  return this.request(
196
219
  "POST",
197
220
  path,
198
- body,
221
+ void 0,
199
222
  token
200
223
  );
201
224
  }
@@ -216,12 +239,12 @@ var AuthClient = class {
216
239
  * Replace SCIM User
217
240
  * PUT /scim/v2/Users/{userId}
218
241
  */
219
- async scimReplaceUser(userId, body, token) {
242
+ async scimReplaceUser(userId, token) {
220
243
  const path = `/scim/v2/Users/${userId}`;
221
244
  return this.request(
222
245
  "PUT",
223
246
  path,
224
- body,
247
+ void 0,
225
248
  token
226
249
  );
227
250
  }
@@ -229,12 +252,12 @@ var AuthClient = class {
229
252
  * Patch SCIM User
230
253
  * PATCH /scim/v2/Users/{userId}
231
254
  */
232
- async scimPatchUser(userId, body, token) {
255
+ async scimPatchUser(userId, token) {
233
256
  const path = `/scim/v2/Users/${userId}`;
234
257
  return this.request(
235
258
  "PATCH",
236
259
  path,
237
- body,
260
+ void 0,
238
261
  token
239
262
  );
240
263
  }
@@ -242,12 +265,12 @@ var AuthClient = class {
242
265
  * Delete SCIM User
243
266
  * DELETE /scim/v2/Users/{userId}
244
267
  */
245
- async scimDeleteUser(userId, body, token) {
268
+ async scimDeleteUser(userId, token) {
246
269
  const path = `/scim/v2/Users/${userId}`;
247
270
  return this.request(
248
271
  "DELETE",
249
272
  path,
250
- body,
273
+ void 0,
251
274
  token
252
275
  );
253
276
  }
@@ -268,12 +291,12 @@ var AuthClient = class {
268
291
  * Delete application (admin)
269
292
  * DELETE /v1/admin/apps/{appId}
270
293
  */
271
- async adminDeleteApp(appId, body, token) {
294
+ async adminDeleteApp(appId, token) {
272
295
  const path = `/v1/admin/apps/${appId}`;
273
296
  return this.request(
274
297
  "DELETE",
275
298
  path,
276
- body,
299
+ void 0,
277
300
  token
278
301
  );
279
302
  }
@@ -307,12 +330,12 @@ var AuthClient = class {
307
330
  * Delete per-app client config overrides
308
331
  * DELETE /v1/admin/apps/{appId}/client-config
309
332
  */
310
- async deleteAppClientConfig(appId, body, token) {
333
+ async deleteAppClientConfig(appId, token) {
311
334
  const path = `/v1/admin/apps/${appId}/client-config`;
312
335
  return this.request(
313
336
  "DELETE",
314
337
  path,
315
- body,
338
+ void 0,
316
339
  token
317
340
  );
318
341
  }
@@ -346,12 +369,12 @@ var AuthClient = class {
346
369
  * Delete per-app session config
347
370
  * DELETE /v1/admin/apps/{appId}/session-config
348
371
  */
349
- async deleteAppSessionConfig(appId, body, token) {
372
+ async deleteAppSessionConfig(appId, token) {
350
373
  const path = `/v1/admin/apps/${appId}/session-config`;
351
374
  return this.request(
352
375
  "DELETE",
353
376
  path,
354
- body,
377
+ void 0,
355
378
  token
356
379
  );
357
380
  }
@@ -359,12 +382,15 @@ var AuthClient = class {
359
382
  * Bulk revoke sessions (admin)
360
383
  * DELETE /v1/admin/bulk/sessions
361
384
  */
362
- async adminBulkRevokeSessions(body, token) {
363
- const path = "/v1/admin/bulk/sessions";
385
+ async adminBulkRevokeSessions(user_id, token) {
386
+ const params = new URLSearchParams();
387
+ if (user_id !== void 0) params.set("user_id", String(user_id));
388
+ const qs = params.toString();
389
+ const path = "/v1/admin/bulk/sessions" + (qs ? `?${qs}` : "");
364
390
  return this.request(
365
391
  "DELETE",
366
392
  path,
367
- body,
393
+ void 0,
368
394
  token
369
395
  );
370
396
  }
@@ -385,12 +411,12 @@ var AuthClient = class {
385
411
  * Stop impersonation (admin)
386
412
  * POST /v1/admin/impersonate/stop
387
413
  */
388
- async adminStopImpersonation(body, token) {
414
+ async adminStopImpersonation(token) {
389
415
  const path = "/v1/admin/impersonate/stop";
390
416
  return this.request(
391
417
  "POST",
392
418
  path,
393
- body,
419
+ void 0,
394
420
  token
395
421
  );
396
422
  }
@@ -398,12 +424,12 @@ var AuthClient = class {
398
424
  * Impersonate user (admin)
399
425
  * POST /v1/admin/impersonate/{userId}
400
426
  */
401
- async adminImpersonate(userId, body, token) {
427
+ async adminImpersonate(userId, token) {
402
428
  const path = `/v1/admin/impersonate/${userId}`;
403
429
  return this.request(
404
430
  "POST",
405
431
  path,
406
- body,
432
+ void 0,
407
433
  token
408
434
  );
409
435
  }
@@ -411,8 +437,11 @@ var AuthClient = class {
411
437
  * List OAuth2 clients
412
438
  * GET /v1/admin/oauth/clients
413
439
  */
414
- async listOAuth2Clients(token) {
415
- const path = "/v1/admin/oauth/clients";
440
+ async listOAuth2Clients(app_id, token) {
441
+ const params = new URLSearchParams();
442
+ if (app_id !== void 0) params.set("app_id", String(app_id));
443
+ const qs = params.toString();
444
+ const path = "/v1/admin/oauth/clients" + (qs ? `?${qs}` : "");
416
445
  return this.request(
417
446
  "GET",
418
447
  path,
@@ -433,16 +462,42 @@ var AuthClient = class {
433
462
  token
434
463
  );
435
464
  }
465
+ /**
466
+ * Update OAuth2 client
467
+ * PATCH /v1/admin/oauth/clients/{clientId}
468
+ */
469
+ async updateOAuth2Client(clientId, body, token) {
470
+ const path = `/v1/admin/oauth/clients/${clientId}`;
471
+ return this.request(
472
+ "PATCH",
473
+ path,
474
+ body,
475
+ token
476
+ );
477
+ }
436
478
  /**
437
479
  * Delete OAuth2 client
438
480
  * DELETE /v1/admin/oauth/clients/{clientId}
439
481
  */
440
- async deleteOAuth2Client(clientId, body, token) {
482
+ async deleteOAuth2Client(clientId, token) {
441
483
  const path = `/v1/admin/oauth/clients/${clientId}`;
442
484
  return this.request(
443
485
  "DELETE",
444
486
  path,
445
- body,
487
+ void 0,
488
+ token
489
+ );
490
+ }
491
+ /**
492
+ * Rotate OAuth2 client secret
493
+ * POST /v1/admin/oauth/clients/{clientId}/secret
494
+ */
495
+ async rotateOAuth2ClientSecret(clientId, token) {
496
+ const path = `/v1/admin/oauth/clients/${clientId}/secret`;
497
+ return this.request(
498
+ "POST",
499
+ path,
500
+ void 0,
446
501
  token
447
502
  );
448
503
  }
@@ -450,12 +505,16 @@ var AuthClient = class {
450
505
  * List organizations (admin)
451
506
  * GET /v1/admin/orgs
452
507
  */
453
- async adminListOrgs() {
454
- const path = "/v1/admin/orgs";
508
+ async adminListOrgs(app_id, token) {
509
+ const params = new URLSearchParams();
510
+ if (app_id !== void 0) params.set("app_id", String(app_id));
511
+ const qs = params.toString();
512
+ const path = "/v1/admin/orgs" + (qs ? `?${qs}` : "");
455
513
  return this.request(
456
514
  "GET",
457
515
  path,
458
- void 0
516
+ void 0,
517
+ token
459
518
  );
460
519
  }
461
520
  /**
@@ -475,12 +534,12 @@ var AuthClient = class {
475
534
  * Revoke platform-owner role (admin)
476
535
  * DELETE /v1/admin/platform/owners/{userID}
477
536
  */
478
- async adminRevokePlatformOwner(userID, body, token) {
537
+ async adminRevokePlatformOwner(userID, token) {
479
538
  const path = `/v1/admin/platform/owners/${userID}`;
480
539
  return this.request(
481
540
  "DELETE",
482
541
  path,
483
- body,
542
+ void 0,
484
543
  token
485
544
  );
486
545
  }
@@ -488,8 +547,13 @@ var AuthClient = class {
488
547
  * List service accounts (admin)
489
548
  * GET /v1/admin/service-accounts
490
549
  */
491
- async adminListServiceAccounts(token) {
492
- const path = "/v1/admin/service-accounts";
550
+ async adminListServiceAccounts(app_id, token, limit, cursor) {
551
+ const params = new URLSearchParams();
552
+ if (app_id !== void 0) params.set("app_id", String(app_id));
553
+ if (limit !== void 0) params.set("limit", String(limit));
554
+ if (cursor !== void 0) params.set("cursor", String(cursor));
555
+ const qs = params.toString();
556
+ const path = "/v1/admin/service-accounts" + (qs ? `?${qs}` : "");
493
557
  return this.request(
494
558
  "GET",
495
559
  path,
@@ -527,12 +591,12 @@ var AuthClient = class {
527
591
  * Delete service account (admin)
528
592
  * DELETE /v1/admin/service-accounts/{serviceAccountId}
529
593
  */
530
- async adminDeleteServiceAccount(serviceAccountId, body, token) {
594
+ async adminDeleteServiceAccount(serviceAccountId, token) {
531
595
  const path = `/v1/admin/service-accounts/${serviceAccountId}`;
532
596
  return this.request(
533
597
  "DELETE",
534
598
  path,
535
- body,
599
+ void 0,
536
600
  token
537
601
  );
538
602
  }
@@ -553,8 +617,12 @@ var AuthClient = class {
553
617
  * List all setting definitions
554
618
  * GET /v1/admin/settings/definitions
555
619
  */
556
- async listSettingsDefinitions(token) {
557
- const path = "/v1/admin/settings/definitions";
620
+ async listSettingsDefinitions(namespace, category, token) {
621
+ const params = new URLSearchParams();
622
+ if (namespace !== void 0) params.set("namespace", String(namespace));
623
+ if (category !== void 0) params.set("category", String(category));
624
+ const qs = params.toString();
625
+ const path = "/v1/admin/settings/definitions" + (qs ? `?${qs}` : "");
558
626
  return this.request(
559
627
  "GET",
560
628
  path,
@@ -592,12 +660,16 @@ var AuthClient = class {
592
660
  * Remove enforcement from a setting
593
661
  * DELETE /v1/admin/settings/enforce/{key}
594
662
  */
595
- async unenforceSetting(key, body, token) {
596
- const path = `/v1/admin/settings/enforce/${key}`;
663
+ async unenforceSetting(key, scope, scope_id, token) {
664
+ const params = new URLSearchParams();
665
+ if (scope !== void 0) params.set("scope", String(scope));
666
+ if (scope_id !== void 0) params.set("scope_id", String(scope_id));
667
+ const qs = params.toString();
668
+ const path = `/v1/admin/settings/enforce/${key}` + (qs ? `?${qs}` : "");
597
669
  return this.request(
598
670
  "DELETE",
599
671
  path,
600
- body,
672
+ void 0,
601
673
  token
602
674
  );
603
675
  }
@@ -605,8 +677,14 @@ var AuthClient = class {
605
677
  * Resolve all settings at a scope
606
678
  * GET /v1/admin/settings/resolve
607
679
  */
608
- async resolveSettings(token) {
609
- const path = "/v1/admin/settings/resolve";
680
+ async resolveSettings(namespace, app_id, org_id, user_id, token) {
681
+ const params = new URLSearchParams();
682
+ if (namespace !== void 0) params.set("namespace", String(namespace));
683
+ if (app_id !== void 0) params.set("app_id", String(app_id));
684
+ if (org_id !== void 0) params.set("org_id", String(org_id));
685
+ if (user_id !== void 0) params.set("user_id", String(user_id));
686
+ const qs = params.toString();
687
+ const path = "/v1/admin/settings/resolve" + (qs ? `?${qs}` : "");
610
688
  return this.request(
611
689
  "GET",
612
690
  path,
@@ -618,8 +696,13 @@ var AuthClient = class {
618
696
  * Resolve one setting with cascade details
619
697
  * GET /v1/admin/settings/resolve/{key}
620
698
  */
621
- async resolveSetting(key, token) {
622
- const path = `/v1/admin/settings/resolve/${key}`;
699
+ async resolveSetting(key, app_id, org_id, user_id, token) {
700
+ const params = new URLSearchParams();
701
+ if (app_id !== void 0) params.set("app_id", String(app_id));
702
+ if (org_id !== void 0) params.set("org_id", String(org_id));
703
+ if (user_id !== void 0) params.set("user_id", String(user_id));
704
+ const qs = params.toString();
705
+ const path = `/v1/admin/settings/resolve/${key}` + (qs ? `?${qs}` : "");
623
706
  return this.request(
624
707
  "GET",
625
708
  path,
@@ -644,12 +727,16 @@ var AuthClient = class {
644
727
  * Delete a setting override at a scope
645
728
  * DELETE /v1/admin/settings/values/{key}
646
729
  */
647
- async deleteSetting(key, body, token) {
648
- const path = `/v1/admin/settings/values/${key}`;
730
+ async deleteSetting(key, scope, scope_id, token) {
731
+ const params = new URLSearchParams();
732
+ if (scope !== void 0) params.set("scope", String(scope));
733
+ if (scope_id !== void 0) params.set("scope_id", String(scope_id));
734
+ const qs = params.toString();
735
+ const path = `/v1/admin/settings/values/${key}` + (qs ? `?${qs}` : "");
649
736
  return this.request(
650
737
  "DELETE",
651
738
  path,
652
- body,
739
+ void 0,
653
740
  token
654
741
  );
655
742
  }
@@ -786,8 +873,11 @@ var AuthClient = class {
786
873
  * Get stats (admin)
787
874
  * GET /v1/admin/stats
788
875
  */
789
- async adminGetStats(token) {
790
- const path = "/v1/admin/stats";
876
+ async adminGetStats(app_id, token) {
877
+ const params = new URLSearchParams();
878
+ if (app_id !== void 0) params.set("app_id", String(app_id));
879
+ const qs = params.toString();
880
+ const path = "/v1/admin/stats" + (qs ? `?${qs}` : "");
791
881
  return this.request(
792
882
  "GET",
793
883
  path,
@@ -799,8 +889,14 @@ var AuthClient = class {
799
889
  * List users (admin)
800
890
  * GET /v1/admin/users
801
891
  */
802
- async adminListUsers(token) {
803
- const path = "/v1/admin/users";
892
+ async adminListUsers(app_id, token, email, cursor, limit) {
893
+ const params = new URLSearchParams();
894
+ if (app_id !== void 0) params.set("app_id", String(app_id));
895
+ if (email !== void 0) params.set("email", String(email));
896
+ if (cursor !== void 0) params.set("cursor", String(cursor));
897
+ if (limit !== void 0) params.set("limit", String(limit));
898
+ const qs = params.toString();
899
+ const path = "/v1/admin/users" + (qs ? `?${qs}` : "");
804
900
  return this.request(
805
901
  "GET",
806
902
  path,
@@ -808,6 +904,19 @@ var AuthClient = class {
808
904
  token
809
905
  );
810
906
  }
907
+ /**
908
+ * Copy user to another app (admin)
909
+ * POST /v1/admin/users/copy
910
+ */
911
+ async adminCopyUser(body, token) {
912
+ const path = "/v1/admin/users/copy";
913
+ return this.request(
914
+ "POST",
915
+ path,
916
+ body,
917
+ token
918
+ );
919
+ }
811
920
  /**
812
921
  * Create user (admin)
813
922
  * POST /v1/admin/users/create
@@ -851,12 +960,12 @@ var AuthClient = class {
851
960
  * Delete user (admin)
852
961
  * DELETE /v1/admin/users/{userId}
853
962
  */
854
- async adminDeleteUser(userId, body, token) {
963
+ async adminDeleteUser(userId, token) {
855
964
  const path = `/v1/admin/users/${userId}`;
856
965
  return this.request(
857
966
  "DELETE",
858
967
  path,
859
- body,
968
+ void 0,
860
969
  token
861
970
  );
862
971
  }
@@ -877,12 +986,12 @@ var AuthClient = class {
877
986
  * Unban user (admin)
878
987
  * POST /v1/admin/users/{userId}/unban
879
988
  */
880
- async adminUnbanUser(userId, body, token) {
989
+ async adminUnbanUser(userId, token) {
881
990
  const path = `/v1/admin/users/${userId}/unban`;
882
991
  return this.request(
883
992
  "POST",
884
993
  path,
885
- body,
994
+ void 0,
886
995
  token
887
996
  );
888
997
  }
@@ -890,8 +999,11 @@ var AuthClient = class {
890
999
  * List coupons
891
1000
  * GET /v1/billing/coupons
892
1001
  */
893
- async listCoupons(token) {
894
- const path = "/v1/billing/coupons";
1002
+ async listCoupons(app_id, token) {
1003
+ const params = new URLSearchParams();
1004
+ if (app_id !== void 0) params.set("app_id", String(app_id));
1005
+ const qs = params.toString();
1006
+ const path = "/v1/billing/coupons" + (qs ? `?${qs}` : "");
895
1007
  return this.request(
896
1008
  "GET",
897
1009
  path,
@@ -916,12 +1028,12 @@ var AuthClient = class {
916
1028
  * Delete coupon
917
1029
  * DELETE /v1/billing/coupons/{couponId}
918
1030
  */
919
- async deleteCoupon(couponId, body, token) {
1031
+ async deleteCoupon(couponId, token) {
920
1032
  const path = `/v1/billing/coupons/${couponId}`;
921
1033
  return this.request(
922
1034
  "DELETE",
923
1035
  path,
924
- body,
1036
+ void 0,
925
1037
  token
926
1038
  );
927
1039
  }
@@ -942,8 +1054,12 @@ var AuthClient = class {
942
1054
  * List invoices
943
1055
  * GET /v1/billing/invoices
944
1056
  */
945
- async listInvoices(token) {
946
- const path = "/v1/billing/invoices";
1057
+ async listInvoices(app_id, tenant_id, token) {
1058
+ const params = new URLSearchParams();
1059
+ if (app_id !== void 0) params.set("app_id", String(app_id));
1060
+ if (tenant_id !== void 0) params.set("tenant_id", String(tenant_id));
1061
+ const qs = params.toString();
1062
+ const path = "/v1/billing/invoices" + (qs ? `?${qs}` : "");
947
1063
  return this.request(
948
1064
  "GET",
949
1065
  path,
@@ -994,8 +1110,11 @@ var AuthClient = class {
994
1110
  * List billing plans
995
1111
  * GET /v1/billing/plans
996
1112
  */
997
- async listBillingPlans(token) {
998
- const path = "/v1/billing/plans";
1113
+ async listBillingPlans(app_id, token) {
1114
+ const params = new URLSearchParams();
1115
+ if (app_id !== void 0) params.set("app_id", String(app_id));
1116
+ const qs = params.toString();
1117
+ const path = "/v1/billing/plans" + (qs ? `?${qs}` : "");
999
1118
  return this.request(
1000
1119
  "GET",
1001
1120
  path,
@@ -1033,12 +1152,12 @@ var AuthClient = class {
1033
1152
  * Activate a billing plan
1034
1153
  * POST /v1/billing/plans/{planId}/activate
1035
1154
  */
1036
- async activateBillingPlan(planId, body, token) {
1155
+ async activateBillingPlan(planId, token) {
1037
1156
  const path = `/v1/billing/plans/${planId}/activate`;
1038
1157
  return this.request(
1039
1158
  "POST",
1040
1159
  path,
1041
- body,
1160
+ void 0,
1042
1161
  token
1043
1162
  );
1044
1163
  }
@@ -1046,12 +1165,12 @@ var AuthClient = class {
1046
1165
  * Archive a billing plan
1047
1166
  * POST /v1/billing/plans/{planId}/archive
1048
1167
  */
1049
- async archiveBillingPlan(planId, body, token) {
1168
+ async archiveBillingPlan(planId, token) {
1050
1169
  const path = `/v1/billing/plans/${planId}/archive`;
1051
1170
  return this.request(
1052
1171
  "POST",
1053
1172
  path,
1054
- body,
1173
+ void 0,
1055
1174
  token
1056
1175
  );
1057
1176
  }
@@ -1059,8 +1178,13 @@ var AuthClient = class {
1059
1178
  * List subscriptions
1060
1179
  * GET /v1/billing/subscriptions
1061
1180
  */
1062
- async listSubscriptions(token) {
1063
- const path = "/v1/billing/subscriptions";
1181
+ async listSubscriptions(app_id, tenant_id, token, status) {
1182
+ const params = new URLSearchParams();
1183
+ if (app_id !== void 0) params.set("app_id", String(app_id));
1184
+ if (tenant_id !== void 0) params.set("tenant_id", String(tenant_id));
1185
+ if (status !== void 0) params.set("status", String(status));
1186
+ const qs = params.toString();
1187
+ const path = "/v1/billing/subscriptions" + (qs ? `?${qs}` : "");
1064
1188
  return this.request(
1065
1189
  "GET",
1066
1190
  path,
@@ -1085,8 +1209,12 @@ var AuthClient = class {
1085
1209
  * Get active subscription
1086
1210
  * GET /v1/billing/subscriptions/active
1087
1211
  */
1088
- async getActiveSubscription(token) {
1089
- const path = "/v1/billing/subscriptions/active";
1212
+ async getActiveSubscription(app_id, tenant_id, token) {
1213
+ const params = new URLSearchParams();
1214
+ if (app_id !== void 0) params.set("app_id", String(app_id));
1215
+ if (tenant_id !== void 0) params.set("tenant_id", String(tenant_id));
1216
+ const qs = params.toString();
1217
+ const path = "/v1/billing/subscriptions/active" + (qs ? `?${qs}` : "");
1090
1218
  return this.request(
1091
1219
  "GET",
1092
1220
  path,
@@ -1124,12 +1252,12 @@ var AuthClient = class {
1124
1252
  * Pause subscription
1125
1253
  * POST /v1/billing/subscriptions/{subId}/pause
1126
1254
  */
1127
- async pauseSubscription(subId, body, token) {
1255
+ async pauseSubscription(subId, token) {
1128
1256
  const path = `/v1/billing/subscriptions/${subId}/pause`;
1129
1257
  return this.request(
1130
1258
  "POST",
1131
1259
  path,
1132
- body,
1260
+ void 0,
1133
1261
  token
1134
1262
  );
1135
1263
  }
@@ -1137,12 +1265,12 @@ var AuthClient = class {
1137
1265
  * Resume subscription
1138
1266
  * POST /v1/billing/subscriptions/{subId}/resume
1139
1267
  */
1140
- async resumeSubscription(subId, body, token) {
1268
+ async resumeSubscription(subId, token) {
1141
1269
  const path = `/v1/billing/subscriptions/${subId}/resume`;
1142
1270
  return this.request(
1143
1271
  "POST",
1144
1272
  path,
1145
- body,
1273
+ void 0,
1146
1274
  token
1147
1275
  );
1148
1276
  }
@@ -1150,8 +1278,12 @@ var AuthClient = class {
1150
1278
  * Get usage summary
1151
1279
  * GET /v1/billing/usage
1152
1280
  */
1153
- async getUsageSummary(token) {
1154
- const path = "/v1/billing/usage";
1281
+ async getUsageSummary(app_id, tenant_id, token) {
1282
+ const params = new URLSearchParams();
1283
+ if (app_id !== void 0) params.set("app_id", String(app_id));
1284
+ if (tenant_id !== void 0) params.set("tenant_id", String(tenant_id));
1285
+ const qs = params.toString();
1286
+ const path = "/v1/billing/usage" + (qs ? `?${qs}` : "");
1155
1287
  return this.request(
1156
1288
  "GET",
1157
1289
  path,
@@ -1176,8 +1308,11 @@ var AuthClient = class {
1176
1308
  * Get client configuration
1177
1309
  * GET /v1/client-config
1178
1310
  */
1179
- async getClientConfig(token) {
1180
- const path = "/v1/client-config";
1311
+ async getClientConfig(token, key) {
1312
+ const params = new URLSearchParams();
1313
+ if (key !== void 0) params.set("key", String(key));
1314
+ const qs = params.toString();
1315
+ const path = "/v1/client-config" + (qs ? `?${qs}` : "");
1181
1316
  return this.request(
1182
1317
  "GET",
1183
1318
  path,
@@ -1189,36 +1324,44 @@ var AuthClient = class {
1189
1324
  * List consents
1190
1325
  * GET /v1/consent
1191
1326
  */
1192
- async listConsents() {
1193
- const path = "/v1/consent";
1327
+ async listConsents(purpose, cursor, limit, token) {
1328
+ const params = new URLSearchParams();
1329
+ if (purpose !== void 0) params.set("purpose", String(purpose));
1330
+ if (cursor !== void 0) params.set("cursor", String(cursor));
1331
+ if (limit !== void 0) params.set("limit", String(limit));
1332
+ const qs = params.toString();
1333
+ const path = "/v1/consent" + (qs ? `?${qs}` : "");
1194
1334
  return this.request(
1195
1335
  "GET",
1196
1336
  path,
1197
- void 0
1337
+ void 0,
1338
+ token
1198
1339
  );
1199
1340
  }
1200
1341
  /**
1201
1342
  * Grant consent
1202
1343
  * POST /v1/consent/grant
1203
1344
  */
1204
- async grantConsent(body) {
1345
+ async grantConsent(body, token) {
1205
1346
  const path = "/v1/consent/grant";
1206
1347
  return this.request(
1207
1348
  "POST",
1208
1349
  path,
1209
- body
1350
+ body,
1351
+ token
1210
1352
  );
1211
1353
  }
1212
1354
  /**
1213
1355
  * Revoke consent
1214
1356
  * POST /v1/consent/revoke
1215
1357
  */
1216
- async revokeConsent(body) {
1358
+ async revokeConsent(body, token) {
1217
1359
  const path = "/v1/consent/revoke";
1218
1360
  return this.request(
1219
1361
  "POST",
1220
1362
  path,
1221
- body
1363
+ body,
1364
+ token
1222
1365
  );
1223
1366
  }
1224
1367
  /**
@@ -1251,12 +1394,12 @@ var AuthClient = class {
1251
1394
  * Delete device
1252
1395
  * DELETE /v1/devices/{deviceId}
1253
1396
  */
1254
- async deleteDevice(deviceId, body, token) {
1397
+ async deleteDevice(deviceId, token) {
1255
1398
  const path = `/v1/devices/${deviceId}`;
1256
1399
  return this.request(
1257
1400
  "DELETE",
1258
1401
  path,
1259
- body,
1402
+ void 0,
1260
1403
  token
1261
1404
  );
1262
1405
  }
@@ -1264,12 +1407,12 @@ var AuthClient = class {
1264
1407
  * Trust device
1265
1408
  * PATCH /v1/devices/{deviceId}/trust
1266
1409
  */
1267
- async trustDevice(deviceId, body, token) {
1410
+ async trustDevice(deviceId, token) {
1268
1411
  const path = `/v1/devices/${deviceId}/trust`;
1269
1412
  return this.request(
1270
1413
  "PATCH",
1271
1414
  path,
1272
- body,
1415
+ void 0,
1273
1416
  token
1274
1417
  );
1275
1418
  }
@@ -1277,8 +1420,11 @@ var AuthClient = class {
1277
1420
  * List environments
1278
1421
  * GET /v1/environments
1279
1422
  */
1280
- async listEnvironments(token) {
1281
- const path = "/v1/environments";
1423
+ async listEnvironments(app_id, token) {
1424
+ const params = new URLSearchParams();
1425
+ if (app_id !== void 0) params.set("app_id", String(app_id));
1426
+ const qs = params.toString();
1427
+ const path = "/v1/environments" + (qs ? `?${qs}` : "");
1282
1428
  return this.request(
1283
1429
  "GET",
1284
1430
  path,
@@ -1430,8 +1576,12 @@ var AuthClient = class {
1430
1576
  * List API keys
1431
1577
  * GET /v1/keys
1432
1578
  */
1433
- async listAPIKeys(token) {
1434
- const path = "/v1/keys";
1579
+ async listAPIKeys(app_id, token, user_id) {
1580
+ const params = new URLSearchParams();
1581
+ if (app_id !== void 0) params.set("app_id", String(app_id));
1582
+ if (user_id !== void 0) params.set("user_id", String(user_id));
1583
+ const qs = params.toString();
1584
+ const path = "/v1/keys" + (qs ? `?${qs}` : "");
1435
1585
  return this.request(
1436
1586
  "GET",
1437
1587
  path,
@@ -1456,12 +1606,12 @@ var AuthClient = class {
1456
1606
  * Revoke API key
1457
1607
  * DELETE /v1/keys/{keyId}
1458
1608
  */
1459
- async revokeAPIKey(keyId, body, token) {
1609
+ async revokeAPIKey(keyId, token) {
1460
1610
  const path = `/v1/keys/${keyId}`;
1461
1611
  return this.request(
1462
1612
  "DELETE",
1463
1613
  path,
1464
- body,
1614
+ void 0,
1465
1615
  token
1466
1616
  );
1467
1617
  }
@@ -1519,12 +1669,12 @@ var AuthClient = class {
1519
1669
  * Delete account
1520
1670
  * DELETE /v1/me
1521
1671
  */
1522
- async deleteMe(body, token) {
1672
+ async deleteMe(token) {
1523
1673
  const path = "/v1/me";
1524
1674
  return this.request(
1525
1675
  "DELETE",
1526
1676
  path,
1527
- body,
1677
+ void 0,
1528
1678
  token
1529
1679
  );
1530
1680
  }
@@ -1545,12 +1695,12 @@ var AuthClient = class {
1545
1695
  * Unlink an auth method
1546
1696
  * DELETE /v1/me/auth-methods/{provider}
1547
1697
  */
1548
- async unlinkAuthMethod(provider, body, token) {
1698
+ async unlinkAuthMethod(provider, token) {
1549
1699
  const path = `/v1/me/auth-methods/${provider}`;
1550
1700
  return this.request(
1551
1701
  "DELETE",
1552
1702
  path,
1553
- body,
1703
+ void 0,
1554
1704
  token
1555
1705
  );
1556
1706
  }
@@ -1622,12 +1772,12 @@ var AuthClient = class {
1622
1772
  * Regenerate MFA recovery codes
1623
1773
  * POST /v1/mfa/recovery/regenerate
1624
1774
  */
1625
- async regenerateMFARecoveryCodes(body, token) {
1775
+ async regenerateMFARecoveryCodes(token) {
1626
1776
  const path = "/v1/mfa/recovery/regenerate";
1627
1777
  return this.request(
1628
1778
  "POST",
1629
1779
  path,
1630
- body,
1780
+ void 0,
1631
1781
  token
1632
1782
  );
1633
1783
  }
@@ -1685,8 +1835,18 @@ var AuthClient = class {
1685
1835
  * OAuth2 Authorization
1686
1836
  * GET /v1/oauth/authorize
1687
1837
  */
1688
- async oauth2Authorize() {
1689
- const path = "/v1/oauth/authorize";
1838
+ async oauth2Authorize(response_type, client_id, redirect_uri, scope, state, code_challenge, code_challenge_method, resource) {
1839
+ const params = new URLSearchParams();
1840
+ if (response_type !== void 0) params.set("response_type", String(response_type));
1841
+ if (client_id !== void 0) params.set("client_id", String(client_id));
1842
+ if (redirect_uri !== void 0) params.set("redirect_uri", String(redirect_uri));
1843
+ if (scope !== void 0) params.set("scope", String(scope));
1844
+ if (state !== void 0) params.set("state", String(state));
1845
+ if (code_challenge !== void 0) params.set("code_challenge", String(code_challenge));
1846
+ if (code_challenge_method !== void 0) params.set("code_challenge_method", String(code_challenge_method));
1847
+ if (resource !== void 0) for (const element of resource) params.append("resource", String(element));
1848
+ const qs = params.toString();
1849
+ const path = "/v1/oauth/authorize" + (qs ? `?${qs}` : "");
1690
1850
  return this.request(
1691
1851
  "GET",
1692
1852
  path,
@@ -1702,19 +1862,75 @@ var AuthClient = class {
1702
1862
  return this.request(
1703
1863
  "POST",
1704
1864
  path,
1705
- body
1865
+ body,
1866
+ void 0,
1867
+ true
1706
1868
  );
1707
1869
  }
1708
1870
  /**
1709
1871
  * Complete device authorization
1710
1872
  * POST /v1/oauth/device/complete
1711
1873
  */
1712
- async oauth2DeviceComplete(body) {
1874
+ async oauth2DeviceComplete(body, token) {
1713
1875
  const path = "/v1/oauth/device/complete";
1714
1876
  return this.request(
1715
1877
  "POST",
1716
1878
  path,
1717
- body
1879
+ body,
1880
+ token,
1881
+ true
1882
+ );
1883
+ }
1884
+ /**
1885
+ * Register OAuth2 client
1886
+ * POST /v1/oauth/register
1887
+ */
1888
+ async oauth2RegisterClient(body, token) {
1889
+ const path = "/v1/oauth/register";
1890
+ return this.request(
1891
+ "POST",
1892
+ path,
1893
+ body,
1894
+ token
1895
+ );
1896
+ }
1897
+ /**
1898
+ * Read OAuth2 client registration
1899
+ * GET /v1/oauth/register/{clientId}
1900
+ */
1901
+ async oauth2ReadRegistration(clientId, token) {
1902
+ const path = `/v1/oauth/register/${clientId}`;
1903
+ return this.request(
1904
+ "GET",
1905
+ path,
1906
+ void 0,
1907
+ token
1908
+ );
1909
+ }
1910
+ /**
1911
+ * Update OAuth2 client registration
1912
+ * PUT /v1/oauth/register/{clientId}
1913
+ */
1914
+ async oauth2UpdateRegistration(clientId, body, token) {
1915
+ const path = `/v1/oauth/register/${clientId}`;
1916
+ return this.request(
1917
+ "PUT",
1918
+ path,
1919
+ body,
1920
+ token
1921
+ );
1922
+ }
1923
+ /**
1924
+ * Delete OAuth2 client registration
1925
+ * DELETE /v1/oauth/register/{clientId}
1926
+ */
1927
+ async oauth2DeleteRegistration(clientId, token) {
1928
+ const path = `/v1/oauth/register/${clientId}`;
1929
+ return this.request(
1930
+ "DELETE",
1931
+ path,
1932
+ void 0,
1933
+ token
1718
1934
  );
1719
1935
  }
1720
1936
  /**
@@ -1727,7 +1943,8 @@ var AuthClient = class {
1727
1943
  "POST",
1728
1944
  path,
1729
1945
  body,
1730
- token
1946
+ token,
1947
+ true
1731
1948
  );
1732
1949
  }
1733
1950
  /**
@@ -1739,7 +1956,9 @@ var AuthClient = class {
1739
1956
  return this.request(
1740
1957
  "POST",
1741
1958
  path,
1742
- body
1959
+ body,
1960
+ void 0,
1961
+ true
1743
1962
  );
1744
1963
  }
1745
1964
  /**
@@ -1785,8 +2004,12 @@ var AuthClient = class {
1785
2004
  * Check slug availability
1786
2005
  * GET /v1/orgs/check-slug
1787
2006
  */
1788
- async checkOrgSlug(token) {
1789
- const path = "/v1/orgs/check-slug";
2007
+ async checkOrgSlug(app_id, slug, token) {
2008
+ const params = new URLSearchParams();
2009
+ if (app_id !== void 0) params.set("app_id", String(app_id));
2010
+ if (slug !== void 0) params.set("slug", String(slug));
2011
+ const qs = params.toString();
2012
+ const path = "/v1/orgs/check-slug" + (qs ? `?${qs}` : "");
1790
2013
  return this.request(
1791
2014
  "GET",
1792
2015
  path,
@@ -1850,12 +2073,12 @@ var AuthClient = class {
1850
2073
  * Delete organization
1851
2074
  * DELETE /v1/orgs/{orgId}
1852
2075
  */
1853
- async deleteOrganization(orgId, body, token) {
2076
+ async deleteOrganization(orgId, token) {
1854
2077
  const path = `/v1/orgs/${orgId}`;
1855
2078
  return this.request(
1856
2079
  "DELETE",
1857
2080
  path,
1858
- body,
2081
+ void 0,
1859
2082
  token
1860
2083
  );
1861
2084
  }
@@ -1928,12 +2151,12 @@ var AuthClient = class {
1928
2151
  * Remove member
1929
2152
  * DELETE /v1/orgs/{orgId}/members/{memberId}
1930
2153
  */
1931
- async removeMember(orgId, memberId, body, token) {
2154
+ async removeMember(orgId, memberId, token) {
1932
2155
  const path = `/v1/orgs/${orgId}/members/${memberId}`;
1933
2156
  return this.request(
1934
2157
  "DELETE",
1935
2158
  path,
1936
- body,
2159
+ void 0,
1937
2160
  token
1938
2161
  );
1939
2162
  }
@@ -1993,12 +2216,12 @@ var AuthClient = class {
1993
2216
  * Delete team
1994
2217
  * DELETE /v1/orgs/{orgId}/teams/{teamId}
1995
2218
  */
1996
- async deleteTeam(orgId, teamId, body, token) {
2219
+ async deleteTeam(orgId, teamId, token) {
1997
2220
  const path = `/v1/orgs/${orgId}/teams/${teamId}`;
1998
2221
  return this.request(
1999
2222
  "DELETE",
2000
2223
  path,
2001
- body,
2224
+ void 0,
2002
2225
  token
2003
2226
  );
2004
2227
  }
@@ -2019,12 +2242,12 @@ var AuthClient = class {
2019
2242
  * Begin passkey login
2020
2243
  * POST /v1/passkeys/login/begin
2021
2244
  */
2022
- async passkeyLoginBegin(body) {
2245
+ async passkeyLoginBegin() {
2023
2246
  const path = "/v1/passkeys/login/begin";
2024
2247
  return this.request(
2025
2248
  "POST",
2026
2249
  path,
2027
- body
2250
+ void 0
2028
2251
  );
2029
2252
  }
2030
2253
  /**
@@ -2069,12 +2292,12 @@ var AuthClient = class {
2069
2292
  * Delete passkey
2070
2293
  * DELETE /v1/passkeys/{credentialId}
2071
2294
  */
2072
- async deletePasskey(credentialId, body, token) {
2295
+ async deletePasskey(credentialId, token) {
2073
2296
  const path = `/v1/passkeys/${credentialId}`;
2074
2297
  return this.request(
2075
2298
  "DELETE",
2076
2299
  path,
2077
- body,
2300
+ void 0,
2078
2301
  token
2079
2302
  );
2080
2303
  }
@@ -2102,6 +2325,32 @@ var AuthClient = class {
2102
2325
  body
2103
2326
  );
2104
2327
  }
2328
+ /**
2329
+ * List what may act on your behalf
2330
+ * GET /v1/principals/me/delegations
2331
+ */
2332
+ async listMyDelegations(token) {
2333
+ const path = "/v1/principals/me/delegations";
2334
+ return this.request(
2335
+ "GET",
2336
+ path,
2337
+ void 0,
2338
+ token
2339
+ );
2340
+ }
2341
+ /**
2342
+ * Mint an ephemeral child principal
2343
+ * POST /v1/principals/{id}/children
2344
+ */
2345
+ async mintChildPrincipal(id, body, token) {
2346
+ const path = `/v1/principals/${id}/children`;
2347
+ return this.request(
2348
+ "POST",
2349
+ path,
2350
+ body,
2351
+ token
2352
+ );
2353
+ }
2105
2354
  /**
2106
2355
  * Refresh tokens
2107
2356
  * POST /v1/refresh
@@ -2130,8 +2379,11 @@ var AuthClient = class {
2130
2379
  * List roles
2131
2380
  * GET /v1/roles
2132
2381
  */
2133
- async authsomeListRoles(token) {
2134
- const path = "/v1/roles";
2382
+ async authsomeListRoles(app_id, token) {
2383
+ const params = new URLSearchParams();
2384
+ if (app_id !== void 0) params.set("app_id", String(app_id));
2385
+ const qs = params.toString();
2386
+ const path = "/v1/roles" + (qs ? `?${qs}` : "");
2135
2387
  return this.request(
2136
2388
  "GET",
2137
2389
  path,
@@ -2273,12 +2525,12 @@ var AuthClient = class {
2273
2525
  * Revoke session
2274
2526
  * DELETE /v1/sessions/{sessionId}
2275
2527
  */
2276
- async revokeSession(sessionId, body, token) {
2528
+ async revokeSession(sessionId, token) {
2277
2529
  const path = `/v1/sessions/${sessionId}`;
2278
2530
  return this.request(
2279
2531
  "DELETE",
2280
2532
  path,
2281
- body,
2533
+ void 0,
2282
2534
  token
2283
2535
  );
2284
2536
  }
@@ -2298,12 +2550,12 @@ var AuthClient = class {
2298
2550
  * Sign out
2299
2551
  * POST /v1/signout
2300
2552
  */
2301
- async signOut(body, token) {
2553
+ async signOut(token) {
2302
2554
  const path = "/v1/signout";
2303
2555
  return this.request(
2304
2556
  "POST",
2305
2557
  path,
2306
- body,
2558
+ void 0,
2307
2559
  token
2308
2560
  );
2309
2561
  }
@@ -2323,68 +2575,153 @@ var AuthClient = class {
2323
2575
  * Start OAuth flow
2324
2576
  * POST /v1/social/{provider}
2325
2577
  */
2326
- async startOAuth(provider, body) {
2327
- const path = `/v1/social/${provider}`;
2578
+ async startOAuth(provider, frontend_url, redirect_url) {
2579
+ const params = new URLSearchParams();
2580
+ if (frontend_url !== void 0) params.set("frontend_url", String(frontend_url));
2581
+ if (redirect_url !== void 0) params.set("redirect_url", String(redirect_url));
2582
+ const qs = params.toString();
2583
+ const path = `/v1/social/${provider}` + (qs ? `?${qs}` : "");
2328
2584
  return this.request(
2329
2585
  "POST",
2330
2586
  path,
2331
- body
2587
+ void 0
2332
2588
  );
2333
2589
  }
2334
2590
  /**
2335
2591
  * OAuth callback
2336
2592
  * GET /v1/social/{provider}/callback
2337
2593
  */
2338
- async oauthCallback(provider) {
2339
- const path = `/v1/social/${provider}/callback`;
2594
+ async oauthCallback(provider, state, code, error) {
2595
+ const params = new URLSearchParams();
2596
+ if (state !== void 0) params.set("state", String(state));
2597
+ if (code !== void 0) params.set("code", String(code));
2598
+ if (error !== void 0) params.set("error", String(error));
2599
+ const qs = params.toString();
2600
+ const path = `/v1/social/${provider}/callback` + (qs ? `?${qs}` : "");
2340
2601
  return this.request(
2341
2602
  "GET",
2342
2603
  path,
2343
2604
  void 0
2344
2605
  );
2345
2606
  }
2607
+ /**
2608
+ * Exchange SSO one-time code for a session
2609
+ * POST /v1/sso/exchange
2610
+ */
2611
+ async ssoExchange(body, token) {
2612
+ const path = "/v1/sso/exchange";
2613
+ return this.request(
2614
+ "POST",
2615
+ path,
2616
+ body,
2617
+ token
2618
+ );
2619
+ }
2620
+ /**
2621
+ * Start SSO login by email domain
2622
+ * POST /v1/sso/login
2623
+ */
2624
+ async startSSOLoginByDomain(body, token) {
2625
+ const path = "/v1/sso/login";
2626
+ return this.request(
2627
+ "POST",
2628
+ path,
2629
+ body,
2630
+ token
2631
+ );
2632
+ }
2346
2633
  /**
2347
2634
  * SSO SAML ACS endpoint
2348
2635
  * POST /v1/sso/{provider}/acs
2349
2636
  */
2350
- async ssoACS(provider, body) {
2637
+ async ssoACS(provider) {
2351
2638
  const path = `/v1/sso/${provider}/acs`;
2352
2639
  return this.request(
2353
2640
  "POST",
2354
2641
  path,
2355
- body
2642
+ void 0
2643
+ );
2644
+ }
2645
+ /**
2646
+ * SSO OIDC redirect landing
2647
+ * GET /v1/sso/{provider}/callback
2648
+ */
2649
+ async ssoOIDCRedirect(provider, token) {
2650
+ const path = `/v1/sso/${provider}/callback`;
2651
+ return this.request(
2652
+ "GET",
2653
+ path,
2654
+ void 0,
2655
+ token
2356
2656
  );
2357
2657
  }
2358
2658
  /**
2359
2659
  * SSO callback (OIDC)
2360
2660
  * POST /v1/sso/{provider}/callback
2361
2661
  */
2362
- async ssoCallback(provider, body) {
2363
- const path = `/v1/sso/${provider}/callback`;
2662
+ async ssoCallback(provider, state, code, error) {
2663
+ const params = new URLSearchParams();
2664
+ if (state !== void 0) params.set("state", String(state));
2665
+ if (code !== void 0) params.set("code", String(code));
2666
+ if (error !== void 0) params.set("error", String(error));
2667
+ const qs = params.toString();
2668
+ const path = `/v1/sso/${provider}/callback` + (qs ? `?${qs}` : "");
2364
2669
  return this.request(
2365
2670
  "POST",
2366
2671
  path,
2367
- body
2672
+ void 0
2368
2673
  );
2369
2674
  }
2370
2675
  /**
2371
2676
  * Start SSO login flow
2372
2677
  * POST /v1/sso/{provider}/login
2373
2678
  */
2374
- async startSSOLogin(provider, body) {
2375
- const path = `/v1/sso/${provider}/login`;
2679
+ async startSSOLogin(provider, return_url) {
2680
+ const params = new URLSearchParams();
2681
+ if (return_url !== void 0) params.set("return_url", String(return_url));
2682
+ const qs = params.toString();
2683
+ const path = `/v1/sso/${provider}/login` + (qs ? `?${qs}` : "");
2376
2684
  return this.request(
2377
2685
  "POST",
2378
2686
  path,
2379
- body
2687
+ void 0
2688
+ );
2689
+ }
2690
+ /**
2691
+ * SAML SP metadata
2692
+ * GET /v1/sso/{provider}/metadata
2693
+ */
2694
+ async ssoSPMetadata(provider, token) {
2695
+ const path = `/v1/sso/${provider}/metadata`;
2696
+ return this.request(
2697
+ "GET",
2698
+ path,
2699
+ void 0,
2700
+ token
2701
+ );
2702
+ }
2703
+ /**
2704
+ * Exchange a credential for a delegated session
2705
+ * POST /v1/token/exchange
2706
+ */
2707
+ async exchangeToken(body, token) {
2708
+ const path = "/v1/token/exchange";
2709
+ return this.request(
2710
+ "POST",
2711
+ path,
2712
+ body,
2713
+ token
2380
2714
  );
2381
2715
  }
2382
2716
  /**
2383
2717
  * List user roles
2384
2718
  * GET /v1/users/{userId}/roles
2385
2719
  */
2386
- async authsomeListUserRoles(userId, token) {
2387
- const path = `/v1/users/${userId}/roles`;
2720
+ async authsomeListUserRoles(userId, token, app_id) {
2721
+ const params = new URLSearchParams();
2722
+ if (app_id !== void 0) params.set("app_id", String(app_id));
2723
+ const qs = params.toString();
2724
+ const path = `/v1/users/${userId}/roles` + (qs ? `?${qs}` : "");
2388
2725
  return this.request(
2389
2726
  "GET",
2390
2727
  path,
@@ -2420,8 +2757,11 @@ var AuthClient = class {
2420
2757
  * List webhooks
2421
2758
  * GET /v1/webhooks
2422
2759
  */
2423
- async listWebhooks(token) {
2424
- const path = "/v1/webhooks";
2760
+ async listWebhooks(app_id, token) {
2761
+ const params = new URLSearchParams();
2762
+ if (app_id !== void 0) params.set("app_id", String(app_id));
2763
+ const qs = params.toString();
2764
+ const path = "/v1/webhooks" + (qs ? `?${qs}` : "");
2425
2765
  return this.request(
2426
2766
  "GET",
2427
2767
  path,
@@ -2472,21 +2812,21 @@ var AuthClient = class {
2472
2812
  * Delete webhook
2473
2813
  * DELETE /v1/webhooks/{webhookId}
2474
2814
  */
2475
- async deleteWebhook(webhookId, body, token) {
2815
+ async deleteWebhook(webhookId, token) {
2476
2816
  const path = `/v1/webhooks/${webhookId}`;
2477
2817
  return this.request(
2478
2818
  "DELETE",
2479
2819
  path,
2480
- body,
2820
+ void 0,
2481
2821
  token
2482
2822
  );
2483
2823
  }
2484
2824
  // ──────────────────────────────────────────────────
2485
2825
  // Internal request helper
2486
2826
  // ──────────────────────────────────────────────────
2487
- async request(method, path, body, token) {
2827
+ async request(method, path, body, token, form) {
2488
2828
  const headers = {
2489
- "Content-Type": "application/json",
2829
+ "Content-Type": form ? "application/x-www-form-urlencoded" : "application/json",
2490
2830
  "Accept": "application/json"
2491
2831
  };
2492
2832
  if (token) {
@@ -2498,7 +2838,7 @@ var AuthClient = class {
2498
2838
  const response = await this.fetchFn(`${this.baseURL}${path}`, {
2499
2839
  method,
2500
2840
  headers,
2501
- body: body !== void 0 ? JSON.stringify(body) : void 0
2841
+ body: body !== void 0 ? form ? encodeForm(body) : JSON.stringify(body) : void 0
2502
2842
  });
2503
2843
  if (!response.ok) {
2504
2844
  let apiError;
@@ -2557,14 +2897,16 @@ var AuthClient2 = class extends AuthClient {
2557
2897
  /**
2558
2898
  * Sign out.
2559
2899
  *
2560
- * Accepts a raw token string (used by auth.ts) or the full
2561
- * (body, token) pair from the generated client.
2900
+ * Accepts a raw token string (used by auth.ts). The generated client used
2901
+ * to take a (body, token) pair; the endpoint no longer reads a body, so the
2902
+ * two-argument form is still accepted and its first argument ignored rather
2903
+ * than breaking callers outside this package.
2562
2904
  */
2563
2905
  async signOut(bodyOrToken, token) {
2564
2906
  if (typeof bodyOrToken === "string") {
2565
- return super.signOut({}, bodyOrToken);
2907
+ return super.signOut(bodyOrToken);
2566
2908
  }
2567
- return super.signOut(bodyOrToken, token);
2909
+ return super.signOut(token);
2568
2910
  }
2569
2911
  /**
2570
2912
  * MFA challenge — bridge for auth.ts.