auth0 5.2.0 → 5.3.1
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/LICENSE +1 -1
- package/dist/cjs/management/Client.d.ts +3 -0
- package/dist/cjs/management/Client.js +59 -54
- package/dist/cjs/management/api/errors/PreconditionFailedError.d.ts +5 -0
- package/dist/cjs/management/api/errors/PreconditionFailedError.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 +212 -134
- package/dist/cjs/management/api/requests/requests.js +0 -108
- package/dist/cjs/management/api/resources/actions/client/Client.d.ts +3 -0
- package/dist/cjs/management/api/resources/actions/client/Client.js +9 -4
- package/dist/cjs/management/api/resources/actions/resources/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/actions/resources/index.js +2 -1
- package/dist/cjs/management/api/resources/actions/resources/modules/client/Client.d.ts +149 -0
- package/dist/cjs/management/api/resources/actions/resources/modules/client/Client.js +569 -0
- package/dist/cjs/management/api/resources/actions/resources/modules/client/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/actions/resources/modules/client/index.js +2 -0
- package/dist/cjs/management/api/resources/actions/resources/modules/index.d.ts +2 -0
- package/dist/cjs/management/api/resources/actions/resources/modules/index.js +18 -0
- package/dist/cjs/management/api/resources/actions/resources/modules/resources/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/actions/resources/modules/resources/index.js +37 -0
- package/dist/cjs/management/api/resources/actions/resources/modules/resources/versions/client/Client.d.ts +69 -0
- package/dist/cjs/management/api/resources/actions/resources/modules/resources/versions/client/Client.js +275 -0
- package/dist/cjs/management/api/resources/actions/resources/modules/resources/versions/client/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/actions/resources/modules/resources/versions/client/index.js +2 -0
- package/dist/cjs/management/api/resources/actions/resources/modules/resources/versions/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/actions/resources/modules/resources/versions/index.js +17 -0
- package/dist/cjs/management/api/resources/actions/resources/versions/client/Client.d.ts +2 -2
- package/dist/cjs/management/api/resources/actions/resources/versions/client/Client.js +1 -1
- package/dist/cjs/management/api/resources/clientGrants/client/Client.d.ts +17 -0
- package/dist/cjs/management/api/resources/clientGrants/client/Client.js +61 -0
- package/dist/cjs/management/api/resources/connections/client/Client.d.ts +7 -3
- package/dist/cjs/management/api/resources/connections/client/Client.js +9 -5
- package/dist/cjs/management/api/resources/connections/resources/directoryProvisioning/client/Client.d.ts +18 -0
- package/dist/cjs/management/api/resources/connections/resources/directoryProvisioning/client/Client.js +80 -0
- package/dist/cjs/management/api/resources/deviceCredentials/client/Client.d.ts +1 -0
- package/dist/cjs/management/api/resources/deviceCredentials/client/Client.js +2 -1
- package/dist/cjs/management/api/resources/eventStreams/client/Client.d.ts +1 -2
- package/dist/cjs/management/api/resources/eventStreams/client/Client.js +59 -50
- package/dist/cjs/management/api/resources/flows/client/Client.d.ts +2 -2
- package/dist/cjs/management/api/resources/flows/client/Client.js +1 -1
- package/dist/cjs/management/api/resources/flows/resources/executions/client/Client.d.ts +4 -4
- package/dist/cjs/management/api/resources/flows/resources/executions/client/Client.js +2 -2
- package/dist/cjs/management/api/resources/groups/client/Client.d.ts +56 -0
- package/dist/cjs/management/api/resources/groups/client/Client.js +224 -0
- package/dist/cjs/management/api/resources/groups/client/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/groups/client/index.js +2 -0
- package/dist/cjs/management/api/resources/groups/index.d.ts +2 -0
- package/dist/cjs/management/api/resources/groups/index.js +18 -0
- package/dist/cjs/management/api/resources/groups/resources/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/groups/resources/index.js +37 -0
- package/dist/cjs/management/api/resources/groups/resources/members/client/Client.d.ts +34 -0
- package/dist/cjs/management/api/resources/groups/resources/members/client/Client.js +148 -0
- package/dist/cjs/management/api/resources/groups/resources/members/client/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/groups/resources/members/client/index.js +2 -0
- package/dist/cjs/management/api/resources/groups/resources/members/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/groups/resources/members/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/resources/organizations/resources/discoveryDomains/client/Client.d.ts +20 -1
- package/dist/cjs/management/api/resources/organizations/resources/discoveryDomains/client/Client.js +66 -1
- package/dist/cjs/management/api/resources/prompts/resources/rendering/client/Client.d.ts +1 -1
- package/dist/cjs/management/api/resources/refreshTokens/client/Client.d.ts +18 -0
- package/dist/cjs/management/api/resources/refreshTokens/client/Client.js +67 -0
- package/dist/cjs/management/api/resources/roles/client/Client.d.ts +1 -0
- package/dist/cjs/management/api/resources/roles/client/Client.js +3 -0
- package/dist/cjs/management/api/resources/tokenExchangeProfiles/client/Client.d.ts +2 -1
- package/dist/cjs/management/api/resources/tokenExchangeProfiles/client/Client.js +3 -2
- package/dist/cjs/management/api/resources/users/client/Client.d.ts +3 -0
- package/dist/cjs/management/api/resources/users/client/Client.js +23 -18
- package/dist/cjs/management/api/resources/users/resources/groups/client/Client.d.ts +34 -0
- package/dist/cjs/management/api/resources/users/resources/groups/client/Client.js +148 -0
- package/dist/cjs/management/api/resources/users/resources/groups/client/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/users/resources/groups/client/index.js +2 -0
- package/dist/cjs/management/api/resources/users/resources/groups/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/users/resources/groups/index.js +17 -0
- package/dist/cjs/management/api/resources/users/resources/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/users/resources/index.js +2 -1
- package/dist/cjs/management/api/types/types.d.ts +5277 -1396
- package/dist/cjs/management/api/types/types.js +2143 -442
- 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/errors/PreconditionFailedError.d.mts +5 -0
- package/dist/esm/management/api/errors/PreconditionFailedError.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 +212 -134
- package/dist/esm/management/api/requests/requests.mjs +1 -107
- package/dist/esm/management/api/resources/actions/client/Client.d.mts +3 -0
- package/dist/esm/management/api/resources/actions/client/Client.mjs +5 -0
- package/dist/esm/management/api/resources/actions/resources/index.d.mts +1 -0
- package/dist/esm/management/api/resources/actions/resources/index.mjs +1 -0
- package/dist/esm/management/api/resources/actions/resources/modules/client/Client.d.mts +149 -0
- package/dist/esm/management/api/resources/actions/resources/modules/client/Client.mjs +532 -0
- package/dist/esm/management/api/resources/actions/resources/modules/client/index.d.mts +1 -0
- package/dist/esm/management/api/resources/actions/resources/modules/client/index.mjs +1 -0
- package/dist/esm/management/api/resources/actions/resources/modules/index.d.mts +2 -0
- package/dist/esm/management/api/resources/actions/resources/modules/index.mjs +2 -0
- package/dist/esm/management/api/resources/actions/resources/modules/resources/index.d.mts +1 -0
- package/dist/esm/management/api/resources/actions/resources/modules/resources/index.mjs +1 -0
- package/dist/esm/management/api/resources/actions/resources/modules/resources/versions/client/Client.d.mts +69 -0
- package/dist/esm/management/api/resources/actions/resources/modules/resources/versions/client/Client.mjs +238 -0
- package/dist/esm/management/api/resources/actions/resources/modules/resources/versions/client/index.d.mts +1 -0
- package/dist/esm/management/api/resources/actions/resources/modules/resources/versions/client/index.mjs +1 -0
- package/dist/esm/management/api/resources/actions/resources/modules/resources/versions/index.d.mts +1 -0
- package/dist/esm/management/api/resources/actions/resources/modules/resources/versions/index.mjs +1 -0
- package/dist/esm/management/api/resources/actions/resources/versions/client/Client.d.mts +2 -2
- package/dist/esm/management/api/resources/actions/resources/versions/client/Client.mjs +1 -1
- package/dist/esm/management/api/resources/clientGrants/client/Client.d.mts +17 -0
- package/dist/esm/management/api/resources/clientGrants/client/Client.mjs +61 -0
- package/dist/esm/management/api/resources/connections/client/Client.d.mts +7 -3
- package/dist/esm/management/api/resources/connections/client/Client.mjs +9 -5
- package/dist/esm/management/api/resources/connections/resources/directoryProvisioning/client/Client.d.mts +18 -0
- package/dist/esm/management/api/resources/connections/resources/directoryProvisioning/client/Client.mjs +80 -0
- package/dist/esm/management/api/resources/deviceCredentials/client/Client.d.mts +1 -0
- package/dist/esm/management/api/resources/deviceCredentials/client/Client.mjs +2 -1
- package/dist/esm/management/api/resources/eventStreams/client/Client.d.mts +1 -2
- package/dist/esm/management/api/resources/eventStreams/client/Client.mjs +59 -50
- package/dist/esm/management/api/resources/flows/client/Client.d.mts +2 -2
- package/dist/esm/management/api/resources/flows/client/Client.mjs +1 -1
- package/dist/esm/management/api/resources/flows/resources/executions/client/Client.d.mts +4 -4
- package/dist/esm/management/api/resources/flows/resources/executions/client/Client.mjs +2 -2
- package/dist/esm/management/api/resources/groups/client/Client.d.mts +56 -0
- package/dist/esm/management/api/resources/groups/client/Client.mjs +187 -0
- package/dist/esm/management/api/resources/groups/client/index.d.mts +1 -0
- package/dist/esm/management/api/resources/groups/client/index.mjs +1 -0
- package/dist/esm/management/api/resources/groups/index.d.mts +2 -0
- package/dist/esm/management/api/resources/groups/index.mjs +2 -0
- package/dist/esm/management/api/resources/groups/resources/index.d.mts +1 -0
- package/dist/esm/management/api/resources/groups/resources/index.mjs +1 -0
- package/dist/esm/management/api/resources/groups/resources/members/client/Client.d.mts +34 -0
- package/dist/esm/management/api/resources/groups/resources/members/client/Client.mjs +111 -0
- package/dist/esm/management/api/resources/groups/resources/members/client/index.d.mts +1 -0
- package/dist/esm/management/api/resources/groups/resources/members/client/index.mjs +1 -0
- package/dist/esm/management/api/resources/groups/resources/members/index.d.mts +1 -0
- package/dist/esm/management/api/resources/groups/resources/members/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/resources/organizations/resources/discoveryDomains/client/Client.d.mts +20 -1
- package/dist/esm/management/api/resources/organizations/resources/discoveryDomains/client/Client.mjs +66 -1
- package/dist/esm/management/api/resources/prompts/resources/rendering/client/Client.d.mts +1 -1
- package/dist/esm/management/api/resources/refreshTokens/client/Client.d.mts +18 -0
- package/dist/esm/management/api/resources/refreshTokens/client/Client.mjs +67 -0
- package/dist/esm/management/api/resources/roles/client/Client.d.mts +1 -0
- package/dist/esm/management/api/resources/roles/client/Client.mjs +3 -0
- package/dist/esm/management/api/resources/tokenExchangeProfiles/client/Client.d.mts +2 -1
- package/dist/esm/management/api/resources/tokenExchangeProfiles/client/Client.mjs +3 -2
- package/dist/esm/management/api/resources/users/client/Client.d.mts +3 -0
- package/dist/esm/management/api/resources/users/client/Client.mjs +5 -0
- package/dist/esm/management/api/resources/users/resources/groups/client/Client.d.mts +34 -0
- package/dist/esm/management/api/resources/users/resources/groups/client/Client.mjs +111 -0
- package/dist/esm/management/api/resources/users/resources/groups/client/index.d.mts +1 -0
- package/dist/esm/management/api/resources/users/resources/groups/client/index.mjs +1 -0
- package/dist/esm/management/api/resources/users/resources/groups/index.d.mts +1 -0
- package/dist/esm/management/api/resources/users/resources/groups/index.mjs +1 -0
- package/dist/esm/management/api/resources/users/resources/index.d.mts +1 -0
- package/dist/esm/management/api/resources/users/resources/index.mjs +1 -0
- package/dist/esm/management/api/types/types.d.mts +5277 -1396
- package/dist/esm/management/api/types/types.mjs +2133 -438
- package/dist/esm/management/version.d.mts +1 -1
- package/dist/esm/management/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +1572 -185
|
@@ -0,0 +1,532 @@
|
|
|
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
|
+
import { VersionsClient } from "../resources/versions/client/Client.mjs";
|
|
19
|
+
export class ModulesClient {
|
|
20
|
+
constructor(options) {
|
|
21
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
22
|
+
}
|
|
23
|
+
get versions() {
|
|
24
|
+
var _a;
|
|
25
|
+
return ((_a = this._versions) !== null && _a !== void 0 ? _a : (this._versions = new VersionsClient(this._options)));
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Retrieve a paginated list of all Actions Modules with optional filtering and totals.
|
|
29
|
+
*
|
|
30
|
+
* @param {Management.GetActionModulesRequestParameters} request
|
|
31
|
+
* @param {ModulesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
32
|
+
*
|
|
33
|
+
* @throws {@link Management.BadRequestError}
|
|
34
|
+
* @throws {@link Management.UnauthorizedError}
|
|
35
|
+
* @throws {@link Management.ForbiddenError}
|
|
36
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* await client.actions.modules.list({
|
|
40
|
+
* page: 1,
|
|
41
|
+
* per_page: 1
|
|
42
|
+
* })
|
|
43
|
+
*/
|
|
44
|
+
list() {
|
|
45
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
46
|
+
const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
48
|
+
const { page = 0, per_page: perPage = 50 } = request;
|
|
49
|
+
const _queryParams = {};
|
|
50
|
+
if (page !== undefined) {
|
|
51
|
+
_queryParams["page"] = (_a = page === null || page === void 0 ? void 0 : page.toString()) !== null && _a !== void 0 ? _a : null;
|
|
52
|
+
}
|
|
53
|
+
if (perPage !== undefined) {
|
|
54
|
+
_queryParams["per_page"] = (_b = perPage === null || perPage === void 0 ? void 0 : perPage.toString()) !== null && _b !== void 0 ? _b : null;
|
|
55
|
+
}
|
|
56
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
57
|
+
let _headers = mergeHeaders(_authRequest.headers, (_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
58
|
+
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
59
|
+
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ManagementEnvironment.Default, "actions/modules"),
|
|
60
|
+
method: "GET",
|
|
61
|
+
headers: _headers,
|
|
62
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
63
|
+
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
64
|
+
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
65
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
66
|
+
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
67
|
+
logging: this._options.logging,
|
|
68
|
+
});
|
|
69
|
+
if (_response.ok) {
|
|
70
|
+
return {
|
|
71
|
+
data: _response.body,
|
|
72
|
+
rawResponse: _response.rawResponse,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
if (_response.error.reason === "status-code") {
|
|
76
|
+
switch (_response.error.statusCode) {
|
|
77
|
+
case 400:
|
|
78
|
+
throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
|
|
79
|
+
case 401:
|
|
80
|
+
throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
81
|
+
case 403:
|
|
82
|
+
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
83
|
+
case 429:
|
|
84
|
+
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
85
|
+
default:
|
|
86
|
+
throw new errors.ManagementError({
|
|
87
|
+
statusCode: _response.error.statusCode,
|
|
88
|
+
body: _response.error.body,
|
|
89
|
+
rawResponse: _response.rawResponse,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/actions/modules");
|
|
94
|
+
}));
|
|
95
|
+
let _offset = (request === null || request === void 0 ? void 0 : request.page) != null ? request === null || request === void 0 ? void 0 : request.page : 0;
|
|
96
|
+
const dataWithRawResponse = yield list(request).withRawResponse();
|
|
97
|
+
return new core.Page({
|
|
98
|
+
response: dataWithRawResponse.data,
|
|
99
|
+
rawResponse: dataWithRawResponse.rawResponse,
|
|
100
|
+
hasNextPage: (response) => { var _a, _b; return ((_a = response === null || response === void 0 ? void 0 : response.modules) !== null && _a !== void 0 ? _a : []).length >= Math.floor((_b = request === null || request === void 0 ? void 0 : request.per_page) !== null && _b !== void 0 ? _b : 50); },
|
|
101
|
+
getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.modules) !== null && _a !== void 0 ? _a : []; },
|
|
102
|
+
loadPage: (_response) => {
|
|
103
|
+
_offset += 1;
|
|
104
|
+
return list(core.setObjectProperty(request, "page", _offset));
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Create a new Actions Module for reusable code across actions.
|
|
111
|
+
*
|
|
112
|
+
* @param {Management.CreateActionModuleRequestContent} request
|
|
113
|
+
* @param {ModulesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
114
|
+
*
|
|
115
|
+
* @throws {@link Management.BadRequestError}
|
|
116
|
+
* @throws {@link Management.UnauthorizedError}
|
|
117
|
+
* @throws {@link Management.ForbiddenError}
|
|
118
|
+
* @throws {@link Management.ConflictError}
|
|
119
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* await client.actions.modules.create({
|
|
123
|
+
* name: "name",
|
|
124
|
+
* code: "code"
|
|
125
|
+
* })
|
|
126
|
+
*/
|
|
127
|
+
create(request, requestOptions) {
|
|
128
|
+
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
|
|
129
|
+
}
|
|
130
|
+
__create(request, requestOptions) {
|
|
131
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
132
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
133
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
134
|
+
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);
|
|
135
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
136
|
+
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, "actions/modules"),
|
|
137
|
+
method: "POST",
|
|
138
|
+
headers: _headers,
|
|
139
|
+
contentType: "application/json",
|
|
140
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
141
|
+
requestType: "json",
|
|
142
|
+
body: request,
|
|
143
|
+
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,
|
|
144
|
+
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,
|
|
145
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
146
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
147
|
+
logging: this._options.logging,
|
|
148
|
+
});
|
|
149
|
+
if (_response.ok) {
|
|
150
|
+
return {
|
|
151
|
+
data: _response.body,
|
|
152
|
+
rawResponse: _response.rawResponse,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
if (_response.error.reason === "status-code") {
|
|
156
|
+
switch (_response.error.statusCode) {
|
|
157
|
+
case 400:
|
|
158
|
+
throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
|
|
159
|
+
case 401:
|
|
160
|
+
throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
161
|
+
case 403:
|
|
162
|
+
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
163
|
+
case 409:
|
|
164
|
+
throw new Management.ConflictError(_response.error.body, _response.rawResponse);
|
|
165
|
+
case 429:
|
|
166
|
+
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
167
|
+
default:
|
|
168
|
+
throw new errors.ManagementError({
|
|
169
|
+
statusCode: _response.error.statusCode,
|
|
170
|
+
body: _response.error.body,
|
|
171
|
+
rawResponse: _response.rawResponse,
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/actions/modules");
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Retrieve details of a specific Actions Module by its unique identifier.
|
|
180
|
+
*
|
|
181
|
+
* @param {string} id - The ID of the action module to retrieve.
|
|
182
|
+
* @param {ModulesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
183
|
+
*
|
|
184
|
+
* @throws {@link Management.BadRequestError}
|
|
185
|
+
* @throws {@link Management.UnauthorizedError}
|
|
186
|
+
* @throws {@link Management.ForbiddenError}
|
|
187
|
+
* @throws {@link Management.NotFoundError}
|
|
188
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
189
|
+
*
|
|
190
|
+
* @example
|
|
191
|
+
* await client.actions.modules.get("id")
|
|
192
|
+
*/
|
|
193
|
+
get(id, requestOptions) {
|
|
194
|
+
return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions));
|
|
195
|
+
}
|
|
196
|
+
__get(id, requestOptions) {
|
|
197
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
198
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
199
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
200
|
+
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);
|
|
201
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
202
|
+
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, `actions/modules/${core.url.encodePathParam(id)}`),
|
|
203
|
+
method: "GET",
|
|
204
|
+
headers: _headers,
|
|
205
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
206
|
+
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,
|
|
207
|
+
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,
|
|
208
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
209
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
210
|
+
logging: this._options.logging,
|
|
211
|
+
});
|
|
212
|
+
if (_response.ok) {
|
|
213
|
+
return {
|
|
214
|
+
data: _response.body,
|
|
215
|
+
rawResponse: _response.rawResponse,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
if (_response.error.reason === "status-code") {
|
|
219
|
+
switch (_response.error.statusCode) {
|
|
220
|
+
case 400:
|
|
221
|
+
throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
|
|
222
|
+
case 401:
|
|
223
|
+
throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
224
|
+
case 403:
|
|
225
|
+
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
226
|
+
case 404:
|
|
227
|
+
throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
|
|
228
|
+
case 429:
|
|
229
|
+
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
230
|
+
default:
|
|
231
|
+
throw new errors.ManagementError({
|
|
232
|
+
statusCode: _response.error.statusCode,
|
|
233
|
+
body: _response.error.body,
|
|
234
|
+
rawResponse: _response.rawResponse,
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/actions/modules/{id}");
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Permanently delete an Actions Module. This will fail if the module is still in use by any actions.
|
|
243
|
+
*
|
|
244
|
+
* @param {string} id - The ID of the Actions Module to delete.
|
|
245
|
+
* @param {ModulesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
246
|
+
*
|
|
247
|
+
* @throws {@link Management.BadRequestError}
|
|
248
|
+
* @throws {@link Management.UnauthorizedError}
|
|
249
|
+
* @throws {@link Management.ForbiddenError}
|
|
250
|
+
* @throws {@link Management.NotFoundError}
|
|
251
|
+
* @throws {@link Management.PreconditionFailedError}
|
|
252
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
253
|
+
*
|
|
254
|
+
* @example
|
|
255
|
+
* await client.actions.modules.delete("id")
|
|
256
|
+
*/
|
|
257
|
+
delete(id, requestOptions) {
|
|
258
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions));
|
|
259
|
+
}
|
|
260
|
+
__delete(id, requestOptions) {
|
|
261
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
262
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
263
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
264
|
+
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);
|
|
265
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
266
|
+
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, `actions/modules/${core.url.encodePathParam(id)}`),
|
|
267
|
+
method: "DELETE",
|
|
268
|
+
headers: _headers,
|
|
269
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
270
|
+
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,
|
|
271
|
+
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,
|
|
272
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
273
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
274
|
+
logging: this._options.logging,
|
|
275
|
+
});
|
|
276
|
+
if (_response.ok) {
|
|
277
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
278
|
+
}
|
|
279
|
+
if (_response.error.reason === "status-code") {
|
|
280
|
+
switch (_response.error.statusCode) {
|
|
281
|
+
case 400:
|
|
282
|
+
throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
|
|
283
|
+
case 401:
|
|
284
|
+
throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
285
|
+
case 403:
|
|
286
|
+
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
287
|
+
case 404:
|
|
288
|
+
throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
|
|
289
|
+
case 412:
|
|
290
|
+
throw new Management.PreconditionFailedError(_response.error.body, _response.rawResponse);
|
|
291
|
+
case 429:
|
|
292
|
+
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
293
|
+
default:
|
|
294
|
+
throw new errors.ManagementError({
|
|
295
|
+
statusCode: _response.error.statusCode,
|
|
296
|
+
body: _response.error.body,
|
|
297
|
+
rawResponse: _response.rawResponse,
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/actions/modules/{id}");
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Update properties of an existing Actions Module, such as code, dependencies, or secrets.
|
|
306
|
+
*
|
|
307
|
+
* @param {string} id - The ID of the action module to update.
|
|
308
|
+
* @param {Management.UpdateActionModuleRequestContent} request
|
|
309
|
+
* @param {ModulesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
310
|
+
*
|
|
311
|
+
* @throws {@link Management.BadRequestError}
|
|
312
|
+
* @throws {@link Management.UnauthorizedError}
|
|
313
|
+
* @throws {@link Management.ForbiddenError}
|
|
314
|
+
* @throws {@link Management.NotFoundError}
|
|
315
|
+
* @throws {@link Management.ConflictError}
|
|
316
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
317
|
+
*
|
|
318
|
+
* @example
|
|
319
|
+
* await client.actions.modules.update("id")
|
|
320
|
+
*/
|
|
321
|
+
update(id, request = {}, requestOptions) {
|
|
322
|
+
return core.HttpResponsePromise.fromPromise(this.__update(id, request, requestOptions));
|
|
323
|
+
}
|
|
324
|
+
__update(id_1) {
|
|
325
|
+
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
326
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
327
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
328
|
+
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);
|
|
329
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
330
|
+
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, `actions/modules/${core.url.encodePathParam(id)}`),
|
|
331
|
+
method: "PATCH",
|
|
332
|
+
headers: _headers,
|
|
333
|
+
contentType: "application/json",
|
|
334
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
335
|
+
requestType: "json",
|
|
336
|
+
body: request,
|
|
337
|
+
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,
|
|
338
|
+
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,
|
|
339
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
340
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
341
|
+
logging: this._options.logging,
|
|
342
|
+
});
|
|
343
|
+
if (_response.ok) {
|
|
344
|
+
return {
|
|
345
|
+
data: _response.body,
|
|
346
|
+
rawResponse: _response.rawResponse,
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
if (_response.error.reason === "status-code") {
|
|
350
|
+
switch (_response.error.statusCode) {
|
|
351
|
+
case 400:
|
|
352
|
+
throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
|
|
353
|
+
case 401:
|
|
354
|
+
throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
355
|
+
case 403:
|
|
356
|
+
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
357
|
+
case 404:
|
|
358
|
+
throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
|
|
359
|
+
case 409:
|
|
360
|
+
throw new Management.ConflictError(_response.error.body, _response.rawResponse);
|
|
361
|
+
case 429:
|
|
362
|
+
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
363
|
+
default:
|
|
364
|
+
throw new errors.ManagementError({
|
|
365
|
+
statusCode: _response.error.statusCode,
|
|
366
|
+
body: _response.error.body,
|
|
367
|
+
rawResponse: _response.rawResponse,
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/actions/modules/{id}");
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Lists all actions that are using a specific Actions Module, showing which deployed action versions reference this Actions Module.
|
|
376
|
+
*
|
|
377
|
+
* @param {string} id - The unique ID of the module.
|
|
378
|
+
* @param {Management.GetActionModuleActionsRequestParameters} request
|
|
379
|
+
* @param {ModulesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
380
|
+
*
|
|
381
|
+
* @throws {@link Management.BadRequestError}
|
|
382
|
+
* @throws {@link Management.UnauthorizedError}
|
|
383
|
+
* @throws {@link Management.ForbiddenError}
|
|
384
|
+
* @throws {@link Management.NotFoundError}
|
|
385
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
386
|
+
*
|
|
387
|
+
* @example
|
|
388
|
+
* await client.actions.modules.listActions("id", {
|
|
389
|
+
* page: 1,
|
|
390
|
+
* per_page: 1
|
|
391
|
+
* })
|
|
392
|
+
*/
|
|
393
|
+
listActions(id_1) {
|
|
394
|
+
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
395
|
+
const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
|
|
396
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
397
|
+
const { page = 0, per_page: perPage = 50 } = request;
|
|
398
|
+
const _queryParams = {};
|
|
399
|
+
if (page !== undefined) {
|
|
400
|
+
_queryParams["page"] = (_a = page === null || page === void 0 ? void 0 : page.toString()) !== null && _a !== void 0 ? _a : null;
|
|
401
|
+
}
|
|
402
|
+
if (perPage !== undefined) {
|
|
403
|
+
_queryParams["per_page"] = (_b = perPage === null || perPage === void 0 ? void 0 : perPage.toString()) !== null && _b !== void 0 ? _b : null;
|
|
404
|
+
}
|
|
405
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
406
|
+
let _headers = mergeHeaders(_authRequest.headers, (_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
407
|
+
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
408
|
+
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ManagementEnvironment.Default, `actions/modules/${core.url.encodePathParam(id)}/actions`),
|
|
409
|
+
method: "GET",
|
|
410
|
+
headers: _headers,
|
|
411
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
412
|
+
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
413
|
+
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
414
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
415
|
+
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
416
|
+
logging: this._options.logging,
|
|
417
|
+
});
|
|
418
|
+
if (_response.ok) {
|
|
419
|
+
return {
|
|
420
|
+
data: _response.body,
|
|
421
|
+
rawResponse: _response.rawResponse,
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
if (_response.error.reason === "status-code") {
|
|
425
|
+
switch (_response.error.statusCode) {
|
|
426
|
+
case 400:
|
|
427
|
+
throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
|
|
428
|
+
case 401:
|
|
429
|
+
throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
430
|
+
case 403:
|
|
431
|
+
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
432
|
+
case 404:
|
|
433
|
+
throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
|
|
434
|
+
case 429:
|
|
435
|
+
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
436
|
+
default:
|
|
437
|
+
throw new errors.ManagementError({
|
|
438
|
+
statusCode: _response.error.statusCode,
|
|
439
|
+
body: _response.error.body,
|
|
440
|
+
rawResponse: _response.rawResponse,
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/actions/modules/{id}/actions");
|
|
445
|
+
}));
|
|
446
|
+
let _offset = (request === null || request === void 0 ? void 0 : request.page) != null ? request === null || request === void 0 ? void 0 : request.page : 0;
|
|
447
|
+
const dataWithRawResponse = yield list(request).withRawResponse();
|
|
448
|
+
return new core.Page({
|
|
449
|
+
response: dataWithRawResponse.data,
|
|
450
|
+
rawResponse: dataWithRawResponse.rawResponse,
|
|
451
|
+
hasNextPage: (response) => { var _a, _b; return ((_a = response === null || response === void 0 ? void 0 : response.actions) !== null && _a !== void 0 ? _a : []).length >= Math.floor((_b = request === null || request === void 0 ? void 0 : request.per_page) !== null && _b !== void 0 ? _b : 50); },
|
|
452
|
+
getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.actions) !== null && _a !== void 0 ? _a : []; },
|
|
453
|
+
loadPage: (_response) => {
|
|
454
|
+
_offset += 1;
|
|
455
|
+
return list(core.setObjectProperty(request, "page", _offset));
|
|
456
|
+
},
|
|
457
|
+
});
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Rolls back an Actions Module's draft to a previously created version. This action copies the code, dependencies, and secrets from the specified version into the current draft.
|
|
462
|
+
*
|
|
463
|
+
* @param {string} id - The unique ID of the module to roll back.
|
|
464
|
+
* @param {Management.RollbackActionModuleRequestParameters} request
|
|
465
|
+
* @param {ModulesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
466
|
+
*
|
|
467
|
+
* @throws {@link Management.BadRequestError}
|
|
468
|
+
* @throws {@link Management.UnauthorizedError}
|
|
469
|
+
* @throws {@link Management.ForbiddenError}
|
|
470
|
+
* @throws {@link Management.NotFoundError}
|
|
471
|
+
* @throws {@link Management.ConflictError}
|
|
472
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
473
|
+
*
|
|
474
|
+
* @example
|
|
475
|
+
* await client.actions.modules.rollback("id", {
|
|
476
|
+
* module_version_id: "module_version_id"
|
|
477
|
+
* })
|
|
478
|
+
*/
|
|
479
|
+
rollback(id, request, requestOptions) {
|
|
480
|
+
return core.HttpResponsePromise.fromPromise(this.__rollback(id, request, requestOptions));
|
|
481
|
+
}
|
|
482
|
+
__rollback(id, request, requestOptions) {
|
|
483
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
484
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
485
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
486
|
+
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);
|
|
487
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
488
|
+
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, `actions/modules/${core.url.encodePathParam(id)}/rollback`),
|
|
489
|
+
method: "POST",
|
|
490
|
+
headers: _headers,
|
|
491
|
+
contentType: "application/json",
|
|
492
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
493
|
+
requestType: "json",
|
|
494
|
+
body: request,
|
|
495
|
+
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,
|
|
496
|
+
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,
|
|
497
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
498
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
499
|
+
logging: this._options.logging,
|
|
500
|
+
});
|
|
501
|
+
if (_response.ok) {
|
|
502
|
+
return {
|
|
503
|
+
data: _response.body,
|
|
504
|
+
rawResponse: _response.rawResponse,
|
|
505
|
+
};
|
|
506
|
+
}
|
|
507
|
+
if (_response.error.reason === "status-code") {
|
|
508
|
+
switch (_response.error.statusCode) {
|
|
509
|
+
case 400:
|
|
510
|
+
throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
|
|
511
|
+
case 401:
|
|
512
|
+
throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
513
|
+
case 403:
|
|
514
|
+
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
515
|
+
case 404:
|
|
516
|
+
throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
|
|
517
|
+
case 409:
|
|
518
|
+
throw new Management.ConflictError(_response.error.body, _response.rawResponse);
|
|
519
|
+
case 429:
|
|
520
|
+
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
521
|
+
default:
|
|
522
|
+
throw new errors.ManagementError({
|
|
523
|
+
statusCode: _response.error.statusCode,
|
|
524
|
+
body: _response.error.body,
|
|
525
|
+
rawResponse: _response.rawResponse,
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/actions/modules/{id}/rollback");
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as versions from "./versions/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as versions from "./versions/index.mjs";
|
|
@@ -0,0 +1,69 @@
|
|
|
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 VersionsClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class VersionsClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<VersionsClient.Options>;
|
|
12
|
+
constructor(options: VersionsClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* List all published versions of a specific Actions Module.
|
|
15
|
+
*
|
|
16
|
+
* @param {string} id - The unique ID of the module.
|
|
17
|
+
* @param {Management.GetActionModuleVersionsRequestParameters} request
|
|
18
|
+
* @param {VersionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
19
|
+
*
|
|
20
|
+
* @throws {@link Management.BadRequestError}
|
|
21
|
+
* @throws {@link Management.UnauthorizedError}
|
|
22
|
+
* @throws {@link Management.ForbiddenError}
|
|
23
|
+
* @throws {@link Management.NotFoundError}
|
|
24
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* await client.actions.modules.versions.list("id", {
|
|
28
|
+
* page: 1,
|
|
29
|
+
* per_page: 1
|
|
30
|
+
* })
|
|
31
|
+
*/
|
|
32
|
+
list(id: string, request?: Management.GetActionModuleVersionsRequestParameters, requestOptions?: VersionsClient.RequestOptions): Promise<core.Page<Management.ActionModuleVersion, Management.GetActionModuleVersionsResponseContent>>;
|
|
33
|
+
/**
|
|
34
|
+
* Creates a new immutable version of an Actions Module from the current draft version. This publishes the draft as a new version that can be referenced by actions, while maintaining the existing draft for continued development.
|
|
35
|
+
*
|
|
36
|
+
* @param {string} id - The ID of the action module to create a version for.
|
|
37
|
+
* @param {VersionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
38
|
+
*
|
|
39
|
+
* @throws {@link Management.BadRequestError}
|
|
40
|
+
* @throws {@link Management.UnauthorizedError}
|
|
41
|
+
* @throws {@link Management.ForbiddenError}
|
|
42
|
+
* @throws {@link Management.NotFoundError}
|
|
43
|
+
* @throws {@link Management.ConflictError}
|
|
44
|
+
* @throws {@link Management.PreconditionFailedError}
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* await client.actions.modules.versions.create("id")
|
|
48
|
+
*/
|
|
49
|
+
create(id: string, requestOptions?: VersionsClient.RequestOptions): core.HttpResponsePromise<Management.CreateActionModuleVersionResponseContent>;
|
|
50
|
+
private __create;
|
|
51
|
+
/**
|
|
52
|
+
* Retrieve the details of a specific, immutable version of an Actions Module.
|
|
53
|
+
*
|
|
54
|
+
* @param {string} id - The unique ID of the module.
|
|
55
|
+
* @param {string} versionId - The unique ID of the module version to retrieve.
|
|
56
|
+
* @param {VersionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
57
|
+
*
|
|
58
|
+
* @throws {@link Management.BadRequestError}
|
|
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.actions.modules.versions.get("id", "versionId")
|
|
66
|
+
*/
|
|
67
|
+
get(id: string, versionId: string, requestOptions?: VersionsClient.RequestOptions): core.HttpResponsePromise<Management.GetActionModuleVersionResponseContent>;
|
|
68
|
+
private __get;
|
|
69
|
+
}
|