auth0 7.4.0-beta.2 → 7.5.0-beta.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 (60) hide show
  1. package/dist/cjs/management/api/requests/requests.d.ts +73 -22
  2. package/dist/cjs/management/api/resources/attackProtection/client/Client.d.ts +3 -0
  3. package/dist/cjs/management/api/resources/attackProtection/client/Client.js +9 -4
  4. package/dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/client/Client.d.ts +105 -0
  5. package/dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/client/Client.js +388 -0
  6. package/dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/client/index.d.ts +1 -0
  7. package/dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/client/index.js +2 -0
  8. package/dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/exports.d.ts +2 -0
  9. package/dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/exports.js +21 -0
  10. package/dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/index.d.ts +1 -0
  11. package/dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/index.js +17 -0
  12. package/dist/cjs/management/api/resources/attackProtection/resources/index.d.ts +1 -0
  13. package/dist/cjs/management/api/resources/attackProtection/resources/index.js +2 -1
  14. package/dist/cjs/management/api/resources/clientGrants/client/Client.d.ts +27 -0
  15. package/dist/cjs/management/api/resources/clientGrants/client/Client.js +101 -0
  16. package/dist/cjs/management/api/resources/clients/client/Client.d.ts +1 -0
  17. package/dist/cjs/management/api/resources/clients/client/Client.js +3 -0
  18. package/dist/cjs/management/api/resources/experimentation/resources/experiments/client/Client.d.ts +0 -22
  19. package/dist/cjs/management/api/resources/experimentation/resources/experiments/client/Client.js +0 -75
  20. package/dist/cjs/management/api/resources/experimentation/resources/featureFlags/client/Client.d.ts +0 -20
  21. package/dist/cjs/management/api/resources/experimentation/resources/featureFlags/client/Client.js +0 -69
  22. package/dist/cjs/management/api/resources/experimentation/resources/featureFlags/resources/variations/client/Client.d.ts +0 -1
  23. package/dist/cjs/management/api/resources/experimentation/resources/featureFlags/resources/variations/client/Client.js +0 -3
  24. package/dist/cjs/management/api/resources/roles/client/Client.d.ts +1 -1
  25. package/dist/cjs/management/api/resources/roles/client/Client.js +1 -1
  26. package/dist/cjs/management/api/types/types.d.ts +1364 -566
  27. package/dist/cjs/management/api/types/types.js +101 -174
  28. package/dist/cjs/management/version.d.ts +1 -1
  29. package/dist/cjs/management/version.js +1 -1
  30. package/dist/esm/management/api/requests/requests.d.mts +73 -22
  31. package/dist/esm/management/api/resources/attackProtection/client/Client.d.mts +3 -0
  32. package/dist/esm/management/api/resources/attackProtection/client/Client.mjs +5 -0
  33. package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/client/Client.d.mts +105 -0
  34. package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/client/Client.mjs +351 -0
  35. package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/client/index.d.mts +1 -0
  36. package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/client/index.mjs +1 -0
  37. package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/exports.d.mts +2 -0
  38. package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/exports.mjs +3 -0
  39. package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/index.d.mts +1 -0
  40. package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/index.mjs +1 -0
  41. package/dist/esm/management/api/resources/attackProtection/resources/index.d.mts +1 -0
  42. package/dist/esm/management/api/resources/attackProtection/resources/index.mjs +1 -0
  43. package/dist/esm/management/api/resources/clientGrants/client/Client.d.mts +27 -0
  44. package/dist/esm/management/api/resources/clientGrants/client/Client.mjs +101 -0
  45. package/dist/esm/management/api/resources/clients/client/Client.d.mts +1 -0
  46. package/dist/esm/management/api/resources/clients/client/Client.mjs +3 -0
  47. package/dist/esm/management/api/resources/experimentation/resources/experiments/client/Client.d.mts +0 -22
  48. package/dist/esm/management/api/resources/experimentation/resources/experiments/client/Client.mjs +0 -75
  49. package/dist/esm/management/api/resources/experimentation/resources/featureFlags/client/Client.d.mts +0 -20
  50. package/dist/esm/management/api/resources/experimentation/resources/featureFlags/client/Client.mjs +0 -69
  51. package/dist/esm/management/api/resources/experimentation/resources/featureFlags/resources/variations/client/Client.d.mts +0 -1
  52. package/dist/esm/management/api/resources/experimentation/resources/featureFlags/resources/variations/client/Client.mjs +0 -3
  53. package/dist/esm/management/api/resources/roles/client/Client.d.mts +1 -1
  54. package/dist/esm/management/api/resources/roles/client/Client.mjs +1 -1
  55. package/dist/esm/management/api/types/types.d.mts +1364 -566
  56. package/dist/esm/management/api/types/types.mjs +80 -153
  57. package/dist/esm/management/version.d.mts +1 -1
  58. package/dist/esm/management/version.mjs +1 -1
  59. package/package.json +12 -1
  60. package/reference.md +514 -246
