@lakeql/response-transformer 0.1.0 → 0.1.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.
- package/README.md +17 -0
- package/dist/index.d.mts +11 -5
- package/package.json +9 -1
package/README.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# @lakeql/response-transformer
|
|
2
|
+
|
|
3
|
+
Transforms raw Trino query responses into typed objects based on JSON Schema definitions, with support for date conversion and field renaming.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @lakeql/response-transformer
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Documentation
|
|
12
|
+
|
|
13
|
+
See the [LakeQL Documentation](https://lakeql.dev/docs) for detailed usage instructions.
|
|
14
|
+
|
|
15
|
+
## License
|
|
16
|
+
|
|
17
|
+
[Apache-2.0](../../LICENSE)
|
package/dist/index.d.mts
CHANGED
|
@@ -150,6 +150,15 @@ declare const transformObject: ({
|
|
|
150
150
|
transformFields,
|
|
151
151
|
dateFields
|
|
152
152
|
}: TransformInput) => Record<string, unknown>;
|
|
153
|
+
/**
|
|
154
|
+
* Parameters for convertTrinoResponse.
|
|
155
|
+
*/
|
|
156
|
+
interface ConvertTrinoResponseProps {
|
|
157
|
+
/** The field names to use as object keys. */
|
|
158
|
+
keys: string[];
|
|
159
|
+
/** The positional values from the Trino response row. */
|
|
160
|
+
values: unknown[];
|
|
161
|
+
}
|
|
153
162
|
/**
|
|
154
163
|
* Converts the trino response element ( array of unknown ) to an object
|
|
155
164
|
* based on the given keys. This function expects that
|
|
@@ -168,9 +177,6 @@ declare const transformObject: ({
|
|
|
168
177
|
declare function convertTrinoResponse<T = Record<string, unknown>>({
|
|
169
178
|
keys,
|
|
170
179
|
values
|
|
171
|
-
}:
|
|
172
|
-
keys: string[];
|
|
173
|
-
values: unknown[];
|
|
174
|
-
}): T;
|
|
180
|
+
}: ConvertTrinoResponseProps): T;
|
|
175
181
|
//#endregion
|
|
176
|
-
export { TransformArrayInput, TransformInput, convertTrinoResponse, transform, transformArray, transformObject };
|
|
182
|
+
export { ConvertTrinoResponseProps, TransformArrayInput, TransformInput, convertTrinoResponse, transform, transformArray, transformObject };
|
package/package.json
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lakeql/response-transformer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Transforms Trino array responses into typed JavaScript objects",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"lakeql",
|
|
7
|
+
"mapping",
|
|
8
|
+
"response",
|
|
9
|
+
"transform",
|
|
10
|
+
"trino"
|
|
11
|
+
],
|
|
4
12
|
"homepage": "https://lakeql.dev",
|
|
5
13
|
"license": "Apache-2.0",
|
|
6
14
|
"author": {
|