@mindstone/mcp-server-google-workspace 0.2.0 → 0.4.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.
Files changed (70) hide show
  1. package/README.md +15 -12
  2. package/dist/modules/chat/index.d.ts +12 -0
  3. package/dist/modules/chat/index.js +18 -0
  4. package/dist/modules/chat/scopes.d.ts +14 -0
  5. package/dist/modules/chat/scopes.js +32 -0
  6. package/dist/modules/chat/types.d.ts +88 -0
  7. package/dist/modules/chat/types.js +14 -0
  8. package/dist/modules/comments/service.js +21 -1
  9. package/dist/modules/contacts/scopes.d.ts +1 -0
  10. package/dist/modules/contacts/scopes.js +2 -2
  11. package/dist/modules/contacts/types.d.ts +34 -0
  12. package/dist/modules/docs/service.js +29 -1
  13. package/dist/modules/drive/activity-service.d.ts +45 -0
  14. package/dist/modules/drive/activity-service.js +114 -0
  15. package/dist/modules/drive/index.d.ts +4 -0
  16. package/dist/modules/drive/index.js +12 -0
  17. package/dist/modules/drive/scopes.d.ts +1 -0
  18. package/dist/modules/drive/scopes.js +3 -0
  19. package/dist/modules/forms/service.js +13 -1
  20. package/dist/modules/gmail/services/base.d.ts +5 -1
  21. package/dist/modules/gmail/services/base.js +8 -0
  22. package/dist/modules/gmail/services/settings.d.ts +14 -1
  23. package/dist/modules/gmail/services/settings.js +94 -0
  24. package/dist/modules/gmail/types.d.ts +36 -0
  25. package/dist/modules/meet/index.d.ts +12 -0
  26. package/dist/modules/meet/index.js +18 -0
  27. package/dist/modules/meet/scopes.d.ts +9 -0
  28. package/dist/modules/meet/scopes.js +25 -0
  29. package/dist/modules/meet/types.d.ts +97 -0
  30. package/dist/modules/meet/types.js +14 -0
  31. package/dist/modules/sheets/service.js +49 -0
  32. package/dist/modules/slides/service.js +25 -1
  33. package/dist/modules/tasks/service.js +25 -1
  34. package/dist/services/base/BaseGoogleService.d.ts +9 -1
  35. package/dist/services/base/BaseGoogleService.js +26 -1
  36. package/dist/services/chat/index.d.ts +34 -0
  37. package/dist/services/chat/index.js +120 -0
  38. package/dist/services/contacts/index.d.ts +19 -1
  39. package/dist/services/contacts/index.js +124 -0
  40. package/dist/services/meet/index.d.ts +35 -0
  41. package/dist/services/meet/index.js +116 -0
  42. package/dist/tools/chat-handlers.d.ts +14 -0
  43. package/dist/tools/chat-handlers.js +126 -0
  44. package/dist/tools/contacts-handlers.d.ts +31 -0
  45. package/dist/tools/contacts-handlers.js +88 -0
  46. package/dist/tools/definitions/chat.d.ts +3 -0
  47. package/dist/tools/definitions/chat.js +137 -0
  48. package/dist/tools/definitions/contacts.js +82 -0
  49. package/dist/tools/definitions/destructive-overrides.json +11 -0
  50. package/dist/tools/definitions/drive.js +48 -0
  51. package/dist/tools/definitions/gmail.js +94 -0
  52. package/dist/tools/definitions/index.d.ts +4 -2
  53. package/dist/tools/definitions/index.js +10 -6
  54. package/dist/tools/definitions/meet.d.ts +3 -0
  55. package/dist/tools/definitions/meet.js +149 -0
  56. package/dist/tools/definitions/open-world-overrides.json +11 -0
  57. package/dist/tools/drive-handlers.d.ts +17 -0
  58. package/dist/tools/drive-handlers.js +49 -1
  59. package/dist/tools/gmail-handlers.d.ts +24 -0
  60. package/dist/tools/gmail-handlers.js +129 -11
  61. package/dist/tools/meet-handlers.d.ts +42 -0
  62. package/dist/tools/meet-handlers.js +144 -0
  63. package/dist/tools/server.js +53 -3
  64. package/dist/utils/apiError.js +5 -2
  65. package/dist/utils/scope-hierarchy.js +10 -0
  66. package/dist/utils/service-initializer.d.ts +0 -10
  67. package/dist/utils/service-initializer.js +14 -23
  68. package/dist/utils/untrusted-content.d.ts +37 -1
  69. package/dist/utils/untrusted-content.js +61 -6
  70. package/package.json +1 -1
