googledrive@1.1.0
This adaptor exports the following from common:
- alterState()
- arrayToString()
- as()
- chunk()
- combine()
- cursor()
- dataPath()
- dataValue()
- dateFns
- each()
- field()
- fields()
- fn()
- fnIf()
- http
- lastReferenceValue()
- merge()
- parseCsv()
- sourceValue()
- util
Functions
create
create(content, fileName, options) ⇒ Operation
Uploads a file to Google Drive.
Param | Type | Description |
---|---|---|
content | string | Base64 encoded file content. |
fileName | string | Name for the uploaded file. |
options | Object | File upload parameters. |
[options.folderId] | string | ID of the parent folder. |
This operation writes the following keys to state:
State Key | Description |
---|---|
data | the parsed response body |
references | an array of all previous data objects used in the Job |
Example: Upload a file to a root folder
create("SGVsbG8gV29ybGQ=", "hello-world.txt");
Example: Upload a file to a specificfolder
create("SGVsbG8gV29ybGQ=", "hello-world.txt", {
folderId: "15tLwRj0lmr4mGIslEm5QEAS8YJ1EAXep",
});
get
get(fileIdOrName) ⇒ Operation
Downloads a file from Google Drive.
Returns: Operation
- An operation that retrieves the file as a base64 string.
Param | Type | Description |
---|---|---|
fileIdOrName | string | ID of the file or its name to download. |
This operation writes the following keys to state:
State Key | Description |
---|---|
data | the parsed response body |
references | an array of all previous data objects used in the Job |
Example: Download a file
get('1B1dHwY2uLgm_-U96LNl9zFsRYq8953jL')
Example: Download a file by name
get('hello-world.txt')
update
update(fileId, content) ⇒ Operation
Updates an existing file in Google Drive.
Param | Type | Description |
---|---|---|
fileId | string | ID of the file to update. |
content | string | Base64 encoded new content. |
This operation writes the following keys to state:
State Key | Description |
---|---|
data | the parsed response body |
references | an array of all previous data objects used in the Job |
Example: Update a file
update('1B1dHwY2uLgm_-U96LNl9zFsRYq8953jL', 'SGVsbG8gTWlrZQ==');