@did-btcr2/cli 0.6.0 → 0.9.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/README.md +77 -24
- package/dist/.tsbuildinfo +1 -1
- package/dist/cjs/index.js +18 -10
- package/dist/esm/src/commands/deactivate.js +8 -6
- package/dist/esm/src/commands/deactivate.js.map +1 -1
- package/dist/esm/src/commands/update.js +9 -6
- package/dist/esm/src/commands/update.js.map +1 -1
- package/dist/types/src/commands/deactivate.d.ts.map +1 -1
- package/dist/types/src/commands/update.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/commands/deactivate.ts +12 -6
- package/src/commands/update.ts +13 -6
package/dist/cjs/index.js
CHANGED
|
@@ -297,11 +297,15 @@ function registerUpdateCommand(program, factory, globals) {
|
|
|
297
297
|
options
|
|
298
298
|
);
|
|
299
299
|
}
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
300
|
+
void deriveNetwork(did);
|
|
301
|
+
void factory;
|
|
302
|
+
void globals;
|
|
303
|
+
void parsed;
|
|
304
|
+
throw new CLIError(
|
|
305
|
+
"CLI signing is not yet implemented. Use @did-btcr2/api with a Signer directly.",
|
|
306
|
+
"NOT_IMPLEMENTED_ERROR",
|
|
307
|
+
{ command: "update" }
|
|
308
|
+
);
|
|
305
309
|
});
|
|
306
310
|
}
|
|
307
311
|
function parseJsonArg(flagName) {
|
|
@@ -351,11 +355,15 @@ function registerDeactivateCommand(program, factory, globals) {
|
|
|
351
355
|
options
|
|
352
356
|
);
|
|
353
357
|
}
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
358
|
+
void deriveNetwork(did);
|
|
359
|
+
void factory;
|
|
360
|
+
void globals;
|
|
361
|
+
void parsed;
|
|
362
|
+
throw new CLIError(
|
|
363
|
+
"CLI signing is not yet implemented. Use @did-btcr2/api with a Signer directly.",
|
|
364
|
+
"NOT_IMPLEMENTED_ERROR",
|
|
365
|
+
{ command: "deactivate" }
|
|
366
|
+
);
|
|
359
367
|
});
|
|
360
368
|
}
|
|
361
369
|
function parseJsonArg2(flagName) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { deriveNetwork } from '../config.js';
|
|
2
2
|
import { CLIError } from '../error.js';
|
|
3
|
-
import { formatResult } from '../output.js';
|
|
4
3
|
/** The JSON Patch that marks a DID document as permanently deactivated. */
|
|
5
4
|
const DEACTIVATION_PATCH = [{ op: 'add', path: '/deactivated', value: true }];
|
|
6
5
|
export function registerDeactivateCommand(program, factory, globals) {
|
|
@@ -24,11 +23,14 @@ export function registerDeactivateCommand(program, factory, globals) {
|
|
|
24
23
|
if (!did) {
|
|
25
24
|
throw new CLIError('Source document must contain an "id" field.', 'INVALID_ARGUMENT_ERROR', options);
|
|
26
25
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
// CLI signing is not yet wired up; deactivate uses the same update path
|
|
27
|
+
// and inherits the same gap. Drive the SDK directly with a `Signer` for now.
|
|
28
|
+
// Variables above are kept so command parsing + validation still works.
|
|
29
|
+
void deriveNetwork(did);
|
|
30
|
+
void factory;
|
|
31
|
+
void globals;
|
|
32
|
+
void parsed;
|
|
33
|
+
throw new CLIError('CLI signing is not yet implemented. Use @did-btcr2/api with a Signer directly.', 'NOT_IMPLEMENTED_ERROR', { command: 'deactivate' });
|
|
32
34
|
});
|
|
33
35
|
}
|
|
34
36
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deactivate.js","sourceRoot":"","sources":["../../../../src/commands/deactivate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAmB,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"deactivate.js","sourceRoot":"","sources":["../../../../src/commands/deactivate.ts"],"names":[],"m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O,CAAC;QACb,KAAK,OAAO,CAAC;QACb,KAAK,MAAM,CAAC;QACZ,MAAM,IAAI,QAAQ,CAChB,gFAAgF,EAChF,uBAAuB,EACvB,EAAE,OAAO,EAAE,YAAY,EAAE,CAC1B,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC;AAED;;;GAGG;AACH,SAAS,YAAY,CAAC,QAAgB;IACpC,OAAO,CAAC,KAAa,EAAW,EAAE;QAChC,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,IAAI,QAAQ,CAChB,oBAAoB,QAAQ,gCAAgC,EAC5D,wBAAwB,EACxB,EAAE,QAAQ,EAAE,KAAK,EAAE,CACpB,CAAC;QACJ,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { deriveNetwork } from '../config.js';
|
|
2
2
|
import { CLIError } from '../error.js';
|
|
3
|
-
import { formatResult } from '../output.js';
|
|
4
3
|
export function registerUpdateCommand(program, factory, globals) {
|
|
5
4
|
program
|
|
6
5
|
.command('update')
|
|
@@ -22,11 +21,15 @@ export function registerUpdateCommand(program, factory, globals) {
|
|
|
22
21
|
if (!did) {
|
|
23
22
|
throw new CLIError('Source document must contain an "id" field.', 'INVALID_ARGUMENT_ERROR', options);
|
|
24
23
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
// The CLI does not yet have a way to load signing material (keystore,
|
|
25
|
+
// KMS config, hardware wallet, etc.), so signed updates from the CLI are
|
|
26
|
+
// not yet wired up. Drive the SDK directly with a `Signer` for now.
|
|
27
|
+
// Variables above are kept so command parsing + validation still works.
|
|
28
|
+
void deriveNetwork(did);
|
|
29
|
+
void factory;
|
|
30
|
+
void globals;
|
|
31
|
+
void parsed;
|
|
32
|
+
throw new CLIError('CLI signing is not yet implemented. Use @did-btcr2/api with a Signer directly.', 'NOT_IMPLEMENTED_ERROR', { command: 'update' });
|
|
30
33
|
});
|
|
31
34
|
}
|
|
32
35
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../src/commands/update.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAmB,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../src/commands/update.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAmB,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,MAAM,UAAU,qBAAqB,CACnC,OAAiB,EACjB,OAAoB,EACpB,OAA6B;IAE7B,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,8BAA8B,CAAC;SAC3C,cAAc,CACb,8BAA8B,EAC9B,oCAAoC,EACpC,YAAY,CAAC,mBAAmB,CAAC,CAClC;SACA,cAAc,CACb,8BAA8B,EAC9B,+BAA+B,CAChC;SACA,cAAc,CACb,sBAAsB,EACtB,8CAA8C,EAC9C,YAAY,CAAC,WAAW,CAAC,CAC1B;SACA,cAAc,CACb,mCAAmC,EACnC,qCAAqC,CACtC;SACA,cAAc,CACb,wBAAwB,EACxB,4BAA4B,EAC5B,YAAY,CAAC,aAAa,CAAC,CAC5B;SACA,MAAM,CAAC,KAAK,EAAE,OAMd,EAAE,EAAE;QACH,MAAM,MAAM,GAAyB;YACnC,cAAc,EAAS,OAAO,CAAC,cAAwD;YACvF,OAAO,EAAgB,OAAO,CAAC,OAA0C;YACzE,eAAe,EAAQ,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC;YACtD,oBAAoB,EAAG,OAAO,CAAC,oBAAoB;YACnD,QAAQ,EAAe,OAAO,CAAC,QAA4C;SAC5E,CAAC;QACF,MAAM,GAAG,GAAG,MAAM,CAAC,cAAc,EAAE,EAAE,CAAC;QACtC,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,MAAM,IAAI,QAAQ,CAChB,6CAA6C,EAC7C,wBAAwB,EACxB,OAAO,CACR,CAAC;QACJ,CAAC;QACD,sEAAsE;QACtE,yEAAyE;QACzE,oEAAoE;QACpE,wEAAwE;QACxE,KAAK,aAAa,CAAC,GAAG,CAAC,CAAC;QACxB,KAAK,OAAO,CAAC;QACb,KAAK,OAAO,CAAC;QACb,KAAK,MAAM,CAAC;QACZ,MAAM,IAAI,QAAQ,CAChB,gFAAgF,EAChF,uBAAuB,EACvB,EAAE,OAAO,EAAE,QAAQ,EAAE,CACtB,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC;AAED;;;GAGG;AACH,SAAS,YAAY,CAAC,QAAgB;IACpC,OAAO,CAAC,KAAa,EAAW,EAAE;QAChC,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,IAAI,QAAQ,CAChB,oBAAoB,QAAQ,gCAAgC,EAC5D,wBAAwB,EACxB,EAAE,QAAQ,EAAE,KAAK,EAAE,CACpB,CAAC;QACJ,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deactivate.d.ts","sourceRoot":"","sources":["../../../../src/commands/deactivate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"deactivate.d.ts","sourceRoot":"","sources":["../../../../src/commands/deactivate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAE9D,OAAO,KAAK,EAAE,aAAa,EAAwB,MAAM,aAAa,CAAC;AAKvE,wBAAgB,yBAAyB,CACvC,OAAO,EAAG,OAAO,EACjB,OAAO,EAAG,UAAU,EACpB,OAAO,EAAG,MAAM,aAAa,GAC5B,IAAI,CAyDN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../../src/commands/update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../../src/commands/update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAE9D,OAAO,KAAK,EAAE,aAAa,EAAwB,MAAM,aAAa,CAAC;AAEvE,wBAAgB,qBAAqB,CACnC,OAAO,EAAG,OAAO,EACjB,OAAO,EAAG,UAAU,EACpB,OAAO,EAAG,MAAM,aAAa,GAC5B,IAAI,CA+DN"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@did-btcr2/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "CLI for interacting with did-btcr2-js, the JavaScript/TypeScript reference implementation of the did:btcr2 method. Exposes various parts of multiple packages in the did-btcr2-js monorepo.",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
@@ -58,10 +58,10 @@
|
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@web5/dids": "^1.2.0",
|
|
60
60
|
"commander": "^13.1.0",
|
|
61
|
-
"@did-btcr2/api": "^0.
|
|
62
|
-
"@did-btcr2/
|
|
63
|
-
"@did-btcr2/
|
|
64
|
-
"@did-btcr2/
|
|
61
|
+
"@did-btcr2/api": "^0.8.0",
|
|
62
|
+
"@did-btcr2/common": "^9.1.0",
|
|
63
|
+
"@did-btcr2/cryptosuite": "^8.0.0",
|
|
64
|
+
"@did-btcr2/method": "^0.33.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@eslint/js": "^9.21.0",
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Command } from 'commander';
|
|
2
2
|
import { deriveNetwork, type ApiFactory } from '../config.js';
|
|
3
3
|
import { CLIError } from '../error.js';
|
|
4
|
-
import { formatResult } from '../output.js';
|
|
5
4
|
import type { GlobalOptions, UpdateCommandOptions } from '../types.js';
|
|
6
5
|
|
|
7
6
|
/** The JSON Patch that marks a DID document as permanently deactivated. */
|
|
@@ -55,11 +54,18 @@ export function registerDeactivateCommand(
|
|
|
55
54
|
options
|
|
56
55
|
);
|
|
57
56
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
// CLI signing is not yet wired up; deactivate uses the same update path
|
|
58
|
+
// and inherits the same gap. Drive the SDK directly with a `Signer` for now.
|
|
59
|
+
// Variables above are kept so command parsing + validation still works.
|
|
60
|
+
void deriveNetwork(did);
|
|
61
|
+
void factory;
|
|
62
|
+
void globals;
|
|
63
|
+
void parsed;
|
|
64
|
+
throw new CLIError(
|
|
65
|
+
'CLI signing is not yet implemented. Use @did-btcr2/api with a Signer directly.',
|
|
66
|
+
'NOT_IMPLEMENTED_ERROR',
|
|
67
|
+
{ command: 'deactivate' }
|
|
68
|
+
);
|
|
63
69
|
});
|
|
64
70
|
}
|
|
65
71
|
|
package/src/commands/update.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Command } from 'commander';
|
|
2
2
|
import { deriveNetwork, type ApiFactory } from '../config.js';
|
|
3
3
|
import { CLIError } from '../error.js';
|
|
4
|
-
import { formatResult } from '../output.js';
|
|
5
4
|
import type { GlobalOptions, UpdateCommandOptions } from '../types.js';
|
|
6
5
|
|
|
7
6
|
export function registerUpdateCommand(
|
|
@@ -57,11 +56,19 @@ export function registerUpdateCommand(
|
|
|
57
56
|
options
|
|
58
57
|
);
|
|
59
58
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
// The CLI does not yet have a way to load signing material (keystore,
|
|
60
|
+
// KMS config, hardware wallet, etc.), so signed updates from the CLI are
|
|
61
|
+
// not yet wired up. Drive the SDK directly with a `Signer` for now.
|
|
62
|
+
// Variables above are kept so command parsing + validation still works.
|
|
63
|
+
void deriveNetwork(did);
|
|
64
|
+
void factory;
|
|
65
|
+
void globals;
|
|
66
|
+
void parsed;
|
|
67
|
+
throw new CLIError(
|
|
68
|
+
'CLI signing is not yet implemented. Use @did-btcr2/api with a Signer directly.',
|
|
69
|
+
'NOT_IMPLEMENTED_ERROR',
|
|
70
|
+
{ command: 'update' }
|
|
71
|
+
);
|
|
65
72
|
});
|
|
66
73
|
}
|
|
67
74
|
|