2023-11-21 09:18:12 +01:00
|
|
|
import { Attribute, Common } from '@strapi/types';
|
2023-12-04 10:10:51 +01:00
|
|
|
import type { Release, Pagination } from './releases';
|
2023-11-21 09:18:12 +01:00
|
|
|
import type { Entity } from '../types';
|
|
|
|
|
|
|
|
import type { errors } from '@strapi/utils';
|
2023-12-04 14:14:00 +01:00
|
|
|
import { UserInfo } from '@strapi/helper-plugin';
|
2023-11-21 09:18:12 +01:00
|
|
|
|
|
|
|
type ReleaseActionEntry = Entity & {
|
|
|
|
// Entity attributes
|
|
|
|
[key: string]: Attribute.Any;
|
|
|
|
};
|
|
|
|
|
2023-12-04 10:10:51 +01:00
|
|
|
export interface ReleaseAction extends Entity {
|
2023-11-21 09:18:12 +01:00
|
|
|
type: 'publish' | 'unpublish';
|
|
|
|
entry: ReleaseActionEntry;
|
|
|
|
contentType: Common.UID.ContentType;
|
|
|
|
release: Release;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2023-12-05 11:00:29 +01:00
|
|
|
* POST /content-releases/:releaseId/actions - Create a release action
|
2023-11-21 09:18:12 +01:00
|
|
|
*/
|
|
|
|
export declare namespace CreateReleaseAction {
|
|
|
|
export interface Request {
|
|
|
|
params: {
|
|
|
|
releaseId: Release['id'];
|
|
|
|
};
|
|
|
|
body: {
|
|
|
|
type: ReleaseAction['type'];
|
|
|
|
entry: {
|
|
|
|
id: ReleaseActionEntry['id'];
|
|
|
|
contentType: Common.UID.ContentType;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface Response {
|
2023-11-23 11:15:29 +01:00
|
|
|
data: ReleaseAction;
|
|
|
|
error?: errors.ApplicationError | errors.ValidationError | errors.NotFoundError;
|
2023-11-21 09:18:12 +01:00
|
|
|
}
|
|
|
|
}
|
2023-12-04 10:10:51 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GET /content-releases/:id/actions - Get all release actions
|
|
|
|
*/
|
|
|
|
export declare namespace GetReleaseActions {
|
|
|
|
export interface Request {
|
|
|
|
params: {
|
|
|
|
releaseId: Release['id'];
|
|
|
|
};
|
|
|
|
query?: Partial<Pick<Pagination, 'page' | 'pageSize'>>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface Response {
|
|
|
|
data: ReleaseAction[];
|
|
|
|
meta: {
|
|
|
|
pagination: Pagination;
|
|
|
|
};
|
2023-12-05 11:00:29 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* 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;
|
2023-12-04 10:10:51 +01:00
|
|
|
error?: errors.ApplicationError | errors.NotFoundError;
|
|
|
|
}
|
|
|
|
}
|
2023-12-04 14:14:00 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* 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;
|
|
|
|
}
|
|
|
|
}
|