ghost 5.17.2 → 5.19.0

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 (190) hide show
  1. package/README.md +3 -3
  2. package/components/tryghost-adapter-manager-5.19.0.tgz +0 -0
  3. package/components/{tryghost-api-framework-5.17.2.tgz → tryghost-api-framework-5.19.0.tgz} +0 -0
  4. package/components/tryghost-api-version-compatibility-service-5.19.0.tgz +0 -0
  5. package/components/tryghost-audience-feedback-5.19.0.tgz +0 -0
  6. package/components/tryghost-bootstrap-socket-5.19.0.tgz +0 -0
  7. package/components/tryghost-constants-5.19.0.tgz +0 -0
  8. package/components/{tryghost-custom-theme-settings-service-5.17.2.tgz → tryghost-custom-theme-settings-service-5.19.0.tgz} +0 -0
  9. package/components/tryghost-domain-events-5.19.0.tgz +0 -0
  10. package/components/tryghost-email-analytics-provider-mailgun-5.19.0.tgz +0 -0
  11. package/components/tryghost-email-analytics-service-5.19.0.tgz +0 -0
  12. package/components/tryghost-email-content-generator-5.19.0.tgz +0 -0
  13. package/components/tryghost-express-dynamic-redirects-5.19.0.tgz +0 -0
  14. package/components/tryghost-extract-api-key-5.19.0.tgz +0 -0
  15. package/components/tryghost-html-to-plaintext-5.19.0.tgz +0 -0
  16. package/components/tryghost-job-manager-5.19.0.tgz +0 -0
  17. package/components/tryghost-link-redirects-5.19.0.tgz +0 -0
  18. package/components/tryghost-link-replacer-5.19.0.tgz +0 -0
  19. package/components/tryghost-link-tracking-5.19.0.tgz +0 -0
  20. package/components/tryghost-magic-link-5.19.0.tgz +0 -0
  21. package/components/tryghost-mailgun-client-5.19.0.tgz +0 -0
  22. package/components/tryghost-member-analytics-service-5.19.0.tgz +0 -0
  23. package/components/tryghost-member-attribution-5.19.0.tgz +0 -0
  24. package/components/tryghost-member-events-5.19.0.tgz +0 -0
  25. package/components/tryghost-members-analytics-ingress-5.19.0.tgz +0 -0
  26. package/components/tryghost-members-api-5.19.0.tgz +0 -0
  27. package/components/tryghost-members-csv-5.19.0.tgz +0 -0
  28. package/components/tryghost-members-events-service-5.19.0.tgz +0 -0
  29. package/components/tryghost-members-importer-5.19.0.tgz +0 -0
  30. package/components/tryghost-members-offers-5.19.0.tgz +0 -0
  31. package/components/tryghost-members-payments-5.19.0.tgz +0 -0
  32. package/components/tryghost-members-ssr-5.19.0.tgz +0 -0
  33. package/components/tryghost-members-stripe-service-5.19.0.tgz +0 -0
  34. package/components/tryghost-minifier-5.19.0.tgz +0 -0
  35. package/components/tryghost-mw-api-version-mismatch-5.19.0.tgz +0 -0
  36. package/components/tryghost-mw-cache-control-5.19.0.tgz +0 -0
  37. package/components/{tryghost-mw-error-handler-5.17.2.tgz → tryghost-mw-error-handler-5.19.0.tgz} +0 -0
  38. package/components/tryghost-mw-session-from-token-5.19.0.tgz +0 -0
  39. package/components/tryghost-mw-update-user-last-seen-5.19.0.tgz +0 -0
  40. package/components/tryghost-mw-vhost-5.19.0.tgz +0 -0
  41. package/components/tryghost-oembed-service-5.19.0.tgz +0 -0
  42. package/components/tryghost-package-json-5.19.0.tgz +0 -0
  43. package/components/tryghost-referrers-5.19.0.tgz +0 -0
  44. package/components/tryghost-security-5.19.0.tgz +0 -0
  45. package/components/tryghost-session-service-5.19.0.tgz +0 -0
  46. package/components/tryghost-settings-path-manager-5.19.0.tgz +0 -0
  47. package/components/tryghost-staff-service-5.19.0.tgz +0 -0
  48. package/components/tryghost-stats-service-5.19.0.tgz +0 -0
  49. package/components/tryghost-update-check-service-5.19.0.tgz +0 -0
  50. package/components/tryghost-verification-trigger-5.19.0.tgz +0 -0
  51. package/components/tryghost-version-notifications-data-service-5.19.0.tgz +0 -0
  52. package/content/themes/casper/assets/built/screen.css +1 -1
  53. package/content/themes/casper/assets/built/screen.css.map +1 -1
  54. package/content/themes/casper/assets/css/screen.css +18 -21
  55. package/content/themes/casper/package.json +1 -1
  56. package/core/boot.js +3 -1
  57. package/core/built/admin/assets/{chunk.143.3f2f5cbbd1ef4b1425d9.js → chunk.143.eaf838fbf1470f018bf3.js} +6 -6
  58. package/core/built/admin/assets/{chunk.174.37fefc669899f0fd0064.js → chunk.174.3a133d51d9b45097c101.js} +160 -159
  59. package/core/built/admin/assets/{chunk.178.8fa31be80e639cbd2df2.js → chunk.178.44dae8a74f7f9d606e06.js} +4 -4
  60. package/core/built/admin/assets/{chunk.579.a9bccec4d650a7be727a.js → chunk.613.f1d519ad47e7f9024263.js} +8962 -8890
  61. package/core/built/admin/assets/{chunk.579.a9bccec4d650a7be727a.js.LICENSE.txt → chunk.613.f1d519ad47e7f9024263.js.LICENSE.txt} +0 -0
  62. package/core/built/admin/assets/{ghost-3577dfa3f54651db5ae5b9fd3d9b2824.js → ghost-5ce6f5a730c83c91fc258b12c537ea35.js} +2905 -2866
  63. package/core/built/admin/assets/ghost-982146a4ada3a5af1981d1919ae01d08.css +1 -0
  64. package/core/built/admin/assets/ghost-dark-41929e4857de411a23597a9de49a4e4f.css +1 -0
  65. package/core/built/admin/assets/{vendor-733135cd6cbca8126c6fa223d63a5bf3.css → vendor-3e6947aa681f0fb82b193090e520dc73.css} +24 -92
  66. package/core/built/admin/assets/{vendor-325e038b8609f0979f6578cae7a87f9e.js → vendor-5c7d7063620bec13668c4370145cd4b4.js} +561 -555
  67. package/core/built/admin/index.html +7 -7
  68. package/core/frontend/helpers/t.js +12 -0
  69. package/core/frontend/helpers/tpl/content-cta.hbs +1 -1
  70. package/core/frontend/public/ghost.min.css +1 -1
  71. package/core/frontend/public/robots.txt +1 -0
  72. package/core/frontend/services/sitemap/handler.js +1 -1
  73. package/core/frontend/services/sitemap/index-generator.js +1 -3
  74. package/core/frontend/web/middleware/static-theme.js +2 -0
  75. package/core/server/api/endpoints/feedback-members.js +23 -0
  76. package/core/server/api/endpoints/index.js +5 -1
  77. package/core/server/api/endpoints/utils/serializers/input/posts.js +3 -3
  78. package/core/server/api/endpoints/utils/serializers/output/mappers/posts.js +14 -13
  79. package/core/server/data/exporter/table-lists.js +3 -1
  80. package/core/server/data/importer/handlers/json.js +21 -23
  81. package/core/server/data/importer/importers/data/base.js +1 -1
  82. package/core/server/data/migrations/versions/4.0/05-add-members-subscribe-events-table.js +1 -1
  83. package/core/server/data/migrations/versions/4.0/06-populate-members-subscribe-events-table.js +1 -1
  84. package/core/server/data/migrations/versions/4.0/11-add-members-paid-subscription-events-table.js +1 -1
  85. package/core/server/data/migrations/versions/4.0/13-add-members-payment-events-table.js +1 -1
  86. package/core/server/data/migrations/versions/4.0/17-populate-members-status-events-table.js +1 -1
  87. package/core/server/data/migrations/versions/4.0/22-solve-orphaned-webhooks.js +1 -1
  88. package/core/server/data/migrations/versions/4.0/25-populate-members-paid-subscription-events-table.js +1 -1
  89. package/core/server/data/migrations/versions/4.11/02-add-email-verification-required-setting.js +1 -1
  90. package/core/server/data/migrations/versions/4.12/01-add-email-only-column-to-posts-meta-table.js +1 -1
  91. package/core/server/data/migrations/versions/4.3/03-add-default-product.js +1 -1
  92. package/core/server/data/migrations/versions/4.3/04-attach-members-to-product.js +1 -1
  93. package/core/server/data/migrations/versions/4.3/06-add-stripe-prices-table.js +2 -2
  94. package/core/server/data/migrations/versions/4.3/08-migrate-members-signup-setting.js +1 -1
  95. package/core/server/data/migrations/versions/4.33/2022-01-14-11-51-add-default-free-tier.js +1 -1
  96. package/core/server/data/migrations/versions/4.42/2022-03-21-17-17-add.js +2 -2
  97. package/core/server/data/migrations/versions/4.43/2022-03-28-19-26-recreate-newsletter-table.js +5 -5
  98. package/core/server/data/migrations/versions/4.46/2022-04-13-13-00-add-default-newsletter.js +1 -1
  99. package/core/server/data/migrations/versions/4.46/2022-04-20-08-39-map-subscribers-to-default-newsletter.js +1 -1
  100. package/core/server/data/migrations/versions/4.7/03-add-labs-setting.js +1 -1
  101. package/core/server/data/migrations/versions/4.8/03-add-default-product-portal-products.js +1 -1
  102. package/core/server/data/migrations/versions/4.8/04-migrate-show-newsletter-header-setting.js +1 -1
  103. package/core/server/data/migrations/versions/5.0/2022-05-06-13-22-add-frontend-integration.js +1 -1
  104. package/core/server/data/migrations/versions/5.17/2022-09-29-12-39-add-track-clicks-column-to-emails.js +2 -2
  105. package/core/server/data/migrations/versions/5.19/2022-09-02-20-25-add-columns-to-products-table.js +19 -0
  106. package/core/server/data/migrations/versions/5.19/2022-09-02-20-52-backfill-new-product-columns.js +37 -0
  107. package/core/server/data/migrations/versions/5.19/2022-10-10-06-58-add-subscriptions-table.js +19 -0
  108. package/core/server/data/migrations/versions/5.19/2022-10-10-10-05-add-members-feedback-table.js +10 -0
  109. package/core/server/data/migrations/versions/5.19/2022-10-11-10-38-add-feedback-enabled-column-to-newsletters.js +7 -0
  110. package/core/server/data/schema/commands.js +3 -3
  111. package/core/server/data/schema/fixtures/fixtures.json +4 -1
  112. package/core/server/data/schema/schema.js +90 -24
  113. package/core/server/data/schema/validator.js +1 -1
  114. package/core/server/models/base/bookshelf.js +3 -4
  115. package/core/server/models/base/plugins/data-manipulation.js +1 -1
  116. package/core/server/models/base/plugins/events.js +1 -1
  117. package/core/server/models/base/utils.js +1 -1
  118. package/core/server/models/member-feedback.js +22 -0
  119. package/core/server/models/newsletter.js +3 -2
  120. package/core/server/models/post.js +24 -0
  121. package/core/server/models/settings.js +1 -1
  122. package/core/server/models/user.js +1 -1
  123. package/core/server/services/audience-feedback/FeedbackRepository.js +67 -0
  124. package/core/server/services/audience-feedback/index.js +33 -0
  125. package/core/server/services/bulk-email/bulk-email-processor.js +7 -1
  126. package/core/server/services/mail/GhostMailer.js +17 -1
  127. package/core/server/services/mega/feedback-buttons.js +69 -0
  128. package/core/server/services/mega/mega.js +1 -1
  129. package/core/server/services/mega/post-email-serializer.js +24 -4
  130. package/core/server/services/mega/template.js +3 -0
  131. package/core/server/services/members/middleware.js +40 -0
  132. package/core/server/services/notifications/notifications.js +1 -1
  133. package/core/server/services/settings/settings-service.js +1 -1
  134. package/core/server/services/themes/storage.js +1 -1
  135. package/core/server/services/webhooks/serialize.js +1 -1
  136. package/core/server/web/admin/app.js +2 -0
  137. package/core/server/web/api/endpoints/admin/routes.js +1 -2
  138. package/core/server/web/members/app.js +12 -0
  139. package/core/shared/config/defaults.json +1 -1
  140. package/core/shared/labs.js +6 -4
  141. package/package.json +117 -117
  142. package/yarn.lock +4867 -1572
  143. package/components/tryghost-adapter-manager-5.17.2.tgz +0 -0
  144. package/components/tryghost-api-version-compatibility-service-5.17.2.tgz +0 -0
  145. package/components/tryghost-bootstrap-socket-5.17.2.tgz +0 -0
  146. package/components/tryghost-constants-5.17.2.tgz +0 -0
  147. package/components/tryghost-domain-events-5.17.2.tgz +0 -0
  148. package/components/tryghost-email-analytics-provider-mailgun-5.17.2.tgz +0 -0
  149. package/components/tryghost-email-analytics-service-5.17.2.tgz +0 -0
  150. package/components/tryghost-email-content-generator-5.17.2.tgz +0 -0
  151. package/components/tryghost-express-dynamic-redirects-5.17.2.tgz +0 -0
  152. package/components/tryghost-extract-api-key-5.17.2.tgz +0 -0
  153. package/components/tryghost-html-to-plaintext-5.17.2.tgz +0 -0
  154. package/components/tryghost-job-manager-5.17.2.tgz +0 -0
  155. package/components/tryghost-link-redirects-5.17.2.tgz +0 -0
  156. package/components/tryghost-link-replacer-5.17.2.tgz +0 -0
  157. package/components/tryghost-link-tracking-5.17.2.tgz +0 -0
  158. package/components/tryghost-magic-link-5.17.2.tgz +0 -0
  159. package/components/tryghost-mailgun-client-5.17.2.tgz +0 -0
  160. package/components/tryghost-member-analytics-service-5.17.2.tgz +0 -0
  161. package/components/tryghost-member-attribution-5.17.2.tgz +0 -0
  162. package/components/tryghost-member-events-5.17.2.tgz +0 -0
  163. package/components/tryghost-members-analytics-ingress-5.17.2.tgz +0 -0
  164. package/components/tryghost-members-api-5.17.2.tgz +0 -0
  165. package/components/tryghost-members-csv-5.17.2.tgz +0 -0
  166. package/components/tryghost-members-events-service-5.17.2.tgz +0 -0
  167. package/components/tryghost-members-importer-5.17.2.tgz +0 -0
  168. package/components/tryghost-members-offers-5.17.2.tgz +0 -0
  169. package/components/tryghost-members-payments-5.17.2.tgz +0 -0
  170. package/components/tryghost-members-ssr-5.17.2.tgz +0 -0
  171. package/components/tryghost-members-stripe-service-5.17.2.tgz +0 -0
  172. package/components/tryghost-minifier-5.17.2.tgz +0 -0
  173. package/components/tryghost-mw-api-version-mismatch-5.17.2.tgz +0 -0
  174. package/components/tryghost-mw-cache-control-5.17.2.tgz +0 -0
  175. package/components/tryghost-mw-session-from-token-5.17.2.tgz +0 -0
  176. package/components/tryghost-mw-update-user-last-seen-5.17.2.tgz +0 -0
  177. package/components/tryghost-mw-vhost-5.17.2.tgz +0 -0
  178. package/components/tryghost-oembed-service-5.17.2.tgz +0 -0
  179. package/components/tryghost-package-json-5.17.2.tgz +0 -0
  180. package/components/tryghost-referrers-5.17.2.tgz +0 -0
  181. package/components/tryghost-security-5.17.2.tgz +0 -0
  182. package/components/tryghost-session-service-5.17.2.tgz +0 -0
  183. package/components/tryghost-settings-path-manager-5.17.2.tgz +0 -0
  184. package/components/tryghost-staff-service-5.17.2.tgz +0 -0
  185. package/components/tryghost-stats-service-5.17.2.tgz +0 -0
  186. package/components/tryghost-update-check-service-5.17.2.tgz +0 -0
  187. package/components/tryghost-verification-trigger-5.17.2.tgz +0 -0
  188. package/components/tryghost-version-notifications-data-service-5.17.2.tgz +0 -0
  189. package/core/built/admin/assets/ghost-597fb8e8b1b91dd0ac4d9f2d75bd67fb.css +0 -1
  190. package/core/built/admin/assets/ghost-dark-e4ccecd9903d35d360d71fe859cbb3bf.css +0 -1
