@luvio/environments 0.73.5 → 0.73.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { DurableStore } from './DurableStore';
1
+ import type { DurableStore } from './DurableStore';
2
2
  export declare const TTL_DURABLE_SEGMENT = "TTL_DURABLE_SEGMENT";
3
3
  export interface DefaultDurableTTLOverride extends DurableTTLOverride {
4
4
  namespace: 'TTL_DEFAULT_KEY';
@@ -713,6 +713,16 @@ function makeDurable(environment, { durableStore, instrumentation }) {
713
713
  return snapshotFromMemoryIngest;
714
714
  });
715
715
  };
716
+ const getNotifyChangeStoreEntries = function (keys) {
717
+ validateNotDisposed();
718
+ return durableStore.getEntries(keys, DefaultDurableSegment).then((durableRecords) => {
719
+ const entries = {};
720
+ publishDurableStoreEntries(durableRecords, (key, record) => {
721
+ entries[key] = record;
722
+ }, () => { });
723
+ return entries;
724
+ });
725
+ };
716
726
  environment.defaultCachePolicy = buildStaleWhileRevalidateImplementation(Number.MAX_SAFE_INTEGER);
717
727
  return create(environment, {
718
728
  publishStoreMetadata: { value: publishStoreMetadata },
@@ -737,6 +747,7 @@ function makeDurable(environment, { durableStore, instrumentation }) {
737
747
  getIngestStagingStoreMetadata: { value: getIngestStagingStoreMetadata },
738
748
  handleSuccessResponse: { value: handleSuccessResponse },
739
749
  handleErrorResponse: { value: handleErrorResponse },
750
+ getNotifyChangeStoreEntries: { value: getNotifyChangeStoreEntries },
740
751
  });
741
752
  }
742
753
 
@@ -1,4 +1,4 @@
1
- import { Luvio } from '@luvio/engine';
1
+ import type { Luvio } from '@luvio/engine';
2
2
  export declare const DURABLE_STORE_ERROR = "durable-store-error";
3
3
  export declare type InstrumentationFunction = Luvio['instrument'];
4
4
  export declare type DurableStoreRejectionHandler = (e: any) => void;
@@ -1,4 +1,4 @@
1
- import { Store } from '@luvio/engine';
2
- import { DurableStore } from '../DurableStore';
3
- import { DurableStoreRejectionHandler } from './error';
1
+ import type { Store } from '@luvio/engine';
2
+ import type { DurableStore } from '../DurableStore';
3
+ import type { DurableStoreRejectionHandler } from './error';
4
4
  export declare function flushStoreValuesToDurableStore(store: Store, durableStore: DurableStore, durableStoreErrorHandler: DurableStoreRejectionHandler): Promise<void>;
@@ -1,6 +1,6 @@
1
- import { Environment, Snapshot, UnAvailableSnapshot, StoreMetadata } from '@luvio/engine';
2
- import { DurableStore, DurableStoreEntries } from '../DurableStore';
3
- import { DurableStoreRejectionHandler } from './error';
1
+ import type { Environment, Snapshot, UnAvailableSnapshot, StoreMetadata } from '@luvio/engine';
2
+ import type { DurableStore, DurableStoreEntries } from '../DurableStore';
3
+ import type { DurableStoreRejectionHandler } from './error';
4
4
  declare type ObjectAsSet = {
5
5
  [key: string]: true;
6
6
  };
@@ -1,2 +1,2 @@
1
- import { StoreRecordError } from '@luvio/engine';
1
+ import type { StoreRecordError } from '@luvio/engine';
2
2
  export declare function isStoreEntryError(storeRecord: unknown): storeRecord is StoreRecordError;
