@ellipticltd/aml-utils 0.16.27 → 0.16.29

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 (99) hide show
  1. package/README.md +11 -43
  2. package/lib/errors/errors.js +19 -30
  3. package/lib/errors/errors.js.map +1 -0
  4. package/{dist → lib}/file-parser/errors.js +1 -1
  5. package/lib/file-parser/errors.js.map +1 -0
  6. package/{dist → lib}/file-parser/file-parser.d.ts +2 -4
  7. package/lib/file-parser/file-parser.js +59 -0
  8. package/lib/file-parser/file-parser.js.map +1 -0
  9. package/{dist/structured-file-parser → lib/file-parser}/parse-row.js +2 -1
  10. package/lib/file-parser/parse-row.js.map +1 -0
  11. package/{dist/file-parser/sanitzeRows.d.ts → lib/file-parser/sanitizeRows.d.ts} +3 -1
  12. package/lib/file-parser/sanitizeRows.js +15 -0
  13. package/lib/file-parser/sanitizeRows.js.map +1 -0
  14. package/lib/formatting/formatting.js +11 -12
  15. package/lib/formatting/formatting.js.map +1 -0
  16. package/{dist → lib}/index.d.ts +1 -1
  17. package/lib/index.js +21 -0
  18. package/lib/index.js.map +1 -0
  19. package/lib/middleware/middleware.js +14 -17
  20. package/lib/middleware/middleware.js.map +1 -0
  21. package/lib/orm-helpers/ormHelpers.js +12 -13
  22. package/lib/orm-helpers/ormHelpers.js.map +1 -0
  23. package/{dist → lib}/structured-file-parser/errors.js +1 -0
  24. package/lib/structured-file-parser/errors.js.map +1 -0
  25. package/{dist/file-parser → lib/structured-file-parser}/parse-row.js +2 -1
  26. package/lib/structured-file-parser/parse-row.js.map +1 -0
  27. package/{dist → lib}/structured-file-parser/sanitize-rows.js +3 -4
  28. package/lib/structured-file-parser/sanitize-rows.js.map +1 -0
  29. package/{dist → lib}/structured-file-parser/structured-file-parser.d.ts +2 -2
  30. package/lib/structured-file-parser/structured-file-parser.js +95 -0
  31. package/lib/structured-file-parser/structured-file-parser.js.map +1 -0
  32. package/{dist → lib}/types/types.d.ts +0 -6
  33. package/lib/types/types.js +191 -203
  34. package/lib/types/types.js.map +1 -0
  35. package/{dist → lib}/validations/validations.d.ts +133 -82
  36. package/lib/validations/validations.js +673 -458
  37. package/lib/validations/validations.js.map +1 -0
  38. package/package.json +7 -61
  39. package/.circleci/config.yml +0 -87
  40. package/.claude/settings.local.json +0 -7
  41. package/.eslintrc +0 -45
  42. package/.huskyrc +0 -5
  43. package/.mocharc.json +0 -3
  44. package/.nvmrc +0 -1
  45. package/.nycrc.json +0 -11
  46. package/.releaserc.json +0 -18
  47. package/.snyk +0 -12
  48. package/codecov.yml +0 -29
  49. package/commitlint.config.js +0 -1
  50. package/dist/errors/errors.js +0 -42
  51. package/dist/errors/errors.spec.d.ts +0 -1
  52. package/dist/errors/errors.spec.js +0 -23
  53. package/dist/file-parser/__tests/file-parser.spec.d.ts +0 -1
  54. package/dist/file-parser/__tests/file-parser.spec.js +0 -109
  55. package/dist/file-parser/__tests/parse-row.spec.d.ts +0 -1
  56. package/dist/file-parser/__tests/parse-row.spec.js +0 -29
  57. package/dist/file-parser/__tests/sanitize-rows.spec.d.ts +0 -1
  58. package/dist/file-parser/__tests/sanitize-rows.spec.js +0 -78
  59. package/dist/file-parser/file-parser.js +0 -55
  60. package/dist/file-parser/sanitzeRows.js +0 -18
  61. package/dist/formatting/formatting.js +0 -17
  62. package/dist/formatting/formatting.spec.d.ts +0 -1
  63. package/dist/formatting/formatting.spec.js +0 -37
  64. package/dist/index.js +0 -22
  65. package/dist/middleware/middleware.js +0 -22
  66. package/dist/orm-helpers/ormHelpers.js +0 -17
  67. package/dist/orm-helpers/ormHelpers.spec.d.ts +0 -1
  68. package/dist/orm-helpers/ormHelpers.spec.js +0 -38
  69. package/dist/structured-file-parser/structured-file-parser.js +0 -98
  70. package/dist/types/types.js +0 -203
  71. package/dist/validations/validations.js +0 -470
  72. package/dist/validations/validations.spec.d.ts +0 -1
  73. package/dist/validations/validations.spec.js +0 -463
  74. package/lib/errors/errors.spec.js +0 -37
  75. package/lib/file-parser/__tests/file-parser.spec.js +0 -107
  76. package/lib/file-parser/__tests/parse-row.spec.js +0 -35
  77. package/lib/file-parser/__tests/sanitize-rows.spec.js +0 -88
  78. package/lib/file-parser/errors.ts +0 -7
  79. package/lib/file-parser/file-parser.ts +0 -84
  80. package/lib/file-parser/parse-row.ts +0 -52
  81. package/lib/file-parser/sanitzeRows.ts +0 -32
  82. package/lib/formatting/formatting.spec.js +0 -45
  83. package/lib/index.ts +0 -19
  84. package/lib/orm-helpers/ormHelpers.spec.js +0 -41
  85. package/lib/structured-file-parser/errors.ts +0 -25
  86. package/lib/structured-file-parser/parse-row.ts +0 -52
  87. package/lib/structured-file-parser/sanitize-rows.ts +0 -24
  88. package/lib/structured-file-parser/structured-file-parser.ts +0 -155
  89. package/lib/validations/validations.spec.js +0 -603
  90. package/tsconfig.json +0 -26
  91. /package/{dist → lib}/errors/errors.d.ts +0 -0
  92. /package/{dist → lib}/file-parser/errors.d.ts +0 -0
  93. /package/{dist → lib}/file-parser/parse-row.d.ts +0 -0
  94. /package/{dist → lib}/formatting/formatting.d.ts +0 -0
  95. /package/{dist → lib}/middleware/middleware.d.ts +0 -0
  96. /package/{dist → lib}/orm-helpers/ormHelpers.d.ts +0 -0
  97. /package/{dist → lib}/structured-file-parser/errors.d.ts +0 -0
  98. /package/{dist → lib}/structured-file-parser/parse-row.d.ts +0 -0
  99. /package/{dist → lib}/structured-file-parser/sanitize-rows.d.ts +0 -0
