@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
|
@@ -1,350 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createAuthedClient
|
|
3
|
-
} from "./chunk-XYBU3WZH.js";
|
|
4
|
-
import "./chunk-E6JCVKW6.js";
|
|
5
|
-
import {
|
|
6
|
-
asJsonObject,
|
|
7
|
-
finiteNumber,
|
|
8
|
-
trimmedText
|
|
9
|
-
} from "./chunk-JXHMDBAY.js";
|
|
10
|
-
import {
|
|
11
|
-
createProviderPlugin,
|
|
12
|
-
requireApiKey,
|
|
13
|
-
upstreamError
|
|
14
|
-
} from "./chunk-ATK45BXV.js";
|
|
15
|
-
import "./chunk-U7B6DS2O.js";
|
|
16
|
-
import {
|
|
17
|
-
TBError,
|
|
18
|
-
external_exports
|
|
19
|
-
} from "./chunk-UZM2RXZH.js";
|
|
20
|
-
import "./chunk-U67V476Y.js";
|
|
21
|
-
|
|
22
|
-
// ../plugins/src/unsplash/api.ts
|
|
23
|
-
var SERVICE = "unsplash";
|
|
24
|
-
var API_BASE = "https://api.unsplash.com";
|
|
25
|
-
function requireRecord(value, label) {
|
|
26
|
-
const result = asJsonObject(value);
|
|
27
|
-
if (result === void 0) {
|
|
28
|
-
throw new TBError("unavailable", `${label}\u4E0D\u662F\u5BF9\u8C61`, { retryable: true });
|
|
29
|
-
}
|
|
30
|
-
return result;
|
|
31
|
-
}
|
|
32
|
-
function objectArray(value) {
|
|
33
|
-
if (!Array.isArray(value)) {
|
|
34
|
-
throw new TBError("unavailable", "Unsplash \u54CD\u5E94\u4E0D\u662F\u6570\u7EC4", { retryable: true });
|
|
35
|
-
}
|
|
36
|
-
return value.map((item) => requireRecord(item, "Unsplash \u6570\u7EC4\u5143\u7D20"));
|
|
37
|
-
}
|
|
38
|
-
function requireText(value, field) {
|
|
39
|
-
const result = trimmedText(value);
|
|
40
|
-
if (result === void 0) throw new TBError("invalid_argument", `${field} \u4E0D\u80FD\u662F\u7A7A\u767D`);
|
|
41
|
-
return result;
|
|
42
|
-
}
|
|
43
|
-
function csv(value) {
|
|
44
|
-
if (value === void 0) return void 0;
|
|
45
|
-
const items = value.map((item) => trimmedText(item)).filter((item) => item !== void 0);
|
|
46
|
-
return items.length > 0 ? items.join(",") : void 0;
|
|
47
|
-
}
|
|
48
|
-
function errorMessage(payload) {
|
|
49
|
-
const body = asJsonObject(payload);
|
|
50
|
-
if (body === void 0) return void 0;
|
|
51
|
-
if (Array.isArray(body.errors)) {
|
|
52
|
-
for (const item of body.errors) {
|
|
53
|
-
const message = trimmedText(item);
|
|
54
|
-
if (message !== void 0) return message;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return trimmedText(body.error) ?? trimmedText(body.message);
|
|
58
|
-
}
|
|
59
|
-
var http = createAuthedClient({
|
|
60
|
-
baseUrl: `${API_BASE}/`,
|
|
61
|
-
service: SERVICE,
|
|
62
|
-
// Unsplash 自有的方案名,不是 Bearer。
|
|
63
|
-
auth: { kind: "custom", headers: (ctx) => ({ authorization: `Client-ID ${requireApiKey(ctx, SERVICE)}` }) },
|
|
64
|
-
headers: { "accept": "application/json", "accept-version": "v1" },
|
|
65
|
-
mapError: ({ bodyKind, data, status }) => upstreamError(
|
|
66
|
-
status,
|
|
67
|
-
errorMessage(bodyKind === "json" ? data : null) ?? `Unsplash \u8FD4\u56DE HTTP ${status}`
|
|
68
|
-
)
|
|
69
|
-
});
|
|
70
|
-
async function request(ctx, path, query = {}) {
|
|
71
|
-
const response = await http.request(ctx, {
|
|
72
|
-
path,
|
|
73
|
-
query: Object.entries(query),
|
|
74
|
-
invalidJson: "text"
|
|
75
|
-
});
|
|
76
|
-
if (response.bodyKind === "invalid-json") {
|
|
77
|
-
throw new TBError("unavailable", "Unsplash \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94", { retryable: true });
|
|
78
|
-
}
|
|
79
|
-
return response.bodyKind === "empty" ? null : response.data;
|
|
80
|
-
}
|
|
81
|
-
async function listPhotos(input, ctx) {
|
|
82
|
-
const payload = await request(ctx, "/photos", {
|
|
83
|
-
page: input.page,
|
|
84
|
-
per_page: input.perPage,
|
|
85
|
-
order_by: input.orderBy
|
|
86
|
-
});
|
|
87
|
-
return { photos: objectArray(payload) };
|
|
88
|
-
}
|
|
89
|
-
async function searchPhotos(input, ctx) {
|
|
90
|
-
const payload = await request(ctx, "/search/photos", {
|
|
91
|
-
// 参数名是 `query`,不是各家搜索 API 常见的 `q`。
|
|
92
|
-
query: requireText(input.query, "query"),
|
|
93
|
-
page: input.page,
|
|
94
|
-
per_page: input.perPage,
|
|
95
|
-
order_by: input.orderBy,
|
|
96
|
-
color: input.color,
|
|
97
|
-
orientation: input.orientation,
|
|
98
|
-
content_filter: input.contentFilter,
|
|
99
|
-
collections: csv(input.collections)
|
|
100
|
-
});
|
|
101
|
-
const result = requireRecord(payload, "Unsplash \u641C\u7D22\u54CD\u5E94");
|
|
102
|
-
return {
|
|
103
|
-
total: finiteNumber(result.total) ?? 0,
|
|
104
|
-
totalPages: finiteNumber(result.total_pages) ?? 0,
|
|
105
|
-
results: objectArray(result.results)
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
async function getPhoto(input, ctx) {
|
|
109
|
-
const id = requireText(input.id, "id");
|
|
110
|
-
const payload = await request(ctx, `/photos/${encodeURIComponent(id)}`);
|
|
111
|
-
return { photo: requireRecord(payload, "Unsplash \u7167\u7247\u54CD\u5E94") };
|
|
112
|
-
}
|
|
113
|
-
async function getRandomPhoto(input, ctx) {
|
|
114
|
-
const query = trimmedText(input.query);
|
|
115
|
-
const collections = csv(input.collections);
|
|
116
|
-
const topics = csv(input.topics);
|
|
117
|
-
if (query !== void 0 && (collections !== void 0 || topics !== void 0)) {
|
|
118
|
-
throw new TBError("invalid_argument", "get_random_photo \u7684 query \u4E0D\u80FD\u4E0E collections \u6216 topics \u540C\u65F6\u4F7F\u7528");
|
|
119
|
-
}
|
|
120
|
-
const payload = await request(ctx, "/photos/random", {
|
|
121
|
-
query,
|
|
122
|
-
collections,
|
|
123
|
-
topics,
|
|
124
|
-
username: trimmedText(input.username),
|
|
125
|
-
orientation: input.orientation,
|
|
126
|
-
content_filter: input.contentFilter,
|
|
127
|
-
count: input.count
|
|
128
|
-
});
|
|
129
|
-
return {
|
|
130
|
-
photos: Array.isArray(payload) ? objectArray(payload) : [requireRecord(payload, "Unsplash \u968F\u673A\u7167\u7247\u54CD\u5E94")]
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
async function listTopics(input, ctx) {
|
|
134
|
-
const payload = await request(ctx, "/topics", {
|
|
135
|
-
page: input.page,
|
|
136
|
-
per_page: input.perPage,
|
|
137
|
-
order_by: input.orderBy
|
|
138
|
-
});
|
|
139
|
-
return { topics: objectArray(payload) };
|
|
140
|
-
}
|
|
141
|
-
async function getTopicPhotos(input, ctx) {
|
|
142
|
-
const topic = requireText(input.topicIdOrSlug, "topicIdOrSlug");
|
|
143
|
-
const payload = await request(ctx, `/topics/${encodeURIComponent(topic)}/photos`, {
|
|
144
|
-
page: input.page,
|
|
145
|
-
per_page: input.perPage,
|
|
146
|
-
orientation: input.orientation,
|
|
147
|
-
order_by: input.orderBy
|
|
148
|
-
});
|
|
149
|
-
return { photos: objectArray(payload) };
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// ../plugins/src/unsplash/schema.ts
|
|
153
|
-
var listPhotosInput = external_exports.strictObject({
|
|
154
|
-
page: external_exports.int().min(1).describe("The 1-based page number to retrieve.").optional(),
|
|
155
|
-
perPage: external_exports.int().min(1).max(30).describe("The number of items to return per page, between 1 and 30.").optional(),
|
|
156
|
-
orderBy: external_exports.enum(["latest", "oldest", "popular"]).describe("The sort order supported by the Unsplash photo listing endpoints.").optional()
|
|
157
|
-
}).describe("The input payload for listing the latest public photos from Unsplash.");
|
|
158
|
-
var listPhotosOutput = external_exports.strictObject({
|
|
159
|
-
photos: external_exports.array(external_exports.strictObject({
|
|
160
|
-
id: external_exports.string().describe("The unique identifier of the photo."),
|
|
161
|
-
slug: external_exports.string().describe("The public slug of the photo.").optional(),
|
|
162
|
-
description: external_exports.string().describe("The description of the photo when Unsplash provides it.").nullable().optional(),
|
|
163
|
-
alt_description: external_exports.string().describe("The alternative description of the photo when Unsplash provides it.").nullable().optional(),
|
|
164
|
-
width: external_exports.number().describe("The width of the photo in pixels.").optional(),
|
|
165
|
-
height: external_exports.number().describe("The height of the photo in pixels.").optional(),
|
|
166
|
-
color: external_exports.string().describe("The representative HEX color of the photo.").optional(),
|
|
167
|
-
blur_hash: external_exports.string().describe("The blur hash value of the photo.").optional(),
|
|
168
|
-
urls: external_exports.looseObject({}).describe("The photo URLs returned by Unsplash in multiple sizes.").optional(),
|
|
169
|
-
links: external_exports.looseObject({}).describe("The related links attached to the Unsplash photo resource.").optional(),
|
|
170
|
-
user: external_exports.looseObject({}).describe("The user metadata attached to the photo.").optional()
|
|
171
|
-
}).describe("A summary photo resource returned by Unsplash.")).describe("The public photo summaries returned by Unsplash.")
|
|
172
|
-
}).describe("The latest public photos returned by Unsplash.");
|
|
173
|
-
var searchPhotosInput = external_exports.strictObject({
|
|
174
|
-
query: external_exports.string().min(1).describe("The search query to run against Unsplash photos."),
|
|
175
|
-
page: external_exports.int().min(1).describe("The 1-based page number to retrieve.").optional(),
|
|
176
|
-
perPage: external_exports.int().min(1).max(30).describe("The number of items to return per page, between 1 and 30.").optional(),
|
|
177
|
-
orderBy: external_exports.enum(["relevant", "latest"]).describe("The sort order supported by the Unsplash photo search endpoint.").optional(),
|
|
178
|
-
color: external_exports.enum(["black_and_white", "black", "white", "yellow", "orange", "red", "purple", "magenta", "green", "teal", "blue"]).describe("The color filter to apply to photo search results.").optional(),
|
|
179
|
-
orientation: external_exports.enum(["landscape", "portrait", "squarish"]).describe("The photo orientation filter to apply.").optional(),
|
|
180
|
-
contentFilter: external_exports.enum(["low", "high"]).describe("The safety filter level to apply to supported Unsplash requests.").optional(),
|
|
181
|
-
collections: external_exports.array(external_exports.string().min(1).describe("One identifier value.")).min(1).describe("The collection identifiers to filter the search results by.").optional()
|
|
182
|
-
}).describe("The input payload for searching photos on Unsplash.");
|
|
183
|
-
var searchPhotosOutput = external_exports.strictObject({
|
|
184
|
-
total: external_exports.number().describe("The total number of matching photo results."),
|
|
185
|
-
totalPages: external_exports.number().describe("The total number of result pages."),
|
|
186
|
-
results: external_exports.array(external_exports.strictObject({
|
|
187
|
-
id: external_exports.string().describe("The unique identifier of the photo."),
|
|
188
|
-
slug: external_exports.string().describe("The public slug of the photo.").optional(),
|
|
189
|
-
description: external_exports.string().describe("The description of the photo when Unsplash provides it.").nullable().optional(),
|
|
190
|
-
alt_description: external_exports.string().describe("The alternative description of the photo when Unsplash provides it.").nullable().optional(),
|
|
191
|
-
width: external_exports.number().describe("The width of the photo in pixels.").optional(),
|
|
192
|
-
height: external_exports.number().describe("The height of the photo in pixels.").optional(),
|
|
193
|
-
color: external_exports.string().describe("The representative HEX color of the photo.").optional(),
|
|
194
|
-
blur_hash: external_exports.string().describe("The blur hash value of the photo.").optional(),
|
|
195
|
-
urls: external_exports.looseObject({}).describe("The photo URLs returned by Unsplash in multiple sizes.").optional(),
|
|
196
|
-
links: external_exports.looseObject({}).describe("The related links attached to the Unsplash photo resource.").optional(),
|
|
197
|
-
user: external_exports.looseObject({}).describe("The user metadata attached to the photo.").optional()
|
|
198
|
-
}).describe("A summary photo resource returned by Unsplash.")).describe("The matching photo summaries returned by Unsplash.")
|
|
199
|
-
}).describe("The photo search results returned by Unsplash.");
|
|
200
|
-
var getPhotoInput = external_exports.strictObject({
|
|
201
|
-
id: external_exports.string().min(1).describe("The Unsplash photo identifier to retrieve.")
|
|
202
|
-
}).describe("The input payload for fetching a single Unsplash photo.");
|
|
203
|
-
var getPhotoOutput = external_exports.strictObject({
|
|
204
|
-
photo: external_exports.strictObject({
|
|
205
|
-
id: external_exports.string().describe("The unique identifier of the photo."),
|
|
206
|
-
slug: external_exports.string().describe("The public slug of the photo.").optional(),
|
|
207
|
-
description: external_exports.string().describe("The description of the photo when Unsplash provides it.").nullable().optional(),
|
|
208
|
-
alt_description: external_exports.string().describe("The alternative description of the photo when Unsplash provides it.").nullable().optional(),
|
|
209
|
-
width: external_exports.number().describe("The width of the photo in pixels.").optional(),
|
|
210
|
-
height: external_exports.number().describe("The height of the photo in pixels.").optional(),
|
|
211
|
-
color: external_exports.string().describe("The representative HEX color of the photo.").optional(),
|
|
212
|
-
blur_hash: external_exports.string().describe("The blur hash value of the photo.").optional(),
|
|
213
|
-
urls: external_exports.looseObject({}).describe("The photo URLs returned by Unsplash in multiple sizes.").optional(),
|
|
214
|
-
links: external_exports.looseObject({}).describe("The related links attached to the Unsplash photo resource.").optional(),
|
|
215
|
-
user: external_exports.looseObject({}).describe("The user metadata attached to the photo.").optional(),
|
|
216
|
-
created_at: external_exports.string().describe("The creation timestamp of the photo.").optional(),
|
|
217
|
-
liked_by_user: external_exports.boolean().describe("Whether the authenticated user liked the photo.").optional(),
|
|
218
|
-
likes: external_exports.number().describe("The total number of likes on the photo.").optional(),
|
|
219
|
-
current_user_collections: external_exports.array(external_exports.looseObject({}).describe("One current user collection reference.")).describe("The current user collections returned with the photo.").optional()
|
|
220
|
-
}).describe("A detailed photo resource returned by Unsplash.")
|
|
221
|
-
}).describe("The detailed photo payload returned by Unsplash.");
|
|
222
|
-
var getRandomPhotoInput = external_exports.strictObject({
|
|
223
|
-
query: external_exports.string().min(1).describe("The search query used to constrain the random photo.").optional(),
|
|
224
|
-
collections: external_exports.array(external_exports.string().min(1).describe("One identifier value.")).min(1).describe("The collection identifiers used to constrain the random photo.").optional(),
|
|
225
|
-
topics: external_exports.array(external_exports.string().min(1).describe("One identifier value.")).min(1).describe("The topic identifiers used to constrain the random photo.").optional(),
|
|
226
|
-
username: external_exports.string().min(1).describe("The username used to constrain the random photo.").optional(),
|
|
227
|
-
orientation: external_exports.enum(["landscape", "portrait", "squarish"]).describe("The photo orientation filter to apply.").optional(),
|
|
228
|
-
contentFilter: external_exports.enum(["low", "high"]).describe("The safety filter level to apply to supported Unsplash requests.").optional(),
|
|
229
|
-
count: external_exports.int().min(1).max(30).describe("The number of random photos to request, between 1 and 30.").optional()
|
|
230
|
-
}).describe("The input payload for fetching one or more random Unsplash photos.");
|
|
231
|
-
var getRandomPhotoOutput = external_exports.strictObject({
|
|
232
|
-
photos: external_exports.array(external_exports.strictObject({
|
|
233
|
-
id: external_exports.string().describe("The unique identifier of the photo."),
|
|
234
|
-
slug: external_exports.string().describe("The public slug of the photo.").optional(),
|
|
235
|
-
description: external_exports.string().describe("The description of the photo when Unsplash provides it.").nullable().optional(),
|
|
236
|
-
alt_description: external_exports.string().describe("The alternative description of the photo when Unsplash provides it.").nullable().optional(),
|
|
237
|
-
width: external_exports.number().describe("The width of the photo in pixels.").optional(),
|
|
238
|
-
height: external_exports.number().describe("The height of the photo in pixels.").optional(),
|
|
239
|
-
color: external_exports.string().describe("The representative HEX color of the photo.").optional(),
|
|
240
|
-
blur_hash: external_exports.string().describe("The blur hash value of the photo.").optional(),
|
|
241
|
-
urls: external_exports.looseObject({}).describe("The photo URLs returned by Unsplash in multiple sizes.").optional(),
|
|
242
|
-
links: external_exports.looseObject({}).describe("The related links attached to the Unsplash photo resource.").optional(),
|
|
243
|
-
user: external_exports.looseObject({}).describe("The user metadata attached to the photo.").optional(),
|
|
244
|
-
created_at: external_exports.string().describe("The creation timestamp of the photo.").optional(),
|
|
245
|
-
liked_by_user: external_exports.boolean().describe("Whether the authenticated user liked the photo.").optional(),
|
|
246
|
-
likes: external_exports.number().describe("The total number of likes on the photo.").optional(),
|
|
247
|
-
current_user_collections: external_exports.array(external_exports.looseObject({}).describe("One current user collection reference.")).describe("The current user collections returned with the photo.").optional()
|
|
248
|
-
}).describe("A detailed photo resource returned by Unsplash.")).describe("The random photo resources returned by Unsplash.")
|
|
249
|
-
}).describe("The normalized random photo payload returned by Unsplash.");
|
|
250
|
-
var listTopicsInput = external_exports.strictObject({
|
|
251
|
-
page: external_exports.int().min(1).describe("The 1-based page number to retrieve.").optional(),
|
|
252
|
-
perPage: external_exports.int().min(1).max(30).describe("The number of items to return per page, between 1 and 30.").optional(),
|
|
253
|
-
orderBy: external_exports.enum(["position", "latest", "oldest", "popular"]).describe("The sort order supported by the Unsplash topic listing endpoint.").optional()
|
|
254
|
-
}).describe("The input payload for listing Unsplash topics.");
|
|
255
|
-
var listTopicsOutput = external_exports.strictObject({
|
|
256
|
-
topics: external_exports.array(external_exports.strictObject({
|
|
257
|
-
id: external_exports.string().describe("The unique identifier of the topic."),
|
|
258
|
-
slug: external_exports.string().describe("The topic slug.").optional(),
|
|
259
|
-
title: external_exports.string().describe("The display title of the topic."),
|
|
260
|
-
description: external_exports.string().describe("The description of the topic when Unsplash provides it.").nullable().optional(),
|
|
261
|
-
featured: external_exports.boolean().describe("Whether the topic is marked as featured.").optional(),
|
|
262
|
-
total_photos: external_exports.number().describe("The total number of photos in the topic.").optional(),
|
|
263
|
-
links: external_exports.looseObject({}).describe("The related links attached to the Unsplash topic resource.").optional(),
|
|
264
|
-
cover_photo: external_exports.looseObject({}).describe("The cover photo attached to the topic when Unsplash provides it.").optional()
|
|
265
|
-
}).describe("A topic resource returned by Unsplash.")).describe("The topics returned by Unsplash.")
|
|
266
|
-
}).describe("The topic listing returned by Unsplash.");
|
|
267
|
-
var getTopicPhotosInput = external_exports.strictObject({
|
|
268
|
-
topicIdOrSlug: external_exports.string().min(1).describe("The topic identifier or slug to read photos from."),
|
|
269
|
-
page: external_exports.int().min(1).describe("The 1-based page number to retrieve.").optional(),
|
|
270
|
-
perPage: external_exports.int().min(1).max(30).describe("The number of items to return per page, between 1 and 30.").optional(),
|
|
271
|
-
orientation: external_exports.enum(["landscape", "portrait", "squarish"]).describe("The photo orientation filter to apply.").optional(),
|
|
272
|
-
orderBy: external_exports.enum(["latest", "oldest", "popular"]).describe("The sort order supported by the Unsplash photo listing endpoints.").optional()
|
|
273
|
-
}).describe("The input payload for listing photos from an Unsplash topic.");
|
|
274
|
-
var getTopicPhotosOutput = external_exports.strictObject({
|
|
275
|
-
photos: external_exports.array(external_exports.strictObject({
|
|
276
|
-
id: external_exports.string().describe("The unique identifier of the photo."),
|
|
277
|
-
slug: external_exports.string().describe("The public slug of the photo.").optional(),
|
|
278
|
-
description: external_exports.string().describe("The description of the photo when Unsplash provides it.").nullable().optional(),
|
|
279
|
-
alt_description: external_exports.string().describe("The alternative description of the photo when Unsplash provides it.").nullable().optional(),
|
|
280
|
-
width: external_exports.number().describe("The width of the photo in pixels.").optional(),
|
|
281
|
-
height: external_exports.number().describe("The height of the photo in pixels.").optional(),
|
|
282
|
-
color: external_exports.string().describe("The representative HEX color of the photo.").optional(),
|
|
283
|
-
blur_hash: external_exports.string().describe("The blur hash value of the photo.").optional(),
|
|
284
|
-
urls: external_exports.looseObject({}).describe("The photo URLs returned by Unsplash in multiple sizes.").optional(),
|
|
285
|
-
links: external_exports.looseObject({}).describe("The related links attached to the Unsplash photo resource.").optional(),
|
|
286
|
-
user: external_exports.looseObject({}).describe("The user metadata attached to the photo.").optional()
|
|
287
|
-
}).describe("A summary photo resource returned by Unsplash.")).describe("The photo summaries returned for the requested Unsplash topic.")
|
|
288
|
-
}).describe("The topic photo listing returned by Unsplash.");
|
|
289
|
-
var unsplashActions = {
|
|
290
|
-
list_photos: {
|
|
291
|
-
description: "List the latest public photos from Unsplash.",
|
|
292
|
-
effect: "read",
|
|
293
|
-
inputSchema: listPhotosInput,
|
|
294
|
-
outputSchema: external_exports.toJSONSchema(listPhotosOutput, { io: "output", unrepresentable: "any" })
|
|
295
|
-
},
|
|
296
|
-
search_photos: {
|
|
297
|
-
description: "Search photos on Unsplash using keyword and filter inputs.",
|
|
298
|
-
effect: "read",
|
|
299
|
-
inputSchema: searchPhotosInput,
|
|
300
|
-
outputSchema: external_exports.toJSONSchema(searchPhotosOutput, { io: "output", unrepresentable: "any" })
|
|
301
|
-
},
|
|
302
|
-
get_photo: {
|
|
303
|
-
description: "Fetch the detailed payload for a single Unsplash photo.",
|
|
304
|
-
effect: "read",
|
|
305
|
-
inputSchema: getPhotoInput,
|
|
306
|
-
outputSchema: external_exports.toJSONSchema(getPhotoOutput, { io: "output", unrepresentable: "any" })
|
|
307
|
-
},
|
|
308
|
-
get_random_photo: {
|
|
309
|
-
description: "Fetch one or more random Unsplash photos using optional filters.",
|
|
310
|
-
effect: "read",
|
|
311
|
-
inputSchema: getRandomPhotoInput,
|
|
312
|
-
outputSchema: external_exports.toJSONSchema(getRandomPhotoOutput, { io: "output", unrepresentable: "any" })
|
|
313
|
-
},
|
|
314
|
-
list_topics: {
|
|
315
|
-
description: "List topics curated by Unsplash.",
|
|
316
|
-
effect: "read",
|
|
317
|
-
inputSchema: listTopicsInput,
|
|
318
|
-
outputSchema: external_exports.toJSONSchema(listTopicsOutput, { io: "output", unrepresentable: "any" })
|
|
319
|
-
},
|
|
320
|
-
get_topic_photos: {
|
|
321
|
-
description: "List photos from a specific Unsplash topic.",
|
|
322
|
-
effect: "read",
|
|
323
|
-
inputSchema: getTopicPhotosInput,
|
|
324
|
-
outputSchema: external_exports.toJSONSchema(getTopicPhotosOutput, { io: "output", unrepresentable: "any" })
|
|
325
|
-
}
|
|
326
|
-
};
|
|
327
|
-
|
|
328
|
-
// ../plugins/src/unsplash/index.ts
|
|
329
|
-
function createUnsplashPlugin() {
|
|
330
|
-
return createProviderPlugin({
|
|
331
|
-
description: "Unsplash",
|
|
332
|
-
actions: unsplashActions,
|
|
333
|
-
// 上游 `credentialValidators.apiKey` 打的就是 `/photos?page=1&per_page=1`,
|
|
334
|
-
// 对应这里的 list_photos:read、无必填入参,平台空参调它即可验证 access key。
|
|
335
|
-
credentialProbe: "list_photos",
|
|
336
|
-
handlers: {
|
|
337
|
-
list_photos: listPhotos,
|
|
338
|
-
search_photos: searchPhotos,
|
|
339
|
-
get_photo: getPhoto,
|
|
340
|
-
get_random_photo: getRandomPhoto,
|
|
341
|
-
list_topics: listTopics,
|
|
342
|
-
get_topic_photos: getTopicPhotos
|
|
343
|
-
}
|
|
344
|
-
});
|
|
345
|
-
}
|
|
346
|
-
var unsplash_default = createUnsplashPlugin();
|
|
347
|
-
export {
|
|
348
|
-
createUnsplashPlugin,
|
|
349
|
-
unsplash_default as default
|
|
350
|
-
};
|