auth0 7.0.0 → 7.1.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 (110) hide show
  1. package/dist/cjs/management/Client.d.ts +5 -5
  2. package/dist/cjs/management/Client.js +28 -28
  3. package/dist/cjs/management/api/errors/GatewayTimeoutError.d.ts +5 -0
  4. package/dist/cjs/management/api/errors/GatewayTimeoutError.js +54 -0
  5. package/dist/cjs/management/api/errors/index.d.ts +1 -0
  6. package/dist/cjs/management/api/errors/index.js +1 -0
  7. package/dist/cjs/management/api/requests/requests.d.ts +112 -88
  8. package/dist/cjs/management/api/resources/experimentation/client/Client.d.ts +12 -0
  9. package/dist/cjs/management/api/resources/experimentation/client/Client.js +16 -0
  10. package/dist/cjs/management/api/resources/experimentation/exports.d.ts +3 -0
  11. package/dist/cjs/management/api/resources/experimentation/exports.js +22 -0
  12. package/dist/cjs/management/api/resources/experimentation/index.d.ts +2 -0
  13. package/dist/cjs/management/api/resources/experimentation/index.js +18 -0
  14. package/dist/cjs/management/api/resources/experimentation/resources/experiments/client/Client.d.ts +34 -0
  15. package/dist/cjs/management/api/resources/experimentation/resources/experiments/client/Client.js +131 -0
  16. package/dist/cjs/management/api/resources/experimentation/resources/experiments/client/index.js +2 -0
  17. package/dist/cjs/management/api/resources/experimentation/resources/experiments/exports.d.ts +2 -0
  18. package/dist/cjs/management/api/resources/{organizationTemplates → experimentation/resources/experiments}/exports.js +2 -2
  19. package/dist/cjs/management/api/resources/experimentation/resources/index.d.ts +1 -0
  20. package/dist/cjs/management/api/resources/experimentation/resources/index.js +37 -0
  21. package/dist/cjs/management/api/resources/guardian/client/Client.d.ts +40 -1
  22. package/dist/cjs/management/api/resources/guardian/client/Client.js +172 -0
  23. package/dist/cjs/management/api/resources/guardian/resources/factors/client/Client.d.ts +3 -0
  24. package/dist/cjs/management/api/resources/guardian/resources/factors/client/Client.js +11 -6
  25. package/dist/cjs/management/api/resources/guardian/resources/factors/resources/email/client/Client.d.ts +46 -0
  26. package/dist/cjs/management/api/resources/guardian/resources/factors/resources/email/client/Client.js +181 -0
  27. package/dist/cjs/management/api/resources/guardian/resources/factors/resources/email/client/index.js +2 -0
  28. package/dist/cjs/management/api/resources/guardian/resources/factors/resources/email/exports.d.ts +2 -0
  29. package/dist/cjs/management/api/resources/guardian/resources/factors/resources/email/exports.js +21 -0
  30. package/dist/cjs/management/api/resources/guardian/resources/factors/resources/email/index.d.ts +1 -0
  31. package/dist/cjs/management/api/resources/guardian/resources/factors/resources/email/index.js +17 -0
  32. package/dist/cjs/management/api/resources/guardian/resources/factors/resources/index.d.ts +1 -0
  33. package/dist/cjs/management/api/resources/guardian/resources/factors/resources/index.js +2 -1
  34. package/dist/cjs/management/api/resources/guardian/resources/factors/resources/phone/client/Client.d.ts +33 -0
  35. package/dist/cjs/management/api/resources/guardian/resources/factors/resources/phone/client/Client.js +122 -0
  36. package/dist/cjs/management/api/resources/index.d.ts +1 -1
  37. package/dist/cjs/management/api/resources/index.js +2 -2
  38. package/dist/cjs/management/api/resources/organizations/client/Client.d.ts +36 -0
  39. package/dist/cjs/management/api/resources/organizations/client/Client.js +104 -0
  40. package/dist/cjs/management/api/resources/resourceServers/client/Client.d.ts +29 -0
  41. package/dist/cjs/management/api/resources/resourceServers/client/Client.js +103 -0
  42. package/dist/cjs/management/api/types/types.d.ts +226 -51
  43. package/dist/cjs/management/api/types/types.js +37 -36
  44. package/dist/cjs/management/version.d.ts +1 -1
  45. package/dist/cjs/management/version.js +1 -1
  46. package/dist/esm/management/Client.d.mts +5 -5
  47. package/dist/esm/management/Client.mjs +7 -7
  48. package/dist/esm/management/api/errors/GatewayTimeoutError.d.mts +5 -0
  49. package/dist/esm/management/api/errors/GatewayTimeoutError.mjs +17 -0
  50. package/dist/esm/management/api/errors/index.d.mts +1 -0
  51. package/dist/esm/management/api/errors/index.mjs +1 -0
  52. package/dist/esm/management/api/requests/requests.d.mts +112 -88
  53. package/dist/esm/management/api/resources/experimentation/client/Client.d.mts +12 -0
  54. package/dist/esm/management/api/resources/experimentation/client/Client.mjs +12 -0
  55. package/dist/esm/management/api/resources/experimentation/client/index.d.mts +1 -0
  56. package/dist/esm/management/api/resources/experimentation/client/index.mjs +1 -0
  57. package/dist/esm/management/api/resources/experimentation/exports.d.mts +3 -0
  58. package/dist/esm/management/api/resources/experimentation/exports.mjs +4 -0
  59. package/dist/esm/management/api/resources/experimentation/index.d.mts +2 -0
  60. package/dist/esm/management/api/resources/experimentation/index.mjs +2 -0
  61. package/dist/esm/management/api/resources/experimentation/resources/experiments/client/Client.d.mts +34 -0
  62. package/dist/esm/management/api/resources/experimentation/resources/experiments/client/Client.mjs +94 -0
  63. package/dist/esm/management/api/resources/experimentation/resources/experiments/client/index.d.mts +1 -0
  64. package/dist/esm/management/api/resources/experimentation/resources/experiments/client/index.mjs +1 -0
  65. package/dist/esm/management/api/resources/experimentation/resources/experiments/exports.d.mts +2 -0
  66. package/dist/esm/management/api/resources/{organizationTemplates → experimentation/resources/experiments}/exports.mjs +1 -1
  67. package/dist/esm/management/api/resources/experimentation/resources/index.d.mts +1 -0
  68. package/dist/esm/management/api/resources/experimentation/resources/index.mjs +1 -0
  69. package/dist/esm/management/api/resources/guardian/client/Client.d.mts +40 -1
  70. package/dist/esm/management/api/resources/guardian/client/Client.mjs +139 -0
  71. package/dist/esm/management/api/resources/guardian/resources/factors/client/Client.d.mts +3 -0
  72. package/dist/esm/management/api/resources/guardian/resources/factors/client/Client.mjs +5 -0
  73. package/dist/esm/management/api/resources/guardian/resources/factors/resources/email/client/Client.d.mts +46 -0
  74. package/dist/esm/management/api/resources/guardian/resources/factors/resources/email/client/Client.mjs +144 -0
  75. package/dist/esm/management/api/resources/guardian/resources/factors/resources/email/client/index.d.mts +1 -0
  76. package/dist/esm/management/api/resources/guardian/resources/factors/resources/email/client/index.mjs +1 -0
  77. package/dist/esm/management/api/resources/guardian/resources/factors/resources/email/exports.d.mts +2 -0
  78. package/dist/esm/management/api/resources/guardian/resources/factors/resources/email/exports.mjs +3 -0
  79. package/dist/esm/management/api/resources/guardian/resources/factors/resources/email/index.d.mts +1 -0
  80. package/dist/esm/management/api/resources/guardian/resources/factors/resources/email/index.mjs +1 -0
  81. package/dist/esm/management/api/resources/guardian/resources/factors/resources/index.d.mts +1 -0
  82. package/dist/esm/management/api/resources/guardian/resources/factors/resources/index.mjs +1 -0
  83. package/dist/esm/management/api/resources/guardian/resources/factors/resources/phone/client/Client.d.mts +33 -0
  84. package/dist/esm/management/api/resources/guardian/resources/factors/resources/phone/client/Client.mjs +122 -0
  85. package/dist/esm/management/api/resources/index.d.mts +1 -1
  86. package/dist/esm/management/api/resources/index.mjs +1 -1
  87. package/dist/esm/management/api/resources/organizations/client/Client.d.mts +36 -0
  88. package/dist/esm/management/api/resources/organizations/client/Client.mjs +104 -0
  89. package/dist/esm/management/api/resources/resourceServers/client/Client.d.mts +29 -0
  90. package/dist/esm/management/api/resources/resourceServers/client/Client.mjs +103 -0
  91. package/dist/esm/management/api/types/types.d.mts +226 -51
  92. package/dist/esm/management/api/types/types.mjs +34 -33
  93. package/dist/esm/management/version.d.mts +1 -1
  94. package/dist/esm/management/version.mjs +1 -1
  95. package/package.json +46 -23
  96. package/reference.md +654 -389
  97. package/dist/cjs/management/api/resources/organizationTemplates/client/Client.d.ts +0 -106
  98. package/dist/cjs/management/api/resources/organizationTemplates/client/Client.js +0 -411
  99. package/dist/cjs/management/api/resources/organizationTemplates/exports.d.ts +0 -2
  100. package/dist/esm/management/api/resources/organizationTemplates/client/Client.d.mts +0 -106
  101. package/dist/esm/management/api/resources/organizationTemplates/client/Client.mjs +0 -374
  102. package/dist/esm/management/api/resources/organizationTemplates/exports.d.mts +0 -2
  103. /package/dist/cjs/management/api/resources/{organizationTemplates → experimentation}/client/index.d.ts +0 -0
  104. /package/dist/cjs/management/api/resources/{organizationTemplates → experimentation}/client/index.js +0 -0
  105. /package/dist/{esm/management/api/resources/organizationTemplates/client/index.d.mts → cjs/management/api/resources/experimentation/resources/experiments/client/index.d.ts} +0 -0
  106. /package/dist/cjs/management/api/resources/{organizationTemplates → experimentation/resources/experiments}/index.d.ts +0 -0
  107. /package/dist/cjs/management/api/resources/{organizationTemplates → experimentation/resources/experiments}/index.js +0 -0
  108. /package/dist/{esm/management/api/resources/organizationTemplates/client/index.mjs → cjs/management/api/resources/guardian/resources/factors/resources/email/client/index.d.ts} +0 -0
  109. /package/dist/esm/management/api/resources/{organizationTemplates → experimentation/resources/experiments}/index.d.mts +0 -0
  110. /package/dist/esm/management/api/resources/{organizationTemplates → experimentation/resources/experiments}/index.mjs +0 -0