@@ -1,7 +1,8 @@
1
- import { CacheKeySet, Environment, RecordSource, Snapshot, Store } from '@luvio/engine';
2
- import { DurableStore } from './DurableStore';
3
- import { InstrumentationFunction } from './makeDurable/error';
4
- import { TTLOverridesMap } from './DurableTTLStore';
1
+ import type { CacheKeySet, Environment, RecordSource, Snapshot } from '@luvio/engine';
2
+ import { Store } from '@luvio/engine';
3
+ import type { DurableStore } from './DurableStore';
4
+ import type { InstrumentationFunction } from './makeDurable/error';
5
+ import type { TTLOverridesMap } from './DurableTTLStore';
5
6
  export interface DurableEnvironment extends Environment {
6
7
  /**
7
8
  * Disposes the environment and detaches the durable store listener
@@ -1,2 +1,2 @@
1
- import { Selector } from '@luvio/engine';
1
+ import type { Selector } from '@luvio/engine';
2
2
  export declare function readPaginationKeysFromSelector(select?: Selector<unknown>): string[];
@@ -1,4 +1,4 @@
1
- import { DurableStore } from './DurableStore';
1
+ import type { DurableStore } from './DurableStore';
2
2
  export declare const TTL_DURABLE_SEGMENT = "TTL_DURABLE_SEGMENT";
3
3
  export interface DefaultDurableTTLOverride extends DurableTTLOverride {
4
4
  namespace: 'TTL_DEFAULT_KEY';
@@ -717,6 +717,16 @@
717
717
  return snapshotFromMemoryIngest;
718
718
  });
719
719
  };
720
+ const getNotifyChangeStoreEntries = function (keys) {
721
+ validateNotDisposed();
722
+ return durableStore.getEntries(keys, DefaultDurableSegment).then((durableRecords) => {
723
+ const entries = {};
724
+ publishDurableStoreEntries(durableRecords, (key, record) => {
725
+ entries[key] = record;
726
+ }, () => { });
727
+ return entries;
728
+ });
729
+ };
720
730
  environment.defaultCachePolicy = engine.buildStaleWhileRevalidateImplementation(Number.MAX_SAFE_INTEGER);
721
731
  return create(environment, {
722
732
  publishStoreMetadata: { value: publishStoreMetadata },
@@ -741,6 +751,7 @@
741
751
  getIngestStagingStoreMetadata: { value: getIngestStagingStoreMetadata },
742
752
  handleSuccessResponse: { value: handleSuccessResponse },
743
753
  handleErrorResponse: { value: handleErrorResponse },
754
+ getNotifyChangeStoreEntries: { value: getNotifyChangeStoreEntries },
744
755
  });
745
756
  }
746
757
 
@@ -1,4 +1,4 @@
1
- import { Luvio } from '@luvio/engine';
1
+ import type { Luvio } from '@luvio/engine';
2
2
  export declare const DURABLE_STORE_ERROR = "durable-store-error";
3
3
  export declare type InstrumentationFunction = Luvio['instrument'];
4
4
  export declare type DurableStoreRejectionHandler = (e: any) => void;
@@ -1,4 +1,4 @@
1
- import { Store } from '@luvio/engine';
2
- import { DurableStore } from '../DurableStore';
3
- import { DurableStoreRejectionHandler } from './error';
1
+ import type { Store } from '@luvio/engine';
2
+ import type { DurableStore } from '../DurableStore';
3
+ import type { DurableStoreRejectionHandler } from './error';
4
4
  export declare function flushStoreValuesToDurableStore(store: Store, durableStore: DurableStore, durableStoreErrorHandler: DurableStoreRejectionHandler): Promise<void>;
@@ -1,6 +1,6 @@
1
- import { Environment, Snapshot, UnAvailableSnapshot, StoreMetadata } from '@luvio/engine';
2
- import { DurableStore, DurableStoreEntries } from '../DurableStore';
3
- import { DurableStoreRejectionHandler } from './error';
1
+ import type { Environment, Snapshot, UnAvailableSnapshot, StoreMetadata } from '@luvio/engine';
2
+ import type { DurableStore, DurableStoreEntries } from '../DurableStore';
3
+ import type { DurableStoreRejectionHandler } from './error';
4
4
  declare type ObjectAsSet = {
5
5
  [key: string]: true;
6
6
  };
@@ -1,2 +1,2 @@
1
- import { StoreRecordError } from '@luvio/engine';
1
+ import type { StoreRecordError } from '@luvio/engine';
2
2
  export declare function isStoreEntryError(storeRecord: unknown): storeRecord is StoreRecordError;
@@ -1,7 +1,8 @@
1
- import { CacheKeySet, Environment, RecordSource, Snapshot, Store } from '@luvio/engine';
2
- import { DurableStore } from './DurableStore';
3
- import { InstrumentationFunction } from './makeDurable/error';
4
- import { TTLOverridesMap } from './DurableTTLStore';
1
+ import type { CacheKeySet, Environment, RecordSource, Snapshot } from '@luvio/engine';
2
+ import { Store } from '@luvio/engine';
3
+ import type { DurableStore } from './DurableStore';
4
+ import type { InstrumentationFunction } from './makeDurable/error';
5
+ import type { TTLOverridesMap } from './DurableTTLStore';
5
6
  export interface DurableEnvironment extends Environment {
6
7
  /**
7
8
  * Disposes the environment and detaches the durable store listener
@@ -1,2 +1,2 @@
1
- import { Selector } from '@luvio/engine';
1
+ import type { Selector } from '@luvio/engine';
2
2
  export declare function readPaginationKeysFromSelector(select?: Selector<unknown>): string[];
@@ -1,4 +1,4 @@
1
- import { DurableStore } from './DurableStore';
1
+ import type { DurableStore } from './DurableStore';
2
2
  export declare const TTL_DURABLE_SEGMENT = "TTL_DURABLE_SEGMENT";
3
3
  export interface DefaultDurableTTLOverride extends DurableTTLOverride {
4
4
  namespace: 'TTL_DEFAULT_KEY';
@@ -756,6 +756,16 @@
756
756
  return snapshotFromMemoryIngest;
757
757
  });
758
758
  };
759
+ var getNotifyChangeStoreEntries = function (keys) {
760
+ validateNotDisposed();
761
+ return durableStore.getEntries(keys, DefaultDurableSegment).then(function (durableRecords) {
762
+ var entries = {};
763
+ publishDurableStoreEntries(durableRecords, function (key, record) {
764
+ entries[key] = record;
765
+ }, function () { });
766
+ return entries;
767
+ });
768
+ };
759
769
  environment.defaultCachePolicy = engine.buildStaleWhileRevalidateImplementation(Number.MAX_SAFE_INTEGER);
760
770
  return create(environment, {
761
771
  publishStoreMetadata: { value: publishStoreMetadata },
@@ -780,6 +790,7 @@
780
790
  getIngestStagingStoreMetadata: { value: getIngestStagingStoreMetadata },
781
791
  handleSuccessResponse: { value: handleSuccessResponse },
782
792
  handleErrorResponse: { value: handleErrorResponse },
793
+ getNotifyChangeStoreEntries: { value: getNotifyChangeStoreEntries },
783
794
  });
784
795
  }
785
796
 
@@ -1,4 +1,4 @@
1
- import { Luvio } from '@luvio/engine';
1
+ import type { Luvio } from '@luvio/engine';
2
2
  export declare const DURABLE_STORE_ERROR = "durable-store-error";
3
3
  export declare type InstrumentationFunction = Luvio['instrument'];
4
4
  export declare type DurableStoreRejectionHandler = (e: any) => void;
@@ -1,4 +1,4 @@
1
- import { Store } from '@luvio/engine';
2
- import { DurableStore } from '../DurableStore';
3
- import { DurableStoreRejectionHandler } from './error';
1
+ import type { Store } from '@luvio/engine';
2
+ import type { DurableStore } from '../DurableStore';
3
+ import type { DurableStoreRejectionHandler } from './error';
4
4
  export declare function flushStoreValuesToDurableStore(store: Store, durableStore: DurableStore, durableStoreErrorHandler: DurableStoreRejectionHandler): Promise<void>;
@@ -1,6 +1,6 @@
1
- import { Environment, Snapshot, UnAvailableSnapshot, StoreMetadata } from '@luvio/engine';
2
- import { DurableStore, DurableStoreEntries } from '../DurableStore';
3
- import { DurableStoreRejectionHandler } from './error';
1
+ import type { Environment, Snapshot, UnAvailableSnapshot, StoreMetadata } from '@luvio/engine';
2
+ import type { DurableStore, DurableStoreEntries } from '../DurableStore';
3
+ import type { DurableStoreRejectionHandler } from './error';
4
4
  declare type ObjectAsSet = {
5
5
  [key: string]: true;
6
6
  };
@@ -1,2 +1,2 @@
1
- import { StoreRecordError } from '@luvio/engine';
1
+ import type { StoreRecordError } from '@luvio/engine';
2
2
  export declare function isStoreEntryError(storeRecord: unknown): storeRecord is StoreRecordError;
@@ -1,7 +1,8 @@
1
- import { CacheKeySet, Environment, RecordSource, Snapshot, Store } from '@luvio/engine';
2
- import { DurableStore } from './DurableStore';
3
- import { InstrumentationFunction } from './makeDurable/error';
4
- import { TTLOverridesMap } from './DurableTTLStore';
1
+ import type { CacheKeySet, Environment, RecordSource, Snapshot } from '@luvio/engine';
2
+ import { Store } from '@luvio/engine';
3
+ import type { DurableStore } from './DurableStore';
4
+ import type { InstrumentationFunction } from './makeDurable/error';
5
+ import type { TTLOverridesMap } from './DurableTTLStore';
5
6
  export interface DurableEnvironment extends Environment {
6
7
  /**
7
8
  * Disposes the environment and detaches the durable store listener
@@ -1,2 +1,2 @@
1
- import { Selector } from '@luvio/engine';
1
+ import type { Selector } from '@luvio/engine';
2
2
  export declare function readPaginationKeysFromSelector(select?: Selector<unknown>): string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luvio/environments",
3
- "version": "0.73.5",
3
+ "version": "0.73.6",
4
4
  "description": "Luvio Environments",
5
5
  "main": "dist/umd/es2018/environments.js",
6
6
  "module": "dist/es/es2018/environments.js",
@@ -11,7 +11,8 @@
11
11
  "build": "rollup --config rollup.config.js",
12
12
  "watch": "yarn build --watch",
13
13
  "test": "jest",
14
- "test:debug": "node --inspect-brk ../../../node_modules/jest/bin/jest.js --config ./jest.config.js --runInBand"
14
+ "test:debug": "node --inspect-brk ../../../node_modules/jest/bin/jest.js --config ./jest.config.js --runInBand",
15
+ "test:size": "bundlesize"
15
16
  },
16
17
  "nx": {
17
18
  "targets": {
@@ -26,6 +27,13 @@
26
27
  "dist/"
27
28
  ],
28
29
  "dependencies": {
29
- "@luvio/engine": "0.73.5"
30
- }
30
+ "@luvio/engine": "0.73.6"
31
+ },
32
+ "bundlesize": [
33
+ {
34
+ "path": "./dist/es/es2018/environments.js",
35
+ "maxSize": "9 kB",
36
+ "compression": "brotli"
37
+ }
38
+ ]
31
39
  }