@pax2pay/model-banking 0.1.156 → 0.1.158
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/.github/workflows/bump.yml +1 -1
- package/.github/workflows/ci.yml +4 -4
- package/Transaction/index.ts +15 -23
- package/Treasury/Transaction/index.ts +1 -1
- package/dist/Transaction/index.d.ts +2 -2
- package/dist/Transaction/index.js +15 -23
- package/dist/Transaction/index.js.map +1 -1
- package/dist/Treasury/Transaction/index.js +1 -1
- package/dist/Treasury/Transaction/index.js.map +1 -1
- package/package.json +1 -1
package/.github/workflows/ci.yml
CHANGED
|
@@ -11,7 +11,7 @@ jobs:
|
|
|
11
11
|
- uses: actions/checkout@v3
|
|
12
12
|
- uses: actions/setup-node@v3
|
|
13
13
|
with:
|
|
14
|
-
node-version:
|
|
14
|
+
node-version: 20
|
|
15
15
|
cache: 'npm'
|
|
16
16
|
- uses: actions/cache@v3
|
|
17
17
|
with:
|
|
@@ -26,7 +26,7 @@ jobs:
|
|
|
26
26
|
- uses: actions/checkout@v3
|
|
27
27
|
- uses: actions/setup-node@v3
|
|
28
28
|
with:
|
|
29
|
-
node-version:
|
|
29
|
+
node-version: 20
|
|
30
30
|
cache: 'npm'
|
|
31
31
|
- uses: actions/cache@v3
|
|
32
32
|
with:
|
|
@@ -41,7 +41,7 @@ jobs:
|
|
|
41
41
|
- uses: actions/checkout@v3
|
|
42
42
|
- uses: actions/setup-node@v3
|
|
43
43
|
with:
|
|
44
|
-
node-version:
|
|
44
|
+
node-version: 20
|
|
45
45
|
cache: 'npm'
|
|
46
46
|
- uses: actions/cache@v3
|
|
47
47
|
with:
|
|
@@ -56,6 +56,6 @@ jobs:
|
|
|
56
56
|
- uses: actions/checkout@v3
|
|
57
57
|
- uses: actions/setup-node@v3
|
|
58
58
|
with:
|
|
59
|
-
node-version:
|
|
59
|
+
node-version: 20
|
|
60
60
|
cache: 'npm'
|
|
61
61
|
- run: npm audit
|
package/Transaction/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as cryptly from "cryptly"
|
|
2
2
|
import { isoly } from "isoly"
|
|
3
3
|
import { isly } from "isly"
|
|
4
|
+
import { Identifier } from "../Identifier"
|
|
4
5
|
import { Operation } from "../Operation"
|
|
5
6
|
import { Rail } from "../Rail"
|
|
6
7
|
import { Creatable as TransactionCreatable } from "./Creatable"
|
|
@@ -62,22 +63,17 @@ export namespace Transaction {
|
|
|
62
63
|
account: Rail,
|
|
63
64
|
transaction: Creatable,
|
|
64
65
|
operations: Operation.Creatable[],
|
|
65
|
-
|
|
66
|
+
balance: number
|
|
66
67
|
): Transaction {
|
|
67
|
-
const id =
|
|
68
|
-
const timestamp = isoly.DateTime.now()
|
|
69
|
-
if ("id" in transaction)
|
|
70
|
-
delete transaction.id
|
|
71
|
-
if ("posted" in transaction)
|
|
72
|
-
delete transaction.posted
|
|
68
|
+
const id = Identifier.generate()
|
|
73
69
|
return {
|
|
74
|
-
organization: organization,
|
|
75
|
-
accountId: accountId,
|
|
76
|
-
account: account,
|
|
77
|
-
id: id,
|
|
78
|
-
posted: timestamp,
|
|
79
|
-
balance: result,
|
|
80
70
|
...transaction,
|
|
71
|
+
organization,
|
|
72
|
+
accountId,
|
|
73
|
+
account: account,
|
|
74
|
+
id,
|
|
75
|
+
posted: isoly.DateTime.now(),
|
|
76
|
+
balance,
|
|
81
77
|
operations: operations.map(o => Operation.fromCreatable(id, o)),
|
|
82
78
|
status: "created",
|
|
83
79
|
flags: [],
|
|
@@ -90,19 +86,15 @@ export namespace Transaction {
|
|
|
90
86
|
accountId: string,
|
|
91
87
|
transaction: Incoming,
|
|
92
88
|
operations: Operation.Creatable[],
|
|
93
|
-
|
|
89
|
+
balance: number
|
|
94
90
|
): Transaction {
|
|
95
|
-
const id =
|
|
96
|
-
if ("id" in transaction)
|
|
97
|
-
delete transaction.id
|
|
98
|
-
if ("transacted" in transaction)
|
|
99
|
-
delete transaction.transacted
|
|
91
|
+
const id = Identifier.generate()
|
|
100
92
|
return {
|
|
101
|
-
organization: organization,
|
|
102
|
-
accountId: accountId,
|
|
103
|
-
id: id,
|
|
104
|
-
balance: result,
|
|
105
93
|
...transaction,
|
|
94
|
+
organization,
|
|
95
|
+
accountId,
|
|
96
|
+
balance,
|
|
97
|
+
id,
|
|
106
98
|
operations: operations.map(o => Operation.fromCreatable(id, o)),
|
|
107
99
|
status: "created",
|
|
108
100
|
flags: [],
|
|
@@ -21,7 +21,7 @@ export namespace Transaction {
|
|
|
21
21
|
}
|
|
22
22
|
export function fromCreatable(transaction: TransactionCreatable, debtor: Rail): Transaction {
|
|
23
23
|
return {
|
|
24
|
-
debtor
|
|
24
|
+
debtor,
|
|
25
25
|
id: cryptly.Identifier.generate(8),
|
|
26
26
|
created: isoly.DateTime.now(),
|
|
27
27
|
...transaction,
|
|
@@ -41,8 +41,8 @@ export declare namespace Transaction {
|
|
|
41
41
|
const is: isly.Type.IsFunction<Transaction>;
|
|
42
42
|
const flaw: isly.Type.FlawFunction;
|
|
43
43
|
const get: isly.Type.GetFunction<Transaction>;
|
|
44
|
-
function fromCreatable(organization: string, accountId: string, account: Rail, transaction: Creatable, operations: Operation.Creatable[],
|
|
45
|
-
function fromIncoming(organization: string, accountId: string, transaction: Incoming, operations: Operation.Creatable[],
|
|
44
|
+
function fromCreatable(organization: string, accountId: string, account: Rail, transaction: Creatable, operations: Operation.Creatable[], balance: number): Transaction;
|
|
45
|
+
function fromIncoming(organization: string, accountId: string, transaction: Incoming, operations: Operation.Creatable[], balance: number): Transaction;
|
|
46
46
|
function isIdentifier(value: cryptly.Identifier | any): value is cryptly.Identifier;
|
|
47
47
|
function flag(transaction: Transaction, note: Note): void;
|
|
48
48
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as cryptly from "cryptly";
|
|
2
2
|
import { isoly } from "isoly";
|
|
3
3
|
import { isly } from "isly";
|
|
4
|
+
import { Identifier } from "../Identifier";
|
|
4
5
|
import { Operation } from "../Operation";
|
|
5
6
|
import { Rail } from "../Rail";
|
|
6
7
|
import { Creatable as TransactionCreatable } from "./Creatable";
|
|
@@ -33,21 +34,16 @@ export var Transaction;
|
|
|
33
34
|
Transaction.is = Transaction.type.is;
|
|
34
35
|
Transaction.flaw = Transaction.type.flaw;
|
|
35
36
|
Transaction.get = Transaction.type.get;
|
|
36
|
-
function fromCreatable(organization, accountId, account, transaction, operations,
|
|
37
|
-
const id =
|
|
38
|
-
const timestamp = isoly.DateTime.now();
|
|
39
|
-
if ("id" in transaction)
|
|
40
|
-
delete transaction.id;
|
|
41
|
-
if ("posted" in transaction)
|
|
42
|
-
delete transaction.posted;
|
|
37
|
+
function fromCreatable(organization, accountId, account, transaction, operations, balance) {
|
|
38
|
+
const id = Identifier.generate();
|
|
43
39
|
return {
|
|
44
|
-
organization: organization,
|
|
45
|
-
accountId: accountId,
|
|
46
|
-
account: account,
|
|
47
|
-
id: id,
|
|
48
|
-
posted: timestamp,
|
|
49
|
-
balance: result,
|
|
50
40
|
...transaction,
|
|
41
|
+
organization,
|
|
42
|
+
accountId,
|
|
43
|
+
account: account,
|
|
44
|
+
id,
|
|
45
|
+
posted: isoly.DateTime.now(),
|
|
46
|
+
balance,
|
|
51
47
|
operations: operations.map(o => Operation.fromCreatable(id, o)),
|
|
52
48
|
status: "created",
|
|
53
49
|
flags: [],
|
|
@@ -56,18 +52,14 @@ export var Transaction;
|
|
|
56
52
|
};
|
|
57
53
|
}
|
|
58
54
|
Transaction.fromCreatable = fromCreatable;
|
|
59
|
-
function fromIncoming(organization, accountId, transaction, operations,
|
|
60
|
-
const id =
|
|
61
|
-
if ("id" in transaction)
|
|
62
|
-
delete transaction.id;
|
|
63
|
-
if ("transacted" in transaction)
|
|
64
|
-
delete transaction.transacted;
|
|
55
|
+
function fromIncoming(organization, accountId, transaction, operations, balance) {
|
|
56
|
+
const id = Identifier.generate();
|
|
65
57
|
return {
|
|
66
|
-
organization: organization,
|
|
67
|
-
accountId: accountId,
|
|
68
|
-
id: id,
|
|
69
|
-
balance: result,
|
|
70
58
|
...transaction,
|
|
59
|
+
organization,
|
|
60
|
+
accountId,
|
|
61
|
+
balance,
|
|
62
|
+
id,
|
|
71
63
|
operations: operations.map(o => Operation.fromCreatable(id, o)),
|
|
72
64
|
status: "created",
|
|
73
65
|
flags: [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Transaction/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,SAAS,IAAI,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAC/D,OAAO,EAAE,QAAQ,IAAI,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,EAAE,IAAI,IAAI,eAAe,EAAE,MAAM,QAAQ,CAAA;AAChD,OAAO,EAAE,SAAS,IAAI,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAC/D,OAAO,EAAE,MAAM,IAAI,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAiBtD,MAAM,KAAW,WAAW,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Transaction/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA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