Skip to content

Commit 0030226

Browse files
committed
feat(gscript): add to ServiceName, Config, and OAuth scopes
1 parent 35821e0 commit 0030226

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

src/auth/oauth.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,13 @@ const GSLIDES_SCOPES = [
6262
'https://www.googleapis.com/auth/userinfo.email', // get email for profile naming
6363
];
6464

65-
const SCOPES: Record<'gmail' | 'gchat' | 'gdocs' | 'gdrive-readonly' | 'gdrive-full' | 'gcal' | 'gtasks' | 'gsheets' | 'gslides', string[]> = {
65+
const GSCRIPT_SCOPES = [
66+
'https://www.googleapis.com/auth/script.projects', // create/read/update Apps Script projects
67+
'https://www.googleapis.com/auth/drive', // list scripts by container, delete scripts
68+
'https://www.googleapis.com/auth/userinfo.email', // get email for profile naming
69+
];
70+
71+
const SCOPES: Record<'gmail' | 'gchat' | 'gdocs' | 'gdrive-readonly' | 'gdrive-full' | 'gcal' | 'gtasks' | 'gsheets' | 'gslides' | 'gscript', string[]> = {
6672
gmail: GMAIL_SCOPES,
6773
gchat: GCHAT_SCOPES,
6874
gdocs: GDOCS_SCOPES,
@@ -72,9 +78,10 @@ const SCOPES: Record<'gmail' | 'gchat' | 'gdocs' | 'gdrive-readonly' | 'gdrive-f
7278
gtasks: GTASKS_SCOPES,
7379
gsheets: GSHEETS_SCOPES,
7480
gslides: GSLIDES_SCOPES,
81+
gscript: GSCRIPT_SCOPES,
7582
};
7683

77-
export type OAuthService = 'gmail' | 'gchat' | 'gdocs' | 'gdrive-readonly' | 'gdrive-full' | 'gcal' | 'gtasks' | 'gsheets' | 'gslides';
84+
export type OAuthService = 'gmail' | 'gchat' | 'gdocs' | 'gdrive-readonly' | 'gdrive-full' | 'gcal' | 'gtasks' | 'gsheets' | 'gslides' | 'gscript';
7885

7986
export async function performOAuthFlow(
8087
service: OAuthService

src/types/config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export interface Config {
8585
gchat?: ProfileValue[];
8686
gsheets?: ProfileValue[];
8787
gslides?: ProfileValue[];
88+
gscript?: ProfileValue[];
8889
github?: ProfileValue[];
8990
jira?: ProfileValue[];
9091
confluence?: ProfileValue[];
@@ -101,9 +102,9 @@ export interface Config {
101102
teleport?: TeleportConfig;
102103
}
103104

104-
export type ServiceName = 'gdocs' | 'gdrive' | 'gmail' | 'gcal' | 'gtasks' | 'gchat' | 'gsheets' | 'gslides' | 'github' | 'jira' | 'confluence' | 'slack' | 'telegram' | 'whatsapp' | 'discourse' | 'sql';
105+
export type ServiceName = 'gdocs' | 'gdrive' | 'gmail' | 'gcal' | 'gtasks' | 'gchat' | 'gsheets' | 'gslides' | 'gscript' | 'github' | 'jira' | 'confluence' | 'slack' | 'telegram' | 'whatsapp' | 'discourse' | 'sql';
105106

106107
export const ALL_SERVICES: readonly ServiceName[] = [
107-
'gdocs', 'gdrive', 'gmail', 'gcal', 'gtasks', 'gchat', 'gsheets', 'gslides',
108+
'gdocs', 'gdrive', 'gmail', 'gcal', 'gtasks', 'gchat', 'gsheets', 'gslides', 'gscript',
108109
'github', 'jira', 'confluence', 'slack', 'telegram', 'whatsapp', 'discourse', 'sql',
109110
];

0 commit comments

Comments
 (0)