@klardaten/n8n-nodes-datevconnect 1.0.5 → 1.0.7

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 (80) hide show
  1. package/README.md +2 -0
  2. package/dist/index.d.ts +3 -0
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +156 -0
  5. package/dist/nodes/Accounting/Accounting.node.d.ts.map +1 -1
  6. package/dist/nodes/Accounting/Accounting.node.js +7 -1
  7. package/dist/nodes/Accounting/types.d.ts +2 -0
  8. package/dist/nodes/Accounting/types.d.ts.map +1 -1
  9. package/dist/nodes/DocumentManagement/DocumentManagement.node.d.ts.map +1 -1
  10. package/dist/nodes/DocumentManagement/DocumentManagement.node.js +7 -1
  11. package/dist/nodes/DocumentManagement/types.d.ts +2 -1
  12. package/dist/nodes/DocumentManagement/types.d.ts.map +1 -1
  13. package/dist/nodes/IdentityAndAccessManagement/IdentityAndAccessManagement.node.d.ts.map +1 -1
  14. package/dist/nodes/IdentityAndAccessManagement/IdentityAndAccessManagement.node.js +7 -1
  15. package/dist/nodes/IdentityAndAccessManagement/types.d.ts +2 -1
  16. package/dist/nodes/IdentityAndAccessManagement/types.d.ts.map +1 -1
  17. package/dist/nodes/MasterData/MasterData.node.d.ts.map +1 -1
  18. package/dist/nodes/MasterData/MasterData.node.js +7 -1
  19. package/dist/nodes/MasterData/types.d.ts +2 -1
  20. package/dist/nodes/MasterData/types.d.ts.map +1 -1
  21. package/dist/nodes/OrderManagement/OrderManagement.config.d.ts +3 -0
  22. package/dist/nodes/OrderManagement/OrderManagement.config.d.ts.map +1 -0
  23. package/dist/nodes/OrderManagement/OrderManagement.config.js +644 -0
  24. package/dist/nodes/OrderManagement/OrderManagement.node.d.ts +6 -0
  25. package/dist/nodes/OrderManagement/OrderManagement.node.d.ts.map +1 -0
  26. package/dist/nodes/OrderManagement/OrderManagement.node.js +92 -0
  27. package/dist/nodes/OrderManagement/handlers/BaseResourceHandler.d.ts +17 -0
  28. package/dist/nodes/OrderManagement/handlers/BaseResourceHandler.d.ts.map +1 -0
  29. package/dist/nodes/OrderManagement/handlers/BaseResourceHandler.js +48 -0
  30. package/dist/nodes/OrderManagement/handlers/ClientGroupResourceHandler.d.ts +8 -0
  31. package/dist/nodes/OrderManagement/handlers/ClientGroupResourceHandler.d.ts.map +1 -0
  32. package/dist/nodes/OrderManagement/handlers/ClientGroupResourceHandler.js +32 -0
  33. package/dist/nodes/OrderManagement/handlers/CostCenterResourceHandler.d.ts +8 -0
  34. package/dist/nodes/OrderManagement/handlers/CostCenterResourceHandler.d.ts.map +1 -0
  35. package/dist/nodes/OrderManagement/handlers/CostCenterResourceHandler.js +38 -0
  36. package/dist/nodes/OrderManagement/handlers/EmployeeResourceHandler.d.ts +12 -0
  37. package/dist/nodes/OrderManagement/handlers/EmployeeResourceHandler.d.ts.map +1 -0
  38. package/dist/nodes/OrderManagement/handlers/EmployeeResourceHandler.js +106 -0
  39. package/dist/nodes/OrderManagement/handlers/FeeResourceHandler.d.ts +9 -0
  40. package/dist/nodes/OrderManagement/handlers/FeeResourceHandler.d.ts.map +1 -0
  41. package/dist/nodes/OrderManagement/handlers/FeeResourceHandler.js +55 -0
  42. package/dist/nodes/OrderManagement/handlers/InvoiceResourceHandler.d.ts +9 -0
  43. package/dist/nodes/OrderManagement/handlers/InvoiceResourceHandler.d.ts.map +1 -0
  44. package/dist/nodes/OrderManagement/handlers/InvoiceResourceHandler.js +49 -0
  45. package/dist/nodes/OrderManagement/handlers/OrderResourceHandler.d.ts +24 -0
  46. package/dist/nodes/OrderManagement/handlers/OrderResourceHandler.d.ts.map +1 -0
  47. package/dist/nodes/OrderManagement/handlers/OrderResourceHandler.js +285 -0
  48. package/dist/nodes/OrderManagement/handlers/OrderTypeResourceHandler.d.ts +8 -0
  49. package/dist/nodes/OrderManagement/handlers/OrderTypeResourceHandler.d.ts.map +1 -0
  50. package/dist/nodes/OrderManagement/handlers/OrderTypeResourceHandler.js +34 -0
  51. package/dist/nodes/OrderManagement/handlers/SelfClientResourceHandler.d.ts +8 -0
  52. package/dist/nodes/OrderManagement/handlers/SelfClientResourceHandler.d.ts.map +1 -0
  53. package/dist/nodes/OrderManagement/handlers/SelfClientResourceHandler.js +36 -0
  54. package/dist/nodes/OrderManagement/types.d.ts +28 -0
  55. package/dist/nodes/OrderManagement/types.d.ts.map +1 -0
  56. package/dist/nodes/OrderManagement/types.js +2 -0
  57. package/dist/nodes/OrderManagement/utils.d.ts +14 -0
  58. package/dist/nodes/OrderManagement/utils.d.ts.map +1 -0
  59. package/dist/nodes/OrderManagement/utils.js +79 -0
  60. package/dist/src/services/accountingClient.d.ts.map +1 -1
  61. package/dist/src/services/accountingClient.js +2 -0
  62. package/dist/src/services/datevConnectClient.d.ts +3 -22
  63. package/dist/src/services/datevConnectClient.d.ts.map +1 -1
  64. package/dist/src/services/datevConnectClient.js +96 -180
  65. package/dist/src/services/documentManagementClient.d.ts +3 -1
  66. package/dist/src/services/documentManagementClient.d.ts.map +1 -1
  67. package/dist/src/services/documentManagementClient.js +28 -27
  68. package/dist/src/services/httpHelpers.d.ts +10 -0
  69. package/dist/src/services/httpHelpers.d.ts.map +1 -0
  70. package/dist/src/services/httpHelpers.js +180 -0
  71. package/dist/src/services/identityAndAccessManagementClient.d.ts +2 -1
  72. package/dist/src/services/identityAndAccessManagementClient.d.ts.map +1 -1
  73. package/dist/src/services/identityAndAccessManagementClient.js +4 -1
  74. package/dist/src/services/orderManagementClient.d.ts +189 -0
  75. package/dist/src/services/orderManagementClient.d.ts.map +1 -0
  76. package/dist/src/services/orderManagementClient.js +459 -0
  77. package/dist/src/services/shared.d.ts +39 -0
  78. package/dist/src/services/shared.d.ts.map +1 -0
  79. package/dist/src/services/shared.js +110 -0
  80. package/package.json +6 -5
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.authenticate = authenticate;
3
+ exports.authenticate = void 0;
4
4
  exports.fetchClients = fetchClients;
