@nakafa/aksara-contracts 0.38.0 → 0.39.0

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/README.md CHANGED
@@ -43,6 +43,10 @@ Article, material, public page, and question metadata carry one required
43
43
  `datePublished` and one optional `dateModified`, both as exact `DateOnly`
44
44
  values.
45
45
 
46
+ Decode external metadata and signed payloads with `onExcessProperty: "error"`.
47
+ Effect schemas own the shape and invariants; the decoder owns excess-property
48
+ policy. This rejects obsolete fields instead of silently discarding them.
49
+
46
50
  - `datePublished` is the first verified public availability of that specific
47
51
  locale page.
48
52
  - `dateModified` is the public activation date of a later signed release that
package/dist/date.js CHANGED
@@ -20,16 +20,14 @@ const PublicationDateFields = {
20
20
  dateModified: Schema.optionalKey(DateOnlySchema),
21
21
  datePublished: DateOnlySchema,
22
22
  };
23
- const PublicationDatesStruct = Schema.Struct(PublicationDateFields).annotate({
24
- parseOptions: { onExcessProperty: "error" },
25
- });
23
+ const PublicationDatesStruct = Schema.Struct(PublicationDateFields);
26
24
  /**
27
25
  * Public authored dates backed by signed activation history.
28
26
  * Publication is locale-specific; modification records only a later meaningful
29
27
  * content activation and is never synthesized from a runtime clock.
30
28
  */
31
29
  export const PublicationDatesSchema = PublicationDatesStruct.pipe(Schema.check(Schema.makeFilter((input) => input.dateModified === undefined ||
32
- input.dateModified > input.datePublished, { message: PUBLICATION_DATE_ORDER_MESSAGE })), Schema.annotate({ parseOptions: { onExcessProperty: "error" } }));
30
+ input.dateModified > input.datePublished, { message: PUBLICATION_DATE_ORDER_MESSAGE })));
33
31
  /**
34
32
  * Adds exact publication dates and their chronological invariant to metadata.
35
33
  *
@@ -40,5 +38,5 @@ export function withPublicationDates(fields) {
40
38
  return PublicationDatesSchema.mapFields((dateFields) => ({ ...fields, ...dateFields }),
41
39
  // Adding fields cannot invalidate the date check because the owning date
42
40
  // fields are preserved unchanged and always win key collisions.
43
- { unsafePreserveChecks: true }).annotate({ parseOptions: { onExcessProperty: "error" } });
41
+ { unsafePreserveChecks: true });
44
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nakafa/aksara-contracts",
3
- "version": "0.38.0",
3
+ "version": "0.39.0",
4
4
  "description": "Schemas and verification contracts for Nakafa content releases.",
5
5
  "homepage": "https://github.com/nakafaai/aksara#readme",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -21,7 +21,7 @@
21
21
  "directory": "packages/contracts"
22
22
  },
23
23
  "peerDependencies": {
24
- "effect": "4.0.0-rc.112"
24
+ "effect": "4.0.0-rc.115"
25
25
  },
26
26
  "exports": {
27
27
  "./content": {