doc-detective 4.0.2-dev.6 → 4.0.2-dev.8

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.
package/dist/index.cjs CHANGED
@@ -107,6 +107,26 @@ var schemas_default = {
107
107
  307,
108
108
  308
109
109
  ]
110
+ },
111
+ headers: {
112
+ description: "Additional HTTP headers to include in the request. Merged on top of Doc Detective's default browser-mimicking headers. Useful for sites behind bot protection or WAFs that allowlist specific headers (for example, a Cloudflare Access service token or a `Cookie` with a `cf_clearance` value).",
113
+ default: {},
114
+ anyOf: [
115
+ {
116
+ title: "Request headers (object)",
117
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
118
+ type: "object",
119
+ additionalProperties: {
120
+ type: "string"
121
+ },
122
+ properties: {}
123
+ },
124
+ {
125
+ title: "Request headers (string)",
126
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
127
+ type: "string"
128
+ }
129
+ ]
110
130
  }
111
131
  }
112
132
  }
@@ -170,6 +190,26 @@ var schemas_default = {
170
190
  307,
171
191
  308
172
192
  ]
193
+ },
194
+ headers: {
195
+ description: "Additional HTTP headers to include in the request. Merged on top of Doc Detective's default browser-mimicking headers. Useful for sites behind bot protection or WAFs that allowlist specific headers (for example, a Cloudflare Access service token or a `Cookie` with a `cf_clearance` value).",
196
+ default: {},
197
+ anyOf: [
198
+ {
199
+ title: "Request headers (object)",
200
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
201
+ type: "object",
202
+ additionalProperties: {
203
+ type: "string"
204
+ },
205
+ properties: {}
206
+ },
207
+ {
208
+ title: "Request headers (string)",
209
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
210
+ type: "string"
211
+ }
212
+ ]
173
213
  }
174
214
  }
175
215
  }
@@ -494,6 +534,18 @@ var schemas_default = {
494
534
  type: "string",
495
535
  default: "."
496
536
  },
537
+ reporters: {
538
+ description: "Reporters to use when emitting test results. Built-in reporters: `terminal`, `json`, `html`. Custom reporters registered via `registerReporter()` can also be referenced by name.",
539
+ type: "array",
540
+ items: {
541
+ type: "string",
542
+ minLength: 1
543
+ },
544
+ default: [
545
+ "terminal",
546
+ "json"
547
+ ]
548
+ },
497
549
  recursive: {
498
550
  description: "If `true` searches `input`, `setup`, and `cleanup` paths recursively for test specifications and source files.",
499
551
  type: "boolean",
@@ -1559,6 +1611,26 @@ var schemas_default = {
1559
1611
  307,
1560
1612
  308
1561
1613
  ]
1614
+ },
1615
+ headers: {
1616
+ description: "Additional HTTP headers to include in the request. Merged on top of Doc Detective's default browser-mimicking headers. Useful for sites behind bot protection or WAFs that allowlist specific headers (for example, a Cloudflare Access service token or a `Cookie` with a `cf_clearance` value).",
1617
+ default: {},
1618
+ anyOf: [
1619
+ {
1620
+ title: "Request headers (object)",
1621
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
1622
+ type: "object",
1623
+ additionalProperties: {
1624
+ type: "string"
1625
+ },
1626
+ properties: {}
1627
+ },
1628
+ {
1629
+ title: "Request headers (string)",
1630
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
1631
+ type: "string"
1632
+ }
1633
+ ]
1562
1634
  }
1563
1635
  }
1564
1636
  }
@@ -1622,6 +1694,26 @@ var schemas_default = {
1622
1694
  307,
1623
1695
  308
1624
1696
  ]
1697
+ },
1698
+ headers: {
1699
+ description: "Additional HTTP headers to include in the request. Merged on top of Doc Detective's default browser-mimicking headers. Useful for sites behind bot protection or WAFs that allowlist specific headers (for example, a Cloudflare Access service token or a `Cookie` with a `cf_clearance` value).",
1700
+ default: {},
1701
+ anyOf: [
1702
+ {
1703
+ title: "Request headers (object)",
1704
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
1705
+ type: "object",
1706
+ additionalProperties: {
1707
+ type: "string"
1708
+ },
1709
+ properties: {}
1710
+ },
1711
+ {
1712
+ title: "Request headers (string)",
1713
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
1714
+ type: "string"
1715
+ }
1716
+ ]
1625
1717
  }
1626
1718
  }
1627
1719
  }
@@ -10182,6 +10274,26 @@ var schemas_default = {
10182
10274
  307,
10183
10275
  308
10184
10276
  ]
