@apiverve/spfvalidator 1.1.13 → 1.2.0

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 (4) hide show
  1. package/README.md +183 -152
  2. package/index.d.ts +36 -20
  3. package/index.js +4 -10
  4. package/package.json +5 -6
package/README.md CHANGED
@@ -122,116 +122,19 @@ async function makeRequest() {
122
122
  "status": "ok",
123
123
  "error": null,
124
124
  "data": {
125
- "authorized_ips": {
126
- "ipv4": [
127
- "63.208.226.34",
128
- "204.16.32.0/22",
129
- "67.134.143.0/24",
130
- "216.205.243.0/24",
131
- "34.85.156.5/32",
132
- "35.245.108.108/32",
133
- "34.86.129.193/32",
134
- "34.86.134.94/32",
135
- "34.85.222.234/32",
136
- "34.86.176.234/32",
137
- "34.86.125.212/32",
138
- "34.85.224.60/32",
139
- "34.86.160.49/32",
140
- "35.245.64.166/32",
141
- "35.188.226.11/32",
142
- "34.86.208.228/32",
143
- "34.85.216.144/32",
144
- "35.221.22.153/32",
145
- "34.86.137.108/32",
146
- "34.86.51.35/32",
147
- "34.150.221.40/32",
148
- "34.85.216.70/32",
149
- "34.86.37.191/32",
150
- "34.85.214.215/32",
151
- "35.236.234.82/32",
152
- "34.86.161.241/32",
153
- "216.32.181.16",
154
- "216.178.32.0/20",
155
- "168.235.224.0/24",
156
- "195.130.217.0/24",
157
- "91.220.42.0/24",
158
- "146.101.78.0/24",
159
- "207.82.80.0/24",
160
- "213.167.81.0/25",
161
- "193.7.207.0/25",
162
- "213.167.75.0/25",
163
- "185.58.85.0/24",
164
- "185.58.86.0/24",
165
- "193.7.206.0/25",
166
- "147.28.36.0/24",
167
- "207.211.31.0/25",
168
- "205.139.110.0/24",
169
- "216.205.24.0/24",
170
- "170.10.129.0/24",
171
- "63.128.21.0/24",
172
- "170.10.133.0/24",
173
- "185.58.84.93/32",
174
- "207.211.41.113/32",
175
- "207.211.30.64/26",
176
- "207.211.30.128/25",
177
- "216.145.221.0/24",
178
- "170.10.128.0/24",
179
- "170.10.132.56/29",
180
- "170.10.132.64/29",
181
- "41.74.192.0/22",
182
- "41.74.200.0/23",
183
- "41.74.196.0/22",
184
- "41.74.204.0/23",
185
- "41.74.206.0/24",
186
- "51.163.158.0/24",
187
- "194.104.109.0/24",
188
- "194.104.111.0/24",
189
- "194.104.110.21/32",
190
- "194.104.110.240/28",
191
- "62.140.10.21/32",
192
- "62.140.7.0/24",
193
- "194.104.108.240/29",
194
- "194.104.108.21/32",
195
- "103.13.69.0/24",
196
- "124.47.150.0/24",
197
- "124.47.189.0/24",
198
- "103.96.23.0/24",
199
- "103.96.21.0/24",
200
- "180.189.28.0/24",
201
- "216.145.217.0/24",
202
- "103.96.22.96/28",
203
- "103.96.22.22/32",
204
- "103.96.20.22/32",
205
- "103.96.20.96/28",
206
- "170.10.145.0/24",
207
- "170.10.147.0/24",
208
- "170.10.144.126/32",
209
- "170.10.146.126/32",
210
- "170.10.144.240/29",
211
- "170.10.146.240/29",
212
- "216.145.216.0/24"
213
- ]
214
- },
215
- "dns_lookups_num": 8,
216
- "domains_extracted": [
217
- "myspace.com",
218
- "_netblocks.mimecast.com",
219
- "eu._netblocks.mimecast.com",
220
- "us._netblocks.mimecast.com",
221
- "za._netblocks.mimecast.com",
222
- "de._netblocks.mimecast.com",
223
- "au._netblocks.mimecast.com",
224
- "ca._netblocks.mimecast.com"
225
- ],
226
- "elapsed_ms": 1118,
227
- "has_issues": false,
228
- "has_spf_record": true,
229
125
  "host": "myspace.com",
230
- "ip_pass": false,
231
- "macros_found": false,
126
+ "has_spf_record": true,
127
+ "dns_lookups_num": 9,
232
128
  "spf_record": "v=spf1 mx ip4:63.208.226.34 ip4:204.16.32.0/22 ip4:67.134.143.0/24 ip4:216.205.243.0/24 ip4:34.85.156.5/32 ip4:35.245.108.108/32 ip4:34.86.129.193/32 ip4:34.86.134.94/32 ip4:34.85.222.234/32 ip4:34.86.176.234/32 ip4:34.86.125.212/32 ip4:34.85.224.60/32 ip4:34.86.160.49/32 ip4:35.245.64.166/32 ip4:35.188.226.11/32 ip4:34.86.208.228/32 ip4:34.85.216.144/32 ip4:35.221.22.153/32 ip4:34.86.137.108/32 ip4:34.86.51.35/32 ip4:34.150.221.40/32 ip4:34.85.216.70/32 ip4:34.86.37.191/32 ip4:34.85.214.215/32 ip4:35.236.234.82/32 ip4:34.86.161.241/32 ip4:216.32.181.16 ip4:216.178.32.0/20 ip4:168.235.224.0/24 include:_netblocks.mimecast.com -all",
233
129
  "spf_records_list": [
234
130
  {
131
+ "origin": "myspace.com",
132
+ "record": "v=spf1 mx ip4:63.208.226.34 ip4:204.16.32.0/22 ip4:67.134.143.0/24 ip4:216.205.243.0/24 ip4:34.85.156.5/32 ip4:35.245.108.108/32 ip4:34.86.129.193/32 ip4:34.86.134.94/32 ip4:34.85.222.234/32 ip4:34.86.176.234/32 ip4:34.86.125.212/32 ip4:34.85.224.60/32 ip4:34.86.160.49/32 ip4:35.245.64.166/32 ip4:35.188.226.11/32 ip4:34.86.208.228/32 ip4:34.85.216.144/32 ip4:35.221.22.153/32 ip4:34.86.137.108/32 ip4:34.86.51.35/32 ip4:34.150.221.40/32 ip4:34.85.216.70/32 ip4:34.86.37.191/32 ip4:34.85.214.215/32 ip4:35.236.234.82/32 ip4:34.86.161.241/32 ip4:216.32.181.16 ip4:216.178.32.0/20 ip4:168.235.224.0/24 include:_netblocks.mimecast.com -all",
133
+ "chars_num": 637,
134
+ "use_macro": false,
135
+ "domains": [
136
+ "_netblocks.mimecast.com"
137
+ ],
235
138
  "authorized_ips": {
236
139
  "ipv4": [
237
140
  "63.208.226.34",
@@ -264,30 +167,28 @@ async function makeRequest() {
264
167
  "216.178.32.0/20",
265
168
  "168.235.224.0/24"
266
169
  ]
267
- },
268
- "chars_num": 637,
269
- "domains": [
270
- "_netblocks.mimecast.com"
271
- ],
272
- "origin": "myspace.com",
273
- "record": "v=spf1 mx ip4:63.208.226.34 ip4:204.16.32.0/22 ip4:67.134.143.0/24 ip4:216.205.243.0/24 ip4:34.85.156.5/32 ip4:35.245.108.108/32 ip4:34.86.129.193/32 ip4:34.86.134.94/32 ip4:34.85.222.234/32 ip4:34.86.176.234/32 ip4:34.86.125.212/32 ip4:34.85.224.60/32 ip4:34.86.160.49/32 ip4:35.245.64.166/32 ip4:35.188.226.11/32 ip4:34.86.208.228/32 ip4:34.85.216.144/32 ip4:35.221.22.153/32 ip4:34.86.137.108/32 ip4:34.86.51.35/32 ip4:34.150.221.40/32 ip4:34.85.216.70/32 ip4:34.86.37.191/32 ip4:34.85.214.215/32 ip4:35.236.234.82/32 ip4:34.86.161.241/32 ip4:216.32.181.16 ip4:216.178.32.0/20 ip4:168.235.224.0/24 include:_netblocks.mimecast.com -all",
274
- "use_macro": false
170
+ }
275
171
  },
276
172
  {
277
- "chars_num": 221,
173
+ "origin": "_netblocks.mimecast.com",
174
+ "record": "v=spf1 include:eu._netblocks.mimecast.com include:us._netblocks.mimecast.com include:za._netblocks.mimecast.com include:de._netblocks.mimecast.com include:au._netblocks.mimecast.com include:ca._netblocks.mimecast.com include:usb._netblocks.mimecast.com ~all",
175
+ "chars_num": 257,
176
+ "use_macro": false,
278
177
  "domains": [
279
178
  "eu._netblocks.mimecast.com",
280
179
  "us._netblocks.mimecast.com",
281
180
  "za._netblocks.mimecast.com",
282
181
  "de._netblocks.mimecast.com",
283
182
  "au._netblocks.mimecast.com",
284
- "ca._netblocks.mimecast.com"
285
- ],
286
- "origin": "_netblocks.mimecast.com",
287
- "record": "v=spf1 include:eu._netblocks.mimecast.com include:us._netblocks.mimecast.com include:za._netblocks.mimecast.com include:de._netblocks.mimecast.com include:au._netblocks.mimecast.com include:ca._netblocks.mimecast.com ~all",
288
- "use_macro": false
183
+ "ca._netblocks.mimecast.com",
184
+ "usb._netblocks.mimecast.com"
185
+ ]
289
186
  },
290
187
  {
188
+ "origin": "eu._netblocks.mimecast.com",
189
+ "record": "v=spf1 ip4:195.130.217.0/24 ip4:91.220.42.0/24 ip4:146.101.78.0/24 ip4:207.82.80.0/24 ip4:213.167.81.0/25 ip4:193.7.207.0/25 ip4:213.167.75.0/25 ip4:185.58.85.0/24 ip4:185.58.86.0/24 ip4:193.7.206.0/25 ip4:147.28.36.0/24 ~all",
190
+ "chars_num": 225,
191
+ "use_macro": false,
291
192
  "authorized_ips": {
292
193
  "ipv4": [
293
194
  "195.130.217.0/24",
@@ -302,13 +203,13 @@ async function makeRequest() {
302
203
  "193.7.206.0/25",
303
204
  "147.28.36.0/24"
304
205
  ]
305
- },
306
- "chars_num": 225,
307
- "origin": "eu._netblocks.mimecast.com",
308
- "record": "v=spf1 ip4:195.130.217.0/24 ip4:91.220.42.0/24 ip4:146.101.78.0/24 ip4:207.82.80.0/24 ip4:213.167.81.0/25 ip4:193.7.207.0/25 ip4:213.167.75.0/25 ip4:185.58.85.0/24 ip4:185.58.86.0/24 ip4:193.7.206.0/25 ip4:147.28.36.0/24 ~all",
309
- "use_macro": false
206
+ }
310
207
  },
311
208
  {
209
+ "origin": "us._netblocks.mimecast.com",
210
+ "record": "v=spf1 ip4:207.211.31.0/25 ip4:205.139.110.0/24 ip4:216.205.24.0/24 ip4:170.10.129.0/24 ip4:63.128.21.0/24 ip4:170.10.133.0/24 ip4:185.58.84.93/32 ip4:207.211.41.113/32 ip4:207.211.30.64/26 ip4:207.211.30.128/25 ip4:216.145.221.0/24 ip4:170.10.128.0/24 ip4:170.10.132.56/29 ip4:170.10.132.64/29 ~all",
211
+ "chars_num": 299,
212
+ "use_macro": false,
312
213
  "authorized_ips": {
313
214
  "ipv4": [
314
215
  "207.211.31.0/25",
@@ -326,13 +227,13 @@ async function makeRequest() {
326
227
  "170.10.132.56/29",
327
228
  "170.10.132.64/29"
328
229
  ]
329
- },
330
- "chars_num": 299,
331
- "origin": "us._netblocks.mimecast.com",
332
- "record": "v=spf1 ip4:207.211.31.0/25 ip4:205.139.110.0/24 ip4:216.205.24.0/24 ip4:170.10.129.0/24 ip4:63.128.21.0/24 ip4:170.10.133.0/24 ip4:185.58.84.93/32 ip4:207.211.41.113/32 ip4:207.211.30.64/26 ip4:207.211.30.128/25 ip4:216.145.221.0/24 ip4:170.10.128.0/24 ip4:170.10.132.56/29 ip4:170.10.132.64/29 ~all",
333
- "use_macro": false
230
+ }
334
231
  },
335
232
  {
233
+ "origin": "za._netblocks.mimecast.com",
234
+ "record": "v=spf1 ip4:41.74.192.0/22 ip4:41.74.200.0/23 ip4:41.74.196.0/22 ip4:41.74.204.0/23 ip4:41.74.206.0/24 ~all",
235
+ "chars_num": 106,
236
+ "use_macro": false,
336
237
  "authorized_ips": {
337
238
  "ipv4": [
338
239
  "41.74.192.0/22",
@@ -341,13 +242,13 @@ async function makeRequest() {
341
242
  "41.74.204.0/23",
342
243
  "41.74.206.0/24"
343
244
  ]
344
- },
345
- "chars_num": 106,
346
- "origin": "za._netblocks.mimecast.com",
347
- "record": "v=spf1 ip4:41.74.192.0/22 ip4:41.74.200.0/23 ip4:41.74.196.0/22 ip4:41.74.204.0/23 ip4:41.74.206.0/24 ~all",
348
- "use_macro": false
245
+ }
349
246
  },
350
247
  {
248
+ "origin": "de._netblocks.mimecast.com",
249
+ "record": "v=spf1 ip4:51.163.158.0/24 ip4:194.104.109.0/24 ip4:194.104.111.0/24 ip4:194.104.110.21/32 ip4:194.104.110.240/28 ip4:62.140.10.21/32 ip4:62.140.7.0/24 ip4:194.104.108.240/29 ip4:194.104.108.21/32 ip4:51.163.159.0/24 ~all",
250
+ "chars_num": 221,
251
+ "use_macro": false,
351
252
  "authorized_ips": {
352
253
  "ipv4": [
353
254
  "51.163.158.0/24",
@@ -358,15 +259,16 @@ async function makeRequest() {
358
259
  "62.140.10.21/32",
359
260
  "62.140.7.0/24",
360
261
  "194.104.108.240/29",
361
- "194.104.108.21/32"
262
+ "194.104.108.21/32",
263
+ "51.163.159.0/24"
362
264
  ]
363
- },
364
- "chars_num": 201,
365
- "origin": "de._netblocks.mimecast.com",
366
- "record": "v=spf1 ip4:51.163.158.0/24 ip4:194.104.109.0/24 ip4:194.104.111.0/24 ip4:194.104.110.21/32 ip4:194.104.110.240/28 ip4:62.140.10.21/32 ip4:62.140.7.0/24 ip4:194.104.108.240/29 ip4:194.104.108.21/32 ~all",
367
- "use_macro": false
265
+ }
368
266
  },
369
267
  {
268
+ "origin": "au._netblocks.mimecast.com",
269
+ "record": "v=spf1 ip4:103.13.69.0/24 ip4:124.47.150.0/24 ip4:124.47.189.0/24 ip4:103.96.23.0/24 ip4:103.96.21.0/24 ip4:180.189.28.0/24 ip4:216.145.217.0/24 ip4:103.96.22.96/28 ip4:103.96.22.22/32 ip4:103.96.20.22/32 ip4:103.96.20.96/28 ~all",
270
+ "chars_num": 229,
271
+ "use_macro": false,
370
272
  "authorized_ips": {
371
273
  "ipv4": [
372
274
  "103.13.69.0/24",
@@ -381,13 +283,13 @@ async function makeRequest() {
381
283
  "103.96.20.22/32",
382
284
  "103.96.20.96/28"
383
285
  ]
384
- },
385
- "chars_num": 229,
386
- "origin": "au._netblocks.mimecast.com",
387
- "record": "v=spf1 ip4:103.13.69.0/24 ip4:124.47.150.0/24 ip4:124.47.189.0/24 ip4:103.96.23.0/24 ip4:103.96.21.0/24 ip4:180.189.28.0/24 ip4:216.145.217.0/24 ip4:103.96.22.96/28 ip4:103.96.22.22/32 ip4:103.96.20.22/32 ip4:103.96.20.96/28 ~all",
388
- "use_macro": false
286
+ }
389
287
  },
390
288
  {
289
+ "origin": "ca._netblocks.mimecast.com",
290
+ "record": "v=spf1 ip4:170.10.145.0/24 ip4:170.10.147.0/24 ip4:170.10.144.126/32 ip4:170.10.146.126/32 ip4:170.10.144.240/29 ip4:170.10.146.240/29 ip4:216.145.216.0/24 ~all",
291
+ "chars_num": 160,
292
+ "use_macro": false,
391
293
  "authorized_ips": {
392
294
  "ipv4": [
393
295
  "170.10.145.0/24",
@@ -398,14 +300,143 @@ async function makeRequest() {
398
300
  "170.10.146.240/29",
399
301
  "216.145.216.0/24"
400
302
  ]
401
- },
402
- "chars_num": 160,
403
- "origin": "ca._netblocks.mimecast.com",
404
- "record": "v=spf1 ip4:170.10.145.0/24 ip4:170.10.147.0/24 ip4:170.10.144.126/32 ip4:170.10.146.126/32 ip4:170.10.144.240/29 ip4:170.10.146.240/29 ip4:216.145.216.0/24 ~all",
405
- "use_macro": false
303
+ }
304
+ },
305
+ {
306
+ "origin": "usb._netblocks.mimecast.com",
307
+ "record": "v=spf1 ip4:170.10.151.0/24 ip4:170.10.153.0/24 ip4:170.10.150.240/29 ip4:170.10.152.240/29 ip4:170.10.156.0/24 ip4:170.10.157.0/24 ~all",
308
+ "chars_num": 135,
309
+ "use_macro": false,
310
+ "authorized_ips": {
311
+ "ipv4": [
312
+ "170.10.151.0/24",
313
+ "170.10.153.0/24",
314
+ "170.10.150.240/29",
315
+ "170.10.152.240/29",
316
+ "170.10.156.0/24",
317
+ "170.10.157.0/24"
318
+ ]
319
+ }
406
320
  }
407
321
  ],
408
- "spf_valid": true
322
+ "domains_extracted": [
323
+ "myspace.com",
324
+ "_netblocks.mimecast.com",
325
+ "eu._netblocks.mimecast.com",
326
+ "us._netblocks.mimecast.com",
327
+ "za._netblocks.mimecast.com",
328
+ "de._netblocks.mimecast.com",
329
+ "au._netblocks.mimecast.com",
330
+ "ca._netblocks.mimecast.com",
331
+ "usb._netblocks.mimecast.com"
332
+ ],
333
+ "authorized_ips": {
334
+ "ipv4": [
335
+ "63.208.226.34",
336
+ "204.16.32.0/22",
337
+ "67.134.143.0/24",
338
+ "216.205.243.0/24",
339
+ "34.85.156.5/32",
340
+ "35.245.108.108/32",
341
+ "34.86.129.193/32",
342
+ "34.86.134.94/32",
343
+ "34.85.222.234/32",
344
+ "34.86.176.234/32",
345
+ "34.86.125.212/32",
346
+ "34.85.224.60/32",
347
+ "34.86.160.49/32",
348
+ "35.245.64.166/32",
349
+ "35.188.226.11/32",
350
+ "34.86.208.228/32",
351
+ "34.85.216.144/32",
352
+ "35.221.22.153/32",
353
+ "34.86.137.108/32",
354
+ "34.86.51.35/32",
355
+ "34.150.221.40/32",
356
+ "34.85.216.70/32",
357
+ "34.86.37.191/32",
358
+ "34.85.214.215/32",
359
+ "35.236.234.82/32",
360
+ "34.86.161.241/32",
361
+ "216.32.181.16",
362
+ "216.178.32.0/20",
363
+ "168.235.224.0/24",
364
+ "195.130.217.0/24",
365
+ "91.220.42.0/24",
366
+ "146.101.78.0/24",
367
+ "207.82.80.0/24",
368
+ "213.167.81.0/25",
369
+ "193.7.207.0/25",
370
+ "213.167.75.0/25",
371
+ "185.58.85.0/24",
372
+ "185.58.86.0/24",
373
+ "193.7.206.0/25",
374
+ "147.28.36.0/24",
375
+ "207.211.31.0/25",
376
+ "205.139.110.0/24",
377
+ "216.205.24.0/24",
378
+ "170.10.129.0/24",
379
+ "63.128.21.0/24",
380
+ "170.10.133.0/24",
381
+ "185.58.84.93/32",
382
+ "207.211.41.113/32",
383
+ "207.211.30.64/26",
384
+ "207.211.30.128/25",
385
+ "216.145.221.0/24",
386
+ "170.10.128.0/24",
387
+ "170.10.132.56/29",
388
+ "170.10.132.64/29",
389
+ "41.74.192.0/22",
390
+ "41.74.200.0/23",
391
+ "41.74.196.0/22",
392
+ "41.74.204.0/23",
393
+ "41.74.206.0/24",
394
+ "51.163.158.0/24",
395
+ "194.104.109.0/24",
396
+ "194.104.111.0/24",
397
+ "194.104.110.21/32",
398
+ "194.104.110.240/28",
399
+ "62.140.10.21/32",
400
+ "62.140.7.0/24",
401
+ "194.104.108.240/29",
402
+ "194.104.108.21/32",
403
+ "51.163.159.0/24",
404
+ "103.13.69.0/24",
405
+ "124.47.150.0/24",
406
+ "124.47.189.0/24",
407
+ "103.96.23.0/24",
408
+ "103.96.21.0/24",
409
+ "180.189.28.0/24",
410
+ "216.145.217.0/24",
411
+ "103.96.22.96/28",
412
+ "103.96.22.22/32",
413
+ "103.96.20.22/32",
414
+ "103.96.20.96/28",
415
+ "170.10.145.0/24",
416
+ "170.10.147.0/24",
417
+ "170.10.144.126/32",
418
+ "170.10.146.126/32",
419
+ "170.10.144.240/29",
420
+ "170.10.146.240/29",
421
+ "216.145.216.0/24",
422
+ "170.10.151.0/24",
423
+ "170.10.153.0/24",
424
+ "170.10.150.240/29",
425
+ "170.10.152.240/29",
426
+ "170.10.156.0/24",
427
+ "170.10.157.0/24"
428
+ ],
429
+ "ipv6": []
430
+ },
431
+ "issues_found": [],
432
+ "spf_valid": true,
433
+ "has_issues": false,
434
+ "macros_found": false,
435
+ "ip_pass": false,
436
+ "elapsed_ms": 431,
437
+ "all_qualifier": "fail",
438
+ "risk_score": 5,
439
+ "risk_level": "low"
409
440
  }
