@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.
- package/dist/author_marker.d.ts +1 -1
- package/dist/block_meta/block_components.cjs +4 -4
- package/dist/block_meta/block_components.cjs.map +1 -1
- package/dist/block_meta/block_components.d.ts +1 -1
- package/dist/block_meta/block_components.js +4 -4
- package/dist/block_meta/block_components.js.map +1 -1
- package/dist/block_meta/block_description.cjs +6 -3
- package/dist/block_meta/block_description.cjs.map +1 -1
- package/dist/block_meta/block_description.d.ts +4 -4
- package/dist/block_meta/block_description.d.ts.map +1 -1
- package/dist/block_meta/block_description.js +6 -3
- package/dist/block_meta/block_description.js.map +1 -1
- package/dist/block_meta/block_id.cjs.map +1 -1
- package/dist/block_meta/block_id.d.ts +1 -1
- package/dist/block_meta/block_id.js.map +1 -1
- package/dist/block_meta/block_manifest.cjs +6 -4
- package/dist/block_meta/block_manifest.cjs.map +1 -1
- package/dist/block_meta/block_manifest.d.ts +2 -2
- package/dist/block_meta/block_manifest.d.ts.map +1 -1
- package/dist/block_meta/block_manifest.js +6 -4
- package/dist/block_meta/block_manifest.js.map +1 -1
- package/dist/block_meta/block_meta.cjs +10 -8
- package/dist/block_meta/block_meta.cjs.map +1 -1
- package/dist/block_meta/block_meta.d.ts +1 -1
- package/dist/block_meta/block_meta.d.ts.map +1 -1
- package/dist/block_meta/block_meta.js +10 -8
- package/dist/block_meta/block_meta.js.map +1 -1
- package/dist/block_meta/common.d.ts +2 -2
- package/dist/block_meta/content_conversion.cjs +6 -6
- package/dist/block_meta/content_conversion.cjs.map +1 -1
- package/dist/block_meta/content_conversion.d.ts +1 -1
- package/dist/block_meta/content_conversion.js +6 -6
- package/dist/block_meta/content_conversion.js.map +1 -1
- package/dist/block_meta/content_types.cjs +35 -35
- package/dist/block_meta/content_types.cjs.map +1 -1
- package/dist/block_meta/content_types.d.ts +1 -1
- package/dist/block_meta/content_types.js +35 -35
- package/dist/block_meta/content_types.js.map +1 -1
- package/dist/block_meta/index.d.ts +9 -9
- package/dist/block_meta/semver.cjs +1 -1
- package/dist/block_meta/semver.cjs.map +1 -1
- package/dist/block_meta/semver.d.ts +1 -1
- package/dist/block_meta/semver.js +1 -1
- package/dist/block_meta/semver.js.map +1 -1
- package/dist/block_registry/block_pack_spec.cjs +5 -5
- package/dist/block_registry/block_pack_spec.cjs.map +1 -1
- package/dist/block_registry/block_pack_spec.d.ts +1 -1
- package/dist/block_registry/block_pack_spec.js +5 -5
- package/dist/block_registry/block_pack_spec.js.map +1 -1
- package/dist/block_registry/index.d.ts +3 -3
- package/dist/block_registry/overview.cjs +18 -10
- package/dist/block_registry/overview.cjs.map +1 -1
- package/dist/block_registry/overview.d.ts +1 -1
- package/dist/block_registry/overview.d.ts.map +1 -1
- package/dist/block_registry/overview.js +18 -10
- package/dist/block_registry/overview.js.map +1 -1
- package/dist/block_registry/registry_spec.cjs +4 -4
- package/dist/block_registry/registry_spec.cjs.map +1 -1
- package/dist/block_registry/registry_spec.d.ts +1 -1
- package/dist/block_registry/registry_spec.js +4 -4
- package/dist/block_registry/registry_spec.js.map +1 -1
- package/dist/block_settings.cjs.map +1 -1
- package/dist/block_settings.d.ts +1 -1
- package/dist/block_settings.js.map +1 -1
- package/dist/block_state.d.ts +4 -4
- package/dist/block_state.d.ts.map +1 -1
- package/dist/index.d.ts +11 -11
- package/dist/json.cjs +4 -4
- package/dist/json.cjs.map +1 -1
- package/dist/json.d.ts +1 -1
- package/dist/json.d.ts.map +1 -1
- package/dist/json.js +4 -4
- package/dist/json.js.map +1 -1
- package/dist/pframe/index.d.ts +1 -1
- package/dist/pframe/internal_api/api_factory.cjs +2 -2
- package/dist/pframe/internal_api/api_factory.cjs.map +1 -1
- package/dist/pframe/internal_api/api_factory.d.ts +3 -3
- package/dist/pframe/internal_api/api_factory.js +2 -2
- package/dist/pframe/internal_api/api_factory.js.map +1 -1
- package/dist/pframe/internal_api/api_read.d.ts +6 -6
- package/dist/pframe/internal_api/api_read.d.ts.map +1 -1
- package/dist/pframe/internal_api/api_wasm.d.ts +4 -4
- package/dist/pframe/internal_api/api_wasm.d.ts.map +1 -1
- package/dist/pframe/internal_api/common.d.ts +3 -3
- package/dist/pframe/internal_api/common.d.ts.map +1 -1
- package/dist/pframe/internal_api/create_table.d.ts +9 -9
- package/dist/pframe/internal_api/create_table.d.ts.map +1 -1
- package/dist/pframe/internal_api/delete_column.d.ts +1 -1
- package/dist/pframe/internal_api/find_columns.d.ts +2 -2
- package/dist/pframe/internal_api/http_helpers.cjs +4 -4
- package/dist/pframe/internal_api/http_helpers.cjs.map +1 -1
- package/dist/pframe/internal_api/http_helpers.d.ts +43 -43
- package/dist/pframe/internal_api/http_helpers.d.ts.map +1 -1
- package/dist/pframe/internal_api/http_helpers.js +4 -4
- package/dist/pframe/internal_api/http_helpers.js.map +1 -1
- package/dist/pframe/internal_api/index.d.ts +11 -11
- package/dist/pframe/internal_api/pframe.d.ts +4 -4
- package/dist/pframe/internal_api/table.d.ts +2 -2
- package/dist/pframe/internal_api/table.d.ts.map +1 -1
- package/dist/project_list.d.ts +1 -1
- package/dist/project_overview.d.ts +7 -7
- package/dist/project_overview.d.ts.map +1 -1
- package/dist/update_info.d.ts +2 -2
- package/package.json +18 -17
- package/src/author_marker.ts +1 -1
- package/src/block_meta/block_components.ts +7 -7
- package/src/block_meta/block_description.ts +17 -14
- package/src/block_meta/block_id.ts +3 -3
- package/src/block_meta/block_manifest.ts +16 -14
- package/src/block_meta/block_meta.ts +17 -21
- package/src/block_meta/common.ts +2 -2
- package/src/block_meta/content_conversion.ts +7 -7
- package/src/block_meta/content_types.ts +35 -35
- package/src/block_meta/index.ts +9 -9
- package/src/block_meta/semver.ts +2 -2
- package/src/block_registry/block_pack_spec.ts +7 -7
- package/src/block_registry/index.ts +3 -3
- package/src/block_registry/overview.ts +34 -26
- package/src/block_registry/registry_spec.ts +5 -5
- package/src/block_settings.ts +1 -1
- package/src/block_state.ts +10 -4
- package/src/index.ts +11 -11
- package/src/json.ts +17 -11
- package/src/pframe/index.ts +1 -1
- package/src/pframe/internal_api/api_factory.ts +6 -6
- package/src/pframe/internal_api/api_read.ts +20 -14
- package/src/pframe/internal_api/api_wasm.ts +9 -20
- package/src/pframe/internal_api/common.ts +5 -7
- package/src/pframe/internal_api/create_table.ts +14 -9
- package/src/pframe/internal_api/delete_column.ts +1 -1
- package/src/pframe/internal_api/find_columns.ts +2 -2
- package/src/pframe/internal_api/http_helpers.ts +52 -52
- package/src/pframe/internal_api/index.ts +11 -11
- package/src/pframe/internal_api/pframe.ts +5 -5
- package/src/pframe/internal_api/table.ts +4 -8
- package/src/project_list.ts +1 -1
- package/src/project_overview.ts +14 -7
- package/src/update_info.ts +2 -2
package/src/block_meta/semver.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from
|
|
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
|
-
|
|
9
|
+
"Wrong version format, please use valid semver",
|
|
10
10
|
);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { BlockPackId } from
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
46
|
+
export const BlockPackSpec = z.discriminatedUnion("type", [
|
|
47
47
|
BlockPackDevV1,
|
|
48
48
|
BlockPackDevV2,
|
|
49
49
|
BlockPackFromRegistryV1,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
1
|
+
export * from "./block_pack_spec";
|
|
2
|
+
export * from "./overview";
|
|
3
|
+
export * from "./registry_spec";
|
|
@@ -1,44 +1,50 @@
|
|
|
1
|
-
import { z } from
|
|
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
|
|
9
|
-
import type { BlockPackFromRegistryV2 } from
|
|
10
|
-
import { BlockPackSpec } from
|
|
11
|
-
import { RegistryEntry } from
|
|
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
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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 =
|
|
26
|
-
export const StableChannel =
|
|
27
|
+
export const AnyChannel = "any";
|
|
28
|
+
export const StableChannel = "stable";
|
|
27
29
|
|
|
28
|
-
export const VersionWithChannels = z
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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({
|
|
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(
|
|
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
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
export const LocalDevFolder = z.object({
|
|
4
|
-
type: z.literal(
|
|
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(
|
|
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(
|
|
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(
|
|
23
|
+
export const RegistrySpec = z.discriminatedUnion("type", [
|
|
24
24
|
RemoteRegistryV1Spec,
|
|
25
25
|
RemoteRegistryV2Spec,
|
|
26
26
|
LocalDevFolder,
|
package/src/block_settings.ts
CHANGED
package/src/block_state.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
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>>,
|
|
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
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
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
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
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
|
|
8
|
-
import { createHash } from
|
|
9
|
-
import fs from
|
|
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> =
|
|
12
|
-
|
|
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(
|
|
21
|
+
const hash = createHash("sha256");
|
|
19
22
|
hash.update(canonicalizeJson(value));
|
|
20
|
-
return hash.digest().toString(
|
|
23
|
+
return hash.digest().toString("hex");
|
|
21
24
|
}
|
|
22
25
|
|
|
23
|
-
export async function readJson<T extends JsonSerializable>(
|
|
24
|
-
|
|
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:
|
|
35
|
+
const content = fs.readFileSync(filePath, { encoding: "utf8" });
|
|
30
36
|
return parseJson(content as StringifiedJson<T>);
|
|
31
37
|
}
|
package/src/pframe/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * as PFrameInternal from
|
|
1
|
+
export * as PFrameInternal from "./internal_api";
|
|
@@ -7,17 +7,17 @@ import type {
|
|
|
7
7
|
ParquetPartitionedDataInfo,
|
|
8
8
|
PColumnSpec,
|
|
9
9
|
PObjectId,
|
|
10
|
-
} from
|
|
11
|
-
import type { HttpServerInfo } from
|
|
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 =
|
|
14
|
+
export const SpecExtension = ".spec" as const;
|
|
15
15
|
|
|
16
16
|
/** PColumn data info file extension */
|
|
17
|
-
export const DataInfoExtension =
|
|
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,
|
|
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
|
|
2
|
-
import type {
|
|
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
|
|
13
|
-
import type { CreateTableRequestV4 } from
|
|
14
|
-
import type { PTableV8 } from
|
|
15
|
-
import type { PTableId } from
|
|
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(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
|
13
|
+
} from "@milaboratories/pl-model-common";
|
|
14
14
|
import type {
|
|
15
15
|
DeleteColumnFromColumnsRequest,
|
|
16
16
|
DeleteColumnFromColumnsResponse,
|
|
17
|
-
} from
|
|
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
|
-
|
|
88
|
+
dataQuery: QueryData;
|
|
100
89
|
};
|
|
101
90
|
|
|
102
91
|
/**
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import type {
|
|
2
|
-
AxisSpec,
|
|
2
|
+
AxisSpec,
|
|
3
|
+
PFrameHandle,
|
|
3
4
|
PTableHandle,
|
|
4
5
|
SingleAxisSelector,
|
|
5
|
-
} from
|
|
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:
|
|
25
|
+
type: "constant";
|
|
28
26
|
axisIndex: number;
|
|
29
27
|
constant: string | number;
|
|
30
28
|
};
|
|
@@ -1,44 +1,49 @@
|
|
|
1
|
-
import type { ConstantAxisFilter } from
|
|
2
|
-
import type {
|
|
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:
|
|
10
|
+
type: "column";
|
|
6
11
|
columnId: PObjectId;
|
|
7
12
|
}
|
|
8
13
|
|
|
9
14
|
export interface SlicedColumnJoinEntry {
|
|
10
|
-
readonly type:
|
|
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:
|
|
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:
|
|
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:
|
|
36
|
+
type: "inner";
|
|
32
37
|
entries: JoinEntryV4[];
|
|
33
38
|
}
|
|
34
39
|
|
|
35
40
|
export interface FullJoinV4 {
|
|
36
|
-
type:
|
|
41
|
+
type: "full";
|
|
37
42
|
entries: JoinEntryV4[];
|
|
38
43
|
}
|
|
39
44
|
|
|
40
45
|
export interface OuterJoinV4 {
|
|
41
|
-
type:
|
|
46
|
+
type: "outer";
|
|
42
47
|
primary: JoinEntryV4;
|
|
43
48
|
secondary: JoinEntryV4[];
|
|
44
49
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ColumnFilter, PColumnIdAndSpec } from
|
|
2
|
-
import type { AxisQualification, ColumnAxesWithQualifications } from
|
|
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;
|