New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@sap-devx/feature-toggle-node

Package Overview
Dependencies
Maintainers
10
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sap-devx/feature-toggle-node - npm Package Compare versions

Comparing version 1.0.8 to 1.0.9

lib/strategy/appStudioMultiStrategy.d.ts

12

CHANGELOG.md

@@ -0,1 +1,13 @@

<a name="1.0.8"></a>
# 1.0.8 (2021-01-20)
### Features
- Retrieving the sub account with the TENANT_NAME environment variable and the workspace with the WORKSPACE_ID environment variable instead of the WS_BASE_URL environment variable
### BREAKING CHANGES
- None
<a name="1.0.7"></a>

@@ -2,0 +14,0 @@

2

lib/server_arguments.d.ts
export declare const ENV_FT_SERVER_ENDPOINT_NAME = "FT_SERVER_ENDPOINT";
export declare const ENV_REFRESH_INTERVAL_NAME = "FT_CLIENT_REFRESH_INTERVAL";
export declare const ENV_FT_TOKEN = "FT_TOKEN";
export interface ServerArgs {
ftServerEndPoint: string;
ftServerInterval: number;
ftServerToken: string | undefined;
}
export declare function getServerArgs(): ServerArgs;

5

lib/server_arguments.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getServerArgs = exports.ENV_REFRESH_INTERVAL_NAME = exports.ENV_FT_SERVER_ENDPOINT_NAME = void 0;
exports.getServerArgs = exports.ENV_FT_TOKEN = exports.ENV_REFRESH_INTERVAL_NAME = exports.ENV_FT_SERVER_ENDPOINT_NAME = void 0;
const logger_1 = require("./logger");

@@ -9,2 +9,3 @@ const utils_1 = require("./utils");

exports.ENV_REFRESH_INTERVAL_NAME = "FT_CLIENT_REFRESH_INTERVAL";
exports.ENV_FT_TOKEN = "FT_TOKEN";
const DEFAULT_REFRESH_INTERVAL = 10000; //10 sec

@@ -30,5 +31,5 @@ // get featureToggle server url and client refresh interval from environment variables

logger_1.log(`client refresh interval is: ${interval}`);
return { ftServerEndPoint: endpoint, ftServerInterval: interval };
return { ftServerEndPoint: endpoint, ftServerInterval: interval, ftServerToken: process.env[exports.ENV_FT_TOKEN] };
}
exports.getServerArgs = getServerArgs;
//# sourceMappingURL=server_arguments.js.map

@@ -6,3 +6,4 @@ "use strict";

const unleash_client_wrapper_1 = require("./unleash_client_wrapper");
const appstudio_strategy_1 = require("./appstudio_strategy");
const appStudioMultiStrategy_1 = require("./strategy/appStudioMultiStrategy");
const appStudioStrategies_1 = require("./strategy/appStudioStrategies");
// Map of Unleash clients.

@@ -16,3 +17,5 @@ // map key = extensionName

//init client
const client = await unleash_client_wrapper_1.initializeUnleashClient(extensionName, serverArgs, [new appstudio_strategy_1.AppStudioMultiStrategy()]);
const appStudioMultiStrategy = new appStudioMultiStrategy_1.AppStudioMultiStrategy();
const client = await unleash_client_wrapper_1.initializeUnleashClient(extensionName, serverArgs, [appStudioMultiStrategy]);
appStudioStrategies_1.registerStrategies(appStudioMultiStrategy);
//add the client to the map

@@ -19,0 +22,0 @@ unleashClientMap.set(extensionName, client);

@@ -31,3 +31,3 @@ "use strict";

//create a new unleash client
const unleashClient = unleash_client_1.initialize({
const options = {
appName: extensionName,

@@ -37,3 +37,7 @@ refreshInterval: serverArgs.ftServerInterval,

strategies: customStrategies,
});
};
if (serverArgs.ftServerToken) {
options.customHeaders = { authorization: serverArgs.ftServerToken };
}
const unleashClient = unleash_client_1.initialize(options);
const readyPromise = getUnleashClientReadyPromise(unleashClient);

@@ -40,0 +44,0 @@ const registeredPromise = getUnleashClientRegisteredPromise(unleashClient);

