@socketsecurity/cli 0.14.3 → 0.14.4

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.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ var vendor = require('./vendor.js');
5
+ var require$$0 = require('node:fs');
6
+ var require$$1 = require('node:path');
7
+ var require$$1$1 = require('@npmcli/promise-spawn');
8
+ var link = require('./link.js');
9
+
10
+ var npxCli$1 = {};
11
+
12
+ var npxCli = {};
13
+
14
+ var _nodeFs = require$$0;
15
+ var _nodePath = require$$1;
16
+ var _promiseSpawn = require$$1$1;
17
+ var _link = link.link;
18
+ const realFilename = (0, _nodeFs.realpathSync)(__filename);
19
+ const realDirname = _nodePath.dirname(realFilename);
20
+ const npxPath = (0, _link.installLinks)(_nodePath.join(realDirname, 'bin'), 'npx');
21
+ const injectionPath = _nodePath.join(realDirname, 'npm-injection.js');
22
+ process.exitCode = 1;
23
+ const spawnPromise = _promiseSpawn(process.execPath, ['--require', injectionPath, npxPath, ...process.argv.slice(2)], {
24
+ stdio: 'inherit'
25
+ });
26
+ spawnPromise.process.on('exit', (code, signal) => {
27
+ if (signal) {
28
+ process.kill(process.pid, signal);
29
+ } else if (code !== null) {
30
+ process.exit(code);
31
+ }
32
+ });
33
+
34
+ (function (exports) {
35
+
36
+ var _interopRequireWildcard = vendor.interopRequireWildcard.default;
37
+ Object.defineProperty(exports, "__esModule", {
38
+ value: true
39
+ });
40
+ var _exportNames = {};
41
+ Object.defineProperty(exports, "default", {
42
+ enumerable: true,
43
+ get: function () {
44
+ return _npxCli.default;
45
+ }
46
+ });
47
+ var _npxCli = _interopRequireWildcard(npxCli, true);
48
+ Object.keys(_npxCli).forEach(function (key) {
49
+ if (key === "default" || key === "__esModule") return;
50
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
51
+ if (key in exports && exports[key] === _npxCli[key]) return;
52
+ Object.defineProperty(exports, key, {
53
+ enumerable: true,
54
+ get: function () {
55
+ return _npxCli[key];
56
+ }
57
+ });
58
+ });
59
+ } (npxCli$1));
60
+
61
+ module.exports = npxCli$1;
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=optimize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optimize.d.ts","sourceRoot":"","sources":["../src/optimize.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
@@ -0,0 +1,11 @@
1
+ /// <reference types="node" />
2
+ import { SocketYml } from '@socketsecurity/config';
3
+ import { SocketSdkReturnType } from '@socketsecurity/sdk';
4
+ declare function directoryPatterns(): string[];
5
+ declare function arrayUnique<T>(array: T[]): T[];
6
+ declare function getPackageFiles(cwd: string, inputPaths: string[], config: SocketYml | undefined, supportedFiles: SocketSdkReturnType<'getReportSupportedFiles'>['data'], debugLog: typeof console.error): Promise<string[]>;
7
+ declare function getPackageFilesFullScans(cwd: string, inputPaths: string[], supportedFiles: SocketSdkReturnType<'getReportSupportedFiles'>['data'], debugLog: typeof console.error): Promise<string[]>;
8
+ declare function mapGlobResultToFiles(entries: string[], supportedFiles: SocketSdkReturnType<'getReportSupportedFiles'>['data']): Promise<string[]>;
9
+ declare function mapGlobEntryToFiles(entry: string, supportedFiles: SocketSdkReturnType<'getReportSupportedFiles'>['data']): Promise<string[]>;
10
+ declare function findRoot(filepath: string): string | undefined;
11
+ export { directoryPatterns, arrayUnique, getPackageFiles, getPackageFilesFullScans, mapGlobResultToFiles, mapGlobEntryToFiles, findRoot };
@@ -0,0 +1,136 @@
1
+ 'use strict';
2
+
3
+ var require$$1 = require('node:fs/promises');
4
+ var require$$1$1 = require('node:path');
5
+ var vendor = require('./vendor.js');
6
+ var require$$3 = require('ignore');
7
+
8
+ var pathResolve = {};
9
+
10
+ var arrays = {};
11
+
12
+ Object.defineProperty(arrays, "__esModule", {
13
+ value: true
14
+ });
15
+ arrays.arrayUnique = arrayUnique;
16
+ function arrayUnique(array) {
17
+ return [...new Set(array)];
18
+ }
19
+
20
+ var ignoreByDefault = {};
21
+
22
+ Object.defineProperty(ignoreByDefault, "__esModule", {
23
+ value: true
24
+ });
25
+ ignoreByDefault.directoryPatterns = directoryPatterns;
26
+ const ignoredDirs = [
27
+ // Taken from ignore-by-default:
28
+ // https://github.com/novemberborn/ignore-by-default/blob/v2.1.0/index.js
29
+ '.git',
30
+ // Git repository files, see <https://git-scm.com/>
31
+ '.log',
32
+ // Log files emitted by tools such as `tsserver`, see <https://github.com/Microsoft/TypeScript/wiki/Standalone-Server-%28tsserver%29>
33
+ '.nyc_output',
34
+ // Temporary directory where nyc stores coverage data, see <https://github.com/bcoe/nyc>
35
+ '.sass-cache',
36
+ // Cache folder for node-sass, see <https://github.com/sass/node-sass>
37
+ '.yarn',
38
+ // Where node modules are installed when using Yarn, see <https://yarnpkg.com/>
39
+ 'bower_components',
40
+ // Where Bower packages are installed, see <http://bower.io/>
41
+ 'coverage',
42
+ // Standard output directory for code coverage reports, see <https://github.com/gotwarlost/istanbul>
43
+ 'node_modules',
44
+ // Where Node modules are installed, see <https://nodejs.org/>
45
+ // Taken from globby:
46
+ // https://github.com/sindresorhus/globby/blob/v14.0.2/ignore.js#L11-L16
47
+ 'flow-typed'];
48
+ const ignoredDirPatterns = ignoredDirs.map(i => `**/${i}`);
49
+ function directoryPatterns() {
50
+ return [...ignoredDirPatterns];
51
+ }
52
+
53
+ Object.defineProperty(pathResolve, "__esModule", {
54
+ value: true
55
+ });
56
+ pathResolve.findRoot = findRoot;
57
+ pathResolve.getPackageFiles = getPackageFiles;
58
+ pathResolve.getPackageFilesFullScans = getPackageFilesFullScans;
59
+ pathResolve.mapGlobEntryToFiles = mapGlobEntryToFiles;
60
+ pathResolve.mapGlobResultToFiles = mapGlobResultToFiles;
61
+ var _promises = require$$1;
62
+ var _nodePath = require$$1$1;
63
+ var _globby = vendor.globby;
64
+ var _ignore = require$$3;
65
+ var _arrays = arrays;
66
+ var _ignoreByDefault = ignoreByDefault;
67
+ const BASE_GLOBBY_OPTS = {
68
+ __proto__: null,
69
+ absolute: true,
70
+ expandDirectories: false,
71
+ gitignore: true,
72
+ ignore: (0, _ignoreByDefault.directoryPatterns)(),
73
+ markDirectories: true,
74
+ onlyFiles: true,
75
+ unique: true
76
+ };
77
+ async function getPackageFiles(cwd, inputPaths, config, supportedFiles, debugLog) {
78
+ debugLog(`Globbed resolving ${inputPaths.length} paths:`, inputPaths);
79
+
80
+ // TODO: Does not support `~/` paths
81
+ const entries = await (0, _globby.globby)(inputPaths, {
82
+ ...BASE_GLOBBY_OPTS,
83
+ cwd,
84
+ onlyFiles: false
85
+ });
86
+ debugLog(`Globbed resolved ${inputPaths.length} paths to ${entries.length} paths:`, entries);
87
+ const packageFiles = await mapGlobResultToFiles(entries, supportedFiles);
88
+ debugLog(`Mapped ${entries.length} entries to ${packageFiles.length} files:`, packageFiles);
89
+ const includedPackageFiles = config?.projectIgnorePaths?.length ? _ignore().add(config.projectIgnorePaths).filter(packageFiles.map(item => _nodePath.relative(cwd, item))).map(item => _nodePath.resolve(cwd, item)) : packageFiles;
90
+ return includedPackageFiles;
91
+ }
92
+ async function getPackageFilesFullScans(cwd, inputPaths, supportedFiles, debugLog) {
93
+ debugLog(`Globbed resolving ${inputPaths.length} paths:`, inputPaths);
94
+
95
+ // TODO: Does not support `~/` paths
96
+ const entries = await (0, _globby.globby)(inputPaths, {
97
+ ...BASE_GLOBBY_OPTS,
98
+ cwd,
99
+ onlyFiles: false
100
+ });
101
+ debugLog(`Globbed resolved ${inputPaths.length} paths to ${entries.length} paths:`, entries);
102
+ const packageFiles = await mapGlobResultToFiles(entries, supportedFiles);
103
+ debugLog(`Mapped ${entries.length} entries to ${packageFiles.length} files:`, packageFiles);
104
+ return packageFiles;
105
+ }
106
+ async function mapGlobResultToFiles(entries, supportedFiles) {
107
+ const packageFiles = await Promise.all(entries.map(entry => mapGlobEntryToFiles(entry, supportedFiles)));
108
+ return (0, _arrays.arrayUnique)(packageFiles.flat());
109
+ }
110
+ async function mapGlobEntryToFiles(entry, supportedFiles) {
111
+ const jsSupported = supportedFiles['npm'] ?? {};
112
+ const jsLockFilePatterns = Object.values(jsSupported).map(p => `**/${p.pattern}`);
113
+ const pyFilePatterns = Object.values(supportedFiles['pypi'] ?? {}).map(p => `**/${p.pattern}`);
114
+ const goSupported = supportedFiles['golang'] ?? {};
115
+ const goSupplementalPatterns = Object.values(goSupported).map(p => `**/${p.pattern}`);
116
+ return await (0, _globby.globby)([...jsLockFilePatterns, ...pyFilePatterns, ...goSupplementalPatterns], {
117
+ ...BASE_GLOBBY_OPTS,
118
+ onlyFiles: true,
119
+ cwd: _nodePath.resolve((await (0, _promises.stat)(entry)).isDirectory() ? entry : _nodePath.dirname(entry))
120
+ });
121
+ }
122
+ function findRoot(filepath) {
123
+ let curPath = filepath;
124
+ while (true) {
125
+ if (_nodePath.basename(curPath) === 'npm') {
126
+ return curPath;
127
+ }
128
+ const parent = _nodePath.dirname(curPath);
129
+ if (parent === curPath) {
130
+ return undefined;
131
+ }
132
+ curPath = parent;
133
+ }
134
+ }
135
+
136
+ exports.pathResolve = pathResolve;
package/dist/sdk.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ /// <reference types="node" />
2
+ import { SocketSdk } from '@socketsecurity/sdk';
3
+ declare function createDebugLogger(printDebugLogs?: boolean): typeof console.error;
4
+ declare function isErrnoException(value: unknown): value is NodeJS.ErrnoException;
5
+ declare function stringJoinWithSeparateFinalSeparator(list: (string | undefined)[], separator?: string): string;
6
+ declare const API_V0_URL = "https://api.socket.dev/v0";
7
+ declare const ENV: Readonly<{
8
+ UPDATE_SOCKET_OVERRIDES_IN_PACKAGE_LOCK_FILE: boolean;
9
+ }>;
10
+ declare const FREE_API_KEY = "sktsec_t_--RAN5U4ivauy4w37-6aoKyYPDt5ZbaT5JBVMqiwKo_api";
11
+ declare function getDefaultKey(): string | undefined;
12
+ declare function setupSdk(apiKey?: string | undefined, apiBaseUrl?: string | undefined, proxy?: string | undefined): Promise<SocketSdk>;
13
+ export { createDebugLogger, isErrnoException, stringJoinWithSeparateFinalSeparator, API_V0_URL, ENV, FREE_API_KEY, getDefaultKey, setupSdk };
package/dist/sdk.js ADDED
@@ -0,0 +1,270 @@
1
+ 'use strict';
2
+
3
+ var vendor = require('./vendor.js');
4
+ var require$$1$1 = require('node:fs/promises');
5
+ var require$$1 = require('node:path');
6
+ var require$$1$2 = require('@inquirer/prompts');
7
+ var require$$4 = require('@socketsecurity/sdk');
8
+ var require$$5 = require('hpagent');
9
+ var require$$0 = require('node:fs');
10
+ var require$$2 = require('node:os');
11
+
12
+ var errors = {};
13
+
14
+ Object.defineProperty(errors, "__esModule", {
15
+ value: true
16
+ });
17
+ errors.InputError = errors.AuthError = void 0;
18
+ class AuthError extends Error {}
19
+ errors.AuthError = AuthError;
20
+ class InputError extends Error {
21
+ constructor(message, body) {
22
+ super(message);
23
+ this.body = body;
24
+ }
25
+ }
26
+ errors.InputError = InputError;
27
+
28
+ var constants = {};
29
+
30
+ Object.defineProperty(constants, "__esModule", {
31
+ value: true
32
+ });
33
+ constants.ENV = constants.API_V0_URL = void 0;
34
+ function envAsBoolean(value) {
35
+ return typeof value === 'string' && (value === '1' || value.toLowerCase() === 'true');
36
+ }
37
+ constants.API_V0_URL = 'https://api.socket.dev/v0';
38
+ constants.ENV = Object.freeze({
39
+ // Flag set by the optimize command to bypass the packagesHaveRiskyIssues check.
40
+ UPDATE_SOCKET_OVERRIDES_IN_PACKAGE_LOCK_FILE: envAsBoolean(process.env['UPDATE_SOCKET_OVERRIDES_IN_PACKAGE_LOCK_FILE'])
41
+ });
42
+
43
+ var chalkMarkdown = {};
44
+
45
+ var _interopRequireDefault$2 = vendor.interopRequireDefault.default;
46
+ Object.defineProperty(chalkMarkdown, "__esModule", {
47
+ value: true
48
+ });
49
+ chalkMarkdown.logSymbols = chalkMarkdown.ChalkOrMarkdown = void 0;
50
+ var _chalk = _interopRequireDefault$2(vendor.source);
51
+ var _isUnicodeSupported = _interopRequireDefault$2(vendor.isUnicodeSupported);
52
+ var _terminalLink = _interopRequireDefault$2(vendor.terminalLink);
53
+ // From the 'log-symbols' module
54
+ const unicodeLogSymbols = {
55
+ __proto__: null,
56
+ info: _chalk.default.blue('ℹ'),
57
+ success: _chalk.default.green('✔'),
58
+ warning: _chalk.default.yellow('⚠'),
59
+ error: _chalk.default.red('✖')
60
+ };
61
+
62
+ // From the 'log-symbols' module
63
+ const fallbackLogSymbols = {
64
+ __proto__: null,
65
+ info: _chalk.default.blue('i'),
66
+ success: _chalk.default.green('√'),
67
+ warning: _chalk.default.yellow('‼'),
68
+ error: _chalk.default.red('×')
69
+ };
70
+
71
+ // From the 'log-symbols' module
72
+ const logSymbols = chalkMarkdown.logSymbols = (0, _isUnicodeSupported.default)() ? unicodeLogSymbols : fallbackLogSymbols;
73
+ const markdownLogSymbols = {
74
+ __proto__: null,
75
+ info: ':information_source:',
76
+ error: ':stop_sign:',
77
+ success: ':white_check_mark:',
78
+ warning: ':warning:'
79
+ };
80
+ class ChalkOrMarkdown {
81
+ constructor(useMarkdown) {
82
+ this.useMarkdown = !!useMarkdown;
83
+ }
84
+ header(text, level = 1) {
85
+ return this.useMarkdown ? `\n${''.padStart(level, '#')} ${text}\n` : _chalk.default.underline(`\n${level === 1 ? _chalk.default.bold(text) : text}\n`);
86
+ }
87
+ bold(text) {
88
+ return this.useMarkdown ? `**${text}**` : _chalk.default.bold(`${text}`);
89
+ }
90
+ italic(text) {
91
+ return this.useMarkdown ? `_${text}_` : _chalk.default.italic(`${text}`);
92
+ }
93
+ hyperlink(text, url, {
94
+ fallback = true,
95
+ fallbackToUrl
96
+ } = {}) {
97
+ if (!url) return text;
98
+ return this.useMarkdown ? `[${text}](${url})` : (0, _terminalLink.default)(text, url, {
99
+ fallback: fallbackToUrl ? (_text, url) => url : fallback
100
+ });
101
+ }
102
+ list(items) {
103
+ const indentedContent = items.map(item => this.indent(item).trimStart());
104
+ return this.useMarkdown ? `* ${indentedContent.join('\n* ')}\n` : `${indentedContent.join('\n')}\n`;
105
+ }
106
+ get logSymbols() {
107
+ return this.useMarkdown ? markdownLogSymbols : logSymbols;
108
+ }
109
+ indent(text, level = 1) {
110
+ const indent = ''.padStart(level * 2, ' ');
111
+ return indent + text.split('\n').join('\n' + indent);
112
+ }
113
+ json(value) {
114
+ return this.useMarkdown ? '```json\n' + JSON.stringify(value) + '\n```' : JSON.stringify(value);
115
+ }
116
+ }
117
+ chalkMarkdown.ChalkOrMarkdown = ChalkOrMarkdown;
118
+
119
+ var misc = {};
120
+
121
+ Object.defineProperty(misc, "__esModule", {
122
+ value: true
123
+ });
124
+ misc.createDebugLogger = createDebugLogger;
125
+ misc.isErrnoException = isErrnoException;
126
+ misc.stringJoinWithSeparateFinalSeparator = stringJoinWithSeparateFinalSeparator;
127
+ var _chalkMarkdown = chalkMarkdown;
128
+ function createDebugLogger(printDebugLogs) {
129
+ return printDebugLogs ? (...params) => console.error(_chalkMarkdown.logSymbols.info, ...params) : () => {};
130
+ }
131
+ function isErrnoException(value) {
132
+ if (!(value instanceof Error)) {
133
+ return false;
134
+ }
135
+ return value.code !== undefined;
136
+ }
137
+ function stringJoinWithSeparateFinalSeparator(list, separator = ' and ') {
138
+ const values = list.filter(value => !!value);
139
+ if (values.length < 2) {
140
+ return values[0] || '';
141
+ }
142
+ const finalValue = values.pop();
143
+ return values.join(', ') + separator + finalValue;
144
+ }
145
+
146
+ var sdk = {};
147
+
148
+ var settings$1 = {};
149
+
150
+ var _interopRequireDefault$1 = vendor.interopRequireDefault.default;
151
+ Object.defineProperty(settings$1, "__esModule", {
152
+ value: true
153
+ });
154
+ settings$1.getSetting = getSetting;
155
+ settings$1.updateSetting = updateSetting;
156
+ var _nodeFs = require$$0;
157
+ var _nodeOs = require$$2;
158
+ var _nodePath$1 = require$$1;
159
+ var _ora = _interopRequireDefault$1(vendor.ora);
160
+ let dataHome = process.platform === 'win32' ? process.env['LOCALAPPDATA'] : process.env['XDG_DATA_HOME'];
161
+ if (!dataHome) {
162
+ if (process.platform === 'win32') throw new Error('missing %LOCALAPPDATA%');
163
+ const home = _nodeOs.homedir();
164
+ dataHome = _nodePath$1.join(home, ...(process.platform === 'darwin' ? ['Library', 'Application Support'] : ['.local', 'share']));
165
+ }
166
+ const settingsPath = _nodePath$1.join(dataHome, 'socket', 'settings');
167
+ let settings = {};
168
+ if ((0, _nodeFs.existsSync)(settingsPath)) {
169
+ const raw = (0, _nodeFs.readFileSync)(settingsPath, 'utf-8');
170
+ try {
171
+ settings = JSON.parse(Buffer.from(raw, 'base64').toString());
172
+ } catch {
173
+ (0, _ora.default)(`Failed to parse settings at ${settingsPath}`).warn();
174
+ }
175
+ } else {
176
+ (0, _nodeFs.mkdirSync)(_nodePath$1.dirname(settingsPath), {
177
+ recursive: true
178
+ });
179
+ }
180
+ function getSetting(key) {
181
+ return settings[key];
182
+ }
183
+ let pendingSave = false;
184
+ function updateSetting(key, value) {
185
+ settings[key] = value;
186
+ if (!pendingSave) {
187
+ pendingSave = true;
188
+ process.nextTick(() => {
189
+ pendingSave = false;
190
+ (0, _nodeFs.writeFileSync)(settingsPath, Buffer.from(JSON.stringify(settings)).toString('base64'));
191
+ });
192
+ }
193
+ }
194
+
195
+ var _interopRequireDefault = vendor.interopRequireDefault.default;
196
+ Object.defineProperty(sdk, "__esModule", {
197
+ value: true
198
+ });
199
+ sdk.FREE_API_KEY = void 0;
200
+ sdk.getDefaultKey = getDefaultKey;
201
+ sdk.setupSdk = setupSdk;
202
+ var _promises = require$$1$1;
203
+ var _nodePath = require$$1;
204
+ var _prompts = require$$1$2;
205
+ var _sdk = require$$4;
206
+ var _hpagent = require$$5;
207
+ var _isInteractive = _interopRequireDefault(vendor.isInteractive);
208
+ var _errors = errors;
209
+ var _settings = settings$1;
210
+ const distPath = __dirname;
211
+ const rootPath = _nodePath.resolve(distPath, '..');
212
+ sdk.FREE_API_KEY = 'sktsec_t_--RAN5U4ivauy4w37-6aoKyYPDt5ZbaT5JBVMqiwKo_api';
213
+
214
+ // This API key should be stored globally for the duration of the CLI execution
215
+ let defaultKey;
216
+ function getDefaultKey() {
217
+ defaultKey = process.env['SOCKET_SECURITY_API_KEY'] || (0, _settings.getSetting)('apiKey') || defaultKey;
218
+ return defaultKey;
219
+ }
220
+
221
+ // The API server that should be used for operations
222
+ let defaultAPIBaseUrl;
223
+ function getDefaultAPIBaseUrl() {
224
+ defaultAPIBaseUrl = process.env['SOCKET_SECURITY_API_BASE_URL'] || (0, _settings.getSetting)('apiBaseUrl') || undefined;
225
+ return defaultAPIBaseUrl;
226
+ }
227
+
228
+ // The API server that should be used for operations
229
+ let defaultApiProxy;
230
+ function getDefaultHTTPProxy() {
231
+ defaultApiProxy = process.env['SOCKET_SECURITY_API_PROXY'] || (0, _settings.getSetting)('apiProxy') || undefined;
232
+ return defaultApiProxy;
233
+ }
234
+ async function setupSdk(apiKey = getDefaultKey(), apiBaseUrl = getDefaultAPIBaseUrl(), proxy = getDefaultHTTPProxy()) {
235
+ if (typeof apiKey !== 'string' && (0, _isInteractive.default)()) {
236
+ apiKey = await (0, _prompts.password)({
237
+ message: 'Enter your Socket.dev API key (not saved, use socket login to persist)'
238
+ });
239
+ defaultKey = apiKey;
240
+ }
241
+ if (!apiKey) {
242
+ throw new _errors.AuthError('You need to provide an API key');
243
+ }
244
+ let agent;
245
+ if (proxy) {
246
+ agent = {
247
+ http: new _hpagent.HttpProxyAgent({
248
+ proxy
249
+ }),
250
+ https: new _hpagent.HttpsProxyAgent({
251
+ proxy
252
+ })
253
+ };
254
+ }
255
+ const packageJsonPath = _nodePath.join(rootPath, 'package.json');
256
+ const packageJson = await _promises.readFile(packageJsonPath, 'utf8');
257
+ const sdkOptions = {
258
+ agent,
259
+ baseUrl: apiBaseUrl,
260
+ userAgent: (0, _sdk.createUserAgentFromPkgJson)(JSON.parse(packageJson))
261
+ };
262
+ return new _sdk.SocketSdk(apiKey || '', sdkOptions);
263
+ }
264
+
265
+ exports.chalkMarkdown = chalkMarkdown;
266
+ exports.constants = constants;
267
+ exports.errors = errors;
268
+ exports.misc = misc;
269
+ exports.sdk = sdk;
270
+ exports.settings = settings$1;
@@ -0,0 +1,9 @@
1
+ interface Settings {
2
+ apiKey?: string | null;
3
+ enforcedOrgs?: string[] | null;
4
+ apiBaseUrl?: string | null;
5
+ apiProxy?: string | null;
6
+ }
7
+ declare function getSetting<Key extends keyof Settings>(key: Key): Settings[Key];
8
+ declare function updateSetting<Key extends keyof Settings>(key: Key, value: Settings[Key]): void;
9
+ export { getSetting, updateSetting };
File without changes