@flexbe/sdk 0.2.24 → 0.2.26

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.
@@ -273,94 +273,36 @@ export class Pages {
273
273
  });
274
274
  }
275
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
276
+ * Get list of page versions
277
+ * @param pageId - ID of the page to get versions for
278
+ * @returns List of page versions
279
279
  * @throws {UnauthorizedException} When the API key is invalid or expired
280
280
  * @throws {NotFoundException} When the page is not found
281
281
  * @throws {ForbiddenException} When the page does not belong to the site
282
282
  * @throws {ServerException} When the server encounters an error
283
283
  * @throws {TimeoutException} When the request times out
284
284
  */
285
- getAbTests(pageId) {
285
+ getPageVersions(pageId) {
286
286
  return __awaiter(this, void 0, void 0, function* () {
287
- const response = yield this.api.get(`/sites/${this.siteId}/pages/${pageId}/abtests`);
287
+ const response = yield this.api.get(`/sites/${this.siteId}/pages/${pageId}/versions`);
288
288
  return response.data;
289
289
  });
290
290
  }
291
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
292
+ * Get a specific page version
293
+ * @param pageId - ID of the page
294
+ * @param versionId - ID of the version to get
295
+ * @returns The requested page version with data
296
296
  * @throws {UnauthorizedException} When the API key is invalid or expired
297
- * @throws {NotFoundException} When the page or AB test is not found
297
+ * @throws {NotFoundException} When the page or version is not found
298
298
  * @throws {ForbiddenException} When the page does not belong to the site
299
299
  * @throws {ServerException} When the server encounters an error
300
300
  * @throws {TimeoutException} When the request times out
301
301
  */
302
- getAbTest(pageId, testId) {
302
+ getPageVersion(pageId, versionId) {
303
303
  return __awaiter(this, void 0, void 0, function* () {
304
- const response = yield this.api.get(`/sites/${this.siteId}/pages/${pageId}/abtests/${testId}`);
304
+ const response = yield this.api.get(`/sites/${this.siteId}/pages/${pageId}/versions/${versionId}`);
305
305
  return response.data;
306
306
  });
307
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
308
  }
@@ -1,6 +1,8 @@
1
1
  import { Pages } from './pages';
2
+ import { Stat } from './stat';
2
3
  export class SiteApi {
3
4
  constructor(api, siteId) {
4
5
  this.pages = new Pages(api, siteId);
6
+ this.stat = new Stat(api, siteId);
5
7
  }
6
8
  }
@@ -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
+ }
@@ -2,3 +2,4 @@ export * from './client/client';
2
2
  export * from './client/pages';
3
3
  export * from './types';
4
4
  export * from './types/pages';
5
+ export * from './types/stat';
@@ -0,0 +1 @@
1
+ export {};
@@ -243,85 +243,33 @@ class Pages {
243
243
  return response.data;
244
244
  }
245
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
246
+ * Get list of page versions
247
+ * @param pageId - ID of the page to get versions for
248
+ * @returns List of page versions
249
249
  * @throws {UnauthorizedException} When the API key is invalid or expired
250
250
  * @throws {NotFoundException} When the page is not found
251
251
  * @throws {ForbiddenException} When the page does not belong to the site
252
252
  * @throws {ServerException} When the server encounters an error
253
253
  * @throws {TimeoutException} When the request times out
254
254
  */
255
- async getAbTests(pageId) {
256
- const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/abtests`);
255
+ async getPageVersions(pageId) {
256
+ const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/versions`);
257
257
  return response.data;
258
258
  }
259
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
260
+ * Get a specific page version
261
+ * @param pageId - ID of the page
262
+ * @param versionId - ID of the version to get
263
+ * @returns The requested page version with data
264
264
  * @throws {UnauthorizedException} When the API key is invalid or expired
265
- * @throws {NotFoundException} When the page or AB test is not found
265
+ * @throws {NotFoundException} When the page or version is not found
266
266
  * @throws {ForbiddenException} When the page does not belong to the site
267
267
  * @throws {ServerException} When the server encounters an error
268
268
  * @throws {TimeoutException} When the request times out
269
269
  */
270
- async getAbTest(pageId, testId) {
271
- const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/abtests/${testId}`);
270
+ async getPageVersion(pageId, versionId) {
271
+ const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/versions/${versionId}`);
272
272
  return response.data;
273
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
274
  }
327
275
  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
@@ -18,3 +18,4 @@ __exportStar(require("./client/client"), exports);
18
18
  __exportStar(require("./client/pages"), exports);
19
19
  __exportStar(require("./types"), exports);
20
20
  __exportStar(require("./types/pages"), exports);
21
+ __exportStar(require("./types/stat"), exports);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -240,84 +240,32 @@ export class Pages {
240
240
  return response.data;
241
241
  }
242
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
243
+ * Get list of page versions
244
+ * @param pageId - ID of the page to get versions for
245
+ * @returns List of page versions
246
246
  * @throws {UnauthorizedException} When the API key is invalid or expired
247
247
  * @throws {NotFoundException} When the page is not found
248
248
  * @throws {ForbiddenException} When the page does not belong to the site
249
249
  * @throws {ServerException} When the server encounters an error
250
250
  * @throws {TimeoutException} When the request times out
251
251
  */
252
- async getAbTests(pageId) {
253
- const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/abtests`);
252
+ async getPageVersions(pageId) {
253
+ const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/versions`);
254
254
  return response.data;
