doc-detective-common 3.4.0 → 3.4.1-dev.2

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.
@@ -3104,6 +3104,14 @@
3104
3104
  }
3105
3105
  ],
3106
3106
  "default": {}
3107
+ },
3108
+ "required": {
3109
+ "type": "array",
3110
+ "description": "Array of field paths that must exist in the response body. Uses dot notation for nested fields (e.g., 'user.name') and bracket notation for array indices (e.g., 'items[0].id'). Fields must be present but may have any value including null.",
3111
+ "items": {
3112
+ "type": "string"
3113
+ },
3114
+ "default": []
3107
3115
  }
3108
3116
  },
3109
3117
  "title": "Response"
@@ -3495,6 +3503,14 @@
3495
3503
  }
3496
3504
  ],
3497
3505
  "default": {}
3506
+ },
3507
+ "required": {
3508
+ "type": "array",
3509
+ "description": "Array of field paths that must exist in the response body. Uses dot notation for nested fields (e.g., 'user.name') and bracket notation for array indices (e.g., 'items[0].id'). Fields must be present but may have any value including null.",
3510
+ "items": {
3511
+ "type": "string"
3512
+ },
3513
+ "default": []
3498
3514
  }
3499
3515
  },
3500
3516
  "title": "Response"
@@ -3676,6 +3692,52 @@
3676
3692
  "request": {
3677
3693
  "headers": "Content-Type: application/json\\nAuthorization: Bearer token"
3678
3694
  }
3695
+ },
3696
+ {
3697
+ "url": "https://api.example.com/users/123",
3698
+ "response": {
3699
+ "required": [
3700
+ "id",
3701
+ "email",
3702
+ "createdAt"
3703
+ ]
3704
+ }
3705
+ },
3706
+ {
3707
+ "url": "https://api.example.com/users/123",
3708
+ "response": {
3709
+ "required": [
3710
+ "user.profile.name",
3711
+ "user.profile.avatar",
3712
+ "user.settings.notifications"
3713
+ ]
3714
+ }
3715
+ },
3716
+ {
3717
+ "url": "https://api.example.com/orders",
3718
+ "response": {
3719
+ "required": [
3720
+ "orders[0].id",
3721
+ "orders[0].total",
3722
+ "orders[0].items[0].productId"
3723
+ ]
3724
+ }
3725
+ },
3726
+ {
3727
+ "url": "https://api.example.com/users",
3728
+ "response": {
3729
+ "required": [
3730
+ "sessionToken",
3731
+ "expiresAt",
3732
+ "user.id"
3733
+ ],
3734
+ "body": {
3735
+ "status": "success",
3736
+ "user": {
3737
+ "role": "admin"
3738
+ }
3739
+ }
3740
+ }
3679
3741
  }
3680
3742
  ]
3681
3743
  }
@@ -8866,6 +8928,14 @@
8866
8928
  }
8867
8929
  ],
8868
8930
  "default": {}
8931
+ },
8932
+ "required": {
8933
+ "type": "array",
8934
+ "description": "Array of field paths that must exist in the response body. Uses dot notation for nested fields (e.g., 'user.name') and bracket notation for array indices (e.g., 'items[0].id'). Fields must be present but may have any value including null.",
8935
+ "items": {
8936
+ "type": "string"
8937
+ },
8938
+ "default": []
8869
8939
  }
8870
8940
  },
8871
8941
  "title": "Response"
@@ -9257,6 +9327,14 @@
9257
9327
  }
9258
9328
  ],
9259
9329
  "default": {}
9330
+ },
9331
+ "required": {
9332
+ "type": "array",
9333
+ "description": "Array of field paths that must exist in the response body. Uses dot notation for nested fields (e.g., 'user.name') and bracket notation for array indices (e.g., 'items[0].id'). Fields must be present but may have any value including null.",
9334
+ "items": {
9335
+ "type": "string"
9336
+ },
9337
+ "default": []
9260
9338
  }
9261
9339
  },
9262
9340
  "title": "Response"
