auth0 7.4.0 → 7.5.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 +3 -0
- package/dist/cjs/management/Client.js +87 -82
- package/dist/cjs/management/api/requests/requests.d.ts +103 -0
- package/dist/cjs/management/api/resources/attackProtection/client/Client.d.ts +3 -0
- package/dist/cjs/management/api/resources/attackProtection/client/Client.js +9 -4
- package/dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/client/Client.d.ts +105 -0
- package/dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/client/Client.js +388 -0
- package/dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/client/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/client/index.js +2 -0
- package/dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/exports.d.ts +2 -0
- package/dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/exports.js +21 -0
- package/dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/attackProtection/resources/captchaPolicies/index.js +17 -0
- package/dist/cjs/management/api/resources/attackProtection/resources/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/attackProtection/resources/index.js +2 -1
- package/dist/cjs/management/api/resources/clientGrants/client/Client.d.ts +27 -0
- package/dist/cjs/management/api/resources/clientGrants/client/Client.js +101 -0
- package/dist/cjs/management/api/resources/clientProfiles/client/Client.d.ts +106 -0
- package/dist/cjs/management/api/resources/clientProfiles/client/Client.js +391 -0
- package/dist/cjs/management/api/resources/clientProfiles/client/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/clientProfiles/client/index.js +2 -0
- package/dist/cjs/management/api/resources/clientProfiles/exports.d.ts +2 -0
- package/dist/cjs/management/api/resources/clientProfiles/exports.js +21 -0
- package/dist/cjs/management/api/resources/clientProfiles/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/clientProfiles/index.js +17 -0
- package/dist/cjs/management/api/resources/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/index.js +2 -1
- package/dist/cjs/management/api/types/types.d.ts +352 -0
- package/dist/cjs/management/api/types/types.js +83 -21
- package/dist/cjs/management/version.d.ts +1 -1
- package/dist/cjs/management/version.js +1 -1
- package/dist/esm/management/Client.d.mts +3 -0
- package/dist/esm/management/Client.mjs +5 -0
- package/dist/esm/management/api/requests/requests.d.mts +103 -0
- package/dist/esm/management/api/resources/attackProtection/client/Client.d.mts +3 -0
- package/dist/esm/management/api/resources/attackProtection/client/Client.mjs +5 -0
- package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/client/Client.d.mts +105 -0
- package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/client/Client.mjs +351 -0
- package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/client/index.d.mts +1 -0
- package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/client/index.mjs +1 -0
- package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/exports.d.mts +2 -0
- package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/exports.mjs +3 -0
- package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/index.d.mts +1 -0
- package/dist/esm/management/api/resources/attackProtection/resources/captchaPolicies/index.mjs +1 -0
- package/dist/esm/management/api/resources/attackProtection/resources/index.d.mts +1 -0
- package/dist/esm/management/api/resources/attackProtection/resources/index.mjs +1 -0
- package/dist/esm/management/api/resources/clientGrants/client/Client.d.mts +27 -0
- package/dist/esm/management/api/resources/clientGrants/client/Client.mjs +101 -0
- package/dist/esm/management/api/resources/clientProfiles/client/Client.d.mts +106 -0
- package/dist/esm/management/api/resources/clientProfiles/client/Client.mjs +354 -0
- package/dist/esm/management/api/resources/clientProfiles/client/index.d.mts +1 -0
- package/dist/esm/management/api/resources/clientProfiles/client/index.mjs +1 -0
- package/dist/esm/management/api/resources/clientProfiles/exports.d.mts +2 -0
- package/dist/esm/management/api/resources/clientProfiles/exports.mjs +3 -0
- package/dist/esm/management/api/resources/clientProfiles/index.d.mts +1 -0
- package/dist/esm/management/api/resources/clientProfiles/index.mjs +1 -0
- package/dist/esm/management/api/resources/index.d.mts +1 -0
- package/dist/esm/management/api/resources/index.mjs +1 -0
- package/dist/esm/management/api/types/types.d.mts +352 -0
- package/dist/esm/management/api/types/types.mjs +62 -0
- package/dist/esm/management/version.d.mts +1 -1
- package/dist/esm/management/version.mjs +1 -1
- package/package.json +23 -1
- package/reference.md +981 -217
|
@@ -2,5 +2,6 @@ export * as botDetection from "./botDetection/index.mjs";
|
|
|
2
2
|
export * as breachedPasswordDetection from "./breachedPasswordDetection/index.mjs";
|
|
3
3
|
export * as bruteForceProtection from "./bruteForceProtection/index.mjs";
|
|
4
4
|
export * as captcha from "./captcha/index.mjs";
|
|
5
|
+
export * as captchaPolicies from "./captchaPolicies/index.mjs";
|
|
5
6
|
export * as phoneProviderProtection from "./phoneProviderProtection/index.mjs";
|
|
6
7
|
export * as suspiciousIpThrottling from "./suspiciousIpThrottling/index.mjs";
|
|
@@ -2,5 +2,6 @@ export * as botDetection from "./botDetection/index.mjs";
|
|
|
2
2
|
export * as breachedPasswordDetection from "./breachedPasswordDetection/index.mjs";
|
|
3
3
|
export * as bruteForceProtection from "./bruteForceProtection/index.mjs";
|
|
4
4
|
export * as captcha from "./captcha/index.mjs";
|
|
5
|
+
export * as captchaPolicies from "./captchaPolicies/index.mjs";
|
|
5
6
|
export * as phoneProviderProtection from "./phoneProviderProtection/index.mjs";
|
|
6
7
|
export * as suspiciousIpThrottling from "./suspiciousIpThrottling/index.mjs";
|
|
@@ -56,6 +56,33 @@ export declare class ClientGrantsClient {
|
|
|
56
56
|
*/
|
|
57
57
|
create(request: Management.CreateClientGrantRequestContent, requestOptions?: ClientGrantsClient.RequestOptions): core.HttpResponsePromise<Management.CreateClientGrantResponseContent>;
|
|
58
58
|
private __create;
|
|
59
|
+
/**
|
|
60
|
+
* Search client grants using SCIM or Lucene filter syntax with low-latency, eventually consistent results. Use the parser parameter to specify "scim" or "lucene" syntax (default: "lucene"). This endpoint provides an alternative to the standard GET /client-grants endpoint with better performance for complex queries.
|
|
61
|
+
* Results may not reflect recent updates immediately.
|
|
62
|
+
*
|
|
63
|
+
* @param {Management.SearchClientGrantsRequestParameters} request
|
|
64
|
+
* @param {ClientGrantsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
65
|
+
*
|
|
66
|
+
* @throws {@link Management.BadRequestError}
|
|
67
|
+
* @throws {@link Management.UnauthorizedError}
|
|
68
|
+
* @throws {@link Management.ForbiddenError}
|
|
69
|
+
* @throws {@link Management.NotFoundError}
|
|
70
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
71
|
+
* @throws {@link Management.InternalServerError}
|
|
72
|
+
* @throws {@link Management.GatewayTimeoutError}
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* await client.clientGrants.search({
|
|
76
|
+
* q: "q",
|
|
77
|
+
* parser: "scim",
|
|
78
|
+
* fields: "fields",
|
|
79
|
+
* include_fields: true,
|
|
80
|
+
* take: 1,
|
|
81
|
+
* from: "from",
|
|
82
|
+
* sort: "audience"
|
|
83
|
+
* })
|
|
84
|
+
*/
|
|
85
|
+
search(request?: Management.SearchClientGrantsRequestParameters, requestOptions?: ClientGrantsClient.RequestOptions): Promise<core.Page<Management.ClientGrantResponseContent, Management.SearchClientGrantsResponseContent>>;
|
|
59
86
|
/**
|
|
60
87
|
* Retrieve a single [client grant](https://auth0.com/docs/get-started/applications/application-access-to-apis-client-grants), including the
|
|
61
88
|
* scopes associated with the application/API pair.
|
|
@@ -185,6 +185,107 @@ export class ClientGrantsClient {
|
|
|
185
185
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/client-grants");
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* Search client grants using SCIM or Lucene filter syntax with low-latency, eventually consistent results. Use the parser parameter to specify "scim" or "lucene" syntax (default: "lucene"). This endpoint provides an alternative to the standard GET /client-grants endpoint with better performance for complex queries.
|
|
190
|
+
* Results may not reflect recent updates immediately.
|
|
191
|
+
*
|
|
192
|
+
* @param {Management.SearchClientGrantsRequestParameters} request
|
|
193
|
+
* @param {ClientGrantsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
194
|
+
*
|
|
195
|
+
* @throws {@link Management.BadRequestError}
|
|
196
|
+
* @throws {@link Management.UnauthorizedError}
|
|
197
|
+
* @throws {@link Management.ForbiddenError}
|
|
198
|
+
* @throws {@link Management.NotFoundError}
|
|
199
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
200
|
+
* @throws {@link Management.InternalServerError}
|
|
201
|
+
* @throws {@link Management.GatewayTimeoutError}
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* await client.clientGrants.search({
|
|
205
|
+
* q: "q",
|
|
206
|
+
* parser: "scim",
|
|
207
|
+
* fields: "fields",
|
|
208
|
+
* include_fields: true,
|
|
209
|
+
* take: 1,
|
|
210
|
+
* from: "from",
|
|
211
|
+
* sort: "audience"
|
|
212
|
+
* })
|
|
213
|
+
*/
|
|
214
|
+
search() {
|
|
215
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
216
|
+
const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
|
|
217
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
218
|
+
const { q, parser, fields, include_fields: includeFields, take = 50, from: from_, sort } = request;
|
|
219
|
+
const _queryParams = {
|
|
220
|
+
q,
|
|
221
|
+
parser: parser !== undefined ? parser : undefined,
|
|
222
|
+
fields,
|
|
223
|
+
include_fields: includeFields,
|
|
224
|
+
take,
|
|
225
|
+
from: from_,
|
|
226
|
+
sort: sort !== undefined ? sort : undefined,
|
|
227
|
+
};
|
|
228
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
229
|
+
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);
|
|
230
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
231
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ManagementEnvironment.Default, "client-grants/search"),
|
|
232
|
+
method: "GET",
|
|
233
|
+
headers: _headers,
|
|
234
|
+
queryString: core.url
|
|
235
|
+
.queryBuilder()
|
|
236
|
+
.addMany(_queryParams)
|
|
237
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
238
|
+
.build(),
|
|
239
|
+
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,
|
|
240
|
+
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,
|
|
241
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
242
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
243
|
+
logging: this._options.logging,
|
|
244
|
+
});
|
|
245
|
+
if (_response.ok) {
|
|
246
|
+
return {
|
|
247
|
+
data: _response.body,
|
|
248
|
+
rawResponse: _response.rawResponse,
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
if (_response.error.reason === "status-code") {
|
|
252
|
+
switch (_response.error.statusCode) {
|
|
253
|
+
case 400:
|
|
254
|
+
throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
|
|
255
|
+
case 401:
|
|
256
|
+
throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
257
|
+
case 403:
|
|
258
|
+
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
259
|
+
case 404:
|
|
260
|
+
throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
|
|
261
|
+
case 429:
|
|
262
|
+
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
263
|
+
case 500:
|
|
264
|
+
throw new Management.InternalServerError(_response.error.body, _response.rawResponse);
|
|
265
|
+
case 504:
|
|
266
|
+
throw new Management.GatewayTimeoutError(_response.error.body, _response.rawResponse);
|
|
267
|
+
default:
|
|
268
|
+
throw new errors.ManagementError({
|
|
269
|
+
statusCode: _response.error.statusCode,
|
|
270
|
+
body: _response.error.body,
|
|
271
|
+
rawResponse: _response.rawResponse,
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/client-grants/search");
|
|
276
|
+
}));
|
|
277
|
+
const dataWithRawResponse = yield list(request).withRawResponse();
|
|
278
|
+
return new core.Page({
|
|
279
|
+
response: dataWithRawResponse.data,
|
|
280
|
+
rawResponse: dataWithRawResponse.rawResponse,
|
|
281
|
+
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) === ""),
|
|
282
|
+
getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.client_grants) !== null && _a !== void 0 ? _a : []; },
|
|
283
|
+
loadPage: (response) => {
|
|
284
|
+
return list(core.setObjectProperty(request, "from", response === null || response === void 0 ? void 0 : response.next));
|
|
285
|
+
},
|
|
286
|
+
});
|
|
287
|
+
});
|
|
288
|
+
}
|
|
188
289
|
/**
|
|
189
290
|
* Retrieve a single [client grant](https://auth0.com/docs/get-started/applications/application-access-to-apis-client-grants), including the
|
|
190
291
|
* scopes associated with the application/API pair.
|
|
@@ -0,0 +1,106 @@
|
|
|
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 ClientProfilesClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class ClientProfilesClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<ClientProfilesClient.Options>;
|
|
12
|
+
constructor(options: ClientProfilesClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Retrieve a paginated list of client profiles for the tenant. Uses checkpoint pagination: pass the <code>next</code> cursor from a previous response as the <code>from</code> query parameter to retrieve the following page.
|
|
15
|
+
*
|
|
16
|
+
* @param {Management.ListClientProfilesRequestParameters} request
|
|
17
|
+
* @param {ClientProfilesClient.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.clientProfiles.list({
|
|
26
|
+
* from: "from",
|
|
27
|
+
* take: 1
|
|
28
|
+
* })
|
|
29
|
+
*/
|
|
30
|
+
list(request?: Management.ListClientProfilesRequestParameters, requestOptions?: ClientProfilesClient.RequestOptions): Promise<core.Page<Management.ClientProfile, Management.ListClientProfilesPaginatedResponseContent>>;
|
|
31
|
+
/**
|
|
32
|
+
* Create a client profile. At most one profile is allowed per tenant in this release; attempting to create a second returns <code>409 Conflict</code>. The profile governs Dynamic CIMD clients matched by its <code>apply_policy</code> at runtime.
|
|
33
|
+
*
|
|
34
|
+
* @param {Management.CreateClientProfileRequestContent} request
|
|
35
|
+
* @param {ClientProfilesClient.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.clientProfiles.create({
|
|
45
|
+
* name: "name",
|
|
46
|
+
* client_configuration: {},
|
|
47
|
+
* apply_policy: {
|
|
48
|
+
* external_metadata_type: "cimd",
|
|
49
|
+
* external_metadata_created_by: "client"
|
|
50
|
+
* }
|
|
51
|
+
* })
|
|
52
|
+
*/
|
|
53
|
+
create(request: Management.CreateClientProfileRequestContent, requestOptions?: ClientProfilesClient.RequestOptions): core.HttpResponsePromise<Management.ClientProfile>;
|
|
54
|
+
private __create;
|
|
55
|
+
/**
|
|
56
|
+
* Retrieve a single client profile by its identifier. Returns <code>404</code> if no profile with the given ID exists for the tenant.
|
|
57
|
+
*
|
|
58
|
+
* @param {Management.ClientProfileId} id - ID of the client profile.
|
|
59
|
+
* @param {ClientProfilesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
60
|
+
*
|
|
61
|
+
* @throws {@link Management.BadRequestError}
|
|
62
|
+
* @throws {@link Management.UnauthorizedError}
|
|
63
|
+
* @throws {@link Management.ForbiddenError}
|
|
64
|
+
* @throws {@link Management.NotFoundError}
|
|
65
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* await client.clientProfiles.get("id")
|
|
69
|
+
*/
|
|
70
|
+
get(id: Management.ClientProfileId, requestOptions?: ClientProfilesClient.RequestOptions): core.HttpResponsePromise<Management.ClientProfile>;
|
|
71
|
+
private __get;
|
|
72
|
+
/**
|
|
73
|
+
* Delete a client profile. Idempotent: returns <code>204 No Content</code> whether or not a profile with the given ID existed. Deleting the profile removes fleet governance for matched clients immediately.
|
|
74
|
+
*
|
|
75
|
+
* @param {Management.ClientProfileId} id - ID of the client profile.
|
|
76
|
+
* @param {ClientProfilesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
77
|
+
*
|
|
78
|
+
* @throws {@link Management.BadRequestError}
|
|
79
|
+
* @throws {@link Management.UnauthorizedError}
|
|
80
|
+
* @throws {@link Management.ForbiddenError}
|
|
81
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* await client.clientProfiles.delete("id")
|
|
85
|
+
*/
|
|
86
|
+
delete(id: Management.ClientProfileId, requestOptions?: ClientProfilesClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
87
|
+
private __delete;
|
|
88
|
+
/**
|
|
89
|
+
* Update a client profile. Supports partial updates at the top level (JSON Merge Patch); omitted top-level fields remain unchanged. Nested objects such as <code>client_configuration</code> must be supplied in full.
|
|
90
|
+
*
|
|
91
|
+
* @param {Management.ClientProfileId} id - ID of the client profile.
|
|
92
|
+
* @param {Management.UpdateClientProfileRequestContent} request
|
|
93
|
+
* @param {ClientProfilesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
94
|
+
*
|
|
95
|
+
* @throws {@link Management.BadRequestError}
|
|
96
|
+
* @throws {@link Management.UnauthorizedError}
|
|
97
|
+
* @throws {@link Management.ForbiddenError}
|
|
98
|
+
* @throws {@link Management.NotFoundError}
|
|
99
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* await client.clientProfiles.update("id")
|
|
103
|
+
*/
|
|
104
|
+
update(id: Management.ClientProfileId, request?: Management.UpdateClientProfileRequestContent, requestOptions?: ClientProfilesClient.RequestOptions): core.HttpResponsePromise<Management.ClientProfile>;
|
|
105
|
+
private __update;
|
|
106
|
+
}
|
|
@@ -0,0 +1,354 @@
|
|
|
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 ClientProfilesClient {
|
|
19
|
+
constructor(options) {
|
|
20
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Retrieve a paginated list of client profiles for the tenant. Uses checkpoint pagination: pass the <code>next</code> cursor from a previous response as the <code>from</code> query parameter to retrieve the following page.
|
|
24
|
+
*
|
|
25
|
+
* @param {Management.ListClientProfilesRequestParameters} request
|
|
26
|
+
* @param {ClientProfilesClient.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.clientProfiles.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 = 50 } = 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, "client-profiles"),
|
|
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", "/client-profiles");
|
|
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.client_profiles) !== 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 a client profile. At most one profile is allowed per tenant in this release; attempting to create a second returns <code>409 Conflict</code>. The profile governs Dynamic CIMD clients matched by its <code>apply_policy</code> at runtime.
|
|
105
|
+
*
|
|
106
|
+
* @param {Management.CreateClientProfileRequestContent} request
|
|
107
|
+
* @param {ClientProfilesClient.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.clientProfiles.create({
|
|
117
|
+
* name: "name",
|
|
118
|
+
* client_configuration: {},
|
|
119
|
+
* apply_policy: {
|
|
120
|
+
* external_metadata_type: "cimd",
|
|
121
|
+
* external_metadata_created_by: "client"
|
|
122
|
+
* }
|
|
123
|
+
* })
|
|
124
|
+
*/
|
|
125
|
+
create(request, requestOptions) {
|
|
126
|
+
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
|
|
127
|
+
}
|
|
128
|
+
__create(request, requestOptions) {
|
|
129
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
130
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
131
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
132
|
+
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);
|
|
133
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
134
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ManagementEnvironment.Default, "client-profiles"),
|
|
135
|
+
method: "POST",
|
|
136
|
+
headers: _headers,
|
|
137
|
+
contentType: "application/json",
|
|
138
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
139
|
+
requestType: "json",
|
|
140
|
+
body: request,
|
|
141
|
+
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,
|
|
142
|
+
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,
|
|
143
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
144
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
145
|
+
logging: this._options.logging,
|
|
146
|
+
});
|
|
147
|
+
if (_response.ok) {
|
|
148
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
149
|
+
}
|
|
150
|
+
if (_response.error.reason === "status-code") {
|
|
151
|
+
switch (_response.error.statusCode) {
|
|
152
|
+
case 400:
|
|
153
|
+
throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
|
|
154
|
+
case 401:
|
|
155
|
+
throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
156
|
+
case 403:
|
|
157
|
+
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
158
|
+
case 409:
|
|
159
|
+
throw new Management.ConflictError(_response.error.body, _response.rawResponse);
|
|
160
|
+
case 429:
|
|
161
|
+
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
162
|
+
default:
|
|
163
|
+
throw new errors.ManagementError({
|
|
164
|
+
statusCode: _response.error.statusCode,
|
|
165
|
+
body: _response.error.body,
|
|
166
|
+
rawResponse: _response.rawResponse,
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/client-profiles");
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Retrieve a single client profile by its identifier. Returns <code>404</code> if no profile with the given ID exists for the tenant.
|
|
175
|
+
*
|
|
176
|
+
* @param {Management.ClientProfileId} id - ID of the client profile.
|
|
177
|
+
* @param {ClientProfilesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
178
|
+
*
|
|
179
|
+
* @throws {@link Management.BadRequestError}
|
|
180
|
+
* @throws {@link Management.UnauthorizedError}
|
|
181
|
+
* @throws {@link Management.ForbiddenError}
|
|
182
|
+
* @throws {@link Management.NotFoundError}
|
|
183
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* await client.clientProfiles.get("id")
|
|
187
|
+
*/
|
|
188
|
+
get(id, requestOptions) {
|
|
189
|
+
return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions));
|
|
190
|
+
}
|
|
191
|
+
__get(id, requestOptions) {
|
|
192
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
193
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
194
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
195
|
+
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);
|
|
196
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
197
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ManagementEnvironment.Default, `client-profiles/${core.url.encodePathParam(id)}`),
|
|
198
|
+
method: "GET",
|
|
199
|
+
headers: _headers,
|
|
200
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
201
|
+
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,
|
|
202
|
+
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,
|
|
203
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
204
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
205
|
+
logging: this._options.logging,
|
|
206
|
+
});
|
|
207
|
+
if (_response.ok) {
|
|
208
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
209
|
+
}
|
|
210
|
+
if (_response.error.reason === "status-code") {
|
|
211
|
+
switch (_response.error.statusCode) {
|
|
212
|
+
case 400:
|
|
213
|
+
throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
|
|
214
|
+
case 401:
|
|
215
|
+
throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
216
|
+
case 403:
|
|
217
|
+
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
218
|
+
case 404:
|
|
219
|
+
throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
|
|
220
|
+
case 429:
|
|
221
|
+
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
222
|
+
default:
|
|
223
|
+
throw new errors.ManagementError({
|
|
224
|
+
statusCode: _response.error.statusCode,
|
|
225
|
+
body: _response.error.body,
|
|
226
|
+
rawResponse: _response.rawResponse,
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/client-profiles/{id}");
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Delete a client profile. Idempotent: returns <code>204 No Content</code> whether or not a profile with the given ID existed. Deleting the profile removes fleet governance for matched clients immediately.
|
|
235
|
+
*
|
|
236
|
+
* @param {Management.ClientProfileId} id - ID of the client profile.
|
|
237
|
+
* @param {ClientProfilesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
238
|
+
*
|
|
239
|
+
* @throws {@link Management.BadRequestError}
|
|
240
|
+
* @throws {@link Management.UnauthorizedError}
|
|
241
|
+
* @throws {@link Management.ForbiddenError}
|
|
242
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
243
|
+
*
|
|
244
|
+
* @example
|
|
245
|
+
* await client.clientProfiles.delete("id")
|
|
246
|
+
*/
|
|
247
|
+
delete(id, requestOptions) {
|
|
248
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions));
|
|
249
|
+
}
|
|
250
|
+
__delete(id, requestOptions) {
|
|
251
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
252
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
253
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
254
|
+
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);
|
|
255
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
256
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ManagementEnvironment.Default, `client-profiles/${core.url.encodePathParam(id)}`),
|
|
257
|
+
method: "DELETE",
|
|
258
|
+
headers: _headers,
|
|
259
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
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: undefined, 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 429:
|
|
278
|
+
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
279
|
+
default:
|
|
280
|
+
throw new errors.ManagementError({
|
|
281
|
+
statusCode: _response.error.statusCode,
|
|
282
|
+
body: _response.error.body,
|
|
283
|
+
rawResponse: _response.rawResponse,
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/client-profiles/{id}");
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Update a client profile. Supports partial updates at the top level (JSON Merge Patch); omitted top-level fields remain unchanged. Nested objects such as <code>client_configuration</code> must be supplied in full.
|
|
292
|
+
*
|
|
293
|
+
* @param {Management.ClientProfileId} id - ID of the client profile.
|
|
294
|
+
* @param {Management.UpdateClientProfileRequestContent} request
|
|
295
|
+
* @param {ClientProfilesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
296
|
+
*
|
|
297
|
+
* @throws {@link Management.BadRequestError}
|
|
298
|
+
* @throws {@link Management.UnauthorizedError}
|
|
299
|
+
* @throws {@link Management.ForbiddenError}
|
|
300
|
+
* @throws {@link Management.NotFoundError}
|
|
301
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
302
|
+
*
|
|
303
|
+
* @example
|
|
304
|
+
* await client.clientProfiles.update("id")
|
|
305
|
+
*/
|
|
306
|
+
update(id, request = {}, requestOptions) {
|
|
307
|
+
return core.HttpResponsePromise.fromPromise(this.__update(id, request, requestOptions));
|
|
308
|
+
}
|
|
309
|
+
__update(id_1) {
|
|
310
|
+
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
311
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
312
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
313
|
+
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);
|
|
314
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
315
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ManagementEnvironment.Default, `client-profiles/${core.url.encodePathParam(id)}`),
|
|
316
|
+
method: "PATCH",
|
|
317
|
+
headers: _headers,
|
|
318
|
+
contentType: "application/json",
|
|
319
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
320
|
+
requestType: "json",
|
|
321
|
+
body: request,
|
|
322
|
+
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,
|
|
323
|
+
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,
|
|
324
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
325
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
326
|
+
logging: this._options.logging,
|
|
327
|
+
});
|
|
328
|
+
if (_response.ok) {
|
|
329
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
330
|
+
}
|
|
331
|
+
if (_response.error.reason === "status-code") {
|
|
332
|
+
switch (_response.error.statusCode) {
|
|
333
|
+
case 400:
|
|
334
|
+
throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
|
|
335
|
+
case 401:
|
|
336
|
+
throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
337
|
+
case 403:
|
|
338
|
+
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
339
|
+
case 404:
|
|
340
|
+
throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
|
|
341
|
+
case 429:
|
|
342
|
+
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
343
|
+
default:
|
|
344
|
+
throw new errors.ManagementError({
|
|
345
|
+
statusCode: _response.error.statusCode,
|
|
346
|
+
body: _response.error.body,
|
|
347
|
+
rawResponse: _response.rawResponse,
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/client-profiles/{id}");
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|