@cardinali-studio/adminkit 2.2.7 → 2.2.8

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.
@@ -158,7 +158,10 @@ export class D1ContentRepository {
158
158
  return "repeated";
159
159
  if ((input.payload === null) === !input.tombstone)
160
160
  throw new Error("invalid_document");
161
- const document = await this.db.prepare("SELECT document_id, draft_revision_id, abandoned_at FROM content_documents WHERE document_id = ?").bind(input.documentId).first();
161
+ /* `kind` and `locale` are part of the immutable identity check below, so
162
+ * they must be projected by the real D1 query. Test doubles used to return
163
+ * extra object properties and accidentally hid their absence in SQL. */
164
+ const document = await this.db.prepare("SELECT document_id, kind, locale, draft_revision_id, abandoned_at FROM content_documents WHERE document_id = ?").bind(input.documentId).first();
162
165
  if (document && (document.kind !== input.kind || document.locale !== input.locale))
163
166
  throw new Error("invalid_document");
164
167
  const expectedDraftRevisionId = input.expectedDraftRevisionId === undefined ? input.baseRevisionId : input.expectedDraftRevisionId;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cardinali-studio/adminkit",
3
- "version": "2.2.7",
3
+ "version": "2.2.8",
4
4
  "type": "module",
5
5
  "description": "Motore riusabile di un pannello di amministrazione per siti Hugo su Cloudflare Pages: codec del front matter guidato dallo schema, form React, libreria media su R2. NIENTE di specifico di un sito qui dentro.",
6
6
  "license": "UNLICENSED",