/** * Execute a sequence of oper. * Wraps `language-common/execute`, and prepends initial state for http. * @example * execute( * create('foo'), * delete('bar') * )(state) * @private * @param {Operations} operations - Operations to be performed. * @returns {Operation} */ export function execute(...operations: Operations): Operation; /** * Uploads a file to Google Drive. * @public * @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", * }); * @param {string} content - Base64 encoded file content. * @param {string} fileName - Name for the uploaded file. * @param {Object} options - File upload parameters. * @param {string} [options.folderId] - ID of the parent folder. * @state {DriveState} * @returns {Operation} */ export function create(content: string, fileName: string, options?: { folderId?: string; }): Operation; /** * Downloads a file from Google Drive. * @public * @example Download a file * get('1B1dHwY2uLgm_-U96LNl9zFsRYq8953jL') * @example Download a file by name * get('hello-world.txt') * @param {string} fileIdOrName - ID of the file or its name to download. * @state {DriveState} * @returns {Operation} An operation that retrieves the file as a base64 string. */ export function get(fileIdOrName: string): Operation; /** * Lists files from a directory or root. * @public * @example List files of a directory * list('') * @example Get the latest modified file in folder * list('', * { * fields: ['id', 'name', 'modifiedTime'], * limit: 1, * orderBy: 'modifiedTime desc' * }) * @param {string} folderId - ID of the folder to list files from. If not provided, lists files from the root. * @param {Object} [options] - Options for listing files * @state {DriveState} * @returns {Operation} An operation that retrieves a list of files. */ export function list(folderId: string, options?: any): Operation; /** * Updates an existing file in Google Drive. * @public * @example Update a file * update('1B1dHwY2uLgm_-U96LNl9zFsRYq8953jL', 'SGVsbG8gTWlrZQ=='); * @param {string} fileId - ID of the file to update. * @param {string} content - Base64 encoded new content. * @state {DriveState} * @returns {Operation} */ export function update(fileId: string, content: string): Operation; /** * State object */ export type DriveState = { /** * - the parsed response body */ data: any; /** * - an array of all previous data objects used in the Job */ references: any; }; export { alterState, arrayToString, as, chunk, combine, cursor, dataPath, dataValue, dateFns, each, field, fields, fn, fnIf, lastReferenceValue, log, merge, parseCsv, sourceValue, util } from "@openfn/language-common";