5
5
  exports.fetchClient = fetchClient;
6
6
  exports.createClient = createClient;
@@ -105,91 +105,10 @@ exports.fetchAccountingTransactionKey = fetchAccountingTransactionKey;
105
105
  exports.fetchVariousAddresses = fetchVariousAddresses;
106
106
  exports.fetchVariousAddress = fetchVariousAddress;
107
107
  exports.createVariousAddress = createVariousAddress;
108
- const JSON_CONTENT_TYPE = "application/json";
109
- const DEFAULT_ERROR_PREFIX = "DATEVconnect request failed";
110
- function normaliseBaseUrl(host) {
111
- if (!host) {
112
- throw new Error("DATEVconnect host must be provided");
113
- }
114
- return host.endsWith("/") ? host : `${host}/`;
115
- }
116
- function buildHeaders(headers) {
117
- return Object.entries(headers).reduce((acc, [key, value]) => {
118
- if (value) {
119
- acc[key] = value;
120
- }
121
- return acc;
122
- }, {});
123
- }
124
- async function readResponseBody(response) {
125
- var _a;
126
- const contentType = (_a = response.headers.get("content-type")) !== null && _a !== void 0 ? _a : "";
127
- if (contentType.toLowerCase().includes(JSON_CONTENT_TYPE)) {
128
- try {
129
- return (await response.json());
130
- }
131
- catch {
132
- return undefined;
133
- }
134
- }
135
- try {
136
- const text = await response.text();
137
- return text.length > 0 ? text : undefined;
138
- }
139
- catch {
140
- return undefined;
141
- }
142
- }
143
- function extractErrorMessage(response, body) {
144
- const statusPart = `${response.status}${response.statusText ? ` ${response.statusText}` : ""}`.trim();
145
- const prefix = `${DEFAULT_ERROR_PREFIX}${statusPart ? ` (${statusPart})` : ""}`;
146
- if (typeof body === "string" && body.trim().length > 0) {
147
- return `${prefix}: ${body.trim()}`;
148
- }
149
- if (body && typeof body === "object") {
150
- const errorDescription = "error_description" in body && typeof body.error_description === "string"
151
- ? body.error_description
152
- : undefined;
153
- const message = ("message" in body && typeof body.message === "string"
154
- ? body.message
155
- : undefined) ||
156
- ("error" in body && typeof body.error === "string" ? body.error : undefined);
157
- if (message) {
158
- return `${prefix}: ${message}${errorDescription ? `: ${errorDescription}` : ""}`;
159
- }
160
- }
161
- return prefix;
162
- }
163
- async function ensureSuccess(response) {
164
- const body = await readResponseBody(response);
165
- if (!response.ok) {
166
- throw new Error(extractErrorMessage(response, body));
167
- }
168
- if (body && typeof body === "object") {
169
- return body;
170
- }
171
- if (body === undefined) {
172
- return undefined;
173
- }
174
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected JSON response body.`);
175
- }
176
- async function authenticate(options) {
177
- const { host, email, password, fetchImpl = fetch } = options;
178
- const baseUrl = normaliseBaseUrl(host);
179
- const url = new URL("api/auth/login", baseUrl);
180
- const response = await fetchImpl(url, {
181
- method: "POST",
182
- headers: buildHeaders({
183
- "content-type": JSON_CONTENT_TYPE,
184
- }),
185
- body: JSON.stringify({ email, password }),
186
- });
187
- const body = await ensureSuccess(response);
188
- if (!body || typeof body !== "object" || !("access_token" in body) || typeof body.access_token !== "string") {
189
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Authentication response missing access_token.`);
190
- }
191
- return body;
192
- }
108
+ const httpHelpers_1 = require("./httpHelpers");
109
+ const shared_1 = require("./shared");
110
+ var shared_2 = require("./shared");
111
+ Object.defineProperty(exports, "authenticate", { enumerable: true, get: function () { return shared_2.authenticate; } });
193
112
  const MASTER_DATA_BASE_PATH = "datevconnect/master-data/v1";
