Skip to content

Commit

Permalink
Merge pull request #2 from checkr/zz/upgrade-jsflagr
Browse files Browse the repository at this point in the history
Upgrade flagr swagger API
  • Loading branch information
zhouzhuojie authored Sep 11, 2018
2 parents fc65463 + 45c8bb4 commit e19e4b0
Show file tree
Hide file tree
Showing 47 changed files with 429 additions and 96 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Flagr - JavaScript client for flagr
Flagr is a feature flagging, A/B testing and dynamic configuration microservice
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:

- API version: 1.0.8
- Package version: 1.0.8
- API version: 1.0.10
- Package version: 1.0.10
- Build package: io.swagger.codegen.languages.JavascriptClientCodegen

## Installation
Expand Down Expand Up @@ -129,14 +129,15 @@ Class | Method | HTTP request | Description
*Flagr.DistributionApi* | [**putDistributions**](docs/DistributionApi.md#putDistributions) | **PUT** /flags/{flagID}/segments/{segmentID}/distributions |
*Flagr.EvaluationApi* | [**postEvaluation**](docs/EvaluationApi.md#postEvaluation) | **POST** /evaluation |
*Flagr.EvaluationApi* | [**postEvaluationBatch**](docs/EvaluationApi.md#postEvaluationBatch) | **POST** /evaluation/batch |
*Flagr.ExportApi* | [**getExportSQLite**](docs/ExportApi.md#getExportSQLite) | **GET** /export/sqlite |
*Flagr.FlagApi* | [**createFlag**](docs/FlagApi.md#createFlag) | **POST** /flags |
*Flagr.FlagApi* | [**deleteFlag**](docs/FlagApi.md#deleteFlag) | **DELETE** /flags/{flagID} |
*Flagr.FlagApi* | [**findFlags**](docs/FlagApi.md#findFlags) | **GET** /flags |
*Flagr.FlagApi* | [**getFlag**](docs/FlagApi.md#getFlag) | **GET** /flags/{flagID} |
*Flagr.FlagApi* | [**getFlagSnapshots**](docs/FlagApi.md#getFlagSnapshots) | **GET** /flags/{flagID}/snapshots |
*Flagr.FlagApi* | [**putFlag**](docs/FlagApi.md#putFlag) | **PUT** /flags/{flagID} |
*Flagr.FlagApi* | [**setFlagEnabled**](docs/FlagApi.md#setFlagEnabled) | **PUT** /flags/{flagID}/enabled |
*Flagr.HealthApi* | [**healthGet**](docs/HealthApi.md#healthGet) | **GET** /health |
*Flagr.HealthApi* | [**getHealth**](docs/HealthApi.md#getHealth) | **GET** /health |
*Flagr.SegmentApi* | [**createSegment**](docs/SegmentApi.md#createSegment) | **POST** /flags/{flagID}/segments |
*Flagr.SegmentApi* | [**deleteSegment**](docs/SegmentApi.md#deleteSegment) | **DELETE** /flags/{flagID}/segments/{segmentID} |
*Flagr.SegmentApi* | [**findSegments**](docs/SegmentApi.md#findSegments) | **GET** /flags/{flagID}/segments |
Expand Down
1 change: 1 addition & 0 deletions docs/CreateFlagRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**description** | **String** | |
**key** | **String** | unique key representation of the flag | [optional]


3 changes: 2 additions & 1 deletion docs/EvalContext.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Name | Type | Description | Notes
**entityType** | **String** | |
**entityContext** | **Object** | | [optional]
**enableDebug** | **Boolean** | | [optional]
**flagID** | **Number** | |
**flagID** | **Number** | flagID | [optional]
**flagKey** | **String** | flagKey. flagID or flagKey will resolve to the same flag. Either works. | [optional]


1 change: 1 addition & 0 deletions docs/EvalResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**flagID** | **Number** | |
**flagKey** | **String** | |
**flagSnapshotID** | **Number** | | [optional]
**segmentID** | **Number** | |
**variantID** | **Number** | |
Expand Down
3 changes: 2 additions & 1 deletion docs/EvaluationBatchRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**entities** | [**[EvaluationEntity]**](EvaluationEntity.md) | |
**enableDebug** | **Boolean** | | [optional]
**flagIDs** | **[Number]** | |
**flagIDs** | **[Number]** | flagIDs | [optional]
**flagKeys** | **[String]** | flagKeys. Either flagIDs or flagKeys works. If pass in both, Flagr may return duplicate results. | [optional]


49 changes: 49 additions & 0 deletions docs/ExportApi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Flagr.ExportApi

All URIs are relative to *http://localhost/api/v1*

Method | HTTP request | Description
------------- | ------------- | -------------
[**getExportSQLite**](ExportApi.md#getExportSQLite) | **GET** /export/sqlite |


<a name="getExportSQLite"></a>
# **getExportSQLite**
> File getExportSQLite()


Export sqlite3 format of the db dump, which is converted from the main database.

### Example
```javascript
var Flagr = require('flagr');

var apiInstance = new Flagr.ExportApi();

var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.getExportSQLite(callback);
```

### Parameters
This endpoint does not need any parameter.

### Return type

**File**

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/octet-stream

1 change: 1 addition & 0 deletions docs/Flag.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Number** | | [optional]
**key** | **String** | unique key representation of the flag | [optional]
**description** | **String** | |
**enabled** | **Boolean** | |
**segments** | [**[Segment]**](Segment.md) | | [optional]
Expand Down
2 changes: 2 additions & 0 deletions docs/FlagApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ var opts = {
'enabled': true, // Boolean | return flags having given enabled status
'description': "description_example", // String | return flags exactly matching given description
'descriptionLike': "descriptionLike_example", // String | return flags partially matching given description
'key': "key_example", // String | return flags matching given key
'offset': 789 // Number | return flags given the offset, it should usually set together with limit
};

Expand All @@ -139,6 +140,7 @@ Name | Type | Description | Notes
**enabled** | **Boolean**| return flags having given enabled status | [optional]
**description** | **String**| return flags exactly matching given description | [optional]
**descriptionLike** | **String**| return flags partially matching given description | [optional]
**key** | **String**| return flags matching given key | [optional]
**offset** | **Number**| return flags given the offset, it should usually set together with limit | [optional]

### Return type
Expand Down
12 changes: 7 additions & 5 deletions docs/HealthApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ All URIs are relative to *http://localhost/api/v1*

Method | HTTP request | Description
------------- | ------------- | -------------
[**healthGet**](HealthApi.md#healthGet) | **GET** /health |
[**getHealth**](HealthApi.md#getHealth) | **GET** /health |


<a name="healthGet"></a>
# **healthGet**
> healthGet()
<a name="getHealth"></a>
# **getHealth**
> getHealth()


Check if Flagr is healthy

### Example
```javascript
var Flagr = require('flagr');
Expand All @@ -26,7 +28,7 @@ var callback = function(error, data, response) {
console.log('API called successfully.');
}
};
apiInstance.healthGet(callback);
apiInstance.getHealth(callback);
```

### Parameters
Expand Down
1 change: 1 addition & 0 deletions docs/PutFlagRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**description** | **String** | |
**dataRecordsEnabled** | **Boolean** | enabled data records will get data logging in the metrics pipeline, for example, kafka. | [optional]
**key** | **String** | | [optional]


4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flagr",
"version": "1.0.8",
"version": "1.0.10",
"description": "Flagr_is_a_feature_flagging_AB_testing_and_dynamic_configuration_microservice",
"license": "Unlicense",
"main": "src/index.js",
Expand All @@ -11,7 +11,7 @@
"fs": false
},
"dependencies": {
"superagent": "3.5.2"
"superagent": "~3.7.0"
},
"devDependencies": {
"mocha": "~2.3.4",
Expand Down
4 changes: 2 additions & 2 deletions src/ApiClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Flagr
* Flagr is a feature flagging, A/B testing and dynamic configuration microservice
*
* OpenAPI spec version: 1.0.8
* OpenAPI spec version: 1.0.10
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
Expand Down Expand Up @@ -32,7 +32,7 @@

/**
* @module ApiClient
* @version 1.0.8
* @version 1.0.10
*/

/**
Expand Down
4 changes: 2 additions & 2 deletions src/api/ConstraintApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Flagr
* Flagr is a feature flagging, A/B testing and dynamic configuration microservice
*
* OpenAPI spec version: 1.0.8
* OpenAPI spec version: 1.0.10
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
Expand Down Expand Up @@ -33,7 +33,7 @@
/**
* Constraint service.
* @module api/ConstraintApi
* @version 1.0.8
* @version 1.0.10
*/

/**
Expand Down
4 changes: 2 additions & 2 deletions src/api/DistributionApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Flagr
* Flagr is a feature flagging, A/B testing and dynamic configuration microservice
*
* OpenAPI spec version: 1.0.8
* OpenAPI spec version: 1.0.10
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
Expand Down Expand Up @@ -33,7 +33,7 @@
/**
* Distribution service.
* @module api/DistributionApi
* @version 1.0.8
* @version 1.0.10
*/

/**
Expand Down
4 changes: 2 additions & 2 deletions src/api/EvaluationApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Flagr
* Flagr is a feature flagging, A/B testing and dynamic configuration microservice
*
* OpenAPI spec version: 1.0.8
* OpenAPI spec version: 1.0.10
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
Expand Down Expand Up @@ -33,7 +33,7 @@
/**
* Evaluation service.
* @module api/EvaluationApi
* @version 1.0.8
* @version 1.0.10
*/

/**
Expand Down
92 changes: 92 additions & 0 deletions src/api/ExportApi.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/**
* Flagr
* Flagr is a feature flagging, A/B testing and dynamic configuration microservice
*
* OpenAPI spec version: 1.0.10
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.0-SNAPSHOT
*
* Do not edit the class manually.
*
*/

(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/Error'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('../model/Error'));
} else {
// Browser globals (root is window)
if (!root.Flagr) {
root.Flagr = {};
}
root.Flagr.ExportApi = factory(root.Flagr.ApiClient, root.Flagr.Error);
}
}(this, function(ApiClient, Error) {
'use strict';

/**
* Export service.
* @module api/ExportApi
* @version 1.0.10
*/

/**
* Constructs a new ExportApi.
* @alias module:api/ExportApi
* @class
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
var exports = function(apiClient) {
this.apiClient = apiClient || ApiClient.instance;


/**
* Callback function to receive the result of the getExportSQLite operation.
* @callback module:api/ExportApi~getExportSQLiteCallback
* @param {String} error Error message, if any.
* @param {File} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/

/**
* Export sqlite3 format of the db dump, which is converted from the main database.
* @param {module:api/ExportApi~getExportSQLiteCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link File}
*/
this.getExportSQLite = function(callback) {
var postBody = null;


var pathParams = {
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};

var authNames = [];
var contentTypes = ['application/json'];
var accepts = ['application/octet-stream'];
var returnType = File;

return this.apiClient.callApi(
'/export/sqlite', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
};

return exports;
}));
6 changes: 4 additions & 2 deletions src/api/FlagApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Flagr
* Flagr is a feature flagging, A/B testing and dynamic configuration microservice
*
* OpenAPI spec version: 1.0.8
* OpenAPI spec version: 1.0.10
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
Expand Down Expand Up @@ -33,7 +33,7 @@
/**
* Flag service.
* @module api/FlagApi
* @version 1.0.8
* @version 1.0.10
*/

/**
Expand Down Expand Up @@ -151,6 +151,7 @@
* @param {Boolean} opts.enabled return flags having given enabled status
* @param {String} opts.description return flags exactly matching given description
* @param {String} opts.descriptionLike return flags partially matching given description
* @param {String} opts.key return flags matching given key
* @param {Number} opts.offset return flags given the offset, it should usually set together with limit
* @param {module:api/FlagApi~findFlagsCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link Array.<module:model/Flag>}
Expand All @@ -167,6 +168,7 @@
'enabled': opts['enabled'],
'description': opts['description'],
'description_like': opts['descriptionLike'],
'key': opts['key'],
'offset': opts['offset'],
};
var collectionQueryParams = {
Expand Down
Loading

0 comments on commit e19e4b0

Please sign in to comment.