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

@feature-hub/history-service

Package Overview
Dependencies
Maintainers
5
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@feature-hub/history-service - npm Package Compare versions

Comparing version 3.1.0 to 3.2.0

16

CHANGELOG.md

@@ -6,2 +6,18 @@ # Change Log

# [3.2.0](https://github.com/sinnerschrader/feature-hub/compare/v3.1.0...v3.2.0) (2023-01-20)
### Bug Fixes
* **history-service:** only declare `GetHistoryKeyOptions` once ([4b97a73](https://github.com/sinnerschrader/feature-hub/commit/4b97a738dd23bb264a1632462f4545004d862d23))
### Features
* **history-service:** add support for `getHistoryKey` option to v1 and v2 ([d43ba57](https://github.com/sinnerschrader/feature-hub/commit/d43ba5712274822c5d23dce907701185414cc534))
# [3.1.0](https://github.com/sinnerschrader/feature-hub/compare/v3.0.1...v3.1.0) (2023-01-20)

@@ -8,0 +24,0 @@

9

lib/cjs/index.js

@@ -38,4 +38,9 @@ "use strict";

return {
'1.0.0': (0, create_history_service_v1_binder_1.createHistoryServiceV1Binder)(context, historyMultiplexers),
'2.0.0': (0, create_history_service_v2_binder_1.createHistoryServiceV2Binder)(context, historyMultiplexers, mode),
'1.0.0': (0, create_history_service_v1_binder_1.createHistoryServiceV1Binder)(context, historyMultiplexers, {
getHistoryKey,
}),
'2.0.0': (0, create_history_service_v2_binder_1.createHistoryServiceV2Binder)(context, historyMultiplexers, {
mode,
getHistoryKey,
}),
'3.0.0': (0, create_history_service_v3_binder_1.createHistoryServiceV3Binder)(context, historyMultiplexers, {

@@ -42,0 +47,0 @@ mode,

import { FeatureServiceBinder } from '@feature-hub/core';
import { HistoryServiceV1 } from '..';
import { HistoryMultiplexers } from './create-history-multiplexers';
import { GetHistoryKeyOptions } from './create-history-service-v3-binder';
import { HistoryServiceContext } from './history-service-context';
export declare function createHistoryServiceV1Binder(context: HistoryServiceContext, historyMultiplexers: HistoryMultiplexers): FeatureServiceBinder<HistoryServiceV1>;
export interface CreateHistoryServiceV1BinderOptions {
readonly getHistoryKey: (options: GetHistoryKeyOptions) => string;
}
export declare function createHistoryServiceV1Binder(context: HistoryServiceContext, historyMultiplexers: HistoryMultiplexers, options: CreateHistoryServiceV1BinderOptions): FeatureServiceBinder<HistoryServiceV1>;
//# sourceMappingURL=create-history-service-v1-binder.d.ts.map

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

const static_consumer_history_1 = require("./static-consumer-history");
function createHistoryServiceV1Binder(context, historyMultiplexers) {
return (consumerId) => {
function createHistoryServiceV1Binder(context, historyMultiplexers, options) {
const { getHistoryKey } = options;
return (consumerId, consumerName) => {
const historyKey = getHistoryKey({ consumerId, consumerName });
let browserConsumerHistoryDestroy = () => undefined;

@@ -19,3 +21,3 @@ let browserConsumerHistory;

else {
const browserConsumerHistoryV5 = new browser_consumer_history_1.BrowserConsumerHistory(context, consumerId, historyMultiplexers.browserHistoryMultiplexer);
const browserConsumerHistoryV5 = new browser_consumer_history_1.BrowserConsumerHistory(context, historyKey, historyMultiplexers.browserHistoryMultiplexer);
browserConsumerHistoryDestroy = () => browserConsumerHistoryV5.destroy();

@@ -31,3 +33,3 @@ browserConsumerHistory = (0, create_history_v4_adapter_1.createHistoryV4Adapter)(context, browserConsumerHistoryV5);

else {
staticConsumerHistory = (0, create_history_v4_adapter_1.createHistoryV4Adapter)(context, new static_consumer_history_1.StaticConsumerHistory(context, consumerId, historyMultiplexers.staticHistoryMultiplexer));
staticConsumerHistory = (0, create_history_v4_adapter_1.createHistoryV4Adapter)(context, new static_consumer_history_1.StaticConsumerHistory(context, historyKey, historyMultiplexers.staticHistoryMultiplexer));
}

@@ -34,0 +36,0 @@ return staticConsumerHistory;

import { FeatureServiceBinder } from '@feature-hub/core';
import { HistoryServiceV2 } from '..';
import { HistoryMultiplexers } from './create-history-multiplexers';
import { GetHistoryKeyOptions } from './create-history-service-v3-binder';
import { HistoryServiceContext } from './history-service-context';
export declare function createHistoryServiceV2Binder(context: HistoryServiceContext, historyMultiplexers: HistoryMultiplexers, mode: 'browser' | 'static'): FeatureServiceBinder<HistoryServiceV2>;
export interface CreateHistoryServiceV2BinderOptions {
readonly mode: 'browser' | 'static';
readonly getHistoryKey: (options: GetHistoryKeyOptions) => string;
}
export declare function createHistoryServiceV2Binder(context: HistoryServiceContext, historyMultiplexers: HistoryMultiplexers, options: CreateHistoryServiceV2BinderOptions): FeatureServiceBinder<HistoryServiceV2>;
//# sourceMappingURL=create-history-service-v2-binder.d.ts.map

@@ -19,6 +19,6 @@ "use strict";

}
function createBrowserHistoryServiceV2Binding(context, historyMultiplexers, consumerId) {
const consumerHistory = new browser_consumer_history_1.BrowserConsumerHistory(context, consumerId, historyMultiplexers.browserHistoryMultiplexer);
function createBrowserHistoryServiceV2Binding(context, historyMultiplexers, historyKey) {
const consumerHistory = new browser_consumer_history_1.BrowserConsumerHistory(context, historyKey, historyMultiplexers.browserHistoryMultiplexer);
return {
featureService: createHistoryServiceV2(context, consumerId, consumerHistory, historyMultiplexers.browserHistoryMultiplexer),
featureService: createHistoryServiceV2(context, historyKey, consumerHistory, historyMultiplexers.browserHistoryMultiplexer),
unbind: () => {

@@ -29,14 +29,18 @@ consumerHistory.destroy();

}
function createStaticHistoryServiceV2Binding(context, historyMultiplexers, consumerId) {
const consumerHistory = new static_consumer_history_1.StaticConsumerHistory(context, consumerId, historyMultiplexers.staticHistoryMultiplexer);
function createStaticHistoryServiceV2Binding(context, historyMultiplexers, historyKey) {
const consumerHistory = new static_consumer_history_1.StaticConsumerHistory(context, historyKey, historyMultiplexers.staticHistoryMultiplexer);
return {
featureService: createHistoryServiceV2(context, consumerId, consumerHistory, historyMultiplexers.staticHistoryMultiplexer),
featureService: createHistoryServiceV2(context, historyKey, consumerHistory, historyMultiplexers.staticHistoryMultiplexer),
};
}
function createHistoryServiceV2Binder(context, historyMultiplexers, mode) {
return (consumerId) => mode === 'browser'
? createBrowserHistoryServiceV2Binding(context, historyMultiplexers, consumerId)
: createStaticHistoryServiceV2Binding(context, historyMultiplexers, consumerId);
function createHistoryServiceV2Binder(context, historyMultiplexers, options) {
const { mode, getHistoryKey } = options;
return (consumerId, consumerName) => {
const historyKey = getHistoryKey({ consumerId, consumerName });
return mode === 'browser'
? createBrowserHistoryServiceV2Binding(context, historyMultiplexers, historyKey)
: createStaticHistoryServiceV2Binding(context, historyMultiplexers, historyKey);
};
}
exports.createHistoryServiceV2Binder = createHistoryServiceV2Binder;
//# sourceMappingURL=create-history-service-v2-binder.js.map

@@ -21,4 +21,9 @@ import { createHistoryMultiplexers } from './internal/create-history-multiplexers';

return {
'1.0.0': createHistoryServiceV1Binder(context, historyMultiplexers),
'2.0.0': createHistoryServiceV2Binder(context, historyMultiplexers, mode),
'1.0.0': createHistoryServiceV1Binder(context, historyMultiplexers, {
getHistoryKey,
}),
'2.0.0': createHistoryServiceV2Binder(context, historyMultiplexers, {
mode,
getHistoryKey,
}),
'3.0.0': createHistoryServiceV3Binder(context, historyMultiplexers, {

@@ -25,0 +30,0 @@ mode,

import { FeatureServiceBinder } from '@feature-hub/core';
import { HistoryServiceV1 } from '..';
import { HistoryMultiplexers } from './create-history-multiplexers';
import { GetHistoryKeyOptions } from './create-history-service-v3-binder';
import { HistoryServiceContext } from './history-service-context';
export declare function createHistoryServiceV1Binder(context: HistoryServiceContext, historyMultiplexers: HistoryMultiplexers): FeatureServiceBinder<HistoryServiceV1>;
export interface CreateHistoryServiceV1BinderOptions {
readonly getHistoryKey: (options: GetHistoryKeyOptions) => string;
}
export declare function createHistoryServiceV1Binder(context: HistoryServiceContext, historyMultiplexers: HistoryMultiplexers, options: CreateHistoryServiceV1BinderOptions): FeatureServiceBinder<HistoryServiceV1>;
//# sourceMappingURL=create-history-service-v1-binder.d.ts.map
import { BrowserConsumerHistory } from './browser-consumer-history';
import { createHistoryV4Adapter } from './create-history-v4-adapter';
import { StaticConsumerHistory } from './static-consumer-history';
export function createHistoryServiceV1Binder(context, historyMultiplexers) {
return (consumerId) => {
export function createHistoryServiceV1Binder(context, historyMultiplexers, options) {
const { getHistoryKey } = options;
return (consumerId, consumerName) => {
const historyKey = getHistoryKey({ consumerId, consumerName });
let browserConsumerHistoryDestroy = () => undefined;

@@ -15,3 +17,3 @@ let browserConsumerHistory;

else {
const browserConsumerHistoryV5 = new BrowserConsumerHistory(context, consumerId, historyMultiplexers.browserHistoryMultiplexer);
const browserConsumerHistoryV5 = new BrowserConsumerHistory(context, historyKey, historyMultiplexers.browserHistoryMultiplexer);
browserConsumerHistoryDestroy = () => browserConsumerHistoryV5.destroy();

@@ -27,3 +29,3 @@ browserConsumerHistory = createHistoryV4Adapter(context, browserConsumerHistoryV5);

else {
staticConsumerHistory = createHistoryV4Adapter(context, new StaticConsumerHistory(context, consumerId, historyMultiplexers.staticHistoryMultiplexer));
staticConsumerHistory = createHistoryV4Adapter(context, new StaticConsumerHistory(context, historyKey, historyMultiplexers.staticHistoryMultiplexer));
}

@@ -30,0 +32,0 @@ return staticConsumerHistory;

import { FeatureServiceBinder } from '@feature-hub/core';
import { HistoryServiceV2 } from '..';
import { HistoryMultiplexers } from './create-history-multiplexers';
import { GetHistoryKeyOptions } from './create-history-service-v3-binder';
import { HistoryServiceContext } from './history-service-context';
export declare function createHistoryServiceV2Binder(context: HistoryServiceContext, historyMultiplexers: HistoryMultiplexers, mode: 'browser' | 'static'): FeatureServiceBinder<HistoryServiceV2>;
export interface CreateHistoryServiceV2BinderOptions {
readonly mode: 'browser' | 'static';
readonly getHistoryKey: (options: GetHistoryKeyOptions) => string;
}
export declare function createHistoryServiceV2Binder(context: HistoryServiceContext, historyMultiplexers: HistoryMultiplexers, options: CreateHistoryServiceV2BinderOptions): FeatureServiceBinder<HistoryServiceV2>;
//# sourceMappingURL=create-history-service-v2-binder.d.ts.map

@@ -16,6 +16,6 @@ import { BrowserConsumerHistory } from './browser-consumer-history';

}
function createBrowserHistoryServiceV2Binding(context, historyMultiplexers, consumerId) {
const consumerHistory = new BrowserConsumerHistory(context, consumerId, historyMultiplexers.browserHistoryMultiplexer);
function createBrowserHistoryServiceV2Binding(context, historyMultiplexers, historyKey) {
const consumerHistory = new BrowserConsumerHistory(context, historyKey, historyMultiplexers.browserHistoryMultiplexer);
return {
featureService: createHistoryServiceV2(context, consumerId, consumerHistory, historyMultiplexers.browserHistoryMultiplexer),
featureService: createHistoryServiceV2(context, historyKey, consumerHistory, historyMultiplexers.browserHistoryMultiplexer),
unbind: () => {

@@ -26,13 +26,17 @@ consumerHistory.destroy();

}
function createStaticHistoryServiceV2Binding(context, historyMultiplexers, consumerId) {
const consumerHistory = new StaticConsumerHistory(context, consumerId, historyMultiplexers.staticHistoryMultiplexer);
function createStaticHistoryServiceV2Binding(context, historyMultiplexers, historyKey) {
const consumerHistory = new StaticConsumerHistory(context, historyKey, historyMultiplexers.staticHistoryMultiplexer);
return {
featureService: createHistoryServiceV2(context, consumerId, consumerHistory, historyMultiplexers.staticHistoryMultiplexer),
featureService: createHistoryServiceV2(context, historyKey, consumerHistory, historyMultiplexers.staticHistoryMultiplexer),
};
}
export function createHistoryServiceV2Binder(context, historyMultiplexers, mode) {
return (consumerId) => mode === 'browser'
? createBrowserHistoryServiceV2Binding(context, historyMultiplexers, consumerId)
: createStaticHistoryServiceV2Binding(context, historyMultiplexers, consumerId);
export function createHistoryServiceV2Binder(context, historyMultiplexers, options) {
const { mode, getHistoryKey } = options;
return (consumerId, consumerName) => {
const historyKey = getHistoryKey({ consumerId, consumerName });
return mode === 'browser'
? createBrowserHistoryServiceV2Binding(context, historyMultiplexers, historyKey)
: createStaticHistoryServiceV2Binding(context, historyMultiplexers, historyKey);
};
}
//# sourceMappingURL=create-history-service-v2-binder.js.map
{
"name": "@feature-hub/history-service",
"version": "3.1.0",
"version": "3.2.0",
"description": "A history facade guaranteeing safe access for multiple consumers.",

@@ -44,3 +44,3 @@ "homepage": "https://feature-hub.io/",

},
"gitHead": "b4ff519c5df67e168b580e9a1cc77f246b7fa9e9"
"gitHead": "7310e0771ed2810df0d4befe595031f45d510a4c"
}

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

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

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

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

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