Commit Graph

12802 Commits

Author SHA1 Message Date
Daniel Lockyer
ae94f82dc3
Updated Ghost-Admin to v4.2.1 2021-04-13 16:23:48 +01:00
Kevin Ansfield
ae1349c12d
🐛 Fixed markdown for linked images still being mangled in some cases
refs https://github.com/TryGhost/Team/issues/596
refs 95751a0e5f

- previous dependency bump of `@tryghost/url-utils` resulted in two versions being referenced in `yarn.lock` with the old buggy version still being used when performing URL transforms
- bumped `@tryghost/kg-default-cards` to up it's minimum allowed version of `@tryghost/url-utils` to force a `yarn.lock` update
- bumped `@tryghost/kg-markdown-html-renderer` to avoid two versions of that library being specified in `yarn.lock`
2021-04-13 16:18:47 +01:00
Kevin Ansfield
5a4ec50fea 🐛 Fixed markdown for linked images still being mangled in some cases
refs https://github.com/TryGhost/Team/issues/596
refs 95751a0e5f

- previous dependency bump of `@tryghost/url-utils` resulted in two versions being referenced in `yarn.lock` with the old buggy version still being used when performing URL transforms
- bumped `@tryghost/kg-default-cards` to up it's minimum allowed version of `@tryghost/url-utils` to force a `yarn.lock` update
- bumped `@tryghost/kg-markdown-html-renderer` to avoid two versions of that library being specified in `yarn.lock`
2021-04-13 15:58:46 +01:00
Hannah Wolfe
f247f6b3ef
Update ---bug-report.md 2021-04-13 10:53:36 +01:00
Rish
2c0d3b9b37 Added price and product models to members service
refs https://github.com/TryGhost/Team/issues/586

- Passes new Product, Stripe Price and Stripe Product models to members API service
- Allows members service to populate the tables for existing plans and products
2021-04-12 21:53:59 +05:30
Rish
5a659c9ebe Added models for stripe prices and products
refs https://github.com/TryGhost/Team/issues/586

