alphamilk 0.0.7 → 0.0.8
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/cli.js +14 -7
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -44,7 +44,7 @@ function clearSession() {
|
|
|
44
44
|
// src/api.ts
|
|
45
45
|
import { Effect, Data } from "effect";
|
|
46
46
|
import { HttpClient, HttpClientRequest } from "@effect/platform";
|
|
47
|
-
var CLI_VERSION = "0.0.
|
|
47
|
+
var CLI_VERSION = "0.0.8";
|
|
48
48
|
var ApiError = class extends Data.TaggedError("ApiError") {
|
|
49
49
|
};
|
|
50
50
|
var apiGet = (baseUrl, path3, params) => Effect.gen(function* () {
|
|
@@ -302,7 +302,7 @@ var artifactSaveData = Options.text("data").pipe(
|
|
|
302
302
|
);
|
|
303
303
|
var artifactSaveFile = Options.text("file").pipe(
|
|
304
304
|
Options.withAlias("f"),
|
|
305
|
-
Options.withDescription("Path to a file (markdown for document, JSON for
|
|
305
|
+
Options.withDescription("Path to a file (markdown for document/report, JSON for metrics)"),
|
|
306
306
|
Options.optional
|
|
307
307
|
);
|
|
308
308
|
var artifactSaveContent = Options.text("content").pipe(
|
|
@@ -346,12 +346,19 @@ Example: alphamilk artifact save --type ${type} --tags step:discovery --data "ex
|
|
|
346
346
|
body.content = content.value;
|
|
347
347
|
}
|
|
348
348
|
} else if (type === "report") {
|
|
349
|
-
if (file._tag === "None") {
|
|
349
|
+
if (file._tag === "None" && content._tag === "None") {
|
|
350
350
|
return yield* exitWithError(
|
|
351
|
-
'Report artifacts require --file
|
|
351
|
+
'Report artifacts require --file or --content.\n\nExample:\n alphamilk artifact save --type report --title "Report" --tags report --file ./report.md\n alphamilk artifact save --type report --title "Report" --tags report --content "# Report\\n..."'
|
|
352
352
|
);
|
|
353
353
|
}
|
|
354
|
-
|
|
354
|
+
if (file._tag === "Some" && content._tag === "Some") {
|
|
355
|
+
return yield* exitWithError("Cannot use both --file and --content. Provide one or the other.");
|
|
356
|
+
}
|
|
357
|
+
if (file._tag === "Some") {
|
|
358
|
+
body.content = yield* readFile(file.value);
|
|
359
|
+
} else {
|
|
360
|
+
body.content = content.value;
|
|
361
|
+
}
|
|
355
362
|
} else if (type === "metrics") {
|
|
356
363
|
if (file._tag === "Some") {
|
|
357
364
|
body.content = yield* readFile(file.value);
|
|
@@ -456,7 +463,7 @@ var artifactRenderCommand = Command.make(
|
|
|
456
463
|
).pipe(handleApiError("Failed to render artifact"));
|
|
457
464
|
yield* Console2.log(response);
|
|
458
465
|
})
|
|
459
|
-
).pipe(Command.withDescription("Render an artifact
|
|
466
|
+
).pipe(Command.withDescription("Render an artifact's content"));
|
|
460
467
|
var artifactListType = Options.text("type").pipe(
|
|
461
468
|
Options.withDescription("Filter by artifact type"),
|
|
462
469
|
Options.optional
|
|
@@ -630,7 +637,7 @@ var root = Command.make("alphamilk").pipe(
|
|
|
630
637
|
);
|
|
631
638
|
var cli = Command.run(root, {
|
|
632
639
|
name: "alphamilk",
|
|
633
|
-
version: "0.0.
|
|
640
|
+
version: "0.0.8"
|
|
634
641
|
});
|
|
635
642
|
var MainLayer = Layer.mergeAll(
|
|
636
643
|
NodeContext.layer,
|