255
255
  }
256
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
257
+ * Get a specific page version
258
+ * @param pageId - ID of the page
259
+ * @param versionId - ID of the version to get
260
+ * @returns The requested page version with data
261
261
  * @throws {UnauthorizedException} When the API key is invalid or expired
262
- * @throws {NotFoundException} When the page or AB test is not found
262
+ * @throws {NotFoundException} When the page or version is not found
263
263
  * @throws {ForbiddenException} When the page does not belong to the site
264
264
  * @throws {ServerException} When the server encounters an error
265
265
  * @throws {TimeoutException} When the request times out
266
266
  */
267
- async getAbTest(pageId, testId) {
268
- const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/abtests/${testId}`);
267
+ async getPageVersion(pageId, versionId) {
268
+ const response = await this.api.get(`/sites/${this.siteId}/pages/${pageId}/versions/${versionId}`);
269
269
  return response.data;
270
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
271
  }
@@ -1,6 +1,8 @@
1
1
  import { Pages } from './pages';
2
+ import { Stat } from './stat';
2
3
  export class SiteApi {
3
4
  constructor(api, siteId) {
4
5
  this.pages = new Pages(api, siteId);
6
+ this.stat = new Stat(api, siteId);
5
7
  }
6
8
  }
@@ -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
@@ -2,3 +2,4 @@ export * from './client/client';
2
2
  export * from './client/pages';
3
3
  export * from './types';
4
4
  export * from './types/pages';
5
+ export * from './types/stat';
@@ -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, AbTest, CreateAbTestParams, UpdateAbTestParams } from '../types/pages';
1
+ import { Page, GetPagesParams, PageListResponse, PageFolder, PageFolderListResponse, UpdateFolderParams, CreateFolderParams, UpdatePageParams, BulkUpdatePageItem, BulkUpdateResponse, BulkUpdateFolderItem, BulkUpdateFolderResponse, BulkDeleteResponse, PageContent, UpdatePageContentParams, PageVersionListResponse, PageVersionData } from '../types/pages';
2
2
  import { ApiClient } from './api-client';
3
3
  export declare class Pages {
4
4
  private readonly api;
@@ -194,70 +194,26 @@ export declare class Pages {
194
194
  */
195
195
  updatePageContent(pageId: number, content: Partial<UpdatePageContentParams>): Promise<PageContent>;
196
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
197
+ * Get list of page versions
198
+ * @param pageId - ID of the page to get versions for
199
+ * @returns List of page versions
200
200
  * @throws {UnauthorizedException} When the API key is invalid or expired
201
201
  * @throws {NotFoundException} When the page is not found
202
202
  * @throws {ForbiddenException} When the page does not belong to the site
203
203
  * @throws {ServerException} When the server encounters an error
204
204
  * @throws {TimeoutException} When the request times out
205
205
  */
206
- getAbTests(pageId: number): Promise<AbTest[]>;
206
+ getPageVersions(pageId: number): Promise<PageVersionListResponse>;
207
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
208
+ * Get a specific page version
209
+ * @param pageId - ID of the page
210
+ * @param versionId - ID of the version to get
211
+ * @returns The requested page version with data
212
212
  * @throws {UnauthorizedException} When the API key is invalid or expired
213
- * @throws {NotFoundException} When the page or AB test is not found
213
+ * @throws {NotFoundException} When the page or version is not found
214
214
  * @throws {ForbiddenException} When the page does not belong to the site
215
215
  * @throws {ServerException} When the server encounters an error
216
216
  * @throws {TimeoutException} When the request times out
217
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>;
218
+ getPageVersion(pageId: number, versionId: number): Promise<PageVersionData>;
263
219
  }
@@ -1,6 +1,8 @@
1
1
  import { ApiClient } from './api-client';
2
2
  import { Pages } from './pages';
3
+ import { Stat } from './stat';
3
4
  export declare class SiteApi {
4
5
  readonly pages: Pages;
6
+ readonly stat: Stat;
5
7
  constructor(api: ApiClient, siteId: number);
6
8
  }
@@ -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
+ }
@@ -2,3 +2,4 @@ export * from './client/client';
2
2
  export * from './client/pages';
3
3
  export * from './types';
4
4
  export * from './types/pages';
5
+ export * from './types/stat';
@@ -292,24 +292,14 @@ export interface PageContent {
292
292
  };
293
293
  }
294
294
  export type UpdatePageContentParams = Omit<PageContent, 'versionId' | 'versionTime'>;
295
- export interface AbTest {
295
+ export interface PageVersion {
296
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;
297
+ createdAt: string;
298
+ }
299
+ export interface PageVersionListResponse {
300
+ list: PageVersion[];
301
+ }
302
+ export interface PageVersionData extends PageVersion {
303
+ data: Record<string, unknown>;
314
304
  }
315
305
  export {};
@@ -0,0 +1,12 @@
1
+ export interface AbTest {
2
+ id: number;
3
+ pageId: number;
4
+ createdAt: string;
5
+ aCountView: number;
6
+ aCountLead: number;
7
+ bCountView: number;
8
+ bCountLead: number;
9
+ }
10
+ export interface CreateAbTestRequest {
11
+ pageId: number;
12
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flexbe/sdk",
3
- "version": "0.2.24",
3
+ "version": "0.2.26",
4
4
  "description": "TypeScript SDK for Flexbe API",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",