|
| 1 | +--- |
| 2 | +"@hypercerts-org/sdk-core": minor |
| 3 | +--- |
| 4 | + |
| 5 | +Rename evidence records to attachments and update schema to match lexicon changes |
| 6 | + |
| 7 | +**Breaking Changes:** |
| 8 | + |
| 9 | +**API Symbol Renames:** |
| 10 | + |
| 11 | +- `addEvidence()` → `addAttachment()` |
| 12 | +- `CreateHypercertEvidenceParams` → `CreateAttachmentParams` |
| 13 | +- `evidenceUris` → `attachmentUris` in create results |
| 14 | +- `evidenceAdded` → `attachmentAdded` event |
| 15 | +- Evidence type exports replaced with Attachment equivalents |
| 16 | + |
| 17 | +**Schema Field Changes:** |
| 18 | + |
| 19 | +**Subject Fields:** |
| 20 | + |
| 21 | +- `subjectUri` (string) → `subjects` (array of StrongRefs or a single uri or StrongRef) |
| 22 | +- `subject` (StrongRef) → `subjects` (array of StrongRefs or a single uri or StrongRef) |
| 23 | + |
| 24 | +**Content Fields:** |
| 25 | + |
| 26 | +- `content` (string | Blob) | Array<(string | Blob)> → `content` (required array of URI/Blob refs) |
| 27 | +- Content is now required and can be an array with multiple items or a single item. SDK will convert to an array |
| 28 | + |
| 29 | +**Removed Fields:** |
| 30 | + |
| 31 | +- `relationType` - removed from attachment schema |
| 32 | +- `contributors` - removed from attachment schema |
| 33 | +- `locations` - removed from attachment schema |
| 34 | + |
| 35 | +**Payload Mapping Examples:** |
| 36 | + |
| 37 | +```typescript |
| 38 | +// Old evidence payload |
| 39 | +{ |
| 40 | + subjectUri: "at://did:plc:abc/org.hypercerts.claim.activity/xyz", |
| 41 | + content: "https://example.com/report.pdf", |
| 42 | + title: "Report", |
| 43 | + relationType: "supports" |
| 44 | +} |
| 45 | + |
| 46 | +// New attachment payload |
| 47 | +{ |
| 48 | + subjects: "at://did:plc:abc/org.hypercerts.claim.activity/xyz", |
| 49 | + content: "https://example.com/report.pdf", |
| 50 | + title: "Report" |
| 51 | + // relationType removed |
| 52 | +} |
| 53 | +// or arrays: |
| 54 | +{ |
| 55 | + subjects: ["at://did:plc:abc/org.hypercerts.claim.activity/xyz", "at://did:plc:abc/org.hypercerts.claim.activity/zyx"] |
| 56 | + content: ["https://reportfile.com/pdf", File] |
| 57 | +} |
| 58 | +``` |
0 commit comments