1 | import type { DefaultElements, BasicMetaSysProps, SysLink, MakeRequest, Link } from '../common-types';
|
2 | import type { ContentfulAppDefinitionAPI } from '../create-app-definition-api';
|
3 | import type { SetOptional, Except } from 'type-fest';
|
4 | import type { FieldType } from './field-type';
|
5 | import type { InstallationParameterType, ParameterDefinition } from './widget-parameters';
|
6 | import type { AppInstallationProps } from './app-installation';
|
7 | import type { EnvironmentProps } from './environment';
|
8 | export interface NavigationItem {
|
9 | name: string;
|
10 | path: string;
|
11 | }
|
12 | type LocationType = 'app-config' | 'entry-sidebar' | 'entry-editor' | 'dialog' | 'page' | 'home';
|
13 | export interface SimpleLocation {
|
14 | location: LocationType;
|
15 | }
|
16 | export interface EntryFieldLocation {
|
17 | location: 'entry-field';
|
18 | fieldTypes: FieldType[];
|
19 | }
|
20 | export interface PageLocation {
|
21 | location: 'page';
|
22 | navigationItem?: NavigationItem;
|
23 | }
|
24 | export type AppLocation = SimpleLocation | EntryFieldLocation | PageLocation;
|
25 | export type AppDefinitionProps = {
|
26 | |
27 |
|
28 |
|
29 | sys: BasicMetaSysProps & {
|
30 | organization: SysLink;
|
31 | shared: boolean;
|
32 | };
|
33 | |
34 |
|
35 |
|
36 | name: string;
|
37 | |
38 |
|
39 |
|
40 | src?: string;
|
41 | |
42 |
|
43 |
|
44 | bundle?: Link<'AppBundle'>;
|
45 | |
46 |
|
47 |
|
48 | locations?: AppLocation[];
|
49 | |
50 |
|
51 |
|
52 | parameters?: {
|
53 | instance?: ParameterDefinition[];
|
54 | installation?: ParameterDefinition<InstallationParameterType>[];
|
55 | };
|
56 | };
|
57 | export type CreateAppDefinitionProps = SetOptional<Except<AppDefinitionProps, 'sys' | 'bundle'>, 'src' | 'locations'>;
|
58 | export type AppDefinition = ContentfulAppDefinitionAPI & AppDefinitionProps & DefaultElements<AppDefinitionProps>;
|
59 | export type AppInstallationsForOrganizationProps = {
|
60 | sys: {
|
61 | type: 'Array';
|
62 | };
|
63 | items: AppInstallationProps[];
|
64 | includes: {
|
65 | Environment: EnvironmentProps[];
|
66 | };
|
67 | };
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 | export declare function wrapAppDefinition(makeRequest: MakeRequest, data: AppDefinitionProps): AppDefinition;
|
75 |
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 | export declare const wrapAppDefinitionCollection: (makeRequest: MakeRequest, data: import("../common-types").CollectionProp<AppDefinitionProps>) => import("../common-types").Collection<AppDefinition, AppDefinitionProps>;
|
82 | export {};
|