@luvio/environments 0.124.0 → 0.126.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.
- package/dist/es/es2018/DurableStore.d.ts +2 -1
- package/dist/es/es2018/environments.js +10 -12
- package/dist/es/es2018/main.d.ts +1 -1
- package/dist/es/es2018/makeDurable/stagingStore.d.ts +1 -2
- package/dist/umd/es2018/DurableStore.d.ts +2 -1
- package/dist/umd/es2018/environments.js +9 -11
- package/dist/umd/es2018/main.d.ts +1 -1
- package/dist/umd/es2018/makeDurable/stagingStore.d.ts +1 -2
- package/dist/umd/es5/DurableStore.d.ts +2 -1
- package/dist/umd/es5/environments.js +9 -11
- package/dist/umd/es5/main.d.ts +1 -1
- package/dist/umd/es5/makeDurable/stagingStore.d.ts +1 -2
- package/package.json +3 -4
|
@@ -41,7 +41,8 @@ export interface DurableStoreEvictOperation extends BaseOperation {
|
|
|
41
41
|
ids: string[];
|
|
42
42
|
}
|
|
43
43
|
export declare type DurableStoreOperation<T> = DurableStoreSetOperation<T> | DurableStoreEvictOperation;
|
|
44
|
-
export declare
|
|
44
|
+
export declare type DefaultDurableSegmentName = 'DEFAULT';
|
|
45
|
+
export declare const DefaultDurableSegment: DefaultDurableSegmentName;
|
|
45
46
|
export interface DurableStoreChange {
|
|
46
47
|
/** The entry IDs of the entries that have changed */
|
|
47
48
|
ids: string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { emitAdapterEvent,
|
|
1
|
+
import { emitAdapterEvent, buildStaleWhileRevalidateImplementation, Reader } from '@luvio/engine';
|
|
2
2
|
|
|
3
3
|
// the last version the metadata shape was altered
|
|
4
4
|
const DURABLE_METADATA_VERSION = '0.111.0';
|
|
@@ -371,12 +371,7 @@ async function reviveTTLOverrides(ttlStore, environment) {
|
|
|
371
371
|
* the TTLOverrides from the given Environment's Store.
|
|
372
372
|
*/
|
|
373
373
|
function buildIngestStagingStore(environment) {
|
|
374
|
-
|
|
375
|
-
// need to make sure any TTL overrides are brought over from real L1
|
|
376
|
-
// because publishStoreMetadata uses those overrides
|
|
377
|
-
store.ttlOverrides = environment.storeGetTTLOverrides();
|
|
378
|
-
store.defaultTTLOverride = environment.storeGetDefaultTTLOverride();
|
|
379
|
-
return store;
|
|
374
|
+
return environment.storeBuildIngestionStagingStore();
|
|
380
375
|
}
|
|
381
376
|
|
|
382
377
|
const AdapterContextSegment = 'ADAPTER-CONTEXT';
|
|
@@ -654,11 +649,14 @@ function makeDurable(environment, { durableStore, instrumentation }) {
|
|
|
654
649
|
};
|
|
655
650
|
const storeRedirect = function (existingKey, canonicalKey) {
|
|
656
651
|
validateNotDisposed();
|
|
657
|
-
|
|
658
|
-
//
|
|
659
|
-
//
|
|
660
|
-
//
|
|
661
|
-
|
|
652
|
+
// call redirect on staging store so "old" keys are removed from L2 on
|
|
653
|
+
// the next publishChangesToDurableStore. NOTE: we don't need to call
|
|
654
|
+
// redirect on the base environment store because staging store and base
|
|
655
|
+
// L1 store share the same redirect and reverseRedirectKeys
|
|
656
|
+
if (ingestStagingStore === null) {
|
|
657
|
+
ingestStagingStore = buildIngestStagingStore(environment);
|
|
658
|
+
}
|
|
659
|
+
ingestStagingStore.redirect(existingKey, canonicalKey);
|
|
662
660
|
};
|
|
663
661
|
const storeSetTTLOverride = function (namespace, representationName, ttl) {
|
|
664
662
|
validateNotDisposed();
|
package/dist/es/es2018/main.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { DurableStore, DurableStoreEntries, DurableStoreEntry, DurableStoreChange, OnDurableStoreChangedListener, DefaultDurableSegment, DurableStoreOperation, DurableStoreOperationType, DURABLE_METADATA_VERSION, } from './DurableStore';
|
|
1
|
+
export { DurableStore, DurableStoreEntries, DurableStoreEntry, DurableStoreChange, OnDurableStoreChangedListener, DefaultDurableSegment, DefaultDurableSegmentName, DurableStoreOperation, DurableStoreOperationType, DURABLE_METADATA_VERSION, } from './DurableStore';
|
|
2
2
|
export { DurableTTLOverride, DefaultDurableTTLOverride } from './DurableTTLStore';
|
|
3
3
|
export { makeDurable, DurableEnvironment } from './makeDurable';
|
|
4
4
|
export { publishDurableStoreEntries } from './makeDurable/revive';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { InMemoryStore } from '@luvio/engine';
|
|
2
|
-
import type { Environment } from '@luvio/engine';
|
|
1
|
+
import type { Environment, InMemoryStore } from '@luvio/engine';
|
|
3
2
|
/**
|
|
4
3
|
* Returns an empty InMemoryStore that can be used for ingestion. Copies over
|
|
5
4
|
* the TTLOverrides from the given Environment's Store.
|
|
@@ -41,7 +41,8 @@ export interface DurableStoreEvictOperation extends BaseOperation {
|
|
|
41
41
|
ids: string[];
|
|
42
42
|
}
|
|
43
43
|
export declare type DurableStoreOperation<T> = DurableStoreSetOperation<T> | DurableStoreEvictOperation;
|
|
44
|
-
export declare
|
|
44
|
+
export declare type DefaultDurableSegmentName = 'DEFAULT';
|
|
45
|
+
export declare const DefaultDurableSegment: DefaultDurableSegmentName;
|
|
45
46
|
export interface DurableStoreChange {
|
|
46
47
|
/** The entry IDs of the entries that have changed */
|
|
47
48
|
ids: string[];
|
|
@@ -375,12 +375,7 @@
|
|
|
375
375
|
* the TTLOverrides from the given Environment's Store.
|
|
376
376
|
*/
|
|
377
377
|
function buildIngestStagingStore(environment) {
|
|
378
|
-
|
|
379
|
-
// need to make sure any TTL overrides are brought over from real L1
|
|
380
|
-
// because publishStoreMetadata uses those overrides
|
|
381
|
-
store.ttlOverrides = environment.storeGetTTLOverrides();
|
|
382
|
-
store.defaultTTLOverride = environment.storeGetDefaultTTLOverride();
|
|
383
|
-
return store;
|
|
378
|
+
return environment.storeBuildIngestionStagingStore();
|
|
384
379
|
}
|
|
385
380
|
|
|
386
381
|
const AdapterContextSegment = 'ADAPTER-CONTEXT';
|
|
@@ -658,11 +653,14 @@
|
|
|
658
653
|
};
|
|
659
654
|
const storeRedirect = function (existingKey, canonicalKey) {
|
|
660
655
|
validateNotDisposed();
|
|
661
|
-
|
|
662
|
-
//
|
|
663
|
-
//
|
|
664
|
-
//
|
|
665
|
-
|
|
656
|
+
// call redirect on staging store so "old" keys are removed from L2 on
|
|
657
|
+
// the next publishChangesToDurableStore. NOTE: we don't need to call
|
|
658
|
+
// redirect on the base environment store because staging store and base
|
|
659
|
+
// L1 store share the same redirect and reverseRedirectKeys
|
|
660
|
+
if (ingestStagingStore === null) {
|
|
661
|
+
ingestStagingStore = buildIngestStagingStore(environment);
|
|
662
|
+
}
|
|
663
|
+
ingestStagingStore.redirect(existingKey, canonicalKey);
|
|
666
664
|
};
|
|
667
665
|
const storeSetTTLOverride = function (namespace, representationName, ttl) {
|
|
668
666
|
validateNotDisposed();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { DurableStore, DurableStoreEntries, DurableStoreEntry, DurableStoreChange, OnDurableStoreChangedListener, DefaultDurableSegment, DurableStoreOperation, DurableStoreOperationType, DURABLE_METADATA_VERSION, } from './DurableStore';
|
|
1
|
+
export { DurableStore, DurableStoreEntries, DurableStoreEntry, DurableStoreChange, OnDurableStoreChangedListener, DefaultDurableSegment, DefaultDurableSegmentName, DurableStoreOperation, DurableStoreOperationType, DURABLE_METADATA_VERSION, } from './DurableStore';
|
|
2
2
|
export { DurableTTLOverride, DefaultDurableTTLOverride } from './DurableTTLStore';
|
|
3
3
|
export { makeDurable, DurableEnvironment } from './makeDurable';
|
|
4
4
|
export { publishDurableStoreEntries } from './makeDurable/revive';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { InMemoryStore } from '@luvio/engine';
|
|
2
|
-
import type { Environment } from '@luvio/engine';
|
|
1
|
+
import type { Environment, InMemoryStore } from '@luvio/engine';
|
|
3
2
|
/**
|
|
4
3
|
* Returns an empty InMemoryStore that can be used for ingestion. Copies over
|
|
5
4
|
* the TTLOverrides from the given Environment's Store.
|
|
@@ -41,7 +41,8 @@ export interface DurableStoreEvictOperation extends BaseOperation {
|
|
|
41
41
|
ids: string[];
|
|
42
42
|
}
|
|
43
43
|
export declare type DurableStoreOperation<T> = DurableStoreSetOperation<T> | DurableStoreEvictOperation;
|
|
44
|
-
export declare
|
|
44
|
+
export declare type DefaultDurableSegmentName = 'DEFAULT';
|
|
45
|
+
export declare const DefaultDurableSegment: DefaultDurableSegmentName;
|
|
45
46
|
export interface DurableStoreChange {
|
|
46
47
|
/** The entry IDs of the entries that have changed */
|
|
47
48
|
ids: string[];
|
|
@@ -463,12 +463,7 @@
|
|
|
463
463
|
* the TTLOverrides from the given Environment's Store.
|
|
464
464
|
*/
|
|
465
465
|
function buildIngestStagingStore(environment) {
|
|
466
|
-
|
|
467
|
-
// need to make sure any TTL overrides are brought over from real L1
|
|
468
|
-
// because publishStoreMetadata uses those overrides
|
|
469
|
-
store.ttlOverrides = environment.storeGetTTLOverrides();
|
|
470
|
-
store.defaultTTLOverride = environment.storeGetDefaultTTLOverride();
|
|
471
|
-
return store;
|
|
466
|
+
return environment.storeBuildIngestionStagingStore();
|
|
472
467
|
}
|
|
473
468
|
|
|
474
469
|
var AdapterContextSegment = 'ADAPTER-CONTEXT';
|
|
@@ -760,11 +755,14 @@
|
|
|
760
755
|
};
|
|
761
756
|
var storeRedirect = function (existingKey, canonicalKey) {
|
|
762
757
|
validateNotDisposed();
|
|
763
|
-
|
|
764
|
-
//
|
|
765
|
-
//
|
|
766
|
-
//
|
|
767
|
-
|
|
758
|
+
// call redirect on staging store so "old" keys are removed from L2 on
|
|
759
|
+
// the next publishChangesToDurableStore. NOTE: we don't need to call
|
|
760
|
+
// redirect on the base environment store because staging store and base
|
|
761
|
+
// L1 store share the same redirect and reverseRedirectKeys
|
|
762
|
+
if (ingestStagingStore === null) {
|
|
763
|
+
ingestStagingStore = buildIngestStagingStore(environment);
|
|
764
|
+
}
|
|
765
|
+
ingestStagingStore.redirect(existingKey, canonicalKey);
|
|
768
766
|
};
|
|
769
767
|
var storeSetTTLOverride = function (namespace, representationName, ttl) {
|
|
770
768
|
validateNotDisposed();
|
package/dist/umd/es5/main.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { DurableStore, DurableStoreEntries, DurableStoreEntry, DurableStoreChange, OnDurableStoreChangedListener, DefaultDurableSegment, DurableStoreOperation, DurableStoreOperationType, DURABLE_METADATA_VERSION, } from './DurableStore';
|
|
1
|
+
export { DurableStore, DurableStoreEntries, DurableStoreEntry, DurableStoreChange, OnDurableStoreChangedListener, DefaultDurableSegment, DefaultDurableSegmentName, DurableStoreOperation, DurableStoreOperationType, DURABLE_METADATA_VERSION, } from './DurableStore';
|
|
2
2
|
export { DurableTTLOverride, DefaultDurableTTLOverride } from './DurableTTLStore';
|
|
3
3
|
export { makeDurable, DurableEnvironment } from './makeDurable';
|
|
4
4
|
export { publishDurableStoreEntries } from './makeDurable/revive';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { InMemoryStore } from '@luvio/engine';
|
|
2
|
-
import type { Environment } from '@luvio/engine';
|
|
1
|
+
import type { Environment, InMemoryStore } from '@luvio/engine';
|
|
3
2
|
/**
|
|
4
3
|
* Returns an empty InMemoryStore that can be used for ingestion. Copies over
|
|
5
4
|
* the TTLOverrides from the given Environment's Store.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luvio/environments",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.126.0",
|
|
4
4
|
"description": "Luvio Environments",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"watch": "yarn build --watch"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@luvio/engine": "0.
|
|
26
|
+
"@luvio/engine": "0.126.0"
|
|
27
27
|
},
|
|
28
28
|
"bundlesize": [
|
|
29
29
|
{
|
|
@@ -40,6 +40,5 @@
|
|
|
40
40
|
]
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
}
|
|
44
|
-
"gitHead": "50e7f51b6cf902290c846bc7ea661febc48fd145"
|
|
43
|
+
}
|
|
45
44
|
}
|