@vm0/cli 9.251.0 → 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-3IQFM2KY.js → agent-DJY6SYVC.js} +7 -7
- package/{banking-EYUWBTLB.js → banking-SV5ZIH44.js} +5 -5
- package/{chat-S7Z2SOGU.js → chat-G2KQYYK5.js} +6 -6
- package/{chunk-KVNHL3NQ.js → chunk-AWLNHCAC.js} +4 -4
- package/{chunk-THDGMML6.js → chunk-BKSVVARX.js} +2 -2
- package/{chunk-2USAOUQI.js → chunk-BSDS7GCS.js} +5 -4
- package/chunk-BSDS7GCS.js.map +1 -0
- package/{chunk-5CVPQC2F.js → chunk-CUAL7MH6.js} +2 -2
- package/{chunk-K3F4FDYI.js → chunk-DK3C2ME6.js} +14 -3
- package/chunk-DK3C2ME6.js.map +1 -0
- package/{chunk-CGLTWZX7.js → chunk-E2DKMMGY.js} +3 -3
- package/{chunk-OJM5IFC3.js → chunk-I56DJKTX.js} +3 -7
- package/chunk-I56DJKTX.js.map +1 -0
- package/{chunk-H46N52S6.js → chunk-IX2GN2TI.js} +2 -2
- package/{chunk-ZSP7ISNV.js → chunk-QL2BWE6J.js} +390 -20
- package/chunk-QL2BWE6J.js.map +1 -0
- package/{chunk-WIO4VCT5.js → chunk-RGHA7C2O.js} +2 -2
- package/{chunk-QHG7ITIT.js → chunk-TRFIH4R5.js} +2 -2
- package/{computer-use-ZI4I63OA.js → computer-use-FUBM53XG.js} +5 -5
- package/{connector-JEISK7OP.js → connector-3GCLB6HW.js} +8 -8
- package/{credit-DZLGKM5H.js → credit-SXRYMKSD.js} +7 -7
- package/{developer-support-GKND4K5Y.js → developer-support-LQHWOQLY.js} +5 -5
- package/{doctor-IDEBPM3X.js → doctor-RVC32BKE.js} +7 -7
- package/feishu-62E2QMM5.js +277 -0
- package/feishu-62E2QMM5.js.map +1 -0
- package/{finance-QRFJGKEW.js → finance-HP4WFZUY.js} +5 -5
- package/{generate-SDDS6YWC.js → generate-PTBOIM6B.js} +7 -7
- package/{github-6KEMKHRG.js → github-62XSFEWF.js} +5 -5
- package/{goal-5ER7N3Z3.js → goal-VRWB2AS3.js} +5 -5
- package/{host-JYOXNY2B.js → host-OKISPSSS.js} +5 -5
- package/{logs-7AGKFCY3.js → logs-53CMUU4J.js} +6 -6
- package/{mail-LJKDHK2A.js → mail-E6R5V6F6.js} +7 -7
- package/{maps-HRMZ7QBC.js → maps-B7F3CODU.js} +5 -5
- package/{model-RXY3MPL4.js → model-2VZQVFTE.js} +6 -6
- package/{model-provider-HYLOR2WF.js → model-provider-XALJ5BZB.js} +6 -6
- package/{org-FKZQ7WF6.js → org-JIAZYZUL.js} +5 -5
- package/package.json +1 -1
- package/{people-search-444TQMDB.js → people-search-LZ2BRXA6.js} +5 -5
- package/{phone-OI2MXOHO.js → phone-MXUV3YD3.js} +5 -5
- package/{preference-MQYZJ7R3.js → preference-LONJZKPE.js} +5 -5
- package/{resource-RVZZU2ZM.js → resource-26IQ2JCS.js} +5 -5
- package/{scrape-MLGY4WK2.js → scrape-H2ZA5AJD.js} +5 -5
- package/{search-PPAN6ZHY.js → search-R62IJFT4.js} +6 -6
- package/{secret-HIYUWKY4.js → secret-PHZZWEE3.js} +5 -5
- package/{slack-QDR4X4V7.js → slack-DQJUJIWY.js} +174 -47
- package/slack-DQJUJIWY.js.map +1 -0
- package/{teams-K6YHGEVC.js → teams-B5NDIX3U.js} +5 -5
- package/{telegram-LHBCOVZP.js → telegram-R67CYOON.js} +5 -5
- package/{upgrade-KM4H4ARY.js → upgrade-FJKXJO6L.js} +4 -4
- package/{variable-ULJ4EFHR.js → variable-GNCE5TUG.js} +5 -5
- package/{video-P26LRUFN.js → video-UDPAFI36.js} +4 -4
- package/{weather-DMUJWZDC.js → weather-O6L5SALA.js} +5 -5
- package/{web-ESXMLMEC.js → web-6I5S773Q.js} +5 -5
- package/{web-search-QCZNJGMG.js → web-search-GQAKFVCC.js} +5 -5
- package/{whoami-4NVG5FI7.js → whoami-MEJV5DZB.js} +7 -7
- package/{workflow-G7DL7SCF.js → workflow-PEVNMY2N.js} +5 -5
- package/zero.js +42 -42
- package/chunk-2USAOUQI.js.map +0 -1
- package/chunk-K3F4FDYI.js.map +0 -1
- package/chunk-OJM5IFC3.js.map +0 -1
- package/chunk-ZSP7ISNV.js.map +0 -1
- package/feishu-HUX5DNAS.js +0 -119
- package/feishu-HUX5DNAS.js.map +0 -1
- package/slack-QDR4X4V7.js.map +0 -1
- /package/{agent-3IQFM2KY.js.map → agent-DJY6SYVC.js.map} +0 -0
- /package/{banking-EYUWBTLB.js.map → banking-SV5ZIH44.js.map} +0 -0
- /package/{chat-S7Z2SOGU.js.map → chat-G2KQYYK5.js.map} +0 -0
- /package/{chunk-KVNHL3NQ.js.map → chunk-AWLNHCAC.js.map} +0 -0
- /package/{chunk-THDGMML6.js.map → chunk-BKSVVARX.js.map} +0 -0
- /package/{chunk-5CVPQC2F.js.map → chunk-CUAL7MH6.js.map} +0 -0
- /package/{chunk-CGLTWZX7.js.map → chunk-E2DKMMGY.js.map} +0 -0
- /package/{chunk-H46N52S6.js.map → chunk-IX2GN2TI.js.map} +0 -0
- /package/{chunk-WIO4VCT5.js.map → chunk-RGHA7C2O.js.map} +0 -0
- /package/{chunk-QHG7ITIT.js.map → chunk-TRFIH4R5.js.map} +0 -0
- /package/{computer-use-ZI4I63OA.js.map → computer-use-FUBM53XG.js.map} +0 -0
- /package/{connector-JEISK7OP.js.map → connector-3GCLB6HW.js.map} +0 -0
- /package/{credit-DZLGKM5H.js.map → credit-SXRYMKSD.js.map} +0 -0
- /package/{developer-support-GKND4K5Y.js.map → developer-support-LQHWOQLY.js.map} +0 -0
- /package/{doctor-IDEBPM3X.js.map → doctor-RVC32BKE.js.map} +0 -0
- /package/{finance-QRFJGKEW.js.map → finance-HP4WFZUY.js.map} +0 -0
- /package/{generate-SDDS6YWC.js.map → generate-PTBOIM6B.js.map} +0 -0
- /package/{github-6KEMKHRG.js.map → github-62XSFEWF.js.map} +0 -0
- /package/{goal-5ER7N3Z3.js.map → goal-VRWB2AS3.js.map} +0 -0
- /package/{host-JYOXNY2B.js.map → host-OKISPSSS.js.map} +0 -0
- /package/{logs-7AGKFCY3.js.map → logs-53CMUU4J.js.map} +0 -0
- /package/{mail-LJKDHK2A.js.map → mail-E6R5V6F6.js.map} +0 -0
- /package/{maps-HRMZ7QBC.js.map → maps-B7F3CODU.js.map} +0 -0
- /package/{model-RXY3MPL4.js.map → model-2VZQVFTE.js.map} +0 -0
- /package/{model-provider-HYLOR2WF.js.map → model-provider-XALJ5BZB.js.map} +0 -0
- /package/{org-FKZQ7WF6.js.map → org-JIAZYZUL.js.map} +0 -0
- /package/{people-search-444TQMDB.js.map → people-search-LZ2BRXA6.js.map} +0 -0
- /package/{phone-OI2MXOHO.js.map → phone-MXUV3YD3.js.map} +0 -0
- /package/{preference-MQYZJ7R3.js.map → preference-LONJZKPE.js.map} +0 -0
- /package/{resource-RVZZU2ZM.js.map → resource-26IQ2JCS.js.map} +0 -0
- /package/{scrape-MLGY4WK2.js.map → scrape-H2ZA5AJD.js.map} +0 -0
- /package/{search-PPAN6ZHY.js.map → search-R62IJFT4.js.map} +0 -0
- /package/{secret-HIYUWKY4.js.map → secret-PHZZWEE3.js.map} +0 -0
- /package/{teams-K6YHGEVC.js.map → teams-B5NDIX3U.js.map} +0 -0
- /package/{telegram-LHBCOVZP.js.map → telegram-R67CYOON.js.map} +0 -0
- /package/{upgrade-KM4H4ARY.js.map → upgrade-FJKXJO6L.js.map} +0 -0
- /package/{variable-ULJ4EFHR.js.map → variable-GNCE5TUG.js.map} +0 -0
- /package/{video-P26LRUFN.js.map → video-UDPAFI36.js.map} +0 -0
- /package/{weather-DMUJWZDC.js.map → weather-O6L5SALA.js.map} +0 -0
- /package/{web-ESXMLMEC.js.map → web-6I5S773Q.js.map} +0 -0
- /package/{web-search-QCZNJGMG.js.map → web-search-GQAKFVCC.js.map} +0 -0
- /package/{whoami-4NVG5FI7.js.map → whoami-MEJV5DZB.js.map} +0 -0
- /package/{workflow-G7DL7SCF.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",
|
|
@@ -7588,6 +7614,53 @@ var webhookModelUsageObservationContract = c25.router({
|
|
|
7588
7614
|
summary: "Receive model usage observation data from sandbox"
|
|
7589
7615
|
}
|
|
7590
7616
|
});
|
|
7617
|
+
var webhookModelUsageObservationV2ItemSchema = external_exports.object({
|
|
7618
|
+
idempotencyKey: external_exports.uuid(),
|
|
7619
|
+
model: external_exports.string().min(1).max(255),
|
|
7620
|
+
inputTokens: external_exports.number().int().min(0).max(Number.MAX_SAFE_INTEGER),
|
|
7621
|
+
outputTokens: external_exports.number().int().min(0).max(Number.MAX_SAFE_INTEGER),
|
|
7622
|
+
cacheReadInputTokens: external_exports.number().int().min(0).max(Number.MAX_SAFE_INTEGER),
|
|
7623
|
+
cacheCreationInputTokens: external_exports.number().int().min(0).max(Number.MAX_SAFE_INTEGER)
|
|
7624
|
+
}).strict().refine(
|
|
7625
|
+
(event) => {
|
|
7626
|
+
return event.inputTokens > 0 || event.outputTokens > 0 || event.cacheReadInputTokens > 0 || event.cacheCreationInputTokens > 0;
|
|
7627
|
+
},
|
|
7628
|
+
{ message: "At least one token counter must be positive" }
|
|
7629
|
+
);
|
|
7630
|
+
var webhookModelUsageObservationV2BodySchema = external_exports.object({
|
|
7631
|
+
runId: external_exports.string().min(1, "runId is required"),
|
|
7632
|
+
events: external_exports.array(webhookModelUsageObservationV2ItemSchema).min(1).max(100)
|
|
7633
|
+
}).strict().superRefine((body, ctx) => {
|
|
7634
|
+
const idempotencyKeys = /* @__PURE__ */ new Set();
|
|
7635
|
+
body.events.forEach((event, index) => {
|
|
7636
|
+
if (idempotencyKeys.has(event.idempotencyKey)) {
|
|
7637
|
+
ctx.addIssue({
|
|
7638
|
+
code: "custom",
|
|
7639
|
+
path: ["events", index, "idempotencyKey"],
|
|
7640
|
+
message: "Idempotency keys must be unique within a request"
|
|
7641
|
+
});
|
|
7642
|
+
}
|
|
7643
|
+
idempotencyKeys.add(event.idempotencyKey);
|
|
7644
|
+
});
|
|
7645
|
+
});
|
|
7646
|
+
var webhookModelUsageObservationV2Contract = c25.router({
|
|
7647
|
+
send: {
|
|
7648
|
+
method: "POST",
|
|
7649
|
+
path: "/api/webhooks/agent/model-usage-observation-v2",
|
|
7650
|
+
headers: authHeadersSchema,
|
|
7651
|
+
body: webhookModelUsageObservationV2BodySchema,
|
|
7652
|
+
responses: {
|
|
7653
|
+
200: external_exports.object({
|
|
7654
|
+
success: external_exports.boolean()
|
|
7655
|
+
}),
|
|
7656
|
+
400: apiErrorSchema,
|
|
7657
|
+
401: apiErrorSchema,
|
|
7658
|
+
404: apiErrorSchema,
|
|
7659
|
+
500: apiErrorSchema
|
|
7660
|
+
},
|
|
7661
|
+
summary: "Receive compact model usage observation data from sandbox"
|
|
7662
|
+
}
|
|
7663
|
+
});
|
|
7591
7664
|
|
|
7592
7665
|
// ../../packages/api-contracts/src/contracts/zero-runs.ts
|
|
7593
7666
|
var zeroRunRequestSchema = unifiedRunRequestSchema.omit({
|
|
@@ -10988,7 +11061,13 @@ var zeroMailDraftStatusSchema = external_exports.enum(["draft", "sent", "deleted
|
|
|
10988
11061
|
var zeroMailAttachmentSchema = external_exports.object({
|
|
10989
11062
|
filename: external_exports.string(),
|
|
10990
11063
|
contentType: external_exports.string(),
|
|
10991
|
-
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()
|
|
10992
11071
|
});
|
|
10993
11072
|
var zeroMailDraftBaseSchema = external_exports.object({
|
|
10994
11073
|
provider: external_exports.literal("gmail"),
|
|
@@ -10999,6 +11078,9 @@ var zeroMailDraftBaseSchema = external_exports.object({
|
|
|
10999
11078
|
bcc: external_exports.array(external_exports.email()),
|
|
11000
11079
|
subject: external_exports.string(),
|
|
11001
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(),
|
|
11002
11084
|
replyTo: external_exports.string().optional(),
|
|
11003
11085
|
inReplyTo: external_exports.string().optional(),
|
|
11004
11086
|
references: external_exports.array(external_exports.string()),
|
|
@@ -11028,6 +11110,9 @@ var zeroMailLinkResponseSchema = zeroMailDraftResponseSchema.pick({
|
|
|
11028
11110
|
var zeroMailDraftPathParamsSchema = external_exports.object({
|
|
11029
11111
|
mailDraftId: external_exports.string().uuid()
|
|
11030
11112
|
});
|
|
11113
|
+
var zeroMailDraftAttachmentPathParamsSchema = zeroMailDraftPathParamsSchema.extend({
|
|
11114
|
+
partId: external_exports.string().min(1)
|
|
11115
|
+
});
|
|
11031
11116
|
var zeroMailContract = c36.router({
|
|
11032
11117
|
linkDraft: {
|
|
11033
11118
|
method: "POST",
|
|
@@ -11061,6 +11146,23 @@ var zeroMailContract = c36.router({
|
|
|
11061
11146
|
},
|
|
11062
11147
|
summary: "Get an email draft by ID"
|
|
11063
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
|
+
},
|
|
11064
11166
|
deleteDraft: {
|
|
11065
11167
|
method: "DELETE",
|
|
11066
11168
|
path: "/api/zero/mail/drafts/:mailDraftId",
|
|
@@ -11209,6 +11311,117 @@ var integrationsFeishuMessageContract = c37.router({
|
|
|
11209
11311
|
summary: "Send a Feishu message via an organization custom app"
|
|
11210
11312
|
}
|
|
11211
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
|
+
});
|
|
11212
11425
|
var sendTelegramMessageBodySchema = external_exports.object({
|
|
11213
11426
|
botId: external_exports.string().min(1, "Bot ID is required"),
|
|
11214
11427
|
chatId: external_exports.string().min(1, "Chat ID is required"),
|
|
@@ -11385,12 +11598,32 @@ var integrationsTelegramBotListContract = c37.router({
|
|
|
11385
11598
|
});
|
|
11386
11599
|
var slackUploadInitBodySchema = external_exports.object({
|
|
11387
11600
|
filename: external_exports.string().min(1, "Filename is required"),
|
|
11388
|
-
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()
|
|
11389
11611
|
});
|
|
11390
|
-
var
|
|
11612
|
+
var directSlackUploadInitResponseSchema = external_exports.object({
|
|
11391
11613
|
uploadUrl: external_exports.string(),
|
|
11392
11614
|
fileId: external_exports.string()
|
|
11393
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
|
+
]);
|
|
11394
11627
|
var integrationsSlackUploadInitContract = c37.router({
|
|
11395
11628
|
init: {
|
|
11396
11629
|
method: "POST",
|
|
@@ -11407,6 +11640,47 @@ var integrationsSlackUploadInitContract = c37.router({
|
|
|
11407
11640
|
summary: "Get a pre-signed Slack upload URL via org bot token"
|
|
11408
11641
|
}
|
|
11409
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
|
+
});
|
|
11410
11684
|
var telegramUploadInitBodySchema = external_exports.object({
|
|
11411
11685
|
filename: external_exports.string().min(1, "Filename is required").max(255),
|
|
11412
11686
|
contentType: external_exports.string().min(1, "Content type is required").max(200),
|
|
@@ -11660,11 +11934,18 @@ var slackUploadCompleteBodySchema = external_exports.object({
|
|
|
11660
11934
|
channel: external_exports.string().min(1, "Channel ID is required"),
|
|
11661
11935
|
threadTs: external_exports.string().optional(),
|
|
11662
11936
|
title: external_exports.string().optional(),
|
|
11663
|
-
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()
|
|
11664
11941
|
});
|
|
11665
11942
|
var slackUploadCompleteResponseSchema = external_exports.object({
|
|
11666
11943
|
fileId: external_exports.string(),
|
|
11667
|
-
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()
|
|
11668
11949
|
});
|
|
11669
11950
|
var integrationsSlackUploadCompleteContract = c37.router({
|
|
11670
11951
|
complete: {
|
|
@@ -11711,6 +11992,15 @@ async function completeSlackFileUpload(body) {
|
|
|
11711
11992
|
}
|
|
11712
11993
|
handleError(result, "Failed to complete Slack file upload");
|
|
11713
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
|
+
}
|
|
11714
12004
|
async function downloadSlackFile(fileId, outPath) {
|
|
11715
12005
|
const baseUrl = await getBaseUrl();
|
|
11716
12006
|
const token = await getActiveToken();
|
|
@@ -11925,6 +12215,9 @@ async function downloadTeamsFile(fileId, outPath) {
|
|
|
11925
12215
|
|
|
11926
12216
|
// src/lib/api/domains/integrations-feishu.ts
|
|
11927
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";
|
|
11928
12221
|
async function sendFeishuMessage(body) {
|
|
11929
12222
|
const config = await getClientConfig();
|
|
11930
12223
|
const client = initClient(integrationsFeishuMessageContract, config);
|
|
@@ -11934,12 +12227,84 @@ async function sendFeishuMessage(body) {
|
|
|
11934
12227
|
}
|
|
11935
12228
|
handleError(result, "Failed to send Feishu message");
|
|
11936
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
|
+
}
|
|
11937
12302
|
|
|
11938
12303
|
// src/lib/api/domains/integrations-github.ts
|
|
11939
12304
|
init_esm_shims();
|
|
11940
|
-
import { createWriteStream as
|
|
11941
|
-
import { Readable as
|
|
11942
|
-
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";
|
|
11943
12308
|
async function initGithubFileUpload(body) {
|
|
11944
12309
|
const config = await getClientConfig();
|
|
11945
12310
|
const client = initClient(integrationsGithubUploadInitContract, config);
|
|
@@ -11998,9 +12363,9 @@ async function downloadGithubFile(fileUrl, outPath, filename) {
|
|
|
11998
12363
|
);
|
|
11999
12364
|
}
|
|
12000
12365
|
const mimetype = response.headers.get("x-file-mimetype") ?? response.headers.get("content-type") ?? "application/octet-stream";
|
|
12001
|
-
await
|
|
12002
|
-
|
|
12003
|
-
|
|
12366
|
+
await pipeline5(
|
|
12367
|
+
Readable5.fromWeb(response.body),
|
|
12368
|
+
createWriteStream5(outPath)
|
|
12004
12369
|
);
|
|
12005
12370
|
const contentLengthHeader = response.headers.get("content-length");
|
|
12006
12371
|
const size = contentLengthHeader ? Number(contentLengthHeader) : 0;
|
|
@@ -12009,9 +12374,9 @@ async function downloadGithubFile(fileUrl, outPath, filename) {
|
|
|
12009
12374
|
|
|
12010
12375
|
// src/lib/api/domains/integrations-phone.ts
|
|
12011
12376
|
init_esm_shims();
|
|
12012
|
-
import { createWriteStream as
|
|
12013
|
-
import { Readable as
|
|
12014
|
-
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";
|
|
12015
12380
|
async function sendPhoneMessage(body) {
|
|
12016
12381
|
const config = await getClientConfig();
|
|
12017
12382
|
const client = initClient(integrationsPhoneMessageContract, config);
|
|
@@ -12076,9 +12441,9 @@ async function downloadPhoneFile(fileId, outPath) {
|
|
|
12076
12441
|
);
|
|
12077
12442
|
}
|
|
12078
12443
|
const mimetype = response.headers.get("x-file-mimetype") ?? response.headers.get("content-type") ?? "application/octet-stream";
|
|
12079
|
-
await
|
|
12080
|
-
|
|
12081
|
-
|
|
12444
|
+
await pipeline6(
|
|
12445
|
+
Readable6.fromWeb(response.body),
|
|
12446
|
+
createWriteStream6(outPath)
|
|
12082
12447
|
);
|
|
12083
12448
|
const contentLengthHeader = response.headers.get("content-length");
|
|
12084
12449
|
const size = contentLengthHeader ? Number(contentLengthHeader) : 0;
|
|
@@ -12318,9 +12683,11 @@ export {
|
|
|
12318
12683
|
listZeroCustomConnectors,
|
|
12319
12684
|
getZeroCustomConnector,
|
|
12320
12685
|
linkZeroMailDraft,
|
|
12686
|
+
FEISHU_FILE_UPLOAD_MAX_BYTES,
|
|
12321
12687
|
sendSlackMessage,
|
|
12322
12688
|
initSlackFileUpload,
|
|
12323
12689
|
completeSlackFileUpload,
|
|
12690
|
+
materializeSlackFileUpload,
|
|
12324
12691
|
downloadSlackFile,
|
|
12325
12692
|
listTelegramBots,
|
|
12326
12693
|
sendTelegramMessage,
|
|
@@ -12332,6 +12699,9 @@ export {
|
|
|
12332
12699
|
completeTeamsFileUpload,
|
|
12333
12700
|
downloadTeamsFile,
|
|
12334
12701
|
sendFeishuMessage,
|
|
12702
|
+
initFeishuFileUpload,
|
|
12703
|
+
completeFeishuFileUpload,
|
|
12704
|
+
downloadFeishuFile,
|
|
12335
12705
|
initGithubFileUpload,
|
|
12336
12706
|
completeGithubFileUpload,
|
|
12337
12707
|
downloadGithubFile,
|
|
@@ -12394,4 +12764,4 @@ export {
|
|
|
12394
12764
|
getHostedSiteFiles,
|
|
12395
12765
|
getHostedSiteDeployments
|
|
12396
12766
|
};
|
|
12397
|
-
//# sourceMappingURL=chunk-
|
|
12767
|
+
//# sourceMappingURL=chunk-QL2BWE6J.js.map
|