@enbox/api 0.1.1 → 0.2.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 (58) hide show
  1. package/README.md +140 -159
  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 +55 -107
  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 +12 -89
  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 +9 -5
  44. package/src/advanced.ts +29 -0
  45. package/src/define-protocol.ts +3 -3
  46. package/src/dwn-api.ts +88 -222
  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
  *
@@ -161,18 +138,19 @@ export class DwnApi {
161
138
  * Configure method, used to setup a new protocol (or update) with the passed definitions
162
139
  */
163
140
  configure: (request) => __awaiter(this, void 0, void 0, function* () {
141
+ const { encryption } = request, messageParams = __rest(request, ["encryption"]);
164
142
  const agentRequest = {
165
143
  author: this.connectedDid,
166
- messageParams: request.message,
144
+ messageParams,
167
145
  messageType: DwnInterface.ProtocolsConfigure,
168
146
  target: this.connectedDid,
169
- encryption: request.encryption,
147
+ encryption,
170
148
  };
171
149
  if (this.delegateDid) {
172
150
  const { message: delegatedGrant } = yield this.permissionsApi.getPermissionForRequest({
173
151
  connectedDid: this.connectedDid,
174
152
  delegateDid: this.delegateDid,
175
- protocol: request.message.definition.protocol,
153
+ protocol: messageParams.definition.protocol,
176
154
  delegate: true,
177
155
  cached: true,
178
156
  messageType: agentRequest.messageType
@@ -193,11 +171,12 @@ export class DwnApi {
193
171
  * Query the available protocols
194
172
  */
195
173
  query: (request) => __awaiter(this, void 0, void 0, function* () {
174
+ const { from } = request, messageParams = __rest(request, ["from"]);
196
175
  const agentRequest = {
197
176
  author: this.connectedDid,
198
- messageParams: request.message,
177
+ messageParams,
199
178
  messageType: DwnInterface.ProtocolsQuery,
200
- target: request.from || this.connectedDid
179
+ target: from || this.connectedDid,
201
180
  };
202
181
  if (this.delegateDid) {
203
182
  // 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 +185,7 @@ export class DwnApi {
206
185
  const { grant: { id: permissionGrantId } } = yield this.permissionsApi.getPermissionForRequest({
207
186
  connectedDid: this.connectedDid,
208
187
  delegateDid: this.delegateDid,
209
- protocol: request.message.filter.protocol,
188
+ protocol: messageParams.filter.protocol,
210
189
  cached: true,
211
190
  messageType: agentRequest.messageType
212
191
  });
@@ -219,7 +198,7 @@ export class DwnApi {
219
198
  }
220
199
  }
221
200
  let agentResponse;
222
- if (request.from) {
201
+ if (from) {
223
202
  agentResponse = yield this.agent.sendDwnRequest(agentRequest);
224
203
  }
225
204
  else {
@@ -236,70 +215,35 @@ export class DwnApi {
236
215
  };
237
216
  }
238
217
  /**
239
- * API to interact with DWN records (e.g., `dwn.records.create()`).
218
+ * API to interact with DWN records (e.g., `dwn.records.write()`).
240
219
  */
241
220
  get records() {
242
221
  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
222
  /**
280
223
  * Delete a record
281
224
  */
282
225
  delete: (request) => __awaiter(this, void 0, void 0, function* () {
226
+ const { from, protocol } = request, messageParams = __rest(request, ["from", "protocol"]);
283
227
  const agentRequest = {
284
228
  /**
285
229
  * The `author` is the DID that will sign the message and must be the DID the Web5 app is
286
230
  * connected with and is authorized to access the signing private key of.
287
231
  */
288
232
  author: this.connectedDid,
289
- messageParams: request.message,
233
+ messageParams,
290
234
  messageType: DwnInterface.RecordsDelete,
291
235
  /**
292
236
  * The `target` is the DID of the DWN tenant under which the delete will be executed.
293
237
  * If `from` is provided, the delete operation will be executed on a remote DWN.
294
238
  * Otherwise, the record will be deleted on the local DWN.
295
239
  */
296
- target: request.from || this.connectedDid
240
+ target: from || this.connectedDid,
297
241
  };
298
242
  if (this.delegateDid) {
299
243
  const { message: delegatedGrant } = yield this.permissionsApi.getPermissionForRequest({
300
244
  connectedDid: this.connectedDid,
301
245
  delegateDid: this.delegateDid,
302
- protocol: request.protocol,
246
+ protocol,
303
247
  delegate: true,
304
248
  cached: true,
305
249
  messageType: agentRequest.messageType
@@ -308,7 +252,7 @@ export class DwnApi {
308
252
  agentRequest.granteeDid = this.delegateDid;
309
253
  }
310
254
  let agentResponse;
311
- if (request.from) {
255
+ if (from) {
312
256
  agentResponse = yield this.agent.sendDwnRequest(agentRequest);
313
257
  }
314
258
  else {
@@ -321,34 +265,35 @@ export class DwnApi {
321
265
  * Query a single or multiple records based on the given filter
322
266
  */
323
267
  query: (request) => __awaiter(this, void 0, void 0, function* () {
268
+ var _a;
269
+ const { from, encryption } = request, messageParams = __rest(request, ["from", "encryption"]);
324
270
  const agentRequest = {
325
271
  /**
326
272
  * The `author` is the DID that will sign the message and must be the DID the Web5 app is
327
273
  * connected with and is authorized to access the signing private key of.
328
274
  */
329
275
  author: this.connectedDid,
330
- messageParams: request.message,
276
+ messageParams,
331
277
  messageType: DwnInterface.RecordsQuery,
332
278
  /**
333
279
  * The `target` is the DID of the DWN tenant under which the query will be executed.
334
280
  * If `from` is provided, the query operation will be executed on a remote DWN.
335
281
  * Otherwise, the local DWN will be queried.
336
282
  */
337
- target: request.from || this.connectedDid,
338
- encryption: request.encryption,
283
+ target: from || this.connectedDid,
284
+ encryption,
339
285
  };
340
286
  if (this.delegateDid) {
341
287
  // if we don't find a delegated grant, we will attempt to query signing as the delegated DID
342
288
  // This is to allow the API caller to query public records without needing to impersonate the delegate.
343
289
  //
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
290
+ // NOTE: For anonymous/public queries without explicit permissions, callers can use `DwnReaderApi` via `Web5.anonymous()`.
291
+ // See: https://github.com/enboxorg/enbox/issues/898
347
292
  try {
348
293
  const { message: delegatedGrant } = yield this.permissionsApi.getPermissionForRequest({
349
294
  connectedDid: this.connectedDid,
350
295
  delegateDid: this.delegateDid,
351
- protocol: request.protocol,
296
+ protocol: (_a = messageParams.filter) === null || _a === void 0 ? void 0 : _a.protocol,
352
297
  delegate: true,
353
298
  cached: true,
354
299
  messageType: agentRequest.messageType
@@ -356,13 +301,13 @@ export class DwnApi {
356
301
  agentRequest.messageParams = Object.assign(Object.assign({}, agentRequest.messageParams), { delegatedGrant });
357
302
  agentRequest.granteeDid = this.delegateDid;
358
303
  }
359
- catch (_a) {
304
+ catch (_b) {
360
305
  // if a grant is not found, we should author the request as the delegated DID to get public records
361
306
  agentRequest.author = this.delegateDid;
362
307
  }
363
308
  }
364
309
  let agentResponse;
365
- if (request.from) {
310
+ if (from) {
366
311
  agentResponse = yield this.agent.sendDwnRequest(agentRequest);
367
312
  }
368
313
  else {
@@ -389,7 +334,7 @@ export class DwnApi {
389
334
  * to determine which DWN to send subsequent read requests to in the event the data
390
335
  * payload exceeds the threshold for being returned with queries.
391
336
  */
392
- remoteOrigin: request.from, delegateDid: this.delegateDid, protocolRole: agentRequest.messageParams.protocolRole }, entry);
337
+ remoteOrigin: from, delegateDid: this.delegateDid, protocolRole: agentRequest.messageParams.protocolRole }, entry);
393
338
  const record = new Record(this.agent, recordOptions, this.permissionsApi);
394
339
  return record;
395
340
  });
@@ -399,34 +344,34 @@ export class DwnApi {
399
344
  * Read a single record based on the given filter
400
345
  */
401
346
  read: (request) => __awaiter(this, void 0, void 0, function* () {
347
+ const { from, protocol, encryption } = request, messageParams = __rest(request, ["from", "protocol", "encryption"]);
402
348
  const agentRequest = {
403
349
  /**
404
350
  * The `author` is the DID that will sign the message and must be the DID the Web5 app is
405
351
  * connected with and is authorized to access the signing private key of.
406
352
  */
407
353
  author: this.connectedDid,
408
- messageParams: request.message,
354
+ messageParams,
409
355
  messageType: DwnInterface.RecordsRead,
410
356
  /**
411
357
  * The `target` is the DID of the DWN tenant under which the read will be executed.
412
358
  * If `from` is provided, the read operation will be executed on a remote DWN.
413
359
  * Otherwise, the read will occur on the local DWN.
414
360
  */
415
- target: request.from || this.connectedDid,
416
- encryption: request.encryption,
361
+ target: from || this.connectedDid,
362
+ encryption,
417
363
  };
418
364
  if (this.delegateDid) {
419
365
  // if we don't find a delegated grant, we will attempt to read signing as the delegated DID
420
366
  // This is to allow the API caller to read public records without needing to impersonate the delegate.
421
367
  //
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
368
+ // NOTE: For anonymous/public reads without explicit permissions, callers can use `DwnReaderApi` via `Web5.anonymous()`.
369
+ // See: https://github.com/enboxorg/enbox/issues/898
425
370
  try {
426
371
  const { message: delegatedGrant } = yield this.permissionsApi.getPermissionForRequest({
427
372
  connectedDid: this.connectedDid,
428
373
  delegateDid: this.delegateDid,
429
- protocol: request.protocol,
374
+ protocol,
430
375
  delegate: true,
431
376
  cached: true,
432
377
  messageType: agentRequest.messageType
@@ -440,7 +385,7 @@ export class DwnApi {
440
385
  }
441
386
  }
442
387
  let agentResponse;
443
- if (request.from) {
388
+ if (from) {
444
389
  agentResponse = yield this.agent.sendDwnRequest(agentRequest);
445
390
  }
446
391
  else {
@@ -467,7 +412,7 @@ export class DwnApi {
467
412
  * to determine which DWN to send subsequent read requests to in the event the data
468
413
  * payload must be read again (e.g., if the data stream is consumed).
469
414
  */
470
- remoteOrigin: request.from, delegateDid: this.delegateDid, data: entry.data, initialWrite: entry.initialWrite }, entry.recordsWrite);
415
+ remoteOrigin: from, delegateDid: this.delegateDid, data: entry.data, initialWrite: entry.initialWrite }, entry.recordsWrite);
471
416
  record = new Record(this.agent, recordOptions, this.permissionsApi);
472
417
  }
473
418
  return { record, status };
@@ -480,11 +425,13 @@ export class DwnApi {
480
425
  * typed change events (`create`, `update`, `delete`).
481
426
  */
482
427
  subscribe: (request) => __awaiter(this, void 0, void 0, function* () {
428
+ var _a;
429
+ const { from } = request, messageParams = __rest(request, ["from"]);
483
430
  // Build a DWN-level subscription handler that wraps raw RecordEvents
484
431
  // into Record objects and feeds them into the LiveQuery.
485
432
  let liveQuery;
486
- const remoteOrigin = request.from;
487
- const protocolRole = request.message.protocolRole;
433
+ const remoteOrigin = from;
434
+ const protocolRole = messageParams.protocolRole;
488
435
  const subscriptionHandler = (event) => __awaiter(this, void 0, void 0, function* () {
489
436
  const { message, initialWrite } = event;
490
437
  const record = new Record(this.agent, Object.assign(Object.assign({}, message), { author: getRecordAuthor(message), connectedDid: this.connectedDid, remoteOrigin,
@@ -494,23 +441,22 @@ export class DwnApi {
494
441
  });
495
442
  const agentRequest = {
496
443
  author: this.connectedDid,
497
- messageParams: request.message,
444
+ messageParams,
498
445
  messageType: DwnInterface.RecordsSubscribe,
499
- target: request.from || this.connectedDid,
446
+ target: from || this.connectedDid,
500
447
  subscriptionHandler,
501
448
  };
502
449
  if (this.delegateDid) {
503
450
  // if we don't find a delegated grant, we will attempt to subscribe signing as the delegated DID
504
451
  // This is to allow the API caller to subscribe to public records without needing to impersonate the delegate.
505
452
  //
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
453
+ // NOTE: For anonymous/public subscriptions without explicit permissions, callers can use `DwnReaderApi` via `Web5.anonymous()`.
454
+ // See: https://github.com/enboxorg/enbox/issues/898
509
455
  try {
510
456
  const { message: delegatedGrant } = yield this.permissionsApi.getPermissionForRequest({
511
457
  connectedDid: this.connectedDid,
512
458
  delegateDid: this.delegateDid,
513
- protocol: request.protocol,
459
+ protocol: (_a = messageParams.filter) === null || _a === void 0 ? void 0 : _a.protocol,
514
460
  delegate: true,
515
461
  cached: true,
516
462
  messageType: agentRequest.messageType
@@ -518,20 +464,20 @@ export class DwnApi {
518
464
  agentRequest.messageParams = Object.assign(Object.assign({}, agentRequest.messageParams), { delegatedGrant });
519
465
  agentRequest.granteeDid = this.delegateDid;
520
466
  }
521
- catch (_a) {
467
+ catch (_b) {
522
468
  // if a grant is not found, we should author the request as the delegated DID to get public records
523
469
  agentRequest.author = this.delegateDid;
524
470
  }
525
471
  }
526
472
  let agentResponse;
527
- if (request.from) {
473
+ if (from) {
528
474
  agentResponse = yield this.agent.sendDwnRequest(agentRequest);
529
475
  }
530
476
  else {
531
477
  agentResponse = yield this.agent.processDwnRequest(agentRequest);
532
478
  }
533
479
  const reply = agentResponse.reply;
534
- const { status, subscription, entries = [] } = reply;
480
+ const { status, subscription, entries = [], cursor } = reply;
535
481
  if (subscription) {
536
482
  liveQuery = new LiveQuery({
537
483
  agent: this.agent,
@@ -541,6 +487,7 @@ export class DwnApi {
541
487
  remoteOrigin,
542
488
  permissionsApi: this.permissionsApi,
543
489
  initialEntries: entries,
490
+ cursor,
544
491
  subscription,
545
492
  });
546
493
  }
@@ -556,23 +503,24 @@ export class DwnApi {
556
503
  * requires fetching from the DWN datastore.
557
504
  */
558
505
  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);
506
+ const { data, store, encryption } = request, restParams = __rest(request, ["data", "store", "encryption"]);
507
+ const { dataBlob, dataFormat } = dataToBlob(data, restParams.dataFormat);
508
+ const messageParams = Object.assign(Object.assign({}, restParams), { dataFormat });
561
509
  const dwnRequestParams = {
562
- store: request.store,
510
+ store,
563
511
  messageType: DwnInterface.RecordsWrite,
564
- messageParams: Object.assign(Object.assign({}, request.message), { dataFormat }),
512
+ messageParams,
565
513
  author: this.connectedDid,
566
514
  target: this.connectedDid,
567
515
  dataStream: dataBlob,
568
- encryption: request.encryption,
516
+ encryption,
569
517
  };
570
518
  // if impersonation is enabled, fetch the delegated grant to use with the write operation
571
519
  if (this.delegateDid) {
572
520
  const { message: delegatedGrant } = yield this.permissionsApi.getPermissionForRequest({
573
521
  connectedDid: this.connectedDid,
574
522
  delegateDid: this.delegateDid,
575
- protocol: request.message.protocol,
523
+ protocol: messageParams.protocol,
576
524
  delegate: true,
577
525
  cached: true,
578
526
  messageType: dwnRequestParams.messageType
@@ -1 +1 @@
1
- {"version":3,"file":"dwn-api.js","sourceRoot":"","sources":["../../src/dwn-api.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,2CAA2C;;;;;;;;;;;;;;;;;;;;;AAe3C,OAAO,EACL,mBAAmB,GACpB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAM7D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAuQjD;;GAEG;AACH,MAAM,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