@flexbe/sdk 0.2.32 → 0.2.34

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.
@@ -144,6 +144,7 @@ export class Pages {
144
144
  * @param pageId - ID of the page to update
145
145
  * @param data - Update parameters including:
146
146
  * - status: New status for the page
147
+ * - versionId: ID of the version to set as current
147
148
  * - name: New name for the page (max 150 characters)
148
149
  * - uri: New URI for the page (max 255 characters, automatically normalized with leading and trailing slashes)
149
150
  * - language: New language for the page
@@ -157,10 +158,9 @@ export class Pages {
157
158
  * - ogTitle: Open Graph title for social sharing (max 200 characters)
158
159
  * - ogDescription: Open Graph description for social sharing (max 1000 characters)
159
160
  * - noindex: Whether to prevent search engine indexing
160
- * - grid: Grid configuration for the page
161
161
  * @throws {UnauthorizedException} When the API key is invalid or expired
162
- * @throws {NotFoundException} When the page is not found
163
- * @throws {ForbiddenException} When the page does not belong to the site
162
+ * @throws {NotFoundException} When the page or version is not found
163
+ * @throws {ForbiddenException} When the page does not belong to the site or version belongs to a different page
164
164
  * @throws {BadRequestException} When the update parameters are invalid
165
165
  * @throws {ServerException} When the server encounters an error
166
166
  * @throws {TimeoutException} When the request times out
@@ -272,6 +272,39 @@ export class Pages {
272
272
  return response.data;
273
273
  });
274
274
  }
275
+ /**
276
+ * Get list of page history items
277
+ * @param pageId - ID of the page to get history for
278
+ * @returns List of page history items
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
+ getPageHistory(pageId) {
286
+ return __awaiter(this, void 0, void 0, function* () {
287
+ const response = yield this.api.get(`/sites/${this.siteId}/pages/${pageId}/history`);
288
+ return response.data;
289
+ });
290
+ }
291
+ /**
292
+ * Get a specific page history item
293
+ * @param pageId - ID of the page
294
+ * @param versionId - ID of the history item to get
295
+ * @returns The requested page history item with data
296
+ * @throws {UnauthorizedException} When the API key is invalid or expired
297
+ * @throws {NotFoundException} When the page or history item 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
+ getPageHistoryItem(pageId, versionId) {
303
+ return __awaiter(this, void 0, void 0, function* () {
304
+ const response = yield this.api.get(`/sites/${this.siteId}/pages/${pageId}/history/${versionId}`);
305
+ return response.data;
306
+ });
307
+ }
275
308
  /**
276
309
  * Get list of page versions
277
310
  * @param pageId - ID of the page to get versions for
@@ -282,9 +315,9 @@ export class Pages {
282
315
  * @throws {ServerException} When the server encounters an error
283
316
  * @throws {TimeoutException} When the request times out
284
317
  */
