mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2025-12-20 21:26:19 +00:00
Compare commits
56 Commits
@openstapp
...
@openstapp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f2e1a6ddd5 | ||
|
|
ccacfbf710 | ||
|
|
b249b329f7 | ||
|
|
7afc24f1bc | ||
|
|
7276525dfa | ||
|
|
c9e881582f | ||
|
|
df681de083 | ||
| 802a7a3fa7 | |||
|
|
343d03e647 | ||
| 727b92911e | |||
| 11bc987807 | |||
|
|
b8faae5988 | ||
| 67ab1fd613 | |||
|
|
142079bf0e | ||
|
|
5050ac90eb | ||
|
|
688bc5f2e7 | ||
|
|
ad174dd7d7 | ||
|
|
26e654f5b8 | ||
|
|
5439484a90 | ||
|
|
68f3366a27 | ||
|
|
dea9a82105 | ||
|
39d2801114
|
|||
|
|
341b209092 | ||
|
|
a6b88d3534 | ||
|
|
be863daaef | ||
| 2f64d69693 | |||
| 964516d3cf | |||
| 71ff9fd960 | |||
| abf9999461 | |||
| 53c3d0ba0c | |||
|
|
622481a3c9 | ||
|
|
1ab5c0c355 | ||
|
|
b0f6ffb21c | ||
|
|
e658cff9d2 | ||
|
|
e71355a2fb | ||
| 100607740b | |||
|
|
10c4466b37 | ||
|
|
09faa66e98 | ||
|
|
7c5687111f | ||
|
|
c066028e49 | ||
| 0858a26dc1 | |||
| 8667603bd6 | |||
| 65bc9a76b6 | |||
| 912ae42270 | |||
| c4a5d6e73b | |||
| deed376c24 | |||
| a4cc23e9a8 | |||
| e8d72683ef | |||
|
|
e3d068f8d4 | ||
|
|
b346d216a3 | ||
| dbb558508f | |||
|
|
754d99c1b4 | ||
|
|
689ac68be3 | ||
|
|
d36d9596fc | ||
|
|
8d50f669e7 | ||
|
|
dce08d9c03 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -24,6 +24,7 @@ report-junit.xml
|
|||||||
# NixOS flake
|
# NixOS flake
|
||||||
result
|
result
|
||||||
hsperfdata_root
|
hsperfdata_root
|
||||||
|
.direnv/
|
||||||
|
|
||||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||||
lib-cov
|
lib-cov
|
||||||
|
|||||||
@@ -2,7 +2,13 @@
|
|||||||
|
|
||||||
/** @type {import('syncpack').RcFile} */
|
/** @type {import('syncpack').RcFile} */
|
||||||
const config = {
|
const config = {
|
||||||
semverRange: '',
|
semverGroups: [
|
||||||
|
{
|
||||||
|
range: '',
|
||||||
|
dependencies: ['**'],
|
||||||
|
packages: ['**'],
|
||||||
|
}
|
||||||
|
],
|
||||||
source: ['package.json', '**/package.json'],
|
source: ['package.json', '**/package.json'],
|
||||||
indent: ' ',
|
indent: ' ',
|
||||||
sortFirst: [
|
sortFirst: [
|
||||||
@@ -49,7 +55,7 @@ const config = {
|
|||||||
{
|
{
|
||||||
label: 'Packages should use workspace version',
|
label: 'Packages should use workspace version',
|
||||||
dependencies: ['@openstapps/**'],
|
dependencies: ['@openstapps/**'],
|
||||||
dependencyTypes: ['prod', 'dev'],
|
dependencyTypes: ['prod', 'dev', 'peer'],
|
||||||
packages: ['**'],
|
packages: ['**'],
|
||||||
pinVersion: 'workspace:*',
|
pinVersion: 'workspace:*',
|
||||||
},
|
},
|
||||||
|
|||||||
3
.tool-versions
Normal file
3
.tool-versions
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
nodejs 18.19.1
|
||||||
|
pnpm 8.15.4
|
||||||
|
python 3.11.5
|
||||||
@@ -1,5 +1,46 @@
|
|||||||
# @openstapps/backend
|
# @openstapps/backend
|
||||||
|
|
||||||
|
## 3.3.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @openstapps/core@3.3.2
|
||||||
|
- @openstapps/core-tools@3.3.2
|
||||||
|
|
||||||
|
## 3.3.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 67ab1fd6: fix for geo.point mapping
|
||||||
|
|
||||||
|
## 3.3.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- 688bc5f2: v3.3.0 changes
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [688bc5f2]
|
||||||
|
- @openstapps/core@3.3.0
|
||||||
|
- @openstapps/core-tools@3.3.0
|
||||||
|
- @openstapps/logger@3.0.0
|
||||||
|
|
||||||
|
## 3.2.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- 912ae422: Add the ability to filter by existence of a field
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 689ac68b: pin alpine version to 3.18 and add healthchecks
|
||||||
|
- e8d72683: Backend unit tests break every year
|
||||||
|
- Updated dependencies [912ae422]
|
||||||
|
- @openstapps/core@4.0.0
|
||||||
|
- @openstapps/core-tools@3.0.0
|
||||||
|
- @openstapps/logger@3.0.0
|
||||||
|
|
||||||
## 3.1.2
|
## 3.1.2
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -9,4 +9,6 @@ ENV NODE_ENV=production
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
HEALTHCHECK --interval=10s --timeout=10s --start-period=10s --retries=12 CMD curl -s --fail --request POST --data '{}' --header 'Content-Type: application/json' http://localhost:3000/ >/dev/null || exit 1
|
||||||
|
|
||||||
ENTRYPOINT ["node", "app.js"]
|
ENTRYPOINT ["node", "app.js"]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
// @ts-check
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the database configuration for the technical university of berlin
|
* This is the database configuration for the technical university of berlin
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// @ts-check
|
|
||||||
import {SCSettingInputType, SCThingOriginType, SCThingType} from '@openstapps/core';
|
import {SCSettingInputType, SCThingOriginType, SCThingType} from '@openstapps/core';
|
||||||
|
|
||||||
/** @type {import('@openstapps/core').SCLanguageSetting} */
|
/** @type {import('@openstapps/core').SCLanguageSetting} */
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// @ts-check
|
|
||||||
/** @type {import('@openstapps/core').SCAppConfigurationMenuCategory[]} */
|
/** @type {import('@openstapps/core').SCAppConfigurationMenuCategory[]} */
|
||||||
const menus = [
|
const menus = [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// @ts-check
|
|
||||||
import {SCSettingInputType, SCThingOriginType, SCThingType} from '@openstapps/core';
|
import {SCSettingInputType, SCThingOriginType, SCThingType} from '@openstapps/core';
|
||||||
|
|
||||||
/** @type {import('@openstapps/core').SCUserGroupSetting} */
|
/** @type {import('@openstapps/core').SCUserGroupSetting} */
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// @ts-check
|
|
||||||
import {SCThingType} from '@openstapps/core';
|
import {SCThingType} from '@openstapps/core';
|
||||||
|
|
||||||
/** @type {import('@openstapps/core').SCBackendAggregationConfiguration[]} */
|
/** @type {import('@openstapps/core').SCBackendAggregationConfiguration[]} */
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// @ts-check
|
|
||||||
import {
|
import {
|
||||||
month,
|
month,
|
||||||
sommerRange,
|
sommerRange,
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// @ts-check
|
|
||||||
import {SCThingType} from '@openstapps/core';
|
import {SCThingType} from '@openstapps/core';
|
||||||
import aggregations from './aggregations.js';
|
import aggregations from './aggregations.js';
|
||||||
import boostings from './boostings.js';
|
import boostings from './boostings.js';
|
||||||
@@ -17,7 +16,7 @@ export const backend = {
|
|||||||
hiddenTypes: [SCThingType.DateSeries, SCThingType.Diff, SCThingType.Floor],
|
hiddenTypes: [SCThingType.DateSeries, SCThingType.Diff, SCThingType.Floor],
|
||||||
mappingIgnoredTags: ['minlength', 'pattern', 'see', 'tjs-format'],
|
mappingIgnoredTags: ['minlength', 'pattern', 'see', 'tjs-format'],
|
||||||
maxMultiSearchRouteQueries: 5,
|
maxMultiSearchRouteQueries: 5,
|
||||||
maxRequestBodySize: 2 * 10 ** 6,
|
maxRequestBodySize: 2e6,
|
||||||
name: 'Goethe-Universität Frankfurt am Main',
|
name: 'Goethe-Universität Frankfurt am Main',
|
||||||
namespace: '909a8cbc-8520-456c-b474-ef1525f14209',
|
namespace: '909a8cbc-8520-456c-b474-ef1525f14209',
|
||||||
sortableFields: [
|
sortableFields: [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// @ts-check
|
|
||||||
import app from './app/index.js';
|
import app from './app/index.js';
|
||||||
import {backend, internal} from './backend/index.js';
|
import {backend, internal} from './backend/index.js';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
// @ts-check
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the default configuration for elasticsearch (a database)
|
* This is the default configuration for elasticsearch (a database)
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// @ts-check
|
|
||||||
import {readFile} from 'fs/promises';
|
import {readFile} from 'fs/promises';
|
||||||
import {SCAboutPageContentType} from '@openstapps/core';
|
import {SCAboutPageContentType} from '@openstapps/core';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// @ts-check
|
|
||||||
/**
|
/**
|
||||||
* Generates a range of numbers that represent consecutive calendar months
|
* Generates a range of numbers that represent consecutive calendar months
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// @ts-check
|
|
||||||
import {readFile, readdir} from 'fs/promises';
|
import {readFile, readdir} from 'fs/promises';
|
||||||
import url from 'url';
|
import url from 'url';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// @ts-check
|
|
||||||
import {SCAboutPageContentType} from '@openstapps/core';
|
import {SCAboutPageContentType} from '@openstapps/core';
|
||||||
import {markdown} from '../../default/tools/markdown.js';
|
import {markdown} from '../../default/tools/markdown.js';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// @ts-check
|
|
||||||
import {SCAboutPageContentType} from '@openstapps/core';
|
import {SCAboutPageContentType} from '@openstapps/core';
|
||||||
|
|
||||||
/** @type {import('@openstapps/core').SCAboutPage} */
|
/** @type {import('@openstapps/core').SCAboutPage} */
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// @ts-check
|
|
||||||
import about from './about.js';
|
import about from './about.js';
|
||||||
import imprint from './imprint.js';
|
import imprint from './imprint.js';
|
||||||
import privacy from './privacy.js';
|
import privacy from './privacy.js';
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// @ts-check
|
|
||||||
import {markdown} from '../../default/tools/markdown.js';
|
import {markdown} from '../../default/tools/markdown.js';
|
||||||
|
|
||||||
/** @type {import('@openstapps/core').SCAboutPage} */
|
/** @type {import('@openstapps/core').SCAboutPage} */
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// @ts-check
|
|
||||||
import aboutPages from './about-pages/index.js';
|
import aboutPages from './about-pages/index.js';
|
||||||
import defaultApp from '../default/app/index.js';
|
import defaultApp from '../default/app/index.js';
|
||||||
import {backend as defaultBackend, internal as defaultInternal} from '../default/backend/index.js';
|
import {backend as defaultBackend, internal as defaultInternal} from '../default/backend/index.js';
|
||||||
|
|||||||
15
backend/backend/config/f-u/version-history/2.5.0.de.md
Normal file
15
backend/backend/config/f-u/version-history/2.5.0.de.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# Goethe-Uni App 2.5
|
||||||
|
|
||||||
|
Die Goethe-Uni App ist noch besser geworden!
|
||||||
|
|
||||||
|
## Komplett neue Kartenansicht
|
||||||
|
|
||||||
|
Wir haben die Karte überarbeitet, um eine klarere und schnellere Übersicht zu bieten.
|
||||||
|
|
||||||
|
## Deutschlandticket mit an Bord
|
||||||
|
|
||||||
|
Wenn du das Upgrade des Semesterticket zum Deutschlandticket gemacht hast und eingeloggt bist, findet es sich jetzt auch in der App.
|
||||||
|
|
||||||
|
## Bibliotheksdienste sind wieder voll funktionsfähig
|
||||||
|
|
||||||
|
Aufgrund einiger Adhoc-Änderungen im Bibliothekssystem haben wir die App so angepasst, dass sie damit umgehen kann.
|
||||||
15
backend/backend/config/f-u/version-history/2.5.0.en.md
Normal file
15
backend/backend/config/f-u/version-history/2.5.0.en.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# Goethe-Uni App 2.5
|
||||||
|
|
||||||
|
The Goethe-Uni App got even better!
|
||||||
|
|
||||||
|
## Completely new map view
|
||||||
|
|
||||||
|
We overhauled the map to offer you a clearer and faster and overview.
|
||||||
|
|
||||||
|
## Deutschlandticket included
|
||||||
|
|
||||||
|
If you upgraded your Semesterticket to a Deutschlandticket it will now reside in the App if you are logged in.
|
||||||
|
|
||||||
|
## Library services are fully functional again
|
||||||
|
|
||||||
|
Due to some adhoc changes in the library system we adjusted the app to handle them properly.
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
// @ts-check
|
|
||||||
import {versions} from '../../default/tools/version.js';
|
import {versions} from '../../default/tools/version.js';
|
||||||
|
|
||||||
/** @type {import('@openstapps/core').SCAppVersionInfo[]} */
|
/** @type {import('@openstapps/core').SCAppVersionInfo[]} */
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@openstapps/backend",
|
"name": "@openstapps/backend",
|
||||||
"description": "A reference implementation for a StApps backend",
|
"description": "A reference implementation for a StApps backend",
|
||||||
"version": "3.1.2",
|
"version": "3.3.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"license": "AGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
"express-prom-bundle": "6.6.0",
|
"express-prom-bundle": "6.6.0",
|
||||||
"express-promise-router": "4.1.1",
|
"express-promise-router": "4.1.1",
|
||||||
"got": "12.6.0",
|
"got": "12.6.0",
|
||||||
"moment": "2.29.4",
|
"moment": "2.30.1",
|
||||||
"morgan": "1.10.0",
|
"morgan": "1.10.0",
|
||||||
"nock": "13.3.1",
|
"nock": "13.3.1",
|
||||||
"node-cache": "5.1.2",
|
"node-cache": "5.1.2",
|
||||||
@@ -98,9 +98,9 @@
|
|||||||
"sinon": "15.0.4",
|
"sinon": "15.0.4",
|
||||||
"sinon-express-mock": "2.2.1",
|
"sinon-express-mock": "2.2.1",
|
||||||
"supertest": "6.3.3",
|
"supertest": "6.3.3",
|
||||||
"ts-node": "10.9.1",
|
"ts-node": "10.9.2",
|
||||||
"tsup": "6.7.0",
|
"tsup": "6.7.0",
|
||||||
"typescript": "5.1.6"
|
"typescript": "5.4.2"
|
||||||
},
|
},
|
||||||
"tsup": {
|
"tsup": {
|
||||||
"entry": [
|
"entry": [
|
||||||
|
|||||||
@@ -13,15 +13,34 @@
|
|||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {SCConfigFile, SCSearchQuery, SCSearchResponse, SCThings, SCUuid} from '@openstapps/core';
|
import {
|
||||||
|
SCConfigFile,
|
||||||
|
SCPlace,
|
||||||
|
SCPlaceWithoutReferences,
|
||||||
|
SCSearchQuery,
|
||||||
|
SCSearchResponse,
|
||||||
|
SCThingWithCategoriesWithoutReferences,
|
||||||
|
SCThings,
|
||||||
|
SCUuid,
|
||||||
|
} from '@openstapps/core';
|
||||||
import {MailQueue} from '../notification/mail-queue.js';
|
import {MailQueue} from '../notification/mail-queue.js';
|
||||||
import {Bulk} from './bulk-storage.js';
|
import {Bulk} from './bulk-storage.js';
|
||||||
|
import {FeatureCollection, Point, Polygon} from 'geojson';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an instance of a database
|
* Creates an instance of a database
|
||||||
*/
|
*/
|
||||||
export type DatabaseConstructor = new (config: SCConfigFile, mailQueue?: MailQueue) => Database;
|
export type DatabaseConstructor = new (config: SCConfigFile, mailQueue?: MailQueue) => Database;
|
||||||
|
|
||||||
|
export type SupplementaryGeoJSON = FeatureCollection<Point | Polygon, SupplementaryGeoJSONThing>;
|
||||||
|
export type SupplementaryGeoJSONThing = Pick<
|
||||||
|
Extract<SCThings, SCPlace>,
|
||||||
|
Exclude<
|
||||||
|
keyof SCPlaceWithoutReferences | keyof SCThingWithCategoriesWithoutReferences<never, never>,
|
||||||
|
'geo' | 'origin' | 'translations'
|
||||||
|
>
|
||||||
|
>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines what one database class needs to have defined
|
* Defines what one database class needs to have defined
|
||||||
*/
|
*/
|
||||||
@@ -82,4 +101,9 @@ export interface Database {
|
|||||||
* @param params Parameters which form a search query to search the backend data
|
* @param params Parameters which form a search query to search the backend data
|
||||||
*/
|
*/
|
||||||
search(parameters: SCSearchQuery): Promise<SCSearchResponse>;
|
search(parameters: SCSearchQuery): Promise<SCSearchResponse>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get geo info for display on a map
|
||||||
|
*/
|
||||||
|
geo(): Promise<SupplementaryGeoJSON>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import {Logger} from '@openstapps/logger';
|
|||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import {MailQueue} from '../../notification/mail-queue.js';
|
import {MailQueue} from '../../notification/mail-queue.js';
|
||||||
import {Bulk} from '../bulk-storage.js';
|
import {Bulk} from '../bulk-storage.js';
|
||||||
import {Database} from '../database.js';
|
import {Database, SupplementaryGeoJSON, SupplementaryGeoJSONThing} from '../database.js';
|
||||||
import {parseAggregations} from './aggregations.js';
|
import {parseAggregations} from './aggregations.js';
|
||||||
import * as Monitoring from './monitoring.js';
|
import * as Monitoring from './monitoring.js';
|
||||||
import {buildQuery} from './query/query.js';
|
import {buildQuery} from './query/query.js';
|
||||||
@@ -46,6 +46,7 @@ import {
|
|||||||
} from './util/index.js';
|
} from './util/index.js';
|
||||||
import {noUndefined} from './util/no-undefined.js';
|
import {noUndefined} from './util/no-undefined.js';
|
||||||
import {retryCatch, RetryOptions} from './util/retry.js';
|
import {retryCatch, RetryOptions} from './util/retry.js';
|
||||||
|
import {Feature, Point, Polygon} from 'geojson';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A database interface for elasticsearch
|
* A database interface for elasticsearch
|
||||||
@@ -405,4 +406,49 @@ export class Elasticsearch implements Database {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async geo(): Promise<SupplementaryGeoJSON> {
|
||||||
|
const searchResponse = await this.client.search<Extract<SCThings, {geo: unknown}>>({
|
||||||
|
body: {
|
||||||
|
query: {
|
||||||
|
exists: {
|
||||||
|
field: 'geo',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
from: 0,
|
||||||
|
allow_no_indices: true,
|
||||||
|
index: ACTIVE_INDICES_ALIAS,
|
||||||
|
size: 1,
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
type: 'FeatureCollection',
|
||||||
|
features: searchResponse.hits.hits
|
||||||
|
.map(thing => {
|
||||||
|
return thing._source?.geo
|
||||||
|
? ({
|
||||||
|
id: Number(thing._source.identifiers?.['OSM']) || undefined,
|
||||||
|
type: 'Feature',
|
||||||
|
geometry: thing._source.geo.polygon ?? thing._source.geo.point,
|
||||||
|
properties: {
|
||||||
|
name: thing._source.name,
|
||||||
|
sameAs: thing._source.sameAs,
|
||||||
|
image: thing._source.image,
|
||||||
|
alternateNames: thing._source.alternateNames,
|
||||||
|
description: thing._source.description,
|
||||||
|
identifiers: thing._source.identifiers,
|
||||||
|
categories: thing._source.categories,
|
||||||
|
categorySpecificValues: thing._source.categorySpecificValues,
|
||||||
|
openingHours: thing._source.openingHours,
|
||||||
|
address: thing._source.address,
|
||||||
|
uid: thing._source.uid,
|
||||||
|
type: thing._source.type,
|
||||||
|
},
|
||||||
|
} satisfies Feature<Polygon | Point, SupplementaryGeoJSONThing>)
|
||||||
|
: undefined;
|
||||||
|
})
|
||||||
|
.filter(noUndefined),
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export function buildDistanceFilter(
|
|||||||
): QueryDslSpecificQueryContainer<'geo_distance'> {
|
): QueryDslSpecificQueryContainer<'geo_distance'> {
|
||||||
const geoObject: QueryDslGeoDistanceQuery = {
|
const geoObject: QueryDslGeoDistanceQuery = {
|
||||||
distance: `${filter.arguments.distance}m`,
|
distance: `${filter.arguments.distance}m`,
|
||||||
[`${filter.arguments.field}.point.coordinates`]: {
|
[`${filter.arguments.field}.point`]: {
|
||||||
lat: filter.arguments.position[1],
|
lat: filter.arguments.position[1],
|
||||||
lon: filter.arguments.position[0],
|
lon: filter.arguments.position[0],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -19,14 +19,29 @@ import {QueryDslSpecificQueryContainer} from '../../types/util.js';
|
|||||||
* Converts a geo filter to elasticsearch syntax
|
* Converts a geo filter to elasticsearch syntax
|
||||||
* @param filter A search filter for the retrieval of the data
|
* @param filter A search filter for the retrieval of the data
|
||||||
*/
|
*/
|
||||||
export function buildGeoFilter(filter: SCGeoFilter): QueryDslSpecificQueryContainer<'geo_shape'> {
|
export function buildGeoFilter(filter: SCGeoFilter): QueryDslSpecificQueryContainer<'bool'> {
|
||||||
return {
|
return {
|
||||||
geo_shape: {
|
bool: {
|
||||||
ignore_unmapped: true,
|
should: [
|
||||||
[`${filter.arguments.field}.polygon`]: {
|
{
|
||||||
shape: filter.arguments.shape,
|
geo_shape: {
|
||||||
relation: filter.arguments.spatialRelation,
|
ignore_unmapped: true,
|
||||||
},
|
[`${filter.arguments.field}.polygon`]: {
|
||||||
|
shape: filter.arguments.shape,
|
||||||
|
relation: filter.arguments.spatialRelation,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
} satisfies QueryDslSpecificQueryContainer<'geo_shape'>,
|
||||||
|
{
|
||||||
|
geo_shape: {
|
||||||
|
ignore_unmapped: true,
|
||||||
|
[`${filter.arguments.field}.point`]: {
|
||||||
|
shape: filter.arguments.shape,
|
||||||
|
relation: filter.arguments.spatialRelation,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
} satisfies QueryDslSpecificQueryContainer<'geo_shape'>,
|
||||||
|
],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,16 +21,31 @@ import {QueryDslSpecificQueryContainer} from '../../types/util.js';
|
|||||||
*/
|
*/
|
||||||
export function buildValueFilter(
|
export function buildValueFilter(
|
||||||
filter: SCSearchValueFilter,
|
filter: SCSearchValueFilter,
|
||||||
): QueryDslSpecificQueryContainer<'term'> | QueryDslSpecificQueryContainer<'terms'> {
|
):
|
||||||
return Array.isArray(filter.arguments.value)
|
| QueryDslSpecificQueryContainer<'exists'>
|
||||||
? {
|
| QueryDslSpecificQueryContainer<'term'>
|
||||||
terms: {
|
| QueryDslSpecificQueryContainer<'terms'> {
|
||||||
[`${filter.arguments.field}.raw`]: filter.arguments.value,
|
switch (typeof filter.arguments.value) {
|
||||||
|
case 'undefined': {
|
||||||
|
return {
|
||||||
|
exists: {
|
||||||
|
field: filter.arguments.field,
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
: {
|
}
|
||||||
|
case 'string': {
|
||||||
|
return {
|
||||||
term: {
|
term: {
|
||||||
[`${filter.arguments.field}.raw`]: filter.arguments.value,
|
[`${filter.arguments.field}.raw`]: filter.arguments.value,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
case 'object': {
|
||||||
|
return {
|
||||||
|
terms: {
|
||||||
|
[`${filter.arguments.field}.raw`]: filter.arguments.value,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export function buildDistanceSort(sort: SCDistanceSort): SortOptions {
|
|||||||
mode: 'avg',
|
mode: 'avg',
|
||||||
order: sort.order,
|
order: sort.order,
|
||||||
unit: 'm',
|
unit: 'm',
|
||||||
[`${sort.arguments.field}.point.coordinates`]: {
|
[`${sort.arguments.field}.point`]: {
|
||||||
lat: sort.arguments.position[1],
|
lat: sort.arguments.position[1],
|
||||||
lon: sort.arguments.position[0],
|
lon: sort.arguments.position[0],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import http from 'http';
|
|||||||
import {MailQueue} from '../src/notification/mail-queue.js';
|
import {MailQueue} from '../src/notification/mail-queue.js';
|
||||||
import {Bulk, BulkStorage} from '../src/storage/bulk-storage.js';
|
import {Bulk, BulkStorage} from '../src/storage/bulk-storage.js';
|
||||||
import getPort from 'get-port';
|
import getPort from 'get-port';
|
||||||
import {Database} from '../src/storage/database.js';
|
import {Database, SupplementaryGeoJSON} from '../src/storage/database.js';
|
||||||
import {v4} from 'uuid';
|
import {v4} from 'uuid';
|
||||||
import {backendConfig} from '../src/config.js';
|
import {backendConfig} from '../src/config.js';
|
||||||
import {getIndexUID} from '../src/storage/elasticsearch/util/index.js';
|
import {getIndexUID} from '../src/storage/elasticsearch/util/index.js';
|
||||||
@@ -58,7 +58,6 @@ export async function startApp(): Promise<Express> {
|
|||||||
* An elasticsearch mock
|
* An elasticsearch mock
|
||||||
*/
|
*/
|
||||||
export class ElasticsearchMock implements Database {
|
export class ElasticsearchMock implements Database {
|
||||||
// @ts-expect-error never read
|
|
||||||
private bulk: Bulk | undefined;
|
private bulk: Bulk | undefined;
|
||||||
|
|
||||||
private storageMock = new Map<string, SCThings>();
|
private storageMock = new Map<string, SCThings>();
|
||||||
@@ -67,6 +66,10 @@ export class ElasticsearchMock implements Database {
|
|||||||
// Nothing to do here
|
// Nothing to do here
|
||||||
}
|
}
|
||||||
|
|
||||||
|
geo(): Promise<SupplementaryGeoJSON> {
|
||||||
|
throw new Error('Method not implemented.');
|
||||||
|
}
|
||||||
|
|
||||||
bulkCreated(bulk: Bulk): Promise<void> {
|
bulkCreated(bulk: Bulk): Promise<void> {
|
||||||
this.bulk = bulk;
|
this.bulk = bulk;
|
||||||
return Promise.resolve(undefined);
|
return Promise.resolve(undefined);
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {
|
import {
|
||||||
|
SCBook,
|
||||||
SCBulkAddRoute,
|
SCBulkAddRoute,
|
||||||
SCBulkDoneRoute,
|
SCBulkDoneRoute,
|
||||||
SCBulkRequest,
|
SCBulkRequest,
|
||||||
@@ -23,29 +24,30 @@ import {
|
|||||||
import {expect} from 'chai';
|
import {expect} from 'chai';
|
||||||
import {bulk, DEFAULT_TEST_TIMEOUT} from '../common.js';
|
import {bulk, DEFAULT_TEST_TIMEOUT} from '../common.js';
|
||||||
import {testApp} from '../tests-setup.js';
|
import {testApp} from '../tests-setup.js';
|
||||||
import {readFile} from 'fs/promises';
|
|
||||||
import {v4} from 'uuid';
|
import {v4} from 'uuid';
|
||||||
|
import bookFile from '@openstapps/core/test/resources/indexable/Book.2.json' assert {type: 'json'};
|
||||||
|
|
||||||
const book = JSON.parse(
|
const book = bookFile.instance as SCBook;
|
||||||
await readFile('node_modules/@openstapps/core/test/resources/indexable/Book.2.json', 'utf8'),
|
|
||||||
).instance;
|
|
||||||
|
|
||||||
describe('Bulk routes', async function () {
|
describe('Bulk routes', async function () {
|
||||||
// increase timeout for the suite
|
// increase timeout for the suite
|
||||||
this.timeout(DEFAULT_TEST_TIMEOUT);
|
this.timeout(DEFAULT_TEST_TIMEOUT);
|
||||||
|
|
||||||
const request: SCBulkRequest = {
|
let request: SCBulkRequest;
|
||||||
expiration: bulk.expiration,
|
let bulkRoute: SCBulkRoute;
|
||||||
source: bulk.source,
|
let bulkAddRoute: SCBulkAddRoute;
|
||||||
type: bulk.type,
|
let bulkDoneRoute: SCBulkDoneRoute;
|
||||||
};
|
|
||||||
const bulkRoute = new SCBulkRoute();
|
|
||||||
const bulkAddRoute = new SCBulkAddRoute();
|
|
||||||
const bulkDoneRoute = new SCBulkDoneRoute();
|
|
||||||
|
|
||||||
// afterEach(async function() {
|
before(function () {
|
||||||
// TODO: Delete saved bulks
|
request = {
|
||||||
// });
|
expiration: bulk.expiration,
|
||||||
|
source: bulk.source,
|
||||||
|
type: bulk.type,
|
||||||
|
};
|
||||||
|
bulkRoute = new SCBulkRoute();
|
||||||
|
bulkAddRoute = new SCBulkAddRoute();
|
||||||
|
bulkDoneRoute = new SCBulkDoneRoute();
|
||||||
|
});
|
||||||
|
|
||||||
it('should create bulk', async function () {
|
it('should create bulk', async function () {
|
||||||
const {status, body, error} = await testApp
|
const {status, body, error} = await testApp
|
||||||
|
|||||||
@@ -21,7 +21,12 @@ import {expect} from 'chai';
|
|||||||
describe('Index route', async function () {
|
describe('Index route', async function () {
|
||||||
// increase timeout for the suite
|
// increase timeout for the suite
|
||||||
this.timeout(DEFAULT_TEST_TIMEOUT);
|
this.timeout(DEFAULT_TEST_TIMEOUT);
|
||||||
const indexRoute = new SCIndexRoute();
|
|
||||||
|
let indexRoute: SCIndexRoute;
|
||||||
|
|
||||||
|
before(function () {
|
||||||
|
indexRoute = new SCIndexRoute();
|
||||||
|
});
|
||||||
|
|
||||||
it('should respond with both app and backend configuration', async function () {
|
it('should respond with both app and backend configuration', async function () {
|
||||||
const request: SCIndexRequest = {};
|
const request: SCIndexRequest = {};
|
||||||
|
|||||||
@@ -30,15 +30,11 @@ import chaiAsPromised from 'chai-as-promised';
|
|||||||
import {DEFAULT_TEST_TIMEOUT} from '../common.js';
|
import {DEFAULT_TEST_TIMEOUT} from '../common.js';
|
||||||
import {testApp} from '../tests-setup.js';
|
import {testApp} from '../tests-setup.js';
|
||||||
import {backendConfig} from '../../src/config.js';
|
import {backendConfig} from '../../src/config.js';
|
||||||
import {readFile} from 'fs/promises';
|
import registerRequest from '@openstapps/core/test/resources/PluginRegisterRequest.1.json' assert {type: 'json'};
|
||||||
|
|
||||||
// for using promises in expectations (to.eventually.be...)
|
// for using promises in expectations (to.eventually.be...)
|
||||||
use(chaiAsPromised);
|
use(chaiAsPromised);
|
||||||
|
|
||||||
const registerRequest = JSON.parse(
|
|
||||||
await readFile('node_modules/@openstapps/core/test/resources/PluginRegisterRequest.1.json', 'utf8'),
|
|
||||||
);
|
|
||||||
|
|
||||||
// cast it because of "TS2322: Type 'string' is not assignable to type '"add"'"
|
// cast it because of "TS2322: Type 'string' is not assignable to type '"add"'"
|
||||||
export const registerAddRequest: SCPluginAdd = registerRequest.instance as SCPluginAdd;
|
export const registerAddRequest: SCPluginAdd = registerRequest.instance as SCPluginAdd;
|
||||||
|
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ describe('Create route', async function () {
|
|||||||
const statusCodeSuccess = 222;
|
const statusCodeSuccess = 222;
|
||||||
const bodySuccess = {foo: true};
|
const bodySuccess = {foo: true};
|
||||||
const sandbox = sinon.createSandbox();
|
const sandbox = sinon.createSandbox();
|
||||||
const validationError = new SCValidationErrorResponse([]);
|
let validationError: SCValidationErrorResponse;
|
||||||
const internalServerError = new SCInternalServerErrorResponse();
|
let internalServerError: SCInternalServerErrorResponse;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
app = express();
|
app = express();
|
||||||
@@ -64,6 +64,9 @@ describe('Create route', async function () {
|
|||||||
handler = (_request, _app) => {
|
handler = (_request, _app) => {
|
||||||
return Promise.resolve(bodySuccess);
|
return Promise.resolve(bodySuccess);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
validationError = new SCValidationErrorResponse([]);
|
||||||
|
internalServerError = new SCInternalServerErrorResponse();
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function () {
|
afterEach(function () {
|
||||||
|
|||||||
@@ -29,14 +29,21 @@ import {backendConfig} from '../../src/config.js';
|
|||||||
describe('Search route', async function () {
|
describe('Search route', async function () {
|
||||||
// increase timeout for the suite
|
// increase timeout for the suite
|
||||||
this.timeout(DEFAULT_TEST_TIMEOUT);
|
this.timeout(DEFAULT_TEST_TIMEOUT);
|
||||||
const searchRoute = new SCSearchRoute();
|
let searchRoute: SCSearchRoute;
|
||||||
const multiSearchRoute = new SCMultiSearchRoute();
|
let multiSearchRoute: SCMultiSearchRoute;
|
||||||
const syntaxError = new SCSyntaxErrorResponse('Foo Message');
|
let syntaxError: SCSyntaxErrorResponse;
|
||||||
const methodNotAllowedError = new SCMethodNotAllowedErrorResponse();
|
let methodNotAllowedError: SCMethodNotAllowedErrorResponse;
|
||||||
const tooManyRequestsError = new SCTooManyRequestsErrorResponse();
|
let tooManyRequestsError: SCTooManyRequestsErrorResponse;
|
||||||
|
|
||||||
|
before(function () {
|
||||||
|
searchRoute = new SCSearchRoute();
|
||||||
|
multiSearchRoute = new SCMultiSearchRoute();
|
||||||
|
syntaxError = new SCSyntaxErrorResponse('Foo Message');
|
||||||
|
methodNotAllowedError = new SCMethodNotAllowedErrorResponse();
|
||||||
|
tooManyRequestsError = new SCTooManyRequestsErrorResponse();
|
||||||
|
});
|
||||||
|
|
||||||
it('should reject GET, PUT with a valid search query', async function () {
|
it('should reject GET, PUT with a valid search query', async function () {
|
||||||
// const expectedParams = JSON.parse(JSON.stringify(defaultParams));
|
|
||||||
const {status} = await testApp.get('/search').set('Accept', 'application/json').send({
|
const {status} = await testApp.get('/search').set('Accept', 'application/json').send({
|
||||||
query: 'Some search terms',
|
query: 'Some search terms',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -13,23 +13,25 @@
|
|||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {SCThingUpdateRoute} from '@openstapps/core';
|
import {SCBook, SCThingUpdateRoute} from '@openstapps/core';
|
||||||
import chaiAsPromised from 'chai-as-promised';
|
import chaiAsPromised from 'chai-as-promised';
|
||||||
import {bulkStorageMock, DEFAULT_TEST_TIMEOUT} from '../common.js';
|
import {bulkStorageMock, DEFAULT_TEST_TIMEOUT} from '../common.js';
|
||||||
import {expect, use} from 'chai';
|
import {expect, use} from 'chai';
|
||||||
import {testApp} from '../tests-setup.js';
|
import {testApp} from '../tests-setup.js';
|
||||||
import {readFile} from 'fs/promises';
|
import bookFile from '@openstapps/core/test/resources/indexable/Book.1.json' assert {type: 'json'};
|
||||||
|
|
||||||
use(chaiAsPromised);
|
use(chaiAsPromised);
|
||||||
|
|
||||||
const book = JSON.parse(
|
const book = bookFile.instance as SCBook;
|
||||||
await readFile('node_modules/@openstapps/core/test/resources/indexable/Book.1.json', 'utf8'),
|
|
||||||
).instance;
|
|
||||||
|
|
||||||
describe('Thing update route', async function () {
|
describe('Thing update route', async function () {
|
||||||
// increase timeout for the suite
|
// increase timeout for the suite
|
||||||
this.timeout(DEFAULT_TEST_TIMEOUT);
|
this.timeout(DEFAULT_TEST_TIMEOUT);
|
||||||
const thingUpdateRoute = new SCThingUpdateRoute();
|
let thingUpdateRoute: SCThingUpdateRoute;
|
||||||
|
|
||||||
|
before(function () {
|
||||||
|
thingUpdateRoute = new SCThingUpdateRoute();
|
||||||
|
});
|
||||||
|
|
||||||
it('should update a thing', async function () {
|
it('should update a thing', async function () {
|
||||||
const thingUpdateRouteurlPath = thingUpdateRoute.urlPath
|
const thingUpdateRouteurlPath = thingUpdateRoute.urlPath
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ import {Elasticsearch} from '../../../src/storage/elasticsearch/elasticsearch.js
|
|||||||
import {bulk, DEFAULT_TEST_TIMEOUT, getTransport, getIndex} from '../../common.js';
|
import {bulk, DEFAULT_TEST_TIMEOUT, getTransport, getIndex} from '../../common.js';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import {backendConfig} from '../../../src/config.js';
|
import {backendConfig} from '../../../src/config.js';
|
||||||
import {readFile} from 'fs/promises';
|
|
||||||
import {
|
import {
|
||||||
ACTIVE_INDICES_ALIAS,
|
ACTIVE_INDICES_ALIAS,
|
||||||
getIndexUID,
|
getIndexUID,
|
||||||
@@ -50,6 +49,11 @@ import {
|
|||||||
} from '../../../src/storage/elasticsearch/util/index.js';
|
} from '../../../src/storage/elasticsearch/util/index.js';
|
||||||
import cron from 'node-cron';
|
import cron from 'node-cron';
|
||||||
import {query} from './query.js';
|
import {query} from './query.js';
|
||||||
|
import messageFile from '@openstapps/core/test/resources/indexable/Message.1.json' assert {type: 'json'};
|
||||||
|
import bookFile from '@openstapps/core/test/resources/indexable/Book.1.json' assert {type: 'json'};
|
||||||
|
|
||||||
|
const message = messageFile.instance as SCMessage;
|
||||||
|
const book = bookFile.instance as SCBook;
|
||||||
|
|
||||||
use(chaiAsPromised);
|
use(chaiAsPromised);
|
||||||
|
|
||||||
@@ -60,13 +64,6 @@ function searchResponse<T>(...hits: SearchHit<T>[]): SearchResponse<T> {
|
|||||||
return {hits: {hits}, took: 0, timed_out: false, _shards: {total: 1, failed: 0, successful: 1}};
|
return {hits: {hits}, took: 0, timed_out: false, _shards: {total: 1, failed: 0, successful: 1}};
|
||||||
}
|
}
|
||||||
|
|
||||||
const message = JSON.parse(
|
|
||||||
await readFile('node_modules/@openstapps/core/test/resources/indexable/Message.1.json', 'utf8'),
|
|
||||||
);
|
|
||||||
const book = JSON.parse(
|
|
||||||
await readFile('node_modules/@openstapps/core/test/resources/indexable/Book.1.json', 'utf8'),
|
|
||||||
);
|
|
||||||
|
|
||||||
describe('Elasticsearch', function () {
|
describe('Elasticsearch', function () {
|
||||||
// increase timeout for the suite
|
// increase timeout for the suite
|
||||||
this.timeout(DEFAULT_TEST_TIMEOUT);
|
this.timeout(DEFAULT_TEST_TIMEOUT);
|
||||||
@@ -74,8 +71,15 @@ describe('Elasticsearch', function () {
|
|||||||
|
|
||||||
before(function () {
|
before(function () {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log('before');
|
|
||||||
sandbox.stub(fs, 'readFileSync').returns('{}');
|
sandbox.stub(fs, 'readFileSync').returns('{}');
|
||||||
|
sandbox.stub(backendConfig.internal.boostings.default[0], 'fields').value({
|
||||||
|
'academicTerms.acronym': {
|
||||||
|
'SS 2023': 1.05,
|
||||||
|
'WS 2023/24': 1.1,
|
||||||
|
'SoSe 2023': 1.05,
|
||||||
|
'WiSe 2023/24': 1.1,
|
||||||
|
},
|
||||||
|
});
|
||||||
});
|
});
|
||||||
after(function () {
|
after(function () {
|
||||||
sandbox.restore();
|
sandbox.restore();
|
||||||
@@ -445,7 +449,7 @@ describe('Elasticsearch', function () {
|
|||||||
_id: '',
|
_id: '',
|
||||||
_index: '',
|
_index: '',
|
||||||
_score: 0,
|
_score: 0,
|
||||||
_source: message as SCMessage,
|
_source: message,
|
||||||
};
|
};
|
||||||
sandbox.stub(es.client, 'search').resolves(searchResponse(foundObject));
|
sandbox.stub(es.client, 'search').resolves(searchResponse(foundObject));
|
||||||
|
|
||||||
@@ -475,7 +479,7 @@ describe('Elasticsearch', function () {
|
|||||||
const object: SearchHit<SCMessage> = {
|
const object: SearchHit<SCMessage> = {
|
||||||
_id: '',
|
_id: '',
|
||||||
_index: oldIndex,
|
_index: oldIndex,
|
||||||
_source: message as SCMessage,
|
_source: message,
|
||||||
};
|
};
|
||||||
sandbox.stub(es.client, 'search').resolves(searchResponse<SCMessage>(object));
|
sandbox.stub(es.client, 'search').resolves(searchResponse<SCMessage>(object));
|
||||||
sandbox.stub(es, 'prepareBulkWrite').resolves(index);
|
sandbox.stub(es, 'prepareBulkWrite').resolves(index);
|
||||||
@@ -489,7 +493,7 @@ describe('Elasticsearch', function () {
|
|||||||
sandbox.stub(es.client, 'create').resolves({result: 'not_found'} as CreateResponse);
|
sandbox.stub(es.client, 'create').resolves({result: 'not_found'} as CreateResponse);
|
||||||
|
|
||||||
await es.init();
|
await es.init();
|
||||||
return expect(es.post(message as SCMessage, bulk)).to.rejectedWith('creation');
|
return expect(es.post(message, bulk)).to.rejectedWith('creation');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create a new object', async function () {
|
it('should create a new object', async function () {
|
||||||
@@ -502,7 +506,7 @@ describe('Elasticsearch', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
await es.init();
|
await es.init();
|
||||||
await es.post(message as SCMessage, bulk);
|
await es.post(message, bulk);
|
||||||
|
|
||||||
expect(createStub.called).to.be.true;
|
expect(createStub.called).to.be.true;
|
||||||
expect(caughtParameter.document).to.be.eql({
|
expect(caughtParameter.document).to.be.eql({
|
||||||
@@ -527,7 +531,7 @@ describe('Elasticsearch', function () {
|
|||||||
_id: '',
|
_id: '',
|
||||||
_index: getIndex(),
|
_index: getIndex(),
|
||||||
_score: 0,
|
_score: 0,
|
||||||
_source: message as SCMessage,
|
_source: message,
|
||||||
};
|
};
|
||||||
sandbox.stub(es.client, 'search').resolves(searchResponse());
|
sandbox.stub(es.client, 'search').resolves(searchResponse());
|
||||||
|
|
||||||
@@ -541,7 +545,7 @@ describe('Elasticsearch', function () {
|
|||||||
_id: '',
|
_id: '',
|
||||||
_index: getIndex(),
|
_index: getIndex(),
|
||||||
_score: 0,
|
_score: 0,
|
||||||
_source: message as SCMessage,
|
_source: message,
|
||||||
};
|
};
|
||||||
sandbox.stub(es.client, 'search').resolves(searchResponse(object));
|
sandbox.stub(es.client, 'search').resolves(searchResponse(object));
|
||||||
// @ts-expect-error unused
|
// @ts-expect-error unused
|
||||||
@@ -564,13 +568,13 @@ describe('Elasticsearch', function () {
|
|||||||
_id: '123',
|
_id: '123',
|
||||||
_index: getIndex(),
|
_index: getIndex(),
|
||||||
_score: 0,
|
_score: 0,
|
||||||
_source: message as SCMessage,
|
_source: message,
|
||||||
};
|
};
|
||||||
const objectBook: SearchHit<SCBook> = {
|
const objectBook: SearchHit<SCBook> = {
|
||||||
_id: '321',
|
_id: '321',
|
||||||
_index: getIndex(),
|
_index: getIndex(),
|
||||||
_score: 0,
|
_score: 0,
|
||||||
_source: book as SCBook,
|
_source: book,
|
||||||
};
|
};
|
||||||
const fakeEsAggregations = {
|
const fakeEsAggregations = {
|
||||||
'@all': {
|
'@all': {
|
||||||
|
|||||||
@@ -466,7 +466,7 @@ describe('Query', function () {
|
|||||||
const expectedFilter: QueryDslSpecificQueryContainer<'geo_distance'> = {
|
const expectedFilter: QueryDslSpecificQueryContainer<'geo_distance'> = {
|
||||||
geo_distance: {
|
geo_distance: {
|
||||||
'distance': '1000m',
|
'distance': '1000m',
|
||||||
'geo.point.coordinates': {
|
'geo.point': {
|
||||||
lat: 8.123,
|
lat: 8.123,
|
||||||
lon: 50.123,
|
lon: 50.123,
|
||||||
},
|
},
|
||||||
@@ -479,18 +479,39 @@ describe('Query', function () {
|
|||||||
it('should build geo filter for shapes and points', function () {
|
it('should build geo filter for shapes and points', function () {
|
||||||
const filter = buildFilter(searchFilters.geoPoint);
|
const filter = buildFilter(searchFilters.geoPoint);
|
||||||
const expectedFilter = {
|
const expectedFilter = {
|
||||||
geo_shape: {
|
bool: {
|
||||||
'geo.polygon': {
|
should: [
|
||||||
relation: undefined,
|
{
|
||||||
shape: {
|
geo_shape: {
|
||||||
type: 'envelope',
|
'geo.polygon': {
|
||||||
coordinates: [
|
relation: undefined,
|
||||||
[50.123, 8.123],
|
shape: {
|
||||||
[50.123, 8.123],
|
coordinates: [
|
||||||
],
|
[50.123, 8.123],
|
||||||
|
[50.123, 8.123],
|
||||||
|
],
|
||||||
|
type: 'envelope',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'ignore_unmapped': true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
'ignore_unmapped': true,
|
geo_shape: {
|
||||||
|
'geo.point': {
|
||||||
|
relation: undefined,
|
||||||
|
shape: {
|
||||||
|
coordinates: [
|
||||||
|
[50.123, 8.123],
|
||||||
|
[50.123, 8.123],
|
||||||
|
],
|
||||||
|
type: 'envelope',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'ignore_unmapped': true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -500,18 +521,39 @@ describe('Query', function () {
|
|||||||
it('should build geo filter for shapes only', function () {
|
it('should build geo filter for shapes only', function () {
|
||||||
const filter = buildFilter(searchFilters.geoShape);
|
const filter = buildFilter(searchFilters.geoShape);
|
||||||
const expectedFilter = {
|
const expectedFilter = {
|
||||||
geo_shape: {
|
bool: {
|
||||||
'geo.polygon': {
|
should: [
|
||||||
relation: 'contains',
|
{
|
||||||
shape: {
|
geo_shape: {
|
||||||
type: 'envelope',
|
'geo.polygon': {
|
||||||
coordinates: [
|
relation: 'contains',
|
||||||
[50.123, 8.123],
|
shape: {
|
||||||
[50.123, 8.123],
|
coordinates: [
|
||||||
],
|
[50.123, 8.123],
|
||||||
|
[50.123, 8.123],
|
||||||
|
],
|
||||||
|
type: 'envelope',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'ignore_unmapped': true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
'ignore_unmapped': true,
|
geo_shape: {
|
||||||
|
'geo.point': {
|
||||||
|
relation: 'contains',
|
||||||
|
shape: {
|
||||||
|
coordinates: [
|
||||||
|
[50.123, 8.123],
|
||||||
|
[50.123, 8.123],
|
||||||
|
],
|
||||||
|
type: 'envelope',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'ignore_unmapped': true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -594,7 +636,7 @@ describe('Query', function () {
|
|||||||
'mode': 'avg',
|
'mode': 'avg',
|
||||||
'order': 'desc',
|
'order': 'desc',
|
||||||
'unit': 'm',
|
'unit': 'm',
|
||||||
'geo.point.coordinates': {
|
'geo.point': {
|
||||||
lat: 50.123,
|
lat: 50.123,
|
||||||
lon: 8.123,
|
lon: 8.123,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,9 +2,7 @@
|
|||||||
"extends": "@openstapps/tsconfig",
|
"extends": "@openstapps/tsconfig",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"useUnknownInCatchVariables": false,
|
"useUnknownInCatchVariables": false
|
||||||
"allowJs": true,
|
|
||||||
"checkJs": true
|
|
||||||
},
|
},
|
||||||
"exclude": ["app.js", "lib/"]
|
"exclude": ["lib", "app.js"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# @openstapps/database
|
# @openstapps/database
|
||||||
|
|
||||||
|
## 3.2.0
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 689ac68b: pin alpine version to 3.18 and add healthchecks
|
||||||
|
|
||||||
## 3.0.0
|
## 3.0.0
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -14,4 +14,6 @@ RUN chown elasticsearch:elasticsearch config/elasticsearch.yml
|
|||||||
|
|
||||||
USER elasticsearch
|
USER elasticsearch
|
||||||
|
|
||||||
|
HEALTHCHECK --interval=10s --timeout=10s --start-period=60s --retries=12 CMD curl --fail -s http://localhost:9200/ >/dev/null || exit 1
|
||||||
|
|
||||||
CMD ["/usr/share/elasticsearch/bin/elasticsearch"]
|
CMD ["/usr/share/elasticsearch/bin/elasticsearch"]
|
||||||
|
|||||||
@@ -3,3 +3,4 @@ discovery.type: "single-node"
|
|||||||
cluster.routing.allocation.disk.threshold_enabled: false
|
cluster.routing.allocation.disk.threshold_enabled: false
|
||||||
network.bind_host: 0.0.0.0
|
network.bind_host: 0.0.0.0
|
||||||
xpack.security.enabled: false
|
xpack.security.enabled: false
|
||||||
|
ingest.geoip.downloader.enabled: false
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@openstapps/database",
|
"name": "@openstapps/database",
|
||||||
"version": "3.0.0",
|
"version": "3.2.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"files": [
|
"files": [
|
||||||
"config",
|
"config",
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
// ESM is not supported, and cts is not detected, so we use type-checked cjs instead.
|
// ESM is not supported, and cts is not detected, so we use type-checked cjs instead.
|
||||||
/** @type {import('../src/common').ConfigFile} */
|
/** @type {import('../src/common').ConfigFile} */
|
||||||
const configFile = {
|
module.exports = {
|
||||||
activeVersions: ['1\\.0\\.\\d+', '2\\.0\\.\\d+'],
|
activeVersions: ['1\\.0\\.\\d+', '2\\.0\\.\\d+'],
|
||||||
hiddenRoutes: ['/bulk'],
|
hiddenRoutes: ['/bulk'],
|
||||||
logFormat: 'default',
|
logFormat: 'default',
|
||||||
@@ -31,5 +31,3 @@ const configFile = {
|
|||||||
dhparam: '/etc/nginx/certs/dhparam.pem',
|
dhparam: '/etc/nginx/certs/dhparam.pem',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default configFile;
|
|
||||||
|
|||||||
@@ -50,8 +50,8 @@
|
|||||||
"dockerode": "3.3.5",
|
"dockerode": "3.3.5",
|
||||||
"is-cidr": "4.0.2",
|
"is-cidr": "4.0.2",
|
||||||
"mustache": "4.2.0",
|
"mustache": "4.2.0",
|
||||||
"semver": "7.5.4",
|
"semver": "7.6.0",
|
||||||
"typescript": "5.1.6"
|
"typescript": "5.4.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@openstapps/api-cli": "workspace:*",
|
"@openstapps/api-cli": "workspace:*",
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
"@types/mustache": "4.2.2",
|
"@types/mustache": "4.2.2",
|
||||||
"@types/node": "18.15.3",
|
"@types/node": "18.15.3",
|
||||||
"@types/proxyquire": "1.3.28",
|
"@types/proxyquire": "1.3.28",
|
||||||
"@types/semver": "7.5.6",
|
"@types/semver": "7.5.8",
|
||||||
"@types/sha1": "1.1.3",
|
"@types/sha1": "1.1.3",
|
||||||
"@types/sinon": "10.0.14",
|
"@types/sinon": "10.0.14",
|
||||||
"@types/sinon-chai": "3.2.9",
|
"@types/sinon-chai": "3.2.9",
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
"mocha-junit-reporter": "2.2.0",
|
"mocha-junit-reporter": "2.2.0",
|
||||||
"sinon": "15.0.4",
|
"sinon": "15.0.4",
|
||||||
"sinon-chai": "3.7.0",
|
"sinon-chai": "3.7.0",
|
||||||
"ts-node": "10.9.1",
|
"ts-node": "10.9.2",
|
||||||
"tsup": "6.7.0"
|
"tsup": "6.7.0"
|
||||||
},
|
},
|
||||||
"tsup": {
|
"tsup": {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"extends": "@openstapps/tsconfig",
|
"extends": "@openstapps/tsconfig",
|
||||||
"exclude": ["./config/", "./lib/"]
|
"exclude": ["config", "lib", "app.js"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// @ts-check
|
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const path = require("node:path");
|
const path = require("node:path");
|
||||||
const child_process = require("child_process");
|
const child_process = require("child_process");
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// @ts-check
|
|
||||||
"use strict"
|
"use strict"
|
||||||
|
|
||||||
const rule = require('./copyright-header-rule')
|
const rule = require('./copyright-header-rule')
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
// @ts-check
|
|
||||||
|
|
||||||
/** @type {import('eslint').Linter.Config} */
|
/** @type {import('eslint').Linter.Config} */
|
||||||
const config = {
|
const config = {
|
||||||
root: true,
|
root: true,
|
||||||
|
|||||||
@@ -18,16 +18,15 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@openstapps/tsconfig": "workspace:*",
|
"@openstapps/tsconfig": "workspace:*",
|
||||||
"@types/node": "18.15.3",
|
"@types/node": "18.15.3",
|
||||||
"eslint": "8.43.0",
|
"eslint": "8.57.0",
|
||||||
"typescript": "5.1.6"
|
"typescript": "5.4.2"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@typescript-eslint/eslint-plugin": "5.60.1",
|
"@typescript-eslint/eslint-plugin": "7.2.0",
|
||||||
"@typescript-eslint/parser": "5.60.1",
|
"@typescript-eslint/parser": "7.2.0",
|
||||||
"eslint": "8.43.0",
|
"eslint": "8.57.0",
|
||||||
"eslint-config-prettier": "8.8.0",
|
"eslint-config-prettier": "9.1.0",
|
||||||
"eslint-plugin-jsdoc": "46.4.2",
|
"eslint-plugin-jsdoc": "48.2.1",
|
||||||
"eslint-plugin-prettier": "4.2.1",
|
"eslint-plugin-unicorn": "51.0.1"
|
||||||
"eslint-plugin-unicorn": "47.0.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# @openstapps/prettier-config
|
# @openstapps/prettier-config
|
||||||
|
|
||||||
|
## 3.2.0
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- dbb55850: Update Prettier to 3.1.1
|
||||||
|
|
||||||
## 3.0.0
|
## 3.0.0
|
||||||
|
|
||||||
### Major Changes
|
### Major Changes
|
||||||
@@ -30,7 +36,7 @@
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
import './lib/app.js';
|
import "./lib/app.js";
|
||||||
```
|
```
|
||||||
|
|
||||||
- 64caebaf: Migrate to ESM
|
- 64caebaf: Migrate to ESM
|
||||||
@@ -69,11 +75,14 @@
|
|||||||
- 64caebaf: Migrated changelogs to changeset format
|
- 64caebaf: Migrated changelogs to changeset format
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import fs from 'fs';
|
import fs from "fs";
|
||||||
|
|
||||||
const path = 'packages/logger/CHANGELOG.md';
|
const path = "packages/logger/CHANGELOG.md";
|
||||||
|
|
||||||
fs.writeFileSync(path, fs.readFileSync(path, 'utf8').replace(/^#+\s+\[/gm, '## ['));
|
fs.writeFileSync(
|
||||||
|
path,
|
||||||
|
fs.readFileSync(path, "utf8").replace(/^#+\s+\[/gm, "## ["),
|
||||||
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
- 98546a97: Migrate away from @openstapps/configuration
|
- 98546a97: Migrate away from @openstapps/configuration
|
||||||
@@ -115,7 +124,7 @@
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
import './lib/app.js';
|
import "./lib/app.js";
|
||||||
```
|
```
|
||||||
|
|
||||||
- 64caebaf: Migrate to ESM
|
- 64caebaf: Migrate to ESM
|
||||||
@@ -154,11 +163,14 @@
|
|||||||
- 64caebaf: Migrated changelogs to changeset format
|
- 64caebaf: Migrated changelogs to changeset format
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import fs from 'fs';
|
import fs from "fs";
|
||||||
|
|
||||||
const path = 'packages/logger/CHANGELOG.md';
|
const path = "packages/logger/CHANGELOG.md";
|
||||||
|
|
||||||
fs.writeFileSync(path, fs.readFileSync(path, 'utf8').replace(/^#+\s+\[/gm, '## ['));
|
fs.writeFileSync(
|
||||||
|
path,
|
||||||
|
fs.readFileSync(path, "utf8").replace(/^#+\s+\[/gm, "## ["),
|
||||||
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
- 98546a97: Migrate away from @openstapps/configuration
|
- 98546a97: Migrate away from @openstapps/configuration
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@openstapps/prettier-config",
|
"name": "@openstapps/prettier-config",
|
||||||
"description": "StApps Prettier Config",
|
"description": "StApps Prettier Config",
|
||||||
"version": "3.0.0",
|
"version": "3.2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
"repository": "git@gitlab.com:openstapps/prettier-config.git",
|
"repository": "git@gitlab.com:openstapps/prettier-config.git",
|
||||||
@@ -19,9 +19,9 @@
|
|||||||
"test": "prettier --config index.js --check \"test/*.js\""
|
"test": "prettier --config index.js --check \"test/*.js\""
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"prettier": "3.1.0"
|
"prettier": "3.1.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"prettier": "3.1.0"
|
"prettier": "3.1.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,8 +43,8 @@
|
|||||||
"@openstapps/logger": "workspace:*",
|
"@openstapps/logger": "workspace:*",
|
||||||
"@slack/web-api": "6.8.1",
|
"@slack/web-api": "6.8.1",
|
||||||
"commander": "10.0.0",
|
"commander": "10.0.0",
|
||||||
"date-fns": "2.30.0",
|
"date-fns": "3.6.0",
|
||||||
"glob": "10.2.7",
|
"glob": "10.3.10",
|
||||||
"mustache": "4.2.0"
|
"mustache": "4.2.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
"@openstapps/tsconfig": "workspace:*",
|
"@openstapps/tsconfig": "workspace:*",
|
||||||
"@types/chai": "4.3.5",
|
"@types/chai": "4.3.5",
|
||||||
"@types/chai-as-promised": "7.1.5",
|
"@types/chai-as-promised": "7.1.5",
|
||||||
"@types/glob": "8.0.1",
|
"@types/glob": "8.1.0",
|
||||||
"@types/mocha": "10.0.1",
|
"@types/mocha": "10.0.1",
|
||||||
"@types/mustache": "4.2.2",
|
"@types/mustache": "4.2.2",
|
||||||
"@types/node": "18.15.3",
|
"@types/node": "18.15.3",
|
||||||
@@ -63,9 +63,9 @@
|
|||||||
"chai-as-promised": "7.1.1",
|
"chai-as-promised": "7.1.1",
|
||||||
"mocha": "10.2.0",
|
"mocha": "10.2.0",
|
||||||
"mocha-junit-reporter": "2.2.0",
|
"mocha-junit-reporter": "2.2.0",
|
||||||
"ts-node": "10.9.1",
|
"ts-node": "10.9.2",
|
||||||
"tsup": "6.7.0",
|
"tsup": "6.7.0",
|
||||||
"typescript": "5.1.6"
|
"typescript": "5.4.2"
|
||||||
},
|
},
|
||||||
"tsup": {
|
"tsup": {
|
||||||
"entry": [
|
"entry": [
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{
|
{
|
||||||
"extends": "@openstapps/tsconfig"
|
"extends": "@openstapps/tsconfig",
|
||||||
|
"exclude": ["lib", "app.js"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# @openstapps/tsconfig
|
# @openstapps/tsconfig
|
||||||
|
|
||||||
|
## 3.3.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- 688bc5f2: v3.3.0 changes
|
||||||
|
|
||||||
## 3.0.0
|
## 3.0.0
|
||||||
|
|
||||||
### Major Changes
|
### Major Changes
|
||||||
@@ -30,7 +36,7 @@
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
import './lib/app.js';
|
import "./lib/app.js";
|
||||||
```
|
```
|
||||||
|
|
||||||
- 64caebaf: Migrate to ESM
|
- 64caebaf: Migrate to ESM
|
||||||
@@ -105,7 +111,7 @@
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
import './lib/app.js';
|
import "./lib/app.js";
|
||||||
```
|
```
|
||||||
|
|
||||||
- 64caebaf: Migrate to ESM
|
- 64caebaf: Migrate to ESM
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@openstapps/tsconfig",
|
"name": "@openstapps/tsconfig",
|
||||||
"description": "The tsconfig for the openstapps project",
|
"description": "The tsconfig for the openstapps project",
|
||||||
"version": "3.0.0",
|
"version": "3.3.0",
|
||||||
"type": "commonjs",
|
"type": "commonjs",
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
"repository": "git@gitlab.com:openstapps/eslint-config.git",
|
"repository": "git@gitlab.com:openstapps/eslint-config.git",
|
||||||
|
|||||||
@@ -14,19 +14,26 @@
|
|||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
|
"checkJs": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
"noImplicitAny": true,
|
"noImplicitAny": true,
|
||||||
"noImplicitReturns": true,
|
"noImplicitReturns": true,
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": false,
|
||||||
"noUnusedParameters": true,
|
"noUnusedParameters": false,
|
||||||
"outDir": "../../../lib/",
|
"outDir": "../../../lib/",
|
||||||
"lib": ["ES2022", "DOM"],
|
"lib": [
|
||||||
|
"ES2022",
|
||||||
|
"DOM"
|
||||||
|
],
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"target": "ES2022"
|
"target": "ES2022"
|
||||||
},
|
},
|
||||||
"ts-node": {
|
"ts-node": {
|
||||||
"transpileOnly": true
|
"transpileOnly": true
|
||||||
},
|
},
|
||||||
"exclude": ["../../../app.js", "../../../lib/"]
|
"exclude": [
|
||||||
|
"../../../app.js",
|
||||||
|
"../../../lib/"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,30 @@
|
|||||||
# @openstapps/minimal-connector
|
# @openstapps/minimal-connector
|
||||||
|
|
||||||
|
## 3.3.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @openstapps/core@3.3.2
|
||||||
|
- @openstapps/api@3.3.2
|
||||||
|
|
||||||
|
## 3.3.0
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [688bc5f2]
|
||||||
|
- @openstapps/api@3.3.0
|
||||||
|
- @openstapps/core@3.3.0
|
||||||
|
- @openstapps/logger@3.0.0
|
||||||
|
|
||||||
|
## 3.2.0
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [912ae422]
|
||||||
|
- @openstapps/core@3.2.0
|
||||||
|
- @openstapps/api@3.2.0
|
||||||
|
- @openstapps/logger@3.0.0
|
||||||
|
|
||||||
## 3.1.1
|
## 3.1.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@openstapps/minimal-connector",
|
"name": "@openstapps/minimal-connector",
|
||||||
"description": "This is a minimal connector which serves as an example",
|
"description": "This is a minimal connector which serves as an example",
|
||||||
"version": "3.1.1",
|
"version": "3.3.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
@@ -53,9 +53,9 @@
|
|||||||
"mocha": "10.2.0",
|
"mocha": "10.2.0",
|
||||||
"mocha-junit-reporter": "2.2.0",
|
"mocha-junit-reporter": "2.2.0",
|
||||||
"nock": "13.3.1",
|
"nock": "13.3.1",
|
||||||
"ts-node": "10.9.1",
|
"ts-node": "10.9.2",
|
||||||
"tsup": "6.7.0",
|
"tsup": "6.7.0",
|
||||||
"typescript": "5.1.6"
|
"typescript": "5.4.2"
|
||||||
},
|
},
|
||||||
"tsup": {
|
"tsup": {
|
||||||
"entry": [
|
"entry": [
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{
|
{
|
||||||
"extends": "@openstapps/tsconfig"
|
"extends": "@openstapps/tsconfig",
|
||||||
|
"exclude": ["lib", "app.js"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,44 +1,62 @@
|
|||||||
version: '3.7'
|
version: '3.7'
|
||||||
|
|
||||||
|
x-development-variables: &development-variables
|
||||||
|
NODE_ENV: "development"
|
||||||
|
ALLOW_NO_TRANSPORT: "true"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
database:
|
database:
|
||||||
image: registry.gitlab.com/openstapps/openstapps/database:2.0.0
|
image: registry.gitlab.com/openstapps/openstapps/database:3.0.0
|
||||||
volumes:
|
# If you need persistence for debugging purposes uncomment the following lines
|
||||||
- ./database:/usr/share/elasticsearch/data
|
#volumes:
|
||||||
|
# - ./database:/usr/share/elasticsearch/data
|
||||||
expose:
|
expose:
|
||||||
- "9200"
|
- 9200
|
||||||
|
ports:
|
||||||
|
- 127.0.0.1:9200:9200
|
||||||
|
environment:
|
||||||
|
- bootstrap.memory_lock=true
|
||||||
|
- "ES_JAVA_OPTS=-Xms2g -Xmx2g"
|
||||||
|
- discovery.type=single-node
|
||||||
|
ulimits:
|
||||||
|
memlock:
|
||||||
|
soft: -1
|
||||||
|
hard: -1
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
backend:
|
backend:
|
||||||
image: registry.gitlab.com/openstapps/openstapps/backend:3.0.0-next.0
|
image: registry.gitlab.com/openstapps/openstapps/backend:3.1.0
|
||||||
environment:
|
environment:
|
||||||
|
<<: *development-variables
|
||||||
ES_ADDR: "http://database:9200"
|
ES_ADDR: "http://database:9200"
|
||||||
NODE_CONFIG_ENV: "elasticsearch"
|
NODE_CONFIG_ENV: "elasticsearch"
|
||||||
ALLOW_NO_TRANSPORT: "true"
|
NODE_APP_INSTANCE: "f-u"
|
||||||
|
PROMETHEUS_MIDDLEWARE: "false"
|
||||||
expose:
|
expose:
|
||||||
- 3000
|
- 3000
|
||||||
ports:
|
ports:
|
||||||
- 3000:3000
|
- 127.0.0.1:3000:3000
|
||||||
links:
|
|
||||||
- "database"
|
|
||||||
labels:
|
labels:
|
||||||
- stapps.version=1.0.0
|
- stapps.version=4.1.0
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
depends_on:
|
depends_on:
|
||||||
- database
|
- database
|
||||||
|
|
||||||
api:
|
|
||||||
image: registry.gitlab.com/openstapps/openstapps/api:3.0.0-next.0
|
|
||||||
links:
|
links:
|
||||||
- "backend"
|
- database
|
||||||
|
|
||||||
minimal-connector:
|
# api:
|
||||||
image: registry.gitlab.com/openstapps/minimal-connector:core-0.23
|
# image: registry.gitlab.com/openstapps/openstapps/api:3.0.0
|
||||||
container_name: minimal-connector-0.23
|
# links:
|
||||||
command: ["http://backend:3000", "minimal-connector", "f-u"]
|
# - backend
|
||||||
|
|
||||||
app:
|
# minimal-connector:
|
||||||
image: registry.gitlab.com/openstapps/app/executable:core-0.23
|
# image: registry.gitlab.com/openstapps/minimal-connector:core-0.23
|
||||||
expose:
|
# container_name: minimal-connector-0.23
|
||||||
- 8100
|
# command: ["http://backend:3000", "minimal-connector", "f-u"]
|
||||||
ports:
|
|
||||||
- 8100:8100
|
# app:
|
||||||
|
# image: registry.gitlab.com/openstapps/app/executable:core-0.23
|
||||||
|
# expose:
|
||||||
|
# - 8100
|
||||||
|
# ports:
|
||||||
|
# - 8100:8100
|
||||||
|
|||||||
@@ -1,5 +1,36 @@
|
|||||||
# @openstapps/minimal-plugin
|
# @openstapps/minimal-plugin
|
||||||
|
|
||||||
|
## 3.3.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @openstapps/core@3.3.2
|
||||||
|
- @openstapps/core-tools@3.3.2
|
||||||
|
- @openstapps/api-plugin@3.3.2
|
||||||
|
- @openstapps/api@3.3.2
|
||||||
|
|
||||||
|
## 3.3.0
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [688bc5f2]
|
||||||
|
- @openstapps/api@3.3.0
|
||||||
|
- @openstapps/core@3.3.0
|
||||||
|
- @openstapps/api-plugin@3.3.0
|
||||||
|
- @openstapps/core-tools@3.3.0
|
||||||
|
- @openstapps/logger@3.0.0
|
||||||
|
|
||||||
|
## 3.2.0
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [912ae422]
|
||||||
|
- @openstapps/core@3.2.0
|
||||||
|
- @openstapps/api@3.2.0
|
||||||
|
- @openstapps/api-plugin@3.2.0
|
||||||
|
- @openstapps/core-tools@3.0.0
|
||||||
|
- @openstapps/logger@3.0.0
|
||||||
|
|
||||||
## 3.1.1
|
## 3.1.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@openstapps/minimal-plugin",
|
"name": "@openstapps/minimal-plugin",
|
||||||
"description": "Minimal Plugin",
|
"description": "Minimal Plugin",
|
||||||
"version": "3.1.1",
|
"version": "3.3.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
"@openstapps/logger": "workspace:*",
|
"@openstapps/logger": "workspace:*",
|
||||||
"commander": "10.0.0",
|
"commander": "10.0.0",
|
||||||
"express": "4.18.2",
|
"express": "4.18.2",
|
||||||
"ts-node": "10.9.1"
|
"ts-node": "10.9.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@openstapps/eslint-config": "workspace:*",
|
"@openstapps/eslint-config": "workspace:*",
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
"@types/express": "4.17.17",
|
"@types/express": "4.17.17",
|
||||||
"@types/node": "18.15.3",
|
"@types/node": "18.15.3",
|
||||||
"tsup": "6.7.0",
|
"tsup": "6.7.0",
|
||||||
"typescript": "5.1.6"
|
"typescript": "5.4.2"
|
||||||
},
|
},
|
||||||
"tsup": {
|
"tsup": {
|
||||||
"entry": [
|
"entry": [
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{
|
{
|
||||||
"extends": "@openstapps/tsconfig"
|
"extends": "@openstapps/tsconfig",
|
||||||
|
"exclude": ["lib", "app.js"]
|
||||||
}
|
}
|
||||||
|
|||||||
40
flake.lock
generated
40
flake.lock
generated
@@ -1,12 +1,30 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1709126324,
|
||||||
|
"narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "d465f4819400de7c8d874d50b982301f28a84605",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1701626906,
|
"lastModified": 1709747860,
|
||||||
"narHash": "sha256-ugr1QyzzwNk505ICE4VMQzonHQ9QS5W33xF2FXzFQ00=",
|
"narHash": "sha256-RT4zuBy579m+l8VyIQFOR66WXfcs4g1jntZUHjh6eoI=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "0c6d8c783336a59f4c59d4a6daed6ab269c4b361",
|
"rev": "58ae79ea707579c40102ddf62d84b902a987c58b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -18,8 +36,24 @@
|
|||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|||||||
138
flake.nix
138
flake.nix
@@ -1,77 +1,71 @@
|
|||||||
{
|
{
|
||||||
description = "A Nix-flake-based development environment for OpenStApps";
|
description = "A Nix-flake-based development environment for OpenStApps";
|
||||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
inputs = {
|
||||||
outputs = { self, nixpkgs }:
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||||
let
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
buildToolsVersion = "30.0.3";
|
};
|
||||||
overlays = [
|
outputs = {
|
||||||
(final: prev: rec {
|
self,
|
||||||
nodejs = prev.nodejs-18_x;
|
nixpkgs,
|
||||||
pnpm = prev.nodePackages.pnpm;
|
flake-utils,
|
||||||
chrome = prev.google-chrome;
|
}: let
|
||||||
firefox = prev.firefox;
|
aapt2buildToolsVersion = "33.0.2";
|
||||||
webkit = prev.epiphany; # Safari-ish browser
|
in
|
||||||
android = prev.androidenv.composeAndroidPackages {
|
flake-utils.lib.eachDefaultSystem (system: let
|
||||||
buildToolsVersions = [ "${buildToolsVersion}" ];
|
pkgs = import nixpkgs {
|
||||||
platformVersions = [ "33" ];
|
inherit system;
|
||||||
};
|
overlays = [
|
||||||
cypress = prev.cypress.overrideAttrs(cyPrev: rec {
|
(final: prev: rec {
|
||||||
version = "13.2.0";
|
fontMin = prev.python311.withPackages (ps: with ps; [brotli fonttools] ++ (with fonttools.optional-dependencies; [woff]));
|
||||||
src = prev.fetchzip {
|
android = prev.androidenv.composeAndroidPackages {
|
||||||
url = "https://cdn.cypress.io/desktop/${version}/linux-x64/cypress.zip";
|
buildToolsVersions = ["30.0.3" aapt2buildToolsVersion];
|
||||||
hash = "sha256-9o0nprGcJhudS1LNm+T7Vf0Dwd1RBauYKI+w1FBQ3ZM=";
|
platformVersions = ["33"];
|
||||||
};
|
};
|
||||||
});
|
cypress = prev.cypress.overrideAttrs (cyPrev: rec {
|
||||||
})
|
version = "13.2.0";
|
||||||
];
|
src = prev.fetchzip {
|
||||||
# TODO: aarch64-linux, x68_64-darwin, aarch64-darwin
|
url = "https://cdn.cypress.io/desktop/${version}/linux-x64/cypress.zip";
|
||||||
supportedSystems = [ "x86_64-linux" ];
|
hash = "sha256-9o0nprGcJhudS1LNm+T7Vf0Dwd1RBauYKI+w1FBQ3ZM=";
|
||||||
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
|
};
|
||||||
pkgs = import nixpkgs {
|
});
|
||||||
inherit overlays system;
|
nodejs = prev.nodejs_18;
|
||||||
config = {
|
})
|
||||||
allowUnfree = true;
|
];
|
||||||
android_sdk.accept_license = true;
|
config = {
|
||||||
};
|
allowUnfree = true;
|
||||||
|
android_sdk.accept_license = true;
|
||||||
};
|
};
|
||||||
});
|
};
|
||||||
in
|
androidFhs = pkgs.buildFHSUserEnv {
|
||||||
{
|
name = "android-env";
|
||||||
devShells = forEachSupportedSystem ({ pkgs }:
|
targetPkgs = pkgs: with pkgs; [];
|
||||||
let
|
runScript = "bash";
|
||||||
python = (pkgs.python311.withPackages(ps: with ps; [ brotli fonttools ] ++ (with fonttools.optional-dependencies; [ ufo lxml unicode woff ])));
|
profile = ''
|
||||||
in
|
export ALLOW_NINJA_ENV=true
|
||||||
{
|
export USE_CCACHE=1
|
||||||
default = (pkgs.buildFHSUserEnv {
|
export LD_LIBRARY_PATH=/usr/lib:/usr/lib32
|
||||||
name = "StApps Dev";
|
'';
|
||||||
targetPkgs = pkgs: with pkgs; [
|
};
|
||||||
nodejs
|
in {
|
||||||
pnpm
|
devShell = pkgs.mkShell rec {
|
||||||
python
|
nativeBuildInputs = [androidFhs];
|
||||||
docker
|
buildInputs = with pkgs; [
|
||||||
# tools
|
nodejs
|
||||||
curl
|
corepack
|
||||||
jq
|
# tools
|
||||||
# browsers
|
curl
|
||||||
firefox
|
jq
|
||||||
chrome
|
fontMin
|
||||||
webkit
|
cypress
|
||||||
cypress
|
# android
|
||||||
# android
|
jdk17
|
||||||
jdk17
|
android.androidsdk
|
||||||
android.androidsdk
|
];
|
||||||
musl
|
ANDROID_JAVA_HOME = "${pkgs.jdk.home}";
|
||||||
];
|
ANDROID_SDK_ROOT = "${pkgs.android.androidsdk}/libexec/android-sdk";
|
||||||
runScript = "bash";
|
GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${ANDROID_SDK_ROOT}/build-tools/${aapt2buildToolsVersion}/aapt2";
|
||||||
profile = ''
|
CYPRESS_INSTALL_BINARY = "0";
|
||||||
export CYPRESS_INSTALL_BINARY=0
|
CYPRESS_RUN_BINARY = "${pkgs.cypress}/bin/Cypress";
|
||||||
export CYPRESS_RUN_BINARY=${pkgs.cypress}/bin/Cypress
|
};
|
||||||
export ANDROID_SDK_ROOT=${pkgs.android.androidsdk}/libexec/android-sdk
|
});
|
||||||
export ANDROID_JAVA_HOME=${pkgs.jdk.home}
|
|
||||||
export DOCKER_HOST=unix:///run/user/1000/docker.sock
|
|
||||||
{ dockerd-rootless & } 2>/dev/null
|
|
||||||
'';
|
|
||||||
}).env;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,10 +5,4 @@
|
|||||||
# You can see what browsers were selected by your queries by running:
|
# You can see what browsers were selected by your queries by running:
|
||||||
# npx browserslist
|
# npx browserslist
|
||||||
|
|
||||||
> 0.5%
|
> 0.5% in DE and last 2 major versions and supports es6 and not dead
|
||||||
last 2 versions
|
|
||||||
Firefox ESR
|
|
||||||
not dead
|
|
||||||
not kaios 2.5
|
|
||||||
not op_mini all
|
|
||||||
not IE 9-11
|
|
||||||
|
|||||||
@@ -1,5 +1,42 @@
|
|||||||
# @openstapps/app
|
# @openstapps/app
|
||||||
|
|
||||||
|
## 3.3.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 7afc24f1: fixed config version comparison
|
||||||
|
- @openstapps/core@3.3.2
|
||||||
|
- @openstapps/api@3.3.2
|
||||||
|
|
||||||
|
## 3.3.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- 688bc5f2: v3.3.0 changes
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [688bc5f2]
|
||||||
|
- @openstapps/api@3.2.0
|
||||||
|
- @openstapps/core@3.2.0
|
||||||
|
- @openstapps/collection-utils@3.0.0
|
||||||
|
|
||||||
|
## 3.2.0
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 689ac68b: pin alpine version to 3.18 and add healthchecks
|
||||||
|
- Updated dependencies [912ae422]
|
||||||
|
- @openstapps/core@4.0.0
|
||||||
|
- @openstapps/api@4.0.0
|
||||||
|
- @openstapps/collection-utils@3.0.0
|
||||||
|
|
||||||
|
## 3.1.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Fix for Android users not being able to log in
|
||||||
|
|
||||||
## 3.1.1
|
## 3.1.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Creates a docker image with only the app as an executable unit
|
# Creates a docker image with only the app as an executable unit
|
||||||
# Dependencies need to be installed beforehand
|
# Dependencies need to be installed beforehand
|
||||||
# Needs to be build beforehand
|
# Needs to be build beforehand
|
||||||
FROM node:18-alpine
|
FROM node:18-alpine3.18
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY www/ /app/www
|
COPY www/ /app/www
|
||||||
|
|||||||
@@ -50,11 +50,11 @@ the config file.
|
|||||||
Icon font minification is done automatically, but requires you to
|
Icon font minification is done automatically, but requires you to
|
||||||
follow a few simple rules:
|
follow a few simple rules:
|
||||||
|
|
||||||
1. Use the tagged template literal for referencing icon names in
|
1. Use the type-safe proxy for referencing icon names in
|
||||||
TypeScript files and code
|
TypeScript files and code
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
SCIcon`icon_name`;
|
SCIcon.icon_name;
|
||||||
```
|
```
|
||||||
|
|
||||||
2. When using `ion-icon` in HTML, reference either icons that went through
|
2. When using `ion-icon` in HTML, reference either icons that went through
|
||||||
|
|||||||
@@ -13,25 +13,25 @@ The StApps 1.x.x (legacy app, but current app in stores) is written using Ionic
|
|||||||
|
|
||||||
There are (`npm`) scripts defined to get the app running as quickly as possible. Those scripts (shortcuts for docker commands) are called using the syntax `npm run + <script-name>`. So we have the following commands available:
|
There are (`npm`) scripts defined to get the app running as quickly as possible. Those scripts (shortcuts for docker commands) are called using the syntax `npm run + <script-name>`. So we have the following commands available:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
npm run docker:pull
|
npm run docker:pull
|
||||||
```
|
```
|
||||||
|
|
||||||
which pulls the up-to-date image ([Dockerfile](Dockerfile)) which contains all the tools needed for building, serving and deploying the app.
|
which pulls the up-to-date image ([Dockerfile](Dockerfile)) which contains all the tools needed for building, serving and deploying the app.
|
||||||
|
|
||||||
```
|
```sh
|
||||||
npm run docker:enter
|
npm run docker:enter
|
||||||
```
|
```
|
||||||
|
|
||||||
which enters the container on docker builder image, where we can run `npm install` (to install the required npm packages) and `npm build` (to build the app: convert into executable files), but also any other arbitrary commands with the tools available in the docker image.
|
which enters the container on docker builder image, where we can run `npm install` (to install the required npm packages) and `npm build` (to build the app: convert into executable files), but also any other arbitrary commands with the tools available in the docker image.
|
||||||
|
|
||||||
```
|
```sh
|
||||||
npm run docker:build
|
npm run docker:build
|
||||||
```
|
```
|
||||||
|
|
||||||
which runs `npm install` (to install the required npm packages) and `npm build` (to build the app: convert into executable files) in the docker container which runs on the docker builder image.
|
which runs `npm install` (to install the required npm packages) and `npm build` (to build the app: convert into executable files) in the docker container which runs on the docker builder image.
|
||||||
|
|
||||||
```
|
```sh
|
||||||
npm run docker:serve
|
npm run docker:serve
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ which serves the app for running it in the browser. It basically runs `ionic ser
|
|||||||
|
|
||||||
## How to build and start the app using the default backend?
|
## How to build and start the app using the default backend?
|
||||||
|
|
||||||
```
|
```sh
|
||||||
npm run build
|
npm run build
|
||||||
npm run start
|
npm run start
|
||||||
```
|
```
|
||||||
@@ -86,52 +86,98 @@ addToIonicDB(
|
|||||||
|
|
||||||
You'll need to run _Chromium_ using
|
You'll need to run _Chromium_ using
|
||||||
|
|
||||||
```shell
|
```sh
|
||||||
pnpm chromium:no-cors
|
pnpm chromium:no-cors
|
||||||
```
|
```
|
||||||
|
|
||||||
### Help, I can't log in!
|
### Help, I can't log in!
|
||||||
|
|
||||||
Login services will often block hosts not coming from the production
|
Login services will often block hosts not coming from the production
|
||||||
server. You can circumvent this locally by using the `:virtual-host`
|
server.
|
||||||
scripts:
|
|
||||||
|
|
||||||
```shell
|
#### Web
|
||||||
|
|
||||||
|
On the web you can circumvent this locally by using the `:virtual-host` scripts:
|
||||||
|
|
||||||
|
```sh
|
||||||
# Start the dev server on mobile.app.uni-frankfurt.de
|
# Start the dev server on mobile.app.uni-frankfurt.de
|
||||||
pnpm start:virtual-host
|
pnpm start:virtual-host
|
||||||
# Run chromium with flags that redirect mobile.app.uni-frankfurt.de to localhost:8100
|
# Run chromium with flags that redirect mobile.app.uni-frankfurt.de to localhost:8100
|
||||||
pnpm chromium:virtual-host
|
pnpm chromium:virtual-host
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Android
|
||||||
|
|
||||||
|
On Android you will need to change the `custom_url_scheme` values
|
||||||
|
to `de.unifrankfurt.app` in the following files:
|
||||||
|
|
||||||
|
- `android/app/src/main/res/values/strings.xml`
|
||||||
|
- `src/environment/environment.ts`
|
||||||
|
|
||||||
|
Then start the app normally as you would
|
||||||
|
|
||||||
|
```sh
|
||||||
|
pnpm run:android
|
||||||
|
```
|
||||||
|
|
||||||
|
**This alone will not make auth work**, only the login flow.
|
||||||
|
|
||||||
|
If you need to test login, you have to disable live reload:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
pnpm ionic capacitor run android
|
||||||
|
```
|
||||||
|
|
||||||
|
_**CAUTION:** a remote chrome debugging session can in some
|
||||||
|
cases hijack the device's ADB connection. If the connection
|
||||||
|
fails for no obvious reason, close chrome and uninstall the
|
||||||
|
app, then try again._
|
||||||
|
|
||||||
|
#### iOS
|
||||||
|
|
||||||
|
On Android you will need to change the `custom_url_scheme` value in
|
||||||
|
`src/environment/environment.ts` as well as the `CFBundleURLTypes`
|
||||||
|
in `ios/App/App/Info.plist`.
|
||||||
|
|
||||||
|
- make sure to remove any `Info.plist.orig` as capacitor might override
|
||||||
|
the modified `Info.plist` with that.
|
||||||
|
- make sure you have a valid device in XCode (Simulator or real device).
|
||||||
|
|
||||||
|
After that, run
|
||||||
|
|
||||||
|
```sh
|
||||||
|
pnpm run:ios
|
||||||
|
```
|
||||||
|
|
||||||
### Running the app
|
### Running the app
|
||||||
|
|
||||||
Install the npm packages needed for running the app (as for any other node project which uses npm):
|
Install the npm packages needed for running the app (as for any other node project which uses npm):
|
||||||
|
|
||||||
```
|
```sh
|
||||||
npm install
|
npm install
|
||||||
```
|
```
|
||||||
|
|
||||||
Check the code for linter issues:
|
Check the code for linter issues:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
npm run lint
|
npm run lint
|
||||||
```
|
```
|
||||||
|
|
||||||
Automatically fix linter issues (those where autofix is possible):
|
Automatically fix linter issues (those where autofix is possible):
|
||||||
|
|
||||||
```
|
```sh
|
||||||
npm run lint:fix
|
npm run lint:fix
|
||||||
```
|
```
|
||||||
|
|
||||||
Build the app (transpile etc.):
|
Build the app (transpile etc.):
|
||||||
|
|
||||||
```
|
```sh
|
||||||
npm run build
|
npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
Open the app in the browser:
|
Open the app in the browser:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
ionic serve
|
ionic serve
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -139,7 +185,7 @@ ionic serve
|
|||||||
|
|
||||||
Run the app for testing on an android device (with live reload in the webview / device, when files are changed):
|
Run the app for testing on an android device (with live reload in the webview / device, when files are changed):
|
||||||
|
|
||||||
```
|
```sh
|
||||||
npm run build # if needed
|
npm run build # if needed
|
||||||
npm run resources:android # generate needed resources (icons and splashscreens)
|
npm run resources:android # generate needed resources (icons and splashscreens)
|
||||||
npm run docker:run:android # runs "ionic capacitor run android --livereload --external" on a selected device
|
npm run docker:run:android # runs "ionic capacitor run android --livereload --external" on a selected device
|
||||||
@@ -159,7 +205,7 @@ Besides that, it is possible to monitor processes (and so the processes related
|
|||||||
|
|
||||||
Build the (debug) app for testing on an android device (creates an APK file in the android's build outputs path):
|
Build the (debug) app for testing on an android device (creates an APK file in the android's build outputs path):
|
||||||
|
|
||||||
```
|
```sh
|
||||||
npm run docker:build:android
|
npm run docker:build:android
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -169,13 +215,13 @@ The mentioned `docker:*:android` npm commands are executed in a docker container
|
|||||||
|
|
||||||
Execute unit tests:
|
Execute unit tests:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
npm test
|
npm test
|
||||||
```
|
```
|
||||||
|
|
||||||
Execute e2e tests:
|
Execute e2e tests:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
npm run e2e
|
npm run e2e
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ android {
|
|||||||
|
|
||||||
apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
|
apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
|
||||||
dependencies {
|
dependencies {
|
||||||
|
implementation project(':capacitor-community-screen-brightness')
|
||||||
implementation project(':capacitor-app')
|
implementation project(':capacitor-app')
|
||||||
implementation project(':capacitor-browser')
|
implementation project(':capacitor-browser')
|
||||||
implementation project(':capacitor-clipboard')
|
implementation project(':capacitor-clipboard')
|
||||||
@@ -21,6 +22,7 @@ dependencies {
|
|||||||
implementation project(':capacitor-local-notifications')
|
implementation project(':capacitor-local-notifications')
|
||||||
implementation project(':capacitor-network')
|
implementation project(':capacitor-network')
|
||||||
implementation project(':capacitor-preferences')
|
implementation project(':capacitor-preferences')
|
||||||
|
implementation project(':capacitor-screen-orientation')
|
||||||
implementation project(':capacitor-share')
|
implementation project(':capacitor-share')
|
||||||
implementation project(':capacitor-splash-screen')
|
implementation project(':capacitor-splash-screen')
|
||||||
implementation project(':transistorsoft-capacitor-background-fetch')
|
implementation project(':transistorsoft-capacitor-background-fetch')
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"pkg": "@capacitor-community/screen-brightness",
|
||||||
|
"classpath": "com.elylucas.capscreenbrightness.ScreenBrightnessPlugin"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"pkg": "@capacitor/app",
|
"pkg": "@capacitor/app",
|
||||||
"classpath": "com.capacitorjs.plugins.app.AppPlugin"
|
"classpath": "com.capacitorjs.plugins.app.AppPlugin"
|
||||||
@@ -47,6 +51,10 @@
|
|||||||
"pkg": "@capacitor/preferences",
|
"pkg": "@capacitor/preferences",
|
||||||
"classpath": "com.capacitorjs.plugins.preferences.PreferencesPlugin"
|
"classpath": "com.capacitorjs.plugins.preferences.PreferencesPlugin"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"pkg": "@capacitor/screen-orientation",
|
||||||
|
"classpath": "com.capacitorjs.plugins.screenorientation.ScreenOrientationPlugin"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"pkg": "@capacitor/share",
|
"pkg": "@capacitor/share",
|
||||||
"classpath": "com.capacitorjs.plugins.share.SharePlugin"
|
"classpath": "com.capacitorjs.plugins.share.SharePlugin"
|
||||||
|
|||||||
@@ -1,51 +1,57 @@
|
|||||||
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
|
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
|
||||||
include ':capacitor-android'
|
include ':capacitor-android'
|
||||||
project(':capacitor-android').projectDir = new File('../../../node_modules/.pnpm/@capacitor+android@5.5.0_@capacitor+core@5.5.0/node_modules/@capacitor/android/capacitor')
|
project(':capacitor-android').projectDir = new File('../../../node_modules/.pnpm/@capacitor+android@5.7.3_@capacitor+core@5.7.3/node_modules/@capacitor/android/capacitor')
|
||||||
|
|
||||||
|
include ':capacitor-community-screen-brightness'
|
||||||
|
project(':capacitor-community-screen-brightness').projectDir = new File('../../../node_modules/.pnpm/@capacitor-community+screen-brightness@6.0.0_@capacitor+core@5.7.3/node_modules/@capacitor-community/screen-brightness/android')
|
||||||
|
|
||||||
include ':capacitor-app'
|
include ':capacitor-app'
|
||||||
project(':capacitor-app').projectDir = new File('../../../node_modules/.pnpm/@capacitor+app@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/app/android')
|
project(':capacitor-app').projectDir = new File('../../../node_modules/.pnpm/@capacitor+app@5.0.7_@capacitor+core@5.7.3/node_modules/@capacitor/app/android')
|
||||||
|
|
||||||
include ':capacitor-browser'
|
include ':capacitor-browser'
|
||||||
project(':capacitor-browser').projectDir = new File('../../../node_modules/.pnpm/@capacitor+browser@5.1.0_@capacitor+core@5.5.0/node_modules/@capacitor/browser/android')
|
project(':capacitor-browser').projectDir = new File('../../../node_modules/.pnpm/@capacitor+browser@5.2.0_@capacitor+core@5.7.3/node_modules/@capacitor/browser/android')
|
||||||
|
|
||||||
include ':capacitor-clipboard'
|
include ':capacitor-clipboard'
|
||||||
project(':capacitor-clipboard').projectDir = new File('../../../node_modules/.pnpm/@capacitor+clipboard@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/clipboard/android')
|
project(':capacitor-clipboard').projectDir = new File('../../../node_modules/.pnpm/@capacitor+clipboard@5.0.7_@capacitor+core@5.7.3/node_modules/@capacitor/clipboard/android')
|
||||||
|
|
||||||
include ':capacitor-device'
|
include ':capacitor-device'
|
||||||
project(':capacitor-device').projectDir = new File('../../../node_modules/.pnpm/@capacitor+device@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/device/android')
|
project(':capacitor-device').projectDir = new File('../../../node_modules/.pnpm/@capacitor+device@5.0.7_@capacitor+core@5.7.3/node_modules/@capacitor/device/android')
|
||||||
|
|
||||||
include ':capacitor-dialog'
|
include ':capacitor-dialog'
|
||||||
project(':capacitor-dialog').projectDir = new File('../../../node_modules/.pnpm/@capacitor+dialog@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/dialog/android')
|
project(':capacitor-dialog').projectDir = new File('../../../node_modules/.pnpm/@capacitor+dialog@5.0.7_@capacitor+core@5.7.3/node_modules/@capacitor/dialog/android')
|
||||||
|
|
||||||
include ':capacitor-filesystem'
|
include ':capacitor-filesystem'
|
||||||
project(':capacitor-filesystem').projectDir = new File('../../../node_modules/.pnpm/@capacitor+filesystem@5.1.4_@capacitor+core@5.5.0/node_modules/@capacitor/filesystem/android')
|
project(':capacitor-filesystem').projectDir = new File('../../../node_modules/.pnpm/@capacitor+filesystem@5.2.1_@capacitor+core@5.7.3/node_modules/@capacitor/filesystem/android')
|
||||||
|
|
||||||
include ':capacitor-geolocation'
|
include ':capacitor-geolocation'
|
||||||
project(':capacitor-geolocation').projectDir = new File('../../../node_modules/.pnpm/@capacitor+geolocation@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/geolocation/android')
|
project(':capacitor-geolocation').projectDir = new File('../../../node_modules/.pnpm/@capacitor+geolocation@5.0.7_@capacitor+core@5.7.3/node_modules/@capacitor/geolocation/android')
|
||||||
|
|
||||||
include ':capacitor-haptics'
|
include ':capacitor-haptics'
|
||||||
project(':capacitor-haptics').projectDir = new File('../../../node_modules/.pnpm/@capacitor+haptics@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/haptics/android')
|
project(':capacitor-haptics').projectDir = new File('../../../node_modules/.pnpm/@capacitor+haptics@5.0.7_@capacitor+core@5.7.3/node_modules/@capacitor/haptics/android')
|
||||||
|
|
||||||
include ':capacitor-keyboard'
|
include ':capacitor-keyboard'
|
||||||
project(':capacitor-keyboard').projectDir = new File('../../../node_modules/.pnpm/@capacitor+keyboard@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/keyboard/android')
|
project(':capacitor-keyboard').projectDir = new File('../../../node_modules/.pnpm/@capacitor+keyboard@5.0.8_@capacitor+core@5.7.3/node_modules/@capacitor/keyboard/android')
|
||||||
|
|
||||||
include ':capacitor-local-notifications'
|
include ':capacitor-local-notifications'
|
||||||
project(':capacitor-local-notifications').projectDir = new File('../../../node_modules/.pnpm/@capacitor+local-notifications@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/local-notifications/android')
|
project(':capacitor-local-notifications').projectDir = new File('../../../node_modules/.pnpm/@capacitor+local-notifications@5.0.7_@capacitor+core@5.7.3/node_modules/@capacitor/local-notifications/android')
|
||||||
|
|
||||||
include ':capacitor-network'
|
include ':capacitor-network'
|
||||||
project(':capacitor-network').projectDir = new File('../../../node_modules/.pnpm/@capacitor+network@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/network/android')
|
project(':capacitor-network').projectDir = new File('../../../node_modules/.pnpm/@capacitor+network@5.0.7_@capacitor+core@5.7.3/node_modules/@capacitor/network/android')
|
||||||
|
|
||||||
include ':capacitor-preferences'
|
include ':capacitor-preferences'
|
||||||
project(':capacitor-preferences').projectDir = new File('../../../node_modules/.pnpm/@capacitor+preferences@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/preferences/android')
|
project(':capacitor-preferences').projectDir = new File('../../../node_modules/.pnpm/@capacitor+preferences@5.0.7_@capacitor+core@5.7.3/node_modules/@capacitor/preferences/android')
|
||||||
|
|
||||||
|
include ':capacitor-screen-orientation'
|
||||||
|
project(':capacitor-screen-orientation').projectDir = new File('../../../node_modules/.pnpm/@capacitor+screen-orientation@6.0.0_@capacitor+core@5.7.3/node_modules/@capacitor/screen-orientation/android')
|
||||||
|
|
||||||
include ':capacitor-share'
|
include ':capacitor-share'
|
||||||
project(':capacitor-share').projectDir = new File('../../../node_modules/.pnpm/@capacitor+share@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/share/android')
|
project(':capacitor-share').projectDir = new File('../../../node_modules/.pnpm/@capacitor+share@5.0.7_@capacitor+core@5.7.3/node_modules/@capacitor/share/android')
|
||||||
|
|
||||||
include ':capacitor-splash-screen'
|
include ':capacitor-splash-screen'
|
||||||
project(':capacitor-splash-screen').projectDir = new File('../../../node_modules/.pnpm/@capacitor+splash-screen@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/splash-screen/android')
|
project(':capacitor-splash-screen').projectDir = new File('../../../node_modules/.pnpm/@capacitor+splash-screen@5.0.7_@capacitor+core@5.7.3/node_modules/@capacitor/splash-screen/android')
|
||||||
|
|
||||||
include ':transistorsoft-capacitor-background-fetch'
|
include ':transistorsoft-capacitor-background-fetch'
|
||||||
project(':transistorsoft-capacitor-background-fetch').projectDir = new File('../../../node_modules/.pnpm/@transistorsoft+capacitor-background-fetch@1.0.2_@capacitor+core@5.5.0/node_modules/@transistorsoft/capacitor-background-fetch/android')
|
project(':transistorsoft-capacitor-background-fetch').projectDir = new File('../../../node_modules/.pnpm/@transistorsoft+capacitor-background-fetch@5.2.0_@capacitor+core@5.7.3/node_modules/@transistorsoft/capacitor-background-fetch/android')
|
||||||
|
|
||||||
include ':capacitor-secure-storage-plugin'
|
include ':capacitor-secure-storage-plugin'
|
||||||
project(':capacitor-secure-storage-plugin').projectDir = new File('../../../node_modules/.pnpm/capacitor-secure-storage-plugin@0.8.1_@capacitor+core@5.5.0/node_modules/capacitor-secure-storage-plugin/android')
|
project(':capacitor-secure-storage-plugin').projectDir = new File('../../../node_modules/.pnpm/capacitor-secure-storage-plugin@0.9.0_@capacitor+core@5.7.3/node_modules/capacitor-secure-storage-plugin/android')
|
||||||
|
|||||||
@@ -21,10 +21,13 @@
|
|||||||
"allowedCommonJsDependencies": [
|
"allowedCommonJsDependencies": [
|
||||||
"moment",
|
"moment",
|
||||||
"opening_hours",
|
"opening_hours",
|
||||||
"leaflet",
|
"localforage",
|
||||||
"leaflet.markercluster",
|
"i18next",
|
||||||
"localforge",
|
"semver",
|
||||||
"guid-typescript"
|
"suncalc",
|
||||||
|
"guid-typescript",
|
||||||
|
"fast-deep-equal",
|
||||||
|
"maplibre-gl"
|
||||||
],
|
],
|
||||||
"aot": true,
|
"aot": true,
|
||||||
"assets": [
|
"assets": [
|
||||||
@@ -32,24 +35,13 @@
|
|||||||
"glob": "**/*",
|
"glob": "**/*",
|
||||||
"input": "src/assets",
|
"input": "src/assets",
|
||||||
"output": "assets"
|
"output": "assets"
|
||||||
},
|
|
||||||
{
|
|
||||||
"glob": "**/*",
|
|
||||||
"input": "./node_modules/leaflet/dist/images",
|
|
||||||
"output": "assets/"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"styles": [
|
"styles": [
|
||||||
{
|
|
||||||
"input": "src/theme/variables.scss",
|
|
||||||
"inject": true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"input": "src/global.scss",
|
"input": "src/global.scss",
|
||||||
"inject": true
|
"inject": true
|
||||||
},
|
}
|
||||||
"./node_modules/leaflet/dist/leaflet.css",
|
|
||||||
"./node_modules/leaflet.markercluster/dist/MarkerCluster.Default.css"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"configurations": {
|
"configurations": {
|
||||||
@@ -97,20 +89,20 @@
|
|||||||
"serve": {
|
"serve": {
|
||||||
"builder": "@angular-devkit/build-angular:dev-server",
|
"builder": "@angular-devkit/build-angular:dev-server",
|
||||||
"options": {
|
"options": {
|
||||||
"browserTarget": "app:build"
|
"buildTarget": "app:build"
|
||||||
},
|
},
|
||||||
"configurations": {
|
"configurations": {
|
||||||
"production": {
|
"production": {
|
||||||
"browserTarget": "app:build:production"
|
"buildTarget": "app:build:production"
|
||||||
},
|
},
|
||||||
"development": {
|
"development": {
|
||||||
"browserTarget": "app:build:development"
|
"buildTarget": "app:build:development"
|
||||||
},
|
},
|
||||||
"ci": {
|
"ci": {
|
||||||
"browserTarget": "app:build"
|
"buildTarget": "app:build"
|
||||||
},
|
},
|
||||||
"fake": {
|
"fake": {
|
||||||
"browserTarget": "app:build:fake"
|
"buildTarget": "app:build:fake"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"defaultConfiguration": "development"
|
"defaultConfiguration": "development"
|
||||||
@@ -132,11 +124,6 @@
|
|||||||
"glob": "**/*",
|
"glob": "**/*",
|
||||||
"input": "src/assets",
|
"input": "src/assets",
|
||||||
"output": "/assets"
|
"output": "/assets"
|
||||||
},
|
|
||||||
{
|
|
||||||
"glob": "**/*",
|
|
||||||
"input": "./node_modules/leaflet/dist/images",
|
|
||||||
"output": "assets/"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ describe('dashboard', async function () {
|
|||||||
cy.visit('/overview');
|
cy.visit('/overview');
|
||||||
|
|
||||||
cy.get('ion-searchbar').click({scrollBehavior: 'center'});
|
cy.get('ion-searchbar').click({scrollBehavior: 'center'});
|
||||||
cy.url().should('eq', Cypress.config().baseUrl + '/search');
|
cy.url().should('include', '/search');
|
||||||
cy.get('ion-searchbar').should('not.have.value');
|
cy.get('ion-searchbar').should('not.have.value');
|
||||||
cy.get('ion-searchbar input.searchbar-input').should('have.focus');
|
cy.get('ion-searchbar input.searchbar-input').should('have.focus');
|
||||||
|
|
||||||
|
|||||||
@@ -12,9 +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/>.
|
||||||
*/
|
*/
|
||||||
import type {IconConfig} from './scripts/icon-config';
|
|
||||||
|
|
||||||
const config: IconConfig = {
|
/** @type {import('./scripts/icon-config').IconConfig} */
|
||||||
|
const config = {
|
||||||
inputPath: 'node_modules/material-symbols/material-symbols-rounded.woff2',
|
inputPath: 'node_modules/material-symbols/material-symbols-rounded.woff2',
|
||||||
outputPath: 'src/assets/icons.min.woff2',
|
outputPath: 'src/assets/icons.min.woff2',
|
||||||
htmlGlob: 'src/**/*.html',
|
htmlGlob: 'src/**/*.html',
|
||||||
@@ -38,10 +38,6 @@ const config: IconConfig = {
|
|||||||
'work',
|
'work',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
codePoints: {
|
|
||||||
ios_share: 'e6b8',
|
|
||||||
fact_check: 'f0c5',
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default config;
|
export default config;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
require_relative '../../../../node_modules/.pnpm/@capacitor+ios@5.5.0_@capacitor+core@5.5.0/node_modules/@capacitor/ios/scripts/pods_helpers'
|
require_relative '../../../../node_modules/.pnpm/@capacitor+ios@5.7.3_@capacitor+core@5.7.3/node_modules/@capacitor/ios/scripts/pods_helpers'
|
||||||
|
|
||||||
platform :ios, '13.0'
|
platform :ios, '13.0'
|
||||||
use_frameworks!
|
use_frameworks!
|
||||||
@@ -9,24 +9,26 @@ use_frameworks!
|
|||||||
install! 'cocoapods', :disable_input_output_paths => true
|
install! 'cocoapods', :disable_input_output_paths => true
|
||||||
|
|
||||||
def capacitor_pods
|
def capacitor_pods
|
||||||
pod 'Capacitor', :path => '../../../../node_modules/.pnpm/@capacitor+ios@5.5.0_@capacitor+core@5.5.0/node_modules/@capacitor/ios'
|
pod 'Capacitor', :path => '../../../../node_modules/.pnpm/@capacitor+ios@5.7.3_@capacitor+core@5.7.3/node_modules/@capacitor/ios'
|
||||||
pod 'CapacitorCordova', :path => '../../../../node_modules/.pnpm/@capacitor+ios@5.5.0_@capacitor+core@5.5.0/node_modules/@capacitor/ios'
|
pod 'CapacitorCordova', :path => '../../../../node_modules/.pnpm/@capacitor+ios@5.7.3_@capacitor+core@5.7.3/node_modules/@capacitor/ios'
|
||||||
pod 'CapacitorApp', :path => '../../../../node_modules/.pnpm/@capacitor+app@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/app'
|
pod 'CapacitorCommunityScreenBrightness', :path => '../../../../node_modules/.pnpm/@capacitor-community+screen-brightness@6.0.0_@capacitor+core@5.7.3/node_modules/@capacitor-community/screen-brightness'
|
||||||
pod 'CapacitorBrowser', :path => '../../../../node_modules/.pnpm/@capacitor+browser@5.1.0_@capacitor+core@5.5.0/node_modules/@capacitor/browser'
|
pod 'CapacitorApp', :path => '../../../../node_modules/.pnpm/@capacitor+app@5.0.7_@capacitor+core@5.7.3/node_modules/@capacitor/app'
|
||||||
pod 'CapacitorClipboard', :path => '../../../../node_modules/.pnpm/@capacitor+clipboard@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/clipboard'
|
pod 'CapacitorBrowser', :path => '../../../../node_modules/.pnpm/@capacitor+browser@5.2.0_@capacitor+core@5.7.3/node_modules/@capacitor/browser'
|
||||||
pod 'CapacitorDevice', :path => '../../../../node_modules/.pnpm/@capacitor+device@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/device'
|
pod 'CapacitorClipboard', :path => '../../../../node_modules/.pnpm/@capacitor+clipboard@5.0.7_@capacitor+core@5.7.3/node_modules/@capacitor/clipboard'
|
||||||
pod 'CapacitorDialog', :path => '../../../../node_modules/.pnpm/@capacitor+dialog@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/dialog'
|
pod 'CapacitorDevice', :path => '../../../../node_modules/.pnpm/@capacitor+device@5.0.7_@capacitor+core@5.7.3/node_modules/@capacitor/device'
|
||||||
pod 'CapacitorFilesystem', :path => '../../../../node_modules/.pnpm/@capacitor+filesystem@5.1.4_@capacitor+core@5.5.0/node_modules/@capacitor/filesystem'
|
pod 'CapacitorDialog', :path => '../../../../node_modules/.pnpm/@capacitor+dialog@5.0.7_@capacitor+core@5.7.3/node_modules/@capacitor/dialog'
|
||||||
pod 'CapacitorGeolocation', :path => '../../../../node_modules/.pnpm/@capacitor+geolocation@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/geolocation'
|
pod 'CapacitorFilesystem', :path => '../../../../node_modules/.pnpm/@capacitor+filesystem@5.2.1_@capacitor+core@5.7.3/node_modules/@capacitor/filesystem'
|
||||||
pod 'CapacitorHaptics', :path => '../../../../node_modules/.pnpm/@capacitor+haptics@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/haptics'
|
pod 'CapacitorGeolocation', :path => '../../../../node_modules/.pnpm/@capacitor+geolocation@5.0.7_@capacitor+core@5.7.3/node_modules/@capacitor/geolocation'
|
||||||
pod 'CapacitorKeyboard', :path => '../../../../node_modules/.pnpm/@capacitor+keyboard@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/keyboard'
|
pod 'CapacitorHaptics', :path => '../../../../node_modules/.pnpm/@capacitor+haptics@5.0.7_@capacitor+core@5.7.3/node_modules/@capacitor/haptics'
|
||||||
pod 'CapacitorLocalNotifications', :path => '../../../../node_modules/.pnpm/@capacitor+local-notifications@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/local-notifications'
|
pod 'CapacitorKeyboard', :path => '../../../../node_modules/.pnpm/@capacitor+keyboard@5.0.8_@capacitor+core@5.7.3/node_modules/@capacitor/keyboard'
|
||||||
pod 'CapacitorNetwork', :path => '../../../../node_modules/.pnpm/@capacitor+network@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/network'
|
pod 'CapacitorLocalNotifications', :path => '../../../../node_modules/.pnpm/@capacitor+local-notifications@5.0.7_@capacitor+core@5.7.3/node_modules/@capacitor/local-notifications'
|
||||||
pod 'CapacitorPreferences', :path => '../../../../node_modules/.pnpm/@capacitor+preferences@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/preferences'
|
pod 'CapacitorNetwork', :path => '../../../../node_modules/.pnpm/@capacitor+network@5.0.7_@capacitor+core@5.7.3/node_modules/@capacitor/network'
|
||||||
pod 'CapacitorShare', :path => '../../../../node_modules/.pnpm/@capacitor+share@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/share'
|
pod 'CapacitorPreferences', :path => '../../../../node_modules/.pnpm/@capacitor+preferences@5.0.7_@capacitor+core@5.7.3/node_modules/@capacitor/preferences'
|
||||||
pod 'CapacitorSplashScreen', :path => '../../../../node_modules/.pnpm/@capacitor+splash-screen@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/splash-screen'
|
pod 'CapacitorScreenOrientation', :path => '../../../../node_modules/.pnpm/@capacitor+screen-orientation@6.0.0_@capacitor+core@5.7.3/node_modules/@capacitor/screen-orientation'
|
||||||
pod 'TransistorsoftCapacitorBackgroundFetch', :path => '../../../../node_modules/.pnpm/@transistorsoft+capacitor-background-fetch@1.0.2_@capacitor+core@5.5.0/node_modules/@transistorsoft/capacitor-background-fetch'
|
pod 'CapacitorShare', :path => '../../../../node_modules/.pnpm/@capacitor+share@5.0.7_@capacitor+core@5.7.3/node_modules/@capacitor/share'
|
||||||
pod 'CapacitorSecureStoragePlugin', :path => '../../../../node_modules/.pnpm/capacitor-secure-storage-plugin@0.9.0_@capacitor+core@5.5.0/node_modules/capacitor-secure-storage-plugin'
|
pod 'CapacitorSplashScreen', :path => '../../../../node_modules/.pnpm/@capacitor+splash-screen@5.0.7_@capacitor+core@5.7.3/node_modules/@capacitor/splash-screen'
|
||||||
|
pod 'TransistorsoftCapacitorBackgroundFetch', :path => '../../../../node_modules/.pnpm/@transistorsoft+capacitor-background-fetch@5.2.0_@capacitor+core@5.7.3/node_modules/@transistorsoft/capacitor-background-fetch'
|
||||||
|
pod 'CapacitorSecureStoragePlugin', :path => '../../../../node_modules/.pnpm/capacitor-secure-storage-plugin@0.9.0_@capacitor+core@5.7.3/node_modules/capacitor-secure-storage-plugin'
|
||||||
pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins'
|
pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ PODS:
|
|||||||
- CordovaPlugins (5.5.0):
|
- CordovaPlugins (5.5.0):
|
||||||
- CapacitorCordova
|
- CapacitorCordova
|
||||||
- SwiftKeychainWrapper (4.0.1)
|
- SwiftKeychainWrapper (4.0.1)
|
||||||
- TransistorsoftCapacitorBackgroundFetch (1.0.2):
|
- TransistorsoftCapacitorBackgroundFetch (5.1.1):
|
||||||
- Capacitor
|
- Capacitor
|
||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
@@ -58,7 +58,7 @@ DEPENDENCIES:
|
|||||||
- "CapacitorShare (from `../../../../node_modules/.pnpm/@capacitor+share@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/share`)"
|
- "CapacitorShare (from `../../../../node_modules/.pnpm/@capacitor+share@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/share`)"
|
||||||
- "CapacitorSplashScreen (from `../../../../node_modules/.pnpm/@capacitor+splash-screen@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/splash-screen`)"
|
- "CapacitorSplashScreen (from `../../../../node_modules/.pnpm/@capacitor+splash-screen@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/splash-screen`)"
|
||||||
- CordovaPlugins (from `../capacitor-cordova-ios-plugins`)
|
- CordovaPlugins (from `../capacitor-cordova-ios-plugins`)
|
||||||
- "TransistorsoftCapacitorBackgroundFetch (from `../../../../node_modules/.pnpm/@transistorsoft+capacitor-background-fetch@1.0.2_@capacitor+core@5.5.0/node_modules/@transistorsoft/capacitor-background-fetch`)"
|
- "TransistorsoftCapacitorBackgroundFetch (from `../../../../node_modules/.pnpm/@transistorsoft+capacitor-background-fetch@5.1.1_@capacitor+core@5.5.0/node_modules/@transistorsoft/capacitor-background-fetch`)"
|
||||||
|
|
||||||
SPEC REPOS:
|
SPEC REPOS:
|
||||||
trunk:
|
trunk:
|
||||||
@@ -102,7 +102,7 @@ EXTERNAL SOURCES:
|
|||||||
CordovaPlugins:
|
CordovaPlugins:
|
||||||
:path: "../capacitor-cordova-ios-plugins"
|
:path: "../capacitor-cordova-ios-plugins"
|
||||||
TransistorsoftCapacitorBackgroundFetch:
|
TransistorsoftCapacitorBackgroundFetch:
|
||||||
:path: "../../../../node_modules/.pnpm/@transistorsoft+capacitor-background-fetch@1.0.2_@capacitor+core@5.5.0/node_modules/@transistorsoft/capacitor-background-fetch"
|
:path: "../../../../node_modules/.pnpm/@transistorsoft+capacitor-background-fetch@5.1.1_@capacitor+core@5.5.0/node_modules/@transistorsoft/capacitor-background-fetch"
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
Capacitor: 57890b363df14d5d2d5d8461aa23e886cb34da2a
|
Capacitor: 57890b363df14d5d2d5d8461aa23e886cb34da2a
|
||||||
@@ -124,8 +124,8 @@ SPEC CHECKSUMS:
|
|||||||
CapacitorSplashScreen: 5fa2ab5e46cf5cc530cf16a51c80c7a986579ccd
|
CapacitorSplashScreen: 5fa2ab5e46cf5cc530cf16a51c80c7a986579ccd
|
||||||
CordovaPlugins: de5669381702d76ed5b1d442177a6a5fc3252a9d
|
CordovaPlugins: de5669381702d76ed5b1d442177a6a5fc3252a9d
|
||||||
SwiftKeychainWrapper: 807ba1d63c33a7d0613288512399cd1eda1e470c
|
SwiftKeychainWrapper: 807ba1d63c33a7d0613288512399cd1eda1e470c
|
||||||
TransistorsoftCapacitorBackgroundFetch: 74ca62dae7ec78639eaf3d0d1e24c595ada213dd
|
TransistorsoftCapacitorBackgroundFetch: ce4b3e01b898cef516e68485d2160a078016ee97
|
||||||
|
|
||||||
PODFILE CHECKSUM: 073b899f90bacc5049101cb9c562a168757d554e
|
PODFILE CHECKSUM: 229278f2c257e8ab555325c7115b2e187e8e628d
|
||||||
|
|
||||||
COCOAPODS: 1.13.0
|
COCOAPODS: 1.13.0
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// @ts-check
|
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2022 StApps
|
* Copyright (C) 2022 StApps
|
||||||
* 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
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@openstapps/app",
|
"name": "@openstapps/app",
|
||||||
"description": "The generic app tailored to fulfill needs of German universities, written using Ionic Framework.",
|
"description": "The generic app tailored to fulfill needs of German universities, written using Ionic Framework.",
|
||||||
"version": "3.1.1",
|
"version": "3.3.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
"author": "Karl-Philipp Wulfert <krlwlfrt@gmail.com>",
|
"author": "Karl-Philipp Wulfert <krlwlfrt@gmail.com>",
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
"build:prod": "ng build --configuration=production",
|
"build:prod": "ng build --configuration=production",
|
||||||
"build:stats": "ng build --configuration=production --stats-json",
|
"build:stats": "ng build --configuration=production --stats-json",
|
||||||
"changelog": "conventional-changelog -p angular -i src/assets/about/CHANGELOG.md -s -r 0",
|
"changelog": "conventional-changelog -p angular -i src/assets/about/CHANGELOG.md -s -r 0",
|
||||||
"check-icons": "ts-node-esm scripts/check-icon-correctness.ts",
|
"check-icons": "node scripts/check-icon-correctness.mjs",
|
||||||
"chromium:no-cors": "chromium --disable-web-security --user-data-dir=\".browser-data/chromium\"",
|
"chromium:no-cors": "chromium --disable-web-security --user-data-dir=\".browser-data/chromium\"",
|
||||||
"chromium:virtual-host": "chromium --host-resolver-rules=\"MAP mobile.app.uni-frankfurt.de:* localhost:8100\" --ignore-certificate-errors",
|
"chromium:virtual-host": "chromium --host-resolver-rules=\"MAP mobile.app.uni-frankfurt.de:* localhost:8100\" --ignore-certificate-errors",
|
||||||
"cypress:open": "cypress open",
|
"cypress:open": "cypress open",
|
||||||
@@ -35,10 +35,10 @@
|
|||||||
"e2e": "ng e2e",
|
"e2e": "ng e2e",
|
||||||
"format": "prettier . -c",
|
"format": "prettier . -c",
|
||||||
"format:fix": "prettier --write .",
|
"format:fix": "prettier --write .",
|
||||||
"licenses": "license-checker --json > src/assets/about/licenses.json && ts-node ./scripts/accumulate-licenses.ts && git add src/assets/about/licenses.json",
|
"licenses": "license-checker --json > src/assets/about/licenses.json && node ./scripts/accumulate-licenses.mjs && git add src/assets/about/licenses.json",
|
||||||
"lint": "ng lint && stylelint \"**/*.scss\"",
|
"lint": "ng lint && stylelint \"**/*.scss\"",
|
||||||
"lint:fix": "eslint --fix -c .eslintrc.json --ignore-path .eslintignore --ext .ts,.html src/ && stylelint --fix \"**/*.scss\"",
|
"lint:fix": "eslint --fix -c .eslintrc.json --ignore-path .eslintignore --ext .ts,.html src/ && stylelint --fix \"**/*.scss\"",
|
||||||
"minify-icons": "ts-node-esm scripts/minify-icon-font.ts",
|
"minify-icons": "node scripts/minify-icon-font.mjs",
|
||||||
"postinstall": "jetify && echo \"skipping jetify in production mode\"",
|
"postinstall": "jetify && echo \"skipping jetify in production mode\"",
|
||||||
"preview": "http-server www --p 8101 -o",
|
"preview": "http-server www --p 8101 -o",
|
||||||
"push": "git push && git push origin \"v$npm_package_version\"",
|
"push": "git push && git push origin \"v$npm_package_version\"",
|
||||||
@@ -52,139 +52,138 @@
|
|||||||
"test:integration": "sh integration-test.sh"
|
"test:integration": "sh integration-test.sh"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "16.1.4",
|
"@angular/animations": "17.3.0",
|
||||||
"@angular/cdk": "16.1.4",
|
"@angular/cdk": "17.3.0",
|
||||||
"@angular/common": "16.1.4",
|
"@angular/common": "17.3.0",
|
||||||
"@angular/core": "16.1.4",
|
"@angular/core": "17.3.0",
|
||||||
"@angular/forms": "16.1.4",
|
"@angular/forms": "17.3.0",
|
||||||
"@angular/platform-browser": "16.1.4",
|
"@angular/platform-browser": "17.3.0",
|
||||||
"@angular/router": "16.1.4",
|
"@angular/router": "17.3.0",
|
||||||
"@asymmetrik/ngx-leaflet": "16.0.1",
|
"@awesome-cordova-plugins/calendar": "6.6.0",
|
||||||
"@asymmetrik/ngx-leaflet-markercluster": "16.0.0",
|
"@awesome-cordova-plugins/core": "6.6.0",
|
||||||
"@awesome-cordova-plugins/calendar": "5.45.0",
|
"@capacitor-community/screen-brightness": "6.0.0",
|
||||||
"@awesome-cordova-plugins/core": "5.45.0",
|
"@capacitor/app": "5.0.7",
|
||||||
"@capacitor/app": "5.0.6",
|
"@capacitor/browser": "5.2.0",
|
||||||
"@capacitor/browser": "5.1.0",
|
"@capacitor/clipboard": "5.0.7",
|
||||||
"@capacitor/clipboard": "5.0.6",
|
"@capacitor/core": "5.7.3",
|
||||||
"@capacitor/core": "5.5.0",
|
"@capacitor/device": "5.0.7",
|
||||||
"@capacitor/device": "5.0.6",
|
"@capacitor/dialog": "5.0.7",
|
||||||
"@capacitor/dialog": "5.0.6",
|
"@capacitor/filesystem": "5.2.1",
|
||||||
"@capacitor/filesystem": "5.1.4",
|
"@capacitor/geolocation": "5.0.7",
|
||||||
"@capacitor/geolocation": "5.0.6",
|
"@capacitor/haptics": "5.0.7",
|
||||||
"@capacitor/haptics": "5.0.6",
|
"@capacitor/keyboard": "5.0.8",
|
||||||
"@capacitor/keyboard": "5.0.6",
|
"@capacitor/local-notifications": "5.0.7",
|
||||||
"@capacitor/local-notifications": "5.0.6",
|
"@capacitor/network": "5.0.7",
|
||||||
"@capacitor/network": "5.0.6",
|
"@capacitor/preferences": "5.0.7",
|
||||||
"@capacitor/preferences": "5.0.6",
|
"@capacitor/screen-orientation": "6.0.0",
|
||||||
"@capacitor/share": "5.0.6",
|
"@capacitor/share": "5.0.7",
|
||||||
"@capacitor/splash-screen": "5.0.6",
|
"@capacitor/splash-screen": "5.0.7",
|
||||||
"@ionic-native/core": "5.36.0",
|
"@ionic-native/core": "5.36.0",
|
||||||
"@ionic/angular": "7.1.3",
|
"@ionic/angular": "7.8.0",
|
||||||
"@ionic/storage-angular": "4.0.0",
|
"@ionic/storage-angular": "4.0.0",
|
||||||
|
"@maplibre/ngx-maplibre-gl": "17.4.1",
|
||||||
"@ngx-translate/core": "15.0.0",
|
"@ngx-translate/core": "15.0.0",
|
||||||
"@ngx-translate/http-loader": "8.0.0",
|
"@ngx-translate/http-loader": "8.0.0",
|
||||||
"@openid/appauth": "1.3.1",
|
"@openid/appauth": "1.3.1",
|
||||||
"@openstapps/api": "workspace:*",
|
"@openstapps/api": "workspace:*",
|
||||||
"@openstapps/collection-utils": "workspace:*",
|
"@openstapps/collection-utils": "workspace:*",
|
||||||
"@openstapps/core": "workspace:*",
|
"@openstapps/core": "workspace:*",
|
||||||
"@transistorsoft/capacitor-background-fetch": "5.1.1",
|
"@transistorsoft/capacitor-background-fetch": "5.2.0",
|
||||||
"@types/dom-view-transitions": "1.0.1",
|
"@types/dom-view-transitions": "1.0.4",
|
||||||
"capacitor-secure-storage-plugin": "0.9.0",
|
"capacitor-secure-storage-plugin": "0.9.0",
|
||||||
"cordova-plugin-calendar": "5.1.6",
|
"cordova-plugin-calendar": "5.1.6",
|
||||||
"date-fns": "2.30.0",
|
"date-fns": "3.6.0",
|
||||||
"deepmerge": "4.3.1",
|
"deepmerge": "4.3.1",
|
||||||
"form-data": "4.0.0",
|
"form-data": "4.0.0",
|
||||||
"geojson": "0.5.0",
|
"geojson": "0.5.0",
|
||||||
"ionic-appauth": "0.9.0",
|
"ionic-appauth": "0.9.0",
|
||||||
"jsonpath-plus": "6.0.1",
|
"jsonpath-plus": "6.0.1",
|
||||||
"leaflet": "1.9.3",
|
"maplibre-gl": "4.0.2",
|
||||||
"leaflet.markercluster": "1.5.3",
|
"material-symbols": "0.17.1",
|
||||||
"material-symbols": "0.10.0",
|
"moment": "2.30.1",
|
||||||
"moment": "2.29.4",
|
"ngx-date-fns": "11.0.0",
|
||||||
"ngx-date-fns": "10.0.1",
|
|
||||||
"ngx-logger": "5.0.12",
|
"ngx-logger": "5.0.12",
|
||||||
"ngx-markdown": "16.0.0",
|
"ngx-markdown": "17.1.1",
|
||||||
"ngx-moment": "6.0.2",
|
"ngx-moment": "6.0.2",
|
||||||
"opening_hours": "3.8.0",
|
"opening_hours": "3.8.0",
|
||||||
|
"pmtiles": "3.0.3",
|
||||||
"rxjs": "7.8.1",
|
"rxjs": "7.8.1",
|
||||||
"semver": "7.5.4",
|
"semver": "7.6.0",
|
||||||
"swiper": "8.4.5",
|
"swiper": "8.4.5",
|
||||||
"tslib": "2.4.1",
|
"tslib": "2.6.2",
|
||||||
"zone.js": "0.13.1"
|
"zone.js": "0.14.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular-devkit/architect": "0.1601.4",
|
"@angular-devkit/architect": "0.1703.0",
|
||||||
"@angular-devkit/build-angular": "16.1.4",
|
"@angular-devkit/build-angular": "17.3.0",
|
||||||
"@angular-devkit/core": "16.1.4",
|
"@angular-devkit/core": "17.3.0",
|
||||||
"@angular-devkit/schematics": "16.1.4",
|
"@angular-devkit/schematics": "17.3.0",
|
||||||
"@angular-eslint/builder": "16.1.0",
|
"@angular-eslint/builder": "17.3.0",
|
||||||
"@angular-eslint/eslint-plugin": "16.1.0",
|
"@angular-eslint/eslint-plugin": "17.3.0",
|
||||||
"@angular-eslint/eslint-plugin-template": "16.1.0",
|
"@angular-eslint/eslint-plugin-template": "17.3.0",
|
||||||
"@angular-eslint/schematics": "16.1.0",
|
"@angular-eslint/schematics": "17.3.0",
|
||||||
"@angular-eslint/template-parser": "16.1.0",
|
"@angular-eslint/template-parser": "17.3.0",
|
||||||
"@angular/cli": "16.1.4",
|
"@angular/cli": "17.3.0",
|
||||||
"@angular/compiler": "16.1.4",
|
"@angular/compiler": "17.3.0",
|
||||||
"@angular/compiler-cli": "16.1.4",
|
"@angular/compiler-cli": "17.3.0",
|
||||||
"@angular/language-service": "16.1.4",
|
"@angular/language-server": "17.3.0",
|
||||||
"@angular/platform-browser-dynamic": "16.1.4",
|
"@angular/language-service": "17.3.0",
|
||||||
"@capacitor/android": "5.5.0",
|
"@angular/platform-browser-dynamic": "17.3.0",
|
||||||
"@capacitor/assets": "3.0.1",
|
"@capacitor/android": "5.7.3",
|
||||||
"@capacitor/cli": "5.5.0",
|
"@capacitor/assets": "3.0.4",
|
||||||
"@capacitor/ios": "5.5.0",
|
"@capacitor/cli": "5.7.3",
|
||||||
"@compodoc/compodoc": "1.1.19",
|
"@capacitor/ios": "5.7.3",
|
||||||
"@cypress/schematic": "1.7.0",
|
"@compodoc/compodoc": "1.1.23",
|
||||||
"@ionic/angular-toolkit": "10.0.0",
|
"@cypress/schematic": "2.5.1",
|
||||||
"@ionic/cli": "7.1.1",
|
"@ionic/angular-toolkit": "11.0.1",
|
||||||
|
"@ionic/cli": "7.2.0",
|
||||||
"@openstapps/prettier-config": "workspace:*",
|
"@openstapps/prettier-config": "workspace:*",
|
||||||
"@openstapps/tsconfig": "workspace:*",
|
"@openstapps/tsconfig": "workspace:*",
|
||||||
"@types/fontkit": "1.8.0",
|
"@types/fontkit": "2.0.7",
|
||||||
"@types/geojson": "1.0.6",
|
"@types/geojson": "1.0.6",
|
||||||
"@types/glob": "8.0.1",
|
"@types/glob": "8.1.0",
|
||||||
"@types/jasmine": "4.3.1",
|
"@types/jasmine": "5.1.4",
|
||||||
"@types/jasminewd2": "2.0.10",
|
"@types/jasminewd2": "2.0.13",
|
||||||
"@types/jsonpath": "0.2.0",
|
"@types/jsonpath": "0.2.0",
|
||||||
"@types/karma": "6.3.4",
|
"@types/karma": "6.3.8",
|
||||||
"@types/karma-coverage": "2.0.1",
|
"@types/karma-coverage": "2.0.3",
|
||||||
"@types/karma-jasmine": "4.0.2",
|
"@types/karma-jasmine": "4.0.5",
|
||||||
"@types/leaflet": "1.9.0",
|
|
||||||
"@types/leaflet.markercluster": "1.5.1",
|
|
||||||
"@types/node": "18.15.3",
|
"@types/node": "18.15.3",
|
||||||
"@types/semver": "7.5.6",
|
"@types/semver": "7.5.8",
|
||||||
"@typescript-eslint/eslint-plugin": "5.60.1",
|
"@typescript-eslint/eslint-plugin": "7.2.0",
|
||||||
"@typescript-eslint/parser": "5.60.1",
|
"@typescript-eslint/parser": "7.2.0",
|
||||||
"cordova-res": "0.15.4",
|
"cordova-res": "0.15.4",
|
||||||
"cypress": "13.2.0",
|
"cypress": "13.7.0",
|
||||||
"eslint": "8.43.0",
|
"eslint": "8.57.0",
|
||||||
"eslint-plugin-jsdoc": "46.4.2",
|
"eslint-plugin-jsdoc": "48.2.1",
|
||||||
"eslint-plugin-prettier": "4.2.1",
|
"eslint-plugin-prettier": "5.1.3",
|
||||||
"eslint-plugin-unicorn": "47.0.0",
|
"eslint-plugin-unicorn": "51.0.1",
|
||||||
"fast-deep-equal": "3.1.3",
|
"fast-deep-equal": "3.1.3",
|
||||||
"fontkit": "2.0.2",
|
"fontkit": "2.0.2",
|
||||||
"glob": "10.2.7",
|
"glob": "10.3.10",
|
||||||
"http-server": "14.1.1",
|
"http-server": "14.1.1",
|
||||||
"is-docker": "2.2.1",
|
"is-docker": "2.2.1",
|
||||||
"jasmine-core": "5.0.1",
|
"jasmine-core": "5.1.2",
|
||||||
"jasmine-spec-reporter": "7.0.0",
|
"jasmine-spec-reporter": "7.0.0",
|
||||||
"jetifier": "2.0.0",
|
"jetifier": "2.0.0",
|
||||||
"junit-report-merger": "6.0.2",
|
"junit-report-merger": "6.0.3",
|
||||||
"karma": "6.4.2",
|
"karma": "6.4.3",
|
||||||
"karma-chrome-launcher": "3.2.0",
|
"karma-chrome-launcher": "3.2.0",
|
||||||
"karma-coverage": "2.2.1",
|
"karma-coverage": "2.2.1",
|
||||||
"karma-jasmine": "5.1.0",
|
"karma-jasmine": "5.1.0",
|
||||||
"karma-junit-reporter": "2.0.1",
|
"karma-junit-reporter": "2.0.1",
|
||||||
"karma-mocha-reporter": "2.2.5",
|
"karma-mocha-reporter": "2.2.5",
|
||||||
"license-checker": "25.0.1",
|
"license-checker": "25.0.1",
|
||||||
"stylelint": "15.10.1",
|
"stylelint": "16.3.1",
|
||||||
"stylelint-config-clean-order": "5.0.1",
|
"stylelint-config-clean-order": "5.4.1",
|
||||||
"stylelint-config-prettier-scss": "1.0.0",
|
"stylelint-config-prettier-scss": "1.0.0",
|
||||||
"stylelint-config-recommended-scss": "12.0.0",
|
"stylelint-config-recommended-scss": "14.0.0",
|
||||||
"stylelint-config-standard-scss": "10.0.0",
|
"stylelint-config-standard-scss": "13.0.0",
|
||||||
"surge": "0.23.1",
|
"surge": "0.23.1",
|
||||||
"ts-node": "10.9.1",
|
"ts-node": "10.9.2",
|
||||||
"typescript": "5.1.6",
|
"typescript": "5.4.2",
|
||||||
"webpack-bundle-analyzer": "4.7.0"
|
"webpack-bundle-analyzer": "4.10.1"
|
||||||
},
|
},
|
||||||
"prettier": "@openstapps/prettier-config",
|
|
||||||
"cordova": {
|
"cordova": {
|
||||||
"plugins": {},
|
"plugins": {},
|
||||||
"platforms": [
|
"platforms": [
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// @ts-check
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2022 StApps
|
* Copyright (C) 2022 StApps
|
||||||
* 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
|
||||||
@@ -25,7 +26,6 @@ const config = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
ignorePath: ['.prettierignore', '../../.gitignore'],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default config;
|
export default config;
|
||||||
|
|||||||
@@ -12,33 +12,34 @@
|
|||||||
* 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 fs from 'fs';
|
import {readFileSync, writeFileSync} from 'fs';
|
||||||
import {omit} from '../src/app/_helpers/collections/omit';
|
import {omit, pickBy} from '@openstapps/collection-utils';
|
||||||
import {pickBy} from '../src/app/_helpers/collections/pick';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* accumulate and transform licenses based on two license files
|
* accumulate and transform licenses based on two license files
|
||||||
|
* @param {string} path
|
||||||
|
* @param {string} additionalLicensesPath
|
||||||
*/
|
*/
|
||||||
function accumulateFile(path: string, additionalLicensesPath: string) {
|
function accumulateFile(path, additionalLicensesPath) {
|
||||||
const packageJson = JSON.parse(fs.readFileSync('./package.json').toString());
|
const packageJson = JSON.parse(readFileSync('./package.json').toString());
|
||||||
const dependencies = packageJson.dependencies;
|
const dependencies = packageJson.dependencies;
|
||||||
|
|
||||||
console.log(`Accumulating licenses from ${path}`);
|
console.log(`Accumulating licenses from ${path}`);
|
||||||
|
|
||||||
fs.writeFileSync(
|
writeFileSync(
|
||||||
path,
|
path,
|
||||||
JSON.stringify(
|
JSON.stringify(
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
Object.entries<any>({
|
Object.entries({
|
||||||
...pickBy(JSON.parse(fs.readFileSync(path).toString()), (_, key: string) => {
|
...pickBy(JSON.parse(readFileSync(path).toString()), (_, key) => {
|
||||||
const parts = key.split('@');
|
const parts = /** @type {string} */ (key).split('@');
|
||||||
|
|
||||||
return dependencies[parts.slice(0, -1).join('@')] === parts[parts.length - 1];
|
return dependencies[parts.slice(0, -1).join('@')] === parts[parts.length - 1];
|
||||||
}),
|
}),
|
||||||
...JSON.parse(fs.readFileSync(additionalLicensesPath).toString()),
|
...JSON.parse(readFileSync(additionalLicensesPath).toString()),
|
||||||
})
|
})
|
||||||
.map(([key, value]) => ({
|
.map(([key, value]) => ({
|
||||||
licenseText: value.licenseFile && fs.readFileSync(value.licenseFile, 'utf8'),
|
licenseText: value.licenseFile && readFileSync(value.licenseFile, 'utf8'),
|
||||||
name: key,
|
name: key,
|
||||||
...omit(value, 'licenseFile', 'path'),
|
...omit(value, 'licenseFile', 'path'),
|
||||||
}))
|
}))
|
||||||
@@ -12,18 +12,20 @@
|
|||||||
* 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 fontkit, {Font} from 'fontkit';
|
import {openSync} from 'fontkit';
|
||||||
import config from '../icons.config';
|
import config from '../icons.config.mjs';
|
||||||
import {existsSync} from 'fs';
|
import {existsSync} from 'fs';
|
||||||
import {getUsedIconsHtml, getUsedIconsTS} from './gather-used-icons';
|
import {getUsedIconsHtml, getUsedIconsTS} from './gather-used-icons.mjs';
|
||||||
|
import {fetchCodePointMap} from './get-code-points.mjs';
|
||||||
|
|
||||||
const commandName = '"npm run minify-icons"';
|
const commandName = '"npm run minify-icons"';
|
||||||
const originalFont = fontkit.openSync(config.inputPath);
|
|
||||||
if (!existsSync(config.outputPath)) {
|
if (!existsSync(config.outputPath)) {
|
||||||
console.error(`Minified font not found. Run ${commandName} first.`);
|
console.error(`Minified font not found. Run ${commandName} first.`);
|
||||||
process.exit(-1);
|
process.exit(-1);
|
||||||
}
|
}
|
||||||
const modifiedFont = fontkit.openSync(config.outputPath);
|
|
||||||
|
/** @type {import('fontkit').Font} */
|
||||||
|
const modifiedFont = openSync(config.outputPath);
|
||||||
|
|
||||||
let success = true;
|
let success = true;
|
||||||
|
|
||||||
@@ -48,25 +50,16 @@ async function checkAll() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* @param {Record<string, string[]>} icons
|
||||||
*/
|
*/
|
||||||
function check(icons: Record<string, string[]>) {
|
async function check(icons) {
|
||||||
for (const [purpose, iconSet] of Object.entries(icons)) {
|
const codePoints = await fetchCodePointMap();
|
||||||
for (const icon of iconSet) {
|
|
||||||
if (!hasIcon(originalFont, icon)) {
|
for (const icon of Object.values(icons).flat()) {
|
||||||
success = false;
|
const codePoint = codePoints.get(icon);
|
||||||
console.error(`${purpose}: ${icon} does not exist. Typo?`);
|
if (!codePoint) throw new Error(`"${icon}" is not a valid icon`);
|
||||||
} else if (!hasIcon(modifiedFont, icon)) {
|
if (!modifiedFont.getGlyph(Number.parseInt(codePoint, 16))) {
|
||||||
success = false;
|
throw new Error(`"${icon}" (code point ${codePoint}) is missing`);
|
||||||
console.error(`${purpose}: ${icon} not found in minified font. Run ${commandName} to regenerate it.`);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
function hasIcon(font: Font, icon: string) {
|
|
||||||
return font.layout(icon).glyphs.some(it => it.isLigature);
|
|
||||||
}
|
|
||||||
@@ -14,34 +14,39 @@
|
|||||||
*/
|
*/
|
||||||
import {glob} from 'glob';
|
import {glob} from 'glob';
|
||||||
import {readFileSync} from 'fs';
|
import {readFileSync} from 'fs';
|
||||||
import {matchPropertyContent, matchTagProperties} from '../src/app/util/ion-icon/icon-match';
|
import {
|
||||||
|
matchPropertyAccess,
|
||||||
|
matchPropertyContent,
|
||||||
|
matchTagProperties,
|
||||||
|
} from '../src/app/util/ion-icon/icon-match.mjs';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* @returns {Promise<Record<string, string[]>>}
|
||||||
*/
|
*/
|
||||||
export async function getUsedIconsHtml(pattern = 'src/**/*.html'): Promise<Record<string, string[]>> {
|
export async function getUsedIconsHtml(pattern = 'src/**/*.html') {
|
||||||
return Object.fromEntries(
|
return Object.fromEntries(
|
||||||
(await glob(pattern))
|
(await glob(pattern))
|
||||||
.map(file => [
|
.map(file => [
|
||||||
file,
|
file,
|
||||||
(readFileSync(file, 'utf8')
|
readFileSync(file, 'utf8')
|
||||||
.match(matchTagProperties('ion-icon'))
|
.match(matchTagProperties('ion-icon'))
|
||||||
?.flatMap(match => {
|
?.flatMap(match => {
|
||||||
return match.match(matchPropertyContent(['name', 'md', 'ios']));
|
return match.match(matchPropertyContent(['name', 'md', 'ios']));
|
||||||
})
|
})
|
||||||
.filter(it => !!it) as string[]) || [],
|
.filter(it => !!it) || [],
|
||||||
])
|
])
|
||||||
.filter(([, values]) => values.length > 0),
|
.filter(([, values]) => values && values.length > 0),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* @returns {Promise<Record<string, string[]>>}
|
||||||
*/
|
*/
|
||||||
export async function getUsedIconsTS(pattern = 'src/**/*.ts'): Promise<Record<string, string[]>> {
|
export async function getUsedIconsTS(pattern = 'src/**/*.ts') {
|
||||||
|
const regex = matchPropertyAccess('SCIcon');
|
||||||
return Object.fromEntries(
|
return Object.fromEntries(
|
||||||
(await glob(pattern))
|
(await glob(pattern))
|
||||||
.map(file => [file, readFileSync(file, 'utf8').match(/(?<=Icon`)[\w-]+(?=`)/g) || []])
|
.map(file => [file, readFileSync(file, 'utf8').match(regex) || []])
|
||||||
.filter(([, values]) => values.length > 0),
|
.filter(([, values]) => values && values.length > 0),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
23
frontend/app/scripts/get-code-points.mjs
Normal file
23
frontend/app/scripts/get-code-points.mjs
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
const url =
|
||||||
|
'https://raw.githubusercontent.com/google/material-design-icons/master/' +
|
||||||
|
'variablefont/MaterialSymbolsRounded%5BFILL%2CGRAD%2Copsz%2Cwght%5D.codepoints';
|
||||||
|
|
||||||
|
export async function fetchCodePointMap() {
|
||||||
|
const icons = await fetch(url)
|
||||||
|
.then(it => it.text())
|
||||||
|
.then(it => new Map(it.split('\n').map(it => /** @type {[string, string]} */ (it.split(' ')))));
|
||||||
|
if (icons.size < 100) throw new Error(`Code point map is very small, is the URL incorrect? ${url}`);
|
||||||
|
return icons;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string[]} icons
|
||||||
|
*/
|
||||||
|
export async function getCodePoints(icons) {
|
||||||
|
const codePoints = await fetchCodePointMap();
|
||||||
|
return icons.map(icon => {
|
||||||
|
const code = codePoints.get(icon);
|
||||||
|
if (!code) throw new Error(`Code point for icon ${icon} not found`);
|
||||||
|
return code;
|
||||||
|
});
|
||||||
|
}
|
||||||
8
frontend/app/scripts/get-ip.mjs
Normal file
8
frontend/app/scripts/get-ip.mjs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import {networkInterfaces} from 'os';
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
Object.entries(networkInterfaces())
|
||||||
|
.map(([, info]) => info)
|
||||||
|
.flat()
|
||||||
|
.find(info => info && !info.internal && info.family === 'IPv4')?.address,
|
||||||
|
);
|
||||||
@@ -19,5 +19,4 @@ export interface IconConfig {
|
|||||||
inputPath: string;
|
inputPath: string;
|
||||||
outputPath: string;
|
outputPath: string;
|
||||||
additionalIcons?: {[purpose: string]: string[]};
|
additionalIcons?: {[purpose: string]: string[]};
|
||||||
codePoints?: {[name: string]: string};
|
|
||||||
}
|
}
|
||||||
@@ -14,16 +14,17 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||||
import fontkit from 'fontkit';
|
|
||||||
import {exec} from 'child_process';
|
import {exec} from 'child_process';
|
||||||
import config from '../icons.config';
|
import config from '../icons.config.mjs';
|
||||||
import {statSync} from 'fs';
|
import {statSync} from 'fs';
|
||||||
import {getUsedIconsHtml, getUsedIconsTS} from './gather-used-icons';
|
import {getUsedIconsHtml, getUsedIconsTS} from './gather-used-icons.mjs';
|
||||||
|
import {getCodePoints} from './get-code-points.mjs';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* @param {string[] | string} command
|
||||||
|
* @returns {Promise<string>}
|
||||||
*/
|
*/
|
||||||
async function run(command: string[] | string): Promise<string> {
|
async function run(command) {
|
||||||
const fullCommand = Array.isArray(command) ? command.join(' ') : command;
|
const fullCommand = Array.isArray(command) ? command.join(' ') : command;
|
||||||
console.log(`>> ${fullCommand}`);
|
console.log(`>> ${fullCommand}`);
|
||||||
|
|
||||||
@@ -44,7 +45,8 @@ async function run(command: string[] | string): Promise<string> {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
async function minifyIconFont() {
|
async function minifyIconFont() {
|
||||||
const icons = new Set<string>();
|
/** @type {Set<string>} */
|
||||||
|
const icons = new Set();
|
||||||
|
|
||||||
for (const iconSet of [
|
for (const iconSet of [
|
||||||
...Object.values(config.additionalIcons || []),
|
...Object.values(config.additionalIcons || []),
|
||||||
@@ -56,35 +58,7 @@ async function minifyIconFont() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('Icons used:', [...icons.values()].sort());
|
const glyphs = ['5f-7a', '30-39', ...(await getCodePoints([...icons]))].sort();
|
||||||
const font = fontkit.openSync(config.inputPath);
|
|
||||||
|
|
||||||
const glyphs: string[] = ['5f-7a', '30-39'];
|
|
||||||
for (const icon of icons) {
|
|
||||||
const iconGlyphs = font.layout(icon).glyphs;
|
|
||||||
if (iconGlyphs.length === 0) {
|
|
||||||
console.error(`${icon} not found in font. Typo?`);
|
|
||||||
process.exit(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
const codePoints = iconGlyphs
|
|
||||||
.flatMap(it => font.stringsForGlyph(it.id))
|
|
||||||
.flatMap(it => [...it])
|
|
||||||
.map(it => it.codePointAt(0)!.toString(16));
|
|
||||||
|
|
||||||
if (codePoints.length === 0) {
|
|
||||||
if (config.codePoints?.[icon]) {
|
|
||||||
glyphs.push(config.codePoints[icon]);
|
|
||||||
} else {
|
|
||||||
console.log();
|
|
||||||
console.error(`${icon} code point could not be determined. Add it to config.codePoints.`);
|
|
||||||
process.exit(-1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
glyphs.push(...codePoints);
|
|
||||||
}
|
|
||||||
glyphs.sort();
|
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
await run([
|
await run([
|
||||||
@@ -114,8 +88,10 @@ minifyIconFont();
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Bytes to respective units
|
* Bytes to respective units
|
||||||
|
* @param {number} value
|
||||||
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
function toByteUnit(value: number): string {
|
function toByteUnit(value) {
|
||||||
if (value < 1024) {
|
if (value < 1024) {
|
||||||
return `${value}B`;
|
return `${value}B`;
|
||||||
} else if (value < 1024 * 1024) {
|
} else if (value < 1024 * 1024) {
|
||||||
@@ -21,7 +21,7 @@ import {
|
|||||||
SCThingOriginType,
|
SCThingOriginType,
|
||||||
SCThingType,
|
SCThingType,
|
||||||
} from '@openstapps/core';
|
} from '@openstapps/core';
|
||||||
import packageInfo from '@openstapps/core/package.json';
|
import {CORE_VERSION} from '@openstapps/core';
|
||||||
import {Polygon} from 'geojson';
|
import {Polygon} from 'geojson';
|
||||||
|
|
||||||
// provides sample aggregations to be used in tests or backendless development
|
// provides sample aggregations to be used in tests or backendless development
|
||||||
@@ -195,7 +195,7 @@ export const sampleIndexResponse: SCIndexResponse = {
|
|||||||
},
|
},
|
||||||
auth: {},
|
auth: {},
|
||||||
backend: {
|
backend: {
|
||||||
SCVersion: packageInfo.version,
|
SCVersion: CORE_VERSION,
|
||||||
externalRequestTimeout: 5000,
|
externalRequestTimeout: 5000,
|
||||||
hiddenTypes: [SCThingType.DateSeries, SCThingType.Diff, SCThingType.Floor],
|
hiddenTypes: [SCThingType.DateSeries, SCThingType.Diff, SCThingType.Floor],
|
||||||
mappingIgnoredTags: [],
|
mappingIgnoredTags: [],
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {AnimationBuilder, AnimationController} from '@ionic/angular';
|
import {AnimationBuilder, AnimationController} from '@ionic/angular';
|
||||||
import {AnimationOptions} from '@ionic/angular/providers/nav-controller';
|
import {AnimationOptions} from '@ionic/angular/common/providers/nav-controller';
|
||||||
import {iosDuration, iosEasing, mdDuration, mdEasing} from './easings';
|
import {iosDuration, iosEasing, mdDuration, mdEasing} from './easings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ import {environment} from '../environments/environment';
|
|||||||
import {AppRoutingModule} from './app-routing.module';
|
import {AppRoutingModule} from './app-routing.module';
|
||||||
import {AppComponent} from './app.component';
|
import {AppComponent} from './app.component';
|
||||||
import {CatalogModule} from './modules/catalog/catalog.module';
|
import {CatalogModule} from './modules/catalog/catalog.module';
|
||||||
import {ConfigModule} from './modules/config/config.module';
|
|
||||||
import {ConfigProvider} from './modules/config/config.provider';
|
import {ConfigProvider} from './modules/config/config.provider';
|
||||||
import {DashboardModule} from './modules/dashboard/dashboard.module';
|
import {DashboardModule} from './modules/dashboard/dashboard.module';
|
||||||
import {DataModule} from './modules/data/data.module';
|
import {DataModule} from './modules/data/data.module';
|
||||||
@@ -70,6 +69,8 @@ import {setDefaultOptions} from 'date-fns';
|
|||||||
import {DateFnsConfigurationService} from 'ngx-date-fns';
|
import {DateFnsConfigurationService} from 'ngx-date-fns';
|
||||||
import {Capacitor} from '@capacitor/core';
|
import {Capacitor} from '@capacitor/core';
|
||||||
import {SplashScreen} from '@capacitor/splash-screen';
|
import {SplashScreen} from '@capacitor/splash-screen';
|
||||||
|
import maplibregl from 'maplibre-gl';
|
||||||
|
import {Protocol} from 'pmtiles';
|
||||||
|
|
||||||
registerLocaleData(localeDe);
|
registerLocaleData(localeDe);
|
||||||
|
|
||||||
@@ -91,6 +92,7 @@ export function initializerFactory(
|
|||||||
) {
|
) {
|
||||||
return async () => {
|
return async () => {
|
||||||
try {
|
try {
|
||||||
|
maplibregl.addProtocol('pmtiles', new Protocol().tile);
|
||||||
initLogger(logger);
|
initLogger(logger);
|
||||||
await storageProvider.init();
|
await storageProvider.init();
|
||||||
await configProvider.init();
|
await configProvider.init();
|
||||||
@@ -151,7 +153,6 @@ export function createTranslateLoader(http: HttpClient) {
|
|||||||
BrowserAnimationsModule,
|
BrowserAnimationsModule,
|
||||||
CatalogModule,
|
CatalogModule,
|
||||||
CommonModule,
|
CommonModule,
|
||||||
ConfigModule,
|
|
||||||
DashboardModule,
|
DashboardModule,
|
||||||
DataModule,
|
DataModule,
|
||||||
HebisModule,
|
HebisModule,
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
<!--
|
<!--
|
||||||
~ Copyright (C) 2023 StApps
|
~ Copyright (C) 2023 StApps
|
||||||
~ 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.
|
||||||
~
|
~
|
||||||
~ This program is distributed in the hope that it will be useful, but WITHOUT
|
~ This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
~ more details.
|
~ more details.
|
||||||
~
|
~
|
||||||
~ 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/>.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<ion-header>
|
<ion-header>
|
||||||
<ion-toolbar color="primary" mode="ios">
|
<ion-toolbar color="primary" mode="ios">
|
||||||
@@ -24,28 +24,24 @@
|
|||||||
</ion-header>
|
</ion-header>
|
||||||
<ion-content parallax>
|
<ion-content parallax>
|
||||||
<div class="licenses-content">
|
<div class="licenses-content">
|
||||||
<ion-card
|
@for (license of licenses; track license) {
|
||||||
*ngFor="let license of licenses"
|
<ion-card [href]="license.url || license.repository" rel="external" target="_blank">
|
||||||
[href]="license.url || license.repository"
|
<ion-card-header>
|
||||||
rel="external"
|
<ion-card-title>
|
||||||
target="_blank"
|
{{ license.name }}
|
||||||
>
|
<ion-icon [size]="16" [weight]="300" class="supertext-icon" name="open_in_browser"></ion-icon>
|
||||||
<ion-card-header>
|
</ion-card-title>
|
||||||
<ion-card-title>
|
@if (license.authors || license.publisher) {
|
||||||
{{ license.name }}
|
<ion-card-subtitle> {{ license.authors || license.publisher }} </ion-card-subtitle>
|
||||||
<ion-icon [size]="16" [weight]="300" class="supertext-icon" name="open_in_browser"></ion-icon>
|
}
|
||||||
</ion-card-title>
|
</ion-card-header>
|
||||||
|
<ion-card-content>
|
||||||
<ion-card-subtitle *ngIf="license.authors || license.publisher">
|
<ion-chip (click)="$event.preventDefault(); viewLicense(license)">
|
||||||
{{ license.authors || license.publisher }}
|
<ion-icon name="copyright"></ion-icon>
|
||||||
</ion-card-subtitle>
|
<ion-label>{{ license.licenses }} License</ion-label>
|
||||||
</ion-card-header>
|
</ion-chip>
|
||||||
<ion-card-content>
|
</ion-card-content>
|
||||||
<ion-chip (click)="$event.preventDefault(); viewLicense(license)">
|
</ion-card>
|
||||||
<ion-icon name="copyright"></ion-icon>
|
}
|
||||||
<ion-label>{{ license.licenses }} License</ion-label>
|
|
||||||
</ion-chip>
|
|
||||||
</ion-card-content>
|
|
||||||
</ion-card>
|
|
||||||
</div>
|
</div>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|||||||
@@ -12,24 +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/>.
|
||||||
*/
|
*/
|
||||||
ion-content > div {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
cdk-virtual-scroll-viewport {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
:host ::ng-deep {
|
|
||||||
.cdk-virtual-scroll-content-wrapper {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.virtual-scroll-expander {
|
|
||||||
clear: both;
|
|
||||||
}
|
|
||||||
|
|
||||||
.supertext-icon {
|
.supertext-icon {
|
||||||
height: 14px;
|
height: 14px;
|
||||||
|
|||||||
@@ -1,41 +1,56 @@
|
|||||||
<!--
|
<!--
|
||||||
~ Copyright (C) 2023 StApps
|
~ Copyright (C) 2023 StApps
|
||||||
~ 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.
|
||||||
~
|
~
|
||||||
~ This program is distributed in the hope that it will be useful, but WITHOUT
|
~ This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
~ more details.
|
~ more details.
|
||||||
~
|
~
|
||||||
~ 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/>.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<markdown *ngIf="content.type === 'markdown'" [data]="'value' | translateSimple : content"></markdown>
|
@if (content.type === 'markdown') {
|
||||||
<div *ngIf="content.type ==='section'">
|
<markdown [data]="'value' | translateSimple: content"></markdown>
|
||||||
<ion-card *ngIf="content.card; else noCard">
|
}
|
||||||
<ion-card-header>
|
@if (content.type === 'section') {
|
||||||
<ion-card-title>{{ 'title' | translateSimple : content }}</ion-card-title>
|
<div>
|
||||||
</ion-card-header>
|
@if (content.card) {
|
||||||
<ion-card-content>
|
<ion-card>
|
||||||
|
<ion-card-header>
|
||||||
|
<ion-card-title>{{ 'title' | translateSimple: content }}</ion-card-title>
|
||||||
|
</ion-card-header>
|
||||||
|
<ion-card-content>
|
||||||
|
<about-page-content [content]="content.content"></about-page-content>
|
||||||
|
</ion-card-content>
|
||||||
|
</ion-card>
|
||||||
|
} @else {
|
||||||
|
<h2>{{ 'title' | translateSimple: content }}</h2>
|
||||||
<about-page-content [content]="content.content"></about-page-content>
|
<about-page-content [content]="content.content"></about-page-content>
|
||||||
</ion-card-content>
|
}
|
||||||
</ion-card>
|
</div>
|
||||||
<ng-template #noCard>
|
}
|
||||||
<h2>{{ 'title' | translateSimple : content }}</h2>
|
@if (content.type === 'table') {
|
||||||
<about-page-content [content]="content.content"></about-page-content>
|
<ion-grid>
|
||||||
</ng-template>
|
@for (row of content.rows; track row) {
|
||||||
</div>
|
<ion-row>
|
||||||
<ion-grid *ngIf="content.type === 'table'">
|
@for (col of row; track col) {
|
||||||
<ion-row *ngFor="let row of content.rows">
|
<ion-col>
|
||||||
<ion-col *ngFor="let col of row">
|
<about-page-content [content]="col"></about-page-content>
|
||||||
<about-page-content [content]="col"></about-page-content>
|
</ion-col>
|
||||||
</ion-col>
|
}
|
||||||
</ion-row>
|
</ion-row>
|
||||||
</ion-grid>
|
}
|
||||||
<ion-item *ngIf="content.type === 'router link'" [routerLink]="content.link">
|
</ion-grid>
|
||||||
<ion-icon *ngIf="content.icon" [name]="content.icon" slot="start"></ion-icon>
|
}
|
||||||
<ion-label>{{ 'title' | translateSimple : content }}</ion-label>
|
@if (content.type === 'router link') {
|
||||||
</ion-item>
|
<ion-item [routerLink]="content.link">
|
||||||
|
@if (content.icon) {
|
||||||
|
<ion-icon [name]="$any(content.icon)" slot="start"></ion-icon>
|
||||||
|
}
|
||||||
|
<ion-label>{{ 'title' | translateSimple: content }}</ion-label>
|
||||||
|
</ion-item>
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,32 +1,37 @@
|
|||||||
<!--
|
<!--
|
||||||
~ Copyright (C) 2023 StApps
|
~ Copyright (C) 2023 StApps
|
||||||
~ 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.
|
||||||
~
|
~
|
||||||
~ This program is distributed in the hope that it will be useful, but WITHOUT
|
~ This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
~ more details.
|
~ more details.
|
||||||
~
|
~
|
||||||
~ 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/>.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<ion-header>
|
<ion-header>
|
||||||
<ion-toolbar color="primary" mode="ios">
|
<ion-toolbar color="primary" mode="ios">
|
||||||
<ion-buttons slot="start">
|
<ion-buttons slot="start">
|
||||||
<ion-back-button></ion-back-button>
|
<ion-back-button></ion-back-button>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
<ion-title *ngIf="content; else titleLoading">{{ 'title' | translateSimple : content }}</ion-title>
|
@if (content) {
|
||||||
<ng-template #titleLoading>
|
<ion-title>{{ 'title' | translateSimple: content }}</ion-title>
|
||||||
|
} @else {
|
||||||
<ion-title><ion-skeleton-text animated="true"></ion-skeleton-text></ion-title>
|
<ion-title><ion-skeleton-text animated="true"></ion-skeleton-text></ion-title>
|
||||||
</ng-template>
|
}
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
<ion-content parallax *ngIf="content">
|
@if (content) {
|
||||||
<ion-text>{{ 'about.VERSION_INFO' | translate: {name, version, stappsVersion} }}</ion-text>
|
<ion-content parallax>
|
||||||
<div class="page-content">
|
<ion-text>{{ 'about.VERSION_INFO' | translate: {name, version, stappsVersion} }}</ion-text>
|
||||||
<about-page-content *ngFor="let element of content.content" [content]="element"></about-page-content>
|
<div class="page-content">
|
||||||
</div>
|
@for (element of content.content; track element) {
|
||||||
</ion-content>
|
<about-page-content [content]="element"></about-page-content>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</ion-content>
|
||||||
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user