@twin.org/identity-cli 0.0.1-next.3 → 0.0.1-next.32
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 +297 -279
- package/dist/esm/index.mjs +297 -282
- package/dist/locales/en.json +908 -783
- package/dist/types/cli.d.ts +5 -1
- package/dist/types/commands/identityCreate.d.ts +6 -0
- package/dist/types/commands/identityResolve.d.ts +5 -0
- package/dist/types/commands/proofCreate.d.ts +6 -1
- package/dist/types/commands/proofVerify.d.ts +9 -7
- package/dist/types/commands/serviceAdd.d.ts +4 -0
- package/dist/types/commands/serviceRemove.d.ts +5 -0
- package/dist/types/commands/setupCommands.d.ts +18 -0
- package/dist/types/commands/verifiableCredentialCreate.d.ts +4 -4
- package/dist/types/commands/verifiableCredentialRevoke.d.ts +5 -0
- package/dist/types/commands/verifiableCredentialUnrevoke.d.ts +5 -0
- package/dist/types/commands/verifiableCredentialVerify.d.ts +4 -0
- package/dist/types/commands/verificationMethodAdd.d.ts +4 -0
- package/dist/types/commands/verificationMethodRemove.d.ts +5 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/models/identityConnectorTypes.d.ts +17 -0
- package/docs/changelog.md +1 -1
- package/docs/examples.md +15 -14
- package/docs/reference/classes/CLI.md +17 -3
- package/docs/reference/functions/actionCommandIdentityCreate.md +3 -1
- package/docs/reference/functions/actionCommandIdentityResolve.md +3 -1
- package/docs/reference/functions/actionCommandProofCreate.md +3 -1
- package/docs/reference/functions/actionCommandProofVerify.md +3 -1
- package/docs/reference/functions/actionCommandServiceAdd.md +3 -1
- package/docs/reference/functions/actionCommandServiceRemove.md +25 -5
- package/docs/reference/functions/actionCommandVerifiableCredentialCreate.md +3 -1
- package/docs/reference/functions/actionCommandVerifiableCredentialRevoke.md +25 -5
- package/docs/reference/functions/actionCommandVerifiableCredentialUnrevoke.md +25 -5
- package/docs/reference/functions/actionCommandVerifiableCredentialVerify.md +3 -1
- package/docs/reference/functions/actionCommandVerificationMethodAdd.md +3 -1
- package/docs/reference/functions/actionCommandVerificationMethodRemove.md +25 -5
- package/docs/reference/functions/setupIdentityConnector.md +47 -0
- package/docs/reference/functions/setupVault.md +9 -0
- package/docs/reference/index.md +10 -0
- package/docs/reference/type-aliases/IdentityConnectorTypes.md +5 -0
- package/docs/reference/variables/IdentityConnectorTypes.md +19 -0
- package/locales/en.json +35 -36
- package/package.json +12 -38
package/dist/types/cli.d.ts
CHANGED
|
@@ -7,7 +7,11 @@ export declare class CLI extends CLIBase {
|
|
|
7
7
|
* Run the app.
|
|
8
8
|
* @param argv The process arguments.
|
|
9
9
|
* @param localesDirectory The directory for the locales, default to relative to the script.
|
|
10
|
+
* @param options Additional options for the CLI.
|
|
11
|
+
* @param options.overrideOutputWidth The override output width.
|
|
10
12
|
* @returns The exit code.
|
|
11
13
|
*/
|
|
12
|
-
run(argv: string[], localesDirectory?: string
|
|
14
|
+
run(argv: string[], localesDirectory?: string, options?: {
|
|
15
|
+
overrideOutputWidth?: number;
|
|
16
|
+
}): Promise<number>;
|
|
13
17
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type CliOutputOptions } from "@twin.org/cli-core";
|
|
2
2
|
import { Command } from "commander";
|
|
3
|
+
import { IdentityConnectorTypes } from "../models/identityConnectorTypes";
|
|
3
4
|
/**
|
|
4
5
|
* Build the identity create command for the CLI.
|
|
5
6
|
* @returns The command.
|
|
@@ -9,11 +10,16 @@ export declare function buildCommandIdentityCreate(): Command;
|
|
|
9
10
|
* Action the identity create command.
|
|
10
11
|
* @param opts The options for the command.
|
|
11
12
|
* @param opts.seed The private key for the controller.
|
|
13
|
+
* @param opts.connector The connector to perform the operations with.
|
|
12
14
|
* @param opts.node The node URL.
|
|
15
|
+
* @param opts.network The network to use for connector.
|
|
13
16
|
* @param opts.explorer The explorer URL.
|
|
14
17
|
*/
|
|
15
18
|
export declare function actionCommandIdentityCreate(opts: {
|
|
16
19
|
seed: string;
|
|
20
|
+
connector?: IdentityConnectorTypes;
|
|
17
21
|
node: string;
|
|
22
|
+
network?: string;
|
|
18
23
|
explorer: string;
|
|
24
|
+
addressIndex?: string;
|
|
19
25
|
} & CliOutputOptions): Promise<void>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type CliOutputOptions } from "@twin.org/cli-core";
|
|
2
2
|
import { Command } from "commander";
|
|
3
|
+
import { IdentityConnectorTypes } from "../models/identityConnectorTypes";
|
|
3
4
|
/**
|
|
4
5
|
* Build the identity resolve command for the CLI.
|
|
5
6
|
* @returns The command.
|
|
@@ -9,11 +10,15 @@ export declare function buildCommandIdentityResolve(): Command;
|
|
|
9
10
|
* Action the identity resolve command.
|
|
10
11
|
* @param opts The options for the command.
|
|
11
12
|
* @param opts.did The identity to resolve.
|
|
13
|
+
* @param opts.connector The connector to perform the operations with.
|
|
12
14
|
* @param opts.node The node URL.
|
|
15
|
+
* @param opts.network The network to use for connector.
|
|
13
16
|
* @param opts.explorer The explorer URL.
|
|
14
17
|
*/
|
|
15
18
|
export declare function actionCommandIdentityResolve(opts: {
|
|
16
19
|
did: string;
|
|
20
|
+
connector?: IdentityConnectorTypes;
|
|
17
21
|
node: string;
|
|
22
|
+
network?: string;
|
|
18
23
|
explorer: string;
|
|
19
24
|
} & CliOutputOptions): Promise<void>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type CliOutputOptions } from "@twin.org/cli-core";
|
|
2
2
|
import { Command } from "commander";
|
|
3
|
+
import { IdentityConnectorTypes } from "../models/identityConnectorTypes";
|
|
3
4
|
/**
|
|
4
5
|
* Build the proof create command for the CLI.
|
|
5
6
|
* @returns The command.
|
|
@@ -11,11 +12,15 @@ export declare function buildCommandProofCreate(): Command;
|
|
|
11
12
|
* @param opts.id The id of the verification method to use for the credential.
|
|
12
13
|
* @param opts.privateKey The private key for the verification method.
|
|
13
14
|
* @param opts.data The data to create the proof for.
|
|
15
|
+
* @param opts.connector The connector to perform the operations with.
|
|
14
16
|
* @param opts.node The node URL.
|
|
17
|
+
* @param opts.network The network to use for connector.
|
|
15
18
|
*/
|
|
16
19
|
export declare function actionCommandProofCreate(opts: {
|
|
17
20
|
id: string;
|
|
18
21
|
privateKey: string;
|
|
19
|
-
|
|
22
|
+
documentFilename: string;
|
|
23
|
+
connector?: IdentityConnectorTypes;
|
|
20
24
|
node: string;
|
|
25
|
+
network?: string;
|
|
21
26
|
} & CliOutputOptions): Promise<void>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type CliOutputOptions } from "@twin.org/cli-core";
|
|
2
2
|
import { Command } from "commander";
|
|
3
|
+
import { IdentityConnectorTypes } from "../models/identityConnectorTypes";
|
|
3
4
|
/**
|
|
4
5
|
* Build the proof verify command for the CLI.
|
|
5
6
|
* @returns The command.
|
|
@@ -9,15 +10,16 @@ export declare function buildCommandProofVerify(): Command;
|
|
|
9
10
|
* Action the proof verify command.
|
|
10
11
|
* @param opts The options for the command.
|
|
11
12
|
* @param opts.id The id of the verification method to use for the credential.
|
|
12
|
-
* @param opts.
|
|
13
|
-
* @param opts.
|
|
14
|
-
* @param opts.
|
|
13
|
+
* @param opts.documentFilename The data to verify the proof for.
|
|
14
|
+
* @param opts.proofFilename The proof value.
|
|
15
|
+
* @param opts.connector The connector to perform the operations with.
|
|
15
16
|
* @param opts.node The node URL.
|
|
17
|
+
* @param opts.network The network to use for connector.
|
|
16
18
|
*/
|
|
17
19
|
export declare function actionCommandProofVerify(opts: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
value: string;
|
|
20
|
+
documentFilename: string;
|
|
21
|
+
proofFilename: string;
|
|
22
|
+
connector?: IdentityConnectorTypes;
|
|
22
23
|
node: string;
|
|
24
|
+
network?: string;
|
|
23
25
|
} & CliOutputOptions): Promise<void>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type CliOutputOptions } from "@twin.org/cli-core";
|
|
2
2
|
import { Command } from "commander";
|
|
3
|
+
import { IdentityConnectorTypes } from "../models/identityConnectorTypes";
|
|
3
4
|
/**
|
|
4
5
|
* Build the service add command for the CLI.
|
|
5
6
|
* @returns The command.
|
|
@@ -13,6 +14,7 @@ export declare function buildCommandServiceAdd(): Command;
|
|
|
13
14
|
* @param opts.id The id of the service to add.
|
|
14
15
|
* @param opts.type The type of the service to add.
|
|
15
16
|
* @param opts.endpoint The service endpoint.
|
|
17
|
+
* @param opts.connector The connector to perform the operations with.
|
|
16
18
|
* @param opts.node The node URL.
|
|
17
19
|
* @param opts.explorer The explorer URL.
|
|
18
20
|
*/
|
|
@@ -22,6 +24,8 @@ export declare function actionCommandServiceAdd(opts: {
|
|
|
22
24
|
id: string;
|
|
23
25
|
type: string;
|
|
24
26
|
endpoint: string;
|
|
27
|
+
connector?: IdentityConnectorTypes;
|
|
25
28
|
node: string;
|
|
29
|
+
network?: string;
|
|
26
30
|
explorer: string;
|
|
27
31
|
} & CliOutputOptions): Promise<void>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
+
import { IdentityConnectorTypes } from "../models/identityConnectorTypes";
|
|
2
3
|
/**
|
|
3
4
|
* Build the service remove command for the CLI.
|
|
4
5
|
* @returns The command.
|
|
@@ -9,12 +10,16 @@ export declare function buildCommandServiceRemove(): Command;
|
|
|
9
10
|
* @param opts The options for the command.
|
|
10
11
|
* @param opts.seed The private key for the controller.
|
|
11
12
|
* @param opts.id The id of the service to remove.
|
|
13
|
+
* @param opts.connector The connector to perform the operations with.
|
|
12
14
|
* @param opts.node The node URL.
|
|
15
|
+
* @param opts.network The network to use for connector.
|
|
13
16
|
* @param opts.explorer The explorer URL.
|
|
14
17
|
*/
|
|
15
18
|
export declare function actionCommandServiceRemove(opts: {
|
|
16
19
|
seed: string;
|
|
17
20
|
id: string;
|
|
21
|
+
connector?: IdentityConnectorTypes;
|
|
18
22
|
node: string;
|
|
23
|
+
network?: string;
|
|
19
24
|
explorer: string;
|
|
20
25
|
}): Promise<void>;
|
|
@@ -1,4 +1,22 @@
|
|
|
1
|
+
import type { IIdentityConnector } from "@twin.org/identity-models";
|
|
2
|
+
import { IdentityConnectorTypes } from "../models/identityConnectorTypes";
|
|
1
3
|
/**
|
|
2
4
|
* Setup the vault for use in the CLI commands.
|
|
3
5
|
*/
|
|
4
6
|
export declare function setupVault(): void;
|
|
7
|
+
/**
|
|
8
|
+
* Setup the identity connector for use in the CLI commands.
|
|
9
|
+
* @param options The options for the identity connector.
|
|
10
|
+
* @param options.nodeEndpoint The node endpoint.
|
|
11
|
+
* @param options.network The network.
|
|
12
|
+
* @param options.addressIndex The wallet index.
|
|
13
|
+
* @param options.vaultSeedId The vault seed ID.
|
|
14
|
+
* @param connector The connector to use.
|
|
15
|
+
* @returns The identity connector.
|
|
16
|
+
*/
|
|
17
|
+
export declare function setupIdentityConnector(options: {
|
|
18
|
+
nodeEndpoint: string;
|
|
19
|
+
network?: string;
|
|
20
|
+
addressIndex?: number;
|
|
21
|
+
vaultSeedId?: string;
|
|
22
|
+
}, connector?: IdentityConnectorTypes): IIdentityConnector;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type CliOutputOptions } from "@twin.org/cli-core";
|
|
2
2
|
import { Command } from "commander";
|
|
3
|
+
import { IdentityConnectorTypes } from "../models/identityConnectorTypes";
|
|
3
4
|
/**
|
|
4
5
|
* Build the verifiable credential create command for the CLI.
|
|
5
6
|
* @returns The command.
|
|
@@ -11,19 +12,18 @@ export declare function buildCommandVerifiableCredentialCreate(): Command;
|
|
|
11
12
|
* @param opts.id The id of the verification method to use for the credential.
|
|
12
13
|
* @param opts.privateKey The private key for the verification method.
|
|
13
14
|
* @param opts.credentialId The id of the credential.
|
|
14
|
-
* @param opts.types The types for the credential.
|
|
15
15
|
* @param opts.subjectJson The JSON data for the subject.
|
|
16
|
-
* @param opts.contexts The contexts for the credential.
|
|
17
16
|
* @param opts.revocationIndex The revocation index for the credential.
|
|
17
|
+
* @param opts.connector The connector to perform the operations with.
|
|
18
18
|
* @param opts.node The node URL.
|
|
19
19
|
*/
|
|
20
20
|
export declare function actionCommandVerifiableCredentialCreate(opts: {
|
|
21
21
|
id: string;
|
|
22
22
|
privateKey: string;
|
|
23
23
|
credentialId?: string;
|
|
24
|
-
types?: string[];
|
|
25
24
|
subjectJson: string;
|
|
26
|
-
contexts?: string[];
|
|
27
25
|
revocationIndex?: string;
|
|
26
|
+
connector?: IdentityConnectorTypes;
|
|
28
27
|
node: string;
|
|
28
|
+
network?: string;
|
|
29
29
|
} & CliOutputOptions): Promise<void>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
+
import { IdentityConnectorTypes } from "../models/identityConnectorTypes";
|
|
2
3
|
/**
|
|
3
4
|
* Build the verifiable credential revoke command for the CLI.
|
|
4
5
|
* @returns The command.
|
|
@@ -10,11 +11,15 @@ export declare function buildCommandVerifiableCredentialRevoke(): Command;
|
|
|
10
11
|
* @param opts.seed The seed to generate the private key for the controller.
|
|
11
12
|
* @param opts.did The id of the document to revoke the index.
|
|
12
13
|
* @param opts.revocationIndex The revocation index for the credential.
|
|
14
|
+
* @param opts.connector The connector to perform the operations with.
|
|
13
15
|
* @param opts.node The node URL.
|
|
16
|
+
* @param opts.network The network to use for connector.
|
|
14
17
|
*/
|
|
15
18
|
export declare function actionCommandVerifiableCredentialRevoke(opts: {
|
|
16
19
|
seed: string;
|
|
17
20
|
did: string;
|
|
18
21
|
revocationIndex: string;
|
|
22
|
+
connector?: IdentityConnectorTypes;
|
|
19
23
|
node: string;
|
|
24
|
+
network?: string;
|
|
20
25
|
}): Promise<void>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
+
import { IdentityConnectorTypes } from "../models/identityConnectorTypes";
|
|
2
3
|
/**
|
|
3
4
|
* Build the verifiable credential unrevoke command for the CLI.
|
|
4
5
|
* @returns The command.
|
|
@@ -10,11 +11,15 @@ export declare function buildCommandVerifiableCredentialUnrevoke(): Command;
|
|
|
10
11
|
* @param opts.seed The seed to generate the private key for the controller.
|
|
11
12
|
* @param opts.did The id of the document to unrevoke the index.
|
|
12
13
|
* @param opts.revocationIndex The revocation index for the credential.
|
|
14
|
+
* @param opts.connector The connector to perform the operations with.
|
|
13
15
|
* @param opts.node The node URL.
|
|
16
|
+
* @param opts.network The network to use for connector.
|
|
14
17
|
*/
|
|
15
18
|
export declare function actionCommandVerifiableCredentialUnrevoke(opts: {
|
|
16
19
|
seed: string;
|
|
17
20
|
did: string;
|
|
18
21
|
revocationIndex: string;
|
|
22
|
+
connector?: IdentityConnectorTypes;
|
|
19
23
|
node: string;
|
|
24
|
+
network?: string;
|
|
20
25
|
}): Promise<void>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type CliOutputOptions } from "@twin.org/cli-core";
|
|
2
2
|
import { Command } from "commander";
|
|
3
|
+
import { IdentityConnectorTypes } from "../models/identityConnectorTypes";
|
|
3
4
|
/**
|
|
4
5
|
* Build the verifiable credential verify command for the CLI.
|
|
5
6
|
* @returns The command.
|
|
@@ -9,9 +10,12 @@ export declare function buildCommandVerifiableCredentialVerify(): Command;
|
|
|
9
10
|
* Action the verifiable credential verify command.
|
|
10
11
|
* @param opts The options for the command.
|
|
11
12
|
* @param opts.jwt The JSON web token for the verifiable credential.
|
|
13
|
+
* @param opts.connector The connector to perform the operations with.
|
|
12
14
|
* @param opts.node The node URL.
|
|
13
15
|
*/
|
|
14
16
|
export declare function actionCommandVerifiableCredentialVerify(opts: {
|
|
15
17
|
jwt: string;
|
|
18
|
+
connector?: IdentityConnectorTypes;
|
|
16
19
|
node: string;
|
|
20
|
+
network?: string;
|
|
17
21
|
} & CliOutputOptions): Promise<void>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type CliOutputOptions } from "@twin.org/cli-core";
|
|
2
2
|
import { DidVerificationMethodType } from "@twin.org/standards-w3c-did";
|
|
3
3
|
import { Command } from "commander";
|
|
4
|
+
import { IdentityConnectorTypes } from "../models/identityConnectorTypes";
|
|
4
5
|
/**
|
|
5
6
|
* Build the verification method add command for the CLI.
|
|
6
7
|
* @returns The command.
|
|
@@ -13,6 +14,7 @@ export declare function buildCommandVerificationMethodAdd(): Command;
|
|
|
13
14
|
* @param opts.did The identity of the document to add to.
|
|
14
15
|
* @param opts.type The type of the verification method to add.
|
|
15
16
|
* @param opts.id The id of the verification method to add.
|
|
17
|
+
* @param opts.connector The connector to perform the operations with.
|
|
16
18
|
* @param opts.node The node URL.
|
|
17
19
|
* @param opts.explorer The explorer URL.
|
|
18
20
|
*/
|
|
@@ -21,6 +23,8 @@ export declare function actionCommandVerificationMethodAdd(opts: {
|
|
|
21
23
|
did: string;
|
|
22
24
|
type: DidVerificationMethodType;
|
|
23
25
|
id?: string;
|
|
26
|
+
connector?: IdentityConnectorTypes;
|
|
24
27
|
node: string;
|
|
28
|
+
network?: string;
|
|
25
29
|
explorer: string;
|
|
26
30
|
} & CliOutputOptions): Promise<void>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
+
import { IdentityConnectorTypes } from "../models/identityConnectorTypes";
|
|
2
3
|
/**
|
|
3
4
|
* Build the verification method remove command for the CLI.
|
|
4
5
|
* @returns The command.
|
|
@@ -9,12 +10,16 @@ export declare function buildCommandVerificationMethodRemove(): Command;
|
|
|
9
10
|
* @param opts The options for the command.
|
|
10
11
|
* @param opts.seed The private key for the controller.
|
|
11
12
|
* @param opts.id The id of the verification method to remove.
|
|
13
|
+
* @param opts.connector The connector to perform the operations with.
|
|
12
14
|
* @param opts.node The node URL.
|
|
13
15
|
* @param opts.explorer The explorer URL.
|
|
16
|
+
* @param opts.network The network to use for connector.
|
|
14
17
|
*/
|
|
15
18
|
export declare function actionCommandVerificationMethodRemove(opts: {
|
|
16
19
|
seed: string;
|
|
17
20
|
id: string;
|
|
21
|
+
connector?: IdentityConnectorTypes;
|
|
18
22
|
node: string;
|
|
23
|
+
network?: string;
|
|
19
24
|
explorer: string;
|
|
20
25
|
}): Promise<void>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -5,9 +5,11 @@ export * from "./commands/proofCreate";
|
|
|
5
5
|
export * from "./commands/proofVerify";
|
|
6
6
|
export * from "./commands/serviceAdd";
|
|
7
7
|
export * from "./commands/serviceRemove";
|
|
8
|
+
export * from "./commands/setupCommands";
|
|
8
9
|
export * from "./commands/verifiableCredentialCreate";
|
|
9
10
|
export * from "./commands/verifiableCredentialRevoke";
|
|
10
11
|
export * from "./commands/verifiableCredentialUnrevoke";
|
|
11
12
|
export * from "./commands/verifiableCredentialVerify";
|
|
12
13
|
export * from "./commands/verificationMethodAdd";
|
|
13
14
|
export * from "./commands/verificationMethodRemove";
|
|
15
|
+
export * from "./models/identityConnectorTypes";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The identity connector types.
|
|
3
|
+
*/
|
|
4
|
+
export declare const IdentityConnectorTypes: {
|
|
5
|
+
/**
|
|
6
|
+
* IOTA.
|
|
7
|
+
*/
|
|
8
|
+
readonly Iota: "iota";
|
|
9
|
+
/**
|
|
10
|
+
* IOTA Stardust.
|
|
11
|
+
*/
|
|
12
|
+
readonly IotaStardust: "iota-stardust";
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The identity connector types.
|
|
16
|
+
*/
|
|
17
|
+
export type IdentityConnectorTypes = (typeof IdentityConnectorTypes)[keyof typeof IdentityConnectorTypes];
|
package/docs/changelog.md
CHANGED
package/docs/examples.md
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
# @twin.org/identity-cli - Examples
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Running
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
To install and run the CLI locally use the following commands:
|
|
6
6
|
|
|
7
7
|
```shell
|
|
8
|
-
npm install @twin.org/identity-cli
|
|
8
|
+
npm install @twin.org/identity-cli -g
|
|
9
|
+
twin-identity
|
|
9
10
|
```
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
or run directly using NPX:
|
|
12
13
|
|
|
13
14
|
```shell
|
|
14
|
-
twin-
|
|
15
|
+
npx "@twin.org/identity-cli"
|
|
15
16
|
```
|
|
16
17
|
|
|
17
18
|
Output
|
|
@@ -63,7 +64,7 @@ Creates a Decentralized Identifier (DID).
|
|
|
63
64
|
|
|
64
65
|
Options:
|
|
65
66
|
--seed <seed> The seed for the controller address in hex or base64 used to create the DID, or start with ! to read environment variable.
|
|
66
|
-
--
|
|
67
|
+
--address-index <index> The address index to use for the creation. (default: "0")
|
|
67
68
|
--no-console Hides the output in the console.
|
|
68
69
|
--json <filename> Creates a JSON file containing the output.
|
|
69
70
|
--merge-json If the JSON file already exists merge the data instead of overwriting.
|
|
@@ -80,7 +81,7 @@ The commands `mnemonic`, `address`, `faucet` and `transfer` are described in mor
|
|
|
80
81
|
|
|
81
82
|
### identity-create
|
|
82
83
|
|
|
83
|
-
Use this command to create a new DID, the
|
|
84
|
+
Use this command to create a new DID, the wallet address must have sufficient funds to store the identity. The seed and the funds can be generated using the `mnemonic` and `faucet` commands.
|
|
84
85
|
|
|
85
86
|
```shell
|
|
86
87
|
# Generate a seed and mnemonic and store it in the env file
|
|
@@ -100,10 +101,10 @@ EXPLORER_URL="https://explorer.iota.org/iota-testnet/"
|
|
|
100
101
|
To then request some funds and generate the identity you can issue the following commands:
|
|
101
102
|
|
|
102
103
|
```shell
|
|
103
|
-
# Fund the
|
|
104
|
-
twin-identity faucet --load-env config.env wallet.env --address !
|
|
104
|
+
# Fund the wallet address from the faucet loading the config and wallet env files
|
|
105
|
+
twin-identity faucet --load-env config.env wallet.env --address !ADDRESS_0
|
|
105
106
|
# Create an identity
|
|
106
|
-
twin-identity identity-create --load-env config.env wallet.env --seed !SEED --
|
|
107
|
+
twin-identity identity-create --load-env config.env wallet.env --seed !SEED --env identity.env
|
|
107
108
|
```
|
|
108
109
|
|
|
109
110
|
### identity-resolve
|
|
@@ -196,15 +197,15 @@ twin-identity verifiable-credential-unrevoke --load-env config.env wallet.env id
|
|
|
196
197
|
This command will generate a proof using the specified verification method.
|
|
197
198
|
|
|
198
199
|
```shell
|
|
199
|
-
twin-identity proof-create --load-env config.env verification-method.env --id !DID_VERIFICATION_METHOD_ID --private-key !DID_VERIFICATION_METHOD_PRIVATE_KEY --data
|
|
200
|
+
twin-identity proof-create --load-env config.env verification-method.env --id !DID_VERIFICATION_METHOD_ID --private-key !DID_VERIFICATION_METHOD_PRIVATE_KEY --document-filename unsecured.json --json data-proof.json
|
|
200
201
|
```
|
|
201
202
|
|
|
202
|
-
This will output the proof
|
|
203
|
+
This will output the proof.
|
|
203
204
|
|
|
204
205
|
## proof-verify
|
|
205
206
|
|
|
206
|
-
This command will verify a proof
|
|
207
|
+
This command will verify a proof for a document.
|
|
207
208
|
|
|
208
209
|
```shell
|
|
209
|
-
twin-identity proof-verify --load-env config.env verification-method.env --id !DID_VERIFICATION_METHOD_ID --
|
|
210
|
+
twin-identity proof-verify --load-env config.env verification-method.env --id !DID_VERIFICATION_METHOD_ID --document-filename unsecured.json --proof-filename data-proof.json
|
|
210
211
|
```
|
|
@@ -24,20 +24,34 @@ The main entry point for the CLI.
|
|
|
24
24
|
|
|
25
25
|
### run()
|
|
26
26
|
|
|
27
|
-
> **run**(`argv`, `localesDirectory`?): `Promise`\<`number`\>
|
|
27
|
+
> **run**(`argv`, `localesDirectory`?, `options`?): `Promise`\<`number`\>
|
|
28
28
|
|
|
29
29
|
Run the app.
|
|
30
30
|
|
|
31
31
|
#### Parameters
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
##### argv
|
|
34
|
+
|
|
35
|
+
`string`[]
|
|
34
36
|
|
|
35
37
|
The process arguments.
|
|
36
38
|
|
|
37
|
-
|
|
39
|
+
##### localesDirectory?
|
|
40
|
+
|
|
41
|
+
`string`
|
|
38
42
|
|
|
39
43
|
The directory for the locales, default to relative to the script.
|
|
40
44
|
|
|
45
|
+
##### options?
|
|
46
|
+
|
|
47
|
+
Additional options for the CLI.
|
|
48
|
+
|
|
49
|
+
###### overrideOutputWidth?
|
|
50
|
+
|
|
51
|
+
`number`
|
|
52
|
+
|
|
53
|
+
The override output width.
|
|
54
|
+
|
|
41
55
|
#### Returns
|
|
42
56
|
|
|
43
57
|
`Promise`\<`number`\>
|
|
@@ -6,7 +6,9 @@ Action the identity create command.
|
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### opts
|
|
10
|
+
|
|
11
|
+
`object` & `ICliOutputOptionsConsole` & `ICliOutputOptionsEnv` & `ICliOutputOptionsJson`
|
|
10
12
|
|
|
11
13
|
The options for the command.
|
|
12
14
|
|
|
@@ -6,7 +6,9 @@ Action the identity resolve command.
|
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### opts
|
|
10
|
+
|
|
11
|
+
`object` & `ICliOutputOptionsConsole` & `ICliOutputOptionsEnv` & `ICliOutputOptionsJson`
|
|
10
12
|
|
|
11
13
|
The options for the command.
|
|
12
14
|
|
|
@@ -6,7 +6,9 @@ Action the proof create command.
|
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### opts
|
|
10
|
+
|
|
11
|
+
`object` & `ICliOutputOptionsConsole` & `ICliOutputOptionsEnv` & `ICliOutputOptionsJson`
|
|
10
12
|
|
|
11
13
|
The options for the command.
|
|
12
14
|
|
|
@@ -6,7 +6,9 @@ Action the proof verify command.
|
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### opts
|
|
10
|
+
|
|
11
|
+
`object` & `ICliOutputOptionsConsole` & `ICliOutputOptionsEnv` & `ICliOutputOptionsJson`
|
|
10
12
|
|
|
11
13
|
The options for the command.
|
|
12
14
|
|
|
@@ -6,7 +6,9 @@ Action the service add command.
|
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### opts
|
|
10
|
+
|
|
11
|
+
`object` & `ICliOutputOptionsConsole` & `ICliOutputOptionsEnv` & `ICliOutputOptionsJson`
|
|
10
12
|
|
|
11
13
|
The options for the command.
|
|
12
14
|
|
|
@@ -6,23 +6,43 @@ Action the service remove command.
|
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### opts
|
|
10
10
|
|
|
11
11
|
The options for the command.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
#### seed
|
|
14
|
+
|
|
15
|
+
`string`
|
|
14
16
|
|
|
15
17
|
The private key for the controller.
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
#### id
|
|
20
|
+
|
|
21
|
+
`string`
|
|
18
22
|
|
|
19
23
|
The id of the service to remove.
|
|
20
24
|
|
|
21
|
-
|
|
25
|
+
#### connector?
|
|
26
|
+
|
|
27
|
+
[`IdentityConnectorTypes`](../type-aliases/IdentityConnectorTypes.md)
|
|
28
|
+
|
|
29
|
+
The connector to perform the operations with.
|
|
30
|
+
|
|
31
|
+
#### node
|
|
32
|
+
|
|
33
|
+
`string`
|
|
22
34
|
|
|
23
35
|
The node URL.
|
|
24
36
|
|
|
25
|
-
|
|
37
|
+
#### network?
|
|
38
|
+
|
|
39
|
+
`string`
|
|
40
|
+
|
|
41
|
+
The network to use for connector.
|
|
42
|
+
|
|
43
|
+
#### explorer
|
|
44
|
+
|
|
45
|
+
`string`
|
|
26
46
|
|
|
27
47
|
The explorer URL.
|
|
28
48
|
|
|
@@ -6,7 +6,9 @@ Action the verifiable credential create command.
|
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### opts
|
|
10
|
+
|
|
11
|
+
`object` & `ICliOutputOptionsConsole` & `ICliOutputOptionsEnv` & `ICliOutputOptionsJson`
|
|
10
12
|
|
|
11
13
|
The options for the command.
|
|
12
14
|
|
|
@@ -6,26 +6,46 @@ Action the verifiable credential revoke command.
|
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### opts
|
|
10
10
|
|
|
11
11
|
The options for the command.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
#### seed
|
|
14
|
+
|
|
15
|
+
`string`
|
|
14
16
|
|
|
15
17
|
The seed to generate the private key for the controller.
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
#### did
|
|
20
|
+
|
|
21
|
+
`string`
|
|
18
22
|
|
|
19
23
|
The id of the document to revoke the index.
|
|
20
24
|
|
|
21
|
-
|
|
25
|
+
#### revocationIndex
|
|
26
|
+
|
|
27
|
+
`string`
|
|
22
28
|
|
|
23
29
|
The revocation index for the credential.
|
|
24
30
|
|
|
25
|
-
|
|
31
|
+
#### connector?
|
|
32
|
+
|
|
33
|
+
[`IdentityConnectorTypes`](../type-aliases/IdentityConnectorTypes.md)
|
|
34
|
+
|
|
35
|
+
The connector to perform the operations with.
|
|
36
|
+
|
|
37
|
+
#### node
|
|
38
|
+
|
|
39
|
+
`string`
|
|
26
40
|
|
|
27
41
|
The node URL.
|
|
28
42
|
|
|
43
|
+
#### network?
|
|
44
|
+
|
|
45
|
+
`string`
|
|
46
|
+
|
|
47
|
+
The network to use for connector.
|
|
48
|
+
|
|
29
49
|
## Returns
|
|
30
50
|
|
|
31
51
|
`Promise`\<`void`\>
|