@narrative.io/data-collaboration-sdk-ts 0.3.0 → 0.4.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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Config, ApiRecords } from "src/types";
|
|
2
2
|
import { BaseApi } from "../base-api";
|
|
3
|
-
import type { CreateMapping, Mapping, MappingTestResult } from "./types";
|
|
3
|
+
import type { CreateMapping, Mapping, MappingTestResult, MappingTestResults } from "./types";
|
|
4
4
|
import { CompanyInfoApi } from "../company-info";
|
|
5
5
|
/**
|
|
6
6
|
* A class for accessing the Mappings API.
|
|
@@ -25,8 +25,8 @@ declare class MappingsApi extends BaseApi {
|
|
|
25
25
|
* @async
|
|
26
26
|
*/
|
|
27
27
|
createPrivateMapping(mapping: CreateMapping, companyId?: number): Promise<Mapping>;
|
|
28
|
-
testMapping(mapping: CreateMapping): Promise<
|
|
29
|
-
previewMapping(mappingId: string): Promise<
|
|
28
|
+
testMapping(mapping: CreateMapping): Promise<MappingTestResults>;
|
|
29
|
+
previewMapping(mappingId: string): Promise<MappingTestResults>;
|
|
30
30
|
deleteMapping(mappingId: string): Promise<void>;
|
|
31
31
|
/**
|
|
32
32
|
* Retrieves the company ID from the API.
|
|
@@ -39,4 +39,4 @@ declare class MappingsApi extends BaseApi {
|
|
|
39
39
|
acceptMapping(mappingId: string): Promise<void>;
|
|
40
40
|
rejectMapping(mappingId: string): Promise<void>;
|
|
41
41
|
}
|
|
42
|
-
export { type Mapping, MappingsApi, type CreateMapping, type MappingTestResult, };
|
|
42
|
+
export { type Mapping, MappingsApi, type CreateMapping, type MappingTestResult, type MappingTestResults, };
|
package/build/nql/AstParser.d.ts
CHANGED
|
@@ -12,11 +12,12 @@ export interface Explain {
|
|
|
12
12
|
export interface Select {
|
|
13
13
|
type: "select";
|
|
14
14
|
budget: ast.NqlBudget | null;
|
|
15
|
-
columns:
|
|
15
|
+
columns: Output[];
|
|
16
16
|
deduplication: Deduplication | Raw | null;
|
|
17
17
|
from: Table[] | Raw;
|
|
18
18
|
where: BooleanExpression | Raw | null;
|
|
19
19
|
}
|
|
20
|
+
export type Output = ColumnRef | Lit | Raw;
|
|
20
21
|
export type Expression = ArithmeticExpression | BooleanExpression | ColumnRef | Lit | FunctionCall | StringExpression | UnaryMinus | Raw;
|
|
21
22
|
export interface Raw {
|
|
22
23
|
type: "nql";
|
|
@@ -203,3 +204,4 @@ export declare function parseFrom(n: ast.NqlAst): Table[];
|
|
|
203
204
|
export declare function parseWhere(n: ast.NqlAst): BooleanExpression | Raw;
|
|
204
205
|
export declare function parseDeduplication(n: ast.NqlSelect): Deduplication | Raw | null;
|
|
205
206
|
export declare function parseExpression(n: ast.NqlAst): Expression;
|
|
207
|
+
export declare function parseOutput(n: ast.NqlAst): Output;
|
package/build/nql/AstParser.js
CHANGED
|
@@ -35,7 +35,7 @@ export function parseSelect(n) {
|
|
|
35
35
|
const select = {
|
|
36
36
|
type: "select",
|
|
37
37
|
budget: n.budget,
|
|
38
|
-
columns: n.columns.map((col) =>
|
|
38
|
+
columns: n.columns.map((col) => parseOutput(col)),
|
|
39
39
|
deduplication: parseDeduplication(n),
|
|
40
40
|
from: n.from !== null ? parseFrom(n.from) : [],
|
|
41
41
|
where: n.where !== null ? parseWhere(n.where) : null,
|
|
@@ -103,6 +103,10 @@ export function parseExpression(n) {
|
|
|
103
103
|
const parse = oneOf(parseArithmetic, parseBooleanExpression, parseColumnRef, parseFunctionCall, parseLit, parseStringExpression);
|
|
104
104
|
return parse(n);
|
|
105
105
|
}
|
|
106
|
+
export function parseOutput(n) {
|
|
107
|
+
const parse = oneOf(parseColumnRef, parseLit);
|
|
108
|
+
return parse(n);
|
|
109
|
+
}
|
|
106
110
|
function parseBooleanExpression(n) {
|
|
107
111
|
switch (n.type) {
|
|
108
112
|
case "binary_op": {
|