@strapi/content-releases 5.0.0-beta.0 → 5.0.0-beta.2
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.
- package/dist/_chunks/{App-IkyOz9wq.mjs → App-WrCrq8qe.mjs} +29 -18
- package/dist/_chunks/App-WrCrq8qe.mjs.map +1 -0
- package/dist/_chunks/{App-FuRaphre.js → App-egamppr5.js} +29 -18
- package/dist/_chunks/App-egamppr5.js.map +1 -0
- package/dist/_chunks/{PurchaseContentReleases-Clm0iACO.mjs → PurchaseContentReleases-3tRbmbY3.mjs} +2 -2
- package/dist/_chunks/PurchaseContentReleases-3tRbmbY3.mjs.map +1 -0
- package/dist/_chunks/{PurchaseContentReleases-YhAPgpG9.js → PurchaseContentReleases-bpIYXOfu.js} +2 -2
- package/dist/_chunks/PurchaseContentReleases-bpIYXOfu.js.map +1 -0
- package/dist/_chunks/{en-faJDuv3q.js → en-3SGjiVyR.js} +10 -2
- package/dist/_chunks/en-3SGjiVyR.js.map +1 -0
- package/dist/_chunks/{en-RdapH-9X.mjs → en-bpHsnU0n.mjs} +10 -2
- package/dist/_chunks/en-bpHsnU0n.mjs.map +1 -0
- package/dist/_chunks/{index-qP3rNiDS.mjs → index-AjuPz9xq.mjs} +206 -11
- package/dist/_chunks/index-AjuPz9xq.mjs.map +1 -0
- package/dist/_chunks/{index-Sb3Nal8H.js → index-tSOxtfmU.js} +205 -10
- package/dist/_chunks/index-tSOxtfmU.js.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/CMReleasesContainer.d.ts +21 -0
- package/dist/admin/src/components/ReleaseAction.d.ts +3 -0
- package/dist/admin/src/components/ReleaseModal.d.ts +1 -1
- package/dist/admin/src/services/release.d.ts +40 -15
- package/dist/server/index.js +10 -26
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +11 -27
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/bootstrap.d.ts +2 -2
- package/dist/server/src/bootstrap.d.ts.map +1 -1
- package/dist/server/src/controllers/validation/release-action.d.ts +7 -2
- package/dist/server/src/controllers/validation/release-action.d.ts.map +1 -1
- package/dist/server/src/destroy.d.ts +2 -2
- package/dist/server/src/destroy.d.ts.map +1 -1
- package/dist/server/src/index.d.ts +1411 -1411
- package/dist/server/src/migrations/index.d.ts.map +1 -1
- package/dist/server/src/register.d.ts +2 -2
- package/dist/server/src/register.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +1407 -1407
- package/dist/server/src/services/release.d.ts +7 -7
- package/dist/server/src/services/release.d.ts.map +1 -1
- package/dist/server/src/services/scheduling.d.ts +6 -6
- package/dist/server/src/services/scheduling.d.ts.map +1 -1
- package/dist/server/src/services/validation.d.ts +2 -2
- package/dist/server/src/services/validation.d.ts.map +1 -1
- package/dist/server/src/utils/index.d.ts +8 -8
- package/dist/server/src/utils/index.d.ts.map +1 -1
- package/dist/shared/contracts/release-actions.d.ts +9 -9
- package/dist/shared/contracts/release-actions.d.ts.map +1 -1
- package/dist/shared/types.d.ts +2 -2
- package/dist/shared/types.d.ts.map +1 -1
- package/package.json +10 -8
- package/dist/_chunks/App-FuRaphre.js.map +0 -1
- package/dist/_chunks/App-IkyOz9wq.mjs.map +0 -1
- package/dist/_chunks/PurchaseContentReleases-Clm0iACO.mjs.map +0 -1
- package/dist/_chunks/PurchaseContentReleases-YhAPgpG9.js.map +0 -1
- package/dist/_chunks/en-RdapH-9X.mjs.map +0 -1
- package/dist/_chunks/en-faJDuv3q.js.map +0 -1
- package/dist/_chunks/index-Sb3Nal8H.js.map +0 -1
- package/dist/_chunks/index-qP3rNiDS.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateReleaseAction, DeleteReleaseAction } from '../../../shared/contracts/release-actions';
|
|
1
|
+
import { CreateReleaseAction, CreateManyReleaseActions, DeleteReleaseAction } from '../../../shared/contracts/release-actions';
|
|
2
2
|
import type { GetReleaseActions, UpdateReleaseAction, ReleaseActionGroupBy } from '../../../shared/contracts/release-actions';
|
|
3
3
|
import type { CreateRelease, DeleteRelease, GetContentTypeEntryReleases, GetReleases, GetRelease, PublishRelease } from '../../../shared/contracts/releases';
|
|
4
4
|
export interface GetReleasesQueryParams {
|
|
@@ -34,7 +34,7 @@ declare const releaseApi: import("@reduxjs/toolkit/query/react").Api<(<TData = a
|
|
|
34
34
|
data?: undefined;
|
|
35
35
|
}>), {
|
|
36
36
|
getReleasesForEntry: import("@reduxjs/toolkit/query/react").QueryDefinition<Partial<{
|
|
37
|
-
contentTypeUid: import("@strapi/types/dist/
|
|
37
|
+
contentTypeUid: import("@strapi/types/dist/uid").ContentType;
|
|
38
38
|
entryId: number;
|
|
39
39
|
hasEntryAttached?: boolean | undefined;
|
|
40
40
|
}>, <TData = any, TSend = any>({ url, method, data, config, }: import("./axios").QueryArguments<TSend>) => Promise<{
|
|
@@ -64,7 +64,7 @@ declare const releaseApi: import("@reduxjs/toolkit/query/react").Api<(<TData = a
|
|
|
64
64
|
data?: undefined;
|
|
65
65
|
}>, "Release" | "ReleaseAction", GetReleasesTabResponse, "content-releases">;
|
|
66
66
|
getRelease: import("@reduxjs/toolkit/query/react").QueryDefinition<{
|
|
67
|
-
id: import("@strapi/types/dist/
|
|
67
|
+
id: import("@strapi/types/dist/data").ID;
|
|
68
68
|
}, <TData = any, TSend = any>({ url, method, data, config, }: import("./axios").QueryArguments<TSend>) => Promise<{
|
|
69
69
|
data: TData;
|
|
70
70
|
error?: undefined;
|
|
@@ -79,7 +79,7 @@ declare const releaseApi: import("@reduxjs/toolkit/query/react").Api<(<TData = a
|
|
|
79
79
|
data?: undefined;
|
|
80
80
|
}>, "Release" | "ReleaseAction", GetRelease.Response, "content-releases">;
|
|
81
81
|
getReleaseActions: import("@reduxjs/toolkit/query/react").QueryDefinition<{
|
|
82
|
-
releaseId: import("@strapi/types/dist/
|
|
82
|
+
releaseId: import("@strapi/types/dist/data").ID;
|
|
83
83
|
} & Partial<Pick<import("../../../shared/contracts/releases").Pagination, "page" | "pageSize">> & {
|
|
84
84
|
groupBy?: ReleaseActionGroupBy | undefined;
|
|
85
85
|
}, <TData = any, TSend = any>({ url, method, data, config, }: import("./axios").QueryArguments<TSend>) => Promise<{
|
|
@@ -113,7 +113,7 @@ declare const releaseApi: import("@reduxjs/toolkit/query/react").Api<(<TData = a
|
|
|
113
113
|
data?: undefined;
|
|
114
114
|
}>, "Release" | "ReleaseAction", CreateRelease.Response, "content-releases">;
|
|
115
115
|
updateRelease: import("@reduxjs/toolkit/query/react").MutationDefinition<{
|
|
116
|
-
id: import("@strapi/types/dist/
|
|
116
|
+
id: import("@strapi/types/dist/data").ID;
|
|
117
117
|
} & {
|
|
118
118
|
name: string;
|
|
119
119
|
scheduledAt?: Date | null | undefined;
|
|
@@ -144,6 +144,19 @@ declare const releaseApi: import("@reduxjs/toolkit/query/react").Api<(<TData = a
|
|
|
144
144
|
};
|
|
145
145
|
data?: undefined;
|
|
146
146
|
}>, "Release" | "ReleaseAction", CreateReleaseAction.Response, "content-releases">;
|
|
147
|
+
createManyReleaseActions: import("@reduxjs/toolkit/query/react").MutationDefinition<CreateManyReleaseActions.Request, <TData = any, TSend = any>({ url, method, data, config, }: import("./axios").QueryArguments<TSend>) => Promise<{
|
|
148
|
+
data: TData;
|
|
149
|
+
error?: undefined;
|
|
150
|
+
} | {
|
|
151
|
+
error: {
|
|
152
|
+
status: number | undefined;
|
|
153
|
+
code: string | undefined;
|
|
154
|
+
response: {
|
|
155
|
+
data: unknown;
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
data?: undefined;
|
|
159
|
+
}>, "Release" | "ReleaseAction", CreateManyReleaseActions.Response, "content-releases">;
|
|
147
160
|
updateReleaseAction: import("@reduxjs/toolkit/query/react").MutationDefinition<UpdateReleaseAction.Request & {
|
|
148
161
|
query: GetReleaseActions.Request['query'];
|
|
149
162
|
} & {
|
|
@@ -175,7 +188,7 @@ declare const releaseApi: import("@reduxjs/toolkit/query/react").Api<(<TData = a
|
|
|
175
188
|
data?: undefined;
|
|
176
189
|
}>, "Release" | "ReleaseAction", DeleteReleaseAction.Response, "content-releases">;
|
|
177
190
|
publishRelease: import("@reduxjs/toolkit/query/react").MutationDefinition<{
|
|
178
|
-
id: import("@strapi/types/dist/
|
|
191
|
+
id: import("@strapi/types/dist/data").ID;
|
|
179
192
|
}, <TData = any, TSend = any>({ url, method, data, config, }: import("./axios").QueryArguments<TSend>) => Promise<{
|
|
180
193
|
data: TData;
|
|
181
194
|
error?: undefined;
|
|
@@ -190,7 +203,7 @@ declare const releaseApi: import("@reduxjs/toolkit/query/react").Api<(<TData = a
|
|
|
190
203
|
data?: undefined;
|
|
191
204
|
}>, "Release" | "ReleaseAction", PublishRelease.Response, "content-releases">;
|
|
192
205
|
deleteRelease: import("@reduxjs/toolkit/query/react").MutationDefinition<{
|
|
193
|
-
id: import("@strapi/types/dist/
|
|
206
|
+
id: import("@strapi/types/dist/data").ID;
|
|
194
207
|
}, <TData = any, TSend = any>({ url, method, data, config, }: import("./axios").QueryArguments<TSend>) => Promise<{
|
|
195
208
|
data: TData;
|
|
196
209
|
error?: undefined;
|
|
@@ -218,7 +231,7 @@ declare const useGetReleasesQuery: import("@reduxjs/toolkit/dist/query/react/bui
|
|
|
218
231
|
};
|
|
219
232
|
data?: undefined;
|
|
220
233
|
}>, "Release" | "ReleaseAction", GetReleasesTabResponse, "content-releases">>, useGetReleasesForEntryQuery: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseQuery<import("@reduxjs/toolkit/query/react").QueryDefinition<Partial<{
|
|
221
|
-
contentTypeUid: import("@strapi/types/dist/
|
|
234
|
+
contentTypeUid: import("@strapi/types/dist/uid").ContentType;
|
|
222
235
|
entryId: number;
|
|
223
236
|
hasEntryAttached?: boolean | undefined;
|
|
224
237
|
}>, <TData = any, TSend = any>({ url, method, data, config, }: import("./axios").QueryArguments<TSend>) => Promise<{
|
|
@@ -234,7 +247,7 @@ declare const useGetReleasesQuery: import("@reduxjs/toolkit/dist/query/react/bui
|
|
|
234
247
|
};
|
|
235
248
|
data?: undefined;
|
|
236
249
|
}>, "Release" | "ReleaseAction", GetContentTypeEntryReleases.Response, "content-releases">>, useGetReleaseQuery: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseQuery<import("@reduxjs/toolkit/query/react").QueryDefinition<{
|
|
237
|
-
id: import("@strapi/types/dist/
|
|
250
|
+
id: import("@strapi/types/dist/data").ID;
|
|
238
251
|
}, <TData = any, TSend = any>({ url, method, data, config, }: import("./axios").QueryArguments<TSend>) => Promise<{
|
|
239
252
|
data: TData;
|
|
240
253
|
error?: undefined;
|
|
@@ -248,7 +261,7 @@ declare const useGetReleasesQuery: import("@reduxjs/toolkit/dist/query/react/bui
|
|
|
248
261
|
};
|
|
249
262
|
data?: undefined;
|
|
250
263
|
}>, "Release" | "ReleaseAction", GetRelease.Response, "content-releases">>, useGetReleaseActionsQuery: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseQuery<import("@reduxjs/toolkit/query/react").QueryDefinition<{
|
|
251
|
-
releaseId: import("@strapi/types/dist/
|
|
264
|
+
releaseId: import("@strapi/types/dist/data").ID;
|
|
252
265
|
} & Partial<Pick<import("../../../shared/contracts/releases").Pagination, "page" | "pageSize">> & {
|
|
253
266
|
groupBy?: ReleaseActionGroupBy | undefined;
|
|
254
267
|
}, <TData = any, TSend = any>({ url, method, data, config, }: import("./axios").QueryArguments<TSend>) => Promise<{
|
|
@@ -291,8 +304,20 @@ declare const useGetReleasesQuery: import("@reduxjs/toolkit/dist/query/react/bui
|
|
|
291
304
|
};
|
|
292
305
|
};
|
|
293
306
|
data?: undefined;
|
|
294
|
-
}>, "Release" | "ReleaseAction", CreateReleaseAction.Response, "content-releases">>,
|
|
295
|
-
|
|
307
|
+
}>, "Release" | "ReleaseAction", CreateReleaseAction.Response, "content-releases">>, useCreateManyReleaseActionsMutation: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseMutation<import("@reduxjs/toolkit/query/react").MutationDefinition<CreateManyReleaseActions.Request, <TData = any, TSend = any>({ url, method, data, config, }: import("./axios").QueryArguments<TSend>) => Promise<{
|
|
308
|
+
data: TData;
|
|
309
|
+
error?: undefined;
|
|
310
|
+
} | {
|
|
311
|
+
error: {
|
|
312
|
+
status: number | undefined;
|
|
313
|
+
code: string | undefined;
|
|
314
|
+
response: {
|
|
315
|
+
data: unknown;
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
data?: undefined;
|
|
319
|
+
}>, "Release" | "ReleaseAction", CreateManyReleaseActions.Response, "content-releases">>, useUpdateReleaseMutation: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseMutation<import("@reduxjs/toolkit/query/react").MutationDefinition<{
|
|
320
|
+
id: import("@strapi/types/dist/data").ID;
|
|
296
321
|
} & {
|
|
297
322
|
name: string;
|
|
298
323
|
scheduledAt?: Date | null | undefined;
|
|
@@ -326,7 +351,7 @@ declare const useGetReleasesQuery: import("@reduxjs/toolkit/dist/query/react/bui
|
|
|
326
351
|
};
|
|
327
352
|
data?: undefined;
|
|
328
353
|
}>, "Release" | "ReleaseAction", UpdateReleaseAction.Response, "content-releases">>, usePublishReleaseMutation: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseMutation<import("@reduxjs/toolkit/query/react").MutationDefinition<{
|
|
329
|
-
id: import("@strapi/types/dist/
|
|
354
|
+
id: import("@strapi/types/dist/data").ID;
|
|
330
355
|
}, <TData = any, TSend = any>({ url, method, data, config, }: import("./axios").QueryArguments<TSend>) => Promise<{
|
|
331
356
|
data: TData;
|
|
332
357
|
error?: undefined;
|
|
@@ -352,7 +377,7 @@ declare const useGetReleasesQuery: import("@reduxjs/toolkit/dist/query/react/bui
|
|
|
352
377
|
};
|
|
353
378
|
data?: undefined;
|
|
354
379
|
}>, "Release" | "ReleaseAction", DeleteReleaseAction.Response, "content-releases">>, useDeleteReleaseMutation: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseMutation<import("@reduxjs/toolkit/query/react").MutationDefinition<{
|
|
355
|
-
id: import("@strapi/types/dist/
|
|
380
|
+
id: import("@strapi/types/dist/data").ID;
|
|
356
381
|
}, <TData = any, TSend = any>({ url, method, data, config, }: import("./axios").QueryArguments<TSend>) => Promise<{
|
|
357
382
|
data: TData;
|
|
358
383
|
error?: undefined;
|
|
@@ -366,4 +391,4 @@ declare const useGetReleasesQuery: import("@reduxjs/toolkit/dist/query/react/bui
|
|
|
366
391
|
};
|
|
367
392
|
data?: undefined;
|
|
368
393
|
}>, "Release" | "ReleaseAction", DeleteRelease.Response, "content-releases">>;
|
|
369
|
-
export { useGetReleasesQuery, useGetReleasesForEntryQuery, useGetReleaseQuery, useGetReleaseActionsQuery, useCreateReleaseMutation, useCreateReleaseActionMutation, useUpdateReleaseMutation, useUpdateReleaseActionMutation, usePublishReleaseMutation, useDeleteReleaseActionMutation, useDeleteReleaseMutation, releaseApi, };
|
|
394
|
+
export { useGetReleasesQuery, useGetReleasesForEntryQuery, useGetReleaseQuery, useGetReleaseActionsQuery, useCreateReleaseMutation, useCreateReleaseActionMutation, useCreateManyReleaseActionsMutation, useUpdateReleaseMutation, useUpdateReleaseActionMutation, usePublishReleaseMutation, useDeleteReleaseActionMutation, useDeleteReleaseMutation, releaseApi, };
|
package/dist/server/index.js
CHANGED
|
@@ -344,9 +344,7 @@ const bootstrap = async ({ strapi: strapi2 }) => {
|
|
|
344
344
|
actions: {
|
|
345
345
|
target_type: model.uid,
|
|
346
346
|
target_id: {
|
|
347
|
-
$in: entriesToDelete.map(
|
|
348
|
-
(entry) => entry.id
|
|
349
|
-
)
|
|
347
|
+
$in: entriesToDelete.map((entry) => entry.id)
|
|
350
348
|
}
|
|
351
349
|
}
|
|
352
350
|
}
|
|
@@ -373,13 +371,9 @@ const bootstrap = async ({ strapi: strapi2 }) => {
|
|
|
373
371
|
try {
|
|
374
372
|
const { model, result } = event;
|
|
375
373
|
if (model.kind === "collectionType" && model.options?.draftAndPublish) {
|
|
376
|
-
const isEntryValid = await getEntryValidStatus(
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
{
|
|
380
|
-
strapi: strapi2
|
|
381
|
-
}
|
|
382
|
-
);
|
|
374
|
+
const isEntryValid = await getEntryValidStatus(model.uid, result, {
|
|
375
|
+
strapi: strapi2
|
|
376
|
+
});
|
|
383
377
|
await strapi2.db.query(RELEASE_ACTION_MODEL_UID).update({
|
|
384
378
|
where: {
|
|
385
379
|
target_type: model.uid,
|
|
@@ -662,7 +656,7 @@ const createReleaseService = ({ strapi: strapi2 }) => {
|
|
|
662
656
|
return release2;
|
|
663
657
|
},
|
|
664
658
|
async findOne(id, query = {}) {
|
|
665
|
-
const dbQuery =
|
|
659
|
+
const dbQuery = strapi2.get("query-params").transform(RELEASE_MODEL_UID, query);
|
|
666
660
|
const release2 = await strapi2.db.query(RELEASE_MODEL_UID).findOne({
|
|
667
661
|
...dbQuery,
|
|
668
662
|
where: { id }
|
|
@@ -670,7 +664,7 @@ const createReleaseService = ({ strapi: strapi2 }) => {
|
|
|
670
664
|
return release2;
|
|
671
665
|
},
|
|
672
666
|
findPage(query) {
|
|
673
|
-
const dbQuery =
|
|
667
|
+
const dbQuery = strapi2.get("query-params").transform(RELEASE_MODEL_UID, query ?? {});
|
|
674
668
|
return strapi2.db.query(RELEASE_MODEL_UID).findPage({
|
|
675
669
|
...dbQuery,
|
|
676
670
|
populate: {
|
|
@@ -831,10 +825,7 @@ const createReleaseService = ({ strapi: strapi2 }) => {
|
|
|
831
825
|
if (!release2) {
|
|
832
826
|
throw new utils.errors.NotFoundError(`No release found for id ${releaseId}`);
|
|
833
827
|
}
|
|
834
|
-
const dbQuery =
|
|
835
|
-
RELEASE_ACTION_MODEL_UID,
|
|
836
|
-
query ?? {}
|
|
837
|
-
);
|
|
828
|
+
const dbQuery = strapi2.get("query-params").transform(RELEASE_ACTION_MODEL_UID, query ?? {});
|
|
838
829
|
return strapi2.db.query(RELEASE_ACTION_MODEL_UID).findPage({
|
|
839
830
|
...dbQuery,
|
|
840
831
|
populate: {
|
|
@@ -848,10 +839,7 @@ const createReleaseService = ({ strapi: strapi2 }) => {
|
|
|
848
839
|
});
|
|
849
840
|
},
|
|
850
841
|
async countActions(query) {
|
|
851
|
-
const dbQuery =
|
|
852
|
-
RELEASE_ACTION_MODEL_UID,
|
|
853
|
-
query ?? {}
|
|
854
|
-
);
|
|
842
|
+
const dbQuery = strapi2.get("query-params").transform(RELEASE_ACTION_MODEL_UID, query ?? {});
|
|
855
843
|
return strapi2.db.query(RELEASE_ACTION_MODEL_UID).count(dbQuery);
|
|
856
844
|
},
|
|
857
845
|
async groupActions(actions, groupBy) {
|
|
@@ -861,9 +849,7 @@ const createReleaseService = ({ strapi: strapi2 }) => {
|
|
|
861
849
|
}
|
|
862
850
|
return acc;
|
|
863
851
|
}, []);
|
|
864
|
-
const allReleaseContentTypesDictionary = await this.getContentTypesDataForActions(
|
|
865
|
-
contentTypeUids
|
|
866
|
-
);
|
|
852
|
+
const allReleaseContentTypesDictionary = await this.getContentTypesDataForActions(contentTypeUids);
|
|
867
853
|
const allLocalesDictionary = await this.getLocalesDataForActions();
|
|
868
854
|
const formattedData = actions.map((action) => {
|
|
869
855
|
const { mainField, displayName } = allReleaseContentTypesDictionary[action.contentType];
|
|
@@ -985,9 +971,7 @@ const createReleaseService = ({ strapi: strapi2 }) => {
|
|
|
985
971
|
}
|
|
986
972
|
try {
|
|
987
973
|
strapi2.log.info(`[Content Releases] Starting to publish release ${lockedRelease.name}`);
|
|
988
|
-
const { collectionTypeActions, singleTypeActions } = await getFormattedActions(
|
|
989
|
-
releaseId
|
|
990
|
-
);
|
|
974
|
+
const { collectionTypeActions, singleTypeActions } = await getFormattedActions(releaseId);
|
|
991
975
|
await strapi2.db.transaction(async () => {
|
|
992
976
|
for (const { uid, action, id } of singleTypeActions) {
|
|
993
977
|
await publishSingleTypeAction(uid, action, id);
|