@tool-bridge/server 0.1.0 → 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-6SMIQ6QU.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,1322 @@
|
|
|
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/googledocs/api/shared.ts
|
|
15
|
+
var SERVICE = "googledocs";
|
|
16
|
+
var DOCS_API_BASE = "https://docs.googleapis.com/v1";
|
|
17
|
+
var DRIVE_API_BASE = "https://www.googleapis.com/drive/v3";
|
|
18
|
+
var SHEETS_API_BASE = "https://sheets.googleapis.com/v4";
|
|
19
|
+
var REQUEST_TIMEOUT_MS = 3e4;
|
|
20
|
+
var MAX_ERROR_MESSAGE_LENGTH = 500;
|
|
21
|
+
var BASE64_CHUNK = 8192;
|
|
22
|
+
var RATE_LIMIT_REASONS = /* @__PURE__ */ new Set([
|
|
23
|
+
"rateLimitExceeded",
|
|
24
|
+
"userRateLimitExceeded",
|
|
25
|
+
"quotaExceeded",
|
|
26
|
+
"dailyLimitExceeded"
|
|
27
|
+
]);
|
|
28
|
+
var DRIVE_FILE_FIELDS = [
|
|
29
|
+
"id",
|
|
30
|
+
"name",
|
|
31
|
+
"mimeType",
|
|
32
|
+
"webViewLink",
|
|
33
|
+
"createdTime",
|
|
34
|
+
"modifiedTime",
|
|
35
|
+
"driveId",
|
|
36
|
+
"parents",
|
|
37
|
+
"owners(displayName,emailAddress,permissionId,photoLink)",
|
|
38
|
+
"shared",
|
|
39
|
+
"starred",
|
|
40
|
+
"trashed"
|
|
41
|
+
].join(",");
|
|
42
|
+
function record(value) {
|
|
43
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
44
|
+
}
|
|
45
|
+
function optionalText(value) {
|
|
46
|
+
return value === void 0 || value === "" ? void 0 : value;
|
|
47
|
+
}
|
|
48
|
+
function compact(input) {
|
|
49
|
+
return Object.fromEntries(
|
|
50
|
+
Object.entries(input).filter((entry) => entry[1] !== void 0)
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
function requireRecord(value, label) {
|
|
54
|
+
const result = record(value);
|
|
55
|
+
if (result === void 0) throw new TBError("unavailable", `${label}\u4E0D\u662F\u5BF9\u8C61`, { retryable: true });
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
function objectArray(value) {
|
|
59
|
+
if (!Array.isArray(value)) return [];
|
|
60
|
+
return value.flatMap((item) => {
|
|
61
|
+
const fields = record(item);
|
|
62
|
+
return fields === void 0 ? [] : [fields];
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function nestedText(value, path) {
|
|
66
|
+
let current = value;
|
|
67
|
+
for (const key of path) {
|
|
68
|
+
const fields = record(current);
|
|
69
|
+
if (fields === void 0) return void 0;
|
|
70
|
+
current = fields[key];
|
|
71
|
+
}
|
|
72
|
+
return typeof current === "string" ? optionalText(current) : void 0;
|
|
73
|
+
}
|
|
74
|
+
function nestedNumber(value, path) {
|
|
75
|
+
let current = value;
|
|
76
|
+
for (const key of path) {
|
|
77
|
+
const fields = record(current);
|
|
78
|
+
if (fields === void 0) return void 0;
|
|
79
|
+
current = fields[key];
|
|
80
|
+
}
|
|
81
|
+
return typeof current === "number" ? current : void 0;
|
|
82
|
+
}
|
|
83
|
+
function requireNonBlank(value, field) {
|
|
84
|
+
if (value === void 0 || value.trim() === "") {
|
|
85
|
+
throw new TBError("invalid_argument", `${field} is required`);
|
|
86
|
+
}
|
|
87
|
+
return value;
|
|
88
|
+
}
|
|
89
|
+
function extractId(value, pattern) {
|
|
90
|
+
let url;
|
|
91
|
+
try {
|
|
92
|
+
url = new URL(value);
|
|
93
|
+
} catch {
|
|
94
|
+
return value;
|
|
95
|
+
}
|
|
96
|
+
return url.toString().match(pattern)?.[1] ?? value;
|
|
97
|
+
}
|
|
98
|
+
function requireDocumentId(value, field) {
|
|
99
|
+
return extractId(requireNonBlank(value, field), /\/document\/d\/([^/?#]+)/u);
|
|
100
|
+
}
|
|
101
|
+
function requireSpreadsheetId(value, field) {
|
|
102
|
+
return extractId(requireNonBlank(value, field), /\/spreadsheets\/d\/([^/?#]+)/u);
|
|
103
|
+
}
|
|
104
|
+
function requireFileId(value, field) {
|
|
105
|
+
const raw = requireNonBlank(value, field);
|
|
106
|
+
const fromDocument = extractId(raw, /\/document\/d\/([^/?#]+)/u);
|
|
107
|
+
if (fromDocument !== raw) return fromDocument;
|
|
108
|
+
return extractId(raw, /\/spreadsheets\/d\/([^/?#]+)/u);
|
|
109
|
+
}
|
|
110
|
+
function buildUrl(url, query) {
|
|
111
|
+
const target = new URL(url);
|
|
112
|
+
for (const [key, value] of Object.entries(query ?? {})) {
|
|
113
|
+
if (value !== void 0) target.searchParams.set(key, value);
|
|
114
|
+
}
|
|
115
|
+
return target.toString();
|
|
116
|
+
}
|
|
117
|
+
function truncate(value) {
|
|
118
|
+
return value.length <= MAX_ERROR_MESSAGE_LENGTH ? value : `${value.slice(0, MAX_ERROR_MESSAGE_LENGTH)}\u2026`;
|
|
119
|
+
}
|
|
120
|
+
async function readError(response) {
|
|
121
|
+
const raw = await response.text().catch(() => "");
|
|
122
|
+
if (raw === "") return { message: `Google Docs \u8FD4\u56DE HTTP ${response.status}`, reasons: [] };
|
|
123
|
+
let payload;
|
|
124
|
+
try {
|
|
125
|
+
payload = JSON.parse(raw);
|
|
126
|
+
} catch {
|
|
127
|
+
return { message: truncate(raw), reasons: [] };
|
|
128
|
+
}
|
|
129
|
+
const body = record(payload);
|
|
130
|
+
const error = record(body?.error);
|
|
131
|
+
const reasons = Array.isArray(error?.errors) ? error.errors.map((item) => nestedText(record(item), ["reason"])).filter((item) => item !== void 0) : [];
|
|
132
|
+
const message = nestedText(error, ["message"]) ?? nestedText(body, ["error_description"]) ?? truncate(raw);
|
|
133
|
+
return { message, reasons };
|
|
134
|
+
}
|
|
135
|
+
async function docsError(response) {
|
|
136
|
+
const { message, reasons } = await readError(response);
|
|
137
|
+
if (response.status === 403 && reasons.some((reason) => RATE_LIMIT_REASONS.has(reason))) {
|
|
138
|
+
return upstreamError(429, message);
|
|
139
|
+
}
|
|
140
|
+
return upstreamError(response.status, message);
|
|
141
|
+
}
|
|
142
|
+
async function send(ctx, input) {
|
|
143
|
+
const accessToken = requireApiKey(ctx, SERVICE);
|
|
144
|
+
const hasBody = input.body !== void 0;
|
|
145
|
+
let response;
|
|
146
|
+
try {
|
|
147
|
+
response = await guardedFetch(buildUrl(input.url, input.query), {
|
|
148
|
+
method: input.method ?? (hasBody ? "POST" : "GET"),
|
|
149
|
+
headers: {
|
|
150
|
+
accept: "application/json",
|
|
151
|
+
authorization: `Bearer ${accessToken}`,
|
|
152
|
+
...hasBody ? { "content-type": "application/json" } : {}
|
|
153
|
+
},
|
|
154
|
+
body: hasBody ? JSON.stringify(input.body) : void 0,
|
|
155
|
+
// 不设超时会让一个挂死的端点拖住整个调用;上游同样给了 30s 的独立预算。
|
|
156
|
+
signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS)
|
|
157
|
+
});
|
|
158
|
+
} catch (error) {
|
|
159
|
+
if (error instanceof TBError) throw error;
|
|
160
|
+
if (error instanceof Error && error.name === "TimeoutError") {
|
|
161
|
+
throw upstreamError(504, `Google Docs \u8BF7\u6C42\u8D85\u65F6(${REQUEST_TIMEOUT_MS / 1e3} \u79D2)`);
|
|
162
|
+
}
|
|
163
|
+
const message = error instanceof Error ? error.message : "unknown network error";
|
|
164
|
+
throw upstreamError(502, `Google Docs \u8BF7\u6C42\u5931\u8D25:${message}`);
|
|
165
|
+
}
|
|
166
|
+
if (!response.ok) throw await docsError(response);
|
|
167
|
+
return response;
|
|
168
|
+
}
|
|
169
|
+
async function requestJson(ctx, input) {
|
|
170
|
+
const response = await send(ctx, input);
|
|
171
|
+
const body = await response.text();
|
|
172
|
+
if (body === "") {
|
|
173
|
+
throw new TBError("unavailable", "Google Docs \u5728\u5E94\u56DE JSON \u7684\u5730\u65B9\u56DE\u4E86\u7A7A\u54CD\u5E94\u4F53", { retryable: true });
|
|
174
|
+
}
|
|
175
|
+
try {
|
|
176
|
+
return JSON.parse(body);
|
|
177
|
+
} catch {
|
|
178
|
+
throw new TBError("unavailable", "Google Docs \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94", { retryable: true });
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
async function requestRecord(ctx, input) {
|
|
182
|
+
return requireRecord(await requestJson(ctx, input), "Google Docs \u54CD\u5E94");
|
|
183
|
+
}
|
|
184
|
+
function base64(bytes) {
|
|
185
|
+
let binary = "";
|
|
186
|
+
for (let offset = 0; offset < bytes.length; offset += BASE64_CHUNK) {
|
|
187
|
+
binary += String.fromCharCode(...bytes.subarray(offset, offset + BASE64_CHUNK));
|
|
188
|
+
}
|
|
189
|
+
return btoa(binary);
|
|
190
|
+
}
|
|
191
|
+
async function runBatch(ctx, documentId, requests, writeControl) {
|
|
192
|
+
const payload = await requestRecord(ctx, {
|
|
193
|
+
url: `${DOCS_API_BASE}/documents/${documentId}:batchUpdate`,
|
|
194
|
+
method: "POST",
|
|
195
|
+
body: compact({ requests, writeControl })
|
|
196
|
+
});
|
|
197
|
+
return {
|
|
198
|
+
documentId,
|
|
199
|
+
replies: objectArray(payload.replies),
|
|
200
|
+
// 上游只在 Google 真的回了 writeControl 时才透出这个键。
|
|
201
|
+
...record(payload.writeControl) === void 0 ? {} : { writeControl: record(payload.writeControl) }
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
async function runSingle(ctx, documentId, request, extra) {
|
|
205
|
+
const output = await runBatch(ctx, documentId, [request]);
|
|
206
|
+
return { ...output, ...extra };
|
|
207
|
+
}
|
|
208
|
+
function documentSummary(document) {
|
|
209
|
+
const documentId = typeof document.documentId === "string" ? document.documentId : "";
|
|
210
|
+
return {
|
|
211
|
+
documentId: extractId(documentId, /\/document\/d\/([^/?#]+)/u),
|
|
212
|
+
title: typeof document.title === "string" ? document.title : "",
|
|
213
|
+
revisionId: nestedText(document, ["revisionId"]) ?? null
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
function documentDetail(document) {
|
|
217
|
+
const containers = ["body", "headers", "footers", "footnotes", "documentStyle", "namedRanges", "inlineObjects", "lists"];
|
|
218
|
+
const detail = documentSummary(document);
|
|
219
|
+
for (const key of containers) {
|
|
220
|
+
const value = record(document[key]);
|
|
221
|
+
if (value !== void 0) detail[key] = value;
|
|
222
|
+
}
|
|
223
|
+
if (Array.isArray(document.tabs)) detail.tabs = objectArray(document.tabs);
|
|
224
|
+
return detail;
|
|
225
|
+
}
|
|
226
|
+
function driveFile(payload) {
|
|
227
|
+
const owners = Array.isArray(payload.owners) ? objectArray(payload.owners).map((owner) => ({
|
|
228
|
+
displayName: nestedText(owner, ["displayName"]) ?? null,
|
|
229
|
+
emailAddress: nestedText(owner, ["emailAddress"]) ?? null,
|
|
230
|
+
permissionId: nestedText(owner, ["permissionId"]) ?? null,
|
|
231
|
+
photoLink: nestedText(owner, ["photoLink"]) ?? null
|
|
232
|
+
})) : void 0;
|
|
233
|
+
const parents = Array.isArray(payload.parents) ? payload.parents.filter((item) => typeof item === "string") : void 0;
|
|
234
|
+
return compact({
|
|
235
|
+
id: typeof payload.id === "string" ? payload.id : "",
|
|
236
|
+
name: typeof payload.name === "string" ? payload.name : "",
|
|
237
|
+
mimeType: typeof payload.mimeType === "string" ? payload.mimeType : "",
|
|
238
|
+
webViewLink: nestedText(payload, ["webViewLink"]) ?? null,
|
|
239
|
+
createdTime: nestedText(payload, ["createdTime"]) ?? null,
|
|
240
|
+
modifiedTime: nestedText(payload, ["modifiedTime"]) ?? null,
|
|
241
|
+
driveId: nestedText(payload, ["driveId"]) ?? null,
|
|
242
|
+
parents,
|
|
243
|
+
owners,
|
|
244
|
+
// 三个布尔只在 Google 明确给了布尔时才透出(上游用 typeof 判,不给缺省值)。
|
|
245
|
+
shared: typeof payload.shared === "boolean" ? payload.shared : void 0,
|
|
246
|
+
starred: typeof payload.starred === "boolean" ? payload.starred : void 0,
|
|
247
|
+
trashed: typeof payload.trashed === "boolean" ? payload.trashed : void 0
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// ../plugins/src/googledocs/api/batch.ts
|
|
252
|
+
async function createFooter(input, ctx) {
|
|
253
|
+
const documentId = requireDocumentId(input.document_id, "document_id");
|
|
254
|
+
const output = await runSingle(ctx, documentId, {
|
|
255
|
+
createFooter: compact({
|
|
256
|
+
type: input.type,
|
|
257
|
+
sectionBreakLocation: input.section_break_location
|
|
258
|
+
})
|
|
259
|
+
});
|
|
260
|
+
return compact({
|
|
261
|
+
...output,
|
|
262
|
+
footerId: nestedText(output.replies[0], ["createFooter", "footerId"])
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
async function createFootnote(input, ctx) {
|
|
266
|
+
const documentId = requireDocumentId(input.documentId, "documentId");
|
|
267
|
+
const output = await runSingle(ctx, documentId, {
|
|
268
|
+
createFootnote: compact({
|
|
269
|
+
location: input.location,
|
|
270
|
+
endOfSegmentLocation: input.endOfSegmentLocation
|
|
271
|
+
})
|
|
272
|
+
});
|
|
273
|
+
return compact({
|
|
274
|
+
...output,
|
|
275
|
+
footnoteId: nestedText(output.replies[0], ["createFootnote", "footnoteId"])
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
async function createHeader(input, ctx) {
|
|
279
|
+
const documentId = requireDocumentId(input.documentId, "documentId");
|
|
280
|
+
const created = await runSingle(ctx, documentId, {
|
|
281
|
+
createHeader: compact({
|
|
282
|
+
type: optionalText(input.type),
|
|
283
|
+
sectionBreakLocation: input.sectionBreakLocation
|
|
284
|
+
})
|
|
285
|
+
});
|
|
286
|
+
const headerId = nestedText(created.replies[0], ["createHeader", "headerId"]);
|
|
287
|
+
const text = optionalText(input.text);
|
|
288
|
+
if (headerId === void 0 || text === void 0) {
|
|
289
|
+
return compact({ ...created, headerId });
|
|
290
|
+
}
|
|
291
|
+
const inserted = await runSingle(ctx, documentId, {
|
|
292
|
+
insertText: { text, endOfSegmentLocation: { segmentId: headerId } }
|
|
293
|
+
});
|
|
294
|
+
return compact({
|
|
295
|
+
documentId,
|
|
296
|
+
headerId,
|
|
297
|
+
insertedTextLength: text.length,
|
|
298
|
+
// 两步的 replies 首尾相接:调用方按 request 顺序读它们。
|
|
299
|
+
replies: [...created.replies, ...inserted.replies],
|
|
300
|
+
writeControl: inserted.writeControl
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
async function createNamedRange(input, ctx) {
|
|
304
|
+
const documentId = requireDocumentId(input.documentId, "documentId");
|
|
305
|
+
const output = await runSingle(ctx, documentId, {
|
|
306
|
+
createNamedRange: {
|
|
307
|
+
name: input.name,
|
|
308
|
+
range: compact({
|
|
309
|
+
startIndex: input.rangeStartIndex,
|
|
310
|
+
endIndex: input.rangeEndIndex,
|
|
311
|
+
segmentId: optionalText(input.rangeSegmentId)
|
|
312
|
+
})
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
return compact({
|
|
316
|
+
...output,
|
|
317
|
+
name: input.name,
|
|
318
|
+
namedRangeId: nestedText(output.replies[0], ["createNamedRange", "namedRangeId"])
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
function createParagraphBullets(input, ctx) {
|
|
322
|
+
return runSingle(ctx, requireDocumentId(input.document_id, "document_id"), {
|
|
323
|
+
createParagraphBullets: input.createParagraphBullets
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
function deleteContentRange(input, ctx) {
|
|
327
|
+
return runSingle(ctx, requireDocumentId(input.document_id, "document_id"), {
|
|
328
|
+
deleteContentRange: { range: input.range }
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
function deleteFooter(input, ctx) {
|
|
332
|
+
return runSingle(
|
|
333
|
+
ctx,
|
|
334
|
+
requireDocumentId(input.document_id, "document_id"),
|
|
335
|
+
{ deleteFooter: compact({ footerId: input.footer_id, tabId: optionalText(input.tab_id) }) },
|
|
336
|
+
// 上游把被删的 id 回显在出参里,方便调用方对账。
|
|
337
|
+
{ footerId: input.footer_id }
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
function deleteHeader(input, ctx) {
|
|
341
|
+
return runSingle(
|
|
342
|
+
ctx,
|
|
343
|
+
requireDocumentId(input.document_id, "document_id"),
|
|
344
|
+
{ deleteHeader: compact({ headerId: input.header_id, tabId: optionalText(input.tab_id) }) },
|
|
345
|
+
{ headerId: input.header_id }
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
function deleteNamedRange(input, ctx) {
|
|
349
|
+
return runSingle(ctx, requireDocumentId(input.document_id, "document_id"), {
|
|
350
|
+
deleteNamedRange: input.deleteNamedRange
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
function deleteParagraphBullets(input, ctx) {
|
|
354
|
+
return runSingle(ctx, requireDocumentId(input.document_id, "document_id"), {
|
|
355
|
+
deleteParagraphBullets: compact({ range: input.range, tabId: optionalText(input.tab_id) })
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
function deleteTableColumn(input, ctx) {
|
|
359
|
+
return runBatch(ctx, requireDocumentId(input.document_id, "document_id"), input.requests);
|
|
360
|
+
}
|
|
361
|
+
function deleteTableRow(input, ctx) {
|
|
362
|
+
return runSingle(ctx, requireDocumentId(input.documentId, "documentId"), {
|
|
363
|
+
deleteTableRow: { tableCellLocation: input.tableCellLocation }
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
async function insertInlineImage(input, ctx) {
|
|
367
|
+
const documentId = requireDocumentId(input.documentId, "documentId");
|
|
368
|
+
const output = await runSingle(ctx, documentId, {
|
|
369
|
+
insertInlineImage: compact({
|
|
370
|
+
uri: input.uri,
|
|
371
|
+
location: input.location,
|
|
372
|
+
objectSize: input.objectSize
|
|
373
|
+
})
|
|
374
|
+
});
|
|
375
|
+
return {
|
|
376
|
+
...output,
|
|
377
|
+
// 这个键上游明确给 null 兜底(不像 footerId 那样省掉):调用方要拿它接着改图片样式。
|
|
378
|
+
inlineObjectId: nestedText(output.replies[0], ["insertInlineImage", "objectId"]) ?? null
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
function insertPageBreak(input, ctx) {
|
|
382
|
+
return runSingle(ctx, requireDocumentId(input.documentId, "documentId"), {
|
|
383
|
+
insertPageBreak: input.insertPageBreak
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
function insertTable(input, ctx) {
|
|
387
|
+
const segmentId = optionalText(input.segmentId);
|
|
388
|
+
const tabId = optionalText(input.tabId);
|
|
389
|
+
const atEnd = input.insertAtEndOfSegment === true || input.index === void 0;
|
|
390
|
+
return runSingle(ctx, requireDocumentId(input.documentId, "documentId"), {
|
|
391
|
+
insertTable: compact({
|
|
392
|
+
rows: input.rows,
|
|
393
|
+
columns: input.columns,
|
|
394
|
+
location: atEnd ? void 0 : compact({ index: input.index, segmentId, tabId }),
|
|
395
|
+
endOfSegmentLocation: atEnd ? compact({ segmentId, tabId }) : void 0
|
|
396
|
+
})
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
function insertTableColumn(input, ctx) {
|
|
400
|
+
return runBatch(ctx, requireDocumentId(input.document_id, "document_id"), input.requests);
|
|
401
|
+
}
|
|
402
|
+
async function insertText(input, ctx) {
|
|
403
|
+
const documentId = requireDocumentId(input.document_id, "document_id");
|
|
404
|
+
const text = input.text_to_insert ?? "";
|
|
405
|
+
const segmentId = optionalText(input.segment_id);
|
|
406
|
+
const mode = input.append_to_end === true || input.insertion_index === void 0 ? "append" : "index";
|
|
407
|
+
const output = await runSingle(ctx, documentId, {
|
|
408
|
+
insertText: compact({
|
|
409
|
+
text,
|
|
410
|
+
location: mode === "index" ? compact({ index: input.insertion_index, segmentId }) : void 0,
|
|
411
|
+
endOfSegmentLocation: mode === "append" ? compact({ segmentId }) : void 0
|
|
412
|
+
})
|
|
413
|
+
});
|
|
414
|
+
return { ...output, insertedTextLength: text.length, mode };
|
|
415
|
+
}
|
|
416
|
+
async function replaceAllText(input, ctx) {
|
|
417
|
+
const documentId = requireDocumentId(input.document_id, "document_id");
|
|
418
|
+
const output = await runSingle(ctx, documentId, {
|
|
419
|
+
replaceAllText: compact({
|
|
420
|
+
containsText: compact({
|
|
421
|
+
text: input.find_text,
|
|
422
|
+
// matchCase 上游给了 false 兜底(Google 的缺省也是 false,写出来是为了让请求自解释)。
|
|
423
|
+
matchCase: input.match_case ?? false,
|
|
424
|
+
searchByRegex: input.search_by_regex
|
|
425
|
+
}),
|
|
426
|
+
replaceText: input.replace_text,
|
|
427
|
+
// 空数组不发:发过去等于"在零个 tab 里找",一个都不会替换。
|
|
428
|
+
tabsCriteria: input.tab_ids !== void 0 && input.tab_ids.length > 0 ? { tabIds: input.tab_ids } : void 0
|
|
429
|
+
})
|
|
430
|
+
});
|
|
431
|
+
return compact({
|
|
432
|
+
...output,
|
|
433
|
+
occurrencesChanged: nestedNumber(output.replies[0], ["replaceAllText", "occurrencesChanged"])
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
function replaceImage(input, ctx) {
|
|
437
|
+
return runSingle(ctx, requireDocumentId(input.document_id, "document_id"), {
|
|
438
|
+
replaceImage: input.replace_image
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
function unmergeTableCells(input, ctx) {
|
|
442
|
+
return runSingle(ctx, requireDocumentId(input.documentId, "documentId"), {
|
|
443
|
+
unmergeTableCells: { tableRange: input.tableRange }
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
function updateDocumentBatch(input, ctx) {
|
|
447
|
+
return runBatch(
|
|
448
|
+
ctx,
|
|
449
|
+
requireDocumentId(input.document_id, "document_id"),
|
|
450
|
+
input.requests,
|
|
451
|
+
input.write_control
|
|
452
|
+
);
|
|
453
|
+
}
|
|
454
|
+
async function updateDocumentStyle(input, ctx) {
|
|
455
|
+
const documentId = requireDocumentId(input.document_id, "document_id");
|
|
456
|
+
const documentStyle = input.document_style;
|
|
457
|
+
const fields = optionalText(input.fields) ?? (Object.keys(documentStyle).join(",") || "*");
|
|
458
|
+
const output = await runSingle(ctx, documentId, {
|
|
459
|
+
updateDocumentStyle: compact({
|
|
460
|
+
documentStyle,
|
|
461
|
+
fields,
|
|
462
|
+
tabId: optionalText(input.tab_id)
|
|
463
|
+
})
|
|
464
|
+
});
|
|
465
|
+
return { ...output, fields };
|
|
466
|
+
}
|
|
467
|
+
function updateExistingDocument(input, ctx) {
|
|
468
|
+
return runBatch(ctx, requireDocumentId(input.document_id, "document_id"), input.editDocs);
|
|
469
|
+
}
|
|
470
|
+
function updateTableRowStyle(input, ctx) {
|
|
471
|
+
return runSingle(ctx, requireDocumentId(input.documentId, "documentId"), {
|
|
472
|
+
updateTableRowStyle: input.updateTableRowStyle
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
// ../plugins/src/googledocs/api/plaintext.ts
|
|
477
|
+
function contentArray(container) {
|
|
478
|
+
const fields = record(container);
|
|
479
|
+
if (fields === void 0 || !Array.isArray(fields.content)) return [];
|
|
480
|
+
return fields.content.flatMap((item) => {
|
|
481
|
+
const element = record(item);
|
|
482
|
+
return element === void 0 ? [] : [element];
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
function objectArray2(value) {
|
|
486
|
+
if (!Array.isArray(value)) return [];
|
|
487
|
+
return value.flatMap((item) => {
|
|
488
|
+
const element = record(item);
|
|
489
|
+
return element === void 0 ? [] : [element];
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
function contentText(value) {
|
|
493
|
+
const content = record(value)?.content;
|
|
494
|
+
return typeof content === "string" ? content : "";
|
|
495
|
+
}
|
|
496
|
+
function renderParagraph(paragraph) {
|
|
497
|
+
return objectArray2(paragraph.elements).map((element) => {
|
|
498
|
+
if (element.textRun !== void 0) return contentText(element.textRun);
|
|
499
|
+
if (element.autoText !== void 0) return contentText(element.autoText);
|
|
500
|
+
if (element.pageBreak !== void 0 || element.columnBreak !== void 0) return "\n";
|
|
501
|
+
return "";
|
|
502
|
+
}).join("");
|
|
503
|
+
}
|
|
504
|
+
function renderStructuralElements(elements, options) {
|
|
505
|
+
let output = "";
|
|
506
|
+
for (const element of elements) {
|
|
507
|
+
if (element.paragraph !== void 0) {
|
|
508
|
+
output += renderParagraph(record(element.paragraph) ?? {});
|
|
509
|
+
continue;
|
|
510
|
+
}
|
|
511
|
+
if (element.table !== void 0 && options.includeTables) {
|
|
512
|
+
const table = objectArray2(record(element.table)?.tableRows).map((row) => objectArray2(row.tableCells).map((cell) => renderStructuralElements(contentArray(cell), options).trim()).join(options.tableCellDelimiter)).join(options.tableRowDelimiter);
|
|
513
|
+
if (table !== "") output += `${table}
|
|
514
|
+
`;
|
|
515
|
+
continue;
|
|
516
|
+
}
|
|
517
|
+
if (element.tableOfContents !== void 0) {
|
|
518
|
+
output += renderStructuralElements(contentArray(element.tableOfContents), options);
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
return output;
|
|
522
|
+
}
|
|
523
|
+
function renderTabRecursive(tab, options) {
|
|
524
|
+
const outputs = [];
|
|
525
|
+
const documentTab = record(tab.documentTab);
|
|
526
|
+
const title = typeof record(tab.tabProperties)?.title === "string" ? String(record(tab.tabProperties)?.title) : "";
|
|
527
|
+
const body = documentTab === void 0 ? "" : renderStructuralElements(contentArray(documentTab.body), options).trim();
|
|
528
|
+
if (body !== "") outputs.push(title === "" ? body : `[Tab: ${title}]
|
|
529
|
+
${body}`);
|
|
530
|
+
for (const child of objectArray2(tab.childTabs)) outputs.push(...renderTabRecursive(child, options));
|
|
531
|
+
return outputs;
|
|
532
|
+
}
|
|
533
|
+
function renderTabs(tabs, options) {
|
|
534
|
+
return objectArray2(tabs).flatMap((tab) => renderTabRecursive(tab, options)).filter((value) => value.trim() !== "").join("\n\n");
|
|
535
|
+
}
|
|
536
|
+
function renderNamedSegments(segments, options) {
|
|
537
|
+
return Object.entries(segments).map(([segmentId, segment]) => {
|
|
538
|
+
const text = renderStructuralElements(contentArray(segment), options).trim();
|
|
539
|
+
return text === "" ? "" : `(${segmentId})
|
|
540
|
+
${text}`;
|
|
541
|
+
}).filter((value) => value !== "").join("\n\n");
|
|
542
|
+
}
|
|
543
|
+
function renderDocumentPlainText(document, options) {
|
|
544
|
+
const sections = [];
|
|
545
|
+
const bodyText = options.includeTabsContent ? renderTabs(document.tabs, options) || renderStructuralElements(contentArray(document.body), options) : renderStructuralElements(contentArray(document.body), options);
|
|
546
|
+
if (bodyText.trim() !== "") sections.push(bodyText.trimEnd());
|
|
547
|
+
const headers = record(document.headers);
|
|
548
|
+
if (options.includeHeaders && headers !== void 0) {
|
|
549
|
+
const text = renderNamedSegments(headers, options);
|
|
550
|
+
if (text !== "") sections.push(`[Headers]
|
|
551
|
+
${text}`);
|
|
552
|
+
}
|
|
553
|
+
const footers = record(document.footers);
|
|
554
|
+
if (options.includeFooters && footers !== void 0) {
|
|
555
|
+
const text = renderNamedSegments(footers, options);
|
|
556
|
+
if (text !== "") sections.push(`[Footers]
|
|
557
|
+
${text}`);
|
|
558
|
+
}
|
|
559
|
+
const footnotes = record(document.footnotes);
|
|
560
|
+
if (options.includeFootnotes && footnotes !== void 0) {
|
|
561
|
+
const text = renderNamedSegments(footnotes, options);
|
|
562
|
+
if (text !== "") sections.push(`[Footnotes]
|
|
563
|
+
${text}`);
|
|
564
|
+
}
|
|
565
|
+
return sections.join("\n\n").trim();
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
// ../plugins/src/googledocs/api/documents.ts
|
|
569
|
+
async function createDocumentResource(ctx, title) {
|
|
570
|
+
return requestRecord(ctx, { url: `${DOCS_API_BASE}/documents`, method: "POST", body: { title } });
|
|
571
|
+
}
|
|
572
|
+
async function fetchDocument(ctx, documentId, includeTabs) {
|
|
573
|
+
return requestRecord(ctx, {
|
|
574
|
+
url: `${DOCS_API_BASE}/documents/${documentId}`,
|
|
575
|
+
query: includeTabs ? { includeTabsContent: "true" } : void 0
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
async function copyDocument(input, ctx) {
|
|
579
|
+
const fileId = requireDocumentId(input.document_id, "document_id");
|
|
580
|
+
const payload = await requestRecord(ctx, {
|
|
581
|
+
url: `${DRIVE_API_BASE}/files/${fileId}/copy`,
|
|
582
|
+
method: "POST",
|
|
583
|
+
query: {
|
|
584
|
+
// 缺省 true:共享云端硬盘里的文档也能复制,否则 Drive 直接说找不到文件。
|
|
585
|
+
supportsAllDrives: String(input.include_shared_drives ?? true),
|
|
586
|
+
fields: DRIVE_FILE_FIELDS
|
|
587
|
+
},
|
|
588
|
+
// 不给标题就让 Drive 用它自己的规则("Copy of …"),故这个键可以整个不出现。
|
|
589
|
+
body: compact({ name: optionalText(input.title) })
|
|
590
|
+
});
|
|
591
|
+
return driveFile(payload);
|
|
592
|
+
}
|
|
593
|
+
async function createDocument(input, ctx) {
|
|
594
|
+
const document = await createDocumentResource(ctx, input.title);
|
|
595
|
+
const summary = documentSummary(document);
|
|
596
|
+
const text = optionalText(input.text);
|
|
597
|
+
if (text === void 0) return { ...summary, insertedTextLength: 0 };
|
|
598
|
+
await runSingle(ctx, String(summary.documentId), {
|
|
599
|
+
insertText: { text, endOfSegmentLocation: { segmentId: "" } }
|
|
600
|
+
});
|
|
601
|
+
return { ...summary, insertedTextLength: text.length };
|
|
602
|
+
}
|
|
603
|
+
async function createBlankDocument(input, ctx) {
|
|
604
|
+
return documentSummary(await createDocumentResource(ctx, input.title));
|
|
605
|
+
}
|
|
606
|
+
async function exportDocumentAsPdf(input, ctx) {
|
|
607
|
+
const fileId = requireFileId(input.file_id, "file_id");
|
|
608
|
+
const response = await send(ctx, {
|
|
609
|
+
url: `${DRIVE_API_BASE}/files/${fileId}/export`,
|
|
610
|
+
query: { mimeType: "application/pdf" }
|
|
611
|
+
});
|
|
612
|
+
const bytes = new Uint8Array(await response.arrayBuffer());
|
|
613
|
+
const filename = optionalText(input.filename);
|
|
614
|
+
return {
|
|
615
|
+
fileId,
|
|
616
|
+
filename: filename === void 0 ? `${fileId}.pdf` : filename.endsWith(".pdf") ? filename : `${filename}.pdf`,
|
|
617
|
+
mimeType: "application/pdf",
|
|
618
|
+
dataBase64: base64(bytes),
|
|
619
|
+
sizeBytes: bytes.byteLength
|
|
620
|
+
};
|
|
621
|
+
}
|
|
622
|
+
async function getDocumentById(input, ctx) {
|
|
623
|
+
const documentId = requireDocumentId(input.id, "id");
|
|
624
|
+
return documentDetail(await fetchDocument(ctx, documentId, input.include_tabs_content === true));
|
|
625
|
+
}
|
|
626
|
+
async function getDocumentPlaintext(input, ctx) {
|
|
627
|
+
const documentId = requireDocumentId(input.document_id, "document_id");
|
|
628
|
+
const document = await fetchDocument(ctx, documentId, input.include_tabs_content === true);
|
|
629
|
+
return {
|
|
630
|
+
documentId,
|
|
631
|
+
title: nestedText(document, ["title"]) ?? null,
|
|
632
|
+
text: renderDocumentPlainText(document, {
|
|
633
|
+
// 默认值的不对称是上游的(见文件头第 5 条)。
|
|
634
|
+
includeTables: input.include_tables ?? true,
|
|
635
|
+
includeHeaders: input.include_headers ?? false,
|
|
636
|
+
includeFooters: input.include_footers ?? false,
|
|
637
|
+
includeFootnotes: input.include_footnotes ?? false,
|
|
638
|
+
includeTabsContent: input.include_tabs_content ?? false,
|
|
639
|
+
tableCellDelimiter: optionalText(input.table_cell_delimiter) ?? " ",
|
|
640
|
+
tableRowDelimiter: optionalText(input.table_row_delimiter) ?? "\n"
|
|
641
|
+
})
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
async function listSpreadsheetCharts(input, ctx) {
|
|
645
|
+
const spreadsheetId = requireSpreadsheetId(input.spreadsheet_id, "spreadsheet_id");
|
|
646
|
+
const payload = await requestRecord(ctx, {
|
|
647
|
+
url: `${SHEETS_API_BASE}/spreadsheets/${spreadsheetId}`,
|
|
648
|
+
// 字段掩码把响应压到只有图表元数据 —— 不给掩码 Sheets 会回整张表的所有单元格。
|
|
649
|
+
query: { fields: "spreadsheetId,properties(title),sheets(properties(sheetId,title),charts(chartId,spec,position))" }
|
|
650
|
+
});
|
|
651
|
+
return {
|
|
652
|
+
spreadsheetId,
|
|
653
|
+
title: nestedText(payload, ["properties", "title"]) ?? null,
|
|
654
|
+
sheets: objectArray(payload.sheets).map((sheet) => compact({
|
|
655
|
+
sheetId: nestedNumber(sheet, ["properties", "sheetId"]),
|
|
656
|
+
title: nestedText(sheet, ["properties", "title"]),
|
|
657
|
+
charts: objectArray(sheet.charts)
|
|
658
|
+
}))
|
|
659
|
+
};
|
|
660
|
+
}
|
|
661
|
+
function driveSearchQuery(query) {
|
|
662
|
+
if (/[=<>]/u.test(query) || /\b(?:and|or|not)\b/iu.test(query)) return query;
|
|
663
|
+
return `fullText contains '${query.replace(/'/gu, "\\'")}'`;
|
|
664
|
+
}
|
|
665
|
+
async function searchDocuments(input, ctx) {
|
|
666
|
+
const includeSharedDrives = String(input.include_shared_drives ?? true);
|
|
667
|
+
const parts = [
|
|
668
|
+
// 这一条固定带上:这个 action 只找 Docs 文档,不找别的 Drive 文件。
|
|
669
|
+
"mimeType='application/vnd.google-apps.document'",
|
|
670
|
+
input.include_trashed ?? false ? void 0 : "trashed=false",
|
|
671
|
+
input.starred_only === true ? "starred=true" : void 0,
|
|
672
|
+
input.shared_with_me === true ? "sharedWithMe=true" : void 0,
|
|
673
|
+
optionalText(input.created_after) === void 0 ? void 0 : `createdTime > '${input.created_after}'`,
|
|
674
|
+
optionalText(input.modified_after) === void 0 ? void 0 : `modifiedTime > '${input.modified_after}'`,
|
|
675
|
+
optionalText(input.query) === void 0 ? void 0 : driveSearchQuery(String(input.query))
|
|
676
|
+
].filter((part) => part !== void 0);
|
|
677
|
+
const payload = await requestRecord(ctx, {
|
|
678
|
+
url: `${DRIVE_API_BASE}/files`,
|
|
679
|
+
query: compact({
|
|
680
|
+
q: parts.join(" and "),
|
|
681
|
+
orderBy: optionalText(input.order_by),
|
|
682
|
+
pageToken: optionalText(input.page_token),
|
|
683
|
+
pageSize: String(input.max_results ?? 10),
|
|
684
|
+
fields: `nextPageToken,files(${DRIVE_FILE_FIELDS})`,
|
|
685
|
+
includeItemsFromAllDrives: includeSharedDrives,
|
|
686
|
+
supportsAllDrives: includeSharedDrives
|
|
687
|
+
})
|
|
688
|
+
});
|
|
689
|
+
return {
|
|
690
|
+
documents: objectArray(payload.files).map((file) => driveFile(file)),
|
|
691
|
+
nextPageToken: nestedText(payload, ["nextPageToken"]) ?? null
|
|
692
|
+
};
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
// ../plugins/src/googledocs/schema.ts
|
|
696
|
+
var copyDocumentInput = external_exports.strictObject({
|
|
697
|
+
document_id: external_exports.string().describe("The ID of the Google Docs document to copy."),
|
|
698
|
+
title: external_exports.string().describe("The title for the copied document.").optional(),
|
|
699
|
+
include_shared_drives: external_exports.boolean().describe("Whether to include shared drives when locating the source document.").optional()
|
|
700
|
+
}).describe("The input payload for this action.");
|
|
701
|
+
var copyDocumentOutput = external_exports.looseObject({
|
|
702
|
+
id: external_exports.string().describe("The ID of the file in Google Drive."),
|
|
703
|
+
name: external_exports.string().describe("The name of the file."),
|
|
704
|
+
mimeType: external_exports.string().describe("The MIME type of the file."),
|
|
705
|
+
webViewLink: external_exports.string().describe("A string value that may be null.").nullable().optional(),
|
|
706
|
+
createdTime: external_exports.string().describe("A string value that may be null.").nullable().optional(),
|
|
707
|
+
modifiedTime: external_exports.string().describe("A string value that may be null.").nullable().optional(),
|
|
708
|
+
driveId: external_exports.string().describe("A string value that may be null.").nullable().optional(),
|
|
709
|
+
parents: external_exports.array(external_exports.string()).describe("The IDs of the parent folders that contain the file.").optional(),
|
|
710
|
+
owners: external_exports.array(external_exports.looseObject({
|
|
711
|
+
displayName: external_exports.string().describe("A string value that may be null.").nullable().optional(),
|
|
712
|
+
emailAddress: external_exports.string().describe("A string value that may be null.").nullable().optional(),
|
|
713
|
+
permissionId: external_exports.string().describe("A string value that may be null.").nullable().optional(),
|
|
714
|
+
photoLink: external_exports.string().describe("A string value that may be null.").nullable().optional()
|
|
715
|
+
}).describe("Google Drive file owner.")).describe("The owners of the file.").optional(),
|
|
716
|
+
shared: external_exports.boolean().describe("Whether the file has been shared with others.").optional(),
|
|
717
|
+
starred: external_exports.boolean().describe("Whether the user has starred the file.").optional(),
|
|
718
|
+
trashed: external_exports.boolean().describe("Whether the file has been trashed.").optional()
|
|
719
|
+
}).describe("Google Drive file metadata.");
|
|
720
|
+
var createDocumentInput = external_exports.strictObject({
|
|
721
|
+
title: external_exports.string().describe("The title of the new document."),
|
|
722
|
+
text: external_exports.string().describe("Initial text to insert at the beginning of the document.").optional()
|
|
723
|
+
}).describe("The input payload for this action.");
|
|
724
|
+
var createDocumentOutput = external_exports.looseObject({
|
|
725
|
+
documentId: external_exports.string().describe("The ID of the Google Docs document."),
|
|
726
|
+
title: external_exports.string().describe("The title of the document."),
|
|
727
|
+
revisionId: external_exports.string().describe("A string value that may be null.").nullable(),
|
|
728
|
+
insertedTextLength: external_exports.int().describe("The number of characters inserted as initial text.")
|
|
729
|
+
}).describe("Google Docs action output.");
|
|
730
|
+
var createDocument2Input = external_exports.strictObject({
|
|
731
|
+
title: external_exports.string().describe("The title of the new document.")
|
|
732
|
+
}).describe("The input payload for this action.");
|
|
733
|
+
var createDocument2Output = external_exports.looseObject({
|
|
734
|
+
documentId: external_exports.string().describe("The ID of the Google Docs document."),
|
|
735
|
+
title: external_exports.string().describe("The title of the document."),
|
|
736
|
+
revisionId: external_exports.string().describe("A string value that may be null.").nullable().optional()
|
|
737
|
+
}).describe("Google Docs document summary.");
|
|
738
|
+
var createFooterInput = external_exports.strictObject({
|
|
739
|
+
document_id: external_exports.string().describe("The ID of the Google Docs document."),
|
|
740
|
+
type: external_exports.string().describe("The type of footer to create."),
|
|
741
|
+
section_break_location: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
742
|
+
}).describe("The input payload for this action.");
|
|
743
|
+
var createFooterOutput = external_exports.looseObject({
|
|
744
|
+
documentId: external_exports.string().describe("The ID of the document that was updated."),
|
|
745
|
+
replies: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).describe("An array of JSON-like objects."),
|
|
746
|
+
writeControl: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
747
|
+
}).describe("Google Docs batch update result.");
|
|
748
|
+
var createFootnoteInput = external_exports.strictObject({
|
|
749
|
+
documentId: external_exports.string().describe("The ID of the Google Docs document."),
|
|
750
|
+
location: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional(),
|
|
751
|
+
endOfSegmentLocation: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
752
|
+
}).describe("The input payload for this action.");
|
|
753
|
+
var createFootnoteOutput = external_exports.looseObject({
|
|
754
|
+
documentId: external_exports.string().describe("The ID of the document that was updated."),
|
|
755
|
+
replies: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).describe("An array of JSON-like objects."),
|
|
756
|
+
writeControl: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
757
|
+
}).describe("Google Docs batch update result.");
|
|
758
|
+
var createHeaderInput = external_exports.strictObject({
|
|
759
|
+
documentId: external_exports.string().describe("The ID of the Google Docs document."),
|
|
760
|
+
type: external_exports.string().describe("The type of header to create.").optional(),
|
|
761
|
+
text: external_exports.string().describe("Initial text to insert into the header.").optional(),
|
|
762
|
+
sectionBreakLocation: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
763
|
+
}).describe("The input payload for this action.");
|
|
764
|
+
var createHeaderOutput = external_exports.looseObject({
|
|
765
|
+
documentId: external_exports.string().describe("The ID of the document that was updated."),
|
|
766
|
+
replies: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).describe("An array of JSON-like objects."),
|
|
767
|
+
writeControl: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
768
|
+
}).describe("Google Docs batch update result.");
|
|
769
|
+
var createNamedRangeInput = external_exports.strictObject({
|
|
770
|
+
documentId: external_exports.string().describe("The ID of the Google Docs document."),
|
|
771
|
+
name: external_exports.string().min(1).max(256).describe("The name of the named range."),
|
|
772
|
+
rangeStartIndex: external_exports.int().describe("The zero-based start index of the range."),
|
|
773
|
+
rangeEndIndex: external_exports.int().describe("The zero-based end index of the range."),
|
|
774
|
+
rangeSegmentId: external_exports.string().describe("The ID of the segment the range belongs to.").optional()
|
|
775
|
+
}).describe("The input payload for this action.");
|
|
776
|
+
var createNamedRangeOutput = external_exports.looseObject({
|
|
777
|
+
documentId: external_exports.string().describe("The ID of the document that was updated."),
|
|
778
|
+
replies: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).describe("An array of JSON-like objects."),
|
|
779
|
+
writeControl: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
780
|
+
}).describe("Google Docs batch update result.");
|
|
781
|
+
var createParagraphBulletsInput = external_exports.strictObject({
|
|
782
|
+
document_id: external_exports.string().describe("The ID of the Google Docs document."),
|
|
783
|
+
createParagraphBullets: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")
|
|
784
|
+
}).describe("The input payload for this action.");
|
|
785
|
+
var createParagraphBulletsOutput = external_exports.looseObject({
|
|
786
|
+
documentId: external_exports.string().describe("The ID of the document that was updated."),
|
|
787
|
+
replies: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).describe("An array of JSON-like objects."),
|
|
788
|
+
writeControl: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
789
|
+
}).describe("Google Docs batch update result.");
|
|
790
|
+
var deleteContentRangeInput = external_exports.strictObject({
|
|
791
|
+
document_id: external_exports.string().describe("The ID of the Google Docs document."),
|
|
792
|
+
range: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")
|
|
793
|
+
}).describe("The input payload for this action.");
|
|
794
|
+
var deleteContentRangeOutput = external_exports.looseObject({
|
|
795
|
+
documentId: external_exports.string().describe("The ID of the document that was updated."),
|
|
796
|
+
replies: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).describe("An array of JSON-like objects."),
|
|
797
|
+
writeControl: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
798
|
+
}).describe("Google Docs batch update result.");
|
|
799
|
+
var deleteFooterInput = external_exports.strictObject({
|
|
800
|
+
document_id: external_exports.string().describe("The ID of the Google Docs document."),
|
|
801
|
+
footer_id: external_exports.string().describe("The ID of the footer to delete."),
|
|
802
|
+
tab_id: external_exports.string().describe("The ID of the tab containing the footer.").optional()
|
|
803
|
+
}).describe("The input payload for this action.");
|
|
804
|
+
var deleteFooterOutput = external_exports.looseObject({
|
|
805
|
+
documentId: external_exports.string().describe("The ID of the document that was updated."),
|
|
806
|
+
replies: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).describe("An array of JSON-like objects."),
|
|
807
|
+
writeControl: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
808
|
+
}).describe("Google Docs batch update result.");
|
|
809
|
+
var deleteHeaderInput = external_exports.strictObject({
|
|
810
|
+
document_id: external_exports.string().describe("The ID of the Google Docs document."),
|
|
811
|
+
header_id: external_exports.string().describe("The ID of the header to delete."),
|
|
812
|
+
tab_id: external_exports.string().describe("The ID of the tab containing the header.").optional()
|
|
813
|
+
}).describe("The input payload for this action.");
|
|
814
|
+
var deleteHeaderOutput = external_exports.looseObject({
|
|
815
|
+
documentId: external_exports.string().describe("The ID of the document that was updated."),
|
|
816
|
+
replies: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).describe("An array of JSON-like objects."),
|
|
817
|
+
writeControl: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
818
|
+
}).describe("Google Docs batch update result.");
|
|
819
|
+
var deleteNamedRangeInput = external_exports.strictObject({
|
|
820
|
+
document_id: external_exports.string().describe("The ID of the Google Docs document."),
|
|
821
|
+
deleteNamedRange: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")
|
|
822
|
+
}).describe("The input payload for this action.");
|
|
823
|
+
var deleteNamedRangeOutput = external_exports.looseObject({
|
|
824
|
+
documentId: external_exports.string().describe("The ID of the document that was updated."),
|
|
825
|
+
replies: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).describe("An array of JSON-like objects."),
|
|
826
|
+
writeControl: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
827
|
+
}).describe("Google Docs batch update result.");
|
|
828
|
+
var deleteParagraphBulletsInput = external_exports.strictObject({
|
|
829
|
+
document_id: external_exports.string().describe("The ID of the Google Docs document."),
|
|
830
|
+
range: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys."),
|
|
831
|
+
tab_id: external_exports.string().describe("The ID of the tab containing the range.").optional()
|
|
832
|
+
}).describe("The input payload for this action.");
|
|
833
|
+
var deleteParagraphBulletsOutput = external_exports.looseObject({
|
|
834
|
+
documentId: external_exports.string().describe("The ID of the document that was updated."),
|
|
835
|
+
replies: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).describe("An array of JSON-like objects."),
|
|
836
|
+
writeControl: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
837
|
+
}).describe("Google Docs batch update result.");
|
|
838
|
+
var deleteTableColumnInput = external_exports.strictObject({
|
|
839
|
+
document_id: external_exports.string().describe("The ID of the Google Docs document."),
|
|
840
|
+
requests: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).min(1).describe("DeleteTableColumnRequest objects.")
|
|
841
|
+
}).describe("The input payload for this action.");
|
|
842
|
+
var deleteTableColumnOutput = external_exports.looseObject({
|
|
843
|
+
documentId: external_exports.string().describe("The ID of the document that was updated."),
|
|
844
|
+
replies: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).describe("An array of JSON-like objects."),
|
|
845
|
+
writeControl: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
846
|
+
}).describe("Google Docs batch update result.");
|
|
847
|
+
var deleteTableRowInput = external_exports.strictObject({
|
|
848
|
+
documentId: external_exports.string().describe("The ID of the Google Docs document."),
|
|
849
|
+
tableCellLocation: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")
|
|
850
|
+
}).describe("The input payload for this action.");
|
|
851
|
+
var deleteTableRowOutput = external_exports.looseObject({
|
|
852
|
+
documentId: external_exports.string().describe("The ID of the document that was updated."),
|
|
853
|
+
replies: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).describe("An array of JSON-like objects."),
|
|
854
|
+
writeControl: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
855
|
+
}).describe("Google Docs batch update result.");
|
|
856
|
+
var exportDocumentAsPdfInput = external_exports.strictObject({
|
|
857
|
+
file_id: external_exports.string().describe("The ID of the Google Docs file to export."),
|
|
858
|
+
filename: external_exports.string().describe("The filename for the exported PDF.").optional()
|
|
859
|
+
}).describe("The input payload for this action.");
|
|
860
|
+
var exportDocumentAsPdfOutput = external_exports.looseObject({
|
|
861
|
+
fileId: external_exports.string().describe("The ID of the exported file in Google Drive."),
|
|
862
|
+
filename: external_exports.string().describe("The filename used for the exported PDF."),
|
|
863
|
+
mimeType: external_exports.literal("application/pdf").describe("The MIME type of the exported file."),
|
|
864
|
+
dataBase64: external_exports.string().describe("The Base64-encoded binary content of the exported PDF."),
|
|
865
|
+
sizeBytes: external_exports.int().describe("The size of the exported PDF in bytes.")
|
|
866
|
+
}).describe("Google Docs action output.");
|
|
867
|
+
var getDocumentByIdInput = external_exports.strictObject({
|
|
868
|
+
id: external_exports.string().describe("The ID of the Google Docs document to retrieve."),
|
|
869
|
+
include_tabs_content: external_exports.boolean().describe("Whether to populate the tabs field in the response.").optional()
|
|
870
|
+
}).describe("The input payload for this action.");
|
|
871
|
+
var getDocumentByIdOutput = external_exports.looseObject({
|
|
872
|
+
documentId: external_exports.string().describe("The ID of the Google Docs document."),
|
|
873
|
+
title: external_exports.string().describe("The title of the document."),
|
|
874
|
+
revisionId: external_exports.string().describe("A string value that may be null.").nullable().optional(),
|
|
875
|
+
body: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional(),
|
|
876
|
+
headers: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional(),
|
|
877
|
+
footers: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional(),
|
|
878
|
+
footnotes: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional(),
|
|
879
|
+
tabs: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).describe("An array of JSON-like objects.").optional(),
|
|
880
|
+
documentStyle: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional(),
|
|
881
|
+
namedRanges: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional(),
|
|
882
|
+
inlineObjects: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional(),
|
|
883
|
+
lists: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
884
|
+
}).describe("Google Docs document detail.");
|
|
885
|
+
var getDocumentPlaintextInput = external_exports.strictObject({
|
|
886
|
+
document_id: external_exports.string().describe("The ID of the Google Docs document."),
|
|
887
|
+
include_tables: external_exports.boolean().describe("Whether to include table content.").optional(),
|
|
888
|
+
include_footers: external_exports.boolean().describe("Whether to include footer content.").optional(),
|
|
889
|
+
include_headers: external_exports.boolean().describe("Whether to include header content.").optional(),
|
|
890
|
+
include_footnotes: external_exports.boolean().describe("Whether to include footnote content.").optional(),
|
|
891
|
+
include_tabs_content: external_exports.boolean().describe("Whether to include content from all tabs.").optional(),
|
|
892
|
+
table_row_delimiter: external_exports.string().describe("The delimiter to insert between table rows.").optional(),
|
|
893
|
+
table_cell_delimiter: external_exports.string().describe("The delimiter to insert between table cells.").optional()
|
|
894
|
+
}).describe("The input payload for this action.");
|
|
895
|
+
var getDocumentPlaintextOutput = external_exports.looseObject({
|
|
896
|
+
documentId: external_exports.string().describe("The ID of the Google Docs document."),
|
|
897
|
+
title: external_exports.string().describe("A string value that may be null.").nullable(),
|
|
898
|
+
text: external_exports.string().describe("The plain-text rendering of the document content.")
|
|
899
|
+
}).describe("Google Docs action output.");
|
|
900
|
+
var insertInlineImageInput = external_exports.strictObject({
|
|
901
|
+
documentId: external_exports.string().describe("The ID of the Google Docs document."),
|
|
902
|
+
uri: external_exports.url().describe("The publicly accessible URI of the image to insert."),
|
|
903
|
+
location: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys."),
|
|
904
|
+
objectSize: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
905
|
+
}).describe("The input payload for this action.");
|
|
906
|
+
var insertInlineImageOutput = external_exports.looseObject({
|
|
907
|
+
documentId: external_exports.string().describe("The ID of the document that was updated."),
|
|
908
|
+
replies: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).describe("An array of JSON-like objects."),
|
|
909
|
+
writeControl: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
910
|
+
}).describe("Google Docs batch update result.");
|
|
911
|
+
var insertPageBreakInput = external_exports.strictObject({
|
|
912
|
+
documentId: external_exports.string().describe("The ID of the Google Docs document."),
|
|
913
|
+
insertPageBreak: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")
|
|
914
|
+
}).describe("The input payload for this action.");
|
|
915
|
+
var insertPageBreakOutput = external_exports.looseObject({
|
|
916
|
+
documentId: external_exports.string().describe("The ID of the document that was updated."),
|
|
917
|
+
replies: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).describe("An array of JSON-like objects."),
|
|
918
|
+
writeControl: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
919
|
+
}).describe("Google Docs batch update result.");
|
|
920
|
+
var insertTableActionInput = external_exports.strictObject({
|
|
921
|
+
documentId: external_exports.string().describe("The ID of the Google Docs document."),
|
|
922
|
+
rows: external_exports.int().gt(0).describe("The number of rows in the table to insert."),
|
|
923
|
+
columns: external_exports.int().gt(0).describe("The number of columns in the table to insert."),
|
|
924
|
+
index: external_exports.int().describe("The zero-based index at which to insert the table.").optional(),
|
|
925
|
+
segmentId: external_exports.string().describe("The segment ID.").optional(),
|
|
926
|
+
tabId: external_exports.string().describe("The tab ID.").optional(),
|
|
927
|
+
insertAtEndOfSegment: external_exports.boolean().describe("Whether to insert at the end of the segment.").optional()
|
|
928
|
+
}).describe("The input payload for this action.");
|
|
929
|
+
var insertTableActionOutput = external_exports.looseObject({
|
|
930
|
+
documentId: external_exports.string().describe("The ID of the document that was updated."),
|
|
931
|
+
replies: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).describe("An array of JSON-like objects."),
|
|
932
|
+
writeControl: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
933
|
+
}).describe("Google Docs batch update result.");
|
|
934
|
+
var insertTableColumnInput = external_exports.strictObject({
|
|
935
|
+
document_id: external_exports.string().describe("The ID of the Google Docs document."),
|
|
936
|
+
requests: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).min(1).describe("InsertTableColumnRequest objects.")
|
|
937
|
+
}).describe("The input payload for this action.");
|
|
938
|
+
var insertTableColumnOutput = external_exports.looseObject({
|
|
939
|
+
documentId: external_exports.string().describe("The ID of the document that was updated."),
|
|
940
|
+
replies: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).describe("An array of JSON-like objects."),
|
|
941
|
+
writeControl: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
942
|
+
}).describe("Google Docs batch update result.");
|
|
943
|
+
var insertTextActionInput = external_exports.strictObject({
|
|
944
|
+
document_id: external_exports.string().describe("The ID of the Google Docs document."),
|
|
945
|
+
text_to_insert: external_exports.string().describe("The text to insert.").optional(),
|
|
946
|
+
append_to_end: external_exports.boolean().describe("Whether to append the text to the end.").optional(),
|
|
947
|
+
insertion_index: external_exports.int().describe("The zero-based index at which to insert the text.").optional(),
|
|
948
|
+
segment_id: external_exports.string().describe("The segment ID.").optional()
|
|
949
|
+
}).describe("The input payload for this action.");
|
|
950
|
+
var insertTextActionOutput = external_exports.looseObject({
|
|
951
|
+
documentId: external_exports.string().describe("The ID of the document that was updated."),
|
|
952
|
+
replies: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).describe("An array of JSON-like objects."),
|
|
953
|
+
writeControl: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
954
|
+
}).describe("Google Docs batch update result.");
|
|
955
|
+
var listSpreadsheetChartsInput = external_exports.strictObject({
|
|
956
|
+
spreadsheet_id: external_exports.string().describe("The ID of the Google Sheets spreadsheet.")
|
|
957
|
+
}).describe("The input payload for this action.");
|
|
958
|
+
var listSpreadsheetChartsOutput = external_exports.looseObject({
|
|
959
|
+
spreadsheetId: external_exports.string().describe("The ID of the Google Sheets spreadsheet."),
|
|
960
|
+
title: external_exports.string().describe("A string value that may be null.").nullable(),
|
|
961
|
+
sheets: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).describe("The sheets in the spreadsheet, each with their chart metadata.")
|
|
962
|
+
}).describe("Google Docs action output.");
|
|
963
|
+
var replaceAllTextInput = external_exports.strictObject({
|
|
964
|
+
document_id: external_exports.string().describe("The ID of the Google Docs document."),
|
|
965
|
+
find_text: external_exports.string().describe("The text or pattern to search for."),
|
|
966
|
+
replace_text: external_exports.string().describe("The replacement text."),
|
|
967
|
+
match_case: external_exports.boolean().describe("Whether the search should be case-sensitive.").optional(),
|
|
968
|
+
search_by_regex: external_exports.boolean().describe("Whether to treat find_text as a regular expression.").optional(),
|
|
969
|
+
tab_ids: external_exports.array(external_exports.string()).describe("The IDs of specific tabs to search.").optional()
|
|
970
|
+
}).describe("The input payload for this action.");
|
|
971
|
+
var replaceAllTextOutput = external_exports.looseObject({
|
|
972
|
+
documentId: external_exports.string().describe("The ID of the document that was updated."),
|
|
973
|
+
replies: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).describe("An array of JSON-like objects."),
|
|
974
|
+
writeControl: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
975
|
+
}).describe("Google Docs batch update result.");
|
|
976
|
+
var replaceImageInput = external_exports.strictObject({
|
|
977
|
+
document_id: external_exports.string().describe("The ID of the Google Docs document."),
|
|
978
|
+
replace_image: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")
|
|
979
|
+
}).describe("The input payload for this action.");
|
|
980
|
+
var replaceImageOutput = external_exports.looseObject({
|
|
981
|
+
documentId: external_exports.string().describe("The ID of the document that was updated."),
|
|
982
|
+
replies: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).describe("An array of JSON-like objects."),
|
|
983
|
+
writeControl: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
984
|
+
}).describe("Google Docs batch update result.");
|
|
985
|
+
var searchDocumentsInput = external_exports.strictObject({
|
|
986
|
+
query: external_exports.string().describe("A Google Drive query string or full-text search string.").optional(),
|
|
987
|
+
order_by: external_exports.string().describe("A comma-separated list of fields to sort results by.").optional(),
|
|
988
|
+
page_token: external_exports.string().describe("A page token from a previous search response.").optional(),
|
|
989
|
+
max_results: external_exports.int().min(1).max(100).describe("The maximum number of files to return.").optional(),
|
|
990
|
+
starred_only: external_exports.boolean().describe("Whether to return only starred files.").optional(),
|
|
991
|
+
created_after: external_exports.iso.datetime({ offset: true }).describe("Only files created after this time are returned.").optional(),
|
|
992
|
+
modified_after: external_exports.iso.datetime({ offset: true }).describe("Only files modified after this time are returned.").optional(),
|
|
993
|
+
shared_with_me: external_exports.boolean().describe("Whether to return only files shared directly with the user.").optional(),
|
|
994
|
+
include_trashed: external_exports.boolean().describe("Whether to include trashed files.").optional(),
|
|
995
|
+
include_shared_drives: external_exports.boolean().describe("Whether to include files from shared drives.").optional()
|
|
996
|
+
}).describe("The input payload for this action.");
|
|
997
|
+
var searchDocumentsOutput = external_exports.looseObject({
|
|
998
|
+
documents: external_exports.array(external_exports.looseObject({
|
|
999
|
+
id: external_exports.string().describe("The ID of the file in Google Drive."),
|
|
1000
|
+
name: external_exports.string().describe("The name of the file."),
|
|
1001
|
+
mimeType: external_exports.string().describe("The MIME type of the file."),
|
|
1002
|
+
webViewLink: external_exports.string().describe("A string value that may be null.").nullable().optional(),
|
|
1003
|
+
createdTime: external_exports.string().describe("A string value that may be null.").nullable().optional(),
|
|
1004
|
+
modifiedTime: external_exports.string().describe("A string value that may be null.").nullable().optional(),
|
|
1005
|
+
driveId: external_exports.string().describe("A string value that may be null.").nullable().optional(),
|
|
1006
|
+
parents: external_exports.array(external_exports.string()).describe("The IDs of the parent folders that contain the file.").optional(),
|
|
1007
|
+
owners: external_exports.array(external_exports.looseObject({
|
|
1008
|
+
displayName: external_exports.string().describe("A string value that may be null.").nullable().optional(),
|
|
1009
|
+
emailAddress: external_exports.string().describe("A string value that may be null.").nullable().optional(),
|
|
1010
|
+
permissionId: external_exports.string().describe("A string value that may be null.").nullable().optional(),
|
|
1011
|
+
photoLink: external_exports.string().describe("A string value that may be null.").nullable().optional()
|
|
1012
|
+
}).describe("Google Drive file owner.")).describe("The owners of the file.").optional(),
|
|
1013
|
+
shared: external_exports.boolean().describe("Whether the file has been shared with others.").optional(),
|
|
1014
|
+
starred: external_exports.boolean().describe("Whether the user has starred the file.").optional(),
|
|
1015
|
+
trashed: external_exports.boolean().describe("Whether the file has been trashed.").optional()
|
|
1016
|
+
}).describe("Google Drive file metadata.")).describe("The list of matching Google Docs files."),
|
|
1017
|
+
nextPageToken: external_exports.string().describe("A string value that may be null.").nullable()
|
|
1018
|
+
}).describe("Google Docs action output.");
|
|
1019
|
+
var unmergeTableCellsInput = external_exports.strictObject({
|
|
1020
|
+
documentId: external_exports.string().describe("The ID of the Google Docs document."),
|
|
1021
|
+
tableRange: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")
|
|
1022
|
+
}).describe("The input payload for this action.");
|
|
1023
|
+
var unmergeTableCellsOutput = external_exports.looseObject({
|
|
1024
|
+
documentId: external_exports.string().describe("The ID of the document that was updated."),
|
|
1025
|
+
replies: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).describe("An array of JSON-like objects."),
|
|
1026
|
+
writeControl: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
1027
|
+
}).describe("Google Docs batch update result.");
|
|
1028
|
+
var updateDocumentBatchInput = external_exports.strictObject({
|
|
1029
|
+
document_id: external_exports.string().describe("The ID of the Google Docs document."),
|
|
1030
|
+
requests: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).min(1).describe("Docs API Request objects."),
|
|
1031
|
+
write_control: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
1032
|
+
}).describe("The input payload for this action.");
|
|
1033
|
+
var updateDocumentBatchOutput = external_exports.looseObject({
|
|
1034
|
+
documentId: external_exports.string().describe("The ID of the document that was updated."),
|
|
1035
|
+
replies: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).describe("An array of JSON-like objects."),
|
|
1036
|
+
writeControl: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
1037
|
+
}).describe("Google Docs batch update result.");
|
|
1038
|
+
var updateDocumentStyleInput = external_exports.strictObject({
|
|
1039
|
+
document_id: external_exports.string().describe("The ID of the Google Docs document."),
|
|
1040
|
+
document_style: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys."),
|
|
1041
|
+
fields: external_exports.string().describe("A field mask specifying which style properties to update.").optional(),
|
|
1042
|
+
tab_id: external_exports.string().describe("The ID of the tab whose document style should be updated.").optional()
|
|
1043
|
+
}).describe("The input payload for this action.");
|
|
1044
|
+
var updateDocumentStyleOutput = external_exports.looseObject({
|
|
1045
|
+
documentId: external_exports.string().describe("The ID of the document that was updated."),
|
|
1046
|
+
replies: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).describe("An array of JSON-like objects."),
|
|
1047
|
+
writeControl: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
1048
|
+
}).describe("Google Docs batch update result.");
|
|
1049
|
+
var updateExistingDocumentInput = external_exports.strictObject({
|
|
1050
|
+
document_id: external_exports.string().describe("The ID of the Google Docs document."),
|
|
1051
|
+
editDocs: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).min(1).describe("Docs API Request objects describing the edits.")
|
|
1052
|
+
}).describe("The input payload for this action.");
|
|
1053
|
+
var updateExistingDocumentOutput = external_exports.looseObject({
|
|
1054
|
+
documentId: external_exports.string().describe("The ID of the document that was updated."),
|
|
1055
|
+
replies: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).describe("An array of JSON-like objects."),
|
|
1056
|
+
writeControl: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
1057
|
+
}).describe("Google Docs batch update result.");
|
|
1058
|
+
var updateTableRowStyleInput = external_exports.strictObject({
|
|
1059
|
+
documentId: external_exports.string().describe("The ID of the Google Docs document."),
|
|
1060
|
+
updateTableRowStyle: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")
|
|
1061
|
+
}).describe("The input payload for this action.");
|
|
1062
|
+
var updateTableRowStyleOutput = external_exports.looseObject({
|
|
1063
|
+
documentId: external_exports.string().describe("The ID of the document that was updated."),
|
|
1064
|
+
replies: external_exports.array(external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.")).describe("An array of JSON-like objects."),
|
|
1065
|
+
writeControl: external_exports.looseObject({}).describe("A JSON-like object with arbitrary string keys.").optional()
|
|
1066
|
+
}).describe("Google Docs batch update result.");
|
|
1067
|
+
var googledocsActions = {
|
|
1068
|
+
copy_document: {
|
|
1069
|
+
description: "Copy an existing Google Docs document through Google Drive.",
|
|
1070
|
+
effect: "write",
|
|
1071
|
+
inputSchema: copyDocumentInput,
|
|
1072
|
+
outputSchema: external_exports.toJSONSchema(copyDocumentOutput, { io: "output", unrepresentable: "any" })
|
|
1073
|
+
},
|
|
1074
|
+
create_document: {
|
|
1075
|
+
description: "Create a Google Docs document and optionally insert initial text at the beginning.",
|
|
1076
|
+
effect: "write",
|
|
1077
|
+
inputSchema: createDocumentInput,
|
|
1078
|
+
outputSchema: external_exports.toJSONSchema(createDocumentOutput, { io: "output", unrepresentable: "any" })
|
|
1079
|
+
},
|
|
1080
|
+
create_document2: {
|
|
1081
|
+
description: "Create a blank Google Docs document.",
|
|
1082
|
+
effect: "write",
|
|
1083
|
+
inputSchema: createDocument2Input,
|
|
1084
|
+
outputSchema: external_exports.toJSONSchema(createDocument2Output, { io: "output", unrepresentable: "any" })
|
|
1085
|
+
},
|
|
1086
|
+
create_footer: {
|
|
1087
|
+
description: "Create a footer in a Google Docs document.",
|
|
1088
|
+
effect: "write",
|
|
1089
|
+
inputSchema: createFooterInput,
|
|
1090
|
+
outputSchema: external_exports.toJSONSchema(createFooterOutput, { io: "output", unrepresentable: "any" })
|
|
1091
|
+
},
|
|
1092
|
+
create_footnote: {
|
|
1093
|
+
description: "Create a footnote in a Google Docs document.",
|
|
1094
|
+
effect: "write",
|
|
1095
|
+
inputSchema: createFootnoteInput,
|
|
1096
|
+
outputSchema: external_exports.toJSONSchema(createFootnoteOutput, { io: "output", unrepresentable: "any" })
|
|
1097
|
+
},
|
|
1098
|
+
create_header: {
|
|
1099
|
+
description: "Create a header in a Google Docs document and optionally insert initial text.",
|
|
1100
|
+
effect: "write",
|
|
1101
|
+
inputSchema: createHeaderInput,
|
|
1102
|
+
outputSchema: external_exports.toJSONSchema(createHeaderOutput, { io: "output", unrepresentable: "any" })
|
|
1103
|
+
},
|
|
1104
|
+
create_named_range: {
|
|
1105
|
+
description: "Create a named range over a specific span in a Google Docs document.",
|
|
1106
|
+
effect: "write",
|
|
1107
|
+
inputSchema: createNamedRangeInput,
|
|
1108
|
+
outputSchema: external_exports.toJSONSchema(createNamedRangeOutput, { io: "output", unrepresentable: "any" })
|
|
1109
|
+
},
|
|
1110
|
+
create_paragraph_bullets: {
|
|
1111
|
+
description: "Add bullets to paragraphs within a specified range in a Google Docs document.",
|
|
1112
|
+
effect: "write",
|
|
1113
|
+
inputSchema: createParagraphBulletsInput,
|
|
1114
|
+
outputSchema: external_exports.toJSONSchema(createParagraphBulletsOutput, { io: "output", unrepresentable: "any" })
|
|
1115
|
+
},
|
|
1116
|
+
delete_content_range: {
|
|
1117
|
+
description: "Delete a content range from a Google Docs document.",
|
|
1118
|
+
effect: "destructive",
|
|
1119
|
+
inputSchema: deleteContentRangeInput,
|
|
1120
|
+
outputSchema: external_exports.toJSONSchema(deleteContentRangeOutput, { io: "output", unrepresentable: "any" })
|
|
1121
|
+
},
|
|
1122
|
+
delete_footer: {
|
|
1123
|
+
description: "Delete a footer from a Google Docs document.",
|
|
1124
|
+
effect: "destructive",
|
|
1125
|
+
inputSchema: deleteFooterInput,
|
|
1126
|
+
outputSchema: external_exports.toJSONSchema(deleteFooterOutput, { io: "output", unrepresentable: "any" })
|
|
1127
|
+
},
|
|
1128
|
+
delete_header: {
|
|
1129
|
+
description: "Delete a header from a Google Docs document.",
|
|
1130
|
+
effect: "destructive",
|
|
1131
|
+
inputSchema: deleteHeaderInput,
|
|
1132
|
+
outputSchema: external_exports.toJSONSchema(deleteHeaderOutput, { io: "output", unrepresentable: "any" })
|
|
1133
|
+
},
|
|
1134
|
+
delete_named_range: {
|
|
1135
|
+
description: "Delete a named range from a Google Docs document.",
|
|
1136
|
+
effect: "destructive",
|
|
1137
|
+
inputSchema: deleteNamedRangeInput,
|
|
1138
|
+
outputSchema: external_exports.toJSONSchema(deleteNamedRangeOutput, { io: "output", unrepresentable: "any" })
|
|
1139
|
+
},
|
|
1140
|
+
delete_paragraph_bullets: {
|
|
1141
|
+
description: "Remove bullets from paragraphs within a specified range in a Google Docs document.",
|
|
1142
|
+
effect: "destructive",
|
|
1143
|
+
inputSchema: deleteParagraphBulletsInput,
|
|
1144
|
+
outputSchema: external_exports.toJSONSchema(deleteParagraphBulletsOutput, { io: "output", unrepresentable: "any" })
|
|
1145
|
+
},
|
|
1146
|
+
delete_table_column: {
|
|
1147
|
+
description: "Delete one or more table columns from a Google Docs document.",
|
|
1148
|
+
effect: "destructive",
|
|
1149
|
+
inputSchema: deleteTableColumnInput,
|
|
1150
|
+
outputSchema: external_exports.toJSONSchema(deleteTableColumnOutput, { io: "output", unrepresentable: "any" })
|
|
1151
|
+
},
|
|
1152
|
+
delete_table_row: {
|
|
1153
|
+
description: "Delete a table row from a Google Docs document.",
|
|
1154
|
+
effect: "destructive",
|
|
1155
|
+
inputSchema: deleteTableRowInput,
|
|
1156
|
+
outputSchema: external_exports.toJSONSchema(deleteTableRowOutput, { io: "output", unrepresentable: "any" })
|
|
1157
|
+
},
|
|
1158
|
+
export_document_as_pdf: {
|
|
1159
|
+
description: "Export a Google Docs file as a PDF through Google Drive.",
|
|
1160
|
+
effect: "read",
|
|
1161
|
+
inputSchema: exportDocumentAsPdfInput,
|
|
1162
|
+
outputSchema: external_exports.toJSONSchema(exportDocumentAsPdfOutput, { io: "output", unrepresentable: "any" })
|
|
1163
|
+
},
|
|
1164
|
+
get_document_by_id: {
|
|
1165
|
+
description: "Retrieve a Google Docs document by ID.",
|
|
1166
|
+
effect: "read",
|
|
1167
|
+
inputSchema: getDocumentByIdInput,
|
|
1168
|
+
outputSchema: external_exports.toJSONSchema(getDocumentByIdOutput, { io: "output", unrepresentable: "any" })
|
|
1169
|
+
},
|
|
1170
|
+
get_document_plaintext: {
|
|
1171
|
+
description: "Retrieve a Google Docs document and render it as best-effort plain text.",
|
|
1172
|
+
effect: "read",
|
|
1173
|
+
inputSchema: getDocumentPlaintextInput,
|
|
1174
|
+
outputSchema: external_exports.toJSONSchema(getDocumentPlaintextOutput, { io: "output", unrepresentable: "any" })
|
|
1175
|
+
},
|
|
1176
|
+
insert_inline_image: {
|
|
1177
|
+
description: "Insert an inline image from a URI at a specified location.",
|
|
1178
|
+
effect: "write",
|
|
1179
|
+
inputSchema: insertInlineImageInput,
|
|
1180
|
+
outputSchema: external_exports.toJSONSchema(insertInlineImageOutput, { io: "output", unrepresentable: "any" })
|
|
1181
|
+
},
|
|
1182
|
+
insert_page_break: {
|
|
1183
|
+
description: "Insert a page break at a specified location.",
|
|
1184
|
+
effect: "write",
|
|
1185
|
+
inputSchema: insertPageBreakInput,
|
|
1186
|
+
outputSchema: external_exports.toJSONSchema(insertPageBreakOutput, { io: "output", unrepresentable: "any" })
|
|
1187
|
+
},
|
|
1188
|
+
insert_table_action: {
|
|
1189
|
+
description: "Insert a table at a specific index or at the end of a segment.",
|
|
1190
|
+
effect: "write",
|
|
1191
|
+
inputSchema: insertTableActionInput,
|
|
1192
|
+
outputSchema: external_exports.toJSONSchema(insertTableActionOutput, { io: "output", unrepresentable: "any" })
|
|
1193
|
+
},
|
|
1194
|
+
insert_table_column: {
|
|
1195
|
+
description: "Insert one or more table columns at a specified location.",
|
|
1196
|
+
effect: "write",
|
|
1197
|
+
inputSchema: insertTableColumnInput,
|
|
1198
|
+
outputSchema: external_exports.toJSONSchema(insertTableColumnOutput, { io: "output", unrepresentable: "any" })
|
|
1199
|
+
},
|
|
1200
|
+
insert_text_action: {
|
|
1201
|
+
description: "Insert text at a specific index or append it to the end.",
|
|
1202
|
+
effect: "write",
|
|
1203
|
+
inputSchema: insertTextActionInput,
|
|
1204
|
+
outputSchema: external_exports.toJSONSchema(insertTextActionOutput, { io: "output", unrepresentable: "any" })
|
|
1205
|
+
},
|
|
1206
|
+
list_spreadsheet_charts: {
|
|
1207
|
+
description: "List chart metadata from a Google Sheets spreadsheet.",
|
|
1208
|
+
effect: "read",
|
|
1209
|
+
inputSchema: listSpreadsheetChartsInput,
|
|
1210
|
+
outputSchema: external_exports.toJSONSchema(listSpreadsheetChartsOutput, { io: "output", unrepresentable: "any" })
|
|
1211
|
+
},
|
|
1212
|
+
replace_all_text: {
|
|
1213
|
+
description: "Replace all matching text in a Google Docs document.",
|
|
1214
|
+
effect: "write",
|
|
1215
|
+
inputSchema: replaceAllTextInput,
|
|
1216
|
+
outputSchema: external_exports.toJSONSchema(replaceAllTextOutput, { io: "output", unrepresentable: "any" })
|
|
1217
|
+
},
|
|
1218
|
+
replace_image: {
|
|
1219
|
+
description: "Replace an existing image in a Google Docs document with a new image from a URI.",
|
|
1220
|
+
effect: "write",
|
|
1221
|
+
inputSchema: replaceImageInput,
|
|
1222
|
+
outputSchema: external_exports.toJSONSchema(replaceImageOutput, { io: "output", unrepresentable: "any" })
|
|
1223
|
+
},
|
|
1224
|
+
search_documents: {
|
|
1225
|
+
description: "Search Google Docs files with Google Drive filters.",
|
|
1226
|
+
effect: "read",
|
|
1227
|
+
inputSchema: searchDocumentsInput,
|
|
1228
|
+
outputSchema: external_exports.toJSONSchema(searchDocumentsOutput, { io: "output", unrepresentable: "any" })
|
|
1229
|
+
},
|
|
1230
|
+
unmerge_table_cells: {
|
|
1231
|
+
description: "Unmerge previously merged table cells in a Google Docs document.",
|
|
1232
|
+
effect: "write",
|
|
1233
|
+
inputSchema: unmergeTableCellsInput,
|
|
1234
|
+
outputSchema: external_exports.toJSONSchema(unmergeTableCellsOutput, { io: "output", unrepresentable: "any" })
|
|
1235
|
+
},
|
|
1236
|
+
update_document_batch: {
|
|
1237
|
+
description: "Apply raw Docs batchUpdate requests to a Google Docs document.",
|
|
1238
|
+
effect: "write",
|
|
1239
|
+
inputSchema: updateDocumentBatchInput,
|
|
1240
|
+
outputSchema: external_exports.toJSONSchema(updateDocumentBatchOutput, { io: "output", unrepresentable: "any" })
|
|
1241
|
+
},
|
|
1242
|
+
update_document_style: {
|
|
1243
|
+
description: "Update global document style settings.",
|
|
1244
|
+
effect: "write",
|
|
1245
|
+
inputSchema: updateDocumentStyleInput,
|
|
1246
|
+
outputSchema: external_exports.toJSONSchema(updateDocumentStyleOutput, { io: "output", unrepresentable: "any" })
|
|
1247
|
+
},
|
|
1248
|
+
update_existing_document: {
|
|
1249
|
+
description: "Apply one or more programmatic edits to an existing Google Docs document.",
|
|
1250
|
+
effect: "write",
|
|
1251
|
+
inputSchema: updateExistingDocumentInput,
|
|
1252
|
+
outputSchema: external_exports.toJSONSchema(updateExistingDocumentOutput, { io: "output", unrepresentable: "any" })
|
|
1253
|
+
},
|
|
1254
|
+
update_table_row_style: {
|
|
1255
|
+
description: "Update the style of a table row in a Google Docs document.",
|
|
1256
|
+
effect: "write",
|
|
1257
|
+
inputSchema: updateTableRowStyleInput,
|
|
1258
|
+
outputSchema: external_exports.toJSONSchema(updateTableRowStyleOutput, { io: "output", unrepresentable: "any" })
|
|
1259
|
+
}
|
|
1260
|
+
};
|
|
1261
|
+
|
|
1262
|
+
// ../plugins/src/googledocs/index.ts
|
|
1263
|
+
function createGoogledocsPlugin() {
|
|
1264
|
+
return createProviderPlugin({
|
|
1265
|
+
description: "Google Docs",
|
|
1266
|
+
oauth: {
|
|
1267
|
+
authorizationUrl: "https://accounts.google.com/o/oauth2/v2/auth",
|
|
1268
|
+
tokenUrl: "https://oauth2.googleapis.com/token",
|
|
1269
|
+
scopes: [
|
|
1270
|
+
"https://www.googleapis.com/auth/documents.readonly",
|
|
1271
|
+
"https://www.googleapis.com/auth/documents",
|
|
1272
|
+
"https://www.googleapis.com/auth/drive.file",
|
|
1273
|
+
"https://www.googleapis.com/auth/spreadsheets.readonly"
|
|
1274
|
+
],
|
|
1275
|
+
clientAuth: "client_secret_post",
|
|
1276
|
+
authorizationParams: {
|
|
1277
|
+
access_type: "offline",
|
|
1278
|
+
prompt: "consent"
|
|
1279
|
+
}
|
|
1280
|
+
},
|
|
1281
|
+
actions: googledocsActions,
|
|
1282
|
+
handlers: {
|
|
1283
|
+
copy_document: copyDocument,
|
|
1284
|
+
create_document: createDocument,
|
|
1285
|
+
create_document2: createBlankDocument,
|
|
1286
|
+
create_footer: createFooter,
|
|
1287
|
+
create_footnote: createFootnote,
|
|
1288
|
+
create_header: createHeader,
|
|
1289
|
+
create_named_range: createNamedRange,
|
|
1290
|
+
create_paragraph_bullets: createParagraphBullets,
|
|
1291
|
+
delete_content_range: deleteContentRange,
|
|
1292
|
+
delete_footer: deleteFooter,
|
|
1293
|
+
delete_header: deleteHeader,
|
|
1294
|
+
delete_named_range: deleteNamedRange,
|
|
1295
|
+
delete_paragraph_bullets: deleteParagraphBullets,
|
|
1296
|
+
delete_table_column: deleteTableColumn,
|
|
1297
|
+
delete_table_row: deleteTableRow,
|
|
1298
|
+
export_document_as_pdf: exportDocumentAsPdf,
|
|
1299
|
+
get_document_by_id: getDocumentById,
|
|
1300
|
+
get_document_plaintext: getDocumentPlaintext,
|
|
1301
|
+
insert_inline_image: insertInlineImage,
|
|
1302
|
+
insert_page_break: insertPageBreak,
|
|
1303
|
+
insert_table_action: insertTable,
|
|
1304
|
+
insert_table_column: insertTableColumn,
|
|
1305
|
+
insert_text_action: insertText,
|
|
1306
|
+
list_spreadsheet_charts: listSpreadsheetCharts,
|
|
1307
|
+
replace_all_text: replaceAllText,
|
|
1308
|
+
replace_image: replaceImage,
|
|
1309
|
+
search_documents: searchDocuments,
|
|
1310
|
+
unmerge_table_cells: unmergeTableCells,
|
|
1311
|
+
update_document_batch: updateDocumentBatch,
|
|
1312
|
+
update_document_style: updateDocumentStyle,
|
|
1313
|
+
update_existing_document: updateExistingDocument,
|
|
1314
|
+
update_table_row_style: updateTableRowStyle
|
|
1315
|
+
}
|
|
1316
|
+
});
|
|
1317
|
+
}
|
|
1318
|
+
var googledocs_default = createGoogledocsPlugin();
|
|
1319
|
+
export {
|
|
1320
|
+
createGoogledocsPlugin,
|
|
1321
|
+
googledocs_default as default
|
|
1322
|
+
};
|