@socketsecurity/sdk 1.10.1 → 1.11.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@socketsecurity/sdk",
3
- "version": "1.10.1",
3
+ "version": "1.11.1",
4
4
  "license": "MIT",
5
5
  "description": "SDK for the Socket API client",
6
6
  "author": {
@@ -21,6 +21,10 @@
21
21
  "types": "./dist/index.d.ts",
22
22
  "default": "./dist/index.js"
23
23
  },
24
+ "./testing": {
25
+ "types": "./dist/testing.d.ts",
26
+ "default": "./dist/testing.js"
27
+ },
24
28
  "./types/api-helpers": "./types/api-helpers.d.ts",
25
29
  "./types/api-helpers.d.ts": "./types/api-helpers.d.ts",
26
30
  "./types/api": "./types/api.d.ts",
@@ -28,7 +32,10 @@
28
32
  "./package.json": "./package.json"
29
33
  },
30
34
  "scripts": {
31
- "build": "pnpm run clean:dist && tsgo --build .config/tsconfig.json",
35
+ "build": "pnpm run build:dist",
36
+ "build:dist": "pnpm run build:dist:src && pnpm run build:dist:types",
37
+ "build:dist:src": "pnpm run clean:dist && rollup -c .config/rollup.dist.config.mjs",
38
+ "build:dist:types": "pnpm run clean:dist:types && tsgo --project tsconfig.dts.json",
32
39
  "check": "run-p -c --aggregate-output check:*",
33
40
  "check:lint": "eslint --config .config/eslint.config.mjs --report-unused-disable-directives .",
34
41
  "check:lint:fix": "pnpm run check:lint -- --fix",
@@ -43,6 +50,7 @@
43
50
  "clean:cache": "del-cli '**/.cache'",
44
51
  "clean:coverage": "del-cli '.type-coverage' 'coverage'",
45
52
  "clean:dist": "del-cli 'dist' '**/*.tsbuildinfo' '.config/*.tsbuildinfo'",
53
+ "clean:dist:types": "del-cli 'dist/types'",
46
54
  "clean:declarations": "del-cli '*.d.ts' '!api*.d.ts'",
47
55
  "clean:node_modules": "del-cli '**/node_modules'",
48
56
  "fix": "run-s lint:fix",
@@ -70,19 +78,27 @@
70
78
  "test-ci": "dotenvx -q run -f .env.test -- vitest --run",
71
79
  "type-ci": "pnpm run check:tsc",
72
80
  "test-pre-commit": "dotenvx -q run -f .env.precommit -- pnpm test",
73
- "update": "run-p --aggregate-output update:**",
81
+ "update": "run-p --aggregate-output update:*",
74
82
  "update:deps": "node scripts/taze.mjs",
75
83
  "update:socket": "pnpm -r update '@socketsecurity/*' --latest"
76
84
  },
77
85
  "dependencies": {
78
- "@socketsecurity/registry": "1.4.1"
86
+ "@socketsecurity/registry": "1.5.1"
79
87
  },
80
88
  "devDependencies": {
89
+ "@babel/core": "7.28.4",
90
+ "@babel/plugin-transform-runtime": "7.28.3",
91
+ "@babel/preset-typescript": "7.27.1",
92
+ "@babel/runtime": "7.28.4",
81
93
  "@biomejs/biome": "2.2.4",
82
94
  "@dotenvx/dotenvx": "1.49.0",
83
95
  "@eslint/compat": "1.3.2",
84
96
  "@eslint/js": "9.35.0",
85
- "@types/node": "24.5.2",
97
+ "@rollup/plugin-babel": "6.0.4",
98
+ "@rollup/plugin-commonjs": "28.0.6",
99
+ "@rollup/plugin-json": "6.1.0",
100
+ "@rollup/plugin-node-resolve": "16.0.1",
101
+ "@types/node": "24.6.2",
86
102
  "@typescript-eslint/eslint-plugin": "8.44.1",
87
103
  "@typescript-eslint/parser": "8.44.1",
88
104
  "@typescript/native-preview": "7.0.0-dev.20250926.1",
@@ -106,6 +122,7 @@
106
122
  "npm-run-all2": "8.0.4",
107
123
  "openapi-typescript": "6.7.6",
108
124
  "oxlint": "1.15.0",
125
+ "rollup": "4.50.1",
109
126
  "taze": "19.6.0",
110
127
  "trash": "10.0.0",
111
128
  "type-coverage": "2.29.7",
@@ -117,7 +134,11 @@
117
134
  "pnpm": {
118
135
  "overrides": {
119
136
  "vite": "7.1.5"
120
- }
137
+ },
138
+ "ignoredBuiltDependencies": [
139
+ "esbuild",
140
+ "unrs-resolver"
141
+ ]
121
142
  },
122
143
  "engines": {
123
144
  "node": ">=18",
@@ -1,91 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PromiseQueue = void 0;
4
- class PromiseQueue {
5
- queue = [];
6
- running = 0;
7
- maxConcurrency;
8
- maxQueueLength;
9
- /**
10
- * Creates a new PromiseQueue
11
- * @param maxConcurrency - Maximum number of promises that can run concurrently
12
- * @param maxQueueLength - Maximum queue size (older tasks are dropped if exceeded)
13
- */
14
- constructor(maxConcurrency, maxQueueLength) {
15
- this.maxConcurrency = maxConcurrency;
16
- this.maxQueueLength = maxQueueLength;
17
- if (maxConcurrency < 1) {
18
- throw new Error('maxConcurrency must be at least 1');
19
- }
20
- }
21
- /**
22
- * Add a task to the queue
23
- * @param fn - Async function to execute
24
- * @returns Promise that resolves with the function's result
25
- */
26
- async add(fn) {
27
- return await new Promise((resolve, reject) => {
28
- const task = { fn, resolve, reject };
29
- if (this.maxQueueLength && this.queue.length >= this.maxQueueLength) {
30
- // Drop oldest task to prevent memory buildup
31
- this.queue.shift();
32
- }
33
- this.queue.push(task);
34
- this.runNext();
35
- });
36
- }
37
- runNext() {
38
- if (this.running >= this.maxConcurrency || this.queue.length === 0) {
39
- return;
40
- }
41
- const task = this.queue.shift();
42
- /* c8 ignore next 3 - Defensive check; unreachable since we verify queue.length above */
43
- if (!task) {
44
- return;
45
- }
46
- this.running++;
47
- task
48
- .fn()
49
- .then(task.resolve)
50
- .catch(task.reject)
51
- .finally(() => {
52
- this.running--;
53
- this.runNext();
54
- });
55
- }
56
- /**
57
- * Wait for all queued and running tasks to complete
58
- */
59
- async onIdle() {
60
- return await new Promise(resolve => {
61
- const check = () => {
62
- if (this.running === 0 && this.queue.length === 0) {
63
- resolve();
64
- }
65
- else {
66
- setImmediate(check);
67
- }
68
- };
69
- check();
70
- });
71
- }
72
- /**
73
- * Get the number of tasks currently running
74
- */
75
- get activeCount() {
76
- return this.running;
77
- }
78
- /**
79
- * Get the number of tasks waiting in the queue
80
- */
81
- get pendingCount() {
82
- return this.queue.length;
83
- }
84
- /**
85
- * Clear all pending tasks from the queue (does not affect running tasks)
86
- */
87
- clear() {
88
- this.queue = [];
89
- }
90
- }
91
- exports.PromiseQueue = PromiseQueue;
package/dist/types.js DELETED
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /* c8 ignore stop */