@openfn/language-gmail 1.3.5 → 2.0.1
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.
- package/README.md +23 -32
- package/dist/index.cjs +0 -3
- package/dist/index.js +0 -3
- package/package.json +1 -1
- package/types/Adaptor.d.ts +1 -1
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
|
-
##
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
-
|
|
280
|
-
-
|
|
281
|
-
-
|
|
282
|
-
-
|
|
283
|
-
-
|
|
284
|
-
-
|
|
285
|
-
|
|
286
|
-
-
|
|
287
|
-
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
-
|
|
296
|
-
|
|
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": "
|
|
314
|
+
"access_token": "[access token acquired from previous section]"
|
|
324
315
|
}
|
|
325
316
|
}
|
|
326
317
|
]
|
package/dist/index.cjs
CHANGED
|
@@ -38,7 +38,6 @@ __export(src_exports, {
|
|
|
38
38
|
fn: () => import_language_common2.fn,
|
|
39
39
|
fnIf: () => import_language_common2.fnIf,
|
|
40
40
|
getContentsFromMessages: () => getContentsFromMessages,
|
|
41
|
-
http: () => import_language_common2.http,
|
|
42
41
|
lastReferenceValue: () => import_language_common2.lastReferenceValue,
|
|
43
42
|
merge: () => import_language_common2.merge,
|
|
44
43
|
sendMessage: () => sendMessage,
|
|
@@ -61,7 +60,6 @@ __export(Adaptor_exports, {
|
|
|
61
60
|
fn: () => import_language_common2.fn,
|
|
62
61
|
fnIf: () => import_language_common2.fnIf,
|
|
63
62
|
getContentsFromMessages: () => getContentsFromMessages,
|
|
64
|
-
http: () => import_language_common2.http,
|
|
65
63
|
lastReferenceValue: () => import_language_common2.lastReferenceValue,
|
|
66
64
|
merge: () => import_language_common2.merge,
|
|
67
65
|
sendMessage: () => sendMessage,
|
|
@@ -463,7 +461,6 @@ var src_default = Adaptor_exports;
|
|
|
463
461
|
fn,
|
|
464
462
|
fnIf,
|
|
465
463
|
getContentsFromMessages,
|
|
466
|
-
http,
|
|
467
464
|
lastReferenceValue,
|
|
468
465
|
merge,
|
|
469
466
|
sendMessage,
|
package/dist/index.js
CHANGED
|
@@ -19,7 +19,6 @@ __export(Adaptor_exports, {
|
|
|
19
19
|
fn: () => fn,
|
|
20
20
|
fnIf: () => fnIf,
|
|
21
21
|
getContentsFromMessages: () => getContentsFromMessages,
|
|
22
|
-
http: () => http,
|
|
23
22
|
lastReferenceValue: () => lastReferenceValue,
|
|
24
23
|
merge: () => merge,
|
|
25
24
|
sendMessage: () => sendMessage,
|
|
@@ -321,7 +320,6 @@ import {
|
|
|
321
320
|
fields,
|
|
322
321
|
fn,
|
|
323
322
|
fnIf,
|
|
324
|
-
http,
|
|
325
323
|
lastReferenceValue,
|
|
326
324
|
merge,
|
|
327
325
|
sourceValue
|
|
@@ -442,7 +440,6 @@ export {
|
|
|
442
440
|
fn,
|
|
443
441
|
fnIf,
|
|
444
442
|
getContentsFromMessages,
|
|
445
|
-
http,
|
|
446
443
|
lastReferenceValue,
|
|
447
444
|
merge,
|
|
448
445
|
sendMessage,
|
package/package.json
CHANGED
package/types/Adaptor.d.ts
CHANGED
|
@@ -115,4 +115,4 @@ export type SendMessageOptions = {
|
|
|
115
115
|
content: string | Buffer;
|
|
116
116
|
}>;
|
|
117
117
|
};
|
|
118
|
-
export { alterState, combine, cursor, dataPath, dataValue, each, field, fields, fn, fnIf,
|
|
118
|
+
export { alterState, combine, cursor, dataPath, dataValue, each, field, fields, fn, fnIf, lastReferenceValue, merge, sourceValue } from "@openfn/language-common";
|