@socketsecurity/sdk 3.3.1 → 3.4.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 CHANGED
@@ -4,6 +4,30 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
6
 
7
+ ## [3.4.1](https://github.com/SocketDev/socket-sdk-js/releases/tag/v3.4.1) - 2026-03-12
8
+
9
+ ### Changed
10
+
11
+ - Synced OpenAPI type definitions with latest API specification
12
+ - Improved documentation for Org Triage API query parameters and request fields
13
+ - Updated `@socketsecurity/lib` to v5.8.1
14
+
15
+ ## [3.4.0](https://github.com/SocketDev/socket-sdk-js/releases/tag/v3.4.0) - 2026-03-11
16
+
17
+ ### Added
18
+
19
+ - **listRepositories**: New `workspace` query parameter to filter repositories by workspace (when provided, only repos in that workspace are returned)
20
+ - New audit log action types for OAuth refresh tokens and repository access rules:
21
+ - `CreateOauthRefreshToken` - Track OAuth refresh token creation
22
+ - `RotateOauthRefreshToken` - Track OAuth refresh token rotation
23
+ - `CreateRepoAccessRule` - Track repository access rule creation
24
+ - `UpdateRepoAccessRule` - Track repository access rule updates
25
+ - `DeleteRepoAccessRule` - Track repository access rule deletion
26
+
27
+ ### Changed
28
+
29
+ - Synced OpenAPI type definitions with latest API specification
30
+
7
31
  ## [3.3.1](https://github.com/SocketDev/socket-sdk-js/releases/tag/v3.3.1) - 2026-03-03
8
32
 
9
33
  ### Changed
@@ -323,6 +347,7 @@ The following methods mapped to deprecated `/report/*` backend endpoints and hav
323
347
  #### Method Renames (Following REST Conventions)
324
348
 
325
349
  **Full Scans (Modern API):**
350
+
326
351
  - `getOrgFullScanList()` → `listFullScans()` with `ListFullScansOptions`
327
352
  - `createOrgFullScan()` → `createFullScan()` with `CreateFullScanOptions`
328
353
  - `getOrgFullScanBuffered()` → `getFullScan()`
@@ -331,9 +356,11 @@ The following methods mapped to deprecated `/report/*` backend endpoints and hav
331
356
  - `getOrgFullScanMetadata()` → `getFullScanMetadata()`
332
357
 
333
358
  **Organizations:**
359
+
334
360
  - `getOrganizations()` → `listOrganizations()`
335
361
 
336
362
  **Repositories:**
363
+
337
364
  - `getOrgRepoList()` → `listRepositories()` with `ListRepositoriesOptions`
338
365
  - `getOrgRepo()` → `getRepository()`
339
366
  - `createOrgRepo()` → `createRepository()`
@@ -355,22 +382,26 @@ Strict types now mark guaranteed API fields as required instead of optional, imp
355
382
  ## [2.0.7](https://github.com/SocketDev/socket-sdk-js/releases/tag/v2.0.7) - 2025-10-22
356
383
 
357
384
  ### Changed
385
+
358
386
  - Sync with openapi definition
359
387
 
360
388
  ## [2.0.6](https://github.com/SocketDev/socket-sdk-js/releases/tag/v2.0.6) - 2025-10-22
361
389
 
362
390
  ### Fixed
391
+
363
392
  - TypeScript lint compliance for array type syntax in `SocketSdkArrayElement` type helper
364
393
 
365
394
  ## [2.0.5](https://github.com/SocketDev/socket-sdk-js/releases/tag/v2.0.5) - 2025-10-22
366
395
 
367
396
  ### Added
397
+
368
398
  - `SocketSdkData<T>` type helper for extracting data from SDK operation results
369
399
  - `SocketSdkArrayElement<T, K>` type helper for extracting array element types from SDK operations
370
400
 
371
401
  ## [2.0.4](https://github.com/SocketDev/socket-sdk-js/releases/tag/v2.0.4) - 2025-10-22
372
402
 
373
403
  ### Added
404
+
374
405
  - Support for `Retry-After` header in rate limit responses (HTTP 429)
375
406
  - Automatically respects server-specified retry delays
376
407
  - Parses both delay-seconds (numeric) and HTTP-date formats
@@ -379,16 +410,19 @@ Strict types now mark guaranteed API fields as required instead of optional, imp
379
410
  ## [2.0.3](https://github.com/SocketDev/socket-sdk-js/releases/tag/v2.0.3) - 2025-10-22
380
411
 
381
412
  ### Fixed
413
+
382
414
  - Improved TypeScript module resolution with explicit type exports instead of wildcard re-exports
383
415
 
384
416
  ## [2.0.2](https://github.com/SocketDev/socket-sdk-js/releases/tag/v2.0.2) - 2025-10-22
385
417
 
386
418
  ### Fixed
419
+
387
420
  - Ensured expected dist/ files are produced and refined package.json exports
388
421
 
389
422
  ## [2.0.1](https://github.com/SocketDev/socket-sdk-js/releases/tag/v2.0.1) - 2025-10-21
390
423
 
391
424
  ### Changed
425
+
392
426
  - Use `@socketsecurity/lib` under the hood
393
427
  - Synced OpenAPI type definitions with latest API specification
394
428
  - Added documentation for `scan_type` query parameter on manifest upload endpoint (used for categorizing multiple SBOM heads per repository branch)
@@ -397,6 +431,7 @@ Strict types now mark guaranteed API fields as required instead of optional, imp
397
431
  ## [2.0.0](https://github.com/SocketDev/socket-sdk-js/releases/tag/v2.0.0) - 2025-10-10
