@kubun/plugin-blob-api 0.17.0 → 0.18.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.
- package/lib/index.d.ts +28 -1
- package/lib/index.js +2 -0
- package/package.json +4 -4
package/lib/index.d.ts
CHANGED
|
@@ -18,15 +18,28 @@ export type AttachmentInfo = {
|
|
|
18
18
|
};
|
|
19
19
|
export type BeginFetchParams = {
|
|
20
20
|
attachmentID: string;
|
|
21
|
+
documentID: string;
|
|
21
22
|
chunkSize: number;
|
|
22
23
|
chunkDigests: Array<Uint8Array>;
|
|
23
24
|
};
|
|
24
25
|
export type StageChunkParams = {
|
|
25
26
|
attachmentID: string;
|
|
27
|
+
documentID: string;
|
|
26
28
|
index: number;
|
|
27
29
|
offset: number;
|
|
28
30
|
bytes: Uint8Array;
|
|
29
31
|
};
|
|
32
|
+
export type CompleteFetchParams = {
|
|
33
|
+
attachmentID: string;
|
|
34
|
+
documentID: string;
|
|
35
|
+
};
|
|
36
|
+
export type BindDownloadedAttachmentParams = {
|
|
37
|
+
attachmentID: string;
|
|
38
|
+
documentID: string;
|
|
39
|
+
chunkSize: number;
|
|
40
|
+
chunkDigests: Array<Uint8Array>;
|
|
41
|
+
readChunk(index: number): Promise<Uint8Array>;
|
|
42
|
+
};
|
|
30
43
|
export type BlobAPI = {
|
|
31
44
|
writeAttachment(input: ReadableStream<Uint8Array>, options?: WriteAttachmentOptions): Promise<string>;
|
|
32
45
|
writeAttachmentTx(stores: StoreProvider, input: ReadableStream<Uint8Array>, options?: WriteAttachmentOptions): Promise<string>;
|
|
@@ -36,5 +49,19 @@ export type BlobAPI = {
|
|
|
36
49
|
beginFetch(params: BeginFetchParams): Promise<void>;
|
|
37
50
|
getPresentChunks(attachmentID: string): Promise<Array<number>>;
|
|
38
51
|
stageChunk(params: StageChunkParams): Promise<void>;
|
|
39
|
-
completeFetch(
|
|
52
|
+
completeFetch(params: CompleteFetchParams): Promise<void>;
|
|
53
|
+
hasSource(attachmentID: string, documentID: string): Promise<boolean>;
|
|
54
|
+
holdsDocumentAttachments(documentID: string): Promise<boolean>;
|
|
55
|
+
sweepDocumentTx(stores: StoreProvider, documentID: string): Promise<void>;
|
|
56
|
+
};
|
|
57
|
+
export type BlobTransferAPI = {
|
|
58
|
+
bindDownloadedAttachment(params: BindDownloadedAttachmentParams): Promise<boolean>;
|
|
59
|
+
};
|
|
60
|
+
export type BlobPluginAPI = BlobAPI & BlobTransferAPI;
|
|
61
|
+
export type FetchDocumentAttachmentOptions = {
|
|
62
|
+
documentID: string;
|
|
63
|
+
groupID?: string;
|
|
64
|
+
};
|
|
65
|
+
export type BlobPeerFetchAPI = {
|
|
66
|
+
fetchDocumentAttachment(attachmentID: string, options: FetchDocumentAttachmentOptions): Promise<void>;
|
|
40
67
|
};
|
package/lib/index.js
CHANGED
|
@@ -2,4 +2,6 @@
|
|
|
2
2
|
// `engine.getAPI('blob')`, plus the parameter types its methods take. Types only —
|
|
3
3
|
// importing this creates no runtime edge on the blob plugin. The plugin implements
|
|
4
4
|
// these and re-exports them for its own use.
|
|
5
|
+
// What the p2p plugin offers the blob plugin under 'p2p': fetching a document's
|
|
6
|
+
// attachment bytes from a holder that serves them through that document.
|
|
5
7
|
export { };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubun/plugin-blob-api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"license": "see LICENSE.md",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"LICENSE.md"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@kubun/blob-backend": "^0.
|
|
19
|
-
"@kubun/db": "^0.
|
|
20
|
-
"@kubun/store-blob": "^0.
|
|
18
|
+
"@kubun/blob-backend": "^0.18.0",
|
|
19
|
+
"@kubun/db": "^0.18.0",
|
|
20
|
+
"@kubun/store-blob": "^0.18.0"
|
|
21
21
|
},
|
|
22
22
|
"publishConfig": {
|
|
23
23
|
"access": "public"
|