Compare commits

...

129 Commits

Author SHA1 Message Date
Rainer Killinger
3d19fc87e3 fix: hot fix for android 35 edge to edge window rendering 2025-08-28 13:05:52 +02:00
Rainer Killinger
80bcdad851 refactor: update app licenses file 2025-08-27 13:49:57 +02:00
Rainer Killinger
afd1c8d87e docs: update changelogs for release
ci: publish release
2025-08-27 13:00:27 +02:00
Rainer Killinger
6941f83b8f refactor: complete changeset 2025-08-27 12:02:10 +02:00
Rainer Killinger
3a274a3a7f refactor: upgrade to Capacitor 7 & Angular 18 2025-08-27 11:27:11 +02:00
Rainer Killinger
5a48342a8d docs: update changelogs for release
ci: publish release
2025-07-30 14:15:24 +02:00
Rainer Killinger
6b06de4019 refactor: update audit relevant nodemailer dependency 2025-07-30 13:58:25 +02:00
Rainer Killinger
c5c9bcf433 docs: update changelogs for release
ci: publish release
2025-07-30 12:44:30 +02:00
Rainer Killinger
b40ba7ad63 refactor: update elasticsearch and audit relevant dependencies 2025-07-30 12:40:59 +02:00
Jovan Krunić
362f6adf07 fix: use modal instead of menu inside of a split pane
Closes #234
2025-07-08 14:05:30 +02:00
Rainer Killinger
bbd6b0f874 fix: app missing chevron buttons in schedule module 2025-07-02 16:44:23 +02:00
Rainer Killinger
b1a9ba44d0 fix: app now requests backend version 4.0.0 2025-07-02 12:04:41 +02:00
Rainer Killinger
bee38d4a59 docs: update changelogs for release
ci: publish release
2025-07-01 16:29:42 +02:00
Rainer Killinger
a5c5c31d09 fix: app cypress e2e tests failing on core major version change 2025-07-01 15:33:27 +02:00
Rainer Killinger
c8e290200f refactor: update to node 22 2025-06-30 16:55:33 +02:00
Rainer Killinger
ef4e1f8ded refactor: move ion-menu-button for context menu filtering in ion-toolbar 2025-06-18 15:29:18 +02:00
Rainer Killinger
5759a1cbb1 refactor: update to ionic 8 and update capactior 6 + angular 17 dependencies 2025-06-18 15:29:11 +02:00
b8ac30b9d0 refactor: migrate to angular esbuild
refactor: migrate to ionic standalone components
refactor: migrate ion icons to a custom element
2025-06-18 14:19:56 +02:00
Rainer Killinger
436e1471a7 docs: update changelogs for release
ci: publish release
2024-12-02 11:26:24 +01:00
Rainer Killinger
4c9d330c88 fix: update jsonpath-plus depenency 2024-12-02 11:08:58 +01:00
Thea Schöbl
580ebee362 fix: user gets logged out when their token expires
Closes #230
2024-11-28 18:04:08 +00:00
Rainer Killinger
07e5c80223 docs: update changelogs for release
ci: publish release
2024-11-05 11:40:19 +01:00
Jovan Krunić
2ac840d845 fix: observable immediately returns false if scheduled beyond max delay
Closes #229
2024-11-04 18:04:48 +01:00
Thea Schöbl
8b581ef9ca feat: rework about pages changelog 2024-11-04 07:50:47 +00:00
Rainer Killinger
e2d5d4f187 docs: update changelogs for release
ci: publish release
2024-10-18 16:52:57 +02:00
Rainer Killinger
496b50d892 fix: update jsonpath-plus depenency 2024-10-18 16:12:29 +02:00
e6c17c860b fix: id cards are wiped/replaced when an error happens in the pipe 2024-10-11 15:33:03 +02:00
Jovan Krunić
bb1f596bfc fix: enable starting the app without backend
Closes #223
2024-09-30 11:03:53 +00:00
0c49fd8c34 refactor: update nix dependencies 2024-09-30 13:00:59 +02:00
Thea Schöbl
ce5016a992 fix: text of the feedback form not fully visible
Closes #227
2024-09-18 09:53:50 +00:00
3ac8c04765 fix: date range is now pipe has issues around boundaries 2024-08-06 17:43:59 +02:00
Rainer Killinger
5c260dd26b refactor: update android build dependencies for API level 34 2024-08-05 12:51:47 +00:00
Rainer Killinger
f2e1a6ddd5 docs: update changelogs for release
ci: publish release
2024-08-02 10:19:44 +02:00
Rainer Killinger
ccacfbf710 fix: publish-packages script 2024-08-02 10:18:57 +02:00
Rainer Killinger
b249b329f7 refactor: use development backend for non production environment 2024-08-01 17:44:21 +02:00
Jovan Krunić
7afc24f1bc fix: use major version config from storage when offline
Closes #218
2024-08-01 17:44:20 +02:00
Rainer Killinger
7276525dfa fix: app-builder image build due to nodejs versions <18.19 not being supported by angular 17 2024-08-01 15:24:59 +02:00
Jovan Krunić
c9e881582f refactor: set production version of the backend 2024-07-19 15:20:06 +02:00
Jovan Krunić
df681de083 feat: show title if available on library account profile
Closes #215
2024-07-19 15:20:06 +02:00
802a7a3fa7 fix: docs generation 2024-07-19 15:20:06 +02:00
Jovan Krunić
343d03e647 feat: library account adjustments
Closes #214
2024-07-19 15:20:06 +02:00
727b92911e fix: list item layout broken 2024-07-19 15:20:06 +02:00
11bc987807 fix: elasticsearch integration spams errors 2024-07-19 15:20:06 +02:00
Rainer Killinger
b8faae5988 docs: update changelogs for release
ci: publish release
2024-06-28 17:39:39 +02:00
67ab1fd613 fix: geo.point has wrong mapping 2024-06-28 17:25:32 +02:00
Rainer Killinger
142079bf0e refactor: set app backend to dev version 2024-06-28 12:02:59 +02:00
Rainer Killinger
5050ac90eb docs: update changelogs for release
ci: publish release
2024-06-28 09:28:39 +02:00
Rainer Killinger
688bc5f2e7 refactor: add changeset 2024-06-28 09:03:54 +02:00
Rainer Killinger
ad174dd7d7 refactor: use static map files from backend 2024-06-28 08:59:08 +02:00
Rainer Killinger
26e654f5b8 fix: app license overview 2024-06-27 14:57:24 +02:00
Rainer Killinger
5439484a90 fix: changelog typo 2024-06-27 12:06:52 +02:00
Rainer Killinger
68f3366a27 refactor: adjustments for recent PAIA changes 2024-06-27 09:23:55 +00:00
Jovan Krunić
dea9a82105 fix: do not fetch remote configuration if offline
Closes #206
2024-06-17 09:55:29 +00:00
39d2801114 feat: store id cards 2024-06-12 13:51:46 +02:00
Rainer Killinger
341b209092 refactor: display id-cards in their own modal 2024-06-05 11:07:30 +00:00
Rainer Killinger
a6b88d3534 refactor: add f-u specific changelogs 2024-05-27 16:27:37 +02:00
Rainer Killinger
be863daaef refactor: updated used licences within the app 2024-05-27 15:36:00 +02:00
2f64d69693 feat: migrate to protomaps and maplibre 2024-05-27 15:07:27 +02:00
964516d3cf fix: remove noUnused* TSConfig options
TSConfig options prevent Angular from compiling the app. This is
specifically harsh with the noUnused* rules, which require you to
strictly remove any unused variables even in dev mode while testing.
Since this case is already covered by ESLint, the TSConfig option was
removed.
2024-05-27 15:07:27 +02:00
71ff9fd960 fix: favorite button 2024-05-27 15:07:27 +02:00
abf9999461 feat: type-safe sc-icons 2024-05-27 15:07:26 +02:00
53c3d0ba0c refactor: replace rfdc with native structuredClone 2024-05-27 15:07:25 +02:00
Rainer Killinger
622481a3c9 docs: update changelogs for release\n\nci: publish release 2024-03-28 14:27:56 +01:00
Thea Schöbl
1ab5c0c355 fix: inPlace in list items is placed weird 2024-03-27 13:45:22 +00:00
Rainer Killinger
b0f6ffb21c refactor: ajdust app environment to backend version >= v3.1.0 2024-03-27 10:11:32 +01:00
Rainer Killinger
e658cff9d2 refactor: use GET for id-cards requests 2024-03-27 09:55:31 +01:00
Rainer Killinger
e71355a2fb fix: malformed Bearer header in id-cards provider 2024-03-27 09:55:30 +01:00
100607740b fix: angular lsp broken 2024-03-27 09:55:30 +01:00
Thea Schöbl
10c4466b37 feat: update to angular 17 2024-03-27 09:55:30 +01:00
Rainer Killinger
09faa66e98 fix: broken build and test stage 2024-03-27 09:55:30 +01:00
Rainer Killinger
7c5687111f fix: check-icons script in app 2024-03-27 09:55:30 +01:00
Rainer Killinger
c066028e49 refactor: update asdf .tool-versions 2024-03-27 09:55:30 +01:00
0858a26dc1 fix: dish prices sometimes go missing 2024-03-27 09:55:30 +01:00
8667603bd6 feat: export core version in package 2024-03-27 09:55:29 +01:00
65bc9a76b6 feat: add syncpack semver ranges 2024-03-27 09:55:29 +01:00
912ae42270 feat: add ability to check for existence of a field 2024-03-27 09:55:29 +01:00
c4a5d6e73b fix: exclude app.js and lib from typescript compliation 2024-03-27 09:55:29 +01:00
deed376c24 feat: enable checkJs by default 2024-03-27 09:55:29 +01:00
a4cc23e9a8 feat: add direnv for nix
feat: update nix flake to not rely on buildFHSUserEnv
2024-03-27 09:55:29 +01:00
e8d72683ef fix: backend tests break every year
refactor: update some backend unit tests
2024-03-27 09:55:28 +01:00
Rainer Killinger
e3d068f8d4 fix: iOS build resources 2024-03-27 09:55:28 +01:00
Rainer Killinger
b346d216a3 refactor: add asdf tool versioning file 2024-03-27 09:55:28 +01:00
dbb558508f fix: changeset crashes because it uses internal prettier version 2024-03-27 09:55:28 +01:00
Rainer Killinger
754d99c1b4 refactor: overhaul minimal-deployment compose file 2024-03-27 09:55:27 +01:00
Rainer Killinger
689ac68be3 fix: pin alpine version to 3.18 and add healthchecks 2024-03-06 11:45:40 +01:00
Rainer Killinger
d36d9596fc docs: update changelogs for release 2023-12-19 15:32:42 +01:00
Thea Schöbl
8d50f669e7 feat: collapse detail titles into header bar 2023-12-19 14:16:38 +01:00
Jovan Krunić
dce08d9c03 fix: reverse workaround after update of capacitor
Closes #179
2023-12-19 13:12:25 +00:00
Rainer Killinger
296054c8e0 docs: update changelogs for release
ci: publish release
2023-12-13 16:42:45 +01:00
859763367e fix: throw error if config import fails
feat: log used config in backend
2023-12-12 14:37:24 +01:00
Rainer Killinger
848fde4660 refactor: increase maxRequestBodySize to 2 MB 2023-12-11 13:00:52 +01:00
Rainer Killinger
bd1046a19a docs: update changelogs for release
ci: publish release
2023-12-08 18:03:41 +01:00
Rainer Killinger
3b9068197c fix: pettier config causing changeset to crash 2023-12-08 17:35:00 +01:00
Thea Schöbl
d2c8120255 feat: simplify version history api 2023-12-08 13:49:53 +00:00
d44204cf8d fix: remove old console.log statements 2023-12-06 17:15:03 +01:00
9d5dd05bb6 refactor: remove nullish coalecing pipe 2023-12-06 17:15:03 +01:00
288a49113f refactor: migrate to strict template checking 2023-12-06 17:14:55 +01:00
791b5c895d fix: hide navigation from jop posting search 2023-12-05 15:51:57 +00:00
d7a85b7fae feat: improved e2e tests 2023-12-05 15:17:00 +00:00
Rainer Killinger
bff2d985aa refactor: use latest backend (4.1.0) 2023-12-05 12:06:11 +00:00
Rainer Killinger
655efc9d29 fix: map location preview collapsed in webkit 2023-12-05 12:06:11 +00:00
Rainer Killinger
66712bdd24 fix: iOS app not starting 2023-12-05 11:19:46 +00:00
8b5b4c765b fix: my app card layout 2023-12-05 10:36:22 +00:00
Thea Schöbl
31a6ebfd3f feat: upgrade prettier to v3 2023-12-05 10:36:04 +00:00
Rainer Killinger
991ed1cb1f docs: update changelogs for release
ci: publish release
2023-12-01 19:05:06 +01:00
Rainer Killinger
1efe5c1449 refactor: don't open webpack-bundle-analyzer 2023-12-01 18:28:41 +01:00
Rainer Killinger
4dbeb9936c refactor: adjust f-u release version history 2023-12-01 18:19:36 +01:00
Rainer Killinger
29e6128141 fix: resources:ios script not being BSD compatible 2023-12-01 18:15:15 +01:00
Rainer Killinger
753dc7cd11 docs: update changelogs for release
ci: publish release
2023-12-01 16:42:33 +01:00
Rainer Killinger
4f3834c20e refactor: update capacitor-secure-storage-plugin 2023-12-01 13:42:22 +00:00
Rainer Killinger
cfb4aa364f refactor: add new book and periodical categories 2023-12-01 12:50:28 +00:00
Thea Schöbl
37945f7d19 feat: app release notes 2023-12-01 12:34:20 +00:00
5d47a17629 fix: android system bars always have light buttons 2023-12-01 12:23:38 +01:00
61587c7ba1 feat: add alert when critical errors prevent an app launch 2023-11-28 09:01:23 +00:00
066e374462 feat: upgrade to capacitor 5.0 2023-11-28 09:01:23 +00:00
a02190fe5a fix: flaky tests due to console.error checks 2023-11-27 19:54:28 +01:00
04e275e967 feat: add share option in detail views 2023-11-14 16:37:12 +01:00
f618725598 feat: full database clone feature in api-cli 2023-10-20 15:13:26 +02:00
theld
06b8ca109e feat: job portal
fix: disable function scoping lint rule
fix: outdated contributing docs for adding SCThings
2023-10-20 15:13:26 +02:00
f3ba8af051 fix: prevent duplicate publishes 2023-10-20 14:19:07 +02:00
2e0020b5c8 fix: non-publish branches fail on main 2023-10-20 14:15:22 +02:00
d17e8abea3 fix: docs fail to generate 2023-10-20 14:04:08 +02:00
ef092a8bff fix: library login fails 2023-10-17 18:00:55 +02:00
656f2266e3 feat: add scripts to enable login flow from localhost 2023-10-17 14:50:34 +02:00
Rainer Killinger
5c8c151917 docs: update changelogs for release
ci: publish release
2023-10-15 21:50:05 +02:00
Rainer Killinger
c020f075be fix: missing dependencies 2023-10-15 21:48:18 +02:00
98f21ac23b fix: distance disappears after 10 seconds 2023-10-15 16:41:52 +00:00
c460a3dbc0 fix: safari crashes with long opening hours change times 2023-10-15 16:28:42 +00:00
Rainer Killinger
5db3b7948a docs: update changelogs for release
ci: publish release
2023-10-13 18:22:48 +02:00
789 changed files with 39694 additions and 27775 deletions

