@twin.org/identity-cli 0.0.1-next.8 → 0.0.1

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.
Files changed (45) hide show
  1. package/bin/index.js +0 -0
  2. package/dist/cjs/index.cjs +361 -272
  3. package/dist/esm/index.mjs +359 -275
  4. package/dist/locales/en.json +878 -779
  5. package/dist/types/commands/identityCreate.d.ts +6 -0
  6. package/dist/types/commands/identityResolve.d.ts +5 -0
  7. package/dist/types/commands/proofCreate.d.ts +6 -1
  8. package/dist/types/commands/proofVerify.d.ts +9 -7
  9. package/dist/types/commands/serviceAdd.d.ts +4 -0
  10. package/dist/types/commands/serviceRemove.d.ts +5 -0
  11. package/dist/types/commands/setupCommands.d.ts +31 -0
  12. package/dist/types/commands/verifiableCredentialCreate.d.ts +4 -0
  13. package/dist/types/commands/verifiableCredentialRevoke.d.ts +5 -0
  14. package/dist/types/commands/verifiableCredentialUnrevoke.d.ts +5 -0
  15. package/dist/types/commands/verifiableCredentialVerify.d.ts +4 -0
  16. package/dist/types/commands/verificationMethodAdd.d.ts +4 -0
  17. package/dist/types/commands/verificationMethodRemove.d.ts +5 -0
  18. package/dist/types/index.d.ts +3 -0
  19. package/dist/types/models/identityConnectorTypes.d.ts +13 -0
  20. package/dist/types/models/identityResolverConnectorTypes.d.ts +13 -0
  21. package/docs/changelog.md +308 -1
  22. package/docs/examples.md +14 -12
  23. package/docs/reference/classes/CLI.md +14 -8
  24. package/docs/reference/functions/actionCommandIdentityCreate.md +3 -1
  25. package/docs/reference/functions/actionCommandIdentityResolve.md +3 -1
  26. package/docs/reference/functions/actionCommandProofCreate.md +3 -1
  27. package/docs/reference/functions/actionCommandProofVerify.md +3 -1
  28. package/docs/reference/functions/actionCommandServiceAdd.md +3 -1
  29. package/docs/reference/functions/actionCommandServiceRemove.md +25 -5
  30. package/docs/reference/functions/actionCommandVerifiableCredentialCreate.md +3 -1
  31. package/docs/reference/functions/actionCommandVerifiableCredentialRevoke.md +25 -5
  32. package/docs/reference/functions/actionCommandVerifiableCredentialUnrevoke.md +25 -5
  33. package/docs/reference/functions/actionCommandVerifiableCredentialVerify.md +3 -1
  34. package/docs/reference/functions/actionCommandVerificationMethodAdd.md +3 -1
  35. package/docs/reference/functions/actionCommandVerificationMethodRemove.md +25 -5
  36. package/docs/reference/functions/setupIdentityConnector.md +47 -0
  37. package/docs/reference/functions/setupIdentityResolverConnector.md +35 -0
  38. package/docs/reference/functions/setupVault.md +9 -0
  39. package/docs/reference/index.md +13 -0
  40. package/docs/reference/type-aliases/IdentityConnectorTypes.md +5 -0
  41. package/docs/reference/type-aliases/IdentityResolverConnectorTypes.md +5 -0
  42. package/docs/reference/variables/IdentityConnectorTypes.md +13 -0
  43. package/docs/reference/variables/IdentityResolverConnectorTypes.md +13 -0
  44. package/locales/en.json +39 -27
  45. package/package.json +21 -21
@@ -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
- data: string;
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.data The data to verify the proof for.
13
- * @param opts.type The type of the proof.
14
- * @param opts.value The proof value.
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
- id: string;
19
- data: string;
20
- type: string;
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,35 @@
1
+ import type { IIdentityConnector, IIdentityResolverConnector } from "@twin.org/identity-models";
2
+ import { IdentityConnectorTypes } from "../models/identityConnectorTypes";
3
+ import { IdentityResolverConnectorTypes } from "../models/identityResolverConnectorTypes";
1
4
  /**
2
5
  * Setup the vault for use in the CLI commands.
3
6
  */
4
7
  export declare function setupVault(): void;
8
+ /**
9
+ * Setup the identity connector for use in the CLI commands.
10
+ * @param options The options for the identity connector.
11
+ * @param options.nodeEndpoint The node endpoint.
12
+ * @param options.network The network.
13
+ * @param options.addressIndex The wallet index.
14
+ * @param options.vaultSeedId The vault seed ID.
15
+ * @param connector The connector to use.
16
+ * @returns The identity connector.
17
+ */
18
+ export declare function setupIdentityConnector(options: {
19
+ nodeEndpoint: string;
20
+ network?: string;
21
+ addressIndex?: number;
22
+ vaultSeedId?: string;
23
+ }, connector?: IdentityConnectorTypes): IIdentityConnector;
24
+ /**
25
+ * Setup the identity resolver connector for use in the CLI commands.
26
+ * @param options The options for the identity connector.
27
+ * @param options.nodeEndpoint The node endpoint.
28
+ * @param options.network The network.
29
+ * @param connector The connector to use.
30
+ * @returns The identity connector.
31
+ */
32
+ export declare function setupIdentityResolverConnector(options: {
33
+ nodeEndpoint: string;
34
+ network?: string;
35
+ }, connector?: IdentityResolverConnectorTypes): IIdentityResolverConnector;
@@ -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.
@@ -13,6 +14,7 @@ export declare function buildCommandVerifiableCredentialCreate(): Command;
13
14
  * @param opts.credentialId The id of the credential.
14
15
  * @param opts.subjectJson The JSON data for the subject.
15
16
  * @param opts.revocationIndex The revocation index for the credential.
17
+ * @param opts.connector The connector to perform the operations with.
16
18
  * @param opts.node The node URL.
17
19
  */
18
20
  export declare function actionCommandVerifiableCredentialCreate(opts: {
@@ -21,5 +23,7 @@ export declare function actionCommandVerifiableCredentialCreate(opts: {
21
23
  credentialId?: string;
22
24
  subjectJson: string;
23
25
  revocationIndex?: string;
26
+ connector?: IdentityConnectorTypes;
24
27
  node: string;
28
+ network?: string;
25
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>;
@@ -5,9 +5,12 @@ 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";
16
+ export * from "./models/identityResolverConnectorTypes";
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The identity connector types.
3
+ */
4
+ export declare const IdentityConnectorTypes: {
5
+ /**
6
+ * IOTA.
7
+ */
8
+ readonly Iota: "iota";
9
+ };
10
+ /**
11
+ * The identity connector types.
12
+ */
13
+ export type IdentityConnectorTypes = (typeof IdentityConnectorTypes)[keyof typeof IdentityConnectorTypes];
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The identity resolver connector types.
3
+ */
4
+ export declare const IdentityResolverConnectorTypes: {
5
+ /**
6
+ * IOTA.
7
+ */
8
+ readonly Iota: "iota";
9
+ };
10
+ /**
11
+ * The identity resolver connector types.
12
+ */
13
+ export type IdentityResolverConnectorTypes = (typeof IdentityResolverConnectorTypes)[keyof typeof IdentityResolverConnectorTypes];