@pax2pay/model-banking 0.1.138 → 0.1.140

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.
Files changed (47) hide show
  1. package/Client/Organizations/Rules.ts +3 -3
  2. package/Client/Rules.ts +16 -0
  3. package/Client/index.ts +5 -3
  4. package/Organization/Creatable.ts +2 -2
  5. package/Organization/index.ts +0 -8
  6. package/Realm.ts +8 -0
  7. package/Rule/State/Account.ts +11 -4
  8. package/Rule/State/Transaction.ts +2 -2
  9. package/Rule/State/index.ts +5 -4
  10. package/Transaction/Note.ts +3 -3
  11. package/Transaction/index.ts +4 -0
  12. package/dist/Client/Organizations/Rules.d.ts +2 -2
  13. package/dist/Client/Organizations/Rules.js.map +1 -1
  14. package/dist/Client/Rules.d.ts +9 -0
  15. package/dist/Client/Rules.js +13 -0
  16. package/dist/Client/Rules.js.map +1 -0
  17. package/dist/Client/index.d.ts +5 -3
  18. package/dist/Client/index.js +5 -3
  19. package/dist/Client/index.js.map +1 -1
  20. package/dist/Organization/Creatable.d.ts +1 -1
  21. package/dist/Organization/Creatable.js +2 -2
  22. package/dist/Organization/Creatable.js.map +1 -1
  23. package/dist/Organization/index.d.ts +0 -6
  24. package/dist/Organization/index.js +0 -2
  25. package/dist/Organization/index.js.map +1 -1
  26. package/dist/Realm.d.ts +2 -0
  27. package/dist/Realm.js +7 -0
  28. package/dist/Realm.js.map +1 -1
  29. package/dist/Rule/State/Account.d.ts +28 -2
  30. package/dist/Rule/State/Account.js +2 -2
  31. package/dist/Rule/State/Account.js.map +1 -1
  32. package/dist/Rule/State/Transaction.d.ts +2 -2
  33. package/dist/Rule/State/Transaction.js.map +1 -1
  34. package/dist/Rule/State/index.d.ts +2 -2
  35. package/dist/Rule/State/index.js +3 -3
  36. package/dist/Rule/State/index.js.map +1 -1
  37. package/dist/Transaction/Note.d.ts +1 -0
  38. package/dist/Transaction/Note.js +2 -3
  39. package/dist/Transaction/Note.js.map +1 -1
  40. package/dist/Transaction/index.d.ts +1 -0
  41. package/dist/Transaction/index.js +3 -0
  42. package/dist/Transaction/index.js.map +1 -1
  43. package/package.json +1 -1
  44. package/Organization/Rule.ts +0 -43
  45. package/dist/Organization/Rule.d.ts +0 -26
  46. package/dist/Organization/Rule.js +0 -28
  47. package/dist/Organization/Rule.js.map +0 -1
