Class UtilsGDrive

Hierarchy

  • UtilsGDrive

Constructors

  • Base class containing utils-google-drive methods.

    The token and credentials used for authentication can be provided as strings or objects during initialization (auth.token and auth.credentials). Alternatively, paths to the token and credentials can be provided (auth.pathToken and auth.pathCredentials).

    The token is retreived from ./tokenGDrive.json when neither auth.token nor auth.pathToken is specified. Similarly, the credentials are retreived from ./credentialsGDrive.json when neither auth.credentials nor auth.pathCredentials is specified.

    Use opts.rateLimiter and opts.expBack to set rate-limiting and exponential backoff behaviors for API calls. The default rate limit is 1,000 requests per 100 seconds. The default behavior for exponential backoff is retrying up to three times for any error thrown.

    Parameters

    Returns UtilsGDrive

Properties

batch: ((calls: Call$Batch[]) => Promise<Response$Batch[]>)

Type declaration

call: (<ParamsMethod, ReturnData, Resource>(resource: Resource, method: Method$Call<Resource>, params: ParamsMethod, opts?: StreamMethodOptions) => Promise<ReturnData>)

Type declaration

del: ((identifiers: string | Identifiers) => Promise<undefined>)

Type declaration

    • (identifiers: string | Identifiers): Promise<undefined>
    • Delete a file or folder in Google Drive.

      Parameters

      Returns Promise<undefined>

download: ((identifiers: string | Identifiers$Download, pathOut?: string) => Promise<void>)

Type declaration

    • (identifiers: string | Identifiers$Download, pathOut?: string): Promise<void>
    • Download a file or folder in Google Drive.

      Parameters

      Returns Promise<void>

drive: Drive
getFileId: ((identifiers: string | Identifiers$GetFileId) => Promise<string>)

Type declaration

getFileName: ((fileId: string) => Promise<string>)

Type declaration

    • (fileId: string): Promise<string>
    • Get the name of a file or folder in Google Drive.

      Parameters

      • fileId: string

      Returns Promise<string>

getFiles: ((params?: Params$Resource$Files$Get) => Promise<Schema$File>)

Type declaration

getMimeType: ((identifiers: string | Identifiers) => Promise<string>)

Type declaration

    • (identifiers: string | Identifiers): Promise<string>
    • Get the MIME type of a file or folder in Google Drive.

      Parameters

      Returns Promise<string>

limiter: RateLimiter
listChildren: ((identifiers: string | Identifiers, fields?: string) => Promise<Schema$File[]>)

Type declaration

    • (identifiers: string | Identifiers, fields?: string): Promise<Schema$File[]>
    • List information on a parent folder's children in Google Drive.

      Parameters

      • identifiers: string | Identifiers
      • fields: string = 'files(name, id, mimeType)'

      Returns Promise<Schema$File[]>

listFiles: ((params?: Params$Resource$Files$List, ignoreTrash?: boolean) => Promise<Schema$FileList>)

Type declaration

makeFolder: ((params: string | Params$MakeFolder) => Promise<string>)

Type declaration

move: ((identifiers: string | Identifiers, newParentIdentifiers: string | Identifiers) => Promise<Schema$File>)

Type declaration

optsExpBack: Opts$ExpBack
rename: ((identifiers: string | Identifiers, newName: string) => Promise<Schema$File>)

Type declaration

updateFiles: ((params?: Params$Resource$Files$Update) => Promise<Schema$File>)

Type declaration

upload: ((params: string | Params$Upload) => Promise<string>)

Type declaration

    • (params: string | Params$Upload): Promise<string>
    • Upload a file or folder to Google Drive.

      Parameters

      Returns Promise<string>

Generated using TypeDoc