@milaboratories/pl-model-middle-layer 1.11.3 → 1.11.5

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.
Files changed (138) hide show
  1. package/dist/author_marker.d.ts +1 -1
  2. package/dist/block_meta/block_components.cjs +4 -4
  3. package/dist/block_meta/block_components.cjs.map +1 -1
  4. package/dist/block_meta/block_components.d.ts +1 -1
  5. package/dist/block_meta/block_components.js +4 -4
  6. package/dist/block_meta/block_components.js.map +1 -1
  7. package/dist/block_meta/block_description.cjs +6 -3
  8. package/dist/block_meta/block_description.cjs.map +1 -1
  9. package/dist/block_meta/block_description.d.ts +4 -4
  10. package/dist/block_meta/block_description.d.ts.map +1 -1
  11. package/dist/block_meta/block_description.js +6 -3
  12. package/dist/block_meta/block_description.js.map +1 -1
  13. package/dist/block_meta/block_id.cjs.map +1 -1
  14. package/dist/block_meta/block_id.d.ts +1 -1
  15. package/dist/block_meta/block_id.js.map +1 -1
  16. package/dist/block_meta/block_manifest.cjs +6 -4
  17. package/dist/block_meta/block_manifest.cjs.map +1 -1
  18. package/dist/block_meta/block_manifest.d.ts +2 -2
  19. package/dist/block_meta/block_manifest.d.ts.map +1 -1
  20. package/dist/block_meta/block_manifest.js +6 -4
  21. package/dist/block_meta/block_manifest.js.map +1 -1
  22. package/dist/block_meta/block_meta.cjs +10 -8
  23. package/dist/block_meta/block_meta.cjs.map +1 -1
  24. package/dist/block_meta/block_meta.d.ts +1 -1
  25. package/dist/block_meta/block_meta.d.ts.map +1 -1
  26. package/dist/block_meta/block_meta.js +10 -8
  27. package/dist/block_meta/block_meta.js.map +1 -1
  28. package/dist/block_meta/common.d.ts +2 -2
  29. package/dist/block_meta/content_conversion.cjs +6 -6
  30. package/dist/block_meta/content_conversion.cjs.map +1 -1
  31. package/dist/block_meta/content_conversion.d.ts +1 -1
  32. package/dist/block_meta/content_conversion.js +6 -6
  33. package/dist/block_meta/content_conversion.js.map +1 -1
  34. package/dist/block_meta/content_types.cjs +35 -35
  35. package/dist/block_meta/content_types.cjs.map +1 -1
  36. package/dist/block_meta/content_types.d.ts +1 -1
  37. package/dist/block_meta/content_types.js +35 -35
  38. package/dist/block_meta/content_types.js.map +1 -1
  39. package/dist/block_meta/index.d.ts +9 -9
  40. package/dist/block_meta/semver.cjs +1 -1
  41. package/dist/block_meta/semver.cjs.map +1 -1
  42. package/dist/block_meta/semver.d.ts +1 -1
  43. package/dist/block_meta/semver.js +1 -1
  44. package/dist/block_meta/semver.js.map +1 -1
  45. package/dist/block_registry/block_pack_spec.cjs +5 -5
  46. package/dist/block_registry/block_pack_spec.cjs.map +1 -1
  47. package/dist/block_registry/block_pack_spec.d.ts +1 -1
  48. package/dist/block_registry/block_pack_spec.js +5 -5
  49. package/dist/block_registry/block_pack_spec.js.map +1 -1
  50. package/dist/block_registry/index.d.ts +3 -3
  51. package/dist/block_registry/overview.cjs +18 -10
  52. package/dist/block_registry/overview.cjs.map +1 -1
  53. package/dist/block_registry/overview.d.ts +1 -1
  54. package/dist/block_registry/overview.d.ts.map +1 -1
  55. package/dist/block_registry/overview.js +18 -10
  56. package/dist/block_registry/overview.js.map +1 -1
  57. package/dist/block_registry/registry_spec.cjs +4 -4
  58. package/dist/block_registry/registry_spec.cjs.map +1 -1
  59. package/dist/block_registry/registry_spec.d.ts +1 -1
  60. package/dist/block_registry/registry_spec.js +4 -4
  61. package/dist/block_registry/registry_spec.js.map +1 -1
  62. package/dist/block_settings.cjs.map +1 -1
  63. package/dist/block_settings.d.ts +1 -1
  64. package/dist/block_settings.js.map +1 -1
  65. package/dist/block_state.d.ts +4 -4
  66. package/dist/block_state.d.ts.map +1 -1
  67. package/dist/index.d.ts +11 -11
  68. package/dist/json.cjs +4 -4
  69. package/dist/json.cjs.map +1 -1
  70. package/dist/json.d.ts +1 -1
  71. package/dist/json.d.ts.map +1 -1
  72. package/dist/json.js +4 -4
  73. package/dist/json.js.map +1 -1
  74. package/dist/pframe/index.d.ts +1 -1
  75. package/dist/pframe/internal_api/api_factory.cjs +2 -2
  76. package/dist/pframe/internal_api/api_factory.cjs.map +1 -1
  77. package/dist/pframe/internal_api/api_factory.d.ts +3 -3
  78. package/dist/pframe/internal_api/api_factory.js +2 -2
  79. package/dist/pframe/internal_api/api_factory.js.map +1 -1
  80. package/dist/pframe/internal_api/api_read.d.ts +6 -6
  81. package/dist/pframe/internal_api/api_read.d.ts.map +1 -1
  82. package/dist/pframe/internal_api/api_wasm.d.ts +4 -4
  83. package/dist/pframe/internal_api/api_wasm.d.ts.map +1 -1
  84. package/dist/pframe/internal_api/common.d.ts +3 -3
  85. package/dist/pframe/internal_api/common.d.ts.map +1 -1
  86. package/dist/pframe/internal_api/create_table.d.ts +9 -9
  87. package/dist/pframe/internal_api/create_table.d.ts.map +1 -1
  88. package/dist/pframe/internal_api/delete_column.d.ts +1 -1
  89. package/dist/pframe/internal_api/find_columns.d.ts +2 -2
  90. package/dist/pframe/internal_api/http_helpers.cjs +4 -4
  91. package/dist/pframe/internal_api/http_helpers.cjs.map +1 -1
  92. package/dist/pframe/internal_api/http_helpers.d.ts +43 -43
  93. package/dist/pframe/internal_api/http_helpers.d.ts.map +1 -1
  94. package/dist/pframe/internal_api/http_helpers.js +4 -4
  95. package/dist/pframe/internal_api/http_helpers.js.map +1 -1
  96. package/dist/pframe/internal_api/index.d.ts +11 -11
  97. package/dist/pframe/internal_api/pframe.d.ts +4 -4
  98. package/dist/pframe/internal_api/table.d.ts +2 -2
  99. package/dist/pframe/internal_api/table.d.ts.map +1 -1
  100. package/dist/project_list.d.ts +1 -1
  101. package/dist/project_overview.d.ts +7 -7
  102. package/dist/project_overview.d.ts.map +1 -1
  103. package/dist/update_info.d.ts +2 -2
  104. package/package.json +18 -17
  105. package/src/author_marker.ts +1 -1
  106. package/src/block_meta/block_components.ts +7 -7
  107. package/src/block_meta/block_description.ts +17 -14
  108. package/src/block_meta/block_id.ts +3 -3
  109. package/src/block_meta/block_manifest.ts +16 -14
  110. package/src/block_meta/block_meta.ts +17 -21
  111. package/src/block_meta/common.ts +2 -2
  112. package/src/block_meta/content_conversion.ts +7 -7
  113. package/src/block_meta/content_types.ts +35 -35
  114. package/src/block_meta/index.ts +9 -9
  115. package/src/block_meta/semver.ts +2 -2
  116. package/src/block_registry/block_pack_spec.ts +7 -7
  117. package/src/block_registry/index.ts +3 -3
  118. package/src/block_registry/overview.ts +34 -26
  119. package/src/block_registry/registry_spec.ts +5 -5
  120. package/src/block_settings.ts +1 -1
  121. package/src/block_state.ts +10 -4
  122. package/src/index.ts +11 -11
  123. package/src/json.ts +17 -11
  124. package/src/pframe/index.ts +1 -1
  125. package/src/pframe/internal_api/api_factory.ts +6 -6
  126. package/src/pframe/internal_api/api_read.ts +20 -14
  127. package/src/pframe/internal_api/api_wasm.ts +9 -20
  128. package/src/pframe/internal_api/common.ts +5 -7
  129. package/src/pframe/internal_api/create_table.ts +14 -9
  130. package/src/pframe/internal_api/delete_column.ts +1 -1
  131. package/src/pframe/internal_api/find_columns.ts +2 -2
  132. package/src/pframe/internal_api/http_helpers.ts +52 -52
  133. package/src/pframe/internal_api/index.ts +11 -11
  134. package/src/pframe/internal_api/pframe.ts +5 -5
  135. package/src/pframe/internal_api/table.ts +4 -8
  136. package/src/project_list.ts +1 -1
  137. package/src/project_overview.ts +14 -7
  138. package/src/update_info.ts +2 -2