@@ -3,6 +3,7 @@ export declare const DRIVE_SCOPES: {
3
3
  readonly READONLY: "https://www.googleapis.com/auth/drive.readonly";
4
4
  readonly FILE: "https://www.googleapis.com/auth/drive.file";
5
5
  readonly APPDATA: "https://www.googleapis.com/auth/drive.appdata";
6
+ readonly ACTIVITY_READONLY: "https://www.googleapis.com/auth/drive.activity.readonly";
6
7
  };
7
8
  export type DriveScope = typeof DRIVE_SCOPES[keyof typeof DRIVE_SCOPES];
8
9
  /**
@@ -10,6 +10,8 @@ export const DRIVE_SCOPES = {
10
10
  FILE: 'https://www.googleapis.com/auth/drive.file',
11
11
  // Access to app data folder
12
12
  APPDATA: 'https://www.googleapis.com/auth/drive.appdata',
13
+ // Read-only access to Drive activity (what changed, when, by whom)
14
+ ACTIVITY_READONLY: 'https://www.googleapis.com/auth/drive.activity.readonly',
13
15
  };
14
16
  /**
15
17
  * Register Drive OAuth scopes at startup.
@@ -26,6 +28,7 @@ export function registerDriveScopes() {
26
28
  scopeRegistry.registerScope('drive', DRIVE_SCOPES.FILE);
27
29
  // Register feature-specific scopes
28
30
  scopeRegistry.registerScope('drive', DRIVE_SCOPES.APPDATA);
31
+ scopeRegistry.registerScope('drive', DRIVE_SCOPES.ACTIVITY_READONLY);
29
32
  // Verify all scopes are registered
30
33
  const registeredScopes = scopeRegistry.getAllScopes();
31
34
  const requiredScopes = Object.values(DRIVE_SCOPES);
@@ -1,6 +1,6 @@
1
1
  import { google } from 'googleapis';
2
2
  import { BaseGoogleService } from '../../services/base/BaseGoogleService.js';
3
- import { describeApiError } from '../../utils/apiError.js';
3
+ import { describeApiError, isAuthHandoffError } from '../../utils/apiError.js';
4
4
  import { FORMS_SCOPES } from './scopes.js';
5
5
  /**
6
6
  * Service for interacting with Google Forms API.
@@ -148,6 +148,10 @@ export class FormsService extends BaseGoogleService {
148
148
  };
149
149
  }
150
150
  catch (error) {
151
+ // An expired/revoked grant must keep its reconnect signal — folding it
152
+ // into a plain error string would skip the host's auth_required handoff.
153
+ if (isAuthHandoffError(error))
154
+ throw error;
151
155
  return {
152
156
  success: false,
153
157
  error: describeApiError(error)
@@ -214,6 +218,10 @@ export class FormsService extends BaseGoogleService {
214
218
  };
215
219
  }
216
220
  catch (error) {
221
+ // An expired/revoked grant must keep its reconnect signal — folding it
222
+ // into a plain error string would skip the host's auth_required handoff.
223
+ if (isAuthHandoffError(error))
224
+ throw error;
217
225
  return {
218
226
  success: false,
219
227
  error: describeApiError(error)
@@ -275,6 +283,10 @@ export class FormsService extends BaseGoogleService {
275
283
  };
276
284
  }
277
285
  catch (error) {
286
+ // An expired/revoked grant must keep its reconnect signal — folding it
287
+ // into a plain error string would skip the host's auth_required handoff.
288
+ if (isAuthHandoffError(error))
289
+ throw error;
278
290
  return {
279
291
  success: false,
280
292
  error: describeApiError(error)
@@ -1,6 +1,6 @@
1
1
  import { google } from 'googleapis';
2
2
  import { BaseGoogleService } from '../../../services/base/BaseGoogleService.js';
3
- import { GetEmailsParams, SendEmailParams, SendEmailResponse, GetGmailSettingsParams, GetGmailSettingsResponse, GmailModuleConfig, GetEmailsResponse, DraftResponse, GetDraftsResponse, Label, GetLabelsResponse, GetLabelFiltersResponse, LabelFilter } from '../types.js';
3
+ import { GetEmailsParams, SendEmailParams, SendEmailResponse, GetGmailSettingsParams, GetGmailSettingsResponse, UpdateVacationResponderParams, VacationResponderState, SendAsAlias, GmailModuleConfig, GetEmailsResponse, DraftResponse, GetDraftsResponse, Label, GetLabelsResponse, GetLabelFiltersResponse, LabelFilter } from '../types.js';
4
4
  import { ManageLabelParams, ManageLabelAssignmentParams, ManageLabelFilterParams } from './label.js';
5
5
  import { ManageDraftParams } from './draft.js';
6
6
  /**
@@ -69,6 +69,10 @@ export declare class GmailService extends BaseGoogleService<ReturnType<typeof go
69
69
  sendEmail(params: SendEmailParams): Promise<SendEmailResponse>;
70
70
  manageDraft(params: ManageDraftParams): Promise<DraftResponse | GetDraftsResponse | SendEmailResponse | void>;
71
71
  getWorkspaceGmailSettings(params: GetGmailSettingsParams): Promise<GetGmailSettingsResponse>;
72
+ updateVacationResponder(params: UpdateVacationResponderParams): Promise<VacationResponderState>;
73
+ listSendAs(params: GetGmailSettingsParams): Promise<{
74
+ sendAs: SendAsAlias[];
75
+ }>;
72
76
  manageLabel(params: ManageLabelParams): Promise<Label | GetLabelsResponse | void>;
73
77
  manageLabelAssignment(params: ManageLabelAssignmentParams): Promise<void>;
74
78
  manageLabelFilter(params: ManageLabelFilterParams): Promise<LabelFilter | GetLabelFiltersResponse | void>;
@@ -96,6 +96,14 @@ export class GmailService extends BaseGoogleService {
96
96
  await this.getGmailClient(params.email);
97
97
  return this.settingsService.getWorkspaceGmailSettings(params);
98
98
  }
99
+ async updateVacationResponder(params) {
100
+ await this.getGmailClient(params.email);
101
+ return this.settingsService.updateVacationResponder(params);
102
+ }
103
+ async listSendAs(params) {
104
+ await this.getGmailClient(params.email);
105
+ return this.settingsService.listSendAs(params);
106
+ }
99
107
  // Consolidated Label Management Methods
100
108
  async manageLabel(params) {
101
109
  await this.getGmailClient(params.email);
@@ -1,5 +1,5 @@
1
1
  import { google } from 'googleapis';
2
- import { GetGmailSettingsParams, GetGmailSettingsResponse } from '../types.js';
2
+ import { GetGmailSettingsParams, GetGmailSettingsResponse, UpdateVacationResponderParams, VacationResponderState, SendAsAlias } from '../types.js';
3
3
  export declare class SettingsService {
4
4
  private gmailClient?;
5
5
  constructor(gmailClient?: ReturnType<typeof google.gmail> | undefined);
@@ -10,5 +10,18 @@ export declare class SettingsService {
10
10
  updateClient(client: ReturnType<typeof google.gmail>): void;
11
11
  private ensureClient;
12
12
  getWorkspaceGmailSettings({ email }: GetGmailSettingsParams): Promise<GetGmailSettingsResponse>;
13
+ /**
14
+ * Updates the vacation (out-of-office) auto-responder. The Gmail API replaces
15
+ * the whole vacation resource on update, so the current settings are fetched
16
+ * first and merged — passing only `enabled` would otherwise wipe the existing
17
+ * subject/body.
18
+ */
19
+ updateVacationResponder(params: UpdateVacationResponderParams): Promise<VacationResponderState>;
20
+ /**
21
+ * Lists the account's send-as aliases, including each alias's signature.
22
+ */
23
+ listSendAs({ email }: GetGmailSettingsParams): Promise<{
24
+ sendAs: SendAsAlias[];
25
+ }>;
13
26
  }
