depflow 3.0.0-dev.1 → 3.0.0-dev.10
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/build/cli/DepFLowCLI.d.ts +1 -0
- package/build/cli/DepFLowCLI.js +36 -5
- package/build/cli/DepFLowCLI.js.map +1 -1
- package/build/cli/bin.js +2 -5
- package/build/cli/bin.js.map +1 -1
- package/build/config/Config.d.ts +3 -3
- package/build/config/Config.js +3 -3
- package/build/config/Config.js.map +1 -1
- package/build/config/ImportMap.d.ts +24 -10
- package/build/config/ImportMap.js +39 -24
- package/build/config/ImportMap.js.map +1 -1
- package/build/config/{Tsconfig.d.ts → TSConfig.d.ts} +14 -17
- package/build/config/{Tsconfig.js → TSConfig.js} +39 -35
- package/build/config/TSConfig.js.map +1 -0
- package/build/schema/Config/Builder.d.ts +431 -0
- package/build/schema/Config/Builder.js +48 -0
- package/build/schema/Config/Builder.js.map +1 -0
- package/build/schema/Config/Config.d.ts +582 -0
- package/build/schema/Config/Config.js +20 -0
- package/build/schema/Config/Config.js.map +1 -0
- package/build/schema/Config/Dependency.d.ts +748 -0
- package/build/schema/Config/Dependency.js +25 -0
- package/build/schema/Config/Dependency.js.map +1 -0
- package/build/schema/Config/Extractor.d.ts +133 -0
- package/build/schema/Config/Extractor.js +25 -0
- package/build/schema/Config/Extractor.js.map +1 -0
- package/build/schema/Config/Resolver.d.ts +70 -0
- package/build/schema/Config/Resolver.js +25 -0
- package/build/schema/Config/Resolver.js.map +1 -0
- package/build/schema/Config/Transform.d.ts +73 -0
- package/build/schema/Config/Transform.js +27 -0
- package/build/schema/Config/Transform.js.map +1 -0
- package/build/schema/ImportMap.d.ts +22 -0
- package/build/schema/ImportMap.js +12 -0
- package/build/schema/ImportMap.js.map +1 -0
- package/build/schema/TSConfig.d.ts +56 -0
- package/build/schema/TSConfig.js +19 -0
- package/build/schema/TSConfig.js.map +1 -0
- package/build/schema/schema.d.ts +29 -0
- package/build/schema/schema.js +31 -0
- package/build/schema/schema.js.map +1 -0
- package/build/support/Builder/Builder.d.ts +16 -6
- package/build/support/Builder/Builder.js +57 -30
- package/build/support/Builder/Builder.js.map +1 -1
- package/build/support/Dependency/Dependency.d.ts +5 -5
- package/build/support/Dependency/Dependency.js +1 -1
- package/build/support/Dependency/Dependency.js.map +1 -1
- package/build/support/Dependency/GitDependency.d.ts +2 -2
- package/build/support/Dependency/GitDependency.js +1 -1
- package/build/support/Dependency/GitDependency.js.map +1 -1
- package/build/support/Dependency/NpmDependency.d.ts +3 -3
- package/build/support/Dependency/NpmDependency.js +1 -1
- package/build/support/Dependency/NpmDependency.js.map +1 -1
- package/build/support/Git.js +1 -1
- package/build/support/Git.js.map +1 -1
- package/build/support/PathResolver/AliasCompiler.d.ts +13 -6
- package/build/support/PathResolver/AliasCompiler.js +35 -12
- package/build/support/PathResolver/AliasCompiler.js.map +1 -1
- package/build/support/PathResolver/PathResolver.d.ts +4 -4
- package/build/support/PathResolver/PathResolver.js +23 -22
- package/build/support/PathResolver/PathResolver.js.map +1 -1
- package/build/support/Task/Task.js +1 -1
- package/build/support/Task/Task.js.map +1 -1
- package/build/support/Utils.d.ts +1 -1
- package/build/support/Utils.js.map +1 -1
- package/package.json +6 -7
- package/build/config/Tsconfig.js.map +0 -1
- package/build/config/schemas.d.ts +0 -1194
- package/build/config/schemas.js +0 -66
- package/build/config/schemas.js.map +0 -1
- package/build/support/Async.d.ts +0 -22
- package/build/support/Async.js +0 -62
- package/build/support/Async.js.map +0 -1
- package/build/support/Dependency/Resolver.d.ts +0 -7
- package/build/support/Dependency/Resolver.js +0 -4
- package/build/support/Dependency/Resolver.js.map +0 -1
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import PATH from 'node:path';
|
|
2
1
|
import { Logger } from '@netfeez/vterm';
|
|
3
2
|
import { File, Path } from '@netfeez/common-node';
|
|
4
|
-
import
|
|
5
|
-
export class
|
|
3
|
+
import schema from '../schema/schema.js';
|
|
4
|
+
export class TSConfig {
|
|
6
5
|
data;
|
|
7
|
-
|
|
8
|
-
filename;
|
|
6
|
+
path;
|
|
9
7
|
logger;
|
|
10
|
-
constructor(data,
|
|
8
|
+
constructor(data, path, options = {}) {
|
|
11
9
|
this.data = data;
|
|
12
|
-
this.
|
|
13
|
-
this.filename = filename;
|
|
10
|
+
this.path = path;
|
|
14
11
|
this.logger = options.logger || new Logger({ name: 'TS-CFG' });
|
|
15
12
|
}
|
|
16
13
|
/**
|
|
@@ -25,47 +22,55 @@ export class Tsconfig {
|
|
|
25
22
|
this.data.compilerOptions = {};
|
|
26
23
|
if (!this.data.compilerOptions.paths)
|
|
27
24
|
this.data.compilerOptions.paths = {};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
const projectRoot = Path.dirname(this.path);
|
|
26
|
+
for (const alias of aliases) {
|
|
27
|
+
const key = alias.isWildcard ? `${alias.alias}/*` : alias.alias;
|
|
28
|
+
let target = Path.diff(projectRoot, alias.targets.local);
|
|
31
29
|
target = target.startsWith('.') ? target : `./${target}`;
|
|
32
30
|
target = Path.normalize(target);
|
|
33
|
-
|
|
31
|
+
let typeTarget;
|
|
32
|
+
if (alias.targets.type) {
|
|
33
|
+
typeTarget = Path.diff(projectRoot, alias.targets.type);
|
|
34
|
+
typeTarget = typeTarget.startsWith('.') ? typeTarget : `./${typeTarget}`;
|
|
35
|
+
typeTarget = Path.normalize(typeTarget);
|
|
36
|
+
}
|
|
37
|
+
if (alias.isWildcard) {
|
|
34
38
|
const suffix = target.endsWith('/') ? '*' : '/*';
|
|
35
39
|
target = `${target}${suffix}`;
|
|
40
|
+
if (typeTarget) {
|
|
41
|
+
typeTarget = `${typeTarget}${suffix}`;
|
|
42
|
+
}
|
|
36
43
|
}
|
|
37
|
-
this.data.compilerOptions.paths[key] = [target];
|
|
44
|
+
this.data.compilerOptions.paths[key] = typeTarget ? [typeTarget, target] : [target];
|
|
38
45
|
}
|
|
39
46
|
}
|
|
40
47
|
/**
|
|
41
48
|
* Saves the current tsconfig data to a file.
|
|
42
49
|
* It constructs the path to the tsconfig file using the project root and filename, converts the data to a JSON string with proper formatting, and writes it to the file system using the File.write method.
|
|
43
50
|
* The method also includes error handling to log any issues that occur during the save process, ensuring that users are informed of any problems when attempting to save the tsconfig configuration.
|
|
44
|
-
* @param
|
|
51
|
+
* @param path The path to the tsconfig file where the data should be saved.
|
|
45
52
|
* @returns A promise that resolves when the save operation is complete, or rejects if an error occurs during the process.
|
|
46
53
|
*/
|
|
47
|
-
async save(
|
|
48
|
-
await
|
|
54
|
+
async save(path = this.path) {
|
|
55
|
+
await TSConfig.save(path, this.data, { logger: this.logger });
|
|
56
|
+
if (path !== this.path)
|
|
57
|
+
this.path = path;
|
|
49
58
|
}
|
|
50
59
|
/**
|
|
51
60
|
* Static method to save tsconfig data to a specified file. It takes the project root, filename, tsconfig data, and options (including a logger) as parameters.
|
|
52
61
|
* The method constructs the full path to the tsconfig file, converts the data to a formatted JSON string, and writes it to the file system.
|
|
53
62
|
* It also includes error handling to log any issues that arise during the save process, providing feedback on whether the operation was successful or if it encountered problems.
|
|
54
|
-
* @param
|
|
55
|
-
* @param filename The name of the tsconfig file (default is 'tsconfig.json').
|
|
63
|
+
* @param path The path to the tsconfig file where the data should be saved.
|
|
56
64
|
* @param data The tsconfig data to be saved, structured according to the defined schema.
|
|
57
65
|
* @param options Additional options for saving, such as a logger for logging messages during the save process.
|
|
58
66
|
* @returns A promise that resolves when the save operation is complete, or rejects if an error occurs during the process.
|
|
59
67
|
* @throws Will throw an error if there is an issue during the save process, which can be caught by the caller to handle it appropriately.
|
|
60
68
|
*/
|
|
61
|
-
static async save(
|
|
69
|
+
static async save(path, data, options = {}) {
|
|
62
70
|
const logger = options.logger || new Logger({ name: 'TS-CFG' });
|
|
63
|
-
const tsconfigPath = PATH.resolve(projectRoot, filename);
|
|
64
|
-
const folder = PATH.dirname(tsconfigPath);
|
|
65
|
-
if (!await File.exists(folder))
|
|
66
|
-
await File.mkdir(folder, { recursive: true });
|
|
67
71
|
const json = JSON.stringify(data, null, 4);
|
|
68
|
-
await File.write(
|
|
72
|
+
await File.write(path, json);
|
|
73
|
+
const filename = Path.fileName(path);
|
|
69
74
|
logger.log(`&C2Saved file &C4${filename}&C2 successfully.`);
|
|
70
75
|
}
|
|
71
76
|
/**
|
|
@@ -73,28 +78,27 @@ export class Tsconfig {
|
|
|
73
78
|
* It takes the project root, filename, and options (including a logger) as parameters.
|
|
74
79
|
* The method checks if the tsconfig file exists, and if it does, it reads the content, parses it as JSON, and processes it using the defined schema to ensure it conforms to the expected structure.
|
|
75
80
|
* If the file does not exist, it creates a default tsconfig data object using the schema. Finally, it returns an instance of the Tsconfig class initialized with the loaded or default data.
|
|
76
|
-
* @param
|
|
77
|
-
* @param filename The name of the tsconfig file to load (default is 'tsconfig.json').
|
|
81
|
+
* @param path The path to the tsconfig file to load.
|
|
78
82
|
* @param options Additional options for loading, such as a logger for logging messages during the load process.
|
|
79
83
|
* @returns A promise that resolves to an instance of the Tsconfig class containing the loaded data, or rejects if there is an error during the load process.
|
|
80
84
|
* @throws Will throw an error if there is an issue during the load process, which
|
|
81
85
|
*/
|
|
82
|
-
static async load(
|
|
86
|
+
static async load(path, options) {
|
|
83
87
|
const logger = options.logger || new Logger({ name: 'TS-CFG' });
|
|
84
|
-
const tsconfigPath = PATH.resolve(projectRoot, filename);
|
|
85
88
|
let data;
|
|
86
|
-
if (!await File.exists(
|
|
89
|
+
if (!await File.exists(path)) {
|
|
90
|
+
const filename = Path.fileName(path);
|
|
87
91
|
logger.warn(`&C3${filename} not found. Creating defaults...`);
|
|
88
|
-
data =
|
|
92
|
+
data = schema.TSConfig.processData({});
|
|
89
93
|
// this.save(projectRoot, filename, data, { logger }).catch(err => logger.error(`Failed to create default tsconfig:`, err.message));
|
|
90
94
|
}
|
|
91
95
|
else {
|
|
92
|
-
const content = await File.read(
|
|
96
|
+
const content = await File.read(path, 'utf-8');
|
|
93
97
|
const json = JSON.parse(content);
|
|
94
|
-
data =
|
|
98
|
+
data = schema.TSConfig.processData(json);
|
|
95
99
|
}
|
|
96
|
-
return new
|
|
100
|
+
return new TSConfig(data, path, { logger });
|
|
97
101
|
}
|
|
98
102
|
}
|
|
99
|
-
export default
|
|
100
|
-
//# sourceMappingURL=
|
|
103
|
+
export default TSConfig;
|
|
104
|
+
//# sourceMappingURL=TSConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TSConfig.js","sourceRoot":"","sources":["../../src/config/TSConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAGlD,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC,MAAM,OAAO,QAAQ;IAIH;IACA;IAJJ,MAAM,CAAS;IAEzB,YACc,IAAmB,EACnB,IAAY,EACtB,UAA4B,EAAE;QAFpB,SAAI,GAAJ,IAAI,CAAe;QACnB,SAAI,GAAJ,IAAI,CAAQ;QAEtB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,IAAI,MAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IAAC,CAAC;IACrE;;;;;;OAMG;IACI,WAAW,CAAC,OAAsC;QACrD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe;YAAE,IAAI,CAAC,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;QAC/D,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK;YAAE,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,GAAG,EAAE,CAAC;QAE3E,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE5C,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC1B,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CA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QAAQ,kCAAkC,CAAC,CAAC;YAC9D,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;YACvC,oIAAoI;QACxI,CAAC;aAAM,CAAC;YACJ,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAC/C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACjC,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAC7C,CAAC;QAAC,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IAClD,CAAC;CACJ;AASD,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
import { Schema } from '@netfeez/common';
|
|
2
|
+
export declare const RunEntry: Schema<{
|
|
3
|
+
readonly type: "object";
|
|
4
|
+
readonly required: true;
|
|
5
|
+
readonly properties: {
|
|
6
|
+
readonly maxTimeMs: {
|
|
7
|
+
readonly type: "number";
|
|
8
|
+
readonly default: 60000;
|
|
9
|
+
readonly minimum: -1;
|
|
10
|
+
};
|
|
11
|
+
readonly allowFails: {
|
|
12
|
+
readonly type: "boolean";
|
|
13
|
+
readonly default: false;
|
|
14
|
+
};
|
|
15
|
+
readonly run: {
|
|
16
|
+
readonly type: "union";
|
|
17
|
+
readonly required: true;
|
|
18
|
+
readonly union: [{
|
|
19
|
+
readonly type: "string";
|
|
20
|
+
}, {
|
|
21
|
+
readonly type: "array";
|
|
22
|
+
readonly items: {
|
|
23
|
+
readonly type: "string";
|
|
24
|
+
};
|
|
25
|
+
}];
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
}>;
|
|
29
|
+
export type RunEntry = typeof RunEntry.infer;
|
|
30
|
+
export declare namespace RunEntry { }
|
|
31
|
+
export declare const ExtractEntry: Schema<{
|
|
32
|
+
readonly type: "object";
|
|
33
|
+
readonly required: true;
|
|
34
|
+
readonly properties: {
|
|
35
|
+
readonly extract: {
|
|
36
|
+
readonly type: "union";
|
|
37
|
+
readonly required: true;
|
|
38
|
+
readonly union: [{
|
|
39
|
+
readonly type: "string";
|
|
40
|
+
}, {
|
|
41
|
+
readonly type: "object";
|
|
42
|
+
readonly required: true;
|
|
43
|
+
readonly allowAdditionalProperties: {
|
|
44
|
+
readonly type: "union";
|
|
45
|
+
readonly required: true;
|
|
46
|
+
readonly union: [{
|
|
47
|
+
readonly type: "string";
|
|
48
|
+
readonly required: true;
|
|
49
|
+
}, {
|
|
50
|
+
readonly type: "object";
|
|
51
|
+
readonly required: true;
|
|
52
|
+
readonly properties: {
|
|
53
|
+
readonly to: {
|
|
54
|
+
readonly type: "string";
|
|
55
|
+
readonly required: true;
|
|
56
|
+
};
|
|
57
|
+
readonly map: {
|
|
58
|
+
readonly required: false;
|
|
59
|
+
readonly type: "union";
|
|
60
|
+
readonly union: [{
|
|
61
|
+
readonly type: "string";
|
|
62
|
+
}, {
|
|
63
|
+
readonly type: "object";
|
|
64
|
+
readonly properties: {
|
|
65
|
+
readonly search: {
|
|
66
|
+
readonly type: "string";
|
|
67
|
+
readonly required: true;
|
|
68
|
+
};
|
|
69
|
+
readonly flags: {
|
|
70
|
+
readonly type: "string";
|
|
71
|
+
readonly default: "g";
|
|
72
|
+
readonly pattern: RegExp;
|
|
73
|
+
};
|
|
74
|
+
readonly replace: {
|
|
75
|
+
readonly type: "string";
|
|
76
|
+
readonly required: true;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
}];
|
|
80
|
+
};
|
|
81
|
+
readonly transform: {
|
|
82
|
+
readonly required: false;
|
|
83
|
+
readonly type: "union";
|
|
84
|
+
readonly union: [{
|
|
85
|
+
readonly type: "string";
|
|
86
|
+
}, {
|
|
87
|
+
readonly type: "object";
|
|
88
|
+
readonly properties: {
|
|
89
|
+
readonly search: {
|
|
90
|
+
readonly type: "string";
|
|
91
|
+
readonly required: true;
|
|
92
|
+
};
|
|
93
|
+
readonly flags: {
|
|
94
|
+
readonly type: "string";
|
|
95
|
+
readonly default: "g";
|
|
96
|
+
readonly pattern: RegExp;
|
|
97
|
+
};
|
|
98
|
+
readonly replace: {
|
|
99
|
+
readonly type: "string";
|
|
100
|
+
readonly required: true;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
}];
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
}];
|
|
107
|
+
};
|
|
108
|
+
}];
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
}>;
|
|
112
|
+
export type ExtractEntry = typeof ExtractEntry.infer;
|
|
113
|
+
export declare namespace ExtractEntry { }
|
|
114
|
+
export declare const TransformEntry: Schema<{
|
|
115
|
+
readonly type: "object";
|
|
116
|
+
readonly required: true;
|
|
117
|
+
readonly properties: {
|
|
118
|
+
readonly transform: {
|
|
119
|
+
readonly type: "object";
|
|
120
|
+
readonly required: true;
|
|
121
|
+
readonly properties: {
|
|
122
|
+
readonly search: {
|
|
123
|
+
readonly type: "string";
|
|
124
|
+
readonly required: true;
|
|
125
|
+
};
|
|
126
|
+
readonly flags: {
|
|
127
|
+
readonly type: "string";
|
|
128
|
+
readonly default: "g";
|
|
129
|
+
readonly pattern: RegExp;
|
|
130
|
+
};
|
|
131
|
+
readonly replace: {
|
|
132
|
+
readonly type: "string";
|
|
133
|
+
readonly required: true;
|
|
134
|
+
};
|
|
135
|
+
readonly glob: {
|
|
136
|
+
readonly type: "string";
|
|
137
|
+
readonly required: true;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
}>;
|
|
143
|
+
export type TransformEntry = typeof TransformEntry.infer;
|
|
144
|
+
export declare namespace TransformEntry { }
|
|
145
|
+
export declare const BuilderEntry: Schema<{
|
|
146
|
+
readonly type: "union";
|
|
147
|
+
readonly required: true;
|
|
148
|
+
readonly union: [{
|
|
149
|
+
readonly type: "object";
|
|
150
|
+
readonly required: true;
|
|
151
|
+
readonly properties: {
|
|
152
|
+
readonly maxTimeMs: {
|
|
153
|
+
readonly type: "number";
|
|
154
|
+
readonly default: 60000;
|
|
155
|
+
readonly minimum: -1;
|
|
156
|
+
};
|
|
157
|
+
readonly allowFails: {
|
|
158
|
+
readonly type: "boolean";
|
|
159
|
+
readonly default: false;
|
|
160
|
+
};
|
|
161
|
+
readonly run: {
|
|
162
|
+
readonly type: "union";
|
|
163
|
+
readonly required: true;
|
|
164
|
+
readonly union: [{
|
|
165
|
+
readonly type: "string";
|
|
166
|
+
}, {
|
|
167
|
+
readonly type: "array";
|
|
168
|
+
readonly items: {
|
|
169
|
+
readonly type: "string";
|
|
170
|
+
};
|
|
171
|
+
}];
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
}, {
|
|
175
|
+
readonly type: "object";
|
|
176
|
+
readonly required: true;
|
|
177
|
+
readonly properties: {
|
|
178
|
+
readonly extract: {
|
|
179
|
+
readonly type: "union";
|
|
180
|
+
readonly required: true;
|
|
181
|
+
readonly union: [{
|
|
182
|
+
readonly type: "string";
|
|
183
|
+
}, {
|
|
184
|
+
readonly type: "object";
|
|
185
|
+
readonly required: true;
|
|
186
|
+
readonly allowAdditionalProperties: {
|
|
187
|
+
readonly type: "union";
|
|
188
|
+
readonly required: true;
|
|
189
|
+
readonly union: [{
|
|
190
|
+
readonly type: "string";
|
|
191
|
+
readonly required: true;
|
|
192
|
+
}, {
|
|
193
|
+
readonly type: "object";
|
|
194
|
+
readonly required: true;
|
|
195
|
+
readonly properties: {
|
|
196
|
+
readonly to: {
|
|
197
|
+
readonly type: "string";
|
|
198
|
+
readonly required: true;
|
|
199
|
+
};
|
|
200
|
+
readonly map: {
|
|
201
|
+
readonly required: false;
|
|
202
|
+
readonly type: "union";
|
|
203
|
+
readonly union: [{
|
|
204
|
+
readonly type: "string";
|
|
205
|
+
}, {
|
|
206
|
+
readonly type: "object";
|
|
207
|
+
readonly properties: {
|
|
208
|
+
readonly search: {
|
|
209
|
+
readonly type: "string";
|
|
210
|
+
readonly required: true;
|
|
211
|
+
};
|
|
212
|
+
readonly flags: {
|
|
213
|
+
readonly type: "string";
|
|
214
|
+
readonly default: "g";
|
|
215
|
+
readonly pattern: RegExp;
|
|
216
|
+
};
|
|
217
|
+
readonly replace: {
|
|
218
|
+
readonly type: "string";
|
|
219
|
+
readonly required: true;
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
}];
|
|
223
|
+
};
|
|
224
|
+
readonly transform: {
|
|
225
|
+
readonly required: false;
|
|
226
|
+
readonly type: "union";
|
|
227
|
+
readonly union: [{
|
|
228
|
+
readonly type: "string";
|
|
229
|
+
}, {
|
|
230
|
+
readonly type: "object";
|
|
231
|
+
readonly properties: {
|
|
232
|
+
readonly search: {
|
|
233
|
+
readonly type: "string";
|
|
234
|
+
readonly required: true;
|
|
235
|
+
};
|
|
236
|
+
readonly flags: {
|
|
237
|
+
readonly type: "string";
|
|
238
|
+
readonly default: "g";
|
|
239
|
+
readonly pattern: RegExp;
|
|
240
|
+
};
|
|
241
|
+
readonly replace: {
|
|
242
|
+
readonly type: "string";
|
|
243
|
+
readonly required: true;
|
|
244
|
+
};
|
|
245
|
+
};
|
|
246
|
+
}];
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
}];
|
|
250
|
+
};
|
|
251
|
+
}];
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
}, {
|
|
255
|
+
readonly type: "object";
|
|
256
|
+
readonly required: true;
|
|
257
|
+
readonly properties: {
|
|
258
|
+
readonly transform: {
|
|
259
|
+
readonly type: "object";
|
|
260
|
+
readonly required: true;
|
|
261
|
+
readonly properties: {
|
|
262
|
+
readonly search: {
|
|
263
|
+
readonly type: "string";
|
|
264
|
+
readonly required: true;
|
|
265
|
+
};
|
|
266
|
+
readonly flags: {
|
|
267
|
+
readonly type: "string";
|
|
268
|
+
readonly default: "g";
|
|
269
|
+
readonly pattern: RegExp;
|
|
270
|
+
};
|
|
271
|
+
readonly replace: {
|
|
272
|
+
readonly type: "string";
|
|
273
|
+
readonly required: true;
|
|
274
|
+
};
|
|
275
|
+
readonly glob: {
|
|
276
|
+
readonly type: "string";
|
|
277
|
+
readonly required: true;
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
};
|
|
282
|
+
}];
|
|
283
|
+
}>;
|
|
284
|
+
export type BuilderEntry = typeof BuilderEntry.infer;
|
|
285
|
+
export declare namespace BuilderEntry { }
|
|
286
|
+
export declare const Builder: Schema<{
|
|
287
|
+
readonly type: "array";
|
|
288
|
+
readonly default: [];
|
|
289
|
+
readonly items: {
|
|
290
|
+
readonly type: "union";
|
|
291
|
+
readonly required: true;
|
|
292
|
+
readonly union: [{
|
|
293
|
+
readonly type: "object";
|
|
294
|
+
readonly required: true;
|
|
295
|
+
readonly properties: {
|
|
296
|
+
readonly maxTimeMs: {
|
|
297
|
+
readonly type: "number";
|
|
298
|
+
readonly default: 60000;
|
|
299
|
+
readonly minimum: -1;
|
|
300
|
+
};
|
|
301
|
+
readonly allowFails: {
|
|
302
|
+
readonly type: "boolean";
|
|
303
|
+
readonly default: false;
|
|
304
|
+
};
|
|
305
|
+
readonly run: {
|
|
306
|
+
readonly type: "union";
|
|
307
|
+
readonly required: true;
|
|
308
|
+
readonly union: [{
|
|
309
|
+
readonly type: "string";
|
|
310
|
+
}, {
|
|
311
|
+
readonly type: "array";
|
|
312
|
+
readonly items: {
|
|
313
|
+
readonly type: "string";
|
|
314
|
+
};
|
|
315
|
+
}];
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
}, {
|
|
319
|
+
readonly type: "object";
|
|
320
|
+
readonly required: true;
|
|
321
|
+
readonly properties: {
|
|
322
|
+
readonly extract: {
|
|
323
|
+
readonly type: "union";
|
|
324
|
+
readonly required: true;
|
|
325
|
+
readonly union: [{
|
|
326
|
+
readonly type: "string";
|
|
327
|
+
}, {
|
|
328
|
+
readonly type: "object";
|
|
329
|
+
readonly required: true;
|
|
330
|
+
readonly allowAdditionalProperties: {
|
|
331
|
+
readonly type: "union";
|
|
332
|
+
readonly required: true;
|
|
333
|
+
readonly union: [{
|
|
334
|
+
readonly type: "string";
|
|
335
|
+
readonly required: true;
|
|
336
|
+
}, {
|
|
337
|
+
readonly type: "object";
|
|
338
|
+
readonly required: true;
|
|
339
|
+
readonly properties: {
|
|
340
|
+
readonly to: {
|
|
341
|
+
readonly type: "string";
|
|
342
|
+
readonly required: true;
|
|
343
|
+
};
|
|
344
|
+
readonly map: {
|
|
345
|
+
readonly required: false;
|
|
346
|
+
readonly type: "union";
|
|
347
|
+
readonly union: [{
|
|
348
|
+
readonly type: "string";
|
|
349
|
+
}, {
|
|
350
|
+
readonly type: "object";
|
|
351
|
+
readonly properties: {
|
|
352
|
+
readonly search: {
|
|
353
|
+
readonly type: "string";
|
|
354
|
+
readonly required: true;
|
|
355
|
+
};
|
|
356
|
+
readonly flags: {
|
|
357
|
+
readonly type: "string";
|
|
358
|
+
readonly default: "g";
|
|
359
|
+
readonly pattern: RegExp;
|
|
360
|
+
};
|
|
361
|
+
readonly replace: {
|
|
362
|
+
readonly type: "string";
|
|
363
|
+
readonly required: true;
|
|
364
|
+
};
|
|
365
|
+
};
|
|
366
|
+
}];
|
|
367
|
+
};
|
|
368
|
+
readonly transform: {
|
|
369
|
+
readonly required: false;
|
|
370
|
+
readonly type: "union";
|
|
371
|
+
readonly union: [{
|
|
372
|
+
readonly type: "string";
|
|
373
|
+
}, {
|
|
374
|
+
readonly type: "object";
|
|
375
|
+
readonly properties: {
|
|
376
|
+
readonly search: {
|
|
377
|
+
readonly type: "string";
|
|
378
|
+
readonly required: true;
|
|
379
|
+
};
|
|
380
|
+
readonly flags: {
|
|
381
|
+
readonly type: "string";
|
|
382
|
+
readonly default: "g";
|
|
383
|
+
readonly pattern: RegExp;
|
|
384
|
+
};
|
|
385
|
+
readonly replace: {
|
|
386
|
+
readonly type: "string";
|
|
387
|
+
readonly required: true;
|
|
388
|
+
};
|
|
389
|
+
};
|
|
390
|
+
}];
|
|
391
|
+
};
|
|
392
|
+
};
|
|
393
|
+
}];
|
|
394
|
+
};
|
|
395
|
+
}];
|
|
396
|
+
};
|
|
397
|
+
};
|
|
398
|
+
}, {
|
|
399
|
+
readonly type: "object";
|
|
400
|
+
readonly required: true;
|
|
401
|
+
readonly properties: {
|
|
402
|
+
readonly transform: {
|
|
403
|
+
readonly type: "object";
|
|
404
|
+
readonly required: true;
|
|
405
|
+
readonly properties: {
|
|
406
|
+
readonly search: {
|
|
407
|
+
readonly type: "string";
|
|
408
|
+
readonly required: true;
|
|
409
|
+
};
|
|
410
|
+
readonly flags: {
|
|
411
|
+
readonly type: "string";
|
|
412
|
+
readonly default: "g";
|
|
413
|
+
readonly pattern: RegExp;
|
|
414
|
+
};
|
|
415
|
+
readonly replace: {
|
|
416
|
+
readonly type: "string";
|
|
417
|
+
readonly required: true;
|
|
418
|
+
};
|
|
419
|
+
readonly glob: {
|
|
420
|
+
readonly type: "string";
|
|
421
|
+
readonly required: true;
|
|
422
|
+
};
|
|
423
|
+
};
|
|
424
|
+
};
|
|
425
|
+
};
|
|
426
|
+
}];
|
|
427
|
+
};
|
|
428
|
+
}>;
|
|
429
|
+
export type Builder = typeof Builder.infer;
|
|
430
|
+
export declare namespace Builder { }
|
|
431
|
+
export default Builder;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Schema } from '@netfeez/common';
|
|
2
|
+
import { GlobalTransform } from './Transform.js';
|
|
3
|
+
import Extractor from './Extractor.js';
|
|
4
|
+
export const RunEntry = new Schema({
|
|
5
|
+
type: 'object',
|
|
6
|
+
required: true,
|
|
7
|
+
properties: {
|
|
8
|
+
maxTimeMs: { type: 'number', default: 60000, minimum: -1 },
|
|
9
|
+
allowFails: { type: 'boolean', default: false },
|
|
10
|
+
run: { type: 'union', required: true, union: [
|
|
11
|
+
{ type: 'string' },
|
|
12
|
+
{ type: 'array', items: { type: 'string' } }
|
|
13
|
+
] }
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
export const ExtractEntry = new Schema({
|
|
17
|
+
type: 'object',
|
|
18
|
+
required: true,
|
|
19
|
+
properties: {
|
|
20
|
+
extract: { type: 'union', required: true, union: [
|
|
21
|
+
{ type: 'string' },
|
|
22
|
+
Extractor.root
|
|
23
|
+
] }
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
export const TransformEntry = new Schema({
|
|
27
|
+
type: 'object',
|
|
28
|
+
required: true,
|
|
29
|
+
properties: {
|
|
30
|
+
transform: GlobalTransform.root
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
export const BuilderEntry = new Schema({
|
|
34
|
+
type: 'union',
|
|
35
|
+
required: true,
|
|
36
|
+
union: [
|
|
37
|
+
RunEntry.root,
|
|
38
|
+
ExtractEntry.root,
|
|
39
|
+
TransformEntry.root
|
|
40
|
+
]
|
|
41
|
+
});
|
|
42
|
+
export const Builder = new Schema({
|
|
43
|
+
type: 'array',
|
|
44
|
+
default: [],
|
|
45
|
+
items: BuilderEntry.root
|
|
46
|
+
});
|
|
47
|
+
export default Builder;
|
|
48
|
+
//# sourceMappingURL=Builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Builder.js","sourceRoot":"","sources":["../../../src/schema/Config/Builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAEvC,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,MAAM,CAAC;IAC/B,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE;QACR,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,EAA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