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