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

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
  }
@@ -1559,6 +1599,26 @@ var schemas_default = {
1559
1599
  307,
1560
1600
  308
1561
1601
  ]
1602
+ },
1603
+ headers: {
1604
+ 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).",
1605
+ default: {},
1606
+ anyOf: [
1607
+ {
1608
+ title: "Request headers (object)",
1609
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
1610
+ type: "object",
1611
+ additionalProperties: {
1612
+ type: "string"
1613
+ },
1614
+ properties: {}
1615
+ },
1616
+ {
1617
+ title: "Request headers (string)",
1618
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
1619
+ type: "string"
1620
+ }
1621
+ ]
1562
1622
  }
1563
1623
  }
1564
1624
  }
@@ -1622,6 +1682,26 @@ var schemas_default = {
1622
1682
  307,
1623
1683
  308
1624
1684
  ]
1685
+ },
1686
+ headers: {
1687
+ 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).",
1688
+ default: {},
1689
+ anyOf: [
1690
+ {
1691
+ title: "Request headers (object)",
1692
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
1693
+ type: "object",
1694
+ additionalProperties: {
1695
+ type: "string"
1696
+ },
1697
+ properties: {}
1698
+ },
1699
+ {
1700
+ title: "Request headers (string)",
1701
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
1702
+ type: "string"
1703
+ }
1704
+ ]
1625
1705
  }
1626
1706
  }
1627
1707
  }
@@ -10182,6 +10262,26 @@ var schemas_default = {
10182
10262
  307,
10183
10263
  308
10184
10264
  ]
10265
+ },
10266
+ headers: {
10267
+ 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).",
10268
+ default: {},
10269
+ anyOf: [
10270
+ {
10271
+ title: "Request headers (object)",
10272
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
10273
+ type: "object",
10274
+ additionalProperties: {
10275
+ type: "string"
10276
+ },
10277
+ properties: {}
10278
+ },
10279
+ {
10280
+ title: "Request headers (string)",
10281
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
10282
+ type: "string"
10283
+ }
10284
+ ]
10185
10285
  }
10186
10286
  }
10187
10287
  }
@@ -10245,6 +10345,26 @@ var schemas_default = {
10245
10345
  307,
10246
10346
  308
10247
10347
  ]
10348
+ },
10349
+ headers: {
10350
+ 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).",
10351
+ default: {},
10352
+ anyOf: [
10353
+ {
10354
+ title: "Request headers (object)",
10355
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
10356
+ type: "object",
10357
+ additionalProperties: {
10358
+ type: "string"
10359
+ },
10360
+ properties: {}
10361
+ },
10362
+ {
10363
+ title: "Request headers (string)",
10364
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
10365
+ type: "string"
10366
+ }
10367
+ ]
10248
10368
  }
10249
10369
  }
10250
10370
  }
@@ -23218,6 +23338,26 @@ var schemas_default = {
23218
23338
  307,
23219
23339
  308
23220
23340
  ]
23341
+ },
23342
+ headers: {
23343
+ 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).",
23344
+ default: {},
23345
+ anyOf: [
23346
+ {
23347
+ title: "Request headers (object)",
23348
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
23349
+ type: "object",
23350
+ additionalProperties: {
23351
+ type: "string"
23352
+ },
23353
+ properties: {}
23354
+ },
23355
+ {
23356
+ title: "Request headers (string)",
23357
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
23358
+ type: "string"
23359
+ }
23360
+ ]
23221
23361
  }
23222
23362
  }
23223
23363
  }
@@ -23281,6 +23421,26 @@ var schemas_default = {
23281
23421
  307,
23282
23422
  308
23283
23423
  ]
23424
+ },
23425
+ headers: {
23426
+ 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).",
23427
+ default: {},
23428
+ anyOf: [
23429
+ {
23430
+ title: "Request headers (object)",
23431
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
23432
+ type: "object",
23433
+ additionalProperties: {
23434
+ type: "string"
23435
+ },
23436
+ properties: {}
23437
+ },
23438
+ {
23439
+ title: "Request headers (string)",
23440
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
23441
+ type: "string"
23442
+ }
23443
+ ]
23284
23444
  }
23285
23445
  }
23286
23446
  }
@@ -31841,6 +32001,26 @@ var schemas_default = {
31841
32001
  307,
31842
32002
  308
31843
32003
  ]
