@pax2pay/model-banking 0.1.601 → 0.1.603
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/.eslintrc +13 -14
- package/.prettierrc +2 -3
- package/Account/Charge/Fx/index.ts +2 -1
- package/Account/Creatable.ts +1 -1
- package/Account/History.ts +1 -1
- package/Account/Status.ts +2 -2
- package/Account/Type.ts +1 -1
- package/Audit.ts +1 -1
- package/Authorization/Status.ts +8 -6
- package/Backup/Base.ts +1 -1
- package/Balance.ts +2 -2
- package/Balances.ts +6 -3
- package/Card/Expiry.ts +2 -2
- package/Card/Operation/Authorization.ts +1 -1
- package/Card/Operation/Card.ts +1 -1
- package/Card/Operation/index.ts +1 -1
- package/Card/Preset.ts +1 -1
- package/Card/Restriction/Merchant.ts +8 -6
- package/Card/Restriction/index.ts +2 -1
- package/Card/Scheme.ts +1 -1
- package/Card/Stack.ts +2 -2
- package/Client/Labels.ts +4 -1
- package/Client/Operations.ts +4 -4
- package/Client/Transactions/index.ts +3 -2
- package/Client/index.ts +3 -2
- package/Holidays/index.ts +1 -1
- package/Label.ts +1 -1
- package/Log/Message/Configuration.ts +1 -1
- package/Log/Message/Entry.ts +1 -1
- package/Log/Message/index.ts +3 -2
- package/Log/index.ts +4 -2
- package/Operation/Change.ts +1 -1
- package/Operation/Changes.ts +10 -9
- package/Operation/Creatable.ts +1 -1
- package/Operation/Status.ts +1 -1
- package/Operation/index.ts +2 -1
- package/Organization/Risk.ts +1 -1
- package/Quarter.ts +1 -1
- package/Rail/Address/Route.ts +2 -2
- package/Rail/Address/index.ts +1 -11
- package/Rail/index.ts +1 -1
- package/Realm.ts +2 -2
- package/Rule/Base.ts +2 -2
- package/Rule/Other.ts +5 -3
- package/Rule/State/Authorization.ts +1 -1
- package/Rule/State/Card.ts +3 -2
- package/Rule/State/index.ts +1 -1
- package/Rule/index.ts +1 -1
- package/Settlement/Entry/fromCreatable.ts +8 -6
- package/Settlement/Status.ts +1 -1
- package/Settlement/Total.ts +8 -6
- package/Settlement/Totals.ts +4 -2
- package/Supplier/index.ts +2 -3
- package/Transaction/Statistics.ts +6 -5
- package/Transaction/Status.ts +3 -3
- package/Transaction/index.ts +22 -20
- package/Treasury/Account/Category.ts +1 -1
- package/Treasury/Snapshot/funding.ts +7 -5
- package/User/Access/Permission.ts +2 -2
- package/User/Identity.ts +7 -3
- package/User/Password.ts +5 -4
- package/Warning/Base.ts +1 -1
- package/Warning/Snapshot/MissingBuffer.ts +2 -1
- package/Warning/Snapshot/StaleFiat.ts +6 -3
- package/dist/cjs/Account/Charge/Fx/index.js +2 -1
- package/dist/cjs/Account/Charge/Fx/index.js.map +1 -1
- package/dist/cjs/Account/Creatable.d.ts +1 -1
- package/dist/cjs/Account/History.d.ts +1 -1
- package/dist/cjs/Account/Status.d.ts +2 -2
- package/dist/cjs/Account/Type.d.ts +1 -1
- package/dist/cjs/Audit.d.ts +1 -1
- package/dist/cjs/Authorization/Status.d.ts +1 -1
- package/dist/cjs/Authorization/Status.js +10 -5
- package/dist/cjs/Authorization/Status.js.map +1 -1
- package/dist/cjs/Backup/Base.d.ts +1 -1
- package/dist/cjs/Balance.d.ts +2 -2
- package/dist/cjs/Balances.js +6 -3
- package/dist/cjs/Balances.js.map +1 -1
- package/dist/cjs/Card/Expiry.d.ts +2 -2
- package/dist/cjs/Card/Operation/Authorization.d.ts +1 -1
- package/dist/cjs/Card/Operation/Card.d.ts +1 -1
- package/dist/cjs/Card/Operation/index.js.map +1 -1
- package/dist/cjs/Card/Preset.d.ts +1 -1
- package/dist/cjs/Card/Restriction/Merchant.d.ts +1 -1
- package/dist/cjs/Card/Restriction/Merchant.js +10 -5
- package/dist/cjs/Card/Restriction/Merchant.js.map +1 -1
- package/dist/cjs/Card/Restriction/index.js +2 -1
- package/dist/cjs/Card/Restriction/index.js.map +1 -1
- package/dist/cjs/Card/Scheme.d.ts +1 -1
- package/dist/cjs/Card/Stack.d.ts +2 -2
- package/dist/cjs/Client/Labels.js.map +1 -1
- package/dist/cjs/Client/Operations.js.map +1 -1
- package/dist/cjs/Client/Transactions/index.d.ts +1 -1
- package/dist/cjs/Client/Transactions/index.js +2 -1
- package/dist/cjs/Client/Transactions/index.js.map +1 -1
- package/dist/cjs/Client/index.js +3 -2
- package/dist/cjs/Client/index.js.map +1 -1
- package/dist/cjs/Holidays/index.d.ts +1 -1
- package/dist/cjs/Label.d.ts +1 -1
- package/dist/cjs/Log/Message/Configuration.js.map +1 -1
- package/dist/cjs/Log/Message/Entry.js.map +1 -1
- package/dist/cjs/Log/Message/index.js +2 -1
- package/dist/cjs/Log/Message/index.js.map +1 -1
- package/dist/cjs/Log/index.js +4 -2
- package/dist/cjs/Log/index.js.map +1 -1
- package/dist/cjs/Operation/Change.d.ts +1 -1
- package/dist/cjs/Operation/Changes.d.ts +2 -2
- package/dist/cjs/Operation/Changes.js +8 -4
- package/dist/cjs/Operation/Changes.js.map +1 -1
- package/dist/cjs/Operation/Creatable.d.ts +1 -1
- package/dist/cjs/Operation/Status.d.ts +1 -1
- package/dist/cjs/Operation/index.js +2 -1
- package/dist/cjs/Operation/index.js.map +1 -1
- package/dist/cjs/Organization/Risk.d.ts +1 -1
- package/dist/cjs/Quarter.d.ts +1 -1
- package/dist/cjs/Rail/Address/Route.d.ts +1 -1
- package/dist/cjs/Rail/Address/Route.js +1 -1
- package/dist/cjs/Rail/Address/Route.js.map +1 -1
- package/dist/cjs/Rail/Address/index.d.ts +2 -4
- package/dist/cjs/Rail/Address/index.js +1 -9
- package/dist/cjs/Rail/Address/index.js.map +1 -1
- package/dist/cjs/Rail/index.d.ts +3 -3
- package/dist/cjs/Realm.d.ts +1 -1
- package/dist/cjs/Realm.js +1 -1
- package/dist/cjs/Realm.js.map +1 -1
- package/dist/cjs/Rule/Base.d.ts +2 -2
- package/dist/cjs/Rule/Other.d.ts +1 -1
- package/dist/cjs/Rule/Other.js +4 -2
- package/dist/cjs/Rule/Other.js.map +1 -1
- package/dist/cjs/Rule/State/Authorization.js.map +1 -1
- package/dist/cjs/Rule/State/Card.js +4 -2
- package/dist/cjs/Rule/State/Card.js.map +1 -1
- package/dist/cjs/Rule/State/index.d.ts +1 -1
- package/dist/cjs/Rule/index.d.ts +1 -1
- package/dist/cjs/Settlement/Entry/fromCreatable.js +10 -5
- package/dist/cjs/Settlement/Entry/fromCreatable.js.map +1 -1
- package/dist/cjs/Settlement/Status.d.ts +1 -1
- package/dist/cjs/Settlement/Total.js +4 -2
- package/dist/cjs/Settlement/Total.js.map +1 -1
- package/dist/cjs/Settlement/Totals.js +4 -2
- package/dist/cjs/Settlement/Totals.js.map +1 -1
- package/dist/cjs/Supplier/index.d.ts +3 -3
- package/dist/cjs/Supplier/index.js +1 -1
- package/dist/cjs/Supplier/index.js.map +1 -1
- package/dist/cjs/Transaction/Statistics.d.ts +2 -2
- package/dist/cjs/Transaction/Statistics.js +2 -1
- package/dist/cjs/Transaction/Statistics.js.map +1 -1
- package/dist/cjs/Transaction/Status.d.ts +3 -3
- package/dist/cjs/Transaction/index.d.ts +2 -2
- package/dist/cjs/Transaction/index.js +10 -5
- package/dist/cjs/Transaction/index.js.map +1 -1
- package/dist/cjs/Treasury/Account/Category.d.ts +1 -1
- package/dist/cjs/Treasury/Snapshot/funding.js +8 -4
- package/dist/cjs/Treasury/Snapshot/funding.js.map +1 -1
- package/dist/cjs/User/Access/Permission.d.ts +2 -2
- package/dist/cjs/User/Identity.js +4 -2
- package/dist/cjs/User/Identity.js.map +1 -1
- package/dist/cjs/User/Password.js +8 -4
- package/dist/cjs/User/Password.js.map +1 -1
- package/dist/cjs/Warning/Base.d.ts +1 -1
- package/dist/cjs/Warning/Snapshot/MissingBuffer.js +2 -1
- package/dist/cjs/Warning/Snapshot/MissingBuffer.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/StaleFiat.js +6 -3
- package/dist/cjs/Warning/Snapshot/StaleFiat.js.map +1 -1
- package/dist/cjs/fx.d.ts +1 -1
- package/dist/cjs/reports/visa/Data/Cards.js +6 -3
- package/dist/cjs/reports/visa/Data/Cards.js.map +1 -1
- package/dist/cjs/reports/visa/Data/Country.js +6 -3
- package/dist/cjs/reports/visa/Data/Country.js.map +1 -1
- package/dist/cjs/reports/visa/Data/Iin.d.ts +2 -2
- package/dist/cjs/reports/visa/Data/Monthly.d.ts +1 -1
- package/dist/cjs/reports/visa/Data/Monthly.js +2 -1
- package/dist/cjs/reports/visa/Data/Monthly.js.map +1 -1
- package/dist/cjs/reports/visa/Data/NonMonthly.js +8 -4
- package/dist/cjs/reports/visa/Data/NonMonthly.js.map +1 -1
- package/dist/cjs/reports/visa/Data/Region.d.ts +1 -1
- package/dist/cjs/reports/visa/Data/Region.js +16 -8
- package/dist/cjs/reports/visa/Data/Region.js.map +1 -1
- package/dist/cjs/reports/visa/Data/Regional.js +4 -2
- package/dist/cjs/reports/visa/Data/Regional.js.map +1 -1
- package/dist/cjs/reports/visa/Data/index.js +4 -2
- package/dist/cjs/reports/visa/Data/index.js.map +1 -1
- package/dist/cjs/reports/visa/index.js +10 -5
- package/dist/cjs/reports/visa/index.js.map +1 -1
- package/dist/cjs/reports/visa/rows.d.ts +2 -2
- package/dist/cjs/reports/visa/rows.js +2 -1
- package/dist/cjs/reports/visa/rows.js.map +1 -1
- package/dist/mjs/Account/Charge/Fx/index.js +2 -1
- package/dist/mjs/Account/Charge/Fx/index.js.map +1 -1
- package/dist/mjs/Account/Creatable.d.ts +1 -1
- package/dist/mjs/Account/History.d.ts +1 -1
- package/dist/mjs/Account/Status.d.ts +2 -2
- package/dist/mjs/Account/Type.d.ts +1 -1
- package/dist/mjs/Audit.d.ts +1 -1
- package/dist/mjs/Authorization/Status.d.ts +1 -1
- package/dist/mjs/Authorization/Status.js +10 -5
- package/dist/mjs/Authorization/Status.js.map +1 -1
- package/dist/mjs/Backup/Base.d.ts +1 -1
- package/dist/mjs/Balance.d.ts +2 -2
- package/dist/mjs/Balances.js +6 -3
- package/dist/mjs/Balances.js.map +1 -1
- package/dist/mjs/Card/Expiry.d.ts +2 -2
- package/dist/mjs/Card/Operation/Authorization.d.ts +1 -1
- package/dist/mjs/Card/Operation/Card.d.ts +1 -1
- package/dist/mjs/Card/Operation/index.js.map +1 -1
- package/dist/mjs/Card/Preset.d.ts +1 -1
- package/dist/mjs/Card/Restriction/Merchant.d.ts +1 -1
- package/dist/mjs/Card/Restriction/Merchant.js +10 -5
- package/dist/mjs/Card/Restriction/Merchant.js.map +1 -1
- package/dist/mjs/Card/Restriction/index.js +2 -1
- package/dist/mjs/Card/Restriction/index.js.map +1 -1
- package/dist/mjs/Card/Scheme.d.ts +1 -1
- package/dist/mjs/Card/Stack.d.ts +2 -2
- package/dist/mjs/Client/Labels.js.map +1 -1
- package/dist/mjs/Client/Operations.js.map +1 -1
- package/dist/mjs/Client/Transactions/index.d.ts +1 -1
- package/dist/mjs/Client/Transactions/index.js +2 -1
- package/dist/mjs/Client/Transactions/index.js.map +1 -1
- package/dist/mjs/Client/index.js +3 -2
- package/dist/mjs/Client/index.js.map +1 -1
- package/dist/mjs/Holidays/index.d.ts +1 -1
- package/dist/mjs/Label.d.ts +1 -1
- package/dist/mjs/Log/Message/Configuration.js.map +1 -1
- package/dist/mjs/Log/Message/Entry.js.map +1 -1
- package/dist/mjs/Log/Message/index.js +2 -1
- package/dist/mjs/Log/Message/index.js.map +1 -1
- package/dist/mjs/Log/index.js +4 -2
- package/dist/mjs/Log/index.js.map +1 -1
- package/dist/mjs/Operation/Change.d.ts +1 -1
- package/dist/mjs/Operation/Changes.d.ts +2 -2
- package/dist/mjs/Operation/Changes.js +8 -4
- package/dist/mjs/Operation/Changes.js.map +1 -1
- package/dist/mjs/Operation/Creatable.d.ts +1 -1
- package/dist/mjs/Operation/Status.d.ts +1 -1
- package/dist/mjs/Operation/index.js +2 -1
- package/dist/mjs/Operation/index.js.map +1 -1
- package/dist/mjs/Organization/Risk.d.ts +1 -1
- package/dist/mjs/Quarter.d.ts +1 -1
- package/dist/mjs/Rail/Address/Route.d.ts +1 -1
- package/dist/mjs/Rail/Address/Route.js +1 -1
- package/dist/mjs/Rail/Address/Route.js.map +1 -1
- package/dist/mjs/Rail/Address/index.d.ts +2 -4
- package/dist/mjs/Rail/Address/index.js +1 -9
- package/dist/mjs/Rail/Address/index.js.map +1 -1
- package/dist/mjs/Rail/index.d.ts +3 -3
- package/dist/mjs/Realm.d.ts +1 -1
- package/dist/mjs/Realm.js +1 -1
- package/dist/mjs/Realm.js.map +1 -1
- package/dist/mjs/Rule/Base.d.ts +2 -2
- package/dist/mjs/Rule/Other.d.ts +1 -1
- package/dist/mjs/Rule/Other.js +4 -2
- package/dist/mjs/Rule/Other.js.map +1 -1
- package/dist/mjs/Rule/State/Authorization.js.map +1 -1
- package/dist/mjs/Rule/State/Card.js +4 -2
- package/dist/mjs/Rule/State/Card.js.map +1 -1
- package/dist/mjs/Rule/State/index.d.ts +1 -1
- package/dist/mjs/Rule/index.d.ts +1 -1
- package/dist/mjs/Settlement/Entry/fromCreatable.js +10 -5
- package/dist/mjs/Settlement/Entry/fromCreatable.js.map +1 -1
- package/dist/mjs/Settlement/Status.d.ts +1 -1
- package/dist/mjs/Settlement/Total.js +4 -2
- package/dist/mjs/Settlement/Total.js.map +1 -1
- package/dist/mjs/Settlement/Totals.js +4 -2
- package/dist/mjs/Settlement/Totals.js.map +1 -1
- package/dist/mjs/Supplier/index.d.ts +3 -3
- package/dist/mjs/Supplier/index.js +1 -1
- package/dist/mjs/Supplier/index.js.map +1 -1
- package/dist/mjs/Transaction/Statistics.d.ts +2 -2
- package/dist/mjs/Transaction/Statistics.js +2 -1
- package/dist/mjs/Transaction/Statistics.js.map +1 -1
- package/dist/mjs/Transaction/Status.d.ts +3 -3
- package/dist/mjs/Transaction/index.d.ts +2 -2
- package/dist/mjs/Transaction/index.js +10 -5
- package/dist/mjs/Transaction/index.js.map +1 -1
- package/dist/mjs/Treasury/Account/Category.d.ts +1 -1
- package/dist/mjs/Treasury/Snapshot/funding.js +8 -4
- package/dist/mjs/Treasury/Snapshot/funding.js.map +1 -1
- package/dist/mjs/User/Access/Permission.d.ts +2 -2
- package/dist/mjs/User/Identity.js +4 -2
- package/dist/mjs/User/Identity.js.map +1 -1
- package/dist/mjs/User/Password.js +8 -4
- package/dist/mjs/User/Password.js.map +1 -1
- package/dist/mjs/Warning/Base.d.ts +1 -1
- package/dist/mjs/Warning/Snapshot/MissingBuffer.js +2 -1
- package/dist/mjs/Warning/Snapshot/MissingBuffer.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/StaleFiat.js +6 -3
- package/dist/mjs/Warning/Snapshot/StaleFiat.js.map +1 -1
- package/dist/mjs/fx.d.ts +1 -1
- package/dist/mjs/reports/visa/Data/Cards.js +6 -3
- package/dist/mjs/reports/visa/Data/Cards.js.map +1 -1
- package/dist/mjs/reports/visa/Data/Country.js +6 -3
- package/dist/mjs/reports/visa/Data/Country.js.map +1 -1
- package/dist/mjs/reports/visa/Data/Iin.d.ts +2 -2
- package/dist/mjs/reports/visa/Data/Monthly.d.ts +1 -1
- package/dist/mjs/reports/visa/Data/Monthly.js +2 -1
- package/dist/mjs/reports/visa/Data/Monthly.js.map +1 -1
- package/dist/mjs/reports/visa/Data/NonMonthly.js +8 -4
- package/dist/mjs/reports/visa/Data/NonMonthly.js.map +1 -1
- package/dist/mjs/reports/visa/Data/Region.d.ts +1 -1
- package/dist/mjs/reports/visa/Data/Region.js +16 -8
- package/dist/mjs/reports/visa/Data/Region.js.map +1 -1
- package/dist/mjs/reports/visa/Data/Regional.js +4 -2
- package/dist/mjs/reports/visa/Data/Regional.js.map +1 -1
- package/dist/mjs/reports/visa/Data/index.js +4 -2
- package/dist/mjs/reports/visa/Data/index.js.map +1 -1
- package/dist/mjs/reports/visa/index.js +10 -5
- package/dist/mjs/reports/visa/index.js.map +1 -1
- package/dist/mjs/reports/visa/rows.d.ts +2 -2
- package/dist/mjs/reports/visa/rows.js +2 -1
- package/dist/mjs/reports/visa/rows.js.map +1 -1
- package/fx.ts +1 -1
- package/package.json +10 -9
- package/reports/visa/Data/Cards.ts +6 -3
- package/reports/visa/Data/Country.ts +6 -3
- package/reports/visa/Data/Iin.ts +2 -2
- package/reports/visa/Data/Monthly.ts +3 -2
- package/reports/visa/Data/NonMonthly.ts +8 -4
- package/reports/visa/Data/Region.ts +11 -9
- package/reports/visa/Data/Regional.ts +4 -2
- package/reports/visa/Data/index.ts +3 -2
- package/reports/visa/index.ts +8 -6
- package/reports/visa/rows.ts +4 -3
- package/Rail/Address/PaxgiroCredit.ts +0 -14
- package/dist/cjs/Rail/Address/PaxgiroCredit.d.ts +0 -8
- package/dist/cjs/Rail/Address/PaxgiroCredit.js +0 -13
- package/dist/cjs/Rail/Address/PaxgiroCredit.js.map +0 -1
- package/dist/mjs/Rail/Address/PaxgiroCredit.d.ts +0 -8
- package/dist/mjs/Rail/Address/PaxgiroCredit.js +0 -10
- package/dist/mjs/Rail/Address/PaxgiroCredit.js.map +0 -1
package/.eslintrc
CHANGED
|
@@ -3,20 +3,27 @@
|
|
|
3
3
|
"parser": "@typescript-eslint/parser",
|
|
4
4
|
"plugins": [
|
|
5
5
|
"@typescript-eslint",
|
|
6
|
-
"
|
|
6
|
+
"prettier",
|
|
7
7
|
"simple-import-sort"
|
|
8
8
|
],
|
|
9
9
|
"extends": [
|
|
10
10
|
"eslint:recommended",
|
|
11
11
|
"plugin:@typescript-eslint/eslint-recommended",
|
|
12
12
|
"plugin:@typescript-eslint/recommended",
|
|
13
|
-
"plugin:
|
|
13
|
+
"plugin:prettier/recommended"
|
|
14
14
|
],
|
|
15
15
|
"rules": {
|
|
16
|
-
"
|
|
17
|
-
|
|
16
|
+
"curly": [
|
|
17
|
+
"error",
|
|
18
|
+
"all"
|
|
19
|
+
],
|
|
20
|
+
"prettier/prettier": [
|
|
21
|
+
"warn",
|
|
18
22
|
{
|
|
19
|
-
"
|
|
23
|
+
"semi": false,
|
|
24
|
+
"singleQuote": false,
|
|
25
|
+
"tabWidth": 2,
|
|
26
|
+
"trailingComma": "es5"
|
|
20
27
|
}
|
|
21
28
|
],
|
|
22
29
|
"@typescript-eslint/no-explicit-any": "off",
|
|
@@ -41,10 +48,6 @@
|
|
|
41
48
|
"no-case-declarations": "off",
|
|
42
49
|
"no-inner-declarations": "off",
|
|
43
50
|
"sort-imports": "off",
|
|
44
|
-
"curly": [
|
|
45
|
-
"warn",
|
|
46
|
-
"multi"
|
|
47
|
-
],
|
|
48
51
|
"simple-import-sort/imports": [
|
|
49
52
|
"error",
|
|
50
53
|
{
|
|
@@ -74,9 +77,5 @@
|
|
|
74
77
|
}
|
|
75
78
|
]
|
|
76
79
|
},
|
|
77
|
-
"settings": {
|
|
78
|
-
"prettierx": {
|
|
79
|
-
"usePrettierrc": true
|
|
80
|
-
}
|
|
81
|
-
}
|
|
80
|
+
"settings": {}
|
|
82
81
|
}
|
package/.prettierrc
CHANGED
|
@@ -18,12 +18,13 @@ export namespace Fx {
|
|
|
18
18
|
let result: Amount.Charge.Fx | undefined
|
|
19
19
|
const chargePreset = preset && charge[preset] ? preset : "default"
|
|
20
20
|
const chargeRate = charge[chargePreset] ?? 0
|
|
21
|
-
if (exchange)
|
|
21
|
+
if (exchange) {
|
|
22
22
|
result = {
|
|
23
23
|
preset: chargePreset,
|
|
24
24
|
rate: chargeRate,
|
|
25
25
|
amount: -isoly.Currency.multiply(currency, amount, chargeRate),
|
|
26
26
|
}
|
|
27
|
+
}
|
|
27
28
|
return result
|
|
28
29
|
}
|
|
29
30
|
}
|
package/Account/Creatable.ts
CHANGED
|
@@ -6,7 +6,7 @@ export interface Creatable {
|
|
|
6
6
|
location?: Creatable.Location
|
|
7
7
|
}
|
|
8
8
|
export namespace Creatable {
|
|
9
|
-
export type Location = typeof Location.values[number]
|
|
9
|
+
export type Location = (typeof Location.values)[number]
|
|
10
10
|
export namespace Location {
|
|
11
11
|
export const values = ["north-east-america", "west-europe"] as const
|
|
12
12
|
export function toCloudflare(value: Location): DurableObjectLocationHint {
|
package/Account/History.ts
CHANGED
package/Account/Status.ts
CHANGED
|
@@ -5,11 +5,11 @@ export type Status = {
|
|
|
5
5
|
reason?: Status.Reason
|
|
6
6
|
}
|
|
7
7
|
export namespace Status {
|
|
8
|
-
export type Mode = typeof Mode.values[number] | (string & Record<never, never>)
|
|
8
|
+
export type Mode = (typeof Mode.values)[number] | (string & Record<never, never>)
|
|
9
9
|
export namespace Mode {
|
|
10
10
|
export const values = ["active", "frozen", "closed"] as const
|
|
11
11
|
}
|
|
12
|
-
export type Reason = typeof Reason.values[number] | (string & Record<never, never>)
|
|
12
|
+
export type Reason = (typeof Reason.values)[number] | (string & Record<never, never>)
|
|
13
13
|
export namespace Reason {
|
|
14
14
|
export const values = ["overdraft", "other"] as const
|
|
15
15
|
}
|
package/Account/Type.ts
CHANGED
package/Audit.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { isly } from "isly"
|
|
|
3
3
|
|
|
4
4
|
export type Audit = storage.AuditLogger.Entry<Audit.Type>
|
|
5
5
|
export namespace Audit {
|
|
6
|
-
export type Type = { [K in keyof typeof Resource.value]: typeof Resource.value[K][number] }
|
|
6
|
+
export type Type = { [K in keyof typeof Resource.value]: (typeof Resource.value)[K][number] }
|
|
7
7
|
export type Resource = keyof typeof Resource.value
|
|
8
8
|
export namespace Resource {
|
|
9
9
|
export const value = {
|
package/Authorization/Status.ts
CHANGED
|
@@ -6,19 +6,21 @@ export type Status = "approved" | Status.Failed
|
|
|
6
6
|
|
|
7
7
|
export namespace Status {
|
|
8
8
|
export const failures = [...Transaction.Status.reasons, "card not found", "account not found", "other"] as const
|
|
9
|
-
export type Failed = typeof failures[number]
|
|
9
|
+
export type Failed = (typeof failures)[number]
|
|
10
10
|
export namespace Failed {
|
|
11
11
|
export function from(error: gracely.Error | Transaction.Status.Reason): Failed {
|
|
12
12
|
let result: Status
|
|
13
|
-
if (gracely.Error.is(error))
|
|
14
|
-
if (error.error?.includes("Card with id"))
|
|
13
|
+
if (gracely.Error.is(error)) {
|
|
14
|
+
if (error.error?.includes("Card with id")) {
|
|
15
15
|
result = "card not found"
|
|
16
|
-
else if (error.error?.includes("Failed to reach account"))
|
|
16
|
+
} else if (error.error?.includes("Failed to reach account")) {
|
|
17
17
|
result = "account not found"
|
|
18
|
-
else
|
|
18
|
+
} else {
|
|
19
19
|
result = "other"
|
|
20
|
-
|
|
20
|
+
}
|
|
21
|
+
} else {
|
|
21
22
|
result = error
|
|
23
|
+
}
|
|
22
24
|
return result
|
|
23
25
|
}
|
|
24
26
|
}
|
package/Backup/Base.ts
CHANGED
|
@@ -14,7 +14,7 @@ export type Base<T> = {
|
|
|
14
14
|
value: T
|
|
15
15
|
}
|
|
16
16
|
export namespace Base {
|
|
17
|
-
export type Action = typeof Action.values[number]
|
|
17
|
+
export type Action = (typeof Action.values)[number]
|
|
18
18
|
export namespace Action {
|
|
19
19
|
export const values = ["created", "updated", "cancelled", "removed", "inactivated"] as const
|
|
20
20
|
}
|
package/Balance.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { Amount } from "./Amount"
|
|
|
4
4
|
|
|
5
5
|
export type Balance = { available?: number; reserved?: Balance.Reserved }
|
|
6
6
|
export namespace Balance {
|
|
7
|
-
export type Reserve = typeof Reserve.values[number]
|
|
7
|
+
export type Reserve = (typeof Reserve.values)[number]
|
|
8
8
|
export namespace Reserve {
|
|
9
9
|
export const values = ["incoming", "outgoing", "buffer"] as const
|
|
10
10
|
export const type = isly.string<Reserve>(values)
|
|
@@ -16,7 +16,7 @@ export namespace Balance {
|
|
|
16
16
|
})
|
|
17
17
|
export type Legacy = Partial<Record<Legacy.Entry, number>>
|
|
18
18
|
export namespace Legacy {
|
|
19
|
-
export type Entry = typeof Entry.values[number]
|
|
19
|
+
export type Entry = (typeof Entry.values)[number]
|
|
20
20
|
export namespace Entry {
|
|
21
21
|
export const values = ["actual", "incomingReserved", "outgoingReserved", "bufferReserved"] as const
|
|
22
22
|
export const type = isly.string<Entry>(values)
|
package/Balances.ts
CHANGED
|
@@ -10,20 +10,23 @@ export namespace Balances {
|
|
|
10
10
|
export const type = isly.record<Balances>(isly.fromIs("isoly.Currency", isoly.Currency.is), Balances.Balance.type)
|
|
11
11
|
export function update(balances: Balances): Balances {
|
|
12
12
|
const result: Balances = {}
|
|
13
|
-
for (const [currency, balance] of Object.entries(balances))
|
|
13
|
+
for (const [currency, balance] of Object.entries(balances)) {
|
|
14
14
|
result[currency as isoly.Currency] = Balance.update(currency as isoly.Currency, balance)
|
|
15
|
+
}
|
|
15
16
|
return result
|
|
16
17
|
}
|
|
17
18
|
export function computeReserved(balances: Balances): Amounts {
|
|
18
19
|
const result: Amounts = {}
|
|
19
|
-
for (const [currency, balance] of Object.entries(balances))
|
|
20
|
+
for (const [currency, balance] of Object.entries(balances)) {
|
|
20
21
|
result[currency as isoly.Currency] = Balance.computeReserved(currency as isoly.Currency, balance)[1]
|
|
22
|
+
}
|
|
21
23
|
return result
|
|
22
24
|
}
|
|
23
25
|
export function computeActual(balances: Balances): Amounts {
|
|
24
26
|
const result: Amounts = {}
|
|
25
|
-
for (const [currency, balance] of Object.entries(balances))
|
|
27
|
+
for (const [currency, balance] of Object.entries(balances)) {
|
|
26
28
|
result[currency as isoly.Currency] = Balance.computeActual(currency as isoly.Currency, balance)[1]
|
|
29
|
+
}
|
|
27
30
|
return result
|
|
28
31
|
}
|
|
29
32
|
}
|
package/Card/Expiry.ts
CHANGED
|
@@ -3,10 +3,10 @@ import { isly } from "isly"
|
|
|
3
3
|
import { isly as isly2 } from "isly2"
|
|
4
4
|
|
|
5
5
|
const year = [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40] as const
|
|
6
|
-
type Year = typeof year[number]
|
|
6
|
+
type Year = (typeof year)[number]
|
|
7
7
|
|
|
8
8
|
const month = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] as const
|
|
9
|
-
type Month = typeof month[number]
|
|
9
|
+
type Month = (typeof month)[number]
|
|
10
10
|
|
|
11
11
|
export type Expiry = [Year, Month]
|
|
12
12
|
export namespace Expiry {
|
|
@@ -12,7 +12,7 @@ export interface Authorization {
|
|
|
12
12
|
|
|
13
13
|
export namespace Authorization {
|
|
14
14
|
export const statuses = ["created", "confirmed", "refunded", "captured", "cancelled"] as const
|
|
15
|
-
export type Status = typeof statuses[number]
|
|
15
|
+
export type Status = (typeof statuses)[number]
|
|
16
16
|
export const type = isly.object<Authorization>({
|
|
17
17
|
type: isly.string("authorization"),
|
|
18
18
|
id: isly.string(),
|
package/Card/Operation/Card.ts
CHANGED
|
@@ -13,7 +13,7 @@ export interface Card {
|
|
|
13
13
|
|
|
14
14
|
export namespace Card {
|
|
15
15
|
export const statuses = ["created", "changed", "cancelled"] as const
|
|
16
|
-
export type Status = typeof statuses[number]
|
|
16
|
+
export type Status = (typeof statuses)[number]
|
|
17
17
|
export const type = isly.object<Card>({
|
|
18
18
|
type: isly.string("card"),
|
|
19
19
|
status: isly.string(statuses),
|
package/Card/Operation/index.ts
CHANGED
|
@@ -25,7 +25,7 @@ export namespace Operation {
|
|
|
25
25
|
id: entry.transaction.id,
|
|
26
26
|
status: entry.type == "capture" ? "captured" : "refunded",
|
|
27
27
|
created: isoly.DateTime.now(),
|
|
28
|
-
|
|
28
|
+
}
|
|
29
29
|
}
|
|
30
30
|
export const type = isly.union(Card.type, OperationAuthorization.type)
|
|
31
31
|
export const type2: isly2.Union<Operation> = isly2
|
package/Card/Preset.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { isly as isly2 } from "isly2"
|
|
|
3
3
|
import { Realm } from "../Realm"
|
|
4
4
|
import { Stack } from "./Stack"
|
|
5
5
|
|
|
6
|
-
export type Preset = typeof Preset.names[number]
|
|
6
|
+
export type Preset = (typeof Preset.names)[number]
|
|
7
7
|
|
|
8
8
|
// (test OR p2p)-scheme-interchange
|
|
9
9
|
export namespace Preset {
|
|
@@ -5,7 +5,7 @@ import { Rail } from "../../Rail"
|
|
|
5
5
|
import { merchants } from "./merchants"
|
|
6
6
|
import { Merchant as Attribute } from "./merchants/Merchant"
|
|
7
7
|
|
|
8
|
-
export type Merchant = typeof Merchant.values[number]
|
|
8
|
+
export type Merchant = (typeof Merchant.values)[number]
|
|
9
9
|
export namespace Merchant {
|
|
10
10
|
export const values = typedly.Object.keys(merchants)
|
|
11
11
|
export const type = isly.string<Merchant>(values)
|
|
@@ -13,27 +13,29 @@ export namespace Merchant {
|
|
|
13
13
|
export function check(merchant: Merchant, counterpart: Rail.Address.Card.Counterpart): boolean {
|
|
14
14
|
const attribute: Attribute = merchants[merchant]
|
|
15
15
|
let result: boolean
|
|
16
|
-
if (attribute?.unambiguousMcc == counterpart.merchant.category)
|
|
16
|
+
if (attribute?.unambiguousMcc == counterpart.merchant.category) {
|
|
17
17
|
result = true
|
|
18
|
-
else if (attribute.contains && attribute.mccs)
|
|
18
|
+
} else if (attribute.contains && attribute.mccs) {
|
|
19
19
|
result =
|
|
20
20
|
attribute.mccs.some(mcc => mcc == counterpart.merchant.category) &&
|
|
21
21
|
attribute.contains.some(n => counterpart.merchant.name.includes(n))
|
|
22
|
-
else if (attribute.startsWith && attribute.mccs)
|
|
22
|
+
} else if (attribute.startsWith && attribute.mccs) {
|
|
23
23
|
result =
|
|
24
24
|
attribute.mccs.some(mcc => mcc == counterpart.merchant.category) &&
|
|
25
25
|
attribute.startsWith.some(n => counterpart.merchant.name.startsWith(n))
|
|
26
|
-
else
|
|
26
|
+
} else {
|
|
27
27
|
result = false
|
|
28
|
+
}
|
|
28
29
|
return result
|
|
29
30
|
}
|
|
30
31
|
export function resolve(counterpart: Rail.Address.Card.Counterpart): Merchant | undefined {
|
|
31
32
|
let result: Merchant | undefined
|
|
32
|
-
for (const merchant of values)
|
|
33
|
+
for (const merchant of values) {
|
|
33
34
|
if (check(merchant, counterpart)) {
|
|
34
35
|
result = merchant
|
|
35
36
|
break
|
|
36
37
|
}
|
|
38
|
+
}
|
|
37
39
|
return result
|
|
38
40
|
}
|
|
39
41
|
}
|
|
@@ -21,8 +21,9 @@ export namespace Restriction {
|
|
|
21
21
|
transaction: Transaction.Creatable.CardTransaction | Transaction.PreTransaction.Authorization
|
|
22
22
|
): boolean {
|
|
23
23
|
let result: boolean = true
|
|
24
|
-
if (restrictions.merchants?.length)
|
|
24
|
+
if (restrictions.merchants?.length) {
|
|
25
25
|
result = restrictions.merchants.some(merchant => Merchant.check(merchant, transaction.counterpart))
|
|
26
|
+
}
|
|
26
27
|
return result
|
|
27
28
|
}
|
|
28
29
|
}
|
package/Card/Scheme.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
2
|
import { isly as isly2 } from "isly2"
|
|
3
3
|
|
|
4
|
-
export type Scheme = typeof Scheme.schemes[number]
|
|
4
|
+
export type Scheme = (typeof Scheme.schemes)[number]
|
|
5
5
|
export namespace Scheme {
|
|
6
6
|
export const schemes = ["mastercard", "diners", "visa"] as const
|
|
7
7
|
export const type = isly.string<Scheme>(schemes)
|
package/Card/Stack.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
2
|
import { Realm } from "../Realm"
|
|
3
3
|
|
|
4
|
-
export type Stack = typeof Stack.stacks[number]
|
|
4
|
+
export type Stack = (typeof Stack.stacks)[number]
|
|
5
5
|
|
|
6
6
|
// realm-scheme-processor(-processor...)
|
|
7
7
|
export namespace Stack {
|
|
@@ -88,5 +88,5 @@ export namespace Stack {
|
|
|
88
88
|
)?.[0]
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
export type Character = typeof Character.values[number]
|
|
91
|
+
export type Character = (typeof Character.values)[number]
|
|
92
92
|
}
|
package/Client/Labels.ts
CHANGED
|
@@ -3,7 +3,10 @@ import { http } from "cloudly-http"
|
|
|
3
3
|
import { Label } from "../Label"
|
|
4
4
|
|
|
5
5
|
export class Labels {
|
|
6
|
-
constructor(
|
|
6
|
+
constructor(
|
|
7
|
+
private readonly client: http.Client,
|
|
8
|
+
readonly type: Label.Type
|
|
9
|
+
) {}
|
|
7
10
|
async create(label: Label): Promise<Label | gracely.Error> {
|
|
8
11
|
return this.client.post<Label>(`/label/${this.type}`, label)
|
|
9
12
|
}
|
package/Client/Operations.ts
CHANGED
|
@@ -15,10 +15,10 @@ export class Operations {
|
|
|
15
15
|
options?.start && options?.end
|
|
16
16
|
? `?start=${options?.start}&end=${options?.end}`
|
|
17
17
|
: options?.start
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
? `?start=${options?.start}`
|
|
19
|
+
: options?.end
|
|
20
|
+
? `?end=${options?.end}`
|
|
21
|
+
: ""
|
|
22
22
|
return this.client.get<Operation[] & { cursor?: string | undefined }>(
|
|
23
23
|
`/operation${search}`,
|
|
24
24
|
options && (({ start, end, ...headers }) => headers)(options)
|
|
@@ -71,8 +71,9 @@ export namespace Transactions {
|
|
|
71
71
|
type: isly.string("value", ...Transaction.types).optional(),
|
|
72
72
|
})
|
|
73
73
|
export function parse(query: string | http.Request["search"]): Query {
|
|
74
|
-
if (typeof query == "string")
|
|
75
|
-
query = query ? http.Search.parse(query.replace("?", "")) : {}
|
|
74
|
+
if (typeof query == "string") {
|
|
75
|
+
query = query ? http.Search.parse(query.replace("?", "")) : {}
|
|
76
|
+
} // search.parse does not support empty string
|
|
76
77
|
return type.prune(query) ?? {}
|
|
77
78
|
}
|
|
78
79
|
}
|
package/Client/index.ts
CHANGED
|
@@ -79,19 +79,20 @@ export class Client {
|
|
|
79
79
|
appendHeader: request => ({
|
|
80
80
|
...request.header,
|
|
81
81
|
realm: result.realm,
|
|
82
|
-
...(request.header.organization ?? result.organization
|
|
82
|
+
...((request.header.organization ?? result.organization)
|
|
83
83
|
? { organization: request.header.organization ?? result.organization }
|
|
84
84
|
: {}),
|
|
85
85
|
}),
|
|
86
86
|
postprocess: async response => {
|
|
87
87
|
let result = response
|
|
88
88
|
const body = await response.body
|
|
89
|
-
if (Array.isArray(body))
|
|
89
|
+
if (Array.isArray(body)) {
|
|
90
90
|
result = http.Response.create(
|
|
91
91
|
Object.defineProperty(body, "cursor", {
|
|
92
92
|
value: response.header.cursor ?? response.header.link?.split?.(",")[0],
|
|
93
93
|
})
|
|
94
94
|
)
|
|
95
|
+
}
|
|
95
96
|
return result
|
|
96
97
|
},
|
|
97
98
|
})
|
package/Holidays/index.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { isly } from "isly"
|
|
|
3
3
|
import { Dates } from "./Dates"
|
|
4
4
|
|
|
5
5
|
export namespace Holidays {
|
|
6
|
-
export type Regions = typeof Regions.values[number]
|
|
6
|
+
export type Regions = (typeof Regions.values)[number]
|
|
7
7
|
export namespace Regions {
|
|
8
8
|
export const values = ["England", "Wales", "Scotland", "Northern Ireland"] as const
|
|
9
9
|
export const type = isly.string<Regions>(values)
|
package/Label.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface Label {
|
|
|
7
7
|
}
|
|
8
8
|
export namespace Label {
|
|
9
9
|
export const type = isly.object<Label>({ name: isly.string(), color: isly.string(), description: isly.string() })
|
|
10
|
-
export type Type = typeof Type.values[number]
|
|
10
|
+
export type Type = (typeof Type.values)[number]
|
|
11
11
|
export namespace Type {
|
|
12
12
|
export const values = ["flag", "group"] as const
|
|
13
13
|
export const type = isly.string(values)
|
package/Log/Message/Entry.ts
CHANGED
package/Log/Message/index.ts
CHANGED
|
@@ -19,15 +19,16 @@ export namespace Message {
|
|
|
19
19
|
realm: configuration.realm,
|
|
20
20
|
resource: configuration.resource,
|
|
21
21
|
entries: [],
|
|
22
|
-
|
|
22
|
+
}
|
|
23
23
|
: undefined
|
|
24
|
-
if (result)
|
|
24
|
+
if (result) {
|
|
25
25
|
for (const trace of traces) {
|
|
26
26
|
const logFragment: { entry: Log.Entry; resource: Log["resource"] } | undefined =
|
|
27
27
|
Message.Entry.fromEventLogs(trace)
|
|
28
28
|
logFragment?.resource && (result.resource ??= logFragment.resource)
|
|
29
29
|
logFragment?.entry && result.entries.push(logFragment.entry)
|
|
30
30
|
}
|
|
31
|
+
}
|
|
31
32
|
return (configuration?.requireEntries && result?.entries && result.entries.length > 0) ||
|
|
32
33
|
!configuration?.requireEntries
|
|
33
34
|
? result
|
package/Log/index.ts
CHANGED
|
@@ -50,10 +50,12 @@ export namespace Log {
|
|
|
50
50
|
locations?: LogLocations
|
|
51
51
|
): void {
|
|
52
52
|
const configuration = { collection, realm, resource, requireEntries }
|
|
53
|
-
if (Log.Message.Configuration.type.safeParse(configuration).success)
|
|
53
|
+
if (Log.Message.Configuration.type.safeParse(configuration).success) {
|
|
54
54
|
console.log(configuration)
|
|
55
|
-
|
|
55
|
+
}
|
|
56
|
+
if (Log.Locations.type.safeParse(locations).success) {
|
|
56
57
|
console.log(Log.Entry.Message.to("Locations", locations, resource))
|
|
58
|
+
}
|
|
57
59
|
}
|
|
58
60
|
export function log(message: string, data?: any, resource?: string): void {
|
|
59
61
|
console.log(Log.Entry.Message.to(message, data, resource))
|
package/Operation/Change.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface Change<T extends Change.Operand = Change.Operand> {
|
|
|
10
10
|
|
|
11
11
|
export namespace Change {
|
|
12
12
|
export const operand = ["add", "subtract"] as const
|
|
13
|
-
export type Operand = typeof operand[number]
|
|
13
|
+
export type Operand = (typeof operand)[number]
|
|
14
14
|
export const type = isly.object<Change>({
|
|
15
15
|
type: isly.string(["add", "subtract"]),
|
|
16
16
|
amount: isly.number(),
|
package/Operation/Changes.ts
CHANGED
|
@@ -18,10 +18,10 @@ export namespace Changes {
|
|
|
18
18
|
: 0
|
|
19
19
|
),
|
|
20
20
|
0
|
|
21
|
-
|
|
21
|
+
)
|
|
22
22
|
: "available" in changes
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
? (changes.available?.type == "subtract" ? -1 : 1) * (changes.available?.amount ?? 0)
|
|
24
|
+
: 0
|
|
25
25
|
}
|
|
26
26
|
export function reserved(changes: MaybeLegacy, currency: isoly.Currency): number {
|
|
27
27
|
return Object.entries(changes).reduce(
|
|
@@ -57,7 +57,7 @@ export namespace Changes {
|
|
|
57
57
|
export const type = isly.record<Legacy>(isly.string(), Change.type)
|
|
58
58
|
export type Entry = AccountBalance.Legacy.Entry
|
|
59
59
|
export namespace Entry {
|
|
60
|
-
export type Balance = typeof AccountBalance.Legacy.Entry.values[number]
|
|
60
|
+
export type Balance = (typeof AccountBalance.Legacy.Entry.values)[number]
|
|
61
61
|
export namespace Balance {
|
|
62
62
|
export const type = AccountBalance.Legacy.Entry.type
|
|
63
63
|
}
|
|
@@ -68,17 +68,18 @@ export namespace Changes {
|
|
|
68
68
|
export const type = isly.string<Entry>()
|
|
69
69
|
export function getBalanceType(key: string): string {
|
|
70
70
|
let result = ""
|
|
71
|
-
if (key.includes("net") || key.includes("fee") || key.includes("charge"))
|
|
71
|
+
if (key.includes("net") || key.includes("fee") || key.includes("charge")) {
|
|
72
72
|
result = "collecting"
|
|
73
|
-
else if (key.toLowerCase().includes("reserved") || key === "available")
|
|
73
|
+
} else if (key.toLowerCase().includes("reserved") || key === "available") {
|
|
74
74
|
result = "balance"
|
|
75
|
-
else if (key.includes("internal"))
|
|
75
|
+
} else if (key.includes("internal")) {
|
|
76
76
|
result = "equalizing"
|
|
77
|
-
else
|
|
77
|
+
} else {
|
|
78
78
|
result = "fiat"
|
|
79
|
+
}
|
|
79
80
|
return result
|
|
80
81
|
}
|
|
81
|
-
export type Balance = typeof Balance.values[number]
|
|
82
|
+
export type Balance = (typeof Balance.values)[number]
|
|
82
83
|
export namespace Balance {
|
|
83
84
|
export const values = ["available", "reserved-incoming", "reserved-outgoing", "reserved-buffer"] as const
|
|
84
85
|
export const type = isly.string<Balance>(values)
|
package/Operation/Creatable.ts
CHANGED
|
@@ -29,7 +29,7 @@ export namespace Creatable {
|
|
|
29
29
|
"legacy",
|
|
30
30
|
"adjustBuffer",
|
|
31
31
|
] as const
|
|
32
|
-
export type Type = typeof types[number]
|
|
32
|
+
export type Type = (typeof types)[number]
|
|
33
33
|
export const type = isly.object<Creatable>({
|
|
34
34
|
account: isly.fromIs("cryptly.Identifier", cryptly.Identifier.is),
|
|
35
35
|
currency: isly.fromIs("isoly.Currency", isoly.Currency.is),
|
package/Operation/Status.ts
CHANGED
package/Operation/index.ts
CHANGED
|
@@ -19,7 +19,7 @@ export namespace Operation {
|
|
|
19
19
|
}
|
|
20
20
|
export function sum(operations: Operation[]): Changes.Sum {
|
|
21
21
|
const result: Changes.Sum = {}
|
|
22
|
-
for (const operation of operations)
|
|
22
|
+
for (const operation of operations) {
|
|
23
23
|
Object.entries(operation.changes).forEach(([entry, change]) => {
|
|
24
24
|
result[entry as Changes.Entry.Balance] = isoly.Currency[change.type](
|
|
25
25
|
operation.currency,
|
|
@@ -27,6 +27,7 @@ export namespace Operation {
|
|
|
27
27
|
change.amount
|
|
28
28
|
)
|
|
29
29
|
})
|
|
30
|
+
}
|
|
30
31
|
return result
|
|
31
32
|
}
|
|
32
33
|
export import Signer = OperationSigner
|
package/Organization/Risk.ts
CHANGED
package/Quarter.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
3
|
|
|
4
|
-
export type Quarter = typeof Quarter.values[number]
|
|
4
|
+
export type Quarter = (typeof Quarter.values)[number]
|
|
5
5
|
export namespace Quarter {
|
|
6
6
|
export const values = ["Q1", "Q2", "Q3", "Q4"] as const
|
|
7
7
|
export const type = isly.string<Quarter>(values)
|
package/Rail/Address/Route.ts
CHANGED
|
@@ -6,11 +6,11 @@ export namespace Route {
|
|
|
6
6
|
export namespace Account {
|
|
7
7
|
export const type = isly.object<Account>({ type: isly.string("account"), id: isly.string() })
|
|
8
8
|
}
|
|
9
|
-
export type Service = { type: "service"; service:
|
|
9
|
+
export type Service = { type: "service"; service: string; configuration: string }
|
|
10
10
|
export namespace Service {
|
|
11
11
|
export const type = isly.object<Service>({
|
|
12
12
|
type: isly.string("service"),
|
|
13
|
-
service: isly.string(
|
|
13
|
+
service: isly.string(),
|
|
14
14
|
configuration: isly.string(),
|
|
15
15
|
})
|
|
16
16
|
}
|