398
432
 
399
433
  ### Changed
434
+
400
435
  - **BREAKING**: Migrated to ESM-only module format
401
436
  - Package is now ESM-only (`"type": "module"` in package.json)
402
437
  - All output files use `.mjs` extension for JavaScript
@@ -407,43 +442,52 @@ Strict types now mark guaranteed API fields as required instead of optional, imp
407
442
  - Improved code splitting for better tree-shaking with ESM
408
443
 
409
444
  ### Removed
445
+
410
446
  - **BREAKING**: Removed CommonJS support and exports
411
447
  - Removed CommonJS-specific build configurations
412
448
 
413
449
  ### Migration Guide
450
+
414
451
  To migrate from v1.x to v2.0:
452
+
415
453
  1. Ensure your project supports ESM modules (Node.js 14+ with `"type": "module"` or `.mjs` extensions)
416
454
  2. Update imports from CommonJS `require()` to ESM `import` statements:
455
+
417
456
  ```javascript
418
457
  // Before (v1.x)
419
- const { SocketSdk } = require('@socketsecurity/sdk');
458
+ const { SocketSdk } = require('@socketsecurity/sdk')
420
459
 
421
460
  // After (v2.0)
422
- import { SocketSdk } from '@socketsecurity/sdk';
461
+ import { SocketSdk } from '@socketsecurity/sdk'
423
462
  ```
463
+
424
464
  3. If your project still requires CommonJS, consider staying on v1.x or using a transpiler
425
465
 
426
466
  ## [1.11.2](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.11.2) - 2025-10-07
427
467
 
428
468
  ### Fixed
469
+
429
470
  - Fixed typos in requirements.json
430
471
  - Updated @socketsecurity/registry to fix bugs related to inlined runtime-dependent expressions
431
472
 
432
473
  ## [1.11.1](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.11.1) - 2025-10-06
433
474
 
434
475
  ### Added
476
+
435
477
  - Performance optimizations with memoization for `normalizeBaseUrl` and quota utility functions
436
478
  - Performance tracking to HTTP client functions
437
479
  - Comprehensive error handling tests for SDK methods across organization, scanning, and batch APIs
438
480
  - Reusable assertion helpers for SDK tests
439
481
 
440
482
  ### Changed
483
+
441
484
  - Improved test coverage and reliability with additional test cases
442
485
  - Streamlined documentation (README, TESTING.md, QUOTA.md, EXAMPLES.md) for better clarity and discoverability
443
486
 
444
487
  ## [1.11.0](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.11.0) - 2025-10-04
445
488
 
446
489
  ### Added
490
+
447
491
  - Optional TTL caching for API responses with configurable cache duration
448
492
  - New `cache` option (default: false) to enable response caching
449
493
  - New `cacheTtl` option (default: 5 minutes) to customize cache duration
@@ -451,16 +495,19 @@ To migrate from v1.x to v2.0:
451
495
  ## [1.10.1](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.10.1) - 2025-10-04
452
496
 
453
497
  ### Added
498
+
454
499
  - Automatic retry with exponential backoff to all HTTP API calls for improved reliability on transient failures
455
500
 
456
501
  ## [1.10.0](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.10.0) - 2025-10-04
457
502
 
458
503
  ### Added
504
+
459
505
  - Added `PromiseQueue` utility for controlled concurrency in async operations
460
506
  - HTTP retry logic with exponential backoff for improved reliability on transient failures
461
507
  - Added option type interfaces: `CreateDependenciesSnapshotOptions`, `CreateOrgFullScanOptions`, `CreateScanFromFilepathsOptions`, `StreamOrgFullScanOptions`, `UploadManifestFilesOptions`
462
508
 
463
509
  ### Changed
510
+
464
511
  - **BREAKING**: Refactored SDK methods to use options objects instead of positional parameters for better API clarity:
465
512
  - `createDependenciesSnapshot(filepaths, options)` - replaced `repo` and `branch` positional parameters with options object
466
513
  - `createOrgFullScan(orgSlug, filepaths, options)` - replaced positional parameters with options object
@@ -473,6 +520,7 @@ To migrate from v1.x to v2.0:
473
520
  - Updated `@socketsecurity/registry` dependency to 1.4.0
474
521
 
475
522
  ### Fixed
523
+
476
524
  - Fixed import assertion syntax for JSON imports to use standard import syntax
477
525
  - Fixed HTTP retry test mocks to correctly match PUT method requests
478
526
  - Fixed critical issues in type handling and URL search parameter conversions
@@ -480,22 +528,26 @@ To migrate from v1.x to v2.0:
480
528
  ## [1.9.2](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.9.2) - 2025-10-04
481
529
 
482
530
  ### Changed
531
+
483
532
  - Improved TypeScript type definitions - All optional properties now include explicit `| undefined` type annotations for better type narrowing and null safety
484
533
 
485
534
  ## [1.9.1](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.9.1) - 2025-10-03
486
535
 
487
536
  ### Changed
537
+
488
538
  - Disabled TypeScript declaration map generation to reduce package size
489
539
 
490
540
  ## [1.9.0](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.9.0) - 2025-10-03
491
541
 
492
542
  ### Changed
543
+
493
544
  - **BREAKING**: Improved `SocketSdkResult` type compatibility - success and error results now have symmetric properties (`data`, `error`, `cause`) with explicit `undefined` types for better TypeScript narrowing
