auth0 7.6.0 → 7.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.
Files changed (70) hide show
  1. package/dist/cjs/management/Client.d.ts +3 -0
  2. package/dist/cjs/management/Client.js +45 -40
  3. package/dist/cjs/management/api/requests/requests.d.ts +48 -2
  4. package/dist/cjs/management/api/resources/clients/client/Client.d.ts +1 -0
  5. package/dist/cjs/management/api/resources/clients/client/Client.js +3 -1
  6. package/dist/cjs/management/api/resources/connections/resources/keys/client/Client.d.ts +3 -3
  7. package/dist/cjs/management/api/resources/connections/resources/keys/client/Client.js +3 -3
  8. package/dist/cjs/management/api/resources/experimentation/resources/segments/client/Client.d.ts +2 -1
  9. package/dist/cjs/management/api/resources/experimentation/resources/segments/client/Client.js +4 -2
  10. package/dist/cjs/management/api/resources/index.d.ts +1 -0
  11. package/dist/cjs/management/api/resources/index.js +2 -1
  12. package/dist/cjs/management/api/resources/portals/client/Client.d.ts +112 -0
  13. package/dist/cjs/management/api/resources/portals/client/Client.js +395 -0
  14. package/dist/cjs/management/api/resources/portals/client/index.d.ts +1 -0
  15. package/dist/cjs/management/api/resources/portals/client/index.js +2 -0
  16. package/dist/cjs/management/api/resources/portals/exports.d.ts +2 -0
  17. package/dist/cjs/management/api/resources/portals/exports.js +21 -0
  18. package/dist/cjs/management/api/resources/portals/index.d.ts +1 -0
  19. package/dist/cjs/management/api/resources/portals/index.js +17 -0
  20. package/dist/cjs/management/api/resources/users/client/Client.d.ts +57 -0
  21. package/dist/cjs/management/api/resources/users/client/Client.js +185 -0
  22. package/dist/cjs/management/api/types/types.d.ts +461 -4
  23. package/dist/cjs/management/api/types/types.js +92 -22
  24. package/dist/cjs/management/version.d.ts +1 -1
  25. package/dist/cjs/management/version.js +1 -1
  26. package/dist/cjs/management/wrapper/ManagementClient.d.ts +4 -1
  27. package/dist/cjs/management/wrapper/ManagementClient.js +2 -1
  28. package/dist/cjs/management/wrapper/auth-helpers.d.ts +3 -0
  29. package/dist/cjs/management/wrapper/auth-helpers.js +5 -0
  30. package/dist/cjs/management/wrapper/domain.d.ts +12 -0
  31. package/dist/cjs/management/wrapper/domain.js +28 -0
  32. package/dist/cjs/management/wrapper/management-auth.d.ts +2 -1
  33. package/dist/cjs/management/wrapper/management-auth.js +2 -1
  34. package/dist/cjs/management/wrapper/token-provider.js +4 -4
  35. package/dist/esm/management/Client.d.mts +3 -0
  36. package/dist/esm/management/Client.mjs +5 -0
  37. package/dist/esm/management/api/requests/requests.d.mts +48 -2
  38. package/dist/esm/management/api/resources/clients/client/Client.d.mts +1 -0
  39. package/dist/esm/management/api/resources/clients/client/Client.mjs +3 -1
  40. package/dist/esm/management/api/resources/connections/resources/keys/client/Client.d.mts +3 -3
  41. package/dist/esm/management/api/resources/connections/resources/keys/client/Client.mjs +3 -3
  42. package/dist/esm/management/api/resources/experimentation/resources/segments/client/Client.d.mts +2 -1
  43. package/dist/esm/management/api/resources/experimentation/resources/segments/client/Client.mjs +4 -2
  44. package/dist/esm/management/api/resources/index.d.mts +1 -0
  45. package/dist/esm/management/api/resources/index.mjs +1 -0
  46. package/dist/esm/management/api/resources/portals/client/Client.d.mts +112 -0
  47. package/dist/esm/management/api/resources/portals/client/Client.mjs +358 -0
  48. package/dist/esm/management/api/resources/portals/client/index.d.mts +1 -0
  49. package/dist/esm/management/api/resources/portals/client/index.mjs +1 -0
  50. package/dist/esm/management/api/resources/portals/exports.d.mts +2 -0
  51. package/dist/esm/management/api/resources/portals/exports.mjs +3 -0
  52. package/dist/esm/management/api/resources/portals/index.d.mts +1 -0
  53. package/dist/esm/management/api/resources/portals/index.mjs +1 -0
  54. package/dist/esm/management/api/resources/users/client/Client.d.mts +57 -0
  55. package/dist/esm/management/api/resources/users/client/Client.mjs +185 -0
  56. package/dist/esm/management/api/types/types.d.mts +461 -4
  57. package/dist/esm/management/api/types/types.mjs +70 -1
  58. package/dist/esm/management/version.d.mts +1 -1
  59. package/dist/esm/management/version.mjs +1 -1
  60. package/dist/esm/management/wrapper/ManagementClient.d.mts +4 -1
  61. package/dist/esm/management/wrapper/ManagementClient.mjs +3 -2
  62. package/dist/esm/management/wrapper/auth-helpers.d.mts +3 -0
  63. package/dist/esm/management/wrapper/auth-helpers.mjs +5 -0
  64. package/dist/esm/management/wrapper/domain.d.mts +12 -0
  65. package/dist/esm/management/wrapper/domain.mjs +25 -0
  66. package/dist/esm/management/wrapper/management-auth.d.mts +2 -1
  67. package/dist/esm/management/wrapper/management-auth.mjs +2 -1
  68. package/dist/esm/management/wrapper/token-provider.mjs +4 -4
  69. package/package.json +12 -1
  70. package/reference.md +462 -3
