@secondlayer/cli 14.0.1 → 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
@@ -28410,10 +28410,7 @@ var init_clarity_to_subgraph = () => {};
28410
28410
 
28411
28411
  // src/generators/subgraph-scaffold.ts
28412
28412
  import { generateTraitSubgraph } from "@secondlayer/scaffold";
28413
- import { classifyContract } from "@secondlayer/stacks/clarity";
28414
- function toCamelCase3(str) {
28415
- return str.replace(/-([a-z0-9])/g, (_2, c4) => c4.toUpperCase());
28416
- }
28413
+ import { classifyContract, toCamelCase as toCamelCase3 } from "@secondlayer/stacks/clarity";
28417
28414
  function snake(str) {
28418
28415
  return str.replace(/-/g, "_");
28419
28416
  }
@@ -30953,10 +30950,31 @@ var init_subgraphs2 = __esm(() => {
30953
30950
  var exports_index_api = {};
30954
30951
  __export(exports_index_api, {
30955
30952
  runIndexCodegen: () => runIndexCodegen,
30956
- registerIndexCommand: () => registerIndexCommand
30953
+ registerIndexCommand: () => registerIndexCommand,
30954
+ parseIndexEventType: () => parseIndexEventType,
30955
+ VALID_INDEX_TYPES: () => VALID_INDEX_TYPES
30957
30956
  });
30958
30957
  import { resolve as resolve4 } from "node:path";
30959
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
+ }
30960
30978
  function client() {
30961
30979
  return new Index2({
30962
30980
  baseUrl: resolveApiUrl(),
@@ -31031,10 +31049,10 @@ function registerIndexCommand(program2) {
31031
31049
  fail("list nft transfers", err);
31032
31050
  }
31033
31051
  });
31034
- 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) => {
31035
31053
  try {
31036
31054
  emit(await client().events.list({
31037
- eventType: o3.eventType ?? o3.types,
31055
+ eventType: parseIndexEventType(o3.eventType, o3.types),
31038
31056
  ...rangeParams(o3),
31039
31057
  sender: o3.sender,
31040
31058
  recipient: o3.recipient,
@@ -31154,10 +31172,12 @@ async function runIndexCodegen(o3) {
31154
31172
  process.exit(1);
31155
31173
  }
31156
31174
  }
31175
+ var VALID_INDEX_TYPES;
31157
31176
  var init_index_api = __esm(() => {
31158
31177
  init_fs();
31159
31178
  init_output();
31160
31179
  init_resolve_auth();
31180
+ VALID_INDEX_TYPES = DECODED_EVENT_TYPES2;
31161
31181
  });
31162
31182
 
31163
31183
  // src/lib/docker.ts
@@ -36777,7 +36797,7 @@ var {
36777
36797
  // package.json
36778
36798
  var package_default = {
36779
36799
  name: "@secondlayer/cli",
36780
- version: "14.0.1",
36800
+ version: "14.0.3",
36781
36801
  description: "Run a Stacks index on your own hardware — set it up, restore verified history, and keep it current.",
36782
36802
  repository: {
36783
36803
  type: "git",
@@ -36823,7 +36843,7 @@ var package_default = {
36823
36843
  "@secondlayer/bundler": "^0.5.1",
36824
36844
  "@secondlayer/scaffold": "^1.5.5",
36825
36845
  "@secondlayer/sdk": "^10.0.0",
36826
- "@secondlayer/shared": "^11.2.0",
36846
+ "@secondlayer/shared": "^11.2.1",
36827
36847
  "@secondlayer/stacks": "^5.0.1",
36828
36848
  "@secondlayer/subgraphs": "^4.1.1",
36829
36849
  esbuild: "^0.27.4",
@@ -42746,5 +42766,5 @@ program.commandsGroup("Archive:");
42746
42766
  registerCreditsCommand(program);
42747
42767
  program.parse();
42748
42768
 
42749
- //# debugId=70015BE103AF7D4B64756E2164756E21
42769
+ //# debugId=435F5C62C9F6B34964756E2164756E21
42750
42770
  //# sourceMappingURL=cli.js.map