@http-forge/core 0.6.5 → 0.6.10

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.
@@ -11,7 +11,7 @@
11
11
  * Platform-independent — no vscode dependency.
12
12
  */
13
13
  import { IEnvironmentConfigService } from '../../types/environment-config';
14
- import { ExecutionRequest, ExecutionResult, PreparedRequest, RequestScripts } from '../../types/types';
14
+ import { ExecutionRequest, ExecutionResult, PreparedRequest, RequestAuth, RequestScripts } from '../../types/types';
15
15
  import { IHttpRequestService } from '../http/interfaces';
16
16
  import { ICookieJar, IScriptExecutor } from '../script/interfaces';
17
17
  import { ConsoleOutputCallback, ICollectionRequestExecutor } from './collection-request-executor-interfaces';
@@ -32,9 +32,10 @@ export declare class CollectionRequestExecutor implements ICollectionRequestExec
32
32
  private readonly folderScriptsChain?;
33
33
  private readonly onConsoleOutput?;
34
34
  private readonly collectionName?;
35
+ private readonly collectionAuth?;
35
36
  private readonly iteration?;
36
37
  private readonly iterationCount?;
37
- constructor(httpService: IHttpRequestService, scriptExecutor: IScriptExecutor, envConfigService: IEnvironmentConfigService, requestPreparer: IRequestPreparer, environment: string, cookieJar?: ICookieJar | undefined, collectionScripts?: RequestScripts | undefined, folderScriptsChain?: (RequestScripts | RequestScripts[]) | undefined, onConsoleOutput?: ConsoleOutputCallback | undefined, collectionName?: string | undefined, iteration?: number | undefined, iterationCount?: number | undefined);
38
+ constructor(httpService: IHttpRequestService, scriptExecutor: IScriptExecutor, envConfigService: IEnvironmentConfigService, requestPreparer: IRequestPreparer, environment: string, cookieJar?: ICookieJar | undefined, collectionScripts?: RequestScripts | undefined, folderScriptsChain?: (RequestScripts | RequestScripts[]) | undefined, onConsoleOutput?: ConsoleOutputCallback | undefined, collectionName?: string | undefined, collectionAuth?: RequestAuth | undefined, iteration?: number | undefined, iterationCount?: number | undefined);
38
39
  /**
39
40
  * Execute a request with full Postman parity.
40
41
  */
@@ -85,6 +85,11 @@ export declare class RequestExecutor {
85
85
  * Handles both {{variable}} and :pathParam patterns in URL
86
86
  */
87
87
  private interpolateRequest;
88
+ /**
89
+ * Convert Postman form-data entries into a native FormData body so fetch can
90
+ * send a real multipart request with an auto-generated boundary.
91
+ */
92
+ private buildMultipartFormData;
88
93
  /**
89
94
  * Build script chain for a request
90
95
  * Returns scripts in execution order: collection → folders → request
@@ -34,4 +34,5 @@ export declare class RequestPreparer implements IRequestPreparer {
34
34
  prepareRequest(input: ExecutionRequest, environment: string, resolvedEnv: ResolvedEnvironment, extraVariables?: Record<string, string>): Promise<PreparedRequest>;
35
35
  private applyOAuth2;
36
36
  private applyApiKey;
37
+ private buildMultipartFormData;
37
38
  }
@@ -138,21 +138,38 @@ export interface ExpectChain {
138
138
  still: ExpectChain;
139
139
  also: ExpectChain;
140
140
  equal(expected: any): ExpectChain;
141
+ eq(expected: any): ExpectChain;
142
+ equals(expected: any): ExpectChain;
141
143
  eql(expected: any): ExpectChain;
144
+ eqls(expected: any): ExpectChain;
142
145
  property(name: string, value?: any): ExpectChain;
143
146
  ok: ExpectChain;
144
147
  exist: ExpectChain;
145
148
  include(value: any): ExpectChain;
149
+ includes(value: any): ExpectChain;
146
150
  contain(value: any): ExpectChain;
151
+ contains(value: any): ExpectChain;
147
152
  oneOf(values: any[]): ExpectChain;
148
153
  match(pattern: RegExp): ExpectChain;
149
154
  above(num: number): ExpectChain;
150
155
  below(num: number): ExpectChain;
156
+ gt(num: number): ExpectChain;
157
+ lt(num: number): ExpectChain;
158
+ least(num: number): ExpectChain;
159
+ most(num: number): ExpectChain;
160
+ gte(num: number): ExpectChain;
161
+ lte(num: number): ExpectChain;
151
162
  greaterThan(num: number): ExpectChain;
152
163
  lessThan(num: number): ExpectChain;
164
+ closeTo(expected: number, delta: number): ExpectChain;
165
+ approximately(expected: number, delta: number): ExpectChain;
153
166
  within(start: number, end: number): ExpectChain;
154
167
  a(type: string): ExpectChain;
155
168
  an(type: string): ExpectChain;
169
+ "throw"(expected?: any): ExpectChain;
170
+ throws(expected?: any): ExpectChain;
171
+ instanceOf(constructor: Function): ExpectChain;
172
+ "instanceof"(constructor: Function): ExpectChain;
156
173
  true: ExpectChain;
157
174
  false: ExpectChain;
158
175
  null: ExpectChain;
@@ -8,7 +8,7 @@
8
8
  * Single Responsibility: Maintain suite state and resolve requests
9
9
  * Dependency Inversion: Depends on ICollectionService abstraction
10
10
  */
11
- import { CollectionRequest, ICollectionService, RequestScripts } from '../../types/collection';
11
+ import { CollectionRequest, ICollectionService, RequestAuth, RequestScripts } from '../../types/collection';
12
12
  import { SuiteRequest, TestSuite } from './interfaces';
13
13
  /**
14
14
  * Cached request entry with full context
@@ -20,8 +20,12 @@ export interface SuiteRequestEntry {
20
20
  suiteRequest: SuiteRequest;
21
21
  /** Collection scripts */
22
22
  collectionScripts?: RequestScripts;
23
+ /** Collection auth */
24
+ collectionAuth?: RequestAuth;
23
25
  /** Folder scripts chain */
24
26
  folderScriptsChain: RequestScripts[];
27
+ /** Folder auth chain */
28
+ folderAuthChain: RequestAuth[];
25
29
  }
