trajectories-sh 1.18.7 → 1.18.8
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.js
CHANGED
|
@@ -98,7 +98,7 @@ async function uploadTrajectoryAction(pathArg, opts) {
|
|
|
98
98
|
);
|
|
99
99
|
}
|
|
100
100
|
if (isZip) {
|
|
101
|
-
const { uploadZip } = await import("./upload-
|
|
101
|
+
const { uploadZip } = await import("./upload-5RQ45JUQ.js");
|
|
102
102
|
const slug2 = opts.slug ?? pathArg.replace(/\.zip$/i, "").replace(/\/+$/, "").split("/").pop();
|
|
103
103
|
console.log(chalk.bold(`
|
|
104
104
|
Uploading ZIP ${pathArg} \u2192 ${chalk.cyan(slug2)}
|
|
@@ -127,7 +127,7 @@ async function uploadTrajectoryAction(pathArg, opts) {
|
|
|
127
127
|
Uploading trajectory ${pathArg} \u2192 ${chalk.cyan(slug)}
|
|
128
128
|
`));
|
|
129
129
|
try {
|
|
130
|
-
const { uploadJob } = await import("./upload-
|
|
130
|
+
const { uploadJob } = await import("./upload-5RQ45JUQ.js");
|
|
131
131
|
const result = await uploadJob(pathArg, {
|
|
132
132
|
slug,
|
|
133
133
|
name: opts.name
|
|
@@ -51,7 +51,7 @@ async function apiPost(path, body, timeout = 3e5) {
|
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
async function uploadZip(zipPath, opts) {
|
|
54
|
-
const {
|
|
54
|
+
const { statSync: _statSync } = await import("fs");
|
|
55
55
|
const fileStat = _statSync(zipPath);
|
|
56
56
|
const sizeBytes = fileStat.size;
|
|
57
57
|
const sizeMB = (sizeBytes / (1024 * 1024)).toFixed(1);
|
|
@@ -73,12 +73,13 @@ async function uploadZip(zipPath, opts) {
|
|
|
73
73
|
const uploadInfo = await infoResp.json();
|
|
74
74
|
const task_id = uploadInfo.task_id;
|
|
75
75
|
console.log(" Uploading ZIP via resumable upload...");
|
|
76
|
-
const
|
|
76
|
+
const { createReadStream } = await import("fs");
|
|
77
77
|
const tus = await import("tus-js-client");
|
|
78
|
-
const projectRef = uploadInfo.supabase_url.replace("https://", "").replace(".supabase.co", "");
|
|
79
78
|
await new Promise((resolve, reject) => {
|
|
80
|
-
const
|
|
79
|
+
const fileStream = createReadStream(zipPath);
|
|
80
|
+
const upload = new tus.Upload(fileStream, {
|
|
81
81
|
endpoint: `${uploadInfo.supabase_url}/storage/v1/upload/resumable`,
|
|
82
|
+
uploadSize: sizeBytes,
|
|
82
83
|
retryDelays: [0, 3e3, 5e3, 1e4],
|
|
83
84
|
headers: {
|
|
84
85
|
authorization: `Bearer ${uploadInfo.service_key}`,
|