@lucianpacurar/iso20022.js 0.2.17 → 0.2.19
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/index.d.ts +16 -2
- package/dist/index.js +2959 -5768
- package/dist/index.mjs +2959 -5768
- package/dist/src/camt/004/cash-management-return-account.d.ts +1 -1
- package/dist/src/camt/006/cash-management-return-transaction.d.ts +1 -1
- package/dist/src/camt/types.d.ts +1 -1
- package/dist/src/camt/utils.d.ts +1 -1
- package/dist/src/lib/currencies.d.ts +3 -0
- package/dist/src/lib/types.d.ts +7 -1
- package/dist/src/pain/008/sepa-direct-debit-payment-initiation.d.ts +6 -0
- package/dist/src/parseUtils.d.ts +1 -1
- package/dist/test/camt/052/cash-management-account-report.test.d.ts +1 -0
- package/dist/test/pain/008/sepa-direct-debit-payment-initiation.test.d.ts +1 -0
- package/package.json +20 -22
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BalanceInReport, BusinessError } from '../types';
|
|
2
2
|
import { GenericISO20022Message, ISO20022MessageTypeName } from '../../lib/interfaces';
|
|
3
3
|
import { AccountIdentification, CashAccountType, MessageHeader } from '../../lib/types';
|
|
4
|
-
import { Currency } from '
|
|
4
|
+
import { Currency } from '../../lib/currencies';
|
|
5
5
|
export interface AccountReport {
|
|
6
6
|
currency: Currency;
|
|
7
7
|
name?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BusinessError } from '../types';
|
|
2
2
|
import { GenericISO20022Message, ISO20022MessageTypeName } from '../../lib/interfaces';
|
|
3
3
|
import { Agent, MessageHeader, Party } from '../../lib/types';
|
|
4
|
-
import { Currency } from '
|
|
4
|
+
import { Currency } from '../../lib/currencies';
|
|
5
5
|
export interface TransactionReport {
|
|
6
6
|
msgId?: string;
|
|
7
7
|
reqExecutionDate?: Date;
|
package/dist/src/camt/types.d.ts
CHANGED
package/dist/src/camt/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Balance, BalanceInReport, BusinessError, Entry, Statement } from 'camt/types';
|
|
2
|
-
import { Currency } from '
|
|
2
|
+
import { Currency } from '../lib/currencies';
|
|
3
3
|
export declare const parseStatement: (stmt: any) => Statement;
|
|
4
4
|
export declare const exportStatement: (stmt: Statement) => any;
|
|
5
5
|
export declare const parseBalance: (balance: any) => Balance;
|
|
@@ -1 +1,4 @@
|
|
|
1
|
+
export type Currency = 'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BOV' | 'BRL' | 'BSD' | 'BTN' | 'BWP' | 'BYN' | 'BZD' | 'CAD' | 'CDF' | 'CHE' | 'CHF' | 'CHW' | 'CLF' | 'CLP' | 'CNY' | 'COP' | 'COU' | 'CRC' | 'CUC' | 'CUP' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EGP' | 'ERN' | 'ETB' | 'EUR' | 'FJD' | 'FKP' | 'GBP' | 'GEL' | 'GHS' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'INR' | 'IQD' | 'IRR' | 'ISK' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KPW' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRU' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MXV' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'RUB' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SHP' | 'SLE' | 'SLL' | 'SOS' | 'SRD' | 'SSP' | 'STN' | 'SVC' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'USD' | 'USN' | 'UYI' | 'UYU' | 'UYW' | 'UZS' | 'VED' | 'VES' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XCD' | 'XOF' | 'XPF' | 'XSU' | 'XUA' | 'YER' | 'ZAR' | 'ZMW' | 'ZWL';
|
|
1
2
|
export declare function getCurrencyPrecision(currency: string): number;
|
|
3
|
+
export declare function formatMinorUnits(amount: number, currency: Currency): string;
|
|
4
|
+
export declare function minorUnitsToNumber(amount: number, currency: Currency): number;
|
package/dist/src/lib/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Currency } from '
|
|
1
|
+
import { Currency } from './currencies';
|
|
2
2
|
import { Alpha2Country } from './countries';
|
|
3
3
|
/**
|
|
4
4
|
* Represents a payment instruction with essential details.
|
|
@@ -427,6 +427,12 @@ export interface SEPADirectDebitPaymentInstruction extends PaymentInstruction {
|
|
|
427
427
|
type?: 'sepa';
|
|
428
428
|
direction?: 'debit';
|
|
429
429
|
currency: 'EUR';
|
|
430
|
+
/**
|
|
431
|
+
* Optional instruction identification. When provided, emitted as `<InstrId>`
|
|
432
|
+
* inside `<PmtId>` (before `<EndToEndId>`). Max 35 characters. Required to
|
|
433
|
+
* echo as `OrgnlInstrId` in pain.007 reversals.
|
|
434
|
+
*/
|
|
435
|
+
instrId?: string;
|
|
430
436
|
/** The party being debited (money is collected from this party) */
|
|
431
437
|
debtor: Party;
|
|
432
438
|
/** Mandate information authorizing the direct debit */
|
|
@@ -30,6 +30,11 @@ export interface SEPADirectDebitPaymentInstructionGroup {
|
|
|
30
30
|
categoryPurpose?: ExternalCategoryPurpose;
|
|
31
31
|
/** Indicates whether transactions should be booked in batch. Defaults to false. */
|
|
32
32
|
batchBooking?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Optional override for `<PmtInfId>`. When omitted, a UUID is generated.
|
|
35
|
+
* Max 35 characters. Required to echo as `OrgnlPmtInfId` in pain.007 reversals.
|
|
36
|
+
*/
|
|
37
|
+
paymentInformationId?: string;
|
|
33
38
|
}
|
|
34
39
|
/**
|
|
35
40
|
* Configuration for SEPA Direct Debit Payment Initiation.
|
|
@@ -150,6 +155,7 @@ export declare class SEPADirectDebitPaymentInitiation extends PaymentInitiation
|
|
|
150
155
|
} | undefined;
|
|
151
156
|
PmtId: {
|
|
152
157
|
EndToEndId: string;
|
|
158
|
+
InstrId?: string | undefined;
|
|
153
159
|
};
|
|
154
160
|
InstdAmt: {
|
|
155
161
|
'#': string;
|
package/dist/src/parseUtils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Account, AccountIdentification, Agent, MessageHeader, Party, StructuredAddress } from 'lib/types';
|
|
2
|
-
import { Currency } from '
|
|
2
|
+
import { Currency } from './lib/currencies';
|
|
3
3
|
export declare const parseAccount: (account: any) => Account;
|
|
4
4
|
export declare const exportAccount: (account: Account) => any;
|
|
5
5
|
export declare const parseAccountIdentification: (accountId: any) => AccountIdentification;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lucianpacurar/iso20022.js",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.19",
|
|
4
4
|
"readme": "README.md",
|
|
5
5
|
"description": "Library to create payment messages.",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -51,32 +51,30 @@
|
|
|
51
51
|
"license": "MIT",
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@babel/preset-typescript": "^7.24.7",
|
|
54
|
-
"@faker-js/faker": "^8.4.1",
|
|
55
54
|
"@jest/globals": "^29.7.0",
|
|
56
|
-
"@rollup/plugin-commonjs": "^
|
|
57
|
-
"@rollup/plugin-node-resolve": "^
|
|
58
|
-
"@rollup/plugin-typescript": "^
|
|
59
|
-
"@types/dinero.js": "^1.9.4",
|
|
55
|
+
"@rollup/plugin-commonjs": "^29.0.2",
|
|
56
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
57
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
60
58
|
"@types/jest": "^29.5.12",
|
|
61
|
-
"@types/node": "^
|
|
62
|
-
"
|
|
63
|
-
"husky": "^9.1.
|
|
59
|
+
"@types/node": "^24.12.2",
|
|
60
|
+
"decimal.js": "^10.6.0",
|
|
61
|
+
"husky": "^9.1.7",
|
|
64
62
|
"jest": "^29.7.0",
|
|
65
|
-
"
|
|
66
|
-
"lint-staged": "^
|
|
67
|
-
"prettier": "^3.
|
|
68
|
-
"rollup": "^4.
|
|
69
|
-
"rollup-plugin-dts": "^6.
|
|
70
|
-
"ts-jest": "^29.
|
|
63
|
+
"libxmljs2": "^0.37.0",
|
|
64
|
+
"lint-staged": "^16.4.0",
|
|
65
|
+
"prettier": "^3.8.3",
|
|
66
|
+
"rollup": "^4.60.1",
|
|
67
|
+
"rollup-plugin-dts": "^6.4.1",
|
|
68
|
+
"ts-jest": "^29.4.9",
|
|
71
69
|
"ts-node": "^10.9.2",
|
|
72
|
-
"tslib": "^2.
|
|
73
|
-
"tsx": "^4.
|
|
74
|
-
"typescript": "^5.
|
|
70
|
+
"tslib": "^2.8.1",
|
|
71
|
+
"tsx": "^4.21.0",
|
|
72
|
+
"typescript": "^5.9.3"
|
|
75
73
|
},
|
|
76
74
|
"dependencies": {
|
|
77
|
-
"
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"
|
|
75
|
+
"fast-xml-parser": "^5.6.0"
|
|
76
|
+
},
|
|
77
|
+
"peerDependencies": {
|
|
78
|
+
"decimal.js": "^10.0.0"
|
|
81
79
|
}
|
|
82
80
|
}
|