backend-manager 5.2.19 → 5.3.1

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.
Files changed (57) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/CLAUDE.md +5 -4
  3. package/docs/admin-post-route.md +2 -0
  4. package/docs/ai-library.md +29 -2
  5. package/docs/common-mistakes.md +1 -1
  6. package/docs/environment-detection.md +87 -3
  7. package/docs/marketing-campaigns.md +1 -1
  8. package/docs/payment-system.md +1 -1
  9. package/docs/testing.md +60 -15
  10. package/package.json +1 -1
  11. package/src/cli/commands/install.js +2 -2
  12. package/src/cli/commands/setup.js +12 -4
  13. package/src/cli/commands/test.js +1 -1
  14. package/src/cli/index.js +6 -2
  15. package/src/defaults/CLAUDE.md +2 -2
  16. package/src/defaults/test/_init.js +14 -0
  17. package/src/manager/functions/_legacy/actions/create-post-handler.js +1 -1
  18. package/src/manager/functions/core/actions/api/admin/edit-post.js +1 -1
  19. package/src/manager/functions/core/actions/api/general/send-email.js +1 -1
  20. package/src/manager/functions/core/actions/api/user/delete.js +1 -1
  21. package/src/manager/functions/core/actions/api/user/oauth2.js +1 -1
  22. package/src/manager/helpers/analytics.js +3 -1
  23. package/src/manager/helpers/assistant.js +43 -38
  24. package/src/manager/index.js +76 -12
  25. package/src/manager/libraries/ai/index.js +33 -0
  26. package/src/manager/libraries/ai/providers/openai.js +105 -8
  27. package/src/manager/libraries/content/ghostii.js +76 -16
  28. package/src/manager/libraries/email/data/disposable-domains.json +23 -0
  29. package/src/manager/libraries/email/generators/lib/image-illustrator.js +154 -0
  30. package/src/manager/libraries/email/generators/newsletter.js +16 -2
  31. package/src/manager/libraries/payment/discount-codes.js +1 -0
  32. package/src/manager/routes/admin/post/put.js +1 -1
  33. package/src/manager/routes/handler/post/post.js +1 -1
  34. package/src/manager/routes/payments/intent/processors/test.js +1 -1
  35. package/src/manager/routes/user/delete.js +1 -1
  36. package/src/manager/routes/user/signup/post.js +4 -2
  37. package/src/test/runner.js +142 -20
  38. package/src/test/test-accounts.js +159 -102
  39. package/test/events/payments/journey-payments-cancel-endpoint.js +6 -2
  40. package/test/events/payments/journey-payments-cancel.js +6 -3
  41. package/test/events/payments/journey-payments-failure.js +6 -3
  42. package/test/events/payments/journey-payments-plan-change.js +6 -3
  43. package/test/events/payments/journey-payments-refund-webhook.js +6 -2
  44. package/test/events/payments/journey-payments-suspend.js +6 -3
  45. package/test/events/payments/journey-payments-trial-cancel.js +6 -3
  46. package/test/events/payments/journey-payments-trial.js +10 -4
  47. package/test/events/payments/journey-payments-uid-resolution.js +6 -2
  48. package/test/events/payments/journey-payments-upgrade.js +6 -3
  49. package/test/helpers/content/ghostii-blocks.js +134 -0
  50. package/test/helpers/environment.js +230 -0
  51. package/test/helpers/webhook-forward.js +26 -0
  52. package/test/routes/marketing/webhook-forward.js +14 -7
  53. package/test/routes/payments/cancel.js +4 -1
  54. package/test/routes/payments/dispute-alert.js +9 -6
  55. package/test/routes/payments/intent.js +55 -14
  56. package/test/routes/payments/portal.js +4 -1
  57. package/test/routes/payments/refund.js +4 -1
@@ -56,9 +56,12 @@ module.exports = {
56
56
 
57
57
  {
58
58
  name: 'succeeds-with-test-processor',
59
- async run({ http, assert, config, accounts, firestore, waitFor }) {
59
+ async run({ http, assert, config, accounts, firestore, waitFor, skip }) {
60
60
  const uid = accounts['journey-payments-portal-route'].uid;
61
61
  const paidProduct = config.payment.products.find(p => p.id !== 'basic' && p.prices?.monthly);
62
+ if (!paidProduct) {
63
+ skip('No paid product with monthly price configured in this brand');
64
+ }
62
65
 
63
66
  // Set up a paid subscription with the test processor
64
67
  const intentResponse = await http.as('journey-payments-portal-route').post('payments/intent', {
@@ -112,9 +112,12 @@ module.exports = {
112
112
 
113
113
  {
114
114
  name: 'succeeds-with-test-processor',
115
- async run({ http, assert, config, accounts, firestore, waitFor }) {
115
+ async run({ http, assert, config, accounts, firestore, waitFor, skip }) {
116
116
  const uid = accounts['route-refund-success'].uid;
117
117
  const paidProduct = config.payment.products.find(p => p.id !== 'basic' && p.prices?.monthly);
118
+ if (!paidProduct) {
119
+ skip('No paid product with monthly price configured in this brand');
120
+ }
118
121
 
119
122
  // Step 1: Create a test subscription intent to set up a proper paid subscription
120
123
  const intentResponse = await http.as('route-refund-success').post('payments/intent', {