auth0 7.4.0 → 7.5.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 (64) hide show
  1. package/dist/cjs/management/Client.d.ts +3 -0
  2. package/dist/cjs/management/Client.js +87 -82
  3. package/dist/cjs/management/api/requests/requests.d.ts +103 -0
  4. package/dist/cjs/management/api/resources/attackProtection/client/Client.d.ts +3 -0
  5. package/dist/cjs/management/api/resources/attackProtection/client/Client.js +9 -4
  6. package/dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/client/Client.d.ts +105 -0
  7. package/dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/client/Client.js +388 -0
  8. package/dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/client/index.d.ts +1 -0
  9. package/dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/client/index.js +2 -0
  10. package/dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/exports.d.ts +2 -0
  11. package/dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/exports.js +21 -0
  12. package/dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/index.d.ts +1 -0
  13. package/dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/index.js +17 -0
  14. package/dist/cjs/management/api/resources/attackProtection/resources/index.d.ts +1 -0
  15. package/dist/cjs/management/api/resources/attackProtection/resources/index.js +2 -1
  16. package/dist/cjs/management/api/resources/clientGrants/client/Client.d.ts +27 -0
  17. package/dist/cjs/management/api/resources/clientGrants/client/Client.js +101 -0
  18. package/dist/cjs/management/api/resources/clientProfiles/client/Client.d.ts +106 -0
  19. package/dist/cjs/management/api/resources/clientProfiles/client/Client.js +391 -0
  20. package/dist/cjs/management/api/resources/clientProfiles/client/index.d.ts +1 -0
  21. package/dist/cjs/management/api/resources/clientProfiles/client/index.js +2 -0
  22. package/dist/cjs/management/api/resources/clientProfiles/exports.d.ts +2 -0
  23. package/dist/cjs/management/api/resources/clientProfiles/exports.js +21 -0
  24. package/dist/cjs/management/api/resources/clientProfiles/index.d.ts +1 -0
  25. package/dist/cjs/management/api/resources/clientProfiles/index.js +17 -0
  26. package/dist/cjs/management/api/resources/index.d.ts +1 -0
  27. package/dist/cjs/management/api/resources/index.js +2 -1
  28. package/dist/cjs/management/api/types/types.d.ts +352 -0
  29. package/dist/cjs/management/api/types/types.js +83 -21
  30. package/dist/cjs/management/version.d.ts +1 -1
  31. package/dist/cjs/management/version.js +1 -1
  32. package/dist/esm/management/Client.d.mts +3 -0
  33. package/dist/esm/management/Client.mjs +5 -0
  34. package/dist/esm/management/api/requests/requests.d.mts +103 -0
  35. package/dist/esm/management/api/resources/attackProtection/client/Client.d.mts +3 -0
  36. package/dist/esm/management/api/resources/attackProtection/client/Client.mjs +5 -0
  37. package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/client/Client.d.mts +105 -0
  38. package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/client/Client.mjs +351 -0
  39. package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/client/index.d.mts +1 -0
  40. package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/client/index.mjs +1 -0
  41. package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/exports.d.mts +2 -0
  42. package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/exports.mjs +3 -0
  43. package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/index.d.mts +1 -0
  44. package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/index.mjs +1 -0
  45. package/dist/esm/management/api/resources/attackProtection/resources/index.d.mts +1 -0
  46. package/dist/esm/management/api/resources/attackProtection/resources/index.mjs +1 -0
  47. package/dist/esm/management/api/resources/clientGrants/client/Client.d.mts +27 -0
  48. package/dist/esm/management/api/resources/clientGrants/client/Client.mjs +101 -0
  49. package/dist/esm/management/api/resources/clientProfiles/client/Client.d.mts +106 -0
  50. package/dist/esm/management/api/resources/clientProfiles/client/Client.mjs +354 -0
  51. package/dist/esm/management/api/resources/clientProfiles/client/index.d.mts +1 -0
  52. package/dist/esm/management/api/resources/clientProfiles/client/index.mjs +1 -0
  53. package/dist/esm/management/api/resources/clientProfiles/exports.d.mts +2 -0
  54. package/dist/esm/management/api/resources/clientProfiles/exports.mjs +3 -0
  55. package/dist/esm/management/api/resources/clientProfiles/index.d.mts +1 -0
  56. package/dist/esm/management/api/resources/clientProfiles/index.mjs +1 -0
  57. package/dist/esm/management/api/resources/index.d.mts +1 -0
  58. package/dist/esm/management/api/resources/index.mjs +1 -0
  59. package/dist/esm/management/api/types/types.d.mts +352 -0
  60. package/dist/esm/management/api/types/types.mjs +62 -0
  61. package/dist/esm/management/version.d.mts +1 -1
  62. package/dist/esm/management/version.mjs +1 -1
  63. package/package.json +23 -1
  64. package/reference.md +981 -217