32004
+ },
32005
+ headers: {
32006
+ 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).",
32007
+ default: {},
32008
+ anyOf: [
32009
+ {
32010
+ title: "Request headers (object)",
32011
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
32012
+ type: "object",
32013
+ additionalProperties: {
32014
+ type: "string"
32015
+ },
32016
+ properties: {}
32017
+ },
32018
+ {
32019
+ title: "Request headers (string)",
32020
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
32021
+ type: "string"
32022
+ }
32023
+ ]
31844
32024
  }
31845
32025
  }
31846
32026
  }
@@ -31904,6 +32084,26 @@ var schemas_default = {
31904
32084
  307,
31905
32085
  308
31906
32086
  ]
32087
+ },
32088
+ headers: {
32089
+ 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).",
32090
+ default: {},
32091
+ anyOf: [
32092
+ {
32093
+ title: "Request headers (object)",
32094
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
32095
+ type: "object",
32096
+ additionalProperties: {
32097
+ type: "string"
32098
+ },
32099
+ properties: {}
32100
+ },
32101
+ {
32102
+ title: "Request headers (string)",
32103
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
32104
+ type: "string"
32105
+ }
32106
+ ]
31907
32107
  }
31908
32108
  }
31909
32109
  }
@@ -41153,6 +41353,26 @@ var schemas_default = {
41153
41353
  307,
41154
41354
  308
41155
41355
  ]
41356
+ },
41357
+ headers: {
41358
+ 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).",
41359
+ default: {},
41360
+ anyOf: [
41361
+ {
41362
+ title: "Request headers (object)",
41363
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
41364
+ type: "object",
41365
+ additionalProperties: {
41366
+ type: "string"
41367
+ },
41368
+ properties: {}
41369
+ },
41370
+ {
41371
+ title: "Request headers (string)",
41372
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
41373
+ type: "string"
41374
+ }
41375
+ ]
41156
41376
  }
41157
41377
  }
41158
41378
  }
@@ -41216,6 +41436,26 @@ var schemas_default = {
41216
41436
  307,
41217
41437
  308
41218
41438
  ]
41439
+ },
41440
+ headers: {
41441
+ 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).",
41442
+ default: {},
41443
+ anyOf: [
41444
+ {
41445
+ title: "Request headers (object)",
41446
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
41447
+ type: "object",
41448
+ additionalProperties: {
41449
+ type: "string"
41450
+ },
41451
+ properties: {}
41452
+ },
41453
+ {
41454
+ title: "Request headers (string)",
41455
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
41456
+ type: "string"
41457
+ }
41458
+ ]
41219
41459
  }
41220
41460
  }
41221
41461
  }
@@ -49250,6 +49490,26 @@ var schemas_default = {
49250
49490
  307,
49251
49491
  308
49252
49492
  ]
49493
+ },
49494
+ headers: {
49495
+ 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).",
49496
+ default: {},
49497
+ anyOf: [
49498
+ {
49499
+ title: "Request headers (object)",
49500
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
49501
+ type: "object",
49502
+ additionalProperties: {
49503
+ type: "string"
49504
+ },
49505
+ properties: {}
49506
+ },
49507
+ {
49508
+ title: "Request headers (string)",
49509
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
49510
+ type: "string"
49511
+ }
49512
+ ]
49253
49513
  }
49254
49514
  }
49255
49515
  }
@@ -49313,6 +49573,26 @@ var schemas_default = {
49313
49573
  307,
49314
49574
  308
49315
49575
  ]
49576
+ },
49577
+ headers: {
49578
+ 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).",
49579
+ default: {},
49580
+ anyOf: [
49581
+ {
49582
+ title: "Request headers (object)",
49583
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
49584
+ type: "object",
49585
+ additionalProperties: {
49586
+ type: "string"
49587
+ },
49588
+ properties: {}
49589
+ },
49590
+ {
49591
+ title: "Request headers (string)",
49592
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
49593
+ type: "string"
49594
+ }
49595
+ ]
49316
49596
  }
49317
49597
  }
49318
49598
  }
@@ -59057,6 +59337,26 @@ var schemas_default = {
59057
59337
  307,
59058
59338
  308
59059
59339
  ]