@@ -1,4 +1,4 @@
1
- import { z } from 'zod';
1
+ import { z } from "zod";
2
2
 
3
3
  // Regex taken from here:
4
4
  // https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
@@ -6,5 +6,5 @@ export const SemVer = z
6
6
  .string()
7
7
  .regex(
8
8
  /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,
9
- 'Wrong version format, please use valid semver',
9
+ "Wrong version format, please use valid semver",
10
10
  );
@@ -1,10 +1,10 @@
1
- import { z } from 'zod';
2
- import { BlockPackId } from '../block_meta';
1
+ import { z } from "zod";
2
+ import { BlockPackId } from "../block_meta";
3
3
 
4
4
  /** Block pack from local folder, to be used during block development. Old layout.
5
5
  * @deprecated don't use */
6
6
  export const BlockPackDevV1 = z.object({
7
- type: z.literal('dev-v1'),
7
+ type: z.literal("dev-v1"),
8
8
  folder: z.string(),
9
9
  mtime: z.string().optional(),
10
10
  });
@@ -13,7 +13,7 @@ export type BlockPackDevV1 = z.infer<typeof BlockPackDevV1>;
13
13
 
14
14
  /** Block pack from local folder, to be used during block development. New layout. */
15
15
  export const BlockPackDevV2 = z.object({
16
- type: z.literal('dev-v2'),
16
+ type: z.literal("dev-v2"),
17
17
  folder: z.string(),
18
18
  mtime: z.string().optional(),
19
19
  });
@@ -25,7 +25,7 @@ export type BlockPackDevV2 = z.infer<typeof BlockPackDevV2>;
25
25
  * @deprecated don't use
26
26
  * */
27
27
  export const BlockPackFromRegistryV1 = z.object({
28
- type: z.literal('from-registry-v1'),
28
+ type: z.literal("from-registry-v1"),
29
29
  registryUrl: z.string(),
30
30
  id: BlockPackId,
31
31
  });
@@ -35,7 +35,7 @@ export type BlockPackFromRegistryV1 = z.infer<typeof BlockPackFromRegistryV1>;
35
35
  /** Block pack from registry with version 2 layout, to be loaded directly
36
36
  * from the client. */
37
37
  export const BlockPackFromRegistryV2 = z.object({
38
- type: z.literal('from-registry-v2'),
38
+ type: z.literal("from-registry-v2"),
39
39
  registryUrl: z.string(),
40
40
  id: BlockPackId,
41
41
  channel: z.string().optional(),
@@ -43,7 +43,7 @@ export const BlockPackFromRegistryV2 = z.object({
43
43
  export type BlockPackFromRegistryV2 = z.infer<typeof BlockPackFromRegistryV2>;
44
44
 
45
45
  /** Information about block origin, can be used to instantiate new blocks */
46
- export const BlockPackSpec = z.discriminatedUnion('type', [
46
+ export const BlockPackSpec = z.discriminatedUnion("type", [
47
47
  BlockPackDevV1,
48
48
  BlockPackDevV2,
49
49
  BlockPackFromRegistryV1,
@@ -1,3 +1,3 @@
1
- export * from './block_pack_spec';
2
- export * from './overview';
3
- export * from './registry_spec';
1
+ export * from "./block_pack_spec";
2
+ export * from "./overview";
3
+ export * from "./registry_spec";
@@ -1,44 +1,50 @@
1
- import { z } from 'zod';
1
+ import { z } from "zod";
2
2
  import {
3
3
  BlockPackId,
4
4
  BlockPackIdNoVersion,
5
5
  BlockPackMetaEmbeddedBytes,
6
6
  FeatureFlags,
7
7
  SemVer,
8
- } from '../block_meta';
9
- import type { BlockPackFromRegistryV2 } from './block_pack_spec';
10
- import { BlockPackSpec } from './block_pack_spec';
11
- import { RegistryEntry } from './registry_spec';
8
+ } from "../block_meta";
9
+ import type { BlockPackFromRegistryV2 } from "./block_pack_spec";
10
+ import { BlockPackSpec } from "./block_pack_spec";
11
+ import { RegistryEntry } from "./registry_spec";
12
12
 
13
13
  /**
14
14
  * Latest information about specific block pack. Contain information about latest version of the package.
15
15
  * */
16
- export const BlockPackOverviewLegacy = z.object({
17
- registryId: z.string(),
18
- id: BlockPackId,
19
- meta: BlockPackMetaEmbeddedBytes,
20
- spec: BlockPackSpec,
21
- otherVersions: z.array(SemVer),
22
- }).passthrough();
16
+ export const BlockPackOverviewLegacy = z
17
+ .object({
18
+ registryId: z.string(),
19
+ id: BlockPackId,
20
+ meta: BlockPackMetaEmbeddedBytes,
21
+ spec: BlockPackSpec,
22
+ otherVersions: z.array(SemVer),
23
+ })
24
+ .passthrough();
23
25
  export type BlockPackOverviewLegacy = z.infer<typeof BlockPackOverviewLegacy>;
24
26
 
25
- export const AnyChannel = 'any';
26
- export const StableChannel = 'stable';
27
+ export const AnyChannel = "any";
28
+ export const StableChannel = "stable";
27
29
 
28
- export const VersionWithChannels = z.object({
29
- version: SemVer,
30
- channels: z.array(z.string()),
31
- }).passthrough();
30
+ export const VersionWithChannels = z
31
+ .object({
32
+ version: SemVer,
33
+ channels: z.array(z.string()),
34
+ })
35
+ .passthrough();
32
36
 
33
37
  /**
34
38
  * Information about specific block pack version.
35
39
  * */
36
- export const SingleBlockPackOverview = z.object({
37
- id: BlockPackId,
38
- meta: BlockPackMetaEmbeddedBytes,
39
- featureFlags: FeatureFlags.optional(),
40
- spec: BlockPackSpec,
41
- }).passthrough();
40
+ export const SingleBlockPackOverview = z
41
+ .object({
42
+ id: BlockPackId,
43
+ meta: BlockPackMetaEmbeddedBytes,
44
+ featureFlags: FeatureFlags.optional(),
45
+ spec: BlockPackSpec,
46
+ })
47
+ .passthrough();
42
48
  export type SingleBlockPackOverview = z.infer<typeof SingleBlockPackOverview>;
43
49
 
44
50
  /**
@@ -53,11 +59,13 @@ export const BlockPackOverviewRaw = z.object({
53
59
  export const BlockPackOverview = BlockPackOverviewRaw.passthrough();
54
60
  export type BlockPackOverview = z.infer<typeof BlockPackOverview>;
55
61
 
56
- export const BlockPackOverviewNoRegistryId = BlockPackOverviewRaw.omit({ registryId: true }).passthrough();
62
+ export const BlockPackOverviewNoRegistryId = BlockPackOverviewRaw.omit({
63
+ registryId: true,
64
+ }).passthrough();
57
65
  export type BlockPackOverviewNoRegistryId = z.infer<typeof BlockPackOverviewNoRegistryId>;
58
66
 
59
67
  export const RegistryStatus = RegistryEntry.extend({
60
- status: z.union([z.literal('online'), z.literal('offline')]),
68
+ status: z.union([z.literal("online"), z.literal("offline")]),
61
69
  });
62
70
  export type RegistryStatus = z.infer<typeof RegistryStatus>;
63
71
 
@@ -1,26 +1,26 @@
1
- import { z } from 'zod';
1
+ import { z } from "zod";
2
2
 
3
3
  export const LocalDevFolder = z.object({
4
- type: z.literal('local-dev'),
4
+ type: z.literal("local-dev"),
5
5
  path: z.string(),
6
6
  });
7
7
  export type LocalDevFolder = z.infer<typeof LocalDevFolder>;
8
8
 
9
9
  /** @deprecated don't use */
10
10
  export const RemoteRegistryV1Spec = z.object({
11
- type: z.literal('remote-v1'),
11
+ type: z.literal("remote-v1"),
12
12
  url: z.string().url(),
13
13
  });
14
14
  /** @deprecated don't use */
15
15
  export type RemoteRegistryV1Spec = z.infer<typeof RemoteRegistryV1Spec>;
16
16
 
17
17
  export const RemoteRegistryV2Spec = z.object({
18
- type: z.literal('remote-v2'),
18
+ type: z.literal("remote-v2"),
19
19
  url: z.string().url(),
20
20
  });
21
21
  export type RemoteRegistryV2Spec = z.infer<typeof RemoteRegistryV2Spec>;
22
22
 
23
- export const RegistrySpec = z.discriminatedUnion('type', [
23
+ export const RegistrySpec = z.discriminatedUnion("type", [
24
24
  RemoteRegistryV1Spec,
25
25
  RemoteRegistryV2Spec,
26
26
  LocalDevFolder,
@@ -6,7 +6,7 @@
6
6
  * - `patch` - version of the block is completely locked
7
7
  *
8
8
  * */
9
- export type VersionLock = 'major' | 'minor' | 'patch';
9
+ export type VersionLock = "major" | "minor" | "patch";
10
10
 
11
11
  /**
12
12
  * Block settings, persisted on the backend.
@@ -1,6 +1,12 @@
1
- import type { AuthorMarker, BlockOutputsBase, BlockState, NavigationState, StringifiedJson } from '@milaboratories/pl-model-common';
2
- import type { StorageDebugView } from '@platforma-sdk/model';
3
- import type { Optional } from 'utility-types';
1
+ import type {
2
+ AuthorMarker,
3
+ BlockOutputsBase,
4
+ BlockState,
5
+ NavigationState,
6
+ StringifiedJson,
7
+ } from "@milaboratories/pl-model-common";
8
+ import type { StorageDebugView } from "@platforma-sdk/model";
9
+ import type { Optional } from "utility-types";
4
10
 
5
11
  // @deprecated TODO v3: keep this name, or rename to BlockStateInternalLegacy?
6
12
  export type BlockStateInternal<
@@ -8,7 +14,7 @@ export type BlockStateInternal<
8
14
  Outputs extends BlockOutputsBase = BlockOutputsBase,
9
15
  UiState = unknown,
10
16
  Href extends `/${string}` = `/${string}`,
11
- > = Optional<Readonly<BlockState<Args, Outputs, UiState, Href>>, 'outputs'>;
17
+ > = Optional<Readonly<BlockState<Args, Outputs, UiState, Href>>, "outputs">;
12
18
 
13
19
  // TODO: we should move this abstract convert for middle layer to the model
14
20
  export type BlockStateInternalV3<
package/src/index.ts CHANGED
@@ -1,12 +1,12 @@
1
- export * from './author_marker';
2
- export * from './block_settings';
3
- export * from './block_state';
4
- export * from './project';
5
- export * from './project_list';
6
- export * from './project_overview';
7
- export * from './update_info';
1
+ export * from "./author_marker";
2
+ export * from "./block_settings";
3
+ export * from "./block_state";
4
+ export * from "./project";
5
+ export * from "./project_list";
6
+ export * from "./project_overview";
7
+ export * from "./update_info";
8
8
 
9
- export * from './block_meta';
10
- export * from './block_registry';
11
- export * from './pframe';
12
- export * from './json';
9
+ export * from "./block_meta";
10
+ export * from "./block_registry";
11
+ export * from "./pframe";
12
+ export * from "./json";
package/src/json.ts CHANGED
@@ -4,28 +4,34 @@ import {
4
4
  type JsonCompatible,
5
5
  type JsonSerializable,
6
6
  type StringifiedJson,
7
- } from '@milaboratories/pl-model-common';
8
- import { createHash } from 'node:crypto';
9
- import fs from 'node:fs';
7
+ } from "@milaboratories/pl-model-common";
8
+ import { createHash } from "node:crypto";
9
+ import fs from "node:fs";
10
10
 
11
- export type HashedJson<T = unknown> = JsonCompatible<T> extends never ? never : string & {
12
- __json_hashed: T;
13
- };
11
+ export type HashedJson<T = unknown> =
12
+ JsonCompatible<T> extends never
13
+ ? never
14
+ : string & {
15
+ __json_hashed: T;
16
+ };
14
17
 
15
18
  export function hashJson<T>(value: JsonCompatible<T>): HashedJson<T>;
16
19
  export function hashJson<T extends JsonSerializable>(value: T): string;
17
20
  export function hashJson(value: unknown): string {
18
- const hash = createHash('sha256');
21
+ const hash = createHash("sha256");
19
22
  hash.update(canonicalizeJson(value));
20
- return hash.digest().toString('hex');
23
+ return hash.digest().toString("hex");
21
24
  }
22
25
 
23
- export async function readJson<T extends JsonSerializable>(filePath: string, signal?: AbortSignal): Promise<T> {
24
- const content = await fs.promises.readFile(filePath, { encoding: 'utf8', signal });
26
+ export async function readJson<T extends JsonSerializable>(
27
+ filePath: string,
28
+ signal?: AbortSignal,
29
+ ): Promise<T> {
30
+ const content = await fs.promises.readFile(filePath, { encoding: "utf8", signal });
25
31
  return parseJson(content as StringifiedJson<T>);
26
32
  }
27
33
 
28
34
  export function readJsonSync<T extends JsonSerializable>(filePath: string): T {
29
- const content = fs.readFileSync(filePath, { encoding: 'utf8' });
35
+ const content = fs.readFileSync(filePath, { encoding: "utf8" });
30
36
  return parseJson(content as StringifiedJson<T>);
31
37
  }
@@ -1 +1 @@
1
- export * as PFrameInternal from './internal_api';
1
+ export * as PFrameInternal from "./internal_api";
@@ -7,17 +7,17 @@ import type {
7
7
  ParquetPartitionedDataInfo,
8
8
  PColumnSpec,
9
9
  PObjectId,
10
- } from '@milaboratories/pl-model-common';
11
- import type { HttpServerInfo } from './http_helpers';
10
+ } from "@milaboratories/pl-model-common";
11
+ import type { HttpServerInfo } from "./http_helpers";
12
12
 
13
13
  /** PColumn spec file extension */
14
- export const SpecExtension = '.spec' as const;
14
+ export const SpecExtension = ".spec" as const;
15
15
 
16
16
  /** PColumn data info file extension */
17
- export const DataInfoExtension = '.datainfo' as const;
17
+ export const DataInfoExtension = ".datainfo" as const;
18
18
 
19
19
  /** Abstract identifier of a data blob that can be requested from the storage backend */
20
- export type PFrameBlobId = Branded<string, 'PFrameInternal.PFrameBlobId'>;
20
+ export type PFrameBlobId = Branded<string, "PFrameInternal.PFrameBlobId">;
21
21
 
22
22
  /** Path of the file containing requested data (blob). This path is returned by
23
23
  * {@link BlobPathResolver} as soon as blob materialized in the file system. */
@@ -72,7 +72,7 @@ export interface PFrameFactoryAPIV4 extends Disposable {
72
72
  dataInfo: DataInfo<PFrameBlobId>,
73
73
  options?: {
74
74
  signal?: AbortSignal;
75
- }
75
+ },
76
76
  ): Promise<void>;
77
77
 
78
78
  /** Releases all the data previously added to PFrame using methods above,
@@ -1,5 +1,8 @@
1
- import type { FindColumnsRequest, FindColumnsResponse } from './find_columns';
2
- import type { DeleteColumnFromColumnsRequest, DeleteColumnFromColumnsResponse } from './delete_column';
1
+ import type { FindColumnsRequest, FindColumnsResponse } from "./find_columns";
2
+ import type {
3
+ DeleteColumnFromColumnsRequest,
4
+ DeleteColumnFromColumnsResponse,
5
+ } from "./delete_column";
3
6
  import type {
4
7
  PColumnInfo,
5
8
  PColumnSpec,
@@ -9,10 +12,10 @@ import type {
9
12
  QueryData,
10
13
  AxisId,
11
14
  PColumnIdAndSpec,
12
- } from '@milaboratories/pl-model-common';
13
- import type { CreateTableRequestV4 } from './create_table';
14
- import type { PTableV8 } from './table';
15
- import type { PTableId } from './common';
15
+ } from "@milaboratories/pl-model-common";
16
+ import type { CreateTableRequestV4 } from "./create_table";
17
+ import type { PTableV8 } from "./table";
18
+ import type { PTableId } from "./common";
16
19
 
17
20
  /** Read interface exposed by PFrames library */
18
21
  export interface PFrameReadAPIV11 {
@@ -42,19 +45,22 @@ export interface PFrameReadAPIV11 {
42
45
  createTable(tableId: PTableId, request: CreateTableRequestV4): PTableV8;
43
46
 
44
47
  /** Creates table from data query and returns an object to access it */
45
- createTableByDataQuery(tableId: PTableId, request: {
46
- tableSpec: {
47
- axes: AxisId[];
48
- columns: PColumnIdAndSpec[];
49
- };
50
- dataQuery: QueryData;
51
- }): PTableV8;
48
+ createTableByDataQuery(
49
+ tableId: PTableId,
50
+ request: {
51
+ tableSpec: {
52
+ axes: AxisId[];
53
+ columns: PColumnIdAndSpec[];
54
+ };
55
+ dataQuery: QueryData;
56
+ },
57
+ ): PTableV8;
52
58
 
53
59
  /** Calculate set of unique values for a specific axis for the filtered set of records */
54
60
  getUniqueValues(
55
61
  request: UniqueValuesRequest,
56
62
  ops?: {
57
63
  signal?: AbortSignal;
58
- }
64
+ },
59
65
  ): Promise<UniqueValuesResponse>;
60
66
  }
@@ -10,15 +10,12 @@ import type {
10
10
  QueryData,
11
11
  QuerySpec,
12
12
  SingleAxisSelector,
13
- } from '@milaboratories/pl-model-common';
13
+ } from "@milaboratories/pl-model-common";
14
14
  import type {
15
15
  DeleteColumnFromColumnsRequest,
16
16
  DeleteColumnFromColumnsResponse,
17
- } from './delete_column';
18
- import type {
19
- FindColumnsRequest,
20
- FindColumnsResponse,
21
- } from './find_columns';
17
+ } from "./delete_column";
18
+ import type { FindColumnsRequest, FindColumnsResponse } from "./find_columns";
22
19
 
23
20
  export interface PFrameWasmAPI {
24
21
  /**
@@ -41,7 +38,7 @@ export interface PFrameWasmAPI {
41
38
  * Finds the index of an axis matching the given selector.
42
39
  */
43
40
  findAxis(spec: AxesSpec, selector: SingleAxisSelector): number;
44
- };
41
+ }
45
42
 
46
43
  /**
47
44
  * A PFrame represents a collection of columns that can be queried and joined.
@@ -50,16 +47,12 @@ export interface PFrameWasm extends Disposable {
50
47
  /**
51
48
  * Deletes columns from a columns specification.
52
49
  */
53
- deleteColumns(
54
- request: DeleteColumnFromColumnsRequest
55
- ): DeleteColumnFromColumnsResponse;
50
+ deleteColumns(request: DeleteColumnFromColumnsRequest): DeleteColumnFromColumnsResponse;
56
51
 
57
52
  /**
58
53
  * Finds columns in the PFrame matching the given filter criteria.
59
54
  */
60
- findColumns(
61
- request: FindColumnsRequest
62
- ): FindColumnsResponse;
55
+ findColumns(request: FindColumnsRequest): FindColumnsResponse;
63
56
  /**
64
57
  * Evaluates a query specification against this PFrame.
65
58
  *
@@ -67,9 +60,7 @@ export interface PFrameWasm extends Disposable {
67
60
  * etc.) and returns the resulting table specification along with the data
68
61
  * layer query representation.
69
62
  */
70
- evaluateQuery(
71
- request: QuerySpec
72
- ): EvaluateQueryResponse;
63
+ evaluateQuery(request: QuerySpec): EvaluateQueryResponse;
73
64
 
74
65
  /**
75
66
  * Rewrites a legacy query format (V4) to the current QuerySpec format.
@@ -78,9 +69,7 @@ export interface PFrameWasm extends Disposable {
78
69
  * and sorting into the new unified QuerySpec format with proper filter and
79
70
  * sort query nodes.
80
71
  */
81
- rewriteLegacyQuery(
82
- request: LegacyQuery
83
- ): QuerySpec;
72
+ rewriteLegacyQuery(request: LegacyQuery): QuerySpec;
84
73
  }
85
74
 
86
75
  /**
@@ -96,7 +85,7 @@ export type EvaluateQueryResponse = {
96
85
  * The data layer query representation with numeric indices,
97
86
  * suitable for execution by the data processing engine.
98
87
  */
99
- joinEntry: QueryData;
88
+ dataQuery: QueryData;
100
89
  };
101
90
 
102
91
  /**
@@ -1,13 +1,11 @@
1
1
  import type {
2
- AxisSpec, PFrameHandle,
2
+ AxisSpec,
3
+ PFrameHandle,
3
4
  PTableHandle,
4
5
  SingleAxisSelector,
5
- } from '@milaboratories/pl-model-common';
6
+ } from "@milaboratories/pl-model-common";
6
7
 
7
- export type Logger = (
8
- level: 'info' | 'warn' | 'error',
9
- message: string
10
- ) => void;
8
+ export type Logger = (level: "info" | "warn" | "error", message: string) => void;
11
9
 
12
10
  export type PFrameId = PFrameHandle;
13
11
 
@@ -24,7 +22,7 @@ export interface ColumnAxesWithQualifications {
24
22
  }
25
23
 
26
24
  export type ConstantAxisFilter = {
27
- type: 'constant';
25
+ type: "constant";
28
26
  axisIndex: number;
29
27
  constant: string | number;
30
28
  };
@@ -1,44 +1,49 @@
1
- import type { ConstantAxisFilter } from './common';
2
- import type { JsonDataInfo, PColumnSpec, PObjectId, PTableRecordFilter } from '@milaboratories/pl-model-common';
1
+ import type { ConstantAxisFilter } from "./common";
2
+ import type {
3
+ JsonDataInfo,
4
+ PColumnSpec,
5
+ PObjectId,
6
+ PTableRecordFilter,
7
+ } from "@milaboratories/pl-model-common";
3
8
 
4
9
  export interface ColumnJoinEntry {
5
- type: 'column';
10
+ type: "column";
6
11
  columnId: PObjectId;
7
12
  }
8
13
 
9
14
  export interface SlicedColumnJoinEntry {
10
- readonly type: 'slicedColumn';
15
+ readonly type: "slicedColumn";
11
16
  readonly columnId: PObjectId;
12
17
  readonly newId: PObjectId;
13
18
  readonly axisFilters: ConstantAxisFilter[];
14
19
  }
15
20
 
16
21
  export interface ArtificialColumnJoinEntry {
17
- readonly type: 'artificialColumn';
22
+ readonly type: "artificialColumn";
18
23
  readonly columnId: PObjectId;
19
24
  readonly newId: PObjectId;
20
25
  readonly axesIndices: number[];
21
26
  }
22
27
 
23
28
  export interface InlineColumnJoinEntry {
24
- readonly type: 'inlineColumn';
29
+ readonly type: "inlineColumn";
25
30
  readonly newId: PObjectId;
26
31
  readonly spec: PColumnSpec;
27
32
  readonly dataInfo: JsonDataInfo;
28
33
  }
29
34
 
30
35
  export interface InnerJoinV4 {
31
- type: 'inner';
36
+ type: "inner";
32
37
  entries: JoinEntryV4[];
33
38
  }
34
39
 
35
40
  export interface FullJoinV4 {
36
- type: 'full';
41
+ type: "full";
37
42
  entries: JoinEntryV4[];
38
43
  }
39
44
 
40
45
  export interface OuterJoinV4 {
41
- type: 'outer';
46
+ type: "outer";
42
47
  primary: JoinEntryV4;
43
48
  secondary: JoinEntryV4[];
44
49
  }
@@ -1,4 +1,4 @@
1
- import type { ColumnAxesWithQualifications } from './common';
1
+ import type { ColumnAxesWithQualifications } from "./common";
2
2
 
3
3
  export interface DeleteColumnFromColumnsRequest {
4
4
  columns: ColumnAxesWithQualifications[];
@@ -1,5 +1,5 @@
1
- import type { ColumnFilter, PColumnIdAndSpec } from '@milaboratories/pl-model-common';
2
- import type { AxisQualification, ColumnAxesWithQualifications } from './common';
1
+ import type { ColumnFilter, PColumnIdAndSpec } from "@milaboratories/pl-model-common";
2
+ import type { AxisQualification, ColumnAxesWithQualifications } from "./common";
3
3
 
4
4
  export interface FindColumnsRequest {
5
5
  columnFilter: ColumnFilter;