auth0 7.0.0 → 7.2.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 +117 -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 +287 -51
  43. package/dist/cjs/management/api/types/types.js +51 -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 +117 -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 +287 -51
  92. package/dist/esm/management/api/types/types.mjs +48 -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
@@ -1,106 +0,0 @@
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
- }
@@ -1,411 +0,0 @@
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;
@@ -1,2 +0,0 @@
1
- export { OrganizationTemplatesClient } from "./client/Client.js";
2
- export * from "./client/index.js";
@@ -1,106 +0,0 @@
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 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
- }