auth0 6.3.0 → 6.4.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 (86) hide show
  1. package/dist/cjs/management/Client.d.ts +3 -0
  2. package/dist/cjs/management/Client.js +45 -40
  3. package/dist/cjs/management/api/errors/UnprocessableEntityError.d.ts +5 -0
  4. package/dist/cjs/management/api/errors/UnprocessableEntityError.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 +91 -0
  8. package/dist/cjs/management/api/resources/connections/client/Client.d.ts +2 -0
  9. package/dist/cjs/management/api/resources/connections/client/Client.js +6 -0
  10. package/dist/cjs/management/api/resources/connections/resources/scimConfiguration/client/Client.d.ts +1 -0
  11. package/dist/cjs/management/api/resources/connections/resources/scimConfiguration/client/Client.js +3 -0
  12. package/dist/cjs/management/api/resources/index.d.ts +1 -0
  13. package/dist/cjs/management/api/resources/index.js +2 -1
  14. package/dist/cjs/management/api/resources/keys/resources/networkAcls/client/Client.d.ts +17 -0
  15. package/dist/cjs/management/api/resources/keys/resources/networkAcls/client/Client.js +60 -0
  16. package/dist/cjs/management/api/resources/organizationTemplates/client/Client.d.ts +106 -0
  17. package/dist/cjs/management/api/resources/organizationTemplates/client/Client.js +411 -0
  18. package/dist/cjs/management/api/resources/organizationTemplates/client/index.d.ts +1 -0
  19. package/dist/cjs/management/api/resources/organizationTemplates/client/index.js +2 -0
  20. package/dist/cjs/management/api/resources/organizationTemplates/exports.d.ts +2 -0
  21. package/dist/cjs/management/api/resources/organizationTemplates/exports.js +21 -0
  22. package/dist/cjs/management/api/resources/organizationTemplates/index.d.ts +1 -0
  23. package/dist/cjs/management/api/resources/organizationTemplates/index.js +17 -0
  24. package/dist/cjs/management/api/resources/organizations/client/Client.d.ts +3 -0
  25. package/dist/cjs/management/api/resources/organizations/client/Client.js +7 -2
  26. package/dist/cjs/management/api/resources/organizations/resources/index.d.ts +1 -0
  27. package/dist/cjs/management/api/resources/organizations/resources/index.js +2 -1
  28. package/dist/cjs/management/api/resources/organizations/resources/organizationTemplate/client/Client.d.ts +63 -0
  29. package/dist/cjs/management/api/resources/organizations/resources/organizationTemplate/client/Client.js +232 -0
  30. package/dist/cjs/management/api/resources/organizations/resources/organizationTemplate/client/index.d.ts +1 -0
  31. package/dist/cjs/management/api/resources/organizations/resources/organizationTemplate/client/index.js +2 -0
  32. package/dist/cjs/management/api/resources/organizations/resources/organizationTemplate/exports.d.ts +2 -0
  33. package/dist/cjs/management/api/resources/organizations/resources/organizationTemplate/exports.js +21 -0
  34. package/dist/cjs/management/api/resources/organizations/resources/organizationTemplate/index.d.ts +1 -0
  35. package/dist/cjs/management/api/resources/organizations/resources/organizationTemplate/index.js +17 -0
  36. package/dist/cjs/management/api/resources/users/resources/organizations/client/Client.d.ts +17 -0
  37. package/dist/cjs/management/api/resources/users/resources/organizations/client/Client.js +19 -0
  38. package/dist/cjs/management/api/types/types.d.ts +8896 -2027
  39. package/dist/cjs/management/api/types/types.js +1455 -166
  40. package/dist/cjs/management/version.d.ts +1 -1
  41. package/dist/cjs/management/version.js +1 -1
  42. package/dist/cjs/management/wrapper/token-provider.js +1 -1
  43. package/dist/esm/management/Client.d.mts +3 -0
  44. package/dist/esm/management/Client.mjs +5 -0
  45. package/dist/esm/management/api/errors/UnprocessableEntityError.d.mts +5 -0
  46. package/dist/esm/management/api/errors/UnprocessableEntityError.mjs +17 -0
  47. package/dist/esm/management/api/errors/index.d.mts +1 -0
  48. package/dist/esm/management/api/errors/index.mjs +1 -0
  49. package/dist/esm/management/api/requests/requests.d.mts +91 -0
  50. package/dist/esm/management/api/resources/connections/client/Client.d.mts +2 -0
  51. package/dist/esm/management/api/resources/connections/client/Client.mjs +6 -0
  52. package/dist/esm/management/api/resources/connections/resources/scimConfiguration/client/Client.d.mts +1 -0
  53. package/dist/esm/management/api/resources/connections/resources/scimConfiguration/client/Client.mjs +3 -0
  54. package/dist/esm/management/api/resources/index.d.mts +1 -0
  55. package/dist/esm/management/api/resources/index.mjs +1 -0
  56. package/dist/esm/management/api/resources/keys/resources/networkAcls/client/Client.d.mts +17 -0
  57. package/dist/esm/management/api/resources/keys/resources/networkAcls/client/Client.mjs +60 -0
  58. package/dist/esm/management/api/resources/organizationTemplates/client/Client.d.mts +106 -0
  59. package/dist/esm/management/api/resources/organizationTemplates/client/Client.mjs +374 -0
  60. package/dist/esm/management/api/resources/organizationTemplates/client/index.d.mts +1 -0
  61. package/dist/esm/management/api/resources/organizationTemplates/client/index.mjs +1 -0
  62. package/dist/esm/management/api/resources/organizationTemplates/exports.d.mts +2 -0
  63. package/dist/esm/management/api/resources/organizationTemplates/exports.mjs +3 -0
  64. package/dist/esm/management/api/resources/organizationTemplates/index.d.mts +1 -0
  65. package/dist/esm/management/api/resources/organizationTemplates/index.mjs +1 -0
  66. package/dist/esm/management/api/resources/organizations/client/Client.d.mts +3 -0
  67. package/dist/esm/management/api/resources/organizations/client/Client.mjs +5 -0
  68. package/dist/esm/management/api/resources/organizations/resources/index.d.mts +1 -0
  69. package/dist/esm/management/api/resources/organizations/resources/index.mjs +1 -0
  70. package/dist/esm/management/api/resources/organizations/resources/organizationTemplate/client/Client.d.mts +63 -0
  71. package/dist/esm/management/api/resources/organizations/resources/organizationTemplate/client/Client.mjs +195 -0
  72. package/dist/esm/management/api/resources/organizations/resources/organizationTemplate/client/index.d.mts +1 -0
  73. package/dist/esm/management/api/resources/organizations/resources/organizationTemplate/client/index.mjs +1 -0
  74. package/dist/esm/management/api/resources/organizations/resources/organizationTemplate/exports.d.mts +2 -0
  75. package/dist/esm/management/api/resources/organizations/resources/organizationTemplate/exports.mjs +3 -0
  76. package/dist/esm/management/api/resources/organizations/resources/organizationTemplate/index.d.mts +1 -0
  77. package/dist/esm/management/api/resources/organizations/resources/organizationTemplate/index.mjs +1 -0
  78. package/dist/esm/management/api/resources/users/resources/organizations/client/Client.d.mts +17 -0
  79. package/dist/esm/management/api/resources/users/resources/organizations/client/Client.mjs +19 -0
  80. package/dist/esm/management/api/types/types.d.mts +8896 -2027
  81. package/dist/esm/management/api/types/types.mjs +1434 -150
  82. package/dist/esm/management/version.d.mts +1 -1
  83. package/dist/esm/management/version.mjs +1 -1
  84. package/dist/esm/management/wrapper/token-provider.mjs +1 -1
  85. package/package.json +23 -1
  86. package/reference.md +688 -28
