@pax2pay/model-banking 0.1.652 → 0.1.653
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/Rule/State/Transaction.ts +1 -25
- package/Rule/State/index.ts +0 -15
- package/Transaction/Creatable.ts +3 -1
- package/dist/cjs/Rule/State/Transaction.d.ts +0 -1
- package/dist/cjs/Rule/State/Transaction.js +1 -21
- package/dist/cjs/Rule/State/Transaction.js.map +1 -1
- package/dist/cjs/Rule/State/index.d.ts +0 -4
- package/dist/cjs/Rule/State/index.js +0 -9
- package/dist/cjs/Rule/State/index.js.map +1 -1
- package/dist/cjs/Transaction/Creatable.d.ts +4 -3
- package/dist/cjs/Transaction/Creatable.js +1 -0
- package/dist/cjs/Transaction/Creatable.js.map +1 -1
- package/dist/mjs/Rule/State/Transaction.d.ts +0 -1
- package/dist/mjs/Rule/State/Transaction.js +1 -21
- package/dist/mjs/Rule/State/Transaction.js.map +1 -1
- package/dist/mjs/Rule/State/index.d.ts +0 -4
- package/dist/mjs/Rule/State/index.js +0 -9
- package/dist/mjs/Rule/State/index.js.map +1 -1
- package/dist/mjs/Transaction/Creatable.d.ts +4 -3
- package/dist/mjs/Transaction/Creatable.js +1 -0
- package/dist/mjs/Transaction/Creatable.js.map +1 -1
- package/package.json +2 -1
|
@@ -30,31 +30,7 @@ export namespace Transaction {
|
|
|
30
30
|
kind,
|
|
31
31
|
amount,
|
|
32
32
|
type: ModelTransaction.getType(transaction.counterpart, account.name),
|
|
33
|
-
original: {
|
|
34
|
-
currency: transaction.currency,
|
|
35
|
-
amount,
|
|
36
|
-
total: amount,
|
|
37
|
-
},
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
export function fromPreTransaction(
|
|
41
|
-
accountName: string,
|
|
42
|
-
transaction: ModelTransaction.PreTransaction | ModelTransaction,
|
|
43
|
-
kind: Rule.Base.Kind,
|
|
44
|
-
stage: "finalize" | "initiate"
|
|
45
|
-
): Transaction {
|
|
46
|
-
return {
|
|
47
|
-
...transaction,
|
|
48
|
-
id: "id" in transaction ? transaction.id : ModelTransaction.Identifier.generate(),
|
|
49
|
-
stage,
|
|
50
|
-
kind,
|
|
51
|
-
amount: Math.abs(typeof transaction.amount == "number" ? transaction.amount : transaction.amount.total),
|
|
52
|
-
type: ModelTransaction.getType(transaction.counterpart, accountName),
|
|
53
|
-
original: {
|
|
54
|
-
currency: transaction.currency,
|
|
55
|
-
amount: Math.abs(typeof transaction.amount == "number" ? transaction.amount : transaction.amount.original),
|
|
56
|
-
total: Math.abs(typeof transaction.amount == "number" ? transaction.amount : transaction.amount.total),
|
|
57
|
-
},
|
|
33
|
+
original: { currency: transaction.currency, amount, total: amount },
|
|
58
34
|
}
|
|
59
35
|
}
|
|
60
36
|
}
|
package/Rule/State/index.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
2
|
import { Account as ModelAccount } from "../../Account"
|
|
3
|
-
import type { Card as ModelCard } from "../../Card"
|
|
4
3
|
import { Rail } from "../../Rail"
|
|
5
4
|
import type { Transaction as ModelTransaction } from "../../Transaction"
|
|
6
5
|
import type { Rule } from "../index"
|
|
@@ -58,18 +57,4 @@ export namespace State {
|
|
|
58
57
|
incoming: "inbound",
|
|
59
58
|
outgoing: "outbound",
|
|
60
59
|
}
|
|
61
|
-
export function fromPreTransaction(
|
|
62
|
-
account: ModelAccount,
|
|
63
|
-
address: Rail.Address,
|
|
64
|
-
transaction: ModelTransaction.PreTransaction,
|
|
65
|
-
card?: ModelCard & { statistics: Card.Statistics },
|
|
66
|
-
organization?: Organization
|
|
67
|
-
): State {
|
|
68
|
-
return {
|
|
69
|
-
account: Account.from(account, address),
|
|
70
|
-
transaction: Transaction.from(account, transaction, type[transaction.type], "initiate"),
|
|
71
|
-
card: card ? Card.from(card, card.statistics) : undefined,
|
|
72
|
-
organization,
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
60
|
}
|
package/Transaction/Creatable.ts
CHANGED
|
@@ -12,15 +12,17 @@ export interface Creatable {
|
|
|
12
12
|
amount: number
|
|
13
13
|
description: string
|
|
14
14
|
exchange?: Exchange
|
|
15
|
+
reference?: { reference?: string }
|
|
15
16
|
}
|
|
16
17
|
export namespace Creatable {
|
|
17
|
-
export type Resolved =
|
|
18
|
+
export type Resolved = Creatable | CardTransaction
|
|
18
19
|
export const type = isly.object<Creatable>({
|
|
19
20
|
counterpart: Rail.Address.type,
|
|
20
21
|
currency: isly.fromIs("isoly.Currency", isoly.Currency.is),
|
|
21
22
|
amount: isly.number(),
|
|
22
23
|
description: isly.string(),
|
|
23
24
|
exchange: Exchange.type.optional(),
|
|
25
|
+
reference: isly.object<{ reference?: string }>({ reference: isly.string().optional() }).optional(),
|
|
24
26
|
})
|
|
25
27
|
export interface CardTransaction extends Creatable {
|
|
26
28
|
account: Pick<Rail.Address.Card, "id" | "type">
|
|
@@ -16,5 +16,4 @@ export type Transaction = ModelTransaction.Creatable.Resolved & {
|
|
|
16
16
|
};
|
|
17
17
|
export declare namespace Transaction {
|
|
18
18
|
function from(account: ModelAccount, transaction: ModelTransaction.Creatable.Resolved | ModelTransaction, kind: Rule.Base.Kind, stage: "finalize" | "initiate"): Transaction;
|
|
19
|
-
function fromPreTransaction(accountName: string, transaction: ModelTransaction.PreTransaction | ModelTransaction, kind: Rule.Base.Kind, stage: "finalize" | "initiate"): Transaction;
|
|
20
19
|
}
|
|
@@ -13,29 +13,9 @@ var Transaction;
|
|
|
13
13
|
kind,
|
|
14
14
|
amount,
|
|
15
15
|
type: Transaction_1.Transaction.getType(transaction.counterpart, account.name),
|
|
16
|
-
original: {
|
|
17
|
-
currency: transaction.currency,
|
|
18
|
-
amount,
|
|
19
|
-
total: amount,
|
|
20
|
-
},
|
|
16
|
+
original: { currency: transaction.currency, amount, total: amount },
|
|
21
17
|
};
|
|
22
18
|
}
|
|
23
19
|
Transaction.from = from;
|
|
24
|
-
function fromPreTransaction(accountName, transaction, kind, stage) {
|
|
25
|
-
return {
|
|
26
|
-
...transaction,
|
|
27
|
-
id: "id" in transaction ? transaction.id : Transaction_1.Transaction.Identifier.generate(),
|
|
28
|
-
stage,
|
|
29
|
-
kind,
|
|
30
|
-
amount: Math.abs(typeof transaction.amount == "number" ? transaction.amount : transaction.amount.total),
|
|
31
|
-
type: Transaction_1.Transaction.getType(transaction.counterpart, accountName),
|
|
32
|
-
original: {
|
|
33
|
-
currency: transaction.currency,
|
|
34
|
-
amount: Math.abs(typeof transaction.amount == "number" ? transaction.amount : transaction.amount.original),
|
|
35
|
-
total: Math.abs(typeof transaction.amount == "number" ? transaction.amount : transaction.amount.total),
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
Transaction.fromPreTransaction = fromPreTransaction;
|
|
40
20
|
})(Transaction || (exports.Transaction = Transaction = {}));
|
|
41
21
|
//# sourceMappingURL=Transaction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transaction.js","sourceRoot":"","sources":["../../../../Rule/State/Transaction.ts"],"names":[],"mappings":";;;AAEA,mDAAmE;AAenE,IAAiB,WAAW,
|
|
1
|
+
{"version":3,"file":"Transaction.js","sourceRoot":"","sources":["../../../../Rule/State/Transaction.ts"],"names":[],"mappings":";;;AAEA,mDAAmE;AAenE,IAAiB,WAAW,CAkB3B;AAlBD,WAAiB,WAAW;IAC3B,SAAgB,IAAI,CACnB,OAAqB,EACrB,WAAmE,EACnE,IAAoB,EACpB,KAA8B;QAE9B,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,WAAW,CAAC,MAAM,IAAI,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;QACjH,OAAO;YACN,GAAG,WAAW;YACd,EAAE,EAAE,IAAI,IAAI,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,yBAAgB,CAAC,UAAU,CAAC,QAAQ,EAAE;YACjF,KAAK;YACL,IAAI;YACJ,MAAM;YACN,IAAI,EAAE,yBAAgB,CAAC,OAAO,CAAC,WAAW,CAAC,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC;YACrE,QAAQ,EAAE,EAAE,QAAQ,EAAE,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;SACnE,CAAA;IACF,CAAC;IAhBe,gBAAI,OAgBnB,CAAA;AACF,CAAC,EAlBgB,WAAW,2BAAX,WAAW,QAkB3B"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isly } from "isly";
|
|
2
2
|
import { Account as ModelAccount } from "../../Account";
|
|
3
|
-
import type { Card as ModelCard } from "../../Card";
|
|
4
3
|
import { Rail } from "../../Rail";
|
|
5
4
|
import type { Transaction as ModelTransaction } from "../../Transaction";
|
|
6
5
|
import type { Rule } from "../index";
|
|
@@ -37,7 +36,4 @@ export declare namespace State {
|
|
|
37
36
|
}
|
|
38
37
|
function from(account: ModelAccount, address: Rail.Address, transaction: ModelTransaction.Creatable.Resolved | ModelTransaction, kind: Rule.Base.Kind, stage: "finalize" | "initiate", card?: Card, organization?: Organization): State;
|
|
39
38
|
const type: Record<ModelTransaction.PreTransaction["type"], Rule.Base.Kind>;
|
|
40
|
-
function fromPreTransaction(account: ModelAccount, address: Rail.Address, transaction: ModelTransaction.PreTransaction, card?: ModelCard & {
|
|
41
|
-
statistics: Card.Statistics;
|
|
42
|
-
}, organization?: Organization): State;
|
|
43
39
|
}
|
|
@@ -36,14 +36,5 @@ var State;
|
|
|
36
36
|
incoming: "inbound",
|
|
37
37
|
outgoing: "outbound",
|
|
38
38
|
};
|
|
39
|
-
function fromPreTransaction(account, address, transaction, card, organization) {
|
|
40
|
-
return {
|
|
41
|
-
account: State.Account.from(account, address),
|
|
42
|
-
transaction: State.Transaction.from(account, transaction, State.type[transaction.type], "initiate"),
|
|
43
|
-
card: card ? State.Card.from(card, card.statistics) : undefined,
|
|
44
|
-
organization,
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
State.fromPreTransaction = fromPreTransaction;
|
|
48
39
|
})(State || (exports.State = State = {}));
|
|
49
40
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Rule/State/index.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Rule/State/index.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;AAK3B,uCAAmD;AACnD,mDAAqE;AACrE,iCAA0C;AAC1C,iDAAkE;AAClE,uCAAmD;AACnD,+CAA+D;AAS/D,IAAiB,KAAK,CAwCrB;AAxCD,WAAiB,KAAK;IACP,aAAO,GAAG,iBAAY,CAAA;IACtB,mBAAa,GAAG,6BAAkB,CAAA;IAClC,UAAI,GAAG,WAAS,CAAA;IAChB,aAAO,GAAG,iBAAY,CAAA;IACtB,iBAAW,GAAG,yBAAgB,CAAA;IAC9B,kBAAY,GAAG,2BAAiB,CAAA;IAE9C,IAAiB,OAAO,CAGvB;IAHD,WAAiB,OAAO;QACV,cAAM,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAA;QACjD,YAAI,GAAG,WAAI,CAAC,MAAM,CAAU,QAAA,MAAM,CAAC,CAAA;IACjD,CAAC,EAHgB,OAAO,GAAP,aAAO,KAAP,aAAO,QAGvB;IAOD,SAAgB,IAAI,CACnB,OAAqB,EACrB,OAAqB,EACrB,WAAmE,EACnE,IAAoB,EACpB,KAA8B,EAC9B,IAAW,EACX,YAA2B;QAE3B,OAAO;YACN,OAAO,EAAE,MAAA,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC;YACvC,WAAW,EAAE,MAAA,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,CAAC;YAChE,aAAa,EAAE,MAAA,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC;YAC9C,IAAI;YACJ,YAAY;SACZ,CAAA;IACF,CAAC;IAhBe,UAAI,OAgBnB,CAAA;IACY,UAAI,GAAoE;QACpF,aAAa,EAAE,eAAe;QAC9B,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,UAAU;KACpB,CAAA;AACF,CAAC,EAxCgB,KAAK,qBAAL,KAAK,QAwCrB"}
|
|
@@ -10,11 +10,12 @@ export interface Creatable {
|
|
|
10
10
|
amount: number;
|
|
11
11
|
description: string;
|
|
12
12
|
exchange?: Exchange;
|
|
13
|
+
reference?: {
|
|
14
|
+
reference?: string;
|
|
15
|
+
};
|
|
13
16
|
}
|
|
14
17
|
export declare namespace Creatable {
|
|
15
|
-
type Resolved =
|
|
16
|
-
counterpart: Rail.Address;
|
|
17
|
-
}) | CardTransaction;
|
|
18
|
+
type Resolved = Creatable | CardTransaction;
|
|
18
19
|
const type: import("isly/dist/cjs/object").IslyObject<Creatable, object>;
|
|
19
20
|
interface CardTransaction extends Creatable {
|
|
20
21
|
account: Pick<Rail.Address.Card, "id" | "type">;
|
|
@@ -14,6 +14,7 @@ var Creatable;
|
|
|
14
14
|
amount: isly_1.isly.number(),
|
|
15
15
|
description: isly_1.isly.string(),
|
|
16
16
|
exchange: Exchange_1.Exchange.type.optional(),
|
|
17
|
+
reference: isly_1.isly.object({ reference: isly_1.isly.string().optional() }).optional(),
|
|
17
18
|
});
|
|
18
19
|
let CardTransaction;
|
|
19
20
|
(function (CardTransaction) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Creatable.js","sourceRoot":"","sources":["../../../Transaction/Creatable.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B,+BAA2B;AAC3B,wCAAoC;AAEpC,kCAA8B;AAE9B,yCAAqC;
|
|
1
|
+
{"version":3,"file":"Creatable.js","sourceRoot":"","sources":["../../../Transaction/Creatable.ts"],"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AAC,QAAQ,CAC7B,SAAS,CAAC,WAAW,EACrB,SAAS,CAAC,QAAQ,EAClB,SAAS,CAAC,MAAM,EAChB,MAAM,EACN,OAAO,EACP,SAAS,CAAC,QAAQ,CAClB,CAAA;QACF,CAAC;QATe,sBAAM,SASrB,CAAA;IACF,CAAC,EAlBgB,eAAe,GAAf,yBAAe,KAAf,yBAAe,QAkB/B;AACF,CAAC,EApCgB,SAAS,yBAAT,SAAS,QAoCzB"}
|
|
@@ -16,5 +16,4 @@ export type Transaction = ModelTransaction.Creatable.Resolved & {
|
|
|
16
16
|
};
|
|
17
17
|
export declare namespace Transaction {
|
|
18
18
|
function from(account: ModelAccount, transaction: ModelTransaction.Creatable.Resolved | ModelTransaction, kind: Rule.Base.Kind, stage: "finalize" | "initiate"): Transaction;
|
|
19
|
-
function fromPreTransaction(accountName: string, transaction: ModelTransaction.PreTransaction | ModelTransaction, kind: Rule.Base.Kind, stage: "finalize" | "initiate"): Transaction;
|
|
20
19
|
}
|
|
@@ -10,29 +10,9 @@ export var Transaction;
|
|
|
10
10
|
kind,
|
|
11
11
|
amount,
|
|
12
12
|
type: ModelTransaction.getType(transaction.counterpart, account.name),
|
|
13
|
-
original: {
|
|
14
|
-
currency: transaction.currency,
|
|
15
|
-
amount,
|
|
16
|
-
total: amount,
|
|
17
|
-
},
|
|
13
|
+
original: { currency: transaction.currency, amount, total: amount },
|
|
18
14
|
};
|
|
19
15
|
}
|
|
20
16
|
Transaction.from = from;
|
|
21
|
-
function fromPreTransaction(accountName, transaction, kind, stage) {
|
|
22
|
-
return {
|
|
23
|
-
...transaction,
|
|
24
|
-
id: "id" in transaction ? transaction.id : ModelTransaction.Identifier.generate(),
|
|
25
|
-
stage,
|
|
26
|
-
kind,
|
|
27
|
-
amount: Math.abs(typeof transaction.amount == "number" ? transaction.amount : transaction.amount.total),
|
|
28
|
-
type: ModelTransaction.getType(transaction.counterpart, accountName),
|
|
29
|
-
original: {
|
|
30
|
-
currency: transaction.currency,
|
|
31
|
-
amount: Math.abs(typeof transaction.amount == "number" ? transaction.amount : transaction.amount.original),
|
|
32
|
-
total: Math.abs(typeof transaction.amount == "number" ? transaction.amount : transaction.amount.total),
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
Transaction.fromPreTransaction = fromPreTransaction;
|
|
37
17
|
})(Transaction || (Transaction = {}));
|
|
38
18
|
//# sourceMappingURL=Transaction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transaction.js","sourceRoot":"","sources":["../../../../Rule/State/Transaction.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAenE,MAAM,KAAW,WAAW,
|
|
1
|
+
{"version":3,"file":"Transaction.js","sourceRoot":"","sources":["../../../../Rule/State/Transaction.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAenE,MAAM,KAAW,WAAW,CAkB3B;AAlBD,WAAiB,WAAW;IAC3B,SAAgB,IAAI,CACnB,OAAqB,EACrB,WAAmE,EACnE,IAAoB,EACpB,KAA8B;QAE9B,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,WAAW,CAAC,MAAM,IAAI,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;QACjH,OAAO;YACN,GAAG,WAAW;YACd,EAAE,EAAE,IAAI,IAAI,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC,UAAU,CAAC,QAAQ,EAAE;YACjF,KAAK;YACL,IAAI;YACJ,MAAM;YACN,IAAI,EAAE,gBAAgB,CAAC,OAAO,CAAC,WAAW,CAAC,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC;YACrE,QAAQ,EAAE,EAAE,QAAQ,EAAE,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;SACnE,CAAA;IACF,CAAC;IAhBe,gBAAI,OAgBnB,CAAA;AACF,CAAC,EAlBgB,WAAW,KAAX,WAAW,QAkB3B"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isly } from "isly";
|
|
2
2
|
import { Account as ModelAccount } from "../../Account";
|
|
3
|
-
import type { Card as ModelCard } from "../../Card";
|
|
4
3
|
import { Rail } from "../../Rail";
|
|
5
4
|
import type { Transaction as ModelTransaction } from "../../Transaction";
|
|
6
5
|
import type { Rule } from "../index";
|
|
@@ -37,7 +36,4 @@ export declare namespace State {
|
|
|
37
36
|
}
|
|
38
37
|
function from(account: ModelAccount, address: Rail.Address, transaction: ModelTransaction.Creatable.Resolved | ModelTransaction, kind: Rule.Base.Kind, stage: "finalize" | "initiate", card?: Card, organization?: Organization): State;
|
|
39
38
|
const type: Record<ModelTransaction.PreTransaction["type"], Rule.Base.Kind>;
|
|
40
|
-
function fromPreTransaction(account: ModelAccount, address: Rail.Address, transaction: ModelTransaction.PreTransaction, card?: ModelCard & {
|
|
41
|
-
statistics: Card.Statistics;
|
|
42
|
-
}, organization?: Organization): State;
|
|
43
39
|
}
|
|
@@ -33,14 +33,5 @@ export var State;
|
|
|
33
33
|
incoming: "inbound",
|
|
34
34
|
outgoing: "outbound",
|
|
35
35
|
};
|
|
36
|
-
function fromPreTransaction(account, address, transaction, card, organization) {
|
|
37
|
-
return {
|
|
38
|
-
account: State.Account.from(account, address),
|
|
39
|
-
transaction: State.Transaction.from(account, transaction, State.type[transaction.type], "initiate"),
|
|
40
|
-
card: card ? State.Card.from(card, card.statistics) : undefined,
|
|
41
|
-
organization,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
State.fromPreTransaction = fromPreTransaction;
|
|
45
36
|
})(State || (State = {}));
|
|
46
37
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Rule/State/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Rule/State/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAK3B,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,WAAW,CAAA;AACnD,OAAO,EAAE,aAAa,IAAI,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACrE,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,QAAQ,CAAA;AAC1C,OAAO,EAAE,YAAY,IAAI,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,WAAW,CAAA;AACnD,OAAO,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAS/D,MAAM,KAAW,KAAK,CAwCrB;AAxCD,WAAiB,KAAK;IACP,aAAO,GAAG,YAAY,CAAA;IACtB,mBAAa,GAAG,kBAAkB,CAAA;IAClC,UAAI,GAAG,SAAS,CAAA;IAChB,aAAO,GAAG,YAAY,CAAA;IACtB,iBAAW,GAAG,gBAAgB,CAAA;IAC9B,kBAAY,GAAG,iBAAiB,CAAA;IAE9C,IAAiB,OAAO,CAGvB;IAHD,WAAiB,OAAO;QACV,cAAM,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAA;QACjD,YAAI,GAAG,IAAI,CAAC,MAAM,CAAU,QAAA,MAAM,CAAC,CAAA;IACjD,CAAC,EAHgB,OAAO,GAAP,aAAO,KAAP,aAAO,QAGvB;IAOD,SAAgB,IAAI,CACnB,OAAqB,EACrB,OAAqB,EACrB,WAAmE,EACnE,IAAoB,EACpB,KAA8B,EAC9B,IAAW,EACX,YAA2B;QAE3B,OAAO;YACN,OAAO,EAAE,MAAA,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC;YACvC,WAAW,EAAE,MAAA,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,CAAC;YAChE,aAAa,EAAE,MAAA,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC;YAC9C,IAAI;YACJ,YAAY;SACZ,CAAA;IACF,CAAC;IAhBe,UAAI,OAgBnB,CAAA;IACY,UAAI,GAAoE;QACpF,aAAa,EAAE,eAAe;QAC9B,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,UAAU;KACpB,CAAA;AACF,CAAC,EAxCgB,KAAK,KAAL,KAAK,QAwCrB"}
|
|
@@ -10,11 +10,12 @@ export interface Creatable {
|
|
|
10
10
|
amount: number;
|
|
11
11
|
description: string;
|
|
12
12
|
exchange?: Exchange;
|
|
13
|
+
reference?: {
|
|
14
|
+
reference?: string;
|
|
15
|
+
};
|
|
13
16
|
}
|
|
14
17
|
export declare namespace Creatable {
|
|
15
|
-
type Resolved =
|
|
16
|
-
counterpart: Rail.Address;
|
|
17
|
-
}) | CardTransaction;
|
|
18
|
+
type Resolved = Creatable | CardTransaction;
|
|
18
19
|
const type: import("isly/dist/cjs/object").IslyObject<Creatable, object>;
|
|
19
20
|
interface CardTransaction extends Creatable {
|
|
20
21
|
account: Pick<Rail.Address.Card, "id" | "type">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Creatable.js","sourceRoot":"","sources":["../../../Transaction/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEpC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAE9B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,C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I,CAAC,MAAM,CAAwB,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;YAC3E,YAAY,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;SACtC,CAAC,CAAA;QACF,SAAgB,MAAM,CAAC,SAA0B,EAAE,MAAc,EAAE,OAAwB;YAC1F,OAAO,OAAO,CAAC,MAAM,CAAC,QAAQ,CAC7B,SAAS,CAAC,WAAW,EACrB,SAAS,CAAC,QAAQ,EAClB,SAAS,CAAC,MAAM,EAChB,MAAM,EACN,OAAO,EACP,SAAS,CAAC,QAAQ,CAClB,CAAA;QACF,CAAC;QATe,sBAAM,SASrB,CAAA;IACF,CAAC,EAlBgB,eAAe,GAAf,yBAAe,KAAf,yBAAe,QAkB/B;AACF,CAAC,EApCgB,SAAS,KAAT,SAAS,QAoCzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pax2pay/model-banking",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.653",
|
|
4
4
|
"description": "Library containing data model types and functions for the Pax2Pay Banking API.",
|
|
5
5
|
"author": "Pax2Pay Ltd",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"scripts": {
|
|
21
21
|
"lint": "eslint --max-warnings=0 '**/*.{ts,tsx}'",
|
|
22
22
|
"fix": "eslint '**/*.{ts,tsx}' --fix",
|
|
23
|
+
"install": "npm i --min-release-age=0",
|
|
23
24
|
"build": "rimraf dist/* && tsc -p tsconfig.mjs.json && tsc -p tsconfig.cjs.json",
|
|
24
25
|
"test": "vitest --run",
|
|
25
26
|
"coverage": "vitest --coverage",
|