doc-detective 4.0.2-dev.1 → 4.0.2-dev.10

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 (93) hide show
  1. package/dist/agents/adapters/claude-code.d.ts +77 -0
  2. package/dist/agents/adapters/claude-code.d.ts.map +1 -0
  3. package/dist/agents/adapters/claude-code.js +461 -0
  4. package/dist/agents/adapters/claude-code.js.map +1 -0
  5. package/dist/agents/adapters/codex.d.ts +64 -0
  6. package/dist/agents/adapters/codex.d.ts.map +1 -0
  7. package/dist/agents/adapters/codex.js +299 -0
  8. package/dist/agents/adapters/codex.js.map +1 -0
  9. package/dist/agents/adapters/copilot-cli.d.ts +29 -0
  10. package/dist/agents/adapters/copilot-cli.d.ts.map +1 -0
  11. package/dist/agents/adapters/copilot-cli.js +195 -0
  12. package/dist/agents/adapters/copilot-cli.js.map +1 -0
  13. package/dist/agents/adapters/gemini-cli.d.ts +29 -0
  14. package/dist/agents/adapters/gemini-cli.d.ts.map +1 -0
  15. package/dist/agents/adapters/gemini-cli.js +207 -0
  16. package/dist/agents/adapters/gemini-cli.js.map +1 -0
  17. package/dist/agents/adapters/opencode.d.ts +67 -0
  18. package/dist/agents/adapters/opencode.d.ts.map +1 -0
  19. package/dist/agents/adapters/opencode.js +341 -0
  20. package/dist/agents/adapters/opencode.js.map +1 -0
  21. package/dist/agents/adapters/qwen-code.d.ts +30 -0
  22. package/dist/agents/adapters/qwen-code.d.ts.map +1 -0
  23. package/dist/agents/adapters/qwen-code.js +212 -0
  24. package/dist/agents/adapters/qwen-code.js.map +1 -0
  25. package/dist/agents/command.d.ts +11 -0
  26. package/dist/agents/command.d.ts.map +1 -0
  27. package/dist/agents/command.js +41 -0
  28. package/dist/agents/command.js.map +1 -0
  29. package/dist/agents/fetcher.d.ts +30 -0
  30. package/dist/agents/fetcher.d.ts.map +1 -0
  31. package/dist/agents/fetcher.js +112 -0
  32. package/dist/agents/fetcher.js.map +1 -0
  33. package/dist/agents/prompts.d.ts +24 -0
  34. package/dist/agents/prompts.d.ts.map +1 -0
  35. package/dist/agents/prompts.js +74 -0
  36. package/dist/agents/prompts.js.map +1 -0
  37. package/dist/agents/registry.d.ts +4 -0
  38. package/dist/agents/registry.d.ts.map +1 -0
  39. package/dist/agents/registry.js +25 -0
  40. package/dist/agents/registry.js.map +1 -0
  41. package/dist/agents/runner.d.ts +13 -0
  42. package/dist/agents/runner.d.ts.map +1 -0
  43. package/dist/agents/runner.js +155 -0
  44. package/dist/agents/runner.js.map +1 -0
  45. package/dist/agents/spawn-helper.d.ts +33 -0
  46. package/dist/agents/spawn-helper.d.ts.map +1 -0
  47. package/dist/agents/spawn-helper.js +98 -0
  48. package/dist/agents/spawn-helper.js.map +1 -0
  49. package/dist/agents/types.d.ts +41 -0
  50. package/dist/agents/types.d.ts.map +1 -0
  51. package/dist/agents/types.js +2 -0
  52. package/dist/agents/types.js.map +1 -0
  53. package/dist/cli.js +42 -10
  54. package/dist/cli.js.map +1 -1
  55. package/dist/common/src/detectTests.d.ts.map +1 -1
  56. package/dist/common/src/detectTests.js +43 -12
  57. package/dist/common/src/detectTests.js.map +1 -1
  58. package/dist/common/src/fileTypes.d.ts.map +1 -1
  59. package/dist/common/src/fileTypes.js +10 -0
  60. package/dist/common/src/fileTypes.js.map +1 -1
  61. package/dist/common/src/schemas/schemas.json +594 -0
  62. package/dist/common/src/types/generated/checkLink_v3.d.ts +15 -0
  63. package/dist/common/src/types/generated/checkLink_v3.d.ts.map +1 -1
  64. package/dist/common/src/types/generated/config_v3.d.ts +4 -0
  65. package/dist/common/src/types/generated/config_v3.d.ts.map +1 -1
  66. package/dist/common/src/types/generated/resolvedTests_v3.d.ts +4 -0
  67. package/dist/common/src/types/generated/resolvedTests_v3.d.ts.map +1 -1
  68. package/dist/common/src/types/generated/step_v3.d.ts +15 -0
  69. package/dist/common/src/types/generated/step_v3.d.ts.map +1 -1
  70. package/dist/common/src/types/generated/test_v3.d.ts +30 -0
  71. package/dist/common/src/types/generated/test_v3.d.ts.map +1 -1
  72. package/dist/core/config.d.ts.map +1 -1
  73. package/dist/core/config.js +10 -0
  74. package/dist/core/config.js.map +1 -1
  75. package/dist/core/integrations/heretto.d.ts.map +1 -1
  76. package/dist/core/integrations/heretto.js +11 -3
  77. package/dist/core/integrations/heretto.js.map +1 -1
  78. package/dist/core/tests/checkLink.d.ts.map +1 -1
  79. package/dist/core/tests/checkLink.js +136 -29
  80. package/dist/core/tests/checkLink.js.map +1 -1
  81. package/dist/core/tests/loadCookie.d.ts.map +1 -1
  82. package/dist/core/tests/loadCookie.js +12 -2
  83. package/dist/core/tests/loadCookie.js.map +1 -1
  84. package/dist/index.cjs +783 -44
  85. package/dist/reporters/htmlReporter.d.ts +2 -0
  86. package/dist/reporters/htmlReporter.d.ts.map +1 -0
  87. package/dist/reporters/htmlReporter.js +1589 -0
  88. package/dist/reporters/htmlReporter.js.map +1 -0
  89. package/dist/utils.d.ts +2 -1
  90. package/dist/utils.d.ts.map +1 -1
  91. package/dist/utils.js +43 -10
  92. package/dist/utils.js.map +1 -1
  93. package/package.json +3 -1
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
  }