194
113
  const CLIENTS_PATH = `${MASTER_DATA_BASE_PATH}/clients`;
195
114
  const TAX_AUTHORITIES_PATH = `${MASTER_DATA_BASE_PATH}/tax-authorities`;
@@ -205,14 +124,9 @@ const BANKS_PATH = `${MASTER_DATA_BASE_PATH}/banks`;
205
124
  const AREA_OF_RESPONSIBILITIES_PATH = `${MASTER_DATA_BASE_PATH}/area-of-responsibilities`;
206
125
  const ADDRESSEES_PATH = `${MASTER_DATA_BASE_PATH}/addressees`;
207
126
  const ADDRESSEES_DELETION_LOG_PATH = `${ADDRESSEES_PATH}/deletion-log`;
208
- function buildApiUrl(host, path) {
209
- const baseUrl = normaliseBaseUrl(host);
210
- const trimmedPath = path.startsWith("/") ? path.slice(1) : path;
211
- return new URL(trimmedPath, baseUrl);
212
- }
213
127
  async function sendMasterDataRequest(options) {
214
- const { host, token, clientInstanceId, path, method, query, body, fetchImpl = fetch } = options;
215
- const url = buildApiUrl(host, path);
128
+ const { host, token, clientInstanceId, path, method, query, body, httpHelper, fetchImpl: providedFetchImpl } = options;
129
+ const url = (0, shared_1.buildApiUrl)(host, path);
216
130
  if (query) {
217
131
  for (const [key, value] of Object.entries(query)) {
218
132
  if (value === undefined || value === null) {
@@ -221,17 +135,18 @@ async function sendMasterDataRequest(options) {
221
135
  url.searchParams.set(key, String(value));
222
136
  }
223
137
  }
138
+ const fetchImpl = httpHelper ? (0, httpHelpers_1.createFetchFromHttpHelper)(httpHelper) : (providedFetchImpl || fetch);
224
139
  const response = await fetchImpl(url, {
225
140
  method,
226
- headers: buildHeaders({
227
- accept: JSON_CONTENT_TYPE,
141
+ headers: (0, shared_1.buildHeaders)({
142
+ accept: shared_1.JSON_CONTENT_TYPE,
228
143
  authorization: `Bearer ${token}`,
229
- "content-type": JSON_CONTENT_TYPE,
144
+ "content-type": shared_1.JSON_CONTENT_TYPE,
230
145
  "x-client-instance-id": clientInstanceId,
231
146
  }),
232
147
  body: body === undefined ? undefined : JSON.stringify(body),
233
148
  });
234
- return ensureSuccess(response);
149
+ return (0, shared_1.ensureSuccess)(response);
235
150
  }
236
151
  async function fetchClients(options) {
237
152
  const { top, skip, select, filter } = options;
@@ -247,7 +162,7 @@ async function fetchClients(options) {
247
162
  },
248
163
  });
249
164
  if (body === undefined) {
250
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected clients payload.`);
165
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected clients payload.`);
251
166
  }
252
167
  return body;
253
168
  }
@@ -262,7 +177,7 @@ async function fetchClient(options) {
262
177
  },
263
178
  });
264
179
  if (body === undefined) {
265
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected client payload.`);
180
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected client payload.`);
266
181
  }
267
182
  return body;
268
183
  }
@@ -298,7 +213,7 @@ async function fetchClientResponsibilities(options) {
298
213
  },
299
214
  });
300
215
  if (body === undefined) {
301
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected responsibilities payload.`);
216
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected responsibilities payload.`);
302
217
  }
303
218
  return body;
304
219
  }
@@ -322,7 +237,7 @@ async function fetchClientCategories(options) {
322
237
  },
323
238
  });
324
239
  if (body === undefined) {
325
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected client categories payload.`);
240
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected client categories payload.`);
326
241
  }
