@milaboratories/pl-client 2.5.1 → 2.5.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/core/final.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1106 -1096
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/core/final.ts +20 -3
- package/src/index.ts +1 -0
package/package.json
CHANGED
package/src/core/final.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { Optional } from 'utility-types';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
BasicResourceData,
|
|
4
|
+
getField,
|
|
5
|
+
isNotNullResourceId,
|
|
6
|
+
isNullResourceId,
|
|
7
|
+
ResourceData
|
|
8
|
+
} from './types';
|
|
3
9
|
|
|
4
10
|
/**
|
|
5
11
|
* Function is used to guide multiple layers of caching in pl-client and derived pl-tree.
|
|
@@ -29,12 +35,19 @@ function readyAndHasAllOutputsFilled(r: Optional<ResourceData, 'fields'>): boole
|
|
|
29
35
|
return true;
|
|
30
36
|
}
|
|
31
37
|
|
|
32
|
-
//
|
|
38
|
+
// solely for logging
|
|
33
39
|
const unknownResourceTypeNames = new Set<string>();
|
|
34
40
|
|
|
35
41
|
/** Default implementation, defining behaviour for built-in resource types. */
|
|
36
42
|
export const DefaultFinalResourceDataPredicate: FinalResourceDataPredicate = (r): boolean => {
|
|
37
43
|
switch (r.type.name) {
|
|
44
|
+
case 'StreamManager':
|
|
45
|
+
if (!readyOrDuplicateOrError(r)) return false;
|
|
46
|
+
if (r.fields === undefined) return true; // if fields are not provided basic resource state is not expected to change in the future
|
|
47
|
+
if (isNotNullResourceId(r.error)) return true;
|
|
48
|
+
const downloadable = getField(r as ResourceData, 'downloadable');
|
|
49
|
+
const stream = getField(r as ResourceData, 'stream');
|
|
50
|
+
return stream.value === downloadable.value;
|
|
38
51
|
case 'StdMap':
|
|
39
52
|
case 'std/map':
|
|
40
53
|
case 'EphStdMap':
|
|
@@ -62,12 +75,16 @@ export const DefaultFinalResourceDataPredicate: FinalResourceDataPredicate = (r)
|
|
|
62
75
|
case 'Frontend/FromUrl':
|
|
63
76
|
case 'Frontend/FromFolder':
|
|
64
77
|
case 'BObjectSpec':
|
|
78
|
+
case 'Blob':
|
|
79
|
+
case 'LSProvider':
|
|
65
80
|
return true;
|
|
66
81
|
case 'UserProject':
|
|
82
|
+
case 'Projects':
|
|
83
|
+
case 'ClientRoot':
|
|
67
84
|
return false;
|
|
68
85
|
default:
|
|
69
86
|
if (r.type.name.startsWith('Blob/')) return true;
|
|
70
|
-
else if (r.type.name.startsWith('BlobUpload/')) {
|
|
87
|
+
else if (r.type.name.startsWith('BlobUpload/') || r.type.name.startsWith('BlobIndex/')) {
|
|
71
88
|
return readyAndHasAllOutputsFilled(r);
|
|
72
89
|
} else if (r.type.name.startsWith('PColumnData/')) {
|
|
73
90
|
return readyOrDuplicateOrError(r);
|
package/src/index.ts
CHANGED