@pax2pay/model-banking 0.1.425 → 0.1.426

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 (273) hide show
  1. package/Account/Creatable.ts +0 -2
  2. package/Account/History.ts +0 -2
  3. package/Account/Status.ts +0 -2
  4. package/Account/index.ts +0 -2
  5. package/Amount.ts +0 -2
  6. package/Amounts.ts +0 -2
  7. package/Authorization/Creatable.ts +0 -2
  8. package/Balances.ts +0 -2
  9. package/Card/Changeable.ts +0 -3
  10. package/Card/Creatable.ts +0 -1
  11. package/Card/Expiry.ts +0 -1
  12. package/Card/Operation/Authorization.ts +0 -1
  13. package/Card/Operation/Card.ts +0 -1
  14. package/Card/Operation/index.ts +0 -1
  15. package/Card/Preset.ts +0 -2
  16. package/Card/Stack.ts +0 -2
  17. package/Card/index.ts +0 -1
  18. package/Exchange.ts +0 -2
  19. package/Identifier.ts +0 -2
  20. package/Identity.ts +2 -1
  21. package/Key/Roles.ts +1 -2
  22. package/Label.ts +0 -4
  23. package/Merchant/index.ts +0 -2
  24. package/Operation/Change.ts +0 -6
  25. package/Operation/Changes.ts +0 -2
  26. package/Operation/Creatable.ts +0 -2
  27. package/Operation/Status.ts +0 -2
  28. package/Operation/index.ts +0 -2
  29. package/Organization/Changeable.ts +0 -2
  30. package/Organization/Contact/Address/GB.ts +0 -2
  31. package/Organization/Contact/Address/General.ts +0 -2
  32. package/Organization/Contact/Address/SE.ts +0 -2
  33. package/Organization/Contact/Address/index.ts +0 -2
  34. package/Organization/Contact/Addresses.ts +0 -2
  35. package/Organization/Contact/index.ts +0 -1
  36. package/Organization/index.ts +0 -2
  37. package/Rail/Address/Card.ts +1 -2
  38. package/Rail/Address/Iban.ts +0 -1
  39. package/Rail/Address/PaxGiro.ts +0 -1
  40. package/Rail/Address/Scan.ts +0 -1
  41. package/Rail/Address/index.ts +1 -1
  42. package/Rail/Address/internal.ts +1 -2
  43. package/Realm.ts +0 -2
  44. package/Rule/Charge.ts +1 -1
  45. package/Rule/Reserve.ts +1 -1
  46. package/Rule/State/Authorization.ts +0 -2
  47. package/Rule/State/Card.ts +0 -2
  48. package/Rule/State/Partial.ts +0 -2
  49. package/Settlement/Batch.ts +0 -1
  50. package/Settlement/Creatable.ts +0 -2
  51. package/Settlement/Entry/Cancel.ts +0 -4
  52. package/Settlement/Entry/Capture.ts +0 -4
  53. package/Settlement/Entry/Creatable.ts +0 -2
  54. package/Settlement/Entry/Refund.ts +0 -4
  55. package/Settlement/Entry/Summary.ts +0 -2
  56. package/Settlement/Entry/Unknown.ts +0 -4
  57. package/Settlement/Entry/index.ts +1 -3
  58. package/Settlement/Fee.ts +0 -2
  59. package/Settlement/Status.ts +0 -2
  60. package/Settlement/index.ts +1 -3
  61. package/Supplier/index.ts +0 -1
  62. package/Transaction/Creatable.ts +0 -3
  63. package/Transaction/Incoming.ts +1 -2
  64. package/Transaction/Note.ts +0 -2
  65. package/Transaction/Reference.ts +1 -2
  66. package/Transaction/index.ts +3 -6
  67. package/Treasury/Account/Conditions.ts +0 -1
  68. package/Treasury/Account/Fetchable.ts +1 -1
  69. package/Treasury/Balance/index.ts +0 -2
  70. package/dist/Account/Creatable.d.ts +0 -3
  71. package/dist/Account/Creatable.js +0 -2
  72. package/dist/Account/Creatable.js.map +1 -1
  73. package/dist/Account/History.d.ts +0 -2
  74. package/dist/Account/History.js +0 -2
  75. package/dist/Account/History.js.map +1 -1
  76. package/dist/Account/Status.d.ts +0 -3
  77. package/dist/Account/Status.js +0 -2
  78. package/dist/Account/Status.js.map +1 -1
  79. package/dist/Account/index.d.ts +0 -3
  80. package/dist/Account/index.js +0 -2
  81. package/dist/Account/index.js.map +1 -1
  82. package/dist/Amount.d.ts +0 -2
  83. package/dist/Amount.js +0 -2
  84. package/dist/Amount.js.map +1 -1
  85. package/dist/Amounts.d.ts +0 -2
  86. package/dist/Amounts.js +0 -2
  87. package/dist/Amounts.js.map +1 -1
  88. package/dist/Authorization/Creatable.d.ts +0 -3
  89. package/dist/Authorization/Creatable.js +0 -2
  90. package/dist/Authorization/Creatable.js.map +1 -1
  91. package/dist/Balances.d.ts +0 -2
  92. package/dist/Balances.js +0 -2
  93. package/dist/Balances.js.map +1 -1
  94. package/dist/Card/Changeable.d.ts +0 -4
  95. package/dist/Card/Changeable.js +0 -3
  96. package/dist/Card/Changeable.js.map +1 -1
  97. package/dist/Card/Creatable.d.ts +0 -1
  98. package/dist/Card/Creatable.js +0 -1
  99. package/dist/Card/Creatable.js.map +1 -1
  100. package/dist/Card/Expiry.d.ts +0 -1
  101. package/dist/Card/Expiry.js +0 -1
  102. package/dist/Card/Expiry.js.map +1 -1
  103. package/dist/Card/Operation/Authorization.d.ts +0 -1
  104. package/dist/Card/Operation/Authorization.js +0 -1
  105. package/dist/Card/Operation/Authorization.js.map +1 -1
  106. package/dist/Card/Operation/Card.d.ts +0 -1
  107. package/dist/Card/Operation/Card.js +0 -1
  108. package/dist/Card/Operation/Card.js.map +1 -1
  109. package/dist/Card/Operation/index.d.ts +0 -1
  110. package/dist/Card/Operation/index.js +0 -1
  111. package/dist/Card/Operation/index.js.map +1 -1
  112. package/dist/Card/Preset.d.ts +0 -2
  113. package/dist/Card/Preset.js +0 -2
  114. package/dist/Card/Preset.js.map +1 -1
  115. package/dist/Card/Stack.d.ts +0 -2
  116. package/dist/Card/Stack.js +0 -2
  117. package/dist/Card/Stack.js.map +1 -1
  118. package/dist/Card/index.d.ts +0 -1
  119. package/dist/Card/index.js +0 -1
  120. package/dist/Card/index.js.map +1 -1
  121. package/dist/Exchange.d.ts +0 -542
  122. package/dist/Exchange.js +0 -2
  123. package/dist/Exchange.js.map +1 -1
  124. package/dist/Identifier.d.ts +0 -2
  125. package/dist/Identifier.js +0 -2
  126. package/dist/Identifier.js.map +1 -1
  127. package/dist/Identity.js +2 -1
  128. package/dist/Identity.js.map +1 -1
  129. package/dist/Key/Roles.d.ts +0 -1
  130. package/dist/Key/Roles.js +1 -2
  131. package/dist/Key/Roles.js.map +1 -1
  132. package/dist/Label.d.ts +0 -4
  133. package/dist/Label.js +0 -4
  134. package/dist/Label.js.map +1 -1
  135. package/dist/Merchant/index.d.ts +0 -3
  136. package/dist/Merchant/index.js +0 -2
  137. package/dist/Merchant/index.js.map +1 -1
  138. package/dist/Operation/Change.d.ts +0 -7
  139. package/dist/Operation/Change.js +0 -6
  140. package/dist/Operation/Change.js.map +1 -1
  141. package/dist/Operation/Changes.d.ts +0 -2
  142. package/dist/Operation/Changes.js +0 -2
  143. package/dist/Operation/Changes.js.map +1 -1
  144. package/dist/Operation/Creatable.d.ts +0 -3
  145. package/dist/Operation/Creatable.js +0 -2
  146. package/dist/Operation/Creatable.js.map +1 -1
  147. package/dist/Operation/Status.d.ts +0 -2
  148. package/dist/Operation/Status.js +0 -2
  149. package/dist/Operation/Status.js.map +1 -1
  150. package/dist/Operation/index.d.ts +0 -3
  151. package/dist/Operation/index.js +0 -2
  152. package/dist/Operation/index.js.map +1 -1
  153. package/dist/Organization/Changeable.d.ts +0 -3
  154. package/dist/Organization/Changeable.js +0 -2
  155. package/dist/Organization/Changeable.js.map +1 -1
  156. package/dist/Organization/Contact/Address/GB.d.ts +0 -3
  157. package/dist/Organization/Contact/Address/GB.js +0 -2
  158. package/dist/Organization/Contact/Address/GB.js.map +1 -1
  159. package/dist/Organization/Contact/Address/General.d.ts +0 -3
  160. package/dist/Organization/Contact/Address/General.js +0 -2
  161. package/dist/Organization/Contact/Address/General.js.map +1 -1
  162. package/dist/Organization/Contact/Address/SE.d.ts +0 -3
  163. package/dist/Organization/Contact/Address/SE.js +0 -2
  164. package/dist/Organization/Contact/Address/SE.js.map +1 -1
  165. package/dist/Organization/Contact/Address/index.d.ts +0 -2
  166. package/dist/Organization/Contact/Address/index.js +0 -2
  167. package/dist/Organization/Contact/Address/index.js.map +1 -1
  168. package/dist/Organization/Contact/Addresses.d.ts +0 -3
  169. package/dist/Organization/Contact/Addresses.js +0 -2
  170. package/dist/Organization/Contact/Addresses.js.map +1 -1
  171. package/dist/Organization/Contact/index.d.ts +0 -1
  172. package/dist/Organization/Contact/index.js +0 -1
  173. package/dist/Organization/Contact/index.js.map +1 -1
  174. package/dist/Organization/index.d.ts +0 -3
  175. package/dist/Organization/index.js +0 -2
  176. package/dist/Organization/index.js.map +1 -1
  177. package/dist/Rail/Address/Card.d.ts +0 -3
  178. package/dist/Rail/Address/Card.js +0 -2
  179. package/dist/Rail/Address/Card.js.map +1 -1
  180. package/dist/Rail/Address/Iban.d.ts +0 -1
  181. package/dist/Rail/Address/Iban.js +0 -1
  182. package/dist/Rail/Address/Iban.js.map +1 -1
  183. package/dist/Rail/Address/PaxGiro.d.ts +0 -1
  184. package/dist/Rail/Address/PaxGiro.js +0 -1
  185. package/dist/Rail/Address/PaxGiro.js.map +1 -1
  186. package/dist/Rail/Address/Scan.d.ts +0 -1
  187. package/dist/Rail/Address/Scan.js +0 -1
  188. package/dist/Rail/Address/Scan.js.map +1 -1
  189. package/dist/Rail/Address/index.d.ts +0 -1
  190. package/dist/Rail/Address/index.js +0 -1
  191. package/dist/Rail/Address/index.js.map +1 -1
  192. package/dist/Rail/Address/internal.d.ts +0 -3
  193. package/dist/Rail/Address/internal.js +0 -2
  194. package/dist/Rail/Address/internal.js.map +1 -1
  195. package/dist/Realm.d.ts +0 -2
  196. package/dist/Realm.js +0 -2
  197. package/dist/Realm.js.map +1 -1
  198. package/dist/Rule/Charge.js +1 -1
  199. package/dist/Rule/Charge.js.map +1 -1
  200. package/dist/Rule/Reserve.js +1 -1
  201. package/dist/Rule/Reserve.js.map +1 -1
  202. package/dist/Rule/State/Authorization.d.ts +0 -3
  203. package/dist/Rule/State/Authorization.js +0 -2
  204. package/dist/Rule/State/Authorization.js.map +1 -1
  205. package/dist/Rule/State/Card.d.ts +0 -3
  206. package/dist/Rule/State/Card.js +0 -2
  207. package/dist/Rule/State/Card.js.map +1 -1
  208. package/dist/Rule/State/Partial.d.ts +0 -3
  209. package/dist/Rule/State/Partial.js +0 -2
  210. package/dist/Rule/State/Partial.js.map +1 -1
  211. package/dist/Settlement/Batch.d.ts +0 -1
  212. package/dist/Settlement/Batch.js +0 -1
  213. package/dist/Settlement/Batch.js.map +1 -1
  214. package/dist/Settlement/Creatable.d.ts +0 -3
  215. package/dist/Settlement/Creatable.js +0 -2
  216. package/dist/Settlement/Creatable.js.map +1 -1
  217. package/dist/Settlement/Entry/Cancel.d.ts +0 -5
  218. package/dist/Settlement/Entry/Cancel.js +0 -4
  219. package/dist/Settlement/Entry/Cancel.js.map +1 -1
  220. package/dist/Settlement/Entry/Capture.d.ts +0 -5
  221. package/dist/Settlement/Entry/Capture.js +0 -4
  222. package/dist/Settlement/Entry/Capture.js.map +1 -1
  223. package/dist/Settlement/Entry/Creatable.d.ts +0 -2
  224. package/dist/Settlement/Entry/Creatable.js +0 -2
  225. package/dist/Settlement/Entry/Creatable.js.map +1 -1
  226. package/dist/Settlement/Entry/Refund.d.ts +0 -5
  227. package/dist/Settlement/Entry/Refund.js +0 -4
  228. package/dist/Settlement/Entry/Refund.js.map +1 -1
  229. package/dist/Settlement/Entry/Summary.d.ts +0 -3
  230. package/dist/Settlement/Entry/Summary.js +0 -2
  231. package/dist/Settlement/Entry/Summary.js.map +1 -1
  232. package/dist/Settlement/Entry/Unknown.d.ts +0 -5
  233. package/dist/Settlement/Entry/Unknown.js +0 -4
  234. package/dist/Settlement/Entry/Unknown.js.map +1 -1
  235. package/dist/Settlement/Entry/index.d.ts +0 -2
  236. package/dist/Settlement/Entry/index.js +1 -3
  237. package/dist/Settlement/Entry/index.js.map +1 -1
  238. package/dist/Settlement/Fee.d.ts +0 -3
  239. package/dist/Settlement/Fee.js +0 -2
  240. package/dist/Settlement/Fee.js.map +1 -1
  241. package/dist/Settlement/Status.d.ts +0 -3
  242. package/dist/Settlement/Status.js +0 -2
  243. package/dist/Settlement/Status.js.map +1 -1
  244. package/dist/Settlement/index.d.ts +0 -3
  245. package/dist/Settlement/index.js +1 -3
  246. package/dist/Settlement/index.js.map +1 -1
  247. package/dist/Supplier/index.d.ts +0 -1
  248. package/dist/Supplier/index.js +0 -1
  249. package/dist/Supplier/index.js.map +1 -1
  250. package/dist/Transaction/Creatable.d.ts +0 -4
  251. package/dist/Transaction/Creatable.js +0 -3
  252. package/dist/Transaction/Creatable.js.map +1 -1
  253. package/dist/Transaction/Incoming.d.ts +0 -3
  254. package/dist/Transaction/Incoming.js +0 -2
  255. package/dist/Transaction/Incoming.js.map +1 -1
  256. package/dist/Transaction/Note.d.ts +0 -2
  257. package/dist/Transaction/Note.js +0 -2
  258. package/dist/Transaction/Note.js.map +1 -1
  259. package/dist/Transaction/Reference.d.ts +0 -1
  260. package/dist/Transaction/Reference.js +1 -2
  261. package/dist/Transaction/Reference.js.map +1 -1
  262. package/dist/Transaction/index.d.ts +0 -6
  263. package/dist/Transaction/index.js +1 -6
  264. package/dist/Transaction/index.js.map +1 -1
  265. package/dist/Treasury/Account/Conditions.d.ts +0 -1
  266. package/dist/Treasury/Account/Conditions.js +0 -1
  267. package/dist/Treasury/Account/Conditions.js.map +1 -1
  268. package/dist/Treasury/Account/Fetchable.js +1 -1
  269. package/dist/Treasury/Account/Fetchable.js.map +1 -1
  270. package/dist/Treasury/Balance/index.d.ts +0 -2
  271. package/dist/Treasury/Balance/index.js +0 -2
  272. package/dist/Treasury/Balance/index.js.map +1 -1
  273. package/package.json +1 -1
