@flexbe/sdk 0.2.23 → 0.2.24
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,95 @@ export class Pages {
|
|
|
272
272
|
return response.data;
|
|
273
273
|
});
|
|
274
274
|
}
|
|
275
|
+
/**
|
|
276
|
+
* Get all AB tests for a page
|
|
277
|
+
* @param pageId - ID of the page to get AB tests for
|
|
278
|
+
* @returns Array of AB tests
|
|
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
|
+
getAbTests(pageId) {
|
|
286
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
287
|
+
const response = yield this.api.get(`/sites/${this.siteId}/pages/${pageId}/abtests`);
|
|
288
|
+
return response.data;
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Get a single AB test by ID
|
|
293
|
+
* @param pageId - ID of the page the AB test belongs to
|
|
294
|
+
* @param testId - ID of the AB test to get
|
|
295
|
+
* @returns The requested AB test
|
|
296
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
297
|
+
* @throws {NotFoundException} When the page or AB test 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
|
+
getAbTest(pageId, testId) {
|
|
303
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
304
|
+
const response = yield this.api.get(`/sites/${this.siteId}/pages/${pageId}/abtests/${testId}`);
|
|
305
|
+
return response.data;
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Create a new AB test
|
|
310
|
+
* @param pageId - ID of the page to create the AB test for
|
|
311
|
+
* @param data - Create parameters:
|
|
312
|
+
* - isActive: Whether the test is active (optional, defaults to true)
|
|
313
|
+
* @returns The created AB test
|
|
314
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
315
|
+
* @throws {NotFoundException} When the page is not found
|
|
316
|
+
* @throws {ForbiddenException} When the page does not belong to the site
|
|
317
|
+
* @throws {BadRequestException} When the create parameters are invalid
|
|
318
|
+
* @throws {ServerException} When the server encounters an error
|
|
319
|
+
* @throws {TimeoutException} When the request times out
|
|
320
|
+
*/
|
|
321
|
+
createAbTest(pageId, data) {
|
|
322
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
323
|
+
const response = yield this.api.post(`/sites/${this.siteId}/pages/${pageId}/abtests`, data);
|
|
324
|
+
return response.data;
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Update an AB test
|
|
329
|
+
* @param pageId - ID of the page the AB test belongs to
|
|
330
|
+
* @param testId - ID of the AB test to update
|
|
331
|
+
* @param data - Update parameters:
|
|
332
|
+
* - isActive: Whether the test is active
|
|
333
|
+
* - aCountView: Number of views for variant A
|
|
334
|
+
* - aCountLead: Number of leads for variant A
|
|
335
|
+
* - bCountView: Number of views for variant B
|
|
336
|
+
* - bCountLead: Number of leads for variant B
|
|
337
|
+
* @returns The updated AB test
|
|
338
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
339
|
+
* @throws {NotFoundException} When the page or AB test is not found
|
|
340
|
+
* @throws {ForbiddenException} When the page does not belong to the site
|
|
341
|
+
* @throws {BadRequestException} When the update parameters are invalid
|
|
342
|
+
* @throws {ServerException} When the server encounters an error
|
|
343
|
+
* @throws {TimeoutException} When the request times out
|
|
344
|
+
*/
|
|
345
|
+
updateAbTest(pageId, testId, data) {
|
|
346
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
347
|
+
const response = yield this.api.put(`/sites/${this.siteId}/pages/${pageId}/abtests/${testId}`, data);
|
|
348
|
+
return response.data;
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Delete an AB test
|
|
353
|
+
* @param pageId - ID of the page the AB test belongs to
|
|
354
|
+
* @param testId - ID of the AB test to delete
|
|
355
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
356
|
+
* @throws {NotFoundException} When the page or AB test is not found
|
|
357
|
+
* @throws {ForbiddenException} When the page does not belong to the site
|
|
358
|
+
* @throws {ServerException} When the server encounters an error
|
|
359
|
+
* @throws {TimeoutException} When the request times out
|
|
360
|
+
*/
|
|
361
|
+
deleteAbTest(pageId, testId) {
|
|
362
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
363
|
+
yield this.api.delete(`/sites/${this.siteId}/pages/${pageId}/abtests/${testId}`);
|
|
364
|
+
});
|
|
365
|
+
}
|
|
275
366
|
}
|
package/dist/cjs/client/pages.js
CHANGED
|
@@ -242,5 +242,86 @@ 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 all AB tests for a page
|
|
247
|
+
* @param pageId - ID of the page to get AB tests for
|
|
248
|
+
* @returns Array of AB tests
|
|
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 getAbTests(pageId) {
|
|
256
|
+
const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/abtests`);
|
|
257
|
+
return response.data;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Get a single AB test by ID
|
|
261
|
+
* @param pageId - ID of the page the AB test belongs to
|
|
262
|
+
* @param testId - ID of the AB test to get
|
|
263
|
+
* @returns The requested AB test
|
|
264
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
265
|
+
* @throws {NotFoundException} When the page or AB test 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 getAbTest(pageId, testId) {
|
|
271
|
+
const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/abtests/${testId}`);
|
|
272
|
+
return response.data;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Create a new AB test
|
|
276
|
+
* @param pageId - ID of the page to create the AB test for
|
|
277
|
+
* @param data - Create parameters:
|
|
278
|
+
* - isActive: Whether the test is active (optional, defaults to true)
|
|
279
|
+
* @returns The created AB test
|
|
280
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
281
|
+
* @throws {NotFoundException} When the page is not found
|
|
282
|
+
* @throws {ForbiddenException} When the page does not belong to the site
|
|
283
|
+
* @throws {BadRequestException} When the create parameters are invalid
|
|
284
|
+
* @throws {ServerException} When the server encounters an error
|
|
285
|
+
* @throws {TimeoutException} When the request times out
|
|
286
|
+
*/
|
|
287
|
+
async createAbTest(pageId, data) {
|
|
288
|
+
const response = await this.api.post(`/sites/${this.siteId}/pages/${pageId}/abtests`, data);
|
|
289
|
+
return response.data;
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Update an AB test
|
|
293
|
+
* @param pageId - ID of the page the AB test belongs to
|
|
294
|
+
* @param testId - ID of the AB test to update
|
|
295
|
+
* @param data - Update parameters:
|
|
296
|
+
* - isActive: Whether the test is active
|
|
297
|
+
* - aCountView: Number of views for variant A
|
|
298
|
+
* - aCountLead: Number of leads for variant A
|
|
299
|
+
* - bCountView: Number of views for variant B
|
|
300
|
+
* - bCountLead: Number of leads for variant B
|
|
301
|
+
* @returns The updated AB test
|
|
302
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
303
|
+
* @throws {NotFoundException} When the page or AB test is not found
|
|
304
|
+
* @throws {ForbiddenException} When the page does not belong to the site
|
|
305
|
+
* @throws {BadRequestException} When the update parameters are invalid
|
|
306
|
+
* @throws {ServerException} When the server encounters an error
|
|
307
|
+
* @throws {TimeoutException} When the request times out
|
|
308
|
+
*/
|
|
309
|
+
async updateAbTest(pageId, testId, data) {
|
|
310
|
+
const response = await this.api.put(`/sites/${this.siteId}/pages/${pageId}/abtests/${testId}`, data);
|
|
311
|
+
return response.data;
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Delete an AB test
|
|
315
|
+
* @param pageId - ID of the page the AB test belongs to
|
|
316
|
+
* @param testId - ID of the AB test to delete
|
|
317
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
318
|
+
* @throws {NotFoundException} When the page or AB test is not found
|
|
319
|
+
* @throws {ForbiddenException} When the page does not belong to the site
|
|
320
|
+
* @throws {ServerException} When the server encounters an error
|
|
321
|
+
* @throws {TimeoutException} When the request times out
|
|
322
|
+
*/
|
|
323
|
+
async deleteAbTest(pageId, testId) {
|
|
324
|
+
await this.api.delete(`/sites/${this.siteId}/pages/${pageId}/abtests/${testId}`);
|
|
325
|
+
}
|
|
245
326
|
}
|
|
246
327
|
exports.Pages = Pages;
|
package/dist/esm/client/pages.js
CHANGED
|
@@ -239,4 +239,85 @@ 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 all AB tests for a page
|
|
244
|
+
* @param pageId - ID of the page to get AB tests for
|
|
245
|
+
* @returns Array of AB tests
|
|
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 getAbTests(pageId) {
|
|
253
|
+
const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/abtests`);
|
|
254
|
+
return response.data;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Get a single AB test by ID
|
|
258
|
+
* @param pageId - ID of the page the AB test belongs to
|
|
259
|
+
* @param testId - ID of the AB test to get
|
|
260
|
+
* @returns The requested AB test
|
|
261
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
262
|
+
* @throws {NotFoundException} When the page or AB test 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 getAbTest(pageId, testId) {
|
|
268
|
+
const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/abtests/${testId}`);
|
|
269
|
+
return response.data;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Create a new AB test
|
|
273
|
+
* @param pageId - ID of the page to create the AB test for
|
|
274
|
+
* @param data - Create parameters:
|
|
275
|
+
* - isActive: Whether the test is active (optional, defaults to true)
|
|
276
|
+
* @returns The created AB test
|
|
277
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
278
|
+
* @throws {NotFoundException} When the page is not found
|
|
279
|
+
* @throws {ForbiddenException} When the page does not belong to the site
|
|
280
|
+
* @throws {BadRequestException} When the create parameters are invalid
|
|
281
|
+
* @throws {ServerException} When the server encounters an error
|
|
282
|
+
* @throws {TimeoutException} When the request times out
|
|
283
|
+
*/
|
|
284
|
+
async createAbTest(pageId, data) {
|
|
285
|
+
const response = await this.api.post(`/sites/${this.siteId}/pages/${pageId}/abtests`, data);
|
|
286
|
+
return response.data;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Update an AB test
|
|
290
|
+
* @param pageId - ID of the page the AB test belongs to
|
|
291
|
+
* @param testId - ID of the AB test to update
|
|
292
|
+
* @param data - Update parameters:
|
|
293
|
+
* - isActive: Whether the test is active
|
|
294
|
+
* - aCountView: Number of views for variant A
|
|
295
|
+
* - aCountLead: Number of leads for variant A
|
|
296
|
+
* - bCountView: Number of views for variant B
|
|
297
|
+
* - bCountLead: Number of leads for variant B
|
|
298
|
+
* @returns The updated AB test
|
|
299
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
300
|
+
* @throws {NotFoundException} When the page or AB test is not found
|
|
301
|
+
* @throws {ForbiddenException} When the page does not belong to the site
|
|
302
|
+
* @throws {BadRequestException} When the update parameters are invalid
|
|
303
|
+
* @throws {ServerException} When the server encounters an error
|
|
304
|
+
* @throws {TimeoutException} When the request times out
|
|
305
|
+
*/
|
|
306
|
+
async updateAbTest(pageId, testId, data) {
|
|
307
|
+
const response = await this.api.put(`/sites/${this.siteId}/pages/${pageId}/abtests/${testId}`, data);
|
|
308
|
+
return response.data;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Delete an AB test
|
|
312
|
+
* @param pageId - ID of the page the AB test belongs to
|
|
313
|
+
* @param testId - ID of the AB test to delete
|
|
314
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
315
|
+
* @throws {NotFoundException} When the page or AB test is not found
|
|
316
|
+
* @throws {ForbiddenException} When the page does not belong to the site
|
|
317
|
+
* @throws {ServerException} When the server encounters an error
|
|
318
|
+
* @throws {TimeoutException} When the request times out
|
|
319
|
+
*/
|
|
320
|
+
async deleteAbTest(pageId, testId) {
|
|
321
|
+
await this.api.delete(`/sites/${this.siteId}/pages/${pageId}/abtests/${testId}`);
|
|
322
|
+
}
|
|
242
323
|
}
|
|
@@ -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, AbTest, CreateAbTestParams, UpdateAbTestParams } from '../types/pages';
|
|
2
2
|
import { ApiClient } from './api-client';
|
|
3
3
|
export declare class Pages {
|
|
4
4
|
private readonly api;
|
|
@@ -193,4 +193,71 @@ 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 all AB tests for a page
|
|
198
|
+
* @param pageId - ID of the page to get AB tests for
|
|
199
|
+
* @returns Array of AB tests
|
|
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
|
+
getAbTests(pageId: number): Promise<AbTest[]>;
|
|
207
|
+
/**
|
|
208
|
+
* Get a single AB test by ID
|
|
209
|
+
* @param pageId - ID of the page the AB test belongs to
|
|
210
|
+
* @param testId - ID of the AB test to get
|
|
211
|
+
* @returns The requested AB test
|
|
212
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
213
|
+
* @throws {NotFoundException} When the page or AB test 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
|
+
getAbTest(pageId: number, testId: number): Promise<AbTest>;
|
|
219
|
+
/**
|
|
220
|
+
* Create a new AB test
|
|
221
|
+
* @param pageId - ID of the page to create the AB test for
|
|
222
|
+
* @param data - Create parameters:
|
|
223
|
+
* - isActive: Whether the test is active (optional, defaults to true)
|
|
224
|
+
* @returns The created AB test
|
|
225
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
226
|
+
* @throws {NotFoundException} When the page is not found
|
|
227
|
+
* @throws {ForbiddenException} When the page does not belong to the site
|
|
228
|
+
* @throws {BadRequestException} When the create parameters are invalid
|
|
229
|
+
* @throws {ServerException} When the server encounters an error
|
|
230
|
+
* @throws {TimeoutException} When the request times out
|
|
231
|
+
*/
|
|
232
|
+
createAbTest(pageId: number, data: CreateAbTestParams): Promise<AbTest>;
|
|
233
|
+
/**
|
|
234
|
+
* Update an AB test
|
|
235
|
+
* @param pageId - ID of the page the AB test belongs to
|
|
236
|
+
* @param testId - ID of the AB test to update
|
|
237
|
+
* @param data - Update parameters:
|
|
238
|
+
* - isActive: Whether the test is active
|
|
239
|
+
* - aCountView: Number of views for variant A
|
|
240
|
+
* - aCountLead: Number of leads for variant A
|
|
241
|
+
* - bCountView: Number of views for variant B
|
|
242
|
+
* - bCountLead: Number of leads for variant B
|
|
243
|
+
* @returns The updated AB test
|
|
244
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
245
|
+
* @throws {NotFoundException} When the page or AB test is not found
|
|
246
|
+
* @throws {ForbiddenException} When the page does not belong to the site
|
|
247
|
+
* @throws {BadRequestException} When the update parameters are invalid
|
|
248
|
+
* @throws {ServerException} When the server encounters an error
|
|
249
|
+
* @throws {TimeoutException} When the request times out
|
|
250
|
+
*/
|
|
251
|
+
updateAbTest(pageId: number, testId: number, data: UpdateAbTestParams): Promise<AbTest>;
|
|
252
|
+
/**
|
|
253
|
+
* Delete an AB test
|
|
254
|
+
* @param pageId - ID of the page the AB test belongs to
|
|
255
|
+
* @param testId - ID of the AB test to delete
|
|
256
|
+
* @throws {UnauthorizedException} When the API key is invalid or expired
|
|
257
|
+
* @throws {NotFoundException} When the page or AB test is not found
|
|
258
|
+
* @throws {ForbiddenException} When the page does not belong to the site
|
|
259
|
+
* @throws {ServerException} When the server encounters an error
|
|
260
|
+
* @throws {TimeoutException} When the request times out
|
|
261
|
+
*/
|
|
262
|
+
deleteAbTest(pageId: number, testId: number): Promise<void>;
|
|
196
263
|
}
|
|
@@ -292,4 +292,24 @@ export interface PageContent {
|
|
|
292
292
|
};
|
|
293
293
|
}
|
|
294
294
|
export type UpdatePageContentParams = Omit<PageContent, 'versionId' | 'versionTime'>;
|
|
295
|
+
export interface AbTest {
|
|
296
|
+
id: number;
|
|
297
|
+
a: string;
|
|
298
|
+
b: string;
|
|
299
|
+
isActive: boolean;
|
|
300
|
+
aCountView?: number;
|
|
301
|
+
aCountLead?: number;
|
|
302
|
+
bCountView?: number;
|
|
303
|
+
bCountLead?: number;
|
|
304
|
+
}
|
|
305
|
+
export interface CreateAbTestParams {
|
|
306
|
+
isActive?: boolean;
|
|
307
|
+
}
|
|
308
|
+
export interface UpdateAbTestParams {
|
|
309
|
+
isActive?: boolean;
|
|
310
|
+
aCountView?: number;
|
|
311
|
+
aCountLead?: number;
|
|
312
|
+
bCountView?: number;
|
|
313
|
+
bCountLead?: number;
|
|
314
|
+
}
|
|
295
315
|
export {};
|