@socketsecurity/sdk 3.4.1 → 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 +40 -0
- package/README.md +1 -1
- package/dist/constants.d.ts +3 -1
- package/dist/file-upload.d.ts +2 -19
- package/dist/http-client.d.ts +9 -118
- package/dist/index.d.ts +2 -7
- package/dist/index.js +810 -1006
- package/dist/socket-sdk-class.d.ts +37 -42
- package/dist/types.d.ts +29 -10
- package/dist/utils.d.ts +0 -1
- package/package.json +11 -9
- package/types/api.d.ts +118 -5
- package/dist/promise-queue.d.ts +0 -35
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ArtifactPatches, BatchPackageFetchResultType, BatchPackageStreamOptions, CreateDependenciesSnapshotOptions, Entitlement, GetOptions, PatchViewResponse, PostOrgTelemetryPayload, PostOrgTelemetryResponse, QueryParams, SendOptions, SocketSdkGenericResult, SocketSdkOptions, SocketSdkResult, StreamOrgFullScanOptions, UploadManifestFilesError, UploadManifestFilesOptions, UploadManifestFilesReturnType } from './types';
|
|
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.
|
|
@@ -73,6 +73,23 @@ export declare class SocketSdk {
|
|
|
73
73
|
purl: string;
|
|
74
74
|
}>;
|
|
75
75
|
}, options?: BatchPackageStreamOptions | undefined): AsyncGenerator<BatchPackageFetchResultType>;
|
|
76
|
+
/**
|
|
77
|
+
* Check packages for malware and security alerts.
|
|
78
|
+
*
|
|
79
|
+
* For small sets (≤ MAX_FIREWALL_COMPONENTS), uses parallel firewall API
|
|
80
|
+
* requests which return full artifact data including score and alert details.
|
|
81
|
+
*
|
|
82
|
+
* For larger sets, uses the batch PURL API for efficiency.
|
|
83
|
+
*
|
|
84
|
+
* Both paths normalize alerts through publicPolicy and only return
|
|
85
|
+
* malware-relevant results.
|
|
86
|
+
*
|
|
87
|
+
* @param components - Array of package URLs to check
|
|
88
|
+
* @returns Normalized results with policy-filtered alerts per package
|
|
89
|
+
*/
|
|
90
|
+
checkMalware(components: Array<{
|
|
91
|
+
purl: string;
|
|
92
|
+
}>): Promise<SocketSdkGenericResult<MalwareCheckResult>>;
|
|
76
93
|
/**
|
|
77
94
|
* Create a snapshot of project dependencies by uploading manifest files.
|
|
78
95
|
* Analyzes dependency files to generate a comprehensive security report.
|
|
@@ -368,29 +385,16 @@ export declare class SocketSdk {
|
|
|
368
385
|
*/
|
|
369
386
|
deleteRepositoryLabel(orgSlug: string, labelId: string): Promise<DeleteRepositoryLabelResult | StrictErrorResult>;
|
|
370
387
|
/**
|
|
371
|
-
*
|
|
372
|
-
|
|
373
|
-
/**
|
|
374
|
-
* Download patch file content by hash.
|
|
388
|
+
* Download full scan files as a tar archive.
|
|
375
389
|
*
|
|
376
|
-
*
|
|
377
|
-
*
|
|
378
|
-
* No authentication is required as patch blobs are publicly accessible.
|
|
390
|
+
* Streams the full scan file contents to the specified output path as a tar file.
|
|
391
|
+
* Includes size limit enforcement to prevent excessive disk usage.
|
|
379
392
|
*
|
|
380
|
-
* @param
|
|
381
|
-
* @param
|
|
382
|
-
* @param
|
|
383
|
-
* @returns
|
|
384
|
-
* @throws Error
|
|
385
|
-
*
|
|
386
|
-
* @example
|
|
387
|
-
* ```typescript
|
|
388
|
-
* const sdk = new SocketSdk('your-api-token')
|
|
389
|
-
* // First get patch metadata
|
|
390
|
-
* const patch = await sdk.viewPatch('my-org', 'patch-uuid')
|
|
391
|
-
* // Then download the actual patched file
|
|
392
|
-
* const fileContent = await sdk.downloadPatch(patch.files['index.js'].socketBlob)
|
|
393
|
-
* ```
|
|
393
|
+
* @param orgSlug - Organization identifier
|
|
394
|
+
* @param fullScanId - Full scan identifier
|
|
395
|
+
* @param outputPath - Local file path to write the tar archive
|
|
396
|
+
* @returns Download result with success/error status
|
|
397
|
+
* @throws {Error} When server returns 5xx status codes
|
|
394
398
|
*/
|
|
395
399
|
downloadOrgFullScanFilesAsTar(orgSlug: string, fullScanId: string, outputPath: string): Promise<SocketSdkResult<'downloadOrgFullScanFilesAsTar'>>;
|
|
396
400
|
/**
|
|
@@ -472,7 +476,7 @@ export declare class SocketSdk {
|
|
|
472
476
|
* @param options - Request options including responseType and throws behavior
|
|
473
477
|
* @returns Raw response, parsed data, or SocketSdkGenericResult based on options
|
|
474
478
|
*/
|
|
475
|
-
getApi<T =
|
|
479
|
+
getApi<T = HttpResponse>(urlPath: string, options?: GetOptions | undefined): Promise<T | SocketSdkGenericResult<T>>;
|
|
476
480
|
/**
|
|
477
481
|
* Get list of API tokens for an organization.
|
|
478
482
|
* Returns organization API tokens with metadata and permissions.
|
|
@@ -526,7 +530,7 @@ export declare class SocketSdk {
|
|
|
526
530
|
/**
|
|
527
531
|
* Retrieve the enabled entitlements for an organization.
|
|
528
532
|
*
|
|
529
|
-
* This method fetches the organization's entitlements and filters for only
|
|
533
|
+
* This method fetches the organization's entitlements and filters for only the enabled ones, returning their keys. Entitlements represent Socket
|
|
530
534
|
* Products that the organization has access to use.
|
|
531
535
|
*/
|
|
532
536
|
getEnabledEntitlements(orgSlug: string): Promise<string[]>;
|
|
@@ -713,13 +717,15 @@ export declare class SocketSdk {
|
|
|
713
717
|
vulnerability_ids: string;
|
|
714
718
|
}): Promise<SocketSdkResult<'fetch-fixes'>>;
|
|
715
719
|
/**
|
|
716
|
-
* Get organization's license policy configuration
|
|
720
|
+
* Get organization's license policy configuration.
|
|
721
|
+
* Returns allowed, restricted, and monitored license types.
|
|
717
722
|
*
|
|
718
723
|
* @throws {Error} When server returns 5xx status codes
|
|
719
724
|
*/
|
|
720
725
|
getOrgLicensePolicy(orgSlug: string): Promise<SocketSdkResult<'getOrgLicensePolicy'>>;
|
|
721
726
|
/**
|
|
722
|
-
* Get organization's security policy configuration
|
|
727
|
+
* Get organization's security policy configuration.
|
|
728
|
+
* Returns alert rules, severity thresholds, and enforcement settings.
|
|
723
729
|
*
|
|
724
730
|
* @throws {Error} When server returns 5xx status codes
|
|
725
731
|
*/
|
|
@@ -782,10 +788,6 @@ export declare class SocketSdk {
|
|
|
782
788
|
* @throws {Error} When server returns 5xx status codes
|
|
783
789
|
*/
|
|
784
790
|
getRepoAnalytics(repo: string, time: string): Promise<SocketSdkResult<'getRepoAnalytics'>>;
|
|
785
|
-
/**
|
|
786
|
-
* Get detailed results for a legacy scan report.
|
|
787
|
-
/**
|
|
788
|
-
|
|
789
791
|
/**
|
|
790
792
|
* Get details for a specific repository.
|
|
791
793
|
*
|
|
@@ -875,15 +877,6 @@ export declare class SocketSdk {
|
|
|
875
877
|
* @throws {Error} When server returns 5xx status codes
|
|
876
878
|
*/
|
|
877
879
|
getSupportedFiles(orgSlug: string): Promise<SocketSdkResult<'getSupportedFiles'>>;
|
|
878
|
-
/**
|
|
879
|
-
* Get list of file types and formats supported for scanning.
|
|
880
|
-
* Returns supported manifest files, lockfiles, and configuration formats.
|
|
881
|
-
*
|
|
882
|
-
* @deprecated Use getSupportedFiles() instead. This endpoint has been deprecated
|
|
883
|
-
* since 2023-01-15 and now uses the /report/supported endpoint.
|
|
884
|
-
* @throws {Error} When server returns 5xx status codes
|
|
885
|
-
*/
|
|
886
|
-
getSupportedScanFiles(): Promise<SocketSdkResult<'getReportSupportedFiles'>>;
|
|
887
880
|
/**
|
|
888
881
|
* List all full scans for an organization.
|
|
889
882
|
*
|
|
@@ -1156,13 +1149,15 @@ export declare class SocketSdk {
|
|
|
1156
1149
|
*/
|
|
1157
1150
|
updateOrgAlertTriage(orgSlug: string, alertId: string, triageData: QueryParams): Promise<SocketSdkResult<'updateOrgAlertTriage'>>;
|
|
1158
1151
|
/**
|
|
1159
|
-
* Update organization's license policy configuration
|
|
1152
|
+
* Update organization's license policy configuration.
|
|
1153
|
+
* Modifies allowed, restricted, and monitored license types.
|
|
1160
1154
|
*
|
|
1161
1155
|
* @throws {Error} When server returns 5xx status codes
|
|
1162
1156
|
*/
|
|
1163
1157
|
updateOrgLicensePolicy(orgSlug: string, policyData: QueryParams, queryParams?: QueryParams | undefined): Promise<SocketSdkResult<'updateOrgLicensePolicy'>>;
|
|
1164
1158
|
/**
|
|
1165
|
-
* Update organization's security policy configuration
|
|
1159
|
+
* Update organization's security policy configuration.
|
|
1160
|
+
* Modifies alert rules, severity thresholds, and enforcement settings.
|
|
1166
1161
|
*
|
|
1167
1162
|
* @throws {Error} When server returns 5xx status codes
|
|
1168
1163
|
*/
|
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']>;
|
|
@@ -171,6 +170,34 @@ export type SocketSdkGenericResult<T> = {
|
|
|
171
170
|
success: false;
|
|
172
171
|
url?: string | undefined;
|
|
173
172
|
};
|
|
173
|
+
export type MalwareCheckAlert = {
|
|
174
|
+
category?: string | undefined;
|
|
175
|
+
fix?: {
|
|
176
|
+
description: string;
|
|
177
|
+
type: string;
|
|
178
|
+
} | undefined;
|
|
179
|
+
key: string;
|
|
180
|
+
props?: Record<string, unknown> | undefined;
|
|
181
|
+
severity?: string | undefined;
|
|
182
|
+
type: ALERT_TYPE;
|
|
183
|
+
};
|
|
184
|
+
export type MalwareCheckPackage = {
|
|
185
|
+
alerts: MalwareCheckAlert[];
|
|
186
|
+
name?: string | undefined;
|
|
187
|
+
namespace?: string | undefined;
|
|
188
|
+
score?: MalwareCheckScore | undefined;
|
|
189
|
+
type: string;
|
|
190
|
+
version?: string | undefined;
|
|
191
|
+
};
|
|
192
|
+
export type MalwareCheckResult = MalwareCheckPackage[];
|
|
193
|
+
export type MalwareCheckScore = {
|
|
194
|
+
license: number;
|
|
195
|
+
maintenance: number;
|
|
196
|
+
overall: number;
|
|
197
|
+
quality: number;
|
|
198
|
+
supplyChain: number;
|
|
199
|
+
vulnerability: number;
|
|
200
|
+
};
|
|
174
201
|
/**
|
|
175
202
|
* Result from file validation callback.
|
|
176
203
|
* Allows consumers to customize error handling and logging.
|
|
@@ -312,14 +339,6 @@ export type CreateDependenciesSnapshotOptions = {
|
|
|
312
339
|
pathsRelativeTo?: string | undefined;
|
|
313
340
|
queryParams?: QueryParams | undefined;
|
|
314
341
|
};
|
|
315
|
-
export type CreateOrgFullScanOptions = {
|
|
316
|
-
pathsRelativeTo?: string | undefined;
|
|
317
|
-
queryParams?: QueryParams | undefined;
|
|
318
|
-
};
|
|
319
|
-
export type CreateScanFromFilepathsOptions = {
|
|
320
|
-
issueRules?: Record<string, boolean> | undefined;
|
|
321
|
-
pathsRelativeTo?: string | undefined;
|
|
322
|
-
};
|
|
323
342
|
export type StreamOrgFullScanOptions = {
|
|
324
343
|
output?: boolean | string | undefined;
|
|
325
344
|
};
|
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",
|
|
@@ -59,16 +59,17 @@
|
|
|
59
59
|
"publish": "node scripts/publish.mjs",
|
|
60
60
|
"publish:ci": "node scripts/publish.mjs --tag ${DIST_TAG:-latest}",
|
|
61
61
|
"claude": "node scripts/claude.mjs",
|
|
62
|
+
"security": "agentshield scan && { command -v zizmor >/dev/null && zizmor .github/ || echo 'zizmor not installed — run pnpm run setup to install'; }",
|
|
62
63
|
"test": "node scripts/test.mjs",
|
|
63
64
|
"type": "tsgo --noEmit -p .config/tsconfig.check.json",
|
|
64
65
|
"update": "node scripts/update.mjs"
|
|
65
66
|
},
|
|
66
67
|
"dependencies": {
|
|
67
|
-
"@
|
|
68
|
-
"@socketsecurity/lib": "5.8.1",
|
|
68
|
+
"@socketsecurity/lib": "5.15.0",
|
|
69
69
|
"form-data": "4.0.5"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
+
"@anthropic-ai/claude-code": "2.1.92",
|
|
72
73
|
"@babel/generator": "7.28.5",
|
|
73
74
|
"@babel/parser": "7.26.3",
|
|
74
75
|
"@babel/traverse": "7.26.4",
|
|
@@ -83,9 +84,9 @@
|
|
|
83
84
|
"acorn": "8.15.0",
|
|
84
85
|
"del": "8.0.1",
|
|
85
86
|
"dev-null-cli": "2.0.0",
|
|
87
|
+
"ecc-agentshield": "1.4.0",
|
|
86
88
|
"esbuild": "0.25.11",
|
|
87
89
|
"fast-glob": "3.3.3",
|
|
88
|
-
"http2-wrapper": "2.2.1",
|
|
89
90
|
"husky": "9.1.7",
|
|
90
91
|
"magic-string": "0.30.14",
|
|
91
92
|
"nock": "14.0.10",
|
|
@@ -109,17 +110,18 @@
|
|
|
109
110
|
"strict": true
|
|
110
111
|
},
|
|
111
112
|
"engines": {
|
|
112
|
-
"node": ">=18",
|
|
113
|
-
"pnpm": ">=10.
|
|
113
|
+
"node": ">=18.20.8",
|
|
114
|
+
"pnpm": ">=10.33.0"
|
|
114
115
|
},
|
|
115
|
-
"packageManager": "pnpm@10.
|
|
116
|
+
"packageManager": "pnpm@10.33.0",
|
|
116
117
|
"pnpm": {
|
|
117
118
|
"ignoredBuiltDependencies": [
|
|
118
119
|
"esbuild",
|
|
119
120
|
"unrs-resolver"
|
|
120
121
|
],
|
|
121
122
|
"overrides": {
|
|
122
|
-
"
|
|
123
|
+
"defu": ">=6.1.6",
|
|
124
|
+
"vite": "7.3.2"
|
|
123
125
|
}
|
|
124
126
|
}
|
|
125
127
|
}
|
package/types/api.d.ts
CHANGED
|
@@ -896,7 +896,7 @@ export interface paths {
|
|
|
896
896
|
/**
|
|
897
897
|
* Start historical data snapshot job (Beta)
|
|
898
898
|
* @description This API endpoint is used to start a historical snapshot job.
|
|
899
|
-
* While snapshots are typically taken
|
|
899
|
+
* While snapshots are typically taken multiple times a day for paid plans and once a day for free plans, this endpoint can be used to start an "on demand" snapshot job to ensure the latest data is collected and stored for historical purposes.
|
|
900
900
|
*
|
|
901
901
|
* An historical snapshot will contain details and raw data for the following resources:
|
|
902
902
|
*
|
|
@@ -1940,6 +1940,27 @@ export interface components {
|
|
|
1940
1940
|
licenseDetails?: components['schemas']['LicenseDetails']
|
|
1941
1941
|
licenseAttrib?: components['schemas']['SAttrib1_N']
|
|
1942
1942
|
}
|
|
1943
|
+
/** @description Mapping of supply chain risk alert types to their computed score contributions and formulas used for calculation. This allows for detailed breakdowns of how each alert type impacts the overall supply chain security score, with the ability to include custom formulas and components for each alert type. */
|
|
1944
|
+
SocketSBOMScore: {
|
|
1945
|
+
[key: string]: {
|
|
1946
|
+
value: {
|
|
1947
|
+
/**
|
|
1948
|
+
* @description Score from 0.0 to 1.0 for the scanned repository, computed from supply chain risk alerts using weighted exponential decay per direct dependency
|
|
1949
|
+
* @default 0
|
|
1950
|
+
*/
|
|
1951
|
+
result: number
|
|
1952
|
+
/** @description Components used to compute result of the formula */
|
|
1953
|
+
components?: {
|
|
1954
|
+
[key: string]: number
|
|
1955
|
+
}
|
|
1956
|
+
/**
|
|
1957
|
+
* @description Formula used to compute the supply chain security score
|
|
1958
|
+
* @default
|
|
1959
|
+
*/
|
|
1960
|
+
formula?: string
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1943
1964
|
SocketDiffArtifact: components['schemas']['SocketPURL'] & {
|
|
1944
1965
|
diffType: components['schemas']['SocketDiffArtifactType']
|
|
1945
1966
|
id?: components['schemas']['SocketId']
|
|
@@ -4331,6 +4352,23 @@ export interface components {
|
|
|
4331
4352
|
usage?: components['schemas']['SocketUsageRef']
|
|
4332
4353
|
}
|
|
4333
4354
|
}
|
|
4355
|
+
| {
|
|
4356
|
+
/** @enum {string} */
|
|
4357
|
+
type?: 'skillPreExecution'
|
|
4358
|
+
value?: components['schemas']['SocketIssueBasics'] & {
|
|
4359
|
+
/** @default */
|
|
4360
|
+
description: string
|
|
4361
|
+
props: {
|
|
4362
|
+
/** @default */
|
|
4363
|
+
notes: string
|
|
4364
|
+
/** @default 0 */
|
|
4365
|
+
confidence: number
|
|
4366
|
+
/** @default 0 */
|
|
4367
|
+
severity: number
|
|
4368
|
+
}
|
|
4369
|
+
usage?: components['schemas']['SocketUsageRef']
|
|
4370
|
+
}
|
|
4371
|
+
}
|
|
4334
4372
|
| {
|
|
4335
4373
|
/** @enum {string} */
|
|
4336
4374
|
type?: 'skillPromptInjection'
|
|
@@ -5522,6 +5560,8 @@ export interface operations {
|
|
|
5522
5560
|
cachedResultsOnly?: boolean
|
|
5523
5561
|
/** @description Include a summary object at the end of the stream with counts of malformed, resolved, and not found PURLs. */
|
|
5524
5562
|
summary?: boolean
|
|
5563
|
+
/** @description Maximum time in seconds to wait for scan results. PURLs that have not completed processing when the timeout is reached will be returned as errors (when purlErrors is enabled). Omit for no timeout. */
|
|
5564
|
+
timeoutSec?: number
|
|
5525
5565
|
}
|
|
5526
5566
|
}
|
|
5527
5567
|
requestBody?: {
|
|
@@ -5598,6 +5638,8 @@ export interface operations {
|
|
|
5598
5638
|
version?: string
|
|
5599
5639
|
/** @default */
|
|
5600
5640
|
release?: string
|
|
5641
|
+
/** @default */
|
|
5642
|
+
workspace?: string
|
|
5601
5643
|
}>
|
|
5602
5644
|
}
|
|
5603
5645
|
}
|
|
@@ -5924,6 +5966,10 @@ export interface operations {
|
|
|
5924
5966
|
include_alert_priority_details?:
|
|
5925
5967
|
| boolean
|
|
5926
5968
|
| Array<'component' | 'formula'>
|
|
5969
|
+
/** @description Include scores event in the response. include_scores_details implies this flag */
|
|
5970
|
+
include_scores: boolean
|
|
5971
|
+
/** @description Control which score detail fields to include in the scores event. Set to "true" to include all fields, "false" to exclude all fields, or specify individual fields like "components,formula" to include only those fields. */
|
|
5972
|
+
include_scores_details?: boolean | Array<'components' | 'formula'>
|
|
5927
5973
|
/** @description Include license details in the response. This can increase the response size significantly. */
|
|
5928
5974
|
include_license_details: boolean
|
|
5929
5975
|
/** @description Return cached immutable scan results. When enabled and results are cached, returns the pre-computed scan. When results are not yet cached, returns 202 Accepted and enqueues a background job. */
|
|
@@ -5937,10 +5983,16 @@ export interface operations {
|
|
|
5937
5983
|
}
|
|
5938
5984
|
}
|
|
5939
5985
|
responses: {
|
|
5940
|
-
/** @description Socket issue lists and scores for all packages */
|
|
5986
|
+
/** @description Socket issue lists and scores for all packages, followed by a final scores event */
|
|
5941
5987
|
200: {
|
|
5942
5988
|
content: {
|
|
5943
|
-
'application/x-ndjson':
|
|
5989
|
+
'application/x-ndjson':
|
|
5990
|
+
| components['schemas']['SocketArtifact']
|
|
5991
|
+
| {
|
|
5992
|
+
/** @enum {string} */
|
|
5993
|
+
_type: 'scores'
|
|
5994
|
+
value: components['schemas']['SocketSBOMScore']
|
|
5995
|
+
}
|
|
5944
5996
|
}
|
|
5945
5997
|
}
|
|
5946
5998
|
/** @description Scan is being processed. Poll again later to retrieve results. */
|
|
@@ -9411,6 +9463,13 @@ export interface operations {
|
|
|
9411
9463
|
*/
|
|
9412
9464
|
action: 'defer' | 'error' | 'warn' | 'monitor' | 'ignore'
|
|
9413
9465
|
}
|
|
9466
|
+
skillPreExecution?: {
|
|
9467
|
+
/**
|
|
9468
|
+
* @description The action to take for skillPreExecution issues.
|
|
9469
|
+
* @enum {string}
|
|
9470
|
+
*/
|
|
9471
|
+
action: 'defer' | 'error' | 'warn' | 'monitor' | 'ignore'
|
|
9472
|
+
}
|
|
9414
9473
|
skillPromptInjection?: {
|
|
9415
9474
|
/**
|
|
9416
9475
|
* @description The action to take for skillPromptInjection issues.
|
|
@@ -10388,6 +10447,13 @@ export interface operations {
|
|
|
10388
10447
|
*/
|
|
10389
10448
|
action: 'defer' | 'error' | 'warn' | 'monitor' | 'ignore'
|
|
10390
10449
|
}
|
|
10450
|
+
skillPreExecution?: {
|
|
10451
|
+
/**
|
|
10452
|
+
* @description The action to take for skillPreExecution issues.
|
|
10453
|
+
* @enum {string}
|
|
10454
|
+
*/
|
|
10455
|
+
action: 'defer' | 'error' | 'warn' | 'monitor' | 'ignore'
|
|
10456
|
+
}
|
|
10391
10457
|
skillPromptInjection?: {
|
|
10392
10458
|
/**
|
|
10393
10459
|
* @description The action to take for skillPromptInjection issues.
|
|
@@ -11519,6 +11585,13 @@ export interface operations {
|
|
|
11519
11585
|
*/
|
|
11520
11586
|
action: 'defer' | 'error' | 'warn' | 'monitor' | 'ignore'
|
|
11521
11587
|
}
|
|
11588
|
+
skillPreExecution?: {
|
|
11589
|
+
/**
|
|
11590
|
+
* @description The action to take for skillPreExecution issues.
|
|
11591
|
+
* @enum {string}
|
|
11592
|
+
*/
|
|
11593
|
+
action: 'defer' | 'error' | 'warn' | 'monitor' | 'ignore'
|
|
11594
|
+
}
|
|
11522
11595
|
skillPromptInjection?: {
|
|
11523
11596
|
/**
|
|
11524
11597
|
* @description The action to take for skillPromptInjection issues.
|
|
@@ -12489,6 +12562,13 @@ export interface operations {
|
|
|
12489
12562
|
*/
|
|
12490
12563
|
action: 'defer' | 'error' | 'warn' | 'monitor' | 'ignore'
|
|
12491
12564
|
}
|
|
12565
|
+
skillPreExecution?: {
|
|
12566
|
+
/**
|
|
12567
|
+
* @description The action to take for skillPreExecution issues.
|
|
12568
|
+
* @enum {string}
|
|
12569
|
+
*/
|
|
12570
|
+
action: 'defer' | 'error' | 'warn' | 'monitor' | 'ignore'
|
|
12571
|
+
}
|
|
12492
12572
|
skillPromptInjection?: {
|
|
12493
12573
|
/**
|
|
12494
12574
|
* @description The action to take for skillPromptInjection issues.
|
|
@@ -13428,6 +13508,13 @@ export interface operations {
|
|
|
13428
13508
|
*/
|
|
13429
13509
|
action: 'defer' | 'error' | 'warn' | 'monitor' | 'ignore'
|
|
13430
13510
|
}
|
|
13511
|
+
skillPreExecution?: {
|
|
13512
|
+
/**
|
|
13513
|
+
* @description The action to take for skillPreExecution issues.
|
|
13514
|
+
* @enum {string}
|
|
13515
|
+
*/
|
|
13516
|
+
action: 'defer' | 'error' | 'warn' | 'monitor' | 'ignore'
|
|
13517
|
+
}
|
|
13431
13518
|
skillPromptInjection?: {
|
|
13432
13519
|
/**
|
|
13433
13520
|
* @description The action to take for skillPromptInjection issues.
|
|
@@ -15243,7 +15330,7 @@ export interface operations {
|
|
|
15243
15330
|
/**
|
|
15244
15331
|
* Start historical data snapshot job (Beta)
|
|
15245
15332
|
* @description This API endpoint is used to start a historical snapshot job.
|
|
15246
|
-
* While snapshots are typically taken
|
|
15333
|
+
* While snapshots are typically taken multiple times a day for paid plans and once a day for free plans, this endpoint can be used to start an "on demand" snapshot job to ensure the latest data is collected and stored for historical purposes.
|
|
15247
15334
|
*
|
|
15248
15335
|
* An historical snapshot will contain details and raw data for the following resources:
|
|
15249
15336
|
*
|
|
@@ -15309,12 +15396,17 @@ export interface operations {
|
|
|
15309
15396
|
| 'ChangePlanSubscriptionSeats'
|
|
15310
15397
|
| 'CreateApiToken'
|
|
15311
15398
|
| 'CreateArtifact'
|
|
15399
|
+
| 'CreateFirewallCustomRegistry'
|
|
15400
|
+
| 'CreateFirewallDeploymentConfig'
|
|
15312
15401
|
| 'CreateLabel'
|
|
15313
15402
|
| 'CreateOauthRefreshToken'
|
|
15314
15403
|
| 'CreateRepoAccessRule'
|
|
15315
15404
|
| 'CreateWebhook'
|
|
15405
|
+
| 'CreateTicket'
|
|
15316
15406
|
| 'DeleteAlertTriage'
|
|
15317
15407
|
| 'DeleteApiToken'
|
|
15408
|
+
| 'DeleteFirewallCustomRegistry'
|
|
15409
|
+
| 'DeleteFirewallDeploymentConfig'
|
|
15318
15410
|
| 'DeleteFullScan'
|
|
15319
15411
|
| 'DeleteLabel'
|
|
15320
15412
|
| 'DeleteLabelSetting'
|
|
@@ -15323,8 +15415,10 @@ export interface operations {
|
|
|
15323
15415
|
| 'DeleteRepository'
|
|
15324
15416
|
| 'DeleteWebhook'
|
|
15325
15417
|
| 'DisassociateLabel'
|
|
15418
|
+
| 'DisconnectJiraIntegration'
|
|
15326
15419
|
| 'DowngradeOrganizationPlan'
|
|
15327
15420
|
| 'JoinOrganization'
|
|
15421
|
+
| 'JiraIntegrationConnected'
|
|
15328
15422
|
| 'MemberAdded'
|
|
15329
15423
|
| 'MemberRemoved'
|
|
15330
15424
|
| 'MemberRoleChanged'
|
|
@@ -15346,6 +15440,8 @@ export interface operations {
|
|
|
15346
15440
|
| 'UpdateApiTokenScopes'
|
|
15347
15441
|
| 'UpdateApiTokenVisibility'
|
|
15348
15442
|
| 'UpdateAutopatchCurated'
|
|
15443
|
+
| 'UpdateFirewallCustomRegistry'
|
|
15444
|
+
| 'UpdateFirewallDeploymentConfig'
|
|
15349
15445
|
| 'UpdateLabel'
|
|
15350
15446
|
| 'UpdateLabelSetting'
|
|
15351
15447
|
| 'UpdateLicenseOverlay'
|
|
@@ -15519,6 +15615,11 @@ export interface operations {
|
|
|
15519
15615
|
| 'alerts'
|
|
15520
15616
|
| 'alerts:list'
|
|
15521
15617
|
| 'alerts:trend'
|
|
15618
|
+
| 'alert-resolution'
|
|
15619
|
+
| 'alert-resolution:list'
|
|
15620
|
+
| 'alert-resolution:create'
|
|
15621
|
+
| 'alert-resolution:read'
|
|
15622
|
+
| 'alert-resolution:delete'
|
|
15522
15623
|
| 'api-tokens'
|
|
15523
15624
|
| 'api-tokens:create'
|
|
15524
15625
|
| 'api-tokens:update'
|
|
@@ -15649,6 +15750,11 @@ export interface operations {
|
|
|
15649
15750
|
| 'alerts'
|
|
15650
15751
|
| 'alerts:list'
|
|
15651
15752
|
| 'alerts:trend'
|
|
15753
|
+
| 'alert-resolution'
|
|
15754
|
+
| 'alert-resolution:list'
|
|
15755
|
+
| 'alert-resolution:create'
|
|
15756
|
+
| 'alert-resolution:read'
|
|
15757
|
+
| 'alert-resolution:delete'
|
|
15652
15758
|
| 'api-tokens'
|
|
15653
15759
|
| 'api-tokens:create'
|
|
15654
15760
|
| 'api-tokens:update'
|
|
@@ -15842,6 +15948,11 @@ export interface operations {
|
|
|
15842
15948
|
| 'alerts'
|
|
15843
15949
|
| 'alerts:list'
|
|
15844
15950
|
| 'alerts:trend'
|
|
15951
|
+
| 'alert-resolution'
|
|
15952
|
+
| 'alert-resolution:list'
|
|
15953
|
+
| 'alert-resolution:create'
|
|
15954
|
+
| 'alert-resolution:read'
|
|
15955
|
+
| 'alert-resolution:delete'
|
|
15845
15956
|
| 'api-tokens'
|
|
15846
15957
|
| 'api-tokens:create'
|
|
15847
15958
|
| 'api-tokens:update'
|
|
@@ -16577,6 +16688,8 @@ export interface operations {
|
|
|
16577
16688
|
cachedResultsOnly?: boolean
|
|
16578
16689
|
/** @description Include a summary object at the end of the stream with counts of malformed, resolved, and not found PURLs. */
|
|
16579
16690
|
summary?: boolean
|
|
16691
|
+
/** @description Maximum time in seconds to wait for scan results. PURLs that have not completed processing when the timeout is reached will be returned as errors (when purlErrors is enabled). Omit for no timeout, unless a default timeout is configured for the organization. */
|
|
16692
|
+
timeoutSec?: number
|
|
16580
16693
|
}
|
|
16581
16694
|
path: {
|
|
16582
16695
|
/** @description The slug of the organization */
|
|
@@ -16667,7 +16780,7 @@ export interface operations {
|
|
|
16667
16780
|
'fetch-fixes': {
|
|
16668
16781
|
parameters: {
|
|
16669
16782
|
query: {
|
|
16670
|
-
/** @description The slug of the repository to fetch fixes for. Computes fixes based on the latest scan on the default branch */
|
|
16783
|
+
/** @description The slug of the repository to fetch fixes for (e.g. "my-repo" or "my-org/my-repo"). Use the full org/repo path to disambiguate when multiple GitHub orgs share the same repo name. Computes fixes based on the latest scan on the default branch */
|
|
16671
16784
|
repo_slug?: string
|
|
16672
16785
|
/** @description The ID of the scan to fetch fixes for */
|
|
16673
16786
|
full_scan_id?: string
|
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
|
-
}
|