@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,483 @@
|
|
|
1
|
+
import {
|
|
2
|
+
asJsonObject
|
|
3
|
+
} from "./chunk-JXHMDBAY.js";
|
|
4
|
+
import {
|
|
5
|
+
createProviderPlugin,
|
|
6
|
+
requireApiKey,
|
|
7
|
+
upstreamError
|
|
8
|
+
} from "./chunk-X7ZUTKHR.js";
|
|
9
|
+
import {
|
|
10
|
+
guardedFetch
|
|
11
|
+
} from "./chunk-7ISGFRC6.js";
|
|
12
|
+
import "./chunk-UY6ANCOY.js";
|
|
13
|
+
import {
|
|
14
|
+
TBError
|
|
15
|
+
} from "./chunk-HA4BGL6C.js";
|
|
16
|
+
import "./chunk-U67V476Y.js";
|
|
17
|
+
|
|
18
|
+
// ../plugins/src/uptimerobot/api.ts
|
|
19
|
+
var SERVICE = "uptimerobot";
|
|
20
|
+
var API_BASE = "https://api.uptimerobot.com/v2/";
|
|
21
|
+
function text(value) {
|
|
22
|
+
return typeof value === "string" && value !== "" ? value : void 0;
|
|
23
|
+
}
|
|
24
|
+
function integer(value) {
|
|
25
|
+
if (Number.isInteger(value)) return value;
|
|
26
|
+
if (typeof value === "string" && value.trim() !== "") {
|
|
27
|
+
const parsed = Number(value);
|
|
28
|
+
return Number.isInteger(parsed) ? parsed : void 0;
|
|
29
|
+
}
|
|
30
|
+
return void 0;
|
|
31
|
+
}
|
|
32
|
+
function toError(status, payload) {
|
|
33
|
+
const error = asJsonObject(asJsonObject(payload)?.error);
|
|
34
|
+
const message = text(error?.message) ?? (!status || status === 200 ? "uptimerobot request failed" : `uptimerobot request failed with status ${status}`);
|
|
35
|
+
const type = text(error?.type);
|
|
36
|
+
const httpStatus = status >= 400 ? status : void 0;
|
|
37
|
+
if (httpStatus === 429 || type?.includes("rate_limit") === true) return upstreamError(429, message);
|
|
38
|
+
if (httpStatus === 401 || httpStatus === 403 || type === "invalid_api_key") {
|
|
39
|
+
return upstreamError(httpStatus === 403 ? 403 : 401, message);
|
|
40
|
+
}
|
|
41
|
+
if (httpStatus !== void 0 && [400, 404, 422].includes(httpStatus)) return upstreamError(httpStatus, message);
|
|
42
|
+
if (type === "invalid_parameter") return upstreamError(400, message);
|
|
43
|
+
return upstreamError(httpStatus ?? 502, message);
|
|
44
|
+
}
|
|
45
|
+
async function readPayload(response) {
|
|
46
|
+
const body = await response.text().catch(() => "");
|
|
47
|
+
if (body === "") return void 0;
|
|
48
|
+
try {
|
|
49
|
+
return JSON.parse(body);
|
|
50
|
+
} catch {
|
|
51
|
+
throw upstreamError(502, "uptimerobot returned invalid JSON");
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
async function request(ctx, endpoint, body) {
|
|
55
|
+
const apiKey = requireApiKey(ctx, SERVICE);
|
|
56
|
+
const form = new URLSearchParams(body);
|
|
57
|
+
form.set("api_key", apiKey);
|
|
58
|
+
form.set("format", "json");
|
|
59
|
+
let response;
|
|
60
|
+
try {
|
|
61
|
+
response = await guardedFetch(new URL(endpoint, API_BASE).toString(), {
|
|
62
|
+
method: "POST",
|
|
63
|
+
headers: {
|
|
64
|
+
"accept": "application/json",
|
|
65
|
+
"content-type": "application/x-www-form-urlencoded"
|
|
66
|
+
},
|
|
67
|
+
body: form
|
|
68
|
+
});
|
|
69
|
+
} catch (error) {
|
|
70
|
+
throw upstreamError(
|
|
71
|
+
502,
|
|
72
|
+
error instanceof Error ? `uptimerobot request failed: ${error.message}` : "uptimerobot request failed"
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
const payload = await readPayload(response);
|
|
76
|
+
if (!response.ok) throw toError(response.status, payload);
|
|
77
|
+
const parsed = asJsonObject(payload);
|
|
78
|
+
if (parsed === void 0) throw upstreamError(502, "uptimerobot returned an invalid response payload");
|
|
79
|
+
if (parsed.stat !== "ok") throw toError(response.status, parsed);
|
|
80
|
+
return parsed;
|
|
81
|
+
}
|
|
82
|
+
function requireObjectPayload(value, label) {
|
|
83
|
+
const parsed = asJsonObject(value);
|
|
84
|
+
if (parsed === void 0) throw upstreamError(502, `${label} must be an object`);
|
|
85
|
+
return parsed;
|
|
86
|
+
}
|
|
87
|
+
function requireArrayPayload(value, label) {
|
|
88
|
+
if (!Array.isArray(value)) throw upstreamError(502, `${label} must be an array`);
|
|
89
|
+
return value;
|
|
90
|
+
}
|
|
91
|
+
function readPagination(payload) {
|
|
92
|
+
const limit = integer(payload.limit);
|
|
93
|
+
const offset = integer(payload.offset);
|
|
94
|
+
const total = integer(payload.total);
|
|
95
|
+
if (limit === void 0 && offset === void 0 && total === void 0) return null;
|
|
96
|
+
const pagination = {};
|
|
97
|
+
if (limit !== void 0) pagination.limit = limit;
|
|
98
|
+
if (offset !== void 0) pagination.offset = offset;
|
|
99
|
+
if (total !== void 0) pagination.total = total;
|
|
100
|
+
return pagination;
|
|
101
|
+
}
|
|
102
|
+
function setBoolean(form, key, value) {
|
|
103
|
+
if (typeof value === "boolean") form.set(key, value ? "1" : "0");
|
|
104
|
+
}
|
|
105
|
+
function setNumber(form, key, value) {
|
|
106
|
+
if (value !== void 0) form.set(key, String(value));
|
|
107
|
+
}
|
|
108
|
+
function setText(form, key, value) {
|
|
109
|
+
if (value !== void 0 && value !== "") form.set(key, value);
|
|
110
|
+
}
|
|
111
|
+
function setHyphenJoined(form, key, value) {
|
|
112
|
+
if (value !== void 0) form.set(key, value.join("-"));
|
|
113
|
+
}
|
|
114
|
+
function encodeAlertContacts(value) {
|
|
115
|
+
if (typeof value === "string") return value;
|
|
116
|
+
return value.map((item) => {
|
|
117
|
+
if (typeof item === "number") return `${item}_0_0`;
|
|
118
|
+
if (item.id === void 0) throw new TBError("invalid_argument", "alert_contacts.id must be a positive integer");
|
|
119
|
+
return `${item.id}_${item.threshold ?? 0}_${item.recurrence ?? 0}`;
|
|
120
|
+
}).join("-");
|
|
121
|
+
}
|
|
122
|
+
function buildMonitorMutationBody(input) {
|
|
123
|
+
const form = new URLSearchParams();
|
|
124
|
+
setText(form, "friendly_name", input.friendly_name);
|
|
125
|
+
setText(form, "url", input.url);
|
|
126
|
+
setNumber(form, "type", input.type);
|
|
127
|
+
setNumber(form, "sub_type", input.sub_type);
|
|
128
|
+
setNumber(form, "port", input.port);
|
|
129
|
+
setNumber(form, "interval", input.interval);
|
|
130
|
+
setNumber(form, "timeout", input.timeout);
|
|
131
|
+
setNumber(form, "keyword_type", input.keyword_type);
|
|
132
|
+
setText(form, "keyword_value", input.keyword_value);
|
|
133
|
+
setText(form, "http_username", input.http_username);
|
|
134
|
+
setText(form, "http_password", input.http_password);
|
|
135
|
+
setBoolean(form, "ssl", input.ssl);
|
|
136
|
+
if (input.alert_contacts !== void 0) form.set("alert_contacts", encodeAlertContacts(input.alert_contacts));
|
|
137
|
+
return form;
|
|
138
|
+
}
|
|
139
|
+
async function getAccountDetails(_input, ctx) {
|
|
140
|
+
const payload = await request(ctx, "getAccountDetails");
|
|
141
|
+
return { account: requireObjectPayload(payload.account, "uptimerobot account details response") };
|
|
142
|
+
}
|
|
143
|
+
async function listAlertContacts(_input, ctx) {
|
|
144
|
+
const payload = await request(ctx, "getAlertContacts");
|
|
145
|
+
return {
|
|
146
|
+
alert_contacts: requireArrayPayload(payload.alert_contacts, "uptimerobot alert contacts response"),
|
|
147
|
+
pagination: readPagination(payload)
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
async function listMonitors(input, ctx) {
|
|
151
|
+
const form = new URLSearchParams();
|
|
152
|
+
setNumber(form, "offset", input.offset);
|
|
153
|
+
setNumber(form, "limit", input.limit);
|
|
154
|
+
setText(form, "search", input.search);
|
|
155
|
+
setText(form, "sort", input.sort);
|
|
156
|
+
setHyphenJoined(form, "monitors", input.monitor_ids);
|
|
157
|
+
setHyphenJoined(form, "types", input.types);
|
|
158
|
+
setHyphenJoined(form, "statuses", input.statuses);
|
|
159
|
+
setBoolean(form, "logs", input.logs);
|
|
160
|
+
setBoolean(form, "alert_contacts", input.alert_contacts);
|
|
161
|
+
const payload = await request(ctx, "getMonitors", form);
|
|
162
|
+
return {
|
|
163
|
+
monitors: requireArrayPayload(payload.monitors, "uptimerobot monitors response"),
|
|
164
|
+
pagination: readPagination(payload)
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
async function getMonitor(input, ctx) {
|
|
168
|
+
const form = new URLSearchParams();
|
|
169
|
+
form.set("monitors", String(input.monitor_id));
|
|
170
|
+
setBoolean(form, "logs", input.logs);
|
|
171
|
+
setBoolean(form, "alert_contacts", input.alert_contacts);
|
|
172
|
+
const payload = await request(ctx, "getMonitors", form);
|
|
173
|
+
const monitors = requireArrayPayload(payload.monitors, "uptimerobot single monitor response");
|
|
174
|
+
const monitor = asJsonObject(monitors[0]);
|
|
175
|
+
if (monitor === void 0) throw upstreamError(404, `monitor ${input.monitor_id} was not found`);
|
|
176
|
+
return { monitor };
|
|
177
|
+
}
|
|
178
|
+
async function createMonitor(input, ctx) {
|
|
179
|
+
const payload = await request(ctx, "newMonitor", buildMonitorMutationBody(input));
|
|
180
|
+
return { monitor: requireObjectPayload(payload.monitor, "uptimerobot create monitor response") };
|
|
181
|
+
}
|
|
182
|
+
async function updateMonitor(input, ctx) {
|
|
183
|
+
const form = buildMonitorMutationBody(input);
|
|
184
|
+
form.set("id", String(input.monitor_id));
|
|
185
|
+
const payload = await request(ctx, "editMonitor", form);
|
|
186
|
+
return { monitor: requireObjectPayload(payload.monitor, "uptimerobot update monitor response") };
|
|
187
|
+
}
|
|
188
|
+
async function deleteMonitor(input, ctx) {
|
|
189
|
+
if (input.monitor_id === void 0) {
|
|
190
|
+
throw new TBError("invalid_argument", "monitor_id must be a positive integer");
|
|
191
|
+
}
|
|
192
|
+
const form = new URLSearchParams();
|
|
193
|
+
form.set("id", String(input.monitor_id));
|
|
194
|
+
const payload = await request(ctx, "deleteMonitor", form);
|
|
195
|
+
requireObjectPayload(payload.monitor, "uptimerobot delete monitor response");
|
|
196
|
+
return { deleted: true };
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// ../plugins/src/uptimerobot/schema.ts
|
|
200
|
+
import { z } from "zod/v4";
|
|
201
|
+
var getAccountDetailsInput = z.strictObject({}).describe("The input payload for getting UptimeRobot account details.");
|
|
202
|
+
var getAccountDetailsOutput = z.strictObject({
|
|
203
|
+
account: z.looseObject({
|
|
204
|
+
email: z.string().describe("The email address of the connected UptimeRobot account.").optional(),
|
|
205
|
+
user_id: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
206
|
+
monitor_limit: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
207
|
+
monitor_interval: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
208
|
+
up_monitors: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
209
|
+
down_monitors: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
210
|
+
paused_monitors: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
211
|
+
firstname: z.string().describe("The first name of the account owner, when present.").optional(),
|
|
212
|
+
registered_at: z.string().describe("The account registration timestamp returned by UptimeRobot, when present.").optional()
|
|
213
|
+
}).describe("The account details returned by the UptimeRobot API.").optional()
|
|
214
|
+
}).describe("The UptimeRobot account details lookup result.");
|
|
215
|
+
var listAlertContactsInput = z.strictObject({}).describe("The input payload for listing UptimeRobot alert contacts.");
|
|
216
|
+
var listAlertContactsOutput = z.strictObject({
|
|
217
|
+
alert_contacts: z.array(z.looseObject({
|
|
218
|
+
id: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
219
|
+
friendly_name: z.string().describe("The friendly name of the alert contact.").optional(),
|
|
220
|
+
type: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
221
|
+
status: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
222
|
+
value: z.string().describe("The destination value configured for the alert contact.").optional()
|
|
223
|
+
}).describe("An alert contact returned by the UptimeRobot API.")).describe("The alert contacts returned by UptimeRobot.").optional(),
|
|
224
|
+
pagination: z.looseObject({
|
|
225
|
+
offset: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
226
|
+
limit: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
227
|
+
total: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional()
|
|
228
|
+
}).describe("The pagination summary returned by UptimeRobot.").nullable().optional()
|
|
229
|
+
}).describe("The alert contact list returned by UptimeRobot.");
|
|
230
|
+
var listMonitorsInput = z.strictObject({
|
|
231
|
+
offset: z.int().min(0).describe("The zero-based pagination offset to request from UptimeRobot.").optional(),
|
|
232
|
+
limit: z.int().min(1).max(50).describe("The maximum number of monitors to return from UptimeRobot.").optional(),
|
|
233
|
+
search: z.string().min(1).describe("A search term applied to monitor friendly names, URLs, and types.").optional(),
|
|
234
|
+
sort: z.enum(["friendly_name", "url", "status", "type"]).describe("The field used by UptimeRobot to sort the monitor list.").optional(),
|
|
235
|
+
monitor_ids: z.array(z.int().min(1).describe("The numeric ID of the UptimeRobot monitor.")).min(1).describe("A list of monitor IDs encoded into the official monitors filter.").optional(),
|
|
236
|
+
types: z.array(z.int().min(1).max(6).describe("The UptimeRobot monitor type code. Known values are 1=HTTP(s), 2=Keyword, 3=Ping, 4=Port, 5=Heartbeat, and 6=SSL.")).min(1).describe("A list of monitor type codes encoded into the official types filter.").optional(),
|
|
237
|
+
statuses: z.array(z.int().min(0).describe("A UptimeRobot monitor status code.")).min(1).describe("A list of monitor status codes encoded into the official statuses filter.").optional(),
|
|
238
|
+
logs: z.boolean().describe("Whether monitor logs should be included in each monitor result.").optional(),
|
|
239
|
+
alert_contacts: z.boolean().describe("Whether alert contacts should be included in each monitor result.").optional()
|
|
240
|
+
}).describe("The input payload for listing monitors from the UptimeRobot account.");
|
|
241
|
+
var listMonitorsOutput = z.strictObject({
|
|
242
|
+
monitors: z.array(z.looseObject({
|
|
243
|
+
id: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
244
|
+
friendly_name: z.string().describe("The friendly name configured for the monitor.").optional(),
|
|
245
|
+
url: z.string().describe("The monitored URL, hostname, or IP address.").optional(),
|
|
246
|
+
type: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
247
|
+
status: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
248
|
+
sub_type: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
249
|
+
interval: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
250
|
+
timeout: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
251
|
+
keyword_type: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
252
|
+
keyword_value: z.string().describe("The keyword value configured for keyword monitors, when present.").optional(),
|
|
253
|
+
http_username: z.string().describe("The HTTP authentication username configured for the monitor, when present.").optional(),
|
|
254
|
+
http_password: z.string().describe("The HTTP authentication password configured for the monitor, when present.").optional(),
|
|
255
|
+
alert_contacts: z.array(z.looseObject({
|
|
256
|
+
id: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
257
|
+
friendly_name: z.string().describe("The friendly name of the alert contact.").optional(),
|
|
258
|
+
type: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
259
|
+
status: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
260
|
+
value: z.string().describe("The destination value configured for the alert contact.").optional()
|
|
261
|
+
}).describe("An alert contact returned by the UptimeRobot API.")).describe("The alert contacts returned for the monitor, when requested.").optional(),
|
|
262
|
+
logs: z.array(z.looseObject({
|
|
263
|
+
type: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
264
|
+
datetime: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
265
|
+
duration: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
266
|
+
reason: z.looseObject({}).describe("The nested reason object returned by UptimeRobot, when present.").optional()
|
|
267
|
+
}).describe("A monitor log entry returned by UptimeRobot.")).describe("The monitor logs returned by UptimeRobot, when requested.").optional(),
|
|
268
|
+
create_datetime: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional()
|
|
269
|
+
}).describe("A monitor returned by the UptimeRobot API.")).describe("The monitors returned by UptimeRobot.").optional(),
|
|
270
|
+
pagination: z.looseObject({
|
|
271
|
+
offset: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
272
|
+
limit: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
273
|
+
total: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional()
|
|
274
|
+
}).describe("The pagination summary returned by UptimeRobot.").nullable().optional()
|
|
275
|
+
}).describe("The UptimeRobot monitor list.");
|
|
276
|
+
var getMonitorInput = z.strictObject({
|
|
277
|
+
monitor_id: z.int().min(1).describe("The numeric ID of the UptimeRobot monitor."),
|
|
278
|
+
logs: z.boolean().describe("Whether monitor logs should be included in the UptimeRobot response.").optional(),
|
|
279
|
+
alert_contacts: z.boolean().describe("Whether alert contacts should be included in the UptimeRobot response.").optional()
|
|
280
|
+
}).describe("The input payload for fetching a single UptimeRobot monitor.");
|
|
281
|
+
var getMonitorOutput = z.strictObject({
|
|
282
|
+
monitor: z.looseObject({
|
|
283
|
+
id: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
284
|
+
friendly_name: z.string().describe("The friendly name configured for the monitor.").optional(),
|
|
285
|
+
url: z.string().describe("The monitored URL, hostname, or IP address.").optional(),
|
|
286
|
+
type: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
287
|
+
status: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
288
|
+
sub_type: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
289
|
+
interval: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
290
|
+
timeout: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
291
|
+
keyword_type: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
292
|
+
keyword_value: z.string().describe("The keyword value configured for keyword monitors, when present.").optional(),
|
|
293
|
+
http_username: z.string().describe("The HTTP authentication username configured for the monitor, when present.").optional(),
|
|
294
|
+
http_password: z.string().describe("The HTTP authentication password configured for the monitor, when present.").optional(),
|
|
295
|
+
alert_contacts: z.array(z.looseObject({
|
|
296
|
+
id: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
297
|
+
friendly_name: z.string().describe("The friendly name of the alert contact.").optional(),
|
|
298
|
+
type: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
299
|
+
status: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
300
|
+
value: z.string().describe("The destination value configured for the alert contact.").optional()
|
|
301
|
+
}).describe("An alert contact returned by the UptimeRobot API.")).describe("The alert contacts returned for the monitor, when requested.").optional(),
|
|
302
|
+
logs: z.array(z.looseObject({
|
|
303
|
+
type: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
304
|
+
datetime: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
305
|
+
duration: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
306
|
+
reason: z.looseObject({}).describe("The nested reason object returned by UptimeRobot, when present.").optional()
|
|
307
|
+
}).describe("A monitor log entry returned by UptimeRobot.")).describe("The monitor logs returned by UptimeRobot, when requested.").optional(),
|
|
308
|
+
create_datetime: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional()
|
|
309
|
+
}).describe("A monitor returned by the UptimeRobot API.").optional()
|
|
310
|
+
}).describe("The single-monitor lookup result returned by UptimeRobot.");
|
|
311
|
+
var createMonitorInput = z.strictObject({
|
|
312
|
+
friendly_name: z.string().min(1).describe("The friendly name of the monitor."),
|
|
313
|
+
url: z.string().min(1).describe("The URL, hostname, or IP address that UptimeRobot should monitor."),
|
|
314
|
+
type: z.int().min(1).max(6).describe("The UptimeRobot monitor type code. Known values are 1=HTTP(s), 2=Keyword, 3=Ping, 4=Port, 5=Heartbeat, and 6=SSL."),
|
|
315
|
+
sub_type: z.int().min(1).describe("The subtype code used for port monitors. Known values are 1=HTTP, 2=HTTPS, 3=FTP, 4=SMTP, 5=POP3, 6=IMAP, and 99=Custom.").optional(),
|
|
316
|
+
port: z.int().min(1).max(65535).describe("The destination port used for custom port monitors.").optional(),
|
|
317
|
+
interval: z.int().min(1).describe("The monitor interval in seconds accepted by UptimeRobot.").optional(),
|
|
318
|
+
timeout: z.int().min(1).max(60).describe("The timeout in seconds before UptimeRobot treats the check as failed.").optional(),
|
|
319
|
+
keyword_type: z.union([z.literal(1), z.literal(2)]).describe("The keyword matching mode. Use 1 when the keyword must exist, or 2 when it must not exist.").optional(),
|
|
320
|
+
keyword_value: z.string().min(1).describe("The keyword value used by keyword monitors.").optional(),
|
|
321
|
+
http_username: z.string().min(1).describe("The HTTP authentication username used by the monitor.").optional(),
|
|
322
|
+
http_password: z.string().min(1).describe("The HTTP authentication password used by the monitor.").optional(),
|
|
323
|
+
ssl: z.boolean().describe("Whether SSL validation should stay enabled for HTTPS-based monitors.").optional(),
|
|
324
|
+
alert_contacts: z.union([z.string().min(1).describe("The official alert_contacts string, such as 12345_0_0-67890_5_2."), z.array(z.union([z.int().min(1).describe("The numeric ID of the UptimeRobot alert contact."), z.strictObject({
|
|
325
|
+
id: z.int().min(1).describe("The numeric ID of the UptimeRobot alert contact.").optional(),
|
|
326
|
+
threshold: z.int().min(0).describe("How many minutes UptimeRobot should wait before notifying this alert contact.").optional(),
|
|
327
|
+
recurrence: z.int().min(0).describe("How many times UptimeRobot should repeat the notification for this alert contact.").optional()
|
|
328
|
+
}).describe("A structured alert contact assignment.")])).min(1).describe("A list of alert contacts to encode into the official alert_contacts parameter.")]).describe("Either the official alert_contacts string or a list of structured alert contact assignments.").optional()
|
|
329
|
+
}).describe("The input payload for creating a UptimeRobot monitor.");
|
|
330
|
+
var createMonitorOutput = z.strictObject({
|
|
331
|
+
monitor: z.looseObject({
|
|
332
|
+
id: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
333
|
+
friendly_name: z.string().describe("The friendly name configured for the monitor.").optional(),
|
|
334
|
+
url: z.string().describe("The monitored URL, hostname, or IP address.").optional(),
|
|
335
|
+
type: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
336
|
+
status: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
337
|
+
sub_type: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
338
|
+
interval: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
339
|
+
timeout: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
340
|
+
keyword_type: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
341
|
+
keyword_value: z.string().describe("The keyword value configured for keyword monitors, when present.").optional(),
|
|
342
|
+
http_username: z.string().describe("The HTTP authentication username configured for the monitor, when present.").optional(),
|
|
343
|
+
http_password: z.string().describe("The HTTP authentication password configured for the monitor, when present.").optional(),
|
|
344
|
+
alert_contacts: z.array(z.looseObject({
|
|
345
|
+
id: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
346
|
+
friendly_name: z.string().describe("The friendly name of the alert contact.").optional(),
|
|
347
|
+
type: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
348
|
+
status: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
349
|
+
value: z.string().describe("The destination value configured for the alert contact.").optional()
|
|
350
|
+
}).describe("An alert contact returned by the UptimeRobot API.")).describe("The alert contacts returned for the monitor, when requested.").optional(),
|
|
351
|
+
logs: z.array(z.looseObject({
|
|
352
|
+
type: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
353
|
+
datetime: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
354
|
+
duration: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
355
|
+
reason: z.looseObject({}).describe("The nested reason object returned by UptimeRobot, when present.").optional()
|
|
356
|
+
}).describe("A monitor log entry returned by UptimeRobot.")).describe("The monitor logs returned by UptimeRobot, when requested.").optional(),
|
|
357
|
+
create_datetime: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional()
|
|
358
|
+
}).describe("A monitor returned by the UptimeRobot API.").optional()
|
|
359
|
+
}).describe("The newly created UptimeRobot monitor.");
|
|
360
|
+
var updateMonitorInput = z.strictObject({
|
|
361
|
+
monitor_id: z.int().min(1).describe("The numeric ID of the UptimeRobot monitor."),
|
|
362
|
+
friendly_name: z.string().min(1).describe("The friendly name of the monitor.").optional(),
|
|
363
|
+
url: z.string().min(1).describe("The URL, hostname, or IP address that UptimeRobot should monitor.").optional(),
|
|
364
|
+
type: z.int().min(1).max(6).describe("The UptimeRobot monitor type code. Known values are 1=HTTP(s), 2=Keyword, 3=Ping, 4=Port, 5=Heartbeat, and 6=SSL.").optional(),
|
|
365
|
+
sub_type: z.int().min(1).describe("The subtype code used for port monitors. Known values are 1=HTTP, 2=HTTPS, 3=FTP, 4=SMTP, 5=POP3, 6=IMAP, and 99=Custom.").optional(),
|
|
366
|
+
port: z.int().min(1).max(65535).describe("The destination port used for custom port monitors.").optional(),
|
|
367
|
+
interval: z.int().min(1).describe("The monitor interval in seconds accepted by UptimeRobot.").optional(),
|
|
368
|
+
timeout: z.int().min(1).max(60).describe("The timeout in seconds before UptimeRobot treats the check as failed.").optional(),
|
|
369
|
+
keyword_type: z.union([z.literal(1), z.literal(2)]).describe("The keyword matching mode. Use 1 when the keyword must exist, or 2 when it must not exist.").optional(),
|
|
370
|
+
keyword_value: z.string().min(1).describe("The keyword value used by keyword monitors.").optional(),
|
|
371
|
+
http_username: z.string().min(1).describe("The HTTP authentication username used by the monitor.").optional(),
|
|
372
|
+
http_password: z.string().min(1).describe("The HTTP authentication password used by the monitor.").optional(),
|
|
373
|
+
ssl: z.boolean().describe("Whether SSL validation should stay enabled for HTTPS-based monitors.").optional(),
|
|
374
|
+
alert_contacts: z.union([z.string().min(1).describe("The official alert_contacts string, such as 12345_0_0-67890_5_2."), z.array(z.union([z.int().min(1).describe("The numeric ID of the UptimeRobot alert contact."), z.strictObject({
|
|
375
|
+
id: z.int().min(1).describe("The numeric ID of the UptimeRobot alert contact.").optional(),
|
|
376
|
+
threshold: z.int().min(0).describe("How many minutes UptimeRobot should wait before notifying this alert contact.").optional(),
|
|
377
|
+
recurrence: z.int().min(0).describe("How many times UptimeRobot should repeat the notification for this alert contact.").optional()
|
|
378
|
+
}).describe("A structured alert contact assignment.")])).min(1).describe("A list of alert contacts to encode into the official alert_contacts parameter.")]).describe("Either the official alert_contacts string or a list of structured alert contact assignments.").optional()
|
|
379
|
+
}).describe("The input payload for updating an existing UptimeRobot monitor.");
|
|
380
|
+
var updateMonitorOutput = z.strictObject({
|
|
381
|
+
monitor: z.looseObject({
|
|
382
|
+
id: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
383
|
+
friendly_name: z.string().describe("The friendly name configured for the monitor.").optional(),
|
|
384
|
+
url: z.string().describe("The monitored URL, hostname, or IP address.").optional(),
|
|
385
|
+
type: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
386
|
+
status: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
387
|
+
sub_type: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
388
|
+
interval: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
389
|
+
timeout: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
390
|
+
keyword_type: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
391
|
+
keyword_value: z.string().describe("The keyword value configured for keyword monitors, when present.").optional(),
|
|
392
|
+
http_username: z.string().describe("The HTTP authentication username configured for the monitor, when present.").optional(),
|
|
393
|
+
http_password: z.string().describe("The HTTP authentication password configured for the monitor, when present.").optional(),
|
|
394
|
+
alert_contacts: z.array(z.looseObject({
|
|
395
|
+
id: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
396
|
+
friendly_name: z.string().describe("The friendly name of the alert contact.").optional(),
|
|
397
|
+
type: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
398
|
+
status: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
399
|
+
value: z.string().describe("The destination value configured for the alert contact.").optional()
|
|
400
|
+
}).describe("An alert contact returned by the UptimeRobot API.")).describe("The alert contacts returned for the monitor, when requested.").optional(),
|
|
401
|
+
logs: z.array(z.looseObject({
|
|
402
|
+
type: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
403
|
+
datetime: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
404
|
+
duration: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional(),
|
|
405
|
+
reason: z.looseObject({}).describe("The nested reason object returned by UptimeRobot, when present.").optional()
|
|
406
|
+
}).describe("A monitor log entry returned by UptimeRobot.")).describe("The monitor logs returned by UptimeRobot, when requested.").optional(),
|
|
407
|
+
create_datetime: z.union([z.int().describe("An integer numeric value."), z.string().describe("A string numeric value.")]).describe("A numeric value returned by the UptimeRobot API.").optional()
|
|
408
|
+
}).describe("A monitor returned by the UptimeRobot API.").optional()
|
|
409
|
+
}).describe("The updated UptimeRobot monitor.");
|
|
410
|
+
var deleteMonitorInput = z.strictObject({
|
|
411
|
+
monitor_id: z.int().min(1).describe("The numeric ID of the UptimeRobot monitor.").optional()
|
|
412
|
+
}).describe("The input payload for deleting a UptimeRobot monitor.");
|
|
413
|
+
var deleteMonitorOutput = z.strictObject({
|
|
414
|
+
deleted: z.boolean().describe("Whether the monitor was deleted successfully.").optional()
|
|
415
|
+
}).describe("The monitor deletion acknowledgement returned by the UptimeRobot provider.");
|
|
416
|
+
var uptimerobotActions = {
|
|
417
|
+
get_account_details: {
|
|
418
|
+
description: "Get account-level monitor usage and profile details from the connected UptimeRobot account.",
|
|
419
|
+
effect: "read",
|
|
420
|
+
inputSchema: getAccountDetailsInput,
|
|
421
|
+
outputSchema: z.toJSONSchema(getAccountDetailsOutput, { io: "output", unrepresentable: "any" })
|
|
422
|
+
},
|
|
423
|
+
list_alert_contacts: {
|
|
424
|
+
description: "List the alert contacts configured in the connected UptimeRobot account.",
|
|
425
|
+
effect: "read",
|
|
426
|
+
inputSchema: listAlertContactsInput,
|
|
427
|
+
outputSchema: z.toJSONSchema(listAlertContactsOutput, { io: "output", unrepresentable: "any" })
|
|
428
|
+
},
|
|
429
|
+
list_monitors: {
|
|
430
|
+
description: "List monitors available in the connected UptimeRobot account.",
|
|
431
|
+
effect: "read",
|
|
432
|
+
inputSchema: listMonitorsInput,
|
|
433
|
+
outputSchema: z.toJSONSchema(listMonitorsOutput, { io: "output", unrepresentable: "any" })
|
|
434
|
+
},
|
|
435
|
+
get_monitor: {
|
|
436
|
+
description: "Get the full configuration and current status of a single UptimeRobot monitor.",
|
|
437
|
+
effect: "read",
|
|
438
|
+
inputSchema: getMonitorInput,
|
|
439
|
+
outputSchema: z.toJSONSchema(getMonitorOutput, { io: "output", unrepresentable: "any" })
|
|
440
|
+
},
|
|
441
|
+
create_monitor: {
|
|
442
|
+
description: "Create a new monitor in the connected UptimeRobot account.",
|
|
443
|
+
effect: "write",
|
|
444
|
+
inputSchema: createMonitorInput,
|
|
445
|
+
outputSchema: z.toJSONSchema(createMonitorOutput, { io: "output", unrepresentable: "any" })
|
|
446
|
+
},
|
|
447
|
+
update_monitor: {
|
|
448
|
+
description: "Update an existing monitor in the connected UptimeRobot account.",
|
|
449
|
+
effect: "write",
|
|
450
|
+
inputSchema: updateMonitorInput,
|
|
451
|
+
outputSchema: z.toJSONSchema(updateMonitorOutput, { io: "output", unrepresentable: "any" })
|
|
452
|
+
},
|
|
453
|
+
delete_monitor: {
|
|
454
|
+
description: "Delete a monitor from the connected UptimeRobot account.",
|
|
455
|
+
effect: "destructive",
|
|
456
|
+
inputSchema: deleteMonitorInput,
|
|
457
|
+
outputSchema: z.toJSONSchema(deleteMonitorOutput, { io: "output", unrepresentable: "any" })
|
|
458
|
+
}
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
// ../plugins/src/uptimerobot/index.ts
|
|
462
|
+
function createUptimerobotPlugin() {
|
|
463
|
+
return createProviderPlugin({
|
|
464
|
+
description: "UptimeRobot",
|
|
465
|
+
actions: uptimerobotActions,
|
|
466
|
+
// 上游的 credentialValidators 就是打 getAccountDetails;它只读、无入参,原样当探针。
|
|
467
|
+
credentialProbe: "get_account_details",
|
|
468
|
+
handlers: {
|
|
469
|
+
get_account_details: getAccountDetails,
|
|
470
|
+
list_alert_contacts: listAlertContacts,
|
|
471
|
+
list_monitors: listMonitors,
|
|
472
|
+
get_monitor: getMonitor,
|
|
473
|
+
create_monitor: createMonitor,
|
|
474
|
+
update_monitor: updateMonitor,
|
|
475
|
+
delete_monitor: deleteMonitor
|
|
476
|
+
}
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
var uptimerobot_default = createUptimerobotPlugin();
|
|
480
|
+
export {
|
|
481
|
+
createUptimerobotPlugin,
|
|
482
|
+
uptimerobot_default as default
|
|
483
|
+
};
|