@mindstone/mcp-server-google-workspace 0.1.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/LICENSE +97 -0
- package/README.md +71 -0
- package/SECURITY.md +38 -0
- package/dist/__fixtures__/accounts.d.ts +47 -0
- package/dist/__fixtures__/accounts.d.ts.map +1 -0
- package/dist/__fixtures__/accounts.js +56 -0
- package/dist/__fixtures__/accounts.js.map +1 -0
- package/dist/api/handler.d.ts +16 -0
- package/dist/api/handler.d.ts.map +1 -0
- package/dist/api/handler.js +68 -0
- package/dist/api/handler.js.map +1 -0
- package/dist/api/request.d.ts +13 -0
- package/dist/api/request.d.ts.map +1 -0
- package/dist/api/request.js +111 -0
- package/dist/api/request.js.map +1 -0
- package/dist/api/validators/endpoint.d.ts +8 -0
- package/dist/api/validators/endpoint.d.ts.map +1 -0
- package/dist/api/validators/endpoint.js +115 -0
- package/dist/api/validators/endpoint.js.map +1 -0
- package/dist/api/validators/parameter.d.ts +12 -0
- package/dist/api/validators/parameter.d.ts.map +1 -0
- package/dist/api/validators/parameter.js +155 -0
- package/dist/api/validators/parameter.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/modules/accounts/index.d.ts +12 -0
- package/dist/modules/accounts/index.d.ts.map +1 -0
- package/dist/modules/accounts/index.js +41 -0
- package/dist/modules/accounts/index.js.map +1 -0
- package/dist/modules/accounts/manager.d.ts +40 -0
- package/dist/modules/accounts/manager.d.ts.map +1 -0
- package/dist/modules/accounts/manager.js +359 -0
- package/dist/modules/accounts/manager.js.map +1 -0
- package/dist/modules/accounts/oauth.d.ts +36 -0
- package/dist/modules/accounts/oauth.d.ts.map +1 -0
- package/dist/modules/accounts/oauth.js +112 -0
- package/dist/modules/accounts/oauth.js.map +1 -0
- package/dist/modules/accounts/token.d.ts +32 -0
- package/dist/modules/accounts/token.d.ts.map +1 -0
- package/dist/modules/accounts/token.js +305 -0
- package/dist/modules/accounts/token.js.map +1 -0
- package/dist/modules/accounts/types.d.ts +47 -0
- package/dist/modules/accounts/types.d.ts.map +1 -0
- package/dist/modules/accounts/types.js +16 -0
- package/dist/modules/accounts/types.js.map +1 -0
- package/dist/modules/accounts/unauthorized.d.ts +3 -0
- package/dist/modules/accounts/unauthorized.d.ts.map +1 -0
- package/dist/modules/accounts/unauthorized.js +44 -0
- package/dist/modules/accounts/unauthorized.js.map +1 -0
- package/dist/modules/attachments/cleanup-service.d.ts +44 -0
- package/dist/modules/attachments/cleanup-service.d.ts.map +1 -0
- package/dist/modules/attachments/cleanup-service.js +118 -0
- package/dist/modules/attachments/cleanup-service.js.map +1 -0
- package/dist/modules/attachments/index-service.d.ts +57 -0
- package/dist/modules/attachments/index-service.d.ts.map +1 -0
- package/dist/modules/attachments/index-service.js +110 -0
- package/dist/modules/attachments/index-service.js.map +1 -0
- package/dist/modules/attachments/response-transformer.d.ts +28 -0
- package/dist/modules/attachments/response-transformer.d.ts.map +1 -0
- package/dist/modules/attachments/response-transformer.js +64 -0
- package/dist/modules/attachments/response-transformer.js.map +1 -0
- package/dist/modules/attachments/service.d.ts +47 -0
- package/dist/modules/attachments/service.d.ts.map +1 -0
- package/dist/modules/attachments/service.js +362 -0
- package/dist/modules/attachments/service.js.map +1 -0
- package/dist/modules/attachments/transformer.d.ts +28 -0
- package/dist/modules/attachments/transformer.d.ts.map +1 -0
- package/dist/modules/attachments/transformer.js +31 -0
- package/dist/modules/attachments/transformer.js.map +1 -0
- package/dist/modules/attachments/types.d.ts +33 -0
- package/dist/modules/attachments/types.d.ts.map +1 -0
- package/dist/modules/attachments/types.js +9 -0
- package/dist/modules/attachments/types.js.map +1 -0
- package/dist/modules/calendar/index.d.ts +48 -0
- package/dist/modules/calendar/index.d.ts.map +1 -0
- package/dist/modules/calendar/index.js +61 -0
- package/dist/modules/calendar/index.js.map +1 -0
- package/dist/modules/calendar/scopes.d.ts +17 -0
- package/dist/modules/calendar/scopes.d.ts.map +1 -0
- package/dist/modules/calendar/scopes.js +39 -0
- package/dist/modules/calendar/scopes.js.map +1 -0
- package/dist/modules/calendar/service.d.ts +75 -0
- package/dist/modules/calendar/service.d.ts.map +1 -0
- package/dist/modules/calendar/service.js +705 -0
- package/dist/modules/calendar/service.js.map +1 -0
- package/dist/modules/calendar/types.d.ts +154 -0
- package/dist/modules/calendar/types.d.ts.map +1 -0
- package/dist/modules/calendar/types.js +11 -0
- package/dist/modules/calendar/types.js.map +1 -0
- package/dist/modules/comments/index.d.ts +12 -0
- package/dist/modules/comments/index.d.ts.map +1 -0
- package/dist/modules/comments/index.js +23 -0
- package/dist/modules/comments/index.js.map +1 -0
- package/dist/modules/comments/service.d.ts +39 -0
- package/dist/modules/comments/service.d.ts.map +1 -0
- package/dist/modules/comments/service.js +227 -0
- package/dist/modules/comments/service.js.map +1 -0
- package/dist/modules/comments/types.d.ts +67 -0
- package/dist/modules/comments/types.d.ts.map +1 -0
- package/dist/modules/comments/types.js +2 -0
- package/dist/modules/comments/types.js.map +1 -0
- package/dist/modules/contacts/index.d.ts +12 -0
- package/dist/modules/contacts/index.d.ts.map +1 -0
- package/dist/modules/contacts/index.js +18 -0
- package/dist/modules/contacts/index.js.map +1 -0
- package/dist/modules/contacts/scopes.d.ts +4 -0
- package/dist/modules/contacts/scopes.d.ts.map +1 -0
- package/dist/modules/contacts/scopes.js +11 -0
- package/dist/modules/contacts/scopes.js.map +1 -0
- package/dist/modules/contacts/types.d.ts +55 -0
- package/dist/modules/contacts/types.d.ts.map +1 -0
- package/dist/modules/contacts/types.js +14 -0
- package/dist/modules/contacts/types.js.map +1 -0
- package/dist/modules/docs/formatters.d.ts +30 -0
- package/dist/modules/docs/formatters.d.ts.map +1 -0
- package/dist/modules/docs/formatters.js +76 -0
- package/dist/modules/docs/formatters.js.map +1 -0
- package/dist/modules/docs/index.d.ts +9 -0
- package/dist/modules/docs/index.d.ts.map +1 -0
- package/dist/modules/docs/index.js +23 -0
- package/dist/modules/docs/index.js.map +1 -0
- package/dist/modules/docs/scopes.d.ts +17 -0
- package/dist/modules/docs/scopes.d.ts.map +1 -0
- package/dist/modules/docs/scopes.js +39 -0
- package/dist/modules/docs/scopes.js.map +1 -0
- package/dist/modules/docs/service.d.ts +58 -0
- package/dist/modules/docs/service.d.ts.map +1 -0
- package/dist/modules/docs/service.js +421 -0
- package/dist/modules/docs/service.js.map +1 -0
- package/dist/modules/docs/types.d.ts +75 -0
- package/dist/modules/docs/types.d.ts.map +1 -0
- package/dist/modules/docs/types.js +2 -0
- package/dist/modules/docs/types.js.map +1 -0
- package/dist/modules/drive/index.d.ts +9 -0
- package/dist/modules/drive/index.d.ts.map +1 -0
- package/dist/modules/drive/index.js +28 -0
- package/dist/modules/drive/index.js.map +1 -0
- package/dist/modules/drive/scopes.d.ts +19 -0
- package/dist/modules/drive/scopes.d.ts.map +1 -0
- package/dist/modules/drive/scopes.js +44 -0
- package/dist/modules/drive/scopes.js.map +1 -0
- package/dist/modules/drive/service.d.ts +33 -0
- package/dist/modules/drive/service.d.ts.map +1 -0
- package/dist/modules/drive/service.js +467 -0
- package/dist/modules/drive/service.js.map +1 -0
- package/dist/modules/drive/types.d.ts +55 -0
- package/dist/modules/drive/types.d.ts.map +1 -0
- package/dist/modules/drive/types.js +2 -0
- package/dist/modules/drive/types.js.map +1 -0
- package/dist/modules/forms/index.d.ts +13 -0
- package/dist/modules/forms/index.d.ts.map +1 -0
- package/dist/modules/forms/index.js +24 -0
- package/dist/modules/forms/index.js.map +1 -0
- package/dist/modules/forms/scopes.d.ts +21 -0
- package/dist/modules/forms/scopes.d.ts.map +1 -0
- package/dist/modules/forms/scopes.js +36 -0
- package/dist/modules/forms/scopes.js.map +1 -0
- package/dist/modules/forms/service.d.ts +52 -0
- package/dist/modules/forms/service.d.ts.map +1 -0
- package/dist/modules/forms/service.js +284 -0
- package/dist/modules/forms/service.js.map +1 -0
- package/dist/modules/forms/types.d.ts +399 -0
- package/dist/modules/forms/types.d.ts.map +1 -0
- package/dist/modules/forms/types.js +6 -0
- package/dist/modules/forms/types.js.map +1 -0
- package/dist/modules/gmail/constants.d.ts +69 -0
- package/dist/modules/gmail/constants.d.ts.map +1 -0
- package/dist/modules/gmail/constants.js +100 -0
- package/dist/modules/gmail/constants.js.map +1 -0
- package/dist/modules/gmail/index.d.ts +7 -0
- package/dist/modules/gmail/index.d.ts.map +1 -0
- package/dist/modules/gmail/index.js +16 -0
- package/dist/modules/gmail/index.js.map +1 -0
- package/dist/modules/gmail/scopes.d.ts +17 -0
- package/dist/modules/gmail/scopes.d.ts.map +1 -0
- package/dist/modules/gmail/scopes.js +39 -0
- package/dist/modules/gmail/scopes.js.map +1 -0
- package/dist/modules/gmail/service.d.ts +2 -0
- package/dist/modules/gmail/service.d.ts.map +1 -0
- package/dist/modules/gmail/service.js +2 -0
- package/dist/modules/gmail/service.js.map +1 -0
- package/dist/modules/gmail/services/attachment.d.ts +41 -0
- package/dist/modules/gmail/services/attachment.d.ts.map +1 -0
- package/dist/modules/gmail/services/attachment.js +143 -0
- package/dist/modules/gmail/services/attachment.js.map +1 -0
- package/dist/modules/gmail/services/base.d.ts +79 -0
- package/dist/modules/gmail/services/base.d.ts.map +1 -0
- package/dist/modules/gmail/services/base.js +124 -0
- package/dist/modules/gmail/services/base.js.map +1 -0
- package/dist/modules/gmail/services/draft.d.ts +104 -0
- package/dist/modules/gmail/services/draft.d.ts.map +1 -0
- package/dist/modules/gmail/services/draft.js +239 -0
- package/dist/modules/gmail/services/draft.js.map +1 -0
- package/dist/modules/gmail/services/email.d.ts +82 -0
- package/dist/modules/gmail/services/email.d.ts.map +1 -0
- package/dist/modules/gmail/services/email.js +462 -0
- package/dist/modules/gmail/services/email.js.map +1 -0
- package/dist/modules/gmail/services/label.d.ts +62 -0
- package/dist/modules/gmail/services/label.d.ts.map +1 -0
- package/dist/modules/gmail/services/label.js +501 -0
- package/dist/modules/gmail/services/label.js.map +1 -0
- package/dist/modules/gmail/services/mime-builder.d.ts +26 -0
- package/dist/modules/gmail/services/mime-builder.d.ts.map +1 -0
- package/dist/modules/gmail/services/mime-builder.js +83 -0
- package/dist/modules/gmail/services/mime-builder.js.map +1 -0
- package/dist/modules/gmail/services/search.d.ts +8 -0
- package/dist/modules/gmail/services/search.d.ts.map +1 -0
- package/dist/modules/gmail/services/search.js +76 -0
- package/dist/modules/gmail/services/search.js.map +1 -0
- package/dist/modules/gmail/services/settings.d.ts +14 -0
- package/dist/modules/gmail/services/settings.d.ts.map +1 -0
- package/dist/modules/gmail/services/settings.js +104 -0
- package/dist/modules/gmail/services/settings.js.map +1 -0
- package/dist/modules/gmail/types.d.ts +279 -0
- package/dist/modules/gmail/types.d.ts.map +1 -0
- package/dist/modules/gmail/types.js +11 -0
- package/dist/modules/gmail/types.js.map +1 -0
- package/dist/modules/sheets/a1Utils.d.ts +20 -0
- package/dist/modules/sheets/a1Utils.d.ts.map +1 -0
- package/dist/modules/sheets/a1Utils.js +252 -0
- package/dist/modules/sheets/a1Utils.js.map +1 -0
- package/dist/modules/sheets/cellShape.d.ts +48 -0
- package/dist/modules/sheets/cellShape.d.ts.map +1 -0
- package/dist/modules/sheets/cellShape.js +418 -0
- package/dist/modules/sheets/cellShape.js.map +1 -0
- package/dist/modules/sheets/errorRewriter.d.ts +6 -0
- package/dist/modules/sheets/errorRewriter.d.ts.map +1 -0
- package/dist/modules/sheets/errorRewriter.js +120 -0
- package/dist/modules/sheets/errorRewriter.js.map +1 -0
- package/dist/modules/sheets/formatters.d.ts +54 -0
- package/dist/modules/sheets/formatters.d.ts.map +1 -0
- package/dist/modules/sheets/formatters.js +270 -0
- package/dist/modules/sheets/formatters.js.map +1 -0
- package/dist/modules/sheets/index.d.ts +9 -0
- package/dist/modules/sheets/index.d.ts.map +1 -0
- package/dist/modules/sheets/index.js +23 -0
- package/dist/modules/sheets/index.js.map +1 -0
- package/dist/modules/sheets/scopes.d.ts +17 -0
- package/dist/modules/sheets/scopes.d.ts.map +1 -0
- package/dist/modules/sheets/scopes.js +39 -0
- package/dist/modules/sheets/scopes.js.map +1 -0
- package/dist/modules/sheets/service.d.ts +102 -0
- package/dist/modules/sheets/service.d.ts.map +1 -0
- package/dist/modules/sheets/service.js +1650 -0
- package/dist/modules/sheets/service.js.map +1 -0
- package/dist/modules/sheets/types.d.ts +271 -0
- package/dist/modules/sheets/types.d.ts.map +1 -0
- package/dist/modules/sheets/types.js +2 -0
- package/dist/modules/sheets/types.js.map +1 -0
- package/dist/modules/sheets/writeGuards.d.ts +31 -0
- package/dist/modules/sheets/writeGuards.d.ts.map +1 -0
- package/dist/modules/sheets/writeGuards.js +254 -0
- package/dist/modules/sheets/writeGuards.js.map +1 -0
- package/dist/modules/slides/formatters.d.ts +35 -0
- package/dist/modules/slides/formatters.d.ts.map +1 -0
- package/dist/modules/slides/formatters.js +96 -0
- package/dist/modules/slides/formatters.js.map +1 -0
- package/dist/modules/slides/index.d.ts +9 -0
- package/dist/modules/slides/index.d.ts.map +1 -0
- package/dist/modules/slides/index.js +23 -0
- package/dist/modules/slides/index.js.map +1 -0
- package/dist/modules/slides/scopes.d.ts +17 -0
- package/dist/modules/slides/scopes.d.ts.map +1 -0
- package/dist/modules/slides/scopes.js +39 -0
- package/dist/modules/slides/scopes.js.map +1 -0
- package/dist/modules/slides/service.d.ts +67 -0
- package/dist/modules/slides/service.d.ts.map +1 -0
- package/dist/modules/slides/service.js +394 -0
- package/dist/modules/slides/service.js.map +1 -0
- package/dist/modules/slides/types.d.ts +63 -0
- package/dist/modules/slides/types.d.ts.map +1 -0
- package/dist/modules/slides/types.js +2 -0
- package/dist/modules/slides/types.js.map +1 -0
- package/dist/modules/tasks/index.d.ts +13 -0
- package/dist/modules/tasks/index.d.ts.map +1 -0
- package/dist/modules/tasks/index.js +24 -0
- package/dist/modules/tasks/index.js.map +1 -0
- package/dist/modules/tasks/scopes.d.ts +18 -0
- package/dist/modules/tasks/scopes.d.ts.map +1 -0
- package/dist/modules/tasks/scopes.js +28 -0
- package/dist/modules/tasks/scopes.js.map +1 -0
- package/dist/modules/tasks/service.d.ts +72 -0
- package/dist/modules/tasks/service.d.ts.map +1 -0
- package/dist/modules/tasks/service.js +319 -0
- package/dist/modules/tasks/service.js.map +1 -0
- package/dist/modules/tasks/types.d.ts +118 -0
- package/dist/modules/tasks/types.d.ts.map +1 -0
- package/dist/modules/tasks/types.js +6 -0
- package/dist/modules/tasks/types.js.map +1 -0
- package/dist/modules/tools/registry.d.ts +28 -0
- package/dist/modules/tools/registry.d.ts.map +1 -0
- package/dist/modules/tools/registry.js +229 -0
- package/dist/modules/tools/registry.js.map +1 -0
- package/dist/modules/tools/scope-registry.d.ts +31 -0
- package/dist/modules/tools/scope-registry.d.ts.map +1 -0
- package/dist/modules/tools/scope-registry.js +52 -0
- package/dist/modules/tools/scope-registry.js.map +1 -0
- package/dist/oauth/client.d.ts +15 -0
- package/dist/oauth/client.d.ts.map +1 -0
- package/dist/oauth/client.js +136 -0
- package/dist/oauth/client.js.map +1 -0
- package/dist/resources/compose-email-template.d.ts +2 -0
- package/dist/resources/compose-email-template.d.ts.map +1 -0
- package/dist/resources/compose-email-template.js +711 -0
- package/dist/resources/compose-email-template.js.map +1 -0
- package/dist/scripts/health-check.d.ts +3 -0
- package/dist/scripts/health-check.d.ts.map +1 -0
- package/dist/scripts/health-check.js +22 -0
- package/dist/scripts/health-check.js.map +1 -0
- package/dist/scripts/setup-environment.d.ts +3 -0
- package/dist/scripts/setup-environment.d.ts.map +1 -0
- package/dist/scripts/setup-environment.js +91 -0
- package/dist/scripts/setup-environment.js.map +1 -0
- package/dist/scripts/setup-google-env.d.ts +3 -0
- package/dist/scripts/setup-google-env.d.ts.map +1 -0
- package/dist/scripts/setup-google-env.js +78 -0
- package/dist/scripts/setup-google-env.js.map +1 -0
- package/dist/services/base/BaseGoogleService.d.ts +52 -0
- package/dist/services/base/BaseGoogleService.d.ts.map +1 -0
- package/dist/services/base/BaseGoogleService.js +155 -0
- package/dist/services/base/BaseGoogleService.js.map +1 -0
- package/dist/services/calendar/index.d.ts +27 -0
- package/dist/services/calendar/index.d.ts.map +1 -0
- package/dist/services/calendar/index.js +146 -0
- package/dist/services/calendar/index.js.map +1 -0
- package/dist/services/contacts/index.d.ts +40 -0
- package/dist/services/contacts/index.d.ts.map +1 -0
- package/dist/services/contacts/index.js +137 -0
- package/dist/services/contacts/index.js.map +1 -0
- package/dist/services/docs/index.d.ts +4 -0
- package/dist/services/docs/index.d.ts.map +1 -0
- package/dist/services/docs/index.js +6 -0
- package/dist/services/docs/index.js.map +1 -0
- package/dist/services/drive/index.d.ts +4 -0
- package/dist/services/drive/index.d.ts.map +1 -0
- package/dist/services/drive/index.js +6 -0
- package/dist/services/drive/index.js.map +1 -0
- package/dist/services/gmail/index.d.ts +39 -0
- package/dist/services/gmail/index.d.ts.map +1 -0
- package/dist/services/gmail/index.js +337 -0
- package/dist/services/gmail/index.js.map +1 -0
- package/dist/services/sheets/index.d.ts +4 -0
- package/dist/services/sheets/index.d.ts.map +1 -0
- package/dist/services/sheets/index.js +6 -0
- package/dist/services/sheets/index.js.map +1 -0
- package/dist/services/slides/index.d.ts +4 -0
- package/dist/services/slides/index.d.ts.map +1 -0
- package/dist/services/slides/index.js +6 -0
- package/dist/services/slides/index.js.map +1 -0
- package/dist/tools/account-handlers.d.ts +28 -0
- package/dist/tools/account-handlers.d.ts.map +1 -0
- package/dist/tools/account-handlers.js +105 -0
- package/dist/tools/account-handlers.js.map +1 -0
- package/dist/tools/arg-aliases.d.ts +6 -0
- package/dist/tools/arg-aliases.d.ts.map +1 -0
- package/dist/tools/arg-aliases.js +22 -0
- package/dist/tools/arg-aliases.js.map +1 -0
- package/dist/tools/calendar-handlers.d.ts +83 -0
- package/dist/tools/calendar-handlers.d.ts.map +1 -0
- package/dist/tools/calendar-handlers.js +658 -0
- package/dist/tools/calendar-handlers.js.map +1 -0
- package/dist/tools/comments-handlers.d.ts +59 -0
- package/dist/tools/comments-handlers.d.ts.map +1 -0
- package/dist/tools/comments-handlers.js +138 -0
- package/dist/tools/comments-handlers.js.map +1 -0
- package/dist/tools/contacts-handlers.d.ts +36 -0
- package/dist/tools/contacts-handlers.d.ts.map +1 -0
- package/dist/tools/contacts-handlers.js +128 -0
- package/dist/tools/contacts-handlers.js.map +1 -0
- package/dist/tools/definitions/account.d.ts +3 -0
- package/dist/tools/definitions/account.d.ts.map +1 -0
- package/dist/tools/definitions/account.js +77 -0
- package/dist/tools/definitions/account.js.map +1 -0
- package/dist/tools/definitions/calendar.d.ts +3 -0
- package/dist/tools/definitions/calendar.d.ts.map +1 -0
- package/dist/tools/definitions/calendar.js +565 -0
- package/dist/tools/definitions/calendar.js.map +1 -0
- package/dist/tools/definitions/comments.d.ts +3 -0
- package/dist/tools/definitions/comments.d.ts.map +1 -0
- package/dist/tools/definitions/comments.js +207 -0
- package/dist/tools/definitions/comments.js.map +1 -0
- package/dist/tools/definitions/contacts.d.ts +3 -0
- package/dist/tools/definitions/contacts.d.ts.map +1 -0
- package/dist/tools/definitions/contacts.js +93 -0
- package/dist/tools/definitions/contacts.js.map +1 -0
- package/dist/tools/definitions/destructive-overrides.json +106 -0
- package/dist/tools/definitions/docs.d.ts +3 -0
- package/dist/tools/definitions/docs.d.ts.map +1 -0
- package/dist/tools/definitions/docs.js +416 -0
- package/dist/tools/definitions/docs.js.map +1 -0
- package/dist/tools/definitions/drive.d.ts +3 -0
- package/dist/tools/definitions/drive.d.ts.map +1 -0
- package/dist/tools/definitions/drive.js +587 -0
- package/dist/tools/definitions/drive.js.map +1 -0
- package/dist/tools/definitions/forms.d.ts +14 -0
- package/dist/tools/definitions/forms.d.ts.map +1 -0
- package/dist/tools/definitions/forms.js +189 -0
- package/dist/tools/definitions/forms.js.map +1 -0
- package/dist/tools/definitions/gmail.d.ts +3 -0
- package/dist/tools/definitions/gmail.d.ts.map +1 -0
- package/dist/tools/definitions/gmail.js +962 -0
- package/dist/tools/definitions/gmail.js.map +1 -0
- package/dist/tools/definitions/index.d.ts +33 -0
- package/dist/tools/definitions/index.d.ts.map +1 -0
- package/dist/tools/definitions/index.js +77 -0
- package/dist/tools/definitions/index.js.map +1 -0
- package/dist/tools/definitions/labels.d.ts +3 -0
- package/dist/tools/definitions/labels.d.ts.map +1 -0
- package/dist/tools/definitions/labels.js +662 -0
- package/dist/tools/definitions/labels.js.map +1 -0
- package/dist/tools/definitions/open-world-overrides.json +106 -0
- package/dist/tools/definitions/sheets.d.ts +3 -0
- package/dist/tools/definitions/sheets.d.ts.map +1 -0
- package/dist/tools/definitions/sheets.js +833 -0
- package/dist/tools/definitions/sheets.js.map +1 -0
- package/dist/tools/definitions/slides.d.ts +3 -0
- package/dist/tools/definitions/slides.d.ts.map +1 -0
- package/dist/tools/definitions/slides.js +383 -0
- package/dist/tools/definitions/slides.js.map +1 -0
- package/dist/tools/definitions/tasks.d.ts +11 -0
- package/dist/tools/definitions/tasks.d.ts.map +1 -0
- package/dist/tools/definitions/tasks.js +259 -0
- package/dist/tools/definitions/tasks.js.map +1 -0
- package/dist/tools/definitions.d.ts +8 -0
- package/dist/tools/definitions.d.ts.map +1 -0
- package/dist/tools/definitions.js +9 -0
- package/dist/tools/definitions.js.map +1 -0
- package/dist/tools/docs-handlers.d.ts +96 -0
- package/dist/tools/docs-handlers.d.ts.map +1 -0
- package/dist/tools/docs-handlers.js +250 -0
- package/dist/tools/docs-handlers.js.map +1 -0
- package/dist/tools/drive-handlers.d.ts +95 -0
- package/dist/tools/drive-handlers.d.ts.map +1 -0
- package/dist/tools/drive-handlers.js +506 -0
- package/dist/tools/drive-handlers.js.map +1 -0
- package/dist/tools/forms-handlers.d.ts +72 -0
- package/dist/tools/forms-handlers.d.ts.map +1 -0
- package/dist/tools/forms-handlers.js +435 -0
- package/dist/tools/forms-handlers.js.map +1 -0
- package/dist/tools/gmail-handlers.d.ts +320 -0
- package/dist/tools/gmail-handlers.d.ts.map +1 -0
- package/dist/tools/gmail-handlers.js +1040 -0
- package/dist/tools/gmail-handlers.js.map +1 -0
- package/dist/tools/param-normalizer.d.ts +2 -0
- package/dist/tools/param-normalizer.d.ts.map +1 -0
- package/dist/tools/param-normalizer.js +96 -0
- package/dist/tools/param-normalizer.js.map +1 -0
- package/dist/tools/server.d.ts +14 -0
- package/dist/tools/server.d.ts.map +1 -0
- package/dist/tools/server.js +733 -0
- package/dist/tools/server.js.map +1 -0
- package/dist/tools/sheets-handlers.d.ts +230 -0
- package/dist/tools/sheets-handlers.d.ts.map +1 -0
- package/dist/tools/sheets-handlers.js +589 -0
- package/dist/tools/sheets-handlers.js.map +1 -0
- package/dist/tools/slides-handlers.d.ts +90 -0
- package/dist/tools/slides-handlers.d.ts.map +1 -0
- package/dist/tools/slides-handlers.js +281 -0
- package/dist/tools/slides-handlers.js.map +1 -0
- package/dist/tools/tasks-handlers.d.ts +85 -0
- package/dist/tools/tasks-handlers.d.ts.map +1 -0
- package/dist/tools/tasks-handlers.js +265 -0
- package/dist/tools/tasks-handlers.js.map +1 -0
- package/dist/tools/type-guards.d.ts +491 -0
- package/dist/tools/type-guards.d.ts.map +1 -0
- package/dist/tools/type-guards.js +1325 -0
- package/dist/tools/type-guards.js.map +1 -0
- package/dist/tools/types.d.ts +298 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/tools/types.js +2 -0
- package/dist/tools/types.js.map +1 -0
- package/dist/types.d.ts +70 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +12 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/atomicCredentialWrite.d.ts +5 -0
- package/dist/utils/atomicCredentialWrite.d.ts.map +1 -0
- package/dist/utils/atomicCredentialWrite.js +120 -0
- package/dist/utils/atomicCredentialWrite.js.map +1 -0
- package/dist/utils/emfileRetry.d.ts +3 -0
- package/dist/utils/emfileRetry.d.ts.map +1 -0
- package/dist/utils/emfileRetry.js +24 -0
- package/dist/utils/emfileRetry.js.map +1 -0
- package/dist/utils/logger.d.ts +8 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +67 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/request-timeout.d.ts +5 -0
- package/dist/utils/request-timeout.d.ts.map +1 -0
- package/dist/utils/request-timeout.js +27 -0
- package/dist/utils/request-timeout.js.map +1 -0
- package/dist/utils/safe-filename.d.ts +2 -0
- package/dist/utils/safe-filename.d.ts.map +1 -0
- package/dist/utils/safe-filename.js +24 -0
- package/dist/utils/safe-filename.js.map +1 -0
- package/dist/utils/scope-hierarchy.d.ts +35 -0
- package/dist/utils/scope-hierarchy.d.ts.map +1 -0
- package/dist/utils/scope-hierarchy.js +123 -0
- package/dist/utils/scope-hierarchy.js.map +1 -0
- package/dist/utils/service-initializer.d.ts +12 -0
- package/dist/utils/service-initializer.d.ts.map +1 -0
- package/dist/utils/service-initializer.js +87 -0
- package/dist/utils/service-initializer.js.map +1 -0
- package/dist/utils/untrusted-content.d.ts +3 -0
- package/dist/utils/untrusted-content.d.ts.map +1 -0
- package/dist/utils/untrusted-content.js +20 -0
- package/dist/utils/untrusted-content.js.map +1 -0
- package/dist/utils/workspace.d.ts +43 -0
- package/dist/utils/workspace.d.ts.map +1 -0
- package/dist/utils/workspace.js +98 -0
- package/dist/utils/workspace.js.map +1 -0
- package/package.json +61 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Functional Source License, Version 1.1, MIT Future License
|
|
2
|
+
|
|
3
|
+
## Abbreviation
|
|
4
|
+
|
|
5
|
+
FSL-1.1-MIT
|
|
6
|
+
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026 Mindstone Learning Limited
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
**Licensor**: Mindstone Learning Limited
|
|
18
|
+
|
|
19
|
+
### The Software
|
|
20
|
+
|
|
21
|
+
The "Software" is each version of the software that we make available under
|
|
22
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
23
|
+
Conditions with the Software.
|
|
24
|
+
|
|
25
|
+
**Software**: Google Workspace MCP Server
|
|
26
|
+
|
|
27
|
+
### License Grant
|
|
28
|
+
|
|
29
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
30
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
31
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
32
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
33
|
+
|
|
34
|
+
### Permitted Purpose
|
|
35
|
+
|
|
36
|
+
A Permitted Purpose is any purpose other than a Competing Use. A "Competing
|
|
37
|
+
Use" means making the Software available to third parties as a commercial
|
|
38
|
+
hosted service that directly competes with any product or service provided by
|
|
39
|
+
the Licensor.
|
|
40
|
+
|
|
41
|
+
### Patents
|
|
42
|
+
|
|
43
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
44
|
+
patents, the license grant above includes a license under our patents. If you
|
|
45
|
+
make a claim against any party that the Software infringes or contributes to
|
|
46
|
+
the infringement of any patent, then your patent license to the Software ends
|
|
47
|
+
immediately.
|
|
48
|
+
|
|
49
|
+
### Redistribution
|
|
50
|
+
|
|
51
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
52
|
+
the Software.
|
|
53
|
+
|
|
54
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
55
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
56
|
+
remove any copyright notices provided in or with the Software.
|
|
57
|
+
|
|
58
|
+
### Disclaimer
|
|
59
|
+
|
|
60
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
61
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
62
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
63
|
+
|
|
64
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
65
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, OF
|
|
66
|
+
ANY CHARACTER INCLUDING DAMAGES FOR LOSS OF GOODWILL, LOST PROFITS, LOST SALES
|
|
67
|
+
OR BUSINESS, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, LOST CONTENT,
|
|
68
|
+
DATA OR DATA USE, BREACH OF DUTY OF GOOD FAITH, OR ANY AND ALL OTHER DAMAGES
|
|
69
|
+
OR LOSSES OF ANY KIND OR NATURE WHATSOEVER (WHETHER DIRECT, INDIRECT, SPECIAL,
|
|
70
|
+
COLLATERAL, INCIDENTAL, CONSEQUENTIAL OR OTHERWISE) ARISING OUT OF OR IN
|
|
71
|
+
CONNECTION WITH THE SOFTWARE OR THIS LICENSE, EVEN IF SUCH PARTY SHALL HAVE
|
|
72
|
+
BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
73
|
+
|
|
74
|
+
### Trademark
|
|
75
|
+
|
|
76
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
77
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
78
|
+
trademarks, trade names, service marks or product names.
|
|
79
|
+
|
|
80
|
+
## Change Date
|
|
81
|
+
|
|
82
|
+
Four years from the date the Software is made available under these Terms and
|
|
83
|
+
Conditions: **2030-04-08**
|
|
84
|
+
|
|
85
|
+
## Change License
|
|
86
|
+
|
|
87
|
+
MIT License
|
|
88
|
+
|
|
89
|
+
## License Details
|
|
90
|
+
|
|
91
|
+
| Parameter | Value |
|
|
92
|
+
|---|---|
|
|
93
|
+
| Licensor | Mindstone Learning Limited |
|
|
94
|
+
| Software | Google Workspace MCP Server |
|
|
95
|
+
| Use Limitation | Competing Use |
|
|
96
|
+
| Change Date | 2030-04-08 |
|
|
97
|
+
| Change License | MIT |
|
package/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Google Workspace MCP Server
|
|
2
|
+
|
|
3
|
+
Google Workspace MCP server for Gmail, Calendar, Drive, Docs, Sheets, Slides, Contacts, Comments, and account diagnostics. Google Tasks and Forms tools are available when `ENABLE_GOOGLE_TASKS_FORMS=true`.
|
|
4
|
+
|
|
5
|
+
Originally based on [aaronsb/google-workspace-mcp](https://github.com/aaronsb/google-workspace-mcp).
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx -y @mindstone/mcp-server-google-workspace
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Configuration
|
|
14
|
+
|
|
15
|
+
This connector uses host-orchestrated Google OAuth. The MCP host owns the browser redirect and writes `accounts.json` plus per-account token files for the connector to read.
|
|
16
|
+
|
|
17
|
+
Required environment variables:
|
|
18
|
+
|
|
19
|
+
| Variable | Description |
|
|
20
|
+
| --- | --- |
|
|
21
|
+
| `GOOGLE_CLIENT_ID` | Google OAuth client ID |
|
|
22
|
+
| `GOOGLE_CLIENT_SECRET` | Google OAuth client secret |
|
|
23
|
+
| `ACCOUNTS_PATH` | Path to `accounts.json` |
|
|
24
|
+
| `CREDENTIALS_PATH` | Directory containing per-account token files |
|
|
25
|
+
|
|
26
|
+
Optional environment variables:
|
|
27
|
+
|
|
28
|
+
| Variable | Default | Description |
|
|
29
|
+
| --- | --- | --- |
|
|
30
|
+
| `ENABLE_GOOGLE_TASKS_FORMS` | `false` | Set to `true` to register Google Tasks and Forms tools |
|
|
31
|
+
| `GOOGLE_WORKSPACE_REQUEST_TIMEOUT_MS` | `60000` | Google API request timeout in milliseconds, max 300000 |
|
|
32
|
+
|
|
33
|
+
`GOOGLE_WORKSPACE_DISABLE_REFRESH=1` may be injected by a host to make the connector return `auth_required` instead of refreshing tokens. It is intentionally not a user-facing setup variable.
|
|
34
|
+
|
|
35
|
+
The OSS package does not read `REBEL_WORKSPACE_PATH`. Local attachment staging uses the connector's own workspace helpers and host-provided paths.
|
|
36
|
+
|
|
37
|
+
## OAuth setup flow
|
|
38
|
+
|
|
39
|
+
`authenticate_workspace_account` returns a structured `auth_required` response:
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"status": "auth_required",
|
|
44
|
+
"user_action": { "id": "google.connect_account" },
|
|
45
|
+
"agent_action": {
|
|
46
|
+
"instruction": "Connect Google Workspace to continue. The user will be redirected to Google's sign-in."
|
|
47
|
+
},
|
|
48
|
+
"setupToolName": "authenticate_workspace_account"
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The connector does not run a callback server and does not generate OAuth URLs. The MCP host computes the Google OAuth URL and handles the callback.
|
|
53
|
+
|
|
54
|
+
## Available tools
|
|
55
|
+
|
|
56
|
+
- Gmail: email search/thread/send/compose, drafts, labels, label filters, attachments, archive/trash/read-state helpers.
|
|
57
|
+
- Calendar: current time, free-slot lookup, calendar/event listing, event creation, updates, responses, and deletion.
|
|
58
|
+
- Drive: list/search/upload/download/copy/move/trash/untrash files, folders, permissions, and revisions.
|
|
59
|
+
- Docs: read, create, append, replace, find/replace, tab listing, and batch updates.
|
|
60
|
+
- Sheets: read/write ranges, create spreadsheets, sheet management, batch operations, find/replace, and formatting.
|
|
61
|
+
- Slides: read, create, list/get slides, batch update, thumbnails, and ID extraction.
|
|
62
|
+
- Contacts: list and search contacts.
|
|
63
|
+
- Comments: list/create/reply/resolve/delete Drive comments.
|
|
64
|
+
- Account: list, authenticate, and remove workspace accounts.
|
|
65
|
+
- Tasks and Forms: registered only when `ENABLE_GOOGLE_TASKS_FORMS=true`.
|
|
66
|
+
|
|
67
|
+
## Security notes
|
|
68
|
+
|
|
69
|
+
- Token and account writes use temp-file plus rename, restrictive permissions, fsync, and symlink rejection.
|
|
70
|
+
- Token refresh can be disabled by the host so a single authority owns refresh-token rotation.
|
|
71
|
+
- User-recoverable failures return host-neutral recovery guidance with `action_required` and `next_step` fields.
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Reporting a Vulnerability
|
|
4
|
+
|
|
5
|
+
If you discover a security vulnerability in any of our MCP connectors, please report it responsibly. **Do not open a public GitHub issue for security vulnerabilities.**
|
|
6
|
+
|
|
7
|
+
### How to Report
|
|
8
|
+
|
|
9
|
+
Email **security@mindstone.com** with the following information:
|
|
10
|
+
|
|
11
|
+
- **Affected connector(s):** Which connector(s) are impacted (e.g. `mcp-server-quickbooks`)
|
|
12
|
+
- **Description:** A clear description of the vulnerability
|
|
13
|
+
- **Reproduction steps:** Step-by-step instructions to reproduce the issue
|
|
14
|
+
- **Impact assessment:** What an attacker could achieve by exploiting this vulnerability
|
|
15
|
+
- **Suggested fix (optional):** If you have a recommendation for how to address the issue
|
|
16
|
+
|
|
17
|
+
### What to Expect
|
|
18
|
+
|
|
19
|
+
- **Acknowledgement:** We will acknowledge receipt of your report within **2 business days**.
|
|
20
|
+
- **Assessment:** We will investigate and provide an initial assessment within **5 business days**.
|
|
21
|
+
- **Resolution:** We aim to release a fix within **30 days** of confirming the vulnerability, depending on complexity.
|
|
22
|
+
- **Disclosure:** We will coordinate with you on public disclosure timing after a fix is available.
|
|
23
|
+
|
|
24
|
+
### Scope
|
|
25
|
+
|
|
26
|
+
This policy covers all connectors in this repository:
|
|
27
|
+
|
|
28
|
+
- All MCP server connectors under `connectors/`
|
|
29
|
+
- Shared utilities and templates under `connectors/_template/`
|
|
30
|
+
|
|
31
|
+
### Out of Scope
|
|
32
|
+
|
|
33
|
+
- Vulnerabilities in third-party APIs that our connectors integrate with (e.g. Zendesk, Freshdesk, Workday)
|
|
34
|
+
- Issues in the Model Context Protocol SDK itself — please report those to the [MCP SDK repository](https://github.com/modelcontextprotocol/sdk)
|
|
35
|
+
|
|
36
|
+
## Supported Versions
|
|
37
|
+
|
|
38
|
+
We provide security updates for the latest published version of each connector. We recommend always using the most recent version.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export declare const mockAccounts: {
|
|
2
|
+
accounts: {
|
|
3
|
+
email: string;
|
|
4
|
+
category: string;
|
|
5
|
+
description: string;
|
|
6
|
+
}[];
|
|
7
|
+
};
|
|
8
|
+
export declare const mockTokens: {
|
|
9
|
+
valid: {
|
|
10
|
+
access_token: string;
|
|
11
|
+
refresh_token: string;
|
|
12
|
+
expiry_date: number;
|
|
13
|
+
};
|
|
14
|
+
expired: {
|
|
15
|
+
access_token: string;
|
|
16
|
+
refresh_token: string;
|
|
17
|
+
expiry_date: number;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare const mockGmailResponses: {
|
|
21
|
+
messageList: {
|
|
22
|
+
messages: {
|
|
23
|
+
id: string;
|
|
24
|
+
threadId: string;
|
|
25
|
+
}[];
|
|
26
|
+
resultSizeEstimate: number;
|
|
27
|
+
};
|
|
28
|
+
message: {
|
|
29
|
+
id: string;
|
|
30
|
+
threadId: string;
|
|
31
|
+
labelIds: string[];
|
|
32
|
+
snippet: string;
|
|
33
|
+
payload: {
|
|
34
|
+
headers: {
|
|
35
|
+
name: string;
|
|
36
|
+
value: string;
|
|
37
|
+
}[];
|
|
38
|
+
parts: {
|
|
39
|
+
mimeType: string;
|
|
40
|
+
body: {
|
|
41
|
+
data: string;
|
|
42
|
+
};
|
|
43
|
+
}[];
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=accounts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/__fixtures__/accounts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY;;;;;;CAaxB,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;;;;;;CAWtB,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;CA4B9B,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export const mockAccounts = {
|
|
2
|
+
accounts: [
|
|
3
|
+
{
|
|
4
|
+
email: 'test@example.com',
|
|
5
|
+
category: 'work',
|
|
6
|
+
description: 'Test Work Account'
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
email: 'test2@example.com',
|
|
10
|
+
category: 'personal',
|
|
11
|
+
description: 'Test Personal Account'
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
};
|
|
15
|
+
export const mockTokens = {
|
|
16
|
+
valid: {
|
|
17
|
+
access_token: 'valid-token',
|
|
18
|
+
refresh_token: 'refresh-token',
|
|
19
|
+
expiry_date: Date.now() + 3600000
|
|
20
|
+
},
|
|
21
|
+
expired: {
|
|
22
|
+
access_token: 'expired-token',
|
|
23
|
+
refresh_token: 'refresh-token',
|
|
24
|
+
expiry_date: Date.now() - 3600000
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
export const mockGmailResponses = {
|
|
28
|
+
messageList: {
|
|
29
|
+
messages: [
|
|
30
|
+
{ id: 'msg1', threadId: 'thread1' },
|
|
31
|
+
{ id: 'msg2', threadId: 'thread2' }
|
|
32
|
+
],
|
|
33
|
+
resultSizeEstimate: 2
|
|
34
|
+
},
|
|
35
|
+
message: {
|
|
36
|
+
id: 'msg1',
|
|
37
|
+
threadId: 'thread1',
|
|
38
|
+
labelIds: ['INBOX'],
|
|
39
|
+
snippet: 'Email snippet',
|
|
40
|
+
payload: {
|
|
41
|
+
headers: [
|
|
42
|
+
{ name: 'From', value: 'sender@example.com' },
|
|
43
|
+
{ name: 'Subject', value: 'Test Subject' },
|
|
44
|
+
{ name: 'To', value: 'recipient@example.com' },
|
|
45
|
+
{ name: 'Date', value: '2024-01-01T00:00:00Z' }
|
|
46
|
+
],
|
|
47
|
+
parts: [
|
|
48
|
+
{
|
|
49
|
+
mimeType: 'text/plain',
|
|
50
|
+
body: { data: Buffer.from('Test content').toString('base64') }
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=accounts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../src/__fixtures__/accounts.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,QAAQ,EAAE;QACR;YACE,KAAK,EAAE,kBAAkB;YACzB,QAAQ,EAAE,MAAM;YAChB,WAAW,EAAE,mBAAmB;SACjC;QACD;YACE,KAAK,EAAE,mBAAmB;YAC1B,QAAQ,EAAE,UAAU;YACpB,WAAW,EAAE,uBAAuB;SACrC;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,KAAK,EAAE;QACL,YAAY,EAAE,aAAa;QAC3B,aAAa,EAAE,eAAe;QAC9B,WAAW,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO;KAClC;IACD,OAAO,EAAE;QACP,YAAY,EAAE,eAAe;QAC7B,aAAa,EAAE,eAAe;QAC9B,WAAW,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO;KAClC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,WAAW,EAAE;QACX,QAAQ,EAAE;YACR,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE;YACnC,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE;SACpC;QACD,kBAAkB,EAAE,CAAC;KACtB;IACD,OAAO,EAAE;QACP,EAAE,EAAE,MAAM;QACV,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,CAAC,OAAO,CAAC;QACnB,OAAO,EAAE,eAAe;QACxB,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,oBAAoB,EAAE;gBAC7C,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,EAAE;gBAC1C,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,uBAAuB,EAAE;gBAC9C,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,sBAAsB,EAAE;aAChD;YACD,KAAK,EAAE;gBACL;oBACE,QAAQ,EAAE,YAAY;oBACtB,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;iBAC/D;aACF;SACF;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { GoogleApiRequestParams, GoogleApiResponse } from '../types.js';
|
|
2
|
+
import { GoogleApiRequest } from './request.js';
|
|
3
|
+
import { AttachmentIndexService } from '../modules/attachments/index-service.js';
|
|
4
|
+
export declare class RequestHandler {
|
|
5
|
+
private apiRequest;
|
|
6
|
+
private endpointValidator;
|
|
7
|
+
private parameterValidator;
|
|
8
|
+
private attachmentTransformer;
|
|
9
|
+
constructor(apiRequest: GoogleApiRequest, attachmentIndexService?: AttachmentIndexService);
|
|
10
|
+
handleRequest(params: GoogleApiRequestParams, token: string): Promise<GoogleApiResponse>;
|
|
11
|
+
private validateRequest;
|
|
12
|
+
private executeRequest;
|
|
13
|
+
private formatSuccessResponse;
|
|
14
|
+
private formatErrorResponse;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/api/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAkB,MAAM,aAAa,CAAC;AACxF,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIhD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAEjF,qBAAa,cAAc;IAMvB,OAAO,CAAC,UAAU;IALpB,OAAO,CAAC,iBAAiB,CAAoB;IAC7C,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,qBAAqB,CAAgC;gBAGnD,UAAU,EAAE,gBAAgB,EACpC,sBAAsB,GAAE,sBAA6D;IAOjF,aAAa,CAAC,MAAM,EAAE,sBAAsB,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;YAehF,eAAe;YAQf,cAAc;IAS5B,OAAO,CAAC,qBAAqB;IAU7B,OAAO,CAAC,mBAAmB;CAgB5B"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { GoogleApiError } from '../types.js';
|
|
2
|
+
import { EndpointValidator } from './validators/endpoint.js';
|
|
3
|
+
import { ParameterValidator } from './validators/parameter.js';
|
|
4
|
+
import { AttachmentResponseTransformer } from '../modules/attachments/response-transformer.js';
|
|
5
|
+
import { AttachmentIndexService } from '../modules/attachments/index-service.js';
|
|
6
|
+
export class RequestHandler {
|
|
7
|
+
apiRequest;
|
|
8
|
+
endpointValidator;
|
|
9
|
+
parameterValidator;
|
|
10
|
+
attachmentTransformer;
|
|
11
|
+
constructor(apiRequest, attachmentIndexService = AttachmentIndexService.getInstance()) {
|
|
12
|
+
this.apiRequest = apiRequest;
|
|
13
|
+
this.endpointValidator = new EndpointValidator();
|
|
14
|
+
this.parameterValidator = new ParameterValidator();
|
|
15
|
+
this.attachmentTransformer = new AttachmentResponseTransformer(attachmentIndexService);
|
|
16
|
+
}
|
|
17
|
+
async handleRequest(params, token) {
|
|
18
|
+
try {
|
|
19
|
+
// Step 1: Basic validation
|
|
20
|
+
await this.validateRequest(params);
|
|
21
|
+
// Step 2: Execute request
|
|
22
|
+
const result = await this.executeRequest(params, token);
|
|
23
|
+
// Step 3: Format response
|
|
24
|
+
return this.formatSuccessResponse(result);
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
return this.formatErrorResponse(error);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
async validateRequest(params) {
|
|
31
|
+
// Validate endpoint format and availability
|
|
32
|
+
await this.endpointValidator.validate(params.api_endpoint);
|
|
33
|
+
// Validate required parameters
|
|
34
|
+
await this.parameterValidator.validate(params);
|
|
35
|
+
}
|
|
36
|
+
async executeRequest(params, token) {
|
|
37
|
+
return this.apiRequest.makeRequest({
|
|
38
|
+
endpoint: params.api_endpoint,
|
|
39
|
+
method: params.method,
|
|
40
|
+
params: params.params,
|
|
41
|
+
token
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
formatSuccessResponse(data) {
|
|
45
|
+
// Transform response to simplify attachments for AI
|
|
46
|
+
const transformedData = this.attachmentTransformer.transformResponse(data);
|
|
47
|
+
return {
|
|
48
|
+
status: 'success',
|
|
49
|
+
data: transformedData
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
formatErrorResponse(error) {
|
|
53
|
+
if (error instanceof GoogleApiError) {
|
|
54
|
+
return {
|
|
55
|
+
status: 'error',
|
|
56
|
+
error: error.message,
|
|
57
|
+
resolution: error.resolution
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
// Handle unexpected errors
|
|
61
|
+
return {
|
|
62
|
+
status: 'error',
|
|
63
|
+
error: error instanceof Error ? error.message : 'Unknown error occurred',
|
|
64
|
+
resolution: 'Please try again or contact support if the issue persists'
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../src/api/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6C,cAAc,EAAE,MAAM,aAAa,CAAC;AAExF,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,6BAA6B,EAAE,MAAM,gDAAgD,CAAC;AAC/F,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAEjF,MAAM,OAAO,cAAc;IAMf;IALF,iBAAiB,CAAoB;IACrC,kBAAkB,CAAqB;IACvC,qBAAqB,CAAgC;IAE7D,YACU,UAA4B,EACpC,yBAAiD,sBAAsB,CAAC,WAAW,EAAE;QAD7E,eAAU,GAAV,UAAU,CAAkB;QAGpC,IAAI,CAAC,iBAAiB,GAAG,IAAI,iBAAiB,EAAE,CAAC;QACjD,IAAI,CAAC,kBAAkB,GAAG,IAAI,kBAAkB,EAAE,CAAC;QACnD,IAAI,CAAC,qBAAqB,GAAG,IAAI,6BAA6B,CAAC,sBAAsB,CAAC,CAAC;IACzF,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,MAA8B,EAAE,KAAa;QAC/D,IAAI,CAAC;YACH,2BAA2B;YAC3B,MAAM,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;YAEnC,0BAA0B;YAC1B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;YAExD,0BAA0B;YAC1B,OAAO,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;QAC5C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,eAAe,CAAC,MAA8B;QAC1D,4CAA4C;QAC5C,MAAM,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QAE3D,+BAA+B;QAC/B,MAAM,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjD,CAAC;IAEO,KAAK,CAAC,cAAc,CAAC,MAA8B,EAAE,KAAa;QACxE,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;YACjC,QAAQ,EAAE,MAAM,CAAC,YAAY;YAC7B,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,KAAK;SACN,CAAC,CAAC;IACL,CAAC;IAEO,qBAAqB,CAAC,IAAS;QACrC,oDAAoD;QACpD,MAAM,eAAe,GAAG,IAAI,CAAC,qBAAqB,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAE3E,OAAO;YACL,MAAM,EAAE,SAAS;YACjB,IAAI,EAAE,eAAe;SACtB,CAAC;IACJ,CAAC;IAEO,mBAAmB,CAAC,KAAc;QACxC,IAAI,KAAK,YAAY,cAAc,EAAE,CAAC;YACpC,OAAO;gBACL,MAAM,EAAE,OAAO;gBACf,KAAK,EAAE,KAAK,CAAC,OAAO;gBACpB,UAAU,EAAE,KAAK,CAAC,UAAU;aAC7B,CAAC;QACJ,CAAC;QAED,2BAA2B;QAC3B,OAAO;YACL,MAAM,EAAE,OAAO;YACf,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,wBAAwB;YACxE,UAAU,EAAE,2DAA2D;SACxE,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { OAuth2Client } from 'google-auth-library';
|
|
2
|
+
import { ApiRequestParams } from '../types.js';
|
|
3
|
+
export declare class GoogleApiRequest {
|
|
4
|
+
private authClient;
|
|
5
|
+
private readonly serviceVersions;
|
|
6
|
+
constructor(authClient: OAuth2Client);
|
|
7
|
+
makeRequest({ endpoint, method, params, token }: ApiRequestParams): Promise<any>;
|
|
8
|
+
private getGoogleService;
|
|
9
|
+
private getApiMethod;
|
|
10
|
+
private handleApiError;
|
|
11
|
+
private getErrorInfo;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/api/request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAkB,MAAM,aAAa,CAAC;AAM/D,qBAAa,gBAAgB;IAQf,OAAO,CAAC,UAAU;IAP9B,OAAO,CAAC,QAAQ,CAAC,eAAe,CAK9B;gBAEkB,UAAU,EAAE,YAAY;IAEtC,WAAW,CAAC,EAChB,QAAQ,EACR,MAAM,EACN,MAAW,EACX,KAAK,EACN,EAAE,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC;YA6BpB,gBAAgB;IAsB9B,OAAO,CAAC,YAAY;IAcpB,OAAO,CAAC,cAAc;IAwBtB,OAAO,CAAC,YAAY;CA2CrB"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { google } from 'googleapis';
|
|
2
|
+
import { GoogleApiError } from '../types.js';
|
|
3
|
+
export class GoogleApiRequest {
|
|
4
|
+
authClient;
|
|
5
|
+
serviceVersions = {
|
|
6
|
+
gmail: 'v1',
|
|
7
|
+
drive: 'v3',
|
|
8
|
+
sheets: 'v4',
|
|
9
|
+
calendar: 'v3'
|
|
10
|
+
};
|
|
11
|
+
constructor(authClient) {
|
|
12
|
+
this.authClient = authClient;
|
|
13
|
+
}
|
|
14
|
+
async makeRequest({ endpoint, method, params = {}, token }) {
|
|
15
|
+
try {
|
|
16
|
+
// Set up authentication
|
|
17
|
+
this.authClient.setCredentials({
|
|
18
|
+
access_token: token
|
|
19
|
+
});
|
|
20
|
+
// Parse the endpoint to get service and method
|
|
21
|
+
const [service, ...methodParts] = endpoint.split('.');
|
|
22
|
+
const methodName = methodParts.join('.');
|
|
23
|
+
// Get the Google API service
|
|
24
|
+
const googleService = await this.getGoogleService(service);
|
|
25
|
+
// Navigate to the method in the service
|
|
26
|
+
const apiMethod = this.getApiMethod(googleService, methodName);
|
|
27
|
+
// Make the API request with proper context binding
|
|
28
|
+
const response = await apiMethod.call(googleService, {
|
|
29
|
+
...params,
|
|
30
|
+
auth: this.authClient
|
|
31
|
+
});
|
|
32
|
+
return response.data;
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
throw this.handleApiError(error);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
async getGoogleService(service) {
|
|
39
|
+
const version = this.serviceVersions[service];
|
|
40
|
+
if (!version) {
|
|
41
|
+
throw new GoogleApiError(`Service "${service}" is not supported`, 'SERVICE_NOT_SUPPORTED', `Supported services are: ${Object.keys(this.serviceVersions).join(', ')}`);
|
|
42
|
+
}
|
|
43
|
+
const serviceConstructor = google[service];
|
|
44
|
+
if (!serviceConstructor) {
|
|
45
|
+
throw new GoogleApiError(`Failed to initialize ${service} service`, 'SERVICE_INIT_FAILED', 'Please check the service name and try again');
|
|
46
|
+
}
|
|
47
|
+
return serviceConstructor({ version, auth: this.authClient });
|
|
48
|
+
}
|
|
49
|
+
getApiMethod(service, methodPath) {
|
|
50
|
+
const method = methodPath.split('.').reduce((obj, part) => obj?.[part], service);
|
|
51
|
+
if (typeof method !== 'function') {
|
|
52
|
+
throw new GoogleApiError(`Method "${methodPath}" not found`, 'METHOD_NOT_FOUND', 'Please check the method name and try again');
|
|
53
|
+
}
|
|
54
|
+
return method;
|
|
55
|
+
}
|
|
56
|
+
handleApiError(error) {
|
|
57
|
+
if (error instanceof GoogleApiError) {
|
|
58
|
+
throw error;
|
|
59
|
+
}
|
|
60
|
+
// Handle Google API specific errors
|
|
61
|
+
if (error.response) {
|
|
62
|
+
const { status, data } = error.response;
|
|
63
|
+
const errorInfo = this.getErrorInfo(status, data);
|
|
64
|
+
throw new GoogleApiError(errorInfo.message, errorInfo.code, errorInfo.resolution);
|
|
65
|
+
}
|
|
66
|
+
// Handle network or other errors
|
|
67
|
+
throw new GoogleApiError(error.message || 'Unknown error occurred', 'API_REQUEST_ERROR', 'Check your network connection and try again');
|
|
68
|
+
}
|
|
69
|
+
getErrorInfo(status, data) {
|
|
70
|
+
const errorMap = {
|
|
71
|
+
400: {
|
|
72
|
+
code: 'BAD_REQUEST',
|
|
73
|
+
resolution: 'Check the request parameters and try again'
|
|
74
|
+
},
|
|
75
|
+
401: {
|
|
76
|
+
code: 'UNAUTHORIZED',
|
|
77
|
+
resolution: 'Token may be expired. Try refreshing the token'
|
|
78
|
+
},
|
|
79
|
+
403: {
|
|
80
|
+
code: 'FORBIDDEN',
|
|
81
|
+
resolution: 'Insufficient permissions. Check required scopes'
|
|
82
|
+
},
|
|
83
|
+
404: {
|
|
84
|
+
code: 'NOT_FOUND',
|
|
85
|
+
resolution: 'Resource not found. Verify the endpoint and parameters'
|
|
86
|
+
},
|
|
87
|
+
429: {
|
|
88
|
+
code: 'RATE_LIMIT',
|
|
89
|
+
resolution: 'Rate limit exceeded. Try again later'
|
|
90
|
+
},
|
|
91
|
+
500: {
|
|
92
|
+
code: 'SERVER_ERROR',
|
|
93
|
+
resolution: 'Internal server error. Please try again later'
|
|
94
|
+
},
|
|
95
|
+
503: {
|
|
96
|
+
code: 'SERVICE_UNAVAILABLE',
|
|
97
|
+
resolution: 'Service is temporarily unavailable. Please try again later'
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
const errorInfo = errorMap[status] || {
|
|
101
|
+
code: `API_ERROR_${status}`,
|
|
102
|
+
resolution: 'Check the API documentation for more details'
|
|
103
|
+
};
|
|
104
|
+
return {
|
|
105
|
+
message: data.error?.message || 'API request failed',
|
|
106
|
+
code: errorInfo.code,
|
|
107
|
+
resolution: errorInfo.resolution
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../src/api/request.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare class EndpointValidator {
|
|
2
|
+
private readonly serviceRegistry;
|
|
3
|
+
validate(endpoint: string): Promise<void>;
|
|
4
|
+
getRequiredScopes(endpoint: string): string[];
|
|
5
|
+
getSupportedServices(): string[];
|
|
6
|
+
getSupportedMethods(service: string): string[];
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=endpoint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoint.d.ts","sourceRoot":"","sources":["../../../src/api/validators/endpoint.ts"],"names":[],"mappings":"AAQA,qBAAa,iBAAiB;IAE5B,OAAO,CAAC,QAAQ,CAAC,eAAe,CAgF9B;IAEI,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAyB/C,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE;IAY7C,oBAAoB,IAAI,MAAM,EAAE;IAIhC,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE;CAG/C"}
|