@components-kit/open-workbook-protocol 0.1.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/LICENSE +21 -0
- package/README.md +20 -0
- package/dist/capabilities.d.ts +40 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/capabilities.js +16 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/collaboration.d.ts +298 -0
- package/dist/collaboration.d.ts.map +1 -0
- package/dist/collaboration.js +2 -0
- package/dist/collaboration.js.map +1 -0
- package/dist/errors.d.ts +30 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +32 -0
- package/dist/errors.js.map +1 -0
- package/dist/ids.d.ts +38 -0
- package/dist/ids.d.ts.map +1 -0
- package/dist/ids.js +7 -0
- package/dist/ids.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/json-rpc.d.ts +28 -0
- package/dist/json-rpc.d.ts.map +1 -0
- package/dist/json-rpc.js +4 -0
- package/dist/json-rpc.js.map +1 -0
- package/dist/operations.d.ts +1126 -0
- package/dist/operations.d.ts.map +1 -0
- package/dist/operations.js +2 -0
- package/dist/operations.js.map +1 -0
- package/dist/prompts.d.ts +11 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/prompts.js +22 -0
- package/dist/prompts.js.map +1 -0
- package/dist/resources.d.ts +10 -0
- package/dist/resources.d.ts.map +1 -0
- package/dist/resources.js +22 -0
- package/dist/resources.js.map +1 -0
- package/dist/tools.d.ts +33 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +687 -0
- package/dist/tools.js.map +1 -0
- package/dist/workbook.d.ts +80 -0
- package/dist/workbook.d.ts.map +1 -0
- package/dist/workbook.js +2 -0
- package/dist/workbook.js.map +1 -0
- package/package.json +51 -0
|
@@ -0,0 +1,1126 @@
|
|
|
1
|
+
import type { AgentId, BackupId, OperationId, PlanId, SnapshotId, TaskId, TemplateId, TransactionId, WorkbookId } from "./ids.js";
|
|
2
|
+
import type { A1Range, CellMatrix, RangeFingerprint, WorkbookFingerprint } from "./workbook.js";
|
|
3
|
+
import type { ExcelRuntimeError } from "./errors.js";
|
|
4
|
+
export type DestructiveLevel = "none" | "values" | "format" | "structure" | "workbook";
|
|
5
|
+
export interface OperationTelemetry {
|
|
6
|
+
durationMs?: number;
|
|
7
|
+
syncCount?: number;
|
|
8
|
+
payloadBytes?: number;
|
|
9
|
+
cellsRead?: number;
|
|
10
|
+
cellsWritten?: number;
|
|
11
|
+
rangeCount?: number;
|
|
12
|
+
chunkCount?: number;
|
|
13
|
+
engineName?: string;
|
|
14
|
+
engineVersion?: string;
|
|
15
|
+
warningCount?: number;
|
|
16
|
+
}
|
|
17
|
+
export interface OperationWarning {
|
|
18
|
+
code: string;
|
|
19
|
+
message: string;
|
|
20
|
+
target?: A1Range;
|
|
21
|
+
details?: Record<string, unknown>;
|
|
22
|
+
}
|
|
23
|
+
export interface OperationBase {
|
|
24
|
+
operationId: OperationId;
|
|
25
|
+
workbookId: WorkbookId;
|
|
26
|
+
destructiveLevel: DestructiveLevel;
|
|
27
|
+
reason: string;
|
|
28
|
+
}
|
|
29
|
+
export interface ReadFullOperation extends OperationBase {
|
|
30
|
+
kind: "range.read_full";
|
|
31
|
+
target: A1Range;
|
|
32
|
+
includeStyles?: boolean;
|
|
33
|
+
includeFormulas?: boolean;
|
|
34
|
+
includeValidation?: boolean;
|
|
35
|
+
includeComments?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface WriteValuesOperation extends OperationBase {
|
|
38
|
+
kind: "range.write_values";
|
|
39
|
+
target: A1Range;
|
|
40
|
+
values: CellMatrix;
|
|
41
|
+
preserveFormats: true;
|
|
42
|
+
}
|
|
43
|
+
export interface WriteFormulasOperation extends OperationBase {
|
|
44
|
+
kind: "range.write_formulas";
|
|
45
|
+
target: A1Range;
|
|
46
|
+
formulas: CellMatrix<string | null>;
|
|
47
|
+
preserveFormats: true;
|
|
48
|
+
}
|
|
49
|
+
export interface ClearValuesKeepFormatOperation extends OperationBase {
|
|
50
|
+
kind: "range.clear_values_keep_format";
|
|
51
|
+
target: A1Range;
|
|
52
|
+
}
|
|
53
|
+
export interface WriteNumberFormatsOperation extends OperationBase {
|
|
54
|
+
kind: "range.write_number_formats";
|
|
55
|
+
target: A1Range;
|
|
56
|
+
numberFormat: string[][];
|
|
57
|
+
preserveValues: true;
|
|
58
|
+
}
|
|
59
|
+
export interface WriteStylesOperation extends OperationBase {
|
|
60
|
+
kind: "range.write_styles";
|
|
61
|
+
target: A1Range;
|
|
62
|
+
style: NonNullable<RangeSnapshot["style"]>;
|
|
63
|
+
preserveValues: true;
|
|
64
|
+
}
|
|
65
|
+
export interface WriteHyperlinksOperation extends OperationBase {
|
|
66
|
+
kind: "range.write_hyperlinks";
|
|
67
|
+
target: A1Range;
|
|
68
|
+
hyperlinks: Array<Array<{
|
|
69
|
+
text?: string;
|
|
70
|
+
address: string;
|
|
71
|
+
screenTip?: string;
|
|
72
|
+
} | null>>;
|
|
73
|
+
}
|
|
74
|
+
export interface WriteCommentsOperation extends OperationBase {
|
|
75
|
+
kind: "range.write_comments";
|
|
76
|
+
target: A1Range;
|
|
77
|
+
comments: CellMatrix<string | null>;
|
|
78
|
+
}
|
|
79
|
+
export interface ClearRangeOperation extends OperationBase {
|
|
80
|
+
kind: "range.clear";
|
|
81
|
+
target: A1Range;
|
|
82
|
+
applyTo?: "all" | "contents" | "formats" | "hyperlinks";
|
|
83
|
+
}
|
|
84
|
+
export interface ClearValuesOperation extends OperationBase {
|
|
85
|
+
kind: "range.clear_values";
|
|
86
|
+
target: A1Range;
|
|
87
|
+
}
|
|
88
|
+
export interface ClearFormatsOperation extends OperationBase {
|
|
89
|
+
kind: "range.clear_formats";
|
|
90
|
+
target: A1Range;
|
|
91
|
+
}
|
|
92
|
+
export interface CopyRangeOperation extends OperationBase {
|
|
93
|
+
kind: "range.copy";
|
|
94
|
+
source: A1Range;
|
|
95
|
+
target: A1Range;
|
|
96
|
+
copyType?: "all" | "values" | "formats" | "formulas";
|
|
97
|
+
}
|
|
98
|
+
export interface MoveRangeOperation extends OperationBase {
|
|
99
|
+
kind: "range.move";
|
|
100
|
+
source: A1Range;
|
|
101
|
+
target: A1Range;
|
|
102
|
+
}
|
|
103
|
+
export interface InsertRowsOperation extends OperationBase {
|
|
104
|
+
kind: "range.insert_rows";
|
|
105
|
+
target: A1Range;
|
|
106
|
+
shift?: "down" | "right";
|
|
107
|
+
}
|
|
108
|
+
export interface DeleteRowsOperation extends OperationBase {
|
|
109
|
+
kind: "range.delete_rows";
|
|
110
|
+
target: A1Range;
|
|
111
|
+
shift?: "up" | "left";
|
|
112
|
+
}
|
|
113
|
+
export interface InsertColumnsOperation extends OperationBase {
|
|
114
|
+
kind: "range.insert_columns";
|
|
115
|
+
target: A1Range;
|
|
116
|
+
shift?: "right" | "down";
|
|
117
|
+
}
|
|
118
|
+
export interface DeleteColumnsOperation extends OperationBase {
|
|
119
|
+
kind: "range.delete_columns";
|
|
120
|
+
target: A1Range;
|
|
121
|
+
shift?: "left" | "up";
|
|
122
|
+
}
|
|
123
|
+
export interface AutofitColumnsOperation extends OperationBase {
|
|
124
|
+
kind: "range.autofit_columns";
|
|
125
|
+
target: A1Range;
|
|
126
|
+
}
|
|
127
|
+
export interface AutofitRowsOperation extends OperationBase {
|
|
128
|
+
kind: "range.autofit_rows";
|
|
129
|
+
target: A1Range;
|
|
130
|
+
}
|
|
131
|
+
export interface MergeRangeOperation extends OperationBase {
|
|
132
|
+
kind: "range.merge";
|
|
133
|
+
target: A1Range;
|
|
134
|
+
across?: boolean;
|
|
135
|
+
}
|
|
136
|
+
export interface UnmergeRangeOperation extends OperationBase {
|
|
137
|
+
kind: "range.unmerge";
|
|
138
|
+
target: A1Range;
|
|
139
|
+
}
|
|
140
|
+
export interface RestoreRangeSnapshotOperation extends OperationBase {
|
|
141
|
+
kind: "range.restore_snapshot";
|
|
142
|
+
target: A1Range;
|
|
143
|
+
snapshot: RangeSnapshot;
|
|
144
|
+
}
|
|
145
|
+
export interface CreateSheetOperation extends OperationBase {
|
|
146
|
+
kind: "sheet.create";
|
|
147
|
+
sheetName: string;
|
|
148
|
+
position?: "beginning" | "end" | "before" | "after";
|
|
149
|
+
relativeToSheetName?: string;
|
|
150
|
+
activate?: boolean;
|
|
151
|
+
}
|
|
152
|
+
export interface CopySheetOperation extends OperationBase {
|
|
153
|
+
kind: "sheet.copy";
|
|
154
|
+
sourceSheetName: string;
|
|
155
|
+
newSheetName: string;
|
|
156
|
+
position?: "beginning" | "end" | "before" | "after";
|
|
157
|
+
relativeToSheetName?: string;
|
|
158
|
+
activate?: boolean;
|
|
159
|
+
}
|
|
160
|
+
export interface RenameSheetOperation extends OperationBase {
|
|
161
|
+
kind: "sheet.rename";
|
|
162
|
+
sheetName: string;
|
|
163
|
+
newSheetName: string;
|
|
164
|
+
}
|
|
165
|
+
export interface DeleteSheetOperation extends OperationBase {
|
|
166
|
+
kind: "sheet.delete";
|
|
167
|
+
sheetName: string;
|
|
168
|
+
}
|
|
169
|
+
export interface MoveSheetOperation extends OperationBase {
|
|
170
|
+
kind: "sheet.move";
|
|
171
|
+
sheetName: string;
|
|
172
|
+
position: "beginning" | "end" | "before" | "after";
|
|
173
|
+
relativeToSheetName?: string;
|
|
174
|
+
}
|
|
175
|
+
export interface HideSheetOperation extends OperationBase {
|
|
176
|
+
kind: "sheet.hide";
|
|
177
|
+
sheetName: string;
|
|
178
|
+
}
|
|
179
|
+
export interface UnhideSheetOperation extends OperationBase {
|
|
180
|
+
kind: "sheet.unhide";
|
|
181
|
+
sheetName: string;
|
|
182
|
+
}
|
|
183
|
+
export interface ProtectSheetOperation extends OperationBase {
|
|
184
|
+
kind: "sheet.protect";
|
|
185
|
+
sheetName: string;
|
|
186
|
+
password?: string;
|
|
187
|
+
}
|
|
188
|
+
export interface UnprotectSheetOperation extends OperationBase {
|
|
189
|
+
kind: "sheet.unprotect";
|
|
190
|
+
sheetName: string;
|
|
191
|
+
password?: string;
|
|
192
|
+
}
|
|
193
|
+
export interface ClearSheetOperation extends OperationBase {
|
|
194
|
+
kind: "sheet.clear";
|
|
195
|
+
sheetName: string;
|
|
196
|
+
applyTo?: "all" | "contents" | "formats";
|
|
197
|
+
}
|
|
198
|
+
export interface SetSheetTabColorOperation extends OperationBase {
|
|
199
|
+
kind: "sheet.set_tab_color";
|
|
200
|
+
sheetName: string;
|
|
201
|
+
color: string;
|
|
202
|
+
}
|
|
203
|
+
export interface WorkbookCalculateOperation extends OperationBase {
|
|
204
|
+
kind: "workbook.calculate";
|
|
205
|
+
calculationType?: "full" | "recalculate";
|
|
206
|
+
}
|
|
207
|
+
export interface WorkbookSaveOperation extends OperationBase {
|
|
208
|
+
kind: "workbook.save";
|
|
209
|
+
}
|
|
210
|
+
export interface CreateSheetFromTemplateOperation extends OperationBase {
|
|
211
|
+
kind: "template.create_sheet_from_template";
|
|
212
|
+
templateId: TemplateId;
|
|
213
|
+
newSheetName: string;
|
|
214
|
+
clearDataRegions: boolean;
|
|
215
|
+
}
|
|
216
|
+
export type ExcelOperation = ReadFullOperation | WriteValuesOperation | WriteFormulasOperation | ClearValuesKeepFormatOperation | WriteNumberFormatsOperation | WriteStylesOperation | WriteHyperlinksOperation | WriteCommentsOperation | ClearRangeOperation | ClearValuesOperation | ClearFormatsOperation | CopyRangeOperation | MoveRangeOperation | InsertRowsOperation | DeleteRowsOperation | InsertColumnsOperation | DeleteColumnsOperation | AutofitColumnsOperation | AutofitRowsOperation | MergeRangeOperation | UnmergeRangeOperation | RestoreRangeSnapshotOperation | CreateSheetOperation | CopySheetOperation | RenameSheetOperation | DeleteSheetOperation | MoveSheetOperation | HideSheetOperation | UnhideSheetOperation | ProtectSheetOperation | UnprotectSheetOperation | ClearSheetOperation | SetSheetTabColorOperation | WorkbookCalculateOperation | WorkbookSaveOperation | CreateSheetFromTemplateOperation;
|
|
217
|
+
export interface BatchRequest {
|
|
218
|
+
workbookId: WorkbookId;
|
|
219
|
+
operations: ExcelOperation[];
|
|
220
|
+
mode: "validate" | "dry_run" | "apply";
|
|
221
|
+
planId?: PlanId | undefined;
|
|
222
|
+
confirmationToken?: string;
|
|
223
|
+
expectedTargetFingerprints?: RangeFingerprint[];
|
|
224
|
+
baseSnapshotId?: SnapshotId;
|
|
225
|
+
agentId?: AgentId | undefined;
|
|
226
|
+
agentName?: string | undefined;
|
|
227
|
+
taskId?: TaskId | undefined;
|
|
228
|
+
role?: string | undefined;
|
|
229
|
+
}
|
|
230
|
+
export interface CompiledBatch {
|
|
231
|
+
workbookId: WorkbookId;
|
|
232
|
+
operations: ExcelOperation[];
|
|
233
|
+
requiredBackups: Array<"region" | "sheet" | "workbook-copy">;
|
|
234
|
+
targetFingerprints: RangeFingerprint[];
|
|
235
|
+
estimatedCellsTouched: number;
|
|
236
|
+
destructiveLevel: DestructiveLevel;
|
|
237
|
+
}
|
|
238
|
+
export interface PlanCreateRequest {
|
|
239
|
+
workbookId: WorkbookId;
|
|
240
|
+
goal: string;
|
|
241
|
+
operations: ExcelOperation[];
|
|
242
|
+
baseSnapshotId?: SnapshotId;
|
|
243
|
+
agentId?: AgentId | undefined;
|
|
244
|
+
agentName?: string | undefined;
|
|
245
|
+
taskId?: TaskId | undefined;
|
|
246
|
+
role?: string | undefined;
|
|
247
|
+
}
|
|
248
|
+
export interface PlanPreview {
|
|
249
|
+
planId: PlanId;
|
|
250
|
+
workbookId: WorkbookId;
|
|
251
|
+
baseSnapshotId: SnapshotId;
|
|
252
|
+
requiredBackups: BackupId[];
|
|
253
|
+
beforeWorkbookFingerprint: WorkbookFingerprint;
|
|
254
|
+
targetFingerprints: RangeFingerprint[];
|
|
255
|
+
diffSummary: DiffSummary;
|
|
256
|
+
warnings: OperationWarning[];
|
|
257
|
+
}
|
|
258
|
+
export interface PlanRefreshResult {
|
|
259
|
+
ok: boolean;
|
|
260
|
+
planId: PlanId;
|
|
261
|
+
refreshed: boolean;
|
|
262
|
+
preview?: PlanPreview | undefined;
|
|
263
|
+
conflicts: OperationWarning[];
|
|
264
|
+
warnings: OperationWarning[];
|
|
265
|
+
}
|
|
266
|
+
export interface DiffSummary {
|
|
267
|
+
title: string;
|
|
268
|
+
changedRanges: A1Range[];
|
|
269
|
+
cellsChanged: number;
|
|
270
|
+
formulasChanged: number;
|
|
271
|
+
stylesChanged: number;
|
|
272
|
+
tablesChanged: number;
|
|
273
|
+
sheetsChanged: number;
|
|
274
|
+
destructiveLevel: DestructiveLevel;
|
|
275
|
+
}
|
|
276
|
+
export interface OperationResult {
|
|
277
|
+
ok: boolean;
|
|
278
|
+
operationId?: OperationId | undefined;
|
|
279
|
+
planId?: PlanId | undefined;
|
|
280
|
+
transactionId?: TransactionId | undefined;
|
|
281
|
+
taskId?: TaskId | undefined;
|
|
282
|
+
agentId?: AgentId | undefined;
|
|
283
|
+
diffSummary?: DiffSummary;
|
|
284
|
+
data?: unknown;
|
|
285
|
+
rollbackAvailable: boolean;
|
|
286
|
+
backups: BackupId[];
|
|
287
|
+
warnings: OperationWarning[];
|
|
288
|
+
telemetry: OperationTelemetry;
|
|
289
|
+
error?: ExcelRuntimeError;
|
|
290
|
+
}
|
|
291
|
+
export interface RangeSnapshot {
|
|
292
|
+
fingerprint: RangeFingerprint;
|
|
293
|
+
values?: CellMatrix;
|
|
294
|
+
formulas?: CellMatrix<string | null>;
|
|
295
|
+
numberFormat?: string[][];
|
|
296
|
+
text?: string[][];
|
|
297
|
+
style?: {
|
|
298
|
+
fillColor?: string;
|
|
299
|
+
fontName?: string;
|
|
300
|
+
fontSize?: number;
|
|
301
|
+
fontColor?: string;
|
|
302
|
+
fontBold?: boolean;
|
|
303
|
+
fontItalic?: boolean;
|
|
304
|
+
horizontalAlignment?: string;
|
|
305
|
+
verticalAlignment?: string;
|
|
306
|
+
rowHeight?: number;
|
|
307
|
+
columnWidth?: number;
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
export type StyleDimension = "columnWidths" | "rowHeights" | "borders" | "fills" | "fonts" | "alignment" | "numberFormats" | "conditionalFormatting" | "dataValidation" | "freezePanes" | "printSettings" | "pageLayout" | "hiddenRowsColumns";
|
|
311
|
+
export interface StyleFingerprintRequest {
|
|
312
|
+
workbookId: WorkbookId;
|
|
313
|
+
sheetName: string;
|
|
314
|
+
address?: string;
|
|
315
|
+
maxCellSamples?: number;
|
|
316
|
+
}
|
|
317
|
+
export interface StyleFingerprintResponse {
|
|
318
|
+
workbookId: WorkbookId;
|
|
319
|
+
sheetName: string;
|
|
320
|
+
address: string;
|
|
321
|
+
capturedAt: string;
|
|
322
|
+
rowCount: number;
|
|
323
|
+
columnCount: number;
|
|
324
|
+
truncated: boolean;
|
|
325
|
+
dimensions: Partial<Record<StyleDimension, unknown>>;
|
|
326
|
+
warnings: OperationWarning[];
|
|
327
|
+
}
|
|
328
|
+
export interface StyleCopyRequest {
|
|
329
|
+
workbookId: WorkbookId;
|
|
330
|
+
sourceSheetName: string;
|
|
331
|
+
targetSheetName: string;
|
|
332
|
+
sourceAddress?: string;
|
|
333
|
+
targetAddress?: string;
|
|
334
|
+
dimensions: StyleDimension[];
|
|
335
|
+
}
|
|
336
|
+
export interface StyleCopyResponse {
|
|
337
|
+
ok: boolean;
|
|
338
|
+
copied: StyleDimension[];
|
|
339
|
+
warnings: OperationWarning[];
|
|
340
|
+
}
|
|
341
|
+
export interface StyleCompareResponse {
|
|
342
|
+
ok: boolean;
|
|
343
|
+
issueCount: number;
|
|
344
|
+
issues: TemplateValidationIssue[];
|
|
345
|
+
sourceFingerprint: StyleFingerprintResponse;
|
|
346
|
+
targetFingerprint: StyleFingerprintResponse;
|
|
347
|
+
}
|
|
348
|
+
export interface FormulaPatternRequest {
|
|
349
|
+
workbookId: WorkbookId;
|
|
350
|
+
sheetName: string;
|
|
351
|
+
address?: string;
|
|
352
|
+
}
|
|
353
|
+
export interface FormulaPatternCell {
|
|
354
|
+
rowIndex: number;
|
|
355
|
+
columnIndex: number;
|
|
356
|
+
formula: string;
|
|
357
|
+
formulaR1C1?: string;
|
|
358
|
+
patternHash: string;
|
|
359
|
+
}
|
|
360
|
+
export interface FormulaSpillRange {
|
|
361
|
+
sheetName?: string | undefined;
|
|
362
|
+
anchorAddress: string;
|
|
363
|
+
spillAddress: string;
|
|
364
|
+
}
|
|
365
|
+
export interface FormulaPatternResponse {
|
|
366
|
+
workbookId: WorkbookId;
|
|
367
|
+
sheetName: string;
|
|
368
|
+
address: string;
|
|
369
|
+
capturedAt: string;
|
|
370
|
+
rowCount: number;
|
|
371
|
+
columnCount: number;
|
|
372
|
+
formulaCount: number;
|
|
373
|
+
formulas: CellMatrix<string | null>;
|
|
374
|
+
formulasR1C1?: CellMatrix<string | null>;
|
|
375
|
+
patternMatrix: CellMatrix<string | null>;
|
|
376
|
+
patterns: Array<{
|
|
377
|
+
patternHash: string;
|
|
378
|
+
formulaR1C1: string;
|
|
379
|
+
count: number;
|
|
380
|
+
cells: Array<{
|
|
381
|
+
rowIndex: number;
|
|
382
|
+
columnIndex: number;
|
|
383
|
+
}>;
|
|
384
|
+
}>;
|
|
385
|
+
cells: FormulaPatternCell[];
|
|
386
|
+
spillRanges?: FormulaSpillRange[] | undefined;
|
|
387
|
+
warnings: OperationWarning[];
|
|
388
|
+
}
|
|
389
|
+
export interface FormulaDependencyNode {
|
|
390
|
+
id: string;
|
|
391
|
+
workbookId: WorkbookId;
|
|
392
|
+
kind: "range" | "table" | "external";
|
|
393
|
+
sheetName?: string | undefined;
|
|
394
|
+
address?: string | undefined;
|
|
395
|
+
tableName?: string | undefined;
|
|
396
|
+
structuredReference?: string | undefined;
|
|
397
|
+
externalWorkbook?: string | undefined;
|
|
398
|
+
externalReference?: string | undefined;
|
|
399
|
+
formula?: string | undefined;
|
|
400
|
+
}
|
|
401
|
+
export interface FormulaDependencyEdge {
|
|
402
|
+
from: FormulaDependencyNode;
|
|
403
|
+
to: FormulaDependencyNode;
|
|
404
|
+
kind: "precedent";
|
|
405
|
+
confidence: "parsed" | "inferred";
|
|
406
|
+
}
|
|
407
|
+
export interface FormulaDependencyGraph {
|
|
408
|
+
workbookId: WorkbookId;
|
|
409
|
+
sheetName: string;
|
|
410
|
+
address: string;
|
|
411
|
+
capturedAt: string;
|
|
412
|
+
nodes: FormulaDependencyNode[];
|
|
413
|
+
edges: FormulaDependencyEdge[];
|
|
414
|
+
warnings: OperationWarning[];
|
|
415
|
+
}
|
|
416
|
+
export interface FormulaTraceResponse {
|
|
417
|
+
ok: boolean;
|
|
418
|
+
workbookId: WorkbookId;
|
|
419
|
+
sheetName: string;
|
|
420
|
+
address: string;
|
|
421
|
+
direction: "precedents" | "dependents";
|
|
422
|
+
nodes: FormulaDependencyNode[];
|
|
423
|
+
edges: FormulaDependencyEdge[];
|
|
424
|
+
warnings: OperationWarning[];
|
|
425
|
+
}
|
|
426
|
+
export interface FormulaCopyPatternsRequest {
|
|
427
|
+
workbookId: WorkbookId;
|
|
428
|
+
sourceSheetName: string;
|
|
429
|
+
targetSheetName: string;
|
|
430
|
+
sourceAddress?: string;
|
|
431
|
+
targetAddress?: string;
|
|
432
|
+
}
|
|
433
|
+
export interface FormulaFillRequest {
|
|
434
|
+
workbookId: WorkbookId;
|
|
435
|
+
sheetName: string;
|
|
436
|
+
sourceAddress: string;
|
|
437
|
+
targetAddress: string;
|
|
438
|
+
direction: "down" | "right";
|
|
439
|
+
}
|
|
440
|
+
export interface FormulaMutationResponse {
|
|
441
|
+
ok: boolean;
|
|
442
|
+
formulasChanged: number;
|
|
443
|
+
warnings: OperationWarning[];
|
|
444
|
+
}
|
|
445
|
+
export interface FormulaCompareResponse {
|
|
446
|
+
ok: boolean;
|
|
447
|
+
issueCount: number;
|
|
448
|
+
issues: TemplateValidationIssue[];
|
|
449
|
+
sourcePatterns: FormulaPatternResponse;
|
|
450
|
+
targetPatterns: FormulaPatternResponse;
|
|
451
|
+
}
|
|
452
|
+
export interface WorkbookSnapshotResponse {
|
|
453
|
+
workbookFingerprint: WorkbookFingerprint;
|
|
454
|
+
rangeSnapshots: RangeSnapshot[];
|
|
455
|
+
}
|
|
456
|
+
export interface TemplateExecutionSource {
|
|
457
|
+
templateId: TemplateId;
|
|
458
|
+
sourceSheetName: string;
|
|
459
|
+
dataRegions: string[];
|
|
460
|
+
}
|
|
461
|
+
export interface AddinExecuteBatchRequest {
|
|
462
|
+
request: BatchRequest;
|
|
463
|
+
compiled: CompiledBatch;
|
|
464
|
+
templateSources?: TemplateExecutionSource[];
|
|
465
|
+
}
|
|
466
|
+
export interface TemplateCaptureRequest {
|
|
467
|
+
workbookId: WorkbookId;
|
|
468
|
+
name: string;
|
|
469
|
+
scope: "workbook" | "local";
|
|
470
|
+
sourceSheetName: string;
|
|
471
|
+
dataRegions: string[];
|
|
472
|
+
}
|
|
473
|
+
export interface TemplateCaptureResponse {
|
|
474
|
+
sourceSheetName: string;
|
|
475
|
+
dataRegions: string[];
|
|
476
|
+
fingerprintPayload: {
|
|
477
|
+
structure: unknown;
|
|
478
|
+
formulas: unknown;
|
|
479
|
+
styles: unknown;
|
|
480
|
+
filters: unknown;
|
|
481
|
+
tables: unknown;
|
|
482
|
+
printLayout: unknown;
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
export interface SheetTemplateFingerprintRequest {
|
|
486
|
+
workbookId: WorkbookId;
|
|
487
|
+
sheetName: string;
|
|
488
|
+
dataRegions?: string[];
|
|
489
|
+
}
|
|
490
|
+
export interface SheetTemplateFingerprintResponse extends TemplateCaptureResponse {
|
|
491
|
+
sheetName: string;
|
|
492
|
+
}
|
|
493
|
+
export interface TemplateValidationIssue {
|
|
494
|
+
code: string;
|
|
495
|
+
severity: "info" | "warning" | "error";
|
|
496
|
+
message: string;
|
|
497
|
+
component: "structure" | "formulas" | "styles" | "filters" | "tables" | "printLayout";
|
|
498
|
+
target?: A1Range;
|
|
499
|
+
expected?: unknown;
|
|
500
|
+
actual?: unknown;
|
|
501
|
+
}
|
|
502
|
+
export interface TemplateValidationResponse {
|
|
503
|
+
ok: boolean;
|
|
504
|
+
sheetName: string;
|
|
505
|
+
templateId: TemplateId;
|
|
506
|
+
issueCount: number;
|
|
507
|
+
issues: TemplateValidationIssue[];
|
|
508
|
+
fingerprintPayload: TemplateCaptureResponse["fingerprintPayload"];
|
|
509
|
+
}
|
|
510
|
+
export interface TemplateRepairRequest {
|
|
511
|
+
workbookId: WorkbookId;
|
|
512
|
+
templateId: TemplateId;
|
|
513
|
+
targetSheetName: string;
|
|
514
|
+
repair: Array<"styles" | "formulas" | "dataRegions" | "layout">;
|
|
515
|
+
}
|
|
516
|
+
export interface AddinTemplateRepairRequest extends TemplateRepairRequest {
|
|
517
|
+
sourceSheetName: string;
|
|
518
|
+
dataRegions: string[];
|
|
519
|
+
}
|
|
520
|
+
export interface TableSelector {
|
|
521
|
+
workbookId: WorkbookId;
|
|
522
|
+
tableName: string;
|
|
523
|
+
}
|
|
524
|
+
export interface TableColumnRef {
|
|
525
|
+
id?: number;
|
|
526
|
+
index: number;
|
|
527
|
+
name: string;
|
|
528
|
+
}
|
|
529
|
+
export interface TableInfo {
|
|
530
|
+
workbookId: WorkbookId;
|
|
531
|
+
tableName: string;
|
|
532
|
+
id?: string;
|
|
533
|
+
sheetName?: string;
|
|
534
|
+
address?: string;
|
|
535
|
+
headerAddress?: string;
|
|
536
|
+
rowCount: number;
|
|
537
|
+
columnCount: number;
|
|
538
|
+
columns: TableColumnRef[];
|
|
539
|
+
style?: string;
|
|
540
|
+
showHeaders?: boolean;
|
|
541
|
+
showTotals?: boolean;
|
|
542
|
+
showFilterButton?: boolean;
|
|
543
|
+
showBandedRows?: boolean;
|
|
544
|
+
showBandedColumns?: boolean;
|
|
545
|
+
filters?: unknown;
|
|
546
|
+
sort?: unknown;
|
|
547
|
+
}
|
|
548
|
+
export interface TableReadResponse {
|
|
549
|
+
info: TableInfo;
|
|
550
|
+
headers: CellMatrix;
|
|
551
|
+
values: CellMatrix;
|
|
552
|
+
formulas: CellMatrix<string | null>;
|
|
553
|
+
text: string[][];
|
|
554
|
+
numberFormat: string[][];
|
|
555
|
+
}
|
|
556
|
+
export interface TableCreateRequest {
|
|
557
|
+
workbookId: WorkbookId;
|
|
558
|
+
sheetName: string;
|
|
559
|
+
address: string;
|
|
560
|
+
tableName?: string;
|
|
561
|
+
hasHeaders: boolean;
|
|
562
|
+
values?: CellMatrix;
|
|
563
|
+
style?: string;
|
|
564
|
+
showTotals?: boolean;
|
|
565
|
+
}
|
|
566
|
+
export interface TableResizeRequest extends TableSelector {
|
|
567
|
+
address: string;
|
|
568
|
+
}
|
|
569
|
+
export interface TableAppendRowsRequest extends TableSelector {
|
|
570
|
+
values: CellMatrix;
|
|
571
|
+
index?: number;
|
|
572
|
+
alwaysInsert?: boolean;
|
|
573
|
+
}
|
|
574
|
+
export interface TableUpdateRowsRequest extends TableSelector {
|
|
575
|
+
rows: Array<{
|
|
576
|
+
index: number;
|
|
577
|
+
values: CellMatrix[number];
|
|
578
|
+
}>;
|
|
579
|
+
}
|
|
580
|
+
export interface TableFilterSpec {
|
|
581
|
+
column: string | number;
|
|
582
|
+
criteria: unknown;
|
|
583
|
+
}
|
|
584
|
+
export interface TableApplyFiltersRequest extends TableSelector {
|
|
585
|
+
filters: TableFilterSpec[];
|
|
586
|
+
}
|
|
587
|
+
export interface TableSortField {
|
|
588
|
+
key: number;
|
|
589
|
+
ascending?: boolean;
|
|
590
|
+
sortOn?: "Value" | "CellColor" | "FontColor" | "Icon";
|
|
591
|
+
color?: string;
|
|
592
|
+
dataOption?: "Normal" | "TextAsNumber";
|
|
593
|
+
}
|
|
594
|
+
export interface TableSortRequest extends TableSelector {
|
|
595
|
+
fields: TableSortField[];
|
|
596
|
+
matchCase?: boolean;
|
|
597
|
+
method?: "PinYin" | "StrokeCount";
|
|
598
|
+
}
|
|
599
|
+
export interface TableSetTotalRowRequest extends TableSelector {
|
|
600
|
+
showTotals: boolean;
|
|
601
|
+
}
|
|
602
|
+
export interface TableSetStyleRequest extends TableSelector {
|
|
603
|
+
style: string;
|
|
604
|
+
}
|
|
605
|
+
export interface TableCopyStructureRequest extends TableSelector {
|
|
606
|
+
targetSheetName: string;
|
|
607
|
+
targetAddress: string;
|
|
608
|
+
newTableName?: string;
|
|
609
|
+
includeStyle?: boolean;
|
|
610
|
+
includeTotals?: boolean;
|
|
611
|
+
includeFilters?: boolean;
|
|
612
|
+
}
|
|
613
|
+
export interface PivotSelector {
|
|
614
|
+
workbookId: WorkbookId;
|
|
615
|
+
pivotTableName: string;
|
|
616
|
+
}
|
|
617
|
+
export interface PivotFieldInfo {
|
|
618
|
+
id?: string;
|
|
619
|
+
name: string;
|
|
620
|
+
showAllItems?: boolean;
|
|
621
|
+
subtotals?: Record<string, unknown>;
|
|
622
|
+
}
|
|
623
|
+
export interface PivotAxisHierarchyInfo {
|
|
624
|
+
id?: string;
|
|
625
|
+
name: string;
|
|
626
|
+
position?: number;
|
|
627
|
+
enableMultipleFilterItems?: boolean;
|
|
628
|
+
fields?: PivotFieldInfo[];
|
|
629
|
+
}
|
|
630
|
+
export interface PivotDataHierarchyInfo {
|
|
631
|
+
id?: string;
|
|
632
|
+
name: string;
|
|
633
|
+
position?: number;
|
|
634
|
+
numberFormat?: string;
|
|
635
|
+
summarizeBy?: string;
|
|
636
|
+
field?: PivotFieldInfo;
|
|
637
|
+
}
|
|
638
|
+
export interface PivotLayoutInfo {
|
|
639
|
+
altTextDescription?: string;
|
|
640
|
+
altTextTitle?: string;
|
|
641
|
+
autoFormat?: boolean;
|
|
642
|
+
emptyCellText?: string;
|
|
643
|
+
enableFieldList?: boolean;
|
|
644
|
+
fillEmptyCells?: boolean;
|
|
645
|
+
layoutType?: string;
|
|
646
|
+
preserveFormatting?: boolean;
|
|
647
|
+
showColumnGrandTotals?: boolean;
|
|
648
|
+
showFieldHeaders?: boolean;
|
|
649
|
+
showRowGrandTotals?: boolean;
|
|
650
|
+
subtotalLocation?: string;
|
|
651
|
+
}
|
|
652
|
+
export interface PivotRangeInfo {
|
|
653
|
+
address: string;
|
|
654
|
+
rowCount: number;
|
|
655
|
+
columnCount: number;
|
|
656
|
+
}
|
|
657
|
+
export interface PivotTableInfo {
|
|
658
|
+
workbookId: WorkbookId;
|
|
659
|
+
pivotTableName: string;
|
|
660
|
+
id?: string;
|
|
661
|
+
sheetName?: string;
|
|
662
|
+
range?: PivotRangeInfo;
|
|
663
|
+
source?: string;
|
|
664
|
+
sourceType?: string;
|
|
665
|
+
refreshOnOpen?: boolean;
|
|
666
|
+
useCustomSortLists?: boolean;
|
|
667
|
+
enableDataValueEditing?: boolean;
|
|
668
|
+
allowMultipleFiltersPerField?: boolean;
|
|
669
|
+
layout?: PivotLayoutInfo;
|
|
670
|
+
rowHierarchies?: PivotAxisHierarchyInfo[];
|
|
671
|
+
columnHierarchies?: PivotAxisHierarchyInfo[];
|
|
672
|
+
filterHierarchies?: PivotAxisHierarchyInfo[];
|
|
673
|
+
dataHierarchies?: PivotDataHierarchyInfo[];
|
|
674
|
+
hierarchies?: Array<{
|
|
675
|
+
id?: string;
|
|
676
|
+
name: string;
|
|
677
|
+
}>;
|
|
678
|
+
}
|
|
679
|
+
export type CapabilityStatus = "supported" | "partial" | "unsupported" | "unknown";
|
|
680
|
+
export interface CapabilityStatusMetadata {
|
|
681
|
+
capability: string;
|
|
682
|
+
status: CapabilityStatus;
|
|
683
|
+
reason?: string;
|
|
684
|
+
}
|
|
685
|
+
export type PivotCapabilityName = "create" | "read_source_metadata" | "read_axis_fields" | "write_axis_fields" | "write_data_fields" | "aggregation" | "number_format" | "layout_flags" | "refresh" | "delete" | "template_copy" | "fingerprint" | "diff" | "rebuild_with_source" | "source_reassignment" | "pivot_chart";
|
|
686
|
+
export interface PivotCapabilityMatrix {
|
|
687
|
+
workbookId?: WorkbookId;
|
|
688
|
+
hostPlatform?: string;
|
|
689
|
+
apiSets?: string[];
|
|
690
|
+
capabilities: Array<CapabilityStatusMetadata & {
|
|
691
|
+
capability: PivotCapabilityName;
|
|
692
|
+
}>;
|
|
693
|
+
}
|
|
694
|
+
export interface PivotOperationCapabilityStatus {
|
|
695
|
+
operation: "pivot.update_source" | "pivot.copy_from_template" | "pivot.repair_from_template" | "pivot.rebuild_with_source";
|
|
696
|
+
capabilities: CapabilityStatusMetadata[];
|
|
697
|
+
warnings: OperationWarning[];
|
|
698
|
+
fallback?: string;
|
|
699
|
+
}
|
|
700
|
+
export interface PivotCopyFromTemplateResponse {
|
|
701
|
+
ok: boolean;
|
|
702
|
+
copied?: string[];
|
|
703
|
+
source?: PivotTableInfo;
|
|
704
|
+
target?: PivotTableInfo;
|
|
705
|
+
warnings?: OperationWarning[];
|
|
706
|
+
capabilityStatus?: PivotOperationCapabilityStatus;
|
|
707
|
+
}
|
|
708
|
+
export interface PivotFingerprint {
|
|
709
|
+
workbookId: WorkbookId;
|
|
710
|
+
pivotTableName: string;
|
|
711
|
+
capturedAt: string;
|
|
712
|
+
hash: string;
|
|
713
|
+
source?: {
|
|
714
|
+
type?: string;
|
|
715
|
+
value?: string;
|
|
716
|
+
fields: string[];
|
|
717
|
+
};
|
|
718
|
+
layout: {
|
|
719
|
+
rowFields: string[];
|
|
720
|
+
columnFields: string[];
|
|
721
|
+
filterFields: string[];
|
|
722
|
+
dataFields: Array<{
|
|
723
|
+
name: string;
|
|
724
|
+
sourceFieldName?: string;
|
|
725
|
+
summarizeBy?: string;
|
|
726
|
+
numberFormat?: string;
|
|
727
|
+
}>;
|
|
728
|
+
flags?: PivotLayoutInfo;
|
|
729
|
+
};
|
|
730
|
+
output?: PivotRangeInfo & {
|
|
731
|
+
sheetName?: string;
|
|
732
|
+
};
|
|
733
|
+
warnings: Array<{
|
|
734
|
+
code: string;
|
|
735
|
+
message: string;
|
|
736
|
+
}>;
|
|
737
|
+
}
|
|
738
|
+
export interface PivotDiff {
|
|
739
|
+
ok: boolean;
|
|
740
|
+
workbookId: WorkbookId;
|
|
741
|
+
sourcePivotTableName: string;
|
|
742
|
+
targetPivotTableName: string;
|
|
743
|
+
source?: PivotFingerprint;
|
|
744
|
+
target?: PivotFingerprint;
|
|
745
|
+
changes: Array<{
|
|
746
|
+
path: string;
|
|
747
|
+
kind: "added" | "removed" | "changed";
|
|
748
|
+
before?: unknown;
|
|
749
|
+
after?: unknown;
|
|
750
|
+
}>;
|
|
751
|
+
warnings: Array<{
|
|
752
|
+
code: string;
|
|
753
|
+
message: string;
|
|
754
|
+
}>;
|
|
755
|
+
}
|
|
756
|
+
export interface PivotCreateRequest {
|
|
757
|
+
workbookId: WorkbookId;
|
|
758
|
+
pivotTableName: string;
|
|
759
|
+
sourceSheetName?: string;
|
|
760
|
+
sourceAddress?: string;
|
|
761
|
+
sourceTableName?: string;
|
|
762
|
+
destinationSheetName: string;
|
|
763
|
+
destinationAddress: string;
|
|
764
|
+
rowFields?: string[];
|
|
765
|
+
columnFields?: string[];
|
|
766
|
+
filterFields?: string[];
|
|
767
|
+
dataFields?: Array<{
|
|
768
|
+
sourceFieldName: string;
|
|
769
|
+
name?: string;
|
|
770
|
+
summarizeBy?: string;
|
|
771
|
+
numberFormat?: string;
|
|
772
|
+
}>;
|
|
773
|
+
layout?: PivotLayoutInfo;
|
|
774
|
+
refresh?: boolean;
|
|
775
|
+
}
|
|
776
|
+
export interface PivotCopyFromTemplateRequest extends PivotSelector {
|
|
777
|
+
templatePivotTableName: string;
|
|
778
|
+
templateId?: TemplateId;
|
|
779
|
+
dimensions?: Array<"metadata" | "layout" | "fields" | "dataFields" | "numberFormats" | "filters" | "refresh">;
|
|
780
|
+
strict?: boolean;
|
|
781
|
+
}
|
|
782
|
+
export interface PivotValidateSourceRequest extends PivotSelector {
|
|
783
|
+
expectedFields?: string[];
|
|
784
|
+
expectedRowFields?: string[];
|
|
785
|
+
expectedColumnFields?: string[];
|
|
786
|
+
expectedFilterFields?: string[];
|
|
787
|
+
expectedDataFields?: string[];
|
|
788
|
+
expectedDataFieldSettings?: Array<{
|
|
789
|
+
sourceFieldName?: string;
|
|
790
|
+
name?: string;
|
|
791
|
+
summarizeBy?: string;
|
|
792
|
+
numberFormat?: string;
|
|
793
|
+
}>;
|
|
794
|
+
expectedLayout?: Partial<PivotLayoutInfo>;
|
|
795
|
+
}
|
|
796
|
+
export interface PivotCompareFingerprintRequest extends PivotSelector {
|
|
797
|
+
targetPivotTableName: string;
|
|
798
|
+
}
|
|
799
|
+
export interface PivotRebuildWithSourceRequest extends PivotCreateRequest {
|
|
800
|
+
templatePivotTableName?: string;
|
|
801
|
+
replaceExisting?: boolean;
|
|
802
|
+
strict?: boolean;
|
|
803
|
+
}
|
|
804
|
+
export type PivotRepairFromTemplateRequest = PivotCopyFromTemplateRequest;
|
|
805
|
+
export type WorkbookFileBridgeOperation = "workbook.save_as" | "workbook.export_copy" | "workbook.restore_file_backup";
|
|
806
|
+
export interface WorkbookFileBridgeRequest {
|
|
807
|
+
operation: WorkbookFileBridgeOperation;
|
|
808
|
+
workbookId: WorkbookId;
|
|
809
|
+
targetPath?: string;
|
|
810
|
+
backupPath?: string;
|
|
811
|
+
restoreTargetPath?: string;
|
|
812
|
+
restoreMode?: WorkbookFileRestoreMode;
|
|
813
|
+
sourceBackupId?: BackupId;
|
|
814
|
+
ranges?: A1Range[];
|
|
815
|
+
reason?: string;
|
|
816
|
+
}
|
|
817
|
+
export interface WorkbookFileBridgeStatus {
|
|
818
|
+
available: boolean;
|
|
819
|
+
url?: string;
|
|
820
|
+
path?: string;
|
|
821
|
+
reason?: "not_configured" | "configured";
|
|
822
|
+
reachable?: boolean;
|
|
823
|
+
checkedAt?: string;
|
|
824
|
+
statusCode?: number;
|
|
825
|
+
bridge?: string;
|
|
826
|
+
route?: string;
|
|
827
|
+
adapter?: Record<string, unknown>;
|
|
828
|
+
error?: string;
|
|
829
|
+
}
|
|
830
|
+
export interface WorkbookFileBridgeResponse {
|
|
831
|
+
ok: boolean;
|
|
832
|
+
operation: WorkbookFileBridgeOperation;
|
|
833
|
+
workbookId: WorkbookId;
|
|
834
|
+
targetPath?: string;
|
|
835
|
+
backupPath?: string;
|
|
836
|
+
restoreTargetPath?: string;
|
|
837
|
+
restoreMode?: WorkbookFileRestoreMode;
|
|
838
|
+
sourceBackupId?: BackupId;
|
|
839
|
+
filePath?: string;
|
|
840
|
+
metadata?: Record<string, unknown>;
|
|
841
|
+
error?: string;
|
|
842
|
+
}
|
|
843
|
+
export type WorkbookFileBackupMode = "export-copy" | "save-copy-as";
|
|
844
|
+
export type WorkbookFileRestoreMode = "open-as-new" | "replace-open-workbook" | "restore-into-open-workbook";
|
|
845
|
+
export interface WorkbookFileBackupManifest {
|
|
846
|
+
backupId: BackupId;
|
|
847
|
+
workbookId: WorkbookId;
|
|
848
|
+
createdAt: string;
|
|
849
|
+
reason: string;
|
|
850
|
+
filePath?: string;
|
|
851
|
+
mode: WorkbookFileBackupMode;
|
|
852
|
+
size?: number;
|
|
853
|
+
checksum?: string;
|
|
854
|
+
sourceSnapshotBackupId?: BackupId;
|
|
855
|
+
pinned?: boolean;
|
|
856
|
+
verifiedAt?: string;
|
|
857
|
+
transactionId?: TransactionId;
|
|
858
|
+
taskId?: TaskId;
|
|
859
|
+
agentId?: AgentId;
|
|
860
|
+
restoreStatus?: "available" | "missing" | "checksum_mismatch" | "unsupported";
|
|
861
|
+
bridge?: WorkbookFileBridgeResponse;
|
|
862
|
+
metadata?: Record<string, unknown>;
|
|
863
|
+
}
|
|
864
|
+
export interface WorkbookCreateFileBackupRequest {
|
|
865
|
+
workbookId: WorkbookId;
|
|
866
|
+
reason?: string;
|
|
867
|
+
targetPath?: string;
|
|
868
|
+
mode?: WorkbookFileBackupMode;
|
|
869
|
+
pin?: boolean;
|
|
870
|
+
}
|
|
871
|
+
export interface WorkbookRestoreFileBackupRequest {
|
|
872
|
+
workbookId: WorkbookId;
|
|
873
|
+
backupId: BackupId;
|
|
874
|
+
mode?: WorkbookFileRestoreMode;
|
|
875
|
+
restoreTargetPath?: string;
|
|
876
|
+
confirmationToken?: string;
|
|
877
|
+
force?: boolean;
|
|
878
|
+
}
|
|
879
|
+
export interface WorkbookBackupRetentionRequest {
|
|
880
|
+
workbookId?: WorkbookId;
|
|
881
|
+
maxAgeDays?: number;
|
|
882
|
+
maxBackupsPerWorkbook?: number;
|
|
883
|
+
dryRun?: boolean;
|
|
884
|
+
}
|
|
885
|
+
export interface WorkbookFileContent {
|
|
886
|
+
ok: true;
|
|
887
|
+
workbookId: WorkbookId;
|
|
888
|
+
fileType: "compressed";
|
|
889
|
+
size: number;
|
|
890
|
+
sliceCount: number;
|
|
891
|
+
base64: string;
|
|
892
|
+
capturedAt: string;
|
|
893
|
+
}
|
|
894
|
+
export interface ChartSelector {
|
|
895
|
+
workbookId: WorkbookId;
|
|
896
|
+
sheetName: string;
|
|
897
|
+
chartName: string;
|
|
898
|
+
}
|
|
899
|
+
export interface ChartInfo {
|
|
900
|
+
workbookId: WorkbookId;
|
|
901
|
+
sheetName: string;
|
|
902
|
+
chartName: string;
|
|
903
|
+
id?: string;
|
|
904
|
+
chartType?: string;
|
|
905
|
+
title?: string;
|
|
906
|
+
top?: number;
|
|
907
|
+
left?: number;
|
|
908
|
+
width?: number;
|
|
909
|
+
height?: number;
|
|
910
|
+
style?: number;
|
|
911
|
+
plotBy?: string;
|
|
912
|
+
}
|
|
913
|
+
export interface ChartCreateRequest {
|
|
914
|
+
workbookId: WorkbookId;
|
|
915
|
+
sheetName: string;
|
|
916
|
+
chartName?: string;
|
|
917
|
+
sourceAddress: string;
|
|
918
|
+
chartType: string;
|
|
919
|
+
seriesBy?: "Auto" | "Columns" | "Rows";
|
|
920
|
+
title?: string;
|
|
921
|
+
position?: {
|
|
922
|
+
startCell: string;
|
|
923
|
+
endCell?: string;
|
|
924
|
+
};
|
|
925
|
+
style?: number;
|
|
926
|
+
}
|
|
927
|
+
export interface ChartUpdateDataSourceRequest extends ChartSelector {
|
|
928
|
+
sourceAddress: string;
|
|
929
|
+
seriesBy?: "Auto" | "Columns" | "Rows";
|
|
930
|
+
}
|
|
931
|
+
export interface RangeMetadataRequest {
|
|
932
|
+
workbookId: WorkbookId;
|
|
933
|
+
sheetName: string;
|
|
934
|
+
address: string;
|
|
935
|
+
}
|
|
936
|
+
export interface RangeAreasSummary {
|
|
937
|
+
address?: string;
|
|
938
|
+
areaCount?: number;
|
|
939
|
+
cellCount?: number;
|
|
940
|
+
isNullObject?: boolean;
|
|
941
|
+
}
|
|
942
|
+
export interface RangeSearchRequest extends RangeMetadataRequest {
|
|
943
|
+
text: string;
|
|
944
|
+
completeMatch?: boolean;
|
|
945
|
+
matchCase?: boolean;
|
|
946
|
+
searchDirection?: "Forward" | "Backwards";
|
|
947
|
+
}
|
|
948
|
+
export interface RangeSearchResponse {
|
|
949
|
+
ok: boolean;
|
|
950
|
+
matches: RangeAreasSummary;
|
|
951
|
+
}
|
|
952
|
+
export interface RangeMetadataResponse {
|
|
953
|
+
ok: boolean;
|
|
954
|
+
target: A1Range;
|
|
955
|
+
data?: unknown;
|
|
956
|
+
warnings: OperationWarning[];
|
|
957
|
+
}
|
|
958
|
+
export type NameScope = "workbook" | "worksheet";
|
|
959
|
+
export interface NameInfo {
|
|
960
|
+
workbookId: WorkbookId;
|
|
961
|
+
name: string;
|
|
962
|
+
scope: NameScope;
|
|
963
|
+
sheetName?: string;
|
|
964
|
+
type?: string;
|
|
965
|
+
value?: unknown;
|
|
966
|
+
formula?: string;
|
|
967
|
+
comment?: string;
|
|
968
|
+
visible?: boolean;
|
|
969
|
+
address?: string;
|
|
970
|
+
}
|
|
971
|
+
export interface NameSelector {
|
|
972
|
+
workbookId: WorkbookId;
|
|
973
|
+
name: string;
|
|
974
|
+
sheetName?: string;
|
|
975
|
+
}
|
|
976
|
+
export interface NameCreateRequest extends NameSelector {
|
|
977
|
+
reference?: string;
|
|
978
|
+
formula?: string;
|
|
979
|
+
comment?: string;
|
|
980
|
+
visible?: boolean;
|
|
981
|
+
}
|
|
982
|
+
export interface NameUpdateRequest extends NameSelector {
|
|
983
|
+
reference?: string;
|
|
984
|
+
formula?: string;
|
|
985
|
+
comment?: string;
|
|
986
|
+
visible?: boolean;
|
|
987
|
+
}
|
|
988
|
+
export interface WorkbookRegion {
|
|
989
|
+
workbookId: WorkbookId;
|
|
990
|
+
regionId: string;
|
|
991
|
+
name: string;
|
|
992
|
+
sheetName: string;
|
|
993
|
+
address: string;
|
|
994
|
+
kind: "data" | "header" | "formula" | "output" | "template" | "table" | "named-range" | "other";
|
|
995
|
+
source?: "manual" | "detected" | "named-range" | "table" | "template";
|
|
996
|
+
description?: string;
|
|
997
|
+
templateId?: TemplateId;
|
|
998
|
+
namedItem?: string;
|
|
999
|
+
createdAt: string;
|
|
1000
|
+
updatedAt: string;
|
|
1001
|
+
}
|
|
1002
|
+
export interface RegionSelector {
|
|
1003
|
+
workbookId: WorkbookId;
|
|
1004
|
+
regionName: string;
|
|
1005
|
+
}
|
|
1006
|
+
export interface RegionRegisterRequest {
|
|
1007
|
+
workbookId: WorkbookId;
|
|
1008
|
+
name: string;
|
|
1009
|
+
sheetName: string;
|
|
1010
|
+
address: string;
|
|
1011
|
+
kind?: WorkbookRegion["kind"];
|
|
1012
|
+
description?: string;
|
|
1013
|
+
templateId?: TemplateId;
|
|
1014
|
+
createNamedRange?: boolean;
|
|
1015
|
+
}
|
|
1016
|
+
export interface PermissionScope {
|
|
1017
|
+
workbookId?: WorkbookId;
|
|
1018
|
+
sheetNames?: string[];
|
|
1019
|
+
regionNames?: string[];
|
|
1020
|
+
}
|
|
1021
|
+
export interface LockedRegion {
|
|
1022
|
+
workbookId: WorkbookId;
|
|
1023
|
+
regionName: string;
|
|
1024
|
+
sheetName: string;
|
|
1025
|
+
address: string;
|
|
1026
|
+
reason?: string;
|
|
1027
|
+
lockedAt: string;
|
|
1028
|
+
}
|
|
1029
|
+
export interface PermissionState {
|
|
1030
|
+
allowWrites: boolean;
|
|
1031
|
+
allowDestructiveActions: boolean;
|
|
1032
|
+
allowWorkbookActions: boolean;
|
|
1033
|
+
allowMacroExecution: boolean;
|
|
1034
|
+
requireConfirmationFor: DestructiveLevel[];
|
|
1035
|
+
scope: PermissionScope;
|
|
1036
|
+
lockedRegions: LockedRegion[];
|
|
1037
|
+
}
|
|
1038
|
+
export interface WorkbookLocalConfig {
|
|
1039
|
+
version: 1;
|
|
1040
|
+
workbookId: WorkbookId;
|
|
1041
|
+
exportedAt: string;
|
|
1042
|
+
source: "open-workbook-local-config";
|
|
1043
|
+
templates: Array<Record<string, unknown>>;
|
|
1044
|
+
regions: WorkbookRegion[];
|
|
1045
|
+
permissions?: PermissionState;
|
|
1046
|
+
}
|
|
1047
|
+
export interface WorkbookLocalConfigImportRequest {
|
|
1048
|
+
workbookId: WorkbookId;
|
|
1049
|
+
config: WorkbookLocalConfig;
|
|
1050
|
+
includeTemplates?: boolean;
|
|
1051
|
+
includeRegions?: boolean;
|
|
1052
|
+
includePermissions?: boolean;
|
|
1053
|
+
overwrite?: boolean;
|
|
1054
|
+
}
|
|
1055
|
+
export interface WorkbookLocalConfigImportResponse {
|
|
1056
|
+
ok: boolean;
|
|
1057
|
+
workbookId: WorkbookId;
|
|
1058
|
+
imported: {
|
|
1059
|
+
templates: number;
|
|
1060
|
+
regions: number;
|
|
1061
|
+
permissions: boolean;
|
|
1062
|
+
};
|
|
1063
|
+
skipped: {
|
|
1064
|
+
templates: number;
|
|
1065
|
+
regions: number;
|
|
1066
|
+
};
|
|
1067
|
+
error?: ExcelRuntimeError;
|
|
1068
|
+
}
|
|
1069
|
+
export interface WorkbookEmbeddedLocalConfigResponse {
|
|
1070
|
+
ok: boolean;
|
|
1071
|
+
workbookId: WorkbookId;
|
|
1072
|
+
embedded: boolean;
|
|
1073
|
+
config?: WorkbookLocalConfig;
|
|
1074
|
+
partCount?: number;
|
|
1075
|
+
warnings?: OperationWarning[];
|
|
1076
|
+
error?: ExcelRuntimeError;
|
|
1077
|
+
}
|
|
1078
|
+
export interface CleaningReport {
|
|
1079
|
+
ok: boolean;
|
|
1080
|
+
workbookId: WorkbookId;
|
|
1081
|
+
target?: A1Range;
|
|
1082
|
+
action: string;
|
|
1083
|
+
changedCells: number;
|
|
1084
|
+
affectedRows?: number;
|
|
1085
|
+
affectedColumns?: number;
|
|
1086
|
+
data?: unknown;
|
|
1087
|
+
result?: OperationResult;
|
|
1088
|
+
warnings: OperationWarning[];
|
|
1089
|
+
error?: ExcelRuntimeError;
|
|
1090
|
+
}
|
|
1091
|
+
export type ValidationSeverity = "info" | "warning" | "error";
|
|
1092
|
+
export type ValidationCategory = "workbook" | "sheet" | "template" | "formula" | "style" | "table" | "filter" | "printLayout" | "reference" | "change" | "capability";
|
|
1093
|
+
export interface ValidationIssue {
|
|
1094
|
+
code: string;
|
|
1095
|
+
severity: ValidationSeverity;
|
|
1096
|
+
category: ValidationCategory;
|
|
1097
|
+
message: string;
|
|
1098
|
+
target?: A1Range;
|
|
1099
|
+
details?: Record<string, unknown>;
|
|
1100
|
+
}
|
|
1101
|
+
export interface ValidationReport {
|
|
1102
|
+
ok: boolean;
|
|
1103
|
+
workbookId: WorkbookId;
|
|
1104
|
+
scope: string;
|
|
1105
|
+
checkedAt: string;
|
|
1106
|
+
issueCount: number;
|
|
1107
|
+
summary: {
|
|
1108
|
+
errorCount: number;
|
|
1109
|
+
warningCount: number;
|
|
1110
|
+
infoCount: number;
|
|
1111
|
+
};
|
|
1112
|
+
issues: ValidationIssue[];
|
|
1113
|
+
data?: unknown;
|
|
1114
|
+
}
|
|
1115
|
+
export interface RepairReport {
|
|
1116
|
+
ok: boolean;
|
|
1117
|
+
workbookId: WorkbookId;
|
|
1118
|
+
repair: string;
|
|
1119
|
+
repairedAt: string;
|
|
1120
|
+
backups: BackupId[];
|
|
1121
|
+
result?: unknown;
|
|
1122
|
+
validation?: ValidationReport | TemplateValidationResponse;
|
|
1123
|
+
warnings: OperationWarning[];
|
|
1124
|
+
error?: ExcelRuntimeError;
|
|
1125
|
+
}
|
|
1126
|
+
//# sourceMappingURL=operations.d.ts.map
|