UNPKG

n8n-nodes-placid

Version:

n8n node to interact with Placid API for creative generation

32 lines 1.12 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.execute = execute; const n8n_workflow_1 = require("n8n-workflow"); async function execute(index) { try { const templateId = this.getNodeParameter('templateId', index); if (!templateId) { throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Template ID is required', { itemIndex: index, }); } const options = { method: 'GET', url: `https://api.placid.app/api/rest/templates/${templateId}`, headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', }, }; const response = await this.helpers.httpRequestWithAuthentication.call(this, 'placidApi', options); return { json: response, }; } catch (error) { throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Failed to get template: ${error.message}`, { itemIndex: index, }); } } //# sourceMappingURL=get.operation.js.map