@luvio/environments 0.62.4 → 0.63.3
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/environments.js +11 -5
- package/dist/es/es2018/makeDurable/cachepolicies/cache-and-network.d.ts +1 -1
- package/dist/es/es2018/makeDurable/cachepolicies/cache-then-network.d.ts +1 -1
- package/dist/es/es2018/makeDurable/cachepolicies/no-cache.d.ts +1 -1
- package/dist/es/es2018/makeDurable/cachepolicies/only-if-cached.d.ts +2 -2
- package/dist/es/es2018/makeDurable/cachepolicies/stale-while-revalidate.d.ts +1 -1
- package/dist/es/es2018/utils/language.d.ts +1 -1
- package/dist/umd/es2018/environments.js +15 -8
- package/dist/umd/es2018/makeDurable/cachepolicies/cache-and-network.d.ts +1 -1
- package/dist/umd/es2018/makeDurable/cachepolicies/cache-then-network.d.ts +1 -1
- package/dist/umd/es2018/makeDurable/cachepolicies/no-cache.d.ts +1 -1
- package/dist/umd/es2018/makeDurable/cachepolicies/only-if-cached.d.ts +2 -2
- package/dist/umd/es2018/makeDurable/cachepolicies/stale-while-revalidate.d.ts +1 -1
- package/dist/umd/es2018/utils/language.d.ts +1 -1
- package/dist/umd/es5/environments.js +41 -32
- package/dist/umd/es5/makeDurable/cachepolicies/cache-and-network.d.ts +1 -1
- package/dist/umd/es5/makeDurable/cachepolicies/cache-then-network.d.ts +1 -1
- package/dist/umd/es5/makeDurable/cachepolicies/no-cache.d.ts +1 -1
- package/dist/umd/es5/makeDurable/cachepolicies/only-if-cached.d.ts +2 -2
- package/dist/umd/es5/makeDurable/cachepolicies/stale-while-revalidate.d.ts +1 -1
- package/dist/umd/es5/utils/language.d.ts +1 -1
- package/package.json +2 -2
|
@@ -182,6 +182,8 @@ function buildNotCachedErrorSnapshot() {
|
|
|
182
182
|
error,
|
|
183
183
|
state: 'Error',
|
|
184
184
|
data: undefined,
|
|
185
|
+
// TODO[@W-10164067]: copy refresh data from the snapshot returned by buildInMemorySnapshot (if any)
|
|
186
|
+
// refresh: ...
|
|
185
187
|
};
|
|
186
188
|
}
|
|
187
189
|
function buildOnlyIfCachedImplementation(funcs) {
|
|
@@ -797,7 +799,7 @@ function makeDurable(environment, { durableStore, instrumentation }) {
|
|
|
797
799
|
if (ingestStagingStore === null) {
|
|
798
800
|
ingestStagingStore = new Store();
|
|
799
801
|
}
|
|
800
|
-
|
|
802
|
+
environment.storeIngest(key, ingest, response, luvio, ingestStagingStore);
|
|
801
803
|
};
|
|
802
804
|
const storeIngestError = function (key, errorSnapshot, storeMetadataParams, _storeOverride) {
|
|
803
805
|
validateNotDisposed();
|
|
@@ -923,13 +925,17 @@ function makeDurable(environment, { durableStore, instrumentation }) {
|
|
|
923
925
|
};
|
|
924
926
|
const storeSetTTLOverride = function (namespace, representationName, ttl) {
|
|
925
927
|
validateNotDisposed();
|
|
926
|
-
|
|
927
|
-
|
|
928
|
+
return Promise.all([
|
|
929
|
+
environment.storeSetTTLOverride(namespace, representationName, ttl),
|
|
930
|
+
durableTTLStore.setDurableTTLOverride(namespace, representationName, ttl),
|
|
931
|
+
]).then();
|
|
928
932
|
};
|
|
929
933
|
const storeSetDefaultTTLOverride = function (ttl) {
|
|
930
934
|
validateNotDisposed();
|
|
931
|
-
|
|
932
|
-
|
|
935
|
+
return Promise.all([
|
|
936
|
+
environment.storeSetDefaultTTLOverride(ttl),
|
|
937
|
+
durableTTLStore.setDefaultDurableTTLOverrides(ttl),
|
|
938
|
+
]).then();
|
|
933
939
|
};
|
|
934
940
|
const getDurableTTLOverrides = function () {
|
|
935
941
|
validateNotDisposed();
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CachePolicyImplementationArgs, Snapshot } from '@luvio/engine';
|
|
2
2
|
import { DurableCachePolicyFunctions } from './utils';
|
|
3
|
-
export declare function buildCacheAndNetworkImplementation(funcs: DurableCachePolicyFunctions, staleDurationSeconds?: number): <C, D>(args: CachePolicyImplementationArgs<C, D>) =>
|
|
3
|
+
export declare function buildCacheAndNetworkImplementation(funcs: DurableCachePolicyFunctions, staleDurationSeconds?: number): <C, D>(args: CachePolicyImplementationArgs<C, D>) => Snapshot<D, unknown> | Promise<Snapshot<D, unknown>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CachePolicyImplementationArgs, Snapshot } from '@luvio/engine';
|
|
2
2
|
import { DurableCachePolicyFunctions } from './utils';
|
|
3
|
-
export declare function buildCacheThenNetworkImplementation(funcs: DurableCachePolicyFunctions): <C, D>(args: CachePolicyImplementationArgs<C, D>) =>
|
|
3
|
+
export declare function buildCacheThenNetworkImplementation(funcs: DurableCachePolicyFunctions): <C, D>(args: CachePolicyImplementationArgs<C, D>) => Snapshot<D, unknown> | Promise<Snapshot<D, unknown>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CachePolicyImplementationArgs, Snapshot } from '@luvio/engine';
|
|
2
2
|
import { DurableCachePolicyFunctions } from './utils';
|
|
3
|
-
export declare function buildNoCacheImplementation(funcs: DurableCachePolicyFunctions): <C, D>(args: CachePolicyImplementationArgs<C, D>) =>
|
|
3
|
+
export declare function buildNoCacheImplementation(funcs: DurableCachePolicyFunctions): <C, D>(args: CachePolicyImplementationArgs<C, D>) => Snapshot<D, unknown> | Promise<Snapshot<D, unknown>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { CachePolicyImplementationArgs,
|
|
1
|
+
import { CachePolicyImplementationArgs, Snapshot } from '@luvio/engine';
|
|
2
2
|
import { DurableCachePolicyFunctions } from './utils';
|
|
3
|
-
export declare function buildOnlyIfCachedImplementation(funcs: DurableCachePolicyFunctions): <C, D>(args: CachePolicyImplementationArgs<C, D>) =>
|
|
3
|
+
export declare function buildOnlyIfCachedImplementation(funcs: DurableCachePolicyFunctions): <C, D>(args: CachePolicyImplementationArgs<C, D>) => Snapshot<D, unknown> | Promise<Snapshot<D, unknown>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CachePolicyImplementationArgs, Snapshot } from '@luvio/engine';
|
|
2
2
|
import { DurableCachePolicyFunctions } from './utils';
|
|
3
|
-
export declare function buildStaleWhileRevalidateImplementation(funcs: DurableCachePolicyFunctions, staleDurationSeconds: number): <C, D>(args: CachePolicyImplementationArgs<C, D>) =>
|
|
3
|
+
export declare function buildStaleWhileRevalidateImplementation(funcs: DurableCachePolicyFunctions, staleDurationSeconds: number): <C, D>(args: CachePolicyImplementationArgs<C, D>) => Snapshot<D, unknown> | Promise<Snapshot<D, unknown>>;
|
|
@@ -14,6 +14,6 @@ declare const keys: {
|
|
|
14
14
|
<T_1 extends Function>(f: T_1): T_1;
|
|
15
15
|
<T_2>(o: T_2): Readonly<T_2>;
|
|
16
16
|
};
|
|
17
|
-
declare const hasOwnProperty: (v:
|
|
17
|
+
declare const hasOwnProperty: (v: PropertyKey) => boolean;
|
|
18
18
|
declare const isArray: (arg: any) => arg is any[];
|
|
19
19
|
export { create as ObjectCreate, keys as ObjectKeys, assign as ObjectAssign, freeze as ObjectFreeze, hasOwnProperty as ObjectPrototypeHasOwnProperty, isArray as ArrayIsArray, };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@luvio/engine')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define(['exports', '@luvio/engine'], factory) :
|
|
4
|
-
(global = global || self, factory(global.luvioEnvironments = {}, global.luvioEngine));
|
|
5
|
-
}(this, (function (exports, engine) { 'use strict';
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.luvioEnvironments = {}, global.luvioEngine));
|
|
5
|
+
})(this, (function (exports, engine) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function isDeprecatedDurableStoreEntry(durableRecord) {
|
|
8
8
|
if (durableRecord.expiration !== undefined) {
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
// Add more deprecated shape checks here
|
|
12
12
|
return false;
|
|
13
13
|
}
|
|
14
|
+
exports.DurableStoreOperationType = void 0;
|
|
14
15
|
(function (DurableStoreOperationType) {
|
|
15
16
|
DurableStoreOperationType["SetEntries"] = "setEntries";
|
|
16
17
|
DurableStoreOperationType["EvictEntries"] = "evictEntries";
|
|
@@ -185,6 +186,8 @@
|
|
|
185
186
|
error,
|
|
186
187
|
state: 'Error',
|
|
187
188
|
data: undefined,
|
|
189
|
+
// TODO[@W-10164067]: copy refresh data from the snapshot returned by buildInMemorySnapshot (if any)
|
|
190
|
+
// refresh: ...
|
|
188
191
|
};
|
|
189
192
|
}
|
|
190
193
|
function buildOnlyIfCachedImplementation(funcs) {
|
|
@@ -800,7 +803,7 @@
|
|
|
800
803
|
if (ingestStagingStore === null) {
|
|
801
804
|
ingestStagingStore = new engine.Store();
|
|
802
805
|
}
|
|
803
|
-
|
|
806
|
+
environment.storeIngest(key, ingest, response, luvio, ingestStagingStore);
|
|
804
807
|
};
|
|
805
808
|
const storeIngestError = function (key, errorSnapshot, storeMetadataParams, _storeOverride) {
|
|
806
809
|
validateNotDisposed();
|
|
@@ -926,13 +929,17 @@
|
|
|
926
929
|
};
|
|
927
930
|
const storeSetTTLOverride = function (namespace, representationName, ttl) {
|
|
928
931
|
validateNotDisposed();
|
|
929
|
-
|
|
930
|
-
|
|
932
|
+
return Promise.all([
|
|
933
|
+
environment.storeSetTTLOverride(namespace, representationName, ttl),
|
|
934
|
+
durableTTLStore.setDurableTTLOverride(namespace, representationName, ttl),
|
|
935
|
+
]).then();
|
|
931
936
|
};
|
|
932
937
|
const storeSetDefaultTTLOverride = function (ttl) {
|
|
933
938
|
validateNotDisposed();
|
|
934
|
-
|
|
935
|
-
|
|
939
|
+
return Promise.all([
|
|
940
|
+
environment.storeSetDefaultTTLOverride(ttl),
|
|
941
|
+
durableTTLStore.setDefaultDurableTTLOverrides(ttl),
|
|
942
|
+
]).then();
|
|
936
943
|
};
|
|
937
944
|
const getDurableTTLOverrides = function () {
|
|
938
945
|
validateNotDisposed();
|
|
@@ -1118,4 +1125,4 @@
|
|
|
1118
1125
|
|
|
1119
1126
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
1120
1127
|
|
|
1121
|
-
}))
|
|
1128
|
+
}));
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CachePolicyImplementationArgs, Snapshot } from '@luvio/engine';
|
|
2
2
|
import { DurableCachePolicyFunctions } from './utils';
|
|
3
|
-
export declare function buildCacheAndNetworkImplementation(funcs: DurableCachePolicyFunctions, staleDurationSeconds?: number): <C, D>(args: CachePolicyImplementationArgs<C, D>) =>
|
|
3
|
+
export declare function buildCacheAndNetworkImplementation(funcs: DurableCachePolicyFunctions, staleDurationSeconds?: number): <C, D>(args: CachePolicyImplementationArgs<C, D>) => Snapshot<D, unknown> | Promise<Snapshot<D, unknown>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CachePolicyImplementationArgs, Snapshot } from '@luvio/engine';
|
|
2
2
|
import { DurableCachePolicyFunctions } from './utils';
|
|
3
|
-
export declare function buildCacheThenNetworkImplementation(funcs: DurableCachePolicyFunctions): <C, D>(args: CachePolicyImplementationArgs<C, D>) =>
|
|
3
|
+
export declare function buildCacheThenNetworkImplementation(funcs: DurableCachePolicyFunctions): <C, D>(args: CachePolicyImplementationArgs<C, D>) => Snapshot<D, unknown> | Promise<Snapshot<D, unknown>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CachePolicyImplementationArgs, Snapshot } from '@luvio/engine';
|
|
2
2
|
import { DurableCachePolicyFunctions } from './utils';
|
|
3
|
-
export declare function buildNoCacheImplementation(funcs: DurableCachePolicyFunctions): <C, D>(args: CachePolicyImplementationArgs<C, D>) =>
|
|
3
|
+
export declare function buildNoCacheImplementation(funcs: DurableCachePolicyFunctions): <C, D>(args: CachePolicyImplementationArgs<C, D>) => Snapshot<D, unknown> | Promise<Snapshot<D, unknown>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { CachePolicyImplementationArgs,
|
|
1
|
+
import { CachePolicyImplementationArgs, Snapshot } from '@luvio/engine';
|
|
2
2
|
import { DurableCachePolicyFunctions } from './utils';
|
|
3
|
-
export declare function buildOnlyIfCachedImplementation(funcs: DurableCachePolicyFunctions): <C, D>(args: CachePolicyImplementationArgs<C, D>) =>
|
|
3
|
+
export declare function buildOnlyIfCachedImplementation(funcs: DurableCachePolicyFunctions): <C, D>(args: CachePolicyImplementationArgs<C, D>) => Snapshot<D, unknown> | Promise<Snapshot<D, unknown>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CachePolicyImplementationArgs, Snapshot } from '@luvio/engine';
|
|
2
2
|
import { DurableCachePolicyFunctions } from './utils';
|
|
3
|
-
export declare function buildStaleWhileRevalidateImplementation(funcs: DurableCachePolicyFunctions, staleDurationSeconds: number): <C, D>(args: CachePolicyImplementationArgs<C, D>) =>
|
|
3
|
+
export declare function buildStaleWhileRevalidateImplementation(funcs: DurableCachePolicyFunctions, staleDurationSeconds: number): <C, D>(args: CachePolicyImplementationArgs<C, D>) => Snapshot<D, unknown> | Promise<Snapshot<D, unknown>>;
|
|
@@ -14,6 +14,6 @@ declare const keys: {
|
|
|
14
14
|
<T_1 extends Function>(f: T_1): T_1;
|
|
15
15
|
<T_2>(o: T_2): Readonly<T_2>;
|
|
16
16
|
};
|
|
17
|
-
declare const hasOwnProperty: (v:
|
|
17
|
+
declare const hasOwnProperty: (v: PropertyKey) => boolean;
|
|
18
18
|
declare const isArray: (arg: any) => arg is any[];
|
|
19
19
|
export { create as ObjectCreate, keys as ObjectKeys, assign as ObjectAssign, freeze as ObjectFreeze, hasOwnProperty as ObjectPrototypeHasOwnProperty, isArray as ArrayIsArray, };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@luvio/engine')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define(['exports', '@luvio/engine'], factory) :
|
|
4
|
-
(global = global || self, factory(global.luvioEnvironments = {}, global.luvioEngine));
|
|
5
|
-
}(this, (function (exports, engine) { 'use strict';
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.luvioEnvironments = {}, global.luvioEngine));
|
|
5
|
+
})(this, (function (exports, engine) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function isDeprecatedDurableStoreEntry(durableRecord) {
|
|
8
8
|
if (durableRecord.expiration !== undefined) {
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
// Add more deprecated shape checks here
|
|
12
12
|
return false;
|
|
13
13
|
}
|
|
14
|
+
exports.DurableStoreOperationType = void 0;
|
|
14
15
|
(function (DurableStoreOperationType) {
|
|
15
16
|
DurableStoreOperationType["SetEntries"] = "setEntries";
|
|
16
17
|
DurableStoreOperationType["EvictEntries"] = "evictEntries";
|
|
@@ -18,18 +19,18 @@
|
|
|
18
19
|
var DefaultDurableSegment = 'DEFAULT';
|
|
19
20
|
|
|
20
21
|
/*! *****************************************************************************
|
|
21
|
-
Copyright (c) Microsoft Corporation.
|
|
22
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
23
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
24
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
22
|
+
Copyright (c) Microsoft Corporation.
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
29
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
24
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
25
|
+
purpose with or without fee is hereby granted.
|
|
30
26
|
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
28
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
29
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
30
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
31
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
32
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
33
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
33
34
|
***************************************************************************** */
|
|
34
35
|
|
|
35
36
|
var __assign = function() {
|
|
@@ -43,12 +44,14 @@
|
|
|
43
44
|
return __assign.apply(this, arguments);
|
|
44
45
|
};
|
|
45
46
|
|
|
46
|
-
function
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
function __spreadArray(to, from, pack) {
|
|
48
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
49
|
+
if (ar || !(i in from)) {
|
|
50
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
51
|
+
ar[i] = from[i];
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
var keys = Object.keys, create = Object.create, assign = Object.assign, freeze = Object.freeze;
|
|
@@ -224,6 +227,8 @@
|
|
|
224
227
|
error: error,
|
|
225
228
|
state: 'Error',
|
|
226
229
|
data: undefined,
|
|
230
|
+
// TODO[@W-10164067]: copy refresh data from the snapshot returned by buildInMemorySnapshot (if any)
|
|
231
|
+
// refresh: ...
|
|
227
232
|
};
|
|
228
233
|
}
|
|
229
234
|
function buildOnlyIfCachedImplementation(funcs) {
|
|
@@ -365,16 +370,16 @@
|
|
|
365
370
|
for (var i = 0, len = selections.length; i < len; i++) {
|
|
366
371
|
var selection = selections[i];
|
|
367
372
|
if (selection.kind === 'Object') {
|
|
368
|
-
nestedSelections =
|
|
373
|
+
nestedSelections = __spreadArray(__spreadArray([], nestedSelections, true), getSelections(selection.selections), true);
|
|
369
374
|
}
|
|
370
375
|
else if (selection.kind === 'Link') {
|
|
371
|
-
nestedSelections =
|
|
376
|
+
nestedSelections = __spreadArray(__spreadArray([], nestedSelections, true), getSelectionsFromFragment(selection.fragment), true);
|
|
372
377
|
}
|
|
373
378
|
else {
|
|
374
379
|
nonNestedSelections.push(selection);
|
|
375
380
|
}
|
|
376
381
|
}
|
|
377
|
-
return
|
|
382
|
+
return __spreadArray(__spreadArray([], nestedSelections, true), nonNestedSelections, true);
|
|
378
383
|
}
|
|
379
384
|
function getSelectionsFromFragment(fragment) {
|
|
380
385
|
var selections = [];
|
|
@@ -384,7 +389,7 @@
|
|
|
384
389
|
var unionKeys = keys(unionSelections);
|
|
385
390
|
for (var i = 0, len = unionKeys.length; i < len; i++) {
|
|
386
391
|
var key = unionKeys[i];
|
|
387
|
-
selections =
|
|
392
|
+
selections = __spreadArray(__spreadArray([], selections, true), unionSelections[key].selections, true);
|
|
388
393
|
}
|
|
389
394
|
}
|
|
390
395
|
// if fragment has selections properties then get them
|
|
@@ -565,7 +570,7 @@
|
|
|
565
570
|
var TTL_DURABLE_SEGMENT = 'TTL_DURABLE_SEGMENT';
|
|
566
571
|
var TTL_DEFAULT_KEY = 'TTL_DEFAULT_KEY';
|
|
567
572
|
function buildDurableTTLOverrideStoreKey(namespace, representationName) {
|
|
568
|
-
return namespace
|
|
573
|
+
return "".concat(namespace, "::").concat(representationName);
|
|
569
574
|
}
|
|
570
575
|
function isEntryDurableTTLOverride(entry) {
|
|
571
576
|
if (typeof entry === 'object' && entry !== undefined && entry !== null) {
|
|
@@ -648,7 +653,7 @@
|
|
|
648
653
|
}
|
|
649
654
|
if (isArray(source)) {
|
|
650
655
|
// TS doesn't trust that this new array is an array unless we cast it
|
|
651
|
-
return
|
|
656
|
+
return __spreadArray([], source, true);
|
|
652
657
|
}
|
|
653
658
|
return __assign({}, source);
|
|
654
659
|
}
|
|
@@ -840,7 +845,7 @@
|
|
|
840
845
|
if (ingestStagingStore === null) {
|
|
841
846
|
ingestStagingStore = new engine.Store();
|
|
842
847
|
}
|
|
843
|
-
|
|
848
|
+
environment.storeIngest(key, ingest, response, luvio, ingestStagingStore);
|
|
844
849
|
};
|
|
845
850
|
var storeIngestError = function (key, errorSnapshot, storeMetadataParams, _storeOverride) {
|
|
846
851
|
validateNotDisposed();
|
|
@@ -946,7 +951,7 @@
|
|
|
946
951
|
validateNotDisposed();
|
|
947
952
|
var contextId = options.contextId, onContextLoaded = options.onContextLoaded;
|
|
948
953
|
var context = undefined;
|
|
949
|
-
var contextAsPromise = reviveOrCreateContext(contextId === undefined ? adapter.name : ""
|
|
954
|
+
var contextAsPromise = reviveOrCreateContext(contextId === undefined ? adapter.name : "".concat(contextId).concat(ADAPTER_CONTEXT_ID_SUFFIX), durableStore, durableStoreErrorHandler, onContextLoaded);
|
|
950
955
|
return function (config, requestContext) {
|
|
951
956
|
if (context === undefined) {
|
|
952
957
|
return contextAsPromise.then(function (revivedContext) {
|
|
@@ -967,13 +972,17 @@
|
|
|
967
972
|
};
|
|
968
973
|
var storeSetTTLOverride = function (namespace, representationName, ttl) {
|
|
969
974
|
validateNotDisposed();
|
|
970
|
-
|
|
971
|
-
|
|
975
|
+
return Promise.all([
|
|
976
|
+
environment.storeSetTTLOverride(namespace, representationName, ttl),
|
|
977
|
+
durableTTLStore.setDurableTTLOverride(namespace, representationName, ttl),
|
|
978
|
+
]).then();
|
|
972
979
|
};
|
|
973
980
|
var storeSetDefaultTTLOverride = function (ttl) {
|
|
974
981
|
validateNotDisposed();
|
|
975
|
-
|
|
976
|
-
|
|
982
|
+
return Promise.all([
|
|
983
|
+
environment.storeSetDefaultTTLOverride(ttl),
|
|
984
|
+
durableTTLStore.setDefaultDurableTTLOverrides(ttl),
|
|
985
|
+
]).then();
|
|
977
986
|
};
|
|
978
987
|
var getDurableTTLOverrides = function () {
|
|
979
988
|
validateNotDisposed();
|
|
@@ -1027,7 +1036,7 @@
|
|
|
1027
1036
|
}
|
|
1028
1037
|
default: {
|
|
1029
1038
|
if (process.env.NODE_ENV !== 'production') {
|
|
1030
|
-
throw new Error("unrecognized cache policy: "
|
|
1039
|
+
throw new Error("unrecognized cache policy: ".concat(JSON.stringify(cachePolicy)));
|
|
1031
1040
|
}
|
|
1032
1041
|
return defaultCachePolicy;
|
|
1033
1042
|
}
|
|
@@ -1162,4 +1171,4 @@
|
|
|
1162
1171
|
|
|
1163
1172
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
1164
1173
|
|
|
1165
|
-
}))
|
|
1174
|
+
}));
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CachePolicyImplementationArgs, Snapshot } from '@luvio/engine';
|
|
2
2
|
import { DurableCachePolicyFunctions } from './utils';
|
|
3
|
-
export declare function buildCacheAndNetworkImplementation(funcs: DurableCachePolicyFunctions, staleDurationSeconds?: number): <C, D>(args: CachePolicyImplementationArgs<C, D>) =>
|
|
3
|
+
export declare function buildCacheAndNetworkImplementation(funcs: DurableCachePolicyFunctions, staleDurationSeconds?: number): <C, D>(args: CachePolicyImplementationArgs<C, D>) => Snapshot<D, unknown> | Promise<Snapshot<D, unknown>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CachePolicyImplementationArgs, Snapshot } from '@luvio/engine';
|
|
2
2
|
import { DurableCachePolicyFunctions } from './utils';
|
|
3
|
-
export declare function buildCacheThenNetworkImplementation(funcs: DurableCachePolicyFunctions): <C, D>(args: CachePolicyImplementationArgs<C, D>) =>
|
|
3
|
+
export declare function buildCacheThenNetworkImplementation(funcs: DurableCachePolicyFunctions): <C, D>(args: CachePolicyImplementationArgs<C, D>) => Snapshot<D, unknown> | Promise<Snapshot<D, unknown>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CachePolicyImplementationArgs, Snapshot } from '@luvio/engine';
|
|
2
2
|
import { DurableCachePolicyFunctions } from './utils';
|
|
3
|
-
export declare function buildNoCacheImplementation(funcs: DurableCachePolicyFunctions): <C, D>(args: CachePolicyImplementationArgs<C, D>) =>
|
|
3
|
+
export declare function buildNoCacheImplementation(funcs: DurableCachePolicyFunctions): <C, D>(args: CachePolicyImplementationArgs<C, D>) => Snapshot<D, unknown> | Promise<Snapshot<D, unknown>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { CachePolicyImplementationArgs,
|
|
1
|
+
import { CachePolicyImplementationArgs, Snapshot } from '@luvio/engine';
|
|
2
2
|
import { DurableCachePolicyFunctions } from './utils';
|
|
3
|
-
export declare function buildOnlyIfCachedImplementation(funcs: DurableCachePolicyFunctions): <C, D>(args: CachePolicyImplementationArgs<C, D>) =>
|
|
3
|
+
export declare function buildOnlyIfCachedImplementation(funcs: DurableCachePolicyFunctions): <C, D>(args: CachePolicyImplementationArgs<C, D>) => Snapshot<D, unknown> | Promise<Snapshot<D, unknown>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CachePolicyImplementationArgs, Snapshot } from '@luvio/engine';
|
|
2
2
|
import { DurableCachePolicyFunctions } from './utils';
|
|
3
|
-
export declare function buildStaleWhileRevalidateImplementation(funcs: DurableCachePolicyFunctions, staleDurationSeconds: number): <C, D>(args: CachePolicyImplementationArgs<C, D>) =>
|
|
3
|
+
export declare function buildStaleWhileRevalidateImplementation(funcs: DurableCachePolicyFunctions, staleDurationSeconds: number): <C, D>(args: CachePolicyImplementationArgs<C, D>) => Snapshot<D, unknown> | Promise<Snapshot<D, unknown>>;
|
|
@@ -14,6 +14,6 @@ declare const keys: {
|
|
|
14
14
|
<T_1 extends Function>(f: T_1): T_1;
|
|
15
15
|
<T_2>(o: T_2): Readonly<T_2>;
|
|
16
16
|
};
|
|
17
|
-
declare const hasOwnProperty: (v:
|
|
17
|
+
declare const hasOwnProperty: (v: PropertyKey) => boolean;
|
|
18
18
|
declare const isArray: (arg: any) => arg is any[];
|
|
19
19
|
export { create as ObjectCreate, keys as ObjectKeys, assign as ObjectAssign, freeze as ObjectFreeze, hasOwnProperty as ObjectPrototypeHasOwnProperty, isArray as ArrayIsArray, };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luvio/environments",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.63.3",
|
|
4
4
|
"description": "Luvio Environments",
|
|
5
5
|
"main": "dist/umd/es2018/environments.js",
|
|
6
6
|
"module": "dist/es/es2018/environments.js",
|
|
@@ -17,6 +17,6 @@
|
|
|
17
17
|
"dist/"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@luvio/engine": "0.
|
|
20
|
+
"@luvio/engine": "0.63.3"
|
|
21
21
|
}
|
|
22
22
|
}
|