@@ -6,6 +6,4 @@ export interface Creatable {
6
6
 
7
7
  export namespace Creatable {
8
8
  export const type = isly.object<Creatable>({ name: isly.string() })
9
- export const is = type.is
10
- export const flaw = type.flaw
11
9
  }
@@ -27,6 +27,4 @@ export namespace History {
27
27
  property: Property.type,
28
28
  to: isly.any().optional(),
29
29
  })
30
- export const is = type.is
31
- export const flaw = type.flaw
32
30
  }
package/Account/Status.ts CHANGED
@@ -17,6 +17,4 @@ export namespace Status {
17
17
  mode: isly.string<Mode>(Mode.values),
18
18
  reason: isly.string().optional(),
19
19
  })
20
- export const is = type.is
21
- export const flaw = type.flaw
22
20
  }
package/Account/index.ts CHANGED
@@ -34,8 +34,6 @@ export namespace Account {
34
34
  rules: Rule.type.array().optional(),
35
35
  status: AccountStatus.type,
36
36
  })
37
- export const is = type.is
38
- export const flaw = type.flaw
39
37
  export function isIdentifier(value: cryptly.Identifier | any): value is cryptly.Identifier {
40
38
  return cryptly.Identifier.is(value, 8)
41
39
  }
package/Amount.ts CHANGED
@@ -9,6 +9,4 @@ export namespace Amount {
9
9
  return !amount ? {} : Object.fromEntries<number>([amount])
10
10
  }
