Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouzhuojie committed Dec 12, 2017
0 parents commit 643e676
Show file tree
Hide file tree
Showing 102 changed files with 9,878 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["env", "stage-0"]
}
23 changes: 23 additions & 0 deletions .swagger-codegen-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Swagger Codegen Ignore
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
1 change: 1 addition & 0 deletions .swagger-codegen/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.3.0-SNAPSHOT
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
language: node_js
node_js:
- "6"
- "6.1"
- "5"
- "5.11"

5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
gen:
docker run --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli generate \
-i /local/swagger.yaml \
-l javascript \
-o /local/
156 changes: 156 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
# flagr

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.0
- Package version: 1.0.0
- Build package: io.swagger.codegen.languages.JavascriptClientCodegen

## Installation

### For [Node.js](https://nodejs.org/)

#### npm

To publish the library as a [npm](https://www.npmjs.com/),
please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).

Then install it via:

```shell
npm install flagr --save
```

#### git
#
If the library is hosted at a git repository, e.g.
https://github.com/GIT_USER_ID/GIT_REPO_ID
then install it via:

```shell
npm install GIT_USER_ID/GIT_REPO_ID --save
```

### For browser

The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following
the above steps with Node.js and installing browserify with `npm install -g browserify`,
perform the following (assuming *main.js* is your entry file):

```shell
browserify main.js > bundle.js
```

Then include *bundle.js* in the HTML pages.

### Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error:
Cannot resolve module", most certainly you should disable AMD loader. Add/merge
the following section to your webpack config:

```javascript
module: {
rules: [
{
parser: {
amd: false
}
}
]
}
```

## Getting Started

Please follow the [installation](#installation) instruction and execute the following JS code:

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

var api = new Flagr.ConstraintApi()

var flagID = 789; // {Number} numeric ID of the flag

var segmentID = 789; // {Number} numeric ID of the segment

var body = new Flagr.CreateConstraintRequest(); // {CreateConstraintRequest} create a constraint


var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.createConstraint(flagID, segmentID, body, callback);

```

## Documentation for API Endpoints

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

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*Flagr.ConstraintApi* | [**createConstraint**](docs/ConstraintApi.md#createConstraint) | **POST** /flags/{flagID}/segments/{segmentID}/constraints |
*Flagr.ConstraintApi* | [**deleteConstraint**](docs/ConstraintApi.md#deleteConstraint) | **DELETE** /flags/{flagID}/segments/{segmentID}/constraints/{constraintID} |
*Flagr.ConstraintApi* | [**findConstraints**](docs/ConstraintApi.md#findConstraints) | **GET** /flags/{flagID}/segments/{segmentID}/constraints |
*Flagr.ConstraintApi* | [**putConstraint**](docs/ConstraintApi.md#putConstraint) | **PUT** /flags/{flagID}/segments/{segmentID}/constraints/{constraintID} |
*Flagr.DistributionApi* | [**findDistributions**](docs/DistributionApi.md#findDistributions) | **GET** /flags/{flagID}/segments/{segmentID}/distributions |
*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.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.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 |
*Flagr.SegmentApi* | [**putSegment**](docs/SegmentApi.md#putSegment) | **PUT** /flags/{flagID}/segments/{segmentID} |
*Flagr.SegmentApi* | [**putSegmentsReorder**](docs/SegmentApi.md#putSegmentsReorder) | **PUT** /flags/{flagID}/segments/reorder |
*Flagr.VariantApi* | [**createVariant**](docs/VariantApi.md#createVariant) | **POST** /flags/{flagID}/variants |
*Flagr.VariantApi* | [**deleteVariant**](docs/VariantApi.md#deleteVariant) | **DELETE** /flags/{flagID}/variants/{variantID} |
*Flagr.VariantApi* | [**findVariants**](docs/VariantApi.md#findVariants) | **GET** /flags/{flagID}/variants |
*Flagr.VariantApi* | [**putVariant**](docs/VariantApi.md#putVariant) | **PUT** /flags/{flagID}/variants/{variantID} |


## Documentation for Models

- [Flagr.Constraint](docs/Constraint.md)
- [Flagr.CreateConstraintRequest](docs/CreateConstraintRequest.md)
- [Flagr.CreateFlagRequest](docs/CreateFlagRequest.md)
- [Flagr.CreateSegmentRequest](docs/CreateSegmentRequest.md)
- [Flagr.CreateVariantRequest](docs/CreateVariantRequest.md)
- [Flagr.Distribution](docs/Distribution.md)
- [Flagr.Error](docs/Error.md)
- [Flagr.EvalContext](docs/EvalContext.md)
- [Flagr.EvalDebugLog](docs/EvalDebugLog.md)
- [Flagr.EvalResult](docs/EvalResult.md)
- [Flagr.EvaluationBatchRequest](docs/EvaluationBatchRequest.md)
- [Flagr.EvaluationBatchResponse](docs/EvaluationBatchResponse.md)
- [Flagr.EvaluationEntity](docs/EvaluationEntity.md)
- [Flagr.Flag](docs/Flag.md)
- [Flagr.FlagSnapshot](docs/FlagSnapshot.md)
- [Flagr.PutDistributionsRequest](docs/PutDistributionsRequest.md)
- [Flagr.PutFlagRequest](docs/PutFlagRequest.md)
- [Flagr.PutSegmentReorderRequest](docs/PutSegmentReorderRequest.md)
- [Flagr.PutSegmentRequest](docs/PutSegmentRequest.md)
- [Flagr.PutVariantRequest](docs/PutVariantRequest.md)
- [Flagr.Segment](docs/Segment.md)
- [Flagr.SegmentDebugLog](docs/SegmentDebugLog.md)
- [Flagr.SetFlagEnabledRequest](docs/SetFlagEnabledRequest.md)
- [Flagr.Variant](docs/Variant.md)


## Documentation for Authorization

All endpoints do not require authorization.

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

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Number** | | [optional]
**property** | **String** | |
**operator** | **String** | |
**value** | **String** | |


<a name="OperatorEnum"></a>
## Enum: OperatorEnum


* `EQ` (value: `"EQ"`)

* `NEQ` (value: `"NEQ"`)

* `LT` (value: `"LT"`)

* `LTE` (value: `"LTE"`)

* `GT` (value: `"GT"`)

* `GTE` (value: `"GTE"`)

* `EREG` (value: `"EREG"`)

* `NEREG` (value: `"NEREG"`)

* `IN` (value: `"IN"`)

* `NOTIN` (value: `"NOTIN"`)

* `CONTAINS` (value: `"CONTAINS"`)

* `NOTCONTAINS` (value: `"NOTCONTAINS"`)




Loading

0 comments on commit 643e676

Please sign in to comment.