@tinycloud/cli 1.5.0-beta.33 → 1.5.0-beta.35
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/index.js +4 -10
- package/dist/index.js.map +1 -1
- package/dist/legacy-entry.js +8 -14
- package/dist/legacy-entry.js.map +1 -1
- package/package.json +6 -6
package/dist/legacy-entry.js
CHANGED
|
@@ -44322,7 +44322,6 @@ function registerSecretsCommand(program, openKeyAcquisition) {
|
|
|
44322
44322
|
|
|
44323
44323
|
// src/commands/share.ts
|
|
44324
44324
|
import { Option } from "commander";
|
|
44325
|
-
import { readFile as readFile18 } from "fs/promises";
|
|
44326
44325
|
import { CLI_NAME as CLI_NAME34 } from "@tinycloud/operations/cli-name";
|
|
44327
44326
|
import { ProfileLockTimeoutError as ProfileLockTimeoutError3 } from "@tinycloud/operations/state";
|
|
44328
44327
|
init_errors();
|
|
@@ -45996,19 +45995,16 @@ function registerShareCommand(program) {
|
|
|
45996
45995
|
try {
|
|
45997
45996
|
const json = jsonOutput(options, command);
|
|
45998
45997
|
if (options.ongoing === true) throw new CLIError("UNSUPPORTED_TARGET", ONGOING_UNAVAILABLE, 2);
|
|
45998
|
+
const target = parseShareTarget(options.to);
|
|
45999
|
+
if (target.kind === "email") throw new CLIError("UNAVAILABLE", "email-addressed shares are not available in this release; nothing was shared", 4);
|
|
45999
46000
|
const maxBytes = byteLimit(options.maxBytes);
|
|
46000
46001
|
if (files.length === 0 || files.includes("-") && files.length > 1) throw new CLIError("INVALID_ARGUMENT", "stdin must be the only publish input", 2);
|
|
46001
46002
|
const name = files.length === 1 ? options.name : void 0;
|
|
46002
|
-
const target = parseShareTarget(options.to);
|
|
46003
46003
|
const actions = requestedActions(options.action);
|
|
46004
46004
|
if (options.notify === true && !actions.includes("read")) throw new CLIError("INVALID_ARGUMENT", "--notify requires the read action; nothing was shared", 2);
|
|
46005
|
-
if (
|
|
46006
|
-
throw new CLIError("INVALID_ARGUMENT", "email publication requires --credential-descriptor, --issuer-did, and --issuer-kid", 2);
|
|
46007
|
-
}
|
|
46008
|
-
if (target.kind !== "email" && (options.credentialDescriptor || options.issuerDid || options.issuerKid)) {
|
|
46005
|
+
if (options.credentialDescriptor || options.issuerDid || options.issuerKid) {
|
|
46009
46006
|
throw new CLIError("INVALID_ARGUMENT", "credential options require an exact email target", 2);
|
|
46010
46007
|
}
|
|
46011
|
-
const credentialDescriptor = target.kind === "email" ? JSON.parse(await readFile18(options.credentialDescriptor, "utf8")) : void 0;
|
|
46012
46008
|
const folder = files.length === 1 && target.kind === "bearer" && options.prefix !== true && await isDirectoryInput(files[0]);
|
|
46013
46009
|
let inputs;
|
|
46014
46010
|
if (folder) {
|
|
@@ -46034,8 +46030,7 @@ function registerShareCommand(program) {
|
|
|
46034
46030
|
throw new CLIError("INVALID_ARGUMENT", "--notify-to requires --to domain:<name> --notify", 2);
|
|
46035
46031
|
}
|
|
46036
46032
|
let notifyRecipient;
|
|
46037
|
-
if (options.notify === true && target.kind === "
|
|
46038
|
-
else if (options.notify === true && target.kind === "emailDomain") {
|
|
46033
|
+
if (options.notify === true && target.kind === "emailDomain") {
|
|
46039
46034
|
const mailbox = options.notifyTo === void 0 ? void 0 : canonicalMailbox(options.notifyTo);
|
|
46040
46035
|
if (mailbox === void 0 || mailbox.domain !== target.domain) {
|
|
46041
46036
|
throw new CLIError("INVALID_ARGUMENT", "--to domain:<name> --notify requires --notify-to <email> at that exact domain (node 1.17.3+)", 2);
|
|
@@ -46059,7 +46054,6 @@ function registerShareCommand(program) {
|
|
|
46059
46054
|
origin: options.viewerOrigin,
|
|
46060
46055
|
...maxBytes === void 0 ? {} : { maxBytes },
|
|
46061
46056
|
notify: options.notify === true,
|
|
46062
|
-
...credentialDescriptor === void 0 ? {} : { credentialDescriptor, issuerDid: options.issuerDid, issuerKid: options.issuerKid },
|
|
46063
46057
|
// The artifact request rides on the adapter call rather than through `publishTargetShare`, whose code is part of
|
|
46064
46058
|
// the browser bundles (the web-sdk size ceiling counts every byte it carries).
|
|
46065
46059
|
targetAdapter: artifact === void 0 || shareServices.targetAdapter === void 0 ? shareServices.targetAdapter : { publish: (request) => shareServices.targetAdapter.publish({ ...request, artifact }) }
|
|
@@ -47195,7 +47189,7 @@ function registerUpgradeCommand(program) {
|
|
|
47195
47189
|
}
|
|
47196
47190
|
|
|
47197
47191
|
// src/commands/vault.ts
|
|
47198
|
-
import { readFile as
|
|
47192
|
+
import { readFile as readFile18 } from "fs/promises";
|
|
47199
47193
|
init_profiles();
|
|
47200
47194
|
init_formatter();
|
|
47201
47195
|
init_errors();
|
|
@@ -47257,7 +47251,7 @@ function registerVaultCommand(program) {
|
|
|
47257
47251
|
throw new CLIError("USAGE_ERROR", "Provide only one of: value argument, --file, or --stdin", ExitCode.USAGE_ERROR);
|
|
47258
47252
|
}
|
|
47259
47253
|
if (options.file) {
|
|
47260
|
-
putValue = new Uint8Array(await
|
|
47254
|
+
putValue = new Uint8Array(await readFile18(options.file));
|
|
47261
47255
|
} else if (options.stdin) {
|
|
47262
47256
|
putValue = new Uint8Array(await readStdin5());
|
|
47263
47257
|
} else {
|
|
@@ -47372,7 +47366,7 @@ function registerVaultCommand(program) {
|
|
|
47372
47366
|
}
|
|
47373
47367
|
|
|
47374
47368
|
// src/commands/vars.ts
|
|
47375
|
-
import { readFile as
|
|
47369
|
+
import { readFile as readFile19 } from "fs/promises";
|
|
47376
47370
|
init_profiles();
|
|
47377
47371
|
init_formatter();
|
|
47378
47372
|
init_errors();
|
|
@@ -47477,7 +47471,7 @@ function registerVarsCommand(program) {
|
|
|
47477
47471
|
throw new CLIError("USAGE_ERROR", "Provide only one of: value argument, --file, or --stdin", ExitCode.USAGE_ERROR);
|
|
47478
47472
|
}
|
|
47479
47473
|
if (options.file) {
|
|
47480
|
-
varValue = await
|
|
47474
|
+
varValue = await readFile19(options.file, "utf-8");
|
|
47481
47475
|
} else if (options.stdin) {
|
|
47482
47476
|
varValue = (await readStdin6()).toString("utf-8");
|
|
47483
47477
|
} else {
|