10277
+ },
10278
+ headers: {
10279
+ description: "Additional HTTP headers to include in the request. Merged on top of Doc Detective's default browser-mimicking headers. Useful for sites behind bot protection or WAFs that allowlist specific headers (for example, a Cloudflare Access service token or a `Cookie` with a `cf_clearance` value).",
10280
+ default: {},
10281
+ anyOf: [
10282
+ {
10283
+ title: "Request headers (object)",
10284
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
10285
+ type: "object",
10286
+ additionalProperties: {
10287
+ type: "string"
10288
+ },
10289
+ properties: {}
10290
+ },
10291
+ {
10292
+ title: "Request headers (string)",
10293
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
10294
+ type: "string"
10295
+ }
10296
+ ]
10185
10297
  }
10186
10298
  }
10187
10299
  }
@@ -10245,6 +10357,26 @@ var schemas_default = {
10245
10357
  307,
10246
10358
  308
10247
10359
  ]
10360
+ },
10361
+ headers: {
10362
+ description: "Additional HTTP headers to include in the request. Merged on top of Doc Detective's default browser-mimicking headers. Useful for sites behind bot protection or WAFs that allowlist specific headers (for example, a Cloudflare Access service token or a `Cookie` with a `cf_clearance` value).",
10363
+ default: {},
10364
+ anyOf: [
10365
+ {
10366
+ title: "Request headers (object)",
10367
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
10368
+ type: "object",
10369
+ additionalProperties: {
10370
+ type: "string"
10371
+ },
10372
+ properties: {}
10373
+ },
10374
+ {
10375
+ title: "Request headers (string)",
10376
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
10377
+ type: "string"
10378
+ }
10379
+ ]
10248
10380
  }
10249
10381
  }
10250
10382
  }
@@ -17845,6 +17977,11 @@ var schemas_default = {
17845
17977
  loadVariables: ".env",
17846
17978
  fileTypes: [
17847
17979
  "markdown"
17980
+ ],
17981
+ reporters: [
17982
+ "terminal",
17983
+ "json",
17984
+ "html"
17848
17985
  ]
17849
17986
  },
17850
17987
  {
@@ -22153,6 +22290,18 @@ var schemas_default = {
22153
22290
  type: "string",
22154
22291
  default: "."
22155
22292
  },
22293
+ reporters: {
22294
+ description: "Reporters to use when emitting test results. Built-in reporters: `terminal`, `json`, `html`. Custom reporters registered via `registerReporter()` can also be referenced by name.",
22295
+ type: "array",
22296
+ items: {
22297
+ type: "string",
22298
+ minLength: 1
22299
+ },
22300
+ default: [
22301
+ "terminal",
22302
+ "json"
22303
+ ]
22304
+ },
22156
22305
  recursive: {
22157
22306
  description: "If `true` searches `input`, `setup`, and `cleanup` paths recursively for test specifications and source files.",
22158
22307
  type: "boolean",
@@ -23218,6 +23367,26 @@ var schemas_default = {
23218
23367
  307,
23219
23368
  308
23220
23369
  ]
23370
+ },
23371
+ headers: {
23372
+ description: "Additional HTTP headers to include in the request. Merged on top of Doc Detective's default browser-mimicking headers. Useful for sites behind bot protection or WAFs that allowlist specific headers (for example, a Cloudflare Access service token or a `Cookie` with a `cf_clearance` value).",
23373
+ default: {},
23374
+ anyOf: [
23375
+ {
23376
+ title: "Request headers (object)",
23377
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
23378
+ type: "object",
23379
+ additionalProperties: {
23380
+ type: "string"
23381
+ },
23382
+ properties: {}
23383
+ },
23384
+ {
23385
+ title: "Request headers (string)",
23386
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
23387
+ type: "string"
23388
+ }
23389
+ ]
23221
23390
  }
23222
23391
  }
23223
23392
  }
@@ -23281,6 +23450,26 @@ var schemas_default = {
23281
23450
  307,
23282
23451
  308
23283
23452
  ]
23453
+ },
23454
+ headers: {
23455
+ description: "Additional HTTP headers to include in the request. Merged on top of Doc Detective's default browser-mimicking headers. Useful for sites behind bot protection or WAFs that allowlist specific headers (for example, a Cloudflare Access service token or a `Cookie` with a `cf_clearance` value).",
23456
+ default: {},
23457
+ anyOf: [
23458
+ {
23459
+ title: "Request headers (object)",
23460
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
23461
+ type: "object",
23462
+ additionalProperties: {
23463
+ type: "string"
23464
+ },
23465
+ properties: {}
23466
+ },
23467
+ {
23468
+ title: "Request headers (string)",
23469
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
23470
+ type: "string"
23471
+ }
23472
+ ]
23284
23473
  }