14
27
  //# sourceMappingURL=settings.d.ts.map
@@ -101,5 +101,99 @@ export class SettingsService {
101
101
  throw new GmailError('Failed to get Gmail settings', 'SETTINGS_ERROR', `Error: ${describeApiError(error)}`);
102
102
  }
103
103
  }
104
+ /**
105
+ * Updates the vacation (out-of-office) auto-responder. The Gmail API replaces
106
+ * the whole vacation resource on update, so the current settings are fetched
107
+ * first and merged — passing only `enabled` would otherwise wipe the existing
108
+ * subject/body.
109
+ */
110
+ async updateVacationResponder(params) {
111
+ try {
112
+ const client = this.ensureClient();
113
+ const { data: current } = await client.users.settings.getVacation({ userId: 'me' });
114
+ const responseSubject = params.responseSubject ?? current.responseSubject ?? undefined;
115
+ // A caller-supplied body is sent as plain text. When omitted, preserve the
116
+ // existing body in its own representation: an HTML body must go back as
117
+ // responseBodyHtml, not be flattened into responseBodyPlainText (that
118
+ // would turn the markup into literal visible text in the auto-reply).
119
+ const hasBody = params.responseBody !== undefined
120
+ || Boolean(current.responseBodyPlainText)
121
+ || Boolean(current.responseBodyHtml);
122
+ if (params.enabled && !hasBody) {
123
+ throw new GmailError('Vacation responder needs a message', 'INVALID_PARAMS', 'Provide response_body (the account has no existing auto-reply message to reuse)');
124
+ }
125
+ const bodyFields = params.responseBody !== undefined
126
+ ? { responseBodyPlainText: params.responseBody }
127
+ : {
128
+ ...(current.responseBodyPlainText && { responseBodyPlainText: current.responseBodyPlainText }),
129
+ ...(current.responseBodyHtml && { responseBodyHtml: current.responseBodyHtml })
130
+ };
131
+ const { data: updated } = await client.users.settings.updateVacation({
132
+ userId: 'me',
133
+ requestBody: {
134
+ enableAutoReply: params.enabled,
135
+ ...(responseSubject && { responseSubject }),
136
+ ...bodyFields,
137
+ ...(params.startTime !== undefined
138
+ ? { startTime: String(params.startTime) }
139
+ : params.enabled && !current.startTime
140
+ ? { startTime: String(Date.now()) }
141
+ : current.startTime ? { startTime: current.startTime } : {}),
142
+ // An omitted endTime preserves a still-pending scheduled end — the API
143
+ // replaces the whole resource, so omitting it would silently erase it.
144
+ // An already-past end is not inherited (Gmail requires start < end, and
145
+ // an expired end carries no meaning); clearEndTime drops one explicitly.
146
+ ...(params.endTime !== undefined
147
+ ? { endTime: String(params.endTime) }
148
+ : !params.clearEndTime && current.endTime && Number(current.endTime) > Date.now()
149
+ ? { endTime: current.endTime } : {}),
150
+ restrictToContacts: params.contactsOnly ?? current.restrictToContacts ?? false,
151
+ restrictToDomain: params.domainOnly ?? current.restrictToDomain ?? false
152
+ }
153
+ });
154
+ return {
155
+ enabled: Boolean(updated.enableAutoReply),
156
+ ...(updated.responseSubject && { responseSubject: updated.responseSubject }),
157
+ ...((updated.responseBodyPlainText || updated.responseBodyHtml) && {
158
+ message: updated.responseBodyPlainText ?? updated.responseBodyHtml ?? ''
159
+ }),
160
+ ...(updated.startTime && { startTime: updated.startTime }),
161
+ ...(updated.endTime && { endTime: updated.endTime }),
162
+ contactsOnly: Boolean(updated.restrictToContacts),
163
+ domainOnly: Boolean(updated.restrictToDomain)
164
+ };
165
+ }
166
+ catch (error) {
167
+ if (error instanceof GmailError) {
168
+ throw error;
169
+ }
170
+ throw new GmailError('Failed to update vacation responder', 'SETTINGS_ERROR', `Error: ${describeApiError(error)}`);
171
+ }
172
+ }
173
+ /**
174
+ * Lists the account's send-as aliases, including each alias's signature.
175
+ */
176
+ async listSendAs({ email }) {
177
+ try {
178
+ const client = this.ensureClient();
179
+ const { data } = await client.users.settings.sendAs.list({ userId: 'me' });
180
+ const sendAs = (data.sendAs ?? []).map(alias => ({
181
+ sendAsEmail: alias.sendAsEmail ?? '',
182
+ ...(alias.displayName && { displayName: alias.displayName }),
183
+ ...(alias.replyToAddress && { replyToAddress: alias.replyToAddress }),
184
+ ...(alias.signature && { signature: alias.signature }),
185
+ ...(alias.isPrimary !== null && alias.isPrimary !== undefined && { isPrimary: alias.isPrimary }),
186
+ ...(alias.isDefault !== null && alias.isDefault !== undefined && { isDefault: alias.isDefault }),
187
+ ...(alias.verificationStatus && { verificationStatus: alias.verificationStatus })
188
+ }));
189
+ return { sendAs };
190
+ }
191
+ catch (error) {
192
+ if (error instanceof GmailError) {
193
+ throw error;
194
+ }
195
+ throw new GmailError('Failed to list send-as aliases', 'SETTINGS_ERROR', `Error: ${describeApiError(error)}`);
196
+ }
197
+ }
104
198
  }