@@ -197,6 +197,34 @@ export interface CreateClientGrantRequestContent {
197
197
  /** If enabled, all scopes configured on the resource server are allowed for this grant. */
198
198
  allow_all_scopes?: boolean;
199
199
  }
200
+ /**
201
+ * @example
202
+ * {
203
+ * q: "q",
204
+ * parser: "scim",
205
+ * fields: "fields",
206
+ * include_fields: true,
207
+ * take: 1,
208
+ * from: "from",
209
+ * sort: "audience"
210
+ * }
211
+ */
212
+ export interface SearchClientGrantsRequestParameters {
213
+ /** Filter expression in SCIM or Lucene syntax (depending on parser parameter). SCIM examples: `audience eq "https://api.example.com"`, `client_id eq "cli_abc"`, `subject_type eq "client"`, `allow_any_organization eq true`, `default_for eq "third_party_clients"`, `audience co "example" and organization_id eq "org_123"`. SCIM operators: eq, ne, sw, ew, co, pr, gt, ge, lt, le, and, or. <br /><br /><b>Supported Fields</b>:<ul><li><i>audience</i> - Filter by audience (eq, ne, sw, co, ew, pr)</li><li><i>client_id</i> - Filter by client ID (eq, ne, sw, pr)</li><li><i>subject_type</i> - Filter by subject type (eq, ne, sw, pr)</li><li><i>allow_any_organization</i> - Filter by allow_any_organization (eq, ne, pr)</li><li><i>organization_id</i> - Filter by organization ID (eq, ne, sw, pr)</li><li><i>updated_at</i> - Filter by last update date (eq, ne, gt, ge, lt, le, pr)</li><li><i>default_for</i> - Filter by default grant group (eq, ne, sw, pr)</li></ul>Maximum 5 filter operations per query. Results are eventually consistent and may not reflect recent updates. */
214
+ q?: string | null;
215
+ /** Query parser to use for the filter expression. Use "scim" for SCIM filter syntax or "lucene" for Lucene query syntax (default). */
216
+ parser?: Management.SearchParserEnum | null;
217
+ /** Comma-separated list of fields to include or exclude in the response. Works with the include_fields parameter to control projection mode. */
218
+ fields?: string | null;
219
+ /** Controls field projection mode. Set to true to include only fields specified in the fields parameter. Set to false to exclude fields specified in the fields parameter. Defaults to true if not specified. */
220
+ include_fields?: boolean | null;
221
+ /** Maximum number of results to return per page (1-100). Defaults to 50. */
222
+ take?: number | null;
223
+ /** Cursor for the next page of results. Use the value from the next field in the previous response. */
224
+ from?: string | null;
225
+ /** Field name to sort results by in ascending order. Defaults to insertion order (oldest first) if not provided. */
226
+ sort?: Management.ClientGrantSortFieldEnum | null;
227
+ }
200
228
  /**
201
229
  * @example
202
230
  * {}
@@ -212,6 +240,46 @@ export interface UpdateClientGrantRequestContent {
212
240
  /** If enabled, all scopes configured on the resource server are allowed for this grant. */
213
241
  allow_all_scopes?: boolean | null;
214
242
  }
