@klardaten/n8n-nodes-datevconnect 1.0.2 → 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.
Files changed (79) hide show
  1. package/README.md +7 -10
  2. package/dist/credentials/DatevConnectApi.credentials.js +68 -95
  3. package/dist/nodes/Accounting/Accounting.config.js +1373 -0
  4. package/dist/nodes/Accounting/Accounting.node.js +180 -5153
  5. package/dist/nodes/Accounting/handlers/AccountPostingResourceHandler.js +40 -0
  6. package/dist/nodes/Accounting/handlers/AccountingSequenceResourceHandler.js +72 -0
  7. package/dist/nodes/Accounting/handlers/AccountingStatisticsResourceHandler.js +38 -0
  8. package/dist/nodes/Accounting/handlers/AccountingSumsAndBalancesResourceHandler.js +52 -0
  9. package/dist/nodes/Accounting/handlers/AccountingTransactionKeysResourceHandler.js +53 -0
  10. package/dist/nodes/Accounting/handlers/AccountsPayableResourceHandler.js +67 -0
  11. package/dist/nodes/Accounting/handlers/AccountsReceivableResourceHandler.js +48 -0
  12. package/dist/nodes/Accounting/handlers/BaseResourceHandler.js +148 -0
  13. package/dist/nodes/Accounting/handlers/BusinessPartnersResourceHandler.js +207 -0
  14. package/dist/nodes/Accounting/handlers/ClientResourceHandler.js +52 -0
  15. package/dist/nodes/Accounting/handlers/CostCenterPropertiesResourceHandler.js +55 -0
  16. package/dist/nodes/Accounting/handlers/CostCentersUnitsResourceHandler.js +55 -0
  17. package/dist/nodes/Accounting/handlers/CostSequencesResourceHandler.js +88 -0
  18. package/dist/nodes/Accounting/handlers/CostSystemsResourceHandler.js +62 -0
  19. package/dist/nodes/Accounting/handlers/FiscalYearResourceHandler.js +49 -0
  20. package/dist/nodes/Accounting/handlers/GeneralLedgerAccountsResourceHandler.js +67 -0
  21. package/dist/nodes/Accounting/handlers/InternalCostServicesResourceHandler.js +40 -0
  22. package/dist/nodes/Accounting/handlers/PostingProposalsResourceHandler.js +98 -0
  23. package/dist/nodes/Accounting/handlers/StocktakingDataResourceHandler.js +57 -0
  24. package/dist/nodes/Accounting/handlers/TermsOfPaymentResourceHandler.js +69 -0
  25. package/dist/nodes/Accounting/handlers/VariousAddressesResourceHandler.js +56 -0
  26. package/dist/nodes/Accounting/handlers/index.js +45 -0
  27. package/dist/nodes/Accounting/types.js +5 -0
  28. package/dist/nodes/DocumentManagement/DocumentManagement.config.js +598 -0
  29. package/dist/nodes/DocumentManagement/DocumentManagement.node.js +96 -3513
  30. package/dist/nodes/DocumentManagement/handlers/BaseResourceHandler.js +121 -0
  31. package/dist/nodes/DocumentManagement/handlers/DocumentFileResourceHandler.js +126 -0
  32. package/dist/nodes/DocumentManagement/handlers/DocumentResourceHandler.js +184 -0
  33. package/dist/nodes/DocumentManagement/handlers/DocumentStateResourceHandler.js +58 -0
  34. package/dist/nodes/DocumentManagement/handlers/DomainResourceHandler.js +32 -0
  35. package/dist/nodes/DocumentManagement/handlers/IndividualPropertyResourceHandler.js +32 -0
  36. package/dist/nodes/DocumentManagement/handlers/IndividualReference1ResourceHandler.js +49 -0
  37. package/dist/nodes/DocumentManagement/handlers/IndividualReference2ResourceHandler.js +49 -0
  38. package/dist/nodes/DocumentManagement/handlers/InfoResourceHandler.js +30 -0
  39. package/dist/nodes/DocumentManagement/handlers/PropertyTemplateResourceHandler.js +34 -0
  40. package/dist/nodes/DocumentManagement/handlers/SecureAreaResourceHandler.js +32 -0
  41. package/dist/nodes/DocumentManagement/types.js +2 -0
  42. package/dist/nodes/DocumentManagement/utils.js +116 -0
  43. package/dist/nodes/IdentityAndAccessManagement/IdentityAndAccessManagement.config.js +368 -0
  44. package/dist/nodes/IdentityAndAccessManagement/IdentityAndAccessManagement.node.js +77 -2774
  45. package/dist/nodes/IdentityAndAccessManagement/handlers/BaseResourceHandler.js +87 -0
  46. package/dist/nodes/IdentityAndAccessManagement/handlers/CurrentUserResourceHandler.js +17 -0
  47. package/dist/nodes/IdentityAndAccessManagement/handlers/GroupResourceHandler.js +63 -0
  48. package/dist/nodes/IdentityAndAccessManagement/handlers/ResourceTypeResourceHandler.js +17 -0
  49. package/dist/nodes/IdentityAndAccessManagement/handlers/SchemaResourceHandler.js +30 -0
  50. package/dist/nodes/IdentityAndAccessManagement/handlers/ServiceProviderConfigResourceHandler.js +17 -0
  51. package/dist/nodes/IdentityAndAccessManagement/handlers/UserResourceHandler.js +73 -0
  52. package/dist/nodes/IdentityAndAccessManagement/types.js +2 -0
  53. package/dist/nodes/IdentityAndAccessManagement/utils.js +89 -0
  54. package/dist/nodes/MasterData/MasterData.config.js +902 -0
  55. package/dist/nodes/MasterData/MasterData.node.js +107 -3561
  56. package/dist/nodes/MasterData/handlers/AddresseeResourceHandler.js +98 -0
  57. package/dist/nodes/MasterData/handlers/AreaOfResponsibilityResourceHandler.js +42 -0
  58. package/dist/nodes/MasterData/handlers/BankResourceHandler.js +42 -0
  59. package/dist/nodes/MasterData/handlers/BaseResourceHandler.js +91 -0
  60. package/dist/nodes/MasterData/handlers/ClientCategoryTypeResourceHandler.js +78 -0
  61. package/dist/nodes/MasterData/handlers/ClientGroupTypeResourceHandler.js +78 -0
  62. package/dist/nodes/MasterData/handlers/ClientResourceHandler.js +183 -0
  63. package/dist/nodes/MasterData/handlers/CorporateStructureResourceHandler.js +68 -0
  64. package/dist/nodes/MasterData/handlers/CountryCodeResourceHandler.js +42 -0
  65. package/dist/nodes/MasterData/handlers/EmployeeResourceHandler.js +78 -0
  66. package/dist/nodes/MasterData/handlers/LegalFormResourceHandler.js +42 -0
  67. package/dist/nodes/MasterData/handlers/RelationshipResourceHandler.js +54 -0
  68. package/dist/nodes/MasterData/handlers/TaxAuthorityResourceHandler.js +42 -0
  69. package/dist/nodes/MasterData/types.js +2 -0
  70. package/dist/nodes/MasterData/utils.js +92 -0
  71. package/dist/src/services/accountingClient.js +766 -0
  72. package/dist/src/services/datevConnectClient.js +1809 -0
  73. package/dist/src/services/documentManagementClient.js +546 -0
  74. package/dist/src/services/identityAndAccessManagementClient.js +293 -0
  75. package/package.json +38 -39
  76. package/dist/nodes/Accounting/Accounting.node.json +0 -25
  77. package/dist/nodes/DocumentManagement/DocumentManagement.node.json +0 -25
  78. package/dist/nodes/IdentityAndAccessManagement/IdentityAndAccessManagement.node.json +0 -25
  79. package/dist/nodes/MasterData/MasterData.node.json +0 -25
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CountryCodeResourceHandler = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const datevConnectClient_1 = require("../../../src/services/datevConnectClient");
6
+ const BaseResourceHandler_1 = require("./BaseResourceHandler");
7
+ /**
8
+ * Handler for all country code-related operations
9
+ */
10
+ class CountryCodeResourceHandler extends BaseResourceHandler_1.BaseResourceHandler {
11
+ async execute(operation, authContext, returnData) {
12
+ const sendSuccess = this.createSendSuccess(returnData);
13
+ try {
14
+ let response;
15
+ switch (operation) {
16
+ case "getAll":
17
+ response = await this.handleGetAll(authContext);
18
+ break;
19
+ default:
20
+ throw new n8n_workflow_1.NodeOperationError(this.context.getNode(), `The operation "${operation}" is not supported for resource "countryCode".`, { itemIndex: this.itemIndex });
21
+ }
22
+ sendSuccess(response);
23
+ }
24
+ catch (error) {
25
+ this.handleError(error, returnData);
26
+ }
27
+ }
28
+ async handleGetAll(authContext) {
29
+ const top = this.getNumberParameter("top", 100);
30
+ const skip = this.getNumberParameter("skip", 0);
31
+ const select = this.getOptionalString("select");
32
+ const filter = this.getOptionalString("filter");
33
+ return await (0, datevConnectClient_1.fetchCountryCodes)({
34
+ ...authContext,
35
+ top,
36
+ skip,
37
+ select,
38
+ filter,
39
+ });
40
+ }
41
+ }
42
+ exports.CountryCodeResourceHandler = CountryCodeResourceHandler;
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EmployeeResourceHandler = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const datevConnectClient_1 = require("../../../src/services/datevConnectClient");
6
+ const BaseResourceHandler_1 = require("./BaseResourceHandler");
7
+ /**
8
+ * Handler for all employee-related operations
9
+ */
10
+ class EmployeeResourceHandler extends BaseResourceHandler_1.BaseResourceHandler {
11
+ async execute(operation, authContext, returnData) {
12
+ const sendSuccess = this.createSendSuccess(returnData);
13
+ try {
14
+ let response;
15
+ switch (operation) {
16
+ case "getAll":
17
+ response = await this.handleGetAll(authContext);
18
+ break;
19
+ case "get":
20
+ response = await this.handleGet(authContext);
21
+ break;
22
+ case "create":
23
+ response = await this.handleCreate(authContext);
24
+ break;
25
+ case "update":
26
+ response = await this.handleUpdate(authContext);
27
+ break;
28
+ default:
29
+ throw new n8n_workflow_1.NodeOperationError(this.context.getNode(), `The operation "${operation}" is not supported for resource "employee".`, { itemIndex: this.itemIndex });
30
+ }
31
+ sendSuccess(response);
32
+ }
33
+ catch (error) {
34
+ this.handleError(error, returnData);
35
+ }
36
+ }
37
+ async handleGetAll(authContext) {
38
+ const top = this.getNumberParameter("top", 100);
39
+ const skip = this.getNumberParameter("skip", 0);
40
+ const select = this.getOptionalString("select");
41
+ const filter = this.getOptionalString("filter");
42
+ return await (0, datevConnectClient_1.fetchEmployees)({
43
+ ...authContext,
44
+ top,
45
+ skip,
46
+ select,
47
+ filter,
48
+ });
49
+ }
50
+ async handleGet(authContext) {
51
+ const employeeId = this.getRequiredString("employeeId");
52
+ const select = this.getOptionalString("select");
53
+ return await (0, datevConnectClient_1.fetchEmployee)({
54
+ ...authContext,
55
+ employeeId,
56
+ select,
57
+ });
58
+ }
59
+ async handleCreate(authContext) {
60
+ const rawEmployee = this.context.getNodeParameter("employeeData", this.itemIndex);
61
+ const employeePayload = this.parseJsonParameter(rawEmployee, "Employee Data");
62
+ return await (0, datevConnectClient_1.createEmployee)({
63
+ ...authContext,
64
+ employee: employeePayload,
65
+ });
66
+ }
67
+ async handleUpdate(authContext) {
68
+ const employeeId = this.getRequiredString("employeeId");
69
+ const rawEmployee = this.context.getNodeParameter("employeeData", this.itemIndex);
70
+ const employeePayload = this.parseJsonParameter(rawEmployee, "Employee Data");
71
+ return await (0, datevConnectClient_1.updateEmployee)({
72
+ ...authContext,
73
+ employeeId,
74
+ employee: employeePayload,
75
+ });
76
+ }
77
+ }
78
+ exports.EmployeeResourceHandler = EmployeeResourceHandler;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LegalFormResourceHandler = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const datevConnectClient_1 = require("../../../src/services/datevConnectClient");
6
+ const BaseResourceHandler_1 = require("./BaseResourceHandler");
7
+ /**
8
+ * Handler for all legal form-related operations
9
+ */
10
+ class LegalFormResourceHandler extends BaseResourceHandler_1.BaseResourceHandler {
11
+ async execute(operation, authContext, returnData) {
12
+ const sendSuccess = this.createSendSuccess(returnData);
13
+ try {
14
+ let response;
15
+ switch (operation) {
16
+ case "getAll":
17
+ response = await this.handleGetAll(authContext);
18
+ break;
19
+ default:
20
+ throw new n8n_workflow_1.NodeOperationError(this.context.getNode(), `The operation "${operation}" is not supported for resource "legalForm".`, { itemIndex: this.itemIndex });
21
+ }
22
+ sendSuccess(response);
23
+ }
24
+ catch (error) {
25
+ this.handleError(error, returnData);
26
+ }
27
+ }
28
+ async handleGetAll(authContext) {
29
+ const top = this.getNumberParameter("top", 100);
30
+ const skip = this.getNumberParameter("skip", 0);
31
+ const select = this.getOptionalString("select");
32
+ const nationalRight = this.getOptionalString("nationalRight");
33
+ return await (0, datevConnectClient_1.fetchLegalForms)({
34
+ ...authContext,
35
+ top,
36
+ skip,
37
+ select,
38
+ nationalRight,
39
+ });
40
+ }
41
+ }
42
+ exports.LegalFormResourceHandler = LegalFormResourceHandler;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RelationshipResourceHandler = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const datevConnectClient_1 = require("../../../src/services/datevConnectClient");
6
+ const BaseResourceHandler_1 = require("./BaseResourceHandler");
7
+ /**
8
+ * Handler for all relationship-related operations
9
+ */
10
+ class RelationshipResourceHandler extends BaseResourceHandler_1.BaseResourceHandler {
11
+ async execute(operation, authContext, returnData) {
12
+ const sendSuccess = this.createSendSuccess(returnData);
13
+ try {
14
+ let response;
15
+ switch (operation) {
16
+ case "getAll":
17
+ response = await this.handleGetAll(authContext);
18
+ break;
19
+ case "getTypes":
20
+ response = await this.handleGetTypes(authContext);
21
+ break;
22
+ default:
23
+ throw new n8n_workflow_1.NodeOperationError(this.context.getNode(), `The operation "${operation}" is not supported for resource "relationship".`, { itemIndex: this.itemIndex });
24
+ }
25
+ sendSuccess(response);
26
+ }
27
+ catch (error) {
28
+ this.handleError(error, returnData);
29
+ }
30
+ }
31
+ async handleGetAll(authContext) {
32
+ const top = this.getNumberParameter("top", 100);
33
+ const skip = this.getNumberParameter("skip", 0);
34
+ const select = this.getOptionalString("select");
35
+ const filter = this.getOptionalString("filter");
36
+ return await (0, datevConnectClient_1.fetchRelationships)({
37
+ ...authContext,
38
+ top,
39
+ skip,
40
+ select,
41
+ filter,
42
+ });
43
+ }
44
+ async handleGetTypes(authContext) {
45
+ const select = this.getOptionalString("select");
46
+ const filter = this.getOptionalString("filter");
47
+ return await (0, datevConnectClient_1.fetchRelationshipTypes)({
48
+ ...authContext,
49
+ select,
50
+ filter,
51
+ });
52
+ }
53
+ }
54
+ exports.RelationshipResourceHandler = RelationshipResourceHandler;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TaxAuthorityResourceHandler = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const datevConnectClient_1 = require("../../../src/services/datevConnectClient");
6
+ const BaseResourceHandler_1 = require("./BaseResourceHandler");
7
+ /**
8
+ * Handler for all tax authority-related operations
9
+ */
10
+ class TaxAuthorityResourceHandler extends BaseResourceHandler_1.BaseResourceHandler {
11
+ async execute(operation, authContext, returnData) {
12
+ const sendSuccess = this.createSendSuccess(returnData);
13
+ try {
14
+ let response;
15
+ switch (operation) {
16
+ case "getAll":
17
+ response = await this.handleGetAll(authContext);
18
+ break;
19
+ default:
20
+ throw new n8n_workflow_1.NodeOperationError(this.context.getNode(), `The operation "${operation}" is not supported for resource "taxAuthority".`, { itemIndex: this.itemIndex });
21
+ }
22
+ sendSuccess(response);
23
+ }
24
+ catch (error) {
25
+ this.handleError(error, returnData);
26
+ }
27
+ }
28
+ async handleGetAll(authContext) {
29
+ const top = this.getNumberParameter("top", 100);
30
+ const skip = this.getNumberParameter("skip", 0);
31
+ const select = this.getOptionalString("select");
32
+ const filter = this.getOptionalString("filter");
33
+ return await (0, datevConnectClient_1.fetchTaxAuthorities)({
34
+ ...authContext,
35
+ top,
36
+ skip,
37
+ select,
38
+ filter,
39
+ });
40
+ }
41
+ }
42
+ exports.TaxAuthorityResourceHandler = TaxAuthorityResourceHandler;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toErrorObject = toErrorObject;
4
+ exports.toErrorMessage = toErrorMessage;
5
+ exports.normaliseToObjects = normaliseToObjects;
6
+ exports.parseJsonParameter = parseJsonParameter;
7
+ exports.getOptionalString = getOptionalString;
8
+ exports.getRequiredString = getRequiredString;
9
+ exports.getNumberParameter = getNumberParameter;
10
+ const n8n_workflow_1 = require("n8n-workflow");
11
+ /**
12
+ * Converts an unknown error to a JsonObject for n8n error handling
13
+ */
14
+ function toErrorObject(error) {
15
+ if (error && typeof error === "object") {
16
+ return error;
17
+ }
18
+ const message = error instanceof Error ? error.message : String(error !== null && error !== void 0 ? error : "Unknown error");
19
+ return { message };
20
+ }
21
+ /**
22
+ * Extracts a readable error message from an unknown error
23
+ */
24
+ function toErrorMessage(error) {
25
+ if (error instanceof Error) {
26
+ return error.message;
27
+ }
28
+ if (error === null || error === undefined) {
29
+ return "Unknown error";
30
+ }
31
+ return typeof error === "string" ? error : JSON.stringify(error);
32
+ }
33
+ /**
34
+ * Normalizes various data types to an array of IDataObject for n8n
35
+ */
36
+ function normaliseToObjects(data) {
37
+ if (Array.isArray(data)) {
38
+ return data.map((entry) => {
39
+ if (entry && typeof entry === "object") {
40
+ return entry;
41
+ }
42
+ return { value: entry !== null && entry !== void 0 ? entry : null };
43
+ });
44
+ }
45
+ if (data && typeof data === "object") {
46
+ return [data];
47
+ }
48
+ return [{ value: data !== null && data !== void 0 ? data : null }];
49
+ }
50
+ /**
51
+ * Safely parses a JSON parameter from node input
52
+ */
53
+ function parseJsonParameter(rawValue, parameterLabel, context, itemIndex) {
54
+ if (rawValue === null || rawValue === undefined) {
55
+ throw new n8n_workflow_1.NodeOperationError(context.getNode(), `Parameter "${parameterLabel}" must be provided.`, { itemIndex });
56
+ }
57
+ if (typeof rawValue === "string") {
58
+ try {
59
+ return JSON.parse(rawValue);
60
+ }
61
+ catch (error) {
62
+ throw new n8n_workflow_1.NodeOperationError(context.getNode(), `Parameter "${parameterLabel}" contains invalid JSON: ${toErrorMessage(error)}`, { itemIndex });
63
+ }
64
+ }
65
+ return rawValue;
66
+ }
67
+ /**
68
+ * Gets an optional string parameter, returning undefined if empty
69
+ */
70
+ function getOptionalString(context, name, itemIndex) {
71
+ const value = context.getNodeParameter(name, itemIndex, "");
72
+ if (typeof value !== "string" || value.trim().length === 0) {
73
+ return undefined;
74
+ }
75
+ return value;
76
+ }
77
+ /**
78
+ * Gets a required string parameter
79
+ */
80
+ function getRequiredString(context, name, itemIndex) {
81
+ const value = context.getNodeParameter(name, itemIndex);
82
+ if (typeof value !== "string" || value.trim().length === 0) {
83
+ throw new n8n_workflow_1.NodeOperationError(context.getNode(), `Parameter "${name}" is required.`, { itemIndex });
84
+ }
85
+ return value;
86
+ }
87
+ /**
88
+ * Gets a number parameter with optional default
89
+ */
90
+ function getNumberParameter(context, name, itemIndex, defaultValue) {
91
+ return context.getNodeParameter(name, itemIndex, defaultValue);
92
+ }