Ghost/core/server/models
Kevin Ansfield afbe0c27fb
🐛 Fixed __GHOST_URL__ appearing in sitemaps (#12787)
closes https://github.com/TryGhost/Team/issues/552

Refactors URL transforms so they take place at the model layer rather than the API serializer layer. Continuation of the pattern created for the settings model in https://github.com/TryGhost/Ghost/pull/12738

- Added checks to all front-end tests to ensure output does not contain the magic replacement string
  - includes failing acceptance test for `__GHOST_URL__` appearing in sitemaps
- Removed all transform-ready URL transforms from API serializers
  - input serializers transform image urls relative->absolute to keep absolute-urls as the consistent "outside of the database" format
  - output serializers should not need to perform any URL transforms as that will be done at the model layer
- Added url transforms to models layer
  - removes knowledge from the API serializers which shouldn't need to know how data is stored internally in the database
  - makes absolute urls the consistent "outside of the database" URL format
  - adds transform step to the sitemap generator because the data used for that is fetched directly via knex which will not run through the bookshelf `parse()` methods
2021-03-18 17:16:37 +00:00
..
base Added unique constraint notation to schema definition 2021-02-04 13:37:20 +13:00
plugins Added email.open_rate order option to posts api (#12439) 2020-12-03 20:13:37 +00:00
relations Extracted promise libs and history into @tryghost/promise 2020-08-11 18:44:21 +01:00
action.js Added model implementation for actions 2019-02-06 21:36:09 +01:00
api-key.js Added the user_id field to the api_keys table 2020-11-20 09:53:18 +01:00
author.js Added plugin based author and public tag models in API v2 (#10284) 2019-01-03 20:30:35 +01:00
email-batch.js Fixed creation of EmailBatch and EmailRecipient collections 2020-10-14 15:11:45 +01:00
email-recipient.js Removed unnecessary bookshelf-relations config in EmailRecipient model 2021-01-05 15:28:30 +00:00
email.js Added migrations for email analytics (#12387) 2020-11-25 17:48:24 +00:00
index.js Added MemberPaidSubscriptionEvent model 2021-02-12 13:55:14 +00:00
integration.js Updated host config to correctly use camelCase 2021-03-04 11:39:32 +00:00
invite.js 🐛 Allowed for inviting contributors when staff is limited 2021-03-15 11:40:44 +00:00
label.js Refactored common lib import to use destructuring (#11835) 2020-05-22 19:22:20 +01:00
member-email-change-event.js Added member relation to events (#12656) 2021-02-16 16:14:20 +00:00
member-login-event.js Added member relation to events (#12656) 2021-02-16 16:14:20 +00:00
member-paid-subscription-event.js Added member relation to events (#12656) 2021-02-16 16:14:20 +00:00
member-payment-event.js Added member relation to events (#12656) 2021-02-16 16:14:20 +00:00
member-status-event.js Fixed member status events query 2021-02-18 18:11:50 +05:30
member-stripe-customer.js Added error handling for failed member imports 2020-08-26 17:11:35 +12:00
member-subscribe-event.js Added member relation to events (#12656) 2021-02-16 16:14:20 +00:00
member.js 🐛 Fixed Member model removing labels when unset 2021-02-08 09:39:46 +00:00
mobiledoc-revision.js Added mobiledoc revisions functionality 2018-10-09 15:31:09 +02:00
permission.js Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00
post.js 🐛 Fixed __GHOST_URL__ appearing in sitemaps (#12787) 2021-03-18 17:16:37 +00:00
posts-meta.js 🐛 Fixed __GHOST_URL__ appearing in sitemaps (#12787) 2021-03-18 17:16:37 +00:00
role.js Refactored common lib import to use destructuring (#11835) 2020-05-22 19:22:20 +01:00
session.js Removed user_id constraint when upserting session (#10085) 2018-10-30 16:15:48 +07:00
settings.js Fixed __GHOST_URL__ appearing in settings values after edit (#12738) 2021-03-08 18:41:43 +00:00
single-use-token.js 🐛 Added multiple use grace period to tokens (#12519) 2021-01-18 17:03:41 +00:00
snippet.js 🐛 Fixed __GHOST_URL__ appearing in sitemaps (#12787) 2021-03-18 17:16:37 +00:00
stripe-customer-subscription.js Removed hardcoded currency symbols (#12700) 2021-02-25 09:49:07 +00:00
tag-public.js Added plugin based author and public tag models in API v2 (#10284) 2019-01-03 20:30:35 +01:00
tag.js 🐛 Fixed __GHOST_URL__ appearing in sitemaps (#12787) 2021-03-18 17:16:37 +00:00
user.js 🐛 Fixed __GHOST_URL__ appearing in sitemaps (#12787) 2021-03-18 17:16:37 +00:00
webhook.js Bumped webhook API defaults to v4 2021-03-02 12:31:52 +13:00