@twin.org/crypto-cli 0.0.3-next.8 → 0.0.3

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/README.md CHANGED
@@ -1,16 +1,16 @@
1
1
  # TWIN Crypto CLI
2
2
 
3
- A command line interface for interacting with the crypto tools.
3
+ This application is part of the framework workspace and provides command line interface for interacting with the crypto tools to support consistent development workflows across the ecosystem.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  ```shell
8
- npm install @twin.org/crypto-cli
8
+ npm install -D @twin.org/crypto-cli
9
9
  ```
10
10
 
11
- ## Examples
11
+ ## Usage
12
12
 
13
- Usage of the tool is shown in the examples [docs/examples.md](docs/examples.md)
13
+ Usage of the tool is shown in the examples [docs/usage.md](docs/usage.md)
14
14
 
15
15
  ## Reference
16
16
 
package/bin/index.js CHANGED
File without changes
package/dist/es/cli.js CHANGED
@@ -21,8 +21,8 @@ export class CLI extends CLIBase {
21
21
  return this.execute({
22
22
  title: "TWIN Crypto",
23
23
  appName: "twin-crypto",
24
- version: "0.0.3-next.8", // x-release-please-version
25
- icon: "🌍",
24
+ version: "0.0.3", // x-release-please-version
25
+ icon: "🔒",
26
26
  supportsEnvFiles: true,
27
27
  overrideOutputWidth: options?.overrideOutputWidth,
28
28
  showDevToolWarning: true
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;GAEG;AACH,MAAM,OAAO,GAAI,SAAQ,OAAO;IAC/B;;;;;;;OAOG;IACI,KAAK,CAAC,GAAG,CACf,IAAc,EACd,gBAAyB,EACzB,OAA0C;QAE1C,OAAO,IAAI,CAAC,OAAO,CAClB;YACC,KAAK,EAAE,aAAa;YACpB,OAAO,EAAE,aAAa;YACtB,OAAO,EAAE,cAAc,EAAE,2BAA2B;YACpD,IAAI,EAAE,IAAI;YACV,gBAAgB,EAAE,IAAI;YACtB,mBAAmB,EAAE,OAAO,EAAE,mBAAmB;YACjD,kBAAkB,EAAE,IAAI;SACxB,EACD,gBAAgB,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY,CAAC,EACzF,IAAI,CACJ,CAAC;IACH,CAAC;IAED;;;;OAIG;IACO,WAAW,CAAC,OAAgB;QACrC,OAAO,CAAC,oBAAoB,EAAE,EAAE,mBAAmB,EAAE,CAAC,CAAC;IACxD,CAAC;CACD","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { CLIBase } from \"@twin.org/cli-core\";\nimport type { Command } from \"commander\";\nimport { buildCommandAddress } from \"./commands/address.js\";\nimport { buildCommandMnemonic } from \"./commands/mnemonic.js\";\n\n/**\n * The main entry point for the CLI.\n */\nexport class CLI extends CLIBase {\n\t/**\n\t * Run the app.\n\t * @param argv The process arguments.\n\t * @param localesDirectory The directory for the locales, default to relative to the script.\n\t * @param options Additional options.\n\t * @param options.overrideOutputWidth Override the output width.\n\t * @returns The exit code.\n\t */\n\tpublic async run(\n\t\targv: string[],\n\t\tlocalesDirectory?: string,\n\t\toptions?: { overrideOutputWidth?: number }\n\t): Promise<number> {\n\t\treturn this.execute(\n\t\t\t{\n\t\t\t\ttitle: \"TWIN Crypto\",\n\t\t\t\tappName: \"twin-crypto\",\n\t\t\t\tversion: \"0.0.3-next.8\", // x-release-please-version\n\t\t\t\ticon: \"🌍\",\n\t\t\t\tsupportsEnvFiles: true,\n\t\t\t\toverrideOutputWidth: options?.overrideOutputWidth,\n\t\t\t\tshowDevToolWarning: true\n\t\t\t},\n\t\t\tlocalesDirectory ?? path.join(path.dirname(fileURLToPath(import.meta.url)), \"../locales\"),\n\t\t\targv\n\t\t);\n\t}\n\n\t/**\n\t * Get the commands for the CLI.\n\t * @param program The main program to add the commands to.\n\t * @internal\n\t */\n\tprotected getCommands(program: Command): Command[] {\n\t\treturn [buildCommandMnemonic(), buildCommandAddress()];\n\t}\n}\n"]}
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;GAEG;AACH,MAAM,OAAO,GAAI,SAAQ,OAAO;IAC/B;;;;;;;OAOG;IACI,KAAK,CAAC,GAAG,CACf,IAAc,EACd,gBAAyB,EACzB,OAA0C;QAE1C,OAAO,IAAI,CAAC,OAAO,CAClB;YACC,KAAK,EAAE,aAAa;YACpB,OAAO,EAAE,aAAa;YACtB,OAAO,EAAE,OAAO,EAAE,2BAA2B;YAC7C,IAAI,EAAE,IAAI;YACV,gBAAgB,EAAE,IAAI;YACtB,mBAAmB,EAAE,OAAO,EAAE,mBAAmB;YACjD,kBAAkB,EAAE,IAAI;SACxB,EACD,gBAAgB,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY,CAAC,EACzF,IAAI,CACJ,CAAC;IACH,CAAC;IAED;;;;OAIG;IACO,WAAW,CAAC,OAAgB;QACrC,OAAO,CAAC,oBAAoB,EAAE,EAAE,mBAAmB,EAAE,CAAC,CAAC;IACxD,CAAC;CACD","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { CLIBase } from \"@twin.org/cli-core\";\nimport type { Command } from \"commander\";\nimport { buildCommandAddress } from \"./commands/address.js\";\nimport { buildCommandMnemonic } from \"./commands/mnemonic.js\";\n\n/**\n * The main entry point for the CLI.\n */\nexport class CLI extends CLIBase {\n\t/**\n\t * Run the app.\n\t * @param argv The process arguments.\n\t * @param localesDirectory The directory for the locales, default to relative to the script.\n\t * @param options Additional options.\n\t * @param options.overrideOutputWidth Override the output width.\n\t * @returns The exit code.\n\t */\n\tpublic async run(\n\t\targv: string[],\n\t\tlocalesDirectory?: string,\n\t\toptions?: { overrideOutputWidth?: number }\n\t): Promise<number> {\n\t\treturn this.execute(\n\t\t\t{\n\t\t\t\ttitle: \"TWIN Crypto\",\n\t\t\t\tappName: \"twin-crypto\",\n\t\t\t\tversion: \"0.0.3\", // x-release-please-version\n\t\t\t\ticon: \"🔒\",\n\t\t\t\tsupportsEnvFiles: true,\n\t\t\t\toverrideOutputWidth: options?.overrideOutputWidth,\n\t\t\t\tshowDevToolWarning: true\n\t\t\t},\n\t\t\tlocalesDirectory ?? path.join(path.dirname(fileURLToPath(import.meta.url)), \"../locales\"),\n\t\t\targv\n\t\t);\n\t}\n\n\t/**\n\t * Get the commands for the CLI.\n\t * @param program The main program to add the commands to.\n\t * @internal\n\t */\n\tprotected getCommands(program: Command): Command[] {\n\t\treturn [buildCommandMnemonic(), buildCommandAddress()];\n\t}\n}\n"]}
@@ -87,6 +87,8 @@
87
87
  "urn": "Property \"{property}\" must be a Urn formatted string, it is \"{value}\"",