@@ -8,7 +8,7 @@
8
8
  <title>Ghost Admin</title>
9
9
 
10
10
 
11
- <meta name="ghost-admin/config/environment" content="%7B%22modulePrefix%22%3A%22ghost-admin%22%2C%22environment%22%3A%22production%22%2C%22rootURL%22%3A%22%22%2C%22locationType%22%3A%22trailing-hash%22%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%2C%22EXTEND_PROTOTYPES%22%3A%7B%22Date%22%3Afalse%2C%22Array%22%3Atrue%2C%22String%22%3Atrue%2C%22Function%22%3Afalse%7D%2C%22_APPLICATION_TEMPLATE_WRAPPER%22%3Afalse%2C%22_JQUERY_INTEGRATION%22%3Atrue%2C%22_TEMPLATE_ONLY_GLIMMER_COMPONENTS%22%3Atrue%7D%2C%22APP%22%3A%7B%22version%22%3A%225.17%22%2C%22name%22%3A%22ghost-admin%22%7D%2C%22ember-simple-auth%22%3A%7B%7D%2C%22%40sentry%2Fember%22%3A%7B%22disablePerformance%22%3Atrue%2C%22sentry%22%3A%7B%7D%7D%2C%22ember-cli-mirage%22%3A%7B%22usingProxy%22%3Afalse%2C%22useDefaultPassthroughs%22%3Atrue%7D%2C%22exportApplicationGlobal%22%3Afalse%2C%22ember-load%22%3A%7B%22loadingIndicatorClass%22%3A%22ember-load-indicator%22%7D%7D" />
11
+ <meta name="ghost-admin/config/environment" content="%7B%22modulePrefix%22%3A%22ghost-admin%22%2C%22environment%22%3A%22production%22%2C%22rootURL%22%3A%22%22%2C%22locationType%22%3A%22trailing-hash%22%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%2C%22EXTEND_PROTOTYPES%22%3A%7B%22Date%22%3Afalse%2C%22Array%22%3Atrue%2C%22String%22%3Atrue%2C%22Function%22%3Afalse%7D%2C%22_APPLICATION_TEMPLATE_WRAPPER%22%3Afalse%2C%22_JQUERY_INTEGRATION%22%3Atrue%2C%22_TEMPLATE_ONLY_GLIMMER_COMPONENTS%22%3Atrue%7D%2C%22APP%22%3A%7B%22version%22%3A%225.19%22%2C%22name%22%3A%22ghost-admin%22%7D%2C%22ember-simple-auth%22%3A%7B%7D%2C%22%40sentry%2Fember%22%3A%7B%22disablePerformance%22%3Atrue%2C%22sentry%22%3A%7B%7D%7D%2C%22ember-cli-mirage%22%3A%7B%22usingProxy%22%3Afalse%2C%22useDefaultPassthroughs%22%3Atrue%7D%2C%22exportApplicationGlobal%22%3Afalse%2C%22ember-load%22%3A%7B%22loadingIndicatorClass%22%3A%22ember-load-indicator%22%7D%7D" />
12
12
 
