@cardanowall/poe-standard 0.0.0 → 0.1.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
@@ -113,11 +113,13 @@ The package root re-exports every group. Subpath imports are available for `./sc
113
113
  `./validator`, and `./error-codes`.
114
114
 
115
115
  **Encode** (`@cardanowall/poe-standard/encoder`)
116
+
116
117
  - `encodePoeRecord(record)` — canonical CBOR for chain submission.
117
118
  - `encodeRecordBodyForSigning(record)` — the `record_body` (full map minus `sigs`) that record-level
118
119
  COSE_Sign1 signatures sign over.
119
120
 
120
121
  **Validate** (`@cardanowall/poe-standard/validator`)
122
+
121
123
  - `validatePoeRecord(bytes)` — the structural pipeline: canonical decode → schema parse → cross-field
122
124
  domain checks. Returns a discriminated `ValidateResult`; never throws.
123
125
  - `validateCidProfile(cid)` — offline IPFS CID-profile parser (CIDv0 and the CIP-309 CIDv1 multibase
@@ -125,14 +127,16 @@ The package root re-exports every group. Subpath imports are available for `./sc
125
127
  - `type ValidateResult`, `type ValidationIssue`.
126
128
 
127
129
  **Error codes** (`@cardanowall/poe-standard/error-codes`)
130
+
128
131
  - `STRUCTURAL_ERROR_CODES` — the codes the structural validator emits (Part A).
129
132
  - `VERIFIER_ERROR_CODES` — the verifier-layer codes (Part B), re-exported so downstream verifiers
130
133
  dispatch on a single union without round-tripping through the SDK.
131
134
  - `ERROR_CODES` — their union; `SEVERITY` / `severityOf(code)` map each to `'error' | 'warning' |
132
- 'info'`. Codes are SCREAMING_SNAKE_CASE and byte-exact across implementations.
135
+ 'info'`. Codes are SCREAMING_SNAKE_CASE and byte-exact across implementations.
133
136
  - `type ErrorCode`, `type StructuralErrorCode`, `type VerifierErrorCode`, `type Severity`.
134
137
 
135
138
  **Schema + types** (`@cardanowall/poe-standard/schema`)
139
+
136
140
  - Zod schemas for the full v1 wire surface: `PoeRecordSchema`, `ItemEntrySchema`,
137
141
  `MerkleCommitSchema`, `EncryptionEnvelopeSchema`, `SlotSchema`, `PassphraseBlockSchema`,
138
142
  `Argon2idParamsSchema`, `HashesMapSchema`, `HashDigestSchema`, `SigEntrySchema`,
@@ -145,6 +149,7 @@ The package root re-exports every group. Subpath imports are available for `./sc
145
149
  `EXTENSION_KEY_COMPANION_RE`.
146
150
 
147
151
  **Chunking** (re-exported from the root)
152
+
148
153
  - `chunkBytes` / `bytesChunkArrayConcat` — split/reassemble chunked byte strings (COSE_Sign1,
149
154
  COSE_Key blobs).
150
155
  - `chunkUri` / `reconstructChunkedUri` — split/reassemble chunked URI arrays on UTF-8 boundaries.
package/dist/index.cjs CHANGED
@@ -2810,11 +2810,7 @@ function validateOneUri(chunks, path, errors) {
2810
2810
  const uri = reconstructed.uri;
2811
2811
  if (uri.includes("#")) {
2812
2812
  errors.push(
2813
- issue(
2814
- "INVALID_URI",
2815
- path,
2816
- "URI contains a fragment identifier ('#'), which is forbidden"
2817
- )
2813
+ issue("INVALID_URI", path, "URI contains a fragment identifier ('#'), which is forbidden")
2818
2814
  );
2819
2815
  return;
2820
2816
  }
@@ -2844,21 +2840,13 @@ function validateOneUri(chunks, path, errors) {
2844
2840
  const cid = slashIdx === -1 ? rest : rest.slice(0, slashIdx);
2845
2841
  if (!validateCidProfile(cid)) {
2846
2842
  errors.push(
2847
- issue(
2848
- "INVALID_URI",
2849
- path,
2850
- "ipfs:// URI is not a valid CID under the CIP-309 profile"
2851
- )
2843
+ issue("INVALID_URI", path, "ipfs:// URI is not a valid CID under the CIP-309 profile")
2852
2844
  );
2853
2845
  }
2854
2846
  return;
2855
2847
  }
2856
2848
  errors.push(
2857
- issue(
2858
- "INVALID_URI",
2859
- path,
2860
- "unsupported URI scheme; v1 PoE URI set is {ar://, ipfs://}"
2861
- )
2849
+ issue("INVALID_URI", path, "unsupported URI scheme; v1 PoE URI set is {ar://, ipfs://}")
2862
2850
  );
2863
2851
  }
2864
2852
  function checkItemEnc(item, idx, errors) {