494
545
  - **BREAKING**: Removed `CResult` type (CLI-specific) in favor of SDK-appropriate `SocketSdkGenericResult` type for `getApi()` and `sendApi()` methods
495
546
  - Updated `getApi()` and `sendApi()` to use `SocketSdkGenericResult` with consistent HTTP status codes instead of CLI exit codes
496
547
  - All result types now use `success` discriminant with `status` (HTTP code), `data`, `error`, and `cause` properties on both branches
497
548
 
498
549
  ### Migration Guide
550
+
499
551
  - If using `getApi()` or `sendApi()` with `throws: false`, update from `CResult` to `SocketSdkGenericResult`
500
552
  - Change `.ok` checks to `.success`
501
553
  - Change `.code` to `.status` (now contains HTTP status code)
@@ -505,11 +557,13 @@ To migrate from v1.x to v2.0:
505
557
  ## [1.8.6](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.8.6) - 2025-10-02
506
558
 
507
559
  ### Changed
560
+
508
561
  - Reduced package size by excluding source map files (.js.map) from published package
509
562
 
510
563
  ## [1.8.5](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.8.5) - 2025-10-02
511
564
 
512
565
  ### Changed
566
+
513
567
  - Synced with OpenAPI definition
514
568
  - Added new `/openapi.json` endpoint for retrieving API specification in JSON format
515
569
  - Updated repo label filter descriptions to document empty string ("") usage for repositories with no labels
@@ -518,37 +572,44 @@ To migrate from v1.x to v2.0:
518
572
  ## [1.8.4](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.8.4) - 2025-10-01
519
573
 
520
574
  ### Fixed
575
+
521
576
  - Fixed registry constant import paths to use correct casing (SOCKET_PUBLIC_API_TOKEN, UNKNOWN_ERROR)
522
577
 
523
578
  ## [1.8.3](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.8.3) - 2025-09-30
524
579
 
525
580
  ### Changed
581
+
526
582
  - Synced with OpenAPI definition
527
583
 
528
584
  ## [1.8.2](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.8.2) - 2025-09-29
529
585
 
530
586
  ### Fixed
587
+
531
588
  - Fixed publishing workflow to ensure dist folder is built before npm publish
532
589
  - Changed prepublishOnly script to prevent accidental local publishing
533
590
 
534
591
  ## [1.8.1](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.8.1) - 2025-09-29
535
592
 
536
593
  ### Changed
594
+
537
595
  - Update test infrastructure and build configuration
538
596
 
539
597
  ## [1.8.0](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.8.0) - 2025-09-27
540
598
 
541
599
  ### Added
600
+
542
601
  - Quota utility functions for API cost management in `quota-utils.ts`
543
602
  - New exported functions: `checkQuota`, `formatQuotaReport`, `getEstimatedCost`, `getMethodCost`, `getQuotaSummary`, `isWithinQuota`
544
603
  - Example files demonstrating quota usage patterns
545
604
 
546
605
  ### Changed
606
+
547
607
  - Improved error handling for quota utilities
548
608
 
549
609
  ## [1.7.0](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.7.0) - 2025-09-26
550
610
 
551
611
  ### Added
612
+
552
613
  - `getApi` method for raw GET requests with configurable response handling
553
614
  - `sendApi` method for POST/PUT requests with JSON body support
554
615
  - `CResult` type pattern for non-throwing API operations
@@ -568,6 +629,7 @@ To migrate from v1.x to v2.0:
568
629
  - Additional coverage tests for invalid JSON line handling in NDJSON streams
569
630
 
570
631
  ### Changed
632
+
571
633
  - Improved error message formatting and JSON parsing error handling
572
634
  - Enhanced type safety with better generic constraints
573
635
  - Renamed option types to `GetOptions` and `SendOptions` for consistency
@@ -582,169 +644,203 @@ To migrate from v1.x to v2.0:
582
644
  ## [1.6.1](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.6.1) - 2025-09-24
583
645
 
584
646
  ### Changed
647
+
585
648
  - Updated to use trusted publisher for npm package provenance
586
649
 
587
650
  ## [1.6.0](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.6.0) - 2025-09-24
588
651
 
589
652
  ### Changed
653
+
590
654
  - **BREAKING:** Converted to single CommonJS export type, removing dual ESM/CJS support
591
655
 
592
656
  ## [1.5.1](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.5.1) - 2025-09-24
593
657
 
594
658
  ### Fixed
659
+
595
660
  - Added missing setup-script to provenance workflow
596
661
 
597
662
  ## [1.5.0](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.5.0) - 2025-09-23
598
663
 
599
664
  ### Added
665
+
600
666
  - `getOrgFullScanBuffered` method for buffered full scan retrieval
601
667
 
602
668
  ### Changed
669
+
603
670
  - **BREAKING:** Renamed `getOrgFullScan` to `streamOrgFullScan` for clarity
604
671
 
605
672
  ### Fixed
673
+
606
674
  - Added missing `getResponseJson` call to `createScanFromFilepaths`
607
675
  - Improved handling of empty response bodies
608
676
 
609
677
  ## [1.4.93](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.4.93) - 2025-09-15
610
678
 
611
679
  ### Fixed
680
+
612
681
  - Fixed malformed part header issue for upload of manifest files
613
682
 
614
683
  ## [1.4.91](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.4.91) - 2025-09-11
615
684
 
616
685
  ### Changed
686
+
617
687
  - Improved URL handling
618
688
 
619
689
  ## [1.4.90](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.4.90) - 2025-09-11
