@ductape/cli 0.3.33 → 0.3.35

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,16 +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 fetchAll(product) that decrypts/resolves secret-backed env
12
- // fields per-env, the same way their single-resource `fetch` does. `resources <module> list` must
13
- // route through the SDK for these instead of the raw-product-document shortcut below, which plucks
14
- // the component array straight off the unmodified product document any secret-backed field
15
- // (connection_url/username/password) is still in its raw encrypted-at-rest form there, never
16
- // resolved to a $Secret{} reference. Confirmed by reading source: graphs.service.ts fetchAll() ->
17
- // products.service.ts fetchGraphs() decrypts each env; databases.service.ts fetchAllDatabases() ->
18
- // fetchDatabases() decrypts connection_url; vector-database.service.ts fetchAll() has the same
19
- // per-env resolution. Other modules are left on the shortcut below, unverified.
20
- const MODULES_WITH_DECRYPTING_FETCH_ALL = new Set(['graph', 'databases', 'vector']);
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']);
21
26
  export function resolveResourceProductTag(override, linkedProductTag) {
22
27
  return override?.trim() || linkedProductTag;
23
28
  }
@@ -306,7 +311,7 @@ export async function runResourceCrud(typeName, verb, opts, extraArgs) {
306
311
  // body) destructures product's string as `options` and fails with "No database connection
307
312
  // established", not a useful error about the definition update. The definition updater is a
308
313
  // separate method, databases.updateDatabase(product, database, data).
309
- const proxyMethod = (module === 'models' || module === 'feature' || MODULES_WITH_DECRYPTING_FETCH_ALL.has(module)) && method === 'list'
314
+ const proxyMethod = (module === 'models' || module === 'feature') && method === 'list'
310
315
  ? 'fetchAll'
311
316
  : module === 'databases' && method === 'update'
312
317
  ? 'updateDatabase'
@@ -346,7 +351,7 @@ export async function runResourceCrud(typeName, verb, opts, extraArgs) {
346
351
  body: payload,
347
352
  });
348
353
  const proxy = getSdkProxy(session);
349
- if (crud === 'list' && !MODULES_WITH_DECRYPTING_FETCH_ALL.has(module)) {
354
+ if (crud === 'list' && !MODULES_WITH_DECRYPTING_LIST.has(module)) {
350
355
  const product = await proxy.execute('product', 'fetch', [productTag]);
351
356
  const catalogue = listComponentsFromProduct(module, product);
352
357
  if (catalogue !== undefined) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ductape/cli",
3
- "version": "0.3.33",
3
+ "version": "0.3.35",
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",