UNPKG

1.46 kBTypeScriptView Raw
1import type { DefaultElements, GetTagParams, MakeRequest, MetaSysProps, SysLink } from '../common-types';
2export type TagVisibility = 'private' | 'public';
3export type TagSysProps = Pick<MetaSysProps, 'id' | 'version' | 'createdAt' | 'createdBy' | 'updatedAt' | 'updatedBy'> & {
4 type: 'Tag';
5 visibility: TagVisibility;
6 space: SysLink;
7 environment: SysLink;
8};
9export type TagProps = {
10 sys: TagSysProps;
11 name: string;
12};
13export type CreateTagProps = Omit<TagProps, 'sys'> & {
14 sys: Pick<TagSysProps, 'visibility'>;
15};
16export type UpdateTagProps = Omit<TagProps, 'sys'> & {
17 sys: Pick<TagSysProps, 'version'>;
18};
19export type DeleteTagParams = GetTagParams & {
20 version: number;
21};
22export type TagCollectionProps = {
23 sys: {
24 type: 'Array';
25 };
26 items: TagProps[];
27 total: number;
28};
29export interface TagCollection {
30 items: Tag[];
31 total: number;
32}
33type TagApi = {
34 update(): Promise<Tag>;
35 delete(): Promise<void>;
36};
37export interface Tag extends TagProps, DefaultElements<TagProps>, TagApi {
38}
39/**
40 * @private
41 */
42export default function createTagApi(makeRequest: MakeRequest): TagApi;
43/**
44 * @private
45 */
46export declare function wrapTag(makeRequest: MakeRequest, data: TagProps): Tag;
47/**
48 * @private
49 */
50export declare const wrapTagCollection: (makeRequest: MakeRequest, data: import("../common-types").CollectionProp<TagProps>) => import("../common-types").Collection<Tag, TagProps>;
51export {};