23285
23474
  }
23286
23475
  }
@@ -31841,6 +32030,26 @@ var schemas_default = {
31841
32030
  307,
31842
32031
  308
31843
32032
  ]
32033
+ },
32034
+ headers: {
32035
+ description: "Additional HTTP headers to include in the request. Merged on top of Doc Detective's default browser-mimicking headers. Useful for sites behind bot protection or WAFs that allowlist specific headers (for example, a Cloudflare Access service token or a `Cookie` with a `cf_clearance` value).",
32036
+ default: {},
32037
+ anyOf: [
32038
+ {
32039
+ title: "Request headers (object)",
32040
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
32041
+ type: "object",
32042
+ additionalProperties: {
32043
+ type: "string"
32044
+ },
32045
+ properties: {}
32046
+ },
32047
+ {
32048
+ title: "Request headers (string)",
32049
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
32050
+ type: "string"
32051
+ }
32052
+ ]
31844
32053
  }
31845
32054
  }
31846
32055
  }
@@ -31904,6 +32113,26 @@ var schemas_default = {
31904
32113
  307,
31905
32114
  308
31906
32115
  ]
32116
+ },
32117
+ headers: {
32118
+ description: "Additional HTTP headers to include in the request. Merged on top of Doc Detective's default browser-mimicking headers. Useful for sites behind bot protection or WAFs that allowlist specific headers (for example, a Cloudflare Access service token or a `Cookie` with a `cf_clearance` value).",
32119
+ default: {},
32120
+ anyOf: [
32121
+ {
32122
+ title: "Request headers (object)",
32123
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
32124
+ type: "object",
32125
+ additionalProperties: {
32126
+ type: "string"
32127
+ },
32128
+ properties: {}
32129
+ },
32130
+ {
32131
+ title: "Request headers (string)",
32132
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
32133
+ type: "string"
32134
+ }
32135
+ ]
31907
32136
  }
31908
32137
  }
31909
32138
  }
@@ -39504,6 +39733,11 @@ var schemas_default = {
39504
39733
  loadVariables: ".env",
39505
39734
  fileTypes: [
39506
39735
  "markdown"
39736
+ ],
39737
+ reporters: [
39738
+ "terminal",
39739
+ "json",
39740
+ "html"
39507
39741
  ]
39508
39742
  },
39509
39743
  {
@@ -41153,6 +41387,26 @@ var schemas_default = {
41153
41387
  307,
41154
41388
  308
41155
41389
  ]
41390
+ },
41391
+ headers: {
41392
+ description: "Additional HTTP headers to include in the request. Merged on top of Doc Detective's default browser-mimicking headers. Useful for sites behind bot protection or WAFs that allowlist specific headers (for example, a Cloudflare Access service token or a `Cookie` with a `cf_clearance` value).",
41393
+ default: {},
41394
+ anyOf: [
41395
+ {
41396
+ title: "Request headers (object)",
41397
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
41398
+ type: "object",
41399
+ additionalProperties: {
41400
+ type: "string"
41401
+ },
41402
+ properties: {}
41403
+ },
41404
+ {
41405
+ title: "Request headers (string)",
41406
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
41407
+ type: "string"
41408
+ }
41409
+ ]
41156
41410
  }
41157
41411
  }
41158
41412
  }
@@ -41216,6 +41470,26 @@ var schemas_default = {
41216
41470
  307,
41217
41471
  308
41218
41472
  ]
41473
+ },
41474
+ headers: {
41475
+ description: "Additional HTTP headers to include in the request. Merged on top of Doc Detective's default browser-mimicking headers. Useful for sites behind bot protection or WAFs that allowlist specific headers (for example, a Cloudflare Access service token or a `Cookie` with a `cf_clearance` value).",
41476
+ default: {},
41477
+ anyOf: [
41478
+ {
41479
+ title: "Request headers (object)",
41480
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
41481
+ type: "object",
41482
+ additionalProperties: {
41483
+ type: "string"
41484
+ },
41485
+ properties: {}
41486
+ },
41487
+ {
41488
+ title: "Request headers (string)",
41489
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
41490
+ type: "string"
41491
+ }
41492
+ ]
41219
41493
  }
41220
41494
  }
41221
41495
  }
@@ -49250,6 +49524,26 @@ var schemas_default = {
49250
49524
  307,
49251
49525
  308
49252
49526
  ]
