@socketsecurity/sdk 1.9.0 → 1.9.2

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.
@@ -40,6 +40,13 @@ export declare class SocketSdk {
40
40
  * @throws {Error} When server returns 5xx status codes
41
41
  */
42
42
  createDependenciesSnapshot(filepaths: string[], pathsRelativeTo?: string, queryParams?: QueryParams | undefined): Promise<SocketSdkResult<'createDependenciesSnapshot'>>;
43
+ /**
44
+ * Create a diff scan from two full scan IDs.
45
+ * Compares two existing full scans to identify changes.
46
+ *
47
+ * @throws {Error} When server returns 5xx status codes
48
+ */
49
+ createOrgDiffScanFromIds(orgSlug: string, queryParams?: QueryParams | undefined): Promise<SocketSdkResult<'createOrgDiffScanFromIds'>>;
43
50
  /**
44
51
  * Create a comprehensive security scan for an organization.
45
52
  * Uploads project files and initiates full security analysis.
@@ -54,13 +61,27 @@ export declare class SocketSdk {
54
61
  * @throws {Error} When server returns 5xx status codes
55
62
  */
56
63
  createOrgRepo(orgSlug: string, queryParams?: QueryParams | undefined): Promise<SocketSdkResult<'createOrgRepo'>>;
64
+ /**
65
+ * Create a new repository label for an organization.
66
+ * Adds label for repository categorization and management.
67
+ *
68
+ * @throws {Error} When server returns 5xx status codes
69
+ */
70
+ createOrgRepoLabel(orgSlug: string, repoSlug: string, labelData: QueryParams): Promise<SocketSdkResult<'createOrgRepoLabel'>>;
57
71
  /**
58
72
  * Create a security scan by uploading project files.
59
73
  * Analyzes uploaded files for security vulnerabilities and policy violations.
60
74
  *
61
75
  * @throws {Error} When server returns 5xx status codes
62
76
  */
63
- createScanFromFilepaths(filepaths: string[], pathsRelativeTo?: string, issueRules?: Record<string, boolean>): Promise<SocketSdkResult<'createReport'>>;
77
+ createScanFromFilepaths(filepaths: string[], pathsRelativeTo?: string, issueRules?: Record<string, boolean> | undefined): Promise<SocketSdkResult<'createReport'>>;
78
+ /**
79
+ * Delete a diff scan from an organization.
80
+ * Permanently removes diff scan data and results.
81
+ *
82
+ * @throws {Error} When server returns 5xx status codes
83
+ */
84
+ deleteOrgDiffScan(orgSlug: string, diffScanId: string): Promise<SocketSdkResult<'deleteOrgDiffScan'>>;
64
85
  /**
65
86
  * Delete a full scan from an organization.
66
87
  * Permanently removes scan data and results.
@@ -75,6 +96,49 @@ export declare class SocketSdk {
75
96
  * @throws {Error} When server returns 5xx status codes
76
97
  */
77
98
  deleteOrgRepo(orgSlug: string, repoSlug: string): Promise<SocketSdkResult<'deleteOrgRepo'>>;
99
+ /**
100
+ * Delete a repository label from an organization.
101
+ * Removes label and associated configuration.
102
+ *
103
+ * @throws {Error} When server returns 5xx status codes
104
+ */
105
+ deleteOrgRepoLabel(orgSlug: string, repoSlug: string, labelSlug: string): Promise<SocketSdkResult<'deleteOrgRepoLabel'>>;
106
+ /**
107
+ * Delete a scan report permanently.
108
+ * Removes scan data and analysis results from the system.
109
+ *
110
+ * @throws {Error} When server returns 5xx status codes
111
+ */
112
+ deleteReport(reportId: string): Promise<SocketSdkResult<'deleteReport'>>;
113
+ /**
114
+ * Export scan results in CycloneDX SBOM format.
115
+ * Returns Software Bill of Materials compliant with CycloneDX standard.
116
+ *
117
+ * @throws {Error} When server returns 5xx status codes
118
+ */
119
+ exportCDX(orgSlug: string, fullScanId: string): Promise<SocketSdkResult<'exportCDX'>>;
120
+ /**
121
+ * Export scan results in SPDX SBOM format.
122
+ * Returns Software Bill of Materials compliant with SPDX standard.
123
+ *
124
+ * @throws {Error} When server returns 5xx status codes
125
+ */
126
+ exportSPDX(orgSlug: string, fullScanId: string): Promise<SocketSdkResult<'exportSPDX'>>;
127
+ /**
128
+ * Execute a raw GET request to any API endpoint with configurable response type.
129
+ * Supports both throwing (default) and non-throwing modes.
130
+ * @param urlPath - API endpoint path (e.g., 'organizations')
131
+ * @param options - Request options including responseType and throws behavior
132
+ * @returns Raw response, parsed data, or SocketSdkGenericResult based on options
133
+ */
134
+ getApi<T = IncomingMessage>(urlPath: string, options?: GetOptions | undefined): Promise<T | SocketSdkGenericResult<T>>;
135
+ /**
136
+ * Get list of API tokens for an organization.
137
+ * Returns organization API tokens with metadata and permissions.
138
+ *
139
+ * @throws {Error} When server returns 5xx status codes
140
+ */
141
+ getAPITokens(orgSlug: string): Promise<SocketSdkResult<'getAPITokens'>>;
78
142
  /**
79
143
  * Retrieve audit log events for an organization.
80
144
  * Returns chronological log of security and administrative actions.
@@ -82,6 +146,13 @@ export declare class SocketSdk {
82
146
  * @throws {Error} When server returns 5xx status codes
83
147
  */
84
148
  getAuditLogEvents(orgSlug: string, queryParams?: QueryParams | undefined): Promise<SocketSdkResult<'getAuditLogEvents'>>;
149
+ /**
150
+ * Get details for a specific diff scan.
151
+ * Returns comparison between two full scans with artifact changes.
152
+ *
153
+ * @throws {Error} When server returns 5xx status codes
154
+ */
155
+ getDiffScanById(orgSlug: string, diffScanId: string): Promise<SocketSdkResult<'getDiffScanById'>>;
85
156
  /**
86
157
  * Retrieve the enabled entitlements for an organization.
87
158
  *
@@ -117,21 +188,6 @@ export declare class SocketSdk {
117
188
  * @throws {Error} When server returns 5xx status codes
118
189
  */
119
190
  getOrganizations(): Promise<SocketSdkResult<'getOrganizations'>>;
120
- /**
121
- * Stream a full scan's results to file or stdout.* Provides efficient streaming for large scan datasets.
122
- *
123
- * @throws {Error} When server returns 5xx status codes
124
- */
125
- streamOrgFullScan(orgSlug: string, fullScanId: string, output?: string | boolean): Promise<SocketSdkResult<'getOrgFullScan'>>;
126
- /**
127
- * Stream patches for artifacts in a scan report.
128
- *
129
- * This method streams all available patches for artifacts in a scan.
130
- * Free tier users will only receive free patches.
131
- *
132
- * Note: This method returns a ReadableStream for processing large datasets.
133
- */
134
- streamPatchesFromScan(orgSlug: string, scanId: string): Promise<ReadableStream<ArtifactPatches>>;
135
191
  /**
136
192
  * Get complete full scan results in memory.
137
193
  * Returns entire scan data as JSON for programmatic processing.
@@ -166,6 +222,20 @@ export declare class SocketSdk {
166
222
  * @throws {Error} When server returns 5xx status codes
167
223
  */
168
224
  getOrgRepo(orgSlug: string, repoSlug: string): Promise<SocketSdkResult<'getOrgRepo'>>;
225
+ /**
226
+ * Get details for a specific repository label.
227
+ * Returns label configuration and metadata.
228
+ *
229
+ * @throws {Error} When server returns 5xx status codes
230
+ */
231
+ getOrgRepoLabel(orgSlug: string, repoSlug: string, labelSlug: string): Promise<SocketSdkResult<'getOrgRepoLabel'>>;
232
+ /**
233
+ * Get list of repository labels for an organization.
234
+ * Returns all labels configured for repository management.
235
+ *
236
+ * @throws {Error} When server returns 5xx status codes
237
+ */
238
+ getOrgRepoLabelList(orgSlug: string, repoSlug: string): Promise<SocketSdkResult<'getOrgRepoLabelList'>>;
169
239
  /**
170
240
  * List all repositories in an organization.
171
241
  * Returns paginated list of repository metadata and status.
@@ -179,6 +249,13 @@ export declare class SocketSdk {
179
249
  * @throws {Error} When server returns 5xx status codes
180
250
  */
181
251
  getOrgSecurityPolicy(orgSlug: string): Promise<SocketSdkResult<'getOrgSecurityPolicy'>>;
252
+ /**
253
+ * Get organization triage settings and status.
254
+ * Returns alert triage configuration and current state.
255
+ *
256
+ * @throws {Error} When server returns 5xx status codes
257
+ */
258
+ getOrgTriage(orgSlug: string): Promise<SocketSdkResult<'getOrgTriage'>>;
182
259
  /**
183
260
  * Get current API quota usage and limits.
184
261
  * Returns remaining requests, rate limits, and quota reset times.
@@ -207,13 +284,6 @@ export declare class SocketSdk {
207
284
  * @throws {Error} When server returns 5xx status codes
208
285
  */
209
286
  getScanList(): Promise<SocketSdkResult<'getReportList'>>;
210
- /**
211
- * Get list of file types and formats supported for scanning.
212
- * Returns supported manifest files, lockfiles, and configuration formats.
213
- *
214
- * @throws {Error} When server returns 5xx status codes
215
- */
216
- getSupportedScanFiles(): Promise<SocketSdkResult<'getReportSupportedFiles'>>;
217
287
  /**
218
288
  * Get security score for a specific npm package and version.
219
289
  * Returns numerical security rating and scoring breakdown.
@@ -222,77 +292,40 @@ export declare class SocketSdk {
222
292
  */
223
293
  getScoreByNpmPackage(pkgName: string, version: string): Promise<SocketSdkResult<'getScoreByNPMPackage'>>;
224
294
  /**
225
- * Update user or organization settings.
226
- * Configures preferences, notifications, and security policies.
227
- *
228
- * @throws {Error} When server returns 5xx status codes
229
- */
230
- postSettings(selectors: Array<{
231
- organization?: string;
232
- }>): Promise<SocketSdkResult<'postSettings'>>;
233
- /**
234
- * Search for dependencies across monitored projects.
235
- * Returns matching packages with security information and usage patterns.
236
- *
237
- * @throws {Error} When server returns 5xx status codes
238
- */
239
- searchDependencies(queryParams?: QueryParams | undefined): Promise<SocketSdkResult<'searchDependencies'>>;
240
- /**
241
- * Update configuration for an organization repository.
242
- * Modifies monitoring settings, branch configuration, and scan preferences.
243
- *
244
- * @throws {Error} When server returns 5xx status codes
245
- */
246
- updateOrgRepo(orgSlug: string, repoSlug: string, queryParams?: QueryParams | undefined): Promise<SocketSdkResult<'updateOrgRepo'>>;
247
- /**
248
- * Upload manifest files for dependency analysis.
249
- * Processes package files to create dependency snapshots and security analysis.
250
- *
251
- * @throws {Error} When server returns 5xx status codes
252
- */
253
- uploadManifestFiles(orgSlug: string, filepaths: string[], pathsRelativeTo?: string): Promise<UploadManifestFilesReturnType | UploadManifestFilesError>;
254
- /**
255
- * View detailed information about a specific patch by its UUID.
256
- *
257
- * This method retrieves comprehensive patch details including files,
258
- * vulnerabilities, description, license, and tier information.
259
- */
260
- viewPatch(orgSlug: string, uuid: string): Promise<PatchViewResponse>;
261
- /**
262
- * Delete a scan report permanently.
263
- * Removes scan data and analysis results from the system.
295
+ * Get list of file types and formats supported for scanning.
296
+ * Returns supported manifest files, lockfiles, and configuration formats.
264
297
  *
265
298
  * @throws {Error} When server returns 5xx status codes
266
299
  */
267
- deleteReport(reportId: string): Promise<SocketSdkResult<'deleteReport'>>;
300
+ getSupportedScanFiles(): Promise<SocketSdkResult<'getReportSupportedFiles'>>;
268
301
  /**
269
- * Export scan results in CycloneDX SBOM format.
270
- * Returns Software Bill of Materials compliant with CycloneDX standard.
302
+ * List all diff scans for an organization.
303
+ * Returns paginated list of diff scan metadata and status.
271
304
  *
272
305
  * @throws {Error} When server returns 5xx status codes
273
306
  */
274
- exportCDX(orgSlug: string, fullScanId: string): Promise<SocketSdkResult<'exportCDX'>>;
307
+ listOrgDiffScans(orgSlug: string): Promise<SocketSdkResult<'listOrgDiffScans'>>;
275
308
  /**
276
- * Export scan results in SPDX SBOM format.
277
- * Returns Software Bill of Materials compliant with SPDX standard.
309
+ * Create a new API token for an organization.
310
+ * Generates API token with specified scopes and metadata.
278
311
  *
279
312
  * @throws {Error} When server returns 5xx status codes
280
313
  */
281
- exportSPDX(orgSlug: string, fullScanId: string): Promise<SocketSdkResult<'exportSPDX'>>;
314
+ postAPIToken(orgSlug: string, tokenData: QueryParams): Promise<SocketSdkResult<'postAPIToken'>>;
282
315
  /**
283
- * Get list of API tokens for an organization.
284
- * Returns organization API tokens with metadata and permissions.
316
+ * Revoke an API token for an organization.
317
+ * Permanently disables the token and removes access.
285
318
  *
286
319
  * @throws {Error} When server returns 5xx status codes
287
320
  */
288
- getAPITokens(orgSlug: string): Promise<SocketSdkResult<'getAPITokens'>>;
321
+ postAPITokensRevoke(orgSlug: string, tokenId: string): Promise<SocketSdkResult<'postAPITokensRevoke'>>;
289
322
  /**
290
- * Create a new API token for an organization.
291
- * Generates API token with specified scopes and metadata.
323
+ * Rotate an API token for an organization.
324
+ * Generates new token value while preserving token metadata.
292
325
  *
293
326
  * @throws {Error} When server returns 5xx status codes
294
327
  */
295
- postAPIToken(orgSlug: string, tokenData: QueryParams): Promise<SocketSdkResult<'postAPIToken'>>;
328
+ postAPITokensRotate(orgSlug: string, tokenId: string): Promise<SocketSdkResult<'postAPITokensRotate'>>;
296
329
  /**
297
330
  * Update an existing API token for an organization.
298
331
  * Modifies token metadata, scopes, or other properties.
@@ -301,38 +334,44 @@ export declare class SocketSdk {
301
334
  */
302
335
  postAPITokenUpdate(orgSlug: string, tokenId: string, updateData: QueryParams): Promise<SocketSdkResult<'postAPITokenUpdate'>>;
303
336
  /**
304
- * Rotate an API token for an organization.
305
- * Generates new token value while preserving token metadata.
337
+ * Update user or organization settings.
338
+ * Configures preferences, notifications, and security policies.
306
339
  *
307
340
  * @throws {Error} When server returns 5xx status codes
308
341
  */
309
- postAPITokensRotate(orgSlug: string, tokenId: string): Promise<SocketSdkResult<'postAPITokensRotate'>>;
342
+ postSettings(selectors: Array<{
343
+ organization?: string | undefined;
344
+ }>): Promise<SocketSdkResult<'postSettings'>>;
310
345
  /**
311
- * Revoke an API token for an organization.
312
- * Permanently disables the token and removes access.
346
+ * Search for dependencies across monitored projects.
347
+ * Returns matching packages with security information and usage patterns.
313
348
  *
314
349
  * @throws {Error} When server returns 5xx status codes
315
350
  */
316
- postAPITokensRevoke(orgSlug: string, tokenId: string): Promise<SocketSdkResult<'postAPITokensRevoke'>>;
351
+ searchDependencies(queryParams?: QueryParams | undefined): Promise<SocketSdkResult<'searchDependencies'>>;
317
352
  /**
318
- * Update organization's security policy configuration.* Modifies alert rules, severity thresholds, and enforcement settings.
319
- *
320
- * @throws {Error} When server returns 5xx status codes
353
+ * Send POST or PUT request with JSON body and return parsed JSON response.
354
+ * Supports both throwing (default) and non-throwing modes.
355
+ * @param urlPath - API endpoint path (e.g., 'organizations')
356
+ * @param options - Request options including method, body, and throws behavior
357
+ * @returns Parsed JSON response or SocketSdkGenericResult based on options
321
358
  */
322
- updateOrgSecurityPolicy(orgSlug: string, policyData: QueryParams): Promise<SocketSdkResult<'updateOrgSecurityPolicy'>>;
359
+ sendApi<T>(urlPath: string, options?: SendOptions | undefined): Promise<T | SocketSdkGenericResult<T>>;
323
360
  /**
324
- * Update organization's license policy configuration.* Modifies allowed, restricted, and monitored license types.
361
+ * Stream a full scan's results to file or stdout.* Provides efficient streaming for large scan datasets.
325
362
  *
326
363
  * @throws {Error} When server returns 5xx status codes
327
364
  */
328
- updateOrgLicensePolicy(orgSlug: string, policyData: QueryParams, queryParams?: QueryParams | undefined): Promise<SocketSdkResult<'updateOrgLicensePolicy'>>;
365
+ streamOrgFullScan(orgSlug: string, fullScanId: string, output?: string | boolean): Promise<SocketSdkResult<'getOrgFullScan'>>;
329
366
  /**
330
- * Get organization triage settings and status.
331
- * Returns alert triage configuration and current state.
367
+ * Stream patches for artifacts in a scan report.
332
368
  *
333
- * @throws {Error} When server returns 5xx status codes
369
+ * This method streams all available patches for artifacts in a scan.
370
+ * Free tier users will only receive free patches.
371
+ *
372
+ * Note: This method returns a ReadableStream for processing large datasets.
334
373
  */
335
- getOrgTriage(orgSlug: string): Promise<SocketSdkResult<'getOrgTriage'>>;
374
+ streamPatchesFromScan(orgSlug: string, scanId: string): Promise<ReadableStream<ArtifactPatches>>;
336
375
  /**
337
376
  * Update alert triage status for an organization.
338
377
  * Modifies alert resolution status and triage decisions.
@@ -341,26 +380,18 @@ export declare class SocketSdk {
341
380
  */
342
381
  updateOrgAlertTriage(orgSlug: string, alertId: string, triageData: QueryParams): Promise<SocketSdkResult<'updateOrgAlertTriage'>>;
343
382
  /**
344
- * Get list of repository labels for an organization.
345
- * Returns all labels configured for repository management.
346
- *
347
- * @throws {Error} When server returns 5xx status codes
348
- */
349
- getOrgRepoLabelList(orgSlug: string, repoSlug: string): Promise<SocketSdkResult<'getOrgRepoLabelList'>>;
350
- /**
351
- * Create a new repository label for an organization.
352
- * Adds label for repository categorization and management.
383
+ * Update organization's license policy configuration.* Modifies allowed, restricted, and monitored license types.
353
384
  *
354
385
  * @throws {Error} When server returns 5xx status codes
355
386
  */
356
- createOrgRepoLabel(orgSlug: string, repoSlug: string, labelData: QueryParams): Promise<SocketSdkResult<'createOrgRepoLabel'>>;
387
+ updateOrgLicensePolicy(orgSlug: string, policyData: QueryParams, queryParams?: QueryParams | undefined): Promise<SocketSdkResult<'updateOrgLicensePolicy'>>;
357
388
  /**
358
- * Get details for a specific repository label.
359
- * Returns label configuration and metadata.
389
+ * Update configuration for an organization repository.
390
+ * Modifies monitoring settings, branch configuration, and scan preferences.
360
391
  *
361
392
  * @throws {Error} When server returns 5xx status codes
362
393
  */
363
- getOrgRepoLabel(orgSlug: string, repoSlug: string, labelSlug: string): Promise<SocketSdkResult<'getOrgRepoLabel'>>;
394
+ updateOrgRepo(orgSlug: string, repoSlug: string, queryParams?: QueryParams | undefined): Promise<SocketSdkResult<'updateOrgRepo'>>;
364
395
  /**
365
396
  * Update a repository label for an organization.
366
397
  * Modifies label properties and configuration.
@@ -369,55 +400,23 @@ export declare class SocketSdk {
369
400
  */
370
401
  updateOrgRepoLabel(orgSlug: string, repoSlug: string, labelSlug: string, labelData: QueryParams): Promise<SocketSdkResult<'updateOrgRepoLabel'>>;
371
402
  /**
372
- * Delete a repository label from an organization.
373
- * Removes label and associated configuration.
374
- *
375
- * @throws {Error} When server returns 5xx status codes
376
- */
377
- deleteOrgRepoLabel(orgSlug: string, repoSlug: string, labelSlug: string): Promise<SocketSdkResult<'deleteOrgRepoLabel'>>;
378
- /**
379
- * Get details for a specific diff scan.
380
- * Returns comparison between two full scans with artifact changes.
381
- *
382
- * @throws {Error} When server returns 5xx status codes
383
- */
384
- getDiffScanById(orgSlug: string, diffScanId: string): Promise<SocketSdkResult<'getDiffScanById'>>;
385
- /**
386
- * Create a diff scan from two full scan IDs.
387
- * Compares two existing full scans to identify changes.
403
+ * Update organization's security policy configuration.* Modifies alert rules, severity thresholds, and enforcement settings.
388
404
  *
389
405
  * @throws {Error} When server returns 5xx status codes
390
406
  */
391
- createOrgDiffScanFromIds(orgSlug: string, queryParams?: QueryParams | undefined): Promise<SocketSdkResult<'createOrgDiffScanFromIds'>>;
407
+ updateOrgSecurityPolicy(orgSlug: string, policyData: QueryParams): Promise<SocketSdkResult<'updateOrgSecurityPolicy'>>;
392
408
  /**
393
- * List all diff scans for an organization.
394
- * Returns paginated list of diff scan metadata and status.
409
+ * Upload manifest files for dependency analysis.
410
+ * Processes package files to create dependency snapshots and security analysis.
395
411
  *
396
412
  * @throws {Error} When server returns 5xx status codes
397
413
  */
398
- listOrgDiffScans(orgSlug: string): Promise<SocketSdkResult<'listOrgDiffScans'>>;
414
+ uploadManifestFiles(orgSlug: string, filepaths: string[], pathsRelativeTo?: string): Promise<UploadManifestFilesReturnType | UploadManifestFilesError>;
399
415
  /**
400
- * Delete a diff scan from an organization.
401
- * Permanently removes diff scan data and results.
416
+ * View detailed information about a specific patch by its UUID.
402
417
  *
403
- * @throws {Error} When server returns 5xx status codes
404
- */
405
- deleteOrgDiffScan(orgSlug: string, diffScanId: string): Promise<SocketSdkResult<'deleteOrgDiffScan'>>;
406
- /**
407
- * Execute a raw GET request to any API endpoint with configurable response type.
408
- * Supports both throwing (default) and non-throwing modes.
409
- * @param urlPath - API endpoint path (e.g., 'organizations')
410
- * @param options - Request options including responseType and throws behavior
411
- * @returns Raw response, parsed data, or SocketSdkGenericResult based on options
412
- */
413
- getApi<T = IncomingMessage>(urlPath: string, options?: GetOptions | undefined): Promise<T | SocketSdkGenericResult<T>>;
414
- /**
415
- * Send POST or PUT request with JSON body and return parsed JSON response.
416
- * Supports both throwing (default) and non-throwing modes.
417
- * @param urlPath - API endpoint path (e.g., 'organizations')
418
- * @param options - Request options including method, body, and throws behavior
419
- * @returns Parsed JSON response or SocketSdkGenericResult based on options
418
+ * This method retrieves comprehensive patch details including files,
419
+ * vulnerabilities, description, license, and tier information.
420
420
  */
421
- sendApi<T>(urlPath: string, options?: SendOptions | undefined): Promise<T | SocketSdkGenericResult<T>>;
421
+ viewPatch(orgSlug: string, uuid: string): Promise<PatchViewResponse>;
422
422
  }
423
- //# sourceMappingURL=socket-sdk-class.d.ts.map