@twin.org/identity-cli 0.0.1-next.48 → 0.0.1-next.50
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/cjs/index.cjs +21 -9
- package/dist/esm/index.mjs +21 -9
- package/dist/locales/en.json +8 -3
- package/docs/changelog.md +30 -0
- package/locales/en.json +4 -2
- package/package.json +4 -3
package/dist/cjs/index.cjs
CHANGED
|
@@ -15,6 +15,7 @@ var identityConnectorIota = require('@twin.org/identity-connector-iota');
|
|
|
15
15
|
var vaultConnectorEntityStorage = require('@twin.org/vault-connector-entity-storage');
|
|
16
16
|
var identityModels = require('@twin.org/identity-models');
|
|
17
17
|
var standardsW3cDid = require('@twin.org/standards-w3c-did');
|
|
18
|
+
var web = require('@twin.org/web');
|
|
18
19
|
|
|
19
20
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
20
21
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -1004,24 +1005,35 @@ async function actionCommandVerificationMethodAdd(opts) {
|
|
|
1004
1005
|
cliCore.CLIDisplay.spinnerStop();
|
|
1005
1006
|
const keyParts = identityModels.DocumentHelper.parseId(verificationMethod.id);
|
|
1006
1007
|
const keyPair = await vaultConnector.getKey(`${localIdentity}/${keyParts.fragment}`);
|
|
1007
|
-
const
|
|
1008
|
-
const
|
|
1009
|
-
? core.Converter.
|
|
1008
|
+
const privateKeyBase64 = core.Converter.bytesToBase64Url(keyPair.privateKey);
|
|
1009
|
+
const publicKeyBase64 = core.Is.uint8Array(keyPair.publicKey)
|
|
1010
|
+
? core.Converter.bytesToBase64Url(keyPair.publicKey)
|
|
1011
|
+
: "";
|
|
1012
|
+
const privateKeyHex = core.Converter.bytesToHex(keyPair.privateKey, true);
|
|
1013
|
+
const publicKeyHex = core.Is.uint8Array(keyPair.publicKey)
|
|
1014
|
+
? core.Converter.bytesToHex(keyPair.publicKey, true)
|
|
1010
1015
|
: "";
|
|
1011
1016
|
if (opts.console) {
|
|
1012
1017
|
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.verification-method-add.labels.verificationMethodId"), verificationMethod.id);
|
|
1013
|
-
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.verification-method-add.labels.
|
|
1014
|
-
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.verification-method-add.labels.
|
|
1018
|
+
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.verification-method-add.labels.privateKeyBase64"), privateKeyBase64);
|
|
1019
|
+
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.verification-method-add.labels.publicKeyBase64"), publicKeyBase64);
|
|
1020
|
+
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.verification-method-add.labels.privateKeyHex"), privateKeyHex);
|
|
1021
|
+
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.verification-method-add.labels.publicKeyHex"), publicKeyHex);
|
|
1015
1022
|
cliCore.CLIDisplay.break();
|
|
1016
1023
|
}
|
|
1017
1024
|
if (core.Is.stringValue(opts?.json)) {
|
|
1018
|
-
await
|
|
1025
|
+
const jwk = await web.Jwk.fromEd25519Private(keyPair.privateKey);
|
|
1026
|
+
const kid = await web.Jwk.generateKid(jwk);
|
|
1027
|
+
await cliCore.CLIUtils.writeJsonFile(opts.json, {
|
|
1028
|
+
kid,
|
|
1029
|
+
...jwk
|
|
1030
|
+
}, opts.mergeJson);
|
|
1019
1031
|
}
|
|
1020
1032
|
if (core.Is.stringValue(opts?.env)) {
|
|
1021
1033
|
await cliCore.CLIUtils.writeEnvFile(opts.env, [
|
|
1022
1034
|
`DID_VERIFICATION_METHOD_ID="${verificationMethod.id}"`,
|
|
1023
|
-
`DID_VERIFICATION_METHOD_PRIVATE_KEY="${
|
|
1024
|
-
`DID_VERIFICATION_METHOD_PUBLIC_KEY="${
|
|
1035
|
+
`DID_VERIFICATION_METHOD_PRIVATE_KEY="${privateKeyHex}"`,
|
|
1036
|
+
`DID_VERIFICATION_METHOD_PUBLIC_KEY="${publicKeyHex}"`
|
|
1025
1037
|
], opts.mergeEnv);
|
|
1026
1038
|
}
|
|
1027
1039
|
if (opts.connector === IdentityConnectorTypes.Iota) {
|
|
@@ -1132,7 +1144,7 @@ class CLI extends cliCore.CLIBase {
|
|
|
1132
1144
|
return this.execute({
|
|
1133
1145
|
title: "TWIN Identity",
|
|
1134
1146
|
appName: "twin-identity",
|
|
1135
|
-
version: "0.0.1-next.
|
|
1147
|
+
version: "0.0.1-next.50", // x-release-please-version
|
|
1136
1148
|
icon: "🌍",
|
|
1137
1149
|
supportsEnvFiles: true,
|
|
1138
1150
|
overrideOutputWidth: options?.overrideOutputWidth
|
package/dist/esm/index.mjs
CHANGED
|
@@ -13,6 +13,7 @@ import { IotaIdentityConnector, IotaIdentityResolverConnector } from '@twin.org/
|
|
|
13
13
|
import { initSchema, EntityStorageVaultConnector } from '@twin.org/vault-connector-entity-storage';
|
|
14
14
|
import { DocumentHelper } from '@twin.org/identity-models';
|
|
15
15
|
import { ProofTypes, DidVerificationMethodType } from '@twin.org/standards-w3c-did';
|
|
16
|
+
import { Jwk } from '@twin.org/web';
|
|
16
17
|
|
|
17
18
|
// Copyright 2024 IOTA Stiftung.
|
|
18
19
|
// SPDX-License-Identifier: Apache-2.0.
|
|
@@ -1001,24 +1002,35 @@ async function actionCommandVerificationMethodAdd(opts) {
|
|
|
1001
1002
|
CLIDisplay.spinnerStop();
|
|
1002
1003
|
const keyParts = DocumentHelper.parseId(verificationMethod.id);
|
|
1003
1004
|
const keyPair = await vaultConnector.getKey(`${localIdentity}/${keyParts.fragment}`);
|
|
1004
|
-
const
|
|
1005
|
-
const
|
|
1006
|
-
? Converter.
|
|
1005
|
+
const privateKeyBase64 = Converter.bytesToBase64Url(keyPair.privateKey);
|
|
1006
|
+
const publicKeyBase64 = Is.uint8Array(keyPair.publicKey)
|
|
1007
|
+
? Converter.bytesToBase64Url(keyPair.publicKey)
|
|
1008
|
+
: "";
|
|
1009
|
+
const privateKeyHex = Converter.bytesToHex(keyPair.privateKey, true);
|
|
1010
|
+
const publicKeyHex = Is.uint8Array(keyPair.publicKey)
|
|
1011
|
+
? Converter.bytesToHex(keyPair.publicKey, true)
|
|
1007
1012
|
: "";
|
|
1008
1013
|
if (opts.console) {
|
|
1009
1014
|
CLIDisplay.value(I18n.formatMessage("commands.verification-method-add.labels.verificationMethodId"), verificationMethod.id);
|
|
1010
|
-
CLIDisplay.value(I18n.formatMessage("commands.verification-method-add.labels.
|
|
1011
|
-
CLIDisplay.value(I18n.formatMessage("commands.verification-method-add.labels.
|
|
1015
|
+
CLIDisplay.value(I18n.formatMessage("commands.verification-method-add.labels.privateKeyBase64"), privateKeyBase64);
|
|
1016
|
+
CLIDisplay.value(I18n.formatMessage("commands.verification-method-add.labels.publicKeyBase64"), publicKeyBase64);
|
|
1017
|
+
CLIDisplay.value(I18n.formatMessage("commands.verification-method-add.labels.privateKeyHex"), privateKeyHex);
|
|
1018
|
+
CLIDisplay.value(I18n.formatMessage("commands.verification-method-add.labels.publicKeyHex"), publicKeyHex);
|
|
1012
1019
|
CLIDisplay.break();
|
|
1013
1020
|
}
|
|
1014
1021
|
if (Is.stringValue(opts?.json)) {
|
|
1015
|
-
await
|
|
1022
|
+
const jwk = await Jwk.fromEd25519Private(keyPair.privateKey);
|
|
1023
|
+
const kid = await Jwk.generateKid(jwk);
|
|
1024
|
+
await CLIUtils.writeJsonFile(opts.json, {
|
|
1025
|
+
kid,
|
|
1026
|
+
...jwk
|
|
1027
|
+
}, opts.mergeJson);
|
|
1016
1028
|
}
|
|
1017
1029
|
if (Is.stringValue(opts?.env)) {
|
|
1018
1030
|
await CLIUtils.writeEnvFile(opts.env, [
|
|
1019
1031
|
`DID_VERIFICATION_METHOD_ID="${verificationMethod.id}"`,
|
|
1020
|
-
`DID_VERIFICATION_METHOD_PRIVATE_KEY="${
|
|
1021
|
-
`DID_VERIFICATION_METHOD_PUBLIC_KEY="${
|
|
1032
|
+
`DID_VERIFICATION_METHOD_PRIVATE_KEY="${privateKeyHex}"`,
|
|
1033
|
+
`DID_VERIFICATION_METHOD_PUBLIC_KEY="${publicKeyHex}"`
|
|
1022
1034
|
], opts.mergeEnv);
|
|
1023
1035
|
}
|
|
1024
1036
|
if (opts.connector === IdentityConnectorTypes.Iota) {
|
|
@@ -1129,7 +1141,7 @@ class CLI extends CLIBase {
|
|
|
1129
1141
|
return this.execute({
|
|
1130
1142
|
title: "TWIN Identity",
|
|
1131
1143
|
appName: "twin-identity",
|
|
1132
|
-
version: "0.0.1-next.
|
|
1144
|
+
version: "0.0.1-next.50", // x-release-please-version
|
|
1133
1145
|
icon: "🌍",
|
|
1134
1146
|
supportsEnvFiles: true,
|
|
1135
1147
|
overrideOutputWidth: options?.overrideOutputWidth
|
package/dist/locales/en.json
CHANGED
|
@@ -300,7 +300,10 @@
|
|
|
300
300
|
"packageObjectError": "Failed to fetch the package object \"{packageId}\"",
|
|
301
301
|
"valueTransactionFailed": "The value transaction failed",
|
|
302
302
|
"transactionFailed": "The transaction failed",
|
|
303
|
-
"addressNotFound": "The address is missing could not be found from the seed \"{address}\""
|
|
303
|
+
"addressNotFound": "The address is missing could not be found from the seed \"{address}\"",
|
|
304
|
+
"gasStationTransactionFailed": "The gas station transaction failed",
|
|
305
|
+
"gasReservationFailed": "The gas reservation failed",
|
|
306
|
+
"gasStationExecutionFailed": "The gas station execution failed"
|
|
304
307
|
},
|
|
305
308
|
"vaultConnectorHelper": {
|
|
306
309
|
"invalidSignature": "The JSON Web token signature could not be verified"
|
|
@@ -619,8 +622,10 @@
|
|
|
619
622
|
"labels": {
|
|
620
623
|
"verificationMethodType": "Verification Method Type",
|
|
621
624
|
"verificationMethodId": "Verification Method Id",
|
|
622
|
-
"
|
|
623
|
-
"
|
|
625
|
+
"privateKeyBase64": "Private Key Base64",
|
|
626
|
+
"publicKeyBase64": "Public Key Base64",
|
|
627
|
+
"privateKeyHex": "Private Key Hex",
|
|
628
|
+
"publicKeyHex": "Public Key Hex"
|
|
624
629
|
}
|
|
625
630
|
},
|
|
626
631
|
"verification-method-remove": {
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @twin.org/identity-cli - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.1-next.50](https://github.com/twinfoundation/identity/compare/identity-cli-v0.0.1-next.49...identity-cli-v0.0.1-next.50) (2025-06-19)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* use new generateKid method ([f0fe779](https://github.com/twinfoundation/identity/commit/f0fe779323b675575bb9f80aa74f1957dc57a094))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/identity-models bumped from 0.0.1-next.49 to 0.0.1-next.50
|
|
16
|
+
* @twin.org/identity-connector-iota bumped from 0.0.1-next.49 to 0.0.1-next.50
|
|
17
|
+
|
|
18
|
+
## [0.0.1-next.49](https://github.com/twinfoundation/identity/compare/identity-cli-v0.0.1-next.48...identity-cli-v0.0.1-next.49) (2025-06-18)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* verification method output JWK and hex on CLI ([49db9da](https://github.com/twinfoundation/identity/commit/49db9da2371eafdcd7176ce44303961b9b8b8380))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Dependencies
|
|
27
|
+
|
|
28
|
+
* The following workspace dependencies were updated
|
|
29
|
+
* dependencies
|
|
30
|
+
* @twin.org/identity-models bumped from 0.0.1-next.48 to 0.0.1-next.49
|
|
31
|
+
* @twin.org/identity-connector-iota bumped from 0.0.1-next.48 to 0.0.1-next.49
|
|
32
|
+
|
|
3
33
|
## [0.0.1-next.48](https://github.com/twinfoundation/identity/compare/identity-cli-v0.0.1-next.47...identity-cli-v0.0.1-next.48) (2025-06-17)
|
|
4
34
|
|
|
5
35
|
|
package/locales/en.json
CHANGED
|
@@ -75,8 +75,10 @@
|
|
|
75
75
|
"labels": {
|
|
76
76
|
"verificationMethodType": "Verification Method Type",
|
|
77
77
|
"verificationMethodId": "Verification Method Id",
|
|
78
|
-
"
|
|
79
|
-
"
|
|
78
|
+
"privateKeyBase64": "Private Key Base64",
|
|
79
|
+
"publicKeyBase64": "Public Key Base64",
|
|
80
|
+
"privateKeyHex": "Private Key Hex",
|
|
81
|
+
"publicKeyHex": "Public Key Hex"
|
|
80
82
|
}
|
|
81
83
|
},
|
|
82
84
|
"verification-method-remove": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/identity-cli",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.50",
|
|
4
4
|
"description": "A command line interface for interacting with the identity connectors",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"@twin.org/data-json-ld": "next",
|
|
22
22
|
"@twin.org/entity": "next",
|
|
23
23
|
"@twin.org/entity-storage-connector-memory": "next",
|
|
24
|
-
"@twin.org/identity-connector-iota": "0.0.1-next.
|
|
25
|
-
"@twin.org/identity-models": "0.0.1-next.
|
|
24
|
+
"@twin.org/identity-connector-iota": "0.0.1-next.50",
|
|
25
|
+
"@twin.org/identity-models": "0.0.1-next.50",
|
|
26
26
|
"@twin.org/nameof": "next",
|
|
27
27
|
"@twin.org/standards-w3c-did": "next",
|
|
28
28
|
"@twin.org/vault-connector-entity-storage": "next",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"@twin.org/wallet-cli": "next",
|
|
31
31
|
"@twin.org/wallet-connector-iota": "next",
|
|
32
32
|
"@twin.org/wallet-models": "next",
|
|
33
|
+
"@twin.org/web": "next",
|
|
33
34
|
"commander": "14.0.0"
|
|
34
35
|
},
|
|
35
36
|
"main": "./dist/cjs/index.cjs",
|