@hostwebhook/node-types 1.52.15 → 1.52.16
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/docs-operations.d.ts +92 -0
- package/dist/docs-operations.js +124 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -1
- package/package.json +1 -1
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google Docs operation enum + esquema del formulario — una sola copia para la
|
|
3
|
+
* api, el Dashboard y el broker.
|
|
4
|
+
*
|
|
5
|
+
* ── Lo que quita ──
|
|
6
|
+
* La lista de cinco estaba escrita a mano **siete veces**: dos en la entidad
|
|
7
|
+
* (enum de Mongoose y unión de tipos), dos en el DTO (enum de Swagger y `@IsIn`),
|
|
8
|
+
* y tres en el dashboard (`lib/api.ts`, el array `OPERATIONS` de la página y el
|
|
9
|
+
* `OP_LABELS` del lienzo). El `operation` del DTO era además un `string` pelado:
|
|
10
|
+
* sólo lo sujetaba el `@IsIn` en tiempo de ejecución.
|
|
11
|
+
*
|
|
12
|
+
* ── Lo fácil de Docs ──
|
|
13
|
+
* Como Mongo, **no hay capa de renombrado**: el `name` de cada param es la prop
|
|
14
|
+
* de la entidad tal cual, y el `apiUpdate` de la página es un passthrough. El
|
|
15
|
+
* ejecutor lee `entity.documentId`, `entity.contentTemplate`… con esos mismos
|
|
16
|
+
* nombres.
|
|
17
|
+
*
|
|
18
|
+
* ── Lo raro de Docs: el desplegable va EN MEDIO ──
|
|
19
|
+
* En esta página el selector de operación **no** está arriba del todo. El orden
|
|
20
|
+
* de pantalla es «qué documento» → «qué hacer» → «con qué»:
|
|
21
|
+
*
|
|
22
|
+
* DocumentPicker + pegar ID (o el título, si es createDoc)
|
|
23
|
+
* ── selector de operación ──
|
|
24
|
+
* Content / Search+Replace / Rows+Columns
|
|
25
|
+
*
|
|
26
|
+
* Por eso cada param lleva `slot`. Sin él, un bucle único empujaría la identidad
|
|
27
|
+
* del documento por debajo del selector y cambiaría el orden en pantalla, que es
|
|
28
|
+
* justo lo que este refactor no debe tocar.
|
|
29
|
+
*/
|
|
30
|
+
export declare const DOCS_OPERATIONS: readonly ["readDoc", "createDoc", "appendText", "replaceText", "insertTable"];
|
|
31
|
+
export type DocsOperation = (typeof DOCS_OPERATIONS)[number];
|
|
32
|
+
/** Type guard — útil al validar entrada que no controlas (DTOs, tool calls). */
|
|
33
|
+
export declare function isDocsOperation(value: unknown): value is DocsOperation;
|
|
34
|
+
export type DocsParamType =
|
|
35
|
+
/**
|
|
36
|
+
* El `DocumentPicker` en vivo (lista los Docs de la credencial) **y** debajo
|
|
37
|
+
* un `TemplateInput` para pegar un ID o una plantilla. Son dos controles para
|
|
38
|
+
* un solo campo, como el `driveFile` de Drive.
|
|
39
|
+
*/
|
|
40
|
+
'docPicker'
|
|
41
|
+
/** `TemplateInput`: una línea con autocompletado de `{{payload.*}}`. */
|
|
42
|
+
| 'template'
|
|
43
|
+
/** `TemplateEditor` con `language="html"`, que es lo que acepta la api. */
|
|
44
|
+
| 'htmlTemplate'
|
|
45
|
+
/**
|
|
46
|
+
* `<input type="number">`. **Ojo**: en el cable esto viaja como NÚMERO, no
|
|
47
|
+
* como string. Es la razón del 400 que este cambio arregla — ver `min`/`max`.
|
|
48
|
+
*/
|
|
49
|
+
| 'number';
|
|
50
|
+
/**
|
|
51
|
+
* Antes o después del selector de operación.
|
|
52
|
+
*
|
|
53
|
+
* `'document'` es la identidad del documento, que se elige antes de decidir qué
|
|
54
|
+
* hacer con él. `'config'` son los campos de la operación.
|
|
55
|
+
*/
|
|
56
|
+
export type DocsParamSlot = 'document' | 'config';
|
|
57
|
+
export interface DocsParamSpec {
|
|
58
|
+
/** La prop de la entidad. Sin renombrado: es también la clave del cable. */
|
|
59
|
+
name: string;
|
|
60
|
+
label: string;
|
|
61
|
+
type: DocsParamType;
|
|
62
|
+
slot: DocsParamSlot;
|
|
63
|
+
/** Texto de ayuda. Llano: el paquete no lleva React. */
|
|
64
|
+
description?: string;
|
|
65
|
+
placeholder?: string;
|
|
66
|
+
/** Sólo `number`. Los topes NO son iguales en los dos: 50 filas, 20 columnas. */
|
|
67
|
+
min?: number;
|
|
68
|
+
max?: number;
|
|
69
|
+
/**
|
|
70
|
+
* Sólo `number`. Coincide con el `default` del `@Prop` de Mongoose, que es de
|
|
71
|
+
* donde salía el 3×3 que nadie podía cambiar.
|
|
72
|
+
*/
|
|
73
|
+
default?: number;
|
|
74
|
+
}
|
|
75
|
+
export interface DocsOperationSpec {
|
|
76
|
+
/** La del desplegable de la página de detalle y del panel: «Read Document». */
|
|
77
|
+
label: string;
|
|
78
|
+
/**
|
|
79
|
+
* La de la píldora del lienzo: «Read».
|
|
80
|
+
*
|
|
81
|
+
* **Son dos etiquetas a propósito**, como en Mongo y Calendar: la tarjeta del
|
|
82
|
+
* lienzo son 260px. Antes había una TERCERA convención, porque el panel pintaba
|
|
83
|
+
* el `operation` **crudo** y decía «insertTable» donde el lienzo decía «Table»
|
|
84
|
+
* y la página «Insert Table».
|
|
85
|
+
*/
|
|
86
|
+
labelShort: string;
|
|
87
|
+
/** Sub-línea del desplegable. */
|
|
88
|
+
description: string;
|
|
89
|
+
/** Orden de pantalla dentro de cada `slot`. */
|
|
90
|
+
params: DocsParamSpec[];
|
|
91
|
+
}
|
|
92
|
+
export declare const DOCS_OPERATION_SPECS: Record<DocsOperation, DocsOperationSpec>;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Google Docs operation enum + esquema del formulario — una sola copia para la
|
|
4
|
+
* api, el Dashboard y el broker.
|
|
5
|
+
*
|
|
6
|
+
* ── Lo que quita ──
|
|
7
|
+
* La lista de cinco estaba escrita a mano **siete veces**: dos en la entidad
|
|
8
|
+
* (enum de Mongoose y unión de tipos), dos en el DTO (enum de Swagger y `@IsIn`),
|
|
9
|
+
* y tres en el dashboard (`lib/api.ts`, el array `OPERATIONS` de la página y el
|
|
10
|
+
* `OP_LABELS` del lienzo). El `operation` del DTO era además un `string` pelado:
|
|
11
|
+
* sólo lo sujetaba el `@IsIn` en tiempo de ejecución.
|
|
12
|
+
*
|
|
13
|
+
* ── Lo fácil de Docs ──
|
|
14
|
+
* Como Mongo, **no hay capa de renombrado**: el `name` de cada param es la prop
|
|
15
|
+
* de la entidad tal cual, y el `apiUpdate` de la página es un passthrough. El
|
|
16
|
+
* ejecutor lee `entity.documentId`, `entity.contentTemplate`… con esos mismos
|
|
17
|
+
* nombres.
|
|
18
|
+
*
|
|
19
|
+
* ── Lo raro de Docs: el desplegable va EN MEDIO ──
|
|
20
|
+
* En esta página el selector de operación **no** está arriba del todo. El orden
|
|
21
|
+
* de pantalla es «qué documento» → «qué hacer» → «con qué»:
|
|
22
|
+
*
|
|
23
|
+
* DocumentPicker + pegar ID (o el título, si es createDoc)
|
|
24
|
+
* ── selector de operación ──
|
|
25
|
+
* Content / Search+Replace / Rows+Columns
|
|
26
|
+
*
|
|
27
|
+
* Por eso cada param lleva `slot`. Sin él, un bucle único empujaría la identidad
|
|
28
|
+
* del documento por debajo del selector y cambiaría el orden en pantalla, que es
|
|
29
|
+
* justo lo que este refactor no debe tocar.
|
|
30
|
+
*/
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.DOCS_OPERATION_SPECS = exports.DOCS_OPERATIONS = void 0;
|
|
33
|
+
exports.isDocsOperation = isDocsOperation;
|
|
34
|
+
exports.DOCS_OPERATIONS = [
|
|
35
|
+
'readDoc', // leer el contenido como texto plano
|
|
36
|
+
'createDoc', // crear un documento nuevo
|
|
37
|
+
'appendText', // añadir texto al final
|
|
38
|
+
'replaceText', // buscar y reemplazar
|
|
39
|
+
'insertTable', // insertar una tabla al final
|
|
40
|
+
];
|
|
41
|
+
/** Type guard — útil al validar entrada que no controlas (DTOs, tool calls). */
|
|
42
|
+
function isDocsOperation(value) {
|
|
43
|
+
return typeof value === 'string' && exports.DOCS_OPERATIONS.includes(value);
|
|
44
|
+
}
|
|
45
|
+
/* Los campos que comparten varias operaciones. */
|
|
46
|
+
const documentId = () => ({
|
|
47
|
+
name: 'documentId',
|
|
48
|
+
label: 'Or paste Document ID / template',
|
|
49
|
+
type: 'docPicker',
|
|
50
|
+
slot: 'document',
|
|
51
|
+
placeholder: '1BxiMVs0XRA5nFMdKvBd... or {{payload.documentId}}',
|
|
52
|
+
});
|
|
53
|
+
const contentTemplate = () => ({
|
|
54
|
+
name: 'contentTemplate',
|
|
55
|
+
label: 'Content',
|
|
56
|
+
type: 'htmlTemplate',
|
|
57
|
+
slot: 'config',
|
|
58
|
+
placeholder: 'Text to insert... supports {{payload.x}} templates',
|
|
59
|
+
});
|
|
60
|
+
exports.DOCS_OPERATION_SPECS = {
|
|
61
|
+
readDoc: {
|
|
62
|
+
label: 'Read Document',
|
|
63
|
+
labelShort: 'Read',
|
|
64
|
+
description: 'Get document content as plain text',
|
|
65
|
+
/* La única sin campos propios: sólo dice qué documento leer. */
|
|
66
|
+
params: [documentId()],
|
|
67
|
+
},
|
|
68
|
+
createDoc: {
|
|
69
|
+
label: 'Create Document',
|
|
70
|
+
labelShort: 'Create',
|
|
71
|
+
description: 'Create a new Google Doc',
|
|
72
|
+
/* La única SIN `documentId`: aquí el documento no existe todavía. Eso es lo
|
|
73
|
+
que en la página eran dos compuertas negadas (`!== "createDoc"`). */
|
|
74
|
+
params: [
|
|
75
|
+
{
|
|
76
|
+
name: 'documentTitle',
|
|
77
|
+
label: 'Document Title',
|
|
78
|
+
type: 'template',
|
|
79
|
+
slot: 'document',
|
|
80
|
+
placeholder: 'Report — {{payload.date}} or My Document',
|
|
81
|
+
},
|
|
82
|
+
contentTemplate(),
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
appendText: {
|
|
86
|
+
label: 'Append Text',
|
|
87
|
+
labelShort: 'Append',
|
|
88
|
+
description: 'Add text to end of document',
|
|
89
|
+
params: [documentId(), contentTemplate()],
|
|
90
|
+
},
|
|
91
|
+
replaceText: {
|
|
92
|
+
label: 'Replace Text',
|
|
93
|
+
labelShort: 'Replace',
|
|
94
|
+
description: 'Find and replace text in document',
|
|
95
|
+
params: [
|
|
96
|
+
documentId(),
|
|
97
|
+
{
|
|
98
|
+
name: 'searchText',
|
|
99
|
+
label: 'Search Text',
|
|
100
|
+
type: 'template',
|
|
101
|
+
slot: 'config',
|
|
102
|
+
placeholder: '{{PLACEHOLDER}} or text to find',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: 'replaceWith',
|
|
106
|
+
label: 'Replace With',
|
|
107
|
+
type: 'template',
|
|
108
|
+
slot: 'config',
|
|
109
|
+
placeholder: '{{payload.value}} or replacement text',
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
insertTable: {
|
|
114
|
+
label: 'Insert Table',
|
|
115
|
+
labelShort: 'Table',
|
|
116
|
+
description: 'Insert a table at end of document',
|
|
117
|
+
params: [
|
|
118
|
+
documentId(),
|
|
119
|
+
/* Los topes son distintos y no es un descuido: 50 filas, 20 columnas. */
|
|
120
|
+
{ name: 'tableRows', label: 'Rows', type: 'number', slot: 'config', min: 1, max: 50, default: 3 },
|
|
121
|
+
{ name: 'tableCols', label: 'Columns', type: 'number', slot: 'config', min: 1, max: 20, default: 3 },
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -35,5 +35,7 @@ export { POSTGRES_OPERATIONS, POSTGRES_MODES, POSTGRES_OPERATION_SPECS, isPostgr
|
|
|
35
35
|
export type { PostgresOperation, PostgresMode, PostgresOperationSpec, } from './postgres-operations';
|
|
36
36
|
export { MONGO_OPERATIONS, MONGO_OPERATION_SPECS, isMongoOperation, } from './mongo-operations';
|
|
37
37
|
export type { MongoOperation, MongoParamType, MongoParamSpec, MongoOperationSpec, } from './mongo-operations';
|
|
38
|
+
export { DOCS_OPERATIONS, DOCS_OPERATION_SPECS, isDocsOperation, } from './docs-operations';
|
|
39
|
+
export type { DocsOperation, DocsParamType, DocsParamSlot, DocsParamSpec, DocsOperationSpec, } from './docs-operations';
|
|
38
40
|
export type { CredentialTypeRegistration, CredentialType } from './credentials';
|
|
39
41
|
export { CREDENTIAL_TYPES, CREDENTIAL_TYPE_VALUES, credentialTypeValues, getCredentialType, isCredentialType, } from './credentials';
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
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.TELEGRAM_TOOLKIT_BY_TOOL_NAME = exports.TELEGRAM_TOOLKIT_SPECS = exports.isTelegramOperation = exports.TELEGRAM_OPERATION_SPECS = exports.TELEGRAM_OPERATIONS = exports.DRIVE_TOOLKIT_BY_TOOL_NAME = exports.DRIVE_TOOLKIT_SPECS = exports.isDriveOperation = exports.DRIVE_OPERATION_SPECS = exports.DRIVE_OPERATIONS = exports.GOOGLE_CALENDAR_TOOLKIT_BY_TOOL_NAME = exports.GOOGLE_CALENDAR_TOOLKIT_SPECS = exports.isGoogleCalendarOperation = exports.GOOGLE_CALENDAR_OPERATION_SPECS = 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.isMongoOperation = exports.MONGO_OPERATION_SPECS = exports.MONGO_OPERATIONS = exports.isPostgresOperation = exports.POSTGRES_OPERATION_SPECS = exports.POSTGRES_MODES = exports.POSTGRES_OPERATIONS = 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.SHEETS_TOOLKIT_DEFAULTABLE = exports.SHEETS_TOOLKIT_BY_TOOL_NAME = exports.SHEETS_TOOLKIT_SPECS = void 0;
|
|
4
|
+
exports.isCredentialType = exports.getCredentialType = exports.credentialTypeValues = exports.CREDENTIAL_TYPE_VALUES = exports.CREDENTIAL_TYPES = exports.isDocsOperation = exports.DOCS_OPERATION_SPECS = exports.DOCS_OPERATIONS = exports.isMongoOperation = exports.MONGO_OPERATION_SPECS = exports.MONGO_OPERATIONS = exports.isPostgresOperation = exports.POSTGRES_OPERATION_SPECS = exports.POSTGRES_MODES = exports.POSTGRES_OPERATIONS = 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.SHEETS_TOOLKIT_DEFAULTABLE = exports.SHEETS_TOOLKIT_BY_TOOL_NAME = exports.SHEETS_TOOLKIT_SPECS = void 0;
|
|
5
5
|
var types_1 = require("./types");
|
|
6
6
|
Object.defineProperty(exports, "singleMeta", { enumerable: true, get: function () { return types_1.singleMeta; } });
|
|
7
7
|
Object.defineProperty(exports, "iterableMeta", { enumerable: true, get: function () { return types_1.iterableMeta; } });
|
|
@@ -93,6 +93,10 @@ var mongo_operations_1 = require("./mongo-operations");
|
|
|
93
93
|
Object.defineProperty(exports, "MONGO_OPERATIONS", { enumerable: true, get: function () { return mongo_operations_1.MONGO_OPERATIONS; } });
|
|
94
94
|
Object.defineProperty(exports, "MONGO_OPERATION_SPECS", { enumerable: true, get: function () { return mongo_operations_1.MONGO_OPERATION_SPECS; } });
|
|
95
95
|
Object.defineProperty(exports, "isMongoOperation", { enumerable: true, get: function () { return mongo_operations_1.isMongoOperation; } });
|
|
96
|
+
var docs_operations_1 = require("./docs-operations");
|
|
97
|
+
Object.defineProperty(exports, "DOCS_OPERATIONS", { enumerable: true, get: function () { return docs_operations_1.DOCS_OPERATIONS; } });
|
|
98
|
+
Object.defineProperty(exports, "DOCS_OPERATION_SPECS", { enumerable: true, get: function () { return docs_operations_1.DOCS_OPERATION_SPECS; } });
|
|
99
|
+
Object.defineProperty(exports, "isDocsOperation", { enumerable: true, get: function () { return docs_operations_1.isDocsOperation; } });
|
|
96
100
|
var credentials_1 = require("./credentials");
|
|
97
101
|
Object.defineProperty(exports, "CREDENTIAL_TYPES", { enumerable: true, get: function () { return credentials_1.CREDENTIAL_TYPES; } });
|
|
98
102
|
Object.defineProperty(exports, "CREDENTIAL_TYPE_VALUES", { enumerable: true, get: function () { return credentials_1.CREDENTIAL_TYPE_VALUES; } });
|
package/package.json
CHANGED