@tool-bridge/server 0.19.0 → 0.21.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-23JBIM6X.js → airtable-DMJEEGJP.js} +19 -16
- package/dist/{alt_text_generator_ai-ADWBTCIH.js → alt_text_generator_ai-RELFQ5FV.js} +4 -4
- package/dist/{amap-CYQCYW2Z.js → amap-YSYEACKQ.js} +4 -4
- package/dist/{anthropic-5P62HDNR.js → anthropic-D5X5GSYE.js} +23 -25
- package/dist/{apify-54RZUAGW.js → apify-5NVFU3IZ.js} +20 -19
- package/dist/{brave_search-AHJ6FTD5.js → brave_search-X557FMGO.js} +16 -14
- package/dist/chunk-JEWFX6Z6.js +71 -0
- package/dist/{chunk-CLEZ6YQ6.js → chunk-MDY7K5CX.js} +1090 -606
- package/dist/{chunk-OKRZPQ3R.js → chunk-MZCIPUNQ.js} +1002 -242
- package/dist/{chunk-VLOIDU5U.js → chunk-Q74GLIDK.js} +3 -3
- package/dist/{chunk-B4P6YZFS.js → chunk-QR4LK3HF.js} +1 -1
- package/dist/{chunk-SWBNHIO4.js → chunk-ZTTN6AJG.js} +1 -1
- package/dist/{circleci-UM3NSQJ3.js → circleci-3P3QTUX2.js} +20 -24
- package/dist/{clerk-FE5LQ2CZ.js → clerk-GNMZQ2MY.js} +22 -21
- package/dist/{cloudflare_dns-KEZABKUT.js → cloudflare_dns-VWZH3ZTR.js} +21 -17
- package/dist/{cohere-4IPJADXP.js → cohere-C7QVIIMG.js} +19 -17
- package/dist/{confluence-56QEKNQI.js → confluence-52I37IUT.js} +16 -11
- package/dist/{convertapi-3QRM5K5T.js → convertapi-3TRJ3WEO.js} +3 -3
- package/dist/{currencyapi-L6G4OND5.js → currencyapi-LWEANWVI.js} +23 -26
- package/dist/{deepseek-LGC6HBFG.js → deepseek-5U24YG4P.js} +27 -17
- package/dist/{docker_hub-XDMK3BIU.js → docker_hub-CMISLRSE.js} +4 -4
- package/dist/{dropbox-4QARMFZU.js → dropbox-TW4QN6FT.js} +9 -8
- package/dist/{dub-C6JSJKOT.js → dub-EFXGI5UH.js} +22 -19
- package/dist/{e2b-6A6TVACJ.js → e2b-PHM63OVF.js} +20 -20
- package/dist/{exa-SIWWW6AA.js → exa-DYOQWURR.js} +22 -25
- package/dist/{fal_ai-3IJXOKSP.js → fal_ai-VJPMCNRH.js} +18 -17
- package/dist/{feishu-L4KDA4DC.js → feishu-TFIZXPIN.js} +2 -2
- package/dist/{feishu_custom_bot-SDM75H4P.js → feishu_custom_bot-ADSE23KU.js} +3 -3
- package/dist/{figma-6DD436DN.js → figma-4AK47AYY.js} +21 -23
- package/dist/{firehydrant-SYSGYB3R.js → firehydrant-RGPTW4EA.js} +15 -15
- package/dist/{fixer-FZG7ASTF.js → fixer-OAMF4DKP.js} +4 -4
- package/dist/{fly-HMRCZBUC.js → fly-YB4AQD4O.js} +20 -16
- package/dist/{front-FAFSD7I3.js → front-6GTVYKUM.js} +20 -23
- package/dist/{geocodio-4D3TWENM.js → geocodio-YRT4K25M.js} +4 -4
- package/dist/{ghost-OSO2FOZS.js → ghost-JCW6UIP2.js} +4 -4
- package/dist/{github-OR4I4RHE.js → github-CEGVRMNX.js} +28 -27
- package/dist/{gmail-5AOPJ63E.js → gmail-JCMJD55P.js} +17 -17
- package/dist/{googlecalendar-SOJIJUWH.js → googlecalendar-2EAW4MNM.js} +16 -14
- package/dist/{googledocs-QSKN5TLN.js → googledocs-YNKKBM6Q.js} +3 -3
- package/dist/{grafana-R3AIZM7M.js → grafana-353VSGXN.js} +24 -25
- package/dist/{graphhopper-4CR3QOAX.js → graphhopper-H3IVJNDS.js} +4 -4
- package/dist/index.d.ts +52 -36
- package/dist/index.js +3 -3
- package/dist/{ip2proxy-OBCG6X6J.js → ip2proxy-DBGRWH7S.js} +4 -4
- package/dist/{ipgeolocation_io-NHH3DTQW.js → ipgeolocation_io-5I2BDVMG.js} +4 -4
- package/dist/{ipqualityscore-7POMCBEC.js → ipqualityscore-ILV7TQCV.js} +4 -4
- package/dist/{jina_ai-YXVKROV4.js → jina_ai-L5BH455V.js} +20 -21
- package/dist/{jira-LADO3VJU.js → jira-IGTILUZA.js} +20 -16
- package/dist/{langsmith-XZ6UAQFU.js → langsmith-BYRX4AOF.js} +25 -25
- package/dist/{lemlist-P74GLNE7.js → lemlist-ZGNYTIQO.js} +23 -24
- package/dist/{linear-CXJ7D37A.js → linear-HLGOWISN.js} +3 -3
- package/dist/{logsnag-EVVHWFLK.js → logsnag-5RGTMTU2.js} +20 -22
- package/dist/main.js +102 -102
- package/dist/{mattermost-WG2MRGBD.js → mattermost-BONGXVC7.js} +21 -17
- package/dist/{mem0-HQWUKG6U.js → mem0-RUVNUPTE.js} +15 -15
- package/dist/{memos-SQMJIFOE.js → memos-TED4HI54.js} +36 -32
- package/dist/{metabase-E27G2DZI.js → metabase-ZHXHRHZK.js} +22 -18
- package/dist/{mistral_ai-MIL63NIT.js → mistral_ai-NGP5SHU7.js} +24 -21
- package/dist/{mother_duck-AIZVCBNR.js → mother_duck-TKVQM35M.js} +23 -19
- package/dist/{ngrok-XS4DVIQS.js → ngrok-BYCUJ7QV.js} +17 -22
- package/dist/{notes-JEOUSL2Y.js → notes-KXRNNYDW.js} +1 -1
- package/dist/{notion-U4EZVDW2.js → notion-2ILYKJOO.js} +20 -17
- package/dist/{open_exchange_rates-AZSQEYEJ.js → open_exchange_rates-JU4DC6HZ.js} +4 -4
- package/dist/{openai-HW3SYMTQ.js → openai-6SOT26ZK.js} +22 -16
- package/dist/{opengraph_io-QX74MAEL.js → opengraph_io-ZEFHV2OL.js} +4 -4
- package/dist/{openrouter-OXSKYL6N.js → openrouter-R4P7JL5L.js} +19 -14
- package/dist/{outline-CCQAPDSW.js → outline-VCTQ5V2X.js} +18 -20
- package/dist/{paddle-6KQPSSCK.js → paddle-AZOAKBJS.js} +17 -15
- package/dist/{perplexity-2TXO7IQE.js → perplexity-OMRLGVAT.js} +19 -23
- package/dist/{pinecone-YOO7NULI.js → pinecone-DI62W3ZX.js} +19 -24
- package/dist/{pipedrive-Q6RIFIFP.js → pipedrive-CW7HONYW.js} +22 -23
- package/dist/{polar-KUMGCES3.js → polar-5DRGTXNR.js} +19 -17
- package/dist/{posthog-VXQHBSMB.js → posthog-3DTHFCKE.js} +29 -24
- package/dist/{postmark-YLIPF52S.js → postmark-ME2V2XXI.js} +19 -17
- package/dist/{prerender-CRY7UJN5.js → prerender-5EAY7GDM.js} +4 -4
- package/dist/{pubmed-3Z4T5AM7.js → pubmed-GRQUBGVA.js} +3 -3
- package/dist/{railway-BP37IGFL.js → railway-FTM75TMX.js} +3 -3
- package/dist/{readwise-HTKICF4K.js → readwise-IJQGV6IQ.js} +16 -15
- package/dist/{render-WIVTUXJH.js → render-TMSPHRTY.js} +21 -20
- package/dist/{replicate-JJYPA43D.js → replicate-RJCMDB7H.js} +20 -21
- package/dist/{resend-TKHZVG7A.js → resend-YYN22NIL.js} +15 -11
- package/dist/{rootly-FRSZLG5U.js → rootly-7RXE4K7L.js} +19 -18
- package/dist/{scrapfly-M5WXGQWE.js → scrapfly-ZJJ6XM4Q.js} +4 -4
- package/dist/{scrapingbee-PMXNLLBK.js → scrapingbee-QNGEOD6D.js} +4 -4
- package/dist/{screenshot_fyi-HFW4TAOH.js → screenshot_fyi-SPZAABVD.js} +4 -4
- package/dist/{semantic_scholar-KXVH2VZQ.js → semantic_scholar-SDPVGDDI.js} +21 -20
- package/dist/{sentry-WWOT2LRX.js → sentry-SJ5NN4C4.js} +22 -19
- package/dist/{shodan-FY635H35.js → shodan-YMGOY7KW.js} +4 -4
- package/dist/{shopify-HQLBVSA5.js → shopify-SU5ABP54.js} +23 -19
- package/dist/{stripe-GJN2GOHB.js → stripe-JAC425KE.js} +3 -3
- package/dist/{supabase-BBNZGQU6.js → supabase-GQ2OFVIL.js} +18 -17
- package/dist/{tavily-DPENIBOG.js → tavily-Y7MDA5CI.js} +20 -20
- package/dist/{telegram-L4NONG6H.js → telegram-OIDT3ZLH.js} +4 -4
- package/dist/{telnyx-H67MAEZS.js → telnyx-4JGMC3K7.js} +19 -19
- package/dist/{todoist-G2BSP4DX.js → todoist-O7S2OUGX.js} +18 -17
- package/dist/{trello-7WMVFDG2.js → trello-3LDE4TAQ.js} +4 -4
- package/dist/{turso-ZUAESFC2.js → turso-MUQ44KCA.js} +23 -30
- package/dist/{twilio-EYFYIX3B.js → twilio-VYF3HUU6.js} +3 -3
- package/dist/{umami-AXAUDUVF.js → umami-SVQIK26J.js} +23 -28
- package/dist/{unsplash-UCQAWPLR.js → unsplash-333XYDCJ.js} +19 -18
- package/dist/{upstash_redis-ZPZ4ASU6.js → upstash_redis-IUM2HDLU.js} +17 -13
- package/dist/{uptimerobot-4QVKKUD5.js → uptimerobot-7ZRU2NJV.js} +3 -3
- package/dist/{v2ex-VGEFJTYC.js → v2ex-AVSJCQPS.js} +35 -18
- package/dist/{vercel-JME4TSCN.js → vercel-J7RGXNSA.js} +21 -18
- package/dist/{wolfram_alpha_api-TRGU2MDG.js → wolfram_alpha_api-6CRVUZOJ.js} +4 -4
- package/dist/{wordpress-WRUKLCZR.js → wordpress-THOJLPKA.js} +21 -17
- package/dist/{workos-ZDW4EHS4.js → workos-ENTGRWF2.js} +26 -27
- package/dist/{zhihu-4VI67CWU.js → zhihu-W2BXICTX.js} +21 -21
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createProviderHttpClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q74GLIDK.js";
|
|
4
4
|
import {
|
|
5
5
|
asJsonObject,
|
|
6
6
|
compactDefined
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
createProviderPlugin,
|
|
10
10
|
requireApiKey,
|
|
11
11
|
upstreamError
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-QR4LK3HF.js";
|
|
13
|
+
import "./chunk-ZTTN6AJG.js";
|
|
14
14
|
import {
|
|
15
15
|
external_exports
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-MZCIPUNQ.js";
|
|
17
17
|
import "./chunk-U67V476Y.js";
|
|
18
18
|
|
|
19
19
|
// ../plugins/src/scrapingbee/api.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createProviderHttpClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q74GLIDK.js";
|
|
4
4
|
import {
|
|
5
5
|
trimmedText
|
|
6
6
|
} from "./chunk-JXHMDBAY.js";
|
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
createProviderPlugin,
|
|
9
9
|
requireApiKey,
|
|
10
10
|
upstreamError
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-QR4LK3HF.js";
|
|
12
|
+
import "./chunk-ZTTN6AJG.js";
|
|
13
13
|
import {
|
|
14
14
|
external_exports
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-MZCIPUNQ.js";
|
|
16
16
|
import "./chunk-U67V476Y.js";
|
|
17
17
|
|
|
18
18
|
// ../plugins/src/screenshot_fyi/schema.ts
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
createAuthedClient
|
|
3
|
+
} from "./chunk-JEWFX6Z6.js";
|
|
4
|
+
import "./chunk-Q74GLIDK.js";
|
|
4
5
|
import {
|
|
5
6
|
asJsonObject
|
|
6
7
|
} from "./chunk-JXHMDBAY.js";
|
|
7
8
|
import {
|
|
8
9
|
createProviderPlugin,
|
|
9
|
-
requireApiKey,
|
|
10
10
|
upstreamError
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-QR4LK3HF.js";
|
|
12
|
+
import "./chunk-ZTTN6AJG.js";
|
|
13
13
|
import {
|
|
14
14
|
TBError,
|
|
15
15
|
external_exports
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-MZCIPUNQ.js";
|
|
17
17
|
import "./chunk-U67V476Y.js";
|
|
18
18
|
|
|
19
19
|
// ../plugins/src/semantic_scholar/api.ts
|
|
@@ -21,11 +21,6 @@ var SERVICE = "semantic_scholar";
|
|
|
21
21
|
var GRAPH_BASE = "https://api.semanticscholar.org/graph/v1";
|
|
22
22
|
var RECOMMENDATIONS_BASE = "https://api.semanticscholar.org/recommendations/v1";
|
|
23
23
|
var REQUEST_TIMEOUT_MS = 3e4;
|
|
24
|
-
var graphHttp = createProviderHttpClient({ baseUrl: `${GRAPH_BASE}/`, service: SERVICE });
|
|
25
|
-
var recommendationsHttp = createProviderHttpClient({
|
|
26
|
-
baseUrl: `${RECOMMENDATIONS_BASE}/`,
|
|
27
|
-
service: SERVICE
|
|
28
|
-
});
|
|
29
24
|
function trimmed(value) {
|
|
30
25
|
if (typeof value !== "string") return void 0;
|
|
31
26
|
const result = value.trim();
|
|
@@ -82,23 +77,29 @@ function errorMessage(payload, status) {
|
|
|
82
77
|
const body = asJsonObject(payload);
|
|
83
78
|
return trimmed(body?.message) ?? trimmed(body?.error) ?? trimmed(body?.detail) ?? `Semantic Scholar \u8FD4\u56DE HTTP ${status}`;
|
|
84
79
|
}
|
|
80
|
+
function s2Client(baseUrl) {
|
|
81
|
+
return createAuthedClient({
|
|
82
|
+
baseUrl,
|
|
83
|
+
service: SERVICE,
|
|
84
|
+
auth: { kind: "header", name: "x-api-key" },
|
|
85
|
+
headers: { accept: "application/json" },
|
|
86
|
+
// invalid-json 与常规错误体走不同分支,标准键序提取表达不了,整段覆写。
|
|
87
|
+
mapError: ({ bodyKind, data, status }) => bodyKind === "invalid-json" ? new TBError("unavailable", "Semantic Scholar \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94", { retryable: true }) : upstreamError(status, errorMessage(data, status)),
|
|
88
|
+
mapTransportError: ({ kind, message }) => kind === "timeout" ? upstreamError(504, `Semantic Scholar \u8BF7\u6C42\u8D85\u65F6(${REQUEST_TIMEOUT_MS / 1e3} \u79D2)`) : upstreamError(502, `Semantic Scholar \u8BF7\u6C42\u5931\u8D25:${message ?? "unknown network error"}`)
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
var graphHttp = s2Client(`${GRAPH_BASE}/`);
|
|
92
|
+
var recommendationsHttp = s2Client(`${RECOMMENDATIONS_BASE}/`);
|
|
85
93
|
async function request(ctx, input) {
|
|
86
|
-
const headers = {
|
|
87
|
-
"accept": "application/json",
|
|
88
|
-
"x-api-key": requireApiKey(ctx, SERVICE)
|
|
89
|
-
};
|
|
90
94
|
const http = input.family === "graph" ? graphHttp : recommendationsHttp;
|
|
91
|
-
const response = await http.request({
|
|
95
|
+
const response = await http.request(ctx, {
|
|
92
96
|
method: input.method,
|
|
93
97
|
path: input.path,
|
|
94
98
|
query: Object.entries(input.params ?? {}),
|
|
95
|
-
headers,
|
|
96
99
|
// 上游对 POST 一律发 body(没给就发 `{}`),保留:batch 端点不接受空请求。
|
|
97
100
|
...input.method === "POST" ? { json: input.body ?? {} } : {},
|
|
98
101
|
timeoutMs: REQUEST_TIMEOUT_MS,
|
|
99
|
-
invalidJsonMessage: "Semantic Scholar \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94"
|
|
100
|
-
mapError: ({ bodyKind, data, status }) => bodyKind === "invalid-json" ? new TBError("unavailable", "Semantic Scholar \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94", { retryable: true }) : upstreamError(status, errorMessage(data, status)),
|
|
101
|
-
mapTransportError: ({ kind, message }) => kind === "timeout" ? upstreamError(504, `Semantic Scholar \u8BF7\u6C42\u8D85\u65F6(${REQUEST_TIMEOUT_MS / 1e3} \u79D2)`) : upstreamError(502, `Semantic Scholar \u8BF7\u6C42\u5931\u8D25:${message ?? "unknown network error"}`)
|
|
102
|
+
invalidJsonMessage: "Semantic Scholar \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94"
|
|
102
103
|
});
|
|
103
104
|
return response.bodyKind === "empty" ? null : response.data;
|
|
104
105
|
}
|
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
createAuthedClient
|
|
3
|
+
} from "./chunk-JEWFX6Z6.js";
|
|
4
|
+
import "./chunk-Q74GLIDK.js";
|
|
4
5
|
import {
|
|
5
6
|
asJsonObject,
|
|
6
7
|
compactDefined
|
|
7
8
|
} from "./chunk-JXHMDBAY.js";
|
|
8
9
|
import {
|
|
9
10
|
createProviderPlugin,
|
|
10
|
-
requireApiKey,
|
|
11
11
|
upstreamError
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-QR4LK3HF.js";
|
|
13
|
+
import "./chunk-ZTTN6AJG.js";
|
|
14
14
|
import {
|
|
15
15
|
TBError,
|
|
16
16
|
external_exports
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-MZCIPUNQ.js";
|
|
18
18
|
import "./chunk-U67V476Y.js";
|
|
19
19
|
|
|
20
20
|
// ../plugins/src/sentry/api.ts
|
|
21
21
|
var SERVICE = "sentry";
|
|
22
22
|
var API_BASE = "https://sentry.io/api/0/";
|
|
23
|
-
var http = createProviderHttpClient({ baseUrl: API_BASE, service: SERVICE });
|
|
24
23
|
function str(value) {
|
|
25
24
|
return typeof value === "string" ? value : void 0;
|
|
26
25
|
}
|
|
@@ -77,26 +76,30 @@ function errorMessage(payload, status) {
|
|
|
77
76
|
const nested = str(asJsonObject(body?.detail)?.message);
|
|
78
77
|
return pickStr(body?.error_description, body?.detail, body?.error, body?.message) ?? (nonEmpty(nested) ? nested : void 0) ?? `Sentry \u8FD4\u56DE HTTP ${status}`;
|
|
79
78
|
}
|
|
79
|
+
var http = createAuthedClient({
|
|
80
|
+
baseUrl: API_BASE,
|
|
81
|
+
service: SERVICE,
|
|
82
|
+
auth: { kind: "bearer" },
|
|
83
|
+
headers: { accept: "application/json" },
|
|
84
|
+
mapError: ({ bodyKind, data, headers, status }) => {
|
|
85
|
+
const payload = headers.get("content-type")?.includes("application/json") === true && bodyKind === "json" ? data : null;
|
|
86
|
+
return upstreamError(status, errorMessage(payload, status));
|
|
87
|
+
},
|
|
88
|
+
mapTransportError: ({ message }) => upstreamError(
|
|
89
|
+
502,
|
|
90
|
+
`Sentry \u8BF7\u6C42\u5931\u8D25:${message ?? "\u672A\u77E5\u9519\u8BEF"}`
|
|
91
|
+
)
|
|
92
|
+
});
|
|
80
93
|
async function request(ctx, path, options = {}) {
|
|
81
|
-
const
|
|
82
|
-
const result = await http.request({
|
|
94
|
+
const result = await http.request(ctx, {
|
|
83
95
|
// path 不带前导斜杠 —— 见文件头注释,否则 /api/0 前缀会被整段吃掉。
|
|
84
96
|
path,
|
|
85
97
|
method: options.method ?? "GET",
|
|
86
98
|
// 多值过滤器(environment / project / field …)展开成重复的同名参数。
|
|
87
99
|
query: Object.entries(options.query ?? {}),
|
|
88
|
-
headers: { accept: "application/json", authorization: `Bearer ${token}` },
|
|
89
100
|
...options.body === void 0 ? {} : { json: options.body },
|
|
90
101
|
invalidJson: "text",
|
|
91
|
-
responseType: "auto"
|
|
92
|
-
mapError: ({ bodyKind, data, headers, status }) => {
|
|
93
|
-
const payload2 = headers.get("content-type")?.includes("application/json") === true && bodyKind === "json" ? data : null;
|
|
94
|
-
return upstreamError(status, errorMessage(payload2, status));
|
|
95
|
-
},
|
|
96
|
-
mapTransportError: ({ message }) => upstreamError(
|
|
97
|
-
502,
|
|
98
|
-
`Sentry \u8BF7\u6C42\u5931\u8D25:${message ?? "\u672A\u77E5\u9519\u8BEF"}`
|
|
99
|
-
)
|
|
102
|
+
responseType: "auto"
|
|
100
103
|
});
|
|
101
104
|
const payload = result.headers.get("content-type")?.includes("application/json") === true && result.bodyKind === "json" ? result.data : null;
|
|
102
105
|
return { payload, headers: result.headers };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createProviderHttpClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q74GLIDK.js";
|
|
4
4
|
import {
|
|
5
5
|
asJsonObject,
|
|
6
6
|
booleanValue,
|
|
@@ -10,12 +10,12 @@ import {
|
|
|
10
10
|
createProviderPlugin,
|
|
11
11
|
requireApiKey,
|
|
12
12
|
upstreamError
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-QR4LK3HF.js";
|
|
14
|
+
import "./chunk-ZTTN6AJG.js";
|
|
15
15
|
import {
|
|
16
16
|
TBError,
|
|
17
17
|
external_exports
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-MZCIPUNQ.js";
|
|
19
19
|
import "./chunk-U67V476Y.js";
|
|
20
20
|
|
|
21
21
|
// ../plugins/src/shodan/api.ts
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
createAuthedClient
|
|
3
|
+
} from "./chunk-JEWFX6Z6.js";
|
|
4
|
+
import "./chunk-Q74GLIDK.js";
|
|
4
5
|
import {
|
|
5
6
|
asJsonObject,
|
|
6
7
|
trimmedText
|
|
@@ -9,19 +10,18 @@ import {
|
|
|
9
10
|
createProviderPlugin,
|
|
10
11
|
requireCredential,
|
|
11
12
|
upstreamError
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-QR4LK3HF.js";
|
|
14
|
+
import "./chunk-ZTTN6AJG.js";
|
|
14
15
|
import {
|
|
15
16
|
TBError,
|
|
16
17
|
external_exports
|
|
17
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-MZCIPUNQ.js";
|
|
18
19
|
import "./chunk-U67V476Y.js";
|
|
19
20
|
|
|
20
21
|
// ../plugins/src/shopify/api.ts
|
|
21
22
|
var SERVICE = "shopify";
|
|
22
23
|
var REST_API_VERSION = "2026-04";
|
|
23
24
|
var MYSHOPIFY_SUFFIX = ".myshopify.com";
|
|
24
|
-
var http = createProviderHttpClient({ service: SERVICE });
|
|
25
25
|
function requireRecord(value, label) {
|
|
26
26
|
const result = asJsonObject(value);
|
|
27
27
|
if (result === void 0) throw new TBError("unavailable", `Shopify \u54CD\u5E94\u7F3A\u5C11 ${label}`, { retryable: true });
|
|
@@ -102,23 +102,27 @@ function pageInfoForRel(linkHeader, rel) {
|
|
|
102
102
|
}
|
|
103
103
|
return null;
|
|
104
104
|
}
|
|
105
|
+
var http = createAuthedClient({
|
|
106
|
+
service: SERVICE,
|
|
107
|
+
auth: {
|
|
108
|
+
kind: "custom",
|
|
109
|
+
headers: (ctx) => ({ "x-shopify-access-token": requireCredential(ctx, SERVICE, "apiKey") })
|
|
110
|
+
},
|
|
111
|
+
headers: { accept: "application/json" },
|
|
112
|
+
mapError: ({ data, status }) => {
|
|
113
|
+
const detail = errorDetail(data);
|
|
114
|
+
return upstreamError(
|
|
115
|
+
status,
|
|
116
|
+
detail === void 0 ? `Shopify REST \u8FD4\u56DE HTTP ${status}` : `Shopify REST \u8FD4\u56DE HTTP ${status}: ${detail}`
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
105
120
|
async function request(ctx, path, query) {
|
|
106
|
-
const result = await http.request({
|
|
121
|
+
const result = await http.request(ctx, {
|
|
107
122
|
baseUrl: `https://${shopHost(ctx)}/admin/api/${REST_API_VERSION}/`,
|
|
108
123
|
path,
|
|
109
124
|
query: Object.entries(query ?? {}),
|
|
110
|
-
|
|
111
|
-
"accept": "application/json",
|
|
112
|
-
"x-shopify-access-token": requireCredential(ctx, SERVICE, "apiKey")
|
|
113
|
-
},
|
|
114
|
-
invalidJsonMessage: "Shopify REST \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94",
|
|
115
|
-
mapError: ({ data, status }) => {
|
|
116
|
-
const detail = errorDetail(data);
|
|
117
|
-
return upstreamError(
|
|
118
|
-
status,
|
|
119
|
-
detail === void 0 ? `Shopify REST \u8FD4\u56DE HTTP ${status}` : `Shopify REST \u8FD4\u56DE HTTP ${status}: ${detail}`
|
|
120
|
-
);
|
|
121
|
-
}
|
|
125
|
+
invalidJsonMessage: "Shopify REST \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94"
|
|
122
126
|
});
|
|
123
127
|
return {
|
|
124
128
|
payload: result.data === void 0 ? null : result.data,
|
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
createProviderPlugin,
|
|
3
3
|
requireApiKey,
|
|
4
4
|
upstreamError
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-QR4LK3HF.js";
|
|
6
6
|
import {
|
|
7
7
|
guardedFetch
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ZTTN6AJG.js";
|
|
9
9
|
import {
|
|
10
10
|
TBError,
|
|
11
11
|
external_exports
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-MZCIPUNQ.js";
|
|
13
13
|
import "./chunk-U67V476Y.js";
|
|
14
14
|
|
|
15
15
|
// ../plugins/src/stripe/api.ts
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
createAuthedClient
|
|
3
|
+
} from "./chunk-JEWFX6Z6.js";
|
|
4
|
+
import "./chunk-Q74GLIDK.js";
|
|
4
5
|
import {
|
|
5
6
|
asJsonObject,
|
|
6
7
|
compactDefined,
|
|
@@ -8,20 +9,18 @@ import {
|
|
|
8
9
|
} from "./chunk-JXHMDBAY.js";
|
|
9
10
|
import {
|
|
10
11
|
createProviderPlugin,
|
|
11
|
-
requireApiKey,
|
|
12
12
|
upstreamError
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-QR4LK3HF.js";
|
|
14
|
+
import "./chunk-ZTTN6AJG.js";
|
|
15
15
|
import {
|
|
16
16
|
TBError,
|
|
17
17
|
external_exports
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-MZCIPUNQ.js";
|
|
19
19
|
import "./chunk-U67V476Y.js";
|
|
20
20
|
|
|
21
21
|
// ../plugins/src/supabase/api.ts
|
|
22
22
|
var SERVICE = "supabase";
|
|
23
23
|
var API_BASE = "https://api.supabase.com/v1";
|
|
24
|
-
var http = createProviderHttpClient({ baseUrl: `${API_BASE}/`, service: SERVICE });
|
|
25
24
|
var PROJECT_STATUSES = /* @__PURE__ */ new Set([
|
|
26
25
|
"ACTIVE_HEALTHY",
|
|
27
26
|
"ACTIVE_UNHEALTHY",
|
|
@@ -84,23 +83,25 @@ function errorMessage(status, payload) {
|
|
|
84
83
|
if (code === "invalid_grant") return "supabase grant is invalid or expired";
|
|
85
84
|
return trimmedText(detail.message) ?? trimmedText(detail.msg) ?? trimmedText(detail.error_description) ?? `supabase request failed with ${status}`;
|
|
86
85
|
}
|
|
86
|
+
var http = createAuthedClient({
|
|
87
|
+
baseUrl: `${API_BASE}/`,
|
|
88
|
+
service: SERVICE,
|
|
89
|
+
auth: { kind: "bearer" },
|
|
90
|
+
headers: { accept: "application/json" },
|
|
91
|
+
mapError: ({ data: payload, status }) => upstreamError(
|
|
92
|
+
status,
|
|
93
|
+
errorMessage(status, typeof payload === "string" ? { message: payload } : payload)
|
|
94
|
+
)
|
|
95
|
+
});
|
|
87
96
|
async function request(ctx, input) {
|
|
88
97
|
const hasBody = input.body !== void 0;
|
|
89
|
-
const { data } = await http.request({
|
|
98
|
+
const { data } = await http.request(ctx, {
|
|
90
99
|
path: input.path,
|
|
91
100
|
method: input.method ?? "GET",
|
|
92
101
|
// health 的 services 靠**重复同名参数**表达;statuses 那种逗号串在调用处就拼好了。
|
|
93
102
|
query: Object.entries(input.query ?? {}),
|
|
94
|
-
headers: {
|
|
95
|
-
accept: "application/json",
|
|
96
|
-
authorization: `Bearer ${requireApiKey(ctx, SERVICE)}`
|
|
97
|
-
},
|
|
98
103
|
...hasBody ? { json: input.body } : {},
|
|
99
|
-
invalidJsonMessage: "malformed supabase response: malformed supabase json response"
|
|
100
|
-
mapError: ({ data: payload2, status }) => upstreamError(
|
|
101
|
-
status,
|
|
102
|
-
errorMessage(status, typeof payload2 === "string" ? { message: payload2 } : payload2)
|
|
103
|
-
)
|
|
104
|
+
invalidJsonMessage: "malformed supabase response: malformed supabase json response"
|
|
104
105
|
});
|
|
105
106
|
const payload = data ?? null;
|
|
106
107
|
if (payload === null && input.allowEmpty !== true) throw malformed("empty body");
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
createAuthedClient
|
|
3
|
+
} from "./chunk-JEWFX6Z6.js";
|
|
4
|
+
import "./chunk-Q74GLIDK.js";
|
|
4
5
|
import {
|
|
5
|
-
asJsonObject
|
|
6
|
-
messageFrom
|
|
6
|
+
asJsonObject
|
|
7
7
|
} from "./chunk-JXHMDBAY.js";
|
|
8
8
|
import {
|
|
9
9
|
createProviderPlugin,
|
|
10
|
-
requireApiKey,
|
|
11
10
|
upstreamError
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-QR4LK3HF.js";
|
|
12
|
+
import "./chunk-ZTTN6AJG.js";
|
|
14
13
|
import {
|
|
15
14
|
external_exports
|
|
16
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-MZCIPUNQ.js";
|
|
17
16
|
import "./chunk-U67V476Y.js";
|
|
18
17
|
|
|
19
18
|
// ../plugins/src/tavily/api.ts
|
|
20
19
|
var SERVICE = "tavily";
|
|
21
20
|
var REQUEST_TIMEOUT_MS = 3e4;
|
|
22
|
-
var http =
|
|
21
|
+
var http = createAuthedClient({
|
|
22
|
+
baseUrl: "https://api.tavily.com/",
|
|
23
|
+
service: SERVICE,
|
|
24
|
+
auth: { kind: "bearer" },
|
|
25
|
+
headers: { accept: "application/json" },
|
|
26
|
+
errorMessage: {
|
|
27
|
+
keys: ["detail", "error", "message"],
|
|
28
|
+
fallback: (status) => `Tavily \u8FD4\u56DE HTTP ${status}`
|
|
29
|
+
},
|
|
30
|
+
mapTransportError: ({ kind, message }) => kind === "timeout" ? upstreamError(504, `Tavily ${REQUEST_TIMEOUT_MS / 1e3}s \u5185\u6CA1\u6709\u8FD4\u56DE`) : upstreamError(502, message === void 0 ? "Tavily \u8BF7\u6C42\u5931\u8D25" : `Tavily \u8BF7\u6C42\u5931\u8D25:${message}`)
|
|
31
|
+
});
|
|
23
32
|
async function request(ctx, options) {
|
|
24
|
-
const { data } = await http.request({
|
|
33
|
+
const { data } = await http.request(ctx, {
|
|
25
34
|
path: options.path,
|
|
26
35
|
method: options.method,
|
|
27
|
-
headers: {
|
|
28
|
-
accept: "application/json",
|
|
29
|
-
authorization: `Bearer ${requireApiKey(ctx, SERVICE)}`
|
|
30
|
-
},
|
|
31
36
|
...options.body === void 0 ? {} : { json: options.body },
|
|
32
37
|
timeoutMs: REQUEST_TIMEOUT_MS,
|
|
33
|
-
invalidJsonMessage: "Tavily \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94"
|
|
34
|
-
mapError: ({ data: payload, status }) => upstreamError(
|
|
35
|
-
status,
|
|
36
|
-
messageFrom(payload, ["detail", "error", "message"], `Tavily \u8FD4\u56DE HTTP ${status}`)
|
|
37
|
-
),
|
|
38
|
-
mapTransportError: ({ kind, message }) => kind === "timeout" ? upstreamError(504, `Tavily ${REQUEST_TIMEOUT_MS / 1e3}s \u5185\u6CA1\u6709\u8FD4\u56DE`) : upstreamError(502, message === void 0 ? "Tavily \u8BF7\u6C42\u5931\u8D25" : `Tavily \u8BF7\u6C42\u5931\u8D25:${message}`)
|
|
38
|
+
invalidJsonMessage: "Tavily \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94"
|
|
39
39
|
});
|
|
40
40
|
if (data === void 0) return {};
|
|
41
41
|
const result = asJsonObject(data);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createProviderHttpClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q74GLIDK.js";
|
|
4
4
|
import {
|
|
5
5
|
asJsonObject,
|
|
6
6
|
booleanValue,
|
|
@@ -12,14 +12,14 @@ import {
|
|
|
12
12
|
createProviderPlugin,
|
|
13
13
|
requireApiKey,
|
|
14
14
|
upstreamError
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-QR4LK3HF.js";
|
|
16
16
|
import {
|
|
17
17
|
assertPublicHttpUrl
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-ZTTN6AJG.js";
|
|
19
19
|
import {
|
|
20
20
|
TBError,
|
|
21
21
|
external_exports
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-MZCIPUNQ.js";
|
|
23
23
|
import "./chunk-U67V476Y.js";
|
|
24
24
|
|
|
25
25
|
// ../plugins/src/telegram/api.ts
|
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
createAuthedClient
|
|
3
|
+
} from "./chunk-JEWFX6Z6.js";
|
|
4
|
+
import "./chunk-Q74GLIDK.js";
|
|
4
5
|
import {
|
|
5
6
|
asJsonObject,
|
|
6
7
|
trimmedText
|
|
7
8
|
} from "./chunk-JXHMDBAY.js";
|
|
8
9
|
import {
|
|
9
10
|
createProviderPlugin,
|
|
10
|
-
requireApiKey,
|
|
11
11
|
upstreamError
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-QR4LK3HF.js";
|
|
13
|
+
import "./chunk-ZTTN6AJG.js";
|
|
14
14
|
import {
|
|
15
15
|
TBError,
|
|
16
16
|
external_exports
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-MZCIPUNQ.js";
|
|
18
18
|
import "./chunk-U67V476Y.js";
|
|
19
19
|
|
|
20
20
|
// ../plugins/src/telnyx/api.ts
|
|
21
21
|
var SERVICE = "telnyx";
|
|
22
22
|
var API_BASE = "https://api.telnyx.com/v2";
|
|
23
|
-
var http = createProviderHttpClient({ baseUrl: `${API_BASE}/`, service: SERVICE });
|
|
24
23
|
function errorMessage(payload, status, statusText) {
|
|
25
24
|
if (typeof payload === "string" && payload.trim() !== "") return payload;
|
|
26
25
|
const record = asJsonObject(payload);
|
|
@@ -29,27 +28,28 @@ function errorMessage(payload, status, statusText) {
|
|
|
29
28
|
const message = first === void 0 ? trimmedText(record?.detail) ?? trimmedText(record?.message) ?? trimmedText(record?.error) ?? trimmedText(record?.title) : trimmedText(first.detail) ?? trimmedText(first.title) ?? trimmedText(first.code);
|
|
30
29
|
return message ?? (statusText || `Telnyx \u8FD4\u56DE HTTP ${status}`);
|
|
31
30
|
}
|
|
31
|
+
var http = createAuthedClient({
|
|
32
|
+
baseUrl: `${API_BASE}/`,
|
|
33
|
+
service: SERVICE,
|
|
34
|
+
auth: { kind: "bearer" },
|
|
35
|
+
headers: { accept: "application/json" },
|
|
36
|
+
mapError: ({ bodyKind, data, status, statusText }) => bodyKind === "invalid-json" ? upstreamError(status === 429 ? 429 : 502, "Telnyx \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94") : upstreamError(status, errorMessage(bodyKind === "empty" ? null : data, status, statusText)),
|
|
37
|
+
mapTransportError: ({ message }) => upstreamError(
|
|
38
|
+
502,
|
|
39
|
+
message === void 0 ? "telnyx request failed" : `telnyx request failed: ${message}`
|
|
40
|
+
)
|
|
41
|
+
});
|
|
32
42
|
async function request(ctx, path, input = {}) {
|
|
33
|
-
const
|
|
34
|
-
accept: "application/json",
|
|
35
|
-
authorization: `Bearer ${requireApiKey(ctx, SERVICE)}`
|
|
36
|
-
};
|
|
37
|
-
const response = await http.request({
|
|
43
|
+
const response = await http.request(ctx, {
|
|
38
44
|
method: input.method ?? "GET",
|
|
39
45
|
path,
|
|
40
46
|
// 空串不进 query:Telnyx 会把 `filter[name]=` 读成"匹配空名字",而调用方省略一个
|
|
41
47
|
// 可选筛选时想要的是"不筛选"。
|
|
42
48
|
query: (input.query ?? []).filter(([, value]) => value !== void 0 && value !== null && value !== ""),
|
|
43
|
-
headers,
|
|
44
49
|
// JSON.stringify 自己会丢掉值为 undefined 的键,故不必复制上游的 removeUndefined;
|
|
45
50
|
// 但 null 必须留住 —— schema 允许 sendAt 显式传 null,那是要发给 Telnyx 的值。
|
|
46
51
|
...input.body === void 0 ? {} : { json: input.body },
|
|
47
|
-
invalidJsonMessage: "Telnyx \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94"
|
|
48
|
-
mapError: ({ bodyKind, data, status, statusText }) => bodyKind === "invalid-json" ? upstreamError(status === 429 ? 429 : 502, "Telnyx \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94") : upstreamError(status, errorMessage(bodyKind === "empty" ? null : data, status, statusText)),
|
|
49
|
-
mapTransportError: ({ message }) => upstreamError(
|
|
50
|
-
502,
|
|
51
|
-
message === void 0 ? "telnyx request failed" : `telnyx request failed: ${message}`
|
|
52
|
-
)
|
|
52
|
+
invalidJsonMessage: "Telnyx \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94"
|
|
53
53
|
});
|
|
54
54
|
const record = asJsonObject(response.bodyKind === "empty" ? null : response.data);
|
|
55
55
|
if (record === void 0) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
createAuthedClient
|
|
3
|
+
} from "./chunk-JEWFX6Z6.js";
|
|
4
|
+
import "./chunk-Q74GLIDK.js";
|
|
4
5
|
import {
|
|
5
6
|
asJsonObject,
|
|
6
7
|
compactDefined,
|
|
@@ -8,21 +9,19 @@ import {
|
|
|
8
9
|
} from "./chunk-JXHMDBAY.js";
|
|
9
10
|
import {
|
|
10
11
|
createProviderPlugin,
|
|
11
|
-
requireApiKey,
|
|
12
12
|
upstreamError
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-QR4LK3HF.js";
|
|
14
|
+
import "./chunk-ZTTN6AJG.js";
|
|
15
15
|
import {
|
|
16
16
|
TBError,
|
|
17
17
|
external_exports
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-MZCIPUNQ.js";
|
|
19
19
|
import "./chunk-U67V476Y.js";
|
|
20
20
|
|
|
21
21
|
// ../plugins/src/todoist/api.ts
|
|
22
22
|
var SERVICE = "todoist";
|
|
23
23
|
var API_BASE = "https://api.todoist.com/api/v1";
|
|
24
24
|
var USER_PATH = "/user";
|
|
25
|
-
var http = createProviderHttpClient({ baseUrl: `${API_BASE}/`, service: SERVICE });
|
|
26
25
|
function requireText(value, field) {
|
|
27
26
|
const result = trimmedText(value);
|
|
28
27
|
if (result === void 0) throw new TBError("invalid_argument", `${field} is required.`);
|
|
@@ -48,6 +47,16 @@ function errorMessage(status, payload) {
|
|
|
48
47
|
}
|
|
49
48
|
return `todoist request failed with ${status}`;
|
|
50
49
|
}
|
|
50
|
+
var http = createAuthedClient({
|
|
51
|
+
baseUrl: `${API_BASE}/`,
|
|
52
|
+
service: SERVICE,
|
|
53
|
+
auth: { kind: "bearer" },
|
|
54
|
+
headers: { accept: "application/json" },
|
|
55
|
+
mapError: ({ data, status }) => upstreamError(
|
|
56
|
+
status,
|
|
57
|
+
errorMessage(status, typeof data === "string" ? { message: data } : data)
|
|
58
|
+
)
|
|
59
|
+
});
|
|
51
60
|
async function request(ctx, input) {
|
|
52
61
|
const hasBody = input.body !== void 0;
|
|
53
62
|
const query = Object.entries(input.query ?? {}).map(([key, value]) => [
|
|
@@ -55,20 +64,12 @@ async function request(ctx, input) {
|
|
|
55
64
|
// 多值参数(list_tasks 的 ids)是**逗号串**,不是重复的同名参数。
|
|
56
65
|
Array.isArray(value) ? value.join(",") : value
|
|
57
66
|
]);
|
|
58
|
-
const { data } = await http.request({
|
|
67
|
+
const { data } = await http.request(ctx, {
|
|
59
68
|
path: input.path,
|
|
60
69
|
method: input.method ?? "GET",
|
|
61
70
|
query,
|
|
62
|
-
headers: {
|
|
63
|
-
accept: "application/json",
|
|
64
|
-
authorization: `Bearer ${requireApiKey(ctx, SERVICE)}`
|
|
65
|
-
},
|
|
66
71
|
...hasBody ? { json: input.body } : {},
|
|
67
|
-
invalidJsonMessage: "Todoist \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94"
|
|
68
|
-
mapError: ({ data: data2, status }) => upstreamError(
|
|
69
|
-
status,
|
|
70
|
-
errorMessage(status, typeof data2 === "string" ? { message: data2 } : data2)
|
|
71
|
-
)
|
|
72
|
+
invalidJsonMessage: "Todoist \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94"
|
|
72
73
|
});
|
|
73
74
|
return data ?? {};
|
|
74
75
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createProviderHttpClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q74GLIDK.js";
|
|
4
4
|
import {
|
|
5
5
|
asJsonObject,
|
|
6
6
|
booleanValue,
|
|
@@ -11,12 +11,12 @@ import {
|
|
|
11
11
|
createProviderPlugin,
|
|
12
12
|
requireCredential,
|
|
13
13
|
upstreamError
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-QR4LK3HF.js";
|
|
15
|
+
import "./chunk-ZTTN6AJG.js";
|
|
16
16
|
import {
|
|
17
17
|
TBError,
|
|
18
18
|
external_exports
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-MZCIPUNQ.js";
|
|
20
20
|
import "./chunk-U67V476Y.js";
|
|
21
21
|
|
|
22
22
|
// ../plugins/src/trello/api.ts
|