UNPKG

2.49 kBTypeScriptView Raw
1import type { BasicMetaSysProps, DefaultElements, ISO8601Timestamp, Link, MakeRequest, VersionedLink } from '../common-types';
2type JsonObject = {
3 [Key in string]?: JsonValue;
4};
5type JsonArray = Array<JsonValue>;
6type JsonValue = string | number | boolean | JsonObject | JsonArray | null;
7declare enum EnvironmentTemplateInstallationStatuses {
8 created = "created",
9 inProgress = "inProgress",
10 failed = "failed",
11 succeeded = "succeeded",
12 disconnected = "disconnected",
13 inRetry = "inRetry"
14}
15export type EnvironmentTemplateInstallationStatus = keyof typeof EnvironmentTemplateInstallationStatuses;
16export type EnvironmentTemplateInstallationProps = {
17 sys: BasicMetaSysProps & {
18 type: 'EnvironmentTemplateInstallation';
19 space: Link<'Space'>;
20 template: VersionedLink<'Template'>;
21 status: EnvironmentTemplateInstallationStatus;
22 createdAt: ISO8601Timestamp;
23 updatedAt: ISO8601Timestamp;
24 createdBy: Link<'User' | 'AppDefinition'>;
25 updatedBy: Link<'User' | 'AppDefinition'>;
26 completedAt?: ISO8601Timestamp;
27 errors?: JsonArray;
28 environment: Link<'Environment'>;
29 version: number;
30 };
31};
32export type CreateEnvironmentTemplateInstallationProps = {
33 version: number;
34 takeover?: {
35 items: Link<'ContentType'>[];
36 };
37 changeSet?: Link<'ChangeSet'>;
38};
39export type ValidateEnvironmentTemplateInstallationProps = Omit<CreateEnvironmentTemplateInstallationProps, 'version'>;
40export type ValidationFinding = {
41 message: string;
42 details: Record<string, unknown>;
43};
44export type EnvironmentTemplateValidationProps<T = ValidationFinding> = {
45 sys: {
46 type: 'Array';
47 environment: Link<'Environment'>;
48 space: Link<'Space'>;
49 changeSet: Link<'ChangeSet'>;
50 };
51 items: T[];
52};
53export type EnvironmentTemplateInstallation = EnvironmentTemplateInstallationProps & DefaultElements<EnvironmentTemplateInstallationProps>;
54export declare function wrapEnvironmentTemplateInstallation(makeRequest: MakeRequest, data: EnvironmentTemplateInstallationProps): EnvironmentTemplateInstallation;
55export declare const wrapEnvironmentTemplateInstallationCollection: (makeRequest: MakeRequest, data: import("../common-types").CursorPaginatedCollectionProp<EnvironmentTemplateInstallationProps>) => import("../common-types").CursorPaginatedCollection<EnvironmentTemplateInstallation, EnvironmentTemplateInstallationProps>;
56export {};