-
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(intake-email): mutualized intake-emails creation in drivers #137
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Deploying papra-client with
|
Latest commit: |
d4a9689
|
Status: | ✅ Deploy successful! |
Preview URL: | https://9c229fab.papra.pages.dev |
Branch Preview URL: | https://intake-email-drivers.papra.pages.dev |
Deploying papra-demo with
|
Latest commit: |
d4a9689
|
Status: | ✅ Deploy successful! |
Preview URL: | https://c2a7af3e.papra-demo.pages.dev |
Branch Preview URL: | https://intake-email-drivers.papra-demo.pages.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This PR refactors the intake email creation process to support a mutualized driver-based approach and prepares the codebase for OwlRelay integration. Key changes include:
- Introducing a new "random-username" intake email driver with its configuration and factory.
- Updating the intake email services, repository, and use cases to use the driver's generated email address rather than relying on username extraction.
- Adjusting tests, types, routes, and client components to support the new email address generation approach.
Reviewed Changes
File | Description |
---|---|
apps/papra-server/src/modules/intake-emails/drivers/random-username/random-username.intake-email-driver.ts | Adds the new driver that generates an email address using a random human-readable ID. |
apps/papra-server/src/modules/intake-emails/intake-emails.services.ts | Creates intake email services using the driver’s generateEmailAddress function. |
apps/papra-server/src/modules/intake-emails/drivers/intake-emails.drivers.ts | Registers the new random username driver in the drivers mapping. |
apps/papra-server/src/modules/intake-emails/drivers/random-username/random-username.intake-email-driver.config.ts | Provides configuration (domain) specific to the new driver. |
apps/papra-server/src/modules/intake-emails/intake-emails.models.test.ts | Adds tests for the buildEmailAddress and parseEmailAddress utilities. |
apps/papra-server/src/modules/intake-emails/drivers/intake-emails.drivers.models.ts | Updates driver models to integrate with the new intake email driver. |
apps/papra-server/src/modules/intake-emails/intake-emails.models.ts | Moves email address utilities to a common module for reuse. |
apps/papra-server/src/modules/intake-emails/intake-emails.repository.ts | Updates repository functions to handle the new emailAddress field and retrieval by email. |
apps/papra-server/src/modules/intake-emails/intake-emails.config.ts | Enhances configuration to allow driver selection and passes specific driver config. |
apps/papra-client/src/modules/intake-emails/pages/intake-emails.page.tsx | Updates client side display to use the new emailAddress field. |
apps/papra-server/src/modules/intake-emails/intake-emails.usecases.ts | Refactors use cases to remove the username extraction logic and rely on the generated email address. |
apps/papra-client/src/modules/intake-emails/intake-emails.types.ts | Updates the IntakeEmail type to include the emailAddress property. |
apps/papra-server/src/modules/intake-emails/intake-emails.routes.ts | Adjusts API routes to use the new driver-based services for intake email creation. |
apps/papra-client/src/modules/intake-emails/intake-emails.models.ts | Removes the obsolete formatIntakeEmail function in favor of using the emailAddress directly. |
Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.
Deploying papra-docs with
|
Latest commit: |
d4a9689
|
Status: | ✅ Deploy successful! |
Preview URL: | https://430c0cb6.papra-2op.pages.dev |
Branch Preview URL: | https://intake-email-drivers.papra-2op.pages.dev |
d3fbfd3
to
d4a9689
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Preparation for OwlRelay integration