327
242
  return body;
328
243
  }
@@ -346,7 +261,7 @@ async function fetchClientGroups(options) {
346
261
  },
347
262
  });
348
263
  if (body === undefined) {
349
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected client groups payload.`);
264
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected client groups payload.`);
350
265
  }
351
266
  return body;
352
267
  }
@@ -373,7 +288,7 @@ async function fetchClientDeletionLog(options) {
373
288
  },
374
289
  });
375
290
  if (body === undefined) {
376
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected client deletion log payload.`);
291
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected client deletion log payload.`);
377
292
  }
378
293
  return body;
379
294
  }
@@ -389,7 +304,7 @@ async function fetchNextFreeClientNumber(options) {
389
304
  },
390
305
  });
391
306
  if (body === undefined) {
392
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected next free number payload.`);
307
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected next free number payload.`);
393
308
  }
394
309
  return body;
395
310
  }
@@ -407,7 +322,7 @@ async function fetchTaxAuthorities(options) {
407
322
  },
408
323
  });
409
324
  if (body === undefined) {
410
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected tax authorities payload.`);
325
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected tax authorities payload.`);
411
326
  }
412
327
  return body;
413
328
  }
@@ -425,7 +340,7 @@ async function fetchRelationships(options) {
425
340
  },
426
341
  });
427
342
  if (body === undefined) {
428
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected relationships payload.`);
343
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected relationships payload.`);
429
344
  }
430
345
  return body;
431
346
  }
@@ -441,7 +356,7 @@ async function fetchRelationshipTypes(options) {
441
356
  },
442
357
  });
443
358
  if (body === undefined) {
444
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected relationship types payload.`);
359
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected relationship types payload.`);
445
360
  }
446
361
  return body;
447
362
  }
@@ -459,7 +374,7 @@ async function fetchLegalForms(options) {
459
374
  },
460
375
  });
461
376
  if (body === undefined) {
462
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected legal forms payload.`);
377
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected legal forms payload.`);
463
378
  }
464
379
  return body;
465
380
  }
@@ -477,7 +392,7 @@ async function fetchCorporateStructures(options) {
477
392
  },
478
393
  });
479
394
  if (body === undefined) {
480
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected corporate structures payload.`);
395
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected corporate structures payload.`);
481
396
  }
482
397
  return body;
483
398
  }
@@ -492,7 +407,7 @@ async function fetchCorporateStructure(options) {
492
407
  },
493
408
  });
494
409
  if (body === undefined) {
495
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected corporate structure payload.`);
410
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected corporate structure payload.`);
496
411
  }
497
412
  return body;
498
413
  }
@@ -507,7 +422,7 @@ async function fetchEstablishment(options) {
507
422
  },
508
423
  });
509
424
  if (body === undefined) {
510
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected establishment payload.`);
425
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected establishment payload.`);
511
426
  }
512
427
  return body;
513
428
  }
@@ -525,7 +440,7 @@ async function fetchEmployees(options) {
525
440
  },
526
441
  });
527
442
  if (body === undefined) {
528
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected employees payload.`);
443
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected employees payload.`);
529
444
  }
530
445
  return body;
531
446
  }
@@ -540,7 +455,7 @@ async function fetchEmployee(options) {
540
455
  },
541
456
  });
542
457
  if (body === undefined) {
543
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected employee payload.`);
458
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected employee payload.`);
544
459
  }
545
460
  return body;
546
461
  }
@@ -576,7 +491,7 @@ async function fetchCountryCodes(options) {
576
491
  },
577
492
  });
578
493
  if (body === undefined) {
579
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected country codes payload.`);
494
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected country codes payload.`);
580
495
  }
581
496
  return body;
582
497
  }
@@ -594,7 +509,7 @@ async function fetchClientGroupTypes(options) {
594
509
  },
595
510
  });
596
511
  if (body === undefined) {
597
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected client group types payload.`);
512
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected client group types payload.`);
598
513
  }
599
514
  return body;
600
515
  }
@@ -609,7 +524,7 @@ async function fetchClientGroupType(options) {
609
524
  },
610
525
  });
611
526
  if (body === undefined) {
612
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected client group type payload.`);
527
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected client group type payload.`);
613
528
  }
614
529
  return body;
615
530
  }
@@ -647,7 +562,7 @@ async function fetchClientCategoryTypes(options) {
647
562
  },
648
563
  });
649
564
  if (body === undefined) {
650
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected client category types payload.`);
565
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected client category types payload.`);
651
566
  }
652
567
  return body;
653
568
  }
@@ -662,7 +577,7 @@ async function fetchClientCategoryType(options) {
662
577
  },
663
578
  });
664
579
  if (body === undefined) {
665
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected client category type payload.`);
580
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected client category type payload.`);
666
581
  }
667
582
  return body;
668
583
  }
@@ -700,7 +615,7 @@ async function fetchBanks(options) {
700
615
  },
701
616
  });
