|
1 | 1 | # @hypercerts-org/sdk-core |
2 | 2 |
|
| 3 | +## 0.10.0-beta.6 |
| 4 | + |
| 5 | +### Minor Changes |
| 6 | + |
| 7 | +- [#101](https://github.com/hypercerts-org/hypercerts-sdk/pull/101) |
| 8 | + [`bf93b3c`](https://github.com/hypercerts-org/hypercerts-sdk/commit/bf93b3cf5d5eccb12de31c4fe6f95ed3676c746e) Thanks |
| 9 | + [@aspiers](https://github.com/aspiers)! - feat: align collection/project types with lexicon + add inline location |
| 10 | + support |
| 11 | + |
| 12 | + This is a BREAKING change. |
| 13 | + |
| 14 | + **Type Alignment with Lexicon:** |
| 15 | + - Changed `createCollection` to use lexicon-aligned `items` array instead of `claims` |
| 16 | + - Updated avatar/banner handling to use proper lexicon union types |
| 17 | + - Simplified project methods to delegate to collection methods |
| 18 | + - Added `CreateCollectionParams`, `UpdateCollectionParams`, and result types derived from lexicon |
| 19 | + - Improved type safety by deriving SDK input types from lexicon definitions |
| 20 | + |
| 21 | + **Inline Location Support:** |
| 22 | + |
| 23 | + `AttachLocationParams` now supports three ways to specify location: |
| 24 | + 1. **StrongRef** - Direct reference with uri and cid (no record creation) |
| 25 | + 2. **AT-URI string** - Reference to existing location record |
| 26 | + 3. **Location object** - Full location data to create a new location record |
| 27 | + |
| 28 | + **Changes:** |
| 29 | + - Add `AttachLocationParams` union type supporting StrongRef, string URI, or location object |
| 30 | + - Add optional `location` field to `CreateCollectionParams` |
| 31 | + - Add optional `location` field to `UpdateCollectionParams` (supports `null` to remove) |
| 32 | + - Update `CreateCollectionResult` to include optional `locationUri` field |
| 33 | + - Implement location handling in `createCollection()` - supports all three forms |
| 34 | + - Add tests for collection creation with StrongRef, string URI, and location object |
| 35 | + |
| 36 | + **Example Usage:** |
| 37 | + |
| 38 | + ```typescript |
| 39 | + // Create a project with location (StrongRef - direct reference) |
| 40 | + const project = await repo.hypercerts.createProject({ |
| 41 | + title: "Climate Initiative", |
| 42 | + items: [...], |
| 43 | + location: { uri: "at://did:plc:alice/app.certified.location/abc", cid: "bafy..." }, |
| 44 | + }); |
| 45 | + |
| 46 | + // Create with location (AT-URI string - fetches CID) |
| 47 | + const project2 = await repo.hypercerts.createProject({ |
| 48 | + title: "Forest Project", |
| 49 | + items: [...], |
| 50 | + location: "at://did:plc:bob/app.certified.location/xyz", |
| 51 | + }); |
| 52 | + |
| 53 | + // Create with location (location object - creates new record) |
| 54 | + const project3 = await repo.hypercerts.createProject({ |
| 55 | + title: "Ocean Project", |
| 56 | + items: [...], |
| 57 | + location: { |
| 58 | + lpVersion: "1.0", |
| 59 | + srs: "EPSG:4326", |
| 60 | + locationType: "coordinate-decimal", |
| 61 | + location: "37.7749, -122.4194", |
| 62 | + }, |
| 63 | + }); |
| 64 | + |
| 65 | + // Update project to change location |
| 66 | + await repo.hypercerts.updateProject(project.uri, { |
| 67 | + location: "at://did:plc:alice/app.certified.location/new", |
| 68 | + }); |
| 69 | + |
| 70 | + // Remove location |
| 71 | + await repo.hypercerts.updateProject(project.uri, { |
| 72 | + location: null, |
| 73 | + }); |
| 74 | + ``` |
| 75 | + |
3 | 76 | ## 0.10.0-beta.5 |
4 | 77 |
|
5 | 78 | ### Minor Changes |
|
0 commit comments