@enbox/api 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/README.md +63 -0
  2. package/dist/browser.mjs +11 -28
  3. package/dist/browser.mjs.map +4 -4
  4. package/dist/esm/advanced.js +1 -1
  5. package/dist/esm/define-protocol.js +3 -3
  6. package/dist/esm/did-api.js +1 -1
  7. package/dist/esm/did-api.js.map +1 -1
  8. package/dist/esm/dwn-api.js +6 -6
  9. package/dist/esm/dwn-api.js.map +1 -1
  10. package/dist/esm/dwn-reader-api.js +2 -2
  11. package/dist/esm/enbox.js +205 -0
  12. package/dist/esm/enbox.js.map +1 -0
  13. package/dist/esm/index.js +16 -15
  14. package/dist/esm/index.js.map +1 -1
  15. package/dist/esm/protocol.js +2 -2
  16. package/dist/esm/protocol.js.map +1 -1
  17. package/dist/esm/record-data.js +79 -5
  18. package/dist/esm/record-data.js.map +1 -1
  19. package/dist/esm/record.js +49 -10
  20. package/dist/esm/record.js.map +1 -1
  21. package/dist/esm/repository.js +7 -7
  22. package/dist/esm/repository.js.map +1 -1
  23. package/dist/esm/typed-enbox.js +583 -0
  24. package/dist/esm/typed-enbox.js.map +1 -0
  25. package/dist/esm/typed-live-query.js +1 -1
  26. package/dist/esm/typed-record.js +370 -46
  27. package/dist/esm/typed-record.js.map +1 -1
  28. package/dist/esm/utils.js +25 -0
  29. package/dist/esm/utils.js.map +1 -1
  30. package/dist/esm/vc-api.js.map +1 -1
  31. package/dist/types/advanced.d.ts +1 -1
  32. package/dist/types/define-protocol.d.ts +3 -3
  33. package/dist/types/did-api.d.ts +4 -4
  34. package/dist/types/did-api.d.ts.map +1 -1
  35. package/dist/types/dwn-api.d.ts +12 -7
  36. package/dist/types/dwn-api.d.ts.map +1 -1
  37. package/dist/types/dwn-reader-api.d.ts +2 -2
  38. package/dist/types/enbox.d.ts +202 -0
  39. package/dist/types/enbox.d.ts.map +1 -0
  40. package/dist/types/grant-revocation.d.ts +2 -2
  41. package/dist/types/grant-revocation.d.ts.map +1 -1
  42. package/dist/types/index.d.ts +16 -15
  43. package/dist/types/index.d.ts.map +1 -1
  44. package/dist/types/live-query.d.ts +2 -2
  45. package/dist/types/live-query.d.ts.map +1 -1
  46. package/dist/types/permission-grant.d.ts +2 -2
  47. package/dist/types/permission-grant.d.ts.map +1 -1
  48. package/dist/types/permission-request.d.ts +2 -2
  49. package/dist/types/permission-request.d.ts.map +1 -1
  50. package/dist/types/protocol-types.d.ts +2 -2
  51. package/dist/types/protocol.d.ts +7 -7
  52. package/dist/types/protocol.d.ts.map +1 -1
  53. package/dist/types/record-data.d.ts +17 -0
  54. package/dist/types/record-data.d.ts.map +1 -1
  55. package/dist/types/record.d.ts +24 -10
  56. package/dist/types/record.d.ts.map +1 -1
  57. package/dist/types/repository-types.d.ts +19 -11
  58. package/dist/types/repository-types.d.ts.map +1 -1
  59. package/dist/types/repository.d.ts +7 -7
  60. package/dist/types/repository.d.ts.map +1 -1
  61. package/dist/types/typed-enbox.d.ts +613 -0
  62. package/dist/types/typed-enbox.d.ts.map +1 -0
  63. package/dist/types/typed-live-query.d.ts +1 -1
  64. package/dist/types/typed-record.d.ts +427 -53
  65. package/dist/types/typed-record.d.ts.map +1 -1
  66. package/dist/types/utils.d.ts +23 -0
  67. package/dist/types/utils.d.ts.map +1 -1
  68. package/dist/types/vc-api.d.ts +3 -3
  69. package/dist/types/vc-api.d.ts.map +1 -1
  70. package/package.json +12 -11
  71. package/src/advanced.ts +1 -1
  72. package/src/define-protocol.ts +3 -3
  73. package/src/did-api.ts +5 -5
  74. package/src/dwn-api.ts +22 -17
  75. package/src/dwn-reader-api.ts +2 -2
  76. package/src/enbox.ts +281 -0
  77. package/src/grant-revocation.ts +3 -3
  78. package/src/index.ts +17 -16
  79. package/src/live-query.ts +2 -2
  80. package/src/permission-grant.ts +4 -4
  81. package/src/permission-request.ts +3 -3
  82. package/src/protocol-types.ts +2 -2
  83. package/src/protocol.ts +8 -8
  84. package/src/record-data.ts +86 -5
  85. package/src/record.ts +54 -13
  86. package/src/repository-types.ts +19 -7
  87. package/src/repository.ts +15 -15
  88. package/src/typed-enbox.ts +1169 -0
  89. package/src/typed-live-query.ts +1 -1
  90. package/src/typed-record.ts +431 -53
  91. package/src/utils.ts +27 -0
  92. package/src/vc-api.ts +4 -4
  93. package/dist/esm/typed-web5.js +0 -339
  94. package/dist/esm/typed-web5.js.map +0 -1
  95. package/dist/esm/web5.js +0 -410
  96. package/dist/esm/web5.js.map +0 -1
  97. package/dist/types/typed-web5.d.ts +0 -221
  98. package/dist/types/typed-web5.d.ts.map +0 -1
  99. package/dist/types/web5.d.ts +0 -346
  100. package/dist/types/web5.d.ts.map +0 -1
  101. package/src/typed-web5.ts +0 -598
  102. package/src/web5.ts +0 -754
