@milaboratories/pl-model-middle-layer 1.8.41 → 1.8.43

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 (104) hide show
  1. package/dist/block_meta/block_components.cjs +4 -4
  2. package/dist/block_meta/block_components.cjs.map +1 -1
  3. package/dist/block_meta/block_components.d.ts +0 -1
  4. package/dist/block_meta/block_components.d.ts.map +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 +2 -2
  8. package/dist/block_meta/block_description.cjs.map +1 -1
  9. package/dist/block_meta/block_description.d.ts +116 -115
  10. package/dist/block_meta/block_description.d.ts.map +1 -1
  11. package/dist/block_meta/block_description.js +2 -2
  12. package/dist/block_meta/block_description.js.map +1 -1
  13. package/dist/block_meta/block_id.cjs +1 -1
  14. package/dist/block_meta/block_id.cjs.map +1 -1
  15. package/dist/block_meta/block_id.js +1 -1
  16. package/dist/block_meta/block_id.js.map +1 -1
  17. package/dist/block_meta/block_manifest.cjs +2 -2
  18. package/dist/block_meta/block_manifest.cjs.map +1 -1
  19. package/dist/block_meta/block_manifest.d.ts +1 -1
  20. package/dist/block_meta/block_manifest.d.ts.map +1 -1
  21. package/dist/block_meta/block_manifest.js +2 -2
  22. package/dist/block_meta/block_manifest.js.map +1 -1
  23. package/dist/block_meta/block_meta.cjs +3 -3
  24. package/dist/block_meta/block_meta.cjs.map +1 -1
  25. package/dist/block_meta/block_meta.js +3 -3
  26. package/dist/block_meta/block_meta.js.map +1 -1
  27. package/dist/block_meta/content_conversion.cjs.map +1 -1
  28. package/dist/block_meta/content_conversion.d.ts +1 -1
  29. package/dist/block_meta/content_conversion.d.ts.map +1 -1
  30. package/dist/block_meta/content_conversion.js.map +1 -1
  31. package/dist/block_meta/content_types.cjs +23 -23
  32. package/dist/block_meta/content_types.cjs.map +1 -1
  33. package/dist/block_meta/content_types.js +23 -23
  34. package/dist/block_meta/content_types.js.map +1 -1
  35. package/dist/block_meta/semver.cjs.map +1 -1
  36. package/dist/block_meta/semver.js.map +1 -1
  37. package/dist/block_registry/block_pack_spec.cjs +5 -5
  38. package/dist/block_registry/block_pack_spec.cjs.map +1 -1
  39. package/dist/block_registry/block_pack_spec.js +5 -5
  40. package/dist/block_registry/block_pack_spec.js.map +1 -1
  41. package/dist/block_registry/overview.cjs +6 -6
  42. package/dist/block_registry/overview.cjs.map +1 -1
  43. package/dist/block_registry/overview.d.ts.map +1 -1
  44. package/dist/block_registry/overview.js +6 -6
  45. package/dist/block_registry/overview.js.map +1 -1
  46. package/dist/block_registry/registry_spec.cjs +5 -5
  47. package/dist/block_registry/registry_spec.cjs.map +1 -1
  48. package/dist/block_registry/registry_spec.js +5 -5
  49. package/dist/block_registry/registry_spec.js.map +1 -1
  50. package/dist/block_state.d.ts +2 -2
  51. package/dist/block_state.d.ts.map +1 -1
  52. package/dist/pframe/internal_api/api_factory.cjs.map +1 -1
  53. package/dist/pframe/internal_api/api_factory.d.ts +2 -2
  54. package/dist/pframe/internal_api/api_factory.d.ts.map +1 -1
  55. package/dist/pframe/internal_api/api_factory.js.map +1 -1
  56. package/dist/pframe/internal_api/api_read.d.ts +9 -8
  57. package/dist/pframe/internal_api/api_read.d.ts.map +1 -1
  58. package/dist/pframe/internal_api/common.d.ts +3 -1
  59. package/dist/pframe/internal_api/common.d.ts.map +1 -1
  60. package/dist/pframe/internal_api/create_table.d.ts +2 -2
  61. package/dist/pframe/internal_api/create_table.d.ts.map +1 -1
  62. package/dist/pframe/internal_api/delete_column.d.ts +1 -1
  63. package/dist/pframe/internal_api/delete_column.d.ts.map +1 -1
  64. package/dist/pframe/internal_api/find_columns.d.ts +2 -2
  65. package/dist/pframe/internal_api/find_columns.d.ts.map +1 -1
  66. package/dist/pframe/internal_api/http_helpers.cjs.map +1 -1
  67. package/dist/pframe/internal_api/http_helpers.d.ts +27 -27
  68. package/dist/pframe/internal_api/http_helpers.d.ts.map +1 -1
  69. package/dist/pframe/internal_api/http_helpers.js.map +1 -1
  70. package/dist/pframe/internal_api/pframe.d.ts +8 -5
  71. package/dist/pframe/internal_api/pframe.d.ts.map +1 -1
  72. package/dist/pframe/internal_api/table.d.ts +5 -5
  73. package/dist/pframe/internal_api/table.d.ts.map +1 -1
  74. package/dist/project_list.d.ts +1 -1
  75. package/dist/project_list.d.ts.map +1 -1
  76. package/dist/project_overview.d.ts +5 -5
  77. package/dist/project_overview.d.ts.map +1 -1
  78. package/dist/update_info.d.ts +1 -1
  79. package/dist/update_info.d.ts.map +1 -1
  80. package/package.json +7 -4
  81. package/src/block_meta/block_components.ts +6 -8
  82. package/src/block_meta/block_description.ts +8 -7
  83. package/src/block_meta/block_id.ts +4 -4
  84. package/src/block_meta/block_manifest.ts +5 -5
  85. package/src/block_meta/block_meta.ts +8 -8
  86. package/src/block_meta/content_conversion.ts +4 -4
  87. package/src/block_meta/content_types.ts +24 -24
  88. package/src/block_meta/semver.ts +1 -1
  89. package/src/block_registry/block_pack_spec.ts +5 -5
  90. package/src/block_registry/overview.ts +10 -9
  91. package/src/block_registry/registry_spec.ts +5 -5
  92. package/src/block_state.ts +3 -3
  93. package/src/pframe/internal_api/api_factory.ts +3 -6
  94. package/src/pframe/internal_api/api_read.ts +11 -10
  95. package/src/pframe/internal_api/common.ts +11 -2
  96. package/src/pframe/internal_api/create_table.ts +3 -3
  97. package/src/pframe/internal_api/delete_column.ts +1 -1
  98. package/src/pframe/internal_api/find_columns.ts +2 -2
  99. package/src/pframe/internal_api/http_helpers.ts +44 -44
  100. package/src/pframe/internal_api/pframe.ts +9 -6
  101. package/src/pframe/internal_api/table.ts +10 -10
  102. package/src/project_list.ts +1 -1
  103. package/src/project_overview.ts +5 -5
  104. package/src/update_info.ts +1 -1
@@ -2,26 +2,26 @@ import { z } from 'zod';
2
2
 
3
3
  const LocalDevFolder = z.object({
4
4
  type: z.literal('local-dev'),
5
- path: z.string()
5
+ path: z.string(),
6
6
  });
7
7
  /** @deprecated don't use */
8
8
  const RemoteRegistryV1Spec = z.object({
9
9
  type: z.literal('remote-v1'),
10
- url: z.string().url()
10
+ url: z.string().url(),
11
11
  });
12
12
  const RemoteRegistryV2Spec = z.object({
13
13
  type: z.literal('remote-v2'),
14
- url: z.string().url()
14
+ url: z.string().url(),
15
15
  });
16
16
  const RegistrySpec = z.discriminatedUnion('type', [
17
17
  RemoteRegistryV1Spec,
18
18
  RemoteRegistryV2Spec,
19
- LocalDevFolder
19
+ LocalDevFolder,
20
20
  ]);
21
21
  const RegistryEntry = z.object({
22
22
  id: z.string(),
23
23
  title: z.string().optional(),
24
- spec: RegistrySpec
24
+ spec: RegistrySpec,
25
25
  });
26
26
  const RegistryList = z.array(RegistryEntry);
27
27
 
@@ -1 +1 @@
1
- {"version":3,"file":"registry_spec.js","sources":["../../src/block_registry/registry_spec.ts"],"sourcesContent":["import { z } from 'zod';\n\nexport const LocalDevFolder = z.object({\n type: z.literal('local-dev'),\n path: z.string()\n});\nexport type LocalDevFolder = z.infer<typeof LocalDevFolder>;\n\n/** @deprecated don't use */\nexport const RemoteRegistryV1Spec = z.object({\n type: z.literal('remote-v1'),\n url: z.string().url()\n});\n/** @deprecated don't use */\nexport type RemoteRegistryV1Spec = z.infer<typeof RemoteRegistryV1Spec>;\n\nexport const RemoteRegistryV2Spec = z.object({\n type: z.literal('remote-v2'),\n url: z.string().url()\n});\nexport type RemoteRegistryV2Spec = z.infer<typeof RemoteRegistryV2Spec>;\n\nexport const RegistrySpec = z.discriminatedUnion('type', [\n RemoteRegistryV1Spec,\n RemoteRegistryV2Spec,\n LocalDevFolder\n]);\nexport type RegistrySpec = z.infer<typeof RegistrySpec>;\n\nexport const RegistryEntry = z.object({\n id: z.string(),\n title: z.string().optional(),\n spec: RegistrySpec\n});\nexport type RegistryEntry = z.infer<typeof RegistryEntry>;\n\nexport const RegistryList = z.array(RegistryEntry);\nexport type RegistryList = z.infer<typeof RegistryList>;\n"],"names":[],"mappings":";;AAEO,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;AACrC,IAAA,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;AAC5B,IAAA,IAAI,EAAE,CAAC,CAAC,MAAM;AACf,CAAA;AAGD;AACO,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;AAC3C,IAAA,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;AAC5B,IAAA,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG;AACpB,CAAA;AAIM,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;AAC3C,IAAA,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;AAC5B,IAAA,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG;AACpB,CAAA;MAGY,YAAY,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IACvD,oBAAoB;IACpB,oBAAoB;IACpB;AACD,CAAA;AAGM,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;AACpC,IAAA,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;AACd,IAAA,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;AAC5B,IAAA,IAAI,EAAE;AACP,CAAA;AAGM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,aAAa;;;;"}
1
+ {"version":3,"file":"registry_spec.js","sources":["../../src/block_registry/registry_spec.ts"],"sourcesContent":["import { z } from 'zod';\n\nexport const LocalDevFolder = z.object({\n type: z.literal('local-dev'),\n path: z.string(),\n});\nexport type LocalDevFolder = z.infer<typeof LocalDevFolder>;\n\n/** @deprecated don't use */\nexport const RemoteRegistryV1Spec = z.object({\n type: z.literal('remote-v1'),\n url: z.string().url(),\n});\n/** @deprecated don't use */\nexport type RemoteRegistryV1Spec = z.infer<typeof RemoteRegistryV1Spec>;\n\nexport const RemoteRegistryV2Spec = z.object({\n type: z.literal('remote-v2'),\n url: z.string().url(),\n});\nexport type RemoteRegistryV2Spec = z.infer<typeof RemoteRegistryV2Spec>;\n\nexport const RegistrySpec = z.discriminatedUnion('type', [\n RemoteRegistryV1Spec,\n RemoteRegistryV2Spec,\n LocalDevFolder,\n]);\nexport type RegistrySpec = z.infer<typeof RegistrySpec>;\n\nexport const RegistryEntry = z.object({\n id: z.string(),\n title: z.string().optional(),\n spec: RegistrySpec,\n});\nexport type RegistryEntry = z.infer<typeof RegistryEntry>;\n\nexport const RegistryList = z.array(RegistryEntry);\nexport type RegistryList = z.infer<typeof RegistryList>;\n"],"names":[],"mappings":";;AAEO,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;AACrC,IAAA,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;AAC5B,IAAA,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;AACjB,CAAA;AAGD;AACO,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;AAC3C,IAAA,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;AAC5B,IAAA,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;AACtB,CAAA;AAIM,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;AAC3C,IAAA,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;AAC5B,IAAA,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;AACtB,CAAA;MAGY,YAAY,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IACvD,oBAAoB;IACpB,oBAAoB;IACpB,cAAc;AACf,CAAA;AAGM,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;AACpC,IAAA,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;AACd,IAAA,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;AAC5B,IAAA,IAAI,EAAE,YAAY;AACnB,CAAA;AAGM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,aAAa;;;;"}
@@ -1,4 +1,4 @@
1
- import { BlockOutputsBase, BlockState } from '@milaboratories/pl-model-common';
2
- import { Optional } from 'utility-types';
1
+ import type { BlockOutputsBase, BlockState } from '@milaboratories/pl-model-common';
2
+ import type { Optional } from 'utility-types';
3
3
  export type BlockStateInternal<Args = unknown, Outputs extends BlockOutputsBase = BlockOutputsBase, UiState = unknown, Href extends `/${string}` = `/${string}`> = Optional<Readonly<BlockState<Args, Outputs, UiState, Href>>, 'outputs'>;
4
4
  //# sourceMappingURL=block_state.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"block_state.d.ts","sourceRoot":"","sources":["../src/block_state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,MAAM,kBAAkB,CAC5B,IAAI,GAAG,OAAO,EACd,OAAO,SAAS,gBAAgB,GAAG,gBAAgB,EACnD,OAAO,GAAG,OAAO,EACjB,IAAI,SAAS,IAAI,MAAM,EAAE,GAAG,IAAI,MAAM,EAAE,IACtC,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC"}
1
+ {"version":3,"file":"block_state.d.ts","sourceRoot":"","sources":["../src/block_state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AACpF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,MAAM,MAAM,kBAAkB,CAC5B,IAAI,GAAG,OAAO,EACd,OAAO,SAAS,gBAAgB,GAAG,gBAAgB,EACnD,OAAO,GAAG,OAAO,EACjB,IAAI,SAAS,IAAI,MAAM,EAAE,GAAG,IAAI,MAAM,EAAE,IACtC,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"api_factory.cjs","sources":["../../../src/pframe/internal_api/api_factory.ts"],"sourcesContent":["import {\n BinaryPartitionedDataInfo,\n Branded,\n JsonDataInfo,\n JsonPartitionedDataInfo,\n ParquetChunk,\n ParquetPartitionedDataInfo,\n PColumnSpec,\n PObjectId,\n} from '@milaboratories/pl-model-common';\nimport {\n HttpHelpers,\n HttpServerInfo,\n} from './http_helpers';\n\n/** PColumn spec file extension */\nexport const SpecExtension = '.spec' as const;\n\n/** PColumn data info file extension */\nexport const DataInfoExtension = '.datainfo' as const;\n\n/** Abstract identifier of a data blob that can be requested from the storage backend */\nexport type PFrameBlobId = Branded<string, 'PFrameInternal.PFrameBlobId'>;\n\n/** Path of the file containing requested data (blob). This path is returned by\n * {@link BlobPathResolver} as soon as blob materialized in the file system. */\nexport type FilePath = string;\n\n/** Data source allows PFrame to retrieve the data blobs for columns with assigned data info. */\nexport interface PFrameDataSourceV2 {\n /**\n * PFrame may notify storage backend about its plans to use particular blobs in the future.\n * Storage backend will do its best to preload specified blob so the subsequent\n * {@link resolveBlob} will quickly return preloaded file path.\n */\n preloadBlob(blobIds: PFrameBlobId[]): Promise<void>;\n\n /** Returns raw blob data given the blob id from {@link DataInfo}. */\n resolveBlobContent(blobId: PFrameBlobId): Promise<Uint8Array>;\n\n /**\n * Parquet HTTP(S) server connection settings, {@link HttpHelpers.createHttpServer}\n * When not provided, parquet BlobIds would be treated as local file paths.\n */\n parquetServer?: HttpServerInfo;\n}\n\n/**\n * Union type representing all possible data storage formats for PColumn data.\n * The specific format used depends on data size, access patterns, and performance requirements.\n *\n * @template Blob - Type parameter representing the storage reference type (could be ResourceInfo, PFrameBlobId, etc.)\n */\nexport type DataInfo<Blob> =\n | JsonDataInfo\n | JsonPartitionedDataInfo<Blob>\n | BinaryPartitionedDataInfo<Blob>\n | ParquetPartitionedDataInfo<ParquetChunk<Blob>>;\n\n/** API exposed by PFrames library allowing to create and provide data for\n * PFrame objects */\nexport interface PFrameFactoryAPIV4 extends Disposable {\n /** Associates data source with this PFrame */\n setDataSource(dataSource: PFrameDataSourceV2): void;\n\n /** Adds PColumn without data info */\n addColumnSpec(columnId: PObjectId, columnSpec: PColumnSpec): void;\n\n /**\n * Assign data info to the specified PColumn.\n * For parquet data info, schema resolution via network is performed during this call.\n */\n setColumnData(\n columnId: PObjectId,\n dataInfo: DataInfo<PFrameBlobId>,\n options?: {\n signal?: AbortSignal,\n }\n ): Promise<void>;\n\n /** Releases all the data previously added to PFrame using methods above,\n * any interactions with disposed PFrame will result in exception */\n dispose(): void;\n}\n"],"names":[],"mappings":";;AAeA;AACO,MAAM,aAAa,GAAG;AAE7B;AACO,MAAM,iBAAiB,GAAG;;;;;"}
1
+ {"version":3,"file":"api_factory.cjs","sources":["../../../src/pframe/internal_api/api_factory.ts"],"sourcesContent":["import type {\n BinaryPartitionedDataInfo,\n Branded,\n JsonDataInfo,\n JsonPartitionedDataInfo,\n ParquetChunk,\n ParquetPartitionedDataInfo,\n PColumnSpec,\n PObjectId,\n} from '@milaboratories/pl-model-common';\nimport type { HttpServerInfo } from './http_helpers';\n\n/** PColumn spec file extension */\nexport const SpecExtension = '.spec' as const;\n\n/** PColumn data info file extension */\nexport const DataInfoExtension = '.datainfo' as const;\n\n/** Abstract identifier of a data blob that can be requested from the storage backend */\nexport type PFrameBlobId = Branded<string, 'PFrameInternal.PFrameBlobId'>;\n\n/** Path of the file containing requested data (blob). This path is returned by\n * {@link BlobPathResolver} as soon as blob materialized in the file system. */\nexport type FilePath = string;\n\n/** Data source allows PFrame to retrieve the data blobs for columns with assigned data info. */\nexport interface PFrameDataSourceV2 {\n /**\n * PFrame may notify storage backend about its plans to use particular blobs in the future.\n * Storage backend will do its best to preload specified blob so the subsequent\n * {@link resolveBlob} will quickly return preloaded file path.\n */\n preloadBlob(blobIds: PFrameBlobId[]): Promise<void>;\n\n /** Returns raw blob data given the blob id from {@link DataInfo}. */\n resolveBlobContent(blobId: PFrameBlobId): Promise<Uint8Array>;\n\n /**\n * Parquet HTTP(S) server connection settings, {@link HttpHelpers.createHttpServer}\n * When not provided, parquet BlobIds would be treated as local file paths.\n */\n parquetServer?: HttpServerInfo;\n}\n\n/**\n * Union type representing all possible data storage formats for PColumn data.\n * The specific format used depends on data size, access patterns, and performance requirements.\n *\n * @template Blob - Type parameter representing the storage reference type (could be ResourceInfo, PFrameBlobId, etc.)\n */\nexport type DataInfo<Blob> =\n | JsonDataInfo\n | JsonPartitionedDataInfo<Blob>\n | BinaryPartitionedDataInfo<Blob>\n | ParquetPartitionedDataInfo<ParquetChunk<Blob>>;\n\n/** API exposed by PFrames library allowing to create and provide data for\n * PFrame objects */\nexport interface PFrameFactoryAPIV4 extends Disposable {\n /** Associates data source with this PFrame */\n setDataSource(dataSource: PFrameDataSourceV2): void;\n\n /** Adds PColumn without data info */\n addColumnSpec(columnId: PObjectId, columnSpec: PColumnSpec): void;\n\n /**\n * Assign data info to the specified PColumn.\n * For parquet data info, schema resolution via network is performed during this call.\n */\n setColumnData(\n columnId: PObjectId,\n dataInfo: DataInfo<PFrameBlobId>,\n options?: {\n signal?: AbortSignal;\n }\n ): Promise<void>;\n\n /** Releases all the data previously added to PFrame using methods above,\n * any interactions with disposed PFrame will result in exception */\n dispose(): void;\n}\n"],"names":[],"mappings":";;AAYA;AACO,MAAM,aAAa,GAAG;AAE7B;AACO,MAAM,iBAAiB,GAAG;;;;;"}
@@ -1,5 +1,5 @@
1
- import { BinaryPartitionedDataInfo, Branded, JsonDataInfo, JsonPartitionedDataInfo, ParquetChunk, ParquetPartitionedDataInfo, PColumnSpec, PObjectId } from '@milaboratories/pl-model-common';
2
- import { HttpServerInfo } from './http_helpers';
1
+ import type { BinaryPartitionedDataInfo, Branded, JsonDataInfo, JsonPartitionedDataInfo, ParquetChunk, ParquetPartitionedDataInfo, PColumnSpec, PObjectId } from '@milaboratories/pl-model-common';
2
+ import type { HttpServerInfo } from './http_helpers';
3
3
  /** PColumn spec file extension */
4
4
  export declare const SpecExtension: ".spec";
5
5
  /** PColumn data info file extension */
@@ -1 +1 @@
1
- {"version":3,"file":"api_factory.d.ts","sourceRoot":"","sources":["../../../src/pframe/internal_api/api_factory.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,OAAO,EACP,YAAY,EACZ,uBAAuB,EACvB,YAAY,EACZ,0BAA0B,EAC1B,WAAW,EACX,SAAS,EACV,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAEL,cAAc,EACf,MAAM,gBAAgB,CAAC;AAExB,kCAAkC;AAClC,eAAO,MAAM,aAAa,SAAmB,CAAC;AAE9C,uCAAuC;AACvC,eAAO,MAAM,iBAAiB,aAAuB,CAAC;AAEtD,wFAAwF;AACxF,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,EAAE,6BAA6B,CAAC,CAAC;AAE1E;+EAC+E;AAC/E,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B,gGAAgG;AAChG,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,WAAW,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpD,qEAAqE;IACrE,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAE9D;;;OAGG;IACH,aAAa,CAAC,EAAE,cAAc,CAAC;CAChC;AAED;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,CAAC,IAAI,IACrB,YAAY,GACZ,uBAAuB,CAAC,IAAI,CAAC,GAC7B,yBAAyB,CAAC,IAAI,CAAC,GAC/B,0BAA0B,CAAC,YAAY,CAAC,IAAI,CAAC,C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AU,CAAC,CAAC;IAE9D;;;OAGG;IACH,aAAa,CAAC,EAAE,cAAc,CAAC;CAChC;AAED;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,CAAC,IAAI,IACrB,YAAY,GACZ,uBAAuB,CAAC,IAAI,CAAC,GAC7B,yBAAyB,CAAC,IAAI,CAAC,GAC/B,0BAA0B,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;AAEnD;oBACoB;AACpB,MAAM,WAAW,kBAAmB,SAAQ,UAAU;IACpD,8CAA8C;IAC9C,aAAa,CAAC,UAAU,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAEpD,qCAAqC;IACrC,aAAa,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;IAElE;;;OAGG;IACH,aAAa,CACX,QAAQ,EAAE,SAAS,EACnB,QAAQ,EAAE,QAAQ,CAAC,YAAY,CAAC,EAChC,OAAO,CAAC,EAAE;QACR,MAAM,CAAC,EAAE,WAAW,CAAC;KACtB,GACA,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB;wEACoE;IACpE,OAAO,IAAI,IAAI,CAAC;CACjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"api_factory.js","sources":["../../../src/pframe/internal_api/api_factory.ts"],"sourcesContent":["import {\n BinaryPartitionedDataInfo,\n Branded,\n JsonDataInfo,\n JsonPartitionedDataInfo,\n ParquetChunk,\n ParquetPartitionedDataInfo,\n PColumnSpec,\n PObjectId,\n} from '@milaboratories/pl-model-common';\nimport {\n HttpHelpers,\n HttpServerInfo,\n} from './http_helpers';\n\n/** PColumn spec file extension */\nexport const SpecExtension = '.spec' as const;\n\n/** PColumn data info file extension */\nexport const DataInfoExtension = '.datainfo' as const;\n\n/** Abstract identifier of a data blob that can be requested from the storage backend */\nexport type PFrameBlobId = Branded<string, 'PFrameInternal.PFrameBlobId'>;\n\n/** Path of the file containing requested data (blob). This path is returned by\n * {@link BlobPathResolver} as soon as blob materialized in the file system. */\nexport type FilePath = string;\n\n/** Data source allows PFrame to retrieve the data blobs for columns with assigned data info. */\nexport interface PFrameDataSourceV2 {\n /**\n * PFrame may notify storage backend about its plans to use particular blobs in the future.\n * Storage backend will do its best to preload specified blob so the subsequent\n * {@link resolveBlob} will quickly return preloaded file path.\n */\n preloadBlob(blobIds: PFrameBlobId[]): Promise<void>;\n\n /** Returns raw blob data given the blob id from {@link DataInfo}. */\n resolveBlobContent(blobId: PFrameBlobId): Promise<Uint8Array>;\n\n /**\n * Parquet HTTP(S) server connection settings, {@link HttpHelpers.createHttpServer}\n * When not provided, parquet BlobIds would be treated as local file paths.\n */\n parquetServer?: HttpServerInfo;\n}\n\n/**\n * Union type representing all possible data storage formats for PColumn data.\n * The specific format used depends on data size, access patterns, and performance requirements.\n *\n * @template Blob - Type parameter representing the storage reference type (could be ResourceInfo, PFrameBlobId, etc.)\n */\nexport type DataInfo<Blob> =\n | JsonDataInfo\n | JsonPartitionedDataInfo<Blob>\n | BinaryPartitionedDataInfo<Blob>\n | ParquetPartitionedDataInfo<ParquetChunk<Blob>>;\n\n/** API exposed by PFrames library allowing to create and provide data for\n * PFrame objects */\nexport interface PFrameFactoryAPIV4 extends Disposable {\n /** Associates data source with this PFrame */\n setDataSource(dataSource: PFrameDataSourceV2): void;\n\n /** Adds PColumn without data info */\n addColumnSpec(columnId: PObjectId, columnSpec: PColumnSpec): void;\n\n /**\n * Assign data info to the specified PColumn.\n * For parquet data info, schema resolution via network is performed during this call.\n */\n setColumnData(\n columnId: PObjectId,\n dataInfo: DataInfo<PFrameBlobId>,\n options?: {\n signal?: AbortSignal,\n }\n ): Promise<void>;\n\n /** Releases all the data previously added to PFrame using methods above,\n * any interactions with disposed PFrame will result in exception */\n dispose(): void;\n}\n"],"names":[],"mappings":"AAeA;AACO,MAAM,aAAa,GAAG;AAE7B;AACO,MAAM,iBAAiB,GAAG;;;;"}
1
+ {"version":3,"file":"api_factory.js","sources":["../../../src/pframe/internal_api/api_factory.ts"],"sourcesContent":["import type {\n BinaryPartitionedDataInfo,\n Branded,\n JsonDataInfo,\n JsonPartitionedDataInfo,\n ParquetChunk,\n ParquetPartitionedDataInfo,\n PColumnSpec,\n PObjectId,\n} from '@milaboratories/pl-model-common';\nimport type { HttpServerInfo } from './http_helpers';\n\n/** PColumn spec file extension */\nexport const SpecExtension = '.spec' as const;\n\n/** PColumn data info file extension */\nexport const DataInfoExtension = '.datainfo' as const;\n\n/** Abstract identifier of a data blob that can be requested from the storage backend */\nexport type PFrameBlobId = Branded<string, 'PFrameInternal.PFrameBlobId'>;\n\n/** Path of the file containing requested data (blob). This path is returned by\n * {@link BlobPathResolver} as soon as blob materialized in the file system. */\nexport type FilePath = string;\n\n/** Data source allows PFrame to retrieve the data blobs for columns with assigned data info. */\nexport interface PFrameDataSourceV2 {\n /**\n * PFrame may notify storage backend about its plans to use particular blobs in the future.\n * Storage backend will do its best to preload specified blob so the subsequent\n * {@link resolveBlob} will quickly return preloaded file path.\n */\n preloadBlob(blobIds: PFrameBlobId[]): Promise<void>;\n\n /** Returns raw blob data given the blob id from {@link DataInfo}. */\n resolveBlobContent(blobId: PFrameBlobId): Promise<Uint8Array>;\n\n /**\n * Parquet HTTP(S) server connection settings, {@link HttpHelpers.createHttpServer}\n * When not provided, parquet BlobIds would be treated as local file paths.\n */\n parquetServer?: HttpServerInfo;\n}\n\n/**\n * Union type representing all possible data storage formats for PColumn data.\n * The specific format used depends on data size, access patterns, and performance requirements.\n *\n * @template Blob - Type parameter representing the storage reference type (could be ResourceInfo, PFrameBlobId, etc.)\n */\nexport type DataInfo<Blob> =\n | JsonDataInfo\n | JsonPartitionedDataInfo<Blob>\n | BinaryPartitionedDataInfo<Blob>\n | ParquetPartitionedDataInfo<ParquetChunk<Blob>>;\n\n/** API exposed by PFrames library allowing to create and provide data for\n * PFrame objects */\nexport interface PFrameFactoryAPIV4 extends Disposable {\n /** Associates data source with this PFrame */\n setDataSource(dataSource: PFrameDataSourceV2): void;\n\n /** Adds PColumn without data info */\n addColumnSpec(columnId: PObjectId, columnSpec: PColumnSpec): void;\n\n /**\n * Assign data info to the specified PColumn.\n * For parquet data info, schema resolution via network is performed during this call.\n */\n setColumnData(\n columnId: PObjectId,\n dataInfo: DataInfo<PFrameBlobId>,\n options?: {\n signal?: AbortSignal;\n }\n ): Promise<void>;\n\n /** Releases all the data previously added to PFrame using methods above,\n * any interactions with disposed PFrame will result in exception */\n dispose(): void;\n}\n"],"names":[],"mappings":"AAYA;AACO,MAAM,aAAa,GAAG;AAE7B;AACO,MAAM,iBAAiB,GAAG;;;;"}
@@ -1,10 +1,11 @@
1
- import { FindColumnsRequest, FindColumnsResponse } from './find_columns';
2
- import { DeleteColumnFromColumnsRequest, DeleteColumnFromColumnsResponse } from './delete_column';
3
- import { PColumnInfo, PColumnSpec, PObjectId, UniqueValuesRequest, UniqueValuesResponse } from '@milaboratories/pl-model-common';
4
- import { CreateTableRequestV4 } from './create_table';
5
- import { PTableV7 } from './table';
1
+ import type { FindColumnsRequest, FindColumnsResponse } from './find_columns';
2
+ import type { DeleteColumnFromColumnsRequest, DeleteColumnFromColumnsResponse } from './delete_column';
3
+ import type { PColumnInfo, PColumnSpec, PObjectId, UniqueValuesRequest, UniqueValuesResponse } from '@milaboratories/pl-model-common';
4
+ import type { CreateTableRequestV4 } from './create_table';
5
+ import type { PTableV8 } from './table';
6
+ import type { PTableId } from './common';
6
7
  /** Read interface exposed by PFrames library */
7
- export interface PFrameReadAPIV10 {
8
+ export interface PFrameReadAPIV11 {
8
9
  /**
9
10
  * Finds columns given filtering criteria on column name, annotations etc.
10
11
  * and a set of qualified axes specs to find only columns with compatible
@@ -20,11 +21,11 @@ export interface PFrameReadAPIV10 {
20
21
  */
21
22
  deleteColumn(request: DeleteColumnFromColumnsRequest): Promise<DeleteColumnFromColumnsResponse>;
22
23
  /** Retrieve single column spec */
23
- getColumnSpec(columnId: PObjectId): Promise<PColumnSpec>;
24
+ getColumnSpec(columnId: PObjectId): Promise<PColumnSpec | null>;
24
25
  /** Retrieve information about all columns currently added to the PFrame */
25
26
  listColumns(): Promise<PColumnInfo[]>;
26
27
  /** Calculates data for the table and returns an object to access it */
27
- createTable(request: CreateTableRequestV4): PTableV7;
28
+ createTable(tableId: PTableId, request: CreateTableRequestV4): PTableV8;
28
29
  /** Calculate set of unique values for a specific axis for the filtered set of records */
29
30
  getUniqueValues(request: UniqueValuesRequest, ops?: {
30
31
  signal?: AbortSignal;
@@ -1 +1 @@
1
- {"version":3,"file":"api_read.d.ts","sourceRoot":"","sources":["../../../src/pframe/internal_api/api_read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,8BAA8B,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAC;AAClG,OAAO,EACL,WAAW,EACX,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,gDAAgD;AAChD,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;SAOK;IACL,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEvE;;;OAGG;IACH,YAAY,CAAC,OAAO,EAAE,8BAA8B,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAC;IAEhG,kCAAkC;IAClC,aAAa,CAAC,QAAQ,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEzD,2EAA2E;IAC3E,WAAW,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAEtC,uEAAuE;IACvE,WAAW,CAAC,OAAO,EAAE,oBAAoB,GAAG,QAAQ,CAAC;IAErD,yFAAyF;IACzF,eAAe,CACb,OAAO,EAAE,mBAAmB,EAC5B,GA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A,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAClC"}
@@ -1,5 +1,7 @@
1
- import { AxisSpec, ValueType } from '@milaboratories/pl-model-common';
1
+ import type { AxisSpec, PFrameHandle, PTableHandle, ValueType } from '@milaboratories/pl-model-common';
2
2
  export type Logger = (level: 'info' | 'warn' | 'error', message: string) => void;
3
+ export type PFrameId = PFrameHandle;
4
+ export type PTableId = PTableHandle;
3
5
  export interface SingleAxisSelector {
4
6
  name: string;
5
7
  type?: ValueType;
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/pframe/internal_api/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEtE,MAAM,MAAM,MAAM,GAAG,CACnB,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,EAChC,OAAO,EAAE,MAAM,KACZ,IAAI,CAAC;AAEV,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,kBAAkB,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE,QAAQ,EAAE,CAAC;IACrB,cAAc,EAAE,iBAAiB,EAAE,CAAC;CACrC;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,UAAU,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;CAC3B,CAAA"}
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/pframe/internal_api/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,SAAS,EACV,MAAM,iCAAiC,CAAC;AAEzC,MAAM,MAAM,MAAM,GAAG,CACnB,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,EAChC,OAAO,EAAE,MAAM,KACZ,IAAI,CAAC;AAEV,MAAM,MAAM,QAAQ,GAAG,YAAY,CAAC;AAEpC,MAAM,MAAM,QAAQ,GAAG,YAAY,CAAC;AAEpC,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,kBAAkB,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE,QAAQ,EAAE,CAAC;IACrB,cAAc,EAAE,iBAAiB,EAAE,CAAC;CACrC;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,UAAU,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;CAC3B,CAAC"}
@@ -1,5 +1,5 @@
1
- import { ConstantAxisFilter } from './common';
2
- import { JsonDataInfo, PColumnSpec, PObjectId, PTableRecordFilter } from '@milaboratories/pl-model-common';
1
+ import type { ConstantAxisFilter } from './common';
2
+ import type { JsonDataInfo, PColumnSpec, PObjectId, PTableRecordFilter } from '@milaboratories/pl-model-common';
3
3
  export interface ColumnJoinEntry {
4
4
  type: 'column';
5
5
  columnId: PObjectId;
@@ -1 +1 @@
1
- {"version":3,"file":"create_table.d.ts","sourceRoot":"","sources":["../../../src/pframe/internal_api/create_table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,M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AAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,WAAW,CAAC;IACrB,SAAS,EAAE,WAAW,EAAE,CAAC;CAC1B;AAED,MAAM,MAAM,WAAW,GACnB,eAAe,GACf,qBAAqB,GACrB,yBAAyB,GACzB,qBAAqB,GACrB,WAAW,GACX,UAAU,GACV,WAAW,CAAC;AAEhB,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,WAAW,CAAC;IACjB,OAAO,EAAE,kBAAkB,EAAE,CAAC;CAC/B"}
@@ -1,4 +1,4 @@
1
- import { ColumnAxesWithQualifications } from './common';
1
+ import type { ColumnAxesWithQualifications } from './common';
2
2
  export interface DeleteColumnFromColumnsRequest {
3
3
  columns: ColumnAxesWithQualifications[];
4
4
  /** Zero based index of the column to delete */
@@ -1 +1 @@
1
- {"version":3,"file":"delete_column.d.ts","sourceRoot":"","sources":["../../../src/pframe/internal_api/delete_column.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAExD,MAAM,WAAW,8BAA8B;IAC7C,OAAO,EAAE,4BAA4B,EAAE,CAAC;IAExC,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,+BAA+B;IAC9C,OAAO,EAAE,4BAA4B,EAAE,CAAC;CACzC"}
1
+ {"version":3,"file":"delete_column.d.ts","sourceRoot":"","sources":["../../../src/pframe/internal_api/delete_column.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAE7D,MAAM,WAAW,8BAA8B;IAC7C,OAAO,EAAE,4BAA4B,EAAE,CAAC;IAExC,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,+BAA+B;IAC9C,OAAO,EAAE,4BAA4B,EAAE,CAAC;CACzC"}
@@ -1,5 +1,5 @@
1
- import { ColumnFilter, PColumnIdAndSpec } from '@milaboratories/pl-model-common';
2
- import { AxisQualification, ColumnAxesWithQualifications } from './common';
1
+ import type { ColumnFilter, PColumnIdAndSpec } from '@milaboratories/pl-model-common';
2
+ import type { AxisQualification, ColumnAxesWithQualifications } from './common';
3
3
  export interface FindColumnsRequest {
4
4
  columnFilter: ColumnFilter;
5
5
  compatibleWith: ColumnAxesWithQualifications[];
@@ -1 +1 @@
1
- {"version":3,"file":"find_columns.d.ts","sourceRoot":"","sources":["../../../src/pframe/internal_api/find_columns.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAE3E,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,YAAY,CAAC;IAC3B,cAAc,EAAE,4BAA4B,EAAE,CAAC;IAC/C,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,gCAAgC;IAC/C,UAAU,EAAE,iBAAiB,EAAE,EAAE,CAAC;IAClC,MAAM,EAAE,iBAAiB,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,yBAAyB;IACxC,cAAc,EAAE,gCAAgC,CAAC;IACjD,yBAAyB,EAAE,gCAAgC,CAAC;CAC7D;AAED,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,gBAAgB,CAAC;IACtB,eAAe,EAAE,yBAAyB,EAAE,CAAC;CAC9C;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,sBAAsB,EAAE,CAAC;CAChC"}
1
+ {"version":3,"file":"find_columns.d.ts","sourceRoot":"","sources":["../../../src/pframe/internal_api/find_columns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACtF,OAAO,KAAK,EAAE,iBAAiB,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAEhF,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,YAAY,CAAC;IAC3B,cAAc,EAAE,4BAA4B,EAAE,CAAC;IAC/C,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,gCAAgC;IAC/C,UAAU,EAAE,iBAAiB,EAAE,EAAE,CAAC;IAClC,MAAM,EAAE,iBAAiB,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,yBAAyB;IACxC,cAAc,EAAE,gCAAgC,CAAC;IACjD,yBAAyB,EAAE,gCAAgC,CAAC;CAC7D;AAED,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,gBAAgB,CAAC;IACtB,eAAe,EAAE,yBAAyB,EAAE,CAAC;CAC9C;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,sBAAsB,EAAE,CAAC;CAChC"}
@@ -1 +1 @@
1
- {"version":3,"file":"http_helpers.cjs","sources":["../../../src/pframe/internal_api/http_helpers.ts"],"sourcesContent":["import type { Readable } from 'node:stream';\nimport type { RequestListener } from 'node:http';\nimport type { Branded, Base64Encoded } from '@milaboratories/pl-model-common';\nimport type { Logger } from './common';\n\n/** Parquet file extension */\nexport const ParquetExtension = '.parquet' as const;\n\n/** Parquet file name */\nexport type ParquetFileName = Branded<`${string}.parquet`, 'PFrameInternal.ParquetFileName'>;\n\nexport type FileRange = {\n /** Start byte position (inclusive) */\n start: number;\n /** End byte position (inclusive) */\n end: number;\n}\n\n/** HTTP range as of RFC 9110 <https://datatracker.ietf.org/doc/html/rfc9110#name-range> */\nexport type HttpRange =\n | {\n /**\n * Get file content in the specified byte range\n * \n * @example\n * ```\n * GET /file.parquet HTTP/1.1\n * Range: bytes=0-1023\n * ```\n */\n type: 'bounded';\n /** Start byte position (inclusive) */\n start: number;\n /** End byte position (inclusive) */\n end: number;\n }\n | {\n /**\n * Get byte range starting from the specified offset\n * \n * @example\n * ```\n * GET /file.parquet HTTP/1.1\n * Range: bytes=1024-\n * ```\n */\n type: 'offset';\n /** Start byte position (inclusive) */\n offset: number;\n }\n | {\n /**\n * Get byte range starting from the specified suffix\n * \n * @example\n * ```\n * GET /file.parquet HTTP/1.1\n * Range: bytes=-1024\n * ```\n */\n type: 'suffix';\n /** End byte position (inclusive) */\n suffix: number;\n };\n\n/** HTTP method passed to object store */\nexport type HttpMethod = 'GET' | 'HEAD';\n\n/** HTTP response from object store */\nexport type ObjectStoreResponse =\n | {\n /**\n * Will be translated to 500 Internal Server Error by the handler\n * or 408 Request Timeout if the request was aborted\n */\n type: 'InternalError';\n }\n | {\n /** Will be translated to 404 Not Found by the handler */\n type: 'NotFound';\n }\n | {\n /** Will be translated to 416 Range Not Satisfiable by the handler */\n type: 'RangeNotSatisfiable';\n /** Total file size in bytes */\n size: number;\n }\n | {\n /** Will be translated to 200 OK or 206 Partial Content by the handler */\n type: 'Ok';\n /** Total file size in bytes */\n size: number;\n /** File range translated from HTTP range */\n range: FileRange;\n /** Stream of file content, undefined for HEAD requests */\n data?: Readable;\n }\n\n/** Common options for object store creation */\nexport interface ObjectStoreOptions {\n /** Logger instance, no logging is performed when not provided */\n logger?: Logger;\n}\n\n/** Options for file system object store creation */\nexport interface FsStoreOptions extends ObjectStoreOptions {\n /** Local directory to serve files from */\n rootDir: string;\n}\n\nexport interface ObjectStore {\n /**\n * Proxy HTTP(S) request for parquet file to object store.\n * Callback promise resolves when stream is closed by handler @see HttpHelpers.createRequestHandler\n * Callback API is used so that ObjectStore can limit the number of concurrent requests.\n */\n request(\n filename: ParquetFileName,\n params: {\n method: HttpMethod;\n range?: HttpRange;\n signal: AbortSignal;\n callback: (response: ObjectStoreResponse) => Promise<void>;\n }\n ): void;\n}\n\n/** File system abstraction for request handler factory, @see HttpHelpers.createRequestHandler */\nexport abstract class BaseObjectStore implements ObjectStore {\n protected readonly logger: Logger;\n\n constructor(options: ObjectStoreOptions) {\n this.logger = options.logger ?? (() => {});\n }\n\n /** Translate HTTP range to file range, @returns null if the range is not satisfiable */\n protected translate(fileSize: number, range?: HttpRange): FileRange | null {\n if (!range) return { start: 0, end: fileSize - 1 };\n switch (range.type) {\n case 'bounded':\n if (range.end >= fileSize) return null;\n return { start: range.start, end: range.end };\n case 'offset':\n if (range.offset >= fileSize) return null;\n return { start: range.offset, end: fileSize - 1 };\n case 'suffix':\n if (range.suffix > fileSize) return null;\n return { start: fileSize - range.suffix, end: fileSize - 1 };\n }\n }\n\n /**\n * Proxy HTTP(S) request for parquet file to object store.\n * Callback promise resolves when stream is closed by handler @see HttpHelpers.createRequestHandler\n * Callback API is used so that ObjectStore can limit the number of concurrent requests.\n */\n abstract request(\n filename: ParquetFileName,\n params: {\n method: HttpMethod;\n range?: HttpRange;\n signal: AbortSignal;\n callback: (response: ObjectStoreResponse) => Promise<void>;\n }\n ): Promise<void>;\n}\n\n/** Object store base URL in format accepted by Apache DataFusion and DuckDB */\nexport type ObjectStoreUrl = Branded<string, 'PFrameInternal.ObjectStoreUrl'>;\n\n/** HTTP(S) request handler creation options */\nexport type RequestHandlerOptions = {\n /** Object store to serve files from, @see HttpHelpers.createFsStore */\n store: ObjectStore;\n /** Here will go caching options... */\n}\n\n/** Server configuration options */\nexport type HttpServerOptions = {\n /** HTTP(S) request handler function, @see HttpHelpers.createRequestHandler */\n handler: RequestListener;\n /** Port to bind to, @default 0 for auto-assignment */\n port?: number;\n /** Do not apply authorization middleware to @param handler */\n noAuth?: true;\n /** Downgrade default HTTPS server to plain HTTP, @warning use only for testing */\n noHttps?: true;\n};\n\n/**\n * Long unique opaque string for use in Bearer authorization header\n * \n * @example\n * ```ts\n * request.setHeader('Authorization', `Bearer ${authToken}`);\n * ```\n */\nexport type HttpAuthorizationToken = Branded<string, 'PFrameInternal.HttpAuthorizationToken'>;\n\n/**\n * TLS certificate in PEM format\n * \n * @example\n * ```txt\n * -----BEGIN CERTIFICATE-----\n * MIIC2zCCAcOgAwIBAgIJaVW7...\n * ...\n * ...Yf9CRK8fgnukKM7TJ\n * -----END CERTIFICATE-----\n * ```\n */\nexport type PemCertificate = Branded<string, 'PFrameInternal.PemCertificate'>;\n\n/** HTTP(S) server connection settings, {@link HttpHelpers.createHttpServer} */\nexport type HttpServerInfo = {\n /** URL of the HTTP(S) server formatted as `http{s}://<host>:<port>/` */\n url: ObjectStoreUrl;\n /** Authorization token for Bearer scheme, undefined when @see HttpServerOptions.noAuth flag is set */\n authToken?: HttpAuthorizationToken;\n /** Encoded CA certificate of HTTPS server, undefined when @see HttpServerOptions.noHttps flag is set */\n encodedCaCert?: Base64Encoded<PemCertificate>;\n};\n\n/** HTTP(S) server information and controls, @see HttpHelpers.createHttpServer */\nexport interface HttpServer {\n /** Server configuration information for initiating connections from clients */\n get info(): HttpServerInfo;\n /** Promise that resolves when the server is stopped */\n get stopped(): Promise<void>;\n /** Request server stop, returns the same promise as @see HttpServer.stopped */\n stop(): Promise<void>;\n}\n\n/** List of HTTP(S) related helper functions exposed by PFrame module */\nexport interface HttpHelpers {\n /**\n * Create an object store for serving files from a local directory.\n * Rejects if the provided path does not exist or is not a directory.\n */\n createFsStore(options: FsStoreOptions): Promise<ObjectStore>;\n\n /**\n * Create an HTTP request handler for serving files from an object store.\n * Accepts only paths of the form `/<filename>.parquet`, returns 410 otherwise.\n * Assumes that files are immutable (and sets cache headers accordingly).\n */\n createRequestHandler(options: RequestHandlerOptions): RequestListener;\n\n /**\n * Serve HTTP(S) requests using the provided handler on localhost port.\n * @returns promise that resolves when the server has stopped.\n *\n * @example\n * ```ts\n * const rootDir = '/path/to/directory/with/parquet/files';\n *\n * let store = await HttpHelpers.createFsStore({ rootDir }).catch((err: unknown) => {\n * throw new Error(`Failed to create file store for ${rootDir} - ${ensureError(err)}`);\n * });\n *\n * const server = await HttpHelpers.createHttpServer({\n * handler: HttpHelpers.createRequestHandler({ store }),\n * }).catch((err: unknown) => {\n * throw new Error(`Failed to start HTTPS server - ${ensureError(err)}`);\n * });\n *\n * const { url, authToken, encodedCaCert } = server.info;\n *\n * await server.stop();\n * ```\n */\n createHttpServer(options: HttpServerOptions): Promise<HttpServer>;\n}\n"],"names":[],"mappings":";;AAKA;AACO,MAAM,gBAAgB,GAAG;AAyHhC;MACsB,eAAe,CAAA;AAChB,IAAA,MAAM;AAEzB,IAAA,WAAA,CAAY,OAA2B,EAAA;AACrC,QAAA,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,KAAK,MAAK,EAAE,CAAC,CAAC;IAC5C;;IAGU,SAAS,CAAC,QAAgB,EAAE,KAAiB,EAAA;AACrD,QAAA,IAAI,CAAC,KAAK;YAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,QAAQ,GAAG,CAAC,EAAE;AAClD,QAAA,QAAQ,KAAK,CAAC,IAAI;AAChB,YAAA,KAAK,SAAS;AACZ,gBAAA,IAAI,KAAK,CAAC,GAAG,IAAI,QAAQ;AAAE,oBAAA,OAAO,IAAI;AACtC,gBAAA,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE;AAC/C,YAAA,KAAK,QAAQ;AACX,gBAAA,IAAI,KAAK,CAAC,MAAM,IAAI,QAAQ;AAAE,oBAAA,OAAO,IAAI;AACzC,gBAAA,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,QAAQ,GAAG,CAAC,EAAE;AACnD,YAAA,KAAK,QAAQ;AACX,gBAAA,IAAI,KAAK,CAAC,MAAM,GAAG,QAAQ;AAAE,oBAAA,OAAO,IAAI;AACxC,gBAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,GAAG,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,QAAQ,GAAG,CAAC,EAAE;;IAElE;AAgBD;;;;;"}
1
+ {"version":3,"file":"http_helpers.cjs","sources":["../../../src/pframe/internal_api/http_helpers.ts"],"sourcesContent":["import type { Readable } from 'node:stream';\nimport type { RequestListener } from 'node:http';\nimport type { Branded, Base64Encoded } from '@milaboratories/pl-model-common';\nimport type { Logger } from './common';\n\n/** Parquet file extension */\nexport const ParquetExtension = '.parquet' as const;\n\n/** Parquet file name */\nexport type ParquetFileName = Branded<`${string}.parquet`, 'PFrameInternal.ParquetFileName'>;\n\nexport type FileRange = {\n /** Start byte position (inclusive) */\n start: number;\n /** End byte position (inclusive) */\n end: number;\n};\n\n/** HTTP range as of RFC 9110 <https://datatracker.ietf.org/doc/html/rfc9110#name-range> */\nexport type HttpRange =\n | {\n /**\n * Get file content in the specified byte range\n *\n * @example\n * ```\n * GET /file.parquet HTTP/1.1\n * Range: bytes=0-1023\n * ```\n */\n type: 'bounded';\n /** Start byte position (inclusive) */\n start: number;\n /** End byte position (inclusive) */\n end: number;\n }\n | {\n /**\n * Get byte range starting from the specified offset\n *\n * @example\n * ```\n * GET /file.parquet HTTP/1.1\n * Range: bytes=1024-\n * ```\n */\n type: 'offset';\n /** Start byte position (inclusive) */\n offset: number;\n }\n | {\n /**\n * Get byte range starting from the specified suffix\n *\n * @example\n * ```\n * GET /file.parquet HTTP/1.1\n * Range: bytes=-1024\n * ```\n */\n type: 'suffix';\n /** End byte position (inclusive) */\n suffix: number;\n };\n\n/** HTTP method passed to object store */\nexport type HttpMethod = 'GET' | 'HEAD';\n\n/** HTTP response from object store */\nexport type ObjectStoreResponse =\n | {\n /**\n * Will be translated to 500 Internal Server Error by the handler\n * or 408 Request Timeout if the request was aborted\n */\n type: 'InternalError';\n }\n | {\n /** Will be translated to 404 Not Found by the handler */\n type: 'NotFound';\n }\n | {\n /** Will be translated to 416 Range Not Satisfiable by the handler */\n type: 'RangeNotSatisfiable';\n /** Total file size in bytes */\n size: number;\n }\n | {\n /** Will be translated to 200 OK or 206 Partial Content by the handler */\n type: 'Ok';\n /** Total file size in bytes */\n size: number;\n /** File range translated from HTTP range */\n range: FileRange;\n /** Stream of file content, undefined for HEAD requests */\n data?: Readable;\n };\n\n/** Common options for object store creation */\nexport interface ObjectStoreOptions {\n /** Logger instance, no logging is performed when not provided */\n logger?: Logger;\n}\n\n/** Options for file system object store creation */\nexport interface FsStoreOptions extends ObjectStoreOptions {\n /** Local directory to serve files from */\n rootDir: string;\n}\n\nexport interface ObjectStore {\n /**\n * Proxy HTTP(S) request for parquet file to object store.\n * Callback promise resolves when stream is closed by handler @see HttpHelpers.createRequestHandler\n * Callback API is used so that ObjectStore can limit the number of concurrent requests.\n */\n request(\n filename: ParquetFileName,\n params: {\n method: HttpMethod;\n range?: HttpRange;\n signal: AbortSignal;\n callback: (response: ObjectStoreResponse) => Promise<void>;\n }\n ): void;\n}\n\n/** File system abstraction for request handler factory, @see HttpHelpers.createRequestHandler */\nexport abstract class BaseObjectStore implements ObjectStore {\n protected readonly logger: Logger;\n\n constructor(options: ObjectStoreOptions) {\n this.logger = options.logger ?? (() => {});\n }\n\n /** Translate HTTP range to file range, @returns null if the range is not satisfiable */\n protected translate(fileSize: number, range?: HttpRange): FileRange | null {\n if (!range) return { start: 0, end: fileSize - 1 };\n switch (range.type) {\n case 'bounded':\n if (range.end >= fileSize) return null;\n return { start: range.start, end: range.end };\n case 'offset':\n if (range.offset >= fileSize) return null;\n return { start: range.offset, end: fileSize - 1 };\n case 'suffix':\n if (range.suffix > fileSize) return null;\n return { start: fileSize - range.suffix, end: fileSize - 1 };\n }\n }\n\n /**\n * Proxy HTTP(S) request for parquet file to object store.\n * Callback promise resolves when stream is closed by handler @see HttpHelpers.createRequestHandler\n * Callback API is used so that ObjectStore can limit the number of concurrent requests.\n */\n abstract request(\n filename: ParquetFileName,\n params: {\n method: HttpMethod;\n range?: HttpRange;\n signal: AbortSignal;\n callback: (response: ObjectStoreResponse) => Promise<void>;\n }\n ): Promise<void>;\n}\n\n/** Object store base URL in format accepted by Apache DataFusion and DuckDB */\nexport type ObjectStoreUrl = Branded<string, 'PFrameInternal.ObjectStoreUrl'>;\n\n/** HTTP(S) request handler creation options */\nexport type RequestHandlerOptions = {\n /** Object store to serve files from, @see HttpHelpers.createFsStore */\n store: ObjectStore;\n /** Here will go caching options... */\n};\n\n/** Server configuration options */\nexport type HttpServerOptions = {\n /** HTTP(S) request handler function, @see HttpHelpers.createRequestHandler */\n handler: RequestListener;\n /** Port to bind to, @default 0 for auto-assignment */\n port?: number;\n /** Do not apply authorization middleware to @param handler */\n noAuth?: true;\n /** Downgrade default HTTPS server to plain HTTP, @warning use only for testing */\n noHttps?: true;\n};\n\n/**\n * Long unique opaque string for use in Bearer authorization header\n *\n * @example\n * ```ts\n * request.setHeader('Authorization', `Bearer ${authToken}`);\n * ```\n */\nexport type HttpAuthorizationToken = Branded<string, 'PFrameInternal.HttpAuthorizationToken'>;\n\n/**\n * TLS certificate in PEM format\n *\n * @example\n * ```txt\n * -----BEGIN CERTIFICATE-----\n * MIIC2zCCAcOgAwIBAgIJaVW7...\n * ...\n * ...Yf9CRK8fgnukKM7TJ\n * -----END CERTIFICATE-----\n * ```\n */\nexport type PemCertificate = Branded<string, 'PFrameInternal.PemCertificate'>;\n\n/** HTTP(S) server connection settings, {@link HttpHelpers.createHttpServer} */\nexport type HttpServerInfo = {\n /** URL of the HTTP(S) server formatted as `http{s}://<host>:<port>/` */\n url: ObjectStoreUrl;\n /** Authorization token for Bearer scheme, undefined when @see HttpServerOptions.noAuth flag is set */\n authToken?: HttpAuthorizationToken;\n /** Encoded CA certificate of HTTPS server, undefined when @see HttpServerOptions.noHttps flag is set */\n encodedCaCert?: Base64Encoded<PemCertificate>;\n};\n\n/** HTTP(S) server information and controls, @see HttpHelpers.createHttpServer */\nexport interface HttpServer {\n /** Server configuration information for initiating connections from clients */\n get info(): HttpServerInfo;\n /** Promise that resolves when the server is stopped */\n get stopped(): Promise<void>;\n /** Request server stop, returns the same promise as @see HttpServer.stopped */\n stop(): Promise<void>;\n}\n\n/** List of HTTP(S) related helper functions exposed by PFrame module */\nexport interface HttpHelpers {\n /**\n * Create an object store for serving files from a local directory.\n * Rejects if the provided path does not exist or is not a directory.\n */\n createFsStore(options: FsStoreOptions): Promise<ObjectStore>;\n\n /**\n * Create an HTTP request handler for serving files from an object store.\n * Accepts only paths of the form `/<filename>.parquet`, returns 410 otherwise.\n * Assumes that files are immutable (and sets cache headers accordingly).\n */\n createRequestHandler(options: RequestHandlerOptions): RequestListener;\n\n /**\n * Serve HTTP(S) requests using the provided handler on localhost port.\n * @returns promise that resolves when the server has stopped.\n *\n * @example\n * ```ts\n * const rootDir = '/path/to/directory/with/parquet/files';\n *\n * let store = await HttpHelpers.createFsStore({ rootDir }).catch((err: unknown) => {\n * throw new Error(`Failed to create file store for ${rootDir} - ${ensureError(err)}`);\n * });\n *\n * const server = await HttpHelpers.createHttpServer({\n * handler: HttpHelpers.createRequestHandler({ store }),\n * }).catch((err: unknown) => {\n * throw new Error(`Failed to start HTTPS server - ${ensureError(err)}`);\n * });\n *\n * const { url, authToken, encodedCaCert } = server.info;\n *\n * await server.stop();\n * ```\n */\n createHttpServer(options: HttpServerOptions): Promise<HttpServer>;\n}\n"],"names":[],"mappings":";;AAKA;AACO,MAAM,gBAAgB,GAAG;AAyHhC;MACsB,eAAe,CAAA;AAChB,IAAA,MAAM;AAEzB,IAAA,WAAA,CAAY,OAA2B,EAAA;AACrC,QAAA,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,KAAK,MAAK,EAAE,CAAC,CAAC;IAC5C;;IAGU,SAAS,CAAC,QAAgB,EAAE,KAAiB,EAAA;AACrD,QAAA,IAAI,CAAC,KAAK;YAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,QAAQ,GAAG,CAAC,EAAE;AAClD,QAAA,QAAQ,KAAK,CAAC,IAAI;AAChB,YAAA,KAAK,SAAS;AACZ,gBAAA,IAAI,KAAK,CAAC,GAAG,IAAI,QAAQ;AAAE,oBAAA,OAAO,IAAI;AACtC,gBAAA,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE;AAC/C,YAAA,KAAK,QAAQ;AACX,gBAAA,IAAI,KAAK,CAAC,MAAM,IAAI,QAAQ;AAAE,oBAAA,OAAO,IAAI;AACzC,gBAAA,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,QAAQ,GAAG,CAAC,EAAE;AACnD,YAAA,KAAK,QAAQ;AACX,gBAAA,IAAI,KAAK,CAAC,MAAM,GAAG,QAAQ;AAAE,oBAAA,OAAO,IAAI;AACxC,gBAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,GAAG,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,QAAQ,GAAG,CAAC,EAAE;;IAElE;AAgBD;;;;;"}
@@ -15,14 +15,14 @@ export type FileRange = {
15
15
  /** HTTP range as of RFC 9110 <https://datatracker.ietf.org/doc/html/rfc9110#name-range> */
16
16
  export type HttpRange = {
17
17
  /**
18
- * Get file content in the specified byte range
19
- *
20
- * @example
21
- * ```
22
- * GET /file.parquet HTTP/1.1
23
- * Range: bytes=0-1023
24
- * ```
25
- */
18
+ * Get file content in the specified byte range
19
+ *
20
+ * @example
21
+ * ```
22
+ * GET /file.parquet HTTP/1.1
23
+ * Range: bytes=0-1023
24
+ * ```
25
+ */
26
26
  type: 'bounded';
27
27
  /** Start byte position (inclusive) */
28
28
  start: number;
@@ -30,27 +30,27 @@ export type HttpRange = {
30
30
  end: number;
31
31
  } | {
32
32
  /**
33
- * Get byte range starting from the specified offset
34
- *
35
- * @example
36
- * ```
37
- * GET /file.parquet HTTP/1.1
38
- * Range: bytes=1024-
39
- * ```
40
- */
33
+ * Get byte range starting from the specified offset
34
+ *
35
+ * @example
36
+ * ```
37
+ * GET /file.parquet HTTP/1.1
38
+ * Range: bytes=1024-
39
+ * ```
40
+ */
41
41
  type: 'offset';
42
42
  /** Start byte position (inclusive) */
43
43
  offset: number;
44
44
  } | {
45
45
  /**
46
- * Get byte range starting from the specified suffix
47
- *
48
- * @example
49
- * ```
50
- * GET /file.parquet HTTP/1.1
51
- * Range: bytes=-1024
52
- * ```
53
- */
46
+ * Get byte range starting from the specified suffix
47
+ *
48
+ * @example
49
+ * ```
50
+ * GET /file.parquet HTTP/1.1
51
+ * Range: bytes=-1024
52
+ * ```
53
+ */
54
54
  type: 'suffix';
55
55
  /** End byte position (inclusive) */
56
56
  suffix: number;
@@ -60,9 +60,9 @@ export type HttpMethod = 'GET' | 'HEAD';
60
60
  /** HTTP response from object store */
61
61
  export type ObjectStoreResponse = {
62
62
  /**
63
- * Will be translated to 500 Internal Server Error by the handler
64
- * or 408 Request Timeout if the request was aborted
65
- */
63
+ * Will be translated to 500 Internal Server Error by the handler
64
+ * or 408 Request Timeout if the request was aborted
65
+ */
66
66
  type: 'InternalError';
67
67
  } | {
68
68
  /** Will be translated to 404 Not Found by the handler */
@@ -1 +1 @@
1
- {"version":3,"file":"http_helpers.d.ts","sourceRoot":"","sources":["../../../src/pframe/internal_api/http_helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,6BAA6B;AAC7B,eAAO,MAAM,gBAAgB,YAAsB,CAAC;AAEpD,wBAAwB;AACxB,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,MAAM,UAAU,EAAE,gCAAgC,CAAC,CAAC;AAE7F,MAAM,MAAM,SAAS,GAAG;IACtB,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,GAAG,EAAE,MAAM,CAAC;CACb,CAAA;AAED,2FAA2F;AAC3F,MAAM,MAAM,SAAS,GACjB;IACE;;;;;;;;OAQG;IACH,IAAI,EAAE,SAAS,CAAC;IAChB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helpers.ts"],"sourcesContent":["import type { Readable } from 'node:stream';\nimport type { RequestListener } from 'node:http';\nimport type { Branded, Base64Encoded } from '@milaboratories/pl-model-common';\nimport type { Logger } from './common';\n\n/** Parquet file extension */\nexport const ParquetExtension = '.parquet' as const;\n\n/** Parquet file name */\nexport type ParquetFileName = Branded<`${string}.parquet`, 'PFrameInternal.ParquetFileName'>;\n\nexport type FileRange = {\n /** Start byte position (inclusive) */\n start: number;\n /** End byte position (inclusive) */\n end: number;\n}\n\n/** HTTP range as of RFC 9110 <https://datatracker.ietf.org/doc/html/rfc9110#name-range> */\nexport type HttpRange =\n | {\n /**\n * Get file content in the specified byte range\n * \n * @example\n * ```\n * GET /file.parquet HTTP/1.1\n * Range: bytes=0-1023\n * ```\n */\n type: 'bounded';\n /** Start byte position (inclusive) */\n start: number;\n /** End byte position (inclusive) */\n end: number;\n }\n | {\n /**\n * Get byte range starting from the specified offset\n * \n * @example\n * ```\n * GET /file.parquet HTTP/1.1\n * Range: bytes=1024-\n * ```\n */\n type: 'offset';\n /** Start byte position (inclusive) */\n offset: number;\n }\n | {\n /**\n * Get byte range starting from the specified suffix\n * \n * @example\n * ```\n * GET /file.parquet HTTP/1.1\n * Range: bytes=-1024\n * ```\n */\n type: 'suffix';\n /** End byte position (inclusive) */\n suffix: number;\n };\n\n/** HTTP method passed to object store */\nexport type HttpMethod = 'GET' | 'HEAD';\n\n/** HTTP response from object store */\nexport type ObjectStoreResponse =\n | {\n /**\n * Will be translated to 500 Internal Server Error by the handler\n * or 408 Request Timeout if the request was aborted\n */\n type: 'InternalError';\n }\n | {\n /** Will be translated to 404 Not Found by the handler */\n type: 'NotFound';\n }\n | {\n /** Will be translated to 416 Range Not Satisfiable by the handler */\n type: 'RangeNotSatisfiable';\n /** Total file size in bytes */\n size: number;\n }\n | {\n /** Will be translated to 200 OK or 206 Partial Content by the handler */\n type: 'Ok';\n /** Total file size in bytes */\n size: number;\n /** File range translated from HTTP range */\n range: FileRange;\n /** Stream of file content, undefined for HEAD requests */\n data?: Readable;\n }\n\n/** Common options for object store creation */\nexport interface ObjectStoreOptions {\n /** Logger instance, no logging is performed when not provided */\n logger?: Logger;\n}\n\n/** Options for file system object store creation */\nexport interface FsStoreOptions extends ObjectStoreOptions {\n /** Local directory to serve files from */\n rootDir: string;\n}\n\nexport interface ObjectStore {\n /**\n * Proxy HTTP(S) request for parquet file to object store.\n * Callback promise resolves when stream is closed by handler @see HttpHelpers.createRequestHandler\n * Callback API is used so that ObjectStore can limit the number of concurrent requests.\n */\n request(\n filename: ParquetFileName,\n params: {\n method: HttpMethod;\n range?: HttpRange;\n signal: AbortSignal;\n callback: (response: ObjectStoreResponse) => Promise<void>;\n }\n ): void;\n}\n\n/** File system abstraction for request handler factory, @see HttpHelpers.createRequestHandler */\nexport abstract class BaseObjectStore implements ObjectStore {\n protected readonly logger: Logger;\n\n constructor(options: ObjectStoreOptions) {\n this.logger = options.logger ?? (() => {});\n }\n\n /** Translate HTTP range to file range, @returns null if the range is not satisfiable */\n protected translate(fileSize: number, range?: HttpRange): FileRange | null {\n if (!range) return { start: 0, end: fileSize - 1 };\n switch (range.type) {\n case 'bounded':\n if (range.end >= fileSize) return null;\n return { start: range.start, end: range.end };\n case 'offset':\n if (range.offset >= fileSize) return null;\n return { start: range.offset, end: fileSize - 1 };\n case 'suffix':\n if (range.suffix > fileSize) return null;\n return { start: fileSize - range.suffix, end: fileSize - 1 };\n }\n }\n\n /**\n * Proxy HTTP(S) request for parquet file to object store.\n * Callback promise resolves when stream is closed by handler @see HttpHelpers.createRequestHandler\n * Callback API is used so that ObjectStore can limit the number of concurrent requests.\n */\n abstract request(\n filename: ParquetFileName,\n params: {\n method: HttpMethod;\n range?: HttpRange;\n signal: AbortSignal;\n callback: (response: ObjectStoreResponse) => Promise<void>;\n }\n ): Promise<void>;\n}\n\n/** Object store base URL in format accepted by Apache DataFusion and DuckDB */\nexport type ObjectStoreUrl = Branded<string, 'PFrameInternal.ObjectStoreUrl'>;\n\n/** HTTP(S) request handler creation options */\nexport type RequestHandlerOptions = {\n /** Object store to serve files from, @see HttpHelpers.createFsStore */\n store: ObjectStore;\n /** Here will go caching options... */\n}\n\n/** Server configuration options */\nexport type HttpServerOptions = {\n /** HTTP(S) request handler function, @see HttpHelpers.createRequestHandler */\n handler: RequestListener;\n /** Port to bind to, @default 0 for auto-assignment */\n port?: number;\n /** Do not apply authorization middleware to @param handler */\n noAuth?: true;\n /** Downgrade default HTTPS server to plain HTTP, @warning use only for testing */\n noHttps?: true;\n};\n\n/**\n * Long unique opaque string for use in Bearer authorization header\n * \n * @example\n * ```ts\n * request.setHeader('Authorization', `Bearer ${authToken}`);\n * ```\n */\nexport type HttpAuthorizationToken = Branded<string, 'PFrameInternal.HttpAuthorizationToken'>;\n\n/**\n * TLS certificate in PEM format\n * \n * @example\n * ```txt\n * -----BEGIN CERTIFICATE-----\n * MIIC2zCCAcOgAwIBAgIJaVW7...\n * ...\n * ...Yf9CRK8fgnukKM7TJ\n * -----END CERTIFICATE-----\n * ```\n */\nexport type PemCertificate = Branded<string, 'PFrameInternal.PemCertificate'>;\n\n/** HTTP(S) server connection settings, {@link HttpHelpers.createHttpServer} */\nexport type HttpServerInfo = {\n /** URL of the HTTP(S) server formatted as `http{s}://<host>:<port>/` */\n url: ObjectStoreUrl;\n /** Authorization token for Bearer scheme, undefined when @see HttpServerOptions.noAuth flag is set */\n authToken?: HttpAuthorizationToken;\n /** Encoded CA certificate of HTTPS server, undefined when @see HttpServerOptions.noHttps flag is set */\n encodedCaCert?: Base64Encoded<PemCertificate>;\n};\n\n/** HTTP(S) server information and controls, @see HttpHelpers.createHttpServer */\nexport interface HttpServer {\n /** Server configuration information for initiating connections from clients */\n get info(): HttpServerInfo;\n /** Promise that resolves when the server is stopped */\n get stopped(): Promise<void>;\n /** Request server stop, returns the same promise as @see HttpServer.stopped */\n stop(): Promise<void>;\n}\n\n/** List of HTTP(S) related helper functions exposed by PFrame module */\nexport interface HttpHelpers {\n /**\n * Create an object store for serving files from a local directory.\n * Rejects if the provided path does not exist or is not a directory.\n */\n createFsStore(options: FsStoreOptions): Promise<ObjectStore>;\n\n /**\n * Create an HTTP request handler for serving files from an object store.\n * Accepts only paths of the form `/<filename>.parquet`, returns 410 otherwise.\n * Assumes that files are immutable (and sets cache headers accordingly).\n */\n createRequestHandler(options: RequestHandlerOptions): RequestListener;\n\n /**\n * Serve HTTP(S) requests using the provided handler on localhost port.\n * @returns promise that resolves when the server has stopped.\n *\n * @example\n * ```ts\n * const rootDir = '/path/to/directory/with/parquet/files';\n *\n * let store = await HttpHelpers.createFsStore({ rootDir }).catch((err: unknown) => {\n * throw new Error(`Failed to create file store for ${rootDir} - ${ensureError(err)}`);\n * });\n *\n * const server = await HttpHelpers.createHttpServer({\n * handler: HttpHelpers.createRequestHandler({ store }),\n * }).catch((err: unknown) => {\n * throw new Error(`Failed to start HTTPS server - ${ensureError(err)}`);\n * });\n *\n * const { url, authToken, encodedCaCert } = server.info;\n *\n * await server.stop();\n * ```\n */\n createHttpServer(options: HttpServerOptions): Promise<HttpServer>;\n}\n"],"names":[],"mappings":"AAKA;AACO,MAAM,gBAAgB,GAAG;AAyHhC;MACsB,eAAe,CAAA;AAChB,IAAA,MAAM;AAEzB,IAAA,WAAA,CAAY,OAA2B,EAAA;AACrC,QAAA,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,KAAK,MAAK,EAAE,CAAC,CAAC;IAC5C;;IAGU,SAAS,CAAC,QAAgB,EAAE,KAAiB,EAAA;AACrD,QAAA,IAAI,CAAC,KAAK;YAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,QAAQ,GAAG,CAAC,EAAE;AAClD,QAAA,QAAQ,KAAK,CAAC,IAAI;AAChB,YAAA,KAAK,SAAS;AACZ,gBAAA,IAAI,KAAK,CAAC,GAAG,IAAI,QAAQ;AAAE,oBAAA,OAAO,IAAI;AACtC,gBAAA,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE;AAC/C,YAAA,KAAK,QAAQ;AACX,gBAAA,IAAI,KAAK,CAAC,MAAM,IAAI,QAAQ;AAAE,oBAAA,OAAO,IAAI;AACzC,gBAAA,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,QAAQ,GAAG,CAAC,EAAE;AACnD,YAAA,KAAK,QAAQ;AACX,gBAAA,IAAI,KAAK,CAAC,MAAM,GAAG,QAAQ;AAAE,oBAAA,OAAO,IAAI;AACxC,gBAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,GAAG,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,QAAQ,GAAG,CAAC,EAAE;;IAElE;AAgBD;;;;"}
1
+ {"version":3,"file":"http_helpers.js","sources":["../../../src/pframe/internal_api/http_helpers.ts"],"sourcesContent":["import type { Readable } from 'node:stream';\nimport type { RequestListener } from 'node:http';\nimport type { Branded, Base64Encoded } from '@milaboratories/pl-model-common';\nimport type { Logger } from './common';\n\n/** Parquet file extension */\nexport const ParquetExtension = '.parquet' as const;\n\n/** Parquet file name */\nexport type ParquetFileName = Branded<`${string}.parquet`, 'PFrameInternal.ParquetFileName'>;\n\nexport type FileRange = {\n /** Start byte position (inclusive) */\n start: number;\n /** End byte position (inclusive) */\n end: number;\n};\n\n/** HTTP range as of RFC 9110 <https://datatracker.ietf.org/doc/html/rfc9110#name-range> */\nexport type HttpRange =\n | {\n /**\n * Get file content in the specified byte range\n *\n * @example\n * ```\n * GET /file.parquet HTTP/1.1\n * Range: bytes=0-1023\n * ```\n */\n type: 'bounded';\n /** Start byte position (inclusive) */\n start: number;\n /** End byte position (inclusive) */\n end: number;\n }\n | {\n /**\n * Get byte range starting from the specified offset\n *\n * @example\n * ```\n * GET /file.parquet HTTP/1.1\n * Range: bytes=1024-\n * ```\n */\n type: 'offset';\n /** Start byte position (inclusive) */\n offset: number;\n }\n | {\n /**\n * Get byte range starting from the specified suffix\n *\n * @example\n * ```\n * GET /file.parquet HTTP/1.1\n * Range: bytes=-1024\n * ```\n */\n type: 'suffix';\n /** End byte position (inclusive) */\n suffix: number;\n };\n\n/** HTTP method passed to object store */\nexport type HttpMethod = 'GET' | 'HEAD';\n\n/** HTTP response from object store */\nexport type ObjectStoreResponse =\n | {\n /**\n * Will be translated to 500 Internal Server Error by the handler\n * or 408 Request Timeout if the request was aborted\n */\n type: 'InternalError';\n }\n | {\n /** Will be translated to 404 Not Found by the handler */\n type: 'NotFound';\n }\n | {\n /** Will be translated to 416 Range Not Satisfiable by the handler */\n type: 'RangeNotSatisfiable';\n /** Total file size in bytes */\n size: number;\n }\n | {\n /** Will be translated to 200 OK or 206 Partial Content by the handler */\n type: 'Ok';\n /** Total file size in bytes */\n size: number;\n /** File range translated from HTTP range */\n range: FileRange;\n /** Stream of file content, undefined for HEAD requests */\n data?: Readable;\n };\n\n/** Common options for object store creation */\nexport interface ObjectStoreOptions {\n /** Logger instance, no logging is performed when not provided */\n logger?: Logger;\n}\n\n/** Options for file system object store creation */\nexport interface FsStoreOptions extends ObjectStoreOptions {\n /** Local directory to serve files from */\n rootDir: string;\n}\n\nexport interface ObjectStore {\n /**\n * Proxy HTTP(S) request for parquet file to object store.\n * Callback promise resolves when stream is closed by handler @see HttpHelpers.createRequestHandler\n * Callback API is used so that ObjectStore can limit the number of concurrent requests.\n */\n request(\n filename: ParquetFileName,\n params: {\n method: HttpMethod;\n range?: HttpRange;\n signal: AbortSignal;\n callback: (response: ObjectStoreResponse) => Promise<void>;\n }\n ): void;\n}\n\n/** File system abstraction for request handler factory, @see HttpHelpers.createRequestHandler */\nexport abstract class BaseObjectStore implements ObjectStore {\n protected readonly logger: Logger;\n\n constructor(options: ObjectStoreOptions) {\n this.logger = options.logger ?? (() => {});\n }\n\n /** Translate HTTP range to file range, @returns null if the range is not satisfiable */\n protected translate(fileSize: number, range?: HttpRange): FileRange | null {\n if (!range) return { start: 0, end: fileSize - 1 };\n switch (range.type) {\n case 'bounded':\n if (range.end >= fileSize) return null;\n return { start: range.start, end: range.end };\n case 'offset':\n if (range.offset >= fileSize) return null;\n return { start: range.offset, end: fileSize - 1 };\n case 'suffix':\n if (range.suffix > fileSize) return null;\n return { start: fileSize - range.suffix, end: fileSize - 1 };\n }\n }\n\n /**\n * Proxy HTTP(S) request for parquet file to object store.\n * Callback promise resolves when stream is closed by handler @see HttpHelpers.createRequestHandler\n * Callback API is used so that ObjectStore can limit the number of concurrent requests.\n */\n abstract request(\n filename: ParquetFileName,\n params: {\n method: HttpMethod;\n range?: HttpRange;\n signal: AbortSignal;\n callback: (response: ObjectStoreResponse) => Promise<void>;\n }\n ): Promise<void>;\n}\n\n/** Object store base URL in format accepted by Apache DataFusion and DuckDB */\nexport type ObjectStoreUrl = Branded<string, 'PFrameInternal.ObjectStoreUrl'>;\n\n/** HTTP(S) request handler creation options */\nexport type RequestHandlerOptions = {\n /** Object store to serve files from, @see HttpHelpers.createFsStore */\n store: ObjectStore;\n /** Here will go caching options... */\n};\n\n/** Server configuration options */\nexport type HttpServerOptions = {\n /** HTTP(S) request handler function, @see HttpHelpers.createRequestHandler */\n handler: RequestListener;\n /** Port to bind to, @default 0 for auto-assignment */\n port?: number;\n /** Do not apply authorization middleware to @param handler */\n noAuth?: true;\n /** Downgrade default HTTPS server to plain HTTP, @warning use only for testing */\n noHttps?: true;\n};\n\n/**\n * Long unique opaque string for use in Bearer authorization header\n *\n * @example\n * ```ts\n * request.setHeader('Authorization', `Bearer ${authToken}`);\n * ```\n */\nexport type HttpAuthorizationToken = Branded<string, 'PFrameInternal.HttpAuthorizationToken'>;\n\n/**\n * TLS certificate in PEM format\n *\n * @example\n * ```txt\n * -----BEGIN CERTIFICATE-----\n * MIIC2zCCAcOgAwIBAgIJaVW7...\n * ...\n * ...Yf9CRK8fgnukKM7TJ\n * -----END CERTIFICATE-----\n * ```\n */\nexport type PemCertificate = Branded<string, 'PFrameInternal.PemCertificate'>;\n\n/** HTTP(S) server connection settings, {@link HttpHelpers.createHttpServer} */\nexport type HttpServerInfo = {\n /** URL of the HTTP(S) server formatted as `http{s}://<host>:<port>/` */\n url: ObjectStoreUrl;\n /** Authorization token for Bearer scheme, undefined when @see HttpServerOptions.noAuth flag is set */\n authToken?: HttpAuthorizationToken;\n /** Encoded CA certificate of HTTPS server, undefined when @see HttpServerOptions.noHttps flag is set */\n encodedCaCert?: Base64Encoded<PemCertificate>;\n};\n\n/** HTTP(S) server information and controls, @see HttpHelpers.createHttpServer */\nexport interface HttpServer {\n /** Server configuration information for initiating connections from clients */\n get info(): HttpServerInfo;\n /** Promise that resolves when the server is stopped */\n get stopped(): Promise<void>;\n /** Request server stop, returns the same promise as @see HttpServer.stopped */\n stop(): Promise<void>;\n}\n\n/** List of HTTP(S) related helper functions exposed by PFrame module */\nexport interface HttpHelpers {\n /**\n * Create an object store for serving files from a local directory.\n * Rejects if the provided path does not exist or is not a directory.\n */\n createFsStore(options: FsStoreOptions): Promise<ObjectStore>;\n\n /**\n * Create an HTTP request handler for serving files from an object store.\n * Accepts only paths of the form `/<filename>.parquet`, returns 410 otherwise.\n * Assumes that files are immutable (and sets cache headers accordingly).\n */\n createRequestHandler(options: RequestHandlerOptions): RequestListener;\n\n /**\n * Serve HTTP(S) requests using the provided handler on localhost port.\n * @returns promise that resolves when the server has stopped.\n *\n * @example\n * ```ts\n * const rootDir = '/path/to/directory/with/parquet/files';\n *\n * let store = await HttpHelpers.createFsStore({ rootDir }).catch((err: unknown) => {\n * throw new Error(`Failed to create file store for ${rootDir} - ${ensureError(err)}`);\n * });\n *\n * const server = await HttpHelpers.createHttpServer({\n * handler: HttpHelpers.createRequestHandler({ store }),\n * }).catch((err: unknown) => {\n * throw new Error(`Failed to start HTTPS server - ${ensureError(err)}`);\n * });\n *\n * const { url, authToken, encodedCaCert } = server.info;\n *\n * await server.stop();\n * ```\n */\n createHttpServer(options: HttpServerOptions): Promise<HttpServer>;\n}\n"],"names":[],"mappings":"AAKA;AACO,MAAM,gBAAgB,GAAG;AAyHhC;MACsB,eAAe,CAAA;AAChB,IAAA,MAAM;AAEzB,IAAA,WAAA,CAAY,OAA2B,EAAA;AACrC,QAAA,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,KAAK,MAAK,EAAE,CAAC,CAAC;IAC5C;;IAGU,SAAS,CAAC,QAAgB,EAAE,KAAiB,EAAA;AACrD,QAAA,IAAI,CAAC,KAAK;YAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,QAAQ,GAAG,CAAC,EAAE;AAClD,QAAA,QAAQ,KAAK,CAAC,IAAI;AAChB,YAAA,KAAK,SAAS;AACZ,gBAAA,IAAI,KAAK,CAAC,GAAG,IAAI,QAAQ;AAAE,oBAAA,OAAO,IAAI;AACtC,gBAAA,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE;AAC/C,YAAA,KAAK,QAAQ;AACX,gBAAA,IAAI,KAAK,CAAC,MAAM,IAAI,QAAQ;AAAE,oBAAA,OAAO,IAAI;AACzC,gBAAA,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,QAAQ,GAAG,CAAC,EAAE;AACnD,YAAA,KAAK,QAAQ;AACX,gBAAA,IAAI,KAAK,CAAC,MAAM,GAAG,QAAQ;AAAE,oBAAA,OAAO,IAAI;AACxC,gBAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,GAAG,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,QAAQ,GAAG,CAAC,EAAE;;IAElE;AAgBD;;;;"}
@@ -1,21 +1,24 @@
1
1
  import type { PFrameFactoryAPIV4 } from './api_factory';
2
- import type { PFrameReadAPIV10 } from './api_read';
2
+ import type { PFrameReadAPIV11 } from './api_read';
3
3
  import type { Logger } from './common';
4
- export interface PFrameV12 extends PFrameFactoryAPIV4, PFrameReadAPIV10 {
4
+ import type { PFrameId } from './common';
5
+ export interface PFrameV13 extends PFrameFactoryAPIV4, PFrameReadAPIV11 {
5
6
  }
6
- export type PFrameOptions = {
7
+ export type PFrameOptionsV2 = {
8
+ /** PFrame ID for logging purposes */
9
+ frameId: PFrameId;
7
10
  /** Path to directory where PFrame can create temporary files */
8
11
  spillPath: string;
9
12
  /** Logger instance, no logging is performed when not provided */
10
13
  logger?: Logger;
11
14
  };
12
15
  /** List of PFrame management functions exposed by PFrame module */
13
- export interface PFrameFactoryV3 {
16
+ export interface PFrameFactoryV4 {
14
17
  /**
15
18
  * Create a new PFrame instance.
16
19
  * @warning Use concurrency limiting to avoid OOM crashes when multiple instances are simultaneously in use.
17
20
  */
18
- createPFrame(options: PFrameOptions): PFrameV12;
21
+ createPFrame(options: PFrameOptionsV2): PFrameV13;
19
22
  /**
20
23
  * Dump active allocations from all PFrames instances in pprof format.
21
24
  * The result of this function should be saved as `profile.pb.gz`.
@@ -1 +1 @@
1
- {"version":3,"file":"pframe.d.ts","sourceRoot":"","sources":["../../../src/pframe/internal_api/pframe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,WAAW,SAAU,SAAQ,kBAAkB,EAAE,gBAAgB;CAAG;AAE1E,MAAM,MAAM,aAAa,GAAG;IAC1B,gEAAgE;IAChE,SAAS,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAA;AAED,mEAAmE;AACnE,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,SAAS,CAAC;IAEhD;;;;;;OAMG;IACH,SAAS,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;CACtC"}
1
+ {"version":3,"file":"pframe.d.ts","sourceRoot":"","sources":["../../../src/pframe/internal_api/pframe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,WAAW,SAAU,SAAQ,kBAAkB,EAAE,gBAAgB;CAAG;AAE1E,MAAM,MAAM,eAAe,GAAG;IAC5B,qCAAqC;IACrC,OAAO,EAAE,QAAQ,CAAC;IAClB,gEAAgE;IAChE,SAAS,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,mEAAmE;AACnE,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,YAAY,CAAC,OAAO,EAAE,eAAe,GAAG,SAAS,CAAC;IAElD;;;;;;OAMG;IACH,SAAS,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;CACtC"}
@@ -1,11 +1,12 @@
1
- import { PTableColumnId, PTableColumnSpec, PTableRecordFilter, PTableShape, PTableSorting, PTableVector, TableRange } from '@milaboratories/pl-model-common';
1
+ import type { PTableColumnId, PTableColumnSpec, PTableRecordFilter, PTableShape, PTableSorting, PTableVector, TableRange } from '@milaboratories/pl-model-common';
2
+ import type { PTableId } from './common';
2
3
  /**
3
4
  * Table view returned as a result of create table operation.
4
5
  *
5
6
  * PTable can be thought as having a composite primary key, consisting of axes,
6
7
  * and a set of data columns derived from PColumn values.
7
8
  * */
8
- export interface PTableV7 extends Disposable {
9
+ export interface PTableV8 extends Disposable {
9
10
  /**
10
11
  * Returns ordered array of table axes specs (primary key "columns" in SQL
11
12
  * terms) and data column specs (regular "columns" in SQL terms).
@@ -23,7 +24,6 @@ export interface PTableV7 extends Disposable {
23
24
  * Warning: This call materializes the join.
24
25
  */
25
26
  getFootprint(ops?: {
26
- withPredecessors?: boolean;
27
27
  signal?: AbortSignal;
28
28
  }): Promise<number>;
29
29
  /**
@@ -47,9 +47,9 @@ export interface PTableV7 extends Disposable {
47
47
  signal?: AbortSignal;
48
48
  }): Promise<PTableVector[]>;
49
49
  /** Filters the table and returns new PTable instance */
50
- filter(request: PTableRecordFilter[]): PTableV7;
50
+ filter(tableId: PTableId, request: PTableRecordFilter[]): PTableV8;
51
51
  /** Sorts the table and returns new PTable instance. */
52
- sort(request: PTableSorting[]): PTableV7;
52
+ sort(tableId: PTableId, request: PTableSorting[]): PTableV8;
53
53
  /** Deallocates all underlying resources */
54
54
  dispose(): void;
55
55
  }
@@ -1 +1 @@
1
- {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/pframe/internal_api/table.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,YAAY,EACZ,UAAU,EACX,MAAM,iCAAiC,CAAC;AAEzC;;;;;KAKK;AACL,MAAM,WAAW,QAAS,SAAQ,UAAU;IAC1C;;;;;;;;SAQK;IACL,OAAO,IAAI,gBAAgB,EAAE,CAAC;IAE9B,6EAA6E;IAC7E,gBAAgB,CAAC,SAAS,EAAE,cAAc,EAAE,GAAG,MAAM,EAAE,CAAC;IAExD;;;OAGG;IACH,YAAY,CAAC,GAAG,CAAC,EAAE;QACjB,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,MAAM,CAAC,EAAE,WAAW,CAAC;KACtB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEpB;;;OAGG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE;QACb,MAAM,CAAC,EAAE,WAAW,CAAC;KACtB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEzB;;;;;;;;SAQK;IACL,OAAO,CACL,aAAa,EAAE,MAAM,EAAE,EACvB,GAAG,CAAC,EAAE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Y,EAAE,CAAC,CAAC;IAE3B,wDAAwD;IACxD,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,kBAAkB,EAAE,GAAG,QAAQ,CAAC;IAEnE,uDAAuD;IACvD,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,QAAQ,CAAC;IAE5D,2CAA2C;IAC3C,OAAO,IAAI,IAAI,CAAC;CACjB"}
@@ -1,4 +1,4 @@
1
- import { ProjectMeta } from './project';
1
+ import type { ProjectMeta } from './project';
2
2
  /** Represents single entry in the list of projects owned by current user */
3
3
  export interface ProjectListEntry {
4
4
  /** Project resource ID. */
@@ -1 +1 @@
1
- {"version":3,"file":"project_list.d.ts","sourceRoot":"","sources":["../src/project_list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,4EAA4E;AAC5E,MAAM,WAAW,gBAAgB;IAC/B,2BAA2B;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,0CAA0C;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,0BAA0B;IAC1B,OAAO,EAAE,IAAI,CAAC;IACd,mCAAmC;IACnC,YAAY,EAAE,IAAI,CAAC;IACnB,gCAAgC;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,iCAAiC;IACjC,IAAI,EAAE,WAAW,CAAC;CACnB"}
1
+ {"version":3,"file":"project_list.d.ts","sourceRoot":"","sources":["../src/project_list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,4EAA4E;AAC5E,MAAM,WAAW,gBAAgB;IAC/B,2BAA2B;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,0CAA0C;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,0BAA0B;IAC1B,OAAO,EAAE,IAAI,CAAC;IACd,mCAAmC;IACnC,YAAY,EAAE,IAAI,CAAC;IACnB,gCAAgC;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,iCAAiC;IACjC,IAAI,EAAE,WAAW,CAAC;CACnB"}
@@ -1,8 +1,8 @@
1
- import { ProjectMeta } from './project';
2
- import { BlockPackSpec } from './block_registry/block_pack_spec';
3
- import { BlockCodeFeatureFlags, BlockRenderingMode, BlockSection, NavigationState, AuthorMarker } from '@milaboratories/pl-model-common';
4
- import { UpdateSuggestions } from './update_info';
5
- import { BlockSettings } from './block_settings';
1
+ import type { ProjectMeta } from './project';
2
+ import type { BlockPackSpec } from './block_registry/block_pack_spec';
3
+ import type { BlockCodeFeatureFlags, BlockRenderingMode, BlockSection, NavigationState, AuthorMarker } from '@milaboratories/pl-model-common';
4
+ import type { UpdateSuggestions } from './update_info';
5
+ import type { BlockSettings } from './block_settings';
6
6
  /** Generalized block status, to be used in block item "styling". */
7
7
  export type BlockCalculationStatus = 'NotCalculated' | 'Running' | 'Done' | 'Limbo';
8
8
  /** Overview of the whole project state, required to render a left panel. */
@@ -1 +1 @@
1
- {"version":3,"file":"project_overview.d.ts","sourceRoot":"","sources":["../src/project_overview.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACzI,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,oEAAoE;AACpE,MAAM,MAAM,sBAAsB,GAAG,eAAe,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAEpF,4EAA4E;AAC5E,MAAM,MAAM,eAAe,GAAG;IAC5B,+DAA+D;IAC/D,IAAI,EAAE,WAAW,CAAC;IAElB,0BAA0B;IAC1B,OAAO,EAAE,IAAI,C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AAM,GAAG,SAAS,CAAC;IAE1B;;;OAGG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1B,2BAA2B;IAC3B,aAAa,EAAE,kBAAkB,CAAC;IAElC;;;SAGK;IACL,gBAAgB,EAAE,OAAO,CAAC;IAE1B;;;;;SAKK;IACL,KAAK,EAAE,OAAO,CAAC;IAEf;;;SAGK;IACL,YAAY,EAAE,OAAO,CAAC;IAEtB;;;SAGK;IACL,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;SAGK;IACL,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,2CAA2C;IAC3C,iBAAiB,EAAE,sBAAsB,CAAC;IAE1C;;;SAGK;IACL,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpB;;;SAGK;IACL,WAAW,EAAE,MAAM,EAAE,CAAC;IAEtB;;;SAGK;IACL,QAAQ,EAAE,YAAY,EAAE,GAAG,SAAS,CAAC;IAErC;;;SAGK;IACL,WAAW,EAAE,OAAO,GAAG,SAAS,CAAC;IAEjC;;;SAGK;IACL,MAAM,EAAE,OAAO,CAAC;IAEhB;;;SAGK;IACL,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAE/B;;;SAGK;IACL,YAAY,EAAE,qBAAqB,GAAG,SAAS,CAAC;IAEhD;;;;;SAKK;IACL,yBAAyB,EAAE,OAAO,GAAG,SAAS,CAAC;IAE/C,mEAAmE;IACnE,gBAAgB,EAAE,aAAa,GAAG,SAAS,CAAC;IAE5C;;;SAGK;IACL,gBAAgB,EAAE,aAAa,GAAG,SAAS,CAAC;IAE5C,6BAA6B;IAC7B,QAAQ,EAAE,aAAa,CAAC;IAExB,8BAA8B;IAC9B,iBAAiB,EAAE,iBAAiB,CAAC;IAErC,4CAA4C;IAC5C,eAAe,EAAE,eAAe,CAAC;CAClC,CAAC"}
@@ -1,4 +1,4 @@
1
- import { BlockPackSpec } from './block_registry';
1
+ import type { BlockPackSpec } from './block_registry';
2
2
  /** Communicates possible block update option */
3
3
  export type UpdateSuggestion<V = BlockPackSpec> = {
4
4
  type: 'major' | 'minor' | 'patch';
@@ -1 +1 @@
1
- {"version":3,"file":"update_info.d.ts","sourceRoot":"","sources":["../src/update_info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,gDAAgD;AAChD,MAAM,MAAM,gBAAgB,CAAC,CAAC,GAAG,aAAa,IAAI;IAChD,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;IAClC,MAAM,EAAE,CAAC,CAAC;CACX,CAAC;AAEF,iDAAiD;AACjD,MAAM,MAAM,iBAAiB,CAAC,CAAC,GAAG,aAAa,IAAI,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC"}
1
+ {"version":3,"file":"update_info.d.ts","sourceRoot":"","sources":["../src/update_info.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,gDAAgD;AAChD,MAAM,MAAM,gBAAgB,CAAC,CAAC,GAAG,aAAa,IAAI;IAChD,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;IAClC,MAAM,EAAE,CAAC,CAAC;CACX,CAAC;AAEF,iDAAiD;AACjD,MAAM,MAAM,iBAAiB,CAAC,CAAC,GAAG,aAAa,IAAI,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC"}