@intuned/runtime-dev 1.0.6-cli.8.2.8 ā 1.0.6-cli.8.3.1
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.
|
@@ -19,7 +19,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
19
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
20
20
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
21
|
const execPromise = (0, _util.promisify)(_child_process.exec);
|
|
22
|
-
function
|
|
22
|
+
function ignoreFilesByPattern(filePath, patterns, projectPath) {
|
|
23
23
|
const relativePath = path.relative(projectPath, filePath);
|
|
24
24
|
if (relativePath.startsWith("node_modules")) {
|
|
25
25
|
return true;
|
|
@@ -43,7 +43,7 @@ function listFilesNotIgnored(projectPath, ignorePatterns) {
|
|
|
43
43
|
const entries = fs.readdirSync(dirPath);
|
|
44
44
|
for (const entry of entries) {
|
|
45
45
|
const fullPath = path.join(dirPath, entry);
|
|
46
|
-
if (
|
|
46
|
+
if (ignoreFilesByPattern(fullPath, ignorePatterns, projectPath)) {
|
|
47
47
|
continue;
|
|
48
48
|
}
|
|
49
49
|
try {
|
|
@@ -75,7 +75,7 @@ async function convertProjectToCodeTree(projectPath) {
|
|
|
75
75
|
const entries = fs.readdirSync(dirPath);
|
|
76
76
|
for (const entry of entries) {
|
|
77
77
|
const entryPath = path.join(dirPath, entry);
|
|
78
|
-
if (
|
|
78
|
+
if (ignoreFilesByPattern(entryPath, _projectExclusions.default, projectPath)) {
|
|
79
79
|
continue;
|
|
80
80
|
}
|
|
81
81
|
try {
|
|
@@ -150,13 +150,13 @@ async function deployProject(projectName, auth) {
|
|
|
150
150
|
const {
|
|
151
151
|
status,
|
|
152
152
|
message,
|
|
153
|
-
|
|
153
|
+
projectId
|
|
154
154
|
} = await checkIntunedProjectDeployStatus(workspaceId, projectName, apiKey);
|
|
155
155
|
if (status === "completed" || status === "failed" || status === "not_found") {
|
|
156
156
|
clearInterval(checkInterval);
|
|
157
157
|
resolve(status === "completed" ? {
|
|
158
158
|
deployDone: true,
|
|
159
|
-
projectId
|
|
159
|
+
projectId
|
|
160
160
|
} : {
|
|
161
161
|
deployDone: false,
|
|
162
162
|
projectId: "",
|
|
@@ -311,7 +311,7 @@ const checkIntunedProjectDeployStatus = async (workspaceId, projectName, apiKey)
|
|
|
311
311
|
return {
|
|
312
312
|
status: data.status,
|
|
313
313
|
message: data.message,
|
|
314
|
-
|
|
314
|
+
projectId: data.projectId
|
|
315
315
|
};
|
|
316
316
|
}
|
|
317
317
|
return {
|
|
@@ -16,6 +16,7 @@ var _path = _interopRequireDefault(require("path"));
|
|
|
16
16
|
var _boxen = _interopRequireDefault(require("boxen"));
|
|
17
17
|
var _projectExclusions = _interopRequireDefault(require("../common/projectExclusions"));
|
|
18
18
|
var _constants = require("../../common/cli/constants");
|
|
19
|
+
var _cliReadme = require("../../common/cli/cliReadme");
|
|
19
20
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
21
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
21
22
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -132,7 +133,7 @@ async function scaffoldProject(templateId, isTargetDirectoryEmpty) {
|
|
|
132
133
|
console.log(_chalk.default.green(`ā Template "${templateId}" fetched successfully`));
|
|
133
134
|
console.log(_chalk.default.cyan("šØ Creating project files..."));
|
|
134
135
|
const codeTree = template;
|
|
135
|
-
prepareCLITemplate(codeTree);
|
|
136
|
+
await prepareCLITemplate(codeTree);
|
|
136
137
|
await mountFiles(cwd, codeTree);
|
|
137
138
|
console.log(_chalk.default.green("ā Project files created"));
|
|
138
139
|
console.log((0, _boxen.default)(_chalk.default.green(`ā
Project initialized successfully`) + `\n\n${_chalk.default.cyan("Project details:")}` + `\n⢠Template: ${_chalk.default.bold(templateId)}` + `\n⢠Directory: ${_chalk.default.bold(process.cwd())}` + `\n\n${_chalk.default.cyan("Next steps:")}` + `\n1. ${_chalk.default.bold("cd")} into your project directory (if not already there)` + `\n2. Run ${_chalk.default.bold("npm/yarn install")} to install dependencies` + `\n3. Develop, test and run your automation APIs`, {
|
|
@@ -155,7 +156,7 @@ async function fetchProjectTemplate(templateId) {
|
|
|
155
156
|
}
|
|
156
157
|
return data.template;
|
|
157
158
|
}
|
|
158
|
-
function prepareCLITemplate(codeTree) {
|
|
159
|
+
async function prepareCLITemplate(codeTree) {
|
|
159
160
|
codeTree["parameters"] = {
|
|
160
161
|
directory: {}
|
|
161
162
|
};
|
|
@@ -171,7 +172,7 @@ function prepareCLITemplate(codeTree) {
|
|
|
171
172
|
}
|
|
172
173
|
codeTree["README.md"] = {
|
|
173
174
|
file: {
|
|
174
|
-
contents:
|
|
175
|
+
contents: _cliReadme.cliReadme
|
|
175
176
|
}
|
|
176
177
|
};
|
|
177
178
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cliReadme = "# Intuned CLI\n\n## Usage Instructions\n\nThe Intuned CLI exposes a variaty of commands to develop and create your Intuned projects locally:\n\n### Init a project\n\n`npx -p @intuned/runtime intuned-init`\n\n### Artifacts provided\n\n- `./intuned.json`: Intuned project configuration file\n- `./api`: Folder containing the API files\n- `./parameters`: Folder containing the parameters files, used for API parameters injection\n- `./output`: Folder containing the output files generated by the APIs\n\n### Note:\n\n- You can use either `yarn` or `npm run` to run and execute the commands\n\n### Keys,Environment Variables and Settings\n\n- workspaceId: Your Intuned workspace ID, either provided via command line or Intuned.json setting -> (`workspaceId`)\n- projectName: The name of your Intuned project, either provided via command line or Intuned.json setting -> (`projectName`)\n- INTUNED_API_KEY: Your Intuned API key, either provided via command line or environment variable\n\n### Running the APIs through development\n\n`yarn run-api` <api-name>\n\n- Options:\n - -i, --parameters-file <file>: JSON file containing API parameters\n - -s, --store-results: Store the results of the running API inside the output directory:\n - ./output/[runId]/results.json\n - ./output/[runId]/extendedPayloads.json\n\n### Building the intuned project\n\n`yarn cli-build`\n\n### Deploying the project\n\n`yarn deploy` <project-name>\n\n- <project-name>: Optional project name that overrides the one on the intuned.json file\n- Options (optinal):\n - --workspace-id: Overrides the workspace id specified in the intuned.json file setting\n - --api-key: Overrides the api key provided by the environment var.\n\n### General Notes:\n\n- You can interact with your Intuned project within the platform when deploying it\n- All commands above should be runned from the root location of the project (from where you runned and created the project through `intuned-init` command)\n- Verify you're in the correct location by confirming the presence of package.json and intuned.json files\n- Running commands from subdirectories may result in errors or unexpected behavior";
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.cliReadme = void 0;
|
|
7
|
+
const cliReadme = exports.cliReadme = `# Intuned CLI
|
|
8
|
+
|
|
9
|
+
## Usage Instructions
|
|
10
|
+
|
|
11
|
+
The Intuned CLI exposes a variaty of commands to develop and create your Intuned projects locally:
|
|
12
|
+
|
|
13
|
+
### Init a project
|
|
14
|
+
|
|
15
|
+
\`npx -p @intuned/runtime intuned-init\`
|
|
16
|
+
|
|
17
|
+
### Artifacts provided
|
|
18
|
+
|
|
19
|
+
- \`./intuned.json\`: Intuned project configuration file
|
|
20
|
+
- \`./api\`: Folder containing the API files
|
|
21
|
+
- \`./parameters\`: Folder containing the parameters files, used for API parameters injection
|
|
22
|
+
- \`./output\`: Folder containing the output files generated by the APIs
|
|
23
|
+
|
|
24
|
+
### Note:
|
|
25
|
+
|
|
26
|
+
- You can use either \`yarn\` or \`npm run\` to run and execute the commands
|
|
27
|
+
|
|
28
|
+
### Keys,Environment Variables and Settings
|
|
29
|
+
|
|
30
|
+
- workspaceId: Your Intuned workspace ID, either provided via command line or Intuned.json setting -> (\`workspaceId\`)
|
|
31
|
+
- projectName: The name of your Intuned project, either provided via command line or Intuned.json setting -> (\`projectName\`)
|
|
32
|
+
- INTUNED_API_KEY: Your Intuned API key, either provided via command line or environment variable
|
|
33
|
+
|
|
34
|
+
### Running the APIs through development
|
|
35
|
+
|
|
36
|
+
\`yarn run-api\` <api-name>
|
|
37
|
+
|
|
38
|
+
- Options:
|
|
39
|
+
- -i, --parameters-file <file>: JSON file containing API parameters
|
|
40
|
+
- -s, --store-results: Store the results of the running API inside the output directory:
|
|
41
|
+
- ./output/[runId]/results.json
|
|
42
|
+
- ./output/[runId]/extendedPayloads.json
|
|
43
|
+
|
|
44
|
+
### Building the intuned project
|
|
45
|
+
|
|
46
|
+
\`yarn cli-build\`
|
|
47
|
+
|
|
48
|
+
### Deploying the project
|
|
49
|
+
|
|
50
|
+
\`yarn deploy\` <project-name>
|
|
51
|
+
|
|
52
|
+
- <project-name>: Optional project name that overrides the one on the intuned.json file
|
|
53
|
+
- Options (optinal):
|
|
54
|
+
- --workspace-id: Overrides the workspace id specified in the intuned.json file setting
|
|
55
|
+
- --api-key: Overrides the api key provided by the environment var.
|
|
56
|
+
|
|
57
|
+
### General Notes:
|
|
58
|
+
|
|
59
|
+
- You can interact with your Intuned project within the platform when deploying it
|
|
60
|
+
- All commands above should be runned from the root location of the project (from where you runned and created the project through \`intuned-init\` command)
|
|
61
|
+
- Verify you're in the correct location by confirming the presence of package.json and intuned.json files
|
|
62
|
+
- Running commands from subdirectories may result in errors or unexpected behavior`;
|
|
@@ -6,9 +6,9 @@ export declare const userCLIScripts: {
|
|
|
6
6
|
"types-check": string;
|
|
7
7
|
"pre-publish": string;
|
|
8
8
|
start: string;
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
|
|
9
|
+
"run-api": string;
|
|
10
|
+
"cli-build": string;
|
|
11
|
+
deploy: string;
|
|
12
12
|
};
|
|
13
13
|
export declare const tsConfigCli: {
|
|
14
14
|
compilerOptions: {
|
|
@@ -22,4 +22,3 @@ export declare const tsConfigCli: {
|
|
|
22
22
|
include: string[];
|
|
23
23
|
exclude: string[];
|
|
24
24
|
};
|
|
25
|
-
export declare const cliReadme = "# Intuned CLI Project\n\n## Usage Instructions\n\nThis CLI project is built with Intuned and provides the following commands:\n### Init a project\n`npx -p @intuned/runtime intuned-init`\n\n### Keys,Environment Variables and Settings\n- INTUNED_WORKSPACE_ID: Your Intuned workspace ID, either provided via command line or intuned.json\n- INTUNED_API_KEY: Your Intuned API key, either provided via command line or environment variable\n- INTUNED_PROJECT_NAME: The name of your Intuned project, either provided via command line or intuned.json\n\n### Running the project\n`npm run intuned-run`\n\n\n### Building the project\n`npm run intuned-build`\n\n### Deploying the project\n`npm run intuned-deploy`\n\n### Artifacts provided\n- `./intuned.json`: Intuned project configuration file\n- `./api`: Folder containing the API files\n- `./parameters`: Folder containing the parameters files\n- `./output`: Folder containing the output files\n\n### Run Parameters\n--parameters-file/ -i: Path to the parameters file\n\n### Storage\nResults from your runs and appended payloads will be stored in the `./output/[runId]` directory \nstructure when providing the --store-results option on the intuned run command.\n";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.userCLIScripts = exports.tsConfigCli = exports.
|
|
6
|
+
exports.userCLIScripts = exports.tsConfigCli = exports.ProjectDeploymentStatus = exports.PROJECT_DEPLOY_TIMEOUT = exports.CURRENT_PLAYWRIGHT_VERSION = void 0;
|
|
7
7
|
const CURRENT_PLAYWRIGHT_VERSION = exports.CURRENT_PLAYWRIGHT_VERSION = "1.44.1";
|
|
8
8
|
const ProjectDeploymentStatus = exports.ProjectDeploymentStatus = ["completed", "failed", "pending", "not_found"];
|
|
9
9
|
const PROJECT_DEPLOY_TIMEOUT = exports.PROJECT_DEPLOY_TIMEOUT = 600000;
|
|
@@ -12,9 +12,9 @@ const userCLIScripts = exports.userCLIScripts = {
|
|
|
12
12
|
"types-check": "intuned-ts-check",
|
|
13
13
|
"pre-publish": "intuned-ts-check && intuned-build",
|
|
14
14
|
start: "node ./output/bundle_v2.js",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
15
|
+
"run-api": "intuned-run",
|
|
16
|
+
"cli-build": "intuned-build-project",
|
|
17
|
+
deploy: "intuned-deploy"
|
|
18
18
|
};
|
|
19
19
|
const tsConfigCli = exports.tsConfigCli = {
|
|
20
20
|
compilerOptions: {
|
|
@@ -27,40 +27,4 @@ const tsConfigCli = exports.tsConfigCli = {
|
|
|
27
27
|
},
|
|
28
28
|
include: ["**/*.ts"],
|
|
29
29
|
exclude: ["node_modules", "dist"]
|
|
30
|
-
};
|
|
31
|
-
const cliReadme = exports.cliReadme = `# Intuned CLI Project
|
|
32
|
-
|
|
33
|
-
## Usage Instructions
|
|
34
|
-
|
|
35
|
-
This CLI project is built with Intuned and provides the following commands:
|
|
36
|
-
### Init a project
|
|
37
|
-
\`npx -p @intuned/runtime intuned-init\`
|
|
38
|
-
|
|
39
|
-
### Keys,Environment Variables and Settings
|
|
40
|
-
- INTUNED_WORKSPACE_ID: Your Intuned workspace ID, either provided via command line or intuned.json
|
|
41
|
-
- INTUNED_API_KEY: Your Intuned API key, either provided via command line or environment variable
|
|
42
|
-
- INTUNED_PROJECT_NAME: The name of your Intuned project, either provided via command line or intuned.json
|
|
43
|
-
|
|
44
|
-
### Running the project
|
|
45
|
-
\`npm run intuned-run\`
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
### Building the project
|
|
49
|
-
\`npm run intuned-build\`
|
|
50
|
-
|
|
51
|
-
### Deploying the project
|
|
52
|
-
\`npm run intuned-deploy\`
|
|
53
|
-
|
|
54
|
-
### Artifacts provided
|
|
55
|
-
- \`./intuned.json\`: Intuned project configuration file
|
|
56
|
-
- \`./api\`: Folder containing the API files
|
|
57
|
-
- \`./parameters\`: Folder containing the parameters files
|
|
58
|
-
- \`./output\`: Folder containing the output files
|
|
59
|
-
|
|
60
|
-
### Run Parameters
|
|
61
|
-
--parameters-file/ -i: Path to the parameters file
|
|
62
|
-
|
|
63
|
-
### Storage
|
|
64
|
-
Results from your runs and appended payloads will be stored in the \`./output/[runId]\` directory
|
|
65
|
-
structure when providing the --store-results option on the intuned run command.
|
|
66
|
-
`;
|
|
30
|
+
};
|