@@ -0,0 +1,106 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
3
+ import * as core from "../../../../core/index.js";
4
+ import * as Management from "../../../index.js";
5
+ export declare namespace OrganizationTemplatesClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class OrganizationTemplatesClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<OrganizationTemplatesClient.Options>;
12
+ constructor(options: OrganizationTemplatesClient.Options);
13
+ /**
14
+ * Retrieve a list of Organization Templates. This endpoint supports Checkpoint pagination. Results are returned in a stable order, sorted by their identifier (`id`) in ascending order.
15
+ *
16
+ * @param {Management.ListOrganizationTemplatesRequestParameters} request
17
+ * @param {OrganizationTemplatesClient.RequestOptions} requestOptions - Request-specific configuration.
18
+ *
19
+ * @throws {@link Management.BadRequestError}
20
+ * @throws {@link Management.UnauthorizedError}
21
+ * @throws {@link Management.ForbiddenError}
22
+ * @throws {@link Management.TooManyRequestsError}
23
+ *
24
+ * @example
25
+ * await client.organizationTemplates.list({
26
+ * from: "from",
27
+ * take: 1
28
+ * })
29
+ */
30
+ list(request?: Management.ListOrganizationTemplatesRequestParameters, requestOptions?: OrganizationTemplatesClient.RequestOptions): Promise<core.Page<Management.OrganizationTemplate, Management.ListOrganizationTemplatesPaginatedResponseContent>>;
31
+ /**
32
+ * Create an Organization Template.
33
+ *
34
+ * @param {Management.CreateOrganizationTemplateRequestContent} request
35
+ * @param {OrganizationTemplatesClient.RequestOptions} requestOptions - Request-specific configuration.
36
+ *
37
+ * @throws {@link Management.BadRequestError}
38
+ * @throws {@link Management.UnauthorizedError}
39
+ * @throws {@link Management.ForbiddenError}
40
+ * @throws {@link Management.ConflictError}
41
+ * @throws {@link Management.TooManyRequestsError}
42
+ *
43
+ * @example
44
+ * await client.organizationTemplates.create({
45
+ * name: "name",
46
+ * organization_deletion_behavior: "allow",
47
+ * enforce_permission_ceiling: true,
48
+ * enforce_self_assignment_restriction: true
49
+ * })
50
+ */
51
+ create(request: Management.CreateOrganizationTemplateRequestContent, requestOptions?: OrganizationTemplatesClient.RequestOptions): core.HttpResponsePromise<Management.OrganizationTemplate>;
52
+ private __create;
53
+ /**
54
+ * Retrieve details about a single Organization Template specified by ID.
55
+ *
56
+ * @param {string} id - Organization Template identifier.
57
+ * @param {OrganizationTemplatesClient.RequestOptions} requestOptions - Request-specific configuration.
58
+ *
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.organizationTemplates.get("id")
66
+ */
67
+ get(id: string, requestOptions?: OrganizationTemplatesClient.RequestOptions): core.HttpResponsePromise<Management.OrganizationTemplate>;
68
+ private __get;
69
+ /**
70
+ * Update the details of a specific Organization Template.
71
+ *
72
+ * @param {string} id - Organization Template identifier.
73
+ * @param {Management.UpdateOrganizationTemplateRequestContent} request
74
+ * @param {OrganizationTemplatesClient.RequestOptions} requestOptions - Request-specific configuration.
75
+ *
76
+ * @throws {@link Management.BadRequestError}
77
+ * @throws {@link Management.UnauthorizedError}
78
+ * @throws {@link Management.ForbiddenError}
79
+ * @throws {@link Management.NotFoundError}
80
+ * @throws {@link Management.TooManyRequestsError}
81
+ *
82
+ * @example
83
+ * await client.organizationTemplates.update("id")
84
+ */
85
+ update(id: string, request?: Management.UpdateOrganizationTemplateRequestContent, requestOptions?: OrganizationTemplatesClient.RequestOptions): core.HttpResponsePromise<Management.OrganizationTemplate>;
86
+ private __update;
87
+ /**
88
+ * Retrieve a list of organizations assigned to an Organization Template. This endpoint supports Checkpoint pagination. Results are returned in a stable order, sorted by their identifier (`id`) in ascending order.
89
+ *
90
+ * @param {string} id - The ID of the organization template.
91
+ * @param {Management.ListTemplateOrganizationsRequestParameters} request
92
+ * @param {OrganizationTemplatesClient.RequestOptions} requestOptions - Request-specific configuration.
93
+ *
94
+ * @throws {@link Management.BadRequestError}
95
+ * @throws {@link Management.UnauthorizedError}
96
+ * @throws {@link Management.ForbiddenError}
97
+ * @throws {@link Management.TooManyRequestsError}
98
+ *
99
+ * @example
100
+ * await client.organizationTemplates.listOrganizations("id", {
101
+ * from: "from",
102
+ * take: 1
103
+ * })
104
+ */
105
+ listOrganizations(id: string, request?: Management.ListTemplateOrganizationsRequestParameters, requestOptions?: OrganizationTemplatesClient.RequestOptions): Promise<core.Page<Management.OrganizationTemplateAssignedOrganization, Management.ListTemplateOrganizationsPaginatedResponseContent>>;
106
+ }
@@ -0,0 +1,411 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.OrganizationTemplatesClient = void 0;
47
+ const BaseClient_js_1 = require("../../../../BaseClient.js");
48
+ const core = __importStar(require("../../../../core/index.js"));
49
+ const headers_js_1 = require("../../../../core/headers.js");
50
+ const environments = __importStar(require("../../../../environments.js"));
51
+ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
52
+ const errors = __importStar(require("../../../../errors/index.js"));
53
+ const Management = __importStar(require("../../../index.js"));
54
+ class OrganizationTemplatesClient {
55
+ constructor(options) {
56
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
57
+ }
58
+ /**
59
+ * Retrieve a list of Organization Templates. This endpoint supports Checkpoint pagination. Results are returned in a stable order, sorted by their identifier (`id`) in ascending order.
60
+ *
61
+ * @param {Management.ListOrganizationTemplatesRequestParameters} request
62
+ * @param {OrganizationTemplatesClient.RequestOptions} requestOptions - Request-specific configuration.
63
+ *
64
+ * @throws {@link Management.BadRequestError}
65
+ * @throws {@link Management.UnauthorizedError}
66
+ * @throws {@link Management.ForbiddenError}
67
+ * @throws {@link Management.TooManyRequestsError}
68
+ *
69
+ * @example
70
+ * await client.organizationTemplates.list({
71
+ * from: "from",
72
+ * take: 1
73
+ * })
74
+ */
75
+ list() {
76
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
77
+ const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
78
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
79
+ const { from: from_, take = 5 } = request;
80
+ const _queryParams = {
81
+ from: from_,
82
+ take,
83
+ };
84
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
85
+ 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);
86
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
87
+ 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, "organization-templates"),
88
+ method: "GET",
89
+ headers: _headers,
90
+ queryString: core.url
91
+ .queryBuilder()
92
+ .addMany(_queryParams)
93
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
94
+ .build(),
95
+ 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,
96
+ 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,
97
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
98
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
99
+ logging: this._options.logging,
100
+ });
101
+ if (_response.ok) {
102
+ return {
103
+ data: _response.body,
104
+ rawResponse: _response.rawResponse,
105
+ };
106
+ }
107
+ if (_response.error.reason === "status-code") {
108
+ switch (_response.error.statusCode) {
109
+ case 400:
110
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
111
+ case 401:
112
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
113
+ case 403:
114
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
115
+ case 429:
116
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
117
+ default:
118
+ throw new errors.ManagementError({
119
+ statusCode: _response.error.statusCode,
120
+ body: _response.error.body,
121
+ rawResponse: _response.rawResponse,
122
+ });
123
+ }
124
+ }
125
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/organization-templates");
126
+ }));
127
+ const dataWithRawResponse = yield list(request).withRawResponse();
128
+ return new core.Page({
129
+ response: dataWithRawResponse.data,
130
+ rawResponse: dataWithRawResponse.rawResponse,
131
+ 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) === ""),
132
+ getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.organization_templates) !== null && _a !== void 0 ? _a : []; },
133
+ loadPage: (response) => {
134
+ return list(core.setObjectProperty(request, "from", response === null || response === void 0 ? void 0 : response.next));
135
+ },
136
+ });
137
+ });
138
+ }
139
+ /**
140
+ * Create an Organization Template.
141
+ *
142
+ * @param {Management.CreateOrganizationTemplateRequestContent} request
143
+ * @param {OrganizationTemplatesClient.RequestOptions} requestOptions - Request-specific configuration.
144
+ *
145
+ * @throws {@link Management.BadRequestError}
146
+ * @throws {@link Management.UnauthorizedError}
147
+ * @throws {@link Management.ForbiddenError}
148
+ * @throws {@link Management.ConflictError}
149
+ * @throws {@link Management.TooManyRequestsError}
150
+ *
151
+ * @example
152
+ * await client.organizationTemplates.create({
153
+ * name: "name",
154
+ * organization_deletion_behavior: "allow",
155
+ * enforce_permission_ceiling: true,
156
+ * enforce_self_assignment_restriction: true
157
+ * })
158
+ */
159
+ create(request, requestOptions) {
160
+ return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
161
+ }
162
+ __create(request, requestOptions) {
163
+ return __awaiter(this, void 0, void 0, function* () {
164
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
165
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
166
+ 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);
167
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
168
+ 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, "organization-templates"),
169
+ method: "POST",
170
+ headers: _headers,
171
+ contentType: "application/json",
172
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
173
+ requestType: "json",
174
+ body: request,
175
+ 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,
176
+ 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,
177
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
178
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
179
+ logging: this._options.logging,
180
+ });
181
+ if (_response.ok) {
182
+ return { data: _response.body, rawResponse: _response.rawResponse };
183
+ }
184
+ if (_response.error.reason === "status-code") {
185
+ switch (_response.error.statusCode) {
186
+ case 400:
187
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
188
+ case 401:
189
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
190
+ case 403:
191
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
192
+ case 409:
193
+ throw new Management.ConflictError(_response.error.body, _response.rawResponse);
194
+ case 429:
195
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
196
+ default:
197
+ throw new errors.ManagementError({
198
+ statusCode: _response.error.statusCode,
199
+ body: _response.error.body,
200
+ rawResponse: _response.rawResponse,
201
+ });
202
+ }
203
+ }
204
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/organization-templates");
205
+ });
206
+ }
207
+ /**
208
+ * Retrieve details about a single Organization Template specified by ID.
209
+ *
210
+ * @param {string} id - Organization Template identifier.
211
+ * @param {OrganizationTemplatesClient.RequestOptions} requestOptions - Request-specific configuration.
212
+ *
213
+ * @throws {@link Management.UnauthorizedError}
214
+ * @throws {@link Management.ForbiddenError}
215
+ * @throws {@link Management.NotFoundError}
216
+ * @throws {@link Management.TooManyRequestsError}
217
+ *
218
+ * @example
219
+ * await client.organizationTemplates.get("id")
220
+ */
221
+ get(id, requestOptions) {
222
+ return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions));
223
+ }
224
+ __get(id, requestOptions) {
225
+ return __awaiter(this, void 0, void 0, function* () {
226
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
227
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
228
+ 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);
229
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
230
+ 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, `organization-templates/${core.url.encodePathParam(id)}`),
231
+ method: "GET",
232
+ headers: _headers,
233
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
234
+ 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,
235
+ 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,
236
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
237
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
238
+ logging: this._options.logging,
239
+ });
240
+ if (_response.ok) {
241
+ return { data: _response.body, rawResponse: _response.rawResponse };
242
+ }
243
+ if (_response.error.reason === "status-code") {
244
+ switch (_response.error.statusCode) {
245
+ case 401:
246
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
247
+ case 403:
248
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
249
+ case 404:
250
+ throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
251
+ case 429:
252
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
253
+ default:
254
+ throw new errors.ManagementError({
255
+ statusCode: _response.error.statusCode,
256
+ body: _response.error.body,
257
+ rawResponse: _response.rawResponse,
258
+ });
259
+ }
260
+ }
261
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/organization-templates/{id}");
262
+ });
263
+ }
264
+ /**
265
+ * Update the details of a specific Organization Template.
266
+ *
267
+ * @param {string} id - Organization Template identifier.
268
+ * @param {Management.UpdateOrganizationTemplateRequestContent} request
269
+ * @param {OrganizationTemplatesClient.RequestOptions} requestOptions - Request-specific configuration.
270
+ *
271
+ * @throws {@link Management.BadRequestError}
272
+ * @throws {@link Management.UnauthorizedError}
273
+ * @throws {@link Management.ForbiddenError}
274
+ * @throws {@link Management.NotFoundError}
275
+ * @throws {@link Management.TooManyRequestsError}
276
+ *
277
+ * @example
278
+ * await client.organizationTemplates.update("id")
279
+ */
280
+ update(id, request = {}, requestOptions) {
281
+ return core.HttpResponsePromise.fromPromise(this.__update(id, request, requestOptions));
282
+ }
283
+ __update(id_1) {
284
+ return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
285
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
286
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
287
+ 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);
288
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
289
+ 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, `organization-templates/${core.url.encodePathParam(id)}`),
290
+ method: "PATCH",
291
+ headers: _headers,
292
+ contentType: "application/json",
293
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
294
+ requestType: "json",
295
+ body: request,
296
+ 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,
297
+ 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,
298
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
299
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
300
+ logging: this._options.logging,
301
+ });
302
+ if (_response.ok) {
303
+ return { data: _response.body, rawResponse: _response.rawResponse };
304
+ }
305
+ if (_response.error.reason === "status-code") {
306
+ switch (_response.error.statusCode) {
307
+ case 400:
308
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
309
+ case 401:
310
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
311
+ case 403:
312
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
313
+ case 404:
314
+ throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
315
+ case 429:
316
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
317
+ default:
318
+ throw new errors.ManagementError({
319
+ statusCode: _response.error.statusCode,
320
+ body: _response.error.body,
321
+ rawResponse: _response.rawResponse,
322
+ });
323
+ }
324
+ }
325
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/organization-templates/{id}");
326
+ });
327
+ }
328
+ /**
329
+ * Retrieve a list of organizations assigned to an Organization Template. This endpoint supports Checkpoint pagination. Results are returned in a stable order, sorted by their identifier (`id`) in ascending order.
330
+ *
331
+ * @param {string} id - The ID of the organization template.
332
+ * @param {Management.ListTemplateOrganizationsRequestParameters} request
333
+ * @param {OrganizationTemplatesClient.RequestOptions} requestOptions - Request-specific configuration.
334
+ *
335
+ * @throws {@link Management.BadRequestError}
336
+ * @throws {@link Management.UnauthorizedError}
337
+ * @throws {@link Management.ForbiddenError}
338
+ * @throws {@link Management.TooManyRequestsError}
339
+ *
340
+ * @example
341
+ * await client.organizationTemplates.listOrganizations("id", {
342
+ * from: "from",
343
+ * take: 1
344
+ * })
345
+ */
346
+ listOrganizations(id_1) {
347
+ return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
348
+ const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
349
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
350
+ const { from: from_, take = 5 } = request;
351
+ const _queryParams = {
352
+ from: from_,
353
+ take,
354
+ };
355
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
356
+ 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);
357
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
358
+ 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, `organization-templates/${core.url.encodePathParam(id)}/organizations`),
359
+ method: "GET",
360
+ headers: _headers,
361
+ queryString: core.url
362
+ .queryBuilder()
363
+ .addMany(_queryParams)
364
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
365
+ .build(),
366
+ 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,
367
+ 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,
368
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
369
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
370
+ logging: this._options.logging,
371
+ });
372
+ if (_response.ok) {
373
+ return {
374
+ data: _response.body,
375
+ rawResponse: _response.rawResponse,
376
+ };
377
+ }
378
+ if (_response.error.reason === "status-code") {
379
+ switch (_response.error.statusCode) {
380
+ case 400:
381
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
382
+ case 401:
383
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
384
+ case 403:
385
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
386
+ case 429:
387
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
388
+ default:
389
+ throw new errors.ManagementError({
390
+ statusCode: _response.error.statusCode,
391
+ body: _response.error.body,
392
+ rawResponse: _response.rawResponse,
393
+ });
394
+ }
395
+ }
396
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/organization-templates/{id}/organizations");
397
+ }));
398
+ const dataWithRawResponse = yield list(request).withRawResponse();
399
+ return new core.Page({
400
+ response: dataWithRawResponse.data,
401
+ rawResponse: dataWithRawResponse.rawResponse,
402
+ 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) === ""),
403
+ getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.organizations) !== null && _a !== void 0 ? _a : []; },
404
+ loadPage: (response) => {
405
+ return list(core.setObjectProperty(request, "from", response === null || response === void 0 ? void 0 : response.next));
406
+ },
407
+ });
408
+ });
409
+ }
410
+ }
411
+ exports.OrganizationTemplatesClient = OrganizationTemplatesClient;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export { OrganizationTemplatesClient } from "./client/Client.js";
2
+ export * from "./client/index.js";
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.OrganizationTemplatesClient = void 0;
19
+ var Client_js_1 = require("./client/Client.js");
20
+ Object.defineProperty(exports, "OrganizationTemplatesClient", { enumerable: true, get: function () { return Client_js_1.OrganizationTemplatesClient; } });
21
+ __exportStar(require("./client/index.js"), exports);
@@ -0,0 +1 @@
1
+ export * from "./client/index.js";
@@ -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);
@@ -10,6 +10,7 @@ import { EnabledConnectionsClient } from "../resources/enabledConnections/client
10
10
  import { GroupsClient } from "../resources/groups/client/Client.js";
