@tool-bridge/server 0.16.0 → 0.19.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/dist/{airtable-S3T4TAN7.js → airtable-23JBIM6X.js} +106 -114
- package/dist/{alt_text_generator_ai-4DIRIDKL.js → alt_text_generator_ai-ADWBTCIH.js} +25 -16
- package/dist/{amap-LGVGNPML.js → amap-CYQCYW2Z.js} +114 -123
- package/dist/{anthropic-27RFZO35.js → anthropic-5P62HDNR.js} +34 -56
- package/dist/{apify-6WLYAIAS.js → apify-54RZUAGW.js} +31 -49
- package/dist/{brave_search-K2SVJ66F.js → brave_search-AHJ6FTD5.js} +52 -77
- package/dist/{chunk-VK3V2WTY.js → chunk-B4P6YZFS.js} +4 -6
- package/dist/{chunk-BB6ZLMTU.js → chunk-CLEZ6YQ6.js} +2600 -481
- package/dist/chunk-JXHMDBAY.js +45 -0
- package/dist/chunk-LMLX3DJF.js +50 -0
- package/dist/{chunk-YB2FLNWI.js → chunk-OKRZPQ3R.js} +2558 -1926
- package/dist/chunk-SWBNHIO4.js +977 -0
- package/dist/chunk-U67V476Y.js +35 -0
- package/dist/chunk-VLOIDU5U.js +283 -0
- package/dist/{circleci-WV3ITU7Q.js → circleci-UM3NSQJ3.js} +36 -55
- package/dist/{clerk-NFQEFKS4.js → clerk-FE5LQ2CZ.js} +60 -80
- package/dist/{cloudflare_dns-2RK5ASBJ.js → cloudflare_dns-KEZABKUT.js} +90 -113
- package/dist/{cohere-5KEW7LWT.js → cohere-4IPJADXP.js} +33 -49
- package/dist/{confluence-SZE63S46.js → confluence-56QEKNQI.js} +79 -115
- package/dist/{convertapi-QPG2JC5K.js → convertapi-3QRM5K5T.js} +13 -16
- package/dist/{currencyapi-UO2APQRY.js → currencyapi-L6G4OND5.js} +30 -53
- package/dist/{deepseek-LJELIMM3.js → deepseek-LGC6HBFG.js} +30 -38
- package/dist/{docker_hub-2MFXSBOF.js → docker_hub-XDMK3BIU.js} +141 -157
- package/dist/{dropbox-GQYNTTVA.js → dropbox-4QARMFZU.js} +134 -141
- package/dist/{dub-KI2LHXST.js → dub-C6JSJKOT.js} +61 -93
- package/dist/{e2b-WO6ISY3C.js → e2b-6A6TVACJ.js} +39 -69
- package/dist/{exa-IZ7B3BPT.js → exa-SIWWW6AA.js} +49 -77
- package/dist/{fal_ai-LTMF36GJ.js → fal_ai-3IJXOKSP.js} +37 -44
- package/dist/{feishu-WM7SLSFD.js → feishu-L4KDA4DC.js} +4 -6
- package/dist/{feishu_custom_bot-66W3MXH2.js → feishu_custom_bot-SDM75H4P.js} +4 -5
- package/dist/{figma-2Z274VQZ.js → figma-6DD436DN.js} +56 -81
- package/dist/{firehydrant-IFI4R65V.js → firehydrant-SYSGYB3R.js} +40 -53
- package/dist/{fixer-BCCZEB3D.js → fixer-FZG7ASTF.js} +31 -43
- package/dist/{fly-755FXYB5.js → fly-HMRCZBUC.js} +50 -66
- package/dist/{front-4FZKKXXK.js → front-FAFSD7I3.js} +43 -66
- package/dist/{geocodio-WYKDJ3DP.js → geocodio-4D3TWENM.js} +37 -63
- package/dist/{ghost-5BNQTCOH.js → ghost-OSO2FOZS.js} +51 -57
- package/dist/{github-ULELF5VX.js → github-OR4I4RHE.js} +48 -41
- package/dist/{gmail-G34WT64J.js → gmail-5AOPJ63E.js} +26 -36
- package/dist/{googlecalendar-BQU255SC.js → googlecalendar-SOJIJUWH.js} +57 -78
- package/dist/{googledocs-HPCNQXYJ.js → googledocs-QSKN5TLN.js} +14 -22
- package/dist/{grafana-VOV24FIC.js → grafana-R3AIZM7M.js} +95 -122
- package/dist/{graphhopper-D5RXW6AP.js → graphhopper-4CR3QOAX.js} +32 -46
- package/dist/index.d.ts +108 -56
- package/dist/index.js +4 -3
- package/dist/{ip2proxy-DAYO7EKZ.js → ip2proxy-OBCG6X6J.js} +35 -42
- package/dist/{ipgeolocation_io-XD4PSLII.js → ipgeolocation_io-NHH3DTQW.js} +40 -60
- package/dist/{ipqualityscore-K27QEAWK.js → ipqualityscore-7POMCBEC.js} +30 -42
- package/dist/{jina_ai-E6UXFV2P.js → jina_ai-YXVKROV4.js} +32 -58
- package/dist/{jira-ZDSXGQ6W.js → jira-LADO3VJU.js} +116 -126
- package/dist/{langsmith-TIFJRREW.js → langsmith-XZ6UAQFU.js} +101 -121
- package/dist/{lemlist-DASEMJMA.js → lemlist-P74GLNE7.js} +57 -68
- package/dist/{linear-KE6UP4SP.js → linear-CXJ7D37A.js} +109 -118
- package/dist/{logsnag-IMNDN4R5.js → logsnag-EVVHWFLK.js} +31 -48
- package/dist/main.js +103 -102
- package/dist/{mattermost-HHHMUXQA.js → mattermost-WG2MRGBD.js} +45 -62
- package/dist/{mem0-D2FGGOIY.js → mem0-HQWUKG6U.js} +72 -98
- package/dist/{memos-4OVIGFPH.js → memos-SQMJIFOE.js} +68 -122
- package/dist/{metabase-33WCX5YD.js → metabase-E27G2DZI.js} +47 -60
- package/dist/{mistral_ai-QIMZ2JYL.js → mistral_ai-MIL63NIT.js} +35 -40
- package/dist/{mother_duck-M6VWS2VH.js → mother_duck-AIZVCBNR.js} +42 -62
- package/dist/{ngrok-Z2PKQBHH.js → ngrok-XS4DVIQS.js} +42 -58
- package/dist/{notes-SS4RPC4K.js → notes-JEOUSL2Y.js} +3 -5
- package/dist/{notion-FJCNQ6I7.js → notion-U4EZVDW2.js} +83 -97
- package/dist/{open_exchange_rates-WU57WTT5.js → open_exchange_rates-AZSQEYEJ.js} +35 -39
- package/dist/{openai-JODZ4GKT.js → openai-HW3SYMTQ.js} +51 -55
- package/dist/{opengraph_io-SQRAUSV5.js → opengraph_io-QX74MAEL.js} +61 -79
- package/dist/{openrouter-Q5XXEJZ7.js → openrouter-OXSKYL6N.js} +41 -55
- package/dist/{outline-RT2EHJ2X.js → outline-CCQAPDSW.js} +89 -104
- package/dist/{paddle-OF2V7GAC.js → paddle-6KQPSSCK.js} +34 -49
- package/dist/{perplexity-LNZEWLHG.js → perplexity-2TXO7IQE.js} +33 -50
- package/dist/{pinecone-JSJIXZYN.js → pinecone-YOO7NULI.js} +65 -91
- package/dist/{pipedrive-D4CKVUXR.js → pipedrive-Q6RIFIFP.js} +37 -59
- package/dist/{polar-M7ZYP6UR.js → polar-KUMGCES3.js} +43 -53
- package/dist/{posthog-YV7CZOH4.js → posthog-VXQHBSMB.js} +58 -77
- package/dist/{postmark-KYHLECRG.js → postmark-YLIPF52S.js} +52 -71
- package/dist/{prerender-HCMHBKV2.js → prerender-CRY7UJN5.js} +32 -50
- package/dist/{pubmed-WYVLCCN3.js → pubmed-3Z4T5AM7.js} +28 -60
- package/dist/{railway-TWIRD5KR.js → railway-BP37IGFL.js} +32 -39
- package/dist/{readwise-UZ467IQ7.js → readwise-HTKICF4K.js} +62 -78
- package/dist/{render-MECUC5CC.js → render-WIVTUXJH.js} +48 -64
- package/dist/{replicate-A5MEK3SW.js → replicate-JJYPA43D.js} +41 -58
- package/dist/{resend-BC6EAWJQ.js → resend-TKHZVG7A.js} +27 -37
- package/dist/{rootly-ZM3QDUIS.js → rootly-FRSZLG5U.js} +64 -76
- package/dist/{scrapfly-WAML42QJ.js → scrapfly-M5WXGQWE.js} +45 -51
- package/dist/{scrapingbee-DG7PET3V.js → scrapingbee-PMXNLLBK.js} +25 -33
- package/dist/{screenshot_fyi-HY6WTHIO.js → screenshot_fyi-HFW4TAOH.js} +29 -47
- package/dist/{semantic_scholar-C5IZA7IP.js → semantic_scholar-KXVH2VZQ.js} +37 -56
- package/dist/{sentry-OKBPSTDM.js → sentry-WWOT2LRX.js} +66 -85
- package/dist/{shodan-PPC6DYU4.js → shodan-FY635H35.js} +42 -53
- package/dist/{shopify-EWGUHBXO.js → shopify-HQLBVSA5.js} +32 -49
- package/dist/{stripe-6RPDPC5W.js → stripe-GJN2GOHB.js} +4 -5
- package/dist/{supabase-SK7DQ42N.js → supabase-BBNZGQU6.js} +69 -88
- package/dist/{tavily-YCG5VQMH.js → tavily-DPENIBOG.js} +37 -62
- package/dist/{telegram-2OES5FYB.js → telegram-L4NONG6H.js} +168 -177
- package/dist/{telnyx-POOSBBR4.js → telnyx-H67MAEZS.js} +30 -50
- package/dist/{todoist-M7YD6YSS.js → todoist-G2BSP4DX.js} +77 -89
- package/dist/{trello-IS6V5W3E.js → trello-7WMVFDG2.js} +108 -122
- package/dist/{turso-RCFHUFVH.js → turso-ZUAESFC2.js} +52 -64
- package/dist/{twilio-OS2RXFGO.js → twilio-EYFYIX3B.js} +48 -55
- package/dist/{umami-PQ2SJ2LN.js → umami-AXAUDUVF.js} +49 -69
- package/dist/{unsplash-C6BPZO4E.js → unsplash-UCQAWPLR.js} +35 -52
- package/dist/{upstash_redis-WH6UER7H.js → upstash_redis-ZPZ4ASU6.js} +28 -40
- package/dist/{uptimerobot-M3YZGS6Z.js → uptimerobot-4QVKKUD5.js} +11 -12
- package/dist/{v2ex-R4JWTEHN.js → v2ex-VGEFJTYC.js} +36 -61
- package/dist/{vercel-FZVYUOQD.js → vercel-JME4TSCN.js} +124 -150
- package/dist/{webapi-VLM4IKVB.js → webapi-GW5QXWXE.js} +1 -1
- package/dist/{wolfram_alpha_api-2KOLO5DC.js → wolfram_alpha_api-TRGU2MDG.js} +26 -34
- package/dist/{wordpress-XRWGO6LG.js → wordpress-WRUKLCZR.js} +87 -104
- package/dist/{workos-WR4NKOYL.js → workos-ZDW4EHS4.js} +37 -56
- package/dist/{zhihu-BKZIB3WA.js → zhihu-4VI67CWU.js} +35 -57
- package/package.json +3 -3
- package/dist/chunk-2O27H4Y2.js +0 -183
- package/dist/chunk-GKX72JMJ.js +0 -378
- package/dist/chunk-MLKGABMK.js +0 -9
|
@@ -1,72 +1,55 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createProviderHttpClient
|
|
3
|
+
} from "./chunk-VLOIDU5U.js";
|
|
4
|
+
import {
|
|
5
|
+
messageFrom
|
|
6
|
+
} from "./chunk-JXHMDBAY.js";
|
|
1
7
|
import {
|
|
2
8
|
createProviderPlugin,
|
|
3
9
|
requireApiKey,
|
|
4
10
|
upstreamError
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import
|
|
7
|
-
guardedFetch
|
|
8
|
-
} from "./chunk-2O27H4Y2.js";
|
|
9
|
-
import "./chunk-GKX72JMJ.js";
|
|
11
|
+
} from "./chunk-B4P6YZFS.js";
|
|
12
|
+
import "./chunk-SWBNHIO4.js";
|
|
10
13
|
import {
|
|
11
14
|
external_exports
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-OKRZPQ3R.js";
|
|
16
|
+
import "./chunk-U67V476Y.js";
|
|
14
17
|
|
|
15
18
|
// ../plugins/src/logsnag/api.ts
|
|
16
19
|
var SERVICE = "logsnag";
|
|
17
|
-
var
|
|
18
|
-
async function readPayload(response) {
|
|
19
|
-
const text2 = await response.text().catch(() => "");
|
|
20
|
-
if (text2 === "") return void 0;
|
|
21
|
-
if (response.headers.get("content-type")?.includes("json") !== true) return text2;
|
|
22
|
-
try {
|
|
23
|
-
return JSON.parse(text2);
|
|
24
|
-
} catch {
|
|
25
|
-
return text2;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
function text(value) {
|
|
29
|
-
if (typeof value !== "string") return void 0;
|
|
30
|
-
return value.trim() || void 0;
|
|
31
|
-
}
|
|
32
|
-
function errorMessage(payload, status) {
|
|
33
|
-
const direct = text(payload);
|
|
34
|
-
if (direct !== void 0) return direct;
|
|
35
|
-
if (typeof payload === "object" && payload !== null && !Array.isArray(payload)) {
|
|
36
|
-
const record = payload;
|
|
37
|
-
for (const key of ["message", "error", "detail"]) {
|
|
38
|
-
const value = text(record[key]);
|
|
39
|
-
if (value !== void 0) return value;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return `LogSnag request failed with ${status}`;
|
|
43
|
-
}
|
|
20
|
+
var http = createProviderHttpClient({ baseUrl: "https://api.logsnag.com/v1/", service: SERVICE });
|
|
44
21
|
async function request(path, method, body, ctx) {
|
|
45
|
-
const
|
|
22
|
+
const result = await http.request({
|
|
23
|
+
path,
|
|
46
24
|
method,
|
|
47
25
|
headers: {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"content-type": "application/json"
|
|
26
|
+
accept: "application/json",
|
|
27
|
+
authorization: `Bearer ${requireApiKey(ctx, SERVICE)}`
|
|
51
28
|
},
|
|
52
|
-
|
|
29
|
+
json: body,
|
|
30
|
+
responseType: "auto",
|
|
31
|
+
invalidJson: "text",
|
|
32
|
+
mapError: ({ data, status }) => upstreamError(
|
|
33
|
+
status,
|
|
34
|
+
messageFrom(data, ["message", "error", "detail"], `LogSnag request failed with ${status}`)
|
|
35
|
+
)
|
|
53
36
|
});
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
37
|
+
return {
|
|
38
|
+
ok: true,
|
|
39
|
+
status: result.status,
|
|
40
|
+
...result.data === void 0 ? {} : { payload: result.data }
|
|
41
|
+
};
|
|
59
42
|
}
|
|
60
|
-
|
|
43
|
+
function publishEvent(input, ctx) {
|
|
61
44
|
return request("log", "POST", input, ctx);
|
|
62
45
|
}
|
|
63
|
-
|
|
46
|
+
function identifyUser(input, ctx) {
|
|
64
47
|
return request("identify", "POST", input, ctx);
|
|
65
48
|
}
|
|
66
|
-
|
|
49
|
+
function publishInsight(input, ctx) {
|
|
67
50
|
return request("insight", "POST", input, ctx);
|
|
68
51
|
}
|
|
69
|
-
|
|
52
|
+
function mutateInsight(input, ctx) {
|
|
70
53
|
return request("insight", "PATCH", input, ctx);
|
|
71
54
|
}
|
|
72
55
|
|
package/dist/main.js
CHANGED
|
@@ -2,111 +2,112 @@
|
|
|
2
2
|
import {
|
|
3
3
|
configFromEnv,
|
|
4
4
|
createTbServer
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-CLEZ6YQ6.js";
|
|
6
|
+
import "./chunk-SWBNHIO4.js";
|
|
7
|
+
import "./chunk-OKRZPQ3R.js";
|
|
8
|
+
import "./chunk-U67V476Y.js";
|
|
8
9
|
|
|
9
10
|
// ../plugins/src/registry.generated.ts
|
|
10
11
|
var BUILTIN_PLUGIN_LOADERS = {
|
|
11
|
-
airtable: () => import("./airtable-
|
|
12
|
-
alt_text_generator_ai: () => import("./alt_text_generator_ai-
|
|
13
|
-
amap: () => import("./amap-
|
|
14
|
-
anthropic: () => import("./anthropic-
|
|
15
|
-
apify: () => import("./apify-
|
|
16
|
-
brave_search: () => import("./brave_search-
|
|
17
|
-
circleci: () => import("./circleci-
|
|
18
|
-
clerk: () => import("./clerk-
|
|
19
|
-
cloudflare_dns: () => import("./cloudflare_dns-
|
|
20
|
-
cohere: () => import("./cohere-
|
|
21
|
-
confluence: () => import("./confluence-
|
|
22
|
-
convertapi: () => import("./convertapi-
|
|
23
|
-
currencyapi: () => import("./currencyapi-
|
|
24
|
-
deepseek: () => import("./deepseek-
|
|
25
|
-
docker_hub: () => import("./docker_hub-
|
|
26
|
-
dropbox: () => import("./dropbox-
|
|
27
|
-
dub: () => import("./dub-
|
|
28
|
-
e2b: () => import("./e2b-
|
|
29
|
-
exa: () => import("./exa-
|
|
30
|
-
fal_ai: () => import("./fal_ai-
|
|
31
|
-
feishu: () => import("./feishu-
|
|
32
|
-
feishu_custom_bot: () => import("./feishu_custom_bot-
|
|
33
|
-
figma: () => import("./figma-
|
|
34
|
-
firehydrant: () => import("./firehydrant-
|
|
35
|
-
fixer: () => import("./fixer-
|
|
36
|
-
fly: () => import("./fly-
|
|
37
|
-
front: () => import("./front-
|
|
38
|
-
geocodio: () => import("./geocodio-
|
|
39
|
-
ghost: () => import("./ghost-
|
|
40
|
-
github: () => import("./github-
|
|
41
|
-
gmail: () => import("./gmail-
|
|
42
|
-
googlecalendar: () => import("./googlecalendar-
|
|
43
|
-
googledocs: () => import("./googledocs-
|
|
44
|
-
grafana: () => import("./grafana-
|
|
45
|
-
graphhopper: () => import("./graphhopper-
|
|
46
|
-
ip2proxy: () => import("./ip2proxy-
|
|
47
|
-
ipgeolocation_io: () => import("./ipgeolocation_io-
|
|
48
|
-
ipqualityscore: () => import("./ipqualityscore-
|
|
49
|
-
jina_ai: () => import("./jina_ai-
|
|
50
|
-
jira: () => import("./jira-
|
|
51
|
-
langsmith: () => import("./langsmith-
|
|
52
|
-
lemlist: () => import("./lemlist-
|
|
53
|
-
linear: () => import("./linear-
|
|
54
|
-
logsnag: () => import("./logsnag-
|
|
55
|
-
mattermost: () => import("./mattermost-
|
|
56
|
-
mem0: () => import("./mem0-
|
|
57
|
-
memos: () => import("./memos-
|
|
58
|
-
metabase: () => import("./metabase-
|
|
59
|
-
mistral_ai: () => import("./mistral_ai-
|
|
60
|
-
mother_duck: () => import("./mother_duck-
|
|
61
|
-
ngrok: () => import("./ngrok-
|
|
62
|
-
notes: () => import("./notes-
|
|
63
|
-
notion: () => import("./notion-
|
|
64
|
-
open_exchange_rates: () => import("./open_exchange_rates-
|
|
65
|
-
openai: () => import("./openai-
|
|
66
|
-
opengraph_io: () => import("./opengraph_io-
|
|
67
|
-
openrouter: () => import("./openrouter-
|
|
68
|
-
outline: () => import("./outline-
|
|
69
|
-
paddle: () => import("./paddle-
|
|
70
|
-
perplexity: () => import("./perplexity-
|
|
71
|
-
pinecone: () => import("./pinecone-
|
|
72
|
-
pipedrive: () => import("./pipedrive-
|
|
73
|
-
polar: () => import("./polar-
|
|
74
|
-
posthog: () => import("./posthog-
|
|
75
|
-
postmark: () => import("./postmark-
|
|
76
|
-
prerender: () => import("./prerender-
|
|
77
|
-
pubmed: () => import("./pubmed-
|
|
78
|
-
railway: () => import("./railway-
|
|
79
|
-
readwise: () => import("./readwise-
|
|
80
|
-
render: () => import("./render-
|
|
81
|
-
replicate: () => import("./replicate-
|
|
82
|
-
resend: () => import("./resend-
|
|
83
|
-
rootly: () => import("./rootly-
|
|
84
|
-
scrapfly: () => import("./scrapfly-
|
|
85
|
-
scrapingbee: () => import("./scrapingbee-
|
|
86
|
-
screenshot_fyi: () => import("./screenshot_fyi-
|
|
87
|
-
semantic_scholar: () => import("./semantic_scholar-
|
|
88
|
-
sentry: () => import("./sentry-
|
|
89
|
-
shodan: () => import("./shodan-
|
|
90
|
-
shopify: () => import("./shopify-
|
|
91
|
-
stripe: () => import("./stripe-
|
|
92
|
-
supabase: () => import("./supabase-
|
|
93
|
-
tavily: () => import("./tavily-
|
|
94
|
-
telegram: () => import("./telegram-
|
|
95
|
-
telnyx: () => import("./telnyx-
|
|
96
|
-
todoist: () => import("./todoist-
|
|
97
|
-
trello: () => import("./trello-
|
|
98
|
-
turso: () => import("./turso-
|
|
99
|
-
twilio: () => import("./twilio-
|
|
100
|
-
umami: () => import("./umami-
|
|
101
|
-
unsplash: () => import("./unsplash-
|
|
102
|
-
upstash_redis: () => import("./upstash_redis-
|
|
103
|
-
uptimerobot: () => import("./uptimerobot-
|
|
104
|
-
v2ex: () => import("./v2ex-
|
|
105
|
-
vercel: () => import("./vercel-
|
|
106
|
-
wolfram_alpha_api: () => import("./wolfram_alpha_api-
|
|
107
|
-
wordpress: () => import("./wordpress-
|
|
108
|
-
workos: () => import("./workos-
|
|
109
|
-
zhihu: () => import("./zhihu-
|
|
12
|
+
airtable: () => import("./airtable-23JBIM6X.js"),
|
|
13
|
+
alt_text_generator_ai: () => import("./alt_text_generator_ai-ADWBTCIH.js"),
|
|
14
|
+
amap: () => import("./amap-CYQCYW2Z.js"),
|
|
15
|
+
anthropic: () => import("./anthropic-5P62HDNR.js"),
|
|
16
|
+
apify: () => import("./apify-54RZUAGW.js"),
|
|
17
|
+
brave_search: () => import("./brave_search-AHJ6FTD5.js"),
|
|
18
|
+
circleci: () => import("./circleci-UM3NSQJ3.js"),
|
|
19
|
+
clerk: () => import("./clerk-FE5LQ2CZ.js"),
|
|
20
|
+
cloudflare_dns: () => import("./cloudflare_dns-KEZABKUT.js"),
|
|
21
|
+
cohere: () => import("./cohere-4IPJADXP.js"),
|
|
22
|
+
confluence: () => import("./confluence-56QEKNQI.js"),
|
|
23
|
+
convertapi: () => import("./convertapi-3QRM5K5T.js"),
|
|
24
|
+
currencyapi: () => import("./currencyapi-L6G4OND5.js"),
|
|
25
|
+
deepseek: () => import("./deepseek-LGC6HBFG.js"),
|
|
26
|
+
docker_hub: () => import("./docker_hub-XDMK3BIU.js"),
|
|
27
|
+
dropbox: () => import("./dropbox-4QARMFZU.js"),
|
|
28
|
+
dub: () => import("./dub-C6JSJKOT.js"),
|
|
29
|
+
e2b: () => import("./e2b-6A6TVACJ.js"),
|
|
30
|
+
exa: () => import("./exa-SIWWW6AA.js"),
|
|
31
|
+
fal_ai: () => import("./fal_ai-3IJXOKSP.js"),
|
|
32
|
+
feishu: () => import("./feishu-L4KDA4DC.js"),
|
|
33
|
+
feishu_custom_bot: () => import("./feishu_custom_bot-SDM75H4P.js"),
|
|
34
|
+
figma: () => import("./figma-6DD436DN.js"),
|
|
35
|
+
firehydrant: () => import("./firehydrant-SYSGYB3R.js"),
|
|
36
|
+
fixer: () => import("./fixer-FZG7ASTF.js"),
|
|
37
|
+
fly: () => import("./fly-HMRCZBUC.js"),
|
|
38
|
+
front: () => import("./front-FAFSD7I3.js"),
|
|
39
|
+
geocodio: () => import("./geocodio-4D3TWENM.js"),
|
|
40
|
+
ghost: () => import("./ghost-OSO2FOZS.js"),
|
|
41
|
+
github: () => import("./github-OR4I4RHE.js"),
|
|
42
|
+
gmail: () => import("./gmail-5AOPJ63E.js"),
|
|
43
|
+
googlecalendar: () => import("./googlecalendar-SOJIJUWH.js"),
|
|
44
|
+
googledocs: () => import("./googledocs-QSKN5TLN.js"),
|
|
45
|
+
grafana: () => import("./grafana-R3AIZM7M.js"),
|
|
46
|
+
graphhopper: () => import("./graphhopper-4CR3QOAX.js"),
|
|
47
|
+
ip2proxy: () => import("./ip2proxy-OBCG6X6J.js"),
|
|
48
|
+
ipgeolocation_io: () => import("./ipgeolocation_io-NHH3DTQW.js"),
|
|
49
|
+
ipqualityscore: () => import("./ipqualityscore-7POMCBEC.js"),
|
|
50
|
+
jina_ai: () => import("./jina_ai-YXVKROV4.js"),
|
|
51
|
+
jira: () => import("./jira-LADO3VJU.js"),
|
|
52
|
+
langsmith: () => import("./langsmith-XZ6UAQFU.js"),
|
|
53
|
+
lemlist: () => import("./lemlist-P74GLNE7.js"),
|
|
54
|
+
linear: () => import("./linear-CXJ7D37A.js"),
|
|
55
|
+
logsnag: () => import("./logsnag-EVVHWFLK.js"),
|
|
56
|
+
mattermost: () => import("./mattermost-WG2MRGBD.js"),
|
|
57
|
+
mem0: () => import("./mem0-HQWUKG6U.js"),
|
|
58
|
+
memos: () => import("./memos-SQMJIFOE.js"),
|
|
59
|
+
metabase: () => import("./metabase-E27G2DZI.js"),
|
|
60
|
+
mistral_ai: () => import("./mistral_ai-MIL63NIT.js"),
|
|
61
|
+
mother_duck: () => import("./mother_duck-AIZVCBNR.js"),
|
|
62
|
+
ngrok: () => import("./ngrok-XS4DVIQS.js"),
|
|
63
|
+
notes: () => import("./notes-JEOUSL2Y.js"),
|
|
64
|
+
notion: () => import("./notion-U4EZVDW2.js"),
|
|
65
|
+
open_exchange_rates: () => import("./open_exchange_rates-AZSQEYEJ.js"),
|
|
66
|
+
openai: () => import("./openai-HW3SYMTQ.js"),
|
|
67
|
+
opengraph_io: () => import("./opengraph_io-QX74MAEL.js"),
|
|
68
|
+
openrouter: () => import("./openrouter-OXSKYL6N.js"),
|
|
69
|
+
outline: () => import("./outline-CCQAPDSW.js"),
|
|
70
|
+
paddle: () => import("./paddle-6KQPSSCK.js"),
|
|
71
|
+
perplexity: () => import("./perplexity-2TXO7IQE.js"),
|
|
72
|
+
pinecone: () => import("./pinecone-YOO7NULI.js"),
|
|
73
|
+
pipedrive: () => import("./pipedrive-Q6RIFIFP.js"),
|
|
74
|
+
polar: () => import("./polar-KUMGCES3.js"),
|
|
75
|
+
posthog: () => import("./posthog-VXQHBSMB.js"),
|
|
76
|
+
postmark: () => import("./postmark-YLIPF52S.js"),
|
|
77
|
+
prerender: () => import("./prerender-CRY7UJN5.js"),
|
|
78
|
+
pubmed: () => import("./pubmed-3Z4T5AM7.js"),
|
|
79
|
+
railway: () => import("./railway-BP37IGFL.js"),
|
|
80
|
+
readwise: () => import("./readwise-HTKICF4K.js"),
|
|
81
|
+
render: () => import("./render-WIVTUXJH.js"),
|
|
82
|
+
replicate: () => import("./replicate-JJYPA43D.js"),
|
|
83
|
+
resend: () => import("./resend-TKHZVG7A.js"),
|
|
84
|
+
rootly: () => import("./rootly-FRSZLG5U.js"),
|
|
85
|
+
scrapfly: () => import("./scrapfly-M5WXGQWE.js"),
|
|
86
|
+
scrapingbee: () => import("./scrapingbee-PMXNLLBK.js"),
|
|
87
|
+
screenshot_fyi: () => import("./screenshot_fyi-HFW4TAOH.js"),
|
|
88
|
+
semantic_scholar: () => import("./semantic_scholar-KXVH2VZQ.js"),
|
|
89
|
+
sentry: () => import("./sentry-WWOT2LRX.js"),
|
|
90
|
+
shodan: () => import("./shodan-FY635H35.js"),
|
|
91
|
+
shopify: () => import("./shopify-HQLBVSA5.js"),
|
|
92
|
+
stripe: () => import("./stripe-GJN2GOHB.js"),
|
|
93
|
+
supabase: () => import("./supabase-BBNZGQU6.js"),
|
|
94
|
+
tavily: () => import("./tavily-DPENIBOG.js"),
|
|
95
|
+
telegram: () => import("./telegram-L4NONG6H.js"),
|
|
96
|
+
telnyx: () => import("./telnyx-H67MAEZS.js"),
|
|
97
|
+
todoist: () => import("./todoist-G2BSP4DX.js"),
|
|
98
|
+
trello: () => import("./trello-7WMVFDG2.js"),
|
|
99
|
+
turso: () => import("./turso-ZUAESFC2.js"),
|
|
100
|
+
twilio: () => import("./twilio-EYFYIX3B.js"),
|
|
101
|
+
umami: () => import("./umami-AXAUDUVF.js"),
|
|
102
|
+
unsplash: () => import("./unsplash-UCQAWPLR.js"),
|
|
103
|
+
upstash_redis: () => import("./upstash_redis-ZPZ4ASU6.js"),
|
|
104
|
+
uptimerobot: () => import("./uptimerobot-4QVKKUD5.js"),
|
|
105
|
+
v2ex: () => import("./v2ex-VGEFJTYC.js"),
|
|
106
|
+
vercel: () => import("./vercel-JME4TSCN.js"),
|
|
107
|
+
wolfram_alpha_api: () => import("./wolfram_alpha_api-TRGU2MDG.js"),
|
|
108
|
+
wordpress: () => import("./wordpress-WRUKLCZR.js"),
|
|
109
|
+
workos: () => import("./workos-ZDW4EHS4.js"),
|
|
110
|
+
zhihu: () => import("./zhihu-4VI67CWU.js")
|
|
110
111
|
};
|
|
111
112
|
|
|
112
113
|
// ../plugins/src/catalog.generated.ts
|
|
@@ -1,37 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createProviderHttpClient
|
|
3
|
+
} from "./chunk-VLOIDU5U.js";
|
|
4
|
+
import {
|
|
5
|
+
asJsonObject,
|
|
6
|
+
trimmedText
|
|
7
|
+
} from "./chunk-JXHMDBAY.js";
|
|
1
8
|
import {
|
|
2
9
|
createProviderPlugin,
|
|
3
10
|
requireCredential,
|
|
4
11
|
upstreamError
|
|
5
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-B4P6YZFS.js";
|
|
6
13
|
import {
|
|
7
|
-
assertPublicHttpUrl
|
|
8
|
-
|
|
9
|
-
} from "./chunk-2O27H4Y2.js";
|
|
10
|
-
import "./chunk-GKX72JMJ.js";
|
|
14
|
+
assertPublicHttpUrl
|
|
15
|
+
} from "./chunk-SWBNHIO4.js";
|
|
11
16
|
import {
|
|
12
17
|
TBError,
|
|
13
18
|
external_exports
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
19
|
+
} from "./chunk-OKRZPQ3R.js";
|
|
20
|
+
import "./chunk-U67V476Y.js";
|
|
16
21
|
|
|
17
22
|
// ../plugins/src/mattermost/api.ts
|
|
18
23
|
var SERVICE = "mattermost";
|
|
19
24
|
var API_PATH_PREFIX = "/api/v4";
|
|
20
25
|
var REQUEST_TIMEOUT_MS = 3e4;
|
|
26
|
+
var http = createProviderHttpClient({ service: SERVICE });
|
|
21
27
|
var SINCE_CONFLICTING_FIELDS = ["page", "perPage", "beforePostId", "afterPostId"];
|
|
22
|
-
function text(value) {
|
|
23
|
-
if (typeof value !== "string") return void 0;
|
|
24
|
-
const trimmed = value.trim();
|
|
25
|
-
return trimmed === "" ? void 0 : trimmed;
|
|
26
|
-
}
|
|
27
|
-
function record(value) {
|
|
28
|
-
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
29
|
-
}
|
|
30
28
|
function invalidResponse(message) {
|
|
31
29
|
return new TBError("unavailable", message, { retryable: true });
|
|
32
30
|
}
|
|
33
31
|
function requireRecord(value, label) {
|
|
34
|
-
const result =
|
|
32
|
+
const result = asJsonObject(value);
|
|
35
33
|
if (result === void 0) throw invalidResponse(`${label}\u4E0D\u662F\u5BF9\u8C61`);
|
|
36
34
|
return result;
|
|
37
35
|
}
|
|
@@ -40,7 +38,7 @@ function requireRecordArray(value, label) {
|
|
|
40
38
|
return value.map((item, index) => requireRecord(item, `${label} \u7684\u7B2C ${index} \u9879`));
|
|
41
39
|
}
|
|
42
40
|
function requireText(value, field) {
|
|
43
|
-
const result =
|
|
41
|
+
const result = trimmedText(value);
|
|
44
42
|
if (result === void 0) throw new TBError("invalid_argument", `${field} \u662F\u5FC5\u586B\u7684`);
|
|
45
43
|
return result;
|
|
46
44
|
}
|
|
@@ -66,49 +64,34 @@ function apiBaseUrl(ctx) {
|
|
|
66
64
|
url.pathname = path.endsWith(API_PATH_PREFIX) ? path.slice(0, -API_PATH_PREFIX.length) : path;
|
|
67
65
|
return `${url.toString().replace(/\/$/, "")}${API_PATH_PREFIX}`;
|
|
68
66
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
try {
|
|
73
|
-
return JSON.parse(body);
|
|
74
|
-
} catch {
|
|
75
|
-
if (response.ok) throw invalidResponse("Mattermost \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94");
|
|
76
|
-
return { message: body };
|
|
77
|
-
}
|
|
67
|
+
function responsePayload(data, bodyKind) {
|
|
68
|
+
if (bodyKind === "empty") return null;
|
|
69
|
+
return bodyKind === "invalid-json" ? { message: data } : data;
|
|
78
70
|
}
|
|
79
71
|
function errorMessage(payload, status) {
|
|
80
|
-
const body =
|
|
81
|
-
return
|
|
72
|
+
const body = asJsonObject(payload);
|
|
73
|
+
return trimmedText(body?.message) ?? trimmedText(body?.error) ?? trimmedText(body?.details) ?? trimmedText(body?.id) ?? `Mattermost \u8FD4\u56DE HTTP ${status}`;
|
|
82
74
|
}
|
|
83
75
|
async function request(ctx, input) {
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
})
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
if (error instanceof Error && error.name === "TimeoutError") {
|
|
104
|
-
throw upstreamError(504, `Mattermost \u8BF7\u6C42\u8D85\u65F6(${REQUEST_TIMEOUT_MS / 1e3} \u79D2)`);
|
|
105
|
-
}
|
|
106
|
-
const message = error instanceof Error ? error.message : "unknown network error";
|
|
107
|
-
throw upstreamError(502, `Mattermost \u8BF7\u6C42\u5931\u8D25:${message}`);
|
|
108
|
-
}
|
|
109
|
-
const payload = await readPayload(response);
|
|
110
|
-
if (!response.ok) throw upstreamError(response.status, errorMessage(payload, response.status));
|
|
111
|
-
return payload;
|
|
76
|
+
const result = await http.request({
|
|
77
|
+
baseUrl: `${apiBaseUrl(ctx)}/`,
|
|
78
|
+
path: input.path,
|
|
79
|
+
method: input.method ?? "GET",
|
|
80
|
+
query: Object.entries(input.query ?? {}),
|
|
81
|
+
headers: {
|
|
82
|
+
accept: "application/json",
|
|
83
|
+
authorization: `Bearer ${requireCredential(ctx, SERVICE, "apiKey")}`
|
|
84
|
+
},
|
|
85
|
+
...input.body === void 0 ? {} : { json: input.body },
|
|
86
|
+
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"}`)
|
|
93
|
+
});
|
|
94
|
+
return responsePayload(result.data, result.bodyKind);
|
|
112
95
|
}
|
|
113
96
|
async function getCurrentUser(_input, ctx) {
|
|
114
97
|
const payload = await request(ctx, { path: "/users/me" });
|
|
@@ -136,8 +119,8 @@ async function getChannel(input, ctx) {
|
|
|
136
119
|
function normalizePostList(payload) {
|
|
137
120
|
const raw = requireRecord(payload, "Mattermost \u5E16\u5B50\u5217\u8868");
|
|
138
121
|
const order = Array.isArray(raw.order) ? raw.order.filter((item) => typeof item === "string") : [];
|
|
139
|
-
const postsById =
|
|
140
|
-
const posts = postsById !== void 0 && order.length > 0 ? order.map((id) =>
|
|
122
|
+
const postsById = asJsonObject(raw.posts);
|
|
123
|
+
const posts = postsById !== void 0 && order.length > 0 ? order.map((id) => asJsonObject(postsById[id]) ?? { id }) : Object.values(postsById ?? {}).map((item) => asJsonObject(item) ?? { value: item });
|
|
141
124
|
return { posts, order, raw };
|
|
142
125
|
}
|
|
143
126
|
async function listChannelPosts(input, ctx) {
|
|
@@ -157,15 +140,15 @@ async function listChannelPosts(input, ctx) {
|
|
|
157
140
|
page: input.page,
|
|
158
141
|
per_page: input.perPage,
|
|
159
142
|
since: input.since,
|
|
160
|
-
before:
|
|
161
|
-
after:
|
|
143
|
+
before: trimmedText(input.beforePostId),
|
|
144
|
+
after: trimmedText(input.afterPostId)
|
|
162
145
|
}
|
|
163
146
|
});
|
|
164
147
|
return normalizePostList(payload);
|
|
165
148
|
}
|
|
166
149
|
async function createPost(input, ctx) {
|
|
167
|
-
const rootId =
|
|
168
|
-
const props =
|
|
150
|
+
const rootId = trimmedText(input.rootId);
|
|
151
|
+
const props = asJsonObject(input.props);
|
|
169
152
|
const payload = await request(ctx, {
|
|
170
153
|
path: "/posts",
|
|
171
154
|
method: "POST",
|