Граф коммитов

25 Коммитов

Автор SHA1 Сообщение Дата
Barry Chen d588eb23e8
feat(password): send OTP to start password reset flow
Because:
 - we want to use OTPs to improve the UX of the password reset flow

This commit:
 - adds a lib for generating and validating random numeric OTPs
 - adds a new auth-server endpoint for requesting the OTP in an email
   - this endpoint does not send an email yet; To Be Implemented
2024-04-24 12:11:14 -05:00
dschom 8b9051f881
task(graphql): Send notifications when users opt in/out of metrics collection
Because:
- We want to let RPs know when users opt out of metrics collection
- We want to let RPs know when users opt in to metrics collection

This Commit:
- Ports the notifier code over to nx libs from auth server
- Ports other supporting libraries from fxa-shared to nx libs
  - MozLoggerService
  - Sentry
  - Metrics (ie statsd)
- Updates graphql to emit a 'metricsChange' event when users toggle their 'Help improve Mozilla accounts' option in settings.
- Adds support for the metricsChanged event to the fxa-event-broker
2024-04-24 08:10:14 -07:00
Reino Muhl c595afe4f3
feat(next): create setupCart server action
Because:

* Call CartService.setupCart from payments-next via server action.

This commit:

* Extracts fxa-geodb into libs/* library
* Updates CartService to include GeodbManager
* Call setupCart from payments-next

Closes #FXA-8892
2024-04-15 12:48:35 -04:00
Reino Muhl 652c09ab50
feat(next): add l10n to localizer for next rsc
Because:

* Ensure all localization strings can be localized in React Server
  Components.

This commit:

* Removes LocalizerServer
* Adds LocalizerRSC to serve as a wrapper for ReactLocalization that can
  be used by React Server Components, as well as a few other utility
  methods.
* Adds LocalizerRscFactory that instantiates LocalizerRSC only with
  bundles for a provided acceptLanguage string.
* Adds LocalizerRscFactoryProvider to be used with the NestApp to
  instantiate and then intialize the LocalizerRscFactory. Initalization
  will fetch all messages from disk and populate the bundles.
* Reorganize shared/l10n library to match Node style guide
* Removes demo l10n code
* Update purchase-details, terms-and-service components, and success and
  error pages to use new LocalizerRSC class for localization.
* Adds temporary l10n-convert script to provide translation for existing
  ftl strings.

Closes #FXA-8822
2024-04-08 14:58:17 -04:00
Reino Muhl 695d791b15
feat(l10n): add localizer class for payments next
Because:

* Create a localizer class that can be used by payments next react
  server components.
* Only generate fluent bundles once on startup.

This commit:

* Moves logic from Localizer class, defined in
  `fxa-auth-server/lib/l10n/index.ts`, to a LocalizerBase class.
* Adds LocalizerServer class to be used by payments next.
* Moves nestapp from payments-next app to a library

Closes #FXA-8821
2024-03-22 08:58:53 -04:00
Lisa Chan 25bcf355ed
feat(shared-assets): Create library for shared assets 2024-03-20 18:54:49 -04:00
Ben Bangert c28b061257
chore: update Node to LTS 20, TypeScript, tsconfig
Because:

* We want to update to Node 20 LTS.
* We want to target the JS output of Node 20.
* We want to use the latest TypeScript 5.4

This commit:

* Updates the Node version to 20 LTS.
* Updates the TypeScript version and related TS libs
  to 5.4.
* Updates tsconfig for the new Node 20 target.
2024-03-14 11:54:20 -07:00
dschom aaa625ce15
task(admin-panel): Hookup account delete
Because:
- We want to delete accounts from the admin panel

This Commit:
- Adds cloud task emulator pm2 service
- Creates cloud-task nx lib for interacting with cloud tasks
- Creates PageDeleteAccount in admin panel
- Adds ability to delete accounts to admin server's account resolver
- Fixes broken admin panel configuration
- Fixes broken admin server configuration
2024-03-13 11:26:09 -07:00
Julian Poyourow 573a18be60
feat(auth): type-cacheable firestore and networkfirst adapter 2024-02-14 09:01:30 -08:00
Reino Muhl a9259228ad
fix(auth): add contentful to plans api
Because:

* The GET /plans API is used in multiple places to retrieve the relying
  party configuration data currently configured in Stripe.metadata

This commit:

* Updates the logic used by the GET /plans API to retrieve the relying
  party configuration data from Contentful, with Stripe.metadata as a
  fallback
* Reports a Sentry error when the Contentful configuration data does not
  match the Stripe.metadata

Closes #FXA-8538
2023-11-17 10:26:54 -05:00
Ivo Plamenac 5c5b055f86
feat(sp3): add Stripe Factories
Because:

* we want to employ the factory pattern for mocking testing data

This commit:

* adds factory functions for several stripe objects

Closes #FXA-8311
2023-10-25 10:52:05 -07:00
Reino Muhl 63e5ab95fd
feat(libs): move fxa-shared/l10n to libs/shared/l10n
Because:

* We want to use functions from fxa-shared/l10n in new libs/* libraries
  including libs/shared/contentful.

This commit:

* Moves fxa-shared/l10n to libs/shared/l10n
* Updates all references in packages/*

Closes #FXA-8228
2023-10-04 16:08:01 -04:00
Bianca Danforth 83501ecf83
feat(libs): create EligibilityManager library
Because:

* Plan eligibility depends on a number of factors, including what plans the user is already subscribed to (in Stripe, Google IAP or Apple IAP) and available upgrade paths for those plans per product-specific config (in Stripe metadata currently but soon to live in Contentful).
* We want to break out eligibility checks and types into a separate library from the auth server's `CapabilityService.getPlanEligibility`, since it's not really capability-oriented.

This commit:

* Generates a new nx library in lib/payments/eligibility

Closes #FXA-7582
2023-09-25 16:02:44 -04:00
Lisa Chan 8616a34f6d
feat(libs): Create CapabilityManager library 2023-09-14 09:15:26 -04:00
Reino Muhl 3894a65527
feat(next): payments-next initial work
Because:

* Create the initial work for the Checkout page as a starting point and
  example for the rest of the SP3 components and pages.

This commit:

* Adds the payments/next/ui Next.js library.
* Move Header JSX into layout.tsx and remove ExampleHeader component.
* Add RSC PurchaseDetails, using JSX from SP2.5 PlanDetails component.
* Add RSC TermsAndPrivacy component
* Add various stubs functions for illustration purposes. These will be
  replaced with actual implementations in future tickets.
  * Cart fetch
  * Contentful fetch
  * Translation using @fluent/bundle

Closes FXA-8133
2023-09-12 14:24:39 -04:00
Meghan Sardesai a999afd748
chore(next): add Storybook to NextJS setup
Because:

* We want to include Storybook in 3.0.

This commit:

* Ensures Storybook component loads as expected.
* Ensures shared Tailwind styles can be used in payments-next and works with hot-reloading.
* Ensures the build script executes without any errors.

Closes FXA-7503
2023-09-11 17:26:30 -04:00
Ben Bangert 0be6fd95c5
feat: add account manager class
Because:

* We want to have a single place to manage account related operations in
  the database layer.

This commit:

* Adds a new AccountManager class and account package.

Closes #FXA-6623
2023-08-18 09:06:28 -07:00
Julian Poyourow d65c9f9cc7
feat(shared): contentful client
Because
- We need a reusable client for accessing contentful

This Commit
- Adds a contentful client with automated codegen
- Creates a reusable query system

Closes FXA-7501
2023-08-16 16:27:12 +00:00
Bianca Danforth a9dc3372fe
feat(shared): create error library with initial error classes
Because:

* We want an error library to generalize error handling across all new integrated libraries.

This commit:

* Generates a new JS library with nx called shared-error that exports a few error classes.
* Ports the PayPalClientError to the new library as an example error (renamed to PayPalNVPError with PayPalClientError becoming a MultiError composed of one or more PayPalNVPErrors), refactoring the multiple error handling logic to a new helper.

Closes #FXA-7656
2023-08-02 11:26:54 -04:00
Reino Muhl 868a723be6
feat(payments): add cart library and factories
Because:

* Need a library to handle the cart db table and related functions

This commit:

* Add cart DB model
* Initializes the Cart library and creates factories and types
* Adds CartManager library
* Adds Cart related resolvers with basic Cart DB queries

Closes: #FXA-7508 #FXA-7505
2023-08-01 14:42:42 -04:00
Ben Bangert 9e1670ab30
feat: add foundational db classes
Because:

 * We want to use clean and well tested code for our new integrated
   account database layer.
 * We don't want to use stored procedures for new code.

This commit:

 * Adds a new library that contains core mysql connection functionality.
 * Duplicates core objection classes and setup from fxa-shared without
   stored procedure functionality.

Closes FXA-6622
2023-07-24 14:44:12 -04:00
Lisa Chan d4bf24117c
chore(next): Add Next.js to fxa and initial setup 2023-07-19 14:57:15 -04:00
Julian Poyourow 1faa33a353
feat(payments/paypal): add subs/paypal library
Because:

* Nx gives us the ability to break things up into smaller libraries with
  individual responsibilities.
* Paypal logic can exist in a standalone library for reusability in SP3

This commit:

* Moves PayPalClient and associated utils/typings to a library named
  `subs/paypal`. It can be imported via `@fxa/payments/paypal` in any
  TypeScript code.

Closes FXA-7610
2023-06-07 11:40:10 -07:00
Julian Poyourow d07236bcd8
chore(build): upgrade nx to v16
Because:

* Nx released v16!

This commit:

* Upgrades Nx to v16 using `nx migrate`

Closes FXA-7622
2023-06-01 13:21:44 -07:00
Julian Poyourow 565ebb89c9
chore(build): initial nx implementation
Because:

* We want to introduce nx to the repository

This commit:

* Adds nx with working builds

Closes: FXA-7341

Co-authored-by: dschom <dschomburg@mozilla.com>
2023-05-23 08:37:47 -07:00