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.
- package/dist/cjs/management/Client.d.ts +5 -5
- package/dist/cjs/management/Client.js +28 -28
- package/dist/cjs/management/api/errors/GatewayTimeoutError.d.ts +5 -0
- package/dist/cjs/management/api/errors/GatewayTimeoutError.js +54 -0
- package/dist/cjs/management/api/errors/index.d.ts +1 -0
- package/dist/cjs/management/api/errors/index.js +1 -0
- package/dist/cjs/management/api/requests/requests.d.ts +117 -88
- package/dist/cjs/management/api/resources/experimentation/client/Client.d.ts +12 -0
- package/dist/cjs/management/api/resources/experimentation/client/Client.js +16 -0
- package/dist/cjs/management/api/resources/experimentation/exports.d.ts +3 -0
- package/dist/cjs/management/api/resources/experimentation/exports.js +22 -0
- package/dist/cjs/management/api/resources/experimentation/index.d.ts +2 -0
- package/dist/cjs/management/api/resources/experimentation/index.js +18 -0
- package/dist/cjs/management/api/resources/experimentation/resources/experiments/client/Client.d.ts +34 -0
- package/dist/cjs/management/api/resources/experimentation/resources/experiments/client/Client.js +131 -0
- package/dist/cjs/management/api/resources/experimentation/resources/experiments/client/index.js +2 -0
- package/dist/cjs/management/api/resources/experimentation/resources/experiments/exports.d.ts +2 -0
- package/dist/cjs/management/api/resources/{organizationTemplates → experimentation/resources/experiments}/exports.js +2 -2
- package/dist/cjs/management/api/resources/experimentation/resources/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/experimentation/resources/index.js +37 -0
- package/dist/cjs/management/api/resources/guardian/client/Client.d.ts +40 -1
- package/dist/cjs/management/api/resources/guardian/client/Client.js +172 -0
- package/dist/cjs/management/api/resources/guardian/resources/factors/client/Client.d.ts +3 -0
- package/dist/cjs/management/api/resources/guardian/resources/factors/client/Client.js +11 -6
- package/dist/cjs/management/api/resources/guardian/resources/factors/resources/email/client/Client.d.ts +46 -0
- package/dist/cjs/management/api/resources/guardian/resources/factors/resources/email/client/Client.js +181 -0
- package/dist/cjs/management/api/resources/guardian/resources/factors/resources/email/client/index.js +2 -0
- package/dist/cjs/management/api/resources/guardian/resources/factors/resources/email/exports.d.ts +2 -0
- package/dist/cjs/management/api/resources/guardian/resources/factors/resources/email/exports.js +21 -0
- package/dist/cjs/management/api/resources/guardian/resources/factors/resources/email/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/guardian/resources/factors/resources/email/index.js +17 -0
- package/dist/cjs/management/api/resources/guardian/resources/factors/resources/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/guardian/resources/factors/resources/index.js +2 -1
- package/dist/cjs/management/api/resources/guardian/resources/factors/resources/phone/client/Client.d.ts +33 -0
- package/dist/cjs/management/api/resources/guardian/resources/factors/resources/phone/client/Client.js +122 -0
- package/dist/cjs/management/api/resources/index.d.ts +1 -1
- package/dist/cjs/management/api/resources/index.js +2 -2
- package/dist/cjs/management/api/resources/organizations/client/Client.d.ts +36 -0
- package/dist/cjs/management/api/resources/organizations/client/Client.js +104 -0
- package/dist/cjs/management/api/resources/resourceServers/client/Client.d.ts +29 -0
- package/dist/cjs/management/api/resources/resourceServers/client/Client.js +103 -0
- package/dist/cjs/management/api/types/types.d.ts +287 -51
- package/dist/cjs/management/api/types/types.js +51 -36
- package/dist/cjs/management/version.d.ts +1 -1
- package/dist/cjs/management/version.js +1 -1
- package/dist/esm/management/Client.d.mts +5 -5
- package/dist/esm/management/Client.mjs +7 -7
- package/dist/esm/management/api/errors/GatewayTimeoutError.d.mts +5 -0
- package/dist/esm/management/api/errors/GatewayTimeoutError.mjs +17 -0
- package/dist/esm/management/api/errors/index.d.mts +1 -0
- package/dist/esm/management/api/errors/index.mjs +1 -0
- package/dist/esm/management/api/requests/requests.d.mts +117 -88
- package/dist/esm/management/api/resources/experimentation/client/Client.d.mts +12 -0
- package/dist/esm/management/api/resources/experimentation/client/Client.mjs +12 -0
- package/dist/esm/management/api/resources/experimentation/client/index.d.mts +1 -0
- package/dist/esm/management/api/resources/experimentation/client/index.mjs +1 -0
- package/dist/esm/management/api/resources/experimentation/exports.d.mts +3 -0
- package/dist/esm/management/api/resources/experimentation/exports.mjs +4 -0
- package/dist/esm/management/api/resources/experimentation/index.d.mts +2 -0
- package/dist/esm/management/api/resources/experimentation/index.mjs +2 -0
- package/dist/esm/management/api/resources/experimentation/resources/experiments/client/Client.d.mts +34 -0
- package/dist/esm/management/api/resources/experimentation/resources/experiments/client/Client.mjs +94 -0
- package/dist/esm/management/api/resources/experimentation/resources/experiments/client/index.d.mts +1 -0
- package/dist/esm/management/api/resources/experimentation/resources/experiments/client/index.mjs +1 -0
- package/dist/esm/management/api/resources/experimentation/resources/experiments/exports.d.mts +2 -0
- package/dist/esm/management/api/resources/{organizationTemplates → experimentation/resources/experiments}/exports.mjs +1 -1
- package/dist/esm/management/api/resources/experimentation/resources/index.d.mts +1 -0
- package/dist/esm/management/api/resources/experimentation/resources/index.mjs +1 -0
- package/dist/esm/management/api/resources/guardian/client/Client.d.mts +40 -1
- package/dist/esm/management/api/resources/guardian/client/Client.mjs +139 -0
- package/dist/esm/management/api/resources/guardian/resources/factors/client/Client.d.mts +3 -0
- package/dist/esm/management/api/resources/guardian/resources/factors/client/Client.mjs +5 -0
- package/dist/esm/management/api/resources/guardian/resources/factors/resources/email/client/Client.d.mts +46 -0
- package/dist/esm/management/api/resources/guardian/resources/factors/resources/email/client/Client.mjs +144 -0
- package/dist/esm/management/api/resources/guardian/resources/factors/resources/email/client/index.d.mts +1 -0
- package/dist/esm/management/api/resources/guardian/resources/factors/resources/email/client/index.mjs +1 -0
- package/dist/esm/management/api/resources/guardian/resources/factors/resources/email/exports.d.mts +2 -0
- package/dist/esm/management/api/resources/guardian/resources/factors/resources/email/exports.mjs +3 -0
- package/dist/esm/management/api/resources/guardian/resources/factors/resources/email/index.d.mts +1 -0
- package/dist/esm/management/api/resources/guardian/resources/factors/resources/email/index.mjs +1 -0
- package/dist/esm/management/api/resources/guardian/resources/factors/resources/index.d.mts +1 -0
- package/dist/esm/management/api/resources/guardian/resources/factors/resources/index.mjs +1 -0
- package/dist/esm/management/api/resources/guardian/resources/factors/resources/phone/client/Client.d.mts +33 -0
- package/dist/esm/management/api/resources/guardian/resources/factors/resources/phone/client/Client.mjs +122 -0
- package/dist/esm/management/api/resources/index.d.mts +1 -1
- package/dist/esm/management/api/resources/index.mjs +1 -1
- package/dist/esm/management/api/resources/organizations/client/Client.d.mts +36 -0
- package/dist/esm/management/api/resources/organizations/client/Client.mjs +104 -0
- package/dist/esm/management/api/resources/resourceServers/client/Client.d.mts +29 -0
- package/dist/esm/management/api/resources/resourceServers/client/Client.mjs +103 -0
- package/dist/esm/management/api/types/types.d.mts +287 -51
- package/dist/esm/management/api/types/types.mjs +48 -33
- package/dist/esm/management/version.d.mts +1 -1
- package/dist/esm/management/version.mjs +1 -1
- package/package.json +46 -23
- package/reference.md +654 -389
- package/dist/cjs/management/api/resources/organizationTemplates/client/Client.d.ts +0 -106
- package/dist/cjs/management/api/resources/organizationTemplates/client/Client.js +0 -411
- package/dist/cjs/management/api/resources/organizationTemplates/exports.d.ts +0 -2
- package/dist/esm/management/api/resources/organizationTemplates/client/Client.d.mts +0 -106
- package/dist/esm/management/api/resources/organizationTemplates/client/Client.mjs +0 -374
- package/dist/esm/management/api/resources/organizationTemplates/exports.d.mts +0 -2
- /package/dist/cjs/management/api/resources/{organizationTemplates → experimentation}/client/index.d.ts +0 -0
- /package/dist/cjs/management/api/resources/{organizationTemplates → experimentation}/client/index.js +0 -0
- /package/dist/{esm/management/api/resources/organizationTemplates/client/index.d.mts → cjs/management/api/resources/experimentation/resources/experiments/client/index.d.ts} +0 -0
- /package/dist/cjs/management/api/resources/{organizationTemplates → experimentation/resources/experiments}/index.d.ts +0 -0
- /package/dist/cjs/management/api/resources/{organizationTemplates → experimentation/resources/experiments}/index.js +0 -0
- /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
- /package/dist/esm/management/api/resources/{organizationTemplates → experimentation/resources/experiments}/index.d.mts +0 -0
- /package/dist/esm/management/api/resources/{organizationTemplates → experimentation/resources/experiments}/index.mjs +0 -0
|
@@ -1,374 +0,0 @@
|
|
|
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 OrganizationTemplatesClient {
|
|
19
|
-
constructor(options) {
|
|
20
|
-
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* 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.
|
|
24
|
-
*
|
|
25
|
-
* @param {Management.ListOrganizationTemplatesRequestParameters} request
|
|
26
|
-
* @param {OrganizationTemplatesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
|
-
*
|
|
28
|
-
* @throws {@link Management.BadRequestError}
|
|
29
|
-
* @throws {@link Management.UnauthorizedError}
|
|
30
|
-
* @throws {@link Management.ForbiddenError}
|
|
31
|
-
* @throws {@link Management.TooManyRequestsError}
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* await client.organizationTemplates.list({
|
|
35
|
-
* from: "from",
|
|
36
|
-
* take: 1
|
|
37
|
-
* })
|
|
38
|
-
*/
|
|
39
|
-
list() {
|
|
40
|
-
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
41
|
-
const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
43
|
-
const { from: from_, take = 5 } = request;
|
|
44
|
-
const _queryParams = {
|
|
45
|
-
from: from_,
|
|
46
|
-
take,
|
|
47
|
-
};
|
|
48
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
49
|
-
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);
|
|
50
|
-
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
51
|
-
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"),
|
|
52
|
-
method: "GET",
|
|
53
|
-
headers: _headers,
|
|
54
|
-
queryString: core.url
|
|
55
|
-
.queryBuilder()
|
|
56
|
-
.addMany(_queryParams)
|
|
57
|
-
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
58
|
-
.build(),
|
|
59
|
-
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,
|
|
60
|
-
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,
|
|
61
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
62
|
-
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
63
|
-
logging: this._options.logging,
|
|
64
|
-
});
|
|
65
|
-
if (_response.ok) {
|
|
66
|
-
return {
|
|
67
|
-
data: _response.body,
|
|
68
|
-
rawResponse: _response.rawResponse,
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
if (_response.error.reason === "status-code") {
|
|
72
|
-
switch (_response.error.statusCode) {
|
|
73
|
-
case 400:
|
|
74
|
-
throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
|
|
75
|
-
case 401:
|
|
76
|
-
throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
77
|
-
case 403:
|
|
78
|
-
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
79
|
-
case 429:
|
|
80
|
-
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
81
|
-
default:
|
|
82
|
-
throw new errors.ManagementError({
|
|
83
|
-
statusCode: _response.error.statusCode,
|
|
84
|
-
body: _response.error.body,
|
|
85
|
-
rawResponse: _response.rawResponse,
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/organization-templates");
|
|
90
|
-
}));
|
|
91
|
-
const dataWithRawResponse = yield list(request).withRawResponse();
|
|
92
|
-
return new core.Page({
|
|
93
|
-
response: dataWithRawResponse.data,
|
|
94
|
-
rawResponse: dataWithRawResponse.rawResponse,
|
|
95
|
-
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) === ""),
|
|
96
|
-
getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.organization_templates) !== null && _a !== void 0 ? _a : []; },
|
|
97
|
-
loadPage: (response) => {
|
|
98
|
-
return list(core.setObjectProperty(request, "from", response === null || response === void 0 ? void 0 : response.next));
|
|
99
|
-
},
|
|
100
|
-
});
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Create an Organization Template.
|
|
105
|
-
*
|
|
106
|
-
* @param {Management.CreateOrganizationTemplateRequestContent} request
|
|
107
|
-
* @param {OrganizationTemplatesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
108
|
-
*
|
|
109
|
-
* @throws {@link Management.BadRequestError}
|
|
110
|
-
* @throws {@link Management.UnauthorizedError}
|
|
111
|
-
* @throws {@link Management.ForbiddenError}
|
|
112
|
-
* @throws {@link Management.ConflictError}
|
|
113
|
-
* @throws {@link Management.TooManyRequestsError}
|
|
114
|
-
*
|
|
115
|
-
* @example
|
|
116
|
-
* await client.organizationTemplates.create({
|
|
117
|
-
* name: "name",
|
|
118
|
-
* organization_deletion_behavior: "allow",
|
|
119
|
-
* enforce_permission_ceiling: true,
|
|
120
|
-
* enforce_self_assignment_restriction: true
|
|
121
|
-
* })
|
|
122
|
-
*/
|
|
123
|
-
create(request, requestOptions) {
|
|
124
|
-
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
|
|
125
|
-
}
|
|
126
|
-
__create(request, requestOptions) {
|
|
127
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
128
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
129
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
130
|
-
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);
|
|
131
|
-
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
132
|
-
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"),
|
|
133
|
-
method: "POST",
|
|
134
|
-
headers: _headers,
|
|
135
|
-
contentType: "application/json",
|
|
136
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
137
|
-
requestType: "json",
|
|
138
|
-
body: request,
|
|
139
|
-
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,
|
|
140
|
-
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,
|
|
141
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
142
|
-
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
143
|
-
logging: this._options.logging,
|
|
144
|
-
});
|
|
145
|
-
if (_response.ok) {
|
|
146
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
147
|
-
}
|
|
148
|
-
if (_response.error.reason === "status-code") {
|
|
149
|
-
switch (_response.error.statusCode) {
|
|
150
|
-
case 400:
|
|
151
|
-
throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
|
|
152
|
-
case 401:
|
|
153
|
-
throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
154
|
-
case 403:
|
|
155
|
-
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
156
|
-
case 409:
|
|
157
|
-
throw new Management.ConflictError(_response.error.body, _response.rawResponse);
|
|
158
|
-
case 429:
|
|
159
|
-
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
160
|
-
default:
|
|
161
|
-
throw new errors.ManagementError({
|
|
162
|
-
statusCode: _response.error.statusCode,
|
|
163
|
-
body: _response.error.body,
|
|
164
|
-
rawResponse: _response.rawResponse,
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/organization-templates");
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Retrieve details about a single Organization Template specified by ID.
|
|
173
|
-
*
|
|
174
|
-
* @param {string} id - Organization Template identifier.
|
|
175
|
-
* @param {OrganizationTemplatesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
176
|
-
*
|
|
177
|
-
* @throws {@link Management.UnauthorizedError}
|
|
178
|
-
* @throws {@link Management.ForbiddenError}
|
|
179
|
-
* @throws {@link Management.NotFoundError}
|
|
180
|
-
* @throws {@link Management.TooManyRequestsError}
|
|
181
|
-
*
|
|
182
|
-
* @example
|
|
183
|
-
* await client.organizationTemplates.get("id")
|
|
184
|
-
*/
|
|
185
|
-
get(id, requestOptions) {
|
|
186
|
-
return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions));
|
|
187
|
-
}
|
|
188
|
-
__get(id, requestOptions) {
|
|
189
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
190
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
191
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
192
|
-
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);
|
|
193
|
-
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
194
|
-
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)}`),
|
|
195
|
-
method: "GET",
|
|
196
|
-
headers: _headers,
|
|
197
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
198
|
-
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,
|
|
199
|
-
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,
|
|
200
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
201
|
-
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
202
|
-
logging: this._options.logging,
|
|
203
|
-
});
|
|
204
|
-
if (_response.ok) {
|
|
205
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
206
|
-
}
|
|
207
|
-
if (_response.error.reason === "status-code") {
|
|
208
|
-
switch (_response.error.statusCode) {
|
|
209
|
-
case 401:
|
|
210
|
-
throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
211
|
-
case 403:
|
|
212
|
-
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
213
|
-
case 404:
|
|
214
|
-
throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
|
|
215
|
-
case 429:
|
|
216
|
-
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
217
|
-
default:
|
|
218
|
-
throw new errors.ManagementError({
|
|
219
|
-
statusCode: _response.error.statusCode,
|
|
220
|
-
body: _response.error.body,
|
|
221
|
-
rawResponse: _response.rawResponse,
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/organization-templates/{id}");
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* Update the details of a specific Organization Template.
|
|
230
|
-
*
|
|
231
|
-
* @param {string} id - Organization Template identifier.
|
|
232
|
-
* @param {Management.UpdateOrganizationTemplateRequestContent} request
|
|
233
|
-
* @param {OrganizationTemplatesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
234
|
-
*
|
|
235
|
-
* @throws {@link Management.BadRequestError}
|
|
236
|
-
* @throws {@link Management.UnauthorizedError}
|
|
237
|
-
* @throws {@link Management.ForbiddenError}
|
|
238
|
-
* @throws {@link Management.NotFoundError}
|
|
239
|
-
* @throws {@link Management.TooManyRequestsError}
|
|
240
|
-
*
|
|
241
|
-
* @example
|
|
242
|
-
* await client.organizationTemplates.update("id")
|
|
243
|
-
*/
|
|
244
|
-
update(id, request = {}, requestOptions) {
|
|
245
|
-
return core.HttpResponsePromise.fromPromise(this.__update(id, request, requestOptions));
|
|
246
|
-
}
|
|
247
|
-
__update(id_1) {
|
|
248
|
-
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
249
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
250
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
251
|
-
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);
|
|
252
|
-
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
253
|
-
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)}`),
|
|
254
|
-
method: "PATCH",
|
|
255
|
-
headers: _headers,
|
|
256
|
-
contentType: "application/json",
|
|
257
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
258
|
-
requestType: "json",
|
|
259
|
-
body: request,
|
|
260
|
-
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,
|
|
261
|
-
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,
|
|
262
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
263
|
-
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
264
|
-
logging: this._options.logging,
|
|
265
|
-
});
|
|
266
|
-
if (_response.ok) {
|
|
267
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
268
|
-
}
|
|
269
|
-
if (_response.error.reason === "status-code") {
|
|
270
|
-
switch (_response.error.statusCode) {
|
|
271
|
-
case 400:
|
|
272
|
-
throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
|
|
273
|
-
case 401:
|
|
274
|
-
throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
275
|
-
case 403:
|
|
276
|
-
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
277
|
-
case 404:
|
|
278
|
-
throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
|
|
279
|
-
case 429:
|
|
280
|
-
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
281
|
-
default:
|
|
282
|
-
throw new errors.ManagementError({
|
|
283
|
-
statusCode: _response.error.statusCode,
|
|
284
|
-
body: _response.error.body,
|
|
285
|
-
rawResponse: _response.rawResponse,
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/organization-templates/{id}");
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
/**
|
|
293
|
-
* 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.
|
|
294
|
-
*
|
|
295
|
-
* @param {string} id - The ID of the organization template.
|
|
296
|
-
* @param {Management.ListTemplateOrganizationsRequestParameters} request
|
|
297
|
-
* @param {OrganizationTemplatesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
298
|
-
*
|
|
299
|
-
* @throws {@link Management.BadRequestError}
|
|
300
|
-
* @throws {@link Management.UnauthorizedError}
|
|
301
|
-
* @throws {@link Management.ForbiddenError}
|
|
302
|
-
* @throws {@link Management.TooManyRequestsError}
|
|
303
|
-
*
|
|
304
|
-
* @example
|
|
305
|
-
* await client.organizationTemplates.listOrganizations("id", {
|
|
306
|
-
* from: "from",
|
|
307
|
-
* take: 1
|
|
308
|
-
* })
|
|
309
|
-
*/
|
|
310
|
-
listOrganizations(id_1) {
|
|
311
|
-
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
312
|
-
const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
|
|
313
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
314
|
-
const { from: from_, take = 5 } = request;
|
|
315
|
-
const _queryParams = {
|
|
316
|
-
from: from_,
|
|
317
|
-
take,
|
|
318
|
-
};
|
|
319
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
320
|
-
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);
|
|
321
|
-
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
322
|
-
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`),
|
|
323
|
-
method: "GET",
|
|
324
|
-
headers: _headers,
|
|
325
|
-
queryString: core.url
|
|
326
|
-
.queryBuilder()
|
|
327
|
-
.addMany(_queryParams)
|
|
328
|
-
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
329
|
-
.build(),
|
|
330
|
-
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,
|
|
331
|
-
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,
|
|
332
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
333
|
-
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
334
|
-
logging: this._options.logging,
|
|
335
|
-
});
|
|
336
|
-
if (_response.ok) {
|
|
337
|
-
return {
|
|
338
|
-
data: _response.body,
|
|
339
|
-
rawResponse: _response.rawResponse,
|
|
340
|
-
};
|
|
341
|
-
}
|
|
342
|
-
if (_response.error.reason === "status-code") {
|
|
343
|
-
switch (_response.error.statusCode) {
|
|
344
|
-
case 400:
|
|
345
|
-
throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
|
|
346
|
-
case 401:
|
|
347
|
-
throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
348
|
-
case 403:
|
|
349
|
-
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
350
|
-
case 429:
|
|
351
|
-
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
352
|
-
default:
|
|
353
|
-
throw new errors.ManagementError({
|
|
354
|
-
statusCode: _response.error.statusCode,
|
|
355
|
-
body: _response.error.body,
|
|
356
|
-
rawResponse: _response.rawResponse,
|
|
357
|
-
});
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/organization-templates/{id}/organizations");
|
|
361
|
-
}));
|
|
362
|
-
const dataWithRawResponse = yield list(request).withRawResponse();
|
|
363
|
-
return new core.Page({
|
|
364
|
-
response: dataWithRawResponse.data,
|
|
365
|
-
rawResponse: dataWithRawResponse.rawResponse,
|
|
366
|
-
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) === ""),
|
|
367
|
-
getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.organizations) !== null && _a !== void 0 ? _a : []; },
|
|
368
|
-
loadPage: (response) => {
|
|
369
|
-
return list(core.setObjectProperty(request, "from", response === null || response === void 0 ? void 0 : response.next));
|
|
370
|
-
},
|
|
371
|
-
});
|
|
372
|
-
});
|
|
373
|
-
}
|
|
374
|
-
}
|
|
File without changes
|
/package/dist/cjs/management/api/resources/{organizationTemplates → experimentation}/client/index.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|