n8n-nodes-mammouth 0.1.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/README.md +99 -0
- package/dist/ChatDescription.d.ts +3 -0
- package/dist/ChatDescription.js +385 -0
- package/dist/GenericFunctions.d.ts +2 -0
- package/dist/GenericFunctions.js +10 -0
- package/dist/ImageDescription.d.ts +3 -0
- package/dist/ImageDescription.js +381 -0
- package/dist/MammouthAi.node.d.ts +4 -0
- package/dist/MammouthAi.node.js +63 -0
- package/dist/MammouthAi.node.json +7 -0
- package/dist/MammouthApi.credentials.d.ts +9 -0
- package/dist/MammouthApi.credentials.js +43 -0
- package/dist/TextDescription.d.ts +3 -0
- package/dist/TextDescription.js +464 -0
- package/dist/__schema__/v1.0.0/chat/chat.json +9 -0
- package/dist/__schema__/v1.0.0/image/create.json +9 -0
- package/dist/__schema__/v1.1.0/chat/complete.json +57 -0
- package/dist/__schema__/v1.1.0/image/create.json +12 -0
- package/dist/__schema__/v1.1.0/text/chat.json +9 -0
- package/dist/__schema__/v1.1.0/text/complete.json +15 -0
- package/dist/icons/mammouth.dark.svg +13 -0
- package/dist/icons/mammouth.svg +12 -0
- package/package.json +37 -0
package/README.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Mammouth pour n8n
|
|
2
|
+
|
|
3
|
+
Node privé d'actions Chat / Image / Text pour une API compatible avec le protocole
|
|
4
|
+
OpenAI. Ce n'est pas un sous-node Chat Model pour AI Agent.
|
|
5
|
+
|
|
6
|
+
## Compilation et vérification
|
|
7
|
+
|
|
8
|
+
Node.js 24 ou supérieur et npm sont nécessaires (une dépendance du SDK n8n
|
|
9
|
+
exige Node.js 24). Respecter également la version
|
|
10
|
+
Node.js requise par votre installation n8n. Le paquet est compilé et testé avec
|
|
11
|
+
`n8n-workflow` 2.42.1 ; la compatibilité avec votre version exacte de n8n reste
|
|
12
|
+
à vérifier sur votre instance.
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
cd /home/mathieu/delivery/Projets/n8n-integration
|
|
16
|
+
npm ci
|
|
17
|
+
npm test
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
La compilation produit `/home/mathieu/delivery/Projets/n8n-integration/dist`,
|
|
21
|
+
avec le node, ses credentials, ses icônes et ses métadonnées.
|
|
22
|
+
|
|
23
|
+
## Chargement dans n8n installé avec npm / Node.js
|
|
24
|
+
|
|
25
|
+
Sur la machine qui exécute n8n, après compilation, définir le répertoire
|
|
26
|
+
d'extensions personnalisées au démarrage :
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
export N8N_CUSTOM_EXTENSIONS="/home/mathieu/delivery/Projets/n8n-integration/dist"
|
|
30
|
+
n8n start
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Arrêter préalablement l'instance existante : ne pas lancer un deuxième processus
|
|
34
|
+
sur le même port. Si n8n est géré par systemd ou PM2, ajouter cette variable à
|
|
35
|
+
la configuration de ce service, puis le redémarrer avec son gestionnaire.
|
|
36
|
+
Un simple `export` dans un terminal ne modifie pas l'environnement d'un service.
|
|
37
|
+
|
|
38
|
+
- Exécuter n8n avec son utilisateur habituel pour conserver ses données.
|
|
39
|
+
- Le chemin ci-dessus est celui de ce projet : l'adapter si n8n tourne ailleurs.
|
|
40
|
+
- Conserver les dépendances installées dans ce projet et rendre le projet lisible
|
|
41
|
+
par l'utilisateur du service n8n.
|
|
42
|
+
- Si `N8N_CUSTOM_EXTENSIONS` contient déjà des chemins, ajouter ce répertoire en
|
|
43
|
+
les séparant par `;`, sans supprimer les extensions existantes.
|
|
44
|
+
- Recompiler puis redémarrer n8n après chaque modification.
|
|
45
|
+
- Recharger l'interface et chercher **Mammouth** dans le sélecteur de nodes.
|
|
46
|
+
|
|
47
|
+
Cette installation reste privée : aucune publication npm n'est nécessaire.
|
|
48
|
+
`npm pack` produit aussi une archive installable pour un déploiement en paquet
|
|
49
|
+
communautaire privé. Ne pas charger simultanément le même node comme extension
|
|
50
|
+
personnalisée et comme paquet communautaire ; leurs identifiants de workflow
|
|
51
|
+
diffèrent (`CUSTOM.mammouth` et `n8n-nodes-mammouth.mammouth`).
|
|
52
|
+
|
|
53
|
+
## Configuration de l'API
|
|
54
|
+
|
|
55
|
+
Créer des credentials **Mammouth API** et renseigner :
|
|
56
|
+
|
|
57
|
+
- **API Base URL** : URL complète de la base API, avec `/v1` si votre serveur
|
|
58
|
+
l'exige. Par exemple, `https://api.example.com/v1` est un exemple fictif, pas
|
|
59
|
+
l'adresse de votre entreprise. Un préfixe tel que `/proxy/v1` est conservé.
|
|
60
|
+
- **API Key** : clé envoyée dans `Authorization: Bearer …`.
|
|
61
|
+
|
|
62
|
+
Aucune URL d'API n'est préremplie et aucun repli vers OpenAI n'est effectué.
|
|
63
|
+
Utiliser HTTPS hors tests locaux. Le bouton de test des credentials appelle
|
|
64
|
+
`GET /models` ; il exige que cet endpoint soit disponible et autorisé.
|
|
65
|
+
|
|
66
|
+
Pour un premier essai : sélectionner **Chat → Complete**, choisir un modèle,
|
|
67
|
+
ajouter un message de rôle **User**, puis exécuter le node.
|
|
68
|
+
|
|
69
|
+
## Endpoints et limites
|
|
70
|
+
|
|
71
|
+
Les chemins suivants sont ajoutés à l'URL de base :
|
|
72
|
+
|
|
73
|
+
| Fonction | Méthode et chemin |
|
|
74
|
+
| --- | --- |
|
|
75
|
+
| Liste des modèles et test des credentials | `GET /models` |
|
|
76
|
+
| Chat | `POST /chat/completions` |
|
|
77
|
+
| Image | `POST /images/generations` |
|
|
78
|
+
| Complétion texte | `POST /completions` |
|
|
79
|
+
| Édition texte | `POST /edits` |
|
|
80
|
+
| Modération | `POST /moderations` |
|
|
81
|
+
|
|
82
|
+
La liste des modèles attend `{ "data": [{ "id": "identifiant-du-modele" }] }`.
|
|
83
|
+
Elle n'applique aucun filtre de marque : choisir un modèle compatible avec
|
|
84
|
+
l'opération. L'édition et la modération demandent un identifiant saisi manuellement.
|
|
85
|
+
|
|
86
|
+
Les opérations et options sont héritées du node d'origine. Une compatibilité
|
|
87
|
+
Chat Completions ne garantit pas les endpoints historiques d'édition, de texte,
|
|
88
|
+
de modération, ni les paramètres image. Les options spécifiques DALL-E restent
|
|
89
|
+
conditionnées à ces modèles. Seules les fonctions effectivement exposées par
|
|
90
|
+
votre API pourront fonctionner ; aucun support supplémentaire n'est présumé.
|
|
91
|
+
|
|
92
|
+
Les tests vérifient la compilation, les exports, les assets, les expressions n8n,
|
|
93
|
+
l'authentification, les modèles et les erreurs HTTP. Un serveur HTTP local simule
|
|
94
|
+
les endpoints modèles et chat à partir de la configuration du node ; ce test
|
|
95
|
+
ne remplace pas une exécution du moteur de routage n8n ni un appel à votre API.
|
|
96
|
+
|
|
97
|
+
Ce paquet est marqué `private: true` et `UNLICENSED` pour éviter une publication
|
|
98
|
+
accidentelle. Cela ne remplace pas la licence du code amont : vérifier les
|
|
99
|
+
obligations de licence et d'attribution du code repris avant toute distribution.
|
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.chatFields = exports.chatOperations = void 0;
|
|
4
|
+
const GenericFunctions_1 = require("./GenericFunctions");
|
|
5
|
+
exports.chatOperations = [
|
|
6
|
+
{
|
|
7
|
+
displayName: 'Operation',
|
|
8
|
+
name: 'operation',
|
|
9
|
+
type: 'options',
|
|
10
|
+
noDataExpression: true,
|
|
11
|
+
displayOptions: {
|
|
12
|
+
show: {
|
|
13
|
+
resource: ['chat'],
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
options: [
|
|
17
|
+
{
|
|
18
|
+
name: 'Complete',
|
|
19
|
+
value: 'complete',
|
|
20
|
+
action: 'Create a Completion',
|
|
21
|
+
description: 'Create one or more completions for a given text',
|
|
22
|
+
routing: {
|
|
23
|
+
request: {
|
|
24
|
+
method: 'POST',
|
|
25
|
+
url: '/chat/completions',
|
|
26
|
+
},
|
|
27
|
+
output: { postReceive: [GenericFunctions_1.sendErrorPostReceive] },
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
default: 'complete',
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
const completeOperations = [
|
|
35
|
+
{
|
|
36
|
+
displayName: 'Model',
|
|
37
|
+
name: 'model',
|
|
38
|
+
type: 'options',
|
|
39
|
+
description: 'The model available on your Mammouth API which will generate the completion',
|
|
40
|
+
displayOptions: {
|
|
41
|
+
show: {
|
|
42
|
+
operation: ['complete'],
|
|
43
|
+
resource: ['chat'],
|
|
44
|
+
'@version': [1],
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
typeOptions: {
|
|
48
|
+
loadOptions: {
|
|
49
|
+
routing: {
|
|
50
|
+
request: {
|
|
51
|
+
method: 'GET',
|
|
52
|
+
url: '/models',
|
|
53
|
+
},
|
|
54
|
+
output: {
|
|
55
|
+
postReceive: [
|
|
56
|
+
{
|
|
57
|
+
type: 'rootProperty',
|
|
58
|
+
properties: {
|
|
59
|
+
property: 'data',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
type: 'setKeyValue',
|
|
64
|
+
properties: {
|
|
65
|
+
name: '={{$responseItem.id}}',
|
|
66
|
+
value: '={{$responseItem.id}}',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
type: 'sort',
|
|
71
|
+
properties: {
|
|
72
|
+
key: 'name',
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
routing: {
|
|
81
|
+
send: {
|
|
82
|
+
type: 'body',
|
|
83
|
+
property: 'model',
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
required: true,
|
|
87
|
+
default: '',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
displayName: 'Model',
|
|
91
|
+
name: 'chatModel',
|
|
92
|
+
type: 'options',
|
|
93
|
+
description: 'The model available on your Mammouth API which will generate the completion',
|
|
94
|
+
displayOptions: {
|
|
95
|
+
show: {
|
|
96
|
+
operation: ['complete'],
|
|
97
|
+
resource: ['chat'],
|
|
98
|
+
},
|
|
99
|
+
hide: {
|
|
100
|
+
'@version': [1],
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
typeOptions: {
|
|
104
|
+
loadOptions: {
|
|
105
|
+
routing: {
|
|
106
|
+
request: {
|
|
107
|
+
method: 'GET',
|
|
108
|
+
url: '/models',
|
|
109
|
+
},
|
|
110
|
+
output: {
|
|
111
|
+
postReceive: [
|
|
112
|
+
{
|
|
113
|
+
type: 'rootProperty',
|
|
114
|
+
properties: {
|
|
115
|
+
property: 'data',
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
type: 'setKeyValue',
|
|
120
|
+
properties: {
|
|
121
|
+
name: '={{$responseItem.id}}',
|
|
122
|
+
value: '={{$responseItem.id}}',
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
type: 'sort',
|
|
127
|
+
properties: {
|
|
128
|
+
key: 'name',
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
routing: {
|
|
137
|
+
send: {
|
|
138
|
+
type: 'body',
|
|
139
|
+
property: 'model',
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
required: true,
|
|
143
|
+
default: '',
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
displayName: 'Prompt',
|
|
147
|
+
name: 'prompt',
|
|
148
|
+
type: 'fixedCollection',
|
|
149
|
+
typeOptions: {
|
|
150
|
+
sortable: true,
|
|
151
|
+
multipleValues: true,
|
|
152
|
+
},
|
|
153
|
+
displayOptions: {
|
|
154
|
+
show: {
|
|
155
|
+
resource: ['chat'],
|
|
156
|
+
operation: ['complete'],
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
placeholder: 'Add Message',
|
|
160
|
+
default: {},
|
|
161
|
+
options: [
|
|
162
|
+
{
|
|
163
|
+
displayName: 'Messages',
|
|
164
|
+
name: 'messages',
|
|
165
|
+
values: [
|
|
166
|
+
{
|
|
167
|
+
displayName: 'Role',
|
|
168
|
+
name: 'role',
|
|
169
|
+
type: 'options',
|
|
170
|
+
options: [
|
|
171
|
+
{
|
|
172
|
+
name: 'Assistant',
|
|
173
|
+
value: 'assistant',
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: 'System',
|
|
177
|
+
value: 'system',
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: 'User',
|
|
181
|
+
value: 'user',
|
|
182
|
+
},
|
|
183
|
+
],
|
|
184
|
+
default: 'user',
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
displayName: 'Content',
|
|
188
|
+
name: 'content',
|
|
189
|
+
type: 'string',
|
|
190
|
+
default: '',
|
|
191
|
+
},
|
|
192
|
+
],
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
routing: {
|
|
196
|
+
send: {
|
|
197
|
+
type: 'body',
|
|
198
|
+
property: 'messages',
|
|
199
|
+
value: '={{ $value.messages }}',
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
];
|
|
204
|
+
const sharedOperations = [
|
|
205
|
+
{
|
|
206
|
+
displayName: 'Simplify',
|
|
207
|
+
name: 'simplifyOutput',
|
|
208
|
+
type: 'boolean',
|
|
209
|
+
default: true,
|
|
210
|
+
displayOptions: {
|
|
211
|
+
show: {
|
|
212
|
+
operation: ['complete'],
|
|
213
|
+
resource: ['chat'],
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
routing: {
|
|
217
|
+
output: {
|
|
218
|
+
postReceive: [
|
|
219
|
+
{
|
|
220
|
+
type: 'set',
|
|
221
|
+
enabled: '={{$value}}',
|
|
222
|
+
properties: {
|
|
223
|
+
value: '={{ { "data": $response.body.choices } }}',
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
type: 'rootProperty',
|
|
228
|
+
enabled: '={{$value}}',
|
|
229
|
+
properties: {
|
|
230
|
+
property: 'data',
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
async function (items) {
|
|
234
|
+
if (this.getNode().parameters.simplifyOutput === false) {
|
|
235
|
+
return items;
|
|
236
|
+
}
|
|
237
|
+
return items.map((item) => {
|
|
238
|
+
return {
|
|
239
|
+
json: {
|
|
240
|
+
...item.json,
|
|
241
|
+
message: item.json.message,
|
|
242
|
+
},
|
|
243
|
+
};
|
|
244
|
+
});
|
|
245
|
+
},
|
|
246
|
+
],
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
description: 'Whether to return a simplified version of the response instead of the raw data',
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
displayName: 'Options',
|
|
253
|
+
name: 'options',
|
|
254
|
+
placeholder: 'Add option',
|
|
255
|
+
description: 'Additional options to add',
|
|
256
|
+
type: 'collection',
|
|
257
|
+
default: {},
|
|
258
|
+
displayOptions: {
|
|
259
|
+
show: {
|
|
260
|
+
operation: ['complete'],
|
|
261
|
+
resource: ['chat'],
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
options: [
|
|
265
|
+
{
|
|
266
|
+
displayName: 'Echo Prompt',
|
|
267
|
+
name: 'echo',
|
|
268
|
+
type: 'boolean',
|
|
269
|
+
description: 'Whether the prompt should be echo back in addition to the completion',
|
|
270
|
+
default: false,
|
|
271
|
+
displayOptions: {
|
|
272
|
+
show: {
|
|
273
|
+
'/operation': ['complete'],
|
|
274
|
+
},
|
|
275
|
+
},
|
|
276
|
+
routing: {
|
|
277
|
+
send: {
|
|
278
|
+
type: 'body',
|
|
279
|
+
property: 'echo',
|
|
280
|
+
},
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
displayName: 'Frequency Penalty',
|
|
285
|
+
name: 'frequency_penalty',
|
|
286
|
+
default: 0,
|
|
287
|
+
typeOptions: { maxValue: 2, minValue: -2, numberPrecision: 1 },
|
|
288
|
+
description: "Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim",
|
|
289
|
+
type: 'number',
|
|
290
|
+
routing: {
|
|
291
|
+
send: {
|
|
292
|
+
type: 'body',
|
|
293
|
+
property: 'frequency_penalty',
|
|
294
|
+
},
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
displayName: 'Maximum Number of Tokens',
|
|
299
|
+
name: 'maxTokens',
|
|
300
|
+
default: 16,
|
|
301
|
+
description: 'The maximum number of tokens to generate in the completion. Most models have a context length of 2048 tokens (except for the newest models, which support 32,768).',
|
|
302
|
+
type: 'number',
|
|
303
|
+
displayOptions: {
|
|
304
|
+
show: {
|
|
305
|
+
'/operation': ['complete'],
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
typeOptions: {
|
|
309
|
+
maxValue: 32768,
|
|
310
|
+
},
|
|
311
|
+
routing: {
|
|
312
|
+
send: {
|
|
313
|
+
type: 'body',
|
|
314
|
+
property: 'max_tokens',
|
|
315
|
+
},
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
displayName: 'Number of Completions',
|
|
320
|
+
name: 'n',
|
|
321
|
+
default: 1,
|
|
322
|
+
description: 'How many completions to generate for each prompt. Note: Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for max_tokens and stop.',
|
|
323
|
+
type: 'number',
|
|
324
|
+
routing: {
|
|
325
|
+
send: {
|
|
326
|
+
type: 'body',
|
|
327
|
+
property: 'n',
|
|
328
|
+
},
|
|
329
|
+
},
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
displayName: 'Presence Penalty',
|
|
333
|
+
name: 'presence_penalty',
|
|
334
|
+
default: 0,
|
|
335
|
+
typeOptions: { maxValue: 2, minValue: -2, numberPrecision: 1 },
|
|
336
|
+
description: "Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics",
|
|
337
|
+
type: 'number',
|
|
338
|
+
routing: {
|
|
339
|
+
send: {
|
|
340
|
+
type: 'body',
|
|
341
|
+
property: 'presence_penalty',
|
|
342
|
+
},
|
|
343
|
+
},
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
displayName: 'Sampling Temperature',
|
|
347
|
+
name: 'temperature',
|
|
348
|
+
default: 1,
|
|
349
|
+
typeOptions: { maxValue: 1, minValue: 0, numberPrecision: 1 },
|
|
350
|
+
description: 'Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive.',
|
|
351
|
+
type: 'number',
|
|
352
|
+
routing: {
|
|
353
|
+
send: {
|
|
354
|
+
type: 'body',
|
|
355
|
+
property: 'temperature',
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
displayName: 'Top P',
|
|
361
|
+
name: 'topP',
|
|
362
|
+
default: 1,
|
|
363
|
+
typeOptions: { maxValue: 1, minValue: 0, numberPrecision: 1 },
|
|
364
|
+
description: 'Controls diversity via nucleus sampling: 0.5 means half of all likelihood-weighted options are considered. We generally recommend altering this or temperature but not both.',
|
|
365
|
+
type: 'number',
|
|
366
|
+
routing: {
|
|
367
|
+
send: {
|
|
368
|
+
type: 'body',
|
|
369
|
+
property: 'top_p',
|
|
370
|
+
},
|
|
371
|
+
},
|
|
372
|
+
},
|
|
373
|
+
],
|
|
374
|
+
},
|
|
375
|
+
];
|
|
376
|
+
exports.chatFields = [
|
|
377
|
+
/* -------------------------------------------------------------------------- */
|
|
378
|
+
/* chat:complete */
|
|
379
|
+
/* -------------------------------------------------------------------------- */
|
|
380
|
+
...completeOperations,
|
|
381
|
+
/* -------------------------------------------------------------------------- */
|
|
382
|
+
/* chat:ALL */
|
|
383
|
+
/* -------------------------------------------------------------------------- */
|
|
384
|
+
...sharedOperations,
|
|
385
|
+
];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendErrorPostReceive = sendErrorPostReceive;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
async function sendErrorPostReceive(data, response) {
|
|
6
|
+
if (String(response.statusCode).startsWith('4') || String(response.statusCode).startsWith('5')) {
|
|
7
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), response);
|
|
8
|
+
}
|
|
9
|
+
return data;
|
|
10
|
+
}
|