n8n-nodes-placid
Version:
n8n node to interact with Placid API for creative generation
30 lines • 1.15 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.execute = execute;
const n8n_workflow_1 = require("n8n-workflow");
const config_1 = require("../../utils/config");
async function execute(i) {
const imageId = this.getNodeParameter('imageId', i);
if (!imageId) {
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Image ID is required');
}
const options = {
method: 'DELETE',
url: `${config_1.PlacidConfig.getRestUrl(config_1.PlacidConfig.ENDPOINTS.IMAGES)}/${imageId}`,
headers: {
'Accept': config_1.PlacidConfig.HTTP.HEADERS.ACCEPT,
'Content-Type': config_1.PlacidConfig.HTTP.HEADERS.CONTENT_TYPE,
'x-placid-integration': config_1.PlacidConfig.HTTP.HEADERS.PLACID_INTEGRATION,
},
};
await this.helpers.httpRequestWithAuthentication.call(this, 'placidApi', options);
return {
json: {
success: true,
message: `Image ${imageId} deleted successfully`,
id: imageId,
},
pairedItem: { item: i },
};
}
//# sourceMappingURL=delete.operation.js.map