@pax2pay/model-banking 0.1.425 → 0.1.427
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/Account/Creatable.ts +0 -2
- package/Account/History.ts +0 -2
- package/Account/Status.ts +0 -2
- package/Account/index.ts +0 -2
- package/Amount.ts +0 -2
- package/Amounts.ts +0 -2
- package/Authorization/Creatable.ts +0 -2
- package/Authorization/index.ts +2 -0
- package/Balances.ts +0 -2
- package/Card/Changeable.ts +0 -3
- package/Card/Creatable.ts +0 -1
- package/Card/Expiry.ts +0 -1
- package/Card/Operation/Authorization.ts +0 -1
- package/Card/Operation/Card.ts +0 -1
- package/Card/Operation/index.ts +0 -1
- package/Card/Preset.ts +0 -2
- package/Card/Stack.ts +0 -2
- package/Card/index.ts +0 -1
- package/Exchange.ts +0 -2
- package/Identifier.ts +0 -2
- package/Identity.ts +2 -1
- package/Key/Roles.ts +1 -2
- package/Label.ts +0 -4
- package/Merchant/index.ts +0 -2
- package/Operation/Change.ts +0 -6
- package/Operation/Changes.ts +0 -2
- package/Operation/Creatable.ts +0 -2
- package/Operation/Status.ts +0 -2
- package/Operation/index.ts +0 -2
- package/Organization/Changeable.ts +0 -2
- package/Organization/Contact/Address/GB.ts +0 -2
- package/Organization/Contact/Address/General.ts +0 -2
- package/Organization/Contact/Address/SE.ts +0 -2
- package/Organization/Contact/Address/index.ts +0 -2
- package/Organization/Contact/Addresses.ts +0 -2
- package/Organization/Contact/index.ts +0 -1
- package/Organization/index.ts +0 -2
- package/Rail/Address/Card.ts +1 -2
- package/Rail/Address/Iban.ts +0 -1
- package/Rail/Address/PaxGiro.ts +0 -1
- package/Rail/Address/Scan.ts +0 -1
- package/Rail/Address/index.ts +1 -1
- package/Rail/Address/internal.ts +1 -2
- package/Realm.ts +0 -2
- package/Rule/Charge.ts +1 -1
- package/Rule/Reserve.ts +1 -1
- package/Rule/State/Authorization.ts +0 -2
- package/Rule/State/Card.ts +0 -2
- package/Rule/State/Partial.ts +0 -2
- package/Settlement/Batch.ts +0 -1
- package/Settlement/Creatable.ts +0 -2
- package/Settlement/Entry/Cancel.ts +0 -4
- package/Settlement/Entry/Capture.ts +1 -8
- package/Settlement/Entry/Creatable.ts +0 -2
- package/Settlement/Entry/Refund.ts +2 -4
- package/Settlement/Entry/Summary.ts +0 -2
- package/Settlement/Entry/Unknown.ts +0 -4
- package/Settlement/Entry/index.ts +1 -3
- package/Settlement/Fee.ts +0 -2
- package/Settlement/Status.ts +0 -2
- package/Settlement/index.ts +1 -3
- package/Supplier/index.ts +0 -1
- package/Transaction/Creatable.ts +0 -3
- package/Transaction/Incoming.ts +1 -2
- package/Transaction/Note.ts +0 -2
- package/Transaction/Reference.ts +1 -2
- package/Transaction/index.ts +3 -6
- package/Treasury/Account/Conditions.ts +0 -1
- package/Treasury/Account/Fetchable.ts +1 -1
- package/Treasury/Balance/index.ts +0 -2
- package/dist/Account/Creatable.d.ts +0 -3
- package/dist/Account/Creatable.js +0 -2
- package/dist/Account/Creatable.js.map +1 -1
- package/dist/Account/History.d.ts +0 -2
- package/dist/Account/History.js +0 -2
- package/dist/Account/History.js.map +1 -1
- package/dist/Account/Status.d.ts +0 -3
- package/dist/Account/Status.js +0 -2
- package/dist/Account/Status.js.map +1 -1
- package/dist/Account/index.d.ts +0 -3
- package/dist/Account/index.js +0 -2
- package/dist/Account/index.js.map +1 -1
- package/dist/Amount.d.ts +0 -2
- package/dist/Amount.js +0 -2
- package/dist/Amount.js.map +1 -1
- package/dist/Amounts.d.ts +0 -2
- package/dist/Amounts.js +0 -2
- package/dist/Amounts.js.map +1 -1
- package/dist/Authorization/Creatable.d.ts +0 -3
- package/dist/Authorization/Creatable.js +0 -2
- package/dist/Authorization/Creatable.js.map +1 -1
- package/dist/Authorization/index.js +2 -0
- package/dist/Authorization/index.js.map +1 -1
- package/dist/Balances.d.ts +0 -2
- package/dist/Balances.js +0 -2
- package/dist/Balances.js.map +1 -1
- package/dist/Card/Changeable.d.ts +0 -4
- package/dist/Card/Changeable.js +0 -3
- package/dist/Card/Changeable.js.map +1 -1
- package/dist/Card/Creatable.d.ts +0 -1
- package/dist/Card/Creatable.js +0 -1
- package/dist/Card/Creatable.js.map +1 -1
- package/dist/Card/Expiry.d.ts +0 -1
- package/dist/Card/Expiry.js +0 -1
- package/dist/Card/Expiry.js.map +1 -1
- package/dist/Card/Operation/Authorization.d.ts +0 -1
- package/dist/Card/Operation/Authorization.js +0 -1
- package/dist/Card/Operation/Authorization.js.map +1 -1
- package/dist/Card/Operation/Card.d.ts +0 -1
- package/dist/Card/Operation/Card.js +0 -1
- package/dist/Card/Operation/Card.js.map +1 -1
- package/dist/Card/Operation/index.d.ts +0 -1
- package/dist/Card/Operation/index.js +0 -1
- package/dist/Card/Operation/index.js.map +1 -1
- package/dist/Card/Preset.d.ts +0 -2
- package/dist/Card/Preset.js +0 -2
- package/dist/Card/Preset.js.map +1 -1
- package/dist/Card/Stack.d.ts +0 -2
- package/dist/Card/Stack.js +0 -2
- package/dist/Card/Stack.js.map +1 -1
- package/dist/Card/index.d.ts +0 -1
- package/dist/Card/index.js +0 -1
- package/dist/Card/index.js.map +1 -1
- package/dist/Exchange.d.ts +0 -542
- package/dist/Exchange.js +0 -2
- package/dist/Exchange.js.map +1 -1
- package/dist/Identifier.d.ts +0 -2
- package/dist/Identifier.js +0 -2
- package/dist/Identifier.js.map +1 -1
- package/dist/Identity.js +2 -1
- package/dist/Identity.js.map +1 -1
- package/dist/Key/Roles.d.ts +0 -1
- package/dist/Key/Roles.js +1 -2
- package/dist/Key/Roles.js.map +1 -1
- package/dist/Label.d.ts +0 -4
- package/dist/Label.js +0 -4
- package/dist/Label.js.map +1 -1
- package/dist/Merchant/index.d.ts +0 -3
- package/dist/Merchant/index.js +0 -2
- package/dist/Merchant/index.js.map +1 -1
- package/dist/Operation/Change.d.ts +0 -7
- package/dist/Operation/Change.js +0 -6
- package/dist/Operation/Change.js.map +1 -1
- package/dist/Operation/Changes.d.ts +0 -2
- package/dist/Operation/Changes.js +0 -2
- package/dist/Operation/Changes.js.map +1 -1
- package/dist/Operation/Creatable.d.ts +0 -3
- package/dist/Operation/Creatable.js +0 -2
- package/dist/Operation/Creatable.js.map +1 -1
- package/dist/Operation/Status.d.ts +0 -2
- package/dist/Operation/Status.js +0 -2
- package/dist/Operation/Status.js.map +1 -1
- package/dist/Operation/index.d.ts +0 -3
- package/dist/Operation/index.js +0 -2
- package/dist/Operation/index.js.map +1 -1
- package/dist/Organization/Changeable.d.ts +0 -3
- package/dist/Organization/Changeable.js +0 -2
- package/dist/Organization/Changeable.js.map +1 -1
- package/dist/Organization/Contact/Address/GB.d.ts +0 -3
- package/dist/Organization/Contact/Address/GB.js +0 -2
- package/dist/Organization/Contact/Address/GB.js.map +1 -1
- package/dist/Organization/Contact/Address/General.d.ts +0 -3
- package/dist/Organization/Contact/Address/General.js +0 -2
- package/dist/Organization/Contact/Address/General.js.map +1 -1
- package/dist/Organization/Contact/Address/SE.d.ts +0 -3
- package/dist/Organization/Contact/Address/SE.js +0 -2
- package/dist/Organization/Contact/Address/SE.js.map +1 -1
- package/dist/Organization/Contact/Address/index.d.ts +0 -2
- package/dist/Organization/Contact/Address/index.js +0 -2
- package/dist/Organization/Contact/Address/index.js.map +1 -1
- package/dist/Organization/Contact/Addresses.d.ts +0 -3
- package/dist/Organization/Contact/Addresses.js +0 -2
- package/dist/Organization/Contact/Addresses.js.map +1 -1
- package/dist/Organization/Contact/index.d.ts +0 -1
- package/dist/Organization/Contact/index.js +0 -1
- package/dist/Organization/Contact/index.js.map +1 -1
- package/dist/Organization/index.d.ts +0 -3
- package/dist/Organization/index.js +0 -2
- package/dist/Organization/index.js.map +1 -1
- package/dist/Rail/Address/Card.d.ts +0 -3
- package/dist/Rail/Address/Card.js +0 -2
- package/dist/Rail/Address/Card.js.map +1 -1
- package/dist/Rail/Address/Iban.d.ts +0 -1
- package/dist/Rail/Address/Iban.js +0 -1
- package/dist/Rail/Address/Iban.js.map +1 -1
- package/dist/Rail/Address/PaxGiro.d.ts +0 -1
- package/dist/Rail/Address/PaxGiro.js +0 -1
- package/dist/Rail/Address/PaxGiro.js.map +1 -1
- package/dist/Rail/Address/Scan.d.ts +0 -1
- package/dist/Rail/Address/Scan.js +0 -1
- package/dist/Rail/Address/Scan.js.map +1 -1
- package/dist/Rail/Address/index.d.ts +0 -1
- package/dist/Rail/Address/index.js +0 -1
- package/dist/Rail/Address/index.js.map +1 -1
- package/dist/Rail/Address/internal.d.ts +0 -3
- package/dist/Rail/Address/internal.js +0 -2
- package/dist/Rail/Address/internal.js.map +1 -1
- package/dist/Realm.d.ts +0 -2
- package/dist/Realm.js +0 -2
- package/dist/Realm.js.map +1 -1
- package/dist/Rule/Charge.js +1 -1
- package/dist/Rule/Charge.js.map +1 -1
- package/dist/Rule/Reserve.js +1 -1
- package/dist/Rule/Reserve.js.map +1 -1
- package/dist/Rule/State/Authorization.d.ts +0 -3
- package/dist/Rule/State/Authorization.js +0 -2
- package/dist/Rule/State/Authorization.js.map +1 -1
- package/dist/Rule/State/Card.d.ts +0 -3
- package/dist/Rule/State/Card.js +0 -2
- package/dist/Rule/State/Card.js.map +1 -1
- package/dist/Rule/State/Partial.d.ts +0 -3
- package/dist/Rule/State/Partial.js +0 -2
- package/dist/Rule/State/Partial.js.map +1 -1
- package/dist/Settlement/Batch.d.ts +0 -1
- package/dist/Settlement/Batch.js +0 -1
- package/dist/Settlement/Batch.js.map +1 -1
- package/dist/Settlement/Creatable.d.ts +0 -3
- package/dist/Settlement/Creatable.js +0 -2
- package/dist/Settlement/Creatable.js.map +1 -1
- package/dist/Settlement/Entry/Cancel.d.ts +0 -5
- package/dist/Settlement/Entry/Cancel.js +0 -4
- package/dist/Settlement/Entry/Cancel.js.map +1 -1
- package/dist/Settlement/Entry/Capture.d.ts +0 -5
- package/dist/Settlement/Entry/Capture.js +1 -8
- package/dist/Settlement/Entry/Capture.js.map +1 -1
- package/dist/Settlement/Entry/Creatable.d.ts +0 -2
- package/dist/Settlement/Entry/Creatable.js +0 -2
- package/dist/Settlement/Entry/Creatable.js.map +1 -1
- package/dist/Settlement/Entry/Refund.d.ts +1 -5
- package/dist/Settlement/Entry/Refund.js +1 -4
- package/dist/Settlement/Entry/Refund.js.map +1 -1
- package/dist/Settlement/Entry/Summary.d.ts +0 -3
- package/dist/Settlement/Entry/Summary.js +0 -2
- package/dist/Settlement/Entry/Summary.js.map +1 -1
- package/dist/Settlement/Entry/Unknown.d.ts +0 -5
- package/dist/Settlement/Entry/Unknown.js +0 -4
- package/dist/Settlement/Entry/Unknown.js.map +1 -1
- package/dist/Settlement/Entry/index.d.ts +0 -2
- package/dist/Settlement/Entry/index.js +1 -3
- package/dist/Settlement/Entry/index.js.map +1 -1
- package/dist/Settlement/Fee.d.ts +0 -3
- package/dist/Settlement/Fee.js +0 -2
- package/dist/Settlement/Fee.js.map +1 -1
- package/dist/Settlement/Status.d.ts +0 -3
- package/dist/Settlement/Status.js +0 -2
- package/dist/Settlement/Status.js.map +1 -1
- package/dist/Settlement/index.d.ts +0 -3
- package/dist/Settlement/index.js +1 -3
- package/dist/Settlement/index.js.map +1 -1
- package/dist/Supplier/index.d.ts +0 -1
- package/dist/Supplier/index.js +0 -1
- package/dist/Supplier/index.js.map +1 -1
- package/dist/Transaction/Creatable.d.ts +0 -4
- package/dist/Transaction/Creatable.js +0 -3
- package/dist/Transaction/Creatable.js.map +1 -1
- package/dist/Transaction/Incoming.d.ts +0 -3
- package/dist/Transaction/Incoming.js +0 -2
- package/dist/Transaction/Incoming.js.map +1 -1
- package/dist/Transaction/Note.d.ts +0 -2
- package/dist/Transaction/Note.js +0 -2
- package/dist/Transaction/Note.js.map +1 -1
- package/dist/Transaction/Reference.d.ts +0 -1
- package/dist/Transaction/Reference.js +1 -2
- package/dist/Transaction/Reference.js.map +1 -1
- package/dist/Transaction/index.d.ts +0 -6
- package/dist/Transaction/index.js +1 -6
- package/dist/Transaction/index.js.map +1 -1
- package/dist/Treasury/Account/Conditions.d.ts +0 -1
- package/dist/Treasury/Account/Conditions.js +0 -1
- package/dist/Treasury/Account/Conditions.js.map +1 -1
- package/dist/Treasury/Account/Fetchable.js +1 -1
- package/dist/Treasury/Account/Fetchable.js.map +1 -1
- package/dist/Treasury/Balance/index.d.ts +0 -2
- package/dist/Treasury/Balance/index.js +0 -2
- package/dist/Treasury/Balance/index.js.map +1 -1
- package/package.json +1 -1
package/Account/Creatable.ts
CHANGED
package/Account/History.ts
CHANGED
package/Account/Status.ts
CHANGED
package/Account/index.ts
CHANGED
|
@@ -34,8 +34,6 @@ export namespace Account {
|
|
|
34
34
|
rules: Rule.type.array().optional(),
|
|
35
35
|
status: AccountStatus.type,
|
|
36
36
|
})
|
|
37
|
-
export const is = type.is
|
|
38
|
-
export const flaw = type.flaw
|
|
39
37
|
export function isIdentifier(value: cryptly.Identifier | any): value is cryptly.Identifier {
|
|
40
38
|
return cryptly.Identifier.is(value, 8)
|
|
41
39
|
}
|
package/Amount.ts
CHANGED
package/Amounts.ts
CHANGED
package/Authorization/index.ts
CHANGED
|
@@ -87,6 +87,7 @@ export namespace Authorization {
|
|
|
87
87
|
id: Identifier.generate(),
|
|
88
88
|
status: Status.Failed.from(transaction),
|
|
89
89
|
...partial,
|
|
90
|
+
account: creatable.account,
|
|
90
91
|
card: { id: creatable.card },
|
|
91
92
|
}
|
|
92
93
|
else if (!Transaction.Status.Success.is(transaction.status))
|
|
@@ -94,6 +95,7 @@ export namespace Authorization {
|
|
|
94
95
|
id: transaction.id,
|
|
95
96
|
status: Status.Failed.from(transaction.status[1]),
|
|
96
97
|
...partial,
|
|
98
|
+
account: transaction.accountId,
|
|
97
99
|
card: { iin: transaction.account.iin, last4: transaction.account.last4, id: creatable.card },
|
|
98
100
|
}
|
|
99
101
|
else
|
package/Balances.ts
CHANGED
|
@@ -8,8 +8,6 @@ export type Balances = Partial<Record<isoly.Currency, Balances.Balance.Extended>
|
|
|
8
8
|
export namespace Balances {
|
|
9
9
|
export import Balance = BalancesBalance
|
|
10
10
|
export const type = isly.record<Balances>(isly.fromIs("isoly.Currency", isoly.Currency.is), Balances.Balance.type)
|
|
11
|
-
export const is = type.is
|
|
12
|
-
export const flaw = type.flaw
|
|
13
11
|
export function update(balances: Balances): Balances {
|
|
14
12
|
const result: Balances = {}
|
|
15
13
|
for (const [currency, balance] of Object.entries(balances))
|
package/Card/Changeable.ts
CHANGED
|
@@ -13,7 +13,4 @@ export namespace Changeable {
|
|
|
13
13
|
limit: isly.tuple(isly.fromIs("isoly.Currency", isoly.Currency.is), isly.number()).optional(),
|
|
14
14
|
meta: isly.fromIs("Card.Meta", Meta.is).optional(),
|
|
15
15
|
})
|
|
16
|
-
export const is = type.is
|
|
17
|
-
export const flaw = type.flaw
|
|
18
|
-
export const get = type.get
|
|
19
16
|
}
|
package/Card/Creatable.ts
CHANGED
package/Card/Expiry.ts
CHANGED
|
@@ -10,7 +10,6 @@ type Month = typeof month[number]
|
|
|
10
10
|
export type Expiry = [Year, Month]
|
|
11
11
|
export namespace Expiry {
|
|
12
12
|
export const type = isly.tuple<Expiry>(isly.number([...year]), isly.number([...month])) // Deconstructing to remove readonly.
|
|
13
|
-
export const is = type.is
|
|
14
13
|
export function toDateTime(expiry: Expiry): isoly.DateTime {
|
|
15
14
|
return isoly.DateTime.nextMonth(
|
|
16
15
|
"20" + expiry[0].toString() + "-" + expiry[1].toString().padStart(2, "0") + "-01T00:00:01.000Z"
|
package/Card/Operation/Card.ts
CHANGED
package/Card/Operation/index.ts
CHANGED
package/Card/Preset.ts
CHANGED
|
@@ -19,8 +19,6 @@ export namespace Preset {
|
|
|
19
19
|
"test-diners-202",
|
|
20
20
|
] as const
|
|
21
21
|
export const type = isly.string<Preset>(names)
|
|
22
|
-
export const is = type.is
|
|
23
|
-
export const flaw = type.flaw
|
|
24
22
|
export const presets: Record<Preset, Stack> = {
|
|
25
23
|
"p2p-mc-200": "uk-mc-tpl-marqeta",
|
|
26
24
|
"p2p-diners-175": "uk-diners-dpg",
|
package/Card/Stack.ts
CHANGED
|
@@ -15,8 +15,6 @@ export namespace Stack {
|
|
|
15
15
|
"uk-mc-tpl-marqeta",
|
|
16
16
|
] as const
|
|
17
17
|
export const type = isly.string(stacks)
|
|
18
|
-
export const is = type.is
|
|
19
|
-
export const flaw = type.flaw
|
|
20
18
|
export function toRealm(stack: Stack): Realm {
|
|
21
19
|
return stack.split("-")[0] as Realm
|
|
22
20
|
}
|
package/Card/index.ts
CHANGED
package/Exchange.ts
CHANGED
|
@@ -7,8 +7,6 @@ export namespace Exchange {
|
|
|
7
7
|
isly.fromIs("Currency", isoly.Currency.is),
|
|
8
8
|
isly.record(isly.fromIs("Currency", isoly.Currency.is), isly.number())
|
|
9
9
|
)
|
|
10
|
-
export const is = type.is
|
|
11
|
-
export const flaw = type.flaw
|
|
12
10
|
export function convert(
|
|
13
11
|
amount: number,
|
|
14
12
|
from: isoly.Currency,
|
package/Identifier.ts
CHANGED
|
@@ -19,6 +19,4 @@ export namespace Identifier {
|
|
|
19
19
|
return isoly.DateTime.create(Number(new BigUint64Array(decoded.slice(decoded.length - 8).buffer)), "milliseconds")
|
|
20
20
|
}
|
|
21
21
|
export const type = isly.fromIs("Identifier", cryptly.Identifier.is)
|
|
22
|
-
export const is = type.is
|
|
23
|
-
export const flaw = type.flaw
|
|
24
22
|
}
|
package/Identity.ts
CHANGED
|
@@ -48,7 +48,8 @@ export class Identity {
|
|
|
48
48
|
): value is
|
|
49
49
|
| (keyof T extends keyof Identity ? Required<Pick<Identity, keyof T>> & Identity : Identity)
|
|
50
50
|
| undefined =>
|
|
51
|
-
(requires?.organization ? !!identity?.organization : true) &&
|
|
51
|
+
(requires?.organization ? !!identity?.organization : true) &&
|
|
52
|
+
(requires?.realm ? Realm.type.is(identity?.realm) : true)
|
|
52
53
|
return (identity?.check(constraint) && requirement(identity) && identity) || undefined
|
|
53
54
|
}
|
|
54
55
|
static async verify(
|
package/Key/Roles.ts
CHANGED
|
@@ -31,7 +31,7 @@ export namespace Roles {
|
|
|
31
31
|
(r, role) =>
|
|
32
32
|
userwidgets.User.Permissions.merge(r, {
|
|
33
33
|
[key]:
|
|
34
|
-
organizationCode == "*" && Realm.is(role)
|
|
34
|
+
organizationCode == "*" && Realm.type.is(role)
|
|
35
35
|
? Realm.definitions[role]
|
|
36
36
|
: Organization.definitions[role as Organization.Role],
|
|
37
37
|
}),
|
|
@@ -45,7 +45,6 @@ export namespace Roles {
|
|
|
45
45
|
export type Role = typeof roles[number]
|
|
46
46
|
export const roles = ["admin", "fincrime-readonly", "fincrime", "finance", "operations", "support"] as const
|
|
47
47
|
export const type = isly.string(roles)
|
|
48
|
-
export const is = type.is
|
|
49
48
|
export const definitions: Record<Role, Permissions.Realm | true> = {
|
|
50
49
|
admin: true,
|
|
51
50
|
"fincrime-readonly": {
|
package/Label.ts
CHANGED
|
@@ -7,13 +7,9 @@ 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 const is = type.is
|
|
11
|
-
export const flaw = type.flaw
|
|
12
10
|
export type Type = typeof Type.values[number]
|
|
13
11
|
export namespace Type {
|
|
14
12
|
export const values = ["flag", "group"] as const
|
|
15
13
|
export const type = isly.string(values)
|
|
16
|
-
export const is = type.is
|
|
17
|
-
export const flaw = type.flaw
|
|
18
14
|
}
|
|
19
15
|
}
|
package/Merchant/index.ts
CHANGED
package/Operation/Change.ts
CHANGED
|
@@ -17,20 +17,14 @@ export namespace Change {
|
|
|
17
17
|
status: Status.type,
|
|
18
18
|
result: isly.number().optional(),
|
|
19
19
|
})
|
|
20
|
-
export const is = type.is
|
|
21
|
-
export const flaw = type.flaw
|
|
22
20
|
export namespace Add {
|
|
23
21
|
export const type = Change.type.extend<Change<"add">>({
|
|
24
22
|
type: isly.string("add"),
|
|
25
23
|
})
|
|
26
|
-
export const is = type.is
|
|
27
|
-
export const flaw = type.flaw
|
|
28
24
|
}
|
|
29
25
|
export namespace Subtract {
|
|
30
26
|
export const type = Change.type.extend<Change<"subtract">>({
|
|
31
27
|
type: isly.string("subtract"),
|
|
32
28
|
})
|
|
33
|
-
export const is = type.is
|
|
34
|
-
export const flaw = type.flaw
|
|
35
29
|
}
|
|
36
30
|
}
|
package/Operation/Changes.ts
CHANGED
|
@@ -57,8 +57,6 @@ export namespace Changes {
|
|
|
57
57
|
Record<Changes.Entry.Counterbalance, Change>
|
|
58
58
|
export namespace Legacy {
|
|
59
59
|
export const type = isly.record<Legacy>(isly.string(), Change.type)
|
|
60
|
-
export const is = type.is
|
|
61
|
-
export const flaw = type.flaw
|
|
62
60
|
export type Entry = AccountBalance.Legacy.Entry | Legacy.Entry.Counterbalance
|
|
63
61
|
export namespace Entry {
|
|
64
62
|
export function split(counterbalance: Counterbalance): [isoly.DateTime, CounterbalanceOperation.Link] {
|
package/Operation/Creatable.ts
CHANGED
|
@@ -36,8 +36,6 @@ export namespace Creatable {
|
|
|
36
36
|
changes: Changes.type,
|
|
37
37
|
type: isly.string(types),
|
|
38
38
|
})
|
|
39
|
-
export const is = type.is
|
|
40
|
-
export const flaw = type.flaw
|
|
41
39
|
export function fromRefund(account: string, settlement: string, entry: Settlement.Entry.Refund.Creatable): Creatable {
|
|
42
40
|
// The Entry.Refund.Creatable has negative amount and fee
|
|
43
41
|
// The operation amounts should always be positive
|
package/Operation/Status.ts
CHANGED
package/Operation/index.ts
CHANGED
|
@@ -40,8 +40,6 @@ export namespace Operation {
|
|
|
40
40
|
signature: isly.string().optional(),
|
|
41
41
|
previous: isly.string().optional(),
|
|
42
42
|
})
|
|
43
|
-
export const is = type.is
|
|
44
|
-
export const flaw = type.flaw
|
|
45
43
|
export function fromCreatable(transaction: string, creatable: Creatable): Operation {
|
|
46
44
|
return { ...creatable, transaction, counter: 0, created: isoly.DateTime.now() }
|
|
47
45
|
}
|
package/Organization/index.ts
CHANGED
|
@@ -22,8 +22,6 @@ export namespace Organization {
|
|
|
22
22
|
contact: OrganizationContact.type.optional(),
|
|
23
23
|
groups: isly.string().array().optional(),
|
|
24
24
|
})
|
|
25
|
-
export const is = type.is
|
|
26
|
-
export const flaw = type.flaw
|
|
27
25
|
export type Changeable = OrganizationChangeable
|
|
28
26
|
export const Changeable = OrganizationChangeable
|
|
29
27
|
export type Contact = OrganizationContact
|
package/Rail/Address/Card.ts
CHANGED
package/Rail/Address/Iban.ts
CHANGED
package/Rail/Address/PaxGiro.ts
CHANGED
package/Rail/Address/Scan.ts
CHANGED
package/Rail/Address/index.ts
CHANGED
package/Rail/Address/internal.ts
CHANGED
|
@@ -17,8 +17,7 @@ export namespace Internal {
|
|
|
17
17
|
identifier: isly.union(isly.fromIs("Identifier", cryptly.Identifier.is), Operation.Changes.Entry.type),
|
|
18
18
|
organization: isly.string().optional(),
|
|
19
19
|
})
|
|
20
|
-
|
|
21
|
-
export const flaw = type.flaw
|
|
20
|
+
|
|
22
21
|
export function toLink(internal: Internal, realm: Realm): string {
|
|
23
22
|
return `${realm}-internal-${internal.identifier}`
|
|
24
23
|
}
|
package/Realm.ts
CHANGED
|
@@ -7,8 +7,6 @@ export type Realm = typeof Realm.realms[number]
|
|
|
7
7
|
export namespace Realm {
|
|
8
8
|
export const realms = ["test", "testUK", "uk", "eea", "upcheck"] as const
|
|
9
9
|
export const type: isly.Type<Realm> = isly.string(realms)
|
|
10
|
-
export const is = type.is
|
|
11
|
-
export const flaw = type.flaw
|
|
12
10
|
export function toString(): string {
|
|
13
11
|
return realms.toString().replaceAll(",", ", ") + "."
|
|
14
12
|
}
|
package/Rule/Charge.ts
CHANGED
|
@@ -45,7 +45,7 @@ export namespace Charge {
|
|
|
45
45
|
...rule.charge,
|
|
46
46
|
fixed:
|
|
47
47
|
typeof rule.charge.fixed == "number"
|
|
48
|
-
? [Realm.is(currency) ? Realm.currency[currency] : currency, rule.charge.fixed]
|
|
48
|
+
? [Realm.type.is(currency) ? Realm.currency[currency] : currency, rule.charge.fixed]
|
|
49
49
|
: rule.charge.fixed,
|
|
50
50
|
},
|
|
51
51
|
}
|
package/Rule/Reserve.ts
CHANGED
|
@@ -52,7 +52,7 @@ export namespace Reserve {
|
|
|
52
52
|
...rule.reserve,
|
|
53
53
|
fixed:
|
|
54
54
|
typeof rule.reserve.fixed == "number"
|
|
55
|
-
? [Realm.is(currency) ? Realm.currency[currency] : currency, rule.reserve.fixed]
|
|
55
|
+
? [Realm.type.is(currency) ? Realm.currency[currency] : currency, rule.reserve.fixed]
|
|
56
56
|
: rule.reserve.fixed,
|
|
57
57
|
},
|
|
58
58
|
}
|
package/Rule/State/Card.ts
CHANGED
|
@@ -61,6 +61,4 @@ export namespace Card {
|
|
|
61
61
|
used: isly.object<Card["used"]>({ amount: isly.number(), count: isly.number(), merchants: isly.string().array() }),
|
|
62
62
|
reject: isly.object<Card["reject"]>({ count: isly.number() }),
|
|
63
63
|
})
|
|
64
|
-
export const is = type.is
|
|
65
|
-
export const flaw = type.flaw
|
|
66
64
|
}
|
package/Rule/State/Partial.ts
CHANGED
package/Settlement/Batch.ts
CHANGED
package/Settlement/Creatable.ts
CHANGED
|
@@ -27,13 +27,9 @@ export namespace Cancel {
|
|
|
27
27
|
amount: Amount.type.optional(),
|
|
28
28
|
batch: Batch.type,
|
|
29
29
|
})
|
|
30
|
-
export const is = type.is
|
|
31
|
-
export const flaw = type.flaw
|
|
32
30
|
}
|
|
33
31
|
export const type = Creatable.type.extend<Cancel>({
|
|
34
32
|
status: isly.string(["succeeded", "failed"]),
|
|
35
33
|
reason: isly.string().optional(),
|
|
36
34
|
})
|
|
37
|
-
export const is = type.is
|
|
38
|
-
export const flaw = type.flaw
|
|
39
35
|
}
|
|
@@ -11,10 +11,7 @@ export interface Capture extends Capture.Creatable {
|
|
|
11
11
|
|
|
12
12
|
export namespace Capture {
|
|
13
13
|
export function from(creatable: Creatable): Capture {
|
|
14
|
-
return {
|
|
15
|
-
status: "succeeded",
|
|
16
|
-
...creatable,
|
|
17
|
-
}
|
|
14
|
+
return { status: "succeeded", ...creatable }
|
|
18
15
|
}
|
|
19
16
|
export interface Creatable {
|
|
20
17
|
type: "capture"
|
|
@@ -33,13 +30,9 @@ export namespace Capture {
|
|
|
33
30
|
amount: Amount.type,
|
|
34
31
|
batch: Batch.type,
|
|
35
32
|
})
|
|
36
|
-
export const is = type.is
|
|
37
|
-
export const flaw = type.flaw
|
|
38
33
|
}
|
|
39
34
|
export const type = Creatable.type.extend<Capture>({
|
|
40
35
|
status: isly.string(["succeeded", "failed"]),
|
|
41
36
|
reason: isly.string().optional(),
|
|
42
37
|
})
|
|
43
|
-
export const is = type.is
|
|
44
|
-
export const flaw = type.flaw
|
|
45
38
|
}
|
|
@@ -17,6 +17,7 @@ export namespace Refund {
|
|
|
17
17
|
export interface Creatable {
|
|
18
18
|
type: "refund"
|
|
19
19
|
card: string
|
|
20
|
+
account?: string // Only defined when using the new card id + account id card references
|
|
20
21
|
authorization: Pick<Authorization, "approvalCode">
|
|
21
22
|
merchant: Merchant
|
|
22
23
|
acquirer: Acquirer
|
|
@@ -32,6 +33,7 @@ export namespace Refund {
|
|
|
32
33
|
export const type = isly.object<Creatable>({
|
|
33
34
|
type: isly.string("refund"),
|
|
34
35
|
card: isly.string(),
|
|
36
|
+
account: isly.string().optional(),
|
|
35
37
|
authorization: isly.object({ approvalCode: isly.string() }),
|
|
36
38
|
merchant: Merchant.type,
|
|
37
39
|
acquirer: Acquirer.type,
|
|
@@ -40,14 +42,10 @@ export namespace Refund {
|
|
|
40
42
|
amount: Amount.type,
|
|
41
43
|
batch: Batch.type,
|
|
42
44
|
})
|
|
43
|
-
export const is = type.is
|
|
44
|
-
export const flaw = type.flaw
|
|
45
45
|
}
|
|
46
46
|
export const type = Creatable.type.extend<Refund>({
|
|
47
47
|
status: isly.string(["succeeded", "failed"]),
|
|
48
48
|
reason: isly.string().optional(),
|
|
49
49
|
transaction: Transaction.type.optional(),
|
|
50
50
|
})
|
|
51
|
-
export const is = type.is
|
|
52
|
-
export const flaw = type.flaw
|
|
53
51
|
}
|
|
@@ -21,8 +21,6 @@ export namespace Unknown {
|
|
|
21
21
|
data: isly.record(isly.string(), isly.any()),
|
|
22
22
|
batch: Batch.type,
|
|
23
23
|
})
|
|
24
|
-
export const is = Unknown.is
|
|
25
|
-
export const flaw = Unknown.flaw
|
|
26
24
|
}
|
|
27
25
|
export function from(creatable: Creatable): Unknown {
|
|
28
26
|
return { ...creatable, status: "failed" }
|
|
@@ -31,6 +29,4 @@ export namespace Unknown {
|
|
|
31
29
|
status: isly.string(["succeeded", "failed"]),
|
|
32
30
|
reason: isly.string().optional(),
|
|
33
31
|
})
|
|
34
|
-
export const is = type.is
|
|
35
|
-
export const flaw = type.flaw
|
|
36
32
|
}
|
|
@@ -38,7 +38,7 @@ export namespace Entry {
|
|
|
38
38
|
export const Creatable = EntryCreatable
|
|
39
39
|
export function from(creatable: Entry.Creatable, transaction: Transaction | gracely.Error | string): Entry {
|
|
40
40
|
let result: Entry
|
|
41
|
-
if (!Transaction.is(transaction) || transaction.status != "finalized")
|
|
41
|
+
if (!Transaction.type.is(transaction) || transaction.status != "finalized")
|
|
42
42
|
result = {
|
|
43
43
|
status: "failed",
|
|
44
44
|
reason: reason(creatable, transaction),
|
|
@@ -77,6 +77,4 @@ export namespace Entry {
|
|
|
77
77
|
Entry.Refund.type,
|
|
78
78
|
Entry.Unknown.type
|
|
79
79
|
)
|
|
80
|
-
export const is = type.is
|
|
81
|
-
export const flaw = type.flaw
|
|
82
80
|
}
|
package/Settlement/Fee.ts
CHANGED
package/Settlement/Status.ts
CHANGED
package/Settlement/index.ts
CHANGED
|
@@ -68,7 +68,7 @@ export namespace Settlement {
|
|
|
68
68
|
export type MaybeOld = Settlement | OldSettlement
|
|
69
69
|
export function fromLegacy(settlement: MaybeOld): Settlement {
|
|
70
70
|
let result: Settlement
|
|
71
|
-
if (!is(settlement)) {
|
|
71
|
+
if (!type.is(settlement)) {
|
|
72
72
|
const totalToAmount: (currency: isoly.Currency, total?: OldTotal) => Amount = (currency, oldTotal) => ({
|
|
73
73
|
net: oldTotal?.amount[currency] ?? 0,
|
|
74
74
|
fee: { other: oldTotal?.fee.other[currency] ?? 0 },
|
|
@@ -106,6 +106,4 @@ export namespace Settlement {
|
|
|
106
106
|
entries: Settlement.Entry.Summary.type,
|
|
107
107
|
warnings: Settlement.Warning.type.array().optional(),
|
|
108
108
|
})
|
|
109
|
-
export const is = type.is
|
|
110
|
-
export const flaw = type.flaw
|
|
111
109
|
}
|