@flexbe/sdk 0.2.25 → 0.2.26

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.
@@ -272,4 +272,37 @@ export class Pages {
272
272
  return response.data;
273
273
  });
274
274
  }
275
+ /**
276
+ * Get list of page versions
277
+ * @param pageId - ID of the page to get versions for
278
+ * @returns List of page versions
279
+ * @throws {UnauthorizedException} When the API key is invalid or expired
280
+ * @throws {NotFoundException} When the page is not found
281
+ * @throws {ForbiddenException} When the page does not belong to the site
282
+ * @throws {ServerException} When the server encounters an error
283
+ * @throws {TimeoutException} When the request times out
284
+ */
285
+ getPageVersions(pageId) {
286
+ return __awaiter(this, void 0, void 0, function* () {
287
+ const response = yield this.api.get(`/sites/${this.siteId}/pages/${pageId}/versions`);
288
+ return response.data;
289
+ });
290
+ }
291
+ /**
292
+ * Get a specific page version
293
+ * @param pageId - ID of the page
294
+ * @param versionId - ID of the version to get
295
+ * @returns The requested page version with data
296
+ * @throws {UnauthorizedException} When the API key is invalid or expired
297
+ * @throws {NotFoundException} When the page or version is not found
298
+ * @throws {ForbiddenException} When the page does not belong to the site
299
+ * @throws {ServerException} When the server encounters an error
300
+ * @throws {TimeoutException} When the request times out
301
+ */
302
+ getPageVersion(pageId, versionId) {
303
+ return __awaiter(this, void 0, void 0, function* () {
304
+ const response = yield this.api.get(`/sites/${this.siteId}/pages/${pageId}/versions/${versionId}`);
305
+ return response.data;
306
+ });
307
+ }
275
308
  }
@@ -242,5 +242,34 @@ class Pages {
242
242
  const response = await this.api.put(`/sites/${this.siteId}/pages/${pageId}/content`, content);
243
243
  return response.data;
244
244
  }
245
+ /**
246
+ * Get list of page versions
247
+ * @param pageId - ID of the page to get versions for
248
+ * @returns List of page versions
249
+ * @throws {UnauthorizedException} When the API key is invalid or expired
250
+ * @throws {NotFoundException} When the page is not found
251
+ * @throws {ForbiddenException} When the page does not belong to the site
252
+ * @throws {ServerException} When the server encounters an error
253
+ * @throws {TimeoutException} When the request times out
254
+ */
255
+ async getPageVersions(pageId) {
256
+ const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/versions`);
257
+ return response.data;
258
+ }
259
+ /**
260
+ * Get a specific page version
261
+ * @param pageId - ID of the page
262
+ * @param versionId - ID of the version to get
263
+ * @returns The requested page version with data
264
+ * @throws {UnauthorizedException} When the API key is invalid or expired
265
+ * @throws {NotFoundException} When the page or version is not found
266
+ * @throws {ForbiddenException} When the page does not belong to the site
267
+ * @throws {ServerException} When the server encounters an error
268
+ * @throws {TimeoutException} When the request times out
269
+ */
270
+ async getPageVersion(pageId, versionId) {
271
+ const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/versions/${versionId}`);
272
+ return response.data;
273
+ }
245
274
  }
246
275
  exports.Pages = Pages;
@@ -239,4 +239,33 @@ export class Pages {
239
239
  const response = await this.api.put(`/sites/${this.siteId}/pages/${pageId}/content`, content);
240
240
  return response.data;
241
241
  }
