@enbox/api 0.1.1 → 0.2.1

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 (58) hide show
  1. package/README.md +505 -138
  2. package/dist/browser.mjs +23 -13
  3. package/dist/browser.mjs.map +4 -4
  4. package/dist/esm/advanced.js +11 -0
  5. package/dist/esm/advanced.js.map +1 -0
  6. package/dist/esm/define-protocol.js +3 -3
  7. package/dist/esm/dwn-api.js +56 -114
  8. package/dist/esm/dwn-api.js.map +1 -1
  9. package/dist/esm/dwn-reader-api.js +128 -0
  10. package/dist/esm/dwn-reader-api.js.map +1 -0
  11. package/dist/esm/index.js +3 -2
  12. package/dist/esm/index.js.map +1 -1
  13. package/dist/esm/live-query.js +5 -4
  14. package/dist/esm/live-query.js.map +1 -1
  15. package/dist/esm/read-only-record.js +255 -0
  16. package/dist/esm/read-only-record.js.map +1 -0
  17. package/dist/esm/record.js +46 -57
  18. package/dist/esm/record.js.map +1 -1
  19. package/dist/esm/typed-web5.js +242 -0
  20. package/dist/esm/typed-web5.js.map +1 -0
  21. package/dist/esm/web5.js +71 -3
  22. package/dist/esm/web5.js.map +1 -1
  23. package/dist/types/advanced.d.ts +12 -0
  24. package/dist/types/advanced.d.ts.map +1 -0
  25. package/dist/types/define-protocol.d.ts +3 -3
  26. package/dist/types/dwn-api.d.ts +13 -92
  27. package/dist/types/dwn-api.d.ts.map +1 -1
  28. package/dist/types/dwn-reader-api.d.ts +138 -0
  29. package/dist/types/dwn-reader-api.d.ts.map +1 -0
  30. package/dist/types/index.d.ts +3 -2
  31. package/dist/types/index.d.ts.map +1 -1
  32. package/dist/types/live-query.d.ts +13 -1
  33. package/dist/types/live-query.d.ts.map +1 -1
  34. package/dist/types/protocol-types.d.ts +2 -2
  35. package/dist/types/read-only-record.d.ts +133 -0
  36. package/dist/types/read-only-record.d.ts.map +1 -0
  37. package/dist/types/record.d.ts +37 -17
  38. package/dist/types/record.d.ts.map +1 -1
  39. package/dist/types/{typed-dwn-api.d.ts → typed-web5.d.ts} +70 -73
  40. package/dist/types/typed-web5.d.ts.map +1 -0
  41. package/dist/types/web5.d.ts +79 -3
  42. package/dist/types/web5.d.ts.map +1 -1
  43. package/package.json +10 -6
  44. package/src/advanced.ts +29 -0
  45. package/src/define-protocol.ts +3 -3
  46. package/src/dwn-api.ts +91 -232
  47. package/src/dwn-reader-api.ts +255 -0
  48. package/src/index.ts +3 -2
  49. package/src/live-query.ts +20 -4
  50. package/src/protocol-types.ts +2 -2
  51. package/src/read-only-record.ts +328 -0
  52. package/src/record.ts +116 -86
  53. package/src/typed-web5.ts +445 -0
  54. package/src/web5.ts +104 -5
  55. package/dist/esm/typed-dwn-api.js +0 -182
  56. package/dist/esm/typed-dwn-api.js.map +0 -1
  57. package/dist/types/typed-dwn-api.d.ts.map +0 -1
  58. package/src/typed-dwn-api.ts +0 -370
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Advanced API surface for power users who need direct access to
3
+ * the underlying {@link DwnApi}.
4
+ *
5
+ * Most applications should use `web5.using(protocol)` instead.
6
+ * Import from `@enbox/api/advanced` to access these exports.
7
+ *
8
+ * @packageDocumentation
9
+ */
10
+ export { DwnApi } from './dwn-api.js';
11
+ //# sourceMappingURL=advanced.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"advanced.js","sourceRoot":"","sources":["../../src/advanced.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC"}
@@ -2,7 +2,7 @@
2
2
  * Factory function for creating typed protocol definitions.
