mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-03-07 23:32:15 +00:00
fix: pipeline
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -12,6 +12,9 @@ pids
|
|||||||
*.pid.lock
|
*.pid.lock
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
.angular/
|
||||||
|
www/
|
||||||
|
|
||||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||||
lib-cov
|
lib-cov
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
/**
|
/**
|
||||||
* This is the database configuration for the technical university of berlin
|
* 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 = {
|
const config = {
|
||||||
internal: {
|
internal: {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
*
|
*
|
||||||
* To get more information about the meaning of specific fields, please use your IDE to read the TSDoc documentation.
|
* 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 = {
|
const config = {
|
||||||
internal: {
|
internal: {
|
||||||
|
|||||||
3
backend/backend/src/environment.d.ts
vendored
3
backend/backend/src/environment.d.ts
vendored
@@ -1,5 +1,6 @@
|
|||||||
declare global {
|
declare global {
|
||||||
namespace NodeJS {
|
namespace NodeJS {
|
||||||
|
// eslint-disable-next-line unicorn/prevent-abbreviations
|
||||||
interface ProcessEnv {
|
interface ProcessEnv {
|
||||||
NODE_APP_INSTANCE: 'default' | 'b-tu' | 'f-u' | 'fb-fh' | 'ks-ug' | string | undefined;
|
NODE_APP_INSTANCE: 'default' | 'b-tu' | 'f-u' | 'fb-fh' | 'ks-ug' | string | undefined;
|
||||||
NODE_CONFIG_ENV: 'elasticsearch' | string | undefined;
|
NODE_CONFIG_ENV: 'elasticsearch' | string | undefined;
|
||||||
@@ -12,3 +13,5 @@ declare global {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export {};
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import {
|
|||||||
AggregationsAggregate,
|
AggregationsAggregate,
|
||||||
AggregationsFiltersAggregate,
|
AggregationsFiltersAggregate,
|
||||||
AggregationsMultiTermsBucket,
|
AggregationsMultiTermsBucket,
|
||||||
} from '@elastic/elasticsearch/lib/api/types';
|
} from '@elastic/elasticsearch/lib/api/types.js';
|
||||||
import {SCFacet, SCThingType} from '@openstapps/core';
|
import {SCFacet, SCThingType} from '@openstapps/core';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* 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 {SCBackendConfigurationSearchBoostingType} from '@openstapps/core';
|
||||||
import {QueryDslSpecificQueryContainer} from '../../types/util.js';
|
import {QueryDslSpecificQueryContainer} from '../../types/util.js';
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* 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 {SCBackendConfigurationSearchBoostingContext, SCSearchContext} from '@openstapps/core';
|
||||||
import {buildFunctionsForBoostingTypes} from './boost-functions.js';
|
import {buildFunctionsForBoostingTypes} from './boost-functions.js';
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* 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 {SCSearchFilter} from '@openstapps/core';
|
||||||
import {buildBooleanFilter} from './filters/boolean.js';
|
import {buildBooleanFilter} from './filters/boolean.js';
|
||||||
import {buildAvailabilityFilter} from './filters/availability.js';
|
import {buildAvailabilityFilter} from './filters/availability.js';
|
||||||
@@ -29,19 +29,26 @@ import {buildValueFilter} from './filters/value.js';
|
|||||||
*/
|
*/
|
||||||
export function buildFilter(filter: SCSearchFilter): QueryDslQueryContainer {
|
export function buildFilter(filter: SCSearchFilter): QueryDslQueryContainer {
|
||||||
switch (filter.type) {
|
switch (filter.type) {
|
||||||
case 'value':
|
case 'value': {
|
||||||
return buildValueFilter(filter);
|
return buildValueFilter(filter);
|
||||||
case 'availability':
|
}
|
||||||
|
case 'availability': {
|
||||||
return buildAvailabilityFilter(filter);
|
return buildAvailabilityFilter(filter);
|
||||||
case 'distance':
|
}
|
||||||
|
case 'distance': {
|
||||||
return buildDistanceFilter(filter);
|
return buildDistanceFilter(filter);
|
||||||
case 'boolean':
|
}
|
||||||
|
case 'boolean': {
|
||||||
return buildBooleanFilter(filter);
|
return buildBooleanFilter(filter);
|
||||||
case 'numeric range':
|
}
|
||||||
|
case 'numeric range': {
|
||||||
return buildNumericRangeFilter(filter);
|
return buildNumericRangeFilter(filter);
|
||||||
case 'date range':
|
}
|
||||||
|
case 'date range': {
|
||||||
return buildDateRangeFilter(filter);
|
return buildDateRangeFilter(filter);
|
||||||
case 'geo':
|
}
|
||||||
|
case 'geo': {
|
||||||
return buildGeoFilter(filter);
|
return buildGeoFilter(filter);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* 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 {SCSearchBooleanFilter} from '@openstapps/core';
|
||||||
import {QueryDslSpecificQueryContainer} from '../../types/util.js';
|
import {QueryDslSpecificQueryContainer} from '../../types/util.js';
|
||||||
import {buildFilter} from '../filter.js';
|
import {buildFilter} from '../filter.js';
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* 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 {SCSearchDateRangeFilter} from '@openstapps/core';
|
||||||
import {QueryDslSpecificQueryContainer} from '../../types/util.js';
|
import {QueryDslSpecificQueryContainer} from '../../types/util.js';
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* 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 {SCSearchDistanceFilter} from '@openstapps/core';
|
||||||
import {QueryDslSpecificQueryContainer} from '../../types/util.js';
|
import {QueryDslSpecificQueryContainer} from '../../types/util.js';
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
import {QueryDslNumberRangeQuery} from '@elastic/elasticsearch/lib/api/types.js';
|
||||||
import {QueryDslNumberRangeQuery} from '@elastic/elasticsearch/lib/api/types';
|
|
||||||
import {SCSearchNumericRangeFilter} from '@openstapps/core';
|
import {SCSearchNumericRangeFilter} from '@openstapps/core';
|
||||||
import {QueryDslSpecificQueryContainer} from '../../types/util.js';
|
import {QueryDslSpecificQueryContainer} from '../../types/util.js';
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* 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';
|
import {SCDistanceSort} from '@openstapps/core';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* 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';
|
import {SCDucetSort} from '@openstapps/core';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* 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';
|
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
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
import {QueryDslQueryContainer} from '@elastic/elasticsearch/lib/api/types.js';
|
||||||
import {QueryDslQueryContainer} from '@elastic/elasticsearch/lib/api/types';
|
|
||||||
|
|
||||||
export type QueryDslSpecificQueryContainer<T extends keyof QueryDslQueryContainer> = Required<
|
export type QueryDslSpecificQueryContainer<T extends keyof QueryDslQueryContainer> = Required<
|
||||||
Pick<QueryDslQueryContainer, T>
|
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 {buildSort} from '../../../src/storage/elasticsearch/query/sort.js';
|
||||||
import {ElasticsearchConfig} from '../../../src/storage/elasticsearch/types/elasticsearch-config.js';
|
import {ElasticsearchConfig} from '../../../src/storage/elasticsearch/types/elasticsearch-config.js';
|
||||||
import {QueryDslSpecificQueryContainer} from '../../../src/storage/elasticsearch/types/util.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';
|
import {backendConfig} from '../../../src/config.js';
|
||||||
|
|
||||||
describe('Query', function () {
|
describe('Query', function () {
|
||||||
@@ -363,8 +363,10 @@ describe('Query', function () {
|
|||||||
const filter = buildFilter(rawFilter) as QueryDslSpecificQueryContainer<'range'>;
|
const filter = buildFilter(rawFilter) as QueryDslSpecificQueryContainer<'range'>;
|
||||||
expect(filter).to.deep.equal(expectedFilter);
|
expect(filter).to.deep.equal(expectedFilter);
|
||||||
for (const bound of ['g', 'l']) {
|
for (const bound of ['g', 'l']) {
|
||||||
const inclusiveExists = typeof filter.range.price[`${bound}t`] !== 'undefined';
|
const inclusiveExists =
|
||||||
const exclusiveExists = typeof filter.range.price[`${bound}te`] !== 'undefined';
|
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
|
// only one should exist at the same time
|
||||||
expect(inclusiveExists && exclusiveExists).to.be.false;
|
expect(inclusiveExists && exclusiveExists).to.be.false;
|
||||||
|
|||||||
@@ -15,24 +15,29 @@
|
|||||||
import {Logger} from '@openstapps/logger';
|
import {Logger} from '@openstapps/logger';
|
||||||
import {Command} from 'commander';
|
import {Command} from 'commander';
|
||||||
import {readFileSync} from 'fs';
|
import {readFileSync} from 'fs';
|
||||||
import {join} from 'path';
|
import path from 'path';
|
||||||
import {executeConnector, isValidSCNamespace} from './common.js';
|
import {executeConnector, isValidSCNamespace} from './common.js';
|
||||||
import {MinimalConnector} from './minimal-connector.js';
|
import {MinimalConnector} from './minimal-connector.js';
|
||||||
|
import * as url from 'url';
|
||||||
|
|
||||||
process.on('unhandledRejection', error => {
|
process.on('unhandledRejection', error => {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
|
|
||||||
const connectorVersion = JSON.parse(readFileSync(join(__dirname, '..', 'package.json')).toString()).version;
|
const dirname = path.dirname(url.fileURLToPath(import.meta.url));
|
||||||
|
const connectorVersion = JSON.parse(
|
||||||
|
readFileSync(path.join(dirname, '..', 'package.json')).toString(),
|
||||||
|
).version;
|
||||||
|
|
||||||
const commander = new Command();
|
const commander = new Command();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Uses arguments to paramtrize the connector execution
|
* Uses arguments to parameterize the connector execution
|
||||||
*
|
*
|
||||||
* backendURL - URL of the StApps backend deployment e.g. http://localhost:3000
|
* backendURL - URL of the StApps backend deployment e.g. http://localhost:3000
|
||||||
* origin - Origin, where the data comes from. Typically the name of the connector e.g. minimal-connector
|
* origin - Origin, where the data comes from.
|
||||||
* licensePlate - The license plate of your school. Must be matched to a SCNamespace e.g. f-u
|
* Typically, the name of the connector e.g., minimal-connector licensePlate - The license plate of your school.
|
||||||
|
* Must be matched to a SCNamespace e.g., f-u
|
||||||
*/
|
*/
|
||||||
commander
|
commander
|
||||||
.command('run <backendURL> <origin> <licensePlate>')
|
.command('run <backendURL> <origin> <licensePlate>')
|
||||||
@@ -41,7 +46,7 @@ commander
|
|||||||
if (backendURL.length === 0) {
|
if (backendURL.length === 0) {
|
||||||
throw new Error('Param "backend" needs to have a length greater zero.');
|
throw new Error('Param "backend" needs to have a length greater zero.');
|
||||||
}
|
}
|
||||||
const originRegex = /^[a-z\-\_0-9]+$/;
|
const originRegex = /^[a-z\-_0-9]+$/;
|
||||||
if (!originRegex.test(origin)) {
|
if (!originRegex.test(origin)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'Origin name can only consist of lowercase letters from a-z, "-", "_" and integer numbers.',
|
'Origin name can only consist of lowercase letters from a-z, "-", "_" and integer numbers.',
|
||||||
|
|||||||
@@ -12,8 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {ConnectorClient} from '@openstapps/api/lib/connector-client.js';
|
import {ConnectorClient, HttpClient} from '@openstapps/api';
|
||||||
import {HttpClient} from '@openstapps/api/lib/http-client.js';
|
|
||||||
import {SCLicensePlate, SCNamespaces, SCThings} from '@openstapps/core';
|
import {SCLicensePlate, SCNamespaces, SCThings} from '@openstapps/core';
|
||||||
import {Connector} from './connector.js';
|
import {Connector} from './connector.js';
|
||||||
|
|
||||||
@@ -48,9 +47,6 @@ export function createUUID(itemIdentifier: unknown, licensePlate: SCLicensePlate
|
|||||||
export async function executeConnector<T extends SCThings>(backend: string, connector: Connector<T>) {
|
export async function executeConnector<T extends SCThings>(backend: string, connector: Connector<T>) {
|
||||||
const items: T[] = await connector.getItems();
|
const items: T[] = await connector.getItems();
|
||||||
const client: ConnectorClient = new ConnectorClient(new HttpClient(), backend);
|
const client: ConnectorClient = new ConnectorClient(new HttpClient(), backend);
|
||||||
try {
|
// this might throw an error!
|
||||||
await client.index<T>(items, connector.origin);
|
await client.index<T>(items, connector.origin);
|
||||||
} catch (err) {
|
|
||||||
throw err;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,16 +18,17 @@ import {createUUID} from './common.js';
|
|||||||
/**
|
/**
|
||||||
* Provides abstracted methods for the connector execution process
|
* Provides abstracted methods for the connector execution process
|
||||||
*
|
*
|
||||||
* By extending this class connector-developers only need to implement load and transform of the data
|
* By extending this class connector-developers only need to implement the load and transform of the data
|
||||||
* Pushing the data to the backend will be handled automatically
|
* Pushing the data to the backend will be handled automatically
|
||||||
*
|
*
|
||||||
* @typeparam T Any serializable type
|
* @template T Any serializable type
|
||||||
*/
|
*/
|
||||||
export abstract class Connector<T extends SCThings> {
|
export abstract class Connector<T extends SCThings> {
|
||||||
/**
|
/**
|
||||||
* License plate of the school
|
* License plate of the school
|
||||||
*/
|
*/
|
||||||
protected licensePlate: SCLicensePlate;
|
protected licensePlate: SCLicensePlate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Name of the connector
|
* Name of the connector
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ export class MinimalConnector extends Connector<SCMessage> {
|
|||||||
* Mock-up data
|
* Mock-up data
|
||||||
*/
|
*/
|
||||||
protected async fetchItems(): Promise<SCMessage[]> {
|
protected async fetchItems(): Promise<SCMessage[]> {
|
||||||
const importedItems: SCMessage[] = [
|
return [
|
||||||
{
|
{
|
||||||
audiences: ['students', 'employees'],
|
audiences: ['students', 'employees'],
|
||||||
categories: [],
|
categories: [],
|
||||||
@@ -82,7 +82,5 @@ export class MinimalConnector extends Connector<SCMessage> {
|
|||||||
uid: createUUID({id: 'message_3'}, this.licensePlate),
|
uid: createUUID({id: 'message_3'}, this.licensePlate),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
return importedItems;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {HttpClient, PluginClient} from '@openstapps/api';
|
import {HttpClient, PluginClient} from '@openstapps/api';
|
||||||
import {Converter} from '@openstapps/core-tools';
|
import {Converter} from '@openstapps/core-tools';
|
||||||
import {Logger} from '@openstapps/logger';
|
import {Logger} from '@openstapps/logger';
|
||||||
|
|||||||
@@ -32,13 +32,7 @@ export class MinimalPlugin extends Plugin {
|
|||||||
* @param numbers the list of numbers
|
* @param numbers the list of numbers
|
||||||
*/
|
*/
|
||||||
private static sum(numbers: number[]): number {
|
private static sum(numbers: number[]): number {
|
||||||
let out = 0;
|
return numbers.reduce((a, b) => a + b);
|
||||||
|
|
||||||
for (const num of numbers) {
|
|
||||||
out += num;
|
|
||||||
}
|
|
||||||
|
|
||||||
return out;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -47,13 +41,13 @@ export class MinimalPlugin extends Plugin {
|
|||||||
* For this example the whole purpose of the plugin is to receive a list of numbers and return the sum of them.
|
* For this example the whole purpose of the plugin is to receive a list of numbers and return the sum of them.
|
||||||
* TODO: remove the body of the function and replace with your own logic
|
* TODO: remove the body of the function and replace with your own logic
|
||||||
*
|
*
|
||||||
* @param req the express request object
|
* @param request the express request object
|
||||||
* @param res the express response object
|
* @param response the express response object
|
||||||
*/
|
*/
|
||||||
// tslint:disable-next-line:prefer-function-over-method
|
// tslint:disable-next-line:prefer-function-over-method
|
||||||
protected async onRouteInvoke(req: express.Request, res: express.Response): Promise<void> {
|
protected async onRouteInvoke(request: express.Request, response: express.Response): Promise<void> {
|
||||||
// get the body from the request as a SCMinimalRequest for static type-safety
|
// get the body from the request as a SCMinimalRequest for static type-safety
|
||||||
const requestBody = req.body as SCMinimalRequest;
|
const requestBody = request.body as SCMinimalRequest;
|
||||||
|
|
||||||
// create out response body
|
// create out response body
|
||||||
const responseBody: SCMinimalResponse = {
|
const responseBody: SCMinimalResponse = {
|
||||||
@@ -61,6 +55,6 @@ export class MinimalPlugin extends Plugin {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// send the response
|
// send the response
|
||||||
res.json(responseBody);
|
response.json(responseBody);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,5 @@
|
|||||||
<<<<<<<< HEAD:packages/es-mapping-generator/test/mapping-model/aggregations/src/types.ts
|
|
||||||
/*
|
|
||||||
* Copyright (C) 2020 StApps
|
|
||||||
========
|
|
||||||
/*!
|
/*!
|
||||||
* Copyright (C) 2023 StApps
|
* Copyright (C) 2023 StApps
|
||||||
>>>>>>>> app/develop:frontend/app/src/app/modules/about/about-licenses.scss
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -17,18 +12,6 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
<<<<<<<< HEAD:packages/es-mapping-generator/test/mapping-model/aggregations/src/types.ts
|
|
||||||
export enum ThingType {
|
|
||||||
AggArray = 'agg array',
|
|
||||||
AggGlobal = 'agg global',
|
|
||||||
AggGlobalNested = 'agg global nested',
|
|
||||||
AggNested = 'agg nested',
|
|
||||||
AggInherited = 'agg inherited',
|
|
||||||
AggInheritedGlobal = 'agg inherited global',
|
|
||||||
AggInheritedOverwritten = 'agg inherited overwritten',
|
|
||||||
}
|
|
||||||
========
|
|
||||||
ion-content > div {
|
ion-content > div {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
@@ -52,4 +35,3 @@ cdk-virtual-scroll-viewport {
|
|||||||
vertical-align: text-top;
|
vertical-align: text-top;
|
||||||
height: 14px;
|
height: 14px;
|
||||||
}
|
}
|
||||||
>>>>>>>> app/develop:frontend/app/src/app/modules/about/about-licenses.scss
|
|
||||||
|
|||||||
@@ -12,35 +12,9 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
<<<<<<<< HEAD:frontend/app/src/app/modules/data/list/data-list-item.scss
|
|
||||||
:host {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
ion-item::part(native) {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ion-text-wrap ::ng-deep ion-label {
|
|
||||||
white-space: normal !important;
|
|
||||||
display: -webkit-box;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
-webkit-line-clamp: 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
ion-item {
|
|
||||||
--border-color: transparent;
|
|
||||||
@include border-radius-in-parallax(var(--border-radius-default));
|
|
||||||
overflow: hidden;
|
|
||||||
--inner-padding-end: 0;
|
|
||||||
--padding-start: var(--spacing-sm);
|
|
||||||
margin: var(--spacing-sm);
|
|
||||||
========
|
|
||||||
simple-swiper {
|
simple-swiper {
|
||||||
--swiper-slide-width: 256px;
|
--swiper-slide-width: 256px;
|
||||||
}
|
}
|
||||||
>>>>>>>> app/develop:frontend/app/src/app/modules/dashboard/sections/news-section/news-section.component.scss
|
|
||||||
|
|
||||||
.more-news {
|
.more-news {
|
||||||
font-size: var(--font-size-xl);
|
font-size: var(--font-size-xl);
|
||||||
|
|||||||
@@ -12,9 +12,6 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
<<<<<<<< HEAD:frontend/app/src/app/modules/settings/item/settings-item.scss
|
|
||||||
========
|
|
||||||
|
|
||||||
ion-list {
|
ion-list {
|
||||||
background: none;
|
background: none;
|
||||||
}
|
}
|
||||||
@@ -22,4 +19,3 @@ ion-list {
|
|||||||
skeleton-list {
|
skeleton-list {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
>>>>>>>> app/develop:frontend/app/src/app/modules/data/list/data-list.scss
|
|
||||||
|
|||||||
@@ -1,10 +1,5 @@
|
|||||||
<<<<<<<< HEAD:examples/minimal-plugin/src/common.ts
|
|
||||||
/*
|
|
||||||
* Copyright (C) 2019 StApps
|
|
||||||
========
|
|
||||||
/*!
|
/*!
|
||||||
* Copyright (C) 2023 StApps
|
* Copyright (C) 2023 StApps
|
||||||
>>>>>>>> app/develop:frontend/app/src/app/modules/settings/item/settings-item.scss
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -17,8 +12,3 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
<<<<<<<< HEAD:examples/minimal-plugin/src/common.ts
|
|
||||||
|
|
||||||
// TODO: place commonly used values here
|
|
||||||
========
|
|
||||||
>>>>>>>> app/develop:frontend/app/src/app/modules/settings/item/settings-item.scss
|
|
||||||
|
|||||||
@@ -2,17 +2,17 @@
|
|||||||
"name": "@openstapps/openstapps",
|
"name": "@openstapps/openstapps",
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "dotenv -c -- turbo run build",
|
"build": "dotenv -c -- turbo run build --filter=!@openstapps/app",
|
||||||
"dev": "dotenv -c -- turbo run dev",
|
"dev": "dotenv -c -- turbo run dev",
|
||||||
"docs": "typedoc",
|
"docs": "typedoc",
|
||||||
"format": "dotenv -c -- turbo run format",
|
"format": "dotenv -c -- turbo run format",
|
||||||
"format:fix": "dotenv -c -- turbo run format:fix",
|
"format:fix": "dotenv -c -- turbo run format:fix",
|
||||||
"lint": "dotenv -c -- turbo run lint",
|
"lint": "dotenv -c -- turbo run lint --filter=!@openstapps/app",
|
||||||
"lint:fix": "dotenv -c -- turbo run lint:fix",
|
"lint:fix": "dotenv -c -- turbo run lint:fix --filter=!@openstapps/app",
|
||||||
"publish-packages": "dotenv -c -- turbo run build format lint test && changeset version && changeset publish",
|
"publish-packages": "dotenv -c -- turbo run build format lint test && changeset version && changeset publish",
|
||||||
"syncpack": "syncpack list-mismatches && syncpack lint-semver-ranges",
|
"syncpack": "syncpack list-mismatches && syncpack lint-semver-ranges",
|
||||||
"syncpack:fix": "syncpack format && syncpack fix-mismatches",
|
"syncpack:fix": "syncpack format && syncpack fix-mismatches",
|
||||||
"test": "dotenv -c -- turbo run test && node coverage.mjs"
|
"test": "dotenv -c -- turbo run test --filter=!@openstapps/app && node coverage.mjs"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@changesets/cli": "2.26.1",
|
"@changesets/cli": "2.26.1",
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
{
|
{
|
||||||
"extends": "@openstapps"
|
"extends": "@openstapps",
|
||||||
|
"rules": {
|
||||||
|
"no-console": "off",
|
||||||
|
"unicorn/no-negated-condition": "off",
|
||||||
|
"unicorn/no-null": "off",
|
||||||
|
"jsdoc/check-tag-names": "off"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user