auth0 7.4.0 → 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 (40) hide show
  1. package/dist/cjs/management/api/requests/requests.d.ts +61 -0
  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/types/types.d.ts +1063 -467
  17. package/dist/cjs/management/api/types/types.js +36 -171
  18. package/dist/cjs/management/version.d.ts +1 -1
  19. package/dist/cjs/management/version.js +1 -1
  20. package/dist/esm/management/api/requests/requests.d.mts +61 -0
  21. package/dist/esm/management/api/resources/attackProtection/client/Client.d.mts +3 -0
  22. package/dist/esm/management/api/resources/attackProtection/client/Client.mjs +5 -0
  23. package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/client/Client.d.mts +105 -0
  24. package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/client/Client.mjs +351 -0
  25. package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/client/index.d.mts +1 -0
  26. package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/client/index.mjs +1 -0
  27. package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/exports.d.mts +2 -0
  28. package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/exports.mjs +3 -0
  29. package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/index.d.mts +1 -0
  30. package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/index.mjs +1 -0
  31. package/dist/esm/management/api/resources/attackProtection/resources/index.d.mts +1 -0
  32. package/dist/esm/management/api/resources/attackProtection/resources/index.mjs +1 -0
  33. package/dist/esm/management/api/resources/clientGrants/client/Client.d.mts +27 -0
  34. package/dist/esm/management/api/resources/clientGrants/client/Client.mjs +101 -0
  35. package/dist/esm/management/api/types/types.d.mts +1063 -467
  36. package/dist/esm/management/api/types/types.mjs +15 -150
  37. package/dist/esm/management/version.d.mts +1 -1
  38. package/dist/esm/management/version.mjs +1 -1
  39. package/package.json +12 -1
  40. package/reference.md +414 -0
@@ -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.