@secondlayer/cli 14.0.2 → 14.0.3

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
@@ -30950,10 +30950,31 @@ var init_subgraphs2 = __esm(() => {
30950
30950
  var exports_index_api = {};
30951
30951
  __export(exports_index_api, {
30952
30952
  runIndexCodegen: () => runIndexCodegen,
30953
- registerIndexCommand: () => registerIndexCommand
30953
+ registerIndexCommand: () => registerIndexCommand,
30954
+ parseIndexEventType: () => parseIndexEventType,
30955
+ VALID_INDEX_TYPES: () => VALID_INDEX_TYPES
30954
30956
  });
30955
30957
  import { resolve as resolve4 } from "node:path";
30956
30958
  import { Index as Index2 } from "@secondlayer/sdk";
30959
+ import {
30960
+ DECODED_EVENT_TYPES as DECODED_EVENT_TYPES2
30961
+ } from "@secondlayer/shared";
30962
+ function parseIndexEventType(eventType, types5) {
30963
+ if (eventType !== undefined && types5 !== undefined) {
30964
+ throw new Error("--event-type and --types are mutually exclusive");
30965
+ }
30966
+ const raw = (eventType ?? types5)?.trim();
30967
+ if (!raw) {
30968
+ throw new Error(`--event-type is required (one of: ${VALID_INDEX_TYPES.join(", ")})`);
30969
+ }
30970
+ if (raw.includes(",")) {
30971
+ throw new Error("--types takes ONE value on Index reads. Pagination is keyed per event type; make one request per type (or use `secondlayer streams events` for a multi-type feed)");
30972
+ }
30973
+ if (!VALID_INDEX_TYPES.includes(raw)) {
30974
+ throw new Error(`invalid --event-type "${raw}"; expected one of: ${VALID_INDEX_TYPES.join(", ")}`);
30975
+ }
30976
+ return raw;
30977
+ }
30957
30978
  function client() {
30958
30979
  return new Index2({
30959
30980
  baseUrl: resolveApiUrl(),
@@ -31028,10 +31049,10 @@ function registerIndexCommand(program2) {
31028
31049
  fail("list nft transfers", err);
31029
31050
  }
31030
31051
  });
31031
- rangeFlags(index.command("events")).description("List decoded events by type (stx_*, ft/nft mint/burn, print, …)").option("--event-type <type>", "Decoded event type").option("--types <type>", "alias for --event-type, ONE value (the Streams spelling)").option("--sender <principal>", "Filter by sender").option("--recipient <principal>", "Filter by recipient").option("--asset-identifier <id>", "Filter by asset identifier").action(async (o3) => {
31052
+ rangeFlags(index.command("events")).description("List decoded events by type (stx_*, ft/nft mint/burn, print, …)").option("--event-type <type>", `decoded event type (${VALID_INDEX_TYPES.join(", ")})`).option("--types <type>", "alias for --event-type, ONE value (the Streams spelling)").option("--sender <principal>", "Filter by sender").option("--recipient <principal>", "Filter by recipient").option("--asset-identifier <id>", "Filter by asset identifier").action(async (o3) => {
31032
31053
  try {
31033
31054
  emit(await client().events.list({
31034
- eventType: o3.eventType ?? o3.types,
31055
+ eventType: parseIndexEventType(o3.eventType, o3.types),
31035
31056
  ...rangeParams(o3),
31036
31057
  sender: o3.sender,
31037
31058
  recipient: o3.recipient,
@@ -31151,10 +31172,12 @@ async function runIndexCodegen(o3) {
31151
31172
  process.exit(1);
31152
31173
  }
31153
31174
  }
31175
+ var VALID_INDEX_TYPES;
31154
31176
  var init_index_api = __esm(() => {
31155
31177
  init_fs();
31156
31178
  init_output();
31157
31179
  init_resolve_auth();
31180
+ VALID_INDEX_TYPES = DECODED_EVENT_TYPES2;
31158
31181
  });
31159
31182
 
31160
31183
  // src/lib/docker.ts
@@ -36774,7 +36797,7 @@ var {
36774
36797
  // package.json
36775
36798
  var package_default = {
36776
36799
  name: "@secondlayer/cli",
36777
- version: "14.0.2",
36800
+ version: "14.0.3",
36778
36801
  description: "Run a Stacks index on your own hardware — set it up, restore verified history, and keep it current.",
36779
36802
  repository: {
36780
36803
  type: "git",
@@ -42743,5 +42766,5 @@ program.commandsGroup("Archive:");
42743
42766
  registerCreditsCommand(program);
42744
42767
  program.parse();
42745
42768
 
42746
- //# debugId=D8CADFD6A7EDEE7D64756E2164756E21
42769
+ //# debugId=435F5C62C9F6B34964756E2164756E21
42747
42770
  //# sourceMappingURL=cli.js.map