@cloud-copilot/iam-collect 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +661 -0
- package/README.md +23 -0
- package/dist/cjs/cli.d.ts +3 -0
- package/dist/cjs/cli.d.ts.map +1 -0
- package/dist/cjs/cli.js +23 -0
- package/dist/cjs/cli.js.map +1 -0
- package/dist/cjs/cli2.d.ts +63 -0
- package/dist/cjs/cli2.d.ts.map +1 -0
- package/dist/cjs/cli2.js +41 -0
- package/dist/cjs/cli2.js.map +1 -0
- package/dist/cjs/cli3.d.ts +63 -0
- package/dist/cjs/cli3.d.ts.map +1 -0
- package/dist/cjs/cli3.js +41 -0
- package/dist/cjs/cli3.js.map +1 -0
- package/dist/cjs/cliUtils.d.ts +13 -0
- package/dist/cjs/cliUtils.d.ts.map +1 -0
- package/dist/cjs/cliUtils.js +43 -0
- package/dist/cjs/cliUtils.js.map +1 -0
- package/dist/cjs/config/config.d.ts +74 -0
- package/dist/cjs/config/config.d.ts.map +1 -0
- package/dist/cjs/config/config.js +121 -0
- package/dist/cjs/config/config.js.map +1 -0
- package/dist/cjs/config/createConfigFile.d.ts +5 -0
- package/dist/cjs/config/createConfigFile.d.ts.map +1 -0
- package/dist/cjs/config/createConfigFile.js +17 -0
- package/dist/cjs/config/createConfigFile.js.map +1 -0
- package/dist/cjs/config/defaultConfig.d.ts +14 -0
- package/dist/cjs/config/defaultConfig.d.ts.map +1 -0
- package/dist/cjs/config/defaultConfig.js +83 -0
- package/dist/cjs/config/defaultConfig.js.map +1 -0
- package/dist/cjs/config/packageVersion.d.ts +12 -0
- package/dist/cjs/config/packageVersion.d.ts.map +1 -0
- package/dist/cjs/config/packageVersion.js +41 -0
- package/dist/cjs/config/packageVersion.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/showHelp.d.ts +2 -0
- package/dist/cjs/showHelp.d.ts.map +1 -0
- package/dist/cjs/showHelp.js +33 -0
- package/dist/cjs/showHelp.js.map +1 -0
- package/dist/cjs/utils.d.ts +8 -0
- package/dist/cjs/utils.d.ts.map +1 -0
- package/dist/cjs/utils.js +21 -0
- package/dist/cjs/utils.js.map +1 -0
- package/dist/esm/cli.d.ts +3 -0
- package/dist/esm/cli.d.ts.map +1 -0
- package/dist/esm/cli.js +21 -0
- package/dist/esm/cli.js.map +1 -0
- package/dist/esm/cliUtils.d.ts +13 -0
- package/dist/esm/cliUtils.d.ts.map +1 -0
- package/dist/esm/cliUtils.js +40 -0
- package/dist/esm/cliUtils.js.map +1 -0
- package/dist/esm/config/config.d.ts +74 -0
- package/dist/esm/config/config.d.ts.map +1 -0
- package/dist/esm/config/config.js +116 -0
- package/dist/esm/config/config.js.map +1 -0
- package/dist/esm/config/createConfigFile.d.ts +5 -0
- package/dist/esm/config/createConfigFile.d.ts.map +1 -0
- package/dist/esm/config/createConfigFile.js +14 -0
- package/dist/esm/config/createConfigFile.js.map +1 -0
- package/dist/esm/config/defaultConfig.d.ts +14 -0
- package/dist/esm/config/defaultConfig.d.ts.map +1 -0
- package/dist/esm/config/defaultConfig.js +77 -0
- package/dist/esm/config/defaultConfig.js.map +1 -0
- package/dist/esm/config/packageVersion.d.ts +12 -0
- package/dist/esm/config/packageVersion.d.ts.map +1 -0
- package/dist/esm/config/packageVersion.js +37 -0
- package/dist/esm/config/packageVersion.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/utils.d.ts +8 -0
- package/dist/esm/utils.d.ts.map +1 -0
- package/dist/esm/utils.js +18 -0
- package/dist/esm/utils.js.map +1 -0
- package/package.json +45 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defaultConfigFileName = void 0;
|
|
4
|
+
exports.fullDefaultConfigPath = fullDefaultConfigPath;
|
|
5
|
+
exports.defaultConfigExists = defaultConfigExists;
|
|
6
|
+
exports.getDefaultConfig = getDefaultConfig;
|
|
7
|
+
const fs_1 = require("fs");
|
|
8
|
+
const path_1 = require("path");
|
|
9
|
+
const packageVersion_js_1 = require("./packageVersion.js");
|
|
10
|
+
exports.defaultConfigFileName = 'iam-download.jsonc';
|
|
11
|
+
/**
|
|
12
|
+
* Get the full path to the config file.
|
|
13
|
+
*
|
|
14
|
+
* @returns The full path to the config file.
|
|
15
|
+
*/
|
|
16
|
+
function fullDefaultConfigPath() {
|
|
17
|
+
return (0, path_1.resolve)(process.cwd(), exports.defaultConfigFileName);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @returns Whether the default config file exists
|
|
22
|
+
*/
|
|
23
|
+
function defaultConfigExists() {
|
|
24
|
+
return (0, fs_1.existsSync)(fullDefaultConfigPath());
|
|
25
|
+
}
|
|
26
|
+
const defaultConfig = `
|
|
27
|
+
{
|
|
28
|
+
// The name of the configuration, used if you need to have multiple configurations.
|
|
29
|
+
"name": "default config",
|
|
30
|
+
"iamDownloadVersion": "0.0.0",
|
|
31
|
+
|
|
32
|
+
// Default storage is on the file system.
|
|
33
|
+
"storage": {
|
|
34
|
+
"type": "file",
|
|
35
|
+
//If this starts with a '.', it is relative to the config file, otherwise it is an absolute path.
|
|
36
|
+
"rootPath": "./"
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/*
|
|
40
|
+
You can also use S3 storage instead of the default file storage.
|
|
41
|
+
"storage": {
|
|
42
|
+
"type": "s3",
|
|
43
|
+
"bucket": "my-bucket",
|
|
44
|
+
"prefix": "iam-data/",
|
|
45
|
+
"region": "us-west-2",
|
|
46
|
+
"endpoint": "https://s3.us-west-2.amazonaws.com", // Optional endpoint if using a specific VPC endpoint
|
|
47
|
+
//Optional auth configuration, see https://github.com/cloud-copilot/iam-download/docs/Authentication.md
|
|
48
|
+
"auth": {
|
|
49
|
+
//The type of authentication to use
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
// Optional block, by default all regions returned by ec2:DescribeRegions with 'opt-in-not-required' or 'opted-in' are included
|
|
55
|
+
// If regions are specified in the CLI, this is ignored
|
|
56
|
+
// "regions": {
|
|
57
|
+
//Optional regions to include, if empty all regions are included
|
|
58
|
+
// "included": ["us-east-1", "us-west-1"],
|
|
59
|
+
//Optional regions to exclude, if empty no regions are excluded. You can use it with included, but that wouldn't make much sense.
|
|
60
|
+
// "excluded": ["us-west-2"]
|
|
61
|
+
// },
|
|
62
|
+
|
|
63
|
+
// Optional block, by default all supported services are included
|
|
64
|
+
// If services are specified in the CLI, this is ignored
|
|
65
|
+
// "services": {
|
|
66
|
+
//Optional services to include, if empty all supported services are included
|
|
67
|
+
// "included": ["s3", "ec2"],
|
|
68
|
+
//Optional services to exclude, if empty no services are excluded. You can use it with included, but that wouldn't make much sense.
|
|
69
|
+
// "excluded": ["iam"]
|
|
70
|
+
// },
|
|
71
|
+
|
|
72
|
+
// Optional block for authentication, see , see https://github.com/cloud-copilot/iam-download/docs/Authentication.md
|
|
73
|
+
// "auth": {
|
|
74
|
+
// //The type of authentication to use
|
|
75
|
+
// }
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
}
|
|
79
|
+
`;
|
|
80
|
+
function getDefaultConfig() {
|
|
81
|
+
return defaultConfig.replace('0.0.0', (0, packageVersion_js_1.iamDownloadVersion)());
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=defaultConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultConfig.js","sourceRoot":"","sources":["../../../src/config/defaultConfig.ts"],"names":[],"mappings":";;;AAWA,sDAEC;AAMD,kDAEC;AAyDD,4CAEC;AAhFD,2BAA+B;AAC/B,+BAA8B;AAC9B,2DAAwD;AAE3C,QAAA,qBAAqB,GAAG,oBAAoB,CAAA;AAEzD;;;;GAIG;AACH,SAAgB,qBAAqB;IACnC,OAAO,IAAA,cAAO,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,6BAAqB,CAAC,CAAA;AACtD,CAAC;AAED;;;GAGG;AACH,SAAgB,mBAAmB;IACjC,OAAO,IAAA,eAAU,EAAC,qBAAqB,EAAE,CAAC,CAAA;AAC5C,CAAC;AAED,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDrB,CAAA;AAED,SAAgB,gBAAgB;IAC9B,OAAO,aAAa,CAAC,OAAO,CAAC,OAAO,EAAE,IAAA,sCAAkB,GAAE,CAAC,CAAA;AAC7D,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get a data file from the data directory in CommonJS
|
|
3
|
+
*
|
|
4
|
+
* @param file the path to the file to retrieve data for.
|
|
5
|
+
* @returns the data from the file
|
|
6
|
+
*/
|
|
7
|
+
export declare function readRelativeFile<T>(pathParts: string[]): T;
|
|
8
|
+
/**
|
|
9
|
+
* Get the version of the package
|
|
10
|
+
*/
|
|
11
|
+
export declare function iamDownloadVersion(): string;
|
|
12
|
+
//# sourceMappingURL=packageVersion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../../../src/config/packageVersion.ts"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,CAAC,CAG1D;AAqBD;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAG3C"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readRelativeFile = readRelativeFile;
|
|
4
|
+
exports.iamDownloadVersion = iamDownloadVersion;
|
|
5
|
+
const fs_1 = require("fs");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
let root = (0, path_1.join)(__dirname, '..', '..');
|
|
8
|
+
if (__dirname.endsWith('src')) {
|
|
9
|
+
root = (0, path_1.join)(__dirname, '..');
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Get a data file from the data directory in CommonJS
|
|
13
|
+
*
|
|
14
|
+
* @param file the path to the file to retrieve data for.
|
|
15
|
+
* @returns the data from the file
|
|
16
|
+
*/
|
|
17
|
+
function readRelativeFile(pathParts) {
|
|
18
|
+
const contents = (0, fs_1.readFileSync)((0, path_1.join)(root, ...pathParts), 'utf8');
|
|
19
|
+
return JSON.parse(contents);
|
|
20
|
+
}
|
|
21
|
+
let packageCache = undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Get the package data version
|
|
24
|
+
*
|
|
25
|
+
* @returns the package data version
|
|
26
|
+
*/
|
|
27
|
+
function getPackageData() {
|
|
28
|
+
if (!packageCache) {
|
|
29
|
+
const packageInfo = readRelativeFile(['package.json']);
|
|
30
|
+
packageCache = packageInfo;
|
|
31
|
+
}
|
|
32
|
+
return packageCache;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Get the version of the package
|
|
36
|
+
*/
|
|
37
|
+
function iamDownloadVersion() {
|
|
38
|
+
const data = getPackageData();
|
|
39
|
+
return data.version;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../../../src/config/packageVersion.ts"],"names":[],"mappings":";;AAcA,4CAGC;AAwBD,gDAGC;AA5CD,2BAAiC;AACjC,+BAA2B;AAE3B,IAAI,IAAI,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACtC,IAAI,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;IAC9B,IAAI,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,CAAC,CAAA;AAC9B,CAAC;AAED;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAI,SAAmB;IACrD,MAAM,QAAQ,GAAG,IAAA,iBAAY,EAAC,IAAA,WAAI,EAAC,IAAI,EAAE,GAAG,SAAS,CAAC,EAAE,MAAM,CAAC,CAAA;IAC/D,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;AAC7B,CAAC;AAMD,IAAI,YAAY,GAA4B,SAAS,CAAA;AAErD;;;;GAIG;AACH,SAAS,cAAc;IACrB,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,MAAM,WAAW,GAAG,gBAAgB,CAAsB,CAAC,cAAc,CAAC,CAAC,CAAA;QAC3E,YAAY,GAAG,WAAW,CAAA;IAC5B,CAAC;IACD,OAAO,YAAa,CAAA;AACtB,CAAC;AAED;;GAEG;AACH,SAAgB,kBAAkB;IAChC,MAAM,IAAI,GAAG,cAAc,EAAE,CAAA;IAC7B,OAAO,IAAI,CAAC,OAAO,CAAA;AACrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"showHelp.d.ts","sourceRoot":"","sources":["../../src/showHelp.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const cli4_js_1 = require("./cli4.js");
|
|
4
|
+
// console.log(process.stdout.columns)
|
|
5
|
+
(0, cli4_js_1.printHelpContents)('my-command',
|
|
6
|
+
// optional commands
|
|
7
|
+
[
|
|
8
|
+
{ name: 'init', description: 'Initialize my environment' },
|
|
9
|
+
{
|
|
10
|
+
name: 'execute',
|
|
11
|
+
description: 'Run the download'
|
|
12
|
+
}
|
|
13
|
+
], {
|
|
14
|
+
expandAsterisk: {
|
|
15
|
+
character: 'e',
|
|
16
|
+
description: 'Expand a single wildcard asterisk (*) to all possible values',
|
|
17
|
+
values: 'none'
|
|
18
|
+
},
|
|
19
|
+
invalidActionBehavior: {
|
|
20
|
+
description: 'Behavior when an invalid action is encountered, defaults to remove',
|
|
21
|
+
validValues: ['remove', 'error', 'include'],
|
|
22
|
+
type: 'enum',
|
|
23
|
+
values: 'single'
|
|
24
|
+
},
|
|
25
|
+
readWaitMs: {
|
|
26
|
+
description: 'Milliseconds to wait between read operations',
|
|
27
|
+
type: 'number',
|
|
28
|
+
values: 'single'
|
|
29
|
+
}
|
|
30
|
+
}, {
|
|
31
|
+
operandsName: 'action'
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=showHelp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"showHelp.js","sourceRoot":"","sources":["../../src/showHelp.ts"],"names":[],"mappings":";;AAAA,uCAA6C;AAE7C,sCAAsC;AAEtC,IAAA,2BAAiB,EACf,YAAY;AACZ,oBAAoB;AACpB;IACE,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,2BAA2B,EAAE;IAC1D;QACE,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,kBAAkB;KAChC;CACF,EACD;IACE,cAAc,EAAE;QACd,SAAS,EAAE,GAAG;QACd,WAAW,EAAE,8DAA8D;QAC3E,MAAM,EAAE,MAAM;KACf;IACD,qBAAqB,EAAE;QACrB,WAAW,EAAE,oEAAoE;QACjF,WAAW,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC;QAC3C,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,QAAQ;KACjB;IACD,UAAU,EAAE;QACV,WAAW,EAAE,8CAA8C;QAC3D,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,QAAQ;KACjB;CACF,EACD;IACE,YAAY,EAAE,QAAQ;CACvB,CACF,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Optionally print a message and exit the process with the given exit code.
|
|
3
|
+
*
|
|
4
|
+
* @param exitCode the exit code to use
|
|
5
|
+
* @param message the message to print
|
|
6
|
+
*/
|
|
7
|
+
export declare function exit(exitCode: number, message: string | undefined): void;
|
|
8
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,QASjE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.exit = exit;
|
|
4
|
+
/**
|
|
5
|
+
* Optionally print a message and exit the process with the given exit code.
|
|
6
|
+
*
|
|
7
|
+
* @param exitCode the exit code to use
|
|
8
|
+
* @param message the message to print
|
|
9
|
+
*/
|
|
10
|
+
function exit(exitCode, message) {
|
|
11
|
+
if (message) {
|
|
12
|
+
if (exitCode === 0) {
|
|
13
|
+
console.log(message);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
console.error(message);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
process.exit(exitCode);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;AAMA,oBASC;AAfD;;;;;GAKG;AACH,SAAgB,IAAI,CAAC,QAAgB,EAAE,OAA2B;IAChE,IAAI,OAAO,EAAE,CAAC;QACZ,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;YACnB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QACtB,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QACxB,CAAC;IACH,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;AACxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/esm/cli.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { parseCliArguments } from './cliUtils.js';
|
|
3
|
+
import { createDefaultConfiguration } from './config/createConfigFile.js';
|
|
4
|
+
import { defaultConfigExists } from './config/defaultConfig.js';
|
|
5
|
+
const rawArgs = process.argv.slice(2); // Ignore the first two elements
|
|
6
|
+
const parsedArgs = parseCliArguments(rawArgs);
|
|
7
|
+
if (parsedArgs.unrecognizedParams) {
|
|
8
|
+
console.error(`Unrecognized parameters: ${parsedArgs.unrecognizedParams.join(', ')}`);
|
|
9
|
+
process.exit(1);
|
|
10
|
+
}
|
|
11
|
+
const command = parsedArgs.cliArguments?.command || 'download';
|
|
12
|
+
if (command === 'init') {
|
|
13
|
+
if (defaultConfigExists()) {
|
|
14
|
+
console.error('Configuration file already exists');
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
console.log('Initializing...');
|
|
18
|
+
createDefaultConfiguration();
|
|
19
|
+
process.exit(0);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAA;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAE/D,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA,CAAC,gCAAgC;AACtE,MAAM,UAAU,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAA;AAE7C,IAAI,UAAU,CAAC,kBAAkB,EAAE,CAAC;IAClC,OAAO,CAAC,KAAK,CAAC,4BAA4B,UAAU,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IACrF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC;AAED,MAAM,OAAO,GAAG,UAAU,CAAC,YAAY,EAAE,OAAO,IAAI,UAAU,CAAA;AAE9D,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;IACvB,IAAI,mBAAmB,EAAE,EAAE,CAAC;QAC1B,OAAO,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAA;QAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;IAC9B,0BAA0B,EAAE,CAAA;IAC5B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface CliArguments {
|
|
2
|
+
command: string | undefined;
|
|
3
|
+
regions?: string[];
|
|
4
|
+
services?: string[];
|
|
5
|
+
}
|
|
6
|
+
interface ParsedCliArguments {
|
|
7
|
+
unrecognizedParams?: string[];
|
|
8
|
+
noParams?: boolean;
|
|
9
|
+
cliArguments?: CliArguments;
|
|
10
|
+
}
|
|
11
|
+
export declare function parseCliArguments(args: string[]): ParsedCliArguments;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=cliUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cliUtils.d.ts","sourceRoot":"","sources":["../../src/cliUtils.ts"],"names":[],"mappings":"AAEA,UAAU,YAAY;IACpB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CACpB;AAED,UAAU,kBAAkB;IAC1B,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,YAAY,CAAC,EAAE,YAAY,CAAA;CAC5B;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,kBAAkB,CAyCpE"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const allowedArguments = new Set(['regions', 'services', 'accounts']);
|
|
2
|
+
export function parseCliArguments(args) {
|
|
3
|
+
if (args.length == 0) {
|
|
4
|
+
return {
|
|
5
|
+
noParams: true
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
const firstArg = args[0];
|
|
9
|
+
let command = undefined;
|
|
10
|
+
let unrecognizedParams = [];
|
|
11
|
+
if (!firstArg.startsWith('--')) {
|
|
12
|
+
command = firstArg;
|
|
13
|
+
args = args.slice(1);
|
|
14
|
+
}
|
|
15
|
+
const cliArguments = {
|
|
16
|
+
command: command
|
|
17
|
+
};
|
|
18
|
+
let currentArgType;
|
|
19
|
+
for (let i = 0; i < args.length; i++) {
|
|
20
|
+
const arg = args[i];
|
|
21
|
+
if (arg.startsWith('--')) {
|
|
22
|
+
currentArgType = arg.slice(2);
|
|
23
|
+
if (!allowedArguments.has(currentArgType)) {
|
|
24
|
+
unrecognizedParams.push(arg);
|
|
25
|
+
currentArgType = undefined;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
if (currentArgType) {
|
|
30
|
+
cliArguments[currentArgType] = cliArguments[currentArgType] || [];
|
|
31
|
+
cliArguments[currentArgType].push(arg);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
cliArguments,
|
|
37
|
+
unrecognizedParams: unrecognizedParams.length > 0 ? unrecognizedParams : undefined
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=cliUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cliUtils.js","sourceRoot":"","sources":["../../src/cliUtils.ts"],"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,YAAY,CAAC,cAAc,CAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YACzC,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO;QACL,YAAY;QACZ,kBAAkB,EAAE,kBAAkB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,SAAS;KACnF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
interface AuthConfig {
|
|
2
|
+
/**
|
|
3
|
+
* The profile to use when authenticating with AWS. If not present, the default AWS SDK credential resolution chain will be used.
|
|
4
|
+
*/
|
|
5
|
+
profile?: string;
|
|
6
|
+
role?: {
|
|
7
|
+
/**
|
|
8
|
+
* The path and name of the role to assume. Required if using a role.
|
|
9
|
+
*/
|
|
10
|
+
pathAndName: 'path/role-name';
|
|
11
|
+
/**
|
|
12
|
+
* The account to assume the role in. Optional, if not present the account of the current principal will be used.
|
|
13
|
+
*/
|
|
14
|
+
account?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Optional, the external id to use when assuming the role.
|
|
17
|
+
*/
|
|
18
|
+
externalId?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Optional, the session name to use when assuming the role.
|
|
21
|
+
*/
|
|
22
|
+
sessionName?: string;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export interface FileSystemStorageConfig {
|
|
26
|
+
type: 'file';
|
|
27
|
+
path: string;
|
|
28
|
+
}
|
|
29
|
+
export interface S3StorageConfig {
|
|
30
|
+
type: 's3';
|
|
31
|
+
bucket: string;
|
|
32
|
+
prefix?: string;
|
|
33
|
+
region: string;
|
|
34
|
+
endpoint?: string;
|
|
35
|
+
auth?: AuthConfig;
|
|
36
|
+
}
|
|
37
|
+
export type StorageConfig = FileSystemStorageConfig | S3StorageConfig;
|
|
38
|
+
interface BaseConfig {
|
|
39
|
+
regions?: {
|
|
40
|
+
included?: string[];
|
|
41
|
+
excluded?: string[];
|
|
42
|
+
};
|
|
43
|
+
services?: {
|
|
44
|
+
included?: string[];
|
|
45
|
+
excluded?: string[];
|
|
46
|
+
};
|
|
47
|
+
auth?: AuthConfig;
|
|
48
|
+
}
|
|
49
|
+
interface ServiceConfig extends BaseConfig {
|
|
50
|
+
endpoint?: string;
|
|
51
|
+
regionConfigs?: Record<string, Omit<ServiceConfig, 'regionConfigs'>>;
|
|
52
|
+
}
|
|
53
|
+
interface AccountConfig extends BaseConfig {
|
|
54
|
+
serviceConfigs?: Record<string, ServiceConfig>;
|
|
55
|
+
}
|
|
56
|
+
export interface TopLevelConfig extends BaseConfig {
|
|
57
|
+
name?: string;
|
|
58
|
+
iamDownloadVersion: string;
|
|
59
|
+
storage: StorageConfig;
|
|
60
|
+
auth?: AuthConfig;
|
|
61
|
+
accounts?: Record<string, AccountConfig>;
|
|
62
|
+
serviceConfigs?: Record<string, ServiceConfig>;
|
|
63
|
+
}
|
|
64
|
+
type ServicesForAccount = string[];
|
|
65
|
+
type RegionsForAccountService = string[];
|
|
66
|
+
interface ResolvedAccountServiceRegionConfig {
|
|
67
|
+
auth?: AuthConfig;
|
|
68
|
+
endpoint?: string;
|
|
69
|
+
}
|
|
70
|
+
export declare function servicesForAccount(account: string, configs: TopLevelConfig[], allServices: string[]): ServicesForAccount;
|
|
71
|
+
export declare function regionsForService(service: string, account: string, configs: TopLevelConfig[], allRegions: string[]): RegionsForAccountService;
|
|
72
|
+
export declare function accountServiceRegionConfig(service: string, account: string, region: string, configs: TopLevelConfig[]): ResolvedAccountServiceRegionConfig;
|
|
73
|
+
export {};
|
|
74
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/config/config.ts"],"names":[],"mappings":"AAAA,UAAU,UAAU;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAGhB,IAAI,CAAC,EAAE;QACL;;WAEG;QACH,WAAW,EAAE,gBAAgB,C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EAAE,aAAa,CAAA;IACtB,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;IACxC,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;CAC/C;AAED,KAAK,kBAAkB,GAAG,MAAM,EAAE,CAAA;AAClC,KAAK,wBAAwB,GAAG,MAAM,EAAE,CAAA;AAiBxC,UAAU,kCAAkC;IAC1C,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,cAAc,EAAE,EACzB,WAAW,EAAE,MAAM,EAAE,GACpB,kBAAkB,CA2BpB;AAED,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,cAAc,EAAE,EACzB,UAAU,EAAE,MAAM,EAAE,GACnB,wBAAwB,CA0C1B;AAED,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,cAAc,EAAE,GACxB,kCAAkC,CAwDpC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
export function servicesForAccount(account, configs, allServices) {
|
|
2
|
+
let services = allServices;
|
|
3
|
+
for (const config of configs) {
|
|
4
|
+
if (config.services?.included) {
|
|
5
|
+
services = config.services.included;
|
|
6
|
+
}
|
|
7
|
+
if (config.services?.excluded) {
|
|
8
|
+
services = services.filter((service) => !config.services.excluded?.includes(service));
|
|
9
|
+
}
|
|
10
|
+
const accountServices = config.accounts?.[account]?.services;
|
|
11
|
+
if (accountServices) {
|
|
12
|
+
if (accountServices.included) {
|
|
13
|
+
for (const service of accountServices.included) {
|
|
14
|
+
if (!services.includes(service)) {
|
|
15
|
+
services.push(service);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
if (accountServices.excluded) {
|
|
20
|
+
services = services.filter((service) => !accountServices.excluded?.includes(service));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return services;
|
|
25
|
+
}
|
|
26
|
+
export function regionsForService(service, account, configs, allRegions) {
|
|
27
|
+
let regions = allRegions;
|
|
28
|
+
for (const config of configs) {
|
|
29
|
+
if (config.regions?.included) {
|
|
30
|
+
regions = config.regions.included;
|
|
31
|
+
}
|
|
32
|
+
if (config.regions?.excluded) {
|
|
33
|
+
regions = regions.filter((region) => !config.regions.excluded?.includes(region));
|
|
34
|
+
}
|
|
35
|
+
const serviceConfig = config.serviceConfigs?.[service];
|
|
36
|
+
if (serviceConfig) {
|
|
37
|
+
if (serviceConfig.regions?.included) {
|
|
38
|
+
regions = serviceConfig.regions.included;
|
|
39
|
+
}
|
|
40
|
+
if (serviceConfig.regions?.excluded) {
|
|
41
|
+
regions = regions.filter((region) => !serviceConfig.regions.excluded?.includes(region));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const accountConfig = config.accounts?.[account];
|
|
45
|
+
if (accountConfig) {
|
|
46
|
+
if (accountConfig.regions?.included) {
|
|
47
|
+
regions = accountConfig.regions.included;
|
|
48
|
+
}
|
|
49
|
+
if (accountConfig.regions?.excluded) {
|
|
50
|
+
regions = regions.filter((region) => !accountConfig.regions.excluded?.includes(region));
|
|
51
|
+
}
|
|
52
|
+
const accountServices = accountConfig.serviceConfigs?.[service];
|
|
53
|
+
if (accountServices) {
|
|
54
|
+
if (accountServices.regions?.included) {
|
|
55
|
+
regions = accountServices.regions.included;
|
|
56
|
+
}
|
|
57
|
+
if (accountServices.regions?.excluded) {
|
|
58
|
+
regions = regions.filter((region) => !accountServices.regions.excluded?.includes(region));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return regions;
|
|
64
|
+
}
|
|
65
|
+
export function accountServiceRegionConfig(service, account, region, configs) {
|
|
66
|
+
let result = {};
|
|
67
|
+
for (const config of configs) {
|
|
68
|
+
if (config.auth) {
|
|
69
|
+
result.auth = config.auth;
|
|
70
|
+
}
|
|
71
|
+
const serviceConfig = config.serviceConfigs?.[service];
|
|
72
|
+
if (serviceConfig) {
|
|
73
|
+
if (serviceConfig.auth) {
|
|
74
|
+
result.auth = serviceConfig.auth;
|
|
75
|
+
}
|
|
76
|
+
if (serviceConfig.endpoint) {
|
|
77
|
+
result.endpoint = serviceConfig.endpoint;
|
|
78
|
+
}
|
|
79
|
+
const regionConfig = serviceConfig.regionConfigs?.[region];
|
|
80
|
+
if (regionConfig) {
|
|
81
|
+
if (regionConfig.auth) {
|
|
82
|
+
result.auth = regionConfig.auth;
|
|
83
|
+
}
|
|
84
|
+
if (regionConfig.endpoint) {
|
|
85
|
+
result.endpoint = regionConfig.endpoint;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
const accountConfig = config.accounts?.[account];
|
|
90
|
+
if (accountConfig) {
|
|
91
|
+
if (accountConfig.auth) {
|
|
92
|
+
result.auth = accountConfig.auth;
|
|
93
|
+
}
|
|
94
|
+
const accountServiceConfig = accountConfig.serviceConfigs?.[service];
|
|
95
|
+
if (accountServiceConfig) {
|
|
96
|
+
if (accountServiceConfig.auth) {
|
|
97
|
+
result.auth = accountServiceConfig.auth;
|
|
98
|
+
}
|
|
99
|
+
if (accountServiceConfig.endpoint) {
|
|
100
|
+
result.endpoint = accountServiceConfig.endpoint;
|
|
101
|
+
}
|
|
102
|
+
const accountRegionConfig = accountServiceConfig.regionConfigs?.[region];
|
|
103
|
+
if (accountRegionConfig) {
|
|
104
|
+
if (accountRegionConfig.auth) {
|
|
105
|
+
result.auth = accountRegionConfig.auth;
|
|
106
|
+
}
|
|
107
|
+
if (accountRegionConfig.endpoint) {
|
|
108
|
+
result.endpoint = accountRegionConfig.endpoint;
|
|
109
|
+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BAAmB,CAAC,IAAI,EAAE,CAAC;wBAC7B,MAAM,CAAC,IAAI,GAAG,mBAAmB,CAAC,IAAI,CAAA;oBACxC,CAAC;oBACD,IAAI,mBAAmB,CAAC,QAAQ,EAAE,CAAC;wBACjC,MAAM,CAAC,QAAQ,GAAG,mBAAmB,CAAC,QAAQ,CAAA;oBAChD,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createConfigFile.d.ts","sourceRoot":"","sources":["../../../src/config/createConfigFile.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,0BAA0B,SAQzC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { writeFileSync } from 'fs';
|
|
2
|
+
import { defaultConfigExists, fullDefaultConfigPath, getDefaultConfig } from './defaultConfig.js';
|
|
3
|
+
/**
|
|
4
|
+
* Create a default configuration file.
|
|
5
|
+
*/
|
|
6
|
+
export function createDefaultConfiguration() {
|
|
7
|
+
if (defaultConfigExists()) {
|
|
8
|
+
throw new Error('Configuration file already exists');
|
|
9
|
+
}
|
|
10
|
+
const configContent = getDefaultConfig();
|
|
11
|
+
// Write the default configuration to a file
|
|
12
|
+
writeFileSync(fullDefaultConfigPath(), configContent);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=createConfigFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createConfigFile.js","sourceRoot":"","sources":["../../../src/config/createConfigFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAA;AAClC,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAEjG;;GAEG;AACH,MAAM,UAAU,0BAA0B;IACxC,IAAI,mBAAmB,EAAE,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAA;IACtD,CAAC;IAED,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAA;IACxC,4CAA4C;IAC5C,aAAa,CAAC,qBAAqB,EAAE,EAAE,aAAa,CAAC,CAAA;AACvD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const defaultConfigFileName = "iam-download.jsonc";
|
|
2
|
+
/**
|
|
3
|
+
* Get the full path to the config file.
|
|
4
|
+
*
|
|
5
|
+
* @returns The full path to the config file.
|
|
6
|
+
*/
|
|
7
|
+
export declare function fullDefaultConfigPath(): string;
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @returns Whether the default config file exists
|
|
11
|
+
*/
|
|
12
|
+
export declare function defaultConfigExists(): boolean;
|
|
13
|
+
export declare function getDefaultConfig(): string;
|
|
14
|
+
//# sourceMappingURL=defaultConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultConfig.d.ts","sourceRoot":"","sources":["../../../src/config/defaultConfig.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB,uBAAuB,CAAA;AAEzD;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAE7C;AAyDD,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC"}
|