243
+ /**
244
+ * @example
245
+ * {
246
+ * from: "from",
247
+ * take: 1
248
+ * }
249
+ */
250
+ export interface ListClientProfilesRequestParameters {
251
+ /** Optional Id from which to start selection. */
252
+ from?: string | null;
253
+ /** Number of results per page. Defaults to 50. */
254
+ take?: number | null;
255
+ }
256
+ /**
257
+ * @example
258
+ * {
259
+ * name: "name",
260
+ * client_configuration: {},
261
+ * apply_policy: {
262
+ * external_metadata_type: "cimd",
263
+ * external_metadata_created_by: "client"
264
+ * }
265
+ * }
266
+ */
267
+ export interface CreateClientProfileRequestContent {
268
+ name: Management.ClientProfileName;
269
+ description?: (Management.ClientProfileDescription | undefined) | null;
270
+ client_configuration: Management.ClientProfileClientConfiguration;
271
+ apply_policy: Management.ClientProfileApplyPolicy;
272
+ }
273
+ /**
274
+ * @example
275
+ * {}
276
+ */
277
+ export interface UpdateClientProfileRequestContent {
278
+ name?: Management.ClientProfileName;
279
+ description?: (Management.ClientProfileDescription | undefined) | null;
280
+ client_configuration?: Management.ClientProfileClientConfiguration;
281
+ apply_policy?: Management.ClientProfileApplyPolicy;
282
+ }
215
283
  /**
216
284
  * @example
217
285
  * {
@@ -2303,6 +2371,39 @@ export interface UpdateAttackProtectionCaptchaRequestContent {
2303
2371
  recaptcha_v2?: Management.AttackProtectionUpdateCaptchaRecaptchaV2;
2304
2372
  simple_captcha?: Management.AttackProtectionCaptchaSimpleCaptchaResponseContent;
2305
2373
  }
2374
+ /**
2375
+ * @example
2376
+ * {
2377
+ * name: "name",
2378
+ * priority: 1,
2379
+ * match: {},
2380
+ * action: {}
2381
+ * }
2382
+ */
2383
+ export interface CreateAttackProtectionCaptchaPolicyRequestContent {
2384
+ /** Human-readable policy name. */
2385
+ name: string;
2386
+ /** Description of the attack protection policy. */
2387
+ description?: string;
2388
+ /** Conflict resolution order. Lower number takes higher precedence. Must be unique per tenant. */
2389
+ priority: number;
2390
+ match: Management.AttackProtectionCaptchaPolicyMatch;
2391
+ action: Management.AttackProtectionCaptchaPolicyActionInput;
2392
+ }
2393
+ /**
2394
+ * @example
2395
+ * {}
2396
+ */
2397
+ export interface UpdateAttackProtectionCaptchaPolicyRequestContent {
2398
+ /** Human-readable policy name. */
2399
+ name?: string;
2400
+ /** Description of the policy's purpose. */
2401
+ description?: string;
2402
+ /** Conflict resolution order. Lower number takes higher precedence. Must be unique per tenant. */
2403
+ priority?: number;
2404
+ match?: Management.AttackProtectionCaptchaPolicyMatch;
2405
+ action?: Management.AttackProtectionCaptchaPolicyActionInput;
2406
+ }
2306
2407
  /**
2307
2408
  * @example
2308
2409
  * {
@@ -4258,6 +4359,8 @@ export interface UpdateTenantSettingsRequestContent {
4258
4359
  resource_parameter_profile?: Management.TenantSettingsResourceParameterProfile;
4259
4360
  /** Whether the authorization server supports retrieving client metadata from a client_id URL. */
4260
4361
  client_id_metadata_document_supported?: boolean;
4362
+ /** Whether the authorization server supports registering clients dynamically from a client_id URL. Requires client_id_metadata_document_supported to be enabled. */
4363
+ client_id_metadata_document_dynamic_registration_supported?: boolean;
4261
4364
  /** Whether Auth0 Guide (AI-powered assistance) is enabled for this tenant. */
4262
4365
  enable_ai_guide?: boolean;
4263
4366
  /** Whether Phone Consolidated Experience is enabled for this tenant. */
@@ -4,6 +4,7 @@ import { BotDetectionClient } from "../resources/botDetection/client/Client.mjs"
4
4
  import { BreachedPasswordDetectionClient } from "../resources/breachedPasswordDetection/client/Client.mjs";
5
5
  import { BruteForceProtectionClient } from "../resources/bruteForceProtection/client/Client.mjs";
6
6
  import { CaptchaClient } from "../resources/captcha/client/Client.mjs";
7
+ import { CaptchaPoliciesClient } from "../resources/captchaPolicies/client/Client.mjs";
7
8
  import { PhoneProviderProtectionClient } from "../resources/phoneProviderProtection/client/Client.mjs";
