@pax2pay/model-banking 0.1.612 → 0.1.614

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 (158) hide show
  1. package/Amount.ts +0 -6
  2. package/Card/Changeable.ts +0 -13
  3. package/Card/Creatable.ts +0 -28
  4. package/Card/Expiry.ts +0 -14
  5. package/Card/Operation/Authorization.ts +1 -13
  6. package/Card/Operation/Card.ts +0 -14
  7. package/Card/Operation/index.ts +0 -5
  8. package/Card/Preset.ts +0 -5
  9. package/Card/Restriction/Merchant.ts +0 -2
  10. package/Card/Restriction/index.ts +0 -8
  11. package/Card/Restriction/merchants/Merchant.ts +2 -2
  12. package/Card/Scheme.ts +0 -5
  13. package/Card/index.ts +0 -37
  14. package/Client/Transactions/index.ts +0 -21
  15. package/Rail/index.ts +0 -2
  16. package/Realm.ts +0 -5
  17. package/Rule/Base.ts +0 -26
  18. package/Rule/Other.ts +0 -6
  19. package/Rule/type.ts +0 -5
  20. package/Treasury/Snapshot/Reconciliation.ts +4 -0
  21. package/Treasury/Snapshot/index.ts +3 -1
  22. package/Warning/Snapshot/Reconciliation.ts +20 -0
  23. package/Warning/Snapshot/index.ts +15 -9
  24. package/dist/cjs/Amount.d.ts +0 -2
  25. package/dist/cjs/Amount.js +0 -3
  26. package/dist/cjs/Amount.js.map +1 -1
  27. package/dist/cjs/Card/Changeable.d.ts +0 -2
  28. package/dist/cjs/Card/Changeable.js +0 -13
  29. package/dist/cjs/Card/Changeable.js.map +1 -1
  30. package/dist/cjs/Card/Creatable.d.ts +0 -2
  31. package/dist/cjs/Card/Creatable.js +0 -28
  32. package/dist/cjs/Card/Creatable.js.map +1 -1
  33. package/dist/cjs/Card/Expiry.d.ts +0 -2
  34. package/dist/cjs/Card/Expiry.js +0 -11
  35. package/dist/cjs/Card/Expiry.js.map +1 -1
  36. package/dist/cjs/Card/Operation/Authorization.d.ts +0 -2
  37. package/dist/cjs/Card/Operation/Authorization.js +0 -12
  38. package/dist/cjs/Card/Operation/Authorization.js.map +1 -1
  39. package/dist/cjs/Card/Operation/Card.d.ts +0 -2
  40. package/dist/cjs/Card/Operation/Card.js +0 -14
  41. package/dist/cjs/Card/Operation/Card.js.map +1 -1
  42. package/dist/cjs/Card/Operation/index.d.ts +0 -2
  43. package/dist/cjs/Card/Operation/index.js +0 -5
  44. package/dist/cjs/Card/Operation/index.js.map +1 -1
  45. package/dist/cjs/Card/Preset.d.ts +0 -2
  46. package/dist/cjs/Card/Preset.js +0 -5
  47. package/dist/cjs/Card/Preset.js.map +1 -1
  48. package/dist/cjs/Card/Restriction/Merchant.d.ts +0 -2
  49. package/dist/cjs/Card/Restriction/Merchant.js +0 -2
  50. package/dist/cjs/Card/Restriction/Merchant.js.map +1 -1
  51. package/dist/cjs/Card/Restriction/index.d.ts +0 -2
  52. package/dist/cjs/Card/Restriction/index.js +0 -8
  53. package/dist/cjs/Card/Restriction/index.js.map +1 -1
  54. package/dist/cjs/Card/Restriction/merchants/Merchant.d.ts +1 -2
  55. package/dist/cjs/Card/Restriction/merchants/Merchant.js +8 -8
  56. package/dist/cjs/Card/Restriction/merchants/Merchant.js.map +1 -1
  57. package/dist/cjs/Card/Scheme.d.ts +0 -2
  58. package/dist/cjs/Card/Scheme.js +0 -5
  59. package/dist/cjs/Card/Scheme.js.map +1 -1
  60. package/dist/cjs/Card/index.d.ts +0 -2
  61. package/dist/cjs/Card/index.js +0 -38
  62. package/dist/cjs/Card/index.js.map +1 -1
  63. package/dist/cjs/Client/Transactions/index.d.ts +0 -16
  64. package/dist/cjs/Client/Transactions/index.js +0 -27
  65. package/dist/cjs/Client/Transactions/index.js.map +1 -1
  66. package/dist/cjs/Rail/index.d.ts +0 -2
  67. package/dist/cjs/Rail/index.js +0 -2
  68. package/dist/cjs/Rail/index.js.map +1 -1
  69. package/dist/cjs/Realm.d.ts +0 -2
  70. package/dist/cjs/Realm.js +0 -5
  71. package/dist/cjs/Realm.js.map +1 -1
  72. package/dist/cjs/Rule/Base.d.ts +0 -4
  73. package/dist/cjs/Rule/Base.js +0 -26
  74. package/dist/cjs/Rule/Base.js.map +1 -1
  75. package/dist/cjs/Rule/Other.d.ts +0 -3
  76. package/dist/cjs/Rule/Other.js +0 -6
  77. package/dist/cjs/Rule/Other.js.map +1 -1
  78. package/dist/cjs/Rule/type.js.map +1 -1
  79. package/dist/cjs/Treasury/Snapshot/Reconciliation.d.ts +4 -0
  80. package/dist/cjs/Treasury/Snapshot/Reconciliation.js +3 -0
  81. package/dist/cjs/Treasury/Snapshot/Reconciliation.js.map +1 -0
  82. package/dist/cjs/Treasury/Snapshot/index.d.ts +3 -0
  83. package/dist/cjs/Treasury/Snapshot/index.js.map +1 -1
  84. package/dist/cjs/Warning/Snapshot/Reconciliation.d.ts +15 -0
  85. package/dist/cjs/Warning/Snapshot/Reconciliation.js +16 -0
  86. package/dist/cjs/Warning/Snapshot/Reconciliation.js.map +1 -0
  87. package/dist/cjs/Warning/Snapshot/index.d.ts +6 -4
  88. package/dist/cjs/Warning/Snapshot/index.js +6 -4
  89. package/dist/cjs/Warning/Snapshot/index.js.map +1 -1
  90. package/dist/cjs/Warning/index.d.ts +1 -1
  91. package/dist/mjs/Amount.d.ts +0 -2
  92. package/dist/mjs/Amount.js +0 -3
  93. package/dist/mjs/Amount.js.map +1 -1
  94. package/dist/mjs/Card/Changeable.d.ts +0 -2
  95. package/dist/mjs/Card/Changeable.js +0 -13
  96. package/dist/mjs/Card/Changeable.js.map +1 -1
  97. package/dist/mjs/Card/Creatable.d.ts +0 -2
  98. package/dist/mjs/Card/Creatable.js +0 -28
  99. package/dist/mjs/Card/Creatable.js.map +1 -1
  100. package/dist/mjs/Card/Expiry.d.ts +0 -2
  101. package/dist/mjs/Card/Expiry.js +0 -11
  102. package/dist/mjs/Card/Expiry.js.map +1 -1
  103. package/dist/mjs/Card/Operation/Authorization.d.ts +0 -2
  104. package/dist/mjs/Card/Operation/Authorization.js +0 -12
  105. package/dist/mjs/Card/Operation/Authorization.js.map +1 -1
  106. package/dist/mjs/Card/Operation/Card.d.ts +0 -2
  107. package/dist/mjs/Card/Operation/Card.js +0 -14
  108. package/dist/mjs/Card/Operation/Card.js.map +1 -1
  109. package/dist/mjs/Card/Operation/index.d.ts +0 -2
  110. package/dist/mjs/Card/Operation/index.js +0 -5
  111. package/dist/mjs/Card/Operation/index.js.map +1 -1
  112. package/dist/mjs/Card/Preset.d.ts +0 -2
  113. package/dist/mjs/Card/Preset.js +0 -5
  114. package/dist/mjs/Card/Preset.js.map +1 -1
  115. package/dist/mjs/Card/Restriction/Merchant.d.ts +0 -2
  116. package/dist/mjs/Card/Restriction/Merchant.js +0 -2
  117. package/dist/mjs/Card/Restriction/Merchant.js.map +1 -1
  118. package/dist/mjs/Card/Restriction/index.d.ts +0 -2
  119. package/dist/mjs/Card/Restriction/index.js +0 -8
  120. package/dist/mjs/Card/Restriction/index.js.map +1 -1
  121. package/dist/mjs/Card/Restriction/merchants/Merchant.d.ts +1 -2
  122. package/dist/mjs/Card/Restriction/merchants/Merchant.js +2 -2
  123. package/dist/mjs/Card/Restriction/merchants/Merchant.js.map +1 -1
  124. package/dist/mjs/Card/Scheme.d.ts +0 -2
  125. package/dist/mjs/Card/Scheme.js +0 -5
  126. package/dist/mjs/Card/Scheme.js.map +1 -1
  127. package/dist/mjs/Card/index.d.ts +0 -2
  128. package/dist/mjs/Card/index.js +0 -38
  129. package/dist/mjs/Card/index.js.map +1 -1
  130. package/dist/mjs/Client/Transactions/index.d.ts +0 -16
  131. package/dist/mjs/Client/Transactions/index.js +0 -27
  132. package/dist/mjs/Client/Transactions/index.js.map +1 -1
  133. package/dist/mjs/Rail/index.d.ts +0 -2
  134. package/dist/mjs/Rail/index.js +0 -2
  135. package/dist/mjs/Rail/index.js.map +1 -1
  136. package/dist/mjs/Realm.d.ts +0 -2
  137. package/dist/mjs/Realm.js +0 -5
  138. package/dist/mjs/Realm.js.map +1 -1
  139. package/dist/mjs/Rule/Base.d.ts +0 -4
  140. package/dist/mjs/Rule/Base.js +0 -26
  141. package/dist/mjs/Rule/Base.js.map +1 -1
  142. package/dist/mjs/Rule/Other.d.ts +0 -3
  143. package/dist/mjs/Rule/Other.js +0 -6
  144. package/dist/mjs/Rule/Other.js.map +1 -1
  145. package/dist/mjs/Rule/type.js.map +1 -1
  146. package/dist/mjs/Treasury/Snapshot/Reconciliation.d.ts +4 -0
  147. package/dist/mjs/Treasury/Snapshot/Reconciliation.js +2 -0
  148. package/dist/mjs/Treasury/Snapshot/Reconciliation.js.map +1 -0
  149. package/dist/mjs/Treasury/Snapshot/index.d.ts +3 -0
  150. package/dist/mjs/Treasury/Snapshot/index.js.map +1 -1
  151. package/dist/mjs/Warning/Snapshot/Reconciliation.d.ts +15 -0
  152. package/dist/mjs/Warning/Snapshot/Reconciliation.js +13 -0
  153. package/dist/mjs/Warning/Snapshot/Reconciliation.js.map +1 -0
  154. package/dist/mjs/Warning/Snapshot/index.d.ts +6 -4
  155. package/dist/mjs/Warning/Snapshot/index.js +6 -4
  156. package/dist/mjs/Warning/Snapshot/index.js.map +1 -1
  157. package/dist/mjs/Warning/index.d.ts +1 -1
  158. package/package.json +1 -6