88
88
  "url": "Property \"{property}\" must be a Url formatted string, it is \"{value}\"",
89
89
  "email": "Property \"{property}\" must be string in e-mail format, it is \"{value}\"",
90
+ "uuidV7": "Property \"{property}\" must be a UUIDv7 formatted string, it is \"{value}\"",
91
+ "uuidV7Compact": "Property \"{property}\" must be a UUIDv7 formatted string in compact mode, it is \"{value}\"",
90
92
  "length32Multiple": "Property \"{property}\" should be a multiple of 32, it is {value}",
91
93
  "lengthEntropy": "Property \"{property}\" should be a multiple of 4, >=16 and <= 32, it is {value}"
92
94
  },
@@ -101,7 +103,8 @@
101
103
  },
102
104
  "factory": {
103
105
  "noUnregister": "There is no {typeName} registered with the name \"{name}\"",
104
- "noGet": "The requested {typeName} \"{name}\" does not exist in the factory"
106
+ "noGet": "The requested {typeName} \"{name}\" does not exist in the factory",
107
+ "noCreate": "The requested {typeName} \"{name}\" cannot be created by the factory, with params \"{params}\""
105
108
  },
106
109
  "bitString": {
107
110
  "outOfRange": "The index should be >= 0 and less than the length of the bit string, the index is \"{index}\" and the number of bit is \"{numberBits}\""
@@ -118,6 +121,12 @@
118
121
  "jsonHelper": {
119
122
  "failedPatch": "Failed to patch the JSON object, patch index \"{index}\" failed"
120
123
  },
124
+ "mutex": {
125
+ "lockNotFound": "The key \"{key}\" has no active lock",
126
+ "lockAlreadyReleased": "The key \"{key}\" is not currently locked",
127
+ "lockTimeout": "Failed to acquire lock for key \"{key}\" within the timeout of {timeout} milliseconds",
128
+ "bufferFetchFailed": "Failed to retrieve shared buffer for key \"{key}\" from the main thread"
129
+ },
121
130
  "ed25519": {
122
131
  "privateKeyLength": "The private key length is incorrect, it should be \"{requiredSize}\" but is \"{actualSize}\"",
123
132
  "publicKeyLength": "The public key length is incorrect, it should be \"{requiredSize}\" but is \"{actualSize}\""
@@ -153,6 +162,9 @@
153
162
  },
154
163
  "slip0010": {
155
164
  "invalidSeed": "The seed is invalid \"{seed}\""
165
+ },
166
+ "pbkdf2": {
167
+ "keyLengthTooSmall": "The key length must be at least 1, it is \"{keyLength}\""
156
168
  }
157
169
  },
158
170
  "warn": {