@indigov/flags-api
Advanced tools
Comparing version 0.0.20 to 0.0.21
@@ -1,4 +0,9 @@ | ||
import Flags from '../index'; | ||
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const index_1 = __importDefault(require("../index")); | ||
describe('Flags Client', () => { | ||
const flags = new Flags(process.env.AUTH_TOKEN, 'indigovdev', 'test', { env: 'local' }); | ||
const flags = new index_1.default(process.env.AUTH_TOKEN, 'indigovdev', 'test', { env: 'local' }); | ||
it('fetches all flags', async () => { | ||
@@ -5,0 +10,0 @@ const response = await flags.getAllFlags(); |
@@ -1,2 +0,7 @@ | ||
import fetch from 'cross-fetch'; | ||
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const cross_fetch_1 = __importDefault(require("cross-fetch")); | ||
const Endpoints = { | ||
@@ -7,3 +12,3 @@ prod: 'https://flags.indigov.us/v1', | ||
}; | ||
export default class Flags { | ||
class Flags { | ||
constructor(token, office, source, { env = 'prod', traceId, cohort } = {}) { | ||
@@ -17,3 +22,3 @@ this.token = token; | ||
this.getAllFlags = async () => this.request('flags/all').then((_) => _.value); | ||
this.request = (path) => fetch(`${this.endpoint}/${path}`, { | ||
this.request = (path) => (0, cross_fetch_1.default)(`${this.endpoint}/${path}`, { | ||
method: 'GET', | ||
@@ -36,2 +41,3 @@ headers: { | ||
} | ||
exports.default = Flags; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@indigov/flags-api", | ||
"version": "0.0.20", | ||
"version": "0.0.21", | ||
"description": "Strongly typed React/Node client for the Flags service", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -5,8 +5,5 @@ { | ||
"compilerOptions": { | ||
"declaration": true, | ||
"outDir": "dist", | ||
"rootDir": "src", | ||
"strict": true, | ||
"sourceMap": true | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
13674
210
0