json-rest-api 1.0.20 → 1.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/audit/00-charter.md +103 -0
- package/audit/01-scope-map.md +84 -0
- package/audit/02-coverage-matrix.csv +174 -0
- package/audit/03-invariants.md +123 -0
- package/audit/04-standards-rubric.md +56 -0
- package/audit/05-competitor-rubric.md +77 -0
- package/audit/06-findings.md +160 -0
- package/audit/07-risk-register.csv +10 -0
- package/audit/08-remediation-roadmap.md +177 -0
- package/audit/09-signoff-check.md +23 -0
- package/audit/10-final-synthesis.md +29 -0
- package/audit/evidence/code/all-files-json-rest-api.txt +168 -0
- package/audit/evidence/code/all-files-json-rest-schema.txt +12 -0
- package/audit/evidence/code/boundary-leak-checks.txt +72 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__bulk-operations-plugin.js.txt +480 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__connectors__express-plugin.js.txt +532 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__connectors__lib__busboy-detector.js.txt +175 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__connectors__lib__formidable-detector.js.txt +138 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__connectors__lib__request-helpers.js.txt +222 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__file-handling-plugin.js.txt +342 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__dbTablesOperations.js.txt +304 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__fractional-positioning.js.txt +188 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying-writing__compile-schemas.js.txt +336 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying-writing__connectors-query-parser.js.txt +165 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying-writing__database-capabilities.js.txt +265 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying-writing__database-value-normalizers.js.txt +369 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying-writing__default-data-helpers.js.txt +72 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying-writing__field-utils.js.txt +139 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying-writing__knex-constants.js.txt +45 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying-writing__knex-field-helpers.js.txt +396 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying-writing__knex-json-api-transformers.js.txt +162 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying-writing__payload-validators.js.txt +1314 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying-writing__schema-helpers.js.txt +488 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying-writing__scope-validations.js.txt +484 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying-writing__simplified-helpers.js.txt +857 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying__knex-cross-table-search.js.txt +565 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying__knex-json-api-transformers-querying.js.txt +485 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying__knex-pagination-helpers.js.txt +560 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying__knex-process-includes.js.txt +167 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying__knex-query-helpers-base.js.txt +109 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying__knex-query-helpers.js.txt +1064 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying__knex-relationship-includes.js.txt +1983 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying__knex-window-queries.js.txt +328 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__querying__url-helpers.js.txt +119 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__storage__storage-adapter.js.txt +160 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__writing__many-to-many-manipulations.js.txt +300 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__lib__writing__relationship-processor.js.txt +245 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-access.js.txt +459 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-cors-plugin.js.txt +237 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-knex-plugin.js.txt +1135 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-multihome-plugin.js.txt +314 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-hooks__compile-resource-schemas.js.txt +7 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-hooks__register-relationship-routes.js.txt +71 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-hooks__register-scope-routes.js.txt +102 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-hooks__turn-scope-init-into-vars.js.txt +49 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-hooks__validate-include-configurations.js.txt +39 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__add-route.js.txt +23 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__check-permissions.js.txt +13 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__common.js.txt +639 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__delete-relationship.js.txt +117 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__delete.js.txt +104 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__enrich-attributes.js.txt +199 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__get-related.js.txt +353 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__get-relationship.js.txt +61 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__get.js.txt +184 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__patch-relationship.js.txt +55 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__patch.js.txt +191 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__post-relationship.js.txt +110 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__post.js.txt +168 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__put.js.txt +253 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__query.js.txt +207 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin-methods__release.js.txt +12 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-plugin.js.txt +165 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__rest-api-positioning-plugin.js.txt +668 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__core__socketio-plugin.js.txt +621 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__storage__local-storage.js.txt +218 -0
- package/audit/evidence/code/critical-pass1/json-rest-api__plugins__storage__s3-storage.js.txt +124 -0
- package/audit/evidence/code/critical-pass1/json-rest-schema__src__CorePlugin.js.txt +269 -0
- package/audit/evidence/code/critical-pass1/json-rest-schema__src__Schema.js.txt +242 -0
- package/audit/evidence/code/critical-pass1/json-rest-schema__src__index.js.txt +77 -0
- package/audit/evidence/code/critical-pass1-risk-keywords.txt +238 -0
- package/audit/evidence/code/critical-pass1-summary.csv +67 -0
- package/audit/evidence/code/critical-pass2-summary.csv +67 -0
- package/audit/evidence/code/early-silent-zones-no-test-token.txt +57 -0
- package/audit/evidence/code/error-model-signals.txt +98 -0
- package/audit/evidence/code/git-files-json-rest-api.txt +171 -0
- package/audit/evidence/code/git-files-json-rest-schema.txt +27 -0
- package/audit/evidence/code/hook-flow-signals.txt +282 -0
- package/audit/evidence/code/idproperty-signals.txt +157 -0
- package/audit/evidence/code/import-cycles-non-anyapi.txt +3 -0
- package/audit/evidence/code/import-hotspots-non-anyapi.txt +96 -0
- package/audit/evidence/code/imports-json-rest-api.txt +354 -0
- package/audit/evidence/code/imports-json-rest-schema.txt +15 -0
- package/audit/evidence/code/in-scope-files-json-rest-api.txt +160 -0
- package/audit/evidence/code/in-scope-files-json-rest-schema.txt +13 -0
- package/audit/evidence/code/non-anyapi-core-files.txt +101 -0
- package/audit/evidence/code/permission-signals.txt +193 -0
- package/audit/evidence/code/query-include-signals.txt +687 -0
- package/audit/evidence/code/transaction-signals.txt +28 -0
- package/audit/evidence/code/validation-signals.txt +650 -0
- package/audit/evidence/code/write-path-signals.txt +61 -0
- package/audit/evidence/docs/docs-claims-signals.txt +1075 -0
- package/audit/evidence/docs/schema-docs-claims-signals.txt +179 -0
- package/audit/evidence/external/corpus-freeze.md +21 -0
- package/audit/evidence/external/npm-competitor-metadata.txt +70 -0
- package/audit/evidence/external/npm-download-signals.txt +23 -0
- package/audit/evidence/external/npm-jsonapi-server.txt +8 -0
- package/audit/evidence/external/npm-modern-jsonapi-metadata.txt +38 -0
- package/audit/evidence/external/readme-fortune-signals.txt +26 -0
- package/audit/evidence/external/readme-fortune.md +165 -0
- package/audit/evidence/external/readme-json-api-serializer-signals.txt +80 -0
- package/audit/evidence/external/readme-json-api-serializer.md +690 -0
- package/audit/evidence/external/readme-jsonapi-serde-server-signals.txt +0 -0
- package/audit/evidence/external/readme-jsonapi-serde-server.md +22 -0
- package/audit/evidence/external/readme-jsonapi-serializer-signals.txt +63 -0
- package/audit/evidence/external/readme-jsonapi-serializer.md +315 -0
- package/audit/evidence/external/readme-jsonapi-server-signals.txt +19 -0
- package/audit/evidence/external/readme-jsonapi-server.md +104 -0
- package/audit/evidence/external/readme-nestjs-json-api-signals.txt +4 -0
- package/audit/evidence/external/readme-nestjs-json-api.md +94 -0
- package/audit/evidence/external/readme-yaser-json-api-nestjs-signals.txt +47 -0
- package/audit/evidence/external/readme-yaser-json-api-nestjs.md +447 -0
- package/audit/evidence/external/standard-jsonapi-snippets.txt +84 -0
- package/audit/evidence/external/standard-rfc-snippets.txt +168 -0
- package/audit/evidence/external/standards-sources.txt +6 -0
- package/audit/evidence/runtime/baseline-commits.txt +2 -0
- package/audit/evidence/runtime/db-adapter-assumptions.txt +3 -0
- package/audit/evidence/runtime/environment.txt +4 -0
- package/audit/evidence/runtime/invariant-runtime-mapping.md +38 -0
- package/audit/evidence/runtime/probe-patch-relationship-error.exitcode +1 -0
- package/audit/evidence/runtime/probe-patch-relationship-error.log +76 -0
- package/audit/evidence/runtime/probe-patch-relationship-error.mjs +67 -0
- package/audit/evidence/runtime/probe-patch-relationship-referenceerror.exitcode +1 -0
- package/audit/evidence/runtime/probe-patch-relationship-referenceerror.log +62 -0
- package/audit/evidence/runtime/probe-patch-relationship-referenceerror.mjs +47 -0
- package/audit/evidence/runtime/test-exitcodes.txt +4 -0
- package/audit/evidence/runtime/test-summary.md +107 -0
- package/audit/evidence/runtime/trace-anchors.txt +61 -0
- package/audit/evidence/tests/access-multitenancy-test-signals.txt +125 -0
- package/audit/evidence/tests/failing-tests-summary.txt +25 -0
- package/audit/evidence/tests/npm-test-json-rest-api.exitcode +1 -0
- package/audit/evidence/tests/npm-test-json-rest-api.log +5885 -0
- package/audit/evidence/tests/npm-test-json-rest-schema.exitcode +1 -0
- package/audit/evidence/tests/npm-test-json-rest-schema.log +356 -0
- package/audit/evidence/tests/query-include-test-signals.txt +948 -0
- package/audit/evidence/tests/relationship-test-signals.txt +223 -0
- package/audit/evidence/tests/skipped-tests.txt +10 -0
- package/audit/evidence/tests/test-suite-list-non-anyapi.txt +30 -0
- package/audit/evidence/tests/test-suite-list.txt +32 -0
- package/audit/subsystems/docs-drift.md +49 -0
- package/audit/subsystems/pass2-cross-review.md +131 -0
- package/audit/subsystems/plugins-access.md +51 -0
- package/audit/subsystems/plugins-bulk.md +50 -0
- package/audit/subsystems/plugins-cors.md +48 -0
- package/audit/subsystems/plugins-file.md +53 -0
- package/audit/subsystems/plugins-multihome.md +50 -0
- package/audit/subsystems/plugins-positioning.md +54 -0
- package/audit/subsystems/plugins-socketio.md +50 -0
- package/audit/subsystems/query-engine.md +61 -0
- package/audit/subsystems/relationships.md +55 -0
- package/audit/subsystems/rest-orchestration.md +66 -0
- package/audit/subsystems/schema-core.md +64 -0
- package/audit/subsystems/storage-knex.md +57 -0
- package/audit/subsystems/tests.md +48 -0
- package/audit/subsystems/transport-express.md +55 -0
- package/audit/traces/trace-read-get.md +22 -0
- package/audit/traces/trace-read-query.md +25 -0
- package/audit/traces/trace-relationship-endpoints.md +31 -0
- package/audit/traces/trace-write-delete.md +17 -0
- package/audit/traces/trace-write-patch.md +26 -0
- package/audit/traces/trace-write-post.md +22 -0
- package/audit/traces/trace-write-put.md +23 -0
- package/package.json +5 -5
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Trace: Read Query
|
|
2
|
+
|
|
3
|
+
## Scope
|
|
4
|
+
- Non-anyapi path only.
|
|
5
|
+
|
|
6
|
+
## Scenario
|
|
7
|
+
- Query collection of resources (`books.query`) with JSON:API envelope.
|
|
8
|
+
|
|
9
|
+
## Input shape
|
|
10
|
+
- Method call: `api.resources.books.query({ queryParams, simplified: false })`
|
|
11
|
+
|
|
12
|
+
## Call path
|
|
13
|
+
1. `register-scope-routes` binds `GET /:scope` to `scope.query` ([plugins/core/rest-api-plugin-hooks/register-scope-routes.js](/home/merc/Development/current/json-rest-api/plugins/core/rest-api-plugin-hooks/register-scope-routes.js)).
|
|
14
|
+
2. `query.js` validates query params then runs `scope.checkPermissions` before storage ([query.js](/home/merc/Development/current/json-rest-api/plugins/core/rest-api-plugin-methods/query.js)).
|
|
15
|
+
3. `helpers.dataQuery` builds SQL + include/pagination transforms in knex plugin ([rest-api-knex-plugin.js](/home/merc/Development/current/json-rest-api/plugins/core/rest-api-knex-plugin.js)).
|
|
16
|
+
4. JSON:API response assembly flows through query transformers and field helpers ([plugins/core/lib/querying/knex-json-api-transformers-querying.js](/home/merc/Development/current/json-rest-api/plugins/core/lib/querying/knex-json-api-transformers-querying.js)).
|
|
17
|
+
|
|
18
|
+
## Runtime evidence
|
|
19
|
+
- `npm test` confirms collection query path in CRUD suite:
|
|
20
|
+
- `ok 3 - should retrieve collection of resources` at `audit/evidence/tests/npm-test-json-rest-api.log:5490`
|
|
21
|
+
- suite pass marker `ok 2 - GET - Retrieve Resources` at `...:5495`
|
|
22
|
+
|
|
23
|
+
## Result
|
|
24
|
+
- [Verified][C4] Standard read-query path executes successfully in regression suite.
|
|
25
|
+
- [Unknown][C2] Query-count bound (N+1 avoidance budget) is not asserted by runtime tests.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Trace: Relationship Endpoints
|
|
2
|
+
|
|
3
|
+
## Scope
|
|
4
|
+
- Non-anyapi path only.
|
|
5
|
+
|
|
6
|
+
## Scenarios
|
|
7
|
+
1. Add to-many members: `postRelationship`
|
|
8
|
+
2. Remove to-many members: `deleteRelationship`
|
|
9
|
+
3. Replace relationship via patch endpoint: `patchRelationship` error-path probe
|
|
10
|
+
|
|
11
|
+
## Call path
|
|
12
|
+
- Entry points in relationship method files:
|
|
13
|
+
- [post-relationship.js](/home/merc/Development/current/json-rest-api/plugins/core/rest-api-plugin-methods/post-relationship.js)
|
|
14
|
+
- [delete-relationship.js](/home/merc/Development/current/json-rest-api/plugins/core/rest-api-plugin-methods/delete-relationship.js)
|
|
15
|
+
- [patch-relationship.js](/home/merc/Development/current/json-rest-api/plugins/core/rest-api-plugin-methods/patch-relationship.js)
|
|
16
|
+
- Core relationship mutation helpers:
|
|
17
|
+
- [relationship-processor.js](/home/merc/Development/current/json-rest-api/plugins/core/lib/writing/relationship-processor.js)
|
|
18
|
+
- [many-to-many-manipulations.js](/home/merc/Development/current/json-rest-api/plugins/core/lib/writing/many-to-many-manipulations.js)
|
|
19
|
+
|
|
20
|
+
## Runtime evidence
|
|
21
|
+
- Relationship endpoint suite passes post/delete paths:
|
|
22
|
+
- `ok 2 - should add authors to book via POST relationship endpoint` (`...log:5050`)
|
|
23
|
+
- `ok 4 - should remove specific authors via DELETE relationship endpoint` (`...log:5060`)
|
|
24
|
+
- Patch endpoint failure-path defect reproduced by dedicated probe:
|
|
25
|
+
- `handleWriteMethodError is not defined`
|
|
26
|
+
- [probe-patch-relationship-referenceerror.log](/home/merc/Development/current/json-rest-api/audit/evidence/runtime/probe-patch-relationship-referenceerror.log)
|
|
27
|
+
|
|
28
|
+
## Result
|
|
29
|
+
- [Verified][C4] POST/DELETE relationship endpoint behavior is covered and passing.
|
|
30
|
+
- [Verified][C5] PATCH relationship endpoint has a runtime error-handling defect on failure paths.
|
|
31
|
+
- [Unknown][C2] No upstream suite currently asserts successful `patchRelationship` endpoint behavior directly.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Trace: Write Delete
|
|
2
|
+
|
|
3
|
+
## Scope
|
|
4
|
+
- Non-anyapi path only.
|
|
5
|
+
|
|
6
|
+
## Scenario
|
|
7
|
+
- Delete single resource and return 204-style no-content path.
|
|
8
|
+
|
|
9
|
+
## Call path
|
|
10
|
+
1. `delete.js` creates/uses transaction, fetches minimal record, checks permissions, then invokes `helpers.dataDelete` ([delete.js](/home/merc/Development/current/json-rest-api/plugins/core/rest-api-plugin-methods/delete.js)).
|
|
11
|
+
2. Commit and afterCommit hooks run on success; rollback on errors via common handling.
|
|
12
|
+
|
|
13
|
+
## Runtime evidence
|
|
14
|
+
- CRUD suite: `ok 1 - should delete an existing resource` at `audit/evidence/tests/npm-test-json-rest-api.log:5514`.
|
|
15
|
+
|
|
16
|
+
## Result
|
|
17
|
+
- [Verified][C4] Delete flow is validated in regression suite.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Trace: Write Patch
|
|
2
|
+
|
|
3
|
+
## Scope
|
|
4
|
+
- Non-anyapi path only.
|
|
5
|
+
|
|
6
|
+
## Scenario A
|
|
7
|
+
- Standard partial update (`scope.patch`) in CRUD path.
|
|
8
|
+
|
|
9
|
+
## Scenario B
|
|
10
|
+
- Relationship endpoint patch error-path (`patchRelationship`) with malformed relationship payload.
|
|
11
|
+
|
|
12
|
+
## Call path
|
|
13
|
+
1. Standard patch: `patch.js` -> `setupCommonRequest` -> validators -> permission checks -> `helpers.dataPatch` -> commit/rollback ([patch.js](/home/merc/Development/current/json-rest-api/plugins/core/rest-api-plugin-methods/patch.js)).
|
|
14
|
+
2. Relationship patch: `patch-relationship.js` wraps and delegates to `scope.patch` with synthesized `relationships` payload.
|
|
15
|
+
3. Catch path in `patch-relationship.js` calls undefined `handleWriteMethodError` symbol ([patch-relationship.js](/home/merc/Development/current/json-rest-api/plugins/core/rest-api-plugin-methods/patch-relationship.js:53)).
|
|
16
|
+
|
|
17
|
+
## Runtime evidence
|
|
18
|
+
- Standard patch success: `ok 1 - should partially update a resource` at `audit/evidence/tests/npm-test-json-rest-api.log:5502`.
|
|
19
|
+
- Error-path probe reproduces runtime defect:
|
|
20
|
+
- `ERROR_NAME=ReferenceError`
|
|
21
|
+
- `ERROR_MESSAGE=handleWriteMethodError is not defined`
|
|
22
|
+
- Evidence log: [probe-patch-relationship-referenceerror.log](/home/merc/Development/current/json-rest-api/audit/evidence/runtime/probe-patch-relationship-referenceerror.log)
|
|
23
|
+
|
|
24
|
+
## Result
|
|
25
|
+
- [Verified][C5] Standard patch path passes.
|
|
26
|
+
- [Verified][C5] Relationship patch error path is broken in runtime (ReferenceError masks original error and bypasses canonical handler flow).
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Trace: Write Post
|
|
2
|
+
|
|
3
|
+
## Scope
|
|
4
|
+
- Non-anyapi path only.
|
|
5
|
+
|
|
6
|
+
## Scenario
|
|
7
|
+
- Create resource (`countries.post`) with JSON:API payload.
|
|
8
|
+
|
|
9
|
+
## Input shape
|
|
10
|
+
- `inputRecord.data = { type, attributes, relationships? }`
|
|
11
|
+
|
|
12
|
+
## Call path
|
|
13
|
+
1. `post.js` calls `setupCommonRequest` (transaction/context/type checks) ([post.js](/home/merc/Development/current/json-rest-api/plugins/core/rest-api-plugin-methods/post.js)).
|
|
14
|
+
2. Validation + relationship access checks run before `scope.checkPermissions` and before `helpers.dataPost`.
|
|
15
|
+
3. `helpers.dataPost` inserts row through knex adapter and returns new ID ([rest-api-knex-plugin.js](/home/merc/Development/current/json-rest-api/plugins/core/rest-api-knex-plugin.js)).
|
|
16
|
+
4. Commit/rollback handled in method catch/finalization via common helper.
|
|
17
|
+
|
|
18
|
+
## Runtime evidence
|
|
19
|
+
- `ok 1 - should create a country` and `ok 1 - POST - Create Resources` at `audit/evidence/tests/npm-test-json-rest-api.log:5458,5473`.
|
|
20
|
+
|
|
21
|
+
## Result
|
|
22
|
+
- [Verified][C4] Post path executes as expected in core CRUD suite.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Trace: Write Put
|
|
2
|
+
|
|
3
|
+
## Scope
|
|
4
|
+
- Non-anyapi path only.
|
|
5
|
+
|
|
6
|
+
## Scenario
|
|
7
|
+
- Complete relationship replacement via PUT semantics in relationship-heavy flow.
|
|
8
|
+
|
|
9
|
+
## Input shape
|
|
10
|
+
- `api.resources.books.put({ id, inputRecord, simplified: false })`
|
|
11
|
+
|
|
12
|
+
## Call path
|
|
13
|
+
1. `put.js` runs `setupCommonRequest`, minimal-record lookup, validation, and permission checks before storage ([put.js](/home/merc/Development/current/json-rest-api/plugins/core/rest-api-plugin-methods/put.js)).
|
|
14
|
+
2. Storage update via `helpers.dataPut` with idProperty-aware adapter path ([rest-api-knex-plugin.js](/home/merc/Development/current/json-rest-api/plugins/core/rest-api-knex-plugin.js)).
|
|
15
|
+
3. Relationship reconciliation routed through common relationship helpers.
|
|
16
|
+
|
|
17
|
+
## Runtime evidence
|
|
18
|
+
- Relationship suite confirms PUT replacement path:
|
|
19
|
+
- `ok 2 - should update many-to-many relationships via PUT (complete replacement)` at `audit/evidence/tests/npm-test-json-rest-api.log:5199`
|
|
20
|
+
- Additional custom-id PUT coverage at `...:1869`.
|
|
21
|
+
|
|
22
|
+
## Result
|
|
23
|
+
- [Verified][C4] Put path works on non-anyapi coverage scenarios.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "json-rest-api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.22",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"homepage": "https://mobily-enterprises.github.io/json-rest-api",
|
|
25
25
|
"description": "REST API plugin for hooked-api with JSON:API compliance",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"hooked-api": "^1.0.
|
|
28
|
-
"json-rest-schema": "^1.0.
|
|
27
|
+
"hooked-api": "^1.0.24",
|
|
28
|
+
"json-rest-schema": "^1.0.12",
|
|
29
29
|
"semver": "^7.7.2"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"express": "^4.0.0 || ^5.0.0",
|
|
36
36
|
"formidable": "^3.0.0",
|
|
37
37
|
"fractional-indexing": "^3.2.0",
|
|
38
|
-
"jose": "^5.10.0",
|
|
38
|
+
"jose": "^5.10.0 || ^6.0.0",
|
|
39
39
|
"knex": "^3.1.0",
|
|
40
40
|
"raw-body": "^2.0.0",
|
|
41
41
|
"redis": "^5.6.0",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"better-sqlite3": "^11.10.0",
|
|
82
82
|
"express": "^5.1.0",
|
|
83
83
|
"fractional-indexing": "^3.2.0",
|
|
84
|
-
"jose": "^
|
|
84
|
+
"jose": "^6.2.2",
|
|
85
85
|
"knex": "^3.1.0",
|
|
86
86
|
"redis": "^5.6.0",
|
|
87
87
|
"socket.io": "^4.8.1",
|