@hostwebhook/node-types 1.52.7 → 1.52.9

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/index.d.ts CHANGED
@@ -19,6 +19,10 @@ export { DISCORD_OPERATIONS, DISCORD_OPERATION_SPECS, isDiscordOperation, } from
19
19
  export type { DiscordOperation, DiscordParamSpec, DiscordOperationSpec, } from './discord-operations';
20
20
  export { SLACK_OPERATIONS, SLACK_OPERATION_SPECS, isSlackOperation, } from './slack-operations';
21
21
  export type { SlackOperation, SlackParamSpec, SlackOperationSpec, } from './slack-operations';
22
+ export { SHEETS_OPERATIONS, SHEETS_OPERATION_SPECS, isSheetsOperation, } from './sheets-operations';
23
+ export type { SheetsOperation, SheetsParamSpec, SheetsOperationSpec, } from './sheets-operations';
24
+ export { SHEETS_TOOLKIT_SPECS, SHEETS_TOOLKIT_BY_TOOL_NAME, SHEETS_TOOLKIT_DEFAULTABLE, } from './sheets-toolkit';
25
+ export type { SheetsToolkitSpec, SheetsToolkitParameter, } from './sheets-toolkit';
22
26
  export { GOOGLE_CONTACTS_OPERATIONS, GOOGLE_CONTACTS_OPERATIONS_V1, GOOGLE_CONTACTS_OPERATIONS_V2, GOOGLE_CONTACTS_OPERATION_SPECS, GOOGLE_CONTACTS_OPERATION_GROUPS, GOOGLE_CONTACTS_DEFAULT_PERSON_FIELDS, isGoogleContactsOperation, } from './google-contacts-operations';
23
27
  export type { GoogleContactsOperation, GoogleContactsParamSpec, GoogleContactsOperationSpec, GoogleContactsOperationGroup, } from './google-contacts-operations';
24
28
  export type { CredentialTypeRegistration, CredentialType } from './credentials';
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isCredentialType = exports.getCredentialType = exports.credentialTypeValues = exports.CREDENTIAL_TYPE_VALUES = exports.CREDENTIAL_TYPES = exports.isGoogleContactsOperation = exports.GOOGLE_CONTACTS_DEFAULT_PERSON_FIELDS = exports.GOOGLE_CONTACTS_OPERATION_GROUPS = exports.GOOGLE_CONTACTS_OPERATION_SPECS = exports.GOOGLE_CONTACTS_OPERATIONS_V2 = exports.GOOGLE_CONTACTS_OPERATIONS_V1 = exports.GOOGLE_CONTACTS_OPERATIONS = exports.isSlackOperation = exports.SLACK_OPERATION_SPECS = exports.SLACK_OPERATIONS = exports.isDiscordOperation = exports.DISCORD_OPERATION_SPECS = exports.DISCORD_OPERATIONS = exports.isWhatsAppOperation = exports.WHATSAPP_OPERATIONS = exports.isTelegramOperation = exports.TELEGRAM_OPERATIONS = exports.isDriveOperation = exports.DRIVE_OPERATIONS = exports.isGoogleCalendarOperation = exports.GOOGLE_CALENDAR_OPERATIONS = exports.isGmailOperation = exports.GMAIL_OPERATIONS = exports.NODE_TYPE_TO_PREFIX = exports.PREFIX_TO_NODE_TYPE = exports.NODE_STATE_KEYS = exports.NODE_COLORS = exports.NODE_DETAIL_PATHS = exports.getNodeRegistryEntry = exports.NODE_REGISTRY = exports.getNodeDispatchConfig = exports.getAllNodeCollections = exports.NODE_DISPATCH = exports.resolveNodeId = exports.PREFIX_TO_TYPE = exports.NODE_UI = exports.ALL_NODE_TYPES = exports.isNodeType = exports.isTerminal = exports.canSendToNodes = exports.canReceiveFromNodes = exports.canReceiveFrom = exports.NODE_CONNECTIONS = exports.iterableMeta = exports.singleMeta = void 0;
3
+ exports.GOOGLE_CONTACTS_DEFAULT_PERSON_FIELDS = exports.GOOGLE_CONTACTS_OPERATION_GROUPS = exports.GOOGLE_CONTACTS_OPERATION_SPECS = exports.GOOGLE_CONTACTS_OPERATIONS_V2 = exports.GOOGLE_CONTACTS_OPERATIONS_V1 = exports.GOOGLE_CONTACTS_OPERATIONS = exports.SHEETS_TOOLKIT_DEFAULTABLE = exports.SHEETS_TOOLKIT_BY_TOOL_NAME = exports.SHEETS_TOOLKIT_SPECS = exports.isSheetsOperation = exports.SHEETS_OPERATION_SPECS = exports.SHEETS_OPERATIONS = exports.isSlackOperation = exports.SLACK_OPERATION_SPECS = exports.SLACK_OPERATIONS = exports.isDiscordOperation = exports.DISCORD_OPERATION_SPECS = exports.DISCORD_OPERATIONS = exports.isWhatsAppOperation = exports.WHATSAPP_OPERATIONS = exports.isTelegramOperation = exports.TELEGRAM_OPERATIONS = exports.isDriveOperation = exports.DRIVE_OPERATIONS = exports.isGoogleCalendarOperation = exports.GOOGLE_CALENDAR_OPERATIONS = exports.isGmailOperation = exports.GMAIL_OPERATIONS = exports.NODE_TYPE_TO_PREFIX = exports.PREFIX_TO_NODE_TYPE = exports.NODE_STATE_KEYS = exports.NODE_COLORS = exports.NODE_DETAIL_PATHS = exports.getNodeRegistryEntry = exports.NODE_REGISTRY = exports.getNodeDispatchConfig = exports.getAllNodeCollections = exports.NODE_DISPATCH = exports.resolveNodeId = exports.PREFIX_TO_TYPE = exports.NODE_UI = exports.ALL_NODE_TYPES = exports.isNodeType = exports.isTerminal = exports.canSendToNodes = exports.canReceiveFromNodes = exports.canReceiveFrom = exports.NODE_CONNECTIONS = exports.iterableMeta = exports.singleMeta = void 0;
4
+ exports.isCredentialType = exports.getCredentialType = exports.credentialTypeValues = exports.CREDENTIAL_TYPE_VALUES = exports.CREDENTIAL_TYPES = exports.isGoogleContactsOperation = void 0;
4
5
  var types_1 = require("./types");
