@flexbe/sdk 0.2.5 → 0.2.6
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.
|
@@ -170,4 +170,51 @@ export class Pages {
|
|
|
170
170
|
return response.data;
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
|
+
/**
|
|
174
|
+
* Bulk update multiple pages
|
|
175
|
+
* @param updates - Array of page updates, each containing:
|
|
176
|
+
* - pageId: ID of the page to update
|
|
177
|
+
* - status: New status for the page
|
|
178
|
+
* - name: New name for the page
|
|
179
|
+
* - uri: New URI for the page
|
|
180
|
+
* - language: New language for the page
|
|
181
|
+
* - folderId: New folder ID for the page
|
|
182
|
+
* - sortIndex: New position in the page list
|
|
183
|
+
* - meta: Meta information for the page
|
|
184
|
+
* @returns Object containing:
|
|
185
|
+
* - updated: Array of successfully updated pages
|
|
186
|
+
* - errors: Array of errors for failed updates
|
|
187
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
188
|
+
* @throws {ForbiddenException} When the site is not accessible
|
|
189
|
+
* @throws {BadRequestException} When all pages fail to update
|
|
190
|
+
* @throws {ServerException} When the server encounters an error
|
|
191
|
+
* @throws {TimeoutException} When the request times out
|
|
192
|
+
*/
|
|
193
|
+
bulkUpdatePages(updates) {
|
|
194
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
195
|
+
const response = yield this.api.patch(`/sites/${this.siteId}/pages`, updates);
|
|
196
|
+
return response.data;
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Bulk update multiple folders
|
|
201
|
+
* @param updates - Array of folder updates, each containing:
|
|
202
|
+
* - folderId: ID of the folder to update
|
|
203
|
+
* - title: New title for the folder
|
|
204
|
+
* - sortIndex: New position in the folder list
|
|
205
|
+
* @returns Object containing:
|
|
206
|
+
* - updated: Array of successfully updated folders
|
|
207
|
+
* - errors: Array of errors for failed updates
|
|
208
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
209
|
+
* @throws {ForbiddenException} When the site is not accessible
|
|
210
|
+
* @throws {BadRequestException} When all folders fail to update
|
|
211
|
+
* @throws {ServerException} When the server encounters an error
|
|
212
|
+
* @throws {TimeoutException} When the request times out
|
|
213
|
+
*/
|
|
214
|
+
bulkUpdateFolders(updates) {
|
|
215
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
216
|
+
const response = yield this.api.patch(`/sites/${this.siteId}/pages-folders`, updates);
|
|
217
|
+
return response.data;
|
|
218
|
+
});
|
|
219
|
+
}
|
|
173
220
|
}
|
package/dist/cjs/client/pages.js
CHANGED
|
@@ -150,5 +150,48 @@ class Pages {
|
|
|
150
150
|
const response = await this.api.put(`/sites/${this.siteId}/pages/${pageId}`, data);
|
|
151
151
|
return response.data;
|
|
152
152
|
}
|
|
153
|
+
/**
|
|
154
|
+
* Bulk update multiple pages
|
|
155
|
+
* @param updates - Array of page updates, each containing:
|
|
156
|
+
* - pageId: ID of the page to update
|
|
157
|
+
* - status: New status for the page
|
|
158
|
+
* - name: New name for the page
|
|
159
|
+
* - uri: New URI for the page
|
|
160
|
+
* - language: New language for the page
|
|
161
|
+
* - folderId: New folder ID for the page
|
|
162
|
+
* - sortIndex: New position in the page list
|
|
163
|
+
* - meta: Meta information for the page
|
|
164
|
+
* @returns Object containing:
|
|
165
|
+
* - updated: Array of successfully updated pages
|
|
166
|
+
* - errors: Array of errors for failed updates
|
|
167
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
168
|
+
* @throws {ForbiddenException} When the site is not accessible
|
|
169
|
+
* @throws {BadRequestException} When all pages fail to update
|
|
170
|
+
* @throws {ServerException} When the server encounters an error
|
|
171
|
+
* @throws {TimeoutException} When the request times out
|
|
172
|
+
*/
|
|
173
|
+
async bulkUpdatePages(updates) {
|
|
174
|
+
const response = await this.api.patch(`/sites/${this.siteId}/pages`, updates);
|
|
175
|
+
return response.data;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Bulk update multiple folders
|
|
179
|
+
* @param updates - Array of folder updates, each containing:
|
|
180
|
+
* - folderId: ID of the folder to update
|
|
181
|
+
* - title: New title for the folder
|
|
182
|
+
* - sortIndex: New position in the folder list
|
|
183
|
+
* @returns Object containing:
|
|
184
|
+
* - updated: Array of successfully updated folders
|
|
185
|
+
* - errors: Array of errors for failed updates
|
|
186
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
187
|
+
* @throws {ForbiddenException} When the site is not accessible
|
|
188
|
+
* @throws {BadRequestException} When all folders fail to update
|
|
189
|
+
* @throws {ServerException} When the server encounters an error
|
|
190
|
+
* @throws {TimeoutException} When the request times out
|
|
191
|
+
*/
|
|
192
|
+
async bulkUpdateFolders(updates) {
|
|
193
|
+
const response = await this.api.patch(`/sites/${this.siteId}/pages-folders`, updates);
|
|
194
|
+
return response.data;
|
|
195
|
+
}
|
|
153
196
|
}
|
|
154
197
|
exports.Pages = Pages;
|
package/dist/esm/client/pages.js
CHANGED
|
@@ -147,4 +147,47 @@ export class Pages {
|
|
|
147
147
|
const response = await this.api.put(`/sites/${this.siteId}/pages/${pageId}`, data);
|
|
148
148
|
return response.data;
|
|
149
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* Bulk update multiple pages
|
|
152
|
+
* @param updates - Array of page updates, each containing:
|
|
153
|
+
* - pageId: ID of the page to update
|
|
154
|
+
* - status: New status for the page
|
|
155
|
+
* - name: New name for the page
|
|
156
|
+
* - uri: New URI for the page
|
|
157
|
+
* - language: New language for the page
|
|
158
|
+
* - folderId: New folder ID for the page
|
|
159
|
+
* - sortIndex: New position in the page list
|
|
160
|
+
* - meta: Meta information for the page
|
|
161
|
+
* @returns Object containing:
|
|
162
|
+
* - updated: Array of successfully updated pages
|
|
163
|
+
* - errors: Array of errors for failed updates
|
|
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 update
|
|
167
|
+
* @throws {ServerException} When the server encounters an error
|
|
168
|
+
* @throws {TimeoutException} When the request times out
|
|
169
|
+
*/
|
|
170
|
+
async bulkUpdatePages(updates) {
|
|
171
|
+
const response = await this.api.patch(`/sites/${this.siteId}/pages`, updates);
|
|
172
|
+
return response.data;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Bulk update multiple folders
|
|
176
|
+
* @param updates - Array of folder updates, each containing:
|
|
177
|
+
* - folderId: ID of the folder to update
|
|
178
|
+
* - title: New title for the folder
|
|
179
|
+
* - sortIndex: New position in the folder list
|
|
180
|
+
* @returns Object containing:
|
|
181
|
+
* - updated: Array of successfully updated folders
|
|
182
|
+
* - errors: Array of errors for failed updates
|
|
183
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
184
|
+
* @throws {ForbiddenException} When the site is not accessible
|
|
185
|
+
* @throws {BadRequestException} When all folders fail to update
|
|
186
|
+
* @throws {ServerException} When the server encounters an error
|
|
187
|
+
* @throws {TimeoutException} When the request times out
|
|
188
|
+
*/
|
|
189
|
+
async bulkUpdateFolders(updates) {
|
|
190
|
+
const response = await this.api.patch(`/sites/${this.siteId}/pages-folders`, updates);
|
|
191
|
+
return response.data;
|
|
192
|
+
}
|
|
150
193
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Page, GetPagesParams, PageListResponse, PageFolder, PageFolderListResponse, UpdateFolderParams, CreateFolderParams, UpdatePageParams } from '../types/pages';
|
|
1
|
+
import { Page, GetPagesParams, PageListResponse, PageFolder, PageFolderListResponse, UpdateFolderParams, CreateFolderParams, UpdatePageParams, BulkUpdatePageItem, BulkUpdateResponse, BulkUpdateFolderItem, BulkUpdateFolderResponse } from '../types/pages';
|
|
2
2
|
import { ApiClient } from './api-client';
|
|
3
3
|
export declare class Pages {
|
|
4
4
|
private readonly api;
|
|
@@ -118,4 +118,41 @@ export declare class Pages {
|
|
|
118
118
|
* @throws {TimeoutException} When the request times out
|
|
119
119
|
*/
|
|
120
120
|
updatePage(pageId: number, data: UpdatePageParams): Promise<Page>;
|
|
121
|
+
/**
|
|
122
|
+
* Bulk update multiple pages
|
|
123
|
+
* @param updates - Array of page updates, each containing:
|
|
124
|
+
* - pageId: ID of the page to update
|
|
125
|
+
* - status: New status for the page
|
|
126
|
+
* - name: New name for the page
|
|
127
|
+
* - uri: New URI for the page
|
|
128
|
+
* - language: New language for the page
|
|
129
|
+
* - folderId: New folder ID for the page
|
|
130
|
+
* - sortIndex: New position in the page list
|
|
131
|
+
* - meta: Meta information for the page
|
|
132
|
+
* @returns Object containing:
|
|
133
|
+
* - updated: Array of successfully updated pages
|
|
134
|
+
* - errors: Array of errors for failed updates
|
|
135
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
136
|
+
* @throws {ForbiddenException} When the site is not accessible
|
|
137
|
+
* @throws {BadRequestException} When all pages fail to update
|
|
138
|
+
* @throws {ServerException} When the server encounters an error
|
|
139
|
+
* @throws {TimeoutException} When the request times out
|
|
140
|
+
*/
|
|
141
|
+
bulkUpdatePages(updates: BulkUpdatePageItem[]): Promise<BulkUpdateResponse>;
|
|
142
|
+
/**
|
|
143
|
+
* Bulk update multiple folders
|
|
144
|
+
* @param updates - Array of folder updates, each containing:
|
|
145
|
+
* - folderId: ID of the folder to update
|
|
146
|
+
* - title: New title for the folder
|
|
147
|
+
* - sortIndex: New position in the folder list
|
|
148
|
+
* @returns Object containing:
|
|
149
|
+
* - updated: Array of successfully updated folders
|
|
150
|
+
* - errors: Array of errors for failed updates
|
|
151
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
152
|
+
* @throws {ForbiddenException} When the site is not accessible
|
|
153
|
+
* @throws {BadRequestException} When all folders fail to update
|
|
154
|
+
* @throws {ServerException} When the server encounters an error
|
|
155
|
+
* @throws {TimeoutException} When the request times out
|
|
156
|
+
*/
|
|
157
|
+
bulkUpdateFolders(updates: BulkUpdateFolderItem[]): Promise<BulkUpdateFolderResponse>;
|
|
121
158
|
}
|
|
@@ -101,3 +101,27 @@ export interface UpdatePageParams {
|
|
|
101
101
|
noindex?: boolean;
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
|
+
export interface BulkUpdatePageItem extends UpdatePageParams {
|
|
105
|
+
pageId: number;
|
|
106
|
+
}
|
|
107
|
+
export interface BulkUpdateError {
|
|
108
|
+
pageId: number;
|
|
109
|
+
code: number;
|
|
110
|
+
message: string;
|
|
111
|
+
}
|
|
112
|
+
export interface BulkUpdateResponse {
|
|
113
|
+
updated: Page[];
|
|
114
|
+
errors: BulkUpdateError[];
|
|
115
|
+
}
|
|
116
|
+
export interface BulkUpdateFolderItem extends UpdateFolderParams {
|
|
117
|
+
folderId: number;
|
|
118
|
+
}
|
|
119
|
+
export interface BulkUpdateFolderError {
|
|
120
|
+
folderId: number;
|
|
121
|
+
code: number;
|
|
122
|
+
message: string;
|
|
123
|
+
}
|
|
124
|
+
export interface BulkUpdateFolderResponse {
|
|
125
|
+
updated: PageFolder[];
|
|
126
|
+
errors: BulkUpdateFolderError[];
|
|
127
|
+
}
|