You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -73,9 +73,10 @@ A **MetaEnvelope** is the top-level container for an entity (post, user, message
73
73
Each field in a MetaEnvelope becomes a separate **Envelope** node in Neo4j:
74
74
75
75
-**id**: Unique identifier
76
-
-**ontology**: The field name from the ontology schema (e.g., "content", "authorId", "createdAt") - this identifies which field in the schema this envelope represents
76
+
-**fieldKey**: The field name from the payload (e.g., "content", "authorId", "createdAt") - this identifies which field in the payload this envelope represents
77
+
-**ontology**: Alias for fieldKey (kept for backward compatibility)
77
78
-**value**: The actual field value (string, number, object, array)
78
-
-**valueType**: Type of the value ("string", "number", "object", "array") - cached from the ontology schema for optimization purposes
79
+
-**valueType**: Type of the value ("string", "number", "object", "array")
79
80
80
81
### Storage Structure
81
82
@@ -97,75 +98,95 @@ This flat graph structure allows:
97
98
98
99
## GraphQL API
99
100
100
-
eVault exposes a GraphQL API at `/graphql` for all data operations.
101
+
eVault exposes a GraphQL API at `/graphql` for all data operations. All operations require the `X-ENAME` header to identify the eVault owner.
102
+
103
+
**Required Header for all operations:**
104
+
```http
105
+
X-ENAME: @user-a.w3id
106
+
```
101
107
102
108
### Queries
103
109
104
-
#### getMetaEnvelopeById
110
+
#### metaEnvelope
105
111
106
-
Retrieve a specific MetaEnvelope by its global ID.
-`search.term`: Search term to match against envelope values
172
+
-`search.caseSensitive`: Whether search is case-sensitive (default: false)
173
+
-`search.fields`: Specific field names to search within (optional)
174
+
-`search.mode`: `CONTAINS`, `STARTS_WITH`, or `EXACT` (default: CONTAINS)
145
175
146
-
Search MetaEnvelopes by content within a specific ontology. The `term` parameter performs case-sensitive text matching against the string values in any of the envelopes within MetaEnvelopes of the specified ontology. The search looks for the term within envelope values (not field names).
Create a new MetaEnvelope. Returns a structured payload with the created entity or errors.
164
185
165
186
**Mutation**:
166
187
```graphql
167
188
mutation {
168
-
storeMetaEnvelope(input: {
189
+
createMetaEnvelope(input: {
169
190
ontology: "550e8400-e29b-41d4-a716-446655440001"
170
191
payload: {
171
192
content: "Hello, world!"
@@ -179,56 +200,29 @@ mutation {
179
200
id
180
201
ontology
181
202
parsed
203
+
envelopes {
204
+
id
205
+
fieldKey
206
+
value
207
+
}
182
208
}
183
-
envelopes {
184
-
id
185
-
value
186
-
valueType
209
+
errors {
210
+
field
211
+
message
212
+
code
187
213
}
188
214
}
189
215
}
190
216
```
191
217
192
-
**Headers Required**:
193
-
-`X-ENAME`: The W3ID of the eVault owner (required)
194
-
-`Authorization: Bearer <token>`: Optional, but recommended for webhook delivery
195
-
196
-
**Response Structure**:
218
+
#### updateMetaEnvelope
197
219
198
-
The `envelopes` array in the response contains one envelope per field in the payload, where each envelope's `ontology` field contains the field name from the schema. For example, storing a post with `content`, `authorId`, and `createdAt` fields produces:
199
-
200
-
```json
201
-
{
202
-
"envelopes": [
203
-
{
204
-
"ontology": "content",
205
-
"value": "Hello, world!"
206
-
},
207
-
{
208
-
"ontology": "authorId",
209
-
"value": "..."
210
-
},
211
-
{
212
-
"ontology": "createdAt",
213
-
"value": "2025-01-24T10:00:00Z"
214
-
},
215
-
{
216
-
"ontology": "mediaUrls",
217
-
"value": []
218
-
}
219
-
],
220
-
"id": "9a84e965-2604-52bf-97a7-5c4f4151fea2"
221
-
}
222
-
```
223
-
224
-
#### updateMetaEnvelopeById
225
-
226
-
Update an existing MetaEnvelope.
220
+
Update an existing MetaEnvelope. Returns a structured payload with the updated entity or errors.
227
221
228
222
**Mutation**:
229
223
```graphql
230
224
mutation {
231
-
updateMetaEnvelopeById(
225
+
updateMetaEnvelope(
232
226
id: "global-id-123"
233
227
input: {
234
228
ontology: "550e8400-e29b-41d4-a716-446655440001"
@@ -244,21 +238,50 @@ mutation {
244
238
ontology
245
239
parsed
246
240
}
241
+
errors {
242
+
message
243
+
code
244
+
}
247
245
}
248
246
}
249
247
```
250
248
251
-
#### deleteMetaEnvelope
249
+
#### removeMetaEnvelope
252
250
253
-
Delete a MetaEnvelope and all its Envelopes.
251
+
Delete a MetaEnvelope and all its Envelopes. Returns a structured payload confirming deletion.
254
252
255
253
**Mutation**:
256
254
```graphql
257
255
mutation {
258
-
deleteMetaEnvelope(id: "global-id-123")
256
+
removeMetaEnvelope(id: "global-id-123") {
257
+
deletedId
258
+
success
259
+
errors {
260
+
message
261
+
code
262
+
}
263
+
}
259
264
}
260
265
```
261
266
267
+
### Legacy API
268
+
269
+
The following queries and mutations are preserved for backward compatibility but are considered legacy. New integrations should use the idiomatic API above.
270
+
271
+
#### Legacy Queries
272
+
273
+
-`getMetaEnvelopeById(id: String!)` - Use `metaEnvelope(id: ID!)` instead
274
+
-`findMetaEnvelopesByOntology(ontology: String!)` - Use `metaEnvelopes(filter: {ontologyId: ...})` instead
275
+
-`searchMetaEnvelopes(ontology: String!, term: String!)` - Use `metaEnvelopes(filter: {search: ...})` instead
276
+
-`getAllEnvelopes` - Returns all envelopes (no pagination)
277
+
278
+
#### Legacy Mutations
279
+
280
+
-`storeMetaEnvelope(input: MetaEnvelopeInput!)` - Use `createMetaEnvelope` instead
281
+
-`updateMetaEnvelopeById(id: String!, input: MetaEnvelopeInput!)` - Use `updateMetaEnvelope` instead
282
+
-`deleteMetaEnvelope(id: String!)` - Use `removeMetaEnvelope` instead (returns `Boolean!`)
283
+
-`updateEnvelopeValue(envelopeId: String!, newValue: JSON!)` - Update individual envelope value
284
+
262
285
## HTTP API
263
286
264
287
### /whois
@@ -451,26 +474,48 @@ The provisioning layer supports shared tenancy (multiple W3IDs can be provisione
**Response**: The eVault returns the created MetaEnvelope with a global ID that should be stored for future reference.
140
+
**Response**: The eVault returns a payload containing the created MetaEnvelope with a global ID (or errors if the operation failed). The ID should be stored for future reference.
137
141
138
142
**Implementation Notes**:
139
143
- Use any HTTP client library in your language (requests in Python, http in Go, fetch in JavaScript, etc.)
0 commit comments