59340
+ },
59341
+ headers: {
59342
+ 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).",
59343
+ default: {},
59344
+ anyOf: [
59345
+ {
59346
+ title: "Request headers (object)",
59347
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
59348
+ type: "object",
59349
+ additionalProperties: {
59350
+ type: "string"
59351
+ },
59352
+ properties: {}
59353
+ },
59354
+ {
59355
+ title: "Request headers (string)",
59356
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
59357
+ type: "string"
59358
+ }
59359
+ ]
59060
59360
  }
59061
59361
  }
59062
59362
  }
@@ -59120,6 +59420,26 @@ var schemas_default = {
59120
59420
  307,
59121
59421
  308
59122
59422
  ]
59423
+ },
59424
+ headers: {
59425
+ 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).",
59426
+ default: {},
59427
+ anyOf: [
59428
+ {
59429
+ title: "Request headers (object)",
59430
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
59431
+ type: "object",
59432
+ additionalProperties: {
59433
+ type: "string"
59434
+ },
59435
+ properties: {}
59436
+ },
59437
+ {
59438
+ title: "Request headers (string)",
59439
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
59440
+ type: "string"
59441
+ }
59442
+ ]
59123
59443
  }
59124
59444
  }
59125
59445
  }
@@ -67154,6 +67474,26 @@ var schemas_default = {
67154
67474
  307,
67155
67475
  308
67156
67476
  ]
67477
+ },
67478
+ headers: {
67479
+ 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).",
67480
+ default: {},
67481
+ anyOf: [
67482
+ {
67483
+ title: "Request headers (object)",
67484
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
67485
+ type: "object",
67486
+ additionalProperties: {
67487
+ type: "string"
67488
+ },
67489
+ properties: {}
67490
+ },
67491
+ {
67492
+ title: "Request headers (string)",
67493
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
67494
+ type: "string"
67495
+ }
67496
+ ]
67157
67497
  }
67158
67498
  }
67159
67499
  }
@@ -67217,6 +67557,26 @@ var schemas_default = {
67217
67557
  307,
67218
67558
  308
67219
67559
  ]
67560
+ },
67561
+ headers: {
67562
+ 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).",
67563
+ default: {},
67564
+ anyOf: [
67565
+ {
67566
+ title: "Request headers (object)",
67567
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
67568
+ type: "object",
67569
+ additionalProperties: {
67570
+ type: "string"
67571
+ },
67572
+ properties: {}
67573
+ },
67574
+ {
67575
+ title: "Request headers (string)",
67576
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
67577
+ type: "string"
67578
+ }
67579
+ ]
67220
67580
  }
67221
67581
  }
67222
67582
  }
@@ -78343,6 +78703,26 @@ var schemas_default = {
78343
78703
  307,
78344
78704
  308
78345
78705
  ]
78706
+ },
78707
+ headers: {
78708
+ 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).",
78709
+ default: {},
78710
+ anyOf: [
78711
+ {
78712
+ title: "Request headers (object)",
78713
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
78714
+ type: "object",
78715
+ additionalProperties: {
78716
+ type: "string"
78717
+ },
78718
+ properties: {}
78719
+ },
78720
+ {
78721
+ title: "Request headers (string)",
78722
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
78723
+ type: "string"
78724
+ }
78725
+ ]
78346
78726
  }
78347
78727
  }
78348
78728
  }
@@ -78406,6 +78786,26 @@ var schemas_default = {
78406
78786
  307,
78407
78787
  308
78408
78788
  ]
78789
+ },
78790
+ headers: {
78791
+ 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).",
78792
+ default: {},
78793
+ anyOf: [
78794
+ {
78795
+ title: "Request headers (object)",
78796
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
78797
+ type: "object",
78798
+ additionalProperties: {
78799
+ type: "string"
78800
+ },
78801
+ properties: {}
78802
+ },
78803
+ {
78804
+ title: "Request headers (string)",
78805
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
78806
+ type: "string"
78807
+ }
78808
+ ]
78409
78809
  }
78410
78810
  }
78411
78811
  }
@@ -86440,6 +86840,26 @@ var schemas_default = {
86440
86840
  307,
86441
86841
  308
86442
86842
  ]