5
6
  Object.defineProperty(exports, "singleMeta", { enumerable: true, get: function () { return types_1.singleMeta; } });
6
7
  Object.defineProperty(exports, "iterableMeta", { enumerable: true, get: function () { return types_1.iterableMeta; } });
@@ -55,6 +56,14 @@ var slack_operations_1 = require("./slack-operations");
55
56
  Object.defineProperty(exports, "SLACK_OPERATIONS", { enumerable: true, get: function () { return slack_operations_1.SLACK_OPERATIONS; } });
56
57
  Object.defineProperty(exports, "SLACK_OPERATION_SPECS", { enumerable: true, get: function () { return slack_operations_1.SLACK_OPERATION_SPECS; } });
57
58
  Object.defineProperty(exports, "isSlackOperation", { enumerable: true, get: function () { return slack_operations_1.isSlackOperation; } });
59
+ var sheets_operations_1 = require("./sheets-operations");
60
+ Object.defineProperty(exports, "SHEETS_OPERATIONS", { enumerable: true, get: function () { return sheets_operations_1.SHEETS_OPERATIONS; } });
61
+ Object.defineProperty(exports, "SHEETS_OPERATION_SPECS", { enumerable: true, get: function () { return sheets_operations_1.SHEETS_OPERATION_SPECS; } });
62
+ Object.defineProperty(exports, "isSheetsOperation", { enumerable: true, get: function () { return sheets_operations_1.isSheetsOperation; } });
63
+ var sheets_toolkit_1 = require("./sheets-toolkit");
64
+ Object.defineProperty(exports, "SHEETS_TOOLKIT_SPECS", { enumerable: true, get: function () { return sheets_toolkit_1.SHEETS_TOOLKIT_SPECS; } });
65
+ Object.defineProperty(exports, "SHEETS_TOOLKIT_BY_TOOL_NAME", { enumerable: true, get: function () { return sheets_toolkit_1.SHEETS_TOOLKIT_BY_TOOL_NAME; } });
66
+ Object.defineProperty(exports, "SHEETS_TOOLKIT_DEFAULTABLE", { enumerable: true, get: function () { return sheets_toolkit_1.SHEETS_TOOLKIT_DEFAULTABLE; } });
58
67
  var google_contacts_operations_1 = require("./google-contacts-operations");
