@tool-bridge/server 0.1.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/airtable-V6446SVY.js +792 -0
- package/dist/alt_text_generator_ai-HV7JZPDT.js +72 -0
- package/dist/amap-TTTVB6WS.js +755 -0
- package/dist/anthropic-JH3RA363.js +224 -0
- package/dist/apify-ETNN7ITU.js +262 -0
- package/dist/brave_search-3DDR2MMB.js +322 -0
- package/dist/chunk-CSJEZHQO.js +252 -0
- package/dist/chunk-JLTYA2B3.js +20121 -0
- package/dist/chunk-K7FVSFUX.js +333 -0
- package/dist/{chunk-MQEYFCJB.js → chunk-KGYJEEBI.js} +2770 -21574
- package/dist/circleci-MX3TX3HC.js +409 -0
- package/dist/clerk-MRPORVF4.js +1036 -0
- package/dist/cloudflare_dns-OWP7DD7L.js +605 -0
- package/dist/cohere-GPECP66S.js +197 -0
- package/dist/confluence-BN7LZ6BC.js +436 -0
- package/dist/convertapi-SBEOFOFQ.js +161 -0
- package/dist/currencyapi-P2YY7Y7P.js +306 -0
- package/dist/deepseek-MWB3NYIN.js +205 -0
- package/dist/docker_hub-3JSCIGQ3.js +946 -0
- package/dist/dropbox-RFIBDAXO.js +1308 -0
- package/dist/dub-YVP57ELQ.js +706 -0
- package/dist/e2b-NFSUHTZR.js +305 -0
- package/dist/exa-KTDY6IV3.js +360 -0
- package/dist/fal_ai-OCUENLNQ.js +405 -0
- package/dist/feishu-5CWBQ7E5.js +225 -0
- package/dist/feishu_custom_bot-ZJR22OK6.js +240 -0
- package/dist/figma-YULGANSA.js +798 -0
- package/dist/firehydrant-2V6YSYAP.js +573 -0
- package/dist/fixer-LTCDB3CJ.js +171 -0
- package/dist/fly-IXPKMAML.js +478 -0
- package/dist/front-KRFB4M5X.js +379 -0
- package/dist/geocodio-VVURKYHQ.js +236 -0
- package/dist/ghost-6J2RIOUB.js +341 -0
- package/dist/github-5Z6KQRYH.js +5410 -0
- package/dist/gmail-KU4NZ7VA.js +1894 -0
- package/dist/googlecalendar-X44DFFXG.js +2539 -0
- package/dist/googledocs-WSGLPKSF.js +1322 -0
- package/dist/grafana-4PKSSDXY.js +817 -0
- package/dist/graphhopper-DF65ZNGK.js +336 -0
- package/dist/index.d.ts +181 -2
- package/dist/index.js +2 -1
- package/dist/ip2proxy-UCAQ5P2J.js +118 -0
- package/dist/ipgeolocation_io-UX6FCA2S.js +333 -0
- package/dist/ipqualityscore-MKTRXIZJ.js +287 -0
- package/dist/jina_ai-MRHPCSV5.js +119 -0
- package/dist/jira-EG7ZPOIW.js +627 -0
- package/dist/langsmith-FNO3RCOZ.js +597 -0
- package/dist/lemlist-SN6BJHSG.js +298 -0
- package/dist/linear-H3VU4PSD.js +2163 -0
- package/dist/logsnag-OY2JJT2H.js +167 -0
- package/dist/main.js +246 -2
- package/dist/mattermost-C5SQ7PGD.js +320 -0
- package/dist/mem0-LMLE5BFC.js +567 -0
- package/dist/memos-UWFAMBZC.js +781 -0
- package/dist/metabase-SRYDSDJ6.js +365 -0
- package/dist/mistral_ai-YNIJ7VDM.js +1195 -0
- package/dist/mother_duck-CPGOFEXE.js +322 -0
- package/dist/ngrok-CDJFBSOM.js +375 -0
- package/dist/notes-DIVFH3P3.js +109 -0
- package/dist/notion-HGDKS4HK.js +945 -0
- package/dist/open_exchange_rates-COHHYJDD.js +216 -0
- package/dist/openai-4TRT66GW.js +795 -0
- package/dist/opengraph_io-YKVW4PXI.js +377 -0
- package/dist/openrouter-6CV7B7V5.js +444 -0
- package/dist/outline-YWDUK5F7.js +604 -0
- package/dist/paddle-MEU7HWDZ.js +464 -0
- package/dist/perplexity-MRQUDBIC.js +238 -0
- package/dist/pinecone-JI7X2TAF.js +599 -0
- package/dist/pipedrive-6JQPAW23.js +453 -0
- package/dist/polar-7BF56CMC.js +400 -0
- package/dist/posthog-YPU5ADEN.js +3462 -0
- package/dist/postmark-BEU5OFKU.js +441 -0
- package/dist/prerender-UT5GOOZH.js +180 -0
- package/dist/pubmed-3SGOE24Q.js +1052 -0
- package/dist/railway-CEK4GLRQ.js +452 -0
- package/dist/readwise-DXQUQU67.js +482 -0
- package/dist/render-7TGAU5AW.js +473 -0
- package/dist/replicate-VICFSQ5A.js +347 -0
- package/dist/resend-3E76WK3O.js +100 -0
- package/dist/rootly-36GY46BY.js +345 -0
- package/dist/scrapfly-VDVUYAHX.js +289 -0
- package/dist/scrapingbee-3KTPMAVY.js +247 -0
- package/dist/screenshot_fyi-LKG62C3J.js +116 -0
- package/dist/semantic_scholar-4WREECYO.js +626 -0
- package/dist/sentry-HUQTGXOV.js +1139 -0
- package/dist/shodan-SGRKU4KS.js +303 -0
- package/dist/shopify-YCZ4L5HT.js +620 -0
- package/dist/stripe-OEBKMELB.js +583 -0
- package/dist/supabase-I3DBY7L4.js +937 -0
- package/dist/tavily-B2YHCNRD.js +349 -0
- package/dist/telegram-2VYJELZX.js +1773 -0
- package/dist/telnyx-HHXD3CXL.js +237 -0
- package/dist/todoist-PHFDEEIS.js +672 -0
- package/dist/trello-WUSAK6YN.js +1091 -0
- package/dist/turso-FW56U2B3.js +432 -0
- package/dist/twilio-M5JI7XHA.js +321 -0
- package/dist/umami-HAYODRC4.js +411 -0
- package/dist/unsplash-EDPTNEHJ.js +364 -0
- package/dist/upstash_redis-GC2CLIWD.js +299 -0
- package/dist/uptimerobot-XMSNYLIT.js +481 -0
- package/dist/v2ex-KU4ECD65.js +672 -0
- package/dist/vercel-THPCEFHW.js +1096 -0
- package/dist/wolfram_alpha_api-WHHTH4GU.js +212 -0
- package/dist/wordpress-O6TQEQNF.js +822 -0
- package/dist/workos-A3VHHWI3.js +681 -0
- package/dist/zhihu-BJAI64YJ.js +273 -0
- package/package.json +5 -4
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createProviderPlugin,
|
|
3
|
+
guardedFetch,
|
|
4
|
+
requireApiKey,
|
|
5
|
+
upstreamError
|
|
6
|
+
} from "./chunk-CSJEZHQO.js";
|
|
7
|
+
import "./chunk-K7FVSFUX.js";
|
|
8
|
+
import {
|
|
9
|
+
TBError,
|
|
10
|
+
external_exports
|
|
11
|
+
} from "./chunk-JLTYA2B3.js";
|
|
12
|
+
import "./chunk-MLKGABMK.js";
|
|
13
|
+
|
|
14
|
+
// ../plugins/src/turso/api.ts
|
|
15
|
+
var SERVICE = "turso";
|
|
16
|
+
var API_BASE = "https://api.turso.tech";
|
|
17
|
+
function record(value) {
|
|
18
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
19
|
+
}
|
|
20
|
+
function text(value) {
|
|
21
|
+
if (typeof value !== "string") return void 0;
|
|
22
|
+
const trimmed = value.trim();
|
|
23
|
+
return trimmed === "" ? void 0 : trimmed;
|
|
24
|
+
}
|
|
25
|
+
function requireText(value, field) {
|
|
26
|
+
const result = text(value);
|
|
27
|
+
if (result === void 0) throw new TBError("invalid_argument", `${field} is required.`);
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
function compact(input) {
|
|
31
|
+
return Object.fromEntries(Object.entries(input).filter(([, value]) => value !== void 0));
|
|
32
|
+
}
|
|
33
|
+
function responseError(message) {
|
|
34
|
+
return new TBError("unavailable", message, { retryable: true });
|
|
35
|
+
}
|
|
36
|
+
function normalizeResource(raw) {
|
|
37
|
+
return compact({
|
|
38
|
+
slug: text(raw.slug),
|
|
39
|
+
name: text(raw.name),
|
|
40
|
+
type: text(raw.type),
|
|
41
|
+
location: text(raw.location),
|
|
42
|
+
uuid: text(raw.uuid),
|
|
43
|
+
group: text(raw.group),
|
|
44
|
+
hostname: text(raw.hostname),
|
|
45
|
+
code: text(raw.code),
|
|
46
|
+
raw
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function normalizeItems(items) {
|
|
50
|
+
return items.flatMap((item) => {
|
|
51
|
+
const fields = record(item);
|
|
52
|
+
return fields === void 0 ? [] : [normalizeResource(fields)];
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function resourceList(payload, keys) {
|
|
56
|
+
if (Array.isArray(payload)) return normalizeItems(payload);
|
|
57
|
+
const fields = record(payload);
|
|
58
|
+
if (fields === void 0) throw responseError("Turso returned an invalid list response");
|
|
59
|
+
for (const key of [...keys, "data"]) {
|
|
60
|
+
const value = fields[key];
|
|
61
|
+
if (Array.isArray(value)) return normalizeItems(value);
|
|
62
|
+
}
|
|
63
|
+
throw responseError("Turso list response is missing items");
|
|
64
|
+
}
|
|
65
|
+
function singleResource(payload, keys) {
|
|
66
|
+
const fields = record(payload);
|
|
67
|
+
if (fields === void 0) throw responseError("Turso returned an invalid resource response");
|
|
68
|
+
for (const key of [...keys, "data"]) {
|
|
69
|
+
const value = record(fields[key]);
|
|
70
|
+
if (value !== void 0) return normalizeResource(value);
|
|
71
|
+
}
|
|
72
|
+
return normalizeResource(fields);
|
|
73
|
+
}
|
|
74
|
+
function readPayload(body) {
|
|
75
|
+
if (body.trim() === "") return {};
|
|
76
|
+
try {
|
|
77
|
+
return JSON.parse(body);
|
|
78
|
+
} catch {
|
|
79
|
+
return { message: body };
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function errorMessage(payload, status) {
|
|
83
|
+
const direct = text(payload);
|
|
84
|
+
if (direct !== void 0) return direct;
|
|
85
|
+
const fields = record(payload);
|
|
86
|
+
const nested = record(fields?.error);
|
|
87
|
+
const message = text(fields?.message) ?? text(fields?.error) ?? text(fields?.detail) ?? text(fields?.title) ?? text(nested?.message) ?? text(nested?.detail);
|
|
88
|
+
return message ?? `Turso request failed with ${status}`;
|
|
89
|
+
}
|
|
90
|
+
async function request(ctx, input) {
|
|
91
|
+
const apiKey = requireApiKey(ctx, SERVICE);
|
|
92
|
+
let response;
|
|
93
|
+
let payload;
|
|
94
|
+
try {
|
|
95
|
+
response = await guardedFetch(`${API_BASE}${input.path}`, {
|
|
96
|
+
method: input.method,
|
|
97
|
+
headers: {
|
|
98
|
+
accept: "application/json",
|
|
99
|
+
authorization: `Bearer ${apiKey}`,
|
|
100
|
+
...input.body === void 0 ? {} : { "content-type": "application/json" }
|
|
101
|
+
},
|
|
102
|
+
body: input.body === void 0 ? void 0 : JSON.stringify(input.body)
|
|
103
|
+
});
|
|
104
|
+
payload = readPayload(await response.text());
|
|
105
|
+
} catch (error) {
|
|
106
|
+
if (error instanceof TBError) throw error;
|
|
107
|
+
throw upstreamError(502, error instanceof Error ? `Turso request failed: ${error.message}` : "Turso request failed");
|
|
108
|
+
}
|
|
109
|
+
if (!response.ok) throw upstreamError(response.status, errorMessage(payload, response.status));
|
|
110
|
+
return payload;
|
|
111
|
+
}
|
|
112
|
+
function organizationPath(organizationSlug) {
|
|
113
|
+
return `/v1/organizations/${encodeURIComponent(requireText(organizationSlug, "organizationSlug"))}`;
|
|
114
|
+
}
|
|
115
|
+
function extensions(value) {
|
|
116
|
+
if (value === void 0 || value === "all") return value;
|
|
117
|
+
return value.map((item) => requireText(item, "extensions"));
|
|
118
|
+
}
|
|
119
|
+
async function listOrganizations(_input, ctx) {
|
|
120
|
+
const payload = await request(ctx, { method: "GET", path: "/v1/organizations" });
|
|
121
|
+
return { organizations: resourceList(payload, ["organizations"]) };
|
|
122
|
+
}
|
|
123
|
+
async function getOrganization(input, ctx) {
|
|
124
|
+
const payload = await request(ctx, { method: "GET", path: organizationPath(input.organizationSlug) });
|
|
125
|
+
return { organization: singleResource(payload, ["organization"]) };
|
|
126
|
+
}
|
|
127
|
+
async function listLocations(_input, ctx) {
|
|
128
|
+
const payload = await request(ctx, { method: "GET", path: "/v1/locations" });
|
|
129
|
+
return { locations: resourceList(payload, ["locations", "regions"]) };
|
|
130
|
+
}
|
|
131
|
+
async function listGroups(input, ctx) {
|
|
132
|
+
const payload = await request(ctx, { method: "GET", path: `${organizationPath(input.organizationSlug)}/groups` });
|
|
133
|
+
return { groups: resourceList(payload, ["groups"]) };
|
|
134
|
+
}
|
|
135
|
+
async function getGroup(input, ctx) {
|
|
136
|
+
const name = encodeURIComponent(requireText(input.name, "name"));
|
|
137
|
+
const payload = await request(ctx, {
|
|
138
|
+
method: "GET",
|
|
139
|
+
path: `${organizationPath(input.organizationSlug)}/groups/${name}`
|
|
140
|
+
});
|
|
141
|
+
return { group: singleResource(payload, ["group"]) };
|
|
142
|
+
}
|
|
143
|
+
async function createGroup(input, ctx) {
|
|
144
|
+
const payload = await request(ctx, {
|
|
145
|
+
method: "POST",
|
|
146
|
+
path: `${organizationPath(input.organizationSlug)}/groups`,
|
|
147
|
+
body: compact({
|
|
148
|
+
name: requireText(input.name, "name"),
|
|
149
|
+
location: requireText(input.location, "location"),
|
|
150
|
+
extensions: extensions(input.extensions)
|
|
151
|
+
})
|
|
152
|
+
});
|
|
153
|
+
return { group: singleResource(payload, ["group"]) };
|
|
154
|
+
}
|
|
155
|
+
async function listDatabases(input, ctx) {
|
|
156
|
+
const payload = await request(ctx, { method: "GET", path: `${organizationPath(input.organizationSlug)}/databases` });
|
|
157
|
+
return { databases: resourceList(payload, ["databases"]) };
|
|
158
|
+
}
|
|
159
|
+
async function getDatabase(input, ctx) {
|
|
160
|
+
const name = encodeURIComponent(requireText(input.name, "name"));
|
|
161
|
+
const payload = await request(ctx, {
|
|
162
|
+
method: "GET",
|
|
163
|
+
path: `${organizationPath(input.organizationSlug)}/databases/${name}`
|
|
164
|
+
});
|
|
165
|
+
return { database: singleResource(payload, ["database"]) };
|
|
166
|
+
}
|
|
167
|
+
async function createDatabase(input, ctx) {
|
|
168
|
+
const payload = await request(ctx, {
|
|
169
|
+
method: "POST",
|
|
170
|
+
path: `${organizationPath(input.organizationSlug)}/databases`,
|
|
171
|
+
// 上游这里没走 compactObject:两个字段都是必填,给不出就该在断言处炸。
|
|
172
|
+
body: {
|
|
173
|
+
name: requireText(input.name, "name"),
|
|
174
|
+
group: requireText(input.group, "group")
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
return { database: singleResource(payload, ["database"]) };
|
|
178
|
+
}
|
|
179
|
+
async function deleteDatabase(input, ctx) {
|
|
180
|
+
const name = encodeURIComponent(requireText(input.name, "name"));
|
|
181
|
+
await request(ctx, {
|
|
182
|
+
method: "DELETE",
|
|
183
|
+
path: `${organizationPath(input.organizationSlug)}/databases/${name}`
|
|
184
|
+
});
|
|
185
|
+
return { deleted: true };
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// ../plugins/src/turso/schema.ts
|
|
189
|
+
var listOrganizationsInput = external_exports.strictObject({}).describe("The input payload for listing Turso organizations.");
|
|
190
|
+
var listOrganizationsOutput = external_exports.strictObject({
|
|
191
|
+
organizations: external_exports.array(external_exports.strictObject({
|
|
192
|
+
slug: external_exports.string().min(1).describe("The resource slug when Turso returns one.").optional(),
|
|
193
|
+
name: external_exports.string().min(1).describe("The resource name when Turso returns one.").optional(),
|
|
194
|
+
type: external_exports.string().min(1).describe("The resource type when Turso returns one.").optional(),
|
|
195
|
+
location: external_exports.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
196
|
+
uuid: external_exports.string().min(1).describe("The UUID when Turso returns one.").optional(),
|
|
197
|
+
group: external_exports.string().min(1).describe("The group name when Turso returns one.").optional(),
|
|
198
|
+
hostname: external_exports.string().min(1).describe("The database hostname when Turso returns one.").optional(),
|
|
199
|
+
code: external_exports.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
200
|
+
raw: external_exports.looseObject({}).describe("The raw Turso resource object returned by the Platform API.")
|
|
201
|
+
}).describe("A normalized Turso Platform API resource.")).describe("The organizations visible to the current API token.")
|
|
202
|
+
}).describe("The organizations returned by the Turso Platform API.");
|
|
203
|
+
var getOrganizationInput = external_exports.strictObject({
|
|
204
|
+
organizationSlug: external_exports.string().min(1).describe("The organization slug used in the Turso API path.")
|
|
205
|
+
}).describe("The input payload for retrieving one organization.");
|
|
206
|
+
var getOrganizationOutput = external_exports.strictObject({
|
|
207
|
+
organization: external_exports.strictObject({
|
|
208
|
+
slug: external_exports.string().min(1).describe("The resource slug when Turso returns one.").optional(),
|
|
209
|
+
name: external_exports.string().min(1).describe("The resource name when Turso returns one.").optional(),
|
|
210
|
+
type: external_exports.string().min(1).describe("The resource type when Turso returns one.").optional(),
|
|
211
|
+
location: external_exports.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
212
|
+
uuid: external_exports.string().min(1).describe("The UUID when Turso returns one.").optional(),
|
|
213
|
+
group: external_exports.string().min(1).describe("The group name when Turso returns one.").optional(),
|
|
214
|
+
hostname: external_exports.string().min(1).describe("The database hostname when Turso returns one.").optional(),
|
|
215
|
+
code: external_exports.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
216
|
+
raw: external_exports.looseObject({}).describe("The raw Turso resource object returned by the Platform API.")
|
|
217
|
+
}).describe("A normalized Turso Platform API resource.")
|
|
218
|
+
}).describe("The organization returned by the Turso Platform API.");
|
|
219
|
+
var listLocationsInput = external_exports.strictObject({}).describe("The input payload for listing Turso locations.");
|
|
220
|
+
var listLocationsOutput = external_exports.strictObject({
|
|
221
|
+
locations: external_exports.array(external_exports.strictObject({
|
|
222
|
+
slug: external_exports.string().min(1).describe("The resource slug when Turso returns one.").optional(),
|
|
223
|
+
name: external_exports.string().min(1).describe("The resource name when Turso returns one.").optional(),
|
|
224
|
+
type: external_exports.string().min(1).describe("The resource type when Turso returns one.").optional(),
|
|
225
|
+
location: external_exports.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
226
|
+
uuid: external_exports.string().min(1).describe("The UUID when Turso returns one.").optional(),
|
|
227
|
+
group: external_exports.string().min(1).describe("The group name when Turso returns one.").optional(),
|
|
228
|
+
hostname: external_exports.string().min(1).describe("The database hostname when Turso returns one.").optional(),
|
|
229
|
+
code: external_exports.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
230
|
+
raw: external_exports.looseObject({}).describe("The raw Turso resource object returned by the Platform API.")
|
|
231
|
+
}).describe("A normalized Turso Platform API resource.")).describe("The available Turso locations.")
|
|
232
|
+
}).describe("The locations returned by the Turso Platform API.");
|
|
233
|
+
var listGroupsInput = external_exports.strictObject({
|
|
234
|
+
organizationSlug: external_exports.string().min(1).describe("The organization slug used in the Turso API path.")
|
|
235
|
+
}).describe("The input payload for listing Turso groups.");
|
|
236
|
+
var listGroupsOutput = external_exports.strictObject({
|
|
237
|
+
groups: external_exports.array(external_exports.strictObject({
|
|
238
|
+
slug: external_exports.string().min(1).describe("The resource slug when Turso returns one.").optional(),
|
|
239
|
+
name: external_exports.string().min(1).describe("The resource name when Turso returns one.").optional(),
|
|
240
|
+
type: external_exports.string().min(1).describe("The resource type when Turso returns one.").optional(),
|
|
241
|
+
location: external_exports.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
242
|
+
uuid: external_exports.string().min(1).describe("The UUID when Turso returns one.").optional(),
|
|
243
|
+
group: external_exports.string().min(1).describe("The group name when Turso returns one.").optional(),
|
|
244
|
+
hostname: external_exports.string().min(1).describe("The database hostname when Turso returns one.").optional(),
|
|
245
|
+
code: external_exports.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
246
|
+
raw: external_exports.looseObject({}).describe("The raw Turso resource object returned by the Platform API.")
|
|
247
|
+
}).describe("A normalized Turso Platform API resource.")).describe("The Turso groups belonging to the organization.")
|
|
248
|
+
}).describe("The Turso groups returned for one organization.");
|
|
249
|
+
var getGroupInput = external_exports.strictObject({
|
|
250
|
+
organizationSlug: external_exports.string().min(1).describe("The organization slug used in the Turso API path."),
|
|
251
|
+
name: external_exports.string().min(1).describe("The Turso group name.")
|
|
252
|
+
}).describe("The input payload for retrieving one Turso group.");
|
|
253
|
+
var getGroupOutput = external_exports.strictObject({
|
|
254
|
+
group: external_exports.strictObject({
|
|
255
|
+
slug: external_exports.string().min(1).describe("The resource slug when Turso returns one.").optional(),
|
|
256
|
+
name: external_exports.string().min(1).describe("The resource name when Turso returns one.").optional(),
|
|
257
|
+
type: external_exports.string().min(1).describe("The resource type when Turso returns one.").optional(),
|
|
258
|
+
location: external_exports.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
259
|
+
uuid: external_exports.string().min(1).describe("The UUID when Turso returns one.").optional(),
|
|
260
|
+
group: external_exports.string().min(1).describe("The group name when Turso returns one.").optional(),
|
|
261
|
+
hostname: external_exports.string().min(1).describe("The database hostname when Turso returns one.").optional(),
|
|
262
|
+
code: external_exports.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
263
|
+
raw: external_exports.looseObject({}).describe("The raw Turso resource object returned by the Platform API.")
|
|
264
|
+
}).describe("A normalized Turso Platform API resource.")
|
|
265
|
+
}).describe("The Turso group returned by the Platform API.");
|
|
266
|
+
var createGroupInput = external_exports.strictObject({
|
|
267
|
+
organizationSlug: external_exports.string().min(1).describe("The organization slug used in the Turso API path."),
|
|
268
|
+
name: external_exports.string().min(1).describe("The Turso group name."),
|
|
269
|
+
location: external_exports.string().min(1).describe("The primary Turso location code for the group."),
|
|
270
|
+
extensions: external_exports.union([external_exports.enum(["all"]).describe("Enable every supported extension."), external_exports.array(external_exports.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()
|
|
271
|
+
}).describe("The input payload for creating a Turso group.");
|
|
272
|
+
var createGroupOutput = external_exports.strictObject({
|
|
273
|
+
group: external_exports.strictObject({
|
|
274
|
+
slug: external_exports.string().min(1).describe("The resource slug when Turso returns one.").optional(),
|
|
275
|
+
name: external_exports.string().min(1).describe("The resource name when Turso returns one.").optional(),
|
|
276
|
+
type: external_exports.string().min(1).describe("The resource type when Turso returns one.").optional(),
|
|
277
|
+
location: external_exports.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
278
|
+
uuid: external_exports.string().min(1).describe("The UUID when Turso returns one.").optional(),
|
|
279
|
+
group: external_exports.string().min(1).describe("The group name when Turso returns one.").optional(),
|
|
280
|
+
hostname: external_exports.string().min(1).describe("The database hostname when Turso returns one.").optional(),
|
|
281
|
+
code: external_exports.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
282
|
+
raw: external_exports.looseObject({}).describe("The raw Turso resource object returned by the Platform API.")
|
|
283
|
+
}).describe("A normalized Turso Platform API resource.")
|
|
284
|
+
}).describe("The newly created Turso group.");
|
|
285
|
+
var listDatabasesInput = external_exports.strictObject({
|
|
286
|
+
organizationSlug: external_exports.string().min(1).describe("The organization slug used in the Turso API path.")
|
|
287
|
+
}).describe("The input payload for listing Turso databases.");
|
|
288
|
+
var listDatabasesOutput = external_exports.strictObject({
|
|
289
|
+
databases: external_exports.array(external_exports.strictObject({
|
|
290
|
+
slug: external_exports.string().min(1).describe("The resource slug when Turso returns one.").optional(),
|
|
291
|
+
name: external_exports.string().min(1).describe("The resource name when Turso returns one.").optional(),
|
|
292
|
+
type: external_exports.string().min(1).describe("The resource type when Turso returns one.").optional(),
|
|
293
|
+
location: external_exports.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
294
|
+
uuid: external_exports.string().min(1).describe("The UUID when Turso returns one.").optional(),
|
|
295
|
+
group: external_exports.string().min(1).describe("The group name when Turso returns one.").optional(),
|
|
296
|
+
hostname: external_exports.string().min(1).describe("The database hostname when Turso returns one.").optional(),
|
|
297
|
+
code: external_exports.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
298
|
+
raw: external_exports.looseObject({}).describe("The raw Turso resource object returned by the Platform API.")
|
|
299
|
+
}).describe("A normalized Turso Platform API resource.")).describe("The Turso databases belonging to the organization.")
|
|
300
|
+
}).describe("The Turso databases returned for one organization.");
|
|
301
|
+
var getDatabaseInput = external_exports.strictObject({
|
|
302
|
+
organizationSlug: external_exports.string().min(1).describe("The organization slug used in the Turso API path."),
|
|
303
|
+
name: external_exports.string().min(1).describe("The Turso database name.")
|
|
304
|
+
}).describe("The input payload for retrieving one Turso database.");
|
|
305
|
+
var getDatabaseOutput = external_exports.strictObject({
|
|
306
|
+
database: external_exports.strictObject({
|
|
307
|
+
slug: external_exports.string().min(1).describe("The resource slug when Turso returns one.").optional(),
|
|
308
|
+
name: external_exports.string().min(1).describe("The resource name when Turso returns one.").optional(),
|
|
309
|
+
type: external_exports.string().min(1).describe("The resource type when Turso returns one.").optional(),
|
|
310
|
+
location: external_exports.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
311
|
+
uuid: external_exports.string().min(1).describe("The UUID when Turso returns one.").optional(),
|
|
312
|
+
group: external_exports.string().min(1).describe("The group name when Turso returns one.").optional(),
|
|
313
|
+
hostname: external_exports.string().min(1).describe("The database hostname when Turso returns one.").optional(),
|
|
314
|
+
code: external_exports.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
315
|
+
raw: external_exports.looseObject({}).describe("The raw Turso resource object returned by the Platform API.")
|
|
316
|
+
}).describe("A normalized Turso Platform API resource.")
|
|
317
|
+
}).describe("The Turso database returned by the Platform API.");
|
|
318
|
+
var createDatabaseInput = external_exports.strictObject({
|
|
319
|
+
organizationSlug: external_exports.string().min(1).describe("The organization slug used in the Turso API path."),
|
|
320
|
+
name: external_exports.string().min(1).describe("The Turso database name."),
|
|
321
|
+
group: external_exports.string().min(1).describe("The Turso group where the database should be created.")
|
|
322
|
+
}).describe("The input payload for creating a Turso database.");
|
|
323
|
+
var createDatabaseOutput = external_exports.strictObject({
|
|
324
|
+
database: external_exports.strictObject({
|
|
325
|
+
slug: external_exports.string().min(1).describe("The resource slug when Turso returns one.").optional(),
|
|
326
|
+
name: external_exports.string().min(1).describe("The resource name when Turso returns one.").optional(),
|
|
327
|
+
type: external_exports.string().min(1).describe("The resource type when Turso returns one.").optional(),
|
|
328
|
+
location: external_exports.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
329
|
+
uuid: external_exports.string().min(1).describe("The UUID when Turso returns one.").optional(),
|
|
330
|
+
group: external_exports.string().min(1).describe("The group name when Turso returns one.").optional(),
|
|
331
|
+
hostname: external_exports.string().min(1).describe("The database hostname when Turso returns one.").optional(),
|
|
332
|
+
code: external_exports.string().min(1).describe("The location code when Turso returns one.").optional(),
|
|
333
|
+
raw: external_exports.looseObject({}).describe("The raw Turso resource object returned by the Platform API.")
|
|
334
|
+
}).describe("A normalized Turso Platform API resource.")
|
|
335
|
+
}).describe("The newly created Turso database.");
|
|
336
|
+
var deleteDatabaseInput = external_exports.strictObject({
|
|
337
|
+
organizationSlug: external_exports.string().min(1).describe("The organization slug used in the Turso API path."),
|
|
338
|
+
name: external_exports.string().min(1).describe("The Turso database name.")
|
|
339
|
+
}).describe("The input payload for deleting one Turso database.");
|
|
340
|
+
var deleteDatabaseOutput = external_exports.strictObject({
|
|
341
|
+
deleted: external_exports.boolean().describe("Whether the connector finished the delete request successfully.")
|
|
342
|
+
}).describe("The normalized delete result returned by the connector.");
|
|
343
|
+
var tursoActions = {
|
|
344
|
+
list_organizations: {
|
|
345
|
+
description: "List organizations visible to the current Turso Platform API token.",
|
|
346
|
+
effect: "read",
|
|
347
|
+
inputSchema: listOrganizationsInput,
|
|
348
|
+
outputSchema: external_exports.toJSONSchema(listOrganizationsOutput, { io: "output", unrepresentable: "any" })
|
|
349
|
+
},
|
|
350
|
+
get_organization: {
|
|
351
|
+
description: "Retrieve one Turso organization by slug.",
|
|
352
|
+
effect: "read",
|
|
353
|
+
inputSchema: getOrganizationInput,
|
|
354
|
+
outputSchema: external_exports.toJSONSchema(getOrganizationOutput, { io: "output", unrepresentable: "any" })
|
|
355
|
+
},
|
|
356
|
+
list_locations: {
|
|
357
|
+
description: "List available Turso locations that can host groups.",
|
|
358
|
+
effect: "read",
|
|
359
|
+
inputSchema: listLocationsInput,
|
|
360
|
+
outputSchema: external_exports.toJSONSchema(listLocationsOutput, { io: "output", unrepresentable: "any" })
|
|
361
|
+
},
|
|
362
|
+
list_groups: {
|
|
363
|
+
description: "List Turso groups for one organization.",
|
|
364
|
+
effect: "read",
|
|
365
|
+
inputSchema: listGroupsInput,
|
|
366
|
+
outputSchema: external_exports.toJSONSchema(listGroupsOutput, { io: "output", unrepresentable: "any" })
|
|
367
|
+
},
|
|
368
|
+
get_group: {
|
|
369
|
+
description: "Retrieve one Turso group by name within an organization.",
|
|
370
|
+
effect: "read",
|
|
371
|
+
inputSchema: getGroupInput,
|
|
372
|
+
outputSchema: external_exports.toJSONSchema(getGroupOutput, { io: "output", unrepresentable: "any" })
|
|
373
|
+
},
|
|
374
|
+
create_group: {
|
|
375
|
+
description: "Create a Turso group in one organization with a primary location.",
|
|
376
|
+
effect: "write",
|
|
377
|
+
inputSchema: createGroupInput,
|
|
378
|
+
outputSchema: external_exports.toJSONSchema(createGroupOutput, { io: "output", unrepresentable: "any" })
|
|
379
|
+
},
|
|
380
|
+
list_databases: {
|
|
381
|
+
description: "List Turso databases for one organization.",
|
|
382
|
+
effect: "read",
|
|
383
|
+
inputSchema: listDatabasesInput,
|
|
384
|
+
outputSchema: external_exports.toJSONSchema(listDatabasesOutput, { io: "output", unrepresentable: "any" })
|
|
385
|
+
},
|
|
386
|
+
get_database: {
|
|
387
|
+
description: "Retrieve one Turso database by name within an organization.",
|
|
388
|
+
effect: "read",
|
|
389
|
+
inputSchema: getDatabaseInput,
|
|
390
|
+
outputSchema: external_exports.toJSONSchema(getDatabaseOutput, { io: "output", unrepresentable: "any" })
|
|
391
|
+
},
|
|
392
|
+
create_database: {
|
|
393
|
+
description: "Create a Turso database in one organization and group.",
|
|
394
|
+
effect: "write",
|
|
395
|
+
inputSchema: createDatabaseInput,
|
|
396
|
+
outputSchema: external_exports.toJSONSchema(createDatabaseOutput, { io: "output", unrepresentable: "any" })
|
|
397
|
+
},
|
|
398
|
+
delete_database: {
|
|
399
|
+
description: "Delete a Turso database from one organization.",
|
|
400
|
+
effect: "destructive",
|
|
401
|
+
inputSchema: deleteDatabaseInput,
|
|
402
|
+
outputSchema: external_exports.toJSONSchema(deleteDatabaseOutput, { io: "output", unrepresentable: "any" })
|
|
403
|
+
}
|
|
404
|
+
};
|
|
405
|
+
|
|
406
|
+
// ../plugins/src/turso/index.ts
|
|
407
|
+
function createTursoPlugin() {
|
|
408
|
+
return createProviderPlugin({
|
|
409
|
+
description: "Turso",
|
|
410
|
+
actions: tursoActions,
|
|
411
|
+
// 上游 credentialValidators 打的 `/v1/auth/validate` 没有对应 action;`list_organizations`
|
|
412
|
+
// 同样只读、无必填入参,且同样要求 Platform token 有效,拿它当挂载时的凭证探针。
|
|
413
|
+
credentialProbe: "list_organizations",
|
|
414
|
+
handlers: {
|
|
415
|
+
list_organizations: listOrganizations,
|
|
416
|
+
get_organization: getOrganization,
|
|
417
|
+
list_locations: listLocations,
|
|
418
|
+
list_groups: listGroups,
|
|
419
|
+
get_group: getGroup,
|
|
420
|
+
create_group: createGroup,
|
|
421
|
+
list_databases: listDatabases,
|
|
422
|
+
get_database: getDatabase,
|
|
423
|
+
create_database: createDatabase,
|
|
424
|
+
delete_database: deleteDatabase
|
|
425
|
+
}
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
var turso_default = createTursoPlugin();
|
|
429
|
+
export {
|
|
430
|
+
createTursoPlugin,
|
|
431
|
+
turso_default as default
|
|
432
|
+
};
|