@ductape/cli 0.3.32 → 0.3.34

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.
@@ -8,6 +8,21 @@ import { printJson } from '../lib/output.js';
8
8
  import { DuctapeOperationError } from '../lib/operation-error.js';
9
9
  import { readCanonicalTopicFile, topicBodyForTransport, validateEventTopicsProject, } from '../lib/event-topics.js';
10
10
  const CRUD_VERBS = ['create', 'list', 'get', 'update', 'delete', 'connect'];
11
+ // Modules whose SDK exposes a real `list` method (ductape.graph.list / ductape.databases.list /
12
+ // ductape.vector.list — each internally calls a differently-named service method, e.g.
13
+ // GraphsService.fetchAll(), but the public/proxy-facing key is `list`) that decrypts/resolves
14
+ // secret-backed env fields per-env, the same way their single-resource `fetch` does.
15
+ // `resources <module> list` must route through the SDK for these instead of the raw-product-
16
+ // document shortcut below, which plucks the component array straight off the unmodified product
17
+ // document — any secret-backed field (connection_url/username/password) is still in its raw
18
+ // encrypted-at-rest form there, never resolved to a $Secret{} reference. IMPORTANT: the proxy
19
+ // method name must stay `list`, not the internal service method name (`fetchAll`) — the sdk-proxy
20
+ // dispatcher does a literal `moduleObject[method]` lookup against `ductape.graph`/`.databases`/
21
+ // `.vector`, none of which have a `fetchAll` property (only `list`); calling `fetchAll` throws
22
+ // "not callable" (graph) or is rejected by the backend's method allowlist entirely (databases,
23
+ // vector — allowlisted differently per module, `list` not `fetchAll`). Other modules are left on
24
+ // the shortcut below, unverified.
25
+ const MODULES_WITH_DECRYPTING_LIST = new Set(['graph', 'databases', 'vector']);
11
26
  export function resolveResourceProductTag(override, linkedProductTag) {
12
27
  return override?.trim() || linkedProductTag;
13
28
  }
@@ -336,7 +351,7 @@ export async function runResourceCrud(typeName, verb, opts, extraArgs) {
336
351
  body: payload,
337
352
  });
338
353
  const proxy = getSdkProxy(session);
339
- if (crud === 'list') {
354
+ if (crud === 'list' && !MODULES_WITH_DECRYPTING_LIST.has(module)) {
340
355
  const product = await proxy.execute('product', 'fetch', [productTag]);
341
356
  const catalogue = listComponentsFromProduct(module, product);
342
357
  if (catalogue !== undefined) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ductape/cli",
3
- "version": "0.3.32",
3
+ "version": "0.3.34",
4
4
  "description": "Ductape CLI — local platform, login, link projects, and manage resources via the proxy (Workbench-compatible)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",