49527
+ },
49528
+ headers: {
49529
+ description: "Additional HTTP headers to include in the request. Merged on top of Doc Detective's default browser-mimicking headers. Useful for sites behind bot protection or WAFs that allowlist specific headers (for example, a Cloudflare Access service token or a `Cookie` with a `cf_clearance` value).",
49530
+ default: {},
49531
+ anyOf: [
49532
+ {
49533
+ title: "Request headers (object)",
49534
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
49535
+ type: "object",
49536
+ additionalProperties: {
49537
+ type: "string"
49538
+ },
49539
+ properties: {}
49540
+ },
49541
+ {
49542
+ title: "Request headers (string)",
49543
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
49544
+ type: "string"
49545
+ }
49546
+ ]
49253
49547
  }
49254
49548
  }
49255
49549
  }
@@ -49313,6 +49607,26 @@ var schemas_default = {
49313
49607
  307,
49314
49608
  308
49315
49609
  ]
49610
+ },
49611
+ headers: {
49612
+ description: "Additional HTTP headers to include in the request. Merged on top of Doc Detective's default browser-mimicking headers. Useful for sites behind bot protection or WAFs that allowlist specific headers (for example, a Cloudflare Access service token or a `Cookie` with a `cf_clearance` value).",
49613
+ default: {},
49614
+ anyOf: [
49615
+ {
49616
+ title: "Request headers (object)",
49617
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
49618
+ type: "object",
49619
+ additionalProperties: {
49620
+ type: "string"
49621
+ },
49622
+ properties: {}
49623
+ },
49624
+ {
49625
+ title: "Request headers (string)",
49626
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
49627
+ type: "string"
49628
+ }
49629
+ ]
49316
49630
  }
49317
49631
  }
49318
49632
  }
@@ -59057,6 +59371,26 @@ var schemas_default = {
59057
59371
  307,
59058
59372
  308
59059
59373
  ]
59374
+ },
59375
+ headers: {
59376
+ description: "Additional HTTP headers to include in the request. Merged on top of Doc Detective's default browser-mimicking headers. Useful for sites behind bot protection or WAFs that allowlist specific headers (for example, a Cloudflare Access service token or a `Cookie` with a `cf_clearance` value).",
59377
+ default: {},
59378
+ anyOf: [
59379
+ {
59380
+ title: "Request headers (object)",
59381
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
59382
+ type: "object",
59383
+ additionalProperties: {
59384
+ type: "string"
59385
+ },
59386
+ properties: {}
59387
+ },
59388
+ {
59389
+ title: "Request headers (string)",
59390
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
59391
+ type: "string"
59392
+ }
59393
+ ]
59060
59394
  }
59061
59395
  }
59062
59396
  }
@@ -59120,6 +59454,26 @@ var schemas_default = {
59120
59454
  307,
59121
59455
  308
59122
59456
  ]
59457
+ },
59458
+ headers: {
59459
+ description: "Additional HTTP headers to include in the request. Merged on top of Doc Detective's default browser-mimicking headers. Useful for sites behind bot protection or WAFs that allowlist specific headers (for example, a Cloudflare Access service token or a `Cookie` with a `cf_clearance` value).",
59460
+ default: {},
59461
+ anyOf: [
59462
+ {
59463
+ title: "Request headers (object)",
59464
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
59465
+ type: "object",
59466
+ additionalProperties: {
59467
+ type: "string"
59468
+ },
59469
+ properties: {}
59470
+ },
59471
+ {
59472
+ title: "Request headers (string)",
59473
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
59474
+ type: "string"
59475
+ }
59476
+ ]
59123
59477
  }
59124
59478
  }
59125
59479
  }
@@ -67154,6 +67508,26 @@ var schemas_default = {
67154
67508
  307,
67155
67509
  308
67156
67510
  ]
67511
+ },
67512
+ headers: {
67513
+ description: "Additional HTTP headers to include in the request. Merged on top of Doc Detective's default browser-mimicking headers. Useful for sites behind bot protection or WAFs that allowlist specific headers (for example, a Cloudflare Access service token or a `Cookie` with a `cf_clearance` value).",
67514
+ default: {},
67515
+ anyOf: [
67516
+ {
67517
+ title: "Request headers (object)",
67518
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
67519
+ type: "object",
67520
+ additionalProperties: {
67521
+ type: "string"
67522
+ },
67523
+ properties: {}
67524
+ },
67525
+ {
67526
+ title: "Request headers (string)",
67527
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
67528
+ type: "string"
67529
+ }
67530
+ ]
67157
67531
  }
67158
67532
  }
67159
67533
  }
@@ -67217,6 +67591,26 @@ var schemas_default = {
67217
67591
  307,
67218
67592
  308
67219
67593
  ]
