@tool-bridge/server 0.20.0 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{airtable-ZNWHIJMO.js → airtable-LLZDFN7M.js} +19 -16
- package/dist/{alt_text_generator_ai-X7RMDDM5.js → alt_text_generator_ai-W7O34SNG.js} +4 -4
- package/dist/{amap-3VER75VH.js → amap-VOX4T2AW.js} +4 -4
- package/dist/{anthropic-N7NTB3UC.js → anthropic-G23NN3X5.js} +23 -25
- package/dist/{apify-JB5P5AJI.js → apify-Y3SS734K.js} +20 -19
- package/dist/{brave_search-USL5OOBS.js → brave_search-ZC7OAPSZ.js} +16 -14
- package/dist/{chunk-6ANLYNFB.js → chunk-ATK45BXV.js} +1 -1
- package/dist/{chunk-6X55ALDX.js → chunk-E6JCVKW6.js} +6 -5
- package/dist/{chunk-RVUERWUZ.js → chunk-KMTT3I6D.js} +768 -1048
- package/dist/chunk-R6P4XAE5.js +248 -0
- package/dist/{chunk-3WL6EXYX.js → chunk-U7B6DS2O.js} +1 -1
- package/dist/{chunk-WIGQCP6O.js → chunk-UZM2RXZH.js} +159 -182
- package/dist/chunk-XYBU3WZH.js +71 -0
- package/dist/{circleci-LBGB25LP.js → circleci-3BAX5FCG.js} +20 -24
- package/dist/{clerk-6RX37CNZ.js → clerk-6LEM6TNU.js} +22 -21
- package/dist/{cloudflare_dns-NQGW7FHV.js → cloudflare_dns-KINYTJUD.js} +21 -17
- package/dist/{cohere-XPC2NAEW.js → cohere-XCJ5AJ6B.js} +19 -17
- package/dist/{confluence-ZUG2LT5A.js → confluence-B3EWPZVE.js} +16 -11
- package/dist/{convertapi-ZLXKWV3L.js → convertapi-EUWSQYPF.js} +3 -3
- package/dist/{currencyapi-T3A3HSOD.js → currencyapi-KVTIK3GL.js} +23 -26
- package/dist/{deepseek-NJMOD23E.js → deepseek-PC5YGNC5.js} +27 -17
- package/dist/{docker_hub-D2MQCSJ7.js → docker_hub-C3MA5FU6.js} +4 -4
- package/dist/{dropbox-MI6U3SOT.js → dropbox-XBV7Z2IR.js} +9 -8
- package/dist/{dub-P2BYBYV4.js → dub-LDOFG3HC.js} +22 -19
- package/dist/{e2b-BGKIAE54.js → e2b-JMCPSVBW.js} +20 -20
- package/dist/{exa-EUY7VV4C.js → exa-RAK7O7RD.js} +22 -25
- package/dist/{fal_ai-AAOG5FYJ.js → fal_ai-23E7JPNT.js} +18 -17
- package/dist/feishu-7QRIDUV6.js +12019 -0
- package/dist/{feishu_custom_bot-BWGMNVXF.js → feishu_custom_bot-TJ4K7QNJ.js} +3 -3
- package/dist/{figma-SJSWYCGD.js → figma-E6IX5DTH.js} +21 -23
- package/dist/{firehydrant-MOXK2PST.js → firehydrant-ZBLPQREE.js} +15 -15
- package/dist/{fixer-ISIDUDZU.js → fixer-BWON27UO.js} +4 -4
- package/dist/{fly-U4KPSGBF.js → fly-ZH3HFCZJ.js} +20 -16
- package/dist/{front-ZHM2YX2E.js → front-QCGXYEDJ.js} +20 -23
- package/dist/{geocodio-SVCCAXAV.js → geocodio-YGNI7DA4.js} +4 -4
- package/dist/{ghost-INTR7FIY.js → ghost-EVSGKH2Q.js} +4 -4
- package/dist/{github-T275VVWR.js → github-MA2BGRCJ.js} +28 -27
- package/dist/{gmail-KSSPOE67.js → gmail-E5E6AADE.js} +17 -17
- package/dist/{googlecalendar-JB5RW27L.js → googlecalendar-BTLFPXTD.js} +22 -19
- package/dist/{googledocs-G522PUGW.js → googledocs-BUHL4J2H.js} +6 -5
- package/dist/{grafana-44ZPIV5P.js → grafana-GLU2DWF2.js} +24 -25
- package/dist/{graphhopper-2MORXLOW.js → graphhopper-WSMB3TCD.js} +4 -4
- package/dist/index.d.ts +31 -30
- package/dist/index.js +4 -3
- package/dist/{ip2proxy-R4K4KEMI.js → ip2proxy-EZ64Y4ZH.js} +4 -4
- package/dist/{ipgeolocation_io-H4J55OGI.js → ipgeolocation_io-AA7HAS22.js} +4 -4
- package/dist/{ipqualityscore-XGID4OHA.js → ipqualityscore-BHJXVTJT.js} +4 -4
- package/dist/{jina_ai-7ZVDOR3Z.js → jina_ai-EFBHTBXL.js} +20 -21
- package/dist/{jira-CTIYZTT3.js → jira-HQSHAA5K.js} +20 -16
- package/dist/{langsmith-ISP567FS.js → langsmith-5W6SCT6F.js} +25 -25
- package/dist/{lemlist-OGKK272F.js → lemlist-HJWH6UMK.js} +23 -24
- package/dist/{linear-6JX4E3JI.js → linear-K7RYFYAD.js} +6 -5
- package/dist/{logsnag-BVB36ZCL.js → logsnag-4KFOHL37.js} +20 -22
- package/dist/main.js +103 -102
- package/dist/{mattermost-UECVPZGY.js → mattermost-S2BRCWLQ.js} +21 -17
- package/dist/{mem0-EUA7S2OO.js → mem0-CAW43CIC.js} +15 -15
- package/dist/{memos-BYSBJRWZ.js → memos-TWEGPKFM.js} +39 -34
- package/dist/{metabase-4JXZH3YG.js → metabase-MMSEPCOF.js} +22 -18
- package/dist/{mistral_ai-2C5BTBKW.js → mistral_ai-64BGZQHP.js} +24 -21
- package/dist/{mother_duck-ZGNNNR3X.js → mother_duck-H7PCQNZ2.js} +23 -19
- package/dist/{ngrok-NTPGMRXI.js → ngrok-GQCUGZKJ.js} +17 -22
- package/dist/{notes-KGYXX6N6.js → notes-PFMKRO33.js} +1 -1
- package/dist/{notion-EX3X2G7G.js → notion-DQWZWP4N.js} +20 -17
- package/dist/{open_exchange_rates-2V2LIGPS.js → open_exchange_rates-QMMD735E.js} +4 -4
- package/dist/{openai-KQFQPK7Z.js → openai-W6PX32NZ.js} +22 -16
- package/dist/{opengraph_io-B63SEYJY.js → opengraph_io-HNDBXYNW.js} +4 -4
- package/dist/{openrouter-62A4H62Q.js → openrouter-JJYMEAUL.js} +19 -14
- package/dist/{outline-QC33XLCK.js → outline-MCBNQZYY.js} +18 -20
- package/dist/{paddle-HDZG35Y7.js → paddle-D2SKLUDN.js} +17 -15
- package/dist/{perplexity-M7LOMJWA.js → perplexity-XIFMKUAE.js} +19 -23
- package/dist/{pinecone-Y7YCJRZM.js → pinecone-HUFTALV2.js} +19 -24
- package/dist/{pipedrive-FLJA62UX.js → pipedrive-Y2O7QGFF.js} +22 -23
- package/dist/{polar-AE55Q425.js → polar-TYTOMOSR.js} +19 -17
- package/dist/{posthog-IAY5D3YW.js → posthog-43JAR3VW.js} +29 -24
- package/dist/{postmark-NMKAXDXZ.js → postmark-KL2QJYSG.js} +19 -17
- package/dist/{prerender-CDJM7I7N.js → prerender-MENYM2TY.js} +4 -4
- package/dist/{pubmed-N437ZJOR.js → pubmed-GOXUVVH5.js} +6 -5
- package/dist/{railway-NBWYXCUM.js → railway-V2SID4WV.js} +3 -3
- package/dist/{readwise-QRO3UC3R.js → readwise-CI4GIMMJ.js} +16 -15
- package/dist/{render-NEW7SROG.js → render-SUBJ6YRZ.js} +21 -20
- package/dist/{replicate-73YQLRTY.js → replicate-756MXPYX.js} +20 -21
- package/dist/{resend-R5BAZFHZ.js → resend-ZKH3BTBI.js} +15 -11
- package/dist/{rootly-5BLALPCS.js → rootly-CD2LJHPI.js} +19 -18
- package/dist/{scrapfly-EHFLNNUZ.js → scrapfly-NSRHFDIQ.js} +4 -4
- package/dist/{scrapingbee-UXLYS72S.js → scrapingbee-OQHLAVEY.js} +4 -4
- package/dist/{screenshot_fyi-KC3NLTJ6.js → screenshot_fyi-DVWG3AXC.js} +4 -4
- package/dist/{semantic_scholar-SA5OIUWA.js → semantic_scholar-T4A252KW.js} +21 -20
- package/dist/{sentry-BAE3XLJN.js → sentry-546MNDJG.js} +22 -19
- package/dist/{shodan-FJR6MKKW.js → shodan-C3OON3Z3.js} +4 -4
- package/dist/{shopify-7OA6SLN5.js → shopify-Y2HN2MCQ.js} +23 -19
- package/dist/{stripe-MUWDZGGF.js → stripe-VE3CD3AY.js} +3 -3
- package/dist/{supabase-SWWGNWYR.js → supabase-U2SL4D63.js} +18 -17
- package/dist/{tavily-XQNJ5EDI.js → tavily-KCZHK6HE.js} +20 -20
- package/dist/{telegram-RR6JPZOG.js → telegram-3URFBCMY.js} +4 -4
- package/dist/{telnyx-7PKXOWSO.js → telnyx-CXQ4EZUX.js} +19 -19
- package/dist/{todoist-63X5IUJE.js → todoist-HNPWNYTD.js} +18 -17
- package/dist/{trello-MOG63DAI.js → trello-3W2MIXRP.js} +4 -4
- package/dist/{turso-ENWTSHDL.js → turso-2EQF7C2Z.js} +23 -30
- package/dist/{twilio-FDXUN7VX.js → twilio-4PDBJKWX.js} +6 -5
- package/dist/{umami-TM7PROWF.js → umami-5REN7TGP.js} +23 -28
- package/dist/{unsplash-NWXLKSOW.js → unsplash-EIXL424F.js} +19 -18
- package/dist/{upstash_redis-CUTQ5L2N.js → upstash_redis-G4LQBYHA.js} +17 -13
- package/dist/{uptimerobot-NNO32M3I.js → uptimerobot-KNJ3EYLY.js} +3 -3
- package/dist/{v2ex-24KMSWS7.js → v2ex-RHJ234PZ.js} +35 -18
- package/dist/{vercel-B45LPF6I.js → vercel-AS6NCIC7.js} +21 -18
- package/dist/{wolfram_alpha_api-DKJWVR6G.js → wolfram_alpha_api-3G4PUJWB.js} +4 -4
- package/dist/{wordpress-XYFSDZXY.js → wordpress-KNDAAUV7.js} +21 -17
- package/dist/{workos-BEM7EPHM.js → workos-R6UITSJ7.js} +26 -27
- package/dist/{zhihu-CFHZ4NC7.js → zhihu-AGK4HILK.js} +21 -21
- package/package.json +5 -5
- package/dist/feishu-AN5IJYOW.js +0 -231
|
@@ -7,14 +7,15 @@ import {
|
|
|
7
7
|
createProviderPlugin,
|
|
8
8
|
requireApiKey,
|
|
9
9
|
upstreamError
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ATK45BXV.js";
|
|
11
11
|
import {
|
|
12
12
|
guardedFetch
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-U7B6DS2O.js";
|
|
14
14
|
import {
|
|
15
15
|
TBError,
|
|
16
|
-
external_exports
|
|
17
|
-
|
|
16
|
+
external_exports,
|
|
17
|
+
isTBError
|
|
18
|
+
} from "./chunk-UZM2RXZH.js";
|
|
18
19
|
import "./chunk-U67V476Y.js";
|
|
19
20
|
|
|
20
21
|
// ../plugins/src/linear/api.ts
|
|
@@ -314,7 +315,7 @@ async function graphqlRequest(ctx, query, variables) {
|
|
|
314
315
|
});
|
|
315
316
|
body = await readJson(response);
|
|
316
317
|
} catch (error) {
|
|
317
|
-
if (error
|
|
318
|
+
if (isTBError(error)) throw error;
|
|
318
319
|
throw upstreamError(502, error instanceof Error ? `linear \u8BF7\u6C42\u5931\u8D25: ${error.message}` : "linear \u8BF7\u6C42\u5931\u8D25");
|
|
319
320
|
}
|
|
320
321
|
if (!response.ok) throw upstreamError(response.status, extractErrorMessage(body));
|
|
@@ -1,38 +1,36 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
createAuthedClient
|
|
3
|
+
} from "./chunk-XYBU3WZH.js";
|
|
4
|
+
import "./chunk-E6JCVKW6.js";
|
|
5
|
+
import "./chunk-JXHMDBAY.js";
|
|
4
6
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import
|
|
8
|
-
createProviderPlugin,
|
|
9
|
-
requireApiKey,
|
|
10
|
-
upstreamError
|
|
11
|
-
} from "./chunk-6ANLYNFB.js";
|
|
12
|
-
import "./chunk-3WL6EXYX.js";
|
|
7
|
+
createProviderPlugin
|
|
8
|
+
} from "./chunk-ATK45BXV.js";
|
|
9
|
+
import "./chunk-U7B6DS2O.js";
|
|
13
10
|
import {
|
|
14
11
|
external_exports
|
|
15
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-UZM2RXZH.js";
|
|
16
13
|
import "./chunk-U67V476Y.js";
|
|
17
14
|
|
|
18
15
|
// ../plugins/src/logsnag/api.ts
|
|
19
16
|
var SERVICE = "logsnag";
|
|
20
|
-
var http =
|
|
17
|
+
var http = createAuthedClient({
|
|
18
|
+
baseUrl: "https://api.logsnag.com/v1/",
|
|
19
|
+
service: SERVICE,
|
|
20
|
+
auth: { kind: "bearer" },
|
|
21
|
+
headers: { accept: "application/json" },
|
|
22
|
+
errorMessage: {
|
|
23
|
+
keys: ["message", "error", "detail"],
|
|
24
|
+
fallback: (status) => `LogSnag request failed with ${status}`
|
|
25
|
+
}
|
|
26
|
+
});
|
|
21
27
|
async function request(path, method, body, ctx) {
|
|
22
|
-
const result = await http.request({
|
|
28
|
+
const result = await http.request(ctx, {
|
|
23
29
|
path,
|
|
24
30
|
method,
|
|
25
|
-
headers: {
|
|
26
|
-
accept: "application/json",
|
|
27
|
-
authorization: `Bearer ${requireApiKey(ctx, SERVICE)}`
|
|
28
|
-
},
|
|
29
31
|
json: body,
|
|
30
32
|
responseType: "auto",
|
|
31
|
-
invalidJson: "text"
|
|
32
|
-
mapError: ({ data, status }) => upstreamError(
|
|
33
|
-
status,
|
|
34
|
-
messageFrom(data, ["message", "error", "detail"], `LogSnag request failed with ${status}`)
|
|
35
|
-
)
|
|
33
|
+
invalidJson: "text"
|
|
36
34
|
});
|
|
37
35
|
return {
|
|
38
36
|
ok: true,
|
package/dist/main.js
CHANGED
|
@@ -2,112 +2,113 @@
|
|
|
2
2
|
import {
|
|
3
3
|
configFromEnv,
|
|
4
4
|
createTbServer
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-KMTT3I6D.js";
|
|
6
|
+
import "./chunk-R6P4XAE5.js";
|
|
7
|
+
import "./chunk-U7B6DS2O.js";
|
|
8
|
+
import "./chunk-UZM2RXZH.js";
|
|
8
9
|
import "./chunk-U67V476Y.js";
|
|
9
10
|
|
|
10
11
|
// ../plugins/src/registry.generated.ts
|
|
11
12
|
var BUILTIN_PLUGIN_LOADERS = {
|
|
12
|
-
airtable: () => import("./airtable-
|
|
13
|
-
alt_text_generator_ai: () => import("./alt_text_generator_ai-
|
|
14
|
-
amap: () => import("./amap-
|
|
15
|
-
anthropic: () => import("./anthropic-
|
|
16
|
-
apify: () => import("./apify-
|
|
17
|
-
brave_search: () => import("./brave_search-
|
|
18
|
-
circleci: () => import("./circleci-
|
|
19
|
-
clerk: () => import("./clerk-
|
|
20
|
-
cloudflare_dns: () => import("./cloudflare_dns-
|
|
21
|
-
cohere: () => import("./cohere-
|
|
22
|
-
confluence: () => import("./confluence-
|
|
23
|
-
convertapi: () => import("./convertapi-
|
|
24
|
-
currencyapi: () => import("./currencyapi-
|
|
25
|
-
deepseek: () => import("./deepseek-
|
|
26
|
-
docker_hub: () => import("./docker_hub-
|
|
27
|
-
dropbox: () => import("./dropbox-
|
|
28
|
-
dub: () => import("./dub-
|
|
29
|
-
e2b: () => import("./e2b-
|
|
30
|
-
exa: () => import("./exa-
|
|
31
|
-
fal_ai: () => import("./fal_ai-
|
|
32
|
-
feishu: () => import("./feishu-
|
|
33
|
-
feishu_custom_bot: () => import("./feishu_custom_bot-
|
|
34
|
-
figma: () => import("./figma-
|
|
35
|
-
firehydrant: () => import("./firehydrant-
|
|
36
|
-
fixer: () => import("./fixer-
|
|
37
|
-
fly: () => import("./fly-
|
|
38
|
-
front: () => import("./front-
|
|
39
|
-
geocodio: () => import("./geocodio-
|
|
40
|
-
ghost: () => import("./ghost-
|
|
41
|
-
github: () => import("./github-
|
|
42
|
-
gmail: () => import("./gmail-
|
|
43
|
-
googlecalendar: () => import("./googlecalendar-
|
|
44
|
-
googledocs: () => import("./googledocs-
|
|
45
|
-
grafana: () => import("./grafana-
|
|
46
|
-
graphhopper: () => import("./graphhopper-
|
|
47
|
-
ip2proxy: () => import("./ip2proxy-
|
|
48
|
-
ipgeolocation_io: () => import("./ipgeolocation_io-
|
|
49
|
-
ipqualityscore: () => import("./ipqualityscore-
|
|
50
|
-
jina_ai: () => import("./jina_ai-
|
|
51
|
-
jira: () => import("./jira-
|
|
52
|
-
langsmith: () => import("./langsmith-
|
|
53
|
-
lemlist: () => import("./lemlist-
|
|
54
|
-
linear: () => import("./linear-
|
|
55
|
-
logsnag: () => import("./logsnag-
|
|
56
|
-
mattermost: () => import("./mattermost-
|
|
57
|
-
mem0: () => import("./mem0-
|
|
58
|
-
memos: () => import("./memos-
|
|
59
|
-
metabase: () => import("./metabase-
|
|
60
|
-
mistral_ai: () => import("./mistral_ai-
|
|
61
|
-
mother_duck: () => import("./mother_duck-
|
|
62
|
-
ngrok: () => import("./ngrok-
|
|
63
|
-
notes: () => import("./notes-
|
|
64
|
-
notion: () => import("./notion-
|
|
65
|
-
open_exchange_rates: () => import("./open_exchange_rates-
|
|
66
|
-
openai: () => import("./openai-
|
|
67
|
-
opengraph_io: () => import("./opengraph_io-
|
|
68
|
-
openrouter: () => import("./openrouter-
|
|
69
|
-
outline: () => import("./outline-
|
|
70
|
-
paddle: () => import("./paddle-
|
|
71
|
-
perplexity: () => import("./perplexity-
|
|
72
|
-
pinecone: () => import("./pinecone-
|
|
73
|
-
pipedrive: () => import("./pipedrive-
|
|
74
|
-
polar: () => import("./polar-
|
|
75
|
-
posthog: () => import("./posthog-
|
|
76
|
-
postmark: () => import("./postmark-
|
|
77
|
-
prerender: () => import("./prerender-
|
|
78
|
-
pubmed: () => import("./pubmed-
|
|
79
|
-
railway: () => import("./railway-
|
|
80
|
-
readwise: () => import("./readwise-
|
|
81
|
-
render: () => import("./render-
|
|
82
|
-
replicate: () => import("./replicate-
|
|
83
|
-
resend: () => import("./resend-
|
|
84
|
-
rootly: () => import("./rootly-
|
|
85
|
-
scrapfly: () => import("./scrapfly-
|
|
86
|
-
scrapingbee: () => import("./scrapingbee-
|
|
87
|
-
screenshot_fyi: () => import("./screenshot_fyi-
|
|
88
|
-
semantic_scholar: () => import("./semantic_scholar-
|
|
89
|
-
sentry: () => import("./sentry-
|
|
90
|
-
shodan: () => import("./shodan-
|
|
91
|
-
shopify: () => import("./shopify-
|
|
92
|
-
stripe: () => import("./stripe-
|
|
93
|
-
supabase: () => import("./supabase-
|
|
94
|
-
tavily: () => import("./tavily-
|
|
95
|
-
telegram: () => import("./telegram-
|
|
96
|
-
telnyx: () => import("./telnyx-
|
|
97
|
-
todoist: () => import("./todoist-
|
|
98
|
-
trello: () => import("./trello-
|
|
99
|
-
turso: () => import("./turso-
|
|
100
|
-
twilio: () => import("./twilio-
|
|
101
|
-
umami: () => import("./umami-
|
|
102
|
-
unsplash: () => import("./unsplash-
|
|
103
|
-
upstash_redis: () => import("./upstash_redis-
|
|
104
|
-
uptimerobot: () => import("./uptimerobot-
|
|
105
|
-
v2ex: () => import("./v2ex-
|
|
106
|
-
vercel: () => import("./vercel-
|
|
107
|
-
wolfram_alpha_api: () => import("./wolfram_alpha_api-
|
|
108
|
-
wordpress: () => import("./wordpress-
|
|
109
|
-
workos: () => import("./workos-
|
|
110
|
-
zhihu: () => import("./zhihu-
|
|
13
|
+
airtable: () => import("./airtable-LLZDFN7M.js"),
|
|
14
|
+
alt_text_generator_ai: () => import("./alt_text_generator_ai-W7O34SNG.js"),
|
|
15
|
+
amap: () => import("./amap-VOX4T2AW.js"),
|
|
16
|
+
anthropic: () => import("./anthropic-G23NN3X5.js"),
|
|
17
|
+
apify: () => import("./apify-Y3SS734K.js"),
|
|
18
|
+
brave_search: () => import("./brave_search-ZC7OAPSZ.js"),
|
|
19
|
+
circleci: () => import("./circleci-3BAX5FCG.js"),
|
|
20
|
+
clerk: () => import("./clerk-6LEM6TNU.js"),
|
|
21
|
+
cloudflare_dns: () => import("./cloudflare_dns-KINYTJUD.js"),
|
|
22
|
+
cohere: () => import("./cohere-XCJ5AJ6B.js"),
|
|
23
|
+
confluence: () => import("./confluence-B3EWPZVE.js"),
|
|
24
|
+
convertapi: () => import("./convertapi-EUWSQYPF.js"),
|
|
25
|
+
currencyapi: () => import("./currencyapi-KVTIK3GL.js"),
|
|
26
|
+
deepseek: () => import("./deepseek-PC5YGNC5.js"),
|
|
27
|
+
docker_hub: () => import("./docker_hub-C3MA5FU6.js"),
|
|
28
|
+
dropbox: () => import("./dropbox-XBV7Z2IR.js"),
|
|
29
|
+
dub: () => import("./dub-LDOFG3HC.js"),
|
|
30
|
+
e2b: () => import("./e2b-JMCPSVBW.js"),
|
|
31
|
+
exa: () => import("./exa-RAK7O7RD.js"),
|
|
32
|
+
fal_ai: () => import("./fal_ai-23E7JPNT.js"),
|
|
33
|
+
feishu: () => import("./feishu-7QRIDUV6.js"),
|
|
34
|
+
feishu_custom_bot: () => import("./feishu_custom_bot-TJ4K7QNJ.js"),
|
|
35
|
+
figma: () => import("./figma-E6IX5DTH.js"),
|
|
36
|
+
firehydrant: () => import("./firehydrant-ZBLPQREE.js"),
|
|
37
|
+
fixer: () => import("./fixer-BWON27UO.js"),
|
|
38
|
+
fly: () => import("./fly-ZH3HFCZJ.js"),
|
|
39
|
+
front: () => import("./front-QCGXYEDJ.js"),
|
|
40
|
+
geocodio: () => import("./geocodio-YGNI7DA4.js"),
|
|
41
|
+
ghost: () => import("./ghost-EVSGKH2Q.js"),
|
|
42
|
+
github: () => import("./github-MA2BGRCJ.js"),
|
|
43
|
+
gmail: () => import("./gmail-E5E6AADE.js"),
|
|
44
|
+
googlecalendar: () => import("./googlecalendar-BTLFPXTD.js"),
|
|
45
|
+
googledocs: () => import("./googledocs-BUHL4J2H.js"),
|
|
46
|
+
grafana: () => import("./grafana-GLU2DWF2.js"),
|
|
47
|
+
graphhopper: () => import("./graphhopper-WSMB3TCD.js"),
|
|
48
|
+
ip2proxy: () => import("./ip2proxy-EZ64Y4ZH.js"),
|
|
49
|
+
ipgeolocation_io: () => import("./ipgeolocation_io-AA7HAS22.js"),
|
|
50
|
+
ipqualityscore: () => import("./ipqualityscore-BHJXVTJT.js"),
|
|
51
|
+
jina_ai: () => import("./jina_ai-EFBHTBXL.js"),
|
|
52
|
+
jira: () => import("./jira-HQSHAA5K.js"),
|
|
53
|
+
langsmith: () => import("./langsmith-5W6SCT6F.js"),
|
|
54
|
+
lemlist: () => import("./lemlist-HJWH6UMK.js"),
|
|
55
|
+
linear: () => import("./linear-K7RYFYAD.js"),
|
|
56
|
+
logsnag: () => import("./logsnag-4KFOHL37.js"),
|
|
57
|
+
mattermost: () => import("./mattermost-S2BRCWLQ.js"),
|
|
58
|
+
mem0: () => import("./mem0-CAW43CIC.js"),
|
|
59
|
+
memos: () => import("./memos-TWEGPKFM.js"),
|
|
60
|
+
metabase: () => import("./metabase-MMSEPCOF.js"),
|
|
61
|
+
mistral_ai: () => import("./mistral_ai-64BGZQHP.js"),
|
|
62
|
+
mother_duck: () => import("./mother_duck-H7PCQNZ2.js"),
|
|
63
|
+
ngrok: () => import("./ngrok-GQCUGZKJ.js"),
|
|
64
|
+
notes: () => import("./notes-PFMKRO33.js"),
|
|
65
|
+
notion: () => import("./notion-DQWZWP4N.js"),
|
|
66
|
+
open_exchange_rates: () => import("./open_exchange_rates-QMMD735E.js"),
|
|
67
|
+
openai: () => import("./openai-W6PX32NZ.js"),
|
|
68
|
+
opengraph_io: () => import("./opengraph_io-HNDBXYNW.js"),
|
|
69
|
+
openrouter: () => import("./openrouter-JJYMEAUL.js"),
|
|
70
|
+
outline: () => import("./outline-MCBNQZYY.js"),
|
|
71
|
+
paddle: () => import("./paddle-D2SKLUDN.js"),
|
|
72
|
+
perplexity: () => import("./perplexity-XIFMKUAE.js"),
|
|
73
|
+
pinecone: () => import("./pinecone-HUFTALV2.js"),
|
|
74
|
+
pipedrive: () => import("./pipedrive-Y2O7QGFF.js"),
|
|
75
|
+
polar: () => import("./polar-TYTOMOSR.js"),
|
|
76
|
+
posthog: () => import("./posthog-43JAR3VW.js"),
|
|
77
|
+
postmark: () => import("./postmark-KL2QJYSG.js"),
|
|
78
|
+
prerender: () => import("./prerender-MENYM2TY.js"),
|
|
79
|
+
pubmed: () => import("./pubmed-GOXUVVH5.js"),
|
|
80
|
+
railway: () => import("./railway-V2SID4WV.js"),
|
|
81
|
+
readwise: () => import("./readwise-CI4GIMMJ.js"),
|
|
82
|
+
render: () => import("./render-SUBJ6YRZ.js"),
|
|
83
|
+
replicate: () => import("./replicate-756MXPYX.js"),
|
|
84
|
+
resend: () => import("./resend-ZKH3BTBI.js"),
|
|
85
|
+
rootly: () => import("./rootly-CD2LJHPI.js"),
|
|
86
|
+
scrapfly: () => import("./scrapfly-NSRHFDIQ.js"),
|
|
87
|
+
scrapingbee: () => import("./scrapingbee-OQHLAVEY.js"),
|
|
88
|
+
screenshot_fyi: () => import("./screenshot_fyi-DVWG3AXC.js"),
|
|
89
|
+
semantic_scholar: () => import("./semantic_scholar-T4A252KW.js"),
|
|
90
|
+
sentry: () => import("./sentry-546MNDJG.js"),
|
|
91
|
+
shodan: () => import("./shodan-C3OON3Z3.js"),
|
|
92
|
+
shopify: () => import("./shopify-Y2HN2MCQ.js"),
|
|
93
|
+
stripe: () => import("./stripe-VE3CD3AY.js"),
|
|
94
|
+
supabase: () => import("./supabase-U2SL4D63.js"),
|
|
95
|
+
tavily: () => import("./tavily-KCZHK6HE.js"),
|
|
96
|
+
telegram: () => import("./telegram-3URFBCMY.js"),
|
|
97
|
+
telnyx: () => import("./telnyx-CXQ4EZUX.js"),
|
|
98
|
+
todoist: () => import("./todoist-HNPWNYTD.js"),
|
|
99
|
+
trello: () => import("./trello-3W2MIXRP.js"),
|
|
100
|
+
turso: () => import("./turso-2EQF7C2Z.js"),
|
|
101
|
+
twilio: () => import("./twilio-4PDBJKWX.js"),
|
|
102
|
+
umami: () => import("./umami-5REN7TGP.js"),
|
|
103
|
+
unsplash: () => import("./unsplash-EIXL424F.js"),
|
|
104
|
+
upstash_redis: () => import("./upstash_redis-G4LQBYHA.js"),
|
|
105
|
+
uptimerobot: () => import("./uptimerobot-KNJ3EYLY.js"),
|
|
106
|
+
v2ex: () => import("./v2ex-RHJ234PZ.js"),
|
|
107
|
+
vercel: () => import("./vercel-AS6NCIC7.js"),
|
|
108
|
+
wolfram_alpha_api: () => import("./wolfram_alpha_api-3G4PUJWB.js"),
|
|
109
|
+
wordpress: () => import("./wordpress-KNDAAUV7.js"),
|
|
110
|
+
workos: () => import("./workos-R6UITSJ7.js"),
|
|
111
|
+
zhihu: () => import("./zhihu-AGK4HILK.js")
|
|
111
112
|
};
|
|
112
113
|
|
|
113
114
|
// ../plugins/src/catalog.generated.ts
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
createAuthedClient
|
|
3
|
+
} from "./chunk-XYBU3WZH.js";
|
|
4
|
+
import "./chunk-E6JCVKW6.js";
|
|
4
5
|
import {
|
|
5
6
|
asJsonObject,
|
|
6
7
|
trimmedText
|
|
@@ -9,21 +10,20 @@ import {
|
|
|
9
10
|
createProviderPlugin,
|
|
10
11
|
requireCredential,
|
|
11
12
|
upstreamError
|
|
12
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ATK45BXV.js";
|
|
13
14
|
import {
|
|
14
15
|
assertPublicHttpUrl
|
|
15
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-U7B6DS2O.js";
|
|
16
17
|
import {
|
|
17
18
|
TBError,
|
|
18
19
|
external_exports
|
|
19
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-UZM2RXZH.js";
|
|
20
21
|
import "./chunk-U67V476Y.js";
|
|
21
22
|
|
|
22
23
|
// ../plugins/src/mattermost/api.ts
|
|
23
24
|
var SERVICE = "mattermost";
|
|
24
25
|
var API_PATH_PREFIX = "/api/v4";
|
|
25
26
|
var REQUEST_TIMEOUT_MS = 3e4;
|
|
26
|
-
var http = createProviderHttpClient({ service: SERVICE });
|
|
27
27
|
var SINCE_CONFLICTING_FIELDS = ["page", "perPage", "beforePostId", "afterPostId"];
|
|
28
28
|
function invalidResponse(message) {
|
|
29
29
|
return new TBError("unavailable", message, { retryable: true });
|
|
@@ -72,24 +72,28 @@ function errorMessage(payload, status) {
|
|
|
72
72
|
const body = asJsonObject(payload);
|
|
73
73
|
return trimmedText(body?.message) ?? trimmedText(body?.error) ?? trimmedText(body?.details) ?? trimmedText(body?.id) ?? `Mattermost \u8FD4\u56DE HTTP ${status}`;
|
|
74
74
|
}
|
|
75
|
+
var http = createAuthedClient({
|
|
76
|
+
service: SERVICE,
|
|
77
|
+
auth: {
|
|
78
|
+
kind: "custom",
|
|
79
|
+
headers: (ctx) => ({ authorization: `Bearer ${requireCredential(ctx, SERVICE, "apiKey")}` })
|
|
80
|
+
},
|
|
81
|
+
headers: { accept: "application/json" },
|
|
82
|
+
mapError: ({ bodyKind, data, status }) => upstreamError(
|
|
83
|
+
status,
|
|
84
|
+
errorMessage(responsePayload(data, bodyKind), status)
|
|
85
|
+
),
|
|
86
|
+
mapTransportError: ({ kind, message }) => kind === "timeout" ? upstreamError(504, `Mattermost \u8BF7\u6C42\u8D85\u65F6(${REQUEST_TIMEOUT_MS / 1e3} \u79D2)`) : upstreamError(502, `Mattermost \u8BF7\u6C42\u5931\u8D25:${message ?? "unknown network error"}`)
|
|
87
|
+
});
|
|
75
88
|
async function request(ctx, input) {
|
|
76
|
-
const result = await http.request({
|
|
89
|
+
const result = await http.request(ctx, {
|
|
77
90
|
baseUrl: `${apiBaseUrl(ctx)}/`,
|
|
78
91
|
path: input.path,
|
|
79
92
|
method: input.method ?? "GET",
|
|
80
93
|
query: Object.entries(input.query ?? {}),
|
|
81
|
-
headers: {
|
|
82
|
-
accept: "application/json",
|
|
83
|
-
authorization: `Bearer ${requireCredential(ctx, SERVICE, "apiKey")}`
|
|
84
|
-
},
|
|
85
94
|
...input.body === void 0 ? {} : { json: input.body },
|
|
86
95
|
timeoutMs: REQUEST_TIMEOUT_MS,
|
|
87
|
-
invalidJsonMessage: "Mattermost \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94"
|
|
88
|
-
mapError: ({ bodyKind, data, status }) => upstreamError(
|
|
89
|
-
status,
|
|
90
|
-
errorMessage(responsePayload(data, bodyKind), status)
|
|
91
|
-
),
|
|
92
|
-
mapTransportError: ({ kind, message }) => kind === "timeout" ? upstreamError(504, `Mattermost \u8BF7\u6C42\u8D85\u65F6(${REQUEST_TIMEOUT_MS / 1e3} \u79D2)`) : upstreamError(502, `Mattermost \u8BF7\u6C42\u5931\u8D25:${message ?? "unknown network error"}`)
|
|
96
|
+
invalidJsonMessage: "Mattermost \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94"
|
|
93
97
|
});
|
|
94
98
|
return responsePayload(result.data, result.bodyKind);
|
|
95
99
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
createAuthedClient
|
|
3
|
+
} from "./chunk-XYBU3WZH.js";
|
|
4
|
+
import "./chunk-E6JCVKW6.js";
|
|
4
5
|
import {
|
|
5
6
|
asJsonObject,
|
|
6
7
|
compactDefined,
|
|
@@ -8,20 +9,18 @@ import {
|
|
|
8
9
|
} from "./chunk-JXHMDBAY.js";
|
|
9
10
|
import {
|
|
10
11
|
createProviderPlugin,
|
|
11
|
-
requireApiKey,
|
|
12
12
|
upstreamError
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-ATK45BXV.js";
|
|
14
|
+
import "./chunk-U7B6DS2O.js";
|
|
15
15
|
import {
|
|
16
16
|
TBError,
|
|
17
17
|
external_exports
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-UZM2RXZH.js";
|
|
19
19
|
import "./chunk-U67V476Y.js";
|
|
20
20
|
|
|
21
21
|
// ../plugins/src/mem0/api.ts
|
|
22
22
|
var SERVICE = "mem0";
|
|
23
23
|
var API_BASE = "https://api.mem0.ai";
|
|
24
|
-
var http = createProviderHttpClient({ baseUrl: `${API_BASE}/`, service: SERVICE });
|
|
25
24
|
function requireText(value, field) {
|
|
26
25
|
const result = trimmedText(value);
|
|
27
26
|
if (result === void 0) throw new TBError("invalid_argument", `${field} \u662F\u5FC5\u586B\u7684`);
|
|
@@ -41,19 +40,20 @@ function errorMessage(value, status) {
|
|
|
41
40
|
if (typeof payload.error === "string" && payload.error !== "") return payload.error;
|
|
42
41
|
return `Mem0 \u8FD4\u56DE HTTP ${status}`;
|
|
43
42
|
}
|
|
43
|
+
var http = createAuthedClient({
|
|
44
|
+
baseUrl: `${API_BASE}/`,
|
|
45
|
+
service: SERVICE,
|
|
46
|
+
auth: { kind: "token" },
|
|
47
|
+
headers: { accept: "application/json" },
|
|
48
|
+
mapError: ({ data, status }) => upstreamError(status, errorMessage(data, status))
|
|
49
|
+
});
|
|
44
50
|
function execute(ctx, input) {
|
|
45
|
-
return http.request({
|
|
51
|
+
return http.request(ctx, {
|
|
46
52
|
path: input.path,
|
|
47
53
|
method: input.method ?? "GET",
|
|
48
54
|
query: Object.entries(input.query ?? {}),
|
|
49
|
-
headers: {
|
|
50
|
-
accept: "application/json",
|
|
51
|
-
// Token 而非 Bearer —— Mem0 用的是 DRF 的 TokenAuthentication。
|
|
52
|
-
authorization: `Token ${requireApiKey(ctx, SERVICE)}`
|
|
53
|
-
},
|
|
54
55
|
...input.body === void 0 ? {} : { json: input.body },
|
|
55
|
-
invalidJson: "text"
|
|
56
|
-
mapError: ({ data, status }) => upstreamError(status, errorMessage(data, status))
|
|
56
|
+
invalidJson: "text"
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
async function request(ctx, input) {
|
|
@@ -3,8 +3,9 @@ import {
|
|
|
3
3
|
readBoundedResponseBytes
|
|
4
4
|
} from "./chunk-LMLX3DJF.js";
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
} from "./chunk-
|
|
6
|
+
createAuthedClient
|
|
7
|
+
} from "./chunk-XYBU3WZH.js";
|
|
8
|
+
import "./chunk-E6JCVKW6.js";
|
|
8
9
|
import {
|
|
9
10
|
asJsonObject,
|
|
10
11
|
compactDefined,
|
|
@@ -14,22 +15,32 @@ import {
|
|
|
14
15
|
createProviderPlugin,
|
|
15
16
|
requireApiKey,
|
|
16
17
|
upstreamError
|
|
17
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-ATK45BXV.js";
|
|
18
19
|
import {
|
|
19
20
|
assertPublicHttpUrl,
|
|
20
21
|
guardedFetch
|
|
21
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-U7B6DS2O.js";
|
|
22
23
|
import {
|
|
23
24
|
TBError,
|
|
24
|
-
external_exports
|
|
25
|
-
|
|
25
|
+
external_exports,
|
|
26
|
+
isTBError
|
|
27
|
+
} from "./chunk-UZM2RXZH.js";
|
|
26
28
|
import "./chunk-U67V476Y.js";
|
|
27
29
|
|
|
28
30
|
// ../plugins/src/memos/api.ts
|
|
29
31
|
var SERVICE = "memos";
|
|
30
32
|
var API_SUFFIX = "/api/v1";
|
|
31
33
|
var ATTACHMENT_MAX_BYTES = 20 * 1024 * 1024;
|
|
32
|
-
var http =
|
|
34
|
+
var http = createAuthedClient({
|
|
35
|
+
service: SERVICE,
|
|
36
|
+
auth: { kind: "bearer" },
|
|
37
|
+
headers: { accept: "application/json" },
|
|
38
|
+
// Memos 的错误消息就一个 `message` 键(gRPC-gateway 的形状);非 JSON 体则是整段文本。
|
|
39
|
+
errorMessage: {
|
|
40
|
+
keys: ["message"],
|
|
41
|
+
fallback: () => "Memos request failed"
|
|
42
|
+
}
|
|
43
|
+
});
|
|
33
44
|
var UPDATE_MASKS = [
|
|
34
45
|
["content", "content"],
|
|
35
46
|
["visibility", "visibility"],
|
|
@@ -84,7 +95,8 @@ function resolveBaseUrl(ctx) {
|
|
|
84
95
|
return normalized.endsWith(API_SUFFIX) ? normalized : `${normalized}${API_SUFFIX}`;
|
|
85
96
|
}
|
|
86
97
|
function resolveTarget(ctx) {
|
|
87
|
-
|
|
98
|
+
requireApiKey(ctx, SERVICE);
|
|
99
|
+
return resolveBaseUrl(ctx);
|
|
88
100
|
}
|
|
89
101
|
function resourcePath(name, collection) {
|
|
90
102
|
const segments = name.split("/");
|
|
@@ -94,21 +106,14 @@ function resourcePath(name, collection) {
|
|
|
94
106
|
}
|
|
95
107
|
return `/${collection}/${encodeURIComponent(id)}`;
|
|
96
108
|
}
|
|
97
|
-
function
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
return trimmedText(asJsonObject(payload)?.message) ?? "Memos request failed";
|
|
101
|
-
}
|
|
102
|
-
async function request(target, input) {
|
|
103
|
-
const result = await http.request({
|
|
104
|
-
baseUrl: `${target.baseUrl}/`,
|
|
109
|
+
async function request(ctx, input) {
|
|
110
|
+
const result = await http.request(ctx, {
|
|
111
|
+
baseUrl: `${resolveTarget(ctx)}/`,
|
|
105
112
|
path: input.path,
|
|
106
113
|
method: input.method ?? "GET",
|
|
107
114
|
query: Object.entries(input.query ?? {}),
|
|
108
|
-
headers: { accept: "application/json", authorization: `Bearer ${target.apiKey}` },
|
|
109
115
|
...input.body === void 0 ? {} : { json: input.body },
|
|
110
116
|
invalidJsonMessage: "Memos returned invalid JSON",
|
|
111
|
-
mapError: ({ data, status }) => upstreamError(status, errorMessage(data)),
|
|
112
117
|
mapTransportError: ({ message }) => upstreamError(
|
|
113
118
|
502,
|
|
114
119
|
`Memos ${input.path} request failed: ${message ?? "unknown network error"}`
|
|
@@ -128,7 +133,7 @@ async function downloadAttachment(fileUrl, declaredType) {
|
|
|
128
133
|
try {
|
|
129
134
|
response = await guardedFetch(fileUrl, { method: "GET" });
|
|
130
135
|
} catch (error) {
|
|
131
|
-
if (error
|
|
136
|
+
if (isTBError(error)) throw error;
|
|
132
137
|
const detail = error instanceof Error ? error.message : "unknown network error";
|
|
133
138
|
throw upstreamError(502, `failed to fetch fileUrl: ${detail}`);
|
|
134
139
|
}
|
|
@@ -138,7 +143,7 @@ async function downloadAttachment(fileUrl, declaredType) {
|
|
|
138
143
|
return { bytes, mimeType: declaredType ?? responseType ?? "application/octet-stream" };
|
|
139
144
|
}
|
|
140
145
|
async function createMemo(input, ctx) {
|
|
141
|
-
const payload = await request(
|
|
146
|
+
const payload = await request(ctx, {
|
|
142
147
|
method: "POST",
|
|
143
148
|
path: "/memos",
|
|
144
149
|
// memoId 是**query** 参数而不是 body 字段(Memos 的 AIP 风格:资源 id 走 query)。
|
|
@@ -154,7 +159,7 @@ async function createMemo(input, ctx) {
|
|
|
154
159
|
return { memo: requireResponseObject(payload, "create memo") };
|
|
155
160
|
}
|
|
156
161
|
async function listMemos(input, ctx) {
|
|
157
|
-
const payload = requireResponseObject(await request(
|
|
162
|
+
const payload = requireResponseObject(await request(ctx, {
|
|
158
163
|
path: "/memos",
|
|
159
164
|
query: compactDefined({
|
|
160
165
|
pageSize: input.pageSize,
|
|
@@ -173,7 +178,7 @@ async function listMemos(input, ctx) {
|
|
|
173
178
|
}
|
|
174
179
|
async function getMemo(input, ctx) {
|
|
175
180
|
const path = resourcePath(requireText(input.name, "name"), "memos");
|
|
176
|
-
const payload = await request(
|
|
181
|
+
const payload = await request(ctx, { path });
|
|
177
182
|
return { memo: requireResponseObject(payload, "get memo") };
|
|
178
183
|
}
|
|
179
184
|
async function updateMemo(input, ctx) {
|
|
@@ -182,7 +187,7 @@ async function updateMemo(input, ctx) {
|
|
|
182
187
|
if (updateMask.length === 0) {
|
|
183
188
|
throw new TBError("invalid_argument", "Provide at least one memo field to update.");
|
|
184
189
|
}
|
|
185
|
-
const payload = await request(
|
|
190
|
+
const payload = await request(ctx, {
|
|
186
191
|
method: "PATCH",
|
|
187
192
|
path: resourcePath(name, "memos"),
|
|
188
193
|
query: { updateMask: updateMask.join(",") },
|
|
@@ -200,7 +205,7 @@ async function updateMemo(input, ctx) {
|
|
|
200
205
|
}
|
|
201
206
|
async function deleteMemo(input, ctx) {
|
|
202
207
|
const name = requireText(input.name, "name");
|
|
203
|
-
await request(
|
|
208
|
+
await request(ctx, {
|
|
204
209
|
method: "DELETE",
|
|
205
210
|
path: resourcePath(name, "memos"),
|
|
206
211
|
query: compactDefined({ force: input.force })
|
|
@@ -208,9 +213,9 @@ async function deleteMemo(input, ctx) {
|
|
|
208
213
|
return { deleted: true, name };
|
|
209
214
|
}
|
|
210
215
|
async function uploadAttachment(input, ctx) {
|
|
211
|
-
|
|
216
|
+
resolveTarget(ctx);
|
|
212
217
|
const source = await downloadAttachment(requireText(input.fileUrl, "fileUrl"), trimmedText(input.type));
|
|
213
|
-
const payload = await request(
|
|
218
|
+
const payload = await request(ctx, {
|
|
214
219
|
method: "POST",
|
|
215
220
|
path: "/attachments",
|
|
216
221
|
query: compactDefined({ attachmentId: trimmedText(input.attachmentId) }),
|
|
@@ -224,7 +229,7 @@ async function uploadAttachment(input, ctx) {
|
|
|
224
229
|
return { attachment: requireResponseObject(payload, "upload attachment") };
|
|
225
230
|
}
|
|
226
231
|
async function listAttachments(input, ctx) {
|
|
227
|
-
const payload = requireResponseObject(await request(
|
|
232
|
+
const payload = requireResponseObject(await request(ctx, {
|
|
228
233
|
path: "/attachments",
|
|
229
234
|
query: compactDefined({
|
|
230
235
|
pageSize: input.pageSize,
|
|
@@ -240,17 +245,17 @@ async function listAttachments(input, ctx) {
|
|
|
240
245
|
}
|
|
241
246
|
async function getAttachment(input, ctx) {
|
|
242
247
|
const path = resourcePath(requireText(input.name, "name"), "attachments");
|
|
243
|
-
const payload = await request(
|
|
248
|
+
const payload = await request(ctx, { path });
|
|
244
249
|
return { attachment: requireResponseObject(payload, "get attachment") };
|
|
245
250
|
}
|
|
246
251
|
async function deleteAttachment(input, ctx) {
|
|
247
252
|
const name = requireText(input.name, "name");
|
|
248
|
-
await request(
|
|
253
|
+
await request(ctx, { method: "DELETE", path: resourcePath(name, "attachments") });
|
|
249
254
|
return { deleted: true, name };
|
|
250
255
|
}
|
|
251
256
|
async function listMemoAttachments(input, ctx) {
|
|
252
257
|
const name = requireText(input.name, "name");
|
|
253
|
-
const payload = requireResponseObject(await request(
|
|
258
|
+
const payload = requireResponseObject(await request(ctx, {
|
|
254
259
|
path: `${resourcePath(name, "memos")}/attachments`,
|
|
255
260
|
query: compactDefined({ pageSize: input.pageSize, pageToken: trimmedText(input.pageToken) })
|
|
256
261
|
}), "list memo attachments");
|
|
@@ -263,7 +268,7 @@ async function setMemoAttachments(input, ctx) {
|
|
|
263
268
|
const name = requireText(input.name, "name");
|
|
264
269
|
const attachmentNames = input.attachmentNames.map((item) => requireText(item, "attachmentNames"));
|
|
265
270
|
for (const attachmentName of attachmentNames) resourcePath(attachmentName, "attachments");
|
|
266
|
-
await request(
|
|
271
|
+
await request(ctx, {
|
|
267
272
|
method: "PATCH",
|
|
268
273
|
path: `${resourcePath(name, "memos")}/attachments`,
|
|
269
274
|
body: { name, attachments: attachmentNames.map((attachmentName) => ({ name: attachmentName })) }
|
|
@@ -271,11 +276,11 @@ async function setMemoAttachments(input, ctx) {
|
|
|
271
276
|
return { updated: true, name, attachmentNames };
|
|
272
277
|
}
|
|
273
278
|
async function getCurrentUser(_input, ctx) {
|
|
274
|
-
const payload = requireResponseObject(await request(
|
|
279
|
+
const payload = requireResponseObject(await request(ctx, { path: "/auth/me" }), "get current user");
|
|
275
280
|
return { user: requireResponseObject(payload.user, "get current user") };
|
|
276
281
|
}
|
|
277
282
|
async function listUsers(input, ctx) {
|
|
278
|
-
const payload = requireResponseObject(await request(
|
|
283
|
+
const payload = requireResponseObject(await request(ctx, {
|
|
279
284
|
path: "/users",
|
|
280
285
|
query: compactDefined({
|
|
281
286
|
pageSize: input.pageSize,
|
|
@@ -291,7 +296,7 @@ async function listUsers(input, ctx) {
|
|
|
291
296
|
}
|
|
292
297
|
async function getUser(input, ctx) {
|
|
293
298
|
const path = resourcePath(requireText(input.name, "name"), "users");
|
|
294
|
-
const payload = await request(
|
|
299
|
+
const payload = await request(ctx, {
|
|
295
300
|
path,
|
|
296
301
|
query: compactDefined({ readMask: trimmedText(input.readMask) })
|
|
297
302
|
});
|