dropthis 0.1.4 → 0.1.5
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/cli.cjs +1 -22
- package/dist/cli.cjs.map +1 -1
- package/node_modules/@dropthis/sdk/dist/index.cjs +30 -72
- package/node_modules/@dropthis/sdk/dist/index.cjs.map +1 -1
- package/node_modules/@dropthis/sdk/dist/index.d.cts +1 -20
- package/node_modules/@dropthis/sdk/dist/index.d.ts +1 -20
- package/node_modules/@dropthis/sdk/dist/index.mjs +30 -72
- package/node_modules/@dropthis/sdk/dist/index.mjs.map +1 -1
- package/node_modules/@dropthis/sdk/package.json +4 -0
- package/package.json +6 -3
package/dist/cli.cjs
CHANGED
|
@@ -706,7 +706,6 @@ async function handlePublishDryRun(input, raw, deps) {
|
|
|
706
706
|
const prepared = await deps.client.prepare(input, options);
|
|
707
707
|
const output = formatDryRunOutput(prepared);
|
|
708
708
|
validateDryRunOutput(output);
|
|
709
|
-
warnInlineSize(output, deps);
|
|
710
709
|
deps.stdout(`${JSON.stringify(output, null, 2)}
|
|
711
710
|
`);
|
|
712
711
|
return { exitCode: 0 };
|
|
@@ -764,11 +763,7 @@ async function dryRunMultiFile(inputs, options, deps) {
|
|
|
764
763
|
`);
|
|
765
764
|
return { exitCode: 0 };
|
|
766
765
|
}
|
|
767
|
-
var MAX_INLINE_CONTENT_BYTES = 1048576;
|
|
768
766
|
function formatDryRunOutput(prepared) {
|
|
769
|
-
if (prepared.kind === "json") {
|
|
770
|
-
return { dryRun: true, kind: "json", body: prepared.body };
|
|
771
|
-
}
|
|
772
767
|
const totalBytes = prepared.manifest.files.reduce(
|
|
773
768
|
(sum, f) => sum + f.sizeBytes,
|
|
774
769
|
0
|
|
@@ -785,19 +780,6 @@ function formatDryRunOutput(prepared) {
|
|
|
785
780
|
totalBytes
|
|
786
781
|
};
|
|
787
782
|
}
|
|
788
|
-
function warnInlineSize(output, deps) {
|
|
789
|
-
if (output.kind !== "json") return;
|
|
790
|
-
const body = output.body;
|
|
791
|
-
const content = body?.content;
|
|
792
|
-
if (typeof content !== "string") return;
|
|
793
|
-
const sizeBytes = Buffer.byteLength(content);
|
|
794
|
-
if (sizeBytes > MAX_INLINE_CONTENT_BYTES) {
|
|
795
|
-
deps.stderr(
|
|
796
|
-
`${JSON.stringify({ warning: `Inline content is ${sizeBytes} bytes, exceeding the ${MAX_INLINE_CONTENT_BYTES} byte threshold. The server will use staged upload.` })}
|
|
797
|
-
`
|
|
798
|
-
);
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
783
|
function validateDryRunOutput(output) {
|
|
802
784
|
if (output.kind !== "staged") return;
|
|
803
785
|
const manifest = output.manifest;
|
|
@@ -975,9 +957,6 @@ async function handleUpdateDryRun(target, input, raw, deps) {
|
|
|
975
957
|
}
|
|
976
958
|
var MAX_BUNDLE_FILE_COUNT2 = 200;
|
|
977
959
|
function formatUpdateDryRun(target, prepared) {
|
|
978
|
-
if (prepared.kind === "json") {
|
|
979
|
-
return { dryRun: true, kind: "json", target, body: prepared.body };
|
|
980
|
-
}
|
|
981
960
|
const totalBytes = prepared.manifest.files.reduce(
|
|
982
961
|
(sum, f) => sum + f.sizeBytes,
|
|
983
962
|
0
|
|
@@ -1182,7 +1161,7 @@ async function writeCredentialFile(path, credential) {
|
|
|
1182
1161
|
function buildProgram(options = {}) {
|
|
1183
1162
|
const program = new import_commander.Command();
|
|
1184
1163
|
const store = options.store ?? new MemoryCredentialStore();
|
|
1185
|
-
program.name("dropthis").description("Publish anything online and get a URL back.").version("0.1.
|
|
1164
|
+
program.name("dropthis").description("Publish anything online and get a URL back.").version("0.1.5");
|
|
1186
1165
|
program.option("--api-key <key>", "Override API key for this invocation");
|
|
1187
1166
|
program.option("--api-url <url>", "Override API base URL");
|
|
1188
1167
|
program.option("--json", "Force JSON output");
|