doc-detective-common 3.6.1-dev.1 → 3.6.1-dev.2
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/.c8rc.json +2 -2
- package/README.md +31 -1
- package/dist/files.d.ts +16 -0
- package/dist/files.d.ts.map +1 -0
- package/dist/files.js +123 -0
- package/dist/files.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +4 -0
- package/dist/resolvePaths.d.ts +28 -0
- package/dist/resolvePaths.d.ts.map +1 -0
- package/dist/resolvePaths.js +236 -0
- package/dist/resolvePaths.js.map +1 -0
- package/dist/schemas/index.d.ts +5 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +9 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/schemas.json +121359 -0
- package/dist/types/generated/checkLink_v3.d.ts +27 -0
- package/dist/types/generated/checkLink_v3.d.ts.map +1 -0
- package/dist/types/generated/checkLink_v3.js +8 -0
- package/dist/types/generated/checkLink_v3.js.map +1 -0
- package/dist/types/generated/click_v3.d.ts +16 -0
- package/dist/types/generated/click_v3.d.ts.map +1 -0
- package/dist/types/generated/click_v3.js +8 -0
- package/dist/types/generated/click_v3.js.map +1 -0
- package/dist/types/generated/config_v3.d.ts +398 -0
- package/dist/types/generated/config_v3.d.ts.map +1 -0
- package/dist/types/generated/config_v3.js +8 -0
- package/dist/types/generated/config_v3.js.map +1 -0
- package/dist/types/generated/context_v3.d.ts +108 -0
- package/dist/types/generated/context_v3.d.ts.map +1 -0
- package/dist/types/generated/context_v3.js +8 -0
- package/dist/types/generated/context_v3.js.map +1 -0
- package/dist/types/generated/dragAndDrop_v3.d.ts +37 -0
- package/dist/types/generated/dragAndDrop_v3.d.ts.map +1 -0
- package/dist/types/generated/dragAndDrop_v3.js +8 -0
- package/dist/types/generated/dragAndDrop_v3.js.map +1 -0
- package/dist/types/generated/endRecord_v3.d.ts +9 -0
- package/dist/types/generated/endRecord_v3.d.ts.map +1 -0
- package/dist/types/generated/endRecord_v3.js +8 -0
- package/dist/types/generated/endRecord_v3.js.map +1 -0
- package/dist/types/generated/find_v3.d.ts +16 -0
- package/dist/types/generated/find_v3.d.ts.map +1 -0
- package/dist/types/generated/find_v3.js +8 -0
- package/dist/types/generated/find_v3.js.map +1 -0
- package/dist/types/generated/goTo_v3.d.ts +46 -0
- package/dist/types/generated/goTo_v3.d.ts.map +1 -0
- package/dist/types/generated/goTo_v3.js +8 -0
- package/dist/types/generated/goTo_v3.js.map +1 -0
- package/dist/types/generated/httpRequest_v3.d.ts +16 -0
- package/dist/types/generated/httpRequest_v3.d.ts.map +1 -0
- package/dist/types/generated/httpRequest_v3.js +8 -0
- package/dist/types/generated/httpRequest_v3.js.map +1 -0
- package/dist/types/generated/loadCookie_v3.d.ts +16 -0
- package/dist/types/generated/loadCookie_v3.d.ts.map +1 -0
- package/dist/types/generated/loadCookie_v3.js +8 -0
- package/dist/types/generated/loadCookie_v3.js.map +1 -0
- package/dist/types/generated/loadVariables_v3.d.ts +9 -0
- package/dist/types/generated/loadVariables_v3.d.ts.map +1 -0
- package/dist/types/generated/loadVariables_v3.js +8 -0
- package/dist/types/generated/loadVariables_v3.js.map +1 -0
- package/dist/types/generated/openApi_v3.d.ts +62 -0
- package/dist/types/generated/openApi_v3.d.ts.map +1 -0
- package/dist/types/generated/openApi_v3.js +8 -0
- package/dist/types/generated/openApi_v3.js.map +1 -0
- package/dist/types/generated/record_v3.d.ts +32 -0
- package/dist/types/generated/record_v3.d.ts.map +1 -0
- package/dist/types/generated/record_v3.js +8 -0
- package/dist/types/generated/record_v3.js.map +1 -0
- package/dist/types/generated/report_v3.d.ts +174 -0
- package/dist/types/generated/report_v3.d.ts.map +1 -0
- package/dist/types/generated/report_v3.js +8 -0
- package/dist/types/generated/report_v3.js.map +1 -0
- package/dist/types/generated/resolvedTests_v3.d.ts +571 -0
- package/dist/types/generated/resolvedTests_v3.d.ts.map +1 -0
- package/dist/types/generated/resolvedTests_v3.js +8 -0
- package/dist/types/generated/resolvedTests_v3.js.map +1 -0
- package/dist/types/generated/runCode_v3.d.ts +57 -0
- package/dist/types/generated/runCode_v3.d.ts.map +1 -0
- package/dist/types/generated/runCode_v3.js +8 -0
- package/dist/types/generated/runCode_v3.js.map +1 -0
- package/dist/types/generated/runShell_v3.d.ts +56 -0
- package/dist/types/generated/runShell_v3.d.ts.map +1 -0
- package/dist/types/generated/runShell_v3.js +8 -0
- package/dist/types/generated/runShell_v3.js.map +1 -0
- package/dist/types/generated/saveCookie_v3.d.ts +16 -0
- package/dist/types/generated/saveCookie_v3.d.ts.map +1 -0
- package/dist/types/generated/saveCookie_v3.js +8 -0
- package/dist/types/generated/saveCookie_v3.js.map +1 -0
- package/dist/types/generated/screenshot_v3.d.ts +74 -0
- package/dist/types/generated/screenshot_v3.d.ts.map +1 -0
- package/dist/types/generated/screenshot_v3.js +8 -0
- package/dist/types/generated/screenshot_v3.js.map +1 -0
- package/dist/types/generated/sourceIntegration_v3.d.ts +30 -0
- package/dist/types/generated/sourceIntegration_v3.d.ts.map +1 -0
- package/dist/types/generated/sourceIntegration_v3.js +8 -0
- package/dist/types/generated/sourceIntegration_v3.js.map +1 -0
- package/dist/types/generated/spec_v3.d.ts +159 -0
- package/dist/types/generated/spec_v3.d.ts.map +1 -0
- package/dist/types/generated/spec_v3.js +8 -0
- package/dist/types/generated/spec_v3.js.map +1 -0
- package/dist/types/generated/step_v3.d.ts +1270 -0
- package/dist/types/generated/step_v3.d.ts.map +1 -0
- package/dist/types/generated/step_v3.js +8 -0
- package/dist/types/generated/step_v3.js.map +1 -0
- package/dist/types/generated/stopRecord_v3.d.ts +9 -0
- package/dist/types/generated/stopRecord_v3.d.ts.map +1 -0
- package/dist/types/generated/stopRecord_v3.js +8 -0
- package/dist/types/generated/stopRecord_v3.js.map +1 -0
- package/dist/types/generated/test_v3.d.ts +2915 -0
- package/dist/types/generated/test_v3.d.ts.map +1 -0
- package/dist/types/generated/test_v3.js +8 -0
- package/dist/types/generated/test_v3.js.map +1 -0
- package/dist/types/generated/type_v3.d.ts +54 -0
- package/dist/types/generated/type_v3.d.ts.map +1 -0
- package/dist/types/generated/type_v3.js +8 -0
- package/dist/types/generated/type_v3.js.map +1 -0
- package/dist/types/generated/wait_v3.d.ts +12 -0
- package/dist/types/generated/wait_v3.d.ts.map +1 -0
- package/dist/types/generated/wait_v3.js +8 -0
- package/dist/types/generated/wait_v3.js.map +1 -0
- package/dist/validate.d.ts +41 -0
- package/dist/validate.d.ts.map +1 -0
- package/dist/validate.js +549 -0
- package/dist/validate.js.map +1 -0
- package/package.json +17 -4
- package/plans/plan-typescriptMigration.prompt.md +25 -0
- package/scripts/createEsmWrapper.js +24 -0
- package/scripts/generateTypes.js +54 -0
- package/src/files.ts +86 -0
- package/src/index.ts +4 -0
- package/src/resolvePaths.ts +233 -0
- package/src/schemas/index.ts +6 -0
- package/src/types/generated/checkLink_v3.ts +29 -0
- package/src/types/generated/click_v3.ts +17 -0
- package/src/types/generated/config_v3.ts +405 -0
- package/src/types/generated/context_v3.ts +112 -0
- package/src/types/generated/dragAndDrop_v3.ts +39 -0
- package/src/types/generated/endRecord_v3.ts +10 -0
- package/src/types/generated/find_v3.ts +17 -0
- package/src/types/generated/goTo_v3.ts +48 -0
- package/src/types/generated/httpRequest_v3.ts +17 -0
- package/src/types/generated/loadCookie_v3.ts +17 -0
- package/src/types/generated/loadVariables_v3.ts +10 -0
- package/src/types/generated/openApi_v3.ts +64 -0
- package/src/types/generated/record_v3.ts +34 -0
- package/src/types/generated/report_v3.ts +183 -0
- package/src/types/generated/resolvedTests_v3.ts +585 -0
- package/src/types/generated/runCode_v3.ts +59 -0
- package/src/types/generated/runShell_v3.ts +58 -0
- package/src/types/generated/saveCookie_v3.ts +17 -0
- package/src/types/generated/screenshot_v3.ts +76 -0
- package/src/types/generated/sourceIntegration_v3.ts +31 -0
- package/src/types/generated/spec_v3.ts +166 -0
- package/src/types/generated/step_v3.ts +1288 -0
- package/src/types/generated/stopRecord_v3.ts +10 -0
- package/src/types/generated/test_v3.ts +3048 -0
- package/src/types/generated/type_v3.ts +56 -0
- package/src/types/generated/wait_v3.ts +13 -0
- package/src/validate.ts +611 -0
- package/tsconfig.json +22 -0
package/.c8rc.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"all": true,
|
|
3
|
-
"include": ["
|
|
4
|
-
"exclude": ["
|
|
3
|
+
"include": ["dist/**/*.js"],
|
|
4
|
+
"exclude": ["dist/types/generated/**/*.js", "dist/**/*.d.ts"],
|
|
5
5
|
"reporter": ["text", "lcov", "json", "json-summary"],
|
|
6
6
|
"report-dir": "coverage",
|
|
7
7
|
"check-coverage": false
|
package/README.md
CHANGED
|
@@ -30,6 +30,36 @@ This package exports the following components:
|
|
|
30
30
|
- `readFile` - File reading utilities
|
|
31
31
|
- `transformToSchemaKey` - Schema key transformation
|
|
32
32
|
|
|
33
|
+
### TypeScript Support
|
|
34
|
+
|
|
35
|
+
Full TypeScript support with exported types:
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import {
|
|
39
|
+
validate,
|
|
40
|
+
ValidateOptions,
|
|
41
|
+
ValidateResult,
|
|
42
|
+
resolvePaths,
|
|
43
|
+
ResolvePathsOptions
|
|
44
|
+
} from 'doc-detective-common';
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Documentation:**
|
|
48
|
+
- [TypeScript Migration Guide](./docs/typescript-migration.md) - Complete guide for TypeScript users
|
|
49
|
+
- [TypeScript Examples](./docs/typescript-examples.md) - Runnable code examples
|
|
50
|
+
|
|
51
|
+
### JavaScript Usage
|
|
52
|
+
|
|
53
|
+
Works seamlessly with JavaScript (CommonJS or ESM):
|
|
54
|
+
|
|
55
|
+
```javascript
|
|
56
|
+
// CommonJS
|
|
57
|
+
const { validate, schemas } = require('doc-detective-common');
|
|
58
|
+
|
|
59
|
+
// ESM
|
|
60
|
+
import { validate, schemas } from 'doc-detective-common';
|
|
61
|
+
```
|
|
62
|
+
|
|
33
63
|
## 🧪 Development
|
|
34
64
|
|
|
35
65
|
```bash
|
|
@@ -45,4 +75,4 @@ npm run build
|
|
|
45
75
|
|
|
46
76
|
## 📄 License
|
|
47
77
|
|
|
48
|
-
AGPL-3.0-only
|
|
78
|
+
AGPL-3.0-only
|
package/dist/files.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface ReadFileOptions {
|
|
2
|
+
fileURLOrPath: string;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Reads and parses content from a remote URL or local file path, supporting JSON and YAML formats.
|
|
6
|
+
*
|
|
7
|
+
* Attempts to parse the file content as JSON first, then YAML. If both parsing attempts fail, returns the raw content as a string. Returns `null` if the file cannot be read.
|
|
8
|
+
*
|
|
9
|
+
* @param options - Options object
|
|
10
|
+
* @param options.fileURLOrPath - The URL or local file path to read.
|
|
11
|
+
* @returns Parsed object for JSON or YAML files, raw string for other formats, or `null` if reading fails.
|
|
12
|
+
*
|
|
13
|
+
* @throws {Error} If {@link fileURLOrPath} is missing, not a string, or is an empty string.
|
|
14
|
+
*/
|
|
15
|
+
export declare function readFile({ fileURLOrPath }: ReadFileOptions): Promise<unknown | string | null>;
|
|
16
|
+
//# sourceMappingURL=files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../src/files.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,QAAQ,CAAC,EAAE,aAAa,EAAE,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,GAAG,MAAM,GAAG,IAAI,CAAC,CAiEnG"}
|
package/dist/files.js
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.readFile = readFile;
|
|
40
|
+
const fs = __importStar(require("fs"));
|
|
41
|
+
const YAML = __importStar(require("yaml"));
|
|
42
|
+
const axios_1 = __importDefault(require("axios"));
|
|
43
|
+
const url_1 = require("url");
|
|
44
|
+
/**
|
|
45
|
+
* Reads and parses content from a remote URL or local file path, supporting JSON and YAML formats.
|
|
46
|
+
*
|
|
47
|
+
* Attempts to parse the file content as JSON first, then YAML. If both parsing attempts fail, returns the raw content as a string. Returns `null` if the file cannot be read.
|
|
48
|
+
*
|
|
49
|
+
* @param options - Options object
|
|
50
|
+
* @param options.fileURLOrPath - The URL or local file path to read.
|
|
51
|
+
* @returns Parsed object for JSON or YAML files, raw string for other formats, or `null` if reading fails.
|
|
52
|
+
*
|
|
53
|
+
* @throws {Error} If {@link fileURLOrPath} is missing, not a string, or is an empty string.
|
|
54
|
+
*/
|
|
55
|
+
async function readFile({ fileURLOrPath }) {
|
|
56
|
+
if (!fileURLOrPath) {
|
|
57
|
+
throw new Error("fileURLOrPath is required");
|
|
58
|
+
}
|
|
59
|
+
if (typeof fileURLOrPath !== "string") {
|
|
60
|
+
throw new Error("fileURLOrPath must be a string");
|
|
61
|
+
}
|
|
62
|
+
if (fileURLOrPath.trim() === "") {
|
|
63
|
+
throw new Error("fileURLOrPath cannot be an empty string");
|
|
64
|
+
}
|
|
65
|
+
let content;
|
|
66
|
+
let isRemote = false;
|
|
67
|
+
try {
|
|
68
|
+
const parsedURL = new url_1.URL(fileURLOrPath);
|
|
69
|
+
isRemote =
|
|
70
|
+
parsedURL.protocol === "http:" || parsedURL.protocol === "https:";
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
// Not a valid URL, assume local file path
|
|
74
|
+
}
|
|
75
|
+
if (isRemote) {
|
|
76
|
+
try {
|
|
77
|
+
const response = await axios_1.default.get(fileURLOrPath);
|
|
78
|
+
content = response.data;
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
console.warn(`Error reading remote file from ${fileURLOrPath}: ${error.message}`);
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
try {
|
|
87
|
+
content = await fs.promises.readFile(fileURLOrPath, "utf8");
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
if (error.code === "ENOENT") {
|
|
91
|
+
console.warn(`File not found: ${fileURLOrPath}`);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
console.warn(`Error reading file: ${error.message}`);
|
|
95
|
+
}
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// Parse based on file extension
|
|
100
|
+
const ext = fileURLOrPath.split('.').pop()?.toLowerCase();
|
|
101
|
+
if (ext === "json") {
|
|
102
|
+
try {
|
|
103
|
+
return JSON.parse(content);
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
console.warn(`Failed to parse JSON: ${error.message}`);
|
|
107
|
+
return content;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
else if (ext === "yaml" || ext === "yml") {
|
|
111
|
+
try {
|
|
112
|
+
return YAML.parse(content);
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
console.warn(`Failed to parse YAML: ${error.message}`);
|
|
116
|
+
return content;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
return content;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../src/files.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,4BAiEC;AArFD,uCAAyB;AACzB,2CAA6B;AAC7B,kDAA0B;AAC1B,6BAA0B;AAM1B;;;;;;;;;;GAUG;AACI,KAAK,UAAU,QAAQ,CAAC,EAAE,aAAa,EAAmB;IAC/D,IAAI,CAAC,aAAa,EA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AAC;iBAAM,CAAC;gBACN,OAAO,CAAC,IAAI,CAAC,uBAAwB,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;YAClE,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,gCAAgC;IAChC,MAAM,GAAG,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,WAAW,EAAE,CAAC;IAE1D,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC;QACnB,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC7B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,IAAI,CAAC,yBAA0B,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;YAClE,OAAO,OAAO,CAAC;QACjB,CAAC;IACH,CAAC;SAAM,IAAI,GAAG,KAAK,MAAM,IAAI,GAAG,KAAK,KAAK,EAAE,CAAC;QAC3C,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC7B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,IAAI,CAAC,yBAA0B,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;YAClE,OAAO,OAAO,CAAC;QACjB,CAAC;IACH,CAAC;SAAM,CAAC;QACN,OAAO,OAAO,CAAC;IACjB,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { schemas, SchemaKey, Schema } from "./schemas";
|
|
2
|
+
export { validate, transformToSchemaKey, ValidateOptions, ValidateResult, TransformOptions } from "./validate";
|
|
3
|
+
export { resolvePaths, ResolvePathsOptions } from "./resolvePaths";
|
|
4
|
+
export { readFile, ReadFileOptions } from "./files";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC/G,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readFile = exports.resolvePaths = exports.transformToSchemaKey = exports.validate = exports.schemas = void 0;
|
|
4
|
+
var schemas_1 = require("./schemas");
|
|
5
|
+
Object.defineProperty(exports, "schemas", { enumerable: true, get: function () { return schemas_1.schemas; } });
|
|
6
|
+
var validate_1 = require("./validate");
|
|
7
|
+
Object.defineProperty(exports, "validate", { enumerable: true, get: function () { return validate_1.validate; } });
|
|
8
|
+
Object.defineProperty(exports, "transformToSchemaKey", { enumerable: true, get: function () { return validate_1.transformToSchemaKey; } });
|
|
9
|
+
var resolvePaths_1 = require("./resolvePaths");
|
|
10
|
+
Object.defineProperty(exports, "resolvePaths", { enumerable: true, get: function () { return resolvePaths_1.resolvePaths; } });
|
|
11
|
+
var files_1 = require("./files");
|
|
12
|
+
Object.defineProperty(exports, "readFile", { enumerable: true, get: function () { return files_1.readFile; } });
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qCAAuD;AAA9C,kGAAA,OAAO,OAAA;AAChB,uCAA+G;AAAtG,oGAAA,QAAQ,OAAA;AAAE,gHAAA,oBAAoB,OAAA;AACvC,+CAAmE;AAA1D,4GAAA,YAAY,OAAA;AACrB,iCAAoD;AAA3C,iGAAA,QAAQ,OAAA"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
type RelativePathBase = "file" | "cwd";
|
|
2
|
+
type ObjectType = "config" | "spec";
|
|
3
|
+
export interface ResolvePathsOptions {
|
|
4
|
+
config: {
|
|
5
|
+
relativePathBase: RelativePathBase;
|
|
6
|
+
};
|
|
7
|
+
object: Record<string, any>;
|
|
8
|
+
filePath: string;
|
|
9
|
+
nested?: boolean;
|
|
10
|
+
objectType?: ObjectType;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Convert recognized relative path properties in a config or spec object to absolute paths.
|
|
14
|
+
*
|
|
15
|
+
* Traverses the provided object (recursing into nested objects and arrays), resolving fields that represent filesystem paths according to the provided config.relativePathBase and reference filePath. On top-level calls the function infers whether the object is a config or spec via schema validation; for nested calls objectType must be provided.
|
|
16
|
+
*
|
|
17
|
+
* @param options - Options for path resolution.
|
|
18
|
+
* @param options.config - Configuration containing settings such as `relativePathBase`.
|
|
19
|
+
* @param options.object - The config or spec object whose path properties will be resolved.
|
|
20
|
+
* @param options.filePath - Reference file or directory used to resolve relative paths.
|
|
21
|
+
* @param options.nested - True when invoked recursively for nested objects.
|
|
22
|
+
* @param options.objectType - 'config' or 'spec'; required for nested invocations to select which properties to resolve.
|
|
23
|
+
* @returns The same object with applicable path properties converted to absolute paths.
|
|
24
|
+
* @throws {Error} If the top-level object matches neither config nor spec schema, or if `objectType` is missing for nested calls.
|
|
25
|
+
*/
|
|
26
|
+
export declare function resolvePaths({ config, object, filePath, nested, objectType, }: ResolvePathsOptions): Promise<Record<string, any>>;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=resolvePaths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolvePaths.d.ts","sourceRoot":"","sources":["../src/resolvePaths.ts"],"names":[],"mappings":"AAIA,KAAK,gBAAgB,GAAG,MAAM,GAAG,KAAK,CAAC;AACvC,KAAK,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEpC,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE;QAAE,gBAAgB,EAAE,gBAAgB,CAAA;KAAE,CAAC;IAC/C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,YAAY,CAAC,EACjC,MAAM,EACN,MAAM,EACN,QAAQ,EACR,MAAc,EACd,UAAU,GACX,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAqMpD"}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.resolvePaths = resolvePaths;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const validate_1 = require("./validate");
|
|
40
|
+
/**
|
|
41
|
+
* Convert recognized relative path properties in a config or spec object to absolute paths.
|
|
42
|
+
*
|
|
43
|
+
* Traverses the provided object (recursing into nested objects and arrays), resolving fields that represent filesystem paths according to the provided config.relativePathBase and reference filePath. On top-level calls the function infers whether the object is a config or spec via schema validation; for nested calls objectType must be provided.
|
|
44
|
+
*
|
|
45
|
+
* @param options - Options for path resolution.
|
|
46
|
+
* @param options.config - Configuration containing settings such as `relativePathBase`.
|
|
47
|
+
* @param options.object - The config or spec object whose path properties will be resolved.
|
|
48
|
+
* @param options.filePath - Reference file or directory used to resolve relative paths.
|
|
49
|
+
* @param options.nested - True when invoked recursively for nested objects.
|
|
50
|
+
* @param options.objectType - 'config' or 'spec'; required for nested invocations to select which properties to resolve.
|
|
51
|
+
* @returns The same object with applicable path properties converted to absolute paths.
|
|
52
|
+
* @throws {Error} If the top-level object matches neither config nor spec schema, or if `objectType` is missing for nested calls.
|
|
53
|
+
*/
|
|
54
|
+
async function resolvePaths({ config, object, filePath, nested = false, objectType, }) {
|
|
55
|
+
// Config properties that contain paths
|
|
56
|
+
const configPaths = [
|
|
57
|
+
"input",
|
|
58
|
+
"output",
|
|
59
|
+
"loadVariables",
|
|
60
|
+
"setup",
|
|
61
|
+
"cleanup",
|
|
62
|
+
"configPath",
|
|
63
|
+
"beforeAny",
|
|
64
|
+
"afterAll",
|
|
65
|
+
"mediaDirectory",
|
|
66
|
+
"downloadDirectory",
|
|
67
|
+
"descriptionPath",
|
|
68
|
+
"path",
|
|
69
|
+
];
|
|
70
|
+
// Spec properties that contain paths
|
|
71
|
+
const specPaths = [
|
|
72
|
+
"file",
|
|
73
|
+
"path",
|
|
74
|
+
"directory",
|
|
75
|
+
"before",
|
|
76
|
+
"after",
|
|
77
|
+
"loadVariables",
|
|
78
|
+
"setup",
|
|
79
|
+
"cleanup",
|
|
80
|
+
"savePath",
|
|
81
|
+
"saveDirectory",
|
|
82
|
+
"specPath",
|
|
83
|
+
"descriptionPath",
|
|
84
|
+
"workingDirectory",
|
|
85
|
+
];
|
|
86
|
+
// Spec objects that are configurable by the user and shouldn't be resolved
|
|
87
|
+
const specNoResolve = [
|
|
88
|
+
"requestData",
|
|
89
|
+
"responseData",
|
|
90
|
+
"requestHeaders",
|
|
91
|
+
"responseHeaders",
|
|
92
|
+
"requestParams",
|
|
93
|
+
"responseParams",
|
|
94
|
+
];
|
|
95
|
+
/**
|
|
96
|
+
* Resolves a relative path to an absolute path using a specified base type and reference file path.
|
|
97
|
+
*
|
|
98
|
+
* @param baseType - Indicates whether to resolve relative to the reference file's directory ("file") or the current working directory ("cwd").
|
|
99
|
+
* @param relativePath - The path to resolve, which may be relative or absolute.
|
|
100
|
+
* @param filePath - The reference file or directory path used for resolution.
|
|
101
|
+
* @returns The absolute path corresponding to {@link relativePath}.
|
|
102
|
+
*
|
|
103
|
+
* @remark If {@link relativePath} is already absolute, it is returned unchanged. If {@link filePath} does not exist, its extension is used to infer whether it is a file or directory.
|
|
104
|
+
* @remark HTTP and HTTPS URLs are returned unchanged without resolution.
|
|
105
|
+
*/
|
|
106
|
+
function resolve(baseType, relativePath, filePath) {
|
|
107
|
+
// If the path is an http:// or https:// URL, or a heretto: URI, return it
|
|
108
|
+
if (relativePath.startsWith("https://") || relativePath.startsWith("http://") || relativePath.startsWith("heretto:")) {
|
|
109
|
+
return relativePath;
|
|
110
|
+
}
|
|
111
|
+
// If path is already absolute, return it
|
|
112
|
+
if (path.isAbsolute(relativePath)) {
|
|
113
|
+
return relativePath;
|
|
114
|
+
}
|
|
115
|
+
// Check if filePath exists and is a file
|
|
116
|
+
const fileExists = fs.existsSync(filePath);
|
|
117
|
+
const isFile = fileExists
|
|
118
|
+
? fs.lstatSync(filePath).isFile()
|
|
119
|
+
: path.parse(filePath).ext !== "";
|
|
120
|
+
// Use directory of filePath if it's a file (or looks like one)
|
|
121
|
+
const basePath = isFile ? path.dirname(filePath) : filePath;
|
|
122
|
+
// Resolve the path based on the base type
|
|
123
|
+
return baseType === "file"
|
|
124
|
+
? path.resolve(basePath, relativePath)
|
|
125
|
+
: path.resolve(relativePath);
|
|
126
|
+
}
|
|
127
|
+
const relativePathBase = config.relativePathBase;
|
|
128
|
+
let pathProperties;
|
|
129
|
+
if (!nested && !objectType) {
|
|
130
|
+
// Check if object matches the config schema
|
|
131
|
+
const validation = (0, validate_1.validate)({
|
|
132
|
+
schemaKey: "config_v3",
|
|
133
|
+
object: { ...object },
|
|
134
|
+
});
|
|
135
|
+
if (validation.valid) {
|
|
136
|
+
pathProperties = configPaths;
|
|
137
|
+
objectType = "config";
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
// Check if object matches the spec schema
|
|
141
|
+
const validation = (0, validate_1.validate)({
|
|
142
|
+
schemaKey: "spec_v3",
|
|
143
|
+
object: { ...object },
|
|
144
|
+
});
|
|
145
|
+
if (validation.valid) {
|
|
146
|
+
pathProperties = specPaths;
|
|
147
|
+
objectType = "spec";
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
throw new Error("Object isn't a valid config or spec.");
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
else if (nested && !objectType) {
|
|
155
|
+
// If the object is nested, the object type is required
|
|
156
|
+
throw new Error("Object type is required for nested objects.");
|
|
157
|
+
}
|
|
158
|
+
else if (objectType === "config") {
|
|
159
|
+
// If the object type is config, use configPaths
|
|
160
|
+
pathProperties = configPaths;
|
|
161
|
+
}
|
|
162
|
+
else if (objectType === "spec") {
|
|
163
|
+
// If the object type is spec, use specPaths
|
|
164
|
+
pathProperties = specPaths;
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
throw new Error("Invalid objectType");
|
|
168
|
+
}
|
|
169
|
+
// If the object is null or empty, return it as is
|
|
170
|
+
if (object === null || Object.keys(object).length === 0) {
|
|
171
|
+
return object;
|
|
172
|
+
}
|
|
173
|
+
for (const property of Object.keys(object)) {
|
|
174
|
+
// If the property is an array, recursively call resolvePaths for each item in the array
|
|
175
|
+
if (Array.isArray(object[property])) {
|
|
176
|
+
for (let i = 0; i < object[property].length; i++) {
|
|
177
|
+
const item = object[property][i];
|
|
178
|
+
// If the item is an object, recursively call resolvePaths to resolve paths within the object
|
|
179
|
+
if (typeof item === "object") {
|
|
180
|
+
await resolvePaths({
|
|
181
|
+
config: config,
|
|
182
|
+
object: item,
|
|
183
|
+
filePath: filePath,
|
|
184
|
+
nested: true,
|
|
185
|
+
objectType: objectType,
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
else if (typeof item === "string" &&
|
|
189
|
+
pathProperties.includes(property)) {
|
|
190
|
+
// Resolve the string path and write it back into the array
|
|
191
|
+
const resolved = property === "path" &&
|
|
192
|
+
object.directory &&
|
|
193
|
+
path.isAbsolute(object.directory)
|
|
194
|
+
? resolve(relativePathBase, item, object.directory)
|
|
195
|
+
: resolve(relativePathBase, item, filePath);
|
|
196
|
+
object[property][i] = resolved;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
// If the property is an object, recursively call resolvePaths to resolve paths within the object
|
|
201
|
+
else if (typeof object[property] === "object" &&
|
|
202
|
+
((objectType === "spec" && !specNoResolve.includes(property)) ||
|
|
203
|
+
objectType === "config")) {
|
|
204
|
+
// If the property is an object, recursively call resolvePaths to resolve paths within the object
|
|
205
|
+
object[property] = await resolvePaths({
|
|
206
|
+
config: config,
|
|
207
|
+
object: object[property],
|
|
208
|
+
filePath: filePath,
|
|
209
|
+
nested: true,
|
|
210
|
+
objectType: objectType,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
else if (typeof object[property] === "string") {
|
|
214
|
+
// If the property begins with "https://", "http://", or "heretto:", skip it
|
|
215
|
+
if (object[property].startsWith("https://") ||
|
|
216
|
+
object[property].startsWith("http://") ||
|
|
217
|
+
object[property].startsWith("heretto:")) {
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
// Check if it matches any of the path properties and resolve it if it does
|
|
221
|
+
if (pathProperties.includes(property)) {
|
|
222
|
+
if (property === "path" && object.directory) {
|
|
223
|
+
const directory = path.isAbsolute(object.directory)
|
|
224
|
+
? object.directory
|
|
225
|
+
: resolve(relativePathBase, object.directory, filePath);
|
|
226
|
+
object[property] = resolve(relativePathBase, object[property], directory);
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
object[property] = resolve(relativePathBase, object[property], filePath);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return object;
|
|
235
|
+
}
|
|
236
|
+
//# sourceMappingURL=resolvePaths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolvePaths.js","sourceRoot":"","sources":["../src/resolvePaths.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,oCA2MC;AAxOD,uCAAyB;AACzB,2CAA6B;AAC7B,yCAAsC;AAatC;;;;;;;;;;;;;GAaG;AACI,KAAK,UA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C,SAAS,EAAE,CAAC;oBAC5C,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC;wBACjD,CAAC,CAAC,MAAM,CAAC,SAAS;wBAClB,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;oBAC1D,MAAM,CAAC,QAAQ,CAAC,GAAG,OAAO,CACxB,gBAAgB,EAChB,MAAM,CAAC,QAAQ,CAAC,EAChB,SAAS,CACV,CAAC;gBACJ,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,QAAQ,CAAC,GAAG,OAAO,CACxB,gBAAgB,EAChB,MAAM,CAAC,QAAQ,CAAC,EAChB,QAAQ,CACT,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAEzC,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,WAAW,CAAC;AACjD,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC;AAErD,eAAO,MAAM,OAAO,EAAE,OAAO,WAAyB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.schemas = void 0;
|
|
7
|
+
const schemas_json_1 = __importDefault(require("./schemas.json"));
|
|
8
|
+
exports.schemas = schemas_json_1.default;
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":";;;;;;AAAA,kEAAyC;AAK5B,QAAA,OAAO,GAAuB,sBAAW,CAAC"}
|