@storacha/clawracha 0.1.11 → 0.1.12
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/plugin.js +5 -5
- package/package.json +1 -1
package/dist/plugin.js
CHANGED
|
@@ -420,7 +420,7 @@ export default function plugin(api) {
|
|
|
420
420
|
results.push("⚠️ No upload delegation to re-delegate.");
|
|
421
421
|
}
|
|
422
422
|
// Re-delegate name capability
|
|
423
|
-
|
|
423
|
+
{
|
|
424
424
|
const { Agent, Name } = await import("@storacha/ucn/pail");
|
|
425
425
|
const { extract } = await import("@storacha/client/delegation");
|
|
426
426
|
const agent = Agent.parse(deviceConfig.agentKey);
|
|
@@ -429,7 +429,7 @@ export default function plugin(api) {
|
|
|
429
429
|
const archiveBytes = decodeDelegation(deviceConfig.nameArchive);
|
|
430
430
|
name = await Name.extract(agent, archiveBytes);
|
|
431
431
|
}
|
|
432
|
-
else {
|
|
432
|
+
else if (deviceConfig.nameDelegation) {
|
|
433
433
|
const nameBytes = decodeDelegation(deviceConfig.nameDelegation);
|
|
434
434
|
const { ok: nameDel } = await extract(nameBytes);
|
|
435
435
|
if (nameDel) {
|
|
@@ -443,9 +443,9 @@ export default function plugin(api) {
|
|
|
443
443
|
results.push(`Name delegation:\n${encodeDelegation(archiveBytes)}`);
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
446
|
+
else {
|
|
447
|
+
results.push("⚠️ No name state available to grant from.");
|
|
448
|
+
}
|
|
449
449
|
}
|
|
450
450
|
console.log(`🔥 Delegations for ${targetDID}:\n`);
|
|
451
451
|
for (const r of results) {
|