@@ -11,14 +11,29 @@
11
11
  * - `.data.json()` returns `Promise<T>` instead of `Promise<unknown>`.
12
12
  * - `.update({ data })` accepts `Partial<T>` for the data payload.
13
13
  *
14
+ * You never construct `TypedRecord` directly — instances are returned by
15
+ * {@link TypedEnbox} methods such as `records.create()`, `records.query()`,
16
+ * `records.read()`, and `records.subscribe()`.
17
+ *
18
+ * @typeParam T - The TypeScript type of the record's data payload, resolved
19
+ * from the protocol's schema map at the given protocol path.
20
+ *
14
21
  * @example
15
22
  * ```ts
16
- * const { record } = await typed.records.write('friend', {
23
+ * const { record } = await proto.records.create('friend', {
17
24
  * data: { did: 'did:example:alice', alias: 'Alice' },
18
25
  * });
19
26
  *
20
27
  * // record is TypedRecord<FriendData>
21
28
  * const data = await record.data.json(); // FriendData — no manual cast
29
+ *
30
+ * // Update preserves the type
31
+ * const { record: updated } = await record.update({
32
+ * data: { alias: 'Ali' }, // Partial<FriendData>
33
+ * });
34
+ *
35
+ * // Send to the remote DWN
36
+ * await updated.send();
22
37
  * ```
23
38
  */
24
39
  import type { Record } from './record.js';
@@ -32,148 +47,507 @@ import type { DwnInterface } from '@enbox/agent';
32
47
  *
33
48
  * All other methods (`blob`, `bytes`, `text`, `stream`, `then`, `catch`)
34
49
  * are forwarded unchanged from the underlying {@link RecordData}.
50
+ *
51
+ * @typeParam T - The TypeScript type returned by {@link TypedRecordData.json | json()}.
52
+ *
53
+ * @example
54
+ * ```ts
55
+ * const { record } = await proto.records.read('notebook', {
56
+ * filter: { recordId: notebookId },
57
+ * });
58
+ *
59
+ * const payload = await record.data.json(); // Promise<NotebookData>
60
+ * const raw = await record.data.text(); // Promise<string>
61
+ * const blob = await record.data.blob(); // Promise<Blob>
62
+ * const stream = await record.data.stream(); // Promise<ReadableStream>
63
+ * ```
35
64
  */
36
65
  export type TypedRecordData<T> = Omit<RecordData, 'json'> & {
37
- /** Parse the data as JSON, returning the typed data shape `T`. */
66
+ /**
67
+ * Parse the record's data as JSON, returning the typed data shape `T`.
68
+ *
69
+ * @returns A promise resolving to the record's data payload typed as `T`.
70
+ * @throws If the data is not valid JSON or the record has been deleted.
71
+ */
38
72
  json: () => Promise<T>;
39
73
  };
40
74
  /**
41
75
  * Update parameters for a {@link TypedRecord}.
42
76
  *
43
- * Extends the base `RecordUpdateParams` but narrows `data` from `unknown`
44
- * to `Partial<T>`.
77
+ * Extends the base {@link RecordUpdateParams} but narrows `data` from
78
+ * `unknown` to `Partial<T>`, providing compile-time type safety when
79
+ * updating record payloads.
80
+ *
81
+ * @typeParam T - The full data type of the record being updated.
82
+ *
83
+ * @example
84
+ * ```ts
85
+ * await record.update({
86
+ * data: { title: 'Updated title' }, // Partial<NotebookData>
87
+ * tags: { category: 'work' },
88
+ * });
89
+ * ```
45
90
  */
