n8n-nodes-base 0.220.0 → 0.221.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/build.tsbuildinfo +1 -1
- package/dist/credentials/HubspotDeveloperApi.credentials.js +1 -0
- package/dist/credentials/HubspotDeveloperApi.credentials.js.map +1 -1
- package/dist/credentials/Postgres.credentials.js +115 -0
- package/dist/credentials/Postgres.credentials.js.map +1 -1
- package/dist/credentials/SshPrivateKey.credentials.js +1 -0
- package/dist/credentials/SshPrivateKey.credentials.js.map +1 -1
- package/dist/known/credentials.json +1 -0
- package/dist/nodes/ActionNetwork/GenericFunctions.d.ts +1 -1
- package/dist/nodes/Autopilot/GenericFunctions.js +2 -1
- package/dist/nodes/Autopilot/GenericFunctions.js.map +1 -1
- package/dist/nodes/Aws/AwsSns.node.js +2 -2
- package/dist/nodes/Aws/AwsSns.node.js.map +1 -1
- package/dist/nodes/Aws/Rekognition/GenericFunctions.js +2 -1
- package/dist/nodes/Aws/Rekognition/GenericFunctions.js.map +1 -1
- package/dist/nodes/Aws/S3/GenericFunctions.js +2 -1
- package/dist/nodes/Aws/S3/GenericFunctions.js.map +1 -1
- package/dist/nodes/ClickUp/GenericFunctions.js +2 -1
- package/dist/nodes/ClickUp/GenericFunctions.js.map +1 -1
- package/dist/nodes/Clockify/GenericFunctions.js +2 -1
- package/dist/nodes/Clockify/GenericFunctions.js.map +1 -1
- package/dist/nodes/CompareDatasets/CompareDatasets.node.js +42 -6
- package/dist/nodes/CompareDatasets/CompareDatasets.node.js.map +1 -1
- package/dist/nodes/CompareDatasets/GenericFunctions.js +60 -18
- package/dist/nodes/CompareDatasets/GenericFunctions.js.map +1 -1
- package/dist/nodes/CompareDatasets/test/node/workflow.compareDatasets.fuzzy.missing_keys.json +232 -0
- package/dist/nodes/CompareDatasets/test/node/workflow.compareDatasets.skipFields.json +897 -0
- package/dist/nodes/CrateDb/CrateDb.node.js +7 -7
- package/dist/nodes/CrateDb/CrateDb.node.js.map +1 -1
- package/dist/nodes/DateTime/DateTime.node.js +11 -1
- package/dist/nodes/DateTime/DateTime.node.js.map +1 -1
- package/dist/nodes/DateTime/test/node/workflow.luxonDateTime.json +165 -0
- package/dist/nodes/Filter/Filter.node.js +12 -5
- package/dist/nodes/Filter/Filter.node.js.map +1 -1
- package/dist/nodes/Github/SearchFunctions.js +1 -1
- package/dist/nodes/Github/SearchFunctions.js.map +1 -1
- package/dist/nodes/GoToWebinar/GenericFunctions.d.ts +1 -1
- package/dist/nodes/GoToWebinar/GenericFunctions.js +5 -4
- package/dist/nodes/GoToWebinar/GenericFunctions.js.map +1 -1
- package/dist/nodes/Google/Gmail/GenericFunctions.d.ts +4 -2
- package/dist/nodes/Google/Gmail/GenericFunctions.js +40 -47
- package/dist/nodes/Google/Gmail/GenericFunctions.js.map +1 -1
- package/dist/nodes/Google/Gmail/GmailTrigger.node.js +1 -1
- package/dist/nodes/Google/Gmail/GmailTrigger.node.js.map +1 -1
- package/dist/nodes/Google/Gmail/v2/GmailV2.node.js +2 -2
- package/dist/nodes/Google/Gmail/v2/GmailV2.node.js.map +1 -1
- package/dist/nodes/Google/Sheet/GoogleSheetsTrigger.utils.d.ts +7 -1
- package/dist/nodes/HelpScout/GenericFunctions.js +2 -1
- package/dist/nodes/HelpScout/GenericFunctions.js.map +1 -1
- package/dist/nodes/HtmlExtract/HtmlExtract.node.js +4 -2
- package/dist/nodes/HtmlExtract/HtmlExtract.node.js.map +1 -1
- package/dist/nodes/HtmlExtract/test/workflow.dotNotation.json +143 -0
- package/dist/nodes/HttpRequest/GenericFunctions.d.ts +9 -0
- package/dist/nodes/HttpRequest/GenericFunctions.js +18 -1
- package/dist/nodes/HttpRequest/GenericFunctions.js.map +1 -1
- package/dist/nodes/HttpRequest/HttpRequest.node.js +2 -1
- package/dist/nodes/HttpRequest/HttpRequest.node.js.map +1 -1
- package/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js +56 -6
- package/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js.map +1 -1
- package/dist/nodes/Hubspot/GenericFunctions.js +2 -1
- package/dist/nodes/Hubspot/GenericFunctions.js.map +1 -1
- package/dist/nodes/LinkedIn/GenericFunctions.js +16 -4
- package/dist/nodes/LinkedIn/GenericFunctions.js.map +1 -1
- package/dist/nodes/LinkedIn/LinkedIn.node.js +33 -77
- package/dist/nodes/LinkedIn/LinkedIn.node.js.map +1 -1
- package/dist/nodes/Microsoft/Teams/GenericFunctions.js +2 -1
- package/dist/nodes/Microsoft/Teams/GenericFunctions.js.map +1 -1
- package/dist/nodes/Notion/GenericFunctions.js +2 -1
- package/dist/nodes/Notion/GenericFunctions.js.map +1 -1
- package/dist/nodes/Orbit/GenericFunctions.js +2 -1
- package/dist/nodes/Orbit/GenericFunctions.js.map +1 -1
- package/dist/nodes/Postgres/Postgres.node.d.ts +3 -9
- package/dist/nodes/Postgres/Postgres.node.js +9 -319
- package/dist/nodes/Postgres/Postgres.node.js.map +1 -1
- package/dist/nodes/Postgres/v1/PostgresV1.node.d.ts +12 -0
- package/dist/nodes/Postgres/v1/PostgresV1.node.js +345 -0
- package/dist/nodes/Postgres/v1/PostgresV1.node.js.map +1 -0
- package/dist/nodes/Postgres/{Postgres.node.functions.js → v1/genericFunctions.js} +1 -1
- package/dist/nodes/Postgres/v1/genericFunctions.js.map +1 -0
- package/dist/nodes/Postgres/v2/PostgresV2.node.d.ts +13 -0
- package/dist/nodes/Postgres/v2/PostgresV2.node.js +20 -0
- package/dist/nodes/Postgres/v2/PostgresV2.node.js.map +1 -0
- package/dist/nodes/Postgres/v2/actions/common.descriptions.d.ts +7 -0
- package/dist/nodes/Postgres/v2/actions/common.descriptions.js +317 -0
- package/dist/nodes/Postgres/v2/actions/common.descriptions.js.map +1 -0
- package/dist/nodes/Postgres/v2/actions/database/Database.resource.d.ts +9 -0
- package/dist/nodes/Postgres/v2/actions/database/Database.resource.js +100 -0
- package/dist/nodes/Postgres/v2/actions/database/Database.resource.js.map +1 -0
- package/dist/nodes/Postgres/v2/actions/database/deleteTable.operation.d.ts +24 -0
- package/dist/nodes/Postgres/v2/actions/database/deleteTable.operation.js +110 -0
- package/dist/nodes/Postgres/v2/actions/database/deleteTable.operation.js.map +1 -0
- package/dist/nodes/Postgres/v2/actions/database/executeQuery.operation.d.ts +24 -0
- package/dist/nodes/Postgres/v2/actions/database/executeQuery.operation.js +60 -0
- package/dist/nodes/Postgres/v2/actions/database/executeQuery.operation.js.map +1 -0
- package/dist/nodes/Postgres/v2/actions/database/insert.operation.d.ts +24 -0
- package/dist/nodes/Postgres/v2/actions/database/insert.operation.js +129 -0
- package/dist/nodes/Postgres/v2/actions/database/insert.operation.js.map +1 -0
- package/dist/nodes/Postgres/v2/actions/database/select.operation.d.ts +24 -0
- package/dist/nodes/Postgres/v2/actions/database/select.operation.js +87 -0
- package/dist/nodes/Postgres/v2/actions/database/select.operation.js.map +1 -0
- package/dist/nodes/Postgres/v2/actions/database/update.operation.d.ts +24 -0
- package/dist/nodes/Postgres/v2/actions/database/update.operation.js +164 -0
- package/dist/nodes/Postgres/v2/actions/database/update.operation.js.map +1 -0
- package/dist/nodes/Postgres/v2/actions/database/upsert.operation.d.ts +24 -0
- package/dist/nodes/Postgres/v2/actions/database/upsert.operation.js +165 -0
- package/dist/nodes/Postgres/v2/actions/database/upsert.operation.js.map +1 -0
- package/dist/nodes/Postgres/v2/actions/node.type.d.ts +7 -0
- package/dist/nodes/Postgres/v2/actions/node.type.js +3 -0
- package/dist/nodes/Postgres/v2/actions/node.type.js.map +1 -0
- package/dist/nodes/Postgres/v2/actions/router.d.ts +2 -0
- package/dist/nodes/Postgres/v2/actions/router.js +65 -0
- package/dist/nodes/Postgres/v2/actions/router.js.map +1 -0
- package/dist/nodes/Postgres/v2/actions/versionDescription.d.ts +2 -0
- package/dist/nodes/Postgres/v2/actions/versionDescription.js +65 -0
- package/dist/nodes/Postgres/v2/actions/versionDescription.js.map +1 -0
- package/dist/nodes/Postgres/v2/helpers/interfaces.d.ts +37 -0
- package/dist/nodes/Postgres/v2/helpers/interfaces.js +3 -0
- package/dist/nodes/Postgres/v2/helpers/interfaces.js.map +1 -0
- package/dist/nodes/Postgres/v2/helpers/utils.d.ts +29 -0
- package/dist/nodes/Postgres/v2/helpers/utils.js +258 -0
- package/dist/nodes/Postgres/v2/helpers/utils.js.map +1 -0
- package/dist/nodes/Postgres/v2/methods/credentialTest.d.ts +2 -0
- package/dist/nodes/Postgres/v2/methods/credentialTest.js +47 -0
- package/dist/nodes/Postgres/v2/methods/credentialTest.js.map +1 -0
- package/dist/nodes/Postgres/v2/methods/index.d.ts +3 -0
- package/dist/nodes/Postgres/v2/methods/index.js +30 -0
- package/dist/nodes/Postgres/v2/methods/index.js.map +1 -0
- package/dist/nodes/Postgres/v2/methods/listSearch.d.ts +3 -0
- package/dist/nodes/Postgres/v2/methods/listSearch.js +42 -0
- package/dist/nodes/Postgres/v2/methods/listSearch.js.map +1 -0
- package/dist/nodes/Postgres/v2/methods/loadOptions.d.ts +4 -0
- package/dist/nodes/Postgres/v2/methods/loadOptions.js +40 -0
- package/dist/nodes/Postgres/v2/methods/loadOptions.js.map +1 -0
- package/dist/nodes/Postgres/v2/transport/index.d.ts +10 -0
- package/dist/nodes/Postgres/v2/transport/index.js +168 -0
- package/dist/nodes/Postgres/v2/transport/index.js.map +1 -0
- package/dist/nodes/QuestDb/QuestDb.node.js +3 -3
- package/dist/nodes/QuestDb/QuestDb.node.js.map +1 -1
- package/dist/nodes/Redis/Redis.node.js +35 -4
- package/dist/nodes/Redis/Redis.node.js.map +1 -1
- package/dist/nodes/S3/GenericFunctions.js +2 -1
- package/dist/nodes/S3/GenericFunctions.js.map +1 -1
- package/dist/nodes/Schedule/ScheduleTrigger.node.js +2 -2
- package/dist/nodes/Schedule/ScheduleTrigger.node.js.map +1 -1
- package/dist/nodes/SendGrid/GenericFunctions.js +2 -1
- package/dist/nodes/SendGrid/GenericFunctions.js.map +1 -1
- package/dist/nodes/SentryIo/GenericFunctions.js +2 -1
- package/dist/nodes/SentryIo/GenericFunctions.js.map +1 -1
- package/dist/nodes/ServiceNow/IncidentDescription.js +7 -0
- package/dist/nodes/ServiceNow/IncidentDescription.js.map +1 -1
- package/dist/nodes/Set/Set.node.js +7 -1
- package/dist/nodes/Set/Set.node.js.map +1 -1
- package/dist/nodes/Set/test/Set.workflow.number.json +145 -0
- package/dist/nodes/Taiga/GenericFunctions.js +2 -1
- package/dist/nodes/Taiga/GenericFunctions.js.map +1 -1
- package/dist/nodes/TimescaleDb/TimescaleDb.node.js +4 -4
- package/dist/nodes/TimescaleDb/TimescaleDb.node.js.map +1 -1
- package/dist/nodes/Zendesk/GenericFunctions.js +2 -1
- package/dist/nodes/Zendesk/GenericFunctions.js.map +1 -1
- package/dist/types/credentials.json +3 -3
- package/dist/types/nodes.json +14 -12
- package/package.json +3 -3
- package/dist/nodes/Postgres/Postgres.node.functions.js.map +0 -1
- /package/dist/nodes/Postgres/{Postgres.node.functions.d.ts → v1/genericFunctions.d.ts} +0 -0
|
@@ -1,334 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.Postgres = void 0;
|
|
7
4
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
class Postgres {
|
|
5
|
+
const PostgresV1_node_1 = require("./v1/PostgresV1.node");
|
|
6
|
+
const PostgresV2_node_1 = require("./v2/PostgresV2.node");
|
|
7
|
+
class Postgres extends n8n_workflow_1.VersionedNodeType {
|
|
11
8
|
constructor() {
|
|
12
|
-
|
|
9
|
+
const baseDescription = {
|
|
13
10
|
displayName: 'Postgres',
|
|
14
11
|
name: 'postgres',
|
|
15
12
|
icon: 'file:postgres.svg',
|
|
16
13
|
group: ['input'],
|
|
17
|
-
|
|
14
|
+
defaultVersion: 2,
|
|
18
15
|
description: 'Get, add and update data in Postgres',
|
|
19
|
-
defaults: {
|
|
20
|
-
name: 'Postgres',
|
|
21
|
-
},
|
|
22
|
-
inputs: ['main'],
|
|
23
|
-
outputs: ['main'],
|
|
24
|
-
credentials: [
|
|
25
|
-
{
|
|
26
|
-
name: 'postgres',
|
|
27
|
-
required: true,
|
|
28
|
-
testedBy: 'postgresConnectionTest',
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
properties: [
|
|
32
|
-
{
|
|
33
|
-
displayName: 'Operation',
|
|
34
|
-
name: 'operation',
|
|
35
|
-
type: 'options',
|
|
36
|
-
noDataExpression: true,
|
|
37
|
-
options: [
|
|
38
|
-
{
|
|
39
|
-
name: 'Execute Query',
|
|
40
|
-
value: 'executeQuery',
|
|
41
|
-
description: 'Execute an SQL query',
|
|
42
|
-
action: 'Execute a SQL query',
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
name: 'Insert',
|
|
46
|
-
value: 'insert',
|
|
47
|
-
description: 'Insert rows in database',
|
|
48
|
-
action: 'Insert rows in database',
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
name: 'Update',
|
|
52
|
-
value: 'update',
|
|
53
|
-
description: 'Update rows in database',
|
|
54
|
-
action: 'Update rows in database',
|
|
55
|
-
},
|
|
56
|
-
],
|
|
57
|
-
default: 'insert',
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
displayName: 'Query',
|
|
61
|
-
name: 'query',
|
|
62
|
-
type: 'string',
|
|
63
|
-
displayOptions: {
|
|
64
|
-
show: {
|
|
65
|
-
operation: ['executeQuery'],
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
default: '',
|
|
69
|
-
placeholder: 'SELECT id, name FROM product WHERE quantity > $1 AND price <= $2',
|
|
70
|
-
required: true,
|
|
71
|
-
description: 'The SQL query to execute. You can use n8n expressions or $1 and $2 in conjunction with query parameters.',
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
displayName: 'Schema',
|
|
75
|
-
name: 'schema',
|
|
76
|
-
type: 'string',
|
|
77
|
-
displayOptions: {
|
|
78
|
-
show: {
|
|
79
|
-
operation: ['insert'],
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
default: 'public',
|
|
83
|
-
required: true,
|
|
84
|
-
description: 'Name of the schema the table belongs to',
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
displayName: 'Table',
|
|
88
|
-
name: 'table',
|
|
89
|
-
type: 'string',
|
|
90
|
-
displayOptions: {
|
|
91
|
-
show: {
|
|
92
|
-
operation: ['insert'],
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
default: '',
|
|
96
|
-
required: true,
|
|
97
|
-
description: 'Name of the table in which to insert data to',
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
displayName: 'Columns',
|
|
101
|
-
name: 'columns',
|
|
102
|
-
type: 'string',
|
|
103
|
-
displayOptions: {
|
|
104
|
-
show: {
|
|
105
|
-
operation: ['insert'],
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
default: '',
|
|
109
|
-
placeholder: 'id:int,name:text,description',
|
|
110
|
-
description: 'Comma-separated list of the properties which should used as columns for the new rows. You can use type casting with colons (:) like id:int.',
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
displayName: 'Schema',
|
|
114
|
-
name: 'schema',
|
|
115
|
-
type: 'string',
|
|
116
|
-
displayOptions: {
|
|
117
|
-
show: {
|
|
118
|
-
operation: ['update'],
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
default: 'public',
|
|
122
|
-
description: 'Name of the schema the table belongs to',
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
displayName: 'Table',
|
|
126
|
-
name: 'table',
|
|
127
|
-
type: 'string',
|
|
128
|
-
displayOptions: {
|
|
129
|
-
show: {
|
|
130
|
-
operation: ['update'],
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
default: '',
|
|
134
|
-
required: true,
|
|
135
|
-
description: 'Name of the table in which to update data in',
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
displayName: 'Update Key',
|
|
139
|
-
name: 'updateKey',
|
|
140
|
-
type: 'string',
|
|
141
|
-
displayOptions: {
|
|
142
|
-
show: {
|
|
143
|
-
operation: ['update'],
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
default: 'id',
|
|
147
|
-
required: true,
|
|
148
|
-
description: 'Comma-separated list of the properties which decides which rows in the database should be updated. Normally that would be "id".',
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
displayName: 'Columns',
|
|
152
|
-
name: 'columns',
|
|
153
|
-
type: 'string',
|
|
154
|
-
displayOptions: {
|
|
155
|
-
show: {
|
|
156
|
-
operation: ['update'],
|
|
157
|
-
},
|
|
158
|
-
},
|
|
159
|
-
default: '',
|
|
160
|
-
placeholder: 'name:text,description',
|
|
161
|
-
description: 'Comma-separated list of the properties which should used as columns for rows to update. You can use type casting with colons (:) like id:int.',
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
displayName: 'Return Fields',
|
|
165
|
-
name: 'returnFields',
|
|
166
|
-
type: 'string',
|
|
167
|
-
requiresDataPath: 'multiple',
|
|
168
|
-
displayOptions: {
|
|
169
|
-
show: {
|
|
170
|
-
operation: ['insert', 'update'],
|
|
171
|
-
},
|
|
172
|
-
},
|
|
173
|
-
default: '*',
|
|
174
|
-
description: 'Comma-separated list of the fields that the operation will return',
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
displayName: 'Additional Fields',
|
|
178
|
-
name: 'additionalFields',
|
|
179
|
-
type: 'collection',
|
|
180
|
-
placeholder: 'Add Field',
|
|
181
|
-
default: {},
|
|
182
|
-
options: [
|
|
183
|
-
{
|
|
184
|
-
displayName: 'Mode',
|
|
185
|
-
name: 'mode',
|
|
186
|
-
type: 'options',
|
|
187
|
-
options: [
|
|
188
|
-
{
|
|
189
|
-
name: 'Independently',
|
|
190
|
-
value: 'independently',
|
|
191
|
-
description: 'Execute each query independently',
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
name: 'Multiple Queries',
|
|
195
|
-
value: 'multiple',
|
|
196
|
-
description: '<b>Default</b>. Sends multiple queries at once to database.',
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
name: 'Transaction',
|
|
200
|
-
value: 'transaction',
|
|
201
|
-
description: 'Executes all queries in a single transaction',
|
|
202
|
-
},
|
|
203
|
-
],
|
|
204
|
-
default: 'multiple',
|
|
205
|
-
description: 'The way queries should be sent to database. Can be used in conjunction with <b>Continue on Fail</b>. See <a href="https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.postgres/">the docs</a> for more examples',
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
displayName: 'Output Large-Format Numbers As',
|
|
209
|
-
name: 'largeNumbersOutput',
|
|
210
|
-
type: 'options',
|
|
211
|
-
options: [
|
|
212
|
-
{
|
|
213
|
-
name: 'Numbers',
|
|
214
|
-
value: 'numbers',
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
name: 'Text',
|
|
218
|
-
value: 'text',
|
|
219
|
-
description: 'Use this if you expect numbers longer than 16 digits (otherwise numbers may be incorrect)',
|
|
220
|
-
},
|
|
221
|
-
],
|
|
222
|
-
hint: 'Applies to NUMERIC and BIGINT columns only',
|
|
223
|
-
default: 'text',
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
displayName: 'Query Parameters',
|
|
227
|
-
name: 'queryParams',
|
|
228
|
-
type: 'string',
|
|
229
|
-
displayOptions: {
|
|
230
|
-
show: {
|
|
231
|
-
'/operation': ['executeQuery'],
|
|
232
|
-
},
|
|
233
|
-
},
|
|
234
|
-
default: '',
|
|
235
|
-
placeholder: 'quantity,price',
|
|
236
|
-
description: 'Comma-separated list of properties which should be used as query parameters',
|
|
237
|
-
},
|
|
238
|
-
],
|
|
239
|
-
},
|
|
240
|
-
],
|
|
241
16
|
};
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
const credentials = credential.data;
|
|
246
|
-
try {
|
|
247
|
-
const pgp = (0, pg_promise_1.default)();
|
|
248
|
-
const config = {
|
|
249
|
-
host: credentials.host,
|
|
250
|
-
port: credentials.port,
|
|
251
|
-
database: credentials.database,
|
|
252
|
-
user: credentials.user,
|
|
253
|
-
password: credentials.password,
|
|
254
|
-
};
|
|
255
|
-
if (credentials.allowUnauthorizedCerts === true) {
|
|
256
|
-
config.ssl = {
|
|
257
|
-
rejectUnauthorized: false,
|
|
258
|
-
};
|
|
259
|
-
}
|
|
260
|
-
else {
|
|
261
|
-
config.ssl = !['disable', undefined].includes(credentials.ssl);
|
|
262
|
-
config.sslmode = credentials.ssl || 'disable';
|
|
263
|
-
}
|
|
264
|
-
const db = pgp(config);
|
|
265
|
-
await db.connect();
|
|
266
|
-
pgp.end();
|
|
267
|
-
}
|
|
268
|
-
catch (error) {
|
|
269
|
-
return {
|
|
270
|
-
status: 'Error',
|
|
271
|
-
message: error.message,
|
|
272
|
-
};
|
|
273
|
-
}
|
|
274
|
-
return {
|
|
275
|
-
status: 'OK',
|
|
276
|
-
message: 'Connection successful!',
|
|
277
|
-
};
|
|
278
|
-
},
|
|
279
|
-
},
|
|
17
|
+
const nodeVersions = {
|
|
18
|
+
1: new PostgresV1_node_1.PostgresV1(baseDescription),
|
|
19
|
+
2: new PostgresV2_node_1.PostgresV2(baseDescription),
|
|
280
20
|
};
|
|
281
|
-
|
|
282
|
-
async execute() {
|
|
283
|
-
const credentials = await this.getCredentials('postgres');
|
|
284
|
-
const largeNumbersOutput = this.getNodeParameter('additionalFields.largeNumbersOutput', 0, '');
|
|
285
|
-
const pgp = (0, pg_promise_1.default)();
|
|
286
|
-
if (largeNumbersOutput === 'numbers') {
|
|
287
|
-
pgp.pg.types.setTypeParser(20, (value) => {
|
|
288
|
-
return parseInt(value, 10);
|
|
289
|
-
});
|
|
290
|
-
pgp.pg.types.setTypeParser(1700, (value) => {
|
|
291
|
-
return parseFloat(value);
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
const config = {
|
|
295
|
-
host: credentials.host,
|
|
296
|
-
port: credentials.port,
|
|
297
|
-
database: credentials.database,
|
|
298
|
-
user: credentials.user,
|
|
299
|
-
password: credentials.password,
|
|
300
|
-
};
|
|
301
|
-
if (credentials.allowUnauthorizedCerts === true) {
|
|
302
|
-
config.ssl = {
|
|
303
|
-
rejectUnauthorized: false,
|
|
304
|
-
};
|
|
305
|
-
}
|
|
306
|
-
else {
|
|
307
|
-
config.ssl = !['disable', undefined].includes(credentials.ssl);
|
|
308
|
-
config.sslmode = credentials.ssl || 'disable';
|
|
309
|
-
}
|
|
310
|
-
const db = pgp(config);
|
|
311
|
-
let returnItems = [];
|
|
312
|
-
const items = this.getInputData();
|
|
313
|
-
const operation = this.getNodeParameter('operation', 0);
|
|
314
|
-
if (operation === 'executeQuery') {
|
|
315
|
-
const queryResult = await Postgres_node_functions_1.pgQueryV2.call(this, pgp, db, items, this.continueOnFail());
|
|
316
|
-
returnItems = queryResult;
|
|
317
|
-
}
|
|
318
|
-
else if (operation === 'insert') {
|
|
319
|
-
const insertData = await Postgres_node_functions_1.pgInsertV2.call(this, pgp, db, items, this.continueOnFail());
|
|
320
|
-
returnItems = insertData;
|
|
321
|
-
}
|
|
322
|
-
else if (operation === 'update') {
|
|
323
|
-
const updateItems = await (0, Postgres_node_functions_1.pgUpdate)(this.getNodeParameter, pgp, db, items, this.continueOnFail());
|
|
324
|
-
returnItems = (0, Postgres_node_functions_1.wrapData)(updateItems);
|
|
325
|
-
}
|
|
326
|
-
else {
|
|
327
|
-
pgp.end();
|
|
328
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not supported!`);
|
|
329
|
-
}
|
|
330
|
-
pgp.end();
|
|
331
|
-
return this.prepareOutputData(returnItems);
|
|
21
|
+
super(nodeVersions, baseDescription);
|
|
332
22
|
}
|
|
333
23
|
}
|
|
334
24
|
exports.Postgres = Postgres;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Postgres.node.js","sourceRoot":"","sources":["../../../nodes/Postgres/Postgres.node.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Postgres.node.js","sourceRoot":"","sources":["../../../nodes/Postgres/Postgres.node.ts"],"names":[],"mappings":";;;AACA,+CAAiD;AAEjD,0DAAkD;AAClD,0DAAkD;AAElD,MAAa,QAAS,SAAQ,gCAAiB;IAC9C;QACC,MAAM,eAAe,GAA6B;YACjD,WAAW,EAAE,UAAU;YACvB,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,mBAAmB;YACzB,KAAK,EAAE,CAAC,OAAO,CAAC;YAChB,cAAc,EAAE,CAAC;YACjB,WAAW,EAAE,sCAAsC;SACnD,CAAC;QAEF,MAAM,YAAY,GAAuC;YACxD,CAAC,EAAE,IAAI,4BAAU,CAAC,eAAe,CAAC;YAClC,CAAC,EAAE,IAAI,4BAAU,CAAC,eAAe,CAAC;SAClC,CAAC;QAEF,KAAK,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;IACtC,CAAC;CACD;AAlBD,4BAkBC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IExecuteFunctions } from 'n8n-core';
|
|
2
|
+
import type { ICredentialsDecrypted, ICredentialTestFunctions, INodeCredentialTestResult, INodeExecutionData, INodeType, INodeTypeBaseDescription, INodeTypeDescription } from 'n8n-workflow';
|
|
3
|
+
export declare class PostgresV1 implements INodeType {
|
|
4
|
+
description: INodeTypeDescription;
|
|
5
|
+
constructor(baseDescription: INodeTypeBaseDescription);
|
|
6
|
+
methods: {
|
|
7
|
+
credentialTest: {
|
|
8
|
+
postgresConnectionTest(this: ICredentialTestFunctions, credential: ICredentialsDecrypted): Promise<INodeCredentialTestResult>;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
12
|
+
}
|