@pax2pay/model-banking 0.1.137 → 0.1.139
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/Authorization/index.ts +2 -8
- package/Client/Organizations/Rules.ts +3 -3
- package/Organization/Creatable.ts +2 -2
- package/Organization/index.ts +0 -8
- package/Rail/Card.ts +12 -2
- package/Rail/index.ts +9 -5
- package/Realm.ts +8 -0
- package/Rule/State/Account.ts +11 -4
- package/Rule/State/Transaction.ts +2 -2
- package/Rule/State/index.ts +5 -4
- package/Transaction/Note.ts +3 -3
- package/Transaction/index.ts +4 -0
- package/dist/Authorization/index.d.ts +1 -1
- package/dist/Authorization/index.js +2 -8
- package/dist/Authorization/index.js.map +1 -1
- package/dist/Client/Organizations/Rules.d.ts +2 -2
- package/dist/Client/Organizations/Rules.js.map +1 -1
- package/dist/Organization/Creatable.d.ts +1 -1
- package/dist/Organization/Creatable.js +2 -2
- package/dist/Organization/Creatable.js.map +1 -1
- package/dist/Organization/index.d.ts +0 -6
- package/dist/Organization/index.js +0 -2
- package/dist/Organization/index.js.map +1 -1
- package/dist/Rail/Card.d.ts +9 -0
- package/dist/Rail/Card.js +9 -2
- package/dist/Rail/Card.js.map +1 -1
- package/dist/Rail/index.d.ts +1 -1
- package/dist/Rail/index.js +8 -3
- package/dist/Rail/index.js.map +1 -1
- package/dist/Realm.d.ts +2 -0
- package/dist/Realm.js +7 -0
- package/dist/Realm.js.map +1 -1
- package/dist/Rule/State/Account.d.ts +28 -2
- package/dist/Rule/State/Account.js +2 -2
- package/dist/Rule/State/Account.js.map +1 -1
- package/dist/Rule/State/Transaction.d.ts +2 -2
- package/dist/Rule/State/Transaction.js.map +1 -1
- package/dist/Rule/State/index.d.ts +2 -2
- package/dist/Rule/State/index.js +3 -3
- package/dist/Rule/State/index.js.map +1 -1
- package/dist/Transaction/Note.d.ts +1 -0
- package/dist/Transaction/Note.js +2 -3
- package/dist/Transaction/Note.js.map +1 -1
- package/dist/Transaction/index.d.ts +1 -0
- package/dist/Transaction/index.js +3 -0
- package/dist/Transaction/index.js.map +1 -1
- package/package.json +1 -1
- package/Organization/Rule.ts +0 -43
- package/dist/Organization/Rule.d.ts +0 -26
- package/dist/Organization/Rule.js +0 -28
- package/dist/Organization/Rule.js.map +0 -1
package/Authorization/index.ts
CHANGED
|
@@ -103,21 +103,15 @@ export namespace Authorization {
|
|
|
103
103
|
return result
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
export function toTransaction(authorization: Authorization
|
|
106
|
+
export function toTransaction(authorization: Authorization): Transaction.Creatable {
|
|
107
107
|
return {
|
|
108
108
|
amount: authorization.amount[1],
|
|
109
109
|
currency: authorization.amount[0],
|
|
110
110
|
description: authorization.description,
|
|
111
111
|
counterpart: {
|
|
112
112
|
type: "card",
|
|
113
|
-
scheme: "mastercard",
|
|
114
|
-
iin: card.details.iin,
|
|
115
|
-
expiry: card.details.expiry,
|
|
116
|
-
last4: card.details.last4,
|
|
117
|
-
holder: card.details.holder,
|
|
118
|
-
id: card.id,
|
|
119
|
-
merchant: authorization.merchant,
|
|
120
113
|
acquirer: authorization.acquirer,
|
|
114
|
+
merchant: authorization.merchant,
|
|
121
115
|
},
|
|
122
116
|
}
|
|
123
117
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { gracely } from "gracely"
|
|
2
2
|
import { http } from "cloudly-http"
|
|
3
3
|
import * as rest from "cloudly-rest"
|
|
4
|
-
import {
|
|
4
|
+
import { Rule } from "../../Rule"
|
|
5
5
|
|
|
6
6
|
export class Rules extends rest.Collection<gracely.Error> {
|
|
7
7
|
constructor(client: http.Client) {
|
|
8
8
|
super(client)
|
|
9
9
|
}
|
|
10
|
-
async replace(organization: string, rules:
|
|
11
|
-
return this.client.put<
|
|
10
|
+
async replace(organization: string, rules: Rule[]): Promise<Rule[] | gracely.Error> {
|
|
11
|
+
return this.client.put<Rule[]>(`/organization/rule`, rules, {
|
|
12
12
|
organization: organization,
|
|
13
13
|
})
|
|
14
14
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
2
|
import { Realm } from "../Realm"
|
|
3
|
+
import { Rule } from "../Rule"
|
|
3
4
|
import { Contact } from "./Contact"
|
|
4
|
-
import { Rule } from "./Rule"
|
|
5
5
|
|
|
6
6
|
export interface Creatable {
|
|
7
7
|
name: string
|
|
@@ -14,7 +14,7 @@ export namespace Creatable {
|
|
|
14
14
|
export const type = isly.object<Creatable>({
|
|
15
15
|
name: isly.string(),
|
|
16
16
|
realm: Realm.type,
|
|
17
|
-
rules:
|
|
17
|
+
rules: Rule.type.array(),
|
|
18
18
|
contact: Contact.type.optional(),
|
|
19
19
|
})
|
|
20
20
|
export const is = type.is
|
package/Organization/index.ts
CHANGED
|
@@ -2,12 +2,10 @@ import * as cryptly from "cryptly"
|
|
|
2
2
|
import { Changeable as OrganizationChangeable } from "./Changeable"
|
|
3
3
|
import { Contact as OrganizationContact } from "./Contact"
|
|
4
4
|
import { Creatable as OrganizationCreatable } from "./Creatable"
|
|
5
|
-
import { Rule as OrganizationRule } from "./Rule"
|
|
6
5
|
|
|
7
6
|
export interface Organization extends OrganizationCreatable {
|
|
8
7
|
readonly id: cryptly.Identifier
|
|
9
8
|
}
|
|
10
|
-
|
|
11
9
|
export namespace Organization {
|
|
12
10
|
export function is(value: Organization | any): value is Organization {
|
|
13
11
|
return value && OrganizationCreatable.is({ ...value }) && typeof value.id == "string"
|
|
@@ -18,7 +16,6 @@ export namespace Organization {
|
|
|
18
16
|
export function isIdentifier(value: cryptly.Identifier | any): value is cryptly.Identifier {
|
|
19
17
|
return cryptly.Identifier.is(value, 8)
|
|
20
18
|
}
|
|
21
|
-
|
|
22
19
|
export type Creatable = OrganizationCreatable
|
|
23
20
|
export const Creatable = OrganizationCreatable
|
|
24
21
|
export type Changeable = OrganizationChangeable
|
|
@@ -29,9 +26,4 @@ export namespace Organization {
|
|
|
29
26
|
export type Address = OrganizationContact.Address
|
|
30
27
|
export type Addresses = OrganizationContact.Addresses
|
|
31
28
|
}
|
|
32
|
-
export type Rule = OrganizationRule
|
|
33
|
-
export const Rule = OrganizationRule
|
|
34
|
-
export namespace Rule {
|
|
35
|
-
export type Result = OrganizationRule.Result
|
|
36
|
-
}
|
|
37
29
|
}
|
package/Rail/Card.ts
CHANGED
|
@@ -11,9 +11,19 @@ export interface Card {
|
|
|
11
11
|
last4: string
|
|
12
12
|
expiry: ModelCard.Expiry
|
|
13
13
|
holder: string
|
|
14
|
+
}
|
|
15
|
+
interface CardCounterpart {
|
|
16
|
+
type: "card"
|
|
14
17
|
merchant: Merchant
|
|
15
18
|
acquirer: Acquirer
|
|
16
19
|
}
|
|
20
|
+
namespace CardCounterpart {
|
|
21
|
+
export const type = isly.object<CardCounterpart>({
|
|
22
|
+
type: isly.string("card"),
|
|
23
|
+
acquirer: Acquirer.type,
|
|
24
|
+
merchant: Merchant.type,
|
|
25
|
+
})
|
|
26
|
+
}
|
|
17
27
|
export namespace Card {
|
|
18
28
|
export const currencies = ["EUR", "GBP", "SEK", "USD"] as const
|
|
19
29
|
export const type = isly.object<Card>({
|
|
@@ -24,9 +34,9 @@ export namespace Card {
|
|
|
24
34
|
last4: isly.string(),
|
|
25
35
|
expiry: ModelCard.Expiry.type,
|
|
26
36
|
holder: isly.string(),
|
|
27
|
-
merchant: Merchant.type,
|
|
28
|
-
acquirer: Acquirer.type,
|
|
29
37
|
})
|
|
30
38
|
export const is = type.is
|
|
31
39
|
export const flaw = type.flaw
|
|
40
|
+
export const Counterpart = CardCounterpart
|
|
41
|
+
export type Counterpart = CardCounterpart
|
|
32
42
|
}
|
package/Rail/index.ts
CHANGED
|
@@ -5,8 +5,7 @@ import { Internal as RailInternal } from "./internal"
|
|
|
5
5
|
import { PaxGiro as RailPaxGiro } from "./PaxGiro"
|
|
6
6
|
import { Scan as RailScan } from "./Scan"
|
|
7
7
|
|
|
8
|
-
export type Rail = RailPaxGiro | RailInternal | RailIban | RailScan | RailCard
|
|
9
|
-
|
|
8
|
+
export type Rail = RailPaxGiro | RailInternal | RailIban | RailScan | RailCard | RailCard.Counterpart
|
|
10
9
|
export namespace Rail {
|
|
11
10
|
export const rails = ["paxgiro", "internal", "iban", "scan", "card"]
|
|
12
11
|
export type Type = typeof rails[number]
|
|
@@ -40,7 +39,7 @@ export namespace Rail {
|
|
|
40
39
|
result = `scan-${rail.sort}-${rail.account}`
|
|
41
40
|
break
|
|
42
41
|
case "card":
|
|
43
|
-
result = `${rail.type}-${rail.id}`
|
|
42
|
+
result = "id" in rail ? `${rail.type}-${rail.id}` : `${rail.type}-merchant-${rail.merchant.id}`
|
|
44
43
|
break
|
|
45
44
|
}
|
|
46
45
|
return result
|
|
@@ -61,7 +60,7 @@ export namespace Rail {
|
|
|
61
60
|
result = `${rail.sort} ${rail.account}`
|
|
62
61
|
break
|
|
63
62
|
case "card":
|
|
64
|
-
result = `${rail.type}-${rail.id}`
|
|
63
|
+
result = "id" in rail ? `${rail.type}-${rail.id}` : `${rail.type}-merchant-${rail.merchant.id}`
|
|
65
64
|
break
|
|
66
65
|
}
|
|
67
66
|
return result
|
|
@@ -70,7 +69,12 @@ export namespace Rail {
|
|
|
70
69
|
return (
|
|
71
70
|
value &&
|
|
72
71
|
typeof value == "object" &&
|
|
73
|
-
(PaxGiro.is(value) ||
|
|
72
|
+
(PaxGiro.is(value) ||
|
|
73
|
+
Iban.is(value) ||
|
|
74
|
+
Internal.is(value) ||
|
|
75
|
+
Scan.is(value) ||
|
|
76
|
+
Card.is(value) ||
|
|
77
|
+
Card.Counterpart.type.is(value))
|
|
74
78
|
)
|
|
75
79
|
}
|
|
76
80
|
export type PaxGiro = RailPaxGiro
|
package/Realm.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isoly } from "isoly"
|
|
1
2
|
import { isly } from "isly"
|
|
2
3
|
import { Supplier as modelSupplier } from "./Supplier"
|
|
3
4
|
|
|
@@ -11,6 +12,13 @@ export namespace Realm {
|
|
|
11
12
|
export function toString(): string {
|
|
12
13
|
return realms.toString().replaceAll(",", ", ") + "."
|
|
13
14
|
}
|
|
15
|
+
export const currency: Record<Realm, isoly.Currency> = {
|
|
16
|
+
test: "EUR",
|
|
17
|
+
upcheck: "EUR",
|
|
18
|
+
testUK: "GBP",
|
|
19
|
+
uk: "GBP",
|
|
20
|
+
eu: "EUR",
|
|
21
|
+
}
|
|
14
22
|
export const suppliers: Record<Realm, modelSupplier[]> = {
|
|
15
23
|
test: ["paxgiro"],
|
|
16
24
|
testUK: ["clearbank"],
|
package/Rule/State/Account.ts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import type { Account as ModelAccount } from "../../Account"
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
|
|
3
|
+
export interface Account extends ModelAccount {
|
|
4
|
+
transactions: Account.Transactions
|
|
5
|
+
}
|
|
5
6
|
export namespace Account {
|
|
6
|
-
export
|
|
7
|
-
|
|
7
|
+
export interface Transactions {
|
|
8
|
+
today: { count: number; amount: number }
|
|
9
|
+
incoming: { today: { count: number; amount: number } }
|
|
10
|
+
outgoing: { today: { count: number; amount: number } }
|
|
11
|
+
card: { today: { count: number; amount: number } }
|
|
12
|
+
}
|
|
13
|
+
export function from(account: ModelAccount, transactions: Transactions): Account {
|
|
14
|
+
return { ...account, transactions }
|
|
8
15
|
}
|
|
9
16
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Transaction as ModelTransaction } from "../../Transaction"
|
|
2
2
|
|
|
3
|
-
export type Transaction = ModelTransaction
|
|
3
|
+
export type Transaction = ModelTransaction.Creatable
|
|
4
4
|
|
|
5
5
|
export namespace Transaction {
|
|
6
|
-
export function from(transaction: ModelTransaction): Transaction {
|
|
6
|
+
export function from(transaction: ModelTransaction.Creatable): Transaction {
|
|
7
7
|
return transaction
|
|
8
8
|
}
|
|
9
9
|
}
|
package/Rule/State/index.ts
CHANGED
|
@@ -10,23 +10,24 @@ import { Transaction as StateTransaction } from "./Transaction"
|
|
|
10
10
|
|
|
11
11
|
export interface State {
|
|
12
12
|
account: StateAccount
|
|
13
|
+
transaction: StateTransaction
|
|
13
14
|
authorization?: StateAuthorization
|
|
14
15
|
card?: StateCard
|
|
15
|
-
transaction: StateTransaction
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export namespace State {
|
|
19
19
|
export function from(
|
|
20
20
|
account: ModelAccount,
|
|
21
|
-
|
|
21
|
+
transactions: StateAccount.Transactions,
|
|
22
|
+
transaction: ModelTransaction.Creatable,
|
|
22
23
|
authorization?: ModelAuthorization.Creatable,
|
|
23
24
|
card?: ModelCard
|
|
24
25
|
): State {
|
|
25
26
|
return {
|
|
26
|
-
account: Account.from(account),
|
|
27
|
+
account: Account.from(account, transactions),
|
|
28
|
+
transaction: Transaction.from(transaction),
|
|
27
29
|
authorization: authorization && Authorization.from(authorization),
|
|
28
30
|
card: card && Card.from(card),
|
|
29
|
-
transaction: Transaction.from(transaction),
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
export type Partial = StatePartial
|
package/Transaction/Note.ts
CHANGED
|
@@ -13,19 +13,19 @@ export namespace Note {
|
|
|
13
13
|
export interface Creatable {
|
|
14
14
|
text?: string
|
|
15
15
|
action?: "approve" | "reject"
|
|
16
|
+
flags?: string[]
|
|
16
17
|
}
|
|
17
18
|
export namespace Creatable {
|
|
18
19
|
export const type = isly.object<Creatable>({
|
|
19
20
|
text: isly.string().optional(),
|
|
20
21
|
action: isly.string(["approve", "reject"]).optional(),
|
|
22
|
+
flags: isly.string().array().optional(),
|
|
21
23
|
})
|
|
22
24
|
export const is = type.is
|
|
23
25
|
}
|
|
24
|
-
export const type =
|
|
26
|
+
export const type = Creatable.type.extend<Note>({
|
|
25
27
|
author: isly.string(),
|
|
26
28
|
created: isly.string(),
|
|
27
|
-
text: isly.string().optional(),
|
|
28
|
-
action: isly.string(["approve", "reject"]).optional(),
|
|
29
29
|
})
|
|
30
30
|
export const is = type.is
|
|
31
31
|
}
|
package/Transaction/index.ts
CHANGED
|
@@ -20,6 +20,7 @@ export interface Transaction extends TransactionCreatable {
|
|
|
20
20
|
operations: Operation[]
|
|
21
21
|
status: "created" | "approved" | "rejected" | "processing" | "finalized"
|
|
22
22
|
flags: ("review" | string)[]
|
|
23
|
+
oldFlags: string[]
|
|
23
24
|
notes: TransactionNote[]
|
|
24
25
|
}
|
|
25
26
|
|
|
@@ -36,6 +37,7 @@ export namespace Transaction {
|
|
|
36
37
|
operations: isly.array(isly.fromIs("Operation", Operation.is)),
|
|
37
38
|
status: isly.string(["created", "approved", "rejected", "processing", "finalized"]),
|
|
38
39
|
flags: isly.array(isly.string() || "review"),
|
|
40
|
+
oldFlags: isly.string().array(),
|
|
39
41
|
notes: isly.array(isly.fromIs("TransactionNote", TransactionNote.is)),
|
|
40
42
|
})
|
|
41
43
|
export const is = type.is
|
|
@@ -65,6 +67,7 @@ export namespace Transaction {
|
|
|
65
67
|
operations: transaction.operations.map(o => Operation.fromCreatable(id, o)),
|
|
66
68
|
status: "created",
|
|
67
69
|
flags: [],
|
|
70
|
+
oldFlags: [],
|
|
68
71
|
notes: [],
|
|
69
72
|
}
|
|
70
73
|
}
|
|
@@ -89,6 +92,7 @@ export namespace Transaction {
|
|
|
89
92
|
operations: transaction.operations.map(o => Operation.fromCreatable(id, o)),
|
|
90
93
|
status: "created",
|
|
91
94
|
flags: [],
|
|
95
|
+
oldFlags: [],
|
|
92
96
|
notes: [],
|
|
93
97
|
}
|
|
94
98
|
}
|
|
@@ -38,5 +38,5 @@ export declare namespace Authorization {
|
|
|
38
38
|
const is: isly.Type.IsFunction<Authorization>;
|
|
39
39
|
const flaw: isly.Type.FlawFunction;
|
|
40
40
|
function fromCreatable(creatable: Creatable, card: Card | gracely.Error, transaction?: Transaction | gracely.Error): Authorization;
|
|
41
|
-
function toTransaction(authorization: Authorization
|
|
41
|
+
function toTransaction(authorization: Authorization): Transaction.Creatable;
|
|
42
42
|
}
|
|
@@ -72,21 +72,15 @@ export var Authorization;
|
|
|
72
72
|
return result;
|
|
73
73
|
}
|
|
74
74
|
Authorization.fromCreatable = fromCreatable;
|
|
75
|
-
function toTransaction(authorization
|
|
75
|
+
function toTransaction(authorization) {
|
|
76
76
|
return {
|
|
77
77
|
amount: authorization.amount[1],
|
|
78
78
|
currency: authorization.amount[0],
|
|
79
79
|
description: authorization.description,
|
|
80
80
|
counterpart: {
|
|
81
81
|
type: "card",
|
|
82
|
-
scheme: "mastercard",
|
|
83
|
-
iin: card.details.iin,
|
|
84
|
-
expiry: card.details.expiry,
|
|
85
|
-
last4: card.details.last4,
|
|
86
|
-
holder: card.details.holder,
|
|
87
|
-
id: card.id,
|
|
88
|
-
merchant: authorization.merchant,
|
|
89
82
|
acquirer: authorization.acquirer,
|
|
83
|
+
merchant: authorization.merchant,
|
|
90
84
|
},
|
|
91
85
|
};
|
|
92
86
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Authorization/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAGtC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,EAAE,SAAS,IAAI,sBAAsB,EAAE,MAAM,aAAa,CAAA;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAwBjC,MAAM,KAAW,aAAa,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Authorization/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SA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,EAAE,aAAa,CAAC,QAAQ;gBAChC,QAAQ,EAAE,aAAa,CAAC,QAAQ;aAChC;SACD,CAAA;IACF,CAAC;IAXe,2BAAa,gBAW5B,CAAA;AACF,CAAC,EAlFgB,aAAa,KAAb,aAAa,QAkF7B"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { gracely } from "gracely";
|
|
2
2
|
import { http } from "cloudly-http";
|
|
3
3
|
import * as rest from "cloudly-rest";
|
|
4
|
-
import {
|
|
4
|
+
import { Rule } from "../../Rule";
|
|
5
5
|
export declare class Rules extends rest.Collection<gracely.Error> {
|
|
6
6
|
constructor(client: http.Client);
|
|
7
|
-
replace(organization: string, rules:
|
|
7
|
+
replace(organization: string, rules: Rule[]): Promise<Rule[] | gracely.Error>;
|
|
8
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Rules.js","sourceRoot":"../","sources":["Client/Organizations/Rules.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAGpC,MAAM,OAAO,KAAM,SAAQ,IAAI,CAAC,UAAyB;IACxD,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;IACd,CAAC;IACD,KAAK,CAAC,OAAO,CAAC,YAAoB,EAAE,
|
|
1
|
+
{"version":3,"file":"Rules.js","sourceRoot":"../","sources":["Client/Organizations/Rules.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAGpC,MAAM,OAAO,KAAM,SAAQ,IAAI,CAAC,UAAyB;IACxD,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;IACd,CAAC;IACD,KAAK,CAAC,OAAO,CAAC,YAAoB,EAAE,KAAa;QAChD,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAS,oBAAoB,EAAE,KAAK,EAAE;YAC3D,YAAY,EAAE,YAAY;SAC1B,CAAC,CAAA;IACH,CAAC;CACD"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { isly } from "isly";
|
|
2
2
|
import { Realm } from "../Realm";
|
|
3
|
+
import { Rule } from "../Rule";
|
|
3
4
|
import { Contact } from "./Contact";
|
|
4
|
-
import { Rule } from "./Rule";
|
|
5
5
|
export var Creatable;
|
|
6
6
|
(function (Creatable) {
|
|
7
7
|
Creatable.type = isly.object({
|
|
8
8
|
name: isly.string(),
|
|
9
9
|
realm: Realm.type,
|
|
10
|
-
rules:
|
|
10
|
+
rules: Rule.type.array(),
|
|
11
11
|
contact: Contact.type.optional(),
|
|
12
12
|
});
|
|
13
13
|
Creatable.is = Creatable.type.is;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Organization/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Organization/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AASnC,MAAM,KAAW,SAAS,CASzB;AATD,WAAiB,SAAS;IACZ,cAAI,GAAG,IAAI,CAAC,MAAM,CAAY;QAC1C,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;QACnB,KAAK,EAAE,KAAK,CAAC,IAAI;QACjB,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;QACxB,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE;KAChC,CAAC,CAAA;IACW,YAAE,GAAG,UAAA,IAAI,CAAC,EAAE,CAAA;IACZ,cAAI,GAAG,UAAA,IAAI,CAAC,IAAI,CAAA;AAC9B,CAAC,EATgB,SAAS,KAAT,SAAS,QASzB"}
|
|
@@ -2,7 +2,6 @@ import * as cryptly from "cryptly";
|
|
|
2
2
|
import { Changeable as OrganizationChangeable } from "./Changeable";
|
|
3
3
|
import { Contact as OrganizationContact } from "./Contact";
|
|
4
4
|
import { Creatable as OrganizationCreatable } from "./Creatable";
|
|
5
|
-
import { Rule as OrganizationRule } from "./Rule";
|
|
6
5
|
export interface Organization extends OrganizationCreatable {
|
|
7
6
|
readonly id: cryptly.Identifier;
|
|
8
7
|
}
|
|
@@ -20,9 +19,4 @@ export declare namespace Organization {
|
|
|
20
19
|
type Address = OrganizationContact.Address;
|
|
21
20
|
type Addresses = OrganizationContact.Addresses;
|
|
22
21
|
}
|
|
23
|
-
type Rule = OrganizationRule;
|
|
24
|
-
const Rule: typeof OrganizationRule;
|
|
25
|
-
namespace Rule {
|
|
26
|
-
type Result = OrganizationRule.Result;
|
|
27
|
-
}
|
|
28
22
|
}
|
|
@@ -2,7 +2,6 @@ import * as cryptly from "cryptly";
|
|
|
2
2
|
import { Changeable as OrganizationChangeable } from "./Changeable";
|
|
3
3
|
import { Contact as OrganizationContact } from "./Contact";
|
|
4
4
|
import { Creatable as OrganizationCreatable } from "./Creatable";
|
|
5
|
-
import { Rule as OrganizationRule } from "./Rule";
|
|
6
5
|
export var Organization;
|
|
7
6
|
(function (Organization) {
|
|
8
7
|
function is(value) {
|
|
@@ -20,6 +19,5 @@ export var Organization;
|
|
|
20
19
|
Organization.Creatable = OrganizationCreatable;
|
|
21
20
|
Organization.Changeable = OrganizationChangeable;
|
|
22
21
|
Organization.Contact = OrganizationContact;
|
|
23
|
-
Organization.Rule = OrganizationRule;
|
|
24
22
|
})(Organization || (Organization = {}));
|
|
25
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Organization/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AAmB,CAAA;AAK3C,CAAC,EApBgB,YAAY,KAAZ,YAAY,QAoB5B"}
|
package/dist/Rail/Card.d.ts
CHANGED
|
@@ -10,12 +10,21 @@ export interface Card {
|
|
|
10
10
|
last4: string;
|
|
11
11
|
expiry: ModelCard.Expiry;
|
|
12
12
|
holder: string;
|
|
13
|
+
}
|
|
14
|
+
interface CardCounterpart {
|
|
15
|
+
type: "card";
|
|
13
16
|
merchant: Merchant;
|
|
14
17
|
acquirer: Acquirer;
|
|
15
18
|
}
|
|
19
|
+
declare namespace CardCounterpart {
|
|
20
|
+
const type: isly.object.ExtendableType<CardCounterpart>;
|
|
21
|
+
}
|
|
16
22
|
export declare namespace Card {
|
|
17
23
|
const currencies: readonly ["EUR", "GBP", "SEK", "USD"];
|
|
18
24
|
const type: isly.object.ExtendableType<Card>;
|
|
19
25
|
const is: isly.Type.IsFunction<Card>;
|
|
20
26
|
const flaw: isly.Type.FlawFunction;
|
|
27
|
+
const Counterpart: typeof CardCounterpart;
|
|
28
|
+
type Counterpart = CardCounterpart;
|
|
21
29
|
}
|
|
30
|
+
export {};
|
package/dist/Rail/Card.js
CHANGED
|
@@ -2,6 +2,14 @@ import { isly } from "isly";
|
|
|
2
2
|
import { Acquirer } from "../Acquirer";
|
|
3
3
|
import { Card as ModelCard } from "../Card";
|
|
4
4
|
import { Merchant } from "../Merchant";
|
|
5
|
+
var CardCounterpart;
|
|
6
|
+
(function (CardCounterpart) {
|
|
7
|
+
CardCounterpart.type = isly.object({
|
|
8
|
+
type: isly.string("card"),
|
|
9
|
+
acquirer: Acquirer.type,
|
|
10
|
+
merchant: Merchant.type,
|
|
11
|
+
});
|
|
12
|
+
})(CardCounterpart || (CardCounterpart = {}));
|
|
5
13
|
export var Card;
|
|
6
14
|
(function (Card) {
|
|
7
15
|
Card.currencies = ["EUR", "GBP", "SEK", "USD"];
|
|
@@ -13,10 +21,9 @@ export var Card;
|
|
|
13
21
|
last4: isly.string(),
|
|
14
22
|
expiry: ModelCard.Expiry.type,
|
|
15
23
|
holder: isly.string(),
|
|
16
|
-
merchant: Merchant.type,
|
|
17
|
-
acquirer: Acquirer.type,
|
|
18
24
|
});
|
|
19
25
|
Card.is = Card.type.is;
|
|
20
26
|
Card.flaw = Card.type.flaw;
|
|
27
|
+
Card.Counterpart = CardCounterpart;
|
|
21
28
|
})(Card || (Card = {}));
|
|
22
29
|
//# sourceMappingURL=Card.js.map
|
package/dist/Rail/Card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","sourceRoot":"../","sources":["Rail/Card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"Card.js","sourceRoot":"../","sources":["Rail/Card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAgBtC,IAAU,eAAe,CAMxB;AAND,WAAU,eAAe;IACX,oBAAI,GAAG,IAAI,CAAC,MAAM,CAAkB;QAChD,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;QACzB,QAAQ,EAAE,QAAQ,CAAC,IAAI;QACvB,QAAQ,EAAE,QAAQ,CAAC,IAAI;KACvB,CAAC,CAAA;AACH,CAAC,EANS,eAAe,KAAf,eAAe,QAMxB;AACD,MAAM,KAAW,IAAI,CAepB;AAfD,WAAiB,IAAI;IACP,eAAU,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAU,CAAA;IAClD,SAAI,GAAG,IAAI,CAAC,MAAM,CAAO;QACrC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;QACzB,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,IAAI;QAC7B,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE;QACjB,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE;QAClB,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE;QACpB,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,IAAI;QAC7B,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;KACrB,CAAC,CAAA;IACW,OAAE,GAAG,KAAA,IAAI,CAAC,EAAE,CAAA;IACZ,SAAI,GAAG,KAAA,IAAI,CAAC,IAAI,CAAA;IAChB,gBAAW,GAAG,eAAe,CAAA;AAE3C,CAAC,EAfgB,IAAI,KAAJ,IAAI,QAepB"}
|
package/dist/Rail/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { Iban as RailIban } from "./Iban";
|
|
|
4
4
|
import { Internal as RailInternal } from "./internal";
|
|
5
5
|
import { PaxGiro as RailPaxGiro } from "./PaxGiro";
|
|
6
6
|
import { Scan as RailScan } from "./Scan";
|
|
7
|
-
export type Rail = RailPaxGiro | RailInternal | RailIban | RailScan | RailCard;
|
|
7
|
+
export type Rail = RailPaxGiro | RailInternal | RailIban | RailScan | RailCard | RailCard.Counterpart;
|
|
8
8
|
export declare namespace Rail {
|
|
9
9
|
const rails: string[];
|
|
10
10
|
type Type = typeof rails[number];
|
package/dist/Rail/index.js
CHANGED
|
@@ -39,7 +39,7 @@ export var Rail;
|
|
|
39
39
|
result = `scan-${rail.sort}-${rail.account}`;
|
|
40
40
|
break;
|
|
41
41
|
case "card":
|
|
42
|
-
result = `${rail.type}-${rail.id}`;
|
|
42
|
+
result = "id" in rail ? `${rail.type}-${rail.id}` : `${rail.type}-merchant-${rail.merchant.id}`;
|
|
43
43
|
break;
|
|
44
44
|
}
|
|
45
45
|
return result;
|
|
@@ -61,7 +61,7 @@ export var Rail;
|
|
|
61
61
|
result = `${rail.sort} ${rail.account}`;
|
|
62
62
|
break;
|
|
63
63
|
case "card":
|
|
64
|
-
result = `${rail.type}-${rail.id}`;
|
|
64
|
+
result = "id" in rail ? `${rail.type}-${rail.id}` : `${rail.type}-merchant-${rail.merchant.id}`;
|
|
65
65
|
break;
|
|
66
66
|
}
|
|
67
67
|
return result;
|
|
@@ -70,7 +70,12 @@ export var Rail;
|
|
|
70
70
|
function is(value) {
|
|
71
71
|
return (value &&
|
|
72
72
|
typeof value == "object" &&
|
|
73
|
-
(Rail.PaxGiro.is(value) ||
|
|
73
|
+
(Rail.PaxGiro.is(value) ||
|
|
74
|
+
Rail.Iban.is(value) ||
|
|
75
|
+
Rail.Internal.is(value) ||
|
|
76
|
+
Rail.Scan.is(value) ||
|
|
77
|
+
Rail.Card.is(value) ||
|
|
78
|
+
Rail.Card.Counterpart.type.is(value)));
|
|
74
79
|
}
|
|
75
80
|
Rail.is = is;
|
|
76
81
|
Rail.PaxGiro = RailPaxGiro;
|
package/dist/Rail/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Rail/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,QAAQ,CAAA;AACzC,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,QAAQ,CAAA;AACzC,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAA;AAClD,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["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IAAI,IAAI,CAAC,OAAO,EAAE,CAAA;gBACvC,MAAK;YACN,KAAK,MAAM;gBACV,MAAM,GAAG,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,aAAa,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAA;gBAC/F,MAAK;SACN;QACD,OAAO,MAAM,CAAA;IACd,CAAC;IApBe,aAAQ,WAoBvB,CAAA;IACD,SAAgB,EAAE,CAAC,KAAiB;QACnC,OAAO,CACN,KAAK;YACL,OAAO,KAAK,IAAI,QAAQ;YACxB,CAAC,KAAA,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC;gBACjB,KAAA,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC;gBACd,KAAA,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC;gBAClB,KAAA,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC;gBACd,KAAA,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC;gBACd,KAAA,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CACjC,CAAA;IACF,CAAC;IAXe,OAAE,KAWjB,CAAA;IAEY,YAAO,GAAG,WAAW,CAAA;IAErB,SAAI,GAAG,QAAQ,CAAA;IAEf,SAAI,GAAG,QAAQ,CAAA;IAEf,aAAQ,GAAG,YAAY,CAAA;IAEvB,SAAI,GAAG,QAAQ,CAAA;AAC7B,CAAC,EAjFgB,IAAI,KAAJ,IAAI,QAiFpB"}
|
package/dist/Realm.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isoly } from "isoly";
|
|
1
2
|
import { isly } from "isly";
|
|
2
3
|
import { Supplier as modelSupplier } from "./Supplier";
|
|
3
4
|
export type Realm = typeof Realm.realms[number];
|
|
@@ -7,6 +8,7 @@ export declare namespace Realm {
|
|
|
7
8
|
const is: isly.Type.IsFunction<"eu" | "uk" | "test" | "testUK" | "upcheck">;
|
|
8
9
|
const flaw: isly.Type.FlawFunction;
|
|
9
10
|
function toString(): string;
|
|
11
|
+
const currency: Record<Realm, isoly.Currency>;
|
|
10
12
|
const suppliers: Record<Realm, modelSupplier[]>;
|
|
11
13
|
interface Suppliers extends Record<Realm, modelSupplier[]> {
|
|
12
14
|
test: ["paxgiro"];
|
package/dist/Realm.js
CHANGED
|
@@ -9,6 +9,13 @@ export var Realm;
|
|
|
9
9
|
return Realm.realms.toString().replaceAll(",", ", ") + ".";
|
|
10
10
|
}
|
|
11
11
|
Realm.toString = toString;
|
|
12
|
+
Realm.currency = {
|
|
13
|
+
test: "EUR",
|
|
14
|
+
upcheck: "EUR",
|
|
15
|
+
testUK: "GBP",
|
|
16
|
+
uk: "GBP",
|
|
17
|
+
eu: "EUR",
|
|
18
|
+
};
|
|
12
19
|
Realm.suppliers = {
|
|
13
20
|
test: ["paxgiro"],
|
|
14
21
|
testUK: ["clearbank"],
|
package/dist/Realm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Realm.js","sourceRoot":"../","sources":["Realm.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Realm.js","sourceRoot":"../","sources":["Realm.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAK3B,MAAM,KAAW,KAAK,CAmCrB;AAnCD,WAAiB,KAAK;IACR,YAAM,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,CAAU,CAAA;IAC3D,UAAI,GAAqB,IAAI,CAAC,MAAM,CAAC,MAAA,MAAM,CAAC,CAAA;IAC5C,QAAE,GAAG,MAAA,IAAI,CAAC,EAAE,CAAA;IACZ,UAAI,GAAG,MAAA,IAAI,CAAC,IAAI,CAAA;IAC7B,SAAgB,QAAQ;QACvB,OAAO,MAAA,MAAM,CAAC,QAAQ,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,GAAG,CAAA;IACrD,CAAC;IAFe,cAAQ,WAEvB,CAAA;IACY,cAAQ,GAAkC;QACtD,IAAI,EAAE,KAAK;QACX,OAAO,EAAE,KAAK;QACd,MAAM,EAAE,KAAK;QACb,EAAE,EAAE,KAAK;QACT,EAAE,EAAE,KAAK;KACT,CAAA;IACY,eAAS,GAAmC;QACxD,IAAI,EAAE,CAAC,SAAS,CAAC;QACjB,MAAM,EAAE,CAAC,WAAW,CAAC;QACrB,EAAE,EAAE,CAAC,WAAW,CAAC;QACjB,EAAE,EAAE,EAAE;QACN,OAAO,EAAE,CAAC,SAAS,CAAC;KACpB,CAAA;IASD,IAAiB,QAAQ,CAIxB;IAJD,WAAiB,QAAQ;QACxB,SAAgB,EAAE,CAAC,KAAY,EAAE,QAA6B;YAC7D,OAAO,MAAA,SAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;QAC3C,CAAC;QAFe,WAAE,KAEjB,CAAA;IACF,CAAC,EAJgB,QAAQ,GAAR,cAAQ,KAAR,cAAQ,QAIxB;AACF,CAAC,EAnCgB,KAAK,KAAL,KAAK,QAmCrB"}
|
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
import type { Account as ModelAccount } from "../../Account";
|
|
2
|
-
export
|
|
2
|
+
export interface Account extends ModelAccount {
|
|
3
|
+
transactions: Account.Transactions;
|
|
4
|
+
}
|
|
3
5
|
export declare namespace Account {
|
|
4
|
-
|
|
6
|
+
interface Transactions {
|
|
7
|
+
today: {
|
|
8
|
+
count: number;
|
|
9
|
+
amount: number;
|
|
10
|
+
};
|
|
11
|
+
incoming: {
|
|
12
|
+
today: {
|
|
13
|
+
count: number;
|
|
14
|
+
amount: number;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
outgoing: {
|
|
18
|
+
today: {
|
|
19
|
+
count: number;
|
|
20
|
+
amount: number;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
card: {
|
|
24
|
+
today: {
|
|
25
|
+
count: number;
|
|
26
|
+
amount: number;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function from(account: ModelAccount, transactions: Transactions): Account;
|
|
5
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Account.js","sourceRoot":"../","sources":["Rule/State/Account.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Account.js","sourceRoot":"../","sources":["Rule/State/Account.ts"],"names":[],"mappings":"AAKA,MAAM,KAAW,OAAO,CAUvB;AAVD,WAAiB,OAAO;IAOvB,SAAgB,IAAI,CAAC,OAAqB,EAAE,YAA0B;QACrE,OAAO,EAAE,GAAG,OAAO,EAAE,YAAY,EAAE,CAAA;IACpC,CAAC;IAFe,YAAI,OAEnB,CAAA;AACF,CAAC,EAVgB,OAAO,KAAP,OAAO,QAUvB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Transaction as ModelTransaction } from "../../Transaction";
|
|
2
|
-
export type Transaction = ModelTransaction;
|
|
2
|
+
export type Transaction = ModelTransaction.Creatable;
|
|
3
3
|
export declare namespace Transaction {
|
|
4
|
-
function from(transaction: ModelTransaction): Transaction;
|
|
4
|
+
function from(transaction: ModelTransaction.Creatable): Transaction;
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transaction.js","sourceRoot":"../","sources":["Rule/State/Transaction.ts"],"names":[],"mappings":"AAIA,MAAM,KAAW,WAAW,CAI3B;AAJD,WAAiB,WAAW;IAC3B,SAAgB,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"Transaction.js","sourceRoot":"../","sources":["Rule/State/Transaction.ts"],"names":[],"mappings":"AAIA,MAAM,KAAW,WAAW,CAI3B;AAJD,WAAiB,WAAW;IAC3B,SAAgB,IAAI,CAAC,WAAuC;QAC3D,OAAO,WAAW,CAAA;IACnB,CAAC;IAFe,gBAAI,OAEnB,CAAA;AACF,CAAC,EAJgB,WAAW,KAAX,WAAW,QAI3B"}
|
|
@@ -9,12 +9,12 @@ import { Partial as StatePartial } from "./Partial";
|
|
|
9
9
|
import { Transaction as StateTransaction } from "./Transaction";
|
|
10
10
|
export interface State {
|
|
11
11
|
account: StateAccount;
|
|
12
|
+
transaction: StateTransaction;
|
|
12
13
|
authorization?: StateAuthorization;
|
|
13
14
|
card?: StateCard;
|
|
14
|
-
transaction: StateTransaction;
|
|
15
15
|
}
|
|
16
16
|
export declare namespace State {
|
|
17
|
-
function from(account: ModelAccount, transaction: ModelTransaction, authorization?: ModelAuthorization.Creatable, card?: ModelCard): State;
|
|
17
|
+
function from(account: ModelAccount, transactions: StateAccount.Transactions, transaction: ModelTransaction.Creatable, authorization?: ModelAuthorization.Creatable, card?: ModelCard): State;
|
|
18
18
|
type Partial = StatePartial;
|
|
19
19
|
const Partial: typeof StatePartial;
|
|
20
20
|
type Account = StateAccount;
|
package/dist/Rule/State/index.js
CHANGED
|
@@ -5,12 +5,12 @@ import { Partial as StatePartial } from "./Partial";
|
|
|
5
5
|
import { Transaction as StateTransaction } from "./Transaction";
|
|
6
6
|
export var State;
|
|
7
7
|
(function (State) {
|
|
8
|
-
function from(account, transaction, authorization, card) {
|
|
8
|
+
function from(account, transactions, transaction, authorization, card) {
|
|
9
9
|
return {
|
|
10
|
-
account: State.Account.from(account),
|
|
10
|
+
account: State.Account.from(account, transactions),
|
|
11
|
+
transaction: State.Transaction.from(transaction),
|
|
11
12
|
authorization: authorization && State.Authorization.from(authorization),
|
|
12
13
|
card: card && State.Card.from(card),
|
|
13
|
-
transaction: State.Transaction.from(transaction),
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
State.from = from;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Rule/State/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO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,CAAA;IAEtB,mBAAa,GAAG,kBAAkB,CAAA;IAElC,UAAI,GAAG,SAAS,CAAA;IAEhB,iBAAW,GAAG,gBAAgB,CAAA;AAC5C,CAAC,EAzBgB,KAAK,KAAL,KAAK,QAyBrB"}
|
package/dist/Transaction/Note.js
CHANGED
|
@@ -11,14 +11,13 @@ export var Note;
|
|
|
11
11
|
Creatable.type = isly.object({
|
|
12
12
|
text: isly.string().optional(),
|
|
13
13
|
action: isly.string(["approve", "reject"]).optional(),
|
|
14
|
+
flags: isly.string().array().optional(),
|
|
14
15
|
});
|
|
15
16
|
Creatable.is = Creatable.type.is;
|
|
16
17
|
})(Creatable = Note.Creatable || (Note.Creatable = {}));
|
|
17
|
-
Note.type =
|
|
18
|
+
Note.type = Creatable.type.extend({
|
|
18
19
|
author: isly.string(),
|
|
19
20
|
created: isly.string(),
|
|
20
|
-
text: isly.string().optional(),
|
|
21
|
-
action: isly.string(["approve", "reject"]).optional(),
|
|
22
21
|
});
|
|
23
22
|
Note.is = Note.type.is;
|
|
24
23
|
})(Note || (Note = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Note.js","sourceRoot":"../","sources":["Transaction/Note.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAO3B,MAAM,KAAW,IAAI,CAsBpB;AAtBD,WAAiB,IAAI;IACpB,SAAgB,aAAa,CAAC,IAAe,EAAE,MAAc;QAC5D,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;IAClE,CAAC;IAFe,kBAAa,gBAE5B,CAAA;
|
|
1
|
+
{"version":3,"file":"Note.js","sourceRoot":"../","sources":["Transaction/Note.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAO3B,MAAM,KAAW,IAAI,CAsBpB;AAtBD,WAAiB,IAAI;IACpB,SAAgB,aAAa,CAAC,IAAe,EAAE,MAAc;QAC5D,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;IAClE,CAAC;IAFe,kBAAa,gBAE5B,CAAA;IAMD,IAAiB,SAAS,CAOzB;IAPD,WAAiB,SAAS;QACZ,cAAI,GAAG,IAAI,CAAC,MAAM,CAAY;YAC1C,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAC9B,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE;YACrD,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;SACvC,CAAC,CAAA;QACW,YAAE,GAAG,UAAA,IAAI,CAAC,EAAE,CAAA;IAC1B,CAAC,EAPgB,SAAS,GAAT,cAAS,KAAT,cAAS,QAOzB;IACY,SAAI,GAAG,SAAS,CAAC,IAAI,CAAC,MAAM,CAAO;QAC/C,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;QACrB,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE;KACtB,CAAC,CAAA;IACW,OAAE,GAAG,KAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EAtBgB,IAAI,KAAJ,IAAI,QAsBpB"}
|
|
@@ -19,6 +19,7 @@ export interface Transaction extends TransactionCreatable {
|
|
|
19
19
|
operations: Operation[];
|
|
20
20
|
status: "created" | "approved" | "rejected" | "processing" | "finalized";
|
|
21
21
|
flags: ("review" | string)[];
|
|
22
|
+
oldFlags: string[];
|
|
22
23
|
notes: TransactionNote[];
|
|
23
24
|
}
|
|
24
25
|
export declare namespace Transaction {
|
|
@@ -21,6 +21,7 @@ export var Transaction;
|
|
|
21
21
|
operations: isly.array(isly.fromIs("Operation", Operation.is)),
|
|
22
22
|
status: isly.string(["created", "approved", "rejected", "processing", "finalized"]),
|
|
23
23
|
flags: isly.array(isly.string() || "review"),
|
|
24
|
+
oldFlags: isly.string().array(),
|
|
24
25
|
notes: isly.array(isly.fromIs("TransactionNote", TransactionNote.is)),
|
|
25
26
|
});
|
|
26
27
|
Transaction.is = Transaction.type.is;
|
|
@@ -44,6 +45,7 @@ export var Transaction;
|
|
|
44
45
|
operations: transaction.operations.map(o => Operation.fromCreatable(id, o)),
|
|
45
46
|
status: "created",
|
|
46
47
|
flags: [],
|
|
48
|
+
oldFlags: [],
|
|
47
49
|
notes: [],
|
|
48
50
|
};
|
|
49
51
|
}
|
|
@@ -63,6 +65,7 @@ export var Transaction;
|
|
|
63
65
|
operations: transaction.operations.map(o => Operation.fromCreatable(id, o)),
|
|
64
66
|
status: "created",
|
|
65
67
|
flags: [],
|
|
68
|
+
oldFlags: [],
|
|
66
69
|
notes: [],
|
|
67
70
|
};
|
|
68
71
|
}
|
|
@@ -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,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AAIpC,CAAC,EAtFgB,WAAW,KAAX,WAAW,QAsF3B"}
|
package/package.json
CHANGED
package/Organization/Rule.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { selectively } from "selectively"
|
|
2
|
-
|
|
3
|
-
const action = ["review", "reject", "flag"] as const
|
|
4
|
-
const type = ["authorization", "outbound", "inbound"] as const
|
|
5
|
-
export interface Rule {
|
|
6
|
-
name: string
|
|
7
|
-
description: string
|
|
8
|
-
action: typeof action[number]
|
|
9
|
-
type: typeof type[number]
|
|
10
|
-
condition: string
|
|
11
|
-
flags: string[]
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
interface RuleResult {
|
|
15
|
-
rule: Rule
|
|
16
|
-
definition: selectively.Definition
|
|
17
|
-
outcome: boolean
|
|
18
|
-
}
|
|
19
|
-
namespace RuleResult {
|
|
20
|
-
export function stringify(data: RuleResult): string {
|
|
21
|
-
return `rule: ${Rule.stringify(data.rule)}, \n definition: { definition: ${
|
|
22
|
-
data.definition.definition
|
|
23
|
-
}, arguments: ${data.definition.arguments.toString()} }, \n outcome: ${data.outcome}`
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export namespace Rule {
|
|
27
|
-
export type Result = RuleResult
|
|
28
|
-
export const Result = RuleResult
|
|
29
|
-
export function is(value: Rule): value is Rule {
|
|
30
|
-
return (
|
|
31
|
-
value &&
|
|
32
|
-
typeof value == "object" &&
|
|
33
|
-
typeof value.name == "string" &&
|
|
34
|
-
action.includes(value.action) &&
|
|
35
|
-
type.includes(value.type) &&
|
|
36
|
-
typeof value.condition == "string" &&
|
|
37
|
-
typeof value.description == "string"
|
|
38
|
-
)
|
|
39
|
-
}
|
|
40
|
-
export function stringify(rule: Rule): string {
|
|
41
|
-
return `{ label: ${rule.name}, action: ${rule.action}, type: ${rule.type}, condition: ${rule.condition}, description: ${rule.description}. }`
|
|
42
|
-
}
|
|
43
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { selectively } from "selectively";
|
|
2
|
-
declare const action: readonly ["review", "reject", "flag"];
|
|
3
|
-
declare const type: readonly ["authorization", "outbound", "inbound"];
|
|
4
|
-
export interface Rule {
|
|
5
|
-
name: string;
|
|
6
|
-
description: string;
|
|
7
|
-
action: typeof action[number];
|
|
8
|
-
type: typeof type[number];
|
|
9
|
-
condition: string;
|
|
10
|
-
flags: string[];
|
|
11
|
-
}
|
|
12
|
-
interface RuleResult {
|
|
13
|
-
rule: Rule;
|
|
14
|
-
definition: selectively.Definition;
|
|
15
|
-
outcome: boolean;
|
|
16
|
-
}
|
|
17
|
-
declare namespace RuleResult {
|
|
18
|
-
function stringify(data: RuleResult): string;
|
|
19
|
-
}
|
|
20
|
-
export declare namespace Rule {
|
|
21
|
-
type Result = RuleResult;
|
|
22
|
-
const Result: typeof RuleResult;
|
|
23
|
-
function is(value: Rule): value is Rule;
|
|
24
|
-
function stringify(rule: Rule): string;
|
|
25
|
-
}
|
|
26
|
-
export {};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
const action = ["review", "reject", "flag"];
|
|
2
|
-
const type = ["authorization", "outbound", "inbound"];
|
|
3
|
-
var RuleResult;
|
|
4
|
-
(function (RuleResult) {
|
|
5
|
-
function stringify(data) {
|
|
6
|
-
return `rule: ${Rule.stringify(data.rule)}, \n definition: { definition: ${data.definition.definition}, arguments: ${data.definition.arguments.toString()} }, \n outcome: ${data.outcome}`;
|
|
7
|
-
}
|
|
8
|
-
RuleResult.stringify = stringify;
|
|
9
|
-
})(RuleResult || (RuleResult = {}));
|
|
10
|
-
export var Rule;
|
|
11
|
-
(function (Rule) {
|
|
12
|
-
Rule.Result = RuleResult;
|
|
13
|
-
function is(value) {
|
|
14
|
-
return (value &&
|
|
15
|
-
typeof value == "object" &&
|
|
16
|
-
typeof value.name == "string" &&
|
|
17
|
-
action.includes(value.action) &&
|
|
18
|
-
type.includes(value.type) &&
|
|
19
|
-
typeof value.condition == "string" &&
|
|
20
|
-
typeof value.description == "string");
|
|
21
|
-
}
|
|
22
|
-
Rule.is = is;
|
|
23
|
-
function stringify(rule) {
|
|
24
|
-
return `{ label: ${rule.name}, action: ${rule.action}, type: ${rule.type}, condition: ${rule.condition}, description: ${rule.description}. }`;
|
|
25
|
-
}
|
|
26
|
-
Rule.stringify = stringify;
|
|
27
|
-
})(Rule || (Rule = {}));
|
|
28
|
-
//# sourceMappingURL=Rule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Rule.js","sourceRoot":"../","sources":["Organization/Rule.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAU,CAAA;AACpD,MAAM,IAAI,GAAG,CAAC,eAAe,EAAE,UAAU,EAAE,SAAS,CAAU,CAAA;AAe9D,IAAU,UAAU,CAMnB;AAND,WAAU,UAAU;IACnB,SAAgB,SAAS,CAAC,IAAgB;QACzC,OAAO,SAAS,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,kCACxC,IAAI,CAAC,UAAU,CAAC,UACjB,gBAAgB,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,QAAQ,EAAE,mBAAmB,IAAI,CAAC,OAAO,EAAE,CAAA;IACtF,CAAC;IAJe,oBAAS,YAIxB,CAAA;AACF,CAAC,EANS,UAAU,KAAV,UAAU,QAMnB;AACD,MAAM,KAAW,IAAI,CAiBpB;AAjBD,WAAiB,IAAI;IAEP,WAAM,GAAG,UAAU,CAAA;IAChC,SAAgB,EAAE,CAAC,KAAW;QAC7B,OAAO,CACN,KAAK;YACL,OAAO,KAAK,IAAI,QAAQ;YACxB,OAAO,KAAK,CAAC,IAAI,IAAI,QAAQ;YAC7B,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC;YAC7B,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC;YACzB,OAAO,KAAK,CAAC,SAAS,IAAI,QAAQ;YAClC,OAAO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