1 | import type { BaseCollection, CursorPaginatedCollection, CursorPaginatedCollectionProp, DefaultElements, ISO8601Timestamp, Link, MakeRequest, MakeRequestPayload } from '../common-types';
|
2 | import { ScheduledActionReferenceFilters } from '../common-types';
|
3 | import type { AsyncActionProcessingOptions } from '../methods/action';
|
4 | import type { ReleaseAction } from './release-action';
|
5 |
|
6 | type Entity = 'Entry' | 'Asset';
|
7 | type ReleaseStatus = 'active' | 'archived';
|
8 | export interface ReleaseQueryOptions {
|
9 |
|
10 | 'entities.sys.linkType'?: string;
|
11 |
|
12 | 'entities.sys.id[in]'?: string;
|
13 |
|
14 | 'sys.id[nin]'?: string;
|
15 |
|
16 | 'sys.id[in]'?: string;
|
17 |
|
18 | 'sys.createdBy.sys.id[in]'?: string;
|
19 |
|
20 | 'sys.status[in]'?: ReleaseStatus;
|
21 |
|
22 | 'sys.status[nin]'?: ReleaseStatus;
|
23 |
|
24 | 'title[match]'?: string;
|
25 |
|
26 | 'entities[exists]'?: boolean;
|
27 |
|
28 | pageNext?: string;
|
29 | |
30 |
|
31 |
|
32 |
|
33 | limit?: number;
|
34 | |
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 | order?: string;
|
43 | }
|
44 | export type ReleaseSysProps = {
|
45 | id: string;
|
46 | type: 'Release';
|
47 | version: number;
|
48 | status: ReleaseStatus;
|
49 | space: Link<'Space'>;
|
50 | environment: Link<'Environment'>;
|
51 | archivedBy?: Link<'User'>;
|
52 | archivedAt?: ISO8601Timestamp;
|
53 | createdBy: Link<'User'> | Link<'AppDefinition'>;
|
54 | updatedBy: Link<'User'> | Link<'AppDefinition'>;
|
55 | createdAt: ISO8601Timestamp;
|
56 | updatedAt: ISO8601Timestamp;
|
57 | lastAction?: Link<'ReleaseAction'>;
|
58 | };
|
59 | export type ReleaseReferenceFilters = ScheduledActionReferenceFilters;
|
60 | export declare const ReleaseReferenceFilters: typeof ScheduledActionReferenceFilters;
|
61 | export type ReleaseMetadata = {
|
62 | withReferences: {
|
63 | entity: Link<'Entry'>;
|
64 | filter: Record<ReleaseReferenceFilters, string[]>;
|
65 | }[];
|
66 | };
|
67 |
|
68 | export interface ReleaseProps {
|
69 | title: string;
|
70 | sys: ReleaseSysProps;
|
71 | entities: BaseCollection<Link<Entity>>;
|
72 | metadata?: ReleaseMetadata;
|
73 | }
|
74 | export interface ReleasePayload extends MakeRequestPayload {
|
75 | title: string;
|
76 | entities: BaseCollection<Link<Entity>>;
|
77 | }
|
78 | export interface ReleaseValidatePayload {
|
79 | action?: 'publish';
|
80 | }
|
81 | export interface ReleaseValidateOptions {
|
82 | payload?: ReleaseValidatePayload;
|
83 | processingOptions?: AsyncActionProcessingOptions;
|
84 | }
|
85 | export interface ReleaseApiMethods {
|
86 | |
87 |
|
88 |
|
89 |
|
90 |
|
91 | archive(): Promise<Release>;
|
92 | |
93 |
|
94 |
|
95 |
|
96 | unarchive(): Promise<Release>;
|
97 |
|
98 | update(payload: ReleasePayload): Promise<Release>;
|
99 |
|
100 | delete(): Promise<void>;
|
101 |
|
102 | publish(options?: AsyncActionProcessingOptions): Promise<ReleaseAction<'publish'>>;
|
103 |
|
104 | unpublish(options?: AsyncActionProcessingOptions): Promise<ReleaseAction<'unpublish'>>;
|
105 |
|
106 | validate({ payload, options, }?: {
|
107 | payload?: ReleaseValidatePayload;
|
108 | options?: AsyncActionProcessingOptions;
|
109 | }): Promise<ReleaseAction<'validate'>>;
|
110 | }
|
111 | export interface Release extends ReleaseProps, ReleaseApiMethods, DefaultElements<ReleaseProps> {
|
112 | }
|
113 |
|
114 |
|
115 |
|
116 |
|
117 |
|
118 |
|
119 |
|
120 | export declare function wrapRelease(makeRequest: MakeRequest, data: ReleaseProps): Release;
|
121 |
|
122 |
|
123 |
|
124 | export declare const wrapReleaseCollection: (makeRequest: MakeRequest, data: CursorPaginatedCollectionProp<ReleaseProps>) => CursorPaginatedCollection<Release, ReleaseProps>;
|
125 | export {};
|