@strapi/content-releases 0.0.0-next.fdac61dd05ca665168f51f655f1d165b55ec4231 → 0.0.0-next.ffc36acb308febe288f1a31b62cbbb75b286585c

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 (262) hide show
  1. package/dist/admin/assets/purchase-page-illustration-dark.svg.js +6 -0
  2. package/dist/admin/assets/purchase-page-illustration-dark.svg.js.map +1 -0
  3. package/dist/admin/assets/purchase-page-illustration-dark.svg.mjs +4 -0
  4. package/dist/admin/assets/purchase-page-illustration-dark.svg.mjs.map +1 -0
  5. package/dist/admin/assets/purchase-page-illustration-light.svg.js +6 -0
  6. package/dist/admin/assets/purchase-page-illustration-light.svg.js.map +1 -0
  7. package/dist/admin/assets/purchase-page-illustration-light.svg.mjs +4 -0
  8. package/dist/admin/assets/purchase-page-illustration-light.svg.mjs.map +1 -0
  9. package/dist/admin/components/EntryValidationPopover.js +344 -0
  10. package/dist/admin/components/EntryValidationPopover.js.map +1 -0
  11. package/dist/admin/components/EntryValidationPopover.mjs +342 -0
  12. package/dist/admin/components/EntryValidationPopover.mjs.map +1 -0
  13. package/dist/admin/components/RelativeTime.js +76 -0
  14. package/dist/admin/components/RelativeTime.js.map +1 -0
  15. package/dist/admin/components/RelativeTime.mjs +55 -0
  16. package/dist/admin/components/RelativeTime.mjs.map +1 -0
  17. package/dist/admin/components/ReleaseAction.js +203 -0
  18. package/dist/admin/components/ReleaseAction.js.map +1 -0
  19. package/dist/admin/components/ReleaseAction.mjs +201 -0
  20. package/dist/admin/components/ReleaseAction.mjs.map +1 -0
  21. package/dist/admin/components/ReleaseActionMenu.js +194 -0
  22. package/dist/admin/components/ReleaseActionMenu.js.map +1 -0
  23. package/dist/admin/components/ReleaseActionMenu.mjs +173 -0
  24. package/dist/admin/components/ReleaseActionMenu.mjs.map +1 -0
  25. package/dist/admin/components/ReleaseActionModal.js +268 -0
  26. package/dist/admin/components/ReleaseActionModal.js.map +1 -0
  27. package/dist/admin/components/ReleaseActionModal.mjs +244 -0
  28. package/dist/admin/components/ReleaseActionModal.mjs.map +1 -0
  29. package/dist/admin/components/ReleaseActionOptions.js +104 -0
  30. package/dist/admin/components/ReleaseActionOptions.js.map +1 -0
  31. package/dist/admin/components/ReleaseActionOptions.mjs +102 -0
  32. package/dist/admin/components/ReleaseActionOptions.mjs.map +1 -0
  33. package/dist/admin/components/ReleaseListCell.js +103 -0
  34. package/dist/admin/components/ReleaseListCell.js.map +1 -0
  35. package/dist/admin/components/ReleaseListCell.mjs +100 -0
  36. package/dist/admin/components/ReleaseListCell.mjs.map +1 -0
  37. package/dist/admin/components/ReleaseModal.js +323 -0
  38. package/dist/admin/components/ReleaseModal.js.map +1 -0
  39. package/dist/admin/components/ReleaseModal.mjs +302 -0
  40. package/dist/admin/components/ReleaseModal.mjs.map +1 -0
  41. package/dist/admin/components/ReleasesPanel.js +138 -0
  42. package/dist/admin/components/ReleasesPanel.js.map +1 -0
  43. package/dist/admin/components/ReleasesPanel.mjs +136 -0
  44. package/dist/admin/components/ReleasesPanel.mjs.map +1 -0
  45. package/dist/admin/constants.js +77 -0
  46. package/dist/admin/constants.js.map +1 -0
  47. package/dist/admin/constants.mjs +75 -0
  48. package/dist/admin/constants.mjs.map +1 -0
  49. package/dist/admin/index.js +121 -14
  50. package/dist/admin/index.js.map +1 -1
  51. package/dist/admin/index.mjs +122 -13
  52. package/dist/admin/index.mjs.map +1 -1
  53. package/dist/admin/modules/hooks.js +8 -0
  54. package/dist/admin/modules/hooks.js.map +1 -0
  55. package/dist/admin/modules/hooks.mjs +6 -0
  56. package/dist/admin/modules/hooks.mjs.map +1 -0
  57. package/dist/admin/pages/App.js +29 -0
  58. package/dist/admin/pages/App.js.map +1 -0
  59. package/dist/admin/pages/App.mjs +27 -0
  60. package/dist/admin/pages/App.mjs.map +1 -0
  61. package/dist/admin/pages/PurchaseContentReleases.js +192 -0
  62. package/dist/admin/pages/PurchaseContentReleases.js.map +1 -0
  63. package/dist/admin/pages/PurchaseContentReleases.mjs +190 -0
  64. package/dist/admin/pages/PurchaseContentReleases.mjs.map +1 -0
  65. package/dist/admin/pages/ReleaseDetailsPage.js +772 -0
  66. package/dist/admin/pages/ReleaseDetailsPage.js.map +1 -0
  67. package/dist/admin/pages/ReleaseDetailsPage.mjs +751 -0
  68. package/dist/admin/pages/ReleaseDetailsPage.mjs.map +1 -0
  69. package/dist/admin/pages/ReleasesPage.js +403 -0
  70. package/dist/admin/pages/ReleasesPage.js.map +1 -0
  71. package/dist/admin/pages/ReleasesPage.mjs +381 -0
  72. package/dist/admin/pages/ReleasesPage.mjs.map +1 -0
  73. package/dist/admin/{chunks/ReleasesSettingsPage-DFVGppsl.js → pages/ReleasesSettingsPage.js} +47 -30
  74. package/dist/admin/pages/ReleasesSettingsPage.js.map +1 -0
  75. package/dist/admin/{chunks/ReleasesSettingsPage-BzdLEfxa.mjs → pages/ReleasesSettingsPage.mjs} +41 -24
  76. package/dist/admin/pages/ReleasesSettingsPage.mjs.map +1 -0
  77. package/dist/admin/pluginId.js +6 -0
  78. package/dist/admin/pluginId.js.map +1 -0
  79. package/dist/admin/pluginId.mjs +4 -0
  80. package/dist/admin/pluginId.mjs.map +1 -0
  81. package/dist/admin/services/release.js +464 -0
  82. package/dist/admin/services/release.js.map +1 -0
  83. package/dist/admin/services/release.mjs +447 -0
  84. package/dist/admin/services/release.mjs.map +1 -0
  85. package/dist/admin/store/hooks.js +8 -0
  86. package/dist/admin/store/hooks.js.map +1 -0
  87. package/dist/admin/store/hooks.mjs +6 -0
  88. package/dist/admin/store/hooks.mjs.map +1 -0
  89. package/dist/admin/{chunks/en-BzpFfVeO.js → translations/en.json.js} +8 -3
  90. package/dist/admin/translations/en.json.js.map +1 -0
  91. package/dist/admin/{chunks/en-B2EeDoOz.mjs → translations/en.json.mjs} +7 -2
  92. package/dist/admin/translations/en.json.mjs.map +1 -0
  93. package/dist/admin/translations/uk.json.js +103 -0
  94. package/dist/admin/translations/uk.json.js.map +1 -0
  95. package/dist/admin/translations/uk.json.mjs +101 -0
  96. package/dist/admin/translations/uk.json.mjs.map +1 -0
  97. package/dist/admin/utils/api.js +8 -0
  98. package/dist/admin/utils/api.js.map +1 -0
  99. package/dist/admin/utils/api.mjs +6 -0
  100. package/dist/admin/utils/api.mjs.map +1 -0
  101. package/dist/admin/utils/prefixPluginTranslations.js +11 -0
  102. package/dist/admin/utils/prefixPluginTranslations.js.map +1 -0
  103. package/dist/admin/utils/prefixPluginTranslations.mjs +9 -0
  104. package/dist/admin/utils/prefixPluginTranslations.mjs.map +1 -0
  105. package/dist/admin/utils/time.js +42 -0
  106. package/dist/admin/utils/time.js.map +1 -0
  107. package/dist/admin/utils/time.mjs +39 -0
  108. package/dist/admin/utils/time.mjs.map +1 -0
  109. package/dist/admin/{chunks/schemas-DS7NeFDN.js → validation/schemas.js} +1 -1
  110. package/dist/admin/validation/schemas.js.map +1 -0
  111. package/dist/admin/{chunks/schemas-DMt8h1z-.mjs → validation/schemas.mjs} +2 -2
  112. package/dist/admin/validation/schemas.mjs.map +1 -0
  113. package/dist/server/bootstrap.js +68 -0
  114. package/dist/server/bootstrap.js.map +1 -0
  115. package/dist/server/bootstrap.mjs +66 -0
  116. package/dist/server/bootstrap.mjs.map +1 -0
  117. package/dist/server/constants.js +74 -0
  118. package/dist/server/constants.js.map +1 -0
  119. package/dist/server/constants.mjs +69 -0
  120. package/dist/server/constants.mjs.map +1 -0
  121. package/dist/server/content-types/index.js +12 -0
  122. package/dist/server/content-types/index.js.map +1 -0
  123. package/dist/server/content-types/index.mjs +10 -0
  124. package/dist/server/content-types/index.mjs.map +1 -0
  125. package/dist/server/content-types/release/index.js +10 -0
  126. package/dist/server/content-types/release/index.js.map +1 -0
  127. package/dist/server/content-types/release/index.mjs +8 -0
  128. package/dist/server/content-types/release/index.mjs.map +1 -0
  129. package/dist/server/content-types/release/schema.js +58 -0
  130. package/dist/server/content-types/release/schema.js.map +1 -0
  131. package/dist/server/content-types/release/schema.mjs +56 -0
  132. package/dist/server/content-types/release/schema.mjs.map +1 -0
  133. package/dist/server/content-types/release-action/index.js +10 -0
  134. package/dist/server/content-types/release-action/index.js.map +1 -0
  135. package/dist/server/content-types/release-action/index.mjs +8 -0
  136. package/dist/server/content-types/release-action/index.mjs.map +1 -0
  137. package/dist/server/content-types/release-action/schema.js +55 -0
  138. package/dist/server/content-types/release-action/schema.js.map +1 -0
  139. package/dist/server/content-types/release-action/schema.mjs +53 -0
  140. package/dist/server/content-types/release-action/schema.mjs.map +1 -0
  141. package/dist/server/controllers/index.js +14 -0
  142. package/dist/server/controllers/index.js.map +1 -0
  143. package/dist/server/controllers/index.mjs +12 -0
  144. package/dist/server/controllers/index.mjs.map +1 -0
  145. package/dist/server/controllers/release-action.js +150 -0
  146. package/dist/server/controllers/release-action.js.map +1 -0
  147. package/dist/server/controllers/release-action.mjs +148 -0
  148. package/dist/server/controllers/release-action.mjs.map +1 -0
  149. package/dist/server/controllers/release.js +302 -0
  150. package/dist/server/controllers/release.js.map +1 -0
  151. package/dist/server/controllers/release.mjs +300 -0
  152. package/dist/server/controllers/release.mjs.map +1 -0
  153. package/dist/server/controllers/settings.js +37 -0
  154. package/dist/server/controllers/settings.js.map +1 -0
  155. package/dist/server/controllers/settings.mjs +35 -0
  156. package/dist/server/controllers/settings.mjs.map +1 -0
  157. package/dist/server/controllers/validation/release-action.js +34 -0
  158. package/dist/server/controllers/validation/release-action.js.map +1 -0
  159. package/dist/server/controllers/validation/release-action.mjs +30 -0
  160. package/dist/server/controllers/validation/release-action.mjs.map +1 -0
  161. package/dist/server/controllers/validation/release.js +26 -0
  162. package/dist/server/controllers/validation/release.js.map +1 -0
  163. package/dist/server/controllers/validation/release.mjs +22 -0
  164. package/dist/server/controllers/validation/release.mjs.map +1 -0
  165. package/dist/server/controllers/validation/settings.js +32 -0
  166. package/dist/server/controllers/validation/settings.js.map +1 -0
  167. package/dist/server/controllers/validation/settings.mjs +10 -0
  168. package/dist/server/controllers/validation/settings.mjs.map +1 -0
  169. package/dist/server/destroy.js +15 -0
  170. package/dist/server/destroy.js.map +1 -0
  171. package/dist/server/destroy.mjs +13 -0
  172. package/dist/server/destroy.mjs.map +1 -0
  173. package/dist/server/index.js +16 -2336
  174. package/dist/server/index.js.map +1 -1
  175. package/dist/server/index.mjs +7 -2308
  176. package/dist/server/index.mjs.map +1 -1
  177. package/dist/server/middlewares/documents.js +104 -0
  178. package/dist/server/middlewares/documents.js.map +1 -0
  179. package/dist/server/middlewares/documents.mjs +101 -0
  180. package/dist/server/middlewares/documents.mjs.map +1 -0
  181. package/dist/server/migrations/database/5.0.0-document-id-in-actions.js +51 -0
  182. package/dist/server/migrations/database/5.0.0-document-id-in-actions.js.map +1 -0
  183. package/dist/server/migrations/database/5.0.0-document-id-in-actions.mjs +49 -0
  184. package/dist/server/migrations/database/5.0.0-document-id-in-actions.mjs.map +1 -0
  185. package/dist/server/migrations/index.js +205 -0
  186. package/dist/server/migrations/index.js.map +1 -0
  187. package/dist/server/migrations/index.mjs +198 -0
  188. package/dist/server/migrations/index.mjs.map +1 -0
  189. package/dist/server/register.js +23 -0
  190. package/dist/server/register.js.map +1 -0
  191. package/dist/server/register.mjs +21 -0
  192. package/dist/server/register.mjs.map +1 -0
  193. package/dist/server/routes/index.js +14 -0
  194. package/dist/server/routes/index.js.map +1 -0
  195. package/dist/server/routes/index.mjs +12 -0
  196. package/dist/server/routes/index.mjs.map +1 -0
  197. package/dist/server/routes/release-action.js +100 -0
  198. package/dist/server/routes/release-action.js.map +1 -0
  199. package/dist/server/routes/release-action.mjs +98 -0
  200. package/dist/server/routes/release-action.mjs.map +1 -0
  201. package/dist/server/routes/release.js +154 -0
  202. package/dist/server/routes/release.js.map +1 -0
  203. package/dist/server/routes/release.mjs +152 -0
  204. package/dist/server/routes/release.mjs.map +1 -0
  205. package/dist/server/routes/settings.js +46 -0
  206. package/dist/server/routes/settings.js.map +1 -0
  207. package/dist/server/routes/settings.mjs +44 -0
  208. package/dist/server/routes/settings.mjs.map +1 -0
  209. package/dist/server/services/index.js +18 -0
  210. package/dist/server/services/index.js.map +1 -0
  211. package/dist/server/services/index.mjs +16 -0
  212. package/dist/server/services/index.mjs.map +1 -0
  213. package/dist/server/services/release-action.js +324 -0
  214. package/dist/server/services/release-action.js.map +1 -0
  215. package/dist/server/services/release-action.mjs +322 -0
  216. package/dist/server/services/release-action.mjs.map +1 -0
  217. package/dist/server/services/release.js +324 -0
  218. package/dist/server/services/release.js.map +1 -0
  219. package/dist/server/services/release.mjs +322 -0
  220. package/dist/server/services/release.mjs.map +1 -0
  221. package/dist/server/services/scheduling.js +74 -0
  222. package/dist/server/services/scheduling.js.map +1 -0
  223. package/dist/server/services/scheduling.mjs +72 -0
  224. package/dist/server/services/scheduling.mjs.map +1 -0
  225. package/dist/server/services/settings.js +34 -0
  226. package/dist/server/services/settings.js.map +1 -0
  227. package/dist/server/services/settings.mjs +32 -0
  228. package/dist/server/services/settings.mjs.map +1 -0
  229. package/dist/server/services/validation.js +91 -0
  230. package/dist/server/services/validation.js.map +1 -0
  231. package/dist/server/services/validation.mjs +86 -0
  232. package/dist/server/services/validation.mjs.map +1 -0
  233. package/dist/server/src/destroy.d.ts.map +1 -1
  234. package/dist/server/src/index.d.ts +4 -4
  235. package/dist/server/src/services/index.d.ts +4 -4
  236. package/dist/server/src/services/release-action.d.ts.map +1 -1
  237. package/dist/server/src/services/scheduling.d.ts +4 -5
  238. package/dist/server/src/services/scheduling.d.ts.map +1 -1
  239. package/dist/server/src/utils/index.d.ts.map +1 -1
  240. package/dist/server/utils/index.js +94 -0
  241. package/dist/server/utils/index.js.map +1 -0
  242. package/dist/server/utils/index.mjs +88 -0
  243. package/dist/server/utils/index.mjs.map +1 -0
  244. package/package.json +10 -11
  245. package/dist/admin/chunks/App-B9yCdSLJ.js +0 -1866
  246. package/dist/admin/chunks/App-B9yCdSLJ.js.map +0 -1
  247. package/dist/admin/chunks/App-CuOosufQ.mjs +0 -1845
  248. package/dist/admin/chunks/App-CuOosufQ.mjs.map +0 -1
  249. package/dist/admin/chunks/PurchaseContentReleases-BCME5SQU.js +0 -55
  250. package/dist/admin/chunks/PurchaseContentReleases-BCME5SQU.js.map +0 -1
  251. package/dist/admin/chunks/PurchaseContentReleases-S1ccDSwp.mjs +0 -53
  252. package/dist/admin/chunks/PurchaseContentReleases-S1ccDSwp.mjs.map +0 -1
  253. package/dist/admin/chunks/ReleasesSettingsPage-BzdLEfxa.mjs.map +0 -1
  254. package/dist/admin/chunks/ReleasesSettingsPage-DFVGppsl.js.map +0 -1
  255. package/dist/admin/chunks/en-B2EeDoOz.mjs.map +0 -1
  256. package/dist/admin/chunks/en-BzpFfVeO.js.map +0 -1
  257. package/dist/admin/chunks/index-1nn-zHX-.js +0 -1657
  258. package/dist/admin/chunks/index-1nn-zHX-.js.map +0 -1
  259. package/dist/admin/chunks/index-CmAFGQWf.mjs +0 -1618
  260. package/dist/admin/chunks/index-CmAFGQWf.mjs.map +0 -1
  261. package/dist/admin/chunks/schemas-DMt8h1z-.mjs.map +0 -1
  262. package/dist/admin/chunks/schemas-DS7NeFDN.js.map +0 -1
