@socketsecurity/sdk 1.9.2 → 1.10.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/CHANGELOG.md +29 -0
- package/README.md +26 -1
- package/dist/constants.js +0 -3
- package/dist/file-upload.js +2 -2
- package/dist/http-client.d.ts +36 -1
- package/dist/http-client.js +86 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +13 -13
- package/dist/promise-queue.d.ts +35 -0
- package/dist/promise-queue.js +91 -0
- package/dist/quota-utils.js +5 -2
- package/dist/socket-sdk-class.d.ts +7 -7
- package/dist/socket-sdk-class.js +146 -84
- package/dist/types.d.ts +26 -4
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +2 -2
- package/package.json +2 -2
package/dist/types.d.ts
CHANGED
|
@@ -73,12 +73,14 @@ export type GotOptions = {
|
|
|
73
73
|
http?: HttpAgent | undefined;
|
|
74
74
|
https?: HttpsAgent | undefined;
|
|
75
75
|
};
|
|
76
|
-
export type QueryParams = Record<string,
|
|
76
|
+
export type QueryParams = Record<string, unknown>;
|
|
77
77
|
export type HeadersRecord = Record<string, string | string[]> | undefined;
|
|
78
|
+
export type SocketMetricSchema = components['schemas']['SocketMetricSchema'];
|
|
79
|
+
export type SocketId = components['schemas']['SocketId'];
|
|
78
80
|
export type SocketArtifactWithExtras = SocketArtifact & {
|
|
79
|
-
scorecards?:
|
|
80
|
-
supplyChainRisk?:
|
|
81
|
-
topLevelAncestors?:
|
|
81
|
+
scorecards?: unknown | undefined;
|
|
82
|
+
supplyChainRisk?: SocketMetricSchema | undefined;
|
|
83
|
+
topLevelAncestors?: SocketId[] | undefined;
|
|
82
84
|
};
|
|
83
85
|
export type RequestOptions = ((HttpsRequestOptions & {
|
|
84
86
|
headers?: HeadersRecord | undefined;
|
|
@@ -130,6 +132,8 @@ export type SocketSdkGenericResult<T> = {
|
|
|
130
132
|
export interface SocketSdkOptions {
|
|
131
133
|
agent?: Agent | GotOptions | undefined;
|
|
132
134
|
baseUrl?: string | undefined;
|
|
135
|
+
retries?: number | undefined;
|
|
136
|
+
retryDelay?: number | undefined;
|
|
133
137
|
timeout?: number | undefined;
|
|
134
138
|
userAgent?: string | undefined;
|
|
135
139
|
}
|
|
@@ -157,3 +161,21 @@ export type BatchPackageStreamOptions = {
|
|
|
157
161
|
concurrencyLimit?: number | undefined;
|
|
158
162
|
queryParams?: QueryParams | undefined;
|
|
159
163
|
};
|
|
164
|
+
export type CreateDependenciesSnapshotOptions = {
|
|
165
|
+
pathsRelativeTo?: string | undefined;
|
|
166
|
+
queryParams?: QueryParams | undefined;
|
|
167
|
+
};
|
|
168
|
+
export type CreateOrgFullScanOptions = {
|
|
169
|
+
pathsRelativeTo?: string | undefined;
|
|
170
|
+
queryParams?: QueryParams | undefined;
|
|
171
|
+
};
|
|
172
|
+
export type CreateScanFromFilepathsOptions = {
|
|
173
|
+
issueRules?: Record<string, boolean> | undefined;
|
|
174
|
+
pathsRelativeTo?: string | undefined;
|
|
175
|
+
};
|
|
176
|
+
export type StreamOrgFullScanOptions = {
|
|
177
|
+
output?: boolean | string | undefined;
|
|
178
|
+
};
|
|
179
|
+
export type UploadManifestFilesOptions = {
|
|
180
|
+
pathsRelativeTo?: string | undefined;
|
|
181
|
+
};
|
package/dist/utils.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export declare function promiseWithResolvers<T>(): ReturnType<typeof Promise.wit
|
|
|
14
14
|
* Convert query parameters to URLSearchParams with API-compatible key normalization.
|
|
15
15
|
* Transforms camelCase keys to snake_case and filters out empty values.
|
|
16
16
|
*/
|
|
17
|
-
export declare function queryToSearchParams(init?: URLSearchParams | string | QueryParams | Iterable<[string,
|
|
17
|
+
export declare function queryToSearchParams(init?: URLSearchParams | string | QueryParams | Iterable<[string, unknown]> | ReadonlyArray<[string, unknown]> | null | undefined): URLSearchParams;
|
|
18
18
|
/**
|
|
19
19
|
* Convert relative file paths to absolute paths.
|
|
20
20
|
* Resolves paths relative to specified base directory or current working directory.
|
package/dist/utils.js
CHANGED
|
@@ -47,8 +47,8 @@ function promiseWithResolvers() {
|
|
|
47
47
|
* Transforms camelCase keys to snake_case and filters out empty values.
|
|
48
48
|
*/
|
|
49
49
|
function queryToSearchParams(init) {
|
|
50
|
-
const params = new URLSearchParams(init
|
|
51
|
-
const normalized =
|
|
50
|
+
const params = new URLSearchParams(init);
|
|
51
|
+
const normalized = Object.create(null);
|
|
52
52
|
const entries = params.entries();
|
|
53
53
|
for (const entry of entries) {
|
|
54
54
|
let key = entry[0];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@socketsecurity/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "SDK for the Socket API client",
|
|
6
6
|
"author": {
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"update:socket": "pnpm -r update '@socketsecurity/*' --latest"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@socketsecurity/registry": "1.
|
|
78
|
+
"@socketsecurity/registry": "1.4.1"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@biomejs/biome": "2.2.4",
|