13
13
  <meta name="HandheldFriendly" content="True" />
14
14
  <meta name="MobileOptimized" content="320" />
@@ -36,8 +36,8 @@
36
36
  }
37
37
  </style>
38
38
 
39
- <link integrity="" rel="stylesheet" href="assets/vendor-733135cd6cbca8126c6fa223d63a5bf3.css">
40
- <link integrity="" rel="stylesheet" href="assets/ghost-597fb8e8b1b91dd0ac4d9f2d75bd67fb.css" title="light">
39
+ <link integrity="" rel="stylesheet" href="assets/vendor-3e6947aa681f0fb82b193090e520dc73.css">
40
+ <link integrity="" rel="stylesheet" href="assets/ghost-982146a4ada3a5af1981d1919ae01d08.css" title="light">
41
41
 
42
42
 
43
43
  </head>
@@ -56,9 +56,9 @@
56
56
 
57
57
  <div id="ember-basic-dropdown-wormhole"></div>
58
58
 
59
- <script src="assets/vendor-325e038b8609f0979f6578cae7a87f9e.js"></script>
60
- <script src="assets/chunk.579.a9bccec4d650a7be727a.js"></script>
61
- <script src="assets/chunk.143.3f2f5cbbd1ef4b1425d9.js"></script>
62
- <script src="assets/ghost-3577dfa3f54651db5ae5b9fd3d9b2824.js"></script>
59
+ <script src="assets/vendor-5c7d7063620bec13668c4370145cd4b4.js"></script>
60
+ <script src="assets/chunk.613.f1d519ad47e7f9024263.js"></script>
61
+ <script src="assets/chunk.143.eaf838fbf1470f018bf3.js"></script>
62
+ <script src="assets/ghost-5ce6f5a730c83c91fc258b12c537ea35.js"></script>
63
63
  </body>
64
64
  </html>
@@ -11,8 +11,20 @@
11
11
  // {{tags prefix=(t " on ")}}
12
12
 
13
13
  const {themeI18n} = require('../services/handlebars');
14
+ const errors = require('@tryghost/errors');
15
+ const tpl = require('@tryghost/tpl');
16
+
17
+ const messages = {
18
+ oopsErrorTemplateHasError: 'Oops, seems there is an error in the template.'
19
+ };
14
20
 
