@apiquest/fracture 1.0.4 → 1.0.6

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 (87) hide show
  1. package/README.md +90 -2
  2. package/dist/CollectionRunner.d.ts +3 -0
  3. package/dist/CollectionRunner.d.ts.map +1 -1
  4. package/dist/CollectionRunner.js +249 -154
  5. package/dist/CollectionRunner.js.map +1 -1
  6. package/dist/CollectionValidator.d.ts.map +1 -1
  7. package/dist/CollectionValidator.js +11 -0
  8. package/dist/CollectionValidator.js.map +1 -1
  9. package/dist/ConsoleReporter.d.ts.map +1 -1
  10. package/dist/ConsoleReporter.js +9 -6
  11. package/dist/ConsoleReporter.js.map +1 -1
  12. package/dist/DagScheduler.d.ts.map +1 -1
  13. package/dist/DagScheduler.js +11 -0
  14. package/dist/DagScheduler.js.map +1 -1
  15. package/dist/LibraryLoader.d.ts +49 -0
  16. package/dist/LibraryLoader.d.ts.map +1 -0
  17. package/dist/LibraryLoader.js +198 -0
  18. package/dist/LibraryLoader.js.map +1 -0
  19. package/dist/PluginLoader.d.ts.map +1 -1
  20. package/dist/PluginLoader.js +9 -6
  21. package/dist/PluginLoader.js.map +1 -1
  22. package/dist/PluginManager.d.ts.map +1 -1
  23. package/dist/PluginManager.js +11 -7
  24. package/dist/PluginManager.js.map +1 -1
  25. package/dist/PluginResolver.d.ts +1 -1
  26. package/dist/PluginResolver.d.ts.map +1 -1
  27. package/dist/PluginResolver.js +1 -1
  28. package/dist/PluginResolver.js.map +1 -1
  29. package/dist/QuestAPI.d.ts.map +1 -1
  30. package/dist/QuestAPI.js +114 -217
  31. package/dist/QuestAPI.js.map +1 -1
  32. package/dist/ScriptEngine.d.ts +2 -1
  33. package/dist/ScriptEngine.d.ts.map +1 -1
  34. package/dist/ScriptEngine.js +15 -8
  35. package/dist/ScriptEngine.js.map +1 -1
  36. package/dist/TaskGraph.d.ts +2 -1
  37. package/dist/TaskGraph.d.ts.map +1 -1
  38. package/dist/TaskGraph.js +28 -26
  39. package/dist/TaskGraph.js.map +1 -1
  40. package/dist/VariableResolver.d.ts +1 -1
  41. package/dist/VariableResolver.js +10 -10
  42. package/dist/VariableResolver.js.map +1 -1
  43. package/dist/cli/index.js +35 -3
  44. package/dist/cli/index.js.map +1 -1
  45. package/dist/cli/plugin-commands.d.ts.map +1 -1
  46. package/dist/cli/plugin-commands.js +47 -81
  47. package/dist/cli/plugin-commands.js.map +1 -1
  48. package/dist/cli/plugin-installer.d.ts +48 -0
  49. package/dist/cli/plugin-installer.d.ts.map +1 -0
  50. package/dist/cli/plugin-installer.js +136 -0
  51. package/dist/cli/plugin-installer.js.map +1 -0
  52. package/dist/cli/plugin-registry.d.ts +17 -0
  53. package/dist/cli/plugin-registry.d.ts.map +1 -0
  54. package/dist/cli/plugin-registry.js +77 -0
  55. package/dist/cli/plugin-registry.js.map +1 -0
  56. package/package.json +1 -1
  57. package/tsconfig.json +1 -0
  58. package/tsconfig.test.json +3 -0
  59. package/dist/QuestAPI.types.d.ts +0 -35
  60. package/dist/QuestAPI.types.d.ts.map +0 -1
  61. package/dist/QuestAPI.types.js +0 -3
  62. package/dist/QuestAPI.types.js.map +0 -1
  63. package/src/CollectionAnalyzer.ts +0 -102
  64. package/src/CollectionRunner.ts +0 -1423
  65. package/src/CollectionRunner.types.ts +0 -9
  66. package/src/CollectionValidator.ts +0 -289
  67. package/src/ConsoleReporter.ts +0 -143
  68. package/src/CookieJar.ts +0 -258
  69. package/src/DagScheduler.ts +0 -439
  70. package/src/Logger.ts +0 -85
  71. package/src/PluginLoader.ts +0 -126
  72. package/src/PluginManager.ts +0 -208
  73. package/src/PluginResolver.ts +0 -154
  74. package/src/QuestAPI.ts +0 -764
  75. package/src/QuestAPI.types.ts +0 -33
  76. package/src/QuestTestAPI.ts +0 -164
  77. package/src/RequestFilter.ts +0 -224
  78. package/src/ScriptEngine.ts +0 -219
  79. package/src/ScriptValidator.ts +0 -428
  80. package/src/TaskGraph.ts +0 -598
  81. package/src/TestCounter.ts +0 -109
  82. package/src/VariableResolver.ts +0 -114
  83. package/src/cli/index.ts +0 -480
  84. package/src/cli/plugin-commands.ts +0 -342
  85. package/src/cli/plugin-discovery.ts +0 -44
  86. package/src/index.ts +0 -24
  87. package/src/utils.ts +0 -52
