@interop/did-cli 0.10.0 → 0.12.0
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/CHANGELOG.md +113 -0
- package/README.md +184 -35
- package/dist/commands/collection-command.d.ts +169 -0
- package/dist/commands/collection-command.d.ts.map +1 -0
- package/dist/commands/collection-command.js +241 -0
- package/dist/commands/collection-command.js.map +1 -0
- package/dist/commands/did/create.d.ts +63 -0
- package/dist/commands/did/create.d.ts.map +1 -0
- package/dist/commands/did/create.js +624 -0
- package/dist/commands/did/create.js.map +1 -0
- package/dist/commands/did/manage.d.ts +69 -0
- package/dist/commands/did/manage.d.ts.map +1 -0
- package/dist/commands/did/manage.js +322 -0
- package/dist/commands/did/manage.js.map +1 -0
- package/dist/commands/did/service.d.ts +93 -0
- package/dist/commands/did/service.d.ts.map +1 -0
- package/dist/commands/did/service.js +322 -0
- package/dist/commands/did/service.js.map +1 -0
- package/dist/commands/did/webvh-update.d.ts +172 -0
- package/dist/commands/did/webvh-update.d.ts.map +1 -0
- package/dist/commands/did/webvh-update.js +438 -0
- package/dist/commands/did/webvh-update.js.map +1 -0
- package/dist/commands/did.d.ts +8 -8
- package/dist/commands/did.d.ts.map +1 -1
- package/dist/commands/did.js +31 -1519
- package/dist/commands/did.js.map +1 -1
- package/dist/commands/edv.d.ts +15 -6
- package/dist/commands/edv.d.ts.map +1 -1
- package/dist/commands/edv.js +38 -28
- package/dist/commands/edv.js.map +1 -1
- package/dist/commands/key.d.ts +104 -0
- package/dist/commands/key.d.ts.map +1 -1
- package/dist/commands/key.js +432 -402
- package/dist/commands/key.js.map +1 -1
- package/dist/commands/vc.d.ts +2 -1
- package/dist/commands/vc.d.ts.map +1 -1
- package/dist/commands/vc.js +88 -145
- package/dist/commands/vc.js.map +1 -1
- package/dist/commands/was/collection.d.ts.map +1 -1
- package/dist/commands/was/collection.js +31 -85
- package/dist/commands/was/collection.js.map +1 -1
- package/dist/commands/was/publish.d.ts.map +1 -1
- package/dist/commands/was/publish.js +16 -44
- package/dist/commands/was/publish.js.map +1 -1
- package/dist/commands/was/resource.d.ts.map +1 -1
- package/dist/commands/was/resource.js +24 -51
- package/dist/commands/was/resource.js.map +1 -1
- package/dist/commands/was/shared.d.ts +83 -6
- package/dist/commands/was/shared.d.ts.map +1 -1
- package/dist/commands/was/shared.js +104 -1
- package/dist/commands/was/shared.js.map +1 -1
- package/dist/commands/was/space.d.ts.map +1 -1
- package/dist/commands/was/space.js +10 -16
- package/dist/commands/was/space.js.map +1 -1
- package/dist/commands/was/tree.d.ts.map +1 -1
- package/dist/commands/was/tree.js +4 -6
- package/dist/commands/was/tree.js.map +1 -1
- package/dist/commands/was.d.ts.map +1 -1
- package/dist/commands/was.js +60 -74
- package/dist/commands/was.js.map +1 -1
- package/dist/commands/zcap.d.ts +0 -18
- package/dist/commands/zcap.d.ts.map +1 -1
- package/dist/commands/zcap.js +63 -155
- package/dist/commands/zcap.js.map +1 -1
- package/dist/documentLoader.d.ts +3 -0
- package/dist/documentLoader.d.ts.map +1 -0
- package/dist/documentLoader.js +26 -0
- package/dist/documentLoader.js.map +1 -0
- package/dist/edv/core.d.ts +5 -4
- package/dist/edv/core.d.ts.map +1 -1
- package/dist/edv/core.js +22 -19
- package/dist/edv/core.js.map +1 -1
- package/dist/edv/hmac.d.ts.map +1 -1
- package/dist/edv/hmac.js +12 -12
- package/dist/edv/hmac.js.map +1 -1
- package/dist/edv/recipients.d.ts +2 -0
- package/dist/edv/recipients.d.ts.map +1 -1
- package/dist/edv/recipients.js +12 -15
- package/dist/edv/recipients.js.map +1 -1
- package/dist/keys/webvh-signer.d.ts +4 -10
- package/dist/keys/webvh-signer.d.ts.map +1 -1
- package/dist/keys/webvh-signer.js +10 -14
- package/dist/keys/webvh-signer.js.map +1 -1
- package/dist/keys/webvh-update.d.ts +6 -1
- package/dist/keys/webvh-update.d.ts.map +1 -1
- package/dist/keys/webvh-update.js +5 -2
- package/dist/keys/webvh-update.js.map +1 -1
- package/dist/meta.d.ts +36 -11
- package/dist/meta.d.ts.map +1 -1
- package/dist/meta.js +95 -73
- package/dist/meta.js.map +1 -1
- package/dist/storage.d.ts +65 -13
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +75 -17
- package/dist/storage.js.map +1 -1
- package/dist/vc/issue.d.ts.map +1 -1
- package/dist/vc/issue.js +4 -7
- package/dist/vc/issue.js.map +1 -1
- package/dist/vc/suites/expirationSuite.d.ts.map +1 -1
- package/dist/vc/suites/expirationSuite.js.map +1 -1
- package/dist/vc/suites/issuerDetailsSuite.d.ts.map +1 -1
- package/dist/vc/suites/issuerDetailsSuite.js.map +1 -1
- package/dist/vc/verify.d.ts +10 -0
- package/dist/vc/verify.d.ts.map +1 -1
- package/dist/vc/verify.js +38 -1
- package/dist/vc/verify.js.map +1 -1
- package/dist/was/client.d.ts.map +1 -1
- package/dist/was/client.js +8 -2
- package/dist/was/client.js.map +1 -1
- package/dist/was/grant.d.ts +44 -0
- package/dist/was/grant.d.ts.map +1 -0
- package/dist/was/grant.js +78 -0
- package/dist/was/grant.js.map +1 -0
- package/dist/was/io.d.ts +2 -2
- package/dist/was/io.d.ts.map +1 -1
- package/dist/was/io.js +1 -1
- package/dist/was/registry.d.ts.map +1 -1
- package/dist/was/registry.js +9 -2
- package/dist/was/registry.js.map +1 -1
- package/dist/zcap/delegate.d.ts.map +1 -1
- package/dist/zcap/delegate.js +1 -6
- package/dist/zcap/delegate.js.map +1 -1
- package/dist/zcap/signer.d.ts.map +1 -1
- package/dist/zcap/signer.js.map +1 -1
- package/package.json +20 -19
- package/dist/keys/webvh-driver.d.ts +0 -24
- package/dist/keys/webvh-driver.d.ts.map +0 -1
- package/dist/keys/webvh-driver.js +0 -73
- package/dist/keys/webvh-driver.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,118 @@
|
|
|
1
1
|
# History
|
|
2
2
|
|
|
3
|
+
## 0.12.0 - 2026-07-09
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Update to the latest `did-method-webvh`, `edv-client`, `minimal-cipher`, and
|
|
8
|
+
`was-client`.
|
|
9
|
+
- `edv encrypt` / `edv decrypt` now route the EDV Document envelope through
|
|
10
|
+
`edv-client`'s public `EdvDocumentCipher` codec, which replaced the private
|
|
11
|
+
`EdvClientCore._encrypt` / `_decrypt` helpers they previously reached into.
|
|
12
|
+
The envelope and its HMAC-blinded `indexed` array are unchanged on the wire.
|
|
13
|
+
- The did:webvh commands no longer pass an explicit `verifier` to `createDID`,
|
|
14
|
+
`updateDID`, and `resolveDIDFromLog`. `did-method-webvh` now defaults it to
|
|
15
|
+
`defaultWebvhLogVerifier`, which is the same verifier the CLI was handing
|
|
16
|
+
back to it. `makeWebvhSigner` is correspondingly narrowed to a `Signer` (it
|
|
17
|
+
no longer implements `Verifier`), and `documentLoader`'s `webvhLogVerifier`
|
|
18
|
+
re-export, which existed only to feed those call sites, is removed.
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- `did create webvh` verified its initial log entry with a verifier bound to a
|
|
23
|
+
single key pair. `did-method-webvh`'s `Verifier` interface is
|
|
24
|
+
`verify(signature, message, publicKey)`, but the CLI's implementation took
|
|
25
|
+
only `(signature, message)` and always checked against the key it was built
|
|
26
|
+
from, ignoring the public key it was handed. During creation that key is the
|
|
27
|
+
signing key, so the check happened to agree with the correct answer; as a
|
|
28
|
+
general verifier it would have accepted a proof from any key. Creation now
|
|
29
|
+
self-verifies through the library's default log verifier, which recovers each
|
|
30
|
+
entry's public key from its proof.
|
|
31
|
+
|
|
32
|
+
## 0.11.0 - 2026-06-27
|
|
33
|
+
|
|
34
|
+
### Changed
|
|
35
|
+
|
|
36
|
+
- `was` command errors now surface the HTTP status and its reason phrase (e.g.
|
|
37
|
+
`Could not put the resource: Request error (HTTP 415 Unsupported Media Type)`)
|
|
38
|
+
plus any server-provided problem `details`, instead of collapsing every
|
|
39
|
+
server rejection to a bare `Request error`. The status was already on the
|
|
40
|
+
`WasError`; `reportError` now includes it.
|
|
41
|
+
|
|
42
|
+
### Added
|
|
43
|
+
|
|
44
|
+
- `did meta <did>` (with no edit flags) now prints a `Location:` block to
|
|
45
|
+
stderr listing where the DID's artifacts live on disk -- the DID document,
|
|
46
|
+
keys file, metadata sidecar, and for `did:webvh` the history log and
|
|
47
|
+
update-keys sidecar. The metadata JSON still goes to stdout unchanged. Add
|
|
48
|
+
`--json` for a machine-readable `{ metadata, files }` object that folds those
|
|
49
|
+
locations in (works in both the read and edit paths). Backed by a new
|
|
50
|
+
`didStorageFiles` helper in `storage.ts`.
|
|
51
|
+
- `did webvh rotate-keys` now accepts `--with-seed`, emitting the secret key
|
|
52
|
+
seed of the new/next update key the rotation generates (the staged next key
|
|
53
|
+
when pre-rotation stays armed, otherwise the freshly generated active key of
|
|
54
|
+
an ordinary rotation). Honors `SECRET_KEY_SEED` when set, mirroring
|
|
55
|
+
`did create`. Rejected for a rotation that generates no new key (a bare
|
|
56
|
+
`--stop-prerotation` reveal, or rotating to an external `--update-key`).
|
|
57
|
+
|
|
58
|
+
## 0.10.1 - 2026-06-26
|
|
59
|
+
|
|
60
|
+
### Fixed
|
|
61
|
+
|
|
62
|
+
- `vc verify` now verifies credentials issued by `did:webvh` (and `did:web`)
|
|
63
|
+
issuers. Verification ran through `@interop/verifier-core`'s default document
|
|
64
|
+
loader, which resolves only `did:key` and `did:web`, so a `did:webvh` proof's
|
|
65
|
+
verification method could never be fetched and the signature was reported as
|
|
66
|
+
invalid. Verification now uses the CLI's shared loader (which registers the
|
|
67
|
+
`did:webvh` driver), passed through to `verifyCredential`.
|
|
68
|
+
- `vc issue --did` now accepts a metadata handle (not just a full DID id),
|
|
69
|
+
resolving it via the same lookup used by the other DID-referencing commands.
|
|
70
|
+
Previously passing a handle failed with a confusing `The "path" argument must
|
|
71
|
+
be of type string. Received undefined` error.
|
|
72
|
+
|
|
73
|
+
### Changed
|
|
74
|
+
|
|
75
|
+
- The `list` / `show` / `meta` / `remove` subcommands and metadata handling of
|
|
76
|
+
the `vc`, `key`, and `zcap` command families now share a single
|
|
77
|
+
`src/commands/collection-command.ts` module (`runListCollection`,
|
|
78
|
+
`runMetaCollection`, `runRemoveCollection`, `resolveRefOrReport`,
|
|
79
|
+
`applyMetaEdits`, `requireSaveForMetaFlags`, and a unified `writeCreateMeta`),
|
|
80
|
+
replacing the near-identical clones previously copy-pasted across the three
|
|
81
|
+
files. `did`'s metadata edit and save-flag guard reuse the same helpers. No
|
|
82
|
+
behavior change.
|
|
83
|
+
- The `did` command file was split, mirroring `was/`: `src/commands/did.ts` now
|
|
84
|
+
holds only the `makeDidCommand()` wiring and delegates to `run*` functions in
|
|
85
|
+
`src/commands/did/` -- `create` (create / add-key), `service`
|
|
86
|
+
(add / remove-service), `manage` (get / show / list / meta / remove), and
|
|
87
|
+
`webvh-update` (the did:webvh log / update-key plumbing plus rotate-keys). The
|
|
88
|
+
in-`create` duplication was folded into shared `deriveSeed`,
|
|
89
|
+
`rejectSeedForNonDeterministic`, `resolveEcdsaCurveOrReport`, and
|
|
90
|
+
`printDidOutput` helpers (and a `DEFAULT_VERIFICATION_PURPOSES` constant), and
|
|
91
|
+
the `did.split(':')[1]` method-index idiom became `methodOf` in `storage.ts`.
|
|
92
|
+
No behavior change.
|
|
93
|
+
- All commands now share a single JSON-LD document loader (`src/documentLoader.ts`)
|
|
94
|
+
for DID resolution, DID-URL dereferencing, and context loading -- replacing the
|
|
95
|
+
per-module loaders previously built in `vc/issue`, `vc/verify` (none was passed
|
|
96
|
+
before), `edv/recipients`, `zcap/delegate`, and `commands/did`. The shared
|
|
97
|
+
loader resolves `did:key`, `did:web`, and `did:webvh`.
|
|
98
|
+
- `vc verify` prints a friendly `Cannot verify: ...` hint on stderr (stdout stays
|
|
99
|
+
machine-parseable JSON) when a proof's verification method uses a DID method the
|
|
100
|
+
loader has no driver for, distinguishing a loader misconfiguration from a
|
|
101
|
+
genuine invalid signature.
|
|
102
|
+
- Internal typing and consistency cleanups (no behavior change): the exported
|
|
103
|
+
key-pair shape is named once as `StoredKeyPair` in `storage.ts` (replacing the
|
|
104
|
+
three verbatim copies in `vc/issue`, `zcap/signer`, `was/client` and the inline
|
|
105
|
+
shapes in `storage`/`meta`); `loadMetaFromCollection` is generic over the
|
|
106
|
+
metadata type (so only the `keys` collection carries the key-specific `dids`
|
|
107
|
+
field); `loadFromCollection` / `saveToCollection` take an options object like
|
|
108
|
+
the rest of the storage helpers; `vc/issue` and `vc/verify` replace their
|
|
109
|
+
`as never` casts with typed ones; `edv/recipients` replaces `Record<string,
|
|
110
|
+
any>` with a named `VerificationMethodNode` type; `edv`'s encrypt functions
|
|
111
|
+
share an `EnvelopeOptions` type and a `resolveEncryptContextOrReport` wrapper;
|
|
112
|
+
and the `z6Mk` / `z6LS` multibase prefixes are named constants. Added the
|
|
113
|
+
file-level JSDoc header to `key.ts` and moved the `zcap revoke` stub message to
|
|
114
|
+
stderr.
|
|
115
|
+
|
|
3
116
|
## 0.10.0 - 2026-06-25
|
|
4
117
|
|
|
5
118
|
### Added
|
package/README.md
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
[](https://github.com/interop-alliance/did-cli-typescript/actions?query=workflow%3A%22CI%22)
|
|
4
4
|
[](https://npm.im/@interop/did-cli)
|
|
5
5
|
|
|
6
|
-
> A command line client for managing DIDs, VCs, zCaps, and corresponding
|
|
6
|
+
> A command line client for managing DIDs, VCs, zCaps, and corresponding
|
|
7
|
+
> cryptographic key pairs, written in Typescript.
|
|
7
8
|
|
|
8
9
|
## Table of Contents
|
|
9
10
|
|
|
@@ -15,8 +16,41 @@
|
|
|
15
16
|
|
|
16
17
|
## Background
|
|
17
18
|
|
|
19
|
+
`@interop/did-cli` is a command-line wallet for the building blocks of
|
|
20
|
+
decentralized identity: [Decentralized Identifiers](https://www.w3.org/TR/did-core/)
|
|
21
|
+
(DIDs), [Verifiable Credentials](https://www.w3.org/TR/vc-data-model-2.0/) (VCs),
|
|
22
|
+
[Authorization Capabilities](https://w3id.org/zcap/v1) (zCaps), and the
|
|
23
|
+
cryptographic key pairs that underpin them.
|
|
24
|
+
|
|
25
|
+
It lets you generate and manage these objects locally -- minting DIDs, issuing
|
|
26
|
+
and verifying credentials, delegating capabilities, and encrypting data -- and
|
|
27
|
+
interact with remote
|
|
28
|
+
[Wallet Attached Storage](https://digitalcredentials.github.io/wallet-attached-storage-spec/)
|
|
29
|
+
servers, all from the terminal and backed by a local file-based wallet.
|
|
30
|
+
|
|
31
|
+
### Features
|
|
32
|
+
|
|
33
|
+
- **DIDs** -- create, resolve, and manage `did:key`, `did:web`, and `did:webvh`
|
|
34
|
+
DIDs (with `did:webvh` key pre-rotation, rotation, and history logs).
|
|
35
|
+
- **Keys** -- generate and store Ed25519, ECDSA, X25519, and HMAC key pairs,
|
|
36
|
+
with deterministic seed-based generation.
|
|
37
|
+
- **Verifiable Credentials** -- issue (sign), verify, and import VCs, including
|
|
38
|
+
signature, expiration, revocation, and trusted-issuer checks.
|
|
39
|
+
- **Authorization Capabilities (zCaps)** -- create root capabilities and
|
|
40
|
+
delegate (attenuate) authority down a signed capability chain.
|
|
41
|
+
- **Encryption (EDV)** -- encrypt and decrypt to X25519 recipients as raw JWE,
|
|
42
|
+
EDV Documents, or chunked stream bundles.
|
|
43
|
+
- **Wallet Attached Storage (WAS)** -- a client for WAS servers: manage spaces,
|
|
44
|
+
collections, and resources over zcap-authorized HTTP.
|
|
45
|
+
- **Local wallet** -- everything is stored in a local file-based wallet with
|
|
46
|
+
searchable metadata (handles, descriptions, timestamps).
|
|
47
|
+
|
|
18
48
|
## Install
|
|
19
49
|
|
|
50
|
+
```
|
|
51
|
+
pnpm install -g @interop/did-cli
|
|
52
|
+
```
|
|
53
|
+
|
|
20
54
|
## Usage
|
|
21
55
|
|
|
22
56
|
Help is available with the `--help/-h` command line option:
|
|
@@ -26,20 +60,71 @@ Help is available with the `--help/-h` command line option:
|
|
|
26
60
|
./di COMMAND -h
|
|
27
61
|
```
|
|
28
62
|
|
|
63
|
+
### Command Summary
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
di did create [method] create a DID (key | web | webvh; default key)
|
|
67
|
+
di did add-key <did> add a verification method to a stored DID
|
|
68
|
+
di did add-service <did> add a service entry to a stored did:web/webvh
|
|
69
|
+
di did remove-service <did> remove a service entry from a stored did:web/webvh
|
|
70
|
+
di did webvh rotate-keys <did> rotate a stored did:webvh update (auth) key
|
|
71
|
+
di did get|resolve <did> resolve a DID (or DID URL) via the document loader
|
|
72
|
+
di did show|view|cat <did> show a stored DID document
|
|
73
|
+
di did list list stored DIDs
|
|
74
|
+
di did meta <did> show/edit a DID's local metadata
|
|
75
|
+
di did remove|delete|rm <did> remove a stored DID
|
|
76
|
+
|
|
77
|
+
di key create generate a key pair
|
|
78
|
+
di key list list stored keys
|
|
79
|
+
di key show|view|cat <id> show a stored key
|
|
80
|
+
di key meta <id> show/edit a key's local metadata
|
|
81
|
+
di key remove|delete|rm <id> remove a stored key
|
|
82
|
+
di key export <id> export a key pair
|
|
83
|
+
|
|
84
|
+
di vc verify [file] verify a Verifiable Credential
|
|
85
|
+
di vc issue [file] issue (sign) a Verifiable Credential
|
|
86
|
+
di vc import [source] import a credential into the wallet
|
|
87
|
+
di vc list list stored credentials
|
|
88
|
+
di vc show|view|cat <id> show a stored credential
|
|
89
|
+
di vc meta <id> show/edit a credential's local metadata
|
|
90
|
+
di vc remove|delete|rm <id> remove a stored credential
|
|
91
|
+
|
|
92
|
+
di zcap create create a root capability
|
|
93
|
+
di zcap delegate delegate (attenuate) a capability
|
|
94
|
+
di zcap list list stored capabilities
|
|
95
|
+
di zcap show|view|cat <id> show a stored capability
|
|
96
|
+
di zcap meta <id> show/edit a capability's local metadata
|
|
97
|
+
di zcap remove|delete|rm <id> remove a stored capability
|
|
98
|
+
di zcap revoke <id> revoke a delegated capability
|
|
99
|
+
|
|
100
|
+
di edv encrypt [file] encrypt to X25519 recipients (raw JWE, an EDV Document with --document, or a chunked bundle with --stream)
|
|
101
|
+
di edv decrypt [file] decrypt a JWE, EDV Document, or stream bundle with a stored X25519 key
|
|
102
|
+
|
|
103
|
+
di wallet ls|list list all wallet collections and items
|
|
104
|
+
|
|
105
|
+
di was space <create|list|show|update|delete|forget|add|backends|quotas|export|import>
|
|
106
|
+
di was collection|coll <create|list|show|update|delete|backend|quota>
|
|
107
|
+
di was resource|res <add|put|get|list|delete>
|
|
108
|
+
di was ls|get|put|rm [path] depth-dispatching shorthands
|
|
109
|
+
di was policy <show|set|clear> manage access-control policies
|
|
110
|
+
di was publish|unpublish <path> toggle world-readable access
|
|
111
|
+
di was grant <path> delegate access via a signed capability
|
|
112
|
+
```
|
|
113
|
+
|
|
29
114
|
### Environment Variables
|
|
30
115
|
|
|
31
116
|
These environment variables configure storage locations and provide defaults
|
|
32
117
|
or secret-key seeds for individual commands. Each is also documented inline in
|
|
33
118
|
the relevant command section below.
|
|
34
119
|
|
|
35
|
-
| Variable
|
|
36
|
-
|
|
37
|
-
| `WALLET_DIR`
|
|
38
|
-
| `DIDS_DIR`
|
|
39
|
-
| `SECRET_KEY_SEED`
|
|
40
|
-
| `WAS_DID`
|
|
41
|
-
| `WAS_SERVER_URL`
|
|
42
|
-
| `ZCAP_CONTROLLER_KEY_SEED` | `zcap`
|
|
120
|
+
| Variable | Used by | Purpose |
|
|
121
|
+
|----------------------------|----------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
122
|
+
| `WALLET_DIR` | all | Wallet collections directory (`keys/`, `zcaps/`, `credentials/`, `was-spaces/`). Defaults to `~/.config/did-cli-wallet/` (honors `XDG_CONFIG_HOME`). |
|
|
123
|
+
| `DIDS_DIR` | `did` | DID-documents directory. Defaults to `<WALLET_DIR>/dids/`. |
|
|
124
|
+
| `SECRET_KEY_SEED` | `key create`, `did create` | Multibase-encoded seed for deterministic key/DID generation. Not supported with `--type ecdsa` or `--type x25519`. |
|
|
125
|
+
| `WAS_DID` | `was` | Default signing DID (or stored-DID handle) when `--did` is omitted. |
|
|
126
|
+
| `WAS_SERVER_URL` | `was` | Default WAS server base URL when `--server` is omitted. |
|
|
127
|
+
| `ZCAP_CONTROLLER_KEY_SEED` | `zcap` | Controller signing-key seed for delegating capabilities. |
|
|
43
128
|
|
|
44
129
|
### Key Management
|
|
45
130
|
|
|
@@ -133,7 +218,8 @@ Like ECDSA, X25519 key generation is non-deterministic, so `--with-seed` and
|
|
|
133
218
|
`SECRET_KEY_SEED` are not supported with `--type x25519`.
|
|
134
219
|
|
|
135
220
|
Generate a `Sha256HmacKey2019` HMAC key -- a 32-byte symmetric secret used to
|
|
136
|
-
HMAC-blind EDV index attributes (
|
|
221
|
+
HMAC-blind EDV index attributes (
|
|
222
|
+
see [Blinded indexing](#blinded-indexing---index))
|
|
137
223
|
-- with `--type hmac`:
|
|
138
224
|
|
|
139
225
|
```
|
|
@@ -147,14 +233,19 @@ half), identified by a random `urn:uuid:` id:
|
|
|
147
233
|
{
|
|
148
234
|
"id": "urn:uuid:...",
|
|
149
235
|
"type": "Sha256HmacKey2019",
|
|
150
|
-
"secretKeyJwk": {
|
|
236
|
+
"secretKeyJwk": {
|
|
237
|
+
"kty": "oct",
|
|
238
|
+
"alg": "HS256",
|
|
239
|
+
"k": "..."
|
|
240
|
+
}
|
|
151
241
|
}
|
|
152
242
|
```
|
|
153
243
|
|
|
154
244
|
HMAC key generation is non-deterministic, so `--with-seed` and `SECRET_KEY_SEED`
|
|
155
245
|
are not supported with `--type hmac`.
|
|
156
246
|
|
|
157
|
-
Save the key to local wallet storage (`~/.config/did-cli-wallet/keys/` by
|
|
247
|
+
Save the key to local wallet storage (`~/.config/did-cli-wallet/keys/` by
|
|
248
|
+
default, or
|
|
158
249
|
`$WALLET_DIR/keys/` if set) with `--save`. A `.meta.json` metadata sidecar is
|
|
159
250
|
written next to the key, recording the creation timestamp; `--handle` (a short
|
|
160
251
|
tag for telling keys apart) and `--description` add user-defined metadata to
|
|
@@ -335,7 +426,8 @@ SECRET_KEY_SEED=z1AXVyT6G1Qk3E9cMPkDYY6wVRpZjVGWAZ3TfrAgFZkX6bv ./di did create
|
|
|
335
426
|
```
|
|
336
427
|
|
|
337
428
|
Save the DID document and key material to local storage with `--save`
|
|
338
|
-
(written to `~/.config/did-cli-wallet/dids/` by default, or `$DIDS_DIR` if set).
|
|
429
|
+
(written to `~/.config/did-cli-wallet/dids/` by default, or `$DIDS_DIR` if set).
|
|
430
|
+
A `.meta.json`
|
|
339
431
|
metadata sidecar is written next to the DID document, recording the creation
|
|
340
432
|
timestamp; `--handle` and `--description` add user-defined metadata to it
|
|
341
433
|
(both require `--save`):
|
|
@@ -391,7 +483,8 @@ SECRET_KEY_SEED=z1AXVyT6G1Qk3E9cMPkDYY6wVRpZjVGWAZ3TfrAgFZkX6bv \
|
|
|
391
483
|
```
|
|
392
484
|
|
|
393
485
|
Save the DID document and key material to local storage with `--save` (written
|
|
394
|
-
to `~/.config/did-cli-wallet/dids/web/` by default, or `$DIDS_DIR` if set). The
|
|
486
|
+
to `~/.config/did-cli-wallet/dids/web/` by default, or `$DIDS_DIR` if set). The
|
|
487
|
+
key file is an
|
|
395
488
|
object keyed by verification method id, so further keys can be appended later:
|
|
396
489
|
|
|
397
490
|
```
|
|
@@ -406,7 +499,8 @@ DID saved to /home/user/.config/did-cli-wallet/dids/web/did:web:example.com.json
|
|
|
406
499
|
#### Add a key to a did:web DID
|
|
407
500
|
|
|
408
501
|
Add another verification key to an existing, locally stored `did:web` DID (the
|
|
409
|
-
DID must have been saved with `did create web --save`). The new key is
|
|
502
|
+
DID must have been saved with `did create web --save`). The new key is
|
|
503
|
+
generated,
|
|
410
504
|
added to the DID document, and both the document and key file in storage are
|
|
411
505
|
updated in place:
|
|
412
506
|
|
|
@@ -444,7 +538,7 @@ is rejected:
|
|
|
444
538
|
```
|
|
445
539
|
|
|
446
540
|
For Ed25519 keys, the new key is derived from a seed (as with `did create`):
|
|
447
|
-
pass `--with-seed` to generate (and print) a fresh seed, or set
|
|
541
|
+
pass `--with-seed` to generate (and print) a fresh seed, or set`SECRET_KEY_SEED`
|
|
448
542
|
to derive the key deterministically. ECDSA and X25519 keys are not
|
|
449
543
|
seed-derivable, so `--with-seed` is not supported with `--type ecdsa` or
|
|
450
544
|
`--type x25519`:
|
|
@@ -566,6 +660,12 @@ Flags:
|
|
|
566
660
|
prior commitment.
|
|
567
661
|
- `--keep-old-key` -- retain the retired update key's secret in the sidecar
|
|
568
662
|
instead of dropping it.
|
|
663
|
+
- `--with-seed` -- emit the secret key seed of the new/next update key this
|
|
664
|
+
rotation generates (the staged next key when pre-rotation stays armed, or the
|
|
665
|
+
freshly generated active key in an ordinary rotation). Honors`SECRET_KEY_SEED`
|
|
666
|
+
if set, otherwise generates a seed. Rejected for a rotation that generates no
|
|
667
|
+
new key (a bare `--stop-prerotation` reveal, or rotating to an external
|
|
668
|
+
`--update-key`).
|
|
569
669
|
- `-y`, `--yes` -- skip the confirmation prompt (rotation is hard to undo).
|
|
570
670
|
|
|
571
671
|
#### Add or remove a service entry
|
|
@@ -739,9 +839,43 @@ fields are included there too).
|
|
|
739
839
|
#### Edit DID metadata
|
|
740
840
|
|
|
741
841
|
Show or edit the metadata of a stored DID with `did meta` (looked up by DID or
|
|
742
|
-
handle). With no options it prints the current metadata
|
|
743
|
-
|
|
744
|
-
|
|
842
|
+
handle). With no options it prints the current metadata (to stdout) and lists
|
|
843
|
+
where the DID's artifacts live on disk (to stderr) -- the DID document, keys
|
|
844
|
+
file, metadata sidecar, and for `did:webvh` the history log and update-keys
|
|
845
|
+
sidecar:
|
|
846
|
+
|
|
847
|
+
```
|
|
848
|
+
./di did meta did:webvh:Qm...:example.com:space:abc:did
|
|
849
|
+
Location:
|
|
850
|
+
document: /home/user/.config/did-cli-wallet/dids/webvh/did:webvh:Qm...:did.json
|
|
851
|
+
keys: /home/user/.config/did-cli-wallet/dids/webvh/did:webvh:Qm...:did.keys.json
|
|
852
|
+
metadata: /home/user/.config/did-cli-wallet/dids/webvh/did:webvh:Qm...:did.meta.json
|
|
853
|
+
log: /home/user/.config/did-cli-wallet/dids/webvh/did:webvh:Qm...:did.jsonl
|
|
854
|
+
update-keys: /home/user/.config/did-cli-wallet/dids/webvh/did:webvh:Qm...:did.update-keys.json
|
|
855
|
+
{
|
|
856
|
+
"created": "2026-06-10T17:22:31.123Z"
|
|
857
|
+
}
|
|
858
|
+
```
|
|
859
|
+
|
|
860
|
+
Add `--json` for a machine-readable object that folds the locations in as a
|
|
861
|
+
`files` map alongside the `metadata`:
|
|
862
|
+
|
|
863
|
+
```
|
|
864
|
+
./di did meta did:webvh:Qm...:did --json
|
|
865
|
+
{
|
|
866
|
+
"metadata": { "created": "..." },
|
|
867
|
+
"files": {
|
|
868
|
+
"document": ".../did:webvh:Qm...:did.json",
|
|
869
|
+
"keys": ".../did:webvh:Qm...:did.keys.json",
|
|
870
|
+
"metadata": ".../did:webvh:Qm...:did.meta.json",
|
|
871
|
+
"log": ".../did:webvh:Qm...:did.jsonl",
|
|
872
|
+
"updateKeys": ".../did:webvh:Qm...:did.update-keys.json"
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
```
|
|
876
|
+
|
|
877
|
+
With `--handle` / `--description` it updates the metadata sidecar (the DID
|
|
878
|
+
document itself is never rewritten). Passing an empty string clears a field:
|
|
745
879
|
|
|
746
880
|
```
|
|
747
881
|
./di did meta did:key:z6Mkr... --handle demo-issuer --description 'Issuer DID for the demo'
|
|
@@ -821,7 +955,8 @@ argument, an http(s) URL, or, if neither is given, from stdin, and the issued
|
|
|
821
955
|
credential is printed to stdout. If the input already carries a proof, issuing
|
|
822
956
|
appends an additional one.
|
|
823
957
|
|
|
824
|
-
The DID to issue with is required (`--did`); it must have been saved locally (
|
|
958
|
+
The DID to issue with is required (`--did`); it must have been saved locally (
|
|
959
|
+
see
|
|
825
960
|
`di did create --save`):
|
|
826
961
|
|
|
827
962
|
```
|
|
@@ -863,7 +998,8 @@ does not match the key type (e.g. `--suite eddsa-rdfc-2022` for an ECDSA key) is
|
|
|
863
998
|
rejected. ECDSA credentials round-trip through `vc verify` (below).
|
|
864
999
|
|
|
865
1000
|
Pass `--save` to also store the issued credential in local wallet storage
|
|
866
|
-
(`~/.config/did-cli-wallet/credentials/` by default, or `$WALLET_DIR` if set);
|
|
1001
|
+
(`~/.config/did-cli-wallet/credentials/` by default, or `$WALLET_DIR` if set);
|
|
1002
|
+
`--save`
|
|
867
1003
|
records the creation timestamp in a `.meta.json` metadata sidecar, and
|
|
868
1004
|
`--handle` / `--description` (which require `--save`) tag the saved credential
|
|
869
1005
|
the same way `zcap create --save` does:
|
|
@@ -1017,9 +1153,11 @@ narrowing the allowed actions or the target.
|
|
|
1017
1153
|
|
|
1018
1154
|
Both commands print the capability as JSON together with an `encoded` field --
|
|
1019
1155
|
the capability serialized and `base58btc`-encoded with a multibase `z` prefix --
|
|
1020
|
-
which is the compact form you pass to `zcap delegate --capability` to delegate
|
|
1156
|
+
which is the compact form you pass to `zcap delegate --capability` to delegate
|
|
1157
|
+
it
|
|
1021
1158
|
further. Pass `--save` to also write the capability to local wallet storage
|
|
1022
|
-
(`~/.config/did-cli-wallet/zcaps/` by default, or `$WALLET_DIR` if set)
|
|
1159
|
+
(`~/.config/did-cli-wallet/zcaps/` by default, or `$WALLET_DIR` if set);`--save`
|
|
1160
|
+
records the
|
|
1023
1161
|
creation timestamp in a `.meta.json` metadata sidecar, and `--handle` /
|
|
1024
1162
|
`--description` (which require `--save`) tag the saved capability the same way
|
|
1025
1163
|
`key create --save` and `did create --save` do. The exit code is `0` on
|
|
@@ -1027,8 +1165,9 @@ success and `1` on a creation / delegation or input error.
|
|
|
1027
1165
|
|
|
1028
1166
|
#### Create a root capability
|
|
1029
1167
|
|
|
1030
|
-
Build the root capability for an invocation target. The `--controller` is the
|
|
1031
|
-
|
|
1168
|
+
Build the root capability for an invocation target. The `--controller` is the
|
|
1169
|
+
DID
|
|
1170
|
+
that holds root authority over the target, and `--url` is the`invocationTarget`.
|
|
1032
1171
|
Root capabilities are unsigned, so no key is needed:
|
|
1033
1172
|
|
|
1034
1173
|
```
|
|
@@ -1046,7 +1185,8 @@ Root capabilities are unsigned, so no key is needed:
|
|
|
1046
1185
|
}
|
|
1047
1186
|
```
|
|
1048
1187
|
|
|
1049
|
-
The root capability's `id` is always
|
|
1188
|
+
The root capability's `id` is always
|
|
1189
|
+
`urn:zcap:root:<url-encoded invocationTarget>`,
|
|
1050
1190
|
and a root capability grants all actions (it has no `allowedAction`).
|
|
1051
1191
|
|
|
1052
1192
|
#### Note about the `encoded` field
|
|
@@ -1267,7 +1407,8 @@ SPACE[/COLLECTION[/RESOURCE]]
|
|
|
1267
1407
|
where `SPACE` is one of:
|
|
1268
1408
|
|
|
1269
1409
|
- a **registry handle** (e.g. `home`) of a space registered in the local
|
|
1270
|
-
wallet (`~/.config/did-cli-wallet/was-spaces/`), which also supplies the
|
|
1410
|
+
wallet (`~/.config/did-cli-wallet/was-spaces/`), which also supplies the
|
|
1411
|
+
server URL and
|
|
1271
1412
|
signing DID defaults;
|
|
1272
1413
|
- a **bare space id** (a server-generated uuid or urn), combined with
|
|
1273
1414
|
`--server` / `WAS_SERVER_URL`;
|
|
@@ -1668,7 +1809,8 @@ WAS_TEST_SERVER_URL=http://localhost:3002 npm run test:node
|
|
|
1668
1809
|
### Encrypted Data (EDV)
|
|
1669
1810
|
|
|
1670
1811
|
The `edv` commands encrypt an object or file to one or more X25519 recipients
|
|
1671
|
-
and decrypt the result, using the
|
|
1812
|
+
and decrypt the result, using the
|
|
1813
|
+
EDV / [minimal-cipher](https://www.npmjs.com/package/@interop/minimal-cipher)
|
|
1672
1814
|
serialization. The output is a single raw **JWE** (the `jwe` field of an EDV
|
|
1673
1815
|
Document), written to stdout or an `-o` file -- by convention `*.jwe.json`.
|
|
1674
1816
|
Encryption is public-key (key-agreement) only: there is no password mode. The
|
|
@@ -1720,9 +1862,11 @@ error rather than emitting garbage.
|
|
|
1720
1862
|
|
|
1721
1863
|
#### EDV Documents (`--document`)
|
|
1722
1864
|
|
|
1723
|
-
By default `edv encrypt` emits a bare JWE. With `-d/--document` it wraps that
|
|
1865
|
+
By default `edv encrypt` emits a bare JWE. With `-d/--document` it wraps that
|
|
1866
|
+
JWE
|
|
1724
1867
|
in a full **EDV Document** envelope -- `{ id, sequence, indexed, jwe }`, the
|
|
1725
|
-
shape an EDV / WAS server stores -- written by convention to `*.edvdoc.json`.
|
|
1868
|
+
shape an EDV / WAS server stores -- written by convention to `*.edvdoc.json`.
|
|
1869
|
+
The
|
|
1726
1870
|
input is encrypted as the document's `content`; an optional `--meta <json>`
|
|
1727
1871
|
object is encrypted alongside it (both live inside the `jwe`, so only `id`,
|
|
1728
1872
|
`sequence`, and `indexed` stay in cleartext). The `id` is a fresh
|
|
@@ -1759,19 +1903,24 @@ require an envelope and reject a bare JWE.
|
|
|
1759
1903
|
|
|
1760
1904
|
For large inputs, `-s/--stream` encrypts the bytes as a sequence of fixed-size
|
|
1761
1905
|
chunks rather than one JWE. The output is a **bundle directory** (convention
|
|
1762
|
-
`*.edvdoc/`, so `-o` is required) holding `document.json` -- an EDV Document
|
|
1763
|
-
|
|
1906
|
+
`*.edvdoc/`, so `-o` is required) holding `document.json` -- an EDV Document
|
|
1907
|
+
whose
|
|
1908
|
+
cleartext `stream: { sequence, chunks }` descriptor records the chunk count --
|
|
1909
|
+
and
|
|
1764
1910
|
one `chunks/<index>.jwe.json` per chunk. This mirrors how an EDV / WAS server
|
|
1765
1911
|
stores stream bytes as resources separate from the document. `--chunk-size
|
|
1766
|
-
<bytes>` sets the chunk size (default 1 MiB); `--meta` and `--update` work as
|
|
1912
|
+
<bytes>` sets the chunk size (default 1 MiB); `--meta` and `--update` work as
|
|
1913
|
+
for
|
|
1767
1914
|
`--document`.
|
|
1768
1915
|
|
|
1769
1916
|
```
|
|
1770
1917
|
./di edv encrypt photo.png --stream -r alice-kak --chunk-size 1048576 -o photo.edvdoc/
|
|
1771
1918
|
```
|
|
1772
1919
|
|
|
1773
|
-
`edv decrypt` recognizes a bundle directory, reassembles the chunks in order,
|
|
1774
|
-
|
|
1920
|
+
`edv decrypt` recognizes a bundle directory, reassembles the chunks in order,
|
|
1921
|
+
and
|
|
1922
|
+
writes the original bytes to `-o`/stdout (the document's `content`/`meta`/
|
|
1923
|
+
`stream`
|
|
1775
1924
|
are reported on stderr).
|
|
1776
1925
|
|
|
1777
1926
|
```
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared helpers for the wallet "collection" command families (`vc`, `key`,
|
|
3
|
+
* and `zcap`), whose `list` / `show` / `meta` / `remove` subcommands and
|
|
4
|
+
* metadata handling are otherwise near-identical clones. Each command file
|
|
5
|
+
* declares its collection name and supplies the per-collection projection
|
|
6
|
+
* (how to load an item, turn it into a table row / JSON object, and resolve a
|
|
7
|
+
* reference); the control flow -- plain/json/empty/table listing, the
|
|
8
|
+
* set-or-clear metadata edits, and the resolve-then-validate preamble -- lives
|
|
9
|
+
* here once.
|
|
10
|
+
*/
|
|
11
|
+
import { type ItemMetadata, type KeyMetadata } from '../storage.js';
|
|
12
|
+
import { type Column } from '../table.js';
|
|
13
|
+
/**
|
|
14
|
+
* Guards the `--handle` / `--description` metadata flags against being given
|
|
15
|
+
* without `--save`. Prints the standard message to stderr and returns false
|
|
16
|
+
* when the combination is invalid; the caller chooses the exit code.
|
|
17
|
+
*
|
|
18
|
+
* @param options {object}
|
|
19
|
+
* @param [options.save] {boolean}
|
|
20
|
+
* @param [options.handle] {string}
|
|
21
|
+
* @param [options.description] {string}
|
|
22
|
+
* @returns {boolean} true when the flags are valid.
|
|
23
|
+
*/
|
|
24
|
+
export declare function requireSaveForMetaFlags({ save, handle, description }: {
|
|
25
|
+
save?: boolean;
|
|
26
|
+
handle?: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
}): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Apply the `--handle` / `--description` set-or-clear edits to a metadata
|
|
31
|
+
* object in place: a defined non-empty value sets the field, an empty string
|
|
32
|
+
* clears it, and an undefined value leaves it untouched.
|
|
33
|
+
*
|
|
34
|
+
* @param meta {ItemMetadata} The metadata object to mutate.
|
|
35
|
+
* @param edits {object}
|
|
36
|
+
* @param [edits.handle] {string}
|
|
37
|
+
* @param [edits.description] {string}
|
|
38
|
+
* @returns {void}
|
|
39
|
+
*/
|
|
40
|
+
export declare function applyMetaEdits(meta: ItemMetadata, { handle, description }: {
|
|
41
|
+
handle?: string;
|
|
42
|
+
description?: string;
|
|
43
|
+
}): void;
|
|
44
|
+
/**
|
|
45
|
+
* Write the `.meta.json` metadata sidecar of a freshly saved wallet item: the
|
|
46
|
+
* creation timestamp plus the handle and description when given. When
|
|
47
|
+
* `mergeExisting` is set, any existing sidecar is loaded first and its fields
|
|
48
|
+
* take precedence over `created` (so re-saving an already-stored item keeps
|
|
49
|
+
* its original timestamp) -- used by `vc import` / `vc issue --save`, which may
|
|
50
|
+
* re-store a credential that is already in the wallet.
|
|
51
|
+
*
|
|
52
|
+
* @param options {object}
|
|
53
|
+
* @param options.collection {string}
|
|
54
|
+
* @param options.storageId {string}
|
|
55
|
+
* @param options.created {string}
|
|
56
|
+
* @param [options.handle] {string}
|
|
57
|
+
* @param [options.description] {string}
|
|
58
|
+
* @param [options.mergeExisting] {boolean}
|
|
59
|
+
* @returns {Promise<void>}
|
|
60
|
+
*/
|
|
61
|
+
export declare function writeCreateMeta({ collection, storageId, created, handle, description, mergeExisting }: {
|
|
62
|
+
collection: string;
|
|
63
|
+
storageId: string;
|
|
64
|
+
created: string;
|
|
65
|
+
handle?: string;
|
|
66
|
+
description?: string;
|
|
67
|
+
mergeExisting?: boolean;
|
|
68
|
+
}): Promise<void>;
|
|
69
|
+
/**
|
|
70
|
+
* Resolve a wallet item reference, reporting failures to stderr and returning
|
|
71
|
+
* undefined: prints the thrown error message on an ambiguous handle, or the
|
|
72
|
+
* standard "No locally stored <noun> found for <ref>" message when nothing
|
|
73
|
+
* matches. Collapses the resolve-then-validate preamble shared by the
|
|
74
|
+
* `show` / `meta` / `remove` subcommands; callers do `if (!resolved) return 1`.
|
|
75
|
+
*
|
|
76
|
+
* @param options {object}
|
|
77
|
+
* @param options.resolve {(ref: string) => Promise<T | undefined>}
|
|
78
|
+
* @param options.ref {string}
|
|
79
|
+
* @param options.noun {string} The item noun for the not-found message.
|
|
80
|
+
* @returns {Promise<T | undefined>}
|
|
81
|
+
*/
|
|
82
|
+
export declare function resolveRefOrReport<T>({ resolve, ref, noun }: {
|
|
83
|
+
resolve: (ref: string) => Promise<T | undefined>;
|
|
84
|
+
ref: string;
|
|
85
|
+
noun: string;
|
|
86
|
+
}): Promise<T | undefined>;
|
|
87
|
+
/**
|
|
88
|
+
* Render a wallet collection listing: one id per line with `plain`, a JSON
|
|
89
|
+
* array with `json`, an empty result as no output, otherwise a column-aligned
|
|
90
|
+
* table. Shared by `vc list`, `key list`, and `zcap list`; each caller
|
|
91
|
+
* supplies how to load an item, project it to a row / JSON object, and the
|
|
92
|
+
* table columns. A `toEntry` returning undefined drops the item from the
|
|
93
|
+
* non-plain output (e.g. an id-less zcap).
|
|
94
|
+
*
|
|
95
|
+
* @param options {object}
|
|
96
|
+
* @param options.collection {string}
|
|
97
|
+
* @param [options.plain] {boolean}
|
|
98
|
+
* @param [options.json] {boolean}
|
|
99
|
+
* @param options.plainId {(item: Item, storageId: string) => string | undefined}
|
|
100
|
+
* The id to print in `--plain` mode; undefined skips the item.
|
|
101
|
+
* @param options.toEntry {(args: {storageId: string, item: Item, meta?: KeyMetadata}) => Entry | undefined | Promise<Entry | undefined>}
|
|
102
|
+
* @param options.toJson {(entry: Entry) => object}
|
|
103
|
+
* @param options.columns {Column[]}
|
|
104
|
+
* @param options.toRow {(entry: Entry) => string[]}
|
|
105
|
+
* @returns {Promise<number>} The process exit code.
|
|
106
|
+
*/
|
|
107
|
+
export declare function runListCollection<Item, Entry>({ collection, plain, json, plainId, toEntry, toJson, columns, toRow }: {
|
|
108
|
+
collection: string;
|
|
109
|
+
plain?: boolean;
|
|
110
|
+
json?: boolean;
|
|
111
|
+
plainId: (item: Item, storageId: string) => string | undefined;
|
|
112
|
+
toEntry: (args: {
|
|
113
|
+
storageId: string;
|
|
114
|
+
item: Item;
|
|
115
|
+
meta?: KeyMetadata;
|
|
116
|
+
}) => Entry | undefined | Promise<Entry | undefined>;
|
|
117
|
+
toJson: (entry: Entry) => object;
|
|
118
|
+
columns: Column[];
|
|
119
|
+
toRow: (entry: Entry) => string[];
|
|
120
|
+
}): Promise<number>;
|
|
121
|
+
/**
|
|
122
|
+
* Show or edit the metadata of a wallet item (by id or handle): with no
|
|
123
|
+
* `--handle` / `--description` edits, prints the current metadata; otherwise
|
|
124
|
+
* applies the set-or-clear edits, saves the sidecar, and prints the result.
|
|
125
|
+
* Shared by `vc meta` and `zcap meta`. (`key meta` keeps its own runner: it
|
|
126
|
+
* additionally backfills the created date and refreshes the cached DID
|
|
127
|
+
* associations.)
|
|
128
|
+
*
|
|
129
|
+
* @param options {object}
|
|
130
|
+
* @param options.collection {string}
|
|
131
|
+
* @param options.noun {string}
|
|
132
|
+
* @param options.resolve {(ref: string) => Promise<{storageId: string, meta?: ItemMetadata} | undefined>}
|
|
133
|
+
* @param options.ref {string}
|
|
134
|
+
* @param [options.handle] {string}
|
|
135
|
+
* @param [options.description] {string}
|
|
136
|
+
* @returns {Promise<number>} The process exit code.
|
|
137
|
+
*/
|
|
138
|
+
export declare function runMetaCollection({ collection, noun, resolve, ref, handle, description }: {
|
|
139
|
+
collection: string;
|
|
140
|
+
noun: string;
|
|
141
|
+
resolve: (ref: string) => Promise<{
|
|
142
|
+
storageId: string;
|
|
143
|
+
meta?: ItemMetadata;
|
|
144
|
+
} | undefined>;
|
|
145
|
+
ref: string;
|
|
146
|
+
handle?: string;
|
|
147
|
+
description?: string;
|
|
148
|
+
}): Promise<number>;
|
|
149
|
+
/**
|
|
150
|
+
* Resolve a wallet item by reference and remove it (and its metadata sidecar),
|
|
151
|
+
* printing each removed file path to stderr. Shared by `vc remove`,
|
|
152
|
+
* `key remove`, and `zcap remove`.
|
|
153
|
+
*
|
|
154
|
+
* @param options {object}
|
|
155
|
+
* @param options.collection {string}
|
|
156
|
+
* @param options.noun {string}
|
|
157
|
+
* @param options.resolve {(ref: string) => Promise<{storageId: string} | undefined>}
|
|
158
|
+
* @param options.ref {string}
|
|
159
|
+
* @returns {Promise<number>} The process exit code.
|
|
160
|
+
*/
|
|
161
|
+
export declare function runRemoveCollection({ collection, noun, resolve, ref }: {
|
|
162
|
+
collection: string;
|
|
163
|
+
noun: string;
|
|
164
|
+
resolve: (ref: string) => Promise<{
|
|
165
|
+
storageId: string;
|
|
166
|
+
} | undefined>;
|
|
167
|
+
ref: string;
|
|
168
|
+
}): Promise<number>;
|
|
169
|
+
//# sourceMappingURL=collection-command.d.ts.map
|