@darseen/vaze 2.4.0 → 2.5.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/dist/index.cjs +30 -7
- package/dist/index.d.cts +15 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +30 -7
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -286,7 +286,7 @@ var Files = class extends Base {
|
|
|
286
286
|
}
|
|
287
287
|
async upload(data) {
|
|
288
288
|
const { files, folder, visibility } = data;
|
|
289
|
-
const url = this.
|
|
289
|
+
const url = this.uploadUrl();
|
|
290
290
|
const formData = new FormData();
|
|
291
291
|
if (folder) formData.append("folder", folder);
|
|
292
292
|
if (visibility) formData.append("visibility", visibility);
|
|
@@ -304,6 +304,18 @@ var Files = class extends Base {
|
|
|
304
304
|
} : null
|
|
305
305
|
};
|
|
306
306
|
}
|
|
307
|
+
/** Where `upload` posts its form, for upload managers that report progress. */
|
|
308
|
+
uploadUrl() {
|
|
309
|
+
return this.apiUrl("/api/files");
|
|
310
|
+
}
|
|
311
|
+
/** Record uploads canceled before they were sent, in the activity history. */
|
|
312
|
+
async reportCanceled(names) {
|
|
313
|
+
return await this.request(
|
|
314
|
+
"POST",
|
|
315
|
+
this.apiUrl("/api/files/canceled"),
|
|
316
|
+
{ names }
|
|
317
|
+
);
|
|
318
|
+
}
|
|
307
319
|
async download(id) {
|
|
308
320
|
return await this.requestBlob(this.downloadUrl(id));
|
|
309
321
|
}
|
|
@@ -317,9 +329,11 @@ var Files = class extends Base {
|
|
|
317
329
|
}
|
|
318
330
|
/** Download several files as one zip, with paths below their shared folder. */
|
|
319
331
|
async downloadMany(ids) {
|
|
320
|
-
return await this.requestBlob(this.
|
|
321
|
-
|
|
322
|
-
|
|
332
|
+
return await this.requestBlob(this.downloadManyUrl(), "POST", { ids });
|
|
333
|
+
}
|
|
334
|
+
/** Where `downloadMany` posts `{ ids }`; stream it yourself with `authHeaders()`. */
|
|
335
|
+
downloadManyUrl() {
|
|
336
|
+
return this.apiUrl("/api/files/download");
|
|
323
337
|
}
|
|
324
338
|
async rename(data) {
|
|
325
339
|
return await this.request("PUT", this.apiUrl("/api/files"), data);
|
|
@@ -403,9 +417,11 @@ var Folders = class extends Base {
|
|
|
403
417
|
}
|
|
404
418
|
/** Download a folder and everything below it as a zip; the root by default. */
|
|
405
419
|
async download(options) {
|
|
406
|
-
return await this.requestBlob(
|
|
407
|
-
|
|
408
|
-
|
|
420
|
+
return await this.requestBlob(this.downloadUrl(options));
|
|
421
|
+
}
|
|
422
|
+
/** Where `download` reads from; fetch it yourself with `authHeaders()`. */
|
|
423
|
+
downloadUrl(options) {
|
|
424
|
+
return this.apiUrl("/api/folders/download", options);
|
|
409
425
|
}
|
|
410
426
|
async create(folder) {
|
|
411
427
|
return await this.request(
|
|
@@ -577,6 +593,13 @@ var Vaze = class extends Base {
|
|
|
577
593
|
this.apiUrl("/api/health")
|
|
578
594
|
);
|
|
579
595
|
}
|
|
596
|
+
/** Whether the instance still needs its first account, which becomes the admin. */
|
|
597
|
+
async setupStatus() {
|
|
598
|
+
return await this.request(
|
|
599
|
+
"GET",
|
|
600
|
+
this.apiUrl("/api/setup")
|
|
601
|
+
);
|
|
602
|
+
}
|
|
580
603
|
/** The caller's account and the scopes it may use. */
|
|
581
604
|
async me() {
|
|
582
605
|
return await this.request("GET", this.apiUrl("/api/me"));
|
package/dist/index.d.cts
CHANGED
|
@@ -1237,6 +1237,10 @@ declare class Files extends Base {
|
|
|
1237
1237
|
files: any[];
|
|
1238
1238
|
} | null;
|
|
1239
1239
|
}>;
|
|
1240
|
+
/** Where `upload` posts its form, for upload managers that report progress. */
|
|
1241
|
+
uploadUrl(): string;
|
|
1242
|
+
/** Record uploads canceled before they were sent, in the activity history. */
|
|
1243
|
+
reportCanceled(names: string[]): Promise<ApiResponse<null>>;
|
|
1240
1244
|
download(id: string): Promise<ApiResponse<{
|
|
1241
1245
|
blob: Blob;
|
|
1242
1246
|
filename: string | null;
|
|
@@ -1252,6 +1256,8 @@ declare class Files extends Base {
|
|
|
1252
1256
|
filename: string | null;
|
|
1253
1257
|
contentType: string;
|
|
1254
1258
|
}>>;
|
|
1259
|
+
/** Where `downloadMany` posts `{ ids }`; stream it yourself with `authHeaders()`. */
|
|
1260
|
+
downloadManyUrl(): string;
|
|
1255
1261
|
rename(data: {
|
|
1256
1262
|
id: string;
|
|
1257
1263
|
name: string;
|
|
@@ -1326,6 +1332,11 @@ declare class Folders extends Base {
|
|
|
1326
1332
|
filename: string | null;
|
|
1327
1333
|
contentType: string;
|
|
1328
1334
|
}>>;
|
|
1335
|
+
/** Where `download` reads from; fetch it yourself with `authHeaders()`. */
|
|
1336
|
+
downloadUrl(options?: {
|
|
1337
|
+
id?: string;
|
|
1338
|
+
key?: string;
|
|
1339
|
+
}): string;
|
|
1329
1340
|
create(folder: string): Promise<ApiResponse<{
|
|
1330
1341
|
folder: Folder;
|
|
1331
1342
|
}>>;
|
|
@@ -1551,6 +1562,10 @@ declare class Vaze extends Base implements IVaze {
|
|
|
1551
1562
|
health(): Promise<ApiResponse<{
|
|
1552
1563
|
message: string;
|
|
1553
1564
|
}>>;
|
|
1565
|
+
/** Whether the instance still needs its first account, which becomes the admin. */
|
|
1566
|
+
setupStatus(): Promise<ApiResponse<{
|
|
1567
|
+
needed: boolean;
|
|
1568
|
+
}>>;
|
|
1554
1569
|
/** The caller's account and the scopes it may use. */
|
|
1555
1570
|
me(): Promise<ApiResponse<Me>>;
|
|
1556
1571
|
/** Dashboard numbers, with each section limited to the caller's scopes. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1237,6 +1237,10 @@ declare class Files extends Base {
|
|
|
1237
1237
|
files: any[];
|
|
1238
1238
|
} | null;
|
|
1239
1239
|
}>;
|
|
1240
|
+
/** Where `upload` posts its form, for upload managers that report progress. */
|
|
1241
|
+
uploadUrl(): string;
|
|
1242
|
+
/** Record uploads canceled before they were sent, in the activity history. */
|
|
1243
|
+
reportCanceled(names: string[]): Promise<ApiResponse<null>>;
|
|
1240
1244
|
download(id: string): Promise<ApiResponse<{
|
|
1241
1245
|
blob: Blob;
|
|
1242
1246
|
filename: string | null;
|
|
@@ -1252,6 +1256,8 @@ declare class Files extends Base {
|
|
|
1252
1256
|
filename: string | null;
|
|
1253
1257
|
contentType: string;
|
|
1254
1258
|
}>>;
|
|
1259
|
+
/** Where `downloadMany` posts `{ ids }`; stream it yourself with `authHeaders()`. */
|
|
1260
|
+
downloadManyUrl(): string;
|
|
1255
1261
|
rename(data: {
|
|
1256
1262
|
id: string;
|
|
1257
1263
|
name: string;
|
|
@@ -1326,6 +1332,11 @@ declare class Folders extends Base {
|
|
|
1326
1332
|
filename: string | null;
|
|
1327
1333
|
contentType: string;
|
|
1328
1334
|
}>>;
|
|
1335
|
+
/** Where `download` reads from; fetch it yourself with `authHeaders()`. */
|
|
1336
|
+
downloadUrl(options?: {
|
|
1337
|
+
id?: string;
|
|
1338
|
+
key?: string;
|
|
1339
|
+
}): string;
|
|
1329
1340
|
create(folder: string): Promise<ApiResponse<{
|
|
1330
1341
|
folder: Folder;
|
|
1331
1342
|
}>>;
|
|
@@ -1551,6 +1562,10 @@ declare class Vaze extends Base implements IVaze {
|
|
|
1551
1562
|
health(): Promise<ApiResponse<{
|
|
1552
1563
|
message: string;
|
|
1553
1564
|
}>>;
|
|
1565
|
+
/** Whether the instance still needs its first account, which becomes the admin. */
|
|
1566
|
+
setupStatus(): Promise<ApiResponse<{
|
|
1567
|
+
needed: boolean;
|
|
1568
|
+
}>>;
|
|
1554
1569
|
/** The caller's account and the scopes it may use. */
|
|
1555
1570
|
me(): Promise<ApiResponse<Me>>;
|
|
1556
1571
|
/** Dashboard numbers, with each section limited to the caller's scopes. */
|
package/dist/index.js
CHANGED
|
@@ -286,7 +286,7 @@ var Files = class extends Base {
|
|
|
286
286
|
}
|
|
287
287
|
async upload(data) {
|
|
288
288
|
const { files, folder, visibility } = data;
|
|
289
|
-
const url = this.
|
|
289
|
+
const url = this.uploadUrl();
|
|
290
290
|
const formData = new FormData();
|
|
291
291
|
if (folder) formData.append("folder", folder);
|
|
292
292
|
if (visibility) formData.append("visibility", visibility);
|
|
@@ -304,6 +304,18 @@ var Files = class extends Base {
|
|
|
304
304
|
} : null
|
|
305
305
|
};
|
|
306
306
|
}
|
|
307
|
+
/** Where `upload` posts its form, for upload managers that report progress. */
|
|
308
|
+
uploadUrl() {
|
|
309
|
+
return this.apiUrl("/api/files");
|
|
310
|
+
}
|
|
311
|
+
/** Record uploads canceled before they were sent, in the activity history. */
|
|
312
|
+
async reportCanceled(names) {
|
|
313
|
+
return await this.request(
|
|
314
|
+
"POST",
|
|
315
|
+
this.apiUrl("/api/files/canceled"),
|
|
316
|
+
{ names }
|
|
317
|
+
);
|
|
318
|
+
}
|
|
307
319
|
async download(id) {
|
|
308
320
|
return await this.requestBlob(this.downloadUrl(id));
|
|
309
321
|
}
|
|
@@ -317,9 +329,11 @@ var Files = class extends Base {
|
|
|
317
329
|
}
|
|
318
330
|
/** Download several files as one zip, with paths below their shared folder. */
|
|
319
331
|
async downloadMany(ids) {
|
|
320
|
-
return await this.requestBlob(this.
|
|
321
|
-
|
|
322
|
-
|
|
332
|
+
return await this.requestBlob(this.downloadManyUrl(), "POST", { ids });
|
|
333
|
+
}
|
|
334
|
+
/** Where `downloadMany` posts `{ ids }`; stream it yourself with `authHeaders()`. */
|
|
335
|
+
downloadManyUrl() {
|
|
336
|
+
return this.apiUrl("/api/files/download");
|
|
323
337
|
}
|
|
324
338
|
async rename(data) {
|
|
325
339
|
return await this.request("PUT", this.apiUrl("/api/files"), data);
|
|
@@ -403,9 +417,11 @@ var Folders = class extends Base {
|
|
|
403
417
|
}
|
|
404
418
|
/** Download a folder and everything below it as a zip; the root by default. */
|
|
405
419
|
async download(options) {
|
|
406
|
-
return await this.requestBlob(
|
|
407
|
-
|
|
408
|
-
|
|
420
|
+
return await this.requestBlob(this.downloadUrl(options));
|
|
421
|
+
}
|
|
422
|
+
/** Where `download` reads from; fetch it yourself with `authHeaders()`. */
|
|
423
|
+
downloadUrl(options) {
|
|
424
|
+
return this.apiUrl("/api/folders/download", options);
|
|
409
425
|
}
|
|
410
426
|
async create(folder) {
|
|
411
427
|
return await this.request(
|
|
@@ -577,6 +593,13 @@ var Vaze = class extends Base {
|
|
|
577
593
|
this.apiUrl("/api/health")
|
|
578
594
|
);
|
|
579
595
|
}
|
|
596
|
+
/** Whether the instance still needs its first account, which becomes the admin. */
|
|
597
|
+
async setupStatus() {
|
|
598
|
+
return await this.request(
|
|
599
|
+
"GET",
|
|
600
|
+
this.apiUrl("/api/setup")
|
|
601
|
+
);
|
|
602
|
+
}
|
|
580
603
|
/** The caller's account and the scopes it may use. */
|
|
581
604
|
async me() {
|
|
582
605
|
return await this.request("GET", this.apiUrl("/api/me"));
|