@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,379 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createProviderPlugin,
|
|
3
|
+
guardedFetch,
|
|
4
|
+
requireApiKey,
|
|
5
|
+
upstreamError
|
|
6
|
+
} from "./chunk-CSJEZHQO.js";
|
|
7
|
+
import "./chunk-K7FVSFUX.js";
|
|
8
|
+
import {
|
|
9
|
+
external_exports
|
|
10
|
+
} from "./chunk-JLTYA2B3.js";
|
|
11
|
+
import "./chunk-MLKGABMK.js";
|
|
12
|
+
|
|
13
|
+
// ../plugins/src/front/api.ts
|
|
14
|
+
var SERVICE = "front";
|
|
15
|
+
var API_BASE = "https://api2.frontapp.com";
|
|
16
|
+
var REQUEST_TIMEOUT_MS = 15e3;
|
|
17
|
+
function text(value) {
|
|
18
|
+
if (typeof value !== "string") return void 0;
|
|
19
|
+
const trimmed = value.trim();
|
|
20
|
+
return trimmed === "" ? void 0 : trimmed;
|
|
21
|
+
}
|
|
22
|
+
function record(value) {
|
|
23
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
24
|
+
}
|
|
25
|
+
async function readPayload(response) {
|
|
26
|
+
const body = await response.text().catch(() => "");
|
|
27
|
+
if (body.trim() === "") return {};
|
|
28
|
+
try {
|
|
29
|
+
return JSON.parse(body);
|
|
30
|
+
} catch {
|
|
31
|
+
return body;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function errorMessage(payload) {
|
|
35
|
+
if (typeof payload === "string") return text(payload);
|
|
36
|
+
const body = record(payload);
|
|
37
|
+
if (body === void 0) return void 0;
|
|
38
|
+
const nested = record(body.error);
|
|
39
|
+
return text(body.message) ?? text(body._error) ?? text(body.error) ?? text(nested?.message);
|
|
40
|
+
}
|
|
41
|
+
async function request(ctx, path, input) {
|
|
42
|
+
const apiKey = requireApiKey(ctx, SERVICE);
|
|
43
|
+
const url = new URL(path, API_BASE);
|
|
44
|
+
for (const [key, value] of input.query ?? []) {
|
|
45
|
+
if (typeof value === "string" && value !== "") url.searchParams.set(key, value);
|
|
46
|
+
else if (typeof value === "number") url.searchParams.set(key, String(value));
|
|
47
|
+
}
|
|
48
|
+
const headers = {
|
|
49
|
+
accept: "application/json",
|
|
50
|
+
authorization: `Bearer ${apiKey}`
|
|
51
|
+
};
|
|
52
|
+
if (input.body !== void 0) headers["content-type"] = "application/json";
|
|
53
|
+
const timeoutSignal = AbortSignal.timeout(REQUEST_TIMEOUT_MS);
|
|
54
|
+
let response;
|
|
55
|
+
try {
|
|
56
|
+
response = await guardedFetch(url.toString(), {
|
|
57
|
+
method: input.method,
|
|
58
|
+
headers,
|
|
59
|
+
signal: timeoutSignal,
|
|
60
|
+
...input.body === void 0 ? {} : { body: JSON.stringify(input.body) }
|
|
61
|
+
});
|
|
62
|
+
} catch (error) {
|
|
63
|
+
if (timeoutSignal.aborted) throw upstreamError(504, "front \u8BF7\u6C42\u8D85\u65F6");
|
|
64
|
+
throw upstreamError(502, error instanceof Error ? `front \u8BF7\u6C42\u5931\u8D25: ${error.message}` : "front \u8BF7\u6C42\u5931\u8D25");
|
|
65
|
+
}
|
|
66
|
+
const payload = await readPayload(response);
|
|
67
|
+
if (!response.ok) {
|
|
68
|
+
throw upstreamError(
|
|
69
|
+
response.status,
|
|
70
|
+
errorMessage(payload) ?? (response.statusText || `front \u8FD4\u56DE HTTP ${response.status}`)
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
return payload;
|
|
74
|
+
}
|
|
75
|
+
function readResults(payload) {
|
|
76
|
+
const body = record(payload);
|
|
77
|
+
if (body === void 0) throw upstreamError(502, "front response must be an object");
|
|
78
|
+
if (!Array.isArray(body._results)) throw upstreamError(502, "front response is missing _results");
|
|
79
|
+
return body._results;
|
|
80
|
+
}
|
|
81
|
+
function requiredString(value, fieldName) {
|
|
82
|
+
const result = text(value);
|
|
83
|
+
if (result === void 0) throw upstreamError(502, `${fieldName} is required`);
|
|
84
|
+
return result;
|
|
85
|
+
}
|
|
86
|
+
function nullableString(value) {
|
|
87
|
+
if (value === null || value === void 0) return null;
|
|
88
|
+
return text(value) ?? null;
|
|
89
|
+
}
|
|
90
|
+
function requiredBoolean(value, fieldName) {
|
|
91
|
+
if (typeof value !== "boolean") throw upstreamError(502, `${fieldName} must be a boolean`);
|
|
92
|
+
return value;
|
|
93
|
+
}
|
|
94
|
+
function readArray(value) {
|
|
95
|
+
if (value === void 0 || value === null) return [];
|
|
96
|
+
if (!Array.isArray(value)) throw upstreamError(502, "front array field has invalid shape");
|
|
97
|
+
return value;
|
|
98
|
+
}
|
|
99
|
+
function readStringArray(value) {
|
|
100
|
+
return readArray(value).map((item) => requiredString(item, "array item"));
|
|
101
|
+
}
|
|
102
|
+
function readObject(value, name) {
|
|
103
|
+
const body = record(value);
|
|
104
|
+
if (body === void 0) throw upstreamError(502, `${name} must be an object`);
|
|
105
|
+
return body;
|
|
106
|
+
}
|
|
107
|
+
function normalizeContactHandle(value) {
|
|
108
|
+
const body = readObject(value, "front contact handle");
|
|
109
|
+
return {
|
|
110
|
+
handle: requiredString(body.handle, "contactHandle.handle"),
|
|
111
|
+
source: requiredString(body.source, "contactHandle.source")
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
function normalizeContactList(value) {
|
|
115
|
+
const body = readObject(value, "front contact list");
|
|
116
|
+
return {
|
|
117
|
+
id: requiredString(body.id, "contactList.id"),
|
|
118
|
+
name: requiredString(body.name, "contactList.name"),
|
|
119
|
+
isPrivate: requiredBoolean(body.is_private, "contactList.is_private")
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function normalizeContact(value) {
|
|
123
|
+
const body = readObject(value, "front contact");
|
|
124
|
+
return {
|
|
125
|
+
id: requiredString(body.id, "contact.id"),
|
|
126
|
+
name: nullableString(body.name),
|
|
127
|
+
description: nullableString(body.description),
|
|
128
|
+
avatarUrl: nullableString(body.avatar_url),
|
|
129
|
+
links: readStringArray(body.links),
|
|
130
|
+
lists: readArray(body.lists).map((item) => normalizeContactList(item)),
|
|
131
|
+
handles: readArray(body.handles).map((item) => normalizeContactHandle(item)),
|
|
132
|
+
customFields: record(body.custom_fields) ?? {},
|
|
133
|
+
isPrivate: requiredBoolean(body.is_private, "contact.is_private")
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
function normalizeTeammate(value) {
|
|
137
|
+
const body = readObject(value, "front teammate");
|
|
138
|
+
return {
|
|
139
|
+
id: requiredString(body.id, "teammate.id"),
|
|
140
|
+
email: requiredString(body.email, "teammate.email"),
|
|
141
|
+
username: requiredString(body.username, "teammate.username"),
|
|
142
|
+
firstName: requiredString(body.first_name, "teammate.first_name"),
|
|
143
|
+
lastName: requiredString(body.last_name, "teammate.last_name"),
|
|
144
|
+
isAdmin: requiredBoolean(body.is_admin, "teammate.is_admin"),
|
|
145
|
+
isAvailable: requiredBoolean(body.is_available, "teammate.is_available"),
|
|
146
|
+
isBlocked: requiredBoolean(body.is_blocked, "teammate.is_blocked"),
|
|
147
|
+
type: requiredString(body.type, "teammate.type"),
|
|
148
|
+
customFields: record(body.custom_fields) ?? {}
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
function extractPageToken(next) {
|
|
152
|
+
if (next === null) return null;
|
|
153
|
+
try {
|
|
154
|
+
return new URL(next).searchParams.get("page_token");
|
|
155
|
+
} catch {
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function normalizePagination(payload) {
|
|
160
|
+
const body = readObject(payload, "front list response");
|
|
161
|
+
const next = text(record(body._pagination)?.next) ?? null;
|
|
162
|
+
return { next, nextPageToken: extractPageToken(next) };
|
|
163
|
+
}
|
|
164
|
+
function buildContactBody(contact, handles) {
|
|
165
|
+
const body = {};
|
|
166
|
+
const name = text(contact.name);
|
|
167
|
+
if (name !== void 0) body.name = name;
|
|
168
|
+
const description = text(contact.description);
|
|
169
|
+
if (description !== void 0) body.description = description;
|
|
170
|
+
if (contact.links !== void 0) body.links = readStringArray(contact.links);
|
|
171
|
+
if (contact.listNames !== void 0) body.list_names = readStringArray(contact.listNames);
|
|
172
|
+
if (contact.customFields !== void 0) body.custom_fields = contact.customFields;
|
|
173
|
+
if (handles !== void 0) body.handles = handles;
|
|
174
|
+
return body;
|
|
175
|
+
}
|
|
176
|
+
async function listContacts(input, ctx) {
|
|
177
|
+
const payload = await request(ctx, "/contacts", {
|
|
178
|
+
method: "GET",
|
|
179
|
+
query: [
|
|
180
|
+
["q", input.query],
|
|
181
|
+
["limit", input.limit],
|
|
182
|
+
["page_token", input.pageToken],
|
|
183
|
+
["sort_by", input.sortBy],
|
|
184
|
+
["sort_order", input.sortOrder]
|
|
185
|
+
]
|
|
186
|
+
});
|
|
187
|
+
return {
|
|
188
|
+
contacts: readResults(payload).map((item) => normalizeContact(item)),
|
|
189
|
+
pagination: normalizePagination(payload)
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
async function getContact(input, ctx) {
|
|
193
|
+
const path = `/contacts/${encodeURIComponent(input.contactId)}`;
|
|
194
|
+
return { contact: normalizeContact(await request(ctx, path, { method: "GET" })) };
|
|
195
|
+
}
|
|
196
|
+
async function createContact(input, ctx) {
|
|
197
|
+
const body = buildContactBody(input.contact, input.handles);
|
|
198
|
+
return { contact: normalizeContact(await request(ctx, "/contacts", { method: "POST", body })) };
|
|
199
|
+
}
|
|
200
|
+
async function updateContact(input, ctx) {
|
|
201
|
+
const path = `/contacts/${encodeURIComponent(input.contactId)}`;
|
|
202
|
+
await request(ctx, path, { method: "PATCH", body: buildContactBody(input.contact) });
|
|
203
|
+
return { success: true };
|
|
204
|
+
}
|
|
205
|
+
async function listTeammates(_input, ctx) {
|
|
206
|
+
const payload = await request(ctx, "/teammates", { method: "GET" });
|
|
207
|
+
return { teammates: readResults(payload).map((item) => normalizeTeammate(item)) };
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// ../plugins/src/front/schema.ts
|
|
211
|
+
var listContactsInput = external_exports.strictObject({
|
|
212
|
+
query: external_exports.string().min(1).describe("Optional Front contact query object string for updated_after and updated_before filters.").optional(),
|
|
213
|
+
limit: external_exports.int().min(1).max(100).describe("Maximum number of contacts per page.").optional(),
|
|
214
|
+
pageToken: external_exports.string().min(1).describe("Front page token returned by a previous list_contacts call.").optional(),
|
|
215
|
+
sortBy: external_exports.enum(["created_at", "updated_at"]).describe("Field used to sort contacts.").optional(),
|
|
216
|
+
sortOrder: external_exports.enum(["asc", "desc"]).describe("Order by which contacts should be sorted.").optional()
|
|
217
|
+
}).describe("Input for listing Front contacts.");
|
|
218
|
+
var listContactsOutput = external_exports.strictObject({
|
|
219
|
+
contacts: external_exports.array(external_exports.strictObject({
|
|
220
|
+
id: external_exports.string().describe("Unique identifier of the contact."),
|
|
221
|
+
name: external_exports.string().describe("Contact name.").nullable(),
|
|
222
|
+
description: external_exports.string().describe("Contact description.").nullable(),
|
|
223
|
+
avatarUrl: external_exports.string().describe("URL of the contact avatar when Front returns one.").nullable(),
|
|
224
|
+
links: external_exports.array(external_exports.string().describe("A contact link URL.")).describe("Links associated with the contact."),
|
|
225
|
+
lists: external_exports.array(external_exports.strictObject({
|
|
226
|
+
id: external_exports.string().describe("Unique identifier of the contact list."),
|
|
227
|
+
name: external_exports.string().describe("Name of the contact list."),
|
|
228
|
+
isPrivate: external_exports.boolean().describe("Whether the contact list is private.")
|
|
229
|
+
}).describe("A Front contact list summary.")).describe("Contact lists that contain the contact."),
|
|
230
|
+
handles: external_exports.array(external_exports.strictObject({
|
|
231
|
+
handle: external_exports.string().min(1).describe("The handle value, such as an email address or phone number."),
|
|
232
|
+
source: external_exports.enum(["twitter", "email", "phone", "facebook", "intercom", "front_chat", "custom"]).describe("The Front contact handle source.")
|
|
233
|
+
}).describe("A handle with which a Front contact can be reached.")).describe("Handles with which the contact is reachable."),
|
|
234
|
+
customFields: external_exports.looseObject({}).describe("Custom fields keyed by the custom field name configured in Front.").optional(),
|
|
235
|
+
isPrivate: external_exports.boolean().describe("Whether the contact is private.")
|
|
236
|
+
}).describe("A normalized Front contact.")).describe("Contacts returned by Front."),
|
|
237
|
+
pagination: external_exports.strictObject({
|
|
238
|
+
next: external_exports.string().describe("Link to the next page of results when Front returns one.").nullable(),
|
|
239
|
+
nextPageToken: external_exports.string().describe("Token extracted from the next page link for the next connector call.").nullable()
|
|
240
|
+
}).describe("Front cursor pagination metadata.")
|
|
241
|
+
}).describe("The Front contacts page.");
|
|
242
|
+
var getContactInput = external_exports.strictObject({
|
|
243
|
+
contactId: external_exports.string().min(1).describe("The Front contact ID, or a documented resource alias such as source:handle.")
|
|
244
|
+
}).describe("Input for fetching one Front contact.");
|
|
245
|
+
var getContactOutput = external_exports.strictObject({
|
|
246
|
+
contact: external_exports.strictObject({
|
|
247
|
+
id: external_exports.string().describe("Unique identifier of the contact."),
|
|
248
|
+
name: external_exports.string().describe("Contact name.").nullable(),
|
|
249
|
+
description: external_exports.string().describe("Contact description.").nullable(),
|
|
250
|
+
avatarUrl: external_exports.string().describe("URL of the contact avatar when Front returns one.").nullable(),
|
|
251
|
+
links: external_exports.array(external_exports.string().describe("A contact link URL.")).describe("Links associated with the contact."),
|
|
252
|
+
lists: external_exports.array(external_exports.strictObject({
|
|
253
|
+
id: external_exports.string().describe("Unique identifier of the contact list."),
|
|
254
|
+
name: external_exports.string().describe("Name of the contact list."),
|
|
255
|
+
isPrivate: external_exports.boolean().describe("Whether the contact list is private.")
|
|
256
|
+
}).describe("A Front contact list summary.")).describe("Contact lists that contain the contact."),
|
|
257
|
+
handles: external_exports.array(external_exports.strictObject({
|
|
258
|
+
handle: external_exports.string().min(1).describe("The handle value, such as an email address or phone number."),
|
|
259
|
+
source: external_exports.enum(["twitter", "email", "phone", "facebook", "intercom", "front_chat", "custom"]).describe("The Front contact handle source.")
|
|
260
|
+
}).describe("A handle with which a Front contact can be reached.")).describe("Handles with which the contact is reachable."),
|
|
261
|
+
customFields: external_exports.looseObject({}).describe("Custom fields keyed by the custom field name configured in Front.").optional(),
|
|
262
|
+
isPrivate: external_exports.boolean().describe("Whether the contact is private.")
|
|
263
|
+
}).describe("A normalized Front contact.")
|
|
264
|
+
}).describe("The Front contact response.");
|
|
265
|
+
var createContactInput = external_exports.strictObject({
|
|
266
|
+
handles: external_exports.array(external_exports.strictObject({
|
|
267
|
+
handle: external_exports.string().min(1).describe("The handle value, such as an email address or phone number."),
|
|
268
|
+
source: external_exports.enum(["twitter", "email", "phone", "facebook", "intercom", "front_chat", "custom"]).describe("The Front contact handle source.")
|
|
269
|
+
}).describe("A handle with which a Front contact can be reached.")).min(1).describe("Handles with which the contact is reachable."),
|
|
270
|
+
contact: external_exports.strictObject({
|
|
271
|
+
name: external_exports.string().min(1).describe("Contact name.").optional(),
|
|
272
|
+
description: external_exports.string().min(1).describe("Contact description.").optional(),
|
|
273
|
+
links: external_exports.array(external_exports.string().min(1).describe("A contact link URL.")).describe("Links associated with the contact.").optional(),
|
|
274
|
+
listNames: external_exports.array(external_exports.string().min(1).describe("A contact list name.")).describe("Contact list names the contact belongs to. Front creates missing lists automatically.").optional(),
|
|
275
|
+
customFields: external_exports.looseObject({}).describe("Custom fields keyed by the custom field name configured in Front.").optional()
|
|
276
|
+
}).describe("JSON fields accepted by Front for contact create and update requests.")
|
|
277
|
+
}).describe("Input for creating a Front company contact.");
|
|
278
|
+
var createContactOutput = external_exports.strictObject({
|
|
279
|
+
contact: external_exports.strictObject({
|
|
280
|
+
id: external_exports.string().describe("Unique identifier of the contact."),
|
|
281
|
+
name: external_exports.string().describe("Contact name.").nullable(),
|
|
282
|
+
description: external_exports.string().describe("Contact description.").nullable(),
|
|
283
|
+
avatarUrl: external_exports.string().describe("URL of the contact avatar when Front returns one.").nullable(),
|
|
284
|
+
links: external_exports.array(external_exports.string().describe("A contact link URL.")).describe("Links associated with the contact."),
|
|
285
|
+
lists: external_exports.array(external_exports.strictObject({
|
|
286
|
+
id: external_exports.string().describe("Unique identifier of the contact list."),
|
|
287
|
+
name: external_exports.string().describe("Name of the contact list."),
|
|
288
|
+
isPrivate: external_exports.boolean().describe("Whether the contact list is private.")
|
|
289
|
+
}).describe("A Front contact list summary.")).describe("Contact lists that contain the contact."),
|
|
290
|
+
handles: external_exports.array(external_exports.strictObject({
|
|
291
|
+
handle: external_exports.string().min(1).describe("The handle value, such as an email address or phone number."),
|
|
292
|
+
source: external_exports.enum(["twitter", "email", "phone", "facebook", "intercom", "front_chat", "custom"]).describe("The Front contact handle source.")
|
|
293
|
+
}).describe("A handle with which a Front contact can be reached.")).describe("Handles with which the contact is reachable."),
|
|
294
|
+
customFields: external_exports.looseObject({}).describe("Custom fields keyed by the custom field name configured in Front.").optional(),
|
|
295
|
+
isPrivate: external_exports.boolean().describe("Whether the contact is private.")
|
|
296
|
+
}).describe("A normalized Front contact.")
|
|
297
|
+
}).describe("The Front contact created by the API.");
|
|
298
|
+
var updateContactInput = external_exports.strictObject({
|
|
299
|
+
contactId: external_exports.string().min(1).describe("The Front contact ID, or a documented resource alias such as source:handle."),
|
|
300
|
+
contact: external_exports.strictObject({
|
|
301
|
+
name: external_exports.string().min(1).describe("Contact name.").optional(),
|
|
302
|
+
description: external_exports.string().min(1).describe("Contact description.").optional(),
|
|
303
|
+
links: external_exports.array(external_exports.string().min(1).describe("A contact link URL.")).describe("Links associated with the contact.").optional(),
|
|
304
|
+
listNames: external_exports.array(external_exports.string().min(1).describe("A contact list name.")).describe("Contact list names the contact belongs to. Front creates missing lists automatically.").optional(),
|
|
305
|
+
customFields: external_exports.looseObject({}).describe("Custom fields keyed by the custom field name configured in Front.").optional()
|
|
306
|
+
}).describe("JSON fields accepted by Front for contact create and update requests.")
|
|
307
|
+
}).describe("Input for updating a Front contact.");
|
|
308
|
+
var updateContactOutput = external_exports.strictObject({
|
|
309
|
+
success: external_exports.boolean().describe("Whether Front accepted the update request.")
|
|
310
|
+
}).describe("The result of updating a Front contact.");
|
|
311
|
+
var listTeammatesInput = external_exports.strictObject({}).describe("Input for listing Front teammates.");
|
|
312
|
+
var listTeammatesOutput = external_exports.strictObject({
|
|
313
|
+
teammates: external_exports.array(external_exports.strictObject({
|
|
314
|
+
id: external_exports.string().describe("Unique identifier of the teammate."),
|
|
315
|
+
email: external_exports.string().describe("Email address of the teammate."),
|
|
316
|
+
username: external_exports.string().describe("Username of the teammate."),
|
|
317
|
+
firstName: external_exports.string().describe("First name of the teammate."),
|
|
318
|
+
lastName: external_exports.string().describe("Last name of the teammate."),
|
|
319
|
+
isAdmin: external_exports.boolean().describe("Whether the teammate is a company admin."),
|
|
320
|
+
isAvailable: external_exports.boolean().describe("Whether the teammate is available."),
|
|
321
|
+
isBlocked: external_exports.boolean().describe("Whether the teammate account has been blocked."),
|
|
322
|
+
type: external_exports.string().describe("Type of teammate returned by Front."),
|
|
323
|
+
customFields: external_exports.looseObject({}).describe("Custom fields keyed by the custom field name configured in Front.").optional()
|
|
324
|
+
}).describe("A normalized Front teammate.")).describe("Teammates returned by Front.")
|
|
325
|
+
}).describe("The Front teammates response.");
|
|
326
|
+
var frontActions = {
|
|
327
|
+
list_contacts: {
|
|
328
|
+
description: "List Front company contacts with optional cursor pagination and sorting.",
|
|
329
|
+
effect: "read",
|
|
330
|
+
inputSchema: listContactsInput,
|
|
331
|
+
outputSchema: external_exports.toJSONSchema(listContactsOutput, { io: "output", unrepresentable: "any" })
|
|
332
|
+
},
|
|
333
|
+
get_contact: {
|
|
334
|
+
description: "Fetch one Front contact by contact ID or documented resource alias.",
|
|
335
|
+
effect: "read",
|
|
336
|
+
inputSchema: getContactInput,
|
|
337
|
+
outputSchema: external_exports.toJSONSchema(getContactOutput, { io: "output", unrepresentable: "any" })
|
|
338
|
+
},
|
|
339
|
+
create_contact: {
|
|
340
|
+
description: "Create a Front company contact with JSON fields and one or more reachable handles.",
|
|
341
|
+
effect: "write",
|
|
342
|
+
inputSchema: createContactInput,
|
|
343
|
+
outputSchema: external_exports.toJSONSchema(createContactOutput, { io: "output", unrepresentable: "any" })
|
|
344
|
+
},
|
|
345
|
+
update_contact: {
|
|
346
|
+
description: "Update JSON fields on a Front contact. Avatar uploads are intentionally not exposed.",
|
|
347
|
+
effect: "write",
|
|
348
|
+
inputSchema: updateContactInput,
|
|
349
|
+
outputSchema: external_exports.toJSONSchema(updateContactOutput, { io: "output", unrepresentable: "any" })
|
|
350
|
+
},
|
|
351
|
+
list_teammates: {
|
|
352
|
+
description: "List Front teammates in the company.",
|
|
353
|
+
effect: "read",
|
|
354
|
+
inputSchema: listTeammatesInput,
|
|
355
|
+
outputSchema: external_exports.toJSONSchema(listTeammatesOutput, { io: "output", unrepresentable: "any" })
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
// ../plugins/src/front/index.ts
|
|
360
|
+
function createFrontPlugin() {
|
|
361
|
+
return createProviderPlugin({
|
|
362
|
+
description: "Front",
|
|
363
|
+
actions: frontActions,
|
|
364
|
+
// 上游 credentialValidators 也是打 /teammates 验凭证:只读、无必填入参。
|
|
365
|
+
credentialProbe: "list_teammates",
|
|
366
|
+
handlers: {
|
|
367
|
+
list_contacts: listContacts,
|
|
368
|
+
get_contact: getContact,
|
|
369
|
+
create_contact: createContact,
|
|
370
|
+
update_contact: updateContact,
|
|
371
|
+
list_teammates: listTeammates
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
var front_default = createFrontPlugin();
|
|
376
|
+
export {
|
|
377
|
+
createFrontPlugin,
|
|
378
|
+
front_default as default
|
|
379
|
+
};
|
|
@@ -0,0 +1,236 @@
|
|
|
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/geocodio/api.ts
|
|
15
|
+
var SERVICE = "geocodio";
|
|
16
|
+
var API_BASE = "https://api.geocod.io";
|
|
17
|
+
var API_VERSION = "v1.12";
|
|
18
|
+
function record(value) {
|
|
19
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
20
|
+
}
|
|
21
|
+
function text(value) {
|
|
22
|
+
if (typeof value !== "string") return void 0;
|
|
23
|
+
const trimmed = value.trim();
|
|
24
|
+
return trimmed === "" ? void 0 : trimmed;
|
|
25
|
+
}
|
|
26
|
+
function errorMessage(payload) {
|
|
27
|
+
if (typeof payload === "string") return text(payload);
|
|
28
|
+
const body = record(payload);
|
|
29
|
+
return text(body?.error) ?? text(body?.message);
|
|
30
|
+
}
|
|
31
|
+
async function readPayload(response) {
|
|
32
|
+
const body = await response.text().catch(() => "");
|
|
33
|
+
if (body === "") return null;
|
|
34
|
+
try {
|
|
35
|
+
return JSON.parse(body);
|
|
36
|
+
} catch {
|
|
37
|
+
return body;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
async function request(ctx, path, query, body) {
|
|
41
|
+
const apiKey = requireApiKey(ctx, SERVICE);
|
|
42
|
+
const url = new URL(`/${API_VERSION}${path}`, API_BASE);
|
|
43
|
+
for (const [key, value] of Object.entries(query)) {
|
|
44
|
+
if (value !== void 0) url.searchParams.set(key, String(value));
|
|
45
|
+
}
|
|
46
|
+
url.searchParams.set("api_key", apiKey);
|
|
47
|
+
let response;
|
|
48
|
+
let payload;
|
|
49
|
+
try {
|
|
50
|
+
response = await guardedFetch(url.toString(), body === void 0 ? { method: "GET" } : { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify(body) });
|
|
51
|
+
payload = await readPayload(response);
|
|
52
|
+
} catch (error) {
|
|
53
|
+
throw upstreamError(
|
|
54
|
+
502,
|
|
55
|
+
error instanceof Error ? `Geocodio request failed: ${error.message}` : "Geocodio request failed"
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
if (!response.ok) {
|
|
59
|
+
throw upstreamError(
|
|
60
|
+
// 上游对状态为 0 的响应兜底成 502;这里保持同样的兜底。
|
|
61
|
+
response.status === 0 ? 502 : response.status,
|
|
62
|
+
errorMessage(payload) ?? (response.statusText || "Geocodio request failed")
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
return payload;
|
|
66
|
+
}
|
|
67
|
+
async function singleGeocode(input, ctx) {
|
|
68
|
+
const hasAny = [
|
|
69
|
+
input.q,
|
|
70
|
+
input.street,
|
|
71
|
+
input.street2,
|
|
72
|
+
input.city,
|
|
73
|
+
input.state,
|
|
74
|
+
input.postal_code,
|
|
75
|
+
input.country,
|
|
76
|
+
input.county
|
|
77
|
+
].some((value) => value !== void 0 && value.trim() !== "");
|
|
78
|
+
if (!hasAny) throw new TBError("invalid_argument", "q or at least one address component is required");
|
|
79
|
+
return request(ctx, "/geocode", {
|
|
80
|
+
q: input.q,
|
|
81
|
+
street: input.street,
|
|
82
|
+
street2: input.street2,
|
|
83
|
+
city: input.city,
|
|
84
|
+
state: input.state,
|
|
85
|
+
postal_code: input.postal_code,
|
|
86
|
+
country: input.country,
|
|
87
|
+
county: input.county,
|
|
88
|
+
fields: input.fields,
|
|
89
|
+
limit: input.limit,
|
|
90
|
+
format: input.format
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
async function geocodeBatch(input, ctx) {
|
|
94
|
+
return request(ctx, "/geocode", { fields: input.fields, limit: input.limit }, input.addresses);
|
|
95
|
+
}
|
|
96
|
+
async function singleReverseGeocode(input, ctx) {
|
|
97
|
+
return request(ctx, "/reverse", {
|
|
98
|
+
// 反向查询的坐标拼成一个 `lat,lng` 字符串塞进 q,没有独立的 lat/lng 参数。
|
|
99
|
+
q: `${input.lat},${input.lng}`,
|
|
100
|
+
fields: input.fields,
|
|
101
|
+
limit: input.limit,
|
|
102
|
+
format: input.format
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
async function batchReverseGeocode(input, ctx) {
|
|
106
|
+
return request(ctx, "/reverse", { fields: input.fields, limit: input.limit }, input.coordinates);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// ../plugins/src/geocodio/schema.ts
|
|
110
|
+
var singleGeocodeInput = external_exports.strictObject({
|
|
111
|
+
q: external_exports.string().min(1).describe("The full address string to geocode.").optional(),
|
|
112
|
+
street: external_exports.string().min(1).describe("The street address component.").optional(),
|
|
113
|
+
street2: external_exports.string().min(1).describe("The secondary street address component.").optional(),
|
|
114
|
+
city: external_exports.string().min(1).describe("The city name used for the lookup.").optional(),
|
|
115
|
+
state: external_exports.string().min(1).describe("The state or province code used for the lookup.").optional(),
|
|
116
|
+
postal_code: external_exports.string().min(1).describe("The postal or ZIP code used for the lookup.").optional(),
|
|
117
|
+
country: external_exports.string().min(1).describe("The country context for the lookup.").optional(),
|
|
118
|
+
county: external_exports.string().min(1).describe("The county name used for the lookup.").optional(),
|
|
119
|
+
fields: external_exports.string().min(1).describe("A comma-separated list of Geocodio data append codes.").optional(),
|
|
120
|
+
limit: external_exports.int().min(0).describe("The maximum number of results to return.").optional(),
|
|
121
|
+
format: external_exports.literal("simple").describe("Return Geocodio's simplified single-result response format.").optional()
|
|
122
|
+
}).describe("The input payload for geocoding a single address with Geocodio.");
|
|
123
|
+
var singleGeocodeOutput = external_exports.looseObject({
|
|
124
|
+
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(),
|
|
125
|
+
results: external_exports.array(external_exports.looseObject({
|
|
126
|
+
formatted_address: external_exports.string().describe("The full formatted address.").optional(),
|
|
127
|
+
location: external_exports.looseObject({
|
|
128
|
+
lat: external_exports.number().describe("The latitude coordinate."),
|
|
129
|
+
lng: external_exports.number().describe("The longitude coordinate.")
|
|
130
|
+
}).describe("Latitude and longitude returned by Geocodio.").optional(),
|
|
131
|
+
accuracy: external_exports.number().describe("The match accuracy score from 0.0 to 1.0.").optional(),
|
|
132
|
+
accuracy_type: external_exports.string().describe("The Geocodio accuracy type for the match.").optional(),
|
|
133
|
+
source: external_exports.string().describe("The source dataset for the match.").optional(),
|
|
134
|
+
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(),
|
|
135
|
+
address_lines: external_exports.array(external_exports.string().describe("One formatted address line.")).describe("Formatted address lines.").optional(),
|
|
136
|
+
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()
|
|
137
|
+
}).describe("A single Geocodio geocoding result.")).describe("The ordered geocoding match results.").optional(),
|
|
138
|
+
lat: external_exports.number().describe("The latitude returned by Geocodio simple format.").optional(),
|
|
139
|
+
lng: external_exports.number().describe("The longitude returned by Geocodio simple format.").optional(),
|
|
140
|
+
address: external_exports.string().describe("The address returned by Geocodio simple format.").optional(),
|
|
141
|
+
source: external_exports.string().describe("The source returned by Geocodio simple format.").optional()
|
|
142
|
+
}).describe("The Geocodio response for a single geocode or reverse geocode request.");
|
|
143
|
+
var geocodeBatchInput = external_exports.strictObject({
|
|
144
|
+
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."),
|
|
145
|
+
fields: external_exports.string().min(1).describe("A comma-separated list of Geocodio data append codes.").optional(),
|
|
146
|
+
limit: external_exports.int().min(0).describe("The maximum number of results per address.").optional()
|
|
147
|
+
}).describe("The input payload for batch geocoding addresses with Geocodio.");
|
|
148
|
+
var geocodeBatchOutput = external_exports.strictObject({
|
|
149
|
+
results: external_exports.array(external_exports.looseObject({
|
|
150
|
+
query: external_exports.string().describe("The original query string from the batch request."),
|
|
151
|
+
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.")
|
|
152
|
+
}).describe("One batch geocoding or reverse geocoding result.")).describe("The ordered batch response items.")
|
|
153
|
+
}).describe("The Geocodio response for a batch geocoding request.");
|
|
154
|
+
var singleReverseGeocodeInput = external_exports.strictObject({
|
|
155
|
+
lat: external_exports.number().min(-90).max(90).describe("The latitude to reverse geocode."),
|
|
156
|
+
lng: external_exports.number().min(-180).max(180).describe("The longitude to reverse geocode."),
|
|
157
|
+
fields: external_exports.string().min(1).describe("A comma-separated list of Geocodio data append codes.").optional(),
|
|
158
|
+
limit: external_exports.int().min(0).describe("The maximum number of results to return.").optional(),
|
|
159
|
+
format: external_exports.literal("simple").describe("Return Geocodio's simplified single-result response format.").optional()
|
|
160
|
+
}).describe("The input payload for reverse geocoding a single latitude and longitude pair.");
|
|
161
|
+
var singleReverseGeocodeOutput = external_exports.looseObject({
|
|
162
|
+
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(),
|
|
163
|
+
results: external_exports.array(external_exports.looseObject({
|
|
164
|
+
formatted_address: external_exports.string().describe("The full formatted address.").optional(),
|
|
165
|
+
location: external_exports.looseObject({
|
|
166
|
+
lat: external_exports.number().describe("The latitude coordinate."),
|
|
167
|
+
lng: external_exports.number().describe("The longitude coordinate.")
|
|
168
|
+
}).describe("Latitude and longitude returned by Geocodio.").optional(),
|
|
169
|
+
accuracy: external_exports.number().describe("The match accuracy score from 0.0 to 1.0.").optional(),
|
|
170
|
+
accuracy_type: external_exports.string().describe("The Geocodio accuracy type for the match.").optional(),
|
|
171
|
+
source: external_exports.string().describe("The source dataset for the match.").optional(),
|
|
172
|
+
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(),
|
|
173
|
+
address_lines: external_exports.array(external_exports.string().describe("One formatted address line.")).describe("Formatted address lines.").optional(),
|
|
174
|
+
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()
|
|
175
|
+
}).describe("A single Geocodio geocoding result.")).describe("The ordered geocoding match results.").optional(),
|
|
176
|
+
lat: external_exports.number().describe("The latitude returned by Geocodio simple format.").optional(),
|
|
177
|
+
lng: external_exports.number().describe("The longitude returned by Geocodio simple format.").optional(),
|
|
178
|
+
address: external_exports.string().describe("The address returned by Geocodio simple format.").optional(),
|
|
179
|
+
source: external_exports.string().describe("The source returned by Geocodio simple format.").optional()
|
|
180
|
+
}).describe("The Geocodio response for a single geocode or reverse geocode request.");
|
|
181
|
+
var batchReverseGeocodeInput = external_exports.strictObject({
|
|
182
|
+
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."),
|
|
183
|
+
fields: external_exports.string().min(1).describe("A comma-separated list of Geocodio data append codes.").optional(),
|
|
184
|
+
limit: external_exports.int().min(0).describe("The maximum number of results per coordinate.").optional()
|
|
185
|
+
}).describe("The input payload for batch reverse geocoding coordinate pairs with Geocodio.");
|
|
186
|
+
var batchReverseGeocodeOutput = external_exports.strictObject({
|
|
187
|
+
results: external_exports.array(external_exports.looseObject({
|
|
188
|
+
query: external_exports.string().describe("The original query string from the batch request."),
|
|
189
|
+
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.")
|
|
190
|
+
}).describe("One batch geocoding or reverse geocoding result.")).describe("The ordered batch response items.")
|
|
191
|
+
}).describe("The Geocodio response for a batch geocoding request.");
|
|
192
|
+
var geocodioActions = {
|
|
193
|
+
single_geocode: {
|
|
194
|
+
description: "Geocode a single address and return the official Geocodio response payload.",
|
|
195
|
+
effect: "write",
|
|
196
|
+
inputSchema: singleGeocodeInput,
|
|
197
|
+
outputSchema: external_exports.toJSONSchema(singleGeocodeOutput, { io: "output", unrepresentable: "any" })
|
|
198
|
+
},
|
|
199
|
+
geocode_batch: {
|
|
200
|
+
description: "Geocode multiple addresses in one batch request and return Geocodio batch results.",
|
|
201
|
+
effect: "write",
|
|
202
|
+
inputSchema: geocodeBatchInput,
|
|
203
|
+
outputSchema: external_exports.toJSONSchema(geocodeBatchOutput, { io: "output", unrepresentable: "any" })
|
|
204
|
+
},
|
|
205
|
+
single_reverse_geocode: {
|
|
206
|
+
description: "Reverse geocode a single latitude and longitude pair and return the official Geocodio response payload.",
|
|
207
|
+
effect: "write",
|
|
208
|
+
inputSchema: singleReverseGeocodeInput,
|
|
209
|
+
outputSchema: external_exports.toJSONSchema(singleReverseGeocodeOutput, { io: "output", unrepresentable: "any" })
|
|
210
|
+
},
|
|
211
|
+
batch_reverse_geocode: {
|
|
212
|
+
description: "Reverse geocode multiple coordinate pairs in one batch request and return Geocodio batch results.",
|
|
213
|
+
effect: "write",
|
|
214
|
+
inputSchema: batchReverseGeocodeInput,
|
|
215
|
+
outputSchema: external_exports.toJSONSchema(batchReverseGeocodeOutput, { io: "output", unrepresentable: "any" })
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
// ../plugins/src/geocodio/index.ts
|
|
220
|
+
function createGeocodioPlugin() {
|
|
221
|
+
return createProviderPlugin({
|
|
222
|
+
description: "Geocodio",
|
|
223
|
+
actions: geocodioActions,
|
|
224
|
+
handlers: {
|
|
225
|
+
single_geocode: singleGeocode,
|
|
226
|
+
geocode_batch: geocodeBatch,
|
|
227
|
+
single_reverse_geocode: singleReverseGeocode,
|
|
228
|
+
batch_reverse_geocode: batchReverseGeocode
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
var geocodio_default = createGeocodioPlugin();
|
|
233
|
+
export {
|
|
234
|
+
createGeocodioPlugin,
|
|
235
|
+
geocodio_default as default
|
|
236
|
+
};
|