mirror of
https://github.com/strapi/strapi.git
synced 2025-09-14 11:08:35 +00:00

* chore: migrate bulk publish & unpublish to v5 * chore: change findLocales type to accept arrays * chore: fix lint error * chore: migrate bulkDelete to v5 (#20161) * chore: migrate bulkDelete to v5 * chore: change findLocales type to accept strings array * fix: docs prettier styles * chore: remove console.log * enhancement: migrate countManyDraftRelations to v5 * chore(content-releases): v5 migration * chore(content-releases): remove CMReleasesContainer * fix(content-releases): singleType works with v5 changes and e2e tests enabled * fix(content-releases): apply josh & marc comments * apply comments * fix(content-releases): tests * fix(content-releases): create custom populate object for each content type to handle relations * fix(content-releases): build problem * fix(content-releases): editing lifecycles * fix(content-releases): details view table columns * feat: releases settings (#20354) * feat: releases settings * feat: test nulling default timezone * chore: refactor tests * fix: remove async from describe * chore: OneOf type for response * chore: move OneOf utility to types package --------- Co-authored-by: Fernando Chavez <fernando.chavez@strapi.io> * feat: content releases settings permissions (#20357) * feat: releases settings * feat: test nulling default timezone * chore: refactor tests * fix: remove async from describe * feat: content releases settings permissions * chore: test for unauthorized role --------- Co-authored-by: Fernando Chavez <fernando.chavez@strapi.io> * fix(content-releases): run settings api tests only on ee edition * fix(content-releases): apply mark comments * fix(content-releases): remove releases box when there are no releases related to the entry * fix(content-releases): relation between actions and documents (#20424) * fix(content-releases): refactor relation with entries * fix(content-releases): refactor relation with entries * fix(content-releases): lint & unit tests errors * fix(content-releases): add migration for releases actions coming from v4 * fix(content-releases): apply multiple suggestions * fix(content-releases): new test data for e2e tests * fix(content-releases): fix test data * fix(content-releases): handle edge cases * fix(content-releases): apply marc suggestions * fix(content-releases): add modified status on validation column * fix(content-releases): fix releases menu button * fix(content-releases): use documents middleware instead of db lifecycles * fix(content-releases): invalidate releases tags on some content manager queries * fix(content-releases): using contentType utils and make afterDeleteMany lifecycle async * fix(content-releases): ui fixs * fix(content-releases): removing not needed axios from releases plugin * fix(content-releases): invalidate tags on release service * fix(content-releases): fix dependencies * feat(release-settings): remove navbar link release purchase page in CE (#20498) --------- Co-authored-by: Marc Roig <marc.roig.campos@strapi.io> Co-authored-by: Simone <startae14@gmail.com>
156 lines
3.8 KiB
TypeScript
156 lines
3.8 KiB
TypeScript
import type { Schema, Modules, UID, Struct } from '@strapi/types';
|
|
import type { Release, Pagination } from './releases';
|
|
import type { Entity } from '../types';
|
|
|
|
import type { errors } from '@strapi/utils';
|
|
|
|
type ReleaseActionEntryType = 'single-types' | 'collection-types';
|
|
|
|
export type ReleaseActionEntry = Modules.Documents.AnyDocument & {
|
|
// Entity attributes
|
|
[key: string]: Schema.Attribute.AnyAttribute;
|
|
} & {
|
|
locale?: string;
|
|
};
|
|
|
|
export interface ReleaseAction extends Entity {
|
|
type: 'publish' | 'unpublish';
|
|
entry: ReleaseActionEntry;
|
|
contentType: UID.ContentType;
|
|
entryDocumentId: ReleaseActionEntry['documentId'];
|
|
locale?: string;
|
|
release: Release;
|
|
isEntryValid: boolean;
|
|
status: 'draft' | 'published' | 'modified';
|
|
}
|
|
|
|
export interface FormattedReleaseAction extends Entity {
|
|
type: 'publish' | 'unpublish';
|
|
entry: ReleaseActionEntry;
|
|
contentType: {
|
|
uid: UID.ContentType;
|
|
mainFieldValue?: string;
|
|
displayName: string;
|
|
};
|
|
locale?: {
|
|
name: string;
|
|
code: string;
|
|
};
|
|
release: Release;
|
|
status: 'draft' | 'published' | 'modified';
|
|
}
|
|
|
|
/**
|
|
* POST /content-releases/:releaseId/actions - Create a release action
|
|
*/
|
|
export declare namespace CreateReleaseAction {
|
|
export interface Request {
|
|
params: {
|
|
releaseId: Release['id'];
|
|
};
|
|
body: {
|
|
type: ReleaseAction['type'];
|
|
contentType: UID.ContentType;
|
|
entryDocumentId?: ReleaseActionEntry['documentId'];
|
|
locale?: ReleaseActionEntry['locale'];
|
|
};
|
|
}
|
|
|
|
export interface Response {
|
|
data: ReleaseAction;
|
|
error?: errors.ApplicationError | errors.ValidationError | errors.NotFoundError;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* POST /content-releases/:releaseId/actions/bulk - Create multiple release actions
|
|
*/
|
|
export declare namespace CreateManyReleaseActions {
|
|
export interface Request {
|
|
params: {
|
|
releaseId: Release['id'];
|
|
};
|
|
body: Array<{
|
|
type: ReleaseAction['type'];
|
|
entry: {
|
|
id: ReleaseActionEntry['id'];
|
|
locale?: ReleaseActionEntry['locale'];
|
|
contentType: UID.ContentType;
|
|
};
|
|
}>;
|
|
}
|
|
|
|
export interface Response {
|
|
data: Array<ReleaseAction>;
|
|
meta: {
|
|
totalEntries: number;
|
|
entriesAlreadyInRelease: number;
|
|
};
|
|
error?: errors.ApplicationError | errors.ValidationError | errors.NotFoundError;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* GET /content-releases/:id/actions - Get all release actions
|
|
*/
|
|
|
|
export type ReleaseActionGroupBy = 'contentType' | 'action' | 'locale';
|
|
export declare namespace GetReleaseActions {
|
|
export interface Request {
|
|
params: {
|
|
releaseId: Release['id'];
|
|
};
|
|
query?: Partial<Pick<Pagination, 'page' | 'pageSize'>> & {
|
|
groupBy?: ReleaseActionGroupBy;
|
|
};
|
|
}
|
|
|
|
export interface Response {
|
|
data: {
|
|
[key: string]: Array<FormattedReleaseAction>;
|
|
};
|
|
meta: {
|
|
pagination: Pagination;
|
|
contentTypes: Record<Struct.ContentTypeSchema['uid'], Struct.ContentTypeSchema>;
|
|
components: Record<Struct.ComponentSchema['uid'], Struct.ComponentSchema>;
|
|
};
|
|
}
|
|
}
|
|
|
|
/*
|
|
* DELETE /content-releases/:releaseId/actions/:actionId - Delete a release action
|
|
*/
|
|
export declare namespace DeleteReleaseAction {
|
|
export interface Request {
|
|
params: {
|
|
actionId: ReleaseAction['id'];
|
|
releaseId: Release['id'];
|
|
};
|
|
}
|
|
|
|
export interface Response {
|
|
data: ReleaseAction;
|
|
error?: errors.ApplicationError | errors.NotFoundError;
|
|
}
|
|
}
|
|
|
|
/*
|
|
* PUT /content-releases/:releaseId/actions/:actionId - Update a release action
|
|
*/
|
|
export declare namespace UpdateReleaseAction {
|
|
export interface Request {
|
|
params: {
|
|
actionId: ReleaseAction['id'];
|
|
releaseId: ReleaseAction['id'];
|
|
};
|
|
body: {
|
|
type: ReleaseAction['type'];
|
|
};
|
|
}
|
|
|
|
export interface Response {
|
|
data: ReleaseAction;
|
|
error?: errors.ApplicationError | errors.ValidationError | errors.NotFoundError;
|
|
}
|
|
}
|