@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
package/dist/esm/web5.js CHANGED
@@ -23,11 +23,14 @@ var __rest = (this && this.__rest) || function (s, e) {
23
23
  }
24
24
  return t;
25
25
  };
26
- import { DwnRegistrar } from '@enbox/dwn-clients';
27
- import { WalletConnect, Web5UserAgent } from '@enbox/agent';
26
+ import { AnonymousDwnApi, WalletConnect, Web5UserAgent } from '@enbox/agent';
27
+ import { DidDht, DidJwk, DidKey, DidResolverCacheMemory, DidWeb, UniversalResolver } from '@enbox/dids';
28
+ import { DwnRegistrar, Web5RpcClient } from '@enbox/dwn-clients';
28
29
  import { DidApi } from './did-api.js';
29
30
  import { DwnApi } from './dwn-api.js';
31
+ import { DwnReaderApi } from './dwn-reader-api.js';
30
32
  import { PermissionGrant } from './permission-grant.js';
33
+ import { TypedWeb5 } from './typed-web5.js';
31
34
  import { VcApi } from './vc-api.js';
32
35
  /**
33
36
  * The main Web5 API interface. It manages the creation of a DID if needed, the connection to the
@@ -37,9 +40,74 @@ export class Web5 {
37
40
  constructor({ agent, connectedDid, delegateDid }) {
38
41
  this.agent = agent;
39
42
  this.did = new DidApi({ agent, connectedDid });
40
- this.dwn = new DwnApi({ agent, connectedDid, delegateDid });
43
+ this._dwn = new DwnApi({ agent, connectedDid, delegateDid });
41
44
  this.vc = new VcApi({ agent, connectedDid });
42
45
  }
46
+ /**
47
+ * Returns a {@link TypedWeb5} instance scoped to the given protocol.
48
+ *
49
+ * This is the **primary developer interface** for interacting with
50
+ * protocol-backed records. It auto-injects the protocol URI, protocolPath,
51
+ * and schema into every operation, and provides compile-time path
52
+ * autocompletion plus typed data payloads via the schema map.
53
+ *
54
+ * @param protocol - A typed protocol created via `defineProtocol()`.
55
+ * @returns A `TypedWeb5` instance bound to the given protocol.
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * const social = web5.using(SocialProtocol);
60
+ *
61
+ * await social.configure();
62
+ *
63
+ * const { record } = await social.records.write('friend', {
64
+ * data: { did: 'did:example:alice', alias: 'Alice' },
65
+ * });
66
+ *
67
+ * const { records } = await social.records.query('friend');
68
+ * ```
69
+ */
70
+ using(protocol) {
71
+ return new TypedWeb5(this._dwn, protocol);
72
+ }
73
+ /**
74
+ * Creates a lightweight, read-only Web5 instance for querying public DWN data.
75
+ *
76
+ * No identity, vault, password, or signing keys are required. The returned
77
+ * API supports querying and reading published records and protocols from any
78
+ * remote DWN, using **unsigned** (anonymous) DWN messages.
79
+ *
80
+ * @param options - Optional configuration overrides.
81
+ * @returns A {@link Web5AnonymousApi} with a read-only `dwn` property.
82
+ *
83
+ * @example
84
+ * ```ts
85
+ * const { dwn } = Web5.anonymous();
86
+ *
87
+ * const { records } = await dwn.records.query({
88
+ * from: 'did:dht:alice...',
89
+ * filter: { protocol: 'https://social.example/posts', protocolPath: 'post' },
90
+ * });
91
+ *
92
+ * for (const record of records) {
93
+ * console.log(record.id, await record.data.text());
94
+ * }
95
+ * ```
96
+ *
97
+ * @beta
98
+ */
99
+ static anonymous(options) {
100
+ var _a;
101
+ const didResolver = new UniversalResolver({
102
+ didResolvers: (_a = options === null || options === void 0 ? void 0 : options.didResolvers) !== null && _a !== void 0 ? _a : [DidDht, DidJwk, DidKey, DidWeb],
103
+ cache: new DidResolverCacheMemory(),
104
+ });
105
+ const rpcClient = new Web5RpcClient();
106
+ const anonymousDwn = new AnonymousDwnApi({ didResolver, rpcClient });
107
+ return {
108
+ dwn: new DwnReaderApi(anonymousDwn),
109
+ };
110
+ }
43
111
  /**
44
112
  * Connects to a {@link Web5Agent}. Defaults to creating a local {@link Web5UserAgent} if one
45
113
  * isn't provided.
@@ -1 +1 @@
1
- {"version":3,"file":"web5.js","sourceRoot":"","sources":["../../src/web5.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,2CAA2C;;;;;;;;;;;;;;;;;;;;;AAc3C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE5D,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AA+LpC;;;GAGG;AACH,MAAM,OAAO,IAAI;IAgBf,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,WAAW,EAAc;QAC1D,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,GAAG,GAAG,IAAI,MAAM,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;QAC/C,IAAI,CAAC,GAAG,GAAG,IAAI,MAAM,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC,CAAC;QAC5D,IAAI,CAAC,EAAE,GAAG,IAAI,KAAK,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAO,OAAO;6DAAC,EACnB,KAAK,EACL,UAAU,EACV,YAAY,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BACpB,OAAO,CAAC,KAAK,CAAC,6BAA6B,QAAQ,CAAC,QAAQ,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACzF,CAAC;QACH,CAAC;KAAA;IAED;;;;OAIG;IACH,MAAM,CAAO,sBAAsB;6DAAC,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAI/D;YACC,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAU,CAAC;YAC7C,KAAK,MAAM,YAAY,IAAI,MAAM,EAAE,CAAC;gBAClC,2GAA2G;gBAC3G,MAAM,KAAK,GAAG,MAAM,eAAe,CAAC,KAAK,CAAC,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC;gBACvG,gIAAgI;gBAChI,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAC3C,IAAI,MAAM,CAAC,IAAI,KAAK,GAAG,EAAE,CAAC;oBACxB,MAAM,IAAI,KAAK,CAAC,mDAAmD,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;gBACtF,CAAC;gBAED,MAAM,QAAQ,GAAI,KAAK,CAAC,KAAgE,CAAC,QAAQ,CAAC;gBAClG,IAAI,QAAQ,EAAE,CAAC;oBACb,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;gBACnC,CAAC;YACH,CAAC;YAED,2HAA2H;YAC3H,sHAAsH;YACtH,OAAO,CAAC,GAAG,kBAAkB,CAAC,CAAC;QACjC,CAAC;KAAA;CACF"}
@@ -0,0 +1,12 @@
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
+ export type { FetchGrantsRequest, FetchRequestsRequest, ProtocolsConfigureRequest, ProtocolsConfigureResponse, ProtocolsQueryRequest, ProtocolsQueryResponse, RecordsDeleteRequest, RecordsQueryRequest, RecordsQueryResponse, RecordsReadRequest, RecordsReadResponse, RecordsSubscribeRequest, RecordsSubscribeResponse, RecordsWriteRequest, RecordsWriteResponse, } from './dwn-api.js';
12
+ //# sourceMappingURL=advanced.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"advanced.d.ts","sourceRoot":"","sources":["../../src/advanced.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,YAAY,EACV,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,EACzB,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,wBAAwB,EACxB,mBAAmB,EACnB,oBAAoB,GACrB,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
  import type { ProtocolDefinition } from '@enbox/dwn-sdk-js';
@@ -14,7 +14,7 @@ import type { SchemaMap, TypedProtocol } from './protocol-types.js';
14
14
  *
15
15
  * The `definition` argument is returned as-is (no cloning). The schema map
16
16
  * is a phantom type parameter — it exists only at compile time to thread
17
- * type information through to `TypedDwnApi`.
17
+ * type information through to `TypedWeb5`.
18
18
  *
19
19
  * @param definition - A standard `ProtocolDefinition` object.
20
20
  * @param _schemaMap - A phantom value (e.g. `{} as MySchemaMap`) that carries
@@ -29,7 +29,7 @@ import type { SchemaMap, TypedProtocol } from './protocol-types.js';
29
29
  * });
30
30
  *
31
31
  * // socialGraph.definition is the raw ProtocolDefinition
32
- * // TypedDwnApi infers paths like 'friend' | 'friend/message' and
32
+ * // TypedWeb5 infers paths like 'friend' | 'friend/message' and
33
33
  * // data types from the schema map.
34
34
  * ```
35
35
  */
