ghost 5.48.1 → 5.49.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 (152) hide show
  1. package/components/tryghost-adapter-cache-memory-ttl-5.49.0.tgz +0 -0
  2. package/components/tryghost-adapter-cache-redis-5.49.0.tgz +0 -0
  3. package/components/tryghost-adapter-manager-5.49.0.tgz +0 -0
  4. package/components/tryghost-announcement-bar-settings-5.49.0.tgz +0 -0
  5. package/components/{tryghost-api-framework-5.48.1.tgz → tryghost-api-framework-5.49.0.tgz} +0 -0
  6. package/components/tryghost-api-version-compatibility-service-5.49.0.tgz +0 -0
  7. package/components/tryghost-audience-feedback-5.49.0.tgz +0 -0
  8. package/components/tryghost-bootstrap-socket-5.49.0.tgz +0 -0
  9. package/components/tryghost-collections-5.49.0.tgz +0 -0
  10. package/components/tryghost-constants-5.49.0.tgz +0 -0
  11. package/components/tryghost-custom-theme-settings-service-5.49.0.tgz +0 -0
  12. package/components/tryghost-data-generator-5.49.0.tgz +0 -0
  13. package/components/tryghost-domain-events-5.49.0.tgz +0 -0
  14. package/components/tryghost-dynamic-routing-events-5.49.0.tgz +0 -0
  15. package/components/tryghost-email-analytics-provider-mailgun-5.49.0.tgz +0 -0
  16. package/components/tryghost-email-analytics-service-5.49.0.tgz +0 -0
  17. package/components/tryghost-email-content-generator-5.49.0.tgz +0 -0
  18. package/components/tryghost-email-events-5.49.0.tgz +0 -0
  19. package/components/tryghost-email-service-5.49.0.tgz +0 -0
  20. package/components/tryghost-email-suppression-list-5.49.0.tgz +0 -0
  21. package/components/tryghost-event-aware-cache-wrapper-5.49.0.tgz +0 -0
  22. package/components/tryghost-express-dynamic-redirects-5.49.0.tgz +0 -0
  23. package/components/tryghost-external-media-inliner-5.49.0.tgz +0 -0
  24. package/components/tryghost-extract-api-key-5.49.0.tgz +0 -0
  25. package/components/tryghost-html-to-plaintext-5.49.0.tgz +0 -0
  26. package/components/tryghost-i18n-5.49.0.tgz +0 -0
  27. package/components/tryghost-importer-handler-content-files-5.49.0.tgz +0 -0
  28. package/components/tryghost-importer-revue-5.49.0.tgz +0 -0
  29. package/components/tryghost-in-memory-repository-5.49.0.tgz +0 -0
  30. package/components/tryghost-job-manager-5.49.0.tgz +0 -0
  31. package/components/tryghost-link-redirects-5.49.0.tgz +0 -0
  32. package/components/tryghost-link-replacer-5.49.0.tgz +0 -0
  33. package/components/tryghost-link-tracking-5.49.0.tgz +0 -0
  34. package/components/{tryghost-magic-link-5.48.1.tgz → tryghost-magic-link-5.49.0.tgz} +0 -0
  35. package/components/tryghost-mailgun-client-5.49.0.tgz +0 -0
  36. package/components/tryghost-member-attribution-5.49.0.tgz +0 -0
  37. package/components/tryghost-member-events-5.49.0.tgz +0 -0
  38. package/components/{tryghost-members-api-5.48.1.tgz → tryghost-members-api-5.49.0.tgz} +0 -0
  39. package/components/tryghost-members-csv-5.49.0.tgz +0 -0
  40. package/components/tryghost-members-events-service-5.49.0.tgz +0 -0
  41. package/components/tryghost-members-importer-5.49.0.tgz +0 -0
  42. package/components/tryghost-members-offers-5.49.0.tgz +0 -0
  43. package/components/tryghost-members-payments-5.49.0.tgz +0 -0
  44. package/components/tryghost-members-ssr-5.49.0.tgz +0 -0
  45. package/components/{tryghost-members-stripe-service-5.48.1.tgz → tryghost-members-stripe-service-5.49.0.tgz} +0 -0
  46. package/components/tryghost-mentions-email-report-5.49.0.tgz +0 -0
  47. package/components/tryghost-milestones-5.49.0.tgz +0 -0
  48. package/components/tryghost-minifier-5.49.0.tgz +0 -0
  49. package/components/tryghost-mw-api-version-mismatch-5.49.0.tgz +0 -0
  50. package/components/tryghost-mw-cache-control-5.49.0.tgz +0 -0
  51. package/components/{tryghost-mw-error-handler-5.48.1.tgz → tryghost-mw-error-handler-5.49.0.tgz} +0 -0
  52. package/components/tryghost-mw-session-from-token-5.49.0.tgz +0 -0
  53. package/components/tryghost-mw-update-user-last-seen-5.49.0.tgz +0 -0
  54. package/components/tryghost-mw-version-match-5.49.0.tgz +0 -0
  55. package/components/tryghost-mw-vhost-5.49.0.tgz +0 -0
  56. package/components/tryghost-oembed-service-5.49.0.tgz +0 -0
  57. package/components/tryghost-package-json-5.49.0.tgz +0 -0
  58. package/components/tryghost-post-revisions-5.49.0.tgz +0 -0
  59. package/components/tryghost-posts-service-5.49.0.tgz +0 -0
  60. package/components/tryghost-referrers-5.49.0.tgz +0 -0
  61. package/components/tryghost-security-5.49.0.tgz +0 -0
  62. package/components/tryghost-session-service-5.49.0.tgz +0 -0
  63. package/components/tryghost-settings-path-manager-5.49.0.tgz +0 -0
  64. package/components/tryghost-slack-notifications-5.49.0.tgz +0 -0
  65. package/components/{tryghost-staff-service-5.48.1.tgz → tryghost-staff-service-5.49.0.tgz} +0 -0
  66. package/components/tryghost-stats-service-5.49.0.tgz +0 -0
  67. package/components/{tryghost-tiers-5.48.1.tgz → tryghost-tiers-5.49.0.tgz} +0 -0
  68. package/components/{tryghost-update-check-service-5.48.1.tgz → tryghost-update-check-service-5.49.0.tgz} +0 -0
  69. package/components/tryghost-verification-trigger-5.49.0.tgz +0 -0
  70. package/components/tryghost-version-notifications-data-service-5.49.0.tgz +0 -0
  71. package/components/tryghost-webmentions-5.49.0.tgz +0 -0
  72. package/core/built/admin/assets/{chunk.143.7ffa4fa3e2ad37094023.js → chunk.143.c84e66067cd00cfdfb1a.js} +5 -5
  73. package/core/built/admin/assets/{chunk.178.b0604abd844e7e089a22.js → chunk.178.a05c4695bf385a398033.js} +4 -4
  74. package/core/built/admin/assets/ghost-c4f5365681d093dace25873e79b1e841.css +1 -0
  75. package/core/built/admin/assets/{ghost-f902f5e70d4a27fb3c35f775e50e65ff.js → ghost-c74cada1daf3e4f04e7ef4dfd2c77eea.js} +115 -105
  76. package/core/built/admin/assets/ghost-dark-282e39d72ddcbc4ea45fc80c6580a33e.css +1 -0
  77. package/core/built/admin/index.html +4 -4
  78. package/core/frontend/src/cards/css/signup.css +183 -0
  79. package/core/server/api/endpoints/collections.js +115 -0
  80. package/core/server/api/endpoints/index.js +4 -0
  81. package/core/server/run-update-check.js +3 -0
  82. package/core/server/services/collections/index.js +22 -0
  83. package/core/server/services/members/content-gating.js +1 -1
  84. package/core/server/web/api/endpoints/admin/routes.js +7 -0
  85. package/core/shared/labs.js +0 -1
  86. package/package.json +135 -134
  87. package/yarn.lock +459 -882
  88. package/components/tryghost-adapter-cache-memory-ttl-5.48.1.tgz +0 -0
  89. package/components/tryghost-adapter-cache-redis-5.48.1.tgz +0 -0
  90. package/components/tryghost-adapter-manager-5.48.1.tgz +0 -0
  91. package/components/tryghost-announcement-bar-settings-5.48.1.tgz +0 -0
  92. package/components/tryghost-api-version-compatibility-service-5.48.1.tgz +0 -0
  93. package/components/tryghost-audience-feedback-5.48.1.tgz +0 -0
  94. package/components/tryghost-bootstrap-socket-5.48.1.tgz +0 -0
  95. package/components/tryghost-collections-5.48.1.tgz +0 -0
  96. package/components/tryghost-constants-5.48.1.tgz +0 -0
  97. package/components/tryghost-custom-theme-settings-service-5.48.1.tgz +0 -0
  98. package/components/tryghost-data-generator-5.48.1.tgz +0 -0
  99. package/components/tryghost-domain-events-5.48.1.tgz +0 -0
  100. package/components/tryghost-dynamic-routing-events-5.48.1.tgz +0 -0
  101. package/components/tryghost-email-analytics-provider-mailgun-5.48.1.tgz +0 -0
  102. package/components/tryghost-email-analytics-service-5.48.1.tgz +0 -0
  103. package/components/tryghost-email-content-generator-5.48.1.tgz +0 -0
  104. package/components/tryghost-email-events-5.48.1.tgz +0 -0
  105. package/components/tryghost-email-service-5.48.1.tgz +0 -0
  106. package/components/tryghost-email-suppression-list-5.48.1.tgz +0 -0
  107. package/components/tryghost-event-aware-cache-wrapper-5.48.1.tgz +0 -0
  108. package/components/tryghost-express-dynamic-redirects-5.48.1.tgz +0 -0
  109. package/components/tryghost-external-media-inliner-5.48.1.tgz +0 -0
  110. package/components/tryghost-extract-api-key-5.48.1.tgz +0 -0
  111. package/components/tryghost-html-to-plaintext-5.48.1.tgz +0 -0
  112. package/components/tryghost-i18n-5.48.1.tgz +0 -0
  113. package/components/tryghost-importer-handler-content-files-5.48.1.tgz +0 -0
  114. package/components/tryghost-importer-revue-5.48.1.tgz +0 -0
  115. package/components/tryghost-in-memory-repository-5.48.1.tgz +0 -0
  116. package/components/tryghost-job-manager-5.48.1.tgz +0 -0
  117. package/components/tryghost-link-redirects-5.48.1.tgz +0 -0
  118. package/components/tryghost-link-replacer-5.48.1.tgz +0 -0
  119. package/components/tryghost-link-tracking-5.48.1.tgz +0 -0
  120. package/components/tryghost-mailgun-client-5.48.1.tgz +0 -0
  121. package/components/tryghost-member-attribution-5.48.1.tgz +0 -0
  122. package/components/tryghost-member-events-5.48.1.tgz +0 -0
  123. package/components/tryghost-members-csv-5.48.1.tgz +0 -0
  124. package/components/tryghost-members-events-service-5.48.1.tgz +0 -0
  125. package/components/tryghost-members-importer-5.48.1.tgz +0 -0
  126. package/components/tryghost-members-offers-5.48.1.tgz +0 -0
  127. package/components/tryghost-members-payments-5.48.1.tgz +0 -0
  128. package/components/tryghost-members-ssr-5.48.1.tgz +0 -0
  129. package/components/tryghost-mentions-email-report-5.48.1.tgz +0 -0
  130. package/components/tryghost-milestones-5.48.1.tgz +0 -0
  131. package/components/tryghost-minifier-5.48.1.tgz +0 -0
  132. package/components/tryghost-mw-api-version-mismatch-5.48.1.tgz +0 -0
  133. package/components/tryghost-mw-cache-control-5.48.1.tgz +0 -0
  134. package/components/tryghost-mw-session-from-token-5.48.1.tgz +0 -0
  135. package/components/tryghost-mw-update-user-last-seen-5.48.1.tgz +0 -0
  136. package/components/tryghost-mw-version-match-5.48.1.tgz +0 -0
  137. package/components/tryghost-mw-vhost-5.48.1.tgz +0 -0
  138. package/components/tryghost-oembed-service-5.48.1.tgz +0 -0
  139. package/components/tryghost-package-json-5.48.1.tgz +0 -0
  140. package/components/tryghost-post-revisions-5.48.1.tgz +0 -0
  141. package/components/tryghost-posts-service-5.48.1.tgz +0 -0
  142. package/components/tryghost-referrers-5.48.1.tgz +0 -0
  143. package/components/tryghost-security-5.48.1.tgz +0 -0
  144. package/components/tryghost-session-service-5.48.1.tgz +0 -0
  145. package/components/tryghost-settings-path-manager-5.48.1.tgz +0 -0
  146. package/components/tryghost-slack-notifications-5.48.1.tgz +0 -0
  147. package/components/tryghost-stats-service-5.48.1.tgz +0 -0
  148. package/components/tryghost-verification-trigger-5.48.1.tgz +0 -0
  149. package/components/tryghost-version-notifications-data-service-5.48.1.tgz +0 -0
  150. package/components/tryghost-webmentions-5.48.1.tgz +0 -0
  151. package/core/built/admin/assets/ghost-4f32549fd7f27543889f729a10be18b4.css +0 -1
  152. package/core/built/admin/assets/ghost-dark-99e343e4c1fcf9b6c1bde9dea2b50c6f.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.48%22%2C%22name%22%3A%22ghost-admin%22%7D%2C%22ember-simple-auth%22%3A%7B%7D%2C%22ember-websockets%22%3A%7B%22socketIO%22%3Atrue%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.49%22%2C%22name%22%3A%22ghost-admin%22%7D%2C%22ember-simple-auth%22%3A%7B%7D%2C%22ember-websockets%22%3A%7B%22socketIO%22%3Atrue%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" />
