@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.
- package/dist/admin.js +170 -0
- package/dist/airtable-VMQVXLHK.js +790 -0
- package/dist/{alt_text_generator_ai-W7O34SNG.js → alt_text_generator_ai-FTWY4RU4.js} +12 -11
- package/dist/{amap-VOX4T2AW.js → amap-OK5VBHYC.js} +221 -220
- package/dist/anthropic-S67AZFZ3.js +203 -0
- package/dist/apify-ZE6MYQI3.js +248 -0
- package/dist/brave_search-TG2M2KOD.js +302 -0
- package/dist/chunk-2JNAI4OC.js +161 -0
- package/dist/{chunk-KMTT3I6D.js → chunk-4XJPN3DY.js} +19392 -26136
- package/dist/chunk-5ICRY3VU.js +8432 -0
- package/dist/chunk-7CTWGTDU.js +302 -0
- package/dist/chunk-BADVCN6K.js +378 -0
- package/dist/{chunk-XYBU3WZH.js → chunk-TDAWLMDE.js} +3 -3
- package/dist/chunk-U7PTOA3U.js +7320 -0
- package/dist/{chunk-E6JCVKW6.js → chunk-VWRUGUSU.js} +3 -3
- package/dist/{chunk-ATK45BXV.js → chunk-WJHG6OK7.js} +4 -2
- package/dist/circleci-3L3WJVSK.js +389 -0
- package/dist/clerk-EZPF2V7T.js +1019 -0
- package/dist/cohere-U27DPO64.js +185 -0
- package/dist/{confluence-B3EWPZVE.js → confluence-G2KL6ERH.js} +105 -104
- package/dist/{convertapi-EUWSQYPF.js → convertapi-L4CLJ2M3.js} +32 -31
- package/dist/{currencyapi-KVTIK3GL.js → currencyapi-YPYXG7YY.js} +71 -71
- package/dist/deepseek-6HT6WF3M.js +210 -0
- package/dist/docker_hub-LPE3PCVB.js +933 -0
- package/dist/dropbox-V56ABHTA.js +1305 -0
- package/dist/dub-6OKQ7MHT.js +680 -0
- package/dist/e2b-JS2U2QFU.js +278 -0
- package/dist/exa-DPWVYXSP.js +332 -0
- package/dist/{fal_ai-23E7JPNT.js → fal_ai-DK6Y27ZF.js} +81 -80
- package/dist/{feishu-7QRIDUV6.js → feishu-K7EGSRF3.js} +528 -572
- package/dist/{feishu_custom_bot-TJ4K7QNJ.js → feishu_custom_bot-2JUGFYNG.js} +57 -53
- package/dist/figma-FT5I7ITD.js +777 -0
- package/dist/firehydrant-EIKLKHX2.js +563 -0
- package/dist/{fixer-BWON27UO.js → fixer-U5QXIAKD.js} +34 -33
- package/dist/fly-T3JYFZ2M.js +469 -0
- package/dist/{front-QCGXYEDJ.js → front-D72MGVOR.js} +104 -104
- package/dist/geocodio-BOTD5TI5.js +213 -0
- package/dist/ghost-KYP7SZGB.js +338 -0
- package/dist/github-AGMZT3VY.js +5421 -0
- package/dist/gmail-BLJNJOBG.js +1887 -0
- package/dist/googlecalendar-GTHWNCF6.js +2524 -0
- package/dist/{googledocs-BUHL4J2H.js → googledocs-6EEDMEBQ.js} +341 -340
- package/dist/{grafana-GLU2DWF2.js → grafana-GMW6EKSQ.js} +221 -220
- package/dist/graphhopper-6OLGBDGB.js +325 -0
- package/dist/index.d.ts +1132 -332
- package/dist/index.js +31 -14
- package/dist/{ip2proxy-EZ64Y4ZH.js → ip2proxy-4QN42E6T.js} +28 -27
- package/dist/ipgeolocation_io-SK4XKDA2.js +315 -0
- package/dist/ipqualityscore-6ANBPXKT.js +279 -0
- package/dist/{jina_ai-EFBHTBXL.js → jina_ai-IHPSVRM5.js} +23 -23
- package/dist/{jira-HQSHAA5K.js → jira-46KKM4LC.js} +118 -117
- package/dist/langsmith-JZA345I5.js +593 -0
- package/dist/lemlist-43IV7DK6.js +289 -0
- package/dist/{linear-K7RYFYAD.js → linear-5LFH7XNL.js} +327 -326
- package/dist/logsnag-5RMYAHIL.js +150 -0
- package/dist/main.js +57 -280
- package/dist/{mattermost-S2BRCWLQ.js → mattermost-XFL6SHGG.js} +59 -58
- package/dist/mem0-NYO4DTP6.js +544 -0
- package/dist/memos-37MPQOLV.js +744 -0
- package/dist/{metabase-MMSEPCOF.js → metabase-KYBKZFMG.js} +90 -89
- package/dist/mistral_ai-6PL3K4PM.js +1196 -0
- package/dist/{mother_duck-H7PCQNZ2.js → mother_duck-2NH7W5M5.js} +94 -93
- package/dist/ngrok-UO6CDYCA.js +356 -0
- package/dist/{notes-PFMKRO33.js → notes-I3P32WP4.js} +11 -9
- package/dist/notion-BEAJFUOE.js +940 -0
- package/dist/open_exchange_rates-CMF62JB4.js +215 -0
- package/dist/openai-IHOMKVND.js +800 -0
- package/dist/opengraph_io-ZQ2FGLHX.js +362 -0
- package/dist/openrouter-HXLW3NR5.js +441 -0
- package/dist/outline-ELCP4NEU.js +599 -0
- package/dist/paddle-O77LALVN.js +454 -0
- package/dist/perplexity-JCU654QV.js +220 -0
- package/dist/pinecone-W5W4LRKL.js +571 -0
- package/dist/{pipedrive-Y2O7QGFF.js → pipedrive-ITMJLLPZ.js} +99 -98
- package/dist/polar-R33XU4L3.js +395 -0
- package/dist/posthog-JVNTOLTV.js +3464 -0
- package/dist/postmark-6SBG7HWV.js +427 -0
- package/dist/{prerender-MENYM2TY.js → prerender-GPNKTNFC.js} +31 -30
- package/dist/{pubmed-GOXUVVH5.js → pubmed-UP6ZEEIH.js} +239 -238
- package/dist/{railway-V2SID4WV.js → railway-KWEWXHTY.js} +118 -117
- package/dist/readwise-BLATSMC3.js +470 -0
- package/dist/render-QYRVIXII.js +461 -0
- package/dist/{replicate-756MXPYX.js → replicate-JYTWH4NF.js} +81 -80
- package/dist/{resend-ZKH3BTBI.js → resend-L5N75SZM.js} +20 -16
- package/dist/rootly-MHCPEQ26.js +336 -0
- package/dist/{scrapfly-NSRHFDIQ.js → scrapfly-PTPGYSJM.js} +62 -61
- package/dist/{scrapingbee-OQHLAVEY.js → scrapingbee-JN6UH5PY.js} +56 -56
- package/dist/{screenshot_fyi-DVWG3AXC.js → screenshot_fyi-4QRVSV55.js} +16 -16
- package/dist/semantic_scholar-LRSWA2GE.js +611 -0
- package/dist/{sentry-546MNDJG.js → sentry-2G6PF5W6.js} +208 -207
- package/dist/{shodan-C3OON3Z3.js → shodan-WKKPP5C6.js} +62 -61
- package/dist/shopify-64YDK5T2.js +610 -0
- package/dist/stripe-QAIGGOTF.js +585 -0
- package/dist/{supabase-U2SL4D63.js → supabase-WHTGR6ND.js} +245 -244
- package/dist/tavily-QIXCDDWO.js +326 -0
- package/dist/telegram-E6G7CWI6.js +1767 -0
- package/dist/{telnyx-CXQ4EZUX.js → telnyx-ZDVVS7PK.js} +57 -56
- package/dist/todoist-DMYF3G7J.js +664 -0
- package/dist/trello-HY2RYIRP.js +1080 -0
- package/dist/turso-HAQWMGRP.js +416 -0
- package/dist/{twilio-4PDBJKWX.js → twilio-MLXYPHJE.js} +70 -69
- package/dist/umami-DZHBLPVG.js +389 -0
- package/dist/unsplash-GS2OPXKE.js +351 -0
- package/dist/{upstash_redis-G4LQBYHA.js → upstash_redis-XMXWTNAJ.js} +51 -50
- package/dist/uptimerobot-TF5WRZ4G.js +483 -0
- package/dist/v2ex-2BVXAPDF.js +667 -0
- package/dist/vercel-YMJGQYJE.js +1076 -0
- package/dist/{wolfram_alpha_api-3G4PUJWB.js → wolfram_alpha_api-I56SXWFZ.js} +36 -35
- package/dist/wordpress-R7TDFZ2P.js +812 -0
- package/dist/workos-HDNHWVMS.js +664 -0
- package/dist/zhihu-LX6AGGDS.js +254 -0
- package/package.json +18 -9
- package/dist/airtable-LLZDFN7M.js +0 -789
- package/dist/anthropic-G23NN3X5.js +0 -202
- package/dist/apify-Y3SS734K.js +0 -247
- package/dist/brave_search-ZC7OAPSZ.js +0 -301
- package/dist/chunk-R6P4XAE5.js +0 -248
- package/dist/chunk-U7B6DS2O.js +0 -977
- package/dist/chunk-UZM2RXZH.js +0 -23436
- package/dist/circleci-3BAX5FCG.js +0 -388
- package/dist/clerk-6LEM6TNU.js +0 -1019
- package/dist/cloudflare_dns-KINYTJUD.js +0 -588
- package/dist/cohere-XCJ5AJ6B.js +0 -185
- package/dist/deepseek-PC5YGNC5.js +0 -209
- package/dist/docker_hub-C3MA5FU6.js +0 -932
- package/dist/dropbox-XBV7Z2IR.js +0 -1304
- package/dist/dub-LDOFG3HC.js +0 -679
- package/dist/e2b-JMCPSVBW.js +0 -277
- package/dist/exa-RAK7O7RD.js +0 -331
- package/dist/figma-E6IX5DTH.js +0 -773
- package/dist/firehydrant-ZBLPQREE.js +0 -562
- package/dist/fly-ZH3HFCZJ.js +0 -468
- package/dist/geocodio-YGNI7DA4.js +0 -212
- package/dist/ghost-EVSGKH2Q.js +0 -337
- package/dist/github-MA2BGRCJ.js +0 -5420
- package/dist/gmail-E5E6AADE.js +0 -1886
- package/dist/googlecalendar-BTLFPXTD.js +0 -2523
- package/dist/graphhopper-WSMB3TCD.js +0 -324
- package/dist/ipgeolocation_io-AA7HAS22.js +0 -315
- package/dist/ipqualityscore-BHJXVTJT.js +0 -277
- package/dist/langsmith-5W6SCT6F.js +0 -592
- package/dist/lemlist-HJWH6UMK.js +0 -288
- package/dist/logsnag-4KFOHL37.js +0 -150
- package/dist/mem0-CAW43CIC.js +0 -543
- package/dist/memos-TWEGPKFM.js +0 -740
- package/dist/mistral_ai-64BGZQHP.js +0 -1195
- package/dist/ngrok-GQCUGZKJ.js +0 -356
- package/dist/notion-DQWZWP4N.js +0 -936
- package/dist/open_exchange_rates-QMMD735E.js +0 -214
- package/dist/openai-W6PX32NZ.js +0 -799
- package/dist/opengraph_io-HNDBXYNW.js +0 -361
- package/dist/openrouter-JJYMEAUL.js +0 -437
- package/dist/outline-MCBNQZYY.js +0 -595
- package/dist/paddle-D2SKLUDN.js +0 -453
- package/dist/perplexity-XIFMKUAE.js +0 -219
- package/dist/pinecone-HUFTALV2.js +0 -570
- package/dist/polar-TYTOMOSR.js +0 -394
- package/dist/posthog-43JAR3VW.js +0 -3463
- package/dist/postmark-KL2QJYSG.js +0 -426
- package/dist/readwise-CI4GIMMJ.js +0 -469
- package/dist/render-SUBJ6YRZ.js +0 -460
- package/dist/rootly-CD2LJHPI.js +0 -336
- package/dist/semantic_scholar-T4A252KW.js +0 -610
- package/dist/shopify-Y2HN2MCQ.js +0 -609
- package/dist/stripe-VE3CD3AY.js +0 -584
- package/dist/tavily-KCZHK6HE.js +0 -326
- package/dist/telegram-3URFBCMY.js +0 -1766
- package/dist/todoist-HNPWNYTD.js +0 -663
- package/dist/trello-3W2MIXRP.js +0 -1079
- package/dist/turso-2EQF7C2Z.js +0 -415
- package/dist/umami-5REN7TGP.js +0 -388
- package/dist/unsplash-EIXL424F.js +0 -350
- package/dist/uptimerobot-KNJ3EYLY.js +0 -482
- package/dist/v2ex-RHJ234PZ.js +0 -666
- package/dist/vercel-AS6NCIC7.js +0 -1075
- package/dist/wordpress-KNDAAUV7.js +0 -811
- package/dist/workos-R6UITSJ7.js +0 -663
- package/dist/zhihu-AGK4HILK.js +0 -253
|
@@ -0,0 +1,599 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createAuthedClient
|
|
3
|
+
} from "./chunk-TDAWLMDE.js";
|
|
4
|
+
import "./chunk-VWRUGUSU.js";
|
|
5
|
+
import {
|
|
6
|
+
asJsonObject,
|
|
7
|
+
compactDefined,
|
|
8
|
+
integerValue,
|
|
9
|
+
trimmedText
|
|
10
|
+
} from "./chunk-JXHMDBAY.js";
|
|
11
|
+
import {
|
|
12
|
+
createProviderPlugin,
|
|
13
|
+
requireApiKey,
|
|
14
|
+
upstreamError
|
|
15
|
+
} from "./chunk-WJHG6OK7.js";
|
|
16
|
+
import {
|
|
17
|
+
assertPublicHttpUrl
|
|
18
|
+
} from "./chunk-2JNAI4OC.js";
|
|
19
|
+
import "./chunk-BADVCN6K.js";
|
|
20
|
+
import {
|
|
21
|
+
TBError
|
|
22
|
+
} from "./chunk-5ICRY3VU.js";
|
|
23
|
+
import "./chunk-U67V476Y.js";
|
|
24
|
+
|
|
25
|
+
// ../plugins/src/outline/api.ts
|
|
26
|
+
var SERVICE = "outline";
|
|
27
|
+
var CLOUD_API_BASE = "https://app.getoutline.com/api";
|
|
28
|
+
var http = createAuthedClient({
|
|
29
|
+
service: SERVICE,
|
|
30
|
+
auth: { kind: "bearer" },
|
|
31
|
+
headers: { accept: "application/json" },
|
|
32
|
+
errorMessage: {
|
|
33
|
+
// Outline 的错误消息在 `message` / `error` / `status` 三处之一。
|
|
34
|
+
keys: ["message", "error", "status"],
|
|
35
|
+
fallback: (status) => `outline request failed with status ${status}`
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
function nullableText(value) {
|
|
39
|
+
return value === null ? null : trimmedText(value);
|
|
40
|
+
}
|
|
41
|
+
function nullableBoolean(value) {
|
|
42
|
+
if (value === null) return null;
|
|
43
|
+
return typeof value === "boolean" ? value : void 0;
|
|
44
|
+
}
|
|
45
|
+
function responseError(message) {
|
|
46
|
+
return new TBError("unavailable", message, { retryable: true });
|
|
47
|
+
}
|
|
48
|
+
function configError(message) {
|
|
49
|
+
return new TBError("invalid_argument", `${SERVICE} \u7684 baseUrl ${message}`);
|
|
50
|
+
}
|
|
51
|
+
function resolveApiBase(ctx) {
|
|
52
|
+
const configured = ctx.config?.baseUrl;
|
|
53
|
+
if (configured !== void 0 && typeof configured !== "string") {
|
|
54
|
+
throw configError("\u5FC5\u987B\u662F\u5B57\u7B26\u4E32");
|
|
55
|
+
}
|
|
56
|
+
const candidate = trimmedText(configured) ?? CLOUD_API_BASE;
|
|
57
|
+
let url;
|
|
58
|
+
try {
|
|
59
|
+
url = assertPublicHttpUrl(candidate);
|
|
60
|
+
} catch (error) {
|
|
61
|
+
const detail = error instanceof Error ? error.message : "\u4E0D\u53EF\u7528";
|
|
62
|
+
throw configError(
|
|
63
|
+
`\u4E0D\u53EF\u7528(${detail})\u3002\u81EA\u5EFA Outline \u5FC5\u987B\u662F**\u516C\u7F51\u53EF\u8FBE**\u7684 https \u5730\u5740:\u63D2\u4EF6\u4E0E\u7F51\u5173\u540C\u8FDB\u7A0B,\u6307\u5411\u5185\u7F51\u6216\u4FDD\u7559\u5730\u5740\u4F1A\u88AB\u51FA\u7AD9\u6821\u9A8C\u62D2\u7EDD`
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
if (url.protocol !== "https:") throw configError("\u5FC5\u987B\u7528 https");
|
|
67
|
+
url.search = "";
|
|
68
|
+
url.hash = "";
|
|
69
|
+
const path = url.pathname.replace(/\/+$/, "");
|
|
70
|
+
const normalized = `${url.origin}${path}`;
|
|
71
|
+
return normalized.endsWith("/api") ? normalized : `${normalized}/api`;
|
|
72
|
+
}
|
|
73
|
+
async function request(ctx, path, body = {}) {
|
|
74
|
+
requireApiKey(ctx, SERVICE);
|
|
75
|
+
const result = await http.request(ctx, {
|
|
76
|
+
baseUrl: `${resolveApiBase(ctx)}/`,
|
|
77
|
+
path,
|
|
78
|
+
method: "POST",
|
|
79
|
+
json: body,
|
|
80
|
+
invalidJsonMessage: "outline \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94",
|
|
81
|
+
mapTransportError: ({ message }) => upstreamError(
|
|
82
|
+
502,
|
|
83
|
+
`outline ${path} failed before receiving response: ${message ?? "unknown network error"}`
|
|
84
|
+
)
|
|
85
|
+
});
|
|
86
|
+
return result.data === void 0 ? null : result.data;
|
|
87
|
+
}
|
|
88
|
+
function readData(payload) {
|
|
89
|
+
const body = asJsonObject(payload);
|
|
90
|
+
if (body === void 0 || !("data" in body)) {
|
|
91
|
+
throw responseError("outline \u54CD\u5E94\u91CC\u6CA1\u6709 data");
|
|
92
|
+
}
|
|
93
|
+
return body.data;
|
|
94
|
+
}
|
|
95
|
+
function requireObject(value, label) {
|
|
96
|
+
const result = asJsonObject(value);
|
|
97
|
+
if (result === void 0) throw responseError(`outline ${label} \u4E0D\u662F\u5BF9\u8C61`);
|
|
98
|
+
return result;
|
|
99
|
+
}
|
|
100
|
+
function requireObjectArray(value, label) {
|
|
101
|
+
if (!Array.isArray(value)) throw responseError(`outline ${label} \u4E0D\u662F\u6570\u7EC4`);
|
|
102
|
+
return value.map((item, index) => requireObject(item, `${label}[${index}]`));
|
|
103
|
+
}
|
|
104
|
+
function requireText(value, label) {
|
|
105
|
+
const result = trimmedText(value);
|
|
106
|
+
if (result === void 0) throw responseError(`outline \u54CD\u5E94\u91CC\u6CA1\u6709 ${label}`);
|
|
107
|
+
return result;
|
|
108
|
+
}
|
|
109
|
+
function requireInputText(value, field) {
|
|
110
|
+
const result = trimmedText(value);
|
|
111
|
+
if (result === void 0) throw new TBError("invalid_argument", `${field} is required.`);
|
|
112
|
+
return result;
|
|
113
|
+
}
|
|
114
|
+
function statusFilter(value) {
|
|
115
|
+
if (!Array.isArray(value)) return void 0;
|
|
116
|
+
const items = value.map((item) => trimmedText(item)).filter((item) => item !== void 0);
|
|
117
|
+
return items.length > 0 ? items : void 0;
|
|
118
|
+
}
|
|
119
|
+
function normalizeSort(value) {
|
|
120
|
+
const sort = asJsonObject(value);
|
|
121
|
+
if (sort === void 0) return void 0;
|
|
122
|
+
const field = trimmedText(sort.field);
|
|
123
|
+
const direction = trimmedText(sort.direction);
|
|
124
|
+
if (field === void 0 || direction === void 0) return void 0;
|
|
125
|
+
return { field, direction };
|
|
126
|
+
}
|
|
127
|
+
function normalizeCollection(input) {
|
|
128
|
+
return compactDefined({
|
|
129
|
+
id: requireText(input.id, "collection.id"),
|
|
130
|
+
urlId: nullableText(input.urlId),
|
|
131
|
+
name: requireText(input.name, "collection.name"),
|
|
132
|
+
description: nullableText(input.description),
|
|
133
|
+
sort: normalizeSort(input.sort),
|
|
134
|
+
index: nullableText(input.index),
|
|
135
|
+
color: nullableText(input.color),
|
|
136
|
+
icon: nullableText(input.icon),
|
|
137
|
+
permission: nullableText(input.permission),
|
|
138
|
+
sharing: nullableBoolean(input.sharing),
|
|
139
|
+
createdAt: nullableText(input.createdAt),
|
|
140
|
+
updatedAt: nullableText(input.updatedAt),
|
|
141
|
+
archivedAt: nullableText(input.archivedAt),
|
|
142
|
+
deletedAt: nullableText(input.deletedAt),
|
|
143
|
+
// 裁剪掉的字段仍从 raw 里可得:Outline 各版本的字段集不一样,裁死会让自建实例丢东西。
|
|
144
|
+
raw: input
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
function normalizeUser(value) {
|
|
148
|
+
const user = asJsonObject(value);
|
|
149
|
+
if (user === void 0) return void 0;
|
|
150
|
+
const id = trimmedText(user.id);
|
|
151
|
+
const name = trimmedText(user.name);
|
|
152
|
+
if (id === void 0 && name === void 0) return void 0;
|
|
153
|
+
return compactDefined({
|
|
154
|
+
id,
|
|
155
|
+
name,
|
|
156
|
+
avatarUrl: nullableText(user.avatarUrl),
|
|
157
|
+
email: nullableText(user.email),
|
|
158
|
+
role: nullableText(user.role),
|
|
159
|
+
isSuspended: nullableBoolean(user.isSuspended),
|
|
160
|
+
lastActiveAt: nullableText(user.lastActiveAt),
|
|
161
|
+
createdAt: nullableText(user.createdAt)
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
function normalizeDataAttributes(value) {
|
|
165
|
+
if (!Array.isArray(value)) return void 0;
|
|
166
|
+
return value.map((item) => asJsonObject(item)).filter((item) => item !== void 0).map((item) => compactDefined({
|
|
167
|
+
dataAttributeId: requireText(item.dataAttributeId, "document.dataAttributes[].dataAttributeId"),
|
|
168
|
+
value: item.value,
|
|
169
|
+
updatedAt: nullableText(item.updatedAt)
|
|
170
|
+
}));
|
|
171
|
+
}
|
|
172
|
+
function normalizeDocument(input) {
|
|
173
|
+
return compactDefined({
|
|
174
|
+
id: requireText(input.id, "document.id"),
|
|
175
|
+
collectionId: nullableText(input.collectionId),
|
|
176
|
+
parentDocumentId: nullableText(input.parentDocumentId),
|
|
177
|
+
title: requireText(input.title, "document.title"),
|
|
178
|
+
fullWidth: nullableBoolean(input.fullWidth),
|
|
179
|
+
emoji: nullableText(input.emoji),
|
|
180
|
+
text: nullableText(input.text),
|
|
181
|
+
urlId: nullableText(input.urlId),
|
|
182
|
+
pinned: nullableBoolean(input.pinned),
|
|
183
|
+
templateId: nullableText(input.templateId),
|
|
184
|
+
revision: integerValue(input.revision),
|
|
185
|
+
createdAt: nullableText(input.createdAt),
|
|
186
|
+
createdBy: normalizeUser(input.createdBy),
|
|
187
|
+
updatedAt: nullableText(input.updatedAt),
|
|
188
|
+
updatedBy: normalizeUser(input.updatedBy),
|
|
189
|
+
publishedAt: nullableText(input.publishedAt),
|
|
190
|
+
dataAttributes: normalizeDataAttributes(input.dataAttributes),
|
|
191
|
+
archivedAt: nullableText(input.archivedAt),
|
|
192
|
+
deletedAt: nullableText(input.deletedAt),
|
|
193
|
+
raw: input
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
function normalizePagination(payload) {
|
|
197
|
+
const pagination = asJsonObject(asJsonObject(payload)?.pagination);
|
|
198
|
+
return {
|
|
199
|
+
offset: integerValue(pagination?.offset) ?? 0,
|
|
200
|
+
limit: integerValue(pagination?.limit) ?? 0
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
function normalizeNavigationNode(input, label) {
|
|
204
|
+
return {
|
|
205
|
+
id: requireText(input.id, `${label}.id`),
|
|
206
|
+
title: requireText(input.title, `${label}.title`),
|
|
207
|
+
url: requireText(input.url, `${label}.url`),
|
|
208
|
+
children: Array.isArray(input.children) ? input.children.map((child) => asJsonObject(child)).filter((child) => child !== void 0).map((child) => normalizeNavigationNode(child, `${label}.children[]`)) : []
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
async function listCollections(input, ctx) {
|
|
212
|
+
const payload = await request(ctx, "collections.list", compactDefined({
|
|
213
|
+
query: trimmedText(input.query),
|
|
214
|
+
statusFilter: statusFilter(input.statusFilter),
|
|
215
|
+
sort: trimmedText(input.sort),
|
|
216
|
+
direction: trimmedText(input.direction),
|
|
217
|
+
offset: integerValue(input.offset),
|
|
218
|
+
limit: integerValue(input.limit)
|
|
219
|
+
}));
|
|
220
|
+
return {
|
|
221
|
+
collections: requireObjectArray(readData(payload), "collections.list.data").map(normalizeCollection),
|
|
222
|
+
pagination: normalizePagination(payload)
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
async function getCollection(input, ctx) {
|
|
226
|
+
const payload = await request(ctx, "collections.info", { id: requireInputText(input.id, "id") });
|
|
227
|
+
return { collection: normalizeCollection(requireObject(readData(payload), "collections.info.data")) };
|
|
228
|
+
}
|
|
229
|
+
async function listCollectionDocuments(input, ctx) {
|
|
230
|
+
const payload = await request(ctx, "collections.documents", { id: requireInputText(input.id, "id") });
|
|
231
|
+
return {
|
|
232
|
+
tree: requireObjectArray(readData(payload), "collections.documents.data").map((item) => normalizeNavigationNode(item, "tree[]"))
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
async function listDocuments(input, ctx) {
|
|
236
|
+
const payload = await request(ctx, "documents.list", compactDefined({
|
|
237
|
+
offset: integerValue(input.offset),
|
|
238
|
+
limit: integerValue(input.limit),
|
|
239
|
+
sort: trimmedText(input.sort),
|
|
240
|
+
direction: trimmedText(input.direction),
|
|
241
|
+
collectionId: trimmedText(input.collectionId),
|
|
242
|
+
userId: trimmedText(input.userId),
|
|
243
|
+
backlinkDocumentId: trimmedText(input.backlinkDocumentId),
|
|
244
|
+
parentDocumentId: trimmedText(input.parentDocumentId),
|
|
245
|
+
statusFilter: statusFilter(input.statusFilter)
|
|
246
|
+
}));
|
|
247
|
+
return {
|
|
248
|
+
documents: requireObjectArray(readData(payload), "documents.list.data").map(normalizeDocument),
|
|
249
|
+
pagination: normalizePagination(payload)
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
async function searchDocuments(input, ctx) {
|
|
253
|
+
const payload = await request(ctx, "documents.search", compactDefined({
|
|
254
|
+
query: requireInputText(input.query, "query"),
|
|
255
|
+
offset: integerValue(input.offset),
|
|
256
|
+
limit: integerValue(input.limit),
|
|
257
|
+
userId: trimmedText(input.userId),
|
|
258
|
+
collectionId: trimmedText(input.collectionId),
|
|
259
|
+
documentId: trimmedText(input.documentId),
|
|
260
|
+
statusFilter: statusFilter(input.statusFilter),
|
|
261
|
+
dateFilter: trimmedText(input.dateFilter),
|
|
262
|
+
shareId: trimmedText(input.shareId),
|
|
263
|
+
snippetMinWords: integerValue(input.snippetMinWords),
|
|
264
|
+
snippetMaxWords: integerValue(input.snippetMaxWords),
|
|
265
|
+
sort: trimmedText(input.sort),
|
|
266
|
+
direction: trimmedText(input.direction)
|
|
267
|
+
}));
|
|
268
|
+
return {
|
|
269
|
+
documents: requireObjectArray(readData(payload), "documents.search.data").map(normalizeDocument),
|
|
270
|
+
pagination: normalizePagination(payload)
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
async function getDocument(input, ctx) {
|
|
274
|
+
const id = trimmedText(input.id);
|
|
275
|
+
const shareId = trimmedText(input.shareId);
|
|
276
|
+
if (id === void 0 && shareId === void 0) {
|
|
277
|
+
throw new TBError("invalid_argument", "Provide at least one of id or shareId.");
|
|
278
|
+
}
|
|
279
|
+
const payload = await request(ctx, "documents.info", compactDefined({ id, shareId }));
|
|
280
|
+
return { document: normalizeDocument(requireObject(readData(payload), "documents.info.data")) };
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// ../plugins/src/outline/schema.ts
|
|
284
|
+
import { z as z2 } from "zod/v4";
|
|
285
|
+
|
|
286
|
+
// ../plugins/src/outline/schema.handwritten.ts
|
|
287
|
+
import { z } from "zod/v4";
|
|
288
|
+
var outlineUser = z.strictObject({
|
|
289
|
+
id: z.uuid().describe("The unique identifier for the user."),
|
|
290
|
+
name: z.string().min(1).describe("The display name of the user."),
|
|
291
|
+
avatarUrl: z.url().describe("The avatar URL for the user.").optional(),
|
|
292
|
+
email: z.email().describe("The email address for the user.").optional(),
|
|
293
|
+
role: z.enum(["admin", "member", "viewer", "guest"]).describe("The Outline user role.").optional(),
|
|
294
|
+
isSuspended: z.boolean().describe("Whether the user is suspended.").optional(),
|
|
295
|
+
lastActiveAt: z.iso.datetime({ offset: true }).describe("The ISO timestamp when the user was last active.").optional(),
|
|
296
|
+
createdAt: z.iso.datetime({ offset: true }).describe("The ISO timestamp when the user was created.").optional()
|
|
297
|
+
}).describe("One Outline user returned inside auth or document metadata.");
|
|
298
|
+
var outlineDocument = z.strictObject({
|
|
299
|
+
id: z.uuid().describe("The unique identifier for the document."),
|
|
300
|
+
collectionId: z.uuid().describe("The unique identifier for the associated collection.").optional(),
|
|
301
|
+
parentDocumentId: z.uuid().describe("The unique identifier for the parent document, or null when the document is at the root level.").nullable().optional(),
|
|
302
|
+
title: z.string().describe("The document title."),
|
|
303
|
+
fullWidth: z.boolean().describe("Whether the document is displayed in full width.").optional(),
|
|
304
|
+
emoji: z.string().describe("The emoji associated with the document, or null when not set.").nullable().optional(),
|
|
305
|
+
text: z.string().describe("The markdown document body returned by Outline.").optional(),
|
|
306
|
+
urlId: z.string().describe("The short document URL identifier returned by Outline.").optional(),
|
|
307
|
+
pinned: z.boolean().describe("Whether the document is pinned.").optional(),
|
|
308
|
+
templateId: z.uuid().describe("The template identifier when the document was created from a template, or null when not set.").nullable().optional(),
|
|
309
|
+
revision: z.number().describe("The current document revision number.").optional(),
|
|
310
|
+
createdAt: z.iso.datetime({ offset: true }).describe("The ISO timestamp when the document was created.").optional(),
|
|
311
|
+
createdBy: outlineUser.optional(),
|
|
312
|
+
updatedAt: z.iso.datetime({ offset: true }).describe("The ISO timestamp when the document was last updated.").optional(),
|
|
313
|
+
updatedBy: outlineUser.optional(),
|
|
314
|
+
publishedAt: z.iso.datetime({ offset: true }).describe("The ISO timestamp when the document was published, or null when it is a draft.").nullable().optional(),
|
|
315
|
+
dataAttributes: z.array(z.strictObject({
|
|
316
|
+
dataAttributeId: z.uuid().describe("The unique identifier for the associated data attribute."),
|
|
317
|
+
value: z.union([z.string().describe("A string data attribute value."), z.boolean().describe("A boolean data attribute value."), z.number().describe("A numeric data attribute value.")]).describe("A data attribute value returned by Outline, which may be string, boolean, or number."),
|
|
318
|
+
updatedAt: z.iso.datetime({ offset: true }).describe("The ISO timestamp when this data attribute value was last updated.")
|
|
319
|
+
}).describe("One document data attribute returned by Outline.")).describe("The data attributes attached to the document.").nullable().optional(),
|
|
320
|
+
archivedAt: z.iso.datetime({ offset: true }).describe("The ISO timestamp when the document was archived, or null when active.").nullable().optional(),
|
|
321
|
+
deletedAt: z.iso.datetime({ offset: true }).describe("The ISO timestamp when the document was deleted, or null when active.").nullable().optional(),
|
|
322
|
+
raw: z.looseObject({}).describe("The raw document object returned by Outline.").optional()
|
|
323
|
+
}).describe("One Outline document returned by document endpoints.");
|
|
324
|
+
var getDocumentInput = z.strictObject({
|
|
325
|
+
id: z.string().min(1).describe("The document UUID or short urlId accepted by Outline. Provide at least one of id or shareId.").optional(),
|
|
326
|
+
shareId: z.string().min(1).describe("The share UUID used to resolve a shared document. Provide at least one of id or shareId.").optional()
|
|
327
|
+
}).refine(
|
|
328
|
+
(input) => input.id !== void 0 || input.shareId !== void 0,
|
|
329
|
+
{ message: "at least one of id or shareId is required", path: ["id"] }
|
|
330
|
+
).describe("Input parameters for retrieving one Outline document.");
|
|
331
|
+
var getDocumentOutput = z.strictObject({
|
|
332
|
+
document: outlineDocument
|
|
333
|
+
}).describe("The single Outline document response.");
|
|
334
|
+
|
|
335
|
+
// ../plugins/src/outline/schema.ts
|
|
336
|
+
var listCollectionsInput = z2.strictObject({
|
|
337
|
+
offset: z2.int().min(0).describe("The zero-based result offset to request.").optional(),
|
|
338
|
+
limit: z2.int().min(1).describe("The maximum number of results to request.").optional(),
|
|
339
|
+
sort: z2.string().min(1).describe("The field used to sort collection list results.").optional(),
|
|
340
|
+
direction: z2.enum(["ASC", "DESC"]).describe("The sort direction applied by Outline.").optional(),
|
|
341
|
+
query: z2.string().min(1).describe("Optional collection name query filter.").optional(),
|
|
342
|
+
statusFilter: z2.array(z2.enum(["archived"]).describe("One collection status filter accepted by Outline.")).describe("Optional collection statuses to include in the results.").optional()
|
|
343
|
+
}).describe("Input parameters for listing Outline collections.");
|
|
344
|
+
var listCollectionsOutput = z2.strictObject({
|
|
345
|
+
collections: z2.array(z2.strictObject({
|
|
346
|
+
id: z2.uuid().describe("The unique identifier for the collection."),
|
|
347
|
+
urlId: z2.string().min(1).describe("The short collection URL identifier.").optional(),
|
|
348
|
+
name: z2.string().min(1).describe("The collection name."),
|
|
349
|
+
description: z2.string().describe("The collection description, which may contain markdown.").optional(),
|
|
350
|
+
sort: z2.strictObject({
|
|
351
|
+
field: z2.string().describe("The collection sort field."),
|
|
352
|
+
direction: z2.enum(["asc", "desc"]).describe("The collection sort direction returned by Outline.")
|
|
353
|
+
}).describe("The collection sort metadata returned by Outline.").optional(),
|
|
354
|
+
index: z2.string().describe("The sidebar index for the collection.").optional(),
|
|
355
|
+
color: z2.string().describe("The HEX color associated with the collection.").optional(),
|
|
356
|
+
icon: z2.string().describe("The icon or emoji associated with the collection.").optional(),
|
|
357
|
+
permission: z2.enum(["read", "read_write"]).describe("The collection permission returned by Outline.").optional(),
|
|
358
|
+
sharing: z2.boolean().describe("Whether sharing is enabled for the collection.").optional(),
|
|
359
|
+
createdAt: z2.iso.datetime({ offset: true }).describe("The ISO timestamp when the collection was created."),
|
|
360
|
+
updatedAt: z2.iso.datetime({ offset: true }).describe("The ISO timestamp when the collection was last updated."),
|
|
361
|
+
archivedAt: z2.iso.datetime({ offset: true }).describe("The ISO timestamp when the collection was archived, or null when active.").nullable().optional(),
|
|
362
|
+
deletedAt: z2.iso.datetime({ offset: true }).describe("The ISO timestamp when the collection was deleted, or null when active.").nullable().optional(),
|
|
363
|
+
raw: z2.looseObject({}).describe("The raw collection object returned by Outline.").optional()
|
|
364
|
+
}).describe("One Outline collection returned by collection endpoints.")).describe("The collections returned by Outline."),
|
|
365
|
+
pagination: z2.strictObject({
|
|
366
|
+
offset: z2.int().min(0).describe("The zero-based result offset."),
|
|
367
|
+
limit: z2.int().min(1).describe("The maximum number of results requested.")
|
|
368
|
+
}).describe("The pagination object returned by Outline list endpoints.")
|
|
369
|
+
}).describe("The paginated Outline collection list response.");
|
|
370
|
+
var getCollectionInput = z2.strictObject({
|
|
371
|
+
id: z2.uuid().describe("The unique identifier for the collection.")
|
|
372
|
+
}).describe("Input parameters for retrieving one Outline collection.");
|
|
373
|
+
var getCollectionOutput = z2.strictObject({
|
|
374
|
+
collection: z2.strictObject({
|
|
375
|
+
id: z2.uuid().describe("The unique identifier for the collection."),
|
|
376
|
+
urlId: z2.string().min(1).describe("The short collection URL identifier.").optional(),
|
|
377
|
+
name: z2.string().min(1).describe("The collection name."),
|
|
378
|
+
description: z2.string().describe("The collection description, which may contain markdown.").optional(),
|
|
379
|
+
sort: z2.strictObject({
|
|
380
|
+
field: z2.string().describe("The collection sort field."),
|
|
381
|
+
direction: z2.enum(["asc", "desc"]).describe("The collection sort direction returned by Outline.")
|
|
382
|
+
}).describe("The collection sort metadata returned by Outline.").optional(),
|
|
383
|
+
index: z2.string().describe("The sidebar index for the collection.").optional(),
|
|
384
|
+
color: z2.string().describe("The HEX color associated with the collection.").optional(),
|
|
385
|
+
icon: z2.string().describe("The icon or emoji associated with the collection.").optional(),
|
|
386
|
+
permission: z2.enum(["read", "read_write"]).describe("The collection permission returned by Outline.").optional(),
|
|
387
|
+
sharing: z2.boolean().describe("Whether sharing is enabled for the collection.").optional(),
|
|
388
|
+
createdAt: z2.iso.datetime({ offset: true }).describe("The ISO timestamp when the collection was created."),
|
|
389
|
+
updatedAt: z2.iso.datetime({ offset: true }).describe("The ISO timestamp when the collection was last updated."),
|
|
390
|
+
archivedAt: z2.iso.datetime({ offset: true }).describe("The ISO timestamp when the collection was archived, or null when active.").nullable().optional(),
|
|
391
|
+
deletedAt: z2.iso.datetime({ offset: true }).describe("The ISO timestamp when the collection was deleted, or null when active.").nullable().optional(),
|
|
392
|
+
raw: z2.looseObject({}).describe("The raw collection object returned by Outline.").optional()
|
|
393
|
+
}).describe("One Outline collection returned by collection endpoints.")
|
|
394
|
+
}).describe("The single Outline collection response.");
|
|
395
|
+
var listCollectionDocumentsInput = z2.strictObject({
|
|
396
|
+
id: z2.uuid().describe("The unique identifier for the collection.")
|
|
397
|
+
}).describe("Input parameters for retrieving one Outline collection document tree.");
|
|
398
|
+
var listCollectionDocumentsOutput = z2.strictObject({
|
|
399
|
+
tree: z2.array(z2.strictObject({
|
|
400
|
+
id: z2.uuid().describe("The unique identifier for the document."),
|
|
401
|
+
title: z2.string().min(1).describe("The document title."),
|
|
402
|
+
url: z2.string().describe("The document URL path returned by Outline."),
|
|
403
|
+
children: z2.array(z2.looseObject({}).describe("One child navigation node.")).describe("The child nodes nested under this document.")
|
|
404
|
+
}).describe("One node in the Outline collection document tree.")).describe("The document tree returned for the collection.")
|
|
405
|
+
}).describe("The Outline collection document tree response.");
|
|
406
|
+
var listDocumentsInput = z2.strictObject({
|
|
407
|
+
offset: z2.int().min(0).describe("The zero-based result offset to request.").optional(),
|
|
408
|
+
limit: z2.int().min(1).describe("The maximum number of results to request.").optional(),
|
|
409
|
+
sort: z2.string().min(1).describe("The field used to sort document list results.").optional(),
|
|
410
|
+
direction: z2.enum(["ASC", "DESC"]).describe("The sort direction applied by Outline.").optional(),
|
|
411
|
+
collectionId: z2.uuid().describe("Optional collection UUID used to restrict the document list.").optional(),
|
|
412
|
+
userId: z2.uuid().describe("Optional user UUID used to restrict the document list.").optional(),
|
|
413
|
+
backlinkDocumentId: z2.uuid().describe("Optional document UUID used to filter documents that backlink to the specified document.").optional(),
|
|
414
|
+
parentDocumentId: z2.uuid().describe("Optional parent document UUID used to list direct child documents.").optional(),
|
|
415
|
+
statusFilter: z2.array(z2.enum(["draft", "archived", "published"]).describe("One document status filter accepted by Outline.")).describe("Optional document statuses to include in the results.").optional()
|
|
416
|
+
}).describe("Input parameters for listing Outline documents.");
|
|
417
|
+
var listDocumentsOutput = z2.strictObject({
|
|
418
|
+
documents: z2.array(z2.strictObject({
|
|
419
|
+
id: z2.uuid().describe("The unique identifier for the document."),
|
|
420
|
+
collectionId: z2.uuid().describe("The unique identifier for the associated collection.").optional(),
|
|
421
|
+
parentDocumentId: z2.uuid().describe("The unique identifier for the parent document, or null when the document is at the root level.").nullable().optional(),
|
|
422
|
+
title: z2.string().describe("The document title."),
|
|
423
|
+
fullWidth: z2.boolean().describe("Whether the document is displayed in full width.").optional(),
|
|
424
|
+
emoji: z2.string().describe("The emoji associated with the document, or null when not set.").nullable().optional(),
|
|
425
|
+
text: z2.string().describe("The markdown document body returned by Outline.").optional(),
|
|
426
|
+
urlId: z2.string().describe("The short document URL identifier returned by Outline.").optional(),
|
|
427
|
+
pinned: z2.boolean().describe("Whether the document is pinned.").optional(),
|
|
428
|
+
templateId: z2.uuid().describe("The template identifier when the document was created from a template, or null when not set.").nullable().optional(),
|
|
429
|
+
revision: z2.number().describe("The current document revision number.").optional(),
|
|
430
|
+
createdAt: z2.iso.datetime({ offset: true }).describe("The ISO timestamp when the document was created.").optional(),
|
|
431
|
+
createdBy: z2.strictObject({
|
|
432
|
+
id: z2.uuid().describe("The unique identifier for the user."),
|
|
433
|
+
name: z2.string().min(1).describe("The display name of the user."),
|
|
434
|
+
avatarUrl: z2.url().describe("The avatar URL for the user.").optional(),
|
|
435
|
+
email: z2.email().describe("The email address for the user.").optional(),
|
|
436
|
+
role: z2.enum(["admin", "member", "viewer", "guest"]).describe("The Outline user role.").optional(),
|
|
437
|
+
isSuspended: z2.boolean().describe("Whether the user is suspended.").optional(),
|
|
438
|
+
lastActiveAt: z2.iso.datetime({ offset: true }).describe("The ISO timestamp when the user was last active.").optional(),
|
|
439
|
+
createdAt: z2.iso.datetime({ offset: true }).describe("The ISO timestamp when the user was created.").optional()
|
|
440
|
+
}).describe("One Outline user returned inside auth or document metadata.").optional(),
|
|
441
|
+
updatedAt: z2.iso.datetime({ offset: true }).describe("The ISO timestamp when the document was last updated.").optional(),
|
|
442
|
+
updatedBy: z2.strictObject({
|
|
443
|
+
id: z2.uuid().describe("The unique identifier for the user."),
|
|
444
|
+
name: z2.string().min(1).describe("The display name of the user."),
|
|
445
|
+
avatarUrl: z2.url().describe("The avatar URL for the user.").optional(),
|
|
446
|
+
email: z2.email().describe("The email address for the user.").optional(),
|
|
447
|
+
role: z2.enum(["admin", "member", "viewer", "guest"]).describe("The Outline user role.").optional(),
|
|
448
|
+
isSuspended: z2.boolean().describe("Whether the user is suspended.").optional(),
|
|
449
|
+
lastActiveAt: z2.iso.datetime({ offset: true }).describe("The ISO timestamp when the user was last active.").optional(),
|
|
450
|
+
createdAt: z2.iso.datetime({ offset: true }).describe("The ISO timestamp when the user was created.").optional()
|
|
451
|
+
}).describe("One Outline user returned inside auth or document metadata.").optional(),
|
|
452
|
+
publishedAt: z2.iso.datetime({ offset: true }).describe("The ISO timestamp when the document was published, or null when it is a draft.").nullable().optional(),
|
|
453
|
+
dataAttributes: z2.array(z2.strictObject({
|
|
454
|
+
dataAttributeId: z2.uuid().describe("The unique identifier for the associated data attribute."),
|
|
455
|
+
value: z2.union([z2.string().describe("A string data attribute value."), z2.boolean().describe("A boolean data attribute value."), z2.number().describe("A numeric data attribute value.")]).describe("A data attribute value returned by Outline, which may be string, boolean, or number."),
|
|
456
|
+
updatedAt: z2.iso.datetime({ offset: true }).describe("The ISO timestamp when this data attribute value was last updated.")
|
|
457
|
+
}).describe("One document data attribute returned by Outline.")).describe("The data attributes attached to the document.").nullable().optional(),
|
|
458
|
+
archivedAt: z2.iso.datetime({ offset: true }).describe("The ISO timestamp when the document was archived, or null when active.").nullable().optional(),
|
|
459
|
+
deletedAt: z2.iso.datetime({ offset: true }).describe("The ISO timestamp when the document was deleted, or null when active.").nullable().optional(),
|
|
460
|
+
raw: z2.looseObject({}).describe("The raw document object returned by Outline.").optional()
|
|
461
|
+
}).describe("One Outline document returned by document endpoints.")).describe("The documents returned by Outline."),
|
|
462
|
+
pagination: z2.strictObject({
|
|
463
|
+
offset: z2.int().min(0).describe("The zero-based result offset."),
|
|
464
|
+
limit: z2.int().min(1).describe("The maximum number of results requested.")
|
|
465
|
+
}).describe("The pagination object returned by Outline list endpoints.")
|
|
466
|
+
}).describe("The paginated Outline document list response.");
|
|
467
|
+
var searchDocumentsInput = z2.strictObject({
|
|
468
|
+
offset: z2.int().min(0).describe("The zero-based result offset to request.").optional(),
|
|
469
|
+
limit: z2.int().min(1).describe("The maximum number of results to request.").optional(),
|
|
470
|
+
query: z2.string().min(1).describe("The keyword query used to search documents."),
|
|
471
|
+
userId: z2.uuid().describe("Optional user UUID used to filter by editor.").optional(),
|
|
472
|
+
collectionId: z2.uuid().describe("Optional collection UUID used to restrict search scope.").optional(),
|
|
473
|
+
documentId: z2.uuid().describe("Optional document UUID used to search within a document subtree.").optional(),
|
|
474
|
+
statusFilter: z2.array(z2.enum(["draft", "archived", "published"]).describe("One document status filter accepted by Outline.")).describe("Optional document statuses to include in the search results.").optional(),
|
|
475
|
+
dateFilter: z2.enum(["day", "week", "month", "year"]).describe("The recency filter applied by Outline search.").optional(),
|
|
476
|
+
shareId: z2.string().min(1).describe("Optional share identifier used to restrict search to a shared collection or document.").optional(),
|
|
477
|
+
snippetMinWords: z2.int().min(0).describe("The minimum number of words to include in result snippets.").optional(),
|
|
478
|
+
snippetMaxWords: z2.int().min(0).describe("The maximum number of words to include in result snippets.").optional(),
|
|
479
|
+
sort: z2.enum(["relevance", "createdAt", "updatedAt", "title"]).describe("The sorting mode applied by Outline document search.").optional(),
|
|
480
|
+
direction: z2.enum(["ASC", "DESC"]).describe("The sort direction applied by Outline.").optional()
|
|
481
|
+
}).describe("Input parameters for searching Outline documents.");
|
|
482
|
+
var searchDocumentsOutput = z2.strictObject({
|
|
483
|
+
documents: z2.array(z2.strictObject({
|
|
484
|
+
id: z2.uuid().describe("The unique identifier for the document."),
|
|
485
|
+
collectionId: z2.uuid().describe("The unique identifier for the associated collection.").optional(),
|
|
486
|
+
parentDocumentId: z2.uuid().describe("The unique identifier for the parent document, or null when the document is at the root level.").nullable().optional(),
|
|
487
|
+
title: z2.string().describe("The document title."),
|
|
488
|
+
fullWidth: z2.boolean().describe("Whether the document is displayed in full width.").optional(),
|
|
489
|
+
emoji: z2.string().describe("The emoji associated with the document, or null when not set.").nullable().optional(),
|
|
490
|
+
text: z2.string().describe("The markdown document body returned by Outline.").optional(),
|
|
491
|
+
urlId: z2.string().describe("The short document URL identifier returned by Outline.").optional(),
|
|
492
|
+
pinned: z2.boolean().describe("Whether the document is pinned.").optional(),
|
|
493
|
+
templateId: z2.uuid().describe("The template identifier when the document was created from a template, or null when not set.").nullable().optional(),
|
|
494
|
+
revision: z2.number().describe("The current document revision number.").optional(),
|
|
495
|
+
createdAt: z2.iso.datetime({ offset: true }).describe("The ISO timestamp when the document was created.").optional(),
|
|
496
|
+
createdBy: z2.strictObject({
|
|
497
|
+
id: z2.uuid().describe("The unique identifier for the user."),
|
|
498
|
+
name: z2.string().min(1).describe("The display name of the user."),
|
|
499
|
+
avatarUrl: z2.url().describe("The avatar URL for the user.").optional(),
|
|
500
|
+
email: z2.email().describe("The email address for the user.").optional(),
|
|
501
|
+
role: z2.enum(["admin", "member", "viewer", "guest"]).describe("The Outline user role.").optional(),
|
|
502
|
+
isSuspended: z2.boolean().describe("Whether the user is suspended.").optional(),
|
|
503
|
+
lastActiveAt: z2.iso.datetime({ offset: true }).describe("The ISO timestamp when the user was last active.").optional(),
|
|
504
|
+
createdAt: z2.iso.datetime({ offset: true }).describe("The ISO timestamp when the user was created.").optional()
|
|
505
|
+
}).describe("One Outline user returned inside auth or document metadata.").optional(),
|
|
506
|
+
updatedAt: z2.iso.datetime({ offset: true }).describe("The ISO timestamp when the document was last updated.").optional(),
|
|
507
|
+
updatedBy: z2.strictObject({
|
|
508
|
+
id: z2.uuid().describe("The unique identifier for the user."),
|
|
509
|
+
name: z2.string().min(1).describe("The display name of the user."),
|
|
510
|
+
avatarUrl: z2.url().describe("The avatar URL for the user.").optional(),
|
|
511
|
+
email: z2.email().describe("The email address for the user.").optional(),
|
|
512
|
+
role: z2.enum(["admin", "member", "viewer", "guest"]).describe("The Outline user role.").optional(),
|
|
513
|
+
isSuspended: z2.boolean().describe("Whether the user is suspended.").optional(),
|
|
514
|
+
lastActiveAt: z2.iso.datetime({ offset: true }).describe("The ISO timestamp when the user was last active.").optional(),
|
|
515
|
+
createdAt: z2.iso.datetime({ offset: true }).describe("The ISO timestamp when the user was created.").optional()
|
|
516
|
+
}).describe("One Outline user returned inside auth or document metadata.").optional(),
|
|
517
|
+
publishedAt: z2.iso.datetime({ offset: true }).describe("The ISO timestamp when the document was published, or null when it is a draft.").nullable().optional(),
|
|
518
|
+
dataAttributes: z2.array(z2.strictObject({
|
|
519
|
+
dataAttributeId: z2.uuid().describe("The unique identifier for the associated data attribute."),
|
|
520
|
+
value: z2.union([z2.string().describe("A string data attribute value."), z2.boolean().describe("A boolean data attribute value."), z2.number().describe("A numeric data attribute value.")]).describe("A data attribute value returned by Outline, which may be string, boolean, or number."),
|
|
521
|
+
updatedAt: z2.iso.datetime({ offset: true }).describe("The ISO timestamp when this data attribute value was last updated.")
|
|
522
|
+
}).describe("One document data attribute returned by Outline.")).describe("The data attributes attached to the document.").nullable().optional(),
|
|
523
|
+
archivedAt: z2.iso.datetime({ offset: true }).describe("The ISO timestamp when the document was archived, or null when active.").nullable().optional(),
|
|
524
|
+
deletedAt: z2.iso.datetime({ offset: true }).describe("The ISO timestamp when the document was deleted, or null when active.").nullable().optional(),
|
|
525
|
+
raw: z2.looseObject({}).describe("The raw document object returned by Outline.").optional()
|
|
526
|
+
}).describe("One Outline document returned by document endpoints.")).describe("The matching documents returned by Outline search."),
|
|
527
|
+
pagination: z2.strictObject({
|
|
528
|
+
offset: z2.int().min(0).describe("The zero-based result offset."),
|
|
529
|
+
limit: z2.int().min(1).describe("The maximum number of results requested.")
|
|
530
|
+
}).describe("The pagination object returned by Outline list endpoints.")
|
|
531
|
+
}).describe("The paginated Outline document search response.");
|
|
532
|
+
var outlineActions = {
|
|
533
|
+
list_collections: {
|
|
534
|
+
description: "List Outline collections the authenticated user can access, with optional search, status filtering, pagination, and sorting.",
|
|
535
|
+
effect: "read",
|
|
536
|
+
inputSchema: listCollectionsInput,
|
|
537
|
+
outputSchema: z2.toJSONSchema(listCollectionsOutput, { io: "output", unrepresentable: "any" })
|
|
538
|
+
},
|
|
539
|
+
get_collection: {
|
|
540
|
+
description: "Retrieve one Outline collection by its UUID.",
|
|
541
|
+
effect: "read",
|
|
542
|
+
inputSchema: getCollectionInput,
|
|
543
|
+
outputSchema: z2.toJSONSchema(getCollectionOutput, { io: "output", unrepresentable: "any" })
|
|
544
|
+
},
|
|
545
|
+
list_collection_documents: {
|
|
546
|
+
description: "Retrieve the document tree for one Outline collection by UUID.",
|
|
547
|
+
effect: "read",
|
|
548
|
+
inputSchema: listCollectionDocumentsInput,
|
|
549
|
+
outputSchema: z2.toJSONSchema(listCollectionDocumentsOutput, { io: "output", unrepresentable: "any" })
|
|
550
|
+
},
|
|
551
|
+
list_documents: {
|
|
552
|
+
description: "List Outline documents visible to the authenticated user with optional collection, user, parent, status, pagination, and sorting filters.",
|
|
553
|
+
effect: "read",
|
|
554
|
+
inputSchema: listDocumentsInput,
|
|
555
|
+
outputSchema: z2.toJSONSchema(listDocumentsOutput, { io: "output", unrepresentable: "any" })
|
|
556
|
+
},
|
|
557
|
+
search_documents: {
|
|
558
|
+
description: "Search Outline documents by keyword with optional scope, recency, snippet, pagination, and sorting controls.",
|
|
559
|
+
effect: "read",
|
|
560
|
+
inputSchema: searchDocumentsInput,
|
|
561
|
+
outputSchema: z2.toJSONSchema(searchDocumentsOutput, { io: "output", unrepresentable: "any" })
|
|
562
|
+
},
|
|
563
|
+
get_document: {
|
|
564
|
+
description: "Retrieve one Outline document by UUID or urlId, or by shareId when reading through a share link context.",
|
|
565
|
+
effect: "read",
|
|
566
|
+
inputSchema: getDocumentInput,
|
|
567
|
+
outputSchema: z2.toJSONSchema(getDocumentOutput, { io: "output", unrepresentable: "any" })
|
|
568
|
+
}
|
|
569
|
+
};
|
|
570
|
+
|
|
571
|
+
// ../plugins/src/outline/index.ts
|
|
572
|
+
function createOutlinePlugin() {
|
|
573
|
+
return createProviderPlugin({
|
|
574
|
+
description: "Outline",
|
|
575
|
+
actions: outlineActions,
|
|
576
|
+
// 上游 credentialValidators 打的 `/auth.info` 没有对应 action;`list_collections` 同样
|
|
577
|
+
// 只读、无必填入参,且同样要求凭证有效,拿它当挂载时的凭证探针。
|
|
578
|
+
credentialProbe: "list_collections",
|
|
579
|
+
// baseUrl 非必配:缺省走 Outline 云端(app.getoutline.com),自建实例才配。
|
|
580
|
+
mountConfigFields: [{
|
|
581
|
+
key: "baseUrl",
|
|
582
|
+
label: "\u5B9E\u4F8B\u5730\u5740",
|
|
583
|
+
description: "\u81EA\u5EFA Outline \u7684\u6839\u5730\u5740;\u7559\u7A7A\u7528\u4E91\u7AEF app.getoutline.com"
|
|
584
|
+
}],
|
|
585
|
+
handlers: {
|
|
586
|
+
list_collections: listCollections,
|
|
587
|
+
get_collection: getCollection,
|
|
588
|
+
list_collection_documents: listCollectionDocuments,
|
|
589
|
+
list_documents: listDocuments,
|
|
590
|
+
search_documents: searchDocuments,
|
|
591
|
+
get_document: getDocument
|
|
592
|
+
}
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
var outline_default = createOutlinePlugin();
|
|
596
|
+
export {
|
|
597
|
+
createOutlinePlugin,
|
|
598
|
+
outline_default as default
|
|
599
|
+
};
|