@ardrive/turbo-sdk 1.13.0 → 1.14.0-alpha.2

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.
@@ -1,99 +1,31 @@
1
- import { Command } from 'commander';
2
- import { TokenType, TurboUnauthenticatedConfiguration } from '../node/index.js';
3
- import { GlobalOptions, WalletOptions } from './types.js';
1
+ import { Command, OptionValues } from 'commander';
2
+ import { TokenType, TurboAuthenticatedClient, TurboUnauthenticatedConfiguration } from '../node/index.js';
3
+ import { AddressOptions, GlobalOptions, UploadFolderOptions, WalletOptions } from './types.js';
4
+ export declare function exitWithErrorLog(error: unknown): void;
5
+ export declare function runCommand<O extends OptionValues>(command: Command, action: (options: O) => Promise<void>): Promise<void>;
4
6
  interface CommanderOption {
5
7
  alias: string;
6
8
  description: string;
7
9
  default?: string | boolean;
8
10
  }
9
- export declare const optionMap: {
10
- readonly token: {
11
- readonly alias: "-t, --token <type>";
12
- readonly description: "Crypto token type for wallet or action";
13
- readonly default: "arweave";
14
- };
15
- readonly currency: {
16
- readonly alias: "-c, --currency <currency>";
17
- readonly description: "Fiat currency type to use for the action";
18
- readonly default: "usd";
19
- };
20
- readonly address: {
21
- readonly alias: "-a, --address <nativeAddress>";
22
- readonly description: "Native address to use for action";
23
- };
24
- readonly value: {
25
- readonly alias: "-v, --value <value>";
26
- readonly description: "Value of fiat currency or crypto token for action. e.g: 10.50 for $10.50 USD or 0.0001 for 0.0001 AR";
27
- };
28
- readonly walletFile: {
29
- readonly alias: "-w, --wallet-file <filePath>";
30
- readonly description: "Wallet file to use with the action. Formats accepted: JWK.json, KYVE or ETH private key as a string, or SOL Secret Key as a Uint8Array";
31
- };
32
- readonly mnemonic: {
33
- readonly alias: "-m, --mnemonic <phrase>";
34
- readonly description: "Mnemonic to use with the action";
35
- };
36
- readonly privateKey: {
37
- readonly alias: "-p, --private-key <key>";
38
- readonly description: "Private key to use with the action";
39
- };
40
- readonly gateway: {
41
- readonly alias: "-g, --gateway <url>";
42
- readonly description: "Set a custom crypto gateway URL";
43
- readonly default: undefined;
44
- };
45
- readonly dev: {
46
- readonly alias: "--dev";
47
- readonly description: "Enable development endpoints";
48
- readonly default: false;
49
- };
50
- readonly debug: {
51
- readonly alias: "--debug";
52
- readonly description: "Enable verbose logging";
53
- readonly default: false;
54
- };
55
- readonly quiet: {
56
- readonly alias: "--quiet";
57
- readonly description: "Disable logging";
58
- readonly default: false;
59
- };
60
- };
61
- export declare const walletOptions: ({
62
- readonly alias: "-w, --wallet-file <filePath>";
63
- readonly description: "Wallet file to use with the action. Formats accepted: JWK.json, KYVE or ETH private key as a string, or SOL Secret Key as a Uint8Array";
64
- } | {
65
- readonly alias: "-m, --mnemonic <phrase>";
66
- readonly description: "Mnemonic to use with the action";
67
- } | {
68
- readonly alias: "-p, --private-key <key>";
69
- readonly description: "Private key to use with the action";
70
- })[];
71
- export declare const globalOptions: ({
72
- readonly alias: "-t, --token <type>";
73
- readonly description: "Crypto token type for wallet or action";
74
- readonly default: "arweave";
75
- } | {
76
- readonly alias: "-g, --gateway <url>";
77
- readonly description: "Set a custom crypto gateway URL";
78
- readonly default: undefined;
79
- } | {
80
- readonly alias: "--dev";
81
- readonly description: "Enable development endpoints";
82
- readonly default: false;
83
- } | {
84
- readonly alias: "--debug";
85
- readonly description: "Enable verbose logging";
86
- readonly default: false;
87
- } | {
88
- readonly alias: "--quiet";
89
- readonly description: "Disable logging";
90
- readonly default: false;
91
- })[];
92
11
  export declare function applyOptions(command: Command, options: CommanderOption[]): Command;