46
91
  export type TypedRecordUpdateParams<T> = Omit<RecordUpdateParams, 'data'> & {
47
- /** The new data for the record. Type-checked against the schema map. */
92
+ /**
93
+ * The new data for the record. Type-checked against the schema map as
94
+ * `Partial<T>`, so you only need to supply the fields you want to change.
95
+ */
48
96
  data?: Partial<T>;
49
97
  };
50
98
  /**
51
99
  * Result of a {@link TypedRecord.update} operation.
100
+ *
101
+ * Includes the DWN response status (`status.code` / `status.detail`) and
102
+ * the updated record, which carries the same type parameter `T` so
103
+ * subsequent reads remain type-safe.
104
+ *
105
+ * @typeParam T - The data type of the record.
52
106
  */
53
107
  export type TypedRecordUpdateResult<T> = DwnResponseStatus & {
54
- /** The updated record, carrying the same type parameter. */
108
+ /**
109
+ * The updated record, carrying the same type parameter `T`.
110
+ *
111
+ * This is a **new** {@link TypedRecord} instance reflecting the post-update
112
+ * state. The original record instance is also mutated in-place, so both
113
+ * references see the updated data.
114
+ */
55
115
  record: TypedRecord<T>;
56
116
  };
57
117
  /**
58
118
  * Result of a {@link TypedRecord.delete} operation.
119
+ *
120
+ * Includes the DWN response status and the record in its deleted state.
121
+ * The original record instance is also mutated in-place, so both
122
+ * references reflect the deletion.
123
+ *
124
+ * @typeParam T - The data type of the record.
59
125
  */
60
126
  export type TypedRecordDeleteResult<T> = DwnResponseStatus & {
61
- /** The deleted record, carrying the same type parameter. */
127
+ /**
128
+ * The record in its deleted state. The {@link TypedRecord.deleted} getter
129
+ * will return `true`, and data accessors will throw.
130
+ */
62
131
  record: TypedRecord<T>;
63
132
  };
64
133
  /**
65
134
  * A type-safe wrapper around {@link Record} that preserves the data type `T`.
66
135
  *
67
- * Obtain instances through `TypedWeb5.records.write()`, `.query()`, `.read()`,
68
- * or `.subscribe()` — never construct directly.
136
+ * Obtain instances through {@link TypedEnbox} methods — `records.create()`,
137
+ * `records.query()`, `records.read()`, or `records.subscribe()` — never
138
+ * construct directly.
139
+ *
140
+ * @typeParam T - The TypeScript type of the record's data payload. This type
141
+ * is inferred automatically from the protocol's schema map and the protocol
142
+ * path used when creating or querying the record.
143
+ *
144
+ * @example
145
+ * ```ts
146
+ * // TypedRecord instances are returned by TypedEnbox methods:
147
+ * const { record } = await proto.records.create('notebook', {
148
+ * data: { name: 'My Notebook' },
149
+ * });
150
+ *
151
+ * // Access metadata
152
+ * console.log(record.id); // unique record ID
153
+ * console.log(record.contextId); // context ID for hierarchical grouping
154
+ * console.log(record.dateCreated); // ISO 8601 creation timestamp
155
+ * console.log(record.timestamp); // ISO 8601 last-update timestamp
156
+ * console.log(record.tags); // key-value metadata tags
157
+ *
158
+ * // Type-safe data access
159
+ * const data = await record.data.json(); // NotebookData
160
+ *
161
+ * // Lifecycle
162
+ * await record.send(); // push to remote DWN
163
+ * await record.update({ data: { name: 'Renamed' } });
164
+ * await record.delete();
165
+ * ```
69
166
  */