11
11
  export const type = isly.tuple<Amount>(isly.string(isoly.Currency.types), isly.number())
12
- export const is = type.is
13
- export const flaw = type.flaw
14
12
  }
package/Amounts.ts CHANGED
@@ -19,6 +19,4 @@ export namespace Amounts {
19
19
  )
20
20
  }
21
21
  export const type = isly.record<Amounts>(isly.string(isoly.Currency.types), isly.number())
22
- export const is = type.is
23
- export const flaw = type.flaw
24
22
  }
@@ -26,6 +26,4 @@ export namespace Creatable {
26
26
  reference: isly.string(),
27
27
  description: isly.string(),
28
28
  })
29
- export const is = type.is
30
- export const flaw = type.flaw
31
29
  }
package/Balances.ts CHANGED
@@ -8,8 +8,6 @@ export type Balances = Partial<Record<isoly.Currency, Balances.Balance.Extended>
8
8
  export namespace Balances {
9
9
  export import Balance = BalancesBalance
10
10
  export const type = isly.record<Balances>(isly.fromIs("isoly.Currency", isoly.Currency.is), Balances.Balance.type)
11
- export const is = type.is
12
- export const flaw = type.flaw
13
11
  export function update(balances: Balances): Balances {
14
12
  const result: Balances = {}
15
13
  for (const [currency, balance] of Object.entries(balances))
@@ -13,7 +13,4 @@ export namespace Changeable {
13
13
  limit: isly.tuple(isly.fromIs("isoly.Currency", isoly.Currency.is), isly.number()).optional(),
14
14
  meta: isly.fromIs("Card.Meta", Meta.is).optional(),
15
15
  })
16
- export const is = type.is
17
- export const flaw = type.flaw
18
- export const get = type.get
19
16
  }
