@luvio/environments 0.111.3 → 0.112.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 +7 -7
- package/dist/es/es2018/environments.js +16 -3
- package/dist/es/es2018/main.d.ts +1 -1
- package/dist/umd/es2018/DurableStore.d.ts +7 -7
- package/dist/umd/es2018/environments.js +16 -2
- package/dist/umd/es2018/main.d.ts +1 -1
- package/dist/umd/es5/DurableStore.d.ts +7 -7
- package/dist/umd/es5/environments.js +13 -2
- package/dist/umd/es5/main.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import type { StoreMetadata } from '@luvio/engine';
|
|
2
|
+
export declare const DURABLE_METADATA_VERSION = "0.111.0";
|
|
3
|
+
interface DurableStoreMetadata extends StoreMetadata {
|
|
4
|
+
metadataVersion: string;
|
|
5
|
+
}
|
|
1
6
|
/**
|
|
2
7
|
* Contains store entry data along with any metadata for that entry that needs
|
|
3
8
|
* to be persisted to durable storage
|
|
@@ -9,13 +14,7 @@
|
|
|
9
14
|
*/
|
|
10
15
|
export interface DurableStoreEntry<T = unknown> {
|
|
11
16
|
data: T;
|
|
12
|
-
metadata?:
|
|
13
|
-
ingestionTimestamp: number;
|
|
14
|
-
expirationTimestamp: number;
|
|
15
|
-
namespace: string;
|
|
16
|
-
version: string;
|
|
17
|
-
representationName: string;
|
|
18
|
-
};
|
|
17
|
+
metadata?: DurableStoreMetadata;
|
|
19
18
|
}
|
|
20
19
|
export declare function isDeprecatedDurableStoreEntry(durableRecord: unknown): boolean;
|
|
21
20
|
export interface DeprecatedDurableStoreEntry1<T = unknown> {
|
|
@@ -131,3 +130,4 @@ export interface DurableStore {
|
|
|
131
130
|
*/
|
|
132
131
|
registerOnChangedListener(listener: OnDurableStoreChangedListener): () => Promise<void>;
|
|
133
132
|
}
|
|
133
|
+
export {};
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import { emitAdapterEvent, InMemoryStore, buildStaleWhileRevalidateImplementation, Reader } from '@luvio/engine';
|
|
2
2
|
|
|
3
|
+
// the last version the metadata shape was altered
|
|
4
|
+
const DURABLE_METADATA_VERSION = '0.111.0';
|
|
3
5
|
function isDeprecatedDurableStoreEntry(durableRecord) {
|
|
4
6
|
if (durableRecord.expiration !== undefined) {
|
|
5
7
|
return true;
|
|
6
8
|
}
|
|
9
|
+
const metadata = durableRecord.metadata;
|
|
10
|
+
if (metadata !== undefined) {
|
|
11
|
+
const { metadataVersion } = metadata;
|
|
12
|
+
// eventually we will want to assert that metadataVersion is defined
|
|
13
|
+
if (metadataVersion !== undefined && metadataVersion !== DURABLE_METADATA_VERSION) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
7
17
|
// Add more deprecated shape checks here
|
|
8
18
|
return false;
|
|
9
19
|
}
|
|
@@ -297,7 +307,10 @@ function flushInMemoryStoreValuesToDurableStore(store, durableStore, durableStor
|
|
|
297
307
|
data: copy(record),
|
|
298
308
|
};
|
|
299
309
|
if (metadata !== undefined) {
|
|
300
|
-
durableRecords[key].metadata =
|
|
310
|
+
durableRecords[key].metadata = {
|
|
311
|
+
...metadata,
|
|
312
|
+
metadataVersion: DURABLE_METADATA_VERSION,
|
|
313
|
+
};
|
|
301
314
|
}
|
|
302
315
|
}
|
|
303
316
|
const durableStoreOperations = [];
|
|
@@ -357,7 +370,7 @@ async function reviveTTLOverrides(ttlStore, environment) {
|
|
|
357
370
|
function buildIngestStagingStore(environment) {
|
|
358
371
|
const store = new InMemoryStore();
|
|
359
372
|
// need to make sure any TTL overrides are brought over from real L1
|
|
360
|
-
// because
|
|
373
|
+
// because publishStoreMetadata uses those overrides
|
|
361
374
|
store.ttlOverrides = environment.storeGetTTLOverrides();
|
|
362
375
|
store.defaultTTLOverride = environment.storeGetDefaultTTLOverride();
|
|
363
376
|
return store;
|
|
@@ -844,4 +857,4 @@ function makeDurable(environment, { durableStore, instrumentation }) {
|
|
|
844
857
|
});
|
|
845
858
|
}
|
|
846
859
|
|
|
847
|
-
export { DefaultDurableSegment, isDurableEnvironmentEvent, makeDurable, publishDurableStoreEntries };
|
|
860
|
+
export { DURABLE_METADATA_VERSION, DefaultDurableSegment, isDurableEnvironmentEvent, makeDurable, publishDurableStoreEntries };
|
package/dist/es/es2018/main.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { DurableStore, DurableStoreEntries, DurableStoreEntry, DurableStoreChange, OnDurableStoreChangedListener, DefaultDurableSegment, DurableStoreOperation, DurableStoreOperationType, } from './DurableStore';
|
|
1
|
+
export { DurableStore, DurableStoreEntries, DurableStoreEntry, DurableStoreChange, OnDurableStoreChangedListener, DefaultDurableSegment, 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,3 +1,8 @@
|
|
|
1
|
+
import type { StoreMetadata } from '@luvio/engine';
|
|
2
|
+
export declare const DURABLE_METADATA_VERSION = "0.111.0";
|
|
3
|
+
interface DurableStoreMetadata extends StoreMetadata {
|
|
4
|
+
metadataVersion: string;
|
|
5
|
+
}
|
|
1
6
|
/**
|
|
2
7
|
* Contains store entry data along with any metadata for that entry that needs
|
|
3
8
|
* to be persisted to durable storage
|
|
@@ -9,13 +14,7 @@
|
|
|
9
14
|
*/
|
|
10
15
|
export interface DurableStoreEntry<T = unknown> {
|
|
11
16
|
data: T;
|
|
12
|
-
metadata?:
|
|
13
|
-
ingestionTimestamp: number;
|
|
14
|
-
expirationTimestamp: number;
|
|
15
|
-
namespace: string;
|
|
16
|
-
version: string;
|
|
17
|
-
representationName: string;
|
|
18
|
-
};
|
|
17
|
+
metadata?: DurableStoreMetadata;
|
|
19
18
|
}
|
|
20
19
|
export declare function isDeprecatedDurableStoreEntry(durableRecord: unknown): boolean;
|
|
21
20
|
export interface DeprecatedDurableStoreEntry1<T = unknown> {
|
|
@@ -131,3 +130,4 @@ export interface DurableStore {
|
|
|
131
130
|
*/
|
|
132
131
|
registerOnChangedListener(listener: OnDurableStoreChangedListener): () => Promise<void>;
|
|
133
132
|
}
|
|
133
|
+
export {};
|
|
@@ -4,10 +4,20 @@
|
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.luvioEnvironments = {}, global.luvioEngine));
|
|
5
5
|
})(this, (function (exports, engine) { 'use strict';
|
|
6
6
|
|
|
7
|
+
// the last version the metadata shape was altered
|
|
8
|
+
const DURABLE_METADATA_VERSION = '0.111.0';
|
|
7
9
|
function isDeprecatedDurableStoreEntry(durableRecord) {
|
|
8
10
|
if (durableRecord.expiration !== undefined) {
|
|
9
11
|
return true;
|
|
10
12
|
}
|
|
13
|
+
const metadata = durableRecord.metadata;
|
|
14
|
+
if (metadata !== undefined) {
|
|
15
|
+
const { metadataVersion } = metadata;
|
|
16
|
+
// eventually we will want to assert that metadataVersion is defined
|
|
17
|
+
if (metadataVersion !== undefined && metadataVersion !== DURABLE_METADATA_VERSION) {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
11
21
|
// Add more deprecated shape checks here
|
|
12
22
|
return false;
|
|
13
23
|
}
|
|
@@ -301,7 +311,10 @@
|
|
|
301
311
|
data: copy(record),
|
|
302
312
|
};
|
|
303
313
|
if (metadata !== undefined) {
|
|
304
|
-
durableRecords[key].metadata =
|
|
314
|
+
durableRecords[key].metadata = {
|
|
315
|
+
...metadata,
|
|
316
|
+
metadataVersion: DURABLE_METADATA_VERSION,
|
|
317
|
+
};
|
|
305
318
|
}
|
|
306
319
|
}
|
|
307
320
|
const durableStoreOperations = [];
|
|
@@ -361,7 +374,7 @@
|
|
|
361
374
|
function buildIngestStagingStore(environment) {
|
|
362
375
|
const store = new engine.InMemoryStore();
|
|
363
376
|
// need to make sure any TTL overrides are brought over from real L1
|
|
364
|
-
// because
|
|
377
|
+
// because publishStoreMetadata uses those overrides
|
|
365
378
|
store.ttlOverrides = environment.storeGetTTLOverrides();
|
|
366
379
|
store.defaultTTLOverride = environment.storeGetDefaultTTLOverride();
|
|
367
380
|
return store;
|
|
@@ -848,6 +861,7 @@
|
|
|
848
861
|
});
|
|
849
862
|
}
|
|
850
863
|
|
|
864
|
+
exports.DURABLE_METADATA_VERSION = DURABLE_METADATA_VERSION;
|
|
851
865
|
exports.DefaultDurableSegment = DefaultDurableSegment;
|
|
852
866
|
exports.isDurableEnvironmentEvent = isDurableEnvironmentEvent;
|
|
853
867
|
exports.makeDurable = makeDurable;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { DurableStore, DurableStoreEntries, DurableStoreEntry, DurableStoreChange, OnDurableStoreChangedListener, DefaultDurableSegment, DurableStoreOperation, DurableStoreOperationType, } from './DurableStore';
|
|
1
|
+
export { DurableStore, DurableStoreEntries, DurableStoreEntry, DurableStoreChange, OnDurableStoreChangedListener, DefaultDurableSegment, 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,3 +1,8 @@
|
|
|
1
|
+
import type { StoreMetadata } from '@luvio/engine';
|
|
2
|
+
export declare const DURABLE_METADATA_VERSION = "0.111.0";
|
|
3
|
+
interface DurableStoreMetadata extends StoreMetadata {
|
|
4
|
+
metadataVersion: string;
|
|
5
|
+
}
|
|
1
6
|
/**
|
|
2
7
|
* Contains store entry data along with any metadata for that entry that needs
|
|
3
8
|
* to be persisted to durable storage
|
|
@@ -9,13 +14,7 @@
|
|
|
9
14
|
*/
|
|
10
15
|
export interface DurableStoreEntry<T = unknown> {
|
|
11
16
|
data: T;
|
|
12
|
-
metadata?:
|
|
13
|
-
ingestionTimestamp: number;
|
|
14
|
-
expirationTimestamp: number;
|
|
15
|
-
namespace: string;
|
|
16
|
-
version: string;
|
|
17
|
-
representationName: string;
|
|
18
|
-
};
|
|
17
|
+
metadata?: DurableStoreMetadata;
|
|
19
18
|
}
|
|
20
19
|
export declare function isDeprecatedDurableStoreEntry(durableRecord: unknown): boolean;
|
|
21
20
|
export interface DeprecatedDurableStoreEntry1<T = unknown> {
|
|
@@ -131,3 +130,4 @@ export interface DurableStore {
|
|
|
131
130
|
*/
|
|
132
131
|
registerOnChangedListener(listener: OnDurableStoreChangedListener): () => Promise<void>;
|
|
133
132
|
}
|
|
133
|
+
export {};
|
|
@@ -4,10 +4,20 @@
|
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.luvioEnvironments = {}, global.luvioEngine));
|
|
5
5
|
})(this, (function (exports, engine) { 'use strict';
|
|
6
6
|
|
|
7
|
+
// the last version the metadata shape was altered
|
|
8
|
+
var DURABLE_METADATA_VERSION = '0.111.0';
|
|
7
9
|
function isDeprecatedDurableStoreEntry(durableRecord) {
|
|
8
10
|
if (durableRecord.expiration !== undefined) {
|
|
9
11
|
return true;
|
|
10
12
|
}
|
|
13
|
+
var metadata = durableRecord.metadata;
|
|
14
|
+
if (metadata !== undefined) {
|
|
15
|
+
var metadataVersion = metadata.metadataVersion;
|
|
16
|
+
// eventually we will want to assert that metadataVersion is defined
|
|
17
|
+
if (metadataVersion !== undefined && metadataVersion !== DURABLE_METADATA_VERSION) {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
11
21
|
// Add more deprecated shape checks here
|
|
12
22
|
return false;
|
|
13
23
|
}
|
|
@@ -382,7 +392,7 @@
|
|
|
382
392
|
data: copy(record),
|
|
383
393
|
};
|
|
384
394
|
if (metadata !== undefined) {
|
|
385
|
-
durableRecords[key].metadata =
|
|
395
|
+
durableRecords[key].metadata = __assign(__assign({}, metadata), { metadataVersion: DURABLE_METADATA_VERSION });
|
|
386
396
|
}
|
|
387
397
|
}
|
|
388
398
|
var durableStoreOperations = [];
|
|
@@ -452,7 +462,7 @@
|
|
|
452
462
|
function buildIngestStagingStore(environment) {
|
|
453
463
|
var store = new engine.InMemoryStore();
|
|
454
464
|
// need to make sure any TTL overrides are brought over from real L1
|
|
455
|
-
// because
|
|
465
|
+
// because publishStoreMetadata uses those overrides
|
|
456
466
|
store.ttlOverrides = environment.storeGetTTLOverrides();
|
|
457
467
|
store.defaultTTLOverride = environment.storeGetDefaultTTLOverride();
|
|
458
468
|
return store;
|
|
@@ -991,6 +1001,7 @@
|
|
|
991
1001
|
});
|
|
992
1002
|
}
|
|
993
1003
|
|
|
1004
|
+
exports.DURABLE_METADATA_VERSION = DURABLE_METADATA_VERSION;
|
|
994
1005
|
exports.DefaultDurableSegment = DefaultDurableSegment;
|
|
995
1006
|
exports.isDurableEnvironmentEvent = isDurableEnvironmentEvent;
|
|
996
1007
|
exports.makeDurable = makeDurable;
|
package/dist/umd/es5/main.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { DurableStore, DurableStoreEntries, DurableStoreEntry, DurableStoreChange, OnDurableStoreChangedListener, DefaultDurableSegment, DurableStoreOperation, DurableStoreOperationType, } from './DurableStore';
|
|
1
|
+
export { DurableStore, DurableStoreEntries, DurableStoreEntry, DurableStoreChange, OnDurableStoreChangedListener, DefaultDurableSegment, 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';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luvio/environments",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.112.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.112.0"
|
|
27
27
|
},
|
|
28
28
|
"bundlesize": [
|
|
29
29
|
{
|