@socketsecurity/sdk 3.5.0 → 4.0.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 +23 -0
- package/dist/file-upload.d.ts +2 -19
- package/dist/http-client.d.ts +8 -82
- package/dist/index.d.ts +1 -6
- package/dist/index.js +571 -877
- package/dist/socket-sdk-class.d.ts +2 -11
- package/dist/types.d.ts +1 -2
- package/dist/utils.d.ts +0 -1
- package/package.json +6 -7
- package/types/api.d.ts +6 -0
- package/dist/promise-queue.d.ts +0 -35
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ArtifactPatches, BatchPackageFetchResultType, BatchPackageStreamOptions, CreateDependenciesSnapshotOptions, Entitlement, GetOptions, MalwareCheckResult, PatchViewResponse, PostOrgTelemetryPayload, PostOrgTelemetryResponse, QueryParams, SendOptions, SocketSdkGenericResult, SocketSdkOptions, SocketSdkResult, StreamOrgFullScanOptions, UploadManifestFilesError, UploadManifestFilesOptions, UploadManifestFilesReturnType } from './types';
|
|
2
2
|
import type { CreateFullScanOptions, DeleteRepositoryLabelResult, DeleteResult, FullScanListResult, FullScanResult, GetRepositoryOptions, ListFullScansOptions, ListRepositoriesOptions, OrganizationsResult, RepositoriesListResult, RepositoryLabelResult, RepositoryLabelsListResult, RepositoryResult, StrictErrorResult } from './types-strict';
|
|
3
|
-
import type {
|
|
3
|
+
import type { HttpResponse } from '@socketsecurity/lib/http-request';
|
|
4
4
|
/**
|
|
5
5
|
* Socket SDK for programmatic access to Socket.dev security analysis APIs.
|
|
6
6
|
* Provides methods for package scanning, organization management, and security analysis.
|
|
@@ -476,7 +476,7 @@ export declare class SocketSdk {
|
|
|
476
476
|
* @param options - Request options including responseType and throws behavior
|
|
477
477
|
* @returns Raw response, parsed data, or SocketSdkGenericResult based on options
|
|
478
478
|
*/
|
|
479
|
-
getApi<T =
|
|
479
|
+
getApi<T = HttpResponse>(urlPath: string, options?: GetOptions | undefined): Promise<T | SocketSdkGenericResult<T>>;
|
|
480
480
|
/**
|
|
481
481
|
* Get list of API tokens for an organization.
|
|
482
482
|
* Returns organization API tokens with metadata and permissions.
|
|
@@ -877,15 +877,6 @@ export declare class SocketSdk {
|
|
|
877
877
|
* @throws {Error} When server returns 5xx status codes
|
|
878
878
|
*/
|
|
879
879
|
getSupportedFiles(orgSlug: string): Promise<SocketSdkResult<'getSupportedFiles'>>;
|
|
880
|
-
/**
|
|
881
|
-
* Get list of file types and formats supported for scanning.
|
|
882
|
-
* Returns supported manifest files, lockfiles, and configuration formats.
|
|
883
|
-
*
|
|
884
|
-
* @deprecated Use getSupportedFiles() instead. This endpoint has been deprecated
|
|
885
|
-
* since 2023-01-15 and now uses the /report/supported endpoint.
|
|
886
|
-
* @throws {Error} When server returns 5xx status codes
|
|
887
|
-
*/
|
|
888
|
-
getSupportedScanFiles(): Promise<SocketSdkResult<'getReportSupportedFiles'>>;
|
|
889
880
|
/**
|
|
890
881
|
* List all full scans for an organization.
|
|
891
882
|
*
|
package/dist/types.d.ts
CHANGED
|
@@ -5,9 +5,8 @@
|
|
|
5
5
|
import type { components, operations } from '../types/api';
|
|
6
6
|
import type { OpReturnType } from '../types/api-helpers';
|
|
7
7
|
import type { Remap } from '@socketsecurity/lib/objects';
|
|
8
|
-
import type { ClientHttp2Session } from 'http2-wrapper';
|
|
9
8
|
import type { Agent as HttpAgent, RequestOptions as HttpRequestOptions } from 'node:http';
|
|
10
|
-
import type { ClientSessionRequestOptions } from 'node:http2';
|
|
9
|
+
import type { ClientHttp2Session, ClientSessionRequestOptions } from 'node:http2';
|
|
11
10
|
import type { Agent as HttpsAgent, RequestOptions as HttpsRequestOptions } from 'node:https';
|
|
12
11
|
export type ALERT_ACTION = 'error' | 'monitor' | 'warn' | 'ignore';
|
|
13
12
|
export type ALERT_TYPE = keyof NonNullable<operations['getOrgSecurityPolicy']['responses']['200']['content']['application/json']['securityPolicyRules']>;
|
package/dist/utils.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@socketsecurity/sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "SDK for the Socket API client",
|
|
5
5
|
"homepage": "https://github.com/SocketDev/socket-sdk-js",
|
|
6
6
|
"license": "MIT",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"clean": "node scripts/clean.mjs",
|
|
49
49
|
"cover": "node scripts/cover.mjs",
|
|
50
50
|
"fix": "node scripts/lint.mjs --fix",
|
|
51
|
-
"format": "oxfmt .",
|
|
51
|
+
"format": "oxfmt --write .",
|
|
52
52
|
"format:check": "oxfmt --check .",
|
|
53
53
|
"generate-sdk": "node scripts/generate-sdk.mjs",
|
|
54
54
|
"lint": "node scripts/lint.mjs",
|
|
@@ -65,12 +65,11 @@
|
|
|
65
65
|
"update": "node scripts/update.mjs"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@
|
|
69
|
-
"@socketsecurity/lib": "5.11.4",
|
|
68
|
+
"@socketsecurity/lib": "5.15.0",
|
|
70
69
|
"form-data": "4.0.5"
|
|
71
70
|
},
|
|
72
71
|
"devDependencies": {
|
|
73
|
-
"@anthropic-ai/claude-code": "2.1.
|
|
72
|
+
"@anthropic-ai/claude-code": "2.1.92",
|
|
74
73
|
"@babel/generator": "7.28.5",
|
|
75
74
|
"@babel/parser": "7.26.3",
|
|
76
75
|
"@babel/traverse": "7.26.4",
|
|
@@ -88,7 +87,6 @@
|
|
|
88
87
|
"ecc-agentshield": "1.4.0",
|
|
89
88
|
"esbuild": "0.25.11",
|
|
90
89
|
"fast-glob": "3.3.3",
|
|
91
|
-
"http2-wrapper": "2.2.1",
|
|
92
90
|
"husky": "9.1.7",
|
|
93
91
|
"magic-string": "0.30.14",
|
|
94
92
|
"nock": "14.0.10",
|
|
@@ -122,7 +120,8 @@
|
|
|
122
120
|
"unrs-resolver"
|
|
123
121
|
],
|
|
124
122
|
"overrides": {
|
|
125
|
-
"
|
|
123
|
+
"defu": ">=6.1.6",
|
|
124
|
+
"vite": "7.3.2"
|
|
126
125
|
}
|
|
127
126
|
}
|
|
128
127
|
}
|
package/types/api.d.ts
CHANGED
|
@@ -15396,6 +15396,8 @@ export interface operations {
|
|
|
15396
15396
|
| 'ChangePlanSubscriptionSeats'
|
|
15397
15397
|
| 'CreateApiToken'
|
|
15398
15398
|
| 'CreateArtifact'
|
|
15399
|
+
| 'CreateFirewallCustomRegistry'
|
|
15400
|
+
| 'CreateFirewallDeploymentConfig'
|
|
15399
15401
|
| 'CreateLabel'
|
|
15400
15402
|
| 'CreateOauthRefreshToken'
|
|
15401
15403
|
| 'CreateRepoAccessRule'
|
|
@@ -15403,6 +15405,8 @@ export interface operations {
|
|
|
15403
15405
|
| 'CreateTicket'
|
|
15404
15406
|
| 'DeleteAlertTriage'
|
|
15405
15407
|
| 'DeleteApiToken'
|
|
15408
|
+
| 'DeleteFirewallCustomRegistry'
|
|
15409
|
+
| 'DeleteFirewallDeploymentConfig'
|
|
15406
15410
|
| 'DeleteFullScan'
|
|
15407
15411
|
| 'DeleteLabel'
|
|
15408
15412
|
| 'DeleteLabelSetting'
|
|
@@ -15436,6 +15440,8 @@ export interface operations {
|
|
|
15436
15440
|
| 'UpdateApiTokenScopes'
|
|
15437
15441
|
| 'UpdateApiTokenVisibility'
|
|
15438
15442
|
| 'UpdateAutopatchCurated'
|
|
15443
|
+
| 'UpdateFirewallCustomRegistry'
|
|
15444
|
+
| 'UpdateFirewallDeploymentConfig'
|
|
15439
15445
|
| 'UpdateLabel'
|
|
15440
15446
|
| 'UpdateLabelSetting'
|
|
15441
15447
|
| 'UpdateLicenseOverlay'
|
package/dist/promise-queue.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export declare class PromiseQueue {
|
|
2
|
-
private queue;
|
|
3
|
-
private running;
|
|
4
|
-
private readonly maxConcurrency;
|
|
5
|
-
private readonly maxQueueLength;
|
|
6
|
-
/**
|
|
7
|
-
* Creates a new PromiseQueue
|
|
8
|
-
* @param maxConcurrency - Maximum number of promises that can run concurrently
|
|
9
|
-
* @param maxQueueLength - Maximum queue size (older tasks are dropped if exceeded)
|
|
10
|
-
*/
|
|
11
|
-
constructor(maxConcurrency: number, maxQueueLength?: number | undefined);
|
|
12
|
-
private runNext;
|
|
13
|
-
/**
|
|
14
|
-
* Get the number of tasks currently running
|
|
15
|
-
*/
|
|
16
|
-
get activeCount(): number;
|
|
17
|
-
/**
|
|
18
|
-
* Add a task to the queue
|
|
19
|
-
* @param fn - Async function to execute
|
|
20
|
-
* @returns Promise that resolves with the function's result
|
|
21
|
-
*/
|
|
22
|
-
add<T>(fn: () => Promise<T>): Promise<T>;
|
|
23
|
-
/**
|
|
24
|
-
* Clear all pending tasks from the queue (does not affect running tasks)
|
|
25
|
-
*/
|
|
26
|
-
clear(): void;
|
|
27
|
-
/**
|
|
28
|
-
* Wait for all queued and running tasks to complete
|
|
29
|
-
*/
|
|
30
|
-
onIdle(): Promise<void>;
|
|
31
|
-
/**
|
|
32
|
-
* Get the number of tasks waiting in the queue
|
|
33
|
-
*/
|
|
34
|
-
get pendingCount(): number;
|
|
35
|
-
}
|