package/Card/Creatable.ts CHANGED
@@ -35,5 +35,4 @@ export namespace Creatable {
35
35
  meta: isly.fromIs("Card.Meta", Meta.is).optional(),
36
36
  key: isly.string().optional(),
37
37
  })
38
- export const is = type.is
39
38
  }
package/Card/Expiry.ts CHANGED
@@ -10,7 +10,6 @@ type Month = typeof month[number]
10
10
  export type Expiry = [Year, Month]
11
11
  export namespace Expiry {
12
12
  export const type = isly.tuple<Expiry>(isly.number([...year]), isly.number([...month])) // Deconstructing to remove readonly.
13
- export const is = type.is
14
13
  export function toDateTime(expiry: Expiry): isoly.DateTime {
15
14
  return isoly.DateTime.nextMonth(
16
15
  "20" + expiry[0].toString() + "-" + expiry[1].toString().padStart(2, "0") + "-01T00:00:01.000Z"
@@ -18,5 +18,4 @@ export namespace Authorization {
18
18
  reason: isly.string().optional(),
19
19
  created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
20
20
  })
21
- export const is = type.is
22
21
  }
@@ -18,5 +18,4 @@ export namespace Card {
18
18
  from: Changeable.type.optional(),
19
19
  created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
20
20
  })