67594
+ },
67595
+ headers: {
67596
+ description: "Additional HTTP headers to include in the request. Merged on top of Doc Detective's default browser-mimicking headers. Useful for sites behind bot protection or WAFs that allowlist specific headers (for example, a Cloudflare Access service token or a `Cookie` with a `cf_clearance` value).",
67597
+ default: {},
67598
+ anyOf: [
67599
+ {
67600
+ title: "Request headers (object)",
67601
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
67602
+ type: "object",
67603
+ additionalProperties: {
67604
+ type: "string"
67605
+ },
67606
+ properties: {}
67607
+ },
67608
+ {
67609
+ title: "Request headers (string)",
67610
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
67611
+ type: "string"
67612
+ }
67613
+ ]
67220
67614
  }
67221
67615
  }
67222
67616
  }
@@ -78343,6 +78737,26 @@ var schemas_default = {
78343
78737
  307,
78344
78738
  308
78345
78739
  ]
78740
+ },
78741
+ headers: {
78742
+ description: "Additional HTTP headers to include in the request. Merged on top of Doc Detective's default browser-mimicking headers. Useful for sites behind bot protection or WAFs that allowlist specific headers (for example, a Cloudflare Access service token or a `Cookie` with a `cf_clearance` value).",
78743
+ default: {},
78744
+ anyOf: [
78745
+ {
78746
+ title: "Request headers (object)",
78747
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
78748
+ type: "object",
78749
+ additionalProperties: {
78750
+ type: "string"
78751
+ },
78752
+ properties: {}
78753
+ },
78754
+ {
78755
+ title: "Request headers (string)",
78756
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
78757
+ type: "string"
78758
+ }
78759
+ ]
78346
78760
  }
78347
78761
  }
78348
78762
  }
@@ -78406,6 +78820,26 @@ var schemas_default = {
78406
78820
  307,
78407
78821
  308
78408
78822
  ]
78823
+ },
78824
+ headers: {
78825
+ description: "Additional HTTP headers to include in the request. Merged on top of Doc Detective's default browser-mimicking headers. Useful for sites behind bot protection or WAFs that allowlist specific headers (for example, a Cloudflare Access service token or a `Cookie` with a `cf_clearance` value).",
78826
+ default: {},
78827
+ anyOf: [
78828
+ {
78829
+ title: "Request headers (object)",
78830
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
78831
+ type: "object",
78832
+ additionalProperties: {
78833
+ type: "string"
78834
+ },
78835
+ properties: {}
78836
+ },
78837
+ {
78838
+ title: "Request headers (string)",
78839
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
78840
+ type: "string"
78841
+ }
78842
+ ]
78409
78843
  }
78410
78844
  }
78411
78845
  }
@@ -86440,6 +86874,26 @@ var schemas_default = {
86440
86874
  307,
86441
86875
  308
86442
86876
  ]
86877
+ },
86878
+ headers: {
86879
+ description: "Additional HTTP headers to include in the request. Merged on top of Doc Detective's default browser-mimicking headers. Useful for sites behind bot protection or WAFs that allowlist specific headers (for example, a Cloudflare Access service token or a `Cookie` with a `cf_clearance` value).",
86880
+ default: {},
86881
+ anyOf: [
86882
+ {
86883
+ title: "Request headers (object)",
86884
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
86885
+ type: "object",
86886
+ additionalProperties: {
86887
+ type: "string"
86888
+ },
86889
+ properties: {}
86890
+ },
86891
+ {
86892
+ title: "Request headers (string)",
86893
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
86894
+ type: "string"
86895
+ }
86896
+ ]
86443
86897
  }
86444
86898
  }
86445
86899
  }
@@ -86503,6 +86957,26 @@ var schemas_default = {
86503
86957
  307,
86504
86958
  308
86505
86959
  ]
86960
+ },
86961
+ headers: {
86962
+ description: "Additional HTTP headers to include in the request. Merged on top of Doc Detective's default browser-mimicking headers. Useful for sites behind bot protection or WAFs that allowlist specific headers (for example, a Cloudflare Access service token or a `Cookie` with a `cf_clearance` value).",
86963
+ default: {},
86964
+ anyOf: [
86965
+ {
86966
+ title: "Request headers (object)",
86967
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
86968
+ type: "object",
86969
+ additionalProperties: {
86970
+ type: "string"
86971
+ },
86972
+ properties: {}
86973
+ },
86974
+ {
86975
+ title: "Request headers (string)",
86976
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
86977
+ type: "string"
86978
+ }
86979
+ ]
86506
86980
  }
86507
86981
  }
86508
86982
  }