@@ -0,0 +1,3 @@
1
+ export { ExperimentationClient } from "./client/Client.mjs";
2
+ export * from "./client/index.mjs";
3
+ export * from "./resources/index.mjs";
@@ -0,0 +1,4 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export { ExperimentationClient } from "./client/Client.mjs";
3
+ export * from "./client/index.mjs";
4
+ export * from "./resources/index.mjs";
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.mjs";
2
+ export * from "./resources/index.mjs";
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.mjs";
2
+ export * from "./resources/index.mjs";
@@ -0,0 +1,34 @@
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 ExperimentsClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class ExperimentsClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<ExperimentsClient.Options>;
12
+ constructor(options: ExperimentsClient.Options);
13
+ /**
14
+ * Increments the current ramp index to the requested target level. Up-only: the target must be the immediate next level in the schedule. Idempotent: calling with the current level returns success without writing anything.
15
+ *
16
+ * @param {string} id - The ID of the experiment to advance.
17
+ * @param {Management.AdvanceRampRequestContent} request
18
+ * @param {ExperimentsClient.RequestOptions} requestOptions - Request-specific configuration.
19
+ *
20
+ * @throws {@link Management.BadRequestError}
21
+ * @throws {@link Management.UnauthorizedError}
22
+ * @throws {@link Management.ForbiddenError}
23
+ * @throws {@link Management.NotFoundError}
24
+ * @throws {@link Management.ConflictError}
25
+ * @throws {@link Management.TooManyRequestsError}
26
+ *
27
+ * @example
28
+ * await client.experimentation.experiments.advanceRamp("id", {
29
+ * target_level: 1
30
+ * })
31
+ */
32
+ advanceRamp(id: string, request: Management.AdvanceRampRequestContent, requestOptions?: ExperimentsClient.RequestOptions): core.HttpResponsePromise<Management.AdvanceRampResponseContent>;
33
+ private __advanceRamp;
34
+ }
@@ -0,0 +1,94 @@
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 ExperimentsClient {
19
+ constructor(options) {
20
+ this._options = normalizeClientOptionsWithAuth(options);
21
+ }
22
+ /**
23
+ * Increments the current ramp index to the requested target level. Up-only: the target must be the immediate next level in the schedule. Idempotent: calling with the current level returns success without writing anything.
24
+ *
25
+ * @param {string} id - The ID of the experiment to advance.
26
+ * @param {Management.AdvanceRampRequestContent} request
27
+ * @param {ExperimentsClient.RequestOptions} requestOptions - Request-specific configuration.
28
+ *
29
+ * @throws {@link Management.BadRequestError}
30
+ * @throws {@link Management.UnauthorizedError}
31
+ * @throws {@link Management.ForbiddenError}
32
+ * @throws {@link Management.NotFoundError}
33
+ * @throws {@link Management.ConflictError}
34
+ * @throws {@link Management.TooManyRequestsError}
35
+ *
36
+ * @example
37
+ * await client.experimentation.experiments.advanceRamp("id", {
38
+ * target_level: 1
39
+ * })
40
+ */
41
+ advanceRamp(id, request, requestOptions) {
42
+ return core.HttpResponsePromise.fromPromise(this.__advanceRamp(id, request, requestOptions));
43
+ }
44
+ __advanceRamp(id, request, requestOptions) {
45
+ return __awaiter(this, void 0, void 0, function* () {
46
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
47
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
48
+ 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);
49
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
50
+ 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, `experimentation/experiments/${core.url.encodePathParam(id)}/advance-ramp`),
51
+ method: "POST",
52
+ headers: _headers,
53
+ contentType: "application/json",
54
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
55
+ requestType: "json",
56
+ body: request,
57
+ 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,
58
+ 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,
59
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
60
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
61
+ logging: this._options.logging,
62
+ });
63
+ if (_response.ok) {
64
+ return {
65
+ data: _response.body,
66
+ rawResponse: _response.rawResponse,
67
+ };
68
+ }
69
+ if (_response.error.reason === "status-code") {
70
+ switch (_response.error.statusCode) {
71
+ case 400:
72
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
73
+ case 401:
74
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
75
+ case 403:
76
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
77
+ case 404:
78
+ throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
79
+ case 409:
80
+ throw new Management.ConflictError(_response.error.body, _response.rawResponse);
81
+ case 429:
82
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
83
+ default:
84
+ throw new errors.ManagementError({
85
+ statusCode: _response.error.statusCode,
86
+ body: _response.error.body,
87
+ rawResponse: _response.rawResponse,
88
+ });
89
+ }
90
+ }
91
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/experimentation/experiments/{id}/advance-ramp");
92
+ });
93
+ }
94
+ }
@@ -0,0 +1,2 @@
1
+ export { ExperimentsClient } from "./client/Client.mjs";
2
+ export * from "./client/index.mjs";
@@ -1,3 +1,3 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
- export { OrganizationTemplatesClient } from "./client/Client.mjs";
2
+ export { ExperimentsClient } from "./client/Client.mjs";
3
3
  export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * as experiments from "./experiments/index.mjs";