@@ -1,3 +0,0 @@
1
- // Type definitions for Quest API
2
- export {};
3
- //# sourceMappingURL=QuestAPI.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QuestAPI.types.js","sourceRoot":"","sources":["../src/QuestAPI.types.ts"],"names":[],"mappings":"AAAA,iCAAiC"}
@@ -1,102 +0,0 @@
1
- import type { Collection, Request, CollectionItem, Auth, Variable } from '@apiquest/types';
2
- import { isNullOrEmpty, hasItems, isValidAuth, isValidAuthType } from './utils.js';
3
- import { Logger } from './Logger.js';
4
-
5
- export interface PluginRequirements {
6
- protocols: Set<string>;
7
- authTypes: Set<string>;
8
- valueProviders: Set<string>;
9
- }
10
-
11
- export class CollectionAnalyzer {
12
- private logger: Logger;
13
-
14
- constructor(baseLogger?: Logger) {
15
- this.logger = baseLogger?.createLogger('CollectionAnalyzer') ?? new Logger('CollectionAnalyzer');
16
- }
17
-
18
- /**
19
- * Analyze a collection to determine which plugins are needed
20
- * Per schema: protocol is collection-level, auth can be at any level, variables can have providers
21
- */
22
- analyzeRequirements(collection: Collection): PluginRequirements {
23
- this.logger.debug(`Analyzing collection requirements: ${collection.info.name}`);
24
- const requirements: PluginRequirements = {
25
- protocols: new Set(),
26
- authTypes: new Set(),
27
- valueProviders: new Set()
28
- };
29
-
30
- // Protocol is at collection level (schema line 16-18)
31
- if (!isNullOrEmpty(collection.protocol)) {
32
- requirements.protocols.add(collection.protocol);
33
- this.logger.trace(`Protocol requirement: ${collection.protocol}`);
34
- }
35
-
36
- // Scan collection-level auth
37
- if (isValidAuth(collection.auth)) {
38
- this.logger.trace(`Collection auth requirement: ${collection.auth?.type}`);
39
- this.scanAuth(collection.auth, requirements);
40
- }
41
-
42
- // Scan all items for folder/request-level auth
43
- if (hasItems(collection.items)) {
44
- this.scanItems(collection.items, requirements);
45
- }
46
-
47
- // Scan variables for provider field (schema line 123-126)
48
- this.scanVariables(collection, requirements);
49
-
50
- this.logger.debug(
51
- `Requirements resolved: protocols=${requirements.protocols.size}, auth=${requirements.authTypes.size}, providers=${requirements.valueProviders.size}`
52
- );
53
-
54
- return requirements;
55
- }
56
-
57
- private scanItems(items: CollectionItem[], requirements: PluginRequirements): void {
58
- for (const item of items) {
59
- if (item.type === 'folder' && hasItems(item.items)) {
60
- // Scan folder-level auth
61
- if (isValidAuth(item.auth)) {
62
- this.logger.trace(`Folder auth requirement: ${item.auth?.type}`);
63
- this.scanAuth(item.auth, requirements);
64
- }
65
-
66
- // Recursively scan folder items
67
- this.scanItems(item.items, requirements);
68
- } else if (item.type === 'request') {
69
- const request = item;
70
-
71
- // Scan request-level auth
72
- if (isValidAuth(request.auth)) {
73
- this.logger.trace(`Request auth requirement: ${request.auth?.type}`);
74
- this.scanAuth(request.auth, requirements);
75
- }
76
- }
77
- }
78
- }
79
-
80
- private scanAuth(auth: Auth, requirements: PluginRequirements): void {
81
- // Skip 'none' and 'inherit' - they're not plugin types
82
- if (isValidAuthType(auth.type)) {
83
- requirements.authTypes.add(auth.type);
84
- }
85
- }
86
-
87
- private scanVariables(collection: Collection, requirements: PluginRequirements): void {
88
- // Scan collection variables for provider field (variable objects, not just strings)
89
- const variables = collection.variables ?? {};
90
-
91
- for (const value of Object.values(variables)) {
92
- // Variables can be strings OR variable objects with provider field
93
- if (typeof value === 'object' && value !== null) {
94
- const varObj = value;
95
- if (varObj.provider !== null && varObj.provider !== undefined && varObj.provider !== '') {
96
- requirements.valueProviders.add(varObj.provider);
97
- this.logger.trace(`Variable provider requirement: ${varObj.provider}`);
98
- }
99
- }
100
- }
101
- }
102
- }