70
167
  export declare class TypedRecord<T> {
71
- /** The underlying untyped Record instance. */
168
+ /** @internal The underlying untyped Record instance. */
72
169
  private _record;
170
+ /**
171
+ * @internal Wrap an untyped {@link Record} in a type-safe shell.
172
+ * @param record - The underlying `Record` instance to wrap.
173
+ */
73
174
  constructor(record: Record);
74
- /** Access the underlying untyped {@link Record} for advanced use cases. */
175
+ /**
176
+ * Access the underlying untyped {@link Record} for advanced use cases.
177
+ *
178
+ * Use this escape hatch when you need to call `Record` methods or access
179
+ * properties that are not surfaced by the typed wrapper.
180
+ *
181
+ * @returns The wrapped {@link Record} instance.
182
+ */
75
183
  get rawRecord(): Record;
76
184
  /**
77
- * Returns the data of the current record with type-safe accessors.
185
+ * Returns the record's data with type-safe accessors.
78
186
  *
79
- * The `json()` method returns `Promise<T>` no manual generic needed.
187
+ * The returned object provides multiple ways to consume the data:
80
188
  *
189
+ * | Method | Return type | Description |
190
+ * |------------|--------------------------|--------------------------------------|
191
+ * | `json()` | `Promise<T>` | Parse as JSON with full type safety |
192
+ * | `text()` | `Promise<string>` | Raw UTF-8 text |
193
+ * | `blob()` | `Promise<Blob>` | Binary blob (respects `dataFormat`) |
194
+ * | `bytes()` | `Promise<Uint8Array>` | Raw bytes |
195
+ * | `stream()` | `Promise<ReadableStream>`| Web `ReadableStream` for streaming |
196
+ *
197
+ * The object is also directly awaitable (returns the stream).
198
+ *
199
+ * @returns A {@link TypedRecordData} accessor whose `json()` returns `Promise<T>`.
81
200
  * @throws `Error` if the record has been deleted.
201
+ *
202
+ * @example
203
+ * ```ts
204
+ * const { record } = await proto.records.read('notebook', {
205
+ * filter: { recordId },
206
+ * });
207
+ *
208
+ * const notebook = await record.data.json(); // NotebookData
209
+ * const raw = await record.data.text(); // string
210
+ * ```
82
211
  */
83
212
  get data(): TypedRecordData<T>;
84
213
  /**
85
- * Update the current record on the DWN.
214
+ * Update the current record's data and/or metadata on the DWN.
215
+ *
216
+ * The `data` field accepts `Partial<T>`, so you only need to provide
217
+ * the fields you want to change. A new {@link TypedRecord} is returned
218
+ * **and** the original instance is mutated in-place, so both the returned
219
+ * record and the original reference reflect the updated state.
86
220
  *
87
- * @param params - Parameters including the typed `data` payload.
88
- * @returns The status and an updated {@link TypedRecord}.
221
+ * @param params - Update parameters. `data` is type-checked as `Partial<T>`.
222
+ * Other fields like `tags`, `published`, and `datePublished` can also be
223
+ * updated.
224
+ * @returns A {@link TypedRecordUpdateResult} containing the DWN response
225
+ * `status` and the updated {@link TypedRecord}.
89
226
  * @throws `Error` if the record has been deleted.
227
+ *
228
+ * @example
229
+ * ```ts
230
+ * const { status, record: updated } = await record.update({
231
+ * data: { title: 'New Title' }, // Partial<PageData>
232
+ * tags: { priority: 'high' },
233
+ * });
234
+ *
235
+ * if (status.code === 202) {
236
+ * await updated.send(); // push update to remote
237
+ * }
238
+ * ```
90
239
  */
91
240
  update(params: TypedRecordUpdateParams<T>): Promise<TypedRecordUpdateResult<T>>;
92
241
  /**
93
- * Delete the current record on the DWN.
242
+ * Delete the current record from the DWN.
243
+ *
244
+ * After deletion, **both** the returned record and the original instance's
245
+ * {@link TypedRecord.deleted | deleted} property will be `true`, and
246
+ * calling data accessors on either will throw.
247
+ *
248
+ * @param params - Optional delete parameters:
249
+ * - `store` — whether to persist the delete message (defaults to `true`).
250
+ * - `prune` — whether to also delete child records.
251
+ * - `signAsOwner` — sign the delete as the DWN owner (for imports).
252
+ * @returns A {@link TypedRecordDeleteResult} containing the DWN response
253
+ * `status` and the record in its deleted state.
94
254
  *
95
- * @param params - Delete parameters.
96
- * @returns The status and a {@link TypedRecord} reflecting the deleted state.
255
+ * @example
256
+ * ```ts
257
+ * const { status } = await record.delete({ prune: true });
258
+ * if (status.code === 202) {
259
+ * console.log('Record and children deleted');
260
+ * }
261
+ * ```
97
262
  */
98
263
  delete(params?: RecordDeleteParams): Promise<TypedRecordDeleteResult<T>>;
99
264
  /**
100
- * Stores the current record state to the owner's DWN.
265
+ * Stores the current record state to the local DWN.
101
266
  *
102
- * @param importRecord - If true, sign as owner before storing. Defaults to false.
267
+ * Call this after creating a record with `store: false` or after
268
+ * receiving a record from a remote DWN that you want to persist locally.
269
+ *
270
+ * @param importRecord - If `true`, sign the record as the DWN owner
271
+ * before storing (useful for importing records authored by others).
272
+ * Defaults to `false`.
273
+ * @returns The DWN response status.
103
274
  */
104
275
  store(importRecord?: boolean): Promise<DwnResponseStatus>;
105
276
  /**
106
- * Signs and optionally stores the record to the owner's DWN.
107
- * Useful when importing a record signed by someone else.
277
+ * Signs the record as the DWN owner and optionally stores it.
278
+ *
279
+ * Use this when importing a record authored/signed by another DID into
280
+ * your own DWN. The record will be re-signed under your identity.
108
281
  *
109
- * @param store - If true, store after signing. Defaults to true.
282
+ * @param store - If `true`, persist the record after signing.
283
+ * Defaults to `true`.
284
+ * @returns The DWN response status.
110
285
  */
111
286
  import(store?: boolean): Promise<DwnResponseStatus>;
112
287
  /**
113
- * Send the current record to a remote DWN.
288
+ * Push the current record to a remote DWN.
289
+ *
290
+ * This sends the record (including its data) to the specified remote
291
+ * DWN. Use this after `create`, `update`, or `delete` to sync changes
292
+ * with the remote node.
293
+ *
294
+ * @param target - The DID of the remote DWN to send to. If omitted,
295
+ * defaults to the DID of the currently connected identity.
296
+ * @returns The DWN response status from the remote node.
297
+ *
298
+ * @example
299
+ * ```ts
300
+ * const { record } = await proto.records.create('notebook', {
301
+ * data: { name: 'Travel Notes' },
302
+ * });
114
303
  *
115
- * @param target - Optional DID of the target DWN. Defaults to the connected DID.
304
+ * // Push to your own remote DWN
305
+ * await record.send();
306
+ *
307
+ * // Or push to another user's DWN
308
+ * await record.send('did:example:bob');
309
+ * ```
116
310
  */
117
311
  send(target?: string): Promise<DwnResponseStatus>;
118
312
  /**
119
- * Returns a JSON representation of the Record instance.
313
+ * Returns a JSON-serializable representation of the record's metadata.
314
+ *
315
+ * Useful for logging, debugging, or serializing the record's state.
316
+ * Does **not** include the record's data payload — use {@link TypedRecord.data | data}
317
+ * accessors for that.
318
+ *
319
+ * @returns A {@link RecordModel} containing the record's metadata fields.
120
320
  */
121
321
  toJSON(): RecordModel;
122
322
  /**
123
- * Returns a string representation of the Record instance.
323
+ * Returns a human-readable string representation of the record.
324
+ *
325
+ * @returns A string summary of the record (delegates to the underlying Record).
124
326
  */
125
327
  toString(): string;
126
328
  /**
127
- * Returns a pagination cursor for the current record given a sort order.
329
+ * Returns a pagination cursor anchored at this record for the given sort
330
+ * order.
331
+ *
332
+ * Pass the returned cursor to a subsequent `query()` call's
333
+ * `pagination.cursor` to resume pagination from this record.
334
+ *
335
+ * @param sort - The date-sort order to use for cursor positioning
336
+ * (e.g. `DateSort.CreatedAscending`).
337
+ * @returns A pagination cursor, or `undefined` if the record cannot
338
+ * produce one.
128
339
  */
129
340
  paginationCursor(sort: DwnDateSort): Promise<DwnPaginationCursor | undefined>;
130
- /** Record's ID. */
341
+ /**
342
+ * The record's unique identifier.
343
+ *
344
+ * This is a stable, globally unique ID assigned when the record is first
345
+ * created. It does not change across updates or deletes.
346
+ */
131
347
  get id(): string;
132
- /** Record's context ID. */
348
+ /**
349
+ * The context ID used to group hierarchical records.
350
+ *
351
+ * When a record is created as a child (using `parentContextId`), the DWN
352
+ * assigns a `contextId` that links all records in the same hierarchy.
353
+ * Use this value as the `parentContextId` when creating child records,
354
+ * or as a `parentId` filter when querying for children.
355
+ *
356
+ * @returns The context ID string, or `undefined` if the record is not
357
+ * part of a hierarchical context.
358
+ *
359
+ * @example
360
+ * ```ts
361
+ * const { record: notebook } = await proto.records.create('notebook', {
362
+ * data: { name: 'My Notebook' },
363
+ * });
364
+ *
365
+ * // Create a child page under the notebook's context
366
+ * const { record: page } = await proto.records.create('notebook/page', {
367
+ * data: { title: 'Page 1' },
368
+ * parentContextId: notebook.contextId,
369
+ * });
370
+ * ```
371
+ */
133
372
  get contextId(): string | undefined;
134
- /** Record's creation date. */
373
+ /**
374
+ * ISO 8601 timestamp of when the record was first created.
375
+ *
376
+ * This value is immutable and never changes, even when the record is
377
+ * updated or deleted. For the timestamp of the most recent mutation,
378
+ * use {@link TypedRecord.timestamp | timestamp}.
379
+ */
135
380
  get dateCreated(): string;
136
- /** Record's parent ID. */
381
+ /**
382
+ * The parent record's ID, if this record was created as a child.
383
+ *
384
+ * @returns The parent's record ID, or `undefined` for top-level records.
385
+ */
137
386
  get parentId(): string | undefined;
138
- /** Record's protocol. */
387
+ /**
388
+ * The protocol URI this record belongs to.
389
+ *
390
+ * @returns The protocol URI string (e.g. `'https://example.com/social'`),
391
+ * or `undefined` if the record is not protocol-scoped.
392
+ */
139
393
  get protocol(): string | undefined;
140
- /** Record's protocol path. */
394
+ /**
395
+ * The protocol path of this record within the protocol's structure.
396
+ *
397
+ * For example, `'notebook'` or `'notebook/page'`. This identifies which
398
+ * type definition in the protocol structure governs this record.
399
+ */
141
400
  get protocolPath(): string | undefined;
142
- /** Record's recipient. */
401
+ /**
402
+ * The DID of the intended recipient of this record.
403
+ *
404
+ * @returns The recipient's DID string, or `undefined` if no specific
405
+ * recipient was set.
406
+ */
143
407
  get recipient(): string | undefined;
144
- /** Record's schema. */
408
+ /**
409
+ * The schema URI associated with this record's type in the protocol
410
+ * definition.
411
+ *
412
+ * @returns The schema URI string, or `undefined` if the type has no schema.
413
+ */
145
414
  get schema(): string | undefined;
146
- /** Record's data format. */
415
+ /**
416
+ * The MIME type / data format of the record's payload.
417
+ *
418
+ * Typically `'application/json'` for structured data, but can be any
419
+ * MIME type supported by the protocol definition's `dataFormats` array.
420
+ */
147
421
  get dataFormat(): string | undefined;
148
- /** Record's data CID. */
422
+ /**
423
+ * The Content Identifier (CID) of the record's data.
424
+ *
425
+ * This is a content-addressable hash of the data payload, useful for
426
+ * verifying data integrity.
427
+ */
149
428
  get dataCid(): string | undefined;
150
- /** Record's data size. */
429
+ /**
430
+ * The size of the record's data payload in bytes.
431
+ */
151
432
  get dataSize(): number | undefined;
152
- /** Record's published date. */
433
+ /**
434
+ * ISO 8601 timestamp of when the record was published.
435
+ *
436
+ * Only present if the record has been explicitly published
437
+ * (i.e. `published: true` was set during create or update).
438
+ */
153
439
  get datePublished(): string | undefined;
154
- /** Record's published status. */
440
+ /**
441
+ * Whether the record is publicly published.
442
+ *
443
+ * Published records can be read by anyone without authorization.
444
+ * `undefined` if the published state was never explicitly set.
445
+ */
155
446
  get published(): boolean | undefined;
156
- /** Tags of the record. */
447
+ /**
448
+ * Key-value metadata tags attached to the record.
449
+ *
450
+ * Tags are indexed by the DWN and can be used in query filters for
451
+ * efficient lookups. Values can be strings, numbers, booleans, or
452
+ * arrays of strings/numbers.
453
+ *
454
+ * @returns The tags object, or `undefined` if no tags are set.
455
+ *
456
+ * @example
457
+ * ```ts
458
+ * // Query records by tag
459
+ * const { records } = await proto.records.query('notebook', {
460
+ * filter: { tags: { category: 'work' } },
461
+ * });
462
+ *
463
+ * // Read tags from a record
464
+ * const tags = record.tags; // { category: 'work', priority: 1 }
465
+ * ```
466
+ */
157
467
  get tags(): DwnMessage[DwnInterface.RecordsWrite]['descriptor']['tags'] | undefined;
158
- /** DID that is the logical author of the Record. */
468
+ /**
469
+ * The DID of the logical author of this record.
470
+ *
471
+ * For records you create, this is your own DID. For records written by
472
+ * others (e.g. received via a protocol role), this is the signer's DID.
473
+ */
159
474
  get author(): string;
160
- /** DID that is the original creator of the Record. */
475
+ /**
476
+ * The DID of the original creator of this record.
477
+ *
478
+ * Unlike {@link TypedRecord.author | author}, which reflects the current
479
+ * message signer (and may change on updates), `creator` always refers
480
+ * to the DID that authored the initial write.
481
+ */
161
482
  get creator(): string;
162
- /** Record's message timestamp. */
483
+ /**
484
+ * ISO 8601 timestamp of the record's most recent message (create, update,
485
+ * or delete).
486
+ *
487
+ * This value changes with every mutation. For the original creation time,
488
+ * use {@link TypedRecord.dateCreated | dateCreated}.
489
+ *
490
+ * **Note:** There is no `.dateModified` property — use `timestamp` to
491
+ * determine when the record was last changed.
492
+ */
163
493
  get timestamp(): string;
164
- /** Record's encryption details. */
494
+ /**
495
+ * Encryption metadata for the record, if it was encrypted.
496
+ *
497
+ * Contains the algorithm, key encryption details, and initialization
498
+ * vectors used to encrypt the record's data. `undefined` for
499
+ * unencrypted records.
500
+ */
165
501
  get encryption(): DwnMessage[DwnInterface.RecordsWrite]['encryption'];
166
- /** Record's authorization. */
502
+ /**
503
+ * The authorization signature(s) for the current record message.
504
+ *
505
+ * Contains the JWS (JSON Web Signature) proving the message was
506
+ * authorized by the author.
507
+ */
167
508
  get authorization(): DwnMessage[DwnInterface.RecordsWrite | DwnInterface.RecordsDelete]['authorization'];
168
- /** Record's attestation. */
509
+ /**
510
+ * Optional attestation signature(s) for the record.
511
+ *
512
+ * Attestations are additional signatures (beyond the author's
513
+ * authorization) that vouch for the record's content.
514
+ *
515
+ * @returns The attestation JWS, or `undefined` if none is present.
516
+ */
169
517
  get attestation(): DwnMessage[DwnInterface.RecordsWrite]['attestation'] | undefined;
170
- /** Role under which the author is writing the record. */
518
+ /**
519
+ * The protocol role under which this record was written.
520
+ *
521
+ * When a record is created with a `protocolRole`, the DWN checks that
522
+ * the author is authorized to write under that role per the protocol's
523
+ * `$actions` rules.
524
+ *
525
+ * @returns The role string (e.g. `'admin'`, `'member'`), or `undefined`
526
+ * if no role was specified.
527
+ */
171
528
  get protocolRole(): string | undefined;
172
- /** Record's deleted state. */
529
+ /**
530
+ * Whether the record has been deleted.
531
+ *
532
+ * Once `true`, data accessors (`data.json()`, etc.) will throw. The
533
+ * record's metadata (ID, timestamps, etc.) remains accessible.
534
+ */
173
535
  get deleted(): boolean;
174
- /** Record's initial write if the record has been updated. */
536
+ /**
537
+ * The initial `RecordsWrite` message for this record, if it has been
538
+ * updated at least once.
539
+ *
540
+ * The DWN preserves the initial write message to allow other nodes to
541
+ * verify the full history chain. For records that have never been
542
+ * updated, this is `undefined`.
543
+ */
175
544
  get initialWrite(): DwnMessage[DwnInterface.RecordsWrite] | undefined;
176
- /** The raw DWN message backing this record. */
545
+ /**
546
+ * The raw DWN message backing this record's current state.
547
+ *
548
+ * This is the full, unprocessed DWN message — either a `RecordsWrite`
549
+ * or `RecordsDelete` message depending on the record's state.
550
+ */
177
551
  get rawMessage(): DwnMessage[DwnInterface.RecordsWrite] | DwnMessage[DwnInterface.RecordsDelete];
178
552
  }