Adds new models for stripe price and product tables
2021-04-12 21:53:59 +05:30
Rishabh Garg
eb66c715fd
Updated stripe prices table schema (#12863)
refs https://github.com/TryGhost/Team/issues/586

- Change the interval column to be `nullable` as one time payments won't have any interval
- Remove the `livemode` column as we store the connected account's livemode status at top level
2021-04-12 19:18:19 +05:30
Renovate Bot
fad527f7ba
Update dependency keypair to v1.0.3 2021-04-12 08:50:08 +00:00
Renovate Bot
e24b8ecb21
Update dependency eslint to v7.24.0 2021-04-09 23:29:58 +00:00
Thibaut Patel
44244871fe Added configurable limits to the theme management
issue https://github.com/TryGhost/Team/issues/590
2021-04-09 18:30:17 +02:00
Naz
b10cc5f62d Blocked webhooks when integration limit is in place
https://github.com/TryGhost/Team/issues/599

- When custom integration limit is enabled all webhooks belonging to integrations have to be disabled as well. The result is the webhook would stop working and to discover that a user would need to navigate to Admin UI (this changes is yet to come, see refed issue)
2021-04-10 00:48:46 +12:00
Naz
cb0807d07a Blocked requests from integrations when integration limit is in place
https://github.com/TryGhost/Team/issues/599

- When custom integration limit is enabled all requests from existing integrations should not be accepted. With the exception of internal integrations like backup and scheduler
2021-04-10 00:45:26 +12:00
Naz
edd0e26a78 Fixed limits realoding during soft Ghost restart
refs https://github.com/TryGhost/Team/issues/599

- This is a precursor change to tests which verify the hostSettings limits are working correctly
- Bumped limits-service version which allows for multiple calls of loadLimits on the same service instance
2021-04-10 00:08:17 +12:00
Naz
e5b13ee5d2 Added todo to users' schema to audit status field
no issue

- There is a valid subset of statuses that can be set for the users but there's no "isIn" validation for possible values
- Additionally some of the statuses like warn-1, warn-2, etc. don't have a clear usecase (or at least nothing was found in the codebase for them to be used). They might be up for removal if this assumption is correct
2021-04-09 18:59:38 +12:00
Fabien 'egg' O'Carroll
15b7485a94
Added Product model and Member model relation (#12859)
refs https://github.com/TryGhost/Team/issues/586

- Member model now has `products` relation, sorted using `sort_order`, following convention from `labels`
- Product model has handling to set `slug` from name, following convention of Label model
- Updated filter plugin to handle filtering Member models by their `product` relations e.g. `product:[slug, slug]`
2021-04-08 18:01:49 +01:00
Rishabh Garg
94766c05bf
Added stripe_products and stripe_prices tables (#12858)
refs https://github.com/TryGhost/Team/issues/586

- Add the `stripe_products` table, so that we can map Stripe Products to Products in Ghost
- Add the `stripe_prices` table, so that we can associate Stripe Prices to Products table
2021-04-08 20:41:00 +05:30
Fabien 'egg' O'Carroll
25182b7b82
Added products and members_products tables (#12844)
refs https://github.com/TryGhost/Team/issues/586

- Add the products table, so that we can store Products in Ghost 
- Add the members_products table, so that we can associate Members w/ Products
- Use sort_order on the members_products table to follow the same convention in members_labels
- Populate the products table with a single product, using the name from the stripe_product_name setting
- Populate the members_products table with relations based on the status column of the members table

Populating the tables allows us to transition from the current system, which does not care about products, into the
new system, where Products are used to group members. The intention is that all existing paid members have the
same product
2021-04-08 14:15:30 +01:00
Kevin Ansfield
bb19eddeae
Added DELETE /members/ to the Admin API for bulk member deletion (#12082)
refs https://github.com/TryGhost/Team/issues/585

- adds `DELETE /members/` route to the Admin API
- supports `?filter`, and `?search` query params to limit the members that are deleted
- `?all=true` is required if no other filter or query is provided
- uses `models.Member.bulkDestroy` which _will not_ cancel any Stripe subscriptions if members have them but _will_ clean up the Stripe relationship data in Ghost's database
2021-04-08 12:03:45 +01:00
Hannah Wolfe
c99dc2f0bc
Update ---bug-report.md 2021-04-07 08:57:20 +01:00
Naz
b677927322 Refactored api key auth to use async/await syntax
https://github.com/TryGhost/Team/issues/599

- Before introducing limit checks into this codebase rewrote the code to use async/await for more clarity and less nesting
2021-04-07 16:52:26 +12:00
Naz
42a3197f6d Updated dependency @tryghost/limit-service to v0.4.0
refs https://github.com/TryGhost/Team/issues/510

- This version bump includes follwing interface improvements of the limit-service package: passing in errors as a parameter to "loadLimits" and allowing for custom "currentCountQuery" method implementations per limit
2021-04-07 15:31:52 +12:00
Daniel Lockyer
efc674fda2
v4.2.0 2021-04-06 16:57:54 +01:00
Daniel Lockyer
ed6bb776ec
Updated Ghost-Admin to v4.2.0 2021-04-06 16:57:54 +01:00
Daniel Lockyer
ec26a35105
Updated Casper to v4.0.4 2021-04-06 16:57:51 +01:00
Rishabh Garg
dba2a2970b
Added migration to fix incorrect mrr events (#12837)
closes https://github.com/TryGhost/Team/issues/595

Due to a bug in `mrr_delta` calculation, we ended up reducing the MRR delta by twice the original amount when a subscription goes from active to canceled and storing it in `members_paid_subscription_events` table, which is used to show the MRR chart on Dashboard. The way we identify the incorrect events in the table which got the double negative value is by checking if they match certain criteria - Both `from_plan` and `to_plan` have same value as a subscription changes status while being on same plan.

This migration halves the `mrr_delta` for incorrect events to restore the correct MRR change for the site.
2021-04-06 21:14:54 +05:30
renovate[bot]
a6b3d5463d
🐛 Fixed incorrect MRR delta calculation (#12823)
refs https://github.com/TryGhost/Team/issues/595

The MRR delta calculation for subscription cancelation was incorrectly setting double negative of the original amount.

- Bumped to @tryghost/members-api@1.1.1 that includes the calculation fix
2021-04-06 19:54:28 +05:30
Renovate Bot
3861446c3d Update dependency cssnano to v4.1.11 2021-04-06 14:08:41 +01:00
Fabien 'egg' O'Carroll
2a2009e4cd
Bumped @tryghost/members-api & Portal versions (#12836)
closes https://github.com/TryGhost/Team/issues/530

This adds support for the smart_cancel option when cancelling
subscriptions, which will cancel the subscription immediately if it is
in an "overdue" state. The update to Portal wires up this behaviour for
members.
2021-04-05 16:29:17 +01:00
Renovate Bot
2111992dd4
Update dependency jsonpath to v1.1.1 2021-04-01 20:00:01 +00:00
Renovate Bot
e4f0e20943
Update dependency @tryghost/members-api to v1.1.0 2021-04-01 16:56:25 +00:00
Renovate Bot
e328f314a6
Update dependency @tryghost/helpers to v1.1.41 2021-04-01 14:56:45 +00:00
Renovate Bot
4e923302f6
Update dependency @sentry/node to v6.2.5 2021-04-01 12:25:18 +00:00
Daniel Lockyer
54a09842a6
Disabled automerging of @TryGhost dependencies
refs 865bc40be2

- we want to disable automerging of TryGhost dependencies into this
  repository, in order to allow merging with emojis in commits
- the referenced commit adds a preset which which is a packageRule
  to match TryGhost dependencies and disable `automergeNonMajor`
2021-04-01 13:19:41 +01:00
Renovate Bot
61edf00a1b Update dependency @tryghost/admin-api-schema to v2.0.2 2021-04-01 12:18:10 +00:00
Kevin Ansfield
95751a0e5f 🐛 Fixed markdown for linked images being mangled in some cases
refs https://github.com/TryGhost/Team/issues/596

Since Ghost 3.0, if a same-site image in a markdown card was linked to a same-site URL (eg: `![![Image Alt](/content/images/example.png)](/example-post)`) then the source markdown was mangled by the absolute/relative URL transforms.

- bumped `@tryghost/url-utils` to a fixed version (see https://github.com/TryGhost/SDK/pull/379)
2021-03-31 19:39:07 +01:00
Naz
f3a581ef7f Fixed v3 API config's billingUrl fetching
refs 26f56626ce

- The renamed was missed during the config rename host_settings -> hostSettings in the referenced commit.
2021-03-31 13:47:58 +13:00
Renovate Bot
4df59adcc6
Update dependency @sentry/node to v6.2.4 2021-03-30 14:38:42 +00:00
Renovate Bot
d43b80b60d
Update dependency ghost-ignition to v4.6.1 2021-03-30 11:38:09 +00:00
Naz
af6b73f085 Fixed typo in test case name 2021-03-30 17:54:53 +13:00
Naz
33a52d5850 Added test coverage for send_email in members API
no issue

- During an investigation of a possible Zapier bug discovered there was no coverage at all for sending emails for new member signups. This changeset adds coverage for basic case of `send_email` and `email_type` behavior
2021-03-30 17:54:53 +13:00
Rishabh Garg
72e8894eac
Cleaned old members stats endpoint (#12821)
no refs

- Removes old `/members/stats` endpoint in favor of new `/members/stats/count` in canary/v4 which captures members counts using new events table
- Removes tests for old `/members/stats` endpoint
- Added test for new `/members/stats/count` endpoint
2021-03-29 13:07:01 +05:30
Renovate Bot
7e51b90792
Update dependency eslint to v7.23.0 2021-03-26 22:24:13 +00:00
Matthew Schmoyer
4b0a990a75
Update contributing docs to reference main branch (#12815)
no issue
2021-03-25 11:05:14 +00:00
naz
ffd866cedc
💥 Reduced default exports content for DB APIs (#12818)
refs https://github.com/TryGhost/Team/issues/555

- Export files included a lot of data which was not used in the importer, for example: members,  labels, migrations and many more. This lead to a lot of clutter in the import files and made it hard to reason about their purpose.
- The main purpose of exports - is to export importable resources. These are posts, tags, and users. The rest of data like members or migrations either have their own importer (like CSV importer for members) or does not and should not have any ways to be imported.
- These changes are in now way complete. It's a first step towards resource-based exports which could be properly versioned in the future on API level and not be a mirror of the DB structure.
- This is sort of a breaking change. But we are doing it because: (1) its an internal API that should not be used by external clients, (2) there was no public contract to have this API stable at any point, (3) we really need to get back the control over export files structure and size
- In case an external client was dependent on some structure of the exported json file they can still pass in ALL of previously exported data by passing table names in `include` query parameter.
2021-03-25 19:27:49 +13:00
Naz
2d4a06023d Updated version check assertion in exporter test
refs https://github.com/TryGhost/Team/issues/555

-  This version is dynamic and depends on latest Ghsot version. It's unrealistic to expect test maintainer to update this version regularly, instead opted into checking the format of the version property
2021-03-25 17:16:18 +13:00
Naz
ea90e0a314 Fixed exporter unit test suite
refs https://github.com/TryGhost/Team/issues/555

-  Fixed "skipped" test which was useful to have for scenarios when "include" parameters are passed into exporter
- Also updated assertions to explicitly list calls to tables - these tests should break and should be fixed when exporter is modified!
2021-03-25 17:10:22 +13:00
Naz
aaa54c603c Refactored exporter to use "allowlist" table filtering
refs https://github.com/TryGhost/Team/issues/555

- Previous blocklist approach was resulting in adding every single new table into an export automatically. Which creates possibility to leak sensitive data if not used porperly. Allowlist approach gives better control over what is exported, makes this information explicit, and version-control friendlier
2021-03-25 16:46:56 +13:00
Naz
eccb15a988 Removed unecessaryly complex logic from exporter
refs https://github.com/TryGhost/Team/issues/555

- The getVersionAndTables was doing too much and was only used once creating clutter in doExport method. Refactored code doing 2 direct calls instead of destructuring "dances".
2021-03-25 15:27:39 +13:00
Naz
2e9ec65b63 Refactored exporter to use async/await
refs https://github.com/TryGhost/Team/issues/555

- async/await is much more readable and is a preferred style within the codebase
2021-03-25 15:27:39 +13:00
naz
7f50083cc5
Fixed node version specific object key sorting (#12817)
refs 74cdbadedb

- Fixes failing test by enforcing ordering through `sort()` call. Doing this to avoid differences between node versions' `Object.keys()` ordering
2021-03-25 15:16:24 +13:00