@hostwebhook/node-types 1.52.12 → 1.52.13
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 +2 -0
- package/dist/index.js +6 -1
- package/dist/postgres-operations.d.ts +60 -0
- package/dist/postgres-operations.js +79 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -29,5 +29,7 @@ export { SHEETS_TOOLKIT_SPECS, SHEETS_TOOLKIT_BY_TOOL_NAME, SHEETS_TOOLKIT_DEFAU
|
|
|
29
29
|
export type { SheetsToolkitSpec, SheetsToolkitParameter, } from './sheets-toolkit';
|
|
30
30
|
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';
|
|
31
31
|
export type { GoogleContactsOperation, GoogleContactsParamSpec, GoogleContactsOperationSpec, GoogleContactsOperationGroup, } from './google-contacts-operations';
|
|
32
|
+
export { POSTGRES_OPERATIONS, POSTGRES_MODES, POSTGRES_OPERATION_SPECS, isPostgresOperation, } from './postgres-operations';
|
|
33
|
+
export type { PostgresOperation, PostgresMode, PostgresOperationSpec, } from './postgres-operations';
|
|
32
34
|
export type { CredentialTypeRegistration, CredentialType } from './credentials';
|
|
33
35
|
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.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.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.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 = 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 = void 0;
|
|
4
|
+
exports.isCredentialType = exports.getCredentialType = exports.credentialTypeValues = exports.CREDENTIAL_TYPE_VALUES = exports.CREDENTIAL_TYPES = 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 = 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; } });
|
|
@@ -80,6 +80,11 @@ Object.defineProperty(exports, "GOOGLE_CONTACTS_OPERATION_SPECS", { enumerable:
|
|
|
80
80
|
Object.defineProperty(exports, "GOOGLE_CONTACTS_OPERATION_GROUPS", { enumerable: true, get: function () { return google_contacts_operations_1.GOOGLE_CONTACTS_OPERATION_GROUPS; } });
|
|
81
81
|
Object.defineProperty(exports, "GOOGLE_CONTACTS_DEFAULT_PERSON_FIELDS", { enumerable: true, get: function () { return google_contacts_operations_1.GOOGLE_CONTACTS_DEFAULT_PERSON_FIELDS; } });
|
|
82
82
|
Object.defineProperty(exports, "isGoogleContactsOperation", { enumerable: true, get: function () { return google_contacts_operations_1.isGoogleContactsOperation; } });
|
|
83
|
+
var postgres_operations_1 = require("./postgres-operations");
|
|
84
|
+
Object.defineProperty(exports, "POSTGRES_OPERATIONS", { enumerable: true, get: function () { return postgres_operations_1.POSTGRES_OPERATIONS; } });
|
|
85
|
+
Object.defineProperty(exports, "POSTGRES_MODES", { enumerable: true, get: function () { return postgres_operations_1.POSTGRES_MODES; } });
|
|
86
|
+
Object.defineProperty(exports, "POSTGRES_OPERATION_SPECS", { enumerable: true, get: function () { return postgres_operations_1.POSTGRES_OPERATION_SPECS; } });
|
|
87
|
+
Object.defineProperty(exports, "isPostgresOperation", { enumerable: true, get: function () { return postgres_operations_1.isPostgresOperation; } });
|
|
83
88
|
var credentials_1 = require("./credentials");
|
|
84
89
|
Object.defineProperty(exports, "CREDENTIAL_TYPES", { enumerable: true, get: function () { return credentials_1.CREDENTIAL_TYPES; } });
|
|
85
90
|
Object.defineProperty(exports, "CREDENTIAL_TYPE_VALUES", { enumerable: true, get: function () { return credentials_1.CREDENTIAL_TYPE_VALUES; } });
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Postgres operation enum + metadatos por operación — una sola copia para la
|
|
3
|
+
* api, el Dashboard y el broker.
|
|
4
|
+
*
|
|
5
|
+
* ── Por qué esto no trae un esquema de formulario ──
|
|
6
|
+
* A diferencia de Slack, Discord, Sheets, Telegram, Contacts y Drive,
|
|
7
|
+
* `postgresAction` **no tiene campos por operación**: el mismo formulario —SQL,
|
|
8
|
+
* Parameters, Statement timeout— se pinta para las cinco. Su eje real es `mode`
|
|
9
|
+
* (`single` / `transaction`). Así que aquí no hay `*_OPERATION_SPECS` de params,
|
|
10
|
+
* porque saldrían idénticos cinco veces; lo que sí había era la lista escrita a
|
|
11
|
+
* mano **nueve veces**, y eso es lo que esto quita:
|
|
12
|
+
*
|
|
13
|
+
* api dto: @ApiProperty enum, @IsIn, la unión TS (3)
|
|
14
|
+
* api entity: @Prop enum, la unión TS (2)
|
|
15
|
+
* dash lib/api.ts: la unión TS (1)
|
|
16
|
+
* dash PostgresTablePicker: la unión en un prop (1)
|
|
17
|
+
* dash PostgresActionDetail: OPERATIONS (1)
|
|
18
|
+
* dash PostgresNode + FlowPanel: opLabels idénticos (2)
|
|
19
|
+
*
|
|
20
|
+
* Las **clases de color no están aquí**: son presentación (Tailwind), y se
|
|
21
|
+
* quedan en el dashboard, igual que los `ICONOS` de Telegram y de Drive.
|
|
22
|
+
*/
|
|
23
|
+
export declare const POSTGRES_OPERATIONS: readonly ["query", "insertOne", "update", "delete", "execute"];
|
|
24
|
+
export type PostgresOperation = (typeof POSTGRES_OPERATIONS)[number];
|
|
25
|
+
/** Type guard — útil al validar entrada que no controlas (DTOs, tool calls). */
|
|
26
|
+
export declare function isPostgresOperation(value: unknown): value is PostgresOperation;
|
|
27
|
+
/**
|
|
28
|
+
* Cómo se ejecuta el nodo. `single` es una sentencia; `transaction` es una lista
|
|
29
|
+
* ordenada dentro de BEGIN / COMMIT con rollback condicional.
|
|
30
|
+
*/
|
|
31
|
+
export declare const POSTGRES_MODES: readonly ["single", "transaction"];
|
|
32
|
+
export type PostgresMode = (typeof POSTGRES_MODES)[number];
|
|
33
|
+
export interface PostgresOperationSpec {
|
|
34
|
+
/**
|
|
35
|
+
* Etiqueta corta, para la píldora estrecha del lienzo y del panel. Estaba
|
|
36
|
+
* escrita **idéntica** en `PostgresNode.tsx` y en `FlowPanel.tsx`.
|
|
37
|
+
*/
|
|
38
|
+
label: string;
|
|
39
|
+
/**
|
|
40
|
+
* La etiqueta larga del título del editor de SQL en la página de detalle,
|
|
41
|
+
* donde hay sitio para el paréntesis aclaratorio. **No es la misma que
|
|
42
|
+
* `label` y no debe unificarse**: son dos anchos distintos y las dos se ven.
|
|
43
|
+
*/
|
|
44
|
+
labelLong: string;
|
|
45
|
+
/** Una línea de cuándo usar esta operación. */
|
|
46
|
+
description: string;
|
|
47
|
+
/** SQL de ejemplo, el `placeholder` del editor. */
|
|
48
|
+
sqlPlaceholder: string;
|
|
49
|
+
/**
|
|
50
|
+
* Si la operación devuelve filas **siempre**. Sólo `execute` no: ahí depende
|
|
51
|
+
* de `returnRows` en la entidad, porque puede ser DDL.
|
|
52
|
+
*
|
|
53
|
+
* Este invariante vivía en dos sitios y en uno era un comentario: la api lo
|
|
54
|
+
* calculaba con `entity.operation !== 'execute' || entity.returnRows`, y el
|
|
55
|
+
* dashboard lo expresaba como `localOperation === "execute"` para decidir si
|
|
56
|
+
* enseñaba el interruptor. Es el mismo hecho, dicho aquí una vez.
|
|
57
|
+
*/
|
|
58
|
+
returnsRowsAlways: boolean;
|
|
59
|
+
}
|
|
60
|
+
export declare const POSTGRES_OPERATION_SPECS: Record<PostgresOperation, PostgresOperationSpec>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Postgres operation enum + metadatos por operación — una sola copia para la
|
|
4
|
+
* api, el Dashboard y el broker.
|
|
5
|
+
*
|
|
6
|
+
* ── Por qué esto no trae un esquema de formulario ──
|
|
7
|
+
* A diferencia de Slack, Discord, Sheets, Telegram, Contacts y Drive,
|
|
8
|
+
* `postgresAction` **no tiene campos por operación**: el mismo formulario —SQL,
|
|
9
|
+
* Parameters, Statement timeout— se pinta para las cinco. Su eje real es `mode`
|
|
10
|
+
* (`single` / `transaction`). Así que aquí no hay `*_OPERATION_SPECS` de params,
|
|
11
|
+
* porque saldrían idénticos cinco veces; lo que sí había era la lista escrita a
|
|
12
|
+
* mano **nueve veces**, y eso es lo que esto quita:
|
|
13
|
+
*
|
|
14
|
+
* api dto: @ApiProperty enum, @IsIn, la unión TS (3)
|
|
15
|
+
* api entity: @Prop enum, la unión TS (2)
|
|
16
|
+
* dash lib/api.ts: la unión TS (1)
|
|
17
|
+
* dash PostgresTablePicker: la unión en un prop (1)
|
|
18
|
+
* dash PostgresActionDetail: OPERATIONS (1)
|
|
19
|
+
* dash PostgresNode + FlowPanel: opLabels idénticos (2)
|
|
20
|
+
*
|
|
21
|
+
* Las **clases de color no están aquí**: son presentación (Tailwind), y se
|
|
22
|
+
* quedan en el dashboard, igual que los `ICONOS` de Telegram y de Drive.
|
|
23
|
+
*/
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.POSTGRES_OPERATION_SPECS = exports.POSTGRES_MODES = exports.POSTGRES_OPERATIONS = void 0;
|
|
26
|
+
exports.isPostgresOperation = isPostgresOperation;
|
|
27
|
+
exports.POSTGRES_OPERATIONS = [
|
|
28
|
+
'query', // SELECT — devuelve filas
|
|
29
|
+
'insertOne', // INSERT, normalmente con RETURNING *
|
|
30
|
+
'update', // UPDATE ... WHERE
|
|
31
|
+
'delete', // DELETE ... WHERE
|
|
32
|
+
'execute', // SQL cualquiera: DDL, transacciones, multi-sentencia
|
|
33
|
+
];
|
|
34
|
+
/** Type guard — útil al validar entrada que no controlas (DTOs, tool calls). */
|
|
35
|
+
function isPostgresOperation(value) {
|
|
36
|
+
return typeof value === 'string' && exports.POSTGRES_OPERATIONS.includes(value);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Cómo se ejecuta el nodo. `single` es una sentencia; `transaction` es una lista
|
|
40
|
+
* ordenada dentro de BEGIN / COMMIT con rollback condicional.
|
|
41
|
+
*/
|
|
42
|
+
exports.POSTGRES_MODES = ['single', 'transaction'];
|
|
43
|
+
exports.POSTGRES_OPERATION_SPECS = {
|
|
44
|
+
query: {
|
|
45
|
+
label: 'SELECT',
|
|
46
|
+
labelLong: 'SELECT (query)',
|
|
47
|
+
description: 'Run a SELECT and return rows',
|
|
48
|
+
sqlPlaceholder: 'SELECT id, email FROM users WHERE org_id = {{payload.orgId}} ORDER BY created_at DESC LIMIT 50',
|
|
49
|
+
returnsRowsAlways: true,
|
|
50
|
+
},
|
|
51
|
+
insertOne: {
|
|
52
|
+
label: 'INSERT',
|
|
53
|
+
labelLong: 'INSERT',
|
|
54
|
+
description: 'Insert a row (with RETURNING * recommended)',
|
|
55
|
+
sqlPlaceholder: 'INSERT INTO events (kind, payload) VALUES ({{payload.kind}}, {{payload.data}}) RETURNING *',
|
|
56
|
+
returnsRowsAlways: true,
|
|
57
|
+
},
|
|
58
|
+
update: {
|
|
59
|
+
label: 'UPDATE',
|
|
60
|
+
labelLong: 'UPDATE',
|
|
61
|
+
description: 'Update rows matching WHERE',
|
|
62
|
+
sqlPlaceholder: 'UPDATE users SET last_seen = NOW() WHERE id = {{payload.userId}} RETURNING id',
|
|
63
|
+
returnsRowsAlways: true,
|
|
64
|
+
},
|
|
65
|
+
delete: {
|
|
66
|
+
label: 'DELETE',
|
|
67
|
+
labelLong: 'DELETE',
|
|
68
|
+
description: 'Delete rows matching WHERE',
|
|
69
|
+
sqlPlaceholder: 'DELETE FROM sessions WHERE expires_at < NOW() RETURNING id',
|
|
70
|
+
returnsRowsAlways: true,
|
|
71
|
+
},
|
|
72
|
+
execute: {
|
|
73
|
+
label: 'EXEC',
|
|
74
|
+
labelLong: 'EXEC (raw)',
|
|
75
|
+
description: 'Run any SQL — DDL, transactions, or multi-stmt. Toggle returnRows for INSERT ... RETURNING.',
|
|
76
|
+
sqlPlaceholder: 'CREATE TEMP TABLE x AS SELECT 1; ANALYZE; -- DDL or batch',
|
|
77
|
+
returnsRowsAlways: false,
|
|
78
|
+
},
|
|
79
|
+
};
|
package/package.json
CHANGED