@flexbe/sdk 0.2.12 → 0.2.14
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.
|
@@ -21,6 +21,7 @@ export class Pages {
|
|
|
21
21
|
* - status: Filter by page status (could be an array of statuses)
|
|
22
22
|
* - uri: Search by URI (exact match with '/' or partial match with '%word%')
|
|
23
23
|
* - folderId: Filter by folder ID
|
|
24
|
+
* - themeId: Filter by theme ID
|
|
24
25
|
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
25
26
|
* @throws {ForbiddenException} When the site is not accessible
|
|
26
27
|
* @throws {BadRequestException} When the query parameters are invalid
|
|
@@ -237,4 +238,38 @@ export class Pages {
|
|
|
237
238
|
return response.data;
|
|
238
239
|
});
|
|
239
240
|
}
|
|
241
|
+
/**
|
|
242
|
+
* Get page content
|
|
243
|
+
* @param pageId - ID of the page to get content for
|
|
244
|
+
* @returns The page content
|
|
245
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
246
|
+
* @throws {NotFoundException} When the page is not found
|
|
247
|
+
* @throws {ForbiddenException} When the page does not belong to the site
|
|
248
|
+
* @throws {ServerException} When the server encounters an error
|
|
249
|
+
* @throws {TimeoutException} When the request times out
|
|
250
|
+
*/
|
|
251
|
+
getPageContent(pageId) {
|
|
252
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
253
|
+
const response = yield this.api.get(`/sites/${this.siteId}/pages/${pageId}/content`);
|
|
254
|
+
return response.data;
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Update page content
|
|
259
|
+
* @param pageId - ID of the page to update content for
|
|
260
|
+
* @param content - The new page content
|
|
261
|
+
* @returns The updated page content
|
|
262
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
263
|
+
* @throws {NotFoundException} When the page is not found
|
|
264
|
+
* @throws {ForbiddenException} When the page does not belong to the site
|
|
265
|
+
* @throws {BadRequestException} When the update parameters are invalid
|
|
266
|
+
* @throws {ServerException} When the server encounters an error
|
|
267
|
+
* @throws {TimeoutException} When the request times out
|
|
268
|
+
*/
|
|
269
|
+
updatePageContent(pageId, content) {
|
|
270
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
271
|
+
const response = yield this.api.put(`/sites/${this.siteId}/pages/${pageId}/content`, content);
|
|
272
|
+
return response.data;
|
|
273
|
+
});
|
|
274
|
+
}
|
|
240
275
|
}
|
package/dist/cjs/client/pages.js
CHANGED
|
@@ -15,6 +15,7 @@ class Pages {
|
|
|
15
15
|
* - status: Filter by page status (could be an array of statuses)
|
|
16
16
|
* - uri: Search by URI (exact match with '/' or partial match with '%word%')
|
|
17
17
|
* - folderId: Filter by folder ID
|
|
18
|
+
* - themeId: Filter by theme ID
|
|
18
19
|
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
19
20
|
* @throws {ForbiddenException} When the site is not accessible
|
|
20
21
|
* @throws {BadRequestException} When the query parameters are invalid
|
|
@@ -211,5 +212,35 @@ class Pages {
|
|
|
211
212
|
});
|
|
212
213
|
return response.data;
|
|
213
214
|
}
|
|
215
|
+
/**
|
|
216
|
+
* Get page content
|
|
217
|
+
* @param pageId - ID of the page to get content for
|
|
218
|
+
* @returns The page content
|
|
219
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
220
|
+
* @throws {NotFoundException} When the page is not found
|
|
221
|
+
* @throws {ForbiddenException} When the page does not belong to the site
|
|
222
|
+
* @throws {ServerException} When the server encounters an error
|
|
223
|
+
* @throws {TimeoutException} When the request times out
|
|
224
|
+
*/
|
|
225
|
+
async getPageContent(pageId) {
|
|
226
|
+
const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/content`);
|
|
227
|
+
return response.data;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Update page content
|
|
231
|
+
* @param pageId - ID of the page to update content for
|
|
232
|
+
* @param content - The new page content
|
|
233
|
+
* @returns The updated page content
|
|
234
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
235
|
+
* @throws {NotFoundException} When the page is not found
|
|
236
|
+
* @throws {ForbiddenException} When the page does not belong to the site
|
|
237
|
+
* @throws {BadRequestException} When the update parameters are invalid
|
|
238
|
+
* @throws {ServerException} When the server encounters an error
|
|
239
|
+
* @throws {TimeoutException} When the request times out
|
|
240
|
+
*/
|
|
241
|
+
async updatePageContent(pageId, content) {
|
|
242
|
+
const response = await this.api.put(`/sites/${this.siteId}/pages/${pageId}/content`, content);
|
|
243
|
+
return response.data;
|
|
244
|
+
}
|
|
214
245
|
}
|
|
215
246
|
exports.Pages = Pages;
|
package/dist/esm/client/pages.js
CHANGED
|
@@ -12,6 +12,7 @@ export class Pages {
|
|
|
12
12
|
* - status: Filter by page status (could be an array of statuses)
|
|
13
13
|
* - uri: Search by URI (exact match with '/' or partial match with '%word%')
|
|
14
14
|
* - folderId: Filter by folder ID
|
|
15
|
+
* - themeId: Filter by theme ID
|
|
15
16
|
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
16
17
|
* @throws {ForbiddenException} When the site is not accessible
|
|
17
18
|
* @throws {BadRequestException} When the query parameters are invalid
|
|
@@ -208,4 +209,34 @@ export class Pages {
|
|
|
208
209
|
});
|
|
209
210
|
return response.data;
|
|
210
211
|
}
|
|
212
|
+
/**
|
|
213
|
+
* Get page content
|
|
214
|
+
* @param pageId - ID of the page to get content for
|
|
215
|
+
* @returns The page content
|
|
216
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
217
|
+
* @throws {NotFoundException} When the page is not found
|
|
218
|
+
* @throws {ForbiddenException} When the page does not belong to the site
|
|
219
|
+
* @throws {ServerException} When the server encounters an error
|
|
220
|
+
* @throws {TimeoutException} When the request times out
|
|
221
|
+
*/
|
|
222
|
+
async getPageContent(pageId) {
|
|
223
|
+
const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/content`);
|
|
224
|
+
return response.data;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Update page content
|
|
228
|
+
* @param pageId - ID of the page to update content for
|
|
229
|
+
* @param content - The new page content
|
|
230
|
+
* @returns The updated page content
|
|
231
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
232
|
+
* @throws {NotFoundException} When the page is not found
|
|
233
|
+
* @throws {ForbiddenException} When the page does not belong to the site
|
|
234
|
+
* @throws {BadRequestException} When the update parameters are invalid
|
|
235
|
+
* @throws {ServerException} When the server encounters an error
|
|
236
|
+
* @throws {TimeoutException} When the request times out
|
|
237
|
+
*/
|
|
238
|
+
async updatePageContent(pageId, content) {
|
|
239
|
+
const response = await this.api.put(`/sites/${this.siteId}/pages/${pageId}/content`, content);
|
|
240
|
+
return response.data;
|
|
241
|
+
}
|
|
211
242
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Page, GetPagesParams, PageListResponse, PageFolder, PageFolderListResponse, UpdateFolderParams, CreateFolderParams, UpdatePageParams, BulkUpdatePageItem, BulkUpdateResponse, BulkUpdateFolderItem, BulkUpdateFolderResponse, BulkDeleteResponseDto } from '../types/pages';
|
|
1
|
+
import { Page, GetPagesParams, PageListResponse, PageFolder, PageFolderListResponse, UpdateFolderParams, CreateFolderParams, UpdatePageParams, BulkUpdatePageItem, BulkUpdateResponse, BulkUpdateFolderItem, BulkUpdateFolderResponse, BulkDeleteResponseDto, PageContentDto, UpdatePageContentDto } from '../types/pages';
|
|
2
2
|
import { ApiClient } from './api-client';
|
|
3
3
|
export declare class Pages {
|
|
4
4
|
private readonly api;
|
|
@@ -13,6 +13,7 @@ export declare class Pages {
|
|
|
13
13
|
* - status: Filter by page status (could be an array of statuses)
|
|
14
14
|
* - uri: Search by URI (exact match with '/' or partial match with '%word%')
|
|
15
15
|
* - folderId: Filter by folder ID
|
|
16
|
+
* - themeId: Filter by theme ID
|
|
16
17
|
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
17
18
|
* @throws {ForbiddenException} When the site is not accessible
|
|
18
19
|
* @throws {BadRequestException} When the query parameters are invalid
|
|
@@ -168,4 +169,28 @@ export declare class Pages {
|
|
|
168
169
|
* @throws {TimeoutException} When the request times out
|
|
169
170
|
*/
|
|
170
171
|
bulkDeletePages(ids: number[]): Promise<BulkDeleteResponseDto>;
|
|
172
|
+
/**
|
|
173
|
+
* Get page content
|
|
174
|
+
* @param pageId - ID of the page to get content for
|
|
175
|
+
* @returns The page content
|
|
176
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
177
|
+
* @throws {NotFoundException} When the page is not found
|
|
178
|
+
* @throws {ForbiddenException} When the page does not belong to the site
|
|
179
|
+
* @throws {ServerException} When the server encounters an error
|
|
180
|
+
* @throws {TimeoutException} When the request times out
|
|
181
|
+
*/
|
|
182
|
+
getPageContent(pageId: number): Promise<PageContentDto>;
|
|
183
|
+
/**
|
|
184
|
+
* Update page content
|
|
185
|
+
* @param pageId - ID of the page to update content for
|
|
186
|
+
* @param content - The new page content
|
|
187
|
+
* @returns The updated page content
|
|
188
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
189
|
+
* @throws {NotFoundException} When the page is not found
|
|
190
|
+
* @throws {ForbiddenException} When the page does not belong to the site
|
|
191
|
+
* @throws {BadRequestException} When the update parameters are invalid
|
|
192
|
+
* @throws {ServerException} When the server encounters an error
|
|
193
|
+
* @throws {TimeoutException} When the request times out
|
|
194
|
+
*/
|
|
195
|
+
updatePageContent(pageId: number, content: UpdatePageContentDto): Promise<PageContentDto>;
|
|
171
196
|
}
|
|
@@ -56,6 +56,7 @@ export interface Page {
|
|
|
56
56
|
deletedAt: Date | null;
|
|
57
57
|
screenshot: Screenshot | null;
|
|
58
58
|
meta: PageMeta | null;
|
|
59
|
+
themeId: number;
|
|
59
60
|
}
|
|
60
61
|
export interface GetPagesParams {
|
|
61
62
|
offset?: number;
|
|
@@ -64,6 +65,7 @@ export interface GetPagesParams {
|
|
|
64
65
|
status?: PageStatus | PageStatus[];
|
|
65
66
|
uri?: string;
|
|
66
67
|
folderId?: number;
|
|
68
|
+
themeId?: number;
|
|
67
69
|
}
|
|
68
70
|
export interface PageListResponse {
|
|
69
71
|
list: Page[];
|
|
@@ -92,15 +94,7 @@ export interface UpdatePageParams {
|
|
|
92
94
|
language?: string;
|
|
93
95
|
folderId?: number;
|
|
94
96
|
sortIndex?: number;
|
|
95
|
-
meta?:
|
|
96
|
-
title?: string;
|
|
97
|
-
description?: string;
|
|
98
|
-
keywords?: string;
|
|
99
|
-
ogImage?: string;
|
|
100
|
-
ogTitle?: string;
|
|
101
|
-
ogDescription?: string;
|
|
102
|
-
noindex?: boolean;
|
|
103
|
-
};
|
|
97
|
+
meta?: Partial<PageMeta>;
|
|
104
98
|
}
|
|
105
99
|
export interface BulkUpdatePageItem extends UpdatePageParams {
|
|
106
100
|
id: number;
|
|
@@ -138,3 +132,172 @@ export interface BulkDeleteResponseDto {
|
|
|
138
132
|
deleted: number[];
|
|
139
133
|
errors: BulkDeleteError[];
|
|
140
134
|
}
|
|
135
|
+
export interface PageBackground {
|
|
136
|
+
image: {
|
|
137
|
+
id: number;
|
|
138
|
+
ext: string;
|
|
139
|
+
average: string;
|
|
140
|
+
preview: string;
|
|
141
|
+
width: number;
|
|
142
|
+
height: number;
|
|
143
|
+
proportion: number;
|
|
144
|
+
border: string;
|
|
145
|
+
animated: boolean;
|
|
146
|
+
transparent: number;
|
|
147
|
+
} | null;
|
|
148
|
+
styles: {
|
|
149
|
+
backgroundRepeat: string;
|
|
150
|
+
backgroundPosition: string;
|
|
151
|
+
backgroundSize: string;
|
|
152
|
+
backgroundFixed: boolean;
|
|
153
|
+
backgroundColor: string;
|
|
154
|
+
contrast: string;
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
export interface PageGrid {
|
|
158
|
+
color: string;
|
|
159
|
+
desktop: {
|
|
160
|
+
columns: string;
|
|
161
|
+
containerWidth: string;
|
|
162
|
+
columnWidth: string;
|
|
163
|
+
gap: string;
|
|
164
|
+
};
|
|
165
|
+
mobile: {
|
|
166
|
+
columns: string;
|
|
167
|
+
containerWidth: string;
|
|
168
|
+
columnWidth: string;
|
|
169
|
+
gap: string;
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
export interface PageFont {
|
|
173
|
+
set: Array<{
|
|
174
|
+
id: string;
|
|
175
|
+
uid: string;
|
|
176
|
+
protected: boolean;
|
|
177
|
+
title: string;
|
|
178
|
+
style: {
|
|
179
|
+
fontId: string;
|
|
180
|
+
family: string;
|
|
181
|
+
weight: number;
|
|
182
|
+
size: string;
|
|
183
|
+
line_height: number;
|
|
184
|
+
letter_spacing: number;
|
|
185
|
+
registry: string;
|
|
186
|
+
decoration_italic: boolean;
|
|
187
|
+
color: string;
|
|
188
|
+
contrast: string;
|
|
189
|
+
decoration_strike: boolean;
|
|
190
|
+
decoration_underline: boolean;
|
|
191
|
+
colors: {
|
|
192
|
+
enable: boolean;
|
|
193
|
+
light: {
|
|
194
|
+
color: string;
|
|
195
|
+
opacity: number;
|
|
196
|
+
contrast: string;
|
|
197
|
+
};
|
|
198
|
+
dark: {
|
|
199
|
+
color: string;
|
|
200
|
+
opacity: number;
|
|
201
|
+
contrast: string;
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
mobile: {
|
|
206
|
+
weight: string;
|
|
207
|
+
size: string;
|
|
208
|
+
line_height: number;
|
|
209
|
+
letter_spacing: string;
|
|
210
|
+
fontId: string;
|
|
211
|
+
family: string;
|
|
212
|
+
registry: string;
|
|
213
|
+
decoration_italic: string;
|
|
214
|
+
decoration_strike: string;
|
|
215
|
+
decoration_underline: string;
|
|
216
|
+
colors: {
|
|
217
|
+
light: string;
|
|
218
|
+
dark: string;
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
subsets: string[];
|
|
222
|
+
}>;
|
|
223
|
+
}
|
|
224
|
+
export interface PageBlock {
|
|
225
|
+
update_time: number;
|
|
226
|
+
data: Record<string, unknown>;
|
|
227
|
+
id: string;
|
|
228
|
+
is: string;
|
|
229
|
+
template_id: string;
|
|
230
|
+
refPageId?: number;
|
|
231
|
+
p_id: number;
|
|
232
|
+
aboveTheFold?: boolean;
|
|
233
|
+
}
|
|
234
|
+
export interface PageElement {
|
|
235
|
+
update_time: number;
|
|
236
|
+
data: Record<string, unknown>;
|
|
237
|
+
id: string;
|
|
238
|
+
is: string;
|
|
239
|
+
template_id: string;
|
|
240
|
+
mod_id?: string;
|
|
241
|
+
p_id: number;
|
|
242
|
+
aboveTheFold?: boolean;
|
|
243
|
+
hidden?: string;
|
|
244
|
+
}
|
|
245
|
+
export interface PageWidget {
|
|
246
|
+
update_time: number;
|
|
247
|
+
data: Record<string, unknown>;
|
|
248
|
+
id: string;
|
|
249
|
+
is: string;
|
|
250
|
+
template_id: string;
|
|
251
|
+
untouched?: boolean;
|
|
252
|
+
p_id: number;
|
|
253
|
+
}
|
|
254
|
+
export interface PageABTest {
|
|
255
|
+
a: string;
|
|
256
|
+
b: string;
|
|
257
|
+
current: 'a' | 'b';
|
|
258
|
+
is_active: number;
|
|
259
|
+
id: number;
|
|
260
|
+
}
|
|
261
|
+
export interface PageModal {
|
|
262
|
+
update_time: number;
|
|
263
|
+
data: Record<string, unknown>;
|
|
264
|
+
id: string;
|
|
265
|
+
is: string;
|
|
266
|
+
template_id: string;
|
|
267
|
+
mod_id: string;
|
|
268
|
+
p_id: number;
|
|
269
|
+
screenshot: {
|
|
270
|
+
id: number;
|
|
271
|
+
ext: string;
|
|
272
|
+
average: string;
|
|
273
|
+
preview: string;
|
|
274
|
+
width: number;
|
|
275
|
+
height: number;
|
|
276
|
+
proportion: number;
|
|
277
|
+
animated: boolean;
|
|
278
|
+
transparent: number;
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
export interface PageContentDto {
|
|
282
|
+
blocks: PageBlock[];
|
|
283
|
+
modals: PageModal[];
|
|
284
|
+
elements: PageElement[];
|
|
285
|
+
widgets: PageWidget[];
|
|
286
|
+
codes: string[];
|
|
287
|
+
background: PageBackground;
|
|
288
|
+
fonts: PageFont;
|
|
289
|
+
abtests: PageABTest[];
|
|
290
|
+
responsive: string | boolean;
|
|
291
|
+
}
|
|
292
|
+
export interface UpdatePageContentDto {
|
|
293
|
+
id: number;
|
|
294
|
+
blocks?: PageBlock[];
|
|
295
|
+
modals?: PageModal[];
|
|
296
|
+
elements?: PageElement[];
|
|
297
|
+
widgets?: PageWidget[];
|
|
298
|
+
codes?: string[];
|
|
299
|
+
background?: PageBackground;
|
|
300
|
+
fonts?: PageFont;
|
|
301
|
+
abtests?: PageABTest[];
|
|
302
|
+
responsive?: string | boolean;
|
|
303
|
+
}
|