@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/index.js
CHANGED
|
@@ -15199,7 +15199,6 @@ init_profiles();
|
|
|
15199
15199
|
|
|
15200
15200
|
// src/commands/share.ts
|
|
15201
15201
|
import { Option } from "commander";
|
|
15202
|
-
import { readFile as readFile8 } from "fs/promises";
|
|
15203
15202
|
import { CLI_NAME as CLI_NAME12 } from "@tinycloud/operations/cli-name";
|
|
15204
15203
|
|
|
15205
15204
|
// ../share-sdk/dist/artifact.js
|
|
@@ -33060,19 +33059,16 @@ function registerShareCommand(program2) {
|
|
|
33060
33059
|
try {
|
|
33061
33060
|
const json = jsonOutput(options, command);
|
|
33062
33061
|
if (options.ongoing === true) throw new CLIError("UNSUPPORTED_TARGET", ONGOING_UNAVAILABLE, 2);
|
|
33062
|
+
const target = parseShareTarget(options.to);
|
|
33063
|
+
if (target.kind === "email") throw new CLIError("UNAVAILABLE", "email-addressed shares are not available in this release; nothing was shared", 4);
|
|
33063
33064
|
const maxBytes = byteLimit(options.maxBytes);
|
|
33064
33065
|
if (files.length === 0 || files.includes("-") && files.length > 1) throw new CLIError("INVALID_ARGUMENT", "stdin must be the only publish input", 2);
|
|
33065
33066
|
const name = files.length === 1 ? options.name : void 0;
|
|
33066
|
-
const target = parseShareTarget(options.to);
|
|
33067
33067
|
const actions = requestedActions(options.action);
|
|
33068
33068
|
if (options.notify === true && !actions.includes("read")) throw new CLIError("INVALID_ARGUMENT", "--notify requires the read action; nothing was shared", 2);
|
|
33069
|
-
if (
|
|
33070
|
-
throw new CLIError("INVALID_ARGUMENT", "email publication requires --credential-descriptor, --issuer-did, and --issuer-kid", 2);
|
|
33071
|
-
}
|
|
33072
|
-
if (target.kind !== "email" && (options.credentialDescriptor || options.issuerDid || options.issuerKid)) {
|
|
33069
|
+
if (options.credentialDescriptor || options.issuerDid || options.issuerKid) {
|
|
33073
33070
|
throw new CLIError("INVALID_ARGUMENT", "credential options require an exact email target", 2);
|
|
33074
33071
|
}
|
|
33075
|
-
const credentialDescriptor = target.kind === "email" ? JSON.parse(await readFile8(options.credentialDescriptor, "utf8")) : void 0;
|
|
33076
33072
|
const folder = files.length === 1 && target.kind === "bearer" && options.prefix !== true && await isDirectoryInput(files[0]);
|
|
33077
33073
|
let inputs;
|
|
33078
33074
|
if (folder) {
|
|
@@ -33098,8 +33094,7 @@ function registerShareCommand(program2) {
|
|
|
33098
33094
|
throw new CLIError("INVALID_ARGUMENT", "--notify-to requires --to domain:<name> --notify", 2);
|
|
33099
33095
|
}
|
|
33100
33096
|
let notifyRecipient;
|
|
33101
|
-
if (options.notify === true && target.kind === "
|
|
33102
|
-
else if (options.notify === true && target.kind === "emailDomain") {
|
|
33097
|
+
if (options.notify === true && target.kind === "emailDomain") {
|
|
33103
33098
|
const mailbox = options.notifyTo === void 0 ? void 0 : canonicalMailbox2(options.notifyTo);
|
|
33104
33099
|
if (mailbox === void 0 || mailbox.domain !== target.domain) {
|
|
33105
33100
|
throw new CLIError("INVALID_ARGUMENT", "--to domain:<name> --notify requires --notify-to <email> at that exact domain (node 1.17.3+)", 2);
|
|
@@ -33123,7 +33118,6 @@ function registerShareCommand(program2) {
|
|
|
33123
33118
|
origin: options.viewerOrigin,
|
|
33124
33119
|
...maxBytes === void 0 ? {} : { maxBytes },
|
|
33125
33120
|
notify: options.notify === true,
|
|
33126
|
-
...credentialDescriptor === void 0 ? {} : { credentialDescriptor, issuerDid: options.issuerDid, issuerKid: options.issuerKid },
|
|
33127
33121
|
// The artifact request rides on the adapter call rather than through `publishTargetShare`, whose code is part of
|
|
33128
33122
|
// the browser bundles (the web-sdk size ceiling counts every byte it carries).
|
|
33129
33123
|
targetAdapter: artifact === void 0 || shareServices.targetAdapter === void 0 ? shareServices.targetAdapter : { publish: (request) => shareServices.targetAdapter.publish({ ...request, artifact }) }
|