@intuned/runtime-dev 1.3.18-interface.12 → 1.3.18-interface.15
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/.babelrc +27 -0
- package/.claude/settings.local.json +7 -0
- package/.eslintignore +10 -0
- package/.eslintrc.js +39 -0
- package/InterfaceTemplate/__utils.ts +63 -0
- package/InterfaceTemplate/index.playwright.ts +6 -0
- package/WebTemplate.zip +0 -0
- package/package.json +19 -72
- package/template.tsconfig.json +11 -0
- package/tsconfig.eslint.json +5 -0
- package/tsconfig.json +25 -0
- package/tsup.config.ts +11 -0
- package/typedoc.json +49 -0
- package/dist/commands/api/run.d.ts +0 -8
- package/dist/commands/api/run.js +0 -2094
- package/dist/commands/auth-sessions/load.d.ts +0 -1
- package/dist/commands/auth-sessions/load.js +0 -1559
- package/dist/commands/auth-sessions/run-check.d.ts +0 -1
- package/dist/commands/auth-sessions/run-check.js +0 -1964
- package/dist/commands/auth-sessions/run-create.d.ts +0 -1
- package/dist/commands/auth-sessions/run-create.js +0 -1968
- package/dist/commands/browser/save-state.d.ts +0 -1
- package/dist/commands/browser/save-state.js +0 -108
- package/dist/commands/browser/start-browser.d.ts +0 -1
- package/dist/commands/browser/start-browser.js +0 -67
- package/dist/commands/build.d.ts +0 -2
- package/dist/commands/build.js +0 -203
- package/dist/commands/common/tsNodeImport.d.ts +0 -5
- package/dist/commands/common/tsNodeImport.js +0 -82
- package/dist/commands/get-headless-user-agent.d.ts +0 -2
- package/dist/commands/get-headless-user-agent.js +0 -354
- package/dist/commands/interface/run.d.ts +0 -3
- package/dist/commands/interface/run.js +0 -2084
- package/dist/commands/intuned-cli/main.d.ts +0 -2
- package/dist/commands/intuned-cli/main.js +0 -5403
- package/dist/commands/ts-check.d.ts +0 -1
- package/dist/commands/ts-check.js +0 -158
- package/dist/common/assets/browser_scripts.js +0 -2580
- package/dist/common/asyncLocalStorage/index.d.ts +0 -17
- package/dist/common/asyncLocalStorage/index.js +0 -41
- package/dist/common/binStartupScript.d.ts +0 -2
- package/dist/common/binStartupScript.js +0 -152
- package/dist/common/cleanEnvironmentVariables.d.ts +0 -3
- package/dist/common/cleanEnvironmentVariables.js +0 -38
- package/dist/common/constants.d.ts +0 -13
- package/dist/common/constants.js +0 -59
- package/dist/common/contextStorageStateHelpers.d.ts +0 -24
- package/dist/common/contextStorageStateHelpers.js +0 -108
- package/dist/common/jwtTokenManager.d.ts +0 -19
- package/dist/common/jwtTokenManager.js +0 -180
- package/dist/common/runApi/index.d.ts +0 -11
- package/dist/common/runApi/index.js +0 -1873
- package/dist/common/settingsSchema.d.ts +0 -540
- package/dist/common/settingsSchema.js +0 -92
- package/dist/common/telemetry.d.ts +0 -6
- package/dist/common/telemetry.js +0 -63
- package/dist/export.d-BAUMB-lG.d.ts +0 -140
- package/dist/index.d.ts +0 -6
- package/dist/index.js +0 -808
- package/dist/runtime/index.d.ts +0 -168
- package/dist/runtime/index.js +0 -801
package/.babelrc
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"presets": [
|
|
3
|
+
[
|
|
4
|
+
"@babel/preset-env",
|
|
5
|
+
{
|
|
6
|
+
"targets": {
|
|
7
|
+
"chrome": 130,
|
|
8
|
+
"node": "20"
|
|
9
|
+
},
|
|
10
|
+
"modules": "commonjs"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"@babel/preset-typescript"
|
|
14
|
+
],
|
|
15
|
+
"plugins": [
|
|
16
|
+
["module-resolver", {
|
|
17
|
+
"root": ["./src"],
|
|
18
|
+
"alias": {
|
|
19
|
+
"@intuned/runtime-interface": "./src/vendor/runtime-interface"
|
|
20
|
+
}
|
|
21
|
+
}],
|
|
22
|
+
"babel-plugin-macros",
|
|
23
|
+
"@babel/plugin-transform-export-namespace-from"
|
|
24
|
+
],
|
|
25
|
+
"sourceMaps": false,
|
|
26
|
+
"comments": false
|
|
27
|
+
}
|
package/.eslintignore
ADDED
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
root: true,
|
|
3
|
+
parser: "@typescript-eslint/parser",
|
|
4
|
+
parserOptions: {
|
|
5
|
+
project: "./tsconfig.eslint.json",
|
|
6
|
+
tsconfigRootDir: __dirname,
|
|
7
|
+
},
|
|
8
|
+
plugins: ["@typescript-eslint", "deprecation", "prettier"],
|
|
9
|
+
ignorePatterns: ["src/common/browserScripts/rollup.config.mjs"],
|
|
10
|
+
extends: [
|
|
11
|
+
"eslint:recommended",
|
|
12
|
+
"plugin:@typescript-eslint/eslint-recommended",
|
|
13
|
+
"plugin:@typescript-eslint/recommended",
|
|
14
|
+
],
|
|
15
|
+
rules: {
|
|
16
|
+
"@next/next/no-html-link-for-pages": 0,
|
|
17
|
+
"prettier/prettier": "error",
|
|
18
|
+
|
|
19
|
+
// recommended for safety
|
|
20
|
+
"@typescript-eslint/no-floating-promises": "error", // forgetting to await Activities and Workflow APIs is bad
|
|
21
|
+
"deprecation/deprecation": "warn",
|
|
22
|
+
|
|
23
|
+
// code style preference
|
|
24
|
+
"object-shorthand": ["warn", "always"],
|
|
25
|
+
|
|
26
|
+
// relaxed rules, for convenience
|
|
27
|
+
"@typescript-eslint/no-unused-vars": [
|
|
28
|
+
"warn",
|
|
29
|
+
{
|
|
30
|
+
argsIgnorePattern: "^_",
|
|
31
|
+
varsIgnorePattern: "^_",
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
35
|
+
"@typescript-eslint/no-empty-interface": "off",
|
|
36
|
+
"@typescript-eslint/ban-ts-comment": "warn",
|
|
37
|
+
"no-empty": "warn",
|
|
38
|
+
},
|
|
39
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import type { ImportFunction } from "@intuned/runtime-interface";
|
|
3
|
+
|
|
4
|
+
import { err, ok } from "neverthrow";
|
|
5
|
+
|
|
6
|
+
export const importModule: ImportFunction = async (path: string) => {
|
|
7
|
+
const [folderName, ...functionNameParts] = path.split("/");
|
|
8
|
+
const functionNameDepth = functionNameParts.length;
|
|
9
|
+
|
|
10
|
+
// string literals should be inline
|
|
11
|
+
// currently we support only 5 levels of depth
|
|
12
|
+
// rollup dynamic import does not support multiple levels of dynamic imports so we need to specify the possible paths explicitly
|
|
13
|
+
let imported: any = undefined;
|
|
14
|
+
try {
|
|
15
|
+
switch (functionNameDepth) {
|
|
16
|
+
case 1:
|
|
17
|
+
imported = await import(`./${folderName}/${functionNameParts[0]}.ts`);
|
|
18
|
+
break;
|
|
19
|
+
case 2:
|
|
20
|
+
imported = await import(
|
|
21
|
+
`./${folderName}/${functionNameParts[0]}/${functionNameParts[1]}.ts`
|
|
22
|
+
);
|
|
23
|
+
break;
|
|
24
|
+
case 3:
|
|
25
|
+
imported = await import(
|
|
26
|
+
`./${folderName}/${functionNameParts[0]}/${functionNameParts[1]}/${functionNameParts[2]}.ts`
|
|
27
|
+
);
|
|
28
|
+
break;
|
|
29
|
+
case 4:
|
|
30
|
+
imported = await import(
|
|
31
|
+
`./${folderName}/${functionNameParts[0]}/${functionNameParts[1]}/${functionNameParts[2]}/${functionNameParts[3]}.ts`
|
|
32
|
+
);
|
|
33
|
+
break;
|
|
34
|
+
case 5:
|
|
35
|
+
imported = await import(
|
|
36
|
+
`./${folderName}/${functionNameParts[0]}/${functionNameParts[1]}/${functionNameParts[2]}/${functionNameParts[3]}/${functionNameParts[4]}.ts`
|
|
37
|
+
);
|
|
38
|
+
break;
|
|
39
|
+
default:
|
|
40
|
+
return err({
|
|
41
|
+
type: "other",
|
|
42
|
+
error: new Error(
|
|
43
|
+
`intuned supports maximum 5 levels of depth in the api folder`
|
|
44
|
+
),
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return ok(imported);
|
|
48
|
+
} catch (e: any) {
|
|
49
|
+
if (
|
|
50
|
+
"message" in e &&
|
|
51
|
+
typeof e.message === "string" &&
|
|
52
|
+
e.message.includes("Unknown variable dynamic import")
|
|
53
|
+
) {
|
|
54
|
+
return err({
|
|
55
|
+
type: "not_found",
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return err({
|
|
59
|
+
type: "other",
|
|
60
|
+
error: e,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
};
|
package/WebTemplate.zip
ADDED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,81 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intuned/runtime-dev",
|
|
3
|
-
"version": "1.3.18-interface.
|
|
3
|
+
"version": "1.3.18-interface.15",
|
|
4
4
|
"description": "Intuned runtime",
|
|
5
5
|
"packageManager": "yarn@4.12.0",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
|
-
".":
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"./dist/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"./dist/common/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"./dist/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
"./dist/common/contextStorageStateHelpers": {
|
|
26
|
-
"types": "./dist/common/contextStorageStateHelpers.d.ts",
|
|
27
|
-
"require": "./dist/common/contextStorageStateHelpers.js"
|
|
28
|
-
},
|
|
29
|
-
"./dist/common/telemetry": {
|
|
30
|
-
"types": "./dist/common/telemetry.d.ts",
|
|
31
|
-
"require": "./dist/common/telemetry.js"
|
|
32
|
-
},
|
|
33
|
-
"./dist/common/jwtTokenManager": {
|
|
34
|
-
"types": "./dist/common/jwtTokenManager.d.ts",
|
|
35
|
-
"require": "./dist/common/jwtTokenManager.js"
|
|
36
|
-
},
|
|
37
|
-
"./dist/common/asyncLocalStorage": {
|
|
38
|
-
"types": "./dist/common/asyncLocalStorage/index.d.ts",
|
|
39
|
-
"require": "./dist/common/asyncLocalStorage/index.js"
|
|
40
|
-
},
|
|
41
|
-
"./dist/common/cleanEnvironmentVariables": {
|
|
42
|
-
"types": "./dist/common/cleanEnvironmentVariables.d.ts",
|
|
43
|
-
"require": "./dist/common/cleanEnvironmentVariables.js"
|
|
44
|
-
},
|
|
45
|
-
"./dist/common/constants": {
|
|
46
|
-
"types": "./dist/common/constants.d.ts",
|
|
47
|
-
"require": "./dist/common/constants.js"
|
|
48
|
-
},
|
|
49
|
-
"./dist/commands/interface/run": {
|
|
50
|
-
"types": "./dist/commands/interface/run.d.ts",
|
|
51
|
-
"require": "./dist/commands/interface/run.js"
|
|
52
|
-
},
|
|
53
|
-
"./dist/commands/build": {
|
|
54
|
-
"types": "./dist/commands/build.d.ts",
|
|
55
|
-
"require": "./dist/commands/build.js"
|
|
56
|
-
},
|
|
57
|
-
"./dist/common/binStartupScript": {
|
|
58
|
-
"types": "./dist/common/binStartupScript.d.ts",
|
|
59
|
-
"require": "./dist/common/binStartupScript.js"
|
|
60
|
-
},
|
|
61
|
-
"./dist/commands/common/tsNodeImport": {
|
|
62
|
-
"types": "./dist/commands/common/tsNodeImport.d.ts",
|
|
63
|
-
"require": "./dist/commands/common/tsNodeImport.js"
|
|
64
|
-
},
|
|
65
|
-
"./dist/commands/intuned-cli/main.js": "./dist/commands/intuned-cli/main.js",
|
|
66
|
-
"./dist/commands/api/run.js": "./dist/commands/api/run.js",
|
|
67
|
-
"./dist/commands/auth-sessions/run-check.js": "./dist/commands/auth-sessions/run-check.js",
|
|
68
|
-
"./dist/commands/auth-sessions/run-create.js": "./dist/commands/auth-sessions/run-create.js",
|
|
69
|
-
"./dist/commands/auth-sessions/load.js": "./dist/commands/auth-sessions/load.js",
|
|
70
|
-
"./dist/commands/browser/save-state.js": "./dist/commands/browser/save-state.js",
|
|
71
|
-
"./dist/commands/browser/start-browser.js": "./dist/commands/browser/start-browser.js",
|
|
72
|
-
"./dist/commands/get-headless-user-agent.js": "./dist/commands/get-headless-user-agent.js",
|
|
73
|
-
"./dist/commands/ts-check.js": "./dist/commands/ts-check.js"
|
|
9
|
+
".": "./dist/index.js",
|
|
10
|
+
"./dist/runtime": "./dist/runtime/index.js",
|
|
11
|
+
"./dist/common/runApi": "./dist/common/runApi/index.js",
|
|
12
|
+
"./dist/common/settingsSchema": "./dist/common/settingsSchema.js",
|
|
13
|
+
"./dist/common/contextStorageStateHelpers": "./dist/common/contextStorageStateHelpers.js",
|
|
14
|
+
"./dist/common/telemetry": "./dist/common/telemetry.js",
|
|
15
|
+
"./dist/common/jwtTokenManager": "./dist/common/jwtTokenManager.js",
|
|
16
|
+
"./dist/common/asyncLocalStorage": "./dist/common/asyncLocalStorage/index.js",
|
|
17
|
+
"./dist/common/cleanEnvironmentVariables": "./dist/common/cleanEnvironmentVariables.js",
|
|
18
|
+
"./dist/common/constants": "./dist/common/constants.js",
|
|
19
|
+
"./dist/commands/interface/run": "./dist/commands/interface/run.js",
|
|
20
|
+
"./interface": "./dist/commands/interface/index.js",
|
|
21
|
+
"./dist/commands/intuned-run/intuned-run": "./dist/commands/intuned-run/intuned-run.js",
|
|
22
|
+
"./dist/common/binStartupScript": "./dist/common/binStartupScript.js",
|
|
23
|
+
"./dist/commands/common/utils/interfaceClient": "./dist/commands/common/utils/interfaceClient.js"
|
|
74
24
|
},
|
|
75
|
-
"files": [
|
|
76
|
-
"dist",
|
|
77
|
-
"bin"
|
|
78
|
-
],
|
|
79
25
|
"author": "Intuned Team",
|
|
80
26
|
"license": "Elastic-2.0",
|
|
81
27
|
"scripts": {
|
|
@@ -89,7 +35,7 @@
|
|
|
89
35
|
"intuned-ts-check": "yarn prepublishOnly && vite-node ./src/commands/ts-check.ts",
|
|
90
36
|
"intuned": "vite-node ./src/commands/intuned-cli/main.ts",
|
|
91
37
|
"intuned-get-headless-user-agent": "vite-node ./src/commands/get-headless-user-agent.ts",
|
|
92
|
-
"build": "rm -rf
|
|
38
|
+
"build": "rm -rf dist && tsc -p tsconfig.json && yarn copy-dts && babel src --out-dir dist --extensions '.ts' && tsup && cp -r ./src/common/assets dist/common/assets",
|
|
93
39
|
"test": "vitest run",
|
|
94
40
|
"test:watch": "vitest",
|
|
95
41
|
"e2e": "yarn playwright test --config ./playwright.config.ts",
|
|
@@ -164,7 +110,7 @@
|
|
|
164
110
|
"@babel/plugin-transform-export-namespace-from": "^7.24.1",
|
|
165
111
|
"@babel/preset-env": "^7.23.7",
|
|
166
112
|
"@babel/preset-typescript": "^7.23.3",
|
|
167
|
-
"@intuned/runtime-interface": "
|
|
113
|
+
"@intuned/runtime-interface": "workspace:*",
|
|
168
114
|
"@jest/globals": "^29.6.2",
|
|
169
115
|
"@ngneat/falso": "^7.2.0",
|
|
170
116
|
"@types/jest": "^29.5.3",
|
|
@@ -178,6 +124,7 @@
|
|
|
178
124
|
"@typescript-eslint/parser": "^7.5.0",
|
|
179
125
|
"@vitest/ui": "^1.1.3",
|
|
180
126
|
"babel-plugin-macros": "^3.1.0",
|
|
127
|
+
"babel-plugin-module-resolver": "^5.0.2",
|
|
181
128
|
"babel-preset-minify": "^0.5.2",
|
|
182
129
|
"copyfiles": "^2.4.1",
|
|
183
130
|
"dts-bundle-generator": "^8.0.1",
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2021",
|
|
4
|
+
"module": "esnext",
|
|
5
|
+
"esModuleInterop": true,
|
|
6
|
+
"moduleResolution": "bundler",
|
|
7
|
+
"resolveJsonModule": true,
|
|
8
|
+
"outDir": "./dist",
|
|
9
|
+
"strict": false,
|
|
10
|
+
"strictNullChecks": true,
|
|
11
|
+
"rootDir": "./src",
|
|
12
|
+
"sourceMap": false,
|
|
13
|
+
"declaration": true,
|
|
14
|
+
"emitDeclarationOnly": false,
|
|
15
|
+
"skipLibCheck": true,
|
|
16
|
+
"types": ["vitest/globals"]
|
|
17
|
+
},
|
|
18
|
+
"include": [
|
|
19
|
+
"src/**/*.ts",
|
|
20
|
+
"src/**/*.d.ts",
|
|
21
|
+
"types-package/noEmpty.ts",
|
|
22
|
+
"src/assets/**/*"
|
|
23
|
+
],
|
|
24
|
+
"exclude": ["node_modules", "**/*.test.ts", "**/__tests__/*"]
|
|
25
|
+
}
|
package/tsup.config.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { defineConfig } from "tsup";
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
entry: ["src/vendor/runtime-interface.ts"],
|
|
5
|
+
format: ["cjs"],
|
|
6
|
+
dts: true,
|
|
7
|
+
outDir: "dist/vendor",
|
|
8
|
+
clean: false, // Don't clean - babel handles dist cleanup
|
|
9
|
+
sourcemap: false,
|
|
10
|
+
target: "node20",
|
|
11
|
+
});
|
package/typedoc.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
// base config
|
|
3
|
+
"out": "docs/content",
|
|
4
|
+
"tsconfig": "./types-package/tsconfig.json",
|
|
5
|
+
"entryPoints": ["./types-package/ai-extractors/index.d.ts"],
|
|
6
|
+
|
|
7
|
+
// specific inclusions and exclusions
|
|
8
|
+
// "excludeProtected": true,
|
|
9
|
+
// "excludeNotDocumented": true,
|
|
10
|
+
|
|
11
|
+
"exclude": [
|
|
12
|
+
"./src.ts/_admin/**/*",
|
|
13
|
+
"./src.ts/_tests/**/*",
|
|
14
|
+
"./src.ts/testcases/**/*"
|
|
15
|
+
],
|
|
16
|
+
|
|
17
|
+
// plugins
|
|
18
|
+
"plugin": [
|
|
19
|
+
// "./plugins/reorderSections.mjs",
|
|
20
|
+
"typedoc-plugin-remove-references", // remove additional references that clutter documentation
|
|
21
|
+
"typedoc-plugin-markdown", // generate markdown files
|
|
22
|
+
"typedoc-plugin-frontmatter", // add frontmatter to markdown files, prereq for the below custom plugin
|
|
23
|
+
"./docs/plugins/typedoc-plugin-mintlify-frontmatter.mjs", // formats frontmatter to match mintlify
|
|
24
|
+
"./docs/plugins/typedoc-plugin-navigation-output.mjs" // formats navigation to match mintlify
|
|
25
|
+
],
|
|
26
|
+
|
|
27
|
+
// formatting + mintlify compatibility
|
|
28
|
+
"fileExtension": ".mdx", // use mdx files for mintlfiy compatibility
|
|
29
|
+
"entryFileName": "index.mdx", // rename entry from "README.md" to "index.mdx"
|
|
30
|
+
"hidePageHeader": true, // hide page header, conflicts with mintlify
|
|
31
|
+
"hidePageTitle": true, // hide page title, conflicts with mintlify
|
|
32
|
+
"hideBreadcrumbs": true, // hide breadcrumbs, conflicts with mintlify
|
|
33
|
+
"useCodeBlocks": true, // makes API definitions more readable
|
|
34
|
+
|
|
35
|
+
"expandObjects": false,
|
|
36
|
+
// "parametersFormat": "table", // readability
|
|
37
|
+
// "propertiesFormat": "table", // readability
|
|
38
|
+
"navigation": {
|
|
39
|
+
"includeCategories": true,
|
|
40
|
+
"includeGroups": false
|
|
41
|
+
},
|
|
42
|
+
"disableSources": true,
|
|
43
|
+
"hideParameterTypesInTitle": false,
|
|
44
|
+
// "membersWithOwnFile": ["Class", "Enum", "Interface", "Function"],
|
|
45
|
+
// "hideParameterTypesInTitle": true,
|
|
46
|
+
"readme": "none",
|
|
47
|
+
"githubPages": false,
|
|
48
|
+
"excludeExternals": true
|
|
49
|
+
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
declare function executeCLI(apiName: string, mode: "vanilla" | "playwright" | "playwright-standalone" | "playwright-headless", inputData: object | null | undefined, options: {
|
|
3
|
-
cdpAddress: string;
|
|
4
|
-
authSessionPath: undefined | string;
|
|
5
|
-
outputFileId: string | undefined;
|
|
6
|
-
}): Promise<void>;
|
|
7
|
-
|
|
8
|
-
export { executeCLI };
|