242
+ /**
243
+ * Get list of page versions
244
+ * @param pageId - ID of the page to get versions for
245
+ * @returns List of page versions
246
+ * @throws {UnauthorizedException} When the API key is invalid or expired
247
+ * @throws {NotFoundException} When the page is not found
248
+ * @throws {ForbiddenException} When the page does not belong to the site
249
+ * @throws {ServerException} When the server encounters an error
250
+ * @throws {TimeoutException} When the request times out
251
+ */
252
+ async getPageVersions(pageId) {
253
+ const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/versions`);
254
+ return response.data;
255
+ }
256
+ /**
257
+ * Get a specific page version
258
+ * @param pageId - ID of the page
259
+ * @param versionId - ID of the version to get
260
+ * @returns The requested page version with data
261
+ * @throws {UnauthorizedException} When the API key is invalid or expired
262
+ * @throws {NotFoundException} When the page or version is not found
263
+ * @throws {ForbiddenException} When the page does not belong to the site
264
+ * @throws {ServerException} When the server encounters an error
265
+ * @throws {TimeoutException} When the request times out
266
+ */
267
+ async getPageVersion(pageId, versionId) {
268
+ const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/versions/${versionId}`);
269
+ return response.data;
270
+ }
242
271
  }
@@ -1,4 +1,4 @@
1
- import { Page, GetPagesParams, PageListResponse, PageFolder, PageFolderListResponse, UpdateFolderParams, CreateFolderParams, UpdatePageParams, BulkUpdatePageItem, BulkUpdateResponse, BulkUpdateFolderItem, BulkUpdateFolderResponse, BulkDeleteResponse, PageContent, UpdatePageContentParams } from '../types/pages';
1
+ import { Page, GetPagesParams, PageListResponse, PageFolder, PageFolderListResponse, UpdateFolderParams, CreateFolderParams, UpdatePageParams, BulkUpdatePageItem, BulkUpdateResponse, BulkUpdateFolderItem, BulkUpdateFolderResponse, BulkDeleteResponse, PageContent, UpdatePageContentParams, PageVersionListResponse, PageVersionData } from '../types/pages';
2
2
  import { ApiClient } from './api-client';
3
3
  export declare class Pages {
4
4
  private readonly api;
@@ -193,4 +193,27 @@ export declare class Pages {
193
193
  * @throws {TimeoutException} When the request times out
194
194
  */
195
195
  updatePageContent(pageId: number, content: Partial<UpdatePageContentParams>): Promise<PageContent>;
196
+ /**
197
+ * Get list of page versions
198
+ * @param pageId - ID of the page to get versions for
199
+ * @returns List of page versions
200
+ * @throws {UnauthorizedException} When the API key is invalid or expired
201
+ * @throws {NotFoundException} When the page is not found
202
+ * @throws {ForbiddenException} When the page does not belong to the site
203
+ * @throws {ServerException} When the server encounters an error
204
+ * @throws {TimeoutException} When the request times out
205
+ */
206
+ getPageVersions(pageId: number): Promise<PageVersionListResponse>;
207
+ /**
208
+ * Get a specific page version
209
+ * @param pageId - ID of the page
210
+ * @param versionId - ID of the version to get
211
+ * @returns The requested page version with data
212
+ * @throws {UnauthorizedException} When the API key is invalid or expired
213
+ * @throws {NotFoundException} When the page or version is not found
214
+ * @throws {ForbiddenException} When the page does not belong to the site
215
+ * @throws {ServerException} When the server encounters an error
216
+ * @throws {TimeoutException} When the request times out
217
+ */
218
+ getPageVersion(pageId: number, versionId: number): Promise<PageVersionData>;
196
219
  }
@@ -292,4 +292,14 @@ export interface PageContent {
292
292
  };
293
293
  }
294
294
  export type UpdatePageContentParams = Omit<PageContent, 'versionId' | 'versionTime'>;
295
+ export interface PageVersion {
296
+ id: number;
297
+ createdAt: string;
298
+ }
299
+ export interface PageVersionListResponse {
300
+ list: PageVersion[];
301
+ }
302
+ export interface PageVersionData extends PageVersion {
303
+ data: Record<string, unknown>;
304
+ }
295
305
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flexbe/sdk",
3
- "version": "0.2.25",
3
+ "version": "0.2.26",
4
4
  "description": "TypeScript SDK for Flexbe API",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",