@@ -9438,6 +9516,52 @@
9438
9516
  "request": {
9439
9517
  "headers": "Content-Type: application/json\\nAuthorization: Bearer token"
9440
9518
  }
9519
+ },
9520
+ {
9521
+ "url": "https://api.example.com/users/123",
9522
+ "response": {
9523
+ "required": [
9524
+ "id",
9525
+ "email",
9526
+ "createdAt"
9527
+ ]
9528
+ }
9529
+ },
9530
+ {
9531
+ "url": "https://api.example.com/users/123",
9532
+ "response": {
9533
+ "required": [
9534
+ "user.profile.name",
9535
+ "user.profile.avatar",
9536
+ "user.settings.notifications"
9537
+ ]
9538
+ }
9539
+ },
9540
+ {
9541
+ "url": "https://api.example.com/orders",
9542
+ "response": {
9543
+ "required": [
9544
+ "orders[0].id",
9545
+ "orders[0].total",
9546
+ "orders[0].items[0].productId"
9547
+ ]
9548
+ }
9549
+ },
9550
+ {
9551
+ "url": "https://api.example.com/users",
9552
+ "response": {
9553
+ "required": [
9554
+ "sessionToken",
9555
+ "expiresAt",
9556
+ "user.id"
9557
+ ],
9558
+ "body": {
9559
+ "status": "success",
9560
+ "user": {
9561
+ "role": "admin"
9562
+ }
9563
+ }
9564
+ }
9441
9565
  }
9442
9566
  ]
9443
9567
  }
@@ -1904,6 +1904,14 @@
1904
1904
  }
1905
1905
  ],
1906
1906
  "default": {}
1907
+ },
1908
+ "required": {
1909
+ "type": "array",
1910
+ "description": "Array of field paths that must exist in the response body. Uses dot notation for nested fields (e.g., 'user.name') and bracket notation for array indices (e.g., 'items[0].id'). Fields must be present but may have any value including null.",
1911
+ "items": {
1912
+ "type": "string"
1913
+ },
1914
+ "default": []
1907
1915
  }
1908
1916
  },
1909
1917
  "title": "Response"
@@ -2295,6 +2303,14 @@
2295
2303
  }
2296
2304
  ],
2297
2305
  "default": {}
2306
+ },
2307
+ "required": {
2308
+ "type": "array",
2309
+ "description": "Array of field paths that must exist in the response body. Uses dot notation for nested fields (e.g., 'user.name') and bracket notation for array indices (e.g., 'items[0].id'). Fields must be present but may have any value including null.",
2310
+ "items": {
2311
+ "type": "string"
2312
+ },
2313
+ "default": []
2298
2314
  }
2299
2315
  },
2300
2316
  "title": "Response"
@@ -2476,6 +2492,52 @@
2476
2492
  "request": {
2477
2493
  "headers": "Content-Type: application/json\\nAuthorization: Bearer token"
2478
2494
  }
2495
+ },
2496
+ {
2497
+ "url": "https://api.example.com/users/123",
2498
+ "response": {
2499
+ "required": [
2500
+ "id",
2501
+ "email",
2502
+ "createdAt"
2503
+ ]
2504
+ }
2505
+ },
2506
+ {
2507
+ "url": "https://api.example.com/users/123",
2508
+ "response": {
2509
+ "required": [
2510
+ "user.profile.name",
2511
+ "user.profile.avatar",
2512
+ "user.settings.notifications"
2513
+ ]
2514
+ }
2515
+ },
2516
+ {
2517
+ "url": "https://api.example.com/orders",
2518
+ "response": {
2519
+ "required": [
2520
+ "orders[0].id",
2521
+ "orders[0].total",
2522
+ "orders[0].items[0].productId"
2523
+ ]
2524
+ }
2525
+ },
2526
+ {
2527
+ "url": "https://api.example.com/users",
2528
+ "response": {
2529
+ "required": [
2530
+ "sessionToken",
2531
+ "expiresAt",
2532
+ "user.id"
2533
+ ],
2534
+ "body": {
2535
+ "status": "success",
2536
+ "user": {
2537
+ "role": "admin"
2538
+ }
2539
+ }
2540
+ }
2479
2541
  }
2480
2542
  ]
2481
2543
  }
@@ -2503,6 +2503,14 @@
2503
2503
  }
2504
2504
  ],
2505
2505
  "default": {}
2506
+ },
2507
+ "required": {
2508
+ "type": "array",
2509
+ "description": "Array of field paths that must exist in the response body. Uses dot notation for nested fields (e.g., 'user.name') and bracket notation for array indices (e.g., 'items[0].id'). Fields must be present but may have any value including null.",
2510
+ "items": {
2511
+ "type": "string"
2512
+ },
2513
+ "default": []
2506
2514
  }
2507
2515
  },
2508
2516
  "title": "Response"
@@ -2894,6 +2902,14 @@
2894
2902
  }
2895
2903
  ],
2896
2904
  "default": {}
2905
+ },
2906
+ "required": {
2907
+ "type": "array",
2908
+ "description": "Array of field paths that must exist in the response body. Uses dot notation for nested fields (e.g., 'user.name') and bracket notation for array indices (e.g., 'items[0].id'). Fields must be present but may have any value including null.",
2909
+ "items": {
2910
+ "type": "string"
2911
+ },
2912
+ "default": []
2897
2913
  }
2898
2914
  },
2899
2915
  "title": "Response"
@@ -3075,6 +3091,52 @@
3075
3091
  "request": {
3076
3092
  "headers": "Content-Type: application/json\\nAuthorization: Bearer token"
3077
3093
  }
3094
+ },
3095
+ {
3096
+ "url": "https://api.example.com/users/123",
3097
+ "response": {
3098
+ "required": [
3099
+ "id",
3100
+ "email",
3101
+ "createdAt"
3102
+ ]
3103
+ }
3104
+ },
3105
+ {
3106
+ "url": "https://api.example.com/users/123",
3107
+ "response": {
3108
+ "required": [
3109
+ "user.profile.name",
3110
+ "user.profile.avatar",
3111
+ "user.settings.notifications"
3112
+ ]
3113
+ }
3114
+ },
3115
+ {
3116
+ "url": "https://api.example.com/orders",
3117
+ "response": {
3118
+ "required": [
3119
+ "orders[0].id",
3120
+ "orders[0].total",
3121
+ "orders[0].items[0].productId"
3122
+ ]
3123
+ }
3124
+ },
3125
+ {
3126
+ "url": "https://api.example.com/users",
3127
+ "response": {
3128
+ "required": [
3129
+ "sessionToken",
3130
+ "expiresAt",
3131
+ "user.id"
3132
+ ],
3133
+ "body": {
3134
+ "status": "success",
3135
+ "user": {
3136
+ "role": "admin"
3137
+ }
3138
+ }
3139
+ }
3078
3140
  }
3079
3141
  ]
3080
3142
  }
@@ -8265,6 +8327,14 @@
8265
8327
  }
8266
8328
  ],
8267
8329
  "default": {}
8330
+ },
8331
+ "required": {
8332
+ "type": "array",
8333
+ "description": "Array of field paths that must exist in the response body. Uses dot notation for nested fields (e.g., 'user.name') and bracket notation for array indices (e.g., 'items[0].id'). Fields must be present but may have any value including null.",
8334
+ "items": {
8335
+ "type": "string"
8336
+ },
8337
+ "default": []
8268
8338
  }
8269
8339
  },
8270
8340
  "title": "Response"
@@ -8656,6 +8726,14 @@
8656
8726
  }
8657
8727
  ],
8658
8728
  "default": {}
8729
+ },
8730
+ "required": {
8731
+ "type": "array",
8732
+ "description": "Array of field paths that must exist in the response body. Uses dot notation for nested fields (e.g., 'user.name') and bracket notation for array indices (e.g., 'items[0].id'). Fields must be present but may have any value including null.",
8733
+ "items": {
8734
+ "type": "string"
8735
+ },
8736
+ "default": []
8659
8737
  }
8660
8738
  },
8661
8739
  "title": "Response"
@@ -8837,6 +8915,52 @@
8837
8915
  "request": {
8838
8916
  "headers": "Content-Type: application/json\\nAuthorization: Bearer token"
8839
8917
  }
8918
+ },
8919
+ {
8920
+ "url": "https://api.example.com/users/123",
8921
+ "response": {
8922
+ "required": [
8923
+ "id",
8924
+ "email",
8925
+ "createdAt"
8926
+ ]
8927
+ }
8928
+ },
8929
+ {
8930
+ "url": "https://api.example.com/users/123",
8931
+ "response": {
8932
+ "required": [
8933
+ "user.profile.name",
8934
+ "user.profile.avatar",
8935
+ "user.settings.notifications"
8936
+ ]
8937
+ }
8938
+ },
8939
+ {
8940
+ "url": "https://api.example.com/orders",
8941
+ "response": {
8942
+ "required": [
8943
+ "orders[0].id",
8944
+ "orders[0].total",
8945
+ "orders[0].items[0].productId"
8946
+ ]
8947
+ }
8948
+ },
8949
+ {
8950
+ "url": "https://api.example.com/users",
8951
+ "response": {
8952
+ "required": [
8953
+ "sessionToken",
8954
+ "expiresAt",
8955
+ "user.id"
8956
+ ],
8957
+ "body": {
8958
+ "status": "success",
8959
+ "user": {
8960
+ "role": "admin"
8961
+ }
8962
+ }
8963
+ }
8840
8964
  }
8841
8965
  ]
8842
8966
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doc-detective-common",
3
- "version": "3.4.0",
3
+ "version": "3.4.1-dev.2",
4
4
  "description": "Shared components for Doc Detective projects.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -20,17 +20,17 @@
20
20
  },
21
21
  "homepage": "https://github.com/doc-detective/doc-detective-common#readme",
22
22
  "devDependencies": {
23
- "chai": "^6.2.0",
24
- "mocha": "^11.7.4",
23
+ "chai": "^6.2.1",
24
+ "mocha": "^11.7.5",
25
25
  "sinon": "^21.0.0"
26
26
  },
27
27
  "dependencies": {
28
- "@apidevtools/json-schema-ref-parser": "^14.2.1",
28
+ "@apidevtools/json-schema-ref-parser": "^15.1.1",
29
29
  "ajv": "^8.17.1",
30
30
  "ajv-errors": "^3.0.0",
31
31
  "ajv-formats": "^3.0.1",
32
32
  "ajv-keywords": "^5.1.0",
33
- "axios": "^1.12.2",
33
+ "axios": "^1.13.2",
34
34
  "yaml": "^2.8.1"
35
35
  }
36
36
  }