package/Amount.ts CHANGED
@@ -1,7 +1,5 @@
1
1
  import { isoly } from "isoly"
2
- import { isoly as isoly2 } from "isoly2"
3
2
  import { isly } from "isly"
4
- import { isly as isly2 } from "isly2"
5
3
  import { Amounts } from "./Amounts"
6
4
 
7
5
  export type Amount = [isoly.Currency, number]
@@ -11,8 +9,4 @@ export namespace Amount {
11
9
  return !amount ? {} : Object.fromEntries<number>([amount])
12
10
  }
13
11
  export const type = isly.tuple<Amount>(isly.string(isoly.Currency.values), isly.number())
14
- export const type2 = isly2.tuple<Amount>(
15
- isoly2.Currency.type,
16
- isly2.number().rename("Amount").describe("Amount in a specified currency.")
17
- )
18
12
  }
@@ -1,7 +1,5 @@
1
1
  import { isoly } from "isoly"
2
- import { isoly as isoly2 } from "isoly2"
3
2
  import { isly } from "isly"
4
- import { isly as isly2 } from "isly2"
5
3
  import { Amount } from "../Amount"
6
4
  import { Meta } from "./Meta"
7
5
 
@@ -15,15 +13,4 @@ export namespace Changeable {
15
13
  limit: isly.tuple(isly.fromIs("isoly.Currency", isoly.Currency.is), isly.number()).optional(),
16
14
  meta: isly.fromIs("Card.Meta", Meta.is).optional(),
17
15
  })