@@ -94817,6 +95291,26 @@ var schemas_default = {
94817
95291
  307,
94818
95292
  308
94819
95293
  ]
95294
+ },
95295
+ headers: {
95296
+ description: "Additional HTTP headers to include in the request. Merged on top of Doc Detective's default browser-mimicking headers. Useful for sites behind bot protection or WAFs that allowlist specific headers (for example, a Cloudflare Access service token or a `Cookie` with a `cf_clearance` value).",
95297
+ default: {},
95298
+ anyOf: [
95299
+ {
95300
+ title: "Request headers (object)",
95301
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
95302
+ type: "object",
95303
+ additionalProperties: {
95304
+ type: "string"
95305
+ },
95306
+ properties: {}
95307
+ },
95308
+ {
95309
+ title: "Request headers (string)",
95310
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
95311
+ type: "string"
95312
+ }
95313
+ ]
94820
95314
  }
94821
95315
  }
94822
95316
  }
@@ -94880,6 +95374,26 @@ var schemas_default = {
94880
95374
  307,
94881
95375
  308
94882
95376
  ]
95377
+ },
95378
+ headers: {
95379
+ description: "Additional HTTP headers to include in the request. Merged on top of Doc Detective's default browser-mimicking headers. Useful for sites behind bot protection or WAFs that allowlist specific headers (for example, a Cloudflare Access service token or a `Cookie` with a `cf_clearance` value).",
95380
+ default: {},
95381
+ anyOf: [
95382
+ {
95383
+ title: "Request headers (object)",
95384
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
95385
+ type: "object",
95386
+ additionalProperties: {
95387
+ type: "string"
95388
+ },
95389
+ properties: {}
95390
+ },
95391
+ {
95392
+ title: "Request headers (string)",
95393
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
95394
+ type: "string"
95395
+ }
95396
+ ]
94883
95397
  }
94884
95398
  }
94885
95399
  }
@@ -103267,6 +103781,26 @@ var schemas_default = {
103267
103781
  307,
103268
103782
  308
103269
103783
  ]
103784
+ },
103785
+ headers: {
103786
+ description: "Additional HTTP headers to include in the request. Merged on top of Doc Detective's default browser-mimicking headers. Useful for sites behind bot protection or WAFs that allowlist specific headers (for example, a Cloudflare Access service token or a `Cookie` with a `cf_clearance` value).",
103787
+ default: {},
103788
+ anyOf: [
103789
+ {
103790
+ title: "Request headers (object)",
103791
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
103792
+ type: "object",
103793
+ additionalProperties: {
103794
+ type: "string"
103795
+ },
103796
+ properties: {}
103797
+ },
103798
+ {
103799
+ title: "Request headers (string)",
103800
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
103801
+ type: "string"
103802
+ }
103803
+ ]
103270
103804
  }
103271
103805
  }
103272
103806
  }
@@ -103330,6 +103864,26 @@ var schemas_default = {
103330
103864
  307,
103331
103865
  308
103332
103866
  ]
103867
+ },
103868
+ headers: {
103869
+ description: "Additional HTTP headers to include in the request. Merged on top of Doc Detective's default browser-mimicking headers. Useful for sites behind bot protection or WAFs that allowlist specific headers (for example, a Cloudflare Access service token or a `Cookie` with a `cf_clearance` value).",
103870
+ default: {},
103871
+ anyOf: [
103872
+ {
103873
+ title: "Request headers (object)",
103874
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
103875
+ type: "object",
103876
+ additionalProperties: {
103877
+ type: "string"
103878
+ },
103879
+ properties: {}
103880
+ },
103881
+ {
103882
+ title: "Request headers (string)",
103883
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
103884
+ type: "string"
103885
+ }
103886
+ ]
103333
103887
  }
103334
103888
  }
103335
103889
  }
@@ -111364,6 +111918,26 @@ var schemas_default = {
111364
111918
  307,
111365
111919
  308
111366
111920
  ]
111921
+ },
111922
+ headers: {
111923
+ description: "Additional HTTP headers to include in the request. Merged on top of Doc Detective's default browser-mimicking headers. Useful for sites behind bot protection or WAFs that allowlist specific headers (for example, a Cloudflare Access service token or a `Cookie` with a `cf_clearance` value).",
111924
+ default: {},
111925
+ anyOf: [
111926
+ {
111927
+ title: "Request headers (object)",
111928
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
111929
+ type: "object",
111930
+ additionalProperties: {
111931
+ type: "string"
111932
+ },
111933
+ properties: {}
111934
+ },
111935
+ {
111936
+ title: "Request headers (string)",
111937
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
111938
+ type: "string"
111939
+ }
111940
+ ]
111367
111941
  }
