@luvio/environments 0.63.1 → 0.63.2
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 +2 -0
- 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 +2 -0
- 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 +28 -24
- 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) {
|
|
@@ -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,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, };
|
|
@@ -19,18 +19,18 @@
|
|
|
19
19
|
var DefaultDurableSegment = 'DEFAULT';
|
|
20
20
|
|
|
21
21
|
/*! *****************************************************************************
|
|
22
|
-
Copyright (c) Microsoft Corporation.
|
|
23
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
24
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
25
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
22
|
+
Copyright (c) Microsoft Corporation.
|
|
26
23
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
30
|
-
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.
|
|
31
26
|
|
|
32
|
-
|
|
33
|
-
|
|
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.
|
|
34
34
|
***************************************************************************** */
|
|
35
35
|
|
|
36
36
|
var __assign = function() {
|
|
@@ -44,12 +44,14 @@
|
|
|
44
44
|
return __assign.apply(this, arguments);
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
function
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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));
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
var keys = Object.keys, create = Object.create, assign = Object.assign, freeze = Object.freeze;
|
|
@@ -225,6 +227,8 @@
|
|
|
225
227
|
error: error,
|
|
226
228
|
state: 'Error',
|
|
227
229
|
data: undefined,
|
|
230
|
+
// TODO[@W-10164067]: copy refresh data from the snapshot returned by buildInMemorySnapshot (if any)
|
|
231
|
+
// refresh: ...
|
|
228
232
|
};
|
|
229
233
|
}
|
|
230
234
|
function buildOnlyIfCachedImplementation(funcs) {
|
|
@@ -366,16 +370,16 @@
|
|
|
366
370
|
for (var i = 0, len = selections.length; i < len; i++) {
|
|
367
371
|
var selection = selections[i];
|
|
368
372
|
if (selection.kind === 'Object') {
|
|
369
|
-
nestedSelections =
|
|
373
|
+
nestedSelections = __spreadArray(__spreadArray([], nestedSelections, true), getSelections(selection.selections), true);
|
|
370
374
|
}
|
|
371
375
|
else if (selection.kind === 'Link') {
|
|
372
|
-
nestedSelections =
|
|
376
|
+
nestedSelections = __spreadArray(__spreadArray([], nestedSelections, true), getSelectionsFromFragment(selection.fragment), true);
|
|
373
377
|
}
|
|
374
378
|
else {
|
|
375
379
|
nonNestedSelections.push(selection);
|
|
376
380
|
}
|
|
377
381
|
}
|
|
378
|
-
return
|
|
382
|
+
return __spreadArray(__spreadArray([], nestedSelections, true), nonNestedSelections, true);
|
|
379
383
|
}
|
|
380
384
|
function getSelectionsFromFragment(fragment) {
|
|
381
385
|
var selections = [];
|
|
@@ -385,7 +389,7 @@
|
|
|
385
389
|
var unionKeys = keys(unionSelections);
|
|
386
390
|
for (var i = 0, len = unionKeys.length; i < len; i++) {
|
|
387
391
|
var key = unionKeys[i];
|
|
388
|
-
selections =
|
|
392
|
+
selections = __spreadArray(__spreadArray([], selections, true), unionSelections[key].selections, true);
|
|
389
393
|
}
|
|
390
394
|
}
|
|
391
395
|
// if fragment has selections properties then get them
|
|
@@ -566,7 +570,7 @@
|
|
|
566
570
|
var TTL_DURABLE_SEGMENT = 'TTL_DURABLE_SEGMENT';
|
|
567
571
|
var TTL_DEFAULT_KEY = 'TTL_DEFAULT_KEY';
|
|
568
572
|
function buildDurableTTLOverrideStoreKey(namespace, representationName) {
|
|
569
|
-
return namespace
|
|
573
|
+
return "".concat(namespace, "::").concat(representationName);
|
|
570
574
|
}
|
|
571
575
|
function isEntryDurableTTLOverride(entry) {
|
|
572
576
|
if (typeof entry === 'object' && entry !== undefined && entry !== null) {
|
|
@@ -649,7 +653,7 @@
|
|
|
649
653
|
}
|
|
650
654
|
if (isArray(source)) {
|
|
651
655
|
// TS doesn't trust that this new array is an array unless we cast it
|
|
652
|
-
return
|
|
656
|
+
return __spreadArray([], source, true);
|
|
653
657
|
}
|
|
654
658
|
return __assign({}, source);
|
|
655
659
|
}
|
|
@@ -947,7 +951,7 @@
|
|
|
947
951
|
validateNotDisposed();
|
|
948
952
|
var contextId = options.contextId, onContextLoaded = options.onContextLoaded;
|
|
949
953
|
var context = undefined;
|
|
950
|
-
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);
|
|
951
955
|
return function (config, requestContext) {
|
|
952
956
|
if (context === undefined) {
|
|
953
957
|
return contextAsPromise.then(function (revivedContext) {
|
|
@@ -1028,7 +1032,7 @@
|
|
|
1028
1032
|
}
|
|
1029
1033
|
default: {
|
|
1030
1034
|
if (process.env.NODE_ENV !== 'production') {
|
|
1031
|
-
throw new Error("unrecognized cache policy: "
|
|
1035
|
+
throw new Error("unrecognized cache policy: ".concat(JSON.stringify(cachePolicy)));
|
|
1032
1036
|
}
|
|
1033
1037
|
return defaultCachePolicy;
|
|
1034
1038
|
}
|
|
@@ -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.63.
|
|
3
|
+
"version": "0.63.2",
|
|
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.63.
|
|
20
|
+
"@luvio/engine": "0.63.2"
|
|
21
21
|
}
|
|
22
22
|
}
|