18
- export const type2: isly2.Object<Changeable> = isly2
19
- .object<Changeable>({
20
- limit: isly2
21
- .tuple(isoly2.Currency.type, isly2.number())
22
- .optional()
23
- .rename("Limit")
24
- .describe("The new limit of the card."),
25
- meta: isly2.from("Card.Meta", Meta.is).optional().rename("Meta").describe("The new meta data of the card."),
26
- })
27
- .rename("Changeable")
28
- .describe("Changeable card properties.")
29
16
  }
package/Card/Creatable.ts CHANGED
@@ -1,7 +1,5 @@
1
1
  import { isoly } from "isoly"
2
- import { isoly as isoly2 } from "isoly2"
3
2
  import { isly } from "isly"
4
- import { isly as isly2 } from "isly2"
5
3
  import { Amount } from "../Amount"
6
4
  import type { Rule } from "../Rule"
7
5
  import { type as ruleType } from "../Rule/type"
@@ -37,30 +35,4 @@ export namespace Creatable {
37
35
  key: isly.string().optional(),
38
36
  restricted: isly.object<Required<Creatable>["restricted"]>({ to: Restriction.type.optional() }).optional(),
39
37
  })
40
- export const type2 = isly2.object<Creatable>({
41
- account: isly2.string().rename("Account").describe("The account id the card was created on."),
42
- number: isly2.string().optional().rename("Number").describe("The card identifier of the user of the api."),
43
- preset: Preset.type2,
44
- details: isly2
45
- .object({ expiry: Expiry.type2, holder: isly2.string() })
46
- .rename("Details")
47
- .describe("The card details, the information that will be displayed on the card."),
48
- limit: isly2
49
- .tuple(isoly2.Currency.type, isly2.number().rename("Amount").describe("Amount in a specified currency."))
50
- .rename("Limit")
51
- .describe("Maximum amount that can be spent on the card."),
52
- rules: isly2
53
- .from("Rule", ruleType.is)
54
- .array()
55
- .optional()
56
- .rename("Rules")
57
- .describe("Card rules that applies to authorizations made with the card."),
58
- meta: isly2.from("Meta", Meta.is).optional(),
59
- key: isly2.string().optional(),
60
- restricted: isly2
61
- .object<Required<Creatable>["restricted"]>({ to: Restriction.type2.optional() })
62
- .optional()
63
- .rename("Restrictions")
64
- .describe("Set of restrictions that apply to the card."),
65
- })
66
38
  }
package/Card/Expiry.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { isoly } from "isoly"
2
2
  import { isly } from "isly"
3
- import { isly as isly2 } from "isly2"
4
3
 
5
4
  const year = [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40] as const
6
5
  type Year = (typeof year)[number]
@@ -11,19 +10,6 @@ type Month = (typeof month)[number]
11
10
  export type Expiry = [Year, Month]
