Document parameters of CDN methods
This commit is contained in:
parent
1bb6e0d01b
commit
2eb89d0400
|
@ -3,6 +3,11 @@ import { formFromObj } from "../utils.ts";
|
|||
import { MethodBase } from "./method_base.ts";
|
||||
|
||||
export class CDN extends MethodBase {
|
||||
/**
|
||||
* Uploads a file.
|
||||
*
|
||||
* @param document The file, it can be a buffer or a readable stream.
|
||||
*/
|
||||
async upload(document: any): Promise<Document> {
|
||||
const form = formFromObj({
|
||||
action: "upload",
|
||||
|
@ -13,6 +18,12 @@ export class CDN extends MethodBase {
|
|||
return (await this.client.invokeCDNRequest(form)).results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Downloads the provided document.
|
||||
*
|
||||
* @param document The ID or instance of the document.
|
||||
* @param stream Wheather to download and returns its data or stream it, returning a `Blob`.
|
||||
*/
|
||||
async download(document: string | Document, stream?: boolean) {
|
||||
const form = formFromObj({
|
||||
action: "download",
|
||||
|
|
Loading…
Reference in New Issue