Skip to content

Latest commit

 

History

History

README.md

@flagent/client

Version: see root VERSION or Releases. Example below uses 0.1.6.

This generator creates TypeScript/JavaScript client that utilizes axios. The generated Node module can be used in the following environments:

Environment

  • Node.js
  • Webpack
  • Browserify

Language level

  • ES5 - you must have a Promises/A+ library installed
  • ES6

Module system

  • CommonJS
  • ES6 module system

It can be used in both TypeScript and JavaScript. In TypeScript, the definition will be automatically resolved via package.json. (Reference)

Building

To build and compile the typescript sources to javascript use:

npm install
npm run build

Publishing

First build the package then run npm publish

Consuming

navigate to the folder of your consuming project and run one of the following commands.

published:

npm install @flagent/client@0.1.7 --save

unPublished (not recommended):

npm install PATH_TO_GENERATED_PACKAGE --save

Documentation for API Endpoints

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

Class Method HTTP request Description
ConstraintApi createConstraint POST /flags/{flagId}/segments/{segmentId}/constraints Create constraint
ConstraintApi deleteConstraint DELETE /flags/{flagId}/segments/{segmentId}/constraints/{constraintId} Delete constraint
ConstraintApi findConstraints GET /flags/{flagId}/segments/{segmentId}/constraints Get constraints for segment
ConstraintApi putConstraint PUT /flags/{flagId}/segments/{segmentId}/constraints/{constraintId} Update constraint
DistributionApi findDistributions GET /flags/{flagId}/segments/{segmentId}/distributions Get distributions for segment
DistributionApi putDistributions PUT /flags/{flagId}/segments/{segmentId}/distributions Update distributions
EvaluationApi postEvaluation POST /evaluation Evaluate flag
EvaluationApi postEvaluationBatch POST /evaluation/batch Batch evaluate flags
ExportApi getExportEvalCacheJSON GET /export/eval_cache/json Export eval cache as JSON
ExportApi getExportSQLite GET /export/sqlite Export database as SQLite
FlagApi createFlag POST /flags Create a new flag
FlagApi deleteFlag DELETE /flags/{flagId} Delete flag
FlagApi findFlags GET /flags Get all flags
FlagApi getFlag GET /flags/{flagId} Get flag by ID
FlagApi getFlagEntityTypes GET /flags/entity_types Get all entity types
FlagApi getFlagSnapshots GET /flags/{flagId}/snapshots Get flag snapshots
FlagApi putFlag PUT /flags/{flagId} Update flag
FlagApi restoreFlag PUT /flags/{flagId}/restore Restore deleted flag
FlagApi setFlagEnabled PUT /flags/{flagId}/enabled Set flag enabled status
HealthApi getHealth GET /health Health check
HealthApi getInfo GET /info Get version information
SegmentApi createSegment POST /flags/{flagId}/segments Create segment
SegmentApi deleteSegment DELETE /flags/{flagId}/segments/{segmentId} Delete segment
SegmentApi findSegments GET /flags/{flagId}/segments Get segments for flag
SegmentApi putSegment PUT /flags/{flagId}/segments/{segmentId} Update segment
SegmentApi putSegmentReorder PUT /flags/{flagId}/segments/reorder Reorder segments
TagApi createFlagTag POST /flags/{flagId}/tags Create tag and associate with flag
TagApi deleteFlagTag DELETE /flags/{flagId}/tags/{tagId} Remove tag from flag
TagApi findAllTags GET /tags Get all tags
TagApi findFlagTags GET /flags/{flagId}/tags Get tags for flag
VariantApi createVariant POST /flags/{flagId}/variants Create variant
VariantApi deleteVariant DELETE /flags/{flagId}/variants/{variantId} Delete variant
VariantApi findVariants GET /flags/{flagId}/variants Get variants for flag
VariantApi putVariant PUT /flags/{flagId}/variants/{variantId} Update variant

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

bearerAuth

  • Type: Bearer authentication (JWT)

basicAuth

  • Type: HTTP basic authentication