285
- getPageHistory(pageId) {
318
+ getPageVersions(pageId) {
286
319
  return __awaiter(this, void 0, void 0, function* () {
287
- const response = yield this.api.get(`/sites/${this.siteId}/pages/${pageId}/history`);
320
+ const response = yield this.api.get(`/sites/${this.siteId}/pages/${pageId}/versions`);
288
321
  return response.data;
289
322
  });
290
323
  }
@@ -299,9 +332,9 @@ export class Pages {
299
332
  * @throws {ServerException} When the server encounters an error
300
333
  * @throws {TimeoutException} When the request times out
301
334
  */
302
- getPageHistoryItem(pageId, versionId) {
335
+ getPageVersion(pageId, versionId) {
303
336
  return __awaiter(this, void 0, void 0, function* () {
304
- const response = yield this.api.get(`/sites/${this.siteId}/pages/${pageId}/history/${versionId}`);
337
+ const response = yield this.api.get(`/sites/${this.siteId}/pages/${pageId}/versions/${versionId}`);
305
338
  return response.data;
306
339
  });
307
340
  }
@@ -126,6 +126,7 @@ class Pages {
126
126
  * @param pageId - ID of the page to update
127
127
  * @param data - Update parameters including:
128
128
  * - status: New status for the page
129
+ * - versionId: ID of the version to set as current
129
130
  * - name: New name for the page (max 150 characters)
130
131
  * - uri: New URI for the page (max 255 characters, automatically normalized with leading and trailing slashes)
131
132
  * - language: New language for the page
@@ -139,10 +140,9 @@ class Pages {
139
140
  * - ogTitle: Open Graph title for social sharing (max 200 characters)
140
141
  * - ogDescription: Open Graph description for social sharing (max 1000 characters)
141
142
  * - noindex: Whether to prevent search engine indexing
142
- * - grid: Grid configuration for the page
143
143
  * @throws {UnauthorizedException} When the API key is invalid or expired
144
- * @throws {NotFoundException} When the page is not found
145
- * @throws {ForbiddenException} When the page does not belong to the site
144
+ * @throws {NotFoundException} When the page or version is not found
145
+ * @throws {ForbiddenException} When the page does not belong to the site or version belongs to a different page
146
146
  * @throws {BadRequestException} When the update parameters are invalid
147
147
  * @throws {ServerException} When the server encounters an error
148
148
  * @throws {TimeoutException} When the request times out
@@ -242,6 +242,35 @@ 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 history items
247
+ * @param pageId - ID of the page to get history for
248
+ * @returns List of page history items
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 getPageHistory(pageId) {
256
+ const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/history`);
257
+ return response.data;
258
+ }
259
+ /**
260
+ * Get a specific page history item
261
+ * @param pageId - ID of the page
262
+ * @param versionId - ID of the history item to get
263
+ * @returns The requested page history item with data
264
+ * @throws {UnauthorizedException} When the API key is invalid or expired
265
+ * @throws {NotFoundException} When the page or history item 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 getPageHistoryItem(pageId, versionId) {
271
+ const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/history/${versionId}`);
272
+ return response.data;
273
+ }
245
274
  /**
246
275
  * Get list of page versions
247
276
  * @param pageId - ID of the page to get versions for
@@ -252,8 +281,8 @@ class Pages {
252
281
  * @throws {ServerException} When the server encounters an error
253
282
  * @throws {TimeoutException} When the request times out
254
283
  */
255
- async getPageHistory(pageId) {
256
- const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/history`);
284
+ async getPageVersions(pageId) {
285
+ const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/versions`);
257
286
  return response.data;
258
287
  }
259
288
  /**
@@ -267,8 +296,8 @@ class Pages {
267
296
  * @throws {ServerException} When the server encounters an error
268
297
  * @throws {TimeoutException} When the request times out
269
298
  */
270
- async getPageHistoryItem(pageId, versionId) {
271
- const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/history/${versionId}`);
299
+ async getPageVersion(pageId, versionId) {
300
+ const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/versions/${versionId}`);
272
301
  return response.data;
273
302
  }
274
303
  }
@@ -123,6 +123,7 @@ export class Pages {
123
123
  * @param pageId - ID of the page to update
124
124
  * @param data - Update parameters including:
125
125
  * - status: New status for the page
126
+ * - versionId: ID of the version to set as current
126
127
  * - name: New name for the page (max 150 characters)
127
128
  * - uri: New URI for the page (max 255 characters, automatically normalized with leading and trailing slashes)
128
129
  * - language: New language for the page
@@ -136,10 +137,9 @@ export class Pages {
136
137
  * - ogTitle: Open Graph title for social sharing (max 200 characters)
137
138
  * - ogDescription: Open Graph description for social sharing (max 1000 characters)
138
139
  * - noindex: Whether to prevent search engine indexing
139
- * - grid: Grid configuration for the page
140
140
  * @throws {UnauthorizedException} When the API key is invalid or expired
141
- * @throws {NotFoundException} When the page is not found
142
- * @throws {ForbiddenException} When the page does not belong to the site
141
+ * @throws {NotFoundException} When the page or version is not found
142
+ * @throws {ForbiddenException} When the page does not belong to the site or version belongs to a different page
143
143
  * @throws {BadRequestException} When the update parameters are invalid
144
144
  * @throws {ServerException} When the server encounters an error
145
145
  * @throws {TimeoutException} When the request times out
@@ -239,6 +239,35 @@ 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 history items
244
+ * @param pageId - ID of the page to get history for
245
+ * @returns List of page history items
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 getPageHistory(pageId) {
253
+ const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/history`);
254
+ return response.data;
255
+ }
256
+ /**
257
+ * Get a specific page history item
258
+ * @param pageId - ID of the page
259
+ * @param versionId - ID of the history item to get
260
+ * @returns The requested page history item with data
261
+ * @throws {UnauthorizedException} When the API key is invalid or expired
262
+ * @throws {NotFoundException} When the page or history item 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 getPageHistoryItem(pageId, versionId) {
268
+ const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/history/${versionId}`);
269
+ return response.data;
270
+ }
242
271
  /**
243
272
  * Get list of page versions
244
273
  * @param pageId - ID of the page to get versions for
@@ -249,8 +278,8 @@ export class Pages {
249
278
  * @throws {ServerException} When the server encounters an error
250
279
  * @throws {TimeoutException} When the request times out
251
280
  */
252
- async getPageHistory(pageId) {
253
- const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/history`);
281
+ async getPageVersions(pageId) {
282
+ const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/versions`);
254
283
  return response.data;
255
284
  }
256
285
  /**
@@ -264,8 +293,8 @@ export class Pages {
264
293
  * @throws {ServerException} When the server encounters an error
265
294
  * @throws {TimeoutException} When the request times out
266
295
  */
267
- async getPageHistoryItem(pageId, versionId) {
268
- const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/history/${versionId}`);
296
+ async getPageVersion(pageId, versionId) {
297
+ const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/versions/${versionId}`);
269
298
  return response.data;
270
299
  }