@@ -37,7 +37,7 @@
37
37
  </style>
38
38
 
39
39
  <link integrity="" rel="stylesheet" href="assets/vendor-3e6947aa681f0fb82b193090e520dc73.css">
40
- <link integrity="" rel="stylesheet" href="assets/ghost-4f32549fd7f27543889f729a10be18b4.css" title="light">
40
+ <link integrity="" rel="stylesheet" href="assets/ghost-c4f5365681d093dace25873e79b1e841.css" title="light">
41
41
 
42
42
 
43
43
  </head>
@@ -58,7 +58,7 @@
58
58
 
59
59
  <script src="assets/vendor-171b41e446763449417a8687279d2270.js"></script>
60
60
  <script src="assets/chunk.362.6bb7cbc3fd3afda65ae1.js"></script>
61
- <script src="assets/chunk.143.7ffa4fa3e2ad37094023.js"></script>
62
- <script src="assets/ghost-f902f5e70d4a27fb3c35f775e50e65ff.js"></script>
61
+ <script src="assets/chunk.143.c84e66067cd00cfdfb1a.js"></script>
62
+ <script src="assets/ghost-c74cada1daf3e4f04e7ef4dfd2c77eea.js"></script>
63
63
  </body>
64
64
  </html>
@@ -0,0 +1,183 @@
1
+ .kg-signup-card,
2
+ .kg-signup-card * {
3
+ box-sizing: border-box;
4
+ }
5
+
6
+ .kg-signup-card {
7
+ min-height: 40vh;
8
+ }
9
+
10
+ .kg-signup-card.kg-width-wide {
11
+ min-height: 60vh;
12
+ }
13
+
14
+ .kg-signup-card.kg-width-full {
15
+ min-height: 80vh;
16
+ }
17
+
18
+ .kg-signup-card a,
19
+ .kg-signup-card a span {
20
+ color: currentColor;
21
+ }
22
+
23
+ .kg-signup-card-container {
24
+ position: relative;
25
+ display: flex;
26
+ flex-direction: column;
27
+ align-items: flex-start;
28
+ justify-content: center;
29
+ height: 100%;
30
+ padding: 12vmin 6em;
31
+ background-size: cover;
32
+ background-position: center;
33
+ text-align: left;
34
+ }
35
+
36
+ .kg-signup-card-container.align-center {
37
+ align-items: center;
38
+ text-align: center;
39
+ }
40
+
41
+ .kg-signup-card-container.kg-style-accent {
42
+ background-color: var(--ghost-accent-color);
43
+ }
44
+
45
+ .kg-signup-card.kg-style-image h2.kg-signup-card-heading,
46
+ .kg-signup-card.kg-style-image h3.kg-signup-card-subheading,
47
+ .kg-signup-card.kg-style-image .kg-signup-card-button {
48
+ z-index: 999;
49
+ }
50
+
51
+
52
+ /* Heading */
53
+
54
+ .kg-signup-card h2.kg-signup-card-heading {
55
+ font-size: 4em;
56
+ font-weight: 700;
57
+ line-height: 1.1em;
58
+ letter-spacing: -0.01em;
59
+ margin: 0;
60
+ }
61
+
62
+ .kg-signup-card h2.kg-signup-card-heading strong {
63
+ font-weight: 800;
64
+ }
65
+
66
+ .kg-signup-card.kg-width-wide h2.kg-signup-card-heading {
67
+ font-size: 5em;
68
+ }
69
+
70
+ .kg-signup-card.kg-width-full h2.kg-signup-card-heading {
71
+ font-size: 6em;
72
+ }
73
+
74
+
75
+ /* Subheading */
76
+
77
+ .kg-signup-card-subheading {
78
+ margin: 0 0 2em;
79
+ }
80
+
81
+ .kg-signup-card h3.kg-signup-card-subheading {
82
+ font-size: 1.25em;
83
+ font-weight: 500;
84
+ line-height: 1.4em;
85
+ margin: 0;
86
+ max-width: 40em;
87
+ }
88
+
89
+ .kg-signup-card h2 + h3.kg-signup-card-subheading {
90
+ margin: 0.35em 0 0;
91
+ }
92
+
93
+ .kg-signup-card h3.kg-signup-card-subheading strong {
94
+ font-weight: 600;
95
+ }
96
+
97
+ .kg-signup-card.kg-width-wide h3.kg-signup-card-subheading {
98
+ font-size: 1.5em;
99
+ }
100
+
101
+ .kg-signup-card.kg-width-full h3.kg-signup-card-subheading {
102
+ font-size: 1.75em;
103
+ }
104
+
105
+
106
+ /* Subscribe form */
107
+
108
+ .kg-signup-card-form {
109
+ display: flex;
110
+ margin: 2.8em 0 0;
111
+ }
112
+
113
+ .kg-width-regular .kg-signup-card-form {
114
+ margin: 2em 0 0;
115
+ }
116
+
117
+ .kg-width-full .kg-signup-card-form {
118
+ margin: 4em 0 0;
119
+ }
120
+
121
+ .kg-signup-card-input {
122
+ min-width: 300px;
123
+ border: solid 1px;
124
+ padding: 12px 16px;
125
+ font-size: 1.1em;
126
+ }
127
+
128
+ .kg-signup-card-button {
129
+ display: flex;
130
+ position: static;
131
+ align-items: center;
132
+ outline: none;
133
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
134
+ font-size: 1em;
135
+ font-weight: 600;
136
+ line-height: 1em;
137
+ text-align: center;
138
+ text-decoration: none;
139
+ letter-spacing: .2px;
140
+ white-space: nowrap;
141
+ text-overflow: ellipsis;
142
+ height: 3em;
143
+ padding: 0 1.2em;
144
+ transition: opacity .2s ease;
145
+ }
146
+
147
+ .kg-signup-card-button.kg-style-accent {
148
+ background-color: var(--ghost-accent-color);
149
+ }
150
+
151
+ .kg-signup-card h2 + .kg-signup-card-button,
152
+ .kg-signup-card h3 + .kg-signup-card-button {
153
+ margin: 1.5em 0 0;
154
+ }
155
+
156
+ .kg-signup-card .kg-signup-card-button:hover {
157
+ opacity: 0.85;
158
+ }
159
+
160
+ .kg-signup-card.kg-width-wide .kg-signup-card-button {
161
+ font-size: 1.05em;
162
+ }
163
+
164
+ .kg-signup-card.kg-width-wide h2 + .kg-signup-card-button,
165
+ .kg-signup-card.kg-width-wide h3 + .kg-signup-card-button {
166
+ margin-top: 1.75em;
167
+ }
168
+
169
+ .kg-signup-card.kg-width-full .kg-signup-card-button {
170
+ font-size: 1.1em;
171
+ }
172
+
173
+ .kg-signup-card.kg-width-full h2 + .kg-signup-card-button,
174
+ .kg-signup-card.kg-width-full h3 + .kg-signup-card-button {
175
+ margin-top: 2em;
176
+ }
177
+
178
+
179
+ /* Disclaimer */
180
+
181
+ .kg-signup-card-disclaimer {
182
+ margin: .8em 0 0;
183
+ }
@@ -0,0 +1,115 @@
1
+ const errors = require('@tryghost/errors');
2
+ const tpl = require('@tryghost/tpl');
3
+ const collectionsService = require('../../services/collections');
4
+
5
+ const messages = {
6
+ collectionNotFound: 'Collection not found.'
7
+ };
8
+
9
+ module.exports = {
10
+ docName: 'collections',
11
+
12
+ browse: {
13
+ options: [
14
+ 'limit',
15
+ 'order',
16
+ 'page'
17
+ ],
18
+ // @NOTE: should have permissions when moving out of Alpha
19
+ permissions: false,
20
+ query(frame) {
21
+ return collectionsService.api.browse(frame.options);
22
+ }
23
+ },
24
+
25
+ read: {
26
+ data: [
27
+ 'id'
28
+ ],
29
+ // @NOTE: should have permissions when moving out of Alpha
30
+ permissions: false,
31
+ async query(frame) {
32
+ const model = await collectionsService.api.read(frame.data.id, frame.options);
33
+
34
+ if (!model) {
35
+ throw new errors.NotFoundError({
36
+ message: tpl(messages.collectionNotFound)
37
+ });
38
+ }
39
+
40
+ return model;
41
+ }
42
+ },
43
+
44
+ add: {
45
+ statusCode: 201,
46
+ headers: {
47
+ cacheInvalidate: true
48
+ },
49
+ // @NOTE: should have permissions when moving out of Alpha
50
+ permissions: false,
51
+ async query(frame) {
52
+ return await collectionsService.api.add(frame.data.collections[0], frame.options);
53
+ }
54
+ },
55
+
56
+ edit: {
57
+ headers: {},
58
+ options: [
59
+ 'id'
60
+ ],
61
+ validation: {
62
+ options: {
63
+ id: {
64
+ required: true
65
+ }
66
+ }
67
+ },
68
+ // @NOTE: should have permissions when moving out of Alpha
69
+ permissions: false,
70
+ async query(frame) {
71
+ const model = await collectionsService.api.edit(Object.assign(frame.data.collections[0], {
72
+ id: frame.options.id
73
+ }), frame.options);
74
+
75
+ if (!model) {
76
+ throw new errors.NotFoundError({
77
+ message: tpl(messages.collectionNotFound)
78
+ });
79
+ }
80
+
81
+ // @NOTE: cache invalidation has to be done manually for now
82
+ // because the model's wasChanged is not returned from
83
+ // the service using in-memory repository layer
84
+ // if (model.wasChanged()) {
85
+ this.headers.cacheInvalidate = true;
86
+ // } else {
87
+ // this.headers.cacheInvalidate = false;
88
+ // }
89
+
90
+ return model;
91
+ }
92
+ },
93
+
94
+ destroy: {
95
+ statusCode: 204,
96
+ headers: {
97
+ cacheInvalidate: true
98
+ },
99
+ options: [
100
+ 'id'
101
+ ],
102
+ validation: {
103
+ options: {
104
+ id: {
105
+ required: true
106
+ }
107
+ }
108
+ },
109
+ // @NOTE: should have permissions when moving out of Alpha
110
+ permissions: false,
111
+ async query(frame) {
112
+ return await collectionsService.api.destroy(frame.options.id);
113
+ }
114
+ }
115
+ };
@@ -12,6 +12,10 @@ module.exports = {
12
12
  return apiFramework.pipeline(require('./authentication'), localUtils);
13
13
  },
