@hypercerts-org/lexicon 0.11.0 → 0.11.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @hypercerts-org/lexicon
2
2
 
3
+ ## 0.11.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#196](https://github.com/hypercerts-org/hypercerts-lexicon/pull/196) [`e66a459`](https://github.com/hypercerts-org/hypercerts-lexicon/commit/e66a4595e5df6640d082072284c96282acaa3faf) Thanks [@aspiers](https://github.com/aspiers)! - Fix incorrect NSID reference in `org.hyperboards.board` subject field description (`org.hypercerts.claim.collection` → `org.hypercerts.collection`).
8
+
9
+ Documentation fixes in `README.md` and `SCHEMAS.md`:
10
+ - Correct `validate()` call signature examples (parameter order and result shape)
11
+ - Fix relationship diagram arrow directions and missing entries (`link/evm`, `CERTIFIED` section)
12
+ - Fix contributor field name (`avatar` → `image`)
13
+ - Fix context target descriptions (generalized to `any record` since subjects use generic `strongRef`)
14
+ - Add missing `$type` discriminators to union member examples
15
+
3
16
  ## 0.11.0
4
17
 
5
18
  The v0.11.0 release introduces EVM identity linking, stronger type safety across badge and funding schemas, vendored Leaflet lexicons for runtime validation, and a set of schema refinements based on real-world usage from the first month of v0.10.0 adoption. All changes listed below are merged to `main` and will ship together as a single coordinated release.
package/README.md CHANGED
@@ -14,19 +14,19 @@ CLAIMS ─ the core impact record and its parts
14
14
  (the hypercert) │ │ │
15
15
  │ ▼ │
16
16
  ├──► contribution (role, timeframe)
17
- ├──► contributorInformation (identity, avatar)
17
+ ├──► contributorInformation (identity, image)
18
18
  ├──► rights (licensing terms)
19
19
  └──► workScope
20
- ├── cel (CEL expression)
21
- └── tag (reusable scope atom)
20
+ ├── cel ───► tag (CEL expression referencing tags)
21
+ └── string (free-form scope)
22
22
 
23
23
  CONTEXT ─ evidence, data, and social verification
24
24
  ──────────────────────────────────────────────────────────────────────
25
- attachment ─────────────► activity / evaluation / ...
26
- measurement ────────────► activity / ...
27
- evaluation ─────────────► activity / attachment
25
+ attachment ─────────────► any record (activity, evaluation, …)
26
+ measurement ────────────► any record (activity, …)
27
+ evaluation ─────────────► any record (activity, measurement, …)
28
28
  └──────► measurement
29
- acknowledgement ────────► activity / collection (bidirectional link)
29
+ acknowledgement ────────► any record (bidirectional link)
30
30
 
31
31
  FUNDING ─ payment records
32
32
  ──────────────────────────────────────────────────────────────────────
@@ -41,9 +41,10 @@ HYPERBOARDS ─ visual display layer (hyperboards.org)
41
41
  CERTIFIED ─ shared lexicons (certified.app)
42
42
  ──────────────────────────────────────────────────────────────────────
43
43
  location (geo coordinates, GeoJSON, H3, …)
44
+ link/evm (ATProto DID ↔ EVM wallet link)
44
45
  actor/profile (user profile)
45
46
  actor/organization (org metadata)