@@ -1,232 +1,283 @@
1
1
  export function _validate(Err: any, pred: any, x: any, msg: any): any;
2
- export function _validate(Err: any, pred: any, x: any, msg: any): any;
3
- export function _validateArg(pred: any, x: any, msg: any): any;
4
2
  export function _validateArg(pred: any, x: any, msg: any): any;
5
3
  export function _tryCheck(fn: any, arg: any): boolean;
6
- export function _tryCheck(fn: any, arg: any): boolean;
7
4
  export function exists(x: any): boolean;
8
- export function exists(x: any): boolean;
9
- export function nonEmpty(x: any): boolean;
10
5
  export function nonEmpty(x: any): boolean;
11
6
  export function isNonEmptyString(x: any): boolean;
12
- export function isNonEmptyString(x: any): boolean;
13
- export function isSafeString(str: any): boolean;
14
7
  export function isSafeString(str: any): boolean;
15
- export function ensureShortEnough(limit: any, x: any): boolean;
8
+ export function isAssetSafeString(str: any): boolean;
16
9
  export function ensureShortEnough(limit: any, x: any): boolean;
17
10
  export function ensure(crit: any, msg: any): boolean;
18
- export function ensure(crit: any, msg: any): boolean;
19
- export function argExists(x: any, msg: any): any;
20
11
  export function argExists(x: any, msg: any): any;
21
12
  export namespace check {
22
13
  function matches(required: any, given: any, msg: any): boolean;
23
- function matches(required: any, given: any, msg: any): boolean;
24
- function wasFound(type: any): (item: any) => any;
25
14
  function wasFound(type: any): (item: any) => any;
26
15
  function wasCreated(msg: any): (arr: any) => any;
27
- function wasCreated(msg: any): (arr: any) => any;
28
16
  function isTrue(crit: any, msg: any): boolean;
29
- function isTrue(crit: any, msg: any): boolean;
30
- function isFalse(crit: any, msg: any): boolean;
31
17
  function isFalse(crit: any, msg: any): boolean;
32
18
  }
