@flexbe/sdk 0.2.8 → 0.2.10

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.
@@ -64,6 +64,14 @@ export class ApiClient {
64
64
  };
65
65
  }
66
66
  }
67
+ // Handle 204 No Content response
68
+ if (response.status === 204) {
69
+ return {
70
+ data: null,
71
+ status: response.status,
72
+ statusText: response.statusText,
73
+ };
74
+ }
67
75
  const data = yield response.json();
68
76
  return {
69
77
  data,
@@ -69,15 +69,15 @@ export class Pages {
69
69
  * @throws {ServerException} When the server encounters an error
70
70
  * @throws {TimeoutException} When the request times out
71
71
  */
72
- getFolder(folderId) {
72
+ getFolder(id) {
73
73
  return __awaiter(this, void 0, void 0, function* () {
74
- const response = yield this.api.get(`/sites/${this.siteId}/pages-folders/${folderId}`);
74
+ const response = yield this.api.get(`/sites/${this.siteId}/pages-folders/${id}`);
75
75
  return response.data;
76
76
  });
77
77
  }
78
78
  /**
79
79
  * Update a folder's properties
80
- * @param folderId - ID of the folder to update
80
+ * @param id - ID of the folder to update
81
81
  * @param data - Update parameters:
82
82
  * - title: New title for the folder
83
83
  * - sortIndex: New position in the folder list
@@ -88,9 +88,9 @@ export class Pages {
88
88
  * @throws {ServerException} When the server encounters an error
89
89
  * @throws {TimeoutException} When the request times out
90
90
  */
91
- updateFolder(folderId, data) {
91
+ updateFolder(id, data) {
92
92
  return __awaiter(this, void 0, void 0, function* () {
93
- const response = yield this.api.patch(`/sites/${this.siteId}/pages-folders/${folderId}`, data);
93
+ const response = yield this.api.patch(`/sites/${this.siteId}/pages-folders/${id}`, data);
94
94
  return response.data;
95
95
  });
96
96
  }
@@ -119,9 +119,9 @@ export class Pages {
119
119
  * @throws {ServerException} When the server encounters an error
120
120
  * @throws {TimeoutException} When the request times out
121
121
  */
122
- deleteFolder(folderId) {
122
+ deleteFolder(id) {
123
123
  return __awaiter(this, void 0, void 0, function* () {
124
- yield this.api.delete(`/sites/${this.siteId}/pages-folders/${folderId}`);
124
+ yield this.api.delete(`/sites/${this.siteId}/pages-folders/${id}`);
125
125
  });
126
126
  }
127
127
  /**
@@ -219,7 +219,7 @@ export class Pages {
219
219
  }
220
220
  /**
221
221
  * Bulk delete multiple pages
222
- * @param pageIds - Array of page IDs to delete
222
+ * @param ids - Array of page IDs to delete
223
223
  * @returns Object containing:
224
224
  * - deleted: Array of successfully deleted page IDs
225
225
  * - errors: Array of errors for failed deletions
@@ -229,10 +229,10 @@ export class Pages {
229
229
  * @throws {ServerException} When the server encounters an error
230
230
  * @throws {TimeoutException} When the request times out
231
231
  */
232
- bulkDeletePages(pageIds) {
232
+ bulkDeletePages(ids) {
233
233
  return __awaiter(this, void 0, void 0, function* () {
234
234
  const response = yield this.api.delete(`/sites/${this.siteId}/pages`, {
235
- body: JSON.stringify({ pageIds })
235
+ body: JSON.stringify({ ids })
236
236
  });
237
237
  return response.data;
238
238
  });
@@ -64,6 +64,14 @@ class ApiClient {
64
64
  };
65
65
  }
66
66
  }
67
+ // Handle 204 No Content response
68
+ if (response.status === 204) {
69
+ return {
70
+ data: null,
71
+ status: response.status,
72
+ statusText: response.statusText,
73
+ };
74
+ }
67
75
  const data = await response.json();
68
76
  return {
69
77
  data,
@@ -61,13 +61,13 @@ class Pages {
61
61
  * @throws {ServerException} When the server encounters an error
62
62
  * @throws {TimeoutException} When the request times out
63
63
  */
64
- async getFolder(folderId) {
65
- const response = await this.api.get(`/sites/${this.siteId}/pages-folders/${folderId}`);
64
+ async getFolder(id) {
65
+ const response = await this.api.get(`/sites/${this.siteId}/pages-folders/${id}`);
66
66
  return response.data;
67
67
  }
68
68
  /**
69
69
  * Update a folder's properties
70
- * @param folderId - ID of the folder to update
70
+ * @param id - ID of the folder to update
71
71
  * @param data - Update parameters:
72
72
  * - title: New title for the folder
73
73
  * - sortIndex: New position in the folder list
@@ -78,8 +78,8 @@ class Pages {
78
78
  * @throws {ServerException} When the server encounters an error
79
79
  * @throws {TimeoutException} When the request times out
80
80
  */
81
- async updateFolder(folderId, data) {
82
- const response = await this.api.patch(`/sites/${this.siteId}/pages-folders/${folderId}`, data);
81
+ async updateFolder(id, data) {
82
+ const response = await this.api.patch(`/sites/${this.siteId}/pages-folders/${id}`, data);
83
83
  return response.data;
84
84
  }
85
85
  /**
@@ -105,8 +105,8 @@ class Pages {
105
105
  * @throws {ServerException} When the server encounters an error
106
106
  * @throws {TimeoutException} When the request times out
107
107
  */
108
- async deleteFolder(folderId) {
109
- await this.api.delete(`/sites/${this.siteId}/pages-folders/${folderId}`);
108
+ async deleteFolder(id) {
109
+ await this.api.delete(`/sites/${this.siteId}/pages-folders/${id}`);
110
110
  }
111
111
  /**
112
112
  * Delete a page
@@ -195,7 +195,7 @@ class Pages {
195
195
  }
196
196
  /**
197
197
  * Bulk delete multiple pages
198
- * @param pageIds - Array of page IDs to delete
198
+ * @param ids - Array of page IDs to delete
199
199
  * @returns Object containing:
200
200
  * - deleted: Array of successfully deleted page IDs
201
201
  * - errors: Array of errors for failed deletions
@@ -205,9 +205,9 @@ class Pages {
205
205
  * @throws {ServerException} When the server encounters an error
206
206
  * @throws {TimeoutException} When the request times out
207
207
  */
208
- async bulkDeletePages(pageIds) {
208
+ async bulkDeletePages(ids) {
209
209
  const response = await this.api.delete(`/sites/${this.siteId}/pages`, {
210
- body: JSON.stringify({ pageIds })
210
+ body: JSON.stringify({ ids })
211
211
  });
212
212
  return response.data;
213
213
  }
@@ -61,6 +61,14 @@ export class ApiClient {
61
61
  };
62
62
  }
63
63
  }
64
+ // Handle 204 No Content response
65
+ if (response.status === 204) {
66
+ return {
67
+ data: null,
68
+ status: response.status,
69
+ statusText: response.statusText,
70
+ };
71
+ }
64
72
  const data = await response.json();
65
73
  return {
66
74
  data,
@@ -58,13 +58,13 @@ export class Pages {
58
58
  * @throws {ServerException} When the server encounters an error
59
59
  * @throws {TimeoutException} When the request times out
60
60
  */
61
- async getFolder(folderId) {
62
- const response = await this.api.get(`/sites/${this.siteId}/pages-folders/${folderId}`);
61
+ async getFolder(id) {
62
+ const response = await this.api.get(`/sites/${this.siteId}/pages-folders/${id}`);
63
63
  return response.data;
64
64
  }
65
65
  /**
66
66
  * Update a folder's properties
67
- * @param folderId - ID of the folder to update
67
+ * @param id - ID of the folder to update
68
68
  * @param data - Update parameters:
69
69
  * - title: New title for the folder
70
70
  * - sortIndex: New position in the folder list
@@ -75,8 +75,8 @@ export class Pages {
75
75
  * @throws {ServerException} When the server encounters an error
76
76
  * @throws {TimeoutException} When the request times out
77
77
  */
78
- async updateFolder(folderId, data) {
79
- const response = await this.api.patch(`/sites/${this.siteId}/pages-folders/${folderId}`, data);
78
+ async updateFolder(id, data) {
79
+ const response = await this.api.patch(`/sites/${this.siteId}/pages-folders/${id}`, data);
80
80
  return response.data;
81
81
  }
82
82
  /**
@@ -102,8 +102,8 @@ export class Pages {
102
102
  * @throws {ServerException} When the server encounters an error
103
103
  * @throws {TimeoutException} When the request times out
104
104
  */
105
- async deleteFolder(folderId) {
106
- await this.api.delete(`/sites/${this.siteId}/pages-folders/${folderId}`);
105
+ async deleteFolder(id) {
106
+ await this.api.delete(`/sites/${this.siteId}/pages-folders/${id}`);
107
107
  }
108
108
  /**
109
109
  * Delete a page
@@ -192,7 +192,7 @@ export class Pages {
192
192
  }
193
193
  /**
194
194
  * Bulk delete multiple pages
195
- * @param pageIds - Array of page IDs to delete
195
+ * @param ids - Array of page IDs to delete
196
196
  * @returns Object containing:
197
197
  * - deleted: Array of successfully deleted page IDs
198
198
  * - errors: Array of errors for failed deletions
@@ -202,9 +202,9 @@ export class Pages {
202
202
  * @throws {ServerException} When the server encounters an error
203
203
  * @throws {TimeoutException} When the request times out
204
204
  */
205
- async bulkDeletePages(pageIds) {
205
+ async bulkDeletePages(ids) {
206
206
  const response = await this.api.delete(`/sites/${this.siteId}/pages`, {
207
- body: JSON.stringify({ pageIds })
207
+ body: JSON.stringify({ ids })
208
208
  });
209
209
  return response.data;
210
210
  }
@@ -45,10 +45,10 @@ export declare class Pages {
45
45
  * @throws {ServerException} When the server encounters an error
46
46
  * @throws {TimeoutException} When the request times out
47
47
  */
48
- getFolder(folderId: number): Promise<PageFolder>;
48
+ getFolder(id: number): Promise<PageFolder>;
49
49
  /**
50
50
  * Update a folder's properties
51
- * @param folderId - ID of the folder to update
51
+ * @param id - ID of the folder to update
52
52
  * @param data - Update parameters:
53
53
  * - title: New title for the folder
54
54
  * - sortIndex: New position in the folder list
@@ -59,7 +59,7 @@ export declare class Pages {
59
59
  * @throws {ServerException} When the server encounters an error
60
60
  * @throws {TimeoutException} When the request times out
61
61
  */
62
- updateFolder(folderId: number, data: UpdateFolderParams): Promise<PageFolder>;
62
+ updateFolder(id: number, data: UpdateFolderParams): Promise<PageFolder>;
63
63
  /**
64
64
  * Create a new folder
65
65
  * @param data - Create parameters:
@@ -80,7 +80,7 @@ export declare class Pages {
80
80
  * @throws {ServerException} When the server encounters an error
81
81
  * @throws {TimeoutException} When the request times out
82
82
  */
83
- deleteFolder(folderId: number): Promise<void>;
83
+ deleteFolder(id: number): Promise<void>;
84
84
  /**
85
85
  * Delete a page
86
86
  * @param pageId - ID of the page to delete
@@ -157,7 +157,7 @@ export declare class Pages {
157
157
  bulkUpdateFolders(updates: BulkUpdateFolderItem[]): Promise<BulkUpdateFolderResponse>;
158
158
  /**
159
159
  * Bulk delete multiple pages
160
- * @param pageIds - Array of page IDs to delete
160
+ * @param ids - Array of page IDs to delete
161
161
  * @returns Object containing:
162
162
  * - deleted: Array of successfully deleted page IDs
163
163
  * - errors: Array of errors for failed deletions
@@ -167,5 +167,5 @@ export declare class Pages {
167
167
  * @throws {ServerException} When the server encounters an error
168
168
  * @throws {TimeoutException} When the request times out
169
169
  */
170
- bulkDeletePages(pageIds: number[]): Promise<BulkDeleteResponseDto>;
170
+ bulkDeletePages(ids: number[]): Promise<BulkDeleteResponseDto>;
171
171
  }
@@ -103,10 +103,10 @@ export interface UpdatePageParams {
103
103
  };
104
104
  }
105
105
  export interface BulkUpdatePageItem extends UpdatePageParams {
106
- pageId: number;
106
+ id: number;
107
107
  }
108
108
  export interface BulkUpdateError {
109
- pageId: number;
109
+ id: number;
110
110
  code: number;
111
111
  message: string;
112
112
  }
@@ -115,10 +115,10 @@ export interface BulkUpdateResponse {
115
115
  errors: BulkUpdateError[];
116
116
  }
117
117
  export interface BulkUpdateFolderItem extends UpdateFolderParams {
118
- folderId: number;
118
+ id: number;
119
119
  }
120
120
  export interface BulkUpdateFolderError {
121
- folderId: number;
121
+ id: number;
122
122
  code: number;
123
123
  message: string;
124
124
  }
@@ -130,7 +130,7 @@ export interface BulkDeletePagesDto {
130
130
  pageIds: number[];
131
131
  }
132
132
  export interface BulkDeleteError {
133
- pageId: number;
133
+ id: number;
134
134
  code: number;
135
135
  message: string;
136
136
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flexbe/sdk",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "description": "TypeScript SDK for Flexbe API",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",