111368
111942
  }
111369
111943
  }
@@ -111427,6 +112001,26 @@ var schemas_default = {
111427
112001
  307,
111428
112002
  308
111429
112003
  ]
112004
+ },
112005
+ headers: {
112006
+ description: "Additional HTTP headers to include in the request. Merged on top of Doc Detective's default browser-mimicking headers. Useful for sites behind bot protection or WAFs that allowlist specific headers (for example, a Cloudflare Access service token or a `Cookie` with a `cf_clearance` value).",
112007
+ default: {},
112008
+ anyOf: [
112009
+ {
112010
+ title: "Request headers (object)",
112011
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
112012
+ type: "object",
112013
+ additionalProperties: {
112014
+ type: "string"
112015
+ },
112016
+ properties: {}
112017
+ },
112018
+ {
112019
+ title: "Request headers (string)",
112020
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
112021
+ type: "string"
112022
+ }
112023
+ ]
111430
112024
  }
111431
112025
  }
111432
112026
  }
@@ -133601,6 +134195,102 @@ async function runShell({ config, step }) {
133601
134195
 
133602
134196
  // dist/core/tests/checkLink.js
133603
134197
  var import_axios4 = __toESM(require("axios"), 1);
134198
+ var DEFAULT_HEADERS = {
134199
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
134200
+ Accept: "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
134201
+ "Accept-Language": "en-US,en;q=0.9",
134202
+ "Accept-Encoding": "gzip, deflate, br",
134203
+ "Upgrade-Insecure-Requests": "1",
134204
+ "Sec-Fetch-Site": "none",
134205
+ "Sec-Fetch-Mode": "navigate",
134206
+ "Sec-Fetch-Dest": "document",
134207
+ "Sec-Fetch-User": "?1",
134208
+ "Sec-Ch-Ua": '"Not_A Brand";v="8", "Chromium";v="120", "Google Chrome";v="120"',
134209
+ "Sec-Ch-Ua-Mobile": "?0",
134210
+ "Sec-Ch-Ua-Platform": '"Windows"'
134211
+ };
134212
+ var MAX_ATTEMPTS = 4;
134213
+ var BASE_BACKOFF_MS = 1e3;
134214
+ var MAX_RETRY_AFTER_MS = 1e4;
134215
+ function parseHeaderString(raw) {
134216
+ const out = {};
134217
+ for (const line of raw.split(/\r?\n/)) {
134218
+ const idx = line.indexOf(":");
134219
+ if (idx === -1)
134220
+ continue;
134221
+ const key = line.slice(0, idx).trim();
134222
+ const value = line.slice(idx + 1).trim();
134223
+ if (key && value)
134224
+ out[key] = value;
134225
+ }
134226
+ return out;
134227
+ }
134228
+ function mergeHeaders(userHeaders) {
134229
+ const merged = { ...DEFAULT_HEADERS };
134230
+ if (!userHeaders)
134231
+ return merged;
134232
+ const parsed = typeof userHeaders === "string" ? parseHeaderString(userHeaders) : userHeaders;
134233
+ for (const userKey of Object.keys(parsed)) {
134234
+ const raw = parsed[userKey];
134235
+ if (raw === null || raw === void 0)
134236
+ continue;
134237
+ const value = typeof raw === "string" ? raw : String(raw);
134238
+ const lower = userKey.toLowerCase();
134239
+ for (const existingKey of Object.keys(merged)) {
134240
+ if (existingKey.toLowerCase() === lower)
134241
+ delete merged[existingKey];
134242
+ }
134243
+ merged[userKey] = value;
134244
+ }
134245
+ return merged;
134246
+ }
134247
+ function parseRetryAfter(value) {
134248
+ const candidate = Array.isArray(value) ? value[0] : value;
134249
+ if (typeof candidate !== "string" && typeof candidate !== "number")
134250
+ return null;
134251
+ const str = String(candidate).trim();
134252
+ if (!str)
134253
+ return null;
134254
+ const seconds = Number(str);
134255
+ if (Number.isFinite(seconds)) {
134256
+ return Math.max(0, Math.min(seconds * 1e3, MAX_RETRY_AFTER_MS));
134257
+ }
134258
+ const date = Date.parse(str);
134259
+ if (!Number.isNaN(date)) {
134260
+ return Math.max(0, Math.min(date - Date.now(), MAX_RETRY_AFTER_MS));
134261
+ }
134262
+ return null;
134263
+ }
134264
+ function sleep(ms) {
134265
+ return new Promise((resolve) => setTimeout(resolve, ms));
134266
+ }
134267
+ function shouldRetry(statusCode) {
134268
+ if (statusCode === null)
134269
+ return false;
134270
+ return statusCode === 429 || statusCode >= 500;
134271
+ }
134272
+ async function attemptRequest(method, url, headers) {
134273
+ try {
134274
+ const res = await import_axios4.default.request({
134275
+ method,
134276
+ url,
134277
+ headers,
134278
+ timeout: 1e4,
134279
+ maxRedirects: 5,
134280
+ validateStatus: () => true
134281
+ });
134282
+ const retryAfter = parseRetryAfter(res.headers?.["retry-after"] ?? res.headers?.["Retry-After"]);
134283
+ return { statusCode: res.status, retryAfter };
134284
+ } catch (error) {
134285
+ if (error?.response?.status) {
134286
+ return {
134287
+ statusCode: error.response.status,
134288
+ retryAfter: parseRetryAfter(error.response.headers?.["retry-after"] ?? error.response.headers?.["Retry-After"])
134289
+ };
134290
+ }
134291
+ return { statusCode: null, retryAfter: null };
134292
+ }
134293
+ }
133604
134294
  async function checkLink({ config, step }) {
133605
134295
  let result = { status: "PASS", description: "Checked link." };
133606
134296
  if (typeof step.checkLink === "string") {
@@ -133632,36 +134322,39 @@ async function checkLink({ config, step }) {
133632
134322
  } else if (typeof step.checkLink.statusCodes === "number") {
133633
134323
  step.checkLink.statusCodes = [step.checkLink.statusCodes];
133634
134324
  }
133635
- const requestConfig = {
133636
- headers: {
133637
- "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
133638
- "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
133639
- "Accept-Language": "en-US,en;q=0.9"
133640
- },
133641
- timeout: 1e4,
133642
- // 10 second timeout
133643
- maxRedirects: 5
133644
- };
133645
- let req = await import_axios4.default.get(step.checkLink.url, requestConfig).then((res) => {
133646
- return { statusCode: res.status };
133647
- }).catch((error) => {
133648
- return { error };
133649
- });
133650
- if (req.error) {
133651
- if (req.error.response && req.error.response.status) {
133652
- req = { statusCode: req.error.response.status };
133653
- } else {
133654
- result.status = "FAIL";
133655
- result.description = `Invalid or unresolvable URL: ${step.checkLink.url}`;
133656
- return result;
134325
+ const headers = mergeHeaders(step.checkLink.headers);
134326
+ const url = step.checkLink.url;
134327
+ const acceptedCodes = step.checkLink.statusCodes;
134328
+ const isAccepted = (code) => code !== null && acceptedCodes.indexOf(code) >= 0;
134329
+ let last = { statusCode: null, retryAfter: null };
134330
+ for (let attempt = 0; attempt < MAX_ATTEMPTS; attempt++) {
134331
+ last = await attemptRequest("get", url, headers);
134332
+ if (isAccepted(last.statusCode))
134333
+ break;
134334
+ if (!shouldRetry(last.statusCode))
134335
+ break;
134336
+ if (attempt < MAX_ATTEMPTS - 1) {
134337
+ const backoff = last.retryAfter ?? BASE_BACKOFF_MS * Math.pow(2, attempt);
134338
+ await sleep(backoff);
134339
+ }
134340
+ }
134341
+ if (!isAccepted(last.statusCode) && (last.statusCode === 429 || last.statusCode === 403)) {
134342
+ const headResult = await attemptRequest("head", url, headers);
134343
+ if (isAccepted(headResult.statusCode)) {
134344
+ last = headResult;
133657
134345
  }
133658
134346
  }
133659
- if (step.checkLink.statusCodes.indexOf(req.statusCode) >= 0) {
134347
+ if (last.statusCode === null) {
134348
+ result.status = "FAIL";
134349
+ result.description = `Invalid or unresolvable URL: ${url}`;
134350
+ return result;
134351
+ }
134352
+ if (step.checkLink.statusCodes.indexOf(last.statusCode) >= 0) {
133660
134353
  result.status = "PASS";
133661
- result.description = `Returned ${req.statusCode}`;
134354
+ result.description = `Returned ${last.statusCode}`;
133662
134355
  } else {
133663
134356
  result.status = "FAIL";
133664
- result.description = `Returned ${req.statusCode}. Expected one of ${JSON.stringify(step.checkLink.statusCodes)}`;
134357
+ result.description = `Returned ${last.statusCode}. Expected one of ${JSON.stringify(step.checkLink.statusCodes)}`;
133665
134358
  }
133666
134359
  return result;
133667
134360
  }