@@ -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 { Organization } from "../../Organization"
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: Organization.Rule[]): Promise<Organization.Rule[] | gracely.Error> {
11
- return this.client.put<Organization.Rule[]>(`/organization/rule`, rules, {
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
  }
@@ -0,0 +1,16 @@
1
+ import { gracely } from "gracely"
2
+ import { http } from "cloudly-http"
3
+ import * as rest from "cloudly-rest"
4
+ import { Rule } from "../Rule"
5
+
6
+ export class Rules extends rest.Collection<gracely.Error> {
7
+ constructor(client: http.Client) {
8
+ super(client)
9
+ }
10
+ async replace(rule: Rule[]): Promise<Rule[] | gracely.Error> {
11
+ return this.client.put<Rule[]>(`/rule`, rule)
12
+ }
13
+ async list(): Promise<Rule[] | gracely.Error> {
14
+ return this.client.get<Rule[]>(`/rule`)
15
+ }
16
+ }
package/Client/index.ts CHANGED
@@ -6,6 +6,7 @@ import { Accounts } from "./Accounts"
6
6
  import { Cards } from "./Cards"
7
7
  import { Operations } from "./Operations"
8
8
  import { Organizations } from "./Organizations"
9
+ import { Rules } from "./Rules"
9
10
  import { Settlements } from "./Settlements"
10
11
  import { Transactions } from "./Transactions"
11
12
  import { Treasury } from "./Treasury"
@@ -14,15 +15,16 @@ import { Version } from "./Version"
14
15
  export class Client extends rest.Client<gracely.Error> {
15
16
  realm?: string
16
17
  organization?: string
17
- readonly userwidgets = new userwidgets.ClientCollection(this.client, { pathPrefix: "/widgets" })
18
18
  readonly accounts = new Accounts(this.client)
19
+ readonly cards = new Cards(this.client)
19
20
  readonly operations = new Operations(this.client)
20
21
  readonly organizations = new Organizations(this.client)
22
+ readonly rules = new Rules(this.client)
23
+ readonly settlements = new Settlements(this.client)
21
24
  readonly transactions = new Transactions(this.client)
22
25
  readonly treasury = new Treasury(this.client)
26
+ readonly userwidgets = new userwidgets.ClientCollection(this.client, { pathPrefix: "/widgets" })
23
27
  readonly version = new Version(this.client)
24
- readonly cards = new Cards(this.client)
25
- readonly settlements = new Settlements(this.client)
26
28
 
27
29
  static create<T = Record<string, any>>(server: string, key: string, load?: (client: http.Client) => T): Client & T {
28
30
  let httpClient: http.Client<gracely.Error>
@@ -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: isly.fromIs<Rule>("Rule", Rule.is).array(),
17
+ rules: Rule.type.array(),
18
18
  contact: Contact.type.optional(),
19
19
  })
20
20
  export const is = type.is
@@ -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/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"],
@@ -1,9 +1,16 @@
1
1
  import type { Account as ModelAccount } from "../../Account"
2
2
 
3
- export type Account = ModelAccount
4
-
3
+ export interface Account extends ModelAccount {
4
+ transactions: Account.Transactions
5
+ }
5
6
  export namespace Account {
6
- export function from(account: ModelAccount): Account {
7
- return account
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
  }
@@ -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
- transaction: ModelTransaction,
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
@@ -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 = isly.object<Note>({
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
  }
@@ -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
  }
@@ -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 { Organization } from "../../Organization";
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: Organization.Rule[]): Promise<Organization.Rule[] | gracely.Error>;
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,KAA0B;QAC7D,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAsB,oBAAoB,EAAE,KAAK,EAAE;YACxE,YAAY,EAAE,YAAY;SAC1B,CAAC,CAAA;IACH,CAAC;CACD"}
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"}
@@ -0,0 +1,9 @@
1
+ import { gracely } from "gracely";
2
+ import { http } from "cloudly-http";
3
+ import * as rest from "cloudly-rest";
4
+ import { Rule } from "../Rule";
5
+ export declare class Rules extends rest.Collection<gracely.Error> {
6
+ constructor(client: http.Client);
7
+ replace(rule: Rule[]): Promise<Rule[] | gracely.Error>;
8
+ list(): Promise<Rule[] | gracely.Error>;
9
+ }
@@ -0,0 +1,13 @@
1
+ import * as rest from "cloudly-rest";
2
+ export class Rules extends rest.Collection {
3
+ constructor(client) {
4
+ super(client);
5
+ }
6
+ async replace(rule) {
7
+ return this.client.put(`/rule`, rule);
8
+ }
9
+ async list() {
10
+ return this.client.get(`/rule`);
11
+ }
12
+ }
13
+ //# sourceMappingURL=Rules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Rules.js","sourceRoot":"../","sources":["Client/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,IAAY;QACzB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAS,OAAO,EAAE,IAAI,CAAC,CAAA;IAC9C,CAAC;IACD,KAAK,CAAC,IAAI;QACT,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAS,OAAO,CAAC,CAAA;IACxC,CAAC;CACD"}
@@ -6,6 +6,7 @@ import { Accounts } from "./Accounts";
6
6
  import { Cards } from "./Cards";
7
7
  import { Operations } from "./Operations";
8
8
  import { Organizations } from "./Organizations";
9
+ import { Rules } from "./Rules";
9
10
  import { Settlements } from "./Settlements";
10
11
  import { Transactions } from "./Transactions";
11
12
  import { Treasury } from "./Treasury";
@@ -13,15 +14,16 @@ import { Version } from "./Version";
13
14
  export declare class Client extends rest.Client<gracely.Error> {
14
15
  realm?: string;
15
16
  organization?: string;
16
- readonly userwidgets: userwidgets.ClientCollection;
17
17
  readonly accounts: Accounts;
18
+ readonly cards: Cards;
18
19
  readonly operations: Operations;
19
20
  readonly organizations: Organizations;
21
+ readonly rules: Rules;
22
+ readonly settlements: Settlements;
20
23
  readonly transactions: Transactions;
21
24
  readonly treasury: Treasury;
25
+ readonly userwidgets: userwidgets.ClientCollection;
22
26
  readonly version: Version;
23
- readonly cards: Cards;
24
- readonly settlements: Settlements;
25
27
  static create<T = Record<string, any>>(server: string, key: string, load?: (client: http.Client) => T): Client & T;
26
28
  }
27
29
  export declare namespace Client {
@@ -5,6 +5,7 @@ import { Accounts } from "./Accounts";
5
5
  import { Cards } from "./Cards";
6
6
  import { Operations } from "./Operations";
7
7
  import { Organizations } from "./Organizations";
8
+ import { Rules } from "./Rules";
8
9
  import { Settlements } from "./Settlements";
9
10
  import { Transactions } from "./Transactions";
10
11
  import { Treasury } from "./Treasury";
@@ -12,15 +13,16 @@ import { Version } from "./Version";
12
13
  export class Client extends rest.Client {
13
14
  constructor() {
14
15
  super(...arguments);
15
- this.userwidgets = new userwidgets.ClientCollection(this.client, { pathPrefix: "/widgets" });
16
16
  this.accounts = new Accounts(this.client);
17
+ this.cards = new Cards(this.client);
17
18
  this.operations = new Operations(this.client);
18
19
  this.organizations = new Organizations(this.client);
20
+ this.rules = new Rules(this.client);
21
+ this.settlements = new Settlements(this.client);
19
22
  this.transactions = new Transactions(this.client);
20
23
  this.treasury = new Treasury(this.client);
24
+ this.userwidgets = new userwidgets.ClientCollection(this.client, { pathPrefix: "/widgets" });
21
25
  this.version = new Version(this.client);
22
- this.cards = new Cards(this.client);
23
- this.settlements = new Settlements(this.client);
24
26
  }
25
27
  static create(server, key, load) {
26
28
  let httpClient;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,MAAM,OAAO,MAAO,SAAQ,IAAI,CAAC,MAAqB;IAAtD;;QAGU,gBAAW,GAAG,IAAI,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,CAAA;QACvF,aAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI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CAAC,MAAM,CAAC,CAAA;IAa5C,CAAC;IAXA,MAAM,CAAC,MAAM,CAA0B,MAAc,EAAE,GAAW,EAAE,IAAiC;QACpG,IAAI,UAAsC,CAAA;QAC1C,MAAM,MAAM,GAAW,IAAI,MAAM,CAChC,CAAC,UAAU,GAAG,IAAI,IAAI,CAAC,MAAM,CAAgB,MAAM,EAAE,GAAG,EAAE;YACzD,YAAY,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC;SACxG,CAAC,CAAC,CACH,CAAA;QACD,IAAI,IAAI;YACP,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAA;QACxC,OAAO,MAAoB,CAAA;IAC5B,CAAC;CACD"}
@@ -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
  export interface Creatable {
6
6
  name: string;
7
7
  realm: Realm;
@@ -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: isly.fromIs("Rule", Rule.is).array(),
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,EA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A,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/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,UAAU,IAAI,sBAAsB,EAAE,MAAM,cAAc,CAAA;AACnE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAC1D,OAAO,EAAE,SAAS,IAAI,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAChE,OAAO,EA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,qBAAqB,CAAC,EAAE,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC,IAAI,OAAO,KAAK,CAAC,EAAE,IAAI,QAAQ,CAAA;IACtF,CAAC;IAFe,eAAE,KAEjB,CAAA;IACD,SAAgB,aAAa,CAAC,YAAuB;QACpD,OAAO,EAAE,GAAG,YAAY,EAAE,EAAE,EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/D,CAAC;IAFe,0BAAa,gBAE5B,CAAA;IACD,SAAgB,YAAY,CAAC,KAA+B;QAC3D,OAAO,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;IACvC,CAAC;IAFe,yBAAY,eAE3B,CAAA;IAEY,sBAAS,GAAG,qBAAqB,CAAA;IAEjC,uBAAU,GAAG,sBAAsB,CAAA;IAEnC,oBAAO,GAAG,mBAAmB,CAAA;AAK3C,CAAC,EApBgB,YAAY,KAAZ,YAAY,QAoB5B"}
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":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAK3B,MAAM,KAAW,KAAK,CA4BrB;AA5BD,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,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,EA5BgB,KAAK,KAAL,KAAK,QA4BrB"}
1
+ {"version":3,"file":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@ -1,5 +1,31 @@
1
1
  import type { Account as ModelAccount } from "../../Account";
2
- export type Account = ModelAccount;
2
+ export interface Account extends ModelAccount {
3
+ transactions: Account.Transactions;
4
+ }
3
5
  export declare namespace Account {
4
- function from(account: ModelAccount): Account;
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,7 +1,7 @@
1
1
  export var Account;
2
2
  (function (Account) {
3
- function from(account) {
4
- return account;
3
+ function from(account, transactions) {
4
+ return { ...account, transactions };
5
5
  }
6
6
  Account.from = from;
7
7
  })(Account || (Account = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"Account.js","sourceRoot":"../","sources":["Rule/State/Account.ts"],"names":[],"mappings":"AAIA,MAAM,KAAW,OAAO,CAIvB;AAJD,WAAiB,OAAO;IACvB,SAAgB,IAAI,CAAC,OAAqB;QACzC,OAAO,OAAO,CAAA;IACf,CAAC;IAFe,YAAI,OAEnB,CAAA;AACF,CAAC,EAJgB,OAAO,KAAP,OAAO,QAIvB"}
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,WAA6B;QACjD,OAAO,WAAW,CAAA;IACnB,CAAC;IAFe,gBAAI,OAEnB,CAAA;AACF,CAAC,EAJgB,WAAW,KAAX,WAAW,QAI3B"}
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;
@@ -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,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;AAC1C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,WAAW,CAAA;AACnD,OAAO,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAS/D,MAAM,KAAW,KAAK,CAwBrB;AAxBD,WAAiB,KAAK;IACrB,SAAgB,IAAI,CACnB,OAAqB,EACrB,WAA6B,EAC7B,aAA4C,EAC5C,IAAgB;QAEhB,OAAO;YACN,OAAO,EAAE,MAAA,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;YAC9B,aAAa,EAAE,aAAa,IAAI,MAAA,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC;YACjE,IAAI,EAAE,IAAI,IAAI,MAAA,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;YAC7B,WAAW,EAAE,MAAA,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC;SAC1C,CAAA;IACF,CAAC;IAZe,UAAI,OAYnB,CAAA;IAEY,aAAO,GAAG,YAAY,CAAA;IAEtB,aAAO,GAAG,YAAY,CAAA;IAEtB,mBAAa,GAAG,kBAAkB,CAAA;IAElC,UAAI,GAAG,SAAS,CAAA;IAEhB,iBAAW,GAAG,gBAAgB,CAAA;AAC5C,CAAC,EAxBgB,KAAK,KAAL,KAAK,QAwBrB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"../","sources":["Rule/State/index.ts"],"names":[],"mappings":"AAIA,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;AAC1C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,WAAW,CAAA;AACnD,OAAO,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAS/D,MAAM,KAAW,KAAK,CAyBrB;AAzBD,WAAiB,KAAK;IACrB,SAAgB,IAAI,CACnB,OAAqB,EACrB,YAAuC,EACvC,WAAuC,EACvC,aAA4C,EAC5C,IAAgB;QAEhB,OAAO;YACN,OAAO,EAAE,MAAA,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC;YAC5C,WAAW,EAAE,MAAA,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC;YAC1C,aAAa,EAAE,aAAa,IAAI,MAAA,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC;YACjE,IAAI,EAAE,IAAI,IAAI,MAAA,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;SAC7B,CAAA;IACF,CAAC;IAbe,UAAI,OAanB,CAAA;IAEY,aAAO,GAAG,YAAY,CAAA;IAEtB,aAAO,GAAG,YAAY,CAAA;IAEtB,mBAAa,GAAG,kBAAkB,CAAA;IAElC,UAAI,GAAG,SAAS,CAAA;IAEhB,iBAAW,GAAG,gBAAgB,CAAA;AAC5C,CAAC,EAzBgB,KAAK,KAAL,KAAK,QAyBrB"}
@@ -9,6 +9,7 @@ export declare namespace Note {
9
9
  interface Creatable {
10
10
  text?: string;
11
11
  action?: "approve" | "reject";
12
+ flags?: string[];
12
13
  }
13
14
  namespace Creatable {
14
15
  const type: isly.object.ExtendableType<Creatable>;
@@ -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 = isly.object({
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;IAKD,IAAiB,SAAS,CAMzB;IAND,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;SACrD,CAAC,CAAA;QACW,YAAE,GAAG,UAAA,IAAI,CAAC,EAAE,CAAA;IAC1B,CAAC,EANgB,SAAS,GAAT,cAAS,KAAT,cAAS,QAMz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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,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C,QAAQ,CAAC,CAAC,CAAC,CAAA;QACzC,IAAI,IAAI,IAAI,WAAW;YACtB,OAAO,WAAW,CAAC,EAAE,CAAA;QACtB,IAAI,YAAY,IAAI,WAAW;YAC9B,OAAO,WAAW,CAAC,UAAU,CAAA;QAC9B,OAAO;YACN,YAAY,EAAE,YAAY;YAC1B,SAAS,EAAE,SAAS;YACpB,EAAE,EAAE,EAAE;YACN,OAAO,EAAE,MAAM;YACf,GAAG,WAAW;YACd,UAAU,EAAE,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;YAC3E,MAAM,EAAE,SAAS;YACjB,KAAK,EAAE,EAAE;YACT,QAAQ,EAAE,EAAE;YACZ,KAAK,EAAE,EAAE;SACT,CAAA;IACF,CAAC;IAvBe,wBAAY,eAuB3B,CAAA;IACD,SAAgB,YAAY,CAAC,KAA+B;QAC3D,OAAO,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;IACvC,CAAC;IAFe,wBAAY,eAE3B,CAAA;IAGY,qBAAS,GAAG,oBAAoB,CAAA;IAEhC,oBAAQ,GAAG,mBAAmB,CAAA;IAG9B,gBAAI,GAAG,eAAe,CAAA;AAIpC,CAAC,EAtFgB,WAAW,KAAX,WAAW,QAsF3B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pax2pay/model-banking",
3
- "version": "0.1.138",
3
+ "version": "0.1.140",
4
4
  "description": "Library containing data model types and functions for the Pax2Pay Banking API.",
5
5
  "author": "Pax2Pay Ltd",
6
6
  "license": "MIT",
@@ -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,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