{
"name": "@sap-devx/feature-toggle-node",
"version": "1.0.8",
"version": "1.0.9",
"description": "",

@@ -34,17 +34,17 @@ "main": "lib/api.js",

"parse-duration": "0.4.4",
"unleash-client": "3.4.0"
"unleash-client": "3.8.0"
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "1.0.1",
"@types/chai": "4.2.14",
"@types/mocha": "8.2.0",
"@types/chai": "4.2.15",
"@types/mocha": "8.2.1",
"@types/rimraf": "3.0.0",
"@types/sinon": "9.0.10",
"@types/sinon": "9.0.11",
"@typescript-eslint/eslint-plugin": "2.34.0",
"@typescript-eslint/parser": "2.34.0",
"coveralls": "3.1.0",
"chai": "4.2.0",
"chai": "4.3.4",
"cz-conventional-changelog": "3.3.0",
"@commitlint/cli": "11.0.0",
"@commitlint/config-conventional": "11.0.0",
"@commitlint/config-conventional": "12.0.1",
"eslint": "6.8.0",

@@ -54,3 +54,3 @@ "eslint-config-prettier": "6.15.0",

"husky": "4.3.7",
"mocha": "8.2.1",
"mocha": "8.3.0",
"npm-run-all": "4.1.5",

@@ -60,6 +60,6 @@ "nyc": "15.1.0",

"rimraf": "3.0.2",
"sinon": "9.2.3",
"sinon": "9.2.4",
"source-map-support": "0.5.19",
"ts-node": "9.1.1",
"typescript": "4.1.3"
"typescript": "4.2.3"
},

@@ -66,0 +66,0 @@ "husky": {

@@ -12,3 +12,2 @@ [![CircleCI](https://circleci.com/gh/SAP/feature-toggle-node.svg?style=svg)](https://circleci.com/gh/SAP/feature-toggle-node)

## Description

@@ -78,1 +77,5 @@ This module is used to inquire if an SAP Business Application Studio feature toggle is enabled or disabled.

Open an issue within this GitHub repository.
## Licensing
Please see our [LICENSE](https://github.com/SAP/feature-toggle-node/LICENSE) for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available via the [REUSE tool](https://api.reuse.software/info/github.com/SAP/feature-toggle-node).

@@ -7,2 +7,3 @@ import { log } from "./logger";

export const ENV_REFRESH_INTERVAL_NAME = "FT_CLIENT_REFRESH_INTERVAL";
export const ENV_FT_TOKEN = "FT_TOKEN";
const DEFAULT_REFRESH_INTERVAL = 10000; //10 sec

@@ -13,2 +14,3 @@

ftServerInterval: number;
ftServerToken: string | undefined;
}

@@ -36,3 +38,4 @@

log(`client refresh interval is: ${interval}`);
return { ftServerEndPoint: endpoint, ftServerInterval: interval };
return { ftServerEndPoint: endpoint, ftServerInterval: interval, ftServerToken: process.env[ENV_FT_TOKEN] };
}
import { Unleash } from "unleash-client";
import * as ServerArgs from "./server_arguments";
import { initializeUnleashClient } from "./unleash_client_wrapper";
import { AppStudioMultiStrategy } from "./appstudio_strategy";
import { AppStudioMultiStrategy } from "./strategy/appStudioMultiStrategy";
import { registerStrategies } from "./strategy/appStudioStrategies";

@@ -16,3 +17,5 @@ // Map of Unleash clients.

//init client
const client = await initializeUnleashClient(extensionName, serverArgs, [new AppStudioMultiStrategy()]);
const appStudioMultiStrategy = new AppStudioMultiStrategy();
const client = await initializeUnleashClient(extensionName, serverArgs, [appStudioMultiStrategy]);
registerStrategies(appStudioMultiStrategy);

@@ -19,0 +22,0 @@ //add the client to the map

@@ -5,2 +5,3 @@ import { initialize, Unleash, Strategy } from "unleash-client";

import to from "await-to-js";
import { UnleashConfig } from "unleash-client/lib/unleash";

@@ -33,3 +34,3 @@ async function getUnleashClientRegisteredPromise(client: Unleash): Promise<void> {

//create a new unleash client
const unleashClient = initialize({
const options: UnleashConfig = {
appName: extensionName,

@@ -39,5 +40,9 @@ refreshInterval: serverArgs.ftServerInterval,

strategies: customStrategies,
//customHeaders: {"authorization" : ""},
});
};
if (serverArgs.ftServerToken) {
options.customHeaders = { authorization: serverArgs.ftServerToken };
}
const unleashClient = initialize(options);
const readyPromise = getUnleashClientReadyPromise(unleashClient);

@@ -44,0 +49,0 @@ const registeredPromise = getUnleashClientRegisteredPromise(unleashClient);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc