json-rest-api 1.0.22 → 1.0.24

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 (290) hide show
  1. package/CLAUDE.md +1 -2
  2. package/JSKIT_BACKEND_MIGRATION_TRACKER.txt +180 -0
  3. package/README.md +22 -1
  4. package/SINGLE_VALIDATION_CONTRACT_TODO.txt +172 -0
  5. package/docs/API.md +196 -38
  6. package/docs/COMPARISON.md +2 -2
  7. package/docs/GUIDE/GUIDE_1_Initial_Setup.md +111 -5
  8. package/docs/GUIDE/GUIDE_2_2_Manipulating_And_Searching_Tables.md +5 -1
  9. package/docs/GUIDE/GUIDE_2_7_Pagination_And_Ordering.md +3 -1
  10. package/docs/GUIDE/GUIDE_2_8_Effects_of_PUT_and_PATCH.md +12 -60
  11. package/docs/GUIDE/GUIDE_2_Data_And_Relations.md +2 -2
  12. package/docs/GUIDE/GUIDE_3_Field_Transformations.md +5 -1
  13. package/docs/GUIDE/GUIDE_7_Hooks_Data_Management_And_Plugins.md +2 -0
  14. package/docs/GUIDE/GUIDE_X_Autofiltering.md +355 -0
  15. package/docs/GUIDE/GUIDE_X_Fastify.md +78 -0
  16. package/docs/GUIDE/GUIDE_X_Knex_Schema_And_Migrations.md +370 -0
  17. package/docs/GUIDE/GUIDE_X_Query_Projections.md +159 -0
  18. package/docs/GUIDE/GUIDE_X_Writing_Plugins.md +199 -0
  19. package/docs/GUIDE/index.md +18 -9
  20. package/docs/QUICKSTART.md +5 -1
  21. package/docs/index.md +1 -1
  22. package/index.js +3 -2
  23. package/lib/enhanced-logger.js +1 -1
  24. package/package.json +6 -2
  25. package/plugins/core/bulk-operations-plugin.js +26 -34
  26. package/plugins/core/connectors/express-plugin.js +97 -190
  27. package/plugins/core/connectors/fastify-plugin.js +206 -0
  28. package/plugins/core/connectors/lib/busboy-detector.js +4 -4
  29. package/plugins/core/connectors/lib/connector-core.js +195 -0
  30. package/plugins/core/connectors/lib/transport-http-helpers.js +122 -0
  31. package/plugins/core/connectors/lib/transport-route-schemas.js +92 -0
  32. package/plugins/core/lib/anyapi/schema-utils.js +43 -4
  33. package/plugins/core/lib/anyapi/utils/descriptor-helpers.js +4 -1
  34. package/plugins/core/lib/dbIntrospection.js +1078 -0
  35. package/plugins/core/lib/dbTablesOperations.js +1111 -160
  36. package/plugins/core/lib/querying/knex-cross-table-search.js +0 -7
  37. package/plugins/core/lib/querying/knex-json-api-transformers-querying.js +5 -3
  38. package/plugins/core/lib/querying/knex-process-includes.js +3 -4
  39. package/plugins/core/lib/querying/knex-query-helpers.js +21 -76
  40. package/plugins/core/lib/querying/knex-relationship-includes.js +468 -215
  41. package/plugins/core/lib/querying/query-builder-utils.js +19 -0
  42. package/plugins/core/lib/querying/query-field-sort-helpers.js +135 -0
  43. package/plugins/core/lib/querying/sort-helpers.js +33 -0
  44. package/plugins/core/lib/querying/storage-adapter-utils.js +51 -0
  45. package/plugins/core/lib/querying/url-helpers.js +8 -2
  46. package/plugins/core/lib/querying-writing/compile-schemas.js +20 -5
  47. package/plugins/core/lib/querying-writing/knex-field-helpers.js +83 -14
  48. package/plugins/core/lib/querying-writing/knex-json-api-transformers.js +13 -12
  49. package/plugins/core/lib/querying-writing/query-field-helpers.js +88 -0
  50. package/plugins/core/lib/querying-writing/request-contracts.js +590 -0
  51. package/plugins/core/lib/querying-writing/resource-id-normalization.js +131 -0
  52. package/plugins/core/lib/querying-writing/schema-helpers.js +0 -2
  53. package/plugins/core/lib/querying-writing/simplified-helpers.js +4 -11
  54. package/plugins/core/lib/storage/canonical-storage-mapping.js +133 -0
  55. package/plugins/core/lib/storage/storage-adapter.js +82 -4
  56. package/plugins/core/lib/storage/storage-mapping.js +274 -0
  57. package/plugins/core/lib/writing/many-to-many-manipulations.js +4 -2
  58. package/plugins/core/rest-api-anyapi-knex-plugin.js +531 -312
  59. package/plugins/core/rest-api-autofilter-plugin.js +414 -0
  60. package/plugins/core/rest-api-knex-plugin.js +271 -226
  61. package/plugins/core/rest-api-plugin-hooks/register-relationship-routes.js +10 -5
  62. package/plugins/core/rest-api-plugin-hooks/register-scope-routes.js +12 -6
  63. package/plugins/core/rest-api-plugin-hooks/turn-scope-init-into-vars.js +1 -0
  64. package/plugins/core/rest-api-plugin-methods/apply-query-filters.js +41 -0
  65. package/plugins/core/rest-api-plugin-methods/common.js +148 -92
  66. package/plugins/core/rest-api-plugin-methods/delete-relationship.js +11 -2
  67. package/plugins/core/rest-api-plugin-methods/delete.js +6 -1
  68. package/plugins/core/rest-api-plugin-methods/enrich-attributes.js +6 -1
  69. package/plugins/core/rest-api-plugin-methods/get-related.js +7 -2
  70. package/plugins/core/rest-api-plugin-methods/get-relationship.js +7 -2
  71. package/plugins/core/rest-api-plugin-methods/get.js +29 -14
  72. package/plugins/core/rest-api-plugin-methods/patch-relationship.js +10 -3
  73. package/plugins/core/rest-api-plugin-methods/patch.js +56 -12
  74. package/plugins/core/rest-api-plugin-methods/post-relationship.js +11 -2
  75. package/plugins/core/rest-api-plugin-methods/post.js +21 -8
  76. package/plugins/core/rest-api-plugin-methods/put.js +73 -21
  77. package/plugins/core/rest-api-plugin-methods/query.js +15 -53
  78. package/plugins/core/rest-api-plugin-methods/release.js +0 -2
  79. package/plugins/core/rest-api-plugin.js +6 -0
  80. package/plugins/core/rest-api-positioning-plugin.js +2 -5
  81. package/plugins/core/rest-api-query-projections-plugin.js +130 -0
  82. package/plugins/core/socketio-plugin.js +1 -4
  83. package/plugins/storage/local-storage.js +1 -1
  84. package/plugins/storage/s3-storage.js +5 -2
  85. package/quickTest.js +1 -0
  86. package/scripts/run-docs.js +80 -84
  87. package/test-debug.js +1 -1
  88. package/tests/README.md +7 -0
  89. package/tests/anyapi-basic.test.js +3 -0
  90. package/tests/autofilter.test.js +463 -0
  91. package/tests/custom-id-mysql-returning-fallback.test.js +128 -0
  92. package/tests/custom-id-simplified-post.test.js +75 -0
  93. package/tests/custom-idproperty-relationships.test.js +33 -0
  94. package/tests/db-introspection.test.js +521 -0
  95. package/tests/db-table-operations.test.js +786 -0
  96. package/tests/fastify-plugin.test.js +156 -0
  97. package/tests/field-getters.test.js +1 -2
  98. package/tests/field-setters.test.js +0 -4
  99. package/tests/fixtures/api-configs.js +278 -176
  100. package/tests/helpers/fake-fastify.js +99 -0
  101. package/tests/http-connectors-parity.test.js +235 -0
  102. package/tests/id-normalization.test.js +444 -0
  103. package/tests/logical-id-write-validation.test.js +151 -0
  104. package/tests/pagination-cursor-multifield.test.js +11 -11
  105. package/tests/projected-fields.test.js +319 -0
  106. package/tests/relationships.test.js +3 -3
  107. package/tests/searchschema-knex-behavior.test.js +187 -0
  108. package/tests/searchschema-merge.test.js +21 -69
  109. package/tests/storage-mapping.test.js +259 -0
  110. package/audit/00-charter.md +0 -103
  111. package/audit/01-scope-map.md +0 -84
  112. package/audit/02-coverage-matrix.csv +0 -174
  113. package/audit/03-invariants.md +0 -123
  114. package/audit/04-standards-rubric.md +0 -56
  115. package/audit/05-competitor-rubric.md +0 -77
  116. package/audit/06-findings.md +0 -160
  117. package/audit/07-risk-register.csv +0 -10
  118. package/audit/08-remediation-roadmap.md +0 -177
  119. package/audit/09-signoff-check.md +0 -23
  120. package/audit/10-final-synthesis.md +0 -29
  121. package/audit/evidence/code/all-files-json-rest-api.txt +0 -168
  122. package/audit/evidence/code/all-files-json-rest-schema.txt +0 -12
  123. package/audit/evidence/code/boundary-leak-checks.txt +0 -72
  124. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__bulk-operations-plugin.js.txt +0 -480
  125. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__connectors__express-plugin.js.txt +0 -532
  126. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__connectors__lib__busboy-detector.js.txt +0 -175
  127. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__connectors__lib__formidable-detector.js.txt +0 -138
  128. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__connectors__lib__request-helpers.js.txt +0 -222
  129. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__file-handling-plugin.js.txt +0 -342
  130. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__dbTablesOperations.js.txt +0 -304
  131. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__fractional-positioning.js.txt +0 -188
  132. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying-writing__compile-schemas.js.txt +0 -336
  133. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying-writing__connectors-query-parser.js.txt +0 -165
  134. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying-writing__database-capabilities.js.txt +0 -265
  135. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying-writing__database-value-normalizers.js.txt +0 -369
  136. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying-writing__default-data-helpers.js.txt +0 -72
  137. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying-writing__field-utils.js.txt +0 -139
  138. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying-writing__knex-constants.js.txt +0 -45
  139. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying-writing__knex-field-helpers.js.txt +0 -396
  140. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying-writing__knex-json-api-transformers.js.txt +0 -162
  141. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying-writing__payload-validators.js.txt +0 -1314
  142. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying-writing__schema-helpers.js.txt +0 -488
  143. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying-writing__scope-validations.js.txt +0 -484
  144. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying-writing__simplified-helpers.js.txt +0 -857
  145. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying__knex-cross-table-search.js.txt +0 -565
  146. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying__knex-json-api-transformers-querying.js.txt +0 -485
  147. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying__knex-pagination-helpers.js.txt +0 -560
  148. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying__knex-process-includes.js.txt +0 -167
  149. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying__knex-query-helpers-base.js.txt +0 -109
  150. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying__knex-query-helpers.js.txt +0 -1064
  151. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying__knex-relationship-includes.js.txt +0 -1983
  152. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying__knex-window-queries.js.txt +0 -328
  153. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying__url-helpers.js.txt +0 -119
  154. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__storage__storage-adapter.js.txt +0 -160
  155. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__writing__many-to-many-manipulations.js.txt +0 -300
  156. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__writing__relationship-processor.js.txt +0 -245
  157. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-access.js.txt +0 -459
  158. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-cors-plugin.js.txt +0 -237
  159. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-knex-plugin.js.txt +0 -1135
  160. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-multihome-plugin.js.txt +0 -314
  161. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-hooks__compile-resource-schemas.js.txt +0 -7
  162. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-hooks__register-relationship-routes.js.txt +0 -71
  163. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-hooks__register-scope-routes.js.txt +0 -102
  164. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-hooks__turn-scope-init-into-vars.js.txt +0 -49
  165. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-hooks__validate-include-configurations.js.txt +0 -39
  166. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__add-route.js.txt +0 -23
  167. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__check-permissions.js.txt +0 -13
  168. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__common.js.txt +0 -639
  169. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__delete-relationship.js.txt +0 -117
  170. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__delete.js.txt +0 -104
  171. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__enrich-attributes.js.txt +0 -199
  172. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__get-related.js.txt +0 -353
  173. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__get-relationship.js.txt +0 -61
  174. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__get.js.txt +0 -184
  175. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__patch-relationship.js.txt +0 -55
  176. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__patch.js.txt +0 -191
  177. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__post-relationship.js.txt +0 -110
  178. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__post.js.txt +0 -168
  179. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__put.js.txt +0 -253
  180. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__query.js.txt +0 -207
  181. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__release.js.txt +0 -12
  182. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin.js.txt +0 -165
  183. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-positioning-plugin.js.txt +0 -668
  184. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__socketio-plugin.js.txt +0 -621
  185. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__storage__local-storage.js.txt +0 -218
  186. package/audit/evidence/code/critical-pass1/json-rest-api__plugins__storage__s3-storage.js.txt +0 -124
  187. package/audit/evidence/code/critical-pass1/json-rest-schema__src__CorePlugin.js.txt +0 -269
  188. package/audit/evidence/code/critical-pass1/json-rest-schema__src__Schema.js.txt +0 -242
  189. package/audit/evidence/code/critical-pass1/json-rest-schema__src__index.js.txt +0 -77
  190. package/audit/evidence/code/critical-pass1-risk-keywords.txt +0 -238
  191. package/audit/evidence/code/critical-pass1-summary.csv +0 -67
  192. package/audit/evidence/code/critical-pass2-summary.csv +0 -67
  193. package/audit/evidence/code/early-silent-zones-no-test-token.txt +0 -57
  194. package/audit/evidence/code/error-model-signals.txt +0 -98
  195. package/audit/evidence/code/git-files-json-rest-api.txt +0 -171
  196. package/audit/evidence/code/git-files-json-rest-schema.txt +0 -27
  197. package/audit/evidence/code/hook-flow-signals.txt +0 -282
  198. package/audit/evidence/code/idproperty-signals.txt +0 -157
  199. package/audit/evidence/code/import-cycles-non-anyapi.txt +0 -3
  200. package/audit/evidence/code/import-hotspots-non-anyapi.txt +0 -96
  201. package/audit/evidence/code/imports-json-rest-api.txt +0 -354
  202. package/audit/evidence/code/imports-json-rest-schema.txt +0 -15
  203. package/audit/evidence/code/in-scope-files-json-rest-api.txt +0 -160
  204. package/audit/evidence/code/in-scope-files-json-rest-schema.txt +0 -13
  205. package/audit/evidence/code/non-anyapi-core-files.txt +0 -101
  206. package/audit/evidence/code/permission-signals.txt +0 -193
  207. package/audit/evidence/code/query-include-signals.txt +0 -687
  208. package/audit/evidence/code/transaction-signals.txt +0 -28
  209. package/audit/evidence/code/validation-signals.txt +0 -650
  210. package/audit/evidence/code/write-path-signals.txt +0 -61
  211. package/audit/evidence/docs/docs-claims-signals.txt +0 -1075
  212. package/audit/evidence/docs/schema-docs-claims-signals.txt +0 -179
  213. package/audit/evidence/external/corpus-freeze.md +0 -21
  214. package/audit/evidence/external/npm-competitor-metadata.txt +0 -70
  215. package/audit/evidence/external/npm-download-signals.txt +0 -23
  216. package/audit/evidence/external/npm-jsonapi-server.txt +0 -8
  217. package/audit/evidence/external/npm-modern-jsonapi-metadata.txt +0 -38
  218. package/audit/evidence/external/readme-fortune-signals.txt +0 -26
  219. package/audit/evidence/external/readme-fortune.md +0 -165
  220. package/audit/evidence/external/readme-json-api-serializer-signals.txt +0 -80
  221. package/audit/evidence/external/readme-json-api-serializer.md +0 -690
  222. package/audit/evidence/external/readme-jsonapi-serde-server-signals.txt +0 -0
  223. package/audit/evidence/external/readme-jsonapi-serde-server.md +0 -22
  224. package/audit/evidence/external/readme-jsonapi-serializer-signals.txt +0 -63
  225. package/audit/evidence/external/readme-jsonapi-serializer.md +0 -315
  226. package/audit/evidence/external/readme-jsonapi-server-signals.txt +0 -19
  227. package/audit/evidence/external/readme-jsonapi-server.md +0 -104
  228. package/audit/evidence/external/readme-nestjs-json-api-signals.txt +0 -4
  229. package/audit/evidence/external/readme-nestjs-json-api.md +0 -94
  230. package/audit/evidence/external/readme-yaser-json-api-nestjs-signals.txt +0 -47
  231. package/audit/evidence/external/readme-yaser-json-api-nestjs.md +0 -447
  232. package/audit/evidence/external/standard-jsonapi-snippets.txt +0 -84
  233. package/audit/evidence/external/standard-rfc-snippets.txt +0 -168
  234. package/audit/evidence/external/standards-sources.txt +0 -6
  235. package/audit/evidence/runtime/baseline-commits.txt +0 -2
  236. package/audit/evidence/runtime/db-adapter-assumptions.txt +0 -3
  237. package/audit/evidence/runtime/environment.txt +0 -4
  238. package/audit/evidence/runtime/invariant-runtime-mapping.md +0 -38
  239. package/audit/evidence/runtime/probe-patch-relationship-error.exitcode +0 -1
  240. package/audit/evidence/runtime/probe-patch-relationship-error.log +0 -76
  241. package/audit/evidence/runtime/probe-patch-relationship-error.mjs +0 -67
  242. package/audit/evidence/runtime/probe-patch-relationship-referenceerror.exitcode +0 -1
  243. package/audit/evidence/runtime/probe-patch-relationship-referenceerror.log +0 -62
  244. package/audit/evidence/runtime/probe-patch-relationship-referenceerror.mjs +0 -47
  245. package/audit/evidence/runtime/test-exitcodes.txt +0 -4
  246. package/audit/evidence/runtime/test-summary.md +0 -107
  247. package/audit/evidence/runtime/trace-anchors.txt +0 -61
  248. package/audit/evidence/tests/access-multitenancy-test-signals.txt +0 -125
  249. package/audit/evidence/tests/failing-tests-summary.txt +0 -25
  250. package/audit/evidence/tests/npm-test-json-rest-api.exitcode +0 -1
  251. package/audit/evidence/tests/npm-test-json-rest-api.log +0 -5885
  252. package/audit/evidence/tests/npm-test-json-rest-schema.exitcode +0 -1
  253. package/audit/evidence/tests/npm-test-json-rest-schema.log +0 -356
  254. package/audit/evidence/tests/query-include-test-signals.txt +0 -948
  255. package/audit/evidence/tests/relationship-test-signals.txt +0 -223
  256. package/audit/evidence/tests/skipped-tests.txt +0 -10
  257. package/audit/evidence/tests/test-suite-list-non-anyapi.txt +0 -30
  258. package/audit/evidence/tests/test-suite-list.txt +0 -32
  259. package/audit/subsystems/docs-drift.md +0 -49
  260. package/audit/subsystems/pass2-cross-review.md +0 -131
  261. package/audit/subsystems/plugins-access.md +0 -51
  262. package/audit/subsystems/plugins-bulk.md +0 -50
  263. package/audit/subsystems/plugins-cors.md +0 -48
  264. package/audit/subsystems/plugins-file.md +0 -53
  265. package/audit/subsystems/plugins-multihome.md +0 -50
  266. package/audit/subsystems/plugins-positioning.md +0 -54
  267. package/audit/subsystems/plugins-socketio.md +0 -50
  268. package/audit/subsystems/query-engine.md +0 -61
  269. package/audit/subsystems/relationships.md +0 -55
  270. package/audit/subsystems/rest-orchestration.md +0 -66
  271. package/audit/subsystems/schema-core.md +0 -64
  272. package/audit/subsystems/storage-knex.md +0 -57
  273. package/audit/subsystems/tests.md +0 -48
  274. package/audit/subsystems/transport-express.md +0 -55
  275. package/audit/traces/trace-read-get.md +0 -22
  276. package/audit/traces/trace-read-query.md +0 -25
  277. package/audit/traces/trace-relationship-endpoints.md +0 -31
  278. package/audit/traces/trace-write-delete.md +0 -17
  279. package/audit/traces/trace-write-patch.md +0 -26
  280. package/audit/traces/trace-write-post.md +0 -22
  281. package/audit/traces/trace-write-put.md +0 -23
  282. package/docs/GUIDE/GUIDE_4_Authentication_And_Permissions.md +0 -707
  283. package/docs/GUIDE/GUIDE_X_Multihome.md +0 -666
  284. package/plugins/core/lib/querying-writing/payload-validators.js +0 -1314
  285. package/plugins/core/rest-api-access.js +0 -459
  286. package/plugins/core/rest-api-multihome-plugin.js +0 -314
  287. package/tests/multihome.test.js +0 -553
  288. package/tests/multihome.test.js.bak +0 -550
  289. package/tests/ownership-optout.test.js +0 -76
  290. package/tests/rest-api-access.test.js +0 -206
@@ -1,223 +0,0 @@
1
- tests/custom-idproperty-relationships.test.js:114: it('should create resource with belongsTo relationship using custom IDs', async () => {
2
- tests/custom-idproperty-relationships.test.js:125: // Create publisher with country relationship
3
- tests/custom-idproperty-relationships.test.js:166: it('should update belongsTo relationship via PATCH', async () => {
4
- tests/custom-idproperty-relationships.test.js:189: relationships: {
5
- tests/custom-idproperty-relationships.test.js:253: it('should create many-to-many relationships with custom IDs', async () => {
6
- tests/custom-idproperty-relationships.test.js:300: it('should handle PATCH updates to many-to-many relationships', async () => {
7
- tests/custom-idproperty-relationships.test.js:317: relationships: {
8
- tests/custom-idproperty-relationships.test.js:335: // With include, we should get the authors relationship data
9
- tests/custom-idproperty-relationships.test.js:467: it('should handle nested includes through custom ID relationships', async () => {
10
- tests/custom-idproperty-relationships.test.js:514: // Verify nested relationship
11
- tests/custom-idproperty-relationships.test.js:515: assert.equal(includedPublisher.relationships.country.data.id, country.data.id)
12
- tests/custom-idproperty-relationships.test.js:685: // This should fail: trying to go too deep (if we had deeper relationships)
13
- tests/custom-idproperty-relationships.test.js:810: // Verify all relationships were created
14
- tests/custom-idproperty-relationships.test.js:885: relationships: {
15
- tests/curl.test.js:240: // Create publisher with country relationship
16
- tests/queries.test.js:94: // Create 5 books with various relationships
17
- tests/queries.test.js:303: // Sort test books by country relationship for verification
18
- tests/queries.test.js:305: const countryA = a.relationships.country.data.id
19
- tests/queries.test.js:306: const countryB = b.relationships.country.data.id
20
- tests/queries.test.js:315: assert.equal(sortedTestBooks[0].relationships.country.data.id, country1Result.data.id)
21
- tests/queries.test.js:316: assert.equal(sortedTestBooks[1].relationships.country.data.id, country1Result.data.id)
22
- tests/queries.test.js:317: assert.equal(sortedTestBooks[2].relationships.country.data.id, country2Result.data.id)
23
- tests/queries.test.js:318: assert.equal(sortedTestBooks[3].relationships.country.data.id, country2Result.data.id)
24
- tests/queries.test.js:497: it('should filter and include relationships', async () => {
25
- tests/socketio.test.js:366: // Try to create a book without required country relationship
26
- tests/socketio.test.js:369: // Missing required country relationship
27
- tests/socketio.test.js:379: // Expected to fail due to missing required relationship
28
- tests/socketio.test.js:707: it('should filter by relationship fields', async () => {
29
- tests/rest-api.test.js:90: it('should create a publisher with country relationship', async () => {
30
- tests/rest-api.test.js:102: // Create publisher with country relationship
31
- tests/rest-api.test.js:126: // Verify data and relationship through API
32
- tests/nested-includes.test.js:59: relationships: {
33
- tests/nested-includes.test.js:77: relationships: {
34
- tests/nested-includes.test.js:100: relationships: {
35
- tests/nested-includes.test.js:210: // Create relationships
36
- tests/nested-includes.test.js:242: it('should populate reverse relationships when using nested includes', async () => {
37
- tests/nested-includes.test.js:261: // Verify each book has its authors relationship populated
38
- tests/nested-includes.test.js:263: assert(book.relationships?.authors?.data, `Book ${book.id} should have authors relationship`)
39
- tests/nested-includes.test.js:266: assert.equal(book.relationships.authors.data.length, 1, 'Book 1 should have 1 author')
40
- tests/nested-includes.test.js:267: assert.equal(book.relationships.authors.data[0].id, '1', 'Book 1 should have Author 1')
41
- tests/nested-includes.test.js:269: assert.equal(book.relationships.authors.data.length, 2, 'Book 2 should have 2 authors')
42
- tests/nested-includes.test.js:270: const authorIds = book.relationships.authors.data.map(a => a.id).sort()
43
- tests/nested-includes.test.js:273: assert.equal(book.relationships.authors.data.length, 1, 'Book 3 should have 1 author')
44
- tests/nested-includes.test.js:274: assert.equal(book.relationships.authors.data[0].id, '2', 'Book 3 should have Author 2')
45
- tests/nested-includes.test.js:319: assert(author1.relationships?.books?.data, 'Author 1 should have books relationship')
46
- tests/nested-includes.test.js:322: const bookCount = author1.relationships.books.data.length
47
- tests/nested-includes.test.js:326: // All included books should have their authors relationship populated
48
- tests/nested-includes.test.js:330: // At least some books should have their authors relationship populated
49
- tests/nested-includes.test.js:332: book.relationships?.authors?.data && book.relationships.authors.data.length > 0
50
- tests/nested-includes.test.js:334: assert(booksWithAuthors.length > 0, 'At least some books should have authors relationship populated')
51
- tests/nested-includes.test.js:422: // All defined relationships will be included when requested via ?include=
52
- tests/nested-includes.test.js:424: // Verify nested relationships are populated
53
- tests/nested-includes.test.js:426: assert(book.relationships?.publisher?.data, 'Book should have publisher relationship')
54
- tests/nested-includes.test.js:430: assert(publisher.relationships?.country?.data, 'Publisher should have country relationship')
55
- tests/nested-includes.test.js:449: // Authors should have their relationships populated
56
- tests/nested-includes.test.js:452: assert(author.relationships?.country?.data, 'Author should have country relationship')
57
- tests/nested-includes.test.js:453: assert(author.relationships?.books?.data, 'Author should have books relationship')
58
- tests/nested-includes.test.js:537: // Note: Some internal fields like pages and _relationshipMetadata might still be present
59
- tests/nested-includes.test.js:547: assert(book.relationships?.reviews?.data, 'Book should have reviews relationship')
60
- tests/nested-includes.test.js:553: // Create simple circular relationship data
61
- tests/nested-includes.test.js:607: // All relationships should be properly populated
62
- tests/nested-includes.test.js:609: assert(book.relationships?.authors?.data, 'Book should have authors relationship')
63
- tests/nested-includes.test.js:613: assert(author.relationships?.books?.data, 'Author should have books relationship')
64
- tests/rest-api-access.test.js:161: const relatedUserIds = adminQuery.data.map((resource) => resource.relationships.user.data.id).sort()
65
- tests/computed-fields.test.js:293: it('should always include minimal relationship objects regardless of sparse fieldsets', async () => {
66
- tests/computed-fields.test.js:301: // Minimal relationship objects should still be included
67
- tests/computed-fields.test.js:311: it('should include empty arrays for empty relationships', async () => {
68
- tests/includes.test.js:99: it('should include single belongsTo relationship', async () => {
69
- tests/includes.test.js:121: it('should include multiple relationships', async () => {
70
- tests/includes.test.js:149: it('should include relationships in collection queries', async () => {
71
- tests/includes.test.js:210: it('should include nested relationships', async () => {
72
- tests/includes.test.js:232: // Verify the publisher has country relationship
73
- tests/includes.test.js:233: assert(publisher.relationships?.country, 'Publisher should have country relationship')
74
- tests/includes.test.js:234: assert.equal(publisher.relationships.country.data.id, country.id)
75
- tests/includes.test.js:238: // Create an author to have more relationships
76
- tests/includes.test.js:250: relationships: {
77
- tests/includes.test.js:343: it('should include relationships with sparse fieldsets', async () => {
78
- tests/polymorphic-simple.test.js:83: // Polymorphic fields are no longer in attributes, they're in relationships
79
- tests/polymorphic-simple.test.js:84: assert.equal(retrievedReview.data.relationships.reviewable.data.type, 'books')
80
- tests/polymorphic-simple.test.js:85: assert.equal(retrievedReview.data.relationships.reviewable.data.id, String(book.data.id))
81
- tests/polymorphic-simple.test.js:141: // Polymorphic fields are no longer in attributes, they're in relationships
82
- tests/polymorphic-simple.test.js:142: const bookReview = result.data.find(r => r.relationships.reviewable.data.type === 'books')
83
- tests/polymorphic-simple.test.js:143: const authorReview = result.data.find(r => r.relationships.reviewable.data.type === 'authors')
84
- tests/include-depth-validation.test.js:27: // Set up test data with nested relationships
85
- tests/include-depth-validation.test.js:47: relationships: {
86
- tests/include-depth-validation.test.js:59: relationships: {
87
- tests/include-depth-validation.test.js:71: relationships: {
88
- tests/include-depth-validation.test.js:98: // The included array may or may not be present depending on whether relationships exist
89
- tests/include-depth-validation.test.js:105: // Note: The included array might be present even if some relationships don't have data
90
- tests/include-depth-validation.test.js:223: relationships: {
91
- tests/include-depth-validation.test.js:235: relationships: {
92
- tests/include-depth-validation.test.js:288: relationships: {
93
- tests/include-depth-validation.test.js:300: relationships: {
94
- tests/polymorphic-relationships.test.js:78: // we need to GET the record to verify the relationship was saved correctly
95
- tests/polymorphic-relationships.test.js:102: // Polymorphic fields are no longer in attributes, they're in relationships
96
- tests/polymorphic-relationships.test.js:103: assert.equal(review.data.relationships.reviewable.data.type, 'authors')
97
- tests/polymorphic-relationships.test.js:104: assert.equal(review.data.relationships.reviewable.data.id, String(author.data.id))
98
- tests/polymorphic-relationships.test.js:138: // Polymorphic fields are no longer in attributes, they're in relationships
99
- tests/polymorphic-relationships.test.js:139: assert.equal(review.data.relationships.reviewable.data.type, 'publishers')
100
- tests/polymorphic-relationships.test.js:140: assert.equal(review.data.relationships.reviewable.data.id, String(publisher.data.id))
101
- tests/polymorphic-relationships.test.js:144: // Skip this test for now - polymorphic validation happens at relationship level
102
- tests/polymorphic-relationships.test.js:145: // not at the attribute level, so we need to create a proper relationship
103
- tests/polymorphic-relationships.test.js:342: r.relationships.reviewable.data.type === 'books' &&
104
- tests/polymorphic-relationships.test.js:343: String(r.relationships.reviewable.data.id) === String(book.data.id)
105
- tests/relationships.test.js:50: it('should create resource with belongsTo relationship', async () => {
106
- tests/relationships.test.js:62: // Create publisher with country relationship
107
- tests/relationships.test.js:99: it('should update belongsTo relationship via PATCH', async () => {
108
- tests/relationships.test.js:130: relationships: {
109
- tests/relationships.test.js:154: it('should clear belongsTo relationship with null', async () => {
110
- tests/relationships.test.js:172: // Clear the relationship
111
- tests/relationships.test.js:177: relationships: {
112
- tests/relationships.test.js:189: // Verify relationship cleared
113
- tests/relationships.test.js:195: assert(getResult.data.relationships)
114
- tests/relationships.test.js:196: assert.equal(getResult.data.relationships.country.data, null)
115
- tests/relationships.test.js:264: assert(getResult.data.relationships.authors)
116
- tests/relationships.test.js:265: assert.equal(getResult.data.relationships.authors.data.length, 2)
117
- tests/relationships.test.js:274: it('should update many-to-many relationships via PUT (complete replacement)', async () => {
118
- tests/relationships.test.js:324: relationships: {
119
- tests/relationships.test.js:345: // GET to verify new relationships
120
- tests/relationships.test.js:352: const authorIds = getResult.data.relationships.authors.data.map(a => a.id).sort()
121
- tests/relationships.test.js:356: it('should update many-to-many relationships via PATCH (partial update)', async () => {
122
- tests/relationships.test.js:400: relationships: {
123
- tests/relationships.test.js:423: const authorIds = getResult.data.relationships.authors.data.map(a => a.id).sort()
124
- tests/relationships.test.js:432: it('should clear all many-to-many relationships with empty array', async () => {
125
- tests/relationships.test.js:477: // Clear all relationships
126
- tests/relationships.test.js:482: relationships: {
127
- tests/relationships.test.js:505: assert(getResult.data.relationships.authors)
128
- tests/relationships.test.js:506: assert.equal(getResult.data.relationships.authors.data.length, 0)
129
- tests/relationships.test.js:517: it('should create resource with multiple relationship types', async () => {
130
- tests/relationships.test.js:545: // Create book with all relationships
131
- tests/relationships.test.js:576: // Verify all relationships
132
- tests/relationships.test.js:577: assert(getResult.data.relationships.publisher)
133
- tests/relationships.test.js:578: assert(getResult.data.relationships.authors)
134
- tests/relationships.test.js:579: assert(getResult.data.relationships.country)
135
- tests/relationships.test.js:588: // Verify nested relationship (publisher.country)
136
- tests/relationships.test.js:590: assert(publisher.relationships.country)
137
- tests/relationships.test.js:593: it('should handle PUT with partial relationships object', async () => {
138
- tests/relationships.test.js:616: // Create book with all relationships
139
- tests/relationships.test.js:643: // PUT with only publisher relationship (should preserve authors since relationships object is partial)
140
- tests/relationships.test.js:651: relationships: {
141
- tests/relationships.test.js:654: // Note: authors not mentioned, but relationships object is present
142
- tests/relationships.test.js:674: assert.equal(getResult.data.relationships.publisher.data.id, newPublisherResult.data.id)
143
- tests/relationships.test.js:676: // Authors should be cleared (PUT with relationships object clears unmentioned relationships)
144
- tests/relationships.test.js:677: assert(getResult.data.relationships.authors)
145
- tests/relationships.test.js:678: assert.equal(getResult.data.relationships.authors.data.length, 0)
146
- tests/bulk-operations.test.js:134: it('should create records with relationships', async () => {
147
- tests/bulk-operations.test.js:158: assert.equal(publisher.relationships.country.data.id, countryResult.data.id)
148
- tests/bulk-operations.test.js:478: it('should respect relationships when deleting', async () => {
149
- tests/bulk-operations.test.js:479: // Create country and publishers with relationship
150
- tests/bulk-operations.test.js:619: it('should maintain data integrity with relationships', async () => {
151
- tests/bulk-operations.test.js:630: // Create publishers with country relationships
152
- tests/bulk-operations.test.js:648: // Verify relationships were set correctly via API
153
- tests/bulk-operations.test.js:654: assert.equal(usPublisher.relationships.country.data.id, countryIds[0])
154
- tests/query-limits.test.js:63: relationships: {
155
- tests/query-limits.test.js:84: relationships: {
156
- tests/query-limits.test.js:107: relationships: {
157
- tests/query-limits.test.js:140: relationships: {
158
- tests/query-limits.test.js:258: it('should respect explicit limit in relationship config', async () => {
159
- tests/query-limits.test.js:344: relationships: {
160
- tests/query-limits.test.js:362: relationships: {
161
- tests/query-limits.test.js:416: relationships: {
162
- tests/query-limits.test.js:468: relationships: {
163
- tests/query-limits.test.js:491: r.relationships.publisher.data.id === publisher.id
164
- tests/query-limits.test.js:508: it('should apply window limits to many-to-many relationships', async () => {
165
- tests/query-limits.test.js:569: // Check the author's relationships to see which books they have
166
- tests/query-limits.test.js:570: const authorBookIds = author.relationships?.books?.data?.map(b => b.id) || []
167
- tests/query-limits.test.js:578: `Author ${author.id} should have exactly 3 book relationships (configured limit)`)
168
- tests/relationship-endpoints.test.js:29: // Initialize API with the relationships plugin
169
- tests/relationship-endpoints.test.js:97: it('should get empty relationship data for new book', async () => {
170
- tests/relationship-endpoints.test.js:98: const result = await api.resources.books.getRelationship({
171
- tests/relationship-endpoints.test.js:100: relationshipName: 'authors'
172
- tests/relationship-endpoints.test.js:104: assert.equal(result.links.self, `/books/${book1Id}/relationships/authors`)
173
- tests/relationship-endpoints.test.js:110: it('should add authors to book via POST relationship endpoint', async () => {
174
- tests/relationship-endpoints.test.js:111: // Add authors via relationship endpoint
175
- tests/relationship-endpoints.test.js:112: await api.resources.books.postRelationship({
176
- tests/relationship-endpoints.test.js:114: relationshipName: 'authors',
177
- tests/relationship-endpoints.test.js:115: relationshipData: [
178
- tests/relationship-endpoints.test.js:121: // Verify authors were added via getRelationship
179
- tests/relationship-endpoints.test.js:122: const relResult = await api.resources.books.getRelationship({
180
- tests/relationship-endpoints.test.js:124: relationshipName: 'authors'
181
- tests/relationship-endpoints.test.js:146: assert(getResult.data.relationships.authors, 'Should have authors relationship')
182
- tests/relationship-endpoints.test.js:147: assert.equal(getResult.data.relationships.authors.data.length, 2)
183
- tests/relationship-endpoints.test.js:152: await api.resources.books.postRelationship({
184
- tests/relationship-endpoints.test.js:154: relationshipName: 'authors',
185
- tests/relationship-endpoints.test.js:155: relationshipData: [
186
- tests/relationship-endpoints.test.js:162: const result = await api.resources.books.getRelated({
187
- tests/relationship-endpoints.test.js:164: relationshipName: 'authors'
188
- tests/relationship-endpoints.test.js:177: it('should remove specific authors via DELETE relationship endpoint', async () => {
189
- tests/relationship-endpoints.test.js:179: await api.resources.books.postRelationship({
190
- tests/relationship-endpoints.test.js:181: relationshipName: 'authors',
191
- tests/relationship-endpoints.test.js:182: relationshipData: [
192
- tests/relationship-endpoints.test.js:194: await api.resources.books.deleteRelationship({
193
- tests/relationship-endpoints.test.js:196: relationshipName: 'authors',
194
- tests/relationship-endpoints.test.js:197: relationshipData: [
195
- tests/relationship-endpoints.test.js:203: const relResult = await api.resources.books.getRelationship({
196
- tests/relationship-endpoints.test.js:205: relationshipName: 'authors'
197
- tests/relationship-endpoints.test.js:217: it('should handle errors when relationship does not exist', async () => {
198
- tests/relationship-endpoints.test.js:219: api.resources.books.getRelationship({
199
- tests/relationship-endpoints.test.js:221: relationshipName: 'nonexistent'
200
- tests/relationship-endpoints.test.js:229: it('should handle errors when posting to belongsTo relationship', async () => {
201
- tests/relationship-endpoints.test.js:231: api.resources.books.postRelationship({
202
- tests/relationship-endpoints.test.js:233: relationshipName: 'country',
203
- tests/relationship-endpoints.test.js:234: relationshipData: [
204
- tests/relationship-endpoints.test.js:239: message: /Cannot POST to to-one relationship/
205
- tests/relationship-endpoints.test.js:244: it('should work with inverse relationship (authors to books)', async () => {
206
- tests/relationship-endpoints.test.js:245: // First add the relationship from book side
207
- tests/relationship-endpoints.test.js:246: await api.resources.books.postRelationship({
208
- tests/relationship-endpoints.test.js:248: relationshipName: 'authors',
209
- tests/relationship-endpoints.test.js:249: relationshipData: [
210
- tests/relationship-endpoints.test.js:255: const relResult = await api.resources.authors.getRelationship({
211
- tests/relationship-endpoints.test.js:257: relationshipName: 'books'
212
- tests/relationship-endpoints.test.js:264: const booksResult = await api.resources.authors.getRelated({
213
- tests/relationship-endpoints.test.js:266: relationshipName: 'books'
214
- tests/relationship-endpoints.test.js:333: it('should get one-to-many relationship data', async () => {
215
- tests/relationship-endpoints.test.js:334: const result = await api.resources.publishers.getRelationship({
216
- tests/relationship-endpoints.test.js:336: relationshipName: 'books'
217
- tests/relationship-endpoints.test.js:340: assert.equal(result.links.self, `/publishers/${publisherId}/relationships/books`)
218
- tests/relationship-endpoints.test.js:347: const result = await api.resources.publishers.getRelated({
219
- tests/relationship-endpoints.test.js:349: relationshipName: 'books'
220
- tests/relationship-endpoints.test.js:358: // Note: belongsTo relationships (like 'publisher') are not accessible via relationship endpoints
221
- tests/relationship-endpoints.test.js:359: // They are foreign key fields, not true JSON:API relationships
222
- tests/TEST_TEMPLATE.test.js:56: * - Handle relationships correctly
223
- tests/pagination-enhanced.test.js:493: const countryIds = result.data.map(b => b.relationships.country.data.id)
@@ -1,10 +0,0 @@
1
- tests/pagination-cursor-multifield.test.js:58: it.skip('should handle cursor pagination with multi-field sorting without skipping records', async () => {
2
- tests/pagination-cursor-multifield.test.js:105: it.skip('should handle DESC sorting with duplicates correctly', async () => {
3
- tests/pagination-cursor-multifield.test.js:192: it.skip('should handle cursor pagination with numeric and text fields', async () => {
4
- tests/pagination-cursor-multifield.test.js:225: it.skip('should generate correct cursor values for multi-field sorting', async () => {
5
- tests/pagination-cursor-multifield.test.js:247: it.skip('should handle page[before] with multi-field sorting', async () => {
6
- tests/pagination-cursor-multifield.test.js:295: it.skip('should handle all records having the same value in first sort field', async () => {
7
- tests/pagination-cursor-multifield.test.js:351: it.skip('should handle empty results with multi-field cursor', async () => {
8
- tests/pagination-cursor-multifield.test.js:378: it.skip('should handle special characters in multi-field cursors', async () => {
9
- tests/pagination-cursor-multifield.test.js:421: it.skip('should maintain stable sorting with custom id property', async () => {
10
- tests/pagination-cursor-multifield.test.js:467: it.skip('should handle the exact bug scenario - multiple fruits with same category', async () => {
@@ -1,30 +0,0 @@
1
- /tests/TEST_TEMPLATE.test.js
2
- /tests/bulk-operations.test.js
3
- /tests/computed-fields.test.js
4
- /tests/cors.test.js
5
- /tests/curl.test.js
6
- /tests/custom-idproperty-relationships.test.js
7
- /tests/field-getters.test.js
8
- /tests/field-setters.test.js
9
- /tests/include-depth-validation.test.js
10
- /tests/includes.test.js
11
- /tests/multihome.test.js
12
- /tests/nested-includes.test.js
13
- /tests/ownership-optout.test.js
14
- /tests/pagination-cursor-multifield.test.js
15
- /tests/pagination-enhanced.test.js
16
- /tests/polymorphic-relationships.test.js
17
- /tests/polymorphic-simple.test.js
18
- /tests/positioning-advanced.test.js
19
- /tests/positioning-extended.test.js
20
- /tests/positioning-multifilter.test.js
21
- /tests/positioning.test.js
22
- /tests/queries.test.js
23
- /tests/query-limits.test.js
24
- /tests/relationship-endpoints.test.js
25
- /tests/relationships.test.js
26
- /tests/rest-api-access.test.js
27
- /tests/rest-api.test.js
28
- /tests/searchschema-merge.test.js
29
- /tests/socketio.test.js
30
- /tests/virtual-fields.test.js
@@ -1,32 +0,0 @@
1
- /tests/TEST_TEMPLATE.test.js
2
- /tests/anyapi-basic.test.js
3
- /tests/anyapi-cursor-pagination.test.js
4
- /tests/bulk-operations.test.js
5
- /tests/computed-fields.test.js
6
- /tests/cors.test.js
7
- /tests/curl.test.js
8
- /tests/custom-idproperty-relationships.test.js
9
- /tests/field-getters.test.js
10
- /tests/field-setters.test.js
11
- /tests/include-depth-validation.test.js
12
- /tests/includes.test.js
13
- /tests/multihome.test.js
14
- /tests/nested-includes.test.js
15
- /tests/ownership-optout.test.js
16
- /tests/pagination-cursor-multifield.test.js
17
- /tests/pagination-enhanced.test.js
18
- /tests/polymorphic-relationships.test.js
19
- /tests/polymorphic-simple.test.js
20
- /tests/positioning-advanced.test.js
21
- /tests/positioning-extended.test.js
22
- /tests/positioning-multifilter.test.js
23
- /tests/positioning.test.js
24
- /tests/queries.test.js
25
- /tests/query-limits.test.js
26
- /tests/relationship-endpoints.test.js
27
- /tests/relationships.test.js
28
- /tests/rest-api-access.test.js
29
- /tests/rest-api.test.js
30
- /tests/searchschema-merge.test.js
31
- /tests/socketio.test.js
32
- /tests/virtual-fields.test.js
@@ -1,49 +0,0 @@
1
- # Subsystem: docs-drift (Pass 1)
2
-
3
- ## Scope
4
- - User-facing docs vs observed implementation behavior (both repos).
5
-
6
- ## Purpose
7
- - Detect mismatches between claimed and actual behavior for critical features.
8
-
9
- ## Findings
10
- - D-001:
11
- - [Verified][C5] Internal docs/comments in `payload-validators` describe POST `included` validation support, but write orchestration rejects any `included` array for POST/PUT/PATCH.
12
- - Evidence: `plugins/core/lib/querying-writing/payload-validators.js:658-735` vs `plugins/core/rest-api-plugin-methods/common.js:171-176`.
13
- - D-002:
14
- - [Inferred][C3] Public docs claim broad/full JSON:API compliance; pass-1 code review has at least one envelope inconsistency in CORS blocked-origin response (`{ error: ... }` instead of `errors[]`).
15
- - Evidence: `README.md:9`, `docs/COMPARISON.md:14`, `plugins/core/rest-api-cors-plugin.js:112-117`.
16
- - D-003:
17
- - [Inferred][C3] Pagination documentation examples show clean links, but implementation-level query-link construction may emit duplicated delimiters in some permutations (seen in docs examples with `&&`; runtime confirmation pending).
18
- - Evidence: `docs/GUIDE/GUIDE_2_7_Pagination_And_Ordering.md:972-975`, `1018-1021`, `1220-1223`, and query string assembly at `plugins/core/rest-api-knex-plugin.js:742-773`.
19
-
20
- ## Strengths
21
- - [Verified][C4] Documentation breadth is high and includes operational examples for most major features.
22
- - [Verified][C4] `json-rest-schema` docs align with current module boundaries (runtime validation focus, no migration helper in core).
23
-
24
- ## Risks
25
- - R-DOCS-001:
26
- - [Verified][C5] Contradictory guidance around `included` in write payloads can mislead adopters.
27
- - R-DOCS-002:
28
- - [Inferred][C3] Strong compliance claims without caveats can create expectation risk where edge semantics diverge.
29
-
30
- ## Missing tests/docs actions
31
- - [Inferred][C4] Add docs contract test snippets (or executable examples) for write payload constraints and error envelope contract.
32
- - [Inferred][C3] Normalize CORS blocked-origin response to JSON:API `errors[]` or document exception explicitly.
33
-
34
- ## Explicit unknowns
35
- - [Unknown][C2] Extent of additional drift across long-form guide sections not yet fully line-mapped in pass-1.
36
-
37
- ## Pass-1 confidence
38
- - Overall: **C4** for identified drifts; **C2** for full corpus completeness.
39
-
40
- ## Evidence links
41
- - `audit/evidence/docs/docs-claims-signals.txt`
42
- - `plugins/core/rest-api-plugin-methods/common.js`
43
- - `plugins/core/lib/querying-writing/payload-validators.js`
44
- - `plugins/core/rest-api-cors-plugin.js`
45
- - `/home/merc/Development/current/json-rest-schema/README.md`
46
-
47
- ## Pass-2 cross-review status
48
- - Reconciled in [pass2-cross-review.md](/home/merc/Development/current/json-rest-api/audit/subsystems/pass2-cross-review.md).
49
- - Final assertion/confidence values in this report are considered pass-2 normalized.
@@ -1,131 +0,0 @@
1
- # Subsystems Cross-Review (Pass 2)
2
-
3
- Perspective: challenge-first review focused on contradictory evidence, runtime corroboration, and severity normalization.
4
- Scope: non-anyapi only.
5
-
6
- ## schema-core
7
- - Validated:
8
- - [Verified][C4] Schema compile pipeline remains central source-of-truth (`compileSchemas` + `Schema.validate`).
9
- - Challenged:
10
- - [Inferred][C3] Global registry mutation risk severity reduced to medium (no runtime failure observed in baseline tests).
11
- - Reconciliation:
12
- - Keep risk as medium-operational, not correctness-critical.
13
-
14
- ## rest-orchestration
15
- - Validated:
16
- - [Verified][C5] Permission-before-write ordering confirmed in code path and passing CRUD tests.
17
- - [Verified][C5] `patch-relationship` catch defect runtime-confirmed via probe (`ReferenceError`).
18
- - Challenged:
19
- - None; findings strengthened by runtime probe.
20
- - Reconciliation:
21
- - Elevate `patch-relationship` defect to high severity with C5 confidence.
22
-
23
- ## transport-express
24
- - Validated:
25
- - [Verified][C4] Canonical error mapping for known rest-api error codes.
26
- - Challenged:
27
- - [Inferred][C3] Unknown-error leakage remains moderate risk; no direct exploit scenario found in baseline tests.
28
- - Reconciliation:
29
- - Keep medium severity; recommend sanitization policy test.
30
-
31
- ## storage-knex
32
- - Validated:
33
- - [Verified][C4] Method layer calls storage helpers consistently.
34
- - Challenged:
35
- - TOCTOU/concurrency concerns remain inferred; no direct failure evidence in current suite.
36
- - Reconciliation:
37
- - Keep as medium/partial invariant impact, pending concurrency probes.
38
-
39
- ## query-engine
40
- - Validated:
41
- - [Verified][C4] Include and nested include functional tests pass.
42
- - Challenged:
43
- - N+1/perf cliff claim remains inferred due missing query-count assertions.
44
- - Reconciliation:
45
- - Keep performance risk medium with lower confidence.
46
-
47
- ## relationships
48
- - Validated:
49
- - [Verified][C5] POST/DELETE relationship endpoint paths are covered and passing.
50
- - [Verified][C5] PATCH relationship endpoint failure-path defect confirmed at runtime.
51
- - Challenged:
52
- - Success semantics of `patchRelationship` endpoint remain under-tested.
53
- - Reconciliation:
54
- - Mark partial coverage; add explicit patch endpoint success and rollback tests.
55
-
56
- ## plugins-access
57
- - Validated:
58
- - [Verified][C4] Ownership filters and permission gating covered by tests.
59
- - Challenged:
60
- - Mixed error typing impact not shown to break core suite behavior.
61
- - Reconciliation:
62
- - Keep medium-low severity consistency risk.
63
-
64
- ## plugins-cors
65
- - Validated:
66
- - [Verified][C4] CORS behaviors and preflight handling covered by tests.
67
- - Challenged:
68
- - JSON:API envelope mismatch on blocked origin remains code-verified; direct assertion missing in tests.
69
- - Reconciliation:
70
- - Keep medium severity docs/contract consistency issue.
71
-
72
- ## plugins-file
73
- - Validated:
74
- - [Verified][C3] Schema-driven detection and validation pipeline present.
75
- - Challenged:
76
- - Orphaned-file rollback concern remains inferred (no dedicated failure-path test run).
77
- - Reconciliation:
78
- - Keep as medium operational risk with lower confidence.
79
-
80
- ## plugins-positioning
81
- - Validated:
82
- - [Verified][C5] Runtime suite currently fails 2 tests in multifilter edge cases.
83
- - Challenged:
84
- - Failure severity constrained to plugin semantics; core CRUD invariants unaffected.
85
- - Reconciliation:
86
- - Keep high-priority plugin correctness fix (medium-high severity).
87
-
88
- ## plugins-multihome
89
- - Validated:
90
- - [Verified][C4] Multi-tenant extraction and filter enforcement code + tests align.
91
- - Challenged:
92
- - Bypass resistance across every alternate path remains partial (not exhaustively tested).
93
- - Reconciliation:
94
- - Keep invariant as partial/pass with medium confidence.
95
-
96
- ## plugins-socketio
97
- - Validated:
98
- - [Verified][C4] Transaction-safety tests pass for success/failure notification behavior.
99
- - Challenged:
100
- - High-load/backpressure concerns remain unknown.
101
- - Reconciliation:
102
- - Keep as medium operational unknown.
103
-
104
- ## plugins-bulk
105
- - Validated:
106
- - [Verified][C4] Bulk atomic/non-atomic behavior covered in tests.
107
- - Challenged:
108
- - Optimization hook dead-path risk remains inferred; no direct runtime trigger found.
109
- - Reconciliation:
110
- - Keep as medium maintainability/performance risk.
111
-
112
- ## tests
113
- - Validated:
114
- - [Verified][C5] broad suite coverage, with explicit failing/skip signals captured.
115
- - Challenged:
116
- - Invariant-to-test mapping completeness still incomplete for performance/error-envelope edges.
117
- - Reconciliation:
118
- - Keep test quality as partial.
119
-
120
- ## docs-drift
121
- - Validated:
122
- - [Verified][C4] write `included` claim mismatch remains corroborated (code + docs mismatch).
123
- - Challenged:
124
- - Additional docs drift breadth remains partial until broader executable doc checks exist.
125
- - Reconciliation:
126
- - Maintain medium severity documentation reliability risk.
127
-
128
- ## Unresolved runtime validation queue
129
- - Query-count budget assertions for deep includes.
130
- - File-upload success + downstream DB failure compensation path.
131
- - Full bypass attempt matrix across multihome + relationship endpoints + includes.
@@ -1,51 +0,0 @@
1
- # Subsystem: plugins-access (Pass 1)
2
-
3
- ## Scope
4
- - Ownership/auth enforcement and query filtering plugin.
5
-
6
- ## Purpose
7
- - Enforce auth rules (`public/authenticated/owns` + custom checkers), auto-attach ownership fields, and constrain query visibility.
8
-
9
- ## Key entry points
10
- - `plugins/core/rest-api-access.js`
11
-
12
- ## Core data flow
13
- - Walkthrough (ownership-filtered query):
14
- - [Verified][C5] `knexQueryFiltering` hook appends owner filter when ownership is enabled and user is non-admin. Evidence: `rest-api-access.js:249-289`.
15
- - [Verified][C4] `checkPermissions` evaluates configured rules and fails with 403 when no checker passes. Evidence: `rest-api-access.js:291-341`.
16
-
17
- ## Hook/control flow
18
- - [Verified][C4] Auto-owner assignment occurs on `beforeProcessingPost/Patch/Put`, before schema validation/storage calls. Evidence: `rest-api-access.js:239-247`, `196-237`.
19
- - [Verified][C4] Separate ownership mismatch path converts single-resource unauthorized access into `Resource not found` to reduce disclosure. Evidence: `rest-api-access.js:343-383`.
20
-
21
- ## Failure modes
22
- - [Inferred][C3] Some helper paths throw generic `Error` with `statusCode` instead of typed REST errors; transport mapping consistency depends on connector handling. Evidence: `rest-api-access.js:333-337`, `390-425`.
23
-
24
- ## Strengths
25
- - [Verified][C5] Supports scope-level opt-out (`ownership:false`, `ownerField:false/null`) and admin bypass.
26
- - [Verified][C4] Adapter-aware filter translation reduces coupling to physical column naming.
27
-
28
- ## Risks
29
- - R-ACCESS-001:
30
- - [Inferred][C3] Mixed error typing can produce inconsistent envelopes in non-standard transports.
31
- - R-ACCESS-002:
32
- - [Unknown][C2] Complex custom checker chains may become hard to reason about without tracing/audit logs.
33
-
34
- ## Missing tests
35
- - [Inferred][C3] Add tests for mixed rule chains where checker throws vs returns false across all methods.
36
-
37
- ## Explicit unknowns
38
- - [Unknown][C2] Operational behavior when custom checkers perform async external calls under high latency.
39
-
40
- ## Pass-1 confidence
41
- - Overall: **C4**.
42
-
43
- ## Evidence links
44
- - `plugins/core/rest-api-access.js`
45
- - `tests/rest-api-access.test.js`
46
- - `tests/ownership-optout.test.js`
47
- - `audit/evidence/tests/access-multitenancy-test-signals.txt`
48
-
49
- ## Pass-2 cross-review status
50
- - Reconciled in [pass2-cross-review.md](/home/merc/Development/current/json-rest-api/audit/subsystems/pass2-cross-review.md).
51
- - Final assertion/confidence values in this report are considered pass-2 normalized.
@@ -1,50 +0,0 @@
1
- # Subsystem: plugins-bulk (Pass 1)
2
-
3
- ## Scope
4
- - Bulk operation plugin (`bulkPost`, `bulkPatch`, `bulkDelete`) and route registration.
5
-
6
- ## Purpose
7
- - Batch many create/update/delete operations with optional atomic transaction semantics.
8
-
9
- ## Key entry points
10
- - `plugins/core/bulk-operations-plugin.js`
11
-
12
- ## Core data flow
13
- - Walkthrough (atomic bulk POST):
14
- - [Verified][C4] Validates input size, optionally opens transaction, loops records and delegates to `scope.post`, then commits or rolls back. Evidence: `bulk-operations-plugin.js:19-122`.
15
-
16
- ## Hook/control flow
17
- - [Verified][C3] Plugin registers `beforeBulkPost` optimized hook path, but pass-1 static review found no invocation of `runHooks('beforeBulkPost')` in `bulkPost` flow.
18
- - Evidence: `bulk-operations-plugin.js:19-122`, `418-476`.
19
-
20
- ## Failure modes
21
- - [Verified][C4] Non-atomic mode can produce partial success responses with aggregated errors by design. Evidence: `bulk-operations-plugin.js:84-114`, `217-244`, `310-337`.
22
- - [Inferred][C4] Optimized path appears dead code unless another subsystem triggers `beforeBulkPost`; current file does not.
23
-
24
- ## Strengths
25
- - [Verified][C4] Clear atomic vs non-atomic contract and per-item error reporting.
26
- - [Verified][C4] Reuses existing scope methods, preserving most validation/permission semantics.
27
-
28
- ## Risks
29
- - R-BULK-001:
30
- - [Verified][C4] Potential dead optimization hook path (`beforeBulkPost`) not invoked in visible flow.
31
- - R-BULK-002:
32
- - [Inferred][C3] Large batch runtime cost due to per-record delegation may be high without optimization.
33
-
34
- ## Missing tests
35
- - [Inferred][C3] Add explicit test proving whether `beforeBulkPost` optimization path can execute.
36
- - [Unknown][C2] Add throughput tests for max-batch boundaries and mixed-failure rollback behavior under load.
37
-
38
- ## Explicit unknowns
39
- - [Unknown][C2] Whether external hook framework auto-invokes `beforeBulkPost` for scope methods without explicit calls.
40
-
41
- ## Pass-1 confidence
42
- - Overall: **C3-C4**.
43
-
44
- ## Evidence links
45
- - `plugins/core/bulk-operations-plugin.js`
46
- - `tests/bulk-operations.test.js`
47
-
48
- ## Pass-2 cross-review status
49
- - Reconciled in [pass2-cross-review.md](/home/merc/Development/current/json-rest-api/audit/subsystems/pass2-cross-review.md).
50
- - Final assertion/confidence values in this report are considered pass-2 normalized.
@@ -1,48 +0,0 @@
1
- # Subsystem: plugins-cors (Pass 1)
2
-
3
- ## Scope
4
- - CORS policy plugin and transport response header integration.
5
-
6
- ## Purpose
7
- - Provide cross-origin policy controls with wildcard OPTIONS routing and response header injection.
8
-
9
- ## Key entry points
10
- - `plugins/core/rest-api-cors-plugin.js`
11
-
12
- ## Core data flow
13
- - Walkthrough (preflight):
14
- - [Verified][C5] Plugin registers `OPTIONS` route on transport match-all path and returns CORS headers + 204/403 depending on origin policy. Evidence: `rest-api-cors-plugin.js:79-127`.
15
- - [Verified][C4] Non-OPTIONS responses are decorated through `transport:response` hook. Evidence: `rest-api-cors-plugin.js:129-178`.
16
-
17
- ## Hook/control flow
18
- - [Verified][C4] Requires transport plugin presence (`vars.transport`) and integrates via hooks rather than connector-specific code paths.
19
-
20
- ## Failure modes
21
- - [Verified][C4] 403 response for blocked origin returns `{ error: 'CORS origin not allowed' }`, not JSON:API `errors[]`, causing envelope inconsistency at least for this path. Evidence: `rest-api-cors-plugin.js:112-117`.
22
-
23
- ## Strengths
24
- - [Verified][C4] Supports string/regex/array/function origin policies.
25
- - [Verified][C4] Correctly applies `Vary: Origin` when echoing origin.
26
-
27
- ## Risks
28
- - R-CORS-001:
29
- - [Verified][C4] Preflight rejection envelope shape differs from core transport error contract.
30
- - R-CORS-002:
31
- - [Inferred][C3] Defaults (`credentials: true`, `origin: '*'`) require careful runtime pairing to avoid invalid browser semantics if misconfigured with wildcard behavior.
32
-
33
- ## Missing tests
34
- - [Inferred][C3] Add explicit envelope consistency assertion for blocked origin path.
35
-
36
- ## Explicit unknowns
37
- - [Unknown][C2] Behavior with custom transport plugins beyond Express not runtime-checked in this audit pass.
38
-
39
- ## Pass-1 confidence
40
- - Overall: **C4**.
41
-
42
- ## Evidence links
43
- - `plugins/core/rest-api-cors-plugin.js`
44
- - `tests/cors.test.js`
45
-
46
- ## Pass-2 cross-review status
47
- - Reconciled in [pass2-cross-review.md](/home/merc/Development/current/json-rest-api/audit/subsystems/pass2-cross-review.md).
48
- - Final assertion/confidence values in this report are considered pass-2 normalized.