Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rox-ssr

Package Overview
Dependencies
Maintainers
7
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rox-ssr - npm Package Compare versions

Comparing version 5.4.11 to 5.4.12

8

dist/browser/index.d.ts

@@ -7,2 +7,7 @@ import { Flag } from './flag';

export { RoxNumber } from './number';
declare global {
interface Window {
rolloutData: any;
}
}
export interface RoxContainer {

@@ -54,2 +59,3 @@ [key: string]: Flag | RoxNumber | RoxString;

selfManaged?: SelfManagedOptions;
disableSignatureVerification?: boolean;
}

@@ -87,2 +93,4 @@ export interface dynamicApi {

setCustomBooleanProperty(name: string, value: boolean | ((context?: any) => boolean)): void;
setCustomDateProperty(name: string, value: Date | ((context?: any) => Date)): void;
setCustomSemverProperty(name: string, value: string | ((context?: any) => string)): void;
fetch(): void;

@@ -89,0 +97,0 @@ showOverrides(position?: RoxOverridesPosition): void;

17

dist/browser/index.js

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

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -94,4 +94,7 @@ if (y = 0, t) op = [op[0] & 2, t.value];

_options = __assign({}, options);
if (utils_1.isBrowser() && window && window.rolloutData) {
Object.assign(_options, options, { embedded: window.rolloutData, disableNetworkFetch: true });
if ((0, utils_1.isBrowser)() && window && window.rolloutData) {
Object.assign(_options, options, {
embedded: window.rolloutData,
disableNetworkFetch: true,
});
if (_options.disablePushUpdateListener !== false) {

@@ -129,2 +132,8 @@ _options.disablePushUpdateListener = true;

};
_RoxClient.prototype.setCustomDateProperty = function (name, value) {
utils_1.internalRox.setCustomDateProperty(name, value);
};
_RoxClient.prototype.setCustomSemverProperty = function (name, value) {
utils_1.internalRox.setCustomSemverProperty(name, value);
};
_RoxClient.prototype.fetch = function () {

@@ -134,3 +143,3 @@ utils_1.internalRox.fetch();

_RoxClient.prototype.showOverrides = function (position) {
if (utils_1.isBrowser()) {
if ((0, utils_1.isBrowser)()) {
utils_1.internalRox.showOverrides(position);

@@ -137,0 +146,0 @@ return;

@@ -1,3 +0,3 @@

interface RoxNumberInterface {
new (defaultValue: number, variations?: ReadonlyArray<number>): RoxNumberInterface;
interface IRoxNumberInterface {
new (defaultValue: number, variations?: ReadonlyArray<number>): IRoxNumberInterface;
readonly name: string;

@@ -7,5 +7,5 @@ readonly defaultValue: number;

}
declare const internalRoxNumber: RoxNumberInterface;
declare const internalRoxNumber: IRoxNumberInterface;
export declare class RoxNumber extends internalRoxNumber {
}
export {};

@@ -1,3 +0,3 @@

interface RoxStringInterface {
new (defaultValue: string, variations?: ReadonlyArray<string>): RoxStringInterface;
interface IRoxStringInterface {
new (defaultValue: string, variations?: ReadonlyArray<string>): IRoxStringInterface;
readonly name: string;

@@ -7,5 +7,5 @@ readonly defaultValue: string;

}
declare const internalRoxString: RoxStringInterface;
declare const internalRoxString: IRoxStringInterface;
export declare class RoxString extends internalRoxString {
}
export {};
interface FlagInterface {
new (defaultValue: boolean): FlagInterface;
/**
* The name of the Flag
*/
* The name of the Flag
*/
readonly name: string;
/**
* Default value of the Flag, as string: 'true' or 'false'
*/
* Default value of the Flag, as string: 'true' or 'false'
*/
readonly defaultValue: string;
/**
* Returns true when the flag is enabled
*/
* Returns true when the flag is enabled
*/
isEnabled(context?: any): boolean;

@@ -15,0 +15,0 @@ }

@@ -7,2 +7,7 @@ import { Flag } from './flag';

export { RoxNumber } from './number';
declare global {
interface Window {
rolloutData: any;
}
}
export interface RoxContainer {

@@ -63,11 +68,12 @@ [key: string]: Flag | RoxNumber | RoxString;

selfManaged?: SelfManagedOptions;
disableSignatureVerification?: boolean;
}
export interface dynamicApi {
/**
* Getting boolean value of a flag
*/
* Getting boolean value of a flag
*/
isEnabled(nameSpacedFlagName: string, defaultValue: boolean, context?: any): boolean;
/**
* Getting string value of a RoxString flag
*/
* Getting string value of a RoxString flag
*/
value(nameSpacedFlagName: string, defaultValue: string, context?: any): string;

@@ -81,28 +87,28 @@ /**

/**
* Sets an override value on a specific flag, this function accepts two parameters flag name (
* full flag name including namespace) and desired value (from type String).
* This function also saves the override value on the local device disk,
* so it is "remembered" for the next the SDK is loaded to production.
*
* https://support.rollout.io/docs/javascript-browser-api#section--rox-overrides-setoverride-
*
* Note that for boolean flag we still give the value as a string.
*/
* Sets an override value on a specific flag, this function accepts two parameters flag name (
* full flag name including namespace) and desired value (from type String).
* This function also saves the override value on the local device disk,
* so it is "remembered" for the next the SDK is loaded to production.
*
* https://support.rollout.io/docs/javascript-browser-api#section--rox-overrides-setoverride-
*
* Note that for boolean flag we still give the value as a string.
*/
setOverride(nameSpacedFlagName: string, value: string): void;
/**
* Clears the override value from the flag (and the disk).
*
* https://support.rollout.io/docs/javascript-browser-api#section--rox-overrides-clearoverride-
*/
* Clears the override value from the flag (and the disk).
*
* https://support.rollout.io/docs/javascript-browser-api#section--rox-overrides-clearoverride-
*/
clearOverride(nameSpacedFlagName: string): void;
/**
* Clears all override values
*/
* Clears all override values
*/
clearAllOverrides(): void;
getOriginalValue(nameSpacedFlagName: string): string;
/**
* full flag name including namespace
*
* https://support.rollout.io/docs/javascript-browser-api#section--rox-overrides-hasoverride-
*/
* full flag name including namespace
*
* https://support.rollout.io/docs/javascript-browser-api#section--rox-overrides-hasoverride-
*/
hasOverride(nameSpacedFlagName: string): boolean;

@@ -118,19 +124,19 @@ }

/**
* Dynamic API is an alternative to Rollout static API for defining flags on the
* different container objects and accessing them from that container object.
* https://support.rollout.io/docs/dynamic-api
*/
* Dynamic API is an alternative to Rollout static API for defining flags on the
* different container objects and accessing them from that container object.
* https://support.rollout.io/docs/dynamic-api
*/
dynamicApi: dynamicApi;
/**
* Override: Should only be used for development purposes (QA - Feature dev - e2e)
*
* When you override an existing flag value using the Rox.overrides.setOverride method,
* the SDK will disregard existing configuration coming from the dashboard and will
* serialize the override on disk this value will be loaded and override the flag
* right after you call Rox.setup. To clear the override from the cache you need to
* call the Rox.overrides.clearOverride method.
*
* One can refer to the javascript-browser-api for this feature:
* https://support.rollout.io/docs/javascript-browser-api#section--rox-overrides-
*/
* Override: Should only be used for development purposes (QA - Feature dev - e2e)
*
* When you override an existing flag value using the Rox.overrides.setOverride method,
* the SDK will disregard existing configuration coming from the dashboard and will
* serialize the override on disk this value will be loaded and override the flag
* right after you call Rox.setup. To clear the override from the cache you need to
* call the Rox.overrides.clearOverride method.
*
* One can refer to the javascript-browser-api for this feature:
* https://support.rollout.io/docs/javascript-browser-api#section--rox-overrides-
*/
overrides: overrides;

@@ -141,6 +147,6 @@ private alreadyInitialized;

/**
* The register function should be called before the call to Rox.setup()
*
* https://support.rollout.io/docs/nodejs-api#section-register
*/
* The register function should be called before the call to Rox.setup()
*
* https://support.rollout.io/docs/nodejs-api#section-register
*/
register(namespace: string, roxContainer: RoxContainer): void;

@@ -154,14 +160,14 @@ /**

/**
* Initiate connection with Rox servers for the application identified by the application key.
* The registered containers will be synced and Rox entities will get the appropriate values.
*
* https://support.rollout.io/docs/nodejs-api#section-setup
*/
* Initiate connection with Rox servers for the application identified by the application key.
* The registered containers will be synced and Rox entities will get the appropriate values.
*
* https://support.rollout.io/docs/nodejs-api#section-setup
*/
setup(apiKey: string, options?: RoxSetupOptions): Promise<void>;
/**
* Set Global Context.
* You can think of Global Context as a default context
*
* https://support.rollout.io/docs/nodejs-api#section-setcontext
*/
* Set Global Context.
* You can think of Global Context as a default context
*
* https://support.rollout.io/docs/nodejs-api#section-setcontext
*/
setContext(globalContext: any): void;

@@ -171,14 +177,16 @@ setCustomNumberProperty(name: string, value: number | ((context?: any) => number)): void;

setCustomBooleanProperty(name: string, value: boolean | ((context?: any) => boolean)): void;
setCustomDateProperty(name: string, value: Date | ((context?: any) => Date)): void;
setCustomSemverProperty(name: string, value: string | ((context?: any) => string)): void;
/**
* Pulls the latest configuration and flag values down from the Rollout servers
*
* https://support.rollout.io/docs/nodejs-api#section-fetch
*/
* Pulls the latest configuration and flag values down from the Rollout servers
*
* https://support.rollout.io/docs/nodejs-api#section-fetch
*/
fetch(): void;
/**
* Opens the flag override view, providing a debug UI for the application's set of
* feature flags.
* This is only available in a browser context
* https://support.rollout.io/docs/javascript-browser-api#section-showoverrides
*/
* Opens the flag override view, providing a debug UI for the application's set of
* feature flags.
* This is only available in a browser context
* https://support.rollout.io/docs/javascript-browser-api#section-showoverrides
*/
showOverrides(position?: RoxOverridesPosition): void;

@@ -185,0 +193,0 @@ private _configurationFetchedHandler;

@@ -13,2 +13,3 @@ "use strict";

exports.Rox = exports._RoxClient = exports.RoxOverridesPosition = exports.RoxFetcherStatus = exports.RoxNumber = exports.RoxString = exports.Flag = void 0;
/* eslint-disable @typescript-eslint/naming-convention */
const utils_1 = require("./utils");

@@ -38,19 +39,19 @@ var flag_1 = require("./flag");

/**
* Dynamic API is an alternative to Rollout static API for defining flags on the
* different container objects and accessing them from that container object.
* https://support.rollout.io/docs/dynamic-api
*/
* Dynamic API is an alternative to Rollout static API for defining flags on the
* different container objects and accessing them from that container object.
* https://support.rollout.io/docs/dynamic-api
*/
this.dynamicApi = utils_1.internalRox.dynamicApi;
/**
* Override: Should only be used for development purposes (QA - Feature dev - e2e)
*
* When you override an existing flag value using the Rox.overrides.setOverride method,
* the SDK will disregard existing configuration coming from the dashboard and will
* serialize the override on disk this value will be loaded and override the flag
* right after you call Rox.setup. To clear the override from the cache you need to
* call the Rox.overrides.clearOverride method.
*
* One can refer to the javascript-browser-api for this feature:
* https://support.rollout.io/docs/javascript-browser-api#section--rox-overrides-
*/
* Override: Should only be used for development purposes (QA - Feature dev - e2e)
*
* When you override an existing flag value using the Rox.overrides.setOverride method,
* the SDK will disregard existing configuration coming from the dashboard and will
* serialize the override on disk this value will be loaded and override the flag
* right after you call Rox.setup. To clear the override from the cache you need to
* call the Rox.overrides.clearOverride method.
*
* One can refer to the javascript-browser-api for this feature:
* https://support.rollout.io/docs/javascript-browser-api#section--rox-overrides-
*/
this.overrides = utils_1.internalRox.overrides;

@@ -66,7 +67,7 @@ // Helper boolean to check that setup() is not called more than once

/**
* Initiate connection with Rox servers for the application identified by the application key.
* The registered containers will be synced and Rox entities will get the appropriate values.
*
* https://support.rollout.io/docs/nodejs-api#section-setup
*/
* Initiate connection with Rox servers for the application identified by the application key.
* The registered containers will be synced and Rox entities will get the appropriate values.
*
* https://support.rollout.io/docs/nodejs-api#section-setup
*/
setup(apiKey, options) {

@@ -79,5 +80,8 @@ return __awaiter(this, void 0, void 0, function* () {

// @ts-ignore
if (utils_1.isBrowser() && window && window.rolloutData) {
if ((0, utils_1.isBrowser)() && window && window.rolloutData) {
// @ts-ignore
Object.assign(_options, options, { embedded: window.rolloutData, disableNetworkFetch: true });
Object.assign(_options, options, {
embedded: window.rolloutData,
disableNetworkFetch: true,
});
if (_options.disablePushUpdateListener !== false) {

@@ -99,7 +103,7 @@ _options.disablePushUpdateListener = true;

/**
* Set Global Context.
* You can think of Global Context as a default context
*
* https://support.rollout.io/docs/nodejs-api#section-setcontext
*/
* Set Global Context.
* You can think of Global Context as a default context
*
* https://support.rollout.io/docs/nodejs-api#section-setcontext
*/
setContext(globalContext) {

@@ -117,7 +121,13 @@ utils_1.internalRox.setContext(globalContext);

}
setCustomDateProperty(name, value) {
utils_1.internalRox.setCustomDateProperty(name, value);
}
setCustomSemverProperty(name, value) {
utils_1.internalRox.setCustomSemverProperty(name, value);
}
/**
* Pulls the latest configuration and flag values down from the Rollout servers
*
* https://support.rollout.io/docs/nodejs-api#section-fetch
*/
* Pulls the latest configuration and flag values down from the Rollout servers
*
* https://support.rollout.io/docs/nodejs-api#section-fetch
*/
fetch() {

@@ -127,9 +137,9 @@ utils_1.internalRox.fetch();

/**
* Opens the flag override view, providing a debug UI for the application's set of
* feature flags.
* This is only available in a browser context
* https://support.rollout.io/docs/javascript-browser-api#section-showoverrides
*/
* Opens the flag override view, providing a debug UI for the application's set of
* feature flags.
* This is only available in a browser context
* https://support.rollout.io/docs/javascript-browser-api#section-showoverrides
*/
showOverrides(position) {
if (utils_1.isBrowser()) {
if ((0, utils_1.isBrowser)()) {
utils_1.internalRox.showOverrides(position);

@@ -141,2 +151,3 @@ return;

_configurationFetchedHandler() {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const roxClient = this;

@@ -143,0 +154,0 @@ return (fetcherResults) => {

@@ -1,19 +0,19 @@

interface RoxNumberInterface {
new (defaultValue: number, variations?: ReadonlyArray<number>): RoxNumberInterface;
interface IRoxNumberInterface {
new (defaultValue: number, variations?: ReadonlyArray<number>): IRoxNumberInterface;
/**
* The name of the Flag
*/
* The name of the Flag
*/
readonly name: string;
/**
* Default value of the Flag, as string: 'true' or 'false'
*/
* Default value of the Flag, as string: 'true' or 'false'
*/
readonly defaultValue: number;
/**
* Returns true when the flag is enabled
*/
* Returns true when the flag is enabled
*/
getValue(context?: any): number;
}
declare const internalRoxNumber: RoxNumberInterface;
declare const internalRoxNumber: IRoxNumberInterface;
export declare class RoxNumber extends internalRoxNumber {
}
export {};

@@ -1,10 +0,10 @@

interface RoxStringInterface {
new (defaultValue: string, variations?: ReadonlyArray<string>): RoxStringInterface;
interface IRoxStringInterface {
new (defaultValue: string, variations?: ReadonlyArray<string>): IRoxStringInterface;
/**
* The name of the string
*/
* The name of the string
*/
readonly name: string;
/**
* Default value of the string
*/
* Default value of the string
*/
readonly defaultValue: string;

@@ -16,3 +16,3 @@ /**

}
declare const internalRoxString: RoxStringInterface;
declare const internalRoxString: IRoxStringInterface;
/**

@@ -19,0 +19,0 @@ * Used to create and manage Rollout feature flags that determine different predefined values

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

let Rox;
if (0 /* Current */ === 1 /* Browser */) {
if (0 /* Target.Current */ === 1 /* Target.Browser */) {
Rox = require('rox-browser'); // eslint-disable-line global-require

@@ -8,0 +8,0 @@ }

{
"name": "rox-ssr",
"version": "5.4.11",
"version": "5.4.12",
"description": "Rollout.io ROX JS SDK Client for SSR",

@@ -37,3 +37,3 @@ "author": "Rollout.io <support@rollout.io>",

"build-es6": "tsc",
"lint": "eslint . --ext .js,.ts",
"lint": "eslint . --ext .js,.ts --fix",
"prepublishOnly": "yarn run build",

@@ -47,17 +47,10 @@ "test": "jest --no-watchman --testPathPattern ./src/**",

"dependencies": {
"rox-browser": "^5.4.11",
"rox-node": "^5.4.11"
"rox-browser": "^5.4.12",
"rox-node": "^5.4.12"
},
"devDependencies": {
"@types/jest": "^24.0.23",
"@types/node": "^14.14.35",
"@typescript-eslint/eslint-plugin": "^2.21.0",
"@typescript-eslint/parser": "^2.21.0",
"eslint": "^6.8.0",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-config-airbnb-typescript": "^6.3.0",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.18.3",
"ts-jest": "^24.2.0",
"@cloudbees/eslint-plugin": "cloudbees/eslint-plugin",
"@types/jest": "^27.0.3",
"@types/node": "^18.0.3",
"ts-jest": "^27.1.2",
"typescript": "^4.2.3"

@@ -70,14 +63,7 @@ },

"jest": {
"transform": {
".(ts|tsx)": "ts-jest"
},
"preset": "ts-jest/presets/js-with-ts",
"testURL": "http://localhost/",
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
"moduleFileExtensions": [
"ts",
"tsx",
"js"
]
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$"
},
"gitHead": "4ca2027ed19ba4192c7bd507971d8e697011ad89"
"gitHead": "75b020764a4eda65eda370487e24c941e5ac2937"
}
![Rollout](https://1ko9923xosh2dsbjsxpwqp45-wpengine.netdna-ssl.com/wp-content/themes/rollout/images/rollout_white_logo1.png)
Rollout is a Secure Feature Managment Solution for the Enterprise.
CloudBees Feature Management is a secure feature management solution for the enterprise.

@@ -9,3 +9,3 @@ > Accelerate development and minimize the risk of deploying new code with simple to create feature flags, controlled rollouts, advanced target groups & deployment rules.

Please see the detailed instructions in our docs how to [add Rollout to your project](https://support.rollout.io/docs/installing-the-sdk).
Please see the detailed instructions in our docs on how to [add CloudBees Feature Management to your project](https://support.rollout.io/docs/installing-the-sdk).

@@ -12,0 +12,0 @@ ## Documentation

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