@drakulavich/oura-cli 0.4.0 → 0.4.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.
- package/CHANGELOG.md +10 -0
- package/dist/index.js +57 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,15 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.4.1] - 2026-05-13
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
- Global flags (`--format`, `--token`, `--db`, `--tz`, `--no-color`) placed
|
|
13
|
+
BEFORE the subcommand name are now hoisted to AFTER it before citty parses
|
|
14
|
+
argv. Restores the v0.3.x flag-first form like
|
|
15
|
+
`oura-cli --format json sleep today`. Regression introduced by the citty
|
|
16
|
+
migration in v0.4.0.
|
|
17
|
+
|
|
9
18
|
## [0.4.0] - 2026-05-13
|
|
10
19
|
|
|
11
20
|
### Changed
|
|
@@ -190,6 +199,7 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
190
199
|
- Local SQLite cache at `~/.oura-cli/oura.db`.
|
|
191
200
|
- Auth via `oura-cli login`, `OURA_TOKEN`, `OURA_TOKEN_PATH`, or `~/.oura-token`.
|
|
192
201
|
|
|
202
|
+
[0.4.1]: https://github.com/drakulavich/oura-cli/releases/tag/v0.4.1
|
|
193
203
|
[0.4.0]: https://github.com/drakulavich/oura-cli/releases/tag/v0.4.0
|
|
194
204
|
[0.3.4]: https://github.com/drakulavich/oura-cli/releases/tag/v0.3.4
|
|
195
205
|
[0.3.3]: https://github.com/drakulavich/oura-cli/releases/tag/v0.3.3
|
package/dist/index.js
CHANGED
|
@@ -2576,8 +2576,62 @@ function createApiCommand(name, description, endpoint) {
|
|
|
2576
2576
|
});
|
|
2577
2577
|
}
|
|
2578
2578
|
|
|
2579
|
+
// src/lib/argv-normalize.ts
|
|
2580
|
+
var GLOBAL_FLAGS_WITH_VALUE = new Set(["--format", "--token", "--db", "--tz"]);
|
|
2581
|
+
var GLOBAL_FLAGS_BOOLEAN = new Set(["--no-color"]);
|
|
2582
|
+
var SUBCOMMANDS = new Set([
|
|
2583
|
+
"login",
|
|
2584
|
+
"describe",
|
|
2585
|
+
"healthcheck",
|
|
2586
|
+
"manifest",
|
|
2587
|
+
"sleep",
|
|
2588
|
+
"readiness",
|
|
2589
|
+
"activity",
|
|
2590
|
+
"hr",
|
|
2591
|
+
"spo2",
|
|
2592
|
+
"stress",
|
|
2593
|
+
"workout",
|
|
2594
|
+
"sync",
|
|
2595
|
+
"db",
|
|
2596
|
+
"report"
|
|
2597
|
+
]);
|
|
2598
|
+
function normalizeArgv(argv) {
|
|
2599
|
+
const [bun, script, ...rest] = argv;
|
|
2600
|
+
const subIdx = rest.findIndex((a) => SUBCOMMANDS.has(a));
|
|
2601
|
+
if (subIdx < 0)
|
|
2602
|
+
return argv;
|
|
2603
|
+
const before = rest.slice(0, subIdx);
|
|
2604
|
+
const subcommandOnwards = rest.slice(subIdx);
|
|
2605
|
+
const hoisted = [];
|
|
2606
|
+
const leftover = [];
|
|
2607
|
+
for (let i = 0;i < before.length; i++) {
|
|
2608
|
+
const tok = before[i];
|
|
2609
|
+
if (tok.includes("=")) {
|
|
2610
|
+
const name = tok.slice(0, tok.indexOf("="));
|
|
2611
|
+
if (GLOBAL_FLAGS_WITH_VALUE.has(name) || GLOBAL_FLAGS_BOOLEAN.has(name)) {
|
|
2612
|
+
hoisted.push(tok);
|
|
2613
|
+
continue;
|
|
2614
|
+
}
|
|
2615
|
+
}
|
|
2616
|
+
if (GLOBAL_FLAGS_WITH_VALUE.has(tok)) {
|
|
2617
|
+
hoisted.push(tok);
|
|
2618
|
+
if (i + 1 < before.length) {
|
|
2619
|
+
hoisted.push(before[i + 1]);
|
|
2620
|
+
i++;
|
|
2621
|
+
}
|
|
2622
|
+
continue;
|
|
2623
|
+
}
|
|
2624
|
+
if (GLOBAL_FLAGS_BOOLEAN.has(tok)) {
|
|
2625
|
+
hoisted.push(tok);
|
|
2626
|
+
continue;
|
|
2627
|
+
}
|
|
2628
|
+
leftover.push(tok);
|
|
2629
|
+
}
|
|
2630
|
+
return [bun, script, ...leftover, ...subcommandOnwards, ...hoisted];
|
|
2631
|
+
}
|
|
2632
|
+
|
|
2579
2633
|
// src/index.ts
|
|
2580
|
-
var VERSION = "0.4.
|
|
2634
|
+
var VERSION = "0.4.1";
|
|
2581
2635
|
if (process.argv.includes("--no-color") || process.env.NO_COLOR) {
|
|
2582
2636
|
source_default.level = 0;
|
|
2583
2637
|
}
|
|
@@ -2605,4 +2659,5 @@ var main = defineCommand({
|
|
|
2605
2659
|
report: reportCommand
|
|
2606
2660
|
}
|
|
2607
2661
|
});
|
|
2608
|
-
|
|
2662
|
+
var normalized = normalizeArgv(process.argv);
|
|
2663
|
+
runMain(main, { rawArgs: normalized.slice(2) });
|
package/package.json
CHANGED