@@ -4,14 +4,11 @@
4
4
  */
5
5
  import type { CreateGrantParams, CreateRequestParams, DwnMessageParams, DwnPaginationCursor, DwnResponseStatus, FetchPermissionRequestParams, FetchPermissionsParams, Web5Agent } from '@enbox/agent';
6
6
  import { DwnInterface } from '@enbox/agent';
7
- import type { ProtocolDefinition } from '@enbox/dwn-sdk-js';
8
- import type { SchemaMap, TypedProtocol } from './protocol-types.js';
9
7
  import { LiveQuery } from './live-query.js';
10
8
  import { PermissionGrant } from './permission-grant.js';
11
9
  import { PermissionRequest } from './permission-request.js';
12
10
  import { Protocol } from './protocol.js';
13
11
  import { Record } from './record.js';
14
- import { TypedDwnApi } from './typed-dwn-api.js';
15
12
  /**
16
13
  * Represents the request payload for fetching permission requests from a Decentralized Web Node (DWN).
17
14
  *
@@ -25,22 +22,18 @@ export type FetchRequestsRequest = Omit<FetchPermissionRequestParams, 'author' |
25
22
  * Represents the request payload for fetching permission grants from a Decentralized Web Node (DWN).
26
23
  *
27
24
  * Optionally, specify a remote DWN target in the `from` property to fetch requests from.
28
- * Optionally, specify whether to check if the grant is revoked in the `checkRevoked` property.
25
+ * Revoked grants are filtered out by default; set `checkRevoked: false` to include them.
29
26
  */
