Classes
Methods
(async) create(data, filenameopt)
Upload an asset.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data |
any
|
Asset data to upload, typically a File or Blob. | |
filename |
string
|
<optional> |
Name of the file. |
Returns:
Asset resource.
(async) delete(id)
Delete an asset.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
id |
string
|
ID of asset to delete. |
(async) download(id, responseTypeopt)
Download an asset.
- Source:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
id |
string
|
ID of asset to download. | ||
responseType |
string
|
<optional> |
"stream" | Type of response data. Options include: "arraybuffer", "document", "json", "text", or "stream". See Axios docs for details. |
Returns:
Response object with asset data.
(async) downloadURL(id, paramsopt) → {string}
Retrieve public asset download URL.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
id |
string
|
ID of asset to download. | |||||||||
params |
Object
|
<optional> |
Optional download parameters.
|
Returns:
- Type:
-
string
Asset download URL. Note the URL is only valid from one hour of generation.
(async) get(id)
Get an asset.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
id |
string
|
ID of asset to get. |
Returns:
Asset resource.
(async) list(paramsopt)
List assets.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object
|
<optional> |
Optional list parameters.
|
Returns:
List of asset resources.
(async) update(id, data, filenameopt)
Update an asset.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
id |
string
|
ID of asset to update. | |
data |
any
|
Asset data to upload, typically a File or Blob. | |
filename |
string
|
<optional> |
Name of the file. |
Returns:
Asset resource.