@blocklet/pages-kit 0.4.145 → 0.4.147

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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/pages-kit",
3
- "version": "0.4.145",
3
+ "version": "0.4.147",
4
4
  "description": "Pages Kit components and utils for blocklet(s)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -100,7 +100,7 @@
100
100
  "url": "git+https://github.com/blocklet/pages-kit.git"
101
101
  },
102
102
  "dependencies": {
103
- "@arcblock/did-connect": "^2.13.16",
103
+ "@arcblock/did-connect": "^2.13.18",
104
104
  "@blocklet/ai-kit": "^0.1.74",
105
105
  "@blocklet/js-sdk": "^1.16.42",
106
106
  "@blocklet/sdk": "^1.16.42",
@@ -169,7 +169,7 @@
169
169
  "react-router-dom": "^6.16.0"
170
170
  },
171
171
  "devDependencies": {
172
- "@arcblock/ux": "^2.13.16",
172
+ "@arcblock/ux": "^2.13.18",
173
173
  "@blocklet/ai-runtime": "^0.4.263",
174
174
  "@blocklet/js-sdk": "^1.16.42",
175
175
  "@blocklet/sdk": "^1.16.42",