@vm0/cli 9.251.1 → 9.252.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/{agent-BNFNLNHG.js → agent-DJY6SYVC.js} +7 -7
- package/{banking-TCGIBAP6.js → banking-SV5ZIH44.js} +5 -5
- package/{chat-YPDUENU7.js → chat-G2KQYYK5.js} +6 -6
- package/{chunk-DLKSV2HZ.js → chunk-AWLNHCAC.js} +4 -4
- package/{chunk-GO2ZC4S5.js → chunk-BKSVVARX.js} +2 -2
- package/{chunk-BRSUIBNM.js → chunk-BSDS7GCS.js} +5 -4
- package/chunk-BSDS7GCS.js.map +1 -0
- package/{chunk-B7MK54AY.js → chunk-CUAL7MH6.js} +2 -2
- package/{chunk-4CCCO3QU.js → chunk-DK3C2ME6.js} +13 -1
- package/chunk-DK3C2ME6.js.map +1 -0
- package/{chunk-4GD76EQ4.js → chunk-E2DKMMGY.js} +3 -3
- package/{chunk-CV7MCB2U.js → chunk-I56DJKTX.js} +3 -3
- package/{chunk-CV7MCB2U.js.map → chunk-I56DJKTX.js.map} +1 -1
- package/{chunk-KHZ4LMY2.js → chunk-IX2GN2TI.js} +2 -2
- package/{chunk-PP2JWZSG.js → chunk-QL2BWE6J.js} +343 -20
- package/chunk-QL2BWE6J.js.map +1 -0
- package/{chunk-6AKLTZUH.js → chunk-RGHA7C2O.js} +2 -2
- package/{chunk-U3VV27JW.js → chunk-TRFIH4R5.js} +2 -2
- package/{computer-use-VXYMW7DO.js → computer-use-FUBM53XG.js} +5 -5
- package/{connector-UIBA5P4Z.js → connector-3GCLB6HW.js} +8 -8
- package/{credit-GWNSOZOX.js → credit-SXRYMKSD.js} +7 -7
- package/{developer-support-QOTFHN2S.js → developer-support-LQHWOQLY.js} +5 -5
- package/{doctor-G4UUSU3R.js → doctor-RVC32BKE.js} +7 -7
- package/feishu-62E2QMM5.js +277 -0
- package/feishu-62E2QMM5.js.map +1 -0
- package/{finance-QEB2AYB4.js → finance-HP4WFZUY.js} +5 -5
- package/{generate-Y2GBOZ4T.js → generate-PTBOIM6B.js} +7 -7
- package/{github-JX5PFWTW.js → github-62XSFEWF.js} +5 -5
- package/{goal-ETVDARSU.js → goal-VRWB2AS3.js} +5 -5
- package/{host-OTBNOMJO.js → host-OKISPSSS.js} +5 -5
- package/{logs-MK4VKYGE.js → logs-53CMUU4J.js} +6 -6
- package/{mail-4WPLYKL5.js → mail-E6R5V6F6.js} +7 -7
- package/{maps-7YWGDMU4.js → maps-B7F3CODU.js} +5 -5
- package/{model-P5TLS3KD.js → model-2VZQVFTE.js} +6 -6
- package/{model-provider-YUQ65CGB.js → model-provider-XALJ5BZB.js} +6 -6
- package/{org-BO46UGHP.js → org-JIAZYZUL.js} +5 -5
- package/package.json +1 -1
- package/{people-search-6JZNG46F.js → people-search-LZ2BRXA6.js} +5 -5
- package/{phone-OLPRI3UD.js → phone-MXUV3YD3.js} +5 -5
- package/{preference-OSLWFBAT.js → preference-LONJZKPE.js} +5 -5
- package/{resource-6IX3QB3W.js → resource-26IQ2JCS.js} +5 -5
- package/{scrape-T6XHTU6J.js → scrape-H2ZA5AJD.js} +5 -5
- package/{search-KYW4WRMQ.js → search-R62IJFT4.js} +6 -6
- package/{secret-ORODPPSX.js → secret-PHZZWEE3.js} +5 -5
- package/{slack-CXZCQ5HU.js → slack-DQJUJIWY.js} +174 -47
- package/slack-DQJUJIWY.js.map +1 -0
- package/{teams-CGDBFXQ2.js → teams-B5NDIX3U.js} +5 -5
- package/{telegram-SCGQFOYI.js → telegram-R67CYOON.js} +5 -5
- package/{upgrade-3LEF7WD7.js → upgrade-FJKXJO6L.js} +4 -4
- package/{variable-G6WZKJJG.js → variable-GNCE5TUG.js} +5 -5
- package/{video-JKYPCENK.js → video-UDPAFI36.js} +4 -4
- package/{weather-3WQV3JMX.js → weather-O6L5SALA.js} +5 -5
- package/{web-3FRUHVEN.js → web-6I5S773Q.js} +5 -5
- package/{web-search-H6WV4RFE.js → web-search-GQAKFVCC.js} +5 -5
- package/{whoami-BMNW6CH3.js → whoami-MEJV5DZB.js} +7 -7
- package/{workflow-O6CVNJWM.js → workflow-PEVNMY2N.js} +5 -5
- package/zero.js +42 -42
- package/chunk-4CCCO3QU.js.map +0 -1
- package/chunk-BRSUIBNM.js.map +0 -1
- package/chunk-PP2JWZSG.js.map +0 -1
- package/feishu-GQEAUNH3.js +0 -119
- package/feishu-GQEAUNH3.js.map +0 -1
- package/slack-CXZCQ5HU.js.map +0 -1
- /package/{agent-BNFNLNHG.js.map → agent-DJY6SYVC.js.map} +0 -0
- /package/{banking-TCGIBAP6.js.map → banking-SV5ZIH44.js.map} +0 -0
- /package/{chat-YPDUENU7.js.map → chat-G2KQYYK5.js.map} +0 -0
- /package/{chunk-DLKSV2HZ.js.map → chunk-AWLNHCAC.js.map} +0 -0
- /package/{chunk-GO2ZC4S5.js.map → chunk-BKSVVARX.js.map} +0 -0
- /package/{chunk-B7MK54AY.js.map → chunk-CUAL7MH6.js.map} +0 -0
- /package/{chunk-4GD76EQ4.js.map → chunk-E2DKMMGY.js.map} +0 -0
- /package/{chunk-KHZ4LMY2.js.map → chunk-IX2GN2TI.js.map} +0 -0
- /package/{chunk-6AKLTZUH.js.map → chunk-RGHA7C2O.js.map} +0 -0
- /package/{chunk-U3VV27JW.js.map → chunk-TRFIH4R5.js.map} +0 -0
- /package/{computer-use-VXYMW7DO.js.map → computer-use-FUBM53XG.js.map} +0 -0
- /package/{connector-UIBA5P4Z.js.map → connector-3GCLB6HW.js.map} +0 -0
- /package/{credit-GWNSOZOX.js.map → credit-SXRYMKSD.js.map} +0 -0
- /package/{developer-support-QOTFHN2S.js.map → developer-support-LQHWOQLY.js.map} +0 -0
- /package/{doctor-G4UUSU3R.js.map → doctor-RVC32BKE.js.map} +0 -0
- /package/{finance-QEB2AYB4.js.map → finance-HP4WFZUY.js.map} +0 -0
- /package/{generate-Y2GBOZ4T.js.map → generate-PTBOIM6B.js.map} +0 -0
- /package/{github-JX5PFWTW.js.map → github-62XSFEWF.js.map} +0 -0
- /package/{goal-ETVDARSU.js.map → goal-VRWB2AS3.js.map} +0 -0
- /package/{host-OTBNOMJO.js.map → host-OKISPSSS.js.map} +0 -0
- /package/{logs-MK4VKYGE.js.map → logs-53CMUU4J.js.map} +0 -0
- /package/{mail-4WPLYKL5.js.map → mail-E6R5V6F6.js.map} +0 -0
- /package/{maps-7YWGDMU4.js.map → maps-B7F3CODU.js.map} +0 -0
- /package/{model-P5TLS3KD.js.map → model-2VZQVFTE.js.map} +0 -0
- /package/{model-provider-YUQ65CGB.js.map → model-provider-XALJ5BZB.js.map} +0 -0
- /package/{org-BO46UGHP.js.map → org-JIAZYZUL.js.map} +0 -0
- /package/{people-search-6JZNG46F.js.map → people-search-LZ2BRXA6.js.map} +0 -0
- /package/{phone-OLPRI3UD.js.map → phone-MXUV3YD3.js.map} +0 -0
- /package/{preference-OSLWFBAT.js.map → preference-LONJZKPE.js.map} +0 -0
- /package/{resource-6IX3QB3W.js.map → resource-26IQ2JCS.js.map} +0 -0
- /package/{scrape-T6XHTU6J.js.map → scrape-H2ZA5AJD.js.map} +0 -0
- /package/{search-KYW4WRMQ.js.map → search-R62IJFT4.js.map} +0 -0
- /package/{secret-ORODPPSX.js.map → secret-PHZZWEE3.js.map} +0 -0
- /package/{teams-CGDBFXQ2.js.map → teams-B5NDIX3U.js.map} +0 -0
- /package/{telegram-SCGQFOYI.js.map → telegram-R67CYOON.js.map} +0 -0
- /package/{upgrade-3LEF7WD7.js.map → upgrade-FJKXJO6L.js.map} +0 -0
- /package/{variable-G6WZKJJG.js.map → variable-GNCE5TUG.js.map} +0 -0
- /package/{video-JKYPCENK.js.map → video-UDPAFI36.js.map} +0 -0
- /package/{weather-3WQV3JMX.js.map → weather-O6L5SALA.js.map} +0 -0
- /package/{web-3FRUHVEN.js.map → web-6I5S773Q.js.map} +0 -0
- /package/{web-search-H6WV4RFE.js.map → web-search-GQAKFVCC.js.map} +0 -0
- /package/{whoami-BMNW6CH3.js.map → whoami-MEJV5DZB.js.map} +0 -0
- /package/{workflow-O6CVNJWM.js.map → workflow-PEVNMY2N.js.map} +0 -0
|
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
|
|
|
4
4
|
import {
|
|
5
5
|
getZeroAgent,
|
|
6
6
|
getZeroAgentUserConnectors
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-QL2BWE6J.js";
|
|
8
8
|
import {
|
|
9
9
|
init_esm_shims
|
|
10
10
|
} from "./chunk-3VVCUQPB.js";
|
|
@@ -265,4 +265,4 @@ export {
|
|
|
265
265
|
resolveManualGrantAuthMethod,
|
|
266
266
|
resolveAgentContext
|
|
267
267
|
};
|
|
268
|
-
//# sourceMappingURL=chunk-
|
|
268
|
+
//# sourceMappingURL=chunk-IX2GN2TI.js.map
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
updateOrgModelPoliciesRequestSchema,
|
|
22
22
|
upsertModelProviderRequestSchema,
|
|
23
23
|
upsertModelProviderResponseSchema
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-E2DKMMGY.js";
|
|
25
25
|
import {
|
|
26
26
|
__commonJS,
|
|
27
27
|
__esm,
|
|
@@ -3367,8 +3367,30 @@ var attachFileSchema = external_exports.object({
|
|
|
3367
3367
|
contentType: external_exports.string(),
|
|
3368
3368
|
size: external_exports.number()
|
|
3369
3369
|
});
|
|
3370
|
+
var assetMaterializationSchema = external_exports.discriminatedUnion("status", [
|
|
3371
|
+
external_exports.object({ status: external_exports.literal("ready") }),
|
|
3372
|
+
external_exports.object({ status: external_exports.literal("pending") }),
|
|
3373
|
+
external_exports.object({
|
|
3374
|
+
status: external_exports.literal("failed"),
|
|
3375
|
+
error: external_exports.object({
|
|
3376
|
+
code: external_exports.string(),
|
|
3377
|
+
message: external_exports.string(),
|
|
3378
|
+
retryable: external_exports.boolean()
|
|
3379
|
+
})
|
|
3380
|
+
})
|
|
3381
|
+
]);
|
|
3382
|
+
var assetRefSchema = external_exports.object({
|
|
3383
|
+
id: external_exports.string().uuid(),
|
|
3384
|
+
classification: external_exports.enum(["input", "published-output"]),
|
|
3385
|
+
access: external_exports.enum(["private", "published"]),
|
|
3386
|
+
materialization: assetMaterializationSchema,
|
|
3387
|
+
provenance: external_exports.object({
|
|
3388
|
+
provider: external_exports.string()
|
|
3389
|
+
}).optional()
|
|
3390
|
+
});
|
|
3370
3391
|
var resolvedAttachFileSchema = attachFileSchema.extend({
|
|
3371
|
-
url: external_exports.string()
|
|
3392
|
+
url: external_exports.string(),
|
|
3393
|
+
assetRef: assetRefSchema.optional()
|
|
3372
3394
|
});
|
|
3373
3395
|
var chatThreadArtifactGoogleDriveSyncSchema = external_exports.discriminatedUnion("status", [
|
|
3374
3396
|
external_exports.object({
|
|
@@ -3403,6 +3425,7 @@ var artifactItemSchema = external_exports.object({
|
|
|
3403
3425
|
contentType: external_exports.string(),
|
|
3404
3426
|
size: external_exports.number().default(0),
|
|
3405
3427
|
url: external_exports.string(),
|
|
3428
|
+
assetRef: assetRefSchema.optional(),
|
|
3406
3429
|
previewImageUrl: external_exports.string().optional(),
|
|
3407
3430
|
createdAt: external_exports.string(),
|
|
3408
3431
|
updatedAt: external_exports.string(),
|
|
@@ -4245,6 +4268,9 @@ var chatThreadMessagesContract = c14.router({
|
|
|
4245
4268
|
},
|
|
4246
4269
|
summary: "Get paginated chat messages for a thread"
|
|
4247
4270
|
},
|
|
4271
|
+
// Compatibility for already-open app-v0.627.3 browser clients. The next app
|
|
4272
|
+
// no longer calls this route; remove it only after those clients can no
|
|
4273
|
+
// longer reasonably remain active against the current backend.
|
|
4248
4274
|
get: {
|
|
4249
4275
|
method: "GET",
|
|
4250
4276
|
path: "/api/zero/chat-threads/:threadId/messages/:messageId",
|
|
@@ -11035,7 +11061,13 @@ var zeroMailDraftStatusSchema = external_exports.enum(["draft", "sent", "deleted
|
|
|
11035
11061
|
var zeroMailAttachmentSchema = external_exports.object({
|
|
11036
11062
|
filename: external_exports.string(),
|
|
11037
11063
|
contentType: external_exports.string(),
|
|
11038
|
-
size: external_exports.number().int().nonnegative()
|
|
11064
|
+
size: external_exports.number().int().nonnegative(),
|
|
11065
|
+
partId: external_exports.string().optional()
|
|
11066
|
+
});
|
|
11067
|
+
var zeroMailInlineImageSchema = external_exports.object({
|
|
11068
|
+
contentId: external_exports.string().min(1),
|
|
11069
|
+
partId: external_exports.string().min(1),
|
|
11070
|
+
alt: external_exports.string()
|
|
11039
11071
|
});
|
|
11040
11072
|
var zeroMailDraftBaseSchema = external_exports.object({
|
|
11041
11073
|
provider: external_exports.literal("gmail"),
|
|
@@ -11046,6 +11078,9 @@ var zeroMailDraftBaseSchema = external_exports.object({
|
|
|
11046
11078
|
bcc: external_exports.array(external_exports.email()),
|
|
11047
11079
|
subject: external_exports.string(),
|
|
11048
11080
|
body: external_exports.string(),
|
|
11081
|
+
bodyHtml: external_exports.string().optional(),
|
|
11082
|
+
inlineImages: external_exports.array(zeroMailInlineImageSchema).optional(),
|
|
11083
|
+
accessStatus: external_exports.enum(["ready", "reconnect"]).optional(),
|
|
11049
11084
|
replyTo: external_exports.string().optional(),
|
|
11050
11085
|
inReplyTo: external_exports.string().optional(),
|
|
11051
11086
|
references: external_exports.array(external_exports.string()),
|
|
@@ -11075,6 +11110,9 @@ var zeroMailLinkResponseSchema = zeroMailDraftResponseSchema.pick({
|
|
|
11075
11110
|
var zeroMailDraftPathParamsSchema = external_exports.object({
|
|
11076
11111
|
mailDraftId: external_exports.string().uuid()
|
|
11077
11112
|
});
|
|
11113
|
+
var zeroMailDraftAttachmentPathParamsSchema = zeroMailDraftPathParamsSchema.extend({
|
|
11114
|
+
partId: external_exports.string().min(1)
|
|
11115
|
+
});
|
|
11078
11116
|
var zeroMailContract = c36.router({
|
|
11079
11117
|
linkDraft: {
|
|
11080
11118
|
method: "POST",
|
|
@@ -11108,6 +11146,23 @@ var zeroMailContract = c36.router({
|
|
|
11108
11146
|
},
|
|
11109
11147
|
summary: "Get an email draft by ID"
|
|
11110
11148
|
},
|
|
11149
|
+
getAttachment: {
|
|
11150
|
+
method: "GET",
|
|
11151
|
+
path: "/api/zero/mail/drafts/:mailDraftId/attachments/:partId",
|
|
11152
|
+
headers: authHeadersSchema,
|
|
11153
|
+
pathParams: zeroMailDraftAttachmentPathParamsSchema,
|
|
11154
|
+
responses: {
|
|
11155
|
+
200: c36.otherResponse({
|
|
11156
|
+
contentType: "application/octet-stream",
|
|
11157
|
+
body: c36.type()
|
|
11158
|
+
}),
|
|
11159
|
+
401: apiErrorSchema,
|
|
11160
|
+
403: apiErrorSchema,
|
|
11161
|
+
404: apiErrorSchema,
|
|
11162
|
+
409: apiErrorSchema
|
|
11163
|
+
},
|
|
11164
|
+
summary: "Get a Gmail draft attachment"
|
|
11165
|
+
},
|
|
11111
11166
|
deleteDraft: {
|
|
11112
11167
|
method: "DELETE",
|
|
11113
11168
|
path: "/api/zero/mail/drafts/:mailDraftId",
|
|
@@ -11256,6 +11311,117 @@ var integrationsFeishuMessageContract = c37.router({
|
|
|
11256
11311
|
summary: "Send a Feishu message via an organization custom app"
|
|
11257
11312
|
}
|
|
11258
11313
|
});
|
|
11314
|
+
var FEISHU_FILE_UPLOAD_MAX_BYTES = 30 * 1024 * 1024;
|
|
11315
|
+
var feishuResourceTypeSchema = external_exports.enum(["file", "image"]);
|
|
11316
|
+
var integrationsFeishuDownloadFileContract = c37.router({
|
|
11317
|
+
download: {
|
|
11318
|
+
method: "GET",
|
|
11319
|
+
path: "/api/zero/integrations/feishu/download-file",
|
|
11320
|
+
headers: authHeadersSchema,
|
|
11321
|
+
query: external_exports.object({
|
|
11322
|
+
installation_id: external_exports.string().uuid().optional(),
|
|
11323
|
+
message_id: external_exports.string().min(1, "Message ID is required"),
|
|
11324
|
+
file_key: external_exports.string().min(1, "File key is required"),
|
|
11325
|
+
type: feishuResourceTypeSchema
|
|
11326
|
+
}),
|
|
11327
|
+
responses: {
|
|
11328
|
+
200: c37.otherResponse({
|
|
11329
|
+
contentType: "application/octet-stream",
|
|
11330
|
+
body: external_exports.unknown()
|
|
11331
|
+
}),
|
|
11332
|
+
400: apiErrorSchema,
|
|
11333
|
+
401: apiErrorSchema,
|
|
11334
|
+
403: apiErrorSchema,
|
|
11335
|
+
404: apiErrorSchema,
|
|
11336
|
+
413: apiErrorSchema,
|
|
11337
|
+
502: apiErrorSchema
|
|
11338
|
+
},
|
|
11339
|
+
summary: "Download a file from a Feishu message"
|
|
11340
|
+
}
|
|
11341
|
+
});
|
|
11342
|
+
var feishuUploadInitBodySchema = external_exports.object({
|
|
11343
|
+
filename: external_exports.string().min(1, "Filename is required").max(255),
|
|
11344
|
+
contentType: external_exports.string().min(1, "Content type is required").max(200),
|
|
11345
|
+
length: external_exports.number().int().positive("File length must be a positive integer").max(
|
|
11346
|
+
FEISHU_FILE_UPLOAD_MAX_BYTES,
|
|
11347
|
+
`File must not exceed ${FEISHU_FILE_UPLOAD_MAX_BYTES} bytes`
|
|
11348
|
+
)
|
|
11349
|
+
});
|
|
11350
|
+
var feishuUploadInitResponseSchema = external_exports.object({
|
|
11351
|
+
uploadId: external_exports.string().uuid(),
|
|
11352
|
+
uploadUrl: external_exports.string(),
|
|
11353
|
+
fileUrl: external_exports.string(),
|
|
11354
|
+
filename: external_exports.string(),
|
|
11355
|
+
contentType: external_exports.string(),
|
|
11356
|
+
size: external_exports.number().int().nonnegative()
|
|
11357
|
+
});
|
|
11358
|
+
var integrationsFeishuUploadInitContract = c37.router({
|
|
11359
|
+
init: {
|
|
11360
|
+
method: "POST",
|
|
11361
|
+
path: "/api/zero/integrations/feishu/upload-file/init",
|
|
11362
|
+
headers: authHeadersSchema,
|
|
11363
|
+
body: feishuUploadInitBodySchema,
|
|
11364
|
+
responses: {
|
|
11365
|
+
200: feishuUploadInitResponseSchema,
|
|
11366
|
+
400: apiErrorSchema,
|
|
11367
|
+
401: apiErrorSchema,
|
|
11368
|
+
403: apiErrorSchema
|
|
11369
|
+
},
|
|
11370
|
+
summary: "Get a pre-signed upload URL for Feishu file delivery"
|
|
11371
|
+
}
|
|
11372
|
+
});
|
|
11373
|
+
var feishuUploadCompleteBodySchema = external_exports.object({
|
|
11374
|
+
uploadId: external_exports.string().uuid("Upload ID must be a UUID"),
|
|
11375
|
+
installationId: external_exports.string().uuid().optional(),
|
|
11376
|
+
chat: external_exports.string().min(1, "Chat ID is required").optional(),
|
|
11377
|
+
user: external_exports.string().min(1, "Feishu open ID is required").optional(),
|
|
11378
|
+
replyToMessageId: external_exports.string().min(1, "Message ID is required").optional(),
|
|
11379
|
+
replyInThread: external_exports.boolean().optional(),
|
|
11380
|
+
contentType: external_exports.string().min(1).max(200).optional()
|
|
11381
|
+
}).refine(
|
|
11382
|
+
(body) => {
|
|
11383
|
+
return [body.chat, body.user, body.replyToMessageId].filter(Boolean).length === 1;
|
|
11384
|
+
},
|
|
11385
|
+
{
|
|
11386
|
+
message: "Exactly one of chat, user, or replyToMessageId is required",
|
|
11387
|
+
path: ["chat"]
|
|
11388
|
+
}
|
|
11389
|
+
).refine(
|
|
11390
|
+
(body) => {
|
|
11391
|
+
return !body.replyInThread || Boolean(body.replyToMessageId);
|
|
11392
|
+
},
|
|
11393
|
+
{
|
|
11394
|
+
message: "replyInThread requires replyToMessageId",
|
|
11395
|
+
path: ["replyInThread"]
|
|
11396
|
+
}
|
|
11397
|
+
);
|
|
11398
|
+
var feishuUploadCompleteResponseSchema = external_exports.object({
|
|
11399
|
+
messageId: external_exports.string(),
|
|
11400
|
+
chatId: external_exports.string().nullable(),
|
|
11401
|
+
fileKey: external_exports.string(),
|
|
11402
|
+
filename: external_exports.string(),
|
|
11403
|
+
mimetype: external_exports.string(),
|
|
11404
|
+
size: external_exports.number().int().nonnegative(),
|
|
11405
|
+
url: external_exports.string()
|
|
11406
|
+
});
|
|
11407
|
+
var integrationsFeishuUploadCompleteContract = c37.router({
|
|
11408
|
+
complete: {
|
|
11409
|
+
method: "POST",
|
|
11410
|
+
path: "/api/zero/integrations/feishu/upload-file/complete",
|
|
11411
|
+
headers: authHeadersSchema,
|
|
11412
|
+
body: feishuUploadCompleteBodySchema,
|
|
11413
|
+
responses: {
|
|
11414
|
+
200: feishuUploadCompleteResponseSchema,
|
|
11415
|
+
400: apiErrorSchema,
|
|
11416
|
+
401: apiErrorSchema,
|
|
11417
|
+
403: apiErrorSchema,
|
|
11418
|
+
404: apiErrorSchema,
|
|
11419
|
+
413: apiErrorSchema,
|
|
11420
|
+
502: apiErrorSchema
|
|
11421
|
+
},
|
|
11422
|
+
summary: "Finalize Feishu file upload and send it to a conversation"
|
|
11423
|
+
}
|
|
11424
|
+
});
|
|
11259
11425
|
var sendTelegramMessageBodySchema = external_exports.object({
|
|
11260
11426
|
botId: external_exports.string().min(1, "Bot ID is required"),
|
|
11261
11427
|
chatId: external_exports.string().min(1, "Chat ID is required"),
|
|
@@ -11432,12 +11598,32 @@ var integrationsTelegramBotListContract = c37.router({
|
|
|
11432
11598
|
});
|
|
11433
11599
|
var slackUploadInitBodySchema = external_exports.object({
|
|
11434
11600
|
filename: external_exports.string().min(1, "Filename is required"),
|
|
11435
|
-
length: external_exports.number().int().positive("File length must be a positive integer")
|
|
11601
|
+
length: external_exports.number().int().positive("File length must be a positive integer"),
|
|
11602
|
+
canonical: external_exports.object({
|
|
11603
|
+
operationId: external_exports.string().uuid(),
|
|
11604
|
+
contentType: external_exports.string().min(1).max(200),
|
|
11605
|
+
checksumSha256: external_exports.string().regex(/^[a-f0-9]{64}$/),
|
|
11606
|
+
channel: external_exports.string().min(1, "Channel ID is required"),
|
|
11607
|
+
threadTs: external_exports.string().optional(),
|
|
11608
|
+
title: external_exports.string().optional(),
|
|
11609
|
+
initialComment: external_exports.string().optional()
|
|
11610
|
+
}).optional()
|
|
11436
11611
|
});
|
|
11437
|
-
var
|
|
11612
|
+
var directSlackUploadInitResponseSchema = external_exports.object({
|
|
11438
11613
|
uploadUrl: external_exports.string(),
|
|
11439
11614
|
fileId: external_exports.string()
|
|
11440
11615
|
});
|
|
11616
|
+
var canonicalSlackUploadInitResponseSchema = external_exports.object({
|
|
11617
|
+
kind: external_exports.literal("canonical"),
|
|
11618
|
+
assetId: external_exports.string().uuid(),
|
|
11619
|
+
operationId: external_exports.string().uuid(),
|
|
11620
|
+
uploadUrl: external_exports.string().url().optional(),
|
|
11621
|
+
url: external_exports.string().url()
|
|
11622
|
+
});
|
|
11623
|
+
var slackUploadInitResponseSchema = external_exports.union([
|
|
11624
|
+
directSlackUploadInitResponseSchema,
|
|
11625
|
+
canonicalSlackUploadInitResponseSchema
|
|
11626
|
+
]);
|
|
11441
11627
|
var integrationsSlackUploadInitContract = c37.router({
|
|
11442
11628
|
init: {
|
|
11443
11629
|
method: "POST",
|
|
@@ -11454,6 +11640,47 @@ var integrationsSlackUploadInitContract = c37.router({
|
|
|
11454
11640
|
summary: "Get a pre-signed Slack upload URL via org bot token"
|
|
11455
11641
|
}
|
|
11456
11642
|
});
|
|
11643
|
+
var slackUploadMaterializeBodySchema = external_exports.object({
|
|
11644
|
+
assetId: external_exports.string().uuid(),
|
|
11645
|
+
operationId: external_exports.string().uuid()
|
|
11646
|
+
});
|
|
11647
|
+
var slackUploadMaterializeResponseSchema = external_exports.object({
|
|
11648
|
+
assetId: external_exports.string().uuid(),
|
|
11649
|
+
url: external_exports.string().url(),
|
|
11650
|
+
delivery: external_exports.discriminatedUnion("status", [
|
|
11651
|
+
external_exports.object({
|
|
11652
|
+
status: external_exports.literal("pending"),
|
|
11653
|
+
uploadUrl: external_exports.string(),
|
|
11654
|
+
fileId: external_exports.string()
|
|
11655
|
+
}),
|
|
11656
|
+
external_exports.object({
|
|
11657
|
+
status: external_exports.literal("delivered"),
|
|
11658
|
+
fileId: external_exports.string(),
|
|
11659
|
+
permalink: external_exports.string()
|
|
11660
|
+
}),
|
|
11661
|
+
external_exports.object({
|
|
11662
|
+
status: external_exports.literal("failed"),
|
|
11663
|
+
message: external_exports.string(),
|
|
11664
|
+
retryable: external_exports.boolean()
|
|
11665
|
+
})
|
|
11666
|
+
])
|
|
11667
|
+
});
|
|
11668
|
+
var integrationsSlackUploadMaterializeContract = c37.router({
|
|
11669
|
+
materialize: {
|
|
11670
|
+
method: "POST",
|
|
11671
|
+
path: "/api/zero/integrations/slack/upload-file/materialize",
|
|
11672
|
+
headers: authHeadersSchema,
|
|
11673
|
+
body: slackUploadMaterializeBodySchema,
|
|
11674
|
+
responses: {
|
|
11675
|
+
200: slackUploadMaterializeResponseSchema,
|
|
11676
|
+
400: apiErrorSchema,
|
|
11677
|
+
401: apiErrorSchema,
|
|
11678
|
+
403: apiErrorSchema,
|
|
11679
|
+
404: apiErrorSchema
|
|
11680
|
+
},
|
|
11681
|
+
summary: "Materialize a canonical Slack publication before delivery"
|
|
11682
|
+
}
|
|
11683
|
+
});
|
|
11457
11684
|
var telegramUploadInitBodySchema = external_exports.object({
|
|
11458
11685
|
filename: external_exports.string().min(1, "Filename is required").max(255),
|
|
11459
11686
|
contentType: external_exports.string().min(1, "Content type is required").max(200),
|
|
@@ -11707,11 +11934,18 @@ var slackUploadCompleteBodySchema = external_exports.object({
|
|
|
11707
11934
|
channel: external_exports.string().min(1, "Channel ID is required"),
|
|
11708
11935
|
threadTs: external_exports.string().optional(),
|
|
11709
11936
|
title: external_exports.string().optional(),
|
|
11710
|
-
initialComment: external_exports.string().optional()
|
|
11937
|
+
initialComment: external_exports.string().optional(),
|
|
11938
|
+
canonicalAssetId: external_exports.string().uuid().optional(),
|
|
11939
|
+
operationId: external_exports.string().uuid().optional(),
|
|
11940
|
+
uploadError: external_exports.string().max(2e3).optional()
|
|
11711
11941
|
});
|
|
11712
11942
|
var slackUploadCompleteResponseSchema = external_exports.object({
|
|
11713
11943
|
fileId: external_exports.string(),
|
|
11714
|
-
permalink: external_exports.string()
|
|
11944
|
+
permalink: external_exports.string(),
|
|
11945
|
+
assetId: external_exports.string().uuid().optional(),
|
|
11946
|
+
assetUrl: external_exports.string().url().optional(),
|
|
11947
|
+
deliveryStatus: external_exports.enum(["delivered", "failed"]).optional(),
|
|
11948
|
+
deliveryError: external_exports.string().optional()
|
|
11715
11949
|
});
|
|
11716
11950
|
var integrationsSlackUploadCompleteContract = c37.router({
|
|
11717
11951
|
complete: {
|
|
@@ -11758,6 +11992,15 @@ async function completeSlackFileUpload(body) {
|
|
|
11758
11992
|
}
|
|
11759
11993
|
handleError(result, "Failed to complete Slack file upload");
|
|
11760
11994
|
}
|
|
11995
|
+
async function materializeSlackFileUpload(body) {
|
|
11996
|
+
const config = await getClientConfig();
|
|
11997
|
+
const client = initClient(integrationsSlackUploadMaterializeContract, config);
|
|
11998
|
+
const result = await client.materialize({ body, headers: {} });
|
|
11999
|
+
if (result.status === 200) {
|
|
12000
|
+
return result.body;
|
|
12001
|
+
}
|
|
12002
|
+
handleError(result, "Failed to materialize Slack file upload");
|
|
12003
|
+
}
|
|
11761
12004
|
async function downloadSlackFile(fileId, outPath) {
|
|
11762
12005
|
const baseUrl = await getBaseUrl();
|
|
11763
12006
|
const token = await getActiveToken();
|
|
@@ -11972,6 +12215,9 @@ async function downloadTeamsFile(fileId, outPath) {
|
|
|
11972
12215
|
|
|
11973
12216
|
// src/lib/api/domains/integrations-feishu.ts
|
|
11974
12217
|
init_esm_shims();
|
|
12218
|
+
import { createWriteStream as createWriteStream4 } from "fs";
|
|
12219
|
+
import { Readable as Readable4 } from "stream";
|
|
12220
|
+
import { pipeline as pipeline4 } from "stream/promises";
|
|
11975
12221
|
async function sendFeishuMessage(body) {
|
|
11976
12222
|
const config = await getClientConfig();
|
|
11977
12223
|
const client = initClient(integrationsFeishuMessageContract, config);
|
|
@@ -11981,12 +12227,84 @@ async function sendFeishuMessage(body) {
|
|
|
11981
12227
|
}
|
|
11982
12228
|
handleError(result, "Failed to send Feishu message");
|
|
11983
12229
|
}
|
|
12230
|
+
async function initFeishuFileUpload(body) {
|
|
12231
|
+
const config = await getClientConfig();
|
|
12232
|
+
const client = initClient(integrationsFeishuUploadInitContract, config);
|
|
12233
|
+
const result = await client.init({ body, headers: {} });
|
|
12234
|
+
if (result.status === 200) {
|
|
12235
|
+
return result.body;
|
|
12236
|
+
}
|
|
12237
|
+
handleError(result, "Failed to initialize Feishu file upload");
|
|
12238
|
+
}
|
|
12239
|
+
async function completeFeishuFileUpload(body) {
|
|
12240
|
+
const config = await getClientConfig();
|
|
12241
|
+
const client = initClient(integrationsFeishuUploadCompleteContract, config);
|
|
12242
|
+
const result = await client.complete({ body, headers: {} });
|
|
12243
|
+
if (result.status === 200) {
|
|
12244
|
+
return result.body;
|
|
12245
|
+
}
|
|
12246
|
+
handleError(result, "Failed to complete Feishu file upload");
|
|
12247
|
+
}
|
|
12248
|
+
async function downloadFeishuFile(messageId, fileKey, resourceType, installationId, outPath) {
|
|
12249
|
+
const baseUrl = await getBaseUrl();
|
|
12250
|
+
const token = await getActiveToken();
|
|
12251
|
+
if (!token) {
|
|
12252
|
+
throw new ApiRequestError("Not authenticated", "UNAUTHORIZED", 401);
|
|
12253
|
+
}
|
|
12254
|
+
const url = new URL("/api/zero/integrations/feishu/download-file", baseUrl);
|
|
12255
|
+
url.searchParams.set("message_id", messageId);
|
|
12256
|
+
url.searchParams.set("file_key", fileKey);
|
|
12257
|
+
url.searchParams.set("type", resourceType);
|
|
12258
|
+
if (installationId) {
|
|
12259
|
+
url.searchParams.set("installation_id", installationId);
|
|
12260
|
+
}
|
|
12261
|
+
const headers = {
|
|
12262
|
+
Authorization: `Bearer ${token}`
|
|
12263
|
+
};
|
|
12264
|
+
const bypassSecret = process.env.VERCEL_AUTOMATION_BYPASS_SECRET;
|
|
12265
|
+
if (bypassSecret) {
|
|
12266
|
+
headers["x-vercel-protection-bypass"] = bypassSecret;
|
|
12267
|
+
}
|
|
12268
|
+
const response = await fetch(url, {
|
|
12269
|
+
headers: headersWithCliClientHeaders(headers)
|
|
12270
|
+
});
|
|
12271
|
+
if (!response.ok) {
|
|
12272
|
+
let message = `Failed to download Feishu file (HTTP ${response.status})`;
|
|
12273
|
+
let code = "UNKNOWN";
|
|
12274
|
+
try {
|
|
12275
|
+
const body = await response.json();
|
|
12276
|
+
if (body.error?.message) {
|
|
12277
|
+
message = body.error.message;
|
|
12278
|
+
}
|
|
12279
|
+
if (body.error?.code) {
|
|
12280
|
+
code = body.error.code;
|
|
12281
|
+
}
|
|
12282
|
+
} catch {
|
|
12283
|
+
}
|
|
12284
|
+
throw new ApiRequestError(message, code, response.status);
|
|
12285
|
+
}
|
|
12286
|
+
if (!response.body) {
|
|
12287
|
+
throw new ApiRequestError(
|
|
12288
|
+
"Feishu download response has no body",
|
|
12289
|
+
"EMPTY_BODY",
|
|
12290
|
+
502
|
|
12291
|
+
);
|
|
12292
|
+
}
|
|
12293
|
+
const mimetype = response.headers.get("x-file-mimetype") ?? response.headers.get("content-type") ?? "application/octet-stream";
|
|
12294
|
+
await pipeline4(
|
|
12295
|
+
Readable4.fromWeb(response.body),
|
|
12296
|
+
createWriteStream4(outPath)
|
|
12297
|
+
);
|
|
12298
|
+
const contentLength = response.headers.get("content-length");
|
|
12299
|
+
const size = contentLength ? Number(contentLength) : 0;
|
|
12300
|
+
return { path: outPath, mimetype, size };
|
|
12301
|
+
}
|
|
11984
12302
|
|
|
11985
12303
|
// src/lib/api/domains/integrations-github.ts
|
|
11986
12304
|
init_esm_shims();
|
|
11987
|
-
import { createWriteStream as
|
|
11988
|
-
import { Readable as
|
|
11989
|
-
import { pipeline as
|
|
12305
|
+
import { createWriteStream as createWriteStream5 } from "fs";
|
|
12306
|
+
import { Readable as Readable5 } from "stream";
|
|
12307
|
+
import { pipeline as pipeline5 } from "stream/promises";
|
|
11990
12308
|
async function initGithubFileUpload(body) {
|
|
11991
12309
|
const config = await getClientConfig();
|
|
11992
12310
|
const client = initClient(integrationsGithubUploadInitContract, config);
|
|
@@ -12045,9 +12363,9 @@ async function downloadGithubFile(fileUrl, outPath, filename) {
|
|
|
12045
12363
|
);
|
|
12046
12364
|
}
|
|
12047
12365
|
const mimetype = response.headers.get("x-file-mimetype") ?? response.headers.get("content-type") ?? "application/octet-stream";
|
|
12048
|
-
await
|
|
12049
|
-
|
|
12050
|
-
|
|
12366
|
+
await pipeline5(
|
|
12367
|
+
Readable5.fromWeb(response.body),
|
|
12368
|
+
createWriteStream5(outPath)
|
|
12051
12369
|
);
|
|
12052
12370
|
const contentLengthHeader = response.headers.get("content-length");
|
|
12053
12371
|
const size = contentLengthHeader ? Number(contentLengthHeader) : 0;
|
|
@@ -12056,9 +12374,9 @@ async function downloadGithubFile(fileUrl, outPath, filename) {
|
|
|
12056
12374
|
|
|
12057
12375
|
// src/lib/api/domains/integrations-phone.ts
|
|
12058
12376
|
init_esm_shims();
|
|
12059
|
-
import { createWriteStream as
|
|
12060
|
-
import { Readable as
|
|
12061
|
-
import { pipeline as
|
|
12377
|
+
import { createWriteStream as createWriteStream6 } from "fs";
|
|
12378
|
+
import { Readable as Readable6 } from "stream";
|
|
12379
|
+
import { pipeline as pipeline6 } from "stream/promises";
|
|
12062
12380
|
async function sendPhoneMessage(body) {
|
|
12063
12381
|
const config = await getClientConfig();
|
|
12064
12382
|
const client = initClient(integrationsPhoneMessageContract, config);
|
|
@@ -12123,9 +12441,9 @@ async function downloadPhoneFile(fileId, outPath) {
|
|
|
12123
12441
|
);
|
|
12124
12442
|
}
|
|
12125
12443
|
const mimetype = response.headers.get("x-file-mimetype") ?? response.headers.get("content-type") ?? "application/octet-stream";
|
|
12126
|
-
await
|
|
12127
|
-
|
|
12128
|
-
|
|
12444
|
+
await pipeline6(
|
|
12445
|
+
Readable6.fromWeb(response.body),
|
|
12446
|
+
createWriteStream6(outPath)
|
|
12129
12447
|
);
|
|
12130
12448
|
const contentLengthHeader = response.headers.get("content-length");
|
|
12131
12449
|
const size = contentLengthHeader ? Number(contentLengthHeader) : 0;
|
|
@@ -12365,9 +12683,11 @@ export {
|
|
|
12365
12683
|
listZeroCustomConnectors,
|
|
12366
12684
|
getZeroCustomConnector,
|
|
12367
12685
|
linkZeroMailDraft,
|
|
12686
|
+
FEISHU_FILE_UPLOAD_MAX_BYTES,
|
|
12368
12687
|
sendSlackMessage,
|
|
12369
12688
|
initSlackFileUpload,
|
|
12370
12689
|
completeSlackFileUpload,
|
|
12690
|
+
materializeSlackFileUpload,
|
|
12371
12691
|
downloadSlackFile,
|
|
12372
12692
|
listTelegramBots,
|
|
12373
12693
|
sendTelegramMessage,
|
|
@@ -12379,6 +12699,9 @@ export {
|
|
|
12379
12699
|
completeTeamsFileUpload,
|
|
12380
12700
|
downloadTeamsFile,
|
|
12381
12701
|
sendFeishuMessage,
|
|
12702
|
+
initFeishuFileUpload,
|
|
12703
|
+
completeFeishuFileUpload,
|
|
12704
|
+
downloadFeishuFile,
|
|
12382
12705
|
initGithubFileUpload,
|
|
12383
12706
|
completeGithubFileUpload,
|
|
12384
12707
|
downloadGithubFile,
|
|
@@ -12441,4 +12764,4 @@ export {
|
|
|
12441
12764
|
getHostedSiteFiles,
|
|
12442
12765
|
getHostedSiteDeployments
|
|
12443
12766
|
};
|
|
12444
|
-
//# sourceMappingURL=chunk-
|
|
12767
|
+
//# sourceMappingURL=chunk-QL2BWE6J.js.map
|