33
19
  export function isCustomerReference(x: any): boolean;
34
- export function isCustomerReference(x: any): boolean;
35
- export function isCustomerLabelName(x: any): boolean;
36
20
  export function isCustomerLabelName(x: any): boolean;
37
21
  export namespace binanceChain {
38
- function isAddress(str: any): boolean;
39
22
  function isAddress(str: any): boolean;
40
23
  function isTxHash(str: any): boolean;
41
- function isTxHash(str: any): boolean;
42
24
  }
43
25
  export namespace bitcoin {
44
- function isAddress(str: any): any;
45
- function isAddress(str: any): any;
46
- function isBech32Address(str: any): boolean;
47
- function isBech32Address(str: any): boolean;
48
- function isHDPublicKey(str: any): boolean;
49
- function isHDPublicKey(str: any): boolean;
50
- function isPublicKey(str: any): boolean;
51
- function isPublicKey(str: any): boolean;
52
- function isTxHash(str: any): boolean;
53
- function isTxHash(str: any): boolean;
54
- function isTxHex(str: any): boolean;
55
- function isTxHex(str: any): boolean;
56
- function isHDPath(str: any): any;
57
- function isHDPath(str: any): any;
58
- function isScriptHex(str: any): boolean;
59
- function isScriptHex(str: any): boolean;
60
- function isTxSignature(str: any): boolean;
61
- function isTxSignature(str: any): boolean;
62
- function isBlockHeight(obj: any): boolean;
63
- function isBlockHeight(obj: any): boolean;
26
+ function isAddress(str: any, asset: any): any;
27
+ function isTxHash(str: any): boolean;
64
28
  }
65
29
  export namespace bitcoinCash {
66
- function isAddress(str: any): boolean;
67
30
  function isAddress(str: any): boolean;
68
31
  function isTxHash(str: any): boolean;
69
- function isTxHash(str: any): boolean;
70
32
  }
71
33
  export namespace ethereum {
72
- function isAddress(str: any): boolean;
73
34
  function isAddress(str: any): boolean;
74
35
  function isBlockHash(str: any): boolean;
75
- function isBlockHash(str: any): boolean;
76
- function isTxHash(str: any): boolean;
77
36
  function isTxHash(str: any): boolean;
78
37
  function isAddressCode(str: any): boolean;
79
- function isAddressCode(str: any): boolean;
80
- function isValidWeiAmount(str: any): boolean;
81
38
  function isValidWeiAmount(str: any): boolean;
82
39
  }
83
40
  export namespace horizen {
84
- function isAddress(str: any): any;
85
41
  function isAddress(str: any): any;
86
42
  function isTxHash(str: any): boolean;
87
- function isTxHash(str: any): boolean;
88
43
  }
89
44
  export namespace litecoin {
90
45
  function isAddress(str: any): boolean;
91
- function isAddress(str: any): boolean;
92
- function isTxHash(str: any): boolean;
93
46
  function isTxHash(str: any): boolean;
94
47
  }
95
48
  export namespace ripple {
96
49
  function isAddress(str: any): any;
97
- function isAddress(str: any): any;
98
- function isTxHash(str: any): boolean;
99
50
  function isTxHash(str: any): boolean;
100
51
  }
101
52
  export namespace stellar {
102
53
  function isAddress(str: any): boolean;
103
- function isAddress(str: any): boolean;
104
- function isTxHash(str: any): boolean;
105
54
  function isTxHash(str: any): boolean;
106
55
  }
107
56
  export namespace zcash {
108
- function isAddress(str: any): any;
109
57
  function isAddress(str: any): any;
110
58
  function isTxHash(str: any): boolean;
111
- function isTxHash(str: any): boolean;
112
59
  }
113
60
  export namespace zilliqa {
114
- function isAddress(str: any): boolean;
115
61
  function isAddress(str: any): boolean;
116
62
  function isTxHash(str: any): boolean;
117
- function isTxHash(str: any): boolean;
118
63
  }
119
64
  export namespace algorand {
120
65
  function isAddress(str: any): any;
121
- function isAddress(str: any): any;
122
- function isTxHash(str: any): boolean;
123
66
  function isTxHash(str: any): boolean;
124
67
  }