59
68
  Object.defineProperty(exports, "GOOGLE_CONTACTS_OPERATIONS", { enumerable: true, get: function () { return google_contacts_operations_1.GOOGLE_CONTACTS_OPERATIONS; } });
60
69
  Object.defineProperty(exports, "GOOGLE_CONTACTS_OPERATIONS_V1", { enumerable: true, get: function () { return google_contacts_operations_1.GOOGLE_CONTACTS_OPERATIONS_V1; } });
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Google Sheets operation enum + form schema — single source of truth across
3
+ * the API, Dashboard, and Message Broker. Used by:
4
+ * - sheetsAction entity / DTO (api): operation field + validation
5
+ * - dashboard SheetsAction detail page: the whole operation form
6
+ *
7
+ * The api already accepts these six; the dashboard's own `SheetsAction` type
8
+ * only listed four (it never learned about appendOrUpdateRow and
9
+ * createSpreadsheet), which is exactly the drift this enum removes.
10
+ */
11
+ export declare const SHEETS_OPERATIONS: readonly ["appendRow", "updateRow", "appendOrUpdateRow", "readRange", "getRows", "createSpreadsheet"];
12
+ export type SheetsOperation = (typeof SHEETS_OPERATIONS)[number];
13
+ /** Type guard — useful when validating untrusted input (DTOs, AI tool calls). */
14
+ export declare function isSheetsOperation(value: unknown): value is SheetsOperation;
15
+ /**
16
+ * Per-operation form schema, same idea as SLACK_OPERATION_SPECS and
17
+ * GOOGLE_CONTACTS_OPERATION_SPECS: the detail page renders it with one loop
18
+ * instead of a branch per operation.
19
+ *
20
+ * Two things make this node's schema different from the others, and both are
21
+ * deliberate:
22
+ *
23
+ * 1. **The values are top-level entity fields, not an `operationConfig`
24
+ * record.** `name` here is the property on the sheetsAction document
25
+ * (`spreadsheetId`, `sheetName`, …), and `columnMapping` is a complex field.
26
+ * A renderer copied from Contacts would write to the wrong place.
27
+ * 2. **Half the fields are discovered at run time.** The column list comes from
28
+ * the chosen sheet's header row, fetched live. So the schema names the
29
+ * *picker* rather than carrying options — the same trick Discord's
30
+ * `channel` / `guild` / `role` types use.
31
+ */
32
+ export interface SheetsParamSpec {
33
+ /** Field key — the property name on the sheetsAction document. */
34
+ name: string;
35
+ /** UI label. Empty string where the control has never shown one. */
36
+ label: string;
37
+ /**
38
+ * Param type for form rendering.
39
+ *
40
+ * - `string` — one-line input with `{{payload.x}}` templating.
41
+ * - `spreadsheet` — the spreadsheet picker **plus** the "or paste ID / URL"
42
+ * input that sits under it. They are one field with two ways in, not two
43
+ * fields, and the paste box extracts the id out of a full URL.
44
+ * - `sheetTab` — the tab picker for the chosen spreadsheet. Picking a tab
45
+ * clears `columnMapping`, because the headers just changed.
46
+ * - `headerColumn` — a dropdown of the sheet's live header row.
47
+ * - `columnMapping` — the header-to-template editor. It owns the three
48
+ * states of the header fetch (loading, loaded, failed), which is what
49
+ * used to be six copies of the same conditional in the page.
50
+ */
51
+ type: 'string' | 'spreadsheet' | 'sheetTab' | 'headerColumn' | 'columnMapping';
52
+ /** Required by the operation. Metadata — the form does not gate on it. */
53
+ required?: boolean;
54
+ /** Help text under the control. Absent where the form shows none. */
55
+ description?: string;
56
+ /** Hint shown inside the input. */
57
+ placeholder?: string;
58
+ /**
59
+ * Section this field is rendered inside. Fields without one share the first
60
+ * section with the operation picker; the mapping fields sit in a second
61
+ * section whose title changes per operation ("Columns to Append",
62
+ * "Update Row", "Match & Upsert").
63
+ */
64
+ section?: string;
65
+ /** `columnMapping` only — the line shown while no column has been added. */
66
+ emptyText?: string;
67
+ }
68
+ export interface SheetsOperationSpec {
69
+ /** UI label for the operation picker. */
70
+ label: string;
71
+ /** Sub-line under the label in the picker. */
72
+ description: string;
73
+ /** googleapis call the operation maps to (sheets v4). */
74
+ apiMethod: string;
75
+ /** Parameter schema. Order matters for form rendering. */
76
+ params: SheetsParamSpec[];
77
+ }
78
+ export declare const SHEETS_OPERATION_SPECS: Record<SheetsOperation, SheetsOperationSpec>;
@@ -0,0 +1,154 @@
1
+ "use strict";
2
+ /**
3
+ * Google Sheets operation enum + form schema — single source of truth across
4
+ * the API, Dashboard, and Message Broker. Used by:
5
+ * - sheetsAction entity / DTO (api): operation field + validation
6
+ * - dashboard SheetsAction detail page: the whole operation form
7
+ *
8
+ * The api already accepts these six; the dashboard's own `SheetsAction` type
9
+ * only listed four (it never learned about appendOrUpdateRow and
10
+ * createSpreadsheet), which is exactly the drift this enum removes.
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.SHEETS_OPERATION_SPECS = exports.SHEETS_OPERATIONS = void 0;
14
+ exports.isSheetsOperation = isSheetsOperation;
15
+ exports.SHEETS_OPERATIONS = [
16
+ 'appendRow',
17
+ 'updateRow',
18
+ 'appendOrUpdateRow',
19
+ 'readRange',
20
+ 'getRows',
21
+ 'createSpreadsheet',
22
+ ];
23
+ /** Type guard — useful when validating untrusted input (DTOs, AI tool calls). */
24
+ function isSheetsOperation(value) {
25
+ return (typeof value === 'string' &&
26
+ exports.SHEETS_OPERATIONS.includes(value));
27
+ }
28
+ /* Fields most operations share. The spreadsheet and its tab are the same two
29
+ controls everywhere they appear — createSpreadsheet is the only operation
30
+ that shows neither, because there is no document yet to point at. */
31
+ const spreadsheet = () => ({
32
+ name: 'spreadsheetId',
33
+ label: 'Select Spreadsheet',
34
+ type: 'spreadsheet',
35
+ required: true,
36
+ });
37
+ const sheetTab = () => ({
38
+ name: 'sheetName',
39
+ label: 'Sheet Name',
40
+ type: 'sheetTab',
41
+ required: true,
42
+ });
43
+ /** The mapping editor, whose label, section and empty line change per op. */
44
+ const columnMapping = (over = {}) => ({
45
+ name: 'columnMapping',
46
+ label: 'Columns to Update',
47
+ type: 'columnMapping',
48
+ emptyText: 'No columns selected. Add columns to update.',
49
+ ...over,
50
+ });
51
+ /** Which row to touch: the column to search in, and the value to look for. */
52
+ const matchFields = (section) => [
53
+ {
54
+ name: 'matchColumn',
55
+ label: 'Match Column',
56
+ type: 'headerColumn',
57
+ required: true,
58
+ description: 'Select the column to find the row to update',
59
+ section,
60
+ },
61
+ {
62
+ /* No static placeholder or description: both are built from the chosen
63
+ column at render time ({{payload.<column>}} and 'Template to match
64
+ against "<column>"'), so the schema cannot carry them. */
65
+ name: 'matchValueTemplate',
66
+ label: 'Match Value',
67
+ type: 'string',
68
+ required: true,
69
+ section,
70
+ },
71
+ ];
72
+ exports.SHEETS_OPERATION_SPECS = {
73
+ appendRow: {
74
+ label: 'Append Row',
75
+ description: 'Add a new row at the bottom',
76
+ apiMethod: 'spreadsheets.values.batchUpdate',
77
+ params: [
78
+ spreadsheet(),
79
+ sheetTab(),
80
+ columnMapping({
81
+ /* The append editor has never carried a label of its own — the section
82
+ title above it already says "Columns to Append". */
83
+ label: '',
84
+ section: 'Columns to Append',
85
+ emptyText: 'No columns selected. Add columns to populate in the new row.',
86
+ }),
87
+ ],
88
+ },
89
+ updateRow: {
90
+ label: 'Update Row',
91
+ description: 'Update cells in a specific range',
92
+ apiMethod: 'spreadsheets.values.batchUpdate',
93
+ params: [
94
+ spreadsheet(),
95
+ sheetTab(),
96
+ ...matchFields('Update Row'),
97
+ columnMapping({ section: 'Update Row' }),
98
+ ],
99
+ },
100
+ appendOrUpdateRow: {
101
+ label: 'Append or Update',
102
+ description: 'Update if row exists, append if not',
103
+ apiMethod: 'spreadsheets.values.batchUpdate',
104
+ /* Same fields as updateRow — only the section title differs. The label
105
+ inside still reads "Columns to Update", which is what the page has always
106
+ shown. */
107
+ params: [
108
+ spreadsheet(),
109
+ sheetTab(),
110
+ ...matchFields('Match & Upsert'),
111
+ columnMapping({ section: 'Match & Upsert' }),
112
+ ],
113
+ },
114
+ readRange: {
115
+ label: 'Read Range',
116
+ description: 'Read cells from a specific range',
117
+ apiMethod: 'spreadsheets.values.get',
118
+ params: [
119
+ spreadsheet(),
120
+ sheetTab(),
121
+ {
122
+ name: 'rangeTemplate',
123
+ label: 'Range Template',
124
+ type: 'string',
125
+ required: true,
126
+ placeholder: 'e.g. A2:D100',
127
+ },
128
+ ],
129
+ },
130
+ getRows: {
131
+ label: 'Get Rows',
132
+ description: 'Read all rows with headers as keys',
133
+ apiMethod: 'spreadsheets.values.get',
134
+ params: [spreadsheet(), sheetTab()],
135
+ },
136
+ createSpreadsheet: {
137
+ label: 'Create Spreadsheet',
138
+ description: 'Create a new Google Sheets spreadsheet',
139
+ apiMethod: 'spreadsheets.create',
140
+ /* `sheetName` means the **new document's title** here, not a tab — the one
141
+ field in this node that changes meaning *and* control between
142
+ operations. The api uses it for both the file name and its first tab. */
143
+ params: [
144
+ {
145
+ name: 'sheetName',
146
+ label: 'Spreadsheet Title',
147
+ type: 'string',
148
+ required: true,
149
+ placeholder: 'My New Spreadsheet',
150
+ description: 'Name of the new spreadsheet. Supports {{payload.field}} templates.',
151
+ },
152
+ ],
153
+ },
154
+ };
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Google Sheets AI Toolkit — las herramientas que un sheetsAction expone
3
+ * cuando `aiEnabled` está encendido.
4
+ *
5
+ * **Se escribe una sola vez.** Las especificaciones de toolkit de los demás
6
+ * nodos viven dos veces —una copia en el dashboard y otra en
7
+ * `api/src/mcp-servers/toolkit-specs.ts`, las dos a mano y sin nada que las
8
+ * ate— y de ahí salió que Contacts anunciara 15 herramientas y expusiera una.
9
+ * Sheets empieza por el otro lado: aquí, y las dos capas la importan.
10
+ *
11
+ * La forma es la que ya consume `toolkitSpecToMcpTool` en la api, para que
12
+ * pueda usarse sin adaptador. Los textos van en inglés porque los lee el modelo
13
+ * y quien mire la lista de herramientas del servidor MCP.
14
+ */
15
+ import type { SheetsOperation } from './sheets-operations';
16
+ export interface SheetsToolkitParameter {
17
+ name: string;
18
+ /** El esquema MCP sólo admite estos tres; lo estructurado viaja como JSON
19
+ * en un `string`, igual que el `contacts` del toolkit de Contacts. */
20
+ type: 'string' | 'number' | 'boolean';
21
+ description: string;
22
+ required: boolean;
23
+ }
24
+ export interface SheetsToolkitSpec {
25
+ operation: SheetsOperation;
26
+ label: string;
27
+ toolName: string;
28
+ description: string;
29
+ parameters: SheetsToolkitParameter[];
30
+ /** Escribe en la hoja del usuario. Lo usa la confirmación previa del AI Node. */
31
+ destructive?: boolean;
32
+ }
33
+ export declare const SHEETS_TOOLKIT_SPECS: SheetsToolkitSpec[];
34
+ /** Las herramientas por nombre, para despachar una llamada del modelo. */
35
+ export declare const SHEETS_TOOLKIT_BY_TOOL_NAME: Record<string, SheetsToolkitSpec>;
36
+ /**
37
+ * Los dos parámetros que el nodo puede rellenar por defecto. Se exporta para
38
+ * que la api y el dashboard no vuelvan a escribir la lista a mano —
39
+ * `create_spreadsheet` no declara ninguno de los dos y por eso se queda fuera
40
+ * de la inyección sin necesidad de excepciones.
41
+ */
42
+ export declare const SHEETS_TOOLKIT_DEFAULTABLE: readonly ["spreadsheetId", "sheetName"];
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ /**
3
+ * Google Sheets AI Toolkit — las herramientas que un sheetsAction expone
4
+ * cuando `aiEnabled` está encendido.
5
+ *
6
+ * **Se escribe una sola vez.** Las especificaciones de toolkit de los demás
7
+ * nodos viven dos veces —una copia en el dashboard y otra en
8
+ * `api/src/mcp-servers/toolkit-specs.ts`, las dos a mano y sin nada que las
9
+ * ate— y de ahí salió que Contacts anunciara 15 herramientas y expusiera una.
10
+ * Sheets empieza por el otro lado: aquí, y las dos capas la importan.
11
+ *
12
+ * La forma es la que ya consume `toolkitSpecToMcpTool` en la api, para que
13
+ * pueda usarse sin adaptador. Los textos van en inglés porque los lee el modelo
14
+ * y quien mire la lista de herramientas del servidor MCP.
15
+ */
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.SHEETS_TOOLKIT_DEFAULTABLE = exports.SHEETS_TOOLKIT_BY_TOOL_NAME = exports.SHEETS_TOOLKIT_SPECS = void 0;
18
+ const p = (name, description, required = true, type = 'string') => ({ name, type, description, required });
19
+ /*
20
+ * La hoja y la pestaña del nodo van como **defecto**, y el modelo puede
21
+ * cambiarlas — la misma decisión que el canal por defecto de Slack, y la misma
22
+ * maquinaria: `toolkitSpecToMcpTool(spec, nombre, { spreadsheetId, sheetName })`
23
+ * saca esos dos de `required` **y le cuenta el valor al modelo** en la
24
+ * descripción. Las dos cosas o ninguna: mientras el esquema diga `required`, el
25
+ * LLM siempre los rellena, nunca los omite, y el valor configurado no se usaría
26
+ * jamás.
27
+ *
28
+ * Por eso aquí se declaran `required: true`: lo son para la API de Google, y es
29
+ * el defecto del nodo quien los vuelve opcionales, nodo por nodo.
30
+ *
31
+ * `create_spreadsheet` es el único que NO los declara —no hay documento todavía
32
+ * al que apuntar— y su título se llama `title`, no `sheetName`. Si se llamara
33
+ * `sheetName`, la inyección de defectos vería que la operación declara ese
34
+ * parámetro y le pasaría como título el nombre de la pestaña del nodo: el
35
+ * documento nuevo nacería llamándose «Sheet1».
36
+ */
37
+ const hoja = () => p('spreadsheetId', "Id of the Google Sheets document — the long chunk of its URL, between /d/ and /edit.");
38
+ const pestana = () => p('sheetName', 'Name of the tab inside the document, exactly as it reads on its tab strip.');
39
+ const fila = (que) => p('row', `JSON object holding ${que}. Keys are the sheet's **header names**, spelled exactly as they appear in its title row: {"Name": "Ariel", "Email": "a@b.c"}. A key that is not a header makes the call fail, so when you do not know the headers, call get_rows first.`);
40
+ exports.SHEETS_TOOLKIT_SPECS = [
41
+ {
42
+ operation: 'appendRow',
43
+ label: 'Append row',
44
+ toolName: 'append_row',
45
+ description: 'Add a new row at the bottom of the tab. It does not check whether the row already exists — when it might, use append_or_update_row instead so you do not duplicate it.',
46
+ parameters: [fila('the values of the new row'), hoja(), pestana()],
47
+ destructive: true,
48
+ },
49
+ {
50
+ operation: 'updateRow',
51
+ label: 'Update row',
52
+ toolName: 'update_row',
53
+ description: 'Find a row by the value of one column and overwrite the cells you pass. When no row matches it writes nothing — it does not create one.',
54
+ parameters: [
55
+ p('matchColumn', 'Header of the column to search in, e.g. "Email".'),
56
+ p('matchValue', 'Value to look for inside that column. The whole cell is compared, not a fragment.'),
57
+ fila('the cells to overwrite; the ones you leave out keep their value'),
58
+ hoja(),
59
+ pestana(),
60
+ ],
61
+ destructive: true,
62
+ },
63
+ {
64
+ operation: 'appendOrUpdateRow',
65
+ label: 'Append or update row',
66
+ toolName: 'append_or_update_row',
67
+ description: 'Find a row by the value of one column: update it when it exists, append it at the bottom when it does not. This is the one to use to keep a sheet in sync without duplicating rows.',
68
+ parameters: [
69
+ p('matchColumn', 'Header of the column that identifies the row, e.g. "Email".'),
70
+ p('matchValue', 'Value to look for in that column. When it is not there, the row is appended.'),
71
+ fila('the values of the row, used both to update and to append'),
72
+ hoja(),
73
+ pestana(),
74
+ ],
75
+ destructive: true,
76
+ },
77
+ {
78
+ operation: 'readRange',
79
+ label: 'Read range',
80
+ toolName: 'read_range',
81
+ description: 'Read the cells of an A1-notation range and return them as rows of text, without reading headers. To read data with its column names, get_rows is more useful.',
82
+ parameters: [
83
+ p('range', 'A1-notation range relative to the tab, e.g. "A2:D100". Do not prefix it with the tab name.'),
84
+ hoja(),
85
+ pestana(),
86
+ ],
87
+ },
88
+ {
89
+ operation: 'getRows',
90
+ label: 'Get rows',
91
+ toolName: 'get_rows',
92
+ description: "Read every row of the tab and return them as objects keyed by the sheet's headers. This is how you find out which columns a sheet has before writing to it.",
93
+ parameters: [hoja(), pestana()],
94
+ },
95
+ {
96
+ operation: 'createSpreadsheet',
97
+ label: 'Create spreadsheet',
98
+ toolName: 'create_spreadsheet',
99
+ description: 'Create a new, empty Google Sheets document and return its id and URL. It writes no data: to fill it, call append_row afterwards with the id it returns.',
100
+ parameters: [
101
+ p('title', 'Name of the new document.'),
102
+ p('folderId', 'Id of the Drive folder to create it in. Left out, it lands in the root of My Drive.', false),
103
+ ],
104
+ destructive: true,
105
+ },
106
+ ];
107
+ /** Las herramientas por nombre, para despachar una llamada del modelo. */
108
+ exports.SHEETS_TOOLKIT_BY_TOOL_NAME = Object.fromEntries(exports.SHEETS_TOOLKIT_SPECS.map((s) => [s.toolName, s]));
109
+ /**
110
+ * Los dos parámetros que el nodo puede rellenar por defecto. Se exporta para
111
+ * que la api y el dashboard no vuelvan a escribir la lista a mano —
112
+ * `create_spreadsheet` no declara ninguno de los dos y por eso se queda fuera
113
+ * de la inyección sin necesidad de excepciones.
114
+ */
115
+ exports.SHEETS_TOOLKIT_DEFAULTABLE = ['spreadsheetId', 'sheetName'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostwebhook/node-types",
3
- "version": "1.52.7",
3
+ "version": "1.52.9",
4
4
  "description": "Shared node type definitions, connection rules, and dispatch config for HostWebhook",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",