|
1 | 1 | # @hypercerts-org/sdk-core |
2 | 2 |
|
| 3 | +## 0.10.0-beta.7 |
| 4 | + |
| 5 | +### Minor Changes |
| 6 | + |
| 7 | +- [#112](https://github.com/hypercerts-org/hypercerts-sdk/pull/112) |
| 8 | + [`320b428`](https://github.com/hypercerts-org/hypercerts-sdk/commit/320b428a073b8f9371f3a224dd7897897ad7efae) Thanks |
| 9 | + [@aspiers](https://github.com/aspiers)! - Add comprehensive documentation and tests for collection avatar and banner |
| 10 | + images |
| 11 | + |
| 12 | + Collections and projects now support avatar (thumbnail/icon) and banner (header/cover) images. Images can be provided |
| 13 | + as Blobs for upload or as URI strings for external references. |
| 14 | + |
| 15 | + **What's Included:** |
| 16 | + - Comprehensive JSDoc documentation for `HypercertCollection` type explaining avatar and banner usage |
| 17 | + - Tests for creating collections with avatar/banner using both Blobs and URI strings |
| 18 | + - Tests for updating collection images (add, update, remove, preserve) |
| 19 | + - Examples showing avatar/banner in collections and projects |
| 20 | + |
| 21 | +- [#112](https://github.com/hypercerts-org/hypercerts-sdk/pull/112) |
| 22 | + [`e1ced1e`](https://github.com/hypercerts-org/hypercerts-sdk/commit/e1ced1e53f4f26058f4e4e5c06909563ec3cd49e) Thanks |
| 23 | + [@aspiers](https://github.com/aspiers)! - Add rich text facet support for activity descriptions (lexicon |
| 24 | + v0.10.0-beta.7) |
| 25 | + |
| 26 | + Activities now support rich text annotations (facets) in their descriptions, enabling mentions (@user), URLs, hashtags |
| 27 | + (#tag), and other inline markup. |
| 28 | + - Added `shortDescriptionFacets` and `descriptionFacets` fields to `CreateHypercertParams` |
| 29 | + - Updated `create()` method to include facet fields in hypercert records |
| 30 | + - Enhanced `HypercertClaim` documentation with comprehensive facet examples |
| 31 | + - Added examples showing mentions, links, and tag facets with proper byte indexing |
| 32 | + |
| 33 | +- [#115](https://github.com/hypercerts-org/hypercerts-sdk/pull/115) |
| 34 | + [`5be70fa`](https://github.com/hypercerts-org/hypercerts-sdk/commit/5be70faf5728a41477508089cfebef9c26d1362e) Thanks |
| 35 | + [@s-adamantine](https://github.com/s-adamantine)! - **BREAKING CHANGE**: Update contribution structure to match |
| 36 | + lexicon beta.7+ inline contributor format. |
| 37 | + |
| 38 | + **Old API (lexicon beta.5-beta.6):** |
| 39 | + |
| 40 | + ```typescript |
| 41 | + await repo.hypercerts.create({ |
| 42 | + contributions: [ |
| 43 | + { |
| 44 | + contributors: ["did:plc:contrib1"], |
| 45 | + role: "Developer", |
| 46 | + description: "Led backend development", |
| 47 | + }, |
| 48 | + ], |
| 49 | + }); |
| 50 | + ``` |
| 51 | + |
| 52 | + **New API (lexicon beta.7+):** |
| 53 | + |
| 54 | + ```typescript |
| 55 | + await repo.hypercerts.create({ |
| 56 | + contributions: [ |
| 57 | + { |
| 58 | + contributors: ["did:plc:contrib1"], |
| 59 | + contributionDetails: "Developer", // string | StrongRef | CreateContributionDetailsParams |
| 60 | + weight: "0.75", // optional proportional weight |
| 61 | + }, |
| 62 | + ], |
| 63 | + }); |
| 64 | + ``` |
| 65 | + |
| 66 | + **Migration:** Replace `role` and `description` with `contributionDetails`. Optionally add `weight` for proportional |
| 67 | + attribution. |
| 68 | + |
| 69 | +- [#108](https://github.com/hypercerts-org/hypercerts-sdk/pull/108) |
| 70 | + [`750cd44`](https://github.com/hypercerts-org/hypercerts-sdk/commit/750cd4429ed4ec2c0d21b4ea60296da87c7cc183) Thanks |
| 71 | + [@s-adamantine](https://github.com/s-adamantine)! - Support multiple locations for hypercert activity claims |
| 72 | + |
| 73 | + **Breaking Changes:** |
| 74 | + - `CreateHypercertParams.location` is now `CreateHypercertParams.locations` (plural, array) |
| 75 | + - `CreateHypercertResult.locationUri` is now `CreateHypercertResult.locationUris` (plural, array) |
| 76 | + - `CreateHypercertResult.locationCid` is now `CreateHypercertResult.locationCids` (plural, array) |
| 77 | + |
| 78 | + **New Functionality:** |
| 79 | + - Hypercerts can now have multiple locations to support activities spanning multiple places |
| 80 | + - Each location can be a StrongRef, string URI, or location object |
| 81 | + - `attachLocation()` now appends to existing locations array instead of replacing |
| 82 | + |
| 83 | + **Migration:** |
| 84 | + |
| 85 | + ```typescript |
| 86 | + // Before (v0.10.0-beta.5 and earlier) |
| 87 | + await repo.hypercerts.create({ |
| 88 | + ...params, |
| 89 | + location: { |
| 90 | + lpVersion: "1.0.0", |
| 91 | + srs: "EPSG:4326", |
| 92 | + locationType: "coordinate-decimal", |
| 93 | + location: "https://example.com/location", |
| 94 | + }, |
| 95 | + }); |
| 96 | + |
| 97 | + // After (v0.10.0-beta.6+) |
| 98 | + await repo.hypercerts.create({ |
| 99 | + ...params, |
| 100 | + locations: [ |
| 101 | + { |
| 102 | + lpVersion: "1.0.0", |
| 103 | + srs: "EPSG:4326", |
| 104 | + locationType: "coordinate-decimal", |
| 105 | + location: "https://example.com/location", |
| 106 | + }, |
| 107 | + ], |
| 108 | + }); |
| 109 | + |
| 110 | + // Now supports multiple locations |
| 111 | + await repo.hypercerts.create({ |
| 112 | + ...params, |
| 113 | + locations: [ |
| 114 | + { location: "https://example.com/location1", ... }, |
| 115 | + { location: "https://example.com/location2", ... }, |
| 116 | + ], |
| 117 | + }); |
| 118 | + ``` |
| 119 | + |
| 120 | +- [#120](https://github.com/hypercerts-org/hypercerts-sdk/pull/120) |
| 121 | + [`2e03d8d`](https://github.com/hypercerts-org/hypercerts-sdk/commit/2e03d8dc3a1fafad03c4f783951bfb48acfb01ab) Thanks |
| 122 | + [@Kzoeps](https://github.com/Kzoeps)! - Update measurement API to align with lexicon beta.12+ schema |
| 123 | + |
| 124 | + **Breaking Changes (sdk-core):** |
| 125 | + - `addMeasurement()` now accepts `CreateMeasurementParams` instead of individual parameters |
| 126 | + - `subject` field replaces `hypercertUri` and accepts both string AT-URIs and StrongRefs |
| 127 | + - `unit` is now a required field (e.g., "tons CO2e", "hectares", "%") |
| 128 | + - `measurers` is now optional instead of required |
| 129 | + - Field name changes: `methodUri` → `methodURI`, `evidenceUris` → `evidenceURI` |
| 130 | + |
| 131 | + **Breaking Changes (sdk-react):** |
| 132 | + - Removed `OrgHypercertsDefs` export (WorkScope types removed from lexicon) |
| 133 | + - `UpdateHypercertParams.workScope` now accepts `string | StrongRef` (i.e., `string | { uri: string; cid: string }`) |
| 134 | + |
| 135 | + **New Features:** |
| 136 | + - Added `updateMeasurement()` method with `UpdateMeasurementParams` type (subject is immutable) |
| 137 | + - Support for `locations` array to specify where measurements were taken |
| 138 | + - Added `startDate` and `endDate` for measurement timeframes |
| 139 | + - Added `methodType` for short methodology identifiers |
| 140 | + - Rich text support via `comment` and `commentFacets` fields |
| 141 | + |
| 142 | + **Internal Improvements:** |
| 143 | + - Added `resolveToStrongRef` utility for handling string/StrongRef conversions |
| 144 | + - Updated evidence handling to use `HypercertAttachment` schema (beta.13 compatibility) |
| 145 | + - Improved error messages in URI resolution functions |
| 146 | + |
| 147 | +- [#108](https://github.com/hypercerts-org/hypercerts-sdk/pull/108) |
| 148 | + [`60c3950`](https://github.com/hypercerts-org/hypercerts-sdk/commit/60c3950f596b5ae7080404d66575ecb58861d5c0) Thanks |
| 149 | + [@s-adamantine](https://github.com/s-adamantine)! - feat: implement pre-generation of rKeys for activity claims using |
| 150 | + deterministic content hashing (SHA-256). |
| 151 | + |
| 152 | + fix: normalize hashInput in `createHypercertRecord()` to use resolved StrongRefs (`locationRef`, `contributorsData`) |
| 153 | + instead of raw params which may contain non-serializable Blobs or inconsistent formats, ensuring stable rKey |
| 154 | + generation. |
| 155 | + |
| 156 | +### Patch Changes |
| 157 | + |
| 158 | +- [#112](https://github.com/hypercerts-org/hypercerts-sdk/pull/112) |
| 159 | + [`28a46c8`](https://github.com/hypercerts-org/hypercerts-sdk/commit/28a46c80224633badaddb574971cafc6537edc1c) Thanks |
| 160 | + [@aspiers](https://github.com/aspiers)! - Add documentation for collection item weights (lexicon v0.10.0-beta.7) |
| 161 | + |
| 162 | + Collections now support optional weights on items for proportional attribution. Each item in a collection's `items` |
| 163 | + array can have an `itemWeight` field (positive number as string) to indicate relative weighting. |
| 164 | + - Enhanced documentation for `HypercertCollectionItem` type with usage examples |
| 165 | + - Added examples showing weighted items, nested collections, and basic items |
| 166 | + - Documented `CollectionItemInput` helper type for SDK operations |
| 167 | + |
| 168 | +- [#119](https://github.com/hypercerts-org/hypercerts-sdk/pull/119) |
| 169 | + [`2354987`](https://github.com/hypercerts-org/hypercerts-sdk/commit/23549875fdd02cb30372109784916b3d5d9ee7c3) Thanks |
| 170 | + [@Kzoeps](https://github.com/Kzoeps)! - Fix contributor identity and contribution details to include `$type` for |
| 171 | + lexicon validation |
| 172 | + |
| 173 | + **Breaking Context:** The lexicon defines `contributorIdentity` and `contributionDetails` as union types wrapped in |
| 174 | + `$Typed<>`, which requires `$type: "com.atproto.repo.strongRef"` as a discriminator for validation. Unlike the |
| 175 | + `rights` field (which uses plain `ComAtprotoRepoStrongRef.Main`), these fields require `$type` to pass validation. |
| 176 | + |
| 177 | + **Implementation Changes:** |
| 178 | + - `resolveContributorIdentity()`: Now converts string DIDs to `contributorInformation` records and returns StrongRefs |
| 179 | + with `$type` |
| 180 | + - `resolveContributionDetails()`: Added `$type: "com.atproto.repo.strongRef"` to all StrongRef returns |
| 181 | + - Updated `ResolvedContributorIdentity` and `ResolvedContributionDetails` types to include `$type` in StrongRef |
| 182 | + objects |
| 183 | + |
| 184 | + **Test Updates:** |
| 185 | + - Added mocks for `contributorInformation` record creation when string DIDs are provided (e.g., `"did:plc:contrib1"`) |
| 186 | + - Updated assertions to expect `$type: "com.atproto.repo.strongRef"` in all contributor and contribution detail |
| 187 | + StrongRefs |
| 188 | + - Adjusted mock call indices to account for additional `contributorInformation` record creation calls |
| 189 | + - Fixed 10 failing tests that were expecting plain `{ uri, cid }` objects instead of properly typed StrongRefs |
| 190 | + |
| 191 | + This ensures hypercert records with contributors pass lexicon validation and can be created successfully. |
| 192 | + |
3 | 193 | ## 0.10.0-beta.6 |
4 | 194 |
|
5 | 195 | ### Minor Changes |
|
0 commit comments