21
- export const is = type.is
22
21
  }
@@ -38,5 +38,4 @@ export namespace Operation {
38
38
  return statusConverter[status]
39
39
  }
40
40
  export const type = isly.union(Card.type, OperationAuthorization.type)
41
- export const is = type.is
42
41
  }
package/Card/Preset.ts CHANGED
@@ -19,8 +19,6 @@ export namespace Preset {
19
19
  "test-diners-202",
20
20
  ] as const
21
21
  export const type = isly.string<Preset>(names)
22
- export const is = type.is
23
- export const flaw = type.flaw
24
22
  export const presets: Record<Preset, Stack> = {
25
23
  "p2p-mc-200": "uk-mc-tpl-marqeta",
26
24
  "p2p-diners-175": "uk-diners-dpg",
package/Card/Stack.ts CHANGED
@@ -15,8 +15,6 @@ export namespace Stack {
15
15
  "uk-mc-tpl-marqeta",
16
16
  ] as const
17
17
  export const type = isly.string(stacks)
18
- export const is = type.is
19
- export const flaw = type.flaw
20
18
  export function toRealm(stack: Stack): Realm {
21
19
  return stack.split("-")[0] as Realm
22
20
  }
package/Card/index.ts CHANGED
@@ -63,7 +63,6 @@ export namespace Card {
63
63
  rules: ruleType.array(),
64
64
  meta: isly.fromIs("Card.Meta", CardMeta.is).optional(),
65
65
  })
66
- export const is = type.is
67
66
  export import Creatable = CardCreatable
68
67
  export import Preset = CardPreset
69
68
  export import Meta = CardMeta
package/Exchange.ts CHANGED
@@ -7,8 +7,6 @@ export namespace Exchange {
7
7
  isly.fromIs("Currency", isoly.Currency.is),
8
8
  isly.record(isly.fromIs("Currency", isoly.Currency.is), isly.number())
9
9
  )
10
- export const is = type.is
11
- export const flaw = type.flaw
12
10
  export function convert(
13
11
  amount: number,
14
12
  from: isoly.Currency,
package/Identifier.ts CHANGED
@@ -19,6 +19,4 @@ export namespace Identifier {
19
19
  return isoly.DateTime.create(Number(new BigUint64Array(decoded.slice(decoded.length - 8).buffer)), "milliseconds")
20
20
  }
21
21
  export const type = isly.fromIs("Identifier", cryptly.Identifier.is)
22
- export const is = type.is
23
- export const flaw = type.flaw
24
22
  }
package/Identity.ts CHANGED
@@ -48,7 +48,8 @@ export class Identity {
48
48
  ): value is
49
49
  | (keyof T extends keyof Identity ? Required<Pick<Identity, keyof T>> & Identity : Identity)
50
50
  | undefined =>
51
- (requires?.organization ? !!identity?.organization : true) && (requires?.realm ? Realm.is(identity?.realm) : true)
51
+ (requires?.organization ? !!identity?.organization : true) &&
52
+ (requires?.realm ? Realm.type.is(identity?.realm) : true)
52
53
  return (identity?.check(constraint) && requirement(identity) && identity) || undefined
53
54
  }
