@twin.org/identity-cli 0.0.1-next.47 → 0.0.1-next.49
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 +16 -9
- package/dist/esm/index.mjs +16 -9
- package/dist/locales/en.json +4 -2
- package/docs/changelog.md +30 -0
- package/docs/examples.md +1 -1
- 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,30 @@ 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 cliCore.CLIUtils.writeJsonFile(opts.json,
|
|
1025
|
+
await cliCore.CLIUtils.writeJsonFile(opts.json, await web.Jwk.fromEd25519Private(keyPair.privateKey), opts.mergeJson);
|
|
1019
1026
|
}
|
|
1020
1027
|
if (core.Is.stringValue(opts?.env)) {
|
|
1021
1028
|
await cliCore.CLIUtils.writeEnvFile(opts.env, [
|
|
1022
1029
|
`DID_VERIFICATION_METHOD_ID="${verificationMethod.id}"`,
|
|
1023
|
-
`DID_VERIFICATION_METHOD_PRIVATE_KEY="${
|
|
1024
|
-
`DID_VERIFICATION_METHOD_PUBLIC_KEY="${
|
|
1030
|
+
`DID_VERIFICATION_METHOD_PRIVATE_KEY="${privateKeyHex}"`,
|
|
1031
|
+
`DID_VERIFICATION_METHOD_PUBLIC_KEY="${publicKeyHex}"`
|
|
1025
1032
|
], opts.mergeEnv);
|
|
1026
1033
|
}
|
|
1027
1034
|
if (opts.connector === IdentityConnectorTypes.Iota) {
|
|
@@ -1132,7 +1139,7 @@ class CLI extends cliCore.CLIBase {
|
|
|
1132
1139
|
return this.execute({
|
|
1133
1140
|
title: "TWIN Identity",
|
|
1134
1141
|
appName: "twin-identity",
|
|
1135
|
-
version: "0.0.1-next.
|
|
1142
|
+
version: "0.0.1-next.49", // x-release-please-version
|
|
1136
1143
|
icon: "🌍",
|
|
1137
1144
|
supportsEnvFiles: true,
|
|
1138
1145
|
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,30 @@ 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 CLIUtils.writeJsonFile(opts.json,
|
|
1022
|
+
await CLIUtils.writeJsonFile(opts.json, await Jwk.fromEd25519Private(keyPair.privateKey), opts.mergeJson);
|
|
1016
1023
|
}
|
|
1017
1024
|
if (Is.stringValue(opts?.env)) {
|
|
1018
1025
|
await CLIUtils.writeEnvFile(opts.env, [
|
|
1019
1026
|
`DID_VERIFICATION_METHOD_ID="${verificationMethod.id}"`,
|
|
1020
|
-
`DID_VERIFICATION_METHOD_PRIVATE_KEY="${
|
|
1021
|
-
`DID_VERIFICATION_METHOD_PUBLIC_KEY="${
|
|
1027
|
+
`DID_VERIFICATION_METHOD_PRIVATE_KEY="${privateKeyHex}"`,
|
|
1028
|
+
`DID_VERIFICATION_METHOD_PUBLIC_KEY="${publicKeyHex}"`
|
|
1022
1029
|
], opts.mergeEnv);
|
|
1023
1030
|
}
|
|
1024
1031
|
if (opts.connector === IdentityConnectorTypes.Iota) {
|
|
@@ -1129,7 +1136,7 @@ class CLI extends CLIBase {
|
|
|
1129
1136
|
return this.execute({
|
|
1130
1137
|
title: "TWIN Identity",
|
|
1131
1138
|
appName: "twin-identity",
|
|
1132
|
-
version: "0.0.1-next.
|
|
1139
|
+
version: "0.0.1-next.49", // x-release-please-version
|
|
1133
1140
|
icon: "🌍",
|
|
1134
1141
|
supportsEnvFiles: true,
|
|
1135
1142
|
overrideOutputWidth: options?.overrideOutputWidth
|
package/dist/locales/en.json
CHANGED
|
@@ -619,8 +619,10 @@
|
|
|
619
619
|
"labels": {
|
|
620
620
|
"verificationMethodType": "Verification Method Type",
|
|
621
621
|
"verificationMethodId": "Verification Method Id",
|
|
622
|
-
"
|
|
623
|
-
"
|
|
622
|
+
"privateKeyBase64": "Private Key Base64",
|
|
623
|
+
"publicKeyBase64": "Public Key Base64",
|
|
624
|
+
"privateKeyHex": "Private Key Hex",
|
|
625
|
+
"publicKeyHex": "Public Key Hex"
|
|
624
626
|
}
|
|
625
627
|
},
|
|
626
628
|
"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.49](https://github.com/twinfoundation/identity/compare/identity-cli-v0.0.1-next.48...identity-cli-v0.0.1-next.49) (2025-06-18)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* verification method output JWK and hex on CLI ([49db9da](https://github.com/twinfoundation/identity/commit/49db9da2371eafdcd7176ce44303961b9b8b8380))
|
|
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.48 to 0.0.1-next.49
|
|
16
|
+
* @twin.org/identity-connector-iota bumped from 0.0.1-next.48 to 0.0.1-next.49
|
|
17
|
+
|
|
18
|
+
## [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)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* add mainnet support ([af56a38](https://github.com/twinfoundation/identity/commit/af56a382837896cd4e13d5814c0924c46658b99c))
|
|
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.47 to 0.0.1-next.48
|
|
31
|
+
* @twin.org/identity-connector-iota bumped from 0.0.1-next.47 to 0.0.1-next.48
|
|
32
|
+
|
|
3
33
|
## [0.0.1-next.47](https://github.com/twinfoundation/identity/compare/identity-cli-v0.0.1-next.46...identity-cli-v0.0.1-next.47) (2025-06-12)
|
|
4
34
|
|
|
5
35
|
|
package/docs/examples.md
CHANGED
|
@@ -97,7 +97,7 @@ NODE_URL="https://api.devnet.iota.cafe"
|
|
|
97
97
|
FAUCET_URL="https://faucet.devnet.iota.cafe"
|
|
98
98
|
COIN_TYPE="4218"
|
|
99
99
|
NETWORK="devnet"
|
|
100
|
-
EXPLORER_URL="https://explorer.
|
|
100
|
+
EXPLORER_URL="https://explorer.iota.org/"
|
|
101
101
|
```
|
|
102
102
|
|
|
103
103
|
To then request some funds and generate the identity you can issue the following commands:
|
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.49",
|
|
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.49",
|
|
25
|
+
"@twin.org/identity-models": "0.0.1-next.49",
|
|
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",
|