93
12
  export declare function tokenFromOptions(options: unknown): TokenType;
94
13
  export declare function valueFromOptions(options: unknown): string;
14
+ export declare function getFolderPathFromOptions(options: unknown): string;
15
+ export declare function addressOrPrivateKeyFromOptions(options: AddressOptions): Promise<{
16
+ address: string | undefined;
17
+ privateKey: string | undefined;
18
+ }>;
95
19
  export declare function optionalPrivateKeyFromOptions(options: WalletOptions): Promise<string | undefined>;
96
20
  export declare function privateKeyFromOptions({ mnemonic, privateKey, walletFile, token, }: WalletOptions): Promise<string>;
97
- export declare function configFromOptions({ gateway, dev, token, }: GlobalOptions): TurboUnauthenticatedConfiguration;
21
+ export declare function configFromOptions(options: GlobalOptions): TurboUnauthenticatedConfiguration;
22
+ export declare function turboFromOptions(options: WalletOptions): Promise<TurboAuthenticatedClient>;
23
+ export declare function getUploadFolderOptions(options: UploadFolderOptions): {
24
+ folderPath: string;
25
+ indexFile: string | undefined;
26
+ fallbackFile: string | undefined;
27
+ disableManifest: boolean;
28
+ maxConcurrentUploads: number;
29
+ };
98
30
  export {};
99
31
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/cli/utils.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EACL,SAAS,EACT,iCAAiC,EAKlC,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE1D,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwDZ,CAAC;AAEX,eAAO,MAAM,aAAa;;;;;;;;;IAIzB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;IAMzB,CAAC;AAEF,wBAAgB,YAAY,CAC1B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,eAAe,EAAE,GACzB,OAAO,CAKT;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,CAU5D;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAMzD;AAED,wBAAsB,6BA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AQ;IAI5C,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIjC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIjC,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,uBAAuB,GAAG,MAAM;IAOtE,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAKzC,oBAAoB,CAAC,cAAc,EAAE,MAAM,GAAG,QAAQ;CAGvD"}
1
+ {"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../src/node/upload.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,OAAO,EACL,mCAAmC,EAEpC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEL,4CAA4C,EAC5C,uBAAuB,EAExB,MAAM,aAAa,CAAC;AAErB,qBAAa,+BAAgC,SAAQ,mCAAmC;gBAC1E,EACV,GAA6B,EAC7B,WAAW,EACX,MAAM,EACN,MAAM,EACN,KAAK,GACN,EAAE,4CAA4C;YAIjC,8BAA8B;IAyB5C,QAAQ,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAO5D,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ;IAI5C,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIjC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIjC,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,uBAAuB,GAAG,MAAM;IAOtE,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAKzC,oBAAoB,CAAC,cAAc,EAAE,MAAM,GAAG,QAAQ;CAGvD"}
@@ -14,5 +14,5 @@
14
14
  * You should have received a copy of the GNU Affero General Public License
15
15
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  */
17
- export declare const version = "1.13.0-alpha.2";
17
+ export declare const version = "1.14.0-alpha.1";
18
18
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ardrive/turbo-sdk",
3
- "version": "1.13.0",
3
+ "version": "1.14.0-alpha.2",
4
4
  "main": "./lib/cjs/node/index.js",
5
5
  "types": "./lib/types/node/index.d.ts",
6
6
  "module": "./lib/esm/node/index.js",