@milaboratories/pl-client 2.5.1 → 2.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@milaboratories/pl-client",
3
- "version": "2.5.1",
3
+ "version": "2.5.2",
4
4
  "description": "New TS/JS client for Platform API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",
package/src/core/final.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Optional } from 'utility-types';
2
- import { BasicResourceData, isNotNullResourceId, isNullResourceId, ResourceData } from './types';
2
+ import { BasicResourceData, getField, isNotNullResourceId, isNullResourceId, ResourceData } from './types';
3
3
 
4
4
  /**
5
5
  * Function is used to guide multiple layers of caching in pl-client and derived pl-tree.
@@ -29,12 +29,20 @@ function readyAndHasAllOutputsFilled(r: Optional<ResourceData, 'fields'>): boole
29
29
  return true;
30
30
  }
31
31
 
32
- // solaly for logging
32
+ // solely for logging
33
33
  const unknownResourceTypeNames = new Set<string>();
34
34
 
35
35
  /** Default implementation, defining behaviour for built-in resource types. */
36
36
  export const DefaultFinalResourceDataPredicate: FinalResourceDataPredicate = (r): boolean => {
37
37
  switch (r.type.name) {
38
+ case 'StreamManager':
39
+ if(!readyOrDuplicateOrError(r))
40
+ return false;
41
+ if (r.fields === undefined) return true; // if fields are not provided basic resource state is not expected to change in the future
42
+ if(isNotNullResourceId(r.error)) return true;
43
+ const downloadable = getField(r as ResourceData, "downloadable");
44
+ const stream = getField(r as ResourceData, "stream");
45
+ return stream.value === downloadable.value
38
46
  case 'StdMap':
39
47
  case 'std/map':
40
48
  case 'EphStdMap':
@@ -62,8 +70,11 @@ export const DefaultFinalResourceDataPredicate: FinalResourceDataPredicate = (r)
62
70
  case 'Frontend/FromUrl':
63
71
  case 'Frontend/FromFolder':
64
72
  case 'BObjectSpec':
73
+ case 'Blob':
65
74
  return true;
66
75
  case 'UserProject':
76
+ case 'Projects':
77
+ case 'ClientRoot':
67
78
  return false;
68
79
  default:
69
80
  if (r.type.name.startsWith('Blob/')) return true;
package/src/index.ts CHANGED
@@ -8,6 +8,7 @@ export * from './core/errors';
8
8
  export * from './core/default_client';
9
9
  export * from './core/unauth_client';
10
10
  export * from './core/auth';
11
+ export * from './core/final';
11
12
  export * from './helpers/tx_helpers';
12
13
  export * from './helpers/poll';
13
14