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,395 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.PortalsClient = void 0;
47
+ const BaseClient_js_1 = require("../../../../BaseClient.js");
48
+ const core = __importStar(require("../../../../core/index.js"));
49
+ const headers_js_1 = require("../../../../core/headers.js");
50
+ const requestBody_js_1 = require("../../../../core/requestBody.js");
51
+ const environments = __importStar(require("../../../../environments.js"));
52
+ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
53
+ const errors = __importStar(require("../../../../errors/index.js"));
54
+ const Management = __importStar(require("../../../index.js"));
55
+ class PortalsClient {
56
+ constructor(options) {
57
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
58
+ }
59
+ /**
60
+ * @param {PortalsClient.RequestOptions} requestOptions - Request-specific configuration.
61
+ *
62
+ * @throws {@link Management.UnauthorizedError}
63
+ * @throws {@link Management.ForbiddenError}
64
+ * @throws {@link Management.NotFoundError}
65
+ * @throws {@link Management.TooManyRequestsError}
66
+ * @throws {@link Management.InternalServerError}
67
+ * @throws {@link errors.ManagementError}
68
+ * @throws {@link errors.ManagementTimeoutError}
69
+ *
70
+ * @example
71
+ * await client.portals.list()
72
+ */
73
+ list(requestOptions) {
74
+ return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
75
+ }
76
+ __list(requestOptions) {
77
+ return __awaiter(this, void 0, void 0, function* () {
78
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
79
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
80
+ let _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
81
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
82
+ 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"),
83
+ method: "GET",
84
+ headers: _headers,
85
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
86
+ 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,
87
+ 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,
88
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
89
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
90
+ logging: this._options.logging,
91
+ });
92
+ if (_response.ok) {
93
+ return {
94
+ data: _response.body,
95
+ rawResponse: _response.rawResponse,
96
+ };
97
+ }
98
+ if (_response.error.reason === "status-code") {
99
+ switch (_response.error.statusCode) {
100
+ case 401:
101
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
102
+ case 403:
103
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
104
+ case 404:
105
+ throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
106
+ case 429:
107
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
108
+ case 500:
109
+ throw new Management.InternalServerError(_response.error.body, _response.rawResponse);
110
+ default:
111
+ throw new errors.ManagementError({
112
+ statusCode: _response.error.statusCode,
113
+ body: _response.error.body,
114
+ rawResponse: _response.rawResponse,
115
+ });
116
+ }
117
+ }
118
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/portals");
119
+ });
120
+ }
121
+ /**
122
+ * @param {Management.CreatePortalRequestContent} request
123
+ * @param {PortalsClient.RequestOptions} requestOptions - Request-specific configuration.
124
+ *
125
+ * @throws {@link Management.BadRequestError}
126
+ * @throws {@link Management.UnauthorizedError}
127
+ * @throws {@link Management.ForbiddenError}
128
+ * @throws {@link Management.NotFoundError}
129
+ * @throws {@link Management.ConflictError}
130
+ * @throws {@link Management.TooManyRequestsError}
131
+ * @throws {@link Management.InternalServerError}
132
+ * @throws {@link errors.ManagementError}
133
+ * @throws {@link errors.ManagementTimeoutError}
134
+ *
135
+ * @example
136
+ * await client.portals.create({
137
+ * slug: "slug",
138
+ * name: "name",
139
+ * client: {
140
+ * token_endpoint_auth_method: "client_secret_post",
141
+ * client_id: "client_id",
142
+ * client_secret: "client_secret"
143
+ * }
144
+ * })
145
+ */
146
+ create(request, requestOptions) {
147
+ return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
148
+ }
149
+ __create(request, requestOptions) {
150
+ return __awaiter(this, void 0, void 0, function* () {
151
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
152
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
153
+ let _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
154
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
155
+ 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"),
156
+ method: "POST",
157
+ headers: _headers,
158
+ contentType: "application/json",
159
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
160
+ requestType: "json",
161
+ body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
162
+ 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,
163
+ 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,
164
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
165
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
166
+ logging: this._options.logging,
167
+ });
168
+ if (_response.ok) {
169
+ return { data: _response.body, rawResponse: _response.rawResponse };
170
+ }
171
+ if (_response.error.reason === "status-code") {
172
+ switch (_response.error.statusCode) {
173
+ case 400:
174
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
175
+ case 401:
176
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
177
+ case 403:
178
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
179
+ case 404:
180
+ throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
181
+ case 409:
182
+ throw new Management.ConflictError(_response.error.body, _response.rawResponse);
183
+ case 429:
184
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
185
+ case 500:
186
+ throw new Management.InternalServerError(_response.error.body, _response.rawResponse);
187
+ default:
188
+ throw new errors.ManagementError({
189
+ statusCode: _response.error.statusCode,
190
+ body: _response.error.body,
191
+ rawResponse: _response.rawResponse,
192
+ });
193
+ }
194
+ }
195
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/portals");
196
+ });
197
+ }
198
+ /**
199
+ * @param {Management.PortalId} id
200
+ * @param {PortalsClient.RequestOptions} requestOptions - Request-specific configuration.
201
+ *
202
+ * @throws {@link Management.BadRequestError}
203
+ * @throws {@link Management.UnauthorizedError}
204
+ * @throws {@link Management.ForbiddenError}
205
+ * @throws {@link Management.NotFoundError}
206
+ * @throws {@link Management.TooManyRequestsError}
207
+ * @throws {@link Management.InternalServerError}
208
+ * @throws {@link errors.ManagementError}
209
+ * @throws {@link errors.ManagementTimeoutError}
210
+ *
211
+ * @example
212
+ * await client.portals.get("id")
213
+ */
214
+ get(id, requestOptions) {
215
+ return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions));
216
+ }
217
+ __get(id, requestOptions) {
218
+ return __awaiter(this, void 0, void 0, function* () {
219
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
220
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
221
+ let _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
222
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
223
+ 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)}`),
224
+ method: "GET",
225
+ headers: _headers,
226
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
227
+ 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,
228
+ 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,
229
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
230
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
231
+ logging: this._options.logging,
232
+ });
233
+ if (_response.ok) {
234
+ return { data: _response.body, rawResponse: _response.rawResponse };
235
+ }
236
+ if (_response.error.reason === "status-code") {
237
+ switch (_response.error.statusCode) {
238
+ case 400:
239
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
240
+ case 401:
241
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
242
+ case 403:
243
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
244
+ case 404:
245
+ throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
246
+ case 429:
247
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
248
+ case 500:
249
+ throw new Management.InternalServerError(_response.error.body, _response.rawResponse);
250
+ default:
251
+ throw new errors.ManagementError({
252
+ statusCode: _response.error.statusCode,
253
+ body: _response.error.body,
254
+ rawResponse: _response.rawResponse,
255
+ });
256
+ }
257
+ }
258
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/portals/{id}");
259
+ });
260
+ }
261
+ /**
262
+ * @param {Management.PortalId} id
263
+ * @param {PortalsClient.RequestOptions} requestOptions - Request-specific configuration.
264
+ *
265
+ * @throws {@link Management.BadRequestError}
266
+ * @throws {@link Management.UnauthorizedError}
267
+ * @throws {@link Management.ForbiddenError}
268
+ * @throws {@link Management.NotFoundError}
269
+ * @throws {@link Management.TooManyRequestsError}
270
+ * @throws {@link Management.InternalServerError}
271
+ * @throws {@link errors.ManagementError}
272
+ * @throws {@link errors.ManagementTimeoutError}
273
+ *
274
+ * @example
275
+ * await client.portals.delete("id")
276
+ */
277
+ delete(id, requestOptions) {
278
+ return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions));
279
+ }
280
+ __delete(id, requestOptions) {
281
+ return __awaiter(this, void 0, void 0, function* () {
282
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
283
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
284
+ let _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
285
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
286
+ 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)}`),
287
+ method: "DELETE",
288
+ headers: _headers,
289
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
290
+ 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,
291
+ 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,
292
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
293
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
294
+ logging: this._options.logging,
295
+ });
296
+ if (_response.ok) {
297
+ return { data: undefined, rawResponse: _response.rawResponse };
298
+ }
299
+ if (_response.error.reason === "status-code") {
300
+ switch (_response.error.statusCode) {
301
+ case 400:
302
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
303
+ case 401:
304
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
305
+ case 403:
306
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
307
+ case 404:
308
+ throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
309
+ case 429:
310
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
311
+ case 500:
312
+ throw new Management.InternalServerError(_response.error.body, _response.rawResponse);
313
+ default:
314
+ throw new errors.ManagementError({
315
+ statusCode: _response.error.statusCode,
316
+ body: _response.error.body,
317
+ rawResponse: _response.rawResponse,
318
+ });
319
+ }
320
+ }
321
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/portals/{id}");
322
+ });
323
+ }
324
+ /**
325
+ * @param {Management.PortalId} id
326
+ * @param {Management.UpdatePortalRequestContent} request
327
+ * @param {PortalsClient.RequestOptions} requestOptions - Request-specific configuration.
328
+ *
329
+ * @throws {@link Management.BadRequestError}
330
+ * @throws {@link Management.UnauthorizedError}
331
+ * @throws {@link Management.ForbiddenError}
332
+ * @throws {@link Management.NotFoundError}
333
+ * @throws {@link Management.ConflictError}
334
+ * @throws {@link Management.TooManyRequestsError}
335
+ * @throws {@link Management.InternalServerError}
336
+ * @throws {@link errors.ManagementError}
337
+ * @throws {@link errors.ManagementTimeoutError}
338
+ *
339
+ * @example
340
+ * await client.portals.update("id")
341
+ */
342
+ update(id, request = {}, requestOptions) {
343
+ return core.HttpResponsePromise.fromPromise(this.__update(id, request, requestOptions));
344
+ }
345
+ __update(id_1) {
346
+ return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
347
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
348
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
349
+ let _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
350
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
351
+ 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)}`),
352
+ method: "PATCH",
353
+ headers: _headers,
354
+ contentType: "application/json",
355
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
356
+ requestType: "json",
357
+ body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
358
+ 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,
359
+ 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,
360
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
361
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
362
+ logging: this._options.logging,
363
+ });
364
+ if (_response.ok) {
365
+ return { data: _response.body, rawResponse: _response.rawResponse };
366
+ }
367
+ if (_response.error.reason === "status-code") {
368
+ switch (_response.error.statusCode) {
369
+ case 400:
370
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
371
+ case 401:
372
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
373
+ case 403:
374
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
375
+ case 404:
376
+ throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
377
+ case 409:
378
+ throw new Management.ConflictError(_response.error.body, _response.rawResponse);
379
+ case 429:
380
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
381
+ case 500:
382
+ throw new Management.InternalServerError(_response.error.body, _response.rawResponse);
383
+ default:
384
+ throw new errors.ManagementError({
385
+ statusCode: _response.error.statusCode,
386
+ body: _response.error.body,
387
+ rawResponse: _response.rawResponse,
388
+ });
389
+ }
390
+ }
391
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/portals/{id}");
392
+ });
393
+ }
394
+ }
395
+ exports.PortalsClient = PortalsClient;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export { PortalsClient } from "./client/Client.js";
2
+ export * from "./client/index.js";
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.PortalsClient = void 0;
19
+ var Client_js_1 = require("./client/Client.js");
20
+ Object.defineProperty(exports, "PortalsClient", { enumerable: true, get: function () { return Client_js_1.PortalsClient; } });
21
+ __exportStar(require("./client/index.js"), exports);
@@ -0,0 +1 @@
1
+ export * from "./client/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client/index.js"), exports);
@@ -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
  *