@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,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Service for managing attachment metadata and providing simplified references for AI interactions
|
|
3
|
+
*/
|
|
4
|
+
export interface AttachmentMetadataInternal {
|
|
5
|
+
messageId: string;
|
|
6
|
+
filename: string;
|
|
7
|
+
originalId: string;
|
|
8
|
+
mimeType: string;
|
|
9
|
+
size: number;
|
|
10
|
+
timestamp: number;
|
|
11
|
+
}
|
|
12
|
+
export declare class AttachmentIndexService {
|
|
13
|
+
private static instance;
|
|
14
|
+
private index;
|
|
15
|
+
private readonly _maxEntries;
|
|
16
|
+
private expiryMs;
|
|
17
|
+
/**
|
|
18
|
+
* Get the maximum number of entries allowed in the index
|
|
19
|
+
*/
|
|
20
|
+
get maxEntries(): number;
|
|
21
|
+
private constructor();
|
|
22
|
+
/**
|
|
23
|
+
* Get the singleton instance
|
|
24
|
+
*/
|
|
25
|
+
static getInstance(): AttachmentIndexService;
|
|
26
|
+
/**
|
|
27
|
+
* Add or update attachment metadata in the index
|
|
28
|
+
*/
|
|
29
|
+
addAttachment(messageId: string, attachment: {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
mimeType: string;
|
|
33
|
+
size: number;
|
|
34
|
+
}): void;
|
|
35
|
+
/**
|
|
36
|
+
* Retrieve attachment metadata by message ID and filename
|
|
37
|
+
* Searches by filename since that's what callers typically have
|
|
38
|
+
*/
|
|
39
|
+
getMetadata(messageId: string, filename: string): AttachmentMetadataInternal | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Retrieve attachment metadata by message ID and attachment ID (preferred)
|
|
42
|
+
*/
|
|
43
|
+
getMetadataById(messageId: string, attachmentId: string): AttachmentMetadataInternal | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Remove expired entries from the index
|
|
46
|
+
*/
|
|
47
|
+
cleanExpiredEntries(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Check if an entry has expired
|
|
50
|
+
*/
|
|
51
|
+
private isExpired;
|
|
52
|
+
/**
|
|
53
|
+
* Get current number of entries in the index
|
|
54
|
+
*/
|
|
55
|
+
get size(): number;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=index-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-service.d.ts","sourceRoot":"","sources":["../../../src/modules/attachments/index-service.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,0BAA0B;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,sBAAsB;IACjC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAyB;IAChD,OAAO,CAAC,KAAK,CAA0C;IACvD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAe;IAC3C,OAAO,CAAC,QAAQ,CAAmB;IAEnC;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,OAAO;IAIP;;OAEG;WACW,WAAW,IAAI,sBAAsB;IAOnD;;OAEG;IACH,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE;QAC3C,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,IAAI;IA8BR;;;OAGG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,0BAA0B,GAAG,SAAS;IAexF;;OAEG;IACH,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,0BAA0B,GAAG,SAAS;IAYhG;;OAEG;IACI,mBAAmB,IAAI,IAAI;IASlC;;OAEG;IACH,OAAO,CAAC,SAAS;IAIjB;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Service for managing attachment metadata and providing simplified references for AI interactions
|
|
3
|
+
*/
|
|
4
|
+
export class AttachmentIndexService {
|
|
5
|
+
static instance;
|
|
6
|
+
index;
|
|
7
|
+
_maxEntries = 256;
|
|
8
|
+
expiryMs = 3600000; // 1 hour
|
|
9
|
+
/**
|
|
10
|
+
* Get the maximum number of entries allowed in the index
|
|
11
|
+
*/
|
|
12
|
+
get maxEntries() {
|
|
13
|
+
return this._maxEntries;
|
|
14
|
+
}
|
|
15
|
+
constructor() {
|
|
16
|
+
this.index = new Map();
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Get the singleton instance
|
|
20
|
+
*/
|
|
21
|
+
static getInstance() {
|
|
22
|
+
if (!AttachmentIndexService.instance) {
|
|
23
|
+
AttachmentIndexService.instance = new AttachmentIndexService();
|
|
24
|
+
}
|
|
25
|
+
return AttachmentIndexService.instance;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Add or update attachment metadata in the index
|
|
29
|
+
*/
|
|
30
|
+
addAttachment(messageId, attachment) {
|
|
31
|
+
// Clean expired entries if we're near capacity
|
|
32
|
+
if (this.index.size >= this._maxEntries) {
|
|
33
|
+
this.cleanExpiredEntries();
|
|
34
|
+
// If still at capacity after cleaning expired entries,
|
|
35
|
+
// remove oldest entries until we have space
|
|
36
|
+
if (this.index.size >= this._maxEntries) {
|
|
37
|
+
const entries = Array.from(this.index.entries())
|
|
38
|
+
.sort(([, a], [, b]) => a.timestamp - b.timestamp);
|
|
39
|
+
while (this.index.size >= this._maxEntries && entries.length > 0) {
|
|
40
|
+
const [key] = entries.shift();
|
|
41
|
+
this.index.delete(key);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
// Use attachmentId in key to avoid collision when same filename appears multiple times
|
|
46
|
+
const key = `${messageId}_${attachment.id}`;
|
|
47
|
+
this.index.set(key, {
|
|
48
|
+
messageId,
|
|
49
|
+
filename: attachment.name,
|
|
50
|
+
originalId: attachment.id,
|
|
51
|
+
mimeType: attachment.mimeType,
|
|
52
|
+
size: attachment.size,
|
|
53
|
+
timestamp: Date.now()
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Retrieve attachment metadata by message ID and filename
|
|
58
|
+
* Searches by filename since that's what callers typically have
|
|
59
|
+
*/
|
|
60
|
+
getMetadata(messageId, filename) {
|
|
61
|
+
// Search through entries to find matching messageId and filename
|
|
62
|
+
for (const [, metadata] of this.index.entries()) {
|
|
63
|
+
if (metadata.messageId === messageId && metadata.filename === filename) {
|
|
64
|
+
if (this.isExpired(metadata)) {
|
|
65
|
+
const key = `${messageId}_${metadata.originalId}`;
|
|
66
|
+
this.index.delete(key);
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
return metadata;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Retrieve attachment metadata by message ID and attachment ID (preferred)
|
|
76
|
+
*/
|
|
77
|
+
getMetadataById(messageId, attachmentId) {
|
|
78
|
+
const key = `${messageId}_${attachmentId}`;
|
|
79
|
+
const metadata = this.index.get(key);
|
|
80
|
+
if (metadata && this.isExpired(metadata)) {
|
|
81
|
+
this.index.delete(key);
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
return metadata;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Remove expired entries from the index
|
|
88
|
+
*/
|
|
89
|
+
cleanExpiredEntries() {
|
|
90
|
+
const now = Date.now();
|
|
91
|
+
for (const [key, metadata] of this.index.entries()) {
|
|
92
|
+
if (this.isExpired(metadata)) {
|
|
93
|
+
this.index.delete(key);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Check if an entry has expired
|
|
99
|
+
*/
|
|
100
|
+
isExpired(metadata) {
|
|
101
|
+
return Date.now() - metadata.timestamp > this.expiryMs;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Get current number of entries in the index
|
|
105
|
+
*/
|
|
106
|
+
get size() {
|
|
107
|
+
return this.index.size;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=index-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-service.js","sourceRoot":"","sources":["../../../src/modules/attachments/index-service.ts"],"names":[],"mappings":"AAAA;;GAEG;AAWH,MAAM,OAAO,sBAAsB;IACzB,MAAM,CAAC,QAAQ,CAAyB;IACxC,KAAK,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,CAAC;YACzC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACvB,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;OAEG;IACI,mBAAmB;QACxB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACvB,KAAK,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;YACnD,IAAI,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAC7B,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACzB,CAAC;QACH,CAAC;IACH,CAAC;IAED;;OAEG;IACK,SAAS,CAAC,QAAoC;QACpD,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,CAAC,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC;IACzD,CAAC;IAED;;OAEG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;IACzB,CAAC;CACF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AttachmentIndexService } from './index-service.js';
|
|
2
|
+
/**
|
|
3
|
+
* Simplified attachment information visible to AI
|
|
4
|
+
*/
|
|
5
|
+
export interface AttachmentInfo {
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Service for transforming API responses to hide complex attachment IDs from AI
|
|
10
|
+
*/
|
|
11
|
+
export declare class AttachmentResponseTransformer {
|
|
12
|
+
private indexService;
|
|
13
|
+
constructor(indexService: AttachmentIndexService);
|
|
14
|
+
/**
|
|
15
|
+
* Transform a response object that may contain attachments
|
|
16
|
+
* Works with both email and calendar responses
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Transform a response object that may contain attachments
|
|
20
|
+
* Works with both email and calendar responses
|
|
21
|
+
*/
|
|
22
|
+
transformResponse<T>(response: T): T;
|
|
23
|
+
/**
|
|
24
|
+
* Create a refresh placeholder for expired attachments
|
|
25
|
+
*/
|
|
26
|
+
static createRefreshPlaceholder(): AttachmentInfo[];
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=response-transformer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response-transformer.d.ts","sourceRoot":"","sources":["../../../src/modules/attachments/response-transformer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,qBAAa,6BAA6B;IAC5B,OAAO,CAAC,YAAY;gBAAZ,YAAY,EAAE,sBAAsB;IAExD;;;OAGG;IACH;;;OAGG;IACH,iBAAiB,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC;IA8CpC;;OAEG;IACH,MAAM,CAAC,wBAAwB,IAAI,cAAc,EAAE;CAKpD"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Service for transforming API responses to hide complex attachment IDs from AI
|
|
3
|
+
*/
|
|
4
|
+
export class AttachmentResponseTransformer {
|
|
5
|
+
indexService;
|
|
6
|
+
constructor(indexService) {
|
|
7
|
+
this.indexService = indexService;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Transform a response object that may contain attachments
|
|
11
|
+
* Works with both email and calendar responses
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Transform a response object that may contain attachments
|
|
15
|
+
* Works with both email and calendar responses
|
|
16
|
+
*/
|
|
17
|
+
transformResponse(response) {
|
|
18
|
+
if (Array.isArray(response)) {
|
|
19
|
+
return response.map(item => this.transformResponse(item));
|
|
20
|
+
}
|
|
21
|
+
if (typeof response !== 'object' || response === null) {
|
|
22
|
+
return response;
|
|
23
|
+
}
|
|
24
|
+
// Deep clone to avoid modifying original
|
|
25
|
+
const transformed = { ...response };
|
|
26
|
+
// Transform attachments if present
|
|
27
|
+
if ('attachments' in transformed &&
|
|
28
|
+
Array.isArray(transformed.attachments) &&
|
|
29
|
+
'id' in transformed) {
|
|
30
|
+
const messageId = transformed.id;
|
|
31
|
+
// Store full metadata in index
|
|
32
|
+
transformed.attachments.forEach((attachment) => {
|
|
33
|
+
if (attachment?.id && attachment?.name) {
|
|
34
|
+
this.indexService.addAttachment(messageId, {
|
|
35
|
+
id: attachment.id,
|
|
36
|
+
name: attachment.name,
|
|
37
|
+
mimeType: attachment.mimeType || 'application/octet-stream',
|
|
38
|
+
size: attachment.size || 0
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
// Replace with simplified version
|
|
43
|
+
transformed.attachments = transformed.attachments.map((attachment) => ({
|
|
44
|
+
name: attachment?.name || 'Unknown file'
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
// Recursively transform nested objects
|
|
48
|
+
Object.keys(transformed).forEach(key => {
|
|
49
|
+
if (typeof transformed[key] === 'object' && transformed[key] !== null) {
|
|
50
|
+
transformed[key] = this.transformResponse(transformed[key]);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
return transformed;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Create a refresh placeholder for expired attachments
|
|
57
|
+
*/
|
|
58
|
+
static createRefreshPlaceholder() {
|
|
59
|
+
return [{
|
|
60
|
+
name: "Attachments expired - Request message again to view"
|
|
61
|
+
}];
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=response-transformer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response-transformer.js","sourceRoot":"","sources":["../../../src/modules/attachments/response-transformer.ts"],"names":[],"mappings":"AASA;;GAEG;AACH,MAAM,OAAO,6BAA6B;IACpB;IAApB,YAAoB,YA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,EAAE,UAAU,EAAE,IAAI,IAAI,cAAc;aACzC,CAAC,CAAC,CAAC;QACN,CAAC;QAED,uCAAuC;QACvC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YACrC,IAAI,OAAO,WAAW,CAAC,GAAG,CAAC,KAAK,QAAQ,IAAI,WAAW,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;gBACtE,WAAW,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;YAC9D,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,WAA2B,CAAC;IACrC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,wBAAwB;QAC7B,OAAO,CAAC;gBACN,IAAI,EAAE,qDAAqD;aAC5D,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { AttachmentResult, AttachmentServiceConfig, AttachmentSource, AttachmentFolderType } from './types.js';
|
|
2
|
+
export declare class AttachmentService {
|
|
3
|
+
private static instance;
|
|
4
|
+
private config;
|
|
5
|
+
private initialized;
|
|
6
|
+
private constructor();
|
|
7
|
+
/**
|
|
8
|
+
* Get the singleton instance
|
|
9
|
+
*/
|
|
10
|
+
static getInstance(config?: AttachmentServiceConfig): AttachmentService;
|
|
11
|
+
/**
|
|
12
|
+
* Initialize attachment folders in local storage
|
|
13
|
+
*/
|
|
14
|
+
initialize(email: string): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Validate attachment against configured limits
|
|
17
|
+
*/
|
|
18
|
+
private validateAttachment;
|
|
19
|
+
/**
|
|
20
|
+
* Process attachment and store in local filesystem
|
|
21
|
+
*/
|
|
22
|
+
processAttachment(email: string, source: AttachmentSource, parentFolder: string): Promise<AttachmentResult>;
|
|
23
|
+
/**
|
|
24
|
+
* Download attachment from local storage
|
|
25
|
+
*/
|
|
26
|
+
downloadAttachment(email: string, attachmentId: string, filePath: string): Promise<AttachmentResult>;
|
|
27
|
+
/**
|
|
28
|
+
* Delete attachment from local storage
|
|
29
|
+
*/
|
|
30
|
+
deleteAttachment(email: string, attachmentId: string, filePath: string): Promise<AttachmentResult>;
|
|
31
|
+
/**
|
|
32
|
+
* Get full path for a specific attachment category
|
|
33
|
+
*/
|
|
34
|
+
getAttachmentPath(folder: AttachmentFolderType): string;
|
|
35
|
+
private resolveContainedAttachmentPath;
|
|
36
|
+
/**
|
|
37
|
+
* Find attachment in local storage by scanning filesystem for matching filename.
|
|
38
|
+
* Files are stored as ${uuid}_${filename}, so we search for files ending with _${filename}
|
|
39
|
+
*/
|
|
40
|
+
findAttachmentByFilename(email: string, filename: string, folder: AttachmentFolderType): Promise<AttachmentResult>;
|
|
41
|
+
/**
|
|
42
|
+
* Delete attachment by scanning filesystem for matching filename.
|
|
43
|
+
* Files are stored as ${uuid}_${filename}, so we search for files ending with _${filename}
|
|
44
|
+
*/
|
|
45
|
+
deleteAttachmentByFilename(email: string, filename: string, folder: AttachmentFolderType): Promise<AttachmentResult>;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/modules/attachments/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAGhB,oBAAoB,EACrB,MAAM,YAAY,CAAC;AA2BpB,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAoB;IAC3C,OAAO,CAAC,MAAM,CAA0B;IACxC,OAAO,CAAC,WAAW,CAAS;IAE5B,OAAO;IAQP;;OAEG;WACW,WAAW,CAAC,MAAM,GAAE,uBAA4B,GAAG,iBAAiB;IAOlF;;OAEG;IACG,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAs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