@odla-ai/brand 0.8.2 → 0.8.4
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/dist/index.cjs +8 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -650,7 +650,15 @@ declare function assertAnalysis(value: unknown): AssetAnalysis;
|
|
|
650
650
|
* and the `createdAt` beside it disagreed at all.
|
|
651
651
|
*/
|
|
652
652
|
declare function rowAsWritten<T>(ns: string, row: T): T;
|
|
653
|
-
/** A stored approval receipt in the shape it was written.
|
|
653
|
+
/** A stored approval receipt in the shape it was written.
|
|
654
|
+
*
|
|
655
|
+
* The store adds `$createdAt`, `$createdBy`, `$updatedAt`, and `$updatedBy` to
|
|
656
|
+
* every row after Brand has computed the immutable receipt digest. Those
|
|
657
|
+
* provenance attrs are trustworthy store metadata, but they are not part of
|
|
658
|
+
* the receipt that was signed and must not be fed to its exact-shape verifier
|
|
659
|
+
* or digest. Strip every reserved `$` attr here so both dependency reads and
|
|
660
|
+
* mutation-id replays verify the same bytes Brand originally wrote.
|
|
661
|
+
*/
|
|
654
662
|
declare function receiptAsWritten<T>(row: T): T;
|
|
655
663
|
/** A stored proposal in the shape it was written, so `reviewDigest` matches. */
|
|
656
664
|
declare function proposalAsWritten<T>(row: T): T;
|
package/dist/index.d.ts
CHANGED
|
@@ -650,7 +650,15 @@ declare function assertAnalysis(value: unknown): AssetAnalysis;
|
|
|
650
650
|
* and the `createdAt` beside it disagreed at all.
|
|
651
651
|
*/
|
|
652
652
|
declare function rowAsWritten<T>(ns: string, row: T): T;
|
|
653
|
-
/** A stored approval receipt in the shape it was written.
|
|
653
|
+
/** A stored approval receipt in the shape it was written.
|
|
654
|
+
*
|
|
655
|
+
* The store adds `$createdAt`, `$createdBy`, `$updatedAt`, and `$updatedBy` to
|
|
656
|
+
* every row after Brand has computed the immutable receipt digest. Those
|
|
657
|
+
* provenance attrs are trustworthy store metadata, but they are not part of
|
|
658
|
+
* the receipt that was signed and must not be fed to its exact-shape verifier
|
|
659
|
+
* or digest. Strip every reserved `$` attr here so both dependency reads and
|
|
660
|
+
* mutation-id replays verify the same bytes Brand originally wrote.
|
|
661
|
+
*/
|
|
654
662
|
declare function receiptAsWritten<T>(row: T): T;
|
|
655
663
|
/** A stored proposal in the shape it was written, so `reviewDigest` matches. */
|
|
656
664
|
declare function proposalAsWritten<T>(row: T): T;
|
package/dist/index.js
CHANGED
|
@@ -366,7 +366,13 @@ function rowAsWritten(ns, row) {
|
|
|
366
366
|
return changed ? out : row;
|
|
367
367
|
}
|
|
368
368
|
function receiptAsWritten(row) {
|
|
369
|
-
|
|
369
|
+
const normalized = rowAsWritten(BRAND_NS.approvalReceipt, row);
|
|
370
|
+
if (!record(normalized)) return normalized;
|
|
371
|
+
const systemAttrs = Object.keys(normalized).filter((key) => key.startsWith("$"));
|
|
372
|
+
if (systemAttrs.length === 0) return normalized;
|
|
373
|
+
const out = { ...normalized };
|
|
374
|
+
for (const key of systemAttrs) delete out[key];
|
|
375
|
+
return out;
|
|
370
376
|
}
|
|
371
377
|
function proposalAsWritten(row) {
|
|
372
378
|
return rowAsWritten(BRAND_NS.proposal, row);
|
|
@@ -3428,7 +3434,7 @@ async function proposalDecisionState(ctx, req, book, proposal, resolution, recei
|
|
|
3428
3434
|
status: "active",
|
|
3429
3435
|
name: paletteDep.palette.name,
|
|
3430
3436
|
swatches: paletteDep.palette.swatches,
|
|
3431
|
-
seedHex: paletteDep.palette.seedHex
|
|
3437
|
+
...paletteDep.palette.seedHex ? { seedHex: paletteDep.palette.seedHex } : {},
|
|
3432
3438
|
source: paletteDep.palette.source,
|
|
3433
3439
|
rationale: paletteDep.palette.rationale,
|
|
3434
3440
|
proposalId: paletteDep.palette.proposalId,
|