@nakafa/aksara-contracts 0.48.3 → 0.48.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/date.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Schema } from "effect";
1
+ import { DateTime, Schema } from "effect";
2
2
  const DATE_ONLY_PATTERN = /^(\d{4})-(\d{2})-(\d{2})$/u;
3
3
  /** Checks a source-authored date against the real ISO calendar. */
4
4
  function isDateOnly(value) {
@@ -8,10 +8,10 @@ function isDateOnly(value) {
8
8
  const year = Number.parseInt(value.slice(0, 4), 10);
9
9
  const month = Number.parseInt(value.slice(5, 7), 10);
10
10
  const day = Number.parseInt(value.slice(8, 10), 10);
11
- const date = new Date(Date.UTC(year, month - 1, day));
12
- return (date.getUTCFullYear() === year &&
13
- date.getUTCMonth() === month - 1 &&
14
- date.getUTCDate() === day);
11
+ const date = DateTime.makeUnsafe(Date.UTC(year, month - 1, day));
12
+ return (DateTime.getPartUtc(date, "year") === year &&
13
+ DateTime.getPartUtc(date, "month") === month &&
14
+ DateTime.getPartUtc(date, "day") === day);
15
15
  }
16
16
  /** Exact source-authored calendar date shared by content projections. */
17
17
  export const DateOnlySchema = Schema.String.pipe(Schema.check(Schema.makeFilter(isDateOnly)));
@@ -38,9 +38,9 @@ function summarizeTryoutCatalog(records) {
38
38
  /** Verifies all try-out hashes, digests, counts, routes, and identity. */
39
39
  export const verifyTryoutSnapshotRows = Effect.fn("AksaraContracts.verifyTryoutSnapshotRows")(function* (snapshot, rows) {
40
40
  const [placementDigest, catalogDigest, catalogEvidence] = yield* Effect.all([
41
- digestTryoutPlacements(currentPlacements(rows)),
42
- digestTryoutCatalog(currentTryoutCatalog(rows)),
43
- summarizeTryoutCatalog(currentTryoutCatalog(rows)),
41
+ rows.pipe(currentPlacements, digestTryoutPlacements),
42
+ rows.pipe(currentTryoutCatalog, digestTryoutCatalog),
43
+ rows.pipe(currentTryoutCatalog, summarizeTryoutCatalog),
44
44
  ]);
45
45
  yield* verifyTryoutLocaleClosure({
46
46
  activeAppLocales: snapshot.manifest.activeAppLocales,
@@ -43,7 +43,7 @@ declare const SignatureInvalidError_base: Schema.Class<SignatureInvalidError, Sc
43
43
  /** The signature does not authenticate the supplied canonical bytes. */
44
44
  export declare class SignatureInvalidError extends SignatureInvalidError_base {
45
45
  }
46
- declare const ContentVerificationKeyResolver_base: Context.ServiceClass<ContentVerificationKeyResolver, "AksaraContentVerificationKeyResolver", {
46
+ declare const ContentVerificationKeyResolver_base: Context.ServiceClass<ContentVerificationKeyResolver, "@nakafa/aksara-contracts/signature/spec/ContentVerificationKeyResolver", {
47
47
  /** Resolves a reviewed public key without exposing key material in errors. */
48
48
  readonly resolve: (keyId: SigningKeyId) => Effect.Effect<string, SigningKeyNotFoundError | SigningKeyResolutionError>;
49
49
  }>;
@@ -25,5 +25,5 @@ export class SignatureCheckError extends Schema.TaggedError()("SignatureCheckErr
25
25
  export class SignatureInvalidError extends Schema.TaggedError()("SignatureInvalidError", { keyId: SigningKeyIdSchema, subject: ContentSignatureSubjectSchema }) {
26
26
  }
27
27
  /** Server-side trust seam for resolving reviewed Ed25519 public keys. */
28
- export class ContentVerificationKeyResolver extends Context.Service()("AksaraContentVerificationKeyResolver") {
28
+ export class ContentVerificationKeyResolver extends Context.Service()("@nakafa/aksara-contracts/signature/spec/ContentVerificationKeyResolver") {
29
29
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nakafa/aksara-contracts",
3
- "version": "0.48.3",
3
+ "version": "0.48.4",
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",