54
55
  static async verify(
package/Key/Roles.ts CHANGED
@@ -31,7 +31,7 @@ export namespace Roles {
31
31
  (r, role) =>
32
32
  userwidgets.User.Permissions.merge(r, {
33
33
  [key]:
34
- organizationCode == "*" && Realm.is(role)
34
+ organizationCode == "*" && Realm.type.is(role)
35
35
  ? Realm.definitions[role]
36
36
  : Organization.definitions[role as Organization.Role],
37
37
  }),
@@ -45,7 +45,6 @@ export namespace Roles {
45
45
  export type Role = typeof roles[number]
46
46
  export const roles = ["admin", "fincrime-readonly", "fincrime", "finance", "operations", "support"] as const
47
47
  export const type = isly.string(roles)
48
- export const is = type.is
49
48
  export const definitions: Record<Role, Permissions.Realm | true> = {
50
49
  admin: true,
51
50
  "fincrime-readonly": {
package/Label.ts CHANGED
@@ -7,13 +7,9 @@ export interface Label {
7
7
  }
8
8
  export namespace Label {
9
9
  export const type = isly.object<Label>({ name: isly.string(), color: isly.string(), description: isly.string() })
10
- export const is = type.is
11
- export const flaw = type.flaw
12
10
  export type Type = typeof Type.values[number]
13
11
  export namespace Type {
14
12
  export const values = ["flag", "group"] as const
15
13
  export const type = isly.string(values)
16
- export const is = type.is
17
- export const flaw = type.flaw
18
14
  }
19
15
  }
package/Merchant/index.ts CHANGED
@@ -22,6 +22,4 @@ export namespace Merchant {
22
22
  state: isly.string().optional(),
23
23
  country: isly.string(),
24
24
  })
25
- export const is = type.is
26
- export const flaw = type.flaw
27
25
  }
@@ -17,20 +17,14 @@ export namespace Change {
17
17
  status: Status.type,
18
18
  result: isly.number().optional(),
19
19
  })
20
- export const is = type.is
21
- export const flaw = type.flaw
22
20
  export namespace Add {
23
21
  export const type = Change.type.extend<Change<"add">>({
24
22
  type: isly.string("add"),
25
23
  })
26
- export const is = type.is
27
- export const flaw = type.flaw
28
24
  }
29
25
  export namespace Subtract {
30
26
  export const type = Change.type.extend<Change<"subtract">>({
31
27
  type: isly.string("subtract"),
32
28
  })
33
- export const is = type.is
34
- export const flaw = type.flaw
35
29
  }
36
30
  }
@@ -57,8 +57,6 @@ export namespace Changes {
57
57
  Record<Changes.Entry.Counterbalance, Change>
58
58
  export namespace Legacy {
59
59
  export const type = isly.record<Legacy>(isly.string(), Change.type)
60
- export const is = type.is
61
- export const flaw = type.flaw
62
60
  export type Entry = AccountBalance.Legacy.Entry | Legacy.Entry.Counterbalance
63
61
  export namespace Entry {
64
62
  export function split(counterbalance: Counterbalance): [isoly.DateTime, CounterbalanceOperation.Link] {
@@ -36,8 +36,6 @@ export namespace Creatable {
36
36
  changes: Changes.type,
37
37
  type: isly.string(types),
38
38
  })
39
- export const is = type.is
40
- export const flaw = type.flaw
41
39
  export function fromRefund(account: string, settlement: string, entry: Settlement.Entry.Refund.Creatable): Creatable {
42
40
  // The Entry.Refund.Creatable has negative amount and fee
43
41
  // The operation amounts should always be positive
@@ -5,6 +5,4 @@ export type Status = typeof Status.values[number]
5
5
  export namespace Status {
6
6
  export const values = ["pending", "success", "failed"] as const
7
7
  export const type = isly.string(values)
8
- export const is = type.is
9
- export const flaw = type.flaw
10
8
  }
@@ -40,8 +40,6 @@ export namespace Operation {
40
40
  signature: isly.string().optional(),
41
41
  previous: isly.string().optional(),
42
42
  })
43
- export const is = type.is
44
- export const flaw = type.flaw
45
43
  export function fromCreatable(transaction: string, creatable: Creatable): Operation {
46
44
  return { ...creatable, transaction, counter: 0, created: isoly.DateTime.now() }
47
45
  }
@@ -11,6 +11,4 @@ export namespace Changeable {
11
11
  name: isly.string().optional(),
12
12
  contact: Contact.type.optional(),
13
13
  })
14
- export const is = type.is
15
- export const flaw = type.flaw
16
14
  }
@@ -18,6 +18,4 @@ export namespace GB {
18
18
  building: isly.string(),
19
19
  zipCode: isly.string(),
20
20
  })
21
- export const is = type.is
22
- export const flaw = type.flaw
23
21
  }
@@ -19,6 +19,4 @@ export namespace Default {
19
19
  street: isly.string(),
20
20
  zipCode: isly.string(),
21
21
  })
22
- export const is = type.is
23
- export const flaw = type.flaw
24
22
  }
@@ -13,6 +13,4 @@ export namespace SE {
13
13
  city: isly.string(),
14
14
  street: isly.string(),
15
15
  })
16
- export const is = type.is
17
- export const flaw = type.flaw
18
16
  }
@@ -7,6 +7,4 @@ export type Address = GB | SE | Default
7
7
 
8
8
  export namespace Address {
9
9
  export const type = isly.union(GB.type, SE.type, Default.type)
10
- export const is = type.is
11
- export const flaw = type.flaw
12
10
  }
@@ -14,6 +14,4 @@ export namespace Addresses {
14
14
  delivery: Address.type.optional(),
15
15
  visit: Address.type.optional(),
16
16
  })
17
- export const is = type.is
18
- export const flaw = type.flaw
19
17
  }
@@ -33,5 +33,4 @@ export namespace Contact {
33
33
  code: isly.fromIs("CallingCode", isoly.CallingCode.is),
34
34
  }),
35
35
  })
36
- export const is = type.is
37
36
  }
@@ -22,8 +22,6 @@ export namespace Organization {
22
22
  contact: OrganizationContact.type.optional(),
23
23
  groups: isly.string().array().optional(),
24
24
  })
25
- export const is = type.is
26
- export const flaw = type.flaw
27
25
  export type Changeable = OrganizationChangeable
28
26
  export const Changeable = OrganizationChangeable
29
27
  export type Contact = OrganizationContact
@@ -36,8 +36,7 @@ export namespace Card {
36
36
  expiry: ModelCard.Expiry.type,
37
37
  holder: isly.string(),
38
38
  })
39
- export const is = type.is
40
- export const flaw = type.flaw
39
+
41
40
  export function from(card: ModelCard | Rule.State.Card): Card {
42
41
  return {
43
42
  type: "card",
@@ -17,5 +17,4 @@ export namespace Iban {
17
17
  institution: isly.string().optional(),
18
18
  transactor: isly.string().optional(),
19
19
  })
20
- export const is = type.is
21
20
  }
