runline 0.11.3 → 0.11.4
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/plugins/googleDocs/src/documents.js +91 -0
- package/dist/plugins/googleDocs/src/formatting.js +126 -0
- package/dist/plugins/googleDocs/src/images.js +66 -0
- package/dist/plugins/googleDocs/src/index.js +45 -1008
- package/dist/plugins/googleDocs/src/shared.js +110 -0
- package/dist/plugins/googleDocs/src/structure.js +392 -0
- package/dist/plugins/googleDocs/src/tables.js +390 -0
- package/dist/plugins/googleDocs/src/tabs.js +77 -0
- package/dist/plugins/googleDocs/src/text.js +313 -0
- package/dist/plugins/linear/src/attachments.js +36 -12
- package/dist/plugins/linear/src/comments.js +20 -8
- package/dist/plugins/linear/src/cycles.js +22 -8
- package/dist/plugins/linear/src/initiatives.js +59 -19
- package/dist/plugins/linear/src/issues.js +118 -40
- package/dist/plugins/linear/src/labels.js +31 -11
- package/dist/plugins/linear/src/organization.js +1 -1
- package/dist/plugins/linear/src/projects.js +171 -57
- package/dist/plugins/linear/src/shared.js +16 -5
- package/dist/plugins/linear/src/states.js +14 -6
- package/dist/plugins/linear/src/teams.js +35 -12
- package/dist/plugins/linear/src/users.js +7 -3
- package/dist/plugins/linear/src/views.js +29 -10
- package/dist/plugins/linear/src/webhooks.js +39 -13
- package/dist/plugins/salesforce/src/index.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
import { buildLocation, compact, extractDocumentId, hexToRgbF, location, runBatchUpdate, } from "./shared.js";
|
|
2
|
+
function tableStartLocation(p) {
|
|
3
|
+
return location(p.tableStartIndex, p.segmentId, p.tabId);
|
|
4
|
+
}
|
|
5
|
+
function tableCellLocation(p) {
|
|
6
|
+
return {
|
|
7
|
+
rowIndex: p.rowIndex,
|
|
8
|
+
columnIndex: p.columnIndex,
|
|
9
|
+
tableStartLocation: tableStartLocation(p),
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function point(value) {
|
|
13
|
+
return { magnitude: value, unit: "PT" };
|
|
14
|
+
}
|
|
15
|
+
export function registerTablesActions(rl) {
|
|
16
|
+
rl.registerAction("document.insertTable", {
|
|
17
|
+
description: "Insert an empty table with the given dimensions.",
|
|
18
|
+
inputSchema: {
|
|
19
|
+
document: { type: "string", required: true },
|
|
20
|
+
rows: { type: "number", required: true },
|
|
21
|
+
columns: { type: "number", required: true },
|
|
22
|
+
locationKind: { type: "string", required: false },
|
|
23
|
+
index: { type: "number", required: false },
|
|
24
|
+
segmentId: { type: "string", required: false },
|
|
25
|
+
tabId: { type: "string", required: false },
|
|
26
|
+
},
|
|
27
|
+
async execute(input, ctx) {
|
|
28
|
+
const p = (input ?? {});
|
|
29
|
+
const documentId = extractDocumentId(p.document);
|
|
30
|
+
const kind = p.locationKind ?? "location";
|
|
31
|
+
return runBatchUpdate(ctx, documentId, {
|
|
32
|
+
insertTable: {
|
|
33
|
+
rows: p.rows,
|
|
34
|
+
columns: p.columns,
|
|
35
|
+
...buildLocation(kind, p.segmentId, p.index, p.tabId),
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
rl.registerAction("document.insertTableRow", {
|
|
41
|
+
description: "Insert a table row above or below a cell in an existing table.",
|
|
42
|
+
inputSchema: {
|
|
43
|
+
document: { type: "string", required: true },
|
|
44
|
+
tableStartIndex: {
|
|
45
|
+
type: "number",
|
|
46
|
+
required: true,
|
|
47
|
+
description: "Document index where the table begins",
|
|
48
|
+
},
|
|
49
|
+
rowIndex: { type: "number", required: true },
|
|
50
|
+
columnIndex: { type: "number", required: true },
|
|
51
|
+
insertBelow: {
|
|
52
|
+
type: "boolean",
|
|
53
|
+
required: false,
|
|
54
|
+
description: "default: false (insert above)",
|
|
55
|
+
},
|
|
56
|
+
segmentId: { type: "string", required: false },
|
|
57
|
+
tabId: { type: "string", required: false },
|
|
58
|
+
},
|
|
59
|
+
async execute(input, ctx) {
|
|
60
|
+
const p = (input ?? {});
|
|
61
|
+
const documentId = extractDocumentId(p.document);
|
|
62
|
+
return runBatchUpdate(ctx, documentId, {
|
|
63
|
+
insertTableRow: {
|
|
64
|
+
insertBelow: p.insertBelow === true,
|
|
65
|
+
tableCellLocation: tableCellLocation(p),
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
rl.registerAction("document.deleteTableRow", {
|
|
71
|
+
description: "Delete a specific row from a table.",
|
|
72
|
+
inputSchema: {
|
|
73
|
+
document: { type: "string", required: true },
|
|
74
|
+
tableStartIndex: { type: "number", required: true },
|
|
75
|
+
rowIndex: { type: "number", required: true },
|
|
76
|
+
columnIndex: { type: "number", required: true },
|
|
77
|
+
segmentId: { type: "string", required: false },
|
|
78
|
+
tabId: { type: "string", required: false },
|
|
79
|
+
},
|
|
80
|
+
async execute(input, ctx) {
|
|
81
|
+
const p = (input ?? {});
|
|
82
|
+
const documentId = extractDocumentId(p.document);
|
|
83
|
+
return runBatchUpdate(ctx, documentId, {
|
|
84
|
+
deleteTableRow: {
|
|
85
|
+
tableCellLocation: tableCellLocation(p),
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
rl.registerAction("document.insertTableColumn", {
|
|
91
|
+
description: "Insert a column left or right of a cell.",
|
|
92
|
+
inputSchema: {
|
|
93
|
+
document: { type: "string", required: true },
|
|
94
|
+
tableStartIndex: { type: "number", required: true },
|
|
95
|
+
rowIndex: { type: "number", required: true },
|
|
96
|
+
columnIndex: { type: "number", required: true },
|
|
97
|
+
insertRight: {
|
|
98
|
+
type: "boolean",
|
|
99
|
+
required: false,
|
|
100
|
+
description: "default: false (insert left)",
|
|
101
|
+
},
|
|
102
|
+
segmentId: { type: "string", required: false },
|
|
103
|
+
tabId: { type: "string", required: false },
|
|
104
|
+
},
|
|
105
|
+
async execute(input, ctx) {
|
|
106
|
+
const p = (input ?? {});
|
|
107
|
+
const documentId = extractDocumentId(p.document);
|
|
108
|
+
return runBatchUpdate(ctx, documentId, {
|
|
109
|
+
insertTableColumn: {
|
|
110
|
+
insertRight: p.insertRight === true,
|
|
111
|
+
tableCellLocation: tableCellLocation(p),
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
rl.registerAction("document.deleteTableColumn", {
|
|
117
|
+
description: "Delete a specific column from a table.",
|
|
118
|
+
inputSchema: {
|
|
119
|
+
document: { type: "string", required: true },
|
|
120
|
+
tableStartIndex: { type: "number", required: true },
|
|
121
|
+
rowIndex: { type: "number", required: true },
|
|
122
|
+
columnIndex: { type: "number", required: true },
|
|
123
|
+
segmentId: { type: "string", required: false },
|
|
124
|
+
tabId: { type: "string", required: false },
|
|
125
|
+
},
|
|
126
|
+
async execute(input, ctx) {
|
|
127
|
+
const p = (input ?? {});
|
|
128
|
+
const documentId = extractDocumentId(p.document);
|
|
129
|
+
return runBatchUpdate(ctx, documentId, {
|
|
130
|
+
deleteTableColumn: {
|
|
131
|
+
tableCellLocation: tableCellLocation(p),
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
},
|
|
135
|
+
});
|
|
136
|
+
rl.registerAction("document.updateTableCellStyle", {
|
|
137
|
+
description: "Apply table-cell styling (background color, borders, padding) to a contiguous span of cells. Pass either a single cell via `tableStartLocation+rowIndex+columnIndex`, or a range via `tableStartLocation+rowSpan+columnSpan`.",
|
|
138
|
+
inputSchema: {
|
|
139
|
+
document: { type: "string", required: true },
|
|
140
|
+
tableStartIndex: {
|
|
141
|
+
type: "number",
|
|
142
|
+
required: true,
|
|
143
|
+
description: "The startIndex of the table element.",
|
|
144
|
+
},
|
|
145
|
+
rowIndex: { type: "number", required: true },
|
|
146
|
+
columnIndex: { type: "number", required: true },
|
|
147
|
+
rowSpan: { type: "number", required: false, default: 1 },
|
|
148
|
+
columnSpan: { type: "number", required: false, default: 1 },
|
|
149
|
+
backgroundColorHex: { type: "string", required: false },
|
|
150
|
+
paddingLeftPt: { type: "number", required: false },
|
|
151
|
+
paddingRightPt: { type: "number", required: false },
|
|
152
|
+
paddingTopPt: { type: "number", required: false },
|
|
153
|
+
paddingBottomPt: { type: "number", required: false },
|
|
154
|
+
contentAlignment: {
|
|
155
|
+
type: "string",
|
|
156
|
+
required: false,
|
|
157
|
+
description: "TOP | MIDDLE | BOTTOM",
|
|
158
|
+
},
|
|
159
|
+
segmentId: { type: "string", required: false },
|
|
160
|
+
tabId: { type: "string", required: false },
|
|
161
|
+
},
|
|
162
|
+
async execute(input, ctx) {
|
|
163
|
+
const p = (input ?? {});
|
|
164
|
+
const documentId = extractDocumentId(p.document);
|
|
165
|
+
const style = {};
|
|
166
|
+
const fields = [];
|
|
167
|
+
const pt = (n) => ({ magnitude: n, unit: "PT" });
|
|
168
|
+
if (p.backgroundColorHex) {
|
|
169
|
+
style.backgroundColor = {
|
|
170
|
+
color: { rgbColor: hexToRgbF(p.backgroundColorHex) },
|
|
171
|
+
};
|
|
172
|
+
fields.push("backgroundColor");
|
|
173
|
+
}
|
|
174
|
+
if (p.paddingLeftPt !== undefined) {
|
|
175
|
+
style.paddingLeft = pt(p.paddingLeftPt);
|
|
176
|
+
fields.push("paddingLeft");
|
|
177
|
+
}
|
|
178
|
+
if (p.paddingRightPt !== undefined) {
|
|
179
|
+
style.paddingRight = pt(p.paddingRightPt);
|
|
180
|
+
fields.push("paddingRight");
|
|
181
|
+
}
|
|
182
|
+
if (p.paddingTopPt !== undefined) {
|
|
183
|
+
style.paddingTop = pt(p.paddingTopPt);
|
|
184
|
+
fields.push("paddingTop");
|
|
185
|
+
}
|
|
186
|
+
if (p.paddingBottomPt !== undefined) {
|
|
187
|
+
style.paddingBottom = pt(p.paddingBottomPt);
|
|
188
|
+
fields.push("paddingBottom");
|
|
189
|
+
}
|
|
190
|
+
if (p.contentAlignment) {
|
|
191
|
+
style.contentAlignment = p.contentAlignment;
|
|
192
|
+
fields.push("contentAlignment");
|
|
193
|
+
}
|
|
194
|
+
if (fields.length === 0) {
|
|
195
|
+
throw new Error("googleDocs.document.updateTableCellStyle: at least one style property required");
|
|
196
|
+
}
|
|
197
|
+
return runBatchUpdate(ctx, documentId, [
|
|
198
|
+
{
|
|
199
|
+
updateTableCellStyle: {
|
|
200
|
+
tableRange: {
|
|
201
|
+
tableCellLocation: {
|
|
202
|
+
tableStartLocation: tableStartLocation(p),
|
|
203
|
+
rowIndex: p.rowIndex,
|
|
204
|
+
columnIndex: p.columnIndex,
|
|
205
|
+
},
|
|
206
|
+
rowSpan: p.rowSpan ?? 1,
|
|
207
|
+
columnSpan: p.columnSpan ?? 1,
|
|
208
|
+
},
|
|
209
|
+
tableCellStyle: style,
|
|
210
|
+
fields: fields.join(","),
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
]);
|
|
214
|
+
},
|
|
215
|
+
});
|
|
216
|
+
rl.registerAction("document.mergeTableCells", {
|
|
217
|
+
description: "Merge a contiguous block of cells in a table.",
|
|
218
|
+
inputSchema: {
|
|
219
|
+
document: { type: "string", required: true },
|
|
220
|
+
tableStartIndex: { type: "number", required: true },
|
|
221
|
+
rowIndex: { type: "number", required: true },
|
|
222
|
+
columnIndex: { type: "number", required: true },
|
|
223
|
+
rowSpan: { type: "number", required: true },
|
|
224
|
+
columnSpan: { type: "number", required: true },
|
|
225
|
+
segmentId: { type: "string", required: false },
|
|
226
|
+
tabId: { type: "string", required: false },
|
|
227
|
+
},
|
|
228
|
+
async execute(input, ctx) {
|
|
229
|
+
const p = (input ?? {});
|
|
230
|
+
const documentId = extractDocumentId(p.document);
|
|
231
|
+
return runBatchUpdate(ctx, documentId, [
|
|
232
|
+
{
|
|
233
|
+
mergeTableCells: {
|
|
234
|
+
tableRange: {
|
|
235
|
+
tableCellLocation: {
|
|
236
|
+
tableStartLocation: tableStartLocation(p),
|
|
237
|
+
rowIndex: p.rowIndex,
|
|
238
|
+
columnIndex: p.columnIndex,
|
|
239
|
+
},
|
|
240
|
+
rowSpan: p.rowSpan,
|
|
241
|
+
columnSpan: p.columnSpan,
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
]);
|
|
246
|
+
},
|
|
247
|
+
});
|
|
248
|
+
rl.registerAction("document.unmergeTableCells", {
|
|
249
|
+
description: "Unmerge a previously merged block of cells.",
|
|
250
|
+
inputSchema: {
|
|
251
|
+
document: { type: "string", required: true },
|
|
252
|
+
tableStartIndex: { type: "number", required: true },
|
|
253
|
+
rowIndex: { type: "number", required: true },
|
|
254
|
+
columnIndex: { type: "number", required: true },
|
|
255
|
+
rowSpan: { type: "number", required: true },
|
|
256
|
+
columnSpan: { type: "number", required: true },
|
|
257
|
+
segmentId: { type: "string", required: false },
|
|
258
|
+
tabId: { type: "string", required: false },
|
|
259
|
+
},
|
|
260
|
+
async execute(input, ctx) {
|
|
261
|
+
const p = (input ?? {});
|
|
262
|
+
const documentId = extractDocumentId(p.document);
|
|
263
|
+
return runBatchUpdate(ctx, documentId, [
|
|
264
|
+
{
|
|
265
|
+
unmergeTableCells: {
|
|
266
|
+
tableRange: {
|
|
267
|
+
tableCellLocation: {
|
|
268
|
+
tableStartLocation: tableStartLocation(p),
|
|
269
|
+
rowIndex: p.rowIndex,
|
|
270
|
+
columnIndex: p.columnIndex,
|
|
271
|
+
},
|
|
272
|
+
rowSpan: p.rowSpan,
|
|
273
|
+
columnSpan: p.columnSpan,
|
|
274
|
+
},
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
]);
|
|
278
|
+
},
|
|
279
|
+
});
|
|
280
|
+
rl.registerAction("document.updateTableColumnProperties", {
|
|
281
|
+
description: "Update table column properties such as width for selected columns or all columns.",
|
|
282
|
+
inputSchema: {
|
|
283
|
+
document: { type: "string", required: true },
|
|
284
|
+
tableStartIndex: { type: "number", required: true },
|
|
285
|
+
columnIndices: {
|
|
286
|
+
type: "array",
|
|
287
|
+
required: false,
|
|
288
|
+
description: "Zero-based column indices. Omit to update all columns.",
|
|
289
|
+
},
|
|
290
|
+
widthPt: {
|
|
291
|
+
type: "number",
|
|
292
|
+
required: false,
|
|
293
|
+
description: "Column width in points.",
|
|
294
|
+
},
|
|
295
|
+
fields: {
|
|
296
|
+
type: "string",
|
|
297
|
+
required: false,
|
|
298
|
+
description: "Field mask. Defaults to fields implied by supplied properties.",
|
|
299
|
+
},
|
|
300
|
+
segmentId: { type: "string", required: false },
|
|
301
|
+
tabId: { type: "string", required: false },
|
|
302
|
+
},
|
|
303
|
+
async execute(input, ctx) {
|
|
304
|
+
const p = (input ?? {});
|
|
305
|
+
const documentId = extractDocumentId(p.document);
|
|
306
|
+
const props = {};
|
|
307
|
+
const fields = [];
|
|
308
|
+
if (p.widthPt !== undefined) {
|
|
309
|
+
props.width = point(p.widthPt);
|
|
310
|
+
fields.push("width");
|
|
311
|
+
}
|
|
312
|
+
const mask = p.fields ?? fields.join(",");
|
|
313
|
+
if (!mask)
|
|
314
|
+
throw new Error("googleDocs.document.updateTableColumnProperties: fields or widthPt required");
|
|
315
|
+
return runBatchUpdate(ctx, documentId, {
|
|
316
|
+
updateTableColumnProperties: compact({
|
|
317
|
+
tableStartLocation: tableStartLocation(p),
|
|
318
|
+
columnIndices: p.columnIndices,
|
|
319
|
+
tableColumnProperties: props,
|
|
320
|
+
fields: mask,
|
|
321
|
+
}),
|
|
322
|
+
});
|
|
323
|
+
},
|
|
324
|
+
});
|
|
325
|
+
rl.registerAction("document.updateTableRowStyle", {
|
|
326
|
+
description: "Update table row style such as minimum row height for selected rows or all rows.",
|
|
327
|
+
inputSchema: {
|
|
328
|
+
document: { type: "string", required: true },
|
|
329
|
+
tableStartIndex: { type: "number", required: true },
|
|
330
|
+
rowIndices: {
|
|
331
|
+
type: "array",
|
|
332
|
+
required: false,
|
|
333
|
+
description: "Zero-based row indices. Omit to update all rows.",
|
|
334
|
+
},
|
|
335
|
+
minRowHeightPt: { type: "number", required: false },
|
|
336
|
+
fields: {
|
|
337
|
+
type: "string",
|
|
338
|
+
required: false,
|
|
339
|
+
description: "Field mask. Defaults to fields implied by supplied properties.",
|
|
340
|
+
},
|
|
341
|
+
segmentId: { type: "string", required: false },
|
|
342
|
+
tabId: { type: "string", required: false },
|
|
343
|
+
},
|
|
344
|
+
async execute(input, ctx) {
|
|
345
|
+
const p = (input ?? {});
|
|
346
|
+
const documentId = extractDocumentId(p.document);
|
|
347
|
+
const style = {};
|
|
348
|
+
const fields = [];
|
|
349
|
+
if (p.minRowHeightPt !== undefined) {
|
|
350
|
+
style.minRowHeight = point(p.minRowHeightPt);
|
|
351
|
+
fields.push("minRowHeight");
|
|
352
|
+
}
|
|
353
|
+
const mask = p.fields ?? fields.join(",");
|
|
354
|
+
if (!mask)
|
|
355
|
+
throw new Error("googleDocs.document.updateTableRowStyle: fields or minRowHeightPt required");
|
|
356
|
+
return runBatchUpdate(ctx, documentId, {
|
|
357
|
+
updateTableRowStyle: compact({
|
|
358
|
+
tableStartLocation: tableStartLocation(p),
|
|
359
|
+
rowIndices: p.rowIndices,
|
|
360
|
+
tableRowStyle: style,
|
|
361
|
+
fields: mask,
|
|
362
|
+
}),
|
|
363
|
+
});
|
|
364
|
+
},
|
|
365
|
+
});
|
|
366
|
+
rl.registerAction("document.pinTableHeaderRows", {
|
|
367
|
+
description: "Pin or unpin header rows in a table.",
|
|
368
|
+
inputSchema: {
|
|
369
|
+
document: { type: "string", required: true },
|
|
370
|
+
tableStartIndex: { type: "number", required: true },
|
|
371
|
+
pinnedHeaderRowsCount: {
|
|
372
|
+
type: "number",
|
|
373
|
+
required: true,
|
|
374
|
+
description: "Use 0 to unpin all header rows.",
|
|
375
|
+
},
|
|
376
|
+
segmentId: { type: "string", required: false },
|
|
377
|
+
tabId: { type: "string", required: false },
|
|
378
|
+
},
|
|
379
|
+
async execute(input, ctx) {
|
|
380
|
+
const p = (input ?? {});
|
|
381
|
+
const documentId = extractDocumentId(p.document);
|
|
382
|
+
return runBatchUpdate(ctx, documentId, {
|
|
383
|
+
pinTableHeaderRows: {
|
|
384
|
+
tableStartLocation: tableStartLocation(p),
|
|
385
|
+
pinnedHeaderRowsCount: p.pinnedHeaderRowsCount,
|
|
386
|
+
},
|
|
387
|
+
});
|
|
388
|
+
},
|
|
389
|
+
});
|
|
390
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { compact, extractDocumentId, runBatchUpdate } from "./shared.js";
|
|
2
|
+
function tabProperties(p) {
|
|
3
|
+
return compact({
|
|
4
|
+
tabId: p.tabId,
|
|
5
|
+
title: p.title,
|
|
6
|
+
index: p.index,
|
|
7
|
+
parentTabId: p.parentTabId,
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
export function registerTabActions(rl) {
|
|
11
|
+
rl.registerAction("document.addDocumentTab", {
|
|
12
|
+
description: "Add a Google Docs document tab, optionally at an index or under a parent tab.",
|
|
13
|
+
inputSchema: {
|
|
14
|
+
document: { type: "string", required: true },
|
|
15
|
+
title: { type: "string", required: false },
|
|
16
|
+
index: { type: "number", required: false },
|
|
17
|
+
parentTabId: { type: "string", required: false },
|
|
18
|
+
},
|
|
19
|
+
async execute(input, ctx) {
|
|
20
|
+
const p = (input ?? {});
|
|
21
|
+
const documentId = extractDocumentId(p.document);
|
|
22
|
+
return runBatchUpdate(ctx, documentId, {
|
|
23
|
+
addDocumentTab: { tabProperties: tabProperties(p) },
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
rl.registerAction("document.deleteTab", {
|
|
28
|
+
description: "Delete a Google Docs document tab by tab ID. Child tabs are deleted too.",
|
|
29
|
+
inputSchema: {
|
|
30
|
+
document: { type: "string", required: true },
|
|
31
|
+
tabId: { type: "string", required: true },
|
|
32
|
+
},
|
|
33
|
+
async execute(input, ctx) {
|
|
34
|
+
const p = (input ?? {});
|
|
35
|
+
const documentId = extractDocumentId(p.document);
|
|
36
|
+
return runBatchUpdate(ctx, documentId, {
|
|
37
|
+
deleteTab: { tabId: p.tabId },
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
rl.registerAction("document.updateDocumentTabProperties", {
|
|
42
|
+
description: "Update Google Docs tab properties such as title, index, or parent tab.",
|
|
43
|
+
inputSchema: {
|
|
44
|
+
document: { type: "string", required: true },
|
|
45
|
+
tabId: { type: "string", required: true },
|
|
46
|
+
title: { type: "string", required: false },
|
|
47
|
+
index: { type: "number", required: false },
|
|
48
|
+
parentTabId: { type: "string", required: false },
|
|
49
|
+
fields: {
|
|
50
|
+
type: "string",
|
|
51
|
+
required: false,
|
|
52
|
+
description: "Field mask. Defaults to fields implied by supplied properties.",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
async execute(input, ctx) {
|
|
56
|
+
const p = (input ?? {});
|
|
57
|
+
const documentId = extractDocumentId(p.document);
|
|
58
|
+
const fields = [];
|
|
59
|
+
if (p.title !== undefined)
|
|
60
|
+
fields.push("title");
|
|
61
|
+
if (p.index !== undefined)
|
|
62
|
+
fields.push("index");
|
|
63
|
+
if (p.parentTabId !== undefined)
|
|
64
|
+
fields.push("parentTabId");
|
|
65
|
+
const mask = p.fields ?? fields.join(",");
|
|
66
|
+
if (!mask) {
|
|
67
|
+
throw new Error("googleDocs.document.updateDocumentTabProperties: fields or tab property required");
|
|
68
|
+
}
|
|
69
|
+
return runBatchUpdate(ctx, documentId, {
|
|
70
|
+
updateDocumentTabProperties: {
|
|
71
|
+
tabProperties: tabProperties(p),
|
|
72
|
+
fields: mask,
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
}
|