@http-forge/core 0.6.41 → 0.7.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.
Files changed (29) hide show
  1. package/README.md +1 -0
  2. package/dist/di/service-container.d.ts +3 -1
  3. package/dist/di/service-identifiers.d.ts +2 -0
  4. package/dist/index.d.ts +6 -1
  5. package/dist/index.js +199 -198
  6. package/dist/index.mjs +189 -188
  7. package/dist/infrastructure/config/config.interface.d.ts +9 -1
  8. package/dist/infrastructure/execution/collection-request-executor.d.ts +4 -1
  9. package/dist/infrastructure/history/request-history-service-interfaces.d.ts +1 -1
  10. package/dist/infrastructure/history/request-history-service.d.ts +1 -1
  11. package/dist/infrastructure/script/script-executor.d.ts +10 -1
  12. package/dist/infrastructure/secrets/aws-secret-resolver.d.ts +5 -1
  13. package/dist/infrastructure/secrets/azure-keyvault-resolver.d.ts +1 -0
  14. package/dist/infrastructure/secrets/doppler-resolver.d.ts +5 -1
  15. package/dist/infrastructure/secrets/gcp-secret-resolver.d.ts +1 -0
  16. package/dist/infrastructure/secrets/hashicorp-vault-resolver.d.ts +4 -4
  17. package/dist/infrastructure/secrets/onepassword-resolver.d.ts +21 -6
  18. package/dist/infrastructure/secrets/secret-resolver-registry.d.ts +25 -3
  19. package/dist/infrastructure/security/secret-values.d.ts +26 -0
  20. package/dist/infrastructure/security/sensitive-data-redactor.d.ts +15 -6
  21. package/dist/infrastructure/websocket/node-socketio-client.d.ts +18 -0
  22. package/dist/infrastructure/websocket/node-websocket-client.d.ts +20 -0
  23. package/dist/infrastructure/websocket/socketio-request-runner.d.ts +15 -0
  24. package/dist/infrastructure/websocket/websocket-request-runner.d.ts +26 -0
  25. package/dist/runtime/execution-helpers.d.ts +9 -1
  26. package/dist/types/platform.d.ts +81 -1
  27. package/dist/types/secret-resolver.d.ts +40 -5
  28. package/dist/types/types.d.ts +148 -0
  29. package/package.json +10 -3
@@ -57,6 +57,12 @@ export interface OperationResponse {
57
57
  examples?: Record<string, any>;
58
58
  headers?: Record<string, KeyValueEntry>;
59
59
  }
60
+ /**
61
+ * Request transport. HTTP requests use `method` as the HTTP verb; WebSocket
62
+ * requests use `method: 'GET'` for the handshake and keep their socket-specific
63
+ * configuration in `websocket`.
64
+ */
65
+ export type RequestType = 'http' | 'websocket';
60
66
  /**
61
67
  * Unified Request - normalized request format
62
68
  * Supports full feature set from CollectionRequest with metadata preservation
@@ -67,6 +73,7 @@ export interface UnifiedRequest {
67
73
  name: string;
68
74
  description?: string;
69
75
  doc?: string;
76
+ requestType?: RequestType;
70
77
  method: string;
71
78
  url: string;
72
79
  /** Headers with per-header enabled/disabled flag and OpenAPI metadata */
