@openfn/language-gmail 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +23 -32
  2. package/ast.json +1 -1
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -272,37 +272,28 @@ https://support.google.com/googleapi/answer/6158849
272
272
  - Click "Create"
273
273
  - On the resulting popup screen, find and click "DOWNLOAD JSON" and save this file to a secure location.
274
274
 
275
- ## Use the Postman application to query the OAuth enpoint and retrieve an access token
276
-
277
- Initially, you'll need to configure an authentication request using Postman's built-in OAuth 2.0 implementation:
278
-
279
- - Open Postman
280
- - Create a new request
281
- - Switch to the "Authorization" tab
282
- - On the left side, select Type OAuth 2.0
283
- - On the right side, scroll down to the "Configure New Token" section
284
- - Fill out the form using information from the downloaded json file from the
285
- previous section
286
- - Token Name: Google Oauth
287
- - Grant Type: Authorization Code
288
- - Auth URL: (found in the json file as auth_url)
289
- - Access Token URL: (found in the json file as token_url)
290
- - Client ID: (found in the json file as client_id)
291
- - Client Secret: (found in the json file as client_secret)
292
- - Scope:
293
- https://www.googleapis.com/auth/gmail.readonly
294
- https://www.googleapis.com/auth/gmail.send
295
- - State: (any random string is fine)
296
- - Client Authentication: Send as Basic Auth header
297
-
298
- Once the form is filled out, repeat these steps each hour to retrieve a new
299
- access token:
300
-
301
- - Click on "Get New Access Token"
302
- - A browser will open and you'll be asked to authenticate with your Google Account
303
- - Accept the request to allow this OAuth session to access your Google Account.
304
- - In the MANAGE ACCESS TOKENS popup, find and copy the new Access Token
305
- - This access token will be valid for 1 hour.
275
+ ## Retrieve an access token
276
+
277
+ - Navigate to [OAuth 2.0 Playground](https://developers.google.com/oauthplayground/).
278
+ - Find *Step 1 Select & authorize APIs*:
279
+ - Find the section for *Gmail API v1*.
280
+ - Mark the following two scopes:
281
+ - https://www.googleapis.com/auth/gmail.readonly
282
+ - https://www.googleapis.com/auth/gmail.send
283
+ - In the box labeled with the watermark *Input your own scopes* add `openid`.
284
+ - Click on the **Authorize APIs** button.
285
+ - Log in to the Google account to which you want to grant access.
286
+ - On the *Sign in to Google OAuth 2.0 Playground* screen, Click **Continue**.
287
+ - On the *Google OAuth 2.0 Playground wants access to your Google Account* screen:
288
+ - **Select all**, including:
289
+ - **View your email messages and settings**.
290
+ - **Send email on your behalf**.
291
+ - Click **Continue**.
292
+ - Find *Step 2 Exchange authorization code for tokens*:
293
+ - *Authorization code* will be prepopulated.
294
+ - Click **Exchange authorization code for tokens**.
295
+ - *Refresh token* and *Access token* will be populated briefly before the interface automatically advances to *Step 3 Configure request to API*. To view the *Access token*, return to *Step 2 Exchange authorization code for tokens*.
296
+ - The *Access token* is valid for 1 hour. You may enable **Auto-refresh the token before it expires** or manually refresh it using the **Refresh access token** button.
306
297
 
307
298
  ## Configure OpenFn CLI to find the access token
308
299
 
@@ -320,7 +311,7 @@ Example configuration using a workflow:
320
311
  ],
321
312
  "expression": "path/to/gmail.js",
322
313
  "configuration": {
323
- "access_token": "(access token acquired from Postman)"
314
+ "access_token": "[access token acquired from previous section]"
324
315
  }
325
316
  }
326
317
  ]
package/ast.json CHANGED
@@ -175,7 +175,7 @@
175
175
  "operation"
176
176
  ],
177
177
  "docs": {
178
- "description": "A custom operation that will only execute the function if the condition returns true",
178
+ "description": "Execute a function only when the condition returns true",
179
179
  "tags": [
180
180
  {
181
181
  "title": "public",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@openfn/language-gmail",
3
3
  "label": "Gmail",
4
- "version": "2.0.0",
4
+ "version": "2.0.2",
5
5
  "description": "OpenFn gmail adaptor",
6
6
  "type": "module",
7
7
  "exports": {
@@ -23,7 +23,7 @@
23
23
  "dependencies": {
24
24
  "googleapis": "100.0.0",
25
25
  "jszip": "^3.10.1",
26
- "@openfn/language-common": "3.0.2"
26
+ "@openfn/language-common": "3.0.3"
27
27
  },
28
28
  "devDependencies": {
29
29
  "assertion-error": "2.0.0",