11
11
  import { InvitationsClient } from "../resources/invitations/client/Client.js";
12
12
  import { MembersClient } from "../resources/members/client/Client.js";
13
+ import { OrganizationTemplateClient } from "../resources/organizationTemplate/client/Client.js";
13
14
  import { RolesClient } from "../resources/roles/client/Client.js";
14
15
  export declare namespace OrganizationsClient {
15
16
  type Options = BaseClientOptions;
@@ -25,6 +26,7 @@ export declare class OrganizationsClient {
25
26
  protected _enabledConnections: EnabledConnectionsClient | undefined;
26
27
  protected _invitations: InvitationsClient | undefined;
27
28
  protected _members: MembersClient | undefined;
29
+ protected _organizationTemplate: OrganizationTemplateClient | undefined;
28
30
  protected _groups: GroupsClient | undefined;
29
31
  protected _roles: RolesClient | undefined;
30
32
  constructor(options: OrganizationsClient.Options);
@@ -35,6 +37,7 @@ export declare class OrganizationsClient {
35
37
  get enabledConnections(): EnabledConnectionsClient;
36
38
  get invitations(): InvitationsClient;
37
39
  get members(): MembersClient;
40
+ get organizationTemplate(): OrganizationTemplateClient;
38
41
  get groups(): GroupsClient;
39
42
  get roles(): RolesClient;
40
43
  /**
@@ -59,7 +59,8 @@ const Client_js_5 = require("../resources/enabledConnections/client/Client.js");
59
59
  const Client_js_6 = require("../resources/groups/client/Client.js");
60
60
  const Client_js_7 = require("../resources/invitations/client/Client.js");
61
61
  const Client_js_8 = require("../resources/members/client/Client.js");
62
- const Client_js_9 = require("../resources/roles/client/Client.js");
62
+ const Client_js_9 = require("../resources/organizationTemplate/client/Client.js");
63
+ const Client_js_10 = require("../resources/roles/client/Client.js");
63
64
  class OrganizationsClient {
64
65
  constructor(options) {
65
66
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
@@ -92,13 +93,17 @@ class OrganizationsClient {
92
93
  var _a;
93
94
  return ((_a = this._members) !== null && _a !== void 0 ? _a : (this._members = new Client_js_8.MembersClient(this._options)));
94
95
  }
96
+ get organizationTemplate() {
97
+ var _a;
98
+ return ((_a = this._organizationTemplate) !== null && _a !== void 0 ? _a : (this._organizationTemplate = new Client_js_9.OrganizationTemplateClient(this._options)));
99
+ }
95
100
  get groups() {
96
101
  var _a;
97
102
  return ((_a = this._groups) !== null && _a !== void 0 ? _a : (this._groups = new Client_js_6.GroupsClient(this._options)));
98
103
  }
99
104
  get roles() {
100
105
  var _a;
101
- return ((_a = this._roles) !== null && _a !== void 0 ? _a : (this._roles = new Client_js_9.RolesClient(this._options)));
106
+ return ((_a = this._roles) !== null && _a !== void 0 ? _a : (this._roles = new Client_js_10.RolesClient(this._options)));
102
107
  }
103
108
  /**
104
109
  * Retrieve detailed list of all Organizations available in your tenant. For more information, see Auth0 Organizations.
@@ -6,4 +6,5 @@ export * as enabledConnections from "./enabledConnections/index.js";
6
6
  export * as groups from "./groups/index.js";
7
7
  export * as invitations from "./invitations/index.js";
8
8
  export * as members from "./members/index.js";
9
+ export * as organizationTemplate from "./organizationTemplate/index.js";
9
10
  export * as roles from "./roles/index.js";
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.roles = exports.members = exports.invitations = exports.groups = exports.enabledConnections = exports.discoveryDomains = exports.connections = exports.clients = exports.clientGrants = void 0;
36
+ exports.roles = exports.organizationTemplate = exports.members = exports.invitations = exports.groups = exports.enabledConnections = exports.discoveryDomains = exports.connections = exports.clients = exports.clientGrants = void 0;
37
37
  exports.clientGrants = __importStar(require("./clientGrants/index.js"));
38
38
  exports.clients = __importStar(require("./clients/index.js"));
39
39
  exports.connections = __importStar(require("./connections/index.js"));
@@ -42,4 +42,5 @@ exports.enabledConnections = __importStar(require("./enabledConnections/index.js
42
42
  exports.groups = __importStar(require("./groups/index.js"));
43
43
  exports.invitations = __importStar(require("./invitations/index.js"));
44
44
  exports.members = __importStar(require("./members/index.js"));
45
+ exports.organizationTemplate = __importStar(require("./organizationTemplate/index.js"));
45
46
  exports.roles = __importStar(require("./roles/index.js"));