@flexbe/sdk 0.2.24 → 0.2.25
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.
- package/dist/browser/client/pages.js +0 -91
- package/dist/browser/client/site-api.js +2 -0
- package/dist/browser/client/stat.js +28 -0
- package/dist/browser/index.js +1 -0
- package/dist/browser/types/stat.js +1 -0
- package/dist/cjs/client/pages.js +0 -81
- package/dist/cjs/client/site-api.js +2 -0
- package/dist/cjs/client/stat.js +19 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/types/stat.js +2 -0
- package/dist/esm/client/pages.js +0 -81
- package/dist/esm/client/site-api.js +2 -0
- package/dist/esm/client/stat.js +15 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/types/stat.js +1 -0
- package/dist/types/client/pages.d.ts +1 -68
- package/dist/types/client/site-api.d.ts +2 -0
- package/dist/types/client/stat.d.ts +9 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/types/pages.d.ts +0 -20
- package/dist/types/types/stat.d.ts +12 -0
- package/package.json +1 -1
|
@@ -272,95 +272,4 @@ 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
|
-
}
|
|
366
275
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
export class Stat {
|
|
11
|
+
constructor(api, siteId) {
|
|
12
|
+
this.api = api;
|
|
13
|
+
this.siteId = siteId;
|
|
14
|
+
}
|
|
15
|
+
getAbTest(testId) {
|
|
16
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
const response = yield this.api.get(`/sites/${this.siteId}/stat-abtests/${testId}`);
|
|
18
|
+
return response.data;
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
createAbTest(pageId) {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
const request = { pageId };
|
|
24
|
+
const response = yield this.api.post(`/sites/${this.siteId}/stat-abtests`, request);
|
|
25
|
+
return response.data;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
package/dist/browser/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/cjs/client/pages.js
CHANGED
|
@@ -242,86 +242,5 @@ 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
|
-
}
|
|
326
245
|
}
|
|
327
246
|
exports.Pages = Pages;
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SiteApi = void 0;
|
|
4
4
|
const pages_1 = require("./pages");
|
|
5
|
+
const stat_1 = require("./stat");
|
|
5
6
|
class SiteApi {
|
|
6
7
|
constructor(api, siteId) {
|
|
7
8
|
this.pages = new pages_1.Pages(api, siteId);
|
|
9
|
+
this.stat = new stat_1.Stat(api, siteId);
|
|
8
10
|
}
|
|
9
11
|
}
|
|
10
12
|
exports.SiteApi = SiteApi;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Stat = void 0;
|
|
4
|
+
class Stat {
|
|
5
|
+
constructor(api, siteId) {
|
|
6
|
+
this.api = api;
|
|
7
|
+
this.siteId = siteId;
|
|
8
|
+
}
|
|
9
|
+
async getAbTest(testId) {
|
|
10
|
+
const response = await this.api.get(`/sites/${this.siteId}/stat-abtests/${testId}`);
|
|
11
|
+
return response.data;
|
|
12
|
+
}
|
|
13
|
+
async createAbTest(pageId) {
|
|
14
|
+
const request = { pageId };
|
|
15
|
+
const response = await this.api.post(`/sites/${this.siteId}/stat-abtests`, request);
|
|
16
|
+
return response.data;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.Stat = Stat;
|
package/dist/cjs/index.js
CHANGED
package/dist/esm/client/pages.js
CHANGED
|
@@ -239,85 +239,4 @@ 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
|
-
}
|
|
323
242
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export class Stat {
|
|
2
|
+
constructor(api, siteId) {
|
|
3
|
+
this.api = api;
|
|
4
|
+
this.siteId = siteId;
|
|
5
|
+
}
|
|
6
|
+
async getAbTest(testId) {
|
|
7
|
+
const response = await this.api.get(`/sites/${this.siteId}/stat-abtests/${testId}`);
|
|
8
|
+
return response.data;
|
|
9
|
+
}
|
|
10
|
+
async createAbTest(pageId) {
|
|
11
|
+
const request = { pageId };
|
|
12
|
+
const response = await this.api.post(`/sites/${this.siteId}/stat-abtests`, request);
|
|
13
|
+
return response.data;
|
|
14
|
+
}
|
|
15
|
+
}
|
package/dist/esm/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Page, GetPagesParams, PageListResponse, PageFolder, PageFolderListResponse, UpdateFolderParams, CreateFolderParams, UpdatePageParams, BulkUpdatePageItem, BulkUpdateResponse, BulkUpdateFolderItem, BulkUpdateFolderResponse, BulkDeleteResponse, PageContent, UpdatePageContentParams
|
|
1
|
+
import { Page, GetPagesParams, PageListResponse, PageFolder, PageFolderListResponse, UpdateFolderParams, CreateFolderParams, UpdatePageParams, BulkUpdatePageItem, BulkUpdateResponse, BulkUpdateFolderItem, BulkUpdateFolderResponse, BulkDeleteResponse, PageContent, UpdatePageContentParams } from '../types/pages';
|
|
2
2
|
import { ApiClient } from './api-client';
|
|
3
3
|
export declare class Pages {
|
|
4
4
|
private readonly api;
|
|
@@ -193,71 +193,4 @@ 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>;
|
|
263
196
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ApiClient } from './api-client';
|
|
2
|
+
import { AbTest } from '../types/stat';
|
|
3
|
+
export declare class Stat {
|
|
4
|
+
private readonly api;
|
|
5
|
+
private readonly siteId;
|
|
6
|
+
constructor(api: ApiClient, siteId: number);
|
|
7
|
+
getAbTest(testId: number): Promise<AbTest>;
|
|
8
|
+
createAbTest(pageId: number): Promise<AbTest>;
|
|
9
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -292,24 +292,4 @@ 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
|
-
}
|
|
315
295
|
export {};
|