@ripwords/myinvois-client 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/documentManagement.d.ts +1 -1
- package/dist/api/documentSubmission.d.ts +1 -1
- package/dist/api/documentTypeManagement.d.ts +1 -1
- package/dist/api/notificationManagement.d.ts +1 -1
- package/dist/api/platformLogin.d.ts +1 -1
- package/dist/api/taxpayerValidation.d.ts +1 -1
- package/dist/api/taxpayerValidation.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index10.cjs +61 -4
- package/dist/{index16.cjs.map → index10.cjs.map} +1 -1
- package/dist/index11.cjs +531 -21
- package/dist/index11.cjs.map +1 -0
- package/dist/index12.cjs +195 -2
- package/dist/index12.cjs.map +1 -0
- package/dist/index13.cjs +0 -3
- package/dist/index14.cjs +19 -324
- package/dist/index14.cjs.map +1 -1
- package/dist/index15.cjs +0 -193
- package/dist/index16.cjs +0 -62
- package/dist/index17.cjs +23 -526
- package/dist/index17.cjs.map +1 -1
- package/dist/index18.cjs +16 -187
- package/dist/index18.cjs.map +1 -1
- package/dist/index2.cjs +4 -4
- package/dist/index20.cjs +25 -16
- package/dist/index20.cjs.map +1 -1
- package/dist/index21.cjs +24 -0
- package/dist/{index27.cjs.map → index21.cjs.map} +1 -1
- package/dist/index23.cjs +0 -29
- package/dist/index24.cjs +0 -25
- package/dist/index25.cjs +5 -0
- package/dist/index26.cjs +6 -33
- package/dist/index27.cjs +4 -23
- package/dist/index28.cjs +3 -0
- package/dist/index29.cjs +3 -0
- package/dist/index3.cjs +12 -6
- package/dist/index3.cjs.map +1 -0
- package/dist/index30.cjs +6 -0
- package/dist/index4.cjs +4 -4
- package/dist/index5.cjs +21 -2
- package/dist/index6.cjs +2 -2
- package/dist/index7.cjs +2 -5
- package/dist/index8.cjs +329 -4
- package/dist/index8.cjs.map +1 -0
- package/dist/index9.cjs +189 -9
- package/dist/index9.cjs.map +1 -1
- package/dist/{taxpayer-BWpQOlug.d.ts → taxpayer-BAoT73gg.d.ts} +1 -0
- package/dist/{taxpayer-DUFUvBKi.d.cts → taxpayer-DwGzY1IL.d.cts} +2 -1
- package/dist/{taxpayerValidation-y6P-Es0S.js → taxpayerValidation-Xd_EHDvk.js} +6 -3
- package/dist/{taxpayerValidation-D_jGaVty.cjs → taxpayerValidation-j8s6YGED.cjs} +7 -4
- package/dist/taxpayerValidation-j8s6YGED.cjs.map +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/taxpayer.d.ts +1 -1
- package/dist/utils/document.d.ts +1 -1
- package/dist/utils/signature-diagnostics.d.ts +1 -1
- package/dist/utils/validation.d.ts +1 -1
- package/package.json +1 -1
- package/dist/index15.cjs.map +0 -1
- package/dist/index23.cjs.map +0 -1
- package/dist/index24.cjs.map +0 -1
- package/dist/index26.cjs.map +0 -1
- package/dist/taxpayerValidation-D_jGaVty.cjs.map +0 -1
|
@@ -3,18 +3,21 @@ import { formatIdValue } from "./formatIdValue-qTxJqj9o.js";
|
|
|
3
3
|
//#region src/api/taxpayerValidation.ts
|
|
4
4
|
async function tinSearch(context, params) {
|
|
5
5
|
const { fetch, debug } = context;
|
|
6
|
-
const { taxpayerName, idType, idValue } = params;
|
|
7
|
-
if (!taxpayerName && (!idType || !idValue)) throw new Error("Either taxpayerName must be provided, or both idType and idValue must be provided");
|
|
6
|
+
const { taxpayerName, idType, idValue, fileType } = params;
|
|
8
7
|
if (idType && !idValue || !idType && idValue) throw new Error("idType and idValue must be provided together");
|
|
8
|
+
if (fileType && (!idType || !idValue)) throw new Error("fileType can only be provided together with idType and idValue");
|
|
9
|
+
if (!taxpayerName && (!idType || !idValue)) throw new Error("Either taxpayerName must be provided, or both idType and idValue must be provided");
|
|
9
10
|
const queryParams = new URLSearchParams();
|
|
10
|
-
if (taxpayerName) queryParams.append("taxpayerName", taxpayerName);
|
|
11
11
|
if (idType && idValue) {
|
|
12
12
|
queryParams.append("idType", idType);
|
|
13
13
|
queryParams.append("idValue", formatIdValue(idValue));
|
|
14
14
|
}
|
|
15
|
+
if (fileType) queryParams.append("fileType", fileType);
|
|
16
|
+
if (taxpayerName) queryParams.append("idName", taxpayerName);
|
|
15
17
|
const queryString = queryParams.toString();
|
|
16
18
|
try {
|
|
17
19
|
const response = await fetch(`/api/v1.0/taxpayer/search/tin?${queryString}`, { method: "GET" });
|
|
20
|
+
if (!response.ok) throw new Error(`Failed to search TIN: ${await response.text()}`);
|
|
18
21
|
return await response.json();
|
|
19
22
|
} catch (error) {
|
|
20
23
|
if (debug) console.error("TIN search error:", error);
|
|
@@ -3,18 +3,21 @@ const require_formatIdValue = require('./formatIdValue-i67o4kyD.cjs');
|
|
|
3
3
|
//#region src/api/taxpayerValidation.ts
|
|
4
4
|
async function tinSearch(context, params) {
|
|
5
5
|
const { fetch, debug } = context;
|
|
6
|
-
const { taxpayerName, idType, idValue } = params;
|
|
7
|
-
if (!taxpayerName && (!idType || !idValue)) throw new Error("Either taxpayerName must be provided, or both idType and idValue must be provided");
|
|
6
|
+
const { taxpayerName, idType, idValue, fileType } = params;
|
|
8
7
|
if (idType && !idValue || !idType && idValue) throw new Error("idType and idValue must be provided together");
|
|
8
|
+
if (fileType && (!idType || !idValue)) throw new Error("fileType can only be provided together with idType and idValue");
|
|
9
|
+
if (!taxpayerName && (!idType || !idValue)) throw new Error("Either taxpayerName must be provided, or both idType and idValue must be provided");
|
|
9
10
|
const queryParams = new URLSearchParams();
|
|
10
|
-
if (taxpayerName) queryParams.append("taxpayerName", taxpayerName);
|
|
11
11
|
if (idType && idValue) {
|
|
12
12
|
queryParams.append("idType", idType);
|
|
13
13
|
queryParams.append("idValue", require_formatIdValue.formatIdValue(idValue));
|
|
14
14
|
}
|
|
15
|
+
if (fileType) queryParams.append("fileType", fileType);
|
|
16
|
+
if (taxpayerName) queryParams.append("idName", taxpayerName);
|
|
15
17
|
const queryString = queryParams.toString();
|
|
16
18
|
try {
|
|
17
19
|
const response = await fetch(`/api/v1.0/taxpayer/search/tin?${queryString}`, { method: "GET" });
|
|
20
|
+
if (!response.ok) throw new Error(`Failed to search TIN: ${await response.text()}`);
|
|
18
21
|
return await response.json();
|
|
19
22
|
} catch (error) {
|
|
20
23
|
if (debug) console.error("TIN search error:", error);
|
|
@@ -59,4 +62,4 @@ Object.defineProperty(exports, 'verifyTin', {
|
|
|
59
62
|
return verifyTin;
|
|
60
63
|
}
|
|
61
64
|
});
|
|
62
|
-
//# sourceMappingURL=taxpayerValidation-
|
|
65
|
+
//# sourceMappingURL=taxpayerValidation-j8s6YGED.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taxpayerValidation-j8s6YGED.cjs","names":["context: TaxpayerContext","params: TinSearchParams","tin: string","idType: RegistrationType","idValue: string","qrCodeText: string"],"sources":["../src/api/taxpayerValidation.ts"],"sourcesContent":["import { formatIdValue } from 'src/utils/formatIdValue'\nimport type {\n Fetch,\n RegistrationType,\n TaxpayerQRCodeResponse,\n TinSearchParams,\n TinSearchResponse,\n} from '../types'\n\ninterface TaxpayerContext {\n fetch: Fetch\n debug: boolean\n}\n\nexport async function tinSearch(\n context: TaxpayerContext,\n params: TinSearchParams,\n): Promise<TinSearchResponse> {\n const { fetch, debug } = context\n const { taxpayerName, idType, idValue, fileType } = params\n\n // Validate input parameters according to API requirements\n // Valid combinations:\n // 1. taxpayerName alone\n // 2. taxpayerName + idType + idValue (all three)\n // 3. idType + idValue (both)\n // 4. idType + idValue + fileType (all three)\n // 5. All parameters together (AND operator)\n\n // idType and idValue must be provided together\n if ((idType && !idValue) || (!idType && idValue)) {\n throw new Error('idType and idValue must be provided together')\n }\n\n // fileType can only be provided with idType and idValue\n if (fileType && (!idType || !idValue)) {\n throw new Error(\n 'fileType can only be provided together with idType and idValue',\n )\n }\n\n // Must have at least one valid combination:\n // - taxpayerName alone, OR\n // - idType + idValue (with optional fileType)\n if (!taxpayerName && (!idType || !idValue)) {\n throw new Error(\n 'Either taxpayerName must be provided, or both idType and idValue must be provided',\n )\n }\n\n // Build query parameters\n const queryParams = new URLSearchParams()\n\n if (idType && idValue) {\n queryParams.append('idType', idType)\n queryParams.append('idValue', formatIdValue(idValue))\n }\n\n if (fileType) {\n queryParams.append('fileType', fileType)\n }\n\n if (taxpayerName) {\n queryParams.append('idName', taxpayerName)\n }\n\n const queryString = queryParams.toString()\n\n try {\n const response = await fetch(\n `/api/v1.0/taxpayer/search/tin?${queryString}`,\n {\n method: 'GET',\n },\n )\n if (!response.ok) {\n throw new Error(`Failed to search TIN: ${await response.text()}`)\n }\n return (await response.json()) as TinSearchResponse\n } catch (error) {\n if (debug) {\n console.error('TIN search error:', error)\n }\n throw error\n }\n}\n\nexport async function verifyTin(\n context: TaxpayerContext,\n tin: string,\n idType: RegistrationType,\n idValue: string,\n): Promise<boolean> {\n const { fetch, debug } = context\n\n try {\n const response = await fetch(\n `/api/v1.0/taxpayer/validate/${tin}?idType=${idType}&idValue=${formatIdValue(idValue)}`,\n {\n method: 'GET',\n },\n )\n\n if (!response) {\n // Fetch was stubbed to return undefined or network error occurred\n return false\n }\n\n if (response.ok || response.status === 200) {\n return true\n }\n\n return false\n } catch (error) {\n if (debug) {\n console.error(error)\n }\n return false\n }\n}\n\nexport async function taxpayerQRCode(\n context: TaxpayerContext,\n qrCodeText: string,\n): Promise<TaxpayerQRCodeResponse> {\n const { fetch } = context\n\n const base64EncodedQRCodeText = Buffer.from(qrCodeText).toString('base64')\n\n const response = await fetch(\n `/api/v1.0/taxpayer/qrcodeinfo/${base64EncodedQRCodeText}`,\n )\n\n return response.json()\n}\n"],"mappings":";;;AAcA,eAAsB,UACpBA,SACAC,QAC4B;CAC5B,MAAM,EAAE,OAAO,OAAO,GAAG;CACzB,MAAM,EAAE,cAAc,QAAQ,SAAS,UAAU,GAAG;AAWpD,KAAK,WAAW,YAAc,UAAU,QACtC,OAAM,IAAI,MAAM;AAIlB,KAAI,cAAc,WAAW,SAC3B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ompleteInvoice, CreditNoteV1_1, Debi
|
|
|
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-
|
|
58
|
+
import { TaxpayerQRCodeResponse, TinSearchParams, TinSearchResponse } from "../taxpayer-BAoT73gg.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 };
|
package/dist/types/taxpayer.d.ts
CHANGED
|
@@ -52,5 +52,5 @@ import "../ZX-CDQOfsHh.js";
|
|
|
52
52
|
import "../XX-DOA-10JW.js";
|
|
53
53
|
import "../unit-types-VgYXIwTT.js";
|
|
54
54
|
import "../documents-BYV12TVt.js";
|
|
55
|
-
import { TaxpayerQRCodeResponse, TinSearchParams, TinSearchResponse } from "../taxpayer-
|
|
55
|
+
import { TaxpayerQRCodeResponse, TinSearchParams, TinSearchResponse } from "../taxpayer-BAoT73gg.js";
|
|
56
56
|
export { TaxpayerQRCodeResponse, TinSearchParams, TinSearchResponse };
|
package/dist/utils/document.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ import { AllDocumentsV1_1, CompleteInvoice, InvoiceLineItem, InvoiceSubmission,
|
|
|
55
55
|
import "../payment-modes-g3DzLmWb.js";
|
|
56
56
|
import "../signatures-CerHUrj3.js";
|
|
57
57
|
import "../notifications-sFhgh3rJ.js";
|
|
58
|
-
import "../taxpayer-
|
|
58
|
+
import "../taxpayer-BAoT73gg.js";
|
|
59
59
|
import "../utils-C4FoVKLq.js";
|
|
60
60
|
import "../index-CygwSf0x.js";
|
|
61
61
|
|
|
@@ -55,7 +55,7 @@ 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-
|
|
58
|
+
import "../taxpayer-BAoT73gg.js";
|
|
59
59
|
import "../utils-C4FoVKLq.js";
|
|
60
60
|
import "../index-CygwSf0x.js";
|
|
61
61
|
|
|
@@ -55,7 +55,7 @@ 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-
|
|
58
|
+
import "../taxpayer-BAoT73gg.js";
|
|
59
59
|
import "../utils-C4FoVKLq.js";
|
|
60
60
|
import "../index-CygwSf0x.js";
|
|
61
61
|
|
package/package.json
CHANGED
package/dist/index15.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index15.cjs","names":["tin: string","registrationType?: string","errors: ValidationError[]","contactNumber: string","amount: number","fieldName: string","item: InvoiceLineItem","index: number","invoice: InvoiceV1_1","allErrors: ValidationError[]"],"sources":["../src/utils/validation.ts"],"sourcesContent":["import type { InvoiceV1_1, InvoiceLineItem } from '../types'\n\n/**\n * MyInvois Invoice Validation Utilities\n *\n * Provides comprehensive validation for invoice data before document generation\n * and submission to ensure compliance with MyInvois business rules and format requirements.\n */\n\nexport interface ValidationResult {\n isValid: boolean\n errors: ValidationError[]\n warnings: ValidationWarning[]\n}\n\nexport interface ValidationError {\n field: string\n code: string\n message: string\n severity: 'error' | 'warning'\n}\n\nexport interface ValidationWarning extends ValidationError {\n severity: 'warning'\n}\n\n/**\n * Validates TIN format based on registration type\n */\nexport const validateTIN = (\n tin: string,\n registrationType?: string,\n): ValidationError[] => {\n const errors: ValidationError[] = []\n\n if (!tin) {\n errors.push({\n field: 'tin',\n code: 'TIN_REQUIRED',\n message: 'TIN is required',\n severity: 'error',\n })\n return errors\n }\n\n // TIN format validation based on type\n if (registrationType === 'BRN' && !tin.startsWith('C')) {\n errors.push({\n field: 'tin',\n code: 'TIN_FORMAT_INVALID',\n message: 'Company TIN should start with \"C\" for BRN registration',\n severity: 'warning',\n })\n }\n\n if (registrationType === 'NRIC' && !tin.startsWith('IG')) {\n errors.push({\n field: 'tin',\n code: 'TIN_FORMAT_INVALID',\n message: 'Individual TIN should start with \"IG\" for NRIC registration',\n severity: 'warning',\n })\n }\n\n // Length validation\n if (tin.length > 14) {\n errors.push({\n field: 'tin',\n code: 'TIN_LENGTH_INVALID',\n message: 'TIN cannot exceed 14 characters',\n severity: 'error',\n })\n }\n\n return errors\n}\n\n/**\n * Validates contact number format (E.164 standard)\n */\nexport const validateContactNumber = (\n contactNumber: string,\n): ValidationError[] => {\n const errors: ValidationError[] = []\n\n if (!contactNumber || contactNumber === 'NA') {\n return errors // Allow NA for consolidated e-invoices\n }\n\n // E.164 format validation\n const e164Regex = /^\\+[1-9]\\d{1,14}$/\n if (!e164Regex.test(contactNumber)) {\n errors.push({\n field: 'contactNumber',\n code: 'CONTACT_FORMAT_INVALID',\n message: 'Contact number must be in E.164 format (e.g., +60123456789)',\n severity: 'error',\n })\n }\n\n if (contactNumber.length < 8) {\n errors.push({\n field: 'contactNumber',\n code: 'CONTACT_LENGTH_INVALID',\n message: 'Contact number must be at least 8 characters',\n severity: 'error',\n })\n }\n\n return errors\n}\n\n/**\n * Validates monetary amounts\n */\nexport const validateMonetaryAmount = (\n amount: number,\n fieldName: string,\n maxDigits = 18,\n maxDecimals = 2,\n): ValidationError[] => {\n const errors: ValidationError[] = []\n\n if (amount < 0) {\n errors.push({\n field: fieldName,\n code: 'AMOUNT_NEGATIVE',\n message: `${fieldName} cannot be negative`,\n severity: 'error',\n })\n }\n\n // Check total digits\n const amountStr = amount.toString()\n const [integerPart, decimalPart] = amountStr.split('.')\n\n if (integerPart && integerPart.length > maxDigits - maxDecimals) {\n errors.push({\n field: fieldName,\n code: 'AMOUNT_DIGITS_EXCEEDED',\n message: `${fieldName} exceeds maximum ${maxDigits} digits`,\n severity: 'error',\n })\n }\n\n if (decimalPart && decimalPart.length > maxDecimals) {\n errors.push({\n field: fieldName,\n code: 'AMOUNT_DECIMALS_EXCEEDED',\n message: `${fieldName} exceeds maximum ${maxDecimals} decimal places`,\n severity: 'error',\n })\n }\n\n return errors\n}\n\n/**\n * Validates line item tax calculation consistency for both fixed rate and percentage taxation\n */\nexport const validateLineItemTax = (\n item: InvoiceLineItem,\n index: number,\n): ValidationError[] => {\n const errors: ValidationError[] = []\n const tolerance = 0.01\n\n // Check if tax calculation method is specified\n const hasFixedRate =\n item.taxPerUnitAmount !== undefined && item.baseUnitMeasure !== undefined\n const hasPercentageRate = item.taxRate !== undefined\n\n if (!hasFixedRate && !hasPercentageRate) {\n errors.push({\n field: `lineItem[${index}]`,\n code: 'TAX_METHOD_MISSING',\n message: `Line item ${index + 1} must specify either taxRate (for percentage) or taxPerUnitAmount + baseUnitMeasure (for fixed rate)`,\n severity: 'error',\n })\n return errors\n }\n\n if (hasFixedRate && hasPercentageRate) {\n errors.push({\n field: `lineItem[${index}]`,\n code: 'TAX_METHOD_CONFLICT',\n message: `Line item ${index + 1} cannot have both percentage and fixed rate tax methods`,\n severity: 'error',\n })\n }\n\n // Validate fixed rate tax calculation\n if (hasFixedRate) {\n if (item.baseUnitMeasureCode === undefined) {\n errors.push({\n field: `lineItem[${index}].baseUnitMeasureCode`,\n code: 'UNIT_CODE_MISSING',\n message: `Line item ${index + 1} with fixed rate tax must specify baseUnitMeasureCode`,\n severity: 'error',\n })\n }\n\n const expectedTaxAmount = item.taxPerUnitAmount! * item.baseUnitMeasure!\n if (Math.abs(item.taxAmount - expectedTaxAmount) > tolerance) {\n errors.push({\n field: `lineItem[${index}].taxAmount`,\n code: 'FIXED_TAX_CALCULATION_MISMATCH',\n message: `Line item ${index + 1} tax amount (${item.taxAmount}) doesn't match fixed rate calculation (${item.taxPerUnitAmount} × ${item.baseUnitMeasure} = ${expectedTaxAmount})`,\n severity: 'error',\n })\n }\n }\n\n // Validate percentage tax calculation\n if (hasPercentageRate && !hasFixedRate) {\n const expectedTaxAmount =\n (item.totalTaxableAmountPerLine * item.taxRate!) / 100\n if (Math.abs(item.taxAmount - expectedTaxAmount) > tolerance) {\n errors.push({\n field: `lineItem[${index}].taxAmount`,\n code: 'PERCENTAGE_TAX_CALCULATION_MISMATCH',\n message: `Line item ${index + 1} tax amount (${item.taxAmount}) doesn't match percentage calculation (${item.totalTaxableAmountPerLine} × ${item.taxRate}% = ${expectedTaxAmount})`,\n severity: 'error',\n })\n }\n }\n\n return errors\n}\n\n/**\n * Validates tax calculation consistency\n */\nexport const validateTaxCalculations = (\n invoice: InvoiceV1_1,\n): ValidationError[] => {\n const errors: ValidationError[] = []\n\n // Validate individual line item tax calculations\n invoice.invoiceLineItems.forEach((item, index) => {\n errors.push(...validateLineItemTax(item, index))\n })\n\n // Calculate expected totals from line items\n const expectedTaxExclusive = invoice.invoiceLineItems.reduce(\n (sum, item) => sum + item.totalTaxableAmountPerLine,\n 0,\n )\n const expectedTaxAmount = invoice.invoiceLineItems.reduce(\n (sum, item) => sum + item.taxAmount,\n 0,\n )\n\n // Allow small rounding differences (0.01)\n const tolerance = 0.01\n\n if (\n Math.abs(\n invoice.legalMonetaryTotal.taxExclusiveAmount - expectedTaxExclusive,\n ) > tolerance\n ) {\n errors.push({\n field: 'legalMonetaryTotal.taxExclusiveAmount',\n code: 'TAX_EXCLUSIVE_MISMATCH',\n message: `Tax exclusive amount (${invoice.legalMonetaryTotal.taxExclusiveAmount}) doesn't match sum of line items (${expectedTaxExclusive})`,\n severity: 'error',\n })\n }\n\n if (Math.abs(invoice.taxTotal.taxAmount - expectedTaxAmount) > tolerance) {\n errors.push({\n field: 'taxTotal.taxAmount',\n code: 'TAX_AMOUNT_MISMATCH',\n message: `Tax amount (${invoice.taxTotal.taxAmount}) doesn't match sum of line item taxes (${expectedTaxAmount})`,\n severity: 'error',\n })\n }\n\n return errors\n}\n\n/**\n * Main validation function for complete invoice\n */\nexport const validateInvoice = (invoice: InvoiceV1_1): ValidationResult => {\n const allErrors: ValidationError[] = []\n\n // Core field validations\n allErrors.push(\n ...validateTIN(invoice.supplier.tin, invoice.supplier.registrationType),\n )\n allErrors.push(\n ...validateTIN(invoice.buyer.tin, invoice.buyer.registrationType),\n )\n\n allErrors.push(...validateContactNumber(invoice.supplier.contactNumber))\n allErrors.push(...validateContactNumber(invoice.buyer.contactNumber))\n\n // Monetary validations\n allErrors.push(\n ...validateMonetaryAmount(\n invoice.legalMonetaryTotal.taxExclusiveAmount,\n 'taxExclusiveAmount',\n ),\n )\n allErrors.push(\n ...validateMonetaryAmount(\n invoice.legalMonetaryTotal.payableAmount,\n 'payableAmount',\n ),\n )\n allErrors.push(\n ...validateMonetaryAmount(invoice.taxTotal.taxAmount, 'taxAmount'),\n )\n\n // Line item validations\n invoice.invoiceLineItems.forEach((item, index) => {\n allErrors.push(\n ...validateMonetaryAmount(item.unitPrice, `lineItem[${index}].unitPrice`),\n )\n allErrors.push(\n ...validateMonetaryAmount(item.taxAmount, `lineItem[${index}].taxAmount`),\n )\n allErrors.push(\n ...validateMonetaryAmount(\n item.totalTaxableAmountPerLine,\n `lineItem[${index}].totalTaxableAmountPerLine`,\n ),\n )\n })\n\n // Business rule validations\n allErrors.push(...validateTaxCalculations(invoice))\n\n // Separate errors and warnings\n const errors = allErrors.filter(e => e.severity === 'error')\n const warnings = allErrors.filter(\n e => e.severity === 'warning',\n ) as ValidationWarning[]\n\n return {\n isValid: errors.length === 0,\n errors,\n warnings,\n }\n}\n"],"mappings":";;;;;AA6BA,MAAa,cAAc,CACzBA,KACAC,qBACsB;CACtB,MAAMC,SAA4B,CAAE;AAEpC,MAAK,KAAK;AACR,SAAO,KAAK;GACV,OAAO;GACP,MAAM;GACN,SAAS;GACT,UAAU;EACX,EAAC;AACF,SAA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W,YAAY,CACnE;AAGD,SAAQ,iBAAiB,QAAQ,CAAC,MAAM,UAAU;AAChD,YAAU,KACR,GAAG,uBAAuB,KAAK,YAAY,WAAW,MAAM,aAAa,CAC1E;AACD,YAAU,KACR,GAAG,uBAAuB,KAAK,YAAY,WAAW,MAAM,aAAa,CAC1E;AACD,YAAU,KACR,GAAG,uBACD,KAAK,4BACJ,WAAW,MAAM,6BACnB,CACF;CACF,EAAC;AAGF,WAAU,KAAK,GAAG,wBAAwB,QAAQ,CAAC;CAGnD,MAAM,SAAS,UAAU,OAAO,OAAK,EAAE,aAAa,QAAQ;CAC5D,MAAM,WAAW,UAAU,OACzB,OAAK,EAAE,aAAa,UACrB;AAED,QAAO;EACL,SAAS,OAAO,WAAW;EAC3B;EACA;CACD;AACF"}
|
package/dist/index23.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index23.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"}
|
package/dist/index24.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index24.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"}
|
package/dist/index26.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index26.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":"taxpayerValidation-D_jGaVty.cjs","names":["context: TaxpayerContext","params: TinSearchParams","tin: string","idType: RegistrationType","idValue: string","qrCodeText: string"],"sources":["../src/api/taxpayerValidation.ts"],"sourcesContent":["import { formatIdValue } from 'src/utils/formatIdValue'\nimport type {\n Fetch,\n RegistrationType,\n TaxpayerQRCodeResponse,\n TinSearchParams,\n TinSearchResponse,\n} from '../types'\n\ninterface TaxpayerContext {\n fetch: Fetch\n debug: boolean\n}\n\nexport async function tinSearch(\n context: TaxpayerContext,\n params: TinSearchParams,\n): Promise<TinSearchResponse> {\n const { fetch, debug } = context\n const { taxpayerName, idType, idValue } = params\n\n // Validate input parameters according to API requirements\n if (!taxpayerName && (!idType || !idValue)) {\n throw new Error(\n 'Either taxpayerName must be provided, or both idType and idValue must be provided',\n )\n }\n\n if ((idType && !idValue) || (!idType && idValue)) {\n throw new Error('idType and idValue must be provided together')\n }\n\n // Build query parameters\n const queryParams = new URLSearchParams()\n\n if (taxpayerName) {\n queryParams.append('taxpayerName', taxpayerName)\n }\n\n if (idType && idValue) {\n queryParams.append('idType', idType)\n queryParams.append('idValue', formatIdValue(idValue))\n }\n\n const queryString = queryParams.toString()\n\n try {\n const response = await fetch(\n `/api/v1.0/taxpayer/search/tin?${queryString}`,\n {\n method: 'GET',\n },\n )\n return (await response.json()) as TinSearchResponse\n } catch (error) {\n if (debug) {\n console.error('TIN search error:', error)\n }\n throw error\n }\n}\n\nexport async function verifyTin(\n context: TaxpayerContext,\n tin: string,\n idType: RegistrationType,\n idValue: string,\n): Promise<boolean> {\n const { fetch, debug } = context\n\n try {\n const response = await fetch(\n `/api/v1.0/taxpayer/validate/${tin}?idType=${idType}&idValue=${formatIdValue(idValue)}`,\n {\n method: 'GET',\n },\n )\n\n if (!response) {\n // Fetch was stubbed to return undefined or network error occurred\n return false\n }\n\n if (response.ok || response.status === 200) {\n return true\n }\n\n return false\n } catch (error) {\n if (debug) {\n console.error(error)\n }\n return false\n }\n}\n\nexport async function taxpayerQRCode(\n context: TaxpayerContext,\n qrCodeText: string,\n): Promise<TaxpayerQRCodeResponse> {\n const { fetch } = context\n\n const base64EncodedQRCodeText = Buffer.from(qrCodeText).toString('base64')\n\n const response = await fetch(\n `/api/v1.0/taxpayer/qrcodeinfo/${base64EncodedQRCodeText}`,\n )\n\n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