@ripwords/myinvois-client 0.3.1 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/dist/api/documentManagement.d.ts +2 -2
  2. package/dist/api/documentManagement.js +1 -1
  3. package/dist/api/documentSubmission.d.ts +2 -2
  4. package/dist/api/documentSubmission.js +2 -2
  5. package/dist/api/documentTypeManagement.d.ts +2 -2
  6. package/dist/api/notificationManagement.d.ts +2 -2
  7. package/dist/api/platformLogin.d.ts +2 -2
  8. package/dist/api/taxpayerValidation.d.ts +2 -2
  9. package/dist/{document-DoQEvmcK.cjs → document-B6ab06s1.cjs} +9 -1
  10. package/dist/document-B6ab06s1.cjs.map +1 -0
  11. package/dist/{document-D4O7JY0G.js → document-Bb5WkhRe.js} +8 -0
  12. package/dist/{documentManagement-CyPwiyP4.cjs → documentManagement-BviJDtf2.cjs} +5 -1
  13. package/dist/documentManagement-BviJDtf2.cjs.map +1 -0
  14. package/dist/{documentManagement-CeNbp3qm.js → documentManagement-lPm8Gziu.js} +4 -0
  15. package/dist/{documentSubmission-DUsjqWhR.cjs → documentSubmission-9uGz-31K.cjs} +2 -2
  16. package/dist/{documentSubmission-DUsjqWhR.cjs.map → documentSubmission-9uGz-31K.cjs.map} +1 -1
  17. package/dist/{documentSubmission-uJ7yPWub.js → documentSubmission-BerP4Snv.js} +1 -1
  18. package/dist/{documents-Dp19RgNX.d.ts → documents-BYV12TVt.d.ts} +16 -0
  19. package/dist/{documents-BECak3KN.d.cts → documents-D_V38Q_U.d.cts} +17 -1
  20. package/dist/index.cjs +3 -3
  21. package/dist/index.d.ts +2 -2
  22. package/dist/index.js +3 -3
  23. package/dist/index10.cjs +4 -24
  24. package/dist/index11.cjs +22 -0
  25. package/dist/index12.cjs +2 -33
  26. package/dist/index13.cjs +2 -23
  27. package/dist/index14.cjs +330 -0
  28. package/dist/index14.cjs.map +1 -0
  29. package/dist/index15.cjs +193 -0
  30. package/dist/index15.cjs.map +1 -0
  31. package/dist/index16.cjs +62 -0
  32. package/dist/index16.cjs.map +1 -0
  33. package/dist/index17.cjs +531 -4
  34. package/dist/index17.cjs.map +1 -0
  35. package/dist/index18.cjs +195 -6
  36. package/dist/index18.cjs.map +1 -0
  37. package/dist/index19.cjs +0 -5
  38. package/dist/index2.cjs +4 -61
  39. package/dist/index20.cjs +24 -2
  40. package/dist/index20.cjs.map +1 -0
  41. package/dist/index21.cjs +0 -3
  42. package/dist/index22.cjs +0 -6
  43. package/dist/index23.cjs +24 -203
  44. package/dist/index23.cjs.map +1 -1
  45. package/dist/index24.cjs +20 -104
  46. package/dist/index24.cjs.map +1 -1
  47. package/dist/index25.cjs +0 -137
  48. package/dist/index26.cjs +29 -59
  49. package/dist/index26.cjs.map +1 -1
  50. package/dist/index27.cjs +19 -262
  51. package/dist/index27.cjs.map +1 -1
  52. package/dist/index28.cjs +0 -79
  53. package/dist/index29.cjs +0 -107
  54. package/dist/index3.cjs +6 -531
  55. package/dist/index30.cjs +0 -73
  56. package/dist/index31.cjs +203 -107
  57. package/dist/index31.cjs.map +1 -1
  58. package/dist/index32.cjs +104 -95
  59. package/dist/index32.cjs.map +1 -1
  60. package/dist/index33.cjs +136 -4
  61. package/dist/{index25.cjs.map → index33.cjs.map} +1 -1
  62. package/dist/index34.cjs +60 -9
  63. package/dist/index34.cjs.map +1 -1
  64. package/dist/index35.cjs +266 -4
  65. package/dist/index35.cjs.map +1 -0
  66. package/dist/index36.cjs +78 -21
  67. package/dist/{index28.cjs.map → index36.cjs.map} +1 -1
  68. package/dist/index37.cjs +106 -2
  69. package/dist/{index29.cjs.map → index37.cjs.map} +1 -1
  70. package/dist/index38.cjs +72 -2
  71. package/dist/{index30.cjs.map → index38.cjs.map} +1 -1
  72. package/dist/index39.cjs +108 -326
  73. package/dist/index39.cjs.map +1 -1
  74. package/dist/index4.cjs +4 -195
  75. package/dist/index40.cjs +96 -189
  76. package/dist/index40.cjs.map +1 -1
  77. package/dist/index5.cjs +3 -0
  78. package/dist/index6.cjs +2 -24
  79. package/dist/index7.cjs +6 -0
  80. package/dist/index71.cts.map +1 -1
  81. package/dist/index8.cjs +5 -0
  82. package/dist/index9.cjs +9 -25
  83. package/dist/index9.cjs.map +1 -1
  84. package/dist/{taxpayer-BdvCGHHC.d.ts → taxpayer-BWpQOlug.d.ts} +1 -1
  85. package/dist/{taxpayer-CaDfslWB.d.cts → taxpayer-DUFUvBKi.d.cts} +2 -2
  86. package/dist/types/documents.d.ts +1 -1
  87. package/dist/types/index.d.ts +2 -2
  88. package/dist/types/taxpayer.d.ts +2 -2
  89. package/dist/utils/document.d.ts +4 -2
  90. package/dist/utils/document.js +1 -1
  91. package/dist/utils/signature-diagnostics.d.ts +2 -2
  92. package/dist/utils/signature-diagnostics.js +1 -1
  93. package/dist/utils/validation.d.ts +2 -2
  94. package/package.json +1 -1
  95. package/dist/document-DoQEvmcK.cjs.map +0 -1
  96. package/dist/documentManagement-CyPwiyP4.cjs.map +0 -1
  97. package/dist/index10.cjs.map +0 -1
  98. package/dist/index12.cjs.map +0 -1
  99. package/dist/index13.cjs.map +0 -1
  100. package/dist/index2.cjs.map +0 -1
  101. package/dist/index3.cjs.map +0 -1
  102. package/dist/index4.cjs.map +0 -1
  103. package/dist/index6.cjs.map +0 -1
package/dist/index9.cjs CHANGED
@@ -1,29 +1,13 @@
1
1
 
2
- //#region src/types/notifications.d.ts
3
- let NotificationTypeEnum = /* @__PURE__ */ function(NotificationTypeEnum$1) {
4
- NotificationTypeEnum$1[NotificationTypeEnum$1["Profile data validation"] = 3] = "Profile data validation";
5
- NotificationTypeEnum$1[NotificationTypeEnum$1["Document received"] = 6] = "Document received";
6
- NotificationTypeEnum$1[NotificationTypeEnum$1["Document validated"] = 7] = "Document validated";
7
- NotificationTypeEnum$1[NotificationTypeEnum$1["Document cancelled"] = 8] = "Document cancelled";
8
- NotificationTypeEnum$1[NotificationTypeEnum$1["User profile changed"] = 10] = "User profile changed";
9
- NotificationTypeEnum$1[NotificationTypeEnum$1["Taxpayer profile changed"] = 11] = "Taxpayer profile changed";
10
- NotificationTypeEnum$1[NotificationTypeEnum$1["Document rejection initiated"] = 15] = "Document rejection initiated";
11
- NotificationTypeEnum$1[NotificationTypeEnum$1["ERP data validation"] = 26] = "ERP data validation";
12
- NotificationTypeEnum$1[NotificationTypeEnum$1["Documents processing summary"] = 33] = "Documents processing summary";
13
- NotificationTypeEnum$1[NotificationTypeEnum$1["Document Template Published"] = 34] = "Document Template Published";
14
- NotificationTypeEnum$1[NotificationTypeEnum$1["Document Template Deletion"] = 35] = "Document Template Deletion";
15
- return NotificationTypeEnum$1;
16
- }({});
17
- let NotificationStatusEnum = /* @__PURE__ */ function(NotificationStatusEnum$1) {
18
- NotificationStatusEnum$1[NotificationStatusEnum$1["New"] = 1] = "New";
19
- NotificationStatusEnum$1[NotificationStatusEnum$1["Pending"] = 2] = "Pending";
20
- NotificationStatusEnum$1[NotificationStatusEnum$1["Batched"] = 3] = "Batched";
21
- NotificationStatusEnum$1[NotificationStatusEnum$1["Delivered"] = 4] = "Delivered";
22
- NotificationStatusEnum$1[NotificationStatusEnum$1["Error"] = 5] = "Error";
23
- return NotificationStatusEnum$1;
24
- }({});
2
+ //#region src/utils/base64.ts
3
+ function encodeToBase64(content) {
4
+ return Buffer.from(content).toString("base64");
5
+ }
6
+ function decodeFromBase64(content) {
7
+ return Buffer.from(content, "base64").toString("utf-8");
8
+ }
25
9
 
26
10
  //#endregion
27
- exports.NotificationStatusEnum = NotificationStatusEnum;
28
- exports.NotificationTypeEnum = NotificationTypeEnum;
11
+ exports.decodeFromBase64 = decodeFromBase64;
12
+ exports.encodeToBase64 = encodeToBase64;
29
13
  //# sourceMappingURL=index9.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index9.cjs","names":[],"sources":["../src/types/notifications.d.ts"],"sourcesContent":["export type NotificationType = 3 | 6 | 7 | 8 | 10 | 11 | 15 | 26 | 33 | 34 | 35\n\nexport enum NotificationTypeEnum {\n 'Profile data validation' = 3,\n 'Document received' = 6,\n 'Document validated' = 7,\n 'Document cancelled' = 8,\n 'User profile changed' = 10,\n 'Taxpayer profile changed' = 11,\n 'Document rejection initiated' = 15,\n 'ERP data validation' = 26,\n 'Documents processing summary' = 33,\n 'Document Template Published' = 34,\n 'Document Template Deletion' = 35,\n}\n\nexport type NotificationStatus = 1 | 2 | 3 | 4 | 5\n\nexport enum NotificationStatusEnum {\n 'New' = 1,\n 'Pending' = 2,\n 'Batched' = 3,\n 'Delivered' = 4,\n 'Error' = 5,\n}\n\nexport type NotificationDeliveryAttempt = {\n attemptDateTime: string\n status: string\n statusDetails: string\n}\n\nexport type NotificationMetadata = {\n hasNext: boolean\n}\n\nexport type Notification = {\n notificationId: string\n receiverNName: string\n notificationDeliveryId: string\n creationDateTime: string\n receivedDateTime: string\n notificationSubject: string\n deliveredDateTime: string\n typeId: string\n typeName: string\n finalMessage: string\n address: string\n language: string\n status: string\n deliveryAttempts: NotificationDeliveryAttempt[]\n}\n\nexport type NotificationResponse = {\n notifications: Notification[]\n metadata: NotificationMetadata\n}\n\nexport type NotificationSearchParams = {\n dateFrom?: string\n dateTo?: string\n type?: NotificationType\n language?: string\n status?: NotificationStatus\n pageNo?: number\n pageSize?: number\n}\n"],"mappings":";;AAEA,IAAY,wEAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACD;AAID,IAAY,4EAAL;AACL;AACA;AACA;AACA;AACA;;AACD"}
1
+ {"version":3,"file":"index9.cjs","names":["content: string"],"sources":["../src/utils/base64.ts"],"sourcesContent":["export function encodeToBase64(content: string): string {\n return Buffer.from(content).toString('base64')\n}\n\nexport function decodeFromBase64(content: string): string {\n return Buffer.from(content, 'base64').toString('utf-8')\n}\n"],"mappings":";;AAAA,SAAgB,eAAeA,SAAyB;AACtD,QAAO,OAAO,KAAK,QAAQ,CAAC,SAAS,SAAS;AAC/C;AAED,SAAgB,iBAAiBA,SAAyB;AACxD,QAAO,OAAO,KAAK,SAAS,SAAS,CAAC,SAAS,QAAQ;AACxD"}
@@ -1,5 +1,5 @@
1
1
  import { MSICCode } from "./msic-codes-CjrrJmzb.js";
2
- import { RegistrationType } from "./documents-Dp19RgNX.js";
2
+ import { RegistrationType } from "./documents-BYV12TVt.js";
3
3
 
4
4
  //#region src/types/taxpayer.d.ts