@@ -0,0 +1,388 @@
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.CaptchaPoliciesClient = 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 environments = __importStar(require("../../../../../../environments.js"));
51
+ const handleNonStatusCodeError_js_1 = require("../../../../../../errors/handleNonStatusCodeError.js");
52
+ const errors = __importStar(require("../../../../../../errors/index.js"));
53
+ const Management = __importStar(require("../../../../../index.js"));
54
+ class CaptchaPoliciesClient {
55
+ constructor(options) {
56
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
57
+ }
58
+ /**
59
+ * Retrieve all CAPTCHA attack protection policies for the tenant, sorted by priority ascending.
60
+ *
61
+ * @param {CaptchaPoliciesClient.RequestOptions} requestOptions - Request-specific configuration.
62
+ *
63
+ * @throws {@link Management.BadRequestError}
64
+ * @throws {@link Management.UnauthorizedError}
65
+ * @throws {@link Management.ForbiddenError}
66
+ * @throws {@link Management.NotFoundError}
67
+ * @throws {@link Management.TooManyRequestsError}
68
+ *
69
+ * @example
70
+ * await client.attackProtection.captchaPolicies.list()
71
+ */
72
+ list(requestOptions) {
73
+ return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
74
+ }
75
+ __list(requestOptions) {
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
78
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
79
+ 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);
80
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
81
+ 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, "attack-protection/captcha/policies"),
82
+ method: "GET",
83
+ headers: _headers,
84
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
85
+ 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,
86
+ 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,
87
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
88
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
89
+ logging: this._options.logging,
90
+ });
91
+ if (_response.ok) {
92
+ return {
93
+ data: _response.body,
94
+ rawResponse: _response.rawResponse,
95
+ };
96
+ }
97
+ if (_response.error.reason === "status-code") {
98
+ switch (_response.error.statusCode) {
99
+ case 400:
100
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
101
+ case 401:
102
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
103
+ case 403:
104
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
105
+ case 404:
106
+ throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
107
+ case 429:
108
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
109
+ default:
110
+ throw new errors.ManagementError({
111
+ statusCode: _response.error.statusCode,
112
+ body: _response.error.body,
113
+ rawResponse: _response.rawResponse,
114
+ });
115
+ }
116
+ }
117
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/attack-protection/captcha/policies");
118
+ });
119
+ }
120
+ /**
121
+ * Create a new CAPTCHA attack protection policy for the tenant. The maximum number of policies per tenant is determined by the tenant's subscription.
122
+ *
123
+ * @param {Management.CreateAttackProtectionCaptchaPolicyRequestContent} request
124
+ * @param {CaptchaPoliciesClient.RequestOptions} requestOptions - Request-specific configuration.
125
+ *
126
+ * @throws {@link Management.BadRequestError}
127
+ * @throws {@link Management.UnauthorizedError}
128
+ * @throws {@link Management.ForbiddenError}
129
+ * @throws {@link Management.NotFoundError}
130
+ * @throws {@link Management.ConflictError}
131
+ * @throws {@link Management.TooManyRequestsError}
132
+ *
133
+ * @example
134
+ * await client.attackProtection.captchaPolicies.create({
135
+ * name: "name",
136
+ * priority: 1,
137
+ * match: {},
138
+ * action: {}
139
+ * })
140
+ */
141
+ create(request, requestOptions) {
142
+ return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
143
+ }
144
+ __create(request, requestOptions) {
145
+ return __awaiter(this, void 0, void 0, function* () {
146
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
147
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
148
+ 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);
149
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
150
+ 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, "attack-protection/captcha/policies"),
151
+ method: "POST",
152
+ headers: _headers,
153
+ contentType: "application/json",
154
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
155
+ requestType: "json",
156
+ body: request,
157
+ 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,
158
+ 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,
159
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
160
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
161
+ logging: this._options.logging,
162
+ });
163
+ if (_response.ok) {
164
+ return {
165
+ data: _response.body,
166
+ rawResponse: _response.rawResponse,
167
+ };
168
+ }
169
+ if (_response.error.reason === "status-code") {
170
+ switch (_response.error.statusCode) {
171
+ case 400:
172
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
173
+ case 401:
174
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
175
+ case 403:
176
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
177
+ case 404:
178
+ throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
179
+ case 409:
180
+ throw new Management.ConflictError(_response.error.body, _response.rawResponse);
181
+ case 429:
182
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
183
+ default:
184
+ throw new errors.ManagementError({
185
+ statusCode: _response.error.statusCode,
186
+ body: _response.error.body,
187
+ rawResponse: _response.rawResponse,
188
+ });
189
+ }
190
+ }
191
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/attack-protection/captcha/policies");
192
+ });
193
+ }
194
+ /**
195
+ * Retrieve a single CAPTCHA attack protection policy for the tenant by ID.
196
+ *
197
+ * @param {string} id - ID of the CAPTCHA attack protection policy.
198
+ * @param {CaptchaPoliciesClient.RequestOptions} requestOptions - Request-specific configuration.
199
+ *
200
+ * @throws {@link Management.BadRequestError}
201
+ * @throws {@link Management.UnauthorizedError}
202
+ * @throws {@link Management.ForbiddenError}
203
+ * @throws {@link Management.NotFoundError}
204
+ * @throws {@link Management.TooManyRequestsError}
205
+ *
206
+ * @example
207
+ * await client.attackProtection.captchaPolicies.get("id")
208
+ */
209
+ get(id, requestOptions) {
210
+ return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions));
211
+ }
212
+ __get(id, requestOptions) {
213
+ return __awaiter(this, void 0, void 0, function* () {
214
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
215
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
216
+ 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);
217
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
218
+ 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, `attack-protection/captcha/policies/${core.url.encodePathParam(id)}`),
219
+ method: "GET",
220
+ headers: _headers,
221
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
222
+ 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,
223
+ 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,
224
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
225
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
226
+ logging: this._options.logging,
227
+ });
228
+ if (_response.ok) {
229
+ return {
230
+ data: _response.body,
231
+ rawResponse: _response.rawResponse,
232
+ };
233
+ }
234
+ if (_response.error.reason === "status-code") {
235
+ switch (_response.error.statusCode) {
236
+ case 400:
237
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
238
+ case 401:
239
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
240
+ case 403:
241
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
242
+ case 404:
243
+ throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
244
+ case 429:
245
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
246
+ default:
247
+ throw new errors.ManagementError({
248
+ statusCode: _response.error.statusCode,
249
+ body: _response.error.body,
250
+ rawResponse: _response.rawResponse,
251
+ });
252
+ }
253
+ }
254
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/attack-protection/captcha/policies/{id}");
255
+ });
256
+ }
257
+ /**
258
+ * Delete a CAPTCHA attack protection policy for the tenant.
259
+ *
260
+ * @param {string} id - ID of the CAPTCHA attack protection policy.
261
+ * @param {CaptchaPoliciesClient.RequestOptions} requestOptions - Request-specific configuration.
262
+ *
263
+ * @throws {@link Management.BadRequestError}
264
+ * @throws {@link Management.UnauthorizedError}
265
+ * @throws {@link Management.ForbiddenError}
266
+ * @throws {@link Management.NotFoundError}
267
+ * @throws {@link Management.TooManyRequestsError}
268
+ *
269
+ * @example
270
+ * await client.attackProtection.captchaPolicies.delete("id")
271
+ */
272
+ delete(id, requestOptions) {
273
+ return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions));
274
+ }
275
+ __delete(id, requestOptions) {
276
+ return __awaiter(this, void 0, void 0, function* () {
277
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
278
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
279
+ 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);
280
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
281
+ 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, `attack-protection/captcha/policies/${core.url.encodePathParam(id)}`),
282
+ method: "DELETE",
283
+ headers: _headers,
284
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
285
+ 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,
286
+ 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,
287
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
288
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
289
+ logging: this._options.logging,
290
+ });
291
+ if (_response.ok) {
292
+ return { data: undefined, rawResponse: _response.rawResponse };
293
+ }
294
+ if (_response.error.reason === "status-code") {
295
+ switch (_response.error.statusCode) {
296
+ case 400:
297
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
298
+ case 401:
299
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
300
+ case 403:
301
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
302
+ case 404:
303
+ throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
304
+ case 429:
305
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
306
+ default:
307
+ throw new errors.ManagementError({
308
+ statusCode: _response.error.statusCode,
309
+ body: _response.error.body,
310
+ rawResponse: _response.rawResponse,
311
+ });
312
+ }
313
+ }
314
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/attack-protection/captcha/policies/{id}");
315
+ });
316
+ }
317
+ /**
318
+ * Partially update a CAPTCHA attack protection policy. Only the provided fields are modified. A provided match or action replaces the stored value in full rather than merging with it; within action, a provider secret or API key that is omitted from a provided provider block keeps its stored value.
319
+ *
320
+ * @param {string} id - ID of the CAPTCHA attack protection policy.
321
+ * @param {Management.UpdateAttackProtectionCaptchaPolicyRequestContent} request
322
+ * @param {CaptchaPoliciesClient.RequestOptions} requestOptions - Request-specific configuration.
323
+ *
324
+ * @throws {@link Management.BadRequestError}
325
+ * @throws {@link Management.UnauthorizedError}
326
+ * @throws {@link Management.ForbiddenError}
327
+ * @throws {@link Management.NotFoundError}
328
+ * @throws {@link Management.ConflictError}
329
+ * @throws {@link Management.TooManyRequestsError}
330
+ *
331
+ * @example
332
+ * await client.attackProtection.captchaPolicies.update("id")
333
+ */
334
+ update(id, request = {}, requestOptions) {
335
+ return core.HttpResponsePromise.fromPromise(this.__update(id, request, requestOptions));
336
+ }
337
+ __update(id_1) {
338
+ return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
339
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
340
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
341
+ 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);
342
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
343
+ 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, `attack-protection/captcha/policies/${core.url.encodePathParam(id)}`),
344
+ method: "PATCH",
345
+ headers: _headers,
346
+ contentType: "application/json",
347
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
348
+ requestType: "json",
349
+ body: request,
350
+ 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,
351
+ 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,
352
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
353
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
354
+ logging: this._options.logging,
355
+ });
356
+ if (_response.ok) {
357
+ return {
358
+ data: _response.body,
359
+ rawResponse: _response.rawResponse,
360
+ };
361
+ }
362
+ if (_response.error.reason === "status-code") {
363
+ switch (_response.error.statusCode) {
364
+ case 400:
365
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
366
+ case 401:
367
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
368
+ case 403:
369
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
370
+ case 404:
371
+ throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
372
+ case 409:
373
+ throw new Management.ConflictError(_response.error.body, _response.rawResponse);
374
+ case 429:
375
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
376
+ default:
377
+ throw new errors.ManagementError({
378
+ statusCode: _response.error.statusCode,
379
+ body: _response.error.body,
380
+ rawResponse: _response.rawResponse,
381
+ });
382
+ }
383
+ }
384
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/attack-protection/captcha/policies/{id}");
385
+ });
386
+ }
387
+ }
388
+ exports.CaptchaPoliciesClient = CaptchaPoliciesClient;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export { CaptchaPoliciesClient } 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.CaptchaPoliciesClient = void 0;
19
+ var Client_js_1 = require("./client/Client.js");
20
+ Object.defineProperty(exports, "CaptchaPoliciesClient", { enumerable: true, get: function () { return Client_js_1.CaptchaPoliciesClient; } });
21
+ __exportStar(require("./client/index.js"), exports);
@@ -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);
@@ -2,5 +2,6 @@ export * as botDetection from "./botDetection/index.js";
2
2
  export * as breachedPasswordDetection from "./breachedPasswordDetection/index.js";