26
30
  /**
27
31
  * Interface for TestSuiteStore
@@ -11,10 +11,38 @@ export interface FlatRequest {
11
11
  request: CollectionRequestItem;
12
12
  folderPath: string;
13
13
  }
14
+ /**
15
+ * Encode a single folder name segment so that '/' within the name is
16
+ * unambiguous from the '/' path separator used in folderPath strings.
17
+ * Only '/' is encoded; all other characters are left as-is.
18
+ */
19
+ export declare function encodeFolderName(name: string): string;
20
+ /**
21
+ * Decode a single folder name segment back to its display form.
22
+ */
23
+ export declare function decodeFolderName(name: string): string;
24
+ /**
25
+ * Convert an internal folderPath (segments joined by '/', with '/' inside
26
+ * names encoded as '%2F') to a human-readable display string.
27
+ * E.g. "agl-page-composition/TRAY%2FEPG/AVS5-5303 - TRAY%2FEPG"
28
+ * → "agl-page-composition / TRAY/EPG / AVS5-5303 - TRAY/EPG"
29
+ */
30
+ export declare function decodeFolderPath(folderPath: string): string;
31
+ /**
32
+ * Convert a user-supplied folder input to an internal folderPath.
33
+ * Accepts both the display form ("A / B/C / D" with ' / ' separators)
34
+ * and the raw form ("A/B/C"). In the raw form, each slash that matches a
35
+ * known separator boundary is kept; slashes within a segment are encoded.
36
+ * The simplest reliable approach: if ' / ' is present, treat it as the
37
+ * separator; otherwise encode all '/' as '%2F' (treating the whole input
38
+ * as a single folder name or leaf to match by inclusion).
39
+ */
40
+ export declare function normalizeFolderInput(input: string): string;
14
41
  /** Flatten all requests in a collection into a list with their folder paths. */
15
42
  export declare function flattenRequests(collection: Collection, items?: CollectionItem[], folderPath?: string): FlatRequest[];
16
- /** Enumerate every folder path in a collection along with its recursive request count. */
43
+ /** Enumerate every folder path in a collection along with its id and recursive request count. */
17
44
  export declare function enumerateFolders(collection: Collection, items?: CollectionItem[], prefix?: string): Array<{
45
+ folderId: string;
18
46
  folderPath: string;
19
47
  requestCount: number;
20
48
  }>;
@@ -582,7 +582,7 @@ export interface CollectionRequest {
582
582
  /**
583
583
  * Encoded request body ready for HTTP transmission
584
584
  */
585
- export type RequestBodyEncoded = string | Buffer | null;
585
+ export type RequestBodyEncoded = string | Buffer | FormData | URLSearchParams | null;
586
586
  /**
587
587
  * Resolved body ready for HTTP transmission
588
588
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@http-forge/core",
3
- "version": "0.6.5",
3
+ "version": "0.6.10",
4
4
  "description": "Headless HTTP testing engine with Postman collection support, dynamic variables, and script-based automation.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",