Skip to content

Commit 0d250f3

Browse files
committed
feat: update to match lexicon updates for attachments and remove evidence.
1 parent b8ad8b3 commit 0d250f3

File tree

11 files changed

+673
-181
lines changed

11 files changed

+673
-181
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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+
```

packages/sdk-core/src/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ export type {
9191
OrganizationOperations,
9292
CreateHypercertParams,
9393
CreateHypercertResult,
94-
CreateHypercertEvidenceParams,
9594
CreateOrganizationParams,
9695
LocationParams,
9796
ContributionDetailsParams,
@@ -162,7 +161,7 @@ export type {
162161
BadgeResponse,
163162
FundingReceipt,
164163
// SDK-specific types
165-
HypercertEvidence,
164+
HypercertAttachment,
166165
HypercertImage,
167166
HypercertImageRecord,
168167
BlobRef,
@@ -171,6 +170,9 @@ export type {
171170
HypercertProjectWithMetadata,
172171
CreateProjectParams,
173172
UpdateProjectParams,
173+
CreateAttachmentParams,
174+
UpdateAttachmentParams,
175+
AttachmentParams,
174176
} from "./services/hypercerts/types.js";
175177

176178
// Re-export ATProto lexicon types

packages/sdk-core/src/lexicons.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,10 @@ export const HYPERCERT_COLLECTIONS = {
168168
EVALUATION: EVALUATION_NSID,
169169

170170
/**
171-
* Attachment record collection (formerly evidence).
172-
* @remarks Renamed from EVIDENCE in beta.13
171+
* Attachment record collection.
173172
*/
174173
ATTACHMENT: ATTACHMENT_NSID,
175174

176-
/**
177-
* @deprecated Use ATTACHMENT instead. Renamed in beta.13.
178-
*/
179-
EVIDENCE: ATTACHMENT_NSID,
180-
181175
/**
182176
* Collection record collection (groups of hypercerts).
183177
* Projects are now collections with type='project'.

packages/sdk-core/src/lexicons/sidecar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export async function attachSidecar(repo: Repository, params: AttachSidecarParam
168168
* This orchestrates the creation of a main record followed by one or more
169169
* sidecar records that reference it. This is useful for workflows like:
170170
* - Creating a project with multiple hypercert claims
171-
* - Creating a hypercert with evidence and evaluation records
171+
* - Creating a hypercert with attachments and evaluation records
172172
*
173173
* @param repo - The repository instance
174174
* @param params - Parameters including the main record and sidecar definitions

0 commit comments

Comments
 (0)