86843
+ },
86844
+ headers: {
86845
+ 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).",
86846
+ default: {},
86847
+ anyOf: [
86848
+ {
86849
+ title: "Request headers (object)",
86850
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
86851
+ type: "object",
86852
+ additionalProperties: {
86853
+ type: "string"
86854
+ },
86855
+ properties: {}
86856
+ },
86857
+ {
86858
+ title: "Request headers (string)",
86859
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
86860
+ type: "string"
86861
+ }
86862
+ ]
86443
86863
  }
86444
86864
  }
86445
86865
  }
@@ -86503,6 +86923,26 @@ var schemas_default = {
86503
86923
  307,
86504
86924
  308
86505
86925
  ]
86926
+ },
86927
+ headers: {
86928
+ 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).",
86929
+ default: {},
86930
+ anyOf: [
86931
+ {
86932
+ title: "Request headers (object)",
86933
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
86934
+ type: "object",
86935
+ additionalProperties: {
86936
+ type: "string"
86937
+ },
86938
+ properties: {}
86939
+ },
86940
+ {
86941
+ title: "Request headers (string)",
86942
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
86943
+ type: "string"
86944
+ }
86945
+ ]
86506
86946
  }
86507
86947
  }
86508
86948
  }
@@ -94817,6 +95257,26 @@ var schemas_default = {
94817
95257
  307,
94818
95258
  308
94819
95259
  ]
95260
+ },
95261
+ headers: {
95262
+ 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).",
95263
+ default: {},
95264
+ anyOf: [
95265
+ {
95266
+ title: "Request headers (object)",
95267
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
95268
+ type: "object",
95269
+ additionalProperties: {
95270
+ type: "string"
95271
+ },
95272
+ properties: {}
95273
+ },
95274
+ {
95275
+ title: "Request headers (string)",
95276
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
95277
+ type: "string"
95278
+ }
95279
+ ]
94820
95280
  }
94821
95281
  }
94822
95282
  }
@@ -94880,6 +95340,26 @@ var schemas_default = {
94880
95340
  307,
94881
95341
  308
94882
95342
  ]
95343
+ },
95344
+ headers: {
95345
+ 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).",
95346
+ default: {},
95347
+ anyOf: [
95348
+ {
95349
+ title: "Request headers (object)",
95350
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
95351
+ type: "object",
95352
+ additionalProperties: {
95353
+ type: "string"
95354
+ },
95355
+ properties: {}
95356
+ },
95357
+ {
95358
+ title: "Request headers (string)",
95359
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
95360
+ type: "string"
95361
+ }
95362
+ ]
94883
95363
  }
94884
95364
  }
94885
95365
  }
@@ -103267,6 +103747,26 @@ var schemas_default = {
103267
103747
  307,
103268
103748
  308
103269
103749
  ]
103750
+ },
103751
+ headers: {
103752
+ 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).",
103753
+ default: {},
103754
+ anyOf: [
103755
+ {
103756
+ title: "Request headers (object)",
103757
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
103758
+ type: "object",
103759
+ additionalProperties: {
103760
+ type: "string"
103761
+ },
103762
+ properties: {}
103763
+ },
103764
+ {
103765
+ title: "Request headers (string)",
103766
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
103767
+ type: "string"
103768
+ }
103769
+ ]
103270
103770
  }
103271
103771
  }
103272
103772
  }
@@ -103330,6 +103830,26 @@ var schemas_default = {
103330
103830
  307,
103331
103831
  308
103332
103832
  ]
103833
+ },
103834
+ headers: {
103835
+ 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).",
103836
+ default: {},
103837
+ anyOf: [
103838
+ {
103839
+ title: "Request headers (object)",
103840
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
103841
+ type: "object",
103842
+ additionalProperties: {
103843
+ type: "string"
103844
+ },
103845
+ properties: {}
103846
+ },
103847
+ {
103848
+ title: "Request headers (string)",
103849
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
103850
+ type: "string"
103851
+ }
103852
+ ]
103333
103853
  }
103334
103854
  }
103335
103855
  }
@@ -111364,6 +111884,26 @@ var schemas_default = {
111364
111884
  307,
111365
111885
  308
111366
111886
  ]
111887
+ },
111888
+ headers: {
111889
+ 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).",
111890
+ default: {},
111891
+ anyOf: [
111892
+ {
111893
+ title: "Request headers (object)",
111894
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
111895
+ type: "object",
111896
+ additionalProperties: {
111897
+ type: "string"
111898
+ },
111899
+ properties: {}
111900
+ },
111901
+ {
111902
+ title: "Request headers (string)",
111903
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
111904
+ type: "string"
111905
+ }
111906
+ ]
111367
111907
  }
