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,351 @@
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 * as environments from "../../../../../../environments.mjs";
15
+ import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.mjs";
16
+ import * as errors from "../../../../../../errors/index.mjs";
17
+ import * as Management from "../../../../../index.mjs";
18
+ export class CaptchaPoliciesClient {
19
+ constructor(options) {
20
+ this._options = normalizeClientOptionsWithAuth(options);
21
+ }
22
+ /**
23
+ * Retrieve all CAPTCHA attack protection policies for the tenant, sorted by priority ascending.
24
+ *
25
+ * @param {CaptchaPoliciesClient.RequestOptions} requestOptions - Request-specific configuration.
26
+ *
27
+ * @throws {@link Management.BadRequestError}
28
+ * @throws {@link Management.UnauthorizedError}
29
+ * @throws {@link Management.ForbiddenError}
30
+ * @throws {@link Management.NotFoundError}
31
+ * @throws {@link Management.TooManyRequestsError}
32
+ *
33
+ * @example
34
+ * await client.attackProtection.captchaPolicies.list()
35
+ */
36
+ list(requestOptions) {
37
+ return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
38
+ }
39
+ __list(requestOptions) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
42
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
43
+ 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);
44
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
45
+ 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"),
46
+ method: "GET",
47
+ headers: _headers,
48
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
49
+ 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,
50
+ 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,
51
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
52
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
53
+ logging: this._options.logging,
54
+ });
55
+ if (_response.ok) {
56
+ return {
57
+ data: _response.body,
58
+ rawResponse: _response.rawResponse,
59
+ };
60
+ }
61
+ if (_response.error.reason === "status-code") {
62
+ switch (_response.error.statusCode) {
63
+ case 400:
64
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
65
+ case 401:
66
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
67
+ case 403:
68
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
69
+ case 404:
70
+ throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
71
+ case 429:
72
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
73
+ default:
74
+ throw new errors.ManagementError({
75
+ statusCode: _response.error.statusCode,
76
+ body: _response.error.body,
77
+ rawResponse: _response.rawResponse,
78
+ });
79
+ }
80
+ }
81
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/attack-protection/captcha/policies");
82
+ });
83
+ }
84
+ /**
85
+ * Create a new CAPTCHA attack protection policy for the tenant. The maximum number of policies per tenant is determined by the tenant's subscription.
86
+ *
87
+ * @param {Management.CreateAttackProtectionCaptchaPolicyRequestContent} request
88
+ * @param {CaptchaPoliciesClient.RequestOptions} requestOptions - Request-specific configuration.
89
+ *
90
+ * @throws {@link Management.BadRequestError}
91
+ * @throws {@link Management.UnauthorizedError}
92
+ * @throws {@link Management.ForbiddenError}
93
+ * @throws {@link Management.NotFoundError}
94
+ * @throws {@link Management.ConflictError}
95
+ * @throws {@link Management.TooManyRequestsError}
96
+ *
97
+ * @example
98
+ * await client.attackProtection.captchaPolicies.create({
99
+ * name: "name",
100
+ * priority: 1,
101
+ * match: {},
102
+ * action: {}
103
+ * })
104
+ */
105
+ create(request, requestOptions) {
106
+ return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
107
+ }
108
+ __create(request, requestOptions) {
109
+ return __awaiter(this, void 0, void 0, function* () {
110
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
111
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
112
+ 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);
113
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
114
+ 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"),
115
+ method: "POST",
116
+ headers: _headers,
117
+ contentType: "application/json",
118
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
119
+ requestType: "json",
120
+ body: request,
121
+ 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,
122
+ 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,
123
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
124
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
125
+ logging: this._options.logging,
126
+ });
127
+ if (_response.ok) {
128
+ return {
129
+ data: _response.body,
130
+ rawResponse: _response.rawResponse,
131
+ };
132
+ }
133
+ if (_response.error.reason === "status-code") {
134
+ switch (_response.error.statusCode) {
135
+ case 400:
136
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
137
+ case 401:
138
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
139
+ case 403:
140
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
141
+ case 404:
142
+ throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
143
+ case 409:
144
+ throw new Management.ConflictError(_response.error.body, _response.rawResponse);
145
+ case 429:
146
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
147
+ default:
148
+ throw new errors.ManagementError({
149
+ statusCode: _response.error.statusCode,
150
+ body: _response.error.body,
151
+ rawResponse: _response.rawResponse,
152
+ });
153
+ }
154
+ }
155
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/attack-protection/captcha/policies");
156
+ });
157
+ }
158
+ /**
159
+ * Retrieve a single CAPTCHA attack protection policy for the tenant by ID.
160
+ *
161
+ * @param {string} id - ID of the CAPTCHA attack protection policy.
162
+ * @param {CaptchaPoliciesClient.RequestOptions} requestOptions - Request-specific configuration.
163
+ *
164
+ * @throws {@link Management.BadRequestError}
165
+ * @throws {@link Management.UnauthorizedError}
166
+ * @throws {@link Management.ForbiddenError}
167
+ * @throws {@link Management.NotFoundError}
168
+ * @throws {@link Management.TooManyRequestsError}
169
+ *
170
+ * @example
171
+ * await client.attackProtection.captchaPolicies.get("id")
172
+ */
173
+ get(id, requestOptions) {
174
+ return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions));
175
+ }
176
+ __get(id, requestOptions) {
177
+ return __awaiter(this, void 0, void 0, function* () {
178
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
179
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
180
+ 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);
181
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
182
+ 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)}`),
183
+ method: "GET",
184
+ headers: _headers,
185
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
186
+ 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,
187
+ 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,
188
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
189
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
190
+ logging: this._options.logging,
191
+ });
192
+ if (_response.ok) {
193
+ return {
194
+ data: _response.body,
195
+ rawResponse: _response.rawResponse,
196
+ };
197
+ }
198
+ if (_response.error.reason === "status-code") {
199
+ switch (_response.error.statusCode) {
200
+ case 400:
201
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
202
+ case 401:
203
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
204
+ case 403:
205
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
206
+ case 404:
207
+ throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
208
+ case 429:
209
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
210
+ default:
211
+ throw new errors.ManagementError({
212
+ statusCode: _response.error.statusCode,
213
+ body: _response.error.body,
214
+ rawResponse: _response.rawResponse,
215
+ });
216
+ }
217
+ }
218
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/attack-protection/captcha/policies/{id}");
219
+ });
220
+ }
221
+ /**
222
+ * Delete a CAPTCHA attack protection policy for the tenant.
223
+ *
224
+ * @param {string} id - ID of the CAPTCHA attack protection policy.
225
+ * @param {CaptchaPoliciesClient.RequestOptions} requestOptions - Request-specific configuration.
226
+ *
227
+ * @throws {@link Management.BadRequestError}
228
+ * @throws {@link Management.UnauthorizedError}
229
+ * @throws {@link Management.ForbiddenError}
230
+ * @throws {@link Management.NotFoundError}
231
+ * @throws {@link Management.TooManyRequestsError}
232
+ *
233
+ * @example
234
+ * await client.attackProtection.captchaPolicies.delete("id")
235
+ */
236
+ delete(id, requestOptions) {
237
+ return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions));
238
+ }
239
+ __delete(id, requestOptions) {
240
+ return __awaiter(this, void 0, void 0, function* () {
241
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
242
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
243
+ 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);
244
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
245
+ 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)}`),
246
+ method: "DELETE",
247
+ headers: _headers,
248
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
249
+ 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,
250
+ 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,
251
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
252
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
253
+ logging: this._options.logging,
254
+ });
255
+ if (_response.ok) {
256
+ return { data: undefined, rawResponse: _response.rawResponse };
257
+ }
258
+ if (_response.error.reason === "status-code") {
259
+ switch (_response.error.statusCode) {
260
+ case 400:
261
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
262
+ case 401:
263
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
264
+ case 403:
265
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
266
+ case 404:
267
+ throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
268
+ case 429:
269
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
270
+ default:
271
+ throw new errors.ManagementError({
272
+ statusCode: _response.error.statusCode,
273
+ body: _response.error.body,
274
+ rawResponse: _response.rawResponse,
275
+ });
276
+ }
277
+ }
278
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/attack-protection/captcha/policies/{id}");
279
+ });
280
+ }
281
+ /**
282
+ * 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.
283
+ *
284
+ * @param {string} id - ID of the CAPTCHA attack protection policy.
285
+ * @param {Management.UpdateAttackProtectionCaptchaPolicyRequestContent} request
286
+ * @param {CaptchaPoliciesClient.RequestOptions} requestOptions - Request-specific configuration.
287
+ *
288
+ * @throws {@link Management.BadRequestError}
289
+ * @throws {@link Management.UnauthorizedError}
290
+ * @throws {@link Management.ForbiddenError}
291
+ * @throws {@link Management.NotFoundError}
292
+ * @throws {@link Management.ConflictError}
293
+ * @throws {@link Management.TooManyRequestsError}
294
+ *
295
+ * @example
296
+ * await client.attackProtection.captchaPolicies.update("id")
297
+ */
298
+ update(id, request = {}, requestOptions) {
299
+ return core.HttpResponsePromise.fromPromise(this.__update(id, request, requestOptions));
300
+ }
301
+ __update(id_1) {
302
+ return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
303
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
304
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
305
+ 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);
306
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
307
+ 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)}`),
308
+ method: "PATCH",
309
+ headers: _headers,
310
+ contentType: "application/json",
311
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
312
+ requestType: "json",
313
+ body: request,
314
+ 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,
315
+ 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,
316
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
317
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
318
+ logging: this._options.logging,
319
+ });
320
+ if (_response.ok) {
321
+ return {
322
+ data: _response.body,
323
+ rawResponse: _response.rawResponse,
324
+ };
325
+ }
326
+ if (_response.error.reason === "status-code") {
327
+ switch (_response.error.statusCode) {
328
+ case 400:
329
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
330
+ case 401:
331
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
332
+ case 403:
333
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
334
+ case 404:
335
+ throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
336
+ case 409:
337
+ throw new Management.ConflictError(_response.error.body, _response.rawResponse);
338
+ case 429:
339
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
340
+ default:
341
+ throw new errors.ManagementError({
342
+ statusCode: _response.error.statusCode,
343
+ body: _response.error.body,
344
+ rawResponse: _response.rawResponse,
345
+ });
346
+ }
347
+ }
348
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/attack-protection/captcha/policies/{id}");
349
+ });
350
+ }
351
+ }
@@ -0,0 +1,2 @@
1
+ export { CaptchaPoliciesClient } 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 { CaptchaPoliciesClient } 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";
@@ -2,5 +2,6 @@ export * as botDetection from "./botDetection/index.mjs";
2
2
  export * as breachedPasswordDetection from "./breachedPasswordDetection/index.mjs";
3
3
  export * as bruteForceProtection from "./bruteForceProtection/index.mjs";
4
4
  export * as captcha from "./captcha/index.mjs";
5
+ export * as captchaPolicies from "./captchaPolicies/index.mjs";
5
6
  export * as phoneProviderProtection from "./phoneProviderProtection/index.mjs";
6
7
  export * as suspiciousIpThrottling from "./suspiciousIpThrottling/index.mjs";
@@ -2,5 +2,6 @@ export * as botDetection from "./botDetection/index.mjs";
2
2
  export * as breachedPasswordDetection from "./breachedPasswordDetection/index.mjs";
3
3
  export * as bruteForceProtection from "./bruteForceProtection/index.mjs";
4
4
  export * as captcha from "./captcha/index.mjs";
5
+ export * as captchaPolicies from "./captchaPolicies/index.mjs";
5
6
  export * as phoneProviderProtection from "./phoneProviderProtection/index.mjs";
6
7
  export * as suspiciousIpThrottling from "./suspiciousIpThrottling/index.mjs";
@@ -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.
@@ -185,6 +185,107 @@ export class ClientGrantsClient {
185
185
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/client-grants");
186
186
  });
187
187
  }
188
+ /**
189
+ * 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.
190
+ * Results may not reflect recent updates immediately.
191
+ *
192
+ * @param {Management.SearchClientGrantsRequestParameters} request
193
+ * @param {ClientGrantsClient.RequestOptions} requestOptions - Request-specific configuration.
194
+ *
195
+ * @throws {@link Management.BadRequestError}
196
+ * @throws {@link Management.UnauthorizedError}
197
+ * @throws {@link Management.ForbiddenError}
198
+ * @throws {@link Management.NotFoundError}
199
+ * @throws {@link Management.TooManyRequestsError}
200
+ * @throws {@link Management.InternalServerError}
201
+ * @throws {@link Management.GatewayTimeoutError}
202
+ *
203
+ * @example
204
+ * await client.clientGrants.search({
205
+ * q: "q",
206
+ * parser: "scim",
207
+ * fields: "fields",
208
+ * include_fields: true,
209
+ * take: 1,
210
+ * from: "from",
211
+ * sort: "audience"
212
+ * })
213
+ */
214
+ search() {
215
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
216
+ const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
217
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
218
+ const { q, parser, fields, include_fields: includeFields, take = 50, from: from_, sort } = request;
219
+ const _queryParams = {
220
+ q,
221
+ parser: parser !== undefined ? parser : undefined,
222
+ fields,
223
+ include_fields: includeFields,
224
+ take,
225
+ from: from_,
226
+ sort: sort !== undefined ? sort : undefined,
227
+ };
228
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
229
+ 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);
230
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
231
+ 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"),
232
+ method: "GET",
233
+ headers: _headers,
234
+ queryString: core.url
235
+ .queryBuilder()
236
+ .addMany(_queryParams)
237
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
238
+ .build(),
239
+ 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,
240
+ 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,
241
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
242
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
243
+ logging: this._options.logging,
244
+ });
245
+ if (_response.ok) {
246
+ return {
247
+ data: _response.body,
248
+ rawResponse: _response.rawResponse,
249
+ };
250
+ }
251
+ if (_response.error.reason === "status-code") {
252
+ switch (_response.error.statusCode) {
253
+ case 400:
254
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
255
+ case 401:
256
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
257
+ case 403:
258
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
259
+ case 404:
260
+ throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
261
+ case 429:
262
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
263
+ case 500:
264
+ throw new Management.InternalServerError(_response.error.body, _response.rawResponse);
265
+ case 504:
266
+ throw new Management.GatewayTimeoutError(_response.error.body, _response.rawResponse);
267
+ default:
268
+ throw new errors.ManagementError({
269
+ statusCode: _response.error.statusCode,
270
+ body: _response.error.body,
271
+ rawResponse: _response.rawResponse,
272
+ });
273
+ }
274
+ }
275
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/client-grants/search");
276
+ }));
277
+ const dataWithRawResponse = yield list(request).withRawResponse();
278
+ return new core.Page({
279
+ response: dataWithRawResponse.data,
280
+ rawResponse: dataWithRawResponse.rawResponse,
281
+ 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) === ""),
282
+ getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.client_grants) !== null && _a !== void 0 ? _a : []; },
283
+ loadPage: (response) => {
284
+ return list(core.setObjectProperty(request, "from", response === null || response === void 0 ? void 0 : response.next));
285
+ },
286
+ });
287
+ });
288
+ }
188
289
  /**
189
290
  * Retrieve a single [client grant](https://auth0.com/docs/get-started/applications/application-access-to-apis-client-grants), including the
190
291
  * 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
  *
@@ -331,6 +331,7 @@ export class ClientsClient {
331
331
  * @throws {@link Management.BadRequestError}
332
332
  * @throws {@link Management.UnauthorizedError}
333
333
  * @throws {@link Management.ForbiddenError}
334
+ * @throws {@link Management.ConflictError}
334
335
  * @throws {@link Management.TooManyRequestsError}
335
336
  * @throws {@link Management.InternalServerError}
336
337
  *
@@ -375,6 +376,8 @@ export class ClientsClient {
375
376
  throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
376
377
  case 403:
377
378
  throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
379
+ case 409:
380
+ throw new Management.ConflictError(_response.error.body, _response.rawResponse);
378
381
  case 429:
379
382
  throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
380
383
  case 500:
@@ -126,28 +126,6 @@ export declare class ExperimentsClient {
126
126
  */
127
127
  advanceRamp(id: string, request: Management.AdvanceRampRequestContent, requestOptions?: ExperimentsClient.RequestOptions): core.HttpResponsePromise<Management.AdvanceRampResponseContent>;
128
128
  private __advanceRamp;
129
- /**
130
- * Transitions an experiment through its lifecycle: draft → active, active → paused, paused → active, active/paused → completed. Activation runs full readiness validation.
131
- *
132
- * @param {string} id - The ID of the experiment to transition.
133
- * @param {Management.UpdateExperimentStatusRequestContent} request
134
- * @param {ExperimentsClient.RequestOptions} requestOptions - Request-specific configuration.
135
- *
136
- * @throws {@link Management.BadRequestError}
137
- * @throws {@link Management.UnauthorizedError}
138
- * @throws {@link Management.ForbiddenError}
139
- * @throws {@link Management.NotFoundError}
140
- * @throws {@link Management.ConflictError}
141
- * @throws {@link Management.UnprocessableEntityError}
142
- * @throws {@link Management.TooManyRequestsError}
143
- *
144
- * @example
145
- * await client.experimentation.experiments.updateStatus("id", {
146
- * status: "active"
147
- * })
148
- */
149
- updateStatus(id: string, request: Management.UpdateExperimentStatusRequestContent, requestOptions?: ExperimentsClient.RequestOptions): core.HttpResponsePromise<Management.UpdateExperimentStatusResponseContent>;
150
- private __updateStatus;
151
129
  /**
152
130
  * Checks whether an experiment is ready to be activated. Returns is_valid boolean and an errors array describing any blockers. Read-only; no state is modified.
153
131
  *