@@ -0,0 +1,358 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
12
+ import * as core from "../../../../core/index.mjs";
13
+ import { mergeHeaders } from "../../../../core/headers.mjs";
14
+ import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.mjs";
15
+ import * as environments from "../../../../environments.mjs";
16
+ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
17
+ import * as errors from "../../../../errors/index.mjs";
18
+ import * as Management from "../../../index.mjs";
19
+ export class PortalsClient {
20
+ constructor(options) {
21
+ this._options = normalizeClientOptionsWithAuth(options);
22
+ }
23
+ /**
24
+ * @param {PortalsClient.RequestOptions} requestOptions - Request-specific configuration.
25
+ *
26
+ * @throws {@link Management.UnauthorizedError}
27
+ * @throws {@link Management.ForbiddenError}
28
+ * @throws {@link Management.NotFoundError}
29
+ * @throws {@link Management.TooManyRequestsError}
30
+ * @throws {@link Management.InternalServerError}
31
+ * @throws {@link errors.ManagementError}
32
+ * @throws {@link errors.ManagementTimeoutError}
33
+ *
34
+ * @example
35
+ * await client.portals.list()
36
+ */
37
+ list(requestOptions) {
38
+ return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
39
+ }
40
+ __list(requestOptions) {
41
+ return __awaiter(this, void 0, void 0, function* () {
42
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
43
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
44
+ let _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
45
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
46
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ManagementEnvironment.Default, "portals"),
47
+ method: "GET",
48
+ headers: _headers,
49
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
50
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
51
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
52
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
53
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
54
+ logging: this._options.logging,
55
+ });
56
+ if (_response.ok) {
57
+ return {
58
+ data: _response.body,
59
+ rawResponse: _response.rawResponse,
60
+ };
61
+ }
62
+ if (_response.error.reason === "status-code") {
63
+ switch (_response.error.statusCode) {
64
+ case 401:
65
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
66
+ case 403:
67
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
68
+ case 404:
69
+ throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
70
+ case 429:
71
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
72
+ case 500:
73
+ throw new Management.InternalServerError(_response.error.body, _response.rawResponse);
74
+ default:
75
+ throw new errors.ManagementError({
76
+ statusCode: _response.error.statusCode,
77
+ body: _response.error.body,
78
+ rawResponse: _response.rawResponse,
79
+ });
80
+ }
81
+ }
82
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/portals");
83
+ });
84
+ }
85
+ /**
86
+ * @param {Management.CreatePortalRequestContent} request
87
+ * @param {PortalsClient.RequestOptions} requestOptions - Request-specific configuration.
88
+ *
89
+ * @throws {@link Management.BadRequestError}
90
+ * @throws {@link Management.UnauthorizedError}
91
+ * @throws {@link Management.ForbiddenError}
92
+ * @throws {@link Management.NotFoundError}
93
+ * @throws {@link Management.ConflictError}
94
+ * @throws {@link Management.TooManyRequestsError}
95
+ * @throws {@link Management.InternalServerError}
96
+ * @throws {@link errors.ManagementError}
97
+ * @throws {@link errors.ManagementTimeoutError}
98
+ *
99
+ * @example
100
+ * await client.portals.create({
101
+ * slug: "slug",
102
+ * name: "name",
103
+ * client: {
104
+ * token_endpoint_auth_method: "client_secret_post",
105
+ * client_id: "client_id",
106
+ * client_secret: "client_secret"
107
+ * }
108
+ * })
109
+ */
110
+ create(request, requestOptions) {
111
+ return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
112
+ }
113
+ __create(request, requestOptions) {
114
+ return __awaiter(this, void 0, void 0, function* () {
115
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
116
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
117
+ let _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
118
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
119
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ManagementEnvironment.Default, "portals"),
120
+ method: "POST",
121
+ headers: _headers,
122
+ contentType: "application/json",
123
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
124
+ requestType: "json",
125
+ body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
126
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
127
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
128
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
129
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
130
+ logging: this._options.logging,
131
+ });
132
+ if (_response.ok) {
133
+ return { data: _response.body, rawResponse: _response.rawResponse };
134
+ }
135
+ if (_response.error.reason === "status-code") {
136
+ switch (_response.error.statusCode) {
137
+ case 400:
138
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
139
+ case 401:
140
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
141
+ case 403:
142
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
143
+ case 404:
144
+ throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
145
+ case 409:
146
+ throw new Management.ConflictError(_response.error.body, _response.rawResponse);
147
+ case 429:
148
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
149
+ case 500:
150
+ throw new Management.InternalServerError(_response.error.body, _response.rawResponse);
151
+ default:
152
+ throw new errors.ManagementError({
153
+ statusCode: _response.error.statusCode,
154
+ body: _response.error.body,
155
+ rawResponse: _response.rawResponse,
156
+ });
157
+ }
158
+ }
159
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/portals");
160
+ });
161
+ }
162
+ /**
163
+ * @param {Management.PortalId} id
164
+ * @param {PortalsClient.RequestOptions} requestOptions - Request-specific configuration.
165
+ *
166
+ * @throws {@link Management.BadRequestError}
167
+ * @throws {@link Management.UnauthorizedError}
168
+ * @throws {@link Management.ForbiddenError}
169
+ * @throws {@link Management.NotFoundError}
170
+ * @throws {@link Management.TooManyRequestsError}
171
+ * @throws {@link Management.InternalServerError}
172
+ * @throws {@link errors.ManagementError}
173
+ * @throws {@link errors.ManagementTimeoutError}
174
+ *
175
+ * @example
176
+ * await client.portals.get("id")
177
+ */
178
+ get(id, requestOptions) {
179
+ return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions));
180
+ }
181
+ __get(id, requestOptions) {
182
+ return __awaiter(this, void 0, void 0, function* () {
183
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
184
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
185
+ let _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
186
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
187
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ManagementEnvironment.Default, `portals/${core.url.encodePathParam(id, errors.ManagementError)}`),
188
+ method: "GET",
189
+ headers: _headers,
190
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
191
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
192
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
193
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
194
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
195
+ logging: this._options.logging,
196
+ });
197
+ if (_response.ok) {
198
+ return { data: _response.body, rawResponse: _response.rawResponse };
199
+ }
200
+ if (_response.error.reason === "status-code") {
201
+ switch (_response.error.statusCode) {
202
+ case 400:
203
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
204
+ case 401:
205
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
206
+ case 403:
207
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
208
+ case 404:
209
+ throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
210
+ case 429:
211
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
212
+ case 500:
213
+ throw new Management.InternalServerError(_response.error.body, _response.rawResponse);
214
+ default:
215
+ throw new errors.ManagementError({
216
+ statusCode: _response.error.statusCode,
217
+ body: _response.error.body,
218
+ rawResponse: _response.rawResponse,
219
+ });
220
+ }
221
+ }
222
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/portals/{id}");
223
+ });
224
+ }
225
+ /**
226
+ * @param {Management.PortalId} id
227
+ * @param {PortalsClient.RequestOptions} requestOptions - Request-specific configuration.
228
+ *
229
+ * @throws {@link Management.BadRequestError}
230
+ * @throws {@link Management.UnauthorizedError}
231
+ * @throws {@link Management.ForbiddenError}
232
+ * @throws {@link Management.NotFoundError}
233
+ * @throws {@link Management.TooManyRequestsError}
234
+ * @throws {@link Management.InternalServerError}
235
+ * @throws {@link errors.ManagementError}
236
+ * @throws {@link errors.ManagementTimeoutError}
237
+ *
238
+ * @example
239
+ * await client.portals.delete("id")
240
+ */
241
+ delete(id, requestOptions) {
242
+ return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions));
243
+ }
244
+ __delete(id, requestOptions) {
245
+ return __awaiter(this, void 0, void 0, function* () {
246
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
247
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
248
+ let _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
249
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
250
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ManagementEnvironment.Default, `portals/${core.url.encodePathParam(id, errors.ManagementError)}`),
251
+ method: "DELETE",
252
+ headers: _headers,
253
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
254
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
255
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
256
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
257
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
258
+ logging: this._options.logging,
259
+ });
260
+ if (_response.ok) {
261
+ return { data: undefined, rawResponse: _response.rawResponse };
262
+ }
263
+ if (_response.error.reason === "status-code") {
264
+ switch (_response.error.statusCode) {
265
+ case 400:
266
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
267
+ case 401:
268
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
269
+ case 403:
270
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
271
+ case 404:
272
+ throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
273
+ case 429:
274
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
275
+ case 500:
276
+ throw new Management.InternalServerError(_response.error.body, _response.rawResponse);
277
+ default:
278
+ throw new errors.ManagementError({
279
+ statusCode: _response.error.statusCode,
280
+ body: _response.error.body,
281
+ rawResponse: _response.rawResponse,
282
+ });
283
+ }
284
+ }
285
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/portals/{id}");
286
+ });
287
+ }
288
+ /**
289
+ * @param {Management.PortalId} id
290
+ * @param {Management.UpdatePortalRequestContent} request
291
+ * @param {PortalsClient.RequestOptions} requestOptions - Request-specific configuration.
292
+ *
293
+ * @throws {@link Management.BadRequestError}
294
+ * @throws {@link Management.UnauthorizedError}
295
+ * @throws {@link Management.ForbiddenError}
296
+ * @throws {@link Management.NotFoundError}
297
+ * @throws {@link Management.ConflictError}
298
+ * @throws {@link Management.TooManyRequestsError}
299
+ * @throws {@link Management.InternalServerError}
300
+ * @throws {@link errors.ManagementError}
301
+ * @throws {@link errors.ManagementTimeoutError}
302
+ *
303
+ * @example
304
+ * await client.portals.update("id")
305
+ */
306
+ update(id, request = {}, requestOptions) {
307
+ return core.HttpResponsePromise.fromPromise(this.__update(id, request, requestOptions));
308
+ }
309
+ __update(id_1) {
310
+ return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
311
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
312
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
313
+ let _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
314
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
315
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ManagementEnvironment.Default, `portals/${core.url.encodePathParam(id, errors.ManagementError)}`),
316
+ method: "PATCH",
317
+ headers: _headers,
318
+ contentType: "application/json",
319
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
320
+ requestType: "json",
321
+ body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
322
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
323
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
324
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
325
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
326
+ logging: this._options.logging,
327
+ });
328
+ if (_response.ok) {
329
+ return { data: _response.body, rawResponse: _response.rawResponse };
330
+ }
331
+ if (_response.error.reason === "status-code") {
332
+ switch (_response.error.statusCode) {
333
+ case 400:
334
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
335
+ case 401:
336
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
337
+ case 403:
338
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
339
+ case 404:
340
+ throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
341
+ case 409:
342
+ throw new Management.ConflictError(_response.error.body, _response.rawResponse);
343
+ case 429:
344
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
345
+ case 500:
346
+ throw new Management.InternalServerError(_response.error.body, _response.rawResponse);
347
+ default:
348
+ throw new errors.ManagementError({
349
+ statusCode: _response.error.statusCode,
350
+ body: _response.error.body,
351
+ rawResponse: _response.rawResponse,
352
+ });
353
+ }
354
+ }
355
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/portals/{id}");
356
+ });
357
+ }
358
+ }
@@ -0,0 +1,2 @@
1
+ export { PortalsClient } from "./client/Client.mjs";
2
+ export * from "./client/index.mjs";
@@ -0,0 +1,3 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export { PortalsClient } from "./client/Client.mjs";
3
+ export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -302,6 +302,63 @@ export declare class UsersClient {
302
302
  */
303
303
  update(id: string, request?: Management.UpdateUserRequestContent, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<Management.UpdateUserResponseContent>;
304
304
  private __update;
305
+ /**
306
+ * Retrieve all consent signing keys registered for a user. Returns an empty `keys` array when the user has no keys registered.
307
+ *
308
+ * @param {string} id - The ID of the user.
309
+ * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
310
+ *
311
+ * @throws {@link Management.BadRequestError}
312
+ * @throws {@link Management.UnauthorizedError}
313
+ * @throws {@link Management.ForbiddenError}
314
+ * @throws {@link Management.TooManyRequestsError}
315
+ * @throws {@link errors.ManagementError}
316
+ * @throws {@link errors.ManagementTimeoutError}
317
+ *
318
+ * @example
319
+ * await client.users.listConsentSigningKeys("id")
320
+ */
321
+ listConsentSigningKeys(id: string, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<Management.ListUserConsentSigningKeysResponseContent>;
322
+ private __listConsentSigningKeys;
323
+ /**
324
+ * Retrieve a single consent signing key for a user by its key identifier (kid). Returns 404 if the key does not exist.
325
+ *
326
+ * @param {string} id - The ID of the user.
327
+ * @param {string} kid - The key identifier of the consent signing key.
328
+ * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
329
+ *
330
+ * @throws {@link Management.BadRequestError}
331
+ * @throws {@link Management.UnauthorizedError}
332
+ * @throws {@link Management.ForbiddenError}
333
+ * @throws {@link Management.NotFoundError}
334
+ * @throws {@link Management.TooManyRequestsError}
335
+ * @throws {@link errors.ManagementError}
336
+ * @throws {@link errors.ManagementTimeoutError}
337
+ *
338
+ * @example
339
+ * await client.users.getConsentSigningKey("id", "kid")
340
+ */
341
+ getConsentSigningKey(id: string, kid: string, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<Management.ConsentSigningKey>;
342
+ private __getConsentSigningKey;
343
+ /**
344
+ * Remove a single consent signing key for a user by its key identifier (kid). The operation is idempotent and returns 204 whether or not the key existed.
345
+ *
346
+ * @param {string} id - The ID of the user.
347
+ * @param {string} kid - The key identifier of the consent signing key.
348
+ * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
349
+ *
350
+ * @throws {@link Management.BadRequestError}
351
+ * @throws {@link Management.UnauthorizedError}
352
+ * @throws {@link Management.ForbiddenError}
353
+ * @throws {@link Management.TooManyRequestsError}
354
+ * @throws {@link errors.ManagementError}
355
+ * @throws {@link errors.ManagementTimeoutError}
356
+ *
357
+ * @example
358
+ * await client.users.deleteConsentSigningKey("id", "kid")
359
+ */
360
+ deleteConsentSigningKey(id: string, kid: string, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<void>;
361
+ private __deleteConsentSigningKey;
305
362
  /**
306
363
  * Remove an existing multi-factor authentication (MFA) [recovery code](https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa) and generate a new one. If a user cannot access the original device or account used for MFA enrollment, they can use a recovery code to authenticate.
307
364
  *
@@ -664,6 +664,191 @@ export class UsersClient {
664
664
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/users/{id}");
665
665
  });
666
666
  }
667
+ /**
668
+ * Retrieve all consent signing keys registered for a user. Returns an empty `keys` array when the user has no keys registered.
669
+ *
670
+ * @param {string} id - The ID of the user.
671
+ * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
672
+ *
673
+ * @throws {@link Management.BadRequestError}
674
+ * @throws {@link Management.UnauthorizedError}
675
+ * @throws {@link Management.ForbiddenError}
676
+ * @throws {@link Management.TooManyRequestsError}
677
+ * @throws {@link errors.ManagementError}
678
+ * @throws {@link errors.ManagementTimeoutError}
679
+ *
680
+ * @example
681
+ * await client.users.listConsentSigningKeys("id")
682
+ */
683
+ listConsentSigningKeys(id, requestOptions) {
684
+ return core.HttpResponsePromise.fromPromise(this.__listConsentSigningKeys(id, requestOptions));
685
+ }
686
+ __listConsentSigningKeys(id, requestOptions) {
687
+ return __awaiter(this, void 0, void 0, function* () {
688
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
689
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
690
+ let _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
691
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
692
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ManagementEnvironment.Default, `users/${core.url.encodePathParam(id, errors.ManagementError)}/consent-signing-keys`),
693
+ method: "GET",
694
+ headers: _headers,
695
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
696
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
697
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
698
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
699
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
700
+ logging: this._options.logging,
701
+ });
702
+ if (_response.ok) {
703
+ return {
704
+ data: _response.body,
705
+ rawResponse: _response.rawResponse,
706
+ };
707
+ }
708
+ if (_response.error.reason === "status-code") {
709
+ switch (_response.error.statusCode) {
710
+ case 400:
711
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
712
+ case 401:
713
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
714
+ case 403:
715
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
716
+ case 429:
717
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
718
+ default:
719
+ throw new errors.ManagementError({
720
+ statusCode: _response.error.statusCode,
721
+ body: _response.error.body,
722
+ rawResponse: _response.rawResponse,
723
+ });
724
+ }
725
+ }
726
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/users/{id}/consent-signing-keys");
727
+ });
728
+ }
729
+ /**
730
+ * Retrieve a single consent signing key for a user by its key identifier (kid). Returns 404 if the key does not exist.
731
+ *
732
+ * @param {string} id - The ID of the user.
733
+ * @param {string} kid - The key identifier of the consent signing key.
734
+ * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
735
+ *
736
+ * @throws {@link Management.BadRequestError}
737
+ * @throws {@link Management.UnauthorizedError}
738
+ * @throws {@link Management.ForbiddenError}
739
+ * @throws {@link Management.NotFoundError}
740
+ * @throws {@link Management.TooManyRequestsError}
741
+ * @throws {@link errors.ManagementError}
742
+ * @throws {@link errors.ManagementTimeoutError}
743
+ *
744
+ * @example
745
+ * await client.users.getConsentSigningKey("id", "kid")
746
+ */
747
+ getConsentSigningKey(id, kid, requestOptions) {
748
+ return core.HttpResponsePromise.fromPromise(this.__getConsentSigningKey(id, kid, requestOptions));
749
+ }
750
+ __getConsentSigningKey(id, kid, requestOptions) {
751
+ return __awaiter(this, void 0, void 0, function* () {
752
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
753
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
754
+ let _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
755
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
756
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ManagementEnvironment.Default, `users/${core.url.encodePathParam(id, errors.ManagementError)}/consent-signing-keys/${core.url.encodePathParam(kid, errors.ManagementError)}`),
757
+ method: "GET",
758
+ headers: _headers,
759
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
760
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
761
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
762
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
763
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
764
+ logging: this._options.logging,
765
+ });
766
+ if (_response.ok) {
767
+ return { data: _response.body, rawResponse: _response.rawResponse };
768
+ }
769
+ if (_response.error.reason === "status-code") {
770
+ switch (_response.error.statusCode) {
771
+ case 400:
772
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
773
+ case 401:
774
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
775
+ case 403:
776
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
777
+ case 404:
778
+ throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
779
+ case 429:
780
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
781
+ default:
782
+ throw new errors.ManagementError({
783
+ statusCode: _response.error.statusCode,
784
+ body: _response.error.body,
785
+ rawResponse: _response.rawResponse,
786
+ });
787
+ }
788
+ }
789
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/users/{id}/consent-signing-keys/{kid}");
790
+ });
791
+ }
792
+ /**
793
+ * Remove a single consent signing key for a user by its key identifier (kid). The operation is idempotent and returns 204 whether or not the key existed.
794
+ *
795
+ * @param {string} id - The ID of the user.
796
+ * @param {string} kid - The key identifier of the consent signing key.
797
+ * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
798
+ *
799
+ * @throws {@link Management.BadRequestError}
800
+ * @throws {@link Management.UnauthorizedError}
801
+ * @throws {@link Management.ForbiddenError}
802
+ * @throws {@link Management.TooManyRequestsError}
803
+ * @throws {@link errors.ManagementError}
804
+ * @throws {@link errors.ManagementTimeoutError}
805
+ *
806
+ * @example
807
+ * await client.users.deleteConsentSigningKey("id", "kid")
808
+ */
809
+ deleteConsentSigningKey(id, kid, requestOptions) {
810
+ return core.HttpResponsePromise.fromPromise(this.__deleteConsentSigningKey(id, kid, requestOptions));
811
+ }
812
+ __deleteConsentSigningKey(id, kid, requestOptions) {
813
+ return __awaiter(this, void 0, void 0, function* () {
814
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
815
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
816
+ let _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
817
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
818
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ManagementEnvironment.Default, `users/${core.url.encodePathParam(id, errors.ManagementError)}/consent-signing-keys/${core.url.encodePathParam(kid, errors.ManagementError)}`),
819
+ method: "DELETE",
820
+ headers: _headers,
821
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
822
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
823
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
824
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
825
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
826
+ logging: this._options.logging,
827
+ });
828
+ if (_response.ok) {
829
+ return { data: undefined, rawResponse: _response.rawResponse };
830
+ }
831
+ if (_response.error.reason === "status-code") {
832
+ switch (_response.error.statusCode) {
833
+ case 400:
834
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
835
+ case 401:
836
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
837
+ case 403:
838
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
839
+ case 429:
840
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
841
+ default:
842
+ throw new errors.ManagementError({
843
+ statusCode: _response.error.statusCode,
844
+ body: _response.error.body,
845
+ rawResponse: _response.rawResponse,
846
+ });
847
+ }
848
+ }
849
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/users/{id}/consent-signing-keys/{kid}");
850
+ });
851
+ }
667
852
  /**
668
853
  * Remove an existing multi-factor authentication (MFA) [recovery code](https://auth0.com/docs/secure/multi-factor-authentication/reset-user-mfa) and generate a new one. If a user cannot access the original device or account used for MFA enrollment, they can use a recovery code to authenticate.
669
854
  *