5
5
  interface TaxpayerQRCodeResponse {
@@ -1,5 +1,5 @@
1
1
  import { MSICCode } from "./msic-codes-CIKdPqag.cjs";
2
- import { RegistrationType } from "./documents-BECak3KN.cjs";
2
+ import { RegistrationType } from "./documents-D_V38Q_U.cjs";
3
3
 
4
4
  //#region src/types/taxpayer.d.ts
5
5
  interface TaxpayerQRCodeResponse {
@@ -32,4 +32,4 @@ interface TinSearchResponse {
32
32
  }
33
33
  //#endregion
34
34
  export { TaxpayerQRCodeResponse, TinSearchParams, TinSearchResponse };
35
- //# sourceMappingURL=taxpayer-CaDfslWB.d.cts.map
35
+ //# sourceMappingURL=taxpayer-DUFUvBKi.d.cts.map
@@ -51,5 +51,5 @@ import "../YX-F34sJ7Ik.js";
51
51
  import "../ZX-CDQOfsHh.js";
52
52
  import "../XX-DOA-10JW.js";
53
53
  import "../unit-types-VgYXIwTT.js";
54
- import { Address, AllDocumentsV1_1, Buyer, CompleteInvoice, CreditNoteV1_1, DebitNoteV1_1, DocumentStatus, DocumentSummary, DocumentTypeResponse, DocumentTypeVersion, DocumentTypeVersionResponse, DocumentTypesResponse, DocumentValidationResult, DocumentValidationStepResult, FinalDocumentData, GetSubmissionResponse, InvoiceLineItem, InvoiceSubmission, InvoiceV1_1, LegalMonetaryTotal, RefundNoteV1_1, RegistrationType, ResponseDocument, SelfBilledCreditNoteV1_1, SelfBilledInvoiceV1_1, SelfBilledRefundNoteV1_1, SignedInfoObject, SignedInvoiceSubmission, SignedPropertiesData, SignedPropertiesObject, SigningCredentials, StandardError, SubmissionResponse, SubmissionStatus, Supplier, TaxCategory, TaxSubtotal, TaxTotal, UBLDocument, WorkflowParameter } from "../documents-Dp19RgNX.js";
54
+ import { Address, AllDocumentsV1_1, Buyer, CompleteInvoice, CreditNoteV1_1, DebitNoteV1_1, DocumentStatus, DocumentSummary, DocumentTypeResponse, DocumentTypeVersion, DocumentTypeVersionResponse, DocumentTypesResponse, DocumentValidationResult, DocumentValidationStepResult, FinalDocumentData, GetSubmissionResponse, InvoiceLineItem, InvoiceSubmission, InvoiceV1_1, LegalMonetaryTotal, RefundNoteV1_1, RegistrationType, ResponseDocument, SelfBilledCreditNoteV1_1, SelfBilledInvoiceV1_1, SelfBilledRefundNoteV1_1, SignedInfoObject, SignedInvoiceSubmission, SignedPropertiesData, SignedPropertiesObject, SigningCredentials, StandardError, SubmissionResponse, SubmissionStatus, Supplier, TaxCategory, TaxSubtotal, TaxTotal, UBLDocument, WorkflowParameter } from "../documents-BYV12TVt.js";
55
55
  export { Address, AllDocumentsV1_1, Buyer, CompleteInvoice, CreditNoteV1_1, DebitNoteV1_1, DocumentStatus, DocumentSummary, DocumentTypeResponse, DocumentTypeVersion, DocumentTypeVersionResponse, DocumentTypesResponse, DocumentValidationResult, DocumentValidationStepResult, FinalDocumentData, GetSubmissionResponse, InvoiceLineItem, InvoiceSubmission, InvoiceV1_1, LegalMonetaryTotal, RefundNoteV1_1, RegistrationType, ResponseDocument, SelfBilledCreditNoteV1_1, SelfBilledInvoiceV1_1, SelfBilledRefundNoteV1_1, SignedInfoObject, SignedInvoiceSubmission, SignedPropertiesData, SignedPropertiesObject, SigningCredentials, StandardError, SubmissionResponse, SubmissionStatus, Supplier, TaxCategory, TaxSubtotal, TaxTotal, UBLDocument, WorkflowParameter };
@@ -51,11 +51,11 @@ import "../YX-F34sJ7Ik.js";
51
51
  import "../ZX-CDQOfsHh.js";
52
52
  import "../XX-DOA-10JW.js";
53
53
  import { UnitType, UnitTypeCode } from "../unit-types-VgYXIwTT.js";
54
- import { Address, AllDocumentsV1_1, Buyer, CompleteInvoice, CreditNoteV1_1, DebitNoteV1_1, DocumentStatus, DocumentSummary, DocumentTypeResponse, DocumentTypeVersion, DocumentTypeVersionResponse, DocumentTypesResponse, DocumentValidationResult, DocumentValidationStepResult, FinalDocumentData, GetSubmissionResponse, InvoiceLineItem, InvoiceSubmission, InvoiceV1_1, LegalMonetaryTotal, RefundNoteV1_1, RegistrationType, ResponseDocument, SelfBilledCreditNoteV1_1, SelfBilledInvoiceV1_1, SelfBilledRefundNoteV1_1, SignedInfoObject, SignedInvoiceSubmission, SignedPropertiesData, SignedPropertiesObject, SigningCredentials, StandardError, SubmissionResponse, SubmissionStatus, Supplier, TaxCategory, TaxSubtotal, TaxTotal, UBLDocument, WorkflowParameter } from "../documents-Dp19RgNX.js";
54
+ import { Address, AllDocumentsV1_1, Buyer, CompleteInvoice, CreditNoteV1_1, DebitNoteV1_1, DocumentStatus, DocumentSummary, DocumentTypeResponse, DocumentTypeVersion, DocumentTypeVersionResponse, DocumentTypesResponse, DocumentValidationResult, DocumentValidationStepResult, FinalDocumentData, GetSubmissionResponse, InvoiceLineItem, InvoiceSubmission, InvoiceV1_1, LegalMonetaryTotal, RefundNoteV1_1, RegistrationType, ResponseDocument, SelfBilledCreditNoteV1_1, SelfBilledInvoiceV1_1, SelfBilledRefundNoteV1_1, SignedInfoObject, SignedInvoiceSubmission, SignedPropertiesData, SignedPropertiesObject, SigningCredentials, StandardError, SubmissionResponse, SubmissionStatus, Supplier, TaxCategory, TaxSubtotal, TaxTotal, UBLDocument, WorkflowParameter } from "../documents-BYV12TVt.js";
55
55
  import { PaymentMode, PaymentModeCode, PaymentModeCodeEnum } from "../payment-modes-g3DzLmWb.js";
56
56
  import { CanonicalizationMethod, Cert, CertDigest, DigestMethod, IssuerDigitalSignature, IssuerSerial, KeyInfo, QualifyingProperties, Reference, SignatureMethod, SignedInfo, SignedProperties, SignedSignatureProperties, SigningCertificate, Transform, X509Data } from "../signatures-CerHUrj3.js";
57
57
  import { Notification, NotificationDeliveryAttempt, NotificationMetadata, NotificationResponse, NotificationSearchParams, NotificationStatus, NotificationStatusEnum, NotificationType, NotificationTypeEnum } from "../notifications-sFhgh3rJ.js";
58
- import { TaxpayerQRCodeResponse, TinSearchParams, TinSearchResponse } from "../taxpayer-BdvCGHHC.js";
58
+ import { TaxpayerQRCodeResponse, TinSearchParams, TinSearchResponse } from "../taxpayer-BWpQOlug.js";
59
59
  import { Fetch } from "../utils-C4FoVKLq.js";
60
60
  import { ClientCredentials, TokenResponse } from "../index-CygwSf0x.js";
61
61
  export { Address, AllDocumentsV1_1, Buyer, CanonicalizationMethod, Cert, CertDigest, Classification, ClassificationCode, ClassificationCodeEnum, ClientCredentials, CompleteInvoice, Country, CountryCode, CountryCodeEnum, CountryNameEnum, CreditNoteV1_1, Currency, CurrencyCode, CurrencyCodeEnum, DebitNoteV1_1, DigestMethod, DocumentStatus, DocumentSummary, DocumentTypeResponse, DocumentTypeVersion, DocumentTypeVersionResponse, DocumentTypesResponse, DocumentValidationResult, DocumentValidationStepResult, EInvoiceType, EInvoiceTypeCode, EInvoiceTypeCodeEnum, Fetch, FinalDocumentData, GetSubmissionResponse, InvoiceLineItem, InvoiceSubmission, InvoiceV1_1, IssuerDigitalSignature, IssuerSerial, KeyInfo, LegalMonetaryTotal, MSICCode, Notification, NotificationDeliveryAttempt, NotificationMetadata, NotificationResponse, NotificationSearchParams, NotificationStatus, NotificationStatusEnum, NotificationType, NotificationTypeEnum, PaymentMode, PaymentModeCode, PaymentModeCodeEnum, QualifyingProperties, Reference, RefundNoteV1_1, RegistrationType, ResponseDocument, SelfBilledCreditNoteV1_1, SelfBilledInvoiceV1_1, SelfBilledRefundNoteV1_1, SignatureMethod, SignedInfo, SignedInfoObject, SignedInvoiceSubmission, SignedProperties, SignedPropertiesData, SignedPropertiesObject, SignedSignatureProperties, SigningCertificate, SigningCredentials, StandardError, State, StateCode, StateCodeEnum, SubmissionResponse, SubmissionStatus, Supplier, TaxCategory, TaxSubtotal, TaxTotal, TaxType, TaxTypeCode, TaxTypeCodeEnum, TaxpayerQRCodeResponse, TinSearchParams, TinSearchResponse, TokenResponse, Transform, UBLDocument, UnitType, UnitTypeCode, WorkflowParameter, X509Data };
@@ -51,6 +51,6 @@ import "../YX-F34sJ7Ik.js";
51
51
  import "../ZX-CDQOfsHh.js";
52
52
  import "../XX-DOA-10JW.js";
53
53
  import "../unit-types-VgYXIwTT.js";
54
- import "../documents-Dp19RgNX.js";
55
- import { TaxpayerQRCodeResponse, TinSearchParams, TinSearchResponse } from "../taxpayer-BdvCGHHC.js";
54
+ import "../documents-BYV12TVt.js";
55
+ import { TaxpayerQRCodeResponse, TinSearchParams, TinSearchResponse } from "../taxpayer-BWpQOlug.js";
56
56
  export { TaxpayerQRCodeResponse, TinSearchParams, TinSearchResponse };
@@ -51,11 +51,11 @@ import "../YX-F34sJ7Ik.js";
51
51
  import "../ZX-CDQOfsHh.js";
52
52
  import "../XX-DOA-10JW.js";
53
53
  import { UnitTypeCode } from "../unit-types-VgYXIwTT.js";
54
- import { AllDocumentsV1_1, CompleteInvoice, InvoiceLineItem, InvoiceSubmission, SignedInfoObject, SignedPropertiesObject, SigningCredentials, UBLDocument } from "../documents-Dp19RgNX.js";
54
+ import { AllDocumentsV1_1, CompleteInvoice, InvoiceLineItem, InvoiceSubmission, SignedInfoObject, SignedPropertiesObject, SigningCredentials, UBLDocument } from "../documents-BYV12TVt.js";
55
55
  import "../payment-modes-g3DzLmWb.js";
56
56
  import "../signatures-CerHUrj3.js";
57
57
  import "../notifications-sFhgh3rJ.js";
58
- import "../taxpayer-BdvCGHHC.js";
58
+ import "../taxpayer-BWpQOlug.js";
59
59
  import "../utils-C4FoVKLq.js";
60
60
  import "../index-CygwSf0x.js";
61
61
 
@@ -169,6 +169,7 @@ declare const createPercentageTaxLineItem: (params: {
169
169
  itemDescription: string;
170
170
  unitPrice: number;
171
171
  quantity?: number;
172
+ measurement?: string;
172
173
  taxType: TaxTypeCode;
173
174
  taxRate: number;
174
175
  totalTaxableAmountPerLine?: number;
@@ -183,6 +184,7 @@ declare const createFixedRateTaxLineItem: (params: {
183
184
  itemDescription: string;
184
185
  unitPrice: number;
185
186
  quantity?: number;
187
+ measurement?: string;
186
188
  taxType: TaxTypeCode;
187
189
  taxPerUnitAmount: number;
188
190
  baseUnitMeasure: number;
@@ -1,4 +1,4 @@
1
1
  import "../formatIdValue-qTxJqj9o.js";
2
- import { calculateCertificateDigest, calculateDocumentDigest, calculateExpectedTaxAmount, calculateInvoiceTotals, calculateSignedPropertiesDigest, canonicalizeJSON, createFixedRateTaxLineItem, createPercentageTaxLineItem, createSignedInfoAndSign, createSignedProperties, extractCertificateInfo, generateCleanInvoiceObject, generateCleanUBLDocument, generateCompleteDocument, isFixedRateTax, isPercentageTax, signDocumentString, sortObjectKeys, transformDocumentForHashing } from "../document-D4O7JY0G.js";
2
+ import { calculateCertificateDigest, calculateDocumentDigest, calculateExpectedTaxAmount, calculateInvoiceTotals, calculateSignedPropertiesDigest, canonicalizeJSON, createFixedRateTaxLineItem, createPercentageTaxLineItem, createSignedInfoAndSign, createSignedProperties, extractCertificateInfo, generateCleanInvoiceObject, generateCleanUBLDocument, generateCompleteDocument, isFixedRateTax, isPercentageTax, signDocumentString, sortObjectKeys, transformDocumentForHashing } from "../document-Bb5WkhRe.js";
3
3
 
4
4
  export { calculateCertificateDigest, calculateDocumentDigest, calculateExpectedTaxAmount, calculateInvoiceTotals, calculateSignedPropertiesDigest, canonicalizeJSON, createFixedRateTaxLineItem, createPercentageTaxLineItem, createSignedInfoAndSign, createSignedProperties, extractCertificateInfo, generateCleanInvoiceObject, generateCleanUBLDocument, generateCompleteDocument, isFixedRateTax, isPercentageTax, signDocumentString, sortObjectKeys, transformDocumentForHashing };
@@ -51,11 +51,11 @@ import "../YX-F34sJ7Ik.js";
51
51
  import "../ZX-CDQOfsHh.js";
52
52
  import "../XX-DOA-10JW.js";
53
53
  import "../unit-types-VgYXIwTT.js";
54
- import { InvoiceV1_1 } from "../documents-Dp19RgNX.js";
54
+ import { InvoiceV1_1 } from "../documents-BYV12TVt.js";
55
55
  import "../payment-modes-g3DzLmWb.js";
56
56
  import "../signatures-CerHUrj3.js";
57
57
  import "../notifications-sFhgh3rJ.js";
58
- import "../taxpayer-BdvCGHHC.js";
58
+ import "../taxpayer-BWpQOlug.js";
59
59
  import "../utils-C4FoVKLq.js";
60
60
  import "../index-CygwSf0x.js";
61
61
 
@@ -1,5 +1,5 @@
1
1
  import "../formatIdValue-qTxJqj9o.js";
2
- import { calculateCertificateDigest, calculateDocumentDigest, calculateSignedPropertiesDigest, createSignedProperties, extractCertificateInfo } from "../document-D4O7JY0G.js";
2
+ import { calculateCertificateDigest, calculateDocumentDigest, calculateSignedPropertiesDigest, createSignedProperties, extractCertificateInfo } from "../document-Bb5WkhRe.js";
3
3
  import crypto from "crypto";
4
4
 
5
5
  //#region src/utils/signature-diagnostics.ts
@@ -51,11 +51,11 @@ import "../YX-F34sJ7Ik.js";
51
51
  import "../ZX-CDQOfsHh.js";
52
52
  import "../XX-DOA-10JW.js";
53
53
  import "../unit-types-VgYXIwTT.js";
54
- import { InvoiceLineItem, InvoiceV1_1 } from "../documents-Dp19RgNX.js";
54
+ import { InvoiceLineItem, InvoiceV1_1 } from "../documents-BYV12TVt.js";
55
55
  import "../payment-modes-g3DzLmWb.js";
56
56
  import "../signatures-CerHUrj3.js";
57
57
  import "../notifications-sFhgh3rJ.js";
58
- import "../taxpayer-BdvCGHHC.js";
58
+ import "../taxpayer-BWpQOlug.js";
59
59
  import "../utils-C4FoVKLq.js";
60
60
  import "../index-CygwSf0x.js";
61
61
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ripwords/myinvois-client",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "MyInvois client",
5
5
  "scripts": {
6
6
  "build": "tsdown",
@@ -1 +0,0 @@
1
- {"version":3,"file":"document-DoQEvmcK.cjs","names":["item: InvoiceLineItem","doc: AllDocumentsV1_1","obj: unknown","sortedObj: Record<string, unknown>","invoice: AllDocumentsV1_1","invoices: AllDocumentsV1_1[]","invoice: InvoiceSubmission","certificatePem: string","X509Certificate","str: string","issuer: string","serialHex: string","error: unknown","certificateDigest: string","signingTime: string","issuerName: string","serialNumber: string","signedProperties: SignedPropertiesObject","useTargetWrapper: boolean","digestObj: unknown","docDigest: string","propsDigest: string","privateKeyPem: string","signedInfo: SignedInfoObject","documentString: string","signingCredentials: SigningCredentials","params: {\n itemClassificationCode: ClassificationCode\n itemDescription: string\n unitPrice: number\n quantity?: number\n taxType: TaxTypeCode\n taxRate: number\n totalTaxableAmountPerLine?: number\n discountAmount?: number\n discountRate?: number\n}","params: {\n itemClassificationCode: ClassificationCode\n itemDescription: string\n unitPrice: number\n quantity?: number\n taxType: TaxTypeCode\n taxPerUnitAmount: number\n baseUnitMeasure: number\n baseUnitMeasureCode: UnitTypeCode\n totalTaxableAmountPerLine?: number\n discountAmount?: number\n discountRate?: number\n}","lineItems: InvoiceLineItem[]","payableRoundingAmount: number"],"sources":["../src/utils/document.ts"],"sourcesContent":["import crypto, { X509Certificate } from 'crypto'\nimport {\n InvoiceSubmission,\n AllDocumentsV1_1,\n SigningCredentials,\n SignedPropertiesObject,\n UBLDocument,\n CompleteInvoice,\n SignedInfoObject,\n UnitTypeCode,\n InvoiceLineItem,\n} from '../types'\nimport type { ClassificationCode } from '../types'\nimport type { TaxTypeCode } from '../types'\nimport { formatIdValue } from './formatIdValue'\n\n/**\n * MyInvois v1.1 Document Generation and Signing Utilities\n * Strictly follows: https://sdk.myinvois.hasil.gov.my/documents/invoice-v1-1\n * JSON Signature Guide: https://sdk.myinvois.hasil.gov.my/signature-creation-json/\n */\n\n/**\n * Determines if a line item uses fixed rate taxation\n */\nexport const isFixedRateTax = (item: InvoiceLineItem): boolean => {\n return (\n item.taxPerUnitAmount !== undefined && item.baseUnitMeasure !== undefined\n )\n}\n\n/**\n * Determines if a line item uses percentage taxation\n */\nexport const isPercentageTax = (item: InvoiceLineItem): boolean => {\n return item.taxRate !== undefined && !isFixedRateTax(item)\n}\n\n/**\n * Calculates expected tax amount for a line item based on its tax type\n */\nexport const calculateExpectedTaxAmount = (item: InvoiceLineItem): number => {\n if (isFixedRateTax(item)) {\n return item.taxPerUnitAmount! * item.baseUnitMeasure!\n } else if (isPercentageTax(item)) {\n return (item.totalTaxableAmountPerLine * item.taxRate!) / 100\n }\n return 0\n}\n\n/**\n * Extracts the line-item array from any document variant\n */\nconst getLineItems = (doc: AllDocumentsV1_1): InvoiceLineItem[] => {\n if ('invoiceLineItems' in doc) return doc.invoiceLineItems\n if ('creditNoteLineItems' in doc) return doc.creditNoteLineItems\n if ('debitNoteLineItems' in doc) return doc.debitNoteLineItems\n if ('refundNoteLineItems' in doc) return doc.refundNoteLineItems\n if ('selfBilledCreditNoteLineItems' in doc)\n return doc.selfBilledCreditNoteLineItems\n if ('selfBilledRefundNoteLineItems' in doc)\n return doc.selfBilledRefundNoteLineItems\n // Fallback (should never happen with exhaustive types)\n return []\n}\n\n/**\n * Helper function to recursively sort object keys for JSON canonicalization\n */\nexport function sortObjectKeys(obj: unknown): unknown {\n if (obj === null || typeof obj !== 'object') {\n return obj\n }\n\n if (Array.isArray(obj)) {\n return obj.map(sortObjectKeys)\n }\n\n const sortedObj: Record<string, unknown> = {}\n const keys = Object.keys(obj as Record<string, unknown>).sort()\n\n for (const key of keys) {\n sortedObj[key] = sortObjectKeys((obj as Record<string, unknown>)[key])\n }\n\n return sortedObj\n}\n\n/**\n * Enhanced canonicalization following MyInvois specification exactly\n * Key changes: ensure consistent ordering and formatting\n */\nexport const canonicalizeJSON = (obj: unknown): string => {\n const sortedObj = sortObjectKeys(obj)\n // Use compact JSON with no extra whitespace\n return JSON.stringify(sortedObj, null, 0)\n}\n\n/**\n * Generates a clean invoice object following MyInvois v1.1 specification exactly\n * This is the base invoice structure WITHOUT signature elements (for hash calculation)\n *\n * Key requirements from working documents:\n * - All mandatory fields must be present\n * - Many optional fields must be present even if empty\n * - Specific field ordering and structure\n * - Correct listID values (e.g., \"3166-1\" not \"ISO3166-1\")\n */\nexport const generateCleanInvoiceObject = (\n invoice: AllDocumentsV1_1,\n): InvoiceSubmission => {\n const lineItems = getLineItems(invoice)\n return {\n // === MANDATORY CORE FIELDS ===\n ID: [{ _: invoice.eInvoiceCodeOrNumber }],\n IssueDate: [{ _: invoice.eInvoiceDate }],\n IssueTime: [{ _: invoice.eInvoiceTime }],\n InvoiceTypeCode: [\n {\n _: invoice.eInvoiceTypeCode,\n listVersionID: invoice.eInvoiceVersion || '1.1',\n },\n ],\n DocumentCurrencyCode: [{ _: invoice.invoiceCurrencyCode }],\n\n // === BILLING REFERENCE (only for credit/debit/refund notes) ===\n ...('originalEInvoiceReferenceNumber' in invoice &&\n 'originalEInvoiceInternalId' in invoice &&\n invoice.originalEInvoiceReferenceNumber\n ? {\n BillingReference: [\n {\n InvoiceDocumentReference: [\n {\n UUID: [\n {\n _: invoice.originalEInvoiceReferenceNumber,\n },\n ],\n ID: [\n {\n _: invoice.originalEInvoiceInternalId,\n },\n ],\n },\n ],\n },\n ],\n }\n : {}),\n\n // === SUPPLIER PARTY (AccountingSupplierParty) ===\n AccountingSupplierParty: [\n {\n Party: [\n {\n // Industry Classification - required field\n IndustryClassificationCode: [\n {\n _: invoice.supplier.industryClassificationCode,\n name: invoice.supplier.industryClassificationDescription,\n },\n ],\n\n // Party Identifications\n PartyIdentification: [\n {\n ID: [\n {\n _: invoice.supplier.tin,\n schemeID: 'TIN',\n },\n ],\n },\n {\n ID: [\n {\n _: formatIdValue(invoice.supplier.registrationNumber),\n schemeID: invoice.supplier.registrationType || 'NRIC',\n },\n ],\n },\n ],\n\n // Postal Address - FIXED listID format\n PostalAddress: [\n {\n CityName: [{ _: invoice.supplier.address.cityName }],\n CountrySubentityCode: [{ _: invoice.supplier.address.state }],\n AddressLine: [\n {\n Line: [{ _: invoice.supplier.address.addressLine0 }],\n },\n ],\n Country: [\n {\n IdentificationCode: [\n {\n _: invoice.supplier.address.country || 'MYS',\n listID: '3166-1', // FIXED: was \"ISO3166-1\"\n listAgencyID: 'ISO',\n },\n ],\n },\n ],\n },\n ],\n\n // Party Legal Entity\n PartyLegalEntity: [\n {\n RegistrationName: [{ _: invoice.supplier.name }],\n },\n ],\n\n // Contact Information\n Contact: [\n {\n Telephone: [{ _: invoice.supplier.contactNumber || '' }],\n },\n ],\n },\n ],\n },\n ],\n\n // === BUYER PARTY (AccountingCustomerParty) ===\n AccountingCustomerParty: [\n {\n Party: [\n {\n // Party Identifications\n PartyIdentification: [\n {\n ID: [\n {\n _: invoice.buyer.tin,\n schemeID: 'TIN',\n },\n ],\n },\n {\n ID: [\n {\n _: formatIdValue(invoice.buyer.registrationNumber),\n schemeID: invoice.buyer.registrationType || 'NRIC',\n },\n ],\n },\n {\n ID: [\n {\n _: invoice.buyer.sstRegistrationNumber || 'NA',\n schemeID: 'SST',\n },\n ],\n },\n ],\n\n // Postal Address - FIXED listID format\n PostalAddress: [\n {\n CityName: [{ _: invoice.buyer.address.cityName }],\n CountrySubentityCode: [{ _: invoice.buyer.address.state }],\n AddressLine: [\n {\n Line: [{ _: invoice.buyer.address.addressLine0 }],\n },\n ],\n Country: [\n {\n IdentificationCode: [\n {\n _: invoice.buyer.address.country || 'MYS',\n listID: '3166-1', // FIXED: was \"ISO3166-1\"\n listAgencyID: 'ISO',\n },\n ],\n },\n ],\n },\n ],\n\n // Party Legal Entity\n PartyLegalEntity: [\n {\n RegistrationName: [{ _: invoice.buyer.name }],\n },\n ],\n\n // Contact Information\n Contact: [\n {\n Telephone: [{ _: invoice.buyer.contactNumber || '' }],\n },\n ],\n },\n ],\n },\n ],\n\n // === TAX TOTAL ===\n TaxTotal: [\n {\n TaxAmount: [\n {\n _: invoice.taxTotal.taxAmount,\n currencyID: invoice.invoiceCurrencyCode,\n },\n ],\n TaxSubtotal: [\n // Generate basic tax subtotal from invoice line items\n {\n TaxableAmount: [\n {\n _: invoice.legalMonetaryTotal.taxExclusiveAmount,\n currencyID: invoice.invoiceCurrencyCode,\n },\n ],\n TaxAmount: [\n {\n _: invoice.taxTotal.taxAmount,\n currencyID: invoice.invoiceCurrencyCode,\n },\n ],\n TaxCategory: [\n {\n ID: [{ _: lineItems[0]?.taxType || '01' }],\n TaxScheme: [\n {\n ID: [\n {\n _: 'OTH',\n schemeAgencyID: '6',\n schemeID: 'UN/ECE 5153',\n },\n ],\n },\n ],\n },\n ],\n },\n ],\n },\n ],\n\n // === LEGAL MONETARY TOTAL ===\n LegalMonetaryTotal: [\n {\n LineExtensionAmount: [\n {\n _: invoice.legalMonetaryTotal.taxExclusiveAmount,\n currencyID: invoice.invoiceCurrencyCode,\n },\n ],\n TaxExclusiveAmount: [\n {\n _: invoice.legalMonetaryTotal.taxExclusiveAmount,\n currencyID: invoice.invoiceCurrencyCode,\n },\n ],\n TaxInclusiveAmount: [\n {\n _: invoice.legalMonetaryTotal.taxInclusiveAmount,\n currencyID: invoice.invoiceCurrencyCode,\n },\n ],\n PayableRoundingAmount: [\n {\n _: invoice.legalMonetaryTotal.payableRoundingAmount,\n currencyID: invoice.invoiceCurrencyCode,\n },\n ],\n PayableAmount: [\n {\n _: invoice.legalMonetaryTotal.payableAmount,\n currencyID: invoice.invoiceCurrencyCode,\n },\n ],\n },\n ],\n\n // === INVOICE LINES ===\n InvoiceLine: lineItems.map((item, index) => ({\n ID: [{ _: (index + 1).toString() }],\n\n // Item Information\n Item: [\n {\n CommodityClassification: [\n {\n ItemClassificationCode: [\n {\n _: item.itemClassificationCode,\n listID: 'CLASS',\n },\n ],\n },\n ],\n Description: [{ _: item.itemDescription }],\n },\n ],\n\n ItemPriceExtension: [\n {\n Amount: [\n {\n _:\n (item.totalTaxableAmountPerLine ?? 0) +\n (item.discountAmount ?? 0),\n currencyID: invoice.invoiceCurrencyCode,\n },\n ],\n },\n ],\n\n LineExtensionAmount: [\n {\n _: item.totalTaxableAmountPerLine,\n currencyID: invoice.invoiceCurrencyCode,\n },\n ],\n\n // Price Information\n Price: [\n {\n PriceAmount: [\n {\n _: item.unitPrice,\n currencyID: invoice.invoiceCurrencyCode,\n },\n ],\n },\n ],\n\n // Line-level discount (AllowanceCharge with ChargeIndicator=false) – include only if a discount exists\n ...(item.discountAmount !== undefined || item.discountRate !== undefined\n ? {\n AllowanceCharge: [\n {\n ChargeIndicator: [{ _: false }],\n Amount: [\n {\n _: item.discountAmount ?? 0,\n currencyID: invoice.invoiceCurrencyCode,\n },\n ],\n ...(item.discountRate !== undefined\n ? {\n MultiplierFactorNumeric: [{ _: item.discountRate }],\n BaseAmount: [\n {\n _:\n (item.totalTaxableAmountPerLine ?? 0) +\n (item.discountAmount ?? 0),\n currencyID: invoice.invoiceCurrencyCode,\n },\n ],\n }\n : {}),\n },\n ],\n }\n : {}),\n\n // Tax Information for line\n TaxTotal: [\n {\n TaxAmount: [\n {\n _: item.taxAmount,\n currencyID: invoice.invoiceCurrencyCode,\n },\n ],\n TaxSubtotal: [\n {\n TaxableAmount: [\n {\n _: item.totalTaxableAmountPerLine,\n currencyID: invoice.invoiceCurrencyCode,\n },\n ],\n TaxAmount: [\n {\n _: item.taxAmount,\n currencyID: invoice.invoiceCurrencyCode,\n },\n ],\n // Conditional tax fields based on taxation type\n ...(item.taxPerUnitAmount !== undefined &&\n item.baseUnitMeasure !== undefined\n ? {\n // Fixed Rate Taxation\n PerUnitAmount: [\n {\n _: item.taxPerUnitAmount,\n currencyID: invoice.invoiceCurrencyCode,\n },\n ],\n BaseUnitMeasure: [\n {\n _: item.baseUnitMeasure,\n unitCode: item.baseUnitMeasureCode || 'C62',\n },\n ],\n }\n : item.taxRate !== undefined\n ? {\n // Percentage Taxation\n Percent: [{ _: item.taxRate }],\n }\n : {}),\n TaxCategory: [\n {\n ID: [{ _: item.taxType }],\n TaxScheme: [\n {\n ID: [\n {\n _: 'OTH',\n schemeAgencyID: '6',\n schemeID: 'UN/ECE 5153',\n },\n ],\n },\n ],\n },\n ],\n },\n ],\n },\n ],\n })),\n\n // === TAX EXCHANGE RATE (mandatory where applicable) ===\n TaxExchangeRate: invoice.currencyExchangeRate\n ? [\n {\n SourceCurrencyCode: [\n {\n _: invoice.invoiceCurrencyCode,\n },\n ],\n TargetCurrencyCode: [\n {\n _: 'MYR',\n },\n ],\n CalculationRate: [\n {\n _: invoice.currencyExchangeRate,\n },\n ],\n },\n ]\n : undefined,\n }\n}\n\n/**\n * Generates the complete UBL document structure with namespace declarations\n */\nexport const generateCleanUBLDocument = (\n invoices: AllDocumentsV1_1[],\n): UBLDocument => {\n return {\n _D: 'urn:oasis:names:specification:ubl:schema:xsd:Invoice-2',\n _A: 'urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2',\n _B: 'urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2',\n Invoice: invoices.map(generateCleanInvoiceObject),\n }\n}\n\n/**\n * Step 1: Transform the document for hashing or transmission\n * Removes UBLExtensions and Signature, and minifies the JSON\n * Returns the minified, cleaned JSON string\n *\n * FIXED: Use regex-based minification to match PowerShell script exactly\n */\nexport const transformDocumentForHashing = (\n invoices: AllDocumentsV1_1[],\n): string => {\n // Generate clean UBL document structure\n const cleanDocument = generateCleanUBLDocument(invoices)\n\n // Deep clone to avoid mutating input\n const documentForTransform = JSON.parse(JSON.stringify(cleanDocument))\n if (\n documentForTransform.Invoice &&\n Array.isArray(documentForTransform.Invoice)\n ) {\n documentForTransform.Invoice.forEach((invoice: InvoiceSubmission) => {\n delete invoice.UBLExtensions\n delete invoice.Signature\n })\n }\n\n // Convert to JSON string first\n const jsonString = JSON.stringify(documentForTransform)\n\n // Apply the exact same regex-based minification as PowerShell script\n // This regex preserves whitespace within quoted strings but removes all other whitespace\n const minifiedJson = jsonString.replace(\n /(\"(?:\\\\.|[^\"\\\\])*\")|\\s+/g,\n (match, quotedString) => {\n if (quotedString) {\n return quotedString // Keep string content exactly as-is\n } else {\n return '' // Remove all other whitespace\n }\n },\n )\n\n return minifiedJson\n}\n\n/**\n * Step 2: Calculate Document Digest\n * FIXED: Remove UBLExtensions and Signature before hashing (DS322)\n * Based on working implementation pattern\n */\nexport const calculateDocumentDigest = (\n invoices: AllDocumentsV1_1[],\n): string => {\n // Use the transformation function to get the minified, cleaned JSON string\n const documentString = transformDocumentForHashing(invoices)\n\n // Calculate SHA-256 hash\n const hash = crypto.createHash('sha256')\n hash.update(documentString, 'utf8')\n\n // Return as Base64 (DocDigest)\n return hash.digest('base64')\n}\n\n/**\n * Step 4: Calculate Certificate Digest\n * Enhanced to handle certificate content properly\n * FIXED: Match PowerShell script exactly - use raw certificate data like $cert.RawData\n */\nexport const calculateCertificateDigest = (certificatePem: string): string => {\n try {\n // Create X509Certificate object to get raw data (like PowerShell $cert.RawData)\n const cert = new X509Certificate(certificatePem)\n\n // Get the raw certificate data (DER-encoded, like PowerShell $cert.RawData)\n const rawCertificateData = cert.raw\n\n // Calculate SHA-256 hash of raw certificate data (like PowerShell $sha256.ComputeHash($cert.RawData))\n const hash = crypto.createHash('sha256')\n hash.update(rawCertificateData)\n\n // Return as Base64 (like PowerShell [Convert]::ToBase64String($certHash))\n return hash.digest('base64')\n } catch {\n // Fallback to the previous method if X509Certificate fails\n const certificateContent = certificatePem\n .replace(/-----BEGIN CERTIFICATE-----/g, '')\n .replace(/-----END CERTIFICATE-----/g, '')\n .replace(/\\s+/g, '') // Remove all whitespace\n\n // Convert Base64 to binary\n const certificateBinary = Buffer.from(certificateContent, 'base64')\n\n // Calculate SHA-256 hash of binary content\n const hash = crypto.createHash('sha256')\n hash.update(certificateBinary)\n\n // Return as Base64\n return hash.digest('base64')\n }\n}\n\n/**\n * Enhanced certificate info extraction with better error handling\n * FIXED: Normalize issuer name format to match MyInvois expectations (DS326)\n */\nexport const extractCertificateInfo = (\n certificatePem: string,\n): {\n issuerName: string\n serialNumber: string\n subjectName: string\n} => {\n try {\n const cert = new X509Certificate(certificatePem)\n\n // Extract serial number and convert to decimal string\n const serialNumberHex = cert.serialNumber\n\n // FIXED: Use raw issuer name like PowerShell $cert.IssuerName.Name\n // Apply XML escaping to match PowerShell [System.Security.SecurityElement]::Escape()\n const escapeXmlSpecialChars = (str: string): string => {\n return str\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&apos;')\n }\n\n // FIXED: Normalize issuer name to match MyInvois expectations\n // The issuer name should be in the format: \"CN=Trial LHDNM Sub CA V1, OU=Terms of use at http://www.testcertcomp.com.my, O=LHDNM, C=MY\"\n const normalizeIssuerName = (issuer: string): string => {\n // Node returns issuer DN in reverse RDN order (C, O, ... , CN).\n // The MyInvois validator expects forward order (CN first).\n // 1. Break DN into components separated by newline or commas.\n // 2. Reverse to get CN → ... → C ordering.\n // 3. Join with \", \" and ensure single '=' spacing.\n const parts = issuer\n .split(/\\r?\\n|,\\s*/)\n .map(part => part.trim())\n .filter(part => part.length > 0)\n .reverse()\n return parts.join(', ').replace(/\\s*=\\s*/g, '=')\n }\n\n // Enhanced serial number formatting\n const formatSerialNumber = (serialHex: string): string => {\n // Convert hex to decimal and ensure it's a string\n const decimal = BigInt('0x' + serialHex).toString()\n return decimal\n }\n\n // FIXED: Use raw subject name without normalization to match PowerShell $cert.SubjectName.Name\n // The subject name should be in the format shown in the specification\n const rawSubjectName = cert.subject\n\n return {\n issuerName: escapeXmlSpecialChars(normalizeIssuerName(cert.issuer)),\n serialNumber: formatSerialNumber(serialNumberHex),\n subjectName: rawSubjectName, // Use raw subject name like PowerShell\n }\n } catch (error: unknown) {\n throw new Error(\n `Failed to extract certificate info: ${error instanceof Error ? error.message : String(error)}`,\n )\n }\n}\n\n/**\n * Step 5: Create SignedProperties with enhanced structure\n * FIXED: Simplified structure to match MyInvois expectations (DS320)\n * Following MyInvois JSON signature specification exactly\n */\nexport const createSignedProperties = (\n certificateDigest: string,\n signingTime: string,\n issuerName: string,\n serialNumber: string,\n): SignedPropertiesObject => {\n return {\n SignedProperties: [\n {\n Id: 'id-xades-signed-props',\n SignedSignatureProperties: [\n {\n SigningTime: [{ _: signingTime }],\n SigningCertificate: [\n {\n Cert: [\n {\n CertDigest: [\n {\n DigestMethod: [\n {\n _: '',\n Algorithm:\n 'http://www.w3.org/2001/04/xmlenc#sha256',\n },\n ],\n DigestValue: [{ _: certificateDigest }],\n },\n ],\n IssuerSerial: [\n {\n X509IssuerName: [{ _: issuerName }],\n X509SerialNumber: [{ _: serialNumber }],\n },\n ],\n },\n ],\n },\n ],\n },\n ],\n },\n ],\n }\n}\n\n/**\n * Step 6: Calculate SignedProperties Digest\n * Calculates the digest over the correct structure for validator compliance.\n * FIXED: Calculate digest from SignedProperties only (without Target wrapper)\n */\nexport const calculateSignedPropertiesDigest = (\n signedProperties: SignedPropertiesObject,\n useTargetWrapper: boolean = true, // Changed to true - validator calculates digest from embedded structure with Target wrapper\n): string => {\n let digestObj: unknown\n if (useTargetWrapper) {\n digestObj = {\n Target: 'signature',\n SignedProperties: signedProperties.SignedProperties,\n }\n } else {\n digestObj = signedProperties.SignedProperties\n }\n\n // FIXED: Don't sort object keys - use exact structure as embedded\n // The validator calculates digest from the exact embedded structure\n const signedPropertiesString = JSON.stringify(digestObj)\n\n // Apply the same regex-based minification as the document transformation\n const minifiedSignedProperties = signedPropertiesString.replace(\n /(\"(?:\\\\.|[^\"\\\\])*\")|\\s+/g,\n (match, quotedString) => {\n if (quotedString) {\n return quotedString // Keep string content exactly as-is\n } else {\n return '' // Remove all other whitespace\n }\n },\n )\n\n const hash = crypto.createHash('sha256')\n hash.update(minifiedSignedProperties, 'utf8')\n return hash.digest('base64')\n}\n\n/**\n * Step 3: Create SignedInfo and calculate signature\n * Enhanced with better structure and signature generation\n */\nexport const createSignedInfoAndSign = (\n docDigest: string,\n propsDigest: string,\n privateKeyPem: string,\n): { signedInfo: SignedInfoObject; signatureValue: string } => {\n // Create SignedInfo structure following specification exactly\n const signedInfo: SignedInfoObject = {\n CanonicalizationMethod: [\n {\n _: '',\n Algorithm: 'http://www.w3.org/2006/12/xml-c14n11',\n },\n ],\n SignatureMethod: [\n {\n _: '',\n Algorithm: 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256',\n },\n ],\n Reference: [\n {\n Id: 'id-doc-signed-data',\n Type: '',\n URI: '',\n DigestMethod: [\n {\n _: '',\n Algorithm: 'http://www.w3.org/2001/04/xmlenc#sha256',\n },\n ],\n DigestValue: [{ _: docDigest }],\n },\n {\n Id: 'id-xades-signed-props',\n Type: 'http://uri.etsi.org/01903/v1.3.2#SignedProperties',\n URI: '#id-xades-signed-props',\n DigestMethod: [\n {\n _: '',\n Algorithm: 'http://www.w3.org/2001/04/xmlenc#sha256',\n },\n ],\n DigestValue: [{ _: propsDigest }],\n },\n ],\n }\n\n // Serialize the SignedInfo exactly as it will be embedded (no reordering)\n const signedInfoRaw = JSON.stringify(signedInfo)\n\n try {\n const signer = crypto.createSign('RSA-SHA256')\n signer.update(signedInfoRaw, 'utf8')\n const signatureValue = signer.sign(privateKeyPem, 'base64')\n\n // Reuse the original object so ordering is preserved\n return { signedInfo, signatureValue }\n } catch (error) {\n throw new Error(\n `Signature generation failed: ${error instanceof Error ? error.message : String(error)}`,\n )\n }\n}\n\n/**\n * Signs the minified document string using the provided private key PEM\n * Returns the signature as a base64 string\n * FIXED: Match PowerShell script exactly - first compute hash, then sign the hash\n */\nexport const signDocumentString = (\n documentString: string,\n privateKeyPem: string,\n): string => {\n // Create signer with RSA-SHA256 (matches PowerShell RSAPKCS1SignatureFormatter)\n const signer = crypto.createSign('RSA-SHA256')\n signer.update(documentString, 'utf8')\n return signer.sign(privateKeyPem, 'base64')\n}\n\n/**\n * Complete document generation with signatures\n * Follows the complete MyInvois JSON signature creation process (Steps 1-7)\n */\nexport const generateCompleteDocument = (\n invoices: AllDocumentsV1_1[],\n signingCredentials: SigningCredentials,\n): CompleteInvoice => {\n try {\n // Step 1: Generate clean document (done in calculateDocumentDigest)\n // Step 2: Calculate document digest\n const docDigest = calculateDocumentDigest(invoices)\n\n // Get the minified, cleaned JSON string for signing\n const documentString = transformDocumentForHashing(invoices)\n\n // Step 3: Sign the minified document string (not the digest)\n const docSignature = signDocumentString(\n documentString,\n signingCredentials.privateKeyPem,\n )\n\n // Generate signing time in proper ISO format matching PowerShell exactly\n // PowerShell: Get-Date -Format \"yyyy-MM-ddTHH:mm:ssZ\"\n const now = new Date()\n const signingTime =\n now.getFullYear() +\n '-' +\n String(now.getMonth() + 1).padStart(2, '0') +\n '-' +\n String(now.getDate()).padStart(2, '0') +\n 'T' +\n String(now.getHours()).padStart(2, '0') +\n ':' +\n String(now.getMinutes()).padStart(2, '0') +\n ':' +\n String(now.getSeconds()).padStart(2, '0') +\n 'Z'\n\n // Extract certificate information (enhanced)\n const certInfo = extractCertificateInfo(signingCredentials.certificatePem)\n\n // Step 4: Calculate certificate digest\n const certificateDigest = calculateCertificateDigest(\n signingCredentials.certificatePem,\n )\n\n // Step 5: Create SignedProperties using extracted cert info\n const signedProperties = createSignedProperties(\n certificateDigest,\n signingTime,\n certInfo.issuerName,\n certInfo.serialNumber,\n )\n\n // Step 6: Calculate SignedProperties digest using the dedicated function\n const propsDigest = calculateSignedPropertiesDigest(signedProperties)\n\n // Create simple SignedInfo structure (matching PowerShell approach)\n const signedInfo: SignedInfoObject = {\n CanonicalizationMethod: [\n {\n _: '',\n Algorithm: 'http://www.w3.org/2006/12/xml-c14n11',\n },\n ],\n SignatureMethod: [\n {\n _: '',\n Algorithm: 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256',\n },\n ],\n Reference: [\n {\n Id: 'id-doc-signed-data',\n Type: '',\n URI: '',\n DigestMethod: [\n {\n _: '',\n Algorithm: 'http://www.w3.org/2001/04/xmlenc#sha256',\n },\n ],\n DigestValue: [{ _: docDigest }],\n },\n {\n Id: 'id-xades-signed-props',\n Type: 'http://uri.etsi.org/01903/v1.3.2#SignedProperties',\n URI: '#id-xades-signed-props',\n DigestMethod: [\n {\n _: '',\n Algorithm: 'http://www.w3.org/2001/04/xmlenc#sha256',\n },\n ],\n DigestValue: [{ _: propsDigest }],\n },\n ],\n }\n\n // Extract certificate content using raw data (like PowerShell $cert.RawData)\n const cert = new X509Certificate(signingCredentials.certificatePem)\n const certificate = cert.raw.toString('base64')\n\n // Step 7: Create final signed document\n const signedInvoices = invoices.map(invoice => {\n const cleanInvoice = generateCleanInvoiceObject(invoice)\n\n return {\n ...cleanInvoice,\n\n // Add UBLExtensions with complete signature structure\n UBLExtensions: [\n {\n UBLExtension: [\n {\n ExtensionURI: [\n {\n _: 'urn:oasis:names:specification:ubl:dsig:enveloped:xades',\n },\n ],\n ExtensionContent: [\n {\n UBLDocumentSignatures: [\n {\n SignatureInformation: [\n {\n ID: [\n {\n _: 'urn:oasis:names:specification:ubl:signature:1',\n },\n ],\n ReferencedSignatureID: [\n {\n _: 'urn:oasis:names:specification:ubl:signature:Invoice',\n },\n ],\n Signature: [\n {\n Id: 'signature',\n Object: [\n {\n QualifyingProperties: [\n {\n Target: 'signature',\n SignedProperties:\n signedProperties.SignedProperties,\n },\n ],\n },\n ],\n KeyInfo: [\n {\n X509Data: [\n {\n X509Certificate: [{ _: certificate }],\n X509SubjectName: [\n { _: certInfo.subjectName },\n ],\n X509IssuerSerial: [\n {\n X509IssuerName: [\n {\n _: certInfo.issuerName,\n },\n ],\n X509SerialNumber: [\n {\n _: certInfo.serialNumber,\n },\n ],\n },\n ],\n },\n ],\n },\n ],\n SignatureValue: [{ _: docSignature }],\n SignedInfo: [signedInfo],\n },\n ],\n },\n ],\n },\n ],\n },\n ],\n },\n ],\n },\n ],\n\n // Add simple Signature reference\n Signature: [\n {\n ID: [\n {\n _: 'urn:oasis:names:specification:ubl:signature:Invoice',\n },\n ],\n SignatureMethod: [\n {\n _: 'urn:oasis:names:specification:ubl:dsig:enveloped:xades',\n },\n ],\n },\n ],\n }\n })\n\n return {\n _D: 'urn:oasis:names:specification:ubl:schema:xsd:Invoice-2',\n _A: 'urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2',\n _B: 'urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2',\n Invoice: signedInvoices,\n }\n } catch (error) {\n throw new Error(\n `Document generation failed: ${error instanceof Error ? error.message : String(error)}`,\n )\n }\n}\n\n/**\n * Creates a line item with percentage-based taxation (e.g., SST, GST)\n */\nexport const createPercentageTaxLineItem = (params: {\n itemClassificationCode: ClassificationCode\n itemDescription: string\n unitPrice: number\n quantity?: number\n taxType: TaxTypeCode\n taxRate: number\n totalTaxableAmountPerLine?: number\n discountAmount?: number\n discountRate?: number\n}): InvoiceLineItem => {\n const quantity = params.quantity\n ? params.quantity <= 0\n ? 1\n : (params.quantity ?? 1)\n : 1\n // Compute pre-discount from unit price and quantity only to avoid double-discounting\n const preDiscountAmount = params.unitPrice * quantity\n const hasDiscount =\n params.discountAmount !== undefined || params.discountRate !== undefined\n const computedDiscountByRate =\n hasDiscount && params.discountRate !== undefined\n ? preDiscountAmount * params.discountRate\n : 0\n const discountAmount =\n hasDiscount && params.discountAmount !== undefined\n ? params.discountAmount\n : computedDiscountByRate\n const totalTaxableAmount = Math.max(\n 0,\n preDiscountAmount - (hasDiscount ? discountAmount : 0),\n )\n const taxAmount = (totalTaxableAmount * params.taxRate) / 100\n\n return {\n itemClassificationCode: params.itemClassificationCode,\n itemDescription: params.itemDescription,\n unitPrice: params.unitPrice,\n taxType: params.taxType,\n taxRate: params.taxRate,\n ...(hasDiscount && discountAmount !== undefined ? { discountAmount } : {}),\n ...(hasDiscount && params.discountRate !== undefined\n ? { discountRate: params.discountRate }\n : {}),\n taxAmount: Math.round(taxAmount * 100) / 100, // Round to 2 decimal places\n totalTaxableAmountPerLine: totalTaxableAmount,\n totalAmountPerLine: totalTaxableAmount + taxAmount,\n }\n}\n\n/**\n * Creates a line item with fixed rate taxation (e.g., Tourism Tax)\n */\nexport const createFixedRateTaxLineItem = (params: {\n itemClassificationCode: ClassificationCode\n itemDescription: string\n unitPrice: number\n quantity?: number\n taxType: TaxTypeCode\n taxPerUnitAmount: number\n baseUnitMeasure: number\n baseUnitMeasureCode: UnitTypeCode\n totalTaxableAmountPerLine?: number\n discountAmount?: number\n discountRate?: number\n}): InvoiceLineItem => {\n const quantity = params.quantity || 1\n // Compute pre-discount from unit price and quantity only to avoid double-discounting\n const preDiscountAmount = params.unitPrice * quantity\n const hasDiscount =\n params.discountAmount !== undefined || params.discountRate !== undefined\n const computedDiscountByRate =\n hasDiscount && params.discountRate !== undefined\n ? preDiscountAmount * params.discountRate\n : 0\n const discountAmount =\n hasDiscount && params.discountAmount !== undefined\n ? params.discountAmount\n : computedDiscountByRate\n const totalTaxableAmount = Math.max(\n 0,\n preDiscountAmount - (hasDiscount ? discountAmount : 0),\n )\n const taxAmount = params.taxPerUnitAmount * params.baseUnitMeasure\n\n return {\n itemClassificationCode: params.itemClassificationCode,\n itemDescription: params.itemDescription,\n unitPrice: params.unitPrice,\n taxType: params.taxType,\n taxPerUnitAmount: params.taxPerUnitAmount,\n baseUnitMeasure: params.baseUnitMeasure,\n baseUnitMeasureCode: params.baseUnitMeasureCode,\n ...(hasDiscount && discountAmount !== undefined ? { discountAmount } : {}),\n ...(hasDiscount && params.discountRate !== undefined\n ? { discountRate: params.discountRate }\n : {}),\n taxAmount: Math.round(taxAmount * 100) / 100, // Round to 2 decimal places\n totalTaxableAmountPerLine: totalTaxableAmount,\n totalAmountPerLine: totalTaxableAmount + taxAmount,\n }\n}\n\n/**\n * Calculates invoice totals from line items\n */\nexport const calculateInvoiceTotals = (\n lineItems: InvoiceLineItem[],\n payableRoundingAmount: number = 0,\n): {\n legalMonetaryTotal: {\n taxExclusiveAmount: number\n taxInclusiveAmount: number\n payableRoundingAmount: number\n payableAmount: number\n }\n taxTotal: {\n taxAmount: number\n }\n} => {\n const taxExclusiveAmount = lineItems.reduce(\n (sum, item) => sum + item.totalTaxableAmountPerLine,\n 0,\n )\n const totalTaxAmount = lineItems.reduce(\n (sum, item) => sum + item.taxAmount,\n 0,\n )\n const taxInclusiveAmount = taxExclusiveAmount + totalTaxAmount\n const payableAmount = taxInclusiveAmount + payableRoundingAmount\n\n return {\n legalMonetaryTotal: {\n taxExclusiveAmount: Math.round(taxExclusiveAmount * 100) / 100,\n taxInclusiveAmount: Math.round(taxInclusiveAmount * 100) / 100,\n payableRoundingAmount: Math.round(payableRoundingAmount * 100) / 100,\n payableAmount: Math.round(payableAmount * 100) / 100,\n },\n taxTotal: {\n taxAmount: Math.round(totalTaxAmount * 100) / 100,\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAyBA,MAAa,iBAAiB,CAACA,SAAmC;AAChE,QACE,KAAK,+BAAkC,KAAK;AAE/C;;;;AAKD,MAAa,kBAAkB,CAACA,SAAmC;AACjE,QAAO,KAAK,uBAA0B,eAAe,KAAK;AAC3D;;;;AAKD,MAAa,6BAA6B,CAACA,SAAkC;AAC3E,KAAI,eAAe,KAAK,CACtB,QAAO,KAAK,mBAAoB,KAAK;UAC5B,gBAAgB,KAAK,CAC9B,QAAQ,KAAK,4BAA4B,KAAK,UAAY;AAE5D,QAAO;AACR;;;;AAKD,MAAM,eAAe,CAACC,QAA6C;AACjE,KAAI,sBAAsB,IAAK,QAAO,IAAI;AAC1C,KAAI,yBAAyB,IAAK,QAAO,IAAI;AAC7C,KAAI,wBAAwB,IAAK,QAAO,IAAI;AAC5C,KAAI,yBAAyB,IAAK,QAAO,IAAI;AAC7C,KAAI,mCAAmC,IACrC,QAAO,IAAI;AACb,KAAI,mCAAmC,IACrC,QAAO,IAAI;AAEb,QAAO,CAAE;AACV;;;;AAKD,SAAgB,eAAeC,KAAuB;AACpD,KAAI,QAAQ,eAAe,QAAQ,SACjC,QAAO;AAGT,KAAI,MAAM,QAAQ,IAAI,CACpB,QAAO,IAAI,IAAI,eAAe;CAGhC,MAAMC,YAAqC,CAAE;CAC7C,MAAM,OAAO,OAAO,KAAK,IAA+B,CAAC,MAAM;AAE/D,MAAK,MAAM,OAAO,KAChB,WAAU,OAAO,eAAgB,IAAgC,KAAK;AAGxE,QAAO;AACR;;;;;AAMD,MAAa,mBAAmB,CAACD,QAAyB;CACxD,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AAY,OAAO,mBAAmB,OAAO;AAEnD,QAAO;EACL,wBAAwB,OAAO;EAC/B,iBAAiB,OAAO;EACxB,WAAW,OAAO;EAClB,SAAS,OAAO;EAChB,kBAAkB,OAAO;EACzB,iBAAiB,OAAO;EACxB,qBAAqB,OAAO;EAC5B,GAAI,eAAe,4BAA+B,EAAE,eAAgB,IAAG,CAAE;EACzE,GAAI,eAAe,OAAO,0BACtB,EAAE,cAAc,OAAO,aAAc,IACrC,CAAE;EACN,WAAW,KAAK,MAAM,YAAY,IAAI,GAAG;EACzC,2BAA2B;EAC3B,oBAAoB,qBAAqB;CAC1C;AACF;;;;AAKD,MAAa,yBAAyB,CACpCC,WACAC,wBAAgC,MAW7B;CACH,MAAM,qBAAqB,UAAU,OACnC,CAAC,KAAK,SAAS,MAAM,KAAK,2BAC1B,EACD;CACD,MAAM,iBAAiB,UAAU,OAC/B,CAAC,KAAK,SAAS,MAAM,KAAK,WAC1B,EACD;CACD,MAAM,qBAAqB,qBAAqB;CAChD,MAAM,gBAAgB,qBAAqB;AAE3C,QAAO;EACL,oBAAoB;GAClB,oBAAoB,KAAK,MAAM,qBAAqB,IAAI,GAAG;GAC3D,oBAAoB,KAAK,MAAM,qBAAqB,IAAI,GAAG;GAC3D,uBAAuB,KAAK,MAAM,wBAAwB,IAAI,GAAG;GACjE,eAAe,KAAK,MAAM,gBAAgB,IAAI,GAAG;EAClD;EACD,UAAU,EACR,WAAW,KAAK,MAAM,iBAAiB,IAAI,GAAG,IAC/C;CACF;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"documentManagement-CyPwiyP4.cjs","names":["context: DocumentContext","documentUid: string","params: {\n uuid?: string\n submissionDateFrom: string\n submissionDateTo?: string\n pageSize?: number\n pageNo?: number\n issueDateFrom?: string\n issueDateTo?: string\n invoiceDirection?: 'Sent' | 'Received'\n status?: DocumentStatus\n documentType?: EInvoiceTypeCode\n searchQuery?: string\n }","doc: DocumentSummary & { longID: string }"],"sources":["../src/api/documentManagement.ts"],"sourcesContent":["import type {\n DocumentSummary,\n DocumentStatus,\n EInvoiceTypeCode,\n DocumentValidationResult,\n DocumentValidationStepResult,\n Fetch,\n} from '../types'\n\ninterface DocumentContext {\n fetch: Fetch\n}\n\nexport async function getDocument(\n context: DocumentContext,\n documentUid: string,\n): Promise<DocumentSummary & { document: string }> {\n const { fetch } = context\n\n const response = await fetch(`/api/v1.0/documents/${documentUid}/raw`)\n const data = await response.json()\n\n return { ...data, longId: data.longID ?? data.longId } as DocumentSummary & {\n document: string\n }\n}\n\nexport async function getDocumentDetails(\n context: DocumentContext,\n documentUid: string,\n): Promise<\n DocumentSummary & {\n validationResults: {\n status: DocumentValidationResult\n validationSteps: DocumentValidationStepResult[]\n }\n }\n> {\n const { fetch } = context\n\n const response = await fetch(`/api/v1.0/documents/${documentUid}/details`)\n const data = await response.json()\n const resp = {\n ...data,\n longId: data.longID ?? data.longId,\n } as DocumentSummary & {\n validationResults: {\n status: DocumentValidationResult\n validationSteps: DocumentValidationStepResult[]\n }\n }\n\n return resp\n}\n\nexport async function searchDocuments(\n context: DocumentContext,\n params: {\n uuid?: string\n submissionDateFrom: string\n submissionDateTo?: string\n pageSize?: number\n pageNo?: number\n issueDateFrom?: string\n issueDateTo?: string\n invoiceDirection?: 'Sent' | 'Received'\n status?: DocumentStatus\n documentType?: EInvoiceTypeCode\n searchQuery?: string\n },\n): Promise<DocumentSummary[]> {\n const { fetch } = context\n const {\n uuid,\n submissionDateFrom,\n submissionDateTo,\n pageSize,\n pageNo,\n issueDateFrom,\n issueDateTo,\n invoiceDirection,\n status,\n documentType,\n searchQuery,\n } = params\n\n const queryParams = new URLSearchParams()\n\n if (uuid) queryParams.set('uuid', uuid)\n if (submissionDateFrom)\n queryParams.set('submissionDateFrom', submissionDateFrom)\n if (submissionDateTo) queryParams.set('submissionDateTo', submissionDateTo)\n if (pageSize) queryParams.set('pageSize', pageSize.toString())\n if (pageNo) queryParams.set('pageNo', pageNo.toString())\n if (issueDateFrom) queryParams.set('issueDateFrom', issueDateFrom)\n if (issueDateTo) queryParams.set('issueDateTo', issueDateTo)\n if (invoiceDirection) queryParams.set('invoiceDirection', invoiceDirection)\n if (status) queryParams.set('status', status)\n if (documentType) queryParams.set('documentType', documentType)\n if (searchQuery) queryParams.set('searchQuery', searchQuery)\n\n const response = await fetch(\n `/api/v1.0/documents/search?${queryParams.toString()}`,\n )\n\n const data = await response.json()\n\n return data.map((doc: DocumentSummary & { longID: string }) => ({\n ...doc,\n longId: doc.longID ?? doc.longId,\n })) as DocumentSummary[]\n}\n"],"mappings":";;AAaA,eAAsB,YACpBA,SACAC,aACiD;CACjD,MAAM,EAAE,OAAO,GAAG;CAElB,MAAM,WAAW,MAAM,OAAO,sBAAsB,YAAY,MAAM;CACtE,MAAM,OAAO,MAAM,SAAS,MAAM;AAElC,QAAO;EAAE,GAAG;EAAM,QAAQ,KAAK,UAAU,KAAK;CAAQ;AAGvD;AAED,eAAsB,mBACpBD,SACAC,aAQA;CACA,MAAM,EAAE,OAAO,GAAG;CAElB,MAAM,WAAW,MAAM,OAAO,sBAAsB,YAAY,UAAU;CAC1E,MAAM,OAAO,MAAM,SAAS,MAAM;CAClC,MAAM,OAAO;EACX,GAAG;EACH,QAAQ,KAAK,UAAU,KAAK;CAC7B;AAOD,QAAO;AACR;AAED,eAAsB,gBACpBD,SACAE,QAa4B;CAC5B,MAAM,EAAE,OAAO,GAAG;CAClB,MAAM,EACJ,MACA,oBACA,kBACA,UACA,QACA,eACA,aACA,kBACA,QACA,cACA,aACD,GAAG;CAEJ,MAAM,cAAc,IAAI;AAExB,KAAI,KAAM,aAAY,IAAI,QAAQ,KAAK;AACvC,KAAI,mBACF,aAAY,IAAI,sBAAsB,mBAAmB;AAC3D,KAAI,iBAAkB,aAAY,IAAI,oBAAoB,iBAAiB;AAC3E,KAAI,SAAU,aAAY,IAAI,YAAY,SAAS,UAAU,CAAC;AAC9D,KAAI,OAAQ,aAAY,IAAI,UAAU,OAAO,UAAU,CAAC;AACxD,KAAI,cAAe,aAAY,IAAI,iBAAiB,cAAc;AAClE,KAAI,YAAa,aAAY,IAAI,eAAe,YAAY;AAC5D,KAAI,iBAAkB,aAAY,IAAI,oBAAoB,iBAAiB;AAC3E,KAAI,OAAQ,aAAY,IAAI,UAAU,OAAO;AAC7C,KAAI,aAAc,aAAY,IAAI,gBAAgB,aAAa;AAC/D,KAAI,YAAa,aAAY,IAAI,eAAe,YAAY;CAE5D,MAAM,WAAW,MAAM,OACpB,6BAA6B,YAAY,UAAU,CAAC,EACtD;CAED,MAAM,OAAO,MAAM,SAAS,MAAM;AAElC,QAAO,KAAK,IAAI,CAACC,SAA+C;EAC9D,GAAG;EACH,QAAQ,IAAI,UAAU,IAAI;CAC3B,GAAE;AACJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index10.cjs","names":[],"sources":["../src/types/payment-modes.d.ts"],"sourcesContent":["/**\n * Represents the allowed codes for payment modes.\n * Based on the documentation: https://sdk.myinvois.hasil.gov.my/codes/payment-methods/\n */\nexport type PaymentModeCode =\n | '01' // Cash\n | '02' // Cheque\n | '03' // Bank Transfer\n | '04' // Credit Card\n | '05' // Debit Card\n | '06' // e-Wallet / Digital Wallet\n | '07' // Digital Bank\n | '08' // Others\n\n/**\n * Enum representing the allowed payment mode codes with descriptive names.\n * Provides a more readable way to reference payment modes.\n *\n * @example\n * const mode = PaymentModeCodeEnum.Cash;\n * console.log(mode); // Output: \"01\"\n */\nexport enum PaymentModeCodeEnum {\n Cash = '01',\n Cheque = '02',\n BankTransfer = '03',\n CreditCard = '04',\n DebitCard = '05',\n EWalletDigitalWallet = '06',\n DigitalBank = '07',\n Others = '08',\n}\n\n/**\n * Interface representing a payment mode entry.\n * Contains the code and its corresponding description.\n */\nexport interface PaymentMode {\n code: PaymentModeCode\n description: string\n}\n"],"mappings":";;;;;;;;;;AAsBA,IAAY,sEAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index12.cjs","names":[],"sources":["../src/types/state-codes.d.ts"],"sourcesContent":["/**\n * Represents the allowed codes for Malaysian states and federal territories.\n * Based on the documentation: https://sdk.myinvois.hasil.gov.my/codes/state-codes/\n */\nexport type StateCode =\n | '01' // Johor\n | '02' // Kedah\n | '03' // Kelantan\n | '04' // Melaka\n | '05' // Negeri Sembilan\n | '06' // Pahang\n | '07' // Pulau Pinang\n | '08' // Perak\n | '09' // Perlis\n | '10' // Selangor\n | '11' // Terengganu\n | '12' // Sabah\n | '13' // Sarawak\n | '14' // Wilayah Persekutuan Kuala Lumpur\n | '15' // Wilayah Persekutuan Labuan\n | '16' // Wilayah Persekutuan Putrajaya\n | '17' // Not Applicable\n\n/**\n * Enum representing the allowed state codes with descriptive names.\n * Provides a more readable way to reference states.\n *\n * @example\n * const code = StateCodeEnum.Selangor;\n * console.log(code); // Output: \"10\"\n */\nexport enum StateCodeEnum {\n Johor = '01',\n Kedah = '02',\n Kelantan = '03',\n Melaka = '04',\n NegeriSembilan = '05',\n Pahang = '06',\n PulauPinang = '07',\n Perak = '08',\n Perlis = '09',\n Selangor = '10',\n Terengganu = '11',\n Sabah = '12',\n Sarawak = '13',\n WPKualaLumpur = '14',\n WPLabuan = '15',\n WPPutrajaya = '16',\n NotApplicable = '17',\n}\n\n/**\n * Interface representing a state code entry.\n * Contains the code and its corresponding name.\n */\nexport interface State {\n code: StateCode\n name: string\n}\n"],"mappings":";;;;;;;;;;AA+BA,IAAY,0DAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index13.cjs","names":[],"sources":["../src/types/tax-types.d.ts"],"sourcesContent":["/**\n * Represents the allowed codes for tax types.\n * Based on the documentation: https://sdk.myinvois.hasil.gov.my/codes/tax-types/\n */\nexport type TaxTypeCode =\n | '01' // Sales Tax\n | '02' // Service Tax\n | '03' // Tourism Tax\n | '04' // High-Value Goods Tax\n | '05' // Sales Tax on Low Value Goods\n | '06' // Not Applicable\n | 'E' // Tax exemption (where applicable)\n\n/**\n * Enum representing the allowed tax type codes with descriptive names.\n * Provides a more readable way to reference tax types.\n *\n * @example\n * const code = TaxTypeCodeEnum.SalesTax;\n * console.log(code); // Output: \"01\"\n */\nexport enum TaxTypeCodeEnum {\n SalesTax = '01',\n ServiceTax = '02',\n TourismTax = '03',\n HighValueGoodsTax = '04',\n SalesTaxLowValueGoods = '05',\n NotApplicable = '06',\n TaxExemption = 'E',\n}\n\n/**\n * Interface representing a tax type entry.\n * Contains the code and its corresponding description.\n */\nexport interface TaxType {\n code: TaxTypeCode\n description: string\n}\n"],"mappings":";;;;;;;;;;AAqBA,IAAY,8DAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AACD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index2.cjs","names":[],"sources":["../src/types/classification-codes.d.ts"],"sourcesContent":["/**\n * Represents the allowed classification codes for e-Invoice items.\n * Based on the documentation: https://sdk.myinvois.hasil.gov.my/codes/classification-codes/\n */\nexport type ClassificationCode =\n | '001' // Breastfeeding equipment\n | '002' // Child care centres and kindergartens fees\n | '003' // Computer, smartphone or tablet\n | '004' // Consolidated e-Invoice\n | '005' // Construction materials (as specified under Fourth Schedule of the Lembaga Pembangunan Industri Pembinaan Malaysia Act 1994)\n | '006' // Disbursement\n | '007' // Donation\n | '008' // e-Commerce - e-Invoice to buyer / purchaser\n | '009' // e-Commerce - Self-billed e-Invoice to seller, logistics, etc.\n | '010' // Education fees\n | '011' // Goods on consignment (Consignor)\n | '012' // Goods on consignment (Consignee)\n | '013' // Gym membership\n | '014' // Insurance - Education and medical benefits\n | '015' // Insurance - Takaful or life insurance\n | '016' // Interest and financing expenses\n | '017' // Internet subscription\n | '018' // Land and building\n | '019' // Medical examination for learning disabilities and early intervention or rehabilitation treatments of learning disabilities\n | '020' // Medical examination or vaccination expenses\n | '021' // Medical expenses for serious diseases\n | '022' // Others\n | '023' // Petroleum operations (as defined in Petroleum (Income Tax) Act 1967)\n | '024' // Private retirement scheme or deferred annuity scheme\n | '025' // Motor vehicle\n | '026' // Subscription of books / journals / magazines / newspapers / other similar publications\n | '027' // Reimbursement\n | '028' // Rental of motor vehicle\n | '029' // EV charging facilities (Installation, rental, sale / purchase or subscription fees)\n | '030' // Repair and maintenance\n | '031' // Research and development\n | '032' // Foreign income\n | '033' // Self-billed - Betting and gaming\n | '034' // Self-billed - Importation of goods\n | '035' // Self-billed - Importation of services\n | '036' // Self-billed - Others\n | '037' // Self-billed - Monetary payment to agents, dealers or distributors\n | '038' // Sports equipment, rental / entry fees for sports facilities, registration in sports competition or sports training fees imposed by associations / sports clubs / companies registered with the Sports Commissioner or Companies Commission of Malaysia and carrying out sports activities as listed under the Sports Development Act 1997\n | '039' // Supporting equipment for disabled person\n | '040' // Voluntary contribution to approved provident fund\n | '041' // Dental examination or treatment\n | '042' // Fertility treatment\n | '043' // Treatment and home care nursing, daycare centres and residential care centers\n | '044' // Vouchers, gift cards, loyalty points, etc\n | '045' // Self-billed - Non-monetary payment to agents, dealers or distributors\n\n/**\n * Enum representing the allowed classification codes with descriptive names.\n * Provides a more readable way to reference classification codes.\n *\n * @example\n * const code = ClassificationCodeEnum.ComputerSmartphoneOrTablet;\n * console.log(code); // Output: \"003\"\n */\nexport enum ClassificationCodeEnum {\n BreastfeedingEquipment = '001',\n ChildCareCentresAndKindergartensFees = '002',\n ComputerSmartphoneOrTablet = '003',\n ConsolidatedEInvoice = '004',\n ConstructionMaterials = '005',\n Disbursement = '006',\n Donation = '007',\n ECommerceEInvoiceToBuyer = '008',\n ECommerceSelfBilledToSellerLogistics = '009',\n EducationFees = '010',\n GoodsOnConsignmentConsignor = '011',\n GoodsOnConsignmentConsignee = '012',\n GymMembership = '013',\n InsuranceEducationMedicalBenefits = '014',\n InsuranceTakafulLife = '015',\n InterestFinancingExpenses = '016',\n InternetSubscription = '017',\n LandAndBuilding = '018',\n MedicalExamLearningDisabilities = '019',\n MedicalExamVaccination = '020',\n MedicalExpensesSeriousDiseases = '021',\n Others = '022',\n PetroleumOperations = '023',\n PrivateRetirementSchemeDeferredAnnuity = '024',\n MotorVehicle = '025',\n SubscriptionBooksJournalsEtc = '026',\n Reimbursement = '027',\n RentalOfMotorVehicle = '028',\n EVChargingFacilities = '029',\n RepairAndMaintenance = '030',\n ResearchAndDevelopment = '031',\n ForeignIncome = '032',\n SelfBilledBettingGaming = '033',\n SelfBilledImportationGoods = '034',\n SelfBilledImportationServices = '035',\n SelfBilledOthers = '036',\n SelfBilledMonetaryPaymentToAgents = '037',\n SportsEquipmentRentalFeesEtc = '038',\n SupportingEquipmentDisabledPerson = '039',\n VoluntaryContributionProvidentFund = '040',\n DentalExamTreatment = '041',\n FertilityTreatment = '042',\n TreatmentHomeCareNursingEtc = '043',\n VouchersGiftCardsLoyaltyPoints = '044',\n SelfBilledNonMonetaryPaymentToAgents = '045',\n}\n\n/**\n * Interface representing a classification code entry.\n * Contains the code and its corresponding description.\n */\nexport interface Classification {\n code: ClassificationCode\n description: string\n}\n"],"mappings":";;;;;;;;;;AA2DA,IAAY,4EAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index3.cjs","names":[],"sources":["../src/types/country-code.d.ts"],"sourcesContent":["/**\n * Represents the allowed ISO-3166 alpha-3 country codes.\n * Based on the documentation: https://sdk.myinvois.hasil.gov.my/codes/countries/\n */\nexport type CountryCode =\n | \"ABW\"\n | \"AFG\"\n | \"AGO\"\n | \"AIA\"\n | \"ALA\"\n | \"ALB\"\n | \"AND\"\n | \"ANT\"\n | \"ARE\"\n | \"ARG\"\n | \"ARM\"\n | \"ASM\"\n | \"ATA\"\n | \"ATF\"\n | \"ATG\"\n | \"AUS\"\n | \"AUT\"\n | \"AZE\"\n | \"BDI\"\n | \"BEL\"\n | \"BEN\"\n | \"BES\"\n | \"BFA\"\n | \"BGD\"\n | \"BGR\"\n | \"BHR\"\n | \"BHS\"\n | \"BIH\"\n | \"BLM\"\n | \"BLR\"\n | \"BLZ\"\n | \"BMU\"\n | \"BOL\"\n | \"BRA\"\n | \"BRB\"\n | \"BRN\"\n | \"BTN\"\n | \"BVT\"\n | \"BWA\"\n | \"CAF\"\n | \"CAN\"\n | \"CCK\"\n | \"CHE\"\n | \"CHL\"\n | \"CHN\"\n | \"CIV\"\n | \"CMR\"\n | \"COD\"\n | \"COG\"\n | \"COK\"\n | \"COL\"\n | \"COM\"\n | \"CPV\"\n | \"CRI\"\n | \"CUB\"\n | \"CUW\"\n | \"CXR\"\n | \"CYM\"\n | \"CYP\"\n | \"CZE\"\n | \"DEU\"\n | \"DJI\"\n | \"DMA\"\n | \"DNK\"\n | \"DOM\"\n | \"DZA\"\n | \"ECU\"\n | \"EGY\"\n | \"ERI\"\n | \"ESH\"\n | \"ESP\"\n | \"EST\"\n | \"ETH\"\n | \"FIN\"\n | \"FJI\"\n | \"FLK\"\n | \"FRA\"\n | \"FRO\"\n | \"FSM\"\n | \"GAB\"\n | \"GBR\"\n | \"GEO\"\n | \"GGY\"\n | \"GHA\"\n | \"GIB\"\n | \"GIN\"\n | \"GLP\"\n | \"GMB\"\n | \"GNB\"\n | \"GNQ\"\n | \"GRC\"\n | \"GRD\"\n | \"GRL\"\n | \"GTM\"\n | \"GUF\"\n | \"GUM\"\n | \"GUY\"\n | \"HKG\"\n | \"HMD\"\n | \"HND\"\n | \"HRV\"\n | \"HTI\"\n | \"HUN\"\n | \"IDN\"\n | \"IMN\"\n | \"IND\"\n | \"IOT\"\n | \"IRL\"\n | \"IRN\"\n | \"IRQ\"\n | \"ISL\"\n | \"ISR\"\n | \"ITA\"\n | \"JAM\"\n | \"JEY\"\n | \"JOR\"\n | \"JPN\"\n | \"KAZ\"\n | \"KEN\"\n | \"KGZ\"\n | \"KHM\"\n | \"KIR\"\n | \"KNA\"\n | \"KOR\"\n | \"KWT\"\n | \"LAO\"\n | \"LBN\"\n | \"LBR\"\n | \"LBY\"\n | \"LCA\"\n | \"LIE\"\n | \"LKA\"\n | \"LSO\"\n | \"LTU\"\n | \"LUX\"\n | \"LVA\"\n | \"MAC\"\n | \"MAF\"\n | \"MAR\"\n | \"MCO\"\n | \"MDA\"\n | \"MDG\"\n | \"MDV\"\n | \"MEX\"\n | \"MHL\"\n | \"MKD\"\n | \"MLI\"\n | \"MLT\"\n | \"MMR\"\n | \"MNE\"\n | \"MNG\"\n | \"MNP\"\n | \"MOZ\"\n | \"MRT\"\n | \"MSR\"\n | \"MTQ\"\n | \"MUS\"\n | \"MWI\"\n | \"MYS\"\n | \"MYT\"\n | \"NAM\"\n | \"NCL\"\n | \"NER\"\n | \"NFK\"\n | \"NGA\"\n | \"NIC\"\n | \"NIU\"\n | \"NLD\"\n | \"NOR\"\n | \"NPL\"\n | \"NRU\"\n | \"NZL\"\n | \"OMN\"\n | \"PAK\"\n | \"PAN\"\n | \"PCN\"\n | \"PER\"\n | \"PHL\"\n | \"PLW\"\n | \"PNG\"\n | \"POL\"\n | \"PRI\"\n | \"PRK\"\n | \"PRT\"\n | \"PRY\"\n | \"PSE\"\n | \"PYF\"\n | \"QAT\"\n | \"REU\"\n | \"ROU\"\n | \"RUS\"\n | \"RWA\"\n | \"SAU\"\n | \"SDN\"\n | \"SEN\"\n | \"SGP\"\n | \"SGS\"\n | \"SHN\"\n | \"SJM\"\n | \"SLB\"\n | \"SLE\"\n | \"SLV\"\n | \"SMR\"\n | \"SOM\"\n | \"SPM\"\n | \"SRB\"\n | \"SSD\"\n | \"STP\"\n | \"SUR\"\n | \"SVK\"\n | \"SVN\"\n | \"SWE\"\n | \"SWZ\"\n | \"SXM\"\n | \"SYC\"\n | \"SYR\"\n | \"TCA\"\n | \"TCD\"\n | \"TGO\"\n | \"THA\"\n | \"TJK\"\n | \"TKL\"\n | \"TKM\"\n | \"TLS\"\n | \"TON\"\n | \"TTO\"\n | \"TUN\"\n | \"TUR\"\n | \"TUV\"\n | \"TWN\"\n | \"TZA\"\n | \"UGA\"\n | \"UKR\"\n | \"UMI\"\n | \"URY\"\n | \"USA\"\n | \"UZB\"\n | \"VAT\"\n | \"VCT\"\n | \"VEN\"\n | \"VGB\"\n | \"VIR\"\n | \"VNM\"\n | \"VUT\"\n | \"WLF\"\n | \"WSM\"\n | \"XKX\"\n | \"YEM\"\n | \"ZAF\"\n | \"ZMB\"\n | \"ZWE\"\n\n/**\n * Enum representing the allowed ISO-3166 alpha-3 country codes.\n * Provides a more readable way to reference country codes.\n *\n * @example\n * const malaysiaCode = CountryCodeEnum.MYS;\n * console.log(malaysiaCode); // Output: \"MYS\"\n */\nexport enum CountryCodeEnum {\n ABW = \"ABW\",\n AFG = \"AFG\",\n AGO = \"AGO\",\n AIA = \"AIA\",\n ALA = \"ALA\",\n ALB = \"ALB\",\n AND = \"AND\",\n ANT = \"ANT\",\n ARE = \"ARE\",\n ARG = \"ARG\",\n ARM = \"ARM\",\n ASM = \"ASM\",\n ATA = \"ATA\",\n ATF = \"ATF\",\n ATG = \"ATG\",\n AUS = \"AUS\",\n AUT = \"AUT\",\n AZE = \"AZE\",\n BDI = \"BDI\",\n BEL = \"BEL\",\n BEN = \"BEN\",\n BES = \"BES\",\n BFA = \"BFA\",\n BGD = \"BGD\",\n BGR = \"BGR\",\n BHR = \"BHR\",\n BHS = \"BHS\",\n BIH = \"BIH\",\n BLM = \"BLM\",\n BLR = \"BLR\",\n BLZ = \"BLZ\",\n BMU = \"BMU\",\n BOL = \"BOL\",\n BRA = \"BRA\",\n BRB = \"BRB\",\n BRN = \"BRN\",\n BTN = \"BTN\",\n BVT = \"BVT\",\n BWA = \"BWA\",\n CAF = \"CAF\",\n CAN = \"CAN\",\n CCK = \"CCK\",\n CHE = \"CHE\",\n CHL = \"CHL\",\n CHN = \"CHN\",\n CIV = \"CIV\",\n CMR = \"CMR\",\n COD = \"COD\",\n COG = \"COG\",\n COK = \"COK\",\n COL = \"COL\",\n COM = \"COM\",\n CPV = \"CPV\",\n CRI = \"CRI\",\n CUB = \"CUB\",\n CUW = \"CUW\",\n CXR = \"CXR\",\n CYM = \"CYM\",\n CYP = \"CYP\",\n CZE = \"CZE\",\n DEU = \"DEU\",\n DJI = \"DJI\",\n DMA = \"DMA\",\n DNK = \"DNK\",\n DOM = \"DOM\",\n DZA = \"DZA\",\n ECU = \"ECU\",\n EGY = \"EGY\",\n ERI = \"ERI\",\n ESH = \"ESH\",\n ESP = \"ESP\",\n EST = \"EST\",\n ETH = \"ETH\",\n FIN = \"FIN\",\n FJI = \"FJI\",\n FLK = \"FLK\",\n FRA = \"FRA\",\n FRO = \"FRO\",\n FSM = \"FSM\",\n GAB = \"GAB\",\n GBR = \"GBR\",\n GEO = \"GEO\",\n GGY = \"GGY\",\n GHA = \"GHA\",\n GIB = \"GIB\",\n GIN = \"GIN\",\n GLP = \"GLP\",\n GMB = \"GMB\",\n GNB = \"GNB\",\n GNQ = \"GNQ\",\n GRC = \"GRC\",\n GRD = \"GRD\",\n GRL = \"GRL\",\n GTM = \"GTM\",\n GUF = \"GUF\",\n GUM = \"GUM\",\n GUY = \"GUY\",\n HKG = \"HKG\",\n HMD = \"HMD\",\n HND = \"HND\",\n HRV = \"HRV\",\n HTI = \"HTI\",\n HUN = \"HUN\",\n IDN = \"IDN\",\n IMN = \"IMN\",\n IND = \"IND\",\n IOT = \"IOT\",\n IRL = \"IRL\",\n IRN = \"IRN\",\n IRQ = \"IRQ\",\n ISL = \"ISL\",\n ISR = \"ISR\",\n ITA = \"ITA\",\n JAM = \"JAM\",\n JEY = \"JEY\",\n JOR = \"JOR\",\n JPN = \"JPN\",\n KAZ = \"KAZ\",\n KEN = \"KEN\",\n KGZ = \"KGZ\",\n KHM = \"KHM\",\n KIR = \"KIR\",\n KNA = \"KNA\",\n KOR = \"KOR\",\n KWT = \"KWT\",\n LAO = \"LAO\",\n LBN = \"LBN\",\n LBR = \"LBR\",\n LBY = \"LBY\",\n LCA = \"LCA\",\n LIE = \"LIE\",\n LKA = \"LKA\",\n LSO = \"LSO\",\n LTU = \"LTU\",\n LUX = \"LUX\",\n LVA = \"LVA\",\n MAC = \"MAC\",\n MAF = \"MAF\",\n MAR = \"MAR\",\n MCO = \"MCO\",\n MDA = \"MDA\",\n MDG = \"MDG\",\n MDV = \"MDV\",\n MEX = \"MEX\",\n MHL = \"MHL\",\n MKD = \"MKD\",\n MLI = \"MLI\",\n MLT = \"MLT\",\n MMR = \"MMR\",\n MNE = \"MNE\",\n MNG = \"MNG\",\n MNP = \"MNP\",\n MOZ = \"MOZ\",\n MRT = \"MRT\",\n MSR = \"MSR\",\n MTQ = \"MTQ\",\n MUS = \"MUS\",\n MWI = \"MWI\",\n MYS = \"MYS\",\n MYT = \"MYT\",\n NAM = \"NAM\",\n NCL = \"NCL\",\n NER = \"NER\",\n NFK = \"NFK\",\n NGA = \"NGA\",\n NIC = \"NIC\",\n NIU = \"NIU\",\n NLD = \"NLD\",\n NOR = \"NOR\",\n NPL = \"NPL\",\n NRU = \"NRU\",\n NZL = \"NZL\",\n OMN = \"OMN\",\n PAK = \"PAK\",\n PAN = \"PAN\",\n PCN = \"PCN\",\n PER = \"PER\",\n PHL = \"PHL\",\n PLW = \"PLW\",\n PNG = \"PNG\",\n POL = \"POL\",\n PRI = \"PRI\",\n PRK = \"PRK\",\n PRT = \"PRT\",\n PRY = \"PRY\",\n PSE = \"PSE\",\n PYF = \"PYF\",\n QAT = \"QAT\",\n REU = \"REU\",\n ROU = \"ROU\",\n RUS = \"RUS\",\n RWA = \"RWA\",\n SAU = \"SAU\",\n SDN = \"SDN\",\n SEN = \"SEN\",\n SGP = \"SGP\",\n SGS = \"SGS\",\n SHN = \"SHN\",\n SJM = \"SJM\",\n SLB = \"SLB\",\n SLE = \"SLE\",\n SLV = \"SLV\",\n SMR = \"SMR\",\n SOM = \"SOM\",\n SPM = \"SPM\",\n SRB = \"SRB\",\n SSD = \"SSD\",\n STP = \"STP\",\n SUR = \"SUR\",\n SVK = \"SVK\",\n SVN = \"SVN\",\n SWE = \"SWE\",\n SWZ = \"SWZ\",\n SXM = \"SXM\",\n SYC = \"SYC\",\n SYR = \"SYR\",\n TCA = \"TCA\",\n TCD = \"TCD\",\n TGO = \"TGO\",\n THA = \"THA\",\n TJK = \"TJK\",\n TKL = \"TKL\",\n TKM = \"TKM\",\n TLS = \"TLS\",\n TON = \"TON\",\n TTO = \"TTO\",\n TUN = \"TUN\",\n TUR = \"TUR\",\n TUV = \"TUV\",\n TWN = \"TWN\",\n TZA = \"TZA\",\n UGA = \"UGA\",\n UKR = \"UKR\",\n UMI = \"UMI\",\n URY = \"URY\",\n USA = \"USA\",\n UZB = \"UZB\",\n VAT = \"VAT\",\n VCT = \"VCT\",\n VEN = \"VEN\",\n VGB = \"VGB\",\n VIR = \"VIR\",\n VNM = \"VNM\",\n VUT = \"VUT\",\n WLF = \"WLF\",\n WSM = \"WSM\",\n XKX = \"XKX\",\n YEM = \"YEM\",\n ZAF = \"ZAF\",\n ZMB = \"ZMB\",\n ZWE = \"ZWE\",\n}\n\n/**\n * Enum mapping ISO-3166 alpha-3 country codes to their corresponding country names.\n * Provides a way to easily retrieve the name of a country using its code.\n *\n * @example\n * import { CountryCodeEnum, CountryNameEnum } from './country-code';\n * const malaysiaName = CountryNameEnum[CountryCodeEnum.MYS];\n * console.log(malaysiaName); // Output: MALAYSIA\n */\nexport enum CountryNameEnum {\n ABW = \"ARUBA\",\n AFG = \"AFGHANISTAN\",\n AGO = \"ANGOLA\",\n AIA = \"ANGUILLA\",\n ALA = \"ALAND ISLANDS\",\n ALB = \"ALBANIA\",\n AND = \"ANDORA\",\n ANT = \"NETHERLANDS ANTILLES\",\n ARE = \"UNITED ARAB EMIRATES\",\n ARG = \"ARGENTINA\",\n ARM = \"ARMENIA\",\n ASM = \"AMERICAN SAMOA\",\n ATA = \"ANTARCTICA\",\n ATF = \"FRENCH SOUTHERN TERRITORIES\",\n ATG = \"ANTIGUA AND BARBUDA\",\n AUS = \"AUSTRALIA\",\n AUT = \"AUSTRIA\",\n AZE = \"AZERBAIDJAN\",\n BDI = \"BURUNDI\",\n BEL = \"BELGIUM\",\n BEN = \"BENIN\",\n BES = \"BONAIRE, SINT EUSTATIUS AND SABA\",\n BFA = \"BURKINA FASO\",\n BGD = \"BANGLADESH\",\n BGR = \"BULGARIA\",\n BHR = \"BAHRAIN\",\n BHS = \"BAHAMAS\",\n BIH = \"BOSNIA AND HERZEGOVINA\",\n BLM = \"SAINT BARTHELEMY\",\n BLR = \"BELARUS\",\n BLZ = \"BELIZE\",\n BMU = \"BERMUDA\",\n BOL = \"BOLIVIA\",\n BRA = \"BRAZIL\",\n BRB = \"BARBADOS\",\n BRN = \"BRUNEI DARUSSALAM\",\n BTN = \"BHUTAN\",\n BVT = \"BOUVET ISLAND\",\n BWA = \"BOTSWANA\",\n CAF = \"CENTRAL AFRICAN REPUBLIC\",\n CAN = \"CANADA\",\n CCK = \"COCOS ISLAND\",\n CHE = \"SWITZERLAND\",\n CHL = \"CHILE\",\n CHN = \"CHINA\",\n CIV = \"COTE D'IVOIRE\",\n CMR = \"CAMEROON\",\n COD = \"CONGO, THE DEMOCRATIC REPUBLIC\",\n COG = \"CONGO\",\n COK = \"COOK ISLANDS\",\n COL = \"COLOMBIA\",\n COM = \"COMOROS\",\n CPV = \"CAPE VERDE\",\n CRI = \"COSTA RICA\",\n CUB = \"CUBA\",\n CUW = \"CURACAO\",\n CXR = \"CHRISTMAS ISLANDS\",\n CYM = \"CAYMAN ISLANDS\",\n CYP = \"CYPRUS\",\n CZE = \"CZECH REPUBLIC\",\n DEU = \"GERMANY\",\n DJI = \"DJIBOUTI\",\n DMA = \"DOMINICA\",\n DNK = \"DENMARK\",\n DOM = \"DOMINICAN REPUBLIC\",\n DZA = \"ALGERIA\",\n ECU = \"ECUADOR\",\n EGY = \"EGYPT\",\n ERI = \"ERITREA\",\n ESH = \"WESTERN SAHARA\",\n ESP = \"SPAIN\",\n EST = \"ESTONIA\",\n ETH = \"ETHIOPIA\",\n FIN = \"FINLAND\",\n FJI = \"FIJI\",\n FLK = \"FALKLAND ISLANDS (MALVINAS)\",\n FRA = \"FRANCE\",\n FRO = \"FAEROE ISLANDS\",\n FSM = \"MICRONESIA, FEDERATED STATES OF\",\n GAB = \"GABON\",\n GBR = \"UNITED KINGDOM\",\n GEO = \"GEORGIA\",\n GGY = \"GUERNSEY\",\n GHA = \"GHANA\",\n GIB = \"GIBRALTAR\",\n GIN = \"GUINEA\",\n GLP = \"GUADELOUPE\",\n GMB = \"GAMBIA\",\n GNB = \"GUINEA-BISSAU\",\n GNQ = \"EQUATORIAL GUINEA\",\n GRC = \"GREECE\",\n GRD = \"GRENADA\",\n GRL = \"GREENLAND\",\n GTM = \"GUATEMALA\",\n GUF = \"FRENCH GUIANA\",\n GUM = \"GUAM\",\n GUY = \"GUYANA\",\n HKG = \"HONG KONG\",\n HMD = \"HEARD AND MCDONALD ISLANDS\",\n HND = \"HONDURAS\",\n HRV = \"CROATIA\",\n HTI = \"HAITI\",\n HUN = \"HUNGARY\",\n IDN = \"INDONESIA\",\n IMN = \"ISLE OF MAN\",\n IND = \"INDIA\",\n IOT = \"BRITISH INDIAN OCEAN TERRITORY\",\n IRL = \"IRELAND\",\n IRN = \"IRAN\",\n IRQ = \"IRAQ\",\n ISL = \"ICELAND\",\n ISR = \"ISRAEL\",\n ITA = \"ITALY\",\n JAM = \"JAMAICA\",\n JEY = \"JERSEY (CHANNEL ISLANDS)\",\n JOR = \"JORDAN\",\n JPN = \"JAPAN\",\n KAZ = \"KAZAKHSTAN\",\n KEN = \"KENYA\",\n KGZ = \"KYRGYZSTAN\",\n KHM = \"CAMBODIA\",\n KIR = \"KIRIBATI\",\n KNA = \"ST.KITTS AND NEVIS\",\n KOR = \"THE REPUBLIC OF KOREA\",\n KWT = \"KUWAIT\",\n LAO = \"LAOS\",\n LBN = \"LEBANON\",\n LBR = \"LIBERIA\",\n LBY = \"LIBYAN ARAB JAMAHIRIYA\",\n LCA = \"SAINT LUCIA\",\n LIE = \"LIECHTENSTEIN\",\n LKA = \"SRI LANKA\",\n LSO = \"LESOTHO\",\n LTU = \"LITHUANIA\",\n LUX = \"LUXEMBOURG\",\n LVA = \"LATVIA\",\n MAC = \"MACAO\",\n MAF = \"SAINT MARTIN (FRENCH PART)\",\n MAR = \"MOROCCO\",\n MCO = \"MONACO\",\n MDA = \"MOLDOVA, REPUBLIC OF\",\n MDG = \"MADAGASCAR\",\n MDV = \"MALDIVES\",\n MEX = \"MEXICO\",\n MHL = \"MARSHALL ISLANDS\",\n MKD = \"MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF\",\n MLI = \"MALI\",\n MLT = \"MALTA\",\n MMR = \"MYANMAR\",\n MNE = \"MONTENEGRO\",\n MNG = \"MONGOLIA\",\n MNP = \"NORTHERN MARIANA ISLANDS\",\n MOZ = \"MOZAMBIQUE\",\n MRT = \"MAURITANIA\",\n MSR = \"MONTSERRAT\",\n MTQ = \"MARTINIQUE\",\n MUS = \"MAURITIUS\",\n MWI = \"MALAWI\",\n MYS = \"MALAYSIA\",\n MYT = \"MAYOTTE\",\n NAM = \"NAMIBIA\",\n NCL = \"NEW CALEDONIA\",\n NER = \"NIGER\",\n NFK = \"NORFOLK ISLAND\",\n NGA = \"NIGERIA\",\n NIC = \"NICARAGUA\",\n NIU = \"NIUE\",\n NLD = \"NETHERLANDS\",\n NOR = \"NORWAY\",\n NPL = \"NEPAL\",\n NRU = \"NAURU\",\n NZL = \"NEW ZEALAND\",\n OMN = \"OMAN\",\n PAK = \"PAKISTAN\",\n PAN = \"PANAMA\",\n PCN = \"PITCAIRN\",\n PER = \"PERU\",\n PHL = \"PHILIPPINES\",\n PLW = \"PALAU\",\n PNG = \"PAPUA NEW GUINEA\",\n POL = \"POLAND\",\n PRI = \"PUERTO RICO\",\n PRK = \"DEMOC.PEOPLES REP.OF KOREA\",\n PRT = \"PORTUGAL\",\n PRY = \"PARAGUAY\",\n PSE = \"PALESTINIAN TERRITORY, OCCUPIED\",\n PYF = \"FRENCH POLYNESIA\",\n QAT = \"QATAR\",\n REU = \"REUNION\",\n ROU = \"ROMANIA\",\n RUS = \"RUSSIAN FEDERATION (USSR)\",\n RWA = \"RWANDA\",\n SAU = \"SAUDI ARABIA\",\n SDN = \"SUDAN\",\n SEN = \"SENEGAL\",\n SGP = \"SINGAPORE\",\n SGS = \"SOUTH GEORGIA AND THE SOUTH SANDWICH ISLAND\",\n SHN = \"ST. HELENA\",\n SJM = \"SVALBARD AND JAN MAYEN ISLANDS\",\n SLB = \"SOLOMON ISLANDS\",\n SLE = \"SIERRA LEONE\",\n SLV = \"EL SALVADOR\",\n SMR = \"SAN MARINO\",\n SOM = \"SOMALIA\",\n SPM = \"ST. PIERRE AND MIQUELON\",\n SRB = \"SERBIA\",\n SSD = \"SOUTH SUDAN\",\n STP = \"SAO TOME AND PRINCIPE\",\n SUR = \"SURINAME\",\n SVK = \"SLOVAK REPUBLIC\",\n SVN = \"SLOVENIA\",\n SWE = \"SWEDEN\",\n SWZ = \"ESWATINI, KINGDOM OF (SWAZILAND)\",\n SXM = \"SINT MAARTEN (DUTCH PART)\",\n SYC = \"SEYCHELLES\",\n SYR = \"SYRIAN ARAB REPUBLIC\",\n TCA = \"TURKS AND CAICOS ISLANDS\",\n TCD = \"CHAD\",\n TGO = \"TOGO\",\n THA = \"THAILAND\",\n TJK = \"TAJIKISTAN\",\n TKL = \"TOKELAU\",\n TKM = \"TURKMENISTAN\",\n TLS = \"TIMOR-LESTE\",\n TON = \"TONGA\",\n TTO = \"TRINIDAD AND TOBAGO\",\n TUN = \"TUNISIA\",\n TUR = \"TURKIYE\",\n TUV = \"TUVALU\",\n TWN = \"TAIWAN\",\n TZA = \"TANZANIA UNITED REPUBLIC\",\n UGA = \"UGANDA\",\n UKR = \"UKRAINE\",\n UMI = \"UNITED STATES MINOR OUTLYING ISLANDS\",\n URY = \"URUGUAY\",\n USA = \"UNITED STATES OF AMERICA\",\n UZB = \"UZBEKISTAN\",\n VAT = \"VATICAN CITY STATE (HOLY SEE)\",\n VCT = \"SAINT VINCENT AND GRENADINES\",\n VEN = \"VENEZUELA\",\n VGB = \"VIRGIN ISLANDS(BRITISH)\",\n VIR = \"VIRGIN ISLANDS(US)\",\n VNM = \"VIETNAM\",\n VUT = \"VANUATU\",\n WLF = \"WALLIS AND FUTUNA ISLANDS\",\n WSM = \"SAMOA\",\n XKX = \"KOSOVO\",\n YEM = \"YEMEN\",\n ZAF = \"SOUTH AFRICA\",\n ZMB = \"ZAMBIA\",\n ZWE = \"ZIMBABWE\",\n}\n\n/**\n * Interface representing a country code entry.\n * Contains the ISO-3166 alpha-3 code and the country name.\n */\nexport interface Country {\n code: CountryCode\n name: string\n}\n"],"mappings":";;;;;;;;;;AAyQA,IAAY,8DAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACD;;;;;;;;;;AAWD,IAAY,8DAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index4.cjs","names":[],"sources":["../src/types/currencies.d.ts"],"sourcesContent":["/**\n * Represents the allowed ISO-4217 3-letter currency codes.\n * Based on the documentation: https://sdk.myinvois.hasil.gov.my/codes/currencies/\n */\nexport type CurrencyCode =\n | 'AED'\n | 'AFN'\n | 'ALL'\n | 'AMD'\n | 'ANG'\n | 'AOA'\n | 'ARS'\n | 'AUD'\n | 'AWG'\n | 'AZN'\n | 'BAM'\n | 'BBD'\n | 'BDT'\n | 'BGN'\n | 'BHD'\n | 'BIF'\n | 'BMD'\n | 'BND'\n | 'BOB'\n | 'BOV'\n | 'BRL'\n | 'BSD'\n | 'BTN'\n | 'BWP'\n | 'BYN'\n | 'BZD'\n | 'CAD'\n | 'CDF'\n | 'CHE'\n | 'CHF'\n | 'CHW'\n | 'CLF'\n | 'CLP'\n | 'CNY'\n | 'COP'\n | 'COU'\n | 'CRC'\n | 'CUC'\n | 'CUP'\n | 'CVE'\n | 'CZK'\n | 'DJF'\n | 'DKK'\n | 'DOP'\n | 'DZD'\n | 'EGP'\n | 'ERN'\n | 'ETB'\n | 'EUR'\n | 'FJD'\n | 'FKP'\n | 'GBP'\n | 'GEL'\n | 'GHS'\n | 'GIP'\n | 'GMD'\n | 'GNF'\n | 'GTQ'\n | 'GYD'\n | 'HKD'\n | 'HNL'\n | 'HRK'\n | 'HTG'\n | 'HUF'\n | 'IDR'\n | 'ILS'\n | 'INR'\n | 'IQD'\n | 'IRR'\n | 'ISK'\n | 'JMD'\n | 'JOD'\n | 'JPY'\n | 'KES'\n | 'KGS'\n | 'KHR'\n | 'KMF'\n | 'KPW'\n | 'KRW'\n | 'KWD'\n | 'KYD'\n | 'KZT'\n | 'LAK'\n | 'LBP'\n | 'LKR'\n | 'LRD'\n | 'LSL'\n | 'LYD'\n | 'MAD'\n | 'MDL'\n | 'MGA'\n | 'MKD'\n | 'MMK'\n | 'MNT'\n | 'MOP'\n | 'MRU'\n | 'MUR'\n | 'MVR'\n | 'MWK'\n | 'MXN'\n | 'MXV'\n | 'MYR'\n | 'MZN'\n | 'NAD'\n | 'NGN'\n | 'NIO'\n | 'NOK'\n | 'NPR'\n | 'NZD'\n | 'OMR'\n | 'PAB'\n | 'PEN'\n | 'PGK'\n | 'PHP'\n | 'PKR'\n | 'PLN'\n | 'PYG'\n | 'QAR'\n | 'RON'\n | 'RSD'\n | 'RUB'\n | 'RWF'\n | 'SAR'\n | 'SBD'\n | 'SCR'\n | 'SDG'\n | 'SEK'\n | 'SGD'\n | 'SHP'\n | 'SLL'\n | 'SOS'\n | 'SRD'\n | 'SSP'\n | 'STN'\n | 'SVC'\n | 'SYP'\n | 'SZL'\n | 'THB'\n | 'TJS'\n | 'TMT'\n | 'TND'\n | 'TOP'\n | 'TRY'\n | 'TTD'\n | 'TWD'\n | 'TZS'\n | 'UAH'\n | 'UGX'\n | 'USD'\n | 'USN'\n | 'UYI'\n | 'UYU'\n | 'UYW'\n | 'UZS'\n | 'VED'\n | 'VES'\n | 'VND'\n | 'VUV'\n | 'WST'\n | 'XAF'\n | 'XAG'\n | 'XAU'\n | 'XBA'\n | 'XBB'\n | 'XBC'\n | 'XBD'\n | 'XCD'\n | 'XDR'\n | 'XOF'\n | 'XPD'\n | 'XPF'\n | 'XPT'\n | 'XSU'\n | 'XUA'\n | 'XXX'\n | 'YER'\n | 'ZAR'\n | 'ZMW'\n | 'ZWL'\n\n/**\n * Enum representing the allowed ISO-4217 3-letter currency codes.\n * Provides a more readable way to reference currency codes.\n *\n * @example\n * const currency = CurrencyCodeEnum.MYR;\n * console.log(currency); // Output: \"MYR\"\n */\nexport enum CurrencyCodeEnum {\n AED = 'AED',\n AFN = 'AFN',\n ALL = 'ALL',\n AMD = 'AMD',\n ANG = 'ANG',\n AOA = 'AOA',\n ARS = 'ARS',\n AUD = 'AUD',\n AWG = 'AWG',\n AZN = 'AZN',\n BAM = 'BAM',\n BBD = 'BBD',\n BDT = 'BDT',\n BGN = 'BGN',\n BHD = 'BHD',\n BIF = 'BIF',\n BMD = 'BMD',\n BND = 'BND',\n BOB = 'BOB',\n BOV = 'BOV',\n BRL = 'BRL',\n BSD = 'BSD',\n BTN = 'BTN',\n BWP = 'BWP',\n BYN = 'BYN',\n BZD = 'BZD',\n CAD = 'CAD',\n CDF = 'CDF',\n CHE = 'CHE',\n CHF = 'CHF',\n CHW = 'CHW',\n CLF = 'CLF',\n CLP = 'CLP',\n CNY = 'CNY',\n COP = 'COP',\n COU = 'COU',\n CRC = 'CRC',\n CUC = 'CUC',\n CUP = 'CUP',\n CVE = 'CVE',\n CZK = 'CZK',\n DJF = 'DJF',\n DKK = 'DKK',\n DOP = 'DOP',\n DZD = 'DZD',\n EGP = 'EGP',\n ERN = 'ERN',\n ETB = 'ETB',\n EUR = 'EUR',\n FJD = 'FJD',\n FKP = 'FKP',\n GBP = 'GBP',\n GEL = 'GEL',\n GHS = 'GHS',\n GIP = 'GIP',\n GMD = 'GMD',\n GNF = 'GNF',\n GTQ = 'GTQ',\n GYD = 'GYD',\n HKD = 'HKD',\n HNL = 'HNL',\n HRK = 'HRK',\n HTG = 'HTG',\n HUF = 'HUF',\n IDR = 'IDR',\n ILS = 'ILS',\n INR = 'INR',\n IQD = 'IQD',\n IRR = 'IRR',\n ISK = 'ISK',\n JMD = 'JMD',\n JOD = 'JOD',\n JPY = 'JPY',\n KES = 'KES',\n KGS = 'KGS',\n KHR = 'KHR',\n KMF = 'KMF',\n KPW = 'KPW',\n KRW = 'KRW',\n KWD = 'KWD',\n KYD = 'KYD',\n KZT = 'KZT',\n LAK = 'LAK',\n LBP = 'LBP',\n LKR = 'LKR',\n LRD = 'LRD',\n LSL = 'LSL',\n LYD = 'LYD',\n MAD = 'MAD',\n MDL = 'MDL',\n MGA = 'MGA',\n MKD = 'MKD',\n MMK = 'MMK',\n MNT = 'MNT',\n MOP = 'MOP',\n MRU = 'MRU',\n MUR = 'MUR',\n MVR = 'MVR',\n MWK = 'MWK',\n MXN = 'MXN',\n MXV = 'MXV',\n MYR = 'MYR',\n MZN = 'MZN',\n NAD = 'NAD',\n NGN = 'NGN',\n NIO = 'NIO',\n NOK = 'NOK',\n NPR = 'NPR',\n NZD = 'NZD',\n OMR = 'OMR',\n PAB = 'PAB',\n PEN = 'PEN',\n PGK = 'PGK',\n PHP = 'PHP',\n PKR = 'PKR',\n PLN = 'PLN',\n PYG = 'PYG',\n QAR = 'QAR',\n RON = 'RON',\n RSD = 'RSD',\n RUB = 'RUB',\n RWF = 'RWF',\n SAR = 'SAR',\n SBD = 'SBD',\n SCR = 'SCR',\n SDG = 'SDG',\n SEK = 'SEK',\n SGD = 'SGD',\n SHP = 'SHP',\n SLL = 'SLL',\n SOS = 'SOS',\n SRD = 'SRD',\n SSP = 'SSP',\n STN = 'STN',\n SVC = 'SVC',\n SYP = 'SYP',\n SZL = 'SZL',\n THB = 'THB',\n TJS = 'TJS',\n TMT = 'TMT',\n TND = 'TND',\n TOP = 'TOP',\n TRY = 'TRY',\n TTD = 'TTD',\n TWD = 'TWD',\n TZS = 'TZS',\n UAH = 'UAH',\n UGX = 'UGX',\n USD = 'USD',\n USN = 'USN',\n UYI = 'UYI',\n UYU = 'UYU',\n UYW = 'UYW',\n UZS = 'UZS',\n VED = 'VED',\n VES = 'VES',\n VND = 'VND',\n VUV = 'VUV',\n WST = 'WST',\n XAF = 'XAF',\n XAG = 'XAG',\n XAU = 'XAU',\n XBA = 'XBA',\n XBB = 'XBB',\n XBC = 'XBC',\n XBD = 'XBD',\n XCD = 'XCD',\n XDR = 'XDR',\n XOF = 'XOF',\n XPD = 'XPD',\n XPF = 'XPF',\n XPT = 'XPT',\n XSU = 'XSU',\n XUA = 'XUA',\n XXX = 'XXX',\n YER = 'YER',\n ZAR = 'ZAR',\n ZMW = 'ZMW',\n ZWL = 'ZWL',\n}\n\n/**\n * Interface representing a currency entry.\n * Contains the ISO-4217 code and the currency name.\n */\nexport interface Currency {\n code: CurrencyCode\n name: string\n}\n"],"mappings":";;;;;;;;;;AAiMA,IAAY,gEAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index6.cjs","names":[],"sources":["../src/types/e-invoice.d.ts"],"sourcesContent":["/**\n * Represents the allowed codes for e-Invoice types.\n * Based on the documentation: https://sdk.myinvois.hasil.gov.my/codes/e-invoice-types/\n */\nexport type EInvoiceTypeCode =\n | '01' // Invoice\n | '02' // Credit Note\n | '03' // Debit Note\n | '04' // Refund Note\n | '11' // Self-billed Invoice\n | '12' // Self-billed Credit Note\n | '13' // Self-billed Debit Note\n | '14' // Self-billed Refund Note\n\n/**\n * Interface representing an e-Invoice type entry.\n * Contains the code and its corresponding description.\n */\nexport interface EInvoiceType {\n code: EInvoiceTypeCode\n description: string\n}\n\n/**\n * Enum representing the allowed codes for e-Invoice types with descriptive names.\n * Provides a more readable way to reference e-Invoice types compared to using raw codes.\n *\n * @example\n * const invoiceCode = EInvoiceTypeCodeEnum.Invoice;\n * console.log(invoiceCode); // Output: \"01\"\n */\nexport enum EInvoiceTypeCodeEnum {\n Invoice = '01',\n CreditNote = '02',\n DebitNote = '03',\n RefundNote = '04',\n SelfBilledInvoice = '11',\n SelfBilledCreditNote = '12',\n SelfBilledDebitNote = '13',\n SelfBilledRefundNote = '14',\n}\n"],"mappings":";;;;;;;;;;AA+BA,IAAY,wEAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACD"}