@stamhoofd/sql 2.82.0 → 2.83.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,9 +1,9 @@
|
|
|
1
1
|
import { PlainObject } from '@simonbackx/simple-encoding';
|
|
2
2
|
import { SortDefinition, SortList } from '@stamhoofd/structures';
|
|
3
|
+
import { SQLExpression } from '../SQLExpression';
|
|
4
|
+
import { SQLJoin } from '../SQLJoin';
|
|
3
5
|
import { SQLOrderBy, SQLOrderByDirection } from '../SQLOrderBy';
|
|
4
6
|
import { SQLSelect } from '../SQLSelect';
|
|
5
|
-
import { SQLJoin } from '../SQLJoin';
|
|
6
|
-
import { SQLExpression } from '../SQLExpression';
|
|
7
7
|
export type SQLSortDefinition<T, B extends PlainObject | Date = PlainObject | Date> = SortDefinition<T, B> & {
|
|
8
8
|
toSQL(direction: SQLOrderByDirection): SQLOrderBy;
|
|
9
9
|
join?: SQLJoin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SQLSorter.d.ts","sourceRoot":"","sources":["../../../src/filters/SQLSorter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"SQLSorter.d.ts","sourceRoot":"","sources":["../../../src/filters/SQLSorter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,MAAM,iBAAiB,CAAC,CAAC,EAAE,CAAC,SAAS,WAAW,GAAG,IAAI,GAAG,WAAW,GAAG,IAAI,IAAI,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;IACzG,KAAK,CAAC,SAAS,EAAE,mBAAmB,GAAG,UAAU,CAAC;IAClD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,CAAC,aAAa,GAAG,MAAM,CAAC,EAAE,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,CAAC,GAAG,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;AAE/E,wBAAgB,cAAc,CAAC,WAAW,EAAE,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,kBAAkB,QA0C5G"}
|
|
@@ -27,7 +27,7 @@ function applySQLSorter(selectQuery, sortBy, definitions) {
|
|
|
27
27
|
throw new simple_errors_1.SimpleError({
|
|
28
28
|
code: 'sorter_join_overlap',
|
|
29
29
|
message: 'This combination of sorters is not possible',
|
|
30
|
-
human: '
|
|
30
|
+
human: $t('e328a7c2-318c-4425-b61a-61e6f4211707'),
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SQLSorter.js","sourceRoot":"","sources":["../../../src/filters/SQLSorter.ts"],"names":[],"mappings":";;AAiBA,wCA0CC;
|
|
1
|
+
{"version":3,"file":"SQLSorter.js","sourceRoot":"","sources":["../../../src/filters/SQLSorter.ts"],"names":[],"mappings":";;AAiBA,wCA0CC;AAxDD,6DAAwD;AAcxD,SAAgB,cAAc,CAAC,WAA2B,EAAE,MAAgB,EAAE,WAA+B;IACzG,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,2BAAW,CAA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AAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC;QACpC,CAAC;IACL,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stamhoofd/sql",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.83.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"license": "UNLICENCED",
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
"publishConfig": {
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
|
-
"gitHead": "
|
|
18
|
+
"gitHead": "5f116184aad8965d9deda1902e73af7feefa5721"
|
|
19
19
|
}
|
package/src/filters/SQLSorter.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { PlainObject } from '@simonbackx/simple-encoding';
|
|
2
2
|
import { SortDefinition, SortList } from '@stamhoofd/structures';
|
|
3
3
|
|
|
4
|
-
import { SQLOrderBy, SQLOrderByDirection } from '../SQLOrderBy';
|
|
5
4
|
import { SimpleError } from '@simonbackx/simple-errors';
|
|
6
|
-
import { SQLSelect } from '../SQLSelect';
|
|
7
|
-
import { SQLJoin } from '../SQLJoin';
|
|
8
5
|
import { SQLExpression } from '../SQLExpression';
|
|
6
|
+
import { SQLJoin } from '../SQLJoin';
|
|
7
|
+
import { SQLOrderBy, SQLOrderByDirection } from '../SQLOrderBy';
|
|
8
|
+
import { SQLSelect } from '../SQLSelect';
|
|
9
9
|
|
|
10
10
|
export type SQLSortDefinition<T, B extends PlainObject | Date = PlainObject | Date> = SortDefinition<T, B> & {
|
|
11
11
|
toSQL(direction: SQLOrderByDirection): SQLOrderBy;
|
|
@@ -44,7 +44,7 @@ export function applySQLSorter(selectQuery: SQLSelect<any>, sortBy: SortList, de
|
|
|
44
44
|
throw new SimpleError({
|
|
45
45
|
code: 'sorter_join_overlap',
|
|
46
46
|
message: 'This combination of sorters is not possible',
|
|
47
|
-
human: '
|
|
47
|
+
human: $t('e328a7c2-318c-4425-b61a-61e6f4211707'),
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
}
|