410
441
  }
411
442
  ```
package/index.d.ts CHANGED
@@ -4,40 +4,56 @@ declare module '@apiverve/spfvalidator' {
4
4
  secure?: boolean;
5
5
  }
6
6
 
7
+ /**
8
+ * Describes fields the current plan does not unlock. Locked fields arrive as null
9
+ * in `data`; `locked_fields` names them, using dot paths for nested fields.
10
+ * Absent when the plan unlocks everything.
11
+ */
12
+ export interface PremiumInfo {
13
+ message: string;
14
+ upgrade_url: string;
15
+ locked_fields: string[];
16
+ }
17
+
7
18
  export interface spfvalidatorResponse {
8
19
  status: string;
9
20
  error: string | null;
10
21
  data: SPFValidatorData;
11
22
  code?: number;
23
+ premium?: PremiumInfo;
12
24
  }
13
25
 
14
26
 
15
27
  interface SPFValidatorData {
16
- authorizedIPS: AuthorizedIPS;
17
- dnsLookupsNum: number;
18
- domainsExtracted: string[];
19
- elapsedMS: number;
20
- hasIssues: boolean;
21
- hasSPFRecord: boolean;
22
- host: string;
23
- ipPass: boolean;
24
- macrosFound: boolean;
25
- spfRecord: string;
28
+ host: null | string;
29
+ hasSPFRecord: boolean | null;
30
+ dnsLookupsNum: number | null;
31
+ spfRecord: null | string;
26
32
  spfRecordsList: SPFRecordsList[];
27
- spfValid: boolean;
28
- }
29
-
30
- interface AuthorizedIPS {
31
- ipv4: string[];
33
+ domainsExtracted: (null | string)[];
34
+ authorizedIPS: { [key: string]: (null | string)[] };
35
+ issuesFound: any[];
36
+ spfValid: boolean | null;
37
+ hasIssues: boolean | null;
38
+ macrosFound: boolean | null;
39
+ ipPass: boolean | null;
40
+ elapsedMS: number | null;
41
+ allQualifier: null | string;
42
+ riskScore: number | null;
43
+ riskLevel: null | string;
32
44
  }
33
45
 
34
46
  interface SPFRecordsList {
47
+ origin: null | string;
48
+ record: null | string;
49
+ charsNum: number | null;
50
+ useMacro: boolean | null;
51
+ domains?: (null | string)[];
35
52
  authorizedIPS?: AuthorizedIPS;
36
- charsNum: number;
37
- domains?: string[];
38
- origin: string;
39
- record: string;
40
- useMacro: boolean;
53
+ }
54
+
55
+ interface AuthorizedIPS {
56
+ ipv4: (null | string)[];
41
57
  }
42
58
 
43
59
  export default class spfvalidatorWrapper {
package/index.js CHANGED
@@ -13,16 +13,10 @@ class spfvalidatorWrapper {
13
13
  throw new Error('API key must be provided as a non-empty string. Get your API key at: https://apiverve.com');
14
14
  }
15
15
 
16
- // Validate API key format (GUID or alphanumeric with hyphens)
17
- const apiKeyPattern = /^[a-zA-Z0-9-]+$/;
16
+ // Validate API key format (GUID, prefixed keys like apv_xxx, or alphanumeric)
17
+ const apiKeyPattern = /^[a-zA-Z0-9_-]+$/;
18
18
  if (!apiKeyPattern.test(api_key)) {
19
- throw new Error('Invalid API key format. API key must be alphanumeric and may contain hyphens. Get your API key at: https://apiverve.com');
20
- }
21
-
22
- // Check minimum length (GUIDs are typically 36 chars with hyphens, or 32 without)
23
- const trimmedKey = api_key.replace(/-/g, '');
24
- if (trimmedKey.length < 32) {
25
- throw new Error('Invalid API key. API key appears to be too short. Get your API key at: https://apiverve.com');
19
+ throw new Error('Invalid API key format. API key must be alphanumeric and may contain hyphens and underscores. Get your API key at: https://apiverve.com');
26
20
  }
27
21
 
28
22
  if (typeof secure !== 'boolean') {
@@ -36,7 +30,7 @@ class spfvalidatorWrapper {
36
30
  this.baseURL = 'https://api.apiverve.com/v1/spfvalidator';
37
31
 
38
32
  // Validation rules for parameters (generated from schema)
39
- this.validationRules = {"domain":{"type":"string","required":true}};
33
+ this.validationRules = {"domain":{"type":"string","required":true,"format":"domain"}};
40
34
  }
41
35
 
42
36
  /**
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@apiverve/spfvalidator",
3
- "version": "1.1.13",
3
+ "version": "1.2.0",
4
4
  "description": "SPF Validator checks the Sender Policy Framework (SPF) DNS record for a domain to verify if it’s valid and optionally whether a given IP address is authorized to send emails for that domain.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
7
7
  "sideEffects": false,
8
8
  "engines": {
9
- "node": ">=14.0.0"
9
+ "node": ">=18.0.0"
10
10
  },
11
11
  "files": [
12
12
  "index.js",
@@ -23,7 +23,7 @@
23
23
  "directory": "npm"
24
24
  },
25
25
  "keywords": [
26
- ""
26
+ "spf", "spf check", "spf validator", "spf test", "email authentication"
27
27
  ],
28
28
  "author": {
29
29
  "name": "APIVerve",
@@ -41,8 +41,7 @@
41
41
  "dotenv": "^16.4.7"
42
42
  },
43
43
  "dependencies": {
44
- "node-fetch": "^3.3.2",
45
- "promise": "^8.3.0",
46
- "axios": "1.13.2"
44
+ "axios": "1.13.2",
45
+ "form-data": "^4.0.1"
47
46
  }
48
47
  }