@platforma-sdk/model 1.48.14 → 1.50.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/src/internal.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ValueOrErrors } from '@milaboratories/pl-model-common';
1
+ import type { OutputWithStatus } from '@milaboratories/pl-model-common';
2
2
  import { } from './global';
3
3
  import type { Platforma, PlatformaApiVersion } from './platforma';
4
4
  import type { FutureHandle, GlobalCfgRenderCtx } from './render/internal';
@@ -13,7 +13,7 @@ export function isInUI() {
13
13
  /** Utility code helping to retrieve a platforma instance form the environment */
14
14
  export function getPlatformaInstance<
15
15
  Args = unknown,
16
- Outputs extends Record<string, ValueOrErrors<unknown>> = Record<string, ValueOrErrors<unknown>>,
16
+ Outputs extends Record<string, OutputWithStatus<unknown>> = Record<string, OutputWithStatus<unknown>>,
17
17
  UiState = unknown,
18
18
  Href extends `/${string}` = `/${string}`,
19
19
  >(config?: { sdkVersion: string; apiVersion: PlatformaApiVersion }): Platforma<Args, Outputs, UiState, Href> {
package/src/platforma.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  import type { BlockApiV1 } from './block_api_v1';
2
2
  import type { BlockApiV2 } from './block_api_v2';
3
- import type { BlockOutputsBase, BlockState, DriverKit, ValueOrErrors } from '@milaboratories/pl-model-common';
3
+ import type { BlockOutputsBase, BlockState, DriverKit, OutputWithStatus } from '@milaboratories/pl-model-common';
4
4
  import type { SdkInfo } from './sdk_info';
5
5
  import type { BlockStatePatch } from './block_state_patch';
6
6
 
7
7
  /** Defines all methods to interact with the platform environment from within a block UI. @deprecated */
8
8
  export interface PlatformaV1<
9
9
  Args = unknown,
10
- Outputs extends Record<string, ValueOrErrors<unknown>> = Record<string, ValueOrErrors<unknown>>,
10
+ Outputs extends Record<string, OutputWithStatus<unknown>> = Record<string, OutputWithStatus<unknown>>,
11
11
  UiState = unknown,
12
12
  Href extends `/${string}` = `/${string}`,
13
13
  > extends BlockApiV1<Args, Outputs, UiState, Href>,
@@ -20,7 +20,7 @@ export interface PlatformaV1<
20
20
  /** V2 version based on effective json patches pulling API */
21
21
  export interface PlatformaV2<
22
22
  Args = unknown,
23
- Outputs extends Record<string, ValueOrErrors<unknown>> = Record<string, ValueOrErrors<unknown>>,
23
+ Outputs extends Record<string, OutputWithStatus<unknown>> = Record<string, OutputWithStatus<unknown>>,
24
24
  UiState = unknown,
25
25
  Href extends `/${string}` = `/${string}`,
26
26
  > extends BlockApiV2<Args, Outputs, UiState, Href>,
@@ -32,7 +32,7 @@ export interface PlatformaV2<
32
32
 
33
33
  export type Platforma<
34
34
  Args = unknown,
35
- Outputs extends Record<string, ValueOrErrors<unknown>> = Record<string, ValueOrErrors<unknown>>,
35
+ Outputs extends Record<string, OutputWithStatus<unknown>> = Record<string, OutputWithStatus<unknown>>,
36
36
  UiState = unknown,
37
37
  Href extends `/${string}` = `/${string}`,
38
38
  > = PlatformaV1<Args, Outputs, UiState, Href> | PlatformaV2<Args, Outputs, UiState, Href>;
@@ -45,7 +45,7 @@ export type InferOutputsType<Pl extends Platforma> =
45
45
  Pl extends Platforma<unknown, infer Outputs> ? Outputs : never;
46
46
 
47
47
  export type InferUiState<Pl extends Platforma> =
48
- Pl extends Platforma<unknown, Record<string, ValueOrErrors<unknown>>, infer UiState>
48
+ Pl extends Platforma<unknown, Record<string, OutputWithStatus<unknown>>, infer UiState>
49
49
  ? UiState
50
50
  : never;
51
51
 
@@ -1,4 +1,4 @@
1
- import type { ValueOrErrors } from '@milaboratories/pl-model-common';
1
+ import type { OutputWithStatus } from '@milaboratories/pl-model-common';
2
2
  import {} from './global';
3
3
  import { getPlatformaInstance } from './internal';
4
4
  import type { Platforma, PlatformaApiVersion } from './platforma';
@@ -10,7 +10,7 @@ export function getPlatformaApiVersion(): PlatformaApiVersion {
10
10
 
11
11
  export function getRawPlatformaInstance<
12
12
  Args = unknown,
13
- Outputs extends Record<string, ValueOrErrors<unknown>> = Record<string, ValueOrErrors<unknown>>,
13
+ Outputs extends Record<string, OutputWithStatus<unknown>> = Record<string, OutputWithStatus<unknown>>,
14
14
  UiState = unknown,
15
15
  Href extends `/${string}` = `/${string}`,
16
16
  >(): Platforma<Args, Outputs, UiState, Href> {
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  BlockSection,
3
3
  LocalBlobHandleAndSize,
4
- RemoteBlobHandleAndSize,
5
- ValueOrErrors
4
+ OutputWithStatus,
5
+ RemoteBlobHandleAndSize
6
6
  } from '@milaboratories/pl-model-common';
7
7
  import { expect, test } from 'vitest';
8
8
  import { DeriveHref, StdCtx } from './bconfig';
@@ -117,8 +117,8 @@ test('test config content', () => {
117
117
  assertType<
118
118
  InferOutputsType<typeof platforma>,
119
119
  {
120
- cell1: ValueOrErrors<{ b: string[] }>;
121
- cell2: ValueOrErrors<'v1'[]>;
120
+ cell1: OutputWithStatus<{ b: string[] }>;
121
+ cell2: OutputWithStatus<'v1'[]>;
122
122
  }
123
123
  >();
124
124
 
@@ -161,7 +161,7 @@ test('test config 2', () => {
161
161
  assertType<
162
162
  InferOutputsType<typeof platforma>,
163
163
  {
164
- cell1: ValueOrErrors<{
164
+ cell1: OutputWithStatus<{
165
165
  b: string;
166
166
  c: [Uint8Array, 'asd'];
167
167
  d: string[];
@@ -169,8 +169,8 @@ test('test config 2', () => {
169
169
  f: LocalBlobHandleAndSize;
170
170
  g: RemoteBlobHandleAndSize;
171
171
  }>;
172
- cell2: ValueOrErrors<number>;
173
- cell3: ValueOrErrors<undefined>;
172
+ cell2: OutputWithStatus<number>;
173
+ cell3: OutputWithStatus<undefined>;
174
174
  }
175
175
  >();
176
176