@blocklet/pages-kit 0.4.145 → 0.4.146
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -87,6 +87,49 @@ export interface Chunk {
|
|
|
87
87
|
id: string;
|
|
88
88
|
code?: string;
|
|
89
89
|
}
|
|
90
|
+
export declare enum DataSourceTypeEnum {
|
|
91
|
+
JSON = "json",
|
|
92
|
+
API = "api",
|
|
93
|
+
TEXT = "text"
|
|
94
|
+
}
|
|
95
|
+
export declare enum ApiMethod {
|
|
96
|
+
GET = "GET",
|
|
97
|
+
POST = "POST",
|
|
98
|
+
PUT = "PUT",
|
|
99
|
+
DELETE = "DELETE",
|
|
100
|
+
PATCH = "PATCH"
|
|
101
|
+
}
|
|
102
|
+
export type ParameterDefinition = {
|
|
103
|
+
type: 'string' | 'number' | 'boolean' | 'object' | 'array';
|
|
104
|
+
required: boolean;
|
|
105
|
+
default?: any;
|
|
106
|
+
description?: string;
|
|
107
|
+
};
|
|
108
|
+
export type DataSourceParameters = {
|
|
109
|
+
[paramName: string]: ParameterDefinition;
|
|
110
|
+
};
|
|
111
|
+
export type JsonTypeSpecificData = {
|
|
112
|
+
content: any;
|
|
113
|
+
};
|
|
114
|
+
export type StringTypeSpecificData = {
|
|
115
|
+
content: string;
|
|
116
|
+
};
|
|
117
|
+
export type ApiTypeSpecificData = {
|
|
118
|
+
endpoint: string;
|
|
119
|
+
method: ApiMethod;
|
|
120
|
+
headers?: Record<string, string>;
|
|
121
|
+
parameters: DataSourceParameters;
|
|
122
|
+
};
|
|
123
|
+
export type TypeSpecificData = JsonTypeSpecificData | StringTypeSpecificData | ApiTypeSpecificData;
|
|
124
|
+
export type SiteDataSource = {
|
|
125
|
+
id: string;
|
|
126
|
+
name: string;
|
|
127
|
+
description: string;
|
|
128
|
+
type: DataSourceTypeEnum;
|
|
129
|
+
typeSpecificData: TypeSpecificData;
|
|
130
|
+
createdAt: string;
|
|
131
|
+
updatedAt: string;
|
|
132
|
+
};
|
|
90
133
|
export interface Section<T = {
|
|
91
134
|
[key: string]: any;
|
|
92
135
|
}> {
|
|
@@ -118,6 +161,8 @@ export type State = {
|
|
|
118
161
|
pages: Record<string, Page | undefined>;
|
|
119
162
|
routeIds: string[];
|
|
120
163
|
routes: Record<string, PageRoute | undefined>;
|
|
164
|
+
dataSourceIds: string[];
|
|
165
|
+
dataSources: Record<string, SiteDataSource | undefined>;
|
|
121
166
|
components: Record<string, {
|
|
122
167
|
index: number;
|
|
123
168
|
data: CustomComponent;
|