@secondlayer/cli 2.0.0 → 2.1.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/dist/cli.js CHANGED
@@ -32383,7 +32383,7 @@ var {
32383
32383
  // package.json
32384
32384
  var package_default = {
32385
32385
  name: "@secondlayer/cli",
32386
- version: "2.0.0",
32386
+ version: "2.1.0",
32387
32387
  description: "CLI for subgraphs and blockchain indexing on Stacks",
32388
32388
  type: "module",
32389
32389
  bin: {
@@ -32429,7 +32429,7 @@ var package_default = {
32429
32429
  "@secondlayer/shared": "^1.0.0",
32430
32430
  "@secondlayer/stacks": "^0.2.2",
32431
32431
  "@secondlayer/subgraphs": "^0.11.6",
32432
- "@secondlayer/workflows": "^1.0.0",
32432
+ "@secondlayer/workflows": "^1.0.1",
32433
32433
  "@biomejs/js-api": "^0.7.0",
32434
32434
  "@biomejs/wasm-nodejs": "^1.9.0",
32435
32435
  esbuild: "^0.19.0",
@@ -35617,6 +35617,32 @@ ${runs.length} run(s)`));
35617
35617
  process.exit(1);
35618
35618
  }
35619
35619
  });
35620
+ workflows.command("templates [id]").description("List workflow templates, or print a template's source to stdout").option("--json", "Output as JSON (list mode only)").action(async (id, options2) => {
35621
+ const { templates, getTemplateById } = await import("@secondlayer/workflows/templates");
35622
+ if (id) {
35623
+ const template = getTemplateById(id);
35624
+ if (!template) {
35625
+ error(`Template not found: ${id}`);
35626
+ info(`Available: ${templates.map((t) => t.id).join(", ")}`);
35627
+ process.exit(1);
35628
+ }
35629
+ process.stdout.write(template.code);
35630
+ return;
35631
+ }
35632
+ if (options2.json) {
35633
+ console.log(JSON.stringify(templates.map(({ code: _code, ...rest }) => rest), null, 2));
35634
+ return;
35635
+ }
35636
+ const rows = templates.map((t) => [
35637
+ t.id,
35638
+ t.category,
35639
+ t.trigger,
35640
+ t.description
35641
+ ]);
35642
+ console.log(formatTable(["Id", "Category", "Trigger", "Description"], rows));
35643
+ console.log(dim(`
35644
+ ${templates.length} template(s). Pipe source with: sl workflows templates <id> > workflows/<name>.ts`));
35645
+ });
35620
35646
  workflows.command("delete <name>").description("Delete a workflow").option("-y, --yes", "Skip confirmation").action(async (name, options2) => {
35621
35647
  try {
35622
35648
  if (!options2.yes) {
@@ -35675,5 +35701,5 @@ registerAuthCommand(program);
35675
35701
  registerWhoamiCommand(program);
35676
35702
  program.parse();
35677
35703
 
35678
- //# debugId=4C1634EBC4C4A9EE64756E2164756E21
35704
+ //# debugId=68B9BDC7A5E4D6A864756E2164756E21
35679
35705
  //# sourceMappingURL=cli.js.map