@kokimoki/app 0.3.0 → 0.3.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.
|
@@ -32,6 +32,9 @@ export declare class KokimokiClient<StatelessDataT = any> extends KokimokiClient
|
|
|
32
32
|
private uploadChunks;
|
|
33
33
|
private completeUpload;
|
|
34
34
|
upload(name: string, blob: Blob, tags?: string[]): Promise<Upload>;
|
|
35
|
+
updateUpload(id: string, update: {
|
|
36
|
+
tags?: string[];
|
|
37
|
+
}): Promise<Upload>;
|
|
35
38
|
listUploads(filter?: {
|
|
36
39
|
clientId?: string;
|
|
37
40
|
mimeTypes?: string[];
|
package/dist/kokimoki-client.js
CHANGED
|
@@ -160,6 +160,14 @@ export class KokimokiClient extends EventEmitter {
|
|
|
160
160
|
const etags = await this.uploadChunks(blob, chunkSize, urls);
|
|
161
161
|
return await this.completeUpload(id, etags);
|
|
162
162
|
}
|
|
163
|
+
async updateUpload(id, update) {
|
|
164
|
+
const res = await fetch(`${this._apiUrl}/uploads/${id}`, {
|
|
165
|
+
method: "PUT",
|
|
166
|
+
headers: this.apiHeaders,
|
|
167
|
+
body: JSON.stringify(update),
|
|
168
|
+
});
|
|
169
|
+
return await res.json();
|
|
170
|
+
}
|
|
163
171
|
async listUploads(filter = {}, skip = 0, limit = 100) {
|
|
164
172
|
const url = new URL("/uploads", this._apiUrl);
|
|
165
173
|
url.searchParams.set("skip", skip.toString());
|