n8n-nodes-base
Version:
Base nodes of n8n
39 lines • 1.53 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.description = void 0;
exports.execute = execute;
const utilities_1 = require("../../../../utils/utilities");
const descriptions_1 = require("../../descriptions");
const transport_1 = require("../../transport");
const properties = [
descriptions_1.logRLC,
{
displayName: 'Attachment Name or ID',
name: 'attachmentId',
type: 'options',
default: '',
required: true,
description: 'ID of the attachment. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
typeOptions: {
loadOptionsMethod: 'loadLogAttachments',
loadOptionsDependsOn: ['logId.value'],
},
},
];
const displayOptions = {
show: {
resource: ['log'],
operation: ['deleteAttachment'],
},
};
exports.description = (0, utilities_1.updateDisplayOptions)(displayOptions, properties);
async function execute(i) {
const logId = this.getNodeParameter('logId', i, '', { extractValue: true });
const attachmentId = this.getNodeParameter('attachmentId', i);
await transport_1.theHiveApiRequest.call(this, 'DELETE', `/v1/log/${logId}/attachments/${attachmentId}`);
const executionData = this.helpers.constructExecutionMetaData((0, utilities_1.wrapData)({ success: true }), {
itemData: { item: i },
});
return executionData;
}
//# sourceMappingURL=deleteAttachment.operation.js.map