@twin.org/identity-cli 0.0.1-next.12 → 0.0.1-next.14

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.
@@ -14,8 +14,8 @@ var commander = require('commander');
14
14
  var entityStorageConnectorMemory = require('@twin.org/entity-storage-connector-memory');
15
15
  var entityStorageModels = require('@twin.org/entity-storage-models');
16
16
  var vaultConnectorEntityStorage = require('@twin.org/vault-connector-entity-storage');
17
- var identityModels = require('@twin.org/identity-models');
18
17
  var standardsW3cDid = require('@twin.org/standards-w3c-did');
18
+ var identityModels = require('@twin.org/identity-models');
19
19
 
20
20
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
21
21
  // Copyright 2024 IOTA Stiftung.
@@ -264,18 +264,16 @@ async function actionCommandProofCreate(opts) {
264
264
  cliCore.CLIDisplay.break();
265
265
  cliCore.CLIDisplay.spinnerStart();
266
266
  const proof = await iotaIdentityConnector.createProof(localIdentity, id, data);
267
- const proofValue = core.Converter.bytesToBase64(proof.value);
268
267
  cliCore.CLIDisplay.spinnerStop();
269
268
  if (opts.console) {
270
- cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.proof-create.labels.type"), proof.type);
271
- cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.proof-create.labels.value"), proofValue);
269
+ cliCore.CLIDisplay.json(proof);
272
270
  cliCore.CLIDisplay.break();
273
271
  }
274
272
  if (core.Is.stringValue(opts?.json)) {
275
- await cliCore.CLIUtils.writeJsonFile(opts.json, { type: proof.type, value: proofValue }, opts.mergeJson);
273
+ await cliCore.CLIUtils.writeJsonFile(opts.json, { cryptosuite: proof.cryptosuite, value: proof.proofValue }, opts.mergeJson);
276
274
  }
277
275
  if (core.Is.stringValue(opts?.env)) {
278
- await cliCore.CLIUtils.writeEnvFile(opts.env, [`DID_PROOF_TYPE="${proof.type}"`, `DID_PROOF_VALUE="${proofValue}"`], opts.mergeEnv);
276
+ await cliCore.CLIUtils.writeEnvFile(opts.env, [`DID_CRYPTOSUITE="${proof.cryptosuite}"`, `DID_PROOF_VALUE="${proof.proofValue}"`], opts.mergeEnv);
279
277
  }
280
278
  cliCore.CLIDisplay.done();
281
279
  }
