@intuned/runtime-dev 1.0.6-cli-auth.0.1.1-test ā 1.0.6-cli-auth.0.1.2-test
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/dist/commands/common/projectExclusions.js +1 -1
- package/dist/commands/deploy/utils.js +49 -1
- package/dist/commands/init/utils.d.ts +3 -1
- package/dist/commands/init/utils.js +2 -0
- package/dist/common/cli/cliReadme.d.ts +1 -1
- package/dist/common/cli/cliReadme.js +23 -0
- package/dist/common/cli/constants.d.ts +9 -0
- package/dist/common/cli/constants.js +10 -1
- package/package.json +2 -1
|
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
const exclusions = ["node_modules/**", ".git/**", "dist/**", "build/**", "coverage/**", ".next/**", ".cache/**", "out/**", "tmp/**", ".DS_Store", "npm-debug.log*", "yarn-debug.log*", "yarn-error.log*", ".env", ".env.*", "**/*.map", "**/*.tsbuildinfo", "tsconfig.json", "
|
|
7
|
+
const exclusions = ["node_modules/**", ".git/**", "dist/**", "build/**", "coverage/**", ".next/**", ".cache/**", "out/**", "tmp/**", ".DS_Store", "npm-debug.log*", "yarn-debug.log*", "yarn-error.log*", ".env", ".env.*", "**/*.map", "**/*.tsbuildinfo", "tsconfig.json", "output/**", "auth-sessions-instances/**", "README.md"];
|
|
8
8
|
var _default = exports.default = exclusions;
|
|
@@ -16,6 +16,9 @@ var _util = require("util");
|
|
|
16
16
|
var _projectExclusions = _interopRequireDefault(require("../common/projectExclusions"));
|
|
17
17
|
var _constants = require("../../common/cli/constants");
|
|
18
18
|
var _utils = require("../../common/cli/utils");
|
|
19
|
+
var _utils2 = require("../init/utils");
|
|
20
|
+
var _lodash = require("lodash");
|
|
21
|
+
var _uuid = require("uuid");
|
|
19
22
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
23
|
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
24
|
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; }
|
|
@@ -111,6 +114,7 @@ async function convertProjectToCodeTree(projectPath) {
|
|
|
111
114
|
}
|
|
112
115
|
console.log(_chalk.default.cyan("\nš¦ Building project..."));
|
|
113
116
|
const tree = readDirectory(projectPath);
|
|
117
|
+
await mapToIDEParams(tree);
|
|
114
118
|
return tree;
|
|
115
119
|
}
|
|
116
120
|
async function deployProject(projectName, auth) {
|
|
@@ -347,4 +351,48 @@ const runBuild = async () => {
|
|
|
347
351
|
return false;
|
|
348
352
|
}
|
|
349
353
|
};
|
|
350
|
-
exports.runBuild = runBuild;
|
|
354
|
+
exports.runBuild = runBuild;
|
|
355
|
+
async function mapToIDEParams(tree) {
|
|
356
|
+
if (!tree) {
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
if (!tree["parameters"] || (0, _utils2._isFileNode)(tree["parameters"])) {
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
const cliParameters = Object.keys(tree["parameters"].directory);
|
|
363
|
+
const ____testParameters = {
|
|
364
|
+
directory: {}
|
|
365
|
+
};
|
|
366
|
+
for (const parameterKey of cliParameters) {
|
|
367
|
+
const parameter = tree["parameters"].directory[parameterKey];
|
|
368
|
+
if ((0, _utils2._isDirectoryNode)(parameter)) {
|
|
369
|
+
continue;
|
|
370
|
+
}
|
|
371
|
+
if ((0, _lodash.isEmpty)(parameter.file.contents)) {
|
|
372
|
+
continue;
|
|
373
|
+
}
|
|
374
|
+
const parameterPayload = JSON.parse(parameter.file.contents);
|
|
375
|
+
if (!parameterPayload["__api-name"]) {
|
|
376
|
+
continue;
|
|
377
|
+
}
|
|
378
|
+
const api = parameterPayload["__api-name"];
|
|
379
|
+
const {
|
|
380
|
+
"__api-name": _,
|
|
381
|
+
...parameterValue
|
|
382
|
+
} = parameterPayload;
|
|
383
|
+
const testParameter = {
|
|
384
|
+
name: parameterKey,
|
|
385
|
+
lastUsed: false,
|
|
386
|
+
id: (0, _uuid.v4)(),
|
|
387
|
+
value: parameterValue
|
|
388
|
+
};
|
|
389
|
+
____testParameters.directory[`${api}.json`] = {
|
|
390
|
+
file: {
|
|
391
|
+
contents: JSON.stringify(testParameter, null, 2)
|
|
392
|
+
}
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
delete tree["parameters"];
|
|
396
|
+
tree["____testParameters"] = ____testParameters;
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { FileSystemTree } from "../../common/cli/types";
|
|
1
|
+
import { DirectoryNode, FileNode, FileSystemTree } from "../../common/cli/types";
|
|
2
|
+
export declare function _isDirectoryNode(node: DirectoryNode | FileNode): node is DirectoryNode;
|
|
3
|
+
export declare function _isFileNode(node: DirectoryNode | FileNode): node is FileNode;
|
|
2
4
|
export declare function mountFiles(cwd: string, tree: FileSystemTree): Promise<void>;
|
|
3
5
|
export declare function checkEmptyDirectory(): Promise<boolean>;
|
|
4
6
|
export declare function getAuthCredentials(options: any): {
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports._isDirectoryNode = _isDirectoryNode;
|
|
7
|
+
exports._isFileNode = _isFileNode;
|
|
6
8
|
exports.checkEmptyDirectory = checkEmptyDirectory;
|
|
7
9
|
exports.getAuthCredentials = getAuthCredentials;
|
|
8
10
|
exports.mountFiles = mountFiles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const cliReadme = "# Intuned CLI\n## Introduction\nThe Intuned CLI exposes a variaty of commands to develop your Intuned projects locally\n\n## Development Commands\n\n### Initialize a Project\n`npx -p @intuned/runtime init`\n\n### Run an API\n`yarn run-api <api-name>`\nor\n`npm run run-api <api-name>`\n\nOptions:\n- `-i, --parameters-file file-path`: JSON file containing API parameters\n- `-s, --store-results`: Store the results in `./output/[runId]/results.json` and `./output/[runId]/extendedPayloads.json`\n\n### Build a Project\n`yarn cli-build`\n\n### Deploy a Project\n`yarn deploy <project-name>`\nor\n`npm run deploy <project-name>`\n\n- `project-name`: Optional name that overrides the one in intuned.json\n- Options:\n - `--workspace-id`: Overrides the workspace ID in intuned.json\n - `--api-key`: Overrides the API key from environment variables\n\n## Configuration\n\n### Environment Variables and Settings\n- `workspaceId`: Your Intuned workspace ID ([How to get your workspaceId](https://docs.intunedhq.com/docs/guides/platform/how-to-get-a-workspace-id))\n - Set in `intuned.json` file under the `workspaceId` property\n - Or provide via CLI with `--workspace-id` flag during deployment\n \n- `projectName`: The name of your Intuned project\n - Set in `intuned.json` file under the `projectName` property\n - Or override via command line when deploying with `yarn deploy my-project-name` or `npm run deploy my-project-name`\n \n- `INTUNED_API_KEY`: Your Intuned API key\n - Set as an environment variable: `export INTUNED_API_KEY=your_api_key_here`\n - Or include in your .env file for development\n - Or provide via CLI with `--api-key` flag during deployment\n\n## Project Structure\n\n### Generated Artifacts\n- `./intuned.json`: Project configuration file\n- `./api`: Folder containing API implementation files\n- `./parameters`: Folder for API parameters injection\n- `./output`: Folder containing generated output files\n\n### Notes\n- You can use either `yarn` or `npm run` to execute commands\n- All commands must be run from the project root directory\n- Verify you're in the correct location by confirming the presence of package.json and intuned.json\n- Running commands from subdirectories may result in errors\n- You can manage your deployed projects through the Intuned platform\n- WARNING: \u26A0\uFE0F Changes to TS Config may break some Intuned functionalities\n";
|
|
1
|
+
export declare const cliReadme = "# Intuned CLI\n## Introduction\nThe Intuned CLI exposes a variaty of commands to develop your Intuned projects locally\n\n## Development Commands\n\n### Initialize a Project\n`npx -p @intuned/runtime init`\n\n### Run an API\n`yarn run-api <api-name>`\nor\n`npm run run-api <api-name>`\n\nOptions:\n- `-i, --parameters-file file-path`: JSON file containing API parameters\n- `-s, --store-results`: Store the results in `./output/[runId]/results.json` and `./output/[runId]/extendedPayloads.json`\n- `-a, --auth-session <session>`: Name of the auth session instance to use if project is auth-enabled\n\n### Build a Project\n`yarn cli-build`\n\n### Deploy a Project\n`yarn deploy <project-name>`\nor\n`npm run deploy <project-name>`\n\n- `project-name`: Optional name that overrides the one in intuned.json\n- Options:\n - `--workspace-id`: Overrides the workspace ID in intuned.json\n - `--api-key`: Overrides the API key from environment variables\n\n\n### Create an auth session\n`yarn create-auth-session <auth-session-name>`\nor\n`npm create-auth-session <auth-session-name>`\n\n- `auth-session-name`: Optional name/id of the auth session instance to use, if not provided, a name will be generated with the current timestamp\n- Options:\n - `--input`: Auth session input parameters file path\n\n### Check an auth session\n`yarn check-auth-session <auth-session-name>`\nor\n`npm check-auth-session <auth-session-name>`\n- `auth-session-name`: Name/id of the auth session instance to check, required\n\n## Configuration\n\n### Environment Variables and Settings\n- `workspaceId`: Your Intuned workspace ID ([How to get your workspaceId](https://docs.intunedhq.com/docs/guides/platform/how-to-get-a-workspace-id))\n - Set in `intuned.json` file under the `workspaceId` property\n - Or provide via CLI with `--workspace-id` flag during deployment\n \n- `projectName`: The name of your Intuned project\n - Set in `intuned.json` file under the `projectName` property\n - Or override via command line when deploying with `yarn deploy my-project-name` or `npm run deploy my-project-name`\n \n- `INTUNED_API_KEY`: Your Intuned API key\n - Set as an environment variable: `export INTUNED_API_KEY=your_api_key_here`\n - Or include in your .env file for development\n - Or provide via CLI with `--api-key` flag during deployment\n\n## Project Structure\n\n### Generated Artifacts\n- `./intuned.json`: Project configuration file\n- `./api`: Folder containing API implementation files\n- `./auth-sessions`: Folder containing auth APIs\n- `./parameters`: Folder for API parameters injection\n- `./output`: Folder containing generated output files\n- `./auth-sessions-instances`: Folder containing auth session instances\n\n## Types of auth sessions\n- `MANUAL`: Manual auth session, records the session using a recorder and stores it in the `auth-sessions-instances` folder\n- `API`: Auth session created via create API, stores the session in the `auth-sessions-instances` folder\n\n### Notes\n- You can use either `yarn` or `npm run` to execute commands\n- All commands must be run from the project root directory\n- Verify you're in the correct location by confirming the presence of package.json and intuned.json\n- Running commands from subdirectories may result in errors\n- You can manage your deployed projects through the Intuned platform\n- WARNING: \u26A0\uFE0F Changes to TS Config may break some Intuned functionalities\n";
|
|
@@ -21,6 +21,7 @@ or
|
|
|
21
21
|
Options:
|
|
22
22
|
- \`-i, --parameters-file file-path\`: JSON file containing API parameters
|
|
23
23
|
- \`-s, --store-results\`: Store the results in \`./output/[runId]/results.json\` and \`./output/[runId]/extendedPayloads.json\`
|
|
24
|
+
- \`-a, --auth-session <session>\`: Name of the auth session instance to use if project is auth-enabled
|
|
24
25
|
|
|
25
26
|
### Build a Project
|
|
26
27
|
\`yarn cli-build\`
|
|
@@ -35,6 +36,22 @@ or
|
|
|
35
36
|
- \`--workspace-id\`: Overrides the workspace ID in intuned.json
|
|
36
37
|
- \`--api-key\`: Overrides the API key from environment variables
|
|
37
38
|
|
|
39
|
+
|
|
40
|
+
### Create an auth session
|
|
41
|
+
\`yarn create-auth-session <auth-session-name>\`
|
|
42
|
+
or
|
|
43
|
+
\`npm create-auth-session <auth-session-name>\`
|
|
44
|
+
|
|
45
|
+
- \`auth-session-name\`: Optional name/id of the auth session instance to use, if not provided, a name will be generated with the current timestamp
|
|
46
|
+
- Options:
|
|
47
|
+
- \`--input\`: Auth session input parameters file path
|
|
48
|
+
|
|
49
|
+
### Check an auth session
|
|
50
|
+
\`yarn check-auth-session <auth-session-name>\`
|
|
51
|
+
or
|
|
52
|
+
\`npm check-auth-session <auth-session-name>\`
|
|
53
|
+
- \`auth-session-name\`: Name/id of the auth session instance to check, required
|
|
54
|
+
|
|
38
55
|
## Configuration
|
|
39
56
|
|
|
40
57
|
### Environment Variables and Settings
|
|
@@ -56,8 +73,14 @@ or
|
|
|
56
73
|
### Generated Artifacts
|
|
57
74
|
- \`./intuned.json\`: Project configuration file
|
|
58
75
|
- \`./api\`: Folder containing API implementation files
|
|
76
|
+
- \`./auth-sessions\`: Folder containing auth APIs
|
|
59
77
|
- \`./parameters\`: Folder for API parameters injection
|
|
60
78
|
- \`./output\`: Folder containing generated output files
|
|
79
|
+
- \`./auth-sessions-instances\`: Folder containing auth session instances
|
|
80
|
+
|
|
81
|
+
## Types of auth sessions
|
|
82
|
+
- \`MANUAL\`: Manual auth session, records the session using a recorder and stores it in the \`auth-sessions-instances\` folder
|
|
83
|
+
- \`API\`: Auth session created via create API, stores the session in the \`auth-sessions-instances\` folder
|
|
61
84
|
|
|
62
85
|
### Notes
|
|
63
86
|
- You can use either \`yarn\` or \`npm run\` to execute commands
|
|
@@ -2,6 +2,8 @@ export declare const CURRENT_PLAYWRIGHT_VERSION = "1.44.1";
|
|
|
2
2
|
export declare const ProjectDeploymentStatus: string[];
|
|
3
3
|
export declare const PROJECT_DEPLOY_TIMEOUT = 600000;
|
|
4
4
|
export declare const userCLIScripts: {
|
|
5
|
+
"dev:local": string;
|
|
6
|
+
dev: string;
|
|
5
7
|
build: string;
|
|
6
8
|
"types-check": string;
|
|
7
9
|
"pre-publish": string;
|
|
@@ -9,6 +11,13 @@ export declare const userCLIScripts: {
|
|
|
9
11
|
"run-api": string;
|
|
10
12
|
"cli-build": string;
|
|
11
13
|
deploy: string;
|
|
14
|
+
"cli-create-auth-session": string;
|
|
15
|
+
"cli-check-auth-session": string;
|
|
16
|
+
"browser-save-state": string;
|
|
17
|
+
"auth-session-check": string;
|
|
18
|
+
"auth-session-create": string;
|
|
19
|
+
"auth-session-refresh": string;
|
|
20
|
+
"auth-session-load": string;
|
|
12
21
|
};
|
|
13
22
|
export declare const tsConfigCli: {
|
|
14
23
|
compilerOptions: {
|
|
@@ -8,13 +8,22 @@ 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;
|
|
10
10
|
const userCLIScripts = exports.userCLIScripts = {
|
|
11
|
+
"dev:local": "intuned-api-run sample playwright -j '{}'",
|
|
12
|
+
dev: "intuned-api-run",
|
|
11
13
|
build: "intuned-build",
|
|
12
14
|
"types-check": "intuned-ts-check",
|
|
13
15
|
"pre-publish": "intuned-ts-check && intuned-build",
|
|
14
16
|
start: "node ./output/bundle_v2.js",
|
|
15
17
|
"run-api": "run-api",
|
|
16
18
|
"cli-build": "cli-build",
|
|
17
|
-
deploy: "deploy"
|
|
19
|
+
deploy: "deploy",
|
|
20
|
+
"cli-create-auth-session": "create-auth-session",
|
|
21
|
+
"cli-check-auth-session": "check-auth-session",
|
|
22
|
+
"browser-save-state": "intuned-browser-save-state",
|
|
23
|
+
"auth-session-check": "intuned-auth-session-check",
|
|
24
|
+
"auth-session-create": "intuned-auth-session-create",
|
|
25
|
+
"auth-session-refresh": "intuned-auth-session-refresh",
|
|
26
|
+
"auth-session-load": "intuned-auth-session-load"
|
|
18
27
|
};
|
|
19
28
|
const tsConfigCli = exports.tsConfigCli = {
|
|
20
29
|
compilerOptions: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intuned/runtime-dev",
|
|
3
|
-
"version": "1.0.6-cli-auth.0.1.
|
|
3
|
+
"version": "1.0.6-cli-auth.0.1.2-test",
|
|
4
4
|
"description": "Intuned runtime",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/index.js",
|
|
@@ -103,6 +103,7 @@
|
|
|
103
103
|
"ts-node": "^10.9.1",
|
|
104
104
|
"tslib": "^2.6.0",
|
|
105
105
|
"typescript": "^5.1.6",
|
|
106
|
+
"uuid": "11.1.0",
|
|
106
107
|
"wait-on": "^7.2.0",
|
|
107
108
|
"zod": "^3.21.4",
|
|
108
109
|
"zod-validation-error": "^3.0.3"
|