@tool-bridge/server 0.21.1 → 0.23.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.
Files changed (178) hide show
  1. package/dist/admin.js +170 -0
  2. package/dist/airtable-VMQVXLHK.js +790 -0
  3. package/dist/{alt_text_generator_ai-W7O34SNG.js → alt_text_generator_ai-FTWY4RU4.js} +12 -11
  4. package/dist/{amap-VOX4T2AW.js → amap-OK5VBHYC.js} +221 -220
  5. package/dist/anthropic-S67AZFZ3.js +203 -0
  6. package/dist/apify-ZE6MYQI3.js +248 -0
  7. package/dist/brave_search-TG2M2KOD.js +302 -0
  8. package/dist/chunk-2JNAI4OC.js +161 -0
  9. package/dist/{chunk-KMTT3I6D.js → chunk-4XJPN3DY.js} +19392 -26136
  10. package/dist/chunk-5ICRY3VU.js +8432 -0
  11. package/dist/chunk-7CTWGTDU.js +302 -0
  12. package/dist/chunk-BADVCN6K.js +378 -0
  13. package/dist/{chunk-XYBU3WZH.js → chunk-TDAWLMDE.js} +3 -3
  14. package/dist/chunk-U7PTOA3U.js +7320 -0
  15. package/dist/{chunk-E6JCVKW6.js → chunk-VWRUGUSU.js} +3 -3
  16. package/dist/{chunk-ATK45BXV.js → chunk-WJHG6OK7.js} +4 -2
  17. package/dist/circleci-3L3WJVSK.js +389 -0
  18. package/dist/clerk-EZPF2V7T.js +1019 -0
  19. package/dist/cohere-U27DPO64.js +185 -0
  20. package/dist/{confluence-B3EWPZVE.js → confluence-G2KL6ERH.js} +105 -104
  21. package/dist/{convertapi-EUWSQYPF.js → convertapi-L4CLJ2M3.js} +32 -31
  22. package/dist/{currencyapi-KVTIK3GL.js → currencyapi-YPYXG7YY.js} +71 -71
  23. package/dist/deepseek-6HT6WF3M.js +210 -0
  24. package/dist/docker_hub-LPE3PCVB.js +933 -0
  25. package/dist/dropbox-V56ABHTA.js +1305 -0
  26. package/dist/dub-6OKQ7MHT.js +680 -0
  27. package/dist/e2b-JS2U2QFU.js +278 -0
  28. package/dist/exa-DPWVYXSP.js +332 -0
  29. package/dist/{fal_ai-23E7JPNT.js → fal_ai-DK6Y27ZF.js} +81 -80
  30. package/dist/{feishu-7QRIDUV6.js → feishu-K7EGSRF3.js} +528 -572
  31. package/dist/{feishu_custom_bot-TJ4K7QNJ.js → feishu_custom_bot-2JUGFYNG.js} +57 -53
  32. package/dist/figma-FT5I7ITD.js +777 -0
  33. package/dist/firehydrant-EIKLKHX2.js +563 -0
  34. package/dist/{fixer-BWON27UO.js → fixer-U5QXIAKD.js} +34 -33
  35. package/dist/fly-T3JYFZ2M.js +469 -0
  36. package/dist/{front-QCGXYEDJ.js → front-D72MGVOR.js} +104 -104
  37. package/dist/geocodio-BOTD5TI5.js +213 -0
  38. package/dist/ghost-KYP7SZGB.js +338 -0
  39. package/dist/github-AGMZT3VY.js +5421 -0
  40. package/dist/gmail-BLJNJOBG.js +1887 -0
  41. package/dist/googlecalendar-GTHWNCF6.js +2524 -0
  42. package/dist/{googledocs-BUHL4J2H.js → googledocs-6EEDMEBQ.js} +341 -340
  43. package/dist/{grafana-GLU2DWF2.js → grafana-GMW6EKSQ.js} +221 -220
  44. package/dist/graphhopper-6OLGBDGB.js +325 -0
  45. package/dist/index.d.ts +1132 -332
  46. package/dist/index.js +31 -14
  47. package/dist/{ip2proxy-EZ64Y4ZH.js → ip2proxy-4QN42E6T.js} +28 -27
  48. package/dist/ipgeolocation_io-SK4XKDA2.js +315 -0
  49. package/dist/ipqualityscore-6ANBPXKT.js +279 -0
  50. package/dist/{jina_ai-EFBHTBXL.js → jina_ai-IHPSVRM5.js} +23 -23
  51. package/dist/{jira-HQSHAA5K.js → jira-46KKM4LC.js} +118 -117
  52. package/dist/langsmith-JZA345I5.js +593 -0
  53. package/dist/lemlist-43IV7DK6.js +289 -0
  54. package/dist/{linear-K7RYFYAD.js → linear-5LFH7XNL.js} +327 -326
  55. package/dist/logsnag-5RMYAHIL.js +150 -0
  56. package/dist/main.js +57 -280
  57. package/dist/{mattermost-S2BRCWLQ.js → mattermost-XFL6SHGG.js} +59 -58
  58. package/dist/mem0-NYO4DTP6.js +544 -0
  59. package/dist/memos-37MPQOLV.js +744 -0
  60. package/dist/{metabase-MMSEPCOF.js → metabase-KYBKZFMG.js} +90 -89
  61. package/dist/mistral_ai-6PL3K4PM.js +1196 -0
  62. package/dist/{mother_duck-H7PCQNZ2.js → mother_duck-2NH7W5M5.js} +94 -93
  63. package/dist/ngrok-UO6CDYCA.js +356 -0
  64. package/dist/{notes-PFMKRO33.js → notes-I3P32WP4.js} +11 -9
  65. package/dist/notion-BEAJFUOE.js +940 -0
  66. package/dist/open_exchange_rates-CMF62JB4.js +215 -0
  67. package/dist/openai-IHOMKVND.js +800 -0
  68. package/dist/opengraph_io-ZQ2FGLHX.js +362 -0
  69. package/dist/openrouter-HXLW3NR5.js +441 -0
  70. package/dist/outline-ELCP4NEU.js +599 -0
  71. package/dist/paddle-O77LALVN.js +454 -0
  72. package/dist/perplexity-JCU654QV.js +220 -0
  73. package/dist/pinecone-W5W4LRKL.js +571 -0
  74. package/dist/{pipedrive-Y2O7QGFF.js → pipedrive-ITMJLLPZ.js} +99 -98
  75. package/dist/polar-R33XU4L3.js +395 -0
  76. package/dist/posthog-JVNTOLTV.js +3464 -0
  77. package/dist/postmark-6SBG7HWV.js +427 -0
  78. package/dist/{prerender-MENYM2TY.js → prerender-GPNKTNFC.js} +31 -30
  79. package/dist/{pubmed-GOXUVVH5.js → pubmed-UP6ZEEIH.js} +239 -238
  80. package/dist/{railway-V2SID4WV.js → railway-KWEWXHTY.js} +118 -117
  81. package/dist/readwise-BLATSMC3.js +470 -0
  82. package/dist/render-QYRVIXII.js +461 -0
  83. package/dist/{replicate-756MXPYX.js → replicate-JYTWH4NF.js} +81 -80
  84. package/dist/{resend-ZKH3BTBI.js → resend-L5N75SZM.js} +20 -16
  85. package/dist/rootly-MHCPEQ26.js +336 -0
  86. package/dist/{scrapfly-NSRHFDIQ.js → scrapfly-PTPGYSJM.js} +62 -61
  87. package/dist/{scrapingbee-OQHLAVEY.js → scrapingbee-JN6UH5PY.js} +56 -56
  88. package/dist/{screenshot_fyi-DVWG3AXC.js → screenshot_fyi-4QRVSV55.js} +16 -16
  89. package/dist/semantic_scholar-LRSWA2GE.js +611 -0
  90. package/dist/{sentry-546MNDJG.js → sentry-2G6PF5W6.js} +208 -207
  91. package/dist/{shodan-C3OON3Z3.js → shodan-WKKPP5C6.js} +62 -61
  92. package/dist/shopify-64YDK5T2.js +610 -0
  93. package/dist/stripe-QAIGGOTF.js +585 -0
  94. package/dist/{supabase-U2SL4D63.js → supabase-WHTGR6ND.js} +245 -244
  95. package/dist/tavily-QIXCDDWO.js +326 -0
  96. package/dist/telegram-E6G7CWI6.js +1767 -0
  97. package/dist/{telnyx-CXQ4EZUX.js → telnyx-ZDVVS7PK.js} +57 -56
  98. package/dist/todoist-DMYF3G7J.js +664 -0
  99. package/dist/trello-HY2RYIRP.js +1080 -0
  100. package/dist/turso-HAQWMGRP.js +416 -0
  101. package/dist/{twilio-4PDBJKWX.js → twilio-MLXYPHJE.js} +70 -69
  102. package/dist/umami-DZHBLPVG.js +389 -0
  103. package/dist/unsplash-GS2OPXKE.js +351 -0
  104. package/dist/{upstash_redis-G4LQBYHA.js → upstash_redis-XMXWTNAJ.js} +51 -50
  105. package/dist/uptimerobot-TF5WRZ4G.js +483 -0
  106. package/dist/v2ex-2BVXAPDF.js +667 -0
  107. package/dist/vercel-YMJGQYJE.js +1076 -0
  108. package/dist/{wolfram_alpha_api-3G4PUJWB.js → wolfram_alpha_api-I56SXWFZ.js} +36 -35
  109. package/dist/wordpress-R7TDFZ2P.js +812 -0
  110. package/dist/workos-HDNHWVMS.js +664 -0
  111. package/dist/zhihu-LX6AGGDS.js +254 -0
  112. package/package.json +18 -9
  113. package/dist/airtable-LLZDFN7M.js +0 -789
  114. package/dist/anthropic-G23NN3X5.js +0 -202
  115. package/dist/apify-Y3SS734K.js +0 -247
  116. package/dist/brave_search-ZC7OAPSZ.js +0 -301
  117. package/dist/chunk-R6P4XAE5.js +0 -248
  118. package/dist/chunk-U7B6DS2O.js +0 -977
  119. package/dist/chunk-UZM2RXZH.js +0 -23436
  120. package/dist/circleci-3BAX5FCG.js +0 -388
  121. package/dist/clerk-6LEM6TNU.js +0 -1019
  122. package/dist/cloudflare_dns-KINYTJUD.js +0 -588
  123. package/dist/cohere-XCJ5AJ6B.js +0 -185
  124. package/dist/deepseek-PC5YGNC5.js +0 -209
  125. package/dist/docker_hub-C3MA5FU6.js +0 -932
  126. package/dist/dropbox-XBV7Z2IR.js +0 -1304
  127. package/dist/dub-LDOFG3HC.js +0 -679
  128. package/dist/e2b-JMCPSVBW.js +0 -277
  129. package/dist/exa-RAK7O7RD.js +0 -331
  130. package/dist/figma-E6IX5DTH.js +0 -773
  131. package/dist/firehydrant-ZBLPQREE.js +0 -562
  132. package/dist/fly-ZH3HFCZJ.js +0 -468
  133. package/dist/geocodio-YGNI7DA4.js +0 -212
  134. package/dist/ghost-EVSGKH2Q.js +0 -337
  135. package/dist/github-MA2BGRCJ.js +0 -5420
  136. package/dist/gmail-E5E6AADE.js +0 -1886
  137. package/dist/googlecalendar-BTLFPXTD.js +0 -2523
  138. package/dist/graphhopper-WSMB3TCD.js +0 -324
  139. package/dist/ipgeolocation_io-AA7HAS22.js +0 -315
  140. package/dist/ipqualityscore-BHJXVTJT.js +0 -277
  141. package/dist/langsmith-5W6SCT6F.js +0 -592
  142. package/dist/lemlist-HJWH6UMK.js +0 -288
  143. package/dist/logsnag-4KFOHL37.js +0 -150
  144. package/dist/mem0-CAW43CIC.js +0 -543
  145. package/dist/memos-TWEGPKFM.js +0 -740
  146. package/dist/mistral_ai-64BGZQHP.js +0 -1195
  147. package/dist/ngrok-GQCUGZKJ.js +0 -356
  148. package/dist/notion-DQWZWP4N.js +0 -936
  149. package/dist/open_exchange_rates-QMMD735E.js +0 -214
  150. package/dist/openai-W6PX32NZ.js +0 -799
  151. package/dist/opengraph_io-HNDBXYNW.js +0 -361
  152. package/dist/openrouter-JJYMEAUL.js +0 -437
  153. package/dist/outline-MCBNQZYY.js +0 -595
  154. package/dist/paddle-D2SKLUDN.js +0 -453
  155. package/dist/perplexity-XIFMKUAE.js +0 -219
  156. package/dist/pinecone-HUFTALV2.js +0 -570
  157. package/dist/polar-TYTOMOSR.js +0 -394
  158. package/dist/posthog-43JAR3VW.js +0 -3463
  159. package/dist/postmark-KL2QJYSG.js +0 -426
  160. package/dist/readwise-CI4GIMMJ.js +0 -469
  161. package/dist/render-SUBJ6YRZ.js +0 -460
  162. package/dist/rootly-CD2LJHPI.js +0 -336
  163. package/dist/semantic_scholar-T4A252KW.js +0 -610
  164. package/dist/shopify-Y2HN2MCQ.js +0 -609
  165. package/dist/stripe-VE3CD3AY.js +0 -584
  166. package/dist/tavily-KCZHK6HE.js +0 -326
  167. package/dist/telegram-3URFBCMY.js +0 -1766
  168. package/dist/todoist-HNPWNYTD.js +0 -663
  169. package/dist/trello-3W2MIXRP.js +0 -1079
  170. package/dist/turso-2EQF7C2Z.js +0 -415
  171. package/dist/umami-5REN7TGP.js +0 -388
  172. package/dist/unsplash-EIXL424F.js +0 -350
  173. package/dist/uptimerobot-KNJ3EYLY.js +0 -482
  174. package/dist/v2ex-RHJ234PZ.js +0 -666
  175. package/dist/vercel-AS6NCIC7.js +0 -1075
  176. package/dist/wordpress-KNDAAUV7.js +0 -811
  177. package/dist/workos-R6UITSJ7.js +0 -663
  178. package/dist/zhihu-AGK4HILK.js +0 -253
