UNPKG

2.37 kBTypeScriptView Raw
1import type { DefaultElements, ISO8601Timestamp, Link, MakeRequest } from '../common-types';
2import type { AsyncActionProcessingOptions } from '../methods/action';
3type ReleaseActionStatuses = 'created' | 'inProgress' | 'failed' | 'succeeded';
4export type ReleaseActionTypes = 'publish' | 'unpublish' | 'validate';
5export type ReleaseActionSysProps = {
6 id: string;
7 type: 'ReleaseAction';
8 space: Link<'Space'>;
9 environment: Link<'Environment'>;
10 release: Link<'Release'>;
11 status: ReleaseActionStatuses;
12 createdBy: Link<'User'>;
13 createdAt: ISO8601Timestamp;
14 updatedBy: Link<'User'>;
15 updatedAt: ISO8601Timestamp;
16};
17/** The object returned by the Releases API */
18export interface ReleaseActionProps<T extends ReleaseActionTypes = any> {
19 action: T;
20 sys: ReleaseActionSysProps;
21}
22export interface ReleaseActionQueryOptions {
23 /** Find Release Actions by using a comma-separated list of Ids */
24 'sys.id[in]'?: string;
25 'sys.release.sys.id[in]'?: string;
26 'sys.status[in]'?: string;
27 'sys.status[nin]'?: string;
28 action?: ReleaseActionTypes;
29 /** Get unique results by this field. Currently supports `sys.release.sys.id` */
30 uniqueBy?: string;
31 /** @default -sys.updatedAt */
32 order?: string;
33 /**
34 * Limit of how many records are returned in the query result
35 * @default 100
36 * */
37 limit?: number;
38}
39export interface ReleaseActionApiMethods {
40 /** Performs a new GET request and returns the wrapper Release */
41 get(): ReleaseAction;
42 /** Waits until the Release Action has either succeeded or failed */
43 waitProcessing(options?: AsyncActionProcessingOptions): ReleaseAction;
44}
45export interface ReleaseAction<T extends ReleaseActionTypes = any> extends ReleaseActionProps<T>, ReleaseActionApiMethods, DefaultElements<ReleaseActionProps<T>> {
46}
47/**
48 * @private
49 * @param makeRequest - function to make requests via an adapter
50 * @param data - Raw Release data
51 * @return Wrapped Release data
52 */
53export declare function wrapReleaseAction(makeRequest: MakeRequest, data: ReleaseActionProps): ReleaseAction;
54/**
55 * @private
56 */
57export declare const wrapReleaseActionCollection: (makeRequest: MakeRequest, data: import("../common-types").CollectionProp<ReleaseActionProps<any>>) => import("../common-types").Collection<ReleaseAction<any>, ReleaseActionProps<any>>;
58export {};