@http-forge/core 0.1.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 (66) hide show
  1. package/README.md +500 -0
  2. package/dist/container.d.ts +146 -0
  3. package/dist/container.d.ts.map +1 -0
  4. package/dist/implementations/cookie-jar.d.ts +97 -0
  5. package/dist/implementations/cookie-jar.d.ts.map +1 -0
  6. package/dist/implementations/cookie-utils.d.ts +78 -0
  7. package/dist/implementations/cookie-utils.d.ts.map +1 -0
  8. package/dist/implementations/data-file-parser.d.ts +71 -0
  9. package/dist/implementations/data-file-parser.d.ts.map +1 -0
  10. package/dist/implementations/fetch-http-client.d.ts +19 -0
  11. package/dist/implementations/fetch-http-client.d.ts.map +1 -0
  12. package/dist/implementations/index.d.ts +22 -0
  13. package/dist/implementations/index.d.ts.map +1 -0
  14. package/dist/implementations/interceptor-chain.d.ts +262 -0
  15. package/dist/implementations/interceptor-chain.d.ts.map +1 -0
  16. package/dist/implementations/module-loader.d.ts +74 -0
  17. package/dist/implementations/module-loader.d.ts.map +1 -0
  18. package/dist/implementations/native-http-client.d.ts +72 -0
  19. package/dist/implementations/native-http-client.d.ts.map +1 -0
  20. package/dist/implementations/node-file-system.d.ts +52 -0
  21. package/dist/implementations/node-file-system.d.ts.map +1 -0
  22. package/dist/implementations/request-history.d.ts +73 -0
  23. package/dist/implementations/request-history.d.ts.map +1 -0
  24. package/dist/implementations/request-preprocessor.d.ts +78 -0
  25. package/dist/implementations/request-preprocessor.d.ts.map +1 -0
  26. package/dist/implementations/variable-interpolator.d.ts +55 -0
  27. package/dist/implementations/variable-interpolator.d.ts.map +1 -0
  28. package/dist/implementations/vm2-script-runner.d.ts +76 -0
  29. package/dist/implementations/vm2-script-runner.d.ts.map +1 -0
  30. package/dist/index.d.ts +27 -0
  31. package/dist/index.d.ts.map +1 -0
  32. package/dist/index.js +46 -0
  33. package/dist/index.mjs +46 -0
  34. package/dist/interfaces/cookie.d.ts +101 -0
  35. package/dist/interfaces/cookie.d.ts.map +1 -0
  36. package/dist/interfaces/history.d.ts +117 -0
  37. package/dist/interfaces/history.d.ts.map +1 -0
  38. package/dist/interfaces/index.d.ts +170 -0
  39. package/dist/interfaces/index.d.ts.map +1 -0
  40. package/dist/interfaces/types.d.ts +308 -0
  41. package/dist/interfaces/types.d.ts.map +1 -0
  42. package/dist/parsers/http-forge-parser.d.ts +35 -0
  43. package/dist/parsers/http-forge-parser.d.ts.map +1 -0
  44. package/dist/parsers/index.d.ts +7 -0
  45. package/dist/parsers/index.d.ts.map +1 -0
  46. package/dist/services/collection-loader.d.ts +52 -0
  47. package/dist/services/collection-loader.d.ts.map +1 -0
  48. package/dist/services/environment-resolver.d.ts +91 -0
  49. package/dist/services/environment-resolver.d.ts.map +1 -0
  50. package/dist/services/folder-collection-loader.d.ts +91 -0
  51. package/dist/services/folder-collection-loader.d.ts.map +1 -0
  52. package/dist/services/forge-env.d.ts +166 -0
  53. package/dist/services/forge-env.d.ts.map +1 -0
  54. package/dist/services/index.d.ts +20 -0
  55. package/dist/services/index.d.ts.map +1 -0
  56. package/dist/services/parser-registry.d.ts +49 -0
  57. package/dist/services/parser-registry.d.ts.map +1 -0
  58. package/dist/services/request-executor.d.ts +86 -0
  59. package/dist/services/request-executor.d.ts.map +1 -0
  60. package/dist/services/script-pipeline.d.ts +43 -0
  61. package/dist/services/script-pipeline.d.ts.map +1 -0
  62. package/dist/services/script-session.d.ts +66 -0
  63. package/dist/services/script-session.d.ts.map +1 -0
  64. package/dist/services/url-builder.d.ts +60 -0
  65. package/dist/services/url-builder.d.ts.map +1 -0
  66. package/package.json +65 -0