@@ -8,5 +8,4 @@ export interface PaxGiro {
8
8
  export namespace PaxGiro {
9
9
  export const currencies = ["EUR", "GBP", "SEK", "USD"] as const
10
10
  export const type = isly.object<PaxGiro>({ type: isly.string("paxgiro"), identifier: isly.string() })
11
- export const is = type.is
12
11
  }
@@ -19,5 +19,4 @@ export namespace Scan {
19
19
  account: isly.string(),
20
20
  holder: isly.string(),
21
21
  })
22
- export const is = type.is
23
22
  }
@@ -98,7 +98,7 @@ export namespace Address {
98
98
  AddressPaxGiro.type,
99
99
  AddressScan.type
100
100
  )
101
- export const is = type.is
101
+
102
102
  export import PaxGiro = AddressPaxGiro
103
103
  export import Iban = AddressIban
104
104
  export import Scan = AddressScan
@@ -17,8 +17,7 @@ export namespace Internal {
17
17
  identifier: isly.union(isly.fromIs("Identifier", cryptly.Identifier.is), Operation.Changes.Entry.type),
18
18
  organization: isly.string().optional(),
19
19
  })
20
- export const is = type.is
21
- export const flaw = type.flaw
20
+
22
21
  export function toLink(internal: Internal, realm: Realm): string {
23
22
  return `${realm}-internal-${internal.identifier}`
24
23
  }
package/Realm.ts CHANGED
@@ -7,8 +7,6 @@ export type Realm = typeof Realm.realms[number]
7
7
  export namespace Realm {
8
8
  export const realms = ["test", "testUK", "uk", "eea", "upcheck"] as const
9
9
  export const type: isly.Type<Realm> = isly.string(realms)
10
- export const is = type.is
11
- export const flaw = type.flaw
12
10
  export function toString(): string {
13
11
  return realms.toString().replaceAll(",", ", ") + "."
14
12
  }
package/Rule/Charge.ts CHANGED
@@ -45,7 +45,7 @@ export namespace Charge {
45
45
  ...rule.charge,
46
46
  fixed:
47
47
  typeof rule.charge.fixed == "number"
48
- ? [Realm.is(currency) ? Realm.currency[currency] : currency, rule.charge.fixed]
48
+ ? [Realm.type.is(currency) ? Realm.currency[currency] : currency, rule.charge.fixed]
49
49
  : rule.charge.fixed,
50
50
  },
51
51
  }
package/Rule/Reserve.ts CHANGED
@@ -52,7 +52,7 @@ export namespace Reserve {
52
52
  ...rule.reserve,
53
53
  fixed:
54
54
  typeof rule.reserve.fixed == "number"
55
- ? [Realm.is(currency) ? Realm.currency[currency] : currency, rule.reserve.fixed]
55
+ ? [Realm.type.is(currency) ? Realm.currency[currency] : currency, rule.reserve.fixed]
56
56
  : rule.reserve.fixed,
57
57
  },
58
58
  }
@@ -47,6 +47,4 @@ export namespace Authorization {
47
47
  isly.object<{ reference: string }>({ reference: isly.string() })
48
48
  ),
49
49
  })
50
- export const is = type.is
51
- export const flaw = type.flaw
52
50
  }
@@ -61,6 +61,4 @@ export namespace Card {
61
61
  used: isly.object<Card["used"]>({ amount: isly.number(), count: isly.number(), merchants: isly.string().array() }),
62
62
  reject: isly.object<Card["reject"]>({ count: isly.number() }),
63
63
  })
64
- export const is = type.is
65
- export const flaw = type.flaw
66
64
  }
@@ -9,6 +9,4 @@ export interface Partial {
9
9
 
10
10
  export namespace Partial {
11
11
  export const type = isly.object<Partial>({ card: Card.type, authorization: Authorization.type })
12
- export const is = type.is
13
- export const flaw = type.flaw
14
12
  }
@@ -3,5 +3,4 @@ import { isly } from "isly"
3
3
  export type Batch = string
4
4
  export namespace Batch {
5
5
  export const type = isly.string<Batch>()
6
- export const is = type.is
7
6
  }
@@ -17,6 +17,4 @@ export namespace Creatable {
17
17
  references: isly.string().array().optional(),
18
18
  batch: Batch.type,
19
19
  })
20
- export const is = type.is
21
- export const flaw = type.flaw
22
20
  }
@@ -27,13 +27,9 @@ export namespace Cancel {
27
27
  amount: Amount.type.optional(),
28
28
  batch: Batch.type,
29
29
  })
30
- export const is = type.is
31
- export const flaw = type.flaw
32
30
  }
33
31
  export const type = Creatable.type.extend<Cancel>({
34
32
  status: isly.string(["succeeded", "failed"]),
35
33
  reason: isly.string().optional(),
36
34
  })
37
- export const is = type.is
38
- export const flaw = type.flaw
39
35
  }
@@ -33,13 +33,9 @@ export namespace Capture {
33
33
  amount: Amount.type,
34
34
  batch: Batch.type,
35
35
  })
36
- export const is = type.is
37
- export const flaw = type.flaw
38
36
  }
39
37
  export const type = Creatable.type.extend<Capture>({
40
38
  status: isly.string(["succeeded", "failed"]),
41
39
  reason: isly.string().optional(),
42
40
  })
43
- export const is = type.is
44
- export const flaw = type.flaw
45
41
  }
@@ -13,6 +13,4 @@ export namespace Creatable {
13
13
  EntryRefund.Creatable.type,
14
14
  EntryUnknown.Creatable.type
15
15
  )
16
- export const is = type.is
17
- export const flaw = type.flaw
18
16
  }
@@ -40,14 +40,10 @@ export namespace Refund {
40
40
  amount: Amount.type,
41
41
  batch: Batch.type,
42
42
  })
43
- export const is = type.is
44
- export const flaw = type.flaw
45
43
  }
46
44
  export const type = Creatable.type.extend<Refund>({
47
45
  status: isly.string(["succeeded", "failed"]),
48
46
  reason: isly.string().optional(),
49
47
  transaction: Transaction.type.optional(),
50
48
  })
51
- export const is = type.is
52
- export const flaw = type.flaw
53
49
  }
@@ -16,6 +16,4 @@ export namespace Summary {
16
16
  })
17
17
  .optional(),
18
18
  })
19
- export const is = type.is
20
- export const flaw = type.flaw
21
19
  }
@@ -21,8 +21,6 @@ export namespace Unknown {
21
21
  data: isly.record(isly.string(), isly.any()),
22
22
  batch: Batch.type,
23
23
  })
24
- export const is = Unknown.is
25
- export const flaw = Unknown.flaw
26
24
  }
27
25
  export function from(creatable: Creatable): Unknown {
28
26
  return { ...creatable, status: "failed" }
@@ -31,6 +29,4 @@ export namespace Unknown {
31
29
  status: isly.string(["succeeded", "failed"]),
32
30
  reason: isly.string().optional(),
33
31
  })
34
- export const is = type.is
35
- export const flaw = type.flaw
36
32
  }
@@ -38,7 +38,7 @@ export namespace Entry {
38
38
  export const Creatable = EntryCreatable
39
39
  export function from(creatable: Entry.Creatable, transaction: Transaction | gracely.Error | string): Entry {
40
40
  let result: Entry
41
- if (!Transaction.is(transaction) || transaction.status != "finalized")
41
+ if (!Transaction.type.is(transaction) || transaction.status != "finalized")
42
42
  result = {
43
43
  status: "failed",
44
44
  reason: reason(creatable, transaction),
@@ -77,6 +77,4 @@ export namespace Entry {
77
77
  Entry.Refund.type,
78
78
  Entry.Unknown.type
79
79
  )
80
- export const is = type.is
81
- export const flaw = type.flaw
82
80
  }
package/Settlement/Fee.ts CHANGED
@@ -9,6 +9,4 @@ export namespace Fee {
9
9
  return { other: Amounts.add(addendee.other, addend.other) }
10
10
  }
11
11
  export const type = isly.object<Fee>({ other: Amounts.type })
12
- export const is = type.is
13
- export const flaw = type.flaw
14
12
  }
@@ -12,6 +12,4 @@ export namespace Status {
12
12
  collected: isly.string(values),
13
13
  settled: isly.string(values),
14
14
  })
15
- export const is = type.is
16
- export const flaw = type.flaw
17
15
  }
@@ -68,7 +68,7 @@ export namespace Settlement {
68
68
  export type MaybeOld = Settlement | OldSettlement
69
69
  export function fromLegacy(settlement: MaybeOld): Settlement {
70
70
  let result: Settlement
71
- if (!is(settlement)) {
71
+ if (!type.is(settlement)) {
72
72
  const totalToAmount: (currency: isoly.Currency, total?: OldTotal) => Amount = (currency, oldTotal) => ({
73
73
  net: oldTotal?.amount[currency] ?? 0,
74
74
  fee: { other: oldTotal?.fee.other[currency] ?? 0 },
@@ -106,6 +106,4 @@ export namespace Settlement {
106
106
  entries: Settlement.Entry.Summary.type,
107
107
  warnings: Settlement.Warning.type.array().optional(),
108
108
  })
109
- export const is = type.is
110
- export const flaw = type.flaw
111
109
  }
package/Supplier/index.ts CHANGED
@@ -5,5 +5,4 @@ export type Supplier = typeof Supplier.names[number]
5
5
  export namespace Supplier {
6
6
  export const names = ["paxgiro", "clearbank", "paxgiroCredit"] as const
7
7
  export const type = isly.string<Supplier>(names)
8
- export const is = type.is
9
8
  }
@@ -16,7 +16,4 @@ export namespace Creatable {
16
16
  amount: isly.number(),
17
17
  description: isly.string(),
18
18
  })
19
- export const is = type.is
20
- export const flaw = type.flaw
21
- export const get = type.get
22
19
  }
@@ -25,8 +25,7 @@ export namespace Incoming {
25
25
  rail: Rail.type.optional(),
26
26
  reference: TransactionReference.type.optional(),
27
27
  })
28
- export const is = type.is
29
- export const flaw = type.flaw
28
+
30
29
  export function fromRefund(entry: Settlement.Entry.Refund.Creatable, card: Rail.Address.Card): Incoming {
31
30
  const [currency, amount] = entry.amount
32
31
  return {
@@ -24,11 +24,9 @@ export namespace Note {
24
24
  flags: isly.string().array().optional(),
25
25
  rule: isly.any().optional(),
26
26
  })
27
- export const is = type.is
28
27
  }
29
28
  export const type = Creatable.type.extend<Note>({
30
29
  author: isly.string(),
31
30
  created: isly.string(),
32
31
  })
33
- export const is = type.is
34
32
  }