@klardaten/n8n-nodes-datevconnect 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -10
- package/dist/credentials/DatevConnectApi.credentials.js +68 -95
- package/dist/nodes/Accounting/Accounting.config.js +1373 -0
- package/dist/nodes/Accounting/Accounting.node.js +180 -5153
- package/dist/nodes/Accounting/handlers/AccountPostingResourceHandler.js +40 -0
- package/dist/nodes/Accounting/handlers/AccountingSequenceResourceHandler.js +72 -0
- package/dist/nodes/Accounting/handlers/AccountingStatisticsResourceHandler.js +38 -0
- package/dist/nodes/Accounting/handlers/AccountingSumsAndBalancesResourceHandler.js +52 -0
- package/dist/nodes/Accounting/handlers/AccountingTransactionKeysResourceHandler.js +53 -0
- package/dist/nodes/Accounting/handlers/AccountsPayableResourceHandler.js +67 -0
- package/dist/nodes/Accounting/handlers/AccountsReceivableResourceHandler.js +48 -0
- package/dist/nodes/Accounting/handlers/BaseResourceHandler.js +148 -0
- package/dist/nodes/Accounting/handlers/BusinessPartnersResourceHandler.js +207 -0
- package/dist/nodes/Accounting/handlers/ClientResourceHandler.js +52 -0
- package/dist/nodes/Accounting/handlers/CostCenterPropertiesResourceHandler.js +55 -0
- package/dist/nodes/Accounting/handlers/CostCentersUnitsResourceHandler.js +55 -0
- package/dist/nodes/Accounting/handlers/CostSequencesResourceHandler.js +88 -0
- package/dist/nodes/Accounting/handlers/CostSystemsResourceHandler.js +62 -0
- package/dist/nodes/Accounting/handlers/FiscalYearResourceHandler.js +49 -0
- package/dist/nodes/Accounting/handlers/GeneralLedgerAccountsResourceHandler.js +67 -0
- package/dist/nodes/Accounting/handlers/InternalCostServicesResourceHandler.js +40 -0
- package/dist/nodes/Accounting/handlers/PostingProposalsResourceHandler.js +98 -0
- package/dist/nodes/Accounting/handlers/StocktakingDataResourceHandler.js +57 -0
- package/dist/nodes/Accounting/handlers/TermsOfPaymentResourceHandler.js +69 -0
- package/dist/nodes/Accounting/handlers/VariousAddressesResourceHandler.js +56 -0
- package/dist/nodes/Accounting/handlers/index.js +45 -0
- package/dist/nodes/Accounting/types.js +5 -0
- package/dist/nodes/DocumentManagement/DocumentManagement.config.js +598 -0
- package/dist/nodes/DocumentManagement/DocumentManagement.node.js +96 -3513
- package/dist/nodes/DocumentManagement/handlers/BaseResourceHandler.js +121 -0
- package/dist/nodes/DocumentManagement/handlers/DocumentFileResourceHandler.js +126 -0
- package/dist/nodes/DocumentManagement/handlers/DocumentResourceHandler.js +184 -0
- package/dist/nodes/DocumentManagement/handlers/DocumentStateResourceHandler.js +58 -0
- package/dist/nodes/DocumentManagement/handlers/DomainResourceHandler.js +32 -0
- package/dist/nodes/DocumentManagement/handlers/IndividualPropertyResourceHandler.js +32 -0
- package/dist/nodes/DocumentManagement/handlers/IndividualReference1ResourceHandler.js +49 -0
- package/dist/nodes/DocumentManagement/handlers/IndividualReference2ResourceHandler.js +49 -0
- package/dist/nodes/DocumentManagement/handlers/InfoResourceHandler.js +30 -0
- package/dist/nodes/DocumentManagement/handlers/PropertyTemplateResourceHandler.js +34 -0
- package/dist/nodes/DocumentManagement/handlers/SecureAreaResourceHandler.js +32 -0
- package/dist/nodes/DocumentManagement/types.js +2 -0
- package/dist/nodes/DocumentManagement/utils.js +116 -0
- package/dist/nodes/IdentityAndAccessManagement/IdentityAndAccessManagement.config.js +368 -0
- package/dist/nodes/IdentityAndAccessManagement/IdentityAndAccessManagement.node.js +77 -2774
- package/dist/nodes/IdentityAndAccessManagement/handlers/BaseResourceHandler.js +87 -0
- package/dist/nodes/IdentityAndAccessManagement/handlers/CurrentUserResourceHandler.js +17 -0
- package/dist/nodes/IdentityAndAccessManagement/handlers/GroupResourceHandler.js +63 -0
- package/dist/nodes/IdentityAndAccessManagement/handlers/ResourceTypeResourceHandler.js +17 -0
- package/dist/nodes/IdentityAndAccessManagement/handlers/SchemaResourceHandler.js +30 -0
- package/dist/nodes/IdentityAndAccessManagement/handlers/ServiceProviderConfigResourceHandler.js +17 -0
- package/dist/nodes/IdentityAndAccessManagement/handlers/UserResourceHandler.js +73 -0
- package/dist/nodes/IdentityAndAccessManagement/types.js +2 -0
- package/dist/nodes/IdentityAndAccessManagement/utils.js +89 -0
- package/dist/nodes/MasterData/MasterData.config.js +902 -0
- package/dist/nodes/MasterData/MasterData.node.js +107 -3561
- package/dist/nodes/MasterData/handlers/AddresseeResourceHandler.js +98 -0
- package/dist/nodes/MasterData/handlers/AreaOfResponsibilityResourceHandler.js +42 -0
- package/dist/nodes/MasterData/handlers/BankResourceHandler.js +42 -0
- package/dist/nodes/MasterData/handlers/BaseResourceHandler.js +91 -0
- package/dist/nodes/MasterData/handlers/ClientCategoryTypeResourceHandler.js +78 -0
- package/dist/nodes/MasterData/handlers/ClientGroupTypeResourceHandler.js +78 -0
- package/dist/nodes/MasterData/handlers/ClientResourceHandler.js +183 -0
- package/dist/nodes/MasterData/handlers/CorporateStructureResourceHandler.js +68 -0
- package/dist/nodes/MasterData/handlers/CountryCodeResourceHandler.js +42 -0
- package/dist/nodes/MasterData/handlers/EmployeeResourceHandler.js +78 -0
- package/dist/nodes/MasterData/handlers/LegalFormResourceHandler.js +42 -0
- package/dist/nodes/MasterData/handlers/RelationshipResourceHandler.js +54 -0
- package/dist/nodes/MasterData/handlers/TaxAuthorityResourceHandler.js +42 -0
- package/dist/nodes/MasterData/types.js +2 -0
- package/dist/nodes/MasterData/utils.js +92 -0
- package/dist/src/services/accountingClient.js +766 -0
- package/dist/src/services/datevConnectClient.js +1809 -0
- package/dist/src/services/documentManagementClient.js +546 -0
- package/dist/src/services/identityAndAccessManagementClient.js +293 -0
- package/package.json +38 -39
- package/dist/nodes/Accounting/Accounting.node.json +0 -25
- package/dist/nodes/DocumentManagement/DocumentManagement.node.json +0 -25
- package/dist/nodes/IdentityAndAccessManagement/IdentityAndAccessManagement.node.json +0 -25
- package/dist/nodes/MasterData/MasterData.node.json +0 -25
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InternalCostServicesResourceHandler = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const BaseResourceHandler_1 = require("./BaseResourceHandler");
|
|
6
|
+
const accountingClient_1 = require("../../../src/services/accountingClient");
|
|
7
|
+
/**
|
|
8
|
+
* Handler for Internal Cost Services operations
|
|
9
|
+
* Manages operations related to internal cost service allocation records
|
|
10
|
+
*/
|
|
11
|
+
class InternalCostServicesResourceHandler extends BaseResourceHandler_1.BaseResourceHandler {
|
|
12
|
+
constructor(context, itemIndex) {
|
|
13
|
+
super(context, itemIndex);
|
|
14
|
+
}
|
|
15
|
+
async execute(operation, requestContext, returnData) {
|
|
16
|
+
switch (operation) {
|
|
17
|
+
case "create":
|
|
18
|
+
await this.handleCreate(requestContext, returnData);
|
|
19
|
+
break;
|
|
20
|
+
default:
|
|
21
|
+
throw new n8n_workflow_1.NodeOperationError(this.context.getNode(), `Unknown operation: ${operation}`, {
|
|
22
|
+
itemIndex: this.itemIndex,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
async handleCreate(requestContext, returnData) {
|
|
27
|
+
try {
|
|
28
|
+
const costSystemId = this.getRequiredString("costSystemId");
|
|
29
|
+
const internalCostServiceDataRaw = this.context.getNodeParameter("internalCostServiceData", this.itemIndex);
|
|
30
|
+
const internalCostServiceData = this.parseJsonParameter(internalCostServiceDataRaw, "internalCostServiceData");
|
|
31
|
+
const result = await accountingClient_1.datevConnectClient.accounting.createInternalCostService(this.context, requestContext.clientId, requestContext.fiscalYearId, costSystemId, internalCostServiceData);
|
|
32
|
+
const sendSuccess = this.createSendSuccess(returnData);
|
|
33
|
+
sendSuccess(result);
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
this.handleError(error, returnData);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.InternalCostServicesResourceHandler = InternalCostServicesResourceHandler;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PostingProposalsResourceHandler = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const accountingClient_1 = require("../../../src/services/accountingClient");
|
|
6
|
+
const BaseResourceHandler_1 = require("./BaseResourceHandler");
|
|
7
|
+
/**
|
|
8
|
+
* Handler for Posting Proposals operations
|
|
9
|
+
* Manages posting proposal rules and batch operations for invoices and cash register data
|
|
10
|
+
*/
|
|
11
|
+
class PostingProposalsResourceHandler extends BaseResourceHandler_1.BaseResourceHandler {
|
|
12
|
+
async execute(operation, requestContext, returnData) {
|
|
13
|
+
const sendSuccess = this.createSendSuccess(returnData);
|
|
14
|
+
try {
|
|
15
|
+
let response;
|
|
16
|
+
switch (operation) {
|
|
17
|
+
case "getRulesIncoming":
|
|
18
|
+
response = await this.handleGetRulesIncoming(requestContext);
|
|
19
|
+
break;
|
|
20
|
+
case "getRulesOutgoing":
|
|
21
|
+
response = await this.handleGetRulesOutgoing(requestContext);
|
|
22
|
+
break;
|
|
23
|
+
case "getRulesCashRegister":
|
|
24
|
+
response = await this.handleGetRulesCashRegister(requestContext);
|
|
25
|
+
break;
|
|
26
|
+
case "getRuleIncoming":
|
|
27
|
+
response = await this.handleGetRuleIncoming(requestContext);
|
|
28
|
+
break;
|
|
29
|
+
case "getRuleOutgoing":
|
|
30
|
+
response = await this.handleGetRuleOutgoing(requestContext);
|
|
31
|
+
break;
|
|
32
|
+
case "getRuleCashRegister":
|
|
33
|
+
response = await this.handleGetRuleCashRegister(requestContext);
|
|
34
|
+
break;
|
|
35
|
+
case "batchIncoming":
|
|
36
|
+
response = await this.handleBatchIncoming(requestContext);
|
|
37
|
+
break;
|
|
38
|
+
case "batchOutgoing":
|
|
39
|
+
response = await this.handleBatchOutgoing(requestContext);
|
|
40
|
+
break;
|
|
41
|
+
case "batchCashRegister":
|
|
42
|
+
response = await this.handleBatchCashRegister(requestContext);
|
|
43
|
+
break;
|
|
44
|
+
default:
|
|
45
|
+
throw new n8n_workflow_1.NodeOperationError(this.context.getNode(), `The operation "${operation}" is not supported for resource "postingProposals".`, { itemIndex: this.itemIndex });
|
|
46
|
+
}
|
|
47
|
+
sendSuccess(response);
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
this.handleError(error, returnData);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
// New handle methods for the converted pattern
|
|
54
|
+
// New handle methods for the converted pattern
|
|
55
|
+
async handleGetRulesIncoming(requestContext) {
|
|
56
|
+
const queryParams = this.buildQueryParams();
|
|
57
|
+
return await accountingClient_1.datevConnectClient.accounting.getPostingProposalRulesIncoming(this.context, requestContext.clientId, requestContext.fiscalYearId, queryParams);
|
|
58
|
+
}
|
|
59
|
+
async handleGetRulesOutgoing(requestContext) {
|
|
60
|
+
const queryParams = this.buildQueryParams();
|
|
61
|
+
return await accountingClient_1.datevConnectClient.accounting.getPostingProposalRulesOutgoing(this.context, requestContext.clientId, requestContext.fiscalYearId, queryParams);
|
|
62
|
+
}
|
|
63
|
+
async handleGetRulesCashRegister(requestContext) {
|
|
64
|
+
const queryParams = this.buildQueryParams();
|
|
65
|
+
return await accountingClient_1.datevConnectClient.accounting.getPostingProposalRulesCashRegister(this.context, requestContext.clientId, requestContext.fiscalYearId, queryParams);
|
|
66
|
+
}
|
|
67
|
+
async handleGetRuleIncoming(requestContext) {
|
|
68
|
+
const ruleId = this.getRequiredString("ruleId");
|
|
69
|
+
const queryParams = this.buildQueryParams();
|
|
70
|
+
return await accountingClient_1.datevConnectClient.accounting.getPostingProposalRuleIncoming(this.context, requestContext.clientId, requestContext.fiscalYearId, ruleId, queryParams);
|
|
71
|
+
}
|
|
72
|
+
async handleGetRuleOutgoing(requestContext) {
|
|
73
|
+
const ruleId = this.getRequiredString("ruleId");
|
|
74
|
+
const queryParams = this.buildQueryParams();
|
|
75
|
+
return await accountingClient_1.datevConnectClient.accounting.getPostingProposalRuleOutgoing(this.context, requestContext.clientId, requestContext.fiscalYearId, ruleId, queryParams);
|
|
76
|
+
}
|
|
77
|
+
async handleGetRuleCashRegister(requestContext) {
|
|
78
|
+
const ruleId = this.getRequiredString("ruleId");
|
|
79
|
+
const queryParams = this.buildQueryParams();
|
|
80
|
+
return await accountingClient_1.datevConnectClient.accounting.getPostingProposalRuleCashRegister(this.context, requestContext.clientId, requestContext.fiscalYearId, ruleId, queryParams);
|
|
81
|
+
}
|
|
82
|
+
async handleBatchIncoming(requestContext) {
|
|
83
|
+
const batchDataRaw = this.context.getNodeParameter("batchData", this.itemIndex);
|
|
84
|
+
const batchData = this.parseJsonParameter(batchDataRaw, "batchData");
|
|
85
|
+
return await accountingClient_1.datevConnectClient.accounting.batchPostingProposalsIncoming(this.context, requestContext.clientId, requestContext.fiscalYearId, batchData);
|
|
86
|
+
}
|
|
87
|
+
async handleBatchOutgoing(requestContext) {
|
|
88
|
+
const batchDataRaw = this.context.getNodeParameter("batchData", this.itemIndex);
|
|
89
|
+
const batchData = this.parseJsonParameter(batchDataRaw, "batchData");
|
|
90
|
+
return await accountingClient_1.datevConnectClient.accounting.batchPostingProposalsOutgoing(this.context, requestContext.clientId, requestContext.fiscalYearId, batchData);
|
|
91
|
+
}
|
|
92
|
+
async handleBatchCashRegister(requestContext) {
|
|
93
|
+
const batchDataRaw = this.context.getNodeParameter("batchData", this.itemIndex);
|
|
94
|
+
const batchData = this.parseJsonParameter(batchDataRaw, "batchData");
|
|
95
|
+
return await accountingClient_1.datevConnectClient.accounting.batchPostingProposalsCashRegister(this.context, requestContext.clientId, requestContext.fiscalYearId, batchData);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
exports.PostingProposalsResourceHandler = PostingProposalsResourceHandler;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StocktakingDataResourceHandler = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const accountingClient_1 = require("../../../src/services/accountingClient");
|
|
6
|
+
const BaseResourceHandler_1 = require("./BaseResourceHandler");
|
|
7
|
+
/**
|
|
8
|
+
* Handler for Stocktaking Data operations
|
|
9
|
+
* Manages operations related to inventory/stocktaking data in asset accounting
|
|
10
|
+
*/
|
|
11
|
+
class StocktakingDataResourceHandler extends BaseResourceHandler_1.BaseResourceHandler {
|
|
12
|
+
async execute(operation, requestContext, returnData) {
|
|
13
|
+
const sendSuccess = this.createSendSuccess(returnData);
|
|
14
|
+
try {
|
|
15
|
+
let response;
|
|
16
|
+
switch (operation) {
|
|
17
|
+
case "getAll":
|
|
18
|
+
response = await this.handleGetAll(requestContext);
|
|
19
|
+
break;
|
|
20
|
+
case "get":
|
|
21
|
+
response = await this.handleGet(requestContext);
|
|
22
|
+
break;
|
|
23
|
+
case "update":
|
|
24
|
+
response = await this.handleUpdate(requestContext);
|
|
25
|
+
break;
|
|
26
|
+
default:
|
|
27
|
+
throw new n8n_workflow_1.NodeOperationError(this.context.getNode(), `The operation "${operation}" is not supported for resource "stocktakingData".`, { itemIndex: this.itemIndex });
|
|
28
|
+
}
|
|
29
|
+
sendSuccess(response);
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
this.handleError(error, returnData);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
async handleGetAll(requestContext) {
|
|
36
|
+
const queryParams = this.buildQueryParams();
|
|
37
|
+
const result = await accountingClient_1.datevConnectClient.accounting.getStocktakingData(this.context, requestContext.clientId, requestContext.fiscalYearId, queryParams);
|
|
38
|
+
return result !== null && result !== void 0 ? result : null;
|
|
39
|
+
}
|
|
40
|
+
async handleGet(requestContext) {
|
|
41
|
+
const assetId = this.getRequiredString("assetId");
|
|
42
|
+
const queryParams = this.buildQueryParams();
|
|
43
|
+
const result = await accountingClient_1.datevConnectClient.accounting.getStocktakingDataByAsset(this.context, requestContext.clientId, requestContext.fiscalYearId, assetId, queryParams);
|
|
44
|
+
return result !== null && result !== void 0 ? result : null;
|
|
45
|
+
}
|
|
46
|
+
async handleUpdate(requestContext) {
|
|
47
|
+
const assetId = this.getRequiredString("assetId");
|
|
48
|
+
const stocktakingData = this.getRequiredString("stocktakingData");
|
|
49
|
+
const data = this.parseJsonParameter(stocktakingData, "stocktakingData");
|
|
50
|
+
if (!data || typeof data !== 'object' || Array.isArray(data)) {
|
|
51
|
+
throw new n8n_workflow_1.NodeOperationError(this.context.getNode(), "Stocktaking data must be a valid JSON object", { itemIndex: this.itemIndex });
|
|
52
|
+
}
|
|
53
|
+
const result = await accountingClient_1.datevConnectClient.accounting.updateStocktakingData(this.context, requestContext.clientId, requestContext.fiscalYearId, assetId, data);
|
|
54
|
+
return result !== null && result !== void 0 ? result : null;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.StocktakingDataResourceHandler = StocktakingDataResourceHandler;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TermsOfPaymentResourceHandler = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const accountingClient_1 = require("../../../src/services/accountingClient");
|
|
6
|
+
const BaseResourceHandler_1 = require("./BaseResourceHandler");
|
|
7
|
+
/**
|
|
8
|
+
* Handler for Terms of Payment operations
|
|
9
|
+
* Manages operations related to payment terms configurations and settings
|
|
10
|
+
*/
|
|
11
|
+
class TermsOfPaymentResourceHandler extends BaseResourceHandler_1.BaseResourceHandler {
|
|
12
|
+
async execute(operation, requestContext, returnData) {
|
|
13
|
+
const sendSuccess = this.createSendSuccess(returnData);
|
|
14
|
+
try {
|
|
15
|
+
let response;
|
|
16
|
+
switch (operation) {
|
|
17
|
+
case "getAll":
|
|
18
|
+
response = await this.handleGetAll(requestContext);
|
|
19
|
+
break;
|
|
20
|
+
case "get":
|
|
21
|
+
response = await this.handleGet(requestContext);
|
|
22
|
+
break;
|
|
23
|
+
case "create":
|
|
24
|
+
response = await this.handleCreate(requestContext);
|
|
25
|
+
break;
|
|
26
|
+
case "update":
|
|
27
|
+
response = await this.handleUpdate(requestContext);
|
|
28
|
+
break;
|
|
29
|
+
default:
|
|
30
|
+
throw new n8n_workflow_1.NodeOperationError(this.context.getNode(), `The operation "${operation}" is not supported for resource "termsOfPayment".`, { itemIndex: this.itemIndex });
|
|
31
|
+
}
|
|
32
|
+
sendSuccess(response);
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
this.handleError(error, returnData);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
async handleGetAll(requestContext) {
|
|
39
|
+
const queryParams = this.buildQueryParams();
|
|
40
|
+
const result = await accountingClient_1.datevConnectClient.accounting.getTermsOfPayment(this.context, requestContext.clientId, requestContext.fiscalYearId, queryParams);
|
|
41
|
+
return result !== null && result !== void 0 ? result : null;
|
|
42
|
+
}
|
|
43
|
+
async handleGet(requestContext) {
|
|
44
|
+
const termOfPaymentId = this.getRequiredString("termOfPaymentId");
|
|
45
|
+
const queryParams = this.buildQueryParams();
|
|
46
|
+
const result = await accountingClient_1.datevConnectClient.accounting.getTermOfPayment(this.context, requestContext.clientId, requestContext.fiscalYearId, termOfPaymentId, queryParams);
|
|
47
|
+
return result !== null && result !== void 0 ? result : null;
|
|
48
|
+
}
|
|
49
|
+
async handleCreate(requestContext) {
|
|
50
|
+
const termOfPaymentData = this.getRequiredString("termOfPaymentData");
|
|
51
|
+
const data = this.parseJsonParameter(termOfPaymentData, "termOfPaymentData");
|
|
52
|
+
if (!data || typeof data !== 'object' || Array.isArray(data)) {
|
|
53
|
+
throw new n8n_workflow_1.NodeOperationError(this.context.getNode(), "Term of payment data must be a valid JSON object", { itemIndex: this.itemIndex });
|
|
54
|
+
}
|
|
55
|
+
const result = await accountingClient_1.datevConnectClient.accounting.createTermOfPayment(this.context, requestContext.clientId, requestContext.fiscalYearId, data);
|
|
56
|
+
return result !== null && result !== void 0 ? result : null;
|
|
57
|
+
}
|
|
58
|
+
async handleUpdate(requestContext) {
|
|
59
|
+
const termOfPaymentId = this.getRequiredString("termOfPaymentId");
|
|
60
|
+
const termOfPaymentData = this.getRequiredString("termOfPaymentData");
|
|
61
|
+
const data = this.parseJsonParameter(termOfPaymentData, "termOfPaymentData");
|
|
62
|
+
if (!data || typeof data !== 'object' || Array.isArray(data)) {
|
|
63
|
+
throw new n8n_workflow_1.NodeOperationError(this.context.getNode(), "Term of payment data must be a valid JSON object", { itemIndex: this.itemIndex });
|
|
64
|
+
}
|
|
65
|
+
const result = await accountingClient_1.datevConnectClient.accounting.updateTermOfPayment(this.context, requestContext.clientId, requestContext.fiscalYearId, termOfPaymentId, data);
|
|
66
|
+
return result !== null && result !== void 0 ? result : null;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.TermsOfPaymentResourceHandler = TermsOfPaymentResourceHandler;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VariousAddressesResourceHandler = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const accountingClient_1 = require("../../../src/services/accountingClient");
|
|
6
|
+
const BaseResourceHandler_1 = require("./BaseResourceHandler");
|
|
7
|
+
/**
|
|
8
|
+
* Handler for Various Addresses operations
|
|
9
|
+
* Manages operations related to address management for various business partners
|
|
10
|
+
*/
|
|
11
|
+
class VariousAddressesResourceHandler extends BaseResourceHandler_1.BaseResourceHandler {
|
|
12
|
+
async execute(operation, requestContext, returnData) {
|
|
13
|
+
const sendSuccess = this.createSendSuccess(returnData);
|
|
14
|
+
try {
|
|
15
|
+
let response;
|
|
16
|
+
switch (operation) {
|
|
17
|
+
case "getAll":
|
|
18
|
+
response = await this.handleGetAll(requestContext);
|
|
19
|
+
break;
|
|
20
|
+
case "get":
|
|
21
|
+
response = await this.handleGet(requestContext);
|
|
22
|
+
break;
|
|
23
|
+
case "create":
|
|
24
|
+
response = await this.handleCreate(requestContext);
|
|
25
|
+
break;
|
|
26
|
+
default:
|
|
27
|
+
throw new n8n_workflow_1.NodeOperationError(this.context.getNode(), `The operation "${operation}" is not supported for resource "variousAddresses".`, { itemIndex: this.itemIndex });
|
|
28
|
+
}
|
|
29
|
+
sendSuccess(response);
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
this.handleError(error, returnData);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
async handleGetAll(requestContext) {
|
|
36
|
+
const queryParams = this.buildQueryParams();
|
|
37
|
+
const result = await accountingClient_1.datevConnectClient.accounting.getVariousAddresses(this.context, requestContext.clientId, requestContext.fiscalYearId, queryParams);
|
|
38
|
+
return result !== null && result !== void 0 ? result : null;
|
|
39
|
+
}
|
|
40
|
+
async handleGet(requestContext) {
|
|
41
|
+
const variousAddressId = this.getRequiredString("variousAddressId");
|
|
42
|
+
const queryParams = this.buildQueryParams();
|
|
43
|
+
const result = await accountingClient_1.datevConnectClient.accounting.getVariousAddress(this.context, requestContext.clientId, requestContext.fiscalYearId, variousAddressId, queryParams);
|
|
44
|
+
return result !== null && result !== void 0 ? result : null;
|
|
45
|
+
}
|
|
46
|
+
async handleCreate(requestContext) {
|
|
47
|
+
const variousAddressData = this.getRequiredString("variousAddressData");
|
|
48
|
+
const data = this.parseJsonParameter(variousAddressData, "variousAddressData");
|
|
49
|
+
if (!data || typeof data !== 'object' || Array.isArray(data)) {
|
|
50
|
+
throw new n8n_workflow_1.NodeOperationError(this.context.getNode(), "Various address data must be a valid JSON object", { itemIndex: this.itemIndex });
|
|
51
|
+
}
|
|
52
|
+
const result = await accountingClient_1.datevConnectClient.accounting.createVariousAddress(this.context, requestContext.clientId, requestContext.fiscalYearId, data);
|
|
53
|
+
return result !== null && result !== void 0 ? result : null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.VariousAddressesResourceHandler = VariousAddressesResourceHandler;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VariousAddressesResourceHandler = exports.AccountingTransactionKeysResourceHandler = exports.AccountingStatisticsResourceHandler = exports.CostSequencesResourceHandler = exports.InternalCostServicesResourceHandler = exports.CostCenterPropertiesResourceHandler = exports.CostCentersUnitsResourceHandler = exports.CostSystemsResourceHandler = exports.StocktakingDataResourceHandler = exports.TermsOfPaymentResourceHandler = exports.GeneralLedgerAccountsResourceHandler = exports.BusinessPartnersResourceHandler = exports.AccountingSumsAndBalancesResourceHandler = exports.PostingProposalsResourceHandler = exports.AccountingSequenceResourceHandler = exports.AccountPostingResourceHandler = exports.AccountsPayableResourceHandler = exports.AccountsReceivableResourceHandler = exports.FiscalYearResourceHandler = exports.ClientResourceHandler = exports.BaseResourceHandler = void 0;
|
|
4
|
+
var BaseResourceHandler_1 = require("./BaseResourceHandler");
|
|
5
|
+
Object.defineProperty(exports, "BaseResourceHandler", { enumerable: true, get: function () { return BaseResourceHandler_1.BaseResourceHandler; } });
|
|
6
|
+
var ClientResourceHandler_1 = require("./ClientResourceHandler");
|
|
7
|
+
Object.defineProperty(exports, "ClientResourceHandler", { enumerable: true, get: function () { return ClientResourceHandler_1.ClientResourceHandler; } });
|
|
8
|
+
var FiscalYearResourceHandler_1 = require("./FiscalYearResourceHandler");
|
|
9
|
+
Object.defineProperty(exports, "FiscalYearResourceHandler", { enumerable: true, get: function () { return FiscalYearResourceHandler_1.FiscalYearResourceHandler; } });
|
|
10
|
+
var AccountsReceivableResourceHandler_1 = require("./AccountsReceivableResourceHandler");
|
|
11
|
+
Object.defineProperty(exports, "AccountsReceivableResourceHandler", { enumerable: true, get: function () { return AccountsReceivableResourceHandler_1.AccountsReceivableResourceHandler; } });
|
|
12
|
+
var AccountsPayableResourceHandler_1 = require("./AccountsPayableResourceHandler");
|
|
13
|
+
Object.defineProperty(exports, "AccountsPayableResourceHandler", { enumerable: true, get: function () { return AccountsPayableResourceHandler_1.AccountsPayableResourceHandler; } });
|
|
14
|
+
var AccountPostingResourceHandler_1 = require("./AccountPostingResourceHandler");
|
|
15
|
+
Object.defineProperty(exports, "AccountPostingResourceHandler", { enumerable: true, get: function () { return AccountPostingResourceHandler_1.AccountPostingResourceHandler; } });
|
|
16
|
+
var AccountingSequenceResourceHandler_1 = require("./AccountingSequenceResourceHandler");
|
|
17
|
+
Object.defineProperty(exports, "AccountingSequenceResourceHandler", { enumerable: true, get: function () { return AccountingSequenceResourceHandler_1.AccountingSequenceResourceHandler; } });
|
|
18
|
+
var PostingProposalsResourceHandler_1 = require("./PostingProposalsResourceHandler");
|
|
19
|
+
Object.defineProperty(exports, "PostingProposalsResourceHandler", { enumerable: true, get: function () { return PostingProposalsResourceHandler_1.PostingProposalsResourceHandler; } });
|
|
20
|
+
var AccountingSumsAndBalancesResourceHandler_1 = require("./AccountingSumsAndBalancesResourceHandler");
|
|
21
|
+
Object.defineProperty(exports, "AccountingSumsAndBalancesResourceHandler", { enumerable: true, get: function () { return AccountingSumsAndBalancesResourceHandler_1.AccountingSumsAndBalancesResourceHandler; } });
|
|
22
|
+
var BusinessPartnersResourceHandler_1 = require("./BusinessPartnersResourceHandler");
|
|
23
|
+
Object.defineProperty(exports, "BusinessPartnersResourceHandler", { enumerable: true, get: function () { return BusinessPartnersResourceHandler_1.BusinessPartnersResourceHandler; } });
|
|
24
|
+
var GeneralLedgerAccountsResourceHandler_1 = require("./GeneralLedgerAccountsResourceHandler");
|
|
25
|
+
Object.defineProperty(exports, "GeneralLedgerAccountsResourceHandler", { enumerable: true, get: function () { return GeneralLedgerAccountsResourceHandler_1.GeneralLedgerAccountsResourceHandler; } });
|
|
26
|
+
var TermsOfPaymentResourceHandler_1 = require("./TermsOfPaymentResourceHandler");
|
|
27
|
+
Object.defineProperty(exports, "TermsOfPaymentResourceHandler", { enumerable: true, get: function () { return TermsOfPaymentResourceHandler_1.TermsOfPaymentResourceHandler; } });
|
|
28
|
+
var StocktakingDataResourceHandler_1 = require("./StocktakingDataResourceHandler");
|
|
29
|
+
Object.defineProperty(exports, "StocktakingDataResourceHandler", { enumerable: true, get: function () { return StocktakingDataResourceHandler_1.StocktakingDataResourceHandler; } });
|
|
30
|
+
var CostSystemsResourceHandler_1 = require("./CostSystemsResourceHandler");
|
|
31
|
+
Object.defineProperty(exports, "CostSystemsResourceHandler", { enumerable: true, get: function () { return CostSystemsResourceHandler_1.CostSystemsResourceHandler; } });
|
|
32
|
+
var CostCentersUnitsResourceHandler_1 = require("./CostCentersUnitsResourceHandler");
|
|
33
|
+
Object.defineProperty(exports, "CostCentersUnitsResourceHandler", { enumerable: true, get: function () { return CostCentersUnitsResourceHandler_1.CostCentersUnitsResourceHandler; } });
|
|
34
|
+
var CostCenterPropertiesResourceHandler_1 = require("./CostCenterPropertiesResourceHandler");
|
|
35
|
+
Object.defineProperty(exports, "CostCenterPropertiesResourceHandler", { enumerable: true, get: function () { return CostCenterPropertiesResourceHandler_1.CostCenterPropertiesResourceHandler; } });
|
|
36
|
+
var InternalCostServicesResourceHandler_1 = require("./InternalCostServicesResourceHandler");
|
|
37
|
+
Object.defineProperty(exports, "InternalCostServicesResourceHandler", { enumerable: true, get: function () { return InternalCostServicesResourceHandler_1.InternalCostServicesResourceHandler; } });
|
|
38
|
+
var CostSequencesResourceHandler_1 = require("./CostSequencesResourceHandler");
|
|
39
|
+
Object.defineProperty(exports, "CostSequencesResourceHandler", { enumerable: true, get: function () { return CostSequencesResourceHandler_1.CostSequencesResourceHandler; } });
|
|
40
|
+
var AccountingStatisticsResourceHandler_1 = require("./AccountingStatisticsResourceHandler");
|
|
41
|
+
Object.defineProperty(exports, "AccountingStatisticsResourceHandler", { enumerable: true, get: function () { return AccountingStatisticsResourceHandler_1.AccountingStatisticsResourceHandler; } });
|
|
42
|
+
var AccountingTransactionKeysResourceHandler_1 = require("./AccountingTransactionKeysResourceHandler");
|
|
43
|
+
Object.defineProperty(exports, "AccountingTransactionKeysResourceHandler", { enumerable: true, get: function () { return AccountingTransactionKeysResourceHandler_1.AccountingTransactionKeysResourceHandler; } });
|
|
44
|
+
var VariousAddressesResourceHandler_1 = require("./VariousAddressesResourceHandler");
|
|
45
|
+
Object.defineProperty(exports, "VariousAddressesResourceHandler", { enumerable: true, get: function () { return VariousAddressesResourceHandler_1.VariousAddressesResourceHandler; } });
|