@@ -0,0 +1,91 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var utils = require('@strapi/utils');
6
+ var constants = require('../constants.js');
7
+
8
+ class AlreadyOnReleaseError extends utils.errors.ApplicationError {
9
+ constructor(message){
10
+ super(message);
11
+ this.name = 'AlreadyOnReleaseError';
12
+ }
13
+ }
14
+ const createReleaseValidationService = ({ strapi })=>({
15
+ async validateUniqueEntry (releaseId, releaseActionArgs) {
16
+ /**
17
+ * Asserting the type, otherwise TS complains: 'release.actions' is of type 'unknown', even though the types come through for non-populated fields...
18
+ * Possibly related to the comment on GetValues: https://github.com/strapi/strapi/blob/main/packages/core/types/src/modules/entity-service/result.ts
19
+ */ const release = await strapi.db.query(constants.RELEASE_MODEL_UID).findOne({
20
+ where: {
21
+ id: releaseId
22
+ },
23
+ populate: {
24
+ actions: true
25
+ }
26
+ });
27
+ if (!release) {
28
+ throw new utils.errors.NotFoundError(`No release found for id ${releaseId}`);
29
+ }
30
+ const isEntryInRelease = release.actions.some((action)=>action.entryDocumentId === releaseActionArgs.entryDocumentId && action.contentType === releaseActionArgs.contentType && (releaseActionArgs.locale ? action.locale === releaseActionArgs.locale : true));
31
+ if (isEntryInRelease) {
32
+ throw new AlreadyOnReleaseError(`Entry with documentId ${releaseActionArgs.entryDocumentId}${releaseActionArgs.locale ? `( ${releaseActionArgs.locale})` : ''} and contentType ${releaseActionArgs.contentType} already exists in release with id ${releaseId}`);
33
+ }
34
+ },
35
+ validateEntryData (contentTypeUid, entryDocumentId) {
36
+ const contentType = strapi.contentType(contentTypeUid);
37
+ if (!contentType) {
38
+ throw new utils.errors.NotFoundError(`No content type found for uid ${contentTypeUid}`);
39
+ }
40
+ if (!utils.contentTypes.hasDraftAndPublish(contentType)) {
41
+ throw new utils.errors.ValidationError(`Content type with uid ${contentTypeUid} does not have draftAndPublish enabled`);
42
+ }
43
+ if (contentType.kind === 'collectionType' && !entryDocumentId) {
44
+ throw new utils.errors.ValidationError('Document id is required for collection type');
45
+ }
46
+ },
47
+ async validatePendingReleasesLimit () {
48
+ // Use the maximum releases option if it exists, otherwise default to 3
49
+ const featureCfg = strapi.ee.features.get('cms-content-releases');
50
+ const maximumPendingReleases = typeof featureCfg === 'object' && featureCfg?.options?.maximumReleases || 3;
51
+ const [, pendingReleasesCount] = await strapi.db.query(constants.RELEASE_MODEL_UID).findWithCount({
52
+ filters: {
53
+ releasedAt: {
54
+ $null: true
55
+ }
56
+ }
57
+ });
58
+ // Unlimited is a number that will never be reached like 9999
59
+ if (pendingReleasesCount >= maximumPendingReleases) {
60
+ throw new utils.errors.ValidationError('You have reached the maximum number of pending releases');
61
+ }
62
+ },
63
+ async validateUniqueNameForPendingRelease (name, id) {
64
+ const pendingReleases = await strapi.db.query(constants.RELEASE_MODEL_UID).findMany({
65
+ where: {
66
+ releasedAt: {
67
+ $null: true
68
+ },
69
+ name,
70
+ ...id && {
71
+ id: {
72
+ $ne: id
73
+ }
74
+ }
75
+ }
76
+ });
77
+ const isNameUnique = pendingReleases.length === 0;
78
+ if (!isNameUnique) {
79
+ throw new utils.errors.ValidationError(`Release with name ${name} already exists`);
80
+ }
81
+ },
82
+ async validateScheduledAtIsLaterThanNow (scheduledAt) {
83
+ if (scheduledAt && new Date(scheduledAt) <= new Date()) {
84
+ throw new utils.errors.ValidationError('Scheduled at must be later than now');
85
+ }
86
+ }
87
+ });
88
+
89
+ exports.AlreadyOnReleaseError = AlreadyOnReleaseError;
90
+ exports.default = createReleaseValidationService;
91
+ //# sourceMappingURL=validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.js","sources":["../../../server/src/services/validation.ts"],"sourcesContent":["import { errors, contentTypes } from '@strapi/utils';\nimport type { Core, UID } from '@strapi/types';\nimport type { Release, CreateRelease, UpdateRelease } from '../../../shared/contracts/releases';\nimport type { CreateReleaseAction } from '../../../shared/contracts/release-actions';\nimport { RELEASE_MODEL_UID } from '../constants';\n\nexport class AlreadyOnReleaseError extends errors.ApplicationError<'AlreadyOnReleaseError'> {\n constructor(message: string) {\n super(message);\n this.name = 'AlreadyOnReleaseError';\n }\n}\n\nconst createReleaseValidationService = ({ strapi }: { strapi: Core.Strapi }) => ({\n async validateUniqueEntry(\n releaseId: CreateReleaseAction.Request['params']['releaseId'],\n releaseActionArgs: CreateReleaseAction.Request['body']\n ) {\n /**\n * Asserting the type, otherwise TS complains: 'release.actions' is of type 'unknown', even though the types come through for non-populated fields...\n * Possibly related to the comment on GetValues: https://github.com/strapi/strapi/blob/main/packages/core/types/src/modules/entity-service/result.ts\n */\n const release = (await strapi.db.query(RELEASE_MODEL_UID).findOne({\n where: {\n id: releaseId,\n },\n populate: {\n actions: true,\n },\n })) as Release | null;\n\n if (!release) {\n throw new errors.NotFoundError(`No release found for id ${releaseId}`);\n }\n\n const isEntryInRelease = release.actions.some(\n (action) =>\n action.entryDocumentId === releaseActionArgs.entryDocumentId &&\n action.contentType === releaseActionArgs.contentType &&\n (releaseActionArgs.locale ? action.locale === releaseActionArgs.locale : true)\n );\n\n if (isEntryInRelease) {\n throw new AlreadyOnReleaseError(\n `Entry with documentId ${releaseActionArgs.entryDocumentId}${releaseActionArgs.locale ? `( ${releaseActionArgs.locale})` : ''} and contentType ${releaseActionArgs.contentType} already exists in release with id ${releaseId}`\n );\n }\n },\n validateEntryData(\n contentTypeUid: CreateReleaseAction.Request['body']['contentType'],\n entryDocumentId: CreateReleaseAction.Request['body']['entryDocumentId']\n ) {\n const contentType = strapi.contentType(contentTypeUid as UID.ContentType);\n\n if (!contentType) {\n throw new errors.NotFoundError(`No content type found for uid ${contentTypeUid}`);\n }\n\n if (!contentTypes.hasDraftAndPublish(contentType)) {\n throw new errors.ValidationError(\n `Content type with uid ${contentTypeUid} does not have draftAndPublish enabled`\n );\n }\n\n if (contentType.kind === 'collectionType' && !entryDocumentId) {\n throw new errors.ValidationError('Document id is required for collection type');\n }\n },\n async validatePendingReleasesLimit() {\n // Use the maximum releases option if it exists, otherwise default to 3\n const featureCfg = strapi.ee.features.get('cms-content-releases');\n\n const maximumPendingReleases =\n (typeof featureCfg === 'object' && featureCfg?.options?.maximumReleases) || 3;\n\n const [, pendingReleasesCount] = await strapi.db.query(RELEASE_MODEL_UID).findWithCount({\n filters: {\n releasedAt: {\n $null: true,\n },\n },\n });\n\n // Unlimited is a number that will never be reached like 9999\n if (pendingReleasesCount >= maximumPendingReleases) {\n throw new errors.ValidationError('You have reached the maximum number of pending releases');\n }\n },\n async validateUniqueNameForPendingRelease(\n name: CreateRelease.Request['body']['name'],\n id?: UpdateRelease.Request['params']['id']\n ) {\n const pendingReleases = (await strapi.db.query(RELEASE_MODEL_UID).findMany({\n where: {\n releasedAt: {\n $null: true,\n },\n name,\n ...(id && { id: { $ne: id } }),\n },\n })) as Release[];\n\n const isNameUnique = pendingReleases.length === 0;\n\n if (!isNameUnique) {\n throw new errors.ValidationError(`Release with name ${name} already exists`);\n }\n },\n async validateScheduledAtIsLaterThanNow(\n scheduledAt: CreateRelease.Request['body']['scheduledAt']\n ) {\n if (scheduledAt && new Date(scheduledAt) <= new Date()) {\n throw new errors.ValidationError('Scheduled at must be later than now');\n }\n },\n});\n\nexport default createReleaseValidationService;\n"],"names":["AlreadyOnReleaseError","errors","ApplicationError","constructor","message","name","createReleaseValidationService","strapi","validateUniqueEntry","releaseId","releaseActionArgs","release","db","query","RELEASE_MODEL_UID","findOne","where","id","populate","actions","NotFoundError","isEntryInRelease","some","action","entryDocumentId","contentType","locale","validateEntryData","contentTypeUid","contentTypes","hasDraftAndPublish","ValidationError","kind","validatePendingReleasesLimit","featureCfg","ee","features","get","maximumPendingReleases","options","maximumReleases","pendingReleasesCount","findWithCount","filters","releasedAt","$null","validateUniqueNameForPendingRelease","pendingReleases","findMany","$ne","isNameUnique","length","validateScheduledAtIsLaterThanNow","scheduledAt","Date"],"mappings":";;;;;;;AAMO,MAAMA,qBAA8BC,SAAAA,YAAAA,CAAOC,gBAAgB,CAAA;AAChEC,IAAAA,WAAAA,CAAYC,OAAe,CAAE;AAC3B,QAAA,KAAK,CAACA,OAAAA,CAAAA;QACN,IAAI,CAACC,IAAI,GAAG,uBAAA;AACd;AACF;AAEA,MAAMC,iCAAiC,CAAC,EAAEC,MAAM,EAA2B,IAAM;QAC/E,MAAMC,mBAAAA,CAAAA,CACJC,SAA6D,EAC7DC,iBAAsD,EAAA;AAEtD;;;QAIA,MAAMC,OAAW,GAAA,MAAMJ,MAAOK,CAAAA,EAAE,CAACC,KAAK,CAACC,2BAAmBC,CAAAA,CAAAA,OAAO,CAAC;gBAChEC,KAAO,EAAA;oBACLC,EAAIR,EAAAA;AACN,iBAAA;gBACAS,QAAU,EAAA;oBACRC,OAAS,EAAA;AACX;AACF,aAAA,CAAA;AAEA,YAAA,IAAI,CAACR,OAAS,EAAA;gBACZ,MAAM,IAAIV,aAAOmB,aAAa,CAAC,CAAC,wBAAwB,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,mCACJC,WAAyD,EAAA;AAEzD,YAAA,IAAIA,WAAe,IAAA,IAAIC,IAAKD,CAAAA,WAAAA,CAAAA,IAAgB,IAAIC,IAAQ,EAAA,EAAA;gBACtD,MAAM,IAAIrD,YAAO8B,CAAAA,eAAe,CAAC,qCAAA,CAAA;AACnC;AACF;KACF;;;;;"}
@@ -0,0 +1,86 @@
1
+ import { errors, contentTypes } from '@strapi/utils';
2
+ import { RELEASE_MODEL_UID } from '../constants.mjs';
3
+
4
+ class AlreadyOnReleaseError extends errors.ApplicationError {
5
+ constructor(message){
6
+ super(message);
7
+ this.name = 'AlreadyOnReleaseError';
8
+ }
9
+ }
10
+ const createReleaseValidationService = ({ strapi })=>({
11
+ async validateUniqueEntry (releaseId, releaseActionArgs) {
12
+ /**
13
+ * Asserting the type, otherwise TS complains: 'release.actions' is of type 'unknown', even though the types come through for non-populated fields...
14
+ * Possibly related to the comment on GetValues: https://github.com/strapi/strapi/blob/main/packages/core/types/src/modules/entity-service/result.ts
15
+ */ const release = await strapi.db.query(RELEASE_MODEL_UID).findOne({
16
+ where: {
17
+ id: releaseId
18
+ },
19
+ populate: {
20
+ actions: true
21
+ }
22
+ });
23
+ if (!release) {
24
+ throw new errors.NotFoundError(`No release found for id ${releaseId}`);
25
+ }
26
+ const isEntryInRelease = release.actions.some((action)=>action.entryDocumentId === releaseActionArgs.entryDocumentId && action.contentType === releaseActionArgs.contentType && (releaseActionArgs.locale ? action.locale === releaseActionArgs.locale : true));
27
+ if (isEntryInRelease) {
28
+ throw new AlreadyOnReleaseError(`Entry with documentId ${releaseActionArgs.entryDocumentId}${releaseActionArgs.locale ? `( ${releaseActionArgs.locale})` : ''} and contentType ${releaseActionArgs.contentType} already exists in release with id ${releaseId}`);
29
+ }
30
+ },
31
+ validateEntryData (contentTypeUid, entryDocumentId) {
32
+ const contentType = strapi.contentType(contentTypeUid);
33
+ if (!contentType) {
34
+ throw new errors.NotFoundError(`No content type found for uid ${contentTypeUid}`);
35
+ }
36
+ if (!contentTypes.hasDraftAndPublish(contentType)) {
37
+ throw new errors.ValidationError(`Content type with uid ${contentTypeUid} does not have draftAndPublish enabled`);
38
+ }
39
+ if (contentType.kind === 'collectionType' && !entryDocumentId) {
40
+ throw new errors.ValidationError('Document id is required for collection type');
41
+ }
42
+ },
43
+ async validatePendingReleasesLimit () {
44
+ // Use the maximum releases option if it exists, otherwise default to 3
45
+ const featureCfg = strapi.ee.features.get('cms-content-releases');
46
+ const maximumPendingReleases = typeof featureCfg === 'object' && featureCfg?.options?.maximumReleases || 3;
47
+ const [, pendingReleasesCount] = await strapi.db.query(RELEASE_MODEL_UID).findWithCount({
48
+ filters: {
49
+ releasedAt: {
50
+ $null: true
51
+ }
52
+ }
53
+ });
54
+ // Unlimited is a number that will never be reached like 9999
55
+ if (pendingReleasesCount >= maximumPendingReleases) {
56
+ throw new errors.ValidationError('You have reached the maximum number of pending releases');
57
+ }
58
+ },
59
+ async validateUniqueNameForPendingRelease (name, id) {
60
+ const pendingReleases = await strapi.db.query(RELEASE_MODEL_UID).findMany({
61
+ where: {
62
+ releasedAt: {
63
+ $null: true
64
+ },
65
+ name,
66
+ ...id && {
67
+ id: {
68
+ $ne: id
69
+ }
70
+ }
71
+ }
72
+ });
73
+ const isNameUnique = pendingReleases.length === 0;
74
+ if (!isNameUnique) {
75
+ throw new errors.ValidationError(`Release with name ${name} already exists`);
76
+ }
77
+ },
78
+ async validateScheduledAtIsLaterThanNow (scheduledAt) {
79
+ if (scheduledAt && new Date(scheduledAt) <= new Date()) {
80
+ throw new errors.ValidationError('Scheduled at must be later than now');
81
+ }
82
+ }
83
+ });
84
+
85
+ export { AlreadyOnReleaseError, createReleaseValidationService as default };
86
+ //# sourceMappingURL=validation.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.mjs","sources":["../../../server/src/services/validation.ts"],"sourcesContent":["import { errors, contentTypes } from '@strapi/utils';\nimport type { Core, UID } from '@strapi/types';\nimport type { Release, CreateRelease, UpdateRelease } from '../../../shared/contracts/releases';\nimport type { CreateReleaseAction } from '../../../shared/contracts/release-actions';\nimport { RELEASE_MODEL_UID } from '../constants';\n\nexport class AlreadyOnReleaseError extends errors.ApplicationError<'AlreadyOnReleaseError'> {\n constructor(message: string) {\n super(message);\n this.name = 'AlreadyOnReleaseError';\n }\n}\n\nconst createReleaseValidationService = ({ strapi }: { strapi: Core.Strapi }) => ({\n async validateUniqueEntry(\n releaseId: CreateReleaseAction.Request['params']['releaseId'],\n releaseActionArgs: CreateReleaseAction.Request['body']\n ) {\n /**\n * Asserting the type, otherwise TS complains: 'release.actions' is of type 'unknown', even though the types come through for non-populated fields...\n * Possibly related to the comment on GetValues: https://github.com/strapi/strapi/blob/main/packages/core/types/src/modules/entity-service/result.ts\n */\n const release = (await strapi.db.query(RELEASE_MODEL_UID).findOne({\n where: {\n id: releaseId,\n },\n populate: {\n actions: true,\n },\n })) as Release | null;\n\n if (!release) {\n throw new errors.NotFoundError(`No release found for id ${releaseId}`);\n }\n\n const isEntryInRelease = release.actions.some(\n (action) =>\n action.entryDocumentId === releaseActionArgs.entryDocumentId &&\n action.contentType === releaseActionArgs.contentType &&\n (releaseActionArgs.locale ? action.locale === releaseActionArgs.locale : true)\n );\n\n if (isEntryInRelease) {\n throw new AlreadyOnReleaseError(\n `Entry with documentId ${releaseActionArgs.entryDocumentId}${releaseActionArgs.locale ? `( ${releaseActionArgs.locale})` : ''} and contentType ${releaseActionArgs.contentType} already exists in release with id ${releaseId}`\n );\n }\n },\n validateEntryData(\n contentTypeUid: CreateReleaseAction.Request['body']['contentType'],\n entryDocumentId: CreateReleaseAction.Request['body']['entryDocumentId']\n ) {\n const contentType = strapi.contentType(contentTypeUid as UID.ContentType);\n\n if (!contentType) {\n throw new errors.NotFoundError(`No content type found for uid ${contentTypeUid}`);\n }\n\n if (!contentTypes.hasDraftAndPublish(contentType)) {\n throw new errors.ValidationError(\n `Content type with uid ${contentTypeUid} does not have draftAndPublish enabled`\n );\n }\n\n if (contentType.kind === 'collectionType' && !entryDocumentId) {\n throw new errors.ValidationError('Document id is required for collection type');\n }\n },\n async validatePendingReleasesLimit() {\n // Use the maximum releases option if it exists, otherwise default to 3\n const featureCfg = strapi.ee.features.get('cms-content-releases');\n\n const maximumPendingReleases =\n (typeof featureCfg === 'object' && featureCfg?.options?.maximumReleases) || 3;\n\n const [, pendingReleasesCount] = await strapi.db.query(RELEASE_MODEL_UID).findWithCount({\n filters: {\n releasedAt: {\n $null: true,\n },\n },\n });\n\n // Unlimited is a number that will never be reached like 9999\n if (pendingReleasesCount >= maximumPendingReleases) {\n throw new errors.ValidationError('You have reached the maximum number of pending releases');\n }\n },\n async validateUniqueNameForPendingRelease(\n name: CreateRelease.Request['body']['name'],\n id?: UpdateRelease.Request['params']['id']\n ) {\n const pendingReleases = (await strapi.db.query(RELEASE_MODEL_UID).findMany({\n where: {\n releasedAt: {\n $null: true,\n },\n name,\n ...(id && { id: { $ne: id } }),\n },\n })) as Release[];\n\n const isNameUnique = pendingReleases.length === 0;\n\n if (!isNameUnique) {\n throw new errors.ValidationError(`Release with name ${name} already exists`);\n }\n },\n async validateScheduledAtIsLaterThanNow(\n scheduledAt: CreateRelease.Request['body']['scheduledAt']\n ) {\n if (scheduledAt && new Date(scheduledAt) <= new Date()) {\n throw new errors.ValidationError('Scheduled at must be later than now');\n }\n },\n});\n\nexport default createReleaseValidationService;\n"],"names":["AlreadyOnReleaseError","errors","ApplicationError","constructor","message","name","createReleaseValidationService","strapi","validateUniqueEntry","releaseId","releaseActionArgs","release","db","query","RELEASE_MODEL_UID","findOne","where","id","populate","actions","NotFoundError","isEntryInRelease","some","action","entryDocumentId","contentType","locale","validateEntryData","contentTypeUid","contentTypes","hasDraftAndPublish","ValidationError","kind","validatePendingReleasesLimit","featureCfg","ee","features","get","maximumPendingReleases","options","maximumReleases","pendingReleasesCount","findWithCount","filters","releasedAt","$null","validateUniqueNameForPendingRelease","pendingReleases","findMany","$ne","isNameUnique","length","validateScheduledAtIsLaterThanNow","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CAAC,yDAAA,CAAA;AACnC;AACF,SAAA;QACA,MAAMe,mCAAAA,CAAAA,CACJzC,IAA2C,EAC3CY,EAA0C,EAAA;YAE1C,MAAM8B,eAAAA,GAAmB,MAAMxC,MAAOK,CAAAA,EAAE,CAACC,KAAK,CAACC,iBAAmBkC,CAAAA,CAAAA,QAAQ,CAAC;gBACzEhC,KAAO,EAAA;oBACL4B,UAAY,EAAA;wBACVC,KAAO,EAAA;AACT,qBAAA;AACAxC,oBAAAA,IAAAA;AACA,oBAAA,GAAIY,EAAM,IAAA;wBAAEA,EAAI,EAAA;4BAAEgC,GAAKhC,EAAAA;AAAG;;AAC5B;AACF,aAAA,CAAA;YAEA,MAAMiC,YAAAA,GAAeH,eAAgBI,CAAAA,MAAM,KAAK,CAAA;AAEhD,YAAA,IAAI,CAACD,YAAc,EAAA;gBACjB,MAAM,IAAIjD,OAAO8B,eAAe,CAAC,CAAC,kBAAkB,EAAE1B,IAAK,CAAA,eAAe,CAAC,CAAA;AAC7E;AACF,SAAA;AACA,QAAA,MAAM+C,mCACJC,WAAyD,EAAA;AAEzD,YAAA,IAAIA,WAAe,IAAA,IAAIC,IAAKD,CAAAA,WAAAA,CAAAA,IAAgB,IAAIC,IAAQ,EAAA,EAAA;gBACtD,MAAM,IAAIrD,MAAO8B,CAAAA,eAAe,CAAC,qCAAA,CAAA;AACnC;AACF;KACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"destroy.d.ts","sourceRoot":"","sources":["../../../server/src/destroy.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAK1C,eAAO,MAAM,OAAO,eAAsB;IAAE,MAAM,EAAE,KAAK,MAAM,CAAA;CAAE,kBAQhE,CAAC"}
1
+ {"version":3,"file":"destroy.d.ts","sourceRoot":"","sources":["../../../server/src/destroy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAK1C,eAAO,MAAM,OAAO,eAAsB;IAAE,MAAM,EAAE,KAAK,MAAM,CAAA;CAAE,kBAQhE,CAAC"}
@@ -1914,10 +1914,10 @@ declare const _default: {
1914
1914
  scheduling: ({ strapi }: {
1915
1915
  strapi: import("@strapi/types/dist/core").Strapi;
1916
1916
  }) => {
1917
- set(releaseId: import("@strapi/types/dist/data").ID, scheduleDate: Date): Promise<Map<import("@strapi/types/dist/data").ID, import("node-schedule").Job>>;
1918
- cancel(releaseId: import("@strapi/types/dist/data").ID): Map<import("@strapi/types/dist/data").ID, import("node-schedule").Job>;
1919
- getAll(): Map<import("@strapi/types/dist/data").ID, import("node-schedule").Job>;
1920
- syncFromDatabase(): Promise<Map<import("@strapi/types/dist/data").ID, import("node-schedule").Job>>;
1917
+ set(releaseId: import("@strapi/types/dist/data").ID, scheduleDate: Date): Promise<Map<import("@strapi/types/dist/data").ID, string>>;
1918
+ cancel(releaseId: import("@strapi/types/dist/data").ID): Map<import("@strapi/types/dist/data").ID, string>;
1919
+ getAll(): Map<import("@strapi/types/dist/data").ID, string>;
1920
+ syncFromDatabase(): Promise<Map<import("@strapi/types/dist/data").ID, string>>;
1921
1921
  };
1922
1922
  settings: ({ strapi }: {
1923
1923
  strapi: import("@strapi/types/dist/core").Strapi;
@@ -1807,10 +1807,10 @@ export declare const services: {
1807
1807
  scheduling: ({ strapi }: {
1808
1808
  strapi: import("@strapi/types/dist/core").Strapi;
1809
1809
  }) => {
1810
- set(releaseId: import("@strapi/types/dist/data").ID, scheduleDate: Date): Promise<Map<import("@strapi/types/dist/data").ID, import("node-schedule").Job>>;
1811
- cancel(releaseId: import("@strapi/types/dist/data").ID): Map<import("@strapi/types/dist/data").ID, import("node-schedule").Job>;
1812
- getAll(): Map<import("@strapi/types/dist/data").ID, import("node-schedule").Job>;
1813
- syncFromDatabase(): Promise<Map<import("@strapi/types/dist/data").ID, import("node-schedule").Job>>;
1810
+ set(releaseId: import("@strapi/types/dist/data").ID, scheduleDate: Date): Promise<Map<import("@strapi/types/dist/data").ID, string>>;
1811
+ cancel(releaseId: import("@strapi/types/dist/data").ID): Map<import("@strapi/types/dist/data").ID, string>;
1812
+ getAll(): Map<import("@strapi/types/dist/data").ID, string>;
1813
+ syncFromDatabase(): Promise<Map<import("@strapi/types/dist/data").ID, string>>;
1814
1814
  };
1815
1815
  settings: ({ strapi }: {
1816
1816
  strapi: import("@strapi/types/dist/core").Strapi;
@@ -1 +1 @@
1
- {"version":3,"file":"release-action.d.ts","sourceRoot":"","sources":["../../../../server/src/services/release-action.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,IAAI,EAAY,OAAO,EAAE,GAAG,EAAQ,MAAM,eAAe,CAAC;AAIxE,OAAO,EAAE,wBAAwB,EAAqB,MAAM,cAAc,CAAC;AAE3E,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AACnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAgBpD,MAAM,WAAW,MAAO,SAAQ,MAAM;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAMD,QAAA,MAAM,0BAA0B,eAAgB;IAAE,MAAM,EAAE,KAAK,MAAM,CAAA;CAAE;sBAyCtD,2BAA2B,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,UACrD,2BAA2B,CAAC,MAAM,CAAC,mCACH;QAAE,0BAA0B,CAAC,EAAE,OAAO,CAAA;KAAE;wBAoErE,yBAAyB,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,UACnD,yBAAyB,CAAC,OAAO,CAAC;;;;;;;;;0BAsDhB,aAAa,EAAE,WAAW,oBAAoB;6CA6B3B,aAAa,EAAE;wBAsCrD,QAAQ,aAAa,CAAC,MAAM,KAAK,CAAC,+BAA+B,EAAE,SAAS,CAAC;qBAQ1E,2BAA2B,CAAC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wBAuCrD,QAAQ,aAAa,CAAC,MAAM,KAAK,CAAC,+BAA+B,EAAE,SAAS,CAAC;qBAQ1E,2BAA2B,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,aAChD,2BAA2B,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,UACrD,2BAA2B,CAAC,MAAM,CAAC;qBAwDjC,2BAA2B,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,aAChD,2BAA2B,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC;mDAyBV,IAAI,WAAW,EAAE;CAuDzE,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAEjF,eAAe,0BAA0B,CAAC"}
@@ -1,18 +1,17 @@
1
- import { Job } from 'node-schedule';
2
1
  import type { Core } from '@strapi/types';
3
2
  import { Release } from '../../../shared/contracts/releases';
4
3
  declare const createSchedulingService: ({ strapi }: {
5
4
  strapi: Core.Strapi;
6
5
  }) => {
7
- set(releaseId: Release['id'], scheduleDate: Date): Promise<Map<import("@strapi/types/dist/data").ID, Job>>;
8
- cancel(releaseId: Release['id']): Map<import("@strapi/types/dist/data").ID, Job>;
9
- getAll(): Map<import("@strapi/types/dist/data").ID, Job>;
6
+ set(releaseId: Release['id'], scheduleDate: Date): Promise<Map<import("@strapi/types/dist/data").ID, string>>;
7
+ cancel(releaseId: Release['id']): Map<import("@strapi/types/dist/data").ID, string>;
8
+ getAll(): Map<import("@strapi/types/dist/data").ID, string>;
10
9
  /**
11
10
  * On bootstrap, we can use this function to make sure to sync the scheduled jobs from the database that are not yet released
12
11
  * This is useful in case the server was restarted and the scheduled jobs were lost
13
12
  * This also could be used to sync different Strapi instances in case of a cluster
14
13
  */
15
- syncFromDatabase(): Promise<Map<import("@strapi/types/dist/data").ID, Job>>;
14
+ syncFromDatabase(): Promise<Map<import("@strapi/types/dist/data").ID, string>>;
16
15
  };
17
16
  export default createSchedulingService;
18
17
  //# sourceMappingURL=scheduling.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scheduling.d.ts","sourceRoot":"","sources":["../../../../server/src/services/scheduling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,GAAG,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAG1C,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAI7D,QAAA,MAAM,uBAAuB,eAAgB;IAAE,MAAM,EAAE,KAAK,MAAM,CAAA;CAAE;mBAI3C,OAAO,CAAC,IAAI,CAAC,gBAAgB,IAAI;sBA6BpC,OAAO,CAAC,IAAI,CAAC;;IAa/B;;;;OAIG;;CAkBN,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
1
+ {"version":3,"file":"scheduling.d.ts","sourceRoot":"","sources":["../../../../server/src/services/scheduling.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAG1C,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAI7D,QAAA,MAAM,uBAAuB,eAAgB;IAAE,MAAM,EAAE,KAAK,MAAM,CAAA;CAAE;mBAI3C,OAAO,CAAC,IAAI,CAAC,gBAAgB,IAAI;sBAkCpC,OAAO,CAAC,IAAI,CAAC;;IAa/B;;;;OAIG;;CAkBN,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AA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AAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,KAAK,QAAQ,GAAG;IACd,OAAO,EAAE,cAAc,CAAC;IACxB,oBAAoB,EAAE,GAAG,CAAC;IAC1B,UAAU,EAAE,GAAG,CAAC;IAChB,gBAAgB,EAAE,oBAAoB,CAAC;IACvC,eAAe,EAAE,GAAG,CAAC;IACrB,QAAQ,EAAE,eAAe,CAAC;CAC3B,CAAC;AAEF,UAAU,MAAM;IACd,WAAW,EAAE,GAAG,CAAC,WAAW,CAAC;IAC7B,UAAU,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,UAAU,uCACf,KAAK,cACC;IAAE,MAAM,EAAE,KAAK,MAAM,CAAA;CAAE,KAClC,QAAQ,CAAC,KAAK,CAEhB,CAAC;AAEF,eAAO,MAAM,wBAAwB,wCACE,MAAM,cAC/B;IAAE,MAAM,EAAE,KAAK,MAAM,CAAA;CAAE,qBASpC,CAAC;AAEF,eAAO,MAAM,YAAY,mBACP,MAAM,SACf,GAAG,cACE;IAAE,MAAM,EAAE,KAAK,MAAM,CAAA;CAAE,qBA0BpC,CAAC;AAEF,eAAO,MAAM,QAAQ,2DAOhB,MAAM,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IAAC,QAAQ,EAAE,GAAG,CAAA;CAAE,cACjD;IAAE,MAAM,EAAE,KAAK,MAAM,CAAA;CAAE,+EAmBpC,CAAC;AAEF,eAAO,MAAM,cAAc,gBAAuB,IAAI,WAAW,SAAS,KAAK,WAAW,gDAwBzF,CAAC"}
@@ -0,0 +1,94 @@
1
+ 'use strict';
2
+
3
+ const getService = (name, { strapi: strapi1 })=>{
4
+ return strapi1.plugin('content-releases').service(name);
5
+ };
6
+ const getDraftEntryValidStatus = async ({ contentType, documentId, locale }, { strapi: strapi1 })=>{
7
+ const populateBuilderService = strapi1.plugin('content-manager').service('populate-builder');
8
+ // @ts-expect-error - populateBuilderService should be a function but is returning service
9
+ const populate = await populateBuilderService(contentType).populateDeep(Infinity).build();
10
+ const entry = await getEntry({
11
+ contentType,
12
+ documentId,
13
+ locale,
14
+ populate
15
+ }, {
16
+ strapi: strapi1
17
+ });
18
+ return isEntryValid(contentType, entry, {
19
+ strapi: strapi1
20
+ });
21
+ };
22
+ const isEntryValid = async (contentTypeUid, entry, { strapi: strapi1 })=>{
23
+ try {
24
+ // @TODO: When documents service has validateEntityCreation method, use it instead
25
+ await strapi1.entityValidator.validateEntityCreation(strapi1.getModel(contentTypeUid), entry, undefined, // @ts-expect-error - FIXME: entity here is unnecessary
26
+ entry);
27
+ const workflowsService = strapi1.plugin('review-workflows').service('workflows');
28
+ // Workflows service may not be available depending on the license
29
+ const workflow = await workflowsService?.getAssignedWorkflow(contentTypeUid, {
30
+ populate: 'stageRequiredToPublish'
31
+ });
32
+ if (workflow?.stageRequiredToPublish) {
33
+ return entry.strapi_stage.id === workflow.stageRequiredToPublish.id;
34
+ }
35
+ return true;
36
+ } catch {
37
+ return false;
38
+ }
39
+ };
40
+ const getEntry = async ({ contentType, documentId, locale, populate, status = 'draft' }, { strapi: strapi1 })=>{
41
+ if (documentId) {
42
+ // Try to get an existing draft or published document
43
+ const entry = await strapi1.documents(contentType).findOne({
44
+ documentId,
45
+ locale,
46
+ populate,
47
+ status
48
+ });
49
+ // The document isn't published yet, but the action is to publish it, fetch the draft
50
+ if (status === 'published' && !entry) {
51
+ return strapi1.documents(contentType).findOne({
52
+ documentId,
53
+ locale,
54
+ populate,
55
+ status: 'draft'
56
+ });
57
+ }
58
+ return entry;
59
+ }
60
+ return strapi1.documents(contentType).findFirst({
61
+ locale,
62
+ populate,
63
+ status
64
+ });
65
+ };
66
+ const getEntryStatus = async (contentType, entry)=>{
67
+ if (entry.publishedAt) {
68
+ return 'published';
69
+ }
70
+ const publishedEntry = await strapi.documents(contentType).findOne({
71
+ documentId: entry.documentId,
72
+ locale: entry.locale,
73
+ status: 'published',
74
+ fields: [
75
+ 'updatedAt'
76
+ ]
77
+ });
78
+ if (!publishedEntry) {
79
+ return 'draft';
80
+ }
81
+ const entryUpdatedAt = new Date(entry.updatedAt).getTime();
82
+ const publishedEntryUpdatedAt = new Date(publishedEntry.updatedAt).getTime();
83
+ if (entryUpdatedAt > publishedEntryUpdatedAt) {
84
+ return 'modified';
85
+ }
86
+ return 'published';
87
+ };
88
+
89
+ exports.getDraftEntryValidStatus = getDraftEntryValidStatus;
90
+ exports.getEntry = getEntry;
91
+ exports.getEntryStatus = getEntryStatus;
92
+ exports.getService = getService;
93
+ exports.isEntryValid = isEntryValid;
94
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../server/src/utils/index.ts"],"sourcesContent":["import type { UID, Data, Core } from '@strapi/types';\n\nimport type { SettingsService } from '../services/settings';\nimport type { ReleaseService } from '../services/release';\nimport type { ReleaseActionService } from '../services/release-action';\n\ntype Services = {\n release: ReleaseService;\n 'release-validation': any;\n scheduling: any;\n 'release-action': ReleaseActionService;\n 'event-manager': any;\n settings: SettingsService;\n};\n\ninterface Action {\n contentType: UID.ContentType;\n documentId?: Data.DocumentID;\n locale?: string;\n}\n\nexport const getService = <TName extends keyof Services>(\n name: TName,\n { strapi }: { strapi: Core.Strapi }\n): Services[TName] => {\n return strapi.plugin('content-releases').service(name);\n};\n\nexport const getDraftEntryValidStatus = async (\n { contentType, documentId, locale }: Action,\n { strapi }: { strapi: Core.Strapi }\n) => {\n const populateBuilderService = strapi.plugin('content-manager').service('populate-builder');\n // @ts-expect-error - populateBuilderService should be a function but is returning service\n const populate = await populateBuilderService(contentType).populateDeep(Infinity).build();\n\n const entry = await getEntry({ contentType, documentId, locale, populate }, { strapi });\n\n return isEntryValid(contentType, entry, { strapi });\n};\n\nexport const isEntryValid = async (\n contentTypeUid: string,\n entry: any,\n { strapi }: { strapi: Core.Strapi }\n) => {\n try {\n // @TODO: When documents service has validateEntityCreation method, use it instead\n await strapi.entityValidator.validateEntityCreation(\n strapi.getModel(contentTypeUid as UID.ContentType),\n entry,\n undefined,\n // @ts-expect-error - FIXME: entity here is unnecessary\n entry\n );\n\n const workflowsService = strapi.plugin('review-workflows').service('workflows');\n // Workflows service may not be available depending on the license\n const workflow = await workflowsService?.getAssignedWorkflow(contentTypeUid, {\n populate: 'stageRequiredToPublish',\n });\n\n if (workflow?.stageRequiredToPublish) {\n return entry.strapi_stage.id === workflow.stageRequiredToPublish.id;\n }\n\n return true;\n } catch {\n return false;\n }\n};\n\nexport const getEntry = async (\n {\n contentType,\n documentId,\n locale,\n populate,\n status = 'draft',\n }: Action & { status?: 'draft' | 'published'; populate: any },\n { strapi }: { strapi: Core.Strapi }\n) => {\n if (documentId) {\n // Try to get an existing draft or published document\n const entry = await strapi\n .documents(contentType)\n .findOne({ documentId, locale, populate, status });\n\n // The document isn't published yet, but the action is to publish it, fetch the draft\n if (status === 'published' && !entry) {\n return strapi\n .documents(contentType)\n .findOne({ documentId, locale, populate, status: 'draft' });\n }\n\n return entry;\n }\n\n return strapi.documents(contentType).findFirst({ locale, populate, status });\n};\n\nexport const getEntryStatus = async (contentType: UID.ContentType, entry: Data.ContentType) => {\n if (entry.publishedAt) {\n return 'published';\n }\n\n const publishedEntry = await strapi.documents(contentType).findOne({\n documentId: entry.documentId,\n locale: entry.locale,\n status: 'published',\n fields: ['updatedAt'],\n });\n\n if (!publishedEntry) {\n return 'draft';\n }\n\n const entryUpdatedAt = new Date(entry.updatedAt).getTime();\n const publishedEntryUpdatedAt = new Date(publishedEntry.updatedAt).getTime();\n\n if (entryUpdatedAt > publishedEntryUpdatedAt) {\n return 'modified';\n }\n\n return 'published';\n};\n"],"names":["getService","name","strapi","plugin","service","getDraftEntryValidStatus","contentType","documentId","locale","populateBuilderService","populate","populateDeep","Infinity","build","entry","getEntry","isEntryValid","contentTypeUid","entityValidator","validateEntityCreation","getModel","undefined","workflowsService","workflow","getAssignedWorkflow","stageRequiredToPublish","strapi_stage","id","status","documents","findOne","findFirst","getEntryStatus","publishedAt","publishedEntry","fields","entryUpdatedAt","Date","updatedAt","getTime","publishedEntryUpdatedAt"],"mappings":";;MAqBaA,UAAa,GAAA,CACxBC,MACA,EAAEC,MAAAA,EAAAA,OAAM,EAA2B,GAAA;AAEnC,IAAA,OAAOA,OAAOC,CAAAA,MAAM,CAAC,kBAAA,CAAA,CAAoBC,OAAO,CAACH,IAAAA,CAAAA;AACnD;AAEaI,MAAAA,wBAAAA,GAA2B,OACtC,EAAEC,WAAW,EAAEC,UAAU,EAAEC,MAAM,EAAU,EAC3C,EAAEN,MAAAA,EAAAA,OAAM,EAA2B,GAAA;AAEnC,IAAA,MAAMO,yBAAyBP,OAAOC,CAAAA,MAAM,CAAC,iBAAA,CAAA,CAAmBC,OAAO,CAAC,kBAAA,CAAA;;AAExE,IAAA,MAAMM,WAAW,MAAMD,sBAAAA,CAAuBH,aAAaK,YAAY,CAACC,UAAUC,KAAK,EAAA;IAEvF,MAAMC,KAAAA,GAAQ,MAAMC,QAAS,CAAA;AAAET,QAAAA,WAAAA;AAAaC,QAAAA,UAAAA;AAAYC,QAAAA,MAAAA;AAAQE,QAAAA;KAAY,EAAA;QAAER,MAAAA,EAAAA;AAAO,KAAA,CAAA;IAErF,OAAOc,YAAAA,CAAaV,aAAaQ,KAAO,EAAA;QAAEZ,MAAAA,EAAAA;AAAO,KAAA,CAAA;AACnD;AAEO,MAAMc,eAAe,OAC1BC,cAAAA,EACAH,OACA,EAAEZ,MAAAA,EAAAA,OAAM,EAA2B,GAAA;IAEnC,IAAI;;QAEF,MAAMA,OAAAA,CAAOgB,eAAe,CAACC,sBAAsB,CACjDjB,OAAOkB,CAAAA,QAAQ,CAACH,cAAAA,CAAAA,EAChBH,KACAO,EAAAA,SAAAA;AAEAP,QAAAA,KAAAA,CAAAA;AAGF,QAAA,MAAMQ,mBAAmBpB,OAAOC,CAAAA,MAAM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cAAiB,GAAA,OAAO1B,WAA8BQ,EAAAA,KAAAA,GAAAA;IACjE,IAAIA,KAAAA,CAAMmB,WAAW,EAAE;QACrB,OAAO,WAAA;AACT;AAEA,IAAA,MAAMC,iBAAiB,MAAMhC,MAAAA,CAAO2B,SAAS,CAACvB,WAAAA,CAAAA,CAAawB,OAAO,CAAC;AACjEvB,QAAAA,UAAAA,EAAYO,MAAMP,UAAU;AAC5BC,QAAAA,MAAAA,EAAQM,MAAMN,MAAM;QACpBoB,MAAQ,EAAA,WAAA;QACRO,MAAQ,EAAA;AAAC,YAAA;AAAY;AACvB,KAAA,CAAA;AAEA,IAAA,IAAI,CAACD,cAAgB,EAAA;QACnB,OAAO,OAAA;AACT;AAEA,IAAA,MAAME,iBAAiB,IAAIC,IAAAA,CAAKvB,KAAMwB,CAAAA,SAAS,EAAEC,OAAO,EAAA;AACxD,IAAA,MAAMC,0BAA0B,IAAIH,IAAAA,CAAKH,cAAeI,CAAAA,SAAS,EAAEC,OAAO,EAAA;AAE1E,IAAA,IAAIH,iBAAiBI,uBAAyB,EAAA;QAC5C,OAAO,UAAA;AACT;IAEA,OAAO,WAAA;AACT;;;;;;;;"}
@@ -0,0 +1,88 @@
1
+ const getService = (name, { strapi: strapi1 })=>{
2
+ return strapi1.plugin('content-releases').service(name);
3
+ };
4
+ const getDraftEntryValidStatus = async ({ contentType, documentId, locale }, { strapi: strapi1 })=>{
5
+ const populateBuilderService = strapi1.plugin('content-manager').service('populate-builder');
6
+ // @ts-expect-error - populateBuilderService should be a function but is returning service
7
+ const populate = await populateBuilderService(contentType).populateDeep(Infinity).build();
8
+ const entry = await getEntry({
9
+ contentType,
10
+ documentId,
11
+ locale,
12
+ populate
13
+ }, {
14
+ strapi: strapi1
15
+ });
16
+ return isEntryValid(contentType, entry, {
17
+ strapi: strapi1
18
+ });
19
+ };
20
+ const isEntryValid = async (contentTypeUid, entry, { strapi: strapi1 })=>{
21
+ try {
22
+ // @TODO: When documents service has validateEntityCreation method, use it instead
23
+ await strapi1.entityValidator.validateEntityCreation(strapi1.getModel(contentTypeUid), entry, undefined, // @ts-expect-error - FIXME: entity here is unnecessary
24
+ entry);
25
+ const workflowsService = strapi1.plugin('review-workflows').service('workflows');
26
+ // Workflows service may not be available depending on the license
27
+ const workflow = await workflowsService?.getAssignedWorkflow(contentTypeUid, {
28
+ populate: 'stageRequiredToPublish'
29
+ });
30
+ if (workflow?.stageRequiredToPublish) {
31
+ return entry.strapi_stage.id === workflow.stageRequiredToPublish.id;
32
+ }
33
+ return true;
34
+ } catch {
35
+ return false;
36
+ }
37
+ };
38
+ const getEntry = async ({ contentType, documentId, locale, populate, status = 'draft' }, { strapi: strapi1 })=>{
39
+ if (documentId) {
40
+ // Try to get an existing draft or published document
41
+ const entry = await strapi1.documents(contentType).findOne({
42
+ documentId,
43
+ locale,
44
+ populate,
45
+ status
46
+ });
47
+ // The document isn't published yet, but the action is to publish it, fetch the draft
48
+ if (status === 'published' && !entry) {
49
+ return strapi1.documents(contentType).findOne({
50
+ documentId,
51
+ locale,
52
+ populate,
53
+ status: 'draft'
54
+ });
55
+ }
56
+ return entry;
57
+ }
58
+ return strapi1.documents(contentType).findFirst({
59
+ locale,
60
+ populate,
61
+ status
62
+ });
63
+ };
64
+ const getEntryStatus = async (contentType, entry)=>{
65
+ if (entry.publishedAt) {
66
+ return 'published';
67
+ }
68
+ const publishedEntry = await strapi.documents(contentType).findOne({
69
+ documentId: entry.documentId,
70
+ locale: entry.locale,
71
+ status: 'published',
72
+ fields: [
73
+ 'updatedAt'
74
+ ]
75
+ });
76
+ if (!publishedEntry) {
77
+ return 'draft';
78
+ }
79
+ const entryUpdatedAt = new Date(entry.updatedAt).getTime();
80
+ const publishedEntryUpdatedAt = new Date(publishedEntry.updatedAt).getTime();
81
+ if (entryUpdatedAt > publishedEntryUpdatedAt) {
82
+ return 'modified';
83
+ }
84
+ return 'published';
85
+ };
86
+
87
+ export { getDraftEntryValidStatus, getEntry, getEntryStatus, getService, isEntryValid };
88
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../../../server/src/utils/index.ts"],"sourcesContent":["import type { UID, Data, Core } from '@strapi/types';\n\nimport type { SettingsService } from '../services/settings';\nimport type { ReleaseService } from '../services/release';\nimport type { ReleaseActionService } from '../services/release-action';\n\ntype Services = {\n release: ReleaseService;\n 'release-validation': any;\n scheduling: any;\n 'release-action': ReleaseActionService;\n 'event-manager': any;\n settings: SettingsService;\n};\n\ninterface Action {\n contentType: UID.ContentType;\n documentId?: Data.DocumentID;\n locale?: string;\n}\n\nexport const getService = <TName extends keyof Services>(\n name: TName,\n { strapi }: { strapi: Core.Strapi }\n): Services[TName] => {\n return strapi.plugin('content-releases').service(name);\n};\n\nexport const getDraftEntryValidStatus = async (\n { contentType, documentId, locale }: Action,\n { strapi }: { strapi: Core.Strapi }\n) => {\n const populateBuilderService = strapi.plugin('content-manager').service('populate-builder');\n // @ts-expect-error - populateBuilderService should be a function but is returning service\n const populate = await populateBuilderService(contentType).populateDeep(Infinity).build();\n\n const entry = await getEntry({ contentType, documentId, locale, populate }, { strapi });\n\n return isEntryValid(contentType, entry, { strapi });\n};\n\nexport const isEntryValid = async (\n contentTypeUid: string,\n entry: any,\n { strapi }: { strapi: Core.Strapi }\n) => {\n try {\n // @TODO: When documents service has validateEntityCreation method, use it instead\n await strapi.entityValidator.validateEntityCreation(\n strapi.getModel(contentTypeUid as UID.ContentType),\n entry,\n undefined,\n // @ts-expect-error - FIXME: entity here is unnecessary\n entry\n );\n\n const workflowsService = strapi.plugin('review-workflows').service('workflows');\n // Workflows service may not be available depending on the license\n const workflow = await workflowsService?.getAssignedWorkflow(contentTypeUid, {\n populate: 'stageRequiredToPublish',\n });\n\n if (workflow?.stageRequiredToPublish) {\n return entry.strapi_stage.id === workflow.stageRequiredToPublish.id;\n }\n\n return true;\n } catch {\n return false;\n }\n};\n\nexport const getEntry = async (\n {\n contentType,\n documentId,\n locale,\n populate,\n status = 'draft',\n }: Action & { status?: 'draft' | 'published'; populate: any },\n { strapi }: { strapi: Core.Strapi }\n) => {\n if (documentId) {\n // Try to get an existing draft or published document\n const entry = await strapi\n .documents(contentType)\n .findOne({ documentId, locale, populate, status });\n\n // The document isn't published yet, but the action is to publish it, fetch the draft\n if (status === 'published' && !entry) {\n return strapi\n .documents(contentType)\n .findOne({ documentId, locale, populate, status: 'draft' });\n }\n\n return entry;\n }\n\n return strapi.documents(contentType).findFirst({ locale, populate, status });\n};\n\nexport const getEntryStatus = async (contentType: UID.ContentType, entry: Data.ContentType) => {\n if (entry.publishedAt) {\n return 'published';\n }\n\n const publishedEntry = await strapi.documents(contentType).findOne({\n documentId: entry.documentId,\n locale: entry.locale,\n status: 'published',\n fields: ['updatedAt'],\n });\n\n if (!publishedEntry) {\n return 'draft';\n }\n\n const entryUpdatedAt = new Date(entry.updatedAt).getTime();\n const publishedEntryUpdatedAt = new Date(publishedEntry.updatedAt).getTime();\n\n if (entryUpdatedAt > publishedEntryUpdatedAt) {\n return 'modified';\n }\n\n return 'published';\n};\n"],"names":["getService","name","strapi","plugin","service","getDraftEntryValidStatus","contentType","documentId","locale","populateBuilderService","populate","populateDeep","Infinity","build","entry","getEntry","isEntryValid","contentTypeUid","entityValidator","validateEntityCreation","getModel","undefined","workflowsService","workflow","getAssignedWorkflow","stageRequiredToPublish","strapi_stage","id","status","documents","findOne","findFirst","getEntryStatus","publishedAt","publishedEntry","fields","entryUpdatedAt","Date","updatedAt","getTime","publishedEntryUpdatedAt"],"mappings":"MAqBaA,UAAa,GAAA,CACxBC,MACA,EAAEC,MAAAA,EAAAA,OAAM,EAA2B,GAAA;AAEnC,IAAA,OAAOA,OAAOC,CAAAA,MAAM,CAAC,kBAAA,CAAA,CAAoBC,OAAO,CAACH,IAAAA,CAAAA;AACnD;AAEaI,MAAAA,wBAAAA,GAA2B,OACtC,EAAEC,WAAW,EAAEC,UAAU,EAAEC,MAAM,EAAU,EAC3C,EAAEN,MAAAA,EAAA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AAA;AACT;AAEA,IAAA,MAAME,iBAAiB,IAAIC,IAAAA,CAAKvB,KAAMwB,CAAAA,SAAS,EAAEC,OAAO,EAAA;AACxD,IAAA,MAAMC,0BAA0B,IAAIH,IAAAA,CAAKH,cAAeI,CAAAA,SAAS,EAAEC,OAAO,EAAA;AAE1E,IAAA,IAAIH,iBAAiBI,uBAAyB,EAAA;QAC5C,OAAO,UAAA;AACT;IAEA,OAAO,WAAA;AACT;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/content-releases",
3
- "version": "0.0.0-next.fdac61dd05ca665168f51f655f1d165b55ec4231",
3
+ "version": "0.0.0-next.ffc36acb308febe288f1a31b62cbbb75b286585c",
4
4
  "description": "Strapi plugin for organizing and releasing content",
5
5
  "repository": {
6
6
  "type": "git",
@@ -59,30 +59,29 @@
59
59
  },
60
60
  "dependencies": {
61
61
  "@reduxjs/toolkit": "1.9.7",
62
- "@strapi/database": "0.0.0-next.fdac61dd05ca665168f51f655f1d165b55ec4231",
63
- "@strapi/design-system": "2.0.0-rc.16",
64
- "@strapi/icons": "2.0.0-rc.16",
65
- "@strapi/types": "0.0.0-next.fdac61dd05ca665168f51f655f1d165b55ec4231",
66
- "@strapi/utils": "0.0.0-next.fdac61dd05ca665168f51f655f1d165b55ec4231",
62
+ "@strapi/database": "0.0.0-next.ffc36acb308febe288f1a31b62cbbb75b286585c",
63
+ "@strapi/design-system": "2.0.0-rc.29",
64
+ "@strapi/icons": "2.0.0-rc.29",
65
+ "@strapi/types": "0.0.0-next.ffc36acb308febe288f1a31b62cbbb75b286585c",
66
+ "@strapi/utils": "0.0.0-next.ffc36acb308febe288f1a31b62cbbb75b286585c",
67
67
  "date-fns": "2.30.0",
68
68
  "date-fns-tz": "2.0.1",
69
69
  "formik": "2.4.5",
70
70
  "lodash": "4.17.21",
71
- "node-schedule": "2.1.1",
72
71
  "qs": "6.11.1",
73
72
  "react-intl": "6.6.2",
74
73
  "react-redux": "8.1.3",
75
74
  "yup": "0.32.9"
76
75
  },
77
76
  "devDependencies": {
78
- "@strapi/admin": "0.0.0-next.fdac61dd05ca665168f51f655f1d165b55ec4231",
79
- "@strapi/admin-test-utils": "0.0.0-next.fdac61dd05ca665168f51f655f1d165b55ec4231",
80
- "@strapi/content-manager": "0.0.0-next.fdac61dd05ca665168f51f655f1d165b55ec4231",
77
+ "@strapi/admin": "0.0.0-next.ffc36acb308febe288f1a31b62cbbb75b286585c",
78
+ "@strapi/admin-test-utils": "0.0.0-next.ffc36acb308febe288f1a31b62cbbb75b286585c",
79
+ "@strapi/content-manager": "0.0.0-next.ffc36acb308febe288f1a31b62cbbb75b286585c",
81
80
  "@testing-library/dom": "10.1.0",
82
81
  "@testing-library/react": "15.0.7",
83
82
  "@testing-library/user-event": "14.5.2",
84
83
  "@types/koa": "2.13.4",
85
- "koa": "2.15.2",
84
+ "koa": "2.16.1",
86
85
  "msw": "1.3.0",
87
86
  "react": "18.3.1",
88
87
  "react-dom": "18.3.1",