Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Script

import { Script } from "https://googleapis.deno.dev/v1/script:v1.ts";

Manages and executes Google Apps Script projects.

class Script {
constructor(client?: CredentialsClient, baseUrl?: string);
async processesList(opts?: ProcessesListOptions): Promise<ListUserProcessesResponse>;
async processesListScriptProcesses(opts?: ProcessesListScriptProcessesOptions): Promise<ListScriptProcessesResponse>;
async projectsCreate(req: CreateProjectRequest): Promise<Project>;
async projectsDeploymentsCreate(scriptId: string, req: DeploymentConfig): Promise<Deployment>;
async projectsDeploymentsDelete(deploymentId: string, scriptId: string): Promise<Empty>;
async projectsDeploymentsGet(deploymentId: string, scriptId: string): Promise<Deployment>;
async projectsDeploymentsList(scriptId: string, opts?: ProjectsDeploymentsListOptions): Promise<ListDeploymentsResponse>;
async projectsDeploymentsUpdate(
deploymentId: string,
scriptId: string,
): Promise<Deployment>;
async projectsGet(scriptId: string): Promise<Project>;
async projectsGetContent(scriptId: string, opts?: ProjectsGetContentOptions): Promise<Content>;
async projectsGetMetrics(scriptId: string, opts?: ProjectsGetMetricsOptions): Promise<Metrics>;
async projectsUpdateContent(scriptId: string, req: Content): Promise<Content>;
async projectsVersionsCreate(scriptId: string, req: Version): Promise<Version>;
async projectsVersionsGet(scriptId: string, versionNumber: number): Promise<Version>;
async projectsVersionsList(scriptId: string, opts?: ProjectsVersionsListOptions): Promise<ListVersionsResponse>;
async scriptsRun(scriptId: string, req: ExecutionRequest): Promise<Operation>;
}

§Constructors

§
new Script(client?: CredentialsClient, baseUrl?: string)
[src]

§Methods

§

List information about processes made by or on behalf of a user, such as process type and current status.

§
processesListScriptProcesses(opts?: ProcessesListScriptProcessesOptions): Promise<ListScriptProcessesResponse>
[src]

List information about a script's executed processes, such as process type and current status.

§
projectsCreate(req: CreateProjectRequest): Promise<Project>
[src]

Creates a new, empty script project with no script files and a base manifest file.

§
projectsDeploymentsCreate(scriptId: string, req: DeploymentConfig): Promise<Deployment>
[src]

Creates a deployment of an Apps Script project.

@param scriptId

The script project's Drive ID.

§
projectsDeploymentsDelete(deploymentId: string, scriptId: string): Promise<Empty>
[src]

Deletes a deployment of an Apps Script project.

@param deploymentId

The deployment ID to be undeployed.

@param scriptId

The script project's Drive ID.

§
projectsDeploymentsGet(deploymentId: string, scriptId: string): Promise<Deployment>
[src]

Gets a deployment of an Apps Script project.

@param deploymentId

The deployment ID.

@param scriptId

The script project's Drive ID.

§
projectsDeploymentsList(scriptId: string, opts?: ProjectsDeploymentsListOptions): Promise<ListDeploymentsResponse>
[src]

Lists the deployments of an Apps Script project.

@param scriptId

The script project's Drive ID.

§
projectsDeploymentsUpdate(deploymentId: string, scriptId: string, req: UpdateDeploymentRequest): Promise<Deployment>
[src]

Updates a deployment of an Apps Script project.

@param deploymentId

The deployment ID for this deployment.

@param scriptId

The script project's Drive ID.

§
projectsGet(scriptId: string): Promise<Project>
[src]

Gets a script project's metadata.

@param scriptId

The script project's Drive ID.

§
projectsGetContent(scriptId: string, opts?: ProjectsGetContentOptions): Promise<Content>
[src]

Gets the content of the script project, including the code source and metadata for each script file.

@param scriptId

The script project's Drive ID.

§
projectsGetMetrics(scriptId: string, opts?: ProjectsGetMetricsOptions): Promise<Metrics>
[src]

Get metrics data for scripts, such as number of executions and active users.

@param scriptId

Required field indicating the script to get metrics for.

§
projectsUpdateContent(scriptId: string, req: Content): Promise<Content>
[src]

Updates the content of the specified script project. This content is stored as the HEAD version, and is used when the script is executed as a trigger, in the script editor, in add-on preview mode, or as a web app or Apps Script API in development mode. This clears all the existing files in the project.

@param scriptId

The script project's Drive ID.

§
projectsVersionsCreate(scriptId: string, req: Version): Promise<Version>
[src]

Creates a new immutable version using the current code, with a unique version number.

@param scriptId

The script project's Drive ID.

§
projectsVersionsGet(scriptId: string, versionNumber: number): Promise<Version>
[src]

Gets a version of a script project.

@param scriptId

The script project's Drive ID.

@param versionNumber

The version number.

§
projectsVersionsList(scriptId: string, opts?: ProjectsVersionsListOptions): Promise<ListVersionsResponse>
[src]

List the versions of a script project.

@param scriptId

The script project's Drive ID.

§
scriptsRun(scriptId: string, req: ExecutionRequest): Promise<Operation>
[src]

Runs a function in an Apps Script project. The script project must be deployed for use with the Apps Script API and the calling application must share the same Cloud Platform project. This method requires authorization with an OAuth 2.0 token that includes at least one of the scopes listed in the Authorization section; script projects that do not require authorization cannot be executed through this API. To find the correct scopes to include in the authentication token, open the script project Overview page and scroll down to "Project OAuth Scopes." The error 403, PERMISSION_DENIED: The caller does not have permission indicates that the Cloud Platform project used to authorize the request is not the same as the one used by the script.

@param scriptId

The script ID of the script to be executed. Find the script ID on the Project settings page under "IDs." As multiple executable APIs can be deployed in new IDE for same script, this field should be populated with DeploymentID generated while deploying in new IDE instead of script ID.