n8n-nodes-sevdesk-v2
Version:
n8n community node for SevDesk API v2 integration with 24 production-ready workflow templates. Direct API access without external dependencies - simplified, secure, and optimized for German accounting automation (n8n 1.101.1 compatible).
114 lines (113 loc) • 6.92 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ResourceRegistry = void 0;
class ResourceRegistry {
static getResourceOptions() {
return this.resources.map(resource => ({
name: resource.name,
value: resource.value
}));
}
static getResourceHandler(resourceValue) {
const resource = this.resources.find(r => r.value === resourceValue);
return resource?.handler || 'handleGenericOperation';
}
static isResourceSupported(resourceValue) {
return this.resources.some(r => r.value === resourceValue);
}
static getResourceValues() {
return this.resources.map(r => r.value);
}
static getStrictResourceOptions() {
return this.strictResources.map(resource => ({
name: resource.name,
value: resource.value
}));
}
static getStrictResourceHandler(resourceValue) {
const resource = this.strictResources.find(r => r.value === resourceValue);
return resource?.handler || 'handleGenericOperation';
}
static isStrictResourceSupported(resourceValue) {
return this.strictResources.some(r => r.value === resourceValue);
}
static getStrictResourceValues() {
return this.strictResources.map(r => r.value);
}
static getStrictResourceConfig(resourceValue) {
return this.strictResources.find(r => r.value === resourceValue);
}
static validateResourceHandler(resourceValue, handler) {
const resource = this.strictResources.find(r => r.value === resourceValue);
return resource?.handler === handler;
}
static getResourcesByCategory(category) {
return this.strictResources.filter(r => r.category === category);
}
static getActiveResources() {
return this.strictResources.filter(r => !r.deprecated);
}
}
exports.ResourceRegistry = ResourceRegistry;
ResourceRegistry.strictResources = [
{ name: "AccountingContact", value: "accountingContact", handler: "handleGenericOperation" },
{ name: "Basic", value: "basics", handler: "handleBasicsOperation" },
{ name: "Batch Operations", value: "batch", handler: "handleBatchOperation" },
{ name: "Category", value: "category", handler: "handleCategoryOperation" },
{ name: "CheckAccount", value: "checkAccount", handler: "handleCheckAccountOperation" },
{ name: "CheckAccountTransaction", value: "checkAccountTransaction", handler: "handleGenericOperation" },
{ name: "CommunicationWay", value: "communicationWay", handler: "handleGenericOperation" },
{ name: "Contact", value: "contact", handler: "handleContactOperation" },
{ name: "Contact Address", value: "contactAddress", handler: "handleGenericOperation" },
{ name: "Contact Custom Field", value: "contactCustomField", handler: "handleGenericOperation" },
{ name: "Contact Custom Field Setting", value: "contactCustomFieldSetting", handler: "handleGenericOperation" },
{ name: "Contact Field", value: "contactField", handler: "handleGenericOperation" },
{ name: "Country", value: "country", handler: "handleGenericOperation" },
{ name: "Credit Note", value: "creditNote", handler: "handleCreditNoteOperation" },
{ name: "Credit Note Po", value: "creditNotePos", handler: "handleGenericOperation" },
{ name: "Export", value: "export", handler: "handleExportOperation" },
{ name: "Invoice", value: "invoice", handler: "handleInvoiceOperation" },
{ name: "Invoice Position", value: "invoicePos", handler: "handleGenericOperation" },
{ name: "Layout", value: "layout", handler: "handleGenericOperation" },
{ name: "Order", value: "order", handler: "handleOrderOperation" },
{ name: "Order Position", value: "orderPos", handler: "handleGenericOperation" },
{ name: "OrderPo", value: "orderPo", handler: "handleGenericOperation" },
{ name: "Part", value: "part", handler: "handlePartOperation" },
{ name: "Report", value: "report", handler: "handleReportOperation" },
{ name: "Tag", value: "tag", handler: "handleTagOperation" },
{ name: "Tag Relation", value: "tagRelation", handler: "handleGenericOperation" },
{ name: "Unity", value: "unity", handler: "handleGenericOperation" },
{ name: "Voucher", value: "voucher", handler: "handleVoucherOperation" },
{ name: "VoucherPo", value: "voucherPo", handler: "handleGenericOperation" },
];
ResourceRegistry.resources = [
{ name: "AccountingContact", value: "accountingContact", handler: "handleGenericOperation" },
{ name: "Basic", value: "basics", handler: "handleBasicsOperation" },
{ name: "Batch Operations", value: "batch", handler: "handleBatchOperation" },
{ name: "Category", value: "category", handler: "handleCategoryOperation" },
{ name: "CheckAccount", value: "checkAccount", handler: "handleCheckAccountOperation" },
{ name: "CheckAccountTransaction", value: "checkAccountTransaction", handler: "handleGenericOperation" },
{ name: "CommunicationWay", value: "communicationWay", handler: "handleGenericOperation" },
{ name: "Contact", value: "contact", handler: "handleContactOperation" },
{ name: "Contact Address", value: "contactAddress", handler: "handleGenericOperation" },
{ name: "Contact Custom Field", value: "contactCustomField", handler: "handleGenericOperation" },
{ name: "Contact Custom Field Setting", value: "contactCustomFieldSetting", handler: "handleGenericOperation" },
{ name: "Contact Field", value: "contactField", handler: "handleGenericOperation" },
{ name: "Country", value: "country", handler: "handleGenericOperation" },
{ name: "Credit Note", value: "creditNote", handler: "handleCreditNoteOperation" },
{ name: "Credit Note Po", value: "creditNotePos", handler: "handleGenericOperation" },
{ name: "Export", value: "export", handler: "handleExportOperation" },
{ name: "Invoice", value: "invoice", handler: "handleInvoiceOperation" },
{ name: "Invoice Position", value: "invoicePos", handler: "handleGenericOperation" },
{ name: "Layout", value: "layout", handler: "handleGenericOperation" },
{ name: "Order", value: "order", handler: "handleOrderOperation" },
{ name: "Order Position", value: "orderPos", handler: "handleGenericOperation" },
{ name: "OrderPo", value: "orderPo", handler: "handleGenericOperation" },
{ name: "Part", value: "part", handler: "handlePartOperation" },
{ name: "Report", value: "report", handler: "handleReportOperation" },
{ name: "Tag", value: "tag", handler: "handleTagOperation" },
{ name: "Tag Relation", value: "tagRelation", handler: "handleGenericOperation" },
{ name: "Unity", value: "unity", handler: "handleGenericOperation" },
{ name: "Voucher", value: "voucher", handler: "handleVoucherOperation" },
{ name: "VoucherPo", value: "voucherPo", handler: "handleGenericOperation" },
];