UNPKG

growthbook

Version:

The GrowthBook command-line interface (CLI) for working with the GrowthBook A/B testing, feature flagging, and experimentation platform

1,026 lines 123 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * GrowthBook REST API * GrowthBook offers a full REST API for interacting with the GrowthBook application. This is currently in **beta** as we add more authenticated API routes and features. Request data can use either JSON or Form data encoding (with proper `Content-Type` headers). All response bodies are JSON-encoded. The API base URL for GrowthBook Cloud is `https://api.growthbook.io`. For self-hosted deployments, it is the same as your API_HOST environment variable (defaults to `http://localhost:3100`). The rest of these docs will assume you are using GrowthBook Cloud. ## Authentication We support both the HTTP Basic and Bearer authentication schemes for convenience. You first need to generate a new Secret Key in GrowthBook by going to `Settings -> API Keys`. If using HTTP Basic auth, pass the Secret Key as the username and leave the password blank: ```bash curl https://api.growthbook.io/api/v1 \\ -u secret_abc123DEF456: # The \":\" at the end stops curl from asking for a password ``` If using Bearer auth, pass the Secret Key as the token: ```bash curl https://api.growthbook.io/api/v1 \\ -H \"Authorization: Bearer secret_abc123DEF456\" ``` ## Errors The API may return the following error status codes: - **400** - Bad Request - Often due to a missing required parameter - **401** - Unauthorized - No valid API key provided - **402** - Request Failed - The parameters are valid, but the request failed - **403** - Forbidden - Provided API key does not have the required access - **404** - Not Found - Unknown API route or requested resource - **429** - Too Many Requests - You exceeded the rate limit of 60 requests per minute. Try again later. - **5XX** - Server Error - Something went wrong on GrowthBook\'s end (these are rare) The response body will be a JSON object with the following properties: - **message** - Information about the error * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.VisualChangesetsApi = exports.VisualChangesetsApiFactory = exports.VisualChangesetsApiFp = exports.VisualChangesetsApiAxiosParamCreator = exports.SegmentsApi = exports.SegmentsApiFactory = exports.SegmentsApiFp = exports.SegmentsApiAxiosParamCreator = exports.SdkConnectionsApi = exports.SdkConnectionsApiFactory = exports.SdkConnectionsApiFp = exports.SdkConnectionsApiAxiosParamCreator = exports.SavedGroupsApi = exports.SavedGroupsApiFactory = exports.SavedGroupsApiFp = exports.SavedGroupsApiAxiosParamCreator = exports.ProjectsApi = exports.ProjectsApiFactory = exports.ProjectsApiFp = exports.ProjectsApiAxiosParamCreator = exports.MetricsApi = exports.MetricsApiFactory = exports.MetricsApiFp = exports.MetricsApiAxiosParamCreator = exports.FeaturesApi = exports.FeaturesApiFactory = exports.FeaturesApiFp = exports.FeaturesApiAxiosParamCreator = exports.ExperimentsApi = exports.ExperimentsApiFactory = exports.ExperimentsApiFp = exports.ExperimentsApiAxiosParamCreator = exports.DimensionsApi = exports.DimensionsApiFactory = exports.DimensionsApiFp = exports.DimensionsApiAxiosParamCreator = exports.DataSourcesApi = exports.DataSourcesApiFactory = exports.DataSourcesApiFp = exports.DataSourcesApiAxiosParamCreator = exports.PostMetricRequestBehaviorGoalEnum = exports.PostMetricRequestTypeEnum = exports.MetricBehaviorGoalEnum = exports.MetricTypeEnum = exports.FeatureValueTypeEnum = exports.ExperimentAnalysisSettingsStatsEngineEnum = exports.ExperimentAnalysisSettingsAttributionModelEnum = exports.ExperimentAnalysisSettingsInProgressConversionsEnum = void 0; const axios_1 = require("axios"); // Some imports not used depending on template conditions // @ts-ignore const common_1 = require("./common"); // @ts-ignore const base_1 = require("./base"); exports.ExperimentAnalysisSettingsInProgressConversionsEnum = { Include: 'include', Exclude: 'exclude' }; exports.ExperimentAnalysisSettingsAttributionModelEnum = { FirstExposure: 'firstExposure', ExperimentDuration: 'experimentDuration' }; exports.ExperimentAnalysisSettingsStatsEngineEnum = { Bayesian: 'bayesian', Frequentist: 'frequentist' }; exports.FeatureValueTypeEnum = { Boolean: 'boolean', String: 'string', Number: 'number', Json: 'json' }; exports.MetricTypeEnum = { Binomial: 'binomial', Count: 'count', Duration: 'duration', Revenue: 'revenue' }; exports.MetricBehaviorGoalEnum = { Increase: 'increase', Decrease: 'decrease' }; exports.PostMetricRequestTypeEnum = { Binomial: 'binomial', Count: 'count', Duration: 'duration', Revenue: 'revenue' }; exports.PostMetricRequestBehaviorGoalEnum = { Increase: 'increase', Decrease: 'decrease' }; /** * DataSourcesApi - axios parameter creator * @export */ const DataSourcesApiAxiosParamCreator = function (configuration) { return { /** * * @summary Get a single data source * @param {any} id The id of the requested resource * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDataSource: async (id, options = {}) => { // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('getDataSource', 'id', id); const localVarPath = `/data-sources/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication basicAuth required // http basic authentication required (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration); // authentication bearerAuth required // http bearer authentication required await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Get all data sources * @param {any} [limit] The number of items to return * @param {any} [offset] How many items to skip (use in conjunction with limit for pagination) * @param {any} [projectId] Filter by project id * @param {*} [options] Override http request option. * @throws {RequiredError} */ listDataSources: async (limit, offset, projectId, options = {}) => { const localVarPath = `/data-sources`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication basicAuth required // http basic authentication required (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration); // authentication bearerAuth required // http bearer authentication required await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (offset !== undefined) { localVarQueryParameter['offset'] = offset; } if (projectId !== undefined) { localVarQueryParameter['projectId'] = projectId; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; exports.DataSourcesApiAxiosParamCreator = DataSourcesApiAxiosParamCreator; /** * DataSourcesApi - functional programming interface * @export */ const DataSourcesApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.DataSourcesApiAxiosParamCreator)(configuration); return { /** * * @summary Get a single data source * @param {any} id The id of the requested resource * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getDataSource(id, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.getDataSource(id, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, /** * * @summary Get all data sources * @param {any} [limit] The number of items to return * @param {any} [offset] How many items to skip (use in conjunction with limit for pagination) * @param {any} [projectId] Filter by project id * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listDataSources(limit, offset, projectId, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.listDataSources(limit, offset, projectId, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, }; }; exports.DataSourcesApiFp = DataSourcesApiFp; /** * DataSourcesApi - factory interface * @export */ const DataSourcesApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.DataSourcesApiFp)(configuration); return { /** * * @summary Get a single data source * @param {any} id The id of the requested resource * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDataSource(id, options) { return localVarFp.getDataSource(id, options).then((request) => request(axios, basePath)); }, /** * * @summary Get all data sources * @param {any} [limit] The number of items to return * @param {any} [offset] How many items to skip (use in conjunction with limit for pagination) * @param {any} [projectId] Filter by project id * @param {*} [options] Override http request option. * @throws {RequiredError} */ listDataSources(limit, offset, projectId, options) { return localVarFp.listDataSources(limit, offset, projectId, options).then((request) => request(axios, basePath)); }, }; }; exports.DataSourcesApiFactory = DataSourcesApiFactory; /** * DataSourcesApi - object-oriented interface * @export * @class DataSourcesApi * @extends {BaseAPI} */ class DataSourcesApi extends base_1.BaseAPI { /** * * @summary Get a single data source * @param {any} id The id of the requested resource * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DataSourcesApi */ getDataSource(id, options) { return (0, exports.DataSourcesApiFp)(this.configuration).getDataSource(id, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Get all data sources * @param {any} [limit] The number of items to return * @param {any} [offset] How many items to skip (use in conjunction with limit for pagination) * @param {any} [projectId] Filter by project id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DataSourcesApi */ listDataSources(limit, offset, projectId, options) { return (0, exports.DataSourcesApiFp)(this.configuration).listDataSources(limit, offset, projectId, options).then((request) => request(this.axios, this.basePath)); } } exports.DataSourcesApi = DataSourcesApi; /** * DimensionsApi - axios parameter creator * @export */ const DimensionsApiAxiosParamCreator = function (configuration) { return { /** * * @summary Get a single dimension * @param {any} id The id of the requested resource * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDimension: async (id, options = {}) => { // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('getDimension', 'id', id); const localVarPath = `/dimensions/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication basicAuth required // http basic authentication required (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration); // authentication bearerAuth required // http bearer authentication required await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Get all dimensions * @param {any} [limit] The number of items to return * @param {any} [offset] How many items to skip (use in conjunction with limit for pagination) * @param {any} [datasourceId] Filter by Data Source * @param {*} [options] Override http request option. * @throws {RequiredError} */ listDimensions: async (limit, offset, datasourceId, options = {}) => { const localVarPath = `/dimensions`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication basicAuth required // http basic authentication required (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration); // authentication bearerAuth required // http bearer authentication required await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (offset !== undefined) { localVarQueryParameter['offset'] = offset; } if (datasourceId !== undefined) { localVarQueryParameter['datasourceId'] = datasourceId; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; exports.DimensionsApiAxiosParamCreator = DimensionsApiAxiosParamCreator; /** * DimensionsApi - functional programming interface * @export */ const DimensionsApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.DimensionsApiAxiosParamCreator)(configuration); return { /** * * @summary Get a single dimension * @param {any} id The id of the requested resource * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getDimension(id, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.getDimension(id, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, /** * * @summary Get all dimensions * @param {any} [limit] The number of items to return * @param {any} [offset] How many items to skip (use in conjunction with limit for pagination) * @param {any} [datasourceId] Filter by Data Source * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listDimensions(limit, offset, datasourceId, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.listDimensions(limit, offset, datasourceId, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, }; }; exports.DimensionsApiFp = DimensionsApiFp; /** * DimensionsApi - factory interface * @export */ const DimensionsApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.DimensionsApiFp)(configuration); return { /** * * @summary Get a single dimension * @param {any} id The id of the requested resource * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDimension(id, options) { return localVarFp.getDimension(id, options).then((request) => request(axios, basePath)); }, /** * * @summary Get all dimensions * @param {any} [limit] The number of items to return * @param {any} [offset] How many items to skip (use in conjunction with limit for pagination) * @param {any} [datasourceId] Filter by Data Source * @param {*} [options] Override http request option. * @throws {RequiredError} */ listDimensions(limit, offset, datasourceId, options) { return localVarFp.listDimensions(limit, offset, datasourceId, options).then((request) => request(axios, basePath)); }, }; }; exports.DimensionsApiFactory = DimensionsApiFactory; /** * DimensionsApi - object-oriented interface * @export * @class DimensionsApi * @extends {BaseAPI} */ class DimensionsApi extends base_1.BaseAPI { /** * * @summary Get a single dimension * @param {any} id The id of the requested resource * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DimensionsApi */ getDimension(id, options) { return (0, exports.DimensionsApiFp)(this.configuration).getDimension(id, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Get all dimensions * @param {any} [limit] The number of items to return * @param {any} [offset] How many items to skip (use in conjunction with limit for pagination) * @param {any} [datasourceId] Filter by Data Source * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DimensionsApi */ listDimensions(limit, offset, datasourceId, options) { return (0, exports.DimensionsApiFp)(this.configuration).listDimensions(limit, offset, datasourceId, options).then((request) => request(this.axios, this.basePath)); } } exports.DimensionsApi = DimensionsApi; /** * ExperimentsApi - axios parameter creator * @export */ const ExperimentsApiAxiosParamCreator = function (configuration) { return { /** * * @summary Get a single experiment * @param {any} id The id of the requested resource * @param {*} [options] Override http request option. * @throws {RequiredError} */ getExperiment: async (id, options = {}) => { // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('getExperiment', 'id', id); const localVarPath = `/experiments/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication basicAuth required // http basic authentication required (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration); // authentication bearerAuth required // http bearer authentication required await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Get results for an experiment * @param {any} id The id of the requested resource * @param {any} [phase] * @param {any} [dimension] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getExperimentResults: async (id, phase, dimension, options = {}) => { // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('getExperimentResults', 'id', id); const localVarPath = `/experiments/{id}/results` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication basicAuth required // http basic authentication required (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration); // authentication bearerAuth required // http bearer authentication required await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); if (phase !== undefined) { localVarQueryParameter['phase'] = phase; } if (dimension !== undefined) { localVarQueryParameter['dimension'] = dimension; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Get all experiments * @param {any} [limit] The number of items to return * @param {any} [offset] How many items to skip (use in conjunction with limit for pagination) * @param {any} [projectId] Filter by project id * @param {any} [datasourceId] Filter by Data Source * @param {any} [experimentId] Filter the returned list by the experiment tracking key (id) * @param {*} [options] Override http request option. * @throws {RequiredError} */ listExperiments: async (limit, offset, projectId, datasourceId, experimentId, options = {}) => { const localVarPath = `/experiments`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication basicAuth required // http basic authentication required (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration); // authentication bearerAuth required // http bearer authentication required await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (offset !== undefined) { localVarQueryParameter['offset'] = offset; } if (projectId !== undefined) { localVarQueryParameter['projectId'] = projectId; } if (datasourceId !== undefined) { localVarQueryParameter['datasourceId'] = datasourceId; } if (experimentId !== undefined) { localVarQueryParameter['experimentId'] = experimentId; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; exports.ExperimentsApiAxiosParamCreator = ExperimentsApiAxiosParamCreator; /** * ExperimentsApi - functional programming interface * @export */ const ExperimentsApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.ExperimentsApiAxiosParamCreator)(configuration); return { /** * * @summary Get a single experiment * @param {any} id The id of the requested resource * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getExperiment(id, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.getExperiment(id, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, /** * * @summary Get results for an experiment * @param {any} id The id of the requested resource * @param {any} [phase] * @param {any} [dimension] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getExperimentResults(id, phase, dimension, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.getExperimentResults(id, phase, dimension, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, /** * * @summary Get all experiments * @param {any} [limit] The number of items to return * @param {any} [offset] How many items to skip (use in conjunction with limit for pagination) * @param {any} [projectId] Filter by project id * @param {any} [datasourceId] Filter by Data Source * @param {any} [experimentId] Filter the returned list by the experiment tracking key (id) * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listExperiments(limit, offset, projectId, datasourceId, experimentId, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.listExperiments(limit, offset, projectId, datasourceId, experimentId, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, }; }; exports.ExperimentsApiFp = ExperimentsApiFp; /** * ExperimentsApi - factory interface * @export */ const ExperimentsApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.ExperimentsApiFp)(configuration); return { /** * * @summary Get a single experiment * @param {any} id The id of the requested resource * @param {*} [options] Override http request option. * @throws {RequiredError} */ getExperiment(id, options) { return localVarFp.getExperiment(id, options).then((request) => request(axios, basePath)); }, /** * * @summary Get results for an experiment * @param {any} id The id of the requested resource * @param {any} [phase] * @param {any} [dimension] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getExperimentResults(id, phase, dimension, options) { return localVarFp.getExperimentResults(id, phase, dimension, options).then((request) => request(axios, basePath)); }, /** * * @summary Get all experiments * @param {any} [limit] The number of items to return * @param {any} [offset] How many items to skip (use in conjunction with limit for pagination) * @param {any} [projectId] Filter by project id * @param {any} [datasourceId] Filter by Data Source * @param {any} [experimentId] Filter the returned list by the experiment tracking key (id) * @param {*} [options] Override http request option. * @throws {RequiredError} */ listExperiments(limit, offset, projectId, datasourceId, experimentId, options) { return localVarFp.listExperiments(limit, offset, projectId, datasourceId, experimentId, options).then((request) => request(axios, basePath)); }, }; }; exports.ExperimentsApiFactory = ExperimentsApiFactory; /** * ExperimentsApi - object-oriented interface * @export * @class ExperimentsApi * @extends {BaseAPI} */ class ExperimentsApi extends base_1.BaseAPI { /** * * @summary Get a single experiment * @param {any} id The id of the requested resource * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ExperimentsApi */ getExperiment(id, options) { return (0, exports.ExperimentsApiFp)(this.configuration).getExperiment(id, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Get results for an experiment * @param {any} id The id of the requested resource * @param {any} [phase] * @param {any} [dimension] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ExperimentsApi */ getExperimentResults(id, phase, dimension, options) { return (0, exports.ExperimentsApiFp)(this.configuration).getExperimentResults(id, phase, dimension, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Get all experiments * @param {any} [limit] The number of items to return * @param {any} [offset] How many items to skip (use in conjunction with limit for pagination) * @param {any} [projectId] Filter by project id * @param {any} [datasourceId] Filter by Data Source * @param {any} [experimentId] Filter the returned list by the experiment tracking key (id) * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ExperimentsApi */ listExperiments(limit, offset, projectId, datasourceId, experimentId, options) { return (0, exports.ExperimentsApiFp)(this.configuration).listExperiments(limit, offset, projectId, datasourceId, experimentId, options).then((request) => request(this.axios, this.basePath)); } } exports.ExperimentsApi = ExperimentsApi; /** * FeaturesApi - axios parameter creator * @export */ const FeaturesApiAxiosParamCreator = function (configuration) { return { /** * * @summary Get a single feature * @param {any} id The id of the requested resource * @param {*} [options] Override http request option. * @throws {RequiredError} */ getFeature: async (id, options = {}) => { // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('getFeature', 'id', id); const localVarPath = `/features/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication basicAuth required // http basic authentication required (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration); // authentication bearerAuth required // http bearer authentication required await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Get all features * @param {any} [limit] The number of items to return * @param {any} [offset] How many items to skip (use in conjunction with limit for pagination) * @param {any} [projectId] Filter by project id * @param {*} [options] Override http request option. * @throws {RequiredError} */ listFeatures: async (limit, offset, projectId, options = {}) => { const localVarPath = `/features`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication basicAuth required // http basic authentication required (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration); // authentication bearerAuth required // http bearer authentication required await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (offset !== undefined) { localVarQueryParameter['offset'] = offset; } if (projectId !== undefined) { localVarQueryParameter['projectId'] = projectId; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Toggle a feature in one or more environments * @param {any} id The id of the requested resource * @param {ToggleFeatureRequest} toggleFeatureRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ toggleFeature: async (id, toggleFeatureRequest, options = {}) => { // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('toggleFeature', 'id', id); // verify required parameter 'toggleFeatureRequest' is not null or undefined (0, common_1.assertParamExists)('toggleFeature', 'toggleFeatureRequest', toggleFeatureRequest); const localVarPath = `/features/{id}/toggle` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication basicAuth required // http basic authentication required (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration); // authentication bearerAuth required // http bearer authentication required await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(toggleFeatureRequest, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; exports.FeaturesApiAxiosParamCreator = FeaturesApiAxiosParamCreator; /** * FeaturesApi - functional programming interface * @export */ const FeaturesApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.FeaturesApiAxiosParamCreator)(configuration); return { /** * * @summary Get a single feature * @param {any} id The id of the requested resource * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getFeature(id, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.getFeature(id, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, /** * * @summary Get all features * @param {any} [limit] The number of items to return * @param {any} [offset] How many items to skip (use in conjunction with limit for pagination) * @param {any} [projectId] Filter by project id * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listFeatures(limit, offset, projectId, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.listFeatures(limit, offset, projectId, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, /** * * @summary Toggle a feature in one or more environments * @param {any} id The id of the requested resource * @param {ToggleFeatureRequest} toggleFeatureRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async toggleFeature(id, toggleFeatureRequest, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.toggleFeature(id, toggleFeatureRequest, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, }; }; exports.FeaturesApiFp = FeaturesApiFp; /** * FeaturesApi - factory interface * @export */ const FeaturesApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.FeaturesApiFp)(configuration); return { /** * * @summary Get a single feature * @param {any} id The id of the requested resource * @param {*} [options] Override http request option. * @throws {RequiredError} */ getFeature(id, options) { return localVarFp.getFeature(id, options).then((request) => request(axios, basePath)); }, /** * * @summary Get all features * @param {any} [limit] The number of items to return * @param {any} [offset] How many items to skip (use in conjunction with limit for pagination) * @param {any} [projectId] Filter by project id * @param {*} [options] Override http request option. * @throws {RequiredError} */ listFeatures(limit, offset, projectId, options) { return localVarFp.listFeatures(limit, offset, projectId, options).then((request) => request(axios, basePath)); }, /** * * @summary Toggle a feature in one or more environments * @param {any} id The id of the requested resource * @param {ToggleFeatureRequest} toggleFeatureRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ toggleFeature(id, toggleFeatureRequest, options) { return localVarFp.toggleFeature(id, toggleFeatureRequest, options).then((request) => request(axios, basePath)); }, }; }; exports.FeaturesApiFactory = FeaturesApiFactory; /** * FeaturesApi - object-oriented interface * @export * @class FeaturesApi * @extends {BaseAPI} */ class FeaturesApi extends base_1.BaseAPI { /** * * @summary Get a single feature * @param {any} id The id of the requested resource * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FeaturesApi */ getFeature(id, options) { return (0, exports.FeaturesApiFp)(this.configuration).getFeature(id, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Get all features * @param {any} [limit] The number of items to return * @param {any} [offset] How many items to skip (use in conjunction with limit for pagination) * @param {any} [projectId] Filter by project id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FeaturesApi */ listFeatures(limit, offset, projectId, options) { return (0, exports.FeaturesApiFp)(this.configuration).listFeatures(limit, offset, projectId, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Toggle a feature in one or more environments * @param {any} id The id of the requested resource * @param {ToggleFeatureRequest} toggleFeatureRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FeaturesApi */ toggleFeature(id, toggleFeatureRequest, options) { return (0, exports.FeaturesApiFp)(this.configuration).toggleFeature(id, toggleFeatureRequest, options).then((request) => request(this.axios, this.basePath)); } } exports.FeaturesApi = FeaturesApi; /** * MetricsApi - axios parameter creator * @export */ const MetricsApiAxiosParamCreator = function (configuration) { return { /** * * @summary Get a single metric * @param {any} id The id of the requested resource * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMetric: async (id, options = {}) => { // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('getMetric', 'id', id); const localVarPath = `/metrics/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication basicAuth required // http basic authentication required (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration); // authentication bearerAuth required // http bearer authentication required await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Get all metrics * @param {any} [limit] The number of items to return * @param {any} [offset] How many items to skip (use in conjunction with limit for pagination) * @param {any} [projectId] Filter by project id * @param {any} [datasourceId] Filter by Data Source * @param {*} [options] Override http request option. * @throws {RequiredError} */ listMetr