3
3
  *
4
4
  * `defineProtocol()` wraps a standard {@link ProtocolDefinition} with
5
- * compile-time type metadata so that {@link TypedDwnApi} can provide
5
+ * compile-time type metadata so that {@link TypedWeb5} can provide
6
6
  * path autocompletion, data-shape inference, and tag type safety.
7
7
  */
8
8
  /**
@@ -12,7 +12,7 @@
12
12
  *
13
13
  * The `definition` argument is returned as-is (no cloning). The schema map
14
14
  * is a phantom type parameter — it exists only at compile time to thread
15
- * type information through to `TypedDwnApi`.
15
+ * type information through to `TypedWeb5`.
16
16
  *
17
17
  * @param definition - A standard `ProtocolDefinition` object.
18
18
  * @param _schemaMap - A phantom value (e.g. `{} as MySchemaMap`) that carries
@@ -27,7 +27,7 @@
27
27
  * });
28
28
  *
29
29
  * // socialGraph.definition is the raw ProtocolDefinition
30
- * // TypedDwnApi infers paths like 'friend' | 'friend/message' and
30
+ * // TypedWeb5 infers paths like 'friend' | 'friend/message' and
31
31
  * // data types from the schema map.
32
32
  * ```
33
33
  */
@@ -24,7 +24,6 @@ var __rest = (this && this.__rest) || function (s, e) {
24
24
  return t;
25
25
  };
26
26
  import { AgentPermissionsApi, } from '@enbox/agent';
27
- import { isEmptyObject } from '@enbox/common';
28
27
  import { DwnInterface, getRecordAuthor } from '@enbox/agent';
29
28
  import { dataToBlob } from './utils.js';
30
29
  import { LiveQuery } from './live-query.js';
@@ -32,7 +31,6 @@ import { PermissionGrant } from './permission-grant.js';
32
31
  import { PermissionRequest } from './permission-request.js';
33
32
  import { Protocol } from './protocol.js';
34
33
  import { Record } from './record.js';
35
- import { TypedDwnApi } from './typed-dwn-api.js';
36
34
  /**
37
35
  * Interface to interact with DWN Records and Protocols
38
36
  */
@@ -43,27 +41,6 @@ export class DwnApi {
43
41
  this.delegateDid = options.delegateDid;
44
42
  this.permissionsApi = new AgentPermissionsApi({ agent: this.agent });
45
43
  }
46
- /**
47
- * Returns a {@link TypedDwnApi} scoped to the given typed protocol.
48
- *
49
- * The returned API provides path autocompletion, typed data payloads,
50
- * and automatically injects the protocol URI and protocolPath into every
51
- * DWN operation.
52
- *
53
- * @param protocol - A typed protocol created via `defineProtocol()`.
54
- * @returns A `TypedDwnApi` instance bound to the given protocol.
55
- *
56
- * @example
57
- * ```ts
58
- * const social = dwn.using(SocialGraphProtocol);
59
- * const { record } = await social.write('friend', {
60
- * data: { did: 'did:example:alice' },
61
- * });
62
- * ```
63
- */
64
- using(protocol) {
65
- return new TypedDwnApi(this, protocol);
66
- }
67
44
  /**
68
45
  * API to interact with Grants
69
46
  *
@@ -126,7 +103,7 @@ export class DwnApi {
126
103
  */
