Commit Graph

2542 Commits

Author SHA1 Message Date
Naz
c627779948 Extracted email-content-generator into a package
refs https://github.com/TryGhost/Toolbox/issues/292

- Following the concept of having as little code in Ghost core as possible :) The email content generation is also needed to be reused in the version mismatch handling package.
2022-05-04 17:28:09 +08:00
Renovate Bot
7c992ef099
Update dependency express-jwt to v7.6.2 2022-05-03 15:17:44 +00:00
Renovate Bot
073b1f8dad Update dependency postcss to v8.4.13 2022-05-02 06:54:31 +01:00
Renovate Bot
e418630737
Update dependency mocha to v10 2022-05-02 01:29:26 +00:00
Renovate Bot
21b0ab0a8e
Update dependency express to v4.18.1 2022-04-29 21:07:20 +00:00
Simon Backx
104a0f5181
Fixed issue with new members always subscribing to defaults (#14629)
no issue

The member was updated when setting the geolocation, but that also included setting subscribed to true.
2022-04-28 13:21:38 +02:00
Daniel Lockyer
d5e7893212
Updated all @tryghost packages
- these packages contain minor code or dependency updates but we're
  forced to publish them because of Lerna
- this commit rolls up all pending updates into one commit to save noise
2022-04-28 11:54:29 +01:00
Renovate Bot
148779b74c Update dependency knex-migrator to v4.2.8 2022-04-28 11:24:13 +01:00
Renovate Bot
b58e7af65e Updated dependency express-jwt to v7
- also requires a small change to the imports to reflect an API change
2022-04-28 11:15:04 +01:00
Simon Backx
efdc42c257
Fixed bulk unsubscribe and updated member import tests (#14610)
refs https://github.com/TryGhost/Team/issues/1567

**Changes in members-api**
- Compare changes: https://github.com/TryGhost/Members/compare/%40tryghost/members-api%406.1.0...%40tryghost/members-api%406.2.2
- Fixed bulk unsubscribe
- Deletes the newsletter relations instead of setting subscribed to false

**Test fail fix**
refs https://github.com/TryGhost/Ghost/pull/14621
refs https://ghost.slack.com/archives/C02G9E68C/p1651126990299689?thread_ts=1651072733.859939&cid=C02G9E68C

- Events didn't always have the same created_at as created members
- This caused a test to fail randomly in the main repo

**Changes**
- Added required helpers for members-api package
- Version bumps of other packages are only tooling related

**Tests**
- Tests if member import still works with the legacy `subscribed` flag
- Updated member importer to use multipleNewsletters flag
- Dropped legacy members tests
2022-04-28 09:50:05 +02:00
Renovate Bot
ad2903a196
Update dependency sqlite3 to v5.0.6 2022-04-27 21:40:10 +00:00
Fabien 'egg' O'Carroll
810c3077e8
Wired up LimitService to NewsletterService (#14602)
refs https://github.com/TryGhost/Team/issues/1549

This allows us to restrict certain sites to a single newsletter
2022-04-27 17:44:16 +01:00
Simon Backx
21af34a0d4
Added mapping from member subscribed to newsletters on edit/create (#14596)
refs https://github.com/TryGhost/Team/issues/1545

**Changes (`members-api`)**
- Compare via https://github.com/TryGhost/Members/compare/%40tryghost/members-api%406.0.0...%40tryghost/members-api%406.1.0
- Added mapping from member subscribed to newsletters on edit/create
- When editing or creating a member with the subscribed property, it is mapped to the corresponding newletters value
- Defaults to all active newsletters with visibility = members and subscribe_on_signup = true

**Tests**
- Adds test that adds a member with subscribed = true
- Adds test that adds a member with subscribed = false
- Adds test that edits a member with subscribed = true
- Adds test that edits a member with subscribed = false
2022-04-27 17:04:55 +02:00
Simon Backx
2cf76cb031
Added newsletter relation to subscribe events (#14585)
refs https://github.com/TryGhost/Team/issues/1478

**Changes**
- Added the newsletter relation to subscribe events

**Changes in `members-api`**
- Compare: https://github.com/TryGhost/Members/compare/%40tryghost/members-api%406.0.0-alpha.0...%40tryghost/members-api%406.0.0
- Makes sure the newsletter relation is returned in the activity feed for susbcribe events (aka newsletter events).

**Tests**
- Added first test for activity feed to check if the newsletter relation is correctly fetched
2022-04-27 16:44:27 +02:00
Fabien 'egg' O'Carroll
d94859f2e5
Added /stats/subscriptions API (#14547)
refs https://github.com/TryGhost/Team/issues/1505
refs https://github.com/TryGhost/Team/issues/1466

Exposes an API for historical counts broken down by tier and cadence.

Counts backwards from the current stats like MRR to minimize inaccruate
data due to missing/superfluous events.
2022-04-27 14:53:32 +01:00
Renovate Bot
0a5fb7166a Update dependency supertest to v6.2.3 2022-04-27 06:49:47 +01:00
Renovate Bot
eec0c502d9
Update dependency @sentry/node to v6.19.7 2022-04-26 16:27:46 +00:00
Renovate Bot
2d08324238 Update dependency grunt-contrib-clean to v2.0.1 2022-04-26 17:25:59 +01:00
Renovate Bot
863c409ca3 Update dependency @playwright/test to v1.21.1 2022-04-26 17:25:39 +01:00
Renovate Bot
2a5af9c0c5 Update dependency jwks-rsa to v2.1.0 2022-04-26 17:21:23 +01:00
Daniel Lockyer
6747f3a93a Updated @tryghost packages
- these packages contain only code changes or dependency updates but
  we're force to publish new versions due to Lerna's limitations
- this commit bulk updates the packages to save having many commits
2022-04-26 16:54:44 +01:00
Daniel Lockyer
1122ce9cc6
🐛 Fixed credentials issue with SES mail transport
refs 58ace0af76

- please see the referenced commit above for full context but this
  commit bumps `@tryghost/nodemailer`, which contains a fix for reading
  credentials when using the SES mail transport
- credits to @touzoku
2022-04-26 16:40:45 +01:00
Renovate Bot
37f17f9dca Update dependency coffeescript to v2.7.0 2022-04-26 16:29:41 +01:00
Renovate Bot
6937b637ec Update dependency eslint to v8.14.0 2022-04-26 16:29:19 +01:00
Simon Backx
32b0f69e55 Added newsletters to subscribe events (#14579)
refs https://github.com/TryGhost/Team/issues/1478

- Moved all admin API members tests to enable the multiple newsletters flag
- Checks if the susbcribe events are added correctly when adding or removing newsletters
- Checks if susbcribe events are added for default newsletters
2022-04-26 12:31:34 +01:00
Thibaut Patel
48799e1c68 Added the newsletter API ?include=count.posts and ?include=count.members query options (#14525)
refs https://github.com/TryGhost/Team/issues/1524

- This enables admins in the ghost admin to have an overview of the total posts/members associated with a newsletter.
- Follows the `?include=count.x` convention used by other resources
2022-04-26 12:31:34 +01:00
Renovate Bot
65c2958f2a
Update dependency express to v4.18.0 2022-04-25 21:12:45 +00:00
Renovate Bot
5bd44a05da Update dependency glob to v8 2022-04-22 13:53:15 +01:00
Renovate Bot
98c4956ff4 Update dependency c8 to v7.11.2 2022-04-22 13:51:14 +01:00
renovate[bot]
24d3b7cfd3
Pinned dependency @tryghost/stats-service to v0.1.0 (#14528)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-04-22 13:47:19 +01:00
Daniel Lockyer
d0553331db
Switched to commit hash for TryGhost/mock-knex
- I had to fork this dependency to add support for Knex 2.0 but yarn is
  weird and won't bump it if we use `master` because "nothing changed"
- Using a hash should force yarn to pull the changes if the hash gets
  updated
2022-04-22 12:24:02 +01:00
Daniel Lockyer
a394a00618
Fixed date-fns missing as a dependency declaration
refs fccee0614f

- `@tryghost/nql-lang` had `date-fns` declared as a devDependency but it
  was used within the library itself
- the referenced commit moved it to `dependencies` and this commit bumps
  the packages in Ghost
2022-04-22 11:41:48 +01:00
Daniel Lockyer
bead1bbe14 ℹ️ Fixed common build issues with SQLite
- we had to switch to `@vscode/sqlite3` a while back because `sqlite3`
  was unmaintained
- this fork didn't come with prebuilt binaries, so everyone had to
  compile them on their machine
- this brought a lot of issues with installing Ghost
- since then, the Ghost team have picked up maintenance of `sqlite3` and
  Knex has switched back, so we can switch back here too
2022-04-22 10:24:42 +01:00
Naz
7b9a80fbf4 Extracted data access code to external module
refs https://github.com/TryGhost/Toolbox/issues/280

- Keeps the code in the core to the minimum. Ideally we should not be adding any logic apart form "hooking things together"
2022-04-22 16:31:56 +08:00
Naz
b7189a99e4 Added support for version missmatch handling
refs https://github.com/TryGhost/Toolbox/issues/280

- Email notification handling logic needs to be added to Ghost. Ideally there should be as little code landing in the core as possible - mostly data fetching and hooking modules together.
- The primary email handling logic for the `Accept-Version`/`Conent-Version` header missmatch is done in `api-version-compatibility-service` module, and the `mw-api-version-mismatch` allows to intercept request with the missmatch and call the api version compatibility service to do it's job. The mw-error-handler gives each case of client BEHIND or AHEAD of the Ghost version a unique error code, so that the versioning compatibility service has data to distinguish different cases
2022-04-22 16:31:56 +08:00
Renovate Bot
2bde20b7de Update dependency sinon to v13.0.2 2022-04-21 16:32:08 +00:00
Fabien 'egg' O'Carroll
19a08cd11d
Replaced stats service with @tryghost/stats-service (#14527)
- Pulls logic out of Ghost core and into the Analytics repository.
- Test coverage has increased for the stats service
- Interface simplified
2022-04-21 14:57:07 +01:00
Simon Backx
b9646cceb1
Updated members API to return subscriptions' offers from the offer_id (#14515)
refs https://github.com/TryGhost/Team/issues/1520

**Changes in members repo**

Bumped to `5.12.0`, with the following changes:

- Compare differences via https://github.com/TryGhost/Members/compare/%40tryghost/members-api%405.11.1...%40tryghost/members-api%405.12.0
- Instead of doing the matching of the offers and subscriptions by looking at the offer redemptions, we can now look at the offer_id from subscriptions.
- This also fixes an issue where we don't attach the offer object to subscriptions in the members' browse method
- Updated browse behaviour to match the read behaviour of members (product relation needs to get loaded because it is missing in member.products if the subscription is expired).

**Tests**
- Includes test to see if the API correctly returns the offer object when fetching one or multiple members
- Check if the return format is the same for the read, edit and browse members admin API endpoints (offer was missing in subscriptions)
- Snapshot files have been updated because now the offer is returned in subscriptions (content length increased)
2022-04-21 12:06:06 +02:00
Renovate Bot
065078c397
Update dependency express-jwt to v6.1.2 2022-04-20 18:02:43 +00:00
Simon Backx
0c72e78e6a
Stored offer_id in subscriptions (#14488)
refs https://github.com/TryGhost/Team/issues/1519

**Tests:**
- Tests whether the metadata from an offer is read correctly and stored in the database
- Test that invalid offer ids are ignored

**Changes in members repository:** 
- Compare changes here: https://github.com/TryGhost/Members/compare/%40tryghost/members-api%405.9.2...%40tryghost/members-api%405.11.1
- The `offer_id` column of subscriptions is set based on the coupon id from Stripe
- `getByStripeCouponId` method added in the offers repository (required to look up an offer from a stripe_coupon_id)
- the `members-payments` package was bumped twice (once for changes, once for undoing those changes, my bad). Nothing else has changed in that package.
2022-04-19 17:06:53 +02:00
Renovate Bot
ad45773d70
Update dependency fs-extra to v10.1.0 2022-04-18 15:32:12 +00:00
Renovate Bot
6db2e411ea
Update dependency luxon to v2.3.2 2022-04-18 08:21:52 +00:00
Rishabh Garg
88ed60d079
Updated default newsletter subscription logic for members (#14482)
refs https://github.com/TryGhost/Team/issues/1469

Previously, members were subscribed to all available newsletters by default when added. This change updates the default newsletters subscription for member to take into account newsletter preferences for auto opt-in(`subscribe_on_signup`) as well as `visibility`.
2022-04-18 13:48:44 +05:30
Renovate Bot
a1fdda51d8 Update dependency nconf to v0.12.0 2022-04-15 07:22:40 +01:00
renovate[bot]
dec282345f
Update dependency @tryghost/members-importer to v0.5.8 (#14421)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-04-14 14:57:44 +01:00
renovate[bot]
11c495276d
Update dependency @tryghost/members-api to v5.9.1 (#14425)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-04-14 14:38:26 +01:00
renovate[bot]
fe5afb6196
Update dependency @tryghost/verification-trigger to v0.2.0 (#14477)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-04-14 14:37:41 +01:00
Renovate Bot
cc26c9aa9f Update dependency knex to v1.0.7 2022-04-14 12:55:04 +01:00
Rishabh Garg
c6da6afc9e
Handled members newsletter preference on signup (#14473)
refs https://github.com/TryGhost/Team/issues/1490

With multiple newsletters, members can choose their newsletter subscription preference in Portal while signing up. This change handles newsletter preference data for both free and paid members via magic link/stripe checkout and saves it for the newly created member.
2022-04-13 20:02:45 +05:30
Thibaut Patel
7a55e1a60a
Added the newsletter_id query string to the post edit API route (#14449)
refs https://github.com/TryGhost/Team/issues/1502

- Support the `newsletter_id` only when sending a newsletter
- Default to the default newsletter when `newsletter_id` isn't specified
- Ignore the `newsletter_id` parameter when passed in the post body
2022-04-13 15:27:43 +02:00