@socketsecurity/lib 5.1.3 → 5.2.0
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/CHANGELOG.md +24 -0
- package/dist/external/npm-pack.js +9850 -4855
- package/dist/releases/github.d.ts +179 -0
- package/dist/releases/github.js +258 -0
- package/dist/releases/socket-btm.d.ts +221 -0
- package/dist/releases/socket-btm.js +131 -0
- package/package.json +11 -1
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* Socket Lib - Built with esbuild */
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var socket_btm_exports = {};
|
|
31
|
+
__export(socket_btm_exports, {
|
|
32
|
+
downloadSocketBtmRelease: () => downloadSocketBtmRelease
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(socket_btm_exports);
|
|
35
|
+
var import_node_os = __toESM(require("node:os"));
|
|
36
|
+
var import_github = require("./github.js");
|
|
37
|
+
const ARCH_MAP = {
|
|
38
|
+
arm64: "arm64",
|
|
39
|
+
x64: "x64"
|
|
40
|
+
};
|
|
41
|
+
function getBinaryAssetName(binaryBaseName, platform, arch, libc) {
|
|
42
|
+
const mappedArch = ARCH_MAP[arch];
|
|
43
|
+
if (!mappedArch) {
|
|
44
|
+
throw new Error(`Unsupported architecture: ${arch}`);
|
|
45
|
+
}
|
|
46
|
+
const muslSuffix = platform === "linux" && libc === "musl" ? "-musl" : "";
|
|
47
|
+
const ext = platform === "win32" ? ".exe" : "";
|
|
48
|
+
if (platform === "darwin") {
|
|
49
|
+
return `${binaryBaseName}-darwin-${mappedArch}${ext}`;
|
|
50
|
+
}
|
|
51
|
+
if (platform === "linux") {
|
|
52
|
+
return `${binaryBaseName}-linux-${mappedArch}${muslSuffix}${ext}`;
|
|
53
|
+
}
|
|
54
|
+
if (platform === "win32") {
|
|
55
|
+
return `${binaryBaseName}-win-${mappedArch}${ext}`;
|
|
56
|
+
}
|
|
57
|
+
throw new Error(`Unsupported platform: ${platform}`);
|
|
58
|
+
}
|
|
59
|
+
function getPlatformArch(platform, arch, libc) {
|
|
60
|
+
const mappedArch = ARCH_MAP[arch];
|
|
61
|
+
if (!mappedArch) {
|
|
62
|
+
throw new Error(`Unsupported architecture: ${arch}`);
|
|
63
|
+
}
|
|
64
|
+
const muslSuffix = platform === "linux" && libc === "musl" ? "-musl" : "";
|
|
65
|
+
return `${platform}-${mappedArch}${muslSuffix}`;
|
|
66
|
+
}
|
|
67
|
+
function getBinaryName(binaryBaseName, platform) {
|
|
68
|
+
return platform === "win32" ? `${binaryBaseName}.exe` : binaryBaseName;
|
|
69
|
+
}
|
|
70
|
+
async function downloadSocketBtmRelease(config) {
|
|
71
|
+
const { cwd, downloadDir, quiet = false, tag, tool } = config;
|
|
72
|
+
const toolPrefix = `${tool}-`;
|
|
73
|
+
let downloadConfig;
|
|
74
|
+
if ("asset" in config) {
|
|
75
|
+
const {
|
|
76
|
+
asset,
|
|
77
|
+
output,
|
|
78
|
+
removeMacOSQuarantine = false
|
|
79
|
+
} = config;
|
|
80
|
+
const outputName = output || asset;
|
|
81
|
+
const platformArch = "assets";
|
|
82
|
+
downloadConfig = {
|
|
83
|
+
owner: import_github.SOCKET_BTM_REPO.owner,
|
|
84
|
+
repo: import_github.SOCKET_BTM_REPO.repo,
|
|
85
|
+
cwd,
|
|
86
|
+
downloadDir,
|
|
87
|
+
toolName: tool,
|
|
88
|
+
platformArch,
|
|
89
|
+
binaryName: outputName,
|
|
90
|
+
assetName: asset,
|
|
91
|
+
toolPrefix,
|
|
92
|
+
tag,
|
|
93
|
+
quiet,
|
|
94
|
+
removeMacOSQuarantine
|
|
95
|
+
};
|
|
96
|
+
} else {
|
|
97
|
+
const {
|
|
98
|
+
bin,
|
|
99
|
+
libc,
|
|
100
|
+
removeMacOSQuarantine = true,
|
|
101
|
+
targetArch,
|
|
102
|
+
targetPlatform
|
|
103
|
+
} = config;
|
|
104
|
+
const baseName = bin || tool;
|
|
105
|
+
const platform = targetPlatform || import_node_os.default.platform();
|
|
106
|
+
const arch = targetArch || import_node_os.default.arch();
|
|
107
|
+
const libcType = libc || (platform === "linux" ? "musl" : void 0);
|
|
108
|
+
const assetName = getBinaryAssetName(baseName, platform, arch, libcType);
|
|
109
|
+
const platformArch = getPlatformArch(platform, arch, libcType);
|
|
110
|
+
const binaryName = getBinaryName(baseName, platform);
|
|
111
|
+
downloadConfig = {
|
|
112
|
+
owner: import_github.SOCKET_BTM_REPO.owner,
|
|
113
|
+
repo: import_github.SOCKET_BTM_REPO.repo,
|
|
114
|
+
cwd,
|
|
115
|
+
downloadDir,
|
|
116
|
+
toolName: tool,
|
|
117
|
+
platformArch,
|
|
118
|
+
binaryName,
|
|
119
|
+
assetName,
|
|
120
|
+
toolPrefix,
|
|
121
|
+
tag,
|
|
122
|
+
quiet,
|
|
123
|
+
removeMacOSQuarantine
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
return await (0, import_github.downloadGitHubRelease)(downloadConfig);
|
|
127
|
+
}
|
|
128
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
129
|
+
0 && (module.exports = {
|
|
130
|
+
downloadSocketBtmRelease
|
|
131
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@socketsecurity/lib",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"packageManager": "pnpm@10.26.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Core utilities and infrastructure for Socket.dev security tools",
|
|
@@ -523,6 +523,14 @@
|
|
|
523
523
|
"types": "./dist/regexps.d.ts",
|
|
524
524
|
"default": "./dist/regexps.js"
|
|
525
525
|
},
|
|
526
|
+
"./releases/github": {
|
|
527
|
+
"types": "./dist/releases/github.d.ts",
|
|
528
|
+
"default": "./dist/releases/github.js"
|
|
529
|
+
},
|
|
530
|
+
"./releases/socket-btm": {
|
|
531
|
+
"types": "./dist/releases/socket-btm.d.ts",
|
|
532
|
+
"default": "./dist/releases/socket-btm.js"
|
|
533
|
+
},
|
|
526
534
|
"./sea": {
|
|
527
535
|
"types": "./dist/sea.d.ts",
|
|
528
536
|
"default": "./dist/sea.js"
|
|
@@ -776,6 +784,7 @@
|
|
|
776
784
|
"overrides": {
|
|
777
785
|
"@npmcli/arborist": "9.1.6",
|
|
778
786
|
"@npmcli/run-script": "10.0.0",
|
|
787
|
+
"@sigstore/sign": "4.1.0",
|
|
779
788
|
"ansi-regex": "6.2.2",
|
|
780
789
|
"lru-cache": "11.2.2",
|
|
781
790
|
"semver": "7.7.2",
|
|
@@ -785,6 +794,7 @@
|
|
|
785
794
|
},
|
|
786
795
|
"patchedDependencies": {
|
|
787
796
|
"@npmcli/run-script@10.0.0": "patches/@npmcli__run-script@10.0.0.patch",
|
|
797
|
+
"@sigstore/sign@4.1.0": "patches/@sigstore__sign@4.1.0.patch",
|
|
788
798
|
"node-gyp@11.5.0": "patches/node-gyp@11.5.0.patch"
|
|
789
799
|
}
|
|
790
800
|
}
|