@tool-bridge/server 0.21.0 → 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-RELFQ5FV.js → alt_text_generator_ai-FGYQAF2A.js} +12 -11
- package/dist/{amap-YSYEACKQ.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-Q74GLIDK.js → chunk-BNMLA2RC.js} +6 -5
- package/dist/chunk-HA4BGL6C.js +8429 -0
- package/dist/{chunk-MDY7K5CX.js → chunk-RMAWSG7E.js} +20135 -26920
- package/dist/{chunk-JEWFX6Z6.js → chunk-RTW5VRTK.js} +3 -3
- package/dist/chunk-U7PTOA3U.js +7320 -0
- package/dist/chunk-UY6ANCOY.js +378 -0
- package/dist/{chunk-QR4LK3HF.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-52I37IUT.js → confluence-6Y6GDETF.js} +105 -104
- package/dist/{convertapi-3TRJ3WEO.js → convertapi-HBZCSWOX.js} +32 -31
- package/dist/{currencyapi-LWEANWVI.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-VJPMCNRH.js → fal_ai-K4Q27IME.js} +81 -80
- package/dist/feishu-4TKXG4SU.js +11975 -0
- package/dist/{feishu_custom_bot-ADSE23KU.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-OAMF4DKP.js → fixer-H2BV2NO4.js} +34 -33
- package/dist/fly-PXKY6PNH.js +469 -0
- package/dist/{front-6GTVYKUM.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-YNKKBM6Q.js → googledocs-SSWIVFKA.js} +343 -341
- package/dist/{grafana-353VSGXN.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 -13
- package/dist/{ip2proxy-DBGRWH7S.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-L5BH455V.js → jina_ai-6WBMBGWM.js} +23 -23
- package/dist/{jira-IGTILUZA.js → jira-DVDVTHNO.js} +118 -117
- package/dist/langsmith-IM5N4YAU.js +593 -0
- package/dist/lemlist-277SHUQF.js +289 -0
- package/dist/{linear-HLGOWISN.js → linear-AEPH7B5V.js} +329 -327
- package/dist/logsnag-VEWRAGBG.js +150 -0
- package/dist/main.js +57 -279
- package/dist/{mattermost-BONGXVC7.js → mattermost-Q3A2BIZA.js} +59 -58
- package/dist/mem0-AXS7GZGI.js +544 -0
- package/dist/memos-7TXG4ZTU.js +744 -0
- package/dist/{metabase-ZHXHRHZK.js → metabase-NSVACWQM.js} +90 -89
- package/dist/mistral_ai-YZ52RGD4.js +1196 -0
- package/dist/{mother_duck-TKVQM35M.js → mother_duck-XLLL6FVL.js} +94 -93
- package/dist/ngrok-4O4W3WZW.js +356 -0
- package/dist/{notes-KXRNNYDW.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-CW7HONYW.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-5EAY7GDM.js → prerender-2W7UT4SC.js} +31 -30
- package/dist/{pubmed-GRQUBGVA.js → pubmed-VVV7XYLU.js} +241 -239
- package/dist/{railway-FTM75TMX.js → railway-KGI57S3O.js} +118 -117
- package/dist/readwise-AGHTQB42.js +470 -0
- package/dist/render-O4HBROCK.js +461 -0
- package/dist/{replicate-RJCMDB7H.js → replicate-KWBOMX7D.js} +81 -80
- package/dist/{resend-YYN22NIL.js → resend-DRH6Y6I4.js} +20 -16
- package/dist/rootly-XGCUDW6X.js +336 -0
- package/dist/{scrapfly-ZJJ6XM4Q.js → scrapfly-OIQ3OY6L.js} +62 -61
- package/dist/{scrapingbee-QNGEOD6D.js → scrapingbee-OCZO4FHX.js} +56 -56
- package/dist/{screenshot_fyi-SPZAABVD.js → screenshot_fyi-CUNGFZOC.js} +16 -16
- package/dist/semantic_scholar-3UJRLKES.js +611 -0
- package/dist/{sentry-SJ5NN4C4.js → sentry-5BWVZFJV.js} +208 -207
- package/dist/{shodan-YMGOY7KW.js → shodan-HI37CTEW.js} +62 -61
- package/dist/shopify-LJ2EV2HH.js +610 -0
- package/dist/stripe-3LHMV55K.js +585 -0
- package/dist/{supabase-GQ2OFVIL.js → supabase-H2KPX3Q2.js} +245 -244
- package/dist/tavily-FBEWGH3Z.js +326 -0
- package/dist/telegram-MYYO3JND.js +1767 -0
- package/dist/{telnyx-4JGMC3K7.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-VYF3HUU6.js → twilio-K6SLK2CX.js} +72 -70
- package/dist/umami-42RS2EPS.js +389 -0
- package/dist/unsplash-V7TOTETT.js +351 -0
- package/dist/{upstash_redis-IUM2HDLU.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-6CRVUZOJ.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-DMJEEGJP.js +0 -789
- package/dist/anthropic-D5X5GSYE.js +0 -202
- package/dist/apify-5NVFU3IZ.js +0 -247
- package/dist/brave_search-X557FMGO.js +0 -301
- package/dist/chunk-MZCIPUNQ.js +0 -23424
- package/dist/chunk-ZTTN6AJG.js +0 -977
- package/dist/circleci-3P3QTUX2.js +0 -388
- package/dist/clerk-GNMZQ2MY.js +0 -1019
- package/dist/cloudflare_dns-VWZH3ZTR.js +0 -588
- package/dist/cohere-C7QVIIMG.js +0 -185
- package/dist/deepseek-5U24YG4P.js +0 -209
- package/dist/docker_hub-CMISLRSE.js +0 -932
- package/dist/dropbox-TW4QN6FT.js +0 -1304
- package/dist/dub-EFXGI5UH.js +0 -679
- package/dist/e2b-PHM63OVF.js +0 -277
- package/dist/exa-DYOQWURR.js +0 -331
- package/dist/feishu-TFIZXPIN.js +0 -231
- package/dist/figma-4AK47AYY.js +0 -773
- package/dist/firehydrant-RGPTW4EA.js +0 -562
- package/dist/fly-YB4AQD4O.js +0 -468
- package/dist/geocodio-YRT4K25M.js +0 -212
- package/dist/ghost-JCW6UIP2.js +0 -337
- package/dist/github-CEGVRMNX.js +0 -5420
- package/dist/gmail-JCMJD55P.js +0 -1886
- package/dist/googlecalendar-2EAW4MNM.js +0 -2522
- package/dist/graphhopper-H3IVJNDS.js +0 -324
- package/dist/ipgeolocation_io-5I2BDVMG.js +0 -315
- package/dist/ipqualityscore-ILV7TQCV.js +0 -277
- package/dist/langsmith-BYRX4AOF.js +0 -592
- package/dist/lemlist-ZGNYTIQO.js +0 -288
- package/dist/logsnag-5RGTMTU2.js +0 -150
- package/dist/mem0-RUVNUPTE.js +0 -543
- package/dist/memos-TED4HI54.js +0 -739
- package/dist/mistral_ai-NGP5SHU7.js +0 -1195
- package/dist/ngrok-BYCUJ7QV.js +0 -356
- package/dist/notion-2ILYKJOO.js +0 -936
- package/dist/open_exchange_rates-JU4DC6HZ.js +0 -214
- package/dist/openai-6SOT26ZK.js +0 -799
- package/dist/opengraph_io-ZEFHV2OL.js +0 -361
- package/dist/openrouter-R4P7JL5L.js +0 -437
- package/dist/outline-VCTQ5V2X.js +0 -595
- package/dist/paddle-AZOAKBJS.js +0 -453
- package/dist/perplexity-OMRLGVAT.js +0 -219
- package/dist/pinecone-DI62W3ZX.js +0 -570
- package/dist/polar-5DRGTXNR.js +0 -394
- package/dist/posthog-3DTHFCKE.js +0 -3463
- package/dist/postmark-ME2V2XXI.js +0 -426
- package/dist/readwise-IJQGV6IQ.js +0 -469
- package/dist/render-TMSPHRTY.js +0 -460
- package/dist/rootly-7RXE4K7L.js +0 -336
- package/dist/semantic_scholar-SDPVGDDI.js +0 -610
- package/dist/shopify-SU5ABP54.js +0 -609
- package/dist/stripe-JAC425KE.js +0 -584
- package/dist/tavily-Y7MDA5CI.js +0 -326
- package/dist/telegram-OIDT3ZLH.js +0 -1766
- package/dist/todoist-O7S2OUGX.js +0 -663
- package/dist/trello-3LDE4TAQ.js +0 -1079
- package/dist/turso-MUQ44KCA.js +0 -415
- package/dist/umami-SVQIK26J.js +0 -388
- package/dist/unsplash-333XYDCJ.js +0 -350
- package/dist/uptimerobot-7ZRU2NJV.js +0 -482
- package/dist/v2ex-AVSJCQPS.js +0 -666
- package/dist/vercel-J7RGXNSA.js +0 -1075
- package/dist/wordpress-THOJLPKA.js +0 -811
- package/dist/workos-ENTGRWF2.js +0 -663
- package/dist/zhihu-W2BXICTX.js +0 -253
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createAuthedClient
|
|
3
|
+
} from "./chunk-RTW5VRTK.js";
|
|
4
|
+
import "./chunk-BNMLA2RC.js";
|
|
5
|
+
import {
|
|
6
|
+
asJsonObject,
|
|
7
|
+
compactDefined,
|
|
8
|
+
trimmedText
|
|
9
|
+
} from "./chunk-JXHMDBAY.js";
|
|
10
|
+
import {
|
|
11
|
+
createProviderPlugin,
|
|
12
|
+
upstreamError
|
|
13
|
+
} from "./chunk-X7ZUTKHR.js";
|
|
14
|
+
import "./chunk-7ISGFRC6.js";
|
|
15
|
+
import "./chunk-UY6ANCOY.js";
|
|
16
|
+
import {
|
|
17
|
+
TBError
|
|
18
|
+
} from "./chunk-HA4BGL6C.js";
|
|
19
|
+
import "./chunk-U67V476Y.js";
|
|
20
|
+
|
|
21
|
+
// ../plugins/src/turso/api.ts
|
|
22
|
+
var SERVICE = "turso";
|
|
23
|
+
var API_BASE = "https://api.turso.tech";
|
|
24
|
+
var http = createAuthedClient({
|
|
25
|
+
baseUrl: `${API_BASE}/`,
|
|
26
|
+
service: SERVICE,
|
|
27
|
+
auth: { kind: "bearer" },
|
|
28
|
+
headers: { accept: "application/json" },
|
|
29
|
+
errorMessage: {
|
|
30
|
+
// Turso 的错误消息散落在五六个键里,按上游的顺序找。
|
|
31
|
+
keys: ["message", "error", "detail", "title", "error.message", "error.detail"],
|
|
32
|
+
fallback: (status) => `Turso request failed with ${status}`
|
|
33
|
+
},
|
|
34
|
+
mapTransportError: ({ message }) => upstreamError(
|
|
35
|
+
502,
|
|
36
|
+
message === void 0 ? "Turso request failed" : `Turso request failed: ${message}`
|
|
37
|
+
)
|
|
38
|
+
});
|
|
39
|
+
function requireText(value, field) {
|
|
40
|
+
const result = trimmedText(value);
|
|
41
|
+
if (result === void 0) throw new TBError("invalid_argument", `${field} is required.`);
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
44
|
+
function responseError(message) {
|
|
45
|
+
return new TBError("unavailable", message, { retryable: true });
|
|
46
|
+
}
|
|
47
|
+
function normalizeResource(raw) {
|
|
48
|
+
return compactDefined({
|
|
49
|
+
slug: trimmedText(raw.slug),
|
|
50
|
+
name: trimmedText(raw.name),
|
|
51
|
+
type: trimmedText(raw.type),
|
|
52
|
+
location: trimmedText(raw.location),
|
|
53
|
+
uuid: trimmedText(raw.uuid),
|
|
54
|
+
group: trimmedText(raw.group),
|
|
55
|
+
hostname: trimmedText(raw.hostname),
|
|
56
|
+
code: trimmedText(raw.code),
|
|
57
|
+
raw
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function normalizeItems(items) {
|
|
61
|
+
return items.flatMap((item) => {
|
|
62
|
+
const fields = asJsonObject(item);
|
|
63
|
+
return fields === void 0 ? [] : [normalizeResource(fields)];
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function resourceList(payload, keys) {
|
|
67
|
+
if (Array.isArray(payload)) return normalizeItems(payload);
|
|
68
|
+
const fields = asJsonObject(payload);
|
|
69
|
+
if (fields === void 0) throw responseError("Turso returned an invalid list response");
|
|
70
|
+
for (const key of [...keys, "data"]) {
|
|
71
|
+
const value = fields[key];
|
|
72
|
+
if (Array.isArray(value)) return normalizeItems(value);
|
|
73
|
+
}
|
|
74
|
+
throw responseError("Turso list response is missing items");
|
|
75
|
+
}
|
|
76
|
+
function singleResource(payload, keys) {
|
|
77
|
+
const fields = asJsonObject(payload);
|
|
78
|
+
if (fields === void 0) throw responseError("Turso returned an invalid resource response");
|
|
79
|
+
for (const key of [...keys, "data"]) {
|
|
80
|
+
const value = asJsonObject(fields[key]);
|
|
81
|
+
if (value !== void 0) return normalizeResource(value);
|
|
82
|
+
}
|
|
83
|
+
return normalizeResource(fields);
|
|
84
|
+
}
|
|
85
|
+
async function request(ctx, input) {
|
|
86
|
+
const response = await http.request(ctx, {
|
|
87
|
+
method: input.method,
|
|
88
|
+
path: input.path,
|
|
89
|
+
...input.body === void 0 ? {} : { json: input.body },
|
|
90
|
+
invalidJson: "text"
|
|
91
|
+
});
|
|
92
|
+
if (response.bodyKind === "empty") return {};
|
|
93
|
+
return response.bodyKind === "json" ? response.data : { message: response.data };
|
|
94
|
+
}
|
|
95
|
+
function organizationPath(organizationSlug) {
|
|
96
|
+
return `/v1/organizations/${encodeURIComponent(requireText(organizationSlug, "organizationSlug"))}`;
|
|
97
|
+
}
|
|
98
|
+
function extensions(value) {
|
|
99
|
+
if (value === void 0 || value === "all") return value;
|
|
100
|
+
return value.map((item) => requireText(item, "extensions"));
|
|
101
|
+
}
|
|
102
|
+
async function listOrganizations(_input, ctx) {
|
|
103
|
+
const payload = await request(ctx, { method: "GET", path: "/v1/organizations" });
|
|
104
|
+
return { organizations: resourceList(payload, ["organizations"]) };
|
|
105
|
+
}
|
|
106
|
+
async function getOrganization(input, ctx) {
|
|
107
|
+
const payload = await request(ctx, { method: "GET", path: organizationPath(input.organizationSlug) });
|
|
108
|
+
return { organization: singleResource(payload, ["organization"]) };
|
|
109
|
+
}
|
|
110
|
+
async function listLocations(_input, ctx) {
|
|
111
|
+
const payload = await request(ctx, { method: "GET", path: "/v1/locations" });
|
|
112
|
+
return { locations: resourceList(payload, ["locations", "regions"]) };
|
|
113
|
+
}
|
|
114
|
+
async function listGroups(input, ctx) {
|
|
115
|
+
const payload = await request(ctx, { method: "GET", path: `${organizationPath(input.organizationSlug)}/groups` });
|
|
116
|
+
return { groups: resourceList(payload, ["groups"]) };
|
|
117
|
+
}
|
|
118
|
+
async function getGroup(input, ctx) {
|
|
119
|
+
const name = encodeURIComponent(requireText(input.name, "name"));
|
|
120
|
+
const payload = await request(ctx, {
|
|
121
|
+
method: "GET",
|
|
122
|
+
path: `${organizationPath(input.organizationSlug)}/groups/${name}`
|
|
123
|
+
});
|
|
124
|
+
return { group: singleResource(payload, ["group"]) };
|
|
125
|
+
}
|
|
126
|
+
async function createGroup(input, ctx) {
|
|
127
|
+
const payload = await request(ctx, {
|
|
128
|
+
method: "POST",
|
|
129
|
+
path: `${organizationPath(input.organizationSlug)}/groups`,
|
|
130
|
+
body: compactDefined({
|
|
131
|
+
name: requireText(input.name, "name"),
|
|
132
|
+
location: requireText(input.location, "location"),
|
|
133
|
+
extensions: extensions(input.extensions)
|
|
134
|
+
})
|
|
135
|
+
});
|
|
136
|
+
return { group: singleResource(payload, ["group"]) };
|
|
137
|
+
}
|
|
138
|
+
async function listDatabases(input, ctx) {
|
|
139
|
+
const payload = await request(ctx, { method: "GET", path: `${organizationPath(input.organizationSlug)}/databases` });
|
|
140
|
+
return { databases: resourceList(payload, ["databases"]) };
|
|
141
|
+
}
|
|
142
|
+
async function getDatabase(input, ctx) {
|
|
143
|
+
const name = encodeURIComponent(requireText(input.name, "name"));
|
|
144
|
+
const payload = await request(ctx, {
|
|
145
|
+
method: "GET",
|
|
146
|
+
path: `${organizationPath(input.organizationSlug)}/databases/${name}`
|
|
147
|
+
});
|
|
148
|
+
return { database: singleResource(payload, ["database"]) };
|
|
149
|
+
}
|
|
150
|
+
async function createDatabase(input, ctx) {
|
|
151
|
+
const payload = await request(ctx, {
|
|
152
|
+
method: "POST",
|
|
153
|
+
path: `${organizationPath(input.organizationSlug)}/databases`,
|
|
154
|
+
// 上游这里没走 compactObject:两个字段都是必填,给不出就该在断言处炸。
|
|
155
|
+
body: {
|
|
156
|
+
name: requireText(input.name, "name"),
|
|
157
|
+
group: requireText(input.group, "group")
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
return { database: singleResource(payload, ["database"]) };
|
|
161
|
+
}
|
|
162
|
+
async function deleteDatabase(input, ctx) {
|
|
163
|
+
const name = encodeURIComponent(requireText(input.name, "name"));
|
|
164
|
+
await request(ctx, {
|
|
165
|
+
method: "DELETE",
|
|
166
|
+
path: `${organizationPath(input.organizationSlug)}/databases/${name}`
|
|
167
|
+
});
|
|
168
|
+
return { deleted: true };
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// ../plugins/src/turso/schema.ts
|
|
172
|
+
import { z } from "zod/v4";
|
|
173
|
+
var listOrganizationsInput = z.strictObject({}).describe("The input payload for listing Turso organizations.");
|
|
174
|
+
var listOrganizationsOutput = z.strictObject({
|
|
175
|
+
organizations: z.array(z.strictObject({
|
|
176
|
+
slug: z.string().min(1).describe("The resource slug when Turso returns one.").optional(),
|
|
177
|
+
name: z.string().min(1).describe("The resource name when Turso returns one.").optional(),
|
|
178
|
+
type: z.string().min(1).describe("The resource type when Turso returns one.").optional(),
|
|
179
|
+
location: z.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
180
|
+
uuid: z.string().min(1).describe("The UUID when Turso returns one.").optional(),
|
|
181
|
+
group: z.string().min(1).describe("The group name when Turso returns one.").optional(),
|
|
182
|
+
hostname: z.string().min(1).describe("The database hostname when Turso returns one.").optional(),
|
|
183
|
+
code: z.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
184
|
+
raw: z.looseObject({}).describe("The raw Turso resource object returned by the Platform API.")
|
|
185
|
+
}).describe("A normalized Turso Platform API resource.")).describe("The organizations visible to the current API token.")
|
|
186
|
+
}).describe("The organizations returned by the Turso Platform API.");
|
|
187
|
+
var getOrganizationInput = z.strictObject({
|
|
188
|
+
organizationSlug: z.string().min(1).describe("The organization slug used in the Turso API path.")
|
|
189
|
+
}).describe("The input payload for retrieving one organization.");
|
|
190
|
+
var getOrganizationOutput = z.strictObject({
|
|
191
|
+
organization: z.strictObject({
|
|
192
|
+
slug: z.string().min(1).describe("The resource slug when Turso returns one.").optional(),
|
|
193
|
+
name: z.string().min(1).describe("The resource name when Turso returns one.").optional(),
|
|
194
|
+
type: z.string().min(1).describe("The resource type when Turso returns one.").optional(),
|
|
195
|
+
location: z.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
196
|
+
uuid: z.string().min(1).describe("The UUID when Turso returns one.").optional(),
|
|
197
|
+
group: z.string().min(1).describe("The group name when Turso returns one.").optional(),
|
|
198
|
+
hostname: z.string().min(1).describe("The database hostname when Turso returns one.").optional(),
|
|
199
|
+
code: z.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
200
|
+
raw: z.looseObject({}).describe("The raw Turso resource object returned by the Platform API.")
|
|
201
|
+
}).describe("A normalized Turso Platform API resource.")
|
|
202
|
+
}).describe("The organization returned by the Turso Platform API.");
|
|
203
|
+
var listLocationsInput = z.strictObject({}).describe("The input payload for listing Turso locations.");
|
|
204
|
+
var listLocationsOutput = z.strictObject({
|
|
205
|
+
locations: z.array(z.strictObject({
|
|
206
|
+
slug: z.string().min(1).describe("The resource slug when Turso returns one.").optional(),
|
|
207
|
+
name: z.string().min(1).describe("The resource name when Turso returns one.").optional(),
|
|
208
|
+
type: z.string().min(1).describe("The resource type when Turso returns one.").optional(),
|
|
209
|
+
location: z.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
210
|
+
uuid: z.string().min(1).describe("The UUID when Turso returns one.").optional(),
|
|
211
|
+
group: z.string().min(1).describe("The group name when Turso returns one.").optional(),
|
|
212
|
+
hostname: z.string().min(1).describe("The database hostname when Turso returns one.").optional(),
|
|
213
|
+
code: z.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
214
|
+
raw: z.looseObject({}).describe("The raw Turso resource object returned by the Platform API.")
|
|
215
|
+
}).describe("A normalized Turso Platform API resource.")).describe("The available Turso locations.")
|
|
216
|
+
}).describe("The locations returned by the Turso Platform API.");
|
|
217
|
+
var listGroupsInput = z.strictObject({
|
|
218
|
+
organizationSlug: z.string().min(1).describe("The organization slug used in the Turso API path.")
|
|
219
|
+
}).describe("The input payload for listing Turso groups.");
|
|
220
|
+
var listGroupsOutput = z.strictObject({
|
|
221
|
+
groups: z.array(z.strictObject({
|
|
222
|
+
slug: z.string().min(1).describe("The resource slug when Turso returns one.").optional(),
|
|
223
|
+
name: z.string().min(1).describe("The resource name when Turso returns one.").optional(),
|
|
224
|
+
type: z.string().min(1).describe("The resource type when Turso returns one.").optional(),
|
|
225
|
+
location: z.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
226
|
+
uuid: z.string().min(1).describe("The UUID when Turso returns one.").optional(),
|
|
227
|
+
group: z.string().min(1).describe("The group name when Turso returns one.").optional(),
|
|
228
|
+
hostname: z.string().min(1).describe("The database hostname when Turso returns one.").optional(),
|
|
229
|
+
code: z.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
230
|
+
raw: z.looseObject({}).describe("The raw Turso resource object returned by the Platform API.")
|
|
231
|
+
}).describe("A normalized Turso Platform API resource.")).describe("The Turso groups belonging to the organization.")
|
|
232
|
+
}).describe("The Turso groups returned for one organization.");
|
|
233
|
+
var getGroupInput = z.strictObject({
|
|
234
|
+
organizationSlug: z.string().min(1).describe("The organization slug used in the Turso API path."),
|
|
235
|
+
name: z.string().min(1).describe("The Turso group name.")
|
|
236
|
+
}).describe("The input payload for retrieving one Turso group.");
|
|
237
|
+
var getGroupOutput = z.strictObject({
|
|
238
|
+
group: z.strictObject({
|
|
239
|
+
slug: z.string().min(1).describe("The resource slug when Turso returns one.").optional(),
|
|
240
|
+
name: z.string().min(1).describe("The resource name when Turso returns one.").optional(),
|
|
241
|
+
type: z.string().min(1).describe("The resource type when Turso returns one.").optional(),
|
|
242
|
+
location: z.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
243
|
+
uuid: z.string().min(1).describe("The UUID when Turso returns one.").optional(),
|
|
244
|
+
group: z.string().min(1).describe("The group name when Turso returns one.").optional(),
|
|
245
|
+
hostname: z.string().min(1).describe("The database hostname when Turso returns one.").optional(),
|
|
246
|
+
code: z.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
247
|
+
raw: z.looseObject({}).describe("The raw Turso resource object returned by the Platform API.")
|
|
248
|
+
}).describe("A normalized Turso Platform API resource.")
|
|
249
|
+
}).describe("The Turso group returned by the Platform API.");
|
|
250
|
+
var createGroupInput = z.strictObject({
|
|
251
|
+
organizationSlug: z.string().min(1).describe("The organization slug used in the Turso API path."),
|
|
252
|
+
name: z.string().min(1).describe("The Turso group name."),
|
|
253
|
+
location: z.string().min(1).describe("The primary Turso location code for the group."),
|
|
254
|
+
extensions: z.union([z.enum(["all"]).describe("Enable every supported extension."), z.array(z.string().min(1).describe("One Turso extension name.")).min(1).describe("The explicit extension names to enable for new databases in the group.")]).describe("The extensions to enable for new databases in the group.").optional()
|
|
255
|
+
}).describe("The input payload for creating a Turso group.");
|
|
256
|
+
var createGroupOutput = z.strictObject({
|
|
257
|
+
group: z.strictObject({
|
|
258
|
+
slug: z.string().min(1).describe("The resource slug when Turso returns one.").optional(),
|
|
259
|
+
name: z.string().min(1).describe("The resource name when Turso returns one.").optional(),
|
|
260
|
+
type: z.string().min(1).describe("The resource type when Turso returns one.").optional(),
|
|
261
|
+
location: z.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
262
|
+
uuid: z.string().min(1).describe("The UUID when Turso returns one.").optional(),
|
|
263
|
+
group: z.string().min(1).describe("The group name when Turso returns one.").optional(),
|
|
264
|
+
hostname: z.string().min(1).describe("The database hostname when Turso returns one.").optional(),
|
|
265
|
+
code: z.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
266
|
+
raw: z.looseObject({}).describe("The raw Turso resource object returned by the Platform API.")
|
|
267
|
+
}).describe("A normalized Turso Platform API resource.")
|
|
268
|
+
}).describe("The newly created Turso group.");
|
|
269
|
+
var listDatabasesInput = z.strictObject({
|
|
270
|
+
organizationSlug: z.string().min(1).describe("The organization slug used in the Turso API path.")
|
|
271
|
+
}).describe("The input payload for listing Turso databases.");
|
|
272
|
+
var listDatabasesOutput = z.strictObject({
|
|
273
|
+
databases: z.array(z.strictObject({
|
|
274
|
+
slug: z.string().min(1).describe("The resource slug when Turso returns one.").optional(),
|
|
275
|
+
name: z.string().min(1).describe("The resource name when Turso returns one.").optional(),
|
|
276
|
+
type: z.string().min(1).describe("The resource type when Turso returns one.").optional(),
|
|
277
|
+
location: z.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
278
|
+
uuid: z.string().min(1).describe("The UUID when Turso returns one.").optional(),
|
|
279
|
+
group: z.string().min(1).describe("The group name when Turso returns one.").optional(),
|
|
280
|
+
hostname: z.string().min(1).describe("The database hostname when Turso returns one.").optional(),
|
|
281
|
+
code: z.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
282
|
+
raw: z.looseObject({}).describe("The raw Turso resource object returned by the Platform API.")
|
|
283
|
+
}).describe("A normalized Turso Platform API resource.")).describe("The Turso databases belonging to the organization.")
|
|
284
|
+
}).describe("The Turso databases returned for one organization.");
|
|
285
|
+
var getDatabaseInput = z.strictObject({
|
|
286
|
+
organizationSlug: z.string().min(1).describe("The organization slug used in the Turso API path."),
|
|
287
|
+
name: z.string().min(1).describe("The Turso database name.")
|
|
288
|
+
}).describe("The input payload for retrieving one Turso database.");
|
|
289
|
+
var getDatabaseOutput = z.strictObject({
|
|
290
|
+
database: z.strictObject({
|
|
291
|
+
slug: z.string().min(1).describe("The resource slug when Turso returns one.").optional(),
|
|
292
|
+
name: z.string().min(1).describe("The resource name when Turso returns one.").optional(),
|
|
293
|
+
type: z.string().min(1).describe("The resource type when Turso returns one.").optional(),
|
|
294
|
+
location: z.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
295
|
+
uuid: z.string().min(1).describe("The UUID when Turso returns one.").optional(),
|
|
296
|
+
group: z.string().min(1).describe("The group name when Turso returns one.").optional(),
|
|
297
|
+
hostname: z.string().min(1).describe("The database hostname when Turso returns one.").optional(),
|
|
298
|
+
code: z.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
299
|
+
raw: z.looseObject({}).describe("The raw Turso resource object returned by the Platform API.")
|
|
300
|
+
}).describe("A normalized Turso Platform API resource.")
|
|
301
|
+
}).describe("The Turso database returned by the Platform API.");
|
|
302
|
+
var createDatabaseInput = z.strictObject({
|
|
303
|
+
organizationSlug: z.string().min(1).describe("The organization slug used in the Turso API path."),
|
|
304
|
+
name: z.string().min(1).describe("The Turso database name."),
|
|
305
|
+
group: z.string().min(1).describe("The Turso group where the database should be created.")
|
|
306
|
+
}).describe("The input payload for creating a Turso database.");
|
|
307
|
+
var createDatabaseOutput = z.strictObject({
|
|
308
|
+
database: z.strictObject({
|
|
309
|
+
slug: z.string().min(1).describe("The resource slug when Turso returns one.").optional(),
|
|
310
|
+
name: z.string().min(1).describe("The resource name when Turso returns one.").optional(),
|
|
311
|
+
type: z.string().min(1).describe("The resource type when Turso returns one.").optional(),
|
|
312
|
+
location: z.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
313
|
+
uuid: z.string().min(1).describe("The UUID when Turso returns one.").optional(),
|
|
314
|
+
group: z.string().min(1).describe("The group name when Turso returns one.").optional(),
|
|
315
|
+
hostname: z.string().min(1).describe("The database hostname when Turso returns one.").optional(),
|
|
316
|
+
code: z.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
317
|
+
raw: z.looseObject({}).describe("The raw Turso resource object returned by the Platform API.")
|
|
318
|
+
}).describe("A normalized Turso Platform API resource.")
|
|
319
|
+
}).describe("The newly created Turso database.");
|
|
320
|
+
var deleteDatabaseInput = z.strictObject({
|
|
321
|
+
organizationSlug: z.string().min(1).describe("The organization slug used in the Turso API path."),
|
|
322
|
+
name: z.string().min(1).describe("The Turso database name.")
|
|
323
|
+
}).describe("The input payload for deleting one Turso database.");
|
|
324
|
+
var deleteDatabaseOutput = z.strictObject({
|
|
325
|
+
deleted: z.boolean().describe("Whether the connector finished the delete request successfully.")
|
|
326
|
+
}).describe("The normalized delete result returned by the connector.");
|
|
327
|
+
var tursoActions = {
|
|
328
|
+
list_organizations: {
|
|
329
|
+
description: "List organizations visible to the current Turso Platform API token.",
|
|
330
|
+
effect: "read",
|
|
331
|
+
inputSchema: listOrganizationsInput,
|
|
332
|
+
outputSchema: z.toJSONSchema(listOrganizationsOutput, { io: "output", unrepresentable: "any" })
|
|
333
|
+
},
|
|
334
|
+
get_organization: {
|
|
335
|
+
description: "Retrieve one Turso organization by slug.",
|
|
336
|
+
effect: "read",
|
|
337
|
+
inputSchema: getOrganizationInput,
|
|
338
|
+
outputSchema: z.toJSONSchema(getOrganizationOutput, { io: "output", unrepresentable: "any" })
|
|
339
|
+
},
|
|
340
|
+
list_locations: {
|
|
341
|
+
description: "List available Turso locations that can host groups.",
|
|
342
|
+
effect: "read",
|
|
343
|
+
inputSchema: listLocationsInput,
|
|
344
|
+
outputSchema: z.toJSONSchema(listLocationsOutput, { io: "output", unrepresentable: "any" })
|
|
345
|
+
},
|
|
346
|
+
list_groups: {
|
|
347
|
+
description: "List Turso groups for one organization.",
|
|
348
|
+
effect: "read",
|
|
349
|
+
inputSchema: listGroupsInput,
|
|
350
|
+
outputSchema: z.toJSONSchema(listGroupsOutput, { io: "output", unrepresentable: "any" })
|
|
351
|
+
},
|
|
352
|
+
get_group: {
|
|
353
|
+
description: "Retrieve one Turso group by name within an organization.",
|
|
354
|
+
effect: "read",
|
|
355
|
+
inputSchema: getGroupInput,
|
|
356
|
+
outputSchema: z.toJSONSchema(getGroupOutput, { io: "output", unrepresentable: "any" })
|
|
357
|
+
},
|
|
358
|
+
create_group: {
|
|
359
|
+
description: "Create a Turso group in one organization with a primary location.",
|
|
360
|
+
effect: "write",
|
|
361
|
+
inputSchema: createGroupInput,
|
|
362
|
+
outputSchema: z.toJSONSchema(createGroupOutput, { io: "output", unrepresentable: "any" })
|
|
363
|
+
},
|
|
364
|
+
list_databases: {
|
|
365
|
+
description: "List Turso databases for one organization.",
|
|
366
|
+
effect: "read",
|
|
367
|
+
inputSchema: listDatabasesInput,
|
|
368
|
+
outputSchema: z.toJSONSchema(listDatabasesOutput, { io: "output", unrepresentable: "any" })
|
|
369
|
+
},
|
|
370
|
+
get_database: {
|
|
371
|
+
description: "Retrieve one Turso database by name within an organization.",
|
|
372
|
+
effect: "read",
|
|
373
|
+
inputSchema: getDatabaseInput,
|
|
374
|
+
outputSchema: z.toJSONSchema(getDatabaseOutput, { io: "output", unrepresentable: "any" })
|
|
375
|
+
},
|
|
376
|
+
create_database: {
|
|
377
|
+
description: "Create a Turso database in one organization and group.",
|
|
378
|
+
effect: "write",
|
|
379
|
+
inputSchema: createDatabaseInput,
|
|
380
|
+
outputSchema: z.toJSONSchema(createDatabaseOutput, { io: "output", unrepresentable: "any" })
|
|
381
|
+
},
|
|
382
|
+
delete_database: {
|
|
383
|
+
description: "Delete a Turso database from one organization.",
|
|
384
|
+
effect: "destructive",
|
|
385
|
+
inputSchema: deleteDatabaseInput,
|
|
386
|
+
outputSchema: z.toJSONSchema(deleteDatabaseOutput, { io: "output", unrepresentable: "any" })
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
// ../plugins/src/turso/index.ts
|
|
391
|
+
function createTursoPlugin() {
|
|
392
|
+
return createProviderPlugin({
|
|
393
|
+
description: "Turso",
|
|
394
|
+
actions: tursoActions,
|
|
395
|
+
// 上游 credentialValidators 打的 `/v1/auth/validate` 没有对应 action;`list_organizations`
|
|
396
|
+
// 同样只读、无必填入参,且同样要求 Platform token 有效,拿它当挂载时的凭证探针。
|
|
397
|
+
credentialProbe: "list_organizations",
|
|
398
|
+
handlers: {
|
|
399
|
+
list_organizations: listOrganizations,
|
|
400
|
+
get_organization: getOrganization,
|
|
401
|
+
list_locations: listLocations,
|
|
402
|
+
list_groups: listGroups,
|
|
403
|
+
get_group: getGroup,
|
|
404
|
+
create_group: createGroup,
|
|
405
|
+
list_databases: listDatabases,
|
|
406
|
+
get_database: getDatabase,
|
|
407
|
+
create_database: createDatabase,
|
|
408
|
+
delete_database: deleteDatabase
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
var turso_default = createTursoPlugin();
|
|
413
|
+
export {
|
|
414
|
+
createTursoPlugin,
|
|
415
|
+
turso_default as default
|
|
416
|
+
};
|
|
@@ -7,14 +7,15 @@ import {
|
|
|
7
7
|
createProviderPlugin,
|
|
8
8
|
requireCredential,
|
|
9
9
|
upstreamError
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-X7ZUTKHR.js";
|
|
11
11
|
import {
|
|
12
12
|
guardedFetch
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-7ISGFRC6.js";
|
|
14
|
+
import "./chunk-UY6ANCOY.js";
|
|
14
15
|
import {
|
|
15
16
|
TBError,
|
|
16
|
-
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
isTBError
|
|
18
|
+
} from "./chunk-HA4BGL6C.js";
|
|
18
19
|
import "./chunk-U67V476Y.js";
|
|
19
20
|
|
|
20
21
|
// ../plugins/src/twilio/api.ts
|
|
@@ -61,7 +62,7 @@ async function request(ctx, options) {
|
|
|
61
62
|
...options.form === void 0 ? {} : { body: options.form.toString() }
|
|
62
63
|
});
|
|
63
64
|
} catch (error) {
|
|
64
|
-
if (error
|
|
65
|
+
if (isTBError(error)) throw error;
|
|
65
66
|
throw upstreamError(
|
|
66
67
|
502,
|
|
67
68
|
error instanceof Error ? `Twilio request failed: ${error.message}` : "Twilio request failed"
|
|
@@ -174,107 +175,108 @@ async function sendMessage(input, ctx) {
|
|
|
174
175
|
}
|
|
175
176
|
|
|
176
177
|
// ../plugins/src/twilio/schema.ts
|
|
177
|
-
|
|
178
|
-
var
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
178
|
+
import { z } from "zod/v4";
|
|
179
|
+
var getAccountInput = z.strictObject({}).describe("No input is required for this action.");
|
|
180
|
+
var getAccountOutput = z.strictObject({
|
|
181
|
+
accountSid: z.string().describe("The Twilio account SID."),
|
|
182
|
+
friendlyName: z.string().describe("The friendly name of the Twilio account.").nullable(),
|
|
183
|
+
status: z.string().describe("The current status of the Twilio account.").nullable(),
|
|
184
|
+
type: z.string().describe("The Twilio account type.").nullable()
|
|
183
185
|
}).describe("The normalized Twilio account payload.");
|
|
184
|
-
var listUsageRecordsInput =
|
|
185
|
-
category:
|
|
186
|
-
startDate:
|
|
187
|
-
endDate:
|
|
188
|
-
pageSize:
|
|
186
|
+
var listUsageRecordsInput = z.strictObject({
|
|
187
|
+
category: z.string().describe("The Twilio usage category to filter by.").optional(),
|
|
188
|
+
startDate: z.iso.date().describe("The inclusive start date in YYYY-MM-DD format.").optional(),
|
|
189
|
+
endDate: z.iso.date().describe("The inclusive end date in YYYY-MM-DD format.").optional(),
|
|
190
|
+
pageSize: z.int().min(1).describe("The maximum number of records to return in one page.").optional()
|
|
189
191
|
}).describe("The input payload for listing Twilio usage records.");
|
|
190
|
-
var listUsageRecordsOutput =
|
|
191
|
-
usageRecords:
|
|
192
|
-
accountSid:
|
|
193
|
-
category:
|
|
194
|
-
count:
|
|
195
|
-
countUnit:
|
|
196
|
-
usage:
|
|
197
|
-
usageUnit:
|
|
198
|
-
price:
|
|
199
|
-
priceUnit:
|
|
200
|
-
startDate:
|
|
201
|
-
endDate:
|
|
192
|
+
var listUsageRecordsOutput = z.strictObject({
|
|
193
|
+
usageRecords: z.array(z.strictObject({
|
|
194
|
+
accountSid: z.string().describe("The Twilio account SID that owns the usage.").nullable().optional(),
|
|
195
|
+
category: z.string().describe("The Twilio usage category.").nullable().optional(),
|
|
196
|
+
count: z.string().describe("The number of units consumed in the record.").nullable().optional(),
|
|
197
|
+
countUnit: z.string().describe("The unit for the usage count.").nullable().optional(),
|
|
198
|
+
usage: z.string().describe("The aggregated usage amount.").nullable().optional(),
|
|
199
|
+
usageUnit: z.string().describe("The unit for the aggregated usage amount.").nullable().optional(),
|
|
200
|
+
price: z.string().describe("The billed price for the usage record.").nullable().optional(),
|
|
201
|
+
priceUnit: z.string().describe("The currency unit for the billed price.").nullable().optional(),
|
|
202
|
+
startDate: z.string().describe("The inclusive start date of the usage record.").nullable().optional(),
|
|
203
|
+
endDate: z.string().describe("The inclusive end date of the usage record.").nullable().optional()
|
|
202
204
|
}).describe("One normalized Twilio usage record.")).describe("The normalized usage records returned by Twilio."),
|
|
203
|
-
page:
|
|
204
|
-
pageSize:
|
|
205
|
-
nextPageUri:
|
|
205
|
+
page: z.int().describe("The current Twilio result page.").nullable(),
|
|
206
|
+
pageSize: z.int().describe("The Twilio page size for this result.").nullable(),
|
|
207
|
+
nextPageUri: z.string().describe("The next page URI returned by Twilio, if any.").nullable()
|
|
206
208
|
}).describe("The output payload for listing Twilio usage records.");
|
|
207
|
-
var listMessagesInput =
|
|
208
|
-
to:
|
|
209
|
-
from:
|
|
210
|
-
pageSize:
|
|
211
|
-
pageToken:
|
|
209
|
+
var listMessagesInput = z.strictObject({
|
|
210
|
+
to: z.string().describe("Only include messages sent to this phone number.").optional(),
|
|
211
|
+
from: z.string().describe("Only include messages sent from this phone number.").optional(),
|
|
212
|
+
pageSize: z.int().min(1).describe("The maximum number of records to return in one page.").optional(),
|
|
213
|
+
pageToken: z.string().describe("The Twilio page token used to continue a previous listing.").optional()
|
|
212
214
|
}).describe("The input payload for listing Twilio messages.");
|
|
213
|
-
var listMessagesOutput =
|
|
214
|
-
messages:
|
|
215
|
-
messageSid:
|
|
216
|
-
accountSid:
|
|
217
|
-
status:
|
|
218
|
-
to:
|
|
219
|
-
from:
|
|
220
|
-
body:
|
|
215
|
+
var listMessagesOutput = z.strictObject({
|
|
216
|
+
messages: z.array(z.strictObject({
|
|
217
|
+
messageSid: z.string().describe("The Twilio message SID.").optional(),
|
|
218
|
+
accountSid: z.string().describe("The Twilio account SID that owns the message.").nullable().optional(),
|
|
219
|
+
status: z.string().describe("The delivery status of the message.").nullable().optional(),
|
|
220
|
+
to: z.string().describe("The destination phone number.").nullable().optional(),
|
|
221
|
+
from: z.string().describe("The sender phone number.").nullable().optional(),
|
|
222
|
+
body: z.string().describe("The text body of the message.").nullable().optional()
|
|
221
223
|
}).describe("The normalized Twilio message payload.")).describe("The normalized Twilio messages."),
|
|
222
|
-
nextPageUri:
|
|
224
|
+
nextPageUri: z.string().describe("The next page URI returned by Twilio, if any.").nullable()
|
|
223
225
|
}).describe("The output payload for listing Twilio messages.");
|
|
224
|
-
var getMessageInput =
|
|
225
|
-
messageSid:
|
|
226
|
+
var getMessageInput = z.strictObject({
|
|
227
|
+
messageSid: z.string().min(1).describe("The Twilio message SID to fetch.")
|
|
226
228
|
}).describe("The input payload for fetching one Twilio message.");
|
|
227
|
-
var getMessageOutput =
|
|
228
|
-
messageSid:
|
|
229
|
-
accountSid:
|
|
230
|
-
status:
|
|
231
|
-
to:
|
|
232
|
-
from:
|
|
233
|
-
body:
|
|
229
|
+
var getMessageOutput = z.strictObject({
|
|
230
|
+
messageSid: z.string().describe("The Twilio message SID.").optional(),
|
|
231
|
+
accountSid: z.string().describe("The Twilio account SID that owns the message.").nullable().optional(),
|
|
232
|
+
status: z.string().describe("The delivery status of the message.").nullable().optional(),
|
|
233
|
+
to: z.string().describe("The destination phone number.").nullable().optional(),
|
|
234
|
+
from: z.string().describe("The sender phone number.").nullable().optional(),
|
|
235
|
+
body: z.string().describe("The text body of the message.").nullable().optional()
|
|
234
236
|
}).describe("The normalized Twilio message payload.");
|
|
235
|
-
var sendMessageInput =
|
|
236
|
-
to:
|
|
237
|
-
from:
|
|
238
|
-
body:
|
|
237
|
+
var sendMessageInput = z.strictObject({
|
|
238
|
+
to: z.string().min(1).describe("The destination phone number in E.164 format."),
|
|
239
|
+
from: z.string().min(1).describe("The Twilio phone number sending the message."),
|
|
240
|
+
body: z.string().min(1).describe("The text body of the outbound message.")
|
|
239
241
|
}).describe("The input payload for sending a Twilio message.");
|
|
240
|
-
var sendMessageOutput =
|
|
241
|
-
messageSid:
|
|
242
|
-
accountSid:
|
|
243
|
-
status:
|
|
244
|
-
to:
|
|
245
|
-
from:
|
|
246
|
-
body:
|
|
242
|
+
var sendMessageOutput = z.strictObject({
|
|
243
|
+
messageSid: z.string().describe("The Twilio message SID.").optional(),
|
|
244
|
+
accountSid: z.string().describe("The Twilio account SID that owns the message.").nullable().optional(),
|
|
245
|
+
status: z.string().describe("The delivery status of the message.").nullable().optional(),
|
|
246
|
+
to: z.string().describe("The destination phone number.").nullable().optional(),
|
|
247
|
+
from: z.string().describe("The sender phone number.").nullable().optional(),
|
|
248
|
+
body: z.string().describe("The text body of the message.").nullable().optional()
|
|
247
249
|
}).describe("The normalized Twilio message payload.");
|
|
248
250
|
var twilioActions = {
|
|
249
251
|
get_account: {
|
|
250
252
|
description: "Fetch the current Twilio account profile for the connected credential.",
|
|
251
253
|
effect: "read",
|
|
252
254
|
inputSchema: getAccountInput,
|
|
253
|
-
outputSchema:
|
|
255
|
+
outputSchema: z.toJSONSchema(getAccountOutput, { io: "output", unrepresentable: "any" })
|
|
254
256
|
},
|
|
255
257
|
list_usage_records: {
|
|
256
258
|
description: "List Twilio usage records for the connected account.",
|
|
257
259
|
effect: "read",
|
|
258
260
|
inputSchema: listUsageRecordsInput,
|
|
259
|
-
outputSchema:
|
|
261
|
+
outputSchema: z.toJSONSchema(listUsageRecordsOutput, { io: "output", unrepresentable: "any" })
|
|
260
262
|
},
|
|
261
263
|
list_messages: {
|
|
262
264
|
description: "List SMS or MMS messages for the connected Twilio account.",
|
|
263
265
|
effect: "read",
|
|
264
266
|
inputSchema: listMessagesInput,
|
|
265
|
-
outputSchema:
|
|
267
|
+
outputSchema: z.toJSONSchema(listMessagesOutput, { io: "output", unrepresentable: "any" })
|
|
266
268
|
},
|
|
267
269
|
get_message: {
|
|
268
270
|
description: "Fetch one Twilio message by message SID.",
|
|
269
271
|
effect: "read",
|
|
270
272
|
inputSchema: getMessageInput,
|
|
271
|
-
outputSchema:
|
|
273
|
+
outputSchema: z.toJSONSchema(getMessageOutput, { io: "output", unrepresentable: "any" })
|
|
272
274
|
},
|
|
273
275
|
send_message: {
|
|
274
276
|
description: "Send an outbound SMS or MMS message with Twilio.",
|
|
275
277
|
effect: "write",
|
|
276
278
|
inputSchema: sendMessageInput,
|
|
277
|
-
outputSchema:
|
|
279
|
+
outputSchema: z.toJSONSchema(sendMessageOutput, { io: "output", unrepresentable: "any" })
|
|
278
280
|
}
|
|
279
281
|
};
|
|
280
282
|
|