15
21
  module.exports = function t(text, options) {
22
+ if (text === undefined && options === undefined) {
23
+ throw new errors.IncorrectUsageError({
24
+ message: tpl(messages.oopsErrorTemplateHasError)
25
+ });
26
+ }
27
+
16
28
  const bindings = {};
17
29
  let prop;
18
30
  for (prop in options.hash) {
@@ -11,7 +11,7 @@
11
11
  <h2>This {{#is "page"}}page{{else}}post{{/is}} is for subscribers on the {{tiers}} only </h2>
12
12
  {{/has}}
13
13
  {{#if @member}}
14
- <a class="gh-btn" data-portal="account/plans" style="color:{{@site.accentColor}}">Upgrade your account</a>
14
+ <a class="gh-btn" data-portal="account/plans" style="color:{{@site.accent_color}}">Upgrade your account</a>
15
15
  {{else}}
16
16
  <a class="gh-btn" data-portal="signup" style="color:{{@site.accent_color}}">Subscribe now</a>
17
17
  <p><small>Already have an account? <a data-portal="signin">Sign in</a></small></p>
@@ -1 +1 @@
1
- /*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}.black{color:#15171a}.darkgrey{color:#394047}.midgrey{color:#7c8b9a}.lightgrey{color:#ced4d9}.blue{color:#14b8ff}.red{color:#f50b23}.orange{color:#ffb41f}.green{color:#30cf43}.darkgrey-hover:hover{color:#394047}.midgrey-hover:hover{color:#7c8b9a}.lightgrey-hover:hover{color:#ced4d9}.blue-hover:hover{color:#14b8ff}.red-hover:hover{color:#f50b23}.orange-hover:hover{color:#ffb41f}.green-hover:hover{color:#30cf43}*,:after,:before{box-sizing:border-box}html{overflow:hidden;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:62.5%;line-height:1.65;letter-spacing:.2px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body,html{width:100%;height:100%}body{overflow:auto;overflow-x:hidden;color:#343f44;font-size:1.4rem}.gh-view{-ms-flex-positive:1;flex-grow:1;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}h1,h2{margin:0 0 .3em;color:#343f44;line-height:1.15em;text-rendering:optimizeLegibility;text-indent:-1px;font-size:2.9rem}@media (max-width:500px){h1{font-size:2.4rem}}.gh-input{display:block;padding:10px 12px;width:100%;height:40px;border:1px solid #d6e3eb;border-radius:4px;color:#4b5b62;font-size:1.6rem;line-height:1em;font-weight:300;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;transition:border-color .15s linear;-webkit-appearance:none}.gh-input:focus{outline:0;border-color:#b4cbda}.gh-btn{display:inline-block;outline:none;border:1px solid #d6e3eb;color:#829aa8;text-decoration:none!important;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;fill:#829aa8;border-radius:5px;transition:all .2s ease;-webkit-font-smoothing:subpixel-antialiased}.gh-btn span{display:block;padding:0 12px;height:33px;font-size:1.3rem;line-height:33px;font-weight:400;text-align:center;letter-spacing:.2px;border-radius:4px}.gh-btn:hover{border-color:#b4cbda}.gh-btn-hover-blue:hover{border-color:#3eb0ef;color:#3eb0ef}.gh-btn-blue{padding:1px;border:0;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.1);fill:#fff;background:linear-gradient(#3da1d6,#2288bf);box-shadow:0 1px 0 rgba(0,0,0,.12);transition:none!important}.gh-btn-blue span{background:linear-gradient(#4ab6f0,#2fa5e4 60%,#2fa5e4 90%,#38a9e5);box-shadow:inset 0 1px 0 hsla(0,0%,100%,.1)}.gh-btn-blue:active,.gh-btn-blue:focus{background:#1e78a9}.gh-btn-blue:active span,.gh-btn-blue:focus span{background:#29a0e0;box-shadow:none}.gh-btn-block{display:block;width:100%}.gh-input-icon{position:relative;display:block}.gh-input-icon svg{position:absolute;top:50%;left:10px;z-index:2;height:14px;width:auto;fill:color(var(--midgrey) l(15%));transform:translateY(-7px)}.gh-input-icon input{padding-left:35px}.gh-app{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:hidden;height:100%}.gh-viewport{overflow:hidden;max-height:100%}.gh-main,.gh-viewport{-ms-flex-positive:1;flex-grow:1;display:-ms-flexbox;display:flex}.gh-main{position:relative;background:#fff;overflow-y:auto}.gh-flow{overflow-y:auto;min-height:100%;background:linear-gradient(315deg,#efefef,#fff)}.gh-flow,.gh-flow-content-wrap{flex-grow:1;display:flex;flex-direction:column}.gh-flow-content-wrap{flex-shrink:0;justify-content:center;align-items:center;margin:0 24px;padding-bottom:8vh}.gh-flow-content-wrap .site-icon{width:70px;height:70px;border-radius:3px}.gh-flow-content{display:flex;flex-direction:column;max-width:520px;width:100%;margin:4rem 0 6rem;padding:40px;background:#fff;color:var(--darkgrey);font-size:1.9rem;line-height:1.5em;font-weight:300;border-radius:3px;box-shadow:0 2.8px 2.2px rgba(0,0,0,.02),0 6.7px 5.3px rgba(0,0,0,.02),0 12.5px 10px rgba(0,0,0,.02),0 22.3px 17.9px rgba(0,0,0,.03),0 41.8px 33.4px rgba(0,0,0,.03),0 100px 80px rgba(0,0,0,.05)}.gh-flow-content.unsubscribe{align-items:center;justify-content:center;max-width:560px;min-height:200px;margin:4rem 0;text-align:center}@media (max-width:500px){.gh-flow-content{padding:0;background:transparent;box-shadow:none}}.gh-flow-content header{display:flex;flex-direction:column;align-items:center}.gh-flow-content h1{margin-bottom:24px;color:#15171a;font-size:4.1rem;font-weight:700;line-height:1.15em}.gh-flow-content.unsubscribe h1{font-size:3.2rem}@media (max-width:600px){.gh-flow-content.unsubscribe h1,.gh-flow-content h1{font-size:6vw}}.gh-flow-content.unsubscribe p{margin:0 0 .4em;color:#394047;font-size:1.8rem}@media (max-width:500px){.gh-flow-content.unsubscribe p{font-size:1.6rem;line-height:1.5}}.gh-flow-content .gh-btn{display:block;margin:20px auto 0;max-width:400px}.gh-flow-content .form-group{position:relative;margin-bottom:2.5rem}.gh-flow-content .form-group.error .gh-input{border-color:#f50b23;box-shadow:0 0 0 3px rgba(239,24,24,.15)}.gh-flow-content .main-error{position:absolute;right:0;margin:0;color:#7c8b9a;font-size:1.35rem;font-weight:400;text-align:center;user-select:text}.gh-flow-em{font-weight:500}.unsubscribe-footer{text-align:center;font-size:1.5rem}@media (max-width:500px){.unsubscribe-footer{padding:0 24px;font-size:1.4rem;line-height:1.4em}}.unsubscribe-footer p{color:#7c8b9a;margin:0 0 .4rem}.unsubscribe-footer a{color:#15171a;text-decoration:none}.unsubscribe-footer a:hover{text-decoration:underline}.gh-signin{margin-bottom:1.5rem}.gh-signin .gh-input,.gh-signin .gh-input:-webkit-autofill:first-line{height:54px;padding:12px 16px;font-size:1.8rem;border-radius:8px}.gh-signin .gh-input::placeholder{color:#abb4be;font-weight:400;opacity:1}.gh-signin .gh-input::-webkit-input-placeholder{color:#abb4be;font-weight:400}.gh-signin .gh-input:-ms-input-placeholder{color:#abb4be;font-weight:400}.gh-signin .gh-input::-moz-placeholder{color:#abb4be;font-weight:400;opacity:1}.gh-signin .gh-input:focus{border-color:#30cf43;box-shadow:0 0 0 3px rgba(26,170,96,.15)}.gh-signin .gh-btn{margin:0;width:100%;height:54px;max-width:unset;margin-top:32px;background:#15171a;font-weight:300;line-height:54px;border-radius:8px;transition:all .4s ease;-webkit-font-smoothing:subpixel-antialiased}.gh-signin .gh-btn span{color:#fff;font-size:1.8rem}.error-content{flex-grow:1;justify-content:center;user-select:text;padding:8vw}.error-content,.error-details{display:flex;align-items:center}.error-details{margin-bottom:4rem}.error-ghost{margin:15px;height:115px}@media (max-width:630px){.error-ghost{display:none}}.error-code{margin:0;color:#c5d2d9;font-size:10vw;font-weight:600;line-height:.9em;letter-spacing:-.4vw}.error-description{margin:0;padding:0;border:none;color:#54666d;font-size:2.3rem;font-weight:300;line-height:1.3em}.error-message{display:flex;flex-direction:column;margin:15px;align-items:center}.error-message a{font-size:1.4rem;line-height:1;margin:8px 0}.error-link{background-color:transparent;color:#5ba4e5;transition:background .3s,color .3s;text-decoration:none}.error-stack{margin:1rem auto;padding:2rem;max-width:800px;background-color:hsla(0,0%,100%,.3)}.error-stack-list{margin:0;padding:0;list-style-type:none}.error-stack-list li{display:block}.error-stack-list li:before{content:"\21AA";display:inline-block;margin-right:.5rem;color:#bbb;font-size:1.2rem}.error-stack-function{font-weight:700}
1
+ /*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;font-family:sans-serif}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}.black{color:#15171a}.darkgrey{color:#394047}.midgrey{color:#7c8b9a}.lightgrey{color:#ced4d9}.blue{color:#14b8ff}.red{color:#f50b23}.orange{color:#ffb41f}.green{color:#30cf43}.darkgrey-hover:hover{color:#394047}.midgrey-hover:hover{color:#7c8b9a}.lightgrey-hover:hover{color:#ced4d9}.blue-hover:hover{color:#14b8ff}.red-hover:hover{color:#f50b23}.orange-hover:hover{color:#ffb41f}.green-hover:hover{color:#30cf43}*,:after,:before{box-sizing:border-box}html{-webkit-tap-highlight-color:rgba(0,0,0,0);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:62.5%;letter-spacing:.2px;line-height:1.65;overflow:hidden}body,html{height:100%;width:100%}body{color:#343f44;font-size:1.4rem;overflow:auto;overflow-x:hidden}.gh-view{-ms-flex-positive:1;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;flex-grow:1}h1,h2{color:#343f44;font-size:2.9rem;line-height:1.15em;margin:0 0 .3em;text-indent:-1px;text-rendering:optimizeLegibility}@media (max-width:500px){h1{font-size:2.4rem}}.gh-input{-webkit-appearance:none;border:1px solid #d6e3eb;border-radius:4px;color:#4b5b62;display:block;font-size:1.6rem;font-weight:300;height:40px;line-height:1em;padding:10px 12px;transition:border-color .15s linear;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;width:100%}.gh-input:focus{border-color:#b4cbda;outline:0}.gh-btn{fill:#829aa8;-webkit-font-smoothing:subpixel-antialiased;border:1px solid #d6e3eb;border-radius:5px;color:#829aa8;display:inline-block;outline:none;text-decoration:none!important;transition:all .2s ease;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.gh-btn span{border-radius:4px;display:block;font-size:1.3rem;font-weight:400;height:33px;letter-spacing:.2px;line-height:33px;padding:0 12px;text-align:center}.gh-btn:hover{border-color:#b4cbda}.gh-btn-hover-blue:hover{border-color:#3eb0ef;color:#3eb0ef}.gh-btn-blue{fill:#fff;background:linear-gradient(#3da1d6,#2288bf);border:0;box-shadow:0 1px 0 rgba(0,0,0,.12);color:#fff;padding:1px;text-shadow:0 -1px 0 rgba(0,0,0,.1);transition:none!important}.gh-btn-blue span{background:linear-gradient(#4ab6f0,#2fa5e4 60%,#2fa5e4 90%,#38a9e5);box-shadow:inset 0 1px 0 hsla(0,0%,100%,.1)}.gh-btn-blue:active,.gh-btn-blue:focus{background:#1e78a9}.gh-btn-blue:active span,.gh-btn-blue:focus span{background:#29a0e0;box-shadow:none}.gh-btn-block{display:block;width:100%}.gh-input-icon{display:block;position:relative}.gh-input-icon svg{fill:color(var(--midgrey) l(15%));height:14px;left:10px;position:absolute;top:50%;transform:translateY(-7px);width:auto;z-index:2}.gh-input-icon input{padding-left:35px}.gh-app{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%;overflow:hidden}.gh-viewport{max-height:100%;overflow:hidden}.gh-main,.gh-viewport{-ms-flex-positive:1;display:-ms-flexbox;display:flex;flex-grow:1}.gh-main{background:#fff;overflow-y:auto;position:relative}.gh-flow{background:linear-gradient(315deg,#efefef,#fff);min-height:100%;overflow-y:auto}.gh-flow,.gh-flow-content-wrap{display:flex;flex-direction:column;flex-grow:1}.gh-flow-content-wrap{align-items:center;flex-shrink:0;justify-content:center;margin:0 24px;padding-bottom:8vh}.gh-flow-content-wrap .site-icon{border-radius:3px;height:70px;width:70px}.gh-flow-content{background:#fff;border-radius:3px;box-shadow:0 2.8px 2.2px rgba(0,0,0,.02),0 6.7px 5.3px rgba(0,0,0,.02),0 12.5px 10px rgba(0,0,0,.02),0 22.3px 17.9px rgba(0,0,0,.03),0 41.8px 33.4px rgba(0,0,0,.03),0 100px 80px rgba(0,0,0,.05);color:var(--darkgrey);display:flex;flex-direction:column;font-size:1.9rem;font-weight:300;line-height:1.5em;margin:4rem 0 6rem;max-width:520px;padding:40px;width:100%}.gh-flow-content.unsubscribe{align-items:center;justify-content:center;margin:4rem 0;max-width:560px;min-height:200px;text-align:center}@media (max-width:500px){.gh-flow-content{background:transparent;box-shadow:none;padding:0}}.gh-flow-content header{align-items:center;display:flex;flex-direction:column}.gh-flow-content h1{color:#15171a;font-size:4.1rem;font-weight:700;line-height:1.15em;margin-bottom:24px}.gh-flow-content.unsubscribe h1{font-size:3.2rem}@media (max-width:600px){.gh-flow-content h1,.gh-flow-content.unsubscribe h1{font-size:6vw}}.gh-flow-content.unsubscribe p{color:#394047;font-size:1.8rem;margin:0 0 .4em}@media (max-width:500px){.gh-flow-content.unsubscribe p{font-size:1.6rem;line-height:1.5}}.gh-flow-content .gh-btn{display:block;margin:20px auto 0;max-width:400px}.gh-flow-content .form-group{margin-bottom:2.5rem;position:relative}.gh-flow-content .form-group.error .gh-input{border-color:#f50b23;box-shadow:0 0 0 3px rgba(239,24,24,.15)}.gh-flow-content .main-error{color:#7c8b9a;font-size:1.35rem;font-weight:400;margin:0;position:absolute;right:0;text-align:center;user-select:text}.gh-flow-em{font-weight:500}.unsubscribe-footer{font-size:1.5rem;text-align:center}@media (max-width:500px){.unsubscribe-footer{font-size:1.4rem;line-height:1.4em;padding:0 24px}}.unsubscribe-footer p{color:#7c8b9a;margin:0 0 .4rem}.unsubscribe-footer a{color:#15171a;text-decoration:none}.unsubscribe-footer a:hover{text-decoration:underline}.gh-signin{margin-bottom:1.5rem}.gh-signin .gh-input,.gh-signin .gh-input:-webkit-autofill:first-line{border-radius:8px;font-size:1.8rem;height:54px;padding:12px 16px}.gh-signin .gh-input::placeholder{color:#abb4be;font-weight:400;opacity:1}.gh-signin .gh-input::-webkit-input-placeholder{color:#abb4be;font-weight:400}.gh-signin .gh-input:-ms-input-placeholder{color:#abb4be;font-weight:400}.gh-signin .gh-input::-moz-placeholder{color:#abb4be;font-weight:400;opacity:1}.gh-signin .gh-input:focus{border-color:#30cf43;box-shadow:0 0 0 3px rgba(26,170,96,.15)}.gh-signin .gh-btn{-webkit-font-smoothing:subpixel-antialiased;background:#15171a;border-radius:8px;font-weight:300;height:54px;line-height:54px;margin:0;margin-top:32px;max-width:unset;transition:all .4s ease;width:100%}.gh-signin .gh-btn span{color:#fff;font-size:1.8rem}.error-content{flex-grow:1;justify-content:center;padding:8vw;user-select:text}.error-content,.error-details{align-items:center;display:flex}.error-details{margin-bottom:4rem}.error-ghost{height:115px;margin:15px}@media (max-width:630px){.error-ghost{display:none}}.error-code{color:#c5d2d9;font-size:10vw;font-weight:600;letter-spacing:-.4vw;line-height:.9em;margin:0}.error-description{border:none;color:#54666d;font-size:2.3rem;font-weight:300;line-height:1.3em;margin:0;padding:0}.error-message{align-items:center;display:flex;flex-direction:column;margin:15px}.error-message a{font-size:1.4rem;line-height:1;margin:8px 0}.error-link{background-color:transparent;color:#5ba4e5;text-decoration:none;transition:background .3s,color .3s}.error-stack{background-color:hsla(0,0%,100%,.3);margin:1rem auto;max-width:800px;padding:2rem}.error-stack-list{list-style-type:none;margin:0;padding:0}.error-stack-list li{display:block}.error-stack-list li:before{color:#bbb;content:"\21AA";display:inline-block;font-size:1.2rem;margin-right:.5rem}.error-stack-function{font-weight:700}
@@ -3,3 +3,4 @@ Sitemap: {{blog-url}}/sitemap.xml
3
3
  Disallow: /ghost/
4
4
  Disallow: /p/
5
5
  Disallow: /email/
6
+ Disallow: /r/
@@ -30,7 +30,7 @@ module.exports = function handler(siteApp) {
30
30
  const content = manager.getSiteMapXml(type, page);
31
31
  // Prevent x-1.xml as it is a duplicate of x.xml and empty sitemaps
32
32
  // (except for the first page so that at least one sitemap exists per type)
33
- if (pageParam === '1' || (!content && page !== 1)) {
33
+ if (pageParam === '1' || content === null) {
34
34
  return res.sendStatus(404);
35
35
  }
36
36
 
@@ -31,10 +31,8 @@ class SiteMapIndexGenerator {
31
31
 
32
32
  generateSiteMapUrlElements() {
33
33
  return _.map(this.types, (resourceType) => {
34
- // `|| 1` = even if there are no items we still have an empty sitemap file
35
- const noOfPages = Math.ceil(Object.keys(resourceType.nodeLookup).length / this.maxPerPage) || 1;
34
+ const noOfPages = Math.ceil(Object.keys(resourceType.nodeLookup).length / this.maxPerPage);
36
35
  const pages = [];
37
-
38
36
  for (let i = 0; i < noOfPages; i++) {
39
37
  const page = i === 0 ? '' : `-${i + 1}`;
40
38
  const url = urlUtils.urlFor({relativeUrl: '/sitemap-' + resourceType.name + page + '.xml'}, true);
@@ -32,6 +32,8 @@ function forwardToExpressStatic(req, res, next) {
32
32
 
33
33
  const configMaxAge = config.get('caching:theme:maxAge');
34
34
 
35
+ // @NOTE: the maxAge config passed below are in milliseconds and the config
36
+ // is specified in seconds. See https://github.com/expressjs/serve-static/issues/150 for more context
35
37
  express.static(themeEngine.getActive().path, {
36
38
  maxAge: (configMaxAge || configMaxAge === 0) ? configMaxAge : constants.ONE_YEAR_MS
37
39
  }
@@ -0,0 +1,23 @@
1
+ const feedbackService = require('../../services/audience-feedback');
2
+
3
+ module.exports = {
4
+ docName: 'feedback',
5
+
6
+ add: {
7
+ statusCode: 201,
8
+ validation: {
9
+ data: {
10
+ post_id: {
11
+ required: true
12
+ },
13
+ score: {
14
+ required: true
15
+ }
16
+ }
17
+ },
18
+ permissions: false,
19
+ query(frame) {
20
+ return feedbackService.controller.add(frame);
21
+ }
22
+ }
23
+ };
@@ -231,5 +231,9 @@ module.exports = {
231
231
 
232
232
  get commentsMembers() {
233
233
  return apiFramework.pipeline(require('./comments-members'), localUtils, 'members');
234
- }
234
+ },
235
+
236
+ get feedbackMembers() {
237
+ return apiFramework.pipeline(require('./feedback-members'), localUtils, 'members');
238
+ }
235
239
  };
@@ -25,10 +25,10 @@ function defaultRelations(frame) {
25
25
  return false;
26
26
  }
27
27
 
28
- if (labs.isSet('emailClicks')) {
29
- frame.options.withRelated = ['tags', 'authors', 'authors.roles', 'email', 'tiers', 'newsletter', 'count.signups', 'count.paid_conversions', 'count.clicks'];
28
+ if (labs.isSet('audienceFeedback')) {
29
+ frame.options.withRelated = ['tags', 'authors', 'authors.roles', 'email', 'tiers', 'newsletter', 'count.signups', 'count.paid_conversions', 'count.clicks', 'count.sentiment', 'count.positive_feedback'];
30
30
  } else {
31
- frame.options.withRelated = ['tags', 'authors', 'authors.roles', 'email', 'tiers', 'newsletter', 'count.signups', 'count.paid_conversions'];
31
+ frame.options.withRelated = ['tags', 'authors', 'authors.roles', 'email', 'tiers', 'newsletter', 'count.signups', 'count.paid_conversions', 'count.clicks'];
32
32
  }
33
33
  }
34
34
 
@@ -10,7 +10,6 @@ const extraAttrs = require('../utils/extra-attrs');
10
10
  const gating = require('../utils/post-gating');
11
11
  const url = require('../utils/url');
12
12
 
13
- const labs = require('../../../../../../../shared/labs');
14
13
  const utils = require('../../../index');
15
14
 
16
15
  const postsMetaSchema = require('../../../../../../data/schema').tables.posts_meta;
@@ -110,20 +109,22 @@ module.exports = async (model, frame, options = {}) => {
110
109
  });
111
110
  }
112
111
 
113
- if (labs.isSet('emailClicks')) {
114
- if (jsonModel.email && jsonModel.count) {
115
- jsonModel.email.opened_count = Math.min(
116
- Math.max(
117
- jsonModel.email.opened_count || 0,
118
- jsonModel.count.clicks || 0
119
- ),
120
- jsonModel.email.email_count
121
- );
122
- }
112
+ if (jsonModel.email && jsonModel.count) {
113
+ jsonModel.email.opened_count = Math.min(
114
+ Math.max(
115
+ jsonModel.email.opened_count || 0,
116
+ jsonModel.count.clicks || 0
117
+ ),
118
+ jsonModel.email.email_count
119
+ );
120
+ }
121
+
122
+ if (jsonModel.count && !jsonModel.count.sentiment) {
123
+ jsonModel.count.sentiment = 0;
123
124
  }
124
125
 
125
- if (!labs.isSet('memberAttribution') && !labs.isSet('emailClicks')) {
126
- delete jsonModel.count;
126
+ if (jsonModel.count && !jsonModel.count.positive_feedback) {
127
+ jsonModel.count.positive_feedback = 0;
127
128
  }
128
129
 
129
130
  return jsonModel;
@@ -20,6 +20,7 @@ const BACKUP_TABLES = [
20
20
  'webhooks',
21
21
  'tokens',
22
22
  'sessions',
23
+ 'subscriptions',
23
24
  'mobiledoc_revisions',
24
25
  'post_revisions',
25
26
  'email_batches',
@@ -40,7 +41,8 @@ const BACKUP_TABLES = [
40
41
  'comment_reports',
41
42
  'jobs',
42
43
  'redirects',
43
- 'members_click_events'
44
+ 'members_click_events',
45
+ 'members_feedback'
44
46
  ];
45
47
 
46
48
  // NOTE: exposing only tables which are going to be included in a "default" export file
@@ -1,5 +1,4 @@
1
1
  const _ = require('lodash');
2
- const Promise = require('bluebird');
3
2
  const fs = require('fs-extra');
4
3
  const tpl = require('@tryghost/tpl');
5
4
  const errors = require('@tryghost/errors');
@@ -17,36 +16,35 @@ JSONHandler = {
17
16
  contentTypes: ['application/octet-stream', 'application/json'],
18
17
  directories: [],
19
18
 
20
- loadFile: function (files, startDir) { // eslint-disable-line no-unused-vars
19
+ loadFile: async function (files, startDir) { // eslint-disable-line no-unused-vars
21
20
  // @TODO: Handle multiple JSON files
22
21
  const filePath = files[0].path;
23
22
 
24
- return fs.readFile(filePath).then(function (fileData) {
25
- let importData;
23
+ const fileData = await fs.readFile(filePath);
24
+ let importData;
26
25
 
27
- try {
28
- importData = JSON.parse(fileData);
26
+ try {
27
+ importData = JSON.parse(fileData);
29
28
 
30
- // if importData follows JSON-API format `{ db: [exportedData] }`
31
- if (_.keys(importData).length === 1) {
32
- if (!importData.db || !Array.isArray(importData.db)) {
33
- throw new errors.InternalServerError({
34
- message: tpl(messages.invalidJsonFormat)
35
- });
36
- }
37
-
38
- importData = importData.db[0];
29
+ // if importData follows JSON-API format `{ db: [exportedData] }`
30
+ if (_.keys(importData).length === 1) {
31
+ if (!importData.db || !Array.isArray(importData.db)) {
32
+ throw new errors.InternalServerError({
33
+ message: tpl(messages.invalidJsonFormat)
34
+ });
39
35
  }
40
36
 
41
- return importData;
42
- } catch (err) {
43
- return Promise.reject(new errors.BadRequestError({
44
- err: err,
45
- message: err.message,
46
- help: tpl(messages.checkImportJsonIsValid)
47
- }));
37
+ importData = importData.db[0];
48
38
  }
49
- });
39
+
40
+ return importData;
41
+ } catch (err) {
42
+ throw new errors.BadRequestError({
43
+ err,
44
+ message: err.message,
45
+ help: tpl(messages.checkImportJsonIsValid)
46
+ });
47
+ }
50
48
  }
51
49
  };
52
50
 
@@ -1,7 +1,7 @@
1
1
  const debug = require('@tryghost/debug')('importer:base');
2
2
  const _ = require('lodash');
3
3
  const Promise = require('bluebird');
4
- const ObjectId = require('bson-objectid');
4
+ const ObjectId = require('bson-objectid').default;
5
5
  const errors = require('@tryghost/errors');
6
6
  const {sequence} = require('@tryghost/promise');
7
7
  const models = require('../../../../models');
@@ -3,7 +3,7 @@ const {addTable} = require('../../utils');
3
3
  module.exports = addTable('members_subscribe_events', {
4
4
  id: {type: 'string', maxlength: 24, nullable: false, primary: true},
5
5
  member_id: {type: 'string', maxlength: 24, nullable: false, unique: false, references: 'members.id', cascadeDelete: true},
6
- subscribed: {type: 'bool', nullable: false, defaultTo: true},
6
+ subscribed: {type: 'boolean', nullable: false, defaultTo: true},
7
7
  created_at: {type: 'dateTime', nullable: false},
8
8
  source: {type: 'string', maxlength: 50, nullable: true}
9
9
  });
@@ -1,5 +1,5 @@
1
1
  const {chunk} = require('lodash');
2
- const ObjectID = require('bson-objectid');
2
+ const ObjectID = require('bson-objectid').default;
3
3
  const {createTransactionalMigration} = require('../../utils');
4
4
  const logging = require('@tryghost/logging');
5
5
 
@@ -5,7 +5,7 @@ module.exports = addTable('members_paid_subscription_events', {
5
5
  member_id: {type: 'string', maxlength: 24, nullable: false, references: 'members.id', cascadeDelete: true},
6
6
  from_plan: {type: 'string', maxlength: 255, nullable: true},
7
7
  to_plan: {type: 'string', maxlength: 255, nullable: true},
8
- currency: {type: 'string', maxLength: 3, nullable: false},
8
+ currency: {type: 'string', maxlength: 191, nullable: false},
9
9
  source: {type: 'string', maxlength: 50, nullable: false},
10
10
  mrr_delta: {type: 'integer', nullable: false},
11
11
  created_at: {type: 'dateTime', nullable: false}
@@ -4,7 +4,7 @@ module.exports = addTable('members_payment_events', {
4
4
  id: {type: 'string', maxlength: 24, nullable: false, primary: true},
5
5
  member_id: {type: 'string', maxlength: 24, nullable: false, references: 'members.id', cascadeDelete: true},
6
6
  amount: {type: 'integer', nullable: false},
7
- currency: {type: 'string', maxLength: 3, nullable: false},
7
+ currency: {type: 'string', maxlength: 191, nullable: false},
8
8
  source: {type: 'string', maxlength: 50, nullable: false},
9
9
  created_at: {type: 'dateTime', nullable: false}
10
10
  });
@@ -1,5 +1,5 @@
1
1
  const {chunk} = require('lodash');
2
- const ObjectID = require('bson-objectid');
2
+ const ObjectID = require('bson-objectid').default;
3
3
  const logging = require('@tryghost/logging');
4
4
  const {createTransactionalMigration} = require('../../utils');
5
5
 
@@ -1,6 +1,6 @@
1
1
  const {createIrreversibleMigration} = require('../../utils');
2
2
  const logging = require('@tryghost/logging');
3
- const ObjectID = require('bson-objectid');
3
+ const ObjectID = require('bson-objectid').default;
4
4
  const security = require('@tryghost/security');
5
5
 
6
6
  module.exports = createIrreversibleMigration(
@@ -1,5 +1,5 @@
1
1
  const {chunk} = require('lodash');
2
- const ObjectID = require('bson-objectid');
2
+ const ObjectID = require('bson-objectid').default;
3
3
  const {createTransactionalMigration} = require('../../utils');
4
4
  const logging = require('@tryghost/logging');
5
5
  const errors = require('@tryghost/errors');
@@ -1,4 +1,4 @@
1
- const ObjectID = require('bson-objectid');
1
+ const ObjectID = require('bson-objectid').default;
2
2
  const logging = require('@tryghost/logging');
3
3
  const {createTransactionalMigration} = require('../../utils');
4
4
 
@@ -1,7 +1,7 @@
1
1
  const {createAddColumnMigration} = require('../../utils');
2
2
 
3
3
  module.exports = createAddColumnMigration('posts_meta', 'email_only', {
4
- type: 'bool',
4
+ type: 'boolean',
5
5
  nullable: false,
6
6
  defaultTo: false
7
7
  });
@@ -1,5 +1,5 @@
1
1
  const {createTransactionalMigration} = require('../../utils');
2
- const ObjectID = require('bson-objectid');
2
+ const ObjectID = require('bson-objectid').default;
3
3
  const {slugify} = require('@tryghost/string');
4
4
  const logging = require('@tryghost/logging');
5
5
 
@@ -1,5 +1,5 @@
1
1
  const {createTransactionalMigration} = require('../../utils');
2
- const ObjectID = require('bson-objectid');
2
+ const ObjectID = require('bson-objectid').default;
3
3
  const {chunk} = require('lodash');
4
4
  const logging = require('@tryghost/logging');
5
5
 
@@ -4,9 +4,9 @@ module.exports = addTable('stripe_prices', {
4
4
  id: {type: 'string', maxlength: 24, nullable: false, primary: true},
5
5
  stripe_price_id: {type: 'string', maxlength: 255, nullable: false, unique: true},
6
6
  stripe_product_id: {type: 'string', maxlength: 255, nullable: false, unique: false, references: 'stripe_products.stripe_product_id', cascadeDelete: true},
7
- active: {type: 'bool', nullable: false},
7
+ active: {type: 'boolean', nullable: false},
8
8
  nickname: {type: 'string', maxlength: 50, nullable: true},
9
- currency: {type: 'string', maxLength: 3, nullable: false},
9
+ currency: {type: 'string', maxlength: 191, nullable: false},
10
10
  amount: {type: 'integer', nullable: false},
11
11
  type: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'recurring', validations: {isIn: [['recurring', 'one_time']]}},
12
12
  interval: {type: 'string', maxlength: 50, nullable: true},
@@ -1,6 +1,6 @@
1
1
  const logging = require('@tryghost/logging');
2
2
  const {createTransactionalMigration} = require('../../utils');
3
- const ObjectId = require('bson-objectid');
3
+ const ObjectId = require('bson-objectid').default;
4
4
 
5
5
  module.exports = createTransactionalMigration(
6
6
  async function up(connection) {
@@ -1,5 +1,5 @@
1
1
  const {createTransactionalMigration} = require('../../utils');
2
- const ObjectID = require('bson-objectid');
2
+ const ObjectID = require('bson-objectid').default;
3
3
  const {slugify} = require('@tryghost/string');
4
4
  const logging = require('@tryghost/logging');
5
5
 
@@ -12,7 +12,7 @@ module.exports = addTable('newsletters', {
12
12
  sender_name: {type: 'string', maxlength: 191, nullable: false},
13
13
  sender_email: {type: 'string', maxlength: 191, nullable: false, validations: {isEmail: true}},
14
14
  sender_reply_to: {type: 'string', maxlength: 191, nullable: false, validations: {isEmail: true}},
15
- default: {type: 'bool', nullable: false, defaultTo: false},
15
+ default: {type: 'boolean', nullable: false, defaultTo: false},
16
16
  status: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'active'},
17
17
  recipient_filter: {
18
18
  type: 'text',
@@ -20,6 +20,6 @@ module.exports = addTable('newsletters', {
20
20
  nullable: false,
21
21
  defaultTo: ''
22
22
  },
23
- subscribe_on_signup: {type: 'bool', nullable: false, defaultTo: false},
23
+ subscribe_on_signup: {type: 'boolean', nullable: false, defaultTo: false},
24
24
  sort_order: {type: 'integer', nullable: false, unsigned: true, defaultTo: 0}
25
25
  });
@@ -15,15 +15,15 @@ module.exports = recreateTable('newsletters', {
15
15
  nullable: false,
16
16
  defaultTo: 'members'
17
17
  },
18
- subscribe_on_signup: {type: 'bool', nullable: false, defaultTo: true},
18
+ subscribe_on_signup: {type: 'boolean', nullable: false, defaultTo: true},
19
19
  sort_order: {type: 'integer', nullable: false, unsigned: true, defaultTo: 0},
20
20
  header_image: {type: 'string', maxlength: 2000, nullable: true},
21
- show_header_icon: {type: 'bool', nullable: false, defaultTo: true},
22
- show_header_title: {type: 'bool', nullable: false, defaultTo: true},
21
+ show_header_icon: {type: 'boolean', nullable: false, defaultTo: true},
22
+ show_header_title: {type: 'boolean', nullable: false, defaultTo: true},
23
23
  title_font_category: {type: 'string', maxlength: 191, nullable: false, defaultTo: 'sans_serif', validations: {isIn: [['serif', 'sans_serif']]}},
24
24
  title_alignment: {type: 'string', maxlength: 191, nullable: false, defaultTo: 'center', validations: {isIn: [['center', 'left']]}},
25
- show_feature_image: {type: 'bool', nullable: false, defaultTo: true},
25
+ show_feature_image: {type: 'boolean', nullable: false, defaultTo: true},
26
26
  body_font_category: {type: 'string', maxlength: 191, nullable: false, defaultTo: 'sans_serif', validations: {isIn: [['serif', 'sans_serif']]}},
27
27
  footer_content: {type: 'text', maxlength: 1000000000, nullable: true},
28
- show_badge: {type: 'bool', nullable: false, defaultTo: true}
28
+ show_badge: {type: 'boolean', nullable: false, defaultTo: true}
29
29
  });
@@ -1,4 +1,4 @@
1
- const ObjectId = require('bson-objectid');
1
+ const ObjectId = require('bson-objectid').default;
2
2
  const uuid = require('uuid');
3
3
  const logging = require('@tryghost/logging');
4
4
  const startsWith = require('lodash/startsWith');
@@ -1,5 +1,5 @@
1
1
  const logging = require('@tryghost/logging');
2
- const ObjectID = require('bson-objectid');
2
+ const ObjectID = require('bson-objectid').default;
3
3
 
4
4
  const {createTransactionalMigration} = require('../../utils');
5
5
 
@@ -1,4 +1,4 @@
1
- const ObjectID = require('bson-objectid');
1
+ const ObjectID = require('bson-objectid').default;
2
2
  const logging = require('@tryghost/logging');
3
3
  const {createTransactionalMigration} = require('../../utils');
4
4
 
@@ -1,4 +1,4 @@
1
- const ObjectID = require('bson-objectid');
1
+ const ObjectID = require('bson-objectid').default;
2
2
  const {createTransactionalMigration} = require('../../utils');
3
3
  const logging = require('@tryghost/logging');
4
4
 
@@ -1,6 +1,6 @@
1
1
  const logging = require('@tryghost/logging');
2
2
  const {createTransactionalMigration} = require('../../utils');
3
- const ObjectId = require('bson-objectid');
3
+ const ObjectId = require('bson-objectid').default;
4
4
 
5
5
  // newsletter_show_header = false ->
6
6
  // newsletter_show_header_title = false
@@ -1,5 +1,5 @@
1
1
  const logging = require('@tryghost/logging');
2
- const ObjectID = require('bson-objectid');
2
+ const ObjectID = require('bson-objectid').default;
3
3
  const security = require('@tryghost/security');
4
4
  const {createTransactionalMigration} = require('../../utils');
5
5
 
@@ -1,7 +1,7 @@
1
1
  const {createAddColumnMigration} = require('../../utils');
2
2
 
3
3
  module.exports = createAddColumnMigration('emails', 'track_clicks', {
4
- type: 'bool',
5
- nullable: false,
4
+ type: 'boolean',
5
+ nullable: false,
6
6
  defaultTo: false
7
7
  });
@@ -0,0 +1,19 @@
1
+ const {createAddColumnMigration, combineNonTransactionalMigrations} = require('../../utils');
2
+
3
+ module.exports = combineNonTransactionalMigrations(
4
+ createAddColumnMigration('products', 'monthly_price', {
5
+ type: 'integer',
6
+ unsigned: true,
7
+ nullable: true
8
+ }),
9
+ createAddColumnMigration('products', 'yearly_price', {
10
+ type: 'integer',
11
+ unsigned: true,
12
+ nullable: true
13
+ }),
14
+ createAddColumnMigration('products', 'currency', {
15
+ type: 'string',
16
+ maxlength: 50,
17
+ nullable: true
18
+ })
19
+ );