@twin.org/identity-cli 0.0.1-next.20 → 0.0.1-next.22
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 +249 -226
- package/dist/esm/index.mjs +250 -230
- package/dist/locales/en.json +73 -9
- 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 +5 -0
- package/dist/types/commands/proofVerify.d.ts +5 -0
- 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 -0
- 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 +5 -5
- package/docs/reference/functions/actionCommandServiceRemove.md +12 -0
- package/docs/reference/functions/actionCommandVerifiableCredentialRevoke.md +12 -0
- package/docs/reference/functions/actionCommandVerifiableCredentialUnrevoke.md +12 -0
- package/docs/reference/functions/actionCommandVerificationMethodRemove.md +12 -0
- 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 +17 -2
- package/package.json +7 -5
package/dist/locales/en.json
CHANGED
|
@@ -199,9 +199,12 @@
|
|
|
199
199
|
"jwtDecodeFailed": "Decoding the JWT failed",
|
|
200
200
|
"jwtPayloadMissingParam": "The JWT is missing the required parameter \"{param}\""
|
|
201
201
|
},
|
|
202
|
+
"iotaIdentityResolverConnector": {
|
|
203
|
+
"documentNotFound": "The document could not be found",
|
|
204
|
+
"resolveDocumentFailed": "Resolving the document failed"
|
|
205
|
+
},
|
|
202
206
|
"iotaIdentityConnector": {
|
|
203
207
|
"createDocumentFailed": "Creating the document failed",
|
|
204
|
-
"resolveDocumentFailed": "Resolving the document failed",
|
|
205
208
|
"missingDid": "The full id including DID is required",
|
|
206
209
|
"addVerificationMethodFailed": "Adding the verification method failed",
|
|
207
210
|
"removeVerificationMethodFailed": "Removing the verification method failed",
|
|
@@ -234,6 +237,45 @@
|
|
|
234
237
|
"inclusionFailed": "The transaction generated was not included in a reasonable amount of time",
|
|
235
238
|
"insufficientFunds": "There were insufficient funds to complete the operation"
|
|
236
239
|
},
|
|
240
|
+
"iotaRebasedIdentityResolverConnector": {
|
|
241
|
+
"documentNotFound": "The document could not be found",
|
|
242
|
+
"resolveDocumentFailed": "Resolving the document failed"
|
|
243
|
+
},
|
|
244
|
+
"iotaRebasedIdentityConnector": {
|
|
245
|
+
"createDocumentFailed": "Creating the document failed",
|
|
246
|
+
"missingDid": "The full id including DID is required",
|
|
247
|
+
"addVerificationMethodFailed": "Adding the verification method failed",
|
|
248
|
+
"removeVerificationMethodFailed": "Removing the verification method failed",
|
|
249
|
+
"addServiceFailed": "Adding the service failed",
|
|
250
|
+
"removeServiceFailed": "Removing the service failed",
|
|
251
|
+
"documentNotFound": "The document could not be found",
|
|
252
|
+
"stateControllerMissing": "The state controller address is missing from the metadata",
|
|
253
|
+
"verificationMethodNotFound": "The verification method could not be found",
|
|
254
|
+
"serviceNotFound": "The service could not be found",
|
|
255
|
+
"publicKeyJwkMissing": "The verification method contains no publicKeyJwk in method \"{method}\"",
|
|
256
|
+
"verificationKeyMissing": "The verification key is missing from the vault for method \"{method}\"",
|
|
257
|
+
"createVerifiableCredentialFailed": "Creating the verifiable credential failed",
|
|
258
|
+
"checkingVerifiableCredentialFailed": "Checking the verifiable credential failed",
|
|
259
|
+
"createVerifiablePresentationFailed": "Creating the verifiable presentation failed",
|
|
260
|
+
"checkingVerifiablePresentationFailed": "Checking the verifiable presentation failed",
|
|
261
|
+
"expectingJwtCredential": "Expecting JWT credential in the presentation",
|
|
262
|
+
"keyIndexOutOfRange": "The supplied keyIndex is not in the range of the key list",
|
|
263
|
+
"createProofFailed": "Creating the signature for the data failed",
|
|
264
|
+
"methodMissing": "The verification method specified does not exist \"{method}\"",
|
|
265
|
+
"verifyProofFailed": "Verifying the signature for the data failed",
|
|
266
|
+
"revokeVerifiableCredentialsFailed": "Revoking verifiable credentials failed",
|
|
267
|
+
"unrevokeVerifiableCredentialsFailed": "Unrevoking verifiable credentials failed",
|
|
268
|
+
"inclusionFailed": "The transaction generated for the identity was not included in a reasonable amount of time",
|
|
269
|
+
"insufficientFunds": "There were insufficient funds to complete the operation",
|
|
270
|
+
"walletConnectorMissing": "The wallet connector must be available to perform this operation",
|
|
271
|
+
"proofType": "The proof type must be DataIntegrityProof, it is currently {proofType}",
|
|
272
|
+
"cryptosuite": "The proof cryptosuite must be eddsa-jcs-2022, it is currently {cryptosuite}"
|
|
273
|
+
},
|
|
274
|
+
"iotaRebased": {
|
|
275
|
+
"insufficientFunds": "There were insufficient funds to complete the operation",
|
|
276
|
+
"packageNotFoundOnNetwork": "The package \"{packageId}\" was not found on the network",
|
|
277
|
+
"packageObjectError": "Failed to fetch the package object \"{packageId}\""
|
|
278
|
+
},
|
|
237
279
|
"entityStorageVaultConnector": {
|
|
238
280
|
"keyAlreadyExists": "The key \"{existingId}\" already exists in the vault",
|
|
239
281
|
"keyNotFound": "The key \"{notFoundId}\" was not found in the vault",
|
|
@@ -249,6 +291,12 @@
|
|
|
249
291
|
"iotaFaucetConnector": {
|
|
250
292
|
"fundingFailed": "Fund the address from faucet failed",
|
|
251
293
|
"insufficientFunds": "There were insufficient funds to complete the operation"
|
|
294
|
+
},
|
|
295
|
+
"iotaRebasedWalletConnector": {
|
|
296
|
+
"transferFailed": "The wallet transfer failed."
|
|
297
|
+
},
|
|
298
|
+
"iotaRebasedFaucetConnector": {
|
|
299
|
+
"fundingFailed": "Fund the address from faucet failed"
|
|
252
300
|
}
|
|
253
301
|
},
|
|
254
302
|
"errorNames": {
|
|
@@ -349,8 +397,8 @@
|
|
|
349
397
|
}
|
|
350
398
|
},
|
|
351
399
|
"address": {
|
|
352
|
-
"summary": "Create
|
|
353
|
-
"description": "Create a number of
|
|
400
|
+
"summary": "Create addresses and keys from the seed.",
|
|
401
|
+
"description": "Create a number of addresses and their associated key pairs from the seed.",
|
|
354
402
|
"options": {
|
|
355
403
|
"seed": {
|
|
356
404
|
"param": "--seed '<'seed'>'",
|
|
@@ -366,15 +414,15 @@
|
|
|
366
414
|
},
|
|
367
415
|
"account": {
|
|
368
416
|
"param": "--account '<'number'>'",
|
|
369
|
-
"description": "The account used to generate the
|
|
417
|
+
"description": "The account used to generate the addresses."
|
|
370
418
|
},
|
|
371
419
|
"hrp": {
|
|
372
420
|
"param": "--hrp '<'hrp'>'",
|
|
373
|
-
"description": "The human readable part
|
|
421
|
+
"description": "The human readable part for the addresses if generating bech32 format."
|
|
374
422
|
},
|
|
375
423
|
"coin": {
|
|
376
424
|
"param": "--coin '<'coin'>'",
|
|
377
|
-
"description": "The coin type used to generate the
|
|
425
|
+
"description": "The coin type used to generate the addresses."
|
|
378
426
|
},
|
|
379
427
|
"key-type": {
|
|
380
428
|
"param": "--key-type '<'type'>'",
|
|
@@ -409,7 +457,7 @@
|
|
|
409
457
|
"options": {
|
|
410
458
|
"address": {
|
|
411
459
|
"param": "--address '<'address'>'",
|
|
412
|
-
"description": "The address to fill from the faucet either
|
|
460
|
+
"description": "The address to fill from the faucet either bech32 or hex format, or start with ! to read environment variable."
|
|
413
461
|
},
|
|
414
462
|
"faucet": {
|
|
415
463
|
"param": "--faucet '<'url'>'",
|
|
@@ -453,15 +501,24 @@
|
|
|
453
501
|
"transferringFunds": "Transferring"
|
|
454
502
|
},
|
|
455
503
|
"labels": {
|
|
456
|
-
"destAddress": "Destination Address"
|
|
504
|
+
"destAddress": "Destination Address",
|
|
505
|
+
"amount": "Amount"
|
|
457
506
|
}
|
|
458
507
|
},
|
|
459
508
|
"common": {
|
|
460
509
|
"options": {
|
|
510
|
+
"connector": {
|
|
511
|
+
"param": "--connector '<'connector'>'",
|
|
512
|
+
"description": "The connector to use for the identity operation."
|
|
513
|
+
},
|
|
461
514
|
"node": {
|
|
462
515
|
"param": "--node '<'url'>'",
|
|
463
516
|
"description": "The url for the node endpoint, or an environment variable name containing the url."
|
|
464
517
|
},
|
|
518
|
+
"network": {
|
|
519
|
+
"param": "--network '<'network'>'",
|
|
520
|
+
"description": "The network to use for the identity operation."
|
|
521
|
+
},
|
|
465
522
|
"explorer": {
|
|
466
523
|
"param": "--explorer '<'url'>'",
|
|
467
524
|
"description": "The url for the explorer endpoint, or an environment variable name containing the url."
|
|
@@ -473,6 +530,8 @@
|
|
|
473
530
|
"node": "Node",
|
|
474
531
|
"explorer": "Explorer",
|
|
475
532
|
"explore": "Explore",
|
|
533
|
+
"connector": "Connector",
|
|
534
|
+
"network": "Network",
|
|
476
535
|
"did": "DID"
|
|
477
536
|
}
|
|
478
537
|
},
|
|
@@ -483,13 +542,18 @@
|
|
|
483
542
|
"seed": {
|
|
484
543
|
"param": "--seed '<'seed'>'",
|
|
485
544
|
"description": "The seed for the controller address in hex or base64 used to create the DID, or start with ! to read environment variable."
|
|
545
|
+
},
|
|
546
|
+
"addressIndex": {
|
|
547
|
+
"param": "--address-index '<'index'>'",
|
|
548
|
+
"description": "The address index to use for the creation."
|
|
486
549
|
}
|
|
487
550
|
},
|
|
488
551
|
"progress": {
|
|
489
552
|
"creatingIdentity": "Creating identity"
|
|
490
553
|
},
|
|
491
554
|
"labels": {
|
|
492
|
-
"identity": "Identity"
|
|
555
|
+
"identity": "Identity",
|
|
556
|
+
"addressIndex": "Address Index"
|
|
493
557
|
}
|
|
494
558
|
},
|
|
495
559
|
"identity-resolve": {
|
|
@@ -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 rebased 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 rebased 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 rebased connector.
|
|
15
18
|
*/
|
|
16
19
|
export declare function actionCommandProofCreate(opts: {
|
|
17
20
|
id: string;
|
|
18
21
|
privateKey: string;
|
|
19
22
|
data: 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.
|
|
@@ -12,12 +13,16 @@ export declare function buildCommandProofVerify(): Command;
|
|
|
12
13
|
* @param opts.data The data to verify the proof for.
|
|
13
14
|
* @param opts.cryptosuite The cryptosuite of the proof.
|
|
14
15
|
* @param opts.value The proof value.
|
|
16
|
+
* @param opts.connector The connector to perform the operations with.
|
|
15
17
|
* @param opts.node The node URL.
|
|
18
|
+
* @param opts.network The network to use for rebased connector.
|
|
16
19
|
*/
|
|
17
20
|
export declare function actionCommandProofVerify(opts: {
|
|
18
21
|
id: string;
|
|
19
22
|
data: string;
|
|
20
23
|
cryptosuite: string;
|
|
21
24
|
value: string;
|
|
25
|
+
connector?: IdentityConnectorTypes;
|
|
22
26
|
node: string;
|
|
27
|
+
network?: string;
|
|
23
28
|
} & 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 rebased 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.
|
|
@@ -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 rebased 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 rebased 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 rebased 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 Rebased.
|
|
11
|
+
*/
|
|
12
|
+
readonly IotaRebased: "iota-rebased";
|
|
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
|
@@ -64,7 +64,7 @@ Creates a Decentralized Identifier (DID).
|
|
|
64
64
|
|
|
65
65
|
Options:
|
|
66
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.
|
|
67
|
-
--
|
|
67
|
+
--address-index <index> The address index to use for the creation. (default: "0")
|
|
68
68
|
--no-console Hides the output in the console.
|
|
69
69
|
--json <filename> Creates a JSON file containing the output.
|
|
70
70
|
--merge-json If the JSON file already exists merge the data instead of overwriting.
|
|
@@ -81,7 +81,7 @@ The commands `mnemonic`, `address`, `faucet` and `transfer` are described in mor
|
|
|
81
81
|
|
|
82
82
|
### identity-create
|
|
83
83
|
|
|
84
|
-
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.
|
|
85
85
|
|
|
86
86
|
```shell
|
|
87
87
|
# Generate a seed and mnemonic and store it in the env file
|
|
@@ -101,10 +101,10 @@ EXPLORER_URL="https://explorer.iota.org/iota-testnet/"
|
|
|
101
101
|
To then request some funds and generate the identity you can issue the following commands:
|
|
102
102
|
|
|
103
103
|
```shell
|
|
104
|
-
# Fund the
|
|
105
|
-
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
|
|
106
106
|
# Create an identity
|
|
107
|
-
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
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
### identity-resolve
|
|
@@ -22,12 +22,24 @@ The private key for the controller.
|
|
|
22
22
|
|
|
23
23
|
The id of the service to remove.
|
|
24
24
|
|
|
25
|
+
#### connector
|
|
26
|
+
|
|
27
|
+
[`IdentityConnectorTypes`](../type-aliases/IdentityConnectorTypes.md)
|
|
28
|
+
|
|
29
|
+
The connector to perform the operations with.
|
|
30
|
+
|
|
25
31
|
#### node
|
|
26
32
|
|
|
27
33
|
`string`
|
|
28
34
|
|
|
29
35
|
The node URL.
|
|
30
36
|
|
|
37
|
+
#### network
|
|
38
|
+
|
|
39
|
+
`string`
|
|
40
|
+
|
|
41
|
+
The network to use for rebased connector.
|
|
42
|
+
|
|
31
43
|
#### explorer
|
|
32
44
|
|
|
33
45
|
`string`
|
|
@@ -28,12 +28,24 @@ The id of the document to revoke the index.
|
|
|
28
28
|
|
|
29
29
|
The revocation index for the credential.
|
|
30
30
|
|
|
31
|
+
#### connector
|
|
32
|
+
|
|
33
|
+
[`IdentityConnectorTypes`](../type-aliases/IdentityConnectorTypes.md)
|
|
34
|
+
|
|
35
|
+
The connector to perform the operations with.
|
|
36
|
+
|
|
31
37
|
#### node
|
|
32
38
|
|
|
33
39
|
`string`
|
|
34
40
|
|
|
35
41
|
The node URL.
|
|
36
42
|
|
|
43
|
+
#### network
|
|
44
|
+
|
|
45
|
+
`string`
|
|
46
|
+
|
|
47
|
+
The network to use for rebased connector.
|
|
48
|
+
|
|
37
49
|
## Returns
|
|
38
50
|
|
|
39
51
|
`Promise`\<`void`\>
|
|
@@ -28,12 +28,24 @@ The id of the document to unrevoke the index.
|
|
|
28
28
|
|
|
29
29
|
The revocation index for the credential.
|
|
30
30
|
|
|
31
|
+
#### connector
|
|
32
|
+
|
|
33
|
+
[`IdentityConnectorTypes`](../type-aliases/IdentityConnectorTypes.md)
|
|
34
|
+
|
|
35
|
+
The connector to perform the operations with.
|
|
36
|
+
|
|
31
37
|
#### node
|
|
32
38
|
|
|
33
39
|
`string`
|
|
34
40
|
|
|
35
41
|
The node URL.
|
|
36
42
|
|
|
43
|
+
#### network
|
|
44
|
+
|
|
45
|
+
`string`
|
|
46
|
+
|
|
47
|
+
The network to use for rebased connector.
|
|
48
|
+
|
|
37
49
|
## Returns
|
|
38
50
|
|
|
39
51
|
`Promise`\<`void`\>
|
|
@@ -22,12 +22,24 @@ The private key for the controller.
|
|
|
22
22
|
|
|
23
23
|
The id of the verification method to remove.
|
|
24
24
|
|
|
25
|
+
#### connector
|
|
26
|
+
|
|
27
|
+
[`IdentityConnectorTypes`](../type-aliases/IdentityConnectorTypes.md)
|
|
28
|
+
|
|
29
|
+
The connector to perform the operations with.
|
|
30
|
+
|
|
25
31
|
#### node
|
|
26
32
|
|
|
27
33
|
`string`
|
|
28
34
|
|
|
29
35
|
The node URL.
|
|
30
36
|
|
|
37
|
+
#### network
|
|
38
|
+
|
|
39
|
+
`string`
|
|
40
|
+
|
|
41
|
+
The network to use for rebased connector.
|
|
42
|
+
|
|
31
43
|
#### explorer
|
|
32
44
|
|
|
33
45
|
`string`
|