@@ -1,212 +0,0 @@
1
- import {
2
- createProviderHttpClient
3
- } from "./chunk-E6JCVKW6.js";
4
- import {
5
- messageFrom
6
- } from "./chunk-JXHMDBAY.js";
7
- import {
8
- createProviderPlugin,
9
- requireApiKey,
10
- upstreamError
11
- } from "./chunk-ATK45BXV.js";
12
- import "./chunk-U7B6DS2O.js";
13
- import {
14
- TBError,
15
- external_exports
16
- } from "./chunk-UZM2RXZH.js";
17
- import "./chunk-U67V476Y.js";
18
-
19
- // ../plugins/src/geocodio/api.ts
20
- var SERVICE = "geocodio";
21
- var http = createProviderHttpClient({ baseUrl: "https://api.geocod.io/v1.12/", service: SERVICE });
22
- async function request(ctx, path, query, body) {
23
- const apiKey = requireApiKey(ctx, SERVICE);
24
- const pairs = [
25
- ...Object.entries(query),
26
- ["api_key", apiKey]
27
- ];
28
- const { data } = await http.request({
29
- path,
30
- query: pairs,
31
- ...body === void 0 ? {} : { method: "POST", json: body },
32
- invalidJson: "text",
33
- mapError: ({ data: payload, status }) => upstreamError(
34
- status === 0 ? 502 : status,
35
- messageFrom(payload, ["error", "message"], "Geocodio request failed")
36
- ),
37
- mapTransportError: ({ message }) => upstreamError(
38
- 502,
39
- message === void 0 ? "Geocodio request failed" : `Geocodio request failed: ${message}`
40
- )
41
- });
42
- return data ?? null;
43
- }
44
- function singleGeocode(input, ctx) {
45
- const hasAny = [
46
- input.q,
47
- input.street,
48
- input.street2,
49
- input.city,
50
- input.state,
51
- input.postal_code,
52
- input.country,
53
- input.county
54
- ].some((value) => value !== void 0 && value.trim() !== "");
55
- if (!hasAny) throw new TBError("invalid_argument", "q or at least one address component is required");
56
- return request(ctx, "geocode", {
57
- q: input.q,
58
- street: input.street,
59
- street2: input.street2,
60
- city: input.city,
61
- state: input.state,
62
- postal_code: input.postal_code,
63
- country: input.country,
64
- county: input.county,
65
- fields: input.fields,
66
- limit: input.limit,
67
- format: input.format
68
- });
69
- }
70
- function geocodeBatch(input, ctx) {
71
- return request(ctx, "geocode", { fields: input.fields, limit: input.limit }, input.addresses);
72
- }
73
- function singleReverseGeocode(input, ctx) {
74
- return request(ctx, "reverse", {
75
- q: `${input.lat},${input.lng}`,
76
- fields: input.fields,
77
- limit: input.limit,
78
- format: input.format
79
- });
80
- }
81
- function batchReverseGeocode(input, ctx) {
82
- return request(ctx, "reverse", { fields: input.fields, limit: input.limit }, input.coordinates);
83
- }
84
-
85
- // ../plugins/src/geocodio/schema.ts
86
- var singleGeocodeInput = external_exports.strictObject({
87
- q: external_exports.string().min(1).describe("The full address string to geocode.").optional(),
88
- street: external_exports.string().min(1).describe("The street address component.").optional(),
89
- street2: external_exports.string().min(1).describe("The secondary street address component.").optional(),
90
- city: external_exports.string().min(1).describe("The city name used for the lookup.").optional(),
91
- state: external_exports.string().min(1).describe("The state or province code used for the lookup.").optional(),
92
- postal_code: external_exports.string().min(1).describe("The postal or ZIP code used for the lookup.").optional(),
93
- country: external_exports.string().min(1).describe("The country context for the lookup.").optional(),
94
- county: external_exports.string().min(1).describe("The county name used for the lookup.").optional(),
95
- fields: external_exports.string().min(1).describe("A comma-separated list of Geocodio data append codes.").optional(),
96
- limit: external_exports.int().min(0).describe("The maximum number of results to return.").optional(),
97
- format: external_exports.literal("simple").describe("Return Geocodio's simplified single-result response format.").optional()
98
- }).describe("The input payload for geocoding a single address with Geocodio.");
99
- var singleGeocodeOutput = external_exports.looseObject({
100
- input: external_exports.record(external_exports.string(), external_exports.unknown().describe("A property value in a JSON-like object.")).describe("A JSON-like object with arbitrary string keys.").optional(),
101
- results: external_exports.array(external_exports.looseObject({
102
- formatted_address: external_exports.string().describe("The full formatted address.").optional(),
103
- location: external_exports.looseObject({
104
- lat: external_exports.number().describe("The latitude coordinate."),
105
- lng: external_exports.number().describe("The longitude coordinate.")
106
- }).describe("Latitude and longitude returned by Geocodio.").optional(),
107
- accuracy: external_exports.number().describe("The match accuracy score from 0.0 to 1.0.").optional(),
108
- accuracy_type: external_exports.string().describe("The Geocodio accuracy type for the match.").optional(),
109
- source: external_exports.string().describe("The source dataset for the match.").optional(),
110
- address_components: external_exports.record(external_exports.string(), external_exports.unknown().describe("A property value in a JSON-like object.")).describe("A JSON-like object with arbitrary string keys.").optional(),
111
- address_lines: external_exports.array(external_exports.string().describe("One formatted address line.")).describe("Formatted address lines.").optional(),
112
- fields: external_exports.record(external_exports.string(), external_exports.unknown().describe("A property value in a JSON-like object.")).describe("A JSON-like object with arbitrary string keys.").optional()
113
- }).describe("A single Geocodio geocoding result.")).describe("The ordered geocoding match results.").optional(),
114
- lat: external_exports.number().describe("The latitude returned by Geocodio simple format.").optional(),
115
- lng: external_exports.number().describe("The longitude returned by Geocodio simple format.").optional(),
116
- address: external_exports.string().describe("The address returned by Geocodio simple format.").optional(),
117
- source: external_exports.string().describe("The source returned by Geocodio simple format.").optional()
118
- }).describe("The Geocodio response for a single geocode or reverse geocode request.");
119
- var geocodeBatchInput = external_exports.strictObject({
120
- addresses: external_exports.array(external_exports.string().min(1).describe("One address string to geocode.")).min(1).max(1e4).describe("The address strings to geocode in one batch request."),
121
- fields: external_exports.string().min(1).describe("A comma-separated list of Geocodio data append codes.").optional(),
122
- limit: external_exports.int().min(0).describe("The maximum number of results per address.").optional()
123
- }).describe("The input payload for batch geocoding addresses with Geocodio.");
124
- var geocodeBatchOutput = external_exports.strictObject({
125
- results: external_exports.array(external_exports.looseObject({
126
- query: external_exports.string().describe("The original query string from the batch request."),
127
- response: external_exports.record(external_exports.string(), external_exports.unknown().describe("A property value in a JSON-like object.")).describe("A JSON-like object with arbitrary string keys.")
128
- }).describe("One batch geocoding or reverse geocoding result.")).describe("The ordered batch response items.")
129
- }).describe("The Geocodio response for a batch geocoding request.");
130
- var singleReverseGeocodeInput = external_exports.strictObject({
131
- lat: external_exports.number().min(-90).max(90).describe("The latitude to reverse geocode."),
132
- lng: external_exports.number().min(-180).max(180).describe("The longitude to reverse geocode."),
133
- fields: external_exports.string().min(1).describe("A comma-separated list of Geocodio data append codes.").optional(),
134
- limit: external_exports.int().min(0).describe("The maximum number of results to return.").optional(),
135
- format: external_exports.literal("simple").describe("Return Geocodio's simplified single-result response format.").optional()
136
- }).describe("The input payload for reverse geocoding a single latitude and longitude pair.");
137
- var singleReverseGeocodeOutput = external_exports.looseObject({
138
- input: external_exports.record(external_exports.string(), external_exports.unknown().describe("A property value in a JSON-like object.")).describe("A JSON-like object with arbitrary string keys.").optional(),
139
- results: external_exports.array(external_exports.looseObject({
140
- formatted_address: external_exports.string().describe("The full formatted address.").optional(),
141
- location: external_exports.looseObject({
142
- lat: external_exports.number().describe("The latitude coordinate."),
143
- lng: external_exports.number().describe("The longitude coordinate.")
144
- }).describe("Latitude and longitude returned by Geocodio.").optional(),
145
- accuracy: external_exports.number().describe("The match accuracy score from 0.0 to 1.0.").optional(),
146
- accuracy_type: external_exports.string().describe("The Geocodio accuracy type for the match.").optional(),
147
- source: external_exports.string().describe("The source dataset for the match.").optional(),
148
- address_components: external_exports.record(external_exports.string(), external_exports.unknown().describe("A property value in a JSON-like object.")).describe("A JSON-like object with arbitrary string keys.").optional(),
149
- address_lines: external_exports.array(external_exports.string().describe("One formatted address line.")).describe("Formatted address lines.").optional(),
150
- fields: external_exports.record(external_exports.string(), external_exports.unknown().describe("A property value in a JSON-like object.")).describe("A JSON-like object with arbitrary string keys.").optional()
151
- }).describe("A single Geocodio geocoding result.")).describe("The ordered geocoding match results.").optional(),
152
- lat: external_exports.number().describe("The latitude returned by Geocodio simple format.").optional(),
153
- lng: external_exports.number().describe("The longitude returned by Geocodio simple format.").optional(),
154
- address: external_exports.string().describe("The address returned by Geocodio simple format.").optional(),
155
- source: external_exports.string().describe("The source returned by Geocodio simple format.").optional()
156
- }).describe("The Geocodio response for a single geocode or reverse geocode request.");
157
- var batchReverseGeocodeInput = external_exports.strictObject({
158
- coordinates: external_exports.array(external_exports.string().min(1).describe("One `latitude,longitude` coordinate string.")).min(1).max(1e4).describe("The coordinate strings to reverse geocode in one batch request."),
159
- fields: external_exports.string().min(1).describe("A comma-separated list of Geocodio data append codes.").optional(),
160
- limit: external_exports.int().min(0).describe("The maximum number of results per coordinate.").optional()
161
- }).describe("The input payload for batch reverse geocoding coordinate pairs with Geocodio.");
162
- var batchReverseGeocodeOutput = external_exports.strictObject({
163
- results: external_exports.array(external_exports.looseObject({
164
- query: external_exports.string().describe("The original query string from the batch request."),
165
- response: external_exports.record(external_exports.string(), external_exports.unknown().describe("A property value in a JSON-like object.")).describe("A JSON-like object with arbitrary string keys.")
166
- }).describe("One batch geocoding or reverse geocoding result.")).describe("The ordered batch response items.")
167
- }).describe("The Geocodio response for a batch geocoding request.");
168
- var geocodioActions = {
169
- single_geocode: {
170
- description: "Geocode a single address and return the official Geocodio response payload.",
171
- effect: "write",
172
- inputSchema: singleGeocodeInput,
173
- outputSchema: external_exports.toJSONSchema(singleGeocodeOutput, { io: "output", unrepresentable: "any" })
174
- },
175
- geocode_batch: {
176
- description: "Geocode multiple addresses in one batch request and return Geocodio batch results.",
177
- effect: "write",
178
- inputSchema: geocodeBatchInput,
179
- outputSchema: external_exports.toJSONSchema(geocodeBatchOutput, { io: "output", unrepresentable: "any" })
180
- },
181
- single_reverse_geocode: {
182
- description: "Reverse geocode a single latitude and longitude pair and return the official Geocodio response payload.",
183
- effect: "write",
184
- inputSchema: singleReverseGeocodeInput,
185
- outputSchema: external_exports.toJSONSchema(singleReverseGeocodeOutput, { io: "output", unrepresentable: "any" })
186
- },
187
- batch_reverse_geocode: {
188
- description: "Reverse geocode multiple coordinate pairs in one batch request and return Geocodio batch results.",
189
- effect: "write",
190
- inputSchema: batchReverseGeocodeInput,
191
- outputSchema: external_exports.toJSONSchema(batchReverseGeocodeOutput, { io: "output", unrepresentable: "any" })
192
- }
193
- };
194
-
195
- // ../plugins/src/geocodio/index.ts
196
- function createGeocodioPlugin() {
197
- return createProviderPlugin({
198
- description: "Geocodio",
199
- actions: geocodioActions,
200
- handlers: {
201
- single_geocode: singleGeocode,
202
- geocode_batch: geocodeBatch,
203
- single_reverse_geocode: singleReverseGeocode,
204
- batch_reverse_geocode: batchReverseGeocode
205
- }
206
- });
207
- }
208
- var geocodio_default = createGeocodioPlugin();
209
- export {
210
- createGeocodioPlugin,
211
- geocodio_default as default
212
- };
@@ -1,337 +0,0 @@
1
- import {
2
- createProviderHttpClient
3
- } from "./chunk-E6JCVKW6.js";
4
- import {
5
- asJsonObject,
6
- trimmedText
7
- } from "./chunk-JXHMDBAY.js";
8
- import {
9
- createProviderPlugin,
10
- requireCredential,
11
- upstreamError
12
- } from "./chunk-ATK45BXV.js";
13
- import {
14
- assertPublicHttpUrl
15
- } from "./chunk-U7B6DS2O.js";
16
- import {
17
- TBError,
18
- external_exports
19
- } from "./chunk-UZM2RXZH.js";
20
- import "./chunk-U67V476Y.js";
21
-
22
- // ../plugins/src/ghost/api.ts
23
- var SERVICE = "ghost";
24
- var CONTENT_PATH_PREFIX = "/ghost/api/content";
25
- var CONTENT_API_VERSION = "v5.0";
26
- var http = createProviderHttpClient({ service: SERVICE });
27
- function contentBaseUrl(ctx) {
28
- const raw = requireCredential(ctx, SERVICE, "siteUrl");
29
- let url;
30
- try {
31
- url = assertPublicHttpUrl(raw);
32
- } catch {
33
- throw new TBError(
34
- "invalid_argument",
35
- "Ghost \u51ED\u8BC1\u91CC\u7684 siteUrl \u4E0D\u662F\u53EF\u51FA\u7AD9\u7684\u516C\u7F51 http(s) \u5730\u5740 \u2014\u2014 \u63D2\u4EF6\u4F1A\u62E6\u4E0B\u79C1\u6709\u7F51\u6BB5\u3001\u56DE\u73AF\u4E0E\u4E91\u5143\u6570\u636E\u5730\u5740(\u9632 SSRF)\u3002\u8BF7\u628A\u8FD9\u4E2A Ghost \u7AD9\u70B9\u7684\u516C\u5F00\u5730\u5740\u586B\u8FDB\u51ED\u8BC1\u7684 siteUrl \u5B57\u6BB5"
36
- );
37
- }
38
- if (url.username !== "" || url.password !== "") {
39
- throw new TBError("invalid_argument", "Ghost \u51ED\u8BC1\u91CC\u7684 siteUrl \u4E0D\u80FD\u5185\u5D4C\u7528\u6237\u540D\u6216\u5BC6\u7801");
40
- }
41
- url.hash = "";
42
- url.search = "";
43
- url.pathname = url.pathname.replace(/\/+$/, "");
44
- const site = url.toString().replace(/\/$/, "");
45
- return `${site}${CONTENT_PATH_PREFIX}/${CONTENT_API_VERSION}`;
46
- }
47
- function errorMessage(status, payload) {
48
- const body = asJsonObject(payload);
49
- const errors = body?.errors;
50
- if (Array.isArray(errors)) {
51
- const message = trimmedText(asJsonObject(errors[0])?.message);
52
- if (message !== void 0) return message;
53
- }
54
- return trimmedText(body?.message) ?? `Ghost \u8FD4\u56DE HTTP ${status}`;
55
- }
56
- function errorPayload(data, bodyKind) {
57
- return bodyKind === "invalid-json" ? { message: data } : data;
58
- }
59
- async function request(ctx, path, query = {}) {
60
- const result = await http.request({
61
- // base 里已经带 /ghost/api/content/v5.0;薄层会保住这段部署路径。
62
- baseUrl: `${contentBaseUrl(ctx)}/`,
63
- path,
64
- query: [
65
- ["key", requireCredential(ctx, SERVICE, "apiKey")],
66
- ...Object.entries(query)
67
- ],
68
- headers: { accept: "application/json" },
69
- invalidJsonMessage: "Ghost \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94",
70
- mapError: ({ bodyKind, data, status }) => upstreamError(
71
- status,
72
- errorMessage(status, errorPayload(data, bodyKind))
73
- )
74
- });
75
- return result.data === void 0 ? {} : result.data;
76
- }
77
- function browseQuery(input) {
78
- return {
79
- limit: input.limit,
80
- page: input.page,
81
- include: trimmedText(input.include),
82
- fields: trimmedText(input.fields),
83
- formats: trimmedText(input.formats),
84
- filter: trimmedText(input.filter),
85
- order: trimmedText(input.order)
86
- };
87
- }
88
- function readQuery(input) {
89
- return {
90
- include: trimmedText(input.include),
91
- fields: trimmedText(input.fields),
92
- formats: trimmedText(input.formats)
93
- };
94
- }
95
- async function browse(input, ctx, collection) {
96
- const payload = asJsonObject(await request(ctx, `/${collection}/`, browseQuery(input))) ?? {};
97
- const items = payload[collection];
98
- return {
99
- [collection]: Array.isArray(items) ? items.map((item) => asJsonObject(item) ?? {}) : [],
100
- meta: asJsonObject(payload.meta) ?? null
101
- };
102
- }
103
- async function read(input, ctx, collection) {
104
- const id = trimmedText(input.id);
105
- const slug = trimmedText(input.slug);
106
- if (id === void 0 && slug === void 0) {
107
- throw new TBError("invalid_argument", "id or slug is required");
108
- }
109
- const path = id === void 0 ? `/${collection}/slug/${encodeURIComponent(slug)}/` : `/${collection}/${encodeURIComponent(id)}/`;
110
- const payload = asJsonObject(await request(ctx, path, readQuery(input))) ?? {};
111
- const items = payload[collection];
112
- const resource = Array.isArray(items) ? asJsonObject(items[0]) : void 0;
113
- return { [collection.slice(0, -1)]: resource ?? null };
114
- }
115
- function listPosts(input, ctx) {
116
- return browse(input, ctx, "posts");
117
- }
118
- function getPost(input, ctx) {
119
- return read(input, ctx, "posts");
120
- }
121
- function listPages(input, ctx) {
122
- return browse(input, ctx, "pages");
123
- }
124
- function getPage(input, ctx) {
125
- return read(input, ctx, "pages");
126
- }
127
- function listTags(input, ctx) {
128
- return browse(input, ctx, "tags");
129
- }
130
- function getTag(input, ctx) {
131
- return read(input, ctx, "tags");
132
- }
133
- function listAuthors(input, ctx) {
134
- return browse(input, ctx, "authors");
135
- }
136
- function getAuthor(input, ctx) {
137
- return read(input, ctx, "authors");
138
- }
139
- async function readSettings(_input, ctx) {
140
- const payload = asJsonObject(await request(ctx, "/settings/"));
141
- return { settings: asJsonObject(payload?.settings) ?? null };
142
- }
143
-
144
- // ../plugins/src/ghost/schema.ts
145
- var listPostsInput = external_exports.strictObject({
146
- limit: external_exports.int().min(1).max(100).describe("The maximum number of resources to request from Ghost.").optional(),
147
- page: external_exports.int().min(1).describe("The one-based page number to request from Ghost.").optional(),
148
- include: external_exports.string().min(1).describe("Comma-separated Ghost include expression, such as authors,tags or count.posts.").optional(),
149
- fields: external_exports.string().min(1).describe("Comma-separated Ghost field list to return.").optional(),
150
- formats: external_exports.string().min(1).describe("Comma-separated Ghost formats to return, such as html,plaintext.").optional(),
151
- filter: external_exports.string().min(1).describe("Ghost Content API filter expression.").optional(),
152
- order: external_exports.string().min(1).describe("Ghost Content API order expression.").optional()
153
- }).describe("Input for browsing Ghost content resources.");
154
- var listPostsOutput = external_exports.strictObject({
155
- posts: external_exports.array(external_exports.looseObject({}).describe("The raw Ghost Content API object.")).describe("The Ghost posts returned by the Content API.").optional(),
156
- meta: external_exports.looseObject({}).describe("The Ghost Content API pagination metadata.").nullable().optional()
157
- }).describe("Ghost posts browse response.");
158
- var getPostInput = external_exports.strictObject({
159
- id: external_exports.string().min(1).describe("The Ghost resource ID.").optional(),
160
- slug: external_exports.string().min(1).describe("The Ghost resource slug.").optional(),
161
- include: external_exports.string().min(1).describe("Comma-separated Ghost include expression, such as authors,tags or count.posts.").optional(),
162
- fields: external_exports.string().min(1).describe("Comma-separated Ghost field list to return.").optional(),
163
- formats: external_exports.string().min(1).describe("Comma-separated Ghost formats to return, such as html,plaintext.").optional()
164
- }).describe("Input for reading one Ghost content resource.");
165
- var getPostOutput = external_exports.strictObject({
166
- post: external_exports.looseObject({}).describe("The raw Ghost Content API object.").nullable().optional()
167
- }).describe("Ghost post read response.");
168
- var listPagesInput = external_exports.strictObject({
169
- limit: external_exports.int().min(1).max(100).describe("The maximum number of resources to request from Ghost.").optional(),
170
- page: external_exports.int().min(1).describe("The one-based page number to request from Ghost.").optional(),
171
- include: external_exports.string().min(1).describe("Comma-separated Ghost include expression, such as authors,tags or count.posts.").optional(),
172
- fields: external_exports.string().min(1).describe("Comma-separated Ghost field list to return.").optional(),
173
- formats: external_exports.string().min(1).describe("Comma-separated Ghost formats to return, such as html,plaintext.").optional(),
174
- filter: external_exports.string().min(1).describe("Ghost Content API filter expression.").optional(),
175
- order: external_exports.string().min(1).describe("Ghost Content API order expression.").optional()
176
- }).describe("Input for browsing Ghost content resources.");
177
- var listPagesOutput = external_exports.strictObject({
178
- pages: external_exports.array(external_exports.looseObject({}).describe("The raw Ghost Content API object.")).describe("The Ghost pages returned by the Content API.").optional(),
179
- meta: external_exports.looseObject({}).describe("The Ghost Content API pagination metadata.").nullable().optional()
180
- }).describe("Ghost pages browse response.");
181
- var getPageInput = external_exports.strictObject({
182
- id: external_exports.string().min(1).describe("The Ghost resource ID.").optional(),
183
- slug: external_exports.string().min(1).describe("The Ghost resource slug.").optional(),
184
- include: external_exports.string().min(1).describe("Comma-separated Ghost include expression, such as authors,tags or count.posts.").optional(),
185
- fields: external_exports.string().min(1).describe("Comma-separated Ghost field list to return.").optional(),
186
- formats: external_exports.string().min(1).describe("Comma-separated Ghost formats to return, such as html,plaintext.").optional()
187
- }).describe("Input for reading one Ghost content resource.");
188
- var getPageOutput = external_exports.strictObject({
189
- page: external_exports.looseObject({}).describe("The raw Ghost Content API object.").nullable().optional()
190
- }).describe("Ghost page read response.");
191
- var listTagsInput = external_exports.strictObject({
192
- limit: external_exports.int().min(1).max(100).describe("The maximum number of resources to request from Ghost.").optional(),
193
- page: external_exports.int().min(1).describe("The one-based page number to request from Ghost.").optional(),
194
- include: external_exports.string().min(1).describe("Comma-separated Ghost include expression, such as authors,tags or count.posts.").optional(),
195
- fields: external_exports.string().min(1).describe("Comma-separated Ghost field list to return.").optional(),
196
- formats: external_exports.string().min(1).describe("Comma-separated Ghost formats to return, such as html,plaintext.").optional(),
197
- filter: external_exports.string().min(1).describe("Ghost Content API filter expression.").optional(),
198
- order: external_exports.string().min(1).describe("Ghost Content API order expression.").optional()
199
- }).describe("Input for browsing Ghost content resources.");
200
- var listTagsOutput = external_exports.strictObject({
201
- tags: external_exports.array(external_exports.looseObject({}).describe("The raw Ghost Content API object.")).describe("The Ghost tags returned by the Content API.").optional(),
202
- meta: external_exports.looseObject({}).describe("The Ghost Content API pagination metadata.").nullable().optional()
203
- }).describe("Ghost tags browse response.");
204
- var getTagInput = external_exports.strictObject({
205
- id: external_exports.string().min(1).describe("The Ghost resource ID.").optional(),
206
- slug: external_exports.string().min(1).describe("The Ghost resource slug.").optional(),
207
- include: external_exports.string().min(1).describe("Comma-separated Ghost include expression, such as authors,tags or count.posts.").optional(),
208
- fields: external_exports.string().min(1).describe("Comma-separated Ghost field list to return.").optional(),
209
- formats: external_exports.string().min(1).describe("Comma-separated Ghost formats to return, such as html,plaintext.").optional()
210
- }).describe("Input for reading one Ghost content resource.");
211
- var getTagOutput = external_exports.strictObject({
212
- tag: external_exports.looseObject({}).describe("The raw Ghost Content API object.").nullable().optional()
213
- }).describe("Ghost tag read response.");
214
- var listAuthorsInput = external_exports.strictObject({
215
- limit: external_exports.int().min(1).max(100).describe("The maximum number of resources to request from Ghost.").optional(),
216
- page: external_exports.int().min(1).describe("The one-based page number to request from Ghost.").optional(),
217
- include: external_exports.string().min(1).describe("Comma-separated Ghost include expression, such as authors,tags or count.posts.").optional(),
218
- fields: external_exports.string().min(1).describe("Comma-separated Ghost field list to return.").optional(),
219
- formats: external_exports.string().min(1).describe("Comma-separated Ghost formats to return, such as html,plaintext.").optional(),
220
- filter: external_exports.string().min(1).describe("Ghost Content API filter expression.").optional(),
221
- order: external_exports.string().min(1).describe("Ghost Content API order expression.").optional()
222
- }).describe("Input for browsing Ghost content resources.");
223
- var listAuthorsOutput = external_exports.strictObject({
224
- authors: external_exports.array(external_exports.looseObject({}).describe("The raw Ghost Content API object.")).describe("The Ghost authors returned by the Content API.").optional(),
225
- meta: external_exports.looseObject({}).describe("The Ghost Content API pagination metadata.").nullable().optional()
226
- }).describe("Ghost authors browse response.");
227
- var getAuthorInput = external_exports.strictObject({
228
- id: external_exports.string().min(1).describe("The Ghost resource ID.").optional(),
229
- slug: external_exports.string().min(1).describe("The Ghost resource slug.").optional(),
230
- include: external_exports.string().min(1).describe("Comma-separated Ghost include expression, such as authors,tags or count.posts.").optional(),
231
- fields: external_exports.string().min(1).describe("Comma-separated Ghost field list to return.").optional(),
232
- formats: external_exports.string().min(1).describe("Comma-separated Ghost formats to return, such as html,plaintext.").optional()
233
- }).describe("Input for reading one Ghost content resource.");
234
- var getAuthorOutput = external_exports.strictObject({
235
- author: external_exports.looseObject({}).describe("The raw Ghost Content API object.").nullable().optional()
236
- }).describe("Ghost author read response.");
237
- var readSettingsInput = external_exports.strictObject({}).describe("No input is required to read Ghost settings.");
238
- var readSettingsOutput = external_exports.strictObject({
239
- settings: external_exports.looseObject({}).describe("The raw Ghost settings object.").nullable().optional()
240
- }).describe("Ghost settings response.");
241
- var ghostActions = {
242
- list_posts: {
243
- description: "List published posts from the connected Ghost site.",
244
- effect: "read",
245
- inputSchema: listPostsInput,
246
- outputSchema: external_exports.toJSONSchema(listPostsOutput, { io: "output", unrepresentable: "any" })
247
- },
248
- get_post: {
249
- description: "Get one published Ghost post by ID or slug.",
250
- effect: "read",
251
- inputSchema: getPostInput,
252
- outputSchema: external_exports.toJSONSchema(getPostOutput, { io: "output", unrepresentable: "any" })
253
- },
254
- list_pages: {
255
- description: "List published pages from the connected Ghost site.",
256
- effect: "read",
257
- inputSchema: listPagesInput,
258
- outputSchema: external_exports.toJSONSchema(listPagesOutput, { io: "output", unrepresentable: "any" })
259
- },
260
- get_page: {
261
- description: "Get one published Ghost page by ID or slug.",
262
- effect: "read",
263
- inputSchema: getPageInput,
264
- outputSchema: external_exports.toJSONSchema(getPageOutput, { io: "output", unrepresentable: "any" })
265
- },
266
- list_tags: {
267
- description: "List public tags from the connected Ghost site.",
268
- effect: "read",
269
- inputSchema: listTagsInput,
270
- outputSchema: external_exports.toJSONSchema(listTagsOutput, { io: "output", unrepresentable: "any" })
271
- },
272
- get_tag: {
273
- description: "Get one public Ghost tag by ID or slug.",
274
- effect: "read",
275
- inputSchema: getTagInput,
276
- outputSchema: external_exports.toJSONSchema(getTagOutput, { io: "output", unrepresentable: "any" })
277
- },
278
- list_authors: {
279
- description: "List public authors from the connected Ghost site.",
280
- effect: "read",
281
- inputSchema: listAuthorsInput,
282
- outputSchema: external_exports.toJSONSchema(listAuthorsOutput, { io: "output", unrepresentable: "any" })
283
- },
284
- get_author: {
285
- description: "Get one public Ghost author by ID or slug.",
286
- effect: "read",
287
- inputSchema: getAuthorInput,
288
- outputSchema: external_exports.toJSONSchema(getAuthorOutput, { io: "output", unrepresentable: "any" })
289
- },
290
- read_settings: {
291
- description: "Read public settings for the connected Ghost site.",
292
- effect: "read",
293
- inputSchema: readSettingsInput,
294
- outputSchema: external_exports.toJSONSchema(readSettingsOutput, { io: "output", unrepresentable: "any" })
295
- }
296
- };
297
-
298
- // ../plugins/src/ghost/index.ts
299
- function createGhostPlugin() {
300
- return createProviderPlugin({
301
- description: "Ghost (Content API)",
302
- actions: ghostActions,
303
- credentialFields: [
304
- {
305
- key: "apiKey",
306
- label: "Content API Key",
307
- required: true,
308
- secret: true,
309
- description: "Ghost Content API key,\u4F5C\u4E3A key query \u53C2\u6570\u53D1\u9001;\u5728 Ghost Admin \u7684 Settings > Advanced > Integrations \u91CC\u521B\u5EFA\u6216\u67E5\u770B"
310
- },
311
- {
312
- key: "siteUrl",
313
- label: "Site URL",
314
- required: true,
315
- secret: false,
316
- description: "Ghost \u7AD9\u70B9\u7684\u516C\u5F00\u5730\u5740(https://example.ghost.io),\u4E0D\u8981\u5E26 API \u8DEF\u5F84;\u5FC5\u987B\u662F\u516C\u7F51\u53EF\u8FBE\u5730\u5740,\u79C1\u6709\u7F51\u6BB5\u4F1A\u88AB\u51FA\u7AD9\u7B56\u7565\u62E6\u4E0B"
317
- }
318
- ],
319
- credentialProbe: "read_settings",
320
- handlers: {
321
- list_posts: listPosts,
322
- get_post: getPost,
323
- list_pages: listPages,
324
- get_page: getPage,
325
- list_tags: listTags,
326
- get_tag: getTag,
327
- list_authors: listAuthors,
328
- get_author: getAuthor,
329
- read_settings: readSettings
330
- }
331
- });
332
- }
333
- var ghost_default = createGhostPlugin();
334
- export {
335
- createGhostPlugin,
336
- ghost_default as default
337
- };