@@ -76,8 +76,14 @@ async function resolvePaths({
76
76
  * @returns {string} The absolute path corresponding to {@link relativePath}.
77
77
  *
78
78
  * @remark If {@link relativePath} is already absolute, it is returned unchanged. If {@link filePath} does not exist, its extension is used to infer whether it is a file or directory.
79
+ * @remark HTTP and HTTPS URLs are returned unchanged without resolution.
79
80
  */
80
81
  function resolve(baseType, relativePath, filePath) {
82
+ // If the path is an http:// or https:// URL, return it
83
+ if (relativePath.startsWith("https://") || relativePath.startsWith("http://")) {
84
+ return relativePath;
85
+ }
86
+
81
87
  // If path is already absolute, return it
82
88
  if (path.isAbsolute(relativePath)) {
83
89
  return relativePath;
@@ -134,6 +140,11 @@ async function resolvePaths({
134
140
  pathProperties = specPaths;
135
141
  }
136
142
 
143
+ // If the object is null or empty, return it as is
144
+ if (object === null || Object.keys(object).length === 0) {
145
+ return object;
146
+ }
147
+
137
148
  for (const property of Object.keys(object)) {
138
149
  // If the property is an array, recursively call resolvePaths for each item in the array
139
150
  if (Array.isArray(object[property])) {
@@ -104,6 +104,11 @@
104
104
  "type": "boolean",
105
105
  "description": "Whether or not to run potentially unsafe steps, such as those that might modify files or system state."
106
106
  },
107
+ "crawl": {
108
+ "description": "If `true`, crawls sitemap.xml files specified by URL to find additional files to test.",
109
+ "type": "boolean",
110
+ "default": false
111
+ },
107
112
  "processDitaMaps": {
108
113
  "description": "If `true`, processes DITA maps and includes generated files as inputs.",
109
114
  "type": "boolean",
@@ -238,6 +243,18 @@
238
243
  "properties": {
239
244
  "openApi": {
240
245
  "$ref": "/home/runner/work/common/common/src/schemas/build/test_v3.schema.json#/properties/openApi"
246
+ },
247
+ "docDetectiveApi": {
248
+ "type": "object",
249
+ "description": "Configuration for Doc Detective Orchestration API integration.",
250
+ "additionalProperties": false,
251
+ "properties": {
252
+ "apiKey": {
253
+ "type": "string",
254
+ "description": "API key for authenticating with the Doc Detective Orchestration API."
255
+ }
256
+ },
257
+ "title": "Doc Detective Orchestration API"
241
258
  }
242
259
  },
243
260
  "title": "Integrations options"
@@ -553,6 +570,16 @@
553
570
  },
554
571
  {
555
572
  "debug": "stepThrough"
573
+ },
574
+ {
575
+ "integrations": {
576
+ "docDetectiveApi": {
577
+ "apiKey": "your-api-key-here"
578
+ }
579
+ }
580
+ },
581
+ {
582
+ "crawl": true
556
583
  }
557
584
  ],
558
585
  "$id": "/home/runner/work/common/common/src/schemas/src_schemas/config_v3.schema.json"
@@ -198,6 +198,14 @@
198
198
  }
199
199
  ],
200
200
  "default": {}
201
+ },
202
+ "required": {
203
+ "type": "array",
204
+ "description": "Array of field paths that must exist in the response body. Uses dot notation for nested fields (e.g., 'user.name') and bracket notation for array indices (e.g., 'items[0].id'). Fields must be present but may have any value including null.",
205
+ "items": {
206
+ "type": "string"
207
+ },
208
+ "default": []
201
209
  }
202
210
  },
203
211
  "title": "Response"
@@ -379,6 +387,52 @@
379
387
  "request": {
380
388
  "headers": "Content-Type: application/json\\nAuthorization: Bearer token"
381
389
  }
390
+ },
391
+ {
392
+ "url": "https://api.example.com/users/123",
393
+ "response": {
394
+ "required": [
395
+ "id",
396
+ "email",
397
+ "createdAt"
398
+ ]
399
+ }
400
+ },
401
+ {
402
+ "url": "https://api.example.com/users/123",
403
+ "response": {
404
+ "required": [
405
+ "user.profile.name",
406
+ "user.profile.avatar",
407
+ "user.settings.notifications"
408
+ ]
409
+ }
410
+ },
411
+ {
412
+ "url": "https://api.example.com/orders",
413
+ "response": {
414
+ "required": [
415
+ "orders[0].id",
416
+ "orders[0].total",
417
+ "orders[0].items[0].productId"
418
+ ]
419
+ }
420
+ },
421
+ {
422
+ "url": "https://api.example.com/users",
423
+ "response": {
424
+ "required": [
425
+ "sessionToken",
426
+ "expiresAt",
427
+ "user.id"
428
+ ],
429
+ "body": {
430
+ "status": "success",
431
+ "user": {
432
+ "role": "admin"
433
+ }
434
+ }
435
+ }
382
436
  }
383
437
  ],
384
438
  "$id": "/home/runner/work/common/common/src/schemas/src_schemas/httpRequest_v3.schema.json"