127
104
  queryGrants: (...args_1) => __awaiter(this, [...args_1], void 0, function* (request = {}) {
128
105
  var _a, _b, _c;
129
- const { checkRevoked, from } = request, params = __rest(request, ["checkRevoked", "from"]);
106
+ const { from } = request, params = __rest(request, ["from"]);
130
107
  const remote = from !== undefined;
131
108
  const author = (_a = this.delegateDid) !== null && _a !== void 0 ? _a : this.connectedDid;
132
109
  const target = (_b = from !== null && from !== void 0 ? from : this.delegateDid) !== null && _b !== void 0 ? _b : this.connectedDid;
@@ -140,12 +117,6 @@ export class DwnApi {
140
117
  agent: this.agent,
141
118
  message: permission.message,
142
119
  };
143
- if (checkRevoked) {
144
- const grantRecordId = permission.grant.id;
145
- if (yield this.permissionsApi.isGrantRevoked({ author, target, grantRecordId, remote })) {
146
- continue;
147
- }
148
- }
149
120
  grants.push(yield PermissionGrant.parse(grantParams));
150
121
  }
151
122
  return grants;
@@ -161,18 +132,19 @@ export class DwnApi {
161
132
  * Configure method, used to setup a new protocol (or update) with the passed definitions
162
133
  */
163
134
  configure: (request) => __awaiter(this, void 0, void 0, function* () {
135
+ const { encryption } = request, messageParams = __rest(request, ["encryption"]);
164
136
  const agentRequest = {
165
137
  author: this.connectedDid,
166
- messageParams: request.message,
138
+ messageParams,
167
139
  messageType: DwnInterface.ProtocolsConfigure,
168
140
  target: this.connectedDid,
169
- encryption: request.encryption,
141
+ encryption,
170
142
  };
171
143
  if (this.delegateDid) {
172
144
  const { message: delegatedGrant } = yield this.permissionsApi.getPermissionForRequest({
173
145
  connectedDid: this.connectedDid,
174
146
  delegateDid: this.delegateDid,
175
- protocol: request.message.definition.protocol,
147
+ protocol: messageParams.definition.protocol,
176
148
  delegate: true,
177
149
  cached: true,
178
150
  messageType: agentRequest.messageType
@@ -193,11 +165,12 @@ export class DwnApi {
193
165
  * Query the available protocols
194
166
  */
195
167
  query: (request) => __awaiter(this, void 0, void 0, function* () {
168
+ const { from } = request, messageParams = __rest(request, ["from"]);
196
169
  const agentRequest = {
197
170
  author: this.connectedDid,
198
- messageParams: request.message,
171
+ messageParams,
199
172
  messageType: DwnInterface.ProtocolsQuery,
200
- target: request.from || this.connectedDid
173
+ target: from || this.connectedDid,
201
174
  };
202
175
  if (this.delegateDid) {
203
176
  // We attempt to get a grant within a try catch, if there is no grant we will still sign the query with the delegate DID's key
@@ -206,7 +179,7 @@ export class DwnApi {
206
179
  const { grant: { id: permissionGrantId } } = yield this.permissionsApi.getPermissionForRequest({
207
180
  connectedDid: this.connectedDid,
208
181
  delegateDid: this.delegateDid,
209
- protocol: request.message.filter.protocol,
182
+ protocol: messageParams.filter.protocol,
210
183
  cached: true,
211
184
  messageType: agentRequest.messageType
212
185
  });
@@ -219,7 +192,7 @@ export class DwnApi {
219
192
  }
220
193
  }
221
194
  let agentResponse;
222
- if (request.from) {
195
+ if (from) {
223
196
  agentResponse = yield this.agent.sendDwnRequest(agentRequest);
224
197
  }
225
198
  else {
@@ -236,70 +209,35 @@ export class DwnApi {
236
209
  };
237
210
  }
238
211
  /**
239
- * API to interact with DWN records (e.g., `dwn.records.create()`).
212
+ * API to interact with DWN records (e.g., `dwn.records.write()`).
240
213
  */
241
214
  get records() {
242
215
  return {
243
- /**
244
- * Alias for the `write` method
245
- */
246
- create: (request) => __awaiter(this, void 0, void 0, function* () {
247
- return this.records.write(request);
248
- }),
249
- /**
250
- * Write a record based on an existing one (useful for updating an existing record)
251
- */
252
- createFrom: (request) => __awaiter(this, void 0, void 0, function* () {
253
- var _a, _b;
254
- const _c = request.record.toJSON(), { author: inheritedAuthor } = _c, inheritedProperties = __rest(_c, ["author"]);
255
- // If `data` is being updated then `dataCid` and `dataSize` must not be present.
256
- if (request.data !== undefined) {
257
- delete inheritedProperties.dataCid;
258
- delete inheritedProperties.dataSize;
259
- }
260
- // If `published` is set to false, ensure that `datePublished` is undefined. Otherwise, DWN SDK's schema validation
261
- // will throw an error if `published` is false but `datePublished` is set.
262
- if (((_a = request.message) === null || _a === void 0 ? void 0 : _a.published) === false && inheritedProperties.datePublished !== undefined) {
263
- delete inheritedProperties.datePublished;
264
- delete inheritedProperties.published;
265
- }
266
- // If the request changes the `author` or message `descriptor` then the deterministic `recordId` will change.
267
- // As a result, we will discard the `recordId` if either of these changes occur.
268
- if (!isEmptyObject(request.message) || (request.author && request.author !== inheritedAuthor)) {
269
- delete inheritedProperties.recordId;
270
- }
271
- // Auto-detect encryption from the source record if not explicitly set.
272
- const shouldEncrypt = (_b = request.encryption) !== null && _b !== void 0 ? _b : (request.record.encryption !== undefined);
273
- return this.records.write({
274
- data: request.data,
275
- message: Object.assign(Object.assign({}, inheritedProperties), request.message),
276
- encryption: shouldEncrypt || undefined,
277
- });
278
- }),
279
216
  /**
280
217
  * Delete a record
281
218
  */
282
219
  delete: (request) => __awaiter(this, void 0, void 0, function* () {
220
+ const { from, protocol } = request, messageParams = __rest(request, ["from", "protocol"]);
283
221
  const agentRequest = {
284
222
  /**
285
223
  * The `author` is the DID that will sign the message and must be the DID the Web5 app is
286
224
  * connected with and is authorized to access the signing private key of.
287
225
  */
288
226
  author: this.connectedDid,
289
- messageParams: request.message,
227
+ messageParams,
290
228
  messageType: DwnInterface.RecordsDelete,
291
229
  /**
292
230
  * The `target` is the DID of the DWN tenant under which the delete will be executed.
293
231
  * If `from` is provided, the delete operation will be executed on a remote DWN.
294
232
  * Otherwise, the record will be deleted on the local DWN.
295
233
  */
296
- target: request.from || this.connectedDid
234
+ target: from || this.connectedDid,
297
235
  };
298
236
  if (this.delegateDid) {
299
237
  const { message: delegatedGrant } = yield this.permissionsApi.getPermissionForRequest({
300
238
  connectedDid: this.connectedDid,
301
239
  delegateDid: this.delegateDid,
302
- protocol: request.protocol,
240
+ protocol,
303
241
  delegate: true,
304
242
  cached: true,
305
243
  messageType: agentRequest.messageType
@@ -308,7 +246,7 @@ export class DwnApi {
308
246
  agentRequest.granteeDid = this.delegateDid;
309
247
  }
310
248
  let agentResponse;
311
- if (request.from) {
249
+ if (from) {
312
250
  agentResponse = yield this.agent.sendDwnRequest(agentRequest);
313
251
  }
314
252
  else {
@@ -321,34 +259,35 @@ export class DwnApi {
321
259
  * Query a single or multiple records based on the given filter
322
260
  */
323
261
  query: (request) => __awaiter(this, void 0, void 0, function* () {
262
+ var _a;
263
+ const { from, encryption } = request, messageParams = __rest(request, ["from", "encryption"]);
324
264
  const agentRequest = {
325
265
  /**
326
266
  * The `author` is the DID that will sign the message and must be the DID the Web5 app is
327
267
  * connected with and is authorized to access the signing private key of.
328
268
  */
329
269
  author: this.connectedDid,
330
- messageParams: request.message,
270
+ messageParams,
331
271
  messageType: DwnInterface.RecordsQuery,
332
272
  /**
333
273
  * The `target` is the DID of the DWN tenant under which the query will be executed.
334
274
  * If `from` is provided, the query operation will be executed on a remote DWN.
335
275
  * Otherwise, the local DWN will be queried.
336
276
  */
337
- target: request.from || this.connectedDid,
338
- encryption: request.encryption,
277
+ target: from || this.connectedDid,
278
+ encryption,
339
279
  };
340
280
  if (this.delegateDid) {
341
281
  // if we don't find a delegated grant, we will attempt to query signing as the delegated DID
342
282
  // This is to allow the API caller to query public records without needing to impersonate the delegate.
343
283
  //
344
- // NOTE: When a read-only DwnApi is implemented, callers should use that instead when they don't have an explicit permission.
345
- // This should fail if a permission is not found.
346
- // TODO: https://github.com/enboxorg/enbox/issues/898
284
+ // NOTE: For anonymous/public queries without explicit permissions, callers can use `DwnReaderApi` via `Web5.anonymous()`.
285
+ // See: https://github.com/enboxorg/enbox/issues/898
347
286
  try {
348
287
  const { message: delegatedGrant } = yield this.permissionsApi.getPermissionForRequest({
349
288
  connectedDid: this.connectedDid,
350
289
  delegateDid: this.delegateDid,
351
- protocol: request.protocol,
290
+ protocol: (_a = messageParams.filter) === null || _a === void 0 ? void 0 : _a.protocol,
352
291
  delegate: true,
353
292
  cached: true,
354
293
  messageType: agentRequest.messageType
@@ -356,13 +295,13 @@ export class DwnApi {
356
295
  agentRequest.messageParams = Object.assign(Object.assign({}, agentRequest.messageParams), { delegatedGrant });
357
296
  agentRequest.granteeDid = this.delegateDid;
358
297
  }
359
- catch (_a) {
298
+ catch (_b) {
360
299
  // if a grant is not found, we should author the request as the delegated DID to get public records
361
300
  agentRequest.author = this.delegateDid;
362
301
  }
363
302
  }
364
303
  let agentResponse;
365
- if (request.from) {
304
+ if (from) {
366
305
  agentResponse = yield this.agent.sendDwnRequest(agentRequest);
367
306
  }
368
307
  else {
@@ -389,7 +328,7 @@ export class DwnApi {
389
328
  * to determine which DWN to send subsequent read requests to in the event the data
390
329
  * payload exceeds the threshold for being returned with queries.
391
330
  */
392
- remoteOrigin: request.from, delegateDid: this.delegateDid, protocolRole: agentRequest.messageParams.protocolRole }, entry);
331
+ remoteOrigin: from, delegateDid: this.delegateDid, protocolRole: agentRequest.messageParams.protocolRole }, entry);
393
332
  const record = new Record(this.agent, recordOptions, this.permissionsApi);
394
333
  return record;
395
334
  });
@@ -399,34 +338,34 @@ export class DwnApi {
399
338
  * Read a single record based on the given filter
400
339
  */
401
340
  read: (request) => __awaiter(this, void 0, void 0, function* () {
341
+ const { from, protocol, encryption } = request, messageParams = __rest(request, ["from", "protocol", "encryption"]);
402
342
  const agentRequest = {
403
343
  /**
404
344
  * The `author` is the DID that will sign the message and must be the DID the Web5 app is
405
345
  * connected with and is authorized to access the signing private key of.
406
346
  */
407
347
  author: this.connectedDid,
408
- messageParams: request.message,
348
+ messageParams,
409
349
  messageType: DwnInterface.RecordsRead,
410
350
  /**
411
351
  * The `target` is the DID of the DWN tenant under which the read will be executed.
412
352
  * If `from` is provided, the read operation will be executed on a remote DWN.
413
353
  * Otherwise, the read will occur on the local DWN.
414
354
  */
415
- target: request.from || this.connectedDid,
416
- encryption: request.encryption,
355
+ target: from || this.connectedDid,
356
+ encryption,
417
357
  };
418
358
  if (this.delegateDid) {
419
359
  // if we don't find a delegated grant, we will attempt to read signing as the delegated DID
420
360
  // This is to allow the API caller to read public records without needing to impersonate the delegate.
421
361
  //
422
- // NOTE: When a read-only DwnApi is implemented, callers should use that instead when they don't have an explicit permission.
423
- // This should fail if a permission is not found.
424
- // TODO: https://github.com/enboxorg/enbox/issues/898
362
+ // NOTE: For anonymous/public reads without explicit permissions, callers can use `DwnReaderApi` via `Web5.anonymous()`.
363
+ // See: https://github.com/enboxorg/enbox/issues/898
425
364
  try {
426
365
  const { message: delegatedGrant } = yield this.permissionsApi.getPermissionForRequest({
427
366
  connectedDid: this.connectedDid,
428
367
  delegateDid: this.delegateDid,
429
- protocol: request.protocol,
368
+ protocol,
430
369
  delegate: true,
431
370
  cached: true,
432
371
  messageType: agentRequest.messageType
@@ -440,7 +379,7 @@ export class DwnApi {
440
379
  }
441
380
  }
442
381
  let agentResponse;
443
- if (request.from) {
382
+ if (from) {
444
383
  agentResponse = yield this.agent.sendDwnRequest(agentRequest);
445
384
  }
446
385
  else {
@@ -467,7 +406,7 @@ export class DwnApi {
467
406
  * to determine which DWN to send subsequent read requests to in the event the data
468
407
  * payload must be read again (e.g., if the data stream is consumed).
469
408
  */
470
- remoteOrigin: request.from, delegateDid: this.delegateDid, data: entry.data, initialWrite: entry.initialWrite }, entry.recordsWrite);
409
+ remoteOrigin: from, delegateDid: this.delegateDid, data: entry.data, initialWrite: entry.initialWrite }, entry.recordsWrite);
471
410
  record = new Record(this.agent, recordOptions, this.permissionsApi);
472
411
  }
473
412
  return { record, status };
@@ -480,11 +419,13 @@ export class DwnApi {
480
419
  * typed change events (`create`, `update`, `delete`).
481
420
  */
482
421
  subscribe: (request) => __awaiter(this, void 0, void 0, function* () {
422
+ var _a;
423
+ const { from } = request, messageParams = __rest(request, ["from"]);
483
424
  // Build a DWN-level subscription handler that wraps raw RecordEvents
484
425
  // into Record objects and feeds them into the LiveQuery.
485
426
  let liveQuery;
486
- const remoteOrigin = request.from;
487
- const protocolRole = request.message.protocolRole;
427
+ const remoteOrigin = from;
428
+ const protocolRole = messageParams.protocolRole;
488
429
  const subscriptionHandler = (event) => __awaiter(this, void 0, void 0, function* () {
489
430
  const { message, initialWrite } = event;
490
431
  const record = new Record(this.agent, Object.assign(Object.assign({}, message), { author: getRecordAuthor(message), connectedDid: this.connectedDid, remoteOrigin,
@@ -494,23 +435,22 @@ export class DwnApi {
494
435
  });
495
436
  const agentRequest = {
496
437
  author: this.connectedDid,
497
- messageParams: request.message,
438
+ messageParams,
498
439
  messageType: DwnInterface.RecordsSubscribe,
499
- target: request.from || this.connectedDid,
440
+ target: from || this.connectedDid,
500
441
  subscriptionHandler,
501
442
  };
502
443
  if (this.delegateDid) {
503
444
  // if we don't find a delegated grant, we will attempt to subscribe signing as the delegated DID
504
445
  // This is to allow the API caller to subscribe to public records without needing to impersonate the delegate.
505
446
  //
506
- // NOTE: When a read-only DwnApi is implemented, callers should use that instead when they don't have an explicit permission.
507
- // This should fail if a permission is not found.
508
- // TODO: https://github.com/enboxorg/enbox/issues/898
447
+ // NOTE: For anonymous/public subscriptions without explicit permissions, callers can use `DwnReaderApi` via `Web5.anonymous()`.
448
+ // See: https://github.com/enboxorg/enbox/issues/898
509
449
  try {
510
450
  const { message: delegatedGrant } = yield this.permissionsApi.getPermissionForRequest({
511
451
  connectedDid: this.connectedDid,
512
452
  delegateDid: this.delegateDid,
513
- protocol: request.protocol,
453
+ protocol: (_a = messageParams.filter) === null || _a === void 0 ? void 0 : _a.protocol,
514
454
  delegate: true,
515
455
  cached: true,
516
456
  messageType: agentRequest.messageType
@@ -518,20 +458,20 @@ export class DwnApi {
518
458
  agentRequest.messageParams = Object.assign(Object.assign({}, agentRequest.messageParams), { delegatedGrant });
519
459
  agentRequest.granteeDid = this.delegateDid;
520
460
  }
521
- catch (_a) {
461
+ catch (_b) {
522
462
  // if a grant is not found, we should author the request as the delegated DID to get public records
523
463
  agentRequest.author = this.delegateDid;
524
464
  }
525
465
  }
526
466
  let agentResponse;
527
- if (request.from) {
467
+ if (from) {
528
468
  agentResponse = yield this.agent.sendDwnRequest(agentRequest);
529
469
  }
530
470
  else {
531
471
  agentResponse = yield this.agent.processDwnRequest(agentRequest);
532
472
  }
533
473
  const reply = agentResponse.reply;
534
- const { status, subscription, entries = [] } = reply;
474
+ const { status, subscription, entries = [], cursor } = reply;
535
475
  if (subscription) {
536
476
  liveQuery = new LiveQuery({
537
477
  agent: this.agent,
@@ -541,6 +481,7 @@ export class DwnApi {
541
481
  remoteOrigin,
542
482
  permissionsApi: this.permissionsApi,
543
483
  initialEntries: entries,
484
+ cursor,
544
485
  subscription,
545
486
  });
546
487
  }
@@ -556,23 +497,24 @@ export class DwnApi {
556
497
  * requires fetching from the DWN datastore.
557
498
  */
558
499
  write: (request) => __awaiter(this, void 0, void 0, function* () {
559
- var _a;
560
- const { dataBlob, dataFormat } = dataToBlob(request.data, (_a = request.message) === null || _a === void 0 ? void 0 : _a.dataFormat);
500
+ const { data, store, encryption } = request, restParams = __rest(request, ["data", "store", "encryption"]);
501
+ const { dataBlob, dataFormat } = dataToBlob(data, restParams.dataFormat);
502
+ const messageParams = Object.assign(Object.assign({}, restParams), { dataFormat });
561
503
  const dwnRequestParams = {
562
- store: request.store,
504
+ store,
563
505
  messageType: DwnInterface.RecordsWrite,
564
- messageParams: Object.assign(Object.assign({}, request.message), { dataFormat }),
506
+ messageParams,
565
507
  author: this.connectedDid,
566
508
  target: this.connectedDid,
567
509
  dataStream: dataBlob,
568
- encryption: request.encryption,
510
+ encryption,
569
511
  };
570
512
  // if impersonation is enabled, fetch the delegated grant to use with the write operation
571
513
  if (this.delegateDid) {
572
514
  const { message: delegatedGrant } = yield this.permissionsApi.getPermissionForRequest({
573
515
  connectedDid: this.connectedDid,
574
516
  delegateDid: this.delegateDid,
575
- protocol: request.message.protocol,
517
+ protocol: messageParams.protocol,
576
518
  delegate: true,
577
519
  cached: true,
578
520
  messageType: dwnRequestParams.messageType
@@ -1 +1 @@
1
- {"version":3,"file":"dwn-api.js","sourceRoot":"","sources":["../../src/dwn-api.ts"],"names":[],"mappings":"AAAA;;;GA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