@@ -0,0 +1 @@
1
+ export * as experiments from "./experiments/index.mjs";
@@ -1,10 +1,14 @@
1
- import type { BaseClientOptions } from "../../../../BaseClient.mjs";
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
2
2
  import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
3
+ import * as core from "../../../../core/index.mjs";
4
+ import * as Management from "../../../index.mjs";
3
5
  import { EnrollmentsClient } from "../resources/enrollments/client/Client.mjs";
4
6
  import { FactorsClient } from "../resources/factors/client/Client.mjs";
5
7
  import { PoliciesClient } from "../resources/policies/client/Client.mjs";
6
8
  export declare namespace GuardianClient {
7
9
  type Options = BaseClientOptions;
10
+ interface RequestOptions extends BaseRequestOptions {
11
+ }
8
12
  }
9
13
  export declare class GuardianClient {
10
14
  protected readonly _options: NormalizedClientOptionsWithAuth<GuardianClient.Options>;
@@ -15,4 +19,39 @@ export declare class GuardianClient {
15
19
  get enrollments(): EnrollmentsClient;
16
20
  get factors(): FactorsClient;
17
21
  get policies(): PoliciesClient;
22
+ /**
23
+ * TODO: Link this endpoint to relevant documentation when available.
24
+ *
25
+ * @param {GuardianClient.RequestOptions} requestOptions - Request-specific configuration.
26
+ *
27
+ * @throws {@link Management.UnauthorizedError}
28
+ * @throws {@link Management.ForbiddenError}
29
+ * @throws {@link Management.TooManyRequestsError}
30
+ *
31
+ * @example
32
+ * await client.guardian.get()
33
+ */
34
+ get(requestOptions?: GuardianClient.RequestOptions): core.HttpResponsePromise<Management.GetGuardianSettingsResponseContent>;
35
+ private __get;
36
+ /**
37
+ * Update a tenant's guardian settings such as Remember Me
38
+ *
39
+ * @param {Management.SetGuardianSettingsRequestContent} request
40
+ * @param {GuardianClient.RequestOptions} requestOptions - Request-specific configuration.
41
+ *
42
+ * @throws {@link Management.BadRequestError}
43
+ * @throws {@link Management.UnauthorizedError}
44
+ * @throws {@link Management.ForbiddenError}
45
+ * @throws {@link Management.TooManyRequestsError}
46
+ *
47
+ * @example
48
+ * await client.guardian.set({
49
+ * display_remember_me_checkbox: true,
50
+ * remember_me_default_value: true,
51
+ * mfa_session_inactivity_timeout: 1,
52
+ * mfa_session_overall_timeout: 1
53
+ * })
54
+ */
55
+ set(request: Management.SetGuardianSettingsRequestContent, requestOptions?: GuardianClient.RequestOptions): core.HttpResponsePromise<Management.SetGuardianSettingsResponseContent>;
56
+ private __set;
18
57
  }
@@ -1,5 +1,20 @@
1
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
+ };
2
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";
3
18
  import { EnrollmentsClient } from "../resources/enrollments/client/Client.mjs";
