@apiquest/fracture 1.0.2 → 1.0.4
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 +119 -0
- package/bin/cli.js +2 -2
- package/dist/CollectionRunner.js +3 -3
- package/dist/ScriptEngine.js +4 -4
- package/dist/cli/plugin-commands.d.ts.map +1 -1
- package/dist/cli/plugin-commands.js +2 -1
- package/dist/cli/plugin-commands.js.map +1 -1
- package/package.json +55 -50
- package/src/CollectionAnalyzer.ts +102 -102
- package/src/CollectionRunner.ts +1423 -1423
- package/src/CollectionRunner.types.ts +9 -9
- package/src/CollectionValidator.ts +289 -289
- package/src/ConsoleReporter.ts +143 -143
- package/src/CookieJar.ts +258 -258
- package/src/DagScheduler.ts +439 -439
- package/src/Logger.ts +85 -85
- package/src/PluginLoader.ts +126 -126
- package/src/PluginManager.ts +208 -208
- package/src/PluginResolver.ts +154 -154
- package/src/QuestAPI.ts +764 -764
- package/src/QuestAPI.types.ts +33 -33
- package/src/QuestTestAPI.ts +164 -164
- package/src/RequestFilter.ts +224 -224
- package/src/ScriptEngine.ts +219 -219
- package/src/ScriptValidator.ts +428 -428
- package/src/TaskGraph.ts +598 -598
- package/src/TestCounter.ts +109 -109
- package/src/VariableResolver.ts +114 -114
- package/src/cli/index.ts +480 -480
- package/src/cli/plugin-commands.ts +342 -341
- package/src/cli/plugin-discovery.ts +44 -44
- package/src/index.ts +24 -24
- package/src/utils.ts +52 -52
- package/tsconfig.json +20 -20
- package/tsconfig.test.json +5 -5
- package/vitest.config.ts +22 -22
- package/dist/ExecutionTree.d.ts +0 -77
- package/dist/ExecutionTree.d.ts.map +0 -1
- package/dist/ExecutionTree.js +0 -265
- package/dist/ExecutionTree.js.map +0 -1
- package/dist/fracture/src/CollectionAnalyzer.d.ts +0 -17
- package/dist/fracture/src/CollectionAnalyzer.d.ts.map +0 -1
- package/dist/fracture/src/CollectionAnalyzer.js +0 -70
- package/dist/fracture/src/CollectionAnalyzer.js.map +0 -1
- package/dist/fracture/src/CollectionRunner.d.ts +0 -39
- package/dist/fracture/src/CollectionRunner.d.ts.map +0 -1
- package/dist/fracture/src/CollectionRunner.js +0 -802
- package/dist/fracture/src/CollectionRunner.js.map +0 -1
- package/dist/fracture/src/CollectionRunner.types.d.ts +0 -8
- package/dist/fracture/src/CollectionRunner.types.d.ts.map +0 -1
- package/dist/fracture/src/CollectionRunner.types.js +0 -2
- package/dist/fracture/src/CollectionRunner.types.js.map +0 -1
- package/dist/fracture/src/CollectionValidator.d.ts +0 -14
- package/dist/fracture/src/CollectionValidator.d.ts.map +0 -1
- package/dist/fracture/src/CollectionValidator.js +0 -145
- package/dist/fracture/src/CollectionValidator.js.map +0 -1
- package/dist/fracture/src/ConsoleReporter.d.ts +0 -24
- package/dist/fracture/src/ConsoleReporter.d.ts.map +0 -1
- package/dist/fracture/src/ConsoleReporter.js +0 -123
- package/dist/fracture/src/ConsoleReporter.js.map +0 -1
- package/dist/fracture/src/CookieJar.d.ts +0 -70
- package/dist/fracture/src/CookieJar.d.ts.map +0 -1
- package/dist/fracture/src/CookieJar.js +0 -233
- package/dist/fracture/src/CookieJar.js.map +0 -1
- package/dist/fracture/src/ExecutionTree.d.ts +0 -77
- package/dist/fracture/src/ExecutionTree.d.ts.map +0 -1
- package/dist/fracture/src/ExecutionTree.js +0 -258
- package/dist/fracture/src/ExecutionTree.js.map +0 -1
- package/dist/fracture/src/Logger.d.ts +0 -25
- package/dist/fracture/src/Logger.d.ts.map +0 -1
- package/dist/fracture/src/Logger.js +0 -78
- package/dist/fracture/src/Logger.js.map +0 -1
- package/dist/fracture/src/PluginLoader.d.ts +0 -23
- package/dist/fracture/src/PluginLoader.d.ts.map +0 -1
- package/dist/fracture/src/PluginLoader.js +0 -102
- package/dist/fracture/src/PluginLoader.js.map +0 -1
- package/dist/fracture/src/PluginManager.d.ts +0 -64
- package/dist/fracture/src/PluginManager.d.ts.map +0 -1
- package/dist/fracture/src/PluginManager.js +0 -162
- package/dist/fracture/src/PluginManager.js.map +0 -1
- package/dist/fracture/src/PluginResolver.d.ts +0 -35
- package/dist/fracture/src/PluginResolver.d.ts.map +0 -1
- package/dist/fracture/src/PluginResolver.js +0 -128
- package/dist/fracture/src/PluginResolver.js.map +0 -1
- package/dist/fracture/src/QuestAPI.d.ts +0 -9
- package/dist/fracture/src/QuestAPI.d.ts.map +0 -1
- package/dist/fracture/src/QuestAPI.js +0 -679
- package/dist/fracture/src/QuestAPI.js.map +0 -1
- package/dist/fracture/src/QuestAPI.types.d.ts +0 -35
- package/dist/fracture/src/QuestAPI.types.d.ts.map +0 -1
- package/dist/fracture/src/QuestAPI.types.js +0 -3
- package/dist/fracture/src/QuestAPI.types.js.map +0 -1
- package/dist/fracture/src/QuestTestAPI.d.ts +0 -12
- package/dist/fracture/src/QuestTestAPI.d.ts.map +0 -1
- package/dist/fracture/src/QuestTestAPI.js +0 -133
- package/dist/fracture/src/QuestTestAPI.js.map +0 -1
- package/dist/fracture/src/ScriptEngine.d.ts +0 -21
- package/dist/fracture/src/ScriptEngine.d.ts.map +0 -1
- package/dist/fracture/src/ScriptEngine.js +0 -183
- package/dist/fracture/src/ScriptEngine.js.map +0 -1
- package/dist/fracture/src/ScriptValidator.d.ts +0 -68
- package/dist/fracture/src/ScriptValidator.d.ts.map +0 -1
- package/dist/fracture/src/ScriptValidator.js +0 -351
- package/dist/fracture/src/ScriptValidator.js.map +0 -1
- package/dist/fracture/src/TestCounter.d.ts +0 -18
- package/dist/fracture/src/TestCounter.d.ts.map +0 -1
- package/dist/fracture/src/TestCounter.js +0 -82
- package/dist/fracture/src/TestCounter.js.map +0 -1
- package/dist/fracture/src/VariableResolver.d.ts +0 -20
- package/dist/fracture/src/VariableResolver.d.ts.map +0 -1
- package/dist/fracture/src/VariableResolver.js +0 -100
- package/dist/fracture/src/VariableResolver.js.map +0 -1
- package/dist/fracture/src/cli/index.d.ts +0 -3
- package/dist/fracture/src/cli/index.d.ts.map +0 -1
- package/dist/fracture/src/cli/index.js +0 -347
- package/dist/fracture/src/cli/index.js.map +0 -1
- package/dist/fracture/src/cli/plugin-commands.d.ts +0 -6
- package/dist/fracture/src/cli/plugin-commands.d.ts.map +0 -1
- package/dist/fracture/src/cli/plugin-commands.js +0 -263
- package/dist/fracture/src/cli/plugin-commands.js.map +0 -1
- package/dist/fracture/src/cli/plugin-discovery.d.ts +0 -11
- package/dist/fracture/src/cli/plugin-discovery.d.ts.map +0 -1
- package/dist/fracture/src/cli/plugin-discovery.js +0 -64
- package/dist/fracture/src/cli/plugin-discovery.js.map +0 -1
- package/dist/fracture/src/index.d.ts +0 -13
- package/dist/fracture/src/index.d.ts.map +0 -1
- package/dist/fracture/src/index.js +0 -17
- package/dist/fracture/src/index.js.map +0 -1
- package/dist/fracture/src/utils.d.ts +0 -28
- package/dist/fracture/src/utils.d.ts.map +0 -1
- package/dist/fracture/src/utils.js +0 -48
- package/dist/fracture/src/utils.js.map +0 -1
- package/dist/plugin-auth/src/apikey-auth.d.ts +0 -3
- package/dist/plugin-auth/src/apikey-auth.d.ts.map +0 -1
- package/dist/plugin-auth/src/apikey-auth.js +0 -73
- package/dist/plugin-auth/src/apikey-auth.js.map +0 -1
- package/dist/plugin-auth/src/basic-auth.d.ts +0 -3
- package/dist/plugin-auth/src/basic-auth.d.ts.map +0 -1
- package/dist/plugin-auth/src/basic-auth.js +0 -61
- package/dist/plugin-auth/src/basic-auth.js.map +0 -1
- package/dist/plugin-auth/src/bearer-auth.d.ts +0 -3
- package/dist/plugin-auth/src/bearer-auth.d.ts.map +0 -1
- package/dist/plugin-auth/src/bearer-auth.js +0 -49
- package/dist/plugin-auth/src/bearer-auth.js.map +0 -1
- package/dist/plugin-auth/src/helpers.d.ts +0 -3
- package/dist/plugin-auth/src/helpers.d.ts.map +0 -1
- package/dist/plugin-auth/src/helpers.js +0 -8
- package/dist/plugin-auth/src/helpers.js.map +0 -1
- package/dist/plugin-auth/src/index.d.ts +0 -10
- package/dist/plugin-auth/src/index.d.ts.map +0 -1
- package/dist/plugin-auth/src/index.js +0 -25
- package/dist/plugin-auth/src/index.js.map +0 -1
- package/dist/plugin-auth/src/oauth2-auth.d.ts +0 -35
- package/dist/plugin-auth/src/oauth2-auth.d.ts.map +0 -1
- package/dist/plugin-auth/src/oauth2-auth.js +0 -266
- package/dist/plugin-auth/src/oauth2-auth.js.map +0 -1
- package/dist/plugin-http/src/index.d.ts +0 -4
- package/dist/plugin-http/src/index.d.ts.map +0 -1
- package/dist/plugin-http/src/index.js +0 -266
- package/dist/plugin-http/src/index.js.map +0 -1
- package/dist/plugin-vault-file/src/index.d.ts +0 -67
- package/dist/plugin-vault-file/src/index.d.ts.map +0 -1
- package/dist/plugin-vault-file/src/index.js +0 -171
- package/dist/plugin-vault-file/src/index.js.map +0 -1
- package/dist/types.d.ts +0 -374
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -13
- package/dist/types.js.map +0 -1
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { execSync } from 'child_process';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import { fileURLToPath } from 'url';
|
|
4
|
-
import { dirname } from 'path';
|
|
5
|
-
import fs from 'fs';
|
|
6
|
-
|
|
7
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
-
const __dirname = dirname(__filename);
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Get plugin directories for CLI
|
|
12
|
-
* Returns an array of directories to scan for plugins
|
|
13
|
-
*/
|
|
14
|
-
export function getPluginDirectories(): string[] {
|
|
15
|
-
const dirs: string[] = [];
|
|
16
|
-
|
|
17
|
-
// 1. Development packages folder
|
|
18
|
-
// The CLI dist is at packages/cli/dist, so __dirname/../../ gets us to workspace packages
|
|
19
|
-
const devPackagesDir = path.resolve(__dirname, '../../..');
|
|
20
|
-
|
|
21
|
-
// Check if packages folder exists (we're in dev workspace)
|
|
22
|
-
if (fs.existsSync(devPackagesDir) && fs.statSync(devPackagesDir).isDirectory()) {
|
|
23
|
-
// Verify it's the packages folder by checking for multiple @apiquest packages
|
|
24
|
-
const entries = fs.readdirSync(devPackagesDir);
|
|
25
|
-
const hasPluginAuth = entries.includes('plugin-auth');
|
|
26
|
-
const hasPluginHttp = entries.includes('plugin-http');
|
|
27
|
-
|
|
28
|
-
if (hasPluginAuth && hasPluginHttp) {
|
|
29
|
-
console.debug(`[CLI] DEV MODE: Loading plugins from ${devPackagesDir}`);
|
|
30
|
-
dirs.push(devPackagesDir);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// 2. Global npm packages (@apiquest scope)
|
|
35
|
-
try {
|
|
36
|
-
const globalNodeModules = execSync('npm root -g', { encoding: 'utf-8' }).trim();
|
|
37
|
-
const globalApiquestDir = path.join(globalNodeModules, '@apiquest');
|
|
38
|
-
dirs.push(globalApiquestDir);
|
|
39
|
-
} catch (error) {
|
|
40
|
-
console.warn('[CLI] Could not determine global npm directory:', error);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return dirs;
|
|
44
|
-
}
|
|
1
|
+
import { execSync } from 'child_process';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
import { dirname } from 'path';
|
|
5
|
+
import fs from 'fs';
|
|
6
|
+
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = dirname(__filename);
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Get plugin directories for CLI
|
|
12
|
+
* Returns an array of directories to scan for plugins
|
|
13
|
+
*/
|
|
14
|
+
export function getPluginDirectories(): string[] {
|
|
15
|
+
const dirs: string[] = [];
|
|
16
|
+
|
|
17
|
+
// 1. Development packages folder
|
|
18
|
+
// The CLI dist is at packages/cli/dist, so __dirname/../../ gets us to workspace packages
|
|
19
|
+
const devPackagesDir = path.resolve(__dirname, '../../..');
|
|
20
|
+
|
|
21
|
+
// Check if packages folder exists (we're in dev workspace)
|
|
22
|
+
if (fs.existsSync(devPackagesDir) && fs.statSync(devPackagesDir).isDirectory()) {
|
|
23
|
+
// Verify it's the packages folder by checking for multiple @apiquest packages
|
|
24
|
+
const entries = fs.readdirSync(devPackagesDir);
|
|
25
|
+
const hasPluginAuth = entries.includes('plugin-auth');
|
|
26
|
+
const hasPluginHttp = entries.includes('plugin-http');
|
|
27
|
+
|
|
28
|
+
if (hasPluginAuth && hasPluginHttp) {
|
|
29
|
+
console.debug(`[CLI] DEV MODE: Loading plugins from ${devPackagesDir}`);
|
|
30
|
+
dirs.push(devPackagesDir);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// 2. Global npm packages (@apiquest scope)
|
|
35
|
+
try {
|
|
36
|
+
const globalNodeModules = execSync('npm root -g', { encoding: 'utf-8' }).trim();
|
|
37
|
+
const globalApiquestDir = path.join(globalNodeModules, '@apiquest');
|
|
38
|
+
dirs.push(globalApiquestDir);
|
|
39
|
+
} catch (error) {
|
|
40
|
+
console.warn('[CLI] Could not determine global npm directory:', error);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return dirs;
|
|
44
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
// Main exports for @apiquest/fracture
|
|
2
|
-
export * from './CollectionRunner.js';
|
|
3
|
-
export * from './VariableResolver.js';
|
|
4
|
-
export * from './ScriptEngine.js';
|
|
5
|
-
export * from './PluginManager.js';
|
|
6
|
-
export * from './ConsoleReporter.js';
|
|
7
|
-
|
|
8
|
-
// Convenience function for quick runs
|
|
9
|
-
import { CollectionRunner } from './CollectionRunner.js';
|
|
10
|
-
import type { Collection, RunOptions, RunResult } from '@apiquest/types';
|
|
11
|
-
|
|
12
|
-
export async function run(options: {
|
|
13
|
-
collection: Collection;
|
|
14
|
-
environment?: RunOptions['environment'];
|
|
15
|
-
data?: RunOptions['data'];
|
|
16
|
-
globalVariables?: RunOptions['globalVariables'];
|
|
17
|
-
}): Promise<RunResult> {
|
|
18
|
-
const runner = new CollectionRunner();
|
|
19
|
-
return await runner.run(options.collection, {
|
|
20
|
-
environment: options.environment,
|
|
21
|
-
data: options.data,
|
|
22
|
-
globalVariables: options.globalVariables
|
|
23
|
-
});
|
|
24
|
-
}
|
|
1
|
+
// Main exports for @apiquest/fracture
|
|
2
|
+
export * from './CollectionRunner.js';
|
|
3
|
+
export * from './VariableResolver.js';
|
|
4
|
+
export * from './ScriptEngine.js';
|
|
5
|
+
export * from './PluginManager.js';
|
|
6
|
+
export * from './ConsoleReporter.js';
|
|
7
|
+
|
|
8
|
+
// Convenience function for quick runs
|
|
9
|
+
import { CollectionRunner } from './CollectionRunner.js';
|
|
10
|
+
import type { Collection, RunOptions, RunResult } from '@apiquest/types';
|
|
11
|
+
|
|
12
|
+
export async function run(options: {
|
|
13
|
+
collection: Collection;
|
|
14
|
+
environment?: RunOptions['environment'];
|
|
15
|
+
data?: RunOptions['data'];
|
|
16
|
+
globalVariables?: RunOptions['globalVariables'];
|
|
17
|
+
}): Promise<RunResult> {
|
|
18
|
+
const runner = new CollectionRunner();
|
|
19
|
+
return await runner.run(options.collection, {
|
|
20
|
+
environment: options.environment,
|
|
21
|
+
data: options.data,
|
|
22
|
+
globalVariables: options.globalVariables
|
|
23
|
+
});
|
|
24
|
+
}
|
package/src/utils.ts
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import type { Variable, Auth, CollectionItem } from '@apiquest/types';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Extract value from string | Variable
|
|
5
|
-
* Respects the enabled flag
|
|
6
|
-
*/
|
|
7
|
-
export function extractValue(value: string | Variable): string {
|
|
8
|
-
if (typeof value === 'string') {
|
|
9
|
-
return value;
|
|
10
|
-
}
|
|
11
|
-
// Check if enabled (default to true if not specified)
|
|
12
|
-
if (value.enabled === false) {
|
|
13
|
-
return '';
|
|
14
|
-
}
|
|
15
|
-
return value.value;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Check if a string value is null, undefined, or empty
|
|
20
|
-
*/
|
|
21
|
-
export function isNullOrEmpty(value: string | null | undefined): boolean {
|
|
22
|
-
return value === null || value === undefined || value === '';
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Check if a string value is null, undefined, empty, or only whitespace
|
|
27
|
-
*/
|
|
28
|
-
export function isNullOrWhitespace(value: string | null | undefined): boolean {
|
|
29
|
-
return value === null || value === undefined || value.trim() === '';
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Check if an array has items
|
|
34
|
-
*/
|
|
35
|
-
export function hasItems(items: CollectionItem[] | null | undefined): boolean {
|
|
36
|
-
return items !== null && items !== undefined && items.length > 0;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Type guard to check if auth is valid (not null/undefined)
|
|
41
|
-
*/
|
|
42
|
-
export function isValidAuth(auth: Auth | null | undefined): auth is Auth {
|
|
43
|
-
return auth !== null && auth !== undefined;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Check if an auth type is valid for plugin lookup
|
|
48
|
-
* Excludes 'none' and 'inherit' as they're not plugin types
|
|
49
|
-
*/
|
|
50
|
-
export function isValidAuthType(type: string | null | undefined): type is string {
|
|
51
|
-
return type !== null && type !== undefined && type !== 'none' && type !== 'inherit';
|
|
52
|
-
}
|
|
1
|
+
import type { Variable, Auth, CollectionItem } from '@apiquest/types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Extract value from string | Variable
|
|
5
|
+
* Respects the enabled flag
|
|
6
|
+
*/
|
|
7
|
+
export function extractValue(value: string | Variable): string {
|
|
8
|
+
if (typeof value === 'string') {
|
|
9
|
+
return value;
|
|
10
|
+
}
|
|
11
|
+
// Check if enabled (default to true if not specified)
|
|
12
|
+
if (value.enabled === false) {
|
|
13
|
+
return '';
|
|
14
|
+
}
|
|
15
|
+
return value.value;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Check if a string value is null, undefined, or empty
|
|
20
|
+
*/
|
|
21
|
+
export function isNullOrEmpty(value: string | null | undefined): boolean {
|
|
22
|
+
return value === null || value === undefined || value === '';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Check if a string value is null, undefined, empty, or only whitespace
|
|
27
|
+
*/
|
|
28
|
+
export function isNullOrWhitespace(value: string | null | undefined): boolean {
|
|
29
|
+
return value === null || value === undefined || value.trim() === '';
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Check if an array has items
|
|
34
|
+
*/
|
|
35
|
+
export function hasItems(items: CollectionItem[] | null | undefined): boolean {
|
|
36
|
+
return items !== null && items !== undefined && items.length > 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Type guard to check if auth is valid (not null/undefined)
|
|
41
|
+
*/
|
|
42
|
+
export function isValidAuth(auth: Auth | null | undefined): auth is Auth {
|
|
43
|
+
return auth !== null && auth !== undefined;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Check if an auth type is valid for plugin lookup
|
|
48
|
+
* Excludes 'none' and 'inherit' as they're not plugin types
|
|
49
|
+
*/
|
|
50
|
+
export function isValidAuthType(type: string | null | undefined): type is string {
|
|
51
|
+
return type !== null && type !== undefined && type !== 'none' && type !== 'inherit';
|
|
52
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "Node16",
|
|
5
|
-
"lib": ["ES2022"],
|
|
6
|
-
"moduleResolution": "node16",
|
|
7
|
-
"outDir": "./dist",
|
|
8
|
-
"declaration": true,
|
|
9
|
-
"declarationMap": true,
|
|
10
|
-
"sourceMap": true,
|
|
11
|
-
"strict": true,
|
|
12
|
-
"esModuleInterop": true,
|
|
13
|
-
"skipLibCheck": true,
|
|
14
|
-
"forceConsistentCasingInFileNames": true,
|
|
15
|
-
"resolveJsonModule": true,
|
|
16
|
-
"allowSyntheticDefaultImports": true
|
|
17
|
-
},
|
|
18
|
-
"include": ["src/**/*"],
|
|
19
|
-
"exclude": ["node_modules", "dist", "tests"]
|
|
20
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "Node16",
|
|
5
|
+
"lib": ["ES2022"],
|
|
6
|
+
"moduleResolution": "node16",
|
|
7
|
+
"outDir": "./dist",
|
|
8
|
+
"declaration": true,
|
|
9
|
+
"declarationMap": true,
|
|
10
|
+
"sourceMap": true,
|
|
11
|
+
"strict": true,
|
|
12
|
+
"esModuleInterop": true,
|
|
13
|
+
"skipLibCheck": true,
|
|
14
|
+
"forceConsistentCasingInFileNames": true,
|
|
15
|
+
"resolveJsonModule": true,
|
|
16
|
+
"allowSyntheticDefaultImports": true
|
|
17
|
+
},
|
|
18
|
+
"include": ["src/**/*"],
|
|
19
|
+
"exclude": ["node_modules", "dist", "tests"]
|
|
20
|
+
}
|
package/tsconfig.test.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"include": ["tests/**/*"],
|
|
4
|
-
"exclude": []
|
|
5
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"include": ["tests/**/*"],
|
|
4
|
+
"exclude": []
|
|
5
|
+
}
|
package/vitest.config.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { defineConfig } from 'vitest/config';
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
test: {
|
|
5
|
-
globals: true,
|
|
6
|
-
environment: 'node',
|
|
7
|
-
exclude: [
|
|
8
|
-
'**/node_modules/**',
|
|
9
|
-
'**/dist/**'
|
|
10
|
-
],
|
|
11
|
-
coverage: {
|
|
12
|
-
provider: 'v8',
|
|
13
|
-
reporter: ['text', 'json', 'html'],
|
|
14
|
-
exclude: [
|
|
15
|
-
'node_modules/',
|
|
16
|
-
'dist/',
|
|
17
|
-
'**/*.d.ts',
|
|
18
|
-
'**/*.config.*'
|
|
19
|
-
]
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
});
|
|
1
|
+
import { defineConfig } from 'vitest/config';
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
test: {
|
|
5
|
+
globals: true,
|
|
6
|
+
environment: 'node',
|
|
7
|
+
exclude: [
|
|
8
|
+
'**/node_modules/**',
|
|
9
|
+
'**/dist/**'
|
|
10
|
+
],
|
|
11
|
+
coverage: {
|
|
12
|
+
provider: 'v8',
|
|
13
|
+
reporter: ['text', 'json', 'html'],
|
|
14
|
+
exclude: [
|
|
15
|
+
'node_modules/',
|
|
16
|
+
'dist/',
|
|
17
|
+
'**/*.d.ts',
|
|
18
|
+
'**/*.config.*'
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
package/dist/ExecutionTree.d.ts
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import type { Collection, Folder, Request, IterationData, ILogger, PathType, NodeType, Auth } from '@apiquest/types';
|
|
2
|
-
/**
|
|
3
|
-
* Represents a node in the collection tree
|
|
4
|
-
* - Tree structure: parent/children for hierarchical organization
|
|
5
|
-
* - Graph structure: dependencies for execution order
|
|
6
|
-
*/
|
|
7
|
-
export declare class ExecutionNode {
|
|
8
|
-
id: string;
|
|
9
|
-
name: string;
|
|
10
|
-
type: NodeType;
|
|
11
|
-
item: Collection | Folder | Request;
|
|
12
|
-
parent: ExecutionNode | null;
|
|
13
|
-
children: ExecutionNode[];
|
|
14
|
-
depth: number;
|
|
15
|
-
path: PathType;
|
|
16
|
-
/**
|
|
17
|
-
* Scripts inherited from parent chain
|
|
18
|
-
* Accumulated during tree construction for efficient execution
|
|
19
|
-
*/
|
|
20
|
-
inheritedScripts: {
|
|
21
|
-
collectionPre?: string;
|
|
22
|
-
collectionPost?: string;
|
|
23
|
-
folderPre?: string[];
|
|
24
|
-
folderPost?: string[];
|
|
25
|
-
preRequest?: string[];
|
|
26
|
-
postRequest?: string[];
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Effective auth for this node (cascades from parents)
|
|
30
|
-
* Request auth > Folder auth > Parent folder auth > Collection auth
|
|
31
|
-
*/
|
|
32
|
-
effectiveAuth?: Auth;
|
|
33
|
-
condition?: string;
|
|
34
|
-
dependsOn: string[];
|
|
35
|
-
constructor(type: NodeType, item: Collection | Folder | Request, parent: ExecutionNode | null);
|
|
36
|
-
/**
|
|
37
|
-
* Accumulate scripts from parent chain
|
|
38
|
-
* All scripts stack (collected from parents during tree construction)
|
|
39
|
-
*/
|
|
40
|
-
private inheritScripts;
|
|
41
|
-
/**
|
|
42
|
-
* Cascade auth from parent chain
|
|
43
|
-
* Child auth overrides parent auth
|
|
44
|
-
*/
|
|
45
|
-
private inheritAuth;
|
|
46
|
-
addChild(child: ExecutionNode): void;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Builds execution tree from collection JSON
|
|
50
|
-
* Handles CLI --data override at construction time
|
|
51
|
-
*/
|
|
52
|
-
export declare class TreeBuilder {
|
|
53
|
-
private cliData;
|
|
54
|
-
private logger;
|
|
55
|
-
constructor(cliData?: IterationData[], logger?: ILogger);
|
|
56
|
-
build(collection: Collection): ExecutionNode;
|
|
57
|
-
private buildChildren;
|
|
58
|
-
private countNodes;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Dependency graph for request execution order
|
|
62
|
-
* Flattens tree to request nodes only, topologically sorted by dependencies
|
|
63
|
-
*/
|
|
64
|
-
export declare class DependencyGraph {
|
|
65
|
-
private nodes;
|
|
66
|
-
private edges;
|
|
67
|
-
constructor(root: ExecutionNode, filterSet?: Set<string> | null);
|
|
68
|
-
private buildGraph;
|
|
69
|
-
/**
|
|
70
|
-
* Topological sort: returns requests grouped by execution level
|
|
71
|
-
* Requests in same level can execute in parallel
|
|
72
|
-
*/
|
|
73
|
-
getExecutionLevels(): string[][];
|
|
74
|
-
getNode(id: string): ExecutionNode | undefined;
|
|
75
|
-
canRunInParallel(idA: string, idB: string): boolean;
|
|
76
|
-
}
|
|
77
|
-
//# sourceMappingURL=ExecutionTree.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExecutionTree.d.ts","sourceRoot":"","sources":["../src/ExecutionTree.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAkB,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAKrI;;;;GAIG;AACH,qBAAa,aAAa;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;IAEpC,MAAM,EAAE,aAAa,GAAG,IAAI,CAAC;IAC7B,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,CAAC;IAEf;;;OAGG;IACH,gBAAgB,EAAE;QAChB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QACrB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;QACtB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;QACtB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;KACxB,CAAC;IAEF;;;OAGG;IACH,aAAa,CAAC,EAAE,IAAI,CAAC;IAGrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,EAAE,CAAC;gBAGlB,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,OAAO,EACnC,MAAM,EAAE,aAAa,GAAG,IAAI;IA6C9B;;;OAGG;IACH,OAAO,CAAC,cAAc;IAuDtB;;;OAGG;IACH,OAAO,CAAC,WAAW;IAoBnB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;CAGrC;AAED;;;GAGG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,OAAO,CAA8B;IAC7C,OAAO,CAAC,MAAM,CAAS;gBAEX,OAAO,CAAC,EAAE,aAAa,EAAE,EAAE,MAAM,CAAC,EAAE,OAAO;IAKvD,KAAK,CAAC,UAAU,EAAE,UAAU,GAAG,aAAa;IAe5C,OAAO,CAAC,aAAa;IAarB,OAAO,CAAC,UAAU;CAOnB;AAED;;;GAGG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,KAAK,CAA6B;IAC1C,OAAO,CAAC,KAAK,CAA2B;gBAE5B,IAAI,EAAE,aAAa,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI;IAM/D,OAAO,CAAC,UAAU;IAkBlB;;;OAGG;IACH,kBAAkB,IAAI,MAAM,EAAE,EAAE;IAoChC,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;IAI9C,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO;CAMpD"}
|