@@ -0,0 +1,308 @@
1
+ /**
2
+ * @http-forge/core - Type Definitions
3
+ *
4
+ * Core data types used throughout the framework.
5
+ * Simplified design for maximum compatibility.
6
+ */
7
+ /**
8
+ * Unified Collection - the common format all parsers produce
9
+ */
10
+ export interface UnifiedCollection {
11
+ id: string;
12
+ name: string;
13
+ description?: string;
14
+ variables?: Record<string, string>;
15
+ auth?: CollectionAuth;
16
+ scripts?: CollectionScripts;
17
+ /** Items can be requests or folders */
18
+ items: (UnifiedFolder | UnifiedRequest)[];
19
+ /** Source information */
20
+ source?: {
21
+ format: string;
22
+ filePath: string;
23
+ version?: string;
24
+ };
25
+ }
26
+ /**
27
+ * Unified Folder within a collection
28
+ */
29
+ export interface UnifiedFolder {
30
+ type: 'folder';
31
+ id: string;
32
+ name: string;
33
+ description?: string;
34
+ auth?: CollectionAuth;
35
+ scripts?: CollectionScripts;
36
+ items: (UnifiedFolder | UnifiedRequest)[];
37
+ }
38
+ /**
39
+ * Unified Request - normalized request format
40
+ */
41
+ export interface UnifiedRequest {
42
+ type: 'request';
43
+ id: string;
44
+ name: string;
45
+ description?: string;
46
+ method: string;
47
+ url: string;
48
+ /** Headers as simple key-value pairs */
49
+ headers: Record<string, string>;
50
+ /** Query parameters as simple key-value pairs */
51
+ query: Record<string, string>;
52
+ /** Path parameters */
53
+ params?: Record<string, string>;
54
+ body?: RequestBody;
55
+ auth?: CollectionAuth;
56
+ settings?: RequestSettings;
57
+ scripts?: CollectionScripts;
58
+ }
59
+ /**
60
+ * Collection-level scripts
61
+ */
62
+ export interface CollectionScripts {
63
+ preRequest?: string;
64
+ postResponse?: string;
65
+ }
66
+ /**
67
+ * Collection authentication configuration
68
+ */
69
+ export interface CollectionAuth {
70
+ type: 'none' | 'inherit' | 'basic' | 'bearer' | 'apikey';
71
+ basic?: {
72
+ username: string;
73
+ password: string;
74
+ };
75
+ bearer?: {
76
+ token: string;
77
+ };
78
+ apikey?: {
79
+ key: string;
80
+ value: string;
81
+ in: 'header' | 'query';
82
+ };
83
+ }
84
+ /**
85
+ * Body type for requests
86
+ * Same as plugin's BodyType from shared/utils.ts
87
+ */
88
+ export type BodyType = 'none' | 'raw' | 'form-data' | 'x-www-form-urlencoded' | 'binary' | 'graphql';
89
+ /**
90
+ * Raw format for body content
91
+ * Same as plugin's RawFormat from shared/utils.ts
92
+ */
93
+ export type RawFormat = 'json' | 'text' | 'xml' | 'html' | 'javascript';
94
+ /**
95
+ * Request body with type information
96
+ * Same as plugin's RequestBody from shared/utils.ts
97
+ *
98
+ * Examples:
99
+ * - { type: 'raw', format: 'json', content: '{"key": "value"}' }
100
+ * - { type: 'x-www-form-urlencoded', content: [{ key: 'name', value: 'test', enabled: true }] }
101
+ * - { type: 'form-data', content: [{ key: 'file', value: 'data', type: 'text', enabled: true }] }
102
+ * - { type: 'binary', content: 'base64encodeddata' }
103
+ * - { type: 'graphql', content: { query: '...', variables: {} } }
104
+ * - { type: 'none', content: null }
105
+ */
106
+ export interface RequestBody {
107
+ type: BodyType;
108
+ format?: RawFormat;
109
+ content?: any;
110
+ }
111
+ /**
112
+ * Request settings
113
+ */
114
+ export interface RequestSettings {
115
+ timeout?: number;
116
+ followRedirects?: boolean;
117
+ followOriginalMethod?: boolean;
118
+ followAuthHeader?: boolean;
119
+ maxRedirects?: number;
120
+ strictSSL?: boolean;
121
+ decompress?: boolean;
122
+ includeCookies?: boolean;
123
+ }
124
+ /**
125
+ * HTTP request ready for execution
126
+ */
127
+ export interface HttpRequest {
128
+ method: string;
129
+ url: string;
130
+ headers: Record<string, string>;
131
+ body?: any;
132
+ timeout?: number;
133
+ settings?: RequestSettings;
134
+ }
135
+ /**
136
+ * HTTP response from execution
137
+ */
138
+ export interface HttpResponse {
139
+ status: number;
140
+ statusText: string;
141
+ headers: Record<string, string>;
142
+ body: any;
143
+ time: number;
144
+ size?: number;
145
+ /** Parsed cookies from Set-Cookie headers */
146
+ cookies?: Record<string, string>;
147
+ }
148
+ /**
149
+ * Environment configuration
150
+ */
151
+ export interface Environment {
152
+ name: string;
153
+ description?: string;
154
+ variables: Record<string, string>;
155
+ headers?: Record<string, string>;
156
+ }
157
+ /**
158
+ * Resolved environment with all inherited values merged
159
+ */
160
+ export interface ResolvedEnvironment {
161
+ name: string;
162
+ description?: string;
163
+ variables: Record<string, string>;
164
+ headers: Record<string, string>;
165
+ }
166
+ /**
167
+ * Context available to scripts during execution
168
+ */
169
+ export interface ScriptContext {
170
+ /** The current request (may be modified by pre-request scripts) */
171
+ request: HttpRequest;
172
+ /** The response (only available in post-response scripts) */
173
+ response?: HttpResponse;
174
+ /** Global variables (workspace-wide, persistent) */
175
+ globals?: Record<string, string>;
176
+ /** Collection-level variables */
177
+ collectionVariables?: Record<string, string>;
178
+ /** Environment variables (persistent) */
179
+ environment: Record<string, string>;
180
+ /** Environment name */
181
+ environmentName?: string;
182
+ /** Flow-scoped variables (temporary) */
183
+ variables: Record<string, string>;
184
+ /** Information about the current execution */
185
+ info?: ScriptInfo;
186
+ }
187
+ /**
188
+ * Script execution metadata
189
+ */
190
+ export interface ScriptInfo {
191
+ eventName: 'prerequest' | 'test';
192
+ iteration?: number;
193
+ iterationCount?: number;
194
+ requestName?: string;
195
+ requestId?: string;
196
+ }
197
+ /**
198
+ * Result of script execution
199
+ */
200
+ export interface ScriptResult {
201
+ success: boolean;
202
+ error?: string;
203
+ /** Modified request (from pre-request scripts) */
204
+ modifiedRequest?: Partial<HttpRequest>;
205
+ /** Modified global variables */
206
+ modifiedGlobals?: Record<string, string>;
207
+ /** Modified collection variables */
208
+ modifiedCollectionVariables?: Record<string, string>;
209
+ /** Modified environment variables */
210
+ modifiedEnvironment?: Record<string, string>;
211
+ /** Modified flow-scoped variables */
212
+ modifiedVariables?: Record<string, string>;
213
+ /** Console output from scripts */
214
+ consoleOutput?: string[];
215
+ /** Test assertions (from post-response scripts) */
216
+ assertions?: TestAssertion[];
217
+ }
218
+ /**
219
+ * Test assertion result
220
+ */
221
+ export interface TestAssertion {
222
+ name: string;
223
+ passed: boolean;
224
+ message?: string;
225
+ }
226
+ /**
227
+ * Request overrides that can be applied at runtime
228
+ */
229
+ export interface RequestOverrides {
230
+ /** Override URL path parameters */
231
+ params?: Record<string, string>;
232
+ /** Override query parameters */
233
+ query?: Record<string, string>;
234
+ /** Override headers */
235
+ headers?: Record<string, string>;
236
+ /** Override body */
237
+ body?: any;
238
+ /** Override entire URL */
239
+ url?: string;
240
+ /** Override method */
241
+ method?: string;
242
+ /** Timeout override */
243
+ timeout?: number;
244
+ /** Settings override (e.g., strictSSL, followRedirects) */
245
+ settings?: Partial<RequestSettings>;
246
+ /** Skip all scripts */
247
+ skipScripts?: boolean | ScriptLevel[];
248
+ /** Skip only pre-request scripts */
249
+ skipPreScripts?: boolean;
250
+ /** Skip only post-response scripts */
251
+ skipPostScripts?: boolean;
252
+ }
253
+ /**
254
+ * Script levels that can be skipped
255
+ */
256
+ export type ScriptLevel = 'collection' | 'folder' | 'request';
257
+ /**
258
+ * Resolved request with collection/folder context
259
+ */
260
+ export interface ResolvedRequest extends UnifiedRequest {
261
+ /** Parent collection */
262
+ collection?: UnifiedCollection;
263
+ /** Parent folder (if any) */
264
+ folder?: UnifiedFolder;
265
+ /** Full path: collection/folder/request */
266
+ path: string;
267
+ }
268
+ /**
269
+ * Final response returned to users
270
+ */
271
+ export interface ForgeResponse {
272
+ /** HTTP status code */
273
+ status: number;
274
+ /** HTTP status text */
275
+ statusText: string;
276
+ /** Response headers */
277
+ headers: Record<string, string>;
278
+ /** Parsed response body */
279
+ body: any;
280
+ /** Response time in milliseconds */
281
+ time: number;
282
+ /** Response size in bytes */
283
+ size?: number;
284
+ /** The request that was sent */
285
+ request: HttpRequest;
286
+ /** Test assertions (if post-response scripts ran) */
287
+ assertions?: TestAssertion[];
288
+ /** Console output from scripts */
289
+ consoleOutput?: string[];
290
+ }
291
+ /**
292
+ * Forge configuration options
293
+ */
294
+ export interface ForgeConfig {
295
+ /** Root directory for .forge folder */
296
+ forgeRoot: string;
297
+ /** Default environment name */
298
+ defaultEnvironment?: string;
299
+ /** Default timeout in milliseconds */
300
+ timeout?: number;
301
+ /** Whether to follow redirects */
302
+ followRedirects?: boolean;
303
+ /** Maximum redirects to follow */
304
+ maxRedirects?: number;
305
+ /** Whether to verify SSL certificates */
306
+ strictSSL?: boolean;
307
+ }
308
+ //# sourceMappingURL=types.d.ts.map
@@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AAY,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,cAAc;IACnD,wBAAwB;IACxB,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,6BAA6B;IAC7B,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B,uBAAuB;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,uBAAuB;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,2BAA2B;IAC3B,IAAI,EAAE,GAAG,CAAC;IACV,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,OAAO,EAAE,WAAW,CAAC;IACrB,qDAAqD;IACrD,UAAU,CAAC,EAAE,aAAa,EAAE,CAAC;IAC7B,kCAAkC;IAClC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAMD;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,+BAA+B;IAC/B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kCAAkC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yCAAyC;IACzC,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * HTTP Forge Collection Parser
3
+ *
4
+ * Single Responsibility: Parse HTTP Forge collection format (.forge.json)
5
+ * Dependency Inversion: Implements ICollectionParser interface
6
+ */
7
+ import { ICollectionParser } from '../interfaces';
8
+ import { UnifiedCollection } from '../interfaces/types';
9
+ /**
10
+ * Parser for HTTP Forge native collection format
11
+ */
12
+ export declare class HttpForgeParser implements ICollectionParser {
13
+ readonly format = "http-forge";
14
+ /**
15
+ * Check if content is HTTP Forge format
16
+ */
17
+ canParse(content: string): boolean;
18
+ /**
19
+ * Parse HTTP Forge collection content
20
+ */
21
+ parse(content: string, filePath: string): UnifiedCollection;
22
+ /**
23
+ * Convert HTTP Forge items to unified format
24
+ */
25
+ private convertItems;
26
+ /**
27
+ * Convert folder to unified format
28
+ */
29
+ private convertFolder;
30
+ /**
31
+ * Convert request to unified format
32
+ */
33
+ private convertRequest;
34
+ }
35
+ //# sourceMappingURL=http-forge-parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-forge-parser.d.ts","sourceRoot":"","sources":["../../src/parsers/http-forge-parser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAgD,iBAAiB,EAAiC,MAAM,qBAAqB,CAAC;AAqDrI;;GAEG;AACH,qBAAa,eAAgB,YAAW,iBAAiB;IACrD,QAAQ,CAAC,MAAM,gBAAgB;IAE/B;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAoBlC;;OAEG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,iBAAiB;IAsB3D;;OAEG;IACH,OAAO,CAAC,YAAY;IAUpB;;OAEG;IACH,OAAO,CAAC,aAAa;IAerB;;OAEG;IACH,OAAO,CAAC,cAAc;CAwCzB"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Collection Parsers
3
+ *
4
+ * Export all parser implementations
5
+ */
6
+ export { HttpForgeParser } from './http-forge-parser';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/parsers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Collection Loader Service
3
+ *
4
+ * Single Responsibility: Load collections from file system
5
+ * Dependency Inversion: Uses IFileSystem and ParserRegistry abstractions
6
+ */
7
+ import { ICollectionLoader, IFileSystem } from '../interfaces';
8
+ import { UnifiedCollection } from '../interfaces/types';
9
+ import { ParserRegistry } from './parser-registry';
10
+ /**
11
+ * Options for loading a collection
12
+ */
13
+ export interface LoadOptions {
14
+ /** Force a specific format parser */
15
+ format?: string;
16
+ }
17
+ /**
18
+ * Service for loading collections from files (single-file format)
19
+ * Implements ICollectionLoader for interoperability with FolderCollectionLoader
20
+ */
21
+ export declare class CollectionLoader implements ICollectionLoader {
22
+ private readonly fileSystem;
23
+ private readonly parserRegistry;
24
+ private directory?;
25
+ constructor(fileSystem: IFileSystem, parserRegistry: ParserRegistry);
26
+ /**
27
+ * Set directory for loadAll()
28
+ */
29
+ setDirectory(dirPath: string): void;
30
+ /**
31
+ * Load all collections from configured directory
32
+ * Implements ICollectionLoader
33
+ */
34
+ loadAll(): Promise<UnifiedCollection[]>;
35
+ /**
36
+ * Load a collection from a file path
37
+ */
38
+ load(filePath: string, options?: LoadOptions): Promise<UnifiedCollection>;
39
+ /**
40
+ * Load multiple collections from a directory
41
+ */
42
+ loadDirectory(dirPath: string, patterns?: string[]): Promise<UnifiedCollection[]>;
43
+ /**
44
+ * Check if a file can be loaded as a collection
45
+ */
46
+ canLoad(filePath: string): Promise<boolean>;
47
+ /**
48
+ * Get supported formats
49
+ */
50
+ getSupportedFormats(): string[];
51
+ }
52
+ //# sourceMappingURL=collection-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collection-loader.d.ts","sourceRoot":"","sources":["../../src/services/collection-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,qCAAqC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,qBAAa,gBAAiB,YAAW,iBAAiB;IAIlD,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAJnC,OAAO,CAAC,SAAS,CAAC,CAAS;gBAGN,UAAU,EAAE,WAAW,EACvB,cAAc,EAAE,cAAc;IAGnD;;OAEG;IACH,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAInC;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAO7C;;OAEG;IACG,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAqBnF;;OAEG;IACG,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAM,EAA+B,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAiBnH;;OAEG;IACG,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAYjD;;OAEG;IACH,mBAAmB,IAAI,MAAM,EAAE;CAGlC"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Environment Resolver Service
3
+ *
4
+ * Single Responsibility: Resolve environment variables for request execution
5
+ * Dependency Inversion: Implements IEnvironmentStore interface
6
+ */
7
+ import { IEnvironmentStore } from '../interfaces';
8
+ /**
9
+ * Environment definition
10
+ */
11
+ export interface Environment {
12
+ name: string;
13
+ variables: Record<string, string>;
14
+ /** Base environment to inherit from */
15
+ inherits?: string;
16
+ }
17
+ /**
18
+ * Environment configuration
19
+ */
20
+ export interface EnvironmentConfig {
21
+ /** Global variables (available in all environments) */
22
+ globalVariables?: Record<string, string>;
23
+ /** Environment definitions */
24
+ environments: Record<string, Environment>;
25
+ /** Currently selected environment */
26
+ selectedEnvironment?: string;
27
+ }
28
+ /**
29
+ * In-memory environment store implementation
30
+ */
31
+ export declare class EnvironmentResolver implements IEnvironmentStore {
32
+ private config;
33
+ private selectedEnvironment;
34
+ /** In-memory values */
35
+ private sessionGlobals;
36
+ private sessionEnvironmentValues;
37
+ constructor(config: EnvironmentConfig);
38
+ /**
39
+ * Get a single variable value
40
+ */
41
+ get(key: string): string | undefined;
42
+ /**
43
+ * Set a variable value (in session)
44
+ */
45
+ set(key: string, value: string): void;
46
+ /**
47
+ * Get all variables as a record
48
+ */
49
+ getAll(): Record<string, string>;
50
+ /**
51
+ * Get list of available environment names
52
+ */
53
+ getEnvironments(): string[];
54
+ /**
55
+ * Get the currently active environment name
56
+ */
57
+ getActive(): string | undefined;
58
+ /**
59
+ * Set the active environment
60
+ */
61
+ setActive(name: string): void;
62
+ /**
63
+ * Get merged variables for an environment (includes globals)
64
+ */
65
+ getVariables(environment?: string): Record<string, string>;
66
+ /**
67
+ * Get environment variables only (without globals)
68
+ */
69
+ private getEnvironmentVariables;
70
+ /**
71
+ * Get global variables
72
+ */
73
+ getGlobals(): Record<string, string>;
74
+ /**
75
+ * Set a global variable
76
+ */
77
+ setGlobal(key: string, value: string): void;
78
+ /**
79
+ * Resolve environment for execution
80
+ */
81
+ resolve(environment?: string): {
82
+ name: string;
83
+ merged: Record<string, string>;
84
+ globals: Record<string, string>;
85
+ };
86
+ /**
87
+ * Create from simple variables object
88
+ */
89
+ static fromVariables(variables: Record<string, string>, name?: string): EnvironmentResolver;
90
+ }
91
+ //# sourceMappingURL=environment-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment-resolver.d.ts","sourceRoot":"","sources":["../../src/services/environment-resolver.ts"],"names":[],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AO,CAAC,uBAAuB;IAa/B;;OAEG;IACH,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAOpC;;OAEG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAI3C;;OAEG;IACH,OAAO,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG;QAC3B,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC/B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACnC;IASD;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,SAAY,GAAG,mBAAmB;CAQjG"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Folder Collection Loader
3
+ *
4
+ * Loads collections from directory structure (folder format)
5
+ * Each collection is a folder containing:
6
+ * - collection.json (metadata)
7
+ * - scripts/ (pre-request.js, post-response.js)
8
+ * - {folder-slug}/ (subfolders with folder.json)
9
+ * - {request-slug}/ (request folders with request.json)
10
+ *
11
+ * This is a port of the VS Code extension's FolderCollectionLoader
12
+ */
13
+ import type { ICollectionLoader } from '../interfaces';
14
+ import type { UnifiedCollection } from '../interfaces/types';
15
+ /**
16
+ * Folder Collection Loader
17
+ *
18
+ * Loads collections from folder structure:
19
+ * collections/
20
+ * {collection-slug}/
21
+ * collection.json
22
+ * scripts/
23
+ * pre-request.js
24
+ * post-response.js
25
+ * {folder-slug}/
26
+ * folder.json
27
+ * scripts/
28
+ * {request-slug}/
29
+ * request.json
30
+ * scripts/
31
+ * {request-slug}/
32
+ * request.json
33
+ * scripts/
34
+ */
35
+ export declare class FolderCollectionLoader implements ICollectionLoader {
36
+ private collectionsDir;
37
+ private slugToIdMap;
38
+ private idToSlugMap;
39
+ constructor(collectionsDir: string);
40
+ /**
41
+ * Load all collections from disk
42
+ */
43
+ loadAll(): UnifiedCollection[];
44
+ /**
45
+ * Get collection slug from ID
46
+ */
47
+ getSlugById(id: string): string | undefined;
48
+ /**
49
+ * Get collection ID from slug
50
+ */
51
+ getIdBySlug(slug: string): string | undefined;
52
+ /**
53
+ * Load a collection from a folder
54
+ */
55
+ private loadCollectionFromFolder;
56
+ /**
57
+ * Load items from a directory
58
+ * @param dirPath - Directory path to load items from
59
+ * @param parentId - Parent ID for tracking
60
+ * @param order - Optional order array (slugs) to sort items
61
+ */
62
+ private loadItemsFromDir;
63
+ /**
64
+ * Load a folder from directory
65
+ */
66
+ private loadFolderFromDir;
67
+ /**
68
+ * Load a request from directory
69
+ */
70
+ private loadRequestFromDir;
71
+ /**
72
+ * Convert array of { key, value, enabled } to Record<string, string>
73
+ * Also handles Record format (pass-through)
74
+ * Only includes enabled items (or all if enabled is undefined)
75
+ */
76
+ private arrayToRecord;
77
+ /**
78
+ * Load scripts from a scripts directory
79
+ */
80
+ private loadScriptsFromDir;
81
+ /**
82
+ * Load body from external file if present
83
+ * Supports: body.json, body.xml, body.txt, body.html, body.js, body.graphql
84
+ */
85
+ private loadBodyFromDir;
86
+ }
87
+ /**
88
+ * Generate a slug from a name
89
+ */
90
+ export declare function generateSlug(name: string): string;
91
+ //# sourceMappingURL=folder-collection-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"folder-collection-loader.d.ts","sourceRoot":"","sources":["../../src/services/folder-collection-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAe,iBAAiB,EAAiC,MAAM,qBAAqB,CAAC;AA0FzG;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,sBAAuB,YAAW,iBAAiB;IAC5D,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,WAAW,CAAkC;IACrD,OAAO,CAAC,WAAW,CAAkC;gBAEzC,cAAc,EAAE,MAAM;IAIlC;;OAEG;IACH,OAAO,IAAI,iBAAiB,EAAE;IA6B9B;;OAEG;IACH,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAI3C;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAI7C;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAwChC;;;;;OAKG;IACH,OAAO,CAAC,gBAAgB;IAwDxB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IA+BzB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA6C1B;;;;OAIG;IACH,OAAO,CAAC,aAAa;IAiBrB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAoB1B;;;OAGG;IACH,OAAO,CAAC,eAAe;CAsC1B;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKjD"}