125
68
  export namespace tezos {
126
69
  function isAddress(str: any): any;
127
- function isAddress(str: any): any;
128
- function isTxHash(str: any): boolean;
129
70
  function isTxHash(str: any): boolean;
130
71
  }
131
72
  export namespace polkadot {
132
73
  function isAddress(str: any): any;
133
- function isAddress(str: any): any;
134
- function isTxHash(str: any): boolean;
135
74
  function isTxHash(str: any): boolean;
136
75
  }
137
76
  export namespace cardano {
138
- function isAddress(str: any): any;
139
77
  function isAddress(str: any): any;
140
78
  function isTxHash(str: any): boolean;
141
- function isTxHash(str: any): boolean;
142
79
  }
143
80
  export namespace cryptocom {
144
- function isAddress(str: any): any;
145
81
  function isAddress(str: any): any;
146
82
  function isTxHash(str: any): boolean;
147
- function isTxHash(str: any): boolean;
148
83
  }
149
84
  export namespace near {
150
85
  function isAddress(str: any): boolean;
86
+ function isTxHash(str: any): boolean;
87
+ }
88
+ export namespace doge {
151
89
  function isAddress(str: any): boolean;
152
90
  function isTxHash(str: any): boolean;
91
+ }
92
+ export namespace cosmos {
93
+ function isAddress(str: any): boolean;
153
94
  function isTxHash(str: any): boolean;
154
95
  }
