@soat/cli 0.15.1 → 0.15.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.
Files changed (2) hide show
  1. package/dist/index.mjs +34 -3
  2. package/package.json +6 -5
package/dist/index.mjs CHANGED
@@ -11,7 +11,7 @@ import { load } from "js-yaml";
11
11
  import * as os from "node:os";
12
12
 
13
13
  //#region package.json
14
- var version = "0.15.1";
14
+ var version = "0.15.3";
15
15
 
16
16
  //#endregion
17
17
  //#region src/cli-wrappers/wrappers/formations.ts
@@ -2166,13 +2166,25 @@ var routes = {
2166
2166
  description: "Returns all documents the caller has access to. If projectId is provided, returns only documents in that project. project keys are scoped to a single project automatically. JWT users without projectId receive documents across all their accessible projects.",
2167
2167
  moduleDocsUrl: "https://soat.ttoss.dev/docs/modules/documents",
2168
2168
  pathParams: [],
2169
- queryParams: ["project_id"],
2169
+ queryParams: ["project_id", "limit", "offset"],
2170
2170
  flags: [{
2171
2171
  "name": "project_id",
2172
2172
  "description": "Project ID (optional)",
2173
2173
  "required": false,
2174
2174
  "type": "string",
2175
2175
  "in": "query"
2176
+ }, {
2177
+ "name": "limit",
2178
+ "description": "Maximum number of results to return",
2179
+ "required": false,
2180
+ "type": "integer",
2181
+ "in": "query"
2182
+ }, {
2183
+ "name": "offset",
2184
+ "description": "Number of results to skip",
2185
+ "required": false,
2186
+ "type": "integer",
2187
+ "in": "query"
2176
2188
  }]
2177
2189
  },
2178
2190
  "create-document": {
@@ -5615,6 +5627,21 @@ var parseFlagValue = value => {
5615
5627
  }
5616
5628
  return value;
5617
5629
  };
5630
+ /**
5631
+ * Build the value for an array-typed flag. Collects repeated occurrences
5632
+ * (`--document_paths /a/ --document_paths /b/`) into a list, coercing each
5633
+ * element with `parseFlagValue`. A single JSON-array literal
5634
+ * (`--document_ids '["doc_1","doc_2"]'`) is passed through as-is rather than
5635
+ * being wrapped again, and a single scalar (`--document_paths /playbooks/`)
5636
+ * becomes a one-element array.
5637
+ */
5638
+ var buildArrayFlagValue = rawValues => {
5639
+ const parsed = rawValues.map(v => {
5640
+ return parseFlagValue(v);
5641
+ });
5642
+ if (parsed.length === 1 && Array.isArray(parsed[0])) return parsed[0];
5643
+ return parsed;
5644
+ };
5618
5645
  /** Normalize symbol names to compare exports across acronym casing differences. */
5619
5646
  var normalizeSymbol = name => {
5620
5647
  return name.toLowerCase().replace(/[^a-z0-9]/g, "");
@@ -5799,13 +5826,17 @@ program.argument("[command]", "API command in kebab-case (e.g. list-actors)").ar
5799
5826
  })
5800
5827
  });
5801
5828
  const flags = wrapped.flags.single;
5829
+ const repeatedFlags = wrapped.flags.repeated;
5830
+ const flagTypeByCanonical = new Map(route.flags.map(f => {
5831
+ return [toCanonical(f.name), f.type];
5832
+ }));
5802
5833
  const pathArgs = {};
5803
5834
  const queryArgs = {};
5804
5835
  const bodyArgs = {};
5805
5836
  for (const [flagKey, val] of Object.entries(flags)) {
5806
5837
  if (flagKey === "profile" || flagKey === "id") continue;
5807
5838
  const canonical = toCanonical(flagKey);
5808
- const parsedValue = parseFlagValue(val);
5839
+ const parsedValue = flagTypeByCanonical.get(canonical) === "array" ? buildArrayFlagValue(repeatedFlags[flagKey] ?? [val]) : parseFlagValue(val);
5809
5840
  const pathParam = route.pathParams.find(p => {
5810
5841
  return toCanonical(p) === canonical;
5811
5842
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soat/cli",
3
- "version": "0.15.1",
3
+ "version": "0.15.3",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@inquirer/input": "^5.1.2",
@@ -8,16 +8,17 @@
8
8
  "@ttoss/logger": "^0.8.19",
9
9
  "commander": "^15.0.0",
10
10
  "js-yaml": "^5.2.1",
11
- "@soat/sdk": "0.15.1"
11
+ "@soat/sdk": "0.15.3"
12
12
  },
13
13
  "devDependencies": {
14
14
  "@ttoss/config": "^1.37.17",
15
15
  "@ttoss/test-utils": "^4.2.18",
16
16
  "@types/jest": "^30.0.0",
17
- "@types/node": "^24.13.2",
17
+ "@types/node": "^26.1.1",
18
18
  "jest": "^30.4.2",
19
- "tsdown": "^0.22.3",
20
- "tsx": "^4.23.0"
19
+ "tsdown": "^0.22.7",
20
+ "tsx": "^4.23.1",
21
+ "typescript": "~6.0.3"
21
22
  },
22
23
  "files": [
23
24
  "dist",