@tolinax/ayoune-cli 2026.4.0 → 2026.6.0
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/lib/api/apiClient.js +1 -0
- package/lib/commands/createAggregateCommand.js +656 -0
- package/lib/commands/createDbCommand.js +286 -0
- package/lib/commands/createProgram.js +12 -2
- package/lib/commands/createStatusCommand.js +33 -20
- package/lib/db/copyConfigStore.js +88 -0
- package/lib/db/copyEngine.js +123 -0
- package/lib/db/cronMatcher.js +42 -0
- package/lib/db/types.js +1 -0
- package/lib/helpers/readPipelineInput.js +50 -0
- package/lib/helpers/updateNotifier.js +2 -1
- package/package.json +3 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { readFileSync } from "fs";
|
|
2
|
+
import { cliError } from "./cliError.js";
|
|
3
|
+
import { EXIT_MISUSE } from "../exitCodes.js";
|
|
4
|
+
/**
|
|
5
|
+
* Resolves a MongoDB aggregation pipeline from one of three sources:
|
|
6
|
+
* 1. --pipeline flag (JSON string)
|
|
7
|
+
* 2. --file flag (path to JSON file)
|
|
8
|
+
* 3. stdin (piped input)
|
|
9
|
+
*
|
|
10
|
+
* Returns the parsed pipeline array.
|
|
11
|
+
*/
|
|
12
|
+
export async function readPipelineInput(opts) {
|
|
13
|
+
let raw;
|
|
14
|
+
if (opts.pipeline) {
|
|
15
|
+
raw = opts.pipeline;
|
|
16
|
+
}
|
|
17
|
+
else if (opts.file) {
|
|
18
|
+
try {
|
|
19
|
+
raw = readFileSync(opts.file, "utf-8");
|
|
20
|
+
}
|
|
21
|
+
catch (e) {
|
|
22
|
+
cliError(`Failed to read file: ${e.message}`, EXIT_MISUSE);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
else if (!process.stdin.isTTY) {
|
|
26
|
+
raw = await readStdin();
|
|
27
|
+
}
|
|
28
|
+
if (!raw) {
|
|
29
|
+
cliError("Provide a pipeline via --pipeline, --file, or stdin", EXIT_MISUSE);
|
|
30
|
+
}
|
|
31
|
+
let parsed;
|
|
32
|
+
try {
|
|
33
|
+
parsed = JSON.parse(raw);
|
|
34
|
+
}
|
|
35
|
+
catch (_a) {
|
|
36
|
+
cliError("Invalid JSON — pipeline must be a valid JSON array", EXIT_MISUSE);
|
|
37
|
+
}
|
|
38
|
+
if (!Array.isArray(parsed)) {
|
|
39
|
+
cliError("Pipeline must be a JSON array of stage objects", EXIT_MISUSE);
|
|
40
|
+
}
|
|
41
|
+
return parsed;
|
|
42
|
+
}
|
|
43
|
+
function readStdin() {
|
|
44
|
+
return new Promise((resolve) => {
|
|
45
|
+
let data = "";
|
|
46
|
+
process.stdin.setEncoding("utf-8");
|
|
47
|
+
process.stdin.on("data", (chunk) => (data += chunk));
|
|
48
|
+
process.stdin.on("end", () => resolve(data));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
@@ -24,9 +24,10 @@ export function checkForUpdates(currentVersion) {
|
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
26
|
// Run npm view in background-ish (sync but with short timeout)
|
|
27
|
-
const latest = execSync(`npm view ${PKG_NAME} version
|
|
27
|
+
const latest = execSync(`npm view ${PKG_NAME} version`, {
|
|
28
28
|
encoding: "utf-8",
|
|
29
29
|
timeout: 5000,
|
|
30
|
+
stdio: ["pipe", "pipe", "ignore"],
|
|
30
31
|
}).trim();
|
|
31
32
|
localStorage.setItem("updateCheckTimestamp", String(Date.now()));
|
|
32
33
|
localStorage.setItem("updateCheckLatest", latest);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tolinax/ayoune-cli",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.6.0",
|
|
4
4
|
"description": "CLI for the aYOUne Business-as-a-Service platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -119,6 +119,7 @@
|
|
|
119
119
|
"chalk": "^5.3.0",
|
|
120
120
|
"chalk-animation": "^2.0.3",
|
|
121
121
|
"commander": "^12.0.0",
|
|
122
|
+
"cron-parser": "^4.9.0",
|
|
122
123
|
"figlet": "^1.7.0",
|
|
123
124
|
"gradient-string": "^2.0.2",
|
|
124
125
|
"inquirer": "^9.2.14",
|
|
@@ -134,6 +135,7 @@
|
|
|
134
135
|
"lodash": "^4.17.21",
|
|
135
136
|
"mkdirp": "^3.0.1",
|
|
136
137
|
"moment": "^2.30.1",
|
|
138
|
+
"mongodb": "^6.21.0",
|
|
137
139
|
"nanospinner": "^1.1.0",
|
|
138
140
|
"node-localstorage": "^3.0.5",
|
|
139
141
|
"os": "^0.1.2",
|