@awsless/cli 0.0.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/README.MD +487 -0
- package/dist/app.json +1 -0
- package/dist/app.stage.json +1 -0
- package/dist/bin.d.ts +1 -0
- package/dist/bin.js +49025 -0
- package/dist/build-json-schema.js +1925 -0
- package/dist/chunk-2TBBLACH.js +37 -0
- package/dist/chunk-3YEPERYO.js +1021 -0
- package/dist/chunk-4JFIJMQ6.js +46 -0
- package/dist/chunk-5TWBDDXS.js +60 -0
- package/dist/chunk-7NRPMOO4.js +876 -0
- package/dist/chunk-7XIGSOF4.js +100 -0
- package/dist/chunk-DSXFE5X2.js +174 -0
- package/dist/chunk-E7FQOYML.js +12 -0
- package/dist/chunk-GH475CSF.js +5005 -0
- package/dist/chunk-JHYKYQ5P.js +163 -0
- package/dist/chunk-LBISIOIM.js +28 -0
- package/dist/chunk-RCNT4C4P.js +50 -0
- package/dist/chunk-SIAA4J6H.js +21 -0
- package/dist/chunk-XNYTWFP6.js +241 -0
- package/dist/chunk-Z37AK4IA.js +546 -0
- package/dist/chunk-ZKH7AMP3.js +42 -0
- package/dist/dist-es-GXHCNXAC.js +489 -0
- package/dist/dist-es-J7SL4PXO.js +88 -0
- package/dist/dist-es-LL3VAI2X.js +70 -0
- package/dist/dist-es-QND3CYLI.js +380 -0
- package/dist/dist-es-STVZUSZG.js +21 -0
- package/dist/dist-es-TCFHB4OF.js +324 -0
- package/dist/dist-es-YFQTZTNE.js +167 -0
- package/dist/event-streams-74K5M656.js +244 -0
- package/dist/layers/sharp-arm.zip +0 -0
- package/dist/loadSso-O7PM54HL.js +592 -0
- package/dist/prebuild/icon/HASH +1 -0
- package/dist/prebuild/icon/bundle.zip +0 -0
- package/dist/prebuild/image/HASH +1 -0
- package/dist/prebuild/image/bundle.zip +0 -0
- package/dist/prebuild/on-error-log/HASH +1 -0
- package/dist/prebuild/on-error-log/bundle.zip +0 -0
- package/dist/prebuild/on-failure/HASH +1 -0
- package/dist/prebuild/on-failure/bundle.zip +0 -0
- package/dist/prebuild/rpc/HASH +1 -0
- package/dist/prebuild/rpc/bundle.zip +0 -0
- package/dist/prebuild.js +159 -0
- package/dist/signin-6SPMGGJN.js +704 -0
- package/dist/sso-oidc-5IIWGKXY.js +829 -0
- package/dist/stack.json +1 -0
- package/dist/stack.stage.json +1 -0
- package/dist/sts-6SQWH4BL.js +3788 -0
- package/dist/test-global-setup.js +22 -0
- package/package.json +120 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import {
|
|
2
|
+
chain
|
|
3
|
+
} from "./chunk-LBISIOIM.js";
|
|
4
|
+
import {
|
|
5
|
+
getProfileName,
|
|
6
|
+
loadSharedConfigFiles
|
|
7
|
+
} from "./chunk-XNYTWFP6.js";
|
|
8
|
+
import {
|
|
9
|
+
CredentialsProviderError
|
|
10
|
+
} from "./chunk-2TBBLACH.js";
|
|
11
|
+
|
|
12
|
+
// ../../node_modules/.pnpm/@smithy+querystring-parser@4.2.12/node_modules/@smithy/querystring-parser/dist-es/index.js
|
|
13
|
+
function parseQueryString(querystring) {
|
|
14
|
+
const query = {};
|
|
15
|
+
querystring = querystring.replace(/^\?/, "");
|
|
16
|
+
if (querystring) {
|
|
17
|
+
for (const pair of querystring.split("&")) {
|
|
18
|
+
let [key, value = null] = pair.split("=");
|
|
19
|
+
key = decodeURIComponent(key);
|
|
20
|
+
if (value) {
|
|
21
|
+
value = decodeURIComponent(value);
|
|
22
|
+
}
|
|
23
|
+
if (!(key in query)) {
|
|
24
|
+
query[key] = value;
|
|
25
|
+
} else if (Array.isArray(query[key])) {
|
|
26
|
+
query[key].push(value);
|
|
27
|
+
} else {
|
|
28
|
+
query[key] = [query[key], value];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return query;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// ../../node_modules/.pnpm/@smithy+url-parser@4.2.12/node_modules/@smithy/url-parser/dist-es/index.js
|
|
36
|
+
var parseUrl = (url) => {
|
|
37
|
+
if (typeof url === "string") {
|
|
38
|
+
return parseUrl(new URL(url));
|
|
39
|
+
}
|
|
40
|
+
const { hostname, pathname, port, protocol, search } = url;
|
|
41
|
+
let query;
|
|
42
|
+
if (search) {
|
|
43
|
+
query = parseQueryString(search);
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
hostname,
|
|
47
|
+
port: port ? parseInt(port) : void 0,
|
|
48
|
+
protocol,
|
|
49
|
+
path: pathname,
|
|
50
|
+
query
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// ../../node_modules/.pnpm/@smithy+property-provider@4.2.12/node_modules/@smithy/property-provider/dist-es/fromStatic.js
|
|
55
|
+
var fromStatic = (staticValue) => () => Promise.resolve(staticValue);
|
|
56
|
+
|
|
57
|
+
// ../../node_modules/.pnpm/@smithy+property-provider@4.2.12/node_modules/@smithy/property-provider/dist-es/memoize.js
|
|
58
|
+
var memoize = (provider, isExpired, requiresRefresh) => {
|
|
59
|
+
let resolved;
|
|
60
|
+
let pending;
|
|
61
|
+
let hasResult;
|
|
62
|
+
let isConstant = false;
|
|
63
|
+
const coalesceProvider = async () => {
|
|
64
|
+
if (!pending) {
|
|
65
|
+
pending = provider();
|
|
66
|
+
}
|
|
67
|
+
try {
|
|
68
|
+
resolved = await pending;
|
|
69
|
+
hasResult = true;
|
|
70
|
+
isConstant = false;
|
|
71
|
+
} finally {
|
|
72
|
+
pending = void 0;
|
|
73
|
+
}
|
|
74
|
+
return resolved;
|
|
75
|
+
};
|
|
76
|
+
if (isExpired === void 0) {
|
|
77
|
+
return async (options) => {
|
|
78
|
+
if (!hasResult || options?.forceRefresh) {
|
|
79
|
+
resolved = await coalesceProvider();
|
|
80
|
+
}
|
|
81
|
+
return resolved;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
return async (options) => {
|
|
85
|
+
if (!hasResult || options?.forceRefresh) {
|
|
86
|
+
resolved = await coalesceProvider();
|
|
87
|
+
}
|
|
88
|
+
if (isConstant) {
|
|
89
|
+
return resolved;
|
|
90
|
+
}
|
|
91
|
+
if (requiresRefresh && !requiresRefresh(resolved)) {
|
|
92
|
+
isConstant = true;
|
|
93
|
+
return resolved;
|
|
94
|
+
}
|
|
95
|
+
if (isExpired(resolved)) {
|
|
96
|
+
await coalesceProvider();
|
|
97
|
+
return resolved;
|
|
98
|
+
}
|
|
99
|
+
return resolved;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
// ../../node_modules/.pnpm/@smithy+node-config-provider@4.3.12/node_modules/@smithy/node-config-provider/dist-es/getSelectorName.js
|
|
104
|
+
function getSelectorName(functionString) {
|
|
105
|
+
try {
|
|
106
|
+
const constants = new Set(Array.from(functionString.match(/([A-Z_]){3,}/g) ?? []));
|
|
107
|
+
constants.delete("CONFIG");
|
|
108
|
+
constants.delete("CONFIG_PREFIX_SEPARATOR");
|
|
109
|
+
constants.delete("ENV");
|
|
110
|
+
return [...constants].join(", ");
|
|
111
|
+
} catch (e) {
|
|
112
|
+
return functionString;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// ../../node_modules/.pnpm/@smithy+node-config-provider@4.3.12/node_modules/@smithy/node-config-provider/dist-es/fromEnv.js
|
|
117
|
+
var fromEnv = (envVarSelector, options) => async () => {
|
|
118
|
+
try {
|
|
119
|
+
const config = envVarSelector(process.env, options);
|
|
120
|
+
if (config === void 0) {
|
|
121
|
+
throw new Error();
|
|
122
|
+
}
|
|
123
|
+
return config;
|
|
124
|
+
} catch (e) {
|
|
125
|
+
throw new CredentialsProviderError(e.message || `Not found in ENV: ${getSelectorName(envVarSelector.toString())}`, { logger: options?.logger });
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
// ../../node_modules/.pnpm/@smithy+node-config-provider@4.3.12/node_modules/@smithy/node-config-provider/dist-es/fromSharedConfigFiles.js
|
|
130
|
+
var fromSharedConfigFiles = (configSelector, { preferredFile = "config", ...init } = {}) => async () => {
|
|
131
|
+
const profile = getProfileName(init);
|
|
132
|
+
const { configFile, credentialsFile } = await loadSharedConfigFiles(init);
|
|
133
|
+
const profileFromCredentials = credentialsFile[profile] || {};
|
|
134
|
+
const profileFromConfig = configFile[profile] || {};
|
|
135
|
+
const mergedProfile = preferredFile === "config" ? { ...profileFromCredentials, ...profileFromConfig } : { ...profileFromConfig, ...profileFromCredentials };
|
|
136
|
+
try {
|
|
137
|
+
const cfgFile = preferredFile === "config" ? configFile : credentialsFile;
|
|
138
|
+
const configValue = configSelector(mergedProfile, cfgFile);
|
|
139
|
+
if (configValue === void 0) {
|
|
140
|
+
throw new Error();
|
|
141
|
+
}
|
|
142
|
+
return configValue;
|
|
143
|
+
} catch (e) {
|
|
144
|
+
throw new CredentialsProviderError(e.message || `Not found in config files w/ profile [${profile}]: ${getSelectorName(configSelector.toString())}`, { logger: init.logger });
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
// ../../node_modules/.pnpm/@smithy+node-config-provider@4.3.12/node_modules/@smithy/node-config-provider/dist-es/fromStatic.js
|
|
149
|
+
var isFunction = (func) => typeof func === "function";
|
|
150
|
+
var fromStatic2 = (defaultValue) => isFunction(defaultValue) ? async () => await defaultValue() : fromStatic(defaultValue);
|
|
151
|
+
|
|
152
|
+
// ../../node_modules/.pnpm/@smithy+node-config-provider@4.3.12/node_modules/@smithy/node-config-provider/dist-es/configLoader.js
|
|
153
|
+
var loadConfig = ({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => {
|
|
154
|
+
const { signingName, logger } = configuration;
|
|
155
|
+
const envOptions = { signingName, logger };
|
|
156
|
+
return memoize(chain(fromEnv(environmentVariableSelector, envOptions), fromSharedConfigFiles(configFileSelector, configuration), fromStatic2(defaultValue)));
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
export {
|
|
160
|
+
parseUrl,
|
|
161
|
+
memoize,
|
|
162
|
+
loadConfig
|
|
163
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ProviderError
|
|
3
|
+
} from "./chunk-2TBBLACH.js";
|
|
4
|
+
|
|
5
|
+
// ../../node_modules/.pnpm/@smithy+property-provider@4.2.12/node_modules/@smithy/property-provider/dist-es/chain.js
|
|
6
|
+
var chain = (...providers) => async () => {
|
|
7
|
+
if (providers.length === 0) {
|
|
8
|
+
throw new ProviderError("No providers in chain");
|
|
9
|
+
}
|
|
10
|
+
let lastProviderError;
|
|
11
|
+
for (const provider of providers) {
|
|
12
|
+
try {
|
|
13
|
+
const credentials = await provider();
|
|
14
|
+
return credentials;
|
|
15
|
+
} catch (err) {
|
|
16
|
+
lastProviderError = err;
|
|
17
|
+
if (err?.tryNextLink) {
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
throw err;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
throw lastProviderError;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
chain
|
|
28
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// ../../node_modules/.pnpm/@smithy+smithy-client@4.12.8/node_modules/@smithy/smithy-client/dist-es/create-aggregated-client.js
|
|
2
|
+
var createAggregatedClient = (commands, Client, options) => {
|
|
3
|
+
for (const [command, CommandCtor] of Object.entries(commands)) {
|
|
4
|
+
const methodImpl = async function(args, optionsOrCb, cb) {
|
|
5
|
+
const command2 = new CommandCtor(args);
|
|
6
|
+
if (typeof optionsOrCb === "function") {
|
|
7
|
+
this.send(command2, optionsOrCb);
|
|
8
|
+
} else if (typeof cb === "function") {
|
|
9
|
+
if (typeof optionsOrCb !== "object")
|
|
10
|
+
throw new Error(`Expected http options but got ${typeof optionsOrCb}`);
|
|
11
|
+
this.send(command2, optionsOrCb || {}, cb);
|
|
12
|
+
} else {
|
|
13
|
+
return this.send(command2, optionsOrCb);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
const methodName = (command[0].toLowerCase() + command.slice(1)).replace(/Command$/, "");
|
|
17
|
+
Client.prototype[methodName] = methodImpl;
|
|
18
|
+
}
|
|
19
|
+
const { paginators = {}, waiters = {} } = options ?? {};
|
|
20
|
+
for (const [paginatorName, paginatorFn] of Object.entries(paginators)) {
|
|
21
|
+
if (Client.prototype[paginatorName] === void 0) {
|
|
22
|
+
Client.prototype[paginatorName] = function(commandInput = {}, paginationConfiguration, ...rest) {
|
|
23
|
+
return paginatorFn({
|
|
24
|
+
...paginationConfiguration,
|
|
25
|
+
client: this
|
|
26
|
+
}, commandInput, ...rest);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
for (const [waiterName, waiterFn] of Object.entries(waiters)) {
|
|
31
|
+
if (Client.prototype[waiterName] === void 0) {
|
|
32
|
+
Client.prototype[waiterName] = async function(commandInput = {}, waiterConfiguration, ...rest) {
|
|
33
|
+
let config = waiterConfiguration;
|
|
34
|
+
if (typeof waiterConfiguration === "number") {
|
|
35
|
+
config = {
|
|
36
|
+
maxWaitTime: waiterConfiguration
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
return waiterFn({
|
|
40
|
+
...config,
|
|
41
|
+
client: this
|
|
42
|
+
}, commandInput, ...rest);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
createAggregatedClient
|
|
50
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
4
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
5
|
+
}) : x)(function(x) {
|
|
6
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
7
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
8
|
+
});
|
|
9
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
10
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
11
|
+
};
|
|
12
|
+
var __export = (target, all) => {
|
|
13
|
+
for (var name in all)
|
|
14
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
__require,
|
|
19
|
+
__commonJS,
|
|
20
|
+
__export
|
|
21
|
+
};
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/getProfileName.js
|
|
2
|
+
var ENV_PROFILE = "AWS_PROFILE";
|
|
3
|
+
var DEFAULT_PROFILE = "default";
|
|
4
|
+
var getProfileName = (init) => init.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE;
|
|
5
|
+
|
|
6
|
+
// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/getConfigFilepath.js
|
|
7
|
+
import { join } from "path";
|
|
8
|
+
|
|
9
|
+
// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/getHomeDir.js
|
|
10
|
+
import { homedir } from "os";
|
|
11
|
+
import { sep } from "path";
|
|
12
|
+
var homeDirCache = {};
|
|
13
|
+
var getHomeDirCacheKey = () => {
|
|
14
|
+
if (process && process.geteuid) {
|
|
15
|
+
return `${process.geteuid()}`;
|
|
16
|
+
}
|
|
17
|
+
return "DEFAULT";
|
|
18
|
+
};
|
|
19
|
+
var getHomeDir = () => {
|
|
20
|
+
const { HOME, USERPROFILE, HOMEPATH, HOMEDRIVE = `C:${sep}` } = process.env;
|
|
21
|
+
if (HOME)
|
|
22
|
+
return HOME;
|
|
23
|
+
if (USERPROFILE)
|
|
24
|
+
return USERPROFILE;
|
|
25
|
+
if (HOMEPATH)
|
|
26
|
+
return `${HOMEDRIVE}${HOMEPATH}`;
|
|
27
|
+
const homeDirCacheKey = getHomeDirCacheKey();
|
|
28
|
+
if (!homeDirCache[homeDirCacheKey])
|
|
29
|
+
homeDirCache[homeDirCacheKey] = homedir();
|
|
30
|
+
return homeDirCache[homeDirCacheKey];
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/getConfigFilepath.js
|
|
34
|
+
var ENV_CONFIG_PATH = "AWS_CONFIG_FILE";
|
|
35
|
+
var getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || join(getHomeDir(), ".aws", "config");
|
|
36
|
+
|
|
37
|
+
// ../../node_modules/.pnpm/@smithy+types@4.13.1/node_modules/@smithy/types/dist-es/profile.js
|
|
38
|
+
var IniSectionType;
|
|
39
|
+
(function(IniSectionType2) {
|
|
40
|
+
IniSectionType2["PROFILE"] = "profile";
|
|
41
|
+
IniSectionType2["SSO_SESSION"] = "sso-session";
|
|
42
|
+
IniSectionType2["SERVICES"] = "services";
|
|
43
|
+
})(IniSectionType || (IniSectionType = {}));
|
|
44
|
+
|
|
45
|
+
// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/loadSharedConfigFiles.js
|
|
46
|
+
import { join as join3 } from "path";
|
|
47
|
+
|
|
48
|
+
// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/constants.js
|
|
49
|
+
var CONFIG_PREFIX_SEPARATOR = ".";
|
|
50
|
+
|
|
51
|
+
// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/getConfigData.js
|
|
52
|
+
var getConfigData = (data) => Object.entries(data).filter(([key]) => {
|
|
53
|
+
const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR);
|
|
54
|
+
if (indexOfSeparator === -1) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
return Object.values(IniSectionType).includes(key.substring(0, indexOfSeparator));
|
|
58
|
+
}).reduce((acc, [key, value]) => {
|
|
59
|
+
const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR);
|
|
60
|
+
const updatedKey = key.substring(0, indexOfSeparator) === IniSectionType.PROFILE ? key.substring(indexOfSeparator + 1) : key;
|
|
61
|
+
acc[updatedKey] = value;
|
|
62
|
+
return acc;
|
|
63
|
+
}, {
|
|
64
|
+
...data.default && { default: data.default }
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/getCredentialsFilepath.js
|
|
68
|
+
import { join as join2 } from "path";
|
|
69
|
+
var ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE";
|
|
70
|
+
var getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || join2(getHomeDir(), ".aws", "credentials");
|
|
71
|
+
|
|
72
|
+
// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/parseIni.js
|
|
73
|
+
var prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/;
|
|
74
|
+
var profileNameBlockList = ["__proto__", "profile __proto__"];
|
|
75
|
+
var parseIni = (iniData) => {
|
|
76
|
+
const map = {};
|
|
77
|
+
let currentSection;
|
|
78
|
+
let currentSubSection;
|
|
79
|
+
for (const iniLine of iniData.split(/\r?\n/)) {
|
|
80
|
+
const trimmedLine = iniLine.split(/(^|\s)[;#]/)[0].trim();
|
|
81
|
+
const isSection = trimmedLine[0] === "[" && trimmedLine[trimmedLine.length - 1] === "]";
|
|
82
|
+
if (isSection) {
|
|
83
|
+
currentSection = void 0;
|
|
84
|
+
currentSubSection = void 0;
|
|
85
|
+
const sectionName = trimmedLine.substring(1, trimmedLine.length - 1);
|
|
86
|
+
const matches = prefixKeyRegex.exec(sectionName);
|
|
87
|
+
if (matches) {
|
|
88
|
+
const [, prefix, , name] = matches;
|
|
89
|
+
if (Object.values(IniSectionType).includes(prefix)) {
|
|
90
|
+
currentSection = [prefix, name].join(CONFIG_PREFIX_SEPARATOR);
|
|
91
|
+
}
|
|
92
|
+
} else {
|
|
93
|
+
currentSection = sectionName;
|
|
94
|
+
}
|
|
95
|
+
if (profileNameBlockList.includes(sectionName)) {
|
|
96
|
+
throw new Error(`Found invalid profile name "${sectionName}"`);
|
|
97
|
+
}
|
|
98
|
+
} else if (currentSection) {
|
|
99
|
+
const indexOfEqualsSign = trimmedLine.indexOf("=");
|
|
100
|
+
if (![0, -1].includes(indexOfEqualsSign)) {
|
|
101
|
+
const [name, value] = [
|
|
102
|
+
trimmedLine.substring(0, indexOfEqualsSign).trim(),
|
|
103
|
+
trimmedLine.substring(indexOfEqualsSign + 1).trim()
|
|
104
|
+
];
|
|
105
|
+
if (value === "") {
|
|
106
|
+
currentSubSection = name;
|
|
107
|
+
} else {
|
|
108
|
+
if (currentSubSection && iniLine.trimStart() === iniLine) {
|
|
109
|
+
currentSubSection = void 0;
|
|
110
|
+
}
|
|
111
|
+
map[currentSection] = map[currentSection] || {};
|
|
112
|
+
const key = currentSubSection ? [currentSubSection, name].join(CONFIG_PREFIX_SEPARATOR) : name;
|
|
113
|
+
map[currentSection][key] = value;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return map;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/readFile.js
|
|
122
|
+
import { readFile as fsReadFile } from "fs/promises";
|
|
123
|
+
var filePromises = {};
|
|
124
|
+
var fileIntercept = {};
|
|
125
|
+
var readFile = (path, options) => {
|
|
126
|
+
if (fileIntercept[path] !== void 0) {
|
|
127
|
+
return fileIntercept[path];
|
|
128
|
+
}
|
|
129
|
+
if (!filePromises[path] || options?.ignoreCache) {
|
|
130
|
+
filePromises[path] = fsReadFile(path, "utf8");
|
|
131
|
+
}
|
|
132
|
+
return filePromises[path];
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/loadSharedConfigFiles.js
|
|
136
|
+
var swallowError = () => ({});
|
|
137
|
+
var loadSharedConfigFiles = async (init = {}) => {
|
|
138
|
+
const { filepath = getCredentialsFilepath(), configFilepath = getConfigFilepath() } = init;
|
|
139
|
+
const homeDir = getHomeDir();
|
|
140
|
+
const relativeHomeDirPrefix = "~/";
|
|
141
|
+
let resolvedFilepath = filepath;
|
|
142
|
+
if (filepath.startsWith(relativeHomeDirPrefix)) {
|
|
143
|
+
resolvedFilepath = join3(homeDir, filepath.slice(2));
|
|
144
|
+
}
|
|
145
|
+
let resolvedConfigFilepath = configFilepath;
|
|
146
|
+
if (configFilepath.startsWith(relativeHomeDirPrefix)) {
|
|
147
|
+
resolvedConfigFilepath = join3(homeDir, configFilepath.slice(2));
|
|
148
|
+
}
|
|
149
|
+
const parsedFiles = await Promise.all([
|
|
150
|
+
readFile(resolvedConfigFilepath, {
|
|
151
|
+
ignoreCache: init.ignoreCache
|
|
152
|
+
}).then(parseIni).then(getConfigData).catch(swallowError),
|
|
153
|
+
readFile(resolvedFilepath, {
|
|
154
|
+
ignoreCache: init.ignoreCache
|
|
155
|
+
}).then(parseIni).catch(swallowError)
|
|
156
|
+
]);
|
|
157
|
+
return {
|
|
158
|
+
configFile: parsedFiles[0],
|
|
159
|
+
credentialsFile: parsedFiles[1]
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/getSsoSessionData.js
|
|
164
|
+
var getSsoSessionData = (data) => Object.entries(data).filter(([key]) => key.startsWith(IniSectionType.SSO_SESSION + CONFIG_PREFIX_SEPARATOR)).reduce((acc, [key, value]) => ({ ...acc, [key.substring(key.indexOf(CONFIG_PREFIX_SEPARATOR) + 1)]: value }), {});
|
|
165
|
+
|
|
166
|
+
// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/loadSsoSessionData.js
|
|
167
|
+
var swallowError2 = () => ({});
|
|
168
|
+
var loadSsoSessionData = async (init = {}) => readFile(init.configFilepath ?? getConfigFilepath()).then(parseIni).then(getSsoSessionData).catch(swallowError2);
|
|
169
|
+
|
|
170
|
+
// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/mergeConfigFiles.js
|
|
171
|
+
var mergeConfigFiles = (...files) => {
|
|
172
|
+
const merged = {};
|
|
173
|
+
for (const file of files) {
|
|
174
|
+
for (const [key, values] of Object.entries(file)) {
|
|
175
|
+
if (merged[key] !== void 0) {
|
|
176
|
+
Object.assign(merged[key], values);
|
|
177
|
+
} else {
|
|
178
|
+
merged[key] = values;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return merged;
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/parseKnownFiles.js
|
|
186
|
+
var parseKnownFiles = async (init) => {
|
|
187
|
+
const parsedFiles = await loadSharedConfigFiles(init);
|
|
188
|
+
return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile);
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/getSSOTokenFromFile.js
|
|
192
|
+
import { readFile as readFile2 } from "fs/promises";
|
|
193
|
+
|
|
194
|
+
// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/getSSOTokenFilepath.js
|
|
195
|
+
import { createHash } from "crypto";
|
|
196
|
+
import { join as join4 } from "path";
|
|
197
|
+
var getSSOTokenFilepath = (id) => {
|
|
198
|
+
const hasher = createHash("sha1");
|
|
199
|
+
const cacheName = hasher.update(id).digest("hex");
|
|
200
|
+
return join4(getHomeDir(), ".aws", "sso", "cache", `${cacheName}.json`);
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/getSSOTokenFromFile.js
|
|
204
|
+
var tokenIntercept = {};
|
|
205
|
+
var getSSOTokenFromFile = async (id) => {
|
|
206
|
+
if (tokenIntercept[id]) {
|
|
207
|
+
return tokenIntercept[id];
|
|
208
|
+
}
|
|
209
|
+
const ssoTokenFilepath = getSSOTokenFilepath(id);
|
|
210
|
+
const ssoTokenText = await readFile2(ssoTokenFilepath, "utf8");
|
|
211
|
+
return JSON.parse(ssoTokenText);
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/externalDataInterceptor.js
|
|
215
|
+
var externalDataInterceptor = {
|
|
216
|
+
getFileRecord() {
|
|
217
|
+
return fileIntercept;
|
|
218
|
+
},
|
|
219
|
+
interceptFile(path, contents) {
|
|
220
|
+
fileIntercept[path] = Promise.resolve(contents);
|
|
221
|
+
},
|
|
222
|
+
getTokenRecord() {
|
|
223
|
+
return tokenIntercept;
|
|
224
|
+
},
|
|
225
|
+
interceptToken(id, contents) {
|
|
226
|
+
tokenIntercept[id] = contents;
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
export {
|
|
231
|
+
ENV_PROFILE,
|
|
232
|
+
getProfileName,
|
|
233
|
+
getSSOTokenFilepath,
|
|
234
|
+
getSSOTokenFromFile,
|
|
235
|
+
CONFIG_PREFIX_SEPARATOR,
|
|
236
|
+
readFile,
|
|
237
|
+
loadSharedConfigFiles,
|
|
238
|
+
loadSsoSessionData,
|
|
239
|
+
parseKnownFiles,
|
|
240
|
+
externalDataInterceptor
|
|
241
|
+
};
|