@pax2pay/model-banking 0.1.279 → 0.1.281
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/Client/Accounts/Rules.ts +16 -0
- package/Client/Accounts/index.ts +3 -0
- package/Client/Organizations/Rules.ts +13 -6
- package/Client/Rules.ts +10 -7
- package/Rule/State/Organization.ts +1 -2
- package/Rule/State/index.ts +6 -19
- package/Transaction/index.ts +13 -0
- package/dist/Client/Accounts/Rules.d.ts +10 -0
- package/dist/Client/Accounts/Rules.js +15 -0
- package/dist/Client/Accounts/Rules.js.map +1 -0
- package/dist/Client/Accounts/index.d.ts +2 -0
- package/dist/Client/Accounts/index.js +2 -0
- package/dist/Client/Accounts/index.js.map +1 -1
- package/dist/Client/Organizations/Rules.d.ts +5 -3
- package/dist/Client/Organizations/Rules.js +14 -5
- package/dist/Client/Organizations/Rules.js.map +1 -1
- package/dist/Client/Rules.d.ts +5 -3
- package/dist/Client/Rules.js +10 -5
- package/dist/Client/Rules.js.map +1 -1
- package/dist/Rail/Address/index.d.ts +1 -1
- package/dist/Rail/index.d.ts +1 -1
- package/dist/Rule/State/Organization.d.ts +1 -2
- package/dist/Rule/State/Organization.js +1 -1
- package/dist/Rule/State/Organization.js.map +1 -1
- package/dist/Rule/State/index.d.ts +6 -19
- package/dist/Rule/State/index.js.map +1 -1
- package/dist/Transaction/index.d.ts +9 -0
- package/dist/Transaction/index.js +11 -0
- package/dist/Transaction/index.js.map +1 -1
- package/package.json +1 -1
- package/verifier/index.ts +1 -2
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { gracely } from "gracely"
|
|
2
|
+
import { http } from "cloudly-http"
|
|
3
|
+
import { Rule } from "../../Rule"
|
|
4
|
+
|
|
5
|
+
export class Rules {
|
|
6
|
+
constructor(private readonly client: http.Client) {}
|
|
7
|
+
async create(account: string, rule: Rule): Promise<Rule | gracely.Error> {
|
|
8
|
+
return this.client.post<Rule>(`/account/${account}/rule`, rule)
|
|
9
|
+
}
|
|
10
|
+
async replace(account: string, rule: Rule): Promise<Rule | gracely.Error> {
|
|
11
|
+
return this.client.put<Rule>(`/account/${account}/rule/${rule.code}`, rule)
|
|
12
|
+
}
|
|
13
|
+
async remove(account: string, code: string): Promise<Rule | gracely.Error> {
|
|
14
|
+
return this.client.delete<Rule>(`/account/${account}/rule/${code}`)
|
|
15
|
+
}
|
|
16
|
+
}
|
package/Client/Accounts/index.ts
CHANGED
|
@@ -3,9 +3,12 @@ import { http } from "cloudly-http"
|
|
|
3
3
|
import * as rest from "cloudly-rest"
|
|
4
4
|
import { Account } from "../../Account"
|
|
5
5
|
import { Rails } from "./Rails"
|
|
6
|
+
import { Rules } from "./Rules"
|
|
6
7
|
|
|
7
8
|
export class Accounts extends rest.Collection<gracely.Error> {
|
|
8
9
|
readonly Rails = new Rails(this.client)
|
|
10
|
+
|
|
11
|
+
readonly rules = new Rules(this.client)
|
|
9
12
|
constructor(client: http.Client) {
|
|
10
13
|
super(client)
|
|
11
14
|
}
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import { gracely } from "gracely"
|
|
2
2
|
import { http } from "cloudly-http"
|
|
3
|
-
import * as rest from "cloudly-rest"
|
|
4
3
|
import { Rule } from "../../Rule"
|
|
5
4
|
|
|
6
|
-
export class Rules
|
|
7
|
-
constructor(client: http.Client) {
|
|
8
|
-
|
|
5
|
+
export class Rules {
|
|
6
|
+
constructor(private readonly client: http.Client) {}
|
|
7
|
+
async create(organization: string, rule: Rule): Promise<Rule | gracely.Error> {
|
|
8
|
+
return this.client.post<Rule>(`/organization/rule`, rule, {
|
|
9
|
+
organization,
|
|
10
|
+
})
|
|
11
|
+
}
|
|
12
|
+
async replace(organization: string, rule: Rule): Promise<Rule | gracely.Error> {
|
|
13
|
+
return this.client.put<Rule>(`/organization/rule/${rule.code}`, rule, {
|
|
14
|
+
organization,
|
|
15
|
+
})
|
|
9
16
|
}
|
|
10
|
-
async
|
|
11
|
-
return this.client.
|
|
17
|
+
async remove(organization: string, code: string): Promise<Rule | gracely.Error> {
|
|
18
|
+
return this.client.delete<Rule>(`/organization/rule/${code}`, {
|
|
12
19
|
organization,
|
|
13
20
|
})
|
|
14
21
|
}
|
package/Client/Rules.ts
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { gracely } from "gracely"
|
|
2
2
|
import { http } from "cloudly-http"
|
|
3
|
-
import * as rest from "cloudly-rest"
|
|
4
3
|
import { Rule } from "../Rule"
|
|
5
4
|
|
|
6
|
-
export class Rules
|
|
7
|
-
constructor(client: http.Client) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
async replace(rule: Rule[]): Promise<Rule[] | gracely.Error> {
|
|
11
|
-
return this.client.put<Rule[]>(`/rule`, rule)
|
|
5
|
+
export class Rules {
|
|
6
|
+
constructor(private readonly client: http.Client) {}
|
|
7
|
+
async create(rule: Rule): Promise<Rule | gracely.Error> {
|
|
8
|
+
return this.client.post<Rule>(`/rule`, rule)
|
|
12
9
|
}
|
|
13
10
|
async list(): Promise<Rule[] | gracely.Error> {
|
|
14
11
|
return this.client.get<Rule[]>(`/rule`)
|
|
15
12
|
}
|
|
13
|
+
async replace(rule: Rule): Promise<Rule | gracely.Error> {
|
|
14
|
+
return this.client.put<Rule>(`/rule/${rule.code}`, rule)
|
|
15
|
+
}
|
|
16
|
+
async remove(code: string): Promise<Rule | gracely.Error> {
|
|
17
|
+
return this.client.delete<Rule>(`/rule/${code}`)
|
|
18
|
+
}
|
|
16
19
|
}
|
package/Rule/State/index.ts
CHANGED
|
@@ -37,24 +37,11 @@ export namespace State {
|
|
|
37
37
|
organization,
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
export
|
|
41
|
-
export
|
|
42
|
-
export
|
|
43
|
-
export
|
|
44
|
-
export
|
|
45
|
-
export
|
|
46
|
-
export namespace Card {
|
|
47
|
-
export type Statistics = StateCard.Statistics
|
|
48
|
-
}
|
|
49
|
-
export type Account = StateAccount
|
|
50
|
-
export const Account = StateAccount
|
|
51
|
-
export namespace Account {
|
|
52
|
-
export type Transactions = StateAccount.Transactions
|
|
53
|
-
export type Days = StateAccount.Days
|
|
54
|
-
}
|
|
55
|
-
export type Transaction = StateTransaction
|
|
56
|
-
export const Transaction = StateTransaction
|
|
57
|
-
export type Organization = StateOrganization
|
|
58
|
-
export const Organization = StateOrganization
|
|
40
|
+
export import Partial = StatePartial
|
|
41
|
+
export import Authorization = StateAuthorization
|
|
42
|
+
export import Card = StateCard
|
|
43
|
+
export import Account = StateAccount
|
|
44
|
+
export import Transaction = StateTransaction
|
|
45
|
+
export import Organization = StateOrganization
|
|
59
46
|
export type Data = StateData
|
|
60
47
|
}
|
package/Transaction/index.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { Identifier } from "../Identifier"
|
|
|
5
5
|
import { Operation } from "../Operation"
|
|
6
6
|
import { Rail } from "../Rail"
|
|
7
7
|
import { Report } from "../Report"
|
|
8
|
+
import type { Rule } from "../Rule"
|
|
8
9
|
import { Collect as TransactionCollect } from "./Collect"
|
|
9
10
|
import { Creatable as TransactionCreatable } from "./Creatable"
|
|
10
11
|
import { Incoming as TransactionIncoming } from "./Incoming"
|
|
@@ -36,6 +37,7 @@ export interface Transaction extends Transaction.Creatable {
|
|
|
36
37
|
oldFlags: string[]
|
|
37
38
|
notes: Transaction.Note[]
|
|
38
39
|
risk?: number
|
|
40
|
+
state?: Rule.State
|
|
39
41
|
}
|
|
40
42
|
export namespace Transaction {
|
|
41
43
|
export const types = ["card", "internal", "external", "system"] as const
|
|
@@ -60,6 +62,7 @@ export namespace Transaction {
|
|
|
60
62
|
}
|
|
61
63
|
export type Status = TransactionStatus
|
|
62
64
|
export const Status = TransactionStatus
|
|
65
|
+
|
|
63
66
|
export const type = Creatable.type.extend<Transaction>({
|
|
64
67
|
organization: isly.string(),
|
|
65
68
|
accountId: isly.string(),
|
|
@@ -84,10 +87,20 @@ export namespace Transaction {
|
|
|
84
87
|
oldFlags: isly.string().array(),
|
|
85
88
|
notes: Note.type.array(),
|
|
86
89
|
risk: isly.number().optional(),
|
|
90
|
+
state: isly.any().optional(),
|
|
87
91
|
})
|
|
88
92
|
export const is = type.is
|
|
89
93
|
export const flaw = type.flaw
|
|
90
94
|
export const get = type.get
|
|
95
|
+
export type Event = Omit<Transaction, "state">
|
|
96
|
+
export namespace Event {
|
|
97
|
+
export const type = Transaction.type.omit(["state"])
|
|
98
|
+
export const is = type.is
|
|
99
|
+
export const get = type.get
|
|
100
|
+
export function from(transaction: Transaction): Event {
|
|
101
|
+
return (({ state, ...event }) => event)(transaction)
|
|
102
|
+
}
|
|
103
|
+
}
|
|
91
104
|
export function fromCreatable(
|
|
92
105
|
organization: string,
|
|
93
106
|
accountId: string,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { gracely } from "gracely";
|
|
2
|
+
import { http } from "cloudly-http";
|
|
3
|
+
import { Rule } from "../../Rule";
|
|
4
|
+
export declare class Rules {
|
|
5
|
+
private readonly client;
|
|
6
|
+
constructor(client: http.Client);
|
|
7
|
+
create(account: string, rule: Rule): Promise<Rule | gracely.Error>;
|
|
8
|
+
replace(account: string, rule: Rule): Promise<Rule | gracely.Error>;
|
|
9
|
+
remove(account: string, code: string): Promise<Rule | gracely.Error>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export class Rules {
|
|
2
|
+
constructor(client) {
|
|
3
|
+
this.client = client;
|
|
4
|
+
}
|
|
5
|
+
async create(account, rule) {
|
|
6
|
+
return this.client.post(`/account/${account}/rule`, rule);
|
|
7
|
+
}
|
|
8
|
+
async replace(account, rule) {
|
|
9
|
+
return this.client.put(`/account/${account}/rule/${rule.code}`, rule);
|
|
10
|
+
}
|
|
11
|
+
async remove(account, code) {
|
|
12
|
+
return this.client.delete(`/account/${account}/rule/${code}`);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=Rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Rules.js","sourceRoot":"../","sources":["Client/Accounts/Rules.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,KAAK;IACjB,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IACpD,KAAK,CAAC,MAAM,CAAC,OAAe,EAAE,IAAU;QACvC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAO,YAAY,OAAO,OAAO,EAAE,IAAI,CAAC,CAAA;IAChE,CAAC;IACD,KAAK,CAAC,OAAO,CAAC,OAAe,EAAE,IAAU;QACxC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAO,YAAY,OAAO,SAAS,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,CAAA;IAC5E,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,OAAe,EAAE,IAAY;QACzC,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAO,YAAY,OAAO,SAAS,IAAI,EAAE,CAAC,CAAA;IACpE,CAAC;CACD"}
|
|
@@ -3,8 +3,10 @@ import { http } from "cloudly-http";
|
|
|
3
3
|
import * as rest from "cloudly-rest";
|
|
4
4
|
import { Account } from "../../Account";
|
|
5
5
|
import { Rails } from "./Rails";
|
|
6
|
+
import { Rules } from "./Rules";
|
|
6
7
|
export declare class Accounts extends rest.Collection<gracely.Error> {
|
|
7
8
|
readonly Rails: Rails;
|
|
9
|
+
readonly rules: Rules;
|
|
8
10
|
constructor(client: http.Client);
|
|
9
11
|
create(account: Account.Creatable): Promise<Account | gracely.Error>;
|
|
10
12
|
list(options?: {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as rest from "cloudly-rest";
|
|
2
2
|
import { Rails } from "./Rails";
|
|
3
|
+
import { Rules } from "./Rules";
|
|
3
4
|
export class Accounts extends rest.Collection {
|
|
4
5
|
constructor(client) {
|
|
5
6
|
super(client);
|
|
6
7
|
this.Rails = new Rails(this.client);
|
|
8
|
+
this.rules = new Rules(this.client);
|
|
7
9
|
}
|
|
8
10
|
async create(account) {
|
|
9
11
|
return this.client.post("/account", account);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Accounts/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,MAAM,OAAO,QAAS,SAAQ,IAAI,CAAC,UAAyB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Accounts/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,MAAM,OAAO,QAAS,SAAQ,IAAI,CAAC,UAAyB;IAI3D,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;QAJL,UAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAE9B,UAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAGvC,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,OAA0B;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAU,UAAU,EAAE,OAAO,CAAC,CAAA;IACtD,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,OAGV;QACA,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAA8C,UAAU,EAAE,OAAO,CAAC,CAAA;IACzF,CAAC;CACD"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { gracely } from "gracely";
|
|
2
2
|
import { http } from "cloudly-http";
|
|
3
|
-
import * as rest from "cloudly-rest";
|
|
4
3
|
import { Rule } from "../../Rule";
|
|
5
|
-
export declare class Rules
|
|
4
|
+
export declare class Rules {
|
|
5
|
+
private readonly client;
|
|
6
6
|
constructor(client: http.Client);
|
|
7
|
-
|
|
7
|
+
create(organization: string, rule: Rule): Promise<Rule | gracely.Error>;
|
|
8
|
+
replace(organization: string, rule: Rule): Promise<Rule | gracely.Error>;
|
|
9
|
+
remove(organization: string, code: string): Promise<Rule | gracely.Error>;
|
|
8
10
|
}
|
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
export class Rules extends rest.Collection {
|
|
1
|
+
export class Rules {
|
|
3
2
|
constructor(client) {
|
|
4
|
-
|
|
3
|
+
this.client = client;
|
|
5
4
|
}
|
|
6
|
-
async
|
|
7
|
-
return this.client.
|
|
5
|
+
async create(organization, rule) {
|
|
6
|
+
return this.client.post(`/organization/rule`, rule, {
|
|
7
|
+
organization,
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
async replace(organization, rule) {
|
|
11
|
+
return this.client.put(`/organization/rule/${rule.code}`, rule, {
|
|
12
|
+
organization,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
async remove(organization, code) {
|
|
16
|
+
return this.client.delete(`/organization/rule/${code}`, {
|
|
8
17
|
organization,
|
|
9
18
|
});
|
|
10
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Rules.js","sourceRoot":"../","sources":["Client/Organizations/Rules.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Rules.js","sourceRoot":"../","sources":["Client/Organizations/Rules.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,KAAK;IACjB,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IACpD,KAAK,CAAC,MAAM,CAAC,YAAoB,EAAE,IAAU;QAC5C,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAO,oBAAoB,EAAE,IAAI,EAAE;YACzD,YAAY;SACZ,CAAC,CAAA;IACH,CAAC;IACD,KAAK,CAAC,OAAO,CAAC,YAAoB,EAAE,IAAU;QAC7C,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAO,sBAAsB,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE;YACrE,YAAY;SACZ,CAAC,CAAA;IACH,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,YAAoB,EAAE,IAAY;QAC9C,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAO,sBAAsB,IAAI,EAAE,EAAE;YAC7D,YAAY;SACZ,CAAC,CAAA;IACH,CAAC;CACD"}
|
package/dist/Client/Rules.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { gracely } from "gracely";
|
|
2
2
|
import { http } from "cloudly-http";
|
|
3
|
-
import * as rest from "cloudly-rest";
|
|
4
3
|
import { Rule } from "../Rule";
|
|
5
|
-
export declare class Rules
|
|
4
|
+
export declare class Rules {
|
|
5
|
+
private readonly client;
|
|
6
6
|
constructor(client: http.Client);
|
|
7
|
-
|
|
7
|
+
create(rule: Rule): Promise<Rule | gracely.Error>;
|
|
8
8
|
list(): Promise<Rule[] | gracely.Error>;
|
|
9
|
+
replace(rule: Rule): Promise<Rule | gracely.Error>;
|
|
10
|
+
remove(code: string): Promise<Rule | gracely.Error>;
|
|
9
11
|
}
|
package/dist/Client/Rules.js
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
export class Rules extends rest.Collection {
|
|
1
|
+
export class Rules {
|
|
3
2
|
constructor(client) {
|
|
4
|
-
|
|
3
|
+
this.client = client;
|
|
5
4
|
}
|
|
6
|
-
async
|
|
7
|
-
return this.client.
|
|
5
|
+
async create(rule) {
|
|
6
|
+
return this.client.post(`/rule`, rule);
|
|
8
7
|
}
|
|
9
8
|
async list() {
|
|
10
9
|
return this.client.get(`/rule`);
|
|
11
10
|
}
|
|
11
|
+
async replace(rule) {
|
|
12
|
+
return this.client.put(`/rule/${rule.code}`, rule);
|
|
13
|
+
}
|
|
14
|
+
async remove(code) {
|
|
15
|
+
return this.client.delete(`/rule/${code}`);
|
|
16
|
+
}
|
|
12
17
|
}
|
|
13
18
|
//# sourceMappingURL=Rules.js.map
|
package/dist/Client/Rules.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Rules.js","sourceRoot":"../","sources":["Client/Rules.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Rules.js","sourceRoot":"../","sources":["Client/Rules.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,KAAK;IACjB,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IACpD,KAAK,CAAC,MAAM,CAAC,IAAU;QACtB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAO,OAAO,EAAE,IAAI,CAAC,CAAA;IAC7C,CAAC;IACD,KAAK,CAAC,IAAI;QACT,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAS,OAAO,CAAC,CAAA;IACxC,CAAC;IACD,KAAK,CAAC,OAAO,CAAC,IAAU;QACvB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAO,SAAS,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,CAAA;IACzD,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,IAAY;QACxB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAO,SAAS,IAAI,EAAE,CAAC,CAAA;IACjD,CAAC;CACD"}
|
|
@@ -8,7 +8,7 @@ export type Address = AddressPaxGiro | AddressInternal | AddressIban | AddressSc
|
|
|
8
8
|
export declare namespace Address {
|
|
9
9
|
const types: readonly ["paxgiro", "internal", "iban", "scan", "card"];
|
|
10
10
|
type Type = typeof types[number];
|
|
11
|
-
const type: isly.Type<"paxgiro" | "
|
|
11
|
+
const type: isly.Type<"paxgiro" | "card" | "internal" | "iban" | "scan">;
|
|
12
12
|
function compare(addresses: [Address, Address]): boolean;
|
|
13
13
|
function parse(value: string): Address | undefined;
|
|
14
14
|
function stringify(Address: Address): string;
|
package/dist/Rail/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { Address as RailAddress } from "./Address";
|
|
|
3
3
|
export type Rail = typeof Rail.rails[number];
|
|
4
4
|
export declare namespace Rail {
|
|
5
5
|
const rails: readonly ["internal", "paxgiro", "mastercard", "fasterpayments", "chaps", "bacs", "transfer"];
|
|
6
|
-
const type: isly.Type<"paxgiro" | "
|
|
6
|
+
const type: isly.Type<"paxgiro" | "mastercard" | "internal" | "fasterpayments" | "chaps" | "bacs" | "transfer">;
|
|
7
7
|
type Address = RailAddress;
|
|
8
8
|
namespace Address {
|
|
9
9
|
type Type = RailAddress.Type;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Organization.js","sourceRoot":"../","sources":["Rule/State/Organization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"Organization.js","sourceRoot":"../","sources":["Rule/State/Organization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAEtE,MAAM,KAAQ,YAAY,GAAG,iBAAiB,CAAA"}
|
|
@@ -17,24 +17,11 @@ export interface State {
|
|
|
17
17
|
}
|
|
18
18
|
export declare namespace State {
|
|
19
19
|
function from(data: StateData, account: ModelAccount, transactions: StateAccount.Transactions, days: StateAccount.Days, transaction: ModelTransaction.Creatable, authorization?: StateAuthorization, card?: StateCard, organization?: StateOrganization): State;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
namespace Card {
|
|
27
|
-
type Statistics = StateCard.Statistics;
|
|
28
|
-
}
|
|
29
|
-
type Account = StateAccount;
|
|
30
|
-
const Account: typeof StateAccount;
|
|
31
|
-
namespace Account {
|
|
32
|
-
type Transactions = StateAccount.Transactions;
|
|
33
|
-
type Days = StateAccount.Days;
|
|
34
|
-
}
|
|
35
|
-
type Transaction = StateTransaction;
|
|
36
|
-
const Transaction: typeof StateTransaction;
|
|
37
|
-
type Organization = StateOrganization;
|
|
38
|
-
const Organization: typeof import("../../Organization").Organization;
|
|
20
|
+
export import Partial = StatePartial;
|
|
21
|
+
export import Authorization = StateAuthorization;
|
|
22
|
+
export import Card = StateCard;
|
|
23
|
+
export import Account = StateAccount;
|
|
24
|
+
export import Transaction = StateTransaction;
|
|
25
|
+
export import Organization = StateOrganization;
|
|
39
26
|
type Data = StateData;
|
|
40
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Rule/State/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,WAAW,CAAA;AACnD,OAAO,EAAE,aAAa,IAAI,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACrE,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,QAAQ,CAAA;AAE1C,OAAO,EAAE,YAAY,IAAI,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,WAAW,CAAA;AACnD,OAAO,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAW/D,MAAM,KAAW,KAAK,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Rule/State/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,WAAW,CAAA;AACnD,OAAO,EAAE,aAAa,IAAI,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACrE,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,QAAQ,CAAA;AAE1C,OAAO,EAAE,YAAY,IAAI,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,WAAW,CAAA;AACnD,OAAO,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAW/D,MAAM,KAAW,KAAK,CA2BrB;AA3BD,WAAiB,KAAK;IACrB,SAAgB,IAAI,CACnB,IAAe,EACf,OAAqB,EACrB,YAAuC,EACvC,IAAuB,EACvB,WAAuC,EACvC,aAAkC,EAClC,IAAgB,EAChB,YAAgC;QAEhC,OAAO;YACN,IAAI;YACJ,OAAO,EAAE,MAAA,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC;YAClD,WAAW,EAAE,MAAA,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC;YAC1C,aAAa;YACb,IAAI;YACJ,YAAY;SACZ,CAAA;IACF,CAAC;IAlBe,UAAI,OAkBnB,CAAA;IACa,aAAO,GAAG,YAAY,CAAA;IACtB,mBAAa,GAAG,kBAAkB,CAAA;IAClC,UAAI,GAAG,SAAS,CAAA;IAChB,aAAO,GAAG,YAAY,CAAA;IACtB,iBAAW,GAAG,gBAAgB,CAAA;IAC9B,kBAAY,GAAG,iBAAiB,CAAA;AAE/C,CAAC,EA3BgB,KAAK,KAAL,KAAK,QA2BrB"}
|
|
@@ -3,6 +3,7 @@ import { isoly } from "isoly";
|
|
|
3
3
|
import { isly } from "isly";
|
|
4
4
|
import { Operation } from "../Operation";
|
|
5
5
|
import { Rail } from "../Rail";
|
|
6
|
+
import type { Rule } from "../Rule";
|
|
6
7
|
import { Collect as TransactionCollect } from "./Collect";
|
|
7
8
|
import { Creatable as TransactionCreatable } from "./Creatable";
|
|
8
9
|
import { Incoming as TransactionIncoming } from "./Incoming";
|
|
@@ -33,6 +34,7 @@ export interface Transaction extends Transaction.Creatable {
|
|
|
33
34
|
oldFlags: string[];
|
|
34
35
|
notes: Transaction.Note[];
|
|
35
36
|
risk?: number;
|
|
37
|
+
state?: Rule.State;
|
|
36
38
|
}
|
|
37
39
|
export declare namespace Transaction {
|
|
38
40
|
const types: readonly ["card", "internal", "external", "system"];
|
|
@@ -61,6 +63,13 @@ export declare namespace Transaction {
|
|
|
61
63
|
const is: isly.Type.IsFunction<Transaction>;
|
|
62
64
|
const flaw: isly.Type.FlawFunction;
|
|
63
65
|
const get: isly.Type.GetFunction<Transaction>;
|
|
66
|
+
type Event = Omit<Transaction, "state">;
|
|
67
|
+
namespace Event {
|
|
68
|
+
const type: isly.object.ExtendableType<Omit<Transaction, "state">>;
|
|
69
|
+
const is: isly.Type.IsFunction<Omit<Transaction, "state">>;
|
|
70
|
+
const get: isly.Type.GetFunction<Omit<Transaction, "state">>;
|
|
71
|
+
function from(transaction: Transaction): Event;
|
|
72
|
+
}
|
|
64
73
|
function fromCreatable(organization: string, accountId: string, accountName: string, account: Rail.Address, rail: Rail, creatable: Creatable, operations: Operation.Creatable[], balance: {
|
|
65
74
|
actual: number;
|
|
66
75
|
reserved: number;
|
|
@@ -45,10 +45,21 @@ export var Transaction;
|
|
|
45
45
|
oldFlags: isly.string().array(),
|
|
46
46
|
notes: Transaction.Note.type.array(),
|
|
47
47
|
risk: isly.number().optional(),
|
|
48
|
+
state: isly.any().optional(),
|
|
48
49
|
});
|
|
49
50
|
Transaction.is = Transaction.type.is;
|
|
50
51
|
Transaction.flaw = Transaction.type.flaw;
|
|
51
52
|
Transaction.get = Transaction.type.get;
|
|
53
|
+
let Event;
|
|
54
|
+
(function (Event) {
|
|
55
|
+
Event.type = Transaction.type.omit(["state"]);
|
|
56
|
+
Event.is = Event.type.is;
|
|
57
|
+
Event.get = Event.type.get;
|
|
58
|
+
function from(transaction) {
|
|
59
|
+
return (({ state, ...event }) => event)(transaction);
|
|
60
|
+
}
|
|
61
|
+
Event.from = from;
|
|
62
|
+
})(Event = Transaction.Event || (Transaction.Event = {}));
|
|
52
63
|
function fromCreatable(organization, accountId, accountName, account, rail, creatable, operations, balance, by) {
|
|
53
64
|
const id = Identifier.generate();
|
|
54
65
|
const amount = -creatable.amount;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Transaction/index.ts"],"names":[],"mappings":"AAAA,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,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Transaction/index.ts"],"names":[],"mappings":"AAAA,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,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAElC,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,WAAW,CAAA;AACzD,OAAO,EAAE,SAAS,IAAI,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAC/D,OAAO,EAAE,QAAQ,IAAI,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,EAAE,IAAI,IAAI,eAAe,EAAE,MAAM,QAAQ,CAAA;AAChD,OAAO,EAAE,SAAS,IAAI,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAC/D,OAAO,EAAE,MAAM,IAAI,iBAAiB,EAAE,MAAM,UAAU,CAAA;AA4BtD,MAAM,KAAW,WAAW,CAsN3B;AAtND,WAAiB,WAAW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AAQ,CAAC,IAAI,EAAE;gBACzD,CAAC,CAAC,GAAG,OAAO,CAAC,GAAG,SAAS,OAAO,CAAC,KAAK,EAAE,CAAA;IAC1C,CAAC;IACD,SAAS,aAAa,CAAC,OAAqB;QAC3C,OAAO,OAAO,CAAC,IAAI,IAAI,MAAM;YAC5B,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC;YACjC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC;gBAChD,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;gBACrB,CAAC,CAAC,OAAO,CAAC,EAAE,CAAA;IACd,CAAC;IACD,SAAgB,KAAK,CAAC,YAA2B;QAChD,OAAO,MAAM,CAAC,KAAK,CAClB,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EACnB,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAC9B,MAAM,CAAC,GAAG,CAAC,KAAK,CACf,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,EAC9C,GAAG,CACH,CACD,EACD,GAAG,CACH,CAAA;IACF,CAAC;IAXe,iBAAK,QAWpB,CAAA;AACF,CAAC,EAtNgB,WAAW,KAAX,WAAW,QAsN3B"}
|
package/package.json
CHANGED
package/verifier/index.ts
CHANGED
|
@@ -4,8 +4,7 @@ import { Transaction } from "../Transaction"
|
|
|
4
4
|
export namespace verifier {
|
|
5
5
|
export async function verify(event: string | undefined): Promise<authly.Payload | undefined> {
|
|
6
6
|
const verifier = authly.Verifier.create(authly.Algorithm.RS256(publicKey))
|
|
7
|
-
|
|
8
|
-
return result ? Transaction.get(result) : result
|
|
7
|
+
return Transaction.Event.get(verifier && (await verifier.verify(event)))
|
|
9
8
|
//TODO: Expand to work with other types for other hook-events
|
|
10
9
|
}
|
|
11
10
|
}
|