@lucianpacurar/iso20022.js 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +212 -0
  3. package/dist/index.d.ts +1896 -0
  4. package/dist/index.js +10039 -0
  5. package/dist/index.mjs +10023 -0
  6. package/dist/src/camt/003/cash-management-get-account.d.ts +26 -0
  7. package/dist/src/camt/004/cash-management-return-account.d.ts +30 -0
  8. package/dist/src/camt/005/cash-management-get-transaction.d.ts +26 -0
  9. package/dist/src/camt/006/cash-management-return-transaction.d.ts +43 -0
  10. package/dist/src/camt/053/cash-management-end-of-day-report.d.ts +90 -0
  11. package/dist/src/camt/index.d.ts +5 -0
  12. package/dist/src/camt/types.d.ts +191 -0
  13. package/dist/src/camt/utils.d.ts +12 -0
  14. package/dist/src/errors.d.ts +24 -0
  15. package/dist/src/index.d.ts +61 -0
  16. package/dist/src/iso20022.d.ts +375 -0
  17. package/dist/src/lib/countries.d.ts +254 -0
  18. package/dist/src/lib/currencies.d.ts +1 -0
  19. package/dist/src/lib/index.d.ts +4 -0
  20. package/dist/src/lib/interfaces.d.ts +30 -0
  21. package/dist/src/lib/types.d.ts +376 -0
  22. package/dist/src/pain/001/ach-credit-payment-initiation.d.ts +159 -0
  23. package/dist/src/pain/001/payment-initiation.d.ts +105 -0
  24. package/dist/src/pain/001/rtp-credit-payment-initiation.d.ts +118 -0
  25. package/dist/src/pain/001/sepa-credit-payment-initiation.d.ts +126 -0
  26. package/dist/src/pain/001/swift-credit-payment-initiation.d.ts +72 -0
  27. package/dist/src/pain/002/payment-status-report.d.ts +75 -0
  28. package/dist/src/pain/002/types.d.ts +73 -0
  29. package/dist/src/pain/002/utils.d.ts +4 -0
  30. package/dist/src/parseUtils.d.ts +21 -0
  31. package/dist/src/utils/format.d.ts +1 -0
  32. package/dist/test/camt/003/cash-management-get-account.test.d.ts +1 -0
  33. package/dist/test/camt/004/cash-management-return-account.test.d.ts +1 -0
  34. package/dist/test/camt/005/cash-management-get-transaction.test.d.ts +1 -0
  35. package/dist/test/camt/006/cash-management-return-transaction.test.d.ts +1 -0
  36. package/dist/test/camt/053/cash-management-end-of-day-report.test.d.ts +1 -0
  37. package/dist/test/pain/001/ach-credit-payment-initiation.test.d.ts +1 -0
  38. package/dist/test/pain/001/rtp-credit-payment-initiation.test.d.ts +1 -0
  39. package/dist/test/pain/001/sepa-credit-payment-initiation.test.d.ts +1 -0
  40. package/dist/test/pain/001/swift-credit-payment-initiation.test.d.ts +1 -0
  41. package/dist/test/pain/002/payment-status-report.test.d.ts +1 -0
  42. package/dist/test/parseUtils.test.d.ts +1 -0
  43. package/package.json +82 -0
