@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.
- package/dist/lib/platform-api.js +13 -3
- package/package.json +1 -1
package/dist/lib/platform-api.js
CHANGED
|
@@ -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
|
-
//
|
|
287
|
-
//
|
|
288
|
-
|
|
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