@ductape/cli 0.4.3 → 0.4.4

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.
@@ -283,9 +283,19 @@ export async function configureProductApp(ctx, productRef, appRef, updates) {
283
283
  const productTag = String(product.tag ?? (!/^[a-f\d]{24}$/i.test(productRef) ? productRef : ''));
284
284
  if (!productTag)
285
285
  throw new Error(`Could not resolve product tag for "${productRef}"`);
286
- // Product fetch responses may omit app links. Resolve through the canonical
287
- // connected-App inventory so every app returned by `products apps list` works here.
288
- const listedLinks = await listProductApps(ctx, productTag, true);
286
+ // Prefer the raw link records already on the fetched product document — these are the
287
+ // product's own App connections (access_tag, per-env credentials) and match exactly what
288
+ // `products apps list` displays via the same `row.apps` field (see listProductApps above).
289
+ // `listProductApps(ctx, productTag, true)` looks like the more "canonical" source but is NOT:
290
+ // for full=true it calls GET /integrations/v1/fetch-product-apps/:product_id, which resolves
291
+ // integration.apps[].app_tag against the App/marketplace catalogue (products.service.ts's
292
+ // fetchIntegration -> fetchIntegrationApps) and returns App *definition* objects, not the
293
+ // product's link records — those have no access_tag or per-env credentials at all, which is
294
+ // exactly why every identifier from `products apps list` failed to resolve here (DT-084).
295
+ // Only fall back to the normalized listProductApps() path (full=false, matching the proven-
296
+ // working `products apps list` path) when the product document itself omits `apps`.
297
+ const rawLinks = Array.isArray(product.apps) ? product.apps : undefined;
298
+ const listedLinks = rawLinks ?? (await listProductApps(ctx, productTag, false));
289
299
  const links = listedLinks.filter((item) => Boolean(item && typeof item === 'object'));
290
300
  const normalized = appRef.toLowerCase();
291
301
  const link = links.find((item) => String(item.access_tag ?? '').toLowerCase() === normalized
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ductape/cli",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
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",