105
199
  //# sourceMappingURL=settings.js.map
@@ -150,6 +150,42 @@ export interface DeleteLabelFilterParams {
150
150
  export interface GetGmailSettingsParams {
151
151
  email: string;
152
152
  }
153
+ export interface UpdateVacationResponderParams {
154
+ email: string;
155
+ /** Turn the auto-reply on or off. */
156
+ enabled: boolean;
157
+ responseSubject?: string;
158
+ /** Plain-text auto-reply body. */
159
+ responseBody?: string;
160
+ /** Epoch milliseconds; omit to start immediately when enabling. */
161
+ startTime?: number;
162
+ /** Epoch milliseconds; omit to keep the currently scheduled end (if any). */
163
+ endTime?: number;
164
+ /** Explicitly remove the scheduled end (open-ended auto-reply). */
165
+ clearEndTime?: boolean;
166
+ /** Only auto-reply to people in the user's contacts. */
167
+ contactsOnly?: boolean;
168
+ /** Only auto-reply to people in the user's Workspace domain. */
169
+ domainOnly?: boolean;
170
+ }
171
+ export interface VacationResponderState {
172
+ enabled: boolean;
173
+ responseSubject?: string;
174
+ message?: string;
175
+ startTime?: string;
176
+ endTime?: string;
177
+ contactsOnly?: boolean;
178
+ domainOnly?: boolean;
179
+ }
180
+ export interface SendAsAlias {
181
+ sendAsEmail: string;
182
+ displayName?: string;
183
+ replyToAddress?: string;
184
+ signature?: string;
185
+ isPrimary?: boolean;
186
+ isDefault?: boolean;
187
+ verificationStatus?: string;
188
+ }
153
189
  export interface GetGmailSettingsResponse {
154
190
  profile: {
155
191
  emailAddress: string;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Meet module entry point.
3
+ * Exports types, scopes, and initialization functions for the Google Meet module.
4
+ */
5
+ export * from './types.js';
6
+ export { MEET_SCOPES, registerMeetScopes } from './scopes.js';
7
+ /**
8
+ * Initialize the Meet module.
9
+ * This function is called during server startup to set up any required resources.
10
+ */
11
+ export declare function initializeMeetModule(): Promise<void>;
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Meet module entry point.
3
+ * Exports types, scopes, and initialization functions for the Google Meet module.
4
+ */
5
+ // Export types
6
+ export * from './types.js';
7
+ // Export scopes
8
+ export { MEET_SCOPES, registerMeetScopes } from './scopes.js';
9
+ /**
10
+ * Initialize the Meet module.
11
+ * This function is called during server startup to set up any required resources.
12
+ */
13
+ export async function initializeMeetModule() {
14
+ // Currently no async initialization needed
15
+ // This function is a placeholder for future initialization logic
16
+ return Promise.resolve();
17
+ }
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,9 @@
1
+ export declare const MEET_SCOPES: {
2
+ MEETINGS_SPACE_READONLY: string;
3
+ };
4
+ /**
5
+ * Register Google Meet OAuth scopes at startup.
6
+ * Auth issues will be handled via 401/403 responses rather than pre-validation.
7
+ */
8
+ export declare function registerMeetScopes(): void;
9
+ //# sourceMappingURL=scopes.d.ts.map
@@ -0,0 +1,25 @@
1
+ import { scopeRegistry } from "../tools/scope-registry.js";
2
+ // Define Google Meet scopes as constants for reuse and testing
3
+ // Reference: https://developers.google.com/workspace/meet/api/guides/authenticate-authorize
4
+ export const MEET_SCOPES = {
5
+ // Read-only access to conference records, transcripts, and transcript entries.
6
+ // This single scope covers every read method used by this module:
7
+ // conferenceRecords.list, conferenceRecords.transcripts.list, and
8
+ // conferenceRecords.transcripts.entries.list.
9
+ MEETINGS_SPACE_READONLY: "https://www.googleapis.com/auth/meetings.space.readonly",
10
+ };
11
+ /**
12
+ * Register Google Meet OAuth scopes at startup.
13
+ * Auth issues will be handled via 401/403 responses rather than pre-validation.
14
+ */
15
+ export function registerMeetScopes() {
16
+ scopeRegistry.registerScope("meet", MEET_SCOPES.MEETINGS_SPACE_READONLY);
17
+ // Verify all scopes are registered
18
+ const registeredScopes = scopeRegistry.getAllScopes();
19
+ const requiredScopes = Object.values(MEET_SCOPES);
20
+ const missingScopes = requiredScopes.filter((scope) => !registeredScopes.includes(scope));
21
+ if (missingScopes.length > 0) {
22
+ throw new Error(`Failed to register Meet scopes: ${missingScopes.join(", ")}`);
23
+ }
24
+ }
25
+ //# sourceMappingURL=scopes.js.map
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Parameters for listing conference records.
3
+ */
4
+ export interface ListConferenceRecordsParams {
5
+ email: string;
6
+ pageSize?: number;
7
+ pageToken?: string;
8
+ filter?: string;
9
+ }
10
+ /**
11
+ * Parameters for listing transcripts of a conference record.
12
+ */
13
+ export interface ListTranscriptsParams {
14
+ email: string;
15
+ parent: string;
16
+ pageSize?: number;
17
+ pageToken?: string;
18
+ }
19
+ /**
20
+ * Parameters for listing the entries (speaker + text) of one transcript.
21
+ */
22
+ export interface ListTranscriptEntriesParams {
23
+ email: string;
24
+ parent: string;
25
+ pageSize?: number;
26
+ pageToken?: string;
27
+ }
28
+ /**
29
+ * A single instance of a meeting held in a space.
30
+ * Based on Meet API v2 ConferenceRecord resource.
31
+ * Reference: https://developers.google.com/workspace/meet/api/reference/rest/v2/conferenceRecords
32
+ */
33
+ export interface ConferenceRecord {
34
+ name?: string;
35
+ space?: string;
36
+ startTime?: string;
37
+ endTime?: string;
38
+ expireTime?: string;
39
+ }
40
+ /**
41
+ * Response structure for listing conference records.
42
+ */
43
+ export interface ListConferenceRecordsResponse {
44
+ conferenceRecords?: ConferenceRecord[];
45
+ nextPageToken?: string;
46
+ }
47
+ /**
48
+ * A transcript session of a conference.
49
+ * Based on Meet API v2 Transcript resource.
50
+ * Reference: https://developers.google.com/workspace/meet/api/reference/rest/v2/conferenceRecords.transcripts
51
+ */
52
+ export interface Transcript {
53
+ name?: string;
54
+ state?: string;
55
+ startTime?: string;
56
+ endTime?: string;
57
+ docsDestination?: {
58
+ document?: string;
59
+ exportUri?: string;
60
+ };
61
+ }
62
+ /**
63
+ * Response structure for listing transcripts.
64
+ */
65
+ export interface ListTranscriptsResponse {
66
+ transcripts?: Transcript[];
67
+ nextPageToken?: string;
68
+ }
69
+ /**
70
+ * A single entry (one speaker's utterance) of a transcript session.
71
+ * Based on Meet API v2 TranscriptEntry resource.
72
+ * Reference: https://developers.google.com/workspace/meet/api/reference/rest/v2/conferenceRecords.transcripts.entries
73
+ */
74
+ export interface TranscriptEntry {
75
+ name?: string;
76
+ participant?: string;
77
+ text?: string;
78
+ languageCode?: string;
79
+ startTime?: string;
80
+ endTime?: string;
81
+ }
82
+ /**
83
+ * Response structure for listing transcript entries.
84
+ */
85
+ export interface ListTranscriptEntriesResponse {
86
+ transcriptEntries?: TranscriptEntry[];
87
+ nextPageToken?: string;
88
+ }
89
+ /**
90
+ * Base error class for Meet service.
91
+ */
92
+ export declare class MeetError extends Error {
93
+ code: string;
94
+ details?: string;
95
+ constructor(message: string, code: string, details?: string);
96
+ }
97
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Base error class for Meet service.
3
+ */
4
+ export class MeetError extends Error {
5
+ code;
6
+ details;
7
+ constructor(message, code, details) {
8
+ super(message);
9
+ this.name = "MeetError";
10
+ this.code = code;
11
+ this.details = details;
12
+ }
13
+ }
14
+ //# sourceMappingURL=types.js.map
@@ -1,5 +1,6 @@
1
1
  import { google } from 'googleapis';
2
2
  import { BaseGoogleService } from '../../services/base/BaseGoogleService.js';
3
+ import { isAuthHandoffError } from '../../utils/apiError.js';
3
4
  import { SHEETS_SCOPES } from './scopes.js';
4
5
  import { buildAnchorEnvelope, buildShapedReadResponse, ContinuationTokenError, mergeFormulaAndValue, parseContinuationToken, } from './cellShape.js';
5
6
  import { rewriteSheetsApiError } from './errorRewriter.js';
@@ -495,6 +496,9 @@ export class SheetsService extends BaseGoogleService {
495
496
  };
496
497
  }
497
498
  catch (error) {
499
+ // Keep the reconnect signal: an expired/revoked grant must not collapse to a plain string.
500
+ if (isAuthHandoffError(error))
501
+ throw error;
498
502
  return {
499
503
  success: false,
500
504
  error: error instanceof Error ? error.message : 'Unknown error occurred',
@@ -551,6 +555,9 @@ export class SheetsService extends BaseGoogleService {
551
555
  };
552
556
  }
553
557
  catch (error) {
558
+ // Keep the reconnect signal: an expired/revoked grant must not collapse to a plain string.
559
+ if (isAuthHandoffError(error))
560
+ throw error;
554
561
  if (error instanceof ContinuationTokenError) {
555
562
  return {
556
563
  success: false,
@@ -617,6 +624,9 @@ export class SheetsService extends BaseGoogleService {
617
624
  };
618
625
  }
619
626
  catch (error) {
627
+ // Keep the reconnect signal: an expired/revoked grant must not collapse to a plain string.
628
+ if (isAuthHandoffError(error))
629
+ throw error;
620
630
  if (error instanceof ContinuationTokenError) {
621
631
  return {
622
632
  success: false,
@@ -722,6 +732,9 @@ export class SheetsService extends BaseGoogleService {
722
732
  return { formulaCells };
723
733
  }
724
734
  catch (error) {
735
+ // Keep the reconnect signal: an expired/revoked grant must not collapse to a plain string.
736
+ if (isAuthHandoffError(error))
737
+ throw error;
725
738
  const kind = this.classifyFormulaPreReadError(error);
726
739
  const rewrittenError = rewriteSheetsApiError(error, {
727
740
  tool,
@@ -920,6 +933,9 @@ export class SheetsService extends BaseGoogleService {
920
933
  };
921
934
  }
922
935
  catch (error) {
936
+ // Keep the reconnect signal: an expired/revoked grant must not collapse to a plain string.
937
+ if (isAuthHandoffError(error))
938
+ throw error;
923
939
  return {
924
940
  success: false,
925
941
  error: error instanceof Error ? error.message : 'Unknown error occurred',
@@ -976,6 +992,9 @@ export class SheetsService extends BaseGoogleService {
976
992
  };
977
993
  }
978
994
  catch (error) {
995
+ // Keep the reconnect signal: an expired/revoked grant must not collapse to a plain string.
996
+ if (isAuthHandoffError(error))
997
+ throw error;
979
998
  return {
980
999
  success: false,
981
1000
  error: error instanceof Error ? error.message : 'Unknown error occurred',
@@ -1037,6 +1056,9 @@ export class SheetsService extends BaseGoogleService {
1037
1056
  };
1038
1057
  }
1039
1058
  catch (error) {
1059
+ // Keep the reconnect signal: an expired/revoked grant must not collapse to a plain string.
1060
+ if (isAuthHandoffError(error))
1061
+ throw error;
1040
1062
  return {
1041
1063
  success: false,
1042
1064
  error: error instanceof Error ? error.message : 'Unknown error occurred',
@@ -1067,6 +1089,9 @@ export class SheetsService extends BaseGoogleService {
1067
1089
  };
1068
1090
  }
1069
1091
  catch (error) {
1092
+ // Keep the reconnect signal: an expired/revoked grant must not collapse to a plain string.
1093
+ if (isAuthHandoffError(error))
1094
+ throw error;
1070
1095
  return {
1071
1096
  success: false,
1072
1097
  error: error instanceof Error ? error.message : 'Unknown error occurred',
@@ -1120,6 +1145,9 @@ export class SheetsService extends BaseGoogleService {
1120
1145
  };
1121
1146
  }
1122
1147
  catch (error) {
1148
+ // Keep the reconnect signal: an expired/revoked grant must not collapse to a plain string.
1149
+ if (isAuthHandoffError(error))
1150
+ throw error;
1123
1151
  return {
1124
1152
  success: false,
1125
1153
  error: error instanceof Error ? error.message : 'Unknown error occurred',
@@ -1157,6 +1185,9 @@ export class SheetsService extends BaseGoogleService {
1157
1185
  };
1158
1186
  }
1159
1187
  catch (error) {
1188
+ // Keep the reconnect signal: an expired/revoked grant must not collapse to a plain string.
1189
+ if (isAuthHandoffError(error))
1190
+ throw error;
1160
1191
  return {
1161
1192
  success: false,
1162
1193
  error: error instanceof Error ? error.message : 'Unknown error occurred',
@@ -1190,6 +1221,9 @@ export class SheetsService extends BaseGoogleService {
1190
1221
  };
1191
1222
  }
1192
1223
  catch (error) {
1224
+ // Keep the reconnect signal: an expired/revoked grant must not collapse to a plain string.
1225
+ if (isAuthHandoffError(error))
1226
+ throw error;
1193
1227
  return {
1194
1228
  success: false,
1195
1229
  error: error instanceof Error ? error.message : 'Unknown error occurred',
@@ -1285,6 +1319,9 @@ export class SheetsService extends BaseGoogleService {
1285
1319
  };
1286
1320
  }
1287
1321
  catch (error) {
1322
+ // Keep the reconnect signal: an expired/revoked grant must not collapse to a plain string.
1323
+ if (isAuthHandoffError(error))
1324
+ throw error;
1288
1325
  if (error instanceof ContinuationTokenError) {
1289
1326
  return {
1290
1327
  success: false,
@@ -1391,6 +1428,9 @@ export class SheetsService extends BaseGoogleService {
1391
1428
  };
1392
1429
  }
1393
1430
  catch (error) {
1431
+ // Keep the reconnect signal: an expired/revoked grant must not collapse to a plain string.
1432
+ if (isAuthHandoffError(error))
1433
+ throw error;
1394
1434
  if (error instanceof ContinuationTokenError) {
1395
1435
  return {
1396
1436
  success: false,
@@ -1472,6 +1512,9 @@ export class SheetsService extends BaseGoogleService {
1472
1512
  };
1473
1513
  }
1474
1514
  catch (error) {
1515
+ // Keep the reconnect signal: an expired/revoked grant must not collapse to a plain string.
1516
+ if (isAuthHandoffError(error))
1517
+ throw error;
1475
1518
  return {
1476
1519
  success: false,
1477
1520
  error: error instanceof Error ? error.message : 'Unknown error occurred',
@@ -1520,6 +1563,9 @@ export class SheetsService extends BaseGoogleService {
1520
1563
  };
1521
1564
  }
1522
1565
  catch (error) {
1566
+ // Keep the reconnect signal: an expired/revoked grant must not collapse to a plain string.
1567
+ if (isAuthHandoffError(error))
1568
+ throw error;
1523
1569
  return {
1524
1570
  success: false,
1525
1571
  error: error instanceof Error ? error.message : 'Unknown error occurred',
@@ -1640,6 +1686,9 @@ export class SheetsService extends BaseGoogleService {
1640
1686
  };
1641
1687
  }
1642
1688
  catch (error) {
1689
+ // Keep the reconnect signal: an expired/revoked grant must not collapse to a plain string.
1690
+ if (isAuthHandoffError(error))
1691
+ throw error;
1643
1692
  return {
1644
1693
  success: false,
1645
1694
  error: error instanceof Error ? error.message : 'Unknown error occurred',