fatoority 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/errors.d.mts +67 -0
- package/errors.mjs +94 -0
- package/fatoora_ffi.wasm +0 -0
- package/generated/Adjustment.d.mts +9 -3
- package/generated/Adjustment.mjs +12 -6
- package/generated/AdjustmentKind.d.mts +24 -0
- package/generated/AdjustmentKind.mjs +72 -0
- package/generated/AllowanceCharge.d.mts +6 -4
- package/generated/AllowanceCharge.mjs +10 -8
- package/generated/ClearanceMode.d.mts +30 -0
- package/generated/ClearanceMode.mjs +78 -0
- package/generated/ClearanceStatus.d.mts +34 -0
- package/generated/ClearanceStatus.mjs +84 -0
- package/generated/{CsidCompliance.d.mts → ComplianceCsid.d.mts} +4 -3
- package/generated/{CsidCompliance.mjs → ComplianceCsid.mjs} +21 -13
- package/generated/ComplianceRequest.d.mts +2 -2
- package/generated/ComplianceRequest.mjs +2 -2
- package/generated/Config.d.mts +3 -2
- package/generated/Config.mjs +11 -3
- package/generated/CsrProperties.d.mts +6 -2
- package/generated/CsrProperties.mjs +7 -3
- package/generated/Environment.d.mts +28 -0
- package/generated/Environment.mjs +78 -0
- package/generated/FinalizedInvoice.d.mts +1 -1
- package/generated/FinalizedInvoice.mjs +2 -2
- package/generated/InvoiceBuilder.d.mts +18 -21
- package/generated/InvoiceBuilder.mjs +31 -168
- package/generated/InvoiceData.d.mts +7 -4
- package/generated/InvoiceData.mjs +8 -5
- package/generated/InvoiceFlag.d.mts +36 -0
- package/generated/InvoiceFlag.mjs +105 -0
- package/generated/InvoiceLineItem.d.mts +5 -3
- package/generated/InvoiceLineItem.mjs +8 -6
- package/generated/{Signer.d.mts → InvoiceSigner.d.mts} +3 -3
- package/generated/{Signer.mjs → InvoiceSigner.mjs} +13 -13
- package/generated/InvoiceSubType.d.mts +26 -0
- package/generated/InvoiceSubType.mjs +74 -0
- package/generated/InvoiceTypeKind.d.mts +40 -0
- package/generated/InvoiceTypeKind.mjs +92 -0
- package/generated/LineItemBuilder.d.mts +2 -1
- package/generated/LineItemBuilder.mjs +2 -1
- package/generated/MessageType.d.mts +38 -0
- package/generated/MessageType.mjs +90 -0
- package/generated/{CsidProduction.d.mts → ProductionCsid.d.mts} +4 -3
- package/generated/{CsidProduction.mjs → ProductionCsid.mjs} +21 -13
- package/generated/ProductionRequest.d.mts +2 -2
- package/generated/ProductionRequest.mjs +2 -2
- package/generated/ReportingStatus.d.mts +34 -0
- package/generated/ReportingStatus.mjs +84 -0
- package/generated/Severity.d.mts +30 -0
- package/generated/Severity.mjs +78 -0
- package/generated/SignedInvoice.d.mts +1 -1
- package/generated/SignedInvoice.mjs +2 -2
- package/generated/ValidationLayer.d.mts +49 -0
- package/generated/ValidationLayer.mjs +107 -0
- package/generated/ValidationLocationKind.d.mts +37 -0
- package/generated/ValidationLocationKind.mjs +89 -0
- package/generated/ValidationMessage.d.mts +20 -2
- package/generated/ValidationMessage.mjs +52 -0
- package/generated/ValidationResponse.d.mts +21 -3
- package/generated/ValidationResponse.mjs +52 -0
- package/generated/ValidationResults.d.mts +10 -1
- package/generated/ValidationResults.mjs +26 -0
- package/generated/ValidationStatus.d.mts +38 -0
- package/generated/ValidationStatus.mjs +90 -0
- package/generated/VatBreakdown.d.mts +4 -3
- package/generated/VatBreakdown.mjs +5 -4
- package/generated/VatCategory.d.mts +40 -0
- package/generated/VatCategory.mjs +92 -0
- package/generated/Xml.d.mts +12 -5
- package/generated/Xml.mjs +15 -11
- package/generated/ZatcaClient.d.mts +10 -9
- package/generated/ZatcaClient.mjs +15 -14
- package/generated/ZatcaFinding.d.mts +59 -0
- package/generated/ZatcaFinding.mjs +239 -0
- package/generated/ZatcaRuleSource.d.mts +26 -0
- package/generated/ZatcaRuleSource.mjs +97 -0
- package/generated/ZatcaStage.d.mts +49 -0
- package/generated/ZatcaStage.mjs +107 -0
- package/generated/ZatcaStageReport.d.mts +41 -0
- package/generated/ZatcaStageReport.mjs +168 -0
- package/generated/ZatcaStageStatus.d.mts +45 -0
- package/generated/ZatcaStageStatus.mjs +101 -0
- package/generated/ZatcaValidationReport.d.mts +63 -0
- package/generated/ZatcaValidationReport.mjs +228 -0
- package/generated/index.d.mts +45 -5
- package/generated/index.mjs +45 -5
- package/index.d.mts +131 -15
- package/index.mjs +111 -33
- package/members.mjs +67 -0
- package/package.json +11 -5
- package/patch.mjs +121 -0
- package/raw.d.mts +731 -0
- package/raw.mjs +4 -0
|
@@ -5,10 +5,13 @@ import { AllowanceCharge } from "./AllowanceCharge.mjs"
|
|
|
5
5
|
import { BindingError } from "./BindingError.mjs"
|
|
6
6
|
import { FinalizedInvoice } from "./FinalizedInvoice.mjs"
|
|
7
7
|
import { InvoiceLineItem } from "./InvoiceLineItem.mjs"
|
|
8
|
+
import { InvoiceSubType } from "./InvoiceSubType.mjs"
|
|
9
|
+
import { InvoiceTypeKind } from "./InvoiceTypeKind.mjs"
|
|
8
10
|
import { OriginalInvoiceRef } from "./OriginalInvoiceRef.mjs"
|
|
9
11
|
import { PaymentMeans } from "./PaymentMeans.mjs"
|
|
10
12
|
import { TaxExemption } from "./TaxExemption.mjs"
|
|
11
13
|
import { VatBreakdown } from "./VatBreakdown.mjs"
|
|
14
|
+
import { VatCategory } from "./VatCategory.mjs"
|
|
12
15
|
import wasm from "./diplomat-wasm.mjs";
|
|
13
16
|
import * as diplomatRuntime from "./diplomat-runtime.mjs";
|
|
14
17
|
|
|
@@ -155,14 +158,17 @@ export class InvoiceBuilder {
|
|
|
155
158
|
}
|
|
156
159
|
}
|
|
157
160
|
|
|
158
|
-
|
|
161
|
+
/**
|
|
162
|
+
* Append a document-level allowance (discount), mirroring core `InvoiceBuilder::allowance`.
|
|
163
|
+
*/
|
|
164
|
+
addAllowance(value, category, rate, exemption) {
|
|
159
165
|
let functionCleanupArena = new diplomatRuntime.CleanupArena();
|
|
160
166
|
|
|
161
167
|
const rateSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, rate)));
|
|
162
168
|
const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
|
|
163
169
|
|
|
164
170
|
|
|
165
|
-
const result = wasm.
|
|
171
|
+
const result = wasm.fatoora_InvoiceBuilder_add_allowance(diplomatReceive.buffer, this.ffiValue, value instanceof Adjustment ? value.ffiValue : typeError('value', 'Adjustment'), new VatCategory(category).ffiValue, rateSlice.ptr, exemption instanceof TaxExemption ? exemption.ffiValue : typeError('exemption', 'TaxExemption'));
|
|
166
172
|
|
|
167
173
|
try {
|
|
168
174
|
if (!diplomatReceive.resultFlag) {
|
|
@@ -179,14 +185,17 @@ export class InvoiceBuilder {
|
|
|
179
185
|
}
|
|
180
186
|
}
|
|
181
187
|
|
|
182
|
-
|
|
188
|
+
/**
|
|
189
|
+
* Append a document-level charge, mirroring core `InvoiceBuilder::charge`.
|
|
190
|
+
*/
|
|
191
|
+
addCharge(value, category, rate, exemption) {
|
|
183
192
|
let functionCleanupArena = new diplomatRuntime.CleanupArena();
|
|
184
193
|
|
|
185
|
-
const
|
|
194
|
+
const rateSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, rate)));
|
|
186
195
|
const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
|
|
187
196
|
|
|
188
197
|
|
|
189
|
-
const result = wasm.
|
|
198
|
+
const result = wasm.fatoora_InvoiceBuilder_add_charge(diplomatReceive.buffer, this.ffiValue, value instanceof Adjustment ? value.ffiValue : typeError('value', 'Adjustment'), new VatCategory(category).ffiValue, rateSlice.ptr, exemption instanceof TaxExemption ? exemption.ffiValue : typeError('exemption', 'TaxExemption'));
|
|
190
199
|
|
|
191
200
|
try {
|
|
192
201
|
if (!diplomatReceive.resultFlag) {
|
|
@@ -203,24 +212,20 @@ export class InvoiceBuilder {
|
|
|
203
212
|
}
|
|
204
213
|
}
|
|
205
214
|
|
|
206
|
-
|
|
207
|
-
* Construct a credit or debit note with a complete billing reference.
|
|
208
|
-
*/
|
|
209
|
-
static newWithReference(kind, subtype, reference, reason) {
|
|
215
|
+
setBuyerWithoutAddress(name, vatId, otherId, scheme) {
|
|
210
216
|
let functionCleanupArena = new diplomatRuntime.CleanupArena();
|
|
211
217
|
|
|
212
|
-
const
|
|
218
|
+
const nameSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, name)));
|
|
213
219
|
const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
|
|
214
220
|
|
|
215
221
|
|
|
216
|
-
const result = wasm.
|
|
222
|
+
const result = wasm.fatoora_InvoiceBuilder_set_buyer_without_address(diplomatReceive.buffer, this.ffiValue, nameSlice.ptr, diplomatRuntime.optionToBufferForCalling(wasm, vatId, 8, 4, functionCleanupArena, (arrayBuffer, offset, jsValue) => [functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.str8(wasm, jsValue)).writePtrLenToArrayBuffer(arrayBuffer, offset + 0)]), diplomatRuntime.optionToBufferForCalling(wasm, otherId, 8, 4, functionCleanupArena, (arrayBuffer, offset, jsValue) => [functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.str8(wasm, jsValue)).writePtrLenToArrayBuffer(arrayBuffer, offset + 0)]), diplomatRuntime.optionToBufferForCalling(wasm, scheme, 8, 4, functionCleanupArena, (arrayBuffer, offset, jsValue) => [functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.str8(wasm, jsValue)).writePtrLenToArrayBuffer(arrayBuffer, offset + 0)]));
|
|
217
223
|
|
|
218
224
|
try {
|
|
219
225
|
if (!diplomatReceive.resultFlag) {
|
|
220
226
|
const cause = new BindingError(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
|
|
221
227
|
throw new globalThis.Error('BindingError: ' + cause.toString(), { cause });
|
|
222
228
|
}
|
|
223
|
-
return new InvoiceBuilder(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
|
|
224
229
|
}
|
|
225
230
|
|
|
226
231
|
finally {
|
|
@@ -231,20 +236,24 @@ export class InvoiceBuilder {
|
|
|
231
236
|
}
|
|
232
237
|
}
|
|
233
238
|
|
|
234
|
-
|
|
239
|
+
/**
|
|
240
|
+
* Construct a credit or debit note with a complete billing reference.
|
|
241
|
+
*/
|
|
242
|
+
static newWithReference(kind, subtype, reference, reason) {
|
|
235
243
|
let functionCleanupArena = new diplomatRuntime.CleanupArena();
|
|
236
244
|
|
|
237
|
-
const
|
|
245
|
+
const reasonSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, reason)));
|
|
238
246
|
const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
|
|
239
247
|
|
|
240
248
|
|
|
241
|
-
const result = wasm.
|
|
249
|
+
const result = wasm.fatoora_InvoiceBuilder_new_with_reference(diplomatReceive.buffer, new InvoiceTypeKind(kind).ffiValue, new InvoiceSubType(subtype).ffiValue, reference instanceof OriginalInvoiceRef ? reference.ffiValue : typeError('reference', 'OriginalInvoiceRef'), reasonSlice.ptr);
|
|
242
250
|
|
|
243
251
|
try {
|
|
244
252
|
if (!diplomatReceive.resultFlag) {
|
|
245
253
|
const cause = new BindingError(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
|
|
246
254
|
throw new globalThis.Error('BindingError: ' + cause.toString(), { cause });
|
|
247
255
|
}
|
|
256
|
+
return new InvoiceBuilder(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
|
|
248
257
|
}
|
|
249
258
|
|
|
250
259
|
finally {
|
|
@@ -375,14 +384,14 @@ export class InvoiceBuilder {
|
|
|
375
384
|
}
|
|
376
385
|
}
|
|
377
386
|
|
|
378
|
-
|
|
387
|
+
addTaxExemption(category, rate, exemption) {
|
|
379
388
|
let functionCleanupArena = new diplomatRuntime.CleanupArena();
|
|
380
389
|
|
|
381
390
|
const rateSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, rate)));
|
|
382
391
|
const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
|
|
383
392
|
|
|
384
393
|
|
|
385
|
-
const result = wasm.
|
|
394
|
+
const result = wasm.fatoora_InvoiceBuilder_add_tax_exemption(diplomatReceive.buffer, this.ffiValue, new VatCategory(category).ffiValue, rateSlice.ptr, exemption instanceof TaxExemption ? exemption.ffiValue : typeError('exemption', 'TaxExemption'));
|
|
386
395
|
|
|
387
396
|
try {
|
|
388
397
|
if (!diplomatReceive.resultFlag) {
|
|
@@ -443,7 +452,7 @@ export class InvoiceBuilder {
|
|
|
443
452
|
const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
|
|
444
453
|
|
|
445
454
|
|
|
446
|
-
const result = wasm.fatoora_InvoiceBuilder_new(diplomatReceive.buffer, kind, subtype, diplomatRuntime.optionToBufferForCalling(wasm, originalId, 8, 4, functionCleanupArena, (arrayBuffer, offset, jsValue) => [functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.str8(wasm, jsValue)).writePtrLenToArrayBuffer(arrayBuffer, offset + 0)]), diplomatRuntime.optionToBufferForCalling(wasm, originalUuid, 8, 4, functionCleanupArena, (arrayBuffer, offset, jsValue) => [functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.str8(wasm, jsValue)).writePtrLenToArrayBuffer(arrayBuffer, offset + 0)]), diplomatRuntime.optionToBufferForCalling(wasm, originalDate, 8, 4, functionCleanupArena, (arrayBuffer, offset, jsValue) => [functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.str8(wasm, jsValue)).writePtrLenToArrayBuffer(arrayBuffer, offset + 0)]), diplomatRuntime.optionToBufferForCalling(wasm, reason, 8, 4, functionCleanupArena, (arrayBuffer, offset, jsValue) => [functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.str8(wasm, jsValue)).writePtrLenToArrayBuffer(arrayBuffer, offset + 0)]));
|
|
455
|
+
const result = wasm.fatoora_InvoiceBuilder_new(diplomatReceive.buffer, new InvoiceTypeKind(kind).ffiValue, new InvoiceSubType(subtype).ffiValue, diplomatRuntime.optionToBufferForCalling(wasm, originalId, 8, 4, functionCleanupArena, (arrayBuffer, offset, jsValue) => [functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.str8(wasm, jsValue)).writePtrLenToArrayBuffer(arrayBuffer, offset + 0)]), diplomatRuntime.optionToBufferForCalling(wasm, originalUuid, 8, 4, functionCleanupArena, (arrayBuffer, offset, jsValue) => [functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.str8(wasm, jsValue)).writePtrLenToArrayBuffer(arrayBuffer, offset + 0)]), diplomatRuntime.optionToBufferForCalling(wasm, originalDate, 8, 4, functionCleanupArena, (arrayBuffer, offset, jsValue) => [functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.str8(wasm, jsValue)).writePtrLenToArrayBuffer(arrayBuffer, offset + 0)]), diplomatRuntime.optionToBufferForCalling(wasm, reason, 8, 4, functionCleanupArena, (arrayBuffer, offset, jsValue) => [functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.str8(wasm, jsValue)).writePtrLenToArrayBuffer(arrayBuffer, offset + 0)]));
|
|
447
456
|
|
|
448
457
|
try {
|
|
449
458
|
if (!diplomatReceive.resultFlag) {
|
|
@@ -648,102 +657,6 @@ export class InvoiceBuilder {
|
|
|
648
657
|
}
|
|
649
658
|
}
|
|
650
659
|
|
|
651
|
-
setPaymentMeansCode(value) {
|
|
652
|
-
let functionCleanupArena = new diplomatRuntime.CleanupArena();
|
|
653
|
-
|
|
654
|
-
const valueSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, value)));
|
|
655
|
-
const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
const result = wasm.fatoora_InvoiceBuilder_set_payment_means_code(diplomatReceive.buffer, this.ffiValue, valueSlice.ptr);
|
|
659
|
-
|
|
660
|
-
try {
|
|
661
|
-
if (!diplomatReceive.resultFlag) {
|
|
662
|
-
const cause = new BindingError(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
|
|
663
|
-
throw new globalThis.Error('BindingError: ' + cause.toString(), { cause });
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
finally {
|
|
668
|
-
diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
|
|
669
|
-
functionCleanupArena.free();
|
|
670
|
-
|
|
671
|
-
diplomatReceive.free();
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
allowanceReason(value) {
|
|
676
|
-
let functionCleanupArena = new diplomatRuntime.CleanupArena();
|
|
677
|
-
|
|
678
|
-
const valueSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, value)));
|
|
679
|
-
const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
const result = wasm.fatoora_InvoiceBuilder_allowance_reason(diplomatReceive.buffer, this.ffiValue, valueSlice.ptr);
|
|
683
|
-
|
|
684
|
-
try {
|
|
685
|
-
if (!diplomatReceive.resultFlag) {
|
|
686
|
-
const cause = new BindingError(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
|
|
687
|
-
throw new globalThis.Error('BindingError: ' + cause.toString(), { cause });
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
finally {
|
|
692
|
-
diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
|
|
693
|
-
functionCleanupArena.free();
|
|
694
|
-
|
|
695
|
-
diplomatReceive.free();
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
invoiceLevelCharge(value) {
|
|
700
|
-
let functionCleanupArena = new diplomatRuntime.CleanupArena();
|
|
701
|
-
|
|
702
|
-
const valueSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, value)));
|
|
703
|
-
const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
const result = wasm.fatoora_InvoiceBuilder_invoice_level_charge(diplomatReceive.buffer, this.ffiValue, valueSlice.ptr);
|
|
707
|
-
|
|
708
|
-
try {
|
|
709
|
-
if (!diplomatReceive.resultFlag) {
|
|
710
|
-
const cause = new BindingError(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
|
|
711
|
-
throw new globalThis.Error('BindingError: ' + cause.toString(), { cause });
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
finally {
|
|
716
|
-
diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
|
|
717
|
-
functionCleanupArena.free();
|
|
718
|
-
|
|
719
|
-
diplomatReceive.free();
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
invoiceLevelDiscount(value) {
|
|
724
|
-
let functionCleanupArena = new diplomatRuntime.CleanupArena();
|
|
725
|
-
|
|
726
|
-
const valueSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, value)));
|
|
727
|
-
const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
const result = wasm.fatoora_InvoiceBuilder_invoice_level_discount(diplomatReceive.buffer, this.ffiValue, valueSlice.ptr);
|
|
731
|
-
|
|
732
|
-
try {
|
|
733
|
-
if (!diplomatReceive.resultFlag) {
|
|
734
|
-
const cause = new BindingError(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
|
|
735
|
-
throw new globalThis.Error('BindingError: ' + cause.toString(), { cause });
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
finally {
|
|
740
|
-
diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
|
|
741
|
-
functionCleanupArena.free();
|
|
742
|
-
|
|
743
|
-
diplomatReceive.free();
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
|
-
|
|
747
660
|
setInvoiceCounter(value) {
|
|
748
661
|
const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
|
|
749
662
|
|
|
@@ -767,26 +680,7 @@ export class InvoiceBuilder {
|
|
|
767
680
|
const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
|
|
768
681
|
|
|
769
682
|
|
|
770
|
-
const result = wasm.fatoora_InvoiceBuilder_set_vat_category(diplomatReceive.buffer, this.ffiValue, value);
|
|
771
|
-
|
|
772
|
-
try {
|
|
773
|
-
if (!diplomatReceive.resultFlag) {
|
|
774
|
-
const cause = new BindingError(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
|
|
775
|
-
throw new globalThis.Error('BindingError: ' + cause.toString(), { cause });
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
finally {
|
|
780
|
-
diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
|
|
781
|
-
diplomatReceive.free();
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
flags(value) {
|
|
786
|
-
const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
const result = wasm.fatoora_InvoiceBuilder_flags(diplomatReceive.buffer, this.ffiValue, value);
|
|
683
|
+
const result = wasm.fatoora_InvoiceBuilder_set_vat_category(diplomatReceive.buffer, this.ffiValue, new VatCategory(value).ffiValue);
|
|
790
684
|
|
|
791
685
|
try {
|
|
792
686
|
if (!diplomatReceive.resultFlag) {
|
|
@@ -801,15 +695,11 @@ export class InvoiceBuilder {
|
|
|
801
695
|
}
|
|
802
696
|
}
|
|
803
697
|
|
|
804
|
-
|
|
805
|
-
let functionCleanupArena = new diplomatRuntime.CleanupArena();
|
|
806
|
-
|
|
807
|
-
const languageSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, language)));
|
|
808
|
-
const valueSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, value)));
|
|
698
|
+
setFlags(value) {
|
|
809
699
|
const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
|
|
810
700
|
|
|
811
701
|
|
|
812
|
-
const result = wasm.
|
|
702
|
+
const result = wasm.fatoora_InvoiceBuilder_set_flags(diplomatReceive.buffer, this.ffiValue, value);
|
|
813
703
|
|
|
814
704
|
try {
|
|
815
705
|
if (!diplomatReceive.resultFlag) {
|
|
@@ -820,33 +710,6 @@ export class InvoiceBuilder {
|
|
|
820
710
|
|
|
821
711
|
finally {
|
|
822
712
|
diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
|
|
823
|
-
functionCleanupArena.free();
|
|
824
|
-
|
|
825
|
-
diplomatReceive.free();
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
setAllowance(reason, amount) {
|
|
830
|
-
let functionCleanupArena = new diplomatRuntime.CleanupArena();
|
|
831
|
-
|
|
832
|
-
const reasonSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, reason)));
|
|
833
|
-
const amountSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, amount)));
|
|
834
|
-
const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
const result = wasm.fatoora_InvoiceBuilder_set_allowance(diplomatReceive.buffer, this.ffiValue, reasonSlice.ptr, amountSlice.ptr);
|
|
838
|
-
|
|
839
|
-
try {
|
|
840
|
-
if (!diplomatReceive.resultFlag) {
|
|
841
|
-
const cause = new BindingError(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
|
|
842
|
-
throw new globalThis.Error('BindingError: ' + cause.toString(), { cause });
|
|
843
|
-
}
|
|
844
|
-
}
|
|
845
|
-
|
|
846
|
-
finally {
|
|
847
|
-
diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
|
|
848
|
-
functionCleanupArena.free();
|
|
849
|
-
|
|
850
713
|
diplomatReceive.free();
|
|
851
714
|
}
|
|
852
715
|
}
|
|
@@ -911,7 +774,7 @@ export class InvoiceBuilder {
|
|
|
911
774
|
const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
|
|
912
775
|
|
|
913
776
|
|
|
914
|
-
const result = wasm.fatoora_InvoiceBuilder_add_line_item(diplomatReceive.buffer, this.ffiValue, descriptionSlice.ptr, quantitySlice.ptr, unitCodeSlice.ptr, unitPriceSlice.ptr, vatRateSlice.ptr, category);
|
|
777
|
+
const result = wasm.fatoora_InvoiceBuilder_add_line_item(diplomatReceive.buffer, this.ffiValue, descriptionSlice.ptr, quantitySlice.ptr, unitCodeSlice.ptr, unitPriceSlice.ptr, vatRateSlice.ptr, new VatCategory(category).ffiValue);
|
|
915
778
|
|
|
916
779
|
try {
|
|
917
780
|
if (!diplomatReceive.resultFlag) {
|
|
@@ -3,10 +3,13 @@ import type { AllowanceCharge } from "./AllowanceCharge.mjs"
|
|
|
3
3
|
import type { BindingError } from "./BindingError.mjs"
|
|
4
4
|
import type { InvoiceLineItem } from "./InvoiceLineItem.mjs"
|
|
5
5
|
import type { InvoiceNote } from "./InvoiceNote.mjs"
|
|
6
|
+
import type { InvoiceSubType } from "./InvoiceSubType.mjs"
|
|
7
|
+
import type { InvoiceTypeKind } from "./InvoiceTypeKind.mjs"
|
|
6
8
|
import type { OriginalInvoiceRef } from "./OriginalInvoiceRef.mjs"
|
|
7
9
|
import type { Party } from "./Party.mjs"
|
|
8
10
|
import type { PaymentMeans } from "./PaymentMeans.mjs"
|
|
9
11
|
import type { Text } from "./Text.mjs"
|
|
12
|
+
import type { VatCategory } from "./VatCategory.mjs"
|
|
10
13
|
import type { pointer, codepoint } from "./diplomat-runtime.mjs";
|
|
11
14
|
|
|
12
15
|
|
|
@@ -64,13 +67,13 @@ export class InvoiceData {
|
|
|
64
67
|
|
|
65
68
|
invoiceCounter(): bigint;
|
|
66
69
|
|
|
67
|
-
vatCategory():
|
|
70
|
+
vatCategory(): VatCategory;
|
|
68
71
|
|
|
69
|
-
|
|
72
|
+
flags(): number;
|
|
70
73
|
|
|
71
|
-
invoiceTypeKind():
|
|
74
|
+
invoiceTypeKind(): InvoiceTypeKind;
|
|
72
75
|
|
|
73
|
-
invoiceSubType():
|
|
76
|
+
invoiceSubType(): InvoiceSubType;
|
|
74
77
|
|
|
75
78
|
seller(): Party;
|
|
76
79
|
|
|
@@ -3,10 +3,13 @@ import { AllowanceCharge } from "./AllowanceCharge.mjs"
|
|
|
3
3
|
import { BindingError } from "./BindingError.mjs"
|
|
4
4
|
import { InvoiceLineItem } from "./InvoiceLineItem.mjs"
|
|
5
5
|
import { InvoiceNote } from "./InvoiceNote.mjs"
|
|
6
|
+
import { InvoiceSubType } from "./InvoiceSubType.mjs"
|
|
7
|
+
import { InvoiceTypeKind } from "./InvoiceTypeKind.mjs"
|
|
6
8
|
import { OriginalInvoiceRef } from "./OriginalInvoiceRef.mjs"
|
|
7
9
|
import { Party } from "./Party.mjs"
|
|
8
10
|
import { PaymentMeans } from "./PaymentMeans.mjs"
|
|
9
11
|
import { Text } from "./Text.mjs"
|
|
12
|
+
import { VatCategory } from "./VatCategory.mjs"
|
|
10
13
|
import wasm from "./diplomat-wasm.mjs";
|
|
11
14
|
import * as diplomatRuntime from "./diplomat-runtime.mjs";
|
|
12
15
|
|
|
@@ -517,7 +520,7 @@ export class InvoiceData {
|
|
|
517
520
|
const result = wasm.fatoora_InvoiceData_vat_category(this.ffiValue);
|
|
518
521
|
|
|
519
522
|
try {
|
|
520
|
-
return result;
|
|
523
|
+
return new VatCategory(diplomatRuntime.internalConstructor, result);
|
|
521
524
|
}
|
|
522
525
|
|
|
523
526
|
finally {
|
|
@@ -525,9 +528,9 @@ export class InvoiceData {
|
|
|
525
528
|
}
|
|
526
529
|
}
|
|
527
530
|
|
|
528
|
-
|
|
531
|
+
flags() {
|
|
529
532
|
|
|
530
|
-
const result = wasm.
|
|
533
|
+
const result = wasm.fatoora_InvoiceData_flags(this.ffiValue);
|
|
531
534
|
|
|
532
535
|
try {
|
|
533
536
|
return result;
|
|
@@ -543,7 +546,7 @@ export class InvoiceData {
|
|
|
543
546
|
const result = wasm.fatoora_InvoiceData_invoice_type_kind(this.ffiValue);
|
|
544
547
|
|
|
545
548
|
try {
|
|
546
|
-
return result;
|
|
549
|
+
return new InvoiceTypeKind(diplomatRuntime.internalConstructor, result);
|
|
547
550
|
}
|
|
548
551
|
|
|
549
552
|
finally {
|
|
@@ -556,7 +559,7 @@ export class InvoiceData {
|
|
|
556
559
|
const result = wasm.fatoora_InvoiceData_invoice_sub_type(this.ffiValue);
|
|
557
560
|
|
|
558
561
|
try {
|
|
559
|
-
return result;
|
|
562
|
+
return new InvoiceSubType(diplomatRuntime.internalConstructor, result);
|
|
560
563
|
}
|
|
561
564
|
|
|
562
565
|
finally {
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { pointer, codepoint } from "./diplomat-runtime.mjs";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Named bits of the `u8` invoice flag mask accepted by
|
|
8
|
+
* `InvoiceBuilder::set_flags` and returned by `InvoiceData::flags`.
|
|
9
|
+
*
|
|
10
|
+
* Each discriminant is the flag's bit value; `bit()` returns it as a `u8`
|
|
11
|
+
* for languages whose enums do not expose their discriminant.
|
|
12
|
+
*/
|
|
13
|
+
export class InvoiceFlag {
|
|
14
|
+
|
|
15
|
+
/** @internal */
|
|
16
|
+
static fromValue(value: InvoiceFlag | string): InvoiceFlag;
|
|
17
|
+
|
|
18
|
+
get value(): string;
|
|
19
|
+
|
|
20
|
+
/** @internal */
|
|
21
|
+
get ffiValue(): number;
|
|
22
|
+
|
|
23
|
+
static ThirdParty : InvoiceFlag;
|
|
24
|
+
static Nominal : InvoiceFlag;
|
|
25
|
+
static Export : InvoiceFlag;
|
|
26
|
+
static Summary : InvoiceFlag;
|
|
27
|
+
static SelfBilled : InvoiceFlag;
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The flag's bit within the invoice flag mask.
|
|
32
|
+
*/
|
|
33
|
+
bit(): number;
|
|
34
|
+
|
|
35
|
+
constructor(value: InvoiceFlag | string );
|
|
36
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import wasm from "./diplomat-wasm.mjs";
|
|
3
|
+
import * as diplomatRuntime from "./diplomat-runtime.mjs";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Named bits of the `u8` invoice flag mask accepted by
|
|
9
|
+
* `InvoiceBuilder::set_flags` and returned by `InvoiceData::flags`.
|
|
10
|
+
*
|
|
11
|
+
* Each discriminant is the flag's bit value; `bit()` returns it as a `u8`
|
|
12
|
+
* for languages whose enums do not expose their discriminant.
|
|
13
|
+
*/
|
|
14
|
+
export class InvoiceFlag {
|
|
15
|
+
#value = undefined;
|
|
16
|
+
|
|
17
|
+
static #values = new Map([
|
|
18
|
+
["ThirdParty", 1],
|
|
19
|
+
["Nominal", 2],
|
|
20
|
+
["Export", 4],
|
|
21
|
+
["Summary", 8],
|
|
22
|
+
["SelfBilled", 16]
|
|
23
|
+
]);
|
|
24
|
+
|
|
25
|
+
static getAllEntries() {
|
|
26
|
+
return InvoiceFlag.#values.entries();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
#internalConstructor(value) {
|
|
30
|
+
if (arguments.length > 1 && arguments[0] === diplomatRuntime.internalConstructor) {
|
|
31
|
+
// We pass in two internalConstructor arguments to create *new*
|
|
32
|
+
// instances of this type, otherwise the enums are treated as singletons.
|
|
33
|
+
if (arguments[1] === diplomatRuntime.internalConstructor ) {
|
|
34
|
+
this.#value = arguments[2];
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
return InvoiceFlag.#objectValues[arguments[1]];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (value instanceof InvoiceFlag) {
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
let intVal = InvoiceFlag.#values.get(value);
|
|
45
|
+
|
|
46
|
+
// Nullish check, checks for null or undefined
|
|
47
|
+
if (intVal != null) {
|
|
48
|
+
return InvoiceFlag.#objectValues[intVal];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
throw TypeError(value + " is not a InvoiceFlag and does not correspond to any of its enumerator values.");
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** @internal */
|
|
55
|
+
static fromValue(value) {
|
|
56
|
+
return new InvoiceFlag(value);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
get value(){
|
|
60
|
+
for (let entry of InvoiceFlag.#values) {
|
|
61
|
+
if (entry[1] == this.#value) {
|
|
62
|
+
return entry[0];
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** @internal */
|
|
68
|
+
get ffiValue(){
|
|
69
|
+
return this.#value;
|
|
70
|
+
}
|
|
71
|
+
static #objectValues = {
|
|
72
|
+
[1]: new InvoiceFlag(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 1),
|
|
73
|
+
[2]: new InvoiceFlag(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 2),
|
|
74
|
+
[4]: new InvoiceFlag(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 4),
|
|
75
|
+
[8]: new InvoiceFlag(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 8),
|
|
76
|
+
[16]: new InvoiceFlag(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 16),
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
static ThirdParty = InvoiceFlag.#objectValues[1];
|
|
80
|
+
static Nominal = InvoiceFlag.#objectValues[2];
|
|
81
|
+
static Export = InvoiceFlag.#objectValues[4];
|
|
82
|
+
static Summary = InvoiceFlag.#objectValues[8];
|
|
83
|
+
static SelfBilled = InvoiceFlag.#objectValues[16];
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* The flag's bit within the invoice flag mask.
|
|
88
|
+
*/
|
|
89
|
+
bit() {
|
|
90
|
+
|
|
91
|
+
const result = wasm.fatoora_InvoiceFlag_bit(this.ffiValue);
|
|
92
|
+
|
|
93
|
+
try {
|
|
94
|
+
return result;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
finally {
|
|
98
|
+
diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
constructor(value) {
|
|
103
|
+
return this.#internalConstructor(...arguments)
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
// generated by diplomat-tool
|
|
2
2
|
import type { Adjustment } from "./Adjustment.mjs"
|
|
3
|
+
import type { AdjustmentKind } from "./AdjustmentKind.mjs"
|
|
3
4
|
import type { BindingError } from "./BindingError.mjs"
|
|
4
5
|
import type { OriginalInvoiceRef } from "./OriginalInvoiceRef.mjs"
|
|
5
6
|
import type { OtherId } from "./OtherId.mjs"
|
|
6
7
|
import type { TaxExemption } from "./TaxExemption.mjs"
|
|
7
8
|
import type { Text } from "./Text.mjs"
|
|
8
9
|
import type { VatBreakdown } from "./VatBreakdown.mjs"
|
|
10
|
+
import type { VatCategory } from "./VatCategory.mjs"
|
|
9
11
|
import type { pointer, codepoint } from "./diplomat-runtime.mjs";
|
|
10
12
|
|
|
11
13
|
|
|
@@ -29,7 +31,7 @@ export class InvoiceLineItem {
|
|
|
29
31
|
|
|
30
32
|
adjustment(index: number): Adjustment;
|
|
31
33
|
|
|
32
|
-
|
|
34
|
+
adjustmentKind(index: number): AdjustmentKind;
|
|
33
35
|
|
|
34
36
|
itemSellerIdentifier(): OtherId | null;
|
|
35
37
|
|
|
@@ -49,7 +51,7 @@ export class InvoiceLineItem {
|
|
|
49
51
|
|
|
50
52
|
taxSubtotal(index: number): VatBreakdown;
|
|
51
53
|
|
|
52
|
-
static new_(description: string, quantity: string, unitCode: string, unitPrice: string, rate: string, category:
|
|
54
|
+
static new_(description: string, quantity: string, unitCode: string, unitPrice: string, rate: string, category: VatCategory): InvoiceLineItem;
|
|
53
55
|
|
|
54
56
|
withMetadata(id: string | null, exemption: TaxExemption): InvoiceLineItem;
|
|
55
57
|
|
|
@@ -77,5 +79,5 @@ export class InvoiceLineItem {
|
|
|
77
79
|
|
|
78
80
|
hasGrossAmount(): boolean;
|
|
79
81
|
|
|
80
|
-
vatCategory():
|
|
82
|
+
vatCategory(): VatCategory;
|
|
81
83
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
// generated by diplomat-tool
|
|
2
2
|
import { Adjustment } from "./Adjustment.mjs"
|
|
3
|
+
import { AdjustmentKind } from "./AdjustmentKind.mjs"
|
|
3
4
|
import { BindingError } from "./BindingError.mjs"
|
|
4
5
|
import { OriginalInvoiceRef } from "./OriginalInvoiceRef.mjs"
|
|
5
6
|
import { OtherId } from "./OtherId.mjs"
|
|
6
7
|
import { TaxExemption } from "./TaxExemption.mjs"
|
|
7
8
|
import { Text } from "./Text.mjs"
|
|
8
9
|
import { VatBreakdown } from "./VatBreakdown.mjs"
|
|
10
|
+
import { VatCategory } from "./VatCategory.mjs"
|
|
9
11
|
import wasm from "./diplomat-wasm.mjs";
|
|
10
12
|
import * as diplomatRuntime from "./diplomat-runtime.mjs";
|
|
11
13
|
|
|
@@ -155,18 +157,18 @@ export class InvoiceLineItem {
|
|
|
155
157
|
}
|
|
156
158
|
}
|
|
157
159
|
|
|
158
|
-
|
|
159
|
-
const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5,
|
|
160
|
+
adjustmentKind(index) {
|
|
161
|
+
const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
|
|
160
162
|
|
|
161
163
|
|
|
162
|
-
const result = wasm.
|
|
164
|
+
const result = wasm.fatoora_InvoiceLineItem_adjustment_kind(diplomatReceive.buffer, this.ffiValue, index);
|
|
163
165
|
|
|
164
166
|
try {
|
|
165
167
|
if (!diplomatReceive.resultFlag) {
|
|
166
168
|
const cause = new BindingError(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
|
|
167
169
|
throw new globalThis.Error('BindingError: ' + cause.toString(), { cause });
|
|
168
170
|
}
|
|
169
|
-
return
|
|
171
|
+
return new AdjustmentKind(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
|
|
170
172
|
}
|
|
171
173
|
|
|
172
174
|
finally {
|
|
@@ -352,7 +354,7 @@ export class InvoiceLineItem {
|
|
|
352
354
|
const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
|
|
353
355
|
|
|
354
356
|
|
|
355
|
-
const result = wasm.fatoora_InvoiceLineItem_new(diplomatReceive.buffer, descriptionSlice.ptr, quantitySlice.ptr, unitCodeSlice.ptr, unitPriceSlice.ptr, rateSlice.ptr, category);
|
|
357
|
+
const result = wasm.fatoora_InvoiceLineItem_new(diplomatReceive.buffer, descriptionSlice.ptr, quantitySlice.ptr, unitCodeSlice.ptr, unitPriceSlice.ptr, rateSlice.ptr, new VatCategory(category).ffiValue);
|
|
356
358
|
|
|
357
359
|
try {
|
|
358
360
|
if (!diplomatReceive.resultFlag) {
|
|
@@ -639,7 +641,7 @@ export class InvoiceLineItem {
|
|
|
639
641
|
const result = wasm.fatoora_InvoiceLineItem_vat_category(this.ffiValue);
|
|
640
642
|
|
|
641
643
|
try {
|
|
642
|
-
return result;
|
|
644
|
+
return new VatCategory(diplomatRuntime.internalConstructor, result);
|
|
643
645
|
}
|
|
644
646
|
|
|
645
647
|
finally {
|
|
@@ -7,16 +7,16 @@ import type { pointer, codepoint } from "./diplomat-runtime.mjs";
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
export class
|
|
10
|
+
export class InvoiceSigner {
|
|
11
11
|
/** @internal */
|
|
12
12
|
get ffiValue(): pointer;
|
|
13
13
|
/** @internal */
|
|
14
14
|
constructor();
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
static fromPem(certPem: string, keyPem: string):
|
|
17
|
+
static fromPem(certPem: string, keyPem: string): InvoiceSigner;
|
|
18
18
|
|
|
19
|
-
static fromDer(certDer: Array<number>, keyDer: Array<number>):
|
|
19
|
+
static fromDer(certDer: Array<number>, keyDer: Array<number>): InvoiceSigner;
|
|
20
20
|
|
|
21
21
|
certificateDer(): Bytes;
|
|
22
22
|
|