3
3
  export * as bruteForceProtection from "./bruteForceProtection/index.js";
4
4
  export * as captcha from "./captcha/index.js";
5
+ export * as captchaPolicies from "./captchaPolicies/index.js";
5
6
  export * as phoneProviderProtection from "./phoneProviderProtection/index.js";
6
7
  export * as suspiciousIpThrottling from "./suspiciousIpThrottling/index.js";
@@ -33,10 +33,11 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.suspiciousIpThrottling = exports.phoneProviderProtection = exports.captcha = exports.bruteForceProtection = exports.breachedPasswordDetection = exports.botDetection = void 0;
36
+ exports.suspiciousIpThrottling = exports.phoneProviderProtection = exports.captchaPolicies = exports.captcha = exports.bruteForceProtection = exports.breachedPasswordDetection = exports.botDetection = void 0;
37
37
  exports.botDetection = __importStar(require("./botDetection/index.js"));
38
38
  exports.breachedPasswordDetection = __importStar(require("./breachedPasswordDetection/index.js"));
39
39
  exports.bruteForceProtection = __importStar(require("./bruteForceProtection/index.js"));
40
40
  exports.captcha = __importStar(require("./captcha/index.js"));
41
+ exports.captchaPolicies = __importStar(require("./captchaPolicies/index.js"));
41
42
  exports.phoneProviderProtection = __importStar(require("./phoneProviderProtection/index.js"));