702
617
  if (body === undefined) {
703
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected banks payload.`);
618
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected banks payload.`);
704
619
  }
705
620
  return body;
706
621
  }
@@ -718,7 +633,7 @@ async function fetchAreaOfResponsibilities(options) {
718
633
  },
719
634
  });
720
635
  if (body === undefined) {
721
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected area of responsibilities payload.`);
636
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected area of responsibilities payload.`);
722
637
  }
723
638
  return body;
724
639
  }
@@ -736,7 +651,7 @@ async function fetchAddressees(options) {
736
651
  },
737
652
  });
738
653
  if (body === undefined) {
739
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected addressees payload.`);
654
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected addressees payload.`);
740
655
  }
741
656
  return body;
742
657
  }
@@ -752,7 +667,7 @@ async function fetchAddressee(options) {
752
667
  },
753
668
  });
754
669
  if (body === undefined) {
755
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected addressee payload.`);
670
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected addressee payload.`);
756
671
  }
757
672
  return body;
758
673
  }
@@ -793,14 +708,14 @@ async function fetchAddresseesDeletionLog(options) {
793
708
  },
794
709
  });
795
710
  if (body === undefined) {
796
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected addressees deletion log payload.`);
711
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected addressees deletion log payload.`);
797
712
  }
798
713
  return body;
799
714
  }
800
715
  const ACCOUNTING_BASE_PATH = "datevconnect/accounting/v1";
801
716
  async function sendAccountingRequest(options) {
802
- const { host, token, clientInstanceId, path, method, query, body, fetchImpl = fetch } = options;
803
- const url = buildApiUrl(host, path);
717
+ const { host, token, clientInstanceId, path, method, query, body, httpHelper, fetchImpl: providedFetchImpl } = options;
718
+ const url = (0, shared_1.buildApiUrl)(host, path);
804
719
  if (query) {
805
720
  for (const [key, value] of Object.entries(query)) {
806
721
  if (value === undefined || value === null) {
@@ -809,17 +724,18 @@ async function sendAccountingRequest(options) {
809
724
  url.searchParams.set(key, String(value));
810
725
  }
811
726
  }
727
+ const fetchImpl = httpHelper ? (0, httpHelpers_1.createFetchFromHttpHelper)(httpHelper) : (providedFetchImpl || fetch);
812
728
  const response = await fetchImpl(url, {
813
729
  method,
814
- headers: buildHeaders({
815
- accept: JSON_CONTENT_TYPE,
730
+ headers: (0, shared_1.buildHeaders)({
731
+ accept: shared_1.JSON_CONTENT_TYPE,
816
732
  authorization: `Bearer ${token}`,
817
- "content-type": JSON_CONTENT_TYPE,
733
+ "content-type": shared_1.JSON_CONTENT_TYPE,
818
734
  "x-client-instance-id": clientInstanceId,
819
735
  }),
820
736
  body: body === undefined ? undefined : JSON.stringify(body),
821
737
  });
822
- return ensureSuccess(response);
738
+ return (0, shared_1.ensureSuccess)(response);
823
739
  }
824
740
  async function fetchAccountingClients(options) {
825
741
  const { select, filter, top, skip, expand } = options;
@@ -836,7 +752,7 @@ async function fetchAccountingClients(options) {
836
752
  },
837
753
  });
838
754
  if (body === undefined) {
839
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected accounting clients payload.`);
755
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected accounting clients payload.`);
840
756
  }
841
757
  return body;
842
758
  }
@@ -852,7 +768,7 @@ async function fetchAccountingClient(options) {
852
768
  },
853
769
  });
854
770
  if (body === undefined) {
855
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected accounting client payload.`);
771
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected accounting client payload.`);
856
772
  }
857
773
  return body;
858
774
  }
@@ -870,7 +786,7 @@ async function fetchFiscalYears(options) {
870
786
  },
871
787
  });
872
788
  if (body === undefined) {
873
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected fiscal years payload.`);
789
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected fiscal years payload.`);
874
790
  }
875
791
  return body;
876
792
  }
@@ -885,7 +801,7 @@ async function fetchFiscalYear(options) {
885
801
  },
886
802
  });
887
803
  if (body === undefined) {
888
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected fiscal year payload.`);
804
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected fiscal year payload.`);
889
805
  }
890
806
  return body;
891
807
  }
@@ -904,7 +820,7 @@ async function fetchAccountsReceivable(options) {
904
820
  },
905
821
  });
906
822
  if (body === undefined) {
907
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected accounts receivable payload.`);
823
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected accounts receivable payload.`);
908
824
  }
909
825
  return body;
910
826
  }
@@ -922,7 +838,7 @@ async function fetchAccountsReceivableCondensed(options) {
922
838
  },
923
839
  });
924
840
  if (body === undefined) {
925
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected condensed accounts receivable payload.`);
841
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected condensed accounts receivable payload.`);
926
842
  }
927
843
  return body;
928
844
  }
@@ -938,7 +854,7 @@ async function fetchAccountReceivable(options) {
938
854
  },
939
855
  });
