@enbox/api 0.0.8 → 0.1.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.
- package/dist/browser.mjs +46 -53
- package/dist/browser.mjs.map +4 -4
- package/dist/esm/define-protocol.js +37 -0
- package/dist/esm/define-protocol.js.map +1 -0
- package/dist/esm/dwn-api.js +54 -26
- package/dist/esm/dwn-api.js.map +1 -1
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/live-query.js +153 -0
- package/dist/esm/live-query.js.map +1 -0
- package/dist/esm/protocol-types.js +8 -0
- package/dist/esm/protocol-types.js.map +1 -0
- package/dist/esm/record.js.map +1 -1
- package/dist/esm/typed-dwn-api.js +182 -0
- package/dist/esm/typed-dwn-api.js.map +1 -0
- package/dist/esm/web5.js +3 -2
- package/dist/esm/web5.js.map +1 -1
- package/dist/types/define-protocol.d.ts +37 -0
- package/dist/types/define-protocol.d.ts.map +1 -0
- package/dist/types/dwn-api.d.ts +32 -17
- package/dist/types/dwn-api.d.ts.map +1 -1
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/live-query.d.ts +136 -0
- package/dist/types/live-query.d.ts.map +1 -0
- package/dist/types/protocol-types.d.ts +95 -0
- package/dist/types/protocol-types.d.ts.map +1 -0
- package/dist/types/record.d.ts +1 -1
- package/dist/types/record.d.ts.map +1 -1
- package/dist/types/typed-dwn-api.d.ts +193 -0
- package/dist/types/typed-dwn-api.d.ts.map +1 -0
- package/dist/types/web5.d.ts.map +1 -1
- package/package.json +14 -17
- package/src/define-protocol.ts +48 -0
- package/src/dwn-api.ts +87 -49
- package/src/index.ts +4 -0
- package/src/live-query.ts +245 -0
- package/src/protocol-types.ts +171 -0
- package/src/record.ts +3 -3
- package/src/typed-dwn-api.ts +370 -0
- package/src/web5.ts +3 -2
- package/dist/browser.js +0 -2224
- package/dist/browser.js.map +0 -7
- package/dist/esm/subscription-util.js +0 -35
- package/dist/esm/subscription-util.js.map +0 -1
- package/dist/types/subscription-util.d.ts +0 -19
- package/dist/types/subscription-util.d.ts.map +0 -1
- package/src/subscription-util.ts +0 -44
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A type-safe wrapper around {@link DwnApi} scoped to a single protocol.
|
|
3
|
+
*
|
|
4
|
+
* `TypedDwnApi` is created via `dwn.using(typedProtocol)` and provides
|
|
5
|
+
* autocompletion for protocol paths, typed data payloads, and tag shapes.
|
|
6
|
+
*
|
|
7
|
+
* Every method delegates to the corresponding `dwn.records.*` method,
|
|
8
|
+
* injecting the protocol URI, protocolPath, and schema automatically.
|
|
9
|
+
*/
|
|
10
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
11
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
12
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
13
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
14
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
15
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
16
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
// TypedDwnApi class
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
/**
|
|
23
|
+
* A protocol-scoped wrapper around `DwnApi` that automatically injects
|
|
24
|
+
* the `protocol` URI, `protocolPath`, and `schema` into every DWN operation.
|
|
25
|
+
*
|
|
26
|
+
* Obtain an instance via `dwn.using(typedProtocol)`.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const social = dwn.using(SocialGraphProtocol);
|
|
31
|
+
*
|
|
32
|
+
* // Write — path and data type are checked at compile time
|
|
33
|
+
* const { record } = await social.write('friend', {
|
|
34
|
+
* data: { did: 'did:example:alice', alias: 'Alice' },
|
|
35
|
+
* });
|
|
36
|
+
*
|
|
37
|
+
* // Query — protocol and protocolPath are auto-injected
|
|
38
|
+
* const { records } = await social.query('friend', {
|
|
39
|
+
* filter: { tags: { did: 'did:example:alice' } },
|
|
40
|
+
* });
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export class TypedDwnApi {
|
|
44
|
+
constructor(dwn, protocol) {
|
|
45
|
+
this._dwn = dwn;
|
|
46
|
+
this._definition = protocol.definition;
|
|
47
|
+
}
|
|
48
|
+
/** The protocol URI. */
|
|
49
|
+
get protocol() {
|
|
50
|
+
return this._definition.protocol;
|
|
51
|
+
}
|
|
52
|
+
/** The raw protocol definition. */
|
|
53
|
+
get definition() {
|
|
54
|
+
return this._definition;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Configures (installs) this protocol on the local DWN.
|
|
58
|
+
*
|
|
59
|
+
* @param options - Optional overrides like `encryption`.
|
|
60
|
+
*/
|
|
61
|
+
configure(options) {
|
|
62
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
return this._dwn.protocols.configure({
|
|
64
|
+
message: { definition: this._definition },
|
|
65
|
+
encryption: options === null || options === void 0 ? void 0 : options.encryption,
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Write a record at the given protocol path.
|
|
71
|
+
*
|
|
72
|
+
* @param path - The protocol path (e.g. `'friend'`, `'group/member'`).
|
|
73
|
+
* @param request - Write options including typed `data`.
|
|
74
|
+
*/
|
|
75
|
+
write(path, request) {
|
|
76
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
var _a, _b, _c;
|
|
78
|
+
const typeName = lastSegment(path);
|
|
79
|
+
const typeEntry = this._definition.types[typeName];
|
|
80
|
+
return this._dwn.records.write({
|
|
81
|
+
data: request.data,
|
|
82
|
+
store: request.store,
|
|
83
|
+
encryption: request.encryption,
|
|
84
|
+
message: Object.assign(Object.assign({}, request.message), { protocol: this._definition.protocol, protocolPath: path, schema: typeEntry === null || typeEntry === void 0 ? void 0 : typeEntry.schema, dataFormat: (_b = (_a = request.message) === null || _a === void 0 ? void 0 : _a.dataFormat) !== null && _b !== void 0 ? _b : (_c = typeEntry === null || typeEntry === void 0 ? void 0 : typeEntry.dataFormats) === null || _c === void 0 ? void 0 : _c[0] }),
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Query records at the given protocol path.
|
|
90
|
+
*
|
|
91
|
+
* @param path - The protocol path to query.
|
|
92
|
+
* @param request - Query options including optional filter, sort, and pagination.
|
|
93
|
+
*/
|
|
94
|
+
query(path, request) {
|
|
95
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
96
|
+
const typeName = lastSegment(path);
|
|
97
|
+
const typeEntry = this._definition.types[typeName];
|
|
98
|
+
return this._dwn.records.query({
|
|
99
|
+
from: request === null || request === void 0 ? void 0 : request.from,
|
|
100
|
+
protocol: this._definition.protocol,
|
|
101
|
+
encryption: request === null || request === void 0 ? void 0 : request.encryption,
|
|
102
|
+
message: {
|
|
103
|
+
filter: Object.assign(Object.assign({}, request === null || request === void 0 ? void 0 : request.filter), { protocol: this._definition.protocol, protocolPath: path, schema: typeEntry === null || typeEntry === void 0 ? void 0 : typeEntry.schema }),
|
|
104
|
+
dateSort: request === null || request === void 0 ? void 0 : request.dateSort,
|
|
105
|
+
pagination: request === null || request === void 0 ? void 0 : request.pagination,
|
|
106
|
+
protocolRole: request === null || request === void 0 ? void 0 : request.protocolRole,
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Read a single record at the given protocol path.
|
|
113
|
+
*
|
|
114
|
+
* @param path - The protocol path to read from.
|
|
115
|
+
* @param request - Read options including a filter to identify the record.
|
|
116
|
+
*/
|
|
117
|
+
read(path, request) {
|
|
118
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
+
const typeName = lastSegment(path);
|
|
120
|
+
const typeEntry = this._definition.types[typeName];
|
|
121
|
+
return this._dwn.records.read({
|
|
122
|
+
from: request.from,
|
|
123
|
+
protocol: this._definition.protocol,
|
|
124
|
+
encryption: request.encryption,
|
|
125
|
+
message: {
|
|
126
|
+
filter: Object.assign(Object.assign({}, request.filter), { protocol: this._definition.protocol, protocolPath: path, schema: typeEntry === null || typeEntry === void 0 ? void 0 : typeEntry.schema }),
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Delete a record at the given protocol path.
|
|
133
|
+
*
|
|
134
|
+
* @param path - The protocol path (used for permission scoping).
|
|
135
|
+
* @param request - Delete options including the `recordId`.
|
|
136
|
+
*/
|
|
137
|
+
delete(_path, request) {
|
|
138
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
139
|
+
return this._dwn.records.delete({
|
|
140
|
+
from: request.from,
|
|
141
|
+
protocol: this._definition.protocol,
|
|
142
|
+
message: {
|
|
143
|
+
recordId: request.recordId,
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Subscribe to records at the given protocol path.
|
|
150
|
+
*
|
|
151
|
+
* Returns a {@link LiveQuery} that atomically provides an initial snapshot
|
|
152
|
+
* and a real-time stream of deduplicated change events.
|
|
153
|
+
*
|
|
154
|
+
* @param path - The protocol path to subscribe to.
|
|
155
|
+
* @param request - Subscribe options including optional filter and role.
|
|
156
|
+
*/
|
|
157
|
+
subscribe(path, request) {
|
|
158
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
159
|
+
const typeName = lastSegment(path);
|
|
160
|
+
const typeEntry = this._definition.types[typeName];
|
|
161
|
+
return this._dwn.records.subscribe({
|
|
162
|
+
from: request === null || request === void 0 ? void 0 : request.from,
|
|
163
|
+
protocol: this._definition.protocol,
|
|
164
|
+
message: {
|
|
165
|
+
filter: Object.assign(Object.assign({}, request === null || request === void 0 ? void 0 : request.filter), { protocol: this._definition.protocol, protocolPath: path, schema: typeEntry === null || typeEntry === void 0 ? void 0 : typeEntry.schema }),
|
|
166
|
+
protocolRole: request === null || request === void 0 ? void 0 : request.protocolRole,
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
// ---------------------------------------------------------------------------
|
|
173
|
+
// Helpers
|
|
174
|
+
// ---------------------------------------------------------------------------
|
|
175
|
+
/**
|
|
176
|
+
* Returns the last segment of a slash-delimited path.
|
|
177
|
+
*/
|
|
178
|
+
function lastSegment(path) {
|
|
179
|
+
const parts = path.split('/');
|
|
180
|
+
return parts[parts.length - 1];
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=typed-dwn-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typed-dwn-api.js","sourceRoot":"","sources":["../../src/typed-dwn-api.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;;;;;;;;;;AA2JH,8EAA8E;AAC9E,oBAAoB;AACpB,8EAA8E;AAE9E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAO,WAAW;IAOtB,YAAY,GAAW,EAAE,QAA6B;QACpD,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC;IACzC,CAAC;IAED,wBAAwB;IACxB,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;IACnC,CAAC;IAED,mCAAmC;IACnC,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED;;;;OAIG;IACU,SAAS,CAAC,OAAkC;;YACvD,OAAO,IAAI,CAAC,IAAI,C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this.__rest) || function (s, e) {
|
|
|
23
23
|
}
|
|
24
24
|
return t;
|
|
25
25
|
};
|
|
26
|
-
import { DwnRegistrar
|
|
26
|
+
import { DwnRegistrar } from '@enbox/dwn-clients';
|
|
27
|
+
import { WalletConnect, Web5UserAgent } from '@enbox/agent';
|
|
27
28
|
import { DidApi } from './did-api.js';
|
|
28
29
|
import { DwnApi } from './dwn-api.js';
|
|
29
30
|
import { PermissionGrant } from './permission-grant.js';
|
|
@@ -154,7 +155,7 @@ export class Web5 {
|
|
|
154
155
|
purposes: ['assertionMethod', 'authentication']
|
|
155
156
|
},
|
|
156
157
|
{
|
|
157
|
-
algorithm: '
|
|
158
|
+
algorithm: 'X25519',
|
|
158
159
|
id: 'enc',
|
|
159
160
|
purposes: ['keyAgreement']
|
|
160
161
|
}
|
package/dist/esm/web5.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web5.js","sourceRoot":"","sources":["../../src/web5.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,2CAA2C;;;;;;;;;;;;;;;;;;;;;AAc3C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;
|
|
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,EAA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AC3G,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,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Factory function for creating typed protocol definitions.
|
|
3
|
+
*
|
|
4
|
+
* `defineProtocol()` wraps a standard {@link ProtocolDefinition} with
|
|
5
|
+
* compile-time type metadata so that {@link TypedDwnApi} can provide
|
|
6
|
+
* path autocompletion, data-shape inference, and tag type safety.
|
|
7
|
+
*/
|
|
8
|
+
import type { ProtocolDefinition } from '@enbox/dwn-sdk-js';
|
|
9
|
+
import type { SchemaMap, TypedProtocol } from './protocol-types.js';
|
|
10
|
+
/**
|
|
11
|
+
* Creates a {@link TypedProtocol} from a plain DWN protocol definition and
|
|
12
|
+
* an optional schema map that associates TypeScript types with protocol type
|
|
13
|
+
* names.
|
|
14
|
+
*
|
|
15
|
+
* The `definition` argument is returned as-is (no cloning). The schema map
|
|
16
|
+
* is a phantom type parameter — it exists only at compile time to thread
|
|
17
|
+
* type information through to `TypedDwnApi`.
|
|
18
|
+
*
|
|
19
|
+
* @param definition - A standard `ProtocolDefinition` object.
|
|
20
|
+
* @param _schemaMap - A phantom value (e.g. `{} as MySchemaMap`) that carries
|
|
21
|
+
* the TypeScript type mapping. The runtime value is ignored.
|
|
22
|
+
* @returns A `TypedProtocol` containing the definition and inferred types.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const socialGraph = defineProtocol(SocialGraphDefinition, {} as {
|
|
27
|
+
* friend : { did: string; alias?: string };
|
|
28
|
+
* block : { did: string; reason?: string };
|
|
29
|
+
* });
|
|
30
|
+
*
|
|
31
|
+
* // socialGraph.definition is the raw ProtocolDefinition
|
|
32
|
+
* // TypedDwnApi infers paths like 'friend' | 'friend/message' and
|
|
33
|
+
* // data types from the schema map.
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function defineProtocol<D extends ProtocolDefinition, M extends SchemaMap = SchemaMap>(definition: D, _schemaMap?: M): TypedProtocol<D, M>;
|
|
37
|
+
//# sourceMappingURL=define-protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-protocol.d.ts","sourceRoot":"","sources":["../../src/define-protocol.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,cAAc,CAC5B,CAAC,SAAS,kBAAkB,EAC5B,CAAC,SAAS,SAAS,GAAG,SAAS,EAE/B,UAAU,EAAG,CAAC,EAEd,UAAU,CAAC,EAAE,CAAC,GACb,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAErB"}
|
package/dist/types/dwn-api.d.ts
CHANGED
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
* NOTE: Added reference types here to avoid a `pnpm` bug during build.
|
|
3
3
|
* https://github.com/enboxorg/enbox/pull/507
|
|
4
4
|
*/
|
|
5
|
-
import type { CreateGrantParams, CreateRequestParams, DwnMessageParams,
|
|
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
|
+
import { LiveQuery } from './live-query.js';
|
|
7
10
|
import { PermissionGrant } from './permission-grant.js';
|
|
8
11
|
import { PermissionRequest } from './permission-request.js';
|
|
9
12
|
import { Protocol } from './protocol.js';
|
|
10
13
|
import { Record } from './record.js';
|
|
14
|
+
import { TypedDwnApi } from './typed-dwn-api.js';
|
|
11
15
|
/**
|
|
12
16
|
* Represents the request payload for fetching permission requests from a Decentralized Web Node (DWN).
|
|
13
17
|
*
|
|
@@ -172,33 +176,25 @@ export type RecordsReadResponse = DwnResponseStatus & {
|
|
|
172
176
|
/** The record retrieved by the read operation. */
|
|
173
177
|
record: Record;
|
|
174
178
|
};
|
|
175
|
-
/** Subscription handler for Records */
|
|
176
|
-
export type RecordsSubscriptionHandler = (record: Record) => void;
|
|
177
179
|
/**
|
|
178
180
|
* Represents a request to subscribe to records from a Decentralized Web Node (DWN).
|
|
179
181
|
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
+
* Returns a {@link LiveQuery} that atomically provides an initial snapshot of
|
|
183
|
+
* matching records alongside a real-time stream of deduplicated, semantically-
|
|
184
|
+
* typed change events (`create`, `update`, `delete`).
|
|
182
185
|
*/
|
|
183
186
|
export type RecordsSubscribeRequest = {
|
|
184
187
|
/** Optional DID specifying the remote target DWN tenant to subscribe from. */
|
|
185
188
|
from?: string;
|
|
186
|
-
/** Records must be scoped to a specific protocol */
|
|
189
|
+
/** Records must be scoped to a specific protocol. */
|
|
187
190
|
protocol?: string;
|
|
188
|
-
/** The parameters for the subscription operation, detailing the criteria for the subscription filter */
|
|
191
|
+
/** The parameters for the subscription operation, detailing the criteria for the subscription filter. */
|
|
189
192
|
message: Omit<DwnMessageParams[DwnInterface.RecordsSubscribe], 'signer'>;
|
|
190
|
-
/** The handler to process the subscription events */
|
|
191
|
-
subscriptionHandler: RecordsSubscriptionHandler;
|
|
192
|
-
/** When true, indicates encryption is active (decryption happens on subsequent reads). */
|
|
193
|
-
encryption?: boolean;
|
|
194
193
|
};
|
|
195
|
-
/** Encapsulates the response from a DWN
|
|
194
|
+
/** Encapsulates the response from a DWN RecordsSubscribeRequest. */
|
|
196
195
|
export type RecordsSubscribeResponse = DwnResponseStatus & {
|
|
197
|
-
/**
|
|
198
|
-
|
|
199
|
-
*
|
|
200
|
-
* */
|
|
201
|
-
subscription?: DwnMessageSubscription;
|
|
196
|
+
/** The live query instance, or `undefined` if the request failed. */
|
|
197
|
+
liveQuery?: LiveQuery;
|
|
202
198
|
};
|
|
203
199
|
/**
|
|
204
200
|
* Defines a request to write (create) a record to a Decentralized Web Node (DWN).
|
|
@@ -264,6 +260,25 @@ export declare class DwnApi {
|
|
|
264
260
|
connectedDid: string;
|
|
265
261
|
delegateDid?: string;
|
|
266
262
|
});
|
|
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>;
|
|
267
282
|
/**
|
|
268
283
|
* API to interact with Grants
|
|
269
284
|
*
|
|
@@ -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,
|
|
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,Q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AoB,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;QAC1E,UAAU,EAAE,CAAC,OAAO,EAAE,wBAAwB,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;QACjF,MAAM,EAAE,CAAC,OAAO,EAAE,oBAAoB,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,CAscJ;CACF"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -20,13 +20,17 @@
|
|
|
20
20
|
*
|
|
21
21
|
* @packageDocumentation
|
|
22
22
|
*/
|
|
23
|
+
export * from './define-protocol.js';
|
|
23
24
|
export * from './did-api.js';
|
|
24
25
|
export * from './dwn-api.js';
|
|
25
26
|
export * from './grant-revocation.js';
|
|
27
|
+
export * from './live-query.js';
|
|
26
28
|
export * from './permission-grant.js';
|
|
27
29
|
export * from './permission-request.js';
|
|
28
30
|
export * from './protocol.js';
|
|
31
|
+
export * from './protocol-types.js';
|
|
29
32
|
export * from './record.js';
|
|
33
|
+
export * from './typed-dwn-api.js';
|
|
30
34
|
export * from './vc-api.js';
|
|
31
35
|
export * from './web5.js';
|
|
32
36
|
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,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,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,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"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type { RecordsQueryReplyEntry } from '@enbox/dwn-sdk-js';
|
|
2
|
+
import type { DwnMessageSubscription, PermissionsApi, Web5Agent } from '@enbox/agent';
|
|
3
|
+
import { Record } from './record.js';
|
|
4
|
+
/**
|
|
5
|
+
* The type of change that occurred to a record.
|
|
6
|
+
*/
|
|
7
|
+
export type RecordChangeType = 'create' | 'update' | 'delete';
|
|
8
|
+
/**
|
|
9
|
+
* Describes a change to a record in a {@link LiveQuery}.
|
|
10
|
+
*/
|
|
11
|
+
export type RecordChange = {
|
|
12
|
+
/** Whether the record was created, updated, or deleted. */
|
|
13
|
+
type: RecordChangeType;
|
|
14
|
+
/** The record affected by the change. */
|
|
15
|
+
record: Record;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* A `CustomEvent` subclass carrying a {@link RecordChange} as its `detail`.
|
|
19
|
+
*
|
|
20
|
+
* Dispatched on the {@link LiveQuery} `EventTarget` for both the specific
|
|
21
|
+
* change-type event (`create`, `update`, `delete`) and the catch-all `change`
|
|
22
|
+
* event.
|
|
23
|
+
*/
|
|
24
|
+
export declare class RecordChangeEvent extends CustomEvent<RecordChange> {
|
|
25
|
+
constructor(change: RecordChange);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Options for creating a {@link LiveQuery}.
|
|
29
|
+
* @internal — Constructed by `DwnApi.records.subscribe()`, not by end users.
|
|
30
|
+
*/
|
|
31
|
+
export type LiveQueryOptions = {
|
|
32
|
+
/** The agent instance used to construct Record objects. */
|
|
33
|
+
agent: Web5Agent;
|
|
34
|
+
/** The DID of the connected user. */
|
|
35
|
+
connectedDid: string;
|
|
36
|
+
/** Optional delegate DID for permission-delegated access. */
|
|
37
|
+
delegateDid?: string;
|
|
38
|
+
/** Optional protocol role for role-authorized access. */
|
|
39
|
+
protocolRole?: string;
|
|
40
|
+
/** Optional remote DWN origin if subscribing to a remote DWN. */
|
|
41
|
+
remoteOrigin?: string;
|
|
42
|
+
/** The permissions API instance for constructing Record objects. */
|
|
43
|
+
permissionsApi?: PermissionsApi;
|
|
44
|
+
/** The initial snapshot entries from the subscribe reply. */
|
|
45
|
+
initialEntries: RecordsQueryReplyEntry[];
|
|
46
|
+
/** The underlying DWN subscription handle. */
|
|
47
|
+
subscription: DwnMessageSubscription;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* A live query that combines an initial snapshot of matching records with a
|
|
51
|
+
* real-time stream of deduplicated, semantically-typed change events.
|
|
52
|
+
*
|
|
53
|
+
* `LiveQuery` extends `EventTarget` so that standard `addEventListener` /
|
|
54
|
+
* `removeEventListener` work out of the box. For convenience, the typed
|
|
55
|
+
* {@link LiveQuery.on | `.on()`} method provides a cleaner API that returns an
|
|
56
|
+
* unsubscribe function.
|
|
57
|
+
*
|
|
58
|
+
* ### Events
|
|
59
|
+
*
|
|
60
|
+
* | Event name | `detail` type | Description |
|
|
61
|
+
* |---|---|---|
|
|
62
|
+
* | `create` | {@link RecordChange} | A new record was written |
|
|
63
|
+
* | `update` | {@link RecordChange} | An existing record was updated |
|
|
64
|
+
* | `delete` | {@link RecordChange} | A record was deleted |
|
|
65
|
+
* | `change` | {@link RecordChange} | Catch-all for any of the above |
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* const { liveQuery } = await dwn.records.subscribe({
|
|
70
|
+
* message: {
|
|
71
|
+
* filter: {
|
|
72
|
+
* protocol : chatProtocol.protocol,
|
|
73
|
+
* protocolPath : 'thread/message',
|
|
74
|
+
* }
|
|
75
|
+
* }
|
|
76
|
+
* });
|
|
77
|
+
*
|
|
78
|
+
* // Initial state
|
|
79
|
+
* for (const record of liveQuery.records) {
|
|
80
|
+
* renderMessage(record);
|
|
81
|
+
* }
|
|
82
|
+
*
|
|
83
|
+
* // Real-time changes
|
|
84
|
+
* liveQuery.on('create', (record) => appendMessage(record));
|
|
85
|
+
* liveQuery.on('update', (record) => refreshMessage(record));
|
|
86
|
+
* liveQuery.on('delete', (record) => removeMessage(record));
|
|
87
|
+
*
|
|
88
|
+
* // Or use the catch-all
|
|
89
|
+
* liveQuery.on('change', ({ type, record }) => {
|
|
90
|
+
* console.log(`${type}: ${record.id}`);
|
|
91
|
+
* });
|
|
92
|
+
*
|
|
93
|
+
* // Cleanup
|
|
94
|
+
* await liveQuery.close();
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
export declare class LiveQuery extends EventTarget {
|
|
98
|
+
/** The initial snapshot of matching records. */
|
|
99
|
+
readonly records: Record[];
|
|
100
|
+
/** The underlying DWN subscription handle. */
|
|
101
|
+
private _subscription;
|
|
102
|
+
/** Tracks known record states for dedup and change-type classification. */
|
|
103
|
+
private _knownRecords;
|
|
104
|
+
/** Whether the live query has been closed. */
|
|
105
|
+
private _closed;
|
|
106
|
+
constructor(options: LiveQueryOptions);
|
|
107
|
+
/**
|
|
108
|
+
* Process an incoming live event from the DWN subscription.
|
|
109
|
+
* Deduplicates against the initial snapshot and classifies the change type.
|
|
110
|
+
*
|
|
111
|
+
* @internal — Called by `DwnApi.records.subscribe()` when wiring up the subscription handler.
|
|
112
|
+
*/
|
|
113
|
+
handleEvent(record: Record): void;
|
|
114
|
+
/**
|
|
115
|
+
* Register a typed event handler. Returns an unsubscribe function.
|
|
116
|
+
*
|
|
117
|
+
* @param event - The event type to listen for.
|
|
118
|
+
* @param handler - The handler function.
|
|
119
|
+
* @returns A function that removes the handler when called.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```ts
|
|
123
|
+
* const off = live.on('create', (record) => console.log(record.id));
|
|
124
|
+
* off(); // stop listening
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
on(event: 'change', handler: (change: RecordChange) => void): () => void;
|
|
128
|
+
on(event: 'create', handler: (record: Record) => void): () => void;
|
|
129
|
+
on(event: 'update', handler: (record: Record) => void): () => void;
|
|
130
|
+
on(event: 'delete', handler: (record: Record) => void): () => void;
|
|
131
|
+
/**
|
|
132
|
+
* Close the underlying subscription and stop dispatching events.
|
|
133
|
+
*/
|
|
134
|
+
close(): Promise<void>;
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=live-query.d.ts.map
|
|
@@ -0,0 +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;;GA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