155
- export namespace doge {
96
+ export namespace solana {
156
97
  function isAddress(str: any): boolean;
98
+ function isTxHash(str: any): boolean;
99
+ }
100
+ export namespace binanceSmartChain {
157
101
  function isAddress(str: any): boolean;
158
102
  function isTxHash(str: any): boolean;
103
+ }
104
+ export namespace polygon {
105
+ function isAddress(str: any): boolean;
159
106
  function isTxHash(str: any): boolean;
160
107
  }
161
- export namespace cosmos {
108
+ export namespace filecoin {
162
109
  function isAddress(str: any): boolean;
110
+ function isTxHash(str: any): boolean;
111
+ }
112
+ export namespace optimism {
163
113
  function isAddress(str: any): boolean;
164
114
  function isTxHash(str: any): boolean;
115
+ }
116
+ export namespace avalanche {
117
+ function isAddress(str: any): boolean;
165
118
  function isTxHash(str: any): boolean;
166
119
  }
167
- export namespace solana {
120
+ export namespace arbitrum {
168
121
  function isAddress(str: any): boolean;
122
+ function isTxHash(str: any): boolean;
123
+ }
124
+ export namespace tron {
125
+ function isAddress(str: any): any;
126
+ function isTxHash(str: any): boolean;
127
+ }
128
+ export namespace fantom {
169
129
  function isAddress(str: any): boolean;
170
130
  function isTxHash(str: any): boolean;
131
+ }
132
+ export namespace celo {
133
+ function isAddress(str: any): boolean;
171
134
  function isTxHash(str: any): boolean;
172
135
  }
173
- export namespace binanceSmartChain {
136
+ export namespace ethereumClassic {
174
137
  function isAddress(str: any): boolean;
138
+ function isTxHash(str: any): boolean;
139
+ }
140
+ export namespace mobilecoin {
175
141
  function isAddress(str: any): boolean;
176
142
  function isTxHash(str: any): boolean;
143
+ }
144
+ export namespace sui {
145
+ function isAddress(str: any): boolean;
177
146
  function isTxHash(str: any): boolean;
178
147
  }
179
- export namespace polygon {
148
+ export namespace flare {
180
149
  function isAddress(str: any): boolean;
150
+ function isTxHash(str: any): boolean;
151
+ }
152
+ export namespace ton {
181
153
  function isAddress(str: any): boolean;
182
154
  function isTxHash(str: any): boolean;
155
+ }
156
+ export namespace gnosis {
157
+ function isAddress(str: any): boolean;
183
158
  function isTxHash(str: any): boolean;
184
159
  }
185
- export namespace filecoin {
160
+ export namespace dydx {
186
161
  function isAddress(str: any): boolean;
162
+ function isTxHash(str: any): boolean;
163
+ }
164
+ export namespace hederaHashgraph {
187
165
  function isAddress(str: any): boolean;
188
166
  function isTxHash(str: any): boolean;
167
+ }
168
+ export namespace aptos {
169
+ function isAddress(str: any): boolean;
189
170
  function isTxHash(str: any): boolean;
190
171
  }
191
- export namespace optimism {
172
+ export namespace zksync {
192
173
  function isAddress(str: any): boolean;
174
+ function isTxHash(str: any): boolean;
175
+ }
176
+ export namespace haqq {
193
177
  function isAddress(str: any): boolean;
194
178
  function isTxHash(str: any): boolean;
179
+ }
180
+ export namespace base {
181
+ function isAddress(str: any): boolean;
195
182
  function isTxHash(str: any): boolean;
196
183
  }
197
- export namespace avalanche {
184
+ export namespace corechain {
198
185
  function isAddress(str: any): boolean;
186
+ function isTxHash(str: any): boolean;
187
+ }
188
+ export namespace worldchain {
199
189
  function isAddress(str: any): boolean;
200
190
  function isTxHash(str: any): boolean;
191
+ }
192
+ export namespace injective {
193
+ function isAddress(str: any): boolean;
201
194
  function isTxHash(str: any): boolean;
202
195
  }
203
- export namespace arbitrum {
196
+ export namespace linea {
204
197
  function isAddress(str: any): boolean;
198
+ function isTxHash(str: any): boolean;
199
+ }
200
+ export namespace xdc {
205
201
  function isAddress(str: any): boolean;
206
202
  function isTxHash(str: any): boolean;
203
+ }
204
+ export namespace internetcomputer {
205
+ function isAddress(str: any): boolean;
207
206
  function isTxHash(str: any): boolean;
208
207
  }
209
- export namespace tron {
210
- function isAddress(str: any): any;
208
+ export namespace unichain {
209
+ function isAddress(str: any): boolean;
210
+ function isTxHash(str: any): boolean;
211
+ }
212
+ export namespace sei {
213
+ function isAddress(str: any): boolean;
214
+ function isTxHash(str: any): boolean;
215
+ }
216
+ export namespace bittensor {
211
217
  function isAddress(str: any): any;
212
218
  function isTxHash(str: any): boolean;
219
+ }
220
+ export namespace codex {
221
+ function isAddress(str: any): boolean;
213
222
  function isTxHash(str: any): boolean;
214
223
  }
215
- export namespace fantom {
224
+ export namespace mantra {
216
225
  function isAddress(str: any): boolean;
226
+ function isTxHash(str: any): boolean;
227
+ }
228
+ export namespace nillion {
217
229
  function isAddress(str: any): boolean;
218
230
  function isTxHash(str: any): boolean;
231
+ }
232
+ export namespace canton {
233
+ function isAddress(str: any): boolean;
219
234
  function isTxHash(str: any): boolean;
220
235
  }
221
- export namespace celo {
236
+ export namespace starknet {
222
237
  function isAddress(str: any): boolean;
238
+ function isTxHash(str: any): boolean;
239
+ }
240
+ export namespace noble {
223
241
  function isAddress(str: any): boolean;
224
242
  function isTxHash(str: any): boolean;
243
+ }
244
+ export namespace assethub {
245
+ function isAddress(str: any): any;
225
246
  function isTxHash(str: any): boolean;
226
247
  }
227
- export namespace ethereumClassic {
248
+ export namespace plasma {
228
249
  function isAddress(str: any): boolean;
250
+ function isTxHash(str: any): boolean;
251
+ }
252
+ export namespace ink {
229
253
  function isAddress(str: any): boolean;
230
254
  function isTxHash(str: any): boolean;
255
+ }
256
+ export namespace xlayer {
257
+ function isAddress(str: any): boolean;
258
+ function isTxHash(str: any): boolean;
259
+ }
260
+ export namespace monad {
261
+ function isAddress(str: any): boolean;
262
+ function isTxHash(str: any): boolean;
263
+ }
264
+ export namespace hyperevm {
265
+ function isAddress(str: any): boolean;
266
+ function isTxHash(str: any): boolean;
267
+ }
268
+ export namespace tempo {
269
+ function isAddress(str: any): boolean;
270
+ function isTxHash(str: any): boolean;
271
+ }
272
+ export namespace morph {
273
+ function isAddress(str: any): boolean;
274
+ function isTxHash(str: any): boolean;
275
+ }
276
+ export namespace etherlink {
277
+ function isAddress(str: any): boolean;
278
+ function isTxHash(str: any): boolean;
279
+ }
280
+ export namespace edgex {
281
+ function isAddress(str: any): boolean;
231
282
  function isTxHash(str: any): boolean;
232
283
  }