@query-farm/vgi-rpc 0.2.4 → 0.3.2

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 (75) hide show
  1. package/README.md +3 -3
  2. package/dist/client/connect.d.ts.map +1 -1
  3. package/dist/client/index.d.ts +3 -3
  4. package/dist/client/index.d.ts.map +1 -1
  5. package/dist/client/introspect.d.ts +1 -1
  6. package/dist/client/introspect.d.ts.map +1 -1
  7. package/dist/client/ipc.d.ts +1 -1
  8. package/dist/client/ipc.d.ts.map +1 -1
  9. package/dist/client/pipe.d.ts +2 -2
  10. package/dist/client/pipe.d.ts.map +1 -1
  11. package/dist/client/stream.d.ts +1 -1
  12. package/dist/client/stream.d.ts.map +1 -1
  13. package/dist/dispatch/describe.d.ts +1 -1
  14. package/dist/dispatch/describe.d.ts.map +1 -1
  15. package/dist/dispatch/stream.d.ts +1 -1
  16. package/dist/dispatch/stream.d.ts.map +1 -1
  17. package/dist/dispatch/unary.d.ts.map +1 -1
  18. package/dist/http/common.d.ts +1 -1
  19. package/dist/http/common.d.ts.map +1 -1
  20. package/dist/http/dispatch.d.ts.map +1 -1
  21. package/dist/http/handler.d.ts.map +1 -1
  22. package/dist/http/index.d.ts +3 -1
  23. package/dist/http/index.d.ts.map +1 -1
  24. package/dist/http/token.d.ts.map +1 -1
  25. package/dist/http/types.d.ts.map +1 -1
  26. package/dist/index.d.ts +7 -7
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +2162 -2119
  29. package/dist/index.js.map +26 -26
  30. package/dist/protocol.d.ts +1 -1
  31. package/dist/protocol.d.ts.map +1 -1
  32. package/dist/schema.d.ts +1 -1
  33. package/dist/schema.d.ts.map +1 -1
  34. package/dist/server.d.ts +1 -1
  35. package/dist/server.d.ts.map +1 -1
  36. package/dist/types.d.ts +1 -1
  37. package/dist/types.d.ts.map +1 -1
  38. package/dist/util/schema.d.ts +1 -1
  39. package/dist/util/schema.d.ts.map +1 -1
  40. package/dist/util/zstd.d.ts.map +1 -1
  41. package/dist/wire/reader.d.ts +1 -1
  42. package/dist/wire/reader.d.ts.map +1 -1
  43. package/dist/wire/request.d.ts +1 -1
  44. package/dist/wire/request.d.ts.map +1 -1
  45. package/dist/wire/response.d.ts +1 -1
  46. package/dist/wire/response.d.ts.map +1 -1
  47. package/dist/wire/writer.d.ts +1 -1
  48. package/dist/wire/writer.d.ts.map +1 -1
  49. package/package.json +9 -5
  50. package/src/client/connect.ts +12 -20
  51. package/src/client/index.ts +8 -8
  52. package/src/client/introspect.ts +11 -15
  53. package/src/client/ipc.ts +18 -32
  54. package/src/client/pipe.ts +17 -37
  55. package/src/client/stream.ts +20 -46
  56. package/src/dispatch/describe.ts +15 -27
  57. package/src/dispatch/stream.ts +7 -21
  58. package/src/dispatch/unary.ts +1 -2
  59. package/src/http/common.ts +9 -19
  60. package/src/http/dispatch.ts +115 -110
  61. package/src/http/handler.ts +20 -55
  62. package/src/http/index.ts +3 -1
  63. package/src/http/token.ts +2 -7
  64. package/src/http/types.ts +2 -6
  65. package/src/index.ts +44 -41
  66. package/src/protocol.ts +8 -8
  67. package/src/schema.ts +12 -16
  68. package/src/server.ts +16 -36
  69. package/src/types.ts +9 -36
  70. package/src/util/schema.ts +1 -1
  71. package/src/util/zstd.ts +2 -8
  72. package/src/wire/reader.ts +2 -4
  73. package/src/wire/request.ts +4 -15
  74. package/src/wire/response.ts +9 -25
  75. package/src/wire/writer.ts +1 -5
@@ -2,22 +2,16 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import {
5
- RecordBatch,
6
- Schema,
7
- Field,
8
5
  Data,
9
6
  DataType,
7
+ type Field,
10
8
  makeData,
9
+ RecordBatch,
10
+ type Schema,
11
11
  Struct,
12
12
  vectorFromArray,
13
- } from "apache-arrow";
14
- import {
15
- LOG_LEVEL_KEY,
16
- LOG_MESSAGE_KEY,
17
- LOG_EXTRA_KEY,
18
- SERVER_ID_KEY,
19
- REQUEST_ID_KEY,
20
- } from "../constants.js";
13
+ } from "@query-farm/apache-arrow";
14
+ import { LOG_EXTRA_KEY, LOG_LEVEL_KEY, LOG_MESSAGE_KEY, REQUEST_ID_KEY, SERVER_ID_KEY } from "../constants.js";
21
15
 
22
16
  /**
23
17
  * Coerce values for Int64 schema fields from Number to BigInt.
@@ -63,16 +57,14 @@ export function buildResultBatch(
63
57
  for (const field of schema.fields) {
64
58
  if (values[field.name] === undefined && !field.nullable) {
65
59
  const got = Object.keys(values);
66
- throw new TypeError(
67
- `Handler result missing required field '${field.name}'. Got keys: [${got.join(", ")}]`,
68
- );
60
+ throw new TypeError(`Handler result missing required field '${field.name}'. Got keys: [${got.join(", ")}]`);
69
61
  }
70
62
  }
71
63
 
72
64
  const coerced = coerceInt64(schema, values);
73
65
 
74
66
  const children = schema.fields.map((f: Field) => {
75
- let val = coerced[f.name];
67
+ const val = coerced[f.name];
76
68
  // Raw Data passthrough for Map_ types (whose .get() is broken in arrow-js)
77
69
  if (val instanceof Data) {
78
70
  return val;
@@ -95,12 +87,7 @@ export function buildResultBatch(
95
87
  /**
96
88
  * Build a 0-row error batch with EXCEPTION metadata matching Python's Message.from_exception().
97
89
  */
98
- export function buildErrorBatch(
99
- schema: Schema,
100
- error: Error,
101
- serverId: string,
102
- requestId: string | null,
103
- ): RecordBatch {
90
+ export function buildErrorBatch(schema: Schema, error: Error, serverId: string, requestId: string | null): RecordBatch {
104
91
  const metadata = new Map<string, string>();
105
92
  metadata.set(LOG_LEVEL_KEY, "EXCEPTION");
106
93
  metadata.set(LOG_MESSAGE_KEY, `${error.constructor.name}: ${error.message}`);
@@ -150,10 +137,7 @@ export function buildLogBatch(
150
137
  * Build a 0-row batch from a schema with metadata.
151
138
  * Used for error/log batches.
152
139
  */
153
- export function buildEmptyBatch(
154
- schema: Schema,
155
- metadata?: Map<string, string>,
156
- ): RecordBatch {
140
+ export function buildEmptyBatch(schema: Schema, metadata?: Map<string, string>): RecordBatch {
157
141
  const children = schema.fields.map((f: Field) => {
158
142
  return makeData({ type: f.type, length: 0, nullCount: 0 });
159
143
  });
@@ -1,12 +1,8 @@
1
1
  // © Copyright 2025-2026, Query.Farm LLC - https://query.farm
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import {
5
- RecordBatchStreamWriter,
6
- type RecordBatch,
7
- type Schema,
8
- } from "apache-arrow";
9
4
  import { writeSync } from "node:fs";
5
+ import { type RecordBatch, RecordBatchStreamWriter, type Schema } from "@query-farm/apache-arrow";
10
6
 
11
7
  const STDOUT_FD = 1;
12
8