12
11
  export namespace Expiry {
13
12
  export const type = isly.tuple<Expiry>(isly.number([...year]), isly.number([...month])) // Deconstructing to remove readonly.
14
- export const type2: isly2.Tuple<Expiry> = isly2
15
- .tuple<Expiry>(
16
- isly2
17
- .number("value", ...year)
18
- .rename("Year")
19
- .describe("Year of expiry."),
20
- isly2
21
- .number("value", ...month)
22
- .rename("Month")
23
- .describe("Month of expiry.")
24
- )
25
- .rename("Expiry")
26
- .describe("The year and month the card is valid ([yy, mm]).")
27
13
  export function toDateTime(expiry: Expiry): isoly.DateTime {
28
14
  return isoly.DateTime.nextMonth(
29
15
  "20" + expiry[0].toString() + "-" + expiry[1].toString().padStart(2, "0") + "-01T00:00:01.000Z"
@@ -1,7 +1,6 @@
1
1
  import { isoly } from "isoly"
2
- import { isoly as isoly2 } from "isoly2"
3
2
  import { isly } from "isly"
4
- import { isly as isly2 } from "isly2"
3
+
5
4
  export interface Authorization {
6
5
  type: "authorization"
7
6
  id: string
@@ -9,7 +8,6 @@ export interface Authorization {
9
8
  reason?: string
10
9
  created: isoly.DateTime
11
10
  }
12
-
13
11
  export namespace Authorization {
14
12
  export const statuses = ["created", "confirmed", "refunded", "captured", "cancelled"] as const
15
13
  export type Status = (typeof statuses)[number]
@@ -20,14 +18,4 @@ export namespace Authorization {
20
18
  reason: isly.string().optional(),
21
19
  created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
22
20
  })
23
- export const type2 = isly2.object<Authorization>({
24
- type: isly2.string("value", "authorization").rename("Operation.Type").describe("Type of operation."),
25
- id: isly2.string().rename("Id").describe("The id of the operation."),
26
- status: isly2
27
- .string("value", ...statuses)
28
- .rename("Status")
29
- .describe("The updated status of the operation."),
30
- reason: isly2.string().optional().rename("Reason").describe("The reason for the status change."),
31
- created: isoly2.DateTime.type.describe("The time of the operation."),
32
- })
33
21
  }
@@ -1,7 +1,5 @@
1
1
  import { isoly } from "isoly"
2
- import { isoly as isoly2 } from "isoly2"
3
2
  import { isly } from "isly"
4
- import { isly as isly2 } from "isly2"
5
3
  import { Changeable } from "../Changeable"
6
4
 
7
5
  export interface Card {
@@ -20,16 +18,4 @@ export namespace Card {
20
18
  from: Changeable.type.optional(),
21
19
  created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
22
20
  })
23
- export const type2: isly2.Object<Card> = isly2
24
- .object<Card>({
25
- type: isly2.string("value", "card").rename("Type").describe("Type of operation."),
26
- status: isly2
27
- .string("value", ...statuses)
28
- .rename("Status")
29
- .describe("The updated status of the card."),
30
- from: Changeable.type2.optional(),
31
- created: isoly2.DateTime.type.rename("Created").describe("The time of the operation."),
32
- })
33
- .describe("A card operation.")
34
- .rename("Operation.Card")
35
21
  }
@@ -1,6 +1,5 @@
1
1
  import { isoly } from "isoly"
2
2
  import { isly } from "isly"
3
- import { isly as isly2 } from "isly2"
4
3
  import { Authorization } from "../../Authorization"
5
4
  import { Entry } from "../../Settlement/Entry"
6
5
  import { Authorization as OperationAuthorization } from "./Authorization"
@@ -28,8 +27,4 @@ export namespace Operation {
28
27
  }
29
28
  }
30
29
  export const type = isly.union(Card.type, OperationAuthorization.type)
31
- export const type2: isly2.Union<Operation> = isly2
32
- .union<Operation>(Card.type2, OperationAuthorization.type2)
33
- .rename("Operation")
34
- .describe("An operation performed on a card.")
35
30
  }
package/Card/Preset.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { isly } from "isly"
2
- import { isly as isly2 } from "isly2"
3
2
  import { Realm } from "../Realm"
4
3
  import { Stack } from "./Stack"
5
4
 
@@ -25,10 +24,6 @@ export namespace Preset {
25
24
  "test-diners-175",
26
25
  ] as const
27
26
  export const type = isly.string<Preset>(names)