4
19
  import { FactorsClient } from "../resources/factors/client/Client.mjs";
5
20
  import { PoliciesClient } from "../resources/policies/client/Client.mjs";
@@ -19,4 +34,128 @@ export class GuardianClient {
19
34
  var _a;
20
35
  return ((_a = this._policies) !== null && _a !== void 0 ? _a : (this._policies = new PoliciesClient(this._options)));
21
36
  }
37
+ /**
38
+ * TODO: Link this endpoint to relevant documentation when available.
39
+ *
40
+ * @param {GuardianClient.RequestOptions} requestOptions - Request-specific configuration.
41
+ *
42
+ * @throws {@link Management.UnauthorizedError}
43
+ * @throws {@link Management.ForbiddenError}
44
+ * @throws {@link Management.TooManyRequestsError}
45
+ *
46
+ * @example
47
+ * await client.guardian.get()
48
+ */
49
+ get(requestOptions) {
50
+ return core.HttpResponsePromise.fromPromise(this.__get(requestOptions));
51
+ }
52
+ __get(requestOptions) {
53
+ return __awaiter(this, void 0, void 0, function* () {
54
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
55
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
56
+ 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);
57
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
58
+ 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, "guardian/settings"),
59
+ method: "GET",
60
+ headers: _headers,
61
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
62
+ 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,
63
+ 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,
64
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
65
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
66
+ logging: this._options.logging,
67
+ });
68
+ if (_response.ok) {
69
+ return {
70
+ data: _response.body,
71
+ rawResponse: _response.rawResponse,
72
+ };
73
+ }
74
+ if (_response.error.reason === "status-code") {
75
+ switch (_response.error.statusCode) {
76
+ case 401:
77
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
78
+ case 403:
79
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
80
+ case 429:
81
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
82
+ default:
83
+ throw new errors.ManagementError({
84
+ statusCode: _response.error.statusCode,
85
+ body: _response.error.body,
86
+ rawResponse: _response.rawResponse,
87
+ });
88
+ }
89
+ }
90
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/guardian/settings");
91
+ });
92
+ }
93
+ /**
94
+ * Update a tenant's guardian settings such as Remember Me
95
+ *
96
+ * @param {Management.SetGuardianSettingsRequestContent} request
97
+ * @param {GuardianClient.RequestOptions} requestOptions - Request-specific configuration.
98
+ *
99
+ * @throws {@link Management.BadRequestError}
100
+ * @throws {@link Management.UnauthorizedError}
101
+ * @throws {@link Management.ForbiddenError}
102
+ * @throws {@link Management.TooManyRequestsError}
103
+ *
104
+ * @example
105
+ * await client.guardian.set({
106
+ * display_remember_me_checkbox: true,
107
+ * remember_me_default_value: true,
108
+ * mfa_session_inactivity_timeout: 1,
109
+ * mfa_session_overall_timeout: 1
110
+ * })
111
+ */
112
+ set(request, requestOptions) {
113
+ return core.HttpResponsePromise.fromPromise(this.__set(request, requestOptions));
114
+ }
115
+ __set(request, requestOptions) {
116
+ return __awaiter(this, void 0, void 0, function* () {
117
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
118
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
119
+ 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);
120
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
121
+ 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, "guardian/settings"),
122
+ method: "PUT",
123
+ headers: _headers,
124
+ contentType: "application/json",
125
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
126
+ requestType: "json",
127
+ body: request,
128
+ 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,
129
+ 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,
130
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
131
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
132
+ logging: this._options.logging,
133
+ });
134
+ if (_response.ok) {
135
+ return {
136
+ data: _response.body,
137
+ rawResponse: _response.rawResponse,
138
+ };
139
+ }
140
+ if (_response.error.reason === "status-code") {
141
+ switch (_response.error.statusCode) {
142
+ case 400:
143
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
144
+ case 401:
145
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
146
+ case 403:
147
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
148
+ case 429:
149
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
150
+ default:
151
+ throw new errors.ManagementError({
152
+ statusCode: _response.error.statusCode,
153
+ body: _response.error.body,
154
+ rawResponse: _response.rawResponse,
155
+ });
156
+ }
157
+ }
158
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/guardian/settings");
159
+ });
160
+ }
22
161
  }