940
856
  if (body === undefined) {
941
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected account receivable payload.`);
857
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected account receivable payload.`);
942
858
  }
943
859
  return body;
944
860
  }
@@ -957,7 +873,7 @@ async function fetchAccountsPayable(options) {
957
873
  },
958
874
  });
959
875
  if (body === undefined) {
960
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected accounts payable payload.`);
876
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected accounts payable payload.`);
961
877
  }
962
878
  return body;
963
879
  }
@@ -975,7 +891,7 @@ async function fetchAccountsPayableCondensed(options) {
975
891
  },
976
892
  });
977
893
  if (body === undefined) {
978
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected condensed accounts payable payload.`);
894
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected condensed accounts payable payload.`);
979
895
  }
980
896
  return body;
981
897
  }
@@ -991,7 +907,7 @@ async function fetchAccountPayable(options) {
991
907
  },
992
908
  });
993
909
  if (body === undefined) {
994
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected account payable payload.`);
910
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected account payable payload.`);
995
911
  }
996
912
  return body;
997
913
  }
@@ -1009,7 +925,7 @@ async function fetchAccountPostings(options) {
1009
925
  },
1010
926
  });
1011
927
  if (body === undefined) {
1012
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected account postings payload.`);
928
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected account postings payload.`);
1013
929
  }
1014
930
  return body;
1015
931
  }
@@ -1024,7 +940,7 @@ async function fetchAccountPosting(options) {
1024
940
  },
1025
941
  });
1026
942
  if (body === undefined) {
1027
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected account posting payload.`);
943
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected account posting payload.`);
1028
944
  }
1029
945
  return body;
1030
946
  }
@@ -1041,7 +957,7 @@ async function fetchAccountingSequences(options) {
1041
957
  },
1042
958
  });
1043
959
  if (body === undefined) {
1044
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected accounting sequences payload.`);
960
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected accounting sequences payload.`);
1045
961
  }
1046
962
  return body;
1047
963
  }
@@ -1056,7 +972,7 @@ async function fetchAccountingSequence(options) {
1056
972
  },
1057
973
  });
1058
974
  if (body === undefined) {
1059
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected accounting sequence payload.`);
975
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected accounting sequence payload.`);
1060
976
  }
1061
977
  return body;
1062
978
  }
@@ -1083,7 +999,7 @@ async function fetchAccountingRecords(options) {
1083
999
  },
1084
1000
  });
1085
1001
  if (body === undefined) {
1086
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected accounting records payload.`);
1002
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected accounting records payload.`);
1087
1003
  }
1088
1004
  return body;
1089
1005
  }
@@ -1098,7 +1014,7 @@ async function fetchAccountingRecord(options) {
1098
1014
  },
1099
1015
  });
1100
1016
  if (body === undefined) {
1101
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected accounting record payload.`);
1017
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected accounting record payload.`);
1102
1018
  }
1103
1019
  return body;
1104
1020
  }
@@ -1115,7 +1031,7 @@ async function fetchPostingProposalRulesIncoming(options) {
1115
1031
  },
1116
1032
  });
1117
1033
  if (body === undefined) {
1118
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected posting proposal rules incoming payload.`);
1034
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected posting proposal rules incoming payload.`);
1119
1035
  }
1120
1036
  return body;
1121
1037
  }
@@ -1132,7 +1048,7 @@ async function fetchPostingProposalRulesOutgoing(options) {
1132
1048
  },
1133
1049
  });
1134
1050
  if (body === undefined) {
1135
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected posting proposal rules outgoing payload.`);
1051
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected posting proposal rules outgoing payload.`);
1136
1052
  }
1137
1053
  return body;
1138
1054
  }
@@ -1149,7 +1065,7 @@ async function fetchPostingProposalRulesCashRegister(options) {
1149
1065
  },
1150
1066
  });
1151
1067
  if (body === undefined) {
1152
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected posting proposal rules cash register payload.`);
1068
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected posting proposal rules cash register payload.`);
1153
1069
  }
1154
1070
  return body;
1155
1071
  }
@@ -1164,7 +1080,7 @@ async function fetchPostingProposalRuleIncoming(options) {
1164
1080
  },
1165
1081
  });
1166
1082
  if (body === undefined) {
1167
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected posting proposal rule incoming payload.`);
1083
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected posting proposal rule incoming payload.`);
1168
1084
  }
1169
1085
  return body;
1170
1086
  }
@@ -1179,7 +1095,7 @@ async function fetchPostingProposalRuleOutgoing(options) {
1179
1095
  },
1180
1096
  });
1181
1097
  if (body === undefined) {
1182
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected posting proposal rule outgoing payload.`);
1098
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected posting proposal rule outgoing payload.`);
1183
1099
  }
1184
1100
  return body;
1185
1101
  }
@@ -1194,7 +1110,7 @@ async function fetchPostingProposalRuleCashRegister(options) {
1194
1110
  },
1195
1111
  });
