@flexbe/sdk 0.2.6 → 0.2.7

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.
@@ -217,4 +217,24 @@ export class Pages {
217
217
  return response.data;
218
218
  });
219
219
  }
220
+ /**
221
+ * Bulk delete multiple pages
222
+ * @param pageIds - Array of page IDs to delete
223
+ * @returns Object containing:
224
+ * - deleted: Array of successfully deleted page IDs
225
+ * - errors: Array of errors for failed deletions
226
+ * @throws {UnauthorizedException} When the API key is invalid or expired
227
+ * @throws {ForbiddenException} When the site is not accessible
228
+ * @throws {BadRequestException} When all pages fail to delete
229
+ * @throws {ServerException} When the server encounters an error
230
+ * @throws {TimeoutException} When the request times out
231
+ */
232
+ bulkDeletePages(pageIds) {
233
+ return __awaiter(this, void 0, void 0, function* () {
234
+ const response = yield this.api.delete(`/sites/${this.siteId}/pages`, {
235
+ body: JSON.stringify({ pageIds })
236
+ });
237
+ return response.data;
238
+ });
239
+ }
220
240
  }
@@ -193,5 +193,23 @@ class Pages {
193
193
  const response = await this.api.patch(`/sites/${this.siteId}/pages-folders`, updates);
194
194
  return response.data;
195
195
  }
196
+ /**
197
+ * Bulk delete multiple pages
198
+ * @param pageIds - Array of page IDs to delete
199
+ * @returns Object containing:
200
+ * - deleted: Array of successfully deleted page IDs
201
+ * - errors: Array of errors for failed deletions
202
+ * @throws {UnauthorizedException} When the API key is invalid or expired
203
+ * @throws {ForbiddenException} When the site is not accessible
204
+ * @throws {BadRequestException} When all pages fail to delete
205
+ * @throws {ServerException} When the server encounters an error
206
+ * @throws {TimeoutException} When the request times out
207
+ */
208
+ async bulkDeletePages(pageIds) {
209
+ const response = await this.api.delete(`/sites/${this.siteId}/pages`, {
210
+ body: JSON.stringify({ pageIds })
211
+ });
212
+ return response.data;
213
+ }
196
214
  }
197
215
  exports.Pages = Pages;
@@ -190,4 +190,22 @@ export class Pages {
190
190
  const response = await this.api.patch(`/sites/${this.siteId}/pages-folders`, updates);
191
191
  return response.data;
192
192
  }
193
+ /**
194
+ * Bulk delete multiple pages
195
+ * @param pageIds - Array of page IDs to delete
196
+ * @returns Object containing:
197
+ * - deleted: Array of successfully deleted page IDs
198
+ * - errors: Array of errors for failed deletions
199
+ * @throws {UnauthorizedException} When the API key is invalid or expired
200
+ * @throws {ForbiddenException} When the site is not accessible
201
+ * @throws {BadRequestException} When all pages fail to delete
202
+ * @throws {ServerException} When the server encounters an error
203
+ * @throws {TimeoutException} When the request times out
204
+ */
205
+ async bulkDeletePages(pageIds) {
206
+ const response = await this.api.delete(`/sites/${this.siteId}/pages`, {
207
+ body: JSON.stringify({ pageIds })
208
+ });
209
+ return response.data;
210
+ }
193
211
  }
@@ -1,4 +1,4 @@
1
- import { Page, GetPagesParams, PageListResponse, PageFolder, PageFolderListResponse, UpdateFolderParams, CreateFolderParams, UpdatePageParams, BulkUpdatePageItem, BulkUpdateResponse, BulkUpdateFolderItem, BulkUpdateFolderResponse } from '../types/pages';
1
+ import { Page, GetPagesParams, PageListResponse, PageFolder, PageFolderListResponse, UpdateFolderParams, CreateFolderParams, UpdatePageParams, BulkUpdatePageItem, BulkUpdateResponse, BulkUpdateFolderItem, BulkUpdateFolderResponse, BulkDeleteResponseDto } from '../types/pages';
2
2
  import { ApiClient } from './api-client';
3
3
  export declare class Pages {
4
4
  private readonly api;
@@ -155,4 +155,17 @@ export declare class Pages {
155
155
  * @throws {TimeoutException} When the request times out
156
156
  */
157
157
  bulkUpdateFolders(updates: BulkUpdateFolderItem[]): Promise<BulkUpdateFolderResponse>;
158
+ /**
159
+ * Bulk delete multiple pages
160
+ * @param pageIds - Array of page IDs to delete
161
+ * @returns Object containing:
162
+ * - deleted: Array of successfully deleted page IDs
163
+ * - errors: Array of errors for failed deletions
164
+ * @throws {UnauthorizedException} When the API key is invalid or expired
165
+ * @throws {ForbiddenException} When the site is not accessible
166
+ * @throws {BadRequestException} When all pages fail to delete
167
+ * @throws {ServerException} When the server encounters an error
168
+ * @throws {TimeoutException} When the request times out
169
+ */
170
+ bulkDeletePages(pageIds: number[]): Promise<BulkDeleteResponseDto>;
158
171
  }
@@ -125,3 +125,15 @@ export interface BulkUpdateFolderResponse {
125
125
  updated: PageFolder[];
126
126
  errors: BulkUpdateFolderError[];
127
127
  }
128
+ export interface BulkDeletePagesDto {
129
+ pageIds: number[];
130
+ }
131
+ export interface BulkDeleteError {
132
+ pageId: number;
133
+ code: number;
134
+ message: string;
135
+ }
136
+ export interface BulkDeleteResponseDto {
137
+ deleted: number[];
138
+ errors: BulkDeleteError[];
139
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flexbe/sdk",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "TypeScript SDK for Flexbe API",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",