@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
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contacts module entry point.
|
|
3
|
+
* Exports types, services, and initialization functions for the contacts module.
|
|
4
|
+
*/
|
|
5
|
+
// Export types
|
|
6
|
+
export * from './types.js';
|
|
7
|
+
// Export scopes
|
|
8
|
+
export { CONTACTS_SCOPES } from './scopes.js';
|
|
9
|
+
/**
|
|
10
|
+
* Initialize the contacts module.
|
|
11
|
+
* This function is called during server startup to set up any required resources.
|
|
12
|
+
*/
|
|
13
|
+
export async function initializeContactsModule() {
|
|
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 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/contacts/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAe;AACf,cAAc,YAAY,CAAC;AAE3B,gBAAgB;AAChB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB;IAC5C,2CAA2C;IAC3C,iEAAiE;IACjE,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scopes.d.ts","sourceRoot":"","sources":["../../../src/modules/contacts/scopes.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe;;CAI3B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { scopeRegistry } from "../../modules/tools/scope-registry.js";
|
|
2
|
+
// Define Contacts scopes as constants
|
|
3
|
+
// Reference: https://developers.google.com/people/api/rest/v1/people.connections/list (and other People API docs)
|
|
4
|
+
export const CONTACTS_SCOPES = {
|
|
5
|
+
READONLY: "https://www.googleapis.com/auth/contacts.readonly",
|
|
6
|
+
// Add other scopes like write/modify later if needed
|
|
7
|
+
// CONTACTS: 'https://www.googleapis.com/auth/contacts'
|
|
8
|
+
};
|
|
9
|
+
// Register the contacts scopes with the scope registry
|
|
10
|
+
scopeRegistry.registerScope("contacts", CONTACTS_SCOPES.READONLY);
|
|
11
|
+
//# sourceMappingURL=scopes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scopes.js","sourceRoot":"","sources":["../../../src/modules/contacts/scopes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAEtE,sCAAsC;AACtC,kHAAkH;AAClH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,QAAQ,EAAE,mDAAmD;IAC7D,qDAAqD;IACrD,uDAAuD;CACxD,CAAC;AAEF,uDAAuD;AACvD,aAAa,CAAC,aAAa,CAAC,UAAU,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parameters for retrieving contacts.
|
|
3
|
+
*/
|
|
4
|
+
export interface GetContactsParams {
|
|
5
|
+
email: string;
|
|
6
|
+
pageSize?: number;
|
|
7
|
+
pageToken?: string;
|
|
8
|
+
personFields: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Response structure for getting contacts.
|
|
12
|
+
*/
|
|
13
|
+
export interface GetContactsResponse {
|
|
14
|
+
connections: Contact[];
|
|
15
|
+
nextPageToken?: string;
|
|
16
|
+
totalPeople?: number;
|
|
17
|
+
totalItems?: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Represents a Google Contact (Person).
|
|
21
|
+
* Based on People API Person resource.
|
|
22
|
+
* Reference: https://developers.google.com/people/api/rest/v1/people#Person
|
|
23
|
+
*/
|
|
24
|
+
export interface Contact {
|
|
25
|
+
resourceName: string;
|
|
26
|
+
etag?: string;
|
|
27
|
+
names?: Name[];
|
|
28
|
+
emailAddresses?: EmailAddress[];
|
|
29
|
+
phoneNumbers?: PhoneNumber[];
|
|
30
|
+
}
|
|
31
|
+
export interface Name {
|
|
32
|
+
displayName?: string;
|
|
33
|
+
familyName?: string;
|
|
34
|
+
givenName?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface EmailAddress {
|
|
37
|
+
value?: string;
|
|
38
|
+
type?: string;
|
|
39
|
+
formattedType?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface PhoneNumber {
|
|
42
|
+
value?: string;
|
|
43
|
+
canonicalForm?: string;
|
|
44
|
+
type?: string;
|
|
45
|
+
formattedType?: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Base error class for Contacts service.
|
|
49
|
+
*/
|
|
50
|
+
export declare class ContactsError extends Error {
|
|
51
|
+
code: string;
|
|
52
|
+
details?: string;
|
|
53
|
+
constructor(message: string, code: string, details?: string);
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/modules/contacts/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,OAAO,EAAE,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,OAAO;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,cAAc,CAAC,EAAE,YAAY,EAAE,CAAC;IAChC,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;CAE9B;AAID,MAAM,WAAW,IAAI;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CAEpB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;CAExB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;CAExB;AAED;;GAEG;AACH,qBAAa,aAAc,SAAQ,KAAK;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;gBAEL,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;CAM5D"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base error class for Contacts service.
|
|
3
|
+
*/
|
|
4
|
+
export class ContactsError extends Error {
|
|
5
|
+
code;
|
|
6
|
+
details;
|
|
7
|
+
constructor(message, code, details) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.name = "ContactsError";
|
|
10
|
+
this.code = code;
|
|
11
|
+
this.details = details;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/modules/contacts/types.ts"],"names":[],"mappings":"AA2DA;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK;IACtC,IAAI,CAAS;IACb,OAAO,CAAU;IAEjB,YAAY,OAAe,EAAE,IAAY,EAAE,OAAgB;QACzD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Construct a Google Docs URL from document ID
|
|
3
|
+
*/
|
|
4
|
+
export declare function constructDocumentUrl(documentId: string): string;
|
|
5
|
+
/**
|
|
6
|
+
* Extract document ID from various Google Docs URL formats.
|
|
7
|
+
* Supports:
|
|
8
|
+
* - https://docs.google.com/document/d/{id}/edit
|
|
9
|
+
* - https://docs.google.com/document/d/{id}/edit?...
|
|
10
|
+
* - https://docs.google.com/document/d/{id}
|
|
11
|
+
* - docs.google.com/document/d/{id}/...
|
|
12
|
+
* - Just the document ID itself
|
|
13
|
+
*/
|
|
14
|
+
export declare function extractDocumentIdFromUrl(input: string): string | null;
|
|
15
|
+
/**
|
|
16
|
+
* Format document metadata as human-readable text
|
|
17
|
+
*/
|
|
18
|
+
export declare function formatDocumentHeader(title: string, documentId: string, options?: {
|
|
19
|
+
truncated?: boolean;
|
|
20
|
+
wordCount?: number;
|
|
21
|
+
revisionId?: string;
|
|
22
|
+
}): string;
|
|
23
|
+
/**
|
|
24
|
+
* Format a document read result as human-readable text
|
|
25
|
+
*/
|
|
26
|
+
export declare function formatDocumentAsText(title: string, documentId: string, content: string, options?: {
|
|
27
|
+
truncated?: boolean;
|
|
28
|
+
includeHeader?: boolean;
|
|
29
|
+
}): string;
|
|
30
|
+
//# sourceMappingURL=formatters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../../src/modules/docs/formatters.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA8BrE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE;IACR,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GACA,MAAM,CAiBR;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;IACR,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,GACA,MAAM,CAUR"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utilities for formatting Google Docs content and parsing URLs.
|
|
3
|
+
*/
|
|
4
|
+
import { wrapUntrustedContent } from '../../utils/untrusted-content.js';
|
|
5
|
+
/**
|
|
6
|
+
* Construct a Google Docs URL from document ID
|
|
7
|
+
*/
|
|
8
|
+
export function constructDocumentUrl(documentId) {
|
|
9
|
+
return `https://docs.google.com/document/d/${documentId}/edit`;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Extract document ID from various Google Docs URL formats.
|
|
13
|
+
* Supports:
|
|
14
|
+
* - https://docs.google.com/document/d/{id}/edit
|
|
15
|
+
* - https://docs.google.com/document/d/{id}/edit?...
|
|
16
|
+
* - https://docs.google.com/document/d/{id}
|
|
17
|
+
* - docs.google.com/document/d/{id}/...
|
|
18
|
+
* - Just the document ID itself
|
|
19
|
+
*/
|
|
20
|
+
export function extractDocumentIdFromUrl(input) {
|
|
21
|
+
if (!input || typeof input !== 'string') {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
const trimmed = input.trim();
|
|
25
|
+
// If it looks like just an ID (alphanumeric with hyphens/underscores, ~44 chars)
|
|
26
|
+
if (/^[a-zA-Z0-9_-]{20,60}$/.test(trimmed)) {
|
|
27
|
+
return trimmed;
|
|
28
|
+
}
|
|
29
|
+
// Try to extract from URL patterns
|
|
30
|
+
const patterns = [
|
|
31
|
+
// Standard Google Docs URL
|
|
32
|
+
/docs\.google\.com\/document\/d\/([a-zA-Z0-9_-]+)/,
|
|
33
|
+
// With open instead of edit
|
|
34
|
+
/docs\.google\.com\/document\/d\/([a-zA-Z0-9_-]+)\/open/,
|
|
35
|
+
// URL-encoded
|
|
36
|
+
/docs\.google\.com%2Fdocument%2Fd%2F([a-zA-Z0-9_-]+)/,
|
|
37
|
+
];
|
|
38
|
+
for (const pattern of patterns) {
|
|
39
|
+
const match = trimmed.match(pattern);
|
|
40
|
+
if (match && match[1]) {
|
|
41
|
+
return match[1];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Format document metadata as human-readable text
|
|
48
|
+
*/
|
|
49
|
+
export function formatDocumentHeader(title, documentId, options) {
|
|
50
|
+
const lines = [
|
|
51
|
+
`Document: ${title}`,
|
|
52
|
+
`URL: ${constructDocumentUrl(documentId)}`,
|
|
53
|
+
`ID: ${documentId}`,
|
|
54
|
+
];
|
|
55
|
+
if (options?.wordCount !== undefined) {
|
|
56
|
+
lines.push(`Word count: ${options.wordCount}`);
|
|
57
|
+
}
|
|
58
|
+
if (options?.truncated) {
|
|
59
|
+
lines.push('Status: TRUNCATED (content exceeded limit)');
|
|
60
|
+
}
|
|
61
|
+
lines.push('---');
|
|
62
|
+
return lines.join('\n');
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Format a document read result as human-readable text
|
|
66
|
+
*/
|
|
67
|
+
export function formatDocumentAsText(title, documentId, content, options) {
|
|
68
|
+
if (options?.includeHeader === false) {
|
|
69
|
+
return wrapUntrustedContent(content, `google-workspace:docs:document/${documentId}`);
|
|
70
|
+
}
|
|
71
|
+
const header = formatDocumentHeader(title, documentId, {
|
|
72
|
+
truncated: options?.truncated,
|
|
73
|
+
});
|
|
74
|
+
return wrapUntrustedContent(`${header}\n${content}`, `google-workspace:docs:document/${documentId}`);
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=formatters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../../src/modules/docs/formatters.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAExE;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,UAAkB;IACrD,OAAO,sCAAsC,UAAU,OAAO,CAAC;AACjE,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAa;IACpD,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACxC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAE7B,iFAAiF;IACjF,IAAI,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3C,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,mCAAmC;IACnC,MAAM,QAAQ,GAAG;QACf,2BAA2B;QAC3B,kDAAkD;QAClD,4BAA4B;QAC5B,wDAAwD;QACxD,cAAc;QACd,qDAAqD;KACtD,CAAC;IAEF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACrC,IAAI,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YACtB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAClC,KAAa,EACb,UAAkB,EAClB,OAIC;IAED,MAAM,KAAK,GAAa;QACtB,aAAa,KAAK,EAAE;QACpB,QAAQ,oBAAoB,CAAC,UAAU,CAAC,EAAE;QAC1C,OAAO,UAAU,EAAE;KACpB,CAAC;IAEF,IAAI,OAAO,EAAE,SAAS,KAAK,SAAS,EAAE,CAAC;QACrC,KAAK,CAAC,IAAI,CAAC,eAAe,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,IAAI,OAAO,EAAE,SAAS,EAAE,CAAC;QACvB,KAAK,CAAC,IAAI,CAAC,4CAA4C,CAAC,CAAC;IAC3D,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAClC,KAAa,EACb,UAAkB,EAClB,OAAe,EACf,OAGC;IAED,IAAI,OAAO,EAAE,aAAa,KAAK,KAAK,EAAE,CAAC;QACrC,OAAO,oBAAoB,CAAC,OAAO,EAAE,kCAAkC,UAAU,EAAE,CAAC,CAAC;IACvF,CAAC;IAED,MAAM,MAAM,GAAG,oBAAoB,CAAC,KAAK,EAAE,UAAU,EAAE;QACrD,SAAS,EAAE,OAAO,EAAE,SAAS;KAC9B,CAAC,CAAC;IAEH,OAAO,oBAAoB,CAAC,GAAG,MAAM,KAAK,OAAO,EAAE,EAAE,kCAAkC,UAAU,EAAE,CAAC,CAAC;AACvG,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DocsService } from './service.js';
|
|
2
|
+
import { DocsOperationResult } from './types.js';
|
|
3
|
+
export * from './types.js';
|
|
4
|
+
export * from './scopes.js';
|
|
5
|
+
export { DocsService };
|
|
6
|
+
export declare function getDocsService(): DocsService;
|
|
7
|
+
export declare function initializeDocsModule(): Promise<void>;
|
|
8
|
+
export declare function handleDocsError(error: unknown): DocsOperationResult;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/docs/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAGjD,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,CAAC;AAGvB,wBAAgB,cAAc,IAAI,WAAW,CAE5C;AAGD,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAG1D;AAGD,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,mBAAmB,CAKnE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { docsService } from '../../services/docs/index.js';
|
|
2
|
+
import { DocsService } from './service.js';
|
|
3
|
+
// Export types and service
|
|
4
|
+
export * from './types.js';
|
|
5
|
+
export * from './scopes.js';
|
|
6
|
+
export { DocsService };
|
|
7
|
+
// Get singleton instance (from services/docs)
|
|
8
|
+
export function getDocsService() {
|
|
9
|
+
return docsService;
|
|
10
|
+
}
|
|
11
|
+
// Initialize module
|
|
12
|
+
export async function initializeDocsModule() {
|
|
13
|
+
const service = getDocsService();
|
|
14
|
+
await service.ensureInitialized();
|
|
15
|
+
}
|
|
16
|
+
// Helper to handle errors consistently
|
|
17
|
+
export function handleDocsError(error) {
|
|
18
|
+
return {
|
|
19
|
+
success: false,
|
|
20
|
+
error: error instanceof Error ? error.message : 'Unknown error occurred',
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/docs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3C,2BAA2B;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB,8CAA8C;AAC9C,MAAM,UAAU,cAAc;IAC5B,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,oBAAoB;AACpB,MAAM,CAAC,KAAK,UAAU,oBAAoB;IACxC,MAAM,OAAO,GAAG,cAAc,EAAE,CAAC;IACjC,MAAM,OAAO,CAAC,iBAAiB,EAAE,CAAC;AACpC,CAAC;AAED,uCAAuC;AACvC,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,OAAO;QACL,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,wBAAwB;KACzE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const DOCS_SCOPES: {
|
|
2
|
+
readonly FULL: "https://www.googleapis.com/auth/documents";
|
|
3
|
+
readonly READONLY: "https://www.googleapis.com/auth/documents.readonly";
|
|
4
|
+
};
|
|
5
|
+
export type DocsScope = typeof DOCS_SCOPES[keyof typeof DOCS_SCOPES];
|
|
6
|
+
/**
|
|
7
|
+
* Register Docs OAuth scopes at startup.
|
|
8
|
+
* Auth issues will be handled via 401 responses rather than pre-validation.
|
|
9
|
+
*
|
|
10
|
+
* Note: We register both FULL and READONLY scopes.
|
|
11
|
+
* - FULL is used for write operations (create, append, replace, find/replace)
|
|
12
|
+
* - READONLY is used for read-only operations (read, list tabs)
|
|
13
|
+
*/
|
|
14
|
+
export declare function registerDocsScopes(): void;
|
|
15
|
+
export declare function getDocsScopes(): string[];
|
|
16
|
+
export declare function validateDocsScopes(scopes: string[]): boolean;
|
|
17
|
+
//# sourceMappingURL=scopes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scopes.d.ts","sourceRoot":"","sources":["../../../src/modules/docs/scopes.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,WAAW;;;CAMd,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,OAAO,WAAW,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAErE;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAezC;AAED,wBAAgB,aAAa,IAAI,MAAM,EAAE,CAExC;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAG5D"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { scopeRegistry } from '../tools/scope-registry.js';
|
|
2
|
+
import logger from '../../utils/logger.js';
|
|
3
|
+
// Define Docs scopes as constants for reuse and testing
|
|
4
|
+
// Reference: https://developers.google.com/docs/api/auth
|
|
5
|
+
export const DOCS_SCOPES = {
|
|
6
|
+
// Full access to documents (create, read, update)
|
|
7
|
+
FULL: 'https://www.googleapis.com/auth/documents',
|
|
8
|
+
// Read-only access to documents
|
|
9
|
+
READONLY: 'https://www.googleapis.com/auth/documents.readonly',
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Register Docs OAuth scopes at startup.
|
|
13
|
+
* Auth issues will be handled via 401 responses rather than pre-validation.
|
|
14
|
+
*
|
|
15
|
+
* Note: We register both FULL and READONLY scopes.
|
|
16
|
+
* - FULL is used for write operations (create, append, replace, find/replace)
|
|
17
|
+
* - READONLY is used for read-only operations (read, list tabs)
|
|
18
|
+
*/
|
|
19
|
+
export function registerDocsScopes() {
|
|
20
|
+
// Register core functionality scopes
|
|
21
|
+
scopeRegistry.registerScope('docs', DOCS_SCOPES.FULL);
|
|
22
|
+
scopeRegistry.registerScope('docs', DOCS_SCOPES.READONLY);
|
|
23
|
+
// Verify all scopes are registered
|
|
24
|
+
const registeredScopes = scopeRegistry.getAllScopes();
|
|
25
|
+
const requiredScopes = Object.values(DOCS_SCOPES);
|
|
26
|
+
const missingScopes = requiredScopes.filter(scope => !registeredScopes.includes(scope));
|
|
27
|
+
if (missingScopes.length > 0) {
|
|
28
|
+
throw new Error(`Failed to register Docs scopes: ${missingScopes.join(', ')}`);
|
|
29
|
+
}
|
|
30
|
+
logger.info('Docs scopes registered');
|
|
31
|
+
}
|
|
32
|
+
export function getDocsScopes() {
|
|
33
|
+
return Object.values(DOCS_SCOPES);
|
|
34
|
+
}
|
|
35
|
+
export function validateDocsScopes(scopes) {
|
|
36
|
+
const validScopes = new Set(getDocsScopes());
|
|
37
|
+
return scopes.every(scope => validScopes.has(scope));
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=scopes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scopes.js","sourceRoot":"","sources":["../../../src/modules/docs/scopes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAE3C,wDAAwD;AACxD,yDAAyD;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,kDAAkD;IAClD,IAAI,EAAE,2CAA2C;IAEjD,gCAAgC;IAChC,QAAQ,EAAE,oDAAoD;CACtD,CAAC;AAIX;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB;IAChC,qCAAqC;IACrC,aAAa,CAAC,aAAa,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;IACtD,aAAa,CAAC,aAAa,CAAC,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IAE1D,mCAAmC;IACnC,MAAM,gBAAgB,GAAG,aAAa,CAAC,YAAY,EAAE,CAAC;IACtD,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAElD,MAAM,aAAa,GAAG,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,gBAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IACxF,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,mCAAmC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjF,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,OAAO,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,MAAgB;IACjD,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,aAAa,EAAE,CAAC,CAAC;IAC7C,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { docs_v1 } from 'googleapis';
|
|
2
|
+
import { BaseGoogleService } from '../../services/base/BaseGoogleService.js';
|
|
3
|
+
import { DocsOperationResult, ReadDocumentOptions, CreateDocumentOptions, AppendDocumentOptions, ReplaceDocumentOptions, FindReplaceOptions, ListTabsOptions, BatchUpdateDocumentOptions } from './types.js';
|
|
4
|
+
export declare class DocsService extends BaseGoogleService<docs_v1.Docs> {
|
|
5
|
+
private initialized;
|
|
6
|
+
constructor();
|
|
7
|
+
initialize(): Promise<void>;
|
|
8
|
+
ensureInitialized(): Promise<void>;
|
|
9
|
+
private checkInitialized;
|
|
10
|
+
/**
|
|
11
|
+
* Construct a Google Docs URL from document ID
|
|
12
|
+
*/
|
|
13
|
+
private constructDocumentUrl;
|
|
14
|
+
/**
|
|
15
|
+
* Extract plain text from document body structure
|
|
16
|
+
*/
|
|
17
|
+
private extractTextFromBody;
|
|
18
|
+
/**
|
|
19
|
+
* Get the end index of the document body for insert operations
|
|
20
|
+
*/
|
|
21
|
+
private getDocumentEndIndex;
|
|
22
|
+
/**
|
|
23
|
+
* Read a document and return its content
|
|
24
|
+
*/
|
|
25
|
+
getDocument(email: string, documentId: string, options?: ReadDocumentOptions): Promise<DocsOperationResult>;
|
|
26
|
+
/**
|
|
27
|
+
* Create a new document with optional initial content
|
|
28
|
+
*/
|
|
29
|
+
createDocument(email: string, options: CreateDocumentOptions): Promise<DocsOperationResult>;
|
|
30
|
+
/**
|
|
31
|
+
* Append text to the end of a document
|
|
32
|
+
*/
|
|
33
|
+
appendToDocument(email: string, options: AppendDocumentOptions): Promise<DocsOperationResult>;
|
|
34
|
+
/**
|
|
35
|
+
* Replace entire document content
|
|
36
|
+
*/
|
|
37
|
+
replaceDocument(email: string, options: ReplaceDocumentOptions): Promise<DocsOperationResult>;
|
|
38
|
+
/**
|
|
39
|
+
* Find and replace text throughout the document
|
|
40
|
+
*/
|
|
41
|
+
findAndReplace(email: string, options: FindReplaceOptions): Promise<DocsOperationResult>;
|
|
42
|
+
/**
|
|
43
|
+
* Batch update a document with multiple operations.
|
|
44
|
+
* This is the core API for modifying documents programmatically.
|
|
45
|
+
*
|
|
46
|
+
* @param email - User email for authentication
|
|
47
|
+
* @param documentId - ID of the document to update
|
|
48
|
+
* @param options - BatchUpdateDocumentOptions containing requests array and optional writeControl
|
|
49
|
+
* @returns DocsOperationResult with DocsBatchUpdateResponse data
|
|
50
|
+
*/
|
|
51
|
+
batchUpdate(email: string, documentId: string, options: BatchUpdateDocumentOptions): Promise<DocsOperationResult>;
|
|
52
|
+
/**
|
|
53
|
+
* List tabs in a document
|
|
54
|
+
* Note: Full tab support requires googleapis upgrade. Currently returns single default tab.
|
|
55
|
+
*/
|
|
56
|
+
listTabs(email: string, options: ListTabsOptions): Promise<DocsOperationResult>;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/modules/docs/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,OAAO,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EAClB,eAAe,EACf,0BAA0B,EAG3B,MAAM,YAAY,CAAC;AAMpB,qBAAa,WAAY,SAAQ,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC;IAC9D,OAAO,CAAC,WAAW,CAAS;;IASf,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAS3B,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAM/C,OAAO,CAAC,gBAAgB;IASxB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAI5B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAsC3B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAW3B;;OAEG;IACG,WAAW,CACf,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,mBAAmB,CAAC;IAmD/B;;OAEG;IACG,cAAc,CAClB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,mBAAmB,CAAC;IA4D/B;;OAEG;IACG,gBAAgB,CACpB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,mBAAmB,CAAC;IAkD/B;;OAEG;IACG,eAAe,CACnB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,mBAAmB,CAAC;IAgE/B;;OAEG;IACG,cAAc,CAClB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,mBAAmB,CAAC;IAyD/B;;;;;;;;OAQG;IACG,WAAW,CACf,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,mBAAmB,CAAC;IA8B/B;;;OAGG;IACG,QAAQ,CACZ,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,mBAAmB,CAAC;CA8ChC"}
|