8
9
  import { SuspiciousIpThrottlingClient } from "../resources/suspiciousIpThrottling/client/Client.mjs";
9
10
  export declare namespace AttackProtectionClient {
@@ -15,6 +16,7 @@ export declare class AttackProtectionClient {
15
16
  protected _breachedPasswordDetection: BreachedPasswordDetectionClient | undefined;
16
17
  protected _bruteForceProtection: BruteForceProtectionClient | undefined;
17
18
  protected _captcha: CaptchaClient | undefined;
19
+ protected _captchaPolicies: CaptchaPoliciesClient | undefined;
18
20
  protected _phoneProviderProtection: PhoneProviderProtectionClient | undefined;
19
21
  protected _suspiciousIpThrottling: SuspiciousIpThrottlingClient | undefined;
20
22
  constructor(options: AttackProtectionClient.Options);
@@ -22,6 +24,7 @@ export declare class AttackProtectionClient {
22
24
  get breachedPasswordDetection(): BreachedPasswordDetectionClient;
23
25
  get bruteForceProtection(): BruteForceProtectionClient;
24
26
  get captcha(): CaptchaClient;
27
+ get captchaPolicies(): CaptchaPoliciesClient;
25
28
  get phoneProviderProtection(): PhoneProviderProtectionClient;
26
29
  get suspiciousIpThrottling(): SuspiciousIpThrottlingClient;
27
30
  }
@@ -4,6 +4,7 @@ import { BotDetectionClient } from "../resources/botDetection/client/Client.mjs"
4
4
  import { BreachedPasswordDetectionClient } from "../resources/breachedPasswordDetection/client/Client.mjs";
5
5
  import { BruteForceProtectionClient } from "../resources/bruteForceProtection/client/Client.mjs";
6
6
  import { CaptchaClient } from "../resources/captcha/client/Client.mjs";
7
+ import { CaptchaPoliciesClient } from "../resources/captchaPolicies/client/Client.mjs";
7
8
  import { PhoneProviderProtectionClient } from "../resources/phoneProviderProtection/client/Client.mjs";
8
9
  import { SuspiciousIpThrottlingClient } from "../resources/suspiciousIpThrottling/client/Client.mjs";
9
10
  export class AttackProtectionClient {
@@ -26,6 +27,10 @@ export class AttackProtectionClient {
26
27
  var _a;
27
28
  return ((_a = this._captcha) !== null && _a !== void 0 ? _a : (this._captcha = new CaptchaClient(this._options)));
28
29
  }
30
+ get captchaPolicies() {
31
+ var _a;
32
+ return ((_a = this._captchaPolicies) !== null && _a !== void 0 ? _a : (this._captchaPolicies = new CaptchaPoliciesClient(this._options)));
33
+ }
29
34
  get phoneProviderProtection() {
30
35
  var _a;
31
36
  return ((_a = this._phoneProviderProtection) !== null && _a !== void 0 ? _a : (this._phoneProviderProtection = new PhoneProviderProtectionClient(this._options)));
@@ -0,0 +1,105 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
3
+ import * as core from "../../../../../../core/index.mjs";
4
+ import * as Management from "../../../../../index.mjs";
5
+ export declare namespace CaptchaPoliciesClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class CaptchaPoliciesClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<CaptchaPoliciesClient.Options>;
12
+ constructor(options: CaptchaPoliciesClient.Options);
13
+ /**
14
+ * Retrieve all CAPTCHA attack protection policies for the tenant, sorted by priority ascending.
15
+ *
16
+ * @param {CaptchaPoliciesClient.RequestOptions} requestOptions - Request-specific configuration.
17
+ *
18
+ * @throws {@link Management.BadRequestError}
19
+ * @throws {@link Management.UnauthorizedError}
20
+ * @throws {@link Management.ForbiddenError}
21
+ * @throws {@link Management.NotFoundError}
22
+ * @throws {@link Management.TooManyRequestsError}
23
+ *
24
+ * @example
25
+ * await client.attackProtection.captchaPolicies.list()
26
+ */
27
+ list(requestOptions?: CaptchaPoliciesClient.RequestOptions): core.HttpResponsePromise<Management.ListAttackProtectionCaptchaPoliciesResponseContent>;
28
+ private __list;
29
+ /**
30
+ * Create a new CAPTCHA attack protection policy for the tenant. The maximum number of policies per tenant is determined by the tenant's subscription.
31
+ *
32
+ * @param {Management.CreateAttackProtectionCaptchaPolicyRequestContent} request
33
+ * @param {CaptchaPoliciesClient.RequestOptions} requestOptions - Request-specific configuration.
34
+ *
35
+ * @throws {@link Management.BadRequestError}
36
+ * @throws {@link Management.UnauthorizedError}
37
+ * @throws {@link Management.ForbiddenError}
38
+ * @throws {@link Management.NotFoundError}
39
+ * @throws {@link Management.ConflictError}
40
+ * @throws {@link Management.TooManyRequestsError}
41
+ *
42
+ * @example
43
+ * await client.attackProtection.captchaPolicies.create({
44
+ * name: "name",
45
+ * priority: 1,
46
+ * match: {},
47
+ * action: {}
48
+ * })
49
+ */
50
+ create(request: Management.CreateAttackProtectionCaptchaPolicyRequestContent, requestOptions?: CaptchaPoliciesClient.RequestOptions): core.HttpResponsePromise<Management.AttackProtectionCaptchaPolicy>;
51
+ private __create;
52
+ /**
53
+ * Retrieve a single CAPTCHA attack protection policy for the tenant by ID.
54
+ *
55
+ * @param {string} id - ID of the CAPTCHA attack protection policy.
56
+ * @param {CaptchaPoliciesClient.RequestOptions} requestOptions - Request-specific configuration.
57
+ *
58
+ * @throws {@link Management.BadRequestError}
59
+ * @throws {@link Management.UnauthorizedError}
60
+ * @throws {@link Management.ForbiddenError}
61
+ * @throws {@link Management.NotFoundError}
62
+ * @throws {@link Management.TooManyRequestsError}
63
+ *
64
+ * @example
65
+ * await client.attackProtection.captchaPolicies.get("id")
66
+ */
67
+ get(id: string, requestOptions?: CaptchaPoliciesClient.RequestOptions): core.HttpResponsePromise<Management.AttackProtectionCaptchaPolicy>;
68
+ private __get;
69
+ /**
70
+ * Delete a CAPTCHA attack protection policy for the tenant.
71
+ *
72
+ * @param {string} id - ID of the CAPTCHA attack protection policy.
73
+ * @param {CaptchaPoliciesClient.RequestOptions} requestOptions - Request-specific configuration.
74
+ *
75
+ * @throws {@link Management.BadRequestError}
76
+ * @throws {@link Management.UnauthorizedError}
77
+ * @throws {@link Management.ForbiddenError}
78
+ * @throws {@link Management.NotFoundError}
79
+ * @throws {@link Management.TooManyRequestsError}
80
+ *
81
+ * @example
82
+ * await client.attackProtection.captchaPolicies.delete("id")
83
+ */
84
+ delete(id: string, requestOptions?: CaptchaPoliciesClient.RequestOptions): core.HttpResponsePromise<void>;
85
+ private __delete;
86
+ /**
87
+ * 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.
88
+ *
89
+ * @param {string} id - ID of the CAPTCHA attack protection policy.
90
+ * @param {Management.UpdateAttackProtectionCaptchaPolicyRequestContent} request
91
+ * @param {CaptchaPoliciesClient.RequestOptions} requestOptions - Request-specific configuration.
92
+ *
93
+ * @throws {@link Management.BadRequestError}
94
+ * @throws {@link Management.UnauthorizedError}
95
+ * @throws {@link Management.ForbiddenError}
96
+ * @throws {@link Management.NotFoundError}
97
+ * @throws {@link Management.ConflictError}
98
+ * @throws {@link Management.TooManyRequestsError}
99
+ *
100
+ * @example
101
+ * await client.attackProtection.captchaPolicies.update("id")
102
+ */
103
+ update(id: string, request?: Management.UpdateAttackProtectionCaptchaPolicyRequestContent, requestOptions?: CaptchaPoliciesClient.RequestOptions): core.HttpResponsePromise<Management.AttackProtectionCaptchaPolicy>;
104
+ private __update;
105
+ }
@@ -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";