@@ -3,6 +3,7 @@ import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClie
3
3
  import * as core from "../../../../../../core/index.mjs";
4
4
  import * as Management from "../../../../../index.mjs";
5
5
  import { DuoClient } from "../resources/duo/client/Client.mjs";
6
+ import { EmailClient } from "../resources/email/client/Client.mjs";
6
7
  import { PhoneClient } from "../resources/phone/client/Client.mjs";
7
8
  import { PushNotificationClient } from "../resources/pushNotification/client/Client.mjs";
8
9
  import { SmsClient } from "../resources/sms/client/Client.mjs";
@@ -13,11 +14,13 @@ export declare namespace FactorsClient {
13
14
  }
14
15
  export declare class FactorsClient {
15
16
  protected readonly _options: NormalizedClientOptionsWithAuth<FactorsClient.Options>;
17
+ protected _email: EmailClient | undefined;
16
18
  protected _phone: PhoneClient | undefined;
17
19
  protected _pushNotification: PushNotificationClient | undefined;
18
20
  protected _sms: SmsClient | undefined;
19
21
  protected _duo: DuoClient | undefined;
20
22
  constructor(options: FactorsClient.Options);
23
+ get email(): EmailClient;
21
24
  get phone(): PhoneClient;
22
25
  get pushNotification(): PushNotificationClient;
23
26
  get sms(): SmsClient;
@@ -16,6 +16,7 @@ import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStat
16
16
  import * as errors from "../../../../../../errors/index.mjs";
17
17
  import * as Management from "../../../../../index.mjs";
18
18
  import { DuoClient } from "../resources/duo/client/Client.mjs";
19
+ import { EmailClient } from "../resources/email/client/Client.mjs";
19
20
  import { PhoneClient } from "../resources/phone/client/Client.mjs";
20
21
  import { PushNotificationClient } from "../resources/pushNotification/client/Client.mjs";
21
22
  import { SmsClient } from "../resources/sms/client/Client.mjs";
@@ -23,6 +24,10 @@ export class FactorsClient {
23
24
  constructor(options) {
24
25
  this._options = normalizeClientOptionsWithAuth(options);
25
26
  }
27
+ get email() {
28
+ var _a;
29
+ return ((_a = this._email) !== null && _a !== void 0 ? _a : (this._email = new EmailClient(this._options)));
30
+ }
26
31
  get phone() {
27
32
  var _a;
28
33
  return ((_a = this._phone) !== null && _a !== void 0 ? _a : (this._phone = new PhoneClient(this._options)));
@@ -0,0 +1,46 @@
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 EmailClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class EmailClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<EmailClient.Options>;
12
+ constructor(options: EmailClient.Options);
13
+ /**
14
+ * TODO: Link this endpoint to relevant documentation when available.
15
+ *
16
+ * @param {EmailClient.RequestOptions} requestOptions - Request-specific configuration.
17
+ *
18
+ * @throws {@link Management.UnauthorizedError}
19
+ * @throws {@link Management.ForbiddenError}
20
+ * @throws {@link Management.TooManyRequestsError}
21
+ *
22
+ * @example
23
+ * await client.guardian.factors.email.get()
24
+ */
25
+ get(requestOptions?: EmailClient.RequestOptions): core.HttpResponsePromise<Management.GetEmailFactorSettingsResponseContent>;
26
+ private __get;
27
+ /**
28
+ * TODO: Link this endpoint to relevant documentation when available.
29
+ *
30
+ * @param {Management.SetEmailFactorSettingsRequestContent} request
31
+ * @param {EmailClient.RequestOptions} requestOptions - Request-specific configuration.
32
+ *
33
+ * @throws {@link Management.BadRequestError}
34
+ * @throws {@link Management.UnauthorizedError}
35
+ * @throws {@link Management.ForbiddenError}
36
+ * @throws {@link Management.TooManyRequestsError}
37
+ *
38
+ * @example
39
+ * await client.guardian.factors.email.set({
40
+ * otp_length: 1,
41
+ * otp_expiration_time: 1
42
+ * })
43
+ */
44
+ set(request: Management.SetEmailFactorSettingsRequestContent, requestOptions?: EmailClient.RequestOptions): core.HttpResponsePromise<Management.SetEmailFactorSettingsResponseContent>;
45
+ private __set;
46
+ }
@@ -0,0 +1,144 @@
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 EmailClient {
19
+ constructor(options) {
20
+ this._options = normalizeClientOptionsWithAuth(options);
21
+ }
22
+ /**
23
+ * TODO: Link this endpoint to relevant documentation when available.
24
+ *
25
+ * @param {EmailClient.RequestOptions} requestOptions - Request-specific configuration.
26
+ *
27
+ * @throws {@link Management.UnauthorizedError}
28
+ * @throws {@link Management.ForbiddenError}
29
+ * @throws {@link Management.TooManyRequestsError}
30
+ *
31
+ * @example
32
+ * await client.guardian.factors.email.get()
33
+ */
34
+ get(requestOptions) {
35
+ return core.HttpResponsePromise.fromPromise(this.__get(requestOptions));
36
+ }
37
+ __get(requestOptions) {
38
+ return __awaiter(this, void 0, void 0, function* () {
39
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
40
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
41
+ 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);
42
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
43
+ 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, "guardian/factors/email/settings"),
44
+ method: "GET",
45
+ headers: _headers,
46
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
47
+ 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,
48
+ 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,
49
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
50
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
51
+ logging: this._options.logging,
52
+ });
53
+ if (_response.ok) {
54
+ return {
55
+ data: _response.body,
56
+ rawResponse: _response.rawResponse,
57
+ };
58
+ }
59
+ if (_response.error.reason === "status-code") {
60
+ switch (_response.error.statusCode) {
61
+ case 401:
62
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
63
+ case 403:
64
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
65
+ case 429:
66
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
67
+ default:
68
+ throw new errors.ManagementError({
69
+ statusCode: _response.error.statusCode,
70
+ body: _response.error.body,
71
+ rawResponse: _response.rawResponse,
72
+ });
73
+ }
74
+ }
75
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/guardian/factors/email/settings");
76
+ });
77
+ }
78
+ /**
79
+ * TODO: Link this endpoint to relevant documentation when available.
80
+ *
81
+ * @param {Management.SetEmailFactorSettingsRequestContent} request
82
+ * @param {EmailClient.RequestOptions} requestOptions - Request-specific configuration.
83
+ *
84
+ * @throws {@link Management.BadRequestError}
85
+ * @throws {@link Management.UnauthorizedError}
86
+ * @throws {@link Management.ForbiddenError}
87
+ * @throws {@link Management.TooManyRequestsError}
88
+ *
89
+ * @example
90
+ * await client.guardian.factors.email.set({
91
+ * otp_length: 1,
92
+ * otp_expiration_time: 1
93
+ * })
94
+ */
95
+ set(request, requestOptions) {
96
+ return core.HttpResponsePromise.fromPromise(this.__set(request, requestOptions));
97
+ }
98
+ __set(request, requestOptions) {
99
+ return __awaiter(this, void 0, void 0, function* () {
100
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
101
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
102
+ 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);
103
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
104
+ 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, "guardian/factors/email/settings"),
105
+ method: "PUT",
106
+ headers: _headers,
107
+ contentType: "application/json",
108
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
109
+ requestType: "json",
110
+ body: request,
111
+ 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,
112
+ 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,
113
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
114
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
115
+ logging: this._options.logging,
116
+ });
117
+ if (_response.ok) {
118
+ return {
119
+ data: _response.body,
120
+ rawResponse: _response.rawResponse,
121
+ };
122
+ }
123
+ if (_response.error.reason === "status-code") {
124
+ switch (_response.error.statusCode) {
125
+ case 400:
126
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
127
+ case 401:
128
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
129
+ case 403:
130
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
131
+ case 429:
132
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
133
+ default:
134
+ throw new errors.ManagementError({
135
+ statusCode: _response.error.statusCode,
136
+ body: _response.error.body,
137
+ rawResponse: _response.rawResponse,
138
+ });
139
+ }
140
+ }
141
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/guardian/factors/email/settings");
142
+ });
143
+ }
144
+ }
@@ -0,0 +1,2 @@
1
+ export { EmailClient } 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 { EmailClient } 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";