@sentry/junior-google 0.297.0 → 0.299.0
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 +28 -5
- package/dist/config.d.ts +8 -1
- package/dist/credentials.d.ts +48 -0
- package/dist/index.js +1385 -488
- package/dist/tools/cancel-event.d.ts +34 -2
- package/dist/tools/create-doc.d.ts +176 -0
- package/dist/tools/create-event.d.ts +34 -2
- package/dist/tools/doc-edits.d.ts +84 -0
- package/dist/tools/doc-markdown.d.ts +40 -0
- package/dist/tools/files.d.ts +6 -0
- package/dist/tools/find-meeting-times.d.ts +34 -2
- package/dist/tools/insert-doc-content.d.ts +170 -0
- package/dist/tools/list-events.d.ts +34 -2
- package/dist/tools/list-file-comments.d.ts +34 -2
- package/dist/tools/read-doc.d.ts +39 -5
- package/dist/tools/read-meeting-transcript.d.ts +34 -2
- package/dist/tools/read-sheet.d.ts +34 -2
- package/dist/tools/read-slides.d.ts +34 -2
- package/dist/tools/replace-doc-content.d.ts +169 -0
- package/dist/tools/replace-doc-text.d.ts +173 -0
- package/dist/tools/search-files.d.ts +38 -3
- package/dist/tools/shared.d.ts +17 -1
- package/dist/tools/update-event.d.ts +34 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
# @sentry/junior-google
|
|
2
2
|
|
|
3
3
|
Proof of concept. Junior uses its own Google Workspace account, such as
|
|
4
|
-
`junior@example.com`, to schedule meetings, read Meet transcripts,
|
|
5
|
-
Google Docs, Sheets, and Slides that are shared with that account
|
|
4
|
+
`junior@example.com`, to schedule meetings, read Meet transcripts, read
|
|
5
|
+
Google Docs, Sheets, and Slides that are shared with that account, and create
|
|
6
|
+
and edit Google Docs. Junior does
|
|
6
7
|
not use the Google credentials of the people it helps.
|
|
7
8
|
|
|
8
9
|
## Setup
|
|
9
10
|
|
|
10
11
|
1. In the Google Cloud project of the dashboard OAuth client, enable the
|
|
11
|
-
Calendar, Drive, Sheets, and Slides APIs.
|
|
12
|
+
Calendar, Docs, Drive, Sheets, and Slides APIs.
|
|
12
13
|
2. Use an **Internal** consent screen. Add the scopes
|
|
13
14
|
`calendar.events.freebusy`, `calendar.events.readonly`,
|
|
14
|
-
`calendar.events.owned`, and `drive.readonly`.
|
|
15
|
+
`calendar.events.owned`, `documents`, `drive.file`, and `drive.readonly`.
|
|
16
|
+
After you add a scope, reconnect the account in step 7.
|
|
15
17
|
3. Add the redirect URIs
|
|
16
18
|
`https://<junior host>/api/plugins/google/oauth/callback` and
|
|
17
19
|
`http://127.0.0.1:8765/oauth/callback` (CLI).
|
|
@@ -24,6 +26,27 @@ not use the Google credentials of the people it helps.
|
|
|
24
26
|
`junior google connect`.
|
|
25
27
|
|
|
26
28
|
Anyone who can talk to Junior can read what the Junior account can see. Share
|
|
27
|
-
calendars and files with that account only when that is acceptable.
|
|
29
|
+
calendars and files with that account only when that is acceptable. Given a
|
|
30
|
+
link, Junior opens any Doc, Sheet, or Slides file shared with its account.
|
|
31
|
+
Search finds only files that any employee could already find in Drive, and
|
|
32
|
+
files shared with the requester by name. Files shared by link, or only with
|
|
33
|
+
other people or groups, never show up in search. Search also drops every file
|
|
34
|
+
that no account in `GOOGLE_WORKSPACE_ALLOWED_DOMAINS` owns. Shared-drive files
|
|
35
|
+
have no owner, so search shows them only when they are shared with the
|
|
36
|
+
requester by name. Search returns nothing for a requester outside those
|
|
37
|
+
domains.
|
|
38
|
+
|
|
39
|
+
Junior edits a Doc only for a requester who can edit it through their own
|
|
40
|
+
email, their domain, or an editable link. Access through a Google group is not
|
|
41
|
+
checked. Anyone who can talk to Junior can read a Doc that Junior edits, if
|
|
42
|
+
they give Junior its link. Junior makes the requester the owner of a Doc it
|
|
43
|
+
creates, then removes its own access. Google emails the requester about the
|
|
44
|
+
new ownership. Junior cannot read or edit that Doc again unless the requester
|
|
45
|
+
shares it back. This only works for requesters in the same Workspace
|
|
46
|
+
organization as Junior's account.
|
|
47
|
+
|
|
48
|
+
Each edit of an existing Doc needs the `revision_id` that `readGoogleDoc` or
|
|
49
|
+
the last edit returned. If someone changed the Doc after that, the edit is
|
|
50
|
+
refused, so Junior never changes text that it did not read.
|
|
28
51
|
|
|
29
52
|
Plugin setup: https://junior.sentry.dev/extend/
|
package/dist/config.d.ts
CHANGED
|
@@ -18,11 +18,18 @@ export declare const GOOGLE_ALLOWED_DOMAINS_ENV = "GOOGLE_WORKSPACE_ALLOWED_DOMA
|
|
|
18
18
|
* still decide how much detail each calendar shows.
|
|
19
19
|
* - `calendar.events.owned`: create and change events on Junior's own
|
|
20
20
|
* calendar.
|
|
21
|
+
* - `documents`: create Docs and edit Docs that Junior's account can already
|
|
22
|
+
* edit, through the Docs API. It gives no access to other Drive files and
|
|
23
|
+
* cannot change sharing.
|
|
24
|
+
* - `drive.file`: make the requester the owner of a Doc that Junior created,
|
|
25
|
+
* then remove Junior's own access. It only covers files this OAuth client
|
|
26
|
+
* created, so it cannot change sharing on other files. Full `drive` is not
|
|
27
|
+
* needed.
|
|
21
28
|
* - `drive.readonly`: search Drive, export Docs, read Sheets and Slides, and
|
|
22
29
|
* read comments. The Drive comments API accepts no narrower read scope. The
|
|
23
30
|
* Sheets and Slides APIs also accept this scope.
|
|
24
31
|
*/
|
|
25
|
-
export declare const GOOGLE_API_SCOPES: readonly ["https://www.googleapis.com/auth/calendar.events.freebusy", "https://www.googleapis.com/auth/calendar.events.owned", "https://www.googleapis.com/auth/calendar.events.readonly", "https://www.googleapis.com/auth/drive.readonly"];
|
|
32
|
+
export declare const GOOGLE_API_SCOPES: readonly ["https://www.googleapis.com/auth/calendar.events.freebusy", "https://www.googleapis.com/auth/calendar.events.owned", "https://www.googleapis.com/auth/calendar.events.readonly", "https://www.googleapis.com/auth/documents", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.readonly"];
|
|
26
33
|
/** Identity scopes used only to verify which account signed in. */
|
|
27
34
|
export declare const GOOGLE_IDENTITY_SCOPES: readonly ["openid", "email"];
|
|
28
35
|
export interface GoogleConfig {
|
package/dist/credentials.d.ts
CHANGED
|
@@ -48,6 +48,30 @@ export declare const GOOGLE_OPERATIONS: {
|
|
|
48
48
|
readonly method: "POST";
|
|
49
49
|
readonly path: RegExp;
|
|
50
50
|
};
|
|
51
|
+
readonly "google.docs.document.batchUpdate": {
|
|
52
|
+
readonly access: "write";
|
|
53
|
+
readonly host: "docs.googleapis.com";
|
|
54
|
+
readonly method: "POST";
|
|
55
|
+
readonly path: RegExp;
|
|
56
|
+
};
|
|
57
|
+
readonly "google.docs.document.create": {
|
|
58
|
+
readonly access: "write";
|
|
59
|
+
readonly host: "docs.googleapis.com";
|
|
60
|
+
readonly method: "POST";
|
|
61
|
+
readonly path: RegExp;
|
|
62
|
+
};
|
|
63
|
+
readonly "google.docs.document.get": {
|
|
64
|
+
readonly access: "read";
|
|
65
|
+
readonly host: "docs.googleapis.com";
|
|
66
|
+
readonly method: "GET";
|
|
67
|
+
readonly path: RegExp;
|
|
68
|
+
};
|
|
69
|
+
readonly "google.drive.about.get": {
|
|
70
|
+
readonly access: "read";
|
|
71
|
+
readonly host: "www.googleapis.com";
|
|
72
|
+
readonly method: "GET";
|
|
73
|
+
readonly path: RegExp;
|
|
74
|
+
};
|
|
51
75
|
readonly "google.drive.comments.list": {
|
|
52
76
|
readonly access: "read";
|
|
53
77
|
readonly host: "www.googleapis.com";
|
|
@@ -72,6 +96,30 @@ export declare const GOOGLE_OPERATIONS: {
|
|
|
72
96
|
readonly method: "GET";
|
|
73
97
|
readonly path: RegExp;
|
|
74
98
|
};
|
|
99
|
+
readonly "google.drive.permission.create": {
|
|
100
|
+
readonly access: "write";
|
|
101
|
+
readonly host: "www.googleapis.com";
|
|
102
|
+
readonly method: "POST";
|
|
103
|
+
readonly path: RegExp;
|
|
104
|
+
};
|
|
105
|
+
readonly "google.drive.file.delete": {
|
|
106
|
+
readonly access: "write";
|
|
107
|
+
readonly host: "www.googleapis.com";
|
|
108
|
+
readonly method: "DELETE";
|
|
109
|
+
readonly path: RegExp;
|
|
110
|
+
};
|
|
111
|
+
readonly "google.drive.permission.delete": {
|
|
112
|
+
readonly access: "write";
|
|
113
|
+
readonly host: "www.googleapis.com";
|
|
114
|
+
readonly method: "DELETE";
|
|
115
|
+
readonly path: RegExp;
|
|
116
|
+
};
|
|
117
|
+
readonly "google.drive.permissions.list": {
|
|
118
|
+
readonly access: "read";
|
|
119
|
+
readonly host: "www.googleapis.com";
|
|
120
|
+
readonly method: "GET";
|
|
121
|
+
readonly path: RegExp;
|
|
122
|
+
};
|
|
75
123
|
readonly "google.sheets.spreadsheet.get": {
|
|
76
124
|
readonly access: "read";
|
|
77
125
|
readonly host: "sheets.googleapis.com";
|