@narrative.io/data-collaboration-sdk-ts 2.12.0 → 2.14.0
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/build/datasets/types.d.ts +11 -3
- package/build/nql/index.d.ts +4 -4
- package/build/nql/index.js +8 -8
- package/build/nql/types.d.ts +4 -1
- package/build/nql/types.js +1 -0
- package/package.json +7 -7
|
@@ -73,7 +73,6 @@ export interface DatasetTableSummaryAPIResponse {
|
|
|
73
73
|
dataset_id: number;
|
|
74
74
|
records: DatasetTableSummary[];
|
|
75
75
|
}
|
|
76
|
-
export type SchemaFileConfigType = "flat" | "json" | "parquet";
|
|
77
76
|
export type SchemaPropertiesType = "string" | "boolean" | "double" | "long" | "timestamptz" | "object" | "array";
|
|
78
77
|
export type DatasetStatus = "active" | "archived" | "pending";
|
|
79
78
|
export type DatasetWriteMode = "append" | "overwrite";
|
|
@@ -96,13 +95,22 @@ export type RetentionPolicy = {
|
|
|
96
95
|
period: string;
|
|
97
96
|
};
|
|
98
97
|
};
|
|
99
|
-
export
|
|
100
|
-
|
|
98
|
+
export type SchemaFileConfigType = "flat" | "json" | "parquet";
|
|
99
|
+
export interface FlatFileConfig {
|
|
100
|
+
type: "flat";
|
|
101
101
|
delimiter?: string;
|
|
102
102
|
escape?: string;
|
|
103
103
|
header?: boolean;
|
|
104
104
|
quote?: string;
|
|
105
105
|
}
|
|
106
|
+
export interface JsonFileConfig {
|
|
107
|
+
type: "json";
|
|
108
|
+
normalize_field_names?: boolean;
|
|
109
|
+
}
|
|
110
|
+
export interface ParquetFileConfig {
|
|
111
|
+
type: "parquet";
|
|
112
|
+
}
|
|
113
|
+
export type SchemaFileConfig = FlatFileConfig | JsonFileConfig | ParquetFileConfig;
|
|
106
114
|
export type SchemaProperties = Record<string, SchemaProperty>;
|
|
107
115
|
export type SchemaProperty = SchemaPrimitiveProperty | SchemaArrayProperty | SchemaObjectProperty;
|
|
108
116
|
export interface SchemaPrimitiveProperty {
|
package/build/nql/index.d.ts
CHANGED
|
@@ -12,21 +12,21 @@ declare class NqlApi extends BaseApi {
|
|
|
12
12
|
* @param {string} nqlQuery - The NQL query to execute.
|
|
13
13
|
* @returns {Promise<NqlResult>} A promise that resolves with the result of the NQL query.
|
|
14
14
|
*/
|
|
15
|
-
executeNql(
|
|
15
|
+
executeNql(payload: NqlQueryInput): Promise<NqlResult>;
|
|
16
16
|
/**
|
|
17
17
|
* Compiles an NQL query and returns the result, including any errors.
|
|
18
18
|
*
|
|
19
19
|
* @param {string} nqlQuery - The NQL query to compile.
|
|
20
20
|
* @returns {Promise<NqlCompileResult>} A promise that resolves with the result of the NQL compilation.
|
|
21
21
|
*/
|
|
22
|
-
compileNql(
|
|
22
|
+
compileNql(payload: NqlQueryInput): Promise<NqlCompileResult>;
|
|
23
23
|
/**
|
|
24
24
|
* Compiles an NQL query and returns the result, including any errors.
|
|
25
25
|
*
|
|
26
26
|
* @param {string} nqlQuery - The NQL query to compile.
|
|
27
27
|
* @returns {Promise<NqlCompileResult>} A promise that resolves with the result of the NQL compilation.
|
|
28
28
|
*/
|
|
29
|
-
parseNql(
|
|
29
|
+
parseNql(payload: NqlQueryInput): Promise<NqlAst>;
|
|
30
30
|
/**
|
|
31
31
|
* Validates an NQL query and returns an abstract syntax tree (AST) representing a structured form of
|
|
32
32
|
* the query.
|
|
@@ -34,7 +34,7 @@ declare class NqlApi extends BaseApi {
|
|
|
34
34
|
* @param {string} nqlQuery - The NQL query to validate.
|
|
35
35
|
* @returns {Promise<NqlCompileResult>} A promise that resolves with the result of the NQL validation.
|
|
36
36
|
*/
|
|
37
|
-
validateNql(
|
|
37
|
+
validateNql(payload: NqlQueryInput): Promise<NqlAst>;
|
|
38
38
|
/**
|
|
39
39
|
* Gets an existing NQL query by it's id
|
|
40
40
|
*
|
package/build/nql/index.js
CHANGED
|
@@ -18,8 +18,8 @@ class NqlApi extends BaseApi {
|
|
|
18
18
|
* @param {string} nqlQuery - The NQL query to execute.
|
|
19
19
|
* @returns {Promise<NqlResult>} A promise that resolves with the result of the NQL query.
|
|
20
20
|
*/
|
|
21
|
-
async executeNql(
|
|
22
|
-
const response = await this.post(`${resourceName}/run`,
|
|
21
|
+
async executeNql(payload) {
|
|
22
|
+
const response = await this.post(`${resourceName}/run`, payload);
|
|
23
23
|
return response;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
@@ -28,8 +28,8 @@ class NqlApi extends BaseApi {
|
|
|
28
28
|
* @param {string} nqlQuery - The NQL query to compile.
|
|
29
29
|
* @returns {Promise<NqlCompileResult>} A promise that resolves with the result of the NQL compilation.
|
|
30
30
|
*/
|
|
31
|
-
async compileNql(
|
|
32
|
-
const response = await this.post(`${resourceName}/compile`,
|
|
31
|
+
async compileNql(payload) {
|
|
32
|
+
const response = await this.post(`${resourceName}/compile`, payload);
|
|
33
33
|
return response;
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
@@ -38,8 +38,8 @@ class NqlApi extends BaseApi {
|
|
|
38
38
|
* @param {string} nqlQuery - The NQL query to compile.
|
|
39
39
|
* @returns {Promise<NqlCompileResult>} A promise that resolves with the result of the NQL compilation.
|
|
40
40
|
*/
|
|
41
|
-
async parseNql(
|
|
42
|
-
const response = await this.post(`${resourceName}/parse`,
|
|
41
|
+
async parseNql(payload) {
|
|
42
|
+
const response = await this.post(`${resourceName}/parse`, payload);
|
|
43
43
|
return response;
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
@@ -49,8 +49,8 @@ class NqlApi extends BaseApi {
|
|
|
49
49
|
* @param {string} nqlQuery - The NQL query to validate.
|
|
50
50
|
* @returns {Promise<NqlCompileResult>} A promise that resolves with the result of the NQL validation.
|
|
51
51
|
*/
|
|
52
|
-
async validateNql(
|
|
53
|
-
const response = await this.post(`${resourceName}/validate`,
|
|
52
|
+
async validateNql(payload) {
|
|
53
|
+
const response = await this.post(`${resourceName}/validate`, payload);
|
|
54
54
|
return response;
|
|
55
55
|
}
|
|
56
56
|
/**
|
package/build/nql/types.d.ts
CHANGED
|
@@ -37,15 +37,18 @@ export type NqlBudget = z.infer<typeof NqlBudgetObj>;
|
|
|
37
37
|
*/
|
|
38
38
|
export declare const NqlQueryInputObj: z.ZodObject<{
|
|
39
39
|
nql: z.ZodString;
|
|
40
|
+
data_plane_id: z.ZodNullable<z.ZodString>;
|
|
40
41
|
}, "strip", z.ZodTypeAny, {
|
|
41
42
|
nql: string;
|
|
43
|
+
data_plane_id: string | null;
|
|
42
44
|
}, {
|
|
43
45
|
nql: string;
|
|
46
|
+
data_plane_id: string | null;
|
|
44
47
|
}>;
|
|
45
48
|
/**
|
|
46
49
|
* Type for NqlQueryInput object. This is the object that is passed to the NQL API
|
|
47
50
|
*
|
|
48
|
-
* @typedef
|
|
51
|
+
* @typedef NqlQueryInput
|
|
49
52
|
*/
|
|
50
53
|
export type NqlQueryInput = z.infer<typeof NqlQueryInputObj>;
|
|
51
54
|
/**
|
package/build/nql/types.js
CHANGED
|
@@ -38,6 +38,7 @@ export const NqlQueryInputObj = z.object({
|
|
|
38
38
|
message: "NQL query cannot contain a JOIN statement.",
|
|
39
39
|
})
|
|
40
40
|
.describe("A NQL query"),
|
|
41
|
+
data_plane_id: z.string().nullable().describe("Data plane identifier"),
|
|
41
42
|
});
|
|
42
43
|
/**
|
|
43
44
|
* A schema object used to validate and infer the structure of NqlPreSelectExpression.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@narrative.io/data-collaboration-sdk-ts",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.14.0",
|
|
4
4
|
"main": "build/index.js",
|
|
5
5
|
"repository": "github:narrative-io/data-collaboration-sdk-ts",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -20,17 +20,17 @@
|
|
|
20
20
|
"author": "",
|
|
21
21
|
"license": "ISC",
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@babel/core": "7.24.
|
|
24
|
-
"@babel/preset-env": "7.24.
|
|
25
|
-
"@babel/preset-typescript": "7.24.
|
|
26
|
-
"@biomejs/biome": "1.
|
|
23
|
+
"@babel/core": "7.24.9",
|
|
24
|
+
"@babel/preset-env": "7.24.8",
|
|
25
|
+
"@babel/preset-typescript": "7.24.7",
|
|
26
|
+
"@biomejs/biome": "1.8.3",
|
|
27
27
|
"@commitlint/cli": "19.3.0",
|
|
28
28
|
"@commitlint/config-conventional": "19.2.2",
|
|
29
29
|
"@types/jest": "29.5.12",
|
|
30
30
|
"babel-jest": "29.7.0",
|
|
31
31
|
"jest": "29.7.0",
|
|
32
|
-
"lefthook": "1.
|
|
33
|
-
"ts-jest": "29.
|
|
32
|
+
"lefthook": "1.7.5",
|
|
33
|
+
"ts-jest": "29.2.3"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"mande": "2.0.9",
|