@@ -129279,11 +129873,17 @@ var defaultFileTypes = {
129279
129873
  inlineStatements: {
129280
129874
  testStart: [
129281
129875
  "<\\?doc-detective\\s+test([\\s\\S]*?)\\?>",
129282
- "<!--\\s*test([\\s\\S]+?)-->"
129876
+ "<!--\\s*test([\\s\\S]+?)-->",
129877
+ `<data\\s+[^>]*?name=["']doc-detective["'][^>]*?value='test\\s+([^']+?)'[^>]*?(?:\\/\\s*>|>\\s*<\\/data>)`,
129878
+ `<data\\s+[^>]*?name=["']doc-detective["'][^>]*?value="test\\s+([^"]+?)"[^>]*?(?:\\/\\s*>|>\\s*<\\/data>)`,
129879
+ `<data\\s+[^>]*?value='test\\s+([^']+?)'[^>]*?name=["']doc-detective["'][^>]*?(?:\\/\\s*>|>\\s*<\\/data>)`,
129880
+ `<data\\s+[^>]*?value="test\\s+([^"]+?)"[^>]*?name=["']doc-detective["'][^>]*?(?:\\/\\s*>|>\\s*<\\/data>)`
129283
129881
  ],
129284
129882
  testEnd: [
129285
129883
  "<\\?doc-detective\\s+test\\s+end\\s*\\?>",
129286
- "<!--\\s*test end([\\s\\S]+?)-->"
129884
+ "<!--\\s*test end([\\s\\S]+?)-->",
129885
+ `<data\\s+[^>]*?name=["']doc-detective["'][^>]*?value=["']test end["'][^>]*?(?:\\/\\s*>|>\\s*<\\/data>)`,
129886
+ `<data\\s+[^>]*?value=["']test end["'][^>]*?name=["']doc-detective["'][^>]*?(?:\\/\\s*>|>\\s*<\\/data>)`
129287
129887
  ],
129288
129888
  ignoreStart: [
129289
129889
  "<\\?doc-detective\\s+test\\s+ignore\\s+start\\s*\\?>",
@@ -129296,7 +129896,11 @@ var defaultFileTypes = {
129296
129896
  step: [
129297
129897
  "<\\?doc-detective\\s+step\\s+([\\s\\S]*?)\\s*\\?>",
129298
129898
  "<!--\\s*step([\\s\\S]+?)-->",
129299
- '<data\\s+name="step"\\s*>([\\s\\S]*?)<\\/data>'
129899
+ '<data\\s+name="step"\\s*>([\\s\\S]*?)<\\/data>',
129900
+ `<data\\s+[^>]*?name=["']doc-detective["'][^>]*?value='step\\s+([^']+?)'[^>]*?(?:\\/\\s*>|>\\s*<\\/data>)`,
129901
+ `<data\\s+[^>]*?name=["']doc-detective["'][^>]*?value="step\\s+([^"]+?)"[^>]*?(?:\\/\\s*>|>\\s*<\\/data>)`,
129902
+ `<data\\s+[^>]*?value='step\\s+([^']+?)'[^>]*?name=["']doc-detective["'][^>]*?(?:\\/\\s*>|>\\s*<\\/data>)`,
129903
+ `<data\\s+[^>]*?value="step\\s+([^"]+?)"[^>]*?name=["']doc-detective["'][^>]*?(?:\\/\\s*>|>\\s*<\\/data>)`
129300
129904
  ]
129301
129905
  },
129302
129906
  markup: [
@@ -129759,11 +130363,17 @@ var defaultFileTypesBase = {
129759
130363
  inlineStatements: {
129760
130364
  testStart: [
129761
130365
  "<\\?doc-detective\\s+test([\\s\\S]*?)\\?>",
129762
- "<!--\\s*test([\\s\\S]+?)-->"
130366
+ "<!--\\s*test([\\s\\S]+?)-->",
130367
+ `<data\\s+[^>]*?name=["']doc-detective["'][^>]*?value='test\\s+([^']+?)'[^>]*?(?:\\/\\s*>|>\\s*<\\/data>)`,
130368
+ `<data\\s+[^>]*?name=["']doc-detective["'][^>]*?value="test\\s+([^"]+?)"[^>]*?(?:\\/\\s*>|>\\s*<\\/data>)`,
130369
+ `<data\\s+[^>]*?value='test\\s+([^']+?)'[^>]*?name=["']doc-detective["'][^>]*?(?:\\/\\s*>|>\\s*<\\/data>)`,
130370
+ `<data\\s+[^>]*?value="test\\s+([^"]+?)"[^>]*?name=["']doc-detective["'][^>]*?(?:\\/\\s*>|>\\s*<\\/data>)`
129763
130371
  ],
129764
130372
  testEnd: [
129765
130373
  "<\\?doc-detective\\s+test\\s+end\\s*\\?>",
129766
- "<!--\\s*test end([\\s\\S]+?)-->"
130374
+ "<!--\\s*test end([\\s\\S]+?)-->",
130375
+ `<data\\s+[^>]*?name=["']doc-detective["'][^>]*?value=["']test end["'][^>]*?(?:\\/\\s*>|>\\s*<\\/data>)`,
130376
+ `<data\\s+[^>]*?value=["']test end["'][^>]*?name=["']doc-detective["'][^>]*?(?:\\/\\s*>|>\\s*<\\/data>)`
129767
130377
  ],
129768
130378
  ignoreStart: [
129769
130379
  "<\\?doc-detective\\s+test\\s+ignore\\s+start\\s*\\?>",
@@ -129776,7 +130386,11 @@ var defaultFileTypesBase = {
129776
130386
  step: [
129777
130387
  "<\\?doc-detective\\s+step\\s+([\\s\\S]*?)\\s*\\?>",
129778
130388
  "<!--\\s*step([\\s\\S]+?)-->",
129779
- '<data\\s+name="step"\\s*>([\\s\\S]*?)<\\/data>'
130389
+ '<data\\s+name="step"\\s*>([\\s\\S]*?)<\\/data>',
130390
+ `<data\\s+[^>]*?name=["']doc-detective["'][^>]*?value='step\\s+([^']+?)'[^>]*?(?:\\/\\s*>|>\\s*<\\/data>)`,
130391
+ `<data\\s+[^>]*?name=["']doc-detective["'][^>]*?value="step\\s+([^"]+?)"[^>]*?(?:\\/\\s*>|>\\s*<\\/data>)`,
130392
+ `<data\\s+[^>]*?value='step\\s+([^']+?)'[^>]*?name=["']doc-detective["'][^>]*?(?:\\/\\s*>|>\\s*<\\/data>)`,
130393
+ `<data\\s+[^>]*?value="step\\s+([^"]+?)"[^>]*?name=["']doc-detective["'][^>]*?(?:\\/\\s*>|>\\s*<\\/data>)`
129780
130394
  ]
129781
130395
  },
129782
130396
  markup: [
@@ -130129,6 +130743,9 @@ function parseXmlAttributes({ stringifiedObject }) {
130129
130743
  }
130130
130744
  function parseObject({ stringifiedObject }) {
130131
130745
  if (typeof stringifiedObject === "string") {
130746
+ if (/&(?:#\d+|#x[0-9a-fA-F]+|amp|lt|gt|quot|apos);/.test(stringifiedObject)) {
130747
+ stringifiedObject = stringifiedObject.replace(/&#39;|&apos;/g, "'").replace(/&#34;|&quot;/g, '"').replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
130748
+ }
130132
130749
  const xmlAttrs = parseXmlAttributes({ stringifiedObject });
130133
130750
  if (xmlAttrs !== null) {
130134
130751
  return xmlAttrs;
@@ -130388,17 +131005,7 @@ async function parseContent({ config = {}, content, filePath = "", fileType }) {
130388
131005
  if (step.screenshot && config._herettoPathMapping) {
130389
131006
  const herettoIntegration = findHerettoIntegration(config, filePath);
130390
131007
  if (herettoIntegration) {
130391
- if (typeof step.screenshot === "string") {
130392
- step.screenshot = { path: step.screenshot };
130393
- } else if (typeof step.screenshot === "boolean") {
130394
- step.screenshot = {};
130395
- }
130396
- step.screenshot.sourceIntegration = {
130397
- type: "heretto",
130398
- integrationName: herettoIntegration,
130399
- filePath: step.screenshot.path || "",
130400
- contentPath: filePath
130401
- };
131008
+ attachHerettoScreenshotSourceIntegration(step, herettoIntegration, filePath);
130402
131009
  }
130403
131010
  }
130404
131011
  }
@@ -130464,6 +131071,12 @@ async function parseContent({ config = {}, content, filePath = "", fileType }) {
130464
131071
  endIndex: statement._endIndex
130465
131072
  };
130466
131073
  }
131074
+ if (step.screenshot && config._herettoPathMapping) {
131075
+ const herettoIntegration = findHerettoIntegration(config, filePath);
131076
+ if (herettoIntegration) {
131077
+ attachHerettoScreenshotSourceIntegration(step, herettoIntegration, filePath);
131078
+ }
131079
+ }
130467
131080
  const validation = validate({
130468
131081
  schemaKey: "step_v3",
130469
131082
  object: step,
@@ -130502,6 +131115,19 @@ async function parseContent({ config = {}, content, filePath = "", fileType }) {
130502
131115
  });
130503
131116
  return validatedTests;
130504
131117
  }
131118
+ function attachHerettoScreenshotSourceIntegration(step, integrationName, contentPath) {
131119
+ if (typeof step.screenshot === "string") {
131120
+ step.screenshot = { path: step.screenshot };
131121
+ } else if (step.screenshot === null || typeof step.screenshot !== "object" || Array.isArray(step.screenshot)) {
131122
+ step.screenshot = {};
131123
+ }
131124
+ step.screenshot.sourceIntegration = {
131125
+ type: "heretto",
131126
+ integrationName,
131127
+ filePath: step.screenshot.path || "",
131128
+ contentPath
131129
+ };
131130
+ }
130505
131131
  function findHerettoIntegration(config, filePath) {
130506
131132
  if (!config._herettoPathMapping)
130507
131133
  return null;
@@ -131444,14 +132070,16 @@ async function pollJobStatus(client, fileId, jobId, log3, config) {
131444
132070
  if (job?.status?.result) {
131445
132071
  log3(config, "debug", `Job ${jobId} completed with result: ${job.status.result}`);
131446
132072
  if (job.status.result !== "success") {
131447
- log3(config, "warning", `Publishing job ${jobId} finished with non-success result: ${job.status.result}`);
131448
- return null;
132073
+ log3(config, "warning", `Publishing job ${jobId} finished with non-success result: ${job.status.result}. Checking if output files are available...`);
131449
132074
  }
131450
132075
  try {
131451
132076
  const assets = await getJobAssetDetails(client, fileId, jobId, log3, config);
131452
132077
  log3(config, "debug", `Job ${jobId} has ${assets.length} assets`);
131453
132078
  if (validateDitamapInAssets(assets)) {
131454
132079
  log3(config, "debug", `Found .ditamap file in ot-output/dita/`);
132080
+ if (job.status.result !== "success") {
132081
+ log3(config, "info", `Publishing job ${jobId} result was "${job.status.result}" but required output files are present. Proceeding.`);
132082
+ }
131455
132083
  return job;
131456
132084
  }
131457
132085
  log3(config, "warning", `Publishing job ${jobId} completed but no .ditamap file found in ot-output/dita/`);
@@ -131633,7 +132261,10 @@ async function loadHerettoContent(herettoConfig, log3, config, deps) {
131633
132261
  if (herettoConfig.uploadOnChange) {
131634
132262
  log3(config, "debug", `Fetching resource dependencies for ditamap ${scenario.fileId}...`);
131635
132263
  const resourceDependencies = await getResourceDependenciesFn(restClient, scenario.fileId, log3, config);
131636
- herettoConfig.resourceDependencies = resourceDependencies;
132264
+ herettoConfig.resourceDependencies = {
132265
+ ...resourceDependencies,
132266
+ ...herettoConfig.resourceDependencies || {}
132267
+ };
131637
132268
  }
131638
132269
  log3(config, "debug", `Triggering publishing job for file ${scenario.fileId}...`);
131639
132270
  const job = await triggerPublishingJob(client, scenario.fileId, scenario.scenarioId);
@@ -133599,6 +134230,102 @@ async function runShell({ config, step }) {
133599
134230
 
133600
134231
  // dist/core/tests/checkLink.js
133601
134232
  var import_axios4 = __toESM(require("axios"), 1);
134233
+ var DEFAULT_HEADERS = {
134234
+ "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",
134235
+ Accept: "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
134236
+ "Accept-Language": "en-US,en;q=0.9",
134237
+ "Accept-Encoding": "gzip, deflate, br",
134238
+ "Upgrade-Insecure-Requests": "1",
134239
+ "Sec-Fetch-Site": "none",
134240
+ "Sec-Fetch-Mode": "navigate",
134241
+ "Sec-Fetch-Dest": "document",
134242
+ "Sec-Fetch-User": "?1",
134243
+ "Sec-Ch-Ua": '"Not_A Brand";v="8", "Chromium";v="120", "Google Chrome";v="120"',
134244
+ "Sec-Ch-Ua-Mobile": "?0",
134245
+ "Sec-Ch-Ua-Platform": '"Windows"'
134246
+ };
134247
+ var MAX_ATTEMPTS = 4;
134248
+ var BASE_BACKOFF_MS = 1e3;
134249
+ var MAX_RETRY_AFTER_MS = 1e4;
134250
+ function parseHeaderString(raw) {
134251
+ const out = {};
134252
+ for (const line of raw.split(/\r?\n/)) {
134253
+ const idx = line.indexOf(":");
134254
+ if (idx === -1)
134255
+ continue;
134256
+ const key = line.slice(0, idx).trim();
134257
+ const value = line.slice(idx + 1).trim();
134258
+ if (key && value)
134259
+ out[key] = value;
134260
+ }
134261
+ return out;
134262
+ }
134263
+ function mergeHeaders(userHeaders) {
134264
+ const merged = { ...DEFAULT_HEADERS };
134265
+ if (!userHeaders)
134266
+ return merged;
134267
+ const parsed = typeof userHeaders === "string" ? parseHeaderString(userHeaders) : userHeaders;
134268
+ for (const userKey of Object.keys(parsed)) {
134269
+ const raw = parsed[userKey];
134270
+ if (raw === null || raw === void 0)
134271
+ continue;
134272
+ const value = typeof raw === "string" ? raw : String(raw);
134273
+ const lower = userKey.toLowerCase();
134274
+ for (const existingKey of Object.keys(merged)) {
134275
+ if (existingKey.toLowerCase() === lower)
134276
+ delete merged[existingKey];
134277
+ }
134278
+ merged[userKey] = value;
134279
+ }
134280
+ return merged;
134281
+ }
134282
+ function parseRetryAfter(value) {
134283
+ const candidate = Array.isArray(value) ? value[0] : value;
134284
+ if (typeof candidate !== "string" && typeof candidate !== "number")
134285
+ return null;
134286
+ const str = String(candidate).trim();
134287
+ if (!str)
134288
+ return null;
134289
+ const seconds = Number(str);
134290
+ if (Number.isFinite(seconds)) {
134291
+ return Math.max(0, Math.min(seconds * 1e3, MAX_RETRY_AFTER_MS));
134292
+ }
134293
+ const date = Date.parse(str);
134294
+ if (!Number.isNaN(date)) {
134295
+ return Math.max(0, Math.min(date - Date.now(), MAX_RETRY_AFTER_MS));
134296
+ }
134297
+ return null;
134298
+ }
134299
+ function sleep(ms) {
134300
+ return new Promise((resolve) => setTimeout(resolve, ms));
134301
+ }
134302
+ function shouldRetry(statusCode) {
134303
+ if (statusCode === null)
134304
+ return false;
134305
+ return statusCode === 429 || statusCode >= 500;
134306
+ }
134307
+ async function attemptRequest(method, url, headers) {
134308
+ try {
134309
+ const res = await import_axios4.default.request({
134310
+ method,
134311
+ url,
134312
+ headers,
134313
+ timeout: 1e4,
134314
+ maxRedirects: 5,
134315
+ validateStatus: () => true
134316
+ });
134317
+ const retryAfter = parseRetryAfter(res.headers?.["retry-after"] ?? res.headers?.["Retry-After"]);
134318
+ return { statusCode: res.status, retryAfter };
134319
+ } catch (error) {
134320
+ if (error?.response?.status) {
134321
+ return {
134322
+ statusCode: error.response.status,
134323
+ retryAfter: parseRetryAfter(error.response.headers?.["retry-after"] ?? error.response.headers?.["Retry-After"])
134324
+ };
134325
+ }
134326
+ return { statusCode: null, retryAfter: null };
134327
+ }
134328
+ }
133602
134329
  async function checkLink({ config, step }) {
133603
134330
  let result = { status: "PASS", description: "Checked link." };
133604
134331
  if (typeof step.checkLink === "string") {
@@ -133630,36 +134357,39 @@ async function checkLink({ config, step }) {
133630
134357
  } else if (typeof step.checkLink.statusCodes === "number") {
133631
134358
  step.checkLink.statusCodes = [step.checkLink.statusCodes];
133632
134359
  }
133633
- const requestConfig = {
133634
- headers: {
133635
- "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",
133636
- "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
133637
- "Accept-Language": "en-US,en;q=0.9"
133638
- },
133639
- timeout: 1e4,
133640
- // 10 second timeout
133641
- maxRedirects: 5
133642
- };
133643
- let req = await import_axios4.default.get(step.checkLink.url, requestConfig).then((res) => {
133644
- return { statusCode: res.status };
133645
- }).catch((error) => {
133646
- return { error };
133647
- });
133648
- if (req.error) {
133649
- result.status = "FAIL";
133650
- if (req.error.response && req.error.response.status) {
133651
- result.description = `Returned ${req.error.response.status}. Expected one of ${JSON.stringify(step.checkLink.statusCodes)}`;
133652
- } else {
133653
- result.description = `Invalid or unresolvable URL: ${step.checkLink.url}`;
134360
+ const headers = mergeHeaders(step.checkLink.headers);
134361
+ const url = step.checkLink.url;
134362
+ const acceptedCodes = step.checkLink.statusCodes;
134363
+ const isAccepted = (code) => code !== null && acceptedCodes.indexOf(code) >= 0;
134364
+ let last = { statusCode: null, retryAfter: null };
134365
+ for (let attempt = 0; attempt < MAX_ATTEMPTS; attempt++) {
134366
+ last = await attemptRequest("get", url, headers);
134367
+ if (isAccepted(last.statusCode))
134368
+ break;
134369
+ if (!shouldRetry(last.statusCode))
134370
+ break;
134371
+ if (attempt < MAX_ATTEMPTS - 1) {
134372
+ const backoff = last.retryAfter ?? BASE_BACKOFF_MS * Math.pow(2, attempt);
134373
+ await sleep(backoff);
134374
+ }
134375
+ }
134376
+ if (!isAccepted(last.statusCode) && (last.statusCode === 429 || last.statusCode === 403)) {
134377
+ const headResult = await attemptRequest("head", url, headers);
134378
+ if (isAccepted(headResult.statusCode)) {
134379
+ last = headResult;
133654
134380
  }
134381
+ }
134382
+ if (last.statusCode === null) {
134383
+ result.status = "FAIL";
134384
+ result.description = `Invalid or unresolvable URL: ${url}`;
133655
134385
  return result;
133656
134386
  }
133657
- if (step.checkLink.statusCodes.indexOf(req.statusCode) >= 0) {
134387
+ if (step.checkLink.statusCodes.indexOf(last.statusCode) >= 0) {
133658
134388
  result.status = "PASS";
133659
- result.description = `Returned ${req.statusCode}`;
134389
+ result.description = `Returned ${last.statusCode}`;
133660
134390
  } else {
133661
134391
  result.status = "FAIL";
133662
- result.description = `Returned ${req.statusCode}. Expected one of ${JSON.stringify(step.checkLink.statusCodes)}`;
134392
+ result.description = `Returned ${last.statusCode}. Expected one of ${JSON.stringify(step.checkLink.statusCodes)}`;
133663
134393
  }
133664
134394
  return result;
133665
134395
  }
@@ -134467,6 +135197,15 @@ async function loadCookie({ config, step, driver }) {
134467
135197
  const isHttps = currentUrl.startsWith("https://");
134468
135198
  let sameSite = targetCookie.sameSite || "Lax";
134469
135199
  let secure = targetCookie.secure || false;
135200
+ if (typeof sameSite === "string") {
135201
+ const lower = sameSite.toLowerCase();
135202
+ if (lower === "none")
135203
+ sameSite = "None";
135204
+ else if (lower === "strict")
135205
+ sameSite = "Strict";
135206
+ else
135207
+ sameSite = "Lax";
135208
+ }
134470
135209
  if (sameSite === "None") {
134471
135210
  if (isHttps) {
134472
135211
  secure = true;