@tool-bridge/server 0.21.1 → 0.22.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/admin.js +170 -0
- package/dist/airtable-ML2GIGCH.js +790 -0
- package/dist/{alt_text_generator_ai-W7O34SNG.js → alt_text_generator_ai-FGYQAF2A.js} +12 -11
- package/dist/{amap-VOX4T2AW.js → amap-G7V65NGK.js} +221 -220
- package/dist/anthropic-6ZK24TBB.js +203 -0
- package/dist/apify-VDGYHP6W.js +248 -0
- package/dist/brave_search-TAATLZOS.js +302 -0
- package/dist/chunk-2IAI3XQM.js +302 -0
- package/dist/chunk-7ISGFRC6.js +161 -0
- package/dist/{chunk-E6JCVKW6.js → chunk-BNMLA2RC.js} +3 -3
- package/dist/chunk-HA4BGL6C.js +8429 -0
- package/dist/{chunk-KMTT3I6D.js → chunk-RMAWSG7E.js} +19172 -25717
- package/dist/{chunk-XYBU3WZH.js → chunk-RTW5VRTK.js} +3 -3
- package/dist/chunk-U7PTOA3U.js +7320 -0
- package/dist/chunk-UY6ANCOY.js +378 -0
- package/dist/{chunk-ATK45BXV.js → chunk-X7ZUTKHR.js} +4 -2
- package/dist/circleci-BQ2UWXL2.js +389 -0
- package/dist/clerk-2JYWQNOI.js +1019 -0
- package/dist/cohere-6MI7AQM4.js +185 -0
- package/dist/{confluence-B3EWPZVE.js → confluence-6Y6GDETF.js} +105 -104
- package/dist/{convertapi-EUWSQYPF.js → convertapi-HBZCSWOX.js} +32 -31
- package/dist/{currencyapi-KVTIK3GL.js → currencyapi-337U5TGI.js} +71 -71
- package/dist/deepseek-OSPASO7O.js +210 -0
- package/dist/docker_hub-3ATQOY5L.js +933 -0
- package/dist/dropbox-LSA4GM2Y.js +1305 -0
- package/dist/dub-VZPJSPI6.js +680 -0
- package/dist/e2b-6SDYQZL2.js +278 -0
- package/dist/exa-B6EUYDVP.js +332 -0
- package/dist/{fal_ai-23E7JPNT.js → fal_ai-K4Q27IME.js} +81 -80
- package/dist/{feishu-7QRIDUV6.js → feishu-4TKXG4SU.js} +528 -572
- package/dist/{feishu_custom_bot-TJ4K7QNJ.js → feishu_custom_bot-7CTEAKRB.js} +57 -53
- package/dist/figma-OUKSZLD5.js +777 -0
- package/dist/firehydrant-7MOYL7QH.js +563 -0
- package/dist/{fixer-BWON27UO.js → fixer-H2BV2NO4.js} +34 -33
- package/dist/fly-PXKY6PNH.js +469 -0
- package/dist/{front-QCGXYEDJ.js → front-UZYIV5DW.js} +104 -104
- package/dist/geocodio-NSYO7TFP.js +213 -0
- package/dist/ghost-QBKKQQMF.js +338 -0
- package/dist/github-ENLSJ4CL.js +5421 -0
- package/dist/gmail-KQSDEB47.js +1887 -0
- package/dist/googlecalendar-5YCX4SZF.js +2524 -0
- package/dist/{googledocs-BUHL4J2H.js → googledocs-SSWIVFKA.js} +341 -340
- package/dist/{grafana-GLU2DWF2.js → grafana-TF2LXDQA.js} +221 -220
- package/dist/graphhopper-CURBVHYK.js +325 -0
- package/dist/index.d.ts +1132 -332
- package/dist/index.js +31 -14
- package/dist/{ip2proxy-EZ64Y4ZH.js → ip2proxy-YNVMTZEM.js} +28 -27
- package/dist/ipgeolocation_io-NAU7VJ4J.js +315 -0
- package/dist/ipqualityscore-OT63L4TI.js +279 -0
- package/dist/{jina_ai-EFBHTBXL.js → jina_ai-6WBMBGWM.js} +23 -23
- package/dist/{jira-HQSHAA5K.js → jira-DVDVTHNO.js} +118 -117
- package/dist/langsmith-IM5N4YAU.js +593 -0
- package/dist/lemlist-277SHUQF.js +289 -0
- package/dist/{linear-K7RYFYAD.js → linear-AEPH7B5V.js} +327 -326
- package/dist/logsnag-VEWRAGBG.js +150 -0
- package/dist/main.js +57 -280
- package/dist/{mattermost-S2BRCWLQ.js → mattermost-Q3A2BIZA.js} +59 -58
- package/dist/mem0-AXS7GZGI.js +544 -0
- package/dist/memos-7TXG4ZTU.js +744 -0
- package/dist/{metabase-MMSEPCOF.js → metabase-NSVACWQM.js} +90 -89
- package/dist/mistral_ai-YZ52RGD4.js +1196 -0
- package/dist/{mother_duck-H7PCQNZ2.js → mother_duck-XLLL6FVL.js} +94 -93
- package/dist/ngrok-4O4W3WZW.js +356 -0
- package/dist/{notes-PFMKRO33.js → notes-YTB3TJOO.js} +11 -9
- package/dist/notion-4W4O7J7V.js +940 -0
- package/dist/open_exchange_rates-23QJXVO5.js +215 -0
- package/dist/openai-ZS7GLSLH.js +800 -0
- package/dist/opengraph_io-PMVH7OYI.js +362 -0
- package/dist/openrouter-ONRGFNB6.js +441 -0
- package/dist/outline-UCUYZZ7J.js +599 -0
- package/dist/paddle-35HTKTUL.js +454 -0
- package/dist/perplexity-NVOBYN24.js +220 -0
- package/dist/pinecone-55CJY73C.js +571 -0
- package/dist/{pipedrive-Y2O7QGFF.js → pipedrive-WMCAKS72.js} +99 -98
- package/dist/polar-SM4ZM53B.js +395 -0
- package/dist/posthog-NWCXVXNJ.js +3464 -0
- package/dist/postmark-QJV5PHUQ.js +427 -0
- package/dist/{prerender-MENYM2TY.js → prerender-2W7UT4SC.js} +31 -30
- package/dist/{pubmed-GOXUVVH5.js → pubmed-VVV7XYLU.js} +239 -238
- package/dist/{railway-V2SID4WV.js → railway-KGI57S3O.js} +118 -117
- package/dist/readwise-AGHTQB42.js +470 -0
- package/dist/render-O4HBROCK.js +461 -0
- package/dist/{replicate-756MXPYX.js → replicate-KWBOMX7D.js} +81 -80
- package/dist/{resend-ZKH3BTBI.js → resend-DRH6Y6I4.js} +20 -16
- package/dist/rootly-XGCUDW6X.js +336 -0
- package/dist/{scrapfly-NSRHFDIQ.js → scrapfly-OIQ3OY6L.js} +62 -61
- package/dist/{scrapingbee-OQHLAVEY.js → scrapingbee-OCZO4FHX.js} +56 -56
- package/dist/{screenshot_fyi-DVWG3AXC.js → screenshot_fyi-CUNGFZOC.js} +16 -16
- package/dist/semantic_scholar-3UJRLKES.js +611 -0
- package/dist/{sentry-546MNDJG.js → sentry-5BWVZFJV.js} +208 -207
- package/dist/{shodan-C3OON3Z3.js → shodan-HI37CTEW.js} +62 -61
- package/dist/shopify-LJ2EV2HH.js +610 -0
- package/dist/stripe-3LHMV55K.js +585 -0
- package/dist/{supabase-U2SL4D63.js → supabase-H2KPX3Q2.js} +245 -244
- package/dist/tavily-FBEWGH3Z.js +326 -0
- package/dist/telegram-MYYO3JND.js +1767 -0
- package/dist/{telnyx-CXQ4EZUX.js → telnyx-H4ALEGAX.js} +57 -56
- package/dist/todoist-OBWICA5Q.js +664 -0
- package/dist/trello-GUFUJRWO.js +1080 -0
- package/dist/turso-NIAK4UMS.js +416 -0
- package/dist/{twilio-4PDBJKWX.js → twilio-K6SLK2CX.js} +70 -69
- package/dist/umami-42RS2EPS.js +389 -0
- package/dist/unsplash-V7TOTETT.js +351 -0
- package/dist/{upstash_redis-G4LQBYHA.js → upstash_redis-AWQMB6Y3.js} +51 -50
- package/dist/uptimerobot-AZC2DHOT.js +483 -0
- package/dist/v2ex-4TVRNMLS.js +667 -0
- package/dist/vercel-DPHTJ3XR.js +1076 -0
- package/dist/{wolfram_alpha_api-3G4PUJWB.js → wolfram_alpha_api-XAG7IXBW.js} +36 -35
- package/dist/wordpress-KMPKVGUX.js +812 -0
- package/dist/workos-PKB2YR7S.js +664 -0
- package/dist/zhihu-Y4H4XYPB.js +254 -0
- package/package.json +18 -9
- package/dist/airtable-LLZDFN7M.js +0 -789
- package/dist/anthropic-G23NN3X5.js +0 -202
- package/dist/apify-Y3SS734K.js +0 -247
- package/dist/brave_search-ZC7OAPSZ.js +0 -301
- package/dist/chunk-R6P4XAE5.js +0 -248
- package/dist/chunk-U7B6DS2O.js +0 -977
- package/dist/chunk-UZM2RXZH.js +0 -23436
- package/dist/circleci-3BAX5FCG.js +0 -388
- package/dist/clerk-6LEM6TNU.js +0 -1019
- package/dist/cloudflare_dns-KINYTJUD.js +0 -588
- package/dist/cohere-XCJ5AJ6B.js +0 -185
- package/dist/deepseek-PC5YGNC5.js +0 -209
- package/dist/docker_hub-C3MA5FU6.js +0 -932
- package/dist/dropbox-XBV7Z2IR.js +0 -1304
- package/dist/dub-LDOFG3HC.js +0 -679
- package/dist/e2b-JMCPSVBW.js +0 -277
- package/dist/exa-RAK7O7RD.js +0 -331
- package/dist/figma-E6IX5DTH.js +0 -773
- package/dist/firehydrant-ZBLPQREE.js +0 -562
- package/dist/fly-ZH3HFCZJ.js +0 -468
- package/dist/geocodio-YGNI7DA4.js +0 -212
- package/dist/ghost-EVSGKH2Q.js +0 -337
- package/dist/github-MA2BGRCJ.js +0 -5420
- package/dist/gmail-E5E6AADE.js +0 -1886
- package/dist/googlecalendar-BTLFPXTD.js +0 -2523
- package/dist/graphhopper-WSMB3TCD.js +0 -324
- package/dist/ipgeolocation_io-AA7HAS22.js +0 -315
- package/dist/ipqualityscore-BHJXVTJT.js +0 -277
- package/dist/langsmith-5W6SCT6F.js +0 -592
- package/dist/lemlist-HJWH6UMK.js +0 -288
- package/dist/logsnag-4KFOHL37.js +0 -150
- package/dist/mem0-CAW43CIC.js +0 -543
- package/dist/memos-TWEGPKFM.js +0 -740
- package/dist/mistral_ai-64BGZQHP.js +0 -1195
- package/dist/ngrok-GQCUGZKJ.js +0 -356
- package/dist/notion-DQWZWP4N.js +0 -936
- package/dist/open_exchange_rates-QMMD735E.js +0 -214
- package/dist/openai-W6PX32NZ.js +0 -799
- package/dist/opengraph_io-HNDBXYNW.js +0 -361
- package/dist/openrouter-JJYMEAUL.js +0 -437
- package/dist/outline-MCBNQZYY.js +0 -595
- package/dist/paddle-D2SKLUDN.js +0 -453
- package/dist/perplexity-XIFMKUAE.js +0 -219
- package/dist/pinecone-HUFTALV2.js +0 -570
- package/dist/polar-TYTOMOSR.js +0 -394
- package/dist/posthog-43JAR3VW.js +0 -3463
- package/dist/postmark-KL2QJYSG.js +0 -426
- package/dist/readwise-CI4GIMMJ.js +0 -469
- package/dist/render-SUBJ6YRZ.js +0 -460
- package/dist/rootly-CD2LJHPI.js +0 -336
- package/dist/semantic_scholar-T4A252KW.js +0 -610
- package/dist/shopify-Y2HN2MCQ.js +0 -609
- package/dist/stripe-VE3CD3AY.js +0 -584
- package/dist/tavily-KCZHK6HE.js +0 -326
- package/dist/telegram-3URFBCMY.js +0 -1766
- package/dist/todoist-HNPWNYTD.js +0 -663
- package/dist/trello-3W2MIXRP.js +0 -1079
- package/dist/turso-2EQF7C2Z.js +0 -415
- package/dist/umami-5REN7TGP.js +0 -388
- package/dist/unsplash-EIXL424F.js +0 -350
- package/dist/uptimerobot-KNJ3EYLY.js +0 -482
- package/dist/v2ex-RHJ234PZ.js +0 -666
- package/dist/vercel-AS6NCIC7.js +0 -1075
- package/dist/wordpress-KNDAAUV7.js +0 -811
- package/dist/workos-R6UITSJ7.js +0 -663
- package/dist/zhihu-AGK4HILK.js +0 -253
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createAuthedClient
|
|
3
|
+
} from "./chunk-RTW5VRTK.js";
|
|
4
|
+
import "./chunk-BNMLA2RC.js";
|
|
5
|
+
import {
|
|
6
|
+
asJsonObject,
|
|
7
|
+
trimmedText
|
|
8
|
+
} from "./chunk-JXHMDBAY.js";
|
|
9
|
+
import {
|
|
10
|
+
createProviderPlugin,
|
|
11
|
+
upstreamError
|
|
12
|
+
} from "./chunk-X7ZUTKHR.js";
|
|
13
|
+
import "./chunk-7ISGFRC6.js";
|
|
14
|
+
import "./chunk-UY6ANCOY.js";
|
|
15
|
+
import {
|
|
16
|
+
TBError
|
|
17
|
+
} from "./chunk-HA4BGL6C.js";
|
|
18
|
+
import "./chunk-U67V476Y.js";
|
|
19
|
+
|
|
20
|
+
// ../plugins/src/umami/api.ts
|
|
21
|
+
var SERVICE = "umami";
|
|
22
|
+
var API_BASE = "https://api.umami.is";
|
|
23
|
+
var http = createAuthedClient({
|
|
24
|
+
baseUrl: `${API_BASE}/`,
|
|
25
|
+
service: SERVICE,
|
|
26
|
+
auth: { kind: "bearer" },
|
|
27
|
+
headers: { accept: "application/json" },
|
|
28
|
+
errorMessage: {
|
|
29
|
+
// 错误消息藏在 `error`(字符串或对象)与 `message` 三处之一,纯文本体则整段拿来用。
|
|
30
|
+
keys: ["error", "error.message", "message"],
|
|
31
|
+
fallback: (status, statusText) => statusText || `umami \u8FD4\u56DE HTTP ${status}`
|
|
32
|
+
},
|
|
33
|
+
mapTransportError: ({ message }) => upstreamError(
|
|
34
|
+
502,
|
|
35
|
+
message === void 0 ? "umami \u8BF7\u6C42\u5931\u8D25" : `umami \u8BF7\u6C42\u5931\u8D25: ${message}`
|
|
36
|
+
)
|
|
37
|
+
});
|
|
38
|
+
function requiredText(value, field) {
|
|
39
|
+
const text = trimmedText(value);
|
|
40
|
+
if (text === void 0) throw new TBError("invalid_argument", `${field} \u4E0D\u80FD\u4E3A\u7A7A`);
|
|
41
|
+
return text;
|
|
42
|
+
}
|
|
43
|
+
async function request(ctx, path, query = {}) {
|
|
44
|
+
const response = await http.request(ctx, {
|
|
45
|
+
path,
|
|
46
|
+
query: Object.entries(query),
|
|
47
|
+
invalidJson: "text"
|
|
48
|
+
});
|
|
49
|
+
if (response.bodyKind === "invalid-json") throw upstreamError(502, "umami \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94");
|
|
50
|
+
return response.bodyKind === "empty" ? null : response.data;
|
|
51
|
+
}
|
|
52
|
+
function responseRecord(value, field) {
|
|
53
|
+
const object = asJsonObject(value);
|
|
54
|
+
if (object === void 0) throw upstreamError(502, `umami \u54CD\u5E94\u7684 ${field} \u4E0D\u662F\u5BF9\u8C61`);
|
|
55
|
+
return object;
|
|
56
|
+
}
|
|
57
|
+
function responseArray(value, field) {
|
|
58
|
+
if (!Array.isArray(value)) throw upstreamError(502, `umami \u54CD\u5E94\u7684 ${field} \u4E0D\u662F\u6570\u7EC4`);
|
|
59
|
+
return value;
|
|
60
|
+
}
|
|
61
|
+
function objectArray(value, field) {
|
|
62
|
+
return responseArray(value, field).map((item) => responseRecord(item, `${field} \u5217\u8868\u9879`));
|
|
63
|
+
}
|
|
64
|
+
function responseInteger(value, field, min) {
|
|
65
|
+
if (typeof value !== "number" || !Number.isInteger(value) || value < min) {
|
|
66
|
+
throw upstreamError(502, `umami \u54CD\u5E94\u7684 ${field} \u4E0D\u662F\u5408\u6CD5\u6574\u6570`);
|
|
67
|
+
}
|
|
68
|
+
return value;
|
|
69
|
+
}
|
|
70
|
+
function dateRangeQuery(input) {
|
|
71
|
+
return {
|
|
72
|
+
startAt: String(input.startAt),
|
|
73
|
+
endAt: String(input.endAt),
|
|
74
|
+
timezone: requiredText(input.timezone, "timezone"),
|
|
75
|
+
url: trimmedText(input.url),
|
|
76
|
+
referrer: trimmedText(input.referrer),
|
|
77
|
+
title: trimmedText(input.title),
|
|
78
|
+
host: trimmedText(input.host),
|
|
79
|
+
os: trimmedText(input.os),
|
|
80
|
+
browser: trimmedText(input.browser),
|
|
81
|
+
device: trimmedText(input.device),
|
|
82
|
+
country: trimmedText(input.country),
|
|
83
|
+
region: trimmedText(input.region),
|
|
84
|
+
city: trimmedText(input.city)
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function websitePath(websiteId, suffix = "") {
|
|
88
|
+
return `/api/websites/${encodeURIComponent(requiredText(websiteId, "websiteId"))}${suffix}`;
|
|
89
|
+
}
|
|
90
|
+
function paginated(payload, listKey) {
|
|
91
|
+
const envelope = responseRecord(payload, "\u5206\u9875");
|
|
92
|
+
return {
|
|
93
|
+
[listKey]: objectArray(envelope.data, "data"),
|
|
94
|
+
count: responseInteger(envelope.count, "count", 0),
|
|
95
|
+
page: responseInteger(envelope.page, "page", 1),
|
|
96
|
+
pageSize: responseInteger(envelope.pageSize, "pageSize", 1),
|
|
97
|
+
raw: envelope
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
async function getCurrentUser(_input, ctx) {
|
|
101
|
+
const user = responseRecord(await request(ctx, "/api/me"), "user");
|
|
102
|
+
return { user, raw: user };
|
|
103
|
+
}
|
|
104
|
+
async function listWebsites(input, ctx) {
|
|
105
|
+
const payload = await request(ctx, "/api/websites", {
|
|
106
|
+
query: trimmedText(input.query),
|
|
107
|
+
page: input.page === void 0 ? void 0 : String(input.page),
|
|
108
|
+
pageSize: input.pageSize === void 0 ? void 0 : String(input.pageSize)
|
|
109
|
+
});
|
|
110
|
+
return paginated(payload, "websites");
|
|
111
|
+
}
|
|
112
|
+
async function getWebsite(input, ctx) {
|
|
113
|
+
const website = responseRecord(await request(ctx, websitePath(input.websiteId)), "website");
|
|
114
|
+
return { website, raw: website };
|
|
115
|
+
}
|
|
116
|
+
async function getWebsiteStats(input, ctx) {
|
|
117
|
+
const path = websitePath(input.websiteId, "/stats");
|
|
118
|
+
const stats = responseRecord(await request(ctx, path, dateRangeQuery(input)), "stats");
|
|
119
|
+
return { stats, raw: stats };
|
|
120
|
+
}
|
|
121
|
+
async function getPageviews(input, ctx) {
|
|
122
|
+
const path = websitePath(input.websiteId, "/pageviews");
|
|
123
|
+
const query = { ...dateRangeQuery(input), unit: trimmedText(input.unit) };
|
|
124
|
+
const pageviews = responseRecord(await request(ctx, path, query), "pageviews");
|
|
125
|
+
return { pageviews, raw: pageviews };
|
|
126
|
+
}
|
|
127
|
+
async function getMetrics(input, ctx) {
|
|
128
|
+
const path = websitePath(input.websiteId, "/metrics");
|
|
129
|
+
const query = {
|
|
130
|
+
...dateRangeQuery(input),
|
|
131
|
+
type: requiredText(input.type, "type"),
|
|
132
|
+
limit: input.limit === void 0 ? void 0 : String(input.limit)
|
|
133
|
+
};
|
|
134
|
+
const payload = await request(ctx, path, query);
|
|
135
|
+
return { metrics: objectArray(payload, "metrics"), raw: responseArray(payload, "metrics") };
|
|
136
|
+
}
|
|
137
|
+
async function getRealtime(input, ctx) {
|
|
138
|
+
const path = `/api/realtime/${encodeURIComponent(requiredText(input.websiteId, "websiteId"))}`;
|
|
139
|
+
const realtime = responseRecord(await request(ctx, path), "realtime");
|
|
140
|
+
return { realtime, raw: realtime };
|
|
141
|
+
}
|
|
142
|
+
async function listEvents(input, ctx) {
|
|
143
|
+
const path = websitePath(input.websiteId, "/events");
|
|
144
|
+
const query = {
|
|
145
|
+
...dateRangeQuery(input),
|
|
146
|
+
query: trimmedText(input.query),
|
|
147
|
+
page: input.page === void 0 ? void 0 : String(input.page),
|
|
148
|
+
pageSize: input.pageSize === void 0 ? void 0 : String(input.pageSize)
|
|
149
|
+
};
|
|
150
|
+
return paginated(await request(ctx, path, query), "events");
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// ../plugins/src/umami/schema.ts
|
|
154
|
+
import { z } from "zod/v4";
|
|
155
|
+
var getCurrentUserInput = z.strictObject({}).describe("No input is required to get the current Umami user.");
|
|
156
|
+
var getCurrentUserOutput = z.strictObject({
|
|
157
|
+
user: z.looseObject({
|
|
158
|
+
id: z.string().describe("User ID.").optional(),
|
|
159
|
+
username: z.string().describe("Username.").optional(),
|
|
160
|
+
role: z.string().describe("User role.").optional(),
|
|
161
|
+
isAdmin: z.boolean().describe("Whether the user has administrator privileges.").optional()
|
|
162
|
+
}).describe("Umami user profile."),
|
|
163
|
+
raw: z.looseObject({}).describe("Raw Umami response payload.")
|
|
164
|
+
}).describe("Current Umami user response.");
|
|
165
|
+
var listWebsitesInput = z.strictObject({
|
|
166
|
+
query: z.string().describe("Search query filter for the endpoint.").optional(),
|
|
167
|
+
page: z.int().min(1).describe("One-based page number for paginated Umami endpoints.").optional(),
|
|
168
|
+
pageSize: z.int().min(1).describe("Number of items to return per page.").optional()
|
|
169
|
+
}).describe("Optional pagination and search parameters for listing Umami websites.");
|
|
170
|
+
var listWebsitesOutput = z.strictObject({
|
|
171
|
+
websites: z.array(z.looseObject({
|
|
172
|
+
id: z.string().describe("Website ID.").optional(),
|
|
173
|
+
name: z.string().describe("Website name.").optional(),
|
|
174
|
+
domain: z.string().describe("Website domain.").optional(),
|
|
175
|
+
shareId: z.string().describe("Public share ID when sharing is enabled.").nullable().optional()
|
|
176
|
+
}).describe("Umami website.")).describe("Websites returned by Umami."),
|
|
177
|
+
count: z.int().min(0).describe("Total number of websites matching the query."),
|
|
178
|
+
page: z.int().min(1).describe("Current page number."),
|
|
179
|
+
pageSize: z.int().min(1).describe("Page size used by Umami."),
|
|
180
|
+
raw: z.looseObject({
|
|
181
|
+
data: z.array(z.looseObject({
|
|
182
|
+
id: z.string().describe("Website ID.").optional(),
|
|
183
|
+
name: z.string().describe("Website name.").optional(),
|
|
184
|
+
domain: z.string().describe("Website domain.").optional(),
|
|
185
|
+
shareId: z.string().describe("Public share ID when sharing is enabled.").nullable().optional()
|
|
186
|
+
}).describe("Umami website.")).describe("Websites returned by Umami.").optional(),
|
|
187
|
+
count: z.int().min(0).describe("Total number of websites matching the query.").optional(),
|
|
188
|
+
page: z.int().min(1).describe("Current page number.").optional(),
|
|
189
|
+
pageSize: z.int().min(1).describe("Page size used by Umami.").optional()
|
|
190
|
+
}).describe("Paginated Umami websites response.")
|
|
191
|
+
}).describe("Umami website list response.");
|
|
192
|
+
var getWebsiteInput = z.strictObject({
|
|
193
|
+
websiteId: z.string().min(1).describe("The Umami website ID.")
|
|
194
|
+
}).describe("Request parameters for retrieving an Umami website.");
|
|
195
|
+
var getWebsiteOutput = z.strictObject({
|
|
196
|
+
website: z.looseObject({
|
|
197
|
+
id: z.string().describe("Website ID.").optional(),
|
|
198
|
+
name: z.string().describe("Website name.").optional(),
|
|
199
|
+
domain: z.string().describe("Website domain.").optional(),
|
|
200
|
+
shareId: z.string().describe("Public share ID when sharing is enabled.").nullable().optional()
|
|
201
|
+
}).describe("Umami website."),
|
|
202
|
+
raw: z.looseObject({}).describe("Raw Umami response payload.")
|
|
203
|
+
}).describe("Umami website response.");
|
|
204
|
+
var getWebsiteStatsInput = z.strictObject({
|
|
205
|
+
websiteId: z.string().min(1).describe("The Umami website ID."),
|
|
206
|
+
startAt: z.int().min(0).describe("Start timestamp in milliseconds since the Unix epoch."),
|
|
207
|
+
endAt: z.int().min(0).describe("End timestamp in milliseconds since the Unix epoch."),
|
|
208
|
+
timezone: z.string().min(1).describe("IANA timezone name used by Umami for date grouping."),
|
|
209
|
+
url: z.string().describe("URL path filter for the query.").optional(),
|
|
210
|
+
referrer: z.string().describe("Referrer filter for the query.").optional(),
|
|
211
|
+
title: z.string().describe("Page title filter for the query.").optional(),
|
|
212
|
+
host: z.string().describe("Host filter for the query.").optional(),
|
|
213
|
+
os: z.string().describe("Operating system filter for the query.").optional(),
|
|
214
|
+
browser: z.string().describe("Browser filter for the query.").optional(),
|
|
215
|
+
device: z.string().describe("Device filter for the query.").optional(),
|
|
216
|
+
country: z.string().describe("Country filter for the query.").optional(),
|
|
217
|
+
region: z.string().describe("Region filter for the query.").optional(),
|
|
218
|
+
city: z.string().describe("City filter for the query.").optional()
|
|
219
|
+
}).describe("Request parameters for retrieving Umami website statistics.");
|
|
220
|
+
var getWebsiteStatsOutput = z.strictObject({
|
|
221
|
+
stats: z.looseObject({
|
|
222
|
+
pageviews: z.unknown().describe("Pageview count or comparison object returned by Umami.").optional(),
|
|
223
|
+
visitors: z.unknown().describe("Visitor count or comparison object returned by Umami.").optional(),
|
|
224
|
+
visits: z.unknown().describe("Visit count or comparison object returned by Umami.").optional(),
|
|
225
|
+
bounces: z.unknown().describe("Bounce count or comparison object returned by Umami.").optional(),
|
|
226
|
+
totaltime: z.unknown().describe("Total time count or comparison object returned by Umami.").optional()
|
|
227
|
+
}).describe("Umami website statistics."),
|
|
228
|
+
raw: z.looseObject({}).describe("Raw Umami response payload.")
|
|
229
|
+
}).describe("Umami website statistics response.");
|
|
230
|
+
var getPageviewsInput = z.strictObject({
|
|
231
|
+
websiteId: z.string().min(1).describe("The Umami website ID."),
|
|
232
|
+
startAt: z.int().min(0).describe("Start timestamp in milliseconds since the Unix epoch."),
|
|
233
|
+
endAt: z.int().min(0).describe("End timestamp in milliseconds since the Unix epoch."),
|
|
234
|
+
timezone: z.string().min(1).describe("IANA timezone name used by Umami for date grouping."),
|
|
235
|
+
url: z.string().describe("URL path filter for the query.").optional(),
|
|
236
|
+
referrer: z.string().describe("Referrer filter for the query.").optional(),
|
|
237
|
+
title: z.string().describe("Page title filter for the query.").optional(),
|
|
238
|
+
host: z.string().describe("Host filter for the query.").optional(),
|
|
239
|
+
os: z.string().describe("Operating system filter for the query.").optional(),
|
|
240
|
+
browser: z.string().describe("Browser filter for the query.").optional(),
|
|
241
|
+
device: z.string().describe("Device filter for the query.").optional(),
|
|
242
|
+
country: z.string().describe("Country filter for the query.").optional(),
|
|
243
|
+
region: z.string().describe("Region filter for the query.").optional(),
|
|
244
|
+
city: z.string().describe("City filter for the query.").optional(),
|
|
245
|
+
unit: z.enum(["hour", "day", "month", "year"]).describe("Time unit used for timeseries grouping.").optional()
|
|
246
|
+
}).describe("Request parameters for retrieving Umami pageview timeseries.");
|
|
247
|
+
var getPageviewsOutput = z.strictObject({
|
|
248
|
+
pageviews: z.looseObject({}).describe("Raw Umami response payload."),
|
|
249
|
+
raw: z.looseObject({}).describe("Raw Umami response payload.")
|
|
250
|
+
}).describe("Umami pageview timeseries response.");
|
|
251
|
+
var getMetricsInput = z.strictObject({
|
|
252
|
+
websiteId: z.string().min(1).describe("The Umami website ID."),
|
|
253
|
+
startAt: z.int().min(0).describe("Start timestamp in milliseconds since the Unix epoch."),
|
|
254
|
+
endAt: z.int().min(0).describe("End timestamp in milliseconds since the Unix epoch."),
|
|
255
|
+
timezone: z.string().min(1).describe("IANA timezone name used by Umami for date grouping."),
|
|
256
|
+
url: z.string().describe("URL path filter for the query.").optional(),
|
|
257
|
+
referrer: z.string().describe("Referrer filter for the query.").optional(),
|
|
258
|
+
title: z.string().describe("Page title filter for the query.").optional(),
|
|
259
|
+
host: z.string().describe("Host filter for the query.").optional(),
|
|
260
|
+
os: z.string().describe("Operating system filter for the query.").optional(),
|
|
261
|
+
browser: z.string().describe("Browser filter for the query.").optional(),
|
|
262
|
+
device: z.string().describe("Device filter for the query.").optional(),
|
|
263
|
+
country: z.string().describe("Country filter for the query.").optional(),
|
|
264
|
+
region: z.string().describe("Region filter for the query.").optional(),
|
|
265
|
+
city: z.string().describe("City filter for the query.").optional(),
|
|
266
|
+
type: z.enum(["url", "referrer", "browser", "os", "device", "country", "region", "city", "language", "event"]).describe("Website metric dimension to return."),
|
|
267
|
+
limit: z.int().min(1).describe("Maximum number of metric rows to return.").optional()
|
|
268
|
+
}).describe("Request parameters for retrieving grouped Umami website metrics.");
|
|
269
|
+
var getMetricsOutput = z.strictObject({
|
|
270
|
+
metrics: z.array(z.looseObject({
|
|
271
|
+
x: z.unknown().describe("Metric dimension value returned by Umami.").optional(),
|
|
272
|
+
y: z.number().describe("Metric count returned by Umami.").optional()
|
|
273
|
+
}).describe("Umami metric row.")).describe("Metric rows returned by Umami."),
|
|
274
|
+
raw: z.array(z.unknown().describe("Raw Umami array item.")).describe("Raw Umami response array.")
|
|
275
|
+
}).describe("Umami website metrics response.");
|
|
276
|
+
var getRealtimeInput = z.strictObject({
|
|
277
|
+
websiteId: z.string().min(1).describe("The Umami website ID.")
|
|
278
|
+
}).describe("Request parameters for retrieving Umami realtime data.");
|
|
279
|
+
var getRealtimeOutput = z.strictObject({
|
|
280
|
+
realtime: z.looseObject({}).describe("Raw Umami response payload."),
|
|
281
|
+
raw: z.looseObject({}).describe("Raw Umami response payload.")
|
|
282
|
+
}).describe("Umami realtime response.");
|
|
283
|
+
var listEventsInput = z.strictObject({
|
|
284
|
+
websiteId: z.string().min(1).describe("The Umami website ID."),
|
|
285
|
+
startAt: z.int().min(0).describe("Start timestamp in milliseconds since the Unix epoch."),
|
|
286
|
+
endAt: z.int().min(0).describe("End timestamp in milliseconds since the Unix epoch."),
|
|
287
|
+
timezone: z.string().min(1).describe("IANA timezone name used by Umami for date grouping."),
|
|
288
|
+
url: z.string().describe("URL path filter for the query.").optional(),
|
|
289
|
+
referrer: z.string().describe("Referrer filter for the query.").optional(),
|
|
290
|
+
title: z.string().describe("Page title filter for the query.").optional(),
|
|
291
|
+
host: z.string().describe("Host filter for the query.").optional(),
|
|
292
|
+
os: z.string().describe("Operating system filter for the query.").optional(),
|
|
293
|
+
browser: z.string().describe("Browser filter for the query.").optional(),
|
|
294
|
+
device: z.string().describe("Device filter for the query.").optional(),
|
|
295
|
+
country: z.string().describe("Country filter for the query.").optional(),
|
|
296
|
+
region: z.string().describe("Region filter for the query.").optional(),
|
|
297
|
+
city: z.string().describe("City filter for the query.").optional(),
|
|
298
|
+
query: z.string().describe("Search query filter for the endpoint.").optional(),
|
|
299
|
+
page: z.int().min(1).describe("One-based page number for paginated Umami endpoints.").optional(),
|
|
300
|
+
pageSize: z.int().min(1).describe("Number of items to return per page.").optional()
|
|
301
|
+
}).describe("Request parameters for listing Umami events.");
|
|
302
|
+
var listEventsOutput = z.strictObject({
|
|
303
|
+
events: z.array(z.looseObject({
|
|
304
|
+
id: z.string().describe("Event ID.").optional(),
|
|
305
|
+
websiteId: z.string().describe("Website ID.").optional(),
|
|
306
|
+
sessionId: z.string().describe("Session ID.").optional(),
|
|
307
|
+
eventName: z.string().describe("Event name.").optional(),
|
|
308
|
+
urlPath: z.string().describe("URL path associated with the event.").optional(),
|
|
309
|
+
createdAt: z.string().describe("Event creation timestamp returned by Umami.").optional()
|
|
310
|
+
}).describe("Umami event row.")).describe("Events returned by Umami."),
|
|
311
|
+
count: z.int().min(0).describe("Total number of events matching the query."),
|
|
312
|
+
page: z.int().min(1).describe("Current page number."),
|
|
313
|
+
pageSize: z.int().min(1).describe("Page size used by Umami."),
|
|
314
|
+
raw: z.looseObject({}).describe("Raw Umami event list response.")
|
|
315
|
+
}).describe("Umami event list response.");
|
|
316
|
+
var umamiActions = {
|
|
317
|
+
get_current_user: {
|
|
318
|
+
description: "Get the current Umami user for the configured API token.",
|
|
319
|
+
effect: "read",
|
|
320
|
+
inputSchema: getCurrentUserInput,
|
|
321
|
+
outputSchema: z.toJSONSchema(getCurrentUserOutput, { io: "output", unrepresentable: "any" })
|
|
322
|
+
},
|
|
323
|
+
list_websites: {
|
|
324
|
+
description: "List Umami websites available to the configured API token.",
|
|
325
|
+
effect: "read",
|
|
326
|
+
inputSchema: listWebsitesInput,
|
|
327
|
+
outputSchema: z.toJSONSchema(listWebsitesOutput, { io: "output", unrepresentable: "any" })
|
|
328
|
+
},
|
|
329
|
+
get_website: {
|
|
330
|
+
description: "Get metadata for a single Umami website.",
|
|
331
|
+
effect: "read",
|
|
332
|
+
inputSchema: getWebsiteInput,
|
|
333
|
+
outputSchema: z.toJSONSchema(getWebsiteOutput, { io: "output", unrepresentable: "any" })
|
|
334
|
+
},
|
|
335
|
+
get_website_stats: {
|
|
336
|
+
description: "Get aggregate pageview, visitor, visit, bounce, and time statistics for a website.",
|
|
337
|
+
effect: "read",
|
|
338
|
+
inputSchema: getWebsiteStatsInput,
|
|
339
|
+
outputSchema: z.toJSONSchema(getWebsiteStatsOutput, { io: "output", unrepresentable: "any" })
|
|
340
|
+
},
|
|
341
|
+
get_pageviews: {
|
|
342
|
+
description: "Get Umami pageview and session timeseries for a website.",
|
|
343
|
+
effect: "read",
|
|
344
|
+
inputSchema: getPageviewsInput,
|
|
345
|
+
outputSchema: z.toJSONSchema(getPageviewsOutput, { io: "output", unrepresentable: "any" })
|
|
346
|
+
},
|
|
347
|
+
get_metrics: {
|
|
348
|
+
description: "Get grouped Umami website metrics such as URLs, referrers, browsers, or countries.",
|
|
349
|
+
effect: "read",
|
|
350
|
+
inputSchema: getMetricsInput,
|
|
351
|
+
outputSchema: z.toJSONSchema(getMetricsOutput, { io: "output", unrepresentable: "any" })
|
|
352
|
+
},
|
|
353
|
+
get_realtime: {
|
|
354
|
+
description: "Get realtime active visitor data for an Umami website.",
|
|
355
|
+
effect: "read",
|
|
356
|
+
inputSchema: getRealtimeInput,
|
|
357
|
+
outputSchema: z.toJSONSchema(getRealtimeOutput, { io: "output", unrepresentable: "any" })
|
|
358
|
+
},
|
|
359
|
+
list_events: {
|
|
360
|
+
description: "List tracked Umami events for a website within a time range.",
|
|
361
|
+
effect: "read",
|
|
362
|
+
inputSchema: listEventsInput,
|
|
363
|
+
outputSchema: z.toJSONSchema(listEventsOutput, { io: "output", unrepresentable: "any" })
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
// ../plugins/src/umami/index.ts
|
|
368
|
+
function createUmamiPlugin() {
|
|
369
|
+
return createProviderPlugin({
|
|
370
|
+
description: "Umami",
|
|
371
|
+
actions: umamiActions,
|
|
372
|
+
credentialProbe: "get_current_user",
|
|
373
|
+
handlers: {
|
|
374
|
+
get_current_user: getCurrentUser,
|
|
375
|
+
list_websites: listWebsites,
|
|
376
|
+
get_website: getWebsite,
|
|
377
|
+
get_website_stats: getWebsiteStats,
|
|
378
|
+
get_pageviews: getPageviews,
|
|
379
|
+
get_metrics: getMetrics,
|
|
380
|
+
get_realtime: getRealtime,
|
|
381
|
+
list_events: listEvents
|
|
382
|
+
}
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
var umami_default = createUmamiPlugin();
|
|
386
|
+
export {
|
|
387
|
+
createUmamiPlugin,
|
|
388
|
+
umami_default as default
|
|
389
|
+
};
|