28
- export const type2 = isly2
29
- .string<Preset>("value", ...names)
30
- .rename("Preset")
31
- .describe("Card configuration (iin/scheme/interchange).")
32
27
  export const forRealm: Record<Realm, Preset[]> = {
33
28
  test: ["test-pg-150", "test-pg-200", "test-ta-mc-200", "test-ta-pg-200", "test-ta-pg-bc-200", "test-diners-175"],
34
29
  uk: [
@@ -1,5 +1,4 @@
1
1
  import { isly } from "isly"
2
- import { isly as isly2 } from "isly2"
3
2
  import { typedly } from "typedly"
4
3
  import { Rail } from "../../Rail"
5
4
  import { merchants } from "./merchants"
@@ -9,7 +8,6 @@ export type Merchant = (typeof Merchant.values)[number]
9
8
  export namespace Merchant {
10
9
  export const values = typedly.Object.keys(merchants)
11
10
  export const type = isly.string<Merchant>(values)
12
- export const type2 = isly2.string<Merchant>("value", ...values)
13
11
  export function check(merchant: Merchant, counterpart: Rail.Address.Card.Counterpart): boolean {
14
12
  const attribute: Attribute = merchants[merchant]
15
13
  let result: boolean
@@ -1,5 +1,4 @@
1
1
  import { isly } from "isly"
2
- import { isly as isly2 } from "isly2"
3
2
  import type { Transaction } from "../../Transaction"
4
3
  import { Merchant as RestrictionsMerchant } from "./Merchant"
5
4
 
@@ -9,13 +8,6 @@ export interface Restriction {
9
8
  export namespace Restriction {
10
9
  export import Merchant = RestrictionsMerchant
11
10
  export const type = isly.object<Restriction>({ merchants: Merchant.type.array().optional() })
12
- export const type2 = isly2.object<Restriction>({
13
- merchants: Merchant.type2
14
- .array()
15
- .optional()
16
- .rename("Merchants")
17
- .describe("List of merchants that the card can be used with."),
18
- })
19
11
  export function check(
20
12
  restrictions: Restriction,
21
13
  transaction: Transaction.Creatable.CardTransaction | Transaction.PreTransaction.Authorization
@@ -1,4 +1,4 @@
1
- import { isly } from "isly2"
1
+ import { isly } from "isly"
2
2
 
3
3
  export interface Merchant {
4
4
  name: string
@@ -23,6 +23,6 @@ export namespace Merchant {
23
23
  startsWith: value.startsWith && (Array.isArray(value.startsWith) ? value.startsWith : [value.startsWith]),
24
24
  contains: value.contains && (Array.isArray(value.contains) ? value.contains : [value.contains]),
25
25
  }
26
- return type.prune(result)
26
+ return type.get(result)
27
27
  }
28
28
  }
package/Card/Scheme.ts CHANGED
@@ -1,12 +1,7 @@
1
1
  import { isly } from "isly"
2
- import { isly as isly2 } from "isly2"
3
2
 
4
3
  export type Scheme = (typeof Scheme.schemes)[number]
5
4
  export namespace Scheme {
6
5
  export const schemes = ["mastercard", "diners", "visa"] as const
7
6
  export const type = isly.string<Scheme>(schemes)
8
- export const type2 = isly2
9
- .string<Scheme>("value", ...schemes)
10
- .rename("Scheme")
11
- .describe("Card scheme.")
12
7
  }
package/Card/index.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { isoly } from "isoly"
2
2
  import { isly } from "isly"
3
- import { isly as isly2 } from "isly2"
4
3
  import { Amount } from "../Amount"
5
4
  import { Realm } from "../Realm"
6
5
  import { Report } from "../Report"
@@ -76,42 +75,6 @@ export namespace Card {
76
75
  meta: isly.fromIs("Card.Meta", CardMeta.is).optional(),
77
76
  restricted: isly.object<Required<Card>["restricted"]>({ to: CardRestriction.type.optional() }).optional(),
78
77
  })
79
- export const type2: isly2.Object<Card> = isly2
80
- .object<Card>({
81
- id: isly2.string().rename("Id").describe("Unique 16 character base 64 identifier."),
82
- number: isly2.string().optional().rename("Number").describe("Api users identifier."),
83
- created: isly2.string().rename("Created").describe("Date and time of creation."),
84
- organization: isly2.string().rename("Organization").describe("Organization code."),
85
- realm: Realm.type2,
86
- account: isly2.string().rename("Account").describe("Account identifier."),
87
- preset: CardPreset.type2,
88
- scheme: CardScheme.type2,
89
- reference: isly2.string().rename("Reference").describe("Reference to external system."),
90
- details: isly2.object<Card["details"]>({
91
- iin: isly2.string().rename("Iin").describe("First 6-8 numbers of the pan."),
92
- last4: isly2.string().rename("Last4").describe("Last four digits of pan."),
93
- expiry: CardExpiry.type2,
94
- holder: isly2.string().rename("Holder").describe("Card holder name."),
95
- token: isly2.string().optional().rename("Token").describe("Encrypted token of the card."),
96
- }),
97
- limit: Amount.type2.rename("Limit").describe("Maximum amount that can be spent on the card."),
98
- spent: Amount.type2.rename("Spent").describe("Amount spent on the card."),
99
- status: isly2.string("value", ["active", "cancelled"]).rename("Status").describe("Current card status."),
100
- history: CardOperation.type2.array().rename("History").describe("Card operation history."),
101
- rules: isly2
102
- .from("Rule", ruleType.is)
103
- .array()
104
- .rename("Rules")
105
- .describe("Card rules that applies to authorizations made with the card."),
106
- meta: isly2.from("Card.Meta", CardMeta.is).optional().rename("Meta").describe("Additional card information."),
107
- restricted: isly2
108
- .object<Required<Card>["restricted"]>({ to: CardRestriction.type2.optional() })
109
- .optional()
110
- .rename("Restrictions")
111
- .describe("Set of restrictions that apply to the card."),
112
- })
113
- .rename("Card")
114
- .describe("Card information.")
115
78
  const csvMap: Record<string, (card: Card) => string | number | undefined> = {
116
79
  id: card => card.id,
117
80
  created: card => readableDate(card.created),
@@ -1,7 +1,6 @@
1
1
  import { gracely } from "gracely"
2
2
  import { isoly } from "isoly"
3
3
  import { http } from "cloudly-http"
4
- import { isly } from "isly2"
5
4
  import { Card } from "../../Card"
6
5
  import { Operation } from "../../Operation"
7
6
  import { Rail } from "../../Rail"
@@ -62,24 +61,4 @@ export namespace Transactions {
62
61
  rail?: Rail
63
62
  type?: Transaction.Types
64
63
  }
65
- export namespace Query {
66
- export const type = isly.object({
67
- id: isly.string().optional(),
68
- account: isly.string().optional(),
69
- limit: isly.number().optional(),
70
- cursor: isly.string().optional(),
71
- start: isly.string().optional(),
72
- end: isly.string().optional(),
73
- currency: isly.string().optional(),
74
- organization: isly.string().optional(),
75
- rail: Rail.type2.optional(),
76
- type: isly.string("value", ...Transaction.types).optional(),
77
- })
78
- export function parse(query: string | http.Request["search"]): Query {
79
- if (typeof query == "string") {
80
- query = query ? http.Search.parse(query.replace("?", "")) : {}
81
- } // search.parse does not support empty string
82
- return type.prune(query) ?? {}
83
- }
84
- }
85
64
  }
package/Rail/index.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { isly } from "isly"
2
- import { isly as isly2 } from "isly2"
3
2
  import { Address as RailAddress } from "./Address"
4
3
 
5
4
  export type Rail = (typeof Rail.rails)[number]
@@ -18,6 +17,5 @@ export namespace Rail {
18
17
  "credit",
19
18
  ] as const
20
19
  export const type = isly.string<Rail>(rails)
21
- export const type2 = isly2.string<Rail>("value", ...rails)
22
20
  export import Address = RailAddress
23
21
  }
package/Realm.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { isoly } from "isoly"
2
2
  import { isly } from "isly"
3
- import { isly as isly2 } from "isly2"
4
3
  import { Supplier as modelSupplier } from "./Supplier"
5
4
  import { zod } from "./zod"
6
5
 
@@ -10,10 +9,6 @@ export namespace Realm {
10
9
  export const realms = ["test", "uk", "eea"] as const
11
10
  export const type = isly.string<Realm>(realms)
12
11
  export const typeZod = zod.enum(realms)
13
- export const type2 = isly2
14
- .string<Realm>("value", ...realms)
15
- .rename("Realm")
16
- .describe("Financial jurisdiction.")
17
12
  export function toString(): string {
18
13
  return realms.toString().replaceAll(",", ", ") + "."
19
14
  }
package/Rule/Base.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { isly } from "isly"
2
- import { isly as isly2 } from "isly2"
3
2
  import { Preset } from "../Card/Preset"
4
3
 
5
4
  export interface Base {
@@ -18,10 +17,6 @@ export namespace Base {
18
17
  export namespace Kind {
19
18
  export const values = ["authorization", "outbound", "inbound", "capture", "refund"] as const
20
19
  export const type = isly.string<Kind>(values)
21
- export const type2 = isly2
22
- .string<Kind>("value", ...values)
23
- .rename("Kind")
24
- .describe("The type of the rule.")
25
20
  export function is(kind: Kind, rule: Base, groups: string[] | undefined, preset: Preset | undefined): boolean {
26
21
  const applyRuleForGroup =
27
22
  !rule.groups || rule.groups.some(ruleGroup => groups?.some(organizationGroup => organizationGroup == ruleGroup))
@@ -33,10 +28,6 @@ export namespace Base {
33
28
  export namespace Category {
34
29
  export const values = ["fincrime", "product", "customer"] as const
35
30
  export const type = isly.string<Category>(values)
36
- export const type2 = isly2
37
- .string<Category>("value", ...values)
38
- .rename("Category")
39
- .describe("The category of the rule.")
40
31
  }
41
32
  export const type = isly.object<Base>({
42
33
  code: isly.string(/^[a-z0-9\-_]+$/),
@@ -49,21 +40,4 @@ export namespace Base {
49
40
  groups: isly.string().array().optional(),
50
41
  presets: Preset.type.array().optional(),
51
42
  })
52
- export const type2 = isly2.object<Base>({
53
- code: isly2
54
- .string("value", /^[a-z0-9\-_]+$/)
55
- .rename("Code")
56
- .describe("The unique identifier of the rule."),
57
- name: isly2.string().rename("Name").describe("The name of the rule."),
58
- description: isly2.string().rename("Description").describe("The description of the rule."),
59
- type: Kind.type2,
60
- category: Category.type2,
61
- condition: isly2
62
- .string()
63
- .rename("Condition")
64
- .describe("The condition to evaluate, determines if the action is applied or not."),
65
- flags: isly2.string().array().rename("Flags").describe("The flags to set when the rule is applied."),
66
- groups: isly2.string().array().optional().rename("Groups").describe("The groups the rule applies to."),
67
- presets: Preset.type2.array().optional().rename("Presets").describe("The presets the rule applies to."),
68
- })
69
43
  }
package/Rule/Other.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { isoly } from "isoly"
2
2
  import { isly } from "isly"
3
- import { isly as isly2 } from "isly2"
4
3
  import type { Note } from "../Transaction/Note"
5
4
  import { Base } from "./Base"
6
5
  import { control } from "./control"
@@ -14,13 +13,8 @@ export namespace Other {
14
13
  export namespace Action {
15
14
  export const values = ["review", "reject", "flag"] as const
16
15
  export const type = isly.string<Action>(values)
17
- export const type2 = isly2
18
- .string<Action>("value", ...values)
19
- .rename("Action")
20
- .describe("The action to take when the rule is applied.")
21
16
  }
22
17
  export const type = Base.type.extend<Other>({ action: Action.type })
23
- export const type2: isly2.Object<Other> = Base.type2.extend<Other>({ action: Action.type2 })
24
18
  export function evaluate(
25
19
  rules: Other[],
26
20
  state: State
package/Rule/type.ts CHANGED
@@ -1,8 +1,3 @@
1
- // import { isly as isly2 } from "isly2"
2
1
  import { Other } from "./Other"
3
2
 
4
3
  export const type = Other.type
5
- // TODO: Implement type2
6
- // export const type2 = isly2
7
- // .union<Rule, Other, Score, Charge.Api, Reserve>(Other.type2, Score.type2, Charge.Api.type2, Reserve.type2)
8
- // .describe("Changes what how the rules is applied.")
@@ -0,0 +1,4 @@
1
+ export interface Reconciliation {
2
+ correct: number
3
+ incorrect: number
4
+ }
@@ -8,10 +8,11 @@ import { Account as SnapshotAccount } from "./Account"
8
8
  import { Emoney as SnapshotEmoney } from "./Emoney"
9
9
  import { Fiat as SnapshotFiat } from "./Fiat"
10
10
  import { funding as snapshotFunding } from "./funding"
11
+ import { Reconciliation as SnapshotReconciliation } from "./Reconciliation"
11
12
 
12
13
  export interface Snapshot {
13
14
  warnings: Warning.Snapshot[]
14
- emoney: Balance.Extended & { total?: number }
15
+ emoney: Balance.Extended & { total?: number; reconciliation?: Snapshot.Reconciliation }
15
16
  currency: isoly.Currency
16
17
  supplier: Supplier
17
18
  fiat: {
@@ -26,6 +27,7 @@ export interface Snapshot {
26
27
  }
27
28
  export namespace Snapshot {
28
29
  export import funding = snapshotFunding
30
+ export type Reconciliation = SnapshotReconciliation
29
31
  export type Emoney = SnapshotEmoney
30
32
  export type Fiat = SnapshotFiat
31
33
  export import Account = SnapshotAccount
@@ -0,0 +1,20 @@
1
+ import { isoly } from "isoly"
2
+ import { isly } from "isly"
3
+ import { Base } from "../Base"
4
+
5
+ export interface Reconciliation extends Base {
6
+ type: "reconciliation"
7
+ severity?: "high"
8
+ delta: { account: number; operation: number }
9
+ currency: isoly.Currency
10
+ account: string
11
+ }
12
+ export namespace Reconciliation {
13
+ export const type = Base.type.extend<Reconciliation>({
14
+ type: isly.string("reconciliation"),
15
+ severity: isly.string(["high"]).optional(),
16
+ currency: isly.string(),
17
+ delta: isly.object({ account: isly.number(), operation: isly.number() }),
18
+ account: isly.string(),
19
+ })
20
+ }
@@ -5,31 +5,37 @@ import { MissingEmoney as WarningMissingEmoney } from "./MissingEmoney"
5
5
  import { MissingFiat as WarningMissingFiat } from "./MissingFiat"
6
6
  import { MissingTransaction as WarningMissingTransaction } from "./MissingTransaction"
7
7
  import { Overdraft as WarningOverdraft } from "./Overdraft"
8
+ import { Reconciliation as WarningReconciliation } from "./Reconciliation"
8
9
  import { StaleFiat as WarningStaleFiat } from "./StaleFiat"
9
10
 
10
11
  export type Snapshot =
11
- | Snapshot.Overdraft
12
- | Snapshot.StaleFiat
12
+ | Snapshot.DeltaFiat
13
13
  | Snapshot.MissingBuffer
14
14
  | Snapshot.MissingEmoney
15
15
  | Snapshot.MissingFiat
16
16
  | Snapshot.MissingTransaction
17
- | Snapshot.DeltaFiat
17
+ | Snapshot.Overdraft
18
+ | Snapshot.Reconciliation
19
+ | Snapshot.StaleFiat
20
+
18
21
  export namespace Snapshot {
19
- export import Overdraft = WarningOverdraft
20
- export import StaleFiat = WarningStaleFiat
22
+ export import DeltaFiat = WarningDeltaFiat
21
23
  export import MissingBuffer = WarningMissingBuffer
22
24
  export import MissingEmoney = WarningMissingEmoney
23
25
  export import MissingFiat = WarningMissingFiat
24
26
  export import MissingTransaction = WarningMissingTransaction
25
- export import DeltaFiat = WarningDeltaFiat
27
+ export import Overdraft = WarningOverdraft
28
+ export import Reconciliation = WarningReconciliation
29
+ export import StaleFiat = WarningStaleFiat
30
+
26
31
  export const type = isly.union<Snapshot>(
27
- Overdraft.type,
28
- StaleFiat.type,
32
+ DeltaFiat.type,
29
33
  MissingBuffer.type,
30
34
  MissingEmoney.type,
31
35
  MissingFiat.type,
32
36
  MissingTransaction.type,
33
- DeltaFiat.type
37
+ Overdraft.type,
38
+ Reconciliation.type,
39
+ StaleFiat.type
34
40
  )
35
41
  }
@@ -1,10 +1,8 @@
1
1
  import { isoly } from "isoly";
2
2
  import { isly } from "isly";
3
- import { isly as isly2 } from "isly2";
4
3
  import { Amounts } from "./Amounts";
5
4
  export type Amount = [isoly.Currency, number];
6
5
  export declare namespace Amount {
7
6
  function toAmounts(amount?: Amount): Amounts;
8
7
  const type: isly.Type<Amount>;
9
- const type2: isly2.Tuple<Amount>;
10
8
  }
@@ -2,9 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Amount = void 0;
4
4
  const isoly_1 = require("isoly");
5
- const isoly2_1 = require("isoly2");
6
5
  const isly_1 = require("isly");
7
- const isly2_1 = require("isly2");
8
6
  var Amount;
9
7
  (function (Amount) {
10
8
  function toAmounts(amount) {
@@ -12,6 +10,5 @@ var Amount;
12
10
  }
13
11
  Amount.toAmounts = toAmounts;
14
12
  Amount.type = isly_1.isly.tuple(isly_1.isly.string(isoly_1.isoly.Currency.values), isly_1.isly.number());
15
- Amount.type2 = isly2_1.isly.tuple(isoly2_1.isoly.Currency.type, isly2_1.isly.number().rename("Amount").describe("Amount in a specified currency."));
16
13
  })(Amount || (exports.Amount = Amount = {}));
17
14
  //# sourceMappingURL=Amount.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Amount.js","sourceRoot":"","sources":["../../Amount.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B,mCAAwC;AACxC,+BAA2B;AAC3B,iCAAqC;AAKrC,IAAiB,MAAM,CAStB;AATD,WAAiB,MAAM;IACtB,SAAgB,SAAS,CAAC,MAAe;QACxC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAS,CAAC,MAAM,CAAC,CAAC,CAAA;IAC3D,CAAC;IAFe,gBAAS,YAExB,CAAA;IACY,WAAI,GAAG,WAAI,CAAC,KAAK,CAAS,WAAI,CAAC,MAAM,CAAC,aAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAI,CAAC,MAAM,EAAE,CAAC,CAAA;IAC5E,YAAK,GAAG,YAAK,CAAC,KAAK,CAC/B,cAAM,CAAC,QAAQ,CAAC,IAAI,EACpB,YAAK,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,iCAAiC,CAAC,CAC3E,CAAA;AACF,CAAC,EATgB,MAAM,sBAAN,MAAM,QAStB"}
1
+ {"version":3,"file":"Amount.js","sourceRoot":"","sources":["../../Amount.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B,+BAA2B;AAK3B,IAAiB,MAAM,CAKtB;AALD,WAAiB,MAAM;IACtB,SAAgB,SAAS,CAAC,MAAe;QACxC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAS,CAAC,MAAM,CAAC,CAAC,CAAA;IAC3D,CAAC;IAFe,gBAAS,YAExB,CAAA;IACY,WAAI,GAAG,WAAI,CAAC,KAAK,CAAS,WAAI,CAAC,MAAM,CAAC,aAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAI,CAAC,MAAM,EAAE,CAAC,CAAA;AAC1F,CAAC,EALgB,MAAM,sBAAN,MAAM,QAKtB"}
@@ -1,4 +1,3 @@
1
- import { isly as isly2 } from "isly2";
2
1
  import { Amount } from "../Amount";
3
2
  import { Meta } from "./Meta";
4
3
  export type Changeable = {
@@ -7,5 +6,4 @@ export type Changeable = {
7
6
  };
8
7
  export declare namespace Changeable {
9
8
  const type: import("isly/dist/cjs/object").IslyObject<Changeable, object>;
10
- const type2: isly2.Object<Changeable>;
11
9
  }
@@ -2,9 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Changeable = void 0;
4
4
  const isoly_1 = require("isoly");
5
- const isoly2_1 = require("isoly2");
6
5
  const isly_1 = require("isly");
7
- const isly2_1 = require("isly2");
8
6
  const Meta_1 = require("./Meta");
9
7
  var Changeable;
10
8
  (function (Changeable) {
@@ -12,16 +10,5 @@ var Changeable;
12
10
  limit: isly_1.isly.tuple(isly_1.isly.fromIs("isoly.Currency", isoly_1.isoly.Currency.is), isly_1.isly.number()).optional(),
13
11
  meta: isly_1.isly.fromIs("Card.Meta", Meta_1.Meta.is).optional(),
14
12
  });
15
- Changeable.type2 = isly2_1.isly
16
- .object({
17
- limit: isly2_1.isly
18
- .tuple(isoly2_1.isoly.Currency.type, isly2_1.isly.number())
19
- .optional()
20
- .rename("Limit")
21
- .describe("The new limit of the card."),
22
- meta: isly2_1.isly.from("Card.Meta", Meta_1.Meta.is).optional().rename("Meta").describe("The new meta data of the card."),
23
- })
24
- .rename("Changeable")
25
- .describe("Changeable card properties.");
26
13
  })(Changeable || (exports.Changeable = Changeable = {}));
27
14
  //# sourceMappingURL=Changeable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Changeable.js","sourceRoot":"","sources":["../../../Card/Changeable.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B,mCAAwC;AACxC,+BAA2B;AAC3B,iCAAqC;AAErC,iCAA6B;AAO7B,IAAiB,UAAU,CAgB1B;AAhBD,WAAiB,UAAU;IACb,eAAI,GAAG,WAAI,CAAC,MAAM,CAAa;QAC3C,KAAK,EAAE,WAAI,CAAC,KAAK,CAAC,WAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,aAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,WAAI,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;QAC7F,IAAI,EAAE,WAAI,CAAC,MAAM,CAAC,WAAW,EAAE,WAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;KAClD,CAAC,CAAA;IACW,gBAAK,GAA6B,YAAK;SAClD,MAAM,CAAa;QACnB,KAAK,EAAE,YAAK;aACV,KAAK,CAAC,cAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,YAAK,CAAC,MAAM,EAAE,CAAC;aAC3C,QAAQ,EAAE;aACV,MAAM,CAAC,OAAO,CAAC;aACf,QAAQ,CAAC,4BAA4B,CAAC;QACxC,IAAI,EAAE,YAAK,CAAC,IAAI,CAAC,WAAW,EAAE,WAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,gCAAgC,CAAC;KAC3G,CAAC;SACD,MAAM,CAAC,YAAY,CAAC;SACpB,QAAQ,CAAC,6BAA6B,CAAC,CAAA;AAC1C,CAAC,EAhBgB,UAAU,0BAAV,UAAU,QAgB1B"}
1
+ {"version":3,"file":"Changeable.js","sourceRoot":"","sources":["../../../Card/Changeable.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B,+BAA2B;AAE3B,iCAA6B;AAO7B,IAAiB,UAAU,CAK1B;AALD,WAAiB,UAAU;IACb,eAAI,GAAG,WAAI,CAAC,MAAM,CAAa;QAC3C,KAAK,EAAE,WAAI,CAAC,KAAK,CAAC,WAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,aAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,WAAI,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;QAC7F,IAAI,EAAE,WAAI,CAAC,MAAM,CAAC,WAAW,EAAE,WAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;KAClD,CAAC,CAAA;AACH,CAAC,EALgB,UAAU,0BAAV,UAAU,QAK1B"}
@@ -1,5 +1,4 @@
1
1
  import { isoly } from "isoly";
2
- import { isly as isly2 } from "isly2";
3
2
  import { Amount } from "../Amount";
4
3
  import type { Rule } from "../Rule";
5
4
  import { Expiry } from "./Expiry";
@@ -24,5 +23,4 @@ export interface Creatable {
24
23
  }
25
24
  export declare namespace Creatable {
26
25
  const type: import("isly/dist/cjs/object").IslyObject<Creatable, object>;
27
- const type2: isly2.Object<Creatable>;
28
26
  }