View File

@@ -1,5 +0,0 @@
---
'@openstapps/app': major
---
Update to Angular 16.1

View File

@@ -1,5 +0,0 @@
---
'@openstapps/app': minor
---
Detail views now won't load data again if it is being navigated to from a list item

View File

@@ -1,11 +0,0 @@
---
'@openstapps/app': patch
---
Refactored Opening Hours
- Migrated Opening Hours to use OnPush change detection
- Fixed a bug where opening hours would not update correctly
- Lazy-load opening hours module to keep it out of the main bundle
- Added e2e tests to verify functionality
- Changed live update status to show exact minutes starting one hour before the next change

View File

@@ -1,8 +0,0 @@
---
'@openstapps/core-tools': major
---
Removed pack tool
Use a bundler like `tsup` in conjunction with an
`index.ts` that aggregates all exports instead.

View File

@@ -1,11 +0,0 @@
---
'@openstapps/api-plugin': major
'@openstapps/api-cli': major
'@openstapps/api': major
---
Split API into API, API-CLI and API-Plugin
Plugins are now required to use `api-plugin`.
Consumers of `api` can benefit from a slimmer package with
no NodeJS dependencies.

View File

@@ -1,31 +0,0 @@
---
'@openstapps/backend': major
---
Migrate config system to cosmiconfig
Configs are now written using type-checked JavaScript
```js
// @ts-check
// This file is now type-safe just like TypeScript, but
// without the compilation step
/** @type {import('@openstapps/package').Type} */
const foo = {};
```
You can write config files in JavaScript, JSON, or other
cosmiconfig-supported formats.
The config files now are
- `backendrc.{js,json,...}`
- `elasticsearchrc.{js,json,...}`
- `prometheusrc.{js,json,...}`
You can also split them into multiple files,
as well as using the `markdown.js` helper in
`config/default/tools` to include markdown files
as text (see `config/f-u/about-pages`)

View File

@@ -1,5 +0,0 @@
---
'@openstapps/app': patch
---
Use observable chains instead of change detection in the rating component

View File

