@vm0/cli 9.132.11 → 9.135.0
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/{chunk-S72CJD3V.js → chunk-7C3QXZRH.js} +210 -39
- package/{chunk-S72CJD3V.js.map → chunk-7C3QXZRH.js.map} +1 -1
- package/index.js +9 -9
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/zero.js +202 -24
- package/zero.js.map +1 -1
|
@@ -28041,7 +28041,7 @@ var require_client_h2 = __commonJS({
|
|
|
28041
28041
|
"use strict";
|
|
28042
28042
|
init_esm_shims();
|
|
28043
28043
|
var assert2 = __require("assert");
|
|
28044
|
-
var { pipeline:
|
|
28044
|
+
var { pipeline: pipeline4 } = __require("stream");
|
|
28045
28045
|
var util3 = require_util();
|
|
28046
28046
|
var {
|
|
28047
28047
|
RequestContentLengthMismatchError,
|
|
@@ -28488,7 +28488,7 @@ var require_client_h2 = __commonJS({
|
|
|
28488
28488
|
}
|
|
28489
28489
|
function writeStream(abort, socket, expectsPayload, h2stream, body, client, request2, contentLength) {
|
|
28490
28490
|
assert2(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
|
|
28491
|
-
const pipe2 =
|
|
28491
|
+
const pipe2 = pipeline4(
|
|
28492
28492
|
body,
|
|
28493
28493
|
h2stream,
|
|
28494
28494
|
(err) => {
|
|
@@ -30546,7 +30546,7 @@ var require_readable = __commonJS({
|
|
|
30546
30546
|
"use strict";
|
|
30547
30547
|
init_esm_shims();
|
|
30548
30548
|
var assert2 = __require("assert");
|
|
30549
|
-
var { Readable:
|
|
30549
|
+
var { Readable: Readable5 } = __require("stream");
|
|
30550
30550
|
var { RequestAbortedError, NotSupportedError, InvalidArgumentError: InvalidArgumentError2, AbortError } = require_errors();
|
|
30551
30551
|
var util3 = require_util();
|
|
30552
30552
|
var { ReadableStreamFrom } = require_util();
|
|
@@ -30558,7 +30558,7 @@ var require_readable = __commonJS({
|
|
|
30558
30558
|
var kContentLength = /* @__PURE__ */ Symbol("kContentLength");
|
|
30559
30559
|
var noop = () => {
|
|
30560
30560
|
};
|
|
30561
|
-
var BodyReadable = class extends
|
|
30561
|
+
var BodyReadable = class extends Readable5 {
|
|
30562
30562
|
constructor({
|
|
30563
30563
|
resume: resume2,
|
|
30564
30564
|
abort,
|
|
@@ -30903,7 +30903,7 @@ var require_api_request = __commonJS({
|
|
|
30903
30903
|
"use strict";
|
|
30904
30904
|
init_esm_shims();
|
|
30905
30905
|
var assert2 = __require("assert");
|
|
30906
|
-
var { Readable:
|
|
30906
|
+
var { Readable: Readable5 } = require_readable();
|
|
30907
30907
|
var { InvalidArgumentError: InvalidArgumentError2, RequestAbortedError } = require_errors();
|
|
30908
30908
|
var util3 = require_util();
|
|
30909
30909
|
var { getResolveErrorBodyCallback } = require_util3();
|
|
@@ -30998,7 +30998,7 @@ var require_api_request = __commonJS({
|
|
|
30998
30998
|
const parsedHeaders = responseHeaders === "raw" ? util3.parseHeaders(rawHeaders) : headers;
|
|
30999
30999
|
const contentType = parsedHeaders["content-type"];
|
|
31000
31000
|
const contentLength = parsedHeaders["content-length"];
|
|
31001
|
-
const res = new
|
|
31001
|
+
const res = new Readable5({
|
|
31002
31002
|
resume: resume2,
|
|
31003
31003
|
abort,
|
|
31004
31004
|
contentType,
|
|
@@ -31317,7 +31317,7 @@ var require_api_pipeline = __commonJS({
|
|
|
31317
31317
|
"use strict";
|
|
31318
31318
|
init_esm_shims();
|
|
31319
31319
|
var {
|
|
31320
|
-
Readable:
|
|
31320
|
+
Readable: Readable5,
|
|
31321
31321
|
Duplex,
|
|
31322
31322
|
PassThrough
|
|
31323
31323
|
} = __require("stream");
|
|
@@ -31331,7 +31331,7 @@ var require_api_pipeline = __commonJS({
|
|
|
31331
31331
|
var { addSignal, removeSignal } = require_abort_signal();
|
|
31332
31332
|
var assert2 = __require("assert");
|
|
31333
31333
|
var kResume = /* @__PURE__ */ Symbol("resume");
|
|
31334
|
-
var PipelineRequest = class extends
|
|
31334
|
+
var PipelineRequest = class extends Readable5 {
|
|
31335
31335
|
constructor() {
|
|
31336
31336
|
super({ autoDestroy: true });
|
|
31337
31337
|
this[kResume] = null;
|
|
@@ -31348,7 +31348,7 @@ var require_api_pipeline = __commonJS({
|
|
|
31348
31348
|
callback(err);
|
|
31349
31349
|
}
|
|
31350
31350
|
};
|
|
31351
|
-
var PipelineResponse = class extends
|
|
31351
|
+
var PipelineResponse = class extends Readable5 {
|
|
31352
31352
|
constructor(resume2) {
|
|
31353
31353
|
super({ autoDestroy: true });
|
|
31354
31354
|
this[kResume] = resume2;
|
|
@@ -31499,7 +31499,7 @@ var require_api_pipeline = __commonJS({
|
|
|
31499
31499
|
util3.destroy(ret, err);
|
|
31500
31500
|
}
|
|
31501
31501
|
};
|
|
31502
|
-
function
|
|
31502
|
+
function pipeline4(opts, handler) {
|
|
31503
31503
|
try {
|
|
31504
31504
|
const pipelineHandler = new PipelineHandler(opts, handler);
|
|
31505
31505
|
this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler);
|
|
@@ -31508,7 +31508,7 @@ var require_api_pipeline = __commonJS({
|
|
|
31508
31508
|
return new PassThrough().destroy(err);
|
|
31509
31509
|
}
|
|
31510
31510
|
}
|
|
31511
|
-
module2.exports =
|
|
31511
|
+
module2.exports = pipeline4;
|
|
31512
31512
|
}
|
|
31513
31513
|
});
|
|
31514
31514
|
|
|
@@ -34696,7 +34696,7 @@ var require_fetch = __commonJS({
|
|
|
34696
34696
|
subresourceSet
|
|
34697
34697
|
} = require_constants3();
|
|
34698
34698
|
var EE = __require("events");
|
|
34699
|
-
var { Readable:
|
|
34699
|
+
var { Readable: Readable5, pipeline: pipeline4, finished } = __require("stream");
|
|
34700
34700
|
var { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = require_util();
|
|
34701
34701
|
var { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require_data_url();
|
|
34702
34702
|
var { getGlobalDispatcher } = require_global2();
|
|
@@ -35597,7 +35597,7 @@ var require_fetch = __commonJS({
|
|
|
35597
35597
|
headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString("latin1"), true);
|
|
35598
35598
|
}
|
|
35599
35599
|
location = headersList.get("location", true);
|
|
35600
|
-
this.body = new
|
|
35600
|
+
this.body = new Readable5({ read: resume2 });
|
|
35601
35601
|
const decoders = [];
|
|
35602
35602
|
const willFollow = location && request2.redirect === "follow" && redirectStatusSet.has(status);
|
|
35603
35603
|
if (request2.method !== "HEAD" && request2.method !== "CONNECT" && !nullBodyStatus.includes(status) && !willFollow) {
|
|
@@ -35640,7 +35640,7 @@ var require_fetch = __commonJS({
|
|
|
35640
35640
|
status,
|
|
35641
35641
|
statusText,
|
|
35642
35642
|
headersList,
|
|
35643
|
-
body: decoders.length ?
|
|
35643
|
+
body: decoders.length ? pipeline4(this.body, ...decoders, (err) => {
|
|
35644
35644
|
if (err) {
|
|
35645
35645
|
this.onError(err);
|
|
35646
35646
|
}
|
|
@@ -39593,7 +39593,7 @@ var require_eventsource = __commonJS({
|
|
|
39593
39593
|
"../../node_modules/.pnpm/undici@6.24.1/node_modules/undici/lib/web/eventsource/eventsource.js"(exports, module2) {
|
|
39594
39594
|
"use strict";
|
|
39595
39595
|
init_esm_shims();
|
|
39596
|
-
var { pipeline:
|
|
39596
|
+
var { pipeline: pipeline4 } = __require("stream");
|
|
39597
39597
|
var { fetching } = require_fetch();
|
|
39598
39598
|
var { makeRequest } = require_request2();
|
|
39599
39599
|
var { webidl } = require_webidl();
|
|
@@ -39751,7 +39751,7 @@ var require_eventsource = __commonJS({
|
|
|
39751
39751
|
));
|
|
39752
39752
|
}
|
|
39753
39753
|
});
|
|
39754
|
-
|
|
39754
|
+
pipeline4(
|
|
39755
39755
|
response.body.stream,
|
|
39756
39756
|
eventSourceStream,
|
|
39757
39757
|
(error49) => {
|
|
@@ -66716,7 +66716,7 @@ if (DSN) {
|
|
|
66716
66716
|
init2({
|
|
66717
66717
|
dsn: DSN,
|
|
66718
66718
|
environment: process.env.SENTRY_ENVIRONMENT ?? "production",
|
|
66719
|
-
release: "9.
|
|
66719
|
+
release: "9.135.0",
|
|
66720
66720
|
sendDefaultPii: false,
|
|
66721
66721
|
tracesSampleRate: 0,
|
|
66722
66722
|
shutdownTimeout: 500,
|
|
@@ -66735,7 +66735,7 @@ if (DSN) {
|
|
|
66735
66735
|
}
|
|
66736
66736
|
});
|
|
66737
66737
|
setContext("cli", {
|
|
66738
|
-
version: "9.
|
|
66738
|
+
version: "9.135.0",
|
|
66739
66739
|
command: process.argv.slice(2).join(" ")
|
|
66740
66740
|
});
|
|
66741
66741
|
setContext("runtime", {
|
|
@@ -94523,15 +94523,10 @@ var webhookUsageEventContract = c11.router({
|
|
|
94523
94523
|
method: "POST",
|
|
94524
94524
|
path: "/api/webhooks/agent/usage-event",
|
|
94525
94525
|
headers: authHeadersSchema,
|
|
94526
|
-
body: external_exports.
|
|
94527
|
-
external_exports.
|
|
94528
|
-
|
|
94529
|
-
|
|
94530
|
-
}).strict(),
|
|
94531
|
-
webhookUsageEventItemSchema.extend({
|
|
94532
|
-
runId: external_exports.string().min(1, "runId is required")
|
|
94533
|
-
}).strict()
|
|
94534
|
-
]),
|
|
94526
|
+
body: external_exports.object({
|
|
94527
|
+
runId: external_exports.string().min(1, "runId is required"),
|
|
94528
|
+
events: external_exports.array(webhookUsageEventItemSchema).min(1).max(100)
|
|
94529
|
+
}).strict(),
|
|
94535
94530
|
responses: {
|
|
94536
94531
|
200: external_exports.object({
|
|
94537
94532
|
success: external_exports.boolean()
|
|
@@ -95345,6 +95340,13 @@ var attachFileSchema = external_exports.object({
|
|
|
95345
95340
|
var resolvedAttachFileSchema = attachFileSchema.extend({
|
|
95346
95341
|
url: external_exports.string()
|
|
95347
95342
|
});
|
|
95343
|
+
var chatThreadArtifactFileSchema = resolvedAttachFileSchema.extend({
|
|
95344
|
+
createdAt: external_exports.string()
|
|
95345
|
+
});
|
|
95346
|
+
var chatThreadArtifactRunSchema = external_exports.object({
|
|
95347
|
+
runId: external_exports.string(),
|
|
95348
|
+
files: external_exports.array(chatThreadArtifactFileSchema)
|
|
95349
|
+
});
|
|
95348
95350
|
var persistedAttachmentSchema = external_exports.object({
|
|
95349
95351
|
id: external_exports.string(),
|
|
95350
95352
|
url: external_exports.string(),
|
|
@@ -95658,6 +95660,23 @@ var chatThreadMessagesContract = c13.router({
|
|
|
95658
95660
|
summary: "Get paginated chat messages for a thread"
|
|
95659
95661
|
}
|
|
95660
95662
|
});
|
|
95663
|
+
var chatThreadArtifactsContract = c13.router({
|
|
95664
|
+
list: {
|
|
95665
|
+
method: "GET",
|
|
95666
|
+
path: "/api/zero/chat-threads/:threadId/artifacts",
|
|
95667
|
+
headers: authHeadersSchema,
|
|
95668
|
+
pathParams: external_exports.object({ threadId: external_exports.string() }),
|
|
95669
|
+
responses: {
|
|
95670
|
+
200: external_exports.object({
|
|
95671
|
+
runs: external_exports.array(chatThreadArtifactRunSchema)
|
|
95672
|
+
}),
|
|
95673
|
+
401: apiErrorSchema,
|
|
95674
|
+
403: apiErrorSchema,
|
|
95675
|
+
404: apiErrorSchema
|
|
95676
|
+
},
|
|
95677
|
+
summary: "List uploaded files associated with every run in a chat thread"
|
|
95678
|
+
}
|
|
95679
|
+
});
|
|
95661
95680
|
|
|
95662
95681
|
// src/lib/api/domains/zero-chat.ts
|
|
95663
95682
|
async function searchZeroChat(options) {
|
|
@@ -96750,6 +96769,68 @@ var integrationsSlackUploadInitContract = c21.router({
|
|
|
96750
96769
|
summary: "Get a pre-signed Slack upload URL via org bot token"
|
|
96751
96770
|
}
|
|
96752
96771
|
});
|
|
96772
|
+
var telegramUploadInitBodySchema = external_exports.object({
|
|
96773
|
+
filename: external_exports.string().min(1, "Filename is required").max(255),
|
|
96774
|
+
contentType: external_exports.string().min(1, "Content type is required").max(200),
|
|
96775
|
+
length: external_exports.number().int().positive("File length must be a positive integer")
|
|
96776
|
+
});
|
|
96777
|
+
var telegramUploadInitResponseSchema = external_exports.object({
|
|
96778
|
+
uploadId: external_exports.string().uuid(),
|
|
96779
|
+
uploadUrl: external_exports.string(),
|
|
96780
|
+
fileUrl: external_exports.string(),
|
|
96781
|
+
filename: external_exports.string(),
|
|
96782
|
+
contentType: external_exports.string(),
|
|
96783
|
+
size: external_exports.number().int().nonnegative()
|
|
96784
|
+
});
|
|
96785
|
+
var integrationsTelegramUploadInitContract = c21.router({
|
|
96786
|
+
init: {
|
|
96787
|
+
method: "POST",
|
|
96788
|
+
path: "/api/zero/integrations/telegram/upload-file/init",
|
|
96789
|
+
headers: authHeadersSchema,
|
|
96790
|
+
body: telegramUploadInitBodySchema,
|
|
96791
|
+
responses: {
|
|
96792
|
+
200: telegramUploadInitResponseSchema,
|
|
96793
|
+
400: apiErrorSchema,
|
|
96794
|
+
401: apiErrorSchema,
|
|
96795
|
+
403: apiErrorSchema
|
|
96796
|
+
},
|
|
96797
|
+
summary: "Get a pre-signed upload URL for Telegram file delivery"
|
|
96798
|
+
}
|
|
96799
|
+
});
|
|
96800
|
+
var telegramUploadCompleteBodySchema = external_exports.object({
|
|
96801
|
+
uploadId: external_exports.string().uuid("Upload ID must be a UUID"),
|
|
96802
|
+
botId: external_exports.string().min(1, "Bot ID is required"),
|
|
96803
|
+
chatId: external_exports.string().min(1, "Chat ID is required"),
|
|
96804
|
+
contentType: external_exports.string().min(1).max(200).optional(),
|
|
96805
|
+
caption: external_exports.string().max(1024).optional(),
|
|
96806
|
+
messageThreadId: external_exports.number().int().positive().optional()
|
|
96807
|
+
});
|
|
96808
|
+
var telegramUploadCompleteResponseSchema = external_exports.object({
|
|
96809
|
+
messageId: external_exports.number().int(),
|
|
96810
|
+
chatId: external_exports.string(),
|
|
96811
|
+
fileId: external_exports.string().optional(),
|
|
96812
|
+
filename: external_exports.string(),
|
|
96813
|
+
mimetype: external_exports.string(),
|
|
96814
|
+
size: external_exports.number().int().nonnegative(),
|
|
96815
|
+
url: external_exports.string()
|
|
96816
|
+
});
|
|
96817
|
+
var integrationsTelegramUploadCompleteContract = c21.router({
|
|
96818
|
+
complete: {
|
|
96819
|
+
method: "POST",
|
|
96820
|
+
path: "/api/zero/integrations/telegram/upload-file/complete",
|
|
96821
|
+
headers: authHeadersSchema,
|
|
96822
|
+
body: telegramUploadCompleteBodySchema,
|
|
96823
|
+
responses: {
|
|
96824
|
+
200: telegramUploadCompleteResponseSchema,
|
|
96825
|
+
400: apiErrorSchema,
|
|
96826
|
+
401: apiErrorSchema,
|
|
96827
|
+
403: apiErrorSchema,
|
|
96828
|
+
404: apiErrorSchema,
|
|
96829
|
+
502: apiErrorSchema
|
|
96830
|
+
},
|
|
96831
|
+
summary: "Finalize Telegram file upload and send it to a chat"
|
|
96832
|
+
}
|
|
96833
|
+
});
|
|
96753
96834
|
var slackUploadCompleteBodySchema = external_exports.object({
|
|
96754
96835
|
fileId: external_exports.string().min(1, "File ID is required"),
|
|
96755
96836
|
channel: external_exports.string().min(1, "Channel ID is required"),
|
|
@@ -96882,6 +96963,74 @@ async function downloadSlackFile(fileId, outPath) {
|
|
|
96882
96963
|
return { path: outPath, mimetype, size };
|
|
96883
96964
|
}
|
|
96884
96965
|
|
|
96966
|
+
// src/lib/api/domains/integrations-telegram.ts
|
|
96967
|
+
init_esm_shims();
|
|
96968
|
+
import { createWriteStream as createWriteStream2 } from "fs";
|
|
96969
|
+
import { Readable as Readable3 } from "stream";
|
|
96970
|
+
import { pipeline as pipeline2 } from "stream/promises";
|
|
96971
|
+
async function initTelegramFileUpload(body) {
|
|
96972
|
+
const config4 = await getClientConfig();
|
|
96973
|
+
const client = initClient(integrationsTelegramUploadInitContract, config4);
|
|
96974
|
+
const result = await client.init({ body, headers: {} });
|
|
96975
|
+
if (result.status === 200) {
|
|
96976
|
+
return result.body;
|
|
96977
|
+
}
|
|
96978
|
+
handleError(result, "Failed to initialize Telegram file upload");
|
|
96979
|
+
}
|
|
96980
|
+
async function completeTelegramFileUpload(body) {
|
|
96981
|
+
const config4 = await getClientConfig();
|
|
96982
|
+
const client = initClient(integrationsTelegramUploadCompleteContract, config4);
|
|
96983
|
+
const result = await client.complete({ body, headers: {} });
|
|
96984
|
+
if (result.status === 200) {
|
|
96985
|
+
return result.body;
|
|
96986
|
+
}
|
|
96987
|
+
handleError(result, "Failed to complete Telegram file upload");
|
|
96988
|
+
}
|
|
96989
|
+
async function downloadTelegramFile(fileId, botId, outPath) {
|
|
96990
|
+
const baseUrl = await getBaseUrl();
|
|
96991
|
+
const token = await getActiveToken();
|
|
96992
|
+
if (!token) {
|
|
96993
|
+
throw new ApiRequestError("Not authenticated", "UNAUTHORIZED", 401);
|
|
96994
|
+
}
|
|
96995
|
+
const url2 = new URL("/api/zero/integrations/telegram/download-file", baseUrl);
|
|
96996
|
+
url2.searchParams.set("file_id", fileId);
|
|
96997
|
+
url2.searchParams.set("bot_id", botId);
|
|
96998
|
+
const headers = {
|
|
96999
|
+
Authorization: `Bearer ${token}`
|
|
97000
|
+
};
|
|
97001
|
+
const bypassSecret = process.env.VERCEL_AUTOMATION_BYPASS_SECRET;
|
|
97002
|
+
if (bypassSecret) {
|
|
97003
|
+
headers["x-vercel-protection-bypass"] = bypassSecret;
|
|
97004
|
+
}
|
|
97005
|
+
const response = await fetch(url2, { headers });
|
|
97006
|
+
if (!response.ok) {
|
|
97007
|
+
let message = `Failed to download Telegram file (HTTP ${response.status})`;
|
|
97008
|
+
let code = "UNKNOWN";
|
|
97009
|
+
try {
|
|
97010
|
+
const body = await response.json();
|
|
97011
|
+
if (body.error?.message) message = body.error.message;
|
|
97012
|
+
if (body.error?.code) code = body.error.code;
|
|
97013
|
+
} catch {
|
|
97014
|
+
}
|
|
97015
|
+
throw new ApiRequestError(message, code, response.status);
|
|
97016
|
+
}
|
|
97017
|
+
if (!response.body) {
|
|
97018
|
+
throw new ApiRequestError(
|
|
97019
|
+
"Telegram download response has no body",
|
|
97020
|
+
"EMPTY_BODY",
|
|
97021
|
+
502
|
|
97022
|
+
);
|
|
97023
|
+
}
|
|
97024
|
+
const mimetype = response.headers.get("x-file-mimetype") ?? response.headers.get("content-type") ?? "application/octet-stream";
|
|
97025
|
+
await pipeline2(
|
|
97026
|
+
Readable3.fromWeb(response.body),
|
|
97027
|
+
createWriteStream2(outPath)
|
|
97028
|
+
);
|
|
97029
|
+
const contentLengthHeader = response.headers.get("content-length");
|
|
97030
|
+
const size = contentLengthHeader ? Number(contentLengthHeader) : 0;
|
|
97031
|
+
return { path: outPath, mimetype, size };
|
|
97032
|
+
}
|
|
97033
|
+
|
|
96885
97034
|
// src/lib/api/domains/integrations-chat.ts
|
|
96886
97035
|
init_esm_shims();
|
|
96887
97036
|
async function sendChatMessage(body) {
|
|
@@ -97293,10 +97442,10 @@ async function getComputerUseHost() {
|
|
|
97293
97442
|
|
|
97294
97443
|
// src/lib/api/domains/web.ts
|
|
97295
97444
|
init_esm_shims();
|
|
97296
|
-
import { createWriteStream as
|
|
97445
|
+
import { createWriteStream as createWriteStream3, readFileSync as readFileSync3, statSync } from "fs";
|
|
97297
97446
|
import { basename as basename2, extname } from "path";
|
|
97298
|
-
import { Readable as
|
|
97299
|
-
import { pipeline as
|
|
97447
|
+
import { Readable as Readable4 } from "stream";
|
|
97448
|
+
import { pipeline as pipeline3 } from "stream/promises";
|
|
97300
97449
|
var MIME_BY_EXTENSION = {
|
|
97301
97450
|
".png": "image/png",
|
|
97302
97451
|
".jpg": "image/jpeg",
|
|
@@ -97311,6 +97460,8 @@ var MIME_BY_EXTENSION = {
|
|
|
97311
97460
|
".txt": "text/plain",
|
|
97312
97461
|
".csv": "text/csv",
|
|
97313
97462
|
".md": "text/markdown",
|
|
97463
|
+
".html": "text/html",
|
|
97464
|
+
".htm": "text/html",
|
|
97314
97465
|
".json": "application/json"
|
|
97315
97466
|
};
|
|
97316
97467
|
function inferContentType(localPath) {
|
|
@@ -97352,9 +97503,9 @@ async function downloadWebFile(fileId, outPath) {
|
|
|
97352
97503
|
);
|
|
97353
97504
|
}
|
|
97354
97505
|
const mimetype = response.headers.get("x-file-mimetype") ?? response.headers.get("content-type") ?? "application/octet-stream";
|
|
97355
|
-
await
|
|
97356
|
-
|
|
97357
|
-
|
|
97506
|
+
await pipeline3(
|
|
97507
|
+
Readable4.fromWeb(response.body),
|
|
97508
|
+
createWriteStream3(outPath)
|
|
97358
97509
|
);
|
|
97359
97510
|
const contentLengthHeader = response.headers.get("content-length");
|
|
97360
97511
|
const size = contentLengthHeader ? Number(contentLengthHeader) : 0;
|
|
@@ -97422,12 +97573,29 @@ async function uploadWebFile(localPath, options) {
|
|
|
97422
97573
|
putRes.status
|
|
97423
97574
|
);
|
|
97424
97575
|
}
|
|
97576
|
+
const completeUrl = new URL("/api/zero/uploads/complete", baseUrl);
|
|
97577
|
+
const completeRes = await fetch(completeUrl, {
|
|
97578
|
+
method: "POST",
|
|
97579
|
+
headers: prepareHeaders,
|
|
97580
|
+
body: JSON.stringify({
|
|
97581
|
+
id: prepared.id,
|
|
97582
|
+
contentType: prepared.contentType
|
|
97583
|
+
})
|
|
97584
|
+
});
|
|
97585
|
+
if (!completeRes.ok) {
|
|
97586
|
+
const { message, code } = await parseErrorBody(
|
|
97587
|
+
completeRes,
|
|
97588
|
+
"Failed to complete upload"
|
|
97589
|
+
);
|
|
97590
|
+
throw new ApiRequestError(message, code, completeRes.status);
|
|
97591
|
+
}
|
|
97592
|
+
const completed = await completeRes.json();
|
|
97425
97593
|
return {
|
|
97426
|
-
id:
|
|
97427
|
-
filename:
|
|
97428
|
-
contentType:
|
|
97429
|
-
size:
|
|
97430
|
-
url:
|
|
97594
|
+
id: completed.id,
|
|
97595
|
+
filename: completed.filename,
|
|
97596
|
+
contentType: completed.contentType,
|
|
97597
|
+
size: completed.size,
|
|
97598
|
+
url: completed.url
|
|
97431
97599
|
};
|
|
97432
97600
|
}
|
|
97433
97601
|
|
|
@@ -98555,6 +98723,9 @@ export {
|
|
|
98555
98723
|
initSlackFileUpload,
|
|
98556
98724
|
completeSlackFileUpload,
|
|
98557
98725
|
downloadSlackFile,
|
|
98726
|
+
initTelegramFileUpload,
|
|
98727
|
+
completeTelegramFileUpload,
|
|
98728
|
+
downloadTelegramFile,
|
|
98558
98729
|
sendChatMessage,
|
|
98559
98730
|
deployZeroSchedule,
|
|
98560
98731
|
listZeroSchedules,
|
|
@@ -98615,4 +98786,4 @@ undici/lib/web/fetch/body.js:
|
|
|
98615
98786
|
undici/lib/web/websocket/frame.js:
|
|
98616
98787
|
(*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> *)
|
|
98617
98788
|
*/
|
|
98618
|
-
//# sourceMappingURL=chunk-
|
|
98789
|
+
//# sourceMappingURL=chunk-7C3QXZRH.js.map
|