1196
1112
  if (body === undefined) {
1197
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected posting proposal rule cash register payload.`);
1113
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected posting proposal rule cash register payload.`);
1198
1114
  }
1199
1115
  return body;
1200
1116
  }
@@ -1239,7 +1155,7 @@ async function fetchAccountingSumsAndBalances(options) {
1239
1155
  },
1240
1156
  });
1241
1157
  if (body === undefined) {
1242
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected accounting sums and balances payload.`);
1158
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected accounting sums and balances payload.`);
1243
1159
  }
1244
1160
  return body;
1245
1161
  }
@@ -1251,7 +1167,7 @@ async function fetchAccountingSumsAndBalance(options) {
1251
1167
  method: "GET",
1252
1168
  });
1253
1169
  if (body === undefined) {
1254
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected accounting sums and balance payload.`);
1170
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected accounting sums and balance payload.`);
1255
1171
  }
1256
1172
  return body;
1257
1173
  }
@@ -1270,7 +1186,7 @@ async function fetchDebitors(options) {
1270
1186
  },
1271
1187
  });
1272
1188
  if (body === undefined) {
1273
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected debitors payload.`);
1189
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected debitors payload.`);
1274
1190
  }
1275
1191
  return body;
1276
1192
  }
@@ -1286,7 +1202,7 @@ async function fetchDebitor(options) {
1286
1202
  },
1287
1203
  });
1288
1204
  if (body === undefined) {
1289
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected debitor payload.`);
1205
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected debitor payload.`);
1290
1206
  }
1291
1207
  return body;
1292
1208
  }
@@ -1319,7 +1235,7 @@ async function fetchNextAvailableDebitor(options) {
1319
1235
  },
1320
1236
  });
1321
1237
  if (body === undefined) {
1322
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected next available debitor payload.`);
1238
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected next available debitor payload.`);
1323
1239
  }
1324
1240
  return body;
1325
1241
  }
@@ -1338,7 +1254,7 @@ async function fetchCreditors(options) {
1338
1254
  },
1339
1255
  });
1340
1256
  if (body === undefined) {
1341
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected creditors payload.`);
1257
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected creditors payload.`);
1342
1258
  }
1343
1259
  return body;
1344
1260
  }
@@ -1354,7 +1270,7 @@ async function fetchCreditor(options) {
1354
1270
  },
1355
1271
  });
1356
1272
  if (body === undefined) {
1357
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected creditor payload.`);
1273
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected creditor payload.`);
1358
1274
  }
1359
1275
  return body;
1360
1276
  }
@@ -1387,7 +1303,7 @@ async function fetchNextAvailableCreditor(options) {
1387
1303
  },
1388
1304
  });
1389
1305
  if (body === undefined) {
1390
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected next available creditor payload.`);
1306
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected next available creditor payload.`);
1391
1307
  }
1392
1308
  return body;
1393
1309
  }
@@ -1405,7 +1321,7 @@ async function fetchGeneralLedgerAccounts(options) {
1405
1321
  },
1406
1322
  });
1407
1323
  if (body === undefined) {
1408
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected general ledger accounts payload.`);
1324
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected general ledger accounts payload.`);
1409
1325
  }
1410
1326
  return body;
1411
1327
  }
@@ -1420,7 +1336,7 @@ async function fetchGeneralLedgerAccount(options) {
1420
1336
  },
1421
1337
  });
1422
1338
  if (body === undefined) {
1423
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected general ledger account payload.`);
1339
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected general ledger account payload.`);
1424
1340
  }
1425
1341
  return body;
1426
1342
  }
@@ -1437,7 +1353,7 @@ async function fetchUtilizedGeneralLedgerAccounts(options) {
1437
1353
  },
1438
1354
  });
1439
1355
  if (body === undefined) {
1440
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected utilized general ledger accounts payload.`);
1356
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected utilized general ledger accounts payload.`);
1441
1357
  }
1442
1358
  return body;
1443
1359
  }
@@ -1456,7 +1372,7 @@ async function fetchTermsOfPayment(options) {
1456
1372
  },
1457
1373
  });
1458
1374
  if (body === undefined) {
1459
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected terms of payment payload.`);
1375
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected terms of payment payload.`);
1460
1376
  }
1461
1377
  return body;
1462
1378
  }
@@ -1471,7 +1387,7 @@ async function fetchTermOfPayment(options) {
1471
1387
  },
1472
1388
  });
1473
1389
  if (body === undefined) {
1474
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected term of payment payload.`);
1390
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected term of payment payload.`);
1475
1391
  }
1476
1392
  return body;
1477
1393
  }
@@ -1508,7 +1424,7 @@ async function fetchStocktakingData(options) {
1508
1424
  },
1509
1425
  });
1510
1426
  if (body === undefined) {
1511
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected stocktaking data payload.`);
1427
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected stocktaking data payload.`);
1512
1428
  }
1513
1429
  return body;
1514
1430
  }
@@ -1525,7 +1441,7 @@ async function fetchStocktakingDataByAsset(options) {
1525
1441
  },
