@sisense/mcp-server 0.2.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.md +35 -0
- package/README.md +121 -0
- package/dist/ai-hspmgr2c.js +3148 -0
- package/dist/fileFromPath-s6ap5vrh.js +128 -0
- package/dist/index-29n08mw7.js +95 -0
- package/dist/index-atgbxy7h.js +98603 -0
- package/dist/index-d6843g0v.js +372 -0
- package/dist/index-dcrjg3fk.js +207 -0
- package/dist/index-dxfb3krz.js +1489 -0
- package/dist/index-er0yspcy.js +918 -0
- package/dist/index-g8bgq79c.js +53 -0
- package/dist/index-p1pxtmwn.js +162 -0
- package/dist/index-qdth51hx.js +250 -0
- package/dist/index-tqba2rwh.js +603 -0
- package/dist/index-vrapm0b4.js +765 -0
- package/dist/index-vx54d05h.js +475 -0
- package/dist/sse-server-3343e7xh.js +117 -0
- package/dist/sse-server-36t17nga.js +12127 -0
- package/dist/sse-server-3e0efmg2.js +6276 -0
- package/dist/sse-server-4b60tg0c.js +136 -0
- package/dist/sse-server-4g9za0qq.js +89 -0
- package/dist/sse-server-4jjec4fz.js +9753 -0
- package/dist/sse-server-5tmgacdx.js +62 -0
- package/dist/sse-server-7wcvyxyj.js +31 -0
- package/dist/sse-server-brx9qtyd.js +2131 -0
- package/dist/sse-server-epd916s3.js +167 -0
- package/dist/sse-server-gt7tx6n2.js +2240 -0
- package/dist/sse-server-mkesh468.js +53 -0
- package/dist/sse-server-nwjjjz6x.js +113 -0
- package/dist/sse-server-qj4zxq0f.js +267 -0
- package/dist/sse-server-rr3dp62e.js +116721 -0
- package/dist/sse-server-ss0mydv4.js +3980 -0
- package/dist/sse-server-txz5g5t0.js +5328 -0
- package/dist/sse-server.js +30432 -0
- package/dist/view.html +3016 -0
- package/dist/widget-renderer-66ws3xtk.js +312 -0
- package/package.json +82 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__commonJS
|
|
3
|
+
} from "./sse-server-7wcvyxyj.js";
|
|
4
|
+
|
|
5
|
+
// node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js
|
|
6
|
+
var require_client = __commonJS((exports) => {
|
|
7
|
+
var state = {
|
|
8
|
+
warningEmitted: false
|
|
9
|
+
};
|
|
10
|
+
var emitWarningIfUnsupportedVersion = (version) => {
|
|
11
|
+
if (version && !state.warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 20) {
|
|
12
|
+
state.warningEmitted = true;
|
|
13
|
+
process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will
|
|
14
|
+
no longer support Node.js ${version} in January 2026.
|
|
15
|
+
|
|
16
|
+
To continue receiving updates to AWS services, bug fixes, and security
|
|
17
|
+
updates please upgrade to a supported Node.js LTS version.
|
|
18
|
+
|
|
19
|
+
More information can be found at: https://a.co/c895JFp`);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
function setCredentialFeature(credentials, feature, value) {
|
|
23
|
+
if (!credentials.$source) {
|
|
24
|
+
credentials.$source = {};
|
|
25
|
+
}
|
|
26
|
+
credentials.$source[feature] = value;
|
|
27
|
+
return credentials;
|
|
28
|
+
}
|
|
29
|
+
function setFeature(context, feature, value) {
|
|
30
|
+
if (!context.__aws_sdk_context) {
|
|
31
|
+
context.__aws_sdk_context = {
|
|
32
|
+
features: {}
|
|
33
|
+
};
|
|
34
|
+
} else if (!context.__aws_sdk_context.features) {
|
|
35
|
+
context.__aws_sdk_context.features = {};
|
|
36
|
+
}
|
|
37
|
+
context.__aws_sdk_context.features[feature] = value;
|
|
38
|
+
}
|
|
39
|
+
function setTokenFeature(token, feature, value) {
|
|
40
|
+
if (!token.$source) {
|
|
41
|
+
token.$source = {};
|
|
42
|
+
}
|
|
43
|
+
token.$source[feature] = value;
|
|
44
|
+
return token;
|
|
45
|
+
}
|
|
46
|
+
exports.emitWarningIfUnsupportedVersion = emitWarningIfUnsupportedVersion;
|
|
47
|
+
exports.setCredentialFeature = setCredentialFeature;
|
|
48
|
+
exports.setFeature = setFeature;
|
|
49
|
+
exports.setTokenFeature = setTokenFeature;
|
|
50
|
+
exports.state = state;
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export { require_client };
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import {
|
|
2
|
+
require_dist_cjs as require_dist_cjs2
|
|
3
|
+
} from "./sse-server-qj4zxq0f.js";
|
|
4
|
+
import {
|
|
5
|
+
require_dist_cjs
|
|
6
|
+
} from "./sse-server-3343e7xh.js";
|
|
7
|
+
import {
|
|
8
|
+
__commonJS
|
|
9
|
+
} from "./sse-server-7wcvyxyj.js";
|
|
10
|
+
|
|
11
|
+
// node_modules/@smithy/querystring-parser/dist-cjs/index.js
|
|
12
|
+
var require_dist_cjs3 = __commonJS((exports) => {
|
|
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
|
+
exports.parseQueryString = parseQueryString;
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// node_modules/@smithy/url-parser/dist-cjs/index.js
|
|
38
|
+
var require_dist_cjs4 = __commonJS((exports) => {
|
|
39
|
+
var querystringParser = require_dist_cjs3();
|
|
40
|
+
var parseUrl = (url) => {
|
|
41
|
+
if (typeof url === "string") {
|
|
42
|
+
return parseUrl(new URL(url));
|
|
43
|
+
}
|
|
44
|
+
const { hostname, pathname, port, protocol, search } = url;
|
|
45
|
+
let query;
|
|
46
|
+
if (search) {
|
|
47
|
+
query = querystringParser.parseQueryString(search);
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
hostname,
|
|
51
|
+
port: port ? parseInt(port) : undefined,
|
|
52
|
+
protocol,
|
|
53
|
+
path: pathname,
|
|
54
|
+
query
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
exports.parseUrl = parseUrl;
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// node_modules/@smithy/node-config-provider/dist-cjs/index.js
|
|
61
|
+
var require_dist_cjs5 = __commonJS((exports) => {
|
|
62
|
+
var propertyProvider = require_dist_cjs();
|
|
63
|
+
var sharedIniFileLoader = require_dist_cjs2();
|
|
64
|
+
function getSelectorName(functionString) {
|
|
65
|
+
try {
|
|
66
|
+
const constants = new Set(Array.from(functionString.match(/([A-Z_]){3,}/g) ?? []));
|
|
67
|
+
constants.delete("CONFIG");
|
|
68
|
+
constants.delete("CONFIG_PREFIX_SEPARATOR");
|
|
69
|
+
constants.delete("ENV");
|
|
70
|
+
return [...constants].join(", ");
|
|
71
|
+
} catch (e) {
|
|
72
|
+
return functionString;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
var fromEnv = (envVarSelector, options) => async () => {
|
|
76
|
+
try {
|
|
77
|
+
const config = envVarSelector(process.env, options);
|
|
78
|
+
if (config === undefined) {
|
|
79
|
+
throw new Error;
|
|
80
|
+
}
|
|
81
|
+
return config;
|
|
82
|
+
} catch (e) {
|
|
83
|
+
throw new propertyProvider.CredentialsProviderError(e.message || `Not found in ENV: ${getSelectorName(envVarSelector.toString())}`, { logger: options?.logger });
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
var fromSharedConfigFiles = (configSelector, { preferredFile = "config", ...init } = {}) => async () => {
|
|
87
|
+
const profile = sharedIniFileLoader.getProfileName(init);
|
|
88
|
+
const { configFile, credentialsFile } = await sharedIniFileLoader.loadSharedConfigFiles(init);
|
|
89
|
+
const profileFromCredentials = credentialsFile[profile] || {};
|
|
90
|
+
const profileFromConfig = configFile[profile] || {};
|
|
91
|
+
const mergedProfile = preferredFile === "config" ? { ...profileFromCredentials, ...profileFromConfig } : { ...profileFromConfig, ...profileFromCredentials };
|
|
92
|
+
try {
|
|
93
|
+
const cfgFile = preferredFile === "config" ? configFile : credentialsFile;
|
|
94
|
+
const configValue = configSelector(mergedProfile, cfgFile);
|
|
95
|
+
if (configValue === undefined) {
|
|
96
|
+
throw new Error;
|
|
97
|
+
}
|
|
98
|
+
return configValue;
|
|
99
|
+
} catch (e) {
|
|
100
|
+
throw new propertyProvider.CredentialsProviderError(e.message || `Not found in config files w/ profile [${profile}]: ${getSelectorName(configSelector.toString())}`, { logger: init.logger });
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
var isFunction = (func) => typeof func === "function";
|
|
104
|
+
var fromStatic = (defaultValue) => isFunction(defaultValue) ? async () => await defaultValue() : propertyProvider.fromStatic(defaultValue);
|
|
105
|
+
var loadConfig = ({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => {
|
|
106
|
+
const { signingName, logger } = configuration;
|
|
107
|
+
const envOptions = { signingName, logger };
|
|
108
|
+
return propertyProvider.memoize(propertyProvider.chain(fromEnv(environmentVariableSelector, envOptions), fromSharedConfigFiles(configFileSelector, configuration), fromStatic(defaultValue)));
|
|
109
|
+
};
|
|
110
|
+
exports.loadConfig = loadConfig;
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
export { require_dist_cjs4 as require_dist_cjs, require_dist_cjs5 as require_dist_cjs1 };
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import {
|
|
2
|
+
require_dist_cjs
|
|
3
|
+
} from "./sse-server-4g9za0qq.js";
|
|
4
|
+
import {
|
|
5
|
+
__commonJS,
|
|
6
|
+
__require
|
|
7
|
+
} from "./sse-server-7wcvyxyj.js";
|
|
8
|
+
|
|
9
|
+
// node_modules/@smithy/shared-ini-file-loader/dist-cjs/getHomeDir.js
|
|
10
|
+
var require_getHomeDir = __commonJS((exports) => {
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getHomeDir = undefined;
|
|
13
|
+
var os_1 = __require("os");
|
|
14
|
+
var path_1 = __require("path");
|
|
15
|
+
var homeDirCache = {};
|
|
16
|
+
var getHomeDirCacheKey = () => {
|
|
17
|
+
if (process && process.geteuid) {
|
|
18
|
+
return `${process.geteuid()}`;
|
|
19
|
+
}
|
|
20
|
+
return "DEFAULT";
|
|
21
|
+
};
|
|
22
|
+
var getHomeDir = () => {
|
|
23
|
+
const { HOME, USERPROFILE, HOMEPATH, HOMEDRIVE = `C:${path_1.sep}` } = process.env;
|
|
24
|
+
if (HOME)
|
|
25
|
+
return HOME;
|
|
26
|
+
if (USERPROFILE)
|
|
27
|
+
return USERPROFILE;
|
|
28
|
+
if (HOMEPATH)
|
|
29
|
+
return `${HOMEDRIVE}${HOMEPATH}`;
|
|
30
|
+
const homeDirCacheKey = getHomeDirCacheKey();
|
|
31
|
+
if (!homeDirCache[homeDirCacheKey])
|
|
32
|
+
homeDirCache[homeDirCacheKey] = (0, os_1.homedir)();
|
|
33
|
+
return homeDirCache[homeDirCacheKey];
|
|
34
|
+
};
|
|
35
|
+
exports.getHomeDir = getHomeDir;
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFilepath.js
|
|
39
|
+
var require_getSSOTokenFilepath = __commonJS((exports) => {
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.getSSOTokenFilepath = undefined;
|
|
42
|
+
var crypto_1 = __require("crypto");
|
|
43
|
+
var path_1 = __require("path");
|
|
44
|
+
var getHomeDir_1 = require_getHomeDir();
|
|
45
|
+
var getSSOTokenFilepath = (id) => {
|
|
46
|
+
const hasher = (0, crypto_1.createHash)("sha1");
|
|
47
|
+
const cacheName = hasher.update(id).digest("hex");
|
|
48
|
+
return (0, path_1.join)((0, getHomeDir_1.getHomeDir)(), ".aws", "sso", "cache", `${cacheName}.json`);
|
|
49
|
+
};
|
|
50
|
+
exports.getSSOTokenFilepath = getSSOTokenFilepath;
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFromFile.js
|
|
54
|
+
var require_getSSOTokenFromFile = __commonJS((exports) => {
|
|
55
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
56
|
+
exports.getSSOTokenFromFile = exports.tokenIntercept = undefined;
|
|
57
|
+
var promises_1 = __require("fs/promises");
|
|
58
|
+
var getSSOTokenFilepath_1 = require_getSSOTokenFilepath();
|
|
59
|
+
exports.tokenIntercept = {};
|
|
60
|
+
var getSSOTokenFromFile = async (id) => {
|
|
61
|
+
if (exports.tokenIntercept[id]) {
|
|
62
|
+
return exports.tokenIntercept[id];
|
|
63
|
+
}
|
|
64
|
+
const ssoTokenFilepath = (0, getSSOTokenFilepath_1.getSSOTokenFilepath)(id);
|
|
65
|
+
const ssoTokenText = await (0, promises_1.readFile)(ssoTokenFilepath, "utf8");
|
|
66
|
+
return JSON.parse(ssoTokenText);
|
|
67
|
+
};
|
|
68
|
+
exports.getSSOTokenFromFile = getSSOTokenFromFile;
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
// node_modules/@smithy/shared-ini-file-loader/dist-cjs/readFile.js
|
|
72
|
+
var require_readFile = __commonJS((exports) => {
|
|
73
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
74
|
+
exports.readFile = exports.fileIntercept = exports.filePromises = undefined;
|
|
75
|
+
var promises_1 = __require("node:fs/promises");
|
|
76
|
+
exports.filePromises = {};
|
|
77
|
+
exports.fileIntercept = {};
|
|
78
|
+
var readFile = (path, options) => {
|
|
79
|
+
if (exports.fileIntercept[path] !== undefined) {
|
|
80
|
+
return exports.fileIntercept[path];
|
|
81
|
+
}
|
|
82
|
+
if (!exports.filePromises[path] || options?.ignoreCache) {
|
|
83
|
+
exports.filePromises[path] = (0, promises_1.readFile)(path, "utf8");
|
|
84
|
+
}
|
|
85
|
+
return exports.filePromises[path];
|
|
86
|
+
};
|
|
87
|
+
exports.readFile = readFile;
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js
|
|
91
|
+
var require_dist_cjs2 = __commonJS((exports) => {
|
|
92
|
+
var getHomeDir = require_getHomeDir();
|
|
93
|
+
var getSSOTokenFilepath = require_getSSOTokenFilepath();
|
|
94
|
+
var getSSOTokenFromFile = require_getSSOTokenFromFile();
|
|
95
|
+
var path = __require("path");
|
|
96
|
+
var types = require_dist_cjs();
|
|
97
|
+
var readFile = require_readFile();
|
|
98
|
+
var ENV_PROFILE = "AWS_PROFILE";
|
|
99
|
+
var DEFAULT_PROFILE = "default";
|
|
100
|
+
var getProfileName = (init) => init.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE;
|
|
101
|
+
var CONFIG_PREFIX_SEPARATOR = ".";
|
|
102
|
+
var getConfigData = (data) => Object.entries(data).filter(([key]) => {
|
|
103
|
+
const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR);
|
|
104
|
+
if (indexOfSeparator === -1) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
return Object.values(types.IniSectionType).includes(key.substring(0, indexOfSeparator));
|
|
108
|
+
}).reduce((acc, [key, value]) => {
|
|
109
|
+
const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR);
|
|
110
|
+
const updatedKey = key.substring(0, indexOfSeparator) === types.IniSectionType.PROFILE ? key.substring(indexOfSeparator + 1) : key;
|
|
111
|
+
acc[updatedKey] = value;
|
|
112
|
+
return acc;
|
|
113
|
+
}, {
|
|
114
|
+
...data.default && { default: data.default }
|
|
115
|
+
});
|
|
116
|
+
var ENV_CONFIG_PATH = "AWS_CONFIG_FILE";
|
|
117
|
+
var getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || path.join(getHomeDir.getHomeDir(), ".aws", "config");
|
|
118
|
+
var ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE";
|
|
119
|
+
var getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || path.join(getHomeDir.getHomeDir(), ".aws", "credentials");
|
|
120
|
+
var prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/;
|
|
121
|
+
var profileNameBlockList = ["__proto__", "profile __proto__"];
|
|
122
|
+
var parseIni = (iniData) => {
|
|
123
|
+
const map = {};
|
|
124
|
+
let currentSection;
|
|
125
|
+
let currentSubSection;
|
|
126
|
+
for (const iniLine of iniData.split(/\r?\n/)) {
|
|
127
|
+
const trimmedLine = iniLine.split(/(^|\s)[;#]/)[0].trim();
|
|
128
|
+
const isSection = trimmedLine[0] === "[" && trimmedLine[trimmedLine.length - 1] === "]";
|
|
129
|
+
if (isSection) {
|
|
130
|
+
currentSection = undefined;
|
|
131
|
+
currentSubSection = undefined;
|
|
132
|
+
const sectionName = trimmedLine.substring(1, trimmedLine.length - 1);
|
|
133
|
+
const matches = prefixKeyRegex.exec(sectionName);
|
|
134
|
+
if (matches) {
|
|
135
|
+
const [, prefix, , name] = matches;
|
|
136
|
+
if (Object.values(types.IniSectionType).includes(prefix)) {
|
|
137
|
+
currentSection = [prefix, name].join(CONFIG_PREFIX_SEPARATOR);
|
|
138
|
+
}
|
|
139
|
+
} else {
|
|
140
|
+
currentSection = sectionName;
|
|
141
|
+
}
|
|
142
|
+
if (profileNameBlockList.includes(sectionName)) {
|
|
143
|
+
throw new Error(`Found invalid profile name "${sectionName}"`);
|
|
144
|
+
}
|
|
145
|
+
} else if (currentSection) {
|
|
146
|
+
const indexOfEqualsSign = trimmedLine.indexOf("=");
|
|
147
|
+
if (![0, -1].includes(indexOfEqualsSign)) {
|
|
148
|
+
const [name, value] = [
|
|
149
|
+
trimmedLine.substring(0, indexOfEqualsSign).trim(),
|
|
150
|
+
trimmedLine.substring(indexOfEqualsSign + 1).trim()
|
|
151
|
+
];
|
|
152
|
+
if (value === "") {
|
|
153
|
+
currentSubSection = name;
|
|
154
|
+
} else {
|
|
155
|
+
if (currentSubSection && iniLine.trimStart() === iniLine) {
|
|
156
|
+
currentSubSection = undefined;
|
|
157
|
+
}
|
|
158
|
+
map[currentSection] = map[currentSection] || {};
|
|
159
|
+
const key = currentSubSection ? [currentSubSection, name].join(CONFIG_PREFIX_SEPARATOR) : name;
|
|
160
|
+
map[currentSection][key] = value;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return map;
|
|
166
|
+
};
|
|
167
|
+
var swallowError$1 = () => ({});
|
|
168
|
+
var loadSharedConfigFiles = async (init = {}) => {
|
|
169
|
+
const { filepath = getCredentialsFilepath(), configFilepath = getConfigFilepath() } = init;
|
|
170
|
+
const homeDir = getHomeDir.getHomeDir();
|
|
171
|
+
const relativeHomeDirPrefix = "~/";
|
|
172
|
+
let resolvedFilepath = filepath;
|
|
173
|
+
if (filepath.startsWith(relativeHomeDirPrefix)) {
|
|
174
|
+
resolvedFilepath = path.join(homeDir, filepath.slice(2));
|
|
175
|
+
}
|
|
176
|
+
let resolvedConfigFilepath = configFilepath;
|
|
177
|
+
if (configFilepath.startsWith(relativeHomeDirPrefix)) {
|
|
178
|
+
resolvedConfigFilepath = path.join(homeDir, configFilepath.slice(2));
|
|
179
|
+
}
|
|
180
|
+
const parsedFiles = await Promise.all([
|
|
181
|
+
readFile.readFile(resolvedConfigFilepath, {
|
|
182
|
+
ignoreCache: init.ignoreCache
|
|
183
|
+
}).then(parseIni).then(getConfigData).catch(swallowError$1),
|
|
184
|
+
readFile.readFile(resolvedFilepath, {
|
|
185
|
+
ignoreCache: init.ignoreCache
|
|
186
|
+
}).then(parseIni).catch(swallowError$1)
|
|
187
|
+
]);
|
|
188
|
+
return {
|
|
189
|
+
configFile: parsedFiles[0],
|
|
190
|
+
credentialsFile: parsedFiles[1]
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
var getSsoSessionData = (data) => Object.entries(data).filter(([key]) => key.startsWith(types.IniSectionType.SSO_SESSION + CONFIG_PREFIX_SEPARATOR)).reduce((acc, [key, value]) => ({ ...acc, [key.substring(key.indexOf(CONFIG_PREFIX_SEPARATOR) + 1)]: value }), {});
|
|
194
|
+
var swallowError = () => ({});
|
|
195
|
+
var loadSsoSessionData = async (init = {}) => readFile.readFile(init.configFilepath ?? getConfigFilepath()).then(parseIni).then(getSsoSessionData).catch(swallowError);
|
|
196
|
+
var mergeConfigFiles = (...files) => {
|
|
197
|
+
const merged = {};
|
|
198
|
+
for (const file of files) {
|
|
199
|
+
for (const [key, values] of Object.entries(file)) {
|
|
200
|
+
if (merged[key] !== undefined) {
|
|
201
|
+
Object.assign(merged[key], values);
|
|
202
|
+
} else {
|
|
203
|
+
merged[key] = values;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
return merged;
|
|
208
|
+
};
|
|
209
|
+
var parseKnownFiles = async (init) => {
|
|
210
|
+
const parsedFiles = await loadSharedConfigFiles(init);
|
|
211
|
+
return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile);
|
|
212
|
+
};
|
|
213
|
+
var externalDataInterceptor = {
|
|
214
|
+
getFileRecord() {
|
|
215
|
+
return readFile.fileIntercept;
|
|
216
|
+
},
|
|
217
|
+
interceptFile(path2, contents) {
|
|
218
|
+
readFile.fileIntercept[path2] = Promise.resolve(contents);
|
|
219
|
+
},
|
|
220
|
+
getTokenRecord() {
|
|
221
|
+
return getSSOTokenFromFile.tokenIntercept;
|
|
222
|
+
},
|
|
223
|
+
interceptToken(id, contents) {
|
|
224
|
+
getSSOTokenFromFile.tokenIntercept[id] = contents;
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
Object.defineProperty(exports, "getSSOTokenFromFile", {
|
|
228
|
+
enumerable: true,
|
|
229
|
+
get: function() {
|
|
230
|
+
return getSSOTokenFromFile.getSSOTokenFromFile;
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
Object.defineProperty(exports, "readFile", {
|
|
234
|
+
enumerable: true,
|
|
235
|
+
get: function() {
|
|
236
|
+
return readFile.readFile;
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
exports.CONFIG_PREFIX_SEPARATOR = CONFIG_PREFIX_SEPARATOR;
|
|
240
|
+
exports.DEFAULT_PROFILE = DEFAULT_PROFILE;
|
|
241
|
+
exports.ENV_PROFILE = ENV_PROFILE;
|
|
242
|
+
exports.externalDataInterceptor = externalDataInterceptor;
|
|
243
|
+
exports.getProfileName = getProfileName;
|
|
244
|
+
exports.loadSharedConfigFiles = loadSharedConfigFiles;
|
|
245
|
+
exports.loadSsoSessionData = loadSsoSessionData;
|
|
246
|
+
exports.parseKnownFiles = parseKnownFiles;
|
|
247
|
+
Object.keys(getHomeDir).forEach(function(k) {
|
|
248
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
|
|
249
|
+
Object.defineProperty(exports, k, {
|
|
250
|
+
enumerable: true,
|
|
251
|
+
get: function() {
|
|
252
|
+
return getHomeDir[k];
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
});
|
|
256
|
+
Object.keys(getSSOTokenFilepath).forEach(function(k) {
|
|
257
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
|
|
258
|
+
Object.defineProperty(exports, k, {
|
|
259
|
+
enumerable: true,
|
|
260
|
+
get: function() {
|
|
261
|
+
return getSSOTokenFilepath[k];
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
export { require_dist_cjs2 as require_dist_cjs };
|