@intuned/runtime-dev 0.1.0-test.45 → 0.1.0-test.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/InterfaceTemplate/index.ts +1 -0
- package/Intuned.json +1 -1
- package/WebTemplate/api.ts +92 -90
- package/WebTemplate/controllers/async.ts +48 -52
- package/WebTemplate/controllers/authSessions/check.ts +5 -4
- package/WebTemplate/controllers/authSessions/create.ts +8 -6
- package/WebTemplate/controllers/authSessions/resumeOperation.ts +1 -1
- package/WebTemplate/controllers/runApi/helpers.ts +8 -13
- package/WebTemplate/index.playwright.ts +42 -32
- package/WebTemplate/jobs.ts +2 -13
- package/WebTemplate/utils.ts +1 -48
- package/api/test2.ts +5 -7
- package/auth-sessions/check.ts +1 -3
- package/auth-sessions/create.ts +10 -10
- package/bin/intuned-ts-check +1 -1
- package/dist/commands/api/run.js +5 -7
- package/dist/commands/auth-sessions/run-check.js +3 -9
- package/dist/commands/auth-sessions/run-create.js +6 -11
- package/dist/commands/build.js +12 -16
- package/dist/commands/common/getDefaultExportFromFile.d.ts +1 -0
- package/dist/commands/common/{tsNodeImport.js → getDefaultExportFromFile.js} +5 -6
- package/dist/commands/common/utils/settings.js +5 -5
- package/dist/commands/common/utils/webTemplate.d.ts +1 -0
- package/dist/commands/common/utils/{template.js → webTemplate.js} +7 -7
- package/dist/commands/interface/run.d.ts +2 -1
- package/dist/commands/interface/run.js +108 -132
- package/dist/commands/ts-check.js +7 -9
- package/dist/common/getPlaywrightConstructs.js +1 -5
- package/dist/common/runApi/errors.d.ts +3 -8
- package/dist/common/runApi/errors.js +3 -26
- package/dist/common/runApi/index.d.ts +1 -1
- package/dist/common/runApi/index.js +65 -37
- package/dist/common/runApi/types.d.ts +71 -287
- package/dist/common/runApi/types.js +5 -29
- package/dist/runtime/executionHelpers.test.js +6 -6
- package/package.json +3 -5
- package/testing +0 -0
- package/tsconfig.json +2 -1
- package/11_1.zip +0 -0
- package/2_1.zip +0 -0
- package/InterfaceTemplate/index.playwright.ts +0 -5
- package/InterfaceTemplate/utils.ts +0 -39
- package/dist/commands/common/tsNodeImport.d.ts +0 -1
- package/dist/commands/common/utils/template.d.ts +0 -2
- package/dist/common/formatZodError.d.ts +0 -2
- package/dist/common/formatZodError.js +0 -18
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _vitest = require("vitest");
|
|
4
4
|
var _asyncLocalStorage = require("../common/asyncLocalStorage");
|
|
5
|
-
var
|
|
5
|
+
var _index = require("./index");
|
|
6
6
|
var _enums = require("./enums");
|
|
7
7
|
(0, _vitest.describe)("Execution Helpers", () => {
|
|
8
8
|
(0, _vitest.it)("should be able to get execution info", () => {
|
|
@@ -11,7 +11,7 @@ var _enums = require("./enums");
|
|
|
11
11
|
runId: "test-run-id",
|
|
12
12
|
extendedPayloads: []
|
|
13
13
|
}, () => {
|
|
14
|
-
(0, _vitest.expect)((0,
|
|
14
|
+
(0, _vitest.expect)((0, _index.runInfo)().runId).toEqual("test-run-id");
|
|
15
15
|
});
|
|
16
16
|
});
|
|
17
17
|
(0, _vitest.it)("should be able to mutate extendedPayloads and get the accmulated value at the end ", () => {
|
|
@@ -26,7 +26,7 @@ var _enums = require("./enums");
|
|
|
26
26
|
}, () => {
|
|
27
27
|
var _getExecutionContext, _getExecutionContext2;
|
|
28
28
|
(0, _vitest.expect)((_getExecutionContext = (0, _asyncLocalStorage.getExecutionContext)()) === null || _getExecutionContext === void 0 ? void 0 : _getExecutionContext.extendedPayloads).toEqual([]);
|
|
29
|
-
(0,
|
|
29
|
+
(0, _index.extendPayload)({
|
|
30
30
|
api: "test-api",
|
|
31
31
|
parameters: {}
|
|
32
32
|
});
|
|
@@ -34,15 +34,15 @@ var _enums = require("./enums");
|
|
|
34
34
|
api: "test-api",
|
|
35
35
|
parameters: {}
|
|
36
36
|
}]);
|
|
37
|
-
(0,
|
|
37
|
+
(0, _index.extendPayload)({
|
|
38
38
|
api: "test-api",
|
|
39
39
|
parameters: {}
|
|
40
40
|
});
|
|
41
|
-
(0,
|
|
41
|
+
(0, _index.extendPayload)({
|
|
42
42
|
api: "test-api",
|
|
43
43
|
parameters: {}
|
|
44
44
|
});
|
|
45
|
-
(0,
|
|
45
|
+
(0, _index.extendPayload)({
|
|
46
46
|
api: "test-api",
|
|
47
47
|
parameters: {}
|
|
48
48
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intuned/runtime-dev",
|
|
3
|
-
"version": "0.1.0-test.
|
|
3
|
+
"version": "0.1.0-test.6",
|
|
4
4
|
"description": "Intuned runtime",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/index.js",
|
|
@@ -51,7 +51,6 @@
|
|
|
51
51
|
"intuned-ts-check": "./bin/intuned-ts-check"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
55
54
|
"@intuned/playwright": "^1.44.1-4",
|
|
56
55
|
"@intuned/playwright-core": "^1.44.1-4",
|
|
57
56
|
"@rollup/plugin-commonjs": "^25.0.2",
|
|
@@ -66,7 +65,6 @@
|
|
|
66
65
|
"@types/node": "^20.4.1",
|
|
67
66
|
"applicationinsights": "^2.9.2",
|
|
68
67
|
"async-retry": "^1.3.3",
|
|
69
|
-
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
70
68
|
"chalk": "^4.1.2",
|
|
71
69
|
"commander": "^11.0.0",
|
|
72
70
|
"cross-fetch": "^4.0.0",
|
|
@@ -91,12 +89,12 @@
|
|
|
91
89
|
"source-map": "^0.7.4",
|
|
92
90
|
"stack-utils": "^2.0.6",
|
|
93
91
|
"ts-morph": "^21.0.1",
|
|
92
|
+
"ts-node": "^10.9.1",
|
|
94
93
|
"tslib": "^2.6.0",
|
|
95
94
|
"typescript": "^5.1.6",
|
|
96
95
|
"wait-on": "^7.2.0",
|
|
97
96
|
"zod": "^3.21.4",
|
|
98
|
-
"zod-validation-error": "^3.0.3"
|
|
99
|
-
"ts-node": "^10.9.1"
|
|
97
|
+
"zod-validation-error": "^3.0.3"
|
|
100
98
|
},
|
|
101
99
|
"devDependencies": {
|
|
102
100
|
"@babel/cli": "^7.23.4",
|
package/testing
ADDED
|
Binary file
|
package/tsconfig.json
CHANGED
package/11_1.zip
DELETED
|
Binary file
|
package/2_1.zip
DELETED
|
Binary file
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
export async function importModule(path: string) {
|
|
2
|
-
const [folderName, ...functionNameParts] = path.split("/");
|
|
3
|
-
const functionNameDepth = functionNameParts.length;
|
|
4
|
-
|
|
5
|
-
// string literals should be inline
|
|
6
|
-
// currently we support only 5 levels of depth
|
|
7
|
-
// rollup dynamic import does not support multiple levels of dynamic imports so we need to specify the possible paths explicitly
|
|
8
|
-
let imported: any = undefined;
|
|
9
|
-
switch (functionNameDepth) {
|
|
10
|
-
case 1:
|
|
11
|
-
imported = await import(`./${folderName}/${functionNameParts[0]}.ts`);
|
|
12
|
-
break;
|
|
13
|
-
case 2:
|
|
14
|
-
imported = await import(
|
|
15
|
-
`./${folderName}/${functionNameParts[0]}/${functionNameParts[1]}.ts`
|
|
16
|
-
);
|
|
17
|
-
break;
|
|
18
|
-
case 3:
|
|
19
|
-
imported = await import(
|
|
20
|
-
`./${folderName}/${functionNameParts[0]}/${functionNameParts[1]}/${functionNameParts[2]}.ts`
|
|
21
|
-
);
|
|
22
|
-
break;
|
|
23
|
-
case 4:
|
|
24
|
-
imported = await import(
|
|
25
|
-
`./${folderName}/${functionNameParts[0]}/${functionNameParts[1]}/${functionNameParts[2]}/${functionNameParts[3]}.ts`
|
|
26
|
-
);
|
|
27
|
-
break;
|
|
28
|
-
case 5:
|
|
29
|
-
imported = await import(
|
|
30
|
-
`./${folderName}/${functionNameParts[0]}/${functionNameParts[1]}/${functionNameParts[2]}/${functionNameParts[3]}/${functionNameParts[4]}.ts`
|
|
31
|
-
);
|
|
32
|
-
break;
|
|
33
|
-
default:
|
|
34
|
-
throw new Error(
|
|
35
|
-
"intuned supports maximum 5 levels of depth in the api folder"
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
return imported;
|
|
39
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function tsNodeImport(apiName: string): Promise<any>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.formatZodError = formatZodError;
|
|
7
|
-
function formatZodError(zodError) {
|
|
8
|
-
const formattedErrors = zodError.errors.map(error => {
|
|
9
|
-
const path = error.path.map(segment => {
|
|
10
|
-
return typeof segment === "number" ? `[${segment}]` : segment;
|
|
11
|
-
}).join(".");
|
|
12
|
-
if (path) {
|
|
13
|
-
return `${path} is invalid - ${error.message}`;
|
|
14
|
-
}
|
|
15
|
-
return error.message;
|
|
16
|
-
});
|
|
17
|
-
return formattedErrors;
|
|
18
|
-
}
|