@erdoai/cli 0.273.0 → 0.274.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.
Files changed (2) hide show
  1. package/dist/index.js +21 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1769,6 +1769,11 @@ var ErdoClient = class {
1769
1769
  upsertDeclaration(input) {
1770
1770
  return this.request("PUT", "/v1/declarations", input, false);
1771
1771
  }
1772
+ listDeclarations(params = {}) {
1773
+ const query = new URLSearchParams();
1774
+ for (const [key, value] of Object.entries(params)) if (value !== void 0) query.set(key, String(value));
1775
+ return this.request("GET", `/v1/declarations${query.size ? `?${query}` : ""}`, void 0, false);
1776
+ }
1772
1777
  importLeadSourceRows(input) {
1773
1778
  return this.request("POST", "/v1/provider-lead-sources/import", input, false);
1774
1779
  }
@@ -11572,6 +11577,22 @@ pipelinesCmd.command("mark-handled <slug>").description("Record that failed exec
11572
11577
  }
11573
11578
  });
11574
11579
  var declarationsCmd = program.command("declarations").description("Metric and other declarations an app commits for this organization");
11580
+ declarationsCmd.command("list").description("List declarations and their semantic resolution").option("--namespace <namespace>", "exact namespace").option("--kind <kind>", "exact kind").option("--key <key>", "exact key").option("--source <source>", "exact source").option("--table <table>", "exact table").option("--limit <number>", "page size").option("--offset <number>", "page offset").action(async (opts) => {
11581
+ try {
11582
+ if (Boolean(opts.source) !== Boolean(opts.table)) throw new Error("--source and --table must be set together");
11583
+ print(await new ErdoClient().listDeclarations({
11584
+ namespace: opts.namespace,
11585
+ kind: opts.kind,
11586
+ key: opts.key,
11587
+ source: opts.source,
11588
+ table: opts.table,
11589
+ limit: opts.limit ? Number(opts.limit) : void 0,
11590
+ offset: opts.offset ? Number(opts.offset) : void 0
11591
+ }));
11592
+ } catch (e) {
11593
+ fail(e);
11594
+ }
11595
+ });
11575
11596
  declarationsCmd.command("upsert").description("Write one declaration. The same namespace, kind, key and scope update the existing row").requiredOption("--namespace <namespace>", "the owning app's namespace").requiredOption("--kind <kind>", "declaration kind, for example metric").requiredOption("--key <key>", "what is declared, for example spend").option("--meaning <meaning>", "the expression; leave empty with --adopt to take the connector template").option("--status <status>", "confirmed only after the owning app merged it through a reviewed pull request; anything else is a draft", "draft").option("--source <source>", "synced source the declaration covers (requires --table)").option("--table <table>", "synced table the declaration covers (requires --source)").option("--adopt", "copy the connector template for this kind, key, source and table").option("--reasoning <text>", "why").option("--confidence <level>", "confidence in a proposal").action(async (opts) => {
11576
11597
  try {
11577
11598
  if (Boolean(opts.source) !== Boolean(opts.table)) throw new Error("--source and --table must be set together");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erdoai/cli",
3
- "version": "0.273.0",
3
+ "version": "0.274.0",
4
4
  "description": "Erdo CLI \u2014 drive datasets, pages, and evals from the terminal or CI",
5
5
  "type": "module",
6
6
  "bin": {