14
14
 
15
+ get collections() {
16
+ return apiFramework.pipeline(require('./collections'), localUtils);
17
+ },
18
+
15
19
  get db() {
16
20
  return apiFramework.pipeline(require('./db'), localUtils);
17
21
  },
@@ -40,6 +40,9 @@ if (parentPort) {
40
40
 
41
41
  const settings = require('./services/settings/settings-service');
42
42
  await settings.init();
43
+
44
+ const tiers = require('./services/tiers');
45
+ await tiers.init();
43
46
  // Finished INIT
44
47
 
45
48
  await updateCheck({
@@ -0,0 +1,22 @@
1
+ const {CollectionsService, CollectionsRepositoryInMemory} = require('@tryghost/collections');
2
+
3
+ class CollectionsServiceWrapper {
4
+ api;
5
+
6
+ constructor() {
7
+ const inMemoryCollectionsRepository = new CollectionsRepositoryInMemory();
8
+ const collectionsService = new CollectionsService({
9
+ repository: inMemoryCollectionsRepository
10
+ });
11
+
12
+ this.api = {
13
+ browse: collectionsService.getAll.bind(collectionsService),
14
+ read: collectionsService.getById.bind(collectionsService),
15
+ add: collectionsService.save.bind(collectionsService),
16
+ edit: collectionsService.edit.bind(collectionsService),
17
+ destroy: collectionsService.destroy.bind(collectionsService)
18
+ };
19
+ }
20
+ }
21
+
22
+ module.exports = new CollectionsServiceWrapper();
@@ -46,7 +46,7 @@ function checkPostAccess(post, member) {
46
46
  return BLOCK_ACCESS;
47
47
  }
48
48
  visibility = post.tiers.map((product) => {
49
- return `product:${product.slug}`;
49
+ return `product:'${product.slug}'`;
50
50
  }).join(',');
51
51
  }
52
52
 
@@ -18,6 +18,13 @@ module.exports = function apiRoutes() {
18
18
  // ## Public
19
19
  router.get('/site', mw.publicAdminApi, http(api.site.read));
20
20
 
21
+ // ## Collections
22
+ router.get('/collections', mw.authAdminApi, labs.enabledMiddleware('collections'), http(api.collections.browse));
23
+ router.get('/collections/:id', mw.authAdminApi, labs.enabledMiddleware('collections'), http(api.collections.read));
24
+ router.post('/collections', mw.authAdminApi, labs.enabledMiddleware('collections'), http(api.collections.add));
25
+ router.put('/collections/:id', mw.authAdminApi, labs.enabledMiddleware('collections'), http(api.collections.edit));
26
+ router.del('/collections/:id', mw.authAdminApi, labs.enabledMiddleware('collections'), http(api.collections.destroy));
27
+
21
28
  // ## Configuration
22
29
  router.get('/config', mw.authAdminApi, http(api.config.read));
23
30
 
@@ -32,7 +32,6 @@ const BETA_FEATURES = [
32
32
 
33
33
  const ALPHA_FEATURES = [
34
34
  'urlCache',
35
- 'migrateApp',
36
35
  'lexicalEditor',
37
36
  'lexicalMultiplayer',
38
37
  'websockets',