@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,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BaseResourceHandler = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const utils_1 = require("../utils");
6
+ class BaseResourceHandler {
7
+ constructor(context, itemIndex) {
8
+ this.context = context;
9
+ this.itemIndex = itemIndex;
10
+ }
11
+ async execute(operation, authContext, returnData) {
12
+ try {
13
+ const sendSuccess = (payload) => {
14
+ const data = payload ? (0, utils_1.normaliseToObjects)(payload) : [{}];
15
+ data.forEach((item) => {
16
+ returnData.push({
17
+ json: {
18
+ success: true,
19
+ ...item,
20
+ },
21
+ pairedItem: { item: this.itemIndex },
22
+ });
23
+ });
24
+ };
25
+ await this.executeOperation(operation, authContext, sendSuccess);
26
+ }
27
+ catch (error) {
28
+ if (this.context.continueOnFail()) {
29
+ returnData.push({
30
+ json: {
31
+ error: (0, utils_1.toErrorMessage)(error),
32
+ },
33
+ pairedItem: { item: this.itemIndex },
34
+ });
35
+ return;
36
+ }
37
+ if (error instanceof n8n_workflow_1.NodeApiError || error instanceof n8n_workflow_1.NodeOperationError) {
38
+ throw error;
39
+ }
40
+ throw new n8n_workflow_1.NodeApiError(this.context.getNode(), (0, utils_1.toErrorObject)(error), {
41
+ itemIndex: this.itemIndex,
42
+ });
43
+ }
44
+ }
45
+ async getCredentials() {
46
+ const credentials = (await this.context.getCredentials("datevConnectApi"));
47
+ if (!credentials) {
48
+ throw new n8n_workflow_1.NodeOperationError(this.context.getNode(), "DATEVconnect credentials are missing");
49
+ }
50
+ const { host, email, password, clientInstanceId } = credentials;
51
+ if (!host || !email || !password || !clientInstanceId) {
52
+ throw new n8n_workflow_1.NodeOperationError(this.context.getNode(), "All DATEVconnect credential fields must be provided");
53
+ }
54
+ return credentials;
55
+ }
56
+ createAuthContext(credentials, token) {
57
+ return {
58
+ host: credentials.host,
59
+ token,
60
+ clientInstanceId: credentials.clientInstanceId,
61
+ };
62
+ }
63
+ getOptionalString(name) {
64
+ return (0, utils_1.getOptionalString)(this.context, name, this.itemIndex);
65
+ }
66
+ getRequiredString(name) {
67
+ return (0, utils_1.getRequiredString)(this.context, name, this.itemIndex);
68
+ }
69
+ getNumberParameter(name, defaultValue) {
70
+ return (0, utils_1.getNumberParameter)(this.context, name, this.itemIndex, defaultValue);
71
+ }
72
+ parseJsonParameter(rawValue, parameterLabel) {
73
+ return (0, utils_1.parseJsonParameter)(rawValue, parameterLabel, this.context, this.itemIndex);
74
+ }
75
+ getRequiredJsonData(name) {
76
+ return (0, utils_1.getRequiredJsonData)(this.context, name, this.itemIndex);
77
+ }
78
+ buildQueryParams(params) {
79
+ return (0, utils_1.buildQueryParams)(params);
80
+ }
81
+ validateRequestContext(authContext) {
82
+ if (!authContext.host || !authContext.token || !authContext.clientInstanceId) {
83
+ throw new n8n_workflow_1.NodeOperationError(this.context.getNode(), "Authentication context is incomplete");
84
+ }
85
+ }
86
+ }
87
+ exports.BaseResourceHandler = BaseResourceHandler;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CurrentUserResourceHandler = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const identityAndAccessManagementClient_1 = require("../../../src/services/identityAndAccessManagementClient");
6
+ const BaseResourceHandler_1 = require("./BaseResourceHandler");
7
+ class CurrentUserResourceHandler extends BaseResourceHandler_1.BaseResourceHandler {
8
+ async executeOperation(operation, authContext, sendSuccess) {
9
+ this.validateRequestContext(authContext);
10
+ if (operation !== "get") {
11
+ throw new n8n_workflow_1.NodeOperationError(this.context.getNode(), `The operation "${operation}" is not supported for currentUser.`, { itemIndex: this.itemIndex });
12
+ }
13
+ const response = await identityAndAccessManagementClient_1.IdentityAndAccessManagementClient.fetchCurrentUser(authContext);
14
+ sendSuccess(response);
15
+ }
16
+ }
17
+ exports.CurrentUserResourceHandler = CurrentUserResourceHandler;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GroupResourceHandler = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const identityAndAccessManagementClient_1 = require("../../../src/services/identityAndAccessManagementClient");
6
+ const BaseResourceHandler_1 = require("./BaseResourceHandler");
7
+ class GroupResourceHandler extends BaseResourceHandler_1.BaseResourceHandler {
8
+ async executeOperation(operation, authContext, sendSuccess) {
9
+ this.validateRequestContext(authContext);
10
+ switch (operation) {
11
+ case "getAll": {
12
+ const response = await identityAndAccessManagementClient_1.IdentityAndAccessManagementClient.fetchGroups(authContext);
13
+ sendSuccess(response);
14
+ return;
15
+ }
16
+ case "get": {
17
+ const groupId = this.getRequiredString("groupId");
18
+ const response = await identityAndAccessManagementClient_1.IdentityAndAccessManagementClient.fetchGroup({
19
+ ...authContext,
20
+ groupId,
21
+ });
22
+ sendSuccess(response);
23
+ return;
24
+ }
25
+ case "create": {
26
+ const groupData = this.getRequiredJsonData("groupData");
27
+ const response = await identityAndAccessManagementClient_1.IdentityAndAccessManagementClient.createGroup({
28
+ ...authContext,
29
+ group: groupData,
30
+ });
31
+ sendSuccess(response);
32
+ return;
33
+ }
34
+ case "update": {
35
+ const groupId = this.getRequiredString("groupId");
36
+ const groupData = this.getRequiredJsonData("groupData");
37
+ const response = await identityAndAccessManagementClient_1.IdentityAndAccessManagementClient.updateGroup({
38
+ ...authContext,
39
+ groupId,
40
+ group: groupData,
41
+ });
42
+ sendSuccess(response);
43
+ return;
44
+ }
45
+ case "delete": {
46
+ const groupId = this.getRequiredString("groupId");
47
+ const result = await identityAndAccessManagementClient_1.IdentityAndAccessManagementClient.deleteGroup({
48
+ ...authContext,
49
+ groupId,
50
+ });
51
+ sendSuccess({
52
+ groupId,
53
+ deleted: true,
54
+ ...(result.location ? { location: result.location } : {}),
55
+ });
56
+ return;
57
+ }
58
+ default:
59
+ throw new n8n_workflow_1.NodeOperationError(this.context.getNode(), `The operation "${operation}" is not supported for group.`, { itemIndex: this.itemIndex });
60
+ }
61
+ }
62
+ }
63
+ exports.GroupResourceHandler = GroupResourceHandler;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResourceTypeResourceHandler = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const identityAndAccessManagementClient_1 = require("../../../src/services/identityAndAccessManagementClient");
6
+ const BaseResourceHandler_1 = require("./BaseResourceHandler");
7
+ class ResourceTypeResourceHandler extends BaseResourceHandler_1.BaseResourceHandler {
8
+ async executeOperation(operation, authContext, sendSuccess) {
9
+ this.validateRequestContext(authContext);
10
+ if (operation !== "getAll") {
11
+ throw new n8n_workflow_1.NodeOperationError(this.context.getNode(), `The operation "${operation}" is not supported for resourceType.`, { itemIndex: this.itemIndex });
12
+ }
13
+ const response = await identityAndAccessManagementClient_1.IdentityAndAccessManagementClient.fetchResourceTypes(authContext);
14
+ sendSuccess(response);
15
+ }
16
+ }
17
+ exports.ResourceTypeResourceHandler = ResourceTypeResourceHandler;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SchemaResourceHandler = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const identityAndAccessManagementClient_1 = require("../../../src/services/identityAndAccessManagementClient");
6
+ const BaseResourceHandler_1 = require("./BaseResourceHandler");
7
+ class SchemaResourceHandler extends BaseResourceHandler_1.BaseResourceHandler {
8
+ async executeOperation(operation, authContext, sendSuccess) {
9
+ this.validateRequestContext(authContext);
10
+ switch (operation) {
11
+ case "getAll": {
12
+ const response = await identityAndAccessManagementClient_1.IdentityAndAccessManagementClient.fetchSchemas(authContext);
13
+ sendSuccess(response);
14
+ return;
15
+ }
16
+ case "get": {
17
+ const schemaId = this.getRequiredString("schemaId");
18
+ const response = await identityAndAccessManagementClient_1.IdentityAndAccessManagementClient.fetchSchema({
19
+ ...authContext,
20
+ schemaId,
21
+ });
22
+ sendSuccess(response);
23
+ return;
24
+ }
25
+ default:
26
+ throw new n8n_workflow_1.NodeOperationError(this.context.getNode(), `The operation "${operation}" is not supported for schema.`, { itemIndex: this.itemIndex });
27
+ }
28
+ }
29
+ }
30
+ exports.SchemaResourceHandler = SchemaResourceHandler;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ServiceProviderConfigResourceHandler = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const identityAndAccessManagementClient_1 = require("../../../src/services/identityAndAccessManagementClient");
6
+ const BaseResourceHandler_1 = require("./BaseResourceHandler");
7
+ class ServiceProviderConfigResourceHandler extends BaseResourceHandler_1.BaseResourceHandler {
8
+ async executeOperation(operation, authContext, sendSuccess) {
9
+ this.validateRequestContext(authContext);
10
+ if (operation !== "get") {
11
+ throw new n8n_workflow_1.NodeOperationError(this.context.getNode(), `The operation "${operation}" is not supported for serviceProviderConfig.`, { itemIndex: this.itemIndex });
12
+ }
13
+ const response = await identityAndAccessManagementClient_1.IdentityAndAccessManagementClient.fetchServiceProviderConfig(authContext);
14
+ sendSuccess(response);
15
+ }
16
+ }
17
+ exports.ServiceProviderConfigResourceHandler = ServiceProviderConfigResourceHandler;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserResourceHandler = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const identityAndAccessManagementClient_1 = require("../../../src/services/identityAndAccessManagementClient");
6
+ const BaseResourceHandler_1 = require("./BaseResourceHandler");
7
+ class UserResourceHandler extends BaseResourceHandler_1.BaseResourceHandler {
8
+ async executeOperation(operation, authContext, sendSuccess) {
9
+ this.validateRequestContext(authContext);
10
+ switch (operation) {
11
+ case "getAll": {
12
+ const filter = this.getOptionalString("filter");
13
+ const attributes = this.getOptionalString("attributes");
14
+ const startIndex = this.getNumberParameter("startIndex", 1);
15
+ const count = this.getNumberParameter("count", 100);
16
+ const response = await identityAndAccessManagementClient_1.IdentityAndAccessManagementClient.fetchUsers({
17
+ ...authContext,
18
+ filter,
19
+ attributes,
20
+ startIndex,
21
+ count,
22
+ });
23
+ sendSuccess(response);
24
+ return;
25
+ }
26
+ case "get": {
27
+ const userId = this.getRequiredString("userId");
28
+ const response = await identityAndAccessManagementClient_1.IdentityAndAccessManagementClient.fetchUser({
29
+ ...authContext,
30
+ userId,
31
+ });
32
+ sendSuccess(response);
33
+ return;
34
+ }
35
+ case "create": {
36
+ const userData = this.getRequiredJsonData("userData");
37
+ const response = await identityAndAccessManagementClient_1.IdentityAndAccessManagementClient.createUser({
38
+ ...authContext,
39
+ user: userData,
40
+ });
41
+ sendSuccess(response);
42
+ return;
43
+ }
44
+ case "update": {
45
+ const userId = this.getRequiredString("userId");
46
+ const userData = this.getRequiredJsonData("userData");
47
+ const response = await identityAndAccessManagementClient_1.IdentityAndAccessManagementClient.updateUser({
48
+ ...authContext,
49
+ userId,
50
+ user: userData,
51
+ });
52
+ sendSuccess(response);
53
+ return;
54
+ }
55
+ case "delete": {
56
+ const userId = this.getRequiredString("userId");
57
+ const result = await identityAndAccessManagementClient_1.IdentityAndAccessManagementClient.deleteUser({
58
+ ...authContext,
59
+ userId,
60
+ });
61
+ sendSuccess({
62
+ userId,
63
+ deleted: true,
64
+ ...(result.location ? { location: result.location } : {}),
65
+ });
66
+ return;
67
+ }
68
+ default:
69
+ throw new n8n_workflow_1.NodeOperationError(this.context.getNode(), `The operation "${operation}" is not supported for user.`, { itemIndex: this.itemIndex });
70
+ }
71
+ }
72
+ }
73
+ exports.UserResourceHandler = UserResourceHandler;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,89 @@
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
+ exports.buildQueryParams = buildQueryParams;
11
+ exports.getRequiredJsonData = getRequiredJsonData;
12
+ const n8n_workflow_1 = require("n8n-workflow");
13
+ function toErrorObject(error) {
14
+ if (error instanceof Error) {
15
+ return { message: error.message };
16
+ }
17
+ if (typeof error === "string") {
18
+ return { message: error };
19
+ }
20
+ if (error && typeof error === "object" && "message" in error) {
21
+ return { message: String(error.message) };
22
+ }
23
+ return { message: "An unknown error occurred" };
24
+ }
25
+ function toErrorMessage(error) {
26
+ return toErrorObject(error).message;
27
+ }
28
+ function normaliseToObjects(data) {
29
+ if (data === null || data === undefined) {
30
+ return [];
31
+ }
32
+ if (Array.isArray(data)) {
33
+ return data.map((item) => {
34
+ if (item === null || item === undefined) {
35
+ return {};
36
+ }
37
+ if (typeof item === "object") {
38
+ return item;
39
+ }
40
+ return { value: item };
41
+ });
42
+ }
43
+ if (typeof data === "object") {
44
+ return [data];
45
+ }
46
+ return [{ value: data }];
47
+ }
48
+ function parseJsonParameter(value, parameterName, context, itemIndex) {
49
+ if (typeof value === "string") {
50
+ try {
51
+ return JSON.parse(value);
52
+ }
53
+ catch (error) {
54
+ throw new n8n_workflow_1.NodeOperationError(context.getNode(), `Invalid JSON in parameter '${parameterName}': ${toErrorMessage(error)}`, { itemIndex });
55
+ }
56
+ }
57
+ return value;
58
+ }
59
+ function getOptionalString(context, parameterName, itemIndex) {
60
+ const value = context.getNodeParameter(parameterName, itemIndex, "");
61
+ return value.trim() || undefined;
62
+ }
63
+ function getRequiredString(context, parameterName, itemIndex) {
64
+ const value = getOptionalString(context, parameterName, itemIndex);
65
+ if (!value) {
66
+ throw new Error(`Parameter '${parameterName}' is required`);
67
+ }
68
+ return value;
69
+ }
70
+ function getNumberParameter(context, parameterName, itemIndex, defaultValue) {
71
+ const value = context.getNodeParameter(parameterName, itemIndex, defaultValue);
72
+ return value;
73
+ }
74
+ function buildQueryParams(params) {
75
+ const query = {};
76
+ for (const [key, value] of Object.entries(params)) {
77
+ if (value !== undefined && value !== null && value !== "") {
78
+ query[key] = String(value);
79
+ }
80
+ }
81
+ return query;
82
+ }
83
+ function getRequiredJsonData(context, parameterName, itemIndex) {
84
+ const rawValue = context.getNodeParameter(parameterName, itemIndex);
85
+ if (!rawValue) {
86
+ throw new n8n_workflow_1.NodeOperationError(context.getNode(), `Parameter '${parameterName}' is required`, { itemIndex });
87
+ }
88
+ return parseJsonParameter(rawValue, parameterName, context, itemIndex);
89
+ }