@kokimoki/app 0.3.0 → 0.3.2

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,9 +32,13 @@ 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[];
41
+ tags?: [];
38
42
  }, skip?: number, limit?: number): Promise<Paginated<Upload>>;
39
43
  }
40
44
  export {};
@@ -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());
@@ -170,6 +178,9 @@ export class KokimokiClient extends EventEmitter {
170
178
  if (filter.mimeTypes) {
171
179
  url.searchParams.set("mimeTypes", filter.mimeTypes.join());
172
180
  }
181
+ if (filter.tags) {
182
+ url.searchParams.set("tags", filter.tags.join());
183
+ }
173
184
  const res = await fetch(url.href, {
174
185
  headers: this.apiHeaders,
175
186
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kokimoki/app",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "type": "module",
5
5
  "description": "Kokimoki app",
6
6
  "main": "dist/index.js",