@@ -81,6 +88,8 @@ export interface UnifiedRequest {
81
88
  auth?: CollectionAuth;
82
89
  settings?: RequestSettings;
83
90
  scripts?: CollectionScripts;
91
+ /** WebSocket-specific configuration when requestType is 'websocket'. */
92
+ websocket?: WebSocketRequestConfig;
84
93
  /** Mark request as disabled (not editable via UI) */
85
94
  disabled?: boolean;
86
95
  /** Mark request as deprecated */
@@ -179,6 +188,141 @@ export interface GraphQLContent {
179
188
  variables?: Record<string, unknown>;
180
189
  operationName?: string;
181
190
  }
191
+ /**
192
+ * WebSocket request flavor. Raw WebSocket and Socket.IO share the WebSocket
193
+ * transport but expose different composer/listener UI.
194
+ */
195
+ export type WebSocketProtocol = 'websocket' | 'socketio';
196
+ /** Presentation/validation format for a WebSocket message. */
197
+ export type WebSocketMessageFormat = 'text' | 'json' | 'xml' | 'html' | 'binary';
198
+ /** Encoding used when a WebSocket message is binary. */
199
+ export type WebSocketBinaryEncoding = 'base64' | 'hex';
200
+ /**
201
+ * Saved WebSocket composer message.
202
+ *
203
+ * Text frames store their payload directly. Binary frames store the encoded
204
+ * bytes so the request can round-trip through JSON without losing data.
205
+ */
206
+ export interface WebSocketMessageDraft {
207
+ id: string;
208
+ name?: string;
209
+ type: 'text' | 'binary';
210
+ format?: WebSocketMessageFormat;
211
+ /** Binary encoding used by `data`; ignored for text messages. */
212
+ encoding?: WebSocketBinaryEncoding;
213
+ data: string;
214
+ enabled?: boolean;
215
+ /** Socket.IO event name. Defaults to `message`. */
216
+ event?: string;
217
+ /** Additional Socket.IO arguments, stored as text. */
218
+ args?: string[];
219
+ /** Request an acknowledgement from the Socket.IO server. */
220
+ ack?: boolean;
221
+ }
222
+ /**
223
+ * A frame captured while a WebSocket request runs headlessly (collection
224
+ * runner / suite executor). Binary payloads are encoded so the transcript can
225
+ * round-trip through JSON and be asserted on from scripts.
226
+ */
227
+ export interface WebSocketRunFrame {
228
+ direction: 'in' | 'out' | 'system';
229
+ type: 'text' | 'binary';
230
+ /** Text payload, or the encoded binary payload. */
231
+ data: string;
232
+ /** Encoding used by `data` for binary frames. */
233
+ encoding?: WebSocketBinaryEncoding;
234
+ /** Socket.IO event name, when applicable. */
235
+ event?: string;
236
+ /** Socket.IO arguments, when applicable. */
237
+ args?: string[];
238
+ /** Whether this frame is an acknowledgement. */
239
+ ack?: boolean;
240
+ /** Frame size in bytes. */
241
+ size: number;
242
+ time: number;
243
+ }
244
+ /**
245
+ * Response body exposed to post-response scripts for headless WebSocket runs.
246
+ *
247
+ * Scripts can assert on the frames, for example:
248
+ * `pm.test('greeting', () => pm.expect(pm.response.json().frames.some(f => f.direction === 'in')).to.be.true)`
249
+ */
250
+ export interface WebSocketRunTranscript {
251
+ protocol: WebSocketProtocol;
252
+ frames: WebSocketRunFrame[];
253
+ close?: {
254
+ code: number;
255
+ reason: string;
256
+ wasClean: boolean;
257
+ };
258
+ }
259
+ /**
260
+ * Socket.IO event listener saved with a request.
261
+ */
262
+ export interface SocketIoEventListener {
263
+ id: string;
264
+ name: string;
265
+ description?: string;
266
+ enabled?: boolean;
267
+ }
268
+ /**
269
+ * Socket.IO-specific request configuration.
270
+ */
271
+ export interface SocketIoConfig {
272
+ /** Socket.IO client version selected in the UI. */
273
+ clientVersion?: string;
274
+ /** Handshake path (defaults to `/socket.io`). */
275
+ handshakePath?: string;
276
+ /** Socket.IO namespace (defaults to `/`). */
277
+ namespace?: string;
278
+ /** Auth payload sent during the Socket.IO handshake (stored as JSON text). */
279
+ auth?: string;
280
+ /** Transports to use (defaults to `websocket`). */
281
+ transports?: Array<'websocket' | 'polling'>;
282
+ /** Events the response pane should listen to. */
283
+ listeners?: SocketIoEventListener[];
284
+ }
285
+ /**
286
+ * WebSocket-specific connection settings. TLS verification and HTTP timeout
287
+ * stay in the shared `RequestSettings` bag; these settings only apply to the
288
+ * socket connection/reconnect loop.
289
+ */
290
+ export interface WebSocketConnectionSettings {
291
+ /** Handshake timeout in milliseconds. Overrides `RequestSettings.timeout`. */
292
+ handshakeTimeout?: number;
293
+ /** Maximum automatic reconnect attempts after an unexpected close. */
294
+ reconnectionAttempts?: number;
295
+ /** Delay between reconnect attempts in milliseconds. */
296
+ reconnectionInterval?: number;
297
+ /** Maximum accepted message size in megabytes. 0 means unlimited. */
298
+ maxMessageSizeMb?: number;
299
+ /**
300
+ * Time in milliseconds to collect inbound frames after sending saved
301
+ * messages during a headless run. Defaults to 1000; 0 closes immediately.
302
+ */
303
+ responseTimeout?: number;
304
+ }
305
+ /**
306
+ * WebSocket-specific request configuration.
307
+ *
308
+ * WebSocket requests set `requestType: 'websocket'`; URL, headers, query,
309
+ * params, auth, and settings are shared with HTTP requests. The HTTP handshake
310
+ * method is `GET`, but the method selector is not shown for WebSocket requests.
311
+ */
312
+ export interface WebSocketRequestConfig {
313
+ /** Raw WebSocket or Socket.IO. Defaults to raw WebSocket. */
314
+ protocol?: WebSocketProtocol;
315
+ /** Sec-WebSocket-Protocol values, in preference order. */
316
+ subprotocols?: string[];
317
+ /** Saved composer drafts. The live frame log is runtime-only. */
318
+ messages?: WebSocketMessageDraft[];
319
+ /** Socket connection and reconnection settings. */
320
+ settings?: WebSocketConnectionSettings;
321
+ /** Socket.IO-specific configuration. */
322
+ socketio?: SocketIoConfig;
323
+ /** Persisted frame log from previous runs. */
324
+ frameHistory?: WebSocketRunFrame[];
325
+ }
182
326
  /**
183
327
  * Request settings
184
328
  */
@@ -259,6 +403,7 @@ export interface HttpResponse {
259
403
  export interface ExecutionRequest {
260
404
  id: string;
261
405
  name: string;
406
+ requestType?: RequestType;
262
407
  method: string;
263
408
  url: string;
264
409
  headers?: Record<string, string>;
@@ -269,6 +414,7 @@ export interface ExecutionRequest {
269
414
  settings?: RequestSettings;
270
415
  scripts?: RequestScripts;
271
416
  auth?: RequestAuth;
417
+ websocket?: WebSocketRequestConfig;
272
418
  }
273
419
  /**
274
420
  * Variable scopes for script/request execution.
@@ -613,6 +759,7 @@ export interface RequestScripts {
613
759
  export interface CollectionRequest {
614
760
  id: string;
615
761
  name: string;
762
+ requestType?: RequestType;
616
763
  method: string;
617
764
  url: string;
618
765
  headers?: KeyValueEntry[];
@@ -623,6 +770,7 @@ export interface CollectionRequest {
623
770
  settings?: RequestSettings;
624
771
  scripts?: RequestScripts;
625
772
  auth?: RequestAuth;
773
+ websocket?: WebSocketRequestConfig;
626
774
  description?: string;
627
775
  doc?: string;
628
776
  disabled?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@http-forge/core",
3
- "version": "0.6.41",
3
+ "version": "0.7.0",
4
4
  "description": "Headless Postman-compatible API testing engine for Node.js, CI/CD, OpenAPI workflows, and HTTP Forge automation",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -70,18 +70,24 @@
70
70
  "java-parser": "^3.0.1",
71
71
  "lodash": "4.18.1",
72
72
  "moment": "^2.30.1",
73
+ "socket.io-client": "^4.8.1",
73
74
  "tv4": "^1.3.0",
74
75
  "typescript": "^5.3.0",
75
76
  "uuid": "^14.0.0",
77
+ "ws": "^8.22.0",
76
78
  "yaml": "^2.7.0"
77
79
  },
78
80
  "peerDependencies": {
81
+ "@1password/sdk": ">=0.1.0",
79
82
  "@aws-sdk/client-secrets-manager": ">=3.0.0",
80
83
  "@azure/identity": ">=3.0.0",
81
84
  "@azure/keyvault-secrets": ">=4.0.0",
82
- "node-vault": ">=0.9.0"
85
+ "@google-cloud/secret-manager": ">=5.0.0"
83
86
  },
84
87
  "peerDependenciesMeta": {
88
+ "@1password/sdk": {
89
+ "optional": true
90
+ },
85
91
  "@aws-sdk/client-secrets-manager": {
86
92
  "optional": true
87
93
  },
@@ -91,7 +97,7 @@
91
97
  "@azure/identity": {
92
98
  "optional": true
93
99
  },
94
- "node-vault": {
100
+ "@google-cloud/secret-manager": {
95
101
  "optional": true
96
102
  }
97
103
  },
@@ -100,6 +106,7 @@
100
106
  "@types/node": "^20.10.0",
101
107
  "@types/tv4": "^1.2.33",
102
108
  "@types/uuid": "^9.0.7",
109
+ "@types/ws": "^8.18.2",
103
110
  "esbuild": "0.28.2",
104
111
  "rimraf": "^5.0.5",
105
112
  "tsup": "^8.0.1",