271
300
  }
@@ -1,4 +1,4 @@
1
- import { Page, GetPagesParams, PageListResponse, PageFolder, PageFolderListResponse, UpdateFolderParams, CreateFolderParams, UpdatePageParams, BulkUpdatePageItem, BulkUpdateResponse, BulkUpdateFolderItem, BulkUpdateFolderResponse, BulkDeleteResponse, PageContent, UpdatePageContentParams, PageVersionListResponse, PageHistoryItemData } from '../types/pages';
1
+ import { Page, GetPagesParams, PageListResponse, PageFolder, PageFolderListResponse, UpdateFolderParams, CreateFolderParams, UpdatePageParams, BulkUpdatePageItem, BulkUpdateResponse, BulkUpdateFolderItem, BulkUpdateFolderResponse, BulkDeleteResponse, PageContent, UpdatePageContentParams, PageHistoryListResponse, PageHistoryItemData, PageVersionListResponse, PageVersionDataResponse } from '../types/pages';
2
2
  import { ApiClient } from './api-client';
3
3
  export declare class Pages {
4
4
  private readonly api;
@@ -97,6 +97,7 @@ export declare class Pages {
97
97
  * @param pageId - ID of the page to update
98
98
  * @param data - Update parameters including:
99
99
  * - status: New status for the page
100
+ * - versionId: ID of the version to set as current
100
101
  * - name: New name for the page (max 150 characters)
101
102
  * - uri: New URI for the page (max 255 characters, automatically normalized with leading and trailing slashes)
102
103
  * - language: New language for the page
@@ -110,10 +111,9 @@ export declare class Pages {
110
111
  * - ogTitle: Open Graph title for social sharing (max 200 characters)
111
112
  * - ogDescription: Open Graph description for social sharing (max 1000 characters)
112
113
  * - noindex: Whether to prevent search engine indexing
113
- * - grid: Grid configuration for the page
114
114
  * @throws {UnauthorizedException} When the API key is invalid or expired
115
- * @throws {NotFoundException} When the page is not found
116
- * @throws {ForbiddenException} When the page does not belong to the site
115
+ * @throws {NotFoundException} When the page or version is not found
116
+ * @throws {ForbiddenException} When the page does not belong to the site or version belongs to a different page
117
117
  * @throws {BadRequestException} When the update parameters are invalid
118
118
  * @throws {ServerException} When the server encounters an error
119
119
  * @throws {TimeoutException} When the request times out
@@ -193,6 +193,29 @@ 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 history items
198
+ * @param pageId - ID of the page to get history for
199
+ * @returns List of page history items
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
+ getPageHistory(pageId: number): Promise<PageHistoryListResponse>;
207
+ /**
208
+ * Get a specific page history item
209
+ * @param pageId - ID of the page
210
+ * @param versionId - ID of the history item to get
211
+ * @returns The requested page history item with data
212
+ * @throws {UnauthorizedException} When the API key is invalid or expired
213
+ * @throws {NotFoundException} When the page or history item 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
+ getPageHistoryItem(pageId: number, versionId: number): Promise<PageHistoryItemData>;
196
219
  /**
197
220
  * Get list of page versions
198
221
  * @param pageId - ID of the page to get versions for
@@ -203,7 +226,7 @@ export declare class Pages {
203
226
  * @throws {ServerException} When the server encounters an error
204
227
  * @throws {TimeoutException} When the request times out
205
228
  */
206
- getPageHistory(pageId: number): Promise<PageVersionListResponse>;
229
+ getPageVersions(pageId: number): Promise<PageVersionListResponse>;
207
230
  /**
208
231
  * Get a specific page version
209
232
  * @param pageId - ID of the page
@@ -215,5 +238,5 @@ export declare class Pages {
215
238
  * @throws {ServerException} When the server encounters an error
216
239
  * @throws {TimeoutException} When the request times out
217
240
  */
218
- getPageHistoryItem(pageId: number, versionId: number): Promise<PageHistoryItemData>;
241
+ getPageVersion(pageId: number, versionId: number): Promise<PageVersionDataResponse>;
219
242
  }
@@ -45,6 +45,7 @@ export declare enum PageStatus {
45
45
  }
46
46
  export interface Page {
47
47
  id: number;
48
+ versionId: number | null;
48
49
  type: PageType;
49
50
  status: PageStatus;
50
51
  name: string;
@@ -89,6 +90,7 @@ export interface CreateFolderParams {
89
90
  }
90
91
  export interface UpdatePageParams {
91
92
  status?: PageStatus;
93
+ versionId?: number;
92
94
  name?: string;
93
95
  uri?: string;
94
96
  language?: string;
@@ -292,10 +294,20 @@ export interface PageHistoryItem {
292
294
  createdAt: string;
293
295
  selected?: boolean;
294
296
  }
295
- export interface PageVersionListResponse {
297
+ export interface PageHistoryListResponse {
296
298
  list: PageHistoryItem[];
297
299
  }
298
300
  export interface PageHistoryItemData extends PageHistoryItem {
299
301
  data: Record<string, unknown>;
300
302
  }
303
+ export interface PageVersionItem {
304
+ id: number;
305
+ createdAt: string;
306
+ }
307
+ export interface PageVersionListResponse {
308
+ list: PageVersionItem[];
309
+ }
310
+ export interface PageVersionDataResponse {
311
+ data: PageContent;
312
+ }
301
313
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flexbe/sdk",
3
- "version": "0.2.32",
3
+ "version": "0.2.34",
4
4
  "description": "TypeScript SDK for Flexbe API",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",