files
Creates, updates, deletes, gets or lists a files
resource.
Overview
Name | files |
Type | Resource |
Id | vercel.deployments.files |
Fields
The following fields are returned by SELECT
queries:
- list_deployment_files
Retrieved the file tree successfully
Name | Datatype | Description |
---|---|---|
name | string | The name of the file tree entry (example: my-file.json) |
children | array | The list of children files of the directory (only valid for the directory type) |
contentType | string | The content-type of the file (only valid for the file type) (example: application/json) |
mode | number | The file "mode" indicating file type and permissions. |
symlink | string | Not currently used. See file-list-to-tree.ts . |
type | string | String indicating the type of file tree entry. (example: file) |
uid | string | The unique identifier of the file (only valid for the file type) (example: 2d4aad419917f15b1146e9e03ddc9bb31747e4d0) |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
list_deployment_files | select | id , teamId | Allows to retrieve the file structure of a deployment by supplying the deployment unique identifier. | |
upload_file | exec | teamId | Content-Length , x-vercel-digest , x-now-digest , x-now-size | Before you create a deployment you need to upload the required files for that deployment. To do it, you need to first upload each file to this endpoint. Once that's completed, you can create a new deployment with the uploaded files. The file content must be placed inside the body of the request. In the case of a successful response you'll receive a status code 200 with an empty body. |
get_deployment_file_contents | exec | id , fileId , teamId | path | Allows to retrieve the content of a file by supplying the file identifier and the deployment unique identifier. The response body will contain the raw content of the file. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
fileId | string | The unique file identifier |
id | string | The unique deployment identifier |
teamId | string | The Team identifier or slug to perform the request on behalf of. |
Content-Length | number | The file size in bytes |
path | string | Path to the file to fetch (only for Git deployments) |
x-now-digest | string | The file SHA1 used to check the integrity |
x-now-size | number | The file size as an alternative to Content-Length |
x-vercel-digest | string | The file SHA1 used to check the integrity |
SELECT
examples
- list_deployment_files
Allows to retrieve the file structure of a deployment by supplying the deployment unique identifier.
SELECT
name,
children,
contentType,
mode,
symlink,
type,
uid
FROM vercel.deployments.files
WHERE id = '{{ id }}' -- required
AND teamId = '{{ teamId }}' -- required
;
Lifecycle Methods
- upload_file
- get_deployment_file_contents
Before you create a deployment you need to upload the required files for that deployment. To do it, you need to first upload each file to this endpoint. Once that's completed, you can create a new deployment with the uploaded files. The file content must be placed inside the body of the request. In the case of a successful response you'll receive a status code 200 with an empty body.
EXEC vercel.deployments.files.upload_file
@teamId='{{ teamId }}' --required,
@Content-Length='{{ Content-Length }}',
@x-vercel-digest='{{ x-vercel-digest }}',
@x-now-digest='{{ x-now-digest }}',
@x-now-size='{{ x-now-size }}'
;
Allows to retrieve the content of a file by supplying the file identifier and the deployment unique identifier. The response body will contain the raw content of the file.
EXEC vercel.deployments.files.get_deployment_file_contents
@id='{{ id }}' --required,
@fileId='{{ fileId }}' --required,
@teamId='{{ teamId }}' --required,
@path='{{ path }}'
;