111368
111908
  }
111369
111909
  }
@@ -111427,6 +111967,26 @@ var schemas_default = {
111427
111967
  307,
111428
111968
  308
111429
111969
  ]
111970
+ },
111971
+ headers: {
111972
+ 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).",
111973
+ default: {},
111974
+ anyOf: [
111975
+ {
111976
+ title: "Request headers (object)",
111977
+ description: "Headers to include in the HTTP request, in key/value format. Values must be strings.",
111978
+ type: "object",
111979
+ additionalProperties: {
111980
+ type: "string"
111981
+ },
111982
+ properties: {}
111983
+ },
111984
+ {
111985
+ title: "Request headers (string)",
111986
+ description: "Headers to include in the HTTP request, as newline-separated values. For example, `X-Api-Key: abc123\nAuthorization: Bearer token`.",
111987
+ type: "string"
111988
+ }
111989
+ ]
111430
111990
  }
111431
111991
  }
111432
111992
  }
@@ -133601,6 +134161,102 @@ async function runShell({ config, step }) {
133601
134161
 
133602
134162
  // dist/core/tests/checkLink.js
133603
134163
  var import_axios4 = __toESM(require("axios"), 1);
134164
+ var DEFAULT_HEADERS = {
134165
+ "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",
134166
+ Accept: "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
134167
+ "Accept-Language": "en-US,en;q=0.9",
134168
+ "Accept-Encoding": "gzip, deflate, br",
134169
+ "Upgrade-Insecure-Requests": "1",
134170
+ "Sec-Fetch-Site": "none",
134171
+ "Sec-Fetch-Mode": "navigate",
134172
+ "Sec-Fetch-Dest": "document",
134173
+ "Sec-Fetch-User": "?1",
134174
+ "Sec-Ch-Ua": '"Not_A Brand";v="8", "Chromium";v="120", "Google Chrome";v="120"',
134175
+ "Sec-Ch-Ua-Mobile": "?0",
134176
+ "Sec-Ch-Ua-Platform": '"Windows"'
134177
+ };
134178
+ var MAX_ATTEMPTS = 4;
134179
+ var BASE_BACKOFF_MS = 1e3;
134180
+ var MAX_RETRY_AFTER_MS = 1e4;
134181
+ function parseHeaderString(raw) {
134182
+ const out = {};
134183
+ for (const line of raw.split(/\r?\n/)) {
134184
+ const idx = line.indexOf(":");
134185
+ if (idx === -1)
134186
+ continue;
134187
+ const key = line.slice(0, idx).trim();
134188
+ const value = line.slice(idx + 1).trim();
134189
+ if (key && value)
134190
+ out[key] = value;
134191
+ }
134192
+ return out;
134193
+ }
134194
+ function mergeHeaders(userHeaders) {
134195
+ const merged = { ...DEFAULT_HEADERS };
134196
+ if (!userHeaders)
134197
+ return merged;
134198
+ const parsed = typeof userHeaders === "string" ? parseHeaderString(userHeaders) : userHeaders;
134199
+ for (const userKey of Object.keys(parsed)) {
134200
+ const raw = parsed[userKey];
134201
+ if (raw === null || raw === void 0)
134202
+ continue;
134203
+ const value = typeof raw === "string" ? raw : String(raw);
134204
+ const lower = userKey.toLowerCase();
134205
+ for (const existingKey of Object.keys(merged)) {
134206
+ if (existingKey.toLowerCase() === lower)
134207
+ delete merged[existingKey];
134208
+ }
134209
+ merged[userKey] = value;
134210
+ }
134211
+ return merged;
134212
+ }
134213
+ function parseRetryAfter(value) {
134214
+ const candidate = Array.isArray(value) ? value[0] : value;
134215
+ if (typeof candidate !== "string" && typeof candidate !== "number")
134216
+ return null;
134217
+ const str = String(candidate).trim();
134218
+ if (!str)
134219
+ return null;
134220
+ const seconds = Number(str);
134221
+ if (Number.isFinite(seconds)) {
134222
+ return Math.max(0, Math.min(seconds * 1e3, MAX_RETRY_AFTER_MS));
134223
+ }
134224
+ const date = Date.parse(str);
134225
+ if (!Number.isNaN(date)) {
134226
+ return Math.max(0, Math.min(date - Date.now(), MAX_RETRY_AFTER_MS));
134227
+ }
134228
+ return null;
134229
+ }
134230
+ function sleep(ms) {
134231
+ return new Promise((resolve) => setTimeout(resolve, ms));
134232
+ }
134233
+ function shouldRetry(statusCode) {
134234
+ if (statusCode === null)
134235
+ return false;
134236
+ return statusCode === 429 || statusCode >= 500;
134237
+ }
134238
+ async function attemptRequest(method, url, headers) {
134239
+ try {
134240
+ const res = await import_axios4.default.request({
134241
+ method,
134242
+ url,
134243
+ headers,
134244
+ timeout: 1e4,
134245
+ maxRedirects: 5,
134246
+ validateStatus: () => true
134247
+ });
134248
+ const retryAfter = parseRetryAfter(res.headers?.["retry-after"] ?? res.headers?.["Retry-After"]);
134249
+ return { statusCode: res.status, retryAfter };
134250
+ } catch (error) {
134251
+ if (error?.response?.status) {
134252
+ return {
134253
+ statusCode: error.response.status,
134254
+ retryAfter: parseRetryAfter(error.response.headers?.["retry-after"] ?? error.response.headers?.["Retry-After"])
134255
+ };
134256
+ }
134257
+ return { statusCode: null, retryAfter: null };
134258
+ }
134259
+ }
133604
134260
  async function checkLink({ config, step }) {
133605
134261
  let result = { status: "PASS", description: "Checked link." };
133606
134262
  if (typeof step.checkLink === "string") {
@@ -133632,36 +134288,39 @@ async function checkLink({ config, step }) {
133632
134288
  } else if (typeof step.checkLink.statusCodes === "number") {
133633
134289
  step.checkLink.statusCodes = [step.checkLink.statusCodes];
133634
134290
  }
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;
134291
+ const headers = mergeHeaders(step.checkLink.headers);
134292
+ const url = step.checkLink.url;
134293
+ const acceptedCodes = step.checkLink.statusCodes;
134294
+ const isAccepted = (code) => code !== null && acceptedCodes.indexOf(code) >= 0;
134295
+ let last = { statusCode: null, retryAfter: null };
134296
+ for (let attempt = 0; attempt < MAX_ATTEMPTS; attempt++) {
134297
+ last = await attemptRequest("get", url, headers);
134298
+ if (isAccepted(last.statusCode))
134299
+ break;
134300
+ if (!shouldRetry(last.statusCode))
134301
+ break;
134302
+ if (attempt < MAX_ATTEMPTS - 1) {
134303
+ const backoff = last.retryAfter ?? BASE_BACKOFF_MS * Math.pow(2, attempt);
134304
+ await sleep(backoff);
134305
+ }
134306
+ }
134307
+ if (!isAccepted(last.statusCode) && (last.statusCode === 429 || last.statusCode === 403)) {
134308
+ const headResult = await attemptRequest("head", url, headers);
134309
+ if (isAccepted(headResult.statusCode)) {
134310
+ last = headResult;
133657
134311
  }
133658
134312
  }
133659
- if (step.checkLink.statusCodes.indexOf(req.statusCode) >= 0) {
134313
+ if (last.statusCode === null) {
134314
+ result.status = "FAIL";
134315
+ result.description = `Invalid or unresolvable URL: ${url}`;
134316
+ return result;
134317
+ }
134318
+ if (step.checkLink.statusCodes.indexOf(last.statusCode) >= 0) {
133660
134319
  result.status = "PASS";
133661
- result.description = `Returned ${req.statusCode}`;
134320
+ result.description = `Returned ${last.statusCode}`;
133662
134321
  } else {
133663
134322
  result.status = "FAIL";
133664
- result.description = `Returned ${req.statusCode}. Expected one of ${JSON.stringify(step.checkLink.statusCodes)}`;
134323
+ result.description = `Returned ${last.statusCode}. Expected one of ${JSON.stringify(step.checkLink.statusCodes)}`;
133665
134324
  }
133666
134325
  return result;
133667
134326
  }