n8n-io / n8n-nodes-starter

Example starter module for custom n8n nodes.
MIT License
183 stars 128 forks source link

Programmatic-style node tutorial outdated #49

Open Noiirod opened 1 month ago

Noiirod commented 1 month ago

Hello, its me again, i have a problem with the programmatic-style node tutorial, 2 on 3 imports are outdated.

import {
    IExecuteFunctions,
} from 'n8n-core';

import {
    OptionsWithUri,
} from 'request';

I found that the first one is changed by n8n-workflow, but what about the second ? and how i should change the code in the exemple to match the right import :

// Make HTTP request according to https://sendgrid.com/docs/api-reference/
            const options: OptionsWithUri = {
                headers: {
                    'Accept': 'application/json',
                },
                method: 'PUT',
                body: {
                    contacts: [
                        data,
                    ],
                },
                uri: `https://api.sendgrid.com/v3/marketing/contacts`,
                json: true,
            };
            responseData = await this.helpers.requestWithAuthentication.call(this, 'friendGridApi', options);
            returnData.push(responseData);
        }

Thanks by advance !

netroy commented 1 month ago

can you please link to the tutorial you are using? we can then try to get it updated 🙏🏽

Noiirod commented 1 month ago

Sure ! there it is : https://docs.n8n.io/integrations/creating-nodes/build/programmatic-style-node/

Joffcom commented 1 month ago

I have created DOC-961 as the internal ticket to update the guides.

Noiirod commented 1 month ago

Thank you !