n8n-nodes-placid
Version:
n8n node to interact with Placid API for creative generation
26 lines • 859 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getImageById = getImageById;
exports.execute = execute;
async function getImageById(executeFunctions, imageId) {
const options = {
method: 'GET',
url: `https://api.placid.app/api/rest/images/${imageId}`,
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
};
return await executeFunctions.helpers.httpRequestWithAuthentication.call(executeFunctions, 'placidApi', options);
}
async function execute(i) {
const imageId = this.getNodeParameter('imageId', i);
if (!imageId) {
throw new Error('Image ID is required');
}
const response = await getImageById(this, imageId);
return {
json: response,
};
}
//# sourceMappingURL=get.operation.js.map