2023-11-21 09:18:12 +01:00
|
|
|
import type { Entity } from '../types';
|
|
|
|
import type { ReleaseAction } from './release-actions';
|
|
|
|
import type { UserInfo } from '../types';
|
2023-11-17 16:59:01 +01:00
|
|
|
import { errors } from '@strapi/utils';
|
|
|
|
|
|
|
|
export interface Release extends Entity {
|
|
|
|
name: string;
|
2023-11-21 09:18:12 +01:00
|
|
|
releasedAt: string;
|
|
|
|
actions: ReleaseAction[];
|
|
|
|
}
|
|
|
|
|
|
|
|
type Pagination = {
|
|
|
|
page: number;
|
|
|
|
pageSize: number;
|
|
|
|
pageCount: number;
|
|
|
|
total: number;
|
|
|
|
};
|
|
|
|
|
|
|
|
export interface ReleaseDataResponse extends Omit<Release, 'actions'> {
|
|
|
|
actions: { meta: { count: number } };
|
2023-11-17 16:59:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2023-11-21 09:18:12 +01:00
|
|
|
* GET /content-releases/ - Get all releases
|
2023-11-17 16:59:01 +01:00
|
|
|
*/
|
2023-11-21 09:18:12 +01:00
|
|
|
export declare namespace GetReleases {
|
2023-11-17 16:59:01 +01:00
|
|
|
export interface Request {
|
2023-11-21 09:18:12 +01:00
|
|
|
state: {
|
|
|
|
userAbility: {};
|
|
|
|
};
|
|
|
|
query?: Partial<Pick<Pagination, 'page' | 'pageSize'>>;
|
2023-11-17 16:59:01 +01:00
|
|
|
}
|
|
|
|
|
2023-11-21 09:18:12 +01:00
|
|
|
export type Response =
|
|
|
|
| {
|
|
|
|
data: ReleaseDataResponse[];
|
|
|
|
pagination: Pagination;
|
|
|
|
}
|
|
|
|
| {
|
|
|
|
data: null;
|
|
|
|
error: errors.ApplicationError;
|
|
|
|
};
|
2023-11-17 16:59:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2023-11-21 09:18:12 +01:00
|
|
|
* GET /content-releases/:id - Get a single release
|
2023-11-17 16:59:01 +01:00
|
|
|
*/
|
2023-11-21 09:18:12 +01:00
|
|
|
export declare namespace GetRelease {
|
2023-11-17 16:59:01 +01:00
|
|
|
export interface Request {
|
2023-11-21 09:18:12 +01:00
|
|
|
state: {
|
|
|
|
userAbility: {};
|
|
|
|
};
|
|
|
|
params: {
|
|
|
|
id: Release['id'];
|
|
|
|
};
|
2023-11-17 16:59:01 +01:00
|
|
|
}
|
|
|
|
|
2023-11-21 09:18:12 +01:00
|
|
|
export type Response =
|
|
|
|
| {
|
|
|
|
data: ReleaseDataResponse;
|
|
|
|
}
|
|
|
|
| {
|
|
|
|
data: null;
|
|
|
|
error: errors.ApplicationError | errors.NotFoundError;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* POST /content-releases/ - Create a release
|
|
|
|
*/
|
|
|
|
export declare namespace CreateRelease {
|
|
|
|
export interface Request {
|
|
|
|
state: {
|
|
|
|
user: UserInfo;
|
|
|
|
};
|
|
|
|
body: {
|
|
|
|
name: string;
|
|
|
|
};
|
2023-11-17 16:59:01 +01:00
|
|
|
}
|
2023-11-21 09:18:12 +01:00
|
|
|
|
|
|
|
export type Response =
|
|
|
|
| { data: ReleaseDataResponse }
|
|
|
|
| { data: null; error: errors.ApplicationError | errors.ValidationError };
|
2023-11-17 16:59:01 +01:00
|
|
|
}
|