@twin.org/identity-cli 0.0.1-next.25 → 0.0.1-next.26
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 +8 -5
- package/dist/esm/index.mjs +8 -5
- package/docs/changelog.md +1 -1
- package/package.json +4 -4
package/dist/cjs/index.cjs
CHANGED
|
@@ -14,8 +14,8 @@ var entityStorageConnectorMemory = require('@twin.org/entity-storage-connector-m
|
|
|
14
14
|
var entityStorageModels = require('@twin.org/entity-storage-models');
|
|
15
15
|
var identityConnectorIota = require('@twin.org/identity-connector-iota');
|
|
16
16
|
var vaultConnectorEntityStorage = require('@twin.org/vault-connector-entity-storage');
|
|
17
|
-
var standardsW3cDid = require('@twin.org/standards-w3c-did');
|
|
18
17
|
var identityModels = require('@twin.org/identity-models');
|
|
18
|
+
var standardsW3cDid = require('@twin.org/standards-w3c-did');
|
|
19
19
|
|
|
20
20
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
21
21
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -309,8 +309,9 @@ async function actionCommandProofCreate(opts) {
|
|
|
309
309
|
cliCore.CLIDisplay.break();
|
|
310
310
|
setupVault();
|
|
311
311
|
const localIdentity = "local";
|
|
312
|
+
const vmParts = identityModels.DocumentHelper.parseId(id);
|
|
312
313
|
const vaultConnector = vaultModels.VaultConnectorFactory.get("vault");
|
|
313
|
-
await vaultConnector.addKey(`${localIdentity}/${
|
|
314
|
+
await vaultConnector.addKey(`${localIdentity}/${vmParts.fragment}`, vaultModels.VaultKeyType.Ed25519, privateKey, new Uint8Array());
|
|
314
315
|
const walletConnector = walletCli.setupWalletConnector({ nodeEndpoint, network }, opts.connector);
|
|
315
316
|
walletModels.WalletConnectorFactory.register("wallet", () => walletConnector);
|
|
316
317
|
const identityConnector = setupIdentityConnector({ nodeEndpoint, network }, opts.connector);
|
|
@@ -656,8 +657,9 @@ async function actionCommandVerifiableCredentialCreate(opts) {
|
|
|
656
657
|
cliCore.CLIDisplay.break();
|
|
657
658
|
setupVault();
|
|
658
659
|
const localIdentity = "local";
|
|
660
|
+
const vmParts = identityModels.DocumentHelper.parseId(id);
|
|
659
661
|
const vaultConnector = vaultModels.VaultConnectorFactory.get("vault");
|
|
660
|
-
await vaultConnector.addKey(`${localIdentity}/${
|
|
662
|
+
await vaultConnector.addKey(`${localIdentity}/${vmParts.fragment}`, vaultModels.VaultKeyType.Ed25519, privateKey, new Uint8Array());
|
|
661
663
|
const walletConnector = walletCli.setupWalletConnector({ nodeEndpoint, network }, opts.connector);
|
|
662
664
|
walletModels.WalletConnectorFactory.register("wallet", () => walletConnector);
|
|
663
665
|
const identityConnector = setupIdentityConnector({ nodeEndpoint, network }, opts.connector);
|
|
@@ -972,7 +974,8 @@ async function actionCommandVerificationMethodAdd(opts) {
|
|
|
972
974
|
cliCore.CLIDisplay.spinnerStart();
|
|
973
975
|
const verificationMethod = await identityConnector.addVerificationMethod(localIdentity, did, type, opts?.id);
|
|
974
976
|
cliCore.CLIDisplay.spinnerStop();
|
|
975
|
-
const
|
|
977
|
+
const keyParts = identityModels.DocumentHelper.parseId(verificationMethod.id);
|
|
978
|
+
const keyPair = await vaultConnector.getKey(`${localIdentity}/${keyParts.fragment}`);
|
|
976
979
|
const privateKey = core.Converter.bytesToBase64(keyPair.privateKey);
|
|
977
980
|
const publicKey = core.Is.uint8Array(keyPair.publicKey)
|
|
978
981
|
? core.Converter.bytesToBase64(keyPair.publicKey)
|
|
@@ -1090,7 +1093,7 @@ class CLI extends cliCore.CLIBase {
|
|
|
1090
1093
|
return this.execute({
|
|
1091
1094
|
title: "TWIN Identity",
|
|
1092
1095
|
appName: "twin-identity",
|
|
1093
|
-
version: "0.0.1-next.
|
|
1096
|
+
version: "0.0.1-next.26",
|
|
1094
1097
|
icon: "🌍",
|
|
1095
1098
|
supportsEnvFiles: true,
|
|
1096
1099
|
overrideOutputWidth: options?.overrideOutputWidth
|
package/dist/esm/index.mjs
CHANGED
|
@@ -12,8 +12,8 @@ import { MemoryEntityStorageConnector } from '@twin.org/entity-storage-connector
|
|
|
12
12
|
import { EntityStorageConnectorFactory } from '@twin.org/entity-storage-models';
|
|
13
13
|
import { IotaIdentityConnector } from '@twin.org/identity-connector-iota';
|
|
14
14
|
import { initSchema, EntityStorageVaultConnector } from '@twin.org/vault-connector-entity-storage';
|
|
15
|
-
import { DidTypes, DidContexts, DidVerificationMethodType } from '@twin.org/standards-w3c-did';
|
|
16
15
|
import { DocumentHelper } from '@twin.org/identity-models';
|
|
16
|
+
import { DidTypes, DidContexts, DidVerificationMethodType } from '@twin.org/standards-w3c-did';
|
|
17
17
|
|
|
18
18
|
// Copyright 2024 IOTA Stiftung.
|
|
19
19
|
// SPDX-License-Identifier: Apache-2.0.
|
|
@@ -306,8 +306,9 @@ async function actionCommandProofCreate(opts) {
|
|
|
306
306
|
CLIDisplay.break();
|
|
307
307
|
setupVault();
|
|
308
308
|
const localIdentity = "local";
|
|
309
|
+
const vmParts = DocumentHelper.parseId(id);
|
|
309
310
|
const vaultConnector = VaultConnectorFactory.get("vault");
|
|
310
|
-
await vaultConnector.addKey(`${localIdentity}/${
|
|
311
|
+
await vaultConnector.addKey(`${localIdentity}/${vmParts.fragment}`, VaultKeyType.Ed25519, privateKey, new Uint8Array());
|
|
311
312
|
const walletConnector = setupWalletConnector({ nodeEndpoint, network }, opts.connector);
|
|
312
313
|
WalletConnectorFactory.register("wallet", () => walletConnector);
|
|
313
314
|
const identityConnector = setupIdentityConnector({ nodeEndpoint, network }, opts.connector);
|
|
@@ -653,8 +654,9 @@ async function actionCommandVerifiableCredentialCreate(opts) {
|
|
|
653
654
|
CLIDisplay.break();
|
|
654
655
|
setupVault();
|
|
655
656
|
const localIdentity = "local";
|
|
657
|
+
const vmParts = DocumentHelper.parseId(id);
|
|
656
658
|
const vaultConnector = VaultConnectorFactory.get("vault");
|
|
657
|
-
await vaultConnector.addKey(`${localIdentity}/${
|
|
659
|
+
await vaultConnector.addKey(`${localIdentity}/${vmParts.fragment}`, VaultKeyType.Ed25519, privateKey, new Uint8Array());
|
|
658
660
|
const walletConnector = setupWalletConnector({ nodeEndpoint, network }, opts.connector);
|
|
659
661
|
WalletConnectorFactory.register("wallet", () => walletConnector);
|
|
660
662
|
const identityConnector = setupIdentityConnector({ nodeEndpoint, network }, opts.connector);
|
|
@@ -969,7 +971,8 @@ async function actionCommandVerificationMethodAdd(opts) {
|
|
|
969
971
|
CLIDisplay.spinnerStart();
|
|
970
972
|
const verificationMethod = await identityConnector.addVerificationMethod(localIdentity, did, type, opts?.id);
|
|
971
973
|
CLIDisplay.spinnerStop();
|
|
972
|
-
const
|
|
974
|
+
const keyParts = DocumentHelper.parseId(verificationMethod.id);
|
|
975
|
+
const keyPair = await vaultConnector.getKey(`${localIdentity}/${keyParts.fragment}`);
|
|
973
976
|
const privateKey = Converter.bytesToBase64(keyPair.privateKey);
|
|
974
977
|
const publicKey = Is.uint8Array(keyPair.publicKey)
|
|
975
978
|
? Converter.bytesToBase64(keyPair.publicKey)
|
|
@@ -1087,7 +1090,7 @@ class CLI extends CLIBase {
|
|
|
1087
1090
|
return this.execute({
|
|
1088
1091
|
title: "TWIN Identity",
|
|
1089
1092
|
appName: "twin-identity",
|
|
1090
|
-
version: "0.0.1-next.
|
|
1093
|
+
version: "0.0.1-next.26",
|
|
1091
1094
|
icon: "🌍",
|
|
1092
1095
|
supportsEnvFiles: true,
|
|
1093
1096
|
overrideOutputWidth: options?.overrideOutputWidth
|
package/docs/changelog.md
CHANGED
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.26",
|
|
4
4
|
"description": "A command line interface for interacting with the identity connectors",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"@twin.org/data-json-ld": "next",
|
|
23
23
|
"@twin.org/entity": "next",
|
|
24
24
|
"@twin.org/entity-storage-connector-memory": "next",
|
|
25
|
-
"@twin.org/identity-connector-iota": "0.0.1-next.
|
|
26
|
-
"@twin.org/identity-connector-iota-stardust": "0.0.1-next.
|
|
27
|
-
"@twin.org/identity-models": "0.0.1-next.
|
|
25
|
+
"@twin.org/identity-connector-iota": "0.0.1-next.26",
|
|
26
|
+
"@twin.org/identity-connector-iota-stardust": "0.0.1-next.26",
|
|
27
|
+
"@twin.org/identity-models": "0.0.1-next.26",
|
|
28
28
|
"@twin.org/nameof": "next",
|
|
29
29
|
"@twin.org/standards-w3c-did": "next",
|
|
30
30
|
"@twin.org/vault-connector-entity-storage": "next",
|