@agnocon/piece-bexio 0.1.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 (182) hide show
  1. package/LICENSE.MIT-AP +24 -0
  2. package/dist/index.d.ts +2 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +93 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/lib/actions/create-company.d.ts +28 -0
  7. package/dist/lib/actions/create-company.d.ts.map +1 -0
  8. package/dist/lib/actions/create-company.js +461 -0
  9. package/dist/lib/actions/create-company.js.map +1 -0
  10. package/dist/lib/actions/create-file.d.ts +4 -0
  11. package/dist/lib/actions/create-file.d.ts.map +1 -0
  12. package/dist/lib/actions/create-file.js +48 -0
  13. package/dist/lib/actions/create-file.js.map +1 -0
  14. package/dist/lib/actions/create-manual-entry.d.ts +7 -0
  15. package/dist/lib/actions/create-manual-entry.d.ts.map +1 -0
  16. package/dist/lib/actions/create-manual-entry.js +426 -0
  17. package/dist/lib/actions/create-manual-entry.js.map +1 -0
  18. package/dist/lib/actions/create-person.d.ts +30 -0
  19. package/dist/lib/actions/create-person.d.ts.map +1 -0
  20. package/dist/lib/actions/create-person.js +477 -0
  21. package/dist/lib/actions/create-person.js.map +1 -0
  22. package/dist/lib/actions/create-product.d.ts +34 -0
  23. package/dist/lib/actions/create-product.d.ts.map +1 -0
  24. package/dist/lib/actions/create-product.js +527 -0
  25. package/dist/lib/actions/create-product.js.map +1 -0
  26. package/dist/lib/actions/create-project.d.ts +17 -0
  27. package/dist/lib/actions/create-project.d.ts.map +1 -0
  28. package/dist/lib/actions/create-project.js +316 -0
  29. package/dist/lib/actions/create-project.js.map +1 -0
  30. package/dist/lib/actions/create-sales-invoice.d.ts +25 -0
  31. package/dist/lib/actions/create-sales-invoice.d.ts.map +1 -0
  32. package/dist/lib/actions/create-sales-invoice.js +615 -0
  33. package/dist/lib/actions/create-sales-invoice.js.map +1 -0
  34. package/dist/lib/actions/create-sales-order.d.ts +25 -0
  35. package/dist/lib/actions/create-sales-order.d.ts.map +1 -0
  36. package/dist/lib/actions/create-sales-order.js +642 -0
  37. package/dist/lib/actions/create-sales-order.js.map +1 -0
  38. package/dist/lib/actions/create-sales-quote.d.ts +28 -0
  39. package/dist/lib/actions/create-sales-quote.d.ts.map +1 -0
  40. package/dist/lib/actions/create-sales-quote.js +666 -0
  41. package/dist/lib/actions/create-sales-quote.js.map +1 -0
  42. package/dist/lib/actions/create-time-tracking.d.ts +17 -0
  43. package/dist/lib/actions/create-time-tracking.d.ts.map +1 -0
  44. package/dist/lib/actions/create-time-tracking.js +380 -0
  45. package/dist/lib/actions/create-time-tracking.js.map +1 -0
  46. package/dist/lib/actions/export-invoice-pdf.d.ts +5 -0
  47. package/dist/lib/actions/export-invoice-pdf.d.ts.map +1 -0
  48. package/dist/lib/actions/export-invoice-pdf.js +94 -0
  49. package/dist/lib/actions/export-invoice-pdf.js.map +1 -0
  50. package/dist/lib/actions/find-account.d.ts +6 -0
  51. package/dist/lib/actions/find-account.d.ts.map +1 -0
  52. package/dist/lib/actions/find-account.js +107 -0
  53. package/dist/lib/actions/find-account.js.map +1 -0
  54. package/dist/lib/actions/find-company.d.ts +8 -0
  55. package/dist/lib/actions/find-company.d.ts.map +1 -0
  56. package/dist/lib/actions/find-company.js +160 -0
  57. package/dist/lib/actions/find-company.js.map +1 -0
  58. package/dist/lib/actions/find-country.d.ts +7 -0
  59. package/dist/lib/actions/find-country.d.ts.map +1 -0
  60. package/dist/lib/actions/find-country.js +125 -0
  61. package/dist/lib/actions/find-country.js.map +1 -0
  62. package/dist/lib/actions/find-person.d.ts +9 -0
  63. package/dist/lib/actions/find-person.d.ts.map +1 -0
  64. package/dist/lib/actions/find-person.js +175 -0
  65. package/dist/lib/actions/find-person.js.map +1 -0
  66. package/dist/lib/actions/find-product.d.ts +7 -0
  67. package/dist/lib/actions/find-product.d.ts.map +1 -0
  68. package/dist/lib/actions/find-product.js +124 -0
  69. package/dist/lib/actions/find-product.js.map +1 -0
  70. package/dist/lib/actions/search-invoice.d.ts +7 -0
  71. package/dist/lib/actions/search-invoice.d.ts.map +1 -0
  72. package/dist/lib/actions/search-invoice.js +140 -0
  73. package/dist/lib/actions/search-invoice.js.map +1 -0
  74. package/dist/lib/actions/search-order.d.ts +7 -0
  75. package/dist/lib/actions/search-order.d.ts.map +1 -0
  76. package/dist/lib/actions/search-order.js +139 -0
  77. package/dist/lib/actions/search-order.js.map +1 -0
  78. package/dist/lib/actions/search-quote.d.ts +7 -0
  79. package/dist/lib/actions/search-quote.d.ts.map +1 -0
  80. package/dist/lib/actions/search-quote.js +140 -0
  81. package/dist/lib/actions/search-quote.js.map +1 -0
  82. package/dist/lib/actions/send-sales-invoice.d.ts +9 -0
  83. package/dist/lib/actions/send-sales-invoice.d.ts.map +1 -0
  84. package/dist/lib/actions/send-sales-invoice.js +110 -0
  85. package/dist/lib/actions/send-sales-invoice.js.map +1 -0
  86. package/dist/lib/actions/update-company.d.ts +29 -0
  87. package/dist/lib/actions/update-company.d.ts.map +1 -0
  88. package/dist/lib/actions/update-company.js +506 -0
  89. package/dist/lib/actions/update-company.js.map +1 -0
  90. package/dist/lib/actions/update-person.d.ts +31 -0
  91. package/dist/lib/actions/update-person.d.ts.map +1 -0
  92. package/dist/lib/actions/update-person.js +524 -0
  93. package/dist/lib/actions/update-person.js.map +1 -0
  94. package/dist/lib/actions/update-product.d.ts +34 -0
  95. package/dist/lib/actions/update-product.d.ts.map +1 -0
  96. package/dist/lib/actions/update-product.js +556 -0
  97. package/dist/lib/actions/update-product.js.map +1 -0
  98. package/dist/lib/auth.d.ts +2 -0
  99. package/dist/lib/auth.d.ts.map +1 -0
  100. package/dist/lib/auth.js +51 -0
  101. package/dist/lib/auth.js.map +1 -0
  102. package/dist/lib/common/client.d.ts +13 -0
  103. package/dist/lib/common/client.d.ts.map +1 -0
  104. package/dist/lib/common/client.js +64 -0
  105. package/dist/lib/common/client.js.map +1 -0
  106. package/dist/lib/common/index.d.ts +5 -0
  107. package/dist/lib/common/index.d.ts.map +1 -0
  108. package/dist/lib/common/index.js +10 -0
  109. package/dist/lib/common/index.js.map +1 -0
  110. package/dist/lib/common/props.d.ts +14 -0
  111. package/dist/lib/common/props.d.ts.map +1 -0
  112. package/dist/lib/common/props.js +118 -0
  113. package/dist/lib/common/props.js.map +1 -0
  114. package/dist/lib/common/types.d.ts +89 -0
  115. package/dist/lib/common/types.d.ts.map +1 -0
  116. package/dist/lib/common/types.js +6 -0
  117. package/dist/lib/common/types.js.map +1 -0
  118. package/dist/lib/triggers/new-order.d.ts +11 -0
  119. package/dist/lib/triggers/new-order.d.ts.map +1 -0
  120. package/dist/lib/triggers/new-order.js +152 -0
  121. package/dist/lib/triggers/new-order.js.map +1 -0
  122. package/dist/lib/triggers/new-product.d.ts +3 -0
  123. package/dist/lib/triggers/new-product.d.ts.map +1 -0
  124. package/dist/lib/triggers/new-product.js +111 -0
  125. package/dist/lib/triggers/new-product.js.map +1 -0
  126. package/dist/lib/triggers/new-project.d.ts +11 -0
  127. package/dist/lib/triggers/new-project.d.ts.map +1 -0
  128. package/dist/lib/triggers/new-project.js +141 -0
  129. package/dist/lib/triggers/new-project.js.map +1 -0
  130. package/dist/lib/triggers/new-quote.d.ts +11 -0
  131. package/dist/lib/triggers/new-quote.d.ts.map +1 -0
  132. package/dist/lib/triggers/new-quote.js +153 -0
  133. package/dist/lib/triggers/new-quote.js.map +1 -0
  134. package/dist/lib/triggers/new-sales-invoice.d.ts +11 -0
  135. package/dist/lib/triggers/new-sales-invoice.d.ts.map +1 -0
  136. package/dist/lib/triggers/new-sales-invoice.js +153 -0
  137. package/dist/lib/triggers/new-sales-invoice.js.map +1 -0
  138. package/dist/lib/triggers/new-updated-company.d.ts +3 -0
  139. package/dist/lib/triggers/new-updated-company.d.ts.map +1 -0
  140. package/dist/lib/triggers/new-updated-company.js +122 -0
  141. package/dist/lib/triggers/new-updated-company.js.map +1 -0
  142. package/dist/lib/triggers/new-updated-person.d.ts +3 -0
  143. package/dist/lib/triggers/new-updated-person.d.ts.map +1 -0
  144. package/dist/lib/triggers/new-updated-person.js +122 -0
  145. package/dist/lib/triggers/new-updated-person.js.map +1 -0
  146. package/package.json +48 -0
  147. package/src/index.ts +89 -0
  148. package/src/lib/actions/create-company.ts +464 -0
  149. package/src/lib/actions/create-file.ts +62 -0
  150. package/src/lib/actions/create-manual-entry.ts +445 -0
  151. package/src/lib/actions/create-person.ts +481 -0
  152. package/src/lib/actions/create-product.ts +563 -0
  153. package/src/lib/actions/create-project.ts +344 -0
  154. package/src/lib/actions/create-sales-invoice.ts +656 -0
  155. package/src/lib/actions/create-sales-order.ts +689 -0
  156. package/src/lib/actions/create-sales-quote.ts +713 -0
  157. package/src/lib/actions/create-time-tracking.ts +418 -0
  158. package/src/lib/actions/export-invoice-pdf.ts +104 -0
  159. package/src/lib/actions/find-account.ts +114 -0
  160. package/src/lib/actions/find-company.ts +193 -0
  161. package/src/lib/actions/find-country.ts +127 -0
  162. package/src/lib/actions/find-person.ts +208 -0
  163. package/src/lib/actions/find-product.ts +161 -0
  164. package/src/lib/actions/search-invoice.ts +157 -0
  165. package/src/lib/actions/search-order.ts +155 -0
  166. package/src/lib/actions/search-quote.ts +157 -0
  167. package/src/lib/actions/send-sales-invoice.ts +118 -0
  168. package/src/lib/actions/update-company.ts +518 -0
  169. package/src/lib/actions/update-person.ts +536 -0
  170. package/src/lib/actions/update-product.ts +594 -0
  171. package/src/lib/auth.ts +44 -0
  172. package/src/lib/common/client.ts +65 -0
  173. package/src/lib/common/index.ts +5 -0
  174. package/src/lib/common/props.ts +127 -0
  175. package/src/lib/common/types.ts +99 -0
  176. package/src/lib/triggers/new-order.ts +184 -0
  177. package/src/lib/triggers/new-product.ts +154 -0
  178. package/src/lib/triggers/new-project.ts +165 -0
  179. package/src/lib/triggers/new-quote.ts +186 -0
  180. package/src/lib/triggers/new-sales-invoice.ts +186 -0
  181. package/src/lib/triggers/new-updated-company.ts +161 -0
  182. package/src/lib/triggers/new-updated-person.ts +161 -0
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createFileAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bexio/src/lib/actions/create-file.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
8
+ const auth_1 = require("../auth");
9
+ const pieces_common_1 = require("@agnocon/pieces-common");
10
+ const index_1 = require("../common/index");
11
+ const form_data_1 = tslib_1.__importDefault(require("form-data"));
12
+ exports.createFileAction = (0, pieces_framework_1.createAction)({
13
+ auth: auth_1.bexioAuth,
14
+ name: 'create_file',
15
+ displayName: 'Create File',
16
+ description: 'Upload a new file to Bexio',
17
+ audience: 'both',
18
+ aiMetadata: { description: 'Uploads a file to the Bexio file manager via multipart form data, returning the stored file metadata. Use to add a document or attachment to Bexio storage; requires the file contents. Not idempotent: each call stores another copy of the file.', idempotent: false },
19
+ props: {
20
+ file: pieces_framework_1.Property.File({
21
+ displayName: 'File',
22
+ description: 'The file to upload',
23
+ required: true,
24
+ }),
25
+ },
26
+ run(context) {
27
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
28
+ const file = context.propsValue['file'];
29
+ // Create FormData for multipart/form-data upload
30
+ const formData = new form_data_1.default();
31
+ // Use Buffer directly - form-data package handles it correctly
32
+ formData.append('file', file.data, file.filename);
33
+ // Use httpClient directly for multipart/form-data since BexioClient uses JSON
34
+ const response = yield pieces_common_1.httpClient.sendRequest({
35
+ url: `${index_1.bexioCommon.baseUrl}/3.0/files`,
36
+ method: pieces_common_1.HttpMethod.POST,
37
+ authentication: {
38
+ type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
39
+ token: context.auth.access_token,
40
+ },
41
+ headers: Object.assign({ Accept: 'application/json' }, formData.getHeaders()),
42
+ body: formData,
43
+ });
44
+ return response.body;
45
+ });
46
+ },
47
+ });
48
+ //# sourceMappingURL=create-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-file.js","sourceRoot":"","sources":["../../../src/lib/actions/create-file.ts"],"names":[],"mappings":";;;;AAAA,mGAAmG;AACnG,qEAAqE;AACrE,gEAAmE;AACnE,kCAAoC;AACpC,0DAAoF;AACpF,2CAA8C;AAC9C,kEAAiC;AAEpB,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,4BAA4B;IACzC,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,oPAAoP,EAAE,UAAU,EAAE,KAAK,EAAE;IACpS,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,IAAI,CAAC;YAClB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,oBAAoB;YACjC,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YAExC,iDAAiD;YACjD,MAAM,QAAQ,GAAG,IAAI,mBAAQ,EAAE,CAAC;YAChC,+DAA+D;YAC/D,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YAElD,8EAA8E;YAC9E,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAczC;gBACF,GAAG,EAAE,GAAG,mBAAW,CAAC,OAAO,YAAY;gBACvC,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;iBACjC;gBACD,OAAO,kBACL,MAAM,EAAE,kBAAkB,IAEvB,QAAQ,CAAC,UAAU,EAAE,CACzB;gBACD,IAAI,EAAE,QAAQ;aACf,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const createManualEntryAction: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>, {
2
+ type: import("@agnocon/pieces-framework").StaticDropdownProperty<string, true>;
3
+ date: import("@agnocon/pieces-framework").ShortTextProperty<true>;
4
+ reference_nr: import("@agnocon/pieces-framework").ShortTextProperty<false>;
5
+ entryFields: import("@agnocon/pieces-framework").DynamicProperties<true, import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>>;
6
+ }>;
7
+ //# sourceMappingURL=create-manual-entry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-manual-entry.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/create-manual-entry.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,uBAAuB;;;;;EAqblC,CAAC"}
@@ -0,0 +1,426 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createManualEntryAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bexio/src/lib/actions/create-manual-entry.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
8
+ const auth_1 = require("../auth");
9
+ const client_1 = require("../common/client");
10
+ exports.createManualEntryAction = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.bexioAuth,
12
+ name: 'create_manual_entry',
13
+ displayName: 'Create Manual Entry',
14
+ description: 'Create a manual accounting entry (single, compound, or group)',
15
+ audience: 'both',
16
+ aiMetadata: { description: 'Books a manual accounting entry in Bexio in one of three modes: a single debit/credit line, a compound entry distributing a total across several accounts, or a group of multiple complete bookings sharing one reference. Use to post journal entries directly to the ledger; requires a booking date and the entry lines for the chosen mode (account ids resolvable via Find Account). Not idempotent: each call posts new ledger bookings.', idempotent: false },
17
+ props: {
18
+ type: pieces_framework_1.Property.StaticDropdown({
19
+ displayName: 'Entry Type',
20
+ description: 'Choose the type of manual entry',
21
+ required: true,
22
+ defaultValue: 'manual_single_entry',
23
+ options: {
24
+ disabled: false,
25
+ options: [
26
+ {
27
+ label: 'Single Entry - Simple one-line booking',
28
+ value: 'manual_single_entry',
29
+ },
30
+ {
31
+ label: 'Compound Entry - Total distributed across multiple accounts',
32
+ value: 'manual_compound_entry',
33
+ },
34
+ {
35
+ label: 'Group Entry - Multiple separate bookings with same reference',
36
+ value: 'manual_group_entry',
37
+ },
38
+ ],
39
+ },
40
+ }),
41
+ date: pieces_framework_1.Property.ShortText({
42
+ displayName: 'Booking Date',
43
+ description: 'Date of the booking (YYYY-MM-DD)',
44
+ required: true,
45
+ }),
46
+ reference_nr: pieces_framework_1.Property.ShortText({
47
+ displayName: 'Reference Number',
48
+ description: 'Reference number for the booking',
49
+ required: false,
50
+ }),
51
+ entryFields: pieces_framework_1.Property.DynamicProperties({
52
+ auth: auth_1.bexioAuth,
53
+ displayName: 'Entry Details',
54
+ description: 'Configure the entry details based on selected type',
55
+ required: true,
56
+ refreshers: ['type', 'auth'],
57
+ props: (_a, ctx_1) => tslib_1.__awaiter(void 0, [_a, ctx_1], void 0, function* ({ type, auth }, ctx) {
58
+ const entryType = type || 'manual_single_entry';
59
+ let accounts = [];
60
+ let taxes = [];
61
+ let currencies = [];
62
+ if (auth) {
63
+ try {
64
+ const client = new client_1.BexioClient(auth);
65
+ accounts = yield client.get('/accounts');
66
+ taxes = yield client.get('/taxes');
67
+ currencies = yield client.get('/3.0/currencies');
68
+ }
69
+ catch (error) {
70
+ console.warn('Failed to fetch accounts/taxes/currencies:', error);
71
+ }
72
+ }
73
+ const accountOptions = accounts.map((acc) => ({
74
+ label: `${acc.account_no} - ${acc.name}`,
75
+ value: acc.id,
76
+ }));
77
+ const taxOptions = taxes.map((tax) => ({
78
+ label: `${tax.name} (${tax.percentage}%)`,
79
+ value: tax.id,
80
+ }));
81
+ const currencyOptions = currencies.map((curr) => ({
82
+ label: curr.name,
83
+ value: curr.id,
84
+ }));
85
+ if (entryType === 'manual_single_entry') {
86
+ return {
87
+ debit_account: accountOptions.length > 0
88
+ ? pieces_framework_1.Property.StaticDropdown({
89
+ displayName: 'Debit Account',
90
+ description: 'The account to debit',
91
+ required: true,
92
+ options: {
93
+ disabled: false,
94
+ options: accountOptions,
95
+ },
96
+ })
97
+ : pieces_framework_1.Property.Number({
98
+ displayName: 'Debit Account ID',
99
+ description: 'The account ID to debit',
100
+ required: true,
101
+ }),
102
+ credit_account: accountOptions.length > 0
103
+ ? pieces_framework_1.Property.StaticDropdown({
104
+ displayName: 'Credit Account',
105
+ description: 'The account to credit',
106
+ required: true,
107
+ options: {
108
+ disabled: false,
109
+ options: accountOptions,
110
+ },
111
+ })
112
+ : pieces_framework_1.Property.Number({
113
+ displayName: 'Credit Account ID',
114
+ description: 'The account ID to credit',
115
+ required: true,
116
+ }),
117
+ amount: pieces_framework_1.Property.Number({
118
+ displayName: 'Amount',
119
+ description: 'The transaction amount',
120
+ required: true,
121
+ }),
122
+ description: pieces_framework_1.Property.ShortText({
123
+ displayName: 'Description',
124
+ description: 'Description of the transaction',
125
+ required: false,
126
+ }),
127
+ tax_id: taxOptions.length > 0
128
+ ? pieces_framework_1.Property.StaticDropdown({
129
+ displayName: 'Tax',
130
+ description: 'Tax rate (optional)',
131
+ required: false,
132
+ options: {
133
+ disabled: false,
134
+ options: taxOptions,
135
+ },
136
+ })
137
+ : pieces_framework_1.Property.Number({
138
+ displayName: 'Tax ID',
139
+ description: 'Tax ID (optional)',
140
+ required: false,
141
+ }),
142
+ tax_account: accountOptions.length > 0
143
+ ? pieces_framework_1.Property.StaticDropdown({
144
+ displayName: 'Tax Account',
145
+ description: 'Account for tax calculation',
146
+ required: false,
147
+ options: {
148
+ disabled: false,
149
+ options: accountOptions,
150
+ },
151
+ })
152
+ : pieces_framework_1.Property.Number({
153
+ displayName: 'Tax Account ID',
154
+ description: 'Account ID for tax calculation',
155
+ required: false,
156
+ }),
157
+ currency_id: currencyOptions.length > 0
158
+ ? pieces_framework_1.Property.StaticDropdown({
159
+ displayName: 'Currency',
160
+ description: 'Currency (optional)',
161
+ required: false,
162
+ options: {
163
+ disabled: false,
164
+ options: currencyOptions,
165
+ },
166
+ })
167
+ : pieces_framework_1.Property.Number({
168
+ displayName: 'Currency ID',
169
+ description: 'Currency ID (optional)',
170
+ required: false,
171
+ }),
172
+ currency_factor: pieces_framework_1.Property.Number({
173
+ displayName: 'Currency Factor',
174
+ description: 'Exchange rate factor (defaults to 1)',
175
+ required: false,
176
+ }),
177
+ helper_info: pieces_framework_1.Property.MarkDown({
178
+ value: '',
179
+ }),
180
+ entries: pieces_framework_1.Property.Array({
181
+ displayName: 'Entries',
182
+ description: 'Not used for single entries',
183
+ required: false,
184
+ properties: {},
185
+ }),
186
+ };
187
+ }
188
+ else {
189
+ const isCompound = entryType === 'manual_compound_entry';
190
+ return {
191
+ debit_account: pieces_framework_1.Property.Number({
192
+ displayName: 'Debit Account',
193
+ description: 'Not used for compound/group entries',
194
+ required: false,
195
+ }),
196
+ credit_account: pieces_framework_1.Property.Number({
197
+ displayName: 'Credit Account',
198
+ description: 'Not used for compound/group entries',
199
+ required: false,
200
+ }),
201
+ amount: pieces_framework_1.Property.Number({
202
+ displayName: 'Amount',
203
+ description: 'Not used for compound/group entries',
204
+ required: false,
205
+ }),
206
+ description: pieces_framework_1.Property.ShortText({
207
+ displayName: 'Description',
208
+ description: 'Not used for compound/group entries',
209
+ required: false,
210
+ }),
211
+ tax_id: pieces_framework_1.Property.Number({
212
+ displayName: 'Tax ID',
213
+ description: 'Not used for compound/group entries',
214
+ required: false,
215
+ }),
216
+ tax_account: pieces_framework_1.Property.Number({
217
+ displayName: 'Tax Account',
218
+ description: 'Not used for compound/group entries',
219
+ required: false,
220
+ }),
221
+ currency_id: pieces_framework_1.Property.Number({
222
+ displayName: 'Currency ID',
223
+ description: 'Not used for compound/group entries',
224
+ required: false,
225
+ }),
226
+ currency_factor: pieces_framework_1.Property.Number({
227
+ displayName: 'Currency Factor',
228
+ description: 'Not used for compound/group entries',
229
+ required: false,
230
+ }),
231
+ helper_info: pieces_framework_1.Property.MarkDown({
232
+ value: isCompound
233
+ ? 'For compound entries, each entry should have EITHER debit_account_id OR credit_account_id (not both).'
234
+ : 'For group entries, each entry must have BOTH debit_account_id and credit_account_id.',
235
+ }),
236
+ entries: pieces_framework_1.Property.Array({
237
+ displayName: 'Entries',
238
+ description: isCompound
239
+ ? 'Multiple entries to distribute the total. Each entry should have either debit_account_id OR credit_account_id (not both).'
240
+ : 'Multiple complete bookings. Each entry must have both debit_account_id and credit_account_id.',
241
+ required: true,
242
+ properties: {
243
+ debit_account_id: accountOptions.length > 0
244
+ ? pieces_framework_1.Property.StaticDropdown({
245
+ displayName: 'Debit Account',
246
+ description: isCompound
247
+ ? 'Account to debit (leave empty if this is a credit entry)'
248
+ : 'Account to debit',
249
+ required: !isCompound,
250
+ options: {
251
+ disabled: false,
252
+ options: accountOptions,
253
+ },
254
+ })
255
+ : pieces_framework_1.Property.Number({
256
+ displayName: 'Debit Account ID',
257
+ description: isCompound
258
+ ? 'Account ID to debit (leave 0 if this is a credit entry)'
259
+ : 'Account ID to debit',
260
+ required: !isCompound,
261
+ }),
262
+ credit_account_id: accountOptions.length > 0
263
+ ? pieces_framework_1.Property.StaticDropdown({
264
+ displayName: 'Credit Account',
265
+ description: isCompound
266
+ ? 'Account to credit (leave empty if this is a debit entry)'
267
+ : 'Account to credit',
268
+ required: !isCompound,
269
+ options: {
270
+ disabled: false,
271
+ options: accountOptions,
272
+ },
273
+ })
274
+ : pieces_framework_1.Property.Number({
275
+ displayName: 'Credit Account ID',
276
+ description: isCompound
277
+ ? 'Account ID to credit (leave 0 if this is a debit entry)'
278
+ : 'Account ID to credit',
279
+ required: !isCompound,
280
+ }),
281
+ amount: pieces_framework_1.Property.Number({
282
+ displayName: 'Amount',
283
+ description: 'The transaction amount',
284
+ required: true,
285
+ }),
286
+ description: pieces_framework_1.Property.ShortText({
287
+ displayName: 'Description',
288
+ description: 'Description for this entry',
289
+ required: false,
290
+ }),
291
+ tax_id: taxOptions.length > 0
292
+ ? pieces_framework_1.Property.StaticDropdown({
293
+ displayName: 'Tax',
294
+ description: 'Tax rate (optional)',
295
+ required: false,
296
+ options: {
297
+ disabled: false,
298
+ options: taxOptions,
299
+ },
300
+ })
301
+ : pieces_framework_1.Property.Number({
302
+ displayName: 'Tax ID',
303
+ description: 'Tax ID (optional)',
304
+ required: false,
305
+ }),
306
+ tax_account_id: accountOptions.length > 0
307
+ ? pieces_framework_1.Property.StaticDropdown({
308
+ displayName: 'Tax Account',
309
+ description: 'Account for tax calculation (optional)',
310
+ required: false,
311
+ options: {
312
+ disabled: false,
313
+ options: accountOptions,
314
+ },
315
+ })
316
+ : pieces_framework_1.Property.Number({
317
+ displayName: 'Tax Account ID',
318
+ description: 'Account ID for tax calculation (optional)',
319
+ required: false,
320
+ }),
321
+ currency_id: currencyOptions.length > 0
322
+ ? pieces_framework_1.Property.StaticDropdown({
323
+ displayName: 'Currency',
324
+ description: 'Currency (optional)',
325
+ required: false,
326
+ options: {
327
+ disabled: false,
328
+ options: currencyOptions,
329
+ },
330
+ })
331
+ : pieces_framework_1.Property.Number({
332
+ displayName: 'Currency ID',
333
+ description: 'Currency ID (optional)',
334
+ required: false,
335
+ }),
336
+ currency_factor: pieces_framework_1.Property.Number({
337
+ displayName: 'Currency Factor',
338
+ description: 'Exchange rate factor (defaults to 1)',
339
+ required: false,
340
+ }),
341
+ },
342
+ }),
343
+ };
344
+ }
345
+ }),
346
+ }),
347
+ },
348
+ run(context) {
349
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
350
+ const client = new client_1.BexioClient(context.auth);
351
+ const entryType = context.propsValue.type;
352
+ const entryFields = context.propsValue.entryFields;
353
+ let entries = [];
354
+ if (entryType === 'manual_single_entry') {
355
+ const entry = {
356
+ debit_account_id: entryFields['debit_account'],
357
+ credit_account_id: entryFields['credit_account'],
358
+ amount: entryFields['amount'],
359
+ };
360
+ if (entryFields['description']) {
361
+ entry.description = entryFields['description'];
362
+ }
363
+ if (entryFields['tax_id']) {
364
+ entry.tax_id = entryFields['tax_id'];
365
+ }
366
+ if (entryFields['tax_account']) {
367
+ entry.tax_account_id = entryFields['tax_account'];
368
+ }
369
+ if (entryFields['currency_id']) {
370
+ entry.currency_id = entryFields['currency_id'];
371
+ }
372
+ if (entryFields['currency_factor']) {
373
+ entry.currency_factor = entryFields['currency_factor'];
374
+ }
375
+ entries = [entry];
376
+ }
377
+ else {
378
+ const entriesArray = entryFields['entries'];
379
+ if (!entriesArray || entriesArray.length === 0) {
380
+ throw new Error('At least one entry is required for compound or group entries');
381
+ }
382
+ entries = entriesArray.map((entry) => {
383
+ const bexioEntry = {
384
+ amount: entry['amount'],
385
+ };
386
+ const debitAccountId = entry['debit_account_id'];
387
+ if (debitAccountId && debitAccountId !== 0) {
388
+ bexioEntry.debit_account_id = debitAccountId;
389
+ }
390
+ const creditAccountId = entry['credit_account_id'];
391
+ if (creditAccountId && creditAccountId !== 0) {
392
+ bexioEntry.credit_account_id = creditAccountId;
393
+ }
394
+ if (entry['description']) {
395
+ bexioEntry.description = entry['description'];
396
+ }
397
+ const taxId = entry['tax_id'];
398
+ if (taxId && taxId !== 0) {
399
+ bexioEntry.tax_id = taxId;
400
+ }
401
+ const taxAccountId = entry['tax_account_id'];
402
+ if (taxAccountId && taxAccountId !== 0) {
403
+ bexioEntry.tax_account_id = taxAccountId;
404
+ }
405
+ const currencyId = entry['currency_id'];
406
+ if (currencyId && currencyId !== 0) {
407
+ bexioEntry.currency_id = currencyId;
408
+ }
409
+ if (entry['currency_factor']) {
410
+ bexioEntry.currency_factor = entry['currency_factor'];
411
+ }
412
+ return bexioEntry;
413
+ });
414
+ }
415
+ const requestBody = {
416
+ type: entryType,
417
+ date: context.propsValue.date,
418
+ reference_nr: context.propsValue.reference_nr,
419
+ entries,
420
+ };
421
+ const response = yield client.post('/accounts/manual_entries', requestBody);
422
+ return response;
423
+ });
424
+ },
425
+ });
426
+ //# sourceMappingURL=create-manual-entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-manual-entry.js","sourceRoot":"","sources":["../../../src/lib/actions/create-manual-entry.ts"],"names":[],"mappings":";;;;AAAA,2GAA2G;AAC3G,qEAAqE;AACrE,gEAA2G;AAC3G,kCAAoC;AACpC,6CAA+C;AAIlC,QAAA,uBAAuB,GAAG,IAAA,+BAAY,EAAC;IAClD,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,+DAA+D;IAC5E,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,gbAAgb,EAAE,UAAU,EAAE,KAAK,EAAE;IAChe,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC5B,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,iCAAiC;YAC9C,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,qBAAqB;YACnC,OAAO,EAAE;gBACP,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE;oBACP;wBACE,KAAK,EAAE,wCAAwC;wBAC/C,KAAK,EAAE,qBAAqB;qBAC7B;oBACD;wBACE,KAAK,EAAE,6DAA6D;wBACpE,KAAK,EAAE,uBAAuB;qBAC/B;oBACD;wBACE,KAAK,EAAE,8DAA8D;wBACrE,KAAK,EAAE,oBAAoB;qBAC5B;iBACF;aACF;SACF,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,kCAAkC;YAC/C,QAAQ,EAAE,IAAI;SACf,CAAC;QACF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CAAuB,CAAC;oBAC9D,IAAI,UAAU,IAAI,UAAU,KAAK,CAAC,EAAE,CAAC;wBACnC,UAAU,CAAC,WAAW,GAAG,UAAU,CAAC;oBACtC,CAAC;oBAED,IAAI,KAAK,CAAC,iBAAiB,CAAC,EAAE,CAAC;wBAC7B,UAAU,CAAC,eAAe,GAAG,KAAK,CAAC,iBAAiB,CAAW,CAAC;oBAClE,CAAC;oBAED,OAAO,UAAU,CAAC;gBACpB,CAAC,CAAC,CAAC;YACL,CAAC;YAED,MAAM,WAAW,GAAG;gBAClB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI;gBAC7B,YAAY,EAAE,OAAO,CAAC,UAAU,CAAC,YAAY;gBAC7C,OAAO;aACR,CAAC;YAEF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAChC,0BAA0B,EAC1B,WAAW,CACZ,CAAC;YAEF,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,30 @@
1
+ export declare const createPersonAction: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>, {
2
+ name_1: import("@agnocon/pieces-framework").ShortTextProperty<true>;
3
+ name_2: import("@agnocon/pieces-framework").ShortTextProperty<false>;
4
+ nr: import("@agnocon/pieces-framework").ShortTextProperty<false>;
5
+ salutation_id: import("@agnocon/pieces-framework").DropdownProperty<number, false, import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>>;
6
+ salutation_form: import("@agnocon/pieces-framework").NumberProperty<false>;
7
+ title_id: import("@agnocon/pieces-framework").DropdownProperty<number, false, import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>>;
8
+ birthday: import("@agnocon/pieces-framework").ShortTextProperty<false>;
9
+ street_name: import("@agnocon/pieces-framework").ShortTextProperty<false>;
10
+ house_number: import("@agnocon/pieces-framework").ShortTextProperty<false>;
11
+ address_addition: import("@agnocon/pieces-framework").ShortTextProperty<false>;
12
+ postcode: import("@agnocon/pieces-framework").ShortTextProperty<false>;
13
+ city: import("@agnocon/pieces-framework").ShortTextProperty<false>;
14
+ country_id: import("@agnocon/pieces-framework").DropdownProperty<number, false, import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>>;
15
+ mail: import("@agnocon/pieces-framework").ShortTextProperty<false>;
16
+ mail_second: import("@agnocon/pieces-framework").ShortTextProperty<false>;
17
+ phone_fixed: import("@agnocon/pieces-framework").ShortTextProperty<false>;
18
+ phone_fixed_second: import("@agnocon/pieces-framework").ShortTextProperty<false>;
19
+ phone_mobile: import("@agnocon/pieces-framework").ShortTextProperty<false>;
20
+ fax: import("@agnocon/pieces-framework").ShortTextProperty<false>;
21
+ url: import("@agnocon/pieces-framework").ShortTextProperty<false>;
22
+ skype_name: import("@agnocon/pieces-framework").ShortTextProperty<false>;
23
+ remarks: import("@agnocon/pieces-framework").LongTextProperty<false>;
24
+ language_id: import("@agnocon/pieces-framework").DropdownProperty<number, false, import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>>;
25
+ contact_group_ids: import("@agnocon/pieces-framework").MultiSelectDropdownProperty<string, false, import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>>;
26
+ contact_branch_ids: import("@agnocon/pieces-framework").MultiSelectDropdownProperty<string, false, import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>>;
27
+ user_id: import("@agnocon/pieces-framework").DropdownProperty<number, true, import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>>;
28
+ owner_id: import("@agnocon/pieces-framework").DropdownProperty<number, true, import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>>;
29
+ }>;
30
+ //# sourceMappingURL=create-person.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-person.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/create-person.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2d7B,CAAC"}