179
553
  //# sourceMappingURL=typed-record.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"typed-record.d.ts","sourceRoot":"","sources":["../../src/typed-record.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACpG,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE7F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAMjD;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG;IAC1D,kEAAkE;IAClE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC;CACxB,CAAC;AAMF;;;;;GAKG;AACH,MAAM,MAAM,uBAAuB,CAAC,CAAC,IAAI,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,GAAG;IAC1E,wEAAwE;IACxE,IAAI,CAAC,EAAE,OAAO,CAAC,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AG,SAAS,CAAmC;IAE9E;;;;;;;;;;;;;;;;;;;OAmBG;IACH,IAAW,IAAI,IAAI,UAAU,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,GAAG,SAAS,CAEzF;IAMD;;;;;OAKG;IACH,IAAW,MAAM,IAAI,MAAM,CAAgC;IAE3D;;;;;;OAMG;IACH,IAAW,OAAO,IAAI,MAAM,CAAiC;IAE7D;;;;;;;;;OASG;IACH,IAAW,SAAS,IAAI,MAAM,CAAmC;IAEjE;;;;;;OAMG;IACH,IAAW,UAAU,IAAI,UAAU,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,YAAY,CAAC,CAE3E;IAED;;;;;OAKG;IACH,IAAW,aAAa,IAAI,UAAU,CAAC,YAAY,CAAC,YAAY,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC,eAAe,CAAC,CAE9G;IAED;;;;;;;OAOG;IACH,IAAW,WAAW,IAAI,UAAU,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,aAAa,CAAC,GAAG,SAAS,CAEzF;IAED;;;;;;;;;OASG;IACH,IAAW,YAAY,IAAI,MAAM,GAAG,SAAS,CAAsC;IAEnF;;;;;OAKG;IACH,IAAW,OAAO,IAAI,OAAO,CAAiC;IAE9D;;;;;;;OAOG;IACH,IAAW,YAAY,IAAI,UAAU,CAAC,YAAY,CAAC,YAAY,CAAC,GAAG,SAAS,CAE3E;IAED;;;;;OAKG;IACH,IAAW,UAAU,IAAI,UAAU,CAAC,YAAY,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC,YAAY,CAAC,aAAa,CAAC,CAEtG;CACF"}
@@ -1,3 +1,26 @@
1
+ import type { DwnResponseStatus } from '@enbox/agent';
2
+ /**
3
+ * Returns `true` if the DWN response status indicates success (2xx code).
4
+ *
5
+ * Use this instead of manually checking `status.code >= 200 && status.code <= 299`
6
+ * on every API call.
7
+ *
8
+ * @param response - Any object that conforms to {@link DwnResponseStatus}.
9
+ * @returns `true` for 2xx status codes, `false` otherwise.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const result = await proto.records.create('note', { data: { text: 'hello' } });
14
+ * if (!isOk(result)) {
15
+ * console.error('Create failed:', result.status.detail);
16
+ * return;
17
+ * }
18
+ * // result.record is safe to use here
19
+ * ```
20
+ *
21
+ * @beta
22
+ */
23
+ export declare function isOk(response: DwnResponseStatus): boolean;
1
24
  /**
2
25
  * Converts various data types to a `Blob` object, automatically detecting the data type or using
3
26
  * the specified `dataFormat` to set the Blob's MIME type.
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG;IAC1D,+CAA+C;IAC/C,QAAQ,EAAE,IAAI,CAAC;IACf,iCAAiC;IACjC,UAAU,EAAE,MAAM,CAAC;CACpB,CA8BA;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,SAAS;IACpB;;;MAGE;IACF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAkC;IAEtD;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc,CAAO;IAEpC;;;;;;;OAOG;WACW,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO;IAKxD;;;;;;;OAOG;WACW,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;CAepD"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGtD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,IAAI,CAAC,QAAQ,EAAE,iBAAiB,GAAG,OAAO,CAGzD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG;IAC1D,+CAA+C;IAC/C,QAAQ,EAAE,IAAI,CAAC;IACf,iCAAiC;IACjC,UAAU,EAAE,MAAM,CAAC;CACpB,CA8BA;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,SAAS;IACpB;;;MAGE;IACF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAkC;IAEtD;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc,CAAO;IAEpC;;;;;;;OAOG;WACW,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO;IAKxD;;;;;;;OAOG;WACW,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;CAepD"}
@@ -1,4 +1,4 @@
1
- import type { Web5Agent } from '@enbox/agent';
1
+ import type { EnboxAgent } from '@enbox/agent';
2
2
  /**
3
3
  * The VC API is used to issue, present and verify VCs
4
4
  *
@@ -6,14 +6,14 @@ import type { Web5Agent } from '@enbox/agent';
6
6
  */
