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,569 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
+
exports.ModulesClient = void 0;
|
|
47
|
+
const BaseClient_js_1 = require("../../../../../../BaseClient.js");
|
|
48
|
+
const core = __importStar(require("../../../../../../core/index.js"));
|
|
49
|
+
const headers_js_1 = require("../../../../../../core/headers.js");
|
|
50
|
+
const environments = __importStar(require("../../../../../../environments.js"));
|
|
51
|
+
const handleNonStatusCodeError_js_1 = require("../../../../../../errors/handleNonStatusCodeError.js");
|
|
52
|
+
const errors = __importStar(require("../../../../../../errors/index.js"));
|
|
53
|
+
const Management = __importStar(require("../../../../../index.js"));
|
|
54
|
+
const Client_js_1 = require("../resources/versions/client/Client.js");
|
|
55
|
+
class ModulesClient {
|
|
56
|
+
constructor(options) {
|
|
57
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
58
|
+
}
|
|
59
|
+
get versions() {
|
|
60
|
+
var _a;
|
|
61
|
+
return ((_a = this._versions) !== null && _a !== void 0 ? _a : (this._versions = new Client_js_1.VersionsClient(this._options)));
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Retrieve a paginated list of all Actions Modules with optional filtering and totals.
|
|
65
|
+
*
|
|
66
|
+
* @param {Management.GetActionModulesRequestParameters} request
|
|
67
|
+
* @param {ModulesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
68
|
+
*
|
|
69
|
+
* @throws {@link Management.BadRequestError}
|
|
70
|
+
* @throws {@link Management.UnauthorizedError}
|
|
71
|
+
* @throws {@link Management.ForbiddenError}
|
|
72
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* await client.actions.modules.list({
|
|
76
|
+
* page: 1,
|
|
77
|
+
* per_page: 1
|
|
78
|
+
* })
|
|
79
|
+
*/
|
|
80
|
+
list() {
|
|
81
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
82
|
+
const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
84
|
+
const { page = 0, per_page: perPage = 50 } = request;
|
|
85
|
+
const _queryParams = {};
|
|
86
|
+
if (page !== undefined) {
|
|
87
|
+
_queryParams["page"] = (_a = page === null || page === void 0 ? void 0 : page.toString()) !== null && _a !== void 0 ? _a : null;
|
|
88
|
+
}
|
|
89
|
+
if (perPage !== undefined) {
|
|
90
|
+
_queryParams["per_page"] = (_b = perPage === null || perPage === void 0 ? void 0 : perPage.toString()) !== null && _b !== void 0 ? _b : null;
|
|
91
|
+
}
|
|
92
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
93
|
+
let _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
94
|
+
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
95
|
+
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"),
|
|
96
|
+
method: "GET",
|
|
97
|
+
headers: _headers,
|
|
98
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
99
|
+
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,
|
|
100
|
+
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,
|
|
101
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
102
|
+
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
103
|
+
logging: this._options.logging,
|
|
104
|
+
});
|
|
105
|
+
if (_response.ok) {
|
|
106
|
+
return {
|
|
107
|
+
data: _response.body,
|
|
108
|
+
rawResponse: _response.rawResponse,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
if (_response.error.reason === "status-code") {
|
|
112
|
+
switch (_response.error.statusCode) {
|
|
113
|
+
case 400:
|
|
114
|
+
throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
|
|
115
|
+
case 401:
|
|
116
|
+
throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
117
|
+
case 403:
|
|
118
|
+
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
119
|
+
case 429:
|
|
120
|
+
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
121
|
+
default:
|
|
122
|
+
throw new errors.ManagementError({
|
|
123
|
+
statusCode: _response.error.statusCode,
|
|
124
|
+
body: _response.error.body,
|
|
125
|
+
rawResponse: _response.rawResponse,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/actions/modules");
|
|
130
|
+
}));
|
|
131
|
+
let _offset = (request === null || request === void 0 ? void 0 : request.page) != null ? request === null || request === void 0 ? void 0 : request.page : 0;
|
|
132
|
+
const dataWithRawResponse = yield list(request).withRawResponse();
|
|
133
|
+
return new core.Page({
|
|
134
|
+
response: dataWithRawResponse.data,
|
|
135
|
+
rawResponse: dataWithRawResponse.rawResponse,
|
|
136
|
+
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); },
|
|
137
|
+
getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.modules) !== null && _a !== void 0 ? _a : []; },
|
|
138
|
+
loadPage: (_response) => {
|
|
139
|
+
_offset += 1;
|
|
140
|
+
return list(core.setObjectProperty(request, "page", _offset));
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Create a new Actions Module for reusable code across actions.
|
|
147
|
+
*
|
|
148
|
+
* @param {Management.CreateActionModuleRequestContent} request
|
|
149
|
+
* @param {ModulesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
150
|
+
*
|
|
151
|
+
* @throws {@link Management.BadRequestError}
|
|
152
|
+
* @throws {@link Management.UnauthorizedError}
|
|
153
|
+
* @throws {@link Management.ForbiddenError}
|
|
154
|
+
* @throws {@link Management.ConflictError}
|
|
155
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* await client.actions.modules.create({
|
|
159
|
+
* name: "name",
|
|
160
|
+
* code: "code"
|
|
161
|
+
* })
|
|
162
|
+
*/
|
|
163
|
+
create(request, requestOptions) {
|
|
164
|
+
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
|
|
165
|
+
}
|
|
166
|
+
__create(request, requestOptions) {
|
|
167
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
168
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
169
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
170
|
+
let _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
171
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
172
|
+
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"),
|
|
173
|
+
method: "POST",
|
|
174
|
+
headers: _headers,
|
|
175
|
+
contentType: "application/json",
|
|
176
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
177
|
+
requestType: "json",
|
|
178
|
+
body: request,
|
|
179
|
+
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,
|
|
180
|
+
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,
|
|
181
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
182
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
183
|
+
logging: this._options.logging,
|
|
184
|
+
});
|
|
185
|
+
if (_response.ok) {
|
|
186
|
+
return {
|
|
187
|
+
data: _response.body,
|
|
188
|
+
rawResponse: _response.rawResponse,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
if (_response.error.reason === "status-code") {
|
|
192
|
+
switch (_response.error.statusCode) {
|
|
193
|
+
case 400:
|
|
194
|
+
throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
|
|
195
|
+
case 401:
|
|
196
|
+
throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
197
|
+
case 403:
|
|
198
|
+
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
199
|
+
case 409:
|
|
200
|
+
throw new Management.ConflictError(_response.error.body, _response.rawResponse);
|
|
201
|
+
case 429:
|
|
202
|
+
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
203
|
+
default:
|
|
204
|
+
throw new errors.ManagementError({
|
|
205
|
+
statusCode: _response.error.statusCode,
|
|
206
|
+
body: _response.error.body,
|
|
207
|
+
rawResponse: _response.rawResponse,
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/actions/modules");
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Retrieve details of a specific Actions Module by its unique identifier.
|
|
216
|
+
*
|
|
217
|
+
* @param {string} id - The ID of the action module to retrieve.
|
|
218
|
+
* @param {ModulesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
219
|
+
*
|
|
220
|
+
* @throws {@link Management.BadRequestError}
|
|
221
|
+
* @throws {@link Management.UnauthorizedError}
|
|
222
|
+
* @throws {@link Management.ForbiddenError}
|
|
223
|
+
* @throws {@link Management.NotFoundError}
|
|
224
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
* await client.actions.modules.get("id")
|
|
228
|
+
*/
|
|
229
|
+
get(id, requestOptions) {
|
|
230
|
+
return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions));
|
|
231
|
+
}
|
|
232
|
+
__get(id, requestOptions) {
|
|
233
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
234
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
235
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
236
|
+
let _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
237
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
238
|
+
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)}`),
|
|
239
|
+
method: "GET",
|
|
240
|
+
headers: _headers,
|
|
241
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
242
|
+
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,
|
|
243
|
+
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,
|
|
244
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
245
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
246
|
+
logging: this._options.logging,
|
|
247
|
+
});
|
|
248
|
+
if (_response.ok) {
|
|
249
|
+
return {
|
|
250
|
+
data: _response.body,
|
|
251
|
+
rawResponse: _response.rawResponse,
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
if (_response.error.reason === "status-code") {
|
|
255
|
+
switch (_response.error.statusCode) {
|
|
256
|
+
case 400:
|
|
257
|
+
throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
|
|
258
|
+
case 401:
|
|
259
|
+
throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
260
|
+
case 403:
|
|
261
|
+
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
262
|
+
case 404:
|
|
263
|
+
throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
|
|
264
|
+
case 429:
|
|
265
|
+
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
266
|
+
default:
|
|
267
|
+
throw new errors.ManagementError({
|
|
268
|
+
statusCode: _response.error.statusCode,
|
|
269
|
+
body: _response.error.body,
|
|
270
|
+
rawResponse: _response.rawResponse,
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/actions/modules/{id}");
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Permanently delete an Actions Module. This will fail if the module is still in use by any actions.
|
|
279
|
+
*
|
|
280
|
+
* @param {string} id - The ID of the Actions Module to delete.
|
|
281
|
+
* @param {ModulesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
282
|
+
*
|
|
283
|
+
* @throws {@link Management.BadRequestError}
|
|
284
|
+
* @throws {@link Management.UnauthorizedError}
|
|
285
|
+
* @throws {@link Management.ForbiddenError}
|
|
286
|
+
* @throws {@link Management.NotFoundError}
|
|
287
|
+
* @throws {@link Management.PreconditionFailedError}
|
|
288
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
289
|
+
*
|
|
290
|
+
* @example
|
|
291
|
+
* await client.actions.modules.delete("id")
|
|
292
|
+
*/
|
|
293
|
+
delete(id, requestOptions) {
|
|
294
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions));
|
|
295
|
+
}
|
|
296
|
+
__delete(id, requestOptions) {
|
|
297
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
298
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
299
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
300
|
+
let _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
301
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
302
|
+
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)}`),
|
|
303
|
+
method: "DELETE",
|
|
304
|
+
headers: _headers,
|
|
305
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
306
|
+
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,
|
|
307
|
+
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,
|
|
308
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
309
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
310
|
+
logging: this._options.logging,
|
|
311
|
+
});
|
|
312
|
+
if (_response.ok) {
|
|
313
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
314
|
+
}
|
|
315
|
+
if (_response.error.reason === "status-code") {
|
|
316
|
+
switch (_response.error.statusCode) {
|
|
317
|
+
case 400:
|
|
318
|
+
throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
|
|
319
|
+
case 401:
|
|
320
|
+
throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
321
|
+
case 403:
|
|
322
|
+
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
323
|
+
case 404:
|
|
324
|
+
throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
|
|
325
|
+
case 412:
|
|
326
|
+
throw new Management.PreconditionFailedError(_response.error.body, _response.rawResponse);
|
|
327
|
+
case 429:
|
|
328
|
+
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
329
|
+
default:
|
|
330
|
+
throw new errors.ManagementError({
|
|
331
|
+
statusCode: _response.error.statusCode,
|
|
332
|
+
body: _response.error.body,
|
|
333
|
+
rawResponse: _response.rawResponse,
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/actions/modules/{id}");
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Update properties of an existing Actions Module, such as code, dependencies, or secrets.
|
|
342
|
+
*
|
|
343
|
+
* @param {string} id - The ID of the action module to update.
|
|
344
|
+
* @param {Management.UpdateActionModuleRequestContent} request
|
|
345
|
+
* @param {ModulesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
346
|
+
*
|
|
347
|
+
* @throws {@link Management.BadRequestError}
|
|
348
|
+
* @throws {@link Management.UnauthorizedError}
|
|
349
|
+
* @throws {@link Management.ForbiddenError}
|
|
350
|
+
* @throws {@link Management.NotFoundError}
|
|
351
|
+
* @throws {@link Management.ConflictError}
|
|
352
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
353
|
+
*
|
|
354
|
+
* @example
|
|
355
|
+
* await client.actions.modules.update("id")
|
|
356
|
+
*/
|
|
357
|
+
update(id, request = {}, requestOptions) {
|
|
358
|
+
return core.HttpResponsePromise.fromPromise(this.__update(id, request, requestOptions));
|
|
359
|
+
}
|
|
360
|
+
__update(id_1) {
|
|
361
|
+
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
362
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
363
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
364
|
+
let _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
365
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
366
|
+
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)}`),
|
|
367
|
+
method: "PATCH",
|
|
368
|
+
headers: _headers,
|
|
369
|
+
contentType: "application/json",
|
|
370
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
371
|
+
requestType: "json",
|
|
372
|
+
body: request,
|
|
373
|
+
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,
|
|
374
|
+
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,
|
|
375
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
376
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
377
|
+
logging: this._options.logging,
|
|
378
|
+
});
|
|
379
|
+
if (_response.ok) {
|
|
380
|
+
return {
|
|
381
|
+
data: _response.body,
|
|
382
|
+
rawResponse: _response.rawResponse,
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
if (_response.error.reason === "status-code") {
|
|
386
|
+
switch (_response.error.statusCode) {
|
|
387
|
+
case 400:
|
|
388
|
+
throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
|
|
389
|
+
case 401:
|
|
390
|
+
throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
391
|
+
case 403:
|
|
392
|
+
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
393
|
+
case 404:
|
|
394
|
+
throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
|
|
395
|
+
case 409:
|
|
396
|
+
throw new Management.ConflictError(_response.error.body, _response.rawResponse);
|
|
397
|
+
case 429:
|
|
398
|
+
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
399
|
+
default:
|
|
400
|
+
throw new errors.ManagementError({
|
|
401
|
+
statusCode: _response.error.statusCode,
|
|
402
|
+
body: _response.error.body,
|
|
403
|
+
rawResponse: _response.rawResponse,
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/actions/modules/{id}");
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Lists all actions that are using a specific Actions Module, showing which deployed action versions reference this Actions Module.
|
|
412
|
+
*
|
|
413
|
+
* @param {string} id - The unique ID of the module.
|
|
414
|
+
* @param {Management.GetActionModuleActionsRequestParameters} request
|
|
415
|
+
* @param {ModulesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
416
|
+
*
|
|
417
|
+
* @throws {@link Management.BadRequestError}
|
|
418
|
+
* @throws {@link Management.UnauthorizedError}
|
|
419
|
+
* @throws {@link Management.ForbiddenError}
|
|
420
|
+
* @throws {@link Management.NotFoundError}
|
|
421
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
422
|
+
*
|
|
423
|
+
* @example
|
|
424
|
+
* await client.actions.modules.listActions("id", {
|
|
425
|
+
* page: 1,
|
|
426
|
+
* per_page: 1
|
|
427
|
+
* })
|
|
428
|
+
*/
|
|
429
|
+
listActions(id_1) {
|
|
430
|
+
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
431
|
+
const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
|
|
432
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
433
|
+
const { page = 0, per_page: perPage = 50 } = request;
|
|
434
|
+
const _queryParams = {};
|
|
435
|
+
if (page !== undefined) {
|
|
436
|
+
_queryParams["page"] = (_a = page === null || page === void 0 ? void 0 : page.toString()) !== null && _a !== void 0 ? _a : null;
|
|
437
|
+
}
|
|
438
|
+
if (perPage !== undefined) {
|
|
439
|
+
_queryParams["per_page"] = (_b = perPage === null || perPage === void 0 ? void 0 : perPage.toString()) !== null && _b !== void 0 ? _b : null;
|
|
440
|
+
}
|
|
441
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
442
|
+
let _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
443
|
+
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
444
|
+
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`),
|
|
445
|
+
method: "GET",
|
|
446
|
+
headers: _headers,
|
|
447
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
448
|
+
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,
|
|
449
|
+
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,
|
|
450
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
451
|
+
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
452
|
+
logging: this._options.logging,
|
|
453
|
+
});
|
|
454
|
+
if (_response.ok) {
|
|
455
|
+
return {
|
|
456
|
+
data: _response.body,
|
|
457
|
+
rawResponse: _response.rawResponse,
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
if (_response.error.reason === "status-code") {
|
|
461
|
+
switch (_response.error.statusCode) {
|
|
462
|
+
case 400:
|
|
463
|
+
throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
|
|
464
|
+
case 401:
|
|
465
|
+
throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
466
|
+
case 403:
|
|
467
|
+
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
468
|
+
case 404:
|
|
469
|
+
throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
|
|
470
|
+
case 429:
|
|
471
|
+
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
472
|
+
default:
|
|
473
|
+
throw new errors.ManagementError({
|
|
474
|
+
statusCode: _response.error.statusCode,
|
|
475
|
+
body: _response.error.body,
|
|
476
|
+
rawResponse: _response.rawResponse,
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/actions/modules/{id}/actions");
|
|
481
|
+
}));
|
|
482
|
+
let _offset = (request === null || request === void 0 ? void 0 : request.page) != null ? request === null || request === void 0 ? void 0 : request.page : 0;
|
|
483
|
+
const dataWithRawResponse = yield list(request).withRawResponse();
|
|
484
|
+
return new core.Page({
|
|
485
|
+
response: dataWithRawResponse.data,
|
|
486
|
+
rawResponse: dataWithRawResponse.rawResponse,
|
|
487
|
+
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); },
|
|
488
|
+
getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.actions) !== null && _a !== void 0 ? _a : []; },
|
|
489
|
+
loadPage: (_response) => {
|
|
490
|
+
_offset += 1;
|
|
491
|
+
return list(core.setObjectProperty(request, "page", _offset));
|
|
492
|
+
},
|
|
493
|
+
});
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* 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.
|
|
498
|
+
*
|
|
499
|
+
* @param {string} id - The unique ID of the module to roll back.
|
|
500
|
+
* @param {Management.RollbackActionModuleRequestParameters} request
|
|
501
|
+
* @param {ModulesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
502
|
+
*
|
|
503
|
+
* @throws {@link Management.BadRequestError}
|
|
504
|
+
* @throws {@link Management.UnauthorizedError}
|
|
505
|
+
* @throws {@link Management.ForbiddenError}
|
|
506
|
+
* @throws {@link Management.NotFoundError}
|
|
507
|
+
* @throws {@link Management.ConflictError}
|
|
508
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
509
|
+
*
|
|
510
|
+
* @example
|
|
511
|
+
* await client.actions.modules.rollback("id", {
|
|
512
|
+
* module_version_id: "module_version_id"
|
|
513
|
+
* })
|
|
514
|
+
*/
|
|
515
|
+
rollback(id, request, requestOptions) {
|
|
516
|
+
return core.HttpResponsePromise.fromPromise(this.__rollback(id, request, requestOptions));
|
|
517
|
+
}
|
|
518
|
+
__rollback(id, request, requestOptions) {
|
|
519
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
520
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
521
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
522
|
+
let _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
523
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
524
|
+
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`),
|
|
525
|
+
method: "POST",
|
|
526
|
+
headers: _headers,
|
|
527
|
+
contentType: "application/json",
|
|
528
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
529
|
+
requestType: "json",
|
|
530
|
+
body: request,
|
|
531
|
+
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,
|
|
532
|
+
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,
|
|
533
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
534
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
535
|
+
logging: this._options.logging,
|
|
536
|
+
});
|
|
537
|
+
if (_response.ok) {
|
|
538
|
+
return {
|
|
539
|
+
data: _response.body,
|
|
540
|
+
rawResponse: _response.rawResponse,
|
|
541
|
+
};
|
|
542
|
+
}
|
|
543
|
+
if (_response.error.reason === "status-code") {
|
|
544
|
+
switch (_response.error.statusCode) {
|
|
545
|
+
case 400:
|
|
546
|
+
throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
|
|
547
|
+
case 401:
|
|
548
|
+
throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
549
|
+
case 403:
|
|
550
|
+
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
551
|
+
case 404:
|
|
552
|
+
throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
|
|
553
|
+
case 409:
|
|
554
|
+
throw new Management.ConflictError(_response.error.body, _response.rawResponse);
|
|
555
|
+
case 429:
|
|
556
|
+
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
557
|
+
default:
|
|
558
|
+
throw new errors.ManagementError({
|
|
559
|
+
statusCode: _response.error.statusCode,
|
|
560
|
+
body: _response.error.body,
|
|
561
|
+
rawResponse: _response.rawResponse,
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/actions/modules/{id}/rollback");
|
|
566
|
+
});
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
exports.ModulesClient = ModulesClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./client/index.js"), exports);
|
|
18
|
+
__exportStar(require("./resources/index.js"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as versions from "./versions/index.js";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.versions = void 0;
|
|
37
|
+
exports.versions = __importStar(require("./versions/index.js"));
|