@@ -0,0 +1,118 @@
1
+ import { Party, RTPCreditPaymentInstruction } from '../../lib/types';
2
+ import { PaymentInitiation } from './payment-initiation';
3
+ type AtLeastOne<T> = [T, ...T[]];
4
+ /**
5
+ * Configuration for RTP Credit Payment Initiation.
6
+ *
7
+ * @property {Party} initiatingParty - The party initiating the RTP credit transfer.
8
+ * @property {AtLeastOne<RTPCreditPaymentInstruction>} paymentInstructions - Array containing at least one payment instruction for the RTP credit transfer.
9
+ * @property {string} [messageId] - Optional unique identifier for the message. If not provided, a UUID will be generated.
10
+ * @property {Date} [creationDate] - Optional creation date for the message. If not provided, current date will be used.
11
+ */
12
+ export interface RTPCreditPaymentInitiationConfig {
13
+ /** The party initiating the RTP credit transfer. */
14
+ initiatingParty: Party;
15
+ /** Array containing at least one payment instruction for the RTP credit transfer. */
16
+ paymentInstructions: AtLeastOne<RTPCreditPaymentInstruction>;
17
+ /** Optional unique identifier for the message. If not provided, a UUID will be generated. */
18
+ messageId?: string;
19
+ /** Optional creation date for the message. If not provided, current date will be used. */
20
+ creationDate?: Date;
21
+ }
22
+ /**
23
+ * Represents a RTP Credit Payment Initiation.
24
+ * This class handles the creation and serialization of RTP credit transfer messages
25
+ * according to the ISO20022 standard.
26
+ * @class
27
+ * @extends PaymentInitiation
28
+ * @param {RTPCreditPaymentInitiationConfig} config - The configuration for the RTP Credit Payment Initiation message.
29
+ * @example
30
+ * ```typescript
31
+ * // Creating a payment message
32
+ * const payment = new RTPCreditPaymentInitiation({
33
+ * ...
34
+ * });
35
+ * // Uploading to fiatwebservices.com
36
+ * client.paymentTransfers.create(payment);
37
+ * // Parsing from XML
38
+ * const xml = '<xml>...</xml>';
39
+ * const parsedTransfer = RTPCreditPaymentInitiation.fromXML(xml);
40
+ * ```
41
+ * @see {@link https://docs.iso20022js.com/pain/rtpcredit} for more information.
42
+ */
43
+ export declare class RTPCreditPaymentInitiation extends PaymentInitiation {
44
+ initiatingParty: Party;
45
+ paymentInstructions: AtLeastOne<RTPCreditPaymentInstruction>;
46
+ messageId: string;
47
+ creationDate: Date;
48
+ paymentInformationId: string;
49
+ private formattedPaymentSum;
50
+ constructor(config: RTPCreditPaymentInitiationConfig);
51
+ /**
52
+ * Calculates the sum of all payment instructions.
53
+ * @private
54
+ * @param {AtLeastOne<RTPCreditPaymentInstruction>} instructions - Array of payment instructions.
55
+ * @returns {string} The total sum formatted as a string with 2 decimal places.
56
+ * @throws {Error} If payment instructions have different currencies.
57
+ */
58
+ private sumPaymentInstructions;
59
+ /**
60
+ * Validates the payment initiation data according to SEPA requirements.
61
+ * @private
62
+ * @throws {Error} If messageId exceeds 35 characters.
63
+ * @throws {Error} If payment instructions have different currencies.
64
+ * @throws {Error} If any creditor has incomplete address information.
65
+ */
66
+ private validate;
67
+ /**
68
+ * Generates payment information for a single SEPA credit transfer instruction.
69
+ * @param {RTPCreditPaymentInstruction} instruction - The payment instruction.
70
+ * @returns {Object} The payment information object formatted according to SEPA specifications.
71
+ */
72
+ creditTransfer(instruction: RTPCreditPaymentInstruction): {
73
+ PmtId: {
74
+ InstrId: string;
75
+ EndToEndId: string;
76
+ };
77
+ Amt: {
78
+ InstdAmt: {
79
+ '#': string;
80
+ '@Ccy': "USD";
81
+ };
82
+ };
83
+ CdtrAgt: {
84
+ FinInstnId: {
85
+ BIC: string;
86
+ ClrSysMmbId?: undefined;
87
+ };
88
+ } | {
89
+ FinInstnId: {
90
+ ClrSysMmbId: {
91
+ ClrSysId: {
92
+ Cd: string;
93
+ };
94
+ MmbId: string;
95
+ };
96
+ BIC?: undefined;
97
+ };
98
+ };
99
+ Cdtr: any;
100
+ CdtrAcct: {
101
+ Id: {
102
+ Othr: {
103
+ Id: string;
104
+ };
105
+ };
106
+ };
107
+ RmtInf: {
108
+ Ustrd: string;
109
+ } | undefined;
110
+ };
111
+ /**
112
+ * Serializes the RTP credit transfer initiation to an XML string.
113
+ * @returns {string} The XML representation of the RTP credit transfer initiation.
114
+ */
115
+ serialize(): string;
116
+ static fromXML(rawXml: string): RTPCreditPaymentInitiation;
117
+ }
118
+ export {};
@@ -0,0 +1,126 @@
1
+ import { ExternalCategoryPurpose, Party, SEPACreditPaymentInstruction } from "../../lib/types";
2
+ import { PaymentInitiation } from './payment-initiation';
3
+ type AtLeastOne<T> = [T, ...T[]];
4
+ /**
5
+ * Configuration for SEPA Credit Payment Initiation.
6
+ *
7
+ * @property {Party} initiatingParty - The party initiating the SEPA credit transfer.
8
+ * @property {AtLeastOne<SEPACreditPaymentInstruction>} paymentInstructions - An array containing at least one payment instruction for SEPA credit transfer.
9
+ * @property {string} [messageId] - Optional unique identifier for the message. If not provided, a UUID will be generated.
10
+ * @property {Date} [creationDate] - Optional creation date for the message. If not provided, current date will be used.
11
+ * @property {ExternalCategoryPurpose} [categoryPurpose] - Optional category purpose code following ISO20022 ExternalCategoryPurpose1Code standard.
12
+ */
13
+ export interface SEPACreditPaymentInitiationConfig {
14
+ /** The party initiating the SEPA credit transfer. */
15
+ initiatingParty: Party;
16
+ /** An array containing at least one payment instruction for SEPA credit transfer. */
17
+ paymentInstructions: AtLeastOne<SEPACreditPaymentInstruction>;
18
+ /** Optional unique identifier for the message. If not provided, a UUID will be generated. */
19
+ messageId?: string;
20
+ /** Optional creation date for the message. If not provided, current date will be used. */
21
+ creationDate?: Date;
22
+ /** Optional category purpose code following ISO20022 ExternalCategoryPurpose1Code standard */
23
+ categoryPurpose?: ExternalCategoryPurpose;
24
+ }
25
+ /**
26
+ * Represents a SEPA Credit Payment Initiation.
27
+ * This class handles the creation and serialization of SEPA credit transfer messages
28
+ * according to the ISO20022 standard.
29
+ * @class
30
+ * @extends PaymentInitiation
31
+ * @param {SEPACreditPaymentInitiationConfig} config - The configuration for the SEPA Credit Payment Initiation message.
32
+ * @example
33
+ * ```typescript
34
+ * // Creating a SEPA payment message
35
+ * const payment = new SEPACreditPaymentInitiation({
36
+ * // configuration options
37
+ * });
38
+ * // Uploading the payment
39
+ * client.paymentTransfers.create(payment);
40
+ * // Parsing from XML
41
+ * const xml = '<xml>...</xml>';
42
+ * const parsedTransfer = SEPACreditPaymentInitiation.fromXML(xml);
43
+ * ```
44
+ * @see {@link https://docs.iso20022js.com/pain/sepacredit} for more information.
45
+ */
46
+ export declare class SEPACreditPaymentInitiation extends PaymentInitiation {
47
+ initiatingParty: Party;
48
+ messageId: string;
49
+ creationDate: Date;
50
+ paymentInstructions: AtLeastOne<SEPACreditPaymentInstruction>;
51
+ paymentInformationId: string;
52
+ categoryPurpose?: ExternalCategoryPurpose;
53
+ private formattedPaymentSum;
54
+ /**
55
+ * Creates an instance of SEPACreditPaymentInitiation.
56
+ * @param {SEPACreditPaymentInitiationConfig} config - The configuration object for the SEPA credit transfer.
57
+ */
58
+ constructor(config: SEPACreditPaymentInitiationConfig);
59
+ /**
60
+ * Calculates the sum of all payment instructions.
61
+ * @private
62
+ * @param {AtLeastOne<SEPACreditPaymentInstruction>} instructions - Array of payment instructions.
63
+ * @returns {string} The total sum formatted as a string with 2 decimal places.
64
+ * @throws {Error} If payment instructions have different currencies.
65
+ */
66
+ private sumPaymentInstructions;
67
+ /**
68
+ * Validates the payment initiation data according to SEPA requirements.
69
+ * @private
70
+ * @throws {Error} If messageId exceeds 35 characters.
71
+ * @throws {Error} If payment instructions have different currencies.
72
+ * @throws {Error} If any creditor has incomplete address information.
73
+ */
74
+ private validate;
75
+ private validateAllInstructionsHaveSameCurrency;
76
+ /**
77
+ * Generates payment information for a single SEPA credit transfer instruction.
78
+ * @param {SEPACreditPaymentInstruction} instruction - The payment instruction.
79
+ * @returns {Object} The payment information object formatted according to SEPA specifications.
80
+ */
81
+ creditTransfer(instruction: SEPACreditPaymentInstruction): {
82
+ Cdtr: any;
83
+ CdtrAcct: {
84
+ Id: {
85
+ IBAN: string;
86
+ };
87
+ Ccy: "EUR";
88
+ };
89
+ RmtInf: {
90
+ Ustrd: string;
91
+ } | undefined;
92
+ CdtrAgt?: {
93
+ FinInstnId: {
94
+ BIC: string;
95
+ ClrSysMmbId?: undefined;
96
+ };
97
+ } | {
98
+ FinInstnId: {
99
+ ClrSysMmbId: {
100
+ ClrSysId: {
101
+ Cd: string;
102
+ };
103
+ MmbId: string;
104
+ };
105
+ BIC?: undefined;
106
+ };
107
+ } | undefined;
108
+ PmtId: {
109
+ InstrId: string;
110
+ EndToEndId: string;
111
+ };
112
+ Amt: {
113
+ InstdAmt: {
114
+ '#': string;
115
+ '@Ccy': "EUR";
116
+ };
117
+ };
118
+ };
119
+ /**
120
+ * Serializes the SEPA credit transfer initiation to an XML string.
121
+ * @returns {string} The XML representation of the SEPA credit transfer initiation.
122
+ */
123
+ serialize(): string;
124
+ static fromXML(rawXml: string): SEPACreditPaymentInitiation;
125
+ }
126
+ export {};
@@ -0,0 +1,72 @@
1
+ import { Party, SWIFTCreditPaymentInstruction } from '../../lib/types.js';
2
+ import { PaymentInitiation } from './payment-initiation';
3
+ type AtLeastOne<T> = [T, ...T[]];
4
+ /**
5
+ * Configuration for SWIFT Credit Payment Initiation.
6
+ *
7
+ * @property {Party} initiatingParty - The party initiating the payment.
8
+ * @property {AtLeastOne<SWIFTCreditPaymentInstruction>} paymentInstructions - An array of payment instructions.
9
+ * @property {string} [messageId] - Optional unique identifier for the message. If not provided, a UUID will be generated.
10
+ * @property {Date} [creationDate] - Optional creation date for the message. If not provided, current date will be used.
11
+ */
12
+ export interface SWIFTCreditPaymentInitiationConfig {
13
+ /** The party initiating the payment. */
14
+ initiatingParty: Party;
15
+ /** An array of payment instructions. */
16
+ paymentInstructions: AtLeastOne<SWIFTCreditPaymentInstruction>;
17
+ /** Optional unique identifier for the message. If not provided, a UUID will be generated. */
18
+ messageId?: string;
19
+ /** Optional creation date for the message. If not provided, current date will be used. */
20
+ creationDate?: Date;
21
+ }
22
+ /**
23
+ * Represents a SWIFT Credit Payment v3 Initiation message (pain.001.001.03).
24
+ * @class
25
+ * @extends PaymentInitiation
26
+ * @param {SWIFTCreditPaymentInitiationConfig} config - The configuration for the SWIFT Credit Payment Initiation message.
27
+ * @example
28
+ * ```typescript
29
+ * // Creating a payment message
30
+ * const payment = new SWIFTCreditPaymentInitiation({
31
+ * ...
32
+ * });
33
+ * // Uploading to fiatwebservices.com
34
+ * client.paymentTransfers.create(payment);
35
+ * // Parsing from XML
36
+ * const xml = '<xml>...</xml>';
37
+ * const parsedTransfer = SWIFTCreditPaymentInitiation.fromXML(xml);
38
+ * ```
39
+ * @see {@link https://docs.iso20022js.com/pain/sepacredit} for more information.
40
+ */
41
+ export declare class SWIFTCreditPaymentInitiation extends PaymentInitiation {
42
+ initiatingParty: Party;
43
+ messageId: string;
44
+ creationDate: Date;
45
+ paymentInstructions: SWIFTCreditPaymentInstruction[];
46
+ paymentInformationId: string;
47
+ /**
48
+ * Creates an instance of SWIFTCreditPaymentInitiation.
49
+ * @param {SWIFTCreditPaymentInitiationConfig} config - The configuration object.
50
+ */
51
+ constructor(config: SWIFTCreditPaymentInitiationConfig);
52
+ /**
53
+ * Validates the payment initiation data has the information required to create a valid XML file.
54
+ * @private
55
+ * @throws {Error} If messageId exceeds 35 characters.
56
+ * @throws {Error} If any creditor has incomplete address information.
57
+ */
58
+ private validate;
59
+ /**
60
+ * Generates payment information for a single payment instruction.
61
+ * @param {SWIFTCreditPaymentInstruction} paymentInstruction - The payment instruction.
62
+ * @returns {Object} The credit transfer object.
63
+ */
64
+ creditTransfer(paymentInstruction: SWIFTCreditPaymentInstruction): Record<string, any>;
65
+ /**
66
+ * Serializes the payment initiation to an XML string.
67
+ * @returns {string} The XML representation of the payment initiation.
68
+ */
69
+ static fromXML(rawXml: string): SWIFTCreditPaymentInitiation;
70
+ serialize(): string;
71
+ }
72
+ export {};
@@ -0,0 +1,75 @@
1
+ import { Party } from '../../lib/types';
2
+ import { StatusInformation, PaymentStatus, OriginalGroupInformation } from './types';
3
+ /**
4
+ * Configuration interface for creating a PaymentStatusReport instance.
5
+ */
6
+ interface PaymentStatusReportConfig {
7
+ /** Unique identifier for the message */
8
+ messageId: string;
9
+ creationDate: Date;
10
+ initatingParty: Party;
11
+ originalGroupInformation: OriginalGroupInformation;
12
+ statusInformations: StatusInformation[];
13
+ }
14
+ /**
15
+ * Represents a Payment Status Report, containing information about the status of payments and transactions.
16
+ */
17
+ export declare class PaymentStatusReport {
18
+ private _messageId;
19
+ private _creationDate;
20
+ private _initatingParty;
21
+ private _originalGroupInformation;
22
+ private _statusInformations;
23
+ /**
24
+ * Creates a new PaymentStatusReport instance.
25
+ * @param {PaymentStatusReportConfig} config - The configuration object for the PaymentStatusReport.
26
+ */
27
+ constructor(config: PaymentStatusReportConfig);
28
+ /**
29
+ * Creates a PaymentStatusReport instance from an XML string.
30
+ * @param {string} rawXml - The raw XML string to parse.
31
+ * @returns {PaymentStatusReport} A new PaymentStatusReport instance.
32
+ */
33
+ static fromXML(rawXml: string): PaymentStatusReport;
34
+ /**
35
+ * Gets the message ID of the Payment Status Report.
36
+ * @returns {string} The message ID.
37
+ */
38
+ get messageId(): string;
39
+ /**
40
+ * Gets the creation date of the Payment Status Report.
41
+ * @returns {Date} The creation date.
42
+ */
43
+ get creationDate(): Date;
44
+ /**
45
+ * Gets the initiating party of the Payment Status Report.
46
+ * @returns {Party} The initiating party.
47
+ */
48
+ get initatingParty(): Party;
49
+ /**
50
+ * Gets the original message ID from the original group information.
51
+ * @returns {string} The original message ID.
52
+ */
53
+ get originalMessageId(): string;
54
+ /**
55
+ * Gets all status information entries in the Payment Status Report.
56
+ * @returns {StatusInformation[]} An array of StatusInformation objects.
57
+ */
58
+ get statusInformations(): StatusInformation[];
59
+ /**
60
+ * Gets the first status information entry in the Payment Status Report.
61
+ * @returns {StatusInformation} The first StatusInformation object in the statuses array.
62
+ */
63
+ get firstStatusInformation(): StatusInformation;
64
+ /**
65
+ * Gets the original ID based on the type of the first status information.
66
+ * @returns {string} The original ID, which could be the original message ID, payment ID, or end-to-end ID.
67
+ */
68
+ get originalId(): string;
69
+ /**
70
+ * Gets the status from the first status information entry.
71
+ * @returns {PaymentStatus} The Status from the first status information.
72
+ */
73
+ get status(): PaymentStatus;
74
+ }
75
+ export {};
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Represents the original group information in a payment status report.
3
+ */
4
+ export interface OriginalGroupInformation {
5
+ /** The original message ID associated with the group. */
6
+ originalMessageId: string;
7
+ }
8
+ /**
9
+ * Represents the type of status in a payment status report.
10
+ */
11
+ export type StatusType = 'group' | 'payment' | 'transaction';
12
+ /**
13
+ * Represents the status codes in a payment status report.
14
+ * @see {@link https://www.iso20022.org/sites/default/files/2022-03/externalcodesets_4q2021_v2_1.xlsx}
15
+ */
16
+ export declare const PaymentStatusCode: {
17
+ readonly Rejected: "RJCT";
18
+ readonly PartiallyAccepted: "ACCP";
19
+ readonly Pending: "PNDG";
20
+ readonly Accepted: "ACCP";
21
+ readonly AcceptedSettlementInProgress: "ACSP";
22
+ readonly AcceptedCreditSettlementCompleted: "ACSC";
23
+ readonly AcceptedSettlementCompleted: "ACSC";
24
+ readonly AcceptedTechnicalValidation: "ACTC";
25
+ };
26
+ export type PaymentStatus = (typeof PaymentStatusCode)[keyof typeof PaymentStatusCode];
27
+ /**
28
+ * Represents the base structure for status information in a payment status report.
29
+ */
30
+ export interface BaseStatusInformation {
31
+ /** The type of status (group, payment, or transaction). */
32
+ type: StatusType;
33
+ /** The status value. */
34
+ status: PaymentStatus;
35
+ /** Optional reason for the status. */
36
+ reason?: {
37
+ /** Optional reason code. */
38
+ code?: string;
39
+ /** Optional additional information about the reason. */
40
+ additionalInformation?: string;
41
+ };
42
+ }
43
+ /**
44
+ * Represents the status information for a group in a payment status report.
45
+ */
46
+ export interface GroupStatusInformation extends BaseStatusInformation {
47
+ /** The type is always 'group' for GroupStatus. */
48
+ type: 'group';
49
+ /** The original message ID associated with the group. */
50
+ originalMessageId: string;
51
+ }
52
+ /**
53
+ * Represents the status information for a payment in a payment status report.
54
+ */
55
+ export interface PaymentStatusInformation extends BaseStatusInformation {
56
+ /** The type is always 'payment' for PaymentStatus. */
57
+ type: 'payment';
58
+ /** The original payment ID associated with the payment. */
59
+ originalPaymentId: string;
60
+ }
61
+ /**
62
+ * Represents the status information for a transaction in a payment status report.
63
+ */
64
+ export interface TransactionStatusInformation extends BaseStatusInformation {
65
+ /** The type is always 'transaction' for TransactionStatus. */
66
+ type: 'transaction';
67
+ /** The original end-to-end ID associated with the transaction. */
68
+ originalEndToEndId: string;
69
+ }
70
+ /**
71
+ * Represents the union type of all possible status information types in a payment status report.
72
+ */
73
+ export type StatusInformation = GroupStatusInformation | PaymentStatusInformation | TransactionStatusInformation;
@@ -0,0 +1,4 @@
1
+ import { GroupStatusInformation, PaymentStatusInformation, TransactionStatusInformation } from './types';
2
+ export declare const parseGroupStatusInformation: (originalGroupInfAndStatus: any) => GroupStatusInformation | null;
3
+ export declare const parsePaymentStatusInformations: (originalPaymentInfAndStatuses: any) => PaymentStatusInformation[];
4
+ export declare const parseTransactionStatusInformations: (allTxnsInfoAndStatuses: any[]) => TransactionStatusInformation[];
@@ -0,0 +1,21 @@
1
+ import { Account, AccountIdentification, Agent, MessageHeader, Party, StructuredAddress } from 'lib/types';
2
+ import { Currency } from 'dinero.js';
3
+ export declare const parseAccount: (account: any) => Account;
4
+ export declare const exportAccount: (account: Account) => any;
5
+ export declare const parseAccountIdentification: (accountId: any) => AccountIdentification;
6
+ export declare const exportAccountIdentification: (accountId: AccountIdentification) => any;
7
+ export declare const parseAgent: (agent: any) => Agent;
8
+ export declare const exportAgent: (agent: Agent) => any;
9
+ export declare const parseAmountToMinorUnits: (rawAmount: number, currency?: Currency) => number;
10
+ export declare const exportAmountToString: (amount: number, currency?: Currency) => string;
11
+ export declare const parseDate: (dateElement: any) => Date;
12
+ export declare const parseParty: (party: any) => Party;
13
+ export declare const parseRecipient: (recipient: any) => {
14
+ id?: string;
15
+ name?: string;
16
+ address?: StructuredAddress;
17
+ };
18
+ export declare const exportRecipient: (recipient: ReturnType<typeof parseRecipient>) => any;
19
+ export declare const parseAdditionalInformation: (additionalInformation: any) => string | undefined;
20
+ export declare const parseMessageHeader: (rawHeader: any) => MessageHeader;
21
+ export declare const exportMessageHeader: (header: MessageHeader) => any;
@@ -0,0 +1 @@
1
+ export declare const sanitize: (value: string, length: 35) => string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,82 @@
1
+ {
2
+ "name": "@lucianpacurar/iso20022.js",
3
+ "version": "0.2.7",
4
+ "readme": "README.md",
5
+ "description": "Library to create payment messages.",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "module": "dist/index.mjs",
9
+ "scripts": {
10
+ "test": "npx jest",
11
+ "coverage": "npx jest --coverage",
12
+ "shell": "npx tsx --experimental-repl-await",
13
+ "build": "rollup -c",
14
+ "type-check": "tsc --noEmit",
15
+ "create-patch-version": "npm run build && npm version patch && git push origin --tags && npm publish",
16
+ "example:swift": "npx tsx examples/swift-credit-transfer.ts",
17
+ "example:sepa": "npx tsx examples/sepa-credit-transfer.ts",
18
+ "example:rtp": "npx tsx examples/rtp-credit-transfer.ts",
19
+ "example:ach": "npx tsx examples/ach-credit-transfer.ts",
20
+ "coveralls": "npm run coverage && coveralls report"
21
+ },
22
+ "exports": {
23
+ ".": {
24
+ "require": "./dist/index.js",
25
+ "import": "./dist/index.mjs",
26
+ "types": "./dist/index.d.ts"
27
+ }
28
+ },
29
+ "files": [
30
+ "dist"
31
+ ],
32
+ "type": "module",
33
+ "keywords": [
34
+ "iso20022",
35
+ "finance",
36
+ "fintech",
37
+ "payments"
38
+ ],
39
+ "husky": {
40
+ "hooks": {
41
+ "pre-commit": "lint-staged"
42
+ }
43
+ },
44
+ "lint-staged": {
45
+ "*.{js,jsx,ts,tsx,json,css,scss,md}": [
46
+ "prettier --write"
47
+ ]
48
+ },
49
+ "homepage": "https://iso20022js.com",
50
+ "author": "svapnil",
51
+ "license": "MIT",
52
+ "devDependencies": {
53
+ "@babel/preset-typescript": "^7.24.7",
54
+ "@faker-js/faker": "^8.4.1",
55
+ "@jest/globals": "^29.7.0",
56
+ "@rollup/plugin-commonjs": "^26.0.1",
57
+ "@rollup/plugin-node-resolve": "^15.2.3",
58
+ "@rollup/plugin-typescript": "^11.1.6",
59
+ "@types/dinero.js": "^1.9.4",
60
+ "@types/jest": "^29.5.12",
61
+ "@types/node": "^20.14.12",
62
+ "@types/uuid": "^10.0.0",
63
+ "husky": "^9.1.4",
64
+ "jest": "^29.7.0",
65
+ "libxmljs": "^1.0.11",
66
+ "lint-staged": "^15.2.8",
67
+ "prettier": "^3.3.3",
68
+ "rollup": "^4.19.2",
69
+ "rollup-plugin-dts": "^6.1.1",
70
+ "ts-jest": "^29.2.3",
71
+ "ts-node": "^10.9.2",
72
+ "tslib": "^2.6.3",
73
+ "tsx": "^4.20.5",
74
+ "typescript": "^5.5.4"
75
+ },
76
+ "dependencies": {
77
+ "decimal.js": "^10.6.0",
78
+ "dinero.js": "^1.9.1",
79
+ "fast-xml-parser": "^4.4.1",
80
+ "uuid": "^10.0.0"
81
+ }
82
+ }