1526
1442
  });
1527
1443
  if (body === undefined) {
1528
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected stocktaking data by asset payload.`);
1444
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected stocktaking data by asset payload.`);
1529
1445
  }
1530
1446
  return body;
1531
1447
  }
@@ -1552,7 +1468,7 @@ async function fetchCostSystems(options) {
1552
1468
  },
1553
1469
  });
1554
1470
  if (body === undefined) {
1555
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected cost systems payload.`);
1471
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected cost systems payload.`);
1556
1472
  }
1557
1473
  return body;
1558
1474
  }
@@ -1567,7 +1483,7 @@ async function fetchCostSystem(options) {
1567
1483
  },
1568
1484
  });
1569
1485
  if (body === undefined) {
1570
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected cost system payload.`);
1486
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected cost system payload.`);
1571
1487
  }
1572
1488
  return body;
1573
1489
  }
@@ -1585,7 +1501,7 @@ async function fetchCostCenters(options) {
1585
1501
  },
1586
1502
  });
1587
1503
  if (body === undefined) {
1588
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected cost centers payload.`);
1504
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected cost centers payload.`);
1589
1505
  }
1590
1506
  return body;
1591
1507
  }
@@ -1600,7 +1516,7 @@ async function fetchCostCenter(options) {
1600
1516
  },
1601
1517
  });
1602
1518
  if (body === undefined) {
1603
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected cost center payload.`);
1519
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected cost center payload.`);
1604
1520
  }
1605
1521
  return body;
1606
1522
  }
@@ -1618,7 +1534,7 @@ async function fetchCostCenterProperties(options) {
1618
1534
  },
1619
1535
  });
1620
1536
  if (body === undefined) {
1621
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected cost center properties payload.`);
1537
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected cost center properties payload.`);
1622
1538
  }
1623
1539
  return body;
1624
1540
  }
@@ -1633,7 +1549,7 @@ async function fetchCostCenterProperty(options) {
1633
1549
  },
1634
1550
  });
1635
1551
  if (body === undefined) {
1636
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected cost center property payload.`);
1552
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected cost center property payload.`);
1637
1553
  }
1638
1554
  return body;
1639
1555
  }
@@ -1661,7 +1577,7 @@ async function fetchCostSequences(options) {
1661
1577
  },
1662
1578
  });
1663
1579
  if (body === undefined) {
1664
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected cost sequences payload.`);
1580
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected cost sequences payload.`);
1665
1581
  }
1666
1582
  return body;
1667
1583
  }
@@ -1676,7 +1592,7 @@ async function fetchCostSequence(options) {
1676
1592
  },
1677
1593
  });
1678
1594
  if (body === undefined) {
1679
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected cost sequence payload.`);
1595
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected cost sequence payload.`);
1680
1596
  }
1681
1597
  return body;
1682
1598
  }
@@ -1702,7 +1618,7 @@ async function fetchCostAccountingRecords(options) {
1702
1618
  },
1703
1619
  });
1704
1620
  if (body === undefined) {
1705
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected cost accounting records payload.`);
1621
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected cost accounting records payload.`);
1706
1622
  }
1707
1623
  return body;
1708
1624
  }
@@ -1721,7 +1637,7 @@ async function fetchAccountingStatistics(options) {
1721
1637
  },
1722
1638
  });
1723
1639
  if (body === undefined) {
1724
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected accounting statistics payload.`);
1640
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected accounting statistics payload.`);
1725
1641
  }
1726
1642
  return body;
1727
1643
  }
@@ -1739,7 +1655,7 @@ async function fetchAccountingTransactionKeys(options) {
1739
1655
  },
1740
1656
  });
1741
1657
  if (body === undefined) {
1742
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected accounting transaction keys payload.`);
1658
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected accounting transaction keys payload.`);
1743
1659
  }
1744
1660
  return body;
1745
1661
  }
@@ -1757,7 +1673,7 @@ async function fetchAccountingTransactionKey(options) {
1757
1673
  },
1758
1674
  });
1759
1675
  if (body === undefined) {
1760
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected accounting transaction key payload.`);
1676
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected accounting transaction key payload.`);
1761
1677
  }
1762
1678
  return body;
1763
1679
  }
@@ -1776,7 +1692,7 @@ async function fetchVariousAddresses(options) {
1776
1692
  },
1777
1693
  });
1778
1694
  if (body === undefined) {
1779
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected various addresses payload.`);
1695
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected various addresses payload.`);
1780
1696
  }
1781
1697
  return body;
1782
1698
  }
@@ -1794,7 +1710,7 @@ async function fetchVariousAddress(options) {
1794
1710
  },
1795
1711
  });
1796
1712
  if (body === undefined) {
1797
- throw new Error(`${DEFAULT_ERROR_PREFIX}: Expected various address payload.`);
1713
+ throw new Error(`${shared_1.DEFAULT_ERROR_PREFIX}: Expected various address payload.`);
1798
1714
  }
1799
1715
  return body;
1800
1716
  }