@http-forge/core 0.6.6 → 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.
- package/dist/index.js +242 -242
- package/dist/index.mjs +242 -242
- package/dist/infrastructure/execution/collection-request-executor.d.ts +3 -2
- package/dist/infrastructure/execution/request-executor.d.ts +5 -0
- package/dist/infrastructure/execution/request-preparer.d.ts +1 -0
- package/dist/infrastructure/script/script-factories.d.ts +17 -0
- package/dist/infrastructure/test-suite/test-suite-store.d.ts +5 -1
- package/dist/types/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -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
|
package/dist/types/types.d.ts
CHANGED
|
@@ -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