growthbook
Version:
The GrowthBook command-line interface (CLI) for working with the GrowthBook A/B testing, feature flagging, and experimentation platform
37 lines (36 loc) • 1.26 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SavedGroupsRepository = void 0;
const base_repository_1 = require("./base.repository");
const api_1 = require("../generated/api");
class SavedGroupsRepository extends base_repository_1.BaseRepository {
async getSavedGroup(id) {
const api = this.api();
const result = await api.getSavedGroup(id);
return result.data.savedGroup;
}
async listSavedGroups(limit, offset) {
const api = this.api();
const result = await api.listSavedGroups(limit, offset);
return result.data;
}
async deleteSavedGroup(id) {
const api = this.api();
const result = await api.deleteSavedGroup(id);
return result.data;
}
async createSavedGroup(payload) {
const api = this.api();
const result = await api.postSavedGroup(payload);
return result.data.savedGroup;
}
async updateSavedGroup(id, payload) {
const api = this.api();
const result = await api.updateSavedGroup(id, payload);
return result.data.savedGroup;
}
api() {
return new api_1.SavedGroupsApi(this.apiConfig());
}
}
exports.SavedGroupsRepository = SavedGroupsRepository;