mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 09:03:02 +00:00
fix: pipeline
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* This is the database configuration for the technical university of berlin
|
||||
*
|
||||
* @type {import('@openstapps/logger').RecursivePartial<import('../../src/storage/elasticsearch/types/elasticsearch.js').ElasticsearchConfigFile>}
|
||||
* @type {import('@openstapps/logger').RecursivePartial<import('../../src/storage/elasticsearch/types/elasticsearch-config.js').ElasticsearchConfigFile>}
|
||||
*/
|
||||
const config = {
|
||||
internal: {
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*
|
||||
* To get more information about the meaning of specific fields, please use your IDE to read the TSDoc documentation.
|
||||
*
|
||||
* @type {import('../../src/storage/elasticsearch/types/elasticsearch.js')}
|
||||
* @type {import('../../src/storage/elasticsearch/types/elasticsearch-config.js')}
|
||||
*/
|
||||
const config = {
|
||||
internal: {
|
||||
|
||||
3
backend/backend/src/environment.d.ts
vendored
3
backend/backend/src/environment.d.ts
vendored
@@ -1,5 +1,6 @@
|
||||
declare global {
|
||||
namespace NodeJS {
|
||||
// eslint-disable-next-line unicorn/prevent-abbreviations
|
||||
interface ProcessEnv {
|
||||
NODE_APP_INSTANCE: 'default' | 'b-tu' | 'f-u' | 'fb-fh' | 'ks-ug' | string | undefined;
|
||||
NODE_CONFIG_ENV: 'elasticsearch' | string | undefined;
|
||||
@@ -12,3 +13,5 @@ declare global {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export {};
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
AggregationsAggregate,
|
||||
AggregationsFiltersAggregate,
|
||||
AggregationsMultiTermsBucket,
|
||||
} from '@elastic/elasticsearch/lib/api/types';
|
||||
} from '@elastic/elasticsearch/lib/api/types.js';
|
||||
import {SCFacet, SCThingType} from '@openstapps/core';
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {QueryDslFunctionScoreContainer} from '@elastic/elasticsearch/lib/api/types';
|
||||
import {QueryDslFunctionScoreContainer} from '@elastic/elasticsearch/lib/api/types.js';
|
||||
import {SCBackendConfigurationSearchBoostingType} from '@openstapps/core';
|
||||
import {QueryDslSpecificQueryContainer} from '../../types/util.js';
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {QueryDslFunctionScoreContainer} from '@elastic/elasticsearch/lib/api/types';
|
||||
import {QueryDslFunctionScoreContainer} from '@elastic/elasticsearch/lib/api/types.js';
|
||||
import {SCBackendConfigurationSearchBoostingContext, SCSearchContext} from '@openstapps/core';
|
||||
import {buildFunctionsForBoostingTypes} from './boost-functions.js';
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {QueryDslQueryContainer} from '@elastic/elasticsearch/lib/api/types';
|
||||
import {QueryDslQueryContainer} from '@elastic/elasticsearch/lib/api/types.js';
|
||||
import {SCSearchFilter} from '@openstapps/core';
|
||||
import {buildBooleanFilter} from './filters/boolean.js';
|
||||
import {buildAvailabilityFilter} from './filters/availability.js';
|
||||
@@ -29,19 +29,26 @@ import {buildValueFilter} from './filters/value.js';
|
||||
*/
|
||||
export function buildFilter(filter: SCSearchFilter): QueryDslQueryContainer {
|
||||
switch (filter.type) {
|
||||
case 'value':
|
||||
case 'value': {
|
||||
return buildValueFilter(filter);
|
||||
case 'availability':
|
||||
}
|
||||
case 'availability': {
|
||||
return buildAvailabilityFilter(filter);
|
||||
case 'distance':
|
||||
}
|
||||
case 'distance': {
|
||||
return buildDistanceFilter(filter);
|
||||
case 'boolean':
|
||||
}
|
||||
case 'boolean': {
|
||||
return buildBooleanFilter(filter);
|
||||
case 'numeric range':
|
||||
}
|
||||
case 'numeric range': {
|
||||
return buildNumericRangeFilter(filter);
|
||||
case 'date range':
|
||||
}
|
||||
case 'date range': {
|
||||
return buildDateRangeFilter(filter);
|
||||
case 'geo':
|
||||
}
|
||||
case 'geo': {
|
||||
return buildGeoFilter(filter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {QueryDslBoolQuery} from '@elastic/elasticsearch/lib/api/types';
|
||||
import {QueryDslBoolQuery} from '@elastic/elasticsearch/lib/api/types.js';
|
||||
import {SCSearchBooleanFilter} from '@openstapps/core';
|
||||
import {QueryDslSpecificQueryContainer} from '../../types/util.js';
|
||||
import {buildFilter} from '../filter.js';
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {QueryDslDateRangeQuery} from '@elastic/elasticsearch/lib/api/types';
|
||||
import {QueryDslDateRangeQuery} from '@elastic/elasticsearch/lib/api/types.js';
|
||||
import {SCSearchDateRangeFilter} from '@openstapps/core';
|
||||
import {QueryDslSpecificQueryContainer} from '../../types/util.js';
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {QueryDslGeoDistanceQuery} from '@elastic/elasticsearch/lib/api/types';
|
||||
import {QueryDslGeoDistanceQuery} from '@elastic/elasticsearch/lib/api/types.js';
|
||||
import {SCSearchDistanceFilter} from '@openstapps/core';
|
||||
import {QueryDslSpecificQueryContainer} from '../../types/util.js';
|
||||
|
||||
|
||||
@@ -12,8 +12,7 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {QueryDslNumberRangeQuery} from '@elastic/elasticsearch/lib/api/types';
|
||||
import {QueryDslNumberRangeQuery} from '@elastic/elasticsearch/lib/api/types.js';
|
||||
import {SCSearchNumericRangeFilter} from '@openstapps/core';
|
||||
import {QueryDslSpecificQueryContainer} from '../../types/util.js';
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SortOptions} from '@elastic/elasticsearch/lib/api/types';
|
||||
import {SortOptions} from '@elastic/elasticsearch/lib/api/types.js';
|
||||
import {SCDistanceSort} from '@openstapps/core';
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SortOptions} from '@elastic/elasticsearch/lib/api/types';
|
||||
import {SortOptions} from '@elastic/elasticsearch/lib/api/types.js';
|
||||
import {SCDucetSort} from '@openstapps/core';
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SortOptions} from '@elastic/elasticsearch/lib/api/types';
|
||||
import {SortOptions} from '@elastic/elasticsearch/lib/api/types.js';
|
||||
import {SCPriceSort, SCSportCoursePriceGroup, SCThingsField} from '@openstapps/core';
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,8 +12,7 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {QueryDslQueryContainer} from '@elastic/elasticsearch/lib/api/types';
|
||||
import {QueryDslQueryContainer} from '@elastic/elasticsearch/lib/api/types.js';
|
||||
|
||||
export type QueryDslSpecificQueryContainer<T extends keyof QueryDslQueryContainer> = Required<
|
||||
Pick<QueryDslQueryContainer, T>
|
||||
|
||||
@@ -31,7 +31,7 @@ import {buildQuery} from '../../../src/storage/elasticsearch/query/query.js';
|
||||
import {buildSort} from '../../../src/storage/elasticsearch/query/sort.js';
|
||||
import {ElasticsearchConfig} from '../../../src/storage/elasticsearch/types/elasticsearch-config.js';
|
||||
import {QueryDslSpecificQueryContainer} from '../../../src/storage/elasticsearch/types/util.js';
|
||||
import {SortCombinations} from '@elastic/elasticsearch/lib/api/types.js';
|
||||
import {QueryDslRangeQuery, SortCombinations} from '@elastic/elasticsearch/lib/api/types.js';
|
||||
import {backendConfig} from '../../../src/config.js';
|
||||
|
||||
describe('Query', function () {
|
||||
@@ -363,8 +363,10 @@ describe('Query', function () {
|
||||
const filter = buildFilter(rawFilter) as QueryDslSpecificQueryContainer<'range'>;
|
||||
expect(filter).to.deep.equal(expectedFilter);
|
||||
for (const bound of ['g', 'l']) {
|
||||
const inclusiveExists = typeof filter.range.price[`${bound}t`] !== 'undefined';
|
||||
const exclusiveExists = typeof filter.range.price[`${bound}te`] !== 'undefined';
|
||||
const inclusiveExists =
|
||||
typeof filter.range.price?.[`${bound}t` as keyof QueryDslRangeQuery] !== 'undefined';
|
||||
const exclusiveExists =
|
||||
typeof filter.range.price?.[`${bound}te` as keyof QueryDslRangeQuery] !== 'undefined';
|
||||
|
||||
// only one should exist at the same time
|
||||
expect(inclusiveExists && exclusiveExists).to.be.false;
|
||||
|
||||
Reference in New Issue
Block a user