46
- badge/definition ──► badge/award ──► badge/response
47
+ badge/response ──► badge/award ──► badge/definition
47
48
  ```
48
49
 
49
50
  Every arrow (`►`) is a `strongRef` or union reference stored on the
@@ -206,8 +207,8 @@ const record = {
206
207
  };
207
208
 
208
209
  // Validate before writing
209
- const result = validate(ACTIVITY_NSID, record);
210
- if (!result.valid) throw new Error(JSON.stringify(result.errors));
210
+ const result = validate(record, ACTIVITY_NSID, "main");
211
+ if (!result.success) throw new Error(String(result.error));
211
212
 
212
213
  // Write to the network
213
214
  await agent.api.com.atproto.repo.createRecord({
@@ -225,7 +226,7 @@ await agent.api.com.atproto.repo.createRecord({
225
226
  | --------------------------- | --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
226
227
  | **Activity** | `org.hypercerts.claim.activity` | The main hypercert record — describes impact work with title, description, contributors, work scope, timeframe, locations, and rights. |
227
228
  | **Contribution** | `org.hypercerts.claim.contribution` | Details about a specific contribution: role, description, and timeframe. |
228
- | **Contributor Information** | `org.hypercerts.claim.contributorInformation` | Identity record for a contributor: identifier (DID or URI), display name, and avatar. |
229
+ | **Contributor Information** | `org.hypercerts.claim.contributorInformation` | Identity record for a contributor: identifier (DID or URI), display name, and image. |
229
230
  | **Rights** | `org.hypercerts.claim.rights` | Licensing and rights terms (e.g. "CC BY-SA 4.0") attached to an activity. |
230
231
 
231
232
  ### Collections (`org.hypercerts.*`)
@@ -270,7 +271,7 @@ await agent.api.com.atproto.repo.createRecord({
270
271
  | **Location** | `app.certified.location` | Geographic reference using the [Location Protocol](https://spec.decentralizedgeo.org) (coordinates, GeoJSON, H3, WKT, etc.). |
271
272
  | **Profile** | `app.certified.actor.profile` | User account profile with display name, bio, avatar, and banner. |
272
273
  | **Organization** | `app.certified.actor.organization` | Organization metadata: legal structure, URLs, location, founding date. |
273
- | **Badge Definition** | `app.certified.badge.definition` | Defines a badge type with title, icon, and optional issuer allowlist. |
274
+ | **Badge Definition** | `app.certified.badge.definition` | Defines a badge with type, title, icon, and optional issuer allowlist. |
274
275
  | **Badge Award** | `app.certified.badge.award` | Awards a badge to a user, project, or activity. |
275
276
  | **Badge Response** | `app.certified.badge.response` | Recipient accepts or rejects a badge award. |
276
277
  | **EVM Link** | `app.certified.link.evm` | Verifiable ATProto DID ↔ EVM wallet link via EIP-712 signature. Extensible for future proof methods (e.g. ERC-1271, ERC-6492). |
@@ -295,7 +296,10 @@ await agent.api.com.atproto.repo.createRecord({
295
296
  Individual constants (recommended):
296
297
 
297
298
  ```typescript
298
- import { ACTIVITY_NSID, COLLECTION_NSID } from "@hypercerts-org/lexicon";
299
+ import {
300
+ ACTIVITY_NSID,
301
+ HYPERCERTS_COLLECTION_NSID,
302
+ } from "@hypercerts-org/lexicon";
299
303
  ```
300
304
 
301
305
  Semantic object:
@@ -387,10 +391,10 @@ const activity = {
387
391
  ### Creating Collections (Projects, Portfolios, etc.)
388
392
 
389
393
  ```typescript
390
- import { COLLECTION_NSID } from "@hypercerts-org/lexicon";
394
+ import { HYPERCERTS_COLLECTION_NSID } from "@hypercerts-org/lexicon";
391
395
 
392
396
  const project = {
393
- $type: COLLECTION_NSID,
397
+ $type: HYPERCERTS_COLLECTION_NSID,
394
398
  type: "project",
395
399
  title: "Carbon Offset Initiative",
396
400
  shortDescription: "Activities focused on carbon reduction and reforestation",
@@ -430,7 +434,10 @@ const location = {
430
434
  lpVersion: "1.0",
431
435
  srs: "http://www.opengis.net/def/crs/OGC/1.3/CRS84",
432
436
  locationType: "coordinate-decimal",
433
- location: { string: "-3.4653, -62.2159" },
437
+ location: {
438
+ $type: "app.certified.location#string",
439
+ string: "-3.4653, -62.2159",
440
+ },
434
441
  name: "Amazon Research Station",
435
442
  createdAt: new Date().toISOString(),
436
443
  };
@@ -441,7 +448,10 @@ const geoLocation = {
441
448
  lpVersion: "1.0",
442
449
  srs: "http://www.opengis.net/def/crs/OGC/1.3/CRS84",
443
450
  locationType: "geojson-point",
444
- location: { string: '{"type":"Point","coordinates":[-62.2159,-3.4653]}' },
451
+ location: {
452
+ $type: "app.certified.location#string",
453
+ string: '{"type":"Point","coordinates":[-62.2159,-3.4653]}',
454
+ },
445
455
  name: "Research Station Alpha",
446
456
  createdAt: new Date().toISOString(),
447
457
  };
@@ -453,15 +463,17 @@ When one user includes another's record (e.g. adding an activity to a
453
463
  collection), the owner can confirm or reject with an acknowledgement:
