@luvio/environments 0.67.0 → 0.68.0

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.
@@ -821,15 +821,15 @@ function makeDurable(environment, { durableStore, instrumentation }) {
821
821
  ingestStagingStore = null;
822
822
  return promise;
823
823
  };
824
- const storeLookup = function (sel, createSnapshot, refresh) {
824
+ const storeLookup = function (sel, createSnapshot, refresh, ttlStrategy) {
825
825
  validateNotDisposed();
826
826
  // if this lookup is right after an ingest there will be a staging store
827
827
  if (ingestStagingStore !== null) {
828
- return ingestStagingStore.lookup(sel, createSnapshot, refresh);
828
+ return ingestStagingStore.lookup(sel, createSnapshot, refresh, ttlStrategy);
829
829
  }
830
830
  // otherwise this is from buildInMemorySnapshot and we should use the luvio
831
831
  // L1 store
832
- return environment.storeLookup(sel, createSnapshot, refresh);
832
+ return environment.storeLookup(sel, createSnapshot, refresh, ttlStrategy);
833
833
  };
834
834
  const storeEvict = function (key) {
835
835
  validateNotDisposed();
@@ -1029,6 +1029,9 @@ function makeDurable(environment, { durableStore, instrumentation }) {
1029
1029
  ingestStagingStore.records = existingRecords;
1030
1030
  }
1031
1031
  const snapshotFromMemoryIngest = ingestAndBroadcastFunc();
1032
+ if (snapshotFromMemoryIngest === undefined) {
1033
+ return undefined;
1034
+ }
1032
1035
  if (snapshotFromMemoryIngest.state !== 'Unfulfilled') {
1033
1036
  return snapshotFromMemoryIngest;
1034
1037
  }
@@ -30,7 +30,7 @@ export interface DurableEnvironment extends Environment {
30
30
  * RecordSource to "prime" the ingest staging store with before calling
31
31
  * ingest. Useful for merge-able record types
32
32
  */
33
- handleSuccessResponse<ResponseType>(ingestAndBroadcastFunc: () => Snapshot<ResponseType>, getResponseCacheKeysFunc: () => CacheKeySet, existingRecords?: RecordSource): Snapshot<ResponseType> | Promise<Snapshot<ResponseType>>;
33
+ handleSuccessResponse<IngestionReturnType extends Snapshot<D, V> | undefined, D, V = unknown>(ingestAndBroadcastFunc: () => IngestionReturnType, getResponseCacheKeysFunc: () => CacheKeySet, existingRecords?: RecordSource): IngestionReturnType | Promise<IngestionReturnType>;
34
34
  }
35
35
  export declare const AdapterContextSegment = "ADAPTER-CONTEXT";
36
36
  export declare const ADAPTER_CONTEXT_ID_SUFFIX = "__NAMED_CONTEXT";
@@ -825,15 +825,15 @@
825
825
  ingestStagingStore = null;
826
826
  return promise;
827
827
  };
828
- const storeLookup = function (sel, createSnapshot, refresh) {
828
+ const storeLookup = function (sel, createSnapshot, refresh, ttlStrategy) {
829
829
  validateNotDisposed();
830
830
  // if this lookup is right after an ingest there will be a staging store
831
831
  if (ingestStagingStore !== null) {
832
- return ingestStagingStore.lookup(sel, createSnapshot, refresh);
832
+ return ingestStagingStore.lookup(sel, createSnapshot, refresh, ttlStrategy);
833
833
  }
834
834
  // otherwise this is from buildInMemorySnapshot and we should use the luvio
835
835
  // L1 store
836
- return environment.storeLookup(sel, createSnapshot, refresh);
836
+ return environment.storeLookup(sel, createSnapshot, refresh, ttlStrategy);
837
837
  };
838
838
  const storeEvict = function (key) {
839
839
  validateNotDisposed();
@@ -1033,6 +1033,9 @@
1033
1033
  ingestStagingStore.records = existingRecords;
1034
1034
  }
1035
1035
  const snapshotFromMemoryIngest = ingestAndBroadcastFunc();
1036
+ if (snapshotFromMemoryIngest === undefined) {
1037
+ return undefined;
1038
+ }
1036
1039
  if (snapshotFromMemoryIngest.state !== 'Unfulfilled') {
1037
1040
  return snapshotFromMemoryIngest;
1038
1041
  }
@@ -30,7 +30,7 @@ export interface DurableEnvironment extends Environment {
30
30
  * RecordSource to "prime" the ingest staging store with before calling
31
31
  * ingest. Useful for merge-able record types
32
32
  */
33
- handleSuccessResponse<ResponseType>(ingestAndBroadcastFunc: () => Snapshot<ResponseType>, getResponseCacheKeysFunc: () => CacheKeySet, existingRecords?: RecordSource): Snapshot<ResponseType> | Promise<Snapshot<ResponseType>>;
33
+ handleSuccessResponse<IngestionReturnType extends Snapshot<D, V> | undefined, D, V = unknown>(ingestAndBroadcastFunc: () => IngestionReturnType, getResponseCacheKeysFunc: () => CacheKeySet, existingRecords?: RecordSource): IngestionReturnType | Promise<IngestionReturnType>;
34
34
  }
35
35
  export declare const AdapterContextSegment = "ADAPTER-CONTEXT";
36
36
  export declare const ADAPTER_CONTEXT_ID_SUFFIX = "__NAMED_CONTEXT";
@@ -867,15 +867,15 @@
867
867
  ingestStagingStore = null;
868
868
  return promise;
869
869
  };
870
- var storeLookup = function (sel, createSnapshot, refresh) {
870
+ var storeLookup = function (sel, createSnapshot, refresh, ttlStrategy) {
871
871
  validateNotDisposed();
872
872
  // if this lookup is right after an ingest there will be a staging store
873
873
  if (ingestStagingStore !== null) {
874
- return ingestStagingStore.lookup(sel, createSnapshot, refresh);
874
+ return ingestStagingStore.lookup(sel, createSnapshot, refresh, ttlStrategy);
875
875
  }
876
876
  // otherwise this is from buildInMemorySnapshot and we should use the luvio
877
877
  // L1 store
878
- return environment.storeLookup(sel, createSnapshot, refresh);
878
+ return environment.storeLookup(sel, createSnapshot, refresh, ttlStrategy);
879
879
  };
880
880
  var storeEvict = function (key) {
881
881
  validateNotDisposed();
@@ -1080,6 +1080,9 @@
1080
1080
  ingestStagingStore.records = existingRecords;
1081
1081
  }
1082
1082
  var snapshotFromMemoryIngest = ingestAndBroadcastFunc();
1083
+ if (snapshotFromMemoryIngest === undefined) {
1084
+ return undefined;
1085
+ }
1083
1086
  if (snapshotFromMemoryIngest.state !== 'Unfulfilled') {
1084
1087
  return snapshotFromMemoryIngest;
1085
1088
  }
@@ -30,7 +30,7 @@ export interface DurableEnvironment extends Environment {
30
30
  * RecordSource to "prime" the ingest staging store with before calling
31
31
  * ingest. Useful for merge-able record types
32
32
  */
33
- handleSuccessResponse<ResponseType>(ingestAndBroadcastFunc: () => Snapshot<ResponseType>, getResponseCacheKeysFunc: () => CacheKeySet, existingRecords?: RecordSource): Snapshot<ResponseType> | Promise<Snapshot<ResponseType>>;
33
+ handleSuccessResponse<IngestionReturnType extends Snapshot<D, V> | undefined, D, V = unknown>(ingestAndBroadcastFunc: () => IngestionReturnType, getResponseCacheKeysFunc: () => CacheKeySet, existingRecords?: RecordSource): IngestionReturnType | Promise<IngestionReturnType>;
34
34
  }
35
35
  export declare const AdapterContextSegment = "ADAPTER-CONTEXT";
36
36
  export declare const ADAPTER_CONTEXT_ID_SUFFIX = "__NAMED_CONTEXT";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luvio/environments",
3
- "version": "0.67.0",
3
+ "version": "0.68.0",
4
4
  "description": "Luvio Environments",
5
5
  "main": "dist/umd/es2018/environments.js",
6
6
  "module": "dist/es/es2018/environments.js",
@@ -26,6 +26,6 @@
26
26
  "dist/"
27
27
  ],
28
28
  "dependencies": {
29
- "@luvio/engine": "0.67.0"
29
+ "@luvio/engine": "0.68.0"
30
30
  }
31
31
  }