7
7
  export declare class VcApi {
8
8
  /**
9
- * Holds the instance of a {@link Web5Agent} that represents the current execution context for
9
+ * Holds the instance of a {@link EnboxAgent} that represents the current execution context for
10
10
  * the `VcApi`. This agent is used to process VC requests.
11
11
  */
12
12
  private agent;
13
13
  /** The DID of the tenant under which DID operations are being performed. */
14
14
  private connectedDid;
15
15
  constructor(options: {
16
- agent: Web5Agent;
16
+ agent: EnboxAgent;
17
17
  connectedDid: string;
18
18
  });
19
19
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"vc-api.d.ts","sourceRoot":"","sources":["../../src/vc-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C;;;;GAIG;AACH,qBAAa,KAAK;IAChB;;;OAGG;IACH,OAAO,CAAC,KAAK,CAAY;IAEzB,4EAA4E;IAC5E,OAAO,CAAC,YAAY,CAAS;gBAEjB,OAAO,EAAE;QAAE,KAAK,EAAE,SAAS,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE;IAK/D;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;CAI9B"}
1
+ {"version":3,"file":"vc-api.d.ts","sourceRoot":"","sources":["../../src/vc-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;;;GAIG;AACH,qBAAa,KAAK;IAChB;;;OAGG;IACH,OAAO,CAAC,KAAK,CAAa;IAE1B,4EAA4E;IAC5E,OAAO,CAAC,YAAY,CAAS;gBAEjB,OAAO,EAAE;QAAE,KAAK,EAAE,UAAU,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE;IAKhE;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;CAI9B"}