@http-forge/core 0.1.0 → 0.2.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.
- package/README.md +194 -41
- package/dist/auth/interfaces.d.ts +63 -0
- package/dist/auth/oauth2-token-manager.d.ts +103 -0
- package/dist/collection/collection-loader-factory.d.ts +20 -0
- package/dist/{services → collection}/collection-loader.d.ts +3 -3
- package/dist/collection/collection-service-interfaces.d.ts +119 -0
- package/dist/collection/collection-service.d.ts +75 -0
- package/dist/collection/collection-store.d.ts +109 -0
- package/dist/collection/folder-collection-loader.d.ts +256 -0
- package/dist/collection/folder-collection-store.d.ts +168 -0
- package/dist/collection/interfaces.d.ts +32 -0
- package/dist/collection/json-collection-loader.d.ts +95 -0
- package/dist/{services → collection}/parser-registry.d.ts +1 -2
- package/dist/config/config-service.d.ts +79 -0
- package/dist/config/config.interface.d.ts +140 -0
- package/dist/config/default-config.d.ts +29 -0
- package/dist/config/index.d.ts +6 -0
- package/dist/container.d.ts +22 -14
- package/dist/{implementations → cookie}/cookie-jar.d.ts +2 -3
- package/dist/cookie/cookie-service.d.ts +98 -0
- package/dist/{implementations → cookie}/cookie-utils.d.ts +1 -2
- package/dist/cookie/in-memory-cookie-jar.d.ts +44 -0
- package/dist/{interfaces/cookie.d.ts → cookie/interfaces.d.ts} +22 -3
- package/dist/cookie/persistent-cookie-jar.d.ts +35 -0
- package/dist/environment/environment-config-service.d.ts +95 -0
- package/dist/{services → environment}/environment-resolver.d.ts +6 -5
- package/dist/{services → environment}/forge-env.d.ts +1 -2
- package/dist/environment/interfaces.d.ts +139 -0
- package/dist/environment/variable-interpolator.d.ts +100 -0
- package/dist/execution/collection-request-executor-interfaces.d.ts +36 -0
- package/dist/execution/collection-request-executor.d.ts +78 -0
- package/dist/{services → execution}/request-executor.d.ts +23 -11
- package/dist/execution/request-preparer-interfaces.d.ts +36 -0
- package/dist/execution/request-preparer.d.ts +35 -0
- package/dist/graphql/graphql-completion-provider.d.ts +39 -0
- package/dist/graphql/graphql-schema-service.d.ts +89 -0
- package/dist/{interfaces/history.d.ts → history/history-interfaces.d.ts} +29 -6
- package/dist/history/request-history-service-interfaces.d.ts +43 -0
- package/dist/history/request-history-service.d.ts +133 -0
- package/dist/{implementations → history}/request-history.d.ts +2 -3
- package/dist/{implementations → http}/fetch-http-client.d.ts +4 -5
- package/dist/http/http-request-service.d.ts +36 -0
- package/dist/{implementations → http}/interceptor-chain.d.ts +1 -2
- package/dist/http/interfaces.d.ts +25 -0
- package/dist/http/merge-request-settings.d.ts +12 -0
- package/dist/{implementations → http}/native-http-client.d.ts +6 -15
- package/dist/{implementations → http}/request-preprocessor.d.ts +1 -2
- package/dist/{services → http}/url-builder.d.ts +7 -10
- package/dist/import-export/import-postman-environment.d.ts +21 -0
- package/dist/import-export/rest-client-export.d.ts +35 -0
- package/dist/index.d.ts +88 -6
- package/dist/index.js +262 -35
- package/dist/index.mjs +262 -35
- package/dist/openapi/example-generator.d.ts +26 -0
- package/dist/openapi/history-analyzer.d.ts +29 -0
- package/dist/openapi/index.d.ts +16 -0
- package/dist/openapi/interfaces.d.ts +42 -0
- package/dist/openapi/openapi-exporter.d.ts +73 -0
- package/dist/openapi/openapi-importer.d.ts +72 -0
- package/dist/openapi/ref-resolver.d.ts +28 -0
- package/dist/openapi/schema-inference-service.d.ts +40 -0
- package/dist/openapi/schema-inferrer.d.ts +26 -0
- package/dist/openapi/script-analyzer.d.ts +41 -0
- package/dist/parsers/http-forge-parser.d.ts +2 -3
- package/dist/parsers/index.d.ts +0 -1
- package/dist/{implementations → platform}/data-file-parser.d.ts +0 -1
- package/dist/{implementations → platform}/node-file-system.d.ts +1 -2
- package/dist/script/interfaces.d.ts +149 -0
- package/dist/script/module-loader.d.ts +115 -0
- package/dist/script/request-script-session.d.ts +70 -0
- package/dist/script/script-executor.d.ts +60 -0
- package/dist/script/script-factories.d.ts +83 -0
- package/dist/script/script-utils.d.ts +41 -0
- package/dist/test-suite/index.d.ts +10 -0
- package/dist/test-suite/interfaces.d.ts +164 -0
- package/dist/test-suite/result-storage-service.d.ts +70 -0
- package/dist/test-suite/result-storage.d.ts +296 -0
- package/dist/test-suite/statistics-service.d.ts +51 -0
- package/dist/test-suite/test-suite-service.d.ts +97 -0
- package/dist/test-suite/test-suite-store.d.ts +155 -0
- package/dist/types/console-service.d.ts +40 -0
- package/dist/types/platform.d.ts +206 -0
- package/dist/{interfaces → types}/types.d.ts +282 -12
- package/dist/utils/dynamic-variables.d.ts +38 -0
- package/dist/utils/expression-evaluator.d.ts +34 -0
- package/dist/utils/filter-engine.d.ts +47 -0
- package/dist/utils/helpers.d.ts +47 -0
- package/package.json +11 -3
- package/dist/container.d.ts.map +0 -1
- package/dist/implementations/cookie-jar.d.ts.map +0 -1
- package/dist/implementations/cookie-utils.d.ts.map +0 -1
- package/dist/implementations/data-file-parser.d.ts.map +0 -1
- package/dist/implementations/fetch-http-client.d.ts.map +0 -1
- package/dist/implementations/index.d.ts +0 -22
- package/dist/implementations/index.d.ts.map +0 -1
- package/dist/implementations/interceptor-chain.d.ts.map +0 -1
- package/dist/implementations/module-loader.d.ts +0 -74
- package/dist/implementations/module-loader.d.ts.map +0 -1
- package/dist/implementations/native-http-client.d.ts.map +0 -1
- package/dist/implementations/node-file-system.d.ts.map +0 -1
- package/dist/implementations/request-history.d.ts.map +0 -1
- package/dist/implementations/request-preprocessor.d.ts.map +0 -1
- package/dist/implementations/variable-interpolator.d.ts +0 -55
- package/dist/implementations/variable-interpolator.d.ts.map +0 -1
- package/dist/implementations/vm2-script-runner.d.ts +0 -76
- package/dist/implementations/vm2-script-runner.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/interfaces/cookie.d.ts.map +0 -1
- package/dist/interfaces/history.d.ts.map +0 -1
- package/dist/interfaces/index.d.ts +0 -170
- package/dist/interfaces/index.d.ts.map +0 -1
- package/dist/interfaces/types.d.ts.map +0 -1
- package/dist/parsers/http-forge-parser.d.ts.map +0 -1
- package/dist/parsers/index.d.ts.map +0 -1
- package/dist/services/collection-loader.d.ts.map +0 -1
- package/dist/services/environment-resolver.d.ts.map +0 -1
- package/dist/services/folder-collection-loader.d.ts +0 -91
- package/dist/services/folder-collection-loader.d.ts.map +0 -1
- package/dist/services/forge-env.d.ts.map +0 -1
- package/dist/services/index.d.ts +0 -20
- package/dist/services/index.d.ts.map +0 -1
- package/dist/services/parser-registry.d.ts.map +0 -1
- package/dist/services/request-executor.d.ts.map +0 -1
- package/dist/services/script-pipeline.d.ts +0 -43
- package/dist/services/script-pipeline.d.ts.map +0 -1
- package/dist/services/script-session.d.ts +0 -66
- package/dist/services/script-session.d.ts.map +0 -1
- package/dist/services/url-builder.d.ts.map +0 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* REST Client Export Utilities
|
|
3
|
+
*
|
|
4
|
+
* Pure functions for exporting collections to REST Client format (.http files).
|
|
5
|
+
* No VS Code dependency — uses only Node.js fs/path and core types.
|
|
6
|
+
*/
|
|
7
|
+
import type { Collection, CollectionItem, ICollectionService } from '../collection/interfaces';
|
|
8
|
+
import type { IEnvironmentConfigService } from '../environment/interfaces';
|
|
9
|
+
import type { RequestScripts } from '../types/types';
|
|
10
|
+
/**
|
|
11
|
+
* Write an env file given an object of key/value pairs. Existing file is overwritten.
|
|
12
|
+
*/
|
|
13
|
+
export declare function writeEnvFile(filePath: string, vars?: Record<string, string>): void;
|
|
14
|
+
/**
|
|
15
|
+
* Write pre/post scripts to separate files (pre.js and post.js). If no content, does nothing.
|
|
16
|
+
*/
|
|
17
|
+
export declare function writeScriptFile(dir: string, baseName: string, scripts?: RequestScripts | undefined): void;
|
|
18
|
+
/**
|
|
19
|
+
* Determine the folder where REST-Client exports should be saved.
|
|
20
|
+
*
|
|
21
|
+
* The setting value may be an absolute path or a workspace-relative
|
|
22
|
+
* path. If the provided `pathSetting` is empty/undefined the default
|
|
23
|
+
* "collections-rest-client" directory under the workspace root is used.
|
|
24
|
+
*/
|
|
25
|
+
export declare function getRestClientExportFolder(workspaceFolder: string, pathSetting?: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Perform a complete export for a given collection ID into the specified folder.
|
|
28
|
+
* This includes the collection requests and environment exports (honoring the
|
|
29
|
+
* mergeGlobals workspace setting).
|
|
30
|
+
*/
|
|
31
|
+
export declare function exportCollectionToRestClient(collectionService: ICollectionService, envConfigService: IEnvironmentConfigService, collectionId: string, targetFolder: string, mergeGlobals: boolean): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Recursively write a folder's items (folders and requests) into the output path.
|
|
34
|
+
*/
|
|
35
|
+
export declare function writeFolderItems(items: CollectionItem[], dest: string, collection: Collection): void;
|
package/dist/index.d.ts
CHANGED
|
@@ -18,10 +18,92 @@
|
|
|
18
18
|
*/
|
|
19
19
|
export { ForgeContainer } from './container';
|
|
20
20
|
export type { ForgeContainerOptions, StorageFormat } from './container';
|
|
21
|
-
export * from './
|
|
22
|
-
export
|
|
21
|
+
export * from './types/types';
|
|
22
|
+
export * from './types/platform';
|
|
23
|
+
export * from './types/console-service';
|
|
24
|
+
export * from './cookie/interfaces';
|
|
25
|
+
export { CookieJar } from './cookie/cookie-jar';
|
|
26
|
+
export { CookieUtils } from './cookie/cookie-utils';
|
|
27
|
+
export { InMemoryCookieJar } from './cookie/in-memory-cookie-jar';
|
|
28
|
+
export { PersistentCookieJar } from './cookie/persistent-cookie-jar';
|
|
29
|
+
export { CookieService } from './cookie/cookie-service';
|
|
30
|
+
export type { IHttpRequestService } from './http/interfaces';
|
|
31
|
+
export { FetchHttpClient } from './http/fetch-http-client';
|
|
32
|
+
export { DEFAULT_REQUEST_SETTINGS, NodeHttpClient } from './http/native-http-client';
|
|
33
|
+
export { InterceptorChain, LoggingRequestInterceptor, RetryErrorInterceptor, TimingResponseInterceptor } from './http/interceptor-chain';
|
|
34
|
+
export type { IErrorInterceptor, IInterceptorChain, InterceptorContext, IRequestInterceptor, IResponseInterceptor } from './http/interceptor-chain';
|
|
35
|
+
export { mergeRequestSettings } from './http/merge-request-settings';
|
|
36
|
+
export { RequestPreprocessor } from './http/request-preprocessor';
|
|
37
|
+
export type { IRequestPreprocessor } from './http/request-preprocessor';
|
|
38
|
+
export { HttpRequestService } from './http/http-request-service';
|
|
39
|
+
export { UrlBuilder } from './http/url-builder';
|
|
40
|
+
export type { IUrlBuilder } from './http/url-builder';
|
|
41
|
+
export * from './script/interfaces';
|
|
42
|
+
export { ScriptExecutor } from './script/script-executor';
|
|
43
|
+
export { RequestScriptSession } from './script/request-script-session';
|
|
44
|
+
export type { SessionDependencies } from './script/request-script-session';
|
|
45
|
+
export { createExpectChain, createResponseObject } from './script/script-factories';
|
|
46
|
+
export type { ExpectChain, ResponseAssertions, ScriptResponse } from './script/script-factories';
|
|
47
|
+
export { concatenateScripts, createScriptConsole, createTestFunction, formatConsoleOutput, hasChanged, normalizeHeaders } from './script/script-utils';
|
|
48
|
+
export type { ConsoleMessage } from './script/script-utils';
|
|
49
|
+
export { ModuleLoader, createLodashShim, createModuleLoader, createMomentShim } from './script/module-loader';
|
|
50
|
+
export type { ModuleLoaderOptions } from './script/module-loader';
|
|
51
|
+
export * from './collection/interfaces';
|
|
52
|
+
export { CollectionLoader } from './collection/collection-loader';
|
|
53
|
+
export type { LoadOptions } from './collection/collection-loader';
|
|
54
|
+
export { CollectionLoaderFactory } from './collection/collection-loader-factory';
|
|
55
|
+
export { CollectionService } from './collection/collection-service';
|
|
56
|
+
export { FolderCollectionLoader, generateSlug } from './collection/folder-collection-loader';
|
|
57
|
+
export { FolderCollectionStore } from './collection/folder-collection-store';
|
|
58
|
+
export { JsonCollectionLoader } from './collection/json-collection-loader';
|
|
59
|
+
export { ParserRegistry } from './collection/parser-registry';
|
|
60
|
+
export * from './environment/interfaces';
|
|
61
|
+
export { EnvironmentConfigService } from './environment/environment-config-service';
|
|
62
|
+
export { EnvironmentResolver } from './environment/environment-resolver';
|
|
63
|
+
export type { Environment, EnvironmentStoreConfig } from './environment/environment-resolver';
|
|
64
|
+
export { ForgeEnv } from './environment/forge-env';
|
|
65
|
+
export type { IForgeEnv } from './environment/forge-env';
|
|
66
|
+
export { VariableInterpolator, VariableResolver, createVariableResolver } from './environment/variable-interpolator';
|
|
67
|
+
export type { VariableResolverConfig } from './environment/variable-interpolator';
|
|
68
|
+
export * from './execution/collection-request-executor-interfaces';
|
|
69
|
+
export * from './execution/request-preparer-interfaces';
|
|
70
|
+
export { CollectionRequestExecutor } from './execution/collection-request-executor';
|
|
71
|
+
export { RequestExecutor } from './execution/request-executor';
|
|
72
|
+
export type { ExecuteOptions, ExecuteResult } from './execution/request-executor';
|
|
73
|
+
export { RequestPreparer } from './execution/request-preparer';
|
|
74
|
+
export * from './history/history-interfaces';
|
|
75
|
+
export type { IRequestHistoryService, IResponseStorage } from './history/request-history-service-interfaces';
|
|
76
|
+
export { RequestHistoryStore } from './history/request-history';
|
|
77
|
+
export { RequestHistoryService } from './history/request-history-service';
|
|
78
|
+
export * from './auth/interfaces';
|
|
79
|
+
export { OAuth2TokenManager } from './auth/oauth2-token-manager';
|
|
80
|
+
export { getCompletions, parseQueryContext } from './graphql/graphql-completion-provider';
|
|
81
|
+
export type { CompletionItem, ContextType, QueryContext } from './graphql/graphql-completion-provider';
|
|
82
|
+
export { GraphQLSchemaService } from './graphql/graphql-schema-service';
|
|
83
|
+
export type { GraphQLDirective, GraphQLField, GraphQLOperation, GraphQLSchema, GraphQLType, IGraphQLSchemaService } from './graphql/graphql-schema-service';
|
|
84
|
+
export * from './openapi/interfaces';
|
|
85
|
+
export { ExampleGenerator, HistoryAnalyzer, OpenApiExporter, OpenApiImporter, RefResolver, SchemaInferenceService, SchemaInferrer, ScriptAnalyzer } from './openapi';
|
|
86
|
+
export type { OpenApiExportOptions, OpenApiImportOptions, ScriptAnalysisResult } from './openapi';
|
|
87
|
+
export { CONFIG_FILES, ConfigService, DEFAULT_CONFIG, ROOT_DIRECTORIES } from './config';
|
|
88
|
+
export type { EnvironmentsConfig, HttpForgeConfig, IConfigService, ProxyConfig, RequestConfig, RestClientExportConfig, RunnerConfig, ScriptsConfig, StorageConfig } from './config';
|
|
89
|
+
export { DEFAULT_SUITE_CONFIG } from './test-suite/interfaces';
|
|
90
|
+
export type { ErrorSummary, IStatisticsService, ITestSuiteService, RequestStatistics, RunStatistics, RunSummary, SuiteConfig, SuiteRequest, TestSuite } from './test-suite/interfaces';
|
|
91
|
+
export { HTTP_METHOD_MAP, HTTP_METHOD_REVERSE, buildResultFileName, expandSummary } from './test-suite/result-storage';
|
|
92
|
+
export type { FullResultDetails, IResultStorageService, IndexPage, RecentError, RequestStats, ResultSummary, RunConfig, RunManifest, RunStats } from './test-suite/result-storage';
|
|
93
|
+
export { ResultStorageService } from './test-suite/result-storage-service';
|
|
94
|
+
export { StatisticsService } from './test-suite/statistics-service';
|
|
95
|
+
export { TestSuiteService } from './test-suite/test-suite-service';
|
|
96
|
+
export type { SuitesChangedCallback } from './test-suite/test-suite-service';
|
|
97
|
+
export { TestSuiteStore } from './test-suite/test-suite-store';
|
|
98
|
+
export type { ITestSuiteStore, SuiteRequestEntry } from './test-suite/test-suite-store';
|
|
23
99
|
export { HttpForgeParser } from './parsers';
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export
|
|
27
|
-
|
|
100
|
+
export { parsePostmanEnvironment, parsePostmanEnvironmentFile } from './import-export/import-postman-environment';
|
|
101
|
+
export type { ImportedEnvironment } from './import-export/import-postman-environment';
|
|
102
|
+
export { exportCollectionToRestClient, getRestClientExportFolder, writeEnvFile, writeFolderItems, writeScriptFile } from './import-export/rest-client-export';
|
|
103
|
+
export { NodeFileSystem } from './platform/node-file-system';
|
|
104
|
+
export { DataFileParser } from './platform/data-file-parser';
|
|
105
|
+
export type { IDataFileParser } from './platform/data-file-parser';
|
|
106
|
+
export { DYNAMIC_VARIABLES, augmentWithDynamicVars, resolveDynamicVariable, resolveDynamicVariablesInString } from './utils/dynamic-variables';
|
|
107
|
+
export { evaluateExpression, isExpression } from './utils/expression-evaluator';
|
|
108
|
+
export { applyFilterChain, parseFilterChain } from './utils/filter-engine';
|
|
109
|
+
export { deepClone, formatBytes, formatDuration, generateId, generateUUID, isPlainObject, mergeHeadersCaseInsensitive, safeJsonParse, sanitizeName } from './utils/helpers';
|