42
43
  exports.suspiciousIpThrottling = __importStar(require("./suspiciousIpThrottling/index.js"));
@@ -56,6 +56,33 @@ export declare class ClientGrantsClient {
56
56
  */
57
57
  create(request: Management.CreateClientGrantRequestContent, requestOptions?: ClientGrantsClient.RequestOptions): core.HttpResponsePromise<Management.CreateClientGrantResponseContent>;
58
58
  private __create;
59
+ /**
60
+ * Search client grants using SCIM or Lucene filter syntax with low-latency, eventually consistent results. Use the parser parameter to specify "scim" or "lucene" syntax (default: "lucene"). This endpoint provides an alternative to the standard GET /client-grants endpoint with better performance for complex queries.
61
+ * Results may not reflect recent updates immediately.
62
+ *
63
+ * @param {Management.SearchClientGrantsRequestParameters} request
64
+ * @param {ClientGrantsClient.RequestOptions} requestOptions - Request-specific configuration.
65
+ *
66
+ * @throws {@link Management.BadRequestError}
67
+ * @throws {@link Management.UnauthorizedError}
68
+ * @throws {@link Management.ForbiddenError}
69
+ * @throws {@link Management.NotFoundError}
70
+ * @throws {@link Management.TooManyRequestsError}
71
+ * @throws {@link Management.InternalServerError}
72
+ * @throws {@link Management.GatewayTimeoutError}
73
+ *
74
+ * @example
75
+ * await client.clientGrants.search({
76
+ * q: "q",
77
+ * parser: "scim",
78
+ * fields: "fields",
79
+ * include_fields: true,
80
+ * take: 1,
81
+ * from: "from",
82
+ * sort: "audience"
83
+ * })
84
+ */
85
+ search(request?: Management.SearchClientGrantsRequestParameters, requestOptions?: ClientGrantsClient.RequestOptions): Promise<core.Page<Management.ClientGrantResponseContent, Management.SearchClientGrantsResponseContent>>;
59
86
  /**
60
87
  * Retrieve a single [client grant](https://auth0.com/docs/get-started/applications/application-access-to-apis-client-grants), including the
61
88
  * scopes associated with the application/API pair.
@@ -221,6 +221,107 @@ class ClientGrantsClient {
221
221
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/client-grants");
222
222
  });
223
223
  }
224
+ /**
225
+ * Search client grants using SCIM or Lucene filter syntax with low-latency, eventually consistent results. Use the parser parameter to specify "scim" or "lucene" syntax (default: "lucene"). This endpoint provides an alternative to the standard GET /client-grants endpoint with better performance for complex queries.
226
+ * Results may not reflect recent updates immediately.
227
+ *
228
+ * @param {Management.SearchClientGrantsRequestParameters} request
229
+ * @param {ClientGrantsClient.RequestOptions} requestOptions - Request-specific configuration.
230
+ *
231
+ * @throws {@link Management.BadRequestError}
232
+ * @throws {@link Management.UnauthorizedError}
233
+ * @throws {@link Management.ForbiddenError}
234
+ * @throws {@link Management.NotFoundError}
235
+ * @throws {@link Management.TooManyRequestsError}
236
+ * @throws {@link Management.InternalServerError}
237
+ * @throws {@link Management.GatewayTimeoutError}
238
+ *
239
+ * @example
240
+ * await client.clientGrants.search({
241
+ * q: "q",
242
+ * parser: "scim",
243
+ * fields: "fields",
244
+ * include_fields: true,
245
+ * take: 1,
246
+ * from: "from",
247
+ * sort: "audience"
248
+ * })
249
+ */
250
+ search() {
251
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
252
+ const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
253
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
254
+ const { q, parser, fields, include_fields: includeFields, take = 50, from: from_, sort } = request;
255
+ const _queryParams = {
256
+ q,
257
+ parser: parser !== undefined ? parser : undefined,
258
+ fields,
259
+ include_fields: includeFields,
260
+ take,
261
+ from: from_,
262
+ sort: sort !== undefined ? sort : undefined,
263
+ };
264
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
265
+ 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);
266
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
267
+ 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, "client-grants/search"),
268
+ method: "GET",
269
+ headers: _headers,
270
+ queryString: core.url
271
+ .queryBuilder()
272
+ .addMany(_queryParams)
273
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
274
+ .build(),
275
+ 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,
276
+ 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,
277
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
278
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
279
+ logging: this._options.logging,
280
+ });
281
+ if (_response.ok) {
282
+ return {
283
+ data: _response.body,
284
+ rawResponse: _response.rawResponse,
285
+ };
286
+ }
287
+ if (_response.error.reason === "status-code") {
288
+ switch (_response.error.statusCode) {
289
+ case 400:
290
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
291
+ case 401:
292
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
293
+ case 403:
294
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
295
+ case 404:
296
+ throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
297
+ case 429:
298
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
299
+ case 500:
300
+ throw new Management.InternalServerError(_response.error.body, _response.rawResponse);
301
+ case 504:
302
+ throw new Management.GatewayTimeoutError(_response.error.body, _response.rawResponse);
303
+ default:
304
+ throw new errors.ManagementError({
305
+ statusCode: _response.error.statusCode,
306
+ body: _response.error.body,
307
+ rawResponse: _response.rawResponse,
308
+ });
309
+ }
310
+ }
311
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/client-grants/search");
312
+ }));
313
+ const dataWithRawResponse = yield list(request).withRawResponse();
314
+ return new core.Page({
315
+ response: dataWithRawResponse.data,
316
+ rawResponse: dataWithRawResponse.rawResponse,
317
+ hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.next) != null && !(typeof (response === null || response === void 0 ? void 0 : response.next) === "string" && (response === null || response === void 0 ? void 0 : response.next) === ""),
318
+ getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.client_grants) !== null && _a !== void 0 ? _a : []; },
319
+ loadPage: (response) => {
320
+ return list(core.setObjectProperty(request, "from", response === null || response === void 0 ? void 0 : response.next));
321
+ },
322
+ });
323
+ });
324
+ }
224
325
  /**
225
326
  * Retrieve a single [client grant](https://auth0.com/docs/get-started/applications/application-access-to-apis-client-grants), including the
226
327
  * scopes associated with the application/API pair.
@@ -141,6 +141,7 @@ export declare class ClientsClient {
141
141
  * @throws {@link Management.BadRequestError}
142
142
  * @throws {@link Management.UnauthorizedError}
143
143
  * @throws {@link Management.ForbiddenError}
144
+ * @throws {@link Management.ConflictError}
144
145
  * @throws {@link Management.TooManyRequestsError}
145
146
  * @throws {@link Management.InternalServerError}
146
147
  *
@@ -367,6 +367,7 @@ class ClientsClient {
367
367
  * @throws {@link Management.BadRequestError}
368
368
  * @throws {@link Management.UnauthorizedError}
369
369
  * @throws {@link Management.ForbiddenError}
370
+ * @throws {@link Management.ConflictError}
370
371
  * @throws {@link Management.TooManyRequestsError}
371
372
  * @throws {@link Management.InternalServerError}
372
373
  *
@@ -411,6 +412,8 @@ class ClientsClient {
411
412
  throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
412
413
  case 403:
413
414
  throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
415
+ case 409:
416
+ throw new Management.ConflictError(_response.error.body, _response.rawResponse);
414
417
  case 429:
415
418
  throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
416
419
  case 500: