@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
|
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from "node:module";
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
getApiUrl
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-E2DKMMGY.js";
|
|
7
7
|
import {
|
|
8
8
|
init_esm_shims
|
|
9
9
|
} from "./chunk-3VVCUQPB.js";
|
|
@@ -42,4 +42,4 @@ export {
|
|
|
42
42
|
toPlatformUrl,
|
|
43
43
|
getPlatformOrigin
|
|
44
44
|
};
|
|
45
|
-
//# sourceMappingURL=chunk-
|
|
45
|
+
//# sourceMappingURL=chunk-RGHA7C2O.js.map
|
|
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from "node:module";
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
UNKNOWN_PERMISSION_GRANT
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QL2BWE6J.js";
|
|
7
7
|
import {
|
|
8
8
|
init_esm_shims
|
|
9
9
|
} from "./chunk-3VVCUQPB.js";
|
|
@@ -130,4 +130,4 @@ export {
|
|
|
130
130
|
resolveFirewallMetadataPolicies,
|
|
131
131
|
permissionGrantsToFirewallPolicies
|
|
132
132
|
};
|
|
133
|
-
//# sourceMappingURL=chunk-
|
|
133
|
+
//# sourceMappingURL=chunk-TRFIH4R5.js.map
|
|
@@ -12,13 +12,13 @@ import {
|
|
|
12
12
|
fetchComputerUseScreenshot,
|
|
13
13
|
getComputerUseCommand,
|
|
14
14
|
listComputerUseHosts
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-QL2BWE6J.js";
|
|
16
|
+
import "./chunk-BSDS7GCS.js";
|
|
17
17
|
import {
|
|
18
18
|
ApiRequestError,
|
|
19
19
|
withErrorHandler
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-E2DKMMGY.js";
|
|
21
|
+
import "./chunk-DK3C2ME6.js";
|
|
22
22
|
import {
|
|
23
23
|
Command
|
|
24
24
|
} from "./chunk-LD4ZVU4O.js";
|
|
@@ -970,4 +970,4 @@ export {
|
|
|
970
970
|
formatComputerUseResultForConsole,
|
|
971
971
|
zeroComputerUseCommand
|
|
972
972
|
};
|
|
973
|
-
//# sourceMappingURL=computer-use-
|
|
973
|
+
//# sourceMappingURL=computer-use-FUBM53XG.js.map
|
|
@@ -3,14 +3,14 @@ import { createRequire as __createRequire } from "node:module";
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
findFirewallMetadataPermission
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TRFIH4R5.js";
|
|
7
7
|
import {
|
|
8
8
|
availableConnectorRefs,
|
|
9
9
|
findConnectorStatusItem,
|
|
10
10
|
resolveAgentContext,
|
|
11
11
|
resolveManualGrantAuthMethod,
|
|
12
12
|
searchPublicConnectorCatalog
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-IX2GN2TI.js";
|
|
14
14
|
import {
|
|
15
15
|
UNKNOWN_PERMISSION_GRANT,
|
|
16
16
|
connectZeroConnectorManualGrant,
|
|
@@ -25,20 +25,20 @@ import {
|
|
|
25
25
|
getZeroCustomConnector,
|
|
26
26
|
listZeroConnectorCatalogStatus,
|
|
27
27
|
listZeroCustomConnectors
|
|
28
|
-
} from "./chunk-
|
|
29
|
-
import "./chunk-
|
|
28
|
+
} from "./chunk-QL2BWE6J.js";
|
|
29
|
+
import "./chunk-BSDS7GCS.js";
|
|
30
30
|
import {
|
|
31
31
|
getPlatformOrigin,
|
|
32
32
|
toPlatformUrl
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-RGHA7C2O.js";
|
|
34
34
|
import "./chunk-SB7EZ2ZO.js";
|
|
35
35
|
import {
|
|
36
36
|
ApiRequestError,
|
|
37
37
|
getApiUrl,
|
|
38
38
|
source_default,
|
|
39
39
|
withErrorHandler
|
|
40
|
-
} from "./chunk-
|
|
41
|
-
import "./chunk-
|
|
40
|
+
} from "./chunk-E2DKMMGY.js";
|
|
41
|
+
import "./chunk-DK3C2ME6.js";
|
|
42
42
|
import {
|
|
43
43
|
Command,
|
|
44
44
|
Option
|
|
@@ -1557,4 +1557,4 @@ var zeroConnectorCommand = new Command().name("connector").description("Manage a
|
|
|
1557
1557
|
export {
|
|
1558
1558
|
zeroConnectorCommand
|
|
1559
1559
|
};
|
|
1560
|
-
//# sourceMappingURL=connector-
|
|
1560
|
+
//# sourceMappingURL=connector-3GCLB6HW.js.map
|
|
@@ -5,27 +5,27 @@ import {
|
|
|
5
5
|
currentPlanAllowsVideo,
|
|
6
6
|
currentPlanCanBuyCredits,
|
|
7
7
|
currentTokenCanReadBilling
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-CUAL7MH6.js";
|
|
9
9
|
import {
|
|
10
10
|
createZeroCreditCheckout,
|
|
11
11
|
getZeroBillingStatus,
|
|
12
12
|
getZeroOrgMembers
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-QL2BWE6J.js";
|
|
14
|
+
import "./chunk-BSDS7GCS.js";
|
|
15
15
|
import {
|
|
16
16
|
planUpgradeUrl
|
|
17
17
|
} from "./chunk-W75R7EZF.js";
|
|
18
18
|
import {
|
|
19
19
|
getPlatformOrigin
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-RGHA7C2O.js";
|
|
21
21
|
import "./chunk-SB7EZ2ZO.js";
|
|
22
22
|
import {
|
|
23
23
|
source_default,
|
|
24
24
|
withErrorHandler
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-E2DKMMGY.js";
|
|
26
26
|
import {
|
|
27
27
|
decodeZeroTokenPayload
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-DK3C2ME6.js";
|
|
29
29
|
import {
|
|
30
30
|
Command,
|
|
31
31
|
Option
|
|
@@ -163,4 +163,4 @@ var zeroCreditCommand = new Command().name("credit").description("View credit ba
|
|
|
163
163
|
export {
|
|
164
164
|
zeroCreditCommand
|
|
165
165
|
};
|
|
166
|
-
//# sourceMappingURL=credit-
|
|
166
|
+
//# sourceMappingURL=credit-SXRYMKSD.js.map
|
|
@@ -4,13 +4,13 @@ const require = __createRequire(import.meta.url);
|
|
|
4
4
|
import {
|
|
5
5
|
requestDeveloperSupportConsent,
|
|
6
6
|
submitDeveloperSupport
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-QL2BWE6J.js";
|
|
8
|
+
import "./chunk-BSDS7GCS.js";
|
|
9
9
|
import "./chunk-SB7EZ2ZO.js";
|
|
10
10
|
import {
|
|
11
11
|
withErrorHandler
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-E2DKMMGY.js";
|
|
13
|
+
import "./chunk-DK3C2ME6.js";
|
|
14
14
|
import {
|
|
15
15
|
Command
|
|
16
16
|
} from "./chunk-LD4ZVU4O.js";
|
|
@@ -61,4 +61,4 @@ Notes:
|
|
|
61
61
|
export {
|
|
62
62
|
zeroDeveloperSupportCommand
|
|
63
63
|
};
|
|
64
|
-
//# sourceMappingURL=developer-support-
|
|
64
|
+
//# sourceMappingURL=developer-support-LQHWOQLY.js.map
|
|
@@ -4,25 +4,25 @@ const require = __createRequire(import.meta.url);
|
|
|
4
4
|
import {
|
|
5
5
|
currentPlanAllowsVideo,
|
|
6
6
|
currentPlanCanBuyCredits
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-CUAL7MH6.js";
|
|
8
8
|
import {
|
|
9
9
|
getZeroBillingStatus,
|
|
10
10
|
getZeroOrg,
|
|
11
11
|
getZeroOrgMembers
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-QL2BWE6J.js";
|
|
13
|
+
import "./chunk-BSDS7GCS.js";
|
|
14
14
|
import {
|
|
15
15
|
planUpgradeUrl
|
|
16
16
|
} from "./chunk-W75R7EZF.js";
|
|
17
17
|
import {
|
|
18
18
|
getPlatformOrigin
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-RGHA7C2O.js";
|
|
20
20
|
import "./chunk-SB7EZ2ZO.js";
|
|
21
21
|
import {
|
|
22
22
|
source_default,
|
|
23
23
|
withErrorHandler
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import "./chunk-
|
|
24
|
+
} from "./chunk-E2DKMMGY.js";
|
|
25
|
+
import "./chunk-DK3C2ME6.js";
|
|
26
26
|
import {
|
|
27
27
|
Command
|
|
28
28
|
} from "./chunk-LD4ZVU4O.js";
|
|
@@ -122,4 +122,4 @@ Notes:
|
|
|
122
122
|
export {
|
|
123
123
|
zeroDoctorCommand
|
|
124
124
|
};
|
|
125
|
-
//# sourceMappingURL=doctor-
|
|
125
|
+
//# sourceMappingURL=doctor-RVC32BKE.js.map
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from "node:module";
|
|
3
|
+
const require = __createRequire(import.meta.url);
|
|
4
|
+
import {
|
|
5
|
+
FEISHU_FILE_UPLOAD_MAX_BYTES,
|
|
6
|
+
completeFeishuFileUpload,
|
|
7
|
+
downloadFeishuFile,
|
|
8
|
+
initFeishuFileUpload,
|
|
9
|
+
sendFeishuMessage
|
|
10
|
+
} from "./chunk-QL2BWE6J.js";
|
|
11
|
+
import "./chunk-BSDS7GCS.js";
|
|
12
|
+
import "./chunk-SB7EZ2ZO.js";
|
|
13
|
+
import {
|
|
14
|
+
source_default,
|
|
15
|
+
withErrorHandler
|
|
16
|
+
} from "./chunk-E2DKMMGY.js";
|
|
17
|
+
import "./chunk-DK3C2ME6.js";
|
|
18
|
+
import {
|
|
19
|
+
Command
|
|
20
|
+
} from "./chunk-LD4ZVU4O.js";
|
|
21
|
+
import {
|
|
22
|
+
init_esm_shims
|
|
23
|
+
} from "./chunk-3VVCUQPB.js";
|
|
24
|
+
|
|
25
|
+
// src/commands/zero/feishu/index.ts
|
|
26
|
+
init_esm_shims();
|
|
27
|
+
|
|
28
|
+
// src/commands/zero/feishu/download-file.ts
|
|
29
|
+
init_esm_shims();
|
|
30
|
+
import { tmpdir } from "os";
|
|
31
|
+
import { basename, join } from "path";
|
|
32
|
+
function defaultOutPath(fileKey) {
|
|
33
|
+
return join(tmpdir(), `feishu-${basename(fileKey).slice(0, 80)}`);
|
|
34
|
+
}
|
|
35
|
+
function parseResourceType(value) {
|
|
36
|
+
if (value !== "file" && value !== "image") {
|
|
37
|
+
throw new Error("--type must be either file or image");
|
|
38
|
+
}
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
var downloadFileCommand = new Command().name("download-file").description("Download a file from a Feishu message").argument("<message-id>", "Message ID from a [Feishu file] block").argument("<file-key>", "File key from a [Feishu file] block").requiredOption(
|
|
42
|
+
"--type <type>",
|
|
43
|
+
"Resource type from the block: file or image"
|
|
44
|
+
).option("-i, --installation <id>", "Feishu installation ID").option("-o, --out <path>", "Output path (default: /tmp/feishu-<file-key>)").addHelpText(
|
|
45
|
+
"after",
|
|
46
|
+
`
|
|
47
|
+
Examples:
|
|
48
|
+
Download a file: zero feishu download-file om_xxx file_xxx --type file
|
|
49
|
+
Download an image: zero feishu download-file om_xxx img_xxx --type image -o /tmp/image.png
|
|
50
|
+
Select an app: zero feishu download-file om_xxx file_xxx --type file -i <installation-id>
|
|
51
|
+
|
|
52
|
+
Output:
|
|
53
|
+
Prints a JSON object to stdout on success:
|
|
54
|
+
{"path":"/tmp/feishu-file_xxx","mimetype":"application/pdf","size":12345}
|
|
55
|
+
|
|
56
|
+
Notes:
|
|
57
|
+
- Use the message ID, file key, and type exactly as shown in a [Feishu file] block
|
|
58
|
+
- Specify --installation when the organization has multiple Feishu bots
|
|
59
|
+
- Streams the file bytes directly to disk`
|
|
60
|
+
).action(
|
|
61
|
+
withErrorHandler(
|
|
62
|
+
async (messageId, fileKey, options) => {
|
|
63
|
+
const outPath = options.out ?? defaultOutPath(fileKey);
|
|
64
|
+
const result = await downloadFeishuFile(
|
|
65
|
+
messageId,
|
|
66
|
+
fileKey,
|
|
67
|
+
parseResourceType(options.type),
|
|
68
|
+
options.installation,
|
|
69
|
+
outPath
|
|
70
|
+
);
|
|
71
|
+
console.log(JSON.stringify(result));
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
// src/commands/zero/feishu/message/index.ts
|
|
77
|
+
init_esm_shims();
|
|
78
|
+
|
|
79
|
+
// src/commands/zero/feishu/message/send.ts
|
|
80
|
+
init_esm_shims();
|
|
81
|
+
import { readFileSync } from "fs";
|
|
82
|
+
function isRecord(value) {
|
|
83
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
84
|
+
}
|
|
85
|
+
function parseCard(input) {
|
|
86
|
+
if (!input) {
|
|
87
|
+
return void 0;
|
|
88
|
+
}
|
|
89
|
+
let parsed;
|
|
90
|
+
try {
|
|
91
|
+
parsed = JSON.parse(input);
|
|
92
|
+
} catch {
|
|
93
|
+
throw new Error("Invalid JSON for --card flag", {
|
|
94
|
+
cause: new Error("Provide a valid Feishu card JSON object")
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
if (!isRecord(parsed)) {
|
|
98
|
+
throw new Error("Invalid JSON for --card", {
|
|
99
|
+
cause: new Error("Provide a Feishu card JSON object")
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
return parsed;
|
|
103
|
+
}
|
|
104
|
+
var sendCommand = new Command().name("send").description("Send a message to a Feishu chat or user").option("-i, --installation <id>", "Feishu installation ID").option("-c, --chat <id>", "Feishu chat ID").option("-u, --user <open-id>", 'Feishu user open ID (use "me" for yourself)').option("-r, --reply <message-id>", "Message ID to reply to").option("--thread", "Reply in a Feishu thread").option("-t, --text <message>", "Message text").option("--card <json>", "Feishu interactive card JSON").addHelpText(
|
|
105
|
+
"after",
|
|
106
|
+
`
|
|
107
|
+
Examples:
|
|
108
|
+
Chat message: zero feishu message send -c oc_xxx -t "Hello!"
|
|
109
|
+
Direct message: zero feishu message send -u ou_xxx -t "Hello!"
|
|
110
|
+
DM yourself: zero feishu message send -u me -t "Hello!"
|
|
111
|
+
Thread reply: zero feishu message send -r om_xxx --thread -t "Reply"
|
|
112
|
+
Interactive card: zero feishu message send -c oc_xxx --card '{"schema":"2.0","body":{"elements":[]}}'
|
|
113
|
+
Select a custom app: zero feishu message send -i <installation-id> -c oc_xxx -t "Hello!"
|
|
114
|
+
|
|
115
|
+
Notes:
|
|
116
|
+
- Exactly one of --chat, --user, or --reply is required
|
|
117
|
+
- Exactly one of --text or --card is required
|
|
118
|
+
- --installation is required when the organization has multiple Feishu bots`
|
|
119
|
+
).action(
|
|
120
|
+
withErrorHandler(async (options) => {
|
|
121
|
+
const targets = [options.chat, options.user, options.reply].filter(
|
|
122
|
+
Boolean
|
|
123
|
+
);
|
|
124
|
+
if (targets.length !== 1) {
|
|
125
|
+
throw new Error(
|
|
126
|
+
"Exactly one of --chat, --user, or --reply must be provided"
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
if (options.thread && !options.reply) {
|
|
130
|
+
throw new Error("--thread requires --reply");
|
|
131
|
+
}
|
|
132
|
+
let text = options.text;
|
|
133
|
+
if (!text && !options.card && !process.stdin.isTTY) {
|
|
134
|
+
try {
|
|
135
|
+
text = readFileSync("/dev/stdin", "utf8").trim();
|
|
136
|
+
} catch {
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
const card = parseCard(options.card);
|
|
140
|
+
if (Boolean(text) === Boolean(card)) {
|
|
141
|
+
throw new Error("Exactly one of --text or --card must be provided");
|
|
142
|
+
}
|
|
143
|
+
const result = await sendFeishuMessage({
|
|
144
|
+
installationId: options.installation,
|
|
145
|
+
chat: options.chat,
|
|
146
|
+
user: options.user,
|
|
147
|
+
replyToMessageId: options.reply,
|
|
148
|
+
replyInThread: options.thread,
|
|
149
|
+
text,
|
|
150
|
+
card
|
|
151
|
+
});
|
|
152
|
+
console.log(source_default.green(`\u2713 Message sent (message: ${result.messageId})`));
|
|
153
|
+
})
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
// src/commands/zero/feishu/message/index.ts
|
|
157
|
+
var zeroFeishuMessageCommand = new Command().name("message").description("Send Feishu messages").addCommand(sendCommand);
|
|
158
|
+
|
|
159
|
+
// src/commands/zero/feishu/upload-file.ts
|
|
160
|
+
init_esm_shims();
|
|
161
|
+
import { readFileSync as readFileSync2, statSync } from "fs";
|
|
162
|
+
import { basename as basename2, extname } from "path";
|
|
163
|
+
var MIME_BY_EXTENSION = {
|
|
164
|
+
".csv": "text/csv",
|
|
165
|
+
".gif": "image/gif",
|
|
166
|
+
".jpeg": "image/jpeg",
|
|
167
|
+
".jpg": "image/jpeg",
|
|
168
|
+
".json": "application/json",
|
|
169
|
+
".md": "text/markdown",
|
|
170
|
+
".mov": "video/quicktime",
|
|
171
|
+
".mp4": "video/mp4",
|
|
172
|
+
".pdf": "application/pdf",
|
|
173
|
+
".png": "image/png",
|
|
174
|
+
".svg": "image/svg+xml",
|
|
175
|
+
".txt": "text/plain",
|
|
176
|
+
".webm": "video/webm",
|
|
177
|
+
".webp": "image/webp"
|
|
178
|
+
};
|
|
179
|
+
function inferContentType(localPath) {
|
|
180
|
+
return MIME_BY_EXTENSION[extname(localPath).toLowerCase()] ?? "application/octet-stream";
|
|
181
|
+
}
|
|
182
|
+
var uploadFileCommand = new Command().name("upload-file").description("Upload a local file to Feishu as an organization bot").requiredOption("-f, --file <path>", "Local file path to upload").option("-i, --installation <id>", "Feishu installation ID").option("-c, --chat <id>", "Feishu chat ID").option("-u, --user <open-id>", 'Feishu user open ID (use "me" for yourself)').option("-r, --reply <message-id>", "Message ID to reply to").option("--thread", "Reply in a Feishu thread").option("--content-type <mime>", "Override inferred content type").addHelpText(
|
|
183
|
+
"after",
|
|
184
|
+
`
|
|
185
|
+
Examples:
|
|
186
|
+
Upload to a chat: zero feishu upload-file -f /tmp/report.pdf -c oc_xxx
|
|
187
|
+
Send a DM: zero feishu upload-file -f /tmp/report.pdf -u ou_xxx
|
|
188
|
+
Reply with a file: zero feishu upload-file -f /tmp/report.pdf -r om_xxx --thread
|
|
189
|
+
Select a custom app: zero feishu upload-file -f /tmp/report.pdf -i <installation-id> -c oc_xxx
|
|
190
|
+
|
|
191
|
+
Output:
|
|
192
|
+
Prints a JSON object to stdout on success:
|
|
193
|
+
{"messageId":"om_xxx","chatId":"oc_xxx","fileKey":"file_xxx","filename":"report.pdf","mimetype":"application/pdf","size":12345,"url":"https://..."}
|
|
194
|
+
|
|
195
|
+
Notes:
|
|
196
|
+
- Exactly one of --chat, --user, or --reply is required
|
|
197
|
+
- Feishu accepts non-empty files up to 30 MB
|
|
198
|
+
- Specify --installation when the organization has multiple Feishu bots`
|
|
199
|
+
).action(
|
|
200
|
+
withErrorHandler(async (options) => {
|
|
201
|
+
const targets = [options.chat, options.user, options.reply].filter(
|
|
202
|
+
Boolean
|
|
203
|
+
);
|
|
204
|
+
if (targets.length !== 1) {
|
|
205
|
+
throw new Error(
|
|
206
|
+
"Exactly one of --chat, --user, or --reply must be provided"
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
if (options.thread && !options.reply) {
|
|
210
|
+
throw new Error("--thread requires --reply");
|
|
211
|
+
}
|
|
212
|
+
let fileSize;
|
|
213
|
+
try {
|
|
214
|
+
const stat = statSync(options.file);
|
|
215
|
+
if (!stat.isFile()) {
|
|
216
|
+
throw new Error(`Not a regular file: ${options.file}`);
|
|
217
|
+
}
|
|
218
|
+
fileSize = stat.size;
|
|
219
|
+
} catch (error) {
|
|
220
|
+
if (error instanceof Error && error.message.startsWith("Not ")) {
|
|
221
|
+
throw error;
|
|
222
|
+
}
|
|
223
|
+
throw new Error(`File not found: ${options.file}`);
|
|
224
|
+
}
|
|
225
|
+
if (fileSize === 0) {
|
|
226
|
+
throw new Error("File is empty");
|
|
227
|
+
}
|
|
228
|
+
if (fileSize > FEISHU_FILE_UPLOAD_MAX_BYTES) {
|
|
229
|
+
throw new Error(
|
|
230
|
+
`File exceeds Feishu's ${FEISHU_FILE_UPLOAD_MAX_BYTES}-byte limit`
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
const filename = basename2(options.file);
|
|
234
|
+
const contentType = options.contentType ?? inferContentType(options.file);
|
|
235
|
+
const prepared = await initFeishuFileUpload({
|
|
236
|
+
filename,
|
|
237
|
+
contentType,
|
|
238
|
+
length: fileSize
|
|
239
|
+
});
|
|
240
|
+
const uploadResponse = await fetch(prepared.uploadUrl, {
|
|
241
|
+
method: "PUT",
|
|
242
|
+
headers: { "Content-Type": prepared.contentType },
|
|
243
|
+
body: new Uint8Array(readFileSync2(options.file))
|
|
244
|
+
});
|
|
245
|
+
if (!uploadResponse.ok) {
|
|
246
|
+
throw new Error(
|
|
247
|
+
`File upload failed: ${uploadResponse.status} ${uploadResponse.statusText}`
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
const result = await completeFeishuFileUpload({
|
|
251
|
+
uploadId: prepared.uploadId,
|
|
252
|
+
installationId: options.installation,
|
|
253
|
+
chat: options.chat,
|
|
254
|
+
user: options.user,
|
|
255
|
+
replyToMessageId: options.reply,
|
|
256
|
+
replyInThread: options.thread,
|
|
257
|
+
contentType: prepared.contentType
|
|
258
|
+
});
|
|
259
|
+
console.log(JSON.stringify(result));
|
|
260
|
+
})
|
|
261
|
+
);
|
|
262
|
+
|
|
263
|
+
// src/commands/zero/feishu/index.ts
|
|
264
|
+
var zeroFeishuCommand = new Command().name("feishu").description("Send messages and transfer files through Feishu").addCommand(zeroFeishuMessageCommand).addCommand(downloadFileCommand).addCommand(uploadFileCommand).addHelpText(
|
|
265
|
+
"after",
|
|
266
|
+
`
|
|
267
|
+
Examples:
|
|
268
|
+
Send to a chat: zero feishu message send -c <chat-id> -t "Hello!"
|
|
269
|
+
Send a DM: zero feishu message send -u <open-id> -t "Hello!"
|
|
270
|
+
Reply in a thread: zero feishu message send -r <message-id> --thread -t "Reply"
|
|
271
|
+
Upload a file: zero feishu upload-file -f /tmp/report.pdf -c <chat-id>
|
|
272
|
+
Download a file: zero feishu download-file <message-id> <file-key> --type file`
|
|
273
|
+
);
|
|
274
|
+
export {
|
|
275
|
+
zeroFeishuCommand
|
|
276
|
+
};
|
|
277
|
+
//# sourceMappingURL=feishu-62E2QMM5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/zero/feishu/index.ts","../src/commands/zero/feishu/download-file.ts","../src/commands/zero/feishu/message/index.ts","../src/commands/zero/feishu/message/send.ts","../src/commands/zero/feishu/upload-file.ts"],"sourcesContent":["import { Command } from \"commander\";\n\nimport { downloadFileCommand } from \"./download-file\";\nimport { zeroFeishuMessageCommand } from \"./message\";\nimport { uploadFileCommand } from \"./upload-file\";\n\nexport const zeroFeishuCommand = new Command()\n .name(\"feishu\")\n .description(\"Send messages and transfer files through Feishu\")\n .addCommand(zeroFeishuMessageCommand)\n .addCommand(downloadFileCommand)\n .addCommand(uploadFileCommand)\n .addHelpText(\n \"after\",\n `\nExamples:\n Send to a chat: zero feishu message send -c <chat-id> -t \"Hello!\"\n Send a DM: zero feishu message send -u <open-id> -t \"Hello!\"\n Reply in a thread: zero feishu message send -r <message-id> --thread -t \"Reply\"\n Upload a file: zero feishu upload-file -f /tmp/report.pdf -c <chat-id>\n Download a file: zero feishu download-file <message-id> <file-key> --type file`,\n );\n","import { tmpdir } from \"node:os\";\nimport { basename, join } from \"node:path\";\n\nimport { Command } from \"commander\";\nimport type { FeishuResourceType } from \"@vm0/api-contracts/contracts/integrations\";\n\nimport { downloadFeishuFile } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\n\nfunction defaultOutPath(fileKey: string): string {\n return join(tmpdir(), `feishu-${basename(fileKey).slice(0, 80)}`);\n}\n\nfunction parseResourceType(value: string): FeishuResourceType {\n if (value !== \"file\" && value !== \"image\") {\n throw new Error(\"--type must be either file or image\");\n }\n return value;\n}\n\nexport const downloadFileCommand = new Command()\n .name(\"download-file\")\n .description(\"Download a file from a Feishu message\")\n .argument(\"<message-id>\", \"Message ID from a [Feishu file] block\")\n .argument(\"<file-key>\", \"File key from a [Feishu file] block\")\n .requiredOption(\n \"--type <type>\",\n \"Resource type from the block: file or image\",\n )\n .option(\"-i, --installation <id>\", \"Feishu installation ID\")\n .option(\"-o, --out <path>\", \"Output path (default: /tmp/feishu-<file-key>)\")\n .addHelpText(\n \"after\",\n `\nExamples:\n Download a file: zero feishu download-file om_xxx file_xxx --type file\n Download an image: zero feishu download-file om_xxx img_xxx --type image -o /tmp/image.png\n Select an app: zero feishu download-file om_xxx file_xxx --type file -i <installation-id>\n\nOutput:\n Prints a JSON object to stdout on success:\n {\"path\":\"/tmp/feishu-file_xxx\",\"mimetype\":\"application/pdf\",\"size\":12345}\n\nNotes:\n - Use the message ID, file key, and type exactly as shown in a [Feishu file] block\n - Specify --installation when the organization has multiple Feishu bots\n - Streams the file bytes directly to disk`,\n )\n .action(\n withErrorHandler(\n async (\n messageId: string,\n fileKey: string,\n options: {\n readonly type: string;\n readonly installation?: string;\n readonly out?: string;\n },\n ) => {\n const outPath = options.out ?? defaultOutPath(fileKey);\n const result = await downloadFeishuFile(\n messageId,\n fileKey,\n parseResourceType(options.type),\n options.installation,\n outPath,\n );\n console.log(JSON.stringify(result));\n },\n ),\n );\n","import { Command } from \"commander\";\n\nimport { sendCommand } from \"./send\";\n\nexport const zeroFeishuMessageCommand = new Command()\n .name(\"message\")\n .description(\"Send Feishu messages\")\n .addCommand(sendCommand);\n","import { readFileSync } from \"node:fs\";\n\nimport chalk from \"chalk\";\nimport { Command } from \"commander\";\n\nimport { sendFeishuMessage } from \"../../../../lib/api\";\nimport { withErrorHandler } from \"../../../../lib/command\";\n\ninterface SendFeishuOptions {\n readonly installation?: string;\n readonly chat?: string;\n readonly user?: string;\n readonly reply?: string;\n readonly thread?: boolean;\n readonly text?: string;\n readonly card?: string;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return Boolean(value) && typeof value === \"object\" && !Array.isArray(value);\n}\n\nfunction parseCard(\n input: string | undefined,\n): Record<string, unknown> | undefined {\n if (!input) {\n return undefined;\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(input);\n } catch {\n throw new Error(\"Invalid JSON for --card flag\", {\n cause: new Error(\"Provide a valid Feishu card JSON object\"),\n });\n }\n if (!isRecord(parsed)) {\n throw new Error(\"Invalid JSON for --card\", {\n cause: new Error(\"Provide a Feishu card JSON object\"),\n });\n }\n return parsed;\n}\n\nexport const sendCommand = new Command()\n .name(\"send\")\n .description(\"Send a message to a Feishu chat or user\")\n .option(\"-i, --installation <id>\", \"Feishu installation ID\")\n .option(\"-c, --chat <id>\", \"Feishu chat ID\")\n .option(\"-u, --user <open-id>\", 'Feishu user open ID (use \"me\" for yourself)')\n .option(\"-r, --reply <message-id>\", \"Message ID to reply to\")\n .option(\"--thread\", \"Reply in a Feishu thread\")\n .option(\"-t, --text <message>\", \"Message text\")\n .option(\"--card <json>\", \"Feishu interactive card JSON\")\n .addHelpText(\n \"after\",\n `\nExamples:\n Chat message: zero feishu message send -c oc_xxx -t \"Hello!\"\n Direct message: zero feishu message send -u ou_xxx -t \"Hello!\"\n DM yourself: zero feishu message send -u me -t \"Hello!\"\n Thread reply: zero feishu message send -r om_xxx --thread -t \"Reply\"\n Interactive card: zero feishu message send -c oc_xxx --card '{\"schema\":\"2.0\",\"body\":{\"elements\":[]}}'\n Select a custom app: zero feishu message send -i <installation-id> -c oc_xxx -t \"Hello!\"\n\nNotes:\n - Exactly one of --chat, --user, or --reply is required\n - Exactly one of --text or --card is required\n - --installation is required when the organization has multiple Feishu bots`,\n )\n .action(\n withErrorHandler(async (options: SendFeishuOptions) => {\n const targets = [options.chat, options.user, options.reply].filter(\n Boolean,\n );\n if (targets.length !== 1) {\n throw new Error(\n \"Exactly one of --chat, --user, or --reply must be provided\",\n );\n }\n if (options.thread && !options.reply) {\n throw new Error(\"--thread requires --reply\");\n }\n\n let text = options.text;\n if (!text && !options.card && !process.stdin.isTTY) {\n try {\n text = readFileSync(\"/dev/stdin\", \"utf8\").trim();\n } catch {\n // stdin is not readable; fall through to normal input validation.\n }\n }\n const card = parseCard(options.card);\n if (Boolean(text) === Boolean(card)) {\n throw new Error(\"Exactly one of --text or --card must be provided\");\n }\n\n const result = await sendFeishuMessage({\n installationId: options.installation,\n chat: options.chat,\n user: options.user,\n replyToMessageId: options.reply,\n replyInThread: options.thread,\n text,\n card,\n });\n console.log(chalk.green(`✓ Message sent (message: ${result.messageId})`));\n }),\n );\n","import { readFileSync, statSync } from \"node:fs\";\nimport { basename, extname } from \"node:path\";\n\nimport { Command } from \"commander\";\nimport { FEISHU_FILE_UPLOAD_MAX_BYTES } from \"@vm0/api-contracts/contracts/integrations\";\n\nimport {\n completeFeishuFileUpload,\n initFeishuFileUpload,\n} from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\n\nconst MIME_BY_EXTENSION: Readonly<Record<string, string>> = {\n \".csv\": \"text/csv\",\n \".gif\": \"image/gif\",\n \".jpeg\": \"image/jpeg\",\n \".jpg\": \"image/jpeg\",\n \".json\": \"application/json\",\n \".md\": \"text/markdown\",\n \".mov\": \"video/quicktime\",\n \".mp4\": \"video/mp4\",\n \".pdf\": \"application/pdf\",\n \".png\": \"image/png\",\n \".svg\": \"image/svg+xml\",\n \".txt\": \"text/plain\",\n \".webm\": \"video/webm\",\n \".webp\": \"image/webp\",\n};\n\ninterface UploadFeishuOptions {\n readonly file: string;\n readonly installation?: string;\n readonly chat?: string;\n readonly user?: string;\n readonly reply?: string;\n readonly thread?: boolean;\n readonly contentType?: string;\n}\n\nfunction inferContentType(localPath: string): string {\n return (\n MIME_BY_EXTENSION[extname(localPath).toLowerCase()] ??\n \"application/octet-stream\"\n );\n}\n\nexport const uploadFileCommand = new Command()\n .name(\"upload-file\")\n .description(\"Upload a local file to Feishu as an organization bot\")\n .requiredOption(\"-f, --file <path>\", \"Local file path to upload\")\n .option(\"-i, --installation <id>\", \"Feishu installation ID\")\n .option(\"-c, --chat <id>\", \"Feishu chat ID\")\n .option(\"-u, --user <open-id>\", 'Feishu user open ID (use \"me\" for yourself)')\n .option(\"-r, --reply <message-id>\", \"Message ID to reply to\")\n .option(\"--thread\", \"Reply in a Feishu thread\")\n .option(\"--content-type <mime>\", \"Override inferred content type\")\n .addHelpText(\n \"after\",\n `\nExamples:\n Upload to a chat: zero feishu upload-file -f /tmp/report.pdf -c oc_xxx\n Send a DM: zero feishu upload-file -f /tmp/report.pdf -u ou_xxx\n Reply with a file: zero feishu upload-file -f /tmp/report.pdf -r om_xxx --thread\n Select a custom app: zero feishu upload-file -f /tmp/report.pdf -i <installation-id> -c oc_xxx\n\nOutput:\n Prints a JSON object to stdout on success:\n {\"messageId\":\"om_xxx\",\"chatId\":\"oc_xxx\",\"fileKey\":\"file_xxx\",\"filename\":\"report.pdf\",\"mimetype\":\"application/pdf\",\"size\":12345,\"url\":\"https://...\"}\n\nNotes:\n - Exactly one of --chat, --user, or --reply is required\n - Feishu accepts non-empty files up to 30 MB\n - Specify --installation when the organization has multiple Feishu bots`,\n )\n .action(\n withErrorHandler(async (options: UploadFeishuOptions) => {\n const targets = [options.chat, options.user, options.reply].filter(\n Boolean,\n );\n if (targets.length !== 1) {\n throw new Error(\n \"Exactly one of --chat, --user, or --reply must be provided\",\n );\n }\n if (options.thread && !options.reply) {\n throw new Error(\"--thread requires --reply\");\n }\n\n let fileSize: number;\n try {\n const stat = statSync(options.file);\n if (!stat.isFile()) {\n throw new Error(`Not a regular file: ${options.file}`);\n }\n fileSize = stat.size;\n } catch (error) {\n if (error instanceof Error && error.message.startsWith(\"Not \")) {\n throw error;\n }\n throw new Error(`File not found: ${options.file}`);\n }\n if (fileSize === 0) {\n throw new Error(\"File is empty\");\n }\n if (fileSize > FEISHU_FILE_UPLOAD_MAX_BYTES) {\n throw new Error(\n `File exceeds Feishu's ${FEISHU_FILE_UPLOAD_MAX_BYTES}-byte limit`,\n );\n }\n\n const filename = basename(options.file);\n const contentType = options.contentType ?? inferContentType(options.file);\n const prepared = await initFeishuFileUpload({\n filename,\n contentType,\n length: fileSize,\n });\n const uploadResponse = await fetch(prepared.uploadUrl, {\n method: \"PUT\",\n headers: { \"Content-Type\": prepared.contentType },\n body: new Uint8Array(readFileSync(options.file)),\n });\n if (!uploadResponse.ok) {\n throw new Error(\n `File upload failed: ${uploadResponse.status} ${uploadResponse.statusText}`,\n );\n }\n\n const result = await completeFeishuFileUpload({\n uploadId: prepared.uploadId,\n installationId: options.installation,\n chat: options.chat,\n user: options.user,\n replyToMessageId: options.reply,\n replyInThread: options.thread,\n contentType: prepared.contentType,\n });\n console.log(JSON.stringify(result));\n }),\n );\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;ACAA;AAAA,SAAS,cAAc;AACvB,SAAS,UAAU,YAAY;AAQ/B,SAAS,eAAe,SAAyB;AAC/C,SAAO,KAAK,OAAO,GAAG,UAAU,SAAS,OAAO,EAAE,MAAM,GAAG,EAAE,CAAC,EAAE;AAClE;AAEA,SAAS,kBAAkB,OAAmC;AAC5D,MAAI,UAAU,UAAU,UAAU,SAAS;AACzC,UAAM,IAAI,MAAM,qCAAqC;AAAA,EACvD;AACA,SAAO;AACT;AAEO,IAAM,sBAAsB,IAAI,QAAQ,EAC5C,KAAK,eAAe,EACpB,YAAY,uCAAuC,EACnD,SAAS,gBAAgB,uCAAuC,EAChE,SAAS,cAAc,qCAAqC,EAC5D;AAAA,EACC;AAAA,EACA;AACF,EACC,OAAO,2BAA2B,wBAAwB,EAC1D,OAAO,oBAAoB,+CAA+C,EAC1E;AAAA,EACC;AAAA,EAC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names":["readFileSync","basename","basename","readFileSync"]}
|
|
@@ -14,14 +14,14 @@ import {
|
|
|
14
14
|
zeroFinanceQuoteRequestSchema,
|
|
15
15
|
zeroFinanceRangeSchema,
|
|
16
16
|
zeroFinanceSearchRequestSchema
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-QL2BWE6J.js";
|
|
18
|
+
import "./chunk-BSDS7GCS.js";
|
|
19
19
|
import "./chunk-SB7EZ2ZO.js";
|
|
20
20
|
import {
|
|
21
21
|
source_default,
|
|
22
22
|
withErrorHandler
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-
|
|
23
|
+
} from "./chunk-E2DKMMGY.js";
|
|
24
|
+
import "./chunk-DK3C2ME6.js";
|
|
25
25
|
import {
|
|
26
26
|
Command,
|
|
27
27
|
InvalidArgumentError,
|
|
@@ -125,4 +125,4 @@ Notes:
|
|
|
125
125
|
export {
|
|
126
126
|
zeroFinanceCommand
|
|
127
127
|
};
|
|
128
|
-
//# sourceMappingURL=finance-
|
|
128
|
+
//# sourceMappingURL=finance-HP4WFZUY.js.map
|
|
@@ -21,31 +21,31 @@ import {
|
|
|
21
21
|
import {
|
|
22
22
|
currentPlanAllowsVideo,
|
|
23
23
|
currentTokenCanReadBilling
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-CUAL7MH6.js";
|
|
25
25
|
import {
|
|
26
26
|
getZeroAgentUserConnectors,
|
|
27
27
|
getZeroBillingStatus,
|
|
28
28
|
listZeroConnectorCatalog,
|
|
29
29
|
listZeroConnectorCatalogStatus
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-QL2BWE6J.js";
|
|
31
31
|
import {
|
|
32
32
|
generateWebImage,
|
|
33
33
|
generateWebVideo,
|
|
34
34
|
generateWebVoice
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-BSDS7GCS.js";
|
|
36
36
|
import {
|
|
37
37
|
planUpgradeUrl
|
|
38
38
|
} from "./chunk-W75R7EZF.js";
|
|
39
39
|
import {
|
|
40
40
|
getPlatformOrigin
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-RGHA7C2O.js";
|
|
42
42
|
import "./chunk-SB7EZ2ZO.js";
|
|
43
43
|
import {
|
|
44
44
|
ApiRequestError,
|
|
45
45
|
source_default,
|
|
46
46
|
withErrorHandler
|
|
47
|
-
} from "./chunk-
|
|
48
|
-
import "./chunk-
|
|
47
|
+
} from "./chunk-E2DKMMGY.js";
|
|
48
|
+
import "./chunk-DK3C2ME6.js";
|
|
49
49
|
import {
|
|
50
50
|
Command,
|
|
51
51
|
InvalidArgumentError,
|
|
@@ -2751,4 +2751,4 @@ var generateCommand = new Command().name("generate").description(
|
|
|
2751
2751
|
export {
|
|
2752
2752
|
generateCommand
|
|
2753
2753
|
};
|
|
2754
|
-
//# sourceMappingURL=generate-
|
|
2754
|
+
//# sourceMappingURL=generate-PTBOIM6B.js.map
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
completeGithubFileUpload,
|
|
6
6
|
downloadGithubFile,
|
|
7
7
|
initGithubFileUpload
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-QL2BWE6J.js";
|
|
9
|
+
import "./chunk-BSDS7GCS.js";
|
|
10
10
|
import "./chunk-SB7EZ2ZO.js";
|
|
11
11
|
import {
|
|
12
12
|
withErrorHandler
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-E2DKMMGY.js";
|
|
14
|
+
import "./chunk-DK3C2ME6.js";
|
|
15
15
|
import {
|
|
16
16
|
Command
|
|
17
17
|
} from "./chunk-LD4ZVU4O.js";
|
|
@@ -201,4 +201,4 @@ Examples:
|
|
|
201
201
|
export {
|
|
202
202
|
zeroGithubCommand
|
|
203
203
|
};
|
|
204
|
-
//# sourceMappingURL=github-
|
|
204
|
+
//# sourceMappingURL=github-62XSFEWF.js.map
|
|
@@ -10,13 +10,13 @@ import {
|
|
|
10
10
|
getGoal,
|
|
11
11
|
pauseGoal,
|
|
12
12
|
resumeGoal
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-QL2BWE6J.js";
|
|
14
|
+
import "./chunk-BSDS7GCS.js";
|
|
15
15
|
import "./chunk-SB7EZ2ZO.js";
|
|
16
16
|
import {
|
|
17
17
|
withErrorHandler
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-E2DKMMGY.js";
|
|
19
|
+
import "./chunk-DK3C2ME6.js";
|
|
20
20
|
import {
|
|
21
21
|
Command
|
|
22
22
|
} from "./chunk-LD4ZVU4O.js";
|
|
@@ -78,4 +78,4 @@ var zeroGoalCommand = new Command().name("goal").description("Manage the current
|
|
|
78
78
|
export {
|
|
79
79
|
zeroGoalCommand
|
|
80
80
|
};
|
|
81
|
-
//# sourceMappingURL=goal-
|
|
81
|
+
//# sourceMappingURL=goal-VRWB2AS3.js.map
|