620
690
 
621
691
  ### Fixed
692
+
622
693
  - Improved error handling
623
694
 
624
695
  ## [1.4.84](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.4.84) - 2025-09-03
625
696
 
626
697
  ### Added
698
+
627
699
  - Filter alerts by action
628
700
 
629
701
  ### Changed
702
+
630
703
  - Improved JSON parsing
631
704
 
632
705
  ## [1.4.82](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.4.82) - 2025-09-02
633
706
 
634
707
  ### Changed
708
+
635
709
  - Improved public policy handling
636
710
 
637
711
  ## [1.4.81](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.4.81) - 2025-09-02
638
712
 
639
713
  ### Added
714
+
640
715
  - Add public security policy support
641
716
 
642
717
  ## [1.4.79](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.4.79) - 2025-08-27
643
718
 
644
719
  ### Fixed
720
+
645
721
  - Fixed ESM module compatibility
646
722
 
647
723
  ## [1.4.77](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.4.77) - 2025-08-25
648
724
 
649
725
  ### Added
726
+
650
727
  - Add timeout option for API requests
651
728
 
652
729
  ## [1.4.73](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.4.73) - 2025-08-08
653
730
 
654
731
  ### Fixed
732
+
655
733
  - Fixed crates ecosystem support
656
734
 
657
735
  ## [1.4.72](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.4.72) - 2025-08-08
658
736
 
659
737
  ### Fixed
738
+
660
739
  - Fixed rubygems ecosystem support
661
740
 
662
741
  ## [1.4.71](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.4.71) - 2025-08-08
663
742
 
664
743
  ### Added
744
+
665
745
  - Support for crate and rubygem ecosystems
666
746
 
667
747
  ## [1.4.68](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.4.68) - 2025-08-02
668
748
 
669
749
  ### Changed
750
+
670
751
  - Improved type definitions
671
752
  - Memory usage optimizations
672
753
 
673
754
  ## [1.4.66](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.4.66) - 2025-07-29
674
755
 
675
756
  ### Fixed
757
+
676
758
  - Fixed file upload timing issue
677
759
  - Fixed multipart form data formatting
678
760
 
679
761
  ## [1.4.64](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.4.64) - 2025-07-22
680
762
 
681
763
  ### Changed
764
+
682
765
  - Improved method signatures
683
766
 
684
767
  ## [1.4.62](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.4.62) - 2025-07-21
685
768
 
686
769
  ### Fixed
770
+
687
771
  - Fixed query parameter handling for empty values
688
772
 
689
773
  ## [1.4.61](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.4.61) - 2025-07-21
690
774
 
691
775
  ### Changed
776
+
692
777
  - Improved query parameter normalization
693
778
 
694
779
  ## [1.4.60](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.4.60) - 2025-07-21
695
780
 
696
781
  ### Changed
782
+
697
783
  - Renamed result type for clarity
698
784
 
699
785
  ## [1.4.59](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.4.59) - 2025-07-20
700
786
 
701
787
  ### Added
788
+
702
789
  - Add alias types for improved developer experience
703
790
 
704
791
  ## [1.4.0](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.4.0) - 2025-05-01
705
792
 
706
793
  ### Added
794
+
707
795
  - Full scans feature support
708
796
  - Audit log and repos features
709
797
  - Organization security policy support (getOrgSecurityPolicy)
710
798
 
711
799
  ### Changed
800
+
712
801
  - Improved TypeScript type exports
713
802
  - Enhanced ESM and CJS dual package support
714
803
 
715
804
  ## [1.3.0](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.3.0) - 2025-03-01
716
805
 
717
806
  ### Added
807
+
718
808
  - Support for multiple ecosystem types
719
809
  - Enhanced error handling and reporting
720
810
 
721
811
  ### Changed
812
+
722
813
  - Improved API client architecture
723
814
  - Better TypeScript type definitions
724
815
 
725
816
  ## [1.2.0](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.2.0) - 2025-01-15
726
817
 
727
818
  ### Added
819
+
728
820
  - File upload support for manifest files
729
821
  - Request body creation for file paths
730
822
 
731
823
  ### Changed
824
+
732
825
  - Enhanced multipart form data handling
733
826
  - Improved streaming support
734
827
 
735
828
  ## [1.1.0](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.1.0) - 2024-11-01
736
829
 
737
830
  ### Added
831
+
738
832
  - Query parameter normalization
739
833
  - Enhanced search parameter handling
740
834
 
741
835
  ### Changed
836
+
742
837
  - Improved URL parsing and handling
743
838
  - Better error messages
744
839
 
745
840
  ## [1.0.0](https://github.com/SocketDev/socket-sdk-js/releases/tag/v1.0.0) - 2024-09-01
746
841
 
747
842
  ### Added
843
+
748
844
  - Initial release of Socket SDK for JavaScript
749
845
  - Full Socket API client implementation
750
846
  - TypeScript support with comprehensive type definitions
package/README.md CHANGED
@@ -21,9 +21,9 @@ pnpm add @socketsecurity/sdk
21
21
  import { SocketSdk } from '@socketsecurity/sdk'
22
22
 
23
23
  const client = new SocketSdk('your-api-key', {
24
- retries: 3, // Retry failed requests up to 3 times
25
- retryDelay: 1000, // Start with 1s delay, exponential backoff
26
- timeout: 30000, // 30 second timeout
24
+ retries: 3, // Retry failed requests up to 3 times
25
+ retryDelay: 1000, // Start with 1s delay, exponential backoff
26
+ timeout: 30000, // 30 second timeout
27
27
  })
