@tinycloud/cli 0.6.0-beta.1 → 0.6.0-beta.2

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/README.md CHANGED
@@ -71,7 +71,7 @@ tc delegation create --to did:pkh:eip155:1:0x...
71
71
 
72
72
  Secret names are env-style uppercase identifiers such as `FIREFLIES_API_KEY`.
73
73
  `tc secrets network show` accepts either a short network name or a full
74
- `urn:tinycloud:encryption:<principal>:<network>` identifier. `tc secrets
74
+ `urn:tinycloud:encryption:<ownerDid>:<network>` identifier. `tc secrets
75
75
  network grant` takes the short name, resolves the network, and grants
76
76
  `tinycloud.encryption/decrypt`.
77
77
 
package/dist/index.js CHANGED
@@ -843,7 +843,7 @@ function registerInitCommand(program2) {
843
843
  await ProfileManager.setProfile(profileName, {
844
844
  ...profileConfig,
845
845
  spaceId: delegationData.spaceId,
846
- primaryDid: delegationData.primaryDid
846
+ ownerDid: delegationData.ownerDid
847
847
  });
848
848
  outputJson({
849
849
  profile: profileName,
@@ -907,8 +907,8 @@ function resolveAddress(profile, session) {
907
907
  const sessAddr = session?.address;
908
908
  if (typeof sessAddr === "string" && sessAddr.length > 0) return sessAddr;
909
909
  if (profile.address) return profile.address;
910
- if (profile.primaryDid) {
911
- const match = profile.primaryDid.match(/^did:pkh:eip155:\d+:(0x[a-fA-F0-9]{40})$/);
910
+ if (profile.ownerDid) {
911
+ const match = profile.ownerDid.match(/^did:pkh:eip155:\d+:(0x[a-fA-F0-9]{40})$/);
912
912
  if (match) return match[1];
913
913
  }
914
914
  throw new CLIError(
@@ -959,8 +959,8 @@ function createPermissionRequestArtifact(params) {
959
959
  posture: resolveProfilePosture(params.profile),
960
960
  operatorType: resolveProfileOperatorType(params.profile),
961
961
  host: params.host,
962
- did: didWithoutFragment(params.profile.sessionDid ?? params.profile.did),
963
- primaryDid: params.profile.primaryDid,
962
+ sessionDid: didWithoutFragment(params.profile.sessionDid ?? params.profile.did),
963
+ ownerDid: params.profile.ownerDid,
964
964
  spaceId: params.profile.spaceId,
965
965
  requestedExpiry: params.requestedExpiry,
966
966
  requested: params.requested,
@@ -1382,7 +1382,7 @@ function registerAuthCommand(program2) {
1382
1382
  authenticated,
1383
1383
  did: profile?.did ?? null,
1384
1384
  sessionDid: profile?.sessionDid ?? null,
1385
- primaryDid: profile?.primaryDid ?? null,
1385
+ ownerDid: profile?.ownerDid ?? null,
1386
1386
  spaceId: profile?.spaceId ?? null,
1387
1387
  host: ctx.host,
1388
1388
  profile: ctx.profile,
@@ -1402,7 +1402,7 @@ function registerAuthCommand(program2) {
1402
1402
  process.stdout.write(formatField("Host", ctx.host) + "\n");
1403
1403
  process.stdout.write(formatField("DID", profile?.did ?? null) + "\n");
1404
1404
  process.stdout.write(formatField("Session DID", profile?.sessionDid ?? null) + "\n");
1405
- process.stdout.write(formatField("Primary DID", profile?.primaryDid ?? null) + "\n");
1405
+ process.stdout.write(formatField("Owner DID", profile?.ownerDid ?? null) + "\n");
1406
1406
  process.stdout.write(formatField("Address", profile?.address ?? null) + "\n");
1407
1407
  process.stdout.write(formatField("Space ID", profile?.spaceId ?? null) + "\n");
1408
1408
  process.stdout.write(formatField("Has Key", hasKey !== null) + "\n");
@@ -1603,7 +1603,7 @@ function registerAuthCommand(program2) {
1603
1603
  yes: options.yes === true
1604
1604
  });
1605
1605
  const result = await node.delegateTo(
1606
- parsed.did,
1606
+ parsed.sessionDid,
1607
1607
  parsed.requested,
1608
1608
  parsed.requestedExpiry !== void 0 ? { expiry: parsed.requestedExpiry } : void 0
1609
1609
  );
@@ -1735,7 +1735,7 @@ function registerAuthCommand(program2) {
1735
1735
  profile: ctx.profile,
1736
1736
  did: profile.did,
1737
1737
  sessionDid: profile.sessionDid ?? null,
1738
- primaryDid: profile.primaryDid ?? null,
1738
+ ownerDid: profile.ownerDid ?? null,
1739
1739
  spaceId: profile.spaceId ?? null,
1740
1740
  host: profile.host,
1741
1741
  authenticated,
@@ -1749,7 +1749,7 @@ function registerAuthCommand(program2) {
1749
1749
  process.stdout.write(formatField("Profile", ctx.profile) + "\n");
1750
1750
  process.stdout.write(formatField("DID", profile.did) + "\n");
1751
1751
  process.stdout.write(formatField("Session DID", profile.sessionDid ?? null) + "\n");
1752
- process.stdout.write(formatField("Primary DID", profile.primaryDid ?? null) + "\n");
1752
+ process.stdout.write(formatField("Owner DID", profile.ownerDid ?? null) + "\n");
1753
1753
  process.stdout.write(formatField("Auth Method", profile.authMethod ?? null) + "\n");
1754
1754
  process.stdout.write(formatField("Posture", posture) + "\n");
1755
1755
  process.stdout.write(formatField("Operator", operatorType) + "\n");
@@ -2133,7 +2133,7 @@ async function handleLocalAuth(profileName, host) {
2133
2133
  spaceName: "default",
2134
2134
  did,
2135
2135
  sessionDid,
2136
- primaryDid: did,
2136
+ ownerDid: did,
2137
2137
  spaceId: sessionResult.spaceId,
2138
2138
  createdAt: profile?.createdAt ?? (/* @__PURE__ */ new Date()).toISOString(),
2139
2139
  posture: profile?.posture ?? "local-owner-key",
@@ -2178,7 +2178,7 @@ async function handleOpenKeyAuth(profileName, host, paste) {
2178
2178
  };
2179
2179
  if (delegationData.spaceId) {
2180
2180
  updatedProfile.spaceId = delegationData.spaceId;
2181
- updatedProfile.primaryDid = delegationData.primaryDid;
2181
+ updatedProfile.ownerDid = delegationData.ownerDid;
2182
2182
  }
2183
2183
  await ProfileManager.setProfile(profileName, updatedProfile);
2184
2184
  outputJson({