@milaboratories/pl-model-common 1.3.9 → 1.3.11

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 (71) hide show
  1. package/dist/block.d.ts +2 -0
  2. package/dist/block.d.ts.map +1 -0
  3. package/dist/block_state.d.ts +22 -0
  4. package/dist/block_state.d.ts.map +1 -0
  5. package/dist/branding.d.ts +7 -0
  6. package/dist/branding.d.ts.map +1 -0
  7. package/dist/common_types.d.ts +12 -0
  8. package/dist/common_types.d.ts.map +1 -0
  9. package/dist/driver_kit.d.ts +20 -0
  10. package/dist/driver_kit.d.ts.map +1 -0
  11. package/dist/drivers/blob.d.ts +32 -0
  12. package/dist/drivers/blob.d.ts.map +1 -0
  13. package/dist/drivers/index.d.ts +6 -0
  14. package/dist/drivers/index.d.ts.map +1 -0
  15. package/dist/drivers/log.d.ts +61 -0
  16. package/dist/drivers/log.d.ts.map +1 -0
  17. package/dist/drivers/ls.d.ts +38 -0
  18. package/dist/drivers/ls.d.ts.map +1 -0
  19. package/dist/drivers/pframe/column_filter.d.ts +16 -0
  20. package/dist/drivers/pframe/column_filter.d.ts.map +1 -0
  21. package/dist/drivers/pframe/data.d.ts +51 -0
  22. package/dist/drivers/pframe/data.d.ts.map +1 -0
  23. package/dist/drivers/pframe/driver.d.ts +50 -0
  24. package/dist/drivers/pframe/driver.d.ts.map +1 -0
  25. package/dist/drivers/pframe/find_columns.d.ts +27 -0
  26. package/dist/drivers/pframe/find_columns.d.ts.map +1 -0
  27. package/dist/drivers/pframe/index.d.ts +11 -0
  28. package/dist/drivers/pframe/index.d.ts.map +1 -0
  29. package/dist/drivers/pframe/pframe.d.ts +24 -0
  30. package/dist/drivers/pframe/pframe.d.ts.map +1 -0
  31. package/dist/drivers/pframe/spec.d.ts +106 -0
  32. package/dist/drivers/pframe/spec.d.ts.map +1 -0
  33. package/dist/drivers/pframe/table.d.ts +29 -0
  34. package/dist/drivers/pframe/table.d.ts.map +1 -0
  35. package/dist/drivers/pframe/table_calculate.d.ts +196 -0
  36. package/dist/drivers/pframe/table_calculate.d.ts.map +1 -0
  37. package/dist/drivers/pframe/table_common.d.ts +23 -0
  38. package/dist/drivers/pframe/table_common.d.ts.map +1 -0
  39. package/dist/drivers/pframe/type_util.d.ts +5 -0
  40. package/dist/drivers/pframe/type_util.d.ts.map +1 -0
  41. package/dist/drivers/pframe/unique_values.d.ts +22 -0
  42. package/dist/drivers/pframe/unique_values.d.ts.map +1 -0
  43. package/dist/drivers/upload.d.ts +22 -0
  44. package/dist/drivers/upload.d.ts.map +1 -0
  45. package/dist/index.d.ts +11 -0
  46. package/dist/index.d.ts.map +1 -0
  47. package/dist/index.js +1 -148
  48. package/dist/index.js.map +1 -1
  49. package/dist/index.mjs +141 -0
  50. package/dist/index.mjs.map +1 -0
  51. package/dist/navigation.d.ts +26 -0
  52. package/dist/navigation.d.ts.map +1 -0
  53. package/dist/pool/entry.d.ts +16 -0
  54. package/dist/pool/entry.d.ts.map +1 -0
  55. package/dist/pool/index.d.ts +4 -0
  56. package/dist/pool/index.d.ts.map +1 -0
  57. package/dist/pool/query.d.ts +28 -0
  58. package/dist/pool/query.d.ts.map +1 -0
  59. package/dist/pool/spec.d.ts +30 -0
  60. package/dist/pool/spec.d.ts.map +1 -0
  61. package/dist/ref.d.ts +25 -0
  62. package/dist/ref.d.ts.map +1 -0
  63. package/dist/utag.d.ts +14 -0
  64. package/dist/utag.d.ts.map +1 -0
  65. package/dist/util.d.ts +2 -0
  66. package/dist/util.d.ts.map +1 -0
  67. package/dist/value_or_error.d.ts +9 -0
  68. package/dist/value_or_error.d.ts.map +1 -0
  69. package/package.json +12 -9
  70. package/dist/index.cjs +0 -170
  71. package/dist/index.cjs.map +0 -1
@@ -0,0 +1,2 @@
1
+ export type BlockRenderingMode = 'Light' | 'Heavy' | 'DualContextHeavy';
2
+ //# sourceMappingURL=block.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../src/block.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,OAAO,GAAG,kBAAkB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { BlockOutputsBase } from './common_types';
2
+ import { NavigationState } from './navigation';
3
+ /**
4
+ * @template Args sets type of block arguments passed to the workflow
5
+ * @template Outputs type of the outputs returned by the workflow and rendered
6
+ * according to the output configuration specified for the block
7
+ * @template UiState data that stores only UI related state, that is not passed
8
+ * to the workflow
9
+ * @template Href typed href to represent navigation state
10
+ */
11
+ export type BlockState<Args = unknown, Outputs extends BlockOutputsBase = BlockOutputsBase, UiState = unknown, Href extends `/${string}` = `/${string}`> = {
12
+ /** Block arguments passed to the workflow */
13
+ args: Args;
14
+ /** UI State persisted in the block state but not passed to the backend
15
+ * template */
16
+ ui: UiState;
17
+ /** Outputs rendered with block config */
18
+ outputs: Outputs;
19
+ /** Current navigation state */
20
+ navigationState: NavigationState<Href>;
21
+ };
22
+ //# sourceMappingURL=block_state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block_state.d.ts","sourceRoot":"","sources":["../src/block_state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,CACpB,IAAI,GAAG,OAAO,EACd,OAAO,SAAS,gBAAgB,GAAG,gBAAgB,EACnD,OAAO,GAAG,OAAO,EACjB,IAAI,SAAS,IAAI,MAAM,EAAE,GAAG,IAAI,MAAM,EAAE,IACtC;IACF,6CAA6C;IAC7C,IAAI,EAAE,IAAI,CAAC;IAEX;kBACc;IACd,EAAE,EAAE,OAAO,CAAC;IAEZ,yCAAyC;IACzC,OAAO,EAAE,OAAO,CAAC;IAEjB,+BAA+B;IAC/B,eAAe,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;CACxC,CAAC"}
@@ -0,0 +1,7 @@
1
+ declare const __brand: unique symbol;
2
+ type Brand<B> = {
3
+ [__brand]: B;
4
+ };
5
+ export type Branded<T, B> = T & Brand<B>;
6
+ export {};
7
+ //# sourceMappingURL=branding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"branding.d.ts","sourceRoot":"","sources":["../src/branding.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,OAAO,EAAE,OAAO,MAAM,CAAC;AACrC,KAAK,KAAK,CAAC,CAAC,IAAI;IAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;CAAE,CAAC;AAEjC,MAAM,MAAM,OAAO,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ /** Value or errors */
2
+ export type ValueOrErrors<T> = {
3
+ ok: true;
4
+ value: T;
5
+ } | {
6
+ ok: false;
7
+ errors: string[];
8
+ moreErrors: boolean;
9
+ };
10
+ /** Base type for block outputs */
11
+ export type BlockOutputsBase = Record<string, ValueOrErrors<unknown>>;
12
+ //# sourceMappingURL=common_types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common_types.d.ts","sourceRoot":"","sources":["../src/common_types.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,MAAM,MAAM,aAAa,CAAC,CAAC,IACvB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GACtB;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IAAC,UAAU,EAAE,OAAO,CAAA;CAAE,CAAC;AAEzD,kCAAkC;AAClC,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { BlobDriver, LogsDriver, LsDriver, PFrameDriver } from './drivers';
2
+ /** Set of all drivers exposed in UI SDK via the platforma object. */
3
+ export interface DriverKit {
4
+ /** Driver allowing to retrieve blob data */
5
+ readonly blobDriver: BlobDriver;
6
+ /** Driver allowing to dynamically work with logs */
7
+ readonly logDriver: LogsDriver;
8
+ /**
9
+ * Driver allowing to list local and remote files that current user has
10
+ * access to.
11
+ *
12
+ * Along with file listing this driver provides import handles for listed
13
+ * files, that can be communicated to the workflow via block arguments,
14
+ * converted into blobs using standard workflow library functions.
15
+ * */
16
+ readonly lsDriver: LsDriver;
17
+ /** Driver allowing to interact with PFrames and PTables */
18
+ readonly pFrameDriver: PFrameDriver;
19
+ }
20
+ //# sourceMappingURL=driver_kit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"driver_kit.d.ts","sourceRoot":"","sources":["../src/driver_kit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE3E,qEAAqE;AACrE,MAAM,WAAW,SAAS;IACxB,4CAA4C;IAC5C,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAEhC,oDAAoD;IACpD,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;IAE/B;;;;;;;SAOK;IACL,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAE5B,2DAA2D;IAC3D,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;CACrC"}
@@ -0,0 +1,32 @@
1
+ import { Branded } from '../branding';
2
+ /** Handle of locally downloaded blob. This handle is issued only after the
3
+ * blob's content is downloaded locally, and ready for quick access. */
4
+ export type LocalBlobHandle = Branded<string, 'LocalBlobHandle'>;
5
+ /** Handle of remote blob. This handle is issued as soon as the data becomes
6
+ * available on the remote server. */
7
+ export type RemoteBlobHandle = Branded<string, 'RemoteBlobHandle'>;
8
+ /** Being configured inside the output structure provides information about
9
+ * blob's content and means to retrieve it when needed. */
10
+ export interface BlobHandleAndSize<H extends LocalBlobHandle | RemoteBlobHandle = LocalBlobHandle | RemoteBlobHandle> {
11
+ /** Handle to retrieve block content using {@link BlobDriver.getContent()} */
12
+ readonly handle: H;
13
+ /** Blob size in bytes. */
14
+ readonly size: number;
15
+ }
16
+ /** Being configured inside the output structure provides information about
17
+ * locally downloaded blob and means to retrieve it's content when needed. This
18
+ * structure is created only after the blob's content is downloaded locally, and
19
+ * ready for quick access. */
20
+ export type LocalBlobHandleAndSize = BlobHandleAndSize<LocalBlobHandle>;
21
+ /** Being configured inside the output structure provides information about
22
+ * remote blob and means to retrieve it's content when needed. This structure
23
+ * is created as soon as remote blob becomes available. */
24
+ export type RemoteBlobHandleAndSize = BlobHandleAndSize<RemoteBlobHandle>;
25
+ /** Defines API of blob driver as it is seen from the block UI code. */
26
+ export interface BlobDriver {
27
+ /** Given the blob handle returns its content. Depending on the handle type,
28
+ * content will be served from locally downloaded file, or directly from
29
+ * remote platforma storage. */
30
+ getContent(handle: LocalBlobHandle | RemoteBlobHandle): Promise<Uint8Array>;
31
+ }
32
+ //# sourceMappingURL=blob.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blob.d.ts","sourceRoot":"","sources":["../../src/drivers/blob.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC;uEACuE;AACvE,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAEjE;qCACqC;AACrC,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;AAEnE;0DAC0D;AAC1D,MAAM,WAAW,iBAAiB,CAChC,CAAC,SAAS,eAAe,GAAG,gBAAgB,GACxC,eAAe,GACf,gBAAgB;IAEpB,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IAEnB,0BAA0B;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;6BAG6B;AAC7B,MAAM,MAAM,sBAAsB,GAAG,iBAAiB,CAAC,eAAe,CAAC,CAAC;AAExE;;0DAE0D;AAC1D,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;AAE1E,uEAAuE;AACvE,MAAM,WAAW,UAAU;IACzB;;mCAE+B;IAC/B,UAAU,CAAC,MAAM,EAAE,eAAe,GAAG,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CAC7E"}
@@ -0,0 +1,6 @@
1
+ export * from './blob';
2
+ export * from './upload';
3
+ export * from './log';
4
+ export * from './ls';
5
+ export * from './pframe';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/drivers/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,MAAM,CAAC;AAErB,cAAc,UAAU,CAAC"}
@@ -0,0 +1,61 @@
1
+ /** Handle of logs. This handle should be passed
2
+ * to the driver for retrieving logs. */
3
+ export type AnyLogHandle = LiveLogHandle | ReadyLogHandle;
4
+ /** Handle of the live logs of a program.
5
+ * The resource that represents a log can be deleted,
6
+ * in this case the handle should be refreshed. */
7
+ export type LiveLogHandle = `log+live://log/${string}`;
8
+ /** Handle of the ready logs of a program. */
9
+ export type ReadyLogHandle = `log+ready://log/${string}`;
10
+ /** Driver to retrieve logs given log handle */
11
+ export interface LogsDriver {
12
+ lastLines(
13
+ /** A handle that was issued previously. */
14
+ handle: AnyLogHandle,
15
+ /** Allows client to limit total data sent from server. */
16
+ lineCount: number,
17
+ /** Makes streamer to perform seek operation to given offset before sending the contents.
18
+ * Client can just use the <new_offset> value of the last response from server to continue streaming after reconnection.
19
+ * If undefined, then starts from the end. */
20
+ offsetBytes?: number,
21
+ /** Is substring for line search pattern.
22
+ * This option makes controller to send to the client only lines, that
23
+ * have given substring. */
24
+ searchStr?: string): Promise<StreamingApiResponse>;
25
+ readText(
26
+ /** A handle that was issued previously. */
27
+ handle: AnyLogHandle,
28
+ /** Allows client to limit total data sent from server. */
29
+ lineCount: number,
30
+ /** Makes streamer to perform seek operation to given offset before sending the contents.
31
+ * Client can just use the <new_offset> value of the last response from server to continue streaming after reconnection.
32
+ * If undefined of 0, then starts from the beginning. */
33
+ offsetBytes?: number,
34
+ /** Is substring for line search pattern.
35
+ * This option makes controller to send to the client only lines, that
36
+ * have given substring. */
37
+ searchStr?: string): Promise<StreamingApiResponse>;
38
+ }
39
+ /** Response of the driver.
40
+ * The caller should give a handle to retrieve it.
41
+ * It can be OK or outdated, in which case the handle
42
+ * should be issued again. */
43
+ export type StreamingApiResponse = StreamingApiResponseOk | StreamingApiResponseHandleOutdated;
44
+ export type StreamingApiResponseOk = {
45
+ /** The handle don't have to be updated,
46
+ * the response is OK. */
47
+ shouldUpdateHandle: false;
48
+ /** Whether the log can still grow or it's in a final state. */
49
+ live: boolean;
50
+ /** Data of the response, in bytes. */
51
+ data: Uint8Array;
52
+ /** Current size of the file. It can grow if it's still live. */
53
+ size: number;
54
+ /** Offset in bytes from the beginning of a file. */
55
+ newOffset: number;
56
+ };
57
+ /** The handle should be issued again, this one is done. */
58
+ export type StreamingApiResponseHandleOutdated = {
59
+ shouldUpdateHandle: true;
60
+ };
61
+ //# sourceMappingURL=log.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/drivers/log.ts"],"names":[],"mappings":"AAAA;wCACwC;AACxC,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG,cAAc,CAAC;AAE1D;;kDAEkD;AAClD,MAAM,MAAM,aAAa,GAAG,kBAAkB,MAAM,EAAE,CAAC;AAEvD,6CAA6C;AAC7C,MAAM,MAAM,cAAc,GAAG,mBAAmB,MAAM,EAAE,CAAC;AAEzD,+CAA+C;AAC/C,MAAM,WAAW,UAAU;IACzB,SAAS;IACP,2CAA2C;IAC3C,MAAM,EAAE,YAAY;IAEpB,0DAA0D;IAC1D,SAAS,EAAE,MAAM;IAEjB;;iDAE6C;IAC7C,WAAW,CAAC,EAAE,MAAM;IAEpB;;+BAE2B;IAC3B,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAEjC,QAAQ;IACN,2CAA2C;IAC3C,MAAM,EAAE,YAAY;IAEpB,0DAA0D;IAC1D,SAAS,EAAE,MAAM;IAEjB;;4DAEwD;IACxD,WAAW,CAAC,EAAE,MAAM;IAEpB;;+BAE2B;IAC3B,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAClC;AAED;;;6BAG6B;AAC7B,MAAM,MAAM,oBAAoB,GAC5B,sBAAsB,GACtB,kCAAkC,CAAC;AAEvC,MAAM,MAAM,sBAAsB,GAAG;IACnC;6BACyB;IACzB,kBAAkB,EAAE,KAAK,CAAC;IAE1B,+DAA+D;IAC/D,IAAI,EAAE,OAAO,CAAC;IAEd,sCAAsC;IACtC,IAAI,EAAE,UAAU,CAAC;IACjB,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,2DAA2D;AAC3D,MAAM,MAAM,kCAAkC,GAAG;IAC/C,kBAAkB,EAAE,IAAI,CAAC;CAC1B,CAAC"}
@@ -0,0 +1,38 @@
1
+ export type ImportFileHandleUpload = `upload://upload/${string}`;
2
+ export type ImportFileHandleIndex = `index://index/${string}`;
3
+ export type ImportFileHandle = ImportFileHandleUpload | ImportFileHandleIndex;
4
+ export declare function isImportFileHandleUpload(handle: ImportFileHandle): handle is ImportFileHandleUpload;
5
+ export declare function isImportFileHandleIndex(handle: ImportFileHandle): handle is ImportFileHandleIndex;
6
+ /** Results in upload */
7
+ export type StorageHandleLocal = `local://${string}`;
8
+ /** Results in index */
9
+ export type StorageHandleRemote = `remote://${string}`;
10
+ export type StorageHandle = StorageHandleLocal | StorageHandleRemote;
11
+ export type StorageEntry = {
12
+ name: string;
13
+ handle: StorageHandle;
14
+ initialFullPath: string;
15
+ };
16
+ export type ListFilesResult = {
17
+ parent?: string;
18
+ entries: LsEntry[];
19
+ };
20
+ export type LsEntry = {
21
+ type: 'dir';
22
+ name: string;
23
+ fullPath: string;
24
+ } | {
25
+ type: 'file';
26
+ name: string;
27
+ fullPath: string;
28
+ /** This handle should be set to args... */
29
+ handle: ImportFileHandle;
30
+ };
31
+ export interface LsDriver {
32
+ /** remote and local storages */
33
+ getStorageList(): Promise<StorageEntry[]>;
34
+ listFiles(storage: StorageHandle, fullPath: string): Promise<ListFilesResult>;
35
+ }
36
+ /** Gets a file path from an import handle. */
37
+ export declare function getFilePathFromHandle(handle: ImportFileHandle): string;
38
+ //# sourceMappingURL=ls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ls.d.ts","sourceRoot":"","sources":["../../src/drivers/ls.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,sBAAsB,GAAG,mBAAmB,MAAM,EAAE,CAAC;AACjE,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,MAAM,EAAE,CAAC;AAE9D,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GAAG,qBAAqB,CAAC;AAE9E,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,gBAAgB,GACvB,MAAM,IAAI,sBAAsB,CAElC;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,gBAAgB,GACvB,MAAM,IAAI,qBAAqB,CAEjC;AAED,wBAAwB;AACxB,MAAM,MAAM,kBAAkB,GAAG,WAAW,MAAM,EAAE,CAAC;AAErD,uBAAuB;AACvB,MAAM,MAAM,mBAAmB,GAAG,YAAY,MAAM,EAAE,CAAC;AAEvD,MAAM,MAAM,aAAa,GAAG,kBAAkB,GAAG,mBAAmB,CAAC;AAErE,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,aAAa,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;CAIzB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,EAAE,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,OAAO,GACf;IACE,IAAI,EAAE,KAAK,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,GACD;IACE,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IAEjB,2CAA2C;IAC3C,MAAM,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AAEN,MAAM,WAAW,QAAQ;IACvB,gCAAgC;IAChC,cAAc,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAE1C,SAAS,CAAC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;CAC/E;AAED,8CAA8C;AAC9C,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAYtE"}
@@ -0,0 +1,16 @@
1
+ import { ValueType } from './spec';
2
+ /** Allows to search multiple columns in different contexts. */
3
+ export interface ColumnFilter {
4
+ /** Match any of the types listed here. If undefined, will be ignored during
5
+ * matching. */
6
+ readonly type?: ValueType[];
7
+ /** Match any of the names listed here. If undefined, will be ignored during
8
+ * matching. */
9
+ readonly name?: string[];
10
+ /** Match requires all the annotations listed here to have corresponding values. */
11
+ readonly annotationValue?: Record<string, string>;
12
+ /** Match requires all the annotations listed here to match corresponding regex
13
+ * pattern. */
14
+ readonly annotationPattern?: Record<string, string>;
15
+ }
16
+ //# sourceMappingURL=column_filter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"column_filter.d.ts","sourceRoot":"","sources":["../../../src/drivers/pframe/column_filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,+DAA+D;AAC/D,MAAM,WAAW,YAAY;IAC3B;mBACe;IACf,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC;IAE5B;mBACe;IACf,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAEzB,mFAAmF;IACnF,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAElD;kBACc;IACd,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrD"}
@@ -0,0 +1,51 @@
1
+ import { ValueType } from './spec';
2
+ export declare const PValueIntNA = -2147483648;
3
+ export declare const PValueLongNA = -9007199254740991n;
4
+ export declare const PValueFloatNA: number;
5
+ export declare const PValueDoubleNA: number;
6
+ export declare const PValueStringNA: null;
7
+ export declare const PValueBytesNA: null;
8
+ export type PValueInt = number;
9
+ export type PValueLong = number;
10
+ export type PValueFloat = number;
11
+ export type PValueDouble = number;
12
+ export type PValueString = string | null;
13
+ export type PValueBytes = Uint8Array | null;
14
+ export type PVectorDataInt = Int32Array;
15
+ export type PVectorDataLong = BigInt64Array;
16
+ export type PVectorDataFloat = Float32Array;
17
+ export type PVectorDataDouble = Float64Array;
18
+ export type PVectorDataString = PValueString[];
19
+ export type PVectorDataBytes = PValueBytes[];
20
+ export type PVectorData = PVectorDataInt | PVectorDataLong | PVectorDataFloat | PVectorDataDouble | PVectorDataString | PVectorDataBytes;
21
+ /** Table column data in comparison to the data stored in a separate PColumn
22
+ * may have some of the values "absent", i.e. as a result of missing record in
23
+ * outer join operation. This information is encoded in {@link absent} field. */
24
+ export interface PTableVector {
25
+ /** Stored data type */
26
+ readonly type: ValueType;
27
+ /** Values for present positions, absent positions have NA values */
28
+ readonly data: PVectorData;
29
+ /**
30
+ * Encoded bit array marking some elements of this vector as absent,
31
+ *
32
+ * Encoding described here:
33
+ * https://gist.github.com/vadimpiven/45f8279d84f47b9857df845126694c39
34
+ * */
35
+ readonly absent: Uint8Array;
36
+ }
37
+ /** Used in requests to partially retrieve table's data */
38
+ export type TableRange = {
39
+ /** Index of the first record to retrieve */
40
+ readonly offset: number;
41
+ /** Block length */
42
+ readonly length: number;
43
+ };
44
+ /** Unified information about table shape */
45
+ export type PTableShape = {
46
+ /** Number of unified table columns, including all axes and PColumn values */
47
+ columns: number;
48
+ /** Number of rows */
49
+ rows: number;
50
+ };
51
+ //# sourceMappingURL=data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../src/drivers/pframe/data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,eAAO,MAAM,WAAW,cAAc,CAAC;AACvC,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAC/C,eAAO,MAAM,aAAa,QAAM,CAAC;AACjC,eAAO,MAAM,cAAc,QAAM,CAAC;AAClC,eAAO,MAAM,cAAc,MAAO,CAAC;AACnC,eAAO,MAAM,aAAa,MAAO,CAAC;AAElC,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAC/B,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAChC,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AACjC,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAClC,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,IAAI,CAAC;AACzC,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,IAAI,CAAC;AAE5C,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC;AACxC,MAAM,MAAM,eAAe,GAAG,aAAa,CAAC;AAC5C,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAC5C,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC;AAC7C,MAAM,MAAM,iBAAiB,GAAG,YAAY,EAAE,CAAC;AAC/C,MAAM,MAAM,gBAAgB,GAAG,WAAW,EAAE,CAAC;AAE7C,MAAM,MAAM,WAAW,GACnB,cAAc,GACd,eAAe,GACf,gBAAgB,GAChB,iBAAiB,GACjB,iBAAiB,GACjB,gBAAgB,CAAC;AAErB;;gFAEgF;AAChF,MAAM,WAAW,YAAY;IAC3B,uBAAuB;IACvB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAEzB,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAE3B;;;;;SAKK;IACL,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;CAC7B;AAED,0DAA0D;AAC1D,MAAM,MAAM,UAAU,GAAG;IACvB,4CAA4C;IAC5C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,mBAAmB;IACnB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,4CAA4C;AAC5C,MAAM,MAAM,WAAW,GAAG;IACxB,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAC;IAEhB,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC"}
@@ -0,0 +1,50 @@
1
+ import { Branded } from '../../branding';
2
+ import { PTableShape, PTableVector, TableRange } from './data';
3
+ import { FindColumnsRequest, FindColumnsResponse } from './find_columns';
4
+ import { PObjectId } from '../../pool';
5
+ import { PColumnIdAndSpec, PColumnSpec } from './spec';
6
+ import { CalculateTableDataRequest, CalculateTableDataResponse } from './table_calculate';
7
+ import { UniqueValuesRequest, UniqueValuesResponse } from './unique_values';
8
+ import { PTableColumnSpec } from './table_common';
9
+ /** PFrame handle */
10
+ export type PFrameHandle = Branded<string, 'PFrame'>;
11
+ /** PFrame handle */
12
+ export type PTableHandle = Branded<string, 'PTable'>;
13
+ /** Allows to access main data layer features of platforma */
14
+ export interface PFrameDriver {
15
+ /**
16
+ * Finds columns given filtering criteria on column name, annotations etc.
17
+ * and a set of axes ids to find only columns with compatible specs.
18
+ * */
19
+ findColumns(handle: PFrameHandle, request: FindColumnsRequest): Promise<FindColumnsResponse>;
20
+ /** Retrieve single column spec */
21
+ getColumnSpec(handle: PFrameHandle, columnId: PObjectId): Promise<PColumnSpec>;
22
+ /** Retrieve information about all columns currently added to the PFrame */
23
+ listColumns(handle: PFrameHandle): Promise<PColumnIdAndSpec[]>;
24
+ /** Calculates data for the table and returns complete data representation of it */
25
+ calculateTableData(handle: PFrameHandle, request: CalculateTableDataRequest<PObjectId>): Promise<CalculateTableDataResponse>;
26
+ /** Calculate set of unique values for a specific axis for the filtered set of records */
27
+ getUniqueValues(handle: PFrameHandle, request: UniqueValuesRequest): Promise<UniqueValuesResponse>;
28
+ /** Unified table shape */
29
+ getShape(handle: PTableHandle): Promise<PTableShape>;
30
+ /**
31
+ * Returns ordered array of table axes specs (primary key "columns" in SQL
32
+ * terms) and data column specs (regular "columns" in SQL terms).
33
+ *
34
+ * Data for a specific table column can be retrieved using unified indexing
35
+ * corresponding to elements in this array.
36
+ *
37
+ * Axes are always listed first.
38
+ * */
39
+ getSpec(handle: PTableHandle): Promise<PTableColumnSpec[]>;
40
+ /**
41
+ * Retrieve the data from the table. To retrieve only data required, it can be
42
+ * sliced both horizontally ({@link columnIndices}) and vertically
43
+ * ({@link range}).
44
+ *
45
+ * @param columnIndices unified indices of columns to be retrieved
46
+ * @param range optionally limit the range of records to retrieve
47
+ * */
48
+ getData(handle: PTableHandle, columnIndices: number[], range?: TableRange | undefined): Promise<PTableVector[]>;
49
+ }
50
+ //# sourceMappingURL=driver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../../src/drivers/pframe/driver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAIzC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACvD,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,oBAAoB;AACpB,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAErD,oBAAoB;AACpB,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAErD,6DAA6D;AAC7D,MAAM,WAAW,YAAY;IAK3B;;;SAGK;IACL,WAAW,CACT,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEhC,kCAAkC;IAClC,aAAa,CACX,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,SAAS,GAClB,OAAO,CAAC,WAAW,CAAC,CAAC;IAExB,2EAA2E;IAC3E,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAE/D,mFAAmF;IACnF,kBAAkB,CAChB,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,yBAAyB,CAAC,SAAS,CAAC,GAC5C,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAEvC,yFAAyF;IACzF,eAAe,CACb,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAMjC,0BAA0B;IAC1B,QAAQ,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAErD;;;;;;;;SAQK;IACL,OAAO,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAE3D;;;;;;;SAOK;IACL,OAAO,CACL,MAAM,EAAE,YAAY,EACpB,aAAa,EAAE,MAAM,EAAE,EACvB,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,GAC7B,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;CAC5B"}
@@ -0,0 +1,27 @@
1
+ import { ColumnFilter } from './column_filter';
2
+ import { AxisId, PColumnIdAndSpec } from './spec';
3
+ /**
4
+ * Request to search among existing columns in the PFrame. Two filtering
5
+ * criteria can be used: (1) column ашдеук, to search for columns with
6
+ * specific properties like name, annotations and domains, and (2) being
7
+ * compatible with the given list of axis ids.
8
+ * */
9
+ export interface FindColumnsRequest {
10
+ /** Basic column filter */
11
+ readonly columnFilter: ColumnFilter;
12
+ /** Will only search for columns compatible with these list of axis ids */
13
+ readonly compatibleWith: AxisId[];
14
+ /**
15
+ * Defines what level of compatibility with provided list of axis ids is required.
16
+ *
17
+ * If true will search only for such columns which axes completely maps onto the
18
+ * axes listed in the {@link compatibleWith} list.
19
+ * */
20
+ readonly strictlyCompatible: boolean;
21
+ }
22
+ /** Response for {@link FindColumnsRequest} */
23
+ export interface FindColumnsResponse {
24
+ /** Array of column ids found using request criteria. */
25
+ readonly hits: PColumnIdAndSpec[];
26
+ }
27
+ //# sourceMappingURL=find_columns.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find_columns.d.ts","sourceRoot":"","sources":["../../../src/drivers/pframe/find_columns.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAElD;;;;;KAKK;AACL,MAAM,WAAW,kBAAkB;IACjC,0BAA0B;IAC1B,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAEpC,0EAA0E;IAC1E,QAAQ,CAAC,cAAc,EAAE,MAAM,EAAE,CAAC;IAElC;;;;;SAKK;IACL,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;CACtC;AAED,8CAA8C;AAC9C,MAAM,WAAW,mBAAmB;IAClC,wDAAwD;IACxD,QAAQ,CAAC,IAAI,EAAE,gBAAgB,EAAE,CAAC;CACnC"}
@@ -0,0 +1,11 @@
1
+ export * from './column_filter';
2
+ export * from './data';
3
+ export * from './find_columns';
4
+ export * from './pframe';
5
+ export * from './spec';
6
+ export * from './table';
7
+ export * from './table_calculate';
8
+ export * from './table_common';
9
+ export * from './unique_values';
10
+ export * from './driver';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/drivers/pframe/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAEhC,cAAc,UAAU,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { PObjectId } from '../../pool';
2
+ import { FindColumnsRequest, FindColumnsResponse } from './find_columns';
3
+ import { PColumn, PColumnIdAndSpec, PColumnSpec } from './spec';
4
+ import { CalculateTableDataRequest, CalculateTableDataResponse } from './table_calculate';
5
+ import { UniqueValuesRequest, UniqueValuesResponse } from './unique_values';
6
+ /** Read interface exposed by PFrames library */
7
+ export interface PFrame {
8
+ /**
9
+ * Finds columns given filtering criteria on column name, annotations etc.
10
+ * and a set of axes ids to find only columns with compatible specs.
11
+ * */
12
+ findColumns(request: FindColumnsRequest): Promise<FindColumnsResponse>;
13
+ /** Retrieve single column spec */
14
+ getColumnSpec(columnId: PObjectId): Promise<PColumnSpec>;
15
+ /** Retrieve information about all columns currently added to the PFrame */
16
+ listColumns(): Promise<PColumnIdAndSpec[]>;
17
+ /** Calculates data for the table and returns complete data representation of it */
18
+ calculateTableData(request: CalculateTableDataRequest<PObjectId>): Promise<CalculateTableDataResponse>;
19
+ /** Calculate set of unique values for a specific axis for the filtered set of records */
20
+ getUniqueValues(request: UniqueValuesRequest): Promise<UniqueValuesResponse>;
21
+ }
22
+ /** Information required to instantiate a PFrame. */
23
+ export type PFrameDef<Data> = PColumn<Data>[];
24
+ //# sourceMappingURL=pframe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pframe.d.ts","sourceRoot":"","sources":["../../../src/drivers/pframe/pframe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAChE,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE5E,gDAAgD;AAChD,MAAM,WAAW,MAAM;IACrB;;;SAGK;IACL,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEvE,kCAAkC;IAClC,aAAa,CAAC,QAAQ,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEzD,2EAA2E;IAC3E,WAAW,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAE3C,mFAAmF;IACnF,kBAAkB,CAChB,OAAO,EAAE,yBAAyB,CAAC,SAAS,CAAC,GAC5C,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAEvC,yFAAyF;IACzF,eAAe,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAC9E;AAED,oDAAoD;AACpD,MAAM,MAAM,SAAS,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC"}
@@ -0,0 +1,106 @@
1
+ import { PObject, PObjectId, PObjectSpec } from '../../pool';
2
+ /** PFrame columns and axes within them may store one of these types. */
3
+ export type ValueType = 'Int' | 'Long' | 'Float' | 'Double' | 'String' | 'Bytes';
4
+ /**
5
+ * Specification of an individual axis.
6
+ *
7
+ * Each axis is a part of a composite key that addresses data inside the PColumn.
8
+ *
9
+ * Each record inside a PColumn is addressed by a unique tuple of values set for
10
+ * all the axes specified in the column spec.
11
+ * */
12
+ export interface AxisSpec {
13
+ /** Type of the axis value. Should not use non-key types like float or double. */
14
+ readonly type: ValueType;
15
+ /** Name of the axis */
16
+ readonly name: string;
17
+ /** Adds auxiliary information to the axis name, type and parents to form a
18
+ * unique identifier */
19
+ readonly domain?: Record<string, string>;
20
+ /** Any additional information attached to the axis that does not affect its
21
+ * identifier */
22
+ readonly annotations?: Record<string, string>;
23
+ /**
24
+ * Parent axes provide contextual grouping for the axis in question, establishing
25
+ * a hierarchy where the current axis is dependent on one or more axes for its
26
+ * full definition and meaning. For instance, in a data structure where each
27
+ * "container" axis may contain multiple "item" axes, the `item` axis would
28
+ * list the index of the `container` axis in this field to denote its dependency.
29
+ *
30
+ * This means that the identity or significance of the `item` axis is only
31
+ * interpretable when combined with its parent `container` axis. An `item` axis
32
+ * index by itself may be non-unique and only gains uniqueness within the context
33
+ * of its parent `container`. Therefore, the `parentAxes` field is essential for
34
+ * mapping these relationships and ensuring data coherence across nested or
35
+ * multi-level data models.
36
+ *
37
+ * A list of zero-based indices of parent axes in the overall axes specification
38
+ * from the column spec. Each index corresponds to the position of a parent axis
39
+ * in the list that defines the structure of the data model.
40
+ */
41
+ readonly parentAxes?: number[];
42
+ }
43
+ /** Common type representing spec for all the axes in a column */
44
+ export type AxesSpec = AxisSpec[];
45
+ /**
46
+ * Full column specification including all axes specs and specs of the column
47
+ * itself.
48
+ *
49
+ * A PColumn in its essence represents a mapping from a fixed size, explicitly
50
+ * typed tuple to an explicitly typed value.
51
+ *
52
+ * (axis1Value1, axis2Value1, ...) -> columnValue
53
+ *
54
+ * Each element in tuple correspond to the axis having the same index in axesSpec.
55
+ * */
56
+ export interface PColumnSpec extends PObjectSpec {
57
+ /** Defines specific type of BObject, the most generic type of unit of
58
+ * information in Platforma Project. */
59
+ readonly kind: 'PColumn';
60
+ /** Type of column values */
61
+ readonly valueType: ValueType;
62
+ /** Column name */
63
+ readonly name: string;
64
+ /** Adds auxiliary information to the axis name, type and parents to form a
65
+ * unique identifier */
66
+ readonly domain?: Record<string, string>;
67
+ /** Any additional information attached to the column that does not affect its
68
+ * identifier */
69
+ readonly annotations?: Record<string, string>;
70
+ /** A list of zero-based indices of parent axes from the {@link axesSpec} array. */
71
+ readonly parentAxes?: number[];
72
+ /** Axes specifications */
73
+ readonly axesSpec: AxesSpec;
74
+ }
75
+ export interface PColumn<Data> extends PObject<Data> {
76
+ /** PColumn spec, allowing it to be found among other PObjects */
77
+ readonly spec: PColumnSpec;
78
+ }
79
+ /** Columns in a PFrame also have internal identifier, this object represents
80
+ * combination of specs and such id */
81
+ export interface PColumnIdAndSpec {
82
+ /** Internal column id within the PFrame */
83
+ readonly columnId: PObjectId;
84
+ /** Column spec */
85
+ readonly spec: PColumnSpec;
86
+ }
87
+ /** Information returned by {@link PFrame.listColumns} method */
88
+ export interface PColumnInfo extends PColumnIdAndSpec {
89
+ /** True if data was associated with this PColumn */
90
+ readonly hasData: boolean;
91
+ }
92
+ export interface AxisId {
93
+ /** Type of the axis or column value. For an axis should not use non-key
94
+ * types like float or double. */
95
+ readonly type: ValueType;
96
+ /** Name of the axis or column */
97
+ readonly name: string;
98
+ /** Adds auxiliary information to the axis or column name and type to form a
99
+ * unique identifier */
100
+ readonly domain?: Record<string, string>;
101
+ }
102
+ /** Array of axis ids */
103
+ export type AxesId = AxisId[];
104
+ /** Extracts axes ids from axes spec array from column spec */
105
+ export declare function getAxesId(spec: AxesSpec): AxesId;
106
+ //# sourceMappingURL=spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../../../src/drivers/pframe/spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE7D,wEAAwE;AACxE,MAAM,MAAM,SAAS,GACjB,KAAK,GACL,MAAM,GACN,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,OAAO,CAAC;AAEZ;;;;;;;KAOK;AACL,MAAM,WAAW,QAAQ;IACvB,iFAAiF;IACjF,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAEzB,uBAAuB;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;2BACuB;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEzC;oBACgB;IAChB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE9C;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CAChC;AAED,iEAAiE;AACjE,MAAM,MAAM,QAAQ,GAAG,QAAQ,EAAE,CAAC;AAElC;;;;;;;;;;KAUK;AACL,MAAM,WAAW,WAAY,SAAQ,WAAW;IAC9C;2CACuC;IACvC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAEzB,4BAA4B;IAC5B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAE9B,kBAAkB;IAClB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;2BACuB;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEzC;oBACgB;IAChB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE9C,mFAAmF;IACnF,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAE/B,0BAA0B;IAC1B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;CAC7B;AAED,MAAM,WAAW,OAAO,CAAC,IAAI,CAAE,SAAQ,OAAO,CAAC,IAAI,CAAC;IAClD,iEAAiE;IACjE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;CAC5B;AAED;sCACsC;AACtC,MAAM,WAAW,gBAAgB;IAC/B,2CAA2C;IAC3C,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAE7B,kBAAkB;IAClB,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;CAC5B;AAED,gEAAgE;AAChE,MAAM,WAAW,WAAY,SAAQ,gBAAgB;IACnD,oDAAoD;IACpD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,MAAM;IACrB;qCACiC;IACjC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAEzB,iCAAiC;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;2BACuB;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1C;AAED,wBAAwB;AACxB,MAAM,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC;AAE9B,8DAA8D;AAC9D,wBAAgB,SAAS,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAKhD"}
@@ -0,0 +1,29 @@
1
+ import { PTableColumnSpec } from './table_common';
2
+ import { PTableShape, PTableVector, TableRange } from './data';
3
+ /**
4
+ * Table view.
5
+ * */
6
+ export interface PTable {
7
+ /** Unified table shape */
8
+ getShape(): Promise<PTableShape>;
9
+ /**
10
+ * Returns ordered array of table axes specs (primary key "columns" in SQL
11
+ * terms) and data column specs (regular "columns" in SQL terms).
12
+ *
13
+ * Data for a specific table column can be retrieved using unified indexing
14
+ * corresponding to elements in this array.
15
+ *
16
+ * Axes are always listed first.
17
+ * */
18
+ getSpec(): Promise<PTableColumnSpec[]>;
19
+ /**
20
+ * Retrieve the data from the table. To retrieve only data required, it can be
21
+ * sliced both horizontally ({@link columnIndices}) and vertically
22
+ * ({@link range}).
23
+ *
24
+ * @param columnIndices unified indices of columns to be retrieved
25
+ * @param range optionally limit the range of records to retrieve
26
+ * */
27
+ getData(columnIndices: number[], range?: TableRange): Promise<PTableVector[]>;
28
+ }
29
+ //# sourceMappingURL=table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/drivers/pframe/table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAE/D;;KAEK;AACL,MAAM,WAAW,MAAM;IACrB,0BAA0B;IAC1B,QAAQ,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IAEjC;;;;;;;;SAQK;IACL,OAAO,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAEvC;;;;;;;SAOK;IACL,OAAO,CAAC,aAAa,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;CAC/E"}