28
28
 
29
29
  // Check your quota
@@ -42,16 +42,16 @@ if (result.success) {
42
42
  const batchResult = await client.batchPackageFetch({
43
43
  components: [
44
44
  { purl: 'pkg:npm/express@4.18.0' },
45
- { purl: 'pkg:npm/react@18.0.0' }
46
- ]
45
+ { purl: 'pkg:npm/react@18.0.0' },
46
+ ],
47
47
  })
48
48
  ```
49
49
 
50
50
  ## Documentation
51
51
 
52
- | Guide | Description |
53
- |-------|-------------|
54
- | **[API Reference](./docs/api-reference.md)** | Complete API method documentation |
52
+ | Guide | Description |
53
+ | -------------------------------------------------- | ----------------------------------- |
54
+ | **[API Reference](./docs/api-reference.md)** | Complete API method documentation |
55
55
  | **[Quota Management](./docs/quota-management.md)** | Cost tiers (0/10/100) and utilities |
56
56
 
57
57
  ## License
package/dist/index.js CHANGED
@@ -71,20 +71,26 @@ module.exports = __toCommonJS(index_exports);
71
71
  // package.json
72
72
  var package_default = {
73
73
  name: "@socketsecurity/sdk",
74
- version: "3.3.1",
75
- packageManager: "pnpm@10.30.3",
76
- license: "MIT",
74
+ version: "3.4.1",
77
75
  description: "SDK for the Socket API client",
76
+ homepage: "https://github.com/SocketDev/socket-sdk-js",
77
+ license: "MIT",
78
78
  author: {
79
79
  name: "Socket Inc",
80
80
  email: "eng@socket.dev",
81
81
  url: "https://socket.dev"
82
82
  },
83
- homepage: "https://github.com/SocketDev/socket-sdk-js",
84
83
  repository: {
85
84
  type: "git",
86
85
  url: "git://github.com/SocketDev/socket-sdk-js.git"
87
86
  },
87
+ files: [
88
+ "CHANGELOG.md",
89
+ "data/*.json",
90
+ "dist/*.d.ts",
91
+ "dist/*.js",
92
+ "types/*.d.ts"
93
+ ],
88
94
  main: "./dist/index.js",
89
95
  types: "./dist/index.d.ts",
90
96
  exports: {
@@ -113,6 +119,8 @@ var package_default = {
113
119
  clean: "node scripts/clean.mjs",
114
120
  cover: "node scripts/cover.mjs",
115
121
  fix: "node scripts/lint.mjs --fix",
122
+ format: "oxfmt .",
123
+ "format:check": "oxfmt --check .",
116
124
  "generate-sdk": "node scripts/generate-sdk.mjs",
117
125
  lint: "node scripts/lint.mjs",
118
126
  precommit: "pnpm run check --lint --staged",
@@ -120,7 +128,7 @@ var package_default = {
120
128
  "ci:validate": "node scripts/ci-validate.mjs",
121
129
  prepublishOnly: "echo 'ERROR: Use GitHub Actions workflow for publishing' && exit 1",
122
130
  publish: "node scripts/publish.mjs",
123
- "publish:ci": "node scripts/publish.mjs --skip-git --skip-build --tag ${DIST_TAG:-latest}",
131
+ "publish:ci": "node scripts/publish.mjs --tag ${DIST_TAG:-latest}",
124
132
  claude: "node scripts/claude.mjs",
125
133
  test: "node scripts/test.mjs",
126
134
  type: "tsgo --noEmit -p .config/tsconfig.check.json",
@@ -128,7 +136,7 @@ var package_default = {
128
136
  },
129
137
  dependencies: {
130
138
  "@socketregistry/packageurl-js": "1.3.5",
131
- "@socketsecurity/lib": "5.7.0",
139
+ "@socketsecurity/lib": "5.8.1",
132
140
  "form-data": "4.0.5"
133
141
  },
134
142
  devDependencies: {
@@ -136,10 +144,8 @@ var package_default = {
136
144
  "@babel/parser": "7.26.3",
137
145
  "@babel/traverse": "7.26.4",
138
146
  "@babel/types": "7.26.3",
139
- "@biomejs/biome": "2.2.4",
140
- "@dotenvx/dotenvx": "^1.52.0",
141
- "@eslint/compat": "1.3.2",
142
- "@eslint/js": "9.35.0",
147
+ "@dotenvx/dotenvx": "1.54.1",
148
+ "@oxlint/migrate": "1.52.0",
143
149
  "@sveltejs/acorn-typescript": "1.0.8",
144
150
  "@types/babel__traverse": "7.28.0",
145
151
  "@types/node": "24.9.2",
@@ -149,26 +155,35 @@ var package_default = {
149
155
  del: "8.0.1",
150
156
  "dev-null-cli": "2.0.0",
151
157
  esbuild: "0.25.11",
152
- eslint: "9.35.0",
153
- "eslint-import-resolver-typescript": "4.4.4",
154
- "eslint-plugin-import-x": "4.16.1",
155
- "eslint-plugin-jsdoc": "57.0.8",
156
- "eslint-plugin-n": "17.23.1",
157
- "eslint-plugin-sort-destructure-keys": "2.0.0",
158
- "eslint-plugin-unicorn": "56.0.1",
159
158
  "fast-glob": "3.3.3",
160
- globals: "16.4.0",
161
159
  "http2-wrapper": "2.2.1",
162
160
  husky: "9.1.7",
163
161
  "magic-string": "0.30.14",
164
162
  nock: "14.0.10",
165
163
  "openapi-typescript": "6.7.6",
164
+ oxfmt: "0.37.0",
165
+ oxlint: "1.52.0",
166
166
  semver: "7.7.2",
167
167
  taze: "19.9.2",
168
168
  "type-coverage": "2.29.7",
169
- "typescript-eslint": "8.44.1",
170
169
  vitest: "4.0.3"
171
170
  },
171
+ typeCoverage: {
172
+ atLeast: 99,
173
+ cache: true,
174
+ "ignore-files": "test/*",
175
+ "ignore-non-null-assertion": true,
176
+ "ignore-type-assertion": true,
177
+ ignoreAsAssertion: true,
178
+ ignoreCatch: true,
179
+ ignoreEmptyType: true,
180
+ strict: true
181
+ },
182
+ engines: {
183
+ node: ">=18",
184
+ pnpm: ">=10.25.0"
185
+ },
186
+ packageManager: "pnpm@10.32.1",
172
187
  pnpm: {
173
188
  ignoredBuiltDependencies: [
174
189
  "esbuild",
@@ -177,28 +192,6 @@ var package_default = {
177
192
  overrides: {
178
193
  vite: "7.1.12"
179
194
  }
180
- },
181
- engines: {
182
- node: ">=18",
183
- pnpm: ">=10.25.0"
184
- },
185
- files: [
186
- "CHANGELOG.md",
187
- "data/*.json",
188
- "dist/*.d.ts",
189
- "dist/*.js",
190
- "types/*.d.ts"
191
- ],
192
- typeCoverage: {
193
- cache: true,
194
- atLeast: 99,
195
- ignoreAsAssertion: true,
196
- ignoreCatch: true,
197
- ignoreEmptyType: true,
198
- "ignore-non-null-assertion": true,
199
- "ignore-type-assertion": true,
200
- "ignore-files": "test/*",
201
- strict: true
202
195
  }
203
196
  };
204
197
 
@@ -95,6 +95,7 @@ export type ListRepositoriesOptions = {
95
95
  page?: number | undefined;
96
96
  per_page?: number | undefined;
97
97
  sort?: string | undefined;
98
+ workspace?: string | undefined;
98
99
  };
99
100
  /**
100
101
  * Strict type for organization item.
package/package.json CHANGED
@@ -1,19 +1,25 @@
1
1
  {
2
2
  "name": "@socketsecurity/sdk",
3
- "version": "3.3.1",
4
- "packageManager": "pnpm@10.30.3",
5
- "license": "MIT",
3
+ "version": "3.4.1",
6
4
  "description": "SDK for the Socket API client",
5
+ "homepage": "https://github.com/SocketDev/socket-sdk-js",
6
+ "license": "MIT",
7
7
  "author": {
8
8
  "name": "Socket Inc",
9
9
  "email": "eng@socket.dev",
10
10
  "url": "https://socket.dev"
11
11
  },
12
- "homepage": "https://github.com/SocketDev/socket-sdk-js",
13
12
  "repository": {
14
13
  "type": "git",
15
14
  "url": "git://github.com/SocketDev/socket-sdk-js.git"
16
15
  },
16
+ "files": [
17
+ "CHANGELOG.md",
18
+ "data/*.json",
19
+ "dist/*.d.ts",
20
+ "dist/*.js",
21
+ "types/*.d.ts"
22
+ ],
17
23
  "main": "./dist/index.js",
18
24
  "types": "./dist/index.d.ts",
19
25
  "exports": {
@@ -42,6 +48,8 @@
42
48
  "clean": "node scripts/clean.mjs",
43
49
  "cover": "node scripts/cover.mjs",
44
50
  "fix": "node scripts/lint.mjs --fix",
51
+ "format": "oxfmt .",
52
+ "format:check": "oxfmt --check .",
45
53
  "generate-sdk": "node scripts/generate-sdk.mjs",
46
54
  "lint": "node scripts/lint.mjs",
47
55
  "precommit": "pnpm run check --lint --staged",
@@ -49,7 +57,7 @@
49
57
  "ci:validate": "node scripts/ci-validate.mjs",
50
58
  "prepublishOnly": "echo 'ERROR: Use GitHub Actions workflow for publishing' && exit 1",
51
59
  "publish": "node scripts/publish.mjs",
52
- "publish:ci": "node scripts/publish.mjs --skip-git --skip-build --tag ${DIST_TAG:-latest}",
60
+ "publish:ci": "node scripts/publish.mjs --tag ${DIST_TAG:-latest}",
53
61
  "claude": "node scripts/claude.mjs",
54
62
  "test": "node scripts/test.mjs",
55
63
  "type": "tsgo --noEmit -p .config/tsconfig.check.json",
@@ -57,7 +65,7 @@
57
65
  },
58
66
  "dependencies": {
59
67
  "@socketregistry/packageurl-js": "1.3.5",
60
- "@socketsecurity/lib": "5.7.0",
68
+ "@socketsecurity/lib": "5.8.1",
61
69
  "form-data": "4.0.5"
62
70
  },
63
71
  "devDependencies": {
@@ -65,10 +73,8 @@
65
73
  "@babel/parser": "7.26.3",
66
74
  "@babel/traverse": "7.26.4",
67
75
  "@babel/types": "7.26.3",
68
- "@biomejs/biome": "2.2.4",
69
- "@dotenvx/dotenvx": "^1.52.0",
70
- "@eslint/compat": "1.3.2",
71
- "@eslint/js": "9.35.0",
76
+ "@dotenvx/dotenvx": "1.54.1",
77
+ "@oxlint/migrate": "1.52.0",
72
78
  "@sveltejs/acorn-typescript": "1.0.8",
73
79
  "@types/babel__traverse": "7.28.0",
74
80
  "@types/node": "24.9.2",
@@ -78,26 +84,35 @@
78
84
  "del": "8.0.1",
79
85
  "dev-null-cli": "2.0.0",
80
86
  "esbuild": "0.25.11",
81
- "eslint": "9.35.0",
82
- "eslint-import-resolver-typescript": "4.4.4",
83
- "eslint-plugin-import-x": "4.16.1",
84
- "eslint-plugin-jsdoc": "57.0.8",
85
- "eslint-plugin-n": "17.23.1",
86
- "eslint-plugin-sort-destructure-keys": "2.0.0",
87
- "eslint-plugin-unicorn": "56.0.1",
88
87
  "fast-glob": "3.3.3",
89
- "globals": "16.4.0",
90
88
  "http2-wrapper": "2.2.1",
91
89
  "husky": "9.1.7",
92
90
  "magic-string": "0.30.14",
93
91
  "nock": "14.0.10",
94
92
  "openapi-typescript": "6.7.6",
93
+ "oxfmt": "0.37.0",
94
+ "oxlint": "1.52.0",
95
95
  "semver": "7.7.2",
96
96
  "taze": "19.9.2",
97
97
  "type-coverage": "2.29.7",
98
- "typescript-eslint": "8.44.1",
99
98
  "vitest": "4.0.3"
100
99
  },
100
+ "typeCoverage": {
101
+ "atLeast": 99,
102
+ "cache": true,
103
+ "ignore-files": "test/*",
104
+ "ignore-non-null-assertion": true,
105
+ "ignore-type-assertion": true,
106
+ "ignoreAsAssertion": true,
107
+ "ignoreCatch": true,
108
+ "ignoreEmptyType": true,
109
+ "strict": true
110
+ },
111
+ "engines": {
112
+ "node": ">=18",
113
+ "pnpm": ">=10.25.0"
114
+ },
115
+ "packageManager": "pnpm@10.32.1",
101
116
  "pnpm": {
102
117
  "ignoredBuiltDependencies": [
103
118
  "esbuild",
@@ -106,27 +121,5 @@
106
121
  "overrides": {
107
122
  "vite": "7.1.12"
108
123
  }
109
- },
110
- "engines": {
111
- "node": ">=18",
112
- "pnpm": ">=10.25.0"
113
- },
114
- "files": [
115
- "CHANGELOG.md",
116
- "data/*.json",
117
- "dist/*.d.ts",
118
- "dist/*.js",
119
- "types/*.d.ts"
120
- ],
121
- "typeCoverage": {
122
- "cache": true,
123
- "atLeast": 99,
124
- "ignoreAsAssertion": true,
125
- "ignoreCatch": true,
126
- "ignoreEmptyType": true,
127
- "ignore-non-null-assertion": true,
128
- "ignore-type-assertion": true,
129
- "ignore-files": "test/*",
130
- "strict": true
131
124
  }
132
125
  }
package/types/api.d.ts CHANGED
@@ -466,7 +466,7 @@ export interface paths {
466
466
  '/orgs/{org_slug}/triage/alerts': {
467
467
  /**
468
468
  * List Org Alert Triage
469
- * @description Get alert triage actions for an organization.
469
+ * @description List triage actions for an organization. Results are paginated and can be sorted by created_at or updated_at.
470
470
  *
471
471
  * This endpoint consumes 1 unit of your quota.
472
472
  *
@@ -475,8 +475,8 @@ export interface paths {
475
475
  */
476
476
  get: operations['getOrgTriage']
477
477
  /**
478
- * Update Org Alert Triage
479
- * @description Update triage actions on organization alerts.
478
+ * Create/Update Org Alert Triage
479
+ * @description Create or update triage actions on organization alerts. Accepts a batch of triage entries. Omit `uuid` to create a new entry; provide an existing `uuid` to update it. Use `?force=true` for broad triages that lack a specific `alertKey` or granular package information.
480
480
  *
481
481
  * This endpoint consumes 1 unit of your quota.
482
482
  *
@@ -7477,7 +7477,7 @@ export interface operations {
7477
7477
  }
7478
7478
  /**
7479
7479
  * List Org Alert Triage
7480
- * @description Get alert triage actions for an organization.
7480
+ * @description List triage actions for an organization. Results are paginated and can be sorted by created_at or updated_at.
7481
7481
  *
7482
7482
  * This endpoint consumes 1 unit of your quota.
7483
7483
  *
@@ -7487,9 +7487,13 @@ export interface operations {
7487
7487
  getOrgTriage: {
7488
7488
  parameters: {
7489
7489
  query?: {
7490
+ /** @description Field to sort by. One of: created_at, updated_at. */
7490
7491
  sort?: string
7492
+ /** @description Sort direction. One of: asc, desc. */
7491
7493
  direction?: string
7494
+ /** @description Number of results per page (1–100, default 30). */
7492
7495
  per_page?: number
7496
+ /** @description Page number (1-based). */
7493
7497
  page?: number
7494
7498
  }
7495
7499
  path: {
@@ -7612,8 +7616,8 @@ export interface operations {
7612
7616
  }
7613
7617
  }
7614
7618
  /**
7615
- * Update Org Alert Triage
7616
- * @description Update triage actions on organization alerts.
7619
+ * Create/Update Org Alert Triage
7620
+ * @description Create or update triage actions on organization alerts. Accepts a batch of triage entries. Omit `uuid` to create a new entry; provide an existing `uuid` to update it. Use `?force=true` for broad triages that lack a specific `alertKey` or granular package information.
7617
7621
  *
7618
7622
  * This endpoint consumes 1 unit of your quota.
7619
7623
  *
@@ -7635,19 +7639,40 @@ export interface operations {
7635
7639
  content: {
7636
7640
  'application/json': {
7637
7641
  alertTriage: Array<{
7638
- /** @default */
7642
+ /**
7643
+ * @description The UUID of the triage entry. Omit to create a new entry; provide to update an existing one.
7644
+ * @default
7645
+ */
7639
7646
  uuid?: string | null
7640
- /** @default */
7647
+ /**
7648
+ * @description The package ecosystem type (e.g., npm, pypi). Use null or "*" for wildcard.
7649
+ * @default
7650
+ */
7641
7651
  packageType?: string | null
7642
- /** @default */
7652
+ /**
7653
+ * @description The package namespace or scope. Use null or "*" for wildcard.
7654
+ * @default
7655
+ */
7643
7656
  packageNamespace?: string | null
7644
- /** @default */
7657
+ /**
7658
+ * @description The package name. Use null or "*" for wildcard.
7659
+ * @default
7660
+ */
7645
7661
  packageName?: string | null
7646
- /** @default */
7662
+ /**
7663
+ * @description The package version. Supports a "*" suffix for wildcard prefix matching. Use null for any version.
7664
+ * @default
7665
+ */
7647
7666
  packageVersion?: string | null
7648
- /** @default */
7667
+ /**
7668
+ * @description The specific alert key to target.
7669
+ * @default
7670
+ */
7649
7671
  alertKey?: string | null
7650
- /** @default */
7672
+ /**
7673
+ * @description The alert type (e.g., criticalCVE, highCVE).
7674
+ * @default
7675
+ */
7651
7676
  alertType?: string | null
7652
7677
  /**
7653
7678
  * @description Whether a fix is available, unavailable, or * for any
@@ -7664,16 +7689,25 @@ export interface operations {
7664
7689
  * @enum {string}
7665
7690
  */
7666
7691
  kevs?: 'exist' | 'none' | '*'
7667
- /** @default */
7692
+ /**
7693
+ * @description CVE or GHSA ID to match against.
7694
+ * @default
7695
+ */
7668
7696
  cveOrGhsaId?: string | null
7669
7697
  /**
7670
7698
  * @description The reachability of the alert, can be reachable, unreachable, other, or * for any
7671
7699
  * @enum {string}
7672
7700
  */
7673
7701
  reachability?: 'reachable' | 'unreachable' | 'other' | '*'
7674
- /** @default */
7702
+ /**
7703
+ * @description CVSS score comparison operator and value (e.g., >=7.5, >5.0, ==8.0).
7704
+ * @default
7705
+ */
7675
7706
  cvssScoreCmp?: string | null
7676
- /** @default */
7707
+ /**
7708
+ * @description A note or comment for the triage action.
7709
+ * @default
7710
+ */
7677
7711
  note?: string
7678
7712
  /**
7679
7713
  * @description The triage state of the alert
@@ -7754,6 +7788,8 @@ export interface operations {
7754
7788
  page?: number
7755
7789
  /** @description Include archived repositories in the results */
7756
7790
  include_archived?: boolean
7791
+ /** @description Filter repositories by workspace. When provided (including empty string), only repos in that workspace are returned. */
7792
+ workspace?: string
7757
7793
  }
7758
7794
  path: {
7759
7795
  /** @description The slug of the organization */
@@ -15274,12 +15310,15 @@ export interface operations {
15274
15310
  | 'CreateApiToken'
15275
15311
  | 'CreateArtifact'
15276
15312
  | 'CreateLabel'
15313
+ | 'CreateOauthRefreshToken'
15314
+ | 'CreateRepoAccessRule'
15277
15315
  | 'CreateWebhook'
15278
15316
  | 'DeleteAlertTriage'
15279
15317
  | 'DeleteApiToken'
15280
15318
  | 'DeleteFullScan'
15281
15319
  | 'DeleteLabel'
15282
15320
  | 'DeleteLabelSetting'
15321
+ | 'DeleteRepoAccessRule'
15283
15322
  | 'DeleteReport'
15284
15323
  | 'DeleteRepository'
15285
15324
  | 'DeleteWebhook'
@@ -15293,6 +15332,7 @@ export interface operations {
15293
15332
  | 'RemoveMember'
15294
15333
  | 'ResetInvitationLink'
15295
15334
  | 'ResetOrganizationSettingToDefault'
15335
+ | 'RotateOauthRefreshToken'
15296
15336
  | 'RevokeApiToken'
15297
15337
  | 'RotateApiToken'
15298
15338
  | 'SendInvitation'
@@ -15310,6 +15350,7 @@ export interface operations {
15310
15350
  | 'UpdateLabelSetting'
15311
15351
  | 'UpdateLicenseOverlay'
15312
15352
  | 'UpdateOrganizationSetting'
15353
+ | 'UpdateRepoAccessRule'
15313
15354
  | 'UpdateWebhook'
15314
15355
  | 'UpgradeOrganizationPlan'
15315
15356
  /** @description Number of events per page */