intellitester 0.1.12
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 +200 -0
- package/dist/chunk-35WJGNDA.cjs +136 -0
- package/dist/chunk-35WJGNDA.cjs.map +1 -0
- package/dist/chunk-4B54JUOP.js +234 -0
- package/dist/chunk-4B54JUOP.js.map +1 -0
- package/dist/chunk-5LFSLMQ7.js +2517 -0
- package/dist/chunk-5LFSLMQ7.js.map +1 -0
- package/dist/chunk-6PYKWWH5.js +63 -0
- package/dist/chunk-6PYKWWH5.js.map +1 -0
- package/dist/chunk-ARJYJVRM.cjs +302 -0
- package/dist/chunk-ARJYJVRM.cjs.map +1 -0
- package/dist/chunk-CN6HSJJX.js +133 -0
- package/dist/chunk-CN6HSJJX.js.map +1 -0
- package/dist/chunk-DE5UFTTG.js +31 -0
- package/dist/chunk-DE5UFTTG.js.map +1 -0
- package/dist/chunk-ECBA4GJ3.js +287 -0
- package/dist/chunk-ECBA4GJ3.js.map +1 -0
- package/dist/chunk-OFXNJXMV.cjs +237 -0
- package/dist/chunk-OFXNJXMV.cjs.map +1 -0
- package/dist/chunk-PAKODOH4.cjs +66 -0
- package/dist/chunk-PAKODOH4.cjs.map +1 -0
- package/dist/chunk-QMYM2TCH.cjs +36 -0
- package/dist/chunk-QMYM2TCH.cjs.map +1 -0
- package/dist/chunk-SAVY6D3X.js +125 -0
- package/dist/chunk-SAVY6D3X.js.map +1 -0
- package/dist/chunk-UUJXCHVT.cjs +128 -0
- package/dist/chunk-UUJXCHVT.cjs.map +1 -0
- package/dist/chunk-XWGUA67E.cjs +2552 -0
- package/dist/chunk-XWGUA67E.cjs.map +1 -0
- package/dist/cli/index.cjs +1985 -0
- package/dist/cli/index.cjs.map +1 -0
- package/dist/cli/index.d.cts +1 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +1957 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/core/cleanup/index.cjs +45 -0
- package/dist/core/cleanup/index.cjs.map +1 -0
- package/dist/core/cleanup/index.d.cts +117 -0
- package/dist/core/cleanup/index.d.ts +117 -0
- package/dist/core/cleanup/index.js +8 -0
- package/dist/core/cleanup/index.js.map +1 -0
- package/dist/index.cjs +110 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +852 -0
- package/dist/index.d.ts +852 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/integration/index.cjs +22 -0
- package/dist/integration/index.cjs.map +1 -0
- package/dist/integration/index.d.cts +42 -0
- package/dist/integration/index.d.ts +42 -0
- package/dist/integration/index.js +20 -0
- package/dist/integration/index.js.map +1 -0
- package/dist/providers/appwrite/index.cjs +16 -0
- package/dist/providers/appwrite/index.cjs.map +1 -0
- package/dist/providers/appwrite/index.d.cts +12 -0
- package/dist/providers/appwrite/index.d.ts +12 -0
- package/dist/providers/appwrite/index.js +3 -0
- package/dist/providers/appwrite/index.js.map +1 -0
- package/dist/providers/index.cjs +60 -0
- package/dist/providers/index.cjs.map +1 -0
- package/dist/providers/index.d.cts +13 -0
- package/dist/providers/index.d.ts +13 -0
- package/dist/providers/index.js +7 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/mysql/index.cjs +16 -0
- package/dist/providers/mysql/index.cjs.map +1 -0
- package/dist/providers/mysql/index.d.cts +14 -0
- package/dist/providers/mysql/index.d.ts +14 -0
- package/dist/providers/mysql/index.js +3 -0
- package/dist/providers/mysql/index.js.map +1 -0
- package/dist/providers/postgres/index.cjs +16 -0
- package/dist/providers/postgres/index.cjs.map +1 -0
- package/dist/providers/postgres/index.d.cts +10 -0
- package/dist/providers/postgres/index.d.ts +10 -0
- package/dist/providers/postgres/index.js +3 -0
- package/dist/providers/postgres/index.js.map +1 -0
- package/dist/providers/sqlite/index.cjs +16 -0
- package/dist/providers/sqlite/index.cjs.map +1 -0
- package/dist/providers/sqlite/index.d.cts +11 -0
- package/dist/providers/sqlite/index.d.ts +11 -0
- package/dist/providers/sqlite/index.js +3 -0
- package/dist/providers/sqlite/index.js.map +1 -0
- package/dist/types-LONNVTIF.d.cts +56 -0
- package/dist/types-l-ZaFKC-.d.ts +56 -0
- package/package.json +114 -0
- package/schemas/intellitester.config.schema.json +384 -0
- package/schemas/test.schema.json +517 -0
- package/schemas/workflow.schema.json +227 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { a as CleanupHandler, E as ExecutorOptions, b as CleanupConfig, C as CleanupProvider, c as CleanupResult } from '../../types-l-ZaFKC-.js';
|
|
2
|
+
export { f as CleanupDiscoverConfig, d as CleanupUntrackedOptions, e as CleanupUntrackedResult } from '../../types-l-ZaFKC-.js';
|
|
3
|
+
import { TrackedResource } from '../../integration/index.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Extended options for cleanup execution including provider and config
|
|
7
|
+
*/
|
|
8
|
+
interface ExtendedCleanupOptions extends ExecutorOptions {
|
|
9
|
+
config?: CleanupConfig;
|
|
10
|
+
provider?: CleanupProvider;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Execute cleanup for all tracked resources
|
|
14
|
+
*
|
|
15
|
+
* @param resources - Array of tracked resources to clean up
|
|
16
|
+
* @param handlers - Map of handler names to cleanup functions
|
|
17
|
+
* @param typeMappings - Map of resource types to handler names
|
|
18
|
+
* @param options - Executor options (parallel, retries, config, provider)
|
|
19
|
+
*/
|
|
20
|
+
declare function executeCleanup(resources: TrackedResource[], handlers: Map<string, CleanupHandler>, typeMappings: Record<string, string>, options?: ExtendedCleanupOptions): Promise<CleanupResult>;
|
|
21
|
+
/**
|
|
22
|
+
* Create a cleanup executor with pre-configured handlers and options
|
|
23
|
+
*/
|
|
24
|
+
declare function createCleanupExecutor(handlers: Map<string, CleanupHandler>, typeMappings: Record<string, string>, options?: ExecutorOptions): {
|
|
25
|
+
/**
|
|
26
|
+
* Execute cleanup for resources
|
|
27
|
+
*/
|
|
28
|
+
cleanup: (resources: TrackedResource[]) => Promise<CleanupResult>;
|
|
29
|
+
/**
|
|
30
|
+
* Execute cleanup for a single resource
|
|
31
|
+
*/
|
|
32
|
+
cleanupOne: (resource: TrackedResource) => Promise<boolean>;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Load all cleanup handlers based on configuration
|
|
37
|
+
*
|
|
38
|
+
* Loading order (later overrides earlier):
|
|
39
|
+
* 1. Built-in provider methods
|
|
40
|
+
* 2. intellitester.cleanup.ts at project root
|
|
41
|
+
* 3. Discovery paths (default: tests/cleanup/**\/*.ts)
|
|
42
|
+
* 4. Explicit handler files from config
|
|
43
|
+
*
|
|
44
|
+
* @param config - Cleanup configuration object
|
|
45
|
+
* @param cwd - Current working directory (defaults to process.cwd())
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* // Basic usage with a provider
|
|
50
|
+
* const { handlers, typeMappings } = await loadCleanupHandlers({
|
|
51
|
+
* provider: 'sqlite',
|
|
52
|
+
* sqlite: { database: './test.db' },
|
|
53
|
+
* types: {
|
|
54
|
+
* user: 'sqlite.deleteUser',
|
|
55
|
+
* team: 'sqlite.deleteRow'
|
|
56
|
+
* }
|
|
57
|
+
* });
|
|
58
|
+
*
|
|
59
|
+
* // With custom discovery paths
|
|
60
|
+
* const { handlers, typeMappings } = await loadCleanupHandlers({
|
|
61
|
+
* provider: 'postgres',
|
|
62
|
+
* postgres: { connectionString: 'postgresql://...' },
|
|
63
|
+
* discover: {
|
|
64
|
+
* enabled: true,
|
|
65
|
+
* paths: ['./tests/cleanup', './e2e/cleanup'],
|
|
66
|
+
* pattern: '**\/*.cleanup.ts'
|
|
67
|
+
* },
|
|
68
|
+
* handlers: ['./custom-cleanup.ts']
|
|
69
|
+
* });
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* @returns Object containing loaded handlers map and type mappings
|
|
73
|
+
*/
|
|
74
|
+
declare function loadCleanupHandlers(config: CleanupConfig, cwd?: string): Promise<{
|
|
75
|
+
handlers: Map<string, CleanupHandler>;
|
|
76
|
+
typeMappings: Record<string, string>;
|
|
77
|
+
provider?: CleanupProvider;
|
|
78
|
+
}>;
|
|
79
|
+
/**
|
|
80
|
+
* Get a handler by key, checking both direct keys and provider.method format
|
|
81
|
+
*/
|
|
82
|
+
declare function resolveHandler(handlers: Map<string, CleanupHandler>, typeMappings: Record<string, string>, resourceType: string): CleanupHandler | null;
|
|
83
|
+
|
|
84
|
+
interface FailedCleanup {
|
|
85
|
+
sessionId: string;
|
|
86
|
+
timestamp: string;
|
|
87
|
+
resources: TrackedResource[];
|
|
88
|
+
providerConfig: {
|
|
89
|
+
provider: string;
|
|
90
|
+
[key: string]: unknown;
|
|
91
|
+
};
|
|
92
|
+
errors: string[];
|
|
93
|
+
}
|
|
94
|
+
declare function saveFailedCleanup(cleanup: FailedCleanup, cwd?: string): Promise<void>;
|
|
95
|
+
declare function loadFailedCleanups(cwd?: string): Promise<FailedCleanup[]>;
|
|
96
|
+
declare function removeFailedCleanup(sessionId: string, cwd?: string): Promise<void>;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Helper for defining cleanup handlers in user files.
|
|
100
|
+
* Provides type safety for custom cleanup handler definitions.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* // In cleanup.ts
|
|
104
|
+
* import { defineCleanupHandlers } from 'intellitester/cleanup';
|
|
105
|
+
*
|
|
106
|
+
* export default defineCleanupHandlers({
|
|
107
|
+
* async deleteUser(resource) {
|
|
108
|
+
* // cleanup logic
|
|
109
|
+
* },
|
|
110
|
+
* async deleteTeam(resource) {
|
|
111
|
+
* // cleanup logic
|
|
112
|
+
* }
|
|
113
|
+
* });
|
|
114
|
+
*/
|
|
115
|
+
declare function defineCleanupHandlers<T extends Record<string, CleanupHandler>>(handlers: T): T;
|
|
116
|
+
|
|
117
|
+
export { CleanupConfig, CleanupHandler, CleanupProvider, CleanupResult, ExecutorOptions, type ExtendedCleanupOptions, type FailedCleanup, createCleanupExecutor, defineCleanupHandlers, executeCleanup, loadCleanupHandlers, loadFailedCleanups, removeFailedCleanup, resolveHandler, saveFailedCleanup };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { createCleanupExecutor, defineCleanupHandlers, executeCleanup, loadCleanupHandlers, loadFailedCleanups, removeFailedCleanup, resolveHandler, saveFailedCleanup } from '../../chunk-ECBA4GJ3.js';
|
|
2
|
+
import '../../chunk-DE5UFTTG.js';
|
|
3
|
+
import '../../chunk-6PYKWWH5.js';
|
|
4
|
+
import '../../chunk-4B54JUOP.js';
|
|
5
|
+
import '../../chunk-SAVY6D3X.js';
|
|
6
|
+
import '../../chunk-CN6HSJJX.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkXWGUA67E_cjs = require('./chunk-XWGUA67E.cjs');
|
|
4
|
+
require('./chunk-ARJYJVRM.cjs');
|
|
5
|
+
require('./chunk-QMYM2TCH.cjs');
|
|
6
|
+
require('./chunk-PAKODOH4.cjs');
|
|
7
|
+
require('./chunk-OFXNJXMV.cjs');
|
|
8
|
+
require('./chunk-UUJXCHVT.cjs');
|
|
9
|
+
require('./chunk-35WJGNDA.cjs');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
Object.defineProperty(exports, "ActionSchema", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return chunkXWGUA67E_cjs.ActionSchema; }
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "IntellitesterConfigSchema", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () { return chunkXWGUA67E_cjs.IntellitesterConfigSchema; }
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports, "LocatorSchema", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () { return chunkXWGUA67E_cjs.LocatorSchema; }
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(exports, "TestConfigSchema", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () { return chunkXWGUA67E_cjs.TestConfigSchema; }
|
|
28
|
+
});
|
|
29
|
+
Object.defineProperty(exports, "TestDefinitionSchema", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function () { return chunkXWGUA67E_cjs.TestDefinitionSchema; }
|
|
32
|
+
});
|
|
33
|
+
Object.defineProperty(exports, "cleanupConfigSchema", {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
get: function () { return chunkXWGUA67E_cjs.cleanupConfigSchema; }
|
|
36
|
+
});
|
|
37
|
+
Object.defineProperty(exports, "cleanupDiscoverSchema", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function () { return chunkXWGUA67E_cjs.cleanupDiscoverSchema; }
|
|
40
|
+
});
|
|
41
|
+
Object.defineProperty(exports, "collectMissingEnvVars", {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: function () { return chunkXWGUA67E_cjs.collectMissingEnvVars; }
|
|
44
|
+
});
|
|
45
|
+
Object.defineProperty(exports, "isPipelineFile", {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
get: function () { return chunkXWGUA67E_cjs.isPipelineFile; }
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(exports, "isWorkflowFile", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: function () { return chunkXWGUA67E_cjs.isWorkflowFile; }
|
|
52
|
+
});
|
|
53
|
+
Object.defineProperty(exports, "killServer", {
|
|
54
|
+
enumerable: true,
|
|
55
|
+
get: function () { return chunkXWGUA67E_cjs.killServer; }
|
|
56
|
+
});
|
|
57
|
+
Object.defineProperty(exports, "loadIntellitesterConfig", {
|
|
58
|
+
enumerable: true,
|
|
59
|
+
get: function () { return chunkXWGUA67E_cjs.loadIntellitesterConfig; }
|
|
60
|
+
});
|
|
61
|
+
Object.defineProperty(exports, "loadPipelineDefinition", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: function () { return chunkXWGUA67E_cjs.loadPipelineDefinition; }
|
|
64
|
+
});
|
|
65
|
+
Object.defineProperty(exports, "loadTestDefinition", {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function () { return chunkXWGUA67E_cjs.loadTestDefinition; }
|
|
68
|
+
});
|
|
69
|
+
Object.defineProperty(exports, "loadWorkflowDefinition", {
|
|
70
|
+
enumerable: true,
|
|
71
|
+
get: function () { return chunkXWGUA67E_cjs.loadWorkflowDefinition; }
|
|
72
|
+
});
|
|
73
|
+
Object.defineProperty(exports, "parseIntellitesterConfig", {
|
|
74
|
+
enumerable: true,
|
|
75
|
+
get: function () { return chunkXWGUA67E_cjs.parseIntellitesterConfig; }
|
|
76
|
+
});
|
|
77
|
+
Object.defineProperty(exports, "parsePipelineDefinition", {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
get: function () { return chunkXWGUA67E_cjs.parsePipelineDefinition; }
|
|
80
|
+
});
|
|
81
|
+
Object.defineProperty(exports, "parseTestDefinition", {
|
|
82
|
+
enumerable: true,
|
|
83
|
+
get: function () { return chunkXWGUA67E_cjs.parseTestDefinition; }
|
|
84
|
+
});
|
|
85
|
+
Object.defineProperty(exports, "parseWorkflowDefinition", {
|
|
86
|
+
enumerable: true,
|
|
87
|
+
get: function () { return chunkXWGUA67E_cjs.parseWorkflowDefinition; }
|
|
88
|
+
});
|
|
89
|
+
Object.defineProperty(exports, "runWebTest", {
|
|
90
|
+
enumerable: true,
|
|
91
|
+
get: function () { return chunkXWGUA67E_cjs.runWebTest; }
|
|
92
|
+
});
|
|
93
|
+
Object.defineProperty(exports, "runWorkflow", {
|
|
94
|
+
enumerable: true,
|
|
95
|
+
get: function () { return chunkXWGUA67E_cjs.runWorkflow; }
|
|
96
|
+
});
|
|
97
|
+
Object.defineProperty(exports, "runWorkflowWithContext", {
|
|
98
|
+
enumerable: true,
|
|
99
|
+
get: function () { return chunkXWGUA67E_cjs.runWorkflowWithContext; }
|
|
100
|
+
});
|
|
101
|
+
Object.defineProperty(exports, "setupAppwriteTracking", {
|
|
102
|
+
enumerable: true,
|
|
103
|
+
get: function () { return chunkXWGUA67E_cjs.setupAppwriteTracking; }
|
|
104
|
+
});
|
|
105
|
+
Object.defineProperty(exports, "startWebServer", {
|
|
106
|
+
enumerable: true,
|
|
107
|
+
get: function () { return chunkXWGUA67E_cjs.startWebServer; }
|
|
108
|
+
});
|
|
109
|
+
//# sourceMappingURL=index.cjs.map
|
|
110
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
|