npm

@impleta/gas-turbine

0.1.3 • Public • Published

gas-turbine

REPL and testing framework for Google Application Scripts

Usage

> gas-turbine
Logged in as <email>
> const folders = await GT.drive.getMyDriveContents();
> const 

Installation

npm i -g @impleta/gas-turbine

Set up authentication

This is a one-time setup

  1. Visit https://console.cloud.google.com/cloud-resource-manager and create a new project named gas-turbine with ID gas-turbine.

Option 1: OAuth2

This option allows scripts executed by Gas Turbine the same access as your primary Google account over all of Google drive. Any folders or files created will be owned by your user account.

  1. Visit https://console.cloud.google.com/apis/credentials/consent?project=gas-turbine
  2. Select External if you are not a Google Workspace User, or Internal if you are and you want to limit access to your organization only.
  3. Fill in the App name, User support email, and Developer contact Information required fields. Click SAVE AND CONTINUE.
  4. On the Scopes page, click SAVE AND CONTINUE.
  5. Optionally add any users on the Test users page, then click SAVE AND CONTINUE.
  6. Click on Credentials on the left (or visit https://console.cloud.google.com/apis/credentials?project=gas-turbine
  7. Click CREATE CREDENTIALS at the top and select OAuth client ID.
  8. For Application type, select Web application
  9. For Name, enter GasTurbine Web Client.
  10. Select Create.
  11. On the OAuth client created click DOWNLOAD JSON. Save the file to a safe location. Do not share this or commit this file to source control.

Option 2: Service Account

This option can be used to restrict access only to certain shared folders and documents on your Google drive. Any folders or files created will be owned by the Service Account, though your main account will have write access.

  1. Visit https://console.cloud.google.com/iam-admin/serviceaccounts?project=gas-turbine
  2. Click on CREATE SERVICE ACCOUNT at the top.
  3. Set the Service account name to gas-turbine-service-account, and click CREATE AND CONTINUE
  4. Set the Role as Owner under Grant this service account access to project
  5. Back on the Service account for project "Gas Turbine" page, click on the email address.
  6. Click on KEYS on the top, then ADD KEY > Create new key
  7. Select JSON on the dialog that pops up, then CREATE
  8. A JSON file will be downloaded to the downloads folder of your browser. Move this to a safe location on your computer. Do not share this or commit this file to source control.
  9. Note: You will not be able to download this file again in the future, but you can create a new key should this file be lost.

Usage

> gas-turbine --credential <path-to-oauth2-or-service-account-keys.json>
Logged in as <email-address>
> const folders = await GT.drive.getMyDriveContents()

If authenticated via OAuth2, You will be prompted to select the User, and

Package Sidebar

Install

npm i @impleta/gas-turbine

Weekly Downloads

0

Version

0.1.3

License

ISC

Unpacked Size

61.7 kB

Total Files

44

Last publish

Collaborators

  • impletadev
  • gasdev