growthbook
Version:
The GrowthBook command-line interface (CLI) for working with the GrowthBook A/B testing, feature flagging, and experimentation platform
22 lines (21 loc) • 752 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SegmentsRepository = void 0;
const base_repository_1 = require("./base.repository");
const api_1 = require("../generated/api");
class SegmentsRepository extends base_repository_1.BaseRepository {
async getSegment(id) {
const api = this.api();
const result = await api.getSegment(id);
return result.data.segment;
}
async listSegments(limit, offset, dataSourceId) {
const api = this.api();
const result = await api.listSegments(limit, offset, dataSourceId);
return result.data;
}
api() {
return new api_1.SegmentsApi(this.apiConfig());
}
}
exports.SegmentsRepository = SegmentsRepository;