@flexbe/sdk 0.2.45 → 0.2.47
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.
|
@@ -243,42 +243,6 @@ export class Pages {
|
|
|
243
243
|
return response.data;
|
|
244
244
|
});
|
|
245
245
|
}
|
|
246
|
-
/**
|
|
247
|
-
* @deprecated This method is deprecated and will be removed in a future release. Use the new page version API instead.
|
|
248
|
-
* Get page content
|
|
249
|
-
* @param pageId - ID of the page to get content for
|
|
250
|
-
* @returns The page content
|
|
251
|
-
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
252
|
-
* @throws {NotFoundException} When the page is not found
|
|
253
|
-
* @throws {ForbiddenException} When the page does not belong to the site
|
|
254
|
-
* @throws {ServerException} When the server encounters an error
|
|
255
|
-
* @throws {TimeoutException} When the request times out
|
|
256
|
-
*/
|
|
257
|
-
getPageContent(pageId) {
|
|
258
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
259
|
-
const response = yield this.api.get(`/sites/${this.siteId}/pages/${pageId}/content`);
|
|
260
|
-
return response.data;
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* @deprecated This method is deprecated and will be removed in a future release. Use the new page version API instead.
|
|
265
|
-
* Update page content
|
|
266
|
-
* @param pageId - ID of the page to update content for
|
|
267
|
-
* @param content - The new page content (excluding versionId and versionTime)
|
|
268
|
-
* @returns The updated page content
|
|
269
|
-
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
270
|
-
* @throws {NotFoundException} When the page is not found
|
|
271
|
-
* @throws {ForbiddenException} When the page does not belong to the site
|
|
272
|
-
* @throws {BadRequestException} When the update parameters are invalid
|
|
273
|
-
* @throws {ServerException} When the server encounters an error
|
|
274
|
-
* @throws {TimeoutException} When the request times out
|
|
275
|
-
*/
|
|
276
|
-
updatePageContent(pageId, content) {
|
|
277
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
278
|
-
const response = yield this.api.put(`/sites/${this.siteId}/pages/${pageId}/content`, content);
|
|
279
|
-
return response.data;
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
246
|
/**
|
|
283
247
|
* Get list of page versions
|
|
284
248
|
* @param pageId - ID of the page to get versions for
|
package/dist/cjs/client/pages.js
CHANGED
|
@@ -218,38 +218,6 @@ class Pages {
|
|
|
218
218
|
});
|
|
219
219
|
return response.data;
|
|
220
220
|
}
|
|
221
|
-
/**
|
|
222
|
-
* @deprecated This method is deprecated and will be removed in a future release. Use the new page version API instead.
|
|
223
|
-
* Get page content
|
|
224
|
-
* @param pageId - ID of the page to get content for
|
|
225
|
-
* @returns The page content
|
|
226
|
-
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
227
|
-
* @throws {NotFoundException} When the page is not found
|
|
228
|
-
* @throws {ForbiddenException} When the page does not belong to the site
|
|
229
|
-
* @throws {ServerException} When the server encounters an error
|
|
230
|
-
* @throws {TimeoutException} When the request times out
|
|
231
|
-
*/
|
|
232
|
-
async getPageContent(pageId) {
|
|
233
|
-
const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/content`);
|
|
234
|
-
return response.data;
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* @deprecated This method is deprecated and will be removed in a future release. Use the new page version API instead.
|
|
238
|
-
* Update page content
|
|
239
|
-
* @param pageId - ID of the page to update content for
|
|
240
|
-
* @param content - The new page content (excluding versionId and versionTime)
|
|
241
|
-
* @returns The updated page content
|
|
242
|
-
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
243
|
-
* @throws {NotFoundException} When the page is not found
|
|
244
|
-
* @throws {ForbiddenException} When the page does not belong to the site
|
|
245
|
-
* @throws {BadRequestException} When the update parameters are invalid
|
|
246
|
-
* @throws {ServerException} When the server encounters an error
|
|
247
|
-
* @throws {TimeoutException} When the request times out
|
|
248
|
-
*/
|
|
249
|
-
async updatePageContent(pageId, content) {
|
|
250
|
-
const response = await this.api.put(`/sites/${this.siteId}/pages/${pageId}/content`, content);
|
|
251
|
-
return response.data;
|
|
252
|
-
}
|
|
253
221
|
/**
|
|
254
222
|
* Get list of page versions
|
|
255
223
|
* @param pageId - ID of the page to get versions for
|
package/dist/esm/client/pages.js
CHANGED
|
@@ -215,38 +215,6 @@ export class Pages {
|
|
|
215
215
|
});
|
|
216
216
|
return response.data;
|
|
217
217
|
}
|
|
218
|
-
/**
|
|
219
|
-
* @deprecated This method is deprecated and will be removed in a future release. Use the new page version API instead.
|
|
220
|
-
* Get page content
|
|
221
|
-
* @param pageId - ID of the page to get content for
|
|
222
|
-
* @returns The page content
|
|
223
|
-
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
224
|
-
* @throws {NotFoundException} When the page is not found
|
|
225
|
-
* @throws {ForbiddenException} When the page does not belong to the site
|
|
226
|
-
* @throws {ServerException} When the server encounters an error
|
|
227
|
-
* @throws {TimeoutException} When the request times out
|
|
228
|
-
*/
|
|
229
|
-
async getPageContent(pageId) {
|
|
230
|
-
const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/content`);
|
|
231
|
-
return response.data;
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* @deprecated This method is deprecated and will be removed in a future release. Use the new page version API instead.
|
|
235
|
-
* Update page content
|
|
236
|
-
* @param pageId - ID of the page to update content for
|
|
237
|
-
* @param content - The new page content (excluding versionId and versionTime)
|
|
238
|
-
* @returns The updated page content
|
|
239
|
-
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
240
|
-
* @throws {NotFoundException} When the page is not found
|
|
241
|
-
* @throws {ForbiddenException} When the page does not belong to the site
|
|
242
|
-
* @throws {BadRequestException} When the update parameters are invalid
|
|
243
|
-
* @throws {ServerException} When the server encounters an error
|
|
244
|
-
* @throws {TimeoutException} When the request times out
|
|
245
|
-
*/
|
|
246
|
-
async updatePageContent(pageId, content) {
|
|
247
|
-
const response = await this.api.put(`/sites/${this.siteId}/pages/${pageId}/content`, content);
|
|
248
|
-
return response.data;
|
|
249
|
-
}
|
|
250
218
|
/**
|
|
251
219
|
* Get list of page versions
|
|
252
220
|
* @param pageId - ID of the page to get versions for
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiClient } from './api-client';
|
|
2
|
-
import { BulkDeleteResponse, BulkUpdateFolderItem, BulkUpdateFolderResponse, BulkUpdatePageItem, BulkUpdateResponse, CreateFolderParams, CreatePageVersionParams, GetPagesParams, Page,
|
|
2
|
+
import { BulkDeleteResponse, BulkUpdateFolderItem, BulkUpdateFolderResponse, BulkUpdatePageItem, BulkUpdateResponse, CreateFolderParams, CreatePageVersionParams, GetPagesParams, Page, PageFolder, PageFolderListResponse, PageListResponse, PageVersionDataResponse, PageVersionListResponse, UpdateFolderParams, UpdatePageParams } from '../types/pages';
|
|
3
3
|
export declare class Pages {
|
|
4
4
|
private readonly api;
|
|
5
5
|
private readonly siteId;
|
|
@@ -169,32 +169,6 @@ export declare class Pages {
|
|
|
169
169
|
* @throws {TimeoutException} When the request times out
|
|
170
170
|
*/
|
|
171
171
|
bulkDeletePages(ids: number[]): Promise<BulkDeleteResponse>;
|
|
172
|
-
/**
|
|
173
|
-
* @deprecated This method is deprecated and will be removed in a future release. Use the new page version API instead.
|
|
174
|
-
* Get page content
|
|
175
|
-
* @param pageId - ID of the page to get content for
|
|
176
|
-
* @returns The page content
|
|
177
|
-
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
178
|
-
* @throws {NotFoundException} When the page is not found
|
|
179
|
-
* @throws {ForbiddenException} When the page does not belong to the site
|
|
180
|
-
* @throws {ServerException} When the server encounters an error
|
|
181
|
-
* @throws {TimeoutException} When the request times out
|
|
182
|
-
*/
|
|
183
|
-
getPageContent(pageId: number): Promise<PageContent>;
|
|
184
|
-
/**
|
|
185
|
-
* @deprecated This method is deprecated and will be removed in a future release. Use the new page version API instead.
|
|
186
|
-
* Update page content
|
|
187
|
-
* @param pageId - ID of the page to update content for
|
|
188
|
-
* @param content - The new page content (excluding versionId and versionTime)
|
|
189
|
-
* @returns The updated page content
|
|
190
|
-
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
191
|
-
* @throws {NotFoundException} When the page is not found
|
|
192
|
-
* @throws {ForbiddenException} When the page does not belong to the site
|
|
193
|
-
* @throws {BadRequestException} When the update parameters are invalid
|
|
194
|
-
* @throws {ServerException} When the server encounters an error
|
|
195
|
-
* @throws {TimeoutException} When the request times out
|
|
196
|
-
*/
|
|
197
|
-
updatePageContent(pageId: number, content: Partial<UpdatePageContentParams>): Promise<PageContent>;
|
|
198
172
|
/**
|
|
199
173
|
* Get list of page versions
|
|
200
174
|
* @param pageId - ID of the page to get versions for
|
|
@@ -179,6 +179,17 @@ export interface PageBackground {
|
|
|
179
179
|
image: ImageObj | null;
|
|
180
180
|
styles: PageBackgroundStyles;
|
|
181
181
|
}
|
|
182
|
+
export type PageContainerViewport = number | 'auto';
|
|
183
|
+
export interface PageContainerBreakpoint {
|
|
184
|
+
width: number;
|
|
185
|
+
gutter: number;
|
|
186
|
+
viewport: PageContainerViewport;
|
|
187
|
+
maxViewport: PageContainerViewport;
|
|
188
|
+
}
|
|
189
|
+
export interface PageContainerSettings {
|
|
190
|
+
desktop: PageContainerBreakpoint;
|
|
191
|
+
mobile: PageContainerBreakpoint;
|
|
192
|
+
}
|
|
182
193
|
export interface PageGrid {
|
|
183
194
|
color: string;
|
|
184
195
|
desktop: {
|
|
@@ -218,9 +229,11 @@ export interface TextStyleProperties {
|
|
|
218
229
|
export interface FontFamilyItem {
|
|
219
230
|
id?: string;
|
|
220
231
|
name: string;
|
|
221
|
-
source: 'user' | 'google' | 'system';
|
|
232
|
+
source: 'user' | 'google' | 'system' | 'flexbe';
|
|
222
233
|
subsets?: string[];
|
|
223
234
|
variants: FontVariant[];
|
|
235
|
+
/** For Flexbe fonts */
|
|
236
|
+
cssPath?: string;
|
|
224
237
|
}
|
|
225
238
|
export type UploadedFont = {
|
|
226
239
|
id: string;
|
|
@@ -239,6 +252,45 @@ export interface StylesDataRaw {
|
|
|
239
252
|
siteTextStyles: TextStyleItem[];
|
|
240
253
|
pageTextStyles?: TextStyleItem[];
|
|
241
254
|
}
|
|
255
|
+
export type PageCodeImage = {
|
|
256
|
+
type: 'img';
|
|
257
|
+
id: number;
|
|
258
|
+
name: string;
|
|
259
|
+
ext: string;
|
|
260
|
+
average: string;
|
|
261
|
+
proportion: number;
|
|
262
|
+
};
|
|
263
|
+
export type PageCodeFile = {
|
|
264
|
+
type: 'file';
|
|
265
|
+
id: number;
|
|
266
|
+
name: string;
|
|
267
|
+
};
|
|
268
|
+
export type PageCodeModule = {
|
|
269
|
+
id: string;
|
|
270
|
+
path: string;
|
|
271
|
+
content: string;
|
|
272
|
+
};
|
|
273
|
+
export type PageCodeSources = {
|
|
274
|
+
html: string;
|
|
275
|
+
js: string;
|
|
276
|
+
css: string;
|
|
277
|
+
modules: PageCodeModule[];
|
|
278
|
+
};
|
|
279
|
+
export type PageCodeAsset = PageCodeImage | PageCodeFile;
|
|
280
|
+
export interface PageCodeMeta {
|
|
281
|
+
id: string;
|
|
282
|
+
name: string;
|
|
283
|
+
show_code: boolean;
|
|
284
|
+
is_body: boolean;
|
|
285
|
+
}
|
|
286
|
+
export type PageCode = {
|
|
287
|
+
html: string;
|
|
288
|
+
js: string;
|
|
289
|
+
css: string;
|
|
290
|
+
files: PageCodeAsset[];
|
|
291
|
+
sources: PageCodeSources;
|
|
292
|
+
};
|
|
293
|
+
export type PageCodeWithMeta = PageCodeMeta & PageCode;
|
|
242
294
|
export declare enum PageEntityType {
|
|
243
295
|
Block = "block",
|
|
244
296
|
Modal = "modal",
|
|
@@ -259,11 +311,11 @@ export type PageEntityEvent = {
|
|
|
259
311
|
state: 'all' | 'in' | 'out';
|
|
260
312
|
[key: string]: any;
|
|
261
313
|
};
|
|
262
|
-
export type PageEntityData<T = Record<string,
|
|
314
|
+
export type PageEntityData<T = Record<string, any>> = T;
|
|
263
315
|
export type PageEntityMultiVars<T> = Record<string, {
|
|
264
316
|
data: PageEntityData<T>;
|
|
265
317
|
}>;
|
|
266
|
-
export interface PageEntity<T = Record<string,
|
|
318
|
+
export interface PageEntity<T = Record<string, any>> {
|
|
267
319
|
id: string;
|
|
268
320
|
is: PageEntityType;
|
|
269
321
|
template_id: string;
|
|
@@ -283,7 +335,7 @@ export interface PageEntity<T = Record<string, unknown>> {
|
|
|
283
335
|
vars: PageEntityMultiVars<T>;
|
|
284
336
|
};
|
|
285
337
|
}
|
|
286
|
-
export interface PageBlock<T = Record<string,
|
|
338
|
+
export interface PageBlock<T = Record<string, any>> extends PageEntity<T> {
|
|
287
339
|
is: PageEntityType.Block;
|
|
288
340
|
refPageId?: number;
|
|
289
341
|
aboveTheFold?: boolean;
|
|
@@ -301,16 +353,16 @@ export interface PageBlock<T = Record<string, unknown>> extends PageEntity<T> {
|
|
|
301
353
|
}>;
|
|
302
354
|
};
|
|
303
355
|
}
|
|
304
|
-
export interface PageWidget<T = Record<string,
|
|
356
|
+
export interface PageWidget<T = Record<string, any>> extends PageEntity<T> {
|
|
305
357
|
is: PageEntityType.Widget;
|
|
306
358
|
children?: PageElement[];
|
|
307
359
|
}
|
|
308
|
-
export interface PageModal<T = Record<string,
|
|
360
|
+
export interface PageModal<T = Record<string, any>> extends PageEntity<T> {
|
|
309
361
|
is: PageEntityType.Modal;
|
|
310
362
|
screenshot: ImageObj | null;
|
|
311
363
|
children?: PageElement[];
|
|
312
364
|
}
|
|
313
|
-
export interface PageElement<T = Record<string,
|
|
365
|
+
export interface PageElement<T = Record<string, any>> extends PageEntity<T> {
|
|
314
366
|
is: PageEntityType.Element;
|
|
315
367
|
aboveTheFold?: boolean;
|
|
316
368
|
children?: PageElement[];
|
|
@@ -339,55 +391,41 @@ export interface PageVersionItem {
|
|
|
339
391
|
export interface PageVersionListResponse {
|
|
340
392
|
list: PageVersionItem[];
|
|
341
393
|
}
|
|
342
|
-
/**
|
|
343
|
-
|
|
394
|
+
/**
|
|
395
|
+
* Layout `entity.data` in page version JSON.
|
|
396
|
+
* Known fields + arbitrary keys per `template_id`.
|
|
397
|
+
*/
|
|
398
|
+
export type PageLayoutData = {
|
|
344
399
|
background?: PageBackground;
|
|
345
400
|
responsive?: 'auto' | false;
|
|
346
|
-
|
|
401
|
+
container?: PageContainerSettings;
|
|
402
|
+
} & Record<string, any>;
|
|
403
|
+
/**
|
|
404
|
+
* Page version JSON (`d_pages_versions.data`).
|
|
405
|
+
*/
|
|
347
406
|
export interface PageDataStructure {
|
|
348
407
|
id?: string;
|
|
349
|
-
is:
|
|
408
|
+
is: PageEntityType.Layout;
|
|
350
409
|
template_id: string;
|
|
351
410
|
blocks: PageBlock[];
|
|
352
411
|
modals: PageModal[];
|
|
353
412
|
widgets: PageWidget[];
|
|
354
413
|
abtests?: PageABTest[];
|
|
355
|
-
codes?:
|
|
414
|
+
codes?: PageCodeWithMeta[];
|
|
356
415
|
textStyles?: TextStyleItem[];
|
|
416
|
+
/** Layout settings (background, responsive) */
|
|
357
417
|
data?: PageLayoutData;
|
|
358
|
-
/**
|
|
418
|
+
/**
|
|
419
|
+
* @deprecated Moved to `data.background`
|
|
420
|
+
*/
|
|
359
421
|
background?: PageBackground;
|
|
360
|
-
/**
|
|
422
|
+
/**
|
|
423
|
+
* @deprecated Moved to `data.responsive`
|
|
424
|
+
*/
|
|
361
425
|
responsive?: 'auto' | false | boolean;
|
|
362
426
|
}
|
|
363
427
|
export interface PageVersionDataResponse extends PageVersionItem {
|
|
364
428
|
data: PageDataStructure;
|
|
365
429
|
abtests?: PageABTest[];
|
|
366
430
|
}
|
|
367
|
-
/**
|
|
368
|
-
* @deprecated This type is deprecated and will be removed in a future release. Use PageDataStructure or related types instead.
|
|
369
|
-
*/
|
|
370
|
-
export interface PageContent {
|
|
371
|
-
versionId: number;
|
|
372
|
-
versionTime: number;
|
|
373
|
-
blocks: PageBlock[];
|
|
374
|
-
modals: PageModal[];
|
|
375
|
-
elements: PageElement[];
|
|
376
|
-
widgets: PageWidget[];
|
|
377
|
-
codes: string[];
|
|
378
|
-
settings: {
|
|
379
|
-
background?: PageBackground;
|
|
380
|
-
textStyles?: TextStyleItem[];
|
|
381
|
-
responsive?: string | boolean;
|
|
382
|
-
} | null;
|
|
383
|
-
abtests: PageABTest[];
|
|
384
|
-
assets: {
|
|
385
|
-
images: number[];
|
|
386
|
-
files: string[];
|
|
387
|
-
};
|
|
388
|
-
}
|
|
389
|
-
/**
|
|
390
|
-
* @deprecated This type is deprecated and will be removed in a future release. Use PageDataStructure or related types instead.
|
|
391
|
-
*/
|
|
392
|
-
export type UpdatePageContentParams = Omit<PageContent, 'versionId' | 'versionTime'>;
|
|
393
431
|
export {};
|