From a66e9f933fd483102ca1832c31f315f1bf2e75c0 Mon Sep 17 00:00:00 2001 From: Chris Donnelly Date: Thu, 10 Nov 2022 19:37:59 -0600 Subject: [PATCH 1/3] npm install bumped this --- dist/alks.umd.js | 2692 ++++++++--------- docs/classes/export_.Alks.html | 60 +- docs/classes/export_.AlksError.html | 2 +- docs/enums/export_.PseudoBoolean.html | 2 +- docs/enums/export_.TrustType.html | 2 +- docs/interfaces/AccessToken.html | 2 +- docs/interfaces/Account.html | 2 +- docs/interfaces/AccountUserDetails.html | 2 +- docs/interfaces/AwsAccountRole.html | 2 +- docs/interfaces/AwsRoleType.html | 2 +- docs/interfaces/CloudsploitReport.html | 2 +- docs/interfaces/CostTotal.html | 2 +- docs/interfaces/IamUser.html | 2 +- docs/interfaces/Key.html | 2 +- docs/interfaces/LongTermKey.html | 2 +- docs/interfaces/MachineIdentity.html | 2 +- docs/interfaces/RefreshToken.html | 2 +- docs/interfaces/Role.html | 2 +- docs/interfaces/SkypieaAccount.html | 2 +- docs/interfaces/Tag.html | 2 +- docs/interfaces/User.html | 2 +- docs/interfaces/export_.AccessToken.html | 2 +- docs/interfaces/export_.Account.html | 2 +- .../export_.AccountUserDetails.html | 2 +- docs/interfaces/export_.AwsAccountRole.html | 2 +- docs/interfaces/export_.AwsRoleType.html | 2 +- .../interfaces/export_.CloudsploitReport.html | 2 +- docs/interfaces/export_.CostTotal.html | 2 +- docs/interfaces/export_.IamUser.html | 2 +- docs/interfaces/export_.Key.html | 2 +- docs/interfaces/export_.LongTermKey.html | 2 +- docs/interfaces/export_.MachineIdentity.html | 2 +- docs/interfaces/export_.RefreshToken.html | 2 +- docs/interfaces/export_.Role.html | 2 +- docs/interfaces/export_.SkypieaAccount.html | 2 +- docs/interfaces/export_.Tag.html | 2 +- docs/interfaces/export_.User.html | 2 +- docs/modules.html | 2 +- docs/modules/export_.html | 2 +- package-lock.json | 2 +- 40 files changed, 1414 insertions(+), 1414 deletions(-) diff --git a/dist/alks.umd.js b/dist/alks.umd.js index 3a2c04f4..7aaa45ba 100644 --- a/dist/alks.umd.js +++ b/dist/alks.umd.js @@ -17529,1352 +17529,1352 @@ var require$$3 = /*@__PURE__*/getAugmentedNamespace(lib); - var tslib_1 = require$$0$1; - var packageJson = tslib_1.__importStar(require$$1$1); - var buffer_1 = require$$2; - tslib_1.__importDefault(require$$3); - var fetch = window.fetch.bind(window) - ; - var ALKS; - (function (ALKS) { - function isStsAuth(a) { - return a.accessKey !== undefined; - } - function isPasswordAuth(a) { - return a.userid !== undefined; - } - function isTokenAuth(a) { - return a.accessToken !== undefined; - } - (function (TrustType) { - TrustType["CrossAccount"] = "Cross Account"; - TrustType["InnerAccount"] = "Inner Account"; - })(ALKS.TrustType || (ALKS.TrustType = {})); - (function (PseudoBoolean) { - PseudoBoolean[PseudoBoolean["True"] = 1] = "True"; - PseudoBoolean[PseudoBoolean["False"] = 0] = "False"; - })(ALKS.PseudoBoolean || (ALKS.PseudoBoolean = {})); - /** - * ALKS JavaScript API - */ - var Alks = /** @class */ (function () { - function Alks(config) { - this.config = config; - } - /** - * Returns a new instance of alks with pre-defined properties (which don't need to be supplied to every method). - * - * Any of the properties required by other methods can be specified here. - * - * Properties present on the current object are carried through to the newly created one. - * - * @param {Object} props - An object containing settings for the new ALKS object - * @returns {alks} - * @example - * var myAlks = alks.create({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * }) - * - * myAlks.getKeys({ - * account: 'anAccount', - * role: 'PowerUser', - * sessionTime: 2 - * }).then((creds) => { - * // creds.accessKey, creds.secretKey, creds.sessionToken - * }) - */ - Alks.prototype.create = function (props) { - var config = tslib_1.__assign(tslib_1.__assign({}, this.config), props); - return new Alks(config); - }; - /** - * Returns a Promise for an array of AWS accounts (and roles) accessible by the user - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @returns {Promise} - * @example - * alks.getAccounts({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * }).then((accounts) => { - * // accounts[0].account, accounts[0].role, accounts[0].iamKeyActive, accounts[0].maxKeyDuration, accounts[0].skypieaAccount - * }) - */ - Alks.prototype.getAccounts = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('getAccounts', props)]; - case 1: - results = _a.sent(); - return [2 /*return*/, Object.keys(results.accountListRole).map(function (key) { return ({ - account: key, - role: results.accountListRole[key][0].role, - iamKeyActive: results.accountListRole[key][0].iamKeyActive, - maxKeyDuration: results.accountListRole[key][0].maxKeyDuration, - securityLevel: results.accountListRole[key][0].securityLevel, - skypieaAccount: results.accountListRole[key][0].skypieaAccount, - }); })]; - } - }); - }); - }; - /** - * Returns a Promise for AWS STS credentials from ALKS. - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.account - The AWS account to use when provisioning the credentials - * @param {string} props.role - The ALKS role to use when provisioning the credentials - * @param {string} props.sessionTime - The session length for the credentials - * @returns {Promise} - * @example - * alks.getKeys({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * role: 'PowerUser', - * sessionTime: 2 - * }).then((creds) => { - * // creds.accessKey, creds.secretKey, creds.sessionToken, creds.consoleURL - * }) - */ - Alks.prototype.getKeys = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('getKeys', props)]; - case 1: - results = _a.sent(); - return [2 /*return*/, pick(results, [ - 'accessKey', - 'secretKey', - 'sessionToken', - 'consoleURL', - ])]; - } - }); - }); - }; - /** - * Returns a Promise for AWS STS credentials with IAM permissions from ALKS. - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.account - The AWS account to use when provisioning the credentials - * @param {string} props.role - The ALKS role to use when provisioning the credentials - * @param {number} props.sessionTime - The session length for the credentials - * @returns {Promise} - * @example - * alks.getIAMKeys({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * role: 'IAMAdmin', - * sessionTime: 1 - * }).then((creds) => { - * // creds.accessKey, creds.secretKey, creds.sessionToken, creds.consoleURL - * }) - */ - Alks.prototype.getIAMKeys = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('getIAMKeys', props)]; - case 1: - results = _a.sent(); - return [2 /*return*/, pick(results, [ - 'accessKey', - 'secretKey', - 'sessionToken', - 'consoleURL', - ])]; - } - }); - }); - }; - /** - * Returns a Promise for an array of all available role types (AWS IAM role types, custom role types) and their details - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {boolean} [props.getDynamicValues] - Whether to include the names of any template variables in the response (defaults to false) - * @returns {Promise>} - * @example - * alks.getAllAWSRoleTypes({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * }).then((roleTypes) { - * // roleTypes[i].roleTypeName, roleTypes[i].defaultArns, roleTypes[i].trustRelationship - * }) - * - * @example - * alks.getAllAWSRoleTypes({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * getDynamicValues: true, - * }).then((roleTypes) { - * // roleTypes[i].roleTypeName, roleTypes[i].defaultArns, roleTypes[i].trustRelationship, roleTypes[i].templateVariables[i] - * }) - */ - Alks.prototype.getAllAWSRoleTypes = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var url, results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: - url = props.getDynamicValues - ? 'allAwsRoleTypes?getDynamicValues=true' - : 'allAwsRoleTypes'; - return [4 /*yield*/, this.internalFetch(url, props, 'GET')]; - case 1: - results = _a.sent(); - return [2 /*return*/, results.roleTypes]; - } - }); - }); - }; - /** - * Returns a Promise for an array of available AWS IAM role types - * - * @deprecated Replaced by getAllAWSRoleTypes which includes all AWS role types and their details - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @returns {Promise>} - * @example - * alks.getAWSRoleTypes({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * }).then((roleTypes) { - * // ['AWS Lambda', 'Amazon EC2', ... ] - * }) - */ - Alks.prototype.getAWSRoleTypes = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('getAWSRoleTypes', props)]; - case 1: - results = _a.sent(); - return [2 /*return*/, JSON.parse(results.roleTypes)]; - } - }); - }); - }; - /** - * Returns a Promise for an array of available custom role types - * - * @deprecated Replaced by getAllAWSRoleTypes which includes all AWS role types and their details - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @returns {Promise>} - * @example - * alks.getNonServiceAWSRoleTypes({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * }).then((roleTypes) => { - * // ['AWS Lambda', 'Amazon EC2', ...] - * }) - */ - Alks.prototype.getNonServiceAWSRoleTypes = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('getNonServiceAWSRoleTypes', props)]; - case 1: - results = _a.sent(); - return [2 /*return*/, JSON.parse(results.roleTypes)]; - } - }); - }); - }; - /** - * Returns a Promise for the results of creating a new custom AWS IAM account role - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.account - The user's account associated with the custom role - * @param {string} props.role - The user's role associated with the account - * @param {string} props.roleName - The name of the custom AWS IAM role to create - * @param {string} props.roleType - The type of AWS role to use when creating the new role - * @param {Object} props.trustPolicy - * @param {number} props.includeDefaultPolicy - Whether to include the default policy in the new role (1 = yes, 0 = no) - * @param {boolean} props.enableAlksAccess - Whether the role has a machine identity - * @param {Object} props.templateFields - An object whose keys are template variable names and values are the value to substitute for those template variables - * @param {Array.} props.tags - A list of tag objects, where each object is in the form {key: "tagKey" value: "tagValue"} - * @returns {Promise} - * @example - * alks.createRole({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * role: 'IAMAdmin', - * roleName: 'awsRoleName', - * roleType: 'Amazon EC2', - * includeDefaultPolicy: 1, - * enableAlksAccess: true - * }).then((role) => { - * // role.roleArn, role.denyArns, role.instanceProfileArn, role.addedRoleToInstanceProfile, role.tags - * }) - * @example - * alks.createRole({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * role: 'IAMAdmin', - * roleName: 'awsRoleName', - * trustPolicy: { - * "Version": "2012-10-17", - * "Statement": [ - * { - * "Action": "sts:AssumeRole", - * "Effect": "Allow", - * "Principal": { - * "Service": "ec2.amazonaws.com" - * } - * } - * ] - * }, - * includeDefaultPolicy: 1, - * enableAlksAccess: true - * }).then((role) => { - * // role.roleArn, role.denyArns, role.instanceProfileArn, role.addedRoleToInstanceProfile, role.tags - * }) - * @example - * alks.createRole({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * role: 'IAMAdmin', - * roleName: 'awsRoleName', - * roleType: 'Amazon EKS IRSA', - * includeDefaultPolicy: 1, - * enableAlksAccess: false, - * templateFields: { - * OIDC_PROVIDER: 'oidc.eks.us-east-1.amazonaws.com/id/88G998884RBAD6687HBE3GETY67FQE04', - * K8S_NAMESPACE: 'myNamespace', - * K8S_SERVICE_ACCOUNT: 'myServiceAccount' - * } - * tags: [ - * { - * key: "tagkey1", - * value: "tagValue1" - * }, - * { - * key: "tagkey1", - * value: "tagvalue2" - * } - * ], - * }).then((role) => { - * // role.roleArn, role.denyArns, role.instanceProfileArn, role.addedRoleToInstanceProfile, role.tags - * }) - */ - Alks.prototype.createRole = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var roleTypeExists, trustPolicyExists, results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: - roleTypeExists = props.roleType != null; - trustPolicyExists = props.trustPolicy != null; - if (!(roleTypeExists !== trustPolicyExists)) return [3 /*break*/, 2]; - return [4 /*yield*/, this.internalFetch('createRole', props)]; - case 1: - results = _a.sent(); - results.denyArns = results.denyArns.split(','); - return [2 /*return*/, pick(results, [ - 'roleArn', - 'denyArns', - 'instanceProfileArn', - 'addedRoleToInstanceProfile', - 'tags', - ])]; - case 2: throw new Error("Must include roleType or trustPolicy, but not both."); - } - }); - }); - }; - /** - * Returns a Promise for the results of creating a new custom AWS IAM trust role - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.account - The user's account associated with the custom role - * @param {string} props.role - The user's role associated with the account - * @param {string} props.roleName - The name of the custom AWS IAM role to create - * @param {string} props.roleType - The type of AWS role to use when creating the new role - * @param {number} props.includeDefaultPolicy - Whether to include the default policy in the new role (1 = yes, 0 = no) - * @param {string} props.trustArn - The Arn of the existing role to trust - * @param {string} props.trustType - Whether the trust is 'Cross Account' or 'Inner Account' - * @param {boolean} props.enableAlksAccess - Whether the role has a machine identity - * @param {Array.} props.tags - A list of tag objects, where each object is in the form {key: "tagKey" value: "tagValue"} - * @returns {Promise} - * @example - * alks.createNonServiceRole({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * role: 'IAMAdmin', - * roleName: 'awsRoleName', - * roleType: 'Amazon EC2', - * includeDefaultPolicy: 1, - * trustArn: 'anExistingRoleArn', - * trustType: 'Cross Account', - * enableAlksAccess: true - * }).then((role) => { - * // role.roleArn, role.denyArns, role.instanceProfileArn, role.addedRoleToInstanceProfile, role.tags - * }) - * @@example - * * alks.createNonServiceRole({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * role: 'IAMAdmin', - * roleName: 'awsRoleName', - * roleType: 'Amazon EC2', - * includeDefaultPolicy: 1, - * trustArn: 'anExistingRoleArn', - * trustType: 'Cross Account', - * enableAlksAccess: true, - * tags: [ - * { - * key: "tagkey1", - * value: "tagValue1" - * }, - * { - * key: "tagkey1", - * value: "tagvalue2" - * } - * ], - * }).then((role) => { - * // role.roleArn, role.denyArns, role.instanceProfileArn, role.addedRoleToInstanceProfile, role.tags - * }) - */ - Alks.prototype.createNonServiceRole = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('createNonServiceRole', props)]; - case 1: - results = _a.sent(); - results.denyArns = results.denyArns.split(','); - return [2 /*return*/, pick(results, [ - 'roleArn', - 'denyArns', - 'instanceProfileArn', - 'addedRoleToInstanceProfile', - 'tags', - ])]; - } - }); - }); - }; - /** - * Returns a Promise for an array of AWS account roles - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.account - The account number to get AWS roles for - * @returns {Promise} - * @example - * alks.awsAccountRoles({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: '1234567890', - * }).then((roles) => { - * // roles[i].roleArn, roles[i].isMachineIdentity, roles[i].assumeRolePolicyDocument - * }) - */ - Alks.prototype.awsAccountRoles = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch("awsAccountRoles?account=" + props.account, props, 'GET')]; - case 1: - results = _a.sent(); - return [2 /*return*/, results.awsRoleList]; - } - }); - }); - }; - /** - * Returns a Promise for an array of AWS custom AWS IAM account roles - * - * @deprecated Replaced by awsAccountRoles which includes AWS account roles and their details - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.account - The user's account associated with the custom role - * @param {string} props.role - The user's role associated with the account - * @returns {Promise} - * @example - * alks.listAWSAccountRoles({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * role: 'IAMAdmin', - * }).then((roleNames) => { - * // ['customRole1', 'customRole2', ...] - * }) - */ - Alks.prototype.listAWSAccountRoles = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('listAWSAccountRoles', props)]; - case 1: - results = _a.sent(); - return [2 /*return*/, JSON.parse(results.jsonAWSRoleList).map(function (r) { return r.split('/').slice(-1)[0]; })]; - } - }); - }); - }; - /** - * Returns a Promise for the Amazon Resource Name (ARN) of a custom AWS IAM account role - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.account - The user's account associated with the custom role - * @param {string} props.role - The user's role associated with the account - * @param {string} props.roleName - The name of the custom AWS IAM role - * @param {Array.} props.tags - A list of tag objects, where each object is in the form {key: "tagKey" value: "tagValue"} - * @returns {Promise} - * @example - * alks.getAccountRole({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * role: 'IAMAdmin', - * roleName: 'awsRoleName' - * }).then((role) => { - * // role.roleArn, role.isMachineIdentity, role.instanceProfileArn, role.tags, role.maxSessionDurationInSeconds - * }) - */ - Alks.prototype.getAccountRole = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('getAccountRole', props)]; - case 1: - results = _a.sent(); - if (!results.roleExists) { - throw new Error("Role " + props.roleName + " does not exist in this account"); - } - return [2 /*return*/, tslib_1.__assign(tslib_1.__assign({}, pick(results, [ - 'roleArn', - 'isMachineIdentity', - 'tags', - 'maxSessionDurationInSeconds', - ])), { instanceProfileArn: results.instanceProfileARN })]; - } - }); - }); - }; - /** - * Returns a Promise for the Amazon Resource Name (ARN) of a custom AWS IAM account role - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.account - The user's account associated with the custom role - * @param {string} props.role - The user's role associated with the account - * @param {string} props.roleName - The name of the custom AWS IAM role - * @param {Array.} props.tags - A list of tag objects, where each object is in the form {key: "tagKey" value: "tagValue"} - * @returns {Promise} - * @example - * alks.updateRole({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * role: 'IAMAdmin', - * roleName: 'awsRoleName' - * }).then((role) => { - * // role.roleArn, role.isMachineIdentity, role.instanceProfileArn, role.tags - * }) - */ - Alks.prototype.updateRole = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('role', props, 'PATCH')]; - case 1: - results = _a.sent(); - if (!results.roleExists) { - throw new Error("Role " + props.roleName + " does not exist in this account"); - } - return [2 /*return*/, tslib_1.__assign(tslib_1.__assign({}, pick(results, ['roleArn', 'isMachineIdentity', 'tags'])), { instanceProfileArn: results.instanceProfileARN })]; - } - }); - }); - }; - /** - * Returns a Promise for a boolean "true" indicating the role was deleted - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.account - The user's account associated with the custom role - * @param {string} props.role - The user's role associated with the account - * @param {string} props.roleName - The name of the custom AWS IAM role - * @returns {Promise} - * @example - * alks.deleteRole({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * role: 'IAMAdmin', - * roleName: 'awsRoleName' - * }).then(() => { - * // success! - * }) - */ - Alks.prototype.deleteRole = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('deleteRole', props)]; - case 1: - _a.sent(); - return [2 /*return*/, true]; - } - }); - }); - }; - /** - * Returns a Promise for a string arn indicating the role was enabled for machine identity - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.roleArn - The Amazon Resource Name (ARN) associated with the role - * @returns {Promise} - * @example - * alks.addRoleMachineIdentity({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * roleARN: 'arn:aws:iam::123:role/acct-managed/awsRoleName' - * }).then((roleARN) => { - * // arn:aws:iam::123:role/acct-managed/awsRoleName - * }) - */ - Alks.prototype.addRoleMachineIdentity = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('roleMachineIdentity', props)]; - case 1: - results = _a.sent(); - return [2 /*return*/, pick(results, ['machineIdentityArn'])]; - } - }); - }); - }; - /** - * Returns a Promise for a string arn indicating the role was disabled for machine identity - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.roleArn - The Amazon Resource Name (ARN) associated with the role - * @returns {Promise} - * @example - * alks.deleteRoleMachineIdentity({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * roleARN: 'arn:aws:iam::123:role/acct-managed/awsRoleName' - * }).then((roleARN) => { - * // arn:aws:iam::123:role/acct-managed/awsRoleName - * }) - */ - Alks.prototype.deleteRoleMachineIdentity = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('roleMachineIdentity', props, 'DELETE')]; - case 1: - results = _a.sent(); - return [2 /*return*/, pick(results, ['machineIdentityArn'])]; - } - }); - }); - }; - /** - * Returns a Promise for a list of users who have access to the given account - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.accountId - The accountId used to find which users have access to the account - * @returns {Promise} - * @example - * alks.getUserAccess({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * accountId: '012345678910', - * }).then((users) => { - * // users[i].sAMAccountName, users[i].displayName, users[i].email, users[i].title, users[i].department - * }) - */ - Alks.prototype.getUserAccess = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var accountId, results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: - accountId = props.accountId; - return [4 /*yield*/, this.internalFetch("userAccess/" + accountId, props, 'GET')]; - case 1: - results = _a.sent(); - return [2 /*return*/, results.users]; - } - }); - }); - }; - /** - * Returns a Promise for a map of role names to the list of users with that role for a given account - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.accountId - The accountId used to find which users have access to the account - * @returns {Promise} - * @example - * alks.getUserAccess({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * accountId: '012345678910', - * }).then((users) => { - * // users['Admin'].sAMAccountName, users['Admin'].displayName, users['Admin'].email, users['Admin'].title, users['Admin'].department - * }) - */ - Alks.prototype.getUserAccessByRole = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var accountId, results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: - accountId = props.accountId; - return [4 /*yield*/, this.internalFetch("reports/users-by-role?accountId=" + accountId, props, 'GET')]; - case 1: - results = _a.sent(); - return [2 /*return*/, results.users]; - } - }); - }); - }; - /** - * Returns a Promise for a list of roles a user has for a given account - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.accountId - The accountId used to find which users have access to the account - * @param {string} props.sAMAccountName - The network id of the user to lookup - * @returns {Promise} - * @example - * alks.getUserRoleAccess({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * accountId: '012345678910', - * sAMAccountName: 'bob1', - * }).then((roles) => { - * // ['Admin', 'LabAdmin', ...] - * }) - */ - Alks.prototype.getUserRoleAccess = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var accountId, results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: - accountId = props.accountId; - return [4 /*yield*/, this.internalFetch("userAccess/roles/" + accountId, props)]; - case 1: - results = _a.sent(); - return [2 /*return*/, results.roles]; - } - }); - }); - }; - /** - * Returns a Promise containing a list of the account owners for an account - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.accountId - The accountId used to find which users have access to the account - * @returns {Promise} - * @example - * alks.getAccountOwners({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * accountId: '012345678910', - * }).then((owners) => { - * // owners[0].sAMAccountName, owners[0].displayName, owners[0].email, owners[0].title, owners[0].department - * }) - */ - Alks.prototype.getAccountOwners = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var accountId, results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: - accountId = props.accountId; - return [4 /*yield*/, this.internalFetch("userAccess/owners/" + accountId, props, 'GET')]; - case 1: - results = _a.sent(); - return [2 /*return*/, results.accountOwners]; - } - }); - }); - }; - /** - * Returns a Promise for the results of creating new IAM user and long-term access keys - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.account - The user's account associated with the custom role - * @param {string} props.role - The user's role associated with the account - * @param {string} props.iamUserName - The name of the IAM user to create - * @returns {Promise} - * @example - * alks.createAccessKeys({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * role: 'IAMAdmin', - * iamUserName: 'iamUserName' - * }).then((user) => { - * // user.iamUserArn, user.accessKey, user.secretKey, user.addedIAMUserToGroup - * }) - * @example - * alks.createAccessKeys({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * role: 'IAMAdmin', - * iamUserName: 'iamUserName' - * tags: [ - * { - * key: "tagkey1", - * value: "tagValue1" - * }, - * { - * key: "tagkey1", - * value: "tagvalue2" - * } - * ], - * }).then((user) => { - * // user.iamUserArn, user.accessKey, user.secretKey, user.addedIAMUserToGroup - * }) - */ - Alks.prototype.createAccessKeys = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('accessKeys', props)]; - case 1: - results = _a.sent(); - return [2 /*return*/, pick(results, [ - 'iamUserArn', - 'accessKey', - 'secretKey', - 'addedIAMUserToGroup', - 'tags', - ])]; - } - }); - }); - }; - /** - * Returns a Promise for an IamUser - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.account - The user's account associated with the custom role - * @param {string} props.iamUserName - The name of the custom AWS IAM user - * @returns {Promise} - * @example - * alks.getIamUser({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * iamUserName: 'iamUserName' - * }).then((role) => { - * user.iamUserArn, user.AccountId, user.userName, user.accessKey, user.tags - * }) - */ - Alks.prototype.getIamUser = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch("iam-users/id/" + props.account + "/" + props.iamUserName, props, 'GET')]; - case 1: - results = _a.sent(); - return [2 /*return*/, pick(results.item, [ - 'arn', - 'accountId', - 'userName', - 'accessKey', - 'tags', - ])]; - } - }); - }); - }; - /** - * Returns a Promise for the results of updating an IAM user - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.account - The user's account associated with the custom role - * @param {string} props.iamUserName - The name of the IAM user to update - * @param {Array.} props.tags - A list of tag objects, where each object is in the form {key: "tagKey" value: "tagValue"} - * @returns {Promise} - * @example - * alks.updateIamUser({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * iamUserName: 'iamUserName', - * }).then((user) => { - * // user.iamUserArn, user.AccountId, user.userName, user.accessKey, user.tags - * }) - * @example - * alks.updateIamUser({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * iamUserName: 'iamUserName' - * tags: [ - * { - * key: "tagkey1", - * value: "tagValue1" - * }, - * { - * key: "tagkey1", - * value: "tagvalue2" - * } - * ], - * }).then((user) => { - * // user.iamUserArn, user.AccountId, user.userName, user.accessKey, user.tags - * }) - */ - Alks.prototype.updateIamUser = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var internalFetchProps, results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: - internalFetchProps = tslib_1.__assign(tslib_1.__assign({}, props), { user: { - tags: props.tags, - } }); - delete internalFetchProps.tags; - return [4 /*yield*/, this.internalFetch("iam-users/id/" + props.account + "/" + props.iamUserName, internalFetchProps, 'PATCH')]; - case 1: - results = _a.sent(); - return [2 /*return*/, pick(results.item, [ - 'arn', - 'accountId', - 'userName', - 'accessKey', - 'tags', - ])]; - } - }); - }); - }; - /** - * Returns a Promise for a boolean "true" indicating the IAM user and long-term access keys were deleted - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.account - The user's account associated with the custom role - * @param {string} props.role - The user's role associated with the account - * @param {string} props.iamUserName - The name of the IAM user to delete - * @returns {Promise} - * @example - * alks.deleteIAMUser({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * role: 'IAMAdmin', - * iamUserName: 'iamUserName' - * }).then(() => { - * // success! - * }) - */ - Alks.prototype.deleteIAMUser = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('IAMUser', props, 'DELETE')]; - case 1: - _a.sent(); - return [2 /*return*/, true]; - } - }); - }); - }; - /** - * Returns the version of the ALKS Rest API - * - * @param {Object} props - An object containing the following properties - * @returns {Promise} - * @example - * alks.version({ - * ... - * }).then((data) => { - * // data.version - * }) - */ - Alks.prototype.version = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('version', props, 'GET')]; - case 1: - results = _a.sent(); - return [2 /*return*/, pick(results, ['version'])]; - } - }); - }); - }; - /** - * Returns information about one of the roles used to generate keys - * - * @param {Object} props - An object containing the following properties - * @param {string} props.accountId - The 12-digit account ID associated with the custom role - * @param {string} props.role - The user's role associated with the account - * @returns {Promise} - * @example - * alks.getLoginRole({ - * ... - * }).then((loginRole) => { - * // loginRole.account, loginRole.role, loginRole.iamKeyActive, loginRole.maxKeyDuration - * }) - */ - Alks.prototype.getLoginRole = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var accountId, role, results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: - accountId = props.accountId, role = props.role; - return [4 /*yield*/, this.internalFetch("loginRoles/id/" + accountId + "/" + role, props, 'GET')]; - case 1: - results = (_a.sent()); - // TODO we should probably update this function to include skypieaAccount in the result since it's already being fetched - Ben W 5/10/21 - return [2 /*return*/, pick(results.loginRole, [ - 'account', - 'role', - 'iamKeyActive', - 'maxKeyDuration', - 'securityLevel', - ])]; - } - }); - }); - }; - /** - * Exchanges a refresh token for an access token - * - * @param {Object} props - An object containing the following properties - * @param {string} props.refreshToken - the refresh token to exchange - * @returns {Promise} - * @example - * alks.getAccessToken({ - * ... - * }).then((data) => { - * // data.accessToken, data.expiresIn - * }) - */ - Alks.prototype.getAccessToken = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('accessToken', props)]; - case 1: - results = _a.sent(); - return [2 /*return*/, pick(results, ['accessToken', 'expiresIn'])]; - } - }); - }); - }; - /** - * Returns a list of a user's refresh tokens (Does not return the full token) - * - * @param {Object} props - An object containing the following properties - * @returns {Array} - * @example - * alks.getRefreshTokens({ - * ... - * }).then((tokens) => { - * // token[i].clientId, token[i].id, token[i].userId, token[i].value - * }) - */ - Alks.prototype.getRefreshTokens = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('refreshTokens', props, 'GET')]; - case 1: - results = (_a.sent()); - return [2 /*return*/, results.refreshTokens.map(function (token) { - return pick(token, ['clientId', 'id', 'userId', 'value']); - })]; - } - }); - }); - }; - /** - * Revokes a refresh or access token - * - * @param {Object} props - An object containing the following properties - * @param {string} [props.token] - the access or refresh token to revoke (Required if tokenId not specified) - * @param {string} [props.tokenId] - the ID of the refresh token to revoke (Required if token not specified) - * @returns {boolean} - * @example - * alks.revoke({ - * token: '...', - * ... - * }).then((success) => { - * // success == true - * }) - * - * // or - * - * alks.revoke({ - * tokenId: '...', - * ... - * }).then((success) => { - * // success == true - * }) - */ - Alks.prototype.revoke = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('revoke', props)]; - case 1: - results = _a.sent(); - return [2 /*return*/, results.statusMessage == 'Success']; - } - }); - }); - }; - /** - * Returns cost totals for the specified account for the day, week, month, year, and a breakdown of costs by service for the day and month - * - * @param {Object} props - An object containing the following properties - * @param {String} props.accountId - the 12-digit AWS account ID to get cost data for - * @returns {Object} - * @example - * alks.getCostTotals({ - * accountId: '012345678910', - * }).then((costTotals) => { - * // costTotals.awsAccountId, costTotals.daily, costTotals.weekly, etc. - * }) - */ - Alks.prototype.getCostTotals = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch("costTotals/" + props.accountId, props, 'GET')]; - case 1: - results = (_a.sent()); - return [2 /*return*/, pick(results.costTotals, [ - 'awsAccountId', - 'yyyy', - 'mm', - 'dd', - 'daily', - 'weekly', - 'monthly', - 'yearly', - 'dailyCostsByService', - 'monthlyCostsByService', - ])]; - } - }); - }); - }; - Alks.prototype.internalFetch = function (path, args, method) { - if (args === void 0) { args = {}; } - if (method === void 0) { method = 'POST'; } - return tslib_1.__awaiter(this, void 0, void 0, function () { - var opts, payload, headers, credentials, response, json, err_1; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: - opts = tslib_1.__assign(tslib_1.__assign({}, this.config), args); - payload = tslib_1.__assign({}, opts); - headers = { - 'Content-Type': 'application/json', - 'User-Agent': "AlksJS/" + packageJson.version, - }; - if (isTokenAuth(opts)) { - headers['Authorization'] = "Bearer " + opts.accessToken; - delete payload.accessToken; - } - else if (isStsAuth(opts)) { - headers['ALKS-STS-Access-Key'] = opts.accessKey; - headers['ALKS-STS-Secret-Key'] = opts.secretKey; - headers['ALKS-STS-Session-Token'] = opts.sessionToken; - delete payload.accessKey; - delete payload.secretKey; - delete payload.sessionToken; - } - else if (isPasswordAuth(opts)) { - console.error('The userid and password properties are deprecated and should be replaced with an access token'); - credentials = base64Encode(opts.userid + ":" + opts.password); - headers['Authorization'] = "Basic " + credentials; - delete payload.userid; - delete payload.password; - } - else ; - if (opts.userAgent) { - headers['User-Agent'] += " " + opts.userAgent; - delete payload.userAgent; - } - return [4 /*yield*/, opts._fetch(opts.baseUrl + "/" + path, { - method: method, - headers: headers, - credentials: 'omit', - body: method == 'GET' ? undefined : JSON.stringify(payload), - })]; - case 1: - response = _a.sent(); - _a.label = 2; - case 2: - _a.trys.push([2, 4, , 5]); - return [4 /*yield*/, response.json()]; - case 3: - json = _a.sent(); - return [3 /*break*/, 5]; - case 4: - err_1 = _a.sent(); - json = { - errors: [err_1.message], - }; - return [3 /*break*/, 5]; - case 5: - if (!response.ok) { - throw new AlksError(response, json); - } - return [2 /*return*/, json]; - } - }); - }); - }; - return Alks; - }()); - ALKS.Alks = Alks; - var AlksError = /** @class */ (function (_super) { - tslib_1.__extends(AlksError, _super); - function AlksError(response, json) { - var _this = this; - var errors = Array.isArray(json === null || json === void 0 ? void 0 : json.errors) ? json.errors : []; - if (response.statusText) { - errors.unshift(response.statusText); - } - var message = errors.join('; '); - _this = _super.call(this, message) || this; - _this.status = response.status; - _this.message = message; - Object.assign(_this, json); - return _this; - } - return AlksError; - }(Error)); - ALKS.AlksError = AlksError; - /** - * Encodes a string to base 64 - * - * @param str - the string to encode - * @private - * @returns the base64 encoded string - * @example - * var input = 'password'; - * base64Encode(input); - */ - function base64Encode(str) { - if (str === void 0) { str = ''; } - return buffer_1.Buffer.from(str).toString('base64'); - } - function pick(obj, props) { - return props.reduce(function (acc, prop) { return ((acc[prop] = obj[prop]), acc); }, {}); - } - var defaultConfig = { - _fetch: fetch, - }; - var defaultAlks = Alks.prototype.create.call({}, defaultConfig); - ALKS.create = Alks.prototype.create.bind(defaultAlks); - ALKS.getAccounts = Alks.prototype.getAccounts.bind(defaultAlks); - ALKS.getKeys = Alks.prototype.getKeys.bind(defaultAlks); - ALKS.getIAMKeys = Alks.prototype.getIAMKeys.bind(defaultAlks); - ALKS.getAllAWSRoleTypes = Alks.prototype.getAllAWSRoleTypes.bind(defaultAlks); - ALKS.getAWSRoleTypes = Alks.prototype.getAWSRoleTypes.bind(defaultAlks); - ALKS.getNonServiceAWSRoleTypes = Alks.prototype.getNonServiceAWSRoleTypes.bind(defaultAlks); - ALKS.createRole = Alks.prototype.createRole.bind(defaultAlks); - ALKS.createNonServiceRole = Alks.prototype.createNonServiceRole.bind(defaultAlks); - ALKS.awsAccountRoles = Alks.prototype.awsAccountRoles.bind(defaultAlks); - ALKS.listAWSAccountRoles = Alks.prototype.listAWSAccountRoles.bind(defaultAlks); - ALKS.getAccountRole = Alks.prototype.getAccountRole.bind(defaultAlks); - ALKS.updateRole = Alks.prototype.updateRole.bind(defaultAlks); - ALKS.deleteRole = Alks.prototype.deleteRole.bind(defaultAlks); - ALKS.addRoleMachineIdentity = Alks.prototype.addRoleMachineIdentity.bind(defaultAlks); - ALKS.deleteRoleMachineIdentity = Alks.prototype.deleteRoleMachineIdentity.bind(defaultAlks); - ALKS.getUserAccess = Alks.prototype.getUserAccess.bind(defaultAlks); - ALKS.getUserAccessByRole = Alks.prototype.getUserAccessByRole.bind(defaultAlks); - ALKS.getUserRoleAccess = Alks.prototype.getUserRoleAccess.bind(defaultAlks); - ALKS.getAccountOwners = Alks.prototype.getAccountOwners.bind(defaultAlks); - ALKS.createAccessKeys = Alks.prototype.createAccessKeys.bind(defaultAlks); - ALKS.getIamUser = Alks.prototype.getIamUser.bind(defaultAlks); - ALKS.updateIamUser = Alks.prototype.updateIamUser.bind(defaultAlks); - ALKS.deleteIAMUser = Alks.prototype.deleteIAMUser.bind(defaultAlks); - ALKS.version = Alks.prototype.version.bind(defaultAlks); - ALKS.getLoginRole = Alks.prototype.getLoginRole.bind(defaultAlks); - ALKS.getAccessToken = Alks.prototype.getAccessToken.bind(defaultAlks); - ALKS.getRefreshTokens = Alks.prototype.getRefreshTokens.bind(defaultAlks); - ALKS.revoke = Alks.prototype.revoke.bind(defaultAlks); - ALKS.getCostTotals = Alks.prototype.getCostTotals.bind(defaultAlks); - })(ALKS || (ALKS = {})); + var tslib_1 = require$$0$1; + var packageJson = tslib_1.__importStar(require$$1$1); + var buffer_1 = require$$2; + tslib_1.__importDefault(require$$3); + var fetch = window.fetch.bind(window) + ; + var ALKS; + (function (ALKS) { + function isStsAuth(a) { + return a.accessKey !== undefined; + } + function isPasswordAuth(a) { + return a.userid !== undefined; + } + function isTokenAuth(a) { + return a.accessToken !== undefined; + } + (function (TrustType) { + TrustType["CrossAccount"] = "Cross Account"; + TrustType["InnerAccount"] = "Inner Account"; + })(ALKS.TrustType || (ALKS.TrustType = {})); + (function (PseudoBoolean) { + PseudoBoolean[PseudoBoolean["True"] = 1] = "True"; + PseudoBoolean[PseudoBoolean["False"] = 0] = "False"; + })(ALKS.PseudoBoolean || (ALKS.PseudoBoolean = {})); + /** + * ALKS JavaScript API + */ + var Alks = /** @class */ (function () { + function Alks(config) { + this.config = config; + } + /** + * Returns a new instance of alks with pre-defined properties (which don't need to be supplied to every method). + * + * Any of the properties required by other methods can be specified here. + * + * Properties present on the current object are carried through to the newly created one. + * + * @param {Object} props - An object containing settings for the new ALKS object + * @returns {alks} + * @example + * var myAlks = alks.create({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * }) + * + * myAlks.getKeys({ + * account: 'anAccount', + * role: 'PowerUser', + * sessionTime: 2 + * }).then((creds) => { + * // creds.accessKey, creds.secretKey, creds.sessionToken + * }) + */ + Alks.prototype.create = function (props) { + var config = tslib_1.__assign(tslib_1.__assign({}, this.config), props); + return new Alks(config); + }; + /** + * Returns a Promise for an array of AWS accounts (and roles) accessible by the user + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @returns {Promise} + * @example + * alks.getAccounts({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * }).then((accounts) => { + * // accounts[0].account, accounts[0].role, accounts[0].iamKeyActive, accounts[0].maxKeyDuration, accounts[0].skypieaAccount + * }) + */ + Alks.prototype.getAccounts = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('getAccounts', props)]; + case 1: + results = _a.sent(); + return [2 /*return*/, Object.keys(results.accountListRole).map(function (key) { return ({ + account: key, + role: results.accountListRole[key][0].role, + iamKeyActive: results.accountListRole[key][0].iamKeyActive, + maxKeyDuration: results.accountListRole[key][0].maxKeyDuration, + securityLevel: results.accountListRole[key][0].securityLevel, + skypieaAccount: results.accountListRole[key][0].skypieaAccount, + }); })]; + } + }); + }); + }; + /** + * Returns a Promise for AWS STS credentials from ALKS. + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.account - The AWS account to use when provisioning the credentials + * @param {string} props.role - The ALKS role to use when provisioning the credentials + * @param {string} props.sessionTime - The session length for the credentials + * @returns {Promise} + * @example + * alks.getKeys({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * role: 'PowerUser', + * sessionTime: 2 + * }).then((creds) => { + * // creds.accessKey, creds.secretKey, creds.sessionToken, creds.consoleURL + * }) + */ + Alks.prototype.getKeys = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('getKeys', props)]; + case 1: + results = _a.sent(); + return [2 /*return*/, pick(results, [ + 'accessKey', + 'secretKey', + 'sessionToken', + 'consoleURL', + ])]; + } + }); + }); + }; + /** + * Returns a Promise for AWS STS credentials with IAM permissions from ALKS. + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.account - The AWS account to use when provisioning the credentials + * @param {string} props.role - The ALKS role to use when provisioning the credentials + * @param {number} props.sessionTime - The session length for the credentials + * @returns {Promise} + * @example + * alks.getIAMKeys({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * role: 'IAMAdmin', + * sessionTime: 1 + * }).then((creds) => { + * // creds.accessKey, creds.secretKey, creds.sessionToken, creds.consoleURL + * }) + */ + Alks.prototype.getIAMKeys = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('getIAMKeys', props)]; + case 1: + results = _a.sent(); + return [2 /*return*/, pick(results, [ + 'accessKey', + 'secretKey', + 'sessionToken', + 'consoleURL', + ])]; + } + }); + }); + }; + /** + * Returns a Promise for an array of all available role types (AWS IAM role types, custom role types) and their details + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {boolean} [props.getDynamicValues] - Whether to include the names of any template variables in the response (defaults to false) + * @returns {Promise>} + * @example + * alks.getAllAWSRoleTypes({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * }).then((roleTypes) { + * // roleTypes[i].roleTypeName, roleTypes[i].defaultArns, roleTypes[i].trustRelationship + * }) + * + * @example + * alks.getAllAWSRoleTypes({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * getDynamicValues: true, + * }).then((roleTypes) { + * // roleTypes[i].roleTypeName, roleTypes[i].defaultArns, roleTypes[i].trustRelationship, roleTypes[i].templateVariables[i] + * }) + */ + Alks.prototype.getAllAWSRoleTypes = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var url, results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: + url = props.getDynamicValues + ? 'allAwsRoleTypes?getDynamicValues=true' + : 'allAwsRoleTypes'; + return [4 /*yield*/, this.internalFetch(url, props, 'GET')]; + case 1: + results = _a.sent(); + return [2 /*return*/, results.roleTypes]; + } + }); + }); + }; + /** + * Returns a Promise for an array of available AWS IAM role types + * + * @deprecated Replaced by getAllAWSRoleTypes which includes all AWS role types and their details + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @returns {Promise>} + * @example + * alks.getAWSRoleTypes({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * }).then((roleTypes) { + * // ['AWS Lambda', 'Amazon EC2', ... ] + * }) + */ + Alks.prototype.getAWSRoleTypes = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('getAWSRoleTypes', props)]; + case 1: + results = _a.sent(); + return [2 /*return*/, JSON.parse(results.roleTypes)]; + } + }); + }); + }; + /** + * Returns a Promise for an array of available custom role types + * + * @deprecated Replaced by getAllAWSRoleTypes which includes all AWS role types and their details + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @returns {Promise>} + * @example + * alks.getNonServiceAWSRoleTypes({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * }).then((roleTypes) => { + * // ['AWS Lambda', 'Amazon EC2', ...] + * }) + */ + Alks.prototype.getNonServiceAWSRoleTypes = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('getNonServiceAWSRoleTypes', props)]; + case 1: + results = _a.sent(); + return [2 /*return*/, JSON.parse(results.roleTypes)]; + } + }); + }); + }; + /** + * Returns a Promise for the results of creating a new custom AWS IAM account role + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.account - The user's account associated with the custom role + * @param {string} props.role - The user's role associated with the account + * @param {string} props.roleName - The name of the custom AWS IAM role to create + * @param {string} props.roleType - The type of AWS role to use when creating the new role + * @param {Object} props.trustPolicy + * @param {number} props.includeDefaultPolicy - Whether to include the default policy in the new role (1 = yes, 0 = no) + * @param {boolean} props.enableAlksAccess - Whether the role has a machine identity + * @param {Object} props.templateFields - An object whose keys are template variable names and values are the value to substitute for those template variables + * @param {Array.} props.tags - A list of tag objects, where each object is in the form {key: "tagKey" value: "tagValue"} + * @returns {Promise} + * @example + * alks.createRole({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * role: 'IAMAdmin', + * roleName: 'awsRoleName', + * roleType: 'Amazon EC2', + * includeDefaultPolicy: 1, + * enableAlksAccess: true + * }).then((role) => { + * // role.roleArn, role.denyArns, role.instanceProfileArn, role.addedRoleToInstanceProfile, role.tags + * }) + * @example + * alks.createRole({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * role: 'IAMAdmin', + * roleName: 'awsRoleName', + * trustPolicy: { + * "Version": "2012-10-17", + * "Statement": [ + * { + * "Action": "sts:AssumeRole", + * "Effect": "Allow", + * "Principal": { + * "Service": "ec2.amazonaws.com" + * } + * } + * ] + * }, + * includeDefaultPolicy: 1, + * enableAlksAccess: true + * }).then((role) => { + * // role.roleArn, role.denyArns, role.instanceProfileArn, role.addedRoleToInstanceProfile, role.tags + * }) + * @example + * alks.createRole({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * role: 'IAMAdmin', + * roleName: 'awsRoleName', + * roleType: 'Amazon EKS IRSA', + * includeDefaultPolicy: 1, + * enableAlksAccess: false, + * templateFields: { + * OIDC_PROVIDER: 'oidc.eks.us-east-1.amazonaws.com/id/88G998884RBAD6687HBE3GETY67FQE04', + * K8S_NAMESPACE: 'myNamespace', + * K8S_SERVICE_ACCOUNT: 'myServiceAccount' + * } + * tags: [ + * { + * key: "tagkey1", + * value: "tagValue1" + * }, + * { + * key: "tagkey1", + * value: "tagvalue2" + * } + * ], + * }).then((role) => { + * // role.roleArn, role.denyArns, role.instanceProfileArn, role.addedRoleToInstanceProfile, role.tags + * }) + */ + Alks.prototype.createRole = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var roleTypeExists, trustPolicyExists, results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: + roleTypeExists = props.roleType != null; + trustPolicyExists = props.trustPolicy != null; + if (!(roleTypeExists !== trustPolicyExists)) return [3 /*break*/, 2]; + return [4 /*yield*/, this.internalFetch('createRole', props)]; + case 1: + results = _a.sent(); + results.denyArns = results.denyArns.split(','); + return [2 /*return*/, pick(results, [ + 'roleArn', + 'denyArns', + 'instanceProfileArn', + 'addedRoleToInstanceProfile', + 'tags', + ])]; + case 2: throw new Error("Must include roleType or trustPolicy, but not both."); + } + }); + }); + }; + /** + * Returns a Promise for the results of creating a new custom AWS IAM trust role + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.account - The user's account associated with the custom role + * @param {string} props.role - The user's role associated with the account + * @param {string} props.roleName - The name of the custom AWS IAM role to create + * @param {string} props.roleType - The type of AWS role to use when creating the new role + * @param {number} props.includeDefaultPolicy - Whether to include the default policy in the new role (1 = yes, 0 = no) + * @param {string} props.trustArn - The Arn of the existing role to trust + * @param {string} props.trustType - Whether the trust is 'Cross Account' or 'Inner Account' + * @param {boolean} props.enableAlksAccess - Whether the role has a machine identity + * @param {Array.} props.tags - A list of tag objects, where each object is in the form {key: "tagKey" value: "tagValue"} + * @returns {Promise} + * @example + * alks.createNonServiceRole({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * role: 'IAMAdmin', + * roleName: 'awsRoleName', + * roleType: 'Amazon EC2', + * includeDefaultPolicy: 1, + * trustArn: 'anExistingRoleArn', + * trustType: 'Cross Account', + * enableAlksAccess: true + * }).then((role) => { + * // role.roleArn, role.denyArns, role.instanceProfileArn, role.addedRoleToInstanceProfile, role.tags + * }) + * @@example + * * alks.createNonServiceRole({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * role: 'IAMAdmin', + * roleName: 'awsRoleName', + * roleType: 'Amazon EC2', + * includeDefaultPolicy: 1, + * trustArn: 'anExistingRoleArn', + * trustType: 'Cross Account', + * enableAlksAccess: true, + * tags: [ + * { + * key: "tagkey1", + * value: "tagValue1" + * }, + * { + * key: "tagkey1", + * value: "tagvalue2" + * } + * ], + * }).then((role) => { + * // role.roleArn, role.denyArns, role.instanceProfileArn, role.addedRoleToInstanceProfile, role.tags + * }) + */ + Alks.prototype.createNonServiceRole = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('createNonServiceRole', props)]; + case 1: + results = _a.sent(); + results.denyArns = results.denyArns.split(','); + return [2 /*return*/, pick(results, [ + 'roleArn', + 'denyArns', + 'instanceProfileArn', + 'addedRoleToInstanceProfile', + 'tags', + ])]; + } + }); + }); + }; + /** + * Returns a Promise for an array of AWS account roles + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.account - The account number to get AWS roles for + * @returns {Promise} + * @example + * alks.awsAccountRoles({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: '1234567890', + * }).then((roles) => { + * // roles[i].roleArn, roles[i].isMachineIdentity, roles[i].assumeRolePolicyDocument + * }) + */ + Alks.prototype.awsAccountRoles = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch("awsAccountRoles?account=" + props.account, props, 'GET')]; + case 1: + results = _a.sent(); + return [2 /*return*/, results.awsRoleList]; + } + }); + }); + }; + /** + * Returns a Promise for an array of AWS custom AWS IAM account roles + * + * @deprecated Replaced by awsAccountRoles which includes AWS account roles and their details + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.account - The user's account associated with the custom role + * @param {string} props.role - The user's role associated with the account + * @returns {Promise} + * @example + * alks.listAWSAccountRoles({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * role: 'IAMAdmin', + * }).then((roleNames) => { + * // ['customRole1', 'customRole2', ...] + * }) + */ + Alks.prototype.listAWSAccountRoles = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('listAWSAccountRoles', props)]; + case 1: + results = _a.sent(); + return [2 /*return*/, JSON.parse(results.jsonAWSRoleList).map(function (r) { return r.split('/').slice(-1)[0]; })]; + } + }); + }); + }; + /** + * Returns a Promise for the Amazon Resource Name (ARN) of a custom AWS IAM account role + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.account - The user's account associated with the custom role + * @param {string} props.role - The user's role associated with the account + * @param {string} props.roleName - The name of the custom AWS IAM role + * @param {Array.} props.tags - A list of tag objects, where each object is in the form {key: "tagKey" value: "tagValue"} + * @returns {Promise} + * @example + * alks.getAccountRole({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * role: 'IAMAdmin', + * roleName: 'awsRoleName' + * }).then((role) => { + * // role.roleArn, role.isMachineIdentity, role.instanceProfileArn, role.tags, role.maxSessionDurationInSeconds + * }) + */ + Alks.prototype.getAccountRole = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('getAccountRole', props)]; + case 1: + results = _a.sent(); + if (!results.roleExists) { + throw new Error("Role " + props.roleName + " does not exist in this account"); + } + return [2 /*return*/, tslib_1.__assign(tslib_1.__assign({}, pick(results, [ + 'roleArn', + 'isMachineIdentity', + 'tags', + 'maxSessionDurationInSeconds', + ])), { instanceProfileArn: results.instanceProfileARN })]; + } + }); + }); + }; + /** + * Returns a Promise for the Amazon Resource Name (ARN) of a custom AWS IAM account role + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.account - The user's account associated with the custom role + * @param {string} props.role - The user's role associated with the account + * @param {string} props.roleName - The name of the custom AWS IAM role + * @param {Array.} props.tags - A list of tag objects, where each object is in the form {key: "tagKey" value: "tagValue"} + * @returns {Promise} + * @example + * alks.updateRole({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * role: 'IAMAdmin', + * roleName: 'awsRoleName' + * }).then((role) => { + * // role.roleArn, role.isMachineIdentity, role.instanceProfileArn, role.tags + * }) + */ + Alks.prototype.updateRole = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('role', props, 'PATCH')]; + case 1: + results = _a.sent(); + if (!results.roleExists) { + throw new Error("Role " + props.roleName + " does not exist in this account"); + } + return [2 /*return*/, tslib_1.__assign(tslib_1.__assign({}, pick(results, ['roleArn', 'isMachineIdentity', 'tags'])), { instanceProfileArn: results.instanceProfileARN })]; + } + }); + }); + }; + /** + * Returns a Promise for a boolean "true" indicating the role was deleted + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.account - The user's account associated with the custom role + * @param {string} props.role - The user's role associated with the account + * @param {string} props.roleName - The name of the custom AWS IAM role + * @returns {Promise} + * @example + * alks.deleteRole({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * role: 'IAMAdmin', + * roleName: 'awsRoleName' + * }).then(() => { + * // success! + * }) + */ + Alks.prototype.deleteRole = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('deleteRole', props)]; + case 1: + _a.sent(); + return [2 /*return*/, true]; + } + }); + }); + }; + /** + * Returns a Promise for a string arn indicating the role was enabled for machine identity + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.roleArn - The Amazon Resource Name (ARN) associated with the role + * @returns {Promise} + * @example + * alks.addRoleMachineIdentity({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * roleARN: 'arn:aws:iam::123:role/acct-managed/awsRoleName' + * }).then((roleARN) => { + * // arn:aws:iam::123:role/acct-managed/awsRoleName + * }) + */ + Alks.prototype.addRoleMachineIdentity = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('roleMachineIdentity', props)]; + case 1: + results = _a.sent(); + return [2 /*return*/, pick(results, ['machineIdentityArn'])]; + } + }); + }); + }; + /** + * Returns a Promise for a string arn indicating the role was disabled for machine identity + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.roleArn - The Amazon Resource Name (ARN) associated with the role + * @returns {Promise} + * @example + * alks.deleteRoleMachineIdentity({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * roleARN: 'arn:aws:iam::123:role/acct-managed/awsRoleName' + * }).then((roleARN) => { + * // arn:aws:iam::123:role/acct-managed/awsRoleName + * }) + */ + Alks.prototype.deleteRoleMachineIdentity = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('roleMachineIdentity', props, 'DELETE')]; + case 1: + results = _a.sent(); + return [2 /*return*/, pick(results, ['machineIdentityArn'])]; + } + }); + }); + }; + /** + * Returns a Promise for a list of users who have access to the given account + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.accountId - The accountId used to find which users have access to the account + * @returns {Promise} + * @example + * alks.getUserAccess({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * accountId: '012345678910', + * }).then((users) => { + * // users[i].sAMAccountName, users[i].displayName, users[i].email, users[i].title, users[i].department + * }) + */ + Alks.prototype.getUserAccess = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var accountId, results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: + accountId = props.accountId; + return [4 /*yield*/, this.internalFetch("userAccess/" + accountId, props, 'GET')]; + case 1: + results = _a.sent(); + return [2 /*return*/, results.users]; + } + }); + }); + }; + /** + * Returns a Promise for a map of role names to the list of users with that role for a given account + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.accountId - The accountId used to find which users have access to the account + * @returns {Promise} + * @example + * alks.getUserAccess({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * accountId: '012345678910', + * }).then((users) => { + * // users['Admin'].sAMAccountName, users['Admin'].displayName, users['Admin'].email, users['Admin'].title, users['Admin'].department + * }) + */ + Alks.prototype.getUserAccessByRole = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var accountId, results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: + accountId = props.accountId; + return [4 /*yield*/, this.internalFetch("reports/users-by-role?accountId=" + accountId, props, 'GET')]; + case 1: + results = _a.sent(); + return [2 /*return*/, results.users]; + } + }); + }); + }; + /** + * Returns a Promise for a list of roles a user has for a given account + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.accountId - The accountId used to find which users have access to the account + * @param {string} props.sAMAccountName - The network id of the user to lookup + * @returns {Promise} + * @example + * alks.getUserRoleAccess({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * accountId: '012345678910', + * sAMAccountName: 'bob1', + * }).then((roles) => { + * // ['Admin', 'LabAdmin', ...] + * }) + */ + Alks.prototype.getUserRoleAccess = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var accountId, results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: + accountId = props.accountId; + return [4 /*yield*/, this.internalFetch("userAccess/roles/" + accountId, props)]; + case 1: + results = _a.sent(); + return [2 /*return*/, results.roles]; + } + }); + }); + }; + /** + * Returns a Promise containing a list of the account owners for an account + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.accountId - The accountId used to find which users have access to the account + * @returns {Promise} + * @example + * alks.getAccountOwners({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * accountId: '012345678910', + * }).then((owners) => { + * // owners[0].sAMAccountName, owners[0].displayName, owners[0].email, owners[0].title, owners[0].department + * }) + */ + Alks.prototype.getAccountOwners = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var accountId, results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: + accountId = props.accountId; + return [4 /*yield*/, this.internalFetch("userAccess/owners/" + accountId, props, 'GET')]; + case 1: + results = _a.sent(); + return [2 /*return*/, results.accountOwners]; + } + }); + }); + }; + /** + * Returns a Promise for the results of creating new IAM user and long-term access keys + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.account - The user's account associated with the custom role + * @param {string} props.role - The user's role associated with the account + * @param {string} props.iamUserName - The name of the IAM user to create + * @returns {Promise} + * @example + * alks.createAccessKeys({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * role: 'IAMAdmin', + * iamUserName: 'iamUserName' + * }).then((user) => { + * // user.iamUserArn, user.accessKey, user.secretKey, user.addedIAMUserToGroup + * }) + * @example + * alks.createAccessKeys({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * role: 'IAMAdmin', + * iamUserName: 'iamUserName' + * tags: [ + * { + * key: "tagkey1", + * value: "tagValue1" + * }, + * { + * key: "tagkey1", + * value: "tagvalue2" + * } + * ], + * }).then((user) => { + * // user.iamUserArn, user.accessKey, user.secretKey, user.addedIAMUserToGroup + * }) + */ + Alks.prototype.createAccessKeys = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('accessKeys', props)]; + case 1: + results = _a.sent(); + return [2 /*return*/, pick(results, [ + 'iamUserArn', + 'accessKey', + 'secretKey', + 'addedIAMUserToGroup', + 'tags', + ])]; + } + }); + }); + }; + /** + * Returns a Promise for an IamUser + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.account - The user's account associated with the custom role + * @param {string} props.iamUserName - The name of the custom AWS IAM user + * @returns {Promise} + * @example + * alks.getIamUser({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * iamUserName: 'iamUserName' + * }).then((role) => { + * user.iamUserArn, user.AccountId, user.userName, user.accessKey, user.tags + * }) + */ + Alks.prototype.getIamUser = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch("iam-users/id/" + props.account + "/" + props.iamUserName, props, 'GET')]; + case 1: + results = _a.sent(); + return [2 /*return*/, pick(results.item, [ + 'arn', + 'accountId', + 'userName', + 'accessKey', + 'tags', + ])]; + } + }); + }); + }; + /** + * Returns a Promise for the results of updating an IAM user + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.account - The user's account associated with the custom role + * @param {string} props.iamUserName - The name of the IAM user to update + * @param {Array.} props.tags - A list of tag objects, where each object is in the form {key: "tagKey" value: "tagValue"} + * @returns {Promise} + * @example + * alks.updateIamUser({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * iamUserName: 'iamUserName', + * }).then((user) => { + * // user.iamUserArn, user.AccountId, user.userName, user.accessKey, user.tags + * }) + * @example + * alks.updateIamUser({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * iamUserName: 'iamUserName' + * tags: [ + * { + * key: "tagkey1", + * value: "tagValue1" + * }, + * { + * key: "tagkey1", + * value: "tagvalue2" + * } + * ], + * }).then((user) => { + * // user.iamUserArn, user.AccountId, user.userName, user.accessKey, user.tags + * }) + */ + Alks.prototype.updateIamUser = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var internalFetchProps, results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: + internalFetchProps = tslib_1.__assign(tslib_1.__assign({}, props), { user: { + tags: props.tags, + } }); + delete internalFetchProps.tags; + return [4 /*yield*/, this.internalFetch("iam-users/id/" + props.account + "/" + props.iamUserName, internalFetchProps, 'PATCH')]; + case 1: + results = _a.sent(); + return [2 /*return*/, pick(results.item, [ + 'arn', + 'accountId', + 'userName', + 'accessKey', + 'tags', + ])]; + } + }); + }); + }; + /** + * Returns a Promise for a boolean "true" indicating the IAM user and long-term access keys were deleted + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.account - The user's account associated with the custom role + * @param {string} props.role - The user's role associated with the account + * @param {string} props.iamUserName - The name of the IAM user to delete + * @returns {Promise} + * @example + * alks.deleteIAMUser({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * role: 'IAMAdmin', + * iamUserName: 'iamUserName' + * }).then(() => { + * // success! + * }) + */ + Alks.prototype.deleteIAMUser = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('IAMUser', props, 'DELETE')]; + case 1: + _a.sent(); + return [2 /*return*/, true]; + } + }); + }); + }; + /** + * Returns the version of the ALKS Rest API + * + * @param {Object} props - An object containing the following properties + * @returns {Promise} + * @example + * alks.version({ + * ... + * }).then((data) => { + * // data.version + * }) + */ + Alks.prototype.version = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('version', props, 'GET')]; + case 1: + results = _a.sent(); + return [2 /*return*/, pick(results, ['version'])]; + } + }); + }); + }; + /** + * Returns information about one of the roles used to generate keys + * + * @param {Object} props - An object containing the following properties + * @param {string} props.accountId - The 12-digit account ID associated with the custom role + * @param {string} props.role - The user's role associated with the account + * @returns {Promise} + * @example + * alks.getLoginRole({ + * ... + * }).then((loginRole) => { + * // loginRole.account, loginRole.role, loginRole.iamKeyActive, loginRole.maxKeyDuration + * }) + */ + Alks.prototype.getLoginRole = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var accountId, role, results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: + accountId = props.accountId, role = props.role; + return [4 /*yield*/, this.internalFetch("loginRoles/id/" + accountId + "/" + role, props, 'GET')]; + case 1: + results = (_a.sent()); + // TODO we should probably update this function to include skypieaAccount in the result since it's already being fetched - Ben W 5/10/21 + return [2 /*return*/, pick(results.loginRole, [ + 'account', + 'role', + 'iamKeyActive', + 'maxKeyDuration', + 'securityLevel', + ])]; + } + }); + }); + }; + /** + * Exchanges a refresh token for an access token + * + * @param {Object} props - An object containing the following properties + * @param {string} props.refreshToken - the refresh token to exchange + * @returns {Promise} + * @example + * alks.getAccessToken({ + * ... + * }).then((data) => { + * // data.accessToken, data.expiresIn + * }) + */ + Alks.prototype.getAccessToken = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('accessToken', props)]; + case 1: + results = _a.sent(); + return [2 /*return*/, pick(results, ['accessToken', 'expiresIn'])]; + } + }); + }); + }; + /** + * Returns a list of a user's refresh tokens (Does not return the full token) + * + * @param {Object} props - An object containing the following properties + * @returns {Array} + * @example + * alks.getRefreshTokens({ + * ... + * }).then((tokens) => { + * // token[i].clientId, token[i].id, token[i].userId, token[i].value + * }) + */ + Alks.prototype.getRefreshTokens = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('refreshTokens', props, 'GET')]; + case 1: + results = (_a.sent()); + return [2 /*return*/, results.refreshTokens.map(function (token) { + return pick(token, ['clientId', 'id', 'userId', 'value']); + })]; + } + }); + }); + }; + /** + * Revokes a refresh or access token + * + * @param {Object} props - An object containing the following properties + * @param {string} [props.token] - the access or refresh token to revoke (Required if tokenId not specified) + * @param {string} [props.tokenId] - the ID of the refresh token to revoke (Required if token not specified) + * @returns {boolean} + * @example + * alks.revoke({ + * token: '...', + * ... + * }).then((success) => { + * // success == true + * }) + * + * // or + * + * alks.revoke({ + * tokenId: '...', + * ... + * }).then((success) => { + * // success == true + * }) + */ + Alks.prototype.revoke = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('revoke', props)]; + case 1: + results = _a.sent(); + return [2 /*return*/, results.statusMessage == 'Success']; + } + }); + }); + }; + /** + * Returns cost totals for the specified account for the day, week, month, year, and a breakdown of costs by service for the day and month + * + * @param {Object} props - An object containing the following properties + * @param {String} props.accountId - the 12-digit AWS account ID to get cost data for + * @returns {Object} + * @example + * alks.getCostTotals({ + * accountId: '012345678910', + * }).then((costTotals) => { + * // costTotals.awsAccountId, costTotals.daily, costTotals.weekly, etc. + * }) + */ + Alks.prototype.getCostTotals = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch("costTotals/" + props.accountId, props, 'GET')]; + case 1: + results = (_a.sent()); + return [2 /*return*/, pick(results.costTotals, [ + 'awsAccountId', + 'yyyy', + 'mm', + 'dd', + 'daily', + 'weekly', + 'monthly', + 'yearly', + 'dailyCostsByService', + 'monthlyCostsByService', + ])]; + } + }); + }); + }; + Alks.prototype.internalFetch = function (path, args, method) { + if (args === void 0) { args = {}; } + if (method === void 0) { method = 'POST'; } + return tslib_1.__awaiter(this, void 0, void 0, function () { + var opts, payload, headers, credentials, response, json, err_1; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: + opts = tslib_1.__assign(tslib_1.__assign({}, this.config), args); + payload = tslib_1.__assign({}, opts); + headers = { + 'Content-Type': 'application/json', + 'User-Agent': "AlksJS/" + packageJson.version, + }; + if (isTokenAuth(opts)) { + headers['Authorization'] = "Bearer " + opts.accessToken; + delete payload.accessToken; + } + else if (isStsAuth(opts)) { + headers['ALKS-STS-Access-Key'] = opts.accessKey; + headers['ALKS-STS-Secret-Key'] = opts.secretKey; + headers['ALKS-STS-Session-Token'] = opts.sessionToken; + delete payload.accessKey; + delete payload.secretKey; + delete payload.sessionToken; + } + else if (isPasswordAuth(opts)) { + console.error('The userid and password properties are deprecated and should be replaced with an access token'); + credentials = base64Encode(opts.userid + ":" + opts.password); + headers['Authorization'] = "Basic " + credentials; + delete payload.userid; + delete payload.password; + } + else ; + if (opts.userAgent) { + headers['User-Agent'] += " " + opts.userAgent; + delete payload.userAgent; + } + return [4 /*yield*/, opts._fetch(opts.baseUrl + "/" + path, { + method: method, + headers: headers, + credentials: 'omit', + body: method == 'GET' ? undefined : JSON.stringify(payload), + })]; + case 1: + response = _a.sent(); + _a.label = 2; + case 2: + _a.trys.push([2, 4, , 5]); + return [4 /*yield*/, response.json()]; + case 3: + json = _a.sent(); + return [3 /*break*/, 5]; + case 4: + err_1 = _a.sent(); + json = { + errors: [err_1.message], + }; + return [3 /*break*/, 5]; + case 5: + if (!response.ok) { + throw new AlksError(response, json); + } + return [2 /*return*/, json]; + } + }); + }); + }; + return Alks; + }()); + ALKS.Alks = Alks; + var AlksError = /** @class */ (function (_super) { + tslib_1.__extends(AlksError, _super); + function AlksError(response, json) { + var _this = this; + var errors = Array.isArray(json === null || json === void 0 ? void 0 : json.errors) ? json.errors : []; + if (response.statusText) { + errors.unshift(response.statusText); + } + var message = errors.join('; '); + _this = _super.call(this, message) || this; + _this.status = response.status; + _this.message = message; + Object.assign(_this, json); + return _this; + } + return AlksError; + }(Error)); + ALKS.AlksError = AlksError; + /** + * Encodes a string to base 64 + * + * @param str - the string to encode + * @private + * @returns the base64 encoded string + * @example + * var input = 'password'; + * base64Encode(input); + */ + function base64Encode(str) { + if (str === void 0) { str = ''; } + return buffer_1.Buffer.from(str).toString('base64'); + } + function pick(obj, props) { + return props.reduce(function (acc, prop) { return ((acc[prop] = obj[prop]), acc); }, {}); + } + var defaultConfig = { + _fetch: fetch, + }; + var defaultAlks = Alks.prototype.create.call({}, defaultConfig); + ALKS.create = Alks.prototype.create.bind(defaultAlks); + ALKS.getAccounts = Alks.prototype.getAccounts.bind(defaultAlks); + ALKS.getKeys = Alks.prototype.getKeys.bind(defaultAlks); + ALKS.getIAMKeys = Alks.prototype.getIAMKeys.bind(defaultAlks); + ALKS.getAllAWSRoleTypes = Alks.prototype.getAllAWSRoleTypes.bind(defaultAlks); + ALKS.getAWSRoleTypes = Alks.prototype.getAWSRoleTypes.bind(defaultAlks); + ALKS.getNonServiceAWSRoleTypes = Alks.prototype.getNonServiceAWSRoleTypes.bind(defaultAlks); + ALKS.createRole = Alks.prototype.createRole.bind(defaultAlks); + ALKS.createNonServiceRole = Alks.prototype.createNonServiceRole.bind(defaultAlks); + ALKS.awsAccountRoles = Alks.prototype.awsAccountRoles.bind(defaultAlks); + ALKS.listAWSAccountRoles = Alks.prototype.listAWSAccountRoles.bind(defaultAlks); + ALKS.getAccountRole = Alks.prototype.getAccountRole.bind(defaultAlks); + ALKS.updateRole = Alks.prototype.updateRole.bind(defaultAlks); + ALKS.deleteRole = Alks.prototype.deleteRole.bind(defaultAlks); + ALKS.addRoleMachineIdentity = Alks.prototype.addRoleMachineIdentity.bind(defaultAlks); + ALKS.deleteRoleMachineIdentity = Alks.prototype.deleteRoleMachineIdentity.bind(defaultAlks); + ALKS.getUserAccess = Alks.prototype.getUserAccess.bind(defaultAlks); + ALKS.getUserAccessByRole = Alks.prototype.getUserAccessByRole.bind(defaultAlks); + ALKS.getUserRoleAccess = Alks.prototype.getUserRoleAccess.bind(defaultAlks); + ALKS.getAccountOwners = Alks.prototype.getAccountOwners.bind(defaultAlks); + ALKS.createAccessKeys = Alks.prototype.createAccessKeys.bind(defaultAlks); + ALKS.getIamUser = Alks.prototype.getIamUser.bind(defaultAlks); + ALKS.updateIamUser = Alks.prototype.updateIamUser.bind(defaultAlks); + ALKS.deleteIAMUser = Alks.prototype.deleteIAMUser.bind(defaultAlks); + ALKS.version = Alks.prototype.version.bind(defaultAlks); + ALKS.getLoginRole = Alks.prototype.getLoginRole.bind(defaultAlks); + ALKS.getAccessToken = Alks.prototype.getAccessToken.bind(defaultAlks); + ALKS.getRefreshTokens = Alks.prototype.getRefreshTokens.bind(defaultAlks); + ALKS.revoke = Alks.prototype.revoke.bind(defaultAlks); + ALKS.getCostTotals = Alks.prototype.getCostTotals.bind(defaultAlks); + })(ALKS || (ALKS = {})); var alks = ALKS; exports.default = alks; diff --git a/docs/classes/export_.Alks.html b/docs/classes/export_.Alks.html index 1a82ea9d..6b134996 100644 --- a/docs/classes/export_.Alks.html +++ b/docs/classes/export_.Alks.html @@ -1,6 +1,6 @@ Alks | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

ALKS JavaScript API

-

Hierarchy

  • Alks

Index

Constructors

Properties

Methods

Hierarchy

  • Alks

Index

Constructors

Properties

Methods

Returns Promise<export=.MachineIdentity>

Returns Promise<export=.AwsAccountRole[]>

  • Returns a new instance of alks with pre-defined properties (which don't need to be supplied to every method).

    Any of the properties required by other methods can be specified here.

    Properties present on the current object are carried through to the newly created one.

    @@ -39,7 +39,7 @@ })

    Parameters

    • props: export=.AlksProps

      An object containing settings for the new ALKS object

      -

    Returns Alks

Returns Alks

Returns Promise<export=.LongTermKey>

Returns Promise<export=.Role>

Returns Promise<export=.Role>

Returns Promise<boolean>

Returns Promise<boolean>

Returns Promise<export=.MachineIdentity>

  • Returns a Promise for an array of available AWS IAM role types

    deprecated

    Replaced by getAllAWSRoleTypes which includes all AWS role types and their details

    example

    alks.getAWSRoleTypes({ @@ -228,7 +228,7 @@ })

    Parameters

    Returns Promise<string[]>

Returns Promise<string[]>

Returns Promise<export=.AccessToken>

Returns Promise<export=.User[]>

Returns Promise<export=.Role>

Returns Promise<export=.Account[]>

Returns Promise<export=.AwsRoleType[]>

  • Returns cost totals for the specified account for the day, week, month, year, and a breakdown of costs by service for the day and month

    example

    alks.getCostTotals({ accountId: '012345678910', @@ -297,7 +297,7 @@ })

    Parameters

    Returns Promise<export=.CostTotal>

Returns Promise<export=.CostTotal>

Returns Promise<export=.Key>

Returns Promise<export=.IamUser>

Returns Promise<export=.Key>

  • Returns information about one of the roles used to generate keys

    example

    alks.getLoginRole({ ... @@ -344,7 +344,7 @@ })

    Parameters

    Returns Promise<Omit<export=.Account, "skypieaAccount">>

Returns Promise<Omit<export=.Account, "skypieaAccount">>

  • Returns a Promise for an array of available custom role types

    deprecated

    Replaced by getAllAWSRoleTypes which includes all AWS role types and their details

    example

    alks.getNonServiceAWSRoleTypes({ @@ -355,7 +355,7 @@ })

    Parameters

    Returns Promise<string[]>

Returns Promise<string[]>

Returns Promise<export=.RefreshToken[]>

Returns Promise<export=.User[]>

Returns Promise<Record<string, export=.User[]>>

  • internalFetch(path: string, args?: Partial<export=.AlksProps>, method?: string): Promise<any>

Returns Promise<string[]>

  • internalFetch(path: string, args?: Partial<export=.AlksProps>, method?: string): Promise<any>
  • Returns a Promise for an array of AWS custom AWS IAM account roles

    deprecated

    Replaced by awsAccountRoles which includes AWS account roles and their details

    example

    alks.listAWSAccountRoles({ @@ -411,7 +411,7 @@ })

    Parameters

    Returns Promise<string[]>

Returns Promise<string[]>

  • Revokes a refresh or access token

    example

    alks.revoke({ token: '...', @@ -428,7 +428,7 @@ })

    Parameters

    Returns Promise<boolean>

Returns Promise<boolean>

Returns Promise<export=.IamUser>

Returns Promise<export=.Role>

  • Returns the version of the ALKS Rest API

    example

    alks.version({ ... diff --git a/docs/classes/export_.AlksError.html b/docs/classes/export_.AlksError.html index 7b68a356..96530961 100644 --- a/docs/classes/export_.AlksError.html +++ b/docs/classes/export_.AlksError.html @@ -1,4 +1,4 @@ -AlksError | alks.js

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Class AlksError

    Hierarchy

    • Error
      • AlksError

    Indexable

    [s: string]: any

    Index

    Constructors

    • new AlksError(response: Response, json: any): AlksError

    Properties

    message: string
    name: string
    stack?: string
    status: number
    stackTraceLimit: number

    Methods

    • captureStackTrace(targetObject: object, constructorOpt?: Function): void
    • +AlksError | alks.js
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Class AlksError

      Hierarchy

      • Error
        • AlksError

      Indexable

      [s: string]: any

      Index

      Constructors

      • new AlksError(response: Response, json: any): AlksError

      Properties

      message: string
      name: string
      stack?: string
      status: number
      stackTraceLimit: number

      Methods

      • captureStackTrace(targetObject: object, constructorOpt?: Function): void
      • Create .stack property on a target object

        Parameters

        • targetObject: object
        • Optional constructorOpt: Function

        Returns void

      • prepareStackTrace(err: Error, stackTraces: CallSite[]): any
      • Optional override for formatting stack traces

        diff --git a/docs/enums/export_.PseudoBoolean.html b/docs/enums/export_.PseudoBoolean.html index 0cd0f955..ecb48f0d 100644 --- a/docs/enums/export_.PseudoBoolean.html +++ b/docs/enums/export_.PseudoBoolean.html @@ -1 +1 @@ -PseudoBoolean | alks.js
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Enumeration PseudoBoolean

        Index

        Enumeration members

        Enumeration members

        False = 0
        True = 1

        Legend

        • Property

        Settings

        Theme

        Generated using TypeDoc

        \ No newline at end of file +PseudoBoolean | alks.js
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Enumeration PseudoBoolean

        Index

        Enumeration members

        Enumeration members

        False = 0
        True = 1

        Legend

        • Property

        Settings

        Theme

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/enums/export_.TrustType.html b/docs/enums/export_.TrustType.html index d7bc88c6..7cdb120c 100644 --- a/docs/enums/export_.TrustType.html +++ b/docs/enums/export_.TrustType.html @@ -1 +1 @@ -TrustType | alks.js
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Enumeration TrustType

        Index

        Enumeration members

        Enumeration members

        CrossAccount = "Cross Account"
        InnerAccount = "Inner Account"

        Legend

        • Property

        Settings

        Theme

        Generated using TypeDoc

        \ No newline at end of file +TrustType | alks.js
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Enumeration TrustType

        Index

        Enumeration members

        Enumeration members

        CrossAccount = "Cross Account"
        InnerAccount = "Inner Account"

        Legend

        • Property

        Settings

        Theme

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/interfaces/AccessToken.html b/docs/interfaces/AccessToken.html index c7f20edf..426d7899 100644 --- a/docs/interfaces/AccessToken.html +++ b/docs/interfaces/AccessToken.html @@ -1 +1 @@ -AccessToken | alks.js
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Interface AccessToken

        Hierarchy

        • AccessToken

        Index

        Properties

        accessToken: string
        expiresIn: string

        Legend

        • Property

        Settings

        Theme

        Generated using TypeDoc

        \ No newline at end of file +AccessToken | alks.js
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Interface AccessToken

        Hierarchy

        • AccessToken

        Index

        Properties

        accessToken: string
        expiresIn: string

        Legend

        • Property

        Settings

        Theme

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/interfaces/Account.html b/docs/interfaces/Account.html index bb2ec161..b906c5d1 100644 --- a/docs/interfaces/Account.html +++ b/docs/interfaces/Account.html @@ -5,4 +5,4 @@
    property

    iamKeyActive - Whether credentials with IAM permissions can be provisioned from this account

    property

    maxKeyDuration - The maximum key duration for this account

    property

    skypieaAccount - extra information about the account from Skypiea

    -

Hierarchy

  • Account

Index

Properties

account: string
iamKeyActive: boolean
maxKeyDuration: number
role: string
securityLevel: string
skypieaAccount: null | export=.SkypieaAccount

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • Account

Index

Properties

account: string
iamKeyActive: boolean
maxKeyDuration: number
role: string
securityLevel: string
skypieaAccount: null | export=.SkypieaAccount

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/AccountUserDetails.html b/docs/interfaces/AccountUserDetails.html index dc61e92d..cea244f1 100644 --- a/docs/interfaces/AccountUserDetails.html +++ b/docs/interfaces/AccountUserDetails.html @@ -3,4 +3,4 @@
property

samAccountName - the samAccountName of the user

property

email - the email of the user

property

href - the href self link

-

Hierarchy

  • AccountUserDetails

Index

Properties

email: string
href: string
samAccountName: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • AccountUserDetails

Index

Properties

email: string
href: string
samAccountName: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/AwsAccountRole.html b/docs/interfaces/AwsAccountRole.html index 01255a56..e68ee757 100644 --- a/docs/interfaces/AwsAccountRole.html +++ b/docs/interfaces/AwsAccountRole.html @@ -3,4 +3,4 @@
property

roleArn - The AWS Role ARN

property

isMachineIdentity - true|false value of if this role is a machine identity

property

assumeRolePolicyDocument - The AWS assume role policy document associated with this role

-

Hierarchy

  • AwsAccountRole

Index

Properties

assumeRolePolicyDocument: object
isMachineIdentity: boolean
roleArn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • AwsAccountRole

Index

Properties

assumeRolePolicyDocument: object
isMachineIdentity: boolean
roleArn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/AwsRoleType.html b/docs/interfaces/AwsRoleType.html index 4d24261a..21beee7c 100644 --- a/docs/interfaces/AwsRoleType.html +++ b/docs/interfaces/AwsRoleType.html @@ -5,4 +5,4 @@
property

trustRelationship - The AWS trust policy document associated with this role

property

instanceProfile - Whether this role is an instance profile

property

templateVariables - A list of template variables that exist within the role type's trust policy document

-

Hierarchy

  • AwsRoleType

Index

Properties

defaultArns: string[]
instanceProfile: boolean
roleTypeName: string
templateVariables?: string[]
trustRelationship: object

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • AwsRoleType

Index

Properties

defaultArns: string[]
instanceProfile: boolean
roleTypeName: string
templateVariables?: string[]
trustRelationship: object

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/CloudsploitReport.html b/docs/interfaces/CloudsploitReport.html index b8ea42bc..8486812b 100644 --- a/docs/interfaces/CloudsploitReport.html +++ b/docs/interfaces/CloudsploitReport.html @@ -12,4 +12,4 @@
property

warning - the amount of warnings

property

failing - the amount of fails

property

unknown - the amount of unknowns

-

Hierarchy

  • CloudsploitReport

Index

Properties

awsAccountId: string
day: number
failing: number
href: string
month: number
newRisks: number
passing: number
scanDate: string
scanId: number
unknown: number
warning: number
year: number

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • CloudsploitReport

Index

Properties

awsAccountId: string
day: number
failing: number
href: string
month: number
newRisks: number
passing: number
scanDate: string
scanId: number
unknown: number
warning: number
year: number

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/CostTotal.html b/docs/interfaces/CostTotal.html index 701e0d60..471a5edd 100644 --- a/docs/interfaces/CostTotal.html +++ b/docs/interfaces/CostTotal.html @@ -1 +1 @@ -CostTotal | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface CostTotal

Hierarchy

  • CostTotal

Index

Properties

awsAccountId: string
daily: string
dailyCostsByService: Record<string, string>
dd: string
mm: string
monthly: string
monthlyCostsByService: Record<string, string>
weekly: string
yearly: string
yyyy: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +CostTotal | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface CostTotal

Hierarchy

  • CostTotal

Index

Properties

awsAccountId: string
daily: string
dailyCostsByService: Record<string, string>
dd: string
mm: string
monthly: string
monthlyCostsByService: Record<string, string>
weekly: string
yearly: string
yyyy: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/IamUser.html b/docs/interfaces/IamUser.html index 72ccafe3..396669b8 100644 --- a/docs/interfaces/IamUser.html +++ b/docs/interfaces/IamUser.html @@ -1 +1 @@ -IamUser | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IamUser

Hierarchy

  • IamUser

Index

Properties

accessKey: string
accountId: string
arn: string
tags: export=.Tag[]
userName: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +IamUser | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IamUser

Hierarchy

  • IamUser

Index

Properties

accessKey: string
accountId: string
arn: string
tags: export=.Tag[]
userName: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/Key.html b/docs/interfaces/Key.html index 84262afd..22b1ae86 100644 --- a/docs/interfaces/Key.html +++ b/docs/interfaces/Key.html @@ -4,4 +4,4 @@
property

secretKey - AWS secret key

property

sessionToken - AWS STS session token

property

consoleURL - a URL to the AWS console using these keys

-

Hierarchy

  • Key

Index

Properties

accessKey: string
consoleURL: string
secretKey: string
sessionToken: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • Key

Index

Properties

accessKey: string
consoleURL: string
secretKey: string
sessionToken: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/LongTermKey.html b/docs/interfaces/LongTermKey.html index b592fb98..6a3c9010 100644 --- a/docs/interfaces/LongTermKey.html +++ b/docs/interfaces/LongTermKey.html @@ -4,4 +4,4 @@
property

accessKey - the long term access key

property

secretKey - the secret key for the long term access key

property

addedIAMUserToGroup - whether the user was successfuly added to the deny policy group

-

Hierarchy

  • LongTermKey

Index

Properties

accessKey: string
addedIAMUserToGroup: boolean
iamUserArn: string
secretKey: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • LongTermKey

Index

Properties

accessKey: string
addedIAMUserToGroup: boolean
iamUserArn: string
secretKey: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/MachineIdentity.html b/docs/interfaces/MachineIdentity.html index 11d70ddf..26f0a354 100644 --- a/docs/interfaces/MachineIdentity.html +++ b/docs/interfaces/MachineIdentity.html @@ -1 +1 @@ -MachineIdentity | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MachineIdentity

Hierarchy

  • MachineIdentity

Index

Properties

machineIdentityArn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +MachineIdentity | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MachineIdentity

Hierarchy

  • MachineIdentity

Index

Properties

machineIdentityArn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/RefreshToken.html b/docs/interfaces/RefreshToken.html index 19739e6d..5ff9dcc8 100644 --- a/docs/interfaces/RefreshToken.html +++ b/docs/interfaces/RefreshToken.html @@ -1 +1 @@ -RefreshToken | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface RefreshToken

Hierarchy

  • RefreshToken

Index

Properties

clientId: string
id: string
userId: string
value: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +RefreshToken | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface RefreshToken

Hierarchy

  • RefreshToken

Index

Properties

clientId: string
id: string
userId: string
value: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/Role.html b/docs/interfaces/Role.html index 4fb4bb0e..cf55a8ba 100644 --- a/docs/interfaces/Role.html +++ b/docs/interfaces/Role.html @@ -5,4 +5,4 @@
property

instanceProfileArn - The Instance Profile ARN associated with this role

property

addedRoleToInstanceProfile - Whether this role was added to an Instance Profile

property

tags - Resource tags associated with the IAM account role

-

Hierarchy

  • Role

Index

Properties

addedRoleToInstanceProfile?: boolean
denyArns?: string
instanceProfileArn: string
isMachineIdentity?: boolean
maxSessionDurationInSeconds?: number
roleArn: string
tags?: export=.Tag[]

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • Role

Index

Properties

addedRoleToInstanceProfile?: boolean
denyArns?: string
instanceProfileArn: string
isMachineIdentity?: boolean
maxSessionDurationInSeconds?: number
roleArn: string
tags?: export=.Tag[]

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/SkypieaAccount.html b/docs/interfaces/SkypieaAccount.html index ccce2b45..ffd3601d 100644 --- a/docs/interfaces/SkypieaAccount.html +++ b/docs/interfaces/SkypieaAccount.html @@ -3,4 +3,4 @@
property

label - the friendly name of the account

property

accountOwners - the samAccountNames of the account owners

property

cloudsploitTrend - the cloudsploit trends

-

Hierarchy

  • SkypieaAccount

Index

Properties

accountOwners: export=.AccountUserDetails[]
cloudsploitTrend: export=.CloudsploitReport[]
label: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • SkypieaAccount

Index

Properties

accountOwners: export=.AccountUserDetails[]
cloudsploitTrend: export=.CloudsploitReport[]
label: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/Tag.html b/docs/interfaces/Tag.html index 02855717..8f7d44c4 100644 --- a/docs/interfaces/Tag.html +++ b/docs/interfaces/Tag.html @@ -2,4 +2,4 @@

Alks role tags

property

key - The AWS role tag key

property

value - The AWS role tag value

-

Hierarchy

  • Tag

Index

Properties

Properties

key: string
value: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • Tag

Index

Properties

Properties

key: string
value: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/User.html b/docs/interfaces/User.html index 76b97db2..fafd0ac1 100644 --- a/docs/interfaces/User.html +++ b/docs/interfaces/User.html @@ -5,4 +5,4 @@
property

email - The user email

property

title - The user title

property

department - The user department

-

Hierarchy

  • User

Index

Properties

department: string
displayName: string
email: string
sAMAccountName: string
title: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • User

Index

Properties

department: string
displayName: string
email: string
sAMAccountName: string
title: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.AccessToken.html b/docs/interfaces/export_.AccessToken.html index b0d14158..580ffd95 100644 --- a/docs/interfaces/export_.AccessToken.html +++ b/docs/interfaces/export_.AccessToken.html @@ -1 +1 @@ -AccessToken | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface AccessToken

Hierarchy

  • AccessToken

Index

Properties

accessToken: string
expiresIn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +AccessToken | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface AccessToken

Hierarchy

  • AccessToken

Index

Properties

accessToken: string
expiresIn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.Account.html b/docs/interfaces/export_.Account.html index 0d1918ce..3f5e1d46 100644 --- a/docs/interfaces/export_.Account.html +++ b/docs/interfaces/export_.Account.html @@ -5,4 +5,4 @@
property

iamKeyActive - Whether credentials with IAM permissions can be provisioned from this account

property

maxKeyDuration - The maximum key duration for this account

property

skypieaAccount - extra information about the account from Skypiea

-

Hierarchy

  • Account

Index

Properties

account: string
iamKeyActive: boolean
maxKeyDuration: number
role: string
securityLevel: string
skypieaAccount: null | export=.SkypieaAccount

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • Account

Index

Properties

account: string
iamKeyActive: boolean
maxKeyDuration: number
role: string
securityLevel: string
skypieaAccount: null | export=.SkypieaAccount

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.AccountUserDetails.html b/docs/interfaces/export_.AccountUserDetails.html index edeb35df..3b8f341e 100644 --- a/docs/interfaces/export_.AccountUserDetails.html +++ b/docs/interfaces/export_.AccountUserDetails.html @@ -3,4 +3,4 @@
property

samAccountName - the samAccountName of the user

property

email - the email of the user

property

href - the href self link

-

Hierarchy

  • AccountUserDetails

Index

Properties

email: string
href: string
samAccountName: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • AccountUserDetails

Index

Properties

email: string
href: string
samAccountName: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.AwsAccountRole.html b/docs/interfaces/export_.AwsAccountRole.html index 7c3eee0c..2db4b67a 100644 --- a/docs/interfaces/export_.AwsAccountRole.html +++ b/docs/interfaces/export_.AwsAccountRole.html @@ -3,4 +3,4 @@
property

roleArn - The AWS Role ARN

property

isMachineIdentity - true|false value of if this role is a machine identity

property

assumeRolePolicyDocument - The AWS assume role policy document associated with this role

-

Hierarchy

  • AwsAccountRole

Index

Properties

assumeRolePolicyDocument: object
isMachineIdentity: boolean
roleArn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • AwsAccountRole

Index

Properties

assumeRolePolicyDocument: object
isMachineIdentity: boolean
roleArn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.AwsRoleType.html b/docs/interfaces/export_.AwsRoleType.html index e2d8d2d1..4e98ed42 100644 --- a/docs/interfaces/export_.AwsRoleType.html +++ b/docs/interfaces/export_.AwsRoleType.html @@ -5,4 +5,4 @@
property

trustRelationship - The AWS trust policy document associated with this role

property

instanceProfile - Whether this role is an instance profile

property

templateVariables - A list of template variables that exist within the role type's trust policy document

-

Hierarchy

  • AwsRoleType

Index

Properties

defaultArns: string[]
instanceProfile: boolean
roleTypeName: string
templateVariables?: string[]
trustRelationship: object

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • AwsRoleType

Index

Properties

defaultArns: string[]
instanceProfile: boolean
roleTypeName: string
templateVariables?: string[]
trustRelationship: object

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.CloudsploitReport.html b/docs/interfaces/export_.CloudsploitReport.html index f79fce27..ce66a145 100644 --- a/docs/interfaces/export_.CloudsploitReport.html +++ b/docs/interfaces/export_.CloudsploitReport.html @@ -12,4 +12,4 @@
property

warning - the amount of warnings

property

failing - the amount of fails

property

unknown - the amount of unknowns

-

Hierarchy

  • CloudsploitReport

Index

Properties

awsAccountId: string
day: number
failing: number
href: string
month: number
newRisks: number
passing: number
scanDate: string
scanId: number
unknown: number
warning: number
year: number

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • CloudsploitReport

Index

Properties

awsAccountId: string
day: number
failing: number
href: string
month: number
newRisks: number
passing: number
scanDate: string
scanId: number
unknown: number
warning: number
year: number

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.CostTotal.html b/docs/interfaces/export_.CostTotal.html index 69abb4bb..72a17390 100644 --- a/docs/interfaces/export_.CostTotal.html +++ b/docs/interfaces/export_.CostTotal.html @@ -1 +1 @@ -CostTotal | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface CostTotal

Hierarchy

  • CostTotal

Index

Properties

awsAccountId: string
daily: string
dailyCostsByService: Record<string, string>
dd: string
mm: string
monthly: string
monthlyCostsByService: Record<string, string>
weekly: string
yearly: string
yyyy: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +CostTotal | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface CostTotal

Hierarchy

  • CostTotal

Index

Properties

awsAccountId: string
daily: string
dailyCostsByService: Record<string, string>
dd: string
mm: string
monthly: string
monthlyCostsByService: Record<string, string>
weekly: string
yearly: string
yyyy: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.IamUser.html b/docs/interfaces/export_.IamUser.html index 542c67cf..87a8e64d 100644 --- a/docs/interfaces/export_.IamUser.html +++ b/docs/interfaces/export_.IamUser.html @@ -1 +1 @@ -IamUser | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IamUser

Hierarchy

  • IamUser

Index

Properties

accessKey: string
accountId: string
arn: string
tags: export=.Tag[]
userName: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +IamUser | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IamUser

Hierarchy

  • IamUser

Index

Properties

accessKey: string
accountId: string
arn: string
tags: export=.Tag[]
userName: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.Key.html b/docs/interfaces/export_.Key.html index d525ff0e..fcc17e97 100644 --- a/docs/interfaces/export_.Key.html +++ b/docs/interfaces/export_.Key.html @@ -4,4 +4,4 @@
property

secretKey - AWS secret key

property

sessionToken - AWS STS session token

property

consoleURL - a URL to the AWS console using these keys

-

Hierarchy

  • Key

Index

Properties

accessKey: string
consoleURL: string
secretKey: string
sessionToken: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • Key

Index

Properties

accessKey: string
consoleURL: string
secretKey: string
sessionToken: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.LongTermKey.html b/docs/interfaces/export_.LongTermKey.html index be1d0962..4700060a 100644 --- a/docs/interfaces/export_.LongTermKey.html +++ b/docs/interfaces/export_.LongTermKey.html @@ -4,4 +4,4 @@
property

accessKey - the long term access key

property

secretKey - the secret key for the long term access key

property

addedIAMUserToGroup - whether the user was successfuly added to the deny policy group

-

Hierarchy

  • LongTermKey

Index

Properties

accessKey: string
addedIAMUserToGroup: boolean
iamUserArn: string
secretKey: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • LongTermKey

Index

Properties

accessKey: string
addedIAMUserToGroup: boolean
iamUserArn: string
secretKey: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.MachineIdentity.html b/docs/interfaces/export_.MachineIdentity.html index 62002bb4..ac2615e8 100644 --- a/docs/interfaces/export_.MachineIdentity.html +++ b/docs/interfaces/export_.MachineIdentity.html @@ -1 +1 @@ -MachineIdentity | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MachineIdentity

Hierarchy

  • MachineIdentity

Index

Properties

machineIdentityArn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +MachineIdentity | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MachineIdentity

Hierarchy

  • MachineIdentity

Index

Properties

machineIdentityArn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.RefreshToken.html b/docs/interfaces/export_.RefreshToken.html index fa14ac96..912ef630 100644 --- a/docs/interfaces/export_.RefreshToken.html +++ b/docs/interfaces/export_.RefreshToken.html @@ -1 +1 @@ -RefreshToken | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface RefreshToken

Hierarchy

  • RefreshToken

Index

Properties

clientId: string
id: string
userId: string
value: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +RefreshToken | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface RefreshToken

Hierarchy

  • RefreshToken

Index

Properties

clientId: string
id: string
userId: string
value: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.Role.html b/docs/interfaces/export_.Role.html index 0c5413f8..d70b5476 100644 --- a/docs/interfaces/export_.Role.html +++ b/docs/interfaces/export_.Role.html @@ -5,4 +5,4 @@
property

instanceProfileArn - The Instance Profile ARN associated with this role

property

addedRoleToInstanceProfile - Whether this role was added to an Instance Profile

property

tags - Resource tags associated with the IAM account role

-

Hierarchy

  • Role

Index

Properties

addedRoleToInstanceProfile?: boolean
denyArns?: string
instanceProfileArn: string
isMachineIdentity?: boolean
maxSessionDurationInSeconds?: number
roleArn: string
tags?: export=.Tag[]

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • Role

Index

Properties

addedRoleToInstanceProfile?: boolean
denyArns?: string
instanceProfileArn: string
isMachineIdentity?: boolean
maxSessionDurationInSeconds?: number
roleArn: string
tags?: export=.Tag[]

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.SkypieaAccount.html b/docs/interfaces/export_.SkypieaAccount.html index 01a54428..43fd2ada 100644 --- a/docs/interfaces/export_.SkypieaAccount.html +++ b/docs/interfaces/export_.SkypieaAccount.html @@ -3,4 +3,4 @@
property

label - the friendly name of the account

property

accountOwners - the samAccountNames of the account owners

property

cloudsploitTrend - the cloudsploit trends

-

Hierarchy

  • SkypieaAccount

Index

Properties

accountOwners: export=.AccountUserDetails[]
cloudsploitTrend: export=.CloudsploitReport[]
label: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • SkypieaAccount

Index

Properties

accountOwners: export=.AccountUserDetails[]
cloudsploitTrend: export=.CloudsploitReport[]
label: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.Tag.html b/docs/interfaces/export_.Tag.html index 929da441..7842277b 100644 --- a/docs/interfaces/export_.Tag.html +++ b/docs/interfaces/export_.Tag.html @@ -2,4 +2,4 @@

Alks role tags

property

key - The AWS role tag key

property

value - The AWS role tag value

-

Hierarchy

  • Tag

Index

Properties

Properties

key: string
value: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • Tag

Index

Properties

Properties

key: string
value: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.User.html b/docs/interfaces/export_.User.html index 97233d34..96faece9 100644 --- a/docs/interfaces/export_.User.html +++ b/docs/interfaces/export_.User.html @@ -5,4 +5,4 @@
property

email - The user email

property

title - The user title

property

department - The user department

-

Hierarchy

  • User

Index

Properties

department: string
displayName: string
email: string
sAMAccountName: string
title: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • User

Index

Properties

department: string
displayName: string
email: string
sAMAccountName: string
title: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules.html b/docs/modules.html index d6248c33..194edc45 100644 --- a/docs/modules.html +++ b/docs/modules.html @@ -1 +1 @@ -alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

alks.js

Index

Type aliases

AddRoleMachineIdentityProps: Partial<export=.AlksProps> & { roleARN: string }
AlksProps: BaseConfig & Auth
AwsAccountRolesProps: Partial<export=.AlksProps> & { account: string }
CreateAccessKeysProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; role: string; tags?: export=.Tag[] }
CreateNonServiceRoleProps: Partial<export=.AlksProps> & { account: string; enableAlksAccess: boolean; externalId?: string; includeDefaultPolicy: PseudoBoolean; role: string; roleName: string; roleType: TrustType; tags?: export=.Tag[]; trustArn: string }
CreateRoleProps: Partial<export=.AlksProps> & { account: string; enableAlksAccess: boolean; includeDefaultPolicy: PseudoBoolean; role: string; roleName: string; roleType?: string; tags?: export=.Tag[]; templateFields?: Record<string, string>; trustPolicy?: Record<string, unknown> }
DeleteIAMUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; role: string }
DeleteRoleMachineIdentityProps: Partial<export=.AlksProps> & { roleARN: string }
DeleteRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string }
GetAWSRoleTypesProps: Partial<export=.AlksProps> & {}
GetAccessTokenProps: Partial<export=.AlksProps> & { refreshToken: string }
GetAccountOwnersProps: Partial<export=.AlksProps> & { accountId: string }
GetAccountRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string }
GetAccountsProps: Partial<export=.AlksProps> & {}
GetAllAWSRoleTypesProps: Partial<export=.AlksProps> & { getDynamicValues?: boolean }
GetCostTotalsProps: Partial<export=.AlksProps> & { accountId: string }
GetIAMKeysProps: Partial<export=.AlksProps> & { account: string; role: string; sessionTime: number }
GetIamUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string }
GetKeysProps: Partial<export=.AlksProps> & { account: string; role: string; sessionTime: number }
GetLoginRoleProps: Partial<export=.AlksProps> & { accountId: string; role: string }
GetNonServiceAWSRoleTypesProps: Partial<export=.AlksProps> & {}
GetRefreshTokensProps: Partial<export=.AlksProps> & {}
GetUserAccessByRoleProps: Partial<export=.AlksProps> & { accountId: string }
GetUserAccessProps: Partial<export=.AlksProps> & { accountId: string }
GetUserRoleAccessProps: Partial<export=.AlksProps> & { accountId: string; sAMAccountName: string }
ListAWSAccountRolesProps: Partial<export=.AlksProps> & { account: string; role: string }
RevokeByIdProps: Partial<export=.AlksProps> & { tokenId: string }
RevokeByValueProps: Partial<export=.AlksProps> & { token: string }
UpdateIamUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; tags?: export=.Tag[] }
UpdateRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string; tags: export=.Tag[] }
VersionProps: Partial<export=.AlksProps> & {}

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

alks.js

Index

Type aliases

AddRoleMachineIdentityProps: Partial<export=.AlksProps> & { roleARN: string }
AlksProps: BaseConfig & Auth
AwsAccountRolesProps: Partial<export=.AlksProps> & { account: string }
CreateAccessKeysProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; role: string; tags?: export=.Tag[] }
CreateNonServiceRoleProps: Partial<export=.AlksProps> & { account: string; enableAlksAccess: boolean; externalId?: string; includeDefaultPolicy: PseudoBoolean; role: string; roleName: string; roleType: TrustType; tags?: export=.Tag[]; trustArn: string }
CreateRoleProps: Partial<export=.AlksProps> & { account: string; enableAlksAccess: boolean; includeDefaultPolicy: PseudoBoolean; role: string; roleName: string; roleType?: string; tags?: export=.Tag[]; templateFields?: Record<string, string>; trustPolicy?: Record<string, unknown> }
DeleteIAMUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; role: string }
DeleteRoleMachineIdentityProps: Partial<export=.AlksProps> & { roleARN: string }
DeleteRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string }
GetAWSRoleTypesProps: Partial<export=.AlksProps> & {}
GetAccessTokenProps: Partial<export=.AlksProps> & { refreshToken: string }
GetAccountOwnersProps: Partial<export=.AlksProps> & { accountId: string }
GetAccountRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string }
GetAccountsProps: Partial<export=.AlksProps> & {}
GetAllAWSRoleTypesProps: Partial<export=.AlksProps> & { getDynamicValues?: boolean }
GetCostTotalsProps: Partial<export=.AlksProps> & { accountId: string }
GetIAMKeysProps: Partial<export=.AlksProps> & { account: string; role: string; sessionTime: number }
GetIamUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string }
GetKeysProps: Partial<export=.AlksProps> & { account: string; role: string; sessionTime: number }
GetLoginRoleProps: Partial<export=.AlksProps> & { accountId: string; role: string }
GetNonServiceAWSRoleTypesProps: Partial<export=.AlksProps> & {}
GetRefreshTokensProps: Partial<export=.AlksProps> & {}
GetUserAccessByRoleProps: Partial<export=.AlksProps> & { accountId: string }
GetUserAccessProps: Partial<export=.AlksProps> & { accountId: string }
GetUserRoleAccessProps: Partial<export=.AlksProps> & { accountId: string; sAMAccountName: string }
ListAWSAccountRolesProps: Partial<export=.AlksProps> & { account: string; role: string }
RevokeByIdProps: Partial<export=.AlksProps> & { tokenId: string }
RevokeByValueProps: Partial<export=.AlksProps> & { token: string }
UpdateIamUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; tags?: export=.Tag[] }
UpdateRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string; tags: export=.Tag[] }
VersionProps: Partial<export=.AlksProps> & {}

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules/export_.html b/docs/modules/export_.html index 93ed2bfa..77a4acd1 100644 --- a/docs/modules/export_.html +++ b/docs/modules/export_.html @@ -1 +1 @@ -export= | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace export=

Index

Type aliases

AddRoleMachineIdentityProps: Partial<export=.AlksProps> & { roleARN: string }
AlksProps: BaseConfig & Auth
AwsAccountRolesProps: Partial<export=.AlksProps> & { account: string }
CreateAccessKeysProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; role: string; tags?: export=.Tag[] }
CreateNonServiceRoleProps: Partial<export=.AlksProps> & { account: string; enableAlksAccess: boolean; externalId?: string; includeDefaultPolicy: PseudoBoolean; role: string; roleName: string; roleType: TrustType; tags?: export=.Tag[]; trustArn: string }
CreateRoleProps: Partial<export=.AlksProps> & { account: string; enableAlksAccess: boolean; includeDefaultPolicy: PseudoBoolean; role: string; roleName: string; roleType?: string; tags?: export=.Tag[]; templateFields?: Record<string, string>; trustPolicy?: Record<string, unknown> }
DeleteIAMUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; role: string }
DeleteRoleMachineIdentityProps: Partial<export=.AlksProps> & { roleARN: string }
DeleteRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string }
GetAWSRoleTypesProps: Partial<export=.AlksProps> & {}
GetAccessTokenProps: Partial<export=.AlksProps> & { refreshToken: string }
GetAccountOwnersProps: Partial<export=.AlksProps> & { accountId: string }
GetAccountRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string }
GetAccountsProps: Partial<export=.AlksProps> & {}
GetAllAWSRoleTypesProps: Partial<export=.AlksProps> & { getDynamicValues?: boolean }
GetCostTotalsProps: Partial<export=.AlksProps> & { accountId: string }
GetIAMKeysProps: Partial<export=.AlksProps> & { account: string; role: string; sessionTime: number }
GetIamUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string }
GetKeysProps: Partial<export=.AlksProps> & { account: string; role: string; sessionTime: number }
GetLoginRoleProps: Partial<export=.AlksProps> & { accountId: string; role: string }
GetNonServiceAWSRoleTypesProps: Partial<export=.AlksProps> & {}
GetRefreshTokensProps: Partial<export=.AlksProps> & {}
GetUserAccessByRoleProps: Partial<export=.AlksProps> & { accountId: string }
GetUserAccessProps: Partial<export=.AlksProps> & { accountId: string }
GetUserRoleAccessProps: Partial<export=.AlksProps> & { accountId: string; sAMAccountName: string }
ListAWSAccountRolesProps: Partial<export=.AlksProps> & { account: string; role: string }
RevokeByIdProps: Partial<export=.AlksProps> & { tokenId: string }
RevokeByValueProps: Partial<export=.AlksProps> & { token: string }
UpdateIamUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; tags?: export=.Tag[] }
UpdateRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string; tags: export=.Tag[] }
VersionProps: Partial<export=.AlksProps> & {}

Functions

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +export= | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace export=

Index

Type aliases

AddRoleMachineIdentityProps: Partial<export=.AlksProps> & { roleARN: string }
AlksProps: BaseConfig & Auth
AwsAccountRolesProps: Partial<export=.AlksProps> & { account: string }
CreateAccessKeysProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; role: string; tags?: export=.Tag[] }
CreateNonServiceRoleProps: Partial<export=.AlksProps> & { account: string; enableAlksAccess: boolean; externalId?: string; includeDefaultPolicy: PseudoBoolean; role: string; roleName: string; roleType: TrustType; tags?: export=.Tag[]; trustArn: string }
CreateRoleProps: Partial<export=.AlksProps> & { account: string; enableAlksAccess: boolean; includeDefaultPolicy: PseudoBoolean; role: string; roleName: string; roleType?: string; tags?: export=.Tag[]; templateFields?: Record<string, string>; trustPolicy?: Record<string, unknown> }
DeleteIAMUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; role: string }
DeleteRoleMachineIdentityProps: Partial<export=.AlksProps> & { roleARN: string }
DeleteRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string }
GetAWSRoleTypesProps: Partial<export=.AlksProps> & {}
GetAccessTokenProps: Partial<export=.AlksProps> & { refreshToken: string }
GetAccountOwnersProps: Partial<export=.AlksProps> & { accountId: string }
GetAccountRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string }
GetAccountsProps: Partial<export=.AlksProps> & {}
GetAllAWSRoleTypesProps: Partial<export=.AlksProps> & { getDynamicValues?: boolean }
GetCostTotalsProps: Partial<export=.AlksProps> & { accountId: string }
GetIAMKeysProps: Partial<export=.AlksProps> & { account: string; role: string; sessionTime: number }
GetIamUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string }
GetKeysProps: Partial<export=.AlksProps> & { account: string; role: string; sessionTime: number }
GetLoginRoleProps: Partial<export=.AlksProps> & { accountId: string; role: string }
GetNonServiceAWSRoleTypesProps: Partial<export=.AlksProps> & {}
GetRefreshTokensProps: Partial<export=.AlksProps> & {}
GetUserAccessByRoleProps: Partial<export=.AlksProps> & { accountId: string }
GetUserAccessProps: Partial<export=.AlksProps> & { accountId: string }
GetUserRoleAccessProps: Partial<export=.AlksProps> & { accountId: string; sAMAccountName: string }
ListAWSAccountRolesProps: Partial<export=.AlksProps> & { account: string; role: string }
RevokeByIdProps: Partial<export=.AlksProps> & { tokenId: string }
RevokeByValueProps: Partial<export=.AlksProps> & { token: string }
UpdateIamUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; tags?: export=.Tag[] }
UpdateRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string; tags: export=.Tag[] }
VersionProps: Partial<export=.AlksProps> & {}

Functions

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/package-lock.json b/package-lock.json index abad538f..8aa87bb1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "alks.js", - "version": "2.4.0", + "version": "2.5.0", "license": "MIT", "dependencies": { "encoding": "^0.1.13", From f38df3f330287eefb1f6de3c64642bdced2da3c1 Mon Sep 17 00:00:00 2001 From: Chris Donnelly Date: Thu, 10 Nov 2022 19:39:24 -0600 Subject: [PATCH 2/3] chore: Move typedoc to be a dev dependency. typedoc is not used at runtime, but is currently being bundled in the release, along with its dependencies, including shiki, which is fairly sizable at 8MB uncompressed. --- dist/alks.min.js | 2 +- dist/alks.umd.js | 4 +- docs/classes/export_.Alks.html | 60 ++++++------- docs/classes/export_.AlksError.html | 2 +- docs/enums/export_.PseudoBoolean.html | 2 +- docs/enums/export_.TrustType.html | 2 +- docs/interfaces/AccessToken.html | 2 +- docs/interfaces/Account.html | 2 +- docs/interfaces/AccountUserDetails.html | 2 +- docs/interfaces/AwsAccountRole.html | 2 +- docs/interfaces/AwsRoleType.html | 2 +- docs/interfaces/CloudsploitReport.html | 2 +- docs/interfaces/CostTotal.html | 2 +- docs/interfaces/IamUser.html | 2 +- docs/interfaces/Key.html | 2 +- docs/interfaces/LongTermKey.html | 2 +- docs/interfaces/MachineIdentity.html | 2 +- docs/interfaces/RefreshToken.html | 2 +- docs/interfaces/Role.html | 2 +- docs/interfaces/SkypieaAccount.html | 2 +- docs/interfaces/Tag.html | 2 +- docs/interfaces/User.html | 2 +- docs/interfaces/export_.AccessToken.html | 2 +- docs/interfaces/export_.Account.html | 2 +- .../export_.AccountUserDetails.html | 2 +- docs/interfaces/export_.AwsAccountRole.html | 2 +- docs/interfaces/export_.AwsRoleType.html | 2 +- .../interfaces/export_.CloudsploitReport.html | 2 +- docs/interfaces/export_.CostTotal.html | 2 +- docs/interfaces/export_.IamUser.html | 2 +- docs/interfaces/export_.Key.html | 2 +- docs/interfaces/export_.LongTermKey.html | 2 +- docs/interfaces/export_.MachineIdentity.html | 2 +- docs/interfaces/export_.RefreshToken.html | 2 +- docs/interfaces/export_.Role.html | 2 +- docs/interfaces/export_.SkypieaAccount.html | 2 +- docs/interfaces/export_.Tag.html | 2 +- docs/interfaces/export_.User.html | 2 +- docs/modules.html | 2 +- docs/modules/export_.html | 2 +- package-lock.json | 88 ++++++++++++++----- package.json | 4 +- 42 files changed, 137 insertions(+), 95 deletions(-) diff --git a/dist/alks.min.js b/dist/alks.min.js index e03af159..2f234a27 100644 --- a/dist/alks.min.js +++ b/dist/alks.min.js @@ -1 +1 @@ -!function(global,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((global="undefined"!=typeof globalThis?globalThis:global||self).alks={})}(this,function(e){"use strict";var a=window||this;function p(p){if(p.__esModule)return p;var d=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(p).forEach(function(e){var a=Object.getOwnPropertyDescriptor(p,e);Object.defineProperty(d,e,a.get?a:{enumerable:!0,get:function(){return p[e]}})}),d}var d=function(e,a){return(d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,a){e.__proto__=a}||function(e,a){for(var p in a)Object.prototype.hasOwnProperty.call(a,p)&&(e[p]=a[p])})(e,a)};var t=function(){return(t=Object.assign||function(e){for(var a,p=1,d=arguments.length;p=e.length?void 0:e)&&e[d++],done:!e}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(e,a){var p="function"==typeof Symbol&&e[Symbol.iterator];if(!p)return e;var d,t,i=p.call(e),r=[];try{for(;(void 0===a||0r[0]&&a[1] dist/alks.min.js',build:"npm run clean && npm run compile && npm run rollup && npm run minify",lint:"prettier --write --no-error-on-unmatched-pattern {src,test}/**/*.{ts,js,json,md}",test:"npm run build && npm run lint && npm run mocha && npm run karma",mocha:"nyc mocha test/test.js",coverage:"nyc report --reporter=text-lcov | coveralls",karma:"karma start",docs:"typedoc src/alks.ts",prepare:"husky install",compile:"tsc"},files:["dist/"],repository:{type:"git",url:"https://github.com/Cox-Automotive/alks.js.git"},author:{name:"Cox Automotive",email:"paul.ofallon@coxautoinc.com",url:"https://github.com/Cox-Automotive/"},bugs:{url:"https://github.com/Cox-Automotive/alks.js/issues"},license:"MIT",engines:{node:">=14.0.0"},dependencies:{encoding:"^0.1.13","node-fetch":"^2.6.1",tslib:"^2.3.1",typedoc:"^0.22.15"},devDependencies:{"@rollup/plugin-commonjs":"^19.0.0","@rollup/plugin-node-resolve":"^13.0.0","@rollup/plugin-typescript":"^8.2.1","@types/node":"^15.0.2","@types/node-fetch":"^2.5.10",browserify:"^17.0.0",chai:"^4.3.4","chai-as-promised":"^7.1.1",coveralls:"^3.0.3",eslint:"^7.25.0","eslint-plugin-jsdoc":"^4.1.1","fetch-mock":"^7.3.1",husky:"^6.0.0",karma:"^6.3.2","karma-browserify":"^8.0.0","karma-chrome-launcher":"^3.1.0","karma-mocha":"^2.0.1","karma-mocha-reporter":"^2.2.5","lint-staged":"^11.0.0",mkdirp:"^1.0.4",mocha:"^10.0.0",nyc:"^15.1.0",prettier:"^2.3.0",rimraf:"^3.0.2",rollup:"^2.47.0","rollup-plugin-json":"^3.1.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-replace":"^2.2.0",sinon:"^10.0.0",tslint:"^6.1.3",typescript:"^4.2.4","uglify-js":"^3.13.6"},prettier:{singleQuote:!0,semi:!0,arrowParens:"always",endOfLine:"lf",trailingComma:"es5"},"lint-staged":{"{src,test}/**/*.{js,ts,json,md}":["prettier --write"]}},u=void 0!==a?a:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},h=[],c=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,v=!1;function w(){v=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,p=e.length;a>18&63]+h[d>>12&63]+h[d>>6&63]+h[63&d]);return t.join("")}function g(e){var a;v||w();for(var p=e.length,d=p%3,t="",i=[],r=0,n=p-d;r>2],t+=h[a<<4&63],t+="=="):2==d&&(a=(e[p-2]<<8)+e[p-1],t+=h[a>>10],t+=h[a>>4&63],t+=h[a<<2&63],t+="="),i.push(t),i.join("")}function b(e,a,p,d,t){var i,r,n=8*t-d-1,l=(1<>1,o=-7,s=p?t-1:0,u=p?-1:1,p=e[a+s];for(s+=u,i=p&(1<<-o)-1,p>>=-o,o+=n;0>=-o,o+=d;0>1,s=23===t?Math.pow(2,-24)-Math.pow(2,-77):0,u=d?0:i-1,h=d?1:-1,i=a<0||0===a&&1/a<0?1:0;for(a=Math.abs(a),isNaN(a)||a===1/0?(n=isNaN(a)?1:0,r=m):(r=Math.floor(Math.log(a)/Math.LN2),a*(d=Math.pow(2,-r))<1&&(r--,d*=2),2<=(a+=1<=r+o?s/d:s*Math.pow(2,1-o))*d&&(r++,d/=2),m<=r+o?(n=0,r=m):1<=r+o?(n=(a*d-1)*Math.pow(2,t),r+=o):(n=a*Math.pow(2,o-1)*Math.pow(2,t),r=0));8<=t;e[p+u]=255&n,u+=h,n/=256,t-=8);for(r=r<=D())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+D().toString(16)+" bytes");return 0|e}function O(e){return null!=e&&e._isBuffer}function L(e,a){if(O(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;var p=(e="string"!=typeof e?""+e:e).length;if(0===p)return 0;for(var d=!1;;)switch(a){case"ascii":case"latin1":case"binary":return p;case"utf8":case"utf-8":case void 0:return X(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*p;case"hex":return p>>>1;case"base64":return J(e).length;default:if(d)return X(e).length;a=(""+a).toLowerCase(),d=!0}}function B(e,a,p){var d,t,i,r=!1;if((a=void 0===a||a<0?0:a)>this.length)return"";if((p=void 0===p||p>this.length?this.length:p)<=0)return"";if((p>>>=0)<=(a>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return function(e,a,p){var d=e.length;(!a||a<0)&&(a=0);(!p||p<0||d=e.length){if(t)return-1;p=e.length-1}else if(p<0){if(!t)return-1;p=0}if(O(a="string"==typeof a?R.from(a,d):a))return 0===a.length?-1:F(e,a,p,d,t);if("number"==typeof a)return a&=255,R.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?(t?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,a,p):F(e,[a],p,d,t);throw new TypeError("val must be string, number or Buffer")}function F(e,a,p,d,t){var i=1,r=e.length,n=a.length;if(void 0!==d&&("ucs2"===(d=String(d).toLowerCase())||"ucs-2"===d||"utf16le"===d||"utf-16le"===d)){if(e.length<2||a.length<2)return-1;r/=i=2,n/=2,p/=2}function l(e,a){return 1===i?e[a]:e.readUInt16BE(a*i)}if(t)for(var m=-1,o=p;o>8,d=d%256,t.push(d),t.push(p);return t}(a,e.length-p),e,p,d)}function z(e,a,p){p=Math.min(e.length,p);for(var d=[],t=a;t>>10&1023|55296),o=56320|1023&o),d.push(o),t+=s}return function(e){var a=e.length;if(a<=M)return String.fromCharCode.apply(String,e);var p="",d=0;for(;d"},R.prototype.compare=function(e,a,p,d,t){if(!O(e))throw new TypeError("Argument must be a Buffer");if(void 0===p&&(p=e?e.length:0),void 0===d&&(d=0),void 0===t&&(t=this.length),(a=void 0===a?0:a)<0||p>e.length||d<0||t>this.length)throw new RangeError("out of range index");if(t<=d&&p<=a)return 0;if(t<=d)return-1;if(p<=a)return 1;if(this===e)return 0;for(var i=(t>>>=0)-(d>>>=0),r=(p>>>=0)-(a>>>=0),n=Math.min(i,r),l=this.slice(d,t),m=e.slice(a,p),o=0;othis.length)throw new RangeError("Attempt to write outside buffer bounds");d=d||"utf8";for(var i,r,n,l=!1;;)switch(d){case"hex":return function(e,a,p,d){p=Number(p)||0;var t=e.length-p;if((!d||t<(d=Number(d)))&&(d=t),(t=a.length)%2!=0)throw new TypeError("Invalid hex string");t/2e.length)throw new RangeError("Index out of range")}function H(e,a,p,d){a<0&&(a=65535+a+1);for(var t=0,i=Math.min(e.length-p,2);t>>8*(d?t:1-t)}function K(e,a,p,d){a<0&&(a=4294967295+a+1);for(var t=0,i=Math.min(e.length-p,4);t>>8*(d?t:3-t)&255}function Y(e,a,p,d){if(p+d>e.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("Index out of range")}function W(e,a,p,d,t){return t||Y(e,0,p,4),y(e,a,p,d,23,4),p+4}function $(e,a,p,d,t){return t||Y(e,0,p,8),y(e,a,p,d,52,8),p+8}R.prototype.slice=function(e,a){var p=this.length;if((e=~~e)<0?(e+=p)<0&&(e=0):p>>8):H(this,e,a,!0),a+2},R.prototype.writeUInt16BE=function(e,a,p){return e=+e,a|=0,p||q(this,e,a,2,65535,0),R.TYPED_ARRAY_SUPPORT?(this[a]=e>>>8,this[a+1]=255&e):H(this,e,a,!1),a+2},R.prototype.writeUInt32LE=function(e,a,p){return e=+e,a|=0,p||q(this,e,a,4,4294967295,0),R.TYPED_ARRAY_SUPPORT?(this[a+3]=e>>>24,this[a+2]=e>>>16,this[a+1]=e>>>8,this[a]=255&e):K(this,e,a,!0),a+4},R.prototype.writeUInt32BE=function(e,a,p){return e=+e,a|=0,p||q(this,e,a,4,4294967295,0),R.TYPED_ARRAY_SUPPORT?(this[a]=e>>>24,this[a+1]=e>>>16,this[a+2]=e>>>8,this[a+3]=255&e):K(this,e,a,!1),a+4},R.prototype.writeIntLE=function(e,a,p,d){e=+e,a|=0,d||q(this,e,a,p,(d=Math.pow(2,8*p-1))-1,-d);var t=0,i=1,r=0;for(this[a]=255&e;++t>0)-r&255;return a+p},R.prototype.writeIntBE=function(e,a,p,d){e=+e,a|=0,d||q(this,e,a,p,(d=Math.pow(2,8*p-1))-1,-d);var t=p-1,i=1,r=0;for(this[a+t]=255&e;0<=--t&&(i*=256);)e<0&&0===r&&0!==this[a+t+1]&&(r=1),this[a+t]=(e/i>>0)-r&255;return a+p},R.prototype.writeInt8=function(e,a,p){return e=+e,a|=0,p||q(this,e,a,1,127,-128),R.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[a]=255&(e=e<0?255+e+1:e),a+1},R.prototype.writeInt16LE=function(e,a,p){return e=+e,a|=0,p||q(this,e,a,2,32767,-32768),R.TYPED_ARRAY_SUPPORT?(this[a]=255&e,this[a+1]=e>>>8):H(this,e,a,!0),a+2},R.prototype.writeInt16BE=function(e,a,p){return e=+e,a|=0,p||q(this,e,a,2,32767,-32768),R.TYPED_ARRAY_SUPPORT?(this[a]=e>>>8,this[a+1]=255&e):H(this,e,a,!1),a+2},R.prototype.writeInt32LE=function(e,a,p){return e=+e,a|=0,p||q(this,e,a,4,2147483647,-2147483648),R.TYPED_ARRAY_SUPPORT?(this[a]=255&e,this[a+1]=e>>>8,this[a+2]=e>>>16,this[a+3]=e>>>24):K(this,e,a,!0),a+4},R.prototype.writeInt32BE=function(e,a,p){return e=+e,a|=0,p||q(this,e,a,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),R.TYPED_ARRAY_SUPPORT?(this[a]=e>>>24,this[a+1]=e>>>16,this[a+2]=e>>>8,this[a+3]=255&e):K(this,e,a,!1),a+4},R.prototype.writeFloatLE=function(e,a,p){return W(this,e,a,!0,p)},R.prototype.writeFloatBE=function(e,a,p){return W(this,e,a,!1,p)},R.prototype.writeDoubleLE=function(e,a,p){return $(this,e,a,!0,p)},R.prototype.writeDoubleBE=function(e,a,p){return $(this,e,a,!1,p)},R.prototype.copy=function(e,a,p,d){if(p=p||0,d||0===d||(d=this.length),a>=e.length&&(a=e.length),(d=0=this.length)throw new RangeError("sourceStart out of bounds");if(d<0)throw new RangeError("sourceEnd out of bounds");d>this.length&&(d=this.length);var t,i=(d=e.length-a>>=0,p=void 0===p?this.length:p>>>0,"number"==typeof(e=e||0))for(n=a;n>6|192,63&p|128)}else if(p<65536){if((a-=3)<0)break;i.push(p>>12|224,p>>6&63|128,63&p|128)}else{if(!(p<1114112))throw new Error("Invalid code point");if((a-=4)<0)break;i.push(p>>18|240,p>>12&63|128,p>>6&63|128,63&p|128)}}return i}function J(e){return function(e){var a;v||w();var p=e.length;if(0>16&255,t[r++]=a>>8&255,t[r++]=255&a;return 2==d?(a=c[e.charCodeAt(n)]<<2|c[e.charCodeAt(n+1)]>>4,t[r++]=255&a):1==d&&(a=c[e.charCodeAt(n)]<<10|c[e.charCodeAt(n+1)]<<4|c[e.charCodeAt(n+2)]>>2,t[r++]=a>>8&255,t[r++]=255&a),t}(function(e){var a;if((e=((a=e).trim?a.trim():a.replace(/^\s+|\s+$/g,"")).replace(G,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Q(e,a,p,d){for(var t=0;t=a.length||t>=e.length);++t)a[t+p]=e[t];return t}function ee(e){return null!=e&&(!!e._isBuffer||ae(e)||"function"==typeof(e=e).readFloatLE&&"function"==typeof e.slice&&ae(e.slice(0,0)))}function ae(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var pe=p(Object.freeze({__proto__:null,Buffer:R,INSPECT_MAX_BYTES:50,SlowBuffer:function(e){return R.alloc(+(e=+e!=e?0:e))},isBuffer:ee,kMaxLength:T}));function de(){}function te(){te.init.call(this)}function ie(e){return void 0===e._maxListeners?te.defaultMaxListeners:e._maxListeners}function re(e,a,p,d){var t,i;if("function"!=typeof p)throw new TypeError('"listener" argument must be a function');return(t=e._events)?(t.newListener&&(e.emit("newListener",a,p.listener||p),t=e._events),i=t[a]):(t=e._events=new de,e._eventsCount=0),i?("function"==typeof i?i=t[a]=d?[p,i]:[i,p]:d?i.unshift(p):i.push(p),i.warned||(d=ie(e))&&0d&&(i.warned=!0,(d=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+a+" listeners added. Use emitter.setMaxListeners() to increase limit")).name="MaxListenersExceededWarning",d.emitter=e,d.type=a,d.count=i.length,d=d,"function"==typeof console.warn?console.warn(d):console.log(d))):(i=t[a]=p,++e._eventsCount),e}function ne(e,a,p){var d=!1;function t(){e.removeListener(a,t),d||(d=!0,p.apply(e,arguments))}return t.listener=p,t}function le(e){var a=this._events;if(a){e=a[e];if("function"==typeof e)return 1;if(e)return e.length}return 0}function me(e,a){for(var p=new Array(a);a--;)p[a]=e[a];return p}function oe(){throw new Error("setTimeout has not been defined")}function se(){throw new Error("clearTimeout has not been defined")}de.prototype=Object.create(null),(te.EventEmitter=te).usingDomains=!1,te.prototype.domain=void 0,te.prototype._events=void 0,te.prototype._maxListeners=void 0,te.defaultMaxListeners=10,te.init=function(){this.domain=null,te.usingDomains&&(void 0).active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new de,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},te.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},te.prototype.getMaxListeners=function(){return ie(this)},te.prototype.emit=function(e){var a,p,d,t="error"===e,i=this._events;if(i)t=t&&null==i.error;else if(!t)return!1;if(r=this.domain,t){if(t=arguments[1],r)return(t=t||new Error('Uncaught, unspecified "error" event')).domainEmitter=this,t.domain=r,t.domainThrown=!1,r.emit("error",t),!1;if(t instanceof Error)throw t;var r=new Error('Uncaught, unspecified "error" event. ('+t+")");throw r.context=t,r}if(!(a=i[e]))return!1;var n,l="function"==typeof a;switch(n=arguments.length){case 1:!function(e,a,p){if(a)e.call(p);else for(var d=e.length,t=me(e,d),i=0;i>>0),p=this.head,d=0;p;)p.data.copy(a,d),d+=p.data.length,p=p.next;return a};var aa=R.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function pa(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!aa(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=ta;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=ia;break;default:return void(this.write=da)}this.charBuffer=new R(6),this.charReceived=0,this.charLength=0}function da(e){return e.toString(this.encoding)}function ta(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function ia(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}pa.prototype.write=function(e){for(var a="";this.charLength;){var p=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,p),this.charReceived+=p,this.charReceived>5==6){this.charLength=2;break}if(a<=2&&p>>4==14){this.charLength=3;break}if(a<=3&&p>>3==30){this.charLength=4;break}}this.charReceived=a},pa.prototype.end=function(e){var a,p,d="";return e&&e.length&&(d=this.write(e)),this.charReceived&&(a=this.charReceived,p=this.charBuffer,e=this.encoding,d+=p.slice(0,a).toString(e)),d},ma.ReadableState=la;var ra,na=(Ke(Be)&&(Be=""),ra=(ra="stream").toUpperCase(),Pe[ra]||(new RegExp("\\b"+ra+"\\b","i").test(Be)?Pe[ra]=function(){var e=function(e){if(!He(e)){for(var a=[],p=0;pa.highWaterMark&&(a.highWaterMark=(sa<=(p=e)?p=sa:(p--,p|=p>>>1,p|=p>>>2,p|=p>>>4,p|=p>>>8,p|=p>>>16,p++),p)),e<=a.length?e:a.ended?a.length:(a.needReadable=!0,0));var p}function ha(e){var a=e._readableState;a.needReadable=!1,a.emittedReadable||(na("emitReadable",a.flowing),a.emittedReadable=!0,a.sync?ye(ca,e):ca(e))}function ca(e){na("emit readable"),e.emit("readable"),_a(e)}function fa(e,a){for(var p=a.length;!a.reading&&!a.flowing&&!a.ended&&a.length=a.length?(p=a.decoder?a.buffer.join(""):1===a.buffer.length?a.buffer.head.data:a.buffer.concat(a.length),a.buffer.clear()):p=function(e,a,p){var d;ei.length?i.length:e;if(r===i.length?t+=i:t+=i.slice(0,e),0===(e-=r)){r===i.length?(++d,p.next?a.head=p.next:a.head=a.tail=null):(a.head=p).data=i.slice(r);break}++d}return a.length-=d,t}:function(e,a){var p=R.allocUnsafe(e),d=a.head,t=1;d.data.copy(p),e-=d.data.length;for(;d=d.next;){var i=d.data,r=e>i.length?i.length:e;if(i.copy(p,p.length-e,0,r),0===(e-=r)){r===i.length?(++t,d.next?a.head=d.next:a.head=a.tail=null):(a.head=d).data=i.slice(r);break}++t}return a.length-=t,p})(e,a);return d}(e,a.buffer,a.decoder),p);var p}function ba(e){var a=e._readableState;if(0=a.highWaterMark||a.ended))return na("read: emitReadable",a.length,a.ended),(0===a.length&&a.ended?ba:ha)(this),null;if(0===(e=ua(e,a))&&a.ended)return 0===a.length&&ba(this),null;var d=a.needReadable;return na("need readable",d),(0===a.length||a.length-ea._pos){var d=p.substr(a._pos);if("x-user-defined"===a._charset){for(var t=new R(d.length),i=0;ia._pos&&(a.push(new R(new Uint8Array(r.result.slice(a._pos)))),a._pos=r.result.byteLength)},r.onload=function(){a.push(null)},r.readAsArrayBuffer(p)}a._xhr.readyState===pp&&"ms-stream"!==a._mode&&a.push(null)},De(tp,Va);var ip=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];tp.prototype.setHeader=function(e,a){var p=e.toLowerCase();-1===ip.indexOf(p)&&(this._headers[p]={name:e,value:a})},tp.prototype.getHeader=function(e){return this._headers[e.toLowerCase()].value},tp.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},tp.prototype._onFinish=function(){var a=this;if(!a._destroyed){var e,p=a._opts,d=a._headers;if("POST"!==p.method&&"PUT"!==p.method&&"PATCH"!==p.method||(e=function(){if(void 0!==Ha)return Ha;try{new u.Blob([new ArrayBuffer(1)]),Ha=!0}catch(e){Ha=!1}return Ha}()?new u.Blob(a._body.map(function(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if("function"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(ee(e)){for(var a=new Uint8Array(e.length),p=e.length,d=0;d= 0x80 (not a basic code point)","invalid-input":"Invalid input"},gp=np-lp,bp=Math.floor,yp=String.fromCharCode;function Sp(e){throw new RangeError(_p[e])}function Np(e,a){for(var p=e.length,d=[];p--;)d[p]=a(e[p]);return d}function Tp(e,a){var p=e.split("@"),d="";return 1>>10&1023|55296),e=56320|1023&e),a+=yp(e)}).join("")}function Ap(e,a){return e+22+75*(e<26)-((0!=a)<<5)}function Ep(e,a,p){var d=0;for(e=p?bp(e/sp):e>>1,e+=bp(e/a);gp*mp>>1bp((rp-o)/i))&&Sp("overflow"),o+=n*i,!(n<(n=r<=u?lp:u+mp<=r?mp:r-u));r+=np)i>bp(rp/(n=np-n))&&Sp("overflow"),i*=n;u=Ep(o-t,a=l.length+1,0==t),bp(o/a)>rp-s&&Sp("overflow"),s+=bp(o/a),o%=a,l.splice(o++,0,s)}return Vp(l)}function Rp(e){for(var a,p,d,t,i,r,n,l,m,o,s=[],u=(e=Dp(e)).length,h=hp,c=up,f=a=0;fbp((rp-a)/(l=p+1))&&Sp("overflow"),a+=(t-h)*l,h=t,f=0;frp&&Sp("overflow"),n==h){for(i=a,r=np;!(i<(m=r<=c?lp:c+mp<=r?mp:r-c));r+=np)s.push(yp(Ap(m+(o=i-m)%(m=np-m),0))),i=bp(o/m);s.push(yp(Ap(i,0))),c=Ep(a,l,p==d),a=0,++p}++a,++h}return s.join("")}function xp(e){return Tp(e,function(e){return fp.test(e)?kp(e.slice(4).toLowerCase()):e})}function Cp(e){return Tp(e,function(e){return vp.test(e)?"xn--"+Rp(e):e})}Ee={decode:Dp,encode:Vp},ke=Object.freeze({__proto__:null,decode:kp,encode:Rp,toUnicode:xp,toASCII:Cp,version:"1.4.1",ucs2:Ee,default:{version:"1.4.1",ucs2:Ee,toASCII:Cp,toUnicode:xp,encode:Rp,decode:kp}});var Op=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function Lp(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}}function Bp(e,a){if(e.map)return e.map(a);for(var p=[],d=0;d",'"',"`"," ","\r","\n","\t"]),Mp=["'"].concat(Ae),Zp=["%","/","?",";","#"].concat(Mp),qp=["/","?","#"],Hp=255,Kp=/^[+a-z0-9A-Z_-]{0,63}$/,Yp=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Wp={javascript:!0,"javascript:":!0},$p={javascript:!0,"javascript:":!0},Gp={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Xp(e,a,p){if(e&&We(e)&&e instanceof Fp)return e;var d=new Fp;return d.parse(e,a,p),d}function Jp(e,a,p,d){if(!He(a))throw new TypeError("Parameter 'url' must be a string, not "+typeof a);var t=a.indexOf("?"),i=-1!==t&&tHp?e.hostname="":e.hostname=e.hostname.toLowerCase(),s||(e.hostname=Cp(e.hostname));var S=e.port?":"+e.port:"",N=e.hostname||"";e.host=N+S,e.href+=e.host,s&&(e.hostname=e.hostname.substr(1,e.hostname.length-2),"/"!==r[0]&&(r="/"+r))}if(!Wp[V])for(h=0,c=Mp.length;hi)throw new TypeError("Argument is not in byte range");return p}if(!isNaN(p)&&a.clamp)return p=(a=p)%1==.5&&0==(1&a)?Math.floor(a):Math.round(a),pi&&(p=i),p;if(!Number.isFinite(p)||0===p)return 0;if(p=id(p)*Math.floor(Math.abs(p)),p%=r,!d.unsigned&&p>=n)return p-r;if(d.unsigned)if(p<0)p+=r;else if(-0===p)return 0;return p}}Ae.void=function(){},Ae.boolean=function(e){return!!e},Ae.byte=rd(8,{unsigned:!1}),Ae.octet=rd(8,{unsigned:!0}),Ae.short=rd(16,{unsigned:!1}),Ae["unsigned short"]=rd(16,{unsigned:!0}),Ae.long=rd(32,{unsigned:!1}),Ae["unsigned long"]=rd(32,{unsigned:!0}),Ae["long long"]=rd(32,{unsigned:!1,moduloBitLength:64}),Ae["unsigned long long"]=rd(32,{unsigned:!0,moduloBitLength:64}),Ae.double=function(e){e=+e;if(!Number.isFinite(e))throw new TypeError("Argument is not a finite floating-point value");return e},Ae["unrestricted double"]=function(e){e=+e;if(isNaN(e))throw new TypeError("Argument is NaN");return e},Ae.float=Ae.double,Ae["unrestricted float"]=Ae["unrestricted double"],Ae.DOMString=function(e,a){return(a=a||{}).treatNullAsEmptyString&&null===e?"":String(e)},Ae.ByteString=function(e,a){const p=String(e);var d;for(let e=0;void 0!==(d=p.codePointAt(e));++e)if(255=e)return t;t[0][0]>e?p=d-1:a=d+1}return null}var wd=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;function _d(e){return e.replace(wd,"_").length}var gd=/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2D]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDE2C-\uDE37\uDEDF-\uDEEA\uDF01-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDE30-\uDE40\uDEAB-\uDEB7]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD83A[\uDCD0-\uDCD6]|\uDB40[\uDD00-\uDDEF]/;function bd(e,a,p){var d=function(e,a,p){for(var d=!1,t="",i=_d(e),r=0;r=Math.pow(256,5-p.length))return m;let t=p.pop(),i=0;for(const n of p)t+=n*Math.pow(256,3-i),++i;return t}function N(a){let p="";var d,t=function(a){let p=null,d=1,t=null,i=0;for(let e=0;ed&&(p=t,d=i),t=null,i=0):(null===t&&(t=e),++i);i>d&&(p=t,d=i);return{idx:p,len:d}}(a).idx;let i=!1;for(let e=0;e<=7;++e)i&&0===a[e]||(i=i&&!1,t!==e?(p+=a[e].toString(16),7!==e&&(p+=":")):(d=0===e?"::":":",p+=d,i=!0));return p}function T(e,a){if("["===e[0])return"]"!==e[e.length-1]?m:function(d){const t=[0,0,0,0,0,0,0,0];let i=0,a=null,r=0;if(58===(d=l.ucs2.decode(d))[r]){if(58!==d[r+1])return m;r+=2,++i,a=i}for(;rMath.pow(2,16)-1)return this.parseError=!0,m;this.url.port=a===(e=this.url.scheme,t[e])?null:a,this.buffer=""}if(this.stateOverride)return!1;this.state="path start",--this.pointer}return!0};const k=new Set([47,92,63,35]);E.prototype["parse file"]=function(e){var a;return this.url.scheme="file",47===e||92===e?(92===e&&(this.parseError=!0),this.state="file slash"):null!==this.base&&"file"===this.base.scheme?isNaN(e)?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query=this.base.query):63===e?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query="",this.state="query"):35===e?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query=this.base.query,this.url.fragment="",this.state="fragment"):(this.input.length-this.pointer-1==0||(a=this.input[this.pointer+1],!r(e)||58!==a&&124!==a)||2<=this.input.length-this.pointer-1&&!k.has(this.input[this.pointer+2])?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),V(this.url)):this.parseError=!0,this.state="path",--this.pointer):(this.state="path",--this.pointer),!0},E.prototype["parse file slash"]=function(e){return 47===e||92===e?(92===e&&(this.parseError=!0),this.state="file host"):(null!==this.base&&"file"===this.base.scheme&&(2===(e=this.base.path[0]).length&&r(e.codePointAt(0))&&":"===e[1]?this.url.path.push(this.base.path[0]):this.url.host=this.base.host),this.state="path",--this.pointer),!0},E.prototype["parse file host"]=function(e,a){if(isNaN(e)||47===e||92===e||63===e||35===e)if(--this.pointer,!this.stateOverride&&h(this.buffer))this.parseError=!0,this.state="path";else if(""===this.buffer){if(this.url.host="",this.stateOverride)return!1;this.state="path start"}else{let e=T(this.buffer,f(this.url));if(e===m)return m;if("localhost"===e&&(e=""),this.url.host=e,this.stateOverride)return!1;this.buffer="",this.state="path start"}else this.buffer+=a;return!0},E.prototype["parse path start"]=function(e){return f(this.url)?(92===e&&(this.parseError=!0),this.state="path",47!==e&&92!==e&&--this.pointer):this.stateOverride||63!==e?this.stateOverride||35!==e?void 0!==e&&(this.state="path",47!==e&&--this.pointer):(this.url.fragment="",this.state="fragment"):(this.url.query="",this.state="query"),!0},E.prototype["parse path"]=function(e){if(isNaN(e)||47===e||f(this.url)&&92===e||!this.stateOverride&&(63===e||35===e)){if(f(this.url)&&92===e&&(this.parseError=!0),".."===(a=(a=this.buffer).toLowerCase())||"%2e."===a||".%2e"===a||"%2e%2e"===a?(V(this.url),47===e||f(this.url)&&92===e||this.url.path.push("")):!n(this.buffer)||47===e||f(this.url)&&92===e?n(this.buffer)||("file"===this.url.scheme&&0===this.url.path.length&&h(this.buffer)&&(""!==this.url.host&&null!==this.url.host&&(this.parseError=!0,this.url.host=""),this.buffer=this.buffer[0]+":"),this.url.path.push(this.buffer)):this.url.path.push(""),this.buffer="","file"===this.url.scheme&&(void 0===e||63===e||35===e))for(;1>>7)]}function st(e,a){e.pending_buf[e.pending++]=255&a,e.pending_buf[e.pending++]=a>>>8&255}function ut(e,a,p){e.bi_valid>Zd-p?(e.bi_buf|=a<>Zd-e.bi_valid,e.bi_valid+=p-Zd):(e.bi_buf|=a<>>=1,p<<=1,0<--a;);return p>>>1}function ft(e,a,p){for(var d,t=new Array(Md+1),i=0,r=1;r<=Md;r++)t[r]=i=i+p[r-1]<<1;for(d=0;d<=a;d++){var n=e[2*d+1];0!==n&&(e[2*d]=ct(t[n]++,n))}}function vt(e){for(var a=0;a>1;1<=p;p--)gt(e,i,p);for(t=l;p=e.heap[1],e.heap[1]=e.heap[e.heap_len--],gt(e,i,1),d=e.heap[1],e.heap[--e.heap_max]=p,e.heap[--e.heap_max]=d,i[2*t]=i[2*p]+i[2*d],e.depth[t]=(e.depth[p]>=e.depth[d]?e.depth[p]:e.depth[d])+1,i[2*p+1]=i[2*d+1]=t,e.heap[1]=t++,gt(e,i,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,a){for(var p,d,t,i,r,n=a.dyn_tree,l=a.max_code,m=a.stat_desc.static_tree,o=a.stat_desc.has_stree,s=a.stat_desc.extra_bits,u=a.stat_desc.extra_base,h=a.stat_desc.max_length,c=0,f=0;f<=Md;f++)e.bl_count[f]=0;for(n[2*e.heap[e.heap_max]+1]=0,p=e.heap_max+1;p>=7;i>=8,e.bi_valid-=8)}function Et(e,a,p,d){var t,i,r=0;0>>=1)if(1&a&&0!==e.dyn_ltree[2*p])return kd;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return Rd;for(p=32;p>>3,(i=e.static_len+3+7>>>3)<=t&&(t=i)):t=i=p+5,p+4<=t&&-1!==a?Vt(e,a,p,d):e.strategy===Ed||i===t?(ut(e,(Ld<<1)+(d?1:0),3),bt(e,Qd,et)):(ut(e,(Bd<<1)+(d?1:0),3),function(e,a,p,d){var t;for(ut(e,a-257,5),ut(e,p-1,5),ut(e,d-4,4),t=0;t>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&a,e.pending_buf[e.l_buf+e.last_lit]=255&p,e.last_lit++,0===a?e.dyn_ltree[2*p]++:(e.matches++,a--,e.dyn_ltree[2*(pt[p]+Ud+1)]++,e.dyn_dtree[2*ot(a)]++),e.last_lit===e.lit_bufsize-1}function Rt(e,a,p,d){for(var t=65535&e|0,i=e>>>16&65535|0,r=0;0!==p;){for(p-=r=2e3>>1:p>>>1;e[a]=p}return e}();function Ct(e,a,p,d){var t=xt,i=d+p;e^=-1;for(var r=d;r>>8^t[255&(e^a[r])];return-1^e}var Ot=0,Lt=1,Bt=3,Pt=4,Ut=5,Ft=0,It=1,jt=-2,zt=-3,Mt=-5,Zt=-1,qt=1,Ht=2,Kt=3,Yt=4,Wt=2,$t=8,Gt=9,Xt=286,Jt=30,Qt=19,ei=2*Xt+1,ai=15,pi=3,di=258,ti=di+pi+1,ii=32,ri=42,ni=69,li=73,mi=91,oi=103,si=113,ui=666,hi=1,ci=2,fi=3,vi=4,wi=3;function _i(e,a){return e.msg=Sd[a],a}function gi(e){return(e<<1)-(4e.avail_out?e.avail_out:p)&&(Td(e.output,a.pending_buf,a.pending_out,p,e.next_out),e.next_out+=p,a.pending_out+=p,e.total_out+=p,e.avail_out-=p,a.pending-=p,0===a.pending&&(a.pending_out=0))}function Si(e,a){Et(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,a),e.block_start=e.strstart,yi(e.strm)}function Ni(e,a){e.pending_buf[e.pending++]=a}function Ti(e,a){e.pending_buf[e.pending++]=a>>>8&255,e.pending_buf[e.pending++]=255&a}function Di(e,a){var p,d,t=e.max_chain_length,i=e.strstart,r=e.prev_length,n=e.nice_match,l=e.strstart>e.w_size-ti?e.strstart-(e.w_size-ti):0,m=e.window,o=e.w_mask,s=e.prev,u=e.strstart+di,h=m[i+r-1],c=m[i+r];e.prev_length>=e.good_match&&(t>>=2),n>e.lookahead&&(n=e.lookahead);do{if(m[(p=a)+r]===c&&m[p+r-1]===h&&m[p]===m[i]&&m[++p]===m[i+1]){for(i+=2,p++;m[++i]===m[++p]&&m[++i]===m[++p]&&m[++i]===m[++p]&&m[++i]===m[++p]&&m[++i]===m[++p]&&m[++i]===m[++p]&&m[++i]===m[++p]&&m[++i]===m[++p]&&il&&0!=--t);return r<=e.lookahead?r:e.lookahead}function Vi(e){var a,p,d,t,i,r,n,l,m,o=e.w_size;do{if(m=e.window_size-e.lookahead-e.strstart,e.strstart>=o+(o-ti)){for(Td(e.window,e.window,o,o,0),e.match_start-=o,e.strstart-=o,e.block_start-=o,a=p=e.hash_size;d=e.head[--a],e.head[a]=o<=d?d-o:0,--p;);for(a=p=o;d=e.prev[--a],e.prev[a]=o<=d?d-o:0,--p;);m+=o}if(0===e.strm.avail_in)break;if(i=e.strm,r=e.window,n=e.strstart+e.lookahead,l=m,m=void 0,m=i.avail_in,p=0===(m=l=pi)for(t=e.strstart-e.insert,e.ins_h=e.window[t],e.ins_h=(e.ins_h<=pi&&(e.ins_h=(e.ins_h<=pi)if(d=kt(e,e.strstart-e.match_start,e.match_length-pi),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=pi){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=pi&&(e.ins_h=(e.ins_h<=pi&&e.match_length<=e.prev_length){for(t=e.strstart+e.lookahead-pi,d=kt(e,e.strstart-1-e.prev_match,e.prev_length-pi),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=t&&(e.ins_h=(e.ins_h<>8&255),Ni(p,p.gzhead.time>>16&255),Ni(p,p.gzhead.time>>24&255),Ni(p,9===p.level?2:p.strategy>=Ht||p.level<2?4:0),Ni(p,255&p.gzhead.os),p.gzhead.extra&&p.gzhead.extra.length&&(Ni(p,255&p.gzhead.extra.length),Ni(p,p.gzhead.extra.length>>8&255)),p.gzhead.hcrc&&(e.adler=Ct(e.adler,p.pending_buf,p.pending,0)),p.gzindex=0,p.status=ni):(Ni(p,0),Ni(p,0),Ni(p,0),Ni(p,0),Ni(p,0),Ni(p,9===p.level?2:p.strategy>=Ht||p.level<2?4:0),Ni(p,wi),p.status=si)):(i=$t+(p.w_bits-8<<4)<<8,i|=(p.strategy>=Ht||p.level<2?0:p.level<6?1:6===p.level?2:3)<<6,0!==p.strstart&&(i|=ii),i+=31-i%31,p.status=si,Ti(p,i),0!==p.strstart&&(Ti(p,e.adler>>>16),Ti(p,65535&e.adler)),e.adler=1)),p.status===ni)if(p.gzhead.extra){for(d=p.pending;p.gzindex<(65535&p.gzhead.extra.length)&&(p.pending!==p.pending_buf_size||(p.gzhead.hcrc&&p.pending>d&&(e.adler=Ct(e.adler,p.pending_buf,p.pending-d,d)),yi(e),d=p.pending,p.pending!==p.pending_buf_size));)Ni(p,255&p.gzhead.extra[p.gzindex]),p.gzindex++;p.gzhead.hcrc&&p.pending>d&&(e.adler=Ct(e.adler,p.pending_buf,p.pending-d,d)),p.gzindex===p.gzhead.extra.length&&(p.gzindex=0,p.status=li)}else p.status=li;if(p.status===li)if(p.gzhead.name){d=p.pending;do{if(p.pending===p.pending_buf_size&&(p.gzhead.hcrc&&p.pending>d&&(e.adler=Ct(e.adler,p.pending_buf,p.pending-d,d)),yi(e),d=p.pending,p.pending===p.pending_buf_size)){t=1;break}}while(t=p.gzindexd&&(e.adler=Ct(e.adler,p.pending_buf,p.pending-d,d)),0===t&&(p.gzindex=0,p.status=mi)}else p.status=mi;if(p.status===mi)if(p.gzhead.comment){d=p.pending;do{if(p.pending===p.pending_buf_size&&(p.gzhead.hcrc&&p.pending>d&&(e.adler=Ct(e.adler,p.pending_buf,p.pending-d,d)),yi(e),d=p.pending,p.pending===p.pending_buf_size)){t=1;break}}while(t=p.gzindexd&&(e.adler=Ct(e.adler,p.pending_buf,p.pending-d,d)),0===t&&(p.status=oi)}else p.status=oi;if(p.status===oi&&(p.gzhead.hcrc?(p.pending+2>p.pending_buf_size&&yi(e),p.pending+2<=p.pending_buf_size&&(Ni(p,255&e.adler),Ni(p,e.adler>>8&255),e.adler=0,p.status=si)):p.status=si),0!==p.pending){if(yi(e),0===e.avail_out)return p.last_flush=-1,Ft}else if(0===e.avail_in&&gi(a)<=gi(r)&&a!==Pt)return _i(e,Mt);if(p.status===ui&&0!==e.avail_in)return _i(e,Mt);if(0!==e.avail_in||0!==p.lookahead||a!==Ot&&p.status!==ui){var r=p.strategy===Ht?function(e,a){for(var p;;){if(0===e.lookahead&&(Vi(e),0===e.lookahead)){if(a===Ot)return hi;break}if(e.match_length=0,p=kt(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,p&&(Si(e,!1),0===e.strm.avail_out))return hi}return e.insert=0,a===Pt?(Si(e,!0),0===e.strm.avail_out?fi:vi):e.last_lit&&(Si(e,!1),0===e.strm.avail_out)?hi:ci}(p,a):p.strategy===Kt?function(e,a){for(var p,d,t,i,r=e.window;;){if(e.lookahead<=di){if(Vi(e),e.lookahead<=di&&a===Ot)return hi;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=pi&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=pi?(p=kt(e,1,e.match_length-pi),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(p=kt(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),p&&(Si(e,!1),0===e.strm.avail_out))return hi}return e.insert=0,a===Pt?(Si(e,!0),0===e.strm.avail_out?fi:vi):e.last_lit&&(Si(e,!1),0===e.strm.avail_out)?hi:ci}(p,a):Oi[p.level].func(p,a);if(r!==fi&&r!==vi||(p.status=ui),r===hi||r===fi)return 0===e.avail_out&&(p.last_flush=-1),Ft;if(r===ci&&(a===Lt?At(p):a!==Ut&&(Vt(p,0,0,!1),a===Bt&&(bi(p.head),0===p.lookahead&&(p.strstart=0,p.block_start=0,p.insert=0))),yi(e),0===e.avail_out))return p.last_flush=-1,Ft}return a!==Pt?Ft:p.wrap<=0?It:(2===p.wrap?(Ni(p,255&e.adler),Ni(p,e.adler>>8&255),Ni(p,e.adler>>16&255),Ni(p,e.adler>>24&255),Ni(p,255&e.total_in),Ni(p,e.total_in>>8&255),Ni(p,e.total_in>>16&255),Ni(p,e.total_in>>24&255)):(Ti(p,e.adler>>>16),Ti(p,65535&e.adler)),yi(e),0e.pending_buf_size-5&&(p=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Vi(e),0===e.lookahead&&a===Ot)return hi;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var d=e.block_start+p;if((0===e.strstart||e.strstart>=d)&&(e.lookahead=e.strstart-d,e.strstart=d,Si(e,!1),0===e.strm.avail_out))return hi;if(e.strstart-e.block_start>=e.w_size-ti&&(Si(e,!1),0===e.strm.avail_out))return hi}return e.insert=0,a===Pt?(Si(e,!0),0===e.strm.avail_out?fi:vi):(e.strstart>e.block_start&&(Si(e,!1),e.strm.avail_out),hi)}),new ki(4,4,8,4,Ai),new ki(4,5,16,8,Ai),new ki(4,6,32,32,Ai),new ki(4,4,16,16,Ei),new ki(8,16,32,32,Ei),new ki(8,16,128,128,Ei),new ki(8,32,128,256,Ei),new ki(32,128,258,1024,Ei),new ki(32,258,258,4096,Ei)],Li=30,Bi=12;var Pi=15,Ui=852,Fi=592,Ii=0,ji=1,zi=2,Mi=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Zi=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],qi=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],Hi=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];function Ki(e,a,p,d,t,i,r,n){for(var l,m,o,s,u,h,c,f,v,w=n.bits,_=0,g=0,b=0,y=0,S=0,N=0,T=0,D=0,V=0,A=0,E=null,k=0,R=new Vd(Pi+1),x=new Vd(Pi+1),C=null,O=0,_=0;_<=Pi;_++)R[_]=0;for(g=0;gh?(f=C[O+r[g]],E[k+r[g]]):(f=96,0),l=1<<(c=_-T),b=m=1<>T)+(m-=l)]=c<<24|f<<16|v|0,0!==m;);for(l=1<<_-1;A&l;)l>>=1;if(0!==l?(A&=l-1,A+=l):A=0,g++,0==--R[_]){if(_===y)break;_=a[p+r[g]]}if(S<_&&(A&s)!==o){for(u+=b,D=1<<(N=_-(T=0===T?S:T));N+T>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function Mr(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Vd(320),this.work=new Vd(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Zr(e){var a;return e&&e.state?((a=e.state).wsize=0,a.whave=0,a.wnext=0,(a=e)&&a.state?(e=a.state,a.total_in=a.total_out=e.total=0,a.msg="",e.wrap&&(a.adler=1&e.wrap),e.mode=nr,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Ad(Ir),e.distcode=e.distdyn=new Ad(jr),e.sane=1,e.back=-1,Qi):pr):pr}function qr(e,a){var p,d,t;return e?(p=new Mr,(e.state=p).window=null,d=a,(p=(p=e)&&p.state?(a=p.state,d<0?(t=0,d=-d):(t=1+(d>>4),d<48&&(d&=15)),d&&(d<8||15>>8&255,p.check=Ct(p.check,C,2,0),o=m=0,p.mode=lr;break}if(p.flags=0,p.head&&(p.head.done=!1),!(1&p.wrap)||(((255&m)<<8)+(m>>8))%31){e.msg="incorrect header check",p.mode=Pr;break}if((15&m)!==rr){e.msg="unknown compression method",p.mode=Pr;break}if(o-=4,S=8+(15&(m>>>=4)),0===p.wbits)p.wbits=S;else if(S>p.wbits){e.msg="invalid window size",p.mode=Pr;break}p.dmax=1<>8&1),512&p.flags&&(C[0]=255&m,C[1]=m>>>8&255,p.check=Ct(p.check,C,2,0)),o=m=0,p.mode=mr;case mr:for(;o<32;){if(0===n)break e;n--,m+=d[i++]<>>8&255,C[2]=m>>>16&255,C[3]=m>>>24&255,p.check=Ct(p.check,C,4,0)),o=m=0,p.mode=or;case or:for(;o<16;){if(0===n)break e;n--,m+=d[i++]<>8),512&p.flags&&(C[0]=255&m,C[1]=m>>>8&255,p.check=Ct(p.check,C,2,0)),o=m=0,p.mode=sr;case sr:if(1024&p.flags){for(;o<16;){if(0===n)break e;n--,m+=d[i++]<>>8&255,p.check=Ct(p.check,C,2,0)),o=m=0}else p.head&&(p.head.extra=null);p.mode=ur;case ur:if(1024&p.flags&&((h=n<(h=p.length)?n:h)&&(p.head&&(S=p.head.extra_len-p.length,p.head.extra||(p.head.extra=new Array(p.head.extra_len)),Td(p.head.extra,d,i,h,S)),512&p.flags&&(p.check=Ct(p.check,d,h,i)),n-=h,i+=h,p.length-=h),p.length))break e;p.length=0,p.mode=hr;case hr:if(2048&p.flags){if(0===n)break e;for(h=0;S=d[i+h++],p.head&&S&&p.length<65536&&(p.head.name+=String.fromCharCode(S)),S&&h>9&1,p.head.done=!0),e.adler=p.check=0,p.mode=_r;break;case vr:for(;o<32;){if(0===n)break e;n--,m+=d[i++]<>>=7&o,o-=7&o,p.mode=Or;break}for(;o<3;){if(0===n)break e;n--,m+=d[i++]<>>=1)){case 0:p.mode=br;break;case 1:if(!function(e){if(Yr){var a;for(Hr=new Ad(512),Kr=new Ad(32),a=0;a<144;)e.lens[a++]=8;for(;a<256;)e.lens[a++]=9;for(;a<280;)e.lens[a++]=7;for(;a<288;)e.lens[a++]=8;for(Ki(Wi,e.lens,0,288,Hr,0,e.work,{bits:9}),a=0;a<32;)e.lens[a++]=5;Ki($i,e.lens,0,32,Kr,0,e.work,{bits:5}),Yr=!1}e.lencode=Hr,e.lenbits=9,e.distcode=Kr,e.distbits=5}(p),p.mode=Vr,a!==Ji)break;m>>>=2,o-=2;break e;case 2:p.mode=Nr;break;case 3:e.msg="invalid block type",p.mode=Pr}m>>>=2,o-=2;break;case br:for(m>>>=7&o,o-=7&o;o<32;){if(0===n)break e;n--,m+=d[i++]<>>16^65535)){e.msg="invalid stored block lengths",p.mode=Pr;break}if(p.length=65535&m,o=m=0,p.mode=yr,a===Ji)break e;case yr:p.mode=Sr;case Sr:if(h=p.length){if(0===(h=l<(h=n>>=5,o-=5,p.ndist=1+(31&m),m>>>=5,o-=5,p.ncode=4+(15&m),m>>>=4,o-=4,286>>=3,o-=3}for(;p.have<19;)p.lens[O[p.have++]]=0;if(p.lencode=p.lendyn,p.lenbits=7,T={bits:p.lenbits},N=Ki(Yi,p.lens,0,19,p.lencode,0,p.work,T),p.lenbits=T.bits,N){e.msg="invalid code lengths set",p.mode=Pr;break}p.have=0,p.mode=Dr;case Dr:for(;p.have>>16&255,_=65535&x,!((v=x>>>24)<=o);){if(0===n)break e;n--,m+=d[i++]<>>=v,o-=v,p.lens[p.have++]=_;else{if(16===_){for(D=v+2;o>>=v,o-=v,0===p.have){e.msg="invalid bit length repeat",p.mode=Pr;break}S=p.lens[p.have-1],h=3+(3&m),m>>>=2,o-=2}else if(17===_){for(D=v+3;o>>=v)),m>>>=3,o-=3}else{for(D=v+7;o>>=v)),m>>>=7,o-=7}if(p.have+h>p.nlen+p.ndist){e.msg="invalid bit length repeat",p.mode=Pr;break}for(;h--;)p.lens[p.have++]=S}}if(p.mode===Pr)break;if(0===p.lens[256]){e.msg="invalid code -- missing end-of-block",p.mode=Pr;break}if(p.lenbits=9,T={bits:p.lenbits},N=Ki(Wi,p.lens,0,p.nlen,p.lencode,0,p.work,T),p.lenbits=T.bits,N){e.msg="invalid literal/lengths set",p.mode=Pr;break}if(p.distbits=6,p.distcode=p.distdyn,T={bits:p.distbits},N=Ki($i,p.lens,p.nlen,p.ndist,p.distcode,0,p.work,T),p.distbits=T.bits,N){e.msg="invalid distances set",p.mode=Pr;break}if(p.mode=Vr,a===Ji)break e;case Vr:p.mode=Ar;case Ar:if(6<=n&&258<=l){e.next_out=r,e.avail_out=l,e.next_in=i,e.avail_in=n,p.hold=m,p.bits=o,function(e,a){var p,d,t,i,r,n,l=e.state,m=e.next_in,o=e.input,s=m+(e.avail_in-5),u=e.next_out,h=e.output,c=u-(a-e.avail_out),f=u+(e.avail_out-257),v=l.dmax,w=l.wsize,_=l.whave,g=l.wnext,b=l.window,y=l.hold,S=l.bits,N=l.lencode,T=l.distcode,D=(1<>>=d=p>>>24,S-=d,0===(d=p>>>16&255))h[u++]=65535&p;else{if(!(16&d)){if(0==(64&d)){p=N[(65535&p)+(y&(1<>>=d,S-=d),S<15&&(y+=o[m++]<>>=d=p>>>24,S-=d,!(16&(d=p>>>16&255))){if(0==(64&d)){p=T[(65535&p)+(y&(1<>>=d,S-=d,(d=u-c)>3)<<3))-1,e.next_in=m-=t,e.next_out=u,e.avail_in=m>>16&255,_=65535&x,!((v=x>>>24)<=o);){if(0===n)break e;n--,m+=d[i++]<>g)])>>>16&255,_=65535&x,!(g+(v=x>>>24)<=o);){if(0===n)break e;n--,m+=d[i++]<>>=g,o-=g,p.back+=g}if(m>>>=v,o-=v,p.back+=v,p.length=_,0===w){p.mode=Cr;break}if(32&w){p.back=-1,p.mode=_r;break}if(64&w){e.msg="invalid literal/length code",p.mode=Pr;break}p.extra=15&w,p.mode=Er;case Er:if(p.extra){for(D=p.extra;o>>=p.extra,o-=p.extra,p.back+=p.extra}p.was=p.length,p.mode=kr;case kr:for(;w=(x=p.distcode[m&(1<>>16&255,_=65535&x,!((v=x>>>24)<=o);){if(0===n)break e;n--,m+=d[i++]<>g)])>>>16&255,_=65535&x,!(g+(v=x>>>24)<=o);){if(0===n)break e;n--,m+=d[i++]<>>=g,o-=g,p.back+=g}if(m>>>=v,o-=v,p.back+=v,64&w){e.msg="invalid distance code",p.mode=Pr;break}p.offset=_,p.extra=15&w,p.mode=Rr;case Rr:if(p.extra){for(D=p.extra;o>>=p.extra,o-=p.extra,p.back+=p.extra}if(p.offset>p.dmax){e.msg="invalid distance too far back",p.mode=Pr;break}p.mode=xr;case xr:if(0===l)break e;if(p.offset>(h=u-l)){if((h=p.offset-h)>p.whave&&p.sane){e.msg="invalid distance too far back",p.mode=Pr;break}c=h>p.wnext?(h-=p.wnext,p.wsize-h):p.wnext-h,h>p.length&&(h=p.length),f=p.window}else f=t,c=r-p.offset,h=p.length;for(l-=h=l=R.wsize?(Td(R.window,A,E-R.wsize,R.wsize,0),R.wnext=0,R.whave=R.wsize):(V=R.wsize-R.wnext,Td(R.window,A,E-k,V=kan.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsan.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelan.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelan.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=an.Z_FILTERED&&e.strategy!=an.Z_HUFFMAN_ONLY&&e.strategy!=an.Z_RLE&&e.strategy!=an.Z_FIXED&&e.strategy!=an.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!R.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new an.Zlib(a);var p=this;this._hadError=!1,this._binding.onerror=function(e,a){p._binding=null,p._hadError=!0;e=new Error(e);e.errno=a,e.code=an.codes[a],p.emit("error",e)};var d=an.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(d=e.level);a=an.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(a=e.strategy),this._binding.init(e.windowBits||an.Z_DEFAULT_WINDOWBITS,d,e.memLevel||an.Z_DEFAULT_MEMLEVEL,a,e.dictionary),this._buffer=new R(this._chunkSize),this._offset=0,this._closed=!1,this._level=d,this._strategy=a,this.once("end",this.close)}Object.keys(pn).forEach(function(e){pn[pn[e]]=e}),De(hn,za),hn.prototype.params=function(e,a,p){if(ean.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(a!=an.Z_FILTERED&&a!=an.Z_HUFFMAN_ONLY&&a!=an.Z_RLE&&a!=an.Z_FIXED&&a!=an.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+a);var d;this._level!==e||this._strategy!==a?(d=this).flush(an.Z_SYNC_FLUSH,function(){d._binding.params(e,a),d._hadError||(d._level=e,d._strategy=a,p&&p())}):Oe.nextTick(p)},hn.prototype.reset=function(){return this._binding.reset()},hn.prototype._flush=function(e){this._transform(new R(0),"",e)},hn.prototype.flush=function(e,a){var p,d=this._writableState;"function"!=typeof e&&(void 0!==e||a)||(a=e,e=an.Z_FULL_FLUSH),d.ended?a&&Oe.nextTick(a):d.ending?a&&this.once("end",a):d.needDrain?(p=this).once("drain",function(){p.flush(a)}):(this._flushFlag=e,this.write(new R(0),"",a))},hn.prototype.close=function(e){var a;e&&Oe.nextTick(e),this._closed||(this._closed=!0,this._binding.close(),a=this,Oe.nextTick(function(){a.emit("close")}))},hn.prototype._transform=function(e,a,p){var d,t=this._writableState,i=(t.ending||t.ended)&&(!e||t.length===e.length);if(null===!e&&!R.isBuffer(e))return p(new Error("invalid input"));i?d=an.Z_FINISH:(d=this._flushFlag,e.length>=t.length&&(this._flushFlag=this._opts.flush||an.Z_NO_FLUSH)),this._processChunk(e,d,p)},hn.prototype._processChunk=function(t,i,r){var n=t&&t.length,l=this._chunkSize-this._offset,m=0,o=this,s="function"==typeof r;if(!s){var a,u=[],h=0;this.on("error",function(e){a=e});do{var e=this._binding.writeSync(i,t,m,n,this._buffer,this._offset,l)}while(!this._hadError&&c(e[0],e[1]));if(this._hadError)throw a;var p=R.concat(u,h);return this.close(),p}p=this._binding.write(i,t,m,n,this._buffer,this._offset,l);function c(e,a){if(!o._hadError){var p,d=l-a;if(!function(e,a){if(!e)throw new Error(a)}(0<=d,"have should not go down"),0=o._chunkSize)&&(l=o._chunkSize,o._offset=0,o._buffer=new R(o._chunkSize)),0===a){if(m+=n-e,n=e,!s)return!0;e=o._binding.write(i,t,m,n,o._buffer,o._offset,o._chunkSize);return e.callback=c,void(e.buffer=t)}if(!s)return!1;r()}}p.buffer=t,p.callback=c},De(rn,hn),De(nn,hn),De(ln,hn),De(mn,hn),De(on,hn),De(sn,hn),De(un,hn);var cn={codes:pn,createDeflate:function(e){return new rn(e)},createInflate:function(e){return new nn(e)},createDeflateRaw:function(e){return new on(e)},createInflateRaw:function(e){return new sn(e)},createGzip:function(e){return new ln(e)},createGunzip:function(e){return new mn(e)},createUnzip:function(e){return new un(e)},deflate:function(e,a,p){return"function"==typeof a&&(p=a,a={}),dn(new rn(a),e,p)},deflateSync:function(e,a){return tn(new rn(a),e)},gzip:function(e,a,p){return"function"==typeof a&&(p=a,a={}),dn(new ln(a),e,p)},gzipSync:function(e,a){return tn(new ln(a),e)},deflateRaw:function(e,a,p){return"function"==typeof a&&(p=a,a={}),dn(new on(a),e,p)},deflateRawSync:function(e,a){return tn(new on(a),e)},unzip:function(e,a,p){return"function"==typeof a&&(p=a,a={}),dn(new un(a),e,p)},unzipSync:function(e,a){return tn(new un(a),e)},inflate:function(e,a,p){return"function"==typeof a&&(p=a,a={}),dn(new nn(a),e,p)},inflateSync:function(e,a){return tn(new nn(a),e)},gunzip:function(e,a,p){return"function"==typeof a&&(p=a,a={}),dn(new mn(a),e,p)},gunzipSync:function(e,a){return tn(new mn(a),e)},inflateRaw:function(e,a,p){return"function"==typeof a&&(p=a,a={}),dn(new sn(a),e,p)},inflateRawSync:function(e,a){return tn(new sn(a),e)},Deflate:rn,Inflate:nn,Gzip:ln,Gunzip:mn,DeflateRaw:on,InflateRaw:sn,Unzip:un,Zlib:hn};const fn=qa.Readable,vn=Symbol("buffer"),wn=Symbol("type");class _n{constructor(){this[wn]="";var e=arguments[0],a=arguments[1];const p=[];let d=0;if(e){var t=e,i=Number(t.length);for(let a=0;ad.size)return n=!0,void a(new gn(`content size at ${d.url} over limit: ${d.size}`,"max-size"));r+=e.length,i.push(e)}}),t.on("end",function(){if(!n){clearTimeout(p);try{e(Buffer.concat(i,r))}catch(e){a(new gn(`Could not create Buffer from response body for ${d.url}: ${e.message}`,"system",e))}}})})}function Dn(e){return"object"==typeof e&&"function"==typeof e.append&&"function"==typeof e.delete&&"function"==typeof e.get&&"function"==typeof e.getAll&&"function"==typeof e.has&&"function"==typeof e.set&&("URLSearchParams"===e.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(e)||"function"==typeof e.sort)}function Vn(e){return"object"==typeof e&&"function"==typeof e.arrayBuffer&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}function An(e){var a,p;let d=e.body;if(e.bodyUsed)throw new Error("cannot clone body after it is used");return d instanceof qa&&"function"!=typeof d.getBoundary&&(a=new Sn,p=new Sn,d.pipe(a),d.pipe(p),e[yn].body=a,d=p),d}function En(e){return null===e?null:"string"==typeof e?"text/plain;charset=UTF-8":Dn(e)?"application/x-www-form-urlencoded;charset=UTF-8":Vn(e)?e.type||null:Buffer.isBuffer(e)||"[object ArrayBuffer]"===Object.prototype.toString.call(e)||ArrayBuffer.isView(e)?null:"function"==typeof e.getBoundary?`multipart/form-data;boundary=${e.getBoundary()}`:e instanceof qa?null:"text/plain;charset=UTF-8"}function kn(e){const a=e.body;return null===a?0:Vn(a)?a.size:Buffer.isBuffer(a)?a.length:a&&"function"==typeof a.getLengthSync&&(a._lengthRetrievers&&0==a._lengthRetrievers.length||a.hasKnownLength&&a.hasKnownLength())?a.getLengthSync():null}Nn.prototype={get body(){return this[yn].body},get bodyUsed(){return this[yn].disturbed},arrayBuffer(){return Tn.call(this).then(function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)})},blob(){let a=this.headers&&this.headers.get("content-type")||"";return Tn.call(this).then(function(e){return Object.assign(new _n([],{type:a.toLowerCase()}),{[vn]:e})})},json(){var a=this;return Tn.call(this).then(function(e){try{return JSON.parse(e.toString())}catch(e){return Nn.Promise.reject(new gn(`invalid json response body at ${a.url} reason: ${e.message}`,"invalid-json"))}})},text(){return Tn.call(this).then(function(e){return e.toString()})},buffer(){return Tn.call(this)},textConverted(){var a=this;return Tn.call(this).then(function(e){return function(e,a){if("function"!=typeof bn)throw new Error("The package `encoding` must be installed to use the textConverted() function");a=a.get("content-type");let p="utf-8",d,t;a&&(d=/charset=([^;]*)/i.exec(a));t=e.slice(0,1024).toString(),!d&&t&&(d=/=u.follow)return s(new gn(`maximum redirect reached at: ${u.url}`,"max-redirect")),void f();const r={headers:new Pn(u.headers),follow:u.follow,counter:u.counter+1,agent:u.agent,compress:u.compress,method:u.method,body:u.body,signal:u.signal,timeout:u.timeout,size:u.size};if(!pl(u.url,e))for(const n of["authorization","www-authenticate","cookie","cookie2"])r.headers.delete(n);return 303!==a.statusCode&&u.body&&null===kn(u)?(s(new gn("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void f()):(303!==a.statusCode&&(301!==a.statusCode&&302!==a.statusCode||"POST"!==u.method)||(r.method="GET",r.body=void 0,r.headers.delete("content-length")),o(dl(new Xn(e,r))),void f())}}a.once("end",function(){h&&h.removeEventListener("abort",v)});let t=a.pipe(new al);const i={url:u.url,status:a.statusCode,statusText:a.statusMessage,headers:p,size:u.size,timeout:u.timeout,counter:u.counter};var e=p.get("Content-Encoding");if(!u.compress||"HEAD"===u.method||null===e||204===a.statusCode||304===a.statusCode)return c=new Zn(t,i),void o(c);d={flush:cn.Z_SYNC_FLUSH,finishFlush:cn.Z_SYNC_FLUSH};if("gzip"==e||"x-gzip"==e)return t=t.pipe(cn.createGunzip(d)),c=new Zn(t,i),void o(c);if("deflate"!=e&&"x-deflate"!=e){if("br"==e&&"function"==typeof cn.createBrotliDecompress)return t=t.pipe(cn.createBrotliDecompress()),c=new Zn(t,i),void o(c);c=new Zn(t,i),o(c)}else{const l=a.pipe(new al);l.once("data",function(e){t=8==(15&e[0])?t.pipe(cn.createInflate()):t.pipe(cn.createInflateRaw()),c=new Zn(t,i),o(c)})}}),function(e,a){const p=a.body;null===p?e.end():Vn(p)?p.stream().pipe(e):Buffer.isBuffer(p)?(e.write(p),e.end()):p.pipe(e)}(d,u)}})}dl.isRedirect=function(e){return 301===e||302===e||303===e||307===e||308===e},dl.Promise=a.Promise;var a=p(Object.freeze({__proto__:null,default:dl,Headers:Pn,Request:Xn,Response:Zn,FetchError:gn})),tl=m,il=tl.__importStar(o),rl=pe;tl.__importDefault(a);var nl=window.fetch.bind(window);!function(e){(a=e.TrustType||(e.TrustType={})).CrossAccount="Cross Account",a.InnerAccount="Inner Account",(r=e.PseudoBoolean||(e.PseudoBoolean={}))[r.True=1]="True",r[r.False=0]="False";var a=(p.prototype.create=function(e){return new p(tl.__assign(tl.__assign({},this.config),e))},p.prototype.getAccounts=function(p){return tl.__awaiter(this,void 0,void 0,function(){var a;return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("getAccounts",p)];case 1:return a=e.sent(),[2,Object.keys(a.accountListRole).map(function(e){return{account:e,role:a.accountListRole[e][0].role,iamKeyActive:a.accountListRole[e][0].iamKeyActive,maxKeyDuration:a.accountListRole[e][0].maxKeyDuration,securityLevel:a.accountListRole[e][0].securityLevel,skypieaAccount:a.accountListRole[e][0].skypieaAccount}})]}})})},p.prototype.getKeys=function(a){return tl.__awaiter(this,void 0,void 0,function(){return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("getKeys",a)];case 1:return[2,i(e.sent(),["accessKey","secretKey","sessionToken","consoleURL"])]}})})},p.prototype.getIAMKeys=function(a){return tl.__awaiter(this,void 0,void 0,function(){return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("getIAMKeys",a)];case 1:return[2,i(e.sent(),["accessKey","secretKey","sessionToken","consoleURL"])]}})})},p.prototype.getAllAWSRoleTypes=function(p){return tl.__awaiter(this,void 0,void 0,function(){var a;return tl.__generator(this,function(e){switch(e.label){case 0:return a=p.getDynamicValues?"allAwsRoleTypes?getDynamicValues=true":"allAwsRoleTypes",[4,this.internalFetch(a,p,"GET")];case 1:return[2,e.sent().roleTypes]}})})},p.prototype.getAWSRoleTypes=function(p){return tl.__awaiter(this,void 0,void 0,function(){var a;return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("getAWSRoleTypes",p)];case 1:return a=e.sent(),[2,JSON.parse(a.roleTypes)]}})})},p.prototype.getNonServiceAWSRoleTypes=function(p){return tl.__awaiter(this,void 0,void 0,function(){var a;return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("getNonServiceAWSRoleTypes",p)];case 1:return a=e.sent(),[2,JSON.parse(a.roleTypes)]}})})},p.prototype.createRole=function(d){return tl.__awaiter(this,void 0,void 0,function(){var a,p;return tl.__generator(this,function(e){switch(e.label){case 0:return a=null!=d.roleType,p=null!=d.trustPolicy,a==p?[3,2]:[4,this.internalFetch("createRole",d)];case 1:return(p=e.sent()).denyArns=p.denyArns.split(","),[2,i(p,["roleArn","denyArns","instanceProfileArn","addedRoleToInstanceProfile","tags"])];case 2:throw new Error("Must include roleType or trustPolicy, but not both.")}})})},p.prototype.createNonServiceRole=function(p){return tl.__awaiter(this,void 0,void 0,function(){var a;return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("createNonServiceRole",p)];case 1:return(a=e.sent()).denyArns=a.denyArns.split(","),[2,i(a,["roleArn","denyArns","instanceProfileArn","addedRoleToInstanceProfile","tags"])]}})})},p.prototype.awsAccountRoles=function(a){return tl.__awaiter(this,void 0,void 0,function(){return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("awsAccountRoles?account="+a.account,a,"GET")];case 1:return[2,e.sent().awsRoleList]}})})},p.prototype.listAWSAccountRoles=function(p){return tl.__awaiter(this,void 0,void 0,function(){var a;return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("listAWSAccountRoles",p)];case 1:return a=e.sent(),[2,JSON.parse(a.jsonAWSRoleList).map(function(e){return e.split("/").slice(-1)[0]})]}})})},p.prototype.getAccountRole=function(p){return tl.__awaiter(this,void 0,void 0,function(){var a;return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("getAccountRole",p)];case 1:if(!(a=e.sent()).roleExists)throw new Error("Role "+p.roleName+" does not exist in this account");return[2,tl.__assign(tl.__assign({},i(a,["roleArn","isMachineIdentity","tags","maxSessionDurationInSeconds"])),{instanceProfileArn:a.instanceProfileARN})]}})})},p.prototype.updateRole=function(p){return tl.__awaiter(this,void 0,void 0,function(){var a;return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("role",p,"PATCH")];case 1:if(!(a=e.sent()).roleExists)throw new Error("Role "+p.roleName+" does not exist in this account");return[2,tl.__assign(tl.__assign({},i(a,["roleArn","isMachineIdentity","tags"])),{instanceProfileArn:a.instanceProfileARN})]}})})},p.prototype.deleteRole=function(a){return tl.__awaiter(this,void 0,void 0,function(){return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("deleteRole",a)];case 1:return e.sent(),[2,!0]}})})},p.prototype.addRoleMachineIdentity=function(a){return tl.__awaiter(this,void 0,void 0,function(){return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("roleMachineIdentity",a)];case 1:return[2,i(e.sent(),["machineIdentityArn"])]}})})},p.prototype.deleteRoleMachineIdentity=function(a){return tl.__awaiter(this,void 0,void 0,function(){return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("roleMachineIdentity",a,"DELETE")];case 1:return[2,i(e.sent(),["machineIdentityArn"])]}})})},p.prototype.getUserAccess=function(p){return tl.__awaiter(this,void 0,void 0,function(){var a;return tl.__generator(this,function(e){switch(e.label){case 0:return a=p.accountId,[4,this.internalFetch("userAccess/"+a,p,"GET")];case 1:return[2,e.sent().users]}})})},p.prototype.getUserAccessByRole=function(p){return tl.__awaiter(this,void 0,void 0,function(){var a;return tl.__generator(this,function(e){switch(e.label){case 0:return a=p.accountId,[4,this.internalFetch("reports/users-by-role?accountId="+a,p,"GET")];case 1:return[2,e.sent().users]}})})},p.prototype.getUserRoleAccess=function(p){return tl.__awaiter(this,void 0,void 0,function(){var a;return tl.__generator(this,function(e){switch(e.label){case 0:return a=p.accountId,[4,this.internalFetch("userAccess/roles/"+a,p)];case 1:return[2,e.sent().roles]}})})},p.prototype.getAccountOwners=function(p){return tl.__awaiter(this,void 0,void 0,function(){var a;return tl.__generator(this,function(e){switch(e.label){case 0:return a=p.accountId,[4,this.internalFetch("userAccess/owners/"+a,p,"GET")];case 1:return[2,e.sent().accountOwners]}})})},p.prototype.createAccessKeys=function(a){return tl.__awaiter(this,void 0,void 0,function(){return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("accessKeys",a)];case 1:return[2,i(e.sent(),["iamUserArn","accessKey","secretKey","addedIAMUserToGroup","tags"])]}})})},p.prototype.getIamUser=function(a){return tl.__awaiter(this,void 0,void 0,function(){return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("iam-users/id/"+a.account+"/"+a.iamUserName,a,"GET")];case 1:return[2,i(e.sent().item,["arn","accountId","userName","accessKey","tags"])]}})})},p.prototype.updateIamUser=function(p){return tl.__awaiter(this,void 0,void 0,function(){var a;return tl.__generator(this,function(e){switch(e.label){case 0:return delete(a=tl.__assign(tl.__assign({},p),{user:{tags:p.tags}})).tags,[4,this.internalFetch("iam-users/id/"+p.account+"/"+p.iamUserName,a,"PATCH")];case 1:return[2,i(e.sent().item,["arn","accountId","userName","accessKey","tags"])]}})})},p.prototype.deleteIAMUser=function(a){return tl.__awaiter(this,void 0,void 0,function(){return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("IAMUser",a,"DELETE")];case 1:return e.sent(),[2,!0]}})})},p.prototype.version=function(a){return tl.__awaiter(this,void 0,void 0,function(){return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("version",a,"GET")];case 1:return[2,i(e.sent(),["version"])]}})})},p.prototype.getLoginRole=function(d){return tl.__awaiter(this,void 0,void 0,function(){var a,p;return tl.__generator(this,function(e){switch(e.label){case 0:return a=d.accountId,p=d.role,[4,this.internalFetch("loginRoles/id/"+a+"/"+p,d,"GET")];case 1:return[2,i(e.sent().loginRole,["account","role","iamKeyActive","maxKeyDuration","securityLevel"])]}})})},p.prototype.getAccessToken=function(a){return tl.__awaiter(this,void 0,void 0,function(){return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("accessToken",a)];case 1:return[2,i(e.sent(),["accessToken","expiresIn"])]}})})},p.prototype.getRefreshTokens=function(a){return tl.__awaiter(this,void 0,void 0,function(){return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("refreshTokens",a,"GET")];case 1:return[2,e.sent().refreshTokens.map(function(e){return i(e,["clientId","id","userId","value"])})]}})})},p.prototype.revoke=function(a){return tl.__awaiter(this,void 0,void 0,function(){return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("revoke",a)];case 1:return[2,"Success"==e.sent().statusMessage]}})})},p.prototype.getCostTotals=function(a){return tl.__awaiter(this,void 0,void 0,function(){return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("costTotals/"+a.accountId,a,"GET")];case 1:return[2,i(e.sent().costTotals,["awsAccountId","yyyy","mm","dd","daily","weekly","monthly","yearly","dailyCostsByService","monthlyCostsByService"])]}})})},p.prototype.internalFetch=function(n,l,m){return void 0===l&&(l={}),void 0===m&&(m="POST"),tl.__awaiter(this,void 0,void 0,function(){var a,p,d,t,i,r;return tl.__generator(this,function(e){switch(e.label){case 0:return a=tl.__assign(tl.__assign({},this.config),l),r=tl.__assign({},a),p={"Content-Type":"application/json","User-Agent":"AlksJS/"+il.version},void 0!==a.accessToken?(p.Authorization="Bearer "+a.accessToken,delete r.accessToken):void 0!==a.accessKey?(p["ALKS-STS-Access-Key"]=a.accessKey,p["ALKS-STS-Secret-Key"]=a.secretKey,p["ALKS-STS-Session-Token"]=a.sessionToken,delete r.accessKey,delete r.secretKey,delete r.sessionToken):void 0!==a.userid&&(console.error("The userid and password properties are deprecated and should be replaced with an access token"),d=function(e){void 0===e&&(e="");return rl.Buffer.from(e).toString("base64")}(a.userid+":"+a.password),p.Authorization="Basic "+d,delete r.userid,delete r.password),a.userAgent&&(p["User-Agent"]+=" "+a.userAgent,delete r.userAgent),[4,a._fetch(a.baseUrl+"/"+n,{method:m,headers:p,credentials:"omit",body:"GET"==m?void 0:JSON.stringify(r)})];case 1:t=e.sent(),e.label=2;case 2:return e.trys.push([2,4,,5]),[4,t.json()];case 3:return i=e.sent(),[3,5];case 4:return r=e.sent(),i={errors:[r.message]},[3,5];case 5:if(!t.ok)throw new o(t,i);return[2,i]}})})},p);function p(e){this.config=e}e.Alks=a;var t,o=(t=Error,tl.__extends(d,t),d);function d(e,a){var p=this,d=Array.isArray(null==a?void 0:a.errors)?a.errors:[];e.statusText&&d.unshift(e.statusText);d=d.join("; ");return(p=t.call(this,d)||this).status=e.status,p.message=d,Object.assign(p,a),p}function i(p,e){return e.reduce(function(e,a){return e[a]=p[a],e},{})}e.AlksError=o;var r=a.prototype.create.call({},{_fetch:nl});e.create=a.prototype.create.bind(r),e.getAccounts=a.prototype.getAccounts.bind(r),e.getKeys=a.prototype.getKeys.bind(r),e.getIAMKeys=a.prototype.getIAMKeys.bind(r),e.getAllAWSRoleTypes=a.prototype.getAllAWSRoleTypes.bind(r),e.getAWSRoleTypes=a.prototype.getAWSRoleTypes.bind(r),e.getNonServiceAWSRoleTypes=a.prototype.getNonServiceAWSRoleTypes.bind(r),e.createRole=a.prototype.createRole.bind(r),e.createNonServiceRole=a.prototype.createNonServiceRole.bind(r),e.awsAccountRoles=a.prototype.awsAccountRoles.bind(r),e.listAWSAccountRoles=a.prototype.listAWSAccountRoles.bind(r),e.getAccountRole=a.prototype.getAccountRole.bind(r),e.updateRole=a.prototype.updateRole.bind(r),e.deleteRole=a.prototype.deleteRole.bind(r),e.addRoleMachineIdentity=a.prototype.addRoleMachineIdentity.bind(r),e.deleteRoleMachineIdentity=a.prototype.deleteRoleMachineIdentity.bind(r),e.getUserAccess=a.prototype.getUserAccess.bind(r),e.getUserAccessByRole=a.prototype.getUserAccessByRole.bind(r),e.getUserRoleAccess=a.prototype.getUserRoleAccess.bind(r),e.getAccountOwners=a.prototype.getAccountOwners.bind(r),e.createAccessKeys=a.prototype.createAccessKeys.bind(r),e.getIamUser=a.prototype.getIamUser.bind(r),e.updateIamUser=a.prototype.updateIamUser.bind(r),e.deleteIAMUser=a.prototype.deleteIAMUser.bind(r),e.version=a.prototype.version.bind(r),e.getLoginRole=a.prototype.getLoginRole.bind(r),e.getAccessToken=a.prototype.getAccessToken.bind(r),e.getRefreshTokens=a.prototype.getRefreshTokens.bind(r),e.revoke=a.prototype.revoke.bind(r),e.getCostTotals=a.prototype.getCostTotals.bind(r)}(ll=ll||{});var ll=ll;e.default=ll,Object.defineProperty(e,"__esModule",{value:!0}),Object.assign(e,ll)}); +!function(global,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((global="undefined"!=typeof globalThis?globalThis:global||self).alks={})}(this,function(e){"use strict";var a=window||this;function p(p){if(p.__esModule)return p;var d=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(p).forEach(function(e){var a=Object.getOwnPropertyDescriptor(p,e);Object.defineProperty(d,e,a.get?a:{enumerable:!0,get:function(){return p[e]}})}),d}var d=function(e,a){return(d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,a){e.__proto__=a}||function(e,a){for(var p in a)Object.prototype.hasOwnProperty.call(a,p)&&(e[p]=a[p])})(e,a)};var t=function(){return(t=Object.assign||function(e){for(var a,p=1,d=arguments.length;p=e.length?void 0:e)&&e[d++],done:!e}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(e,a){var p="function"==typeof Symbol&&e[Symbol.iterator];if(!p)return e;var d,t,i=p.call(e),r=[];try{for(;(void 0===a||0r[0]&&a[1] dist/alks.min.js',build:"npm run clean && npm run compile && npm run rollup && npm run minify",lint:"prettier --write --no-error-on-unmatched-pattern {src,test}/**/*.{ts,js,json,md}",test:"npm run build && npm run lint && npm run mocha && npm run karma",mocha:"nyc mocha test/test.js",coverage:"nyc report --reporter=text-lcov | coveralls",karma:"karma start",docs:"typedoc src/alks.ts",prepare:"husky install",compile:"tsc"},files:["dist/"],repository:{type:"git",url:"https://github.com/Cox-Automotive/alks.js.git"},author:{name:"Cox Automotive",email:"paul.ofallon@coxautoinc.com",url:"https://github.com/Cox-Automotive/"},bugs:{url:"https://github.com/Cox-Automotive/alks.js/issues"},license:"MIT",engines:{node:">=14.0.0"},dependencies:{encoding:"^0.1.13","node-fetch":"^2.6.1",tslib:"^2.3.1"},devDependencies:{"@rollup/plugin-commonjs":"^19.0.0","@rollup/plugin-node-resolve":"^13.0.0","@rollup/plugin-typescript":"^8.2.1","@types/node":"^15.0.2","@types/node-fetch":"^2.5.10",browserify:"^17.0.0",chai:"^4.3.4","chai-as-promised":"^7.1.1",coveralls:"^3.0.3",eslint:"^7.25.0","eslint-plugin-jsdoc":"^4.1.1","fetch-mock":"^7.3.1",husky:"^6.0.0",karma:"^6.3.2","karma-browserify":"^8.0.0","karma-chrome-launcher":"^3.1.0","karma-mocha":"^2.0.1","karma-mocha-reporter":"^2.2.5","lint-staged":"^11.0.0",mkdirp:"^1.0.4",mocha:"^10.0.0",nyc:"^15.1.0",prettier:"^2.3.0",rimraf:"^3.0.2",rollup:"^2.47.0","rollup-plugin-json":"^3.1.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-replace":"^2.2.0",sinon:"^10.0.0",tslint:"^6.1.3",typedoc:"^0.22.15",typescript:"^4.2.4","uglify-js":"^3.13.6"},prettier:{singleQuote:!0,semi:!0,arrowParens:"always",endOfLine:"lf",trailingComma:"es5"},"lint-staged":{"{src,test}/**/*.{js,ts,json,md}":["prettier --write"]}},u=void 0!==a?a:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},h=[],c=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,v=!1;function w(){v=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,p=e.length;a>18&63]+h[d>>12&63]+h[d>>6&63]+h[63&d]);return t.join("")}function g(e){var a;v||w();for(var p=e.length,d=p%3,t="",i=[],r=0,n=p-d;r>2],t+=h[a<<4&63],t+="=="):2==d&&(a=(e[p-2]<<8)+e[p-1],t+=h[a>>10],t+=h[a>>4&63],t+=h[a<<2&63],t+="="),i.push(t),i.join("")}function b(e,a,p,d,t){var i,r,n=8*t-d-1,l=(1<>1,o=-7,s=p?t-1:0,u=p?-1:1,p=e[a+s];for(s+=u,i=p&(1<<-o)-1,p>>=-o,o+=n;0>=-o,o+=d;0>1,s=23===t?Math.pow(2,-24)-Math.pow(2,-77):0,u=d?0:i-1,h=d?1:-1,i=a<0||0===a&&1/a<0?1:0;for(a=Math.abs(a),isNaN(a)||a===1/0?(n=isNaN(a)?1:0,r=m):(r=Math.floor(Math.log(a)/Math.LN2),a*(d=Math.pow(2,-r))<1&&(r--,d*=2),2<=(a+=1<=r+o?s/d:s*Math.pow(2,1-o))*d&&(r++,d/=2),m<=r+o?(n=0,r=m):1<=r+o?(n=(a*d-1)*Math.pow(2,t),r+=o):(n=a*Math.pow(2,o-1)*Math.pow(2,t),r=0));8<=t;e[p+u]=255&n,u+=h,n/=256,t-=8);for(r=r<=D())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+D().toString(16)+" bytes");return 0|e}function O(e){return null!=e&&e._isBuffer}function L(e,a){if(O(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;var p=(e="string"!=typeof e?""+e:e).length;if(0===p)return 0;for(var d=!1;;)switch(a){case"ascii":case"latin1":case"binary":return p;case"utf8":case"utf-8":case void 0:return X(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*p;case"hex":return p>>>1;case"base64":return J(e).length;default:if(d)return X(e).length;a=(""+a).toLowerCase(),d=!0}}function B(e,a,p){var d,t,i,r=!1;if((a=void 0===a||a<0?0:a)>this.length)return"";if((p=void 0===p||p>this.length?this.length:p)<=0)return"";if((p>>>=0)<=(a>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return function(e,a,p){var d=e.length;(!a||a<0)&&(a=0);(!p||p<0||d=e.length){if(t)return-1;p=e.length-1}else if(p<0){if(!t)return-1;p=0}if(O(a="string"==typeof a?R.from(a,d):a))return 0===a.length?-1:F(e,a,p,d,t);if("number"==typeof a)return a&=255,R.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?(t?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,a,p):F(e,[a],p,d,t);throw new TypeError("val must be string, number or Buffer")}function F(e,a,p,d,t){var i=1,r=e.length,n=a.length;if(void 0!==d&&("ucs2"===(d=String(d).toLowerCase())||"ucs-2"===d||"utf16le"===d||"utf-16le"===d)){if(e.length<2||a.length<2)return-1;r/=i=2,n/=2,p/=2}function l(e,a){return 1===i?e[a]:e.readUInt16BE(a*i)}if(t)for(var m=-1,o=p;o>8,d=d%256,t.push(d),t.push(p);return t}(a,e.length-p),e,p,d)}function z(e,a,p){p=Math.min(e.length,p);for(var d=[],t=a;t>>10&1023|55296),o=56320|1023&o),d.push(o),t+=s}return function(e){var a=e.length;if(a<=M)return String.fromCharCode.apply(String,e);var p="",d=0;for(;d"},R.prototype.compare=function(e,a,p,d,t){if(!O(e))throw new TypeError("Argument must be a Buffer");if(void 0===p&&(p=e?e.length:0),void 0===d&&(d=0),void 0===t&&(t=this.length),(a=void 0===a?0:a)<0||p>e.length||d<0||t>this.length)throw new RangeError("out of range index");if(t<=d&&p<=a)return 0;if(t<=d)return-1;if(p<=a)return 1;if(this===e)return 0;for(var i=(t>>>=0)-(d>>>=0),r=(p>>>=0)-(a>>>=0),n=Math.min(i,r),l=this.slice(d,t),m=e.slice(a,p),o=0;othis.length)throw new RangeError("Attempt to write outside buffer bounds");d=d||"utf8";for(var i,r,n,l=!1;;)switch(d){case"hex":return function(e,a,p,d){p=Number(p)||0;var t=e.length-p;if((!d||t<(d=Number(d)))&&(d=t),(t=a.length)%2!=0)throw new TypeError("Invalid hex string");t/2e.length)throw new RangeError("Index out of range")}function H(e,a,p,d){a<0&&(a=65535+a+1);for(var t=0,i=Math.min(e.length-p,2);t>>8*(d?t:1-t)}function K(e,a,p,d){a<0&&(a=4294967295+a+1);for(var t=0,i=Math.min(e.length-p,4);t>>8*(d?t:3-t)&255}function Y(e,a,p,d){if(p+d>e.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("Index out of range")}function W(e,a,p,d,t){return t||Y(e,0,p,4),y(e,a,p,d,23,4),p+4}function $(e,a,p,d,t){return t||Y(e,0,p,8),y(e,a,p,d,52,8),p+8}R.prototype.slice=function(e,a){var p=this.length;if((e=~~e)<0?(e+=p)<0&&(e=0):p>>8):H(this,e,a,!0),a+2},R.prototype.writeUInt16BE=function(e,a,p){return e=+e,a|=0,p||q(this,e,a,2,65535,0),R.TYPED_ARRAY_SUPPORT?(this[a]=e>>>8,this[a+1]=255&e):H(this,e,a,!1),a+2},R.prototype.writeUInt32LE=function(e,a,p){return e=+e,a|=0,p||q(this,e,a,4,4294967295,0),R.TYPED_ARRAY_SUPPORT?(this[a+3]=e>>>24,this[a+2]=e>>>16,this[a+1]=e>>>8,this[a]=255&e):K(this,e,a,!0),a+4},R.prototype.writeUInt32BE=function(e,a,p){return e=+e,a|=0,p||q(this,e,a,4,4294967295,0),R.TYPED_ARRAY_SUPPORT?(this[a]=e>>>24,this[a+1]=e>>>16,this[a+2]=e>>>8,this[a+3]=255&e):K(this,e,a,!1),a+4},R.prototype.writeIntLE=function(e,a,p,d){e=+e,a|=0,d||q(this,e,a,p,(d=Math.pow(2,8*p-1))-1,-d);var t=0,i=1,r=0;for(this[a]=255&e;++t>0)-r&255;return a+p},R.prototype.writeIntBE=function(e,a,p,d){e=+e,a|=0,d||q(this,e,a,p,(d=Math.pow(2,8*p-1))-1,-d);var t=p-1,i=1,r=0;for(this[a+t]=255&e;0<=--t&&(i*=256);)e<0&&0===r&&0!==this[a+t+1]&&(r=1),this[a+t]=(e/i>>0)-r&255;return a+p},R.prototype.writeInt8=function(e,a,p){return e=+e,a|=0,p||q(this,e,a,1,127,-128),R.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[a]=255&(e=e<0?255+e+1:e),a+1},R.prototype.writeInt16LE=function(e,a,p){return e=+e,a|=0,p||q(this,e,a,2,32767,-32768),R.TYPED_ARRAY_SUPPORT?(this[a]=255&e,this[a+1]=e>>>8):H(this,e,a,!0),a+2},R.prototype.writeInt16BE=function(e,a,p){return e=+e,a|=0,p||q(this,e,a,2,32767,-32768),R.TYPED_ARRAY_SUPPORT?(this[a]=e>>>8,this[a+1]=255&e):H(this,e,a,!1),a+2},R.prototype.writeInt32LE=function(e,a,p){return e=+e,a|=0,p||q(this,e,a,4,2147483647,-2147483648),R.TYPED_ARRAY_SUPPORT?(this[a]=255&e,this[a+1]=e>>>8,this[a+2]=e>>>16,this[a+3]=e>>>24):K(this,e,a,!0),a+4},R.prototype.writeInt32BE=function(e,a,p){return e=+e,a|=0,p||q(this,e,a,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),R.TYPED_ARRAY_SUPPORT?(this[a]=e>>>24,this[a+1]=e>>>16,this[a+2]=e>>>8,this[a+3]=255&e):K(this,e,a,!1),a+4},R.prototype.writeFloatLE=function(e,a,p){return W(this,e,a,!0,p)},R.prototype.writeFloatBE=function(e,a,p){return W(this,e,a,!1,p)},R.prototype.writeDoubleLE=function(e,a,p){return $(this,e,a,!0,p)},R.prototype.writeDoubleBE=function(e,a,p){return $(this,e,a,!1,p)},R.prototype.copy=function(e,a,p,d){if(p=p||0,d||0===d||(d=this.length),a>=e.length&&(a=e.length),(d=0=this.length)throw new RangeError("sourceStart out of bounds");if(d<0)throw new RangeError("sourceEnd out of bounds");d>this.length&&(d=this.length);var t,i=(d=e.length-a>>=0,p=void 0===p?this.length:p>>>0,"number"==typeof(e=e||0))for(n=a;n>6|192,63&p|128)}else if(p<65536){if((a-=3)<0)break;i.push(p>>12|224,p>>6&63|128,63&p|128)}else{if(!(p<1114112))throw new Error("Invalid code point");if((a-=4)<0)break;i.push(p>>18|240,p>>12&63|128,p>>6&63|128,63&p|128)}}return i}function J(e){return function(e){var a;v||w();var p=e.length;if(0>16&255,t[r++]=a>>8&255,t[r++]=255&a;return 2==d?(a=c[e.charCodeAt(n)]<<2|c[e.charCodeAt(n+1)]>>4,t[r++]=255&a):1==d&&(a=c[e.charCodeAt(n)]<<10|c[e.charCodeAt(n+1)]<<4|c[e.charCodeAt(n+2)]>>2,t[r++]=a>>8&255,t[r++]=255&a),t}(function(e){var a;if((e=((a=e).trim?a.trim():a.replace(/^\s+|\s+$/g,"")).replace(G,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Q(e,a,p,d){for(var t=0;t=a.length||t>=e.length);++t)a[t+p]=e[t];return t}function ee(e){return null!=e&&(!!e._isBuffer||ae(e)||"function"==typeof(e=e).readFloatLE&&"function"==typeof e.slice&&ae(e.slice(0,0)))}function ae(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var pe=p(Object.freeze({__proto__:null,Buffer:R,INSPECT_MAX_BYTES:50,SlowBuffer:function(e){return R.alloc(+(e=+e!=e?0:e))},isBuffer:ee,kMaxLength:T}));function de(){}function te(){te.init.call(this)}function ie(e){return void 0===e._maxListeners?te.defaultMaxListeners:e._maxListeners}function re(e,a,p,d){var t,i;if("function"!=typeof p)throw new TypeError('"listener" argument must be a function');return(t=e._events)?(t.newListener&&(e.emit("newListener",a,p.listener||p),t=e._events),i=t[a]):(t=e._events=new de,e._eventsCount=0),i?("function"==typeof i?i=t[a]=d?[p,i]:[i,p]:d?i.unshift(p):i.push(p),i.warned||(d=ie(e))&&0d&&(i.warned=!0,(d=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+a+" listeners added. Use emitter.setMaxListeners() to increase limit")).name="MaxListenersExceededWarning",d.emitter=e,d.type=a,d.count=i.length,d=d,"function"==typeof console.warn?console.warn(d):console.log(d))):(i=t[a]=p,++e._eventsCount),e}function ne(e,a,p){var d=!1;function t(){e.removeListener(a,t),d||(d=!0,p.apply(e,arguments))}return t.listener=p,t}function le(e){var a=this._events;if(a){e=a[e];if("function"==typeof e)return 1;if(e)return e.length}return 0}function me(e,a){for(var p=new Array(a);a--;)p[a]=e[a];return p}function oe(){throw new Error("setTimeout has not been defined")}function se(){throw new Error("clearTimeout has not been defined")}de.prototype=Object.create(null),(te.EventEmitter=te).usingDomains=!1,te.prototype.domain=void 0,te.prototype._events=void 0,te.prototype._maxListeners=void 0,te.defaultMaxListeners=10,te.init=function(){this.domain=null,te.usingDomains&&(void 0).active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new de,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},te.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},te.prototype.getMaxListeners=function(){return ie(this)},te.prototype.emit=function(e){var a,p,d,t="error"===e,i=this._events;if(i)t=t&&null==i.error;else if(!t)return!1;if(r=this.domain,t){if(t=arguments[1],r)return(t=t||new Error('Uncaught, unspecified "error" event')).domainEmitter=this,t.domain=r,t.domainThrown=!1,r.emit("error",t),!1;if(t instanceof Error)throw t;var r=new Error('Uncaught, unspecified "error" event. ('+t+")");throw r.context=t,r}if(!(a=i[e]))return!1;var n,l="function"==typeof a;switch(n=arguments.length){case 1:!function(e,a,p){if(a)e.call(p);else for(var d=e.length,t=me(e,d),i=0;i>>0),p=this.head,d=0;p;)p.data.copy(a,d),d+=p.data.length,p=p.next;return a};var aa=R.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function pa(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!aa(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=ta;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=ia;break;default:return void(this.write=da)}this.charBuffer=new R(6),this.charReceived=0,this.charLength=0}function da(e){return e.toString(this.encoding)}function ta(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function ia(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}pa.prototype.write=function(e){for(var a="";this.charLength;){var p=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,p),this.charReceived+=p,this.charReceived>5==6){this.charLength=2;break}if(a<=2&&p>>4==14){this.charLength=3;break}if(a<=3&&p>>3==30){this.charLength=4;break}}this.charReceived=a},pa.prototype.end=function(e){var a,p,d="";return e&&e.length&&(d=this.write(e)),this.charReceived&&(a=this.charReceived,p=this.charBuffer,e=this.encoding,d+=p.slice(0,a).toString(e)),d},ma.ReadableState=la;var ra,na=(Ke(Be)&&(Be=""),ra=(ra="stream").toUpperCase(),Pe[ra]||(new RegExp("\\b"+ra+"\\b","i").test(Be)?Pe[ra]=function(){var e=function(e){if(!He(e)){for(var a=[],p=0;pa.highWaterMark&&(a.highWaterMark=(sa<=(p=e)?p=sa:(p--,p|=p>>>1,p|=p>>>2,p|=p>>>4,p|=p>>>8,p|=p>>>16,p++),p)),e<=a.length?e:a.ended?a.length:(a.needReadable=!0,0));var p}function ha(e){var a=e._readableState;a.needReadable=!1,a.emittedReadable||(na("emitReadable",a.flowing),a.emittedReadable=!0,a.sync?ye(ca,e):ca(e))}function ca(e){na("emit readable"),e.emit("readable"),_a(e)}function fa(e,a){for(var p=a.length;!a.reading&&!a.flowing&&!a.ended&&a.length=a.length?(p=a.decoder?a.buffer.join(""):1===a.buffer.length?a.buffer.head.data:a.buffer.concat(a.length),a.buffer.clear()):p=function(e,a,p){var d;ei.length?i.length:e;if(r===i.length?t+=i:t+=i.slice(0,e),0===(e-=r)){r===i.length?(++d,p.next?a.head=p.next:a.head=a.tail=null):(a.head=p).data=i.slice(r);break}++d}return a.length-=d,t}:function(e,a){var p=R.allocUnsafe(e),d=a.head,t=1;d.data.copy(p),e-=d.data.length;for(;d=d.next;){var i=d.data,r=e>i.length?i.length:e;if(i.copy(p,p.length-e,0,r),0===(e-=r)){r===i.length?(++t,d.next?a.head=d.next:a.head=a.tail=null):(a.head=d).data=i.slice(r);break}++t}return a.length-=t,p})(e,a);return d}(e,a.buffer,a.decoder),p);var p}function ba(e){var a=e._readableState;if(0=a.highWaterMark||a.ended))return na("read: emitReadable",a.length,a.ended),(0===a.length&&a.ended?ba:ha)(this),null;if(0===(e=ua(e,a))&&a.ended)return 0===a.length&&ba(this),null;var d=a.needReadable;return na("need readable",d),(0===a.length||a.length-ea._pos){var d=p.substr(a._pos);if("x-user-defined"===a._charset){for(var t=new R(d.length),i=0;ia._pos&&(a.push(new R(new Uint8Array(r.result.slice(a._pos)))),a._pos=r.result.byteLength)},r.onload=function(){a.push(null)},r.readAsArrayBuffer(p)}a._xhr.readyState===pp&&"ms-stream"!==a._mode&&a.push(null)},De(tp,Va);var ip=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];tp.prototype.setHeader=function(e,a){var p=e.toLowerCase();-1===ip.indexOf(p)&&(this._headers[p]={name:e,value:a})},tp.prototype.getHeader=function(e){return this._headers[e.toLowerCase()].value},tp.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},tp.prototype._onFinish=function(){var a=this;if(!a._destroyed){var e,p=a._opts,d=a._headers;if("POST"!==p.method&&"PUT"!==p.method&&"PATCH"!==p.method||(e=function(){if(void 0!==Ha)return Ha;try{new u.Blob([new ArrayBuffer(1)]),Ha=!0}catch(e){Ha=!1}return Ha}()?new u.Blob(a._body.map(function(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if("function"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(ee(e)){for(var a=new Uint8Array(e.length),p=e.length,d=0;d= 0x80 (not a basic code point)","invalid-input":"Invalid input"},gp=np-lp,bp=Math.floor,yp=String.fromCharCode;function Sp(e){throw new RangeError(_p[e])}function Np(e,a){for(var p=e.length,d=[];p--;)d[p]=a(e[p]);return d}function Tp(e,a){var p=e.split("@"),d="";return 1>>10&1023|55296),e=56320|1023&e),a+=yp(e)}).join("")}function Ap(e,a){return e+22+75*(e<26)-((0!=a)<<5)}function Ep(e,a,p){var d=0;for(e=p?bp(e/sp):e>>1,e+=bp(e/a);gp*mp>>1bp((rp-o)/i))&&Sp("overflow"),o+=n*i,!(n<(n=r<=u?lp:u+mp<=r?mp:r-u));r+=np)i>bp(rp/(n=np-n))&&Sp("overflow"),i*=n;u=Ep(o-t,a=l.length+1,0==t),bp(o/a)>rp-s&&Sp("overflow"),s+=bp(o/a),o%=a,l.splice(o++,0,s)}return Vp(l)}function Rp(e){for(var a,p,d,t,i,r,n,l,m,o,s=[],u=(e=Dp(e)).length,h=hp,c=up,f=a=0;fbp((rp-a)/(l=p+1))&&Sp("overflow"),a+=(t-h)*l,h=t,f=0;frp&&Sp("overflow"),n==h){for(i=a,r=np;!(i<(m=r<=c?lp:c+mp<=r?mp:r-c));r+=np)s.push(yp(Ap(m+(o=i-m)%(m=np-m),0))),i=bp(o/m);s.push(yp(Ap(i,0))),c=Ep(a,l,p==d),a=0,++p}++a,++h}return s.join("")}function xp(e){return Tp(e,function(e){return fp.test(e)?kp(e.slice(4).toLowerCase()):e})}function Cp(e){return Tp(e,function(e){return vp.test(e)?"xn--"+Rp(e):e})}Ee={decode:Dp,encode:Vp},ke=Object.freeze({__proto__:null,decode:kp,encode:Rp,toUnicode:xp,toASCII:Cp,version:"1.4.1",ucs2:Ee,default:{version:"1.4.1",ucs2:Ee,toASCII:Cp,toUnicode:xp,encode:Rp,decode:kp}});var Op=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function Lp(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}}function Bp(e,a){if(e.map)return e.map(a);for(var p=[],d=0;d",'"',"`"," ","\r","\n","\t"]),Mp=["'"].concat(Ae),Zp=["%","/","?",";","#"].concat(Mp),qp=["/","?","#"],Hp=255,Kp=/^[+a-z0-9A-Z_-]{0,63}$/,Yp=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Wp={javascript:!0,"javascript:":!0},$p={javascript:!0,"javascript:":!0},Gp={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Xp(e,a,p){if(e&&We(e)&&e instanceof Fp)return e;var d=new Fp;return d.parse(e,a,p),d}function Jp(e,a,p,d){if(!He(a))throw new TypeError("Parameter 'url' must be a string, not "+typeof a);var t=a.indexOf("?"),i=-1!==t&&tHp?e.hostname="":e.hostname=e.hostname.toLowerCase(),s||(e.hostname=Cp(e.hostname));var S=e.port?":"+e.port:"",N=e.hostname||"";e.host=N+S,e.href+=e.host,s&&(e.hostname=e.hostname.substr(1,e.hostname.length-2),"/"!==r[0]&&(r="/"+r))}if(!Wp[V])for(h=0,c=Mp.length;hi)throw new TypeError("Argument is not in byte range");return p}if(!isNaN(p)&&a.clamp)return p=(a=p)%1==.5&&0==(1&a)?Math.floor(a):Math.round(a),pi&&(p=i),p;if(!Number.isFinite(p)||0===p)return 0;if(p=id(p)*Math.floor(Math.abs(p)),p%=r,!d.unsigned&&p>=n)return p-r;if(d.unsigned)if(p<0)p+=r;else if(-0===p)return 0;return p}}Ae.void=function(){},Ae.boolean=function(e){return!!e},Ae.byte=rd(8,{unsigned:!1}),Ae.octet=rd(8,{unsigned:!0}),Ae.short=rd(16,{unsigned:!1}),Ae["unsigned short"]=rd(16,{unsigned:!0}),Ae.long=rd(32,{unsigned:!1}),Ae["unsigned long"]=rd(32,{unsigned:!0}),Ae["long long"]=rd(32,{unsigned:!1,moduloBitLength:64}),Ae["unsigned long long"]=rd(32,{unsigned:!0,moduloBitLength:64}),Ae.double=function(e){e=+e;if(!Number.isFinite(e))throw new TypeError("Argument is not a finite floating-point value");return e},Ae["unrestricted double"]=function(e){e=+e;if(isNaN(e))throw new TypeError("Argument is NaN");return e},Ae.float=Ae.double,Ae["unrestricted float"]=Ae["unrestricted double"],Ae.DOMString=function(e,a){return(a=a||{}).treatNullAsEmptyString&&null===e?"":String(e)},Ae.ByteString=function(e,a){const p=String(e);var d;for(let e=0;void 0!==(d=p.codePointAt(e));++e)if(255=e)return t;t[0][0]>e?p=d-1:a=d+1}return null}var wd=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;function _d(e){return e.replace(wd,"_").length}var gd=/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2D]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDE2C-\uDE37\uDEDF-\uDEEA\uDF01-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDE30-\uDE40\uDEAB-\uDEB7]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD83A[\uDCD0-\uDCD6]|\uDB40[\uDD00-\uDDEF]/;function bd(e,a,p){var d=function(e,a,p){for(var d=!1,t="",i=_d(e),r=0;r=Math.pow(256,5-p.length))return m;let t=p.pop(),i=0;for(const n of p)t+=n*Math.pow(256,3-i),++i;return t}function N(a){let p="";var d,t=function(a){let p=null,d=1,t=null,i=0;for(let e=0;ed&&(p=t,d=i),t=null,i=0):(null===t&&(t=e),++i);i>d&&(p=t,d=i);return{idx:p,len:d}}(a).idx;let i=!1;for(let e=0;e<=7;++e)i&&0===a[e]||(i=i&&!1,t!==e?(p+=a[e].toString(16),7!==e&&(p+=":")):(d=0===e?"::":":",p+=d,i=!0));return p}function T(e,a){if("["===e[0])return"]"!==e[e.length-1]?m:function(d){const t=[0,0,0,0,0,0,0,0];let i=0,a=null,r=0;if(58===(d=l.ucs2.decode(d))[r]){if(58!==d[r+1])return m;r+=2,++i,a=i}for(;rMath.pow(2,16)-1)return this.parseError=!0,m;this.url.port=a===(e=this.url.scheme,t[e])?null:a,this.buffer=""}if(this.stateOverride)return!1;this.state="path start",--this.pointer}return!0};const k=new Set([47,92,63,35]);E.prototype["parse file"]=function(e){var a;return this.url.scheme="file",47===e||92===e?(92===e&&(this.parseError=!0),this.state="file slash"):null!==this.base&&"file"===this.base.scheme?isNaN(e)?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query=this.base.query):63===e?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query="",this.state="query"):35===e?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query=this.base.query,this.url.fragment="",this.state="fragment"):(this.input.length-this.pointer-1==0||(a=this.input[this.pointer+1],!r(e)||58!==a&&124!==a)||2<=this.input.length-this.pointer-1&&!k.has(this.input[this.pointer+2])?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),V(this.url)):this.parseError=!0,this.state="path",--this.pointer):(this.state="path",--this.pointer),!0},E.prototype["parse file slash"]=function(e){return 47===e||92===e?(92===e&&(this.parseError=!0),this.state="file host"):(null!==this.base&&"file"===this.base.scheme&&(2===(e=this.base.path[0]).length&&r(e.codePointAt(0))&&":"===e[1]?this.url.path.push(this.base.path[0]):this.url.host=this.base.host),this.state="path",--this.pointer),!0},E.prototype["parse file host"]=function(e,a){if(isNaN(e)||47===e||92===e||63===e||35===e)if(--this.pointer,!this.stateOverride&&h(this.buffer))this.parseError=!0,this.state="path";else if(""===this.buffer){if(this.url.host="",this.stateOverride)return!1;this.state="path start"}else{let e=T(this.buffer,f(this.url));if(e===m)return m;if("localhost"===e&&(e=""),this.url.host=e,this.stateOverride)return!1;this.buffer="",this.state="path start"}else this.buffer+=a;return!0},E.prototype["parse path start"]=function(e){return f(this.url)?(92===e&&(this.parseError=!0),this.state="path",47!==e&&92!==e&&--this.pointer):this.stateOverride||63!==e?this.stateOverride||35!==e?void 0!==e&&(this.state="path",47!==e&&--this.pointer):(this.url.fragment="",this.state="fragment"):(this.url.query="",this.state="query"),!0},E.prototype["parse path"]=function(e){if(isNaN(e)||47===e||f(this.url)&&92===e||!this.stateOverride&&(63===e||35===e)){if(f(this.url)&&92===e&&(this.parseError=!0),".."===(a=(a=this.buffer).toLowerCase())||"%2e."===a||".%2e"===a||"%2e%2e"===a?(V(this.url),47===e||f(this.url)&&92===e||this.url.path.push("")):!n(this.buffer)||47===e||f(this.url)&&92===e?n(this.buffer)||("file"===this.url.scheme&&0===this.url.path.length&&h(this.buffer)&&(""!==this.url.host&&null!==this.url.host&&(this.parseError=!0,this.url.host=""),this.buffer=this.buffer[0]+":"),this.url.path.push(this.buffer)):this.url.path.push(""),this.buffer="","file"===this.url.scheme&&(void 0===e||63===e||35===e))for(;1>>7)]}function st(e,a){e.pending_buf[e.pending++]=255&a,e.pending_buf[e.pending++]=a>>>8&255}function ut(e,a,p){e.bi_valid>Zd-p?(e.bi_buf|=a<>Zd-e.bi_valid,e.bi_valid+=p-Zd):(e.bi_buf|=a<>>=1,p<<=1,0<--a;);return p>>>1}function ft(e,a,p){for(var d,t=new Array(Md+1),i=0,r=1;r<=Md;r++)t[r]=i=i+p[r-1]<<1;for(d=0;d<=a;d++){var n=e[2*d+1];0!==n&&(e[2*d]=ct(t[n]++,n))}}function vt(e){for(var a=0;a>1;1<=p;p--)gt(e,i,p);for(t=l;p=e.heap[1],e.heap[1]=e.heap[e.heap_len--],gt(e,i,1),d=e.heap[1],e.heap[--e.heap_max]=p,e.heap[--e.heap_max]=d,i[2*t]=i[2*p]+i[2*d],e.depth[t]=(e.depth[p]>=e.depth[d]?e.depth[p]:e.depth[d])+1,i[2*p+1]=i[2*d+1]=t,e.heap[1]=t++,gt(e,i,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,a){for(var p,d,t,i,r,n=a.dyn_tree,l=a.max_code,m=a.stat_desc.static_tree,o=a.stat_desc.has_stree,s=a.stat_desc.extra_bits,u=a.stat_desc.extra_base,h=a.stat_desc.max_length,c=0,f=0;f<=Md;f++)e.bl_count[f]=0;for(n[2*e.heap[e.heap_max]+1]=0,p=e.heap_max+1;p>=7;i>=8,e.bi_valid-=8)}function Et(e,a,p,d){var t,i,r=0;0>>=1)if(1&a&&0!==e.dyn_ltree[2*p])return kd;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return Rd;for(p=32;p>>3,(i=e.static_len+3+7>>>3)<=t&&(t=i)):t=i=p+5,p+4<=t&&-1!==a?Vt(e,a,p,d):e.strategy===Ed||i===t?(ut(e,(Ld<<1)+(d?1:0),3),bt(e,Qd,et)):(ut(e,(Bd<<1)+(d?1:0),3),function(e,a,p,d){var t;for(ut(e,a-257,5),ut(e,p-1,5),ut(e,d-4,4),t=0;t>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&a,e.pending_buf[e.l_buf+e.last_lit]=255&p,e.last_lit++,0===a?e.dyn_ltree[2*p]++:(e.matches++,a--,e.dyn_ltree[2*(pt[p]+Ud+1)]++,e.dyn_dtree[2*ot(a)]++),e.last_lit===e.lit_bufsize-1}function Rt(e,a,p,d){for(var t=65535&e|0,i=e>>>16&65535|0,r=0;0!==p;){for(p-=r=2e3>>1:p>>>1;e[a]=p}return e}();function Ct(e,a,p,d){var t=xt,i=d+p;e^=-1;for(var r=d;r>>8^t[255&(e^a[r])];return-1^e}var Ot=0,Lt=1,Bt=3,Pt=4,Ut=5,Ft=0,It=1,jt=-2,zt=-3,Mt=-5,Zt=-1,qt=1,Ht=2,Kt=3,Yt=4,Wt=2,$t=8,Gt=9,Xt=286,Jt=30,Qt=19,ei=2*Xt+1,ai=15,pi=3,di=258,ti=di+pi+1,ii=32,ri=42,ni=69,li=73,mi=91,oi=103,si=113,ui=666,hi=1,ci=2,fi=3,vi=4,wi=3;function _i(e,a){return e.msg=Sd[a],a}function gi(e){return(e<<1)-(4e.avail_out?e.avail_out:p)&&(Td(e.output,a.pending_buf,a.pending_out,p,e.next_out),e.next_out+=p,a.pending_out+=p,e.total_out+=p,e.avail_out-=p,a.pending-=p,0===a.pending&&(a.pending_out=0))}function Si(e,a){Et(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,a),e.block_start=e.strstart,yi(e.strm)}function Ni(e,a){e.pending_buf[e.pending++]=a}function Ti(e,a){e.pending_buf[e.pending++]=a>>>8&255,e.pending_buf[e.pending++]=255&a}function Di(e,a){var p,d,t=e.max_chain_length,i=e.strstart,r=e.prev_length,n=e.nice_match,l=e.strstart>e.w_size-ti?e.strstart-(e.w_size-ti):0,m=e.window,o=e.w_mask,s=e.prev,u=e.strstart+di,h=m[i+r-1],c=m[i+r];e.prev_length>=e.good_match&&(t>>=2),n>e.lookahead&&(n=e.lookahead);do{if(m[(p=a)+r]===c&&m[p+r-1]===h&&m[p]===m[i]&&m[++p]===m[i+1]){for(i+=2,p++;m[++i]===m[++p]&&m[++i]===m[++p]&&m[++i]===m[++p]&&m[++i]===m[++p]&&m[++i]===m[++p]&&m[++i]===m[++p]&&m[++i]===m[++p]&&m[++i]===m[++p]&&il&&0!=--t);return r<=e.lookahead?r:e.lookahead}function Vi(e){var a,p,d,t,i,r,n,l,m,o=e.w_size;do{if(m=e.window_size-e.lookahead-e.strstart,e.strstart>=o+(o-ti)){for(Td(e.window,e.window,o,o,0),e.match_start-=o,e.strstart-=o,e.block_start-=o,a=p=e.hash_size;d=e.head[--a],e.head[a]=o<=d?d-o:0,--p;);for(a=p=o;d=e.prev[--a],e.prev[a]=o<=d?d-o:0,--p;);m+=o}if(0===e.strm.avail_in)break;if(i=e.strm,r=e.window,n=e.strstart+e.lookahead,l=m,m=void 0,m=i.avail_in,p=0===(m=l=pi)for(t=e.strstart-e.insert,e.ins_h=e.window[t],e.ins_h=(e.ins_h<=pi&&(e.ins_h=(e.ins_h<=pi)if(d=kt(e,e.strstart-e.match_start,e.match_length-pi),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=pi){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=pi&&(e.ins_h=(e.ins_h<=pi&&e.match_length<=e.prev_length){for(t=e.strstart+e.lookahead-pi,d=kt(e,e.strstart-1-e.prev_match,e.prev_length-pi),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=t&&(e.ins_h=(e.ins_h<>8&255),Ni(p,p.gzhead.time>>16&255),Ni(p,p.gzhead.time>>24&255),Ni(p,9===p.level?2:p.strategy>=Ht||p.level<2?4:0),Ni(p,255&p.gzhead.os),p.gzhead.extra&&p.gzhead.extra.length&&(Ni(p,255&p.gzhead.extra.length),Ni(p,p.gzhead.extra.length>>8&255)),p.gzhead.hcrc&&(e.adler=Ct(e.adler,p.pending_buf,p.pending,0)),p.gzindex=0,p.status=ni):(Ni(p,0),Ni(p,0),Ni(p,0),Ni(p,0),Ni(p,0),Ni(p,9===p.level?2:p.strategy>=Ht||p.level<2?4:0),Ni(p,wi),p.status=si)):(i=$t+(p.w_bits-8<<4)<<8,i|=(p.strategy>=Ht||p.level<2?0:p.level<6?1:6===p.level?2:3)<<6,0!==p.strstart&&(i|=ii),i+=31-i%31,p.status=si,Ti(p,i),0!==p.strstart&&(Ti(p,e.adler>>>16),Ti(p,65535&e.adler)),e.adler=1)),p.status===ni)if(p.gzhead.extra){for(d=p.pending;p.gzindex<(65535&p.gzhead.extra.length)&&(p.pending!==p.pending_buf_size||(p.gzhead.hcrc&&p.pending>d&&(e.adler=Ct(e.adler,p.pending_buf,p.pending-d,d)),yi(e),d=p.pending,p.pending!==p.pending_buf_size));)Ni(p,255&p.gzhead.extra[p.gzindex]),p.gzindex++;p.gzhead.hcrc&&p.pending>d&&(e.adler=Ct(e.adler,p.pending_buf,p.pending-d,d)),p.gzindex===p.gzhead.extra.length&&(p.gzindex=0,p.status=li)}else p.status=li;if(p.status===li)if(p.gzhead.name){d=p.pending;do{if(p.pending===p.pending_buf_size&&(p.gzhead.hcrc&&p.pending>d&&(e.adler=Ct(e.adler,p.pending_buf,p.pending-d,d)),yi(e),d=p.pending,p.pending===p.pending_buf_size)){t=1;break}}while(t=p.gzindexd&&(e.adler=Ct(e.adler,p.pending_buf,p.pending-d,d)),0===t&&(p.gzindex=0,p.status=mi)}else p.status=mi;if(p.status===mi)if(p.gzhead.comment){d=p.pending;do{if(p.pending===p.pending_buf_size&&(p.gzhead.hcrc&&p.pending>d&&(e.adler=Ct(e.adler,p.pending_buf,p.pending-d,d)),yi(e),d=p.pending,p.pending===p.pending_buf_size)){t=1;break}}while(t=p.gzindexd&&(e.adler=Ct(e.adler,p.pending_buf,p.pending-d,d)),0===t&&(p.status=oi)}else p.status=oi;if(p.status===oi&&(p.gzhead.hcrc?(p.pending+2>p.pending_buf_size&&yi(e),p.pending+2<=p.pending_buf_size&&(Ni(p,255&e.adler),Ni(p,e.adler>>8&255),e.adler=0,p.status=si)):p.status=si),0!==p.pending){if(yi(e),0===e.avail_out)return p.last_flush=-1,Ft}else if(0===e.avail_in&&gi(a)<=gi(r)&&a!==Pt)return _i(e,Mt);if(p.status===ui&&0!==e.avail_in)return _i(e,Mt);if(0!==e.avail_in||0!==p.lookahead||a!==Ot&&p.status!==ui){var r=p.strategy===Ht?function(e,a){for(var p;;){if(0===e.lookahead&&(Vi(e),0===e.lookahead)){if(a===Ot)return hi;break}if(e.match_length=0,p=kt(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,p&&(Si(e,!1),0===e.strm.avail_out))return hi}return e.insert=0,a===Pt?(Si(e,!0),0===e.strm.avail_out?fi:vi):e.last_lit&&(Si(e,!1),0===e.strm.avail_out)?hi:ci}(p,a):p.strategy===Kt?function(e,a){for(var p,d,t,i,r=e.window;;){if(e.lookahead<=di){if(Vi(e),e.lookahead<=di&&a===Ot)return hi;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=pi&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=pi?(p=kt(e,1,e.match_length-pi),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(p=kt(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),p&&(Si(e,!1),0===e.strm.avail_out))return hi}return e.insert=0,a===Pt?(Si(e,!0),0===e.strm.avail_out?fi:vi):e.last_lit&&(Si(e,!1),0===e.strm.avail_out)?hi:ci}(p,a):Oi[p.level].func(p,a);if(r!==fi&&r!==vi||(p.status=ui),r===hi||r===fi)return 0===e.avail_out&&(p.last_flush=-1),Ft;if(r===ci&&(a===Lt?At(p):a!==Ut&&(Vt(p,0,0,!1),a===Bt&&(bi(p.head),0===p.lookahead&&(p.strstart=0,p.block_start=0,p.insert=0))),yi(e),0===e.avail_out))return p.last_flush=-1,Ft}return a!==Pt?Ft:p.wrap<=0?It:(2===p.wrap?(Ni(p,255&e.adler),Ni(p,e.adler>>8&255),Ni(p,e.adler>>16&255),Ni(p,e.adler>>24&255),Ni(p,255&e.total_in),Ni(p,e.total_in>>8&255),Ni(p,e.total_in>>16&255),Ni(p,e.total_in>>24&255)):(Ti(p,e.adler>>>16),Ti(p,65535&e.adler)),yi(e),0e.pending_buf_size-5&&(p=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Vi(e),0===e.lookahead&&a===Ot)return hi;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var d=e.block_start+p;if((0===e.strstart||e.strstart>=d)&&(e.lookahead=e.strstart-d,e.strstart=d,Si(e,!1),0===e.strm.avail_out))return hi;if(e.strstart-e.block_start>=e.w_size-ti&&(Si(e,!1),0===e.strm.avail_out))return hi}return e.insert=0,a===Pt?(Si(e,!0),0===e.strm.avail_out?fi:vi):(e.strstart>e.block_start&&(Si(e,!1),e.strm.avail_out),hi)}),new ki(4,4,8,4,Ai),new ki(4,5,16,8,Ai),new ki(4,6,32,32,Ai),new ki(4,4,16,16,Ei),new ki(8,16,32,32,Ei),new ki(8,16,128,128,Ei),new ki(8,32,128,256,Ei),new ki(32,128,258,1024,Ei),new ki(32,258,258,4096,Ei)],Li=30,Bi=12;var Pi=15,Ui=852,Fi=592,Ii=0,ji=1,zi=2,Mi=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Zi=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],qi=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],Hi=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];function Ki(e,a,p,d,t,i,r,n){for(var l,m,o,s,u,h,c,f,v,w=n.bits,_=0,g=0,b=0,y=0,S=0,N=0,T=0,D=0,V=0,A=0,E=null,k=0,R=new Vd(Pi+1),x=new Vd(Pi+1),C=null,O=0,_=0;_<=Pi;_++)R[_]=0;for(g=0;gh?(f=C[O+r[g]],E[k+r[g]]):(f=96,0),l=1<<(c=_-T),b=m=1<>T)+(m-=l)]=c<<24|f<<16|v|0,0!==m;);for(l=1<<_-1;A&l;)l>>=1;if(0!==l?(A&=l-1,A+=l):A=0,g++,0==--R[_]){if(_===y)break;_=a[p+r[g]]}if(S<_&&(A&s)!==o){for(u+=b,D=1<<(N=_-(T=0===T?S:T));N+T>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function Mr(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Vd(320),this.work=new Vd(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Zr(e){var a;return e&&e.state?((a=e.state).wsize=0,a.whave=0,a.wnext=0,(a=e)&&a.state?(e=a.state,a.total_in=a.total_out=e.total=0,a.msg="",e.wrap&&(a.adler=1&e.wrap),e.mode=nr,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Ad(Ir),e.distcode=e.distdyn=new Ad(jr),e.sane=1,e.back=-1,Qi):pr):pr}function qr(e,a){var p,d,t;return e?(p=new Mr,(e.state=p).window=null,d=a,(p=(p=e)&&p.state?(a=p.state,d<0?(t=0,d=-d):(t=1+(d>>4),d<48&&(d&=15)),d&&(d<8||15>>8&255,p.check=Ct(p.check,C,2,0),o=m=0,p.mode=lr;break}if(p.flags=0,p.head&&(p.head.done=!1),!(1&p.wrap)||(((255&m)<<8)+(m>>8))%31){e.msg="incorrect header check",p.mode=Pr;break}if((15&m)!==rr){e.msg="unknown compression method",p.mode=Pr;break}if(o-=4,S=8+(15&(m>>>=4)),0===p.wbits)p.wbits=S;else if(S>p.wbits){e.msg="invalid window size",p.mode=Pr;break}p.dmax=1<>8&1),512&p.flags&&(C[0]=255&m,C[1]=m>>>8&255,p.check=Ct(p.check,C,2,0)),o=m=0,p.mode=mr;case mr:for(;o<32;){if(0===n)break e;n--,m+=d[i++]<>>8&255,C[2]=m>>>16&255,C[3]=m>>>24&255,p.check=Ct(p.check,C,4,0)),o=m=0,p.mode=or;case or:for(;o<16;){if(0===n)break e;n--,m+=d[i++]<>8),512&p.flags&&(C[0]=255&m,C[1]=m>>>8&255,p.check=Ct(p.check,C,2,0)),o=m=0,p.mode=sr;case sr:if(1024&p.flags){for(;o<16;){if(0===n)break e;n--,m+=d[i++]<>>8&255,p.check=Ct(p.check,C,2,0)),o=m=0}else p.head&&(p.head.extra=null);p.mode=ur;case ur:if(1024&p.flags&&((h=n<(h=p.length)?n:h)&&(p.head&&(S=p.head.extra_len-p.length,p.head.extra||(p.head.extra=new Array(p.head.extra_len)),Td(p.head.extra,d,i,h,S)),512&p.flags&&(p.check=Ct(p.check,d,h,i)),n-=h,i+=h,p.length-=h),p.length))break e;p.length=0,p.mode=hr;case hr:if(2048&p.flags){if(0===n)break e;for(h=0;S=d[i+h++],p.head&&S&&p.length<65536&&(p.head.name+=String.fromCharCode(S)),S&&h>9&1,p.head.done=!0),e.adler=p.check=0,p.mode=_r;break;case vr:for(;o<32;){if(0===n)break e;n--,m+=d[i++]<>>=7&o,o-=7&o,p.mode=Or;break}for(;o<3;){if(0===n)break e;n--,m+=d[i++]<>>=1)){case 0:p.mode=br;break;case 1:if(!function(e){if(Yr){var a;for(Hr=new Ad(512),Kr=new Ad(32),a=0;a<144;)e.lens[a++]=8;for(;a<256;)e.lens[a++]=9;for(;a<280;)e.lens[a++]=7;for(;a<288;)e.lens[a++]=8;for(Ki(Wi,e.lens,0,288,Hr,0,e.work,{bits:9}),a=0;a<32;)e.lens[a++]=5;Ki($i,e.lens,0,32,Kr,0,e.work,{bits:5}),Yr=!1}e.lencode=Hr,e.lenbits=9,e.distcode=Kr,e.distbits=5}(p),p.mode=Vr,a!==Ji)break;m>>>=2,o-=2;break e;case 2:p.mode=Nr;break;case 3:e.msg="invalid block type",p.mode=Pr}m>>>=2,o-=2;break;case br:for(m>>>=7&o,o-=7&o;o<32;){if(0===n)break e;n--,m+=d[i++]<>>16^65535)){e.msg="invalid stored block lengths",p.mode=Pr;break}if(p.length=65535&m,o=m=0,p.mode=yr,a===Ji)break e;case yr:p.mode=Sr;case Sr:if(h=p.length){if(0===(h=l<(h=n>>=5,o-=5,p.ndist=1+(31&m),m>>>=5,o-=5,p.ncode=4+(15&m),m>>>=4,o-=4,286>>=3,o-=3}for(;p.have<19;)p.lens[O[p.have++]]=0;if(p.lencode=p.lendyn,p.lenbits=7,T={bits:p.lenbits},N=Ki(Yi,p.lens,0,19,p.lencode,0,p.work,T),p.lenbits=T.bits,N){e.msg="invalid code lengths set",p.mode=Pr;break}p.have=0,p.mode=Dr;case Dr:for(;p.have>>16&255,_=65535&x,!((v=x>>>24)<=o);){if(0===n)break e;n--,m+=d[i++]<>>=v,o-=v,p.lens[p.have++]=_;else{if(16===_){for(D=v+2;o>>=v,o-=v,0===p.have){e.msg="invalid bit length repeat",p.mode=Pr;break}S=p.lens[p.have-1],h=3+(3&m),m>>>=2,o-=2}else if(17===_){for(D=v+3;o>>=v)),m>>>=3,o-=3}else{for(D=v+7;o>>=v)),m>>>=7,o-=7}if(p.have+h>p.nlen+p.ndist){e.msg="invalid bit length repeat",p.mode=Pr;break}for(;h--;)p.lens[p.have++]=S}}if(p.mode===Pr)break;if(0===p.lens[256]){e.msg="invalid code -- missing end-of-block",p.mode=Pr;break}if(p.lenbits=9,T={bits:p.lenbits},N=Ki(Wi,p.lens,0,p.nlen,p.lencode,0,p.work,T),p.lenbits=T.bits,N){e.msg="invalid literal/lengths set",p.mode=Pr;break}if(p.distbits=6,p.distcode=p.distdyn,T={bits:p.distbits},N=Ki($i,p.lens,p.nlen,p.ndist,p.distcode,0,p.work,T),p.distbits=T.bits,N){e.msg="invalid distances set",p.mode=Pr;break}if(p.mode=Vr,a===Ji)break e;case Vr:p.mode=Ar;case Ar:if(6<=n&&258<=l){e.next_out=r,e.avail_out=l,e.next_in=i,e.avail_in=n,p.hold=m,p.bits=o,function(e,a){var p,d,t,i,r,n,l=e.state,m=e.next_in,o=e.input,s=m+(e.avail_in-5),u=e.next_out,h=e.output,c=u-(a-e.avail_out),f=u+(e.avail_out-257),v=l.dmax,w=l.wsize,_=l.whave,g=l.wnext,b=l.window,y=l.hold,S=l.bits,N=l.lencode,T=l.distcode,D=(1<>>=d=p>>>24,S-=d,0===(d=p>>>16&255))h[u++]=65535&p;else{if(!(16&d)){if(0==(64&d)){p=N[(65535&p)+(y&(1<>>=d,S-=d),S<15&&(y+=o[m++]<>>=d=p>>>24,S-=d,!(16&(d=p>>>16&255))){if(0==(64&d)){p=T[(65535&p)+(y&(1<>>=d,S-=d,(d=u-c)>3)<<3))-1,e.next_in=m-=t,e.next_out=u,e.avail_in=m>>16&255,_=65535&x,!((v=x>>>24)<=o);){if(0===n)break e;n--,m+=d[i++]<>g)])>>>16&255,_=65535&x,!(g+(v=x>>>24)<=o);){if(0===n)break e;n--,m+=d[i++]<>>=g,o-=g,p.back+=g}if(m>>>=v,o-=v,p.back+=v,p.length=_,0===w){p.mode=Cr;break}if(32&w){p.back=-1,p.mode=_r;break}if(64&w){e.msg="invalid literal/length code",p.mode=Pr;break}p.extra=15&w,p.mode=Er;case Er:if(p.extra){for(D=p.extra;o>>=p.extra,o-=p.extra,p.back+=p.extra}p.was=p.length,p.mode=kr;case kr:for(;w=(x=p.distcode[m&(1<>>16&255,_=65535&x,!((v=x>>>24)<=o);){if(0===n)break e;n--,m+=d[i++]<>g)])>>>16&255,_=65535&x,!(g+(v=x>>>24)<=o);){if(0===n)break e;n--,m+=d[i++]<>>=g,o-=g,p.back+=g}if(m>>>=v,o-=v,p.back+=v,64&w){e.msg="invalid distance code",p.mode=Pr;break}p.offset=_,p.extra=15&w,p.mode=Rr;case Rr:if(p.extra){for(D=p.extra;o>>=p.extra,o-=p.extra,p.back+=p.extra}if(p.offset>p.dmax){e.msg="invalid distance too far back",p.mode=Pr;break}p.mode=xr;case xr:if(0===l)break e;if(p.offset>(h=u-l)){if((h=p.offset-h)>p.whave&&p.sane){e.msg="invalid distance too far back",p.mode=Pr;break}c=h>p.wnext?(h-=p.wnext,p.wsize-h):p.wnext-h,h>p.length&&(h=p.length),f=p.window}else f=t,c=r-p.offset,h=p.length;for(l-=h=l=R.wsize?(Td(R.window,A,E-R.wsize,R.wsize,0),R.wnext=0,R.whave=R.wsize):(V=R.wsize-R.wnext,Td(R.window,A,E-k,V=kan.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsan.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelan.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelan.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=an.Z_FILTERED&&e.strategy!=an.Z_HUFFMAN_ONLY&&e.strategy!=an.Z_RLE&&e.strategy!=an.Z_FIXED&&e.strategy!=an.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!R.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new an.Zlib(a);var p=this;this._hadError=!1,this._binding.onerror=function(e,a){p._binding=null,p._hadError=!0;e=new Error(e);e.errno=a,e.code=an.codes[a],p.emit("error",e)};var d=an.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(d=e.level);a=an.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(a=e.strategy),this._binding.init(e.windowBits||an.Z_DEFAULT_WINDOWBITS,d,e.memLevel||an.Z_DEFAULT_MEMLEVEL,a,e.dictionary),this._buffer=new R(this._chunkSize),this._offset=0,this._closed=!1,this._level=d,this._strategy=a,this.once("end",this.close)}Object.keys(pn).forEach(function(e){pn[pn[e]]=e}),De(hn,za),hn.prototype.params=function(e,a,p){if(ean.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(a!=an.Z_FILTERED&&a!=an.Z_HUFFMAN_ONLY&&a!=an.Z_RLE&&a!=an.Z_FIXED&&a!=an.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+a);var d;this._level!==e||this._strategy!==a?(d=this).flush(an.Z_SYNC_FLUSH,function(){d._binding.params(e,a),d._hadError||(d._level=e,d._strategy=a,p&&p())}):Oe.nextTick(p)},hn.prototype.reset=function(){return this._binding.reset()},hn.prototype._flush=function(e){this._transform(new R(0),"",e)},hn.prototype.flush=function(e,a){var p,d=this._writableState;"function"!=typeof e&&(void 0!==e||a)||(a=e,e=an.Z_FULL_FLUSH),d.ended?a&&Oe.nextTick(a):d.ending?a&&this.once("end",a):d.needDrain?(p=this).once("drain",function(){p.flush(a)}):(this._flushFlag=e,this.write(new R(0),"",a))},hn.prototype.close=function(e){var a;e&&Oe.nextTick(e),this._closed||(this._closed=!0,this._binding.close(),a=this,Oe.nextTick(function(){a.emit("close")}))},hn.prototype._transform=function(e,a,p){var d,t=this._writableState,i=(t.ending||t.ended)&&(!e||t.length===e.length);if(null===!e&&!R.isBuffer(e))return p(new Error("invalid input"));i?d=an.Z_FINISH:(d=this._flushFlag,e.length>=t.length&&(this._flushFlag=this._opts.flush||an.Z_NO_FLUSH)),this._processChunk(e,d,p)},hn.prototype._processChunk=function(t,i,r){var n=t&&t.length,l=this._chunkSize-this._offset,m=0,o=this,s="function"==typeof r;if(!s){var a,u=[],h=0;this.on("error",function(e){a=e});do{var e=this._binding.writeSync(i,t,m,n,this._buffer,this._offset,l)}while(!this._hadError&&c(e[0],e[1]));if(this._hadError)throw a;var p=R.concat(u,h);return this.close(),p}p=this._binding.write(i,t,m,n,this._buffer,this._offset,l);function c(e,a){if(!o._hadError){var p,d=l-a;if(!function(e,a){if(!e)throw new Error(a)}(0<=d,"have should not go down"),0=o._chunkSize)&&(l=o._chunkSize,o._offset=0,o._buffer=new R(o._chunkSize)),0===a){if(m+=n-e,n=e,!s)return!0;e=o._binding.write(i,t,m,n,o._buffer,o._offset,o._chunkSize);return e.callback=c,void(e.buffer=t)}if(!s)return!1;r()}}p.buffer=t,p.callback=c},De(rn,hn),De(nn,hn),De(ln,hn),De(mn,hn),De(on,hn),De(sn,hn),De(un,hn);var cn={codes:pn,createDeflate:function(e){return new rn(e)},createInflate:function(e){return new nn(e)},createDeflateRaw:function(e){return new on(e)},createInflateRaw:function(e){return new sn(e)},createGzip:function(e){return new ln(e)},createGunzip:function(e){return new mn(e)},createUnzip:function(e){return new un(e)},deflate:function(e,a,p){return"function"==typeof a&&(p=a,a={}),dn(new rn(a),e,p)},deflateSync:function(e,a){return tn(new rn(a),e)},gzip:function(e,a,p){return"function"==typeof a&&(p=a,a={}),dn(new ln(a),e,p)},gzipSync:function(e,a){return tn(new ln(a),e)},deflateRaw:function(e,a,p){return"function"==typeof a&&(p=a,a={}),dn(new on(a),e,p)},deflateRawSync:function(e,a){return tn(new on(a),e)},unzip:function(e,a,p){return"function"==typeof a&&(p=a,a={}),dn(new un(a),e,p)},unzipSync:function(e,a){return tn(new un(a),e)},inflate:function(e,a,p){return"function"==typeof a&&(p=a,a={}),dn(new nn(a),e,p)},inflateSync:function(e,a){return tn(new nn(a),e)},gunzip:function(e,a,p){return"function"==typeof a&&(p=a,a={}),dn(new mn(a),e,p)},gunzipSync:function(e,a){return tn(new mn(a),e)},inflateRaw:function(e,a,p){return"function"==typeof a&&(p=a,a={}),dn(new sn(a),e,p)},inflateRawSync:function(e,a){return tn(new sn(a),e)},Deflate:rn,Inflate:nn,Gzip:ln,Gunzip:mn,DeflateRaw:on,InflateRaw:sn,Unzip:un,Zlib:hn};const fn=qa.Readable,vn=Symbol("buffer"),wn=Symbol("type");class _n{constructor(){this[wn]="";var e=arguments[0],a=arguments[1];const p=[];let d=0;if(e){var t=e,i=Number(t.length);for(let a=0;ad.size)return n=!0,void a(new gn(`content size at ${d.url} over limit: ${d.size}`,"max-size"));r+=e.length,i.push(e)}}),t.on("end",function(){if(!n){clearTimeout(p);try{e(Buffer.concat(i,r))}catch(e){a(new gn(`Could not create Buffer from response body for ${d.url}: ${e.message}`,"system",e))}}})})}function Dn(e){return"object"==typeof e&&"function"==typeof e.append&&"function"==typeof e.delete&&"function"==typeof e.get&&"function"==typeof e.getAll&&"function"==typeof e.has&&"function"==typeof e.set&&("URLSearchParams"===e.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(e)||"function"==typeof e.sort)}function Vn(e){return"object"==typeof e&&"function"==typeof e.arrayBuffer&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}function An(e){var a,p;let d=e.body;if(e.bodyUsed)throw new Error("cannot clone body after it is used");return d instanceof qa&&"function"!=typeof d.getBoundary&&(a=new Sn,p=new Sn,d.pipe(a),d.pipe(p),e[yn].body=a,d=p),d}function En(e){return null===e?null:"string"==typeof e?"text/plain;charset=UTF-8":Dn(e)?"application/x-www-form-urlencoded;charset=UTF-8":Vn(e)?e.type||null:Buffer.isBuffer(e)||"[object ArrayBuffer]"===Object.prototype.toString.call(e)||ArrayBuffer.isView(e)?null:"function"==typeof e.getBoundary?`multipart/form-data;boundary=${e.getBoundary()}`:e instanceof qa?null:"text/plain;charset=UTF-8"}function kn(e){const a=e.body;return null===a?0:Vn(a)?a.size:Buffer.isBuffer(a)?a.length:a&&"function"==typeof a.getLengthSync&&(a._lengthRetrievers&&0==a._lengthRetrievers.length||a.hasKnownLength&&a.hasKnownLength())?a.getLengthSync():null}Nn.prototype={get body(){return this[yn].body},get bodyUsed(){return this[yn].disturbed},arrayBuffer(){return Tn.call(this).then(function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)})},blob(){let a=this.headers&&this.headers.get("content-type")||"";return Tn.call(this).then(function(e){return Object.assign(new _n([],{type:a.toLowerCase()}),{[vn]:e})})},json(){var a=this;return Tn.call(this).then(function(e){try{return JSON.parse(e.toString())}catch(e){return Nn.Promise.reject(new gn(`invalid json response body at ${a.url} reason: ${e.message}`,"invalid-json"))}})},text(){return Tn.call(this).then(function(e){return e.toString()})},buffer(){return Tn.call(this)},textConverted(){var a=this;return Tn.call(this).then(function(e){return function(e,a){if("function"!=typeof bn)throw new Error("The package `encoding` must be installed to use the textConverted() function");a=a.get("content-type");let p="utf-8",d,t;a&&(d=/charset=([^;]*)/i.exec(a));t=e.slice(0,1024).toString(),!d&&t&&(d=/=u.follow)return s(new gn(`maximum redirect reached at: ${u.url}`,"max-redirect")),void f();const r={headers:new Pn(u.headers),follow:u.follow,counter:u.counter+1,agent:u.agent,compress:u.compress,method:u.method,body:u.body,signal:u.signal,timeout:u.timeout,size:u.size};if(!pl(u.url,e))for(const n of["authorization","www-authenticate","cookie","cookie2"])r.headers.delete(n);return 303!==a.statusCode&&u.body&&null===kn(u)?(s(new gn("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void f()):(303!==a.statusCode&&(301!==a.statusCode&&302!==a.statusCode||"POST"!==u.method)||(r.method="GET",r.body=void 0,r.headers.delete("content-length")),o(dl(new Xn(e,r))),void f())}}a.once("end",function(){h&&h.removeEventListener("abort",v)});let t=a.pipe(new al);const i={url:u.url,status:a.statusCode,statusText:a.statusMessage,headers:p,size:u.size,timeout:u.timeout,counter:u.counter};var e=p.get("Content-Encoding");if(!u.compress||"HEAD"===u.method||null===e||204===a.statusCode||304===a.statusCode)return c=new Zn(t,i),void o(c);d={flush:cn.Z_SYNC_FLUSH,finishFlush:cn.Z_SYNC_FLUSH};if("gzip"==e||"x-gzip"==e)return t=t.pipe(cn.createGunzip(d)),c=new Zn(t,i),void o(c);if("deflate"!=e&&"x-deflate"!=e){if("br"==e&&"function"==typeof cn.createBrotliDecompress)return t=t.pipe(cn.createBrotliDecompress()),c=new Zn(t,i),void o(c);c=new Zn(t,i),o(c)}else{const l=a.pipe(new al);l.once("data",function(e){t=8==(15&e[0])?t.pipe(cn.createInflate()):t.pipe(cn.createInflateRaw()),c=new Zn(t,i),o(c)})}}),function(e,a){const p=a.body;null===p?e.end():Vn(p)?p.stream().pipe(e):Buffer.isBuffer(p)?(e.write(p),e.end()):p.pipe(e)}(d,u)}})}dl.isRedirect=function(e){return 301===e||302===e||303===e||307===e||308===e},dl.Promise=a.Promise;var a=p(Object.freeze({__proto__:null,default:dl,Headers:Pn,Request:Xn,Response:Zn,FetchError:gn})),tl=m,il=tl.__importStar(o),rl=pe;tl.__importDefault(a);var nl=window.fetch.bind(window);!function(e){(a=e.TrustType||(e.TrustType={})).CrossAccount="Cross Account",a.InnerAccount="Inner Account",(r=e.PseudoBoolean||(e.PseudoBoolean={}))[r.True=1]="True",r[r.False=0]="False";var a=(p.prototype.create=function(e){return new p(tl.__assign(tl.__assign({},this.config),e))},p.prototype.getAccounts=function(p){return tl.__awaiter(this,void 0,void 0,function(){var a;return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("getAccounts",p)];case 1:return a=e.sent(),[2,Object.keys(a.accountListRole).map(function(e){return{account:e,role:a.accountListRole[e][0].role,iamKeyActive:a.accountListRole[e][0].iamKeyActive,maxKeyDuration:a.accountListRole[e][0].maxKeyDuration,securityLevel:a.accountListRole[e][0].securityLevel,skypieaAccount:a.accountListRole[e][0].skypieaAccount}})]}})})},p.prototype.getKeys=function(a){return tl.__awaiter(this,void 0,void 0,function(){return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("getKeys",a)];case 1:return[2,i(e.sent(),["accessKey","secretKey","sessionToken","consoleURL"])]}})})},p.prototype.getIAMKeys=function(a){return tl.__awaiter(this,void 0,void 0,function(){return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("getIAMKeys",a)];case 1:return[2,i(e.sent(),["accessKey","secretKey","sessionToken","consoleURL"])]}})})},p.prototype.getAllAWSRoleTypes=function(p){return tl.__awaiter(this,void 0,void 0,function(){var a;return tl.__generator(this,function(e){switch(e.label){case 0:return a=p.getDynamicValues?"allAwsRoleTypes?getDynamicValues=true":"allAwsRoleTypes",[4,this.internalFetch(a,p,"GET")];case 1:return[2,e.sent().roleTypes]}})})},p.prototype.getAWSRoleTypes=function(p){return tl.__awaiter(this,void 0,void 0,function(){var a;return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("getAWSRoleTypes",p)];case 1:return a=e.sent(),[2,JSON.parse(a.roleTypes)]}})})},p.prototype.getNonServiceAWSRoleTypes=function(p){return tl.__awaiter(this,void 0,void 0,function(){var a;return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("getNonServiceAWSRoleTypes",p)];case 1:return a=e.sent(),[2,JSON.parse(a.roleTypes)]}})})},p.prototype.createRole=function(d){return tl.__awaiter(this,void 0,void 0,function(){var a,p;return tl.__generator(this,function(e){switch(e.label){case 0:return a=null!=d.roleType,p=null!=d.trustPolicy,a==p?[3,2]:[4,this.internalFetch("createRole",d)];case 1:return(p=e.sent()).denyArns=p.denyArns.split(","),[2,i(p,["roleArn","denyArns","instanceProfileArn","addedRoleToInstanceProfile","tags"])];case 2:throw new Error("Must include roleType or trustPolicy, but not both.")}})})},p.prototype.createNonServiceRole=function(p){return tl.__awaiter(this,void 0,void 0,function(){var a;return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("createNonServiceRole",p)];case 1:return(a=e.sent()).denyArns=a.denyArns.split(","),[2,i(a,["roleArn","denyArns","instanceProfileArn","addedRoleToInstanceProfile","tags"])]}})})},p.prototype.awsAccountRoles=function(a){return tl.__awaiter(this,void 0,void 0,function(){return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("awsAccountRoles?account="+a.account,a,"GET")];case 1:return[2,e.sent().awsRoleList]}})})},p.prototype.listAWSAccountRoles=function(p){return tl.__awaiter(this,void 0,void 0,function(){var a;return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("listAWSAccountRoles",p)];case 1:return a=e.sent(),[2,JSON.parse(a.jsonAWSRoleList).map(function(e){return e.split("/").slice(-1)[0]})]}})})},p.prototype.getAccountRole=function(p){return tl.__awaiter(this,void 0,void 0,function(){var a;return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("getAccountRole",p)];case 1:if(!(a=e.sent()).roleExists)throw new Error("Role "+p.roleName+" does not exist in this account");return[2,tl.__assign(tl.__assign({},i(a,["roleArn","isMachineIdentity","tags","maxSessionDurationInSeconds"])),{instanceProfileArn:a.instanceProfileARN})]}})})},p.prototype.updateRole=function(p){return tl.__awaiter(this,void 0,void 0,function(){var a;return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("role",p,"PATCH")];case 1:if(!(a=e.sent()).roleExists)throw new Error("Role "+p.roleName+" does not exist in this account");return[2,tl.__assign(tl.__assign({},i(a,["roleArn","isMachineIdentity","tags"])),{instanceProfileArn:a.instanceProfileARN})]}})})},p.prototype.deleteRole=function(a){return tl.__awaiter(this,void 0,void 0,function(){return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("deleteRole",a)];case 1:return e.sent(),[2,!0]}})})},p.prototype.addRoleMachineIdentity=function(a){return tl.__awaiter(this,void 0,void 0,function(){return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("roleMachineIdentity",a)];case 1:return[2,i(e.sent(),["machineIdentityArn"])]}})})},p.prototype.deleteRoleMachineIdentity=function(a){return tl.__awaiter(this,void 0,void 0,function(){return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("roleMachineIdentity",a,"DELETE")];case 1:return[2,i(e.sent(),["machineIdentityArn"])]}})})},p.prototype.getUserAccess=function(p){return tl.__awaiter(this,void 0,void 0,function(){var a;return tl.__generator(this,function(e){switch(e.label){case 0:return a=p.accountId,[4,this.internalFetch("userAccess/"+a,p,"GET")];case 1:return[2,e.sent().users]}})})},p.prototype.getUserAccessByRole=function(p){return tl.__awaiter(this,void 0,void 0,function(){var a;return tl.__generator(this,function(e){switch(e.label){case 0:return a=p.accountId,[4,this.internalFetch("reports/users-by-role?accountId="+a,p,"GET")];case 1:return[2,e.sent().users]}})})},p.prototype.getUserRoleAccess=function(p){return tl.__awaiter(this,void 0,void 0,function(){var a;return tl.__generator(this,function(e){switch(e.label){case 0:return a=p.accountId,[4,this.internalFetch("userAccess/roles/"+a,p)];case 1:return[2,e.sent().roles]}})})},p.prototype.getAccountOwners=function(p){return tl.__awaiter(this,void 0,void 0,function(){var a;return tl.__generator(this,function(e){switch(e.label){case 0:return a=p.accountId,[4,this.internalFetch("userAccess/owners/"+a,p,"GET")];case 1:return[2,e.sent().accountOwners]}})})},p.prototype.createAccessKeys=function(a){return tl.__awaiter(this,void 0,void 0,function(){return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("accessKeys",a)];case 1:return[2,i(e.sent(),["iamUserArn","accessKey","secretKey","addedIAMUserToGroup","tags"])]}})})},p.prototype.getIamUser=function(a){return tl.__awaiter(this,void 0,void 0,function(){return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("iam-users/id/"+a.account+"/"+a.iamUserName,a,"GET")];case 1:return[2,i(e.sent().item,["arn","accountId","userName","accessKey","tags"])]}})})},p.prototype.updateIamUser=function(p){return tl.__awaiter(this,void 0,void 0,function(){var a;return tl.__generator(this,function(e){switch(e.label){case 0:return delete(a=tl.__assign(tl.__assign({},p),{user:{tags:p.tags}})).tags,[4,this.internalFetch("iam-users/id/"+p.account+"/"+p.iamUserName,a,"PATCH")];case 1:return[2,i(e.sent().item,["arn","accountId","userName","accessKey","tags"])]}})})},p.prototype.deleteIAMUser=function(a){return tl.__awaiter(this,void 0,void 0,function(){return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("IAMUser",a,"DELETE")];case 1:return e.sent(),[2,!0]}})})},p.prototype.version=function(a){return tl.__awaiter(this,void 0,void 0,function(){return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("version",a,"GET")];case 1:return[2,i(e.sent(),["version"])]}})})},p.prototype.getLoginRole=function(d){return tl.__awaiter(this,void 0,void 0,function(){var a,p;return tl.__generator(this,function(e){switch(e.label){case 0:return a=d.accountId,p=d.role,[4,this.internalFetch("loginRoles/id/"+a+"/"+p,d,"GET")];case 1:return[2,i(e.sent().loginRole,["account","role","iamKeyActive","maxKeyDuration","securityLevel"])]}})})},p.prototype.getAccessToken=function(a){return tl.__awaiter(this,void 0,void 0,function(){return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("accessToken",a)];case 1:return[2,i(e.sent(),["accessToken","expiresIn"])]}})})},p.prototype.getRefreshTokens=function(a){return tl.__awaiter(this,void 0,void 0,function(){return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("refreshTokens",a,"GET")];case 1:return[2,e.sent().refreshTokens.map(function(e){return i(e,["clientId","id","userId","value"])})]}})})},p.prototype.revoke=function(a){return tl.__awaiter(this,void 0,void 0,function(){return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("revoke",a)];case 1:return[2,"Success"==e.sent().statusMessage]}})})},p.prototype.getCostTotals=function(a){return tl.__awaiter(this,void 0,void 0,function(){return tl.__generator(this,function(e){switch(e.label){case 0:return[4,this.internalFetch("costTotals/"+a.accountId,a,"GET")];case 1:return[2,i(e.sent().costTotals,["awsAccountId","yyyy","mm","dd","daily","weekly","monthly","yearly","dailyCostsByService","monthlyCostsByService"])]}})})},p.prototype.internalFetch=function(n,l,m){return void 0===l&&(l={}),void 0===m&&(m="POST"),tl.__awaiter(this,void 0,void 0,function(){var a,p,d,t,i,r;return tl.__generator(this,function(e){switch(e.label){case 0:return a=tl.__assign(tl.__assign({},this.config),l),r=tl.__assign({},a),p={"Content-Type":"application/json","User-Agent":"AlksJS/"+il.version},void 0!==a.accessToken?(p.Authorization="Bearer "+a.accessToken,delete r.accessToken):void 0!==a.accessKey?(p["ALKS-STS-Access-Key"]=a.accessKey,p["ALKS-STS-Secret-Key"]=a.secretKey,p["ALKS-STS-Session-Token"]=a.sessionToken,delete r.accessKey,delete r.secretKey,delete r.sessionToken):void 0!==a.userid&&(console.error("The userid and password properties are deprecated and should be replaced with an access token"),d=function(e){void 0===e&&(e="");return rl.Buffer.from(e).toString("base64")}(a.userid+":"+a.password),p.Authorization="Basic "+d,delete r.userid,delete r.password),a.userAgent&&(p["User-Agent"]+=" "+a.userAgent,delete r.userAgent),[4,a._fetch(a.baseUrl+"/"+n,{method:m,headers:p,credentials:"omit",body:"GET"==m?void 0:JSON.stringify(r)})];case 1:t=e.sent(),e.label=2;case 2:return e.trys.push([2,4,,5]),[4,t.json()];case 3:return i=e.sent(),[3,5];case 4:return r=e.sent(),i={errors:[r.message]},[3,5];case 5:if(!t.ok)throw new o(t,i);return[2,i]}})})},p);function p(e){this.config=e}e.Alks=a;var t,o=(t=Error,tl.__extends(d,t),d);function d(e,a){var p=this,d=Array.isArray(null==a?void 0:a.errors)?a.errors:[];e.statusText&&d.unshift(e.statusText);d=d.join("; ");return(p=t.call(this,d)||this).status=e.status,p.message=d,Object.assign(p,a),p}function i(p,e){return e.reduce(function(e,a){return e[a]=p[a],e},{})}e.AlksError=o;var r=a.prototype.create.call({},{_fetch:nl});e.create=a.prototype.create.bind(r),e.getAccounts=a.prototype.getAccounts.bind(r),e.getKeys=a.prototype.getKeys.bind(r),e.getIAMKeys=a.prototype.getIAMKeys.bind(r),e.getAllAWSRoleTypes=a.prototype.getAllAWSRoleTypes.bind(r),e.getAWSRoleTypes=a.prototype.getAWSRoleTypes.bind(r),e.getNonServiceAWSRoleTypes=a.prototype.getNonServiceAWSRoleTypes.bind(r),e.createRole=a.prototype.createRole.bind(r),e.createNonServiceRole=a.prototype.createNonServiceRole.bind(r),e.awsAccountRoles=a.prototype.awsAccountRoles.bind(r),e.listAWSAccountRoles=a.prototype.listAWSAccountRoles.bind(r),e.getAccountRole=a.prototype.getAccountRole.bind(r),e.updateRole=a.prototype.updateRole.bind(r),e.deleteRole=a.prototype.deleteRole.bind(r),e.addRoleMachineIdentity=a.prototype.addRoleMachineIdentity.bind(r),e.deleteRoleMachineIdentity=a.prototype.deleteRoleMachineIdentity.bind(r),e.getUserAccess=a.prototype.getUserAccess.bind(r),e.getUserAccessByRole=a.prototype.getUserAccessByRole.bind(r),e.getUserRoleAccess=a.prototype.getUserRoleAccess.bind(r),e.getAccountOwners=a.prototype.getAccountOwners.bind(r),e.createAccessKeys=a.prototype.createAccessKeys.bind(r),e.getIamUser=a.prototype.getIamUser.bind(r),e.updateIamUser=a.prototype.updateIamUser.bind(r),e.deleteIAMUser=a.prototype.deleteIAMUser.bind(r),e.version=a.prototype.version.bind(r),e.getLoginRole=a.prototype.getLoginRole.bind(r),e.getAccessToken=a.prototype.getAccessToken.bind(r),e.getRefreshTokens=a.prototype.getRefreshTokens.bind(r),e.revoke=a.prototype.revoke.bind(r),e.getCostTotals=a.prototype.getCostTotals.bind(r)}(ll=ll||{});var ll=ll;e.default=ll,Object.defineProperty(e,"__esModule",{value:!0}),Object.assign(e,ll)}); diff --git a/dist/alks.umd.js b/dist/alks.umd.js index 7aaa45ba..efea4e22 100644 --- a/dist/alks.umd.js +++ b/dist/alks.umd.js @@ -336,8 +336,7 @@ var dependencies = { encoding: "^0.1.13", "node-fetch": "^2.6.1", - tslib: "^2.3.1", - typedoc: "^0.22.15" + tslib: "^2.3.1" }; var devDependencies = { "@rollup/plugin-commonjs": "^19.0.0", @@ -370,6 +369,7 @@ "rollup-plugin-replace": "^2.2.0", sinon: "^10.0.0", tslint: "^6.1.3", + typedoc: "^0.22.15", typescript: "^4.2.4", "uglify-js": "^3.13.6" }; diff --git a/docs/classes/export_.Alks.html b/docs/classes/export_.Alks.html index 6b134996..8b5d5198 100644 --- a/docs/classes/export_.Alks.html +++ b/docs/classes/export_.Alks.html @@ -1,6 +1,6 @@ Alks | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

ALKS JavaScript API

-

Hierarchy

  • Alks

Index

Constructors

Properties

Methods

Hierarchy

  • Alks

Index

Constructors

Properties

Methods

Returns Promise<export=.MachineIdentity>

Returns Promise<export=.AwsAccountRole[]>

  • Returns a new instance of alks with pre-defined properties (which don't need to be supplied to every method).

    Any of the properties required by other methods can be specified here.

    Properties present on the current object are carried through to the newly created one.

    @@ -39,7 +39,7 @@ })

    Parameters

    • props: export=.AlksProps

      An object containing settings for the new ALKS object

      -

    Returns Alks

Returns Alks

Returns Promise<export=.LongTermKey>

Returns Promise<export=.Role>

Returns Promise<export=.Role>

Returns Promise<boolean>

Returns Promise<boolean>

Returns Promise<export=.MachineIdentity>

  • Returns a Promise for an array of available AWS IAM role types

    deprecated

    Replaced by getAllAWSRoleTypes which includes all AWS role types and their details

    example

    alks.getAWSRoleTypes({ @@ -228,7 +228,7 @@ })

    Parameters

    Returns Promise<string[]>

Returns Promise<string[]>

Returns Promise<export=.AccessToken>

Returns Promise<export=.User[]>

Returns Promise<export=.Role>

Returns Promise<export=.Account[]>

Returns Promise<export=.AwsRoleType[]>

  • Returns cost totals for the specified account for the day, week, month, year, and a breakdown of costs by service for the day and month

    example

    alks.getCostTotals({ accountId: '012345678910', @@ -297,7 +297,7 @@ })

    Parameters

    Returns Promise<export=.CostTotal>

Returns Promise<export=.CostTotal>

Returns Promise<export=.Key>

Returns Promise<export=.IamUser>

Returns Promise<export=.Key>

  • Returns information about one of the roles used to generate keys

    example

    alks.getLoginRole({ ... @@ -344,7 +344,7 @@ })

    Parameters

    Returns Promise<Omit<export=.Account, "skypieaAccount">>

Returns Promise<Omit<export=.Account, "skypieaAccount">>

  • Returns a Promise for an array of available custom role types

    deprecated

    Replaced by getAllAWSRoleTypes which includes all AWS role types and their details

    example

    alks.getNonServiceAWSRoleTypes({ @@ -355,7 +355,7 @@ })

    Parameters

    Returns Promise<string[]>

Returns Promise<string[]>

Returns Promise<export=.RefreshToken[]>

Returns Promise<export=.User[]>

Returns Promise<Record<string, export=.User[]>>

  • internalFetch(path: string, args?: Partial<export=.AlksProps>, method?: string): Promise<any>

Returns Promise<string[]>

  • internalFetch(path: string, args?: Partial<export=.AlksProps>, method?: string): Promise<any>
  • Returns a Promise for an array of AWS custom AWS IAM account roles

    deprecated

    Replaced by awsAccountRoles which includes AWS account roles and their details

    example

    alks.listAWSAccountRoles({ @@ -411,7 +411,7 @@ })

    Parameters

    Returns Promise<string[]>

Returns Promise<string[]>

  • Revokes a refresh or access token

    example

    alks.revoke({ token: '...', @@ -428,7 +428,7 @@ })

    Parameters

    Returns Promise<boolean>

Returns Promise<boolean>

Returns Promise<export=.IamUser>

Returns Promise<export=.Role>

  • Returns the version of the ALKS Rest API

    example

    alks.version({ ... diff --git a/docs/classes/export_.AlksError.html b/docs/classes/export_.AlksError.html index 96530961..16119947 100644 --- a/docs/classes/export_.AlksError.html +++ b/docs/classes/export_.AlksError.html @@ -1,4 +1,4 @@ -AlksError | alks.js

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Class AlksError

    Hierarchy

    • Error
      • AlksError

    Indexable

    [s: string]: any

    Index

    Constructors

    • new AlksError(response: Response, json: any): AlksError

    Properties

    message: string
    name: string
    stack?: string
    status: number
    stackTraceLimit: number

    Methods

    • captureStackTrace(targetObject: object, constructorOpt?: Function): void
    • +AlksError | alks.js
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Class AlksError

      Hierarchy

      • Error
        • AlksError

      Indexable

      [s: string]: any

      Index

      Constructors

      • new AlksError(response: Response, json: any): AlksError

      Properties

      message: string
      name: string
      stack?: string
      status: number
      stackTraceLimit: number

      Methods

      • captureStackTrace(targetObject: object, constructorOpt?: Function): void
      • Create .stack property on a target object

        Parameters

        • targetObject: object
        • Optional constructorOpt: Function

        Returns void

      • prepareStackTrace(err: Error, stackTraces: CallSite[]): any
      • Optional override for formatting stack traces

        diff --git a/docs/enums/export_.PseudoBoolean.html b/docs/enums/export_.PseudoBoolean.html index ecb48f0d..2cb48713 100644 --- a/docs/enums/export_.PseudoBoolean.html +++ b/docs/enums/export_.PseudoBoolean.html @@ -1 +1 @@ -PseudoBoolean | alks.js
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Enumeration PseudoBoolean

        Index

        Enumeration members

        Enumeration members

        False = 0
        True = 1

        Legend

        • Property

        Settings

        Theme

        Generated using TypeDoc

        \ No newline at end of file +PseudoBoolean | alks.js
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Enumeration PseudoBoolean

        Index

        Enumeration members

        Enumeration members

        False = 0
        True = 1

        Legend

        • Property

        Settings

        Theme

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/enums/export_.TrustType.html b/docs/enums/export_.TrustType.html index 7cdb120c..89767932 100644 --- a/docs/enums/export_.TrustType.html +++ b/docs/enums/export_.TrustType.html @@ -1 +1 @@ -TrustType | alks.js
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Enumeration TrustType

        Index

        Enumeration members

        Enumeration members

        CrossAccount = "Cross Account"
        InnerAccount = "Inner Account"

        Legend

        • Property

        Settings

        Theme

        Generated using TypeDoc

        \ No newline at end of file +TrustType | alks.js
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Enumeration TrustType

        Index

        Enumeration members

        Enumeration members

        CrossAccount = "Cross Account"
        InnerAccount = "Inner Account"

        Legend

        • Property

        Settings

        Theme

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/interfaces/AccessToken.html b/docs/interfaces/AccessToken.html index 426d7899..ea87920c 100644 --- a/docs/interfaces/AccessToken.html +++ b/docs/interfaces/AccessToken.html @@ -1 +1 @@ -AccessToken | alks.js
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Interface AccessToken

        Hierarchy

        • AccessToken

        Index

        Properties

        accessToken: string
        expiresIn: string

        Legend

        • Property

        Settings

        Theme

        Generated using TypeDoc

        \ No newline at end of file +AccessToken | alks.js
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Interface AccessToken

        Hierarchy

        • AccessToken

        Index

        Properties

        accessToken: string
        expiresIn: string

        Legend

        • Property

        Settings

        Theme

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/interfaces/Account.html b/docs/interfaces/Account.html index b906c5d1..92d8e50d 100644 --- a/docs/interfaces/Account.html +++ b/docs/interfaces/Account.html @@ -5,4 +5,4 @@
    property

    iamKeyActive - Whether credentials with IAM permissions can be provisioned from this account

    property

    maxKeyDuration - The maximum key duration for this account

    property

    skypieaAccount - extra information about the account from Skypiea

    -

Hierarchy

  • Account

Index

Properties

account: string
iamKeyActive: boolean
maxKeyDuration: number
role: string
securityLevel: string
skypieaAccount: null | export=.SkypieaAccount

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • Account

Index

Properties

account: string
iamKeyActive: boolean
maxKeyDuration: number
role: string
securityLevel: string
skypieaAccount: null | export=.SkypieaAccount

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/AccountUserDetails.html b/docs/interfaces/AccountUserDetails.html index cea244f1..2c0318af 100644 --- a/docs/interfaces/AccountUserDetails.html +++ b/docs/interfaces/AccountUserDetails.html @@ -3,4 +3,4 @@
property

samAccountName - the samAccountName of the user

property

email - the email of the user

property

href - the href self link

-

Hierarchy

  • AccountUserDetails

Index

Properties

email: string
href: string
samAccountName: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • AccountUserDetails

Index

Properties

email: string
href: string
samAccountName: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/AwsAccountRole.html b/docs/interfaces/AwsAccountRole.html index e68ee757..5f11be62 100644 --- a/docs/interfaces/AwsAccountRole.html +++ b/docs/interfaces/AwsAccountRole.html @@ -3,4 +3,4 @@
property

roleArn - The AWS Role ARN

property

isMachineIdentity - true|false value of if this role is a machine identity

property

assumeRolePolicyDocument - The AWS assume role policy document associated with this role

-

Hierarchy

  • AwsAccountRole

Index

Properties

assumeRolePolicyDocument: object
isMachineIdentity: boolean
roleArn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • AwsAccountRole

Index

Properties

assumeRolePolicyDocument: object
isMachineIdentity: boolean
roleArn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/AwsRoleType.html b/docs/interfaces/AwsRoleType.html index 21beee7c..691cd0d8 100644 --- a/docs/interfaces/AwsRoleType.html +++ b/docs/interfaces/AwsRoleType.html @@ -5,4 +5,4 @@
property

trustRelationship - The AWS trust policy document associated with this role

property

instanceProfile - Whether this role is an instance profile

property

templateVariables - A list of template variables that exist within the role type's trust policy document

-

Hierarchy

  • AwsRoleType

Index

Properties

defaultArns: string[]
instanceProfile: boolean
roleTypeName: string
templateVariables?: string[]
trustRelationship: object

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • AwsRoleType

Index

Properties

defaultArns: string[]
instanceProfile: boolean
roleTypeName: string
templateVariables?: string[]
trustRelationship: object

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/CloudsploitReport.html b/docs/interfaces/CloudsploitReport.html index 8486812b..e9b213bf 100644 --- a/docs/interfaces/CloudsploitReport.html +++ b/docs/interfaces/CloudsploitReport.html @@ -12,4 +12,4 @@
property

warning - the amount of warnings

property

failing - the amount of fails

property

unknown - the amount of unknowns

-

Hierarchy

  • CloudsploitReport

Index

Properties

awsAccountId: string
day: number
failing: number
href: string
month: number
newRisks: number
passing: number
scanDate: string
scanId: number
unknown: number
warning: number
year: number

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • CloudsploitReport

Index

Properties

awsAccountId: string
day: number
failing: number
href: string
month: number
newRisks: number
passing: number
scanDate: string
scanId: number
unknown: number
warning: number
year: number

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/CostTotal.html b/docs/interfaces/CostTotal.html index 471a5edd..93574ba0 100644 --- a/docs/interfaces/CostTotal.html +++ b/docs/interfaces/CostTotal.html @@ -1 +1 @@ -CostTotal | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface CostTotal

Hierarchy

  • CostTotal

Index

Properties

awsAccountId: string
daily: string
dailyCostsByService: Record<string, string>
dd: string
mm: string
monthly: string
monthlyCostsByService: Record<string, string>
weekly: string
yearly: string
yyyy: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +CostTotal | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface CostTotal

Hierarchy

  • CostTotal

Index

Properties

awsAccountId: string
daily: string
dailyCostsByService: Record<string, string>
dd: string
mm: string
monthly: string
monthlyCostsByService: Record<string, string>
weekly: string
yearly: string
yyyy: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/IamUser.html b/docs/interfaces/IamUser.html index 396669b8..1673d108 100644 --- a/docs/interfaces/IamUser.html +++ b/docs/interfaces/IamUser.html @@ -1 +1 @@ -IamUser | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IamUser

Hierarchy

  • IamUser

Index

Properties

accessKey: string
accountId: string
arn: string
tags: export=.Tag[]
userName: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +IamUser | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IamUser

Hierarchy

  • IamUser

Index

Properties

accessKey: string
accountId: string
arn: string
tags: export=.Tag[]
userName: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/Key.html b/docs/interfaces/Key.html index 22b1ae86..97933900 100644 --- a/docs/interfaces/Key.html +++ b/docs/interfaces/Key.html @@ -4,4 +4,4 @@
property

secretKey - AWS secret key

property

sessionToken - AWS STS session token

property

consoleURL - a URL to the AWS console using these keys

-

Hierarchy

  • Key

Index

Properties

accessKey: string
consoleURL: string
secretKey: string
sessionToken: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • Key

Index

Properties

accessKey: string
consoleURL: string
secretKey: string
sessionToken: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/LongTermKey.html b/docs/interfaces/LongTermKey.html index 6a3c9010..e7a9b8ad 100644 --- a/docs/interfaces/LongTermKey.html +++ b/docs/interfaces/LongTermKey.html @@ -4,4 +4,4 @@
property

accessKey - the long term access key

property

secretKey - the secret key for the long term access key

property

addedIAMUserToGroup - whether the user was successfuly added to the deny policy group

-

Hierarchy

  • LongTermKey

Index

Properties

accessKey: string
addedIAMUserToGroup: boolean
iamUserArn: string
secretKey: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • LongTermKey

Index

Properties

accessKey: string
addedIAMUserToGroup: boolean
iamUserArn: string
secretKey: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/MachineIdentity.html b/docs/interfaces/MachineIdentity.html index 26f0a354..c33872e5 100644 --- a/docs/interfaces/MachineIdentity.html +++ b/docs/interfaces/MachineIdentity.html @@ -1 +1 @@ -MachineIdentity | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MachineIdentity

Hierarchy

  • MachineIdentity

Index

Properties

machineIdentityArn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +MachineIdentity | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MachineIdentity

Hierarchy

  • MachineIdentity

Index

Properties

machineIdentityArn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/RefreshToken.html b/docs/interfaces/RefreshToken.html index 5ff9dcc8..ce0ee61d 100644 --- a/docs/interfaces/RefreshToken.html +++ b/docs/interfaces/RefreshToken.html @@ -1 +1 @@ -RefreshToken | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface RefreshToken

Hierarchy

  • RefreshToken

Index

Properties

clientId: string
id: string
userId: string
value: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +RefreshToken | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface RefreshToken

Hierarchy

  • RefreshToken

Index

Properties

clientId: string
id: string
userId: string
value: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/Role.html b/docs/interfaces/Role.html index cf55a8ba..77937156 100644 --- a/docs/interfaces/Role.html +++ b/docs/interfaces/Role.html @@ -5,4 +5,4 @@
property

instanceProfileArn - The Instance Profile ARN associated with this role

property

addedRoleToInstanceProfile - Whether this role was added to an Instance Profile

property

tags - Resource tags associated with the IAM account role

-

Hierarchy

  • Role

Index

Properties

addedRoleToInstanceProfile?: boolean
denyArns?: string
instanceProfileArn: string
isMachineIdentity?: boolean
maxSessionDurationInSeconds?: number
roleArn: string
tags?: export=.Tag[]

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • Role

Index

Properties

addedRoleToInstanceProfile?: boolean
denyArns?: string
instanceProfileArn: string
isMachineIdentity?: boolean
maxSessionDurationInSeconds?: number
roleArn: string
tags?: export=.Tag[]

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/SkypieaAccount.html b/docs/interfaces/SkypieaAccount.html index ffd3601d..77acee41 100644 --- a/docs/interfaces/SkypieaAccount.html +++ b/docs/interfaces/SkypieaAccount.html @@ -3,4 +3,4 @@
property

label - the friendly name of the account

property

accountOwners - the samAccountNames of the account owners

property

cloudsploitTrend - the cloudsploit trends

-

Hierarchy

  • SkypieaAccount

Index

Properties

accountOwners: export=.AccountUserDetails[]
cloudsploitTrend: export=.CloudsploitReport[]
label: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • SkypieaAccount

Index

Properties

accountOwners: export=.AccountUserDetails[]
cloudsploitTrend: export=.CloudsploitReport[]
label: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/Tag.html b/docs/interfaces/Tag.html index 8f7d44c4..41f3fe41 100644 --- a/docs/interfaces/Tag.html +++ b/docs/interfaces/Tag.html @@ -2,4 +2,4 @@

Alks role tags

property

key - The AWS role tag key

property

value - The AWS role tag value

-

Hierarchy

  • Tag

Index

Properties

Properties

key: string
value: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • Tag

Index

Properties

Properties

key: string
value: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/User.html b/docs/interfaces/User.html index fafd0ac1..df4c4345 100644 --- a/docs/interfaces/User.html +++ b/docs/interfaces/User.html @@ -5,4 +5,4 @@
property

email - The user email

property

title - The user title

property

department - The user department

-

Hierarchy

  • User

Index

Properties

department: string
displayName: string
email: string
sAMAccountName: string
title: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • User

Index

Properties

department: string
displayName: string
email: string
sAMAccountName: string
title: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.AccessToken.html b/docs/interfaces/export_.AccessToken.html index 580ffd95..e6484a76 100644 --- a/docs/interfaces/export_.AccessToken.html +++ b/docs/interfaces/export_.AccessToken.html @@ -1 +1 @@ -AccessToken | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface AccessToken

Hierarchy

  • AccessToken

Index

Properties

accessToken: string
expiresIn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +AccessToken | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface AccessToken

Hierarchy

  • AccessToken

Index

Properties

accessToken: string
expiresIn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.Account.html b/docs/interfaces/export_.Account.html index 3f5e1d46..a993aecc 100644 --- a/docs/interfaces/export_.Account.html +++ b/docs/interfaces/export_.Account.html @@ -5,4 +5,4 @@
property

iamKeyActive - Whether credentials with IAM permissions can be provisioned from this account

property

maxKeyDuration - The maximum key duration for this account

property

skypieaAccount - extra information about the account from Skypiea

-

Hierarchy

  • Account

Index

Properties

account: string
iamKeyActive: boolean
maxKeyDuration: number
role: string
securityLevel: string
skypieaAccount: null | export=.SkypieaAccount

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • Account

Index

Properties

account: string
iamKeyActive: boolean
maxKeyDuration: number
role: string
securityLevel: string
skypieaAccount: null | export=.SkypieaAccount

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.AccountUserDetails.html b/docs/interfaces/export_.AccountUserDetails.html index 3b8f341e..9c067bb5 100644 --- a/docs/interfaces/export_.AccountUserDetails.html +++ b/docs/interfaces/export_.AccountUserDetails.html @@ -3,4 +3,4 @@
property

samAccountName - the samAccountName of the user

property

email - the email of the user

property

href - the href self link

-

Hierarchy

  • AccountUserDetails

Index

Properties

email: string
href: string
samAccountName: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • AccountUserDetails

Index

Properties

email: string
href: string
samAccountName: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.AwsAccountRole.html b/docs/interfaces/export_.AwsAccountRole.html index 2db4b67a..43460d4d 100644 --- a/docs/interfaces/export_.AwsAccountRole.html +++ b/docs/interfaces/export_.AwsAccountRole.html @@ -3,4 +3,4 @@
property

roleArn - The AWS Role ARN

property

isMachineIdentity - true|false value of if this role is a machine identity

property

assumeRolePolicyDocument - The AWS assume role policy document associated with this role

-

Hierarchy

  • AwsAccountRole

Index

Properties

assumeRolePolicyDocument: object
isMachineIdentity: boolean
roleArn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • AwsAccountRole

Index

Properties

assumeRolePolicyDocument: object
isMachineIdentity: boolean
roleArn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.AwsRoleType.html b/docs/interfaces/export_.AwsRoleType.html index 4e98ed42..714624b1 100644 --- a/docs/interfaces/export_.AwsRoleType.html +++ b/docs/interfaces/export_.AwsRoleType.html @@ -5,4 +5,4 @@
property

trustRelationship - The AWS trust policy document associated with this role

property

instanceProfile - Whether this role is an instance profile

property

templateVariables - A list of template variables that exist within the role type's trust policy document

-

Hierarchy

  • AwsRoleType

Index

Properties

defaultArns: string[]
instanceProfile: boolean
roleTypeName: string
templateVariables?: string[]
trustRelationship: object

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • AwsRoleType

Index

Properties

defaultArns: string[]
instanceProfile: boolean
roleTypeName: string
templateVariables?: string[]
trustRelationship: object

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.CloudsploitReport.html b/docs/interfaces/export_.CloudsploitReport.html index ce66a145..42cdfbf7 100644 --- a/docs/interfaces/export_.CloudsploitReport.html +++ b/docs/interfaces/export_.CloudsploitReport.html @@ -12,4 +12,4 @@
property

warning - the amount of warnings

property

failing - the amount of fails

property

unknown - the amount of unknowns

-

Hierarchy

  • CloudsploitReport

Index

Properties

awsAccountId: string
day: number
failing: number
href: string
month: number
newRisks: number
passing: number
scanDate: string
scanId: number
unknown: number
warning: number
year: number

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • CloudsploitReport

Index

Properties

awsAccountId: string
day: number
failing: number
href: string
month: number
newRisks: number
passing: number
scanDate: string
scanId: number
unknown: number
warning: number
year: number

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.CostTotal.html b/docs/interfaces/export_.CostTotal.html index 72a17390..837f4f74 100644 --- a/docs/interfaces/export_.CostTotal.html +++ b/docs/interfaces/export_.CostTotal.html @@ -1 +1 @@ -CostTotal | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface CostTotal

Hierarchy

  • CostTotal

Index

Properties

awsAccountId: string
daily: string
dailyCostsByService: Record<string, string>
dd: string
mm: string
monthly: string
monthlyCostsByService: Record<string, string>
weekly: string
yearly: string
yyyy: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +CostTotal | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface CostTotal

Hierarchy

  • CostTotal

Index

Properties

awsAccountId: string
daily: string
dailyCostsByService: Record<string, string>
dd: string
mm: string
monthly: string
monthlyCostsByService: Record<string, string>
weekly: string
yearly: string
yyyy: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.IamUser.html b/docs/interfaces/export_.IamUser.html index 87a8e64d..02521d0e 100644 --- a/docs/interfaces/export_.IamUser.html +++ b/docs/interfaces/export_.IamUser.html @@ -1 +1 @@ -IamUser | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IamUser

Hierarchy

  • IamUser

Index

Properties

accessKey: string
accountId: string
arn: string
tags: export=.Tag[]
userName: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +IamUser | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IamUser

Hierarchy

  • IamUser

Index

Properties

accessKey: string
accountId: string
arn: string
tags: export=.Tag[]
userName: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.Key.html b/docs/interfaces/export_.Key.html index fcc17e97..c4b8f8c8 100644 --- a/docs/interfaces/export_.Key.html +++ b/docs/interfaces/export_.Key.html @@ -4,4 +4,4 @@
property

secretKey - AWS secret key

property

sessionToken - AWS STS session token

property

consoleURL - a URL to the AWS console using these keys

-

Hierarchy

  • Key

Index

Properties

accessKey: string
consoleURL: string
secretKey: string
sessionToken: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • Key

Index

Properties

accessKey: string
consoleURL: string
secretKey: string
sessionToken: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.LongTermKey.html b/docs/interfaces/export_.LongTermKey.html index 4700060a..b710f3dc 100644 --- a/docs/interfaces/export_.LongTermKey.html +++ b/docs/interfaces/export_.LongTermKey.html @@ -4,4 +4,4 @@
property

accessKey - the long term access key

property

secretKey - the secret key for the long term access key

property

addedIAMUserToGroup - whether the user was successfuly added to the deny policy group

-

Hierarchy

  • LongTermKey

Index

Properties

accessKey: string
addedIAMUserToGroup: boolean
iamUserArn: string
secretKey: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • LongTermKey

Index

Properties

accessKey: string
addedIAMUserToGroup: boolean
iamUserArn: string
secretKey: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.MachineIdentity.html b/docs/interfaces/export_.MachineIdentity.html index ac2615e8..fa68c77b 100644 --- a/docs/interfaces/export_.MachineIdentity.html +++ b/docs/interfaces/export_.MachineIdentity.html @@ -1 +1 @@ -MachineIdentity | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MachineIdentity

Hierarchy

  • MachineIdentity

Index

Properties

machineIdentityArn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +MachineIdentity | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MachineIdentity

Hierarchy

  • MachineIdentity

Index

Properties

machineIdentityArn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.RefreshToken.html b/docs/interfaces/export_.RefreshToken.html index 912ef630..a87a2d41 100644 --- a/docs/interfaces/export_.RefreshToken.html +++ b/docs/interfaces/export_.RefreshToken.html @@ -1 +1 @@ -RefreshToken | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface RefreshToken

Hierarchy

  • RefreshToken

Index

Properties

clientId: string
id: string
userId: string
value: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +RefreshToken | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface RefreshToken

Hierarchy

  • RefreshToken

Index

Properties

clientId: string
id: string
userId: string
value: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.Role.html b/docs/interfaces/export_.Role.html index d70b5476..248f3b54 100644 --- a/docs/interfaces/export_.Role.html +++ b/docs/interfaces/export_.Role.html @@ -5,4 +5,4 @@
property

instanceProfileArn - The Instance Profile ARN associated with this role

property

addedRoleToInstanceProfile - Whether this role was added to an Instance Profile

property

tags - Resource tags associated with the IAM account role

-

Hierarchy

  • Role

Index

Properties

addedRoleToInstanceProfile?: boolean
denyArns?: string
instanceProfileArn: string
isMachineIdentity?: boolean
maxSessionDurationInSeconds?: number
roleArn: string
tags?: export=.Tag[]

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • Role

Index

Properties

addedRoleToInstanceProfile?: boolean
denyArns?: string
instanceProfileArn: string
isMachineIdentity?: boolean
maxSessionDurationInSeconds?: number
roleArn: string
tags?: export=.Tag[]

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.SkypieaAccount.html b/docs/interfaces/export_.SkypieaAccount.html index 43fd2ada..76272a6c 100644 --- a/docs/interfaces/export_.SkypieaAccount.html +++ b/docs/interfaces/export_.SkypieaAccount.html @@ -3,4 +3,4 @@
property

label - the friendly name of the account

property

accountOwners - the samAccountNames of the account owners

property

cloudsploitTrend - the cloudsploit trends

-

Hierarchy

  • SkypieaAccount

Index

Properties

accountOwners: export=.AccountUserDetails[]
cloudsploitTrend: export=.CloudsploitReport[]
label: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • SkypieaAccount

Index

Properties

accountOwners: export=.AccountUserDetails[]
cloudsploitTrend: export=.CloudsploitReport[]
label: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.Tag.html b/docs/interfaces/export_.Tag.html index 7842277b..7bb4d272 100644 --- a/docs/interfaces/export_.Tag.html +++ b/docs/interfaces/export_.Tag.html @@ -2,4 +2,4 @@

Alks role tags

property

key - The AWS role tag key

property

value - The AWS role tag value

-

Hierarchy

  • Tag

Index

Properties

Properties

key: string
value: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • Tag

Index

Properties

Properties

key: string
value: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.User.html b/docs/interfaces/export_.User.html index 96faece9..bc488102 100644 --- a/docs/interfaces/export_.User.html +++ b/docs/interfaces/export_.User.html @@ -5,4 +5,4 @@
property

email - The user email

property

title - The user title

property

department - The user department

-

Hierarchy

  • User

Index

Properties

department: string
displayName: string
email: string
sAMAccountName: string
title: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • User

Index

Properties

department: string
displayName: string
email: string
sAMAccountName: string
title: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules.html b/docs/modules.html index 194edc45..ca961036 100644 --- a/docs/modules.html +++ b/docs/modules.html @@ -1 +1 @@ -alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

alks.js

Index

Type aliases

AddRoleMachineIdentityProps: Partial<export=.AlksProps> & { roleARN: string }
AlksProps: BaseConfig & Auth
AwsAccountRolesProps: Partial<export=.AlksProps> & { account: string }
CreateAccessKeysProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; role: string; tags?: export=.Tag[] }
CreateNonServiceRoleProps: Partial<export=.AlksProps> & { account: string; enableAlksAccess: boolean; externalId?: string; includeDefaultPolicy: PseudoBoolean; role: string; roleName: string; roleType: TrustType; tags?: export=.Tag[]; trustArn: string }
CreateRoleProps: Partial<export=.AlksProps> & { account: string; enableAlksAccess: boolean; includeDefaultPolicy: PseudoBoolean; role: string; roleName: string; roleType?: string; tags?: export=.Tag[]; templateFields?: Record<string, string>; trustPolicy?: Record<string, unknown> }
DeleteIAMUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; role: string }
DeleteRoleMachineIdentityProps: Partial<export=.AlksProps> & { roleARN: string }
DeleteRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string }
GetAWSRoleTypesProps: Partial<export=.AlksProps> & {}
GetAccessTokenProps: Partial<export=.AlksProps> & { refreshToken: string }
GetAccountOwnersProps: Partial<export=.AlksProps> & { accountId: string }
GetAccountRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string }
GetAccountsProps: Partial<export=.AlksProps> & {}
GetAllAWSRoleTypesProps: Partial<export=.AlksProps> & { getDynamicValues?: boolean }
GetCostTotalsProps: Partial<export=.AlksProps> & { accountId: string }
GetIAMKeysProps: Partial<export=.AlksProps> & { account: string; role: string; sessionTime: number }
GetIamUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string }
GetKeysProps: Partial<export=.AlksProps> & { account: string; role: string; sessionTime: number }
GetLoginRoleProps: Partial<export=.AlksProps> & { accountId: string; role: string }
GetNonServiceAWSRoleTypesProps: Partial<export=.AlksProps> & {}
GetRefreshTokensProps: Partial<export=.AlksProps> & {}
GetUserAccessByRoleProps: Partial<export=.AlksProps> & { accountId: string }
GetUserAccessProps: Partial<export=.AlksProps> & { accountId: string }
GetUserRoleAccessProps: Partial<export=.AlksProps> & { accountId: string; sAMAccountName: string }
ListAWSAccountRolesProps: Partial<export=.AlksProps> & { account: string; role: string }
RevokeByIdProps: Partial<export=.AlksProps> & { tokenId: string }
RevokeByValueProps: Partial<export=.AlksProps> & { token: string }
UpdateIamUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; tags?: export=.Tag[] }
UpdateRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string; tags: export=.Tag[] }
VersionProps: Partial<export=.AlksProps> & {}

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

alks.js

Index

Type aliases

AddRoleMachineIdentityProps: Partial<export=.AlksProps> & { roleARN: string }
AlksProps: BaseConfig & Auth
AwsAccountRolesProps: Partial<export=.AlksProps> & { account: string }
CreateAccessKeysProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; role: string; tags?: export=.Tag[] }
CreateNonServiceRoleProps: Partial<export=.AlksProps> & { account: string; enableAlksAccess: boolean; externalId?: string; includeDefaultPolicy: PseudoBoolean; role: string; roleName: string; roleType: TrustType; tags?: export=.Tag[]; trustArn: string }
CreateRoleProps: Partial<export=.AlksProps> & { account: string; enableAlksAccess: boolean; includeDefaultPolicy: PseudoBoolean; role: string; roleName: string; roleType?: string; tags?: export=.Tag[]; templateFields?: Record<string, string>; trustPolicy?: Record<string, unknown> }
DeleteIAMUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; role: string }
DeleteRoleMachineIdentityProps: Partial<export=.AlksProps> & { roleARN: string }
DeleteRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string }
GetAWSRoleTypesProps: Partial<export=.AlksProps> & {}
GetAccessTokenProps: Partial<export=.AlksProps> & { refreshToken: string }
GetAccountOwnersProps: Partial<export=.AlksProps> & { accountId: string }
GetAccountRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string }
GetAccountsProps: Partial<export=.AlksProps> & {}
GetAllAWSRoleTypesProps: Partial<export=.AlksProps> & { getDynamicValues?: boolean }
GetCostTotalsProps: Partial<export=.AlksProps> & { accountId: string }
GetIAMKeysProps: Partial<export=.AlksProps> & { account: string; role: string; sessionTime: number }
GetIamUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string }
GetKeysProps: Partial<export=.AlksProps> & { account: string; role: string; sessionTime: number }
GetLoginRoleProps: Partial<export=.AlksProps> & { accountId: string; role: string }
GetNonServiceAWSRoleTypesProps: Partial<export=.AlksProps> & {}
GetRefreshTokensProps: Partial<export=.AlksProps> & {}
GetUserAccessByRoleProps: Partial<export=.AlksProps> & { accountId: string }
GetUserAccessProps: Partial<export=.AlksProps> & { accountId: string }
GetUserRoleAccessProps: Partial<export=.AlksProps> & { accountId: string; sAMAccountName: string }
ListAWSAccountRolesProps: Partial<export=.AlksProps> & { account: string; role: string }
RevokeByIdProps: Partial<export=.AlksProps> & { tokenId: string }
RevokeByValueProps: Partial<export=.AlksProps> & { token: string }
UpdateIamUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; tags?: export=.Tag[] }
UpdateRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string; tags: export=.Tag[] }
VersionProps: Partial<export=.AlksProps> & {}

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules/export_.html b/docs/modules/export_.html index 77a4acd1..3b381afb 100644 --- a/docs/modules/export_.html +++ b/docs/modules/export_.html @@ -1 +1 @@ -export= | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace export=

Index

Type aliases

AddRoleMachineIdentityProps: Partial<export=.AlksProps> & { roleARN: string }
AlksProps: BaseConfig & Auth
AwsAccountRolesProps: Partial<export=.AlksProps> & { account: string }
CreateAccessKeysProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; role: string; tags?: export=.Tag[] }
CreateNonServiceRoleProps: Partial<export=.AlksProps> & { account: string; enableAlksAccess: boolean; externalId?: string; includeDefaultPolicy: PseudoBoolean; role: string; roleName: string; roleType: TrustType; tags?: export=.Tag[]; trustArn: string }
CreateRoleProps: Partial<export=.AlksProps> & { account: string; enableAlksAccess: boolean; includeDefaultPolicy: PseudoBoolean; role: string; roleName: string; roleType?: string; tags?: export=.Tag[]; templateFields?: Record<string, string>; trustPolicy?: Record<string, unknown> }
DeleteIAMUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; role: string }
DeleteRoleMachineIdentityProps: Partial<export=.AlksProps> & { roleARN: string }
DeleteRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string }
GetAWSRoleTypesProps: Partial<export=.AlksProps> & {}
GetAccessTokenProps: Partial<export=.AlksProps> & { refreshToken: string }
GetAccountOwnersProps: Partial<export=.AlksProps> & { accountId: string }
GetAccountRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string }
GetAccountsProps: Partial<export=.AlksProps> & {}
GetAllAWSRoleTypesProps: Partial<export=.AlksProps> & { getDynamicValues?: boolean }
GetCostTotalsProps: Partial<export=.AlksProps> & { accountId: string }
GetIAMKeysProps: Partial<export=.AlksProps> & { account: string; role: string; sessionTime: number }
GetIamUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string }
GetKeysProps: Partial<export=.AlksProps> & { account: string; role: string; sessionTime: number }
GetLoginRoleProps: Partial<export=.AlksProps> & { accountId: string; role: string }
GetNonServiceAWSRoleTypesProps: Partial<export=.AlksProps> & {}
GetRefreshTokensProps: Partial<export=.AlksProps> & {}
GetUserAccessByRoleProps: Partial<export=.AlksProps> & { accountId: string }
GetUserAccessProps: Partial<export=.AlksProps> & { accountId: string }
GetUserRoleAccessProps: Partial<export=.AlksProps> & { accountId: string; sAMAccountName: string }
ListAWSAccountRolesProps: Partial<export=.AlksProps> & { account: string; role: string }
RevokeByIdProps: Partial<export=.AlksProps> & { tokenId: string }
RevokeByValueProps: Partial<export=.AlksProps> & { token: string }
UpdateIamUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; tags?: export=.Tag[] }
UpdateRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string; tags: export=.Tag[] }
VersionProps: Partial<export=.AlksProps> & {}

Functions

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +export= | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace export=

Index

Type aliases

AddRoleMachineIdentityProps: Partial<export=.AlksProps> & { roleARN: string }
AlksProps: BaseConfig & Auth
AwsAccountRolesProps: Partial<export=.AlksProps> & { account: string }
CreateAccessKeysProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; role: string; tags?: export=.Tag[] }
CreateNonServiceRoleProps: Partial<export=.AlksProps> & { account: string; enableAlksAccess: boolean; externalId?: string; includeDefaultPolicy: PseudoBoolean; role: string; roleName: string; roleType: TrustType; tags?: export=.Tag[]; trustArn: string }
CreateRoleProps: Partial<export=.AlksProps> & { account: string; enableAlksAccess: boolean; includeDefaultPolicy: PseudoBoolean; role: string; roleName: string; roleType?: string; tags?: export=.Tag[]; templateFields?: Record<string, string>; trustPolicy?: Record<string, unknown> }
DeleteIAMUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; role: string }
DeleteRoleMachineIdentityProps: Partial<export=.AlksProps> & { roleARN: string }
DeleteRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string }
GetAWSRoleTypesProps: Partial<export=.AlksProps> & {}
GetAccessTokenProps: Partial<export=.AlksProps> & { refreshToken: string }
GetAccountOwnersProps: Partial<export=.AlksProps> & { accountId: string }
GetAccountRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string }
GetAccountsProps: Partial<export=.AlksProps> & {}
GetAllAWSRoleTypesProps: Partial<export=.AlksProps> & { getDynamicValues?: boolean }
GetCostTotalsProps: Partial<export=.AlksProps> & { accountId: string }
GetIAMKeysProps: Partial<export=.AlksProps> & { account: string; role: string; sessionTime: number }
GetIamUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string }
GetKeysProps: Partial<export=.AlksProps> & { account: string; role: string; sessionTime: number }
GetLoginRoleProps: Partial<export=.AlksProps> & { accountId: string; role: string }
GetNonServiceAWSRoleTypesProps: Partial<export=.AlksProps> & {}
GetRefreshTokensProps: Partial<export=.AlksProps> & {}
GetUserAccessByRoleProps: Partial<export=.AlksProps> & { accountId: string }
GetUserAccessProps: Partial<export=.AlksProps> & { accountId: string }
GetUserRoleAccessProps: Partial<export=.AlksProps> & { accountId: string; sAMAccountName: string }
ListAWSAccountRolesProps: Partial<export=.AlksProps> & { account: string; role: string }
RevokeByIdProps: Partial<export=.AlksProps> & { tokenId: string }
RevokeByValueProps: Partial<export=.AlksProps> & { token: string }
UpdateIamUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; tags?: export=.Tag[] }
UpdateRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string; tags: export=.Tag[] }
VersionProps: Partial<export=.AlksProps> & {}

Functions

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 8aa87bb1..8da3676f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,8 +11,7 @@ "dependencies": { "encoding": "^0.1.13", "node-fetch": "^2.6.1", - "tslib": "^2.3.1", - "typedoc": "^0.22.15" + "tslib": "^2.3.1" }, "devDependencies": { "@rollup/plugin-commonjs": "^19.0.0", @@ -45,6 +44,7 @@ "rollup-plugin-replace": "^2.2.0", "sinon": "^10.0.0", "tslint": "^6.1.3", + "typedoc": "^0.22.15", "typescript": "^4.2.4", "uglify-js": "^3.13.6" }, @@ -1094,7 +1094,8 @@ "node_modules/balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true }, "node_modules/base64-js": { "version": "1.5.1", @@ -1198,6 +1199,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1895,7 +1897,8 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true }, "node_modules/concat-stream": { "version": "1.6.2", @@ -3303,7 +3306,8 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true }, "node_modules/fsevents": { "version": "2.3.2", @@ -3418,6 +3422,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -3815,6 +3820,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -3823,7 +3829,8 @@ "node_modules/inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true }, "node_modules/inline-source-map": { "version": "0.6.2", @@ -4413,7 +4420,8 @@ "node_modules/jsonc-parser": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz", - "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==" + "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==", + "dev": true }, "node_modules/jsonfile": { "version": "6.1.0", @@ -4975,7 +4983,8 @@ "node_modules/lunr": { "version": "2.3.9", "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", - "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==" + "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", + "dev": true }, "node_modules/magic-string": { "version": "0.25.7", @@ -5014,6 +5023,7 @@ "version": "4.0.15", "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.15.tgz", "integrity": "sha512-esX5lPdTfG4p8LDkv+obbRCyOKzB+820ZZyMOXJZygZBHrH9b3xXR64X4kT3sPe9Nx8qQXbmcz6kFSMt4Nfk6Q==", + "dev": true, "bin": { "marked": "bin/marked.js" }, @@ -5124,6 +5134,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -5725,6 +5736,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, "dependencies": { "wrappy": "1" } @@ -5950,6 +5962,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -6637,6 +6650,7 @@ "version": "0.10.1", "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.10.1.tgz", "integrity": "sha512-VsY7QJVzU51j5o1+DguUd+6vmCmZ5v/6gYu4vyYAhzjuNQU6P/vmSy4uQaOhvje031qQMiW0d2BwgMH52vqMng==", + "dev": true, "dependencies": { "jsonc-parser": "^3.0.0", "vscode-oniguruma": "^1.6.1", @@ -7453,6 +7467,7 @@ "version": "0.22.15", "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.15.tgz", "integrity": "sha512-CMd1lrqQbFvbx6S9G6fL4HKp3GoIuhujJReWqlIvSb2T26vGai+8Os3Mde7Pn832pXYemd9BMuuYWhFpL5st0Q==", + "dev": true, "dependencies": { "glob": "^7.2.0", "lunr": "^2.3.9", @@ -7474,6 +7489,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, @@ -7485,6 +7501,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, "dependencies": { "balanced-match": "^1.0.0" } @@ -7493,6 +7510,7 @@ "version": "4.2.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", + "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -7710,12 +7728,14 @@ "node_modules/vscode-oniguruma": { "version": "1.6.2", "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.6.2.tgz", - "integrity": "sha512-KH8+KKov5eS/9WhofZR8M8dMHWN2gTxjMsG4jd04YhpbPR91fUj7rYQ2/XjeHCJWbg7X++ApRIU9NUwM2vTvLA==" + "integrity": "sha512-KH8+KKov5eS/9WhofZR8M8dMHWN2gTxjMsG4jd04YhpbPR91fUj7rYQ2/XjeHCJWbg7X++ApRIU9NUwM2vTvLA==", + "dev": true }, "node_modules/vscode-textmate": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-5.2.0.tgz", - "integrity": "sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ==" + "integrity": "sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ==", + "dev": true }, "node_modules/watchify": { "version": "4.0.0", @@ -7906,7 +7926,8 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true }, "node_modules/write-file-atomic": { "version": "3.0.3", @@ -8990,7 +9011,8 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true }, "base64-js": { "version": "1.5.1", @@ -9070,6 +9092,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -9650,7 +9673,8 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true }, "concat-stream": { "version": "1.6.2", @@ -10763,7 +10787,8 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true }, "fsevents": { "version": "2.3.2", @@ -10850,6 +10875,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -11126,6 +11152,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -11134,7 +11161,8 @@ "inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true }, "inline-source-map": { "version": "0.6.2", @@ -11567,7 +11595,8 @@ "jsonc-parser": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz", - "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==" + "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==", + "dev": true }, "jsonfile": { "version": "6.1.0", @@ -12015,7 +12044,8 @@ "lunr": { "version": "2.3.9", "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", - "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==" + "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", + "dev": true }, "magic-string": { "version": "0.25.7", @@ -12046,7 +12076,8 @@ "marked": { "version": "4.0.15", "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.15.tgz", - "integrity": "sha512-esX5lPdTfG4p8LDkv+obbRCyOKzB+820ZZyMOXJZygZBHrH9b3xXR64X4kT3sPe9Nx8qQXbmcz6kFSMt4Nfk6Q==" + "integrity": "sha512-esX5lPdTfG4p8LDkv+obbRCyOKzB+820ZZyMOXJZygZBHrH9b3xXR64X4kT3sPe9Nx8qQXbmcz6kFSMt4Nfk6Q==", + "dev": true }, "md5.js": { "version": "1.3.5", @@ -12132,6 +12163,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -12601,6 +12633,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, "requires": { "wrappy": "1" } @@ -12776,7 +12809,8 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true }, "path-key": { "version": "3.1.1", @@ -13339,6 +13373,7 @@ "version": "0.10.1", "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.10.1.tgz", "integrity": "sha512-VsY7QJVzU51j5o1+DguUd+6vmCmZ5v/6gYu4vyYAhzjuNQU6P/vmSy4uQaOhvje031qQMiW0d2BwgMH52vqMng==", + "dev": true, "requires": { "jsonc-parser": "^3.0.0", "vscode-oniguruma": "^1.6.1", @@ -13999,6 +14034,7 @@ "version": "0.22.15", "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.15.tgz", "integrity": "sha512-CMd1lrqQbFvbx6S9G6fL4HKp3GoIuhujJReWqlIvSb2T26vGai+8Os3Mde7Pn832pXYemd9BMuuYWhFpL5st0Q==", + "dev": true, "requires": { "glob": "^7.2.0", "lunr": "^2.3.9", @@ -14011,6 +14047,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "dev": true, "requires": { "brace-expansion": "^2.0.1" }, @@ -14019,6 +14056,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, "requires": { "balanced-match": "^1.0.0" } @@ -14030,7 +14068,8 @@ "typescript": { "version": "4.2.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", - "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==" + "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", + "dev": true }, "ua-parser-js": { "version": "0.7.31", @@ -14192,12 +14231,14 @@ "vscode-oniguruma": { "version": "1.6.2", "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.6.2.tgz", - "integrity": "sha512-KH8+KKov5eS/9WhofZR8M8dMHWN2gTxjMsG4jd04YhpbPR91fUj7rYQ2/XjeHCJWbg7X++ApRIU9NUwM2vTvLA==" + "integrity": "sha512-KH8+KKov5eS/9WhofZR8M8dMHWN2gTxjMsG4jd04YhpbPR91fUj7rYQ2/XjeHCJWbg7X++ApRIU9NUwM2vTvLA==", + "dev": true }, "vscode-textmate": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-5.2.0.tgz", - "integrity": "sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ==" + "integrity": "sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ==", + "dev": true }, "watchify": { "version": "4.0.0", @@ -14353,7 +14394,8 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true }, "write-file-atomic": { "version": "3.0.3", diff --git a/package.json b/package.json index 7e30efb3..fc411754 100644 --- a/package.json +++ b/package.json @@ -45,8 +45,7 @@ "dependencies": { "encoding": "^0.1.13", "node-fetch": "^2.6.1", - "tslib": "^2.3.1", - "typedoc": "^0.22.15" + "tslib": "^2.3.1" }, "devDependencies": { "@rollup/plugin-commonjs": "^19.0.0", @@ -79,6 +78,7 @@ "rollup-plugin-replace": "^2.2.0", "sinon": "^10.0.0", "tslint": "^6.1.3", + "typedoc": "^0.22.15", "typescript": "^4.2.4", "uglify-js": "^3.13.6" }, From 76cc36c28cbe129f25704195b3fad49ba7a6b256 Mon Sep 17 00:00:00 2001 From: Ben Watson Date: Fri, 11 Nov 2022 17:05:27 -0500 Subject: [PATCH 3/3] updates changelog --- CHANGELOG.md | 20 +- dist/alks.umd.js | 2692 ++++++++--------- docs/classes/export_.Alks.html | 60 +- docs/classes/export_.AlksError.html | 2 +- docs/enums/export_.PseudoBoolean.html | 2 +- docs/enums/export_.TrustType.html | 2 +- docs/interfaces/AccessToken.html | 2 +- docs/interfaces/Account.html | 2 +- docs/interfaces/AccountUserDetails.html | 2 +- docs/interfaces/AwsAccountRole.html | 2 +- docs/interfaces/AwsRoleType.html | 2 +- docs/interfaces/CloudsploitReport.html | 2 +- docs/interfaces/CostTotal.html | 2 +- docs/interfaces/IamUser.html | 2 +- docs/interfaces/Key.html | 2 +- docs/interfaces/LongTermKey.html | 2 +- docs/interfaces/MachineIdentity.html | 2 +- docs/interfaces/RefreshToken.html | 2 +- docs/interfaces/Role.html | 2 +- docs/interfaces/SkypieaAccount.html | 2 +- docs/interfaces/Tag.html | 2 +- docs/interfaces/User.html | 2 +- docs/interfaces/export_.AccessToken.html | 2 +- docs/interfaces/export_.Account.html | 2 +- .../export_.AccountUserDetails.html | 2 +- docs/interfaces/export_.AwsAccountRole.html | 2 +- docs/interfaces/export_.AwsRoleType.html | 2 +- .../interfaces/export_.CloudsploitReport.html | 2 +- docs/interfaces/export_.CostTotal.html | 2 +- docs/interfaces/export_.IamUser.html | 2 +- docs/interfaces/export_.Key.html | 2 +- docs/interfaces/export_.LongTermKey.html | 2 +- docs/interfaces/export_.MachineIdentity.html | 2 +- docs/interfaces/export_.RefreshToken.html | 2 +- docs/interfaces/export_.Role.html | 2 +- docs/interfaces/export_.SkypieaAccount.html | 2 +- docs/interfaces/export_.Tag.html | 2 +- docs/interfaces/export_.User.html | 2 +- docs/modules.html | 2 +- docs/modules/export_.html | 2 +- 40 files changed, 1414 insertions(+), 1432 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65647052..da80fc8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,21 +1,3 @@ # Changelog -All changes to ALKS.js for this version will be noted here - -## Changed -# Description - -Adds tags to createAccessKeys. Adds new functions updateIamUser and getIamUser. - -Rally # [US878015](https://rally1.rallydev.com/#/?detail=/userstory/642939499993&fdp=true): ALKS JS - Enable tagging for IAM Users - -## Type of change - -_Please remove options that are not relevant._ - -- [X] Feature (non-breaking change which adds functionality) - -# How has this been tested? - -## Steps: - 1. Unit Tests +- Moves typedoc to dev dependency diff --git a/dist/alks.umd.js b/dist/alks.umd.js index efea4e22..e74f2d1a 100644 --- a/dist/alks.umd.js +++ b/dist/alks.umd.js @@ -17529,1352 +17529,1352 @@ var require$$3 = /*@__PURE__*/getAugmentedNamespace(lib); - var tslib_1 = require$$0$1; - var packageJson = tslib_1.__importStar(require$$1$1); - var buffer_1 = require$$2; - tslib_1.__importDefault(require$$3); - var fetch = window.fetch.bind(window) - ; - var ALKS; - (function (ALKS) { - function isStsAuth(a) { - return a.accessKey !== undefined; - } - function isPasswordAuth(a) { - return a.userid !== undefined; - } - function isTokenAuth(a) { - return a.accessToken !== undefined; - } - (function (TrustType) { - TrustType["CrossAccount"] = "Cross Account"; - TrustType["InnerAccount"] = "Inner Account"; - })(ALKS.TrustType || (ALKS.TrustType = {})); - (function (PseudoBoolean) { - PseudoBoolean[PseudoBoolean["True"] = 1] = "True"; - PseudoBoolean[PseudoBoolean["False"] = 0] = "False"; - })(ALKS.PseudoBoolean || (ALKS.PseudoBoolean = {})); - /** - * ALKS JavaScript API - */ - var Alks = /** @class */ (function () { - function Alks(config) { - this.config = config; - } - /** - * Returns a new instance of alks with pre-defined properties (which don't need to be supplied to every method). - * - * Any of the properties required by other methods can be specified here. - * - * Properties present on the current object are carried through to the newly created one. - * - * @param {Object} props - An object containing settings for the new ALKS object - * @returns {alks} - * @example - * var myAlks = alks.create({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * }) - * - * myAlks.getKeys({ - * account: 'anAccount', - * role: 'PowerUser', - * sessionTime: 2 - * }).then((creds) => { - * // creds.accessKey, creds.secretKey, creds.sessionToken - * }) - */ - Alks.prototype.create = function (props) { - var config = tslib_1.__assign(tslib_1.__assign({}, this.config), props); - return new Alks(config); - }; - /** - * Returns a Promise for an array of AWS accounts (and roles) accessible by the user - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @returns {Promise} - * @example - * alks.getAccounts({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * }).then((accounts) => { - * // accounts[0].account, accounts[0].role, accounts[0].iamKeyActive, accounts[0].maxKeyDuration, accounts[0].skypieaAccount - * }) - */ - Alks.prototype.getAccounts = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('getAccounts', props)]; - case 1: - results = _a.sent(); - return [2 /*return*/, Object.keys(results.accountListRole).map(function (key) { return ({ - account: key, - role: results.accountListRole[key][0].role, - iamKeyActive: results.accountListRole[key][0].iamKeyActive, - maxKeyDuration: results.accountListRole[key][0].maxKeyDuration, - securityLevel: results.accountListRole[key][0].securityLevel, - skypieaAccount: results.accountListRole[key][0].skypieaAccount, - }); })]; - } - }); - }); - }; - /** - * Returns a Promise for AWS STS credentials from ALKS. - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.account - The AWS account to use when provisioning the credentials - * @param {string} props.role - The ALKS role to use when provisioning the credentials - * @param {string} props.sessionTime - The session length for the credentials - * @returns {Promise} - * @example - * alks.getKeys({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * role: 'PowerUser', - * sessionTime: 2 - * }).then((creds) => { - * // creds.accessKey, creds.secretKey, creds.sessionToken, creds.consoleURL - * }) - */ - Alks.prototype.getKeys = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('getKeys', props)]; - case 1: - results = _a.sent(); - return [2 /*return*/, pick(results, [ - 'accessKey', - 'secretKey', - 'sessionToken', - 'consoleURL', - ])]; - } - }); - }); - }; - /** - * Returns a Promise for AWS STS credentials with IAM permissions from ALKS. - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.account - The AWS account to use when provisioning the credentials - * @param {string} props.role - The ALKS role to use when provisioning the credentials - * @param {number} props.sessionTime - The session length for the credentials - * @returns {Promise} - * @example - * alks.getIAMKeys({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * role: 'IAMAdmin', - * sessionTime: 1 - * }).then((creds) => { - * // creds.accessKey, creds.secretKey, creds.sessionToken, creds.consoleURL - * }) - */ - Alks.prototype.getIAMKeys = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('getIAMKeys', props)]; - case 1: - results = _a.sent(); - return [2 /*return*/, pick(results, [ - 'accessKey', - 'secretKey', - 'sessionToken', - 'consoleURL', - ])]; - } - }); - }); - }; - /** - * Returns a Promise for an array of all available role types (AWS IAM role types, custom role types) and their details - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {boolean} [props.getDynamicValues] - Whether to include the names of any template variables in the response (defaults to false) - * @returns {Promise>} - * @example - * alks.getAllAWSRoleTypes({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * }).then((roleTypes) { - * // roleTypes[i].roleTypeName, roleTypes[i].defaultArns, roleTypes[i].trustRelationship - * }) - * - * @example - * alks.getAllAWSRoleTypes({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * getDynamicValues: true, - * }).then((roleTypes) { - * // roleTypes[i].roleTypeName, roleTypes[i].defaultArns, roleTypes[i].trustRelationship, roleTypes[i].templateVariables[i] - * }) - */ - Alks.prototype.getAllAWSRoleTypes = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var url, results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: - url = props.getDynamicValues - ? 'allAwsRoleTypes?getDynamicValues=true' - : 'allAwsRoleTypes'; - return [4 /*yield*/, this.internalFetch(url, props, 'GET')]; - case 1: - results = _a.sent(); - return [2 /*return*/, results.roleTypes]; - } - }); - }); - }; - /** - * Returns a Promise for an array of available AWS IAM role types - * - * @deprecated Replaced by getAllAWSRoleTypes which includes all AWS role types and their details - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @returns {Promise>} - * @example - * alks.getAWSRoleTypes({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * }).then((roleTypes) { - * // ['AWS Lambda', 'Amazon EC2', ... ] - * }) - */ - Alks.prototype.getAWSRoleTypes = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('getAWSRoleTypes', props)]; - case 1: - results = _a.sent(); - return [2 /*return*/, JSON.parse(results.roleTypes)]; - } - }); - }); - }; - /** - * Returns a Promise for an array of available custom role types - * - * @deprecated Replaced by getAllAWSRoleTypes which includes all AWS role types and their details - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @returns {Promise>} - * @example - * alks.getNonServiceAWSRoleTypes({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * }).then((roleTypes) => { - * // ['AWS Lambda', 'Amazon EC2', ...] - * }) - */ - Alks.prototype.getNonServiceAWSRoleTypes = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('getNonServiceAWSRoleTypes', props)]; - case 1: - results = _a.sent(); - return [2 /*return*/, JSON.parse(results.roleTypes)]; - } - }); - }); - }; - /** - * Returns a Promise for the results of creating a new custom AWS IAM account role - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.account - The user's account associated with the custom role - * @param {string} props.role - The user's role associated with the account - * @param {string} props.roleName - The name of the custom AWS IAM role to create - * @param {string} props.roleType - The type of AWS role to use when creating the new role - * @param {Object} props.trustPolicy - * @param {number} props.includeDefaultPolicy - Whether to include the default policy in the new role (1 = yes, 0 = no) - * @param {boolean} props.enableAlksAccess - Whether the role has a machine identity - * @param {Object} props.templateFields - An object whose keys are template variable names and values are the value to substitute for those template variables - * @param {Array.} props.tags - A list of tag objects, where each object is in the form {key: "tagKey" value: "tagValue"} - * @returns {Promise} - * @example - * alks.createRole({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * role: 'IAMAdmin', - * roleName: 'awsRoleName', - * roleType: 'Amazon EC2', - * includeDefaultPolicy: 1, - * enableAlksAccess: true - * }).then((role) => { - * // role.roleArn, role.denyArns, role.instanceProfileArn, role.addedRoleToInstanceProfile, role.tags - * }) - * @example - * alks.createRole({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * role: 'IAMAdmin', - * roleName: 'awsRoleName', - * trustPolicy: { - * "Version": "2012-10-17", - * "Statement": [ - * { - * "Action": "sts:AssumeRole", - * "Effect": "Allow", - * "Principal": { - * "Service": "ec2.amazonaws.com" - * } - * } - * ] - * }, - * includeDefaultPolicy: 1, - * enableAlksAccess: true - * }).then((role) => { - * // role.roleArn, role.denyArns, role.instanceProfileArn, role.addedRoleToInstanceProfile, role.tags - * }) - * @example - * alks.createRole({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * role: 'IAMAdmin', - * roleName: 'awsRoleName', - * roleType: 'Amazon EKS IRSA', - * includeDefaultPolicy: 1, - * enableAlksAccess: false, - * templateFields: { - * OIDC_PROVIDER: 'oidc.eks.us-east-1.amazonaws.com/id/88G998884RBAD6687HBE3GETY67FQE04', - * K8S_NAMESPACE: 'myNamespace', - * K8S_SERVICE_ACCOUNT: 'myServiceAccount' - * } - * tags: [ - * { - * key: "tagkey1", - * value: "tagValue1" - * }, - * { - * key: "tagkey1", - * value: "tagvalue2" - * } - * ], - * }).then((role) => { - * // role.roleArn, role.denyArns, role.instanceProfileArn, role.addedRoleToInstanceProfile, role.tags - * }) - */ - Alks.prototype.createRole = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var roleTypeExists, trustPolicyExists, results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: - roleTypeExists = props.roleType != null; - trustPolicyExists = props.trustPolicy != null; - if (!(roleTypeExists !== trustPolicyExists)) return [3 /*break*/, 2]; - return [4 /*yield*/, this.internalFetch('createRole', props)]; - case 1: - results = _a.sent(); - results.denyArns = results.denyArns.split(','); - return [2 /*return*/, pick(results, [ - 'roleArn', - 'denyArns', - 'instanceProfileArn', - 'addedRoleToInstanceProfile', - 'tags', - ])]; - case 2: throw new Error("Must include roleType or trustPolicy, but not both."); - } - }); - }); - }; - /** - * Returns a Promise for the results of creating a new custom AWS IAM trust role - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.account - The user's account associated with the custom role - * @param {string} props.role - The user's role associated with the account - * @param {string} props.roleName - The name of the custom AWS IAM role to create - * @param {string} props.roleType - The type of AWS role to use when creating the new role - * @param {number} props.includeDefaultPolicy - Whether to include the default policy in the new role (1 = yes, 0 = no) - * @param {string} props.trustArn - The Arn of the existing role to trust - * @param {string} props.trustType - Whether the trust is 'Cross Account' or 'Inner Account' - * @param {boolean} props.enableAlksAccess - Whether the role has a machine identity - * @param {Array.} props.tags - A list of tag objects, where each object is in the form {key: "tagKey" value: "tagValue"} - * @returns {Promise} - * @example - * alks.createNonServiceRole({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * role: 'IAMAdmin', - * roleName: 'awsRoleName', - * roleType: 'Amazon EC2', - * includeDefaultPolicy: 1, - * trustArn: 'anExistingRoleArn', - * trustType: 'Cross Account', - * enableAlksAccess: true - * }).then((role) => { - * // role.roleArn, role.denyArns, role.instanceProfileArn, role.addedRoleToInstanceProfile, role.tags - * }) - * @@example - * * alks.createNonServiceRole({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * role: 'IAMAdmin', - * roleName: 'awsRoleName', - * roleType: 'Amazon EC2', - * includeDefaultPolicy: 1, - * trustArn: 'anExistingRoleArn', - * trustType: 'Cross Account', - * enableAlksAccess: true, - * tags: [ - * { - * key: "tagkey1", - * value: "tagValue1" - * }, - * { - * key: "tagkey1", - * value: "tagvalue2" - * } - * ], - * }).then((role) => { - * // role.roleArn, role.denyArns, role.instanceProfileArn, role.addedRoleToInstanceProfile, role.tags - * }) - */ - Alks.prototype.createNonServiceRole = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('createNonServiceRole', props)]; - case 1: - results = _a.sent(); - results.denyArns = results.denyArns.split(','); - return [2 /*return*/, pick(results, [ - 'roleArn', - 'denyArns', - 'instanceProfileArn', - 'addedRoleToInstanceProfile', - 'tags', - ])]; - } - }); - }); - }; - /** - * Returns a Promise for an array of AWS account roles - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.account - The account number to get AWS roles for - * @returns {Promise} - * @example - * alks.awsAccountRoles({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: '1234567890', - * }).then((roles) => { - * // roles[i].roleArn, roles[i].isMachineIdentity, roles[i].assumeRolePolicyDocument - * }) - */ - Alks.prototype.awsAccountRoles = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch("awsAccountRoles?account=" + props.account, props, 'GET')]; - case 1: - results = _a.sent(); - return [2 /*return*/, results.awsRoleList]; - } - }); - }); - }; - /** - * Returns a Promise for an array of AWS custom AWS IAM account roles - * - * @deprecated Replaced by awsAccountRoles which includes AWS account roles and their details - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.account - The user's account associated with the custom role - * @param {string} props.role - The user's role associated with the account - * @returns {Promise} - * @example - * alks.listAWSAccountRoles({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * role: 'IAMAdmin', - * }).then((roleNames) => { - * // ['customRole1', 'customRole2', ...] - * }) - */ - Alks.prototype.listAWSAccountRoles = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('listAWSAccountRoles', props)]; - case 1: - results = _a.sent(); - return [2 /*return*/, JSON.parse(results.jsonAWSRoleList).map(function (r) { return r.split('/').slice(-1)[0]; })]; - } - }); - }); - }; - /** - * Returns a Promise for the Amazon Resource Name (ARN) of a custom AWS IAM account role - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.account - The user's account associated with the custom role - * @param {string} props.role - The user's role associated with the account - * @param {string} props.roleName - The name of the custom AWS IAM role - * @param {Array.} props.tags - A list of tag objects, where each object is in the form {key: "tagKey" value: "tagValue"} - * @returns {Promise} - * @example - * alks.getAccountRole({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * role: 'IAMAdmin', - * roleName: 'awsRoleName' - * }).then((role) => { - * // role.roleArn, role.isMachineIdentity, role.instanceProfileArn, role.tags, role.maxSessionDurationInSeconds - * }) - */ - Alks.prototype.getAccountRole = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('getAccountRole', props)]; - case 1: - results = _a.sent(); - if (!results.roleExists) { - throw new Error("Role " + props.roleName + " does not exist in this account"); - } - return [2 /*return*/, tslib_1.__assign(tslib_1.__assign({}, pick(results, [ - 'roleArn', - 'isMachineIdentity', - 'tags', - 'maxSessionDurationInSeconds', - ])), { instanceProfileArn: results.instanceProfileARN })]; - } - }); - }); - }; - /** - * Returns a Promise for the Amazon Resource Name (ARN) of a custom AWS IAM account role - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.account - The user's account associated with the custom role - * @param {string} props.role - The user's role associated with the account - * @param {string} props.roleName - The name of the custom AWS IAM role - * @param {Array.} props.tags - A list of tag objects, where each object is in the form {key: "tagKey" value: "tagValue"} - * @returns {Promise} - * @example - * alks.updateRole({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * role: 'IAMAdmin', - * roleName: 'awsRoleName' - * }).then((role) => { - * // role.roleArn, role.isMachineIdentity, role.instanceProfileArn, role.tags - * }) - */ - Alks.prototype.updateRole = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('role', props, 'PATCH')]; - case 1: - results = _a.sent(); - if (!results.roleExists) { - throw new Error("Role " + props.roleName + " does not exist in this account"); - } - return [2 /*return*/, tslib_1.__assign(tslib_1.__assign({}, pick(results, ['roleArn', 'isMachineIdentity', 'tags'])), { instanceProfileArn: results.instanceProfileARN })]; - } - }); - }); - }; - /** - * Returns a Promise for a boolean "true" indicating the role was deleted - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.account - The user's account associated with the custom role - * @param {string} props.role - The user's role associated with the account - * @param {string} props.roleName - The name of the custom AWS IAM role - * @returns {Promise} - * @example - * alks.deleteRole({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * role: 'IAMAdmin', - * roleName: 'awsRoleName' - * }).then(() => { - * // success! - * }) - */ - Alks.prototype.deleteRole = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('deleteRole', props)]; - case 1: - _a.sent(); - return [2 /*return*/, true]; - } - }); - }); - }; - /** - * Returns a Promise for a string arn indicating the role was enabled for machine identity - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.roleArn - The Amazon Resource Name (ARN) associated with the role - * @returns {Promise} - * @example - * alks.addRoleMachineIdentity({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * roleARN: 'arn:aws:iam::123:role/acct-managed/awsRoleName' - * }).then((roleARN) => { - * // arn:aws:iam::123:role/acct-managed/awsRoleName - * }) - */ - Alks.prototype.addRoleMachineIdentity = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('roleMachineIdentity', props)]; - case 1: - results = _a.sent(); - return [2 /*return*/, pick(results, ['machineIdentityArn'])]; - } - }); - }); - }; - /** - * Returns a Promise for a string arn indicating the role was disabled for machine identity - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.roleArn - The Amazon Resource Name (ARN) associated with the role - * @returns {Promise} - * @example - * alks.deleteRoleMachineIdentity({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * roleARN: 'arn:aws:iam::123:role/acct-managed/awsRoleName' - * }).then((roleARN) => { - * // arn:aws:iam::123:role/acct-managed/awsRoleName - * }) - */ - Alks.prototype.deleteRoleMachineIdentity = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('roleMachineIdentity', props, 'DELETE')]; - case 1: - results = _a.sent(); - return [2 /*return*/, pick(results, ['machineIdentityArn'])]; - } - }); - }); - }; - /** - * Returns a Promise for a list of users who have access to the given account - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.accountId - The accountId used to find which users have access to the account - * @returns {Promise} - * @example - * alks.getUserAccess({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * accountId: '012345678910', - * }).then((users) => { - * // users[i].sAMAccountName, users[i].displayName, users[i].email, users[i].title, users[i].department - * }) - */ - Alks.prototype.getUserAccess = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var accountId, results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: - accountId = props.accountId; - return [4 /*yield*/, this.internalFetch("userAccess/" + accountId, props, 'GET')]; - case 1: - results = _a.sent(); - return [2 /*return*/, results.users]; - } - }); - }); - }; - /** - * Returns a Promise for a map of role names to the list of users with that role for a given account - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.accountId - The accountId used to find which users have access to the account - * @returns {Promise} - * @example - * alks.getUserAccess({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * accountId: '012345678910', - * }).then((users) => { - * // users['Admin'].sAMAccountName, users['Admin'].displayName, users['Admin'].email, users['Admin'].title, users['Admin'].department - * }) - */ - Alks.prototype.getUserAccessByRole = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var accountId, results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: - accountId = props.accountId; - return [4 /*yield*/, this.internalFetch("reports/users-by-role?accountId=" + accountId, props, 'GET')]; - case 1: - results = _a.sent(); - return [2 /*return*/, results.users]; - } - }); - }); - }; - /** - * Returns a Promise for a list of roles a user has for a given account - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.accountId - The accountId used to find which users have access to the account - * @param {string} props.sAMAccountName - The network id of the user to lookup - * @returns {Promise} - * @example - * alks.getUserRoleAccess({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * accountId: '012345678910', - * sAMAccountName: 'bob1', - * }).then((roles) => { - * // ['Admin', 'LabAdmin', ...] - * }) - */ - Alks.prototype.getUserRoleAccess = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var accountId, results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: - accountId = props.accountId; - return [4 /*yield*/, this.internalFetch("userAccess/roles/" + accountId, props)]; - case 1: - results = _a.sent(); - return [2 /*return*/, results.roles]; - } - }); - }); - }; - /** - * Returns a Promise containing a list of the account owners for an account - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.accountId - The accountId used to find which users have access to the account - * @returns {Promise} - * @example - * alks.getAccountOwners({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * accountId: '012345678910', - * }).then((owners) => { - * // owners[0].sAMAccountName, owners[0].displayName, owners[0].email, owners[0].title, owners[0].department - * }) - */ - Alks.prototype.getAccountOwners = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var accountId, results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: - accountId = props.accountId; - return [4 /*yield*/, this.internalFetch("userAccess/owners/" + accountId, props, 'GET')]; - case 1: - results = _a.sent(); - return [2 /*return*/, results.accountOwners]; - } - }); - }); - }; - /** - * Returns a Promise for the results of creating new IAM user and long-term access keys - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.account - The user's account associated with the custom role - * @param {string} props.role - The user's role associated with the account - * @param {string} props.iamUserName - The name of the IAM user to create - * @returns {Promise} - * @example - * alks.createAccessKeys({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * role: 'IAMAdmin', - * iamUserName: 'iamUserName' - * }).then((user) => { - * // user.iamUserArn, user.accessKey, user.secretKey, user.addedIAMUserToGroup - * }) - * @example - * alks.createAccessKeys({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * role: 'IAMAdmin', - * iamUserName: 'iamUserName' - * tags: [ - * { - * key: "tagkey1", - * value: "tagValue1" - * }, - * { - * key: "tagkey1", - * value: "tagvalue2" - * } - * ], - * }).then((user) => { - * // user.iamUserArn, user.accessKey, user.secretKey, user.addedIAMUserToGroup - * }) - */ - Alks.prototype.createAccessKeys = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('accessKeys', props)]; - case 1: - results = _a.sent(); - return [2 /*return*/, pick(results, [ - 'iamUserArn', - 'accessKey', - 'secretKey', - 'addedIAMUserToGroup', - 'tags', - ])]; - } - }); - }); - }; - /** - * Returns a Promise for an IamUser - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.account - The user's account associated with the custom role - * @param {string} props.iamUserName - The name of the custom AWS IAM user - * @returns {Promise} - * @example - * alks.getIamUser({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * iamUserName: 'iamUserName' - * }).then((role) => { - * user.iamUserArn, user.AccountId, user.userName, user.accessKey, user.tags - * }) - */ - Alks.prototype.getIamUser = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch("iam-users/id/" + props.account + "/" + props.iamUserName, props, 'GET')]; - case 1: - results = _a.sent(); - return [2 /*return*/, pick(results.item, [ - 'arn', - 'accountId', - 'userName', - 'accessKey', - 'tags', - ])]; - } - }); - }); - }; - /** - * Returns a Promise for the results of updating an IAM user - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.account - The user's account associated with the custom role - * @param {string} props.iamUserName - The name of the IAM user to update - * @param {Array.} props.tags - A list of tag objects, where each object is in the form {key: "tagKey" value: "tagValue"} - * @returns {Promise} - * @example - * alks.updateIamUser({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * iamUserName: 'iamUserName', - * }).then((user) => { - * // user.iamUserArn, user.AccountId, user.userName, user.accessKey, user.tags - * }) - * @example - * alks.updateIamUser({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * iamUserName: 'iamUserName' - * tags: [ - * { - * key: "tagkey1", - * value: "tagValue1" - * }, - * { - * key: "tagkey1", - * value: "tagvalue2" - * } - * ], - * }).then((user) => { - * // user.iamUserArn, user.AccountId, user.userName, user.accessKey, user.tags - * }) - */ - Alks.prototype.updateIamUser = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var internalFetchProps, results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: - internalFetchProps = tslib_1.__assign(tslib_1.__assign({}, props), { user: { - tags: props.tags, - } }); - delete internalFetchProps.tags; - return [4 /*yield*/, this.internalFetch("iam-users/id/" + props.account + "/" + props.iamUserName, internalFetchProps, 'PATCH')]; - case 1: - results = _a.sent(); - return [2 /*return*/, pick(results.item, [ - 'arn', - 'accountId', - 'userName', - 'accessKey', - 'tags', - ])]; - } - }); - }); - }; - /** - * Returns a Promise for a boolean "true" indicating the IAM user and long-term access keys were deleted - * - * @param {Object} props - An object containing the following properties - * @param {string} props.baseUrl - The base URL of the ALKS service - * @param {string} props.accessToken - The OAuth2 access token used to authorize the request - * @param {string} props.account - The user's account associated with the custom role - * @param {string} props.role - The user's role associated with the account - * @param {string} props.iamUserName - The name of the IAM user to delete - * @returns {Promise} - * @example - * alks.deleteIAMUser({ - * baseUrl: 'https://your.alks-host.com', - * accessToken: 'abc123', - * account: 'anAccount', - * role: 'IAMAdmin', - * iamUserName: 'iamUserName' - * }).then(() => { - * // success! - * }) - */ - Alks.prototype.deleteIAMUser = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('IAMUser', props, 'DELETE')]; - case 1: - _a.sent(); - return [2 /*return*/, true]; - } - }); - }); - }; - /** - * Returns the version of the ALKS Rest API - * - * @param {Object} props - An object containing the following properties - * @returns {Promise} - * @example - * alks.version({ - * ... - * }).then((data) => { - * // data.version - * }) - */ - Alks.prototype.version = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('version', props, 'GET')]; - case 1: - results = _a.sent(); - return [2 /*return*/, pick(results, ['version'])]; - } - }); - }); - }; - /** - * Returns information about one of the roles used to generate keys - * - * @param {Object} props - An object containing the following properties - * @param {string} props.accountId - The 12-digit account ID associated with the custom role - * @param {string} props.role - The user's role associated with the account - * @returns {Promise} - * @example - * alks.getLoginRole({ - * ... - * }).then((loginRole) => { - * // loginRole.account, loginRole.role, loginRole.iamKeyActive, loginRole.maxKeyDuration - * }) - */ - Alks.prototype.getLoginRole = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var accountId, role, results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: - accountId = props.accountId, role = props.role; - return [4 /*yield*/, this.internalFetch("loginRoles/id/" + accountId + "/" + role, props, 'GET')]; - case 1: - results = (_a.sent()); - // TODO we should probably update this function to include skypieaAccount in the result since it's already being fetched - Ben W 5/10/21 - return [2 /*return*/, pick(results.loginRole, [ - 'account', - 'role', - 'iamKeyActive', - 'maxKeyDuration', - 'securityLevel', - ])]; - } - }); - }); - }; - /** - * Exchanges a refresh token for an access token - * - * @param {Object} props - An object containing the following properties - * @param {string} props.refreshToken - the refresh token to exchange - * @returns {Promise} - * @example - * alks.getAccessToken({ - * ... - * }).then((data) => { - * // data.accessToken, data.expiresIn - * }) - */ - Alks.prototype.getAccessToken = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('accessToken', props)]; - case 1: - results = _a.sent(); - return [2 /*return*/, pick(results, ['accessToken', 'expiresIn'])]; - } - }); - }); - }; - /** - * Returns a list of a user's refresh tokens (Does not return the full token) - * - * @param {Object} props - An object containing the following properties - * @returns {Array} - * @example - * alks.getRefreshTokens({ - * ... - * }).then((tokens) => { - * // token[i].clientId, token[i].id, token[i].userId, token[i].value - * }) - */ - Alks.prototype.getRefreshTokens = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('refreshTokens', props, 'GET')]; - case 1: - results = (_a.sent()); - return [2 /*return*/, results.refreshTokens.map(function (token) { - return pick(token, ['clientId', 'id', 'userId', 'value']); - })]; - } - }); - }); - }; - /** - * Revokes a refresh or access token - * - * @param {Object} props - An object containing the following properties - * @param {string} [props.token] - the access or refresh token to revoke (Required if tokenId not specified) - * @param {string} [props.tokenId] - the ID of the refresh token to revoke (Required if token not specified) - * @returns {boolean} - * @example - * alks.revoke({ - * token: '...', - * ... - * }).then((success) => { - * // success == true - * }) - * - * // or - * - * alks.revoke({ - * tokenId: '...', - * ... - * }).then((success) => { - * // success == true - * }) - */ - Alks.prototype.revoke = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch('revoke', props)]; - case 1: - results = _a.sent(); - return [2 /*return*/, results.statusMessage == 'Success']; - } - }); - }); - }; - /** - * Returns cost totals for the specified account for the day, week, month, year, and a breakdown of costs by service for the day and month - * - * @param {Object} props - An object containing the following properties - * @param {String} props.accountId - the 12-digit AWS account ID to get cost data for - * @returns {Object} - * @example - * alks.getCostTotals({ - * accountId: '012345678910', - * }).then((costTotals) => { - * // costTotals.awsAccountId, costTotals.daily, costTotals.weekly, etc. - * }) - */ - Alks.prototype.getCostTotals = function (props) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var results; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.internalFetch("costTotals/" + props.accountId, props, 'GET')]; - case 1: - results = (_a.sent()); - return [2 /*return*/, pick(results.costTotals, [ - 'awsAccountId', - 'yyyy', - 'mm', - 'dd', - 'daily', - 'weekly', - 'monthly', - 'yearly', - 'dailyCostsByService', - 'monthlyCostsByService', - ])]; - } - }); - }); - }; - Alks.prototype.internalFetch = function (path, args, method) { - if (args === void 0) { args = {}; } - if (method === void 0) { method = 'POST'; } - return tslib_1.__awaiter(this, void 0, void 0, function () { - var opts, payload, headers, credentials, response, json, err_1; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: - opts = tslib_1.__assign(tslib_1.__assign({}, this.config), args); - payload = tslib_1.__assign({}, opts); - headers = { - 'Content-Type': 'application/json', - 'User-Agent': "AlksJS/" + packageJson.version, - }; - if (isTokenAuth(opts)) { - headers['Authorization'] = "Bearer " + opts.accessToken; - delete payload.accessToken; - } - else if (isStsAuth(opts)) { - headers['ALKS-STS-Access-Key'] = opts.accessKey; - headers['ALKS-STS-Secret-Key'] = opts.secretKey; - headers['ALKS-STS-Session-Token'] = opts.sessionToken; - delete payload.accessKey; - delete payload.secretKey; - delete payload.sessionToken; - } - else if (isPasswordAuth(opts)) { - console.error('The userid and password properties are deprecated and should be replaced with an access token'); - credentials = base64Encode(opts.userid + ":" + opts.password); - headers['Authorization'] = "Basic " + credentials; - delete payload.userid; - delete payload.password; - } - else ; - if (opts.userAgent) { - headers['User-Agent'] += " " + opts.userAgent; - delete payload.userAgent; - } - return [4 /*yield*/, opts._fetch(opts.baseUrl + "/" + path, { - method: method, - headers: headers, - credentials: 'omit', - body: method == 'GET' ? undefined : JSON.stringify(payload), - })]; - case 1: - response = _a.sent(); - _a.label = 2; - case 2: - _a.trys.push([2, 4, , 5]); - return [4 /*yield*/, response.json()]; - case 3: - json = _a.sent(); - return [3 /*break*/, 5]; - case 4: - err_1 = _a.sent(); - json = { - errors: [err_1.message], - }; - return [3 /*break*/, 5]; - case 5: - if (!response.ok) { - throw new AlksError(response, json); - } - return [2 /*return*/, json]; - } - }); - }); - }; - return Alks; - }()); - ALKS.Alks = Alks; - var AlksError = /** @class */ (function (_super) { - tslib_1.__extends(AlksError, _super); - function AlksError(response, json) { - var _this = this; - var errors = Array.isArray(json === null || json === void 0 ? void 0 : json.errors) ? json.errors : []; - if (response.statusText) { - errors.unshift(response.statusText); - } - var message = errors.join('; '); - _this = _super.call(this, message) || this; - _this.status = response.status; - _this.message = message; - Object.assign(_this, json); - return _this; - } - return AlksError; - }(Error)); - ALKS.AlksError = AlksError; - /** - * Encodes a string to base 64 - * - * @param str - the string to encode - * @private - * @returns the base64 encoded string - * @example - * var input = 'password'; - * base64Encode(input); - */ - function base64Encode(str) { - if (str === void 0) { str = ''; } - return buffer_1.Buffer.from(str).toString('base64'); - } - function pick(obj, props) { - return props.reduce(function (acc, prop) { return ((acc[prop] = obj[prop]), acc); }, {}); - } - var defaultConfig = { - _fetch: fetch, - }; - var defaultAlks = Alks.prototype.create.call({}, defaultConfig); - ALKS.create = Alks.prototype.create.bind(defaultAlks); - ALKS.getAccounts = Alks.prototype.getAccounts.bind(defaultAlks); - ALKS.getKeys = Alks.prototype.getKeys.bind(defaultAlks); - ALKS.getIAMKeys = Alks.prototype.getIAMKeys.bind(defaultAlks); - ALKS.getAllAWSRoleTypes = Alks.prototype.getAllAWSRoleTypes.bind(defaultAlks); - ALKS.getAWSRoleTypes = Alks.prototype.getAWSRoleTypes.bind(defaultAlks); - ALKS.getNonServiceAWSRoleTypes = Alks.prototype.getNonServiceAWSRoleTypes.bind(defaultAlks); - ALKS.createRole = Alks.prototype.createRole.bind(defaultAlks); - ALKS.createNonServiceRole = Alks.prototype.createNonServiceRole.bind(defaultAlks); - ALKS.awsAccountRoles = Alks.prototype.awsAccountRoles.bind(defaultAlks); - ALKS.listAWSAccountRoles = Alks.prototype.listAWSAccountRoles.bind(defaultAlks); - ALKS.getAccountRole = Alks.prototype.getAccountRole.bind(defaultAlks); - ALKS.updateRole = Alks.prototype.updateRole.bind(defaultAlks); - ALKS.deleteRole = Alks.prototype.deleteRole.bind(defaultAlks); - ALKS.addRoleMachineIdentity = Alks.prototype.addRoleMachineIdentity.bind(defaultAlks); - ALKS.deleteRoleMachineIdentity = Alks.prototype.deleteRoleMachineIdentity.bind(defaultAlks); - ALKS.getUserAccess = Alks.prototype.getUserAccess.bind(defaultAlks); - ALKS.getUserAccessByRole = Alks.prototype.getUserAccessByRole.bind(defaultAlks); - ALKS.getUserRoleAccess = Alks.prototype.getUserRoleAccess.bind(defaultAlks); - ALKS.getAccountOwners = Alks.prototype.getAccountOwners.bind(defaultAlks); - ALKS.createAccessKeys = Alks.prototype.createAccessKeys.bind(defaultAlks); - ALKS.getIamUser = Alks.prototype.getIamUser.bind(defaultAlks); - ALKS.updateIamUser = Alks.prototype.updateIamUser.bind(defaultAlks); - ALKS.deleteIAMUser = Alks.prototype.deleteIAMUser.bind(defaultAlks); - ALKS.version = Alks.prototype.version.bind(defaultAlks); - ALKS.getLoginRole = Alks.prototype.getLoginRole.bind(defaultAlks); - ALKS.getAccessToken = Alks.prototype.getAccessToken.bind(defaultAlks); - ALKS.getRefreshTokens = Alks.prototype.getRefreshTokens.bind(defaultAlks); - ALKS.revoke = Alks.prototype.revoke.bind(defaultAlks); - ALKS.getCostTotals = Alks.prototype.getCostTotals.bind(defaultAlks); - })(ALKS || (ALKS = {})); + var tslib_1 = require$$0$1; + var packageJson = tslib_1.__importStar(require$$1$1); + var buffer_1 = require$$2; + tslib_1.__importDefault(require$$3); + var fetch = window.fetch.bind(window) + ; + var ALKS; + (function (ALKS) { + function isStsAuth(a) { + return a.accessKey !== undefined; + } + function isPasswordAuth(a) { + return a.userid !== undefined; + } + function isTokenAuth(a) { + return a.accessToken !== undefined; + } + (function (TrustType) { + TrustType["CrossAccount"] = "Cross Account"; + TrustType["InnerAccount"] = "Inner Account"; + })(ALKS.TrustType || (ALKS.TrustType = {})); + (function (PseudoBoolean) { + PseudoBoolean[PseudoBoolean["True"] = 1] = "True"; + PseudoBoolean[PseudoBoolean["False"] = 0] = "False"; + })(ALKS.PseudoBoolean || (ALKS.PseudoBoolean = {})); + /** + * ALKS JavaScript API + */ + var Alks = /** @class */ (function () { + function Alks(config) { + this.config = config; + } + /** + * Returns a new instance of alks with pre-defined properties (which don't need to be supplied to every method). + * + * Any of the properties required by other methods can be specified here. + * + * Properties present on the current object are carried through to the newly created one. + * + * @param {Object} props - An object containing settings for the new ALKS object + * @returns {alks} + * @example + * var myAlks = alks.create({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * }) + * + * myAlks.getKeys({ + * account: 'anAccount', + * role: 'PowerUser', + * sessionTime: 2 + * }).then((creds) => { + * // creds.accessKey, creds.secretKey, creds.sessionToken + * }) + */ + Alks.prototype.create = function (props) { + var config = tslib_1.__assign(tslib_1.__assign({}, this.config), props); + return new Alks(config); + }; + /** + * Returns a Promise for an array of AWS accounts (and roles) accessible by the user + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @returns {Promise} + * @example + * alks.getAccounts({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * }).then((accounts) => { + * // accounts[0].account, accounts[0].role, accounts[0].iamKeyActive, accounts[0].maxKeyDuration, accounts[0].skypieaAccount + * }) + */ + Alks.prototype.getAccounts = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('getAccounts', props)]; + case 1: + results = _a.sent(); + return [2 /*return*/, Object.keys(results.accountListRole).map(function (key) { return ({ + account: key, + role: results.accountListRole[key][0].role, + iamKeyActive: results.accountListRole[key][0].iamKeyActive, + maxKeyDuration: results.accountListRole[key][0].maxKeyDuration, + securityLevel: results.accountListRole[key][0].securityLevel, + skypieaAccount: results.accountListRole[key][0].skypieaAccount, + }); })]; + } + }); + }); + }; + /** + * Returns a Promise for AWS STS credentials from ALKS. + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.account - The AWS account to use when provisioning the credentials + * @param {string} props.role - The ALKS role to use when provisioning the credentials + * @param {string} props.sessionTime - The session length for the credentials + * @returns {Promise} + * @example + * alks.getKeys({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * role: 'PowerUser', + * sessionTime: 2 + * }).then((creds) => { + * // creds.accessKey, creds.secretKey, creds.sessionToken, creds.consoleURL + * }) + */ + Alks.prototype.getKeys = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('getKeys', props)]; + case 1: + results = _a.sent(); + return [2 /*return*/, pick(results, [ + 'accessKey', + 'secretKey', + 'sessionToken', + 'consoleURL', + ])]; + } + }); + }); + }; + /** + * Returns a Promise for AWS STS credentials with IAM permissions from ALKS. + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.account - The AWS account to use when provisioning the credentials + * @param {string} props.role - The ALKS role to use when provisioning the credentials + * @param {number} props.sessionTime - The session length for the credentials + * @returns {Promise} + * @example + * alks.getIAMKeys({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * role: 'IAMAdmin', + * sessionTime: 1 + * }).then((creds) => { + * // creds.accessKey, creds.secretKey, creds.sessionToken, creds.consoleURL + * }) + */ + Alks.prototype.getIAMKeys = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('getIAMKeys', props)]; + case 1: + results = _a.sent(); + return [2 /*return*/, pick(results, [ + 'accessKey', + 'secretKey', + 'sessionToken', + 'consoleURL', + ])]; + } + }); + }); + }; + /** + * Returns a Promise for an array of all available role types (AWS IAM role types, custom role types) and their details + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {boolean} [props.getDynamicValues] - Whether to include the names of any template variables in the response (defaults to false) + * @returns {Promise>} + * @example + * alks.getAllAWSRoleTypes({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * }).then((roleTypes) { + * // roleTypes[i].roleTypeName, roleTypes[i].defaultArns, roleTypes[i].trustRelationship + * }) + * + * @example + * alks.getAllAWSRoleTypes({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * getDynamicValues: true, + * }).then((roleTypes) { + * // roleTypes[i].roleTypeName, roleTypes[i].defaultArns, roleTypes[i].trustRelationship, roleTypes[i].templateVariables[i] + * }) + */ + Alks.prototype.getAllAWSRoleTypes = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var url, results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: + url = props.getDynamicValues + ? 'allAwsRoleTypes?getDynamicValues=true' + : 'allAwsRoleTypes'; + return [4 /*yield*/, this.internalFetch(url, props, 'GET')]; + case 1: + results = _a.sent(); + return [2 /*return*/, results.roleTypes]; + } + }); + }); + }; + /** + * Returns a Promise for an array of available AWS IAM role types + * + * @deprecated Replaced by getAllAWSRoleTypes which includes all AWS role types and their details + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @returns {Promise>} + * @example + * alks.getAWSRoleTypes({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * }).then((roleTypes) { + * // ['AWS Lambda', 'Amazon EC2', ... ] + * }) + */ + Alks.prototype.getAWSRoleTypes = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('getAWSRoleTypes', props)]; + case 1: + results = _a.sent(); + return [2 /*return*/, JSON.parse(results.roleTypes)]; + } + }); + }); + }; + /** + * Returns a Promise for an array of available custom role types + * + * @deprecated Replaced by getAllAWSRoleTypes which includes all AWS role types and their details + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @returns {Promise>} + * @example + * alks.getNonServiceAWSRoleTypes({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * }).then((roleTypes) => { + * // ['AWS Lambda', 'Amazon EC2', ...] + * }) + */ + Alks.prototype.getNonServiceAWSRoleTypes = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('getNonServiceAWSRoleTypes', props)]; + case 1: + results = _a.sent(); + return [2 /*return*/, JSON.parse(results.roleTypes)]; + } + }); + }); + }; + /** + * Returns a Promise for the results of creating a new custom AWS IAM account role + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.account - The user's account associated with the custom role + * @param {string} props.role - The user's role associated with the account + * @param {string} props.roleName - The name of the custom AWS IAM role to create + * @param {string} props.roleType - The type of AWS role to use when creating the new role + * @param {Object} props.trustPolicy + * @param {number} props.includeDefaultPolicy - Whether to include the default policy in the new role (1 = yes, 0 = no) + * @param {boolean} props.enableAlksAccess - Whether the role has a machine identity + * @param {Object} props.templateFields - An object whose keys are template variable names and values are the value to substitute for those template variables + * @param {Array.} props.tags - A list of tag objects, where each object is in the form {key: "tagKey" value: "tagValue"} + * @returns {Promise} + * @example + * alks.createRole({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * role: 'IAMAdmin', + * roleName: 'awsRoleName', + * roleType: 'Amazon EC2', + * includeDefaultPolicy: 1, + * enableAlksAccess: true + * }).then((role) => { + * // role.roleArn, role.denyArns, role.instanceProfileArn, role.addedRoleToInstanceProfile, role.tags + * }) + * @example + * alks.createRole({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * role: 'IAMAdmin', + * roleName: 'awsRoleName', + * trustPolicy: { + * "Version": "2012-10-17", + * "Statement": [ + * { + * "Action": "sts:AssumeRole", + * "Effect": "Allow", + * "Principal": { + * "Service": "ec2.amazonaws.com" + * } + * } + * ] + * }, + * includeDefaultPolicy: 1, + * enableAlksAccess: true + * }).then((role) => { + * // role.roleArn, role.denyArns, role.instanceProfileArn, role.addedRoleToInstanceProfile, role.tags + * }) + * @example + * alks.createRole({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * role: 'IAMAdmin', + * roleName: 'awsRoleName', + * roleType: 'Amazon EKS IRSA', + * includeDefaultPolicy: 1, + * enableAlksAccess: false, + * templateFields: { + * OIDC_PROVIDER: 'oidc.eks.us-east-1.amazonaws.com/id/88G998884RBAD6687HBE3GETY67FQE04', + * K8S_NAMESPACE: 'myNamespace', + * K8S_SERVICE_ACCOUNT: 'myServiceAccount' + * } + * tags: [ + * { + * key: "tagkey1", + * value: "tagValue1" + * }, + * { + * key: "tagkey1", + * value: "tagvalue2" + * } + * ], + * }).then((role) => { + * // role.roleArn, role.denyArns, role.instanceProfileArn, role.addedRoleToInstanceProfile, role.tags + * }) + */ + Alks.prototype.createRole = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var roleTypeExists, trustPolicyExists, results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: + roleTypeExists = props.roleType != null; + trustPolicyExists = props.trustPolicy != null; + if (!(roleTypeExists !== trustPolicyExists)) return [3 /*break*/, 2]; + return [4 /*yield*/, this.internalFetch('createRole', props)]; + case 1: + results = _a.sent(); + results.denyArns = results.denyArns.split(','); + return [2 /*return*/, pick(results, [ + 'roleArn', + 'denyArns', + 'instanceProfileArn', + 'addedRoleToInstanceProfile', + 'tags', + ])]; + case 2: throw new Error("Must include roleType or trustPolicy, but not both."); + } + }); + }); + }; + /** + * Returns a Promise for the results of creating a new custom AWS IAM trust role + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.account - The user's account associated with the custom role + * @param {string} props.role - The user's role associated with the account + * @param {string} props.roleName - The name of the custom AWS IAM role to create + * @param {string} props.roleType - The type of AWS role to use when creating the new role + * @param {number} props.includeDefaultPolicy - Whether to include the default policy in the new role (1 = yes, 0 = no) + * @param {string} props.trustArn - The Arn of the existing role to trust + * @param {string} props.trustType - Whether the trust is 'Cross Account' or 'Inner Account' + * @param {boolean} props.enableAlksAccess - Whether the role has a machine identity + * @param {Array.} props.tags - A list of tag objects, where each object is in the form {key: "tagKey" value: "tagValue"} + * @returns {Promise} + * @example + * alks.createNonServiceRole({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * role: 'IAMAdmin', + * roleName: 'awsRoleName', + * roleType: 'Amazon EC2', + * includeDefaultPolicy: 1, + * trustArn: 'anExistingRoleArn', + * trustType: 'Cross Account', + * enableAlksAccess: true + * }).then((role) => { + * // role.roleArn, role.denyArns, role.instanceProfileArn, role.addedRoleToInstanceProfile, role.tags + * }) + * @@example + * * alks.createNonServiceRole({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * role: 'IAMAdmin', + * roleName: 'awsRoleName', + * roleType: 'Amazon EC2', + * includeDefaultPolicy: 1, + * trustArn: 'anExistingRoleArn', + * trustType: 'Cross Account', + * enableAlksAccess: true, + * tags: [ + * { + * key: "tagkey1", + * value: "tagValue1" + * }, + * { + * key: "tagkey1", + * value: "tagvalue2" + * } + * ], + * }).then((role) => { + * // role.roleArn, role.denyArns, role.instanceProfileArn, role.addedRoleToInstanceProfile, role.tags + * }) + */ + Alks.prototype.createNonServiceRole = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('createNonServiceRole', props)]; + case 1: + results = _a.sent(); + results.denyArns = results.denyArns.split(','); + return [2 /*return*/, pick(results, [ + 'roleArn', + 'denyArns', + 'instanceProfileArn', + 'addedRoleToInstanceProfile', + 'tags', + ])]; + } + }); + }); + }; + /** + * Returns a Promise for an array of AWS account roles + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.account - The account number to get AWS roles for + * @returns {Promise} + * @example + * alks.awsAccountRoles({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: '1234567890', + * }).then((roles) => { + * // roles[i].roleArn, roles[i].isMachineIdentity, roles[i].assumeRolePolicyDocument + * }) + */ + Alks.prototype.awsAccountRoles = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch("awsAccountRoles?account=" + props.account, props, 'GET')]; + case 1: + results = _a.sent(); + return [2 /*return*/, results.awsRoleList]; + } + }); + }); + }; + /** + * Returns a Promise for an array of AWS custom AWS IAM account roles + * + * @deprecated Replaced by awsAccountRoles which includes AWS account roles and their details + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.account - The user's account associated with the custom role + * @param {string} props.role - The user's role associated with the account + * @returns {Promise} + * @example + * alks.listAWSAccountRoles({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * role: 'IAMAdmin', + * }).then((roleNames) => { + * // ['customRole1', 'customRole2', ...] + * }) + */ + Alks.prototype.listAWSAccountRoles = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('listAWSAccountRoles', props)]; + case 1: + results = _a.sent(); + return [2 /*return*/, JSON.parse(results.jsonAWSRoleList).map(function (r) { return r.split('/').slice(-1)[0]; })]; + } + }); + }); + }; + /** + * Returns a Promise for the Amazon Resource Name (ARN) of a custom AWS IAM account role + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.account - The user's account associated with the custom role + * @param {string} props.role - The user's role associated with the account + * @param {string} props.roleName - The name of the custom AWS IAM role + * @param {Array.} props.tags - A list of tag objects, where each object is in the form {key: "tagKey" value: "tagValue"} + * @returns {Promise} + * @example + * alks.getAccountRole({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * role: 'IAMAdmin', + * roleName: 'awsRoleName' + * }).then((role) => { + * // role.roleArn, role.isMachineIdentity, role.instanceProfileArn, role.tags, role.maxSessionDurationInSeconds + * }) + */ + Alks.prototype.getAccountRole = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('getAccountRole', props)]; + case 1: + results = _a.sent(); + if (!results.roleExists) { + throw new Error("Role " + props.roleName + " does not exist in this account"); + } + return [2 /*return*/, tslib_1.__assign(tslib_1.__assign({}, pick(results, [ + 'roleArn', + 'isMachineIdentity', + 'tags', + 'maxSessionDurationInSeconds', + ])), { instanceProfileArn: results.instanceProfileARN })]; + } + }); + }); + }; + /** + * Returns a Promise for the Amazon Resource Name (ARN) of a custom AWS IAM account role + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.account - The user's account associated with the custom role + * @param {string} props.role - The user's role associated with the account + * @param {string} props.roleName - The name of the custom AWS IAM role + * @param {Array.} props.tags - A list of tag objects, where each object is in the form {key: "tagKey" value: "tagValue"} + * @returns {Promise} + * @example + * alks.updateRole({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * role: 'IAMAdmin', + * roleName: 'awsRoleName' + * }).then((role) => { + * // role.roleArn, role.isMachineIdentity, role.instanceProfileArn, role.tags + * }) + */ + Alks.prototype.updateRole = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('role', props, 'PATCH')]; + case 1: + results = _a.sent(); + if (!results.roleExists) { + throw new Error("Role " + props.roleName + " does not exist in this account"); + } + return [2 /*return*/, tslib_1.__assign(tslib_1.__assign({}, pick(results, ['roleArn', 'isMachineIdentity', 'tags'])), { instanceProfileArn: results.instanceProfileARN })]; + } + }); + }); + }; + /** + * Returns a Promise for a boolean "true" indicating the role was deleted + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.account - The user's account associated with the custom role + * @param {string} props.role - The user's role associated with the account + * @param {string} props.roleName - The name of the custom AWS IAM role + * @returns {Promise} + * @example + * alks.deleteRole({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * role: 'IAMAdmin', + * roleName: 'awsRoleName' + * }).then(() => { + * // success! + * }) + */ + Alks.prototype.deleteRole = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('deleteRole', props)]; + case 1: + _a.sent(); + return [2 /*return*/, true]; + } + }); + }); + }; + /** + * Returns a Promise for a string arn indicating the role was enabled for machine identity + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.roleArn - The Amazon Resource Name (ARN) associated with the role + * @returns {Promise} + * @example + * alks.addRoleMachineIdentity({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * roleARN: 'arn:aws:iam::123:role/acct-managed/awsRoleName' + * }).then((roleARN) => { + * // arn:aws:iam::123:role/acct-managed/awsRoleName + * }) + */ + Alks.prototype.addRoleMachineIdentity = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('roleMachineIdentity', props)]; + case 1: + results = _a.sent(); + return [2 /*return*/, pick(results, ['machineIdentityArn'])]; + } + }); + }); + }; + /** + * Returns a Promise for a string arn indicating the role was disabled for machine identity + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.roleArn - The Amazon Resource Name (ARN) associated with the role + * @returns {Promise} + * @example + * alks.deleteRoleMachineIdentity({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * roleARN: 'arn:aws:iam::123:role/acct-managed/awsRoleName' + * }).then((roleARN) => { + * // arn:aws:iam::123:role/acct-managed/awsRoleName + * }) + */ + Alks.prototype.deleteRoleMachineIdentity = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('roleMachineIdentity', props, 'DELETE')]; + case 1: + results = _a.sent(); + return [2 /*return*/, pick(results, ['machineIdentityArn'])]; + } + }); + }); + }; + /** + * Returns a Promise for a list of users who have access to the given account + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.accountId - The accountId used to find which users have access to the account + * @returns {Promise} + * @example + * alks.getUserAccess({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * accountId: '012345678910', + * }).then((users) => { + * // users[i].sAMAccountName, users[i].displayName, users[i].email, users[i].title, users[i].department + * }) + */ + Alks.prototype.getUserAccess = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var accountId, results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: + accountId = props.accountId; + return [4 /*yield*/, this.internalFetch("userAccess/" + accountId, props, 'GET')]; + case 1: + results = _a.sent(); + return [2 /*return*/, results.users]; + } + }); + }); + }; + /** + * Returns a Promise for a map of role names to the list of users with that role for a given account + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.accountId - The accountId used to find which users have access to the account + * @returns {Promise} + * @example + * alks.getUserAccess({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * accountId: '012345678910', + * }).then((users) => { + * // users['Admin'].sAMAccountName, users['Admin'].displayName, users['Admin'].email, users['Admin'].title, users['Admin'].department + * }) + */ + Alks.prototype.getUserAccessByRole = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var accountId, results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: + accountId = props.accountId; + return [4 /*yield*/, this.internalFetch("reports/users-by-role?accountId=" + accountId, props, 'GET')]; + case 1: + results = _a.sent(); + return [2 /*return*/, results.users]; + } + }); + }); + }; + /** + * Returns a Promise for a list of roles a user has for a given account + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.accountId - The accountId used to find which users have access to the account + * @param {string} props.sAMAccountName - The network id of the user to lookup + * @returns {Promise} + * @example + * alks.getUserRoleAccess({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * accountId: '012345678910', + * sAMAccountName: 'bob1', + * }).then((roles) => { + * // ['Admin', 'LabAdmin', ...] + * }) + */ + Alks.prototype.getUserRoleAccess = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var accountId, results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: + accountId = props.accountId; + return [4 /*yield*/, this.internalFetch("userAccess/roles/" + accountId, props)]; + case 1: + results = _a.sent(); + return [2 /*return*/, results.roles]; + } + }); + }); + }; + /** + * Returns a Promise containing a list of the account owners for an account + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.accountId - The accountId used to find which users have access to the account + * @returns {Promise} + * @example + * alks.getAccountOwners({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * accountId: '012345678910', + * }).then((owners) => { + * // owners[0].sAMAccountName, owners[0].displayName, owners[0].email, owners[0].title, owners[0].department + * }) + */ + Alks.prototype.getAccountOwners = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var accountId, results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: + accountId = props.accountId; + return [4 /*yield*/, this.internalFetch("userAccess/owners/" + accountId, props, 'GET')]; + case 1: + results = _a.sent(); + return [2 /*return*/, results.accountOwners]; + } + }); + }); + }; + /** + * Returns a Promise for the results of creating new IAM user and long-term access keys + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.account - The user's account associated with the custom role + * @param {string} props.role - The user's role associated with the account + * @param {string} props.iamUserName - The name of the IAM user to create + * @returns {Promise} + * @example + * alks.createAccessKeys({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * role: 'IAMAdmin', + * iamUserName: 'iamUserName' + * }).then((user) => { + * // user.iamUserArn, user.accessKey, user.secretKey, user.addedIAMUserToGroup + * }) + * @example + * alks.createAccessKeys({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * role: 'IAMAdmin', + * iamUserName: 'iamUserName' + * tags: [ + * { + * key: "tagkey1", + * value: "tagValue1" + * }, + * { + * key: "tagkey1", + * value: "tagvalue2" + * } + * ], + * }).then((user) => { + * // user.iamUserArn, user.accessKey, user.secretKey, user.addedIAMUserToGroup + * }) + */ + Alks.prototype.createAccessKeys = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('accessKeys', props)]; + case 1: + results = _a.sent(); + return [2 /*return*/, pick(results, [ + 'iamUserArn', + 'accessKey', + 'secretKey', + 'addedIAMUserToGroup', + 'tags', + ])]; + } + }); + }); + }; + /** + * Returns a Promise for an IamUser + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.account - The user's account associated with the custom role + * @param {string} props.iamUserName - The name of the custom AWS IAM user + * @returns {Promise} + * @example + * alks.getIamUser({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * iamUserName: 'iamUserName' + * }).then((role) => { + * user.iamUserArn, user.AccountId, user.userName, user.accessKey, user.tags + * }) + */ + Alks.prototype.getIamUser = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch("iam-users/id/" + props.account + "/" + props.iamUserName, props, 'GET')]; + case 1: + results = _a.sent(); + return [2 /*return*/, pick(results.item, [ + 'arn', + 'accountId', + 'userName', + 'accessKey', + 'tags', + ])]; + } + }); + }); + }; + /** + * Returns a Promise for the results of updating an IAM user + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.account - The user's account associated with the custom role + * @param {string} props.iamUserName - The name of the IAM user to update + * @param {Array.} props.tags - A list of tag objects, where each object is in the form {key: "tagKey" value: "tagValue"} + * @returns {Promise} + * @example + * alks.updateIamUser({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * iamUserName: 'iamUserName', + * }).then((user) => { + * // user.iamUserArn, user.AccountId, user.userName, user.accessKey, user.tags + * }) + * @example + * alks.updateIamUser({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * iamUserName: 'iamUserName' + * tags: [ + * { + * key: "tagkey1", + * value: "tagValue1" + * }, + * { + * key: "tagkey1", + * value: "tagvalue2" + * } + * ], + * }).then((user) => { + * // user.iamUserArn, user.AccountId, user.userName, user.accessKey, user.tags + * }) + */ + Alks.prototype.updateIamUser = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var internalFetchProps, results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: + internalFetchProps = tslib_1.__assign(tslib_1.__assign({}, props), { user: { + tags: props.tags, + } }); + delete internalFetchProps.tags; + return [4 /*yield*/, this.internalFetch("iam-users/id/" + props.account + "/" + props.iamUserName, internalFetchProps, 'PATCH')]; + case 1: + results = _a.sent(); + return [2 /*return*/, pick(results.item, [ + 'arn', + 'accountId', + 'userName', + 'accessKey', + 'tags', + ])]; + } + }); + }); + }; + /** + * Returns a Promise for a boolean "true" indicating the IAM user and long-term access keys were deleted + * + * @param {Object} props - An object containing the following properties + * @param {string} props.baseUrl - The base URL of the ALKS service + * @param {string} props.accessToken - The OAuth2 access token used to authorize the request + * @param {string} props.account - The user's account associated with the custom role + * @param {string} props.role - The user's role associated with the account + * @param {string} props.iamUserName - The name of the IAM user to delete + * @returns {Promise} + * @example + * alks.deleteIAMUser({ + * baseUrl: 'https://your.alks-host.com', + * accessToken: 'abc123', + * account: 'anAccount', + * role: 'IAMAdmin', + * iamUserName: 'iamUserName' + * }).then(() => { + * // success! + * }) + */ + Alks.prototype.deleteIAMUser = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('IAMUser', props, 'DELETE')]; + case 1: + _a.sent(); + return [2 /*return*/, true]; + } + }); + }); + }; + /** + * Returns the version of the ALKS Rest API + * + * @param {Object} props - An object containing the following properties + * @returns {Promise} + * @example + * alks.version({ + * ... + * }).then((data) => { + * // data.version + * }) + */ + Alks.prototype.version = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('version', props, 'GET')]; + case 1: + results = _a.sent(); + return [2 /*return*/, pick(results, ['version'])]; + } + }); + }); + }; + /** + * Returns information about one of the roles used to generate keys + * + * @param {Object} props - An object containing the following properties + * @param {string} props.accountId - The 12-digit account ID associated with the custom role + * @param {string} props.role - The user's role associated with the account + * @returns {Promise} + * @example + * alks.getLoginRole({ + * ... + * }).then((loginRole) => { + * // loginRole.account, loginRole.role, loginRole.iamKeyActive, loginRole.maxKeyDuration + * }) + */ + Alks.prototype.getLoginRole = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var accountId, role, results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: + accountId = props.accountId, role = props.role; + return [4 /*yield*/, this.internalFetch("loginRoles/id/" + accountId + "/" + role, props, 'GET')]; + case 1: + results = (_a.sent()); + // TODO we should probably update this function to include skypieaAccount in the result since it's already being fetched - Ben W 5/10/21 + return [2 /*return*/, pick(results.loginRole, [ + 'account', + 'role', + 'iamKeyActive', + 'maxKeyDuration', + 'securityLevel', + ])]; + } + }); + }); + }; + /** + * Exchanges a refresh token for an access token + * + * @param {Object} props - An object containing the following properties + * @param {string} props.refreshToken - the refresh token to exchange + * @returns {Promise} + * @example + * alks.getAccessToken({ + * ... + * }).then((data) => { + * // data.accessToken, data.expiresIn + * }) + */ + Alks.prototype.getAccessToken = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('accessToken', props)]; + case 1: + results = _a.sent(); + return [2 /*return*/, pick(results, ['accessToken', 'expiresIn'])]; + } + }); + }); + }; + /** + * Returns a list of a user's refresh tokens (Does not return the full token) + * + * @param {Object} props - An object containing the following properties + * @returns {Array} + * @example + * alks.getRefreshTokens({ + * ... + * }).then((tokens) => { + * // token[i].clientId, token[i].id, token[i].userId, token[i].value + * }) + */ + Alks.prototype.getRefreshTokens = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('refreshTokens', props, 'GET')]; + case 1: + results = (_a.sent()); + return [2 /*return*/, results.refreshTokens.map(function (token) { + return pick(token, ['clientId', 'id', 'userId', 'value']); + })]; + } + }); + }); + }; + /** + * Revokes a refresh or access token + * + * @param {Object} props - An object containing the following properties + * @param {string} [props.token] - the access or refresh token to revoke (Required if tokenId not specified) + * @param {string} [props.tokenId] - the ID of the refresh token to revoke (Required if token not specified) + * @returns {boolean} + * @example + * alks.revoke({ + * token: '...', + * ... + * }).then((success) => { + * // success == true + * }) + * + * // or + * + * alks.revoke({ + * tokenId: '...', + * ... + * }).then((success) => { + * // success == true + * }) + */ + Alks.prototype.revoke = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch('revoke', props)]; + case 1: + results = _a.sent(); + return [2 /*return*/, results.statusMessage == 'Success']; + } + }); + }); + }; + /** + * Returns cost totals for the specified account for the day, week, month, year, and a breakdown of costs by service for the day and month + * + * @param {Object} props - An object containing the following properties + * @param {String} props.accountId - the 12-digit AWS account ID to get cost data for + * @returns {Object} + * @example + * alks.getCostTotals({ + * accountId: '012345678910', + * }).then((costTotals) => { + * // costTotals.awsAccountId, costTotals.daily, costTotals.weekly, etc. + * }) + */ + Alks.prototype.getCostTotals = function (props) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var results; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.internalFetch("costTotals/" + props.accountId, props, 'GET')]; + case 1: + results = (_a.sent()); + return [2 /*return*/, pick(results.costTotals, [ + 'awsAccountId', + 'yyyy', + 'mm', + 'dd', + 'daily', + 'weekly', + 'monthly', + 'yearly', + 'dailyCostsByService', + 'monthlyCostsByService', + ])]; + } + }); + }); + }; + Alks.prototype.internalFetch = function (path, args, method) { + if (args === void 0) { args = {}; } + if (method === void 0) { method = 'POST'; } + return tslib_1.__awaiter(this, void 0, void 0, function () { + var opts, payload, headers, credentials, response, json, err_1; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: + opts = tslib_1.__assign(tslib_1.__assign({}, this.config), args); + payload = tslib_1.__assign({}, opts); + headers = { + 'Content-Type': 'application/json', + 'User-Agent': "AlksJS/" + packageJson.version, + }; + if (isTokenAuth(opts)) { + headers['Authorization'] = "Bearer " + opts.accessToken; + delete payload.accessToken; + } + else if (isStsAuth(opts)) { + headers['ALKS-STS-Access-Key'] = opts.accessKey; + headers['ALKS-STS-Secret-Key'] = opts.secretKey; + headers['ALKS-STS-Session-Token'] = opts.sessionToken; + delete payload.accessKey; + delete payload.secretKey; + delete payload.sessionToken; + } + else if (isPasswordAuth(opts)) { + console.error('The userid and password properties are deprecated and should be replaced with an access token'); + credentials = base64Encode(opts.userid + ":" + opts.password); + headers['Authorization'] = "Basic " + credentials; + delete payload.userid; + delete payload.password; + } + else ; + if (opts.userAgent) { + headers['User-Agent'] += " " + opts.userAgent; + delete payload.userAgent; + } + return [4 /*yield*/, opts._fetch(opts.baseUrl + "/" + path, { + method: method, + headers: headers, + credentials: 'omit', + body: method == 'GET' ? undefined : JSON.stringify(payload), + })]; + case 1: + response = _a.sent(); + _a.label = 2; + case 2: + _a.trys.push([2, 4, , 5]); + return [4 /*yield*/, response.json()]; + case 3: + json = _a.sent(); + return [3 /*break*/, 5]; + case 4: + err_1 = _a.sent(); + json = { + errors: [err_1.message], + }; + return [3 /*break*/, 5]; + case 5: + if (!response.ok) { + throw new AlksError(response, json); + } + return [2 /*return*/, json]; + } + }); + }); + }; + return Alks; + }()); + ALKS.Alks = Alks; + var AlksError = /** @class */ (function (_super) { + tslib_1.__extends(AlksError, _super); + function AlksError(response, json) { + var _this = this; + var errors = Array.isArray(json === null || json === void 0 ? void 0 : json.errors) ? json.errors : []; + if (response.statusText) { + errors.unshift(response.statusText); + } + var message = errors.join('; '); + _this = _super.call(this, message) || this; + _this.status = response.status; + _this.message = message; + Object.assign(_this, json); + return _this; + } + return AlksError; + }(Error)); + ALKS.AlksError = AlksError; + /** + * Encodes a string to base 64 + * + * @param str - the string to encode + * @private + * @returns the base64 encoded string + * @example + * var input = 'password'; + * base64Encode(input); + */ + function base64Encode(str) { + if (str === void 0) { str = ''; } + return buffer_1.Buffer.from(str).toString('base64'); + } + function pick(obj, props) { + return props.reduce(function (acc, prop) { return ((acc[prop] = obj[prop]), acc); }, {}); + } + var defaultConfig = { + _fetch: fetch, + }; + var defaultAlks = Alks.prototype.create.call({}, defaultConfig); + ALKS.create = Alks.prototype.create.bind(defaultAlks); + ALKS.getAccounts = Alks.prototype.getAccounts.bind(defaultAlks); + ALKS.getKeys = Alks.prototype.getKeys.bind(defaultAlks); + ALKS.getIAMKeys = Alks.prototype.getIAMKeys.bind(defaultAlks); + ALKS.getAllAWSRoleTypes = Alks.prototype.getAllAWSRoleTypes.bind(defaultAlks); + ALKS.getAWSRoleTypes = Alks.prototype.getAWSRoleTypes.bind(defaultAlks); + ALKS.getNonServiceAWSRoleTypes = Alks.prototype.getNonServiceAWSRoleTypes.bind(defaultAlks); + ALKS.createRole = Alks.prototype.createRole.bind(defaultAlks); + ALKS.createNonServiceRole = Alks.prototype.createNonServiceRole.bind(defaultAlks); + ALKS.awsAccountRoles = Alks.prototype.awsAccountRoles.bind(defaultAlks); + ALKS.listAWSAccountRoles = Alks.prototype.listAWSAccountRoles.bind(defaultAlks); + ALKS.getAccountRole = Alks.prototype.getAccountRole.bind(defaultAlks); + ALKS.updateRole = Alks.prototype.updateRole.bind(defaultAlks); + ALKS.deleteRole = Alks.prototype.deleteRole.bind(defaultAlks); + ALKS.addRoleMachineIdentity = Alks.prototype.addRoleMachineIdentity.bind(defaultAlks); + ALKS.deleteRoleMachineIdentity = Alks.prototype.deleteRoleMachineIdentity.bind(defaultAlks); + ALKS.getUserAccess = Alks.prototype.getUserAccess.bind(defaultAlks); + ALKS.getUserAccessByRole = Alks.prototype.getUserAccessByRole.bind(defaultAlks); + ALKS.getUserRoleAccess = Alks.prototype.getUserRoleAccess.bind(defaultAlks); + ALKS.getAccountOwners = Alks.prototype.getAccountOwners.bind(defaultAlks); + ALKS.createAccessKeys = Alks.prototype.createAccessKeys.bind(defaultAlks); + ALKS.getIamUser = Alks.prototype.getIamUser.bind(defaultAlks); + ALKS.updateIamUser = Alks.prototype.updateIamUser.bind(defaultAlks); + ALKS.deleteIAMUser = Alks.prototype.deleteIAMUser.bind(defaultAlks); + ALKS.version = Alks.prototype.version.bind(defaultAlks); + ALKS.getLoginRole = Alks.prototype.getLoginRole.bind(defaultAlks); + ALKS.getAccessToken = Alks.prototype.getAccessToken.bind(defaultAlks); + ALKS.getRefreshTokens = Alks.prototype.getRefreshTokens.bind(defaultAlks); + ALKS.revoke = Alks.prototype.revoke.bind(defaultAlks); + ALKS.getCostTotals = Alks.prototype.getCostTotals.bind(defaultAlks); + })(ALKS || (ALKS = {})); var alks = ALKS; exports.default = alks; diff --git a/docs/classes/export_.Alks.html b/docs/classes/export_.Alks.html index 8b5d5198..cc93b021 100644 --- a/docs/classes/export_.Alks.html +++ b/docs/classes/export_.Alks.html @@ -1,6 +1,6 @@ Alks | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

ALKS JavaScript API

-

Hierarchy

  • Alks

Index

Constructors

Properties

Methods

Hierarchy

  • Alks

Index

Constructors

Properties

Methods

Returns Promise<export=.MachineIdentity>

Returns Promise<export=.AwsAccountRole[]>

  • Returns a new instance of alks with pre-defined properties (which don't need to be supplied to every method).

    Any of the properties required by other methods can be specified here.

    Properties present on the current object are carried through to the newly created one.

    @@ -39,7 +39,7 @@ })

    Parameters

    • props: export=.AlksProps

      An object containing settings for the new ALKS object

      -

    Returns Alks

Returns Alks

Returns Promise<export=.LongTermKey>

Returns Promise<export=.Role>

Returns Promise<export=.Role>

Returns Promise<boolean>

Returns Promise<boolean>

Returns Promise<export=.MachineIdentity>

  • Returns a Promise for an array of available AWS IAM role types

    deprecated

    Replaced by getAllAWSRoleTypes which includes all AWS role types and their details

    example

    alks.getAWSRoleTypes({ @@ -228,7 +228,7 @@ })

    Parameters

    Returns Promise<string[]>

Returns Promise<string[]>

Returns Promise<export=.AccessToken>

Returns Promise<export=.User[]>

Returns Promise<export=.Role>

Returns Promise<export=.Account[]>

Returns Promise<export=.AwsRoleType[]>

  • Returns cost totals for the specified account for the day, week, month, year, and a breakdown of costs by service for the day and month

    example

    alks.getCostTotals({ accountId: '012345678910', @@ -297,7 +297,7 @@ })

    Parameters

    Returns Promise<export=.CostTotal>

Returns Promise<export=.CostTotal>

Returns Promise<export=.Key>

Returns Promise<export=.IamUser>

Returns Promise<export=.Key>

  • Returns information about one of the roles used to generate keys

    example

    alks.getLoginRole({ ... @@ -344,7 +344,7 @@ })

    Parameters

    Returns Promise<Omit<export=.Account, "skypieaAccount">>

Returns Promise<Omit<export=.Account, "skypieaAccount">>

  • Returns a Promise for an array of available custom role types

    deprecated

    Replaced by getAllAWSRoleTypes which includes all AWS role types and their details

    example

    alks.getNonServiceAWSRoleTypes({ @@ -355,7 +355,7 @@ })

    Parameters

    Returns Promise<string[]>

Returns Promise<string[]>

Returns Promise<export=.RefreshToken[]>

Returns Promise<export=.User[]>

Returns Promise<Record<string, export=.User[]>>

  • internalFetch(path: string, args?: Partial<export=.AlksProps>, method?: string): Promise<any>

Returns Promise<string[]>

  • internalFetch(path: string, args?: Partial<export=.AlksProps>, method?: string): Promise<any>
  • Returns a Promise for an array of AWS custom AWS IAM account roles

    deprecated

    Replaced by awsAccountRoles which includes AWS account roles and their details

    example

    alks.listAWSAccountRoles({ @@ -411,7 +411,7 @@ })

    Parameters

    Returns Promise<string[]>

Returns Promise<string[]>

  • Revokes a refresh or access token

    example

    alks.revoke({ token: '...', @@ -428,7 +428,7 @@ })

    Parameters

    Returns Promise<boolean>

Returns Promise<boolean>

Returns Promise<export=.IamUser>

Returns Promise<export=.Role>

  • Returns the version of the ALKS Rest API

    example

    alks.version({ ... diff --git a/docs/classes/export_.AlksError.html b/docs/classes/export_.AlksError.html index 16119947..5a638eb3 100644 --- a/docs/classes/export_.AlksError.html +++ b/docs/classes/export_.AlksError.html @@ -1,4 +1,4 @@ -AlksError | alks.js

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Class AlksError

    Hierarchy

    • Error
      • AlksError

    Indexable

    [s: string]: any

    Index

    Constructors

    • new AlksError(response: Response, json: any): AlksError

    Properties

    message: string
    name: string
    stack?: string
    status: number
    stackTraceLimit: number

    Methods

    • captureStackTrace(targetObject: object, constructorOpt?: Function): void
    • +AlksError | alks.js
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Class AlksError

      Hierarchy

      • Error
        • AlksError

      Indexable

      [s: string]: any

      Index

      Constructors

      • new AlksError(response: Response, json: any): AlksError

      Properties

      message: string
      name: string
      stack?: string
      status: number
      stackTraceLimit: number

      Methods

      • captureStackTrace(targetObject: object, constructorOpt?: Function): void
      • Create .stack property on a target object

        Parameters

        • targetObject: object
        • Optional constructorOpt: Function

        Returns void

      • prepareStackTrace(err: Error, stackTraces: CallSite[]): any
      • Optional override for formatting stack traces

        diff --git a/docs/enums/export_.PseudoBoolean.html b/docs/enums/export_.PseudoBoolean.html index 2cb48713..acd7c3ab 100644 --- a/docs/enums/export_.PseudoBoolean.html +++ b/docs/enums/export_.PseudoBoolean.html @@ -1 +1 @@ -PseudoBoolean | alks.js
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Enumeration PseudoBoolean

        Index

        Enumeration members

        Enumeration members

        False = 0
        True = 1

        Legend

        • Property

        Settings

        Theme

        Generated using TypeDoc

        \ No newline at end of file +PseudoBoolean | alks.js
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Enumeration PseudoBoolean

        Index

        Enumeration members

        Enumeration members

        False = 0
        True = 1

        Legend

        • Property

        Settings

        Theme

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/enums/export_.TrustType.html b/docs/enums/export_.TrustType.html index 89767932..60ffdcf0 100644 --- a/docs/enums/export_.TrustType.html +++ b/docs/enums/export_.TrustType.html @@ -1 +1 @@ -TrustType | alks.js
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Enumeration TrustType

        Index

        Enumeration members

        Enumeration members

        CrossAccount = "Cross Account"
        InnerAccount = "Inner Account"

        Legend

        • Property

        Settings

        Theme

        Generated using TypeDoc

        \ No newline at end of file +TrustType | alks.js
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Enumeration TrustType

        Index

        Enumeration members

        Enumeration members

        CrossAccount = "Cross Account"
        InnerAccount = "Inner Account"

        Legend

        • Property

        Settings

        Theme

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/interfaces/AccessToken.html b/docs/interfaces/AccessToken.html index ea87920c..de8249b6 100644 --- a/docs/interfaces/AccessToken.html +++ b/docs/interfaces/AccessToken.html @@ -1 +1 @@ -AccessToken | alks.js
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Interface AccessToken

        Hierarchy

        • AccessToken

        Index

        Properties

        accessToken: string
        expiresIn: string

        Legend

        • Property

        Settings

        Theme

        Generated using TypeDoc

        \ No newline at end of file +AccessToken | alks.js
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Interface AccessToken

        Hierarchy

        • AccessToken

        Index

        Properties

        accessToken: string
        expiresIn: string

        Legend

        • Property

        Settings

        Theme

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/interfaces/Account.html b/docs/interfaces/Account.html index 92d8e50d..19f19de4 100644 --- a/docs/interfaces/Account.html +++ b/docs/interfaces/Account.html @@ -5,4 +5,4 @@
    property

    iamKeyActive - Whether credentials with IAM permissions can be provisioned from this account

    property

    maxKeyDuration - The maximum key duration for this account

    property

    skypieaAccount - extra information about the account from Skypiea

    -

Hierarchy

  • Account

Index

Properties

account: string
iamKeyActive: boolean
maxKeyDuration: number
role: string
securityLevel: string
skypieaAccount: null | export=.SkypieaAccount

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • Account

Index

Properties

account: string
iamKeyActive: boolean
maxKeyDuration: number
role: string
securityLevel: string
skypieaAccount: null | export=.SkypieaAccount

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/AccountUserDetails.html b/docs/interfaces/AccountUserDetails.html index 2c0318af..70a9ea16 100644 --- a/docs/interfaces/AccountUserDetails.html +++ b/docs/interfaces/AccountUserDetails.html @@ -3,4 +3,4 @@
property

samAccountName - the samAccountName of the user

property

email - the email of the user

property

href - the href self link

-

Hierarchy

  • AccountUserDetails

Index

Properties

email: string
href: string
samAccountName: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • AccountUserDetails

Index

Properties

email: string
href: string
samAccountName: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/AwsAccountRole.html b/docs/interfaces/AwsAccountRole.html index 5f11be62..12500bfd 100644 --- a/docs/interfaces/AwsAccountRole.html +++ b/docs/interfaces/AwsAccountRole.html @@ -3,4 +3,4 @@
property

roleArn - The AWS Role ARN

property

isMachineIdentity - true|false value of if this role is a machine identity

property

assumeRolePolicyDocument - The AWS assume role policy document associated with this role

-

Hierarchy

  • AwsAccountRole

Index

Properties

assumeRolePolicyDocument: object
isMachineIdentity: boolean
roleArn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • AwsAccountRole

Index

Properties

assumeRolePolicyDocument: object
isMachineIdentity: boolean
roleArn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/AwsRoleType.html b/docs/interfaces/AwsRoleType.html index 691cd0d8..2a7f62d6 100644 --- a/docs/interfaces/AwsRoleType.html +++ b/docs/interfaces/AwsRoleType.html @@ -5,4 +5,4 @@
property

trustRelationship - The AWS trust policy document associated with this role

property

instanceProfile - Whether this role is an instance profile

property

templateVariables - A list of template variables that exist within the role type's trust policy document

-

Hierarchy

  • AwsRoleType

Index

Properties

defaultArns: string[]
instanceProfile: boolean
roleTypeName: string
templateVariables?: string[]
trustRelationship: object

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • AwsRoleType

Index

Properties

defaultArns: string[]
instanceProfile: boolean
roleTypeName: string
templateVariables?: string[]
trustRelationship: object

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/CloudsploitReport.html b/docs/interfaces/CloudsploitReport.html index e9b213bf..47f89ef0 100644 --- a/docs/interfaces/CloudsploitReport.html +++ b/docs/interfaces/CloudsploitReport.html @@ -12,4 +12,4 @@
property

warning - the amount of warnings

property

failing - the amount of fails

property

unknown - the amount of unknowns

-

Hierarchy

  • CloudsploitReport

Index

Properties

awsAccountId: string
day: number
failing: number
href: string
month: number
newRisks: number
passing: number
scanDate: string
scanId: number
unknown: number
warning: number
year: number

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • CloudsploitReport

Index

Properties

awsAccountId: string
day: number
failing: number
href: string
month: number
newRisks: number
passing: number
scanDate: string
scanId: number
unknown: number
warning: number
year: number

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/CostTotal.html b/docs/interfaces/CostTotal.html index 93574ba0..05f5f1fe 100644 --- a/docs/interfaces/CostTotal.html +++ b/docs/interfaces/CostTotal.html @@ -1 +1 @@ -CostTotal | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface CostTotal

Hierarchy

  • CostTotal

Index

Properties

awsAccountId: string
daily: string
dailyCostsByService: Record<string, string>
dd: string
mm: string
monthly: string
monthlyCostsByService: Record<string, string>
weekly: string
yearly: string
yyyy: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +CostTotal | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface CostTotal

Hierarchy

  • CostTotal

Index

Properties

awsAccountId: string
daily: string
dailyCostsByService: Record<string, string>
dd: string
mm: string
monthly: string
monthlyCostsByService: Record<string, string>
weekly: string
yearly: string
yyyy: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/IamUser.html b/docs/interfaces/IamUser.html index 1673d108..6936fae2 100644 --- a/docs/interfaces/IamUser.html +++ b/docs/interfaces/IamUser.html @@ -1 +1 @@ -IamUser | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IamUser

Hierarchy

  • IamUser

Index

Properties

accessKey: string
accountId: string
arn: string
tags: export=.Tag[]
userName: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +IamUser | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IamUser

Hierarchy

  • IamUser

Index

Properties

accessKey: string
accountId: string
arn: string
tags: export=.Tag[]
userName: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/Key.html b/docs/interfaces/Key.html index 97933900..fce1693f 100644 --- a/docs/interfaces/Key.html +++ b/docs/interfaces/Key.html @@ -4,4 +4,4 @@
property

secretKey - AWS secret key

property

sessionToken - AWS STS session token

property

consoleURL - a URL to the AWS console using these keys

-

Hierarchy

  • Key

Index

Properties

accessKey: string
consoleURL: string
secretKey: string
sessionToken: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • Key

Index

Properties

accessKey: string
consoleURL: string
secretKey: string
sessionToken: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/LongTermKey.html b/docs/interfaces/LongTermKey.html index e7a9b8ad..62a88145 100644 --- a/docs/interfaces/LongTermKey.html +++ b/docs/interfaces/LongTermKey.html @@ -4,4 +4,4 @@
property

accessKey - the long term access key

property

secretKey - the secret key for the long term access key

property

addedIAMUserToGroup - whether the user was successfuly added to the deny policy group

-

Hierarchy

  • LongTermKey

Index

Properties

accessKey: string
addedIAMUserToGroup: boolean
iamUserArn: string
secretKey: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • LongTermKey

Index

Properties

accessKey: string
addedIAMUserToGroup: boolean
iamUserArn: string
secretKey: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/MachineIdentity.html b/docs/interfaces/MachineIdentity.html index c33872e5..bee5fbee 100644 --- a/docs/interfaces/MachineIdentity.html +++ b/docs/interfaces/MachineIdentity.html @@ -1 +1 @@ -MachineIdentity | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MachineIdentity

Hierarchy

  • MachineIdentity

Index

Properties

machineIdentityArn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +MachineIdentity | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MachineIdentity

Hierarchy

  • MachineIdentity

Index

Properties

machineIdentityArn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/RefreshToken.html b/docs/interfaces/RefreshToken.html index ce0ee61d..db91ee79 100644 --- a/docs/interfaces/RefreshToken.html +++ b/docs/interfaces/RefreshToken.html @@ -1 +1 @@ -RefreshToken | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface RefreshToken

Hierarchy

  • RefreshToken

Index

Properties

clientId: string
id: string
userId: string
value: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +RefreshToken | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface RefreshToken

Hierarchy

  • RefreshToken

Index

Properties

clientId: string
id: string
userId: string
value: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/Role.html b/docs/interfaces/Role.html index 77937156..ffe1b544 100644 --- a/docs/interfaces/Role.html +++ b/docs/interfaces/Role.html @@ -5,4 +5,4 @@
property

instanceProfileArn - The Instance Profile ARN associated with this role

property

addedRoleToInstanceProfile - Whether this role was added to an Instance Profile

property

tags - Resource tags associated with the IAM account role

-

Hierarchy

  • Role

Index

Properties

addedRoleToInstanceProfile?: boolean
denyArns?: string
instanceProfileArn: string
isMachineIdentity?: boolean
maxSessionDurationInSeconds?: number
roleArn: string
tags?: export=.Tag[]

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • Role

Index

Properties

addedRoleToInstanceProfile?: boolean
denyArns?: string
instanceProfileArn: string
isMachineIdentity?: boolean
maxSessionDurationInSeconds?: number
roleArn: string
tags?: export=.Tag[]

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/SkypieaAccount.html b/docs/interfaces/SkypieaAccount.html index 77acee41..1f26d879 100644 --- a/docs/interfaces/SkypieaAccount.html +++ b/docs/interfaces/SkypieaAccount.html @@ -3,4 +3,4 @@
property

label - the friendly name of the account

property

accountOwners - the samAccountNames of the account owners

property

cloudsploitTrend - the cloudsploit trends

-

Hierarchy

  • SkypieaAccount

Index

Properties

accountOwners: export=.AccountUserDetails[]
cloudsploitTrend: export=.CloudsploitReport[]
label: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • SkypieaAccount

Index

Properties

accountOwners: export=.AccountUserDetails[]
cloudsploitTrend: export=.CloudsploitReport[]
label: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/Tag.html b/docs/interfaces/Tag.html index 41f3fe41..35dfd135 100644 --- a/docs/interfaces/Tag.html +++ b/docs/interfaces/Tag.html @@ -2,4 +2,4 @@

Alks role tags

property

key - The AWS role tag key

property

value - The AWS role tag value

-

Hierarchy

  • Tag

Index

Properties

Properties

key: string
value: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • Tag

Index

Properties

Properties

key: string
value: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/User.html b/docs/interfaces/User.html index df4c4345..34f341ed 100644 --- a/docs/interfaces/User.html +++ b/docs/interfaces/User.html @@ -5,4 +5,4 @@
property

email - The user email

property

title - The user title

property

department - The user department

-

Hierarchy

  • User

Index

Properties

department: string
displayName: string
email: string
sAMAccountName: string
title: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • User

Index

Properties

department: string
displayName: string
email: string
sAMAccountName: string
title: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.AccessToken.html b/docs/interfaces/export_.AccessToken.html index e6484a76..07d44956 100644 --- a/docs/interfaces/export_.AccessToken.html +++ b/docs/interfaces/export_.AccessToken.html @@ -1 +1 @@ -AccessToken | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface AccessToken

Hierarchy

  • AccessToken

Index

Properties

accessToken: string
expiresIn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +AccessToken | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface AccessToken

Hierarchy

  • AccessToken

Index

Properties

accessToken: string
expiresIn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.Account.html b/docs/interfaces/export_.Account.html index a993aecc..564051bc 100644 --- a/docs/interfaces/export_.Account.html +++ b/docs/interfaces/export_.Account.html @@ -5,4 +5,4 @@
property

iamKeyActive - Whether credentials with IAM permissions can be provisioned from this account

property

maxKeyDuration - The maximum key duration for this account

property

skypieaAccount - extra information about the account from Skypiea

-

Hierarchy

  • Account

Index

Properties

account: string
iamKeyActive: boolean
maxKeyDuration: number
role: string
securityLevel: string
skypieaAccount: null | export=.SkypieaAccount

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • Account

Index

Properties

account: string
iamKeyActive: boolean
maxKeyDuration: number
role: string
securityLevel: string
skypieaAccount: null | export=.SkypieaAccount

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.AccountUserDetails.html b/docs/interfaces/export_.AccountUserDetails.html index 9c067bb5..661923f4 100644 --- a/docs/interfaces/export_.AccountUserDetails.html +++ b/docs/interfaces/export_.AccountUserDetails.html @@ -3,4 +3,4 @@
property

samAccountName - the samAccountName of the user

property

email - the email of the user

property

href - the href self link

-

Hierarchy

  • AccountUserDetails

Index

Properties

email: string
href: string
samAccountName: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • AccountUserDetails

Index

Properties

email: string
href: string
samAccountName: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.AwsAccountRole.html b/docs/interfaces/export_.AwsAccountRole.html index 43460d4d..c5fa40f4 100644 --- a/docs/interfaces/export_.AwsAccountRole.html +++ b/docs/interfaces/export_.AwsAccountRole.html @@ -3,4 +3,4 @@
property

roleArn - The AWS Role ARN

property

isMachineIdentity - true|false value of if this role is a machine identity

property

assumeRolePolicyDocument - The AWS assume role policy document associated with this role

-

Hierarchy

  • AwsAccountRole

Index

Properties

assumeRolePolicyDocument: object
isMachineIdentity: boolean
roleArn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • AwsAccountRole

Index

Properties

assumeRolePolicyDocument: object
isMachineIdentity: boolean
roleArn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.AwsRoleType.html b/docs/interfaces/export_.AwsRoleType.html index 714624b1..54a4ed95 100644 --- a/docs/interfaces/export_.AwsRoleType.html +++ b/docs/interfaces/export_.AwsRoleType.html @@ -5,4 +5,4 @@
property

trustRelationship - The AWS trust policy document associated with this role

property

instanceProfile - Whether this role is an instance profile

property

templateVariables - A list of template variables that exist within the role type's trust policy document

-

Hierarchy

  • AwsRoleType

Index

Properties

defaultArns: string[]
instanceProfile: boolean
roleTypeName: string
templateVariables?: string[]
trustRelationship: object

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • AwsRoleType

Index

Properties

defaultArns: string[]
instanceProfile: boolean
roleTypeName: string
templateVariables?: string[]
trustRelationship: object

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.CloudsploitReport.html b/docs/interfaces/export_.CloudsploitReport.html index 42cdfbf7..b6d7011a 100644 --- a/docs/interfaces/export_.CloudsploitReport.html +++ b/docs/interfaces/export_.CloudsploitReport.html @@ -12,4 +12,4 @@
property

warning - the amount of warnings

property

failing - the amount of fails

property

unknown - the amount of unknowns

-

Hierarchy

  • CloudsploitReport

Index

Properties

awsAccountId: string
day: number
failing: number
href: string
month: number
newRisks: number
passing: number
scanDate: string
scanId: number
unknown: number
warning: number
year: number

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • CloudsploitReport

Index

Properties

awsAccountId: string
day: number
failing: number
href: string
month: number
newRisks: number
passing: number
scanDate: string
scanId: number
unknown: number
warning: number
year: number

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.CostTotal.html b/docs/interfaces/export_.CostTotal.html index 837f4f74..27d68749 100644 --- a/docs/interfaces/export_.CostTotal.html +++ b/docs/interfaces/export_.CostTotal.html @@ -1 +1 @@ -CostTotal | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface CostTotal

Hierarchy

  • CostTotal

Index

Properties

awsAccountId: string
daily: string
dailyCostsByService: Record<string, string>
dd: string
mm: string
monthly: string
monthlyCostsByService: Record<string, string>
weekly: string
yearly: string
yyyy: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +CostTotal | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface CostTotal

Hierarchy

  • CostTotal

Index

Properties

awsAccountId: string
daily: string
dailyCostsByService: Record<string, string>
dd: string
mm: string
monthly: string
monthlyCostsByService: Record<string, string>
weekly: string
yearly: string
yyyy: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.IamUser.html b/docs/interfaces/export_.IamUser.html index 02521d0e..1bbe6bcd 100644 --- a/docs/interfaces/export_.IamUser.html +++ b/docs/interfaces/export_.IamUser.html @@ -1 +1 @@ -IamUser | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IamUser

Hierarchy

  • IamUser

Index

Properties

accessKey: string
accountId: string
arn: string
tags: export=.Tag[]
userName: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +IamUser | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IamUser

Hierarchy

  • IamUser

Index

Properties

accessKey: string
accountId: string
arn: string
tags: export=.Tag[]
userName: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.Key.html b/docs/interfaces/export_.Key.html index c4b8f8c8..c309d01e 100644 --- a/docs/interfaces/export_.Key.html +++ b/docs/interfaces/export_.Key.html @@ -4,4 +4,4 @@
property

secretKey - AWS secret key

property

sessionToken - AWS STS session token

property

consoleURL - a URL to the AWS console using these keys

-

Hierarchy

  • Key

Index

Properties

accessKey: string
consoleURL: string
secretKey: string
sessionToken: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • Key

Index

Properties

accessKey: string
consoleURL: string
secretKey: string
sessionToken: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.LongTermKey.html b/docs/interfaces/export_.LongTermKey.html index b710f3dc..0bbc6ed5 100644 --- a/docs/interfaces/export_.LongTermKey.html +++ b/docs/interfaces/export_.LongTermKey.html @@ -4,4 +4,4 @@
property

accessKey - the long term access key

property

secretKey - the secret key for the long term access key

property

addedIAMUserToGroup - whether the user was successfuly added to the deny policy group

-

Hierarchy

  • LongTermKey

Index

Properties

accessKey: string
addedIAMUserToGroup: boolean
iamUserArn: string
secretKey: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • LongTermKey

Index

Properties

accessKey: string
addedIAMUserToGroup: boolean
iamUserArn: string
secretKey: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.MachineIdentity.html b/docs/interfaces/export_.MachineIdentity.html index fa68c77b..4409c99f 100644 --- a/docs/interfaces/export_.MachineIdentity.html +++ b/docs/interfaces/export_.MachineIdentity.html @@ -1 +1 @@ -MachineIdentity | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MachineIdentity

Hierarchy

  • MachineIdentity

Index

Properties

machineIdentityArn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +MachineIdentity | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MachineIdentity

Hierarchy

  • MachineIdentity

Index

Properties

machineIdentityArn: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.RefreshToken.html b/docs/interfaces/export_.RefreshToken.html index a87a2d41..2db366a6 100644 --- a/docs/interfaces/export_.RefreshToken.html +++ b/docs/interfaces/export_.RefreshToken.html @@ -1 +1 @@ -RefreshToken | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface RefreshToken

Hierarchy

  • RefreshToken

Index

Properties

clientId: string
id: string
userId: string
value: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +RefreshToken | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface RefreshToken

Hierarchy

  • RefreshToken

Index

Properties

clientId: string
id: string
userId: string
value: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.Role.html b/docs/interfaces/export_.Role.html index 248f3b54..729fa76e 100644 --- a/docs/interfaces/export_.Role.html +++ b/docs/interfaces/export_.Role.html @@ -5,4 +5,4 @@
property

instanceProfileArn - The Instance Profile ARN associated with this role

property

addedRoleToInstanceProfile - Whether this role was added to an Instance Profile

property

tags - Resource tags associated with the IAM account role

-

Hierarchy

  • Role

Index

Properties

addedRoleToInstanceProfile?: boolean
denyArns?: string
instanceProfileArn: string
isMachineIdentity?: boolean
maxSessionDurationInSeconds?: number
roleArn: string
tags?: export=.Tag[]

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • Role

Index

Properties

addedRoleToInstanceProfile?: boolean
denyArns?: string
instanceProfileArn: string
isMachineIdentity?: boolean
maxSessionDurationInSeconds?: number
roleArn: string
tags?: export=.Tag[]

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.SkypieaAccount.html b/docs/interfaces/export_.SkypieaAccount.html index 76272a6c..fa0eb3fd 100644 --- a/docs/interfaces/export_.SkypieaAccount.html +++ b/docs/interfaces/export_.SkypieaAccount.html @@ -3,4 +3,4 @@
property

label - the friendly name of the account

property

accountOwners - the samAccountNames of the account owners

property

cloudsploitTrend - the cloudsploit trends

-

Hierarchy

  • SkypieaAccount

Index

Properties

accountOwners: export=.AccountUserDetails[]
cloudsploitTrend: export=.CloudsploitReport[]
label: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • SkypieaAccount

Index

Properties

accountOwners: export=.AccountUserDetails[]
cloudsploitTrend: export=.CloudsploitReport[]
label: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.Tag.html b/docs/interfaces/export_.Tag.html index 7bb4d272..aba0f78e 100644 --- a/docs/interfaces/export_.Tag.html +++ b/docs/interfaces/export_.Tag.html @@ -2,4 +2,4 @@

Alks role tags

property

key - The AWS role tag key

property

value - The AWS role tag value

-

Hierarchy

  • Tag

Index

Properties

Properties

key: string
value: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • Tag

Index

Properties

Properties

key: string
value: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/export_.User.html b/docs/interfaces/export_.User.html index bc488102..90d9b45b 100644 --- a/docs/interfaces/export_.User.html +++ b/docs/interfaces/export_.User.html @@ -5,4 +5,4 @@
property

email - The user email

property

title - The user title

property

department - The user department

-

Hierarchy

  • User

Index

Properties

department: string
displayName: string
email: string
sAMAccountName: string
title: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Hierarchy

  • User

Index

Properties

department: string
displayName: string
email: string
sAMAccountName: string
title: string

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules.html b/docs/modules.html index ca961036..0f174991 100644 --- a/docs/modules.html +++ b/docs/modules.html @@ -1 +1 @@ -alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

alks.js

Index

Type aliases

AddRoleMachineIdentityProps: Partial<export=.AlksProps> & { roleARN: string }
AlksProps: BaseConfig & Auth
AwsAccountRolesProps: Partial<export=.AlksProps> & { account: string }
CreateAccessKeysProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; role: string; tags?: export=.Tag[] }
CreateNonServiceRoleProps: Partial<export=.AlksProps> & { account: string; enableAlksAccess: boolean; externalId?: string; includeDefaultPolicy: PseudoBoolean; role: string; roleName: string; roleType: TrustType; tags?: export=.Tag[]; trustArn: string }
CreateRoleProps: Partial<export=.AlksProps> & { account: string; enableAlksAccess: boolean; includeDefaultPolicy: PseudoBoolean; role: string; roleName: string; roleType?: string; tags?: export=.Tag[]; templateFields?: Record<string, string>; trustPolicy?: Record<string, unknown> }
DeleteIAMUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; role: string }
DeleteRoleMachineIdentityProps: Partial<export=.AlksProps> & { roleARN: string }
DeleteRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string }
GetAWSRoleTypesProps: Partial<export=.AlksProps> & {}
GetAccessTokenProps: Partial<export=.AlksProps> & { refreshToken: string }
GetAccountOwnersProps: Partial<export=.AlksProps> & { accountId: string }
GetAccountRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string }
GetAccountsProps: Partial<export=.AlksProps> & {}
GetAllAWSRoleTypesProps: Partial<export=.AlksProps> & { getDynamicValues?: boolean }
GetCostTotalsProps: Partial<export=.AlksProps> & { accountId: string }
GetIAMKeysProps: Partial<export=.AlksProps> & { account: string; role: string; sessionTime: number }
GetIamUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string }
GetKeysProps: Partial<export=.AlksProps> & { account: string; role: string; sessionTime: number }
GetLoginRoleProps: Partial<export=.AlksProps> & { accountId: string; role: string }
GetNonServiceAWSRoleTypesProps: Partial<export=.AlksProps> & {}
GetRefreshTokensProps: Partial<export=.AlksProps> & {}
GetUserAccessByRoleProps: Partial<export=.AlksProps> & { accountId: string }
GetUserAccessProps: Partial<export=.AlksProps> & { accountId: string }
GetUserRoleAccessProps: Partial<export=.AlksProps> & { accountId: string; sAMAccountName: string }
ListAWSAccountRolesProps: Partial<export=.AlksProps> & { account: string; role: string }
RevokeByIdProps: Partial<export=.AlksProps> & { tokenId: string }
RevokeByValueProps: Partial<export=.AlksProps> & { token: string }
UpdateIamUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; tags?: export=.Tag[] }
UpdateRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string; tags: export=.Tag[] }
VersionProps: Partial<export=.AlksProps> & {}

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

alks.js

Index

Type aliases

AddRoleMachineIdentityProps: Partial<export=.AlksProps> & { roleARN: string }
AlksProps: BaseConfig & Auth
AwsAccountRolesProps: Partial<export=.AlksProps> & { account: string }
CreateAccessKeysProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; role: string; tags?: export=.Tag[] }
CreateNonServiceRoleProps: Partial<export=.AlksProps> & { account: string; enableAlksAccess: boolean; externalId?: string; includeDefaultPolicy: PseudoBoolean; role: string; roleName: string; roleType: TrustType; tags?: export=.Tag[]; trustArn: string }
CreateRoleProps: Partial<export=.AlksProps> & { account: string; enableAlksAccess: boolean; includeDefaultPolicy: PseudoBoolean; role: string; roleName: string; roleType?: string; tags?: export=.Tag[]; templateFields?: Record<string, string>; trustPolicy?: Record<string, unknown> }
DeleteIAMUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; role: string }
DeleteRoleMachineIdentityProps: Partial<export=.AlksProps> & { roleARN: string }
DeleteRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string }
GetAWSRoleTypesProps: Partial<export=.AlksProps> & {}
GetAccessTokenProps: Partial<export=.AlksProps> & { refreshToken: string }
GetAccountOwnersProps: Partial<export=.AlksProps> & { accountId: string }
GetAccountRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string }
GetAccountsProps: Partial<export=.AlksProps> & {}
GetAllAWSRoleTypesProps: Partial<export=.AlksProps> & { getDynamicValues?: boolean }
GetCostTotalsProps: Partial<export=.AlksProps> & { accountId: string }
GetIAMKeysProps: Partial<export=.AlksProps> & { account: string; role: string; sessionTime: number }
GetIamUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string }
GetKeysProps: Partial<export=.AlksProps> & { account: string; role: string; sessionTime: number }
GetLoginRoleProps: Partial<export=.AlksProps> & { accountId: string; role: string }
GetNonServiceAWSRoleTypesProps: Partial<export=.AlksProps> & {}
GetRefreshTokensProps: Partial<export=.AlksProps> & {}
GetUserAccessByRoleProps: Partial<export=.AlksProps> & { accountId: string }
GetUserAccessProps: Partial<export=.AlksProps> & { accountId: string }
GetUserRoleAccessProps: Partial<export=.AlksProps> & { accountId: string; sAMAccountName: string }
ListAWSAccountRolesProps: Partial<export=.AlksProps> & { account: string; role: string }
RevokeByIdProps: Partial<export=.AlksProps> & { tokenId: string }
RevokeByValueProps: Partial<export=.AlksProps> & { token: string }
UpdateIamUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; tags?: export=.Tag[] }
UpdateRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string; tags: export=.Tag[] }
VersionProps: Partial<export=.AlksProps> & {}

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules/export_.html b/docs/modules/export_.html index 3b381afb..fec9e6b9 100644 --- a/docs/modules/export_.html +++ b/docs/modules/export_.html @@ -1 +1 @@ -export= | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace export=

Index

Type aliases

AddRoleMachineIdentityProps: Partial<export=.AlksProps> & { roleARN: string }
AlksProps: BaseConfig & Auth
AwsAccountRolesProps: Partial<export=.AlksProps> & { account: string }
CreateAccessKeysProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; role: string; tags?: export=.Tag[] }
CreateNonServiceRoleProps: Partial<export=.AlksProps> & { account: string; enableAlksAccess: boolean; externalId?: string; includeDefaultPolicy: PseudoBoolean; role: string; roleName: string; roleType: TrustType; tags?: export=.Tag[]; trustArn: string }
CreateRoleProps: Partial<export=.AlksProps> & { account: string; enableAlksAccess: boolean; includeDefaultPolicy: PseudoBoolean; role: string; roleName: string; roleType?: string; tags?: export=.Tag[]; templateFields?: Record<string, string>; trustPolicy?: Record<string, unknown> }
DeleteIAMUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; role: string }
DeleteRoleMachineIdentityProps: Partial<export=.AlksProps> & { roleARN: string }
DeleteRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string }
GetAWSRoleTypesProps: Partial<export=.AlksProps> & {}
GetAccessTokenProps: Partial<export=.AlksProps> & { refreshToken: string }
GetAccountOwnersProps: Partial<export=.AlksProps> & { accountId: string }
GetAccountRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string }
GetAccountsProps: Partial<export=.AlksProps> & {}
GetAllAWSRoleTypesProps: Partial<export=.AlksProps> & { getDynamicValues?: boolean }
GetCostTotalsProps: Partial<export=.AlksProps> & { accountId: string }
GetIAMKeysProps: Partial<export=.AlksProps> & { account: string; role: string; sessionTime: number }
GetIamUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string }
GetKeysProps: Partial<export=.AlksProps> & { account: string; role: string; sessionTime: number }
GetLoginRoleProps: Partial<export=.AlksProps> & { accountId: string; role: string }
GetNonServiceAWSRoleTypesProps: Partial<export=.AlksProps> & {}
GetRefreshTokensProps: Partial<export=.AlksProps> & {}
GetUserAccessByRoleProps: Partial<export=.AlksProps> & { accountId: string }
GetUserAccessProps: Partial<export=.AlksProps> & { accountId: string }
GetUserRoleAccessProps: Partial<export=.AlksProps> & { accountId: string; sAMAccountName: string }
ListAWSAccountRolesProps: Partial<export=.AlksProps> & { account: string; role: string }
RevokeByIdProps: Partial<export=.AlksProps> & { tokenId: string }
RevokeByValueProps: Partial<export=.AlksProps> & { token: string }
UpdateIamUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; tags?: export=.Tag[] }
UpdateRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string; tags: export=.Tag[] }
VersionProps: Partial<export=.AlksProps> & {}

Functions

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +export= | alks.js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace export=

Index

Type aliases

AddRoleMachineIdentityProps: Partial<export=.AlksProps> & { roleARN: string }
AlksProps: BaseConfig & Auth
AwsAccountRolesProps: Partial<export=.AlksProps> & { account: string }
CreateAccessKeysProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; role: string; tags?: export=.Tag[] }
CreateNonServiceRoleProps: Partial<export=.AlksProps> & { account: string; enableAlksAccess: boolean; externalId?: string; includeDefaultPolicy: PseudoBoolean; role: string; roleName: string; roleType: TrustType; tags?: export=.Tag[]; trustArn: string }
CreateRoleProps: Partial<export=.AlksProps> & { account: string; enableAlksAccess: boolean; includeDefaultPolicy: PseudoBoolean; role: string; roleName: string; roleType?: string; tags?: export=.Tag[]; templateFields?: Record<string, string>; trustPolicy?: Record<string, unknown> }
DeleteIAMUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; role: string }
DeleteRoleMachineIdentityProps: Partial<export=.AlksProps> & { roleARN: string }
DeleteRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string }
GetAWSRoleTypesProps: Partial<export=.AlksProps> & {}
GetAccessTokenProps: Partial<export=.AlksProps> & { refreshToken: string }
GetAccountOwnersProps: Partial<export=.AlksProps> & { accountId: string }
GetAccountRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string }
GetAccountsProps: Partial<export=.AlksProps> & {}
GetAllAWSRoleTypesProps: Partial<export=.AlksProps> & { getDynamicValues?: boolean }
GetCostTotalsProps: Partial<export=.AlksProps> & { accountId: string }
GetIAMKeysProps: Partial<export=.AlksProps> & { account: string; role: string; sessionTime: number }
GetIamUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string }
GetKeysProps: Partial<export=.AlksProps> & { account: string; role: string; sessionTime: number }
GetLoginRoleProps: Partial<export=.AlksProps> & { accountId: string; role: string }
GetNonServiceAWSRoleTypesProps: Partial<export=.AlksProps> & {}
GetRefreshTokensProps: Partial<export=.AlksProps> & {}
GetUserAccessByRoleProps: Partial<export=.AlksProps> & { accountId: string }
GetUserAccessProps: Partial<export=.AlksProps> & { accountId: string }
GetUserRoleAccessProps: Partial<export=.AlksProps> & { accountId: string; sAMAccountName: string }
ListAWSAccountRolesProps: Partial<export=.AlksProps> & { account: string; role: string }
RevokeByIdProps: Partial<export=.AlksProps> & { tokenId: string }
RevokeByValueProps: Partial<export=.AlksProps> & { token: string }
UpdateIamUserProps: Partial<export=.AlksProps> & { account: string; iamUserName: string; tags?: export=.Tag[] }
UpdateRoleProps: Partial<export=.AlksProps> & { account: string; role: string; roleName: string; tags: export=.Tag[] }
VersionProps: Partial<export=.AlksProps> & {}

Functions

Legend

  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file