30
27
  export type FetchGrantsRequest = Omit<FetchPermissionsParams, 'author' | 'target' | 'remote'> & {
31
28
  /** Optional DID specifying the remote target DWN tenant to be queried. */
32
29
  from?: string;
33
- /** Optionally check if the grant has been revoked. */
34
- checkRevoked?: boolean;
35
30
  };
36
31
  /**
37
32
  * Represents the request payload for configuring a protocol on a Decentralized Web Node (DWN).
38
33
  *
39
34
  * This request type is used to specify the configuration options for the protocol.
40
35
  */
41
- export type ProtocolsConfigureRequest = {
42
- /** Configuration options for the protocol. */
43
- message: Omit<DwnMessageParams[DwnInterface.ProtocolsConfigure], 'signer'>;
36
+ export type ProtocolsConfigureRequest = Omit<DwnMessageParams[DwnInterface.ProtocolsConfigure], 'signer'> & {
44
37
  /** When true, derives and injects $encryption public keys into the protocol definition. */
45
38
  encryption?: boolean;
46
39
  };
@@ -64,11 +57,9 @@ export type ProtocolsConfigureResponse = DwnResponseStatus & {
64
57
  * target the local DWN. If the `from` property is provided, the query will target the specified
65
58
  * remote DWN.
66
59
  */
67
- export type ProtocolsQueryRequest = {
60
+ export type ProtocolsQueryRequest = Omit<DwnMessageParams[DwnInterface.ProtocolsQuery], 'signer'> & {
68
61
  /** Optional DID specifying the remote target DWN tenant to be queried. */
69
62
  from?: string;
70
- /** Query filters and options that influence the results returned. */
71
- message: Omit<DwnMessageParams[DwnInterface.ProtocolsQuery], 'signer'>;
72
63
  };
73
64
  /**
74
65
  * Wraps the response from a protocols query, including the operation status and the list of
@@ -78,37 +69,6 @@ export type ProtocolsQueryResponse = DwnResponseStatus & {
78
69
  /** Array of protocols matching the query. */
79
70
  protocols: Protocol[];
80
71
  };
81
- /**
82
- * Type alias for {@link RecordsWriteRequest}
83
- */
84
- export type RecordsCreateRequest = RecordsWriteRequest;
85
- /**
86
- * Type alias for {@link RecordsWriteResponse}
87
- */
88
- export type RecordsCreateResponse = RecordsWriteResponse;
89
- /**
90
- * Represents a request to create a new record based on an existing one.
91
- *
92
- * This request type allows specifying the new data for the record, along with any additional
93
- * message parameters required for the write operation.
94
- */
95
- export type RecordsCreateFromRequest = {
96
- /** The DID of the entity authoring the record. */
97
- author: string;
98
- /** The new data for the record. */
99
- data: unknown;
100
- /** Optional additional parameters for the record write operation */
101
- message?: Omit<DwnMessageParams[DwnInterface.RecordsWrite], 'signer'>;
102
- /** The existing record instance that is being used as a basis for the new record. */
103
- record: Record;
104
- /**
105
- * Controls whether the new record should be auto-encrypted.
106
- *
107
- * If omitted, auto-detected from the source record: if the source record was
108
- * encrypted, the new record is automatically encrypted with a fresh DEK.
109
- */
110
- encryption?: boolean;
111
- };
112
72
  /**
113
73
  * Defines a request to delete a record from the Decentralized Web Node (DWN).
114
74
  *
@@ -116,13 +76,11 @@ export type RecordsCreateFromRequest = {
116
76
  * message parameters for the delete operation. If the `from` property is not provided, the record
117
77
  * will be deleted from the local DWN.
118
78
  */
119
- export type RecordsDeleteRequest = {
79
+ export type RecordsDeleteRequest = Omit<DwnMessageParams[DwnInterface.RecordsDelete], 'signer'> & {
120
80
  /** Optional DID specifying the remote target DWN tenant the record will be deleted from. */
121
81
  from?: string;
122
- /** Records must be scoped to a specific protocol */
82
+ /** Protocol URI for permission grant resolution. */
123
83
  protocol?: string;
124
- /** The parameters for the delete operation. */
125
- message: Omit<DwnMessageParams[DwnInterface.RecordsDelete], 'signer'>;
126
84
  };
127
85
  /**
128
86
  * Encapsulates a request to query records from a Decentralized Web Node (DWN).
@@ -131,13 +89,9 @@ export type RecordsDeleteRequest = {
131
89
  * parameters, and optionally the target DWN to query from. If the `from` property is not provided,
132
90
  * the query will target the local DWN.
133
91
  */
134
- export type RecordsQueryRequest = {
92
+ export type RecordsQueryRequest = Omit<DwnMessageParams[DwnInterface.RecordsQuery], 'signer'> & {
135
93
  /** Optional DID specifying the remote target DWN tenant to query from and return results. */
136
94
  from?: string;
137
- /** Records must be scoped to a specific protocol */
138
- protocol?: string;
139
- /** The parameters for the query operation, detailing the criteria for selecting records. */
140
- message: Omit<DwnMessageParams[DwnInterface.RecordsQuery], 'signer'>;
141
95
  /** When true, automatically decrypts encrypted records in the query results. */
142
96
  encryption?: boolean;
143
97
  };
@@ -147,7 +101,7 @@ export type RecordsQueryRequest = {
147
101
  */
148
102
  export type RecordsQueryResponse = DwnResponseStatus & {
149
103
  /** Array of records matching the query. */
150
- records?: Record[];
104
+ records: Record[];
151
105
  /** If there are additional results, the messageCid of the last record will be returned as a pagination cursor. */
152
106
  cursor?: DwnPaginationCursor;
153
107
  };
@@ -158,13 +112,11 @@ export type RecordsQueryResponse = DwnResponseStatus & {
158
112
  * additional parameters for the read operation. It's useful for fetching the details of a single
159
113
  * record by its identifier or other criteria.
160
114
  */
161
- export type RecordsReadRequest = {
115
+ export type RecordsReadRequest = Omit<DwnMessageParams[DwnInterface.RecordsRead], 'signer'> & {
162
116
  /** Optional DID specifying the remote target DWN tenant the record will be read from. */
163
117
  from?: string;
164
- /** Records must be scoped to a specific protocol */
118
+ /** Protocol URI for permission grant resolution. */
165
119
  protocol?: string;
166
- /** The parameters for the read operation, detailing the criteria for selecting the record. */
167
- message: Omit<DwnMessageParams[DwnInterface.RecordsRead], 'signer'>;
168
120
  /** When true, automatically decrypts the encrypted record data. */
169
121
  encryption?: boolean;
170
122
  };
@@ -183,13 +135,9 @@ export type RecordsReadResponse = DwnResponseStatus & {
183
135
  * matching records alongside a real-time stream of deduplicated, semantically-
184
136
  * typed change events (`create`, `update`, `delete`).
185
137
  */
186
- export type RecordsSubscribeRequest = {
138
+ export type RecordsSubscribeRequest = Omit<DwnMessageParams[DwnInterface.RecordsSubscribe], 'signer'> & {
187
139
  /** Optional DID specifying the remote target DWN tenant to subscribe from. */
188
140
  from?: string;
189
- /** Records must be scoped to a specific protocol. */
190
- protocol?: string;
191
- /** The parameters for the subscription operation, detailing the criteria for the subscription filter. */
192
- message: Omit<DwnMessageParams[DwnInterface.RecordsSubscribe], 'signer'>;
193
141
  };
194
142
  /** Encapsulates the response from a DWN RecordsSubscribeRequest. */
195
143
  export type RecordsSubscribeResponse = DwnResponseStatus & {
@@ -202,16 +150,10 @@ export type RecordsSubscribeResponse = DwnResponseStatus & {
202
150
  * This request type allows specifying the data for the new or updated record, along with any
203
151
  * additional message parameters required for the write operation, and an optional flag to indicate
204
152
  * whether the record should be immediately stored.
205
- *
206
- * @param data -
207
- * @param message - , excluding the signer.
208
- * @param store -
209
153
  */
210
- export type RecordsWriteRequest = {
154
+ export type RecordsWriteRequest = Omit<Partial<DwnMessageParams[DwnInterface.RecordsWrite]>, 'signer' | 'data' | 'protocol' | 'protocolPath'> & Pick<DwnMessageParams[DwnInterface.RecordsWrite], 'protocol' | 'protocolPath'> & {
211
155
  /** The data payload for the record, which can be of any type. */
212
156
  data: unknown;
213
- /** Optional additional parameters for the record write operation. */
214
- message?: Omit<Partial<DwnMessageParams[DwnInterface.RecordsWrite]>, 'signer'>;
215
157
  /**
216
158
  * Optional flag indicating whether the record should be immediately stored. If true, the record
217
159
  * is persisted in the DWN as part of the write operation. If false, the record is created,
@@ -238,7 +180,7 @@ export type RecordsWriteResponse = DwnResponseStatus & {
238
180
  * The `Record` instance representing the record that was successfully written to the
239
181
  * DWN as a result of the write operation.
240
182
  */
241
- record?: Record;
183
+ record: Record;
242
184
  };
243
185
  /**
244
186
  * Interface to interact with DWN Records and Protocols
@@ -260,25 +202,6 @@ export declare class DwnApi {
260
202
  connectedDid: string;
261
203
  delegateDid?: string;
262
204
  });
263
- /**
264
- * Returns a {@link TypedDwnApi} scoped to the given typed protocol.
265
- *
266
- * The returned API provides path autocompletion, typed data payloads,
267
- * and automatically injects the protocol URI and protocolPath into every
268
- * DWN operation.
269
- *
270
- * @param protocol - A typed protocol created via `defineProtocol()`.
271
- * @returns A `TypedDwnApi` instance bound to the given protocol.
272
- *
273
- * @example
274
- * ```ts
275
- * const social = dwn.using(SocialGraphProtocol);
276
- * const { record } = await social.write('friend', {
277
- * data: { did: 'did:example:alice' },
278
- * });
279
- * ```
280
- */
281
- using<D extends ProtocolDefinition, M extends SchemaMap>(protocol: TypedProtocol<D, M>): TypedDwnApi<D, M>;
282
205
  /**
283
206
  * API to interact with Grants
284
207
  *
@@ -304,11 +227,9 @@ export declare class DwnApi {
304
227
  query: (request: ProtocolsQueryRequest) => Promise<ProtocolsQueryResponse>;
305
228
  };
306
229
  /**
307
- * API to interact with DWN records (e.g., `dwn.records.create()`).
230
+ * API to interact with DWN records (e.g., `dwn.records.write()`).
308
231
  */
309
232
  get records(): {
310
- create: (request: RecordsCreateRequest) => Promise<RecordsCreateResponse>;
311
- createFrom: (request: RecordsCreateFromRequest) => Promise<RecordsWriteResponse>;
312
233
  delete: (request: RecordsDeleteRequest) => Promise<DwnResponseStatus>;
313
234
  query: (request: RecordsQueryRequest) => Promise<RecordsQueryResponse>;
314
235
  read: (request: RecordsReadRequest) => Promise<RecordsReadResponse>;
@@ -1 +1 @@
1
- {"version":3,"file":"dwn-api.d.ts","sourceRoot":"","sources":["../../src/dwn-api.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACV,iBAAiB,EACjB,mBAAmB,EAEnB,gBAAgB,EAChB,mBAAmB,EAEnB,iBAAiB,EACjB,4BAA4B,EAC5B,sBAAsB,EAEtB,SAAS,EAAE,MAAM,cAAc,CAAC;AAOlC,OAAO,EAAE,YAAY,EAAmB,MAAM,cAAc,CAAC;AAE7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpE,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;AAEjD;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,4BAA4B,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC,GAAG;IACtG,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,sBAAsB,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC,GAAG;I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BAAoB,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;QACtE,KAAK,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;QACvE,IAAI,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;QACpE,SAAS,EAAE,CAAC,OAAO,EAAE,uBAAuB,KAAK,OAAO,CAAC,wBAAwB,CAAC,CAAC;QACnF,KAAK,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;KACtE,CA6ZJ;CACF"}
@@ -0,0 +1,138 @@
1
+ /**
2
+ * NOTE: Added reference types here to avoid a `pnpm` bug during build.
3
+ * https://github.com/enboxorg/enbox/pull/507
4
+ */
5
+ import type { AnonymousDwnApi, DwnPaginationCursor, DwnResponseStatus } from '@enbox/agent';
6
+ import type { DateSort, Pagination, ProtocolDefinition, ProtocolsQueryFilter, RecordsFilter } from '@enbox/dwn-sdk-js';
7
+ import { ReadOnlyRecord } from './read-only-record.js';
8
+ /**
9
+ * Request to query public records from a remote DWN.
10
+ *
11
+ * @beta
12
+ */
13
+ export type ReaderRecordsQueryRequest = {
14
+ /** The DID of the remote DWN to query (required — reader is remote-only). */
15
+ from: string;
16
+ /** Filter criteria for the query. */
17
+ filter: RecordsFilter;
18
+ /** Sort order for results. */
19
+ dateSort?: DateSort;
20
+ /** Pagination options. */
21
+ pagination?: Pagination;
22
+ };
23
+ /**
24
+ * Response from a reader records query.
25
+ *
26
+ * @beta
27
+ */
28
+ export type ReaderRecordsQueryResponse = DwnResponseStatus & {
29
+ /** Array of read-only records matching the query. */
30
+ records: ReadOnlyRecord[];
31
+ /** Pagination cursor for fetching the next page. */
32
+ cursor?: DwnPaginationCursor;
33
+ };
34
+ /**
35
+ * Request to read a specific public record from a remote DWN.
36
+ *
37
+ * @beta
38
+ */
39
+ export type ReaderRecordsReadRequest = {
40
+ /** The DID of the remote DWN to read from (required — reader is remote-only). */
41
+ from: string;
42
+ /** Filter to identify the record (typically `{ recordId: '...' }`). */
43
+ filter: RecordsFilter;
44
+ };
45
+ /**
46
+ * Response from a reader records read.
47
+ *
48
+ * @beta
49
+ */
50
+ export type ReaderRecordsReadResponse = DwnResponseStatus & {
51
+ /** The read-only record, if found. */
52
+ record?: ReadOnlyRecord;
53
+ };
54
+ /**
55
+ * Request to count public records on a remote DWN.
56
+ *
57
+ * @beta
58
+ */
59
+ export type ReaderRecordsCountRequest = {
60
+ /** The DID of the remote DWN to count records in (required). */
61
+ from: string;
62
+ /** Filter criteria for counting. */
63
+ filter: RecordsFilter;
64
+ };
65
+ /**
66
+ * Response from a reader records count.
67
+ *
68
+ * @beta
69
+ */
70
+ export type ReaderRecordsCountResponse = DwnResponseStatus & {
71
+ /** The number of matching public records. */
72
+ count?: number;
73
+ };
74
+ /**
75
+ * Request to query published protocols from a remote DWN.
76
+ *
77
+ * @beta
78
+ */
79
+ export type ReaderProtocolsQueryRequest = {
80
+ /** The DID of the remote DWN to query protocols from (required). */
81
+ from: string;
82
+ /** Optional filter for the protocol query. */
83
+ filter?: ProtocolsQueryFilter;
84
+ };
85
+ /**
86
+ * Response from a reader protocols query.
87
+ *
88
+ * @beta
89
+ */
90
+ export type ReaderProtocolsQueryResponse = DwnResponseStatus & {
91
+ /** Array of published protocol definitions. */
92
+ protocols: ProtocolDefinition[];
93
+ };
94
+ /**
95
+ * A read-only API for querying public data on remote DWNs without any identity or signing keys.
96
+ *
97
+ * This class mirrors the shape of {@link DwnApi}'s `records` and `protocols`
98
+ * namespaces, but restricts to read-path operations and requires a `from` DID
99
+ * on every call (remote-only). All messages are unsigned, so only published
100
+ * records and protocols are accessible.
101
+ *
102
+ * Obtain an instance via {@link Web5.anonymous | `Web5.anonymous()`}.
103
+ *
104
+ * @example
105
+ * ```ts
106
+ * const { dwn } = Web5.anonymous();
107
+ *
108
+ * const { records } = await dwn.records.query({
109
+ * from: 'did:dht:alice...',
110
+ * filter: { protocol: 'https://social.example/posts', protocolPath: 'post' },
111
+ * });
112
+ *
113
+ * for (const record of records) {
114
+ * console.log(record.id, await record.data.text());
115
+ * }
116
+ * ```
117
+ *
118
+ * @beta
119
+ */
120
+ export declare class DwnReaderApi {
121
+ private _anonymousDwn;
122
+ constructor(anonymousDwn: AnonymousDwnApi);
123
+ /**
124
+ * API to interact with public DWN records (query, read, count).
125
+ */
126
+ get records(): {
127
+ query: (request: ReaderRecordsQueryRequest) => Promise<ReaderRecordsQueryResponse>;
128
+ read: (request: ReaderRecordsReadRequest) => Promise<ReaderRecordsReadResponse>;
129
+ count: (request: ReaderRecordsCountRequest) => Promise<ReaderRecordsCountResponse>;
130
+ };
131
+ /**
132
+ * API to query published protocol definitions from remote DWNs.
133
+ */
134
+ get protocols(): {
135
+ query: (request: ReaderProtocolsQueryRequest) => Promise<ReaderProtocolsQueryResponse>;
136
+ };
137
+ }
138
+ //# sourceMappingURL=dwn-reader-api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dwn-reader-api.d.ts","sourceRoot":"","sources":["../../src/dwn-reader-api.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC5F,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EACV,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAMvD;;;;GAIG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,MAAM,EAAE,aAAa,CAAC;IACtB,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,0BAA0B;IAC1B,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,CAAC;AAEF;;;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C,CAAC;QACnF,IAAI,EAAE,CAAC,OAAO,EAAE,wBAAwB,KAAK,OAAO,CAAC,yBAAyB,CAAC,CAAC;QAChF,KAAK,EAAE,CAAC,OAAO,EAAE,yBAAyB,KAAK,OAAO,CAAC,0BAA0B,CAAC,CAAC;KAClF,CAiEF;IAED;;OAEG;IACH,IAAI,SAAS,IAAI;QACf,KAAK,EAAE,CAAC,OAAO,EAAE,2BAA2B,KAAK,OAAO,CAAC,4BAA4B,CAAC,CAAC;KACtF,CAkBF;CACF"}
@@ -22,15 +22,16 @@
22
22
  */
23
23
  export * from './define-protocol.js';
24
24
  export * from './did-api.js';
25
- export * from './dwn-api.js';
25
+ export * from './dwn-reader-api.js';
26
26
  export * from './grant-revocation.js';
27
27
  export * from './live-query.js';
28
28
  export * from './permission-grant.js';
29
29
  export * from './permission-request.js';
30
30
  export * from './protocol.js';
31
31
  export * from './protocol-types.js';
32
+ export * from './read-only-record.js';
32
33
  export * from './record.js';
33
- export * from './typed-dwn-api.js';
34
+ export * from './typed-web5.js';
34
35
  export * from './vc-api.js';
35
36
  export * from './web5.js';
36
37
  import * as utils from './utils.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAE1B,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAE1B,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,CAAC"}
@@ -1,5 +1,5 @@
1
- import type { RecordsQueryReplyEntry } from '@enbox/dwn-sdk-js';
2
1
  import type { DwnMessageSubscription, PermissionsApi, Web5Agent } from '@enbox/agent';
2
+ import type { PaginationCursor, RecordsQueryReplyEntry } from '@enbox/dwn-sdk-js';
3
3
  import { Record } from './record.js';
4
4
  /**
5
5
  * The type of change that occurred to a record.
@@ -43,6 +43,8 @@ export type LiveQueryOptions = {
43
43
  permissionsApi?: PermissionsApi;
44
44
  /** The initial snapshot entries from the subscribe reply. */
45
45
  initialEntries: RecordsQueryReplyEntry[];
46
+ /** Pagination cursor for fetching the next page of initial results. */
47
+ cursor?: PaginationCursor;
46
48
  /** The underlying DWN subscription handle. */
47
49
  subscription: DwnMessageSubscription;
48
50
  };
@@ -97,6 +99,16 @@ export type LiveQueryOptions = {
97
99
  export declare class LiveQuery extends EventTarget {
98
100
  /** The initial snapshot of matching records. */
99
101
  readonly records: Record[];
102
+ /**
103
+ * Pagination cursor for fetching the next page of initial results.
104
+ *
105
+ * When the initial snapshot was limited (via `pagination.limit`), this
106
+ * cursor can be passed in a subsequent `records.subscribe()` call to
107
+ * continue from where the previous snapshot left off.
108
+ *
109
+ * `undefined` when there are no more results.
110
+ */
111
+ readonly cursor?: PaginationCursor;
100
112
  /** The underlying DWN subscription handle. */
101
113
  private _subscription;
102
114
  /** Tracks known record states for dedup and change-type classification. */
@@ -1 +1 @@
1
- {"version":3,"file":"live-query.d.ts","sourceRoot":"","sources":["../../src/live-query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAItF,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,2DAA2D;IAC3D,IAAI,EAAE,gBAAgB,CAAC;IAEvB,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;;GAMG;AACH,qBAAa,iBAAkB,SAAQ,WAAW,CAAC,YAAY,CAAC;gBAClD,MAAM,EAAE,YAAY;CAGjC;AAED;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,2DAA2D;IAC3D,KAAK,EAAE,SAAS,CAAC;IAEjB,qCAAqC;IACrC,YAAY,EAAE,MAAM,CAAC;IAErB,6DAA6D;IAC7D,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,yDAAyD;IACzD,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,iEAAiE;IACjE,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,oEAAoE;IACpE,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC,6DAA6D;IAC7D,cAAc,EAAE,sBAAsB,EAAE,CAAC;IAEzC,8CAA8C;IAC9C,YAAY,EAAE,sBAAsB,CAAC;C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