@@ -294,7 +292,7 @@ function buildCommandProofVerify() {
294
292
  .description(core.I18n.formatMessage("commands.proof-verify.description"))
295
293
  .requiredOption(core.I18n.formatMessage("commands.proof-verify.options.id.param"), core.I18n.formatMessage("commands.proof-verify.options.id.description"))
296
294
  .requiredOption(core.I18n.formatMessage("commands.proof-verify.options.data.param"), core.I18n.formatMessage("commands.proof-verify.options.data.description"))
297
- .requiredOption(core.I18n.formatMessage("commands.proof-verify.options.type.param"), core.I18n.formatMessage("commands.proof-verify.options.type.description"))
295
+ .requiredOption(core.I18n.formatMessage("commands.proof-verify.options.cryptosuite.param"), core.I18n.formatMessage("commands.proof-verify.options.cryptosuite.description"))
298
296
  .requiredOption(core.I18n.formatMessage("commands.proof-verify.options.value.param"), core.I18n.formatMessage("commands.proof-verify.options.value.description"));
299
297
  cliCore.CLIOptions.output(command, {
300
298
  noConsole: true,
@@ -313,19 +311,19 @@ function buildCommandProofVerify() {
313
311
  * @param opts The options for the command.
314
312
  * @param opts.id The id of the verification method to use for the credential.
315
313
  * @param opts.data The data to verify the proof for.
316
- * @param opts.type The type of the proof.
314
+ * @param opts.cryptosuite The cryptosuite of the proof.
317
315
  * @param opts.value The proof value.
318
316
  * @param opts.node The node URL.
319
317
  */
320
318
  async function actionCommandProofVerify(opts) {
321
319
  const id = cliCore.CLIParam.stringValue("id", opts.id);
322
320
  const data = cliCore.CLIParam.hexBase64("data", opts.data);
323
- const type = cliCore.CLIParam.stringValue("type", opts.type);
324
- const value = cliCore.CLIParam.hexBase64("value", opts.value);
321
+ const cryptosuite = cliCore.CLIParam.stringValue("cryptosuite", opts.cryptosuite);
322
+ const value = cliCore.CLIParam.stringValue("value", opts.value);
325
323
  const nodeEndpoint = cliCore.CLIParam.url("node", opts.node);
326
324
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.proof-verify.labels.verificationMethodId"), id);
327
- cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.proof-verify.labels.type"), type);
328
- cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.proof-verify.labels.value"), core.Converter.bytesToBase64(value));
325
+ cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.proof-verify.labels.cryptosuite"), cryptosuite);
326
+ cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.proof-verify.labels.value"), value);
329
327
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.node"), nodeEndpoint);
330
328
  cliCore.CLIDisplay.break();
331
329
  setupVault();
@@ -349,7 +347,15 @@ async function actionCommandProofVerify(opts) {
349
347
  cliCore.CLIDisplay.task(core.I18n.formatMessage("commands.proof-verify.progress.verifyingProof"));
350
348
  cliCore.CLIDisplay.break();
351
349
  cliCore.CLIDisplay.spinnerStart();
352
- const isVerified = await iotaIdentityConnector.verifyProof(id, data, type, value);
350
+ const proof = {
351
+ "@context": standardsW3cDid.DidContexts.ContextVCDataIntegrity,
352
+ type: standardsW3cDid.DidTypes.DataIntegrityProof,
353
+ verificationMethod: id,
354
+ cryptosuite,
355
+ proofPurpose: "assertionMethod",
356
+ proofValue: value
357
+ };
358
+ const isVerified = await iotaIdentityConnector.verifyProof(data, proof);
353
359
  cliCore.CLIDisplay.spinnerStop();
354
360
  if (opts.console) {
355
361
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.proof-verify.labels.isVerified"), isVerified);
@@ -12,8 +12,8 @@ import { Command, Option } from 'commander';
12
12
  import { MemoryEntityStorageConnector } from '@twin.org/entity-storage-connector-memory';
13
13
  import { EntityStorageConnectorFactory } from '@twin.org/entity-storage-models';
14
14
  import { initSchema, EntityStorageVaultConnector } from '@twin.org/vault-connector-entity-storage';
15
+ import { DidContexts, DidTypes, DidVerificationMethodType } from '@twin.org/standards-w3c-did';
15
16
  import { DocumentHelper } from '@twin.org/identity-models';
16
- import { DidVerificationMethodType } from '@twin.org/standards-w3c-did';
17
17
 
18
18
  // Copyright 2024 IOTA Stiftung.
19
19
  // SPDX-License-Identifier: Apache-2.0.
@@ -261,18 +261,16 @@ async function actionCommandProofCreate(opts) {
261
261
  CLIDisplay.break();
262
262
  CLIDisplay.spinnerStart();
263
263
  const proof = await iotaIdentityConnector.createProof(localIdentity, id, data);
264
- const proofValue = Converter.bytesToBase64(proof.value);
265
264
  CLIDisplay.spinnerStop();
266
265
  if (opts.console) {
267
- CLIDisplay.value(I18n.formatMessage("commands.proof-create.labels.type"), proof.type);
268
- CLIDisplay.value(I18n.formatMessage("commands.proof-create.labels.value"), proofValue);
266
+ CLIDisplay.json(proof);
269
267
  CLIDisplay.break();
270
268
  }
271
269
  if (Is.stringValue(opts?.json)) {
272
- await CLIUtils.writeJsonFile(opts.json, { type: proof.type, value: proofValue }, opts.mergeJson);
270
+ await CLIUtils.writeJsonFile(opts.json, { cryptosuite: proof.cryptosuite, value: proof.proofValue }, opts.mergeJson);
273
271
  }
274
272
  if (Is.stringValue(opts?.env)) {
275
- await CLIUtils.writeEnvFile(opts.env, [`DID_PROOF_TYPE="${proof.type}"`, `DID_PROOF_VALUE="${proofValue}"`], opts.mergeEnv);
273
+ await CLIUtils.writeEnvFile(opts.env, [`DID_CRYPTOSUITE="${proof.cryptosuite}"`, `DID_PROOF_VALUE="${proof.proofValue}"`], opts.mergeEnv);
276
274
  }
277
275
  CLIDisplay.done();
278
276
  }
@@ -291,7 +289,7 @@ function buildCommandProofVerify() {
291
289
  .description(I18n.formatMessage("commands.proof-verify.description"))
292
290
  .requiredOption(I18n.formatMessage("commands.proof-verify.options.id.param"), I18n.formatMessage("commands.proof-verify.options.id.description"))
293
291
  .requiredOption(I18n.formatMessage("commands.proof-verify.options.data.param"), I18n.formatMessage("commands.proof-verify.options.data.description"))
294
- .requiredOption(I18n.formatMessage("commands.proof-verify.options.type.param"), I18n.formatMessage("commands.proof-verify.options.type.description"))
292
+ .requiredOption(I18n.formatMessage("commands.proof-verify.options.cryptosuite.param"), I18n.formatMessage("commands.proof-verify.options.cryptosuite.description"))
295
293
  .requiredOption(I18n.formatMessage("commands.proof-verify.options.value.param"), I18n.formatMessage("commands.proof-verify.options.value.description"));
296
294
  CLIOptions.output(command, {
297
295
  noConsole: true,
@@ -310,19 +308,19 @@ function buildCommandProofVerify() {
310
308
  * @param opts The options for the command.
311
309
  * @param opts.id The id of the verification method to use for the credential.
312
310
  * @param opts.data The data to verify the proof for.
313
- * @param opts.type The type of the proof.
311
+ * @param opts.cryptosuite The cryptosuite of the proof.
314
312
  * @param opts.value The proof value.
315
313
  * @param opts.node The node URL.
316
314
  */
317
315
  async function actionCommandProofVerify(opts) {
318
316
  const id = CLIParam.stringValue("id", opts.id);
319
317
  const data = CLIParam.hexBase64("data", opts.data);
320
- const type = CLIParam.stringValue("type", opts.type);
321
- const value = CLIParam.hexBase64("value", opts.value);
318
+ const cryptosuite = CLIParam.stringValue("cryptosuite", opts.cryptosuite);
319
+ const value = CLIParam.stringValue("value", opts.value);
322
320
  const nodeEndpoint = CLIParam.url("node", opts.node);
323
321
  CLIDisplay.value(I18n.formatMessage("commands.proof-verify.labels.verificationMethodId"), id);
324
- CLIDisplay.value(I18n.formatMessage("commands.proof-verify.labels.type"), type);
325
- CLIDisplay.value(I18n.formatMessage("commands.proof-verify.labels.value"), Converter.bytesToBase64(value));
322
+ CLIDisplay.value(I18n.formatMessage("commands.proof-verify.labels.cryptosuite"), cryptosuite);
323
+ CLIDisplay.value(I18n.formatMessage("commands.proof-verify.labels.value"), value);
326
324
  CLIDisplay.value(I18n.formatMessage("commands.common.labels.node"), nodeEndpoint);
327
325
  CLIDisplay.break();
328
326
  setupVault();
@@ -346,7 +344,15 @@ async function actionCommandProofVerify(opts) {
346
344
  CLIDisplay.task(I18n.formatMessage("commands.proof-verify.progress.verifyingProof"));
347
345
  CLIDisplay.break();
348
346
  CLIDisplay.spinnerStart();
349
- const isVerified = await iotaIdentityConnector.verifyProof(id, data, type, value);
347
+ const proof = {
348
+ "@context": DidContexts.ContextVCDataIntegrity,
349
+ type: DidTypes.DataIntegrityProof,
350
+ verificationMethod: id,
351
+ cryptosuite,
352
+ proofPurpose: "assertionMethod",
353
+ proofValue: value
354
+ };
355
+ const isVerified = await iotaIdentityConnector.verifyProof(data, proof);
350
356
  CLIDisplay.spinnerStop();
351
357
  if (opts.console) {
352
358
  CLIDisplay.value(I18n.formatMessage("commands.proof-verify.labels.isVerified"), isVerified);
@@ -1,24 +1,5 @@
1
1
  {
2
2
  "error": {
3
- "commands": {
4
- "verifiable-credential-create": {
5
- "subjectJsonFileNotFound": "The subject JSON file was not found."
6
- },
7
- "common": {
8
- "missingEnv": "The \"{option}\" option is configured as an environment variable, but there is no environment variable with the name \"{value}\" set.",
9
- "optionInvalidHex": "The \"{option}\" does not appear to be hex. \"{value}\"",
10
- "optionInvalidBase64": "The \"{option}\" does not appear to be base64. \"{value}\"",
11
- "optionInvalidHexBase64": "The \"{option}\" does not appear to be hex or base64. \"{value}\"",
12
- "optionInvalidBech32": "The \"{option}\" does not appear to be bech32. \"{value}\"",
13
- "optionMinValue": "The \"{option}\" option must be greater than or equal to {minValue}, it is {value}.",
14
- "optionMaxValue": "The \"{option}\" option must be less than or equal to {maxValue}, it is {value}."
15
- },
16
- "address": {
17
- "seedMissingEnv": "The seed does not appear to be hex or base64, assuming it is an environment variable, but there is no environment variable with the name \"{env}\" set.",
18
- "seedInvalidEnv": "The seed does not appear to be hex or base64, assuming it is an environment variable, but there the environment variable is neither hex or base64. \"{envValue}\"",
19
- "seedInvalidFormat": "The seed does not appear to be hex, base64 or an environment variable. \"{seed}\""
20
- }
21
- },
22
3
  "validation": {
23
4
  "beEmpty": "{fieldName} must be empty",
24
5
  "beNotEmpty": "{fieldName} must not be empty",
@@ -27,6 +8,10 @@
27
8
  "beTextMinMax": "{fieldName} must be longer than {minLength} and shorter than {maxLength} characters",
28
9
  "beTextMin": "{fieldName} must be longer than {minLength} characters",
29
10
  "beTextMax": "{fieldName} must be shorter than {maxLength} characters",
11
+ "beTextBase58": "{fieldName} must be text formatted using Base58 characters",
12
+ "beTextBase64": "{fieldName} must be text formatted using Base64 characters",
13
+ "beTextHex": "{fieldName} must be text formatted using Hex characters",
14
+ "beTextRegExp": "{fieldName} must be text formatted using the matching pattern {format}",
30
15
  "beNumber": "{fieldName} must be a number",
31
16
  "beNumberMinMax": "{fieldName} must be >= {minValue} and <= {maxValue}",
32
17
  "beNumberMin": "{fieldName} must be >= {minValue}",
@@ -69,6 +54,7 @@
69
54
  "stringEmpty": "Property \"{property}\" must have a value, it is empty",
70
55
  "stringBase64": "Property \"{property}\" must be a base64 encoded string, it is \"{value}\"",
71
56
  "stringBase64Url": "Property \"{property}\" must be a base64 url encoded string, it is \"{value}\"",
57
+ "stringBase58": "Property \"{property}\" must be a base58 encoded string, it is \"{value}\"",
72
58
  "stringHex": "Property \"{property}\" must be a hex string, it is \"{value}\"",
73
59
  "stringHexLength": "Property \"{property}\" must be a hex string of length \"{options}\", it is \"{value}\"",
74
60
  "number": "Property \"{property}\" must be a number, it is \"{value}\"",
@@ -108,6 +94,15 @@
108
94
  "bitString": {
109
95
  "outOfRange": "The index should be >= 0 and less than the length of the bit string"
110
96
  },
97
+ "base32": {
98
+ "invalidCharacter": "Data contains a character \"{invalidCharacter}\" which is not in the charset"
99
+ },
100
+ "base64": {
101
+ "length4Multiple": "Invalid length should be a multiple of 4, it is \"{value}\""
102
+ },
103
+ "base58": {
104
+ "invalidCharacter": "Data contains a character \"{invalidCharacter}\" which is not in the charset"
105
+ },
111
106
  "bip39": {
112
107
  "missingMnemonicWord": "The mnemonic contains a word not in the wordlist, \"{value}\"",
113
108
  "checksumMismatch": "The checksum does not match \"{newChecksum}\" != \"{checksumBits}\""
@@ -133,18 +128,15 @@
133
128
  "sha256": {
134
129
  "bitSize": "Only 224 or 256 bits are supported, it is \"{bitSize}\""
135
130
  },
131
+ "sha3": {
132
+ "bitSize": "Only 224, 256, 384 or 512 bits are supported, it is \"{bitSize}\""
133
+ },
136
134
  "hmacSha256": {
137
135
  "bitSize": "Only 224 or 256 bits are supported, it is \"{bitSize}\""
138
136
  },
139
137
  "hmacSha512": {
140
138
  "bitSize": "Only 224, 256, 384 or 512 bits are supported, it is \"{bitSize}\""
141
139
  },
142
- "base32": {
143
- "invalidCharacter": "Data contains a character \"{invalidCharacter}\" which is not in the charset"
144
- },
145
- "base64": {
146
- "length4Multiple": "Invalid length should be a multiple of 4, it is \"{value}\""
147
- },
148
140
  "bech32": {
149
141
  "decodeFailed": "The address contains decoding failed for address \"{bech32}\"",
150
142
  "invalidChecksum": "The address contains an invalid checksum in address, \"{bech32}\"",
@@ -169,6 +161,25 @@
169
161
  "slip0010": {
170
162
  "invalidSeed": "The seed is invalid \"{seed}\""
171
163
  },
164
+ "commands": {
165
+ "common": {
166
+ "missingEnv": "The \"{option}\" option is configured as an environment variable, but there is no environment variable with the name \"{value}\" set.",
167
+ "optionInvalidHex": "The \"{option}\" does not appear to be hex. \"{value}\"",
168
+ "optionInvalidBase64": "The \"{option}\" does not appear to be base64. \"{value}\"",
169
+ "optionInvalidHexBase64": "The \"{option}\" does not appear to be hex or base64. \"{value}\"",
170
+ "optionInvalidBech32": "The \"{option}\" does not appear to be bech32. \"{value}\"",
171
+ "optionMinValue": "The \"{option}\" option must be greater than or equal to {minValue}, it is {value}.",
172
+ "optionMaxValue": "The \"{option}\" option must be less than or equal to {maxValue}, it is {value}."
173
+ },
174
+ "address": {
175
+ "seedMissingEnv": "The seed does not appear to be hex or base64, assuming it is an environment variable, but there is no environment variable with the name \"{env}\" set.",
176
+ "seedInvalidEnv": "The seed does not appear to be hex or base64, assuming it is an environment variable, but there the environment variable is neither hex or base64. \"{envValue}\"",
177
+ "seedInvalidFormat": "The seed does not appear to be hex, base64 or an environment variable. \"{seed}\""
178
+ },
179
+ "verifiable-credential-create": {
180
+ "subjectJsonFileNotFound": "The subject JSON file was not found."
181
+ }
182
+ },
172
183
  "entitySchemaHelper": {
173
184
  "noIsPrimary": "Property \"entitySchema.properties\" must contain a value with isPrimary set",
174
185
  "multipleIsPrimary": "Property \"entitySchema.properties\" contains more than one property with isPrimary set"
@@ -210,7 +221,9 @@
210
221
  "unrevokeVerifiableCredentialsFailed": "Unrevoking verifiable credentials failed",
211
222
  "inclusionFailed": "The transaction generated for the identity was not included in a reasonable amount of time",
212
223
  "insufficientFunds": "There were insufficient funds to complete the operation",
213
- "walletConnectorMissing": "The wallet connector must be available to perform this operation"
224
+ "walletConnectorMissing": "The wallet connector must be available to perform this operation",
225
+ "proofType": "The proof type must be DataIntegrityProof, it is currently {proofType}",
226
+ "cryptosuite": "The proof cryptosuite must be eddsa-jcs-2022, it is currently {cryptosuite}"
214
227
  },
215
228
  "iota": {
216
229
  "inclusionFailed": "The transaction generated was not included in a reasonable amount of time",
@@ -231,7 +244,231 @@
231
244
  "insufficientFunds": "There were insufficient funds to complete the operation"
232
245
  }
233
246
  },
247
+ "errorNames": {
248
+ "error": "Error",
249
+ "generalError": "General",
250
+ "guardError": "Guard",
251
+ "conflictError": "Conflict",
252
+ "notFoundError": "Not Found",
253
+ "notSupportedError": "Not Supported",
254
+ "alreadyExistsError": "Already Exists",
255
+ "notImplementedError": "Not Implemented",
256
+ "validationError": "Validation",
257
+ "unprocessableError": "Unprocessable"
258
+ },
259
+ "validation": {
260
+ "defaultFieldName": "The field"
261
+ },
262
+ "cli": {
263
+ "progress": {
264
+ "done": "Done.",
265
+ "error": "Error",
266
+ "loadingEnvFiles": "Loading env files",
267
+ "pleaseWait": "Please wait...",
268
+ "writingJsonFile": "Writing JSON file",
269
+ "writingEnvFile": "Writing env file",
270
+ "readingJsonFile": "Reading JSON file",
271
+ "readingEnvFile": "Reading env file"
272
+ },
273
+ "options": {
274
+ "lang": {
275
+ "param": "--lang '<'lang'>'",
276
+ "description": "The language to display the output in."
277
+ },
278
+ "load-env": {
279
+ "param": "--load-env [env...]",
280
+ "description": "Load the env files to initialise any environment variables."
281
+ },
282
+ "no-console": {
283
+ "param": "--no-console",
284
+ "description": "Hides the output in the console."
285
+ },
286
+ "json": {
287
+ "param": "--json '<'filename'>'",
288
+ "description": "Creates a JSON file containing the output."
289
+ },
290
+ "env": {
291
+ "param": "--env '<'filename'>'",
292
+ "description": "Creates an env file containing the output."
293
+ },
294
+ "merge-json": {
295
+ "param": "--merge-json",
296
+ "description": "If the JSON file already exists merge the data instead of overwriting."
297
+ },
298
+ "merge-env": {
299
+ "param": "--merge-env",
300
+ "description": "If the env file already exists merge the data instead of overwriting."
301
+ }
302
+ }
303
+ },
234
304
  "commands": {
305
+ "mnemonic": {
306
+ "summary": "Create a mnemonic.",
307
+ "description": "Create a mnemonic, will also generate the equivalent seed in hex and base64 format.",
308
+ "options": {
309
+ "strength": {
310
+ "param": "--strength '<'number'>'",
311
+ "description": "The number of words in the mnemonic, defaults to 256 which produces 24 words."
312
+ },
313
+ "seed-format": {
314
+ "param": "--seed-format '<'format'>'",
315
+ "description": "The format to output the seed."
316
+ },
317
+ "no-console": {
318
+ "param": "--no-console",
319
+ "description": "Hides the mnemonic and seed in the console."
320
+ },
321
+ "json": {
322
+ "param": "--json '<'filename'>'",
323
+ "description": "Creates a JSON file containing the mnemonic and seed."
324
+ },
325
+ "env": {
326
+ "param": "--env '<'filename'>'",
327
+ "description": "Creates an env file containing the mnemonic and seed."
328
+ },
329
+ "env-prefix": {
330
+ "param": "--env-prefix '<'prefix'>'",
331
+ "description": "Prefixes the env variables with the value."
332
+ }
333
+ },
334
+ "progress": {
335
+ "writingJsonFile": "Writing JSON file",
336
+ "writingEnvFile": "Writing env file"
337
+ },
338
+ "labels": {
339
+ "mnemonic": "Mnemonic",
340
+ "seed": "Seed",
341
+ "envPrefix": "Env Prefix"
342
+ }
343
+ },
344
+ "address": {
345
+ "summary": "Create bech32 addresses and keys from the seed.",
346
+ "description": "Create a number of bech32 addresses and their associated key pairs from the seed.",
347
+ "options": {
348
+ "seed": {
349
+ "param": "--seed '<'seed'>'",
350
+ "description": "The seed to use for generating the addresses, this can be either hex, base64 or an environment variable name. For an environment variable start the value with a !"
351
+ },
352
+ "start": {
353
+ "param": "--start '<'number'>'",
354
+ "description": "The index of the first address to create."
355
+ },
356
+ "count": {
357
+ "param": "--count '<'number'>'",
358
+ "description": "The number of addresses to create, max 100."
359
+ },
360
+ "account": {
361
+ "param": "--account '<'number'>'",
362
+ "description": "The account used to generate the bech32 addresses."
363
+ },
364
+ "hrp": {
365
+ "param": "--hrp '<'hrp'>'",
366
+ "description": "The human readable part of the bech32 addresses."
367
+ },
368
+ "coin": {
369
+ "param": "--coin '<'coin'>'",
370
+ "description": "The coin type used to generate the bech32 addresses."
371
+ },
372
+ "key-type": {
373
+ "param": "--key-type '<'type'>'",
374
+ "description": "The type of key to generate."
375
+ },
376
+ "key-format": {
377
+ "param": "--key-format '<'format'>'",
378
+ "description": "The format to output the keys."
379
+ }
380
+ },
381
+ "progress": {
382
+ "generatingAddresses": "Generating addresses"
383
+ },
384
+ "labels": {
385
+ "seed": "Seed",
386
+ "start": "Start",
387
+ "count": "Count",
388
+ "account": "Account",
389
+ "hrp": "HRP",
390
+ "coin": "Coin",
391
+ "key-type": "Key Type",
392
+ "key-format": "Key Format",
393
+ "index": "Index",
394
+ "address": "Address",
395
+ "public-key": "Public Key",
396
+ "private-key": "Private Key"
397
+ }
398
+ },
399
+ "faucet": {
400
+ "summary": "Request funds from the faucet.",
401
+ "description": "Request funds from the faucet for the supplied address.",
402
+ "options": {
403
+ "address": {
404
+ "param": "--address '<'address'>'",
405
+ "description": "The address to fill from the faucet either in bech32 format, or start with ! to read environment variable."
406
+ },
407
+ "faucet": {
408
+ "param": "--faucet '<'url'>'",
409
+ "description": "The url for the faucet endpoint, or an environment variable name containing the url."
410
+ }
411
+ },
412
+ "progress": {
413
+ "requestingFunds": "Requesting Funds",
414
+ "requestingBalance": "Requesting Balance"
415
+ },
416
+ "labels": {
417
+ "faucet": "Faucet",
418
+ "fundsAdded": "Funds Added"
419
+ },
420
+ "messages": {
421
+ "noFundsAdded": "No funds were added to the address."
422
+ }
423
+ },
424
+ "transfer": {
425
+ "summary": "Transfer funds from one address to another.",
426
+ "description": "Transfer funds from one address to another.",
427
+ "options": {
428
+ "address": {
429
+ "param": "--address '<'address'>'",
430
+ "description": "The address to send the funds from either in bech32 format, or start with ! to read environment variable."
431
+ },
432
+ "dest-address": {
433
+ "param": "--dest-address '<'address'>'",
434
+ "description": "The address to send the funds to either in bech32 format, or start with ! to read environment variable."
435
+ },
436
+ "amount": {
437
+ "param": "--amount '<'amount'>'",
438
+ "description": "The amount of funds to send."
439
+ },
440
+ "seed": {
441
+ "param": "--seed '<'seed'>'",
442
+ "description": "The seed for the source address in hex or base64 used to sign the transfer, or start with ! to read environment variable."
443
+ }
444
+ },
445
+ "progress": {
446
+ "transferringFunds": "Transferring"
447
+ },
448
+ "labels": {
449
+ "destAddress": "Destination Address"
450
+ }
451
+ },
452
+ "common": {
453
+ "options": {
454
+ "node": {
455
+ "param": "--node '<'url'>'",
456
+ "description": "The url for the node endpoint, or an environment variable name containing the url."
457
+ },
458
+ "explorer": {
459
+ "param": "--explorer '<'url'>'",
460
+ "description": "The url for the explorer endpoint, or an environment variable name containing the url."
461
+ }
462
+ },
463
+ "labels": {
464
+ "address": "Address",
465
+ "balance": "Balance",
466
+ "node": "Node",
467
+ "explorer": "Explorer",
468
+ "explore": "Explore",
469
+ "did": "DID"
470
+ }
471
+ },
235
472
  "identity-create": {
236
473
  "summary": "Create a Decentralized Identifier (DID).",
237
474
  "description": "Creates a Decentralized Identifier (DID).",
@@ -497,9 +734,7 @@
497
734
  "creatingProof": "Creating Proof"
498
735
  },
499
736
  "labels": {
500
- "verificationMethodId": "Verification Method Id",
501
- "type": "Proof Type",
502
- "value": "Proof Value"
737
+ "verificationMethodId": "Verification Method Id"
503
738
  }
504
739
  },
505
740
  "proof-verify": {
@@ -514,9 +749,9 @@
514
749
  "param": "--data '<'data'>'",
515
750
  "description": "The base64 or hex encoded data to verify the proof for, or start with ! to read environment variable."
516
751
  },
517
- "type": {
518
- "param": "--type '<'type'>'",
519
- "description": "The type of the proof, or start with ! to read environment variable."
752
+ "cryptosuite": {
753
+ "param": "--cryptosuite '<'cryptosuite'>'",
754
+ "description": "The cryptosuite of the proof, or start with ! to read environment variable."
520
755
  },
521
756
  "value": {
522
757
  "param": "--value '<'value'>'",
@@ -528,234 +763,10 @@
528
763
  },
529
764
  "labels": {
530
765
  "verificationMethodId": "Verification Method Id",
531
- "type": "Proof Type",
766
+ "cryptosuite": "Proof Cryptosuite",
532
767
  "value": "Proof Value",
533
768
  "isVerified": "Is Verified"
534
769
  }
535
- },
536
- "common": {
537
- "options": {
538
- "node": {
539
- "param": "--node '<'url'>'",
540
- "description": "The url for the node endpoint, or an environment variable name containing the url."
541
- },
542
- "explorer": {
543
- "param": "--explorer '<'url'>'",
544
- "description": "The url for the explorer endpoint, or an environment variable name containing the url."
545
- }
546
- },
547
- "labels": {
548
- "did": "DID",
549
- "node": "Node",
550
- "explorer": "Explorer",
551
- "explore": "Explore",
552
- "address": "Address",
553
- "balance": "Balance"
554
- }
555
- },
556
- "mnemonic": {
557
- "summary": "Create a mnemonic.",
558
- "description": "Create a mnemonic, will also generate the equivalent seed in hex and base64 format.",
559
- "options": {
560
- "strength": {
561
- "param": "--strength '<'number'>'",
562
- "description": "The number of words in the mnemonic, defaults to 256 which produces 24 words."
563
- },
564
- "seed-format": {
565
- "param": "--seed-format '<'format'>'",
566
- "description": "The format to output the seed."
567
- },
568
- "no-console": {
569
- "param": "--no-console",
570
- "description": "Hides the mnemonic and seed in the console."
571
- },
572
- "json": {
573
- "param": "--json '<'filename'>'",
574
- "description": "Creates a JSON file containing the mnemonic and seed."
575
- },
576
- "env": {
577
- "param": "--env '<'filename'>'",
578
- "description": "Creates an env file containing the mnemonic and seed."
579
- },
580
- "env-prefix": {
581
- "param": "--env-prefix '<'prefix'>'",
582
- "description": "Prefixes the env variables with the value."
583
- }
584
- },
585
- "progress": {
586
- "writingJsonFile": "Writing JSON file",
587
- "writingEnvFile": "Writing env file"
588
- },
589
- "labels": {
590
- "mnemonic": "Mnemonic",
591
- "seed": "Seed",
592
- "envPrefix": "Env Prefix"
593
- }
594
- },
595
- "address": {
596
- "summary": "Create bech32 addresses and keys from the seed.",
597
- "description": "Create a number of bech32 addresses and their associated key pairs from the seed.",
598
- "options": {
599
- "seed": {
600
- "param": "--seed '<'seed'>'",
601
- "description": "The seed to use for generating the addresses, this can be either hex, base64 or an environment variable name. For an environment variable start the value with a !"
602
- },
603
- "start": {
604
- "param": "--start '<'number'>'",
605
- "description": "The index of the first address to create."
606
- },
607
- "count": {
608
- "param": "--count '<'number'>'",
609
- "description": "The number of addresses to create, max 100."
610
- },
611
- "account": {
612
- "param": "--account '<'number'>'",
613
- "description": "The account used to generate the bech32 addresses."
614
- },
615
- "hrp": {
616
- "param": "--hrp '<'hrp'>'",
617
- "description": "The human readable part of the bech32 addresses."
618
- },
619
- "coin": {
620
- "param": "--coin '<'coin'>'",
621
- "description": "The coin type used to generate the bech32 addresses."
622
- },
623
- "key-type": {
624
- "param": "--key-type '<'type'>'",
625
- "description": "The type of key to generate."
626
- },
627
- "key-format": {
628
- "param": "--key-format '<'format'>'",
629
- "description": "The format to output the keys."
630
- }
631
- },
632
- "progress": {
633
- "generatingAddresses": "Generating addresses"
634
- },
635
- "labels": {
636
- "seed": "Seed",
637
- "start": "Start",
638
- "count": "Count",
639
- "account": "Account",
640
- "hrp": "HRP",
641
- "coin": "Coin",
642
- "key-type": "Key Type",
643
- "key-format": "Key Format",
644
- "index": "Index",
645
- "address": "Address",
646
- "public-key": "Public Key",
647
- "private-key": "Private Key"
648
- }
649
- },
650
- "faucet": {
651
- "summary": "Request funds from the faucet.",
652
- "description": "Request funds from the faucet for the supplied address.",
653
- "options": {
654
- "address": {
655
- "param": "--address '<'address'>'",
656
- "description": "The address to fill from the faucet either in bech32 format, or start with ! to read environment variable."
657
- },
658
- "faucet": {
659
- "param": "--faucet '<'url'>'",
660
- "description": "The url for the faucet endpoint, or an environment variable name containing the url."
661
- }
662
- },
663
- "progress": {
664
- "requestingFunds": "Requesting Funds",
665
- "requestingBalance": "Requesting Balance"
666
- },
667
- "labels": {
668
- "faucet": "Faucet",
669
- "fundsAdded": "Funds Added"
670
- },
671
- "messages": {
672
- "noFundsAdded": "No funds were added to the address."
673
- }
674
- },
675
- "transfer": {
676
- "summary": "Transfer funds from one address to another.",
677
- "description": "Transfer funds from one address to another.",
678
- "options": {
679
- "address": {
680
- "param": "--address '<'address'>'",
681
- "description": "The address to send the funds from either in bech32 format, or start with ! to read environment variable."
682
- },
683
- "dest-address": {
684
- "param": "--dest-address '<'address'>'",
685
- "description": "The address to send the funds to either in bech32 format, or start with ! to read environment variable."
686
- },
687
- "amount": {
688
- "param": "--amount '<'amount'>'",
689
- "description": "The amount of funds to send."
690
- },
691
- "seed": {
692
- "param": "--seed '<'seed'>'",
693
- "description": "The seed for the source address in hex or base64 used to sign the transfer, or start with ! to read environment variable."
694
- }
695
- },
696
- "progress": {
697
- "transferringFunds": "Transferring"
698
- },
699
- "labels": {
700
- "destAddress": "Destination Address"
701
- }
702
- }
703
- },
704
- "errorNames": {
705
- "error": "Error",
706
- "generalError": "General",
707
- "guardError": "Guard",
708
- "conflictError": "Conflict",
709
- "notFoundError": "Not Found",
710
- "notSupportedError": "Not Supported",
711
- "alreadyExistsError": "Already Exists",
712
- "notImplementedError": "Not Implemented",
713
- "validationError": "Validation",
714
- "unprocessableError": "Unprocessable"
715
- },
716
- "validation": {
717
- "defaultFieldName": "The field"
718
- },
719
- "cli": {
720
- "progress": {
721
- "done": "Done.",
722
- "error": "Error",
723
- "loadingEnvFiles": "Loading env files",
724
- "pleaseWait": "Please wait...",
725
- "writingJsonFile": "Writing JSON file",
726
- "writingEnvFile": "Writing env file",
727
- "readingJsonFile": "Reading JSON file",
728
- "readingEnvFile": "Reading env file"
729
- },
730
- "options": {
731
- "lang": {
732
- "param": "--lang '<'lang'>'",
733
- "description": "The language to display the output in."
734
- },
735
- "load-env": {
736
- "param": "--load-env [env...]",
737
- "description": "Load the env files to initialise any environment variables."
738
- },
739
- "no-console": {
740
- "param": "--no-console",
741
- "description": "Hides the output in the console."
742
- },
743
- "json": {
744
- "param": "--json '<'filename'>'",
745
- "description": "Creates a JSON file containing the output."
746
- },
747
- "env": {
748
- "param": "--env '<'filename'>'",
749
- "description": "Creates an env file containing the output."
750
- },
751
- "merge-json": {
752
- "param": "--merge-json",
753
- "description": "If the JSON file already exists merge the data instead of overwriting."
754
- },
755
- "merge-env": {
756
- "param": "--merge-env",
757
- "description": "If the env file already exists merge the data instead of overwriting."
758
- }
759
770
  }
760
771
  },
761
772
  "jsonLdProcessor": {
@@ -10,14 +10,14 @@ export declare function buildCommandProofVerify(): Command;
10
10
  * @param opts The options for the command.
11
11
  * @param opts.id The id of the verification method to use for the credential.
12
12
  * @param opts.data The data to verify the proof for.
13
- * @param opts.type The type of the proof.
13
+ * @param opts.cryptosuite The cryptosuite of the proof.
14
14
  * @param opts.value The proof value.
15
15
  * @param opts.node The node URL.
16
16
  */
17
17
  export declare function actionCommandProofVerify(opts: {
18
18
  id: string;
19
19
  data: string;
20
- type: string;
20
+ cryptosuite: string;
21
21
  value: string;
22
22
  node: string;
23
23
  } & CliOutputOptions): Promise<void>;
package/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/identity-cli - Changelog
2
2
 
3
- ## v0.0.1-next.12
3
+ ## v0.0.1-next.14
4
4
 
5
5
  - Initial Release
package/docs/examples.md CHANGED
@@ -207,5 +207,5 @@ This will output the proof as a set of data containing the type and a value in b
207
207
  This command will verify a proof using the specified verification method.
208
208
 
209
209
  ```shell
210
- twin-identity proof-verify --load-env config.env verification-method.env --id !DID_VERIFICATION_METHOD_ID --data aGVsbG8gd29ybGQ= --type Ed25519 --value lrPdZ+Gfgc8w/ha2YU7hil8s+gykFHAdmIEdJdraWeRkkb8nHHF1PLKs4gGPXCT1mqBIwiwOgz5V0JKIg00UDg==
210
+ twin-identity proof-verify --load-env config.env verification-method.env --id !DID_VERIFICATION_METHOD_ID --data aGVsbG8gd29ybGQ= --cryptosuite eddsa-jcs-2022 --value 5LVrNuqQzQxnLMxwwpkE1smcD9Zpygg3gvJ6xvwdcLGrhk4yXFW8jewGY5Z3kRMKL1dasqw6ABBCcNgUv1pngnzA
211
211
  ```
package/locales/en.json CHANGED
@@ -272,9 +272,7 @@
272
272
  "creatingProof": "Creating Proof"
273
273
  },
274
274
  "labels": {
275
- "verificationMethodId": "Verification Method Id",
276
- "type": "Proof Type",
277
- "value": "Proof Value"
275
+ "verificationMethodId": "Verification Method Id"
278
276
  }
279
277
  },
280
278
  "proof-verify": {
@@ -289,9 +287,9 @@
289
287
  "param": "--data '<'data'>'",
290
288
  "description": "The base64 or hex encoded data to verify the proof for, or start with ! to read environment variable."
291
289
  },
292
- "type": {
293
- "param": "--type '<'type'>'",
294
- "description": "The type of the proof, or start with ! to read environment variable."
290
+ "cryptosuite": {
291
+ "param": "--cryptosuite '<'cryptosuite'>'",
292
+ "description": "The cryptosuite of the proof, or start with ! to read environment variable."
295
293
  },
296
294
  "value": {
297
295
  "param": "--value '<'value'>'",
@@ -303,7 +301,7 @@
303
301
  },
304
302
  "labels": {
305
303
  "verificationMethodId": "Verification Method Id",
306
- "type": "Proof Type",
304
+ "cryptosuite": "Proof Cryptosuite",
307
305
  "value": "Proof Value",
308
306
  "isVerified": "Is Verified"
309
307
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/identity-cli",
3
- "version": "0.0.1-next.12",
3
+ "version": "0.0.1-next.14",
4
4
  "description": "A command line interface for interacting with the identity connectors",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,8 +22,8 @@
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.12",
26
- "@twin.org/identity-models": "0.0.1-next.12",
25
+ "@twin.org/identity-connector-iota": "0.0.1-next.14",
26
+ "@twin.org/identity-models": "0.0.1-next.14",
27
27
  "@twin.org/nameof": "next",
28
28
  "@twin.org/standards-w3c-did": "next",
29
29
  "@twin.org/vault-connector-entity-storage": "next",