454
464
 
455
465
  ```typescript
456
- import { ACKNOWLEDGEMENT_NSID } from "@hypercerts-org/lexicon";
466
+ import { CONTEXT_ACKNOWLEDGEMENT_NSID } from "@hypercerts-org/lexicon";
457
467
 
458
468
  const ack = {
459
- $type: ACKNOWLEDGEMENT_NSID,
469
+ $type: CONTEXT_ACKNOWLEDGEMENT_NSID,
460
470
  subject: {
461
471
  uri: "at://did:plc:bob/org.hypercerts.claim.activity/3k2abc",
462
472
  cid: "bafy...",
463
473
  },
474
+ // context is a union — use $type to specify the variant
464
475
  context: {
476
+ $type: "com.atproto.repo.strongRef",
465
477
  uri: "at://did:plc:alice/org.hypercerts.collection/7x9def",
466
478
  cid: "bafy...",
467
479
  },
@@ -473,10 +485,10 @@ const ack = {
473
485
  ### Creating Attachments
474
486
 
475
487
  ```typescript
476
- import { ATTACHMENT_NSID } from "@hypercerts-org/lexicon";
488
+ import { CONTEXT_ATTACHMENT_NSID } from "@hypercerts-org/lexicon";
477
489
 
478
490
  const attachment = {
479
- $type: ATTACHMENT_NSID,
491
+ $type: CONTEXT_ATTACHMENT_NSID,
480
492
  title: "Field Survey Report",
481
493
  contentType: "report",
482
494
  subjects: [
@@ -485,9 +497,13 @@ const attachment = {
485
497
  cid: "...",
486
498
  },
487
499
  ],
500
+ // content items are a union — use $type to specify the variant
488
501
  content: [
489
- { uri: "https://example.com/reports/survey-2024.pdf" },
490
- { uri: "ipfs://Qm..." },
502
+ {
503
+ $type: "org.hypercerts.defs#uri",
504
+ uri: "https://example.com/reports/survey-2024.pdf",
505
+ },
506
+ { $type: "org.hypercerts.defs#uri", uri: "ipfs://Qm..." },
491
507
  ],
492
508
  shortDescription: "Quarterly field survey documenting project progress",
493
509
  createdAt: new Date().toISOString(),
package/SCHEMAS.md CHANGED
@@ -660,12 +660,12 @@ Specifies the sub-string range a facet feature applies to. Start index is inclus
660
660
 
661
661
  #### Properties
662
662
 
663
- | Property | Type | Required | Description | Comments |
664
- | -------------------- | -------- | -------- | -------------------------------------------------------------------------------------------------------- | --------------- |
665
- | `subject` | `ref` | ✅ | Reference to the org.hypercerts.claim.activity or org.hypercerts.claim.collection this board visualizes. | |
666
- | `config` | `ref` | ❌ | Visual configuration for a hyperboard's background, colors, and layout. | |
667
- | `contributorConfigs` | `ref[]` | ❌ | Per-contributor configuration entries for this board. | maxLength: 1000 |
668
- | `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created. | |
663
+ | Property | Type | Required | Description | Comments |
664
+ | -------------------- | -------- | -------- | -------------------------------------------------------------------------------------------------- | --------------- |
665
+ | `subject` | `ref` | ✅ | Reference to the org.hypercerts.claim.activity or org.hypercerts.collection this board visualizes. | |
666
+ | `config` | `ref` | ❌ | Visual configuration for a hyperboard's background, colors, and layout. | |
667
+ | `contributorConfigs` | `ref[]` | ❌ | Per-contributor configuration entries for this board. | maxLength: 1000 |
668
+ | `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created. | |
669
669
 
670
670
  #### Defs
671
671
 
package/dist/exports.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * ⚠️ DO NOT EDIT THIS FILE MANUALLY ⚠️
5
5
  *
6
6
  * This file is automatically generated by scripts/generate-exports.js
7
- * Generated: 2026-04-07T22:27:48.251Z
7
+ * Generated: 2026-04-08T16:56:41.853Z
8
8
  *
9
9
  * To regenerate this file, run:
10
10
  * npm run gen-api
@@ -4,7 +4,7 @@
4
4
  * ⚠️ DO NOT EDIT THIS FILE MANUALLY ⚠️
5
5
  *
6
6
  * This file is automatically generated by scripts/generate-exports.js
7
- * Generated: 2026-04-07T22:27:48.251Z
7
+ * Generated: 2026-04-08T16:56:41.853Z
8
8
  *
9
9
  * To regenerate this file, run:
10
10
  * npm run gen-api
@@ -548,7 +548,7 @@ export declare const schemaDict: {
548
548
  readonly subject: {
549
549
  readonly type: "ref";
550
550
  readonly ref: "lex:com.atproto.repo.strongRef";
551
- readonly description: "Reference to the org.hypercerts.claim.activity or org.hypercerts.claim.collection this board visualizes.";
551
+ readonly description: "Reference to the org.hypercerts.claim.activity or org.hypercerts.collection this board visualizes.";
552
552
  };
553
553
  readonly config: {
554
554
  readonly type: "ref";
@@ -2853,7 +2853,7 @@ export declare const schemas: ({
2853
2853
  readonly subject: {
2854
2854
  readonly type: "ref";
2855
2855
  readonly ref: "lex:com.atproto.repo.strongRef";
2856
- readonly description: "Reference to the org.hypercerts.claim.activity or org.hypercerts.claim.collection this board visualizes.";
2856
+ readonly description: "Reference to the org.hypercerts.claim.activity or org.hypercerts.collection this board visualizes.";
2857
2857
  };
2858
2858
  readonly config: {
2859
2859
  readonly type: "ref";
package/dist/index.cjs CHANGED
@@ -628,7 +628,7 @@ const schemaDict = {
628
628
  subject: {
629
629
  type: 'ref',
630
630
  ref: 'lex:com.atproto.repo.strongRef',
631
- description: 'Reference to the org.hypercerts.claim.activity or org.hypercerts.claim.collection this board visualizes.',
631
+ description: 'Reference to the org.hypercerts.claim.activity or org.hypercerts.collection this board visualizes.',
632
632
  },
633
633
  config: {
634
634
  type: 'ref',
@@ -3273,7 +3273,7 @@ var defs$x = {
3273
3273
  subject: {
3274
3274
  type: "ref",
3275
3275
  ref: "com.atproto.repo.strongRef",
3276
- description: "Reference to the org.hypercerts.claim.activity or org.hypercerts.claim.collection this board visualizes."
3276
+ description: "Reference to the org.hypercerts.claim.activity or org.hypercerts.collection this board visualizes."
3277
3277
  },
3278
3278
  config: {
3279
3279
  type: "ref",
@@ -6602,7 +6602,7 @@ var facet = /*#__PURE__*/Object.freeze({
6602
6602
  * ⚠️ DO NOT EDIT THIS FILE MANUALLY ⚠️
6603
6603
  *
6604
6604
  * This file is automatically generated by scripts/generate-exports.js
6605
- * Generated: 2026-04-07T22:27:48.251Z
6605
+ * Generated: 2026-04-08T16:56:41.853Z
6606
6606
  *
6607
6607
  * To regenerate this file, run:
6608
6608
  * npm run gen-api