@portel/photon 1.18.0 → 1.19.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/auto-ui/beam.d.ts.map +1 -1
- package/dist/auto-ui/beam.js +14 -4
- package/dist/auto-ui/beam.js.map +1 -1
- package/dist/beam-form.bundle.js +5 -3
- package/dist/beam-form.bundle.js.map +2 -2
- package/dist/beam.bundle.js +686 -30
- package/dist/beam.bundle.js.map +3 -3
- package/dist/claude-code-plugin.js +1 -1
- package/dist/cli/commands/beam.d.ts.map +1 -1
- package/dist/cli/commands/beam.js +8 -2
- package/dist/cli/commands/beam.js.map +1 -1
- package/dist/cli/commands/changelog.d.ts +9 -0
- package/dist/cli/commands/changelog.d.ts.map +1 -0
- package/dist/cli/commands/changelog.js +133 -0
- package/dist/cli/commands/changelog.js.map +1 -0
- package/dist/cli/commands/maker.d.ts.map +1 -1
- package/dist/cli/commands/maker.js +23 -2
- package/dist/cli/commands/maker.js.map +1 -1
- package/dist/cli/commands/mcp.d.ts.map +1 -1
- package/dist/cli/commands/mcp.js +53 -0
- package/dist/cli/commands/mcp.js.map +1 -1
- package/dist/cli/commands/package.d.ts.map +1 -1
- package/dist/cli/commands/package.js +18 -2
- package/dist/cli/commands/package.js.map +1 -1
- package/dist/cli/commands/run.d.ts.map +1 -1
- package/dist/cli/commands/run.js +1 -0
- package/dist/cli/commands/run.js.map +1 -1
- package/dist/cli/commands/update.d.ts +3 -2
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/update.js +50 -43
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +16 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/cli-alias.js +1 -1
- package/dist/cli-alias.js.map +1 -1
- package/dist/context-store.d.ts +23 -33
- package/dist/context-store.d.ts.map +1 -1
- package/dist/context-store.js +147 -97
- package/dist/context-store.js.map +1 -1
- package/dist/context.d.ts +15 -10
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +37 -13
- package/dist/context.js.map +1 -1
- package/dist/daemon/server.js +4 -2
- package/dist/daemon/server.js.map +1 -1
- package/dist/data-migration.d.ts +27 -0
- package/dist/data-migration.d.ts.map +1 -0
- package/dist/data-migration.js +307 -0
- package/dist/data-migration.js.map +1 -0
- package/dist/editor-support/docblock-tag-catalog.d.ts.map +1 -1
- package/dist/editor-support/docblock-tag-catalog.js +6 -0
- package/dist/editor-support/docblock-tag-catalog.js.map +1 -1
- package/dist/loader.d.ts +10 -0
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +97 -12
- package/dist/loader.js.map +1 -1
- package/dist/marketplace-manager.d.ts.map +1 -1
- package/dist/marketplace-manager.js +25 -5
- package/dist/marketplace-manager.js.map +1 -1
- package/dist/photon-cli-runner.d.ts.map +1 -1
- package/dist/photon-cli-runner.js +47 -21
- package/dist/photon-cli-runner.js.map +1 -1
- package/dist/photon-doc-extractor.d.ts +1 -0
- package/dist/photon-doc-extractor.d.ts.map +1 -1
- package/dist/photon-doc-extractor.js +6 -0
- package/dist/photon-doc-extractor.js.map +1 -1
- package/dist/readme-syncer.d.ts.map +1 -1
- package/dist/readme-syncer.js +6 -1
- package/dist/readme-syncer.js.map +1 -1
- package/dist/server.d.ts +40 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +143 -28
- package/dist/server.js.map +1 -1
- package/dist/shared/audit.js +4 -4
- package/dist/shared/audit.js.map +1 -1
- package/dist/tasks/store.d.ts.map +1 -1
- package/dist/tasks/store.js +6 -2
- package/dist/tasks/store.js.map +1 -1
- package/dist/version-notify.d.ts +27 -0
- package/dist/version-notify.d.ts.map +1 -0
- package/dist/version-notify.js +142 -0
- package/dist/version-notify.js.map +1 -0
- package/package.json +2 -2
- package/dist/auto-ui/bridge/openai-shim.d.ts +0 -20
- package/dist/auto-ui/bridge/openai-shim.d.ts.map +0 -1
- package/dist/auto-ui/bridge/openai-shim.js +0 -231
- package/dist/auto-ui/bridge/openai-shim.js.map +0 -1
- package/dist/auto-ui/bridge/photon-app.d.ts +0 -162
- package/dist/auto-ui/bridge/photon-app.d.ts.map +0 -1
- package/dist/auto-ui/bridge/photon-app.js +0 -460
- package/dist/auto-ui/bridge/photon-app.js.map +0 -1
- package/dist/auto-ui/daemon-tools.d.ts +0 -45
- package/dist/auto-ui/daemon-tools.d.ts.map +0 -1
- package/dist/auto-ui/daemon-tools.js +0 -581
- package/dist/auto-ui/daemon-tools.js.map +0 -1
- package/dist/auto-ui/design-system/index.d.ts +0 -21
- package/dist/auto-ui/design-system/index.d.ts.map +0 -1
- package/dist/auto-ui/design-system/index.js +0 -27
- package/dist/auto-ui/design-system/index.js.map +0 -1
- package/dist/auto-ui/design-system/transaction-ui.d.ts +0 -70
- package/dist/auto-ui/design-system/transaction-ui.d.ts.map +0 -1
- package/dist/auto-ui/design-system/transaction-ui.js +0 -982
- package/dist/auto-ui/design-system/transaction-ui.js.map +0 -1
- package/dist/auto-ui/playground-server.d.ts +0 -7
- package/dist/auto-ui/playground-server.d.ts.map +0 -1
- package/dist/auto-ui/playground-server.js +0 -840
- package/dist/auto-ui/playground-server.js.map +0 -1
- package/dist/auto-ui/rendering/components.d.ts +0 -29
- package/dist/auto-ui/rendering/components.d.ts.map +0 -1
- package/dist/auto-ui/rendering/components.js +0 -1341
- package/dist/auto-ui/rendering/components.js.map +0 -1
- package/dist/auto-ui/rendering/field-analyzer.d.ts +0 -104
- package/dist/auto-ui/rendering/field-analyzer.d.ts.map +0 -1
- package/dist/auto-ui/rendering/field-analyzer.js +0 -447
- package/dist/auto-ui/rendering/field-analyzer.js.map +0 -1
- package/dist/auto-ui/rendering/field-renderers.d.ts +0 -64
- package/dist/auto-ui/rendering/field-renderers.d.ts.map +0 -1
- package/dist/auto-ui/rendering/field-renderers.js +0 -317
- package/dist/auto-ui/rendering/field-renderers.js.map +0 -1
- package/dist/auto-ui/rendering/index.d.ts +0 -28
- package/dist/auto-ui/rendering/index.d.ts.map +0 -1
- package/dist/auto-ui/rendering/index.js +0 -60
- package/dist/auto-ui/rendering/index.js.map +0 -1
- package/dist/auto-ui/rendering/layout-selector.d.ts +0 -60
- package/dist/auto-ui/rendering/layout-selector.d.ts.map +0 -1
- package/dist/auto-ui/rendering/layout-selector.js +0 -476
- package/dist/auto-ui/rendering/layout-selector.js.map +0 -1
- package/dist/markdown-utils.d.ts +0 -8
- package/dist/markdown-utils.d.ts.map +0 -1
- package/dist/markdown-utils.js +0 -64
- package/dist/markdown-utils.js.map +0 -1
- package/dist/mcp-client.d.ts +0 -9
- package/dist/mcp-client.d.ts.map +0 -1
- package/dist/mcp-client.js +0 -11
- package/dist/mcp-client.js.map +0 -1
- package/dist/mcp-elicitation.d.ts +0 -32
- package/dist/mcp-elicitation.d.ts.map +0 -1
- package/dist/mcp-elicitation.js +0 -26
- package/dist/mcp-elicitation.js.map +0 -1
- package/dist/photons/builder-compass.photon.d.ts +0 -167
- package/dist/photons/builder-compass.photon.d.ts.map +0 -1
- package/dist/photons/builder-compass.photon.js +0 -816
- package/dist/photons/builder-compass.photon.js.map +0 -1
- package/dist/photons/builder-compass.photon.ts +0 -1129
- package/dist/photons/docs/ui/docs.html +0 -441
- package/dist/photons/docs.photon.d.ts +0 -237
- package/dist/photons/docs.photon.d.ts.map +0 -1
- package/dist/photons/docs.photon.js +0 -483
- package/dist/photons/docs.photon.js.map +0 -1
- package/dist/photons/docs.photon.ts +0 -536
- package/dist/photons/slides.photon.d.ts +0 -212
- package/dist/photons/slides.photon.d.ts.map +0 -1
- package/dist/photons/slides.photon.js +0 -355
- package/dist/photons/slides.photon.js.map +0 -1
- package/dist/photons/slides.photon.ts +0 -370
- package/dist/photons/spreadsheet/ui/spreadsheet.html +0 -779
- package/dist/photons/spreadsheet.photon.d.ts +0 -554
- package/dist/photons/spreadsheet.photon.d.ts.map +0 -1
- package/dist/photons/spreadsheet.photon.js +0 -1050
- package/dist/photons/spreadsheet.photon.js.map +0 -1
- package/dist/photons/spreadsheet.photon.ts +0 -1239
- package/dist/photons/ui/builder-compass.html +0 -1199
- package/dist/photons/ui/builder-compass.photon.html +0 -380
- package/dist/security-scanner.d.ts +0 -52
- package/dist/security-scanner.d.ts.map +0 -1
- package/dist/security-scanner.js +0 -181
- package/dist/security-scanner.js.map +0 -1
- package/dist/shared/performance.d.ts +0 -65
- package/dist/shared/performance.d.ts.map +0 -1
- package/dist/shared/performance.js +0 -136
- package/dist/shared/performance.js.map +0 -1
|
@@ -1,554 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Spreadsheet — CSV-backed spreadsheet with formulas
|
|
3
|
-
*
|
|
4
|
-
* A spreadsheet engine that works on plain CSV files. Formulas (=SUM, =AVG, etc.)
|
|
5
|
-
* are stored directly in CSV cells and evaluated at runtime. Named instances map
|
|
6
|
-
* to CSV files: `_use('budget')` → `budget.csv` in your spreadsheets folder.
|
|
7
|
-
* Pass a full path to open any CSV: `_use('/path/to/data.csv')`.
|
|
8
|
-
*
|
|
9
|
-
* @version 1.1.0
|
|
10
|
-
* @runtime ^1.14.0
|
|
11
|
-
* @tags spreadsheet, csv, formulas, data
|
|
12
|
-
* @icon 📊
|
|
13
|
-
* @stateful
|
|
14
|
-
* @dependencies @portel/csv@^1.0.0, alasql@^4.0.0
|
|
15
|
-
* @ui dashboard ./ui/spreadsheet.html
|
|
16
|
-
*/
|
|
17
|
-
export default class Spreadsheet {
|
|
18
|
-
private engine;
|
|
19
|
-
private loaded;
|
|
20
|
-
private _lastLoadSize;
|
|
21
|
-
private _lock;
|
|
22
|
-
private _isLargeFileThreshold;
|
|
23
|
-
private _engines;
|
|
24
|
-
private _watcher;
|
|
25
|
-
private _lastFileSize;
|
|
26
|
-
private _watchDebounce;
|
|
27
|
-
emit: (data: any) => void;
|
|
28
|
-
call: (target: string, params?: Record<string, any>, options?: {
|
|
29
|
-
instance?: string;
|
|
30
|
-
}) => Promise<any>;
|
|
31
|
-
instanceName: string;
|
|
32
|
-
private _watches;
|
|
33
|
-
private _watcherAutoStarted;
|
|
34
|
-
protected settings: {
|
|
35
|
-
/** @property Directory where spreadsheet CSV files are stored */
|
|
36
|
-
folder: string;
|
|
37
|
-
/** @property Save format row: true (always), false (never), auto (if original had one or formatting was customized) */
|
|
38
|
-
formatting: "auto" | "true" | "false";
|
|
39
|
-
/** @property Row count for paging in view() */
|
|
40
|
-
pageSize: number;
|
|
41
|
-
};
|
|
42
|
-
onInitialize(): Promise<void>;
|
|
43
|
-
private get defaultFolder();
|
|
44
|
-
private get csvPath();
|
|
45
|
-
/**
|
|
46
|
-
* Memory-efficient line-by-line generator
|
|
47
|
-
*/
|
|
48
|
-
private getLineGenerator;
|
|
49
|
-
/**
|
|
50
|
-
* Helper to get or load an engine for a specific table name
|
|
51
|
-
*/
|
|
52
|
-
private _getCsvEngine;
|
|
53
|
-
/**
|
|
54
|
-
* Pre-process Airtable-style formulas ({Field} -> "Field")
|
|
55
|
-
*/
|
|
56
|
-
private _processAirtableFormula;
|
|
57
|
-
private load;
|
|
58
|
-
private loadHeadersOnly;
|
|
59
|
-
private save;
|
|
60
|
-
/**
|
|
61
|
-
* Optimized append: writes directly to end of file without rewriting
|
|
62
|
-
*/
|
|
63
|
-
private appendRows;
|
|
64
|
-
private shouldWriteFormatRow;
|
|
65
|
-
private buildResponse;
|
|
66
|
-
/**
|
|
67
|
-
* Open spreadsheet UI
|
|
68
|
-
*
|
|
69
|
-
* @ui spreadsheet
|
|
70
|
-
* @autorun
|
|
71
|
-
*/
|
|
72
|
-
main(): Promise<Record<string, any>>;
|
|
73
|
-
/**
|
|
74
|
-
* List all tables (CSV files) in the spreadsheets folder
|
|
75
|
-
* @title List Tables
|
|
76
|
-
*/
|
|
77
|
-
list_tables(): Promise<{
|
|
78
|
-
tables: never[];
|
|
79
|
-
message: string;
|
|
80
|
-
count?: undefined;
|
|
81
|
-
} | {
|
|
82
|
-
tables: {
|
|
83
|
-
name: string;
|
|
84
|
-
file: string;
|
|
85
|
-
size: number;
|
|
86
|
-
modified: string;
|
|
87
|
-
}[];
|
|
88
|
-
count: number;
|
|
89
|
-
message: string;
|
|
90
|
-
}>;
|
|
91
|
-
/**
|
|
92
|
-
* View records (Airtable-compatible)
|
|
93
|
-
*
|
|
94
|
-
* @param maxRecords Max records to return (default 100)
|
|
95
|
-
* @param offset Row offset for pagination
|
|
96
|
-
* @param filterByFormula Optional formula to filter records (e.g. "{Age} > 25")
|
|
97
|
-
* @title List Records
|
|
98
|
-
* @format table
|
|
99
|
-
*/
|
|
100
|
-
list_records(params: {
|
|
101
|
-
maxRecords?: number;
|
|
102
|
-
offset?: number;
|
|
103
|
-
filterByFormula?: string;
|
|
104
|
-
}): Promise<any>;
|
|
105
|
-
/**
|
|
106
|
-
* Lookup a value from another table
|
|
107
|
-
*
|
|
108
|
-
* Mimics the relational "Lookup" field in Airtable/Google Sheets.
|
|
109
|
-
*
|
|
110
|
-
* @param table Other table name (e.g. "Products")
|
|
111
|
-
* @param matchField Field in the other table to match against (e.g. "SKU")
|
|
112
|
-
* @param matchValue Value to search for (e.g. "A101")
|
|
113
|
-
* @param resultField Field to return from the matching row (e.g. "Price")
|
|
114
|
-
* @example lookup({ table: 'Products', matchField: 'SKU', matchValue: 'A101', resultField: 'Price' })
|
|
115
|
-
*/
|
|
116
|
-
lookup(params: {
|
|
117
|
-
table: string;
|
|
118
|
-
matchField: string;
|
|
119
|
-
matchValue: string;
|
|
120
|
-
resultField: string;
|
|
121
|
-
}): Promise<{
|
|
122
|
-
value: any;
|
|
123
|
-
message: string;
|
|
124
|
-
}>;
|
|
125
|
-
/**
|
|
126
|
-
* Get a single record by its row number
|
|
127
|
-
* @param recordId Row number (1-indexed)
|
|
128
|
-
* @title Get Record
|
|
129
|
-
*/
|
|
130
|
-
get_record(params: {
|
|
131
|
-
recordId: number;
|
|
132
|
-
}): Promise<{
|
|
133
|
-
id: number;
|
|
134
|
-
fields: any;
|
|
135
|
-
}>;
|
|
136
|
-
/**
|
|
137
|
-
* Create a new record (Airtable-compatible)
|
|
138
|
-
* @param fields Key-value pairs for the new record
|
|
139
|
-
* @title Create Record
|
|
140
|
-
*/
|
|
141
|
-
create_record(params: {
|
|
142
|
-
fields: Record<string, string>;
|
|
143
|
-
}): Promise<Record<string, any>>;
|
|
144
|
-
/**
|
|
145
|
-
* Update an existing record (Airtable-compatible)
|
|
146
|
-
* @param recordId Row number (1-indexed)
|
|
147
|
-
* @param fields Key-value pairs to update
|
|
148
|
-
* @title Update Record
|
|
149
|
-
*/
|
|
150
|
-
update_record(params: {
|
|
151
|
-
recordId: number;
|
|
152
|
-
fields: Record<string, string>;
|
|
153
|
-
}): Promise<Record<string, any>>;
|
|
154
|
-
/**
|
|
155
|
-
* Delete a record (Airtable-compatible)
|
|
156
|
-
* @param recordId Row number (1-indexed)
|
|
157
|
-
* @title Delete Record
|
|
158
|
-
*/
|
|
159
|
-
delete_record(params: {
|
|
160
|
-
recordId: number;
|
|
161
|
-
}): Promise<Record<string, any>>;
|
|
162
|
-
/**
|
|
163
|
-
* Search for records (Airtable-compatible)
|
|
164
|
-
* @param query Text to search for
|
|
165
|
-
* @title Search Records
|
|
166
|
-
*/
|
|
167
|
-
search_records(params: {
|
|
168
|
-
query: string;
|
|
169
|
-
}): Promise<any>;
|
|
170
|
-
/**
|
|
171
|
-
* View the spreadsheet grid
|
|
172
|
-
*
|
|
173
|
-
* Returns the full spreadsheet or a specific range as a formatted table.
|
|
174
|
-
*
|
|
175
|
-
* @param range Optional cell range to view (e.g., "A1:D10")
|
|
176
|
-
* @param offset Row offset for pagination
|
|
177
|
-
* @param limit Max rows to return (defaults to settings.pageSize)
|
|
178
|
-
* @format table
|
|
179
|
-
*/
|
|
180
|
-
view(params?: {
|
|
181
|
-
range?: string;
|
|
182
|
-
offset?: number;
|
|
183
|
-
limit?: number;
|
|
184
|
-
}): Promise<{
|
|
185
|
-
table: any;
|
|
186
|
-
} | {
|
|
187
|
-
offset: number;
|
|
188
|
-
limit: number;
|
|
189
|
-
total: any;
|
|
190
|
-
}>;
|
|
191
|
-
/**
|
|
192
|
-
* Get a cell value
|
|
193
|
-
*
|
|
194
|
-
* Returns the evaluated value and raw content (formula if any) for a single cell.
|
|
195
|
-
*
|
|
196
|
-
* @param cell Cell reference in A1 notation (e.g., "B3")
|
|
197
|
-
*/
|
|
198
|
-
get(params: {
|
|
199
|
-
cell: string;
|
|
200
|
-
}): Promise<{
|
|
201
|
-
cell: string;
|
|
202
|
-
value: any;
|
|
203
|
-
raw: any;
|
|
204
|
-
message: string;
|
|
205
|
-
}>;
|
|
206
|
-
/**
|
|
207
|
-
* Set a cell value or formula
|
|
208
|
-
*
|
|
209
|
-
* Set a cell to a plain value or a formula starting with "=".
|
|
210
|
-
* Formulas support: SUM, AVG, MAX, MIN, COUNT, IF, LEN, ABS, ROUND, CONCAT.
|
|
211
|
-
* Cell references use A1 notation. Ranges use A1:B2 notation.
|
|
212
|
-
*
|
|
213
|
-
* @param cell Cell reference in A1 notation (e.g., "B3")
|
|
214
|
-
* @param value Value or formula (e.g., "42" or "=SUM(A1:A5)")
|
|
215
|
-
* @example set({ cell: 'B3', value: '=SUM(B1:B2)' })
|
|
216
|
-
*/
|
|
217
|
-
set(params: {
|
|
218
|
-
cell: string;
|
|
219
|
-
value: string;
|
|
220
|
-
}): Promise<Record<string, any>>;
|
|
221
|
-
/**
|
|
222
|
-
* Add a row of data
|
|
223
|
-
*
|
|
224
|
-
* Add a new row to the bottom of the spreadsheet. Pass column values by header name.
|
|
225
|
-
*
|
|
226
|
-
* @param values Key-value pairs mapping column names to values (e.g., {"Name": "Alice", "Age": "30"})
|
|
227
|
-
* @example add({ values: { Name: 'Alice', Age: '30' } })
|
|
228
|
-
*/
|
|
229
|
-
add(params: {
|
|
230
|
-
values: Record<string, string>;
|
|
231
|
-
}): Promise<Record<string, any>>;
|
|
232
|
-
/**
|
|
233
|
-
* Remove a row
|
|
234
|
-
*
|
|
235
|
-
* @param row Row number to remove (1-indexed)
|
|
236
|
-
*/
|
|
237
|
-
remove(params: {
|
|
238
|
-
row: number;
|
|
239
|
-
}): Promise<Record<string, any>>;
|
|
240
|
-
/**
|
|
241
|
-
* Remove a column
|
|
242
|
-
*
|
|
243
|
-
* @param column Column letter or header name to remove
|
|
244
|
-
*/
|
|
245
|
-
removeColumn(params: {
|
|
246
|
-
column: string;
|
|
247
|
-
}): Promise<Record<string, any>>;
|
|
248
|
-
/**
|
|
249
|
-
* Insert a row at a specific position
|
|
250
|
-
*
|
|
251
|
-
* @param row Row number to insert before (1-indexed)
|
|
252
|
-
* @param values Optional: Key-value pairs for the new row
|
|
253
|
-
*/
|
|
254
|
-
insertRow(params: {
|
|
255
|
-
row: number;
|
|
256
|
-
values?: Record<string, string>;
|
|
257
|
-
}): Promise<Record<string, any>>;
|
|
258
|
-
/**
|
|
259
|
-
* Insert a column at a specific position
|
|
260
|
-
*
|
|
261
|
-
* @param column Column letter or header name to insert before
|
|
262
|
-
* @param name Name for the new column
|
|
263
|
-
*/
|
|
264
|
-
insertColumn(params: {
|
|
265
|
-
column: string;
|
|
266
|
-
name: string;
|
|
267
|
-
}): Promise<Record<string, any>>;
|
|
268
|
-
/**
|
|
269
|
-
* Update or insert a row (Database Upsert)
|
|
270
|
-
*
|
|
271
|
-
* Finds a row matching the `search` criteria. If found, updates it with `values`.
|
|
272
|
-
* If not found, adds a new row with `values`.
|
|
273
|
-
*
|
|
274
|
-
* @param search Key-value pairs to match an existing row (e.g., {"ID": "123"})
|
|
275
|
-
* @param values Key-value pairs to set in the row
|
|
276
|
-
* @example upsert({ search: { ID: '101' }, values: { Name: 'Alice', Status: 'Active' } })
|
|
277
|
-
*/
|
|
278
|
-
upsert(params: {
|
|
279
|
-
search: Record<string, string>;
|
|
280
|
-
values: Record<string, string>;
|
|
281
|
-
}): Promise<any>;
|
|
282
|
-
/**
|
|
283
|
-
* Fuzzy search across columns
|
|
284
|
-
*
|
|
285
|
-
* Finds rows containing the query string in any of the specified columns.
|
|
286
|
-
* Uses streaming generator for memory efficiency on large files.
|
|
287
|
-
*
|
|
288
|
-
* @param query Search string
|
|
289
|
-
* @param columns Optional: array of column names to search (searches all if omitted)
|
|
290
|
-
* @param limit Max results to return
|
|
291
|
-
* @format table
|
|
292
|
-
*/
|
|
293
|
-
search(params: {
|
|
294
|
-
query: string;
|
|
295
|
-
columns?: string[];
|
|
296
|
-
limit?: number;
|
|
297
|
-
}): Promise<any>;
|
|
298
|
-
/**
|
|
299
|
-
* Update fields in a row
|
|
300
|
-
*
|
|
301
|
-
* @param row Row number to update (1-indexed)
|
|
302
|
-
* @param values Key-value pairs mapping column names to new values
|
|
303
|
-
* @example update({ row: 3, values: { Age: '42' } })
|
|
304
|
-
*/
|
|
305
|
-
update(params: {
|
|
306
|
-
row: number;
|
|
307
|
-
values: Record<string, string>;
|
|
308
|
-
}): Promise<Record<string, any>>;
|
|
309
|
-
/**
|
|
310
|
-
* Query rows by condition
|
|
311
|
-
*
|
|
312
|
-
* Filter rows where a column matches a condition. Supports: =, !=, >, <, >=, <=, contains.
|
|
313
|
-
*
|
|
314
|
-
* @param where Condition string (e.g., "Age > 25", "Name contains Ali")
|
|
315
|
-
* @param limit Max rows to return
|
|
316
|
-
* @example query({ where: 'Age > 25' })
|
|
317
|
-
*/
|
|
318
|
-
query(params: {
|
|
319
|
-
where: string;
|
|
320
|
-
limit?: number;
|
|
321
|
-
}): Promise<any>;
|
|
322
|
-
/**
|
|
323
|
-
* Sort by column
|
|
324
|
-
*
|
|
325
|
-
* Sorts all data rows by the specified column.
|
|
326
|
-
*
|
|
327
|
-
* @param column Column name or letter to sort by
|
|
328
|
-
* @param order Sort order: "asc" or "desc" (default: "asc")
|
|
329
|
-
* @example sort({ column: 'Age', order: 'desc' })
|
|
330
|
-
*/
|
|
331
|
-
sort(params: {
|
|
332
|
-
column: string;
|
|
333
|
-
order?: string;
|
|
334
|
-
}): Promise<Record<string, any>>;
|
|
335
|
-
/**
|
|
336
|
-
* Fill a range with values or a pattern
|
|
337
|
-
*
|
|
338
|
-
* @param range Cell range (e.g., "A1:A10")
|
|
339
|
-
* @param pattern Comma-separated values to repeat (e.g., "1,2,3")
|
|
340
|
-
* @example fill({ range: 'A1:A10', pattern: '1,2,3' })
|
|
341
|
-
*/
|
|
342
|
-
fill(params: {
|
|
343
|
-
range: string;
|
|
344
|
-
pattern: string;
|
|
345
|
-
}): Promise<Record<string, any>>;
|
|
346
|
-
/**
|
|
347
|
-
* Show column headers and detected types
|
|
348
|
-
*
|
|
349
|
-
* @format table
|
|
350
|
-
*/
|
|
351
|
-
schema(): Promise<{
|
|
352
|
-
table: string;
|
|
353
|
-
schema: any;
|
|
354
|
-
headers: any;
|
|
355
|
-
message: string;
|
|
356
|
-
file: string;
|
|
357
|
-
}>;
|
|
358
|
-
/**
|
|
359
|
-
* Resize the spreadsheet grid
|
|
360
|
-
*
|
|
361
|
-
* @param rows New number of rows
|
|
362
|
-
* @param cols New number of columns
|
|
363
|
-
*/
|
|
364
|
-
resize(params: {
|
|
365
|
-
rows?: number;
|
|
366
|
-
cols?: number;
|
|
367
|
-
}): Promise<Record<string, any>>;
|
|
368
|
-
/**
|
|
369
|
-
* Import CSV data
|
|
370
|
-
*
|
|
371
|
-
* Load data from a CSV file path or raw CSV text. The first row is treated as headers.
|
|
372
|
-
*
|
|
373
|
-
* @param file Path to a CSV file to import
|
|
374
|
-
* @param csv Raw CSV text to import (alternative to file)
|
|
375
|
-
* @example ingest({ csv: 'Name,Age\\nAlice,30\\nBob,25' })
|
|
376
|
-
*/
|
|
377
|
-
ingest(params: {
|
|
378
|
-
file?: string;
|
|
379
|
-
csv?: string;
|
|
380
|
-
}): Promise<Record<string, any>>;
|
|
381
|
-
/**
|
|
382
|
-
* Export as CSV
|
|
383
|
-
*
|
|
384
|
-
* Returns the raw CSV content (with formulas preserved), or saves to a file.
|
|
385
|
-
*
|
|
386
|
-
* @param file Optional file path to save CSV to
|
|
387
|
-
*/
|
|
388
|
-
dump(params?: {
|
|
389
|
-
file?: string;
|
|
390
|
-
}): Promise<{
|
|
391
|
-
message: string;
|
|
392
|
-
file: string;
|
|
393
|
-
csv?: undefined;
|
|
394
|
-
} | {
|
|
395
|
-
csv: any;
|
|
396
|
-
message: string;
|
|
397
|
-
file?: undefined;
|
|
398
|
-
}>;
|
|
399
|
-
/**
|
|
400
|
-
* Clear cells
|
|
401
|
-
*
|
|
402
|
-
* Clear all cells or a specific range.
|
|
403
|
-
*
|
|
404
|
-
* @param range Optional range to clear (e.g., "B:B" or "A1:C5"). Clears all if omitted.
|
|
405
|
-
*/
|
|
406
|
-
clear(params?: {
|
|
407
|
-
range?: string;
|
|
408
|
-
}): Promise<Record<string, any>>;
|
|
409
|
-
/**
|
|
410
|
-
* Rename a column header
|
|
411
|
-
*
|
|
412
|
-
* @param column Column letter or current header name
|
|
413
|
-
* @param name New header name
|
|
414
|
-
* @example rename({ column: 'A', name: 'Product' })
|
|
415
|
-
*/
|
|
416
|
-
rename(params: {
|
|
417
|
-
column: string;
|
|
418
|
-
name: string;
|
|
419
|
-
}): Promise<Record<string, any>>;
|
|
420
|
-
/**
|
|
421
|
-
* Set column formatting
|
|
422
|
-
*
|
|
423
|
-
* Set alignment, type, or width for a column. This creates a format row in the CSV
|
|
424
|
-
* when formatting is set to "auto" (default).
|
|
425
|
-
*
|
|
426
|
-
* @param column Column letter or header name
|
|
427
|
-
* @param align Alignment: "left", "right", or "center"
|
|
428
|
-
* @param type Column type: "text", "number", "currency", "percent", "date", "bool", "select", "formula", "markdown", "longtext"
|
|
429
|
-
* @param width Column width in pixels
|
|
430
|
-
* @param wrap Enable text wrapping for this column
|
|
431
|
-
* @example format({ column: 'B', align: 'right', type: 'number' })
|
|
432
|
-
* @example format({ column: 'C', type: 'markdown', wrap: true })
|
|
433
|
-
*/
|
|
434
|
-
format(params: {
|
|
435
|
-
column: string;
|
|
436
|
-
align?: string;
|
|
437
|
-
type?: string;
|
|
438
|
-
width?: number;
|
|
439
|
-
wrap?: boolean;
|
|
440
|
-
}): Promise<Record<string, any>>;
|
|
441
|
-
/**
|
|
442
|
-
* Watch the CSV file for appended rows
|
|
443
|
-
*
|
|
444
|
-
* Starts watching the underlying CSV file. When external processes append rows,
|
|
445
|
-
* the spreadsheet updates in real-time. Use `unwatch` to stop.
|
|
446
|
-
*/
|
|
447
|
-
tail(): Promise<{
|
|
448
|
-
message: string;
|
|
449
|
-
file: string;
|
|
450
|
-
watching: boolean;
|
|
451
|
-
} | {
|
|
452
|
-
watching: boolean;
|
|
453
|
-
message?: undefined;
|
|
454
|
-
file?: undefined;
|
|
455
|
-
}>;
|
|
456
|
-
/**
|
|
457
|
-
* Stop watching the CSV file
|
|
458
|
-
*
|
|
459
|
-
* Stops the file watcher started by `tail`.
|
|
460
|
-
*/
|
|
461
|
-
untail(): Promise<{
|
|
462
|
-
message: string;
|
|
463
|
-
watching: boolean;
|
|
464
|
-
}>;
|
|
465
|
-
/**
|
|
466
|
-
* Append rows to the spreadsheet
|
|
467
|
-
*
|
|
468
|
-
* Batch-append one or more rows. Each row is a list of values matching
|
|
469
|
-
* the column order, or a key-value object mapping column names to values.
|
|
470
|
-
* Emits after all rows are added so charts and UIs update once.
|
|
471
|
-
*
|
|
472
|
-
* @param rows Array of rows to append. Each row is either an array of values or a {column: value} object.
|
|
473
|
-
* @example push({ rows: [["Alice", "30"], ["Bob", "25"]] })
|
|
474
|
-
* @example push({ rows: [{"Name": "Alice", "Age": "30"}] })
|
|
475
|
-
*/
|
|
476
|
-
push(params: {
|
|
477
|
-
rows: (string[] | Record<string, string>)[];
|
|
478
|
-
}): Promise<Record<string, any>>;
|
|
479
|
-
/** Handle file change detected by watcher */
|
|
480
|
-
private _onFileChanged;
|
|
481
|
-
/**
|
|
482
|
-
* Run a SQL query on the spreadsheet data
|
|
483
|
-
*
|
|
484
|
-
* Query the spreadsheet using SQL syntax. Table name is `data`.
|
|
485
|
-
* Column names with spaces or special characters need double quotes.
|
|
486
|
-
*
|
|
487
|
-
* @param query SQL query string (e.g., "SELECT * FROM data WHERE Age > 25")
|
|
488
|
-
* @example sql({ query: "SELECT Name, Age FROM data WHERE Age > 25 ORDER BY Age DESC" })
|
|
489
|
-
* @example sql({ query: "SELECT COUNT(*) as total FROM data" })
|
|
490
|
-
*/
|
|
491
|
-
sql(params: {
|
|
492
|
-
query: string;
|
|
493
|
-
}): Promise<any>;
|
|
494
|
-
/**
|
|
495
|
-
* Create a live SQL watch
|
|
496
|
-
*
|
|
497
|
-
* Registers a named SQL query that re-runs after every data change.
|
|
498
|
-
* When the query returns rows, an alert is emitted. Optionally triggers
|
|
499
|
-
* a cross-photon action (e.g., "slack.send").
|
|
500
|
-
*
|
|
501
|
-
* @param name Unique watch name (e.g., "price-alert")
|
|
502
|
-
* @param query SQL query — fires when it returns rows (e.g., "SELECT * FROM data WHERE Price < 50")
|
|
503
|
-
* @param action Optional cross-photon call target (e.g., "slack.send")
|
|
504
|
-
* @param actionParams Optional parameters passed to the action
|
|
505
|
-
* @param once If true, auto-removes after first trigger
|
|
506
|
-
* @example watch({ name: "big-orders", query: "SELECT * FROM data WHERE Amount > 1000" })
|
|
507
|
-
* @example watch({ name: "notify", query: "SELECT * FROM data WHERE Status = 'critical'", action: "slack.send", actionParams: { text: "Critical row found!" }, once: true })
|
|
508
|
-
*/
|
|
509
|
-
watch(params: {
|
|
510
|
-
name: string;
|
|
511
|
-
query: string;
|
|
512
|
-
action?: string;
|
|
513
|
-
actionParams?: Record<string, any>;
|
|
514
|
-
once?: boolean;
|
|
515
|
-
}): Promise<{
|
|
516
|
-
message: string;
|
|
517
|
-
watch: string;
|
|
518
|
-
currentMatches: number;
|
|
519
|
-
watches: number;
|
|
520
|
-
}>;
|
|
521
|
-
/**
|
|
522
|
-
* Remove a live SQL watch
|
|
523
|
-
*
|
|
524
|
-
* @param name Watch name to remove
|
|
525
|
-
*/
|
|
526
|
-
unwatch(params: {
|
|
527
|
-
name: string;
|
|
528
|
-
}): Promise<{
|
|
529
|
-
message: string;
|
|
530
|
-
watches: number;
|
|
531
|
-
}>;
|
|
532
|
-
/**
|
|
533
|
-
* List active SQL watches
|
|
534
|
-
*
|
|
535
|
-
* Shows all registered watches with their trigger counts and status.
|
|
536
|
-
*/
|
|
537
|
-
watches(): Promise<{
|
|
538
|
-
watches: {
|
|
539
|
-
name: string;
|
|
540
|
-
query: string;
|
|
541
|
-
action: string | undefined;
|
|
542
|
-
once: boolean;
|
|
543
|
-
triggerCount: number;
|
|
544
|
-
lastTriggered: string | null;
|
|
545
|
-
}[];
|
|
546
|
-
count: number;
|
|
547
|
-
message: string;
|
|
548
|
-
}>;
|
|
549
|
-
private _startFileWatching;
|
|
550
|
-
private _stopFileWatching;
|
|
551
|
-
private _emitAndWatch;
|
|
552
|
-
private _rerunWatches;
|
|
553
|
-
}
|
|
554
|
-
//# sourceMappingURL=spreadsheet.photon.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spreadsheet.photon.d.ts","sourceRoot":"","sources":["../../src/photons/spreadsheet.photon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA2CH,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B,OAAO,CAAC,MAAM,CAAM;IACpB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,aAAa,CAAM;IAC3B,OAAO,CAAC,KAAK,CAAyB;IACtC,OAAO,CAAC,qBAAqB,CAAmB;IAChD,OAAO,CAAC,QAAQ,CAA+B;IAG/C,OAAO,CAAC,QAAQ,CAA0B;IAC1C,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,cAAc,CAA8C;IAE5D,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAC1B,IAAI,EAAE,CACZ,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC5B,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,KAC5B,OAAO,CAAC,GAAG,CAAC,CAAC;IACV,Y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