@pax2pay/model-banking 0.1.602 → 0.1.603

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 (300) hide show
  1. package/.eslintrc +13 -14
  2. package/.prettierrc +2 -3
  3. package/Account/Charge/Fx/index.ts +2 -1
  4. package/Account/Creatable.ts +1 -1
  5. package/Account/History.ts +1 -1
  6. package/Account/Status.ts +2 -2
  7. package/Account/Type.ts +1 -1
  8. package/Audit.ts +1 -1
  9. package/Authorization/Status.ts +8 -6
  10. package/Backup/Base.ts +1 -1
  11. package/Balance.ts +2 -2
  12. package/Balances.ts +6 -3
  13. package/Card/Expiry.ts +2 -2
  14. package/Card/Operation/Authorization.ts +1 -1
  15. package/Card/Operation/Card.ts +1 -1
  16. package/Card/Operation/index.ts +1 -1
  17. package/Card/Preset.ts +1 -1
  18. package/Card/Restriction/Merchant.ts +8 -6
  19. package/Card/Restriction/index.ts +2 -1
  20. package/Card/Scheme.ts +1 -1
  21. package/Card/Stack.ts +2 -2
  22. package/Client/Labels.ts +4 -1
  23. package/Client/Operations.ts +4 -4
  24. package/Client/Transactions/index.ts +3 -2
  25. package/Client/index.ts +3 -2
  26. package/Holidays/index.ts +1 -1
  27. package/Label.ts +1 -1
  28. package/Log/Message/Configuration.ts +1 -1
  29. package/Log/Message/Entry.ts +1 -1
  30. package/Log/Message/index.ts +3 -2
  31. package/Log/index.ts +4 -2
  32. package/Operation/Change.ts +1 -1
  33. package/Operation/Changes.ts +10 -9
  34. package/Operation/Creatable.ts +1 -1
  35. package/Operation/Status.ts +1 -1
  36. package/Operation/index.ts +2 -1
  37. package/Organization/Risk.ts +1 -1
  38. package/Quarter.ts +1 -1
  39. package/Rail/Address/index.ts +1 -1
  40. package/Rail/index.ts +1 -1
  41. package/Rule/Base.ts +2 -2
  42. package/Rule/Other.ts +5 -3
  43. package/Rule/State/Authorization.ts +1 -1
  44. package/Rule/State/Card.ts +3 -2
  45. package/Rule/State/index.ts +1 -1
  46. package/Rule/index.ts +1 -1
  47. package/Settlement/Entry/fromCreatable.ts +8 -6
  48. package/Settlement/Status.ts +1 -1
  49. package/Settlement/Total.ts +8 -6
  50. package/Settlement/Totals.ts +4 -2
  51. package/Supplier/index.ts +1 -2
  52. package/Transaction/Statistics.ts +6 -5
  53. package/Transaction/Status.ts +3 -3
  54. package/Transaction/index.ts +22 -20
  55. package/Treasury/Account/Category.ts +1 -1
  56. package/Treasury/Snapshot/funding.ts +7 -5
  57. package/User/Access/Permission.ts +2 -2
  58. package/User/Identity.ts +7 -3
  59. package/User/Password.ts +5 -4
  60. package/Warning/Base.ts +1 -1
  61. package/Warning/Snapshot/MissingBuffer.ts +2 -1
  62. package/Warning/Snapshot/StaleFiat.ts +6 -3
  63. package/dist/cjs/Account/Charge/Fx/index.js +2 -1
  64. package/dist/cjs/Account/Charge/Fx/index.js.map +1 -1
  65. package/dist/cjs/Account/Creatable.d.ts +1 -1
  66. package/dist/cjs/Account/History.d.ts +1 -1
  67. package/dist/cjs/Account/Status.d.ts +2 -2
  68. package/dist/cjs/Account/Type.d.ts +1 -1
  69. package/dist/cjs/Audit.d.ts +1 -1
  70. package/dist/cjs/Authorization/Status.d.ts +1 -1
  71. package/dist/cjs/Authorization/Status.js +10 -5
  72. package/dist/cjs/Authorization/Status.js.map +1 -1
  73. package/dist/cjs/Backup/Base.d.ts +1 -1
  74. package/dist/cjs/Balance.d.ts +2 -2
  75. package/dist/cjs/Balances.js +6 -3
  76. package/dist/cjs/Balances.js.map +1 -1
  77. package/dist/cjs/Card/Expiry.d.ts +2 -2
  78. package/dist/cjs/Card/Operation/Authorization.d.ts +1 -1
  79. package/dist/cjs/Card/Operation/Card.d.ts +1 -1
  80. package/dist/cjs/Card/Operation/index.js.map +1 -1
  81. package/dist/cjs/Card/Preset.d.ts +1 -1
  82. package/dist/cjs/Card/Restriction/Merchant.d.ts +1 -1
  83. package/dist/cjs/Card/Restriction/Merchant.js +10 -5
  84. package/dist/cjs/Card/Restriction/Merchant.js.map +1 -1
  85. package/dist/cjs/Card/Restriction/index.js +2 -1
  86. package/dist/cjs/Card/Restriction/index.js.map +1 -1
  87. package/dist/cjs/Card/Scheme.d.ts +1 -1
  88. package/dist/cjs/Card/Stack.d.ts +2 -2
  89. package/dist/cjs/Client/Labels.js.map +1 -1
  90. package/dist/cjs/Client/Operations.js.map +1 -1
  91. package/dist/cjs/Client/Transactions/index.js +2 -1
  92. package/dist/cjs/Client/Transactions/index.js.map +1 -1
  93. package/dist/cjs/Client/index.js +3 -2
  94. package/dist/cjs/Client/index.js.map +1 -1
  95. package/dist/cjs/Holidays/index.d.ts +1 -1
  96. package/dist/cjs/Label.d.ts +1 -1
  97. package/dist/cjs/Log/Message/Configuration.js.map +1 -1
  98. package/dist/cjs/Log/Message/Entry.js.map +1 -1
  99. package/dist/cjs/Log/Message/index.js +2 -1
  100. package/dist/cjs/Log/Message/index.js.map +1 -1
  101. package/dist/cjs/Log/index.js +4 -2
  102. package/dist/cjs/Log/index.js.map +1 -1
  103. package/dist/cjs/Operation/Change.d.ts +1 -1
  104. package/dist/cjs/Operation/Changes.d.ts +2 -2
  105. package/dist/cjs/Operation/Changes.js +8 -4
  106. package/dist/cjs/Operation/Changes.js.map +1 -1
  107. package/dist/cjs/Operation/Creatable.d.ts +1 -1
  108. package/dist/cjs/Operation/Status.d.ts +1 -1
  109. package/dist/cjs/Operation/index.js +2 -1
  110. package/dist/cjs/Operation/index.js.map +1 -1
  111. package/dist/cjs/Organization/Risk.d.ts +1 -1
  112. package/dist/cjs/Quarter.d.ts +1 -1
  113. package/dist/cjs/Rail/Address/index.d.ts +1 -1
  114. package/dist/cjs/Rail/index.d.ts +1 -1
  115. package/dist/cjs/Rule/Base.d.ts +2 -2
  116. package/dist/cjs/Rule/Other.d.ts +1 -1
  117. package/dist/cjs/Rule/Other.js +4 -2
  118. package/dist/cjs/Rule/Other.js.map +1 -1
  119. package/dist/cjs/Rule/State/Authorization.js.map +1 -1
  120. package/dist/cjs/Rule/State/Card.js +4 -2
  121. package/dist/cjs/Rule/State/Card.js.map +1 -1
  122. package/dist/cjs/Rule/State/index.d.ts +1 -1
  123. package/dist/cjs/Rule/index.d.ts +1 -1
  124. package/dist/cjs/Settlement/Entry/fromCreatable.js +10 -5
  125. package/dist/cjs/Settlement/Entry/fromCreatable.js.map +1 -1
  126. package/dist/cjs/Settlement/Status.d.ts +1 -1
  127. package/dist/cjs/Settlement/Total.js +4 -2
  128. package/dist/cjs/Settlement/Total.js.map +1 -1
  129. package/dist/cjs/Settlement/Totals.js +4 -2
  130. package/dist/cjs/Settlement/Totals.js.map +1 -1
  131. package/dist/cjs/Supplier/index.d.ts +1 -1
  132. package/dist/cjs/Supplier/index.js.map +1 -1
  133. package/dist/cjs/Transaction/Statistics.d.ts +2 -2
  134. package/dist/cjs/Transaction/Statistics.js +2 -1
  135. package/dist/cjs/Transaction/Statistics.js.map +1 -1
  136. package/dist/cjs/Transaction/Status.d.ts +3 -3
  137. package/dist/cjs/Transaction/index.d.ts +2 -2
  138. package/dist/cjs/Transaction/index.js +10 -5
  139. package/dist/cjs/Transaction/index.js.map +1 -1
  140. package/dist/cjs/Treasury/Account/Category.d.ts +1 -1
  141. package/dist/cjs/Treasury/Snapshot/funding.js +8 -4
  142. package/dist/cjs/Treasury/Snapshot/funding.js.map +1 -1
  143. package/dist/cjs/User/Access/Permission.d.ts +2 -2
  144. package/dist/cjs/User/Identity.js +4 -2
  145. package/dist/cjs/User/Identity.js.map +1 -1
  146. package/dist/cjs/User/Password.js +8 -4
  147. package/dist/cjs/User/Password.js.map +1 -1
  148. package/dist/cjs/Warning/Base.d.ts +1 -1
  149. package/dist/cjs/Warning/Snapshot/MissingBuffer.js +2 -1
  150. package/dist/cjs/Warning/Snapshot/MissingBuffer.js.map +1 -1
  151. package/dist/cjs/Warning/Snapshot/StaleFiat.js +6 -3
  152. package/dist/cjs/Warning/Snapshot/StaleFiat.js.map +1 -1
  153. package/dist/cjs/fx.d.ts +1 -1
  154. package/dist/cjs/reports/visa/Data/Cards.js +6 -3
  155. package/dist/cjs/reports/visa/Data/Cards.js.map +1 -1
  156. package/dist/cjs/reports/visa/Data/Country.js +6 -3
  157. package/dist/cjs/reports/visa/Data/Country.js.map +1 -1
  158. package/dist/cjs/reports/visa/Data/Iin.d.ts +2 -2
  159. package/dist/cjs/reports/visa/Data/Monthly.d.ts +1 -1
  160. package/dist/cjs/reports/visa/Data/Monthly.js +2 -1
  161. package/dist/cjs/reports/visa/Data/Monthly.js.map +1 -1
  162. package/dist/cjs/reports/visa/Data/NonMonthly.js +8 -4
  163. package/dist/cjs/reports/visa/Data/NonMonthly.js.map +1 -1
  164. package/dist/cjs/reports/visa/Data/Region.d.ts +1 -1
  165. package/dist/cjs/reports/visa/Data/Region.js +16 -8
  166. package/dist/cjs/reports/visa/Data/Region.js.map +1 -1
  167. package/dist/cjs/reports/visa/Data/Regional.js +4 -2
  168. package/dist/cjs/reports/visa/Data/Regional.js.map +1 -1
  169. package/dist/cjs/reports/visa/Data/index.js +4 -2
  170. package/dist/cjs/reports/visa/Data/index.js.map +1 -1
  171. package/dist/cjs/reports/visa/index.js +10 -5
  172. package/dist/cjs/reports/visa/index.js.map +1 -1
  173. package/dist/cjs/reports/visa/rows.d.ts +2 -2
  174. package/dist/cjs/reports/visa/rows.js +2 -1
  175. package/dist/cjs/reports/visa/rows.js.map +1 -1
  176. package/dist/mjs/Account/Charge/Fx/index.js +2 -1
  177. package/dist/mjs/Account/Charge/Fx/index.js.map +1 -1
  178. package/dist/mjs/Account/Creatable.d.ts +1 -1
  179. package/dist/mjs/Account/History.d.ts +1 -1
  180. package/dist/mjs/Account/Status.d.ts +2 -2
  181. package/dist/mjs/Account/Type.d.ts +1 -1
  182. package/dist/mjs/Audit.d.ts +1 -1
  183. package/dist/mjs/Authorization/Status.d.ts +1 -1
  184. package/dist/mjs/Authorization/Status.js +10 -5
  185. package/dist/mjs/Authorization/Status.js.map +1 -1
  186. package/dist/mjs/Backup/Base.d.ts +1 -1
  187. package/dist/mjs/Balance.d.ts +2 -2
  188. package/dist/mjs/Balances.js +6 -3
  189. package/dist/mjs/Balances.js.map +1 -1
  190. package/dist/mjs/Card/Expiry.d.ts +2 -2
  191. package/dist/mjs/Card/Operation/Authorization.d.ts +1 -1
  192. package/dist/mjs/Card/Operation/Card.d.ts +1 -1
  193. package/dist/mjs/Card/Operation/index.js.map +1 -1
  194. package/dist/mjs/Card/Preset.d.ts +1 -1
  195. package/dist/mjs/Card/Restriction/Merchant.d.ts +1 -1
  196. package/dist/mjs/Card/Restriction/Merchant.js +10 -5
  197. package/dist/mjs/Card/Restriction/Merchant.js.map +1 -1
  198. package/dist/mjs/Card/Restriction/index.js +2 -1
  199. package/dist/mjs/Card/Restriction/index.js.map +1 -1
  200. package/dist/mjs/Card/Scheme.d.ts +1 -1
  201. package/dist/mjs/Card/Stack.d.ts +2 -2
  202. package/dist/mjs/Client/Labels.js.map +1 -1
  203. package/dist/mjs/Client/Operations.js.map +1 -1
  204. package/dist/mjs/Client/Transactions/index.js +2 -1
  205. package/dist/mjs/Client/Transactions/index.js.map +1 -1
  206. package/dist/mjs/Client/index.js +3 -2
  207. package/dist/mjs/Client/index.js.map +1 -1
  208. package/dist/mjs/Holidays/index.d.ts +1 -1
  209. package/dist/mjs/Label.d.ts +1 -1
  210. package/dist/mjs/Log/Message/Configuration.js.map +1 -1
  211. package/dist/mjs/Log/Message/Entry.js.map +1 -1
  212. package/dist/mjs/Log/Message/index.js +2 -1
  213. package/dist/mjs/Log/Message/index.js.map +1 -1
  214. package/dist/mjs/Log/index.js +4 -2
  215. package/dist/mjs/Log/index.js.map +1 -1
  216. package/dist/mjs/Operation/Change.d.ts +1 -1
  217. package/dist/mjs/Operation/Changes.d.ts +2 -2
  218. package/dist/mjs/Operation/Changes.js +8 -4
  219. package/dist/mjs/Operation/Changes.js.map +1 -1
  220. package/dist/mjs/Operation/Creatable.d.ts +1 -1
  221. package/dist/mjs/Operation/Status.d.ts +1 -1
  222. package/dist/mjs/Operation/index.js +2 -1
  223. package/dist/mjs/Operation/index.js.map +1 -1
  224. package/dist/mjs/Organization/Risk.d.ts +1 -1
  225. package/dist/mjs/Quarter.d.ts +1 -1
  226. package/dist/mjs/Rail/Address/index.d.ts +1 -1
  227. package/dist/mjs/Rail/index.d.ts +1 -1
  228. package/dist/mjs/Rule/Base.d.ts +2 -2
  229. package/dist/mjs/Rule/Other.d.ts +1 -1
  230. package/dist/mjs/Rule/Other.js +4 -2
  231. package/dist/mjs/Rule/Other.js.map +1 -1
  232. package/dist/mjs/Rule/State/Authorization.js.map +1 -1
  233. package/dist/mjs/Rule/State/Card.js +4 -2
  234. package/dist/mjs/Rule/State/Card.js.map +1 -1
  235. package/dist/mjs/Rule/State/index.d.ts +1 -1
  236. package/dist/mjs/Rule/index.d.ts +1 -1
  237. package/dist/mjs/Settlement/Entry/fromCreatable.js +10 -5
  238. package/dist/mjs/Settlement/Entry/fromCreatable.js.map +1 -1
  239. package/dist/mjs/Settlement/Status.d.ts +1 -1
  240. package/dist/mjs/Settlement/Total.js +4 -2
  241. package/dist/mjs/Settlement/Total.js.map +1 -1
  242. package/dist/mjs/Settlement/Totals.js +4 -2
  243. package/dist/mjs/Settlement/Totals.js.map +1 -1
  244. package/dist/mjs/Supplier/index.d.ts +1 -1
  245. package/dist/mjs/Supplier/index.js.map +1 -1
  246. package/dist/mjs/Transaction/Statistics.d.ts +2 -2
  247. package/dist/mjs/Transaction/Statistics.js +2 -1
  248. package/dist/mjs/Transaction/Statistics.js.map +1 -1
  249. package/dist/mjs/Transaction/Status.d.ts +3 -3
  250. package/dist/mjs/Transaction/index.d.ts +2 -2
  251. package/dist/mjs/Transaction/index.js +10 -5
  252. package/dist/mjs/Transaction/index.js.map +1 -1
  253. package/dist/mjs/Treasury/Account/Category.d.ts +1 -1
  254. package/dist/mjs/Treasury/Snapshot/funding.js +8 -4
  255. package/dist/mjs/Treasury/Snapshot/funding.js.map +1 -1
  256. package/dist/mjs/User/Access/Permission.d.ts +2 -2
  257. package/dist/mjs/User/Identity.js +4 -2
  258. package/dist/mjs/User/Identity.js.map +1 -1
  259. package/dist/mjs/User/Password.js +8 -4
  260. package/dist/mjs/User/Password.js.map +1 -1
  261. package/dist/mjs/Warning/Base.d.ts +1 -1
  262. package/dist/mjs/Warning/Snapshot/MissingBuffer.js +2 -1
  263. package/dist/mjs/Warning/Snapshot/MissingBuffer.js.map +1 -1
  264. package/dist/mjs/Warning/Snapshot/StaleFiat.js +6 -3
  265. package/dist/mjs/Warning/Snapshot/StaleFiat.js.map +1 -1
  266. package/dist/mjs/fx.d.ts +1 -1
  267. package/dist/mjs/reports/visa/Data/Cards.js +6 -3
  268. package/dist/mjs/reports/visa/Data/Cards.js.map +1 -1
  269. package/dist/mjs/reports/visa/Data/Country.js +6 -3
  270. package/dist/mjs/reports/visa/Data/Country.js.map +1 -1
  271. package/dist/mjs/reports/visa/Data/Iin.d.ts +2 -2
  272. package/dist/mjs/reports/visa/Data/Monthly.d.ts +1 -1
  273. package/dist/mjs/reports/visa/Data/Monthly.js +2 -1
  274. package/dist/mjs/reports/visa/Data/Monthly.js.map +1 -1
  275. package/dist/mjs/reports/visa/Data/NonMonthly.js +8 -4
  276. package/dist/mjs/reports/visa/Data/NonMonthly.js.map +1 -1
  277. package/dist/mjs/reports/visa/Data/Region.d.ts +1 -1
  278. package/dist/mjs/reports/visa/Data/Region.js +16 -8
  279. package/dist/mjs/reports/visa/Data/Region.js.map +1 -1
  280. package/dist/mjs/reports/visa/Data/Regional.js +4 -2
  281. package/dist/mjs/reports/visa/Data/Regional.js.map +1 -1
  282. package/dist/mjs/reports/visa/Data/index.js +4 -2
  283. package/dist/mjs/reports/visa/Data/index.js.map +1 -1
  284. package/dist/mjs/reports/visa/index.js +10 -5
  285. package/dist/mjs/reports/visa/index.js.map +1 -1
  286. package/dist/mjs/reports/visa/rows.d.ts +2 -2
  287. package/dist/mjs/reports/visa/rows.js +2 -1
  288. package/dist/mjs/reports/visa/rows.js.map +1 -1
  289. package/fx.ts +1 -1
  290. package/package.json +10 -9
  291. package/reports/visa/Data/Cards.ts +6 -3
  292. package/reports/visa/Data/Country.ts +6 -3
  293. package/reports/visa/Data/Iin.ts +2 -2
  294. package/reports/visa/Data/Monthly.ts +3 -2
  295. package/reports/visa/Data/NonMonthly.ts +8 -4
  296. package/reports/visa/Data/Region.ts +11 -9
  297. package/reports/visa/Data/Regional.ts +4 -2
  298. package/reports/visa/Data/index.ts +3 -2
  299. package/reports/visa/index.ts +8 -6
  300. package/reports/visa/rows.ts +4 -3
package/.eslintrc CHANGED
@@ -3,20 +3,27 @@
3
3
  "parser": "@typescript-eslint/parser",
4
4
  "plugins": [
5
5
  "@typescript-eslint",
6
- "prettierx",
6
+ "prettier",
7
7
  "simple-import-sort"
8
8
  ],
9
9
  "extends": [
10
10
  "eslint:recommended",
11
11
  "plugin:@typescript-eslint/eslint-recommended",
12
12
  "plugin:@typescript-eslint/recommended",
13
- "plugin:prettierx/default"
13
+ "plugin:prettier/recommended"
14
14
  ],
15
15
  "rules": {
16
- "prettierx/options": [
17
- 1,
16
+ "curly": [
17
+ "error",
18
+ "all"
19
+ ],
20
+ "prettier/prettier": [
21
+ "warn",
18
22
  {
19
- "singleQuote": false
23
+ "semi": false,
24
+ "singleQuote": false,
25
+ "tabWidth": 2,
26
+ "trailingComma": "es5"
20
27
  }
21
28
  ],
22
29
  "@typescript-eslint/no-explicit-any": "off",
@@ -41,10 +48,6 @@
41
48
  "no-case-declarations": "off",
42
49
  "no-inner-declarations": "off",
43
50
  "sort-imports": "off",
44
- "curly": [
45
- "warn",
46
- "multi"
47
- ],
48
51
  "simple-import-sort/imports": [
49
52
  "error",
50
53
  {
@@ -74,9 +77,5 @@
74
77
  }
75
78
  ]
76
79
  },
77
- "settings": {
78
- "prettierx": {
79
- "usePrettierrc": true
80
- }
81
- }
80
+ "settings": {}
82
81
  }
package/.prettierrc CHANGED
@@ -4,8 +4,7 @@
4
4
  "semi": false,
5
5
  "singleQuote": false,
6
6
  "bracketSpacing": true,
7
- "jsxBracketSameLine": true,
7
+ "bracketSameLine": true,
8
8
  "arrowParens": "avoid",
9
- "endOfLine": "lf",
10
- "breakBeforeStatement": "always"
9
+ "endOfLine": "lf"
11
10
  }
@@ -18,12 +18,13 @@ export namespace Fx {
18
18
  let result: Amount.Charge.Fx | undefined
19
19
  const chargePreset = preset && charge[preset] ? preset : "default"
20
20
  const chargeRate = charge[chargePreset] ?? 0
21
- if (exchange)
21
+ if (exchange) {
22
22
  result = {
23
23
  preset: chargePreset,
24
24
  rate: chargeRate,
25
25
  amount: -isoly.Currency.multiply(currency, amount, chargeRate),
26
26
  }
27
+ }
27
28
  return result
28
29
  }
29
30
  }
@@ -6,7 +6,7 @@ export interface Creatable {
6
6
  location?: Creatable.Location
7
7
  }
8
8
  export namespace Creatable {
9
- export type Location = typeof Location.values[number]
9
+ export type Location = (typeof Location.values)[number]
10
10
  export namespace Location {
11
11
  export const values = ["north-east-america", "west-europe"] as const
12
12
  export function toCloudflare(value: Location): DurableObjectLocationHint {
@@ -8,7 +8,7 @@ export type History = {
8
8
  }
9
9
 
10
10
  export namespace History {
11
- export type Property = typeof Property.values[number]
11
+ export type Property = (typeof Property.values)[number]
12
12
  export namespace Property {
13
13
  export const values = [
14
14
  "status",
package/Account/Status.ts CHANGED
@@ -5,11 +5,11 @@ export type Status = {
5
5
  reason?: Status.Reason
6
6
  }
7
7
  export namespace Status {
8
- export type Mode = typeof Mode.values[number] | (string & Record<never, never>)
8
+ export type Mode = (typeof Mode.values)[number] | (string & Record<never, never>)
9
9
  export namespace Mode {
10
10
  export const values = ["active", "frozen", "closed"] as const
11
11
  }
12
- export type Reason = typeof Reason.values[number] | (string & Record<never, never>)
12
+ export type Reason = (typeof Reason.values)[number] | (string & Record<never, never>)
13
13
  export namespace Reason {
14
14
  export const values = ["overdraft", "other"] as const
15
15
  }
package/Account/Type.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { isly } from "isly"
2
2
 
3
- export type Type = typeof Type.values[number]
3
+ export type Type = (typeof Type.values)[number]
4
4
  export namespace Type {
5
5
  export const values = ["own funds", "emoney"] as const
6
6
  export const type = isly.string<Type>(values)
package/Audit.ts CHANGED
@@ -3,7 +3,7 @@ import { isly } from "isly"
3
3
 
4
4
  export type Audit = storage.AuditLogger.Entry<Audit.Type>
5
5
  export namespace Audit {
6
- export type Type = { [K in keyof typeof Resource.value]: typeof Resource.value[K][number] }
6
+ export type Type = { [K in keyof typeof Resource.value]: (typeof Resource.value)[K][number] }
7
7
  export type Resource = keyof typeof Resource.value
8
8
  export namespace Resource {
9
9
  export const value = {
@@ -6,19 +6,21 @@ export type Status = "approved" | Status.Failed
6
6
 
7
7
  export namespace Status {
8
8
  export const failures = [...Transaction.Status.reasons, "card not found", "account not found", "other"] as const
9
- export type Failed = typeof failures[number]
9
+ export type Failed = (typeof failures)[number]
10
10
  export namespace Failed {
11
11
  export function from(error: gracely.Error | Transaction.Status.Reason): Failed {
12
12
  let result: Status
13
- if (gracely.Error.is(error))
14
- if (error.error?.includes("Card with id"))
13
+ if (gracely.Error.is(error)) {
14
+ if (error.error?.includes("Card with id")) {
15
15
  result = "card not found"
16
- else if (error.error?.includes("Failed to reach account"))
16
+ } else if (error.error?.includes("Failed to reach account")) {
17
17
  result = "account not found"
18
- else
18
+ } else {
19
19
  result = "other"
20
- else
20
+ }
21
+ } else {
21
22
  result = error
23
+ }
22
24
  return result
23
25
  }
24
26
  }
package/Backup/Base.ts CHANGED
@@ -14,7 +14,7 @@ export type Base<T> = {
14
14
  value: T
15
15
  }
16
16
  export namespace Base {
17
- export type Action = typeof Action.values[number]
17
+ export type Action = (typeof Action.values)[number]
18
18
  export namespace Action {
19
19
  export const values = ["created", "updated", "cancelled", "removed", "inactivated"] as const
20
20
  }
package/Balance.ts CHANGED
@@ -4,7 +4,7 @@ import { Amount } from "./Amount"
4
4
 
5
5
  export type Balance = { available?: number; reserved?: Balance.Reserved }
6
6
  export namespace Balance {
7
- export type Reserve = typeof Reserve.values[number]
7
+ export type Reserve = (typeof Reserve.values)[number]
8
8
  export namespace Reserve {
9
9
  export const values = ["incoming", "outgoing", "buffer"] as const
10
10
  export const type = isly.string<Reserve>(values)
@@ -16,7 +16,7 @@ export namespace Balance {
16
16
  })
17
17
  export type Legacy = Partial<Record<Legacy.Entry, number>>
18
18
  export namespace Legacy {
19
- export type Entry = typeof Entry.values[number]
19
+ export type Entry = (typeof Entry.values)[number]
20
20
  export namespace Entry {
21
21
  export const values = ["actual", "incomingReserved", "outgoingReserved", "bufferReserved"] as const
22
22
  export const type = isly.string<Entry>(values)
package/Balances.ts CHANGED
@@ -10,20 +10,23 @@ export namespace Balances {
10
10
  export const type = isly.record<Balances>(isly.fromIs("isoly.Currency", isoly.Currency.is), Balances.Balance.type)
11
11
  export function update(balances: Balances): Balances {
12
12
  const result: Balances = {}
13
- for (const [currency, balance] of Object.entries(balances))
13
+ for (const [currency, balance] of Object.entries(balances)) {
14
14
  result[currency as isoly.Currency] = Balance.update(currency as isoly.Currency, balance)
15
+ }
15
16
  return result
16
17
  }
17
18
  export function computeReserved(balances: Balances): Amounts {
18
19
  const result: Amounts = {}
19
- for (const [currency, balance] of Object.entries(balances))
20
+ for (const [currency, balance] of Object.entries(balances)) {
20
21
  result[currency as isoly.Currency] = Balance.computeReserved(currency as isoly.Currency, balance)[1]
22
+ }
21
23
  return result
22
24
  }
23
25
  export function computeActual(balances: Balances): Amounts {
24
26
  const result: Amounts = {}
25
- for (const [currency, balance] of Object.entries(balances))
27
+ for (const [currency, balance] of Object.entries(balances)) {
26
28
  result[currency as isoly.Currency] = Balance.computeActual(currency as isoly.Currency, balance)[1]
29
+ }
27
30
  return result
28
31
  }
29
32
  }
package/Card/Expiry.ts CHANGED
@@ -3,10 +3,10 @@ import { isly } from "isly"
3
3
  import { isly as isly2 } from "isly2"
4
4
 
5
5
  const year = [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40] as const
6
- type Year = typeof year[number]
6
+ type Year = (typeof year)[number]
7
7
 
8
8
  const month = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] as const
9
- type Month = typeof month[number]
9
+ type Month = (typeof month)[number]
10
10
 
11
11
  export type Expiry = [Year, Month]
12
12
  export namespace Expiry {
@@ -12,7 +12,7 @@ export interface Authorization {
12
12
 
13
13
  export namespace Authorization {
14
14
  export const statuses = ["created", "confirmed", "refunded", "captured", "cancelled"] as const
15
- export type Status = typeof statuses[number]
15
+ export type Status = (typeof statuses)[number]
16
16
  export const type = isly.object<Authorization>({
17
17
  type: isly.string("authorization"),
18
18
  id: isly.string(),
@@ -13,7 +13,7 @@ export interface Card {
13
13
 
14
14
  export namespace Card {
15
15
  export const statuses = ["created", "changed", "cancelled"] as const
16
- export type Status = typeof statuses[number]
16
+ export type Status = (typeof statuses)[number]
17
17
  export const type = isly.object<Card>({
18
18
  type: isly.string("card"),
19
19
  status: isly.string(statuses),
@@ -25,7 +25,7 @@ export namespace Operation {
25
25
  id: entry.transaction.id,
26
26
  status: entry.type == "capture" ? "captured" : "refunded",
27
27
  created: isoly.DateTime.now(),
28
- }
28
+ }
29
29
  }
30
30
  export const type = isly.union(Card.type, OperationAuthorization.type)
31
31
  export const type2: isly2.Union<Operation> = isly2
package/Card/Preset.ts CHANGED
@@ -3,7 +3,7 @@ import { isly as isly2 } from "isly2"
3
3
  import { Realm } from "../Realm"
4
4
  import { Stack } from "./Stack"
5
5
 
6
- export type Preset = typeof Preset.names[number]
6
+ export type Preset = (typeof Preset.names)[number]
7
7
 
8
8
  // (test OR p2p)-scheme-interchange
9
9
  export namespace Preset {
@@ -5,7 +5,7 @@ import { Rail } from "../../Rail"
5
5
  import { merchants } from "./merchants"
6
6
  import { Merchant as Attribute } from "./merchants/Merchant"
7
7
 
8
- export type Merchant = typeof Merchant.values[number]
8
+ export type Merchant = (typeof Merchant.values)[number]
9
9
  export namespace Merchant {
10
10
  export const values = typedly.Object.keys(merchants)
11
11
  export const type = isly.string<Merchant>(values)
@@ -13,27 +13,29 @@ export namespace Merchant {
13
13
  export function check(merchant: Merchant, counterpart: Rail.Address.Card.Counterpart): boolean {
14
14
  const attribute: Attribute = merchants[merchant]
15
15
  let result: boolean
16
- if (attribute?.unambiguousMcc == counterpart.merchant.category)
16
+ if (attribute?.unambiguousMcc == counterpart.merchant.category) {
17
17
  result = true
18
- else if (attribute.contains && attribute.mccs)
18
+ } else if (attribute.contains && attribute.mccs) {
19
19
  result =
20
20
  attribute.mccs.some(mcc => mcc == counterpart.merchant.category) &&
21
21
  attribute.contains.some(n => counterpart.merchant.name.includes(n))
22
- else if (attribute.startsWith && attribute.mccs)
22
+ } else if (attribute.startsWith && attribute.mccs) {
23
23
  result =
24
24
  attribute.mccs.some(mcc => mcc == counterpart.merchant.category) &&
25
25
  attribute.startsWith.some(n => counterpart.merchant.name.startsWith(n))
26
- else
26
+ } else {
27
27
  result = false
28
+ }
28
29
  return result
29
30
  }
30
31
  export function resolve(counterpart: Rail.Address.Card.Counterpart): Merchant | undefined {
31
32
  let result: Merchant | undefined
32
- for (const merchant of values)
33
+ for (const merchant of values) {
33
34
  if (check(merchant, counterpart)) {
34
35
  result = merchant
35
36
  break
36
37
  }
38
+ }
37
39
  return result
38
40
  }
39
41
  }
@@ -21,8 +21,9 @@ export namespace Restriction {
21
21
  transaction: Transaction.Creatable.CardTransaction | Transaction.PreTransaction.Authorization
22
22
  ): boolean {
23
23
  let result: boolean = true
24
- if (restrictions.merchants?.length)
24
+ if (restrictions.merchants?.length) {
25
25
  result = restrictions.merchants.some(merchant => Merchant.check(merchant, transaction.counterpart))
26
+ }
26
27
  return result
27
28
  }
28
29
  }
package/Card/Scheme.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { isly } from "isly"
2
2
  import { isly as isly2 } from "isly2"
3
3
 
4
- export type Scheme = typeof Scheme.schemes[number]
4
+ export type Scheme = (typeof Scheme.schemes)[number]
5
5
  export namespace Scheme {
6
6
  export const schemes = ["mastercard", "diners", "visa"] as const
7
7
  export const type = isly.string<Scheme>(schemes)
package/Card/Stack.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { isly } from "isly"
2
2
  import { Realm } from "../Realm"
3
3
 
4
- export type Stack = typeof Stack.stacks[number]
4
+ export type Stack = (typeof Stack.stacks)[number]
5
5
 
6
6
  // realm-scheme-processor(-processor...)
7
7
  export namespace Stack {
@@ -88,5 +88,5 @@ export namespace Stack {
88
88
  )?.[0]
89
89
  }
90
90
  }
91
- export type Character = typeof Character.values[number]
91
+ export type Character = (typeof Character.values)[number]
92
92
  }
package/Client/Labels.ts CHANGED
@@ -3,7 +3,10 @@ import { http } from "cloudly-http"
3
3
  import { Label } from "../Label"
4
4
 
5
5
  export class Labels {
6
- constructor(private readonly client: http.Client, readonly type: Label.Type) {}
6
+ constructor(
7
+ private readonly client: http.Client,
8
+ readonly type: Label.Type
9
+ ) {}
7
10
  async create(label: Label): Promise<Label | gracely.Error> {
8
11
  return this.client.post<Label>(`/label/${this.type}`, label)
9
12
  }
@@ -15,10 +15,10 @@ export class Operations {
15
15
  options?.start && options?.end
16
16
  ? `?start=${options?.start}&end=${options?.end}`
17
17
  : options?.start
18
- ? `?start=${options?.start}`
19
- : options?.end
20
- ? `?end=${options?.end}`
21
- : ""
18
+ ? `?start=${options?.start}`
19
+ : options?.end
20
+ ? `?end=${options?.end}`
21
+ : ""
22
22
  return this.client.get<Operation[] & { cursor?: string | undefined }>(
23
23
  `/operation${search}`,
24
24
  options && (({ start, end, ...headers }) => headers)(options)
@@ -71,8 +71,9 @@ export namespace Transactions {
71
71
  type: isly.string("value", ...Transaction.types).optional(),
72
72
  })
73
73
  export function parse(query: string | http.Request["search"]): Query {
74
- if (typeof query == "string")
75
- query = query ? http.Search.parse(query.replace("?", "")) : {} // search.parse does not support empty string
74
+ if (typeof query == "string") {
75
+ query = query ? http.Search.parse(query.replace("?", "")) : {}
76
+ } // search.parse does not support empty string
76
77
  return type.prune(query) ?? {}
77
78
  }
78
79
  }
package/Client/index.ts CHANGED
@@ -79,19 +79,20 @@ export class Client {
79
79
  appendHeader: request => ({
80
80
  ...request.header,
81
81
  realm: result.realm,
82
- ...(request.header.organization ?? result.organization
82
+ ...((request.header.organization ?? result.organization)
83
83
  ? { organization: request.header.organization ?? result.organization }
84
84
  : {}),
85
85
  }),
86
86
  postprocess: async response => {
87
87
  let result = response
88
88
  const body = await response.body
89
- if (Array.isArray(body))
89
+ if (Array.isArray(body)) {
90
90
  result = http.Response.create(
91
91
  Object.defineProperty(body, "cursor", {
92
92
  value: response.header.cursor ?? response.header.link?.split?.(",")[0],
93
93
  })
94
94
  )
95
+ }
95
96
  return result
96
97
  },
97
98
  })
package/Holidays/index.ts CHANGED
@@ -3,7 +3,7 @@ import { isly } from "isly"
3
3
  import { Dates } from "./Dates"
4
4
 
5
5
  export namespace Holidays {
6
- export type Regions = typeof Regions.values[number]
6
+ export type Regions = (typeof Regions.values)[number]
7
7
  export namespace Regions {
8
8
  export const values = ["England", "Wales", "Scotland", "Northern Ireland"] as const
9
9
  export const type = isly.string<Regions>(values)
package/Label.ts CHANGED
@@ -7,7 +7,7 @@ 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 type Type = typeof Type.values[number]
10
+ export type Type = (typeof Type.values)[number]
11
11
  export namespace Type {
12
12
  export const values = ["flag", "group"] as const
13
13
  export const type = isly.string(values)
@@ -16,7 +16,7 @@ export namespace Configuration {
16
16
  collection: trace.message[0].collection,
17
17
  resource: trace.message[0].resource,
18
18
  requireEntries: trace.message[0].requireEntries,
19
- }
19
+ }
20
20
  : undefined
21
21
  }
22
22
  }
@@ -16,7 +16,7 @@ export namespace Entry {
16
16
  data: trace.message[0].data,
17
17
  },
18
18
  resource: trace.message[0].resource,
19
- }
19
+ }
20
20
  : undefined
21
21
  }
22
22
  }
@@ -19,15 +19,16 @@ export namespace Message {
19
19
  realm: configuration.realm,
20
20
  resource: configuration.resource,
21
21
  entries: [],
22
- }
22
+ }
23
23
  : undefined
24
- if (result)
24
+ if (result) {
25
25
  for (const trace of traces) {
26
26
  const logFragment: { entry: Log.Entry; resource: Log["resource"] } | undefined =
27
27
  Message.Entry.fromEventLogs(trace)
28
28
  logFragment?.resource && (result.resource ??= logFragment.resource)
29
29
  logFragment?.entry && result.entries.push(logFragment.entry)
30
30
  }
31
+ }
31
32
  return (configuration?.requireEntries && result?.entries && result.entries.length > 0) ||
32
33
  !configuration?.requireEntries
33
34
  ? result
package/Log/index.ts CHANGED
@@ -50,10 +50,12 @@ export namespace Log {
50
50
  locations?: LogLocations
51
51
  ): void {
52
52
  const configuration = { collection, realm, resource, requireEntries }
53
- if (Log.Message.Configuration.type.safeParse(configuration).success)
53
+ if (Log.Message.Configuration.type.safeParse(configuration).success) {
54
54
  console.log(configuration)
55
- if (Log.Locations.type.safeParse(locations).success)
55
+ }
56
+ if (Log.Locations.type.safeParse(locations).success) {
56
57
  console.log(Log.Entry.Message.to("Locations", locations, resource))
58
+ }
57
59
  }
58
60
  export function log(message: string, data?: any, resource?: string): void {
59
61
  console.log(Log.Entry.Message.to(message, data, resource))
@@ -10,7 +10,7 @@ export interface Change<T extends Change.Operand = Change.Operand> {
10
10
 
11
11
  export namespace Change {
12
12
  export const operand = ["add", "subtract"] as const
13
- export type Operand = typeof operand[number]
13
+ export type Operand = (typeof operand)[number]
14
14
  export const type = isly.object<Change>({
15
15
  type: isly.string(["add", "subtract"]),
16
16
  amount: isly.number(),
@@ -18,10 +18,10 @@ export namespace Changes {
18
18
  : 0
19
19
  ),
20
20
  0
21
- )
21
+ )
22
22
  : "available" in changes
23
- ? (changes.available?.type == "subtract" ? -1 : 1) * (changes.available?.amount ?? 0)
24
- : 0
23
+ ? (changes.available?.type == "subtract" ? -1 : 1) * (changes.available?.amount ?? 0)
24
+ : 0
25
25
  }
26
26
  export function reserved(changes: MaybeLegacy, currency: isoly.Currency): number {
27
27
  return Object.entries(changes).reduce(
@@ -57,7 +57,7 @@ export namespace Changes {
57
57
  export const type = isly.record<Legacy>(isly.string(), Change.type)
58
58
  export type Entry = AccountBalance.Legacy.Entry
59
59
  export namespace Entry {
60
- export type Balance = typeof AccountBalance.Legacy.Entry.values[number]
60
+ export type Balance = (typeof AccountBalance.Legacy.Entry.values)[number]
61
61
  export namespace Balance {
62
62
  export const type = AccountBalance.Legacy.Entry.type
63
63
  }
@@ -68,17 +68,18 @@ export namespace Changes {
68
68
  export const type = isly.string<Entry>()
69
69
  export function getBalanceType(key: string): string {
70
70
  let result = ""
71
- if (key.includes("net") || key.includes("fee") || key.includes("charge"))
71
+ if (key.includes("net") || key.includes("fee") || key.includes("charge")) {
72
72
  result = "collecting"
73
- else if (key.toLowerCase().includes("reserved") || key === "available")
73
+ } else if (key.toLowerCase().includes("reserved") || key === "available") {
74
74
  result = "balance"
75
- else if (key.includes("internal"))
75
+ } else if (key.includes("internal")) {
76
76
  result = "equalizing"
77
- else
77
+ } else {
78
78
  result = "fiat"
79
+ }
79
80
  return result
80
81
  }
81
- export type Balance = typeof Balance.values[number]
82
+ export type Balance = (typeof Balance.values)[number]
82
83
  export namespace Balance {
83
84
  export const values = ["available", "reserved-incoming", "reserved-outgoing", "reserved-buffer"] as const
84
85
  export const type = isly.string<Balance>(values)
@@ -29,7 +29,7 @@ export namespace Creatable {
29
29
  "legacy",
30
30
  "adjustBuffer",
31
31
  ] as const
32
- export type Type = typeof types[number]
32
+ export type Type = (typeof types)[number]
33
33
  export const type = isly.object<Creatable>({
34
34
  account: isly.fromIs("cryptly.Identifier", cryptly.Identifier.is),
35
35
  currency: isly.fromIs("isoly.Currency", isoly.Currency.is),
@@ -1,6 +1,6 @@
1
1
  import { isly } from "isly"
2
2
 
3
- export type Status = typeof Status.values[number]
3
+ export type Status = (typeof Status.values)[number]
4
4
 
5
5
  export namespace Status {
6
6
  export const values = ["pending", "success", "failed"] as const
@@ -19,7 +19,7 @@ export namespace Operation {
19
19
  }
20
20
  export function sum(operations: Operation[]): Changes.Sum {
21
21
  const result: Changes.Sum = {}
22
- for (const operation of operations)
22
+ for (const operation of operations) {
23
23
  Object.entries(operation.changes).forEach(([entry, change]) => {
24
24
  result[entry as Changes.Entry.Balance] = isoly.Currency[change.type](
25
25
  operation.currency,
@@ -27,6 +27,7 @@ export namespace Operation {
27
27
  change.amount
28
28
  )
29
29
  })
30
+ }
30
31
  return result
31
32
  }
32
33
  export import Signer = OperationSigner
@@ -1,6 +1,6 @@
1
1
  import { isly } from "isly"
2
2
 
3
- export type Risk = typeof Risk.values[number]
3
+ export type Risk = (typeof Risk.values)[number]
4
4
 
5
5
  export namespace Risk {
6
6
  export const values = ["low", "medium", "high", "prohibited"] as const
package/Quarter.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { isoly } from "isoly"
2
2
  import { isly } from "isly"
3
3
 
4
- export type Quarter = typeof Quarter.values[number]
4
+ export type Quarter = (typeof Quarter.values)[number]
5
5
  export namespace Quarter {
6
6
  export const values = ["Q1", "Q2", "Q3", "Q4"] as const
7
7
  export const type = isly.string<Quarter>(values)
@@ -21,7 +21,7 @@ export namespace Address {
21
21
  eea: ["internal", "iban", "scan", "card"],
22
22
  }
23
23
  export const values = ["paxgiro", "internal", "iban", "scan", "card", "paxgiro-credit"] as const
24
- export type Type = typeof values[number]
24
+ export type Type = (typeof values)[number]
25
25
  export function compare(addresses: [Address, Address]): boolean {
26
26
  return Object.entries(addresses[0]).every(([key, value]) => value == (addresses[1] as any)[key])
27
27
  }
package/Rail/index.ts CHANGED
@@ -2,7 +2,7 @@ import { isly } from "isly"
2
2
  import { isly as isly2 } from "isly2"
3
3
  import { Address as RailAddress } from "./Address"
4
4
 
5
- export type Rail = typeof Rail.rails[number]
5
+ export type Rail = (typeof Rail.rails)[number]
6
6
  export namespace Rail {
7
7
  export const rails = [
8
8
  "internal",