flowerbi 3.8.3 → 3.9.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/dist/QueryJson.d.ts +29 -5
- package/dist/QueryValues.d.ts +10 -10
- package/dist/QueryValues.js.map +1 -1
- package/dist/executeQuery.d.ts +8 -8
- package/dist/executeQuery.js +83 -12
- package/dist/executeQuery.js.map +1 -1
- package/dist/executeQuery.test.d.ts +1 -0
- package/dist/executeQuery.test.js +196 -22
- package/dist/executeQuery.test.js.map +1 -1
- package/dist/queryModel.d.ts +28 -8
- package/dist/queryModel.js.map +1 -1
- package/package.json +1 -1
- package/src/QueryJson.ts +32 -5
- package/src/QueryValues.ts +17 -17
- package/src/executeQuery.test.ts +263 -62
- package/src/executeQuery.ts +121 -31
- package/src/queryModel.ts +59 -34
package/dist/QueryJson.d.ts
CHANGED
|
@@ -32,13 +32,33 @@ export interface AggregationJson {
|
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* Specifies an ordering criteria: which column to sort by, and optionally
|
|
35
|
-
* whether it is descending (the default is ascending). The column
|
|
36
|
-
* specified by a string of the form `table.column
|
|
35
|
+
* whether it is descending (the default is ascending). The column can be
|
|
36
|
+
* specified by a string of the form `table.column`, though this can only
|
|
37
|
+
* target one of the columns specified in select. More flexibly, specify
|
|
38
|
+
* a type of column (the type 'Value' refers to aggregations) and its
|
|
39
|
+
* zero-based position.
|
|
37
40
|
*/
|
|
38
|
-
export
|
|
39
|
-
column: string;
|
|
41
|
+
export declare type OrderingJson = {
|
|
40
42
|
descending?: boolean;
|
|
41
|
-
}
|
|
43
|
+
} & ({
|
|
44
|
+
column: string;
|
|
45
|
+
} | {
|
|
46
|
+
type: "Select" | "Value" | "Calculation";
|
|
47
|
+
index: number;
|
|
48
|
+
});
|
|
49
|
+
/**
|
|
50
|
+
* Specifies an expression for calculating a derived value based on
|
|
51
|
+
* the values of aggregations, specified by zero-based position.
|
|
52
|
+
*/
|
|
53
|
+
export declare type CalculationJson = {
|
|
54
|
+
value: number;
|
|
55
|
+
} | {
|
|
56
|
+
aggregation: number;
|
|
57
|
+
} | {
|
|
58
|
+
first: CalculationJson;
|
|
59
|
+
operator: "+" | "-" | "*" | "/";
|
|
60
|
+
second: CalculationJson;
|
|
61
|
+
};
|
|
42
62
|
/**
|
|
43
63
|
* Specifies an entire query.
|
|
44
64
|
*/
|
|
@@ -51,6 +71,10 @@ export interface QueryJson {
|
|
|
51
71
|
* The aggregated values to fetch.
|
|
52
72
|
*/
|
|
53
73
|
aggregations: AggregationJson[];
|
|
74
|
+
/**
|
|
75
|
+
* The calculations to perform.
|
|
76
|
+
*/
|
|
77
|
+
calculations?: CalculationJson[];
|
|
54
78
|
/**
|
|
55
79
|
* Filters to apply. They are always combined with AND.
|
|
56
80
|
*/
|
package/dist/QueryValues.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { QuerySelect, ExpandedQueryRecord, AggregateValuesOnly, AggregatePropsOnly, ExpandedQueryRecordWithOptionalColumns } from "./queryModel";
|
|
1
|
+
import { QuerySelect, ExpandedQueryRecord, AggregateValuesOnly, AggregatePropsOnly, ExpandedQueryRecordWithOptionalColumns, QueryCalculations, CalculationValues } from "./queryModel";
|
|
2
2
|
/**
|
|
3
3
|
* An abstract interface representing either a row from a dataset or
|
|
4
4
|
* the {@link ExpandedQueryResult.totals} row, so that generic code can
|
|
5
5
|
* format either of them in a consistent way.
|
|
6
6
|
*/
|
|
7
|
-
export interface QueryValues<S extends QuerySelect
|
|
7
|
+
export interface QueryValues<S extends QuerySelect, C extends QueryCalculations<S>> {
|
|
8
8
|
/**
|
|
9
9
|
* The plain values of columns, which may be `undefined` if this
|
|
10
10
|
* refers to the {@link ExpandedQueryResult.totals} record.
|
|
11
11
|
*/
|
|
12
|
-
values: ExpandedQueryRecordWithOptionalColumns<S>;
|
|
12
|
+
values: ExpandedQueryRecordWithOptionalColumns<S, C>;
|
|
13
13
|
percentage<K extends AggregatePropsOnly<S>>(key: K): number;
|
|
14
14
|
}
|
|
15
|
-
export declare class QueryValuesRow<S extends QuerySelect
|
|
16
|
-
readonly values: ExpandedQueryRecord<S>;
|
|
17
|
-
readonly totals: AggregateValuesOnly<S> | undefined;
|
|
18
|
-
constructor(values: ExpandedQueryRecord<S>, totals: AggregateValuesOnly<S> | undefined);
|
|
15
|
+
export declare class QueryValuesRow<S extends QuerySelect, C extends QueryCalculations<S>> implements QueryValues<S, C> {
|
|
16
|
+
readonly values: ExpandedQueryRecord<S, C>;
|
|
17
|
+
readonly totals: (AggregateValuesOnly<S> & CalculationValues<C>) | undefined;
|
|
18
|
+
constructor(values: ExpandedQueryRecord<S, C>, totals: (AggregateValuesOnly<S> & CalculationValues<C>) | undefined);
|
|
19
19
|
percentage<K extends AggregatePropsOnly<S>>(key: K): number;
|
|
20
20
|
}
|
|
21
|
-
export declare class QueryValuesTotal<S extends QuerySelect
|
|
22
|
-
readonly values: ExpandedQueryRecordWithOptionalColumns<S>;
|
|
23
|
-
constructor(totals: AggregateValuesOnly<S>);
|
|
21
|
+
export declare class QueryValuesTotal<S extends QuerySelect, C extends QueryCalculations<S>> implements QueryValues<S, C> {
|
|
22
|
+
readonly values: ExpandedQueryRecordWithOptionalColumns<S, C>;
|
|
23
|
+
constructor(totals: AggregateValuesOnly<S> & CalculationValues<C>);
|
|
24
24
|
percentage(): number;
|
|
25
25
|
}
|
package/dist/QueryValues.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryValues.js","sourceRoot":"","sources":["../src/QueryValues.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"QueryValues.js","sourceRoot":"","sources":["../src/QueryValues.ts"],"names":[],"mappings":";;;AAwBA;IACI,wBAA4B,MAAiC,EAAkB,MAAmE;QAAtH,WAAM,GAAN,MAAM,CAA2B;QAAkB,WAAM,GAAN,MAAM,CAA6D;IAAG,CAAC;IAEtJ,mCAAU,GAAV,UAA4C,GAAM;;QAC9C,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,OAAO,CAAC,CAAC;QAE3B,IAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAClC,IAAM,KAAK,GAAG,MAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,mCAAI,CAAC,CAAC;QACpC,IAAM,OAAO,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC;QAC3D,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;IAC3C,CAAC;IACL,qBAAC;AAAD,CAAC,AAXD,IAWC;AAXY,wCAAc;AAa3B;IAGI,0BAAY,MAAqD;QAC7D,IAAI,CAAC,MAAM,GAAG,MAAsD,CAAC;IACzE,CAAC;IAED,qCAAU,GAAV;QACI,OAAO,GAAG,CAAC;IACf,CAAC;IACL,uBAAC;AAAD,CAAC,AAVD,IAUC;AAVY,4CAAgB"}
|
package/dist/executeQuery.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Query, QuerySelect, ExpandedQueryRecord, AggregateValuesOnly } from "./queryModel";
|
|
1
|
+
import { Query, QuerySelect, ExpandedQueryRecord, AggregateValuesOnly, QueryCalculations, CalculationValues } from "./queryModel";
|
|
2
2
|
import { QueryJson } from "./QueryJson";
|
|
3
3
|
/**
|
|
4
4
|
* The allowed data types for plain columns.
|
|
@@ -45,7 +45,7 @@ export declare type QueryFetch = (queryJson: QueryJson) => Promise<QueryResultJs
|
|
|
45
45
|
* format, ready to be sent to your API.
|
|
46
46
|
* @param query
|
|
47
47
|
*/
|
|
48
|
-
export declare function jsonifyQuery<S extends QuerySelect
|
|
48
|
+
export declare function jsonifyQuery<S extends QuerySelect, C extends QueryCalculations<S>>(query: Query<S, C>): QueryJson;
|
|
49
49
|
/**
|
|
50
50
|
* Converts the `QueryRecordJson` for a single record into a strongly-typed record
|
|
51
51
|
* with named properties, using the {@link Query.select} from the query to perform
|
|
@@ -53,7 +53,7 @@ export declare function jsonifyQuery<S extends QuerySelect>(query: Query<S>): Qu
|
|
|
53
53
|
* @param select The {@link Query.select} property from the query.
|
|
54
54
|
* @param record The record returned from your API.
|
|
55
55
|
*/
|
|
56
|
-
export declare function expandQueryRecord<S extends QuerySelect
|
|
56
|
+
export declare function expandQueryRecord<S extends QuerySelect, C extends QueryCalculations<S>>(select: S, record: QueryRecordJson, calcs?: C): ExpandedQueryRecord<S, C>;
|
|
57
57
|
/**
|
|
58
58
|
* Converts the `QueryRecordJson` from the `totals` record into a strongly-typed
|
|
59
59
|
* record named properties for the aggregated values only, using the
|
|
@@ -62,23 +62,23 @@ export declare function expandQueryRecord<S extends QuerySelect>(select: S, reco
|
|
|
62
62
|
* @param select The {@link Query.select} property from the query.
|
|
63
63
|
* @param record The {@link QueryResultJson.totals} record returned from your API.
|
|
64
64
|
*/
|
|
65
|
-
export declare function getAggregateValuesOnly<S extends QuerySelect
|
|
65
|
+
export declare function getAggregateValuesOnly<S extends QuerySelect, C extends QueryCalculations<S>>(select: S, record: QueryRecordJson, calcs?: C): AggregateValuesOnly<S> & CalculationValues<C>;
|
|
66
66
|
/**
|
|
67
67
|
* The statically-typed result of a {@link Query}.
|
|
68
68
|
*/
|
|
69
|
-
export interface ExpandedQueryResult<S extends QuerySelect
|
|
69
|
+
export interface ExpandedQueryResult<S extends QuerySelect, C extends QueryCalculations<S>> {
|
|
70
70
|
/**
|
|
71
71
|
* The set of records returned, each having named properties
|
|
72
72
|
* corresponding to the plain and aggregated columns selected
|
|
73
73
|
* in the query.
|
|
74
74
|
*/
|
|
75
|
-
records: ExpandedQueryRecord<S>[];
|
|
75
|
+
records: ExpandedQueryRecord<S, C>[];
|
|
76
76
|
/**
|
|
77
77
|
* Optional extra record, only available if {@link QueryJson.totals}
|
|
78
78
|
* was specified as `true` in the query, containing the aggregation
|
|
79
79
|
* totals.
|
|
80
80
|
*/
|
|
81
|
-
totals?: AggregateValuesOnly<S>;
|
|
81
|
+
totals?: AggregateValuesOnly<S> & CalculationValues<C>;
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
84
|
* Converts the payload returned from the API into the statically-typed
|
|
@@ -86,4 +86,4 @@ export interface ExpandedQueryResult<S extends QuerySelect> {
|
|
|
86
86
|
* @param select The {@link Query.select} property from the query.
|
|
87
87
|
* @param result The response payload from the API call.
|
|
88
88
|
*/
|
|
89
|
-
export declare function expandQueryResult<S extends QuerySelect
|
|
89
|
+
export declare function expandQueryResult<S extends QuerySelect, C extends QueryCalculations<S>>(select: S, result: QueryResultJson, calcs?: C): ExpandedQueryResult<S, C>;
|
package/dist/executeQuery.js
CHANGED
|
@@ -2,23 +2,84 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.expandQueryResult = exports.getAggregateValuesOnly = exports.expandQueryRecord = exports.jsonifyQuery = void 0;
|
|
4
4
|
var queryModel_1 = require("./queryModel");
|
|
5
|
+
var arrayHelpers_1 = require("./arrayHelpers");
|
|
6
|
+
function jsonifyCalculation(calculation, props) {
|
|
7
|
+
if (typeof calculation === "string") {
|
|
8
|
+
var aggregation = props.indexOf(calculation);
|
|
9
|
+
if (aggregation === -1) {
|
|
10
|
+
throw new Error("Not a valid aggregation name: ".concat(calculation));
|
|
11
|
+
}
|
|
12
|
+
return { aggregation: aggregation };
|
|
13
|
+
}
|
|
14
|
+
if (typeof calculation === "number") {
|
|
15
|
+
return {
|
|
16
|
+
value: calculation,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
if (calculation instanceof Array) {
|
|
20
|
+
return {
|
|
21
|
+
first: jsonifyCalculation(calculation[0], props),
|
|
22
|
+
operator: calculation[1],
|
|
23
|
+
second: jsonifyCalculation(calculation[2], props),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
throw new Error("Invalid calculation");
|
|
27
|
+
}
|
|
28
|
+
function jsonifyOrdering(ordering, selects, values, calculations) {
|
|
29
|
+
if ("select" in ordering) {
|
|
30
|
+
var index = selects.indexOf(ordering.select);
|
|
31
|
+
if (index !== -1) {
|
|
32
|
+
return {
|
|
33
|
+
type: "Select",
|
|
34
|
+
index: index,
|
|
35
|
+
descending: ordering.descending,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
index = values.indexOf(ordering.select);
|
|
39
|
+
if (index !== -1) {
|
|
40
|
+
return {
|
|
41
|
+
type: "Value",
|
|
42
|
+
index: index,
|
|
43
|
+
descending: ordering.descending,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
throw new Error("Invalid ordering select key: ".concat(String(ordering.select)));
|
|
47
|
+
}
|
|
48
|
+
if ("calculation" in ordering) {
|
|
49
|
+
var index = calculations.indexOf(ordering.calculation);
|
|
50
|
+
if (index !== -1) {
|
|
51
|
+
return {
|
|
52
|
+
type: "Calculation",
|
|
53
|
+
index: index,
|
|
54
|
+
descending: ordering.descending,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
throw new Error("Invalid ordering calculation key: ".concat(String(ordering.calculation)));
|
|
58
|
+
}
|
|
59
|
+
return ordering;
|
|
60
|
+
}
|
|
5
61
|
/**
|
|
6
62
|
* Converts a statically-typed {@link Query} into the {@link QueryJson}
|
|
7
63
|
* format, ready to be sent to your API.
|
|
8
64
|
* @param query
|
|
9
65
|
*/
|
|
10
66
|
function jsonifyQuery(query) {
|
|
11
|
-
var
|
|
67
|
+
var _a;
|
|
68
|
+
var select = query.select, filters = query.filters, calculations = query.calculations, orderBy = query.orderBy, totals = query.totals, take = query.take, skip = query.skip, comment = query.comment, allowDuplicates = query.allowDuplicates;
|
|
69
|
+
var columnProps = (0, queryModel_1.getColumnPropsOnly)(select);
|
|
70
|
+
var aggregationProps = (0, queryModel_1.getAggregatePropsOnly)(select);
|
|
71
|
+
var calculationProps = calculations ? (0, arrayHelpers_1.keysOf)(calculations) : [];
|
|
12
72
|
return {
|
|
13
|
-
select:
|
|
14
|
-
aggregations:
|
|
73
|
+
select: columnProps.map(function (key) { return select[key].name; }),
|
|
74
|
+
aggregations: aggregationProps.map(function (key) { return select[key]; }),
|
|
75
|
+
calculations: calculations ? calculationProps.map(function (key) { return jsonifyCalculation(calculations[key], aggregationProps); }) : undefined,
|
|
15
76
|
filters: filters !== null && filters !== void 0 ? filters : [],
|
|
16
|
-
orderBy: orderBy !== null &&
|
|
77
|
+
orderBy: (_a = orderBy === null || orderBy === void 0 ? void 0 : orderBy.map(function (o) { return jsonifyOrdering(o, columnProps, aggregationProps, calculationProps); })) !== null && _a !== void 0 ? _a : [],
|
|
17
78
|
totals: totals !== null && totals !== void 0 ? totals : false,
|
|
18
79
|
skip: skip !== null && skip !== void 0 ? skip : 0,
|
|
19
80
|
take: take !== null && take !== void 0 ? take : 100,
|
|
20
81
|
comment: comment,
|
|
21
|
-
allowDuplicates: allowDuplicates
|
|
82
|
+
allowDuplicates: allowDuplicates,
|
|
22
83
|
};
|
|
23
84
|
}
|
|
24
85
|
exports.jsonifyQuery = jsonifyQuery;
|
|
@@ -29,16 +90,21 @@ exports.jsonifyQuery = jsonifyQuery;
|
|
|
29
90
|
* @param select The {@link Query.select} property from the query.
|
|
30
91
|
* @param record The record returned from your API.
|
|
31
92
|
*/
|
|
32
|
-
function expandQueryRecord(select, record) {
|
|
93
|
+
function expandQueryRecord(select, record, calcs) {
|
|
33
94
|
var result = {};
|
|
34
95
|
var n = 0;
|
|
35
96
|
for (var _i = 0, _a = (0, queryModel_1.getAggregatePropsOnly)(select); _i < _a.length; _i++) {
|
|
36
97
|
var key = _a[_i];
|
|
37
98
|
result[key] = record.aggregated[n++];
|
|
38
99
|
}
|
|
100
|
+
var calculationProps = calcs ? (0, arrayHelpers_1.keysOf)(calcs) : [];
|
|
101
|
+
for (var _b = 0, calculationProps_1 = calculationProps; _b < calculationProps_1.length; _b++) {
|
|
102
|
+
var key = calculationProps_1[_b];
|
|
103
|
+
result[key] = record.aggregated[n++];
|
|
104
|
+
}
|
|
39
105
|
n = 0;
|
|
40
|
-
for (var
|
|
41
|
-
var key = _c
|
|
106
|
+
for (var _c = 0, _d = (0, queryModel_1.getColumnPropsOnly)(select); _c < _d.length; _c++) {
|
|
107
|
+
var key = _d[_c];
|
|
42
108
|
result[key] = record.selected[n++];
|
|
43
109
|
}
|
|
44
110
|
return result;
|
|
@@ -52,13 +118,18 @@ exports.expandQueryRecord = expandQueryRecord;
|
|
|
52
118
|
* @param select The {@link Query.select} property from the query.
|
|
53
119
|
* @param record The {@link QueryResultJson.totals} record returned from your API.
|
|
54
120
|
*/
|
|
55
|
-
function getAggregateValuesOnly(select, record) {
|
|
121
|
+
function getAggregateValuesOnly(select, record, calcs) {
|
|
56
122
|
var result = {};
|
|
57
123
|
var n = 0;
|
|
58
124
|
for (var _i = 0, _a = (0, queryModel_1.getAggregatePropsOnly)(select); _i < _a.length; _i++) {
|
|
59
125
|
var key = _a[_i];
|
|
60
126
|
result[key] = record.aggregated[n++];
|
|
61
127
|
}
|
|
128
|
+
var calculationProps = calcs ? (0, arrayHelpers_1.keysOf)(calcs) : [];
|
|
129
|
+
for (var _b = 0, calculationProps_2 = calculationProps; _b < calculationProps_2.length; _b++) {
|
|
130
|
+
var key = calculationProps_2[_b];
|
|
131
|
+
result[key] = record.aggregated[n++];
|
|
132
|
+
}
|
|
62
133
|
return result;
|
|
63
134
|
}
|
|
64
135
|
exports.getAggregateValuesOnly = getAggregateValuesOnly;
|
|
@@ -68,10 +139,10 @@ exports.getAggregateValuesOnly = getAggregateValuesOnly;
|
|
|
68
139
|
* @param select The {@link Query.select} property from the query.
|
|
69
140
|
* @param result The response payload from the API call.
|
|
70
141
|
*/
|
|
71
|
-
function expandQueryResult(select, result) {
|
|
142
|
+
function expandQueryResult(select, result, calcs) {
|
|
72
143
|
return {
|
|
73
|
-
records: result.records.map(function (r) { return expandQueryRecord(select, r); }),
|
|
74
|
-
totals: result.totals && getAggregateValuesOnly(select, result.totals)
|
|
144
|
+
records: result.records.map(function (r) { return expandQueryRecord(select, r, calcs); }),
|
|
145
|
+
totals: result.totals && getAggregateValuesOnly(select, result.totals, calcs),
|
|
75
146
|
};
|
|
76
147
|
}
|
|
77
148
|
exports.expandQueryResult = expandQueryResult;
|
package/dist/executeQuery.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executeQuery.js","sourceRoot":"","sources":["../src/executeQuery.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"executeQuery.js","sourceRoot":"","sources":["../src/executeQuery.ts"],"names":[],"mappings":";;;AAAA,2CAYsB;AAGtB,+CAAwC;AA+CxC,SAAS,kBAAkB,CAAwB,WAA2B,EAAE,KAA8B;IAC1G,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;QACjC,IAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAC/C,IAAI,WAAW,KAAK,CAAC,CAAC,EAAE;YACpB,MAAM,IAAI,KAAK,CAAC,wCAAiC,WAAW,CAAE,CAAC,CAAC;SACnE;QACD,OAAO,EAAE,WAAW,aAAA,EAAE,CAAC;KAC1B;IACD,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;QACjC,OAAO;YACH,KAAK,EAAE,WAAW;SACrB,CAAC;KACL;IACD,IAAI,WAAW,YAAY,KAAK,EAAE;QAC9B,OAAO;YACH,KAAK,EAAE,kBAAkB,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC;YAChD,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;YACxB,MAAM,EAAE,kBAAkB,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC;SACpD,CAAC;KACL;IACD,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,eAAe,CACpB,QAAuC,EACvC,OAAiB,EACjB,MAAgB,EACh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B,EAAC,MAAM,CAAC,EAA7B,cAA6B,EAA7B,IAA6B,EAAE;QAA5C,IAAM,GAAG,SAAA;QACV,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC;KACxC;IAED,IAAM,gBAAgB,GAAG,KAAK,CAAC,CAAC,CAAC,IAAA,qBAAM,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACpD,KAAkB,UAAgB,EAAhB,qCAAgB,EAAhB,8BAAgB,EAAhB,IAAgB,EAAE;QAA/B,IAAM,GAAG,yBAAA;QACV,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC;KACxC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AAlBD,wDAkBC;AAoBD;;;;;GAKG;AACH,SAAgB,iBAAiB,CAC7B,MAAS,EACT,MAAuB,EACvB,KAAS;IAET,OAAO;QACH,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,UAAC,CAAC,IAAK,OAAA,iBAAiB,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,EAAnC,CAAmC,CAAC;QACvE,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,sBAAsB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;KAChF,CAAC;AACN,CAAC;AATD,8CASC"}
|
|
@@ -10,20 +10,24 @@ exports.Customer = {
|
|
|
10
10
|
exports.Bug = {
|
|
11
11
|
Id: new QueryColumn_1.QueryColumn("Bug.Id"),
|
|
12
12
|
CustomerId: new QueryColumn_1.QueryColumn("Bug.CustomerId"),
|
|
13
|
+
Fixed: new QueryColumn_1.QueryColumn("Bug.Fixed"),
|
|
13
14
|
};
|
|
14
15
|
test("jsonifies mixed columns", function () {
|
|
15
16
|
expect((0, executeQuery_1.jsonifyQuery)({
|
|
16
17
|
select: {
|
|
17
18
|
customer: exports.Customer.CustomerName,
|
|
18
|
-
bugCount: exports.Bug.Id.count()
|
|
19
|
-
}
|
|
19
|
+
bugCount: exports.Bug.Id.count(),
|
|
20
|
+
},
|
|
20
21
|
})).toStrictEqual({
|
|
21
22
|
select: ["Customer.CustomerName"],
|
|
22
|
-
aggregations: [
|
|
23
|
+
aggregations: [
|
|
24
|
+
{
|
|
23
25
|
column: "Bug.Id",
|
|
24
26
|
function: "Count",
|
|
25
|
-
filters: undefined
|
|
26
|
-
}
|
|
27
|
+
filters: undefined,
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
calculations: undefined,
|
|
27
31
|
filters: [],
|
|
28
32
|
orderBy: [],
|
|
29
33
|
skip: 0,
|
|
@@ -37,10 +41,11 @@ test("jsonifies select", function () {
|
|
|
37
41
|
expect((0, executeQuery_1.jsonifyQuery)({
|
|
38
42
|
select: {
|
|
39
43
|
customer: exports.Customer.CustomerName,
|
|
40
|
-
}
|
|
44
|
+
},
|
|
41
45
|
})).toStrictEqual({
|
|
42
46
|
select: ["Customer.CustomerName"],
|
|
43
47
|
aggregations: [],
|
|
48
|
+
calculations: undefined,
|
|
44
49
|
filters: [],
|
|
45
50
|
orderBy: [],
|
|
46
51
|
skip: 0,
|
|
@@ -61,6 +66,7 @@ test("jsonifies params", function () {
|
|
|
61
66
|
})).toStrictEqual({
|
|
62
67
|
select: [],
|
|
63
68
|
aggregations: [],
|
|
69
|
+
calculations: undefined,
|
|
64
70
|
filters: [],
|
|
65
71
|
orderBy: [],
|
|
66
72
|
skip: 3,
|
|
@@ -73,29 +79,32 @@ test("jsonifies params", function () {
|
|
|
73
79
|
test("jsonifies filters", function () {
|
|
74
80
|
expect((0, executeQuery_1.jsonifyQuery)({
|
|
75
81
|
select: {
|
|
76
|
-
bugCount: exports.Bug.Id.count([
|
|
77
|
-
exports.Customer.CustomerName.lessThan("z")
|
|
78
|
-
])
|
|
82
|
+
bugCount: exports.Bug.Id.count([exports.Customer.CustomerName.lessThan("z")]),
|
|
79
83
|
},
|
|
80
|
-
filters: [
|
|
81
|
-
exports.Customer.CustomerName.greaterThan("a")
|
|
82
|
-
]
|
|
84
|
+
filters: [exports.Customer.CustomerName.greaterThan("a")],
|
|
83
85
|
})).toStrictEqual({
|
|
84
86
|
select: [],
|
|
85
|
-
aggregations: [
|
|
87
|
+
aggregations: [
|
|
88
|
+
{
|
|
86
89
|
column: "Bug.Id",
|
|
87
90
|
function: "Count",
|
|
88
|
-
filters: [
|
|
91
|
+
filters: [
|
|
92
|
+
{
|
|
89
93
|
column: "Customer.CustomerName",
|
|
90
94
|
operator: "<",
|
|
91
95
|
value: "z",
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
calculations: undefined,
|
|
101
|
+
filters: [
|
|
102
|
+
{
|
|
95
103
|
column: "Customer.CustomerName",
|
|
96
104
|
operator: ">",
|
|
97
105
|
value: "a",
|
|
98
|
-
}
|
|
106
|
+
},
|
|
107
|
+
],
|
|
99
108
|
orderBy: [],
|
|
100
109
|
skip: 0,
|
|
101
110
|
take: 100,
|
|
@@ -107,17 +116,115 @@ test("jsonifies filters", function () {
|
|
|
107
116
|
test("jsonifies orderBy", function () {
|
|
108
117
|
expect((0, executeQuery_1.jsonifyQuery)({
|
|
109
118
|
select: {},
|
|
119
|
+
orderBy: [exports.Customer.CustomerName.descending()],
|
|
120
|
+
})).toStrictEqual({
|
|
121
|
+
select: [],
|
|
122
|
+
aggregations: [],
|
|
123
|
+
calculations: undefined,
|
|
124
|
+
filters: [],
|
|
125
|
+
orderBy: [
|
|
126
|
+
{
|
|
127
|
+
column: "Customer.CustomerName",
|
|
128
|
+
descending: true,
|
|
129
|
+
},
|
|
130
|
+
],
|
|
131
|
+
skip: 0,
|
|
132
|
+
take: 100,
|
|
133
|
+
totals: false,
|
|
134
|
+
allowDuplicates: undefined,
|
|
135
|
+
comment: undefined,
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
test("jsonifies calculations and ordering by keys", function () {
|
|
139
|
+
expect((0, executeQuery_1.jsonifyQuery)({
|
|
140
|
+
select: {
|
|
141
|
+
customer: exports.Customer.CustomerName,
|
|
142
|
+
bugCount: exports.Bug.Id.count(),
|
|
143
|
+
bugsFixed: exports.Bug.Id.count([exports.Bug.Fixed.equalTo(true)]),
|
|
144
|
+
},
|
|
145
|
+
calculations: {
|
|
146
|
+
successRate: [100, "*", ["bugsFixed", "/", "bugCount"]],
|
|
147
|
+
failureRate: [100, "-", [100, "*", ["bugsFixed", "/", "bugCount"]]],
|
|
148
|
+
},
|
|
149
|
+
orderBy: [
|
|
150
|
+
{ select: "customer" },
|
|
151
|
+
{ select: "bugsFixed", descending: true },
|
|
152
|
+
{ calculation: "successRate" },
|
|
153
|
+
{ calculation: "failureRate", descending: true },
|
|
154
|
+
],
|
|
155
|
+
})).toStrictEqual({
|
|
156
|
+
select: ["Customer.CustomerName"],
|
|
157
|
+
aggregations: [
|
|
158
|
+
{
|
|
159
|
+
column: "Bug.Id",
|
|
160
|
+
function: "Count",
|
|
161
|
+
filters: undefined,
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
column: "Bug.Id",
|
|
165
|
+
function: "Count",
|
|
166
|
+
filters: [
|
|
167
|
+
{
|
|
168
|
+
column: "Bug.Fixed",
|
|
169
|
+
operator: "=",
|
|
170
|
+
value: true,
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
calculations: [
|
|
176
|
+
{
|
|
177
|
+
first: { value: 100 },
|
|
178
|
+
operator: "*",
|
|
179
|
+
second: {
|
|
180
|
+
first: { aggregation: 1 },
|
|
181
|
+
operator: "/",
|
|
182
|
+
second: { aggregation: 0 },
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
first: { value: 100 },
|
|
187
|
+
operator: "-",
|
|
188
|
+
second: {
|
|
189
|
+
first: { value: 100 },
|
|
190
|
+
operator: "*",
|
|
191
|
+
second: {
|
|
192
|
+
first: { aggregation: 1 },
|
|
193
|
+
operator: "/",
|
|
194
|
+
second: { aggregation: 0 },
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
],
|
|
199
|
+
filters: [],
|
|
110
200
|
orderBy: [
|
|
111
|
-
|
|
112
|
-
|
|
201
|
+
{ type: "Select", index: 0, descending: undefined },
|
|
202
|
+
{ type: "Value", index: 1, descending: true },
|
|
203
|
+
{ type: "Calculation", index: 0, descending: undefined },
|
|
204
|
+
{ type: "Calculation", index: 1, descending: true },
|
|
205
|
+
],
|
|
206
|
+
skip: 0,
|
|
207
|
+
take: 100,
|
|
208
|
+
totals: false,
|
|
209
|
+
allowDuplicates: undefined,
|
|
210
|
+
comment: undefined,
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
test("passes through JSON orderBy", function () {
|
|
214
|
+
expect((0, executeQuery_1.jsonifyQuery)({
|
|
215
|
+
select: {},
|
|
216
|
+
orderBy: [exports.Customer.CustomerName.descending()],
|
|
113
217
|
})).toStrictEqual({
|
|
114
218
|
select: [],
|
|
115
219
|
aggregations: [],
|
|
220
|
+
calculations: undefined,
|
|
116
221
|
filters: [],
|
|
117
|
-
orderBy: [
|
|
222
|
+
orderBy: [
|
|
223
|
+
{
|
|
118
224
|
column: "Customer.CustomerName",
|
|
119
225
|
descending: true,
|
|
120
|
-
}
|
|
226
|
+
},
|
|
227
|
+
],
|
|
121
228
|
skip: 0,
|
|
122
229
|
take: 100,
|
|
123
230
|
totals: false,
|
|
@@ -125,4 +232,71 @@ test("jsonifies orderBy", function () {
|
|
|
125
232
|
comment: undefined,
|
|
126
233
|
});
|
|
127
234
|
});
|
|
235
|
+
function formatResultsFromQuery(query, result) {
|
|
236
|
+
return (0, executeQuery_1.expandQueryResult)(query.select, result, query.calculations);
|
|
237
|
+
}
|
|
238
|
+
test("generates typed results", function () {
|
|
239
|
+
var result = formatResultsFromQuery({
|
|
240
|
+
select: {
|
|
241
|
+
customer: exports.Customer.CustomerName,
|
|
242
|
+
bugCount: exports.Bug.Id.count(),
|
|
243
|
+
bugsFixed: exports.Bug.Id.count([exports.Bug.Fixed.equalTo(true)]),
|
|
244
|
+
},
|
|
245
|
+
calculations: {
|
|
246
|
+
successRate: [100, "*", ["bugsFixed", "/", "bugCount"]],
|
|
247
|
+
failureRate: [100, "-", [100, "*", ["bugsFixed", "/", "bugCount"]]],
|
|
248
|
+
},
|
|
249
|
+
orderBy: [
|
|
250
|
+
{ select: "customer" },
|
|
251
|
+
{ select: "bugsFixed", descending: true },
|
|
252
|
+
{ calculation: "successRate" },
|
|
253
|
+
{ calculation: "failureRate", descending: true },
|
|
254
|
+
],
|
|
255
|
+
}, {
|
|
256
|
+
records: [
|
|
257
|
+
{
|
|
258
|
+
selected: ["woolworths"],
|
|
259
|
+
aggregated: [3, 1, 33.33, 66.67],
|
|
260
|
+
},
|
|
261
|
+
],
|
|
262
|
+
});
|
|
263
|
+
expect(result).toStrictEqual({
|
|
264
|
+
records: [{ customer: "woolworths", bugCount: 3, bugsFixed: 1, successRate: 33.33, failureRate: 66.67 }],
|
|
265
|
+
totals: undefined,
|
|
266
|
+
});
|
|
267
|
+
});
|
|
268
|
+
test("generates typed results with totals", function () {
|
|
269
|
+
var result = formatResultsFromQuery({
|
|
270
|
+
select: {
|
|
271
|
+
customer: exports.Customer.CustomerName,
|
|
272
|
+
bugCount: exports.Bug.Id.count(),
|
|
273
|
+
bugsFixed: exports.Bug.Id.count([exports.Bug.Fixed.equalTo(true)]),
|
|
274
|
+
},
|
|
275
|
+
calculations: {
|
|
276
|
+
successRate: [100, "*", ["bugsFixed", "/", "bugCount"]],
|
|
277
|
+
failureRate: [100, "-", [100, "*", ["bugsFixed", "/", "bugCount"]]],
|
|
278
|
+
},
|
|
279
|
+
orderBy: [
|
|
280
|
+
{ select: "customer" },
|
|
281
|
+
{ select: "bugsFixed", descending: true },
|
|
282
|
+
{ calculation: "successRate" },
|
|
283
|
+
{ calculation: "failureRate", descending: true },
|
|
284
|
+
],
|
|
285
|
+
}, {
|
|
286
|
+
records: [
|
|
287
|
+
{
|
|
288
|
+
selected: ["woolworths"],
|
|
289
|
+
aggregated: [3, 1, 33.33, 66.67],
|
|
290
|
+
},
|
|
291
|
+
],
|
|
292
|
+
totals: {
|
|
293
|
+
selected: [""],
|
|
294
|
+
aggregated: [4, 2, 50, 50],
|
|
295
|
+
},
|
|
296
|
+
});
|
|
297
|
+
expect(result).toStrictEqual({
|
|
298
|
+
records: [{ customer: "woolworths", bugCount: 3, bugsFixed: 1, successRate: 33.33, failureRate: 66.67 }],
|
|
299
|
+
totals: { bugCount: 4, bugsFixed: 2, successRate: 50, failureRate: 50 },
|
|
300
|
+
});
|
|
301
|
+
});
|
|
128
302
|
//# sourceMappingURL=executeQuery.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executeQuery.test.js","sourceRoot":"","sources":["../src/executeQuery.test.ts"],"names":[],"mappings":";;;AAAA,+
|
|
1
|
+
{"version":3,"file":"executeQuery.test.js","sourceRoot":"","sources":["../src/executeQuery.test.ts"],"names":[],"mappings":";;;AAAA,+CAAkF;AAClF,6CAA4C;AAG/B,QAAA,QAAQ,GAAG;IACpB,EAAE,EAAE,IAAI,yBAAW,CAAS,aAAa,CAAC;IAC1C,YAAY,EAAE,IAAI,yBAAW,CAAS,uBAAuB,CAAC;CACjE,CAAC;AAEW,QAAA,GAAG,GAAG;IACf,EAAE,EAAE,IAAI,yBAAW,CAAS,QAAQ,CAAC;IACrC,UAAU,EAAE,IAAI,yBAAW,CAAS,gBAAgB,CAAC;IACrD,KAAK,EAAE,IAAI,yBAAW,CAAU,WAAW,CAAC;CAC/C,CAAC;AAEF,IAAI,CAAC,yBAAyB,EAAE;IAC5B,MAAM,CACF,IAAA,2BAAY,EAAC;QACT,MAAM,EAAE;YACJ,QAAQ,EAAE,gBAAQ,CAAC,YAAY;YAC/B,QAAQ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