@@ -1,51 +0,0 @@
---
'@openstapps/projectmanagement': major
'@openstapps/prettier-config': major
'@openstapps/es-mapping-generator': major
'@openstapps/backend-config': major
'@openstapps/eslint-config': major
'@openstapps/minimal-connector': major
'@openstapps/collection-utils': major
'@openstapps/minimal-plugin': major
'@openstapps/tsconfig': major
'@openstapps/api-plugin': major
'@openstapps/core-tools': major
'@openstapps/gitlab-api': major
'@openstapps/easy-ast': major
'@openstapps/api-cli': major
'@openstapps/backend': major
'@openstapps/logger': major
'@openstapps/proxy': major
'@openstapps/core': major
'@openstapps/app': major
'@openstapps/api': major
---
Move project to a turbo monorepo & pnpm
Internal dependencies are now defined using `"@openstapps/package": "workspace:*"`
- Removed extraneous files from packages
- `.npmrc`
- `.npmignore`
- `.mailmap`
- `.gitignore`
- `CONTRIBUTING.md`
- `LICENSE` (Project license file is added upon publishing, see [pnpm.io](https://pnpm.io/cli/publish))
- `package-lock.json`
- `.editorconfig`
- `.eslintrc.json` (moved eslint config to `package.json`)
- `.eslintignore`
- `.gitlab-ci.yml` (Most workflows are workspace-level)
- `.gitlab/**` (issue templates etc. are now workspace-level)
- `.dockerignore` (Docker files are determined by which files are deployed with `pnpm deploy`, as per `package.json/files`)
- TSConfig has been moved to its own package (You can now use `"extends": "@openstapps/tsconfig"`)
- Removed ESLint and Prettier peer dependency hell by injecting them through the `.pnpmfile.cjs`
- Added syncpack for keeping dependency versions in sync (and consistent key ordering in `package.json`)
- Replaced conventional changelog with changesets
- Apps with binaries now use a top level `app.js`
```js
#!/usr/bin/env node
import './lib/app.js';
```

View File

@@ -1,5 +0,0 @@
---
'@openstapps/app': minor
---
Added the ability to remove and add date series from their detail page

View File

@@ -1,5 +0,0 @@
---
'@openstapps/app': patch
---
Add a way to hide action chips on list items

View File

@@ -1,13 +0,0 @@
---
'@openstapps/core': major
---
Migrate away from [ts-optchain](https://www.npmjs.com/package/ts-optchain)
The package has been deprecated with the last releast being 4 years ago.
TypeScript as well as ECMAScript have native support for optional
chaining with the `?.` operator now.
You will need to update any packages that rely on the translator
module.

View File

@@ -1,25 +0,0 @@
---
'@openstapps/projectmanagement': patch
'@openstapps/prettier-config': patch
'@openstapps/es-mapping-generator': patch
'@openstapps/eslint-config': patch
'@openstapps/minimal-connector': patch
'@openstapps/minimal-plugin': patch
'@openstapps/core-tools': patch
'@openstapps/gitlab-api': patch
'@openstapps/backend': patch
'@openstapps/logger': patch
'@openstapps/proxy': patch
'@openstapps/core': patch
'@openstapps/api': patch
---
Migrated changelogs to changeset format
```js
import fs from 'fs';
const path = 'packages/logger/CHANGELOG.md';
fs.writeFileSync(path, fs.readFileSync(path, 'utf8').replace(/^#+\s+\[/gm, '## ['));
```

View File

@@ -1,8 +0,0 @@
---
'@openstapps/backend': minor
'@openstapps/api-cli': major
---
Migrate integration tests from docker-compose solution to a shell script
`api-cli` no longer builds as a Docker container as a result.

View File

@@ -1,34 +0,0 @@
---
'@openstapps/projectmanagement': major
'@openstapps/prettier-config': major
'@openstapps/es-mapping-generator': major
'@openstapps/backend-config': major
'@openstapps/eslint-config': major
'@openstapps/minimal-connector': major
'@openstapps/collection-utils': major
'@openstapps/minimal-plugin': major
'@openstapps/tsconfig': major
'@openstapps/api-plugin': major
'@openstapps/core-tools': major
'@openstapps/gitlab-api': major
'@openstapps/easy-ast': major
'@openstapps/api-cli': major
'@openstapps/backend': major
'@openstapps/logger': major
'@openstapps/proxy': major
'@openstapps/core': major
'@openstapps/app': major
'@openstapps/api': major
---
Migrate to ESM
CommonJS is no longer supported in any capacity. To use the new
version, you will need to migrate your package to ESM.
We recommend using `tsup` and `Node 18`.
```json
{
"type": "module"
}
```

View File

@@ -1,30 +0,0 @@
---
'@openstapps/projectmanagement': major
'@openstapps/prettier-config': major
'@openstapps/es-mapping-generator': major
'@openstapps/backend-config': major
'@openstapps/eslint-config': major
'@openstapps/minimal-connector': major
'@openstapps/collection-utils': major
'@openstapps/minimal-plugin': major
'@openstapps/tsconfig': major
'@openstapps/api-plugin': major
'@openstapps/core-tools': major
'@openstapps/gitlab-api': major
'@openstapps/easy-ast': major
'@openstapps/api-cli': major
'@openstapps/backend': major
'@openstapps/logger': major
'@openstapps/proxy': major
'@openstapps/core': major
'@openstapps/app': major
'@openstapps/api': major
---
Migrate package to Node 18
- Consumers of this package will need to migrate to Node 18 or
higher.
- Packages have been migrated from promisified `readFile` or
`readFileSync` towards `fs/promises`
- Packages use native `flatMap` now

View File

@@ -1,5 +0,0 @@
---
'@openstapps/gitlab-api': minor
---
Migrate from request-promise-native to got

View File

@@ -1,5 +0,0 @@
---
'@openstapps/app': patch
---
Fixed distance not updating in list items

View File

@@ -1,5 +0,0 @@
---
'@openstapps/projectmanagement': patch
---
Moved project-docs to the [GitLab Wiki](https://gitlab.com/openstapps/openstapps/-/wikis/home) repo.

View File

@@ -1,5 +0,0 @@
---
'@openstapps/app': patch
---
Change leaflet tiles to be inverted as a whole

View File

@@ -1,31 +0,0 @@
---
'@openstapps/projectmanagement': minor
'@openstapps/prettier-config': minor
'@openstapps/es-mapping-generator': minor
'@openstapps/backend-config': minor
'@openstapps/eslint-config': minor
'@openstapps/minimal-connector': minor
'@openstapps/collection-utils': minor
'@openstapps/minimal-plugin': minor
'@openstapps/tsconfig': minor
'@openstapps/api-plugin': minor
'@openstapps/core-tools': minor
'@openstapps/gitlab-api': minor
'@openstapps/easy-ast': minor
'@openstapps/api-cli': minor
'@openstapps/backend': minor
'@openstapps/logger': minor
'@openstapps/proxy': minor
'@openstapps/core': minor
'@openstapps/app': minor
'@openstapps/api': minor
---
Migrate tests to C8/Chai/Mocha
- `@testdeck` OOP testing has been removed.
- Tests have been unified
- CommonJS module mocking has been replaced through
refactoring of tests, as ES Modules cannot be mocked
(do yourself a favor and don't try to mock them)
- C8 now replaces NYC as a native coverage tool

View File

@@ -1,5 +0,0 @@
---
'@openstapps/es-mapping-generator': patch
---
Remove @openstapps/logger dependency

View File

@@ -1,6 +0,0 @@
---
'@openstapps/core': minor
'@openstapps/app': minor
---
Add support for web-service-provided id cards on the profile page

View File

@@ -1,5 +0,0 @@
---
'@openstapps/app': minor
---
Add directions to inPlace and place list items

View File

@@ -1,9 +0,0 @@
---
'@openstapps/app': minor
---
Improved calendar descriptions
- The dashboard quick link now has a more intuitive icon
- "Recurring" has been renamed to "Week Overview"
- Long words in calendar tabs will now break instead of overflowing

View File

@@ -1,68 +0,0 @@
{
"mode": "pre",
"tag": "next",
"initialVersions": {
"@openstapps/backend": "2.0.0",
"@openstapps/database": "2.0.0",
"@openstapps/proxy": "2.0.0",
"@openstapps/backend-config": "2.0.0",
"@openstapps/eslint-config": "2.0.0",
"@openstapps/prettier-config": "2.0.0",
"@openstapps/projectmanagement": "2.0.0",
"@openstapps/tsconfig": "2.0.0",
"@openstapps/minimal-connector": "2.0.0",
"@openstapps/minimal-deployment": "2.0.0",
"@openstapps/minimal-plugin": "2.0.0",
"@openstapps/app": "2.0.0",
"@openstapps/api": "2.0.0",
"@openstapps/api-cli": "2.0.0",
"@openstapps/api-plugin": "2.0.0",
"@openstapps/collection-utils": "2.0.0",
"@openstapps/core": "2.0.0",
"@openstapps/core-tools": "2.0.0",
"@openstapps/easy-ast": "2.0.0",
"@openstapps/es-mapping-generator": "2.0.0",
"@openstapps/gitlab-api": "2.0.0",
"@openstapps/logger": "2.0.0",
"@openstapps/app-builder-image": "3.0.0-next.3",
"@openstapps/node-base": "3.0.0-next.3",
"@openstapps/node-builder": "3.0.0-next.3"
},
"changesets": [
"bright-dryers-act",
"cool-jars-kiss",
"cuddly-bobcats-roll",
"dull-news-appear",
"five-ears-wash",
"fuzzy-walls-greet",
"giant-crabs-cheer",
"gorgeous-flowers-reflect",
"healthy-steaks-shop",
"honest-sheep-train",
"late-zoos-breathe",
"moody-parrots-develop",
"neat-hats-trade",
"new-pianos-joke",
"pretty-timers-complain",
"proud-wolves-end",
"quick-houses-count",
"rare-squids-bake",
"serious-meals-sin",
"silent-maps-float",
"silly-news-punch",
"smart-ghosts-shout",
"soft-donuts-fail",
"sour-coins-visit",
"spicy-snails-sort",
"stale-garlics-share",
"strange-hounds-repair",
"tall-ducks-dream",
"tame-mayflies-hug",
"tame-rings-dream",
"tasty-islands-smell",
"thick-weeks-compete",
"thin-camels-give",
"tidy-buses-reflect",
"tough-hairs-provide"
]
}

View File

@@ -1,8 +0,0 @@
---
'@openstapps/projectmanagement': major
'@openstapps/node-base': major
---
Move images to separate packages
Removed builder image due to migration to Kaniko

View File

@@ -1,13 +0,0 @@
---
'@openstapps/app': minor
---
Revamp "My Courses" section on profile page
The "My Courses" section on the profile page has been improved
- It will now show the upcoming courses for the next five days
- The section header is now consistent with the other sections
- The section now uses standard list items instead of the custom solution
Additionally, the profile page component has been cleaned up.

View File

@@ -1,8 +0,0 @@
---
'@openstapps/app': minor
---
Adjust map button and item behavior on different screen sizes
- Small screens will show the item without margins below the map actions
- Large screens will show the list item on the left side

View File

@@ -1,9 +0,0 @@
---
'@openstapps/eslint-config': minor
---
Update rules
- `unicorn/no-array-reduce` is now off
- `unicorn/no-non-null-assertion` is now off
- Removed prettier rules (use prettier formatting instead)

View File

@@ -1,7 +0,0 @@
---
'@openstapps/es-mapping-generator': major
---
Remove put-es-templates
The `put-es-templates` functionality has been removed.

View File

@@ -1,24 +0,0 @@
---
'@openstapps/projectmanagement': patch
'@openstapps/prettier-config': patch
'@openstapps/es-mapping-generator': patch
'@openstapps/backend-config': patch
'@openstapps/eslint-config': patch
'@openstapps/minimal-connector': patch
'@openstapps/collection-utils': patch
'@openstapps/minimal-plugin': patch
'@openstapps/tsconfig': patch
'@openstapps/api-plugin': patch
'@openstapps/core-tools': patch
'@openstapps/gitlab-api': patch
'@openstapps/easy-ast': patch
'@openstapps/api-cli': patch
'@openstapps/backend': patch
'@openstapps/logger': patch
'@openstapps/proxy': patch
'@openstapps/core': patch
'@openstapps/app': patch
'@openstapps/api': patch
---
Migrate away from @openstapps/configuration

View File

@@ -1,5 +0,0 @@
---
'@openstapps/projectmanagement': patch
---
Update release configs

View File

@@ -1,29 +0,0 @@
---
'@openstapps/projectmanagement': patch
'@openstapps/prettier-config': patch
'@openstapps/es-mapping-generator': patch
'@openstapps/backend-config': patch
'@openstapps/eslint-config': patch
'@openstapps/minimal-deployment': patch
'@openstapps/minimal-connector': patch
'@openstapps/collection-utils': patch
'@openstapps/minimal-plugin': patch
'@openstapps/tsconfig': patch
'@openstapps/node-builder': patch
'@openstapps/api-plugin': patch
'@openstapps/core-tools': patch
'@openstapps/gitlab-api': patch
'@openstapps/app-builder-image': patch
'@openstapps/easy-ast': patch
'@openstapps/database': patch
'@openstapps/node-base': patch
'@openstapps/api-cli': patch
'@openstapps/backend': patch
'@openstapps/logger': patch
'@openstapps/proxy': patch
'@openstapps/core': patch
'@openstapps/app': patch
'@openstapps/api': patch
---
Update to TypeScript 5.1.6

View File

@@ -1,5 +0,0 @@
---
'@openstapps/app': patch
---
Migrate collection helpers to use @openstapps/collection-utils

View File

@@ -1,8 +0,0 @@
---
'@openstapps/app': minor
---
Migrate to Ionic 7
- Migrate uses of `<ion-label>` with inputs to new syntax
- Fix infinite loop in schedule date picker (`datetime.confirm()` to `datetime.cancel()`)

View File

@@ -1,7 +0,0 @@
---
'@openstapps/api': minor
---
Migrate HttpClient to Node 18's native `fetch` API
HttpClient can now be used both in NodeJS and browsers.

View File

@@ -1,5 +0,0 @@
---
'@openstapps/app': patch
---
Fixed an issue that caused double and triple loading of data detail items through the route stack service

View File

@@ -1,7 +0,0 @@
---
'@openstapps/es-mapping-generator': major
'@openstapps/backend': major
'@openstapps/core': major
---
Migrate es mapping types from es-mapping-generator to .d.ts next to generated mappings

View File

@@ -1,5 +0,0 @@
---
'@openstapps/eslint-config': patch
---
Add license header enforcement rule (unfinished)

View File

@@ -1,5 +0,0 @@
---
'@openstapps/core': minor
---
Include openapi.json in built package

View File

@@ -1,26 +0,0 @@
---
'@openstapps/projectmanagement': minor
'@openstapps/minimal-connector': minor
'@openstapps/minimal-plugin': minor
'@openstapps/collection-utils': minor
'@openstapps/core-tools': minor
'@openstapps/gitlab-api': minor
'@openstapps/backend': minor
'@openstapps/logger': minor
'@openstapps/core': minor
'@openstapps/api': minor
---
Migrate away from `@krlwlfrt/async-pool`
```ts
import {mapAsyncLimit} from '@openstapps/collection-utils';
await mapAsyncLimit(
[1, 2, 3],
async it => {
await someNetworkRequest(it);
},
5,
);
```

View File

@@ -1,5 +0,0 @@
---
'@openstapps/app': minor
---
Migrate away from JIT compilation

View File

@@ -1,5 +0,0 @@
---
'@openstapps/logger': patch
---
Fix an issue with chalk terminal colors in tests

View File

@@ -1,9 +0,0 @@
---
'@openstapps/core-tools': major
---
Migrate openapi generation to output single file
The OpenAPI generator now outputs a single file instead
of a directory with the `openapi.json` and copied schema
files.

View File

@@ -1,6 +0,0 @@
---
'@openstapps/app': patch
---
Migrate unit tests to karma-coverage and junit reports.
Fixes an issue where coverage reports would not be generated.

View File

@@ -1,5 +0,0 @@
---
'@openstapps/app': minor
---
Map items are now native list items

View File

@@ -1,5 +0,0 @@
---
'@openstapps/projectmanagement': minor
---
Migrate moment.js to date-fns

View File

@@ -1,23 +0,0 @@
---
'@openstapps/projectmanagement': major
'@openstapps/es-mapping-generator': major
'@openstapps/minimal-connector': major
'@openstapps/collection-utils': major
'@openstapps/minimal-plugin': major
'@openstapps/api-plugin': major
'@openstapps/core-tools': major
'@openstapps/gitlab-api': major
'@openstapps/easy-ast': major
'@openstapps/api-cli': major
'@openstapps/backend': major
'@openstapps/logger': major
'@openstapps/proxy': major
'@openstapps/core': major
'@openstapps/api': major
---
Migrate build system to `tsup`
All packages now use an `index.ts` file to expose contents.
You will need to migrate paths from `import foo from '@scope/package/lib/foo` to `import foo from '@scope/package'`

View File

@@ -1,9 +0,0 @@
---
'@openstapps/core-tools': major
'@openstapps/easy-ast': major
---
Migrate easy-ast to separate package
The `easy-ast` part of `core-tools` has been moved to its own package.
For migration, simply use the new package.

View File

@@ -1,5 +0,0 @@
---
'@openstapps/core-tools': patch
---
Migrate from away from lodash

View File

@@ -1,5 +0,0 @@
---
'@openstapps/app': minor
---
Replaced simple links with list items in date-series detail

View File

@@ -1,5 +0,0 @@
---
'@openstapps/app': patch
---
Make section swiper buttons reactive

View File

@@ -1,5 +0,0 @@
---
'@openstapps/app': minor
---
Use event title for date series instead of the generic date series title

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use flake

4
.gitignore vendored
View File

@@ -24,6 +24,7 @@ report-junit.xml
# NixOS flake
result
hsperfdata_root
.direnv/
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
@@ -97,7 +98,8 @@ typings/
# ignore ide files
.idea
.vscode
.vscode?*
!.vscode/launch.json
# ignore lib
lib

View File

@@ -21,13 +21,7 @@ include:
- local: /.gitlab/publishing.gitlab-ci.yml
variables:
TURBO_CACHE_BYPASS:
value: ''
options:
- '--force'
- '--no-cache'
- ''
description: Bypass turbo cache
TURBO_CACHE_BYPASS: "--force --no-cache"
default:
image: registry.gitlab.com/openstapps/openstapps/node-builder
@@ -36,10 +30,7 @@ default:
interruptible: true
before_script:
- corepack enable
- corepack prepare pnpm@latest-8 --activate
- echo TURBO_API=$TURBO_API >> .env.local
- echo TURBO_TOKEN=$TURBO_TOKEN >> .env.local
- echo TURBO_TEAM=$TURBO_TEAM >> .env.local
- corepack prepare pnpm@latest-10 --activate
- pnpm config set store-dir .pnpm-store
cache: &pnpm_cache
key:
@@ -63,13 +54,13 @@ build:
# - pnpm i --prefer-offline
# - pnpm build:full:skip || pnpm i -r --prefer-offline
- pnpm install
# TODO: whats the benifit for CI? something doesn't work with git here...
# TODO: whats the benefit for CI? something doesn't work with git here...
# "🦋 error Error: Failed to find where HEAD diverged from master. Does master exist?"
# - pnpm changeset:status
- pnpm build:full $TURBO_CACHE_BYPASS
- .gitlab/ci/enableGitlabReviewToolbar.sh frontend/app/www/index.html "$CI_PROJECT_ID" "$CI_OPEN_MERGE_REQUESTS"
- cp frontend/app/www/index.html frontend/app/www/200.html
- pnpm dlx surge -p frontend/app/www -d https://$CI_PROJECT_NAME-$DEPLOY_ID.surge.sh/
- .gitlab/ci/enableGitlabReviewToolbar.sh frontend/app/www/browser/index.html "$CI_PROJECT_ID" "$CI_OPEN_MERGE_REQUESTS"
- cp frontend/app/www/browser/index.html frontend/app/www/browser/200.html
- pnpm dlx surge -p frontend/app/www/browser -d https://$CI_PROJECT_NAME-$DEPLOY_ID.surge.sh/
cache:
<<: *pnpm_cache
policy: pull-push
@@ -105,13 +96,7 @@ unit:
stage: test
needs: ['build']
script:
# - pnpm config set recursive-install false
# - pnpm i --prefer-offline
# - pnpm test:skip || pnpm i -r --prefer-offline
- pnpm install
- cd node_modules/.pnpm/re2*/node_modules/re2
- npm run install
- cd $CI_PROJECT_DIR
- pnpm test $TURBO_CACHE_BYPASS
coverage: '/Statements[^:]*\:[^:]*\s+([\d\.]+)%/'
artifacts:
@@ -133,7 +118,7 @@ audit:
allow_failure: true
needs: []
script:
- pnpm audit --prod
- pnpm audit --prod --audit-level critical
rules:
- if: $CI_COMMIT_BRANCH == 'main'
allow_failure: false

View File

@@ -1,6 +1,11 @@
.limit_publish_pipelines:
rules:
- if: '($CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "develop") && $CI_COMMIT_MESSAGE =~ /ci: publish release/ && $CI_PIPELINE_SOURCE != "schedule"'
- if: '$CI_COMMIT_BRANCH == "develop" && $CI_COMMIT_MESSAGE =~ /ci: publish prerelease/ && $CI_PIPELINE_SOURCE != "schedule"'
variables:
PUBLISH_TAG: next
- if: '$CI_COMMIT_BRANCH == "main" && $CI_COMMIT_MESSAGE =~ /ci: publish release/ && $CI_PIPELINE_SOURCE != "schedule"'
variables:
PUBLISH_TAG: latest
deploy:
stage: publish
@@ -22,10 +27,8 @@ publish image:
- tags
needs: ['deploy']
image:
name: gcr.io/kaniko-project/executor:v1.12.1-debug
name: gcr.io/kaniko-project/executor:v1.24.0-debug
entrypoint: [""]
variables:
PUBLISH_TAG: next
script:
- >
/kaniko/executor
@@ -50,9 +53,6 @@ publish image:
- IMAGE_NAME: app
DEPLOY_DIR: frontend/app
rules:
- if: $CI_COMMIT_BRANCH == 'main'
variables:
PUBLISH_TAG: latest
- !reference [.limit_publish_pipelines, rules]
publish packages:
@@ -61,16 +61,12 @@ publish packages:
variables:
GIT_STRATEGY: clone
GIT_DEPTH: 0
PUBLISH_TAG: next
script:
- pnpm install
- pnpm build
- pnpm config set '//registry.npmjs.org/:_authToken' "${NPM_AUTH_TOKEN}"
- pnpm publish -r --publish-branch ${CI_COMMIT_BRANCH} --tag ${PUBLISH_TAG} --no-git-checks # TODO: Git checks...
rules:
- if: $CI_COMMIT_BRANCH == 'main'
variables:
PUBLISH_TAG: latest
- !reference [.limit_publish_pipelines, rules]
publish docs:
@@ -84,5 +80,4 @@ publish docs:
paths:
- public
rules:
- if: $CI_COMMIT_BRANCH == 'main'
- !reference [.limit_publish_pipelines, rules]

1
.prettierignore Normal file
View File

@@ -0,0 +1 @@
pnpm-lock.yaml

View File

@@ -2,7 +2,13 @@
/** @type {import('syncpack').RcFile} */
const config = {
semverRange: '',
semverGroups: [
{
range: '',
dependencies: ['**'],
packages: ['**'],
}
],
source: ['package.json', '**/package.json'],
indent: ' ',
sortFirst: [
@@ -21,6 +27,7 @@ const config = {
'bin',
'files',
'engines',
'packageManager',
'scripts',
'dependencies',
'devDependencies',
@@ -49,7 +56,7 @@ const config = {
{
label: 'Packages should use workspace version',
dependencies: ['@openstapps/**'],
dependencyTypes: ['prod', 'dev'],
dependencyTypes: ['prod', 'dev', 'peer'],
packages: ['**'],
pinVersion: 'workspace:*',
},

3
.tool-versions Normal file
View File

@@ -0,0 +1,3 @@
nodejs 22.16.0
pnpm 10.12.3
python 3.11.5

23
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,23 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Chrome",
"request": "launch",
"type": "chrome",
"url": "http://localhost:8100",
"webRoot": "${workspaceFolder}/frontend/app/www"
},
{
"type":"node",
"request": "launch",
"name": "Run mocha for nodejs workspace",
"runtimeExecutable": "${fileDirname}/../node_modules/.bin/c8",
"cwd": "${fileDirname}/../",
"runtimeArgs": ["--config", "${workspaceFolder}/.c8rc.json", "${fileDirname}/../node_modules/.bin/mocha", "--exit", "--reporter", "spec"]
},
]
}

View File

@@ -37,13 +37,13 @@ Adding new types requires changes at multiple locations for it to work correctly
- Add your SCThing and SCThingWithoutReferences to `src/things/your-thing-name.ts` and make them extend `SCThingWithoutReferences` and `SCThing` respectively
- Add your SCThingMeta to `src/things/your-thing-name.ts` and make it extend `SCThingMeta`
- Add your SCThingMeta to `SCClasses` in `src/meta.ts`
- Add your SCThing to `SCThingsWithoutDiff` in `src/meta.ts`
- Add your SCThing to `SCIndexableThings ` in `src/meta.ts`
- Add your SCThingWithoutReferences to `SCAssociatedThingWithoutReferences` in `src/meta.ts`
- Add your SCThing to `SCAssociatedThing` in `src/meta.ts`
- Add your SCThing to the `SCThingType` enum in `src/things/abstract/thing.ts`
- Add an example file for your SCThing in `test/resources/YourThingName.json`
- Add the following lines for your SCThing in `test/type.spec.ts`:
- Make sure your SCThing (but not SCThingWithoutReferences!) includes the `@indexable` and `@validatable` JSDoc annotations, otherwise neither JSON Schemas nor Elasticsearch mappings will be generated
```typescript
/**
* Types of properties of SCYourThingName

View File

@@ -9,8 +9,8 @@ integration:
- name: registry.gitlab.com/openstapps/openstapps/database:latest
alias: elasticsearch
script:
- pnpm --filter=@openstapps/backend install
- pnpm test:integration:backend
- pnpm install
- pnpm test:integration:backend --force --no-cache
artifacts:
when: on_failure
paths:

View File

@@ -1,5 +1,270 @@
# @openstapps/backend
## 4.0.3
### Patch Changes
- 3a274a3a: Upgrade to Capacitor 7 and Anuglar 18
- @openstapps/core@4.0.2
- @openstapps/core-tools@4.0.2
- @openstapps/logger@4.0.2
## 4.0.2
### Patch Changes
- 6b06de40: Updated nodemailer dependency
- Updated dependencies [6b06de40]
- @openstapps/logger@4.0.2
- @openstapps/core@4.0.2
- @openstapps/core-tools@4.0.2
## 4.0.1
### Patch Changes
- b40ba7ad: Updated Elasticsearch dependency
- @openstapps/core@4.0.0
## 4.0.0
### Major Changes
- c8e29020: Update to Node 22
### Patch Changes
- Updated dependencies [c8e29020]
- @openstapps/core@4.0.0
- @openstapps/core-tools@4.0.0
- @openstapps/logger@4.0.0
## 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
### Patch Changes
- Fix backend rejecting plugins
- Fix backend sliently falling back to default configs
## 3.1.1
### Patch Changes
- Fix version history offered by backend
- Updated dependencies
- @openstapps/core@3.1.1
## 3.1.0
### Minor Changes
- 06b8ca10: Add job portal feature
### Patch Changes
- Updated dependencies [06b8ca10]
- @openstapps/core@3.1.0
## 3.0.1
### Patch Changes
- Fix missing dependency
## 3.0.0
### Major Changes
- 64caebaf: Migrate config system to cosmiconfig
Configs are now written using type-checked JavaScript
```js
// @ts-check
// This file is now type-safe just like TypeScript, but
// without the compilation step
/** @type {import('@openstapps/package').Type} */
const foo = {};
```
You can write config files in JavaScript, JSON, or other
cosmiconfig-supported formats.
The config files now are
- `backendrc.{js,json,...}`
- `elasticsearchrc.{js,json,...}`
- `prometheusrc.{js,json,...}`
You can also split them into multiple files,
as well as using the `markdown.js` helper in
`config/default/tools` to include markdown files
as text (see `config/f-u/about-pages`)
- 64caebaf: Move project to a turbo monorepo & pnpm
Internal dependencies are now defined using `"@openstapps/package": "workspace:*"`
- Removed extraneous files from packages
- `.npmrc`
- `.npmignore`
- `.mailmap`
- `.gitignore`
- `CONTRIBUTING.md`
- `LICENSE` (Project license file is added upon publishing, see [pnpm.io](https://pnpm.io/cli/publish))
- `package-lock.json`
- `.editorconfig`
- `.eslintrc.json` (moved eslint config to `package.json`)
- `.eslintignore`
- `.gitlab-ci.yml` (Most workflows are workspace-level)
- `.gitlab/**` (issue templates etc. are now workspace-level)
- `.dockerignore` (Docker files are determined by which files are deployed with `pnpm deploy`, as per `package.json/files`)
- TSConfig has been moved to its own package (You can now use `"extends": "@openstapps/tsconfig"`)
- Removed ESLint and Prettier peer dependency hell by injecting them through the `.pnpmfile.cjs`
- Added syncpack for keeping dependency versions in sync (and consistent key ordering in `package.json`)
- Replaced conventional changelog with changesets
- Apps with binaries now use a top level `app.js`
```js
#!/usr/bin/env node
import './lib/app.js';
```
- 64caebaf: Migrate to ESM
CommonJS is no longer supported in any capacity. To use the new
version, you will need to migrate your package to ESM.
We recommend using `tsup` and `Node 18`.
```json
{
"type": "module"
}
```
- 64caebaf: Migrate package to Node 18
- Consumers of this package will need to migrate to Node 18 or
higher.
- Packages have been migrated from promisified `readFile` or
`readFileSync` towards `fs/promises`
- Packages use native `flatMap` now
- 0a7e6af1: Migrate es mapping types from es-mapping-generator to .d.ts next to generated mappings
- 64caebaf: Migrate build system to `tsup`
All packages now use an `index.ts` file to expose contents.
You will need to migrate paths from `import foo from '@scope/package/lib/foo` to `import foo from '@scope/package'`
### Minor Changes
- 64caebaf: Migrate integration tests from docker-compose solution to a shell script
`api-cli` no longer builds as a Docker container as a result.
- 64caebaf: Migrate tests to C8/Chai/Mocha
- `@testdeck` OOP testing has been removed.
- Tests have been unified
- CommonJS module mocking has been replaced through
refactoring of tests, as ES Modules cannot be mocked
(do yourself a favor and don't try to mock them)
- C8 now replaces NYC as a native coverage tool
- 64caebaf: Migrate away from `@krlwlfrt/async-pool`
```ts
import {mapAsyncLimit} from '@openstapps/collection-utils';
await mapAsyncLimit(
[1, 2, 3],
async it => {
await someNetworkRequest(it);
},
5,
);
```
### Patch Changes
- 64caebaf: Migrated changelogs to changeset format
```js
import fs from 'fs';
const path = 'packages/logger/CHANGELOG.md';
fs.writeFileSync(path, fs.readFileSync(path, 'utf8').replace(/^#+\s+\[/gm, '## ['));
```
- 98546a97: Migrate away from @openstapps/configuration
- 23481d0d: Update to TypeScript 5.1.6
- Updated dependencies [98546a97]
- Updated dependencies [64caebaf]
- Updated dependencies [98546a97]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [1f62b5c5]
- Updated dependencies [98546a97]
- Updated dependencies [23481d0d]
- Updated dependencies [0a7e6af1]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [98546a97]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [64caebaf]
- Updated dependencies [98546a97]
- @openstapps/core-tools@3.0.0
- @openstapps/logger@3.0.0
- @openstapps/core@3.0.0
## 3.0.0-next.4
### Patch Changes

View File

@@ -9,4 +9,6 @@ ENV NODE_ENV=production
WORKDIR /app
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"]

View File

@@ -1,5 +1,3 @@
// @ts-check
/**
* This is the database configuration for the technical university of berlin
*

View File

@@ -22,6 +22,7 @@ const app = {
name: 'Goethe-Uni',
privacyPolicyUrl: 'https://mobile.server.uni-frankfurt.de/_static/privacy.md',
settings: [userGroupSetting, languageSetting],
versionHistory: [],
};
export default app;

View File

@@ -1,4 +1,3 @@
// @ts-check
import {SCSettingInputType, SCThingOriginType, SCThingType} from '@openstapps/core';
/** @type {import('@openstapps/core').SCLanguageSetting} */

View File

@@ -1,4 +1,3 @@
// @ts-check
/** @type {import('@openstapps/core').SCAppConfigurationMenuCategory[]} */
const menus = [
{
@@ -56,6 +55,19 @@ const menus = [
},
},
},
{
icon: 'work',
route: '/jobs',
title: 'job postings',
translations: {
de: {
title: 'Jobangebote',
},
en: {
title: 'job postings',
},
},
},
],
title: 'overview',
route: '/overview',
@@ -100,7 +112,7 @@ const menus = [
icon: 'school',
items: [
{
icon: 'grade',
icon: 'star',
route: '/favorites',
title: 'favorites',
translations: {

View File

@@ -1,4 +1,3 @@
// @ts-check
import {SCSettingInputType, SCThingOriginType, SCThingType} from '@openstapps/core';
/** @type {import('@openstapps/core').SCUserGroupSetting} */
@@ -6,8 +5,8 @@ const userGroupSetting = {
categories: ['profile'],
defaultValue: 'students',
description:
'The user group the app is going to be used.' +
'This settings for example is getting used for the predefined price category of mensa meals.',
'The user group the app is going to use primarily.' +
' This settings for example is getting used for the predefined price category of mensa meals.',
inputType: SCSettingInputType.SingleChoice,
name: 'group',
order: 1,
@@ -26,7 +25,7 @@ const userGroupSetting = {
},
en: {
description:
'The user group the app is going to be used.' +
'The user group the app is going to use primarily.' +
' This settings for example is getting used for the predefined price category of mensa meals.',
name: 'Group',
values: ['students', 'employees', 'guests'],

View File

@@ -1,4 +1,3 @@
// @ts-check
import {SCThingType} from '@openstapps/core';
/** @type {import('@openstapps/core').SCBackendAggregationConfiguration[]} */

View File

@@ -1,4 +1,3 @@
// @ts-check
import {
month,
sommerRange,

View File

@@ -1,4 +1,3 @@
// @ts-check
import {SCThingType} from '@openstapps/core';
import aggregations from './aggregations.js';
import boostings from './boostings.js';
@@ -17,7 +16,7 @@ export const backend = {
hiddenTypes: [SCThingType.DateSeries, SCThingType.Diff, SCThingType.Floor],
mappingIgnoredTags: ['minlength', 'pattern', 'see', 'tjs-format'],
maxMultiSearchRouteQueries: 5,
maxRequestBodySize: 512 * 1024,
maxRequestBodySize: 2e6,
name: 'Goethe-Universität Frankfurt am Main',
namespace: '909a8cbc-8520-456c-b474-ef1525f14209',
sortableFields: [

View File

@@ -1,4 +1,3 @@
// @ts-check
import app from './app/index.js';
import {backend, internal} from './backend/index.js';

View File

@@ -1,5 +1,3 @@
// @ts-check
/**
* This is the default configuration for elasticsearch (a database)
*
@@ -11,13 +9,13 @@
*
* To get more information about the meaning of specific fields, please use your IDE to read the TSDoc documentation.
*
* @type {import('../../src/storage/elasticsearch/types/elasticsearch-config.js')}
* @type {import('../../src/storage/elasticsearch/types/elasticsearch-config.js').ElasticsearchConfigFile}
*/
const config = {
internal: {
database: {
name: 'elasticsearch',
version: '5.6',
version: '8.4.2',
query: {
minMatch: '75%',
queryType: 'dis_max',

View File

@@ -1,4 +1,3 @@
// @ts-check
import {readFile} from 'fs/promises';
import {SCAboutPageContentType} from '@openstapps/core';

View File

@@ -1,4 +1,3 @@
// @ts-check
/**
* Generates a range of numbers that represent consecutive calendar months
*

View File

@@ -0,0 +1,37 @@
import {readFile, readdir} from 'fs/promises';
import url from 'url';
import path from 'path';
/**
* @example version(1, import.meta.url)
* @param options {Omit<import('@openstapps/core').SCAppVersionInfo, 'releaseNotes' | 'translations'>}
* @param base {string}
* @returns {Promise<import('@openstapps/core').SCAppVersionInfo>}
*/
export async function version(options, base) {
const de = await readFile(new URL(`${options.version}.de.md`, base), 'utf8');
const en = await readFile(new URL(`${options.version}.en.md`, base), 'utf8');
return {
...options,
releaseNotes: de,
translations: {
en: {
releaseNotes: en,
},
},
};
}
/**
* @param base {string} Base path of the file as `import.meta.url`
* @returns {Promise<import('@openstapps/core').SCAppVersionInfo[]>}
*/
export async function versions(base) {
const directory = await readdir(path.dirname(url.fileURLToPath(base)));
const versions = [
...new Set(directory.filter(it => it.endsWith('.md')).map(it => it.replace(/\.\w+\.md$/, ''))),
].sort((a, b) => -a.localeCompare(b, undefined, {numeric: true}));
return Promise.all(versions.map(versionName => version({version: versionName}, base)));
}

View File

@@ -1,4 +1,3 @@
// @ts-check
import {SCAboutPageContentType} from '@openstapps/core';
import {markdown} from '../../default/tools/markdown.js';

View File

@@ -1,4 +1,3 @@
// @ts-check
import {SCAboutPageContentType} from '@openstapps/core';
/** @type {import('@openstapps/core').SCAboutPage} */

View File

@@ -1,4 +1,3 @@
// @ts-check
import about from './about.js';
import imprint from './imprint.js';
import privacy from './privacy.js';

View File

@@ -1,4 +1,3 @@
// @ts-check
import {markdown} from '../../default/tools/markdown.js';
/** @type {import('@openstapps/core').SCAboutPage} */

View File

@@ -1,7 +1,7 @@
// @ts-check
import aboutPages from './about-pages/index.js';
import defaultApp from '../default/app/index.js';
import {backend as defaultBackend, internal as defaultInternal} from '../default/backend/index.js';
import versionHistory from './version-history/index.js';
/**
* This is the default configuration for the Goethe university of Frankfurt
@@ -76,6 +76,7 @@ const config = {
} */
},
},
versionHistory,
aboutPages,
},
backend: defaultBackend,

View File

@@ -0,0 +1,52 @@
# Goethe-Uni App 2.4
Wir freuen uns euch mehr in der Goethe-Uni App
bieten zu können.
## Navigation zu Gebäuden und Orten
Als eines der Ergebnisse des Ideenwettbewerbs wurde jetzt
ein Navigationsfeature in die App integriert.
Orte auf der Karte, Mensen, sowie sogar Termine (wenn hinterlegt)
bieten jetzt direkt die Option eine Verbindung zu finden, gestützt
durch die Karten App auf deinem Gerät.
## Integration der Jobbörse
Jobs findest du ab sofort auch in der Goethe-Uni App.
Auch das ist ein Ergebnis des Ideenwettbewerbs,
und wir freuen uns es euch hier präsentieren zu können!
## Der Umweltscore
Der Umweltscore für Gerichte wird nun auch in der App angezeigt.
> Nachhaltigkeit, Umweltschutz, Gesundheit und Klimawandel sind
> zentrale Begriffe im gesellschaftlichen Miteinander.
> Unsere Ernährung spielt hierbei eine wichtige Rolle.
> Das Studierendenwerk Frankfurt am Main zeichnet seine Speisenpläne
> ab sofort mit einem Umweltscore aus.
> Anhand dieser Bewertung können Sie direkt ersehen,
> welchen Einfluss Ihre Essenauswahl auf das Klima hat.
## Weitere Verbesserungen
### Performance
Die Performance der App beim Navigieren wurde stark verbessert und ist datensparender.
### Kalender
Die Kalenderabschnitte haben jetzt neue Namen bekommen:
- Der _Kalender_ zeigt Termine für spezifische Tage
- Die _Wochenübersicht_ ist ein Stundenplan mit allen Termine, die sich wiederholen (z. B. Vorlesungen)
- Die _Einzeltermine_ zeigen alle Termine, die sich nicht wiederholen
(z. B. Klausuren)
### Meine App
Der "Meine Kurse" Abschnitt wurde überarbeitet, und zeigt jetzt Termine
für die nächsten Tage und mit mehr Details an.

View File

@@ -0,0 +1,49 @@
# Goethe-Uni App 2.4
The Goethe-Uni App got even better!
## Navigation to buildings and places
As part of the "Ideenwettbewerb," the idea competition,
we have now integrated a navigation feature into the app.
Orte auf der Karte, Mensen, sowie sogar Termine (wenn hinterlegt)
bieten jetzt direkt die Option eine Verbindung zu finden, gestützt
durch die Karten App auf deinem Gerät.
## Integration of the job market
Jobs are now also available in the Goethe-Uni App.
This feature is also a result of the idea competition,
and we're happy to be able to present it to you here!
## The environment score
The environment score for dishes is now displayed inside the app.
> Sustainability, environment protection, health, and climate change are
> central topics in how we live today in our society.
> Our eating habits play an important role in it.
> The "Studierendenwerk Frankfurt am Main" is marking up its menus
> from now on with the so-called "Umweltscore," the environment score.
> Based on this rating, you can see the impact your meal choice would have on our climate.
## Further improvements
### Performance
The performance while navigating around the app has been heavily improved and requires less data to work.
### Calendar
The calendar sections have new names:
- The _calendar_ shows appointments on specific days
- The _week overview_ is a schedule with all events that repeat (e.g. lectures)
- The _single events_ show all appointments that don't repeat (e.g. exams)
### My App
The "my courses" section has been revamped,
and now shows events for the next days and with more detail.

View 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.

View 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.

View File

@@ -0,0 +1,6 @@
import {versions} from '../../default/tools/version.js';
/** @type {import('@openstapps/core').SCAppVersionInfo[]} */
const versionHistory = await versions(import.meta.url);
export default versionHistory;

View File

@@ -1,7 +1,7 @@
{
"name": "@openstapps/backend",
"description": "A reference implementation for a StApps backend",
"version": "3.0.0-next.4",
"version": "4.0.3",
"private": true,
"type": "module",
"license": "AGPL-3.0-only",
@@ -43,32 +43,33 @@
"test:unit": "cross-env NODE_CONFIG_ENV=elasticsearch ALLOW_NO_TRANSPORT=true STAPPS_LOG_LEVEL=0 mocha --exit"
},
"dependencies": {
"@elastic/elasticsearch": "8.4.0",
"@elastic/elasticsearch": "8.14.1",
"@openstapps/core": "workspace:*",
"@openstapps/core-tools": "workspace:*",
"@openstapps/logger": "workspace:*",
"@types/body-parser": "1.19.2",
"@types/body-parser": "1.19.6",
"@types/cors": "2.8.13",
"@types/express": "4.17.17",
"@types/geojson": "1.0.6",
"@types/node": "18.15.3",
"@types/node": "22.15.31",
"@types/node-cron": "3.0.7",
"@types/nodemailer": "6.4.7",
"@types/promise-queue": "2.2.0",
"@types/uuid": "8.3.4",
"body-parser": "1.20.2",
"body-parser": "1.20.3",
"cors": "2.8.5",
"cosmiconfig": "8.1.3",
"express": "4.18.2",
"deepmerge": "4.3.1",
"express": "4.21.2",
"express-prom-bundle": "6.6.0",
"express-promise-router": "4.1.1",
"got": "12.6.0",
"moment": "2.29.4",
"morgan": "1.10.0",
"moment": "2.30.1",
"morgan": "1.10.1",
"nock": "13.3.1",
"node-cache": "5.1.2",
"node-cron": "3.0.2",
"nodemailer": "6.9.1",
"nodemailer": "6.9.9",
"prom-client": "14.1.1",
"promise-queue": "2.2.5",
"uuid": "8.3.2"
@@ -79,27 +80,27 @@
"@openstapps/prettier-config": "workspace:*",
"@openstapps/tsconfig": "workspace:*",
"@testdeck/mocha": "0.3.3",
"@types/chai": "4.3.5",
"@types/chai-as-promised": "7.1.5",
"@types/mocha": "10.0.1",
"@types/morgan": "1.9.4",
"@types/chai": "4.3.20",
"@types/chai-as-promised": "7.1.8",
"@types/mocha": "10.0.10",
"@types/morgan": "1.9.10",
"@types/sinon": "10.0.14",
"@types/sinon-express-mock": "1.3.9",
"@types/supertest": "2.0.12",
"c8": "7.14.0",
"chai": "4.3.7",
"chai-as-promised": "7.1.1",
"c8": "10.1.3",
"chai": "4.5.0",
"chai-as-promised": "7.1.2",
"cross-env": "7.0.3",
"get-port": "5.1.1",
"mocha": "10.2.0",
"mocha": "10.8.2",
"mocha-junit-reporter": "2.2.0",
"mocked-env": "1.3.5",
"sinon": "15.0.4",
"sinon-express-mock": "2.2.1",
"supertest": "6.3.3",
"ts-node": "10.9.1",
"tsup": "6.7.0",
"typescript": "5.1.6"
"ts-node": "10.9.2",
"tsup": "8.5.0",
"typescript": "5.4.2"
},
"tsup": {
"entry": [

View File

@@ -2,6 +2,7 @@ import {cosmiconfig, PublicExplorer} from 'cosmiconfig';
import {SCConfigFile} from '@openstapps/core';
import path from 'path';
import deepmerge from 'deepmerge';
import {Logger} from '@openstapps/logger';
const fallbackNamespace = 'default';
const configPath = 'config';
@@ -23,31 +24,25 @@ function configLoader(moduleName: string): PublicExplorer {
* Find and load a config file
*/
async function findConfig<T>(moduleName: string, namespace = fallbackNamespace): Promise<T> {
return configLoader(moduleName)
.search(path.posix.join('.', configPath, namespace))
.then(it => it!.config as T)
.catch(() =>
configLoader(moduleName)
.search(path.posix.join('.', configPath, fallbackNamespace))
.then(it => it!.config),
);
}
const config = await configLoader(moduleName).search(path.posix.join('.', configPath, namespace));
/**
* Loads a config file
*/
async function loadConfig<T>(moduleName: string): Promise<T> {
const namespace = process.env.NODE_APP_INSTANCE;
const database = process.env.NODE_CONFIG_ENV;
const config = await findConfig<T>(moduleName, namespace);
if (database) {
const databaseConfig = await findConfig<T>(database, namespace);
return deepmerge(config, databaseConfig);
if (config) {
Logger.info(`Using ${namespace} config for ${moduleName}`);
return config.config;
} else {
Logger.info(`Using ${fallbackNamespace} config for ${moduleName}`);
return configLoader(moduleName)
.search(path.posix.join('.', configPath, fallbackNamespace))
.then(it => it!.config);
}
return config;
}
export const backendConfig = await loadConfig<SCConfigFile>('backend');
export const prometheusConfig = await loadConfig<unknown>('prometheus');
const namespace = process.env.NODE_APP_INSTANCE;
const database = process.env.NODE_CONFIG_ENV;
export const prometheusConfig = await findConfig<unknown>('prometheus', namespace);
const backendConfigWithoutDatabase = await findConfig<SCConfigFile>('backend', namespace);
export const backendConfig = database
? deepmerge(backendConfigWithoutDatabase, await findConfig<never>(database, namespace))
: backendConfigWithoutDatabase;

View File

@@ -13,15 +13,34 @@
* 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/>.
*/
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 {Bulk} from './bulk-storage.js';
import {FeatureCollection, Point, Polygon} from 'geojson';
/**
* Creates an instance of a 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
*/
@@ -82,4 +101,9 @@ export interface Database {
* @param params Parameters which form a search query to search the backend data
*/
search(parameters: SCSearchQuery): Promise<SCSearchResponse>;
/**
* Get geo info for display on a map
*/
geo(): Promise<SupplementaryGeoJSON>;
}

View File

@@ -26,7 +26,7 @@ import {Logger} from '@openstapps/logger';
import moment from 'moment';
import {MailQueue} from '../../notification/mail-queue.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 * as Monitoring from './monitoring.js';
import {buildQuery} from './query/query.js';
@@ -46,6 +46,7 @@ import {
} from './util/index.js';
import {noUndefined} from './util/no-undefined.js';
import {retryCatch, RetryOptions} from './util/retry.js';
import {Feature, Point, Polygon} from 'geojson';
/**
* A database interface for elasticsearch
@@ -84,7 +85,10 @@ export class Elasticsearch implements Database {
* @param config an assembled config file
* @param mailQueue a mail queue for monitoring
*/
constructor(private readonly config: SCConfigFile, mailQueue?: MailQueue) {
constructor(
private readonly config: SCConfigFile,
mailQueue?: MailQueue,
) {
if (config.internal.database === undefined || typeof config.internal.database.version !== 'string') {
throw new TypeError('Database version is undefined. Check your config file');
}
@@ -402,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),
};
}
}

View File

@@ -25,7 +25,7 @@ export function buildDistanceFilter(
): QueryDslSpecificQueryContainer<'geo_distance'> {
const geoObject: QueryDslGeoDistanceQuery = {
distance: `${filter.arguments.distance}m`,
[`${filter.arguments.field}.point.coordinates`]: {
[`${filter.arguments.field}.point`]: {
lat: filter.arguments.position[1],
lon: filter.arguments.position[0],
},

View File

@@ -19,14 +19,29 @@ import {QueryDslSpecificQueryContainer} from '../../types/util.js';
* Converts a geo filter to elasticsearch syntax
* @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 {
geo_shape: {
ignore_unmapped: true,
[`${filter.arguments.field}.polygon`]: {
shape: filter.arguments.shape,
relation: filter.arguments.spatialRelation,
},
bool: {
should: [
{
geo_shape: {
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'>,
],
},
};
}

View File

@@ -21,16 +21,31 @@ import {QueryDslSpecificQueryContainer} from '../../types/util.js';
*/
export function buildValueFilter(
filter: SCSearchValueFilter,
): QueryDslSpecificQueryContainer<'term'> | QueryDslSpecificQueryContainer<'terms'> {
return Array.isArray(filter.arguments.value)
? {
terms: {
[`${filter.arguments.field}.raw`]: filter.arguments.value,
):
| QueryDslSpecificQueryContainer<'exists'>
| QueryDslSpecificQueryContainer<'term'>
| QueryDslSpecificQueryContainer<'terms'> {
switch (typeof filter.arguments.value) {
case 'undefined': {
return {
exists: {
field: filter.arguments.field,
},
}
: {
};
}
case 'string': {
return {
term: {
[`${filter.arguments.field}.raw`]: filter.arguments.value,
},
};
}
case 'object': {
return {
terms: {
[`${filter.arguments.field}.raw`]: filter.arguments.value,
},
};
}
}
}

View File

@@ -25,7 +25,7 @@ export function buildDistanceSort(sort: SCDistanceSort): SortOptions {
mode: 'avg',
order: sort.order,
unit: 'm',
[`${sort.arguments.field}.point.coordinates`]: {
[`${sort.arguments.field}.point`]: {
lat: sort.arguments.position[1],
lon: sort.arguments.position[0],
},

View File

@@ -22,7 +22,7 @@ import http from 'http';
import {MailQueue} from '../src/notification/mail-queue.js';
import {Bulk, BulkStorage} from '../src/storage/bulk-storage.js';
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 {backendConfig} from '../src/config.js';
import {getIndexUID} from '../src/storage/elasticsearch/util/index.js';
@@ -58,7 +58,6 @@ export async function startApp(): Promise<Express> {
* An elasticsearch mock
*/
export class ElasticsearchMock implements Database {
// @ts-expect-error never read
private bulk: Bulk | undefined;
private storageMock = new Map<string, SCThings>();
@@ -67,6 +66,10 @@ export class ElasticsearchMock implements Database {
// Nothing to do here
}
geo(): Promise<SupplementaryGeoJSON> {
throw new Error('Method not implemented.');
}
bulkCreated(bulk: Bulk): Promise<void> {
this.bulk = bulk;
return Promise.resolve(undefined);

View File

@@ -14,6 +14,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {
SCBook,
SCBulkAddRoute,
SCBulkDoneRoute,
SCBulkRequest,
@@ -23,29 +24,30 @@ import {
import {expect} from 'chai';
import {bulk, DEFAULT_TEST_TIMEOUT} from '../common.js';
import {testApp} from '../tests-setup.js';
import {readFile} from 'fs/promises';
import {v4} from 'uuid';
import bookFile from '@openstapps/core/test/resources/indexable/Book.2.json' with {type: 'json'};
const book = JSON.parse(
await readFile('node_modules/@openstapps/core/test/resources/indexable/Book.2.json', 'utf8'),
).instance;
const book = bookFile.instance as SCBook;
describe('Bulk routes', async function () {
// increase timeout for the suite
this.timeout(DEFAULT_TEST_TIMEOUT);
const request: SCBulkRequest = {
expiration: bulk.expiration,
source: bulk.source,
type: bulk.type,
};
const bulkRoute = new SCBulkRoute();
const bulkAddRoute = new SCBulkAddRoute();
const bulkDoneRoute = new SCBulkDoneRoute();
let request: SCBulkRequest;
let bulkRoute: SCBulkRoute;
let bulkAddRoute: SCBulkAddRoute;
let bulkDoneRoute: SCBulkDoneRoute;
// afterEach(async function() {
// TODO: Delete saved bulks
// });
before(function () {
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 () {
const {status, body, error} = await testApp

View File

@@ -21,7 +21,12 @@ import {expect} from 'chai';
describe('Index route', async function () {
// increase timeout for the suite
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 () {
const request: SCIndexRequest = {};

View File

@@ -30,15 +30,11 @@ import chaiAsPromised from 'chai-as-promised';
import {DEFAULT_TEST_TIMEOUT} from '../common.js';
import {testApp} from '../tests-setup.js';
import {backendConfig} from '../../src/config.js';
import {readFile} from 'fs/promises';
import registerRequest from '@openstapps/core/test/resources/PluginRegisterRequest.1.json' with {type: 'json'};
// for using promises in expectations (to.eventually.be...)
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"'"
export const registerAddRequest: SCPluginAdd = registerRequest.instance as SCPluginAdd;

Some files were not shown because too many files have changed in this diff Show More