mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-02-18 23:02:51 +00:00
Compare commits
1 Commits
2f38fa4c07
...
202-update
| Author | SHA1 | Date | |
|---|---|---|---|
|
69868663cb
|
@@ -1,3 +1,3 @@
|
|||||||
nodejs 18.19.1
|
nodejs 22.2.0
|
||||||
pnpm 8.15.4
|
pnpm 8.15.4
|
||||||
python 3.11.5
|
python 3.11.5
|
||||||
@@ -1,31 +1,5 @@
|
|||||||
# @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
|
## 3.2.0
|
||||||
|
|
||||||
### Minor Changes
|
### Minor Changes
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
The Goethe-Uni App got even better!
|
The Goethe-Uni App got even better!
|
||||||
|
|
||||||
## Completely new map view
|
## Completelty new map view
|
||||||
|
|
||||||
We overhauled the map to offer you a clearer and faster and overview.
|
We overhauled the map to offer you a clearer and faster and overview.
|
||||||
|
|
||||||
|
|||||||
@@ -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.3.2",
|
"version": "3.2.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"license": "AGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
"@types/geojson": "1.0.6",
|
"@types/geojson": "1.0.6",
|
||||||
"@types/node": "18.15.3",
|
"@types/node": "18.15.3",
|
||||||
"@types/node-cron": "3.0.7",
|
"@types/node-cron": "3.0.7",
|
||||||
"@types/nodemailer": "6.4.15",
|
"@types/nodemailer": "6.4.7",
|
||||||
"@types/promise-queue": "2.2.0",
|
"@types/promise-queue": "2.2.0",
|
||||||
"@types/uuid": "8.3.4",
|
"@types/uuid": "8.3.4",
|
||||||
"body-parser": "1.20.2",
|
"body-parser": "1.20.2",
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
"nock": "13.3.1",
|
"nock": "13.3.1",
|
||||||
"node-cache": "5.1.2",
|
"node-cache": "5.1.2",
|
||||||
"node-cron": "3.0.2",
|
"node-cron": "3.0.2",
|
||||||
"nodemailer": "6.9.14",
|
"nodemailer": "6.9.1",
|
||||||
"prom-client": "14.1.1",
|
"prom-client": "14.1.1",
|
||||||
"promise-queue": "2.2.5",
|
"promise-queue": "2.2.5",
|
||||||
"uuid": "8.3.2"
|
"uuid": "8.3.2"
|
||||||
|
|||||||
@@ -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`]: {
|
[`${filter.arguments.field}.point.coordinates`]: {
|
||||||
lat: filter.arguments.position[1],
|
lat: filter.arguments.position[1],
|
||||||
lon: filter.arguments.position[0],
|
lon: filter.arguments.position[0],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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`]: {
|
[`${sort.arguments.field}.point.coordinates`]: {
|
||||||
lat: sort.arguments.position[1],
|
lat: sort.arguments.position[1],
|
||||||
lon: sort.arguments.position[0],
|
lon: sort.arguments.position[0],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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': {
|
'geo.point.coordinates': {
|
||||||
lat: 8.123,
|
lat: 8.123,
|
||||||
lon: 50.123,
|
lon: 50.123,
|
||||||
},
|
},
|
||||||
@@ -636,7 +636,7 @@ describe('Query', function () {
|
|||||||
'mode': 'avg',
|
'mode': 'avg',
|
||||||
'order': 'desc',
|
'order': 'desc',
|
||||||
'unit': 'm',
|
'unit': 'm',
|
||||||
'geo.point': {
|
'geo.point.coordinates': {
|
||||||
lat: 50.123,
|
lat: 50.123,
|
||||||
lon: 8.123,
|
lon: 8.123,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/usr/bin/env node
|
|
||||||
import './lib/cli.js';
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@openstapps/mail-plugin",
|
|
||||||
"description": "Mail Plugin",
|
|
||||||
"version": "3.2.0",
|
|
||||||
"private": true,
|
|
||||||
"type": "module",
|
|
||||||
"license": "GPL-3.0-only",
|
|
||||||
"author": "Thea Schöbl",
|
|
||||||
"bin": "app.js",
|
|
||||||
"files": [
|
|
||||||
"app.js",
|
|
||||||
"lib",
|
|
||||||
"README.md",
|
|
||||||
"CHANGELOG.md",
|
|
||||||
"Dockerfile"
|
|
||||||
],
|
|
||||||
"scripts": {
|
|
||||||
"build": "tsup-node --dts",
|
|
||||||
"deploy": "pnpm --prod --filter=@openstapps/minimal-plugin deploy ../../.deploy/minimal-plugin",
|
|
||||||
"dev": "tsup-node --watch --onSuccess \"pnpm run start\"",
|
|
||||||
"format": "prettier . -c --ignore-path ../../.gitignore",
|
|
||||||
"format:fix": "prettier --write . --ignore-path ../../.gitignore",
|
|
||||||
"lint": "eslint --ext .ts src/",
|
|
||||||
"lint:fix": "eslint --fix --ext .ts src/",
|
|
||||||
"start": "node app.js"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@openstapps/core": "workspace:*",
|
|
||||||
"@openstapps/core-tools": "workspace:*",
|
|
||||||
"@openstapps/logger": "workspace:*",
|
|
||||||
"commander": "10.0.0",
|
|
||||||
"dotenv": "16.4.5",
|
|
||||||
"express": "4.18.2",
|
|
||||||
"imapflow": "1.0.162",
|
|
||||||
"mailparser": "3.7.1",
|
|
||||||
"node-forge": "1.3.1",
|
|
||||||
"nodemailer": "6.9.14",
|
|
||||||
"ts-node": "10.9.2"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@openstapps/eslint-config": "workspace:*",
|
|
||||||
"@openstapps/prettier-config": "workspace:*",
|
|
||||||
"@openstapps/tsconfig": "workspace:*",
|
|
||||||
"@types/express": "4.17.17",
|
|
||||||
"@types/imapflow": "1.0.18",
|
|
||||||
"@types/mailparser": "3.4.4",
|
|
||||||
"@types/node": "18.15.3",
|
|
||||||
"@types/node-forge": "1.3.11",
|
|
||||||
"@types/nodemailer": "6.4.15",
|
|
||||||
"tsup": "6.7.0",
|
|
||||||
"typescript": "5.4.2"
|
|
||||||
},
|
|
||||||
"tsup": {
|
|
||||||
"entry": [
|
|
||||||
"src/cli.ts"
|
|
||||||
],
|
|
||||||
"sourcemap": true,
|
|
||||||
"clean": true,
|
|
||||||
"format": "esm",
|
|
||||||
"outDir": "lib"
|
|
||||||
},
|
|
||||||
"prettier": "@openstapps/prettier-config",
|
|
||||||
"eslintConfig": {
|
|
||||||
"extends": [
|
|
||||||
"@openstapps"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,123 +0,0 @@
|
|||||||
import {config} from 'dotenv';
|
|
||||||
import {ImapFlow} from 'imapflow';
|
|
||||||
import express from 'express';
|
|
||||||
|
|
||||||
config({path: '.env.local'});
|
|
||||||
|
|
||||||
const app = express();
|
|
||||||
const port = process.env.PORT || 4000;
|
|
||||||
|
|
||||||
app.use(async (request, response, next) => {
|
|
||||||
try {
|
|
||||||
const [user, pass] = Buffer.from(request.headers['authorization']!.replace(/^Basic /, ''), 'base64')
|
|
||||||
.toString('utf8')
|
|
||||||
.split(':');
|
|
||||||
|
|
||||||
const client = new ImapFlow({
|
|
||||||
host: 'imap.server.uni-frankfurt.de',
|
|
||||||
port: 993,
|
|
||||||
secure: true,
|
|
||||||
emitLogs: false,
|
|
||||||
auth: {user, pass},
|
|
||||||
});
|
|
||||||
response.locals.client = client;
|
|
||||||
|
|
||||||
await client.connect();
|
|
||||||
response.on('finish', async () => {
|
|
||||||
await client.logout();
|
|
||||||
client.close();
|
|
||||||
});
|
|
||||||
|
|
||||||
next();
|
|
||||||
} catch {
|
|
||||||
response.status(401).send();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
app.get('/', async (_request, response) => {
|
|
||||||
const result = await response.locals.client.listTree();
|
|
||||||
response.json(result);
|
|
||||||
});
|
|
||||||
|
|
||||||
app.get('/:mailbox', async (request, response) => {
|
|
||||||
try {
|
|
||||||
await response.locals.client.mailboxOpen(request.params.mailbox);
|
|
||||||
const since = Number(request.query.since) || undefined;
|
|
||||||
const preData = await response.locals.client.status(request.params.mailbox, {messages: true});
|
|
||||||
if (preData.messages === 0) {
|
|
||||||
response.json([]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = response.locals.client.fetch(
|
|
||||||
'1:*',
|
|
||||||
{},
|
|
||||||
{
|
|
||||||
// caution, BigInt can throw
|
|
||||||
changedSince: typeof since === 'string' ? BigInt(since) : undefined,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
const messages = [];
|
|
||||||
for await (const message of data) {
|
|
||||||
messages.push(message.seq.toString());
|
|
||||||
}
|
|
||||||
response.json(messages);
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
response.status(404).send();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
app.get('/:mailbox/:id', async (request, response) => {
|
|
||||||
try {
|
|
||||||
await response.locals.client.mailboxOpen(request.params.mailbox);
|
|
||||||
const message = await response.locals.client.fetchOne(request.params.id, {
|
|
||||||
envelope: true,
|
|
||||||
labels: true,
|
|
||||||
flags: true,
|
|
||||||
bodyStructure: true,
|
|
||||||
});
|
|
||||||
response.json({
|
|
||||||
bodyStructure: message.bodyStructure,
|
|
||||||
labels: [...(message.labels ?? [])],
|
|
||||||
flags: [...(message.flags ?? [])],
|
|
||||||
envelope: message.envelope,
|
|
||||||
seq: message.seq,
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
response.status(404).send();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
app.get('/:mailbox/:id/:part', async (request, response) => {
|
|
||||||
try {
|
|
||||||
await response.locals.client.mailboxOpen(request.params.mailbox, {readOnly: true});
|
|
||||||
if (request.query.raw) {
|
|
||||||
const message = await response.locals.client.fetchOne(request.params.id, {
|
|
||||||
bodyParts: [`${request.params.part}.mime`, request.params.part],
|
|
||||||
});
|
|
||||||
|
|
||||||
response.write(message.bodyParts.get(`${request.params.part}.mime`));
|
|
||||||
response.write(message.bodyParts.get(request.params.part));
|
|
||||||
|
|
||||||
response.end();
|
|
||||||
} else {
|
|
||||||
const message = await response.locals.client.download(request.params.id, request.params.part);
|
|
||||||
message.content.on('data', chunk => {
|
|
||||||
response.write(chunk);
|
|
||||||
});
|
|
||||||
message.content.on('end', () => {
|
|
||||||
response.end();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
response.status(404).send();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
app.listen(port, () => {
|
|
||||||
console.log(`Server listening on port ${port}`);
|
|
||||||
});
|
|
||||||
9
backend/mail-plugin/src/types.d.ts
vendored
9
backend/mail-plugin/src/types.d.ts
vendored
@@ -1,9 +0,0 @@
|
|||||||
import {ImapFlow} from 'imapflow';
|
|
||||||
|
|
||||||
declare global {
|
|
||||||
namespace Express {
|
|
||||||
interface Locals {
|
|
||||||
client: ImapFlow;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "@openstapps/tsconfig",
|
|
||||||
"exclude": ["lib", "app.js"]
|
|
||||||
}
|
|
||||||
@@ -1,11 +1,5 @@
|
|||||||
# @openstapps/tsconfig
|
# @openstapps/tsconfig
|
||||||
|
|
||||||
## 3.3.0
|
|
||||||
|
|
||||||
### Minor Changes
|
|
||||||
|
|
||||||
- 688bc5f2: v3.3.0 changes
|
|
||||||
|
|
||||||
## 3.0.0
|
## 3.0.0
|
||||||
|
|
||||||
### Major Changes
|
### Major Changes
|
||||||
@@ -36,7 +30,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
|
||||||
@@ -111,7 +105,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.3.0",
|
"version": "3.0.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",
|
||||||
|
|||||||
@@ -1,28 +1,12 @@
|
|||||||
# @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
|
## 3.2.0
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|
||||||
- Updated dependencies [912ae422]
|
- Updated dependencies [912ae422]
|
||||||
- @openstapps/core@3.2.0
|
- @openstapps/core@4.0.0
|
||||||
- @openstapps/api@3.2.0
|
- @openstapps/api@4.0.0
|
||||||
- @openstapps/logger@3.0.0
|
- @openstapps/logger@3.0.0
|
||||||
|
|
||||||
## 3.1.1
|
## 3.1.1
|
||||||
|
|||||||
@@ -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.3.2",
|
"version": "3.2.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
|
|||||||
@@ -1,33 +1,13 @@
|
|||||||
# @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
|
## 3.2.0
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|
||||||
- Updated dependencies [912ae422]
|
- Updated dependencies [912ae422]
|
||||||
- @openstapps/core@3.2.0
|
- @openstapps/core@4.0.0
|
||||||
- @openstapps/api@3.2.0
|
- @openstapps/api@4.0.0
|
||||||
- @openstapps/api-plugin@3.2.0
|
- @openstapps/api-plugin@4.0.0
|
||||||
- @openstapps/core-tools@3.0.0
|
- @openstapps/core-tools@3.0.0
|
||||||
- @openstapps/logger@3.0.0
|
- @openstapps/logger@3.0.0
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@openstapps/minimal-plugin",
|
"name": "@openstapps/minimal-plugin",
|
||||||
"description": "Minimal Plugin",
|
"description": "Minimal Plugin",
|
||||||
"version": "3.3.2",
|
"version": "3.2.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
|
|||||||
12
flake.lock
generated
12
flake.lock
generated
@@ -5,11 +5,11 @@
|
|||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1709126324,
|
"lastModified": 1710146030,
|
||||||
"narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=",
|
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "d465f4819400de7c8d874d50b982301f28a84605",
|
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -20,11 +20,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1709747860,
|
"lastModified": 1717112898,
|
||||||
"narHash": "sha256-RT4zuBy579m+l8VyIQFOR66WXfcs4g1jntZUHjh6eoI=",
|
"narHash": "sha256-7R2ZvOnvd9h8fDd65p0JnB7wXfUvreox3xFdYWd1BnY=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "58ae79ea707579c40102ddf62d84b902a987c58b",
|
"rev": "6132b0f6e344ce2fe34fc051b72fb46e34f668e0",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
@@ -31,10 +31,10 @@
|
|||||||
);
|
);
|
||||||
android = prev.androidenv.composeAndroidPackages {
|
android = prev.androidenv.composeAndroidPackages {
|
||||||
buildToolsVersions = [
|
buildToolsVersions = [
|
||||||
"34.0.0"
|
"30.0.3"
|
||||||
aapt2buildToolsVersion
|
aapt2buildToolsVersion
|
||||||
];
|
];
|
||||||
platformVersions = [ "34" ];
|
platformVersions = [ "33" ];
|
||||||
};
|
};
|
||||||
cypress = prev.cypress.overrideAttrs (cyPrev: rec {
|
cypress = prev.cypress.overrideAttrs (cyPrev: rec {
|
||||||
version = "13.2.0";
|
version = "13.2.0";
|
||||||
@@ -43,8 +43,7 @@
|
|||||||
hash = "sha256-9o0nprGcJhudS1LNm+T7Vf0Dwd1RBauYKI+w1FBQ3ZM=";
|
hash = "sha256-9o0nprGcJhudS1LNm+T7Vf0Dwd1RBauYKI+w1FBQ3ZM=";
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
nodejs = prev.nodejs_18;
|
nodejs = prev.nodejs_22;
|
||||||
corepack = prev.corepack_18;
|
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
config = {
|
config = {
|
||||||
|
|||||||
1
frontend/app/.gitignore
vendored
1
frontend/app/.gitignore
vendored
@@ -32,7 +32,6 @@ platforms/
|
|||||||
/plugins/
|
/plugins/
|
||||||
$RECYCLE.BIN/
|
$RECYCLE.BIN/
|
||||||
dist/
|
dist/
|
||||||
.nx/
|
|
||||||
# ignore generated resources
|
# ignore generated resources
|
||||||
resources/*/icon/
|
resources/*/icon/
|
||||||
resources/*/splash/
|
resources/*/splash/
|
||||||
|
|||||||
@@ -1,32 +1,5 @@
|
|||||||
# @openstapps/app
|
# @openstapps/app
|
||||||
|
|
||||||
## 3.3.3
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- 496b50d8: Bug fixes and Android target sdk version is now 34
|
|
||||||
|
|
||||||
## 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
|
## 3.2.0
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -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,98 +86,52 @@ addToIonicDB(
|
|||||||
|
|
||||||
You'll need to run _Chromium_ using
|
You'll need to run _Chromium_ using
|
||||||
|
|
||||||
```sh
|
```shell
|
||||||
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.
|
server. You can circumvent this locally by using the `:virtual-host`
|
||||||
|
scripts:
|
||||||
|
|
||||||
#### Web
|
```shell
|
||||||
|
|
||||||
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
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -185,7 +139,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
|
||||||
@@ -205,7 +159,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
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -215,13 +169,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
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
namespace "de.anyschool.app"
|
namespace "de.anyschool.app"
|
||||||
compileSdk rootProject.ext.compileSdkVersion
|
compileSdkVersion rootProject.ext.compileSdkVersion
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "de.anyschool.app"
|
applicationId "de.anyschool.app"
|
||||||
minSdkVersion rootProject.ext.minSdkVersion
|
minSdkVersion rootProject.ext.minSdkVersion
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ 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')
|
||||||
@@ -22,7 +21,6 @@ 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,8 +1,4 @@
|
|||||||
[
|
[
|
||||||
{
|
|
||||||
"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"
|
||||||
@@ -51,10 +47,6 @@
|
|||||||
"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"
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ buildscript {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:8.2.1'
|
classpath 'com.android.tools.build:gradle:8.0.0'
|
||||||
classpath 'com.google.gms:google-services:4.4.0'
|
classpath 'com.google.gms:google-services:4.3.15'
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
|
|||||||
@@ -1,57 +1,51 @@
|
|||||||
// 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@6.1.1_@capacitor+core@6.1.1/node_modules/@capacitor/android/capacitor')
|
project(':capacitor-android').projectDir = new File('../../../node_modules/.pnpm/@capacitor+android@5.5.0_@capacitor+core@5.5.0/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@6.1.1/node_modules/@capacitor-community/screen-brightness/android')
|
|
||||||
|
|
||||||
include ':capacitor-app'
|
include ':capacitor-app'
|
||||||
project(':capacitor-app').projectDir = new File('../../../node_modules/.pnpm/@capacitor+app@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/app/android')
|
project(':capacitor-app').projectDir = new File('../../../node_modules/.pnpm/@capacitor+app@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/app/android')
|
||||||
|
|
||||||
include ':capacitor-browser'
|
include ':capacitor-browser'
|
||||||
project(':capacitor-browser').projectDir = new File('../../../node_modules/.pnpm/@capacitor+browser@6.0.1_@capacitor+core@6.1.1/node_modules/@capacitor/browser/android')
|
project(':capacitor-browser').projectDir = new File('../../../node_modules/.pnpm/@capacitor+browser@5.1.0_@capacitor+core@5.5.0/node_modules/@capacitor/browser/android')
|
||||||
|
|
||||||
include ':capacitor-clipboard'
|
include ':capacitor-clipboard'
|
||||||
project(':capacitor-clipboard').projectDir = new File('../../../node_modules/.pnpm/@capacitor+clipboard@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/clipboard/android')
|
project(':capacitor-clipboard').projectDir = new File('../../../node_modules/.pnpm/@capacitor+clipboard@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/clipboard/android')
|
||||||
|
|
||||||
include ':capacitor-device'
|
include ':capacitor-device'
|
||||||
project(':capacitor-device').projectDir = new File('../../../node_modules/.pnpm/@capacitor+device@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/device/android')
|
project(':capacitor-device').projectDir = new File('../../../node_modules/.pnpm/@capacitor+device@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/device/android')
|
||||||
|
|
||||||
include ':capacitor-dialog'
|
include ':capacitor-dialog'
|
||||||
project(':capacitor-dialog').projectDir = new File('../../../node_modules/.pnpm/@capacitor+dialog@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/dialog/android')
|
project(':capacitor-dialog').projectDir = new File('../../../node_modules/.pnpm/@capacitor+dialog@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/dialog/android')
|
||||||
|
|
||||||
include ':capacitor-filesystem'
|
include ':capacitor-filesystem'
|
||||||
project(':capacitor-filesystem').projectDir = new File('../../../node_modules/.pnpm/@capacitor+filesystem@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/filesystem/android')
|
project(':capacitor-filesystem').projectDir = new File('../../../node_modules/.pnpm/@capacitor+filesystem@5.1.4_@capacitor+core@5.5.0/node_modules/@capacitor/filesystem/android')
|
||||||
|
|
||||||
include ':capacitor-geolocation'
|
include ':capacitor-geolocation'
|
||||||
project(':capacitor-geolocation').projectDir = new File('../../../node_modules/.pnpm/@capacitor+geolocation@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/geolocation/android')
|
project(':capacitor-geolocation').projectDir = new File('../../../node_modules/.pnpm/@capacitor+geolocation@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/geolocation/android')
|
||||||
|
|
||||||
include ':capacitor-haptics'
|
include ':capacitor-haptics'
|
||||||
project(':capacitor-haptics').projectDir = new File('../../../node_modules/.pnpm/@capacitor+haptics@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/haptics/android')
|
project(':capacitor-haptics').projectDir = new File('../../../node_modules/.pnpm/@capacitor+haptics@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/haptics/android')
|
||||||
|
|
||||||
include ':capacitor-keyboard'
|
include ':capacitor-keyboard'
|
||||||
project(':capacitor-keyboard').projectDir = new File('../../../node_modules/.pnpm/@capacitor+keyboard@6.0.1_@capacitor+core@6.1.1/node_modules/@capacitor/keyboard/android')
|
project(':capacitor-keyboard').projectDir = new File('../../../node_modules/.pnpm/@capacitor+keyboard@5.0.6_@capacitor+core@5.5.0/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@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/local-notifications/android')
|
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')
|
||||||
|
|
||||||
include ':capacitor-network'
|
include ':capacitor-network'
|
||||||
project(':capacitor-network').projectDir = new File('../../../node_modules/.pnpm/@capacitor+network@6.0.1_@capacitor+core@6.1.1/node_modules/@capacitor/network/android')
|
project(':capacitor-network').projectDir = new File('../../../node_modules/.pnpm/@capacitor+network@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/network/android')
|
||||||
|
|
||||||
include ':capacitor-preferences'
|
include ':capacitor-preferences'
|
||||||
project(':capacitor-preferences').projectDir = new File('../../../node_modules/.pnpm/@capacitor+preferences@6.0.1_@capacitor+core@6.1.1/node_modules/@capacitor/preferences/android')
|
project(':capacitor-preferences').projectDir = new File('../../../node_modules/.pnpm/@capacitor+preferences@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/preferences/android')
|
||||||
|
|
||||||
include ':capacitor-screen-orientation'
|
|
||||||
project(':capacitor-screen-orientation').projectDir = new File('../../../node_modules/.pnpm/@capacitor+screen-orientation@6.0.1_@capacitor+core@6.1.1/node_modules/@capacitor/screen-orientation/android')
|
|
||||||
|
|
||||||
include ':capacitor-share'
|
include ':capacitor-share'
|
||||||
project(':capacitor-share').projectDir = new File('../../../node_modules/.pnpm/@capacitor+share@6.0.1_@capacitor+core@6.1.1/node_modules/@capacitor/share/android')
|
project(':capacitor-share').projectDir = new File('../../../node_modules/.pnpm/@capacitor+share@5.0.6_@capacitor+core@5.5.0/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@6.0.1_@capacitor+core@6.1.1/node_modules/@capacitor/splash-screen/android')
|
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')
|
||||||
|
|
||||||
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@5.2.0_@capacitor+core@6.1.1/node_modules/@transistorsoft/capacitor-background-fetch/android')
|
project(':transistorsoft-capacitor-background-fetch').projectDir = new File('../../../node_modules/.pnpm/@transistorsoft+capacitor-background-fetch@5.1.1_@capacitor+core@5.5.0/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.9.0_@capacitor+core@6.1.1/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.5.0/node_modules/capacitor-secure-storage-plugin/android')
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
ext {
|
ext {
|
||||||
minSdkVersion = 22
|
minSdkVersion = 22
|
||||||
compileSdkVersion = 34
|
compileSdkVersion = 33
|
||||||
targetSdkVersion = 34
|
targetSdkVersion = 33
|
||||||
androidxActivityVersion = '1.8.0'
|
androidxActivityVersion = '1.7.0'
|
||||||
androidxAppCompatVersion = '1.6.1'
|
androidxAppCompatVersion = '1.6.1'
|
||||||
androidxCoordinatorLayoutVersion = '1.2.0'
|
androidxCoordinatorLayoutVersion = '1.2.0'
|
||||||
androidxCoreVersion = '1.12.0'
|
androidxCoreVersion = '1.10.0'
|
||||||
androidxFragmentVersion = '1.6.2'
|
androidxFragmentVersion = '1.5.6'
|
||||||
coreSplashScreenVersion = '1.0.1'
|
coreSplashScreenVersion = '1.0.0'
|
||||||
androidxWebkitVersion = '1.9.0'
|
androidxWebkitVersion = '1.6.1'
|
||||||
junitVersion = '4.13.2'
|
junitVersion = '4.13.2'
|
||||||
androidxJunitVersion = '1.1.5'
|
androidxJunitVersion = '1.1.5'
|
||||||
androidxEspressoCoreVersion = '3.5.1'
|
androidxEspressoCoreVersion = '3.5.1'
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
require_relative '../../../../node_modules/.pnpm/@capacitor+ios@6.1.1_@capacitor+core@6.1.1/node_modules/@capacitor/ios/scripts/pods_helpers'
|
require_relative '../../../../node_modules/.pnpm/@capacitor+ios@5.5.0_@capacitor+core@5.5.0/node_modules/@capacitor/ios/scripts/pods_helpers'
|
||||||
|
|
||||||
platform :ios, '13.0'
|
platform :ios, '13.0'
|
||||||
use_frameworks!
|
use_frameworks!
|
||||||
@@ -9,26 +9,24 @@ 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@6.1.1_@capacitor+core@6.1.1/node_modules/@capacitor/ios'
|
pod 'Capacitor', :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@6.1.1_@capacitor+core@6.1.1/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 'CapacitorCommunityScreenBrightness', :path => '../../../../node_modules/.pnpm/@capacitor-community+screen-brightness@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor-community/screen-brightness'
|
pod 'CapacitorApp', :path => '../../../../node_modules/.pnpm/@capacitor+app@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/app'
|
||||||
pod 'CapacitorApp', :path => '../../../../node_modules/.pnpm/@capacitor+app@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/app'
|
pod 'CapacitorBrowser', :path => '../../../../node_modules/.pnpm/@capacitor+browser@5.1.0_@capacitor+core@5.5.0/node_modules/@capacitor/browser'
|
||||||
pod 'CapacitorBrowser', :path => '../../../../node_modules/.pnpm/@capacitor+browser@6.0.1_@capacitor+core@6.1.1/node_modules/@capacitor/browser'
|
pod 'CapacitorClipboard', :path => '../../../../node_modules/.pnpm/@capacitor+clipboard@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/clipboard'
|
||||||
pod 'CapacitorClipboard', :path => '../../../../node_modules/.pnpm/@capacitor+clipboard@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/clipboard'
|
pod 'CapacitorDevice', :path => '../../../../node_modules/.pnpm/@capacitor+device@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/device'
|
||||||
pod 'CapacitorDevice', :path => '../../../../node_modules/.pnpm/@capacitor+device@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/device'
|
pod 'CapacitorDialog', :path => '../../../../node_modules/.pnpm/@capacitor+dialog@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/dialog'
|
||||||
pod 'CapacitorDialog', :path => '../../../../node_modules/.pnpm/@capacitor+dialog@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/dialog'
|
pod 'CapacitorFilesystem', :path => '../../../../node_modules/.pnpm/@capacitor+filesystem@5.1.4_@capacitor+core@5.5.0/node_modules/@capacitor/filesystem'
|
||||||
pod 'CapacitorFilesystem', :path => '../../../../node_modules/.pnpm/@capacitor+filesystem@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/filesystem'
|
pod 'CapacitorGeolocation', :path => '../../../../node_modules/.pnpm/@capacitor+geolocation@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/geolocation'
|
||||||
pod 'CapacitorGeolocation', :path => '../../../../node_modules/.pnpm/@capacitor+geolocation@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/geolocation'
|
pod 'CapacitorHaptics', :path => '../../../../node_modules/.pnpm/@capacitor+haptics@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/haptics'
|
||||||
pod 'CapacitorHaptics', :path => '../../../../node_modules/.pnpm/@capacitor+haptics@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/haptics'
|
pod 'CapacitorKeyboard', :path => '../../../../node_modules/.pnpm/@capacitor+keyboard@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/keyboard'
|
||||||
pod 'CapacitorKeyboard', :path => '../../../../node_modules/.pnpm/@capacitor+keyboard@6.0.1_@capacitor+core@6.1.1/node_modules/@capacitor/keyboard'
|
pod 'CapacitorLocalNotifications', :path => '../../../../node_modules/.pnpm/@capacitor+local-notifications@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/local-notifications'
|
||||||
pod 'CapacitorLocalNotifications', :path => '../../../../node_modules/.pnpm/@capacitor+local-notifications@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/local-notifications'
|
pod 'CapacitorNetwork', :path => '../../../../node_modules/.pnpm/@capacitor+network@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/network'
|
||||||
pod 'CapacitorNetwork', :path => '../../../../node_modules/.pnpm/@capacitor+network@6.0.1_@capacitor+core@6.1.1/node_modules/@capacitor/network'
|
pod 'CapacitorPreferences', :path => '../../../../node_modules/.pnpm/@capacitor+preferences@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/preferences'
|
||||||
pod 'CapacitorPreferences', :path => '../../../../node_modules/.pnpm/@capacitor+preferences@6.0.1_@capacitor+core@6.1.1/node_modules/@capacitor/preferences'
|
pod 'CapacitorShare', :path => '../../../../node_modules/.pnpm/@capacitor+share@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/share'
|
||||||
pod 'CapacitorScreenOrientation', :path => '../../../../node_modules/.pnpm/@capacitor+screen-orientation@6.0.1_@capacitor+core@6.1.1/node_modules/@capacitor/screen-orientation'
|
pod 'CapacitorSplashScreen', :path => '../../../../node_modules/.pnpm/@capacitor+splash-screen@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/splash-screen'
|
||||||
pod 'CapacitorShare', :path => '../../../../node_modules/.pnpm/@capacitor+share@6.0.1_@capacitor+core@6.1.1/node_modules/@capacitor/share'
|
pod 'TransistorsoftCapacitorBackgroundFetch', :path => '../../../../node_modules/.pnpm/@transistorsoft+capacitor-background-fetch@5.1.1_@capacitor+core@5.5.0/node_modules/@transistorsoft/capacitor-background-fetch'
|
||||||
pod 'CapacitorSplashScreen', :path => '../../../../node_modules/.pnpm/@capacitor+splash-screen@6.0.1_@capacitor+core@6.1.1/node_modules/@capacitor/splash-screen'
|
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 'TransistorsoftCapacitorBackgroundFetch', :path => '../../../../node_modules/.pnpm/@transistorsoft+capacitor-background-fetch@5.2.0_@capacitor+core@6.1.1/node_modules/@transistorsoft/capacitor-background-fetch'
|
|
||||||
pod 'CapacitorSecureStoragePlugin', :path => '../../../../node_modules/.pnpm/capacitor-secure-storage-plugin@0.9.0_@capacitor+core@6.1.1/node_modules/capacitor-secure-storage-plugin'
|
|
||||||
pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins'
|
pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,70 +1,64 @@
|
|||||||
PODS:
|
PODS:
|
||||||
- Capacitor (6.1.1):
|
- Capacitor (5.5.0):
|
||||||
- CapacitorCordova
|
- CapacitorCordova
|
||||||
- CapacitorApp (6.0.0):
|
- CapacitorApp (5.0.6):
|
||||||
- Capacitor
|
- Capacitor
|
||||||
- CapacitorBrowser (6.0.1):
|
- CapacitorBrowser (5.1.0):
|
||||||
- Capacitor
|
- Capacitor
|
||||||
- CapacitorClipboard (6.0.0):
|
- CapacitorClipboard (5.0.6):
|
||||||
- Capacitor
|
- Capacitor
|
||||||
- CapacitorCommunityScreenBrightness (6.0.0):
|
- CapacitorCordova (5.5.0)
|
||||||
|
- CapacitorDevice (5.0.6):
|
||||||
- Capacitor
|
- Capacitor
|
||||||
- CapacitorCordova (6.1.1)
|
- CapacitorDialog (5.0.6):
|
||||||
- CapacitorDevice (6.0.0):
|
|
||||||
- Capacitor
|
- Capacitor
|
||||||
- CapacitorDialog (6.0.0):
|
- CapacitorFilesystem (5.1.4):
|
||||||
- Capacitor
|
- Capacitor
|
||||||
- CapacitorFilesystem (6.0.0):
|
- CapacitorGeolocation (5.0.6):
|
||||||
- Capacitor
|
- Capacitor
|
||||||
- CapacitorGeolocation (6.0.0):
|
- CapacitorHaptics (5.0.6):
|
||||||
- Capacitor
|
- Capacitor
|
||||||
- CapacitorHaptics (6.0.0):
|
- CapacitorKeyboard (5.0.6):
|
||||||
- Capacitor
|
- Capacitor
|
||||||
- CapacitorKeyboard (6.0.1):
|
- CapacitorLocalNotifications (5.0.6):
|
||||||
- Capacitor
|
- Capacitor
|
||||||
- CapacitorLocalNotifications (6.0.0):
|
- CapacitorNetwork (5.0.6):
|
||||||
- Capacitor
|
- Capacitor
|
||||||
- CapacitorNetwork (6.0.1):
|
- CapacitorPreferences (5.0.6):
|
||||||
- Capacitor
|
|
||||||
- CapacitorPreferences (6.0.1):
|
|
||||||
- Capacitor
|
|
||||||
- CapacitorScreenOrientation (6.0.1):
|
|
||||||
- Capacitor
|
- Capacitor
|
||||||
- CapacitorSecureStoragePlugin (0.9.0):
|
- CapacitorSecureStoragePlugin (0.9.0):
|
||||||
- Capacitor
|
- Capacitor
|
||||||
- SwiftKeychainWrapper
|
- SwiftKeychainWrapper
|
||||||
- CapacitorShare (6.0.1):
|
- CapacitorShare (5.0.6):
|
||||||
- Capacitor
|
- Capacitor
|
||||||
- CapacitorSplashScreen (6.0.1):
|
- CapacitorSplashScreen (5.0.6):
|
||||||
- Capacitor
|
- Capacitor
|
||||||
- CordovaPlugins (6.1.1):
|
- CordovaPlugins (5.5.0):
|
||||||
- CapacitorCordova
|
- CapacitorCordova
|
||||||
- SwiftKeychainWrapper (4.0.1)
|
- SwiftKeychainWrapper (4.0.1)
|
||||||
- TransistorsoftCapacitorBackgroundFetch (5.2.0):
|
- TransistorsoftCapacitorBackgroundFetch (5.1.1):
|
||||||
- Capacitor
|
- Capacitor
|
||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
- "Capacitor (from `../../../../node_modules/.pnpm/@capacitor+ios@6.1.1_@capacitor+core@6.1.1/node_modules/@capacitor/ios`)"
|
- "Capacitor (from `../../../../node_modules/.pnpm/@capacitor+ios@5.5.0_@capacitor+core@5.5.0/node_modules/@capacitor/ios`)"
|
||||||
- "CapacitorApp (from `../../../../node_modules/.pnpm/@capacitor+app@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/app`)"
|
- "CapacitorApp (from `../../../../node_modules/.pnpm/@capacitor+app@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/app`)"
|
||||||
- "CapacitorBrowser (from `../../../../node_modules/.pnpm/@capacitor+browser@6.0.1_@capacitor+core@6.1.1/node_modules/@capacitor/browser`)"
|
- "CapacitorBrowser (from `../../../../node_modules/.pnpm/@capacitor+browser@5.1.0_@capacitor+core@5.5.0/node_modules/@capacitor/browser`)"
|
||||||
- "CapacitorClipboard (from `../../../../node_modules/.pnpm/@capacitor+clipboard@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/clipboard`)"
|
- "CapacitorClipboard (from `../../../../node_modules/.pnpm/@capacitor+clipboard@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/clipboard`)"
|
||||||
- "CapacitorCommunityScreenBrightness (from `../../../../node_modules/.pnpm/@capacitor-community+screen-brightness@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor-community/screen-brightness`)"
|
- "CapacitorCordova (from `../../../../node_modules/.pnpm/@capacitor+ios@5.5.0_@capacitor+core@5.5.0/node_modules/@capacitor/ios`)"
|
||||||
- "CapacitorCordova (from `../../../../node_modules/.pnpm/@capacitor+ios@6.1.1_@capacitor+core@6.1.1/node_modules/@capacitor/ios`)"
|
- "CapacitorDevice (from `../../../../node_modules/.pnpm/@capacitor+device@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/device`)"
|
||||||
- "CapacitorDevice (from `../../../../node_modules/.pnpm/@capacitor+device@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/device`)"
|
- "CapacitorDialog (from `../../../../node_modules/.pnpm/@capacitor+dialog@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/dialog`)"
|
||||||
- "CapacitorDialog (from `../../../../node_modules/.pnpm/@capacitor+dialog@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/dialog`)"
|
- "CapacitorFilesystem (from `../../../../node_modules/.pnpm/@capacitor+filesystem@5.1.4_@capacitor+core@5.5.0/node_modules/@capacitor/filesystem`)"
|
||||||
- "CapacitorFilesystem (from `../../../../node_modules/.pnpm/@capacitor+filesystem@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/filesystem`)"
|
- "CapacitorGeolocation (from `../../../../node_modules/.pnpm/@capacitor+geolocation@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/geolocation`)"
|
||||||
- "CapacitorGeolocation (from `../../../../node_modules/.pnpm/@capacitor+geolocation@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/geolocation`)"
|
- "CapacitorHaptics (from `../../../../node_modules/.pnpm/@capacitor+haptics@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/haptics`)"
|
||||||
- "CapacitorHaptics (from `../../../../node_modules/.pnpm/@capacitor+haptics@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/haptics`)"
|
- "CapacitorKeyboard (from `../../../../node_modules/.pnpm/@capacitor+keyboard@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/keyboard`)"
|
||||||
- "CapacitorKeyboard (from `../../../../node_modules/.pnpm/@capacitor+keyboard@6.0.1_@capacitor+core@6.1.1/node_modules/@capacitor/keyboard`)"
|
- "CapacitorLocalNotifications (from `../../../../node_modules/.pnpm/@capacitor+local-notifications@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/local-notifications`)"
|
||||||
- "CapacitorLocalNotifications (from `../../../../node_modules/.pnpm/@capacitor+local-notifications@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/local-notifications`)"
|
- "CapacitorNetwork (from `../../../../node_modules/.pnpm/@capacitor+network@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/network`)"
|
||||||
- "CapacitorNetwork (from `../../../../node_modules/.pnpm/@capacitor+network@6.0.1_@capacitor+core@6.1.1/node_modules/@capacitor/network`)"
|
- "CapacitorPreferences (from `../../../../node_modules/.pnpm/@capacitor+preferences@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/preferences`)"
|
||||||
- "CapacitorPreferences (from `../../../../node_modules/.pnpm/@capacitor+preferences@6.0.1_@capacitor+core@6.1.1/node_modules/@capacitor/preferences`)"
|
- "CapacitorSecureStoragePlugin (from `../../../../node_modules/.pnpm/capacitor-secure-storage-plugin@0.9.0_@capacitor+core@5.5.0/node_modules/capacitor-secure-storage-plugin`)"
|
||||||
- "CapacitorScreenOrientation (from `../../../../node_modules/.pnpm/@capacitor+screen-orientation@6.0.1_@capacitor+core@6.1.1/node_modules/@capacitor/screen-orientation`)"
|
- "CapacitorShare (from `../../../../node_modules/.pnpm/@capacitor+share@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/share`)"
|
||||||
- "CapacitorSecureStoragePlugin (from `../../../../node_modules/.pnpm/capacitor-secure-storage-plugin@0.9.0_@capacitor+core@6.1.1/node_modules/capacitor-secure-storage-plugin`)"
|
- "CapacitorSplashScreen (from `../../../../node_modules/.pnpm/@capacitor+splash-screen@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/splash-screen`)"
|
||||||
- "CapacitorShare (from `../../../../node_modules/.pnpm/@capacitor+share@6.0.1_@capacitor+core@6.1.1/node_modules/@capacitor/share`)"
|
|
||||||
- "CapacitorSplashScreen (from `../../../../node_modules/.pnpm/@capacitor+splash-screen@6.0.1_@capacitor+core@6.1.1/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@5.2.0_@capacitor+core@6.1.1/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:
|
||||||
@@ -72,72 +66,66 @@ SPEC REPOS:
|
|||||||
|
|
||||||
EXTERNAL SOURCES:
|
EXTERNAL SOURCES:
|
||||||
Capacitor:
|
Capacitor:
|
||||||
:path: "../../../../node_modules/.pnpm/@capacitor+ios@6.1.1_@capacitor+core@6.1.1/node_modules/@capacitor/ios"
|
:path: "../../../../node_modules/.pnpm/@capacitor+ios@5.5.0_@capacitor+core@5.5.0/node_modules/@capacitor/ios"
|
||||||
CapacitorApp:
|
CapacitorApp:
|
||||||
:path: "../../../../node_modules/.pnpm/@capacitor+app@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/app"
|
:path: "../../../../node_modules/.pnpm/@capacitor+app@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/app"
|
||||||
CapacitorBrowser:
|
CapacitorBrowser:
|
||||||
:path: "../../../../node_modules/.pnpm/@capacitor+browser@6.0.1_@capacitor+core@6.1.1/node_modules/@capacitor/browser"
|
:path: "../../../../node_modules/.pnpm/@capacitor+browser@5.1.0_@capacitor+core@5.5.0/node_modules/@capacitor/browser"
|
||||||
CapacitorClipboard:
|
CapacitorClipboard:
|
||||||
:path: "../../../../node_modules/.pnpm/@capacitor+clipboard@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/clipboard"
|
:path: "../../../../node_modules/.pnpm/@capacitor+clipboard@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/clipboard"
|
||||||
CapacitorCommunityScreenBrightness:
|
|
||||||
:path: "../../../../node_modules/.pnpm/@capacitor-community+screen-brightness@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor-community/screen-brightness"
|
|
||||||
CapacitorCordova:
|
CapacitorCordova:
|
||||||
:path: "../../../../node_modules/.pnpm/@capacitor+ios@6.1.1_@capacitor+core@6.1.1/node_modules/@capacitor/ios"
|
:path: "../../../../node_modules/.pnpm/@capacitor+ios@5.5.0_@capacitor+core@5.5.0/node_modules/@capacitor/ios"
|
||||||
CapacitorDevice:
|
CapacitorDevice:
|
||||||
:path: "../../../../node_modules/.pnpm/@capacitor+device@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/device"
|
:path: "../../../../node_modules/.pnpm/@capacitor+device@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/device"
|
||||||
CapacitorDialog:
|
CapacitorDialog:
|
||||||
:path: "../../../../node_modules/.pnpm/@capacitor+dialog@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/dialog"
|
:path: "../../../../node_modules/.pnpm/@capacitor+dialog@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/dialog"
|
||||||
CapacitorFilesystem:
|
CapacitorFilesystem:
|
||||||
:path: "../../../../node_modules/.pnpm/@capacitor+filesystem@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/filesystem"
|
:path: "../../../../node_modules/.pnpm/@capacitor+filesystem@5.1.4_@capacitor+core@5.5.0/node_modules/@capacitor/filesystem"
|
||||||
CapacitorGeolocation:
|
CapacitorGeolocation:
|
||||||
:path: "../../../../node_modules/.pnpm/@capacitor+geolocation@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/geolocation"
|
:path: "../../../../node_modules/.pnpm/@capacitor+geolocation@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/geolocation"
|
||||||
CapacitorHaptics:
|
CapacitorHaptics:
|
||||||
:path: "../../../../node_modules/.pnpm/@capacitor+haptics@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/haptics"
|
:path: "../../../../node_modules/.pnpm/@capacitor+haptics@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/haptics"
|
||||||
CapacitorKeyboard:
|
CapacitorKeyboard:
|
||||||
:path: "../../../../node_modules/.pnpm/@capacitor+keyboard@6.0.1_@capacitor+core@6.1.1/node_modules/@capacitor/keyboard"
|
:path: "../../../../node_modules/.pnpm/@capacitor+keyboard@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/keyboard"
|
||||||
CapacitorLocalNotifications:
|
CapacitorLocalNotifications:
|
||||||
:path: "../../../../node_modules/.pnpm/@capacitor+local-notifications@6.0.0_@capacitor+core@6.1.1/node_modules/@capacitor/local-notifications"
|
:path: "../../../../node_modules/.pnpm/@capacitor+local-notifications@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/local-notifications"
|
||||||
CapacitorNetwork:
|
CapacitorNetwork:
|
||||||
:path: "../../../../node_modules/.pnpm/@capacitor+network@6.0.1_@capacitor+core@6.1.1/node_modules/@capacitor/network"
|
:path: "../../../../node_modules/.pnpm/@capacitor+network@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/network"
|
||||||
CapacitorPreferences:
|
CapacitorPreferences:
|
||||||
:path: "../../../../node_modules/.pnpm/@capacitor+preferences@6.0.1_@capacitor+core@6.1.1/node_modules/@capacitor/preferences"
|
:path: "../../../../node_modules/.pnpm/@capacitor+preferences@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/preferences"
|
||||||
CapacitorScreenOrientation:
|
|
||||||
:path: "../../../../node_modules/.pnpm/@capacitor+screen-orientation@6.0.1_@capacitor+core@6.1.1/node_modules/@capacitor/screen-orientation"
|
|
||||||
CapacitorSecureStoragePlugin:
|
CapacitorSecureStoragePlugin:
|
||||||
:path: "../../../../node_modules/.pnpm/capacitor-secure-storage-plugin@0.9.0_@capacitor+core@6.1.1/node_modules/capacitor-secure-storage-plugin"
|
:path: "../../../../node_modules/.pnpm/capacitor-secure-storage-plugin@0.9.0_@capacitor+core@5.5.0/node_modules/capacitor-secure-storage-plugin"
|
||||||
CapacitorShare:
|
CapacitorShare:
|
||||||
:path: "../../../../node_modules/.pnpm/@capacitor+share@6.0.1_@capacitor+core@6.1.1/node_modules/@capacitor/share"
|
:path: "../../../../node_modules/.pnpm/@capacitor+share@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/share"
|
||||||
CapacitorSplashScreen:
|
CapacitorSplashScreen:
|
||||||
:path: "../../../../node_modules/.pnpm/@capacitor+splash-screen@6.0.1_@capacitor+core@6.1.1/node_modules/@capacitor/splash-screen"
|
:path: "../../../../node_modules/.pnpm/@capacitor+splash-screen@5.0.6_@capacitor+core@5.5.0/node_modules/@capacitor/splash-screen"
|
||||||
CordovaPlugins:
|
CordovaPlugins:
|
||||||
:path: "../capacitor-cordova-ios-plugins"
|
:path: "../capacitor-cordova-ios-plugins"
|
||||||
TransistorsoftCapacitorBackgroundFetch:
|
TransistorsoftCapacitorBackgroundFetch:
|
||||||
:path: "../../../../node_modules/.pnpm/@transistorsoft+capacitor-background-fetch@5.2.0_@capacitor+core@6.1.1/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: 8941aba4364ba9d1b22188569001f2ce45cc2b00
|
Capacitor: 57890b363df14d5d2d5d8461aa23e886cb34da2a
|
||||||
CapacitorApp: 9d53aec7101f7b030a950c5bdc4df8612576b279
|
CapacitorApp: 024e1b1bea5f883d79f6330d309bc441c88ad04a
|
||||||
CapacitorBrowser: 473c7fd70ddbe541608ff09ec1be14da0078279e
|
CapacitorBrowser: 7a0fb6a1011abfaaf2dfedfd8248f942a8eda3d6
|
||||||
CapacitorClipboard: 80282f684154124b9019ebf401235b70b0cf4994
|
CapacitorClipboard: 77edf49827ea21da2a9c05c690a4a6a4d07199c4
|
||||||
CapacitorCommunityScreenBrightness: 250184917bd0738a681c026a9513e18ddb0cb49b
|
CapacitorCordova: 3d3908a3d208a11a75f9df3b18c4405c4de76e1d
|
||||||
CapacitorCordova: 8f2cc8d8d3619c566e9418fe8772064a94266106
|
CapacitorDevice: 2c968f98a1ec4d22357418c1521e7ddc46c675e6
|
||||||
CapacitorDevice: f8fd88f9edd1261c55a109f32015b09bbbfdc4a0
|
CapacitorDialog: 0f3c15dfe9414b83bc64aef4078f1b92bcfead26
|
||||||
CapacitorDialog: 64aa82840ee5e9c066f9e1a49c1e186afd3f24d2
|
CapacitorFilesystem: af704badfbc69f6f8623d9ed313e5490e3723dcb
|
||||||
CapacitorFilesystem: 60e59ba274c234a979e7a3be2552feaadcee4263
|
CapacitorGeolocation: 7be5f77abc205c0efe319fff8587a7183e7b0240
|
||||||
CapacitorGeolocation: 1f12bbe372b65116e851bd8e3a94cf0ef9bacebb
|
CapacitorHaptics: 1fffc1217c7e64a472d7845be50fb0c2f7d4204c
|
||||||
CapacitorHaptics: 9ebc9363f0e9b8eb4295088a0b474530acf1859b
|
CapacitorKeyboard: b978154b024a5f65e044908e37d15b7de58b9d12
|
||||||
CapacitorKeyboard: 5f32a712adf41e07a61caafb82cf29fb6d8ba123
|
CapacitorLocalNotifications: c2d8b14794064fd4814b1d6c4ddbac8029afa295
|
||||||
CapacitorLocalNotifications: 4ab68f0be5f697a579558fadd307d823a9ec1c26
|
CapacitorNetwork: d80b3e79bef6ec37640ee2806c19771f07ff2d0c
|
||||||
CapacitorNetwork: 5c94acfdddc22043f2ffaff224ce9b4aa5a179f0
|
CapacitorPreferences: f03954bcb0ff09c792909e46bff88e3183c16b10
|
||||||
CapacitorPreferences: 72909b165bc7807103778ddbb86d5d8ce06abf71
|
|
||||||
CapacitorScreenOrientation: 3d4965dcbda5d901b6a48350a5d270ad7d404e05
|
|
||||||
CapacitorSecureStoragePlugin: e91d7df060f2495a1acff9583641a6953e3aacba
|
CapacitorSecureStoragePlugin: e91d7df060f2495a1acff9583641a6953e3aacba
|
||||||
CapacitorShare: 02222f2457ff003e642370a9c1ecd101baaa27c8
|
CapacitorShare: cd41743331cb71d217c029de54b681cbd91e0fcc
|
||||||
CapacitorSplashScreen: 61645214e8f955ff2b80f16a6a3648960fe4c89f
|
CapacitorSplashScreen: 5fa2ab5e46cf5cc530cf16a51c80c7a986579ccd
|
||||||
CordovaPlugins: 1078156cfc354dd440b38ce4062e69fd9b07033c
|
CordovaPlugins: de5669381702d76ed5b1d442177a6a5fc3252a9d
|
||||||
SwiftKeychainWrapper: 807ba1d63c33a7d0613288512399cd1eda1e470c
|
SwiftKeychainWrapper: 807ba1d63c33a7d0613288512399cd1eda1e470c
|
||||||
TransistorsoftCapacitorBackgroundFetch: f130c5dcb6048401e74cc531e691e1d513045366
|
TransistorsoftCapacitorBackgroundFetch: ce4b3e01b898cef516e68485d2160a078016ee97
|
||||||
|
|
||||||
PODFILE CHECKSUM: d0561b89b66368df409c77587e3e02b48e737203
|
PODFILE CHECKSUM: 229278f2c257e8ab555325c7115b2e187e8e628d
|
||||||
|
|
||||||
COCOAPODS: 1.15.2
|
COCOAPODS: 1.13.0
|
||||||
|
|||||||
@@ -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.3.3",
|
"version": "3.2.0",
|
||||||
"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>",
|
||||||
@@ -61,23 +61,21 @@
|
|||||||
"@angular/router": "17.3.0",
|
"@angular/router": "17.3.0",
|
||||||
"@awesome-cordova-plugins/calendar": "6.6.0",
|
"@awesome-cordova-plugins/calendar": "6.6.0",
|
||||||
"@awesome-cordova-plugins/core": "6.6.0",
|
"@awesome-cordova-plugins/core": "6.6.0",
|
||||||
"@capacitor-community/screen-brightness": "6.0.0",
|
"@capacitor/app": "5.0.7",
|
||||||
"@capacitor/app": "6.0.0",
|
"@capacitor/browser": "5.2.0",
|
||||||
"@capacitor/browser": "6.0.1",
|
"@capacitor/clipboard": "5.0.7",
|
||||||
"@capacitor/clipboard": "6.0.0",
|
"@capacitor/core": "5.7.3",
|
||||||
"@capacitor/core": "6.1.1",
|
"@capacitor/device": "5.0.7",
|
||||||
"@capacitor/device": "6.0.0",
|
"@capacitor/dialog": "5.0.7",
|
||||||
"@capacitor/dialog": "6.0.0",
|
"@capacitor/filesystem": "5.2.1",
|
||||||
"@capacitor/filesystem": "6.0.0",
|
"@capacitor/geolocation": "5.0.7",
|
||||||
"@capacitor/geolocation": "6.0.0",
|
"@capacitor/haptics": "5.0.7",
|
||||||
"@capacitor/haptics": "6.0.0",
|
"@capacitor/keyboard": "5.0.8",
|
||||||
"@capacitor/keyboard": "6.0.1",
|
"@capacitor/local-notifications": "5.0.7",
|
||||||
"@capacitor/local-notifications": "6.0.0",
|
"@capacitor/network": "5.0.7",
|
||||||
"@capacitor/network": "6.0.1",
|
"@capacitor/preferences": "5.0.7",
|
||||||
"@capacitor/preferences": "6.0.1",
|
"@capacitor/share": "5.0.7",
|
||||||
"@capacitor/screen-orientation": "6.0.1",
|
"@capacitor/splash-screen": "5.0.7",
|
||||||
"@capacitor/share": "6.0.1",
|
|
||||||
"@capacitor/splash-screen": "6.0.1",
|
|
||||||
"@ionic-native/core": "5.36.0",
|
"@ionic-native/core": "5.36.0",
|
||||||
"@ionic/angular": "7.8.0",
|
"@ionic/angular": "7.8.0",
|
||||||
"@ionic/storage-angular": "4.0.0",
|
"@ionic/storage-angular": "4.0.0",
|
||||||
@@ -90,7 +88,6 @@
|
|||||||
"@openstapps/core": "workspace:*",
|
"@openstapps/core": "workspace:*",
|
||||||
"@transistorsoft/capacitor-background-fetch": "5.2.0",
|
"@transistorsoft/capacitor-background-fetch": "5.2.0",
|
||||||
"@types/dom-view-transitions": "1.0.4",
|
"@types/dom-view-transitions": "1.0.4",
|
||||||
"asn1js": "3.0.5",
|
|
||||||
"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": "3.6.0",
|
"date-fns": "3.6.0",
|
||||||
@@ -98,9 +95,7 @@
|
|||||||
"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": "10.0.6",
|
"jsonpath-plus": "6.0.1",
|
||||||
"libbase64": "1.3.0",
|
|
||||||
"libqp": "2.1.0",
|
|
||||||
"maplibre-gl": "4.0.2",
|
"maplibre-gl": "4.0.2",
|
||||||
"material-symbols": "0.17.1",
|
"material-symbols": "0.17.1",
|
||||||
"moment": "2.30.1",
|
"moment": "2.30.1",
|
||||||
@@ -109,14 +104,11 @@
|
|||||||
"ngx-markdown": "17.1.1",
|
"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",
|
||||||
"pkijs": "3.1.0",
|
|
||||||
"pmtiles": "3.0.3",
|
"pmtiles": "3.0.3",
|
||||||
"postal-mime": "2.2.5",
|
|
||||||
"rxjs": "7.8.1",
|
"rxjs": "7.8.1",
|
||||||
"semver": "7.6.0",
|
"semver": "7.6.0",
|
||||||
"swiper": "8.4.5",
|
"swiper": "8.4.5",
|
||||||
"tslib": "2.6.2",
|
"tslib": "2.6.2",
|
||||||
"zod": "3.23.8",
|
|
||||||
"zone.js": "0.14.4"
|
"zone.js": "0.14.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -135,21 +127,19 @@
|
|||||||
"@angular/language-server": "17.3.0",
|
"@angular/language-server": "17.3.0",
|
||||||
"@angular/language-service": "17.3.0",
|
"@angular/language-service": "17.3.0",
|
||||||
"@angular/platform-browser-dynamic": "17.3.0",
|
"@angular/platform-browser-dynamic": "17.3.0",
|
||||||
"@capacitor/android": "6.1.1",
|
"@capacitor/android": "5.7.3",
|
||||||
"@capacitor/assets": "3.0.4",
|
"@capacitor/assets": "3.0.4",
|
||||||
"@capacitor/cli": "6.1.1",
|
"@capacitor/cli": "5.7.3",
|
||||||
"@capacitor/ios": "6.1.1",
|
"@capacitor/ios": "5.7.3",
|
||||||
"@compodoc/compodoc": "1.1.23",
|
"@compodoc/compodoc": "1.1.23",
|
||||||
"@cypress/schematic": "2.5.1",
|
"@cypress/schematic": "2.5.1",
|
||||||
"@ionic/angular-toolkit": "11.0.1",
|
"@ionic/angular-toolkit": "11.0.1",
|
||||||
"@ionic/cli": "7.2.0",
|
"@ionic/cli": "7.2.0",
|
||||||
"@openstapps/prettier-config": "workspace:*",
|
"@openstapps/prettier-config": "workspace:*",
|
||||||
"@openstapps/tsconfig": "workspace:*",
|
"@openstapps/tsconfig": "workspace:*",
|
||||||
"@types/dompurify": "3.0.5",
|
|
||||||
"@types/fontkit": "2.0.7",
|
"@types/fontkit": "2.0.7",
|
||||||
"@types/geojson": "1.0.6",
|
"@types/geojson": "1.0.6",
|
||||||
"@types/glob": "8.1.0",
|
"@types/glob": "8.1.0",
|
||||||
"@types/imapflow": "1.0.18",
|
|
||||||
"@types/jasmine": "5.1.4",
|
"@types/jasmine": "5.1.4",
|
||||||
"@types/jasminewd2": "2.0.13",
|
"@types/jasminewd2": "2.0.13",
|
||||||
"@types/jsonpath": "0.2.0",
|
"@types/jsonpath": "0.2.0",
|
||||||
@@ -162,7 +152,6 @@
|
|||||||
"@typescript-eslint/parser": "7.2.0",
|
"@typescript-eslint/parser": "7.2.0",
|
||||||
"cordova-res": "0.15.4",
|
"cordova-res": "0.15.4",
|
||||||
"cypress": "13.7.0",
|
"cypress": "13.7.0",
|
||||||
"dompurify": "3.1.6",
|
|
||||||
"eslint": "8.57.0",
|
"eslint": "8.57.0",
|
||||||
"eslint-plugin-jsdoc": "48.2.1",
|
"eslint-plugin-jsdoc": "48.2.1",
|
||||||
"eslint-plugin-prettier": "5.1.3",
|
"eslint-plugin-prettier": "5.1.3",
|
||||||
|
|||||||
@@ -1,214 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@openstapps/app",
|
|
||||||
"description": "The generic app tailored to fulfill needs of German universities, written using Ionic Framework.",
|
|
||||||
"version": "3.3.2",
|
|
||||||
"private": true,
|
|
||||||
"license": "GPL-3.0-only",
|
|
||||||
"author": "Karl-Philipp Wulfert <krlwlfrt@gmail.com>",
|
|
||||||
"contributors": [
|
|
||||||
"Frank Nagel <frank.nagel@hrz.uni-marburg.de>",
|
|
||||||
"Jovan Krunić <jovan.krunic@gmail.com>",
|
|
||||||
"Michel Jonathan Schmitz <michel.jonathan.schmitz@its.thm.de>",
|
|
||||||
"Rainer Killinger <mail-openstapps@killinger.co>",
|
|
||||||
"Sebastian Lange <sebastianlange87@gmail.com>",
|
|
||||||
"Thea Schöbl <dev@theaninova.de>"
|
|
||||||
],
|
|
||||||
"scripts": {
|
|
||||||
"analyze": "webpack-bundle-analyzer www/stats.json",
|
|
||||||
"build": "pnpm check-icons && ng build --configuration=production --stats-json && webpack-bundle-analyzer www/stats.json --mode static --report www/bundle-info.html --no-open",
|
|
||||||
"build:analyze": "npm run build:stats && npm run analyze",
|
|
||||||
"build:android": "ionic capacitor build android --no-open && cd android && ./gradlew clean assemble && cd ..",
|
|
||||||
"build:prod": "ng build --configuration=production",
|
|
||||||
"build:stats": "ng build --configuration=production --stats-json",
|
|
||||||
"changelog": "conventional-changelog -p angular -i src/assets/about/CHANGELOG.md -s -r 0",
|
|
||||||
"check-icons": "node scripts/check-icon-correctness.mjs",
|
|
||||||
"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",
|
|
||||||
"cypress:open": "cypress open",
|
|
||||||
"cypress:run": "cypress run",
|
|
||||||
"docker:build": "sudo docker run -p 8100:8100 -p 35729:35729 -p 53703:53703 -v $PWD:/app -it registry.gitlab.com/openstapps/app bash -c \"npm install && npm run build\"",
|
|
||||||
"docker:build:android": "sudo docker run -p 8100:8100 -p 35729:35729 -p 53703:53703 -v $PWD:/app -it registry.gitlab.com/openstapps/app bash -c \"npm run build:android\"",
|
|
||||||
"docker:enter": "sudo docker run -p 8100:8100 -p 35729:35729 -p 53703:53703 -v $PWD:/app -it registry.gitlab.com/openstapps/app bash",
|
|
||||||
"docker:pull": "sudo docker pull registry.gitlab.com/openstapps/app",
|
|
||||||
"docker:run:android": "sudo docker run -v $PWD:/app --privileged -v /dev/bus/usb:/dev/bus/usb --net=host -it registry.gitlab.com/openstapps/app bash -c \"npm run run:android\"",
|
|
||||||
"docker:serve": "sudo docker run -p 8100:8100 -p 35729:35729 -p 53703:53703 -v $PWD:/app -it registry.gitlab.com/openstapps/app bash -c \"npm run start:external\"",
|
|
||||||
"e2e": "ng e2e",
|
|
||||||
"format": "prettier . -c",
|
|
||||||
"format:fix": "prettier --write .",
|
|
||||||
"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:fix": "eslint --fix -c .eslintrc.json --ignore-path .eslintignore --ext .ts,.html src/ && stylelint --fix \"**/*.scss\"",
|
|
||||||
"minify-icons": "node scripts/minify-icon-font.mjs",
|
|
||||||
"postinstall": "jetify && echo \"skipping jetify in production mode\"",
|
|
||||||
"preview": "http-server www --p 8101 -o",
|
|
||||||
"push": "git push && git push origin \"v$npm_package_version\"",
|
|
||||||
"resources:ios": "capacitor-assets generate --ios --iconBackgroundColor $(grep -oE \"^@include ion-color\\(primary, #[a-fA-F0-9]{3,6}\" src/theme/colors.scss | grep -oE \"#[a-fA-F0-9]{3,6}\") --splashBackgroundColor $(grep -oE \"^@include ion-color\\(primary, #[a-fA-F0-9]{3,6}\" src/theme/colors.scss | grep -oE \"#[a-fA-F0-9]{3,6}\")",
|
|
||||||
"run:android": "ionic capacitor run android --livereload --external",
|
|
||||||
"start": "ionic serve",
|
|
||||||
"start:external": "ionic serve --external",
|
|
||||||
"start:prod": "ionic serve --prod",
|
|
||||||
"start:virtual-host": "ionic serve --public-host=mobile.app.uni-frankfurt.de --ssl=true --open=false",
|
|
||||||
"test": "ng test --code-coverage",
|
|
||||||
"test:integration": "sh integration-test.sh"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@angular/animations": "17.3.0",
|
|
||||||
"@angular/cdk": "17.3.0",
|
|
||||||
"@angular/common": "17.3.0",
|
|
||||||
"@angular/core": "17.3.0",
|
|
||||||
"@angular/forms": "17.3.0",
|
|
||||||
"@angular/platform-browser": "17.3.0",
|
|
||||||
"@angular/router": "17.3.0",
|
|
||||||
"@awesome-cordova-plugins/calendar": "6.6.0",
|
|
||||||
"@awesome-cordova-plugins/core": "6.6.0",
|
|
||||||
"@capacitor-community/screen-brightness": "6.0.0",
|
|
||||||
"@capacitor/app": "6.0.0",
|
|
||||||
"@capacitor/browser": "6.0.1",
|
|
||||||
"@capacitor/clipboard": "6.0.0",
|
|
||||||
"@capacitor/core": "6.1.1",
|
|
||||||
"@capacitor/device": "6.0.0",
|
|
||||||
"@capacitor/dialog": "6.0.0",
|
|
||||||
"@capacitor/filesystem": "6.0.0",
|
|
||||||
"@capacitor/geolocation": "6.0.0",
|
|
||||||
"@capacitor/haptics": "6.0.0",
|
|
||||||
"@capacitor/keyboard": "6.0.1",
|
|
||||||
"@capacitor/local-notifications": "6.0.0",
|
|
||||||
"@capacitor/network": "6.0.1",
|
|
||||||
"@capacitor/preferences": "6.0.1",
|
|
||||||
"@capacitor/screen-orientation": "6.0.1",
|
|
||||||
"@capacitor/share": "6.0.1",
|
|
||||||
"@capacitor/splash-screen": "6.0.1",
|
|
||||||
"@ionic-native/core": "5.36.0",
|
|
||||||
"@ionic/angular": "7.8.0",
|
|
||||||
"@ionic/storage-angular": "4.0.0",
|
|
||||||
"@maplibre/ngx-maplibre-gl": "17.4.1",
|
|
||||||
"@ngx-translate/core": "15.0.0",
|
|
||||||
"@ngx-translate/http-loader": "8.0.0",
|
|
||||||
"@openid/appauth": "1.3.1",
|
|
||||||
"@openstapps/api": "workspace:*",
|
|
||||||
"@openstapps/collection-utils": "workspace:*",
|
|
||||||
"@openstapps/core": "workspace:*",
|
|
||||||
"@transistorsoft/capacitor-background-fetch": "5.2.0",
|
|
||||||
"@types/dom-view-transitions": "1.0.4",
|
|
||||||
"asn1js": "3.0.5",
|
|
||||||
"capacitor-secure-storage-plugin": "0.9.0",
|
|
||||||
"cordova-plugin-calendar": "5.1.6",
|
|
||||||
"date-fns": "3.6.0",
|
|
||||||
"deepmerge": "4.3.1",
|
|
||||||
"form-data": "4.0.0",
|
|
||||||
"geojson": "0.5.0",
|
|
||||||
"ionic-appauth": "0.9.0",
|
|
||||||
<<<<<<< HEAD
|
|
||||||
"jsonpath-plus": "10.0.6",
|
|
||||||
"libbase64": "1.3.0",
|
|
||||||
"libqp": "2.1.0",
|
|
||||||
||||||| parent of cff9b026 (fix: pipeline)
|
|
||||||
"jsonpath-plus": "6.0.1",
|
|
||||||
"libbase64": "^1.3.0",
|
|
||||||
"libqp": "^2.1.0",
|
|
||||||
=======
|
|
||||||
"jsonpath-plus": "6.0.1",
|
|
||||||
"libbase64": "1.3.0",
|
|
||||||
"libqp": "2.1.0",
|
|
||||||
>>>>>>> cff9b026 (fix: pipeline)
|
|
||||||
"maplibre-gl": "4.0.2",
|
|
||||||
"material-symbols": "0.17.1",
|
|
||||||
"moment": "2.30.1",
|
|
||||||
"ngx-date-fns": "11.0.0",
|
|
||||||
"ngx-logger": "5.0.12",
|
|
||||||
"ngx-markdown": "17.1.1",
|
|
||||||
"ngx-moment": "6.0.2",
|
|
||||||
"opening_hours": "3.8.0",
|
|
||||||
"pkijs": "3.1.0",
|
|
||||||
"pmtiles": "3.0.3",
|
|
||||||
"postal-mime": "2.2.5",
|
|
||||||
"rxjs": "7.8.1",
|
|
||||||
"semver": "7.6.0",
|
|
||||||
"swiper": "8.4.5",
|
|
||||||
"tslib": "2.6.2",
|
|
||||||
"zod": "3.23.8",
|
|
||||||
"zone.js": "0.14.4"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@angular-devkit/architect": "0.1703.0",
|
|
||||||
"@angular-devkit/build-angular": "17.3.0",
|
|
||||||
"@angular-devkit/core": "17.3.0",
|
|
||||||
"@angular-devkit/schematics": "17.3.0",
|
|
||||||
"@angular-eslint/builder": "17.3.0",
|
|
||||||
"@angular-eslint/eslint-plugin": "17.3.0",
|
|
||||||
"@angular-eslint/eslint-plugin-template": "17.3.0",
|
|
||||||
"@angular-eslint/schematics": "17.3.0",
|
|
||||||
"@angular-eslint/template-parser": "17.3.0",
|
|
||||||
"@angular/cli": "17.3.0",
|
|
||||||
"@angular/compiler": "17.3.0",
|
|
||||||
"@angular/compiler-cli": "17.3.0",
|
|
||||||
"@angular/language-server": "17.3.0",
|
|
||||||
"@angular/language-service": "17.3.0",
|
|
||||||
"@angular/platform-browser-dynamic": "17.3.0",
|
|
||||||
"@capacitor/android": "6.1.1",
|
|
||||||
"@capacitor/assets": "3.0.4",
|
|
||||||
"@capacitor/cli": "6.1.1",
|
|
||||||
"@capacitor/ios": "6.1.1",
|
|
||||||
"@compodoc/compodoc": "1.1.23",
|
|
||||||
"@cypress/schematic": "2.5.1",
|
|
||||||
"@ionic/angular-toolkit": "11.0.1",
|
|
||||||
"@ionic/cli": "7.2.0",
|
|
||||||
"@openstapps/prettier-config": "workspace:*",
|
|
||||||
"@openstapps/tsconfig": "workspace:*",
|
|
||||||
"@types/dompurify": "3.0.5",
|
|
||||||
"@types/fontkit": "2.0.7",
|
|
||||||
"@types/geojson": "1.0.6",
|
|
||||||
"@types/glob": "8.1.0",
|
|
||||||
"@types/imapflow": "1.0.18",
|
|
||||||
"@types/jasmine": "5.1.4",
|
|
||||||
"@types/jasminewd2": "2.0.13",
|
|
||||||
"@types/jsonpath": "0.2.0",
|
|
||||||
"@types/karma": "6.3.8",
|
|
||||||
"@types/karma-coverage": "2.0.3",
|
|
||||||
"@types/karma-jasmine": "4.0.5",
|
|
||||||
"@types/node": "18.15.3",
|
|
||||||
"@types/semver": "7.5.8",
|
|
||||||
"@typescript-eslint/eslint-plugin": "7.2.0",
|
|
||||||
"@typescript-eslint/parser": "7.2.0",
|
|
||||||
"cordova-res": "0.15.4",
|
|
||||||
"cypress": "13.7.0",
|
|
||||||
"dompurify": "3.1.6",
|
|
||||||
"eslint": "8.57.0",
|
|
||||||
"eslint-plugin-jsdoc": "48.2.1",
|
|
||||||
"eslint-plugin-prettier": "5.1.3",
|
|
||||||
"eslint-plugin-unicorn": "51.0.1",
|
|
||||||
"fast-deep-equal": "3.1.3",
|
|
||||||
"fontkit": "2.0.2",
|
|
||||||
"glob": "10.3.10",
|
|
||||||
"http-server": "14.1.1",
|
|
||||||
"is-docker": "2.2.1",
|
|
||||||
"jasmine-core": "5.1.2",
|
|
||||||
"jasmine-spec-reporter": "7.0.0",
|
|
||||||
"jetifier": "2.0.0",
|
|
||||||
"junit-report-merger": "6.0.3",
|
|
||||||
"karma": "6.4.3",
|
|
||||||
"karma-chrome-launcher": "3.2.0",
|
|
||||||
"karma-coverage": "2.2.1",
|
|
||||||
"karma-jasmine": "5.1.0",
|
|
||||||
"karma-junit-reporter": "2.0.1",
|
|
||||||
"karma-mocha-reporter": "2.2.5",
|
|
||||||
"license-checker": "25.0.1",
|
|
||||||
"stylelint": "16.3.1",
|
|
||||||
"stylelint-config-clean-order": "5.4.1",
|
|
||||||
"stylelint-config-prettier-scss": "1.0.0",
|
|
||||||
"stylelint-config-recommended-scss": "14.0.0",
|
|
||||||
"stylelint-config-standard-scss": "13.0.0",
|
|
||||||
"surge": "0.23.1",
|
|
||||||
"ts-node": "10.9.2",
|
|
||||||
"typescript": "5.4.2",
|
|
||||||
"webpack-bundle-analyzer": "4.10.1"
|
|
||||||
},
|
|
||||||
"cordova": {
|
|
||||||
"plugins": {},
|
|
||||||
"platforms": [
|
|
||||||
"ios",
|
|
||||||
"browser",
|
|
||||||
"android"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
import {networkInterfaces} from 'os';
|
|
||||||
|
|
||||||
console.log(
|
|
||||||
Object.entries(networkInterfaces())
|
|
||||||
.map(([, info]) => info)
|
|
||||||
.flat()
|
|
||||||
.find(info => info && !info.internal && info.family === 'IPv4')?.address,
|
|
||||||
);
|
|
||||||
@@ -15,11 +15,12 @@
|
|||||||
import {CommonModule, LocationStrategy, PathLocationStrategy, registerLocaleData} from '@angular/common';
|
import {CommonModule, LocationStrategy, PathLocationStrategy, registerLocaleData} from '@angular/common';
|
||||||
import {HTTP_INTERCEPTORS, HttpClient, HttpClientModule} from '@angular/common/http';
|
import {HTTP_INTERCEPTORS, HttpClient, HttpClientModule} from '@angular/common/http';
|
||||||
import localeDe from '@angular/common/locales/de';
|
import localeDe from '@angular/common/locales/de';
|
||||||
import {APP_INITIALIZER, Injectable, NgModule} from '@angular/core';
|
import {APP_INITIALIZER, NgModule} from '@angular/core';
|
||||||
import {BrowserModule} from '@angular/platform-browser';
|
import {BrowserModule} from '@angular/platform-browser';
|
||||||
import {RouteReuseStrategy} from '@angular/router';
|
import {RouteReuseStrategy} from '@angular/router';
|
||||||
import {IonicModule, IonicRouteStrategy, Platform} from '@ionic/angular';
|
import {IonicModule, IonicRouteStrategy, Platform} from '@ionic/angular';
|
||||||
import {TranslateLoader, TranslateModule, TranslateService} from '@ngx-translate/core';
|
import {TranslateLoader, TranslateModule, TranslateService} from '@ngx-translate/core';
|
||||||
|
import {TranslateHttpLoader} from '@ngx-translate/http-loader';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import 'moment/min/locales';
|
import 'moment/min/locales';
|
||||||
import {LoggerModule, NGXLogger, NgxLoggerLevel} from 'ngx-logger';
|
import {LoggerModule, NGXLogger, NgxLoggerLevel} from 'ngx-logger';
|
||||||
@@ -70,8 +71,6 @@ import {Capacitor} from '@capacitor/core';
|
|||||||
import {SplashScreen} from '@capacitor/splash-screen';
|
import {SplashScreen} from '@capacitor/splash-screen';
|
||||||
import maplibregl from 'maplibre-gl';
|
import maplibregl from 'maplibre-gl';
|
||||||
import {Protocol} from 'pmtiles';
|
import {Protocol} from 'pmtiles';
|
||||||
import {MailModule} from './modules/mail/mail.module';
|
|
||||||
import {Observable, from} from 'rxjs';
|
|
||||||
|
|
||||||
registerLocaleData(localeDe);
|
registerLocaleData(localeDe);
|
||||||
|
|
||||||
@@ -130,16 +129,12 @@ export function initializerFactory(
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Injectable({providedIn: 'root'})
|
/**
|
||||||
export class ImportTranslateLoader {
|
* TODO
|
||||||
static translations: Record<string, () => Promise<{default: object}>> = {
|
* @param http TODO
|
||||||
de: () => import('../assets/i18n/de.json'),
|
*/
|
||||||
en: () => import('../assets/i18n/en.json'),
|
export function createTranslateLoader(http: HttpClient) {
|
||||||
};
|
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
|
||||||
|
|
||||||
getTranslation(lang: string): Observable<object> {
|
|
||||||
return from(ImportTranslateLoader.translations[lang]().then(it => it.default));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -170,7 +165,6 @@ export class ImportTranslateLoader {
|
|||||||
ProfilePageModule,
|
ProfilePageModule,
|
||||||
FeedbackModule,
|
FeedbackModule,
|
||||||
MapModule,
|
MapModule,
|
||||||
MailModule,
|
|
||||||
MenuModule,
|
MenuModule,
|
||||||
NavigationModule,
|
NavigationModule,
|
||||||
NewsModule,
|
NewsModule,
|
||||||
@@ -183,7 +177,7 @@ export class ImportTranslateLoader {
|
|||||||
loader: {
|
loader: {
|
||||||
deps: [HttpClient],
|
deps: [HttpClient],
|
||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
useClass: ImportTranslateLoader,
|
useFactory: createTranslateLoader,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
UtilModule,
|
UtilModule,
|
||||||
|
|||||||
@@ -12,6 +12,24 @@
|
|||||||
* 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;
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ export class AuthHelperService {
|
|||||||
user[key as keyof SCUserConfiguration] = JSONPath({
|
user[key as keyof SCUserConfiguration] = JSONPath({
|
||||||
path: this.userConfigurationMap[key as keyof SCUserConfiguration] as string,
|
path: this.userConfigurationMap[key as keyof SCUserConfiguration] as string,
|
||||||
json: userInfo,
|
json: userInfo,
|
||||||
|
preventEval: true,
|
||||||
})[0];
|
})[0];
|
||||||
}
|
}
|
||||||
if (user.givenName && user.givenName.length > 0 && user.familyName && user.familyName.length > 0) {
|
if (user.givenName && user.givenName.length > 0 && user.familyName && user.familyName.length > 0) {
|
||||||
|
|||||||
@@ -24,17 +24,13 @@ import {
|
|||||||
} from './errors';
|
} from './errors';
|
||||||
import {NGXLogger} from 'ngx-logger';
|
import {NGXLogger} from 'ngx-logger';
|
||||||
import {sampleIndexResponse} from '../../_helpers/data/sample-configuration';
|
import {sampleIndexResponse} from '../../_helpers/data/sample-configuration';
|
||||||
import {BehaviorSubject} from 'rxjs';
|
|
||||||
import {InternetConnectionService} from '../../util/internet-connection.service';
|
|
||||||
|
|
||||||
describe('ConfigProvider', () => {
|
describe('ConfigProvider', () => {
|
||||||
let internetConnectionServiceMock: {offline$: BehaviorSubject<boolean>};
|
|
||||||
let configProvider: ConfigProvider;
|
let configProvider: ConfigProvider;
|
||||||
let storageProviderSpy: jasmine.SpyObj<StorageProvider>;
|
let storageProviderSpy: jasmine.SpyObj<StorageProvider>;
|
||||||
let ngxLogger: jasmine.SpyObj<NGXLogger>;
|
let ngxLogger: jasmine.SpyObj<NGXLogger>;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
internetConnectionServiceMock = {offline$: new BehaviorSubject<boolean>(false)};
|
|
||||||
storageProviderSpy = jasmine.createSpyObj('StorageProvider', ['init', 'get', 'has', 'put']);
|
storageProviderSpy = jasmine.createSpyObj('StorageProvider', ['init', 'get', 'has', 'put']);
|
||||||
const webHttpClientMethodSpy = jasmine.createSpyObj('StAppsWebHttpClient', ['request']);
|
const webHttpClientMethodSpy = jasmine.createSpyObj('StAppsWebHttpClient', ['request']);
|
||||||
ngxLogger = jasmine.createSpyObj('NGXLogger', ['log', 'error', 'warn']);
|
ngxLogger = jasmine.createSpyObj('NGXLogger', ['log', 'error', 'warn']);
|
||||||
@@ -55,10 +51,6 @@ describe('ConfigProvider', () => {
|
|||||||
provide: NGXLogger,
|
provide: NGXLogger,
|
||||||
useValue: ngxLogger,
|
useValue: ngxLogger,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
provide: InternetConnectionService,
|
|
||||||
useValue: internetConnectionServiceMock,
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -67,8 +59,7 @@ describe('ConfigProvider', () => {
|
|||||||
|
|
||||||
it('should fetch app configuration', async () => {
|
it('should fetch app configuration', async () => {
|
||||||
spyOn(configProvider.client, 'handshake').and.returnValue(Promise.resolve(sampleIndexResponse));
|
spyOn(configProvider.client, 'handshake').and.returnValue(Promise.resolve(sampleIndexResponse));
|
||||||
await configProvider.fetch();
|
const result = await configProvider.fetch();
|
||||||
const result = configProvider.config;
|
|
||||||
expect(result).toEqual(sampleIndexResponse);
|
expect(result).toEqual(sampleIndexResponse);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -84,22 +75,6 @@ describe('ConfigProvider', () => {
|
|||||||
expect(error).toEqual(new ConfigFetchError());
|
expect(error).toEqual(new ConfigFetchError());
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should throw device offline error when offline', async () => {
|
|
||||||
// eslint-disable-next-line unicorn/error-message
|
|
||||||
let error = new Error('');
|
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
||||||
// @ts-ignore
|
|
||||||
internetConnectionServiceMock.offline$ = new BehaviorSubject<boolean>(true);
|
|
||||||
|
|
||||||
try {
|
|
||||||
await configProvider.fetch();
|
|
||||||
} catch (error_) {
|
|
||||||
error = error_ as Error;
|
|
||||||
expect(error).toBeInstanceOf(ConfigFetchError);
|
|
||||||
expect(error.message).toContain('Device is offline.');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should init from remote and saved config not available', async () => {
|
it('should init from remote and saved config not available', async () => {
|
||||||
storageProviderSpy.has.and.returnValue(Promise.resolve(false));
|
storageProviderSpy.has.and.returnValue(Promise.resolve(false));
|
||||||
spyOn(configProvider.client, 'handshake').and.returnValue(Promise.resolve(sampleIndexResponse));
|
spyOn(configProvider.client, 'handshake').and.returnValue(Promise.resolve(sampleIndexResponse));
|
||||||
@@ -111,7 +86,7 @@ describe('ConfigProvider', () => {
|
|||||||
expect(storageProviderSpy.has).toHaveBeenCalled();
|
expect(storageProviderSpy.has).toHaveBeenCalled();
|
||||||
expect(storageProviderSpy.get).toHaveBeenCalledTimes(0);
|
expect(storageProviderSpy.get).toHaveBeenCalledTimes(0);
|
||||||
expect(configProvider.client.handshake).toHaveBeenCalled();
|
expect(configProvider.client.handshake).toHaveBeenCalled();
|
||||||
expect(configProvider.getValue('name')).toEqual(sampleIndexResponse.app.name);
|
expect(await configProvider.getValue('name')).toEqual(sampleIndexResponse.app.name);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should throw error on failed initialisation', async () => {
|
it('should throw error on failed initialisation', async () => {
|
||||||
@@ -133,8 +108,6 @@ describe('ConfigProvider', () => {
|
|||||||
wrongConfig.backend.SCVersion = '0.1.0';
|
wrongConfig.backend.SCVersion = '0.1.0';
|
||||||
storageProviderSpy.get.and.returnValue(Promise.resolve(wrongConfig));
|
storageProviderSpy.get.and.returnValue(Promise.resolve(wrongConfig));
|
||||||
spyOn(configProvider.client, 'handshake').and.returnValue(Promise.resolve(sampleIndexResponse));
|
spyOn(configProvider.client, 'handshake').and.returnValue(Promise.resolve(sampleIndexResponse));
|
||||||
// sets StApps core version which has a different major version
|
|
||||||
configProvider.scVersion = '1.0.0';
|
|
||||||
await configProvider.init();
|
await configProvider.init();
|
||||||
|
|
||||||
expect(ngxLogger.warn).toHaveBeenCalledWith(
|
expect(ngxLogger.warn).toHaveBeenCalledWith(
|
||||||
@@ -142,19 +115,6 @@ describe('ConfigProvider', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should load from storage if offline and same major version stored', async () => {
|
|
||||||
internetConnectionServiceMock = {offline$: new BehaviorSubject<boolean>(true)};
|
|
||||||
storageProviderSpy.has.and.returnValue(Promise.resolve(true));
|
|
||||||
const configInStorage = structuredClone(sampleIndexResponse);
|
|
||||||
configInStorage.backend.SCVersion = '1.0.0';
|
|
||||||
storageProviderSpy.get.and.returnValue(Promise.resolve(configInStorage));
|
|
||||||
// sets StApps core version which has the same major version
|
|
||||||
configProvider.scVersion = '1.1.1';
|
|
||||||
await configProvider.init();
|
|
||||||
|
|
||||||
expect(configProvider.getAnyValue('app')).toEqual(configInStorage.app);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should throw error on saved app configuration not available', async () => {
|
it('should throw error on saved app configuration not available', async () => {
|
||||||
storageProviderSpy.has.and.returnValue(Promise.resolve(false));
|
storageProviderSpy.has.and.returnValue(Promise.resolve(false));
|
||||||
// eslint-disable-next-line unicorn/error-message
|
// eslint-disable-next-line unicorn/error-message
|
||||||
@@ -193,31 +153,4 @@ describe('ConfigProvider', () => {
|
|||||||
|
|
||||||
expect(configProvider.getValue('name')).toEqual(sampleIndexResponse.app.name);
|
expect(configProvider.getValue('name')).toEqual(sampleIndexResponse.app.name);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should fetch new config from remote on init', async () => {
|
|
||||||
storageProviderSpy.has.and.returnValue(Promise.resolve(true));
|
|
||||||
storageProviderSpy.get.and.returnValue(Promise.resolve(sampleIndexResponse));
|
|
||||||
spyOn(configProvider, 'fetch');
|
|
||||||
await configProvider.init();
|
|
||||||
|
|
||||||
expect(configProvider.fetch).toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should update the local config with the one from remote', async () => {
|
|
||||||
storageProviderSpy.has.and.returnValue(Promise.resolve(true));
|
|
||||||
storageProviderSpy.get.and.returnValue(Promise.resolve(sampleIndexResponse));
|
|
||||||
const newConfig = structuredClone(sampleIndexResponse);
|
|
||||||
newConfig.app.name = 'New app name';
|
|
||||||
spyOn(configProvider.client, 'handshake').and.returnValue(Promise.resolve(newConfig));
|
|
||||||
await configProvider.init();
|
|
||||||
|
|
||||||
// Validate that the initial configuration is loaded
|
|
||||||
expect(configProvider.getValue('name')).toEqual(sampleIndexResponse.app.name);
|
|
||||||
|
|
||||||
// Fetch the new configuration from the remote
|
|
||||||
await configProvider.fetch();
|
|
||||||
|
|
||||||
// Validate that the new configuration is now set
|
|
||||||
expect(configProvider.getValue('name')).toEqual(newConfig.app.name);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -27,8 +27,6 @@ import {
|
|||||||
SavedConfigNotAvailable,
|
SavedConfigNotAvailable,
|
||||||
WrongConfigVersionInStorage,
|
WrongConfigVersionInStorage,
|
||||||
} from './errors';
|
} from './errors';
|
||||||
import {InternetConnectionService} from '../../util/internet-connection.service';
|
|
||||||
import {firstValueFrom} from 'rxjs';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Key to store config in storage module
|
* Key to store config in storage module
|
||||||
@@ -74,7 +72,6 @@ export class ConfigProvider {
|
|||||||
private readonly storageProvider: StorageProvider,
|
private readonly storageProvider: StorageProvider,
|
||||||
swHttpClient: StAppsWebHttpClient,
|
swHttpClient: StAppsWebHttpClient,
|
||||||
private readonly logger: NGXLogger,
|
private readonly logger: NGXLogger,
|
||||||
private readonly internetConnectionService: InternetConnectionService,
|
|
||||||
) {
|
) {
|
||||||
console.log('config init');
|
console.log('config init');
|
||||||
this.client = new Client(swHttpClient, environment.backend_url, environment.backend_version);
|
this.client = new Client(swHttpClient, environment.backend_url, environment.backend_version);
|
||||||
@@ -83,20 +80,11 @@ export class ConfigProvider {
|
|||||||
/**
|
/**
|
||||||
* Fetches configuration from backend
|
* Fetches configuration from backend
|
||||||
*/
|
*/
|
||||||
async fetch(): Promise<void> {
|
async fetch(): Promise<SCIndexResponse> {
|
||||||
try {
|
try {
|
||||||
const isOffline = await firstValueFrom(this.internetConnectionService.offline$);
|
return await this.client.handshake(this.scVersion);
|
||||||
if (isOffline) {
|
} catch {
|
||||||
throw new Error('Device is offline.');
|
throw new ConfigFetchError();
|
||||||
} else {
|
|
||||||
const fetchedConfig: SCIndexResponse = await this.client.handshake(this.scVersion);
|
|
||||||
await this.set(fetchedConfig);
|
|
||||||
this.logger.log(`Configuration updated from remote`);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
const error_ = error instanceof Error ? new ConfigFetchError(error.message) : new ConfigFetchError();
|
|
||||||
this.logger.warn(`Failed to fetch remote configuration:`, error_);
|
|
||||||
throw error_; // Rethrow the error to handle it in init()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,33 +112,40 @@ export class ConfigProvider {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialises the ConfigProvider
|
* Initialises the ConfigProvider
|
||||||
* @throws ConfigInitError if no configuration could be loaded both locally and remote.
|
* @throws ConfigInitError if no configuration could be loaded.
|
||||||
|
* @throws WrongConfigVersionInStorage if fetch failed and saved config has wrong SCVersion
|
||||||
*/
|
*/
|
||||||
async init(): Promise<void> {
|
async init(): Promise<void> {
|
||||||
|
let loadError;
|
||||||
|
let fetchError;
|
||||||
|
// load saved configuration
|
||||||
try {
|
try {
|
||||||
// Attempt to load the configuration from local storage
|
|
||||||
this.config = await this.loadLocal();
|
this.config = await this.loadLocal();
|
||||||
this.firstSession = false;
|
this.firstSession = false;
|
||||||
this.logger.log(`initialised configuration from storage`);
|
this.logger.log(`initialised configuration from storage`);
|
||||||
|
if (this.config.backend.SCVersion !== this.scVersion) {
|
||||||
// Check if the stored configuration has the correct version
|
loadError = new WrongConfigVersionInStorage(this.scVersion, this.config.backend.SCVersion);
|
||||||
if (this.config.backend.SCVersion.split('.')[0] !== this.scVersion.split('.')[0]) {
|
|
||||||
throw new WrongConfigVersionInStorage(this.scVersion, this.config.backend.SCVersion);
|
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
// Fetch the remote configuration in a non-blocking manner
|
loadError = error;
|
||||||
void this.fetch();
|
}
|
||||||
} catch (loadError) {
|
// fetch remote configuration from backend
|
||||||
this.logger.warn(loadError);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// If local loading fails, immediately try to fetch the configuration from remote
|
const fetchedConfig: SCIndexResponse = await this.fetch();
|
||||||
await this.fetch();
|
await this.set(fetchedConfig);
|
||||||
} catch (fetchError) {
|
this.logger.log(`initialised configuration from remote`);
|
||||||
this.logger.warn(`Failed to fetch remote configuration:`, fetchError);
|
} catch (error) {
|
||||||
// If both local loading and remote fetching fail, throw ConfigInitError
|
fetchError = error;
|
||||||
|
}
|
||||||
|
// check for occurred errors and throw them
|
||||||
|
if (loadError !== undefined && fetchError !== undefined) {
|
||||||
throw new ConfigInitError();
|
throw new ConfigInitError();
|
||||||
}
|
}
|
||||||
|
if (loadError !== undefined) {
|
||||||
|
this.logger.warn(loadError);
|
||||||
|
}
|
||||||
|
if (fetchError !== undefined) {
|
||||||
|
this.logger.warn(fetchError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,10 +19,8 @@ import {AppError} from '../../_helpers/errors';
|
|||||||
* Error that is thrown when fetching from backend fails
|
* Error that is thrown when fetching from backend fails
|
||||||
*/
|
*/
|
||||||
export class ConfigFetchError extends AppError {
|
export class ConfigFetchError extends AppError {
|
||||||
constructor(reason?: string) {
|
constructor() {
|
||||||
const defaultMessage = 'App configuration could not be fetched!';
|
super('ConfigFetchError', 'App configuration could not be fetched!');
|
||||||
const message = reason ? `${defaultMessage} ${reason}` : defaultMessage;
|
|
||||||
super('ConfigFetchError', message);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,9 +33,9 @@ ion-item {
|
|||||||
margin: var(--spacing-sm);
|
margin: var(--spacing-sm);
|
||||||
|
|
||||||
ion-thumbnail {
|
ion-thumbnail {
|
||||||
--size: 36px;
|
--ion-margin: var(--spacing-xs);
|
||||||
|
|
||||||
margin: 0;
|
margin-block: auto;
|
||||||
margin-inline: var(--spacing-md);
|
margin-inline: var(--spacing-md);
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,12 +80,13 @@
|
|||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<ion-checkbox
|
<ion-checkbox
|
||||||
|
class="ion-text-wrap"
|
||||||
color="primary"
|
color="primary"
|
||||||
label-placement="end"
|
label-placement="end"
|
||||||
justify="start"
|
justify="start"
|
||||||
[(ngModel)]="termsAgree"
|
[(ngModel)]="termsAgree"
|
||||||
name="termsAgree"
|
name="termsAgree"
|
||||||
><span class="ion-text-wrap">{{ 'feedback.form.termsAgree.0' | translate }}</span></ion-checkbox
|
>{{ 'feedback.form.termsAgree.0' | translate }}</ion-checkbox
|
||||||
>
|
>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item lines="none">
|
<ion-item lines="none">
|
||||||
@@ -103,9 +104,7 @@
|
|||||||
justify="start"
|
justify="start"
|
||||||
[(ngModel)]="protocolDataAgree"
|
[(ngModel)]="protocolDataAgree"
|
||||||
name="protocolDataAgree"
|
name="protocolDataAgree"
|
||||||
><span class="ion-text-wrap">{{
|
>{{ 'feedback.form.protocolDataAgree' | translate }}</ion-checkbox
|
||||||
'feedback.form.protocolDataAgree' | translate
|
|
||||||
}}</span></ion-checkbox
|
|
||||||
>
|
>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-card>
|
<ion-card>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export class LibraryAccountPageComponent {
|
|||||||
constructor(private readonly libraryAccountService: LibraryAccountService) {}
|
constructor(private readonly libraryAccountService: LibraryAccountService) {}
|
||||||
|
|
||||||
async ionViewWillEnter(): Promise<void> {
|
async ionViewWillEnter(): Promise<void> {
|
||||||
const patron = await this.libraryAccountService.getPatron();
|
const patron = await this.libraryAccountService.getProfile();
|
||||||
this.name = patron?.name;
|
this.name = patron?.name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,8 +39,6 @@ export class CheckedOutPageComponent {
|
|||||||
|
|
||||||
async fetchItems() {
|
async fetchItems() {
|
||||||
try {
|
try {
|
||||||
// Prepare patron (status) for the items
|
|
||||||
await this.libraryAccountService.getPatron();
|
|
||||||
this.checkedOutItems = undefined;
|
this.checkedOutItems = undefined;
|
||||||
this.checkedOutItems = await this.libraryAccountService.getFilteredItems([PAIADocumentStatus.Held]);
|
this.checkedOutItems = await this.libraryAccountService.getFilteredItems([PAIADocumentStatus.Held]);
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
@for (checkedOutItem of checkedOutItems; track checkedOutItem) {
|
@for (checkedOutItem of checkedOutItems; track checkedOutItem) {
|
||||||
<stapps-paia-item
|
<stapps-paia-item
|
||||||
[item]="checkedOutItem"
|
[item]="checkedOutItem"
|
||||||
[propertiesToShow]="['label', 'renewals', 'duedate']"
|
[propertiesToShow]="['label', 'renewals', 'endtime']"
|
||||||
(documentAction)="onDocumentAction($event)"
|
(documentAction)="onDocumentAction($event)"
|
||||||
listName="checked_out"
|
listName="checked_out"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -14,8 +14,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {Component, EventEmitter, Input, Output} from '@angular/core';
|
import {Component, EventEmitter, Input, Output} from '@angular/core';
|
||||||
import {DocumentAction, PAIADocument, PAIADocumentStatus, PAIADocumentVisualStatus} from '../../../types';
|
import {DocumentAction, PAIADocument} from '../../../types';
|
||||||
import {LibraryAccountService} from '../../library-account.service';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'stapps-paia-item',
|
selector: 'stapps-paia-item',
|
||||||
@@ -23,24 +22,7 @@ import {LibraryAccountService} from '../../library-account.service';
|
|||||||
styleUrls: ['./paiaitem.scss'],
|
styleUrls: ['./paiaitem.scss'],
|
||||||
})
|
})
|
||||||
export class PAIAItemComponent {
|
export class PAIAItemComponent {
|
||||||
private _item: PAIADocument;
|
@Input() item: PAIADocument;
|
||||||
|
|
||||||
renewable: boolean;
|
|
||||||
|
|
||||||
visualStatus?: PAIADocumentVisualStatus;
|
|
||||||
|
|
||||||
constructor(private readonly libraryAccountService: LibraryAccountService) {}
|
|
||||||
|
|
||||||
@Input()
|
|
||||||
set item(value: PAIADocument) {
|
|
||||||
this._item = value;
|
|
||||||
void this.setRenewable();
|
|
||||||
this.visualStatus = this.getVisualStatus(Number(this.item.status));
|
|
||||||
}
|
|
||||||
|
|
||||||
get item(): PAIADocument {
|
|
||||||
return this._item;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
propertiesToShow: (keyof PAIADocument)[];
|
propertiesToShow: (keyof PAIADocument)[];
|
||||||
@@ -54,23 +36,4 @@ export class PAIAItemComponent {
|
|||||||
async onClick(action: DocumentAction['action']) {
|
async onClick(action: DocumentAction['action']) {
|
||||||
this.documentAction.emit({doc: this.item, action});
|
this.documentAction.emit({doc: this.item, action});
|
||||||
}
|
}
|
||||||
|
|
||||||
private async setRenewable() {
|
|
||||||
const isActive = await this.libraryAccountService.isActivePatron();
|
|
||||||
this.renewable = isActive && Number(this.item.status) === PAIADocumentStatus.Held;
|
|
||||||
}
|
|
||||||
|
|
||||||
private getVisualStatus(status: PAIADocumentStatus): PAIADocumentVisualStatus | undefined {
|
|
||||||
switch (status) {
|
|
||||||
case PAIADocumentStatus.Ordered: {
|
|
||||||
return {color: 'warning', status: status, statusText: 'ordered'};
|
|
||||||
}
|
|
||||||
case PAIADocumentStatus.Provided: {
|
|
||||||
return {color: 'success', status: status, statusText: 'ready'};
|
|
||||||
}
|
|
||||||
default: {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,22 +14,16 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<ion-item>
|
<ion-item>
|
||||||
|
<!-- TODO: text not selectable in Chrome, bugfix needed https://github.com/ionic-team/ionic-framework/issues/24956 -->
|
||||||
<ion-label class="ion-text-wrap">
|
<ion-label class="ion-text-wrap">
|
||||||
@if (item.about) {
|
@if (item.about) {
|
||||||
<h2 class="name">
|
<h2 class="name">{{ item.about }}</h2>
|
||||||
@if (visualStatus) {
|
|
||||||
<ion-badge [color]="visualStatus.color" slot="start">
|
|
||||||
{{ 'library.account.pages' + '.' + listName + '.' + visualStatus.statusText | translate }}
|
|
||||||
</ion-badge>
|
|
||||||
}
|
|
||||||
{{ item.about }}
|
|
||||||
</h2>
|
|
||||||
}
|
}
|
||||||
@for (property of propertiesToShow; track property) {
|
@for (property of propertiesToShow; track property) {
|
||||||
@if (item[property]) {
|
@if (item[property]) {
|
||||||
<p>
|
<p>
|
||||||
{{ 'library.account.pages' + '.' + listName + '.' + 'labels' + '.' + property | translate }}:
|
{{ 'library.account.pages' + '.' + listName + '.' + 'labels' + '.' + property | translate }}:
|
||||||
@if (!['starttime', 'duedate'].includes(property)) {
|
@if (!['endtime', 'duedate'].includes(property)) {
|
||||||
{{ item[property] }}
|
{{ item[property] }}
|
||||||
} @else {
|
} @else {
|
||||||
{{ $any(item[property]) | amDateFormat: 'll' }}
|
{{ $any(item[property]) | amDateFormat: 'll' }}
|
||||||
@@ -46,7 +40,7 @@
|
|||||||
<!-- >-->
|
<!-- >-->
|
||||||
<!-- {{ 'library.account.actions.cancel.header' | translate }}</ion-button-->
|
<!-- {{ 'library.account.actions.cancel.header' | translate }}</ion-button-->
|
||||||
<!-- >-->
|
<!-- >-->
|
||||||
@if (renewable && item.canrenew) {
|
@if (item.canrenew) {
|
||||||
<ion-button color="primary" (click)="onClick('renew')">
|
<ion-button color="primary" (click)="onClick('renew')">
|
||||||
{{ 'library.account.actions.renew.header' | translate }}</ion-button
|
{{ 'library.account.actions.renew.header' | translate }}</ion-button
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -12,6 +12,3 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
ion-badge {
|
|
||||||
vertical-align: bottom;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -45,8 +45,6 @@ export class HoldsPageComponent {
|
|||||||
? [PAIADocumentStatus.Reserved]
|
? [PAIADocumentStatus.Reserved]
|
||||||
: [PAIADocumentStatus.Ordered, PAIADocumentStatus.Provided];
|
: [PAIADocumentStatus.Ordered, PAIADocumentStatus.Provided];
|
||||||
try {
|
try {
|
||||||
// Prepare patron (status) for the items
|
|
||||||
await this.libraryAccountService.getPatron();
|
|
||||||
this.paiaDocuments = await this.libraryAccountService.getFilteredItems(itemsStatus);
|
this.paiaDocuments = await this.libraryAccountService.getFilteredItems(itemsStatus);
|
||||||
} catch {
|
} catch {
|
||||||
await this.libraryAccountService.handleError();
|
await this.libraryAccountService.handleError();
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
@switch (activeSegment) {
|
@switch (activeSegment) {
|
||||||
@case ('orders') {
|
@case ('orders') {
|
||||||
@for (hold of paiaDocuments; track hold) {
|
@for (hold of paiaDocuments; track hold) {
|
||||||
|
@if (toNumber(hold.status) === paiaDocumentStatus.Provided) {
|
||||||
<stapps-paia-item
|
<stapps-paia-item
|
||||||
[item]="hold"
|
[item]="hold"
|
||||||
[propertiesToShow]="['label', 'storage']"
|
[propertiesToShow]="['label', 'storage']"
|
||||||
@@ -42,13 +43,22 @@
|
|||||||
listName="holds"
|
listName="holds"
|
||||||
>
|
>
|
||||||
</stapps-paia-item>
|
</stapps-paia-item>
|
||||||
|
} @else {
|
||||||
|
<stapps-paia-item
|
||||||
|
[item]="hold"
|
||||||
|
[propertiesToShow]="['label']"
|
||||||
|
(documentAction)="onDocumentAction($event)"
|
||||||
|
listName="holds"
|
||||||
|
>
|
||||||
|
</stapps-paia-item>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@case ('reservations') {
|
@case ('reservations') {
|
||||||
@for (hold of paiaDocuments; track hold) {
|
@for (hold of paiaDocuments; track hold) {
|
||||||
<stapps-paia-item
|
<stapps-paia-item
|
||||||
[item]="hold"
|
[item]="hold"
|
||||||
[propertiesToShow]="['label', 'starttime', 'storage', 'queue']"
|
[propertiesToShow]="['label']"
|
||||||
(documentAction)="onDocumentAction($event)"
|
(documentAction)="onDocumentAction($event)"
|
||||||
listName="holds"
|
listName="holds"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -20,15 +20,7 @@ import {
|
|||||||
SCFeatureConfiguration,
|
SCFeatureConfiguration,
|
||||||
SCFeatureConfigurationExtern,
|
SCFeatureConfigurationExtern,
|
||||||
} from '@openstapps/core';
|
} from '@openstapps/core';
|
||||||
import {
|
import {DocumentAction, PAIADocument, PAIADocumentStatus, PAIAFees, PAIAItems, PAIAPatron} from '../types';
|
||||||
DocumentAction,
|
|
||||||
PAIADocument,
|
|
||||||
PAIADocumentStatus,
|
|
||||||
PAIAFees,
|
|
||||||
PAIAItems,
|
|
||||||
PAIAPatron,
|
|
||||||
PAIAPatronStatus,
|
|
||||||
} from '../types';
|
|
||||||
import {HebisDataProvider} from '../../hebis/hebis-data.provider';
|
import {HebisDataProvider} from '../../hebis/hebis-data.provider';
|
||||||
import {PAIATokenResponse} from '../../auth/paia/paia-token-response';
|
import {PAIATokenResponse} from '../../auth/paia/paia-token-response';
|
||||||
import {AuthHelperService} from '../../auth/auth-helper.service';
|
import {AuthHelperService} from '../../auth/auth-helper.service';
|
||||||
@@ -51,11 +43,6 @@ export class LibraryAccountService {
|
|||||||
*/
|
*/
|
||||||
authType: SCAuthorizationProviderType;
|
authType: SCAuthorizationProviderType;
|
||||||
|
|
||||||
/**
|
|
||||||
* Account (Patron) status
|
|
||||||
*/
|
|
||||||
private status?: PAIAPatronStatus;
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected requestor: Requestor = new JQueryRequestor(),
|
protected requestor: Requestor = new JQueryRequestor(),
|
||||||
private readonly hebisDataProvider: HebisDataProvider,
|
private readonly hebisDataProvider: HebisDataProvider,
|
||||||
@@ -73,23 +60,12 @@ export class LibraryAccountService {
|
|||||||
this.authType = config.authProvider as SCAuthorizationProviderType;
|
this.authType = config.authProvider as SCAuthorizationProviderType;
|
||||||
}
|
}
|
||||||
|
|
||||||
async getPatron() {
|
async getProfile() {
|
||||||
const patronId = ((await this.getValidToken()) as PAIATokenResponse).patron;
|
const patron = ((await this.getValidToken()) as PAIATokenResponse).patron;
|
||||||
const patron = {
|
return {
|
||||||
...(await this.performRequest<PAIAPatron>(`${this.baseUrl}/{patron}`)),
|
...(await this.performRequest<PAIAPatron>(`${this.baseUrl}/{patron}`)),
|
||||||
id: patronId,
|
id: patron,
|
||||||
} as PAIAPatron;
|
} as PAIAPatron;
|
||||||
// Refresh the status
|
|
||||||
this.status = Number(patron.status);
|
|
||||||
return patron;
|
|
||||||
}
|
|
||||||
|
|
||||||
async getPatronStatus() {
|
|
||||||
return this.status ?? (this.status = Number((await this.getPatron()).status) as PAIAPatronStatus);
|
|
||||||
}
|
|
||||||
|
|
||||||
async isActivePatron() {
|
|
||||||
return (await this.getPatronStatus()) === PAIAPatronStatus.Active;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async getItems() {
|
async getItems() {
|
||||||
|
|||||||
@@ -25,17 +25,15 @@ import {PAIAPatron} from '../../types';
|
|||||||
export class ProfilePageComponent {
|
export class ProfilePageComponent {
|
||||||
patron?: PAIAPatron;
|
patron?: PAIAPatron;
|
||||||
|
|
||||||
|
propertiesToShow: (keyof PAIAPatron)[] = ['id', 'name', 'email', 'address', 'expires', 'note'];
|
||||||
|
|
||||||
constructor(private readonly libraryAccountService: LibraryAccountService) {}
|
constructor(private readonly libraryAccountService: LibraryAccountService) {}
|
||||||
|
|
||||||
async ionViewWillEnter(): Promise<void> {
|
async ionViewWillEnter(): Promise<void> {
|
||||||
try {
|
try {
|
||||||
this.patron = await this.libraryAccountService.getPatron();
|
this.patron = await this.libraryAccountService.getProfile();
|
||||||
} catch {
|
} catch {
|
||||||
await this.libraryAccountService.handleError();
|
await this.libraryAccountService.handleError();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
isUnlimitedExpiry(date = ''): boolean {
|
|
||||||
return new Date(date).getFullYear() === 9999;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,46 +26,28 @@
|
|||||||
<ion-card>
|
<ion-card>
|
||||||
<ion-card-content>
|
<ion-card-content>
|
||||||
<ion-grid>
|
<ion-grid>
|
||||||
|
@for (property of propertiesToShow; track property) {
|
||||||
|
@if (patron[property]) {
|
||||||
<ion-row>
|
<ion-row>
|
||||||
<ion-col> {{ 'library.account.pages.profile.labels.id' | translate }}: </ion-col>
|
|
||||||
<ion-col>
|
<ion-col>
|
||||||
{{ patron.id }}
|
{{ 'library.account.pages.profile.labels' + '.' + property | translate }}:
|
||||||
</ion-col>
|
</ion-col>
|
||||||
</ion-row>
|
|
||||||
<ion-row>
|
|
||||||
<ion-col> {{ 'library.account.pages.profile.labels.name' | translate }}: </ion-col>
|
|
||||||
<ion-col> {{ patron.name_details?.title ?? '' }} {{ patron.name }} </ion-col>
|
|
||||||
</ion-row>
|
|
||||||
@if (patron.email) {
|
|
||||||
<ion-row>
|
|
||||||
<ion-col> {{ 'library.account.pages.profile.labels.email' | translate }}: </ion-col>
|
|
||||||
<ion-col>
|
<ion-col>
|
||||||
{{ patron.email }}
|
@if (!['expires'].includes(property)) {
|
||||||
</ion-col>
|
{{ patron[property] }}
|
||||||
</ion-row>
|
} @else {
|
||||||
}
|
@if (patron[property] === '9999-12-31') {
|
||||||
@if (patron.address) {
|
|
||||||
<ion-row>
|
|
||||||
<ion-col> {{ 'library.account.pages.profile.labels.address' | translate }}: </ion-col>
|
|
||||||
<ion-col>
|
|
||||||
{{ patron.address }}
|
|
||||||
</ion-col>
|
|
||||||
</ion-row>
|
|
||||||
}
|
|
||||||
@if (patron.expires) {
|
|
||||||
<ion-row>
|
|
||||||
<ion-col> {{ 'library.account.pages.profile.labels.expires' | translate }}: </ion-col>
|
|
||||||
<ion-col>
|
|
||||||
@if (isUnlimitedExpiry(patron.expires)) {
|
|
||||||
{{ 'library.account.pages.profile.values.unlimited' | translate }}
|
{{ 'library.account.pages.profile.values.unlimited' | translate }}
|
||||||
} @else {
|
} @else {
|
||||||
{{ 'library.account.pages.profile.values.expires' | translate }}: {{
|
{{ 'library.account.pages.profile.values.expires' | translate }}: {{
|
||||||
patron.expires | amDateFormat: 'll'
|
patron[property] | amDateFormat: 'll'
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</ion-col>
|
</ion-col>
|
||||||
</ion-row>
|
</ion-row>
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</ion-grid>
|
</ion-grid>
|
||||||
</ion-card-content>
|
</ion-card-content>
|
||||||
</ion-card>
|
</ion-card>
|
||||||
|
|||||||
@@ -19,24 +19,9 @@ export interface PAIAPatron {
|
|||||||
email?: string;
|
email?: string;
|
||||||
address?: string;
|
address?: string;
|
||||||
expires?: string;
|
expires?: string;
|
||||||
status?: PAIAPatronStatus;
|
status?: string;
|
||||||
type?: string;
|
type?: string;
|
||||||
note?: string;
|
note?: string;
|
||||||
// HeBIS specific property (not in PAIA documentation)
|
|
||||||
name_details?: {
|
|
||||||
firstname?: string;
|
|
||||||
lastname?: string;
|
|
||||||
gender?: string;
|
|
||||||
title?: string;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum PAIAPatronStatus {
|
|
||||||
Active = 0,
|
|
||||||
Inactive = 1,
|
|
||||||
InactiveExpired = 2,
|
|
||||||
InactiveOutstandingFees = 3,
|
|
||||||
InactiveExpiredOutstandingFees = 4,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -54,7 +39,7 @@ export interface PAIADocument {
|
|||||||
queue?: string;
|
queue?: string;
|
||||||
renewals?: string;
|
renewals?: string;
|
||||||
reminder?: string;
|
reminder?: string;
|
||||||
starttime?: string;
|
endtime?: string;
|
||||||
duedate?: string;
|
duedate?: string;
|
||||||
cancancel?: boolean;
|
cancancel?: boolean;
|
||||||
canrenew?: boolean;
|
canrenew?: boolean;
|
||||||
@@ -95,9 +80,3 @@ export interface DocumentAction {
|
|||||||
action: 'cancel' | 'renew';
|
action: 'cancel' | 'renew';
|
||||||
doc: PAIADocument;
|
doc: PAIADocument;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PAIADocumentVisualStatus {
|
|
||||||
color: 'warning' | 'success';
|
|
||||||
status: PAIADocumentStatus;
|
|
||||||
statusText: 'ordered' | 'ready';
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,237 +0,0 @@
|
|||||||
import {HttpClient} from '@angular/common/http';
|
|
||||||
import {Injectable, inject} from '@angular/core';
|
|
||||||
import {Observable, map, catchError, tap, mergeMap, forkJoin, of} from 'rxjs';
|
|
||||||
import {Email, MailboxTreeRoot, RawEmail, RawEmailBodyStructure, Signature, SignedValue} from './schema';
|
|
||||||
import {ContentInfo, SignedData} from 'pkijs';
|
|
||||||
import PostalMime from 'postal-mime';
|
|
||||||
import {z} from 'zod';
|
|
||||||
|
|
||||||
function value(value: undefined): undefined;
|
|
||||||
function value<T>(value: T): SignedValue<T>;
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
function value<T>(value: T | undefined): SignedValue<T> | undefined {
|
|
||||||
return value === undefined ? undefined : {value};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Injectable({providedIn: 'root'})
|
|
||||||
export class MailAdapterService {
|
|
||||||
httpClient = inject(HttpClient);
|
|
||||||
|
|
||||||
request<T>(options: {
|
|
||||||
method?: string;
|
|
||||||
path?: string[];
|
|
||||||
options?: Record<string, string>;
|
|
||||||
responseType?: 'json' | 'arraybuffer';
|
|
||||||
credentials?: string;
|
|
||||||
}): Observable<T> {
|
|
||||||
return this.httpClient.request<T>(
|
|
||||||
options.method ?? 'GET',
|
|
||||||
`http://localhost:4000/${options.path?.map(encodeURIComponent).join('/') ?? ''}${
|
|
||||||
options.options
|
|
||||||
? `?${Object.entries(options.options).map(item => item.map(encodeURIComponent).join('='))}`
|
|
||||||
: ''
|
|
||||||
}`,
|
|
||||||
{
|
|
||||||
responseType: options.responseType as 'json',
|
|
||||||
headers: options.credentials ? {authorization: `Basic ${options.credentials}`} : undefined,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
checkCredentials(credentials: string): Observable<boolean> {
|
|
||||||
return this.request<unknown>({
|
|
||||||
path: [],
|
|
||||||
options: {},
|
|
||||||
responseType: 'json',
|
|
||||||
credentials,
|
|
||||||
}).pipe(
|
|
||||||
map(() => true),
|
|
||||||
catchError(error => {
|
|
||||||
if (error.status === 401) {
|
|
||||||
return of(false);
|
|
||||||
} else {
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
listMailboxes(credentials: string): Observable<MailboxTreeRoot> {
|
|
||||||
return this.request<string[]>({credentials}).pipe(mergeMap(it => MailboxTreeRoot.parseAsync(it)));
|
|
||||||
}
|
|
||||||
|
|
||||||
listRawEmails(credentials: string, mailbox: string, since?: string): Observable<string[]> {
|
|
||||||
return this.request<unknown>({
|
|
||||||
credentials,
|
|
||||||
path: [mailbox],
|
|
||||||
options: since === undefined ? undefined : {since},
|
|
||||||
}).pipe(
|
|
||||||
mergeMap(it => z.array(z.string()).parseAsync(it)),
|
|
||||||
tap(console.log),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private getRawEmail(credentials: string, mailbox: string, id: string): Observable<RawEmail> {
|
|
||||||
return this.request<unknown>({
|
|
||||||
credentials,
|
|
||||||
path: [mailbox, id],
|
|
||||||
options: {raw: 'true'},
|
|
||||||
}).pipe(mergeMap(it => RawEmail.parseAsync(it)));
|
|
||||||
}
|
|
||||||
|
|
||||||
private getPart(credentials: string, mailbox: string, id: string, part: string): Observable<ArrayBuffer> {
|
|
||||||
return this.request<ArrayBuffer>({path: [mailbox, id, part], credentials, responseType: 'arraybuffer'});
|
|
||||||
}
|
|
||||||
|
|
||||||
private getRawPart(
|
|
||||||
credentials: string,
|
|
||||||
mailbox: string,
|
|
||||||
id: string,
|
|
||||||
part: string,
|
|
||||||
): Observable<ArrayBuffer> {
|
|
||||||
return this.request({
|
|
||||||
path: [mailbox, id, part],
|
|
||||||
options: {raw: 'true'},
|
|
||||||
responseType: 'arraybuffer',
|
|
||||||
credentials,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private resolveRawEmail(credentials: string, mailbox: string, email: RawEmail): Observable<Email> {
|
|
||||||
console.log(email);
|
|
||||||
|
|
||||||
if (
|
|
||||||
email.bodyStructure.type === 'application/x-pkcs7-mime' ||
|
|
||||||
email.bodyStructure.type === 'application/pkcs7-mime'
|
|
||||||
) {
|
|
||||||
return this.getRawPart(credentials, mailbox, email.seq, email.bodyStructure.part ?? 'TEXT').pipe(
|
|
||||||
mergeMap(async buffer => {
|
|
||||||
const info = ContentInfo.fromBER(buffer);
|
|
||||||
const signedData = new SignedData({schema: info.content});
|
|
||||||
const valid = await signedData
|
|
||||||
.verify({signer: 0, data: signedData.encapContentInfo.eContent?.valueBeforeDecodeView})
|
|
||||||
.catch(() => false);
|
|
||||||
const content = new TextDecoder().decode(
|
|
||||||
signedData.encapContentInfo.eContent?.valueBeforeDecodeView,
|
|
||||||
);
|
|
||||||
const signedEmail = await PostalMime.parse(content);
|
|
||||||
|
|
||||||
function signed(value: undefined): undefined;
|
|
||||||
function signed<T>(value: T): SignedValue<T>;
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
function signed<T>(value: T | undefined): SignedValue<T> | undefined {
|
|
||||||
return value === undefined
|
|
||||||
? undefined
|
|
||||||
: {
|
|
||||||
value,
|
|
||||||
signature: {
|
|
||||||
type: 'pkcs7',
|
|
||||||
valid,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const result: Email = {
|
|
||||||
id: email.seq,
|
|
||||||
mailbox,
|
|
||||||
subject: signedEmail.subject ? signed(signedEmail.subject) : value(email.envelope.subject),
|
|
||||||
flags: new Set<string>(), //TODO
|
|
||||||
from: signed({
|
|
||||||
name: signedEmail.from.name || undefined,
|
|
||||||
address: signedEmail.from.address || undefined,
|
|
||||||
}),
|
|
||||||
to: signedEmail.to?.map(({name, address}) =>
|
|
||||||
signed({
|
|
||||||
name,
|
|
||||||
address,
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
date: signedEmail.date ? signed(new Date(signedEmail.date)) : value(email.envelope.date),
|
|
||||||
html: signedEmail.html ? signed(signedEmail.html) : undefined,
|
|
||||||
text: signedEmail.text ? signed(signedEmail.text) : undefined,
|
|
||||||
attachments: [],
|
|
||||||
};
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const traverse = (
|
|
||||||
item: RawEmailBodyStructure,
|
|
||||||
result: Pick<Email, 'attachments' | 'text' | 'html'>,
|
|
||||||
signature?: Signature,
|
|
||||||
): Observable<Pick<Email, 'attachments' | 'text' | 'html'>> => {
|
|
||||||
// https://datatracker.ietf.org/doc/html/rfc1847#section-2.1
|
|
||||||
if (item.type === 'multipart/signed' && item.parameters?.protocol === 'application/pkcs7-signature') {
|
|
||||||
return forkJoin({
|
|
||||||
data: this.getPart(credentials, mailbox, email.seq, item.childNodes![0].part!),
|
|
||||||
signature: this.getRawPart(credentials, mailbox, email.seq, item.childNodes![1].part!),
|
|
||||||
}).pipe(
|
|
||||||
mergeMap(({data, signature}) => {
|
|
||||||
const info = ContentInfo.fromBER(signature);
|
|
||||||
const signedData = new SignedData({schema: info.content});
|
|
||||||
return signedData.verify({signer: 0, data});
|
|
||||||
}),
|
|
||||||
catchError(error => {
|
|
||||||
console.log(error);
|
|
||||||
return of(false);
|
|
||||||
}),
|
|
||||||
mergeMap(valid => traverse(item.childNodes![0], result, {type: 'pkcs7', valid})),
|
|
||||||
);
|
|
||||||
} else if (item.type.startsWith('multipart/')) {
|
|
||||||
return forkJoin(item.childNodes!.map(child => traverse(child, result, signature))).pipe(
|
|
||||||
map(children => children[0]),
|
|
||||||
);
|
|
||||||
} else if (item.type === 'text/plain') {
|
|
||||||
return this.getPart(credentials, mailbox, email.seq, item.part ?? 'TEXT').pipe(
|
|
||||||
map(text => {
|
|
||||||
result.html = {value: new TextDecoder().decode(text), signature};
|
|
||||||
return result;
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
} else if (item.type === 'text/html') {
|
|
||||||
return this.getPart(credentials, mailbox, email.seq, item.part ?? 'TEXT').pipe(
|
|
||||||
map(html => {
|
|
||||||
result.html = {value: new TextDecoder().decode(html), signature};
|
|
||||||
return result;
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
} else if (item.part === undefined) {
|
|
||||||
return of(result);
|
|
||||||
} else {
|
|
||||||
result.attachments.push({value: {part: item.part, size: item.size ?? Number.NaN, filename: ''}});
|
|
||||||
return of(result);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return traverse(email.bodyStructure, {attachments: []}).pipe(
|
|
||||||
map(
|
|
||||||
partial =>
|
|
||||||
({
|
|
||||||
...partial,
|
|
||||||
id: email.seq,
|
|
||||||
mailbox,
|
|
||||||
flags: new Set<string>(email.flags),
|
|
||||||
subject: value(email.envelope.subject),
|
|
||||||
from: value({
|
|
||||||
name: email.envelope.from[0]?.name || undefined,
|
|
||||||
address: email.envelope.from[0]?.address || undefined,
|
|
||||||
}),
|
|
||||||
date: value(email.envelope.date),
|
|
||||||
}) satisfies Email,
|
|
||||||
),
|
|
||||||
tap(console.log),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
getEmail(credentials: string, mailbox: string, id: string): Observable<Email> {
|
|
||||||
return this.getRawEmail(credentials, mailbox, id).pipe(
|
|
||||||
mergeMap(it => this.resolveRawEmail(credentials, mailbox, it)),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
import {ChangeDetectionStrategy, Component, inject, signal} from '@angular/core';
|
|
||||||
import {AsyncPipe, TitleCasePipe} from '@angular/common';
|
|
||||||
import {IonicModule} from '@ionic/angular';
|
|
||||||
import {DataModule} from '../data/data.module';
|
|
||||||
import {IonIconModule} from 'src/app/util/ion-icon/ion-icon.module';
|
|
||||||
import {UtilModule} from 'src/app/util/util.module';
|
|
||||||
import {FormatPurePipeModule, ParseIsoPipeModule} from 'ngx-date-fns';
|
|
||||||
import {ActivatedRoute, RouterModule} from '@angular/router';
|
|
||||||
import {map, mergeMap} from 'rxjs';
|
|
||||||
import {DomSanitizer} from '@angular/platform-browser';
|
|
||||||
import {materialFade} from 'src/app/animation/material-motion';
|
|
||||||
import {TranslateModule} from '@ngx-translate/core';
|
|
||||||
import {ShadowHtmlDirective} from 'src/app/util/shadow-html.directive';
|
|
||||||
import {MailStorageProvider} from './mail-storage.provider';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'stapps-mail-detail',
|
|
||||||
templateUrl: 'mail-detail.html',
|
|
||||||
styleUrl: 'mail-detail.scss',
|
|
||||||
animations: [materialFade],
|
|
||||||
standalone: true,
|
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
||||||
imports: [
|
|
||||||
AsyncPipe,
|
|
||||||
IonicModule,
|
|
||||||
DataModule,
|
|
||||||
IonIconModule,
|
|
||||||
UtilModule,
|
|
||||||
FormatPurePipeModule,
|
|
||||||
ParseIsoPipeModule,
|
|
||||||
RouterModule,
|
|
||||||
ShadowHtmlDirective,
|
|
||||||
TranslateModule,
|
|
||||||
TitleCasePipe,
|
|
||||||
],
|
|
||||||
})
|
|
||||||
export class MailDetailComponent {
|
|
||||||
readonly activatedRoute = inject(ActivatedRoute);
|
|
||||||
|
|
||||||
readonly mailStorage = inject(MailStorageProvider);
|
|
||||||
|
|
||||||
readonly sanitizer = inject(DomSanitizer);
|
|
||||||
|
|
||||||
parameters = this.activatedRoute.paramMap.pipe(
|
|
||||||
map(parameters => ({
|
|
||||||
mailbox: parameters.get('mailbox')!,
|
|
||||||
id: parameters.get('id')!,
|
|
||||||
})),
|
|
||||||
);
|
|
||||||
|
|
||||||
mail = this.parameters.pipe(mergeMap(({mailbox, id}) => this.mailStorage.getEmail(mailbox, id)));
|
|
||||||
|
|
||||||
collapse = signal(false);
|
|
||||||
|
|
||||||
todo() {
|
|
||||||
alert('TODO');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,93 +0,0 @@
|
|||||||
<ion-header>
|
|
||||||
<ion-toolbar color="primary" mode="ios">
|
|
||||||
<ion-buttons slot="start">
|
|
||||||
<ion-back-button></ion-back-button>
|
|
||||||
</ion-buttons>
|
|
||||||
<ion-title
|
|
||||||
[style.opacity]="(collapse() ? '1' : '0') + '!important'"
|
|
||||||
[style.translate]="collapse() ? '0' : '0 10px'"
|
|
||||||
>
|
|
||||||
@if (mail | async; as mail) {
|
|
||||||
{{ mail.subject?.value }}
|
|
||||||
} @else {
|
|
||||||
<ion-skeleton-text animated style="width: 100px; height: 20px"></ion-skeleton-text>
|
|
||||||
}
|
|
||||||
</ion-title>
|
|
||||||
<ion-buttons slot="end">
|
|
||||||
<ion-button (click)="todo()">
|
|
||||||
<ion-icon slot="icon-only" name="delete"></ion-icon>
|
|
||||||
</ion-button>
|
|
||||||
<ion-button (click)="todo()">
|
|
||||||
<ion-icon slot="icon-only" name="mark_email_unread"></ion-icon>
|
|
||||||
</ion-button>
|
|
||||||
</ion-buttons>
|
|
||||||
</ion-toolbar>
|
|
||||||
</ion-header>
|
|
||||||
|
|
||||||
<ion-content [scrollEvents]="true" (ionScroll)="collapse.set($any($event).detail.scrollTop > 50)">
|
|
||||||
@if (mail | async; as mail) {
|
|
||||||
<h1 @materialFade>{{ mail.subject?.value }}</h1>
|
|
||||||
<aside @materialFade>
|
|
||||||
<strong class="from">
|
|
||||||
{{ mail.from.value.name || mail.from.value.address }}
|
|
||||||
@if (mail.from.signature?.valid === true) {
|
|
||||||
<ion-icon name="verified" [fill]="true" @materialFade></ion-icon>
|
|
||||||
} @else if (mail.from.signature?.valid === false) {
|
|
||||||
<ion-icon name="gpp_bad" color="danger" [fill]="true" @materialFade></ion-icon>
|
|
||||||
}
|
|
||||||
</strong>
|
|
||||||
<div class="to">
|
|
||||||
to
|
|
||||||
@for (to of mail.to; track to) {
|
|
||||||
<span>{{ to.value.name || to.value.address }}</span>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
@if (mail.cc) {
|
|
||||||
<div class="cc">
|
|
||||||
cc
|
|
||||||
@for (cc of mail.cc; track cc) {
|
|
||||||
<span>{{ cc.value.name || cc.value.address }}</span>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</aside>
|
|
||||||
@if (mail.html) {
|
|
||||||
<main @materialFade>
|
|
||||||
<div class="html" [shadowHTML]="mail.html.value"></div>
|
|
||||||
</main>
|
|
||||||
} @else if (mail.text) {
|
|
||||||
<main @materialFade>
|
|
||||||
<pre>{{ mail.text.value }}</pre>
|
|
||||||
</main>
|
|
||||||
}
|
|
||||||
<ion-list>
|
|
||||||
@for (attachment of mail.attachments; track attachment) {
|
|
||||||
<ion-card>
|
|
||||||
<ion-card-header>
|
|
||||||
<ion-card-title>{{ attachment.value.filename }}</ion-card-title>
|
|
||||||
<ion-card-subtitle>{{ attachment.value.size }}</ion-card-subtitle>
|
|
||||||
</ion-card-header>
|
|
||||||
<ion-card-content>
|
|
||||||
<ion-button fill="clear" (click)="todo()">
|
|
||||||
<ion-icon slot="icon-only" name="download"></ion-icon>
|
|
||||||
</ion-button>
|
|
||||||
</ion-card-content>
|
|
||||||
</ion-card>
|
|
||||||
}
|
|
||||||
</ion-list>
|
|
||||||
<footer>
|
|
||||||
<div>
|
|
||||||
<table>
|
|
||||||
@if (mail.date) {
|
|
||||||
<tr>
|
|
||||||
<th>{{ 'mail.DATE' | translate | titlecase }}</th>
|
|
||||||
<td>
|
|
||||||
<time [dateTime]="mail.date">{{ mail.date.value | dfnsFormatPure: 'PPp' }}</time>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
}
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</footer>
|
|
||||||
}
|
|
||||||
</ion-content>
|
|
||||||
@@ -1,97 +0,0 @@
|
|||||||
@import '../../../theme/util/mixins';
|
|
||||||
|
|
||||||
ion-item {
|
|
||||||
margin-block-end: var(--spacing-xl);
|
|
||||||
}
|
|
||||||
|
|
||||||
ion-title {
|
|
||||||
transition:
|
|
||||||
opacity 0.2s ease,
|
|
||||||
translate 0.2s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
margin: var(--spacing-sm) var(--spacing-md);
|
|
||||||
font-weight: var(--font-weight-bold);
|
|
||||||
color: var(--ion-color-primary-contrast);
|
|
||||||
}
|
|
||||||
|
|
||||||
aside {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
margin: var(--spacing-xs) var(--spacing-md);
|
|
||||||
color: var(--ion-color-primary-contrast);
|
|
||||||
}
|
|
||||||
|
|
||||||
.to {
|
|
||||||
display: flex;
|
|
||||||
gap: var(--spacing-xs);
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-start;
|
|
||||||
|
|
||||||
> span:has(+ span)::after {
|
|
||||||
content: ',';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.from {
|
|
||||||
display: flex;
|
|
||||||
gap: var(--spacing-xs);
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-start;
|
|
||||||
}
|
|
||||||
|
|
||||||
main {
|
|
||||||
@include border-radius-in-parallax(var(--border-radius-default));
|
|
||||||
|
|
||||||
margin: var(--spacing-md);
|
|
||||||
padding: var(--spacing-md);
|
|
||||||
background: var(--ion-item-background);
|
|
||||||
}
|
|
||||||
|
|
||||||
.html {
|
|
||||||
overflow-x: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
pre {
|
|
||||||
font-family: inherit;
|
|
||||||
word-wrap: break-word;
|
|
||||||
white-space: pre-wrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
footer {
|
|
||||||
// css hack to make the element stick to the bottom of the scroll container even
|
|
||||||
// when the content is not filling it
|
|
||||||
position: sticky;
|
|
||||||
top: 100vh;
|
|
||||||
|
|
||||||
> div {
|
|
||||||
margin: var(--spacing-lg);
|
|
||||||
opacity: 0.8;
|
|
||||||
}
|
|
||||||
|
|
||||||
td {
|
|
||||||
padding-inline-start: var(--spacing-md);
|
|
||||||
word-break: break-word;
|
|
||||||
}
|
|
||||||
|
|
||||||
code {
|
|
||||||
font-size: inherit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.attachment {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
margin: var(--spacing-md) 0;
|
|
||||||
padding: var(--spacing-md);
|
|
||||||
|
|
||||||
border: 1px solid var(--ion-border-color);
|
|
||||||
border-radius: var(--border-radius-default);
|
|
||||||
}
|
|
||||||
|
|
||||||
ion-content::part(background) {
|
|
||||||
background: none;
|
|
||||||
}
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
import {AsyncPipe, TitleCasePipe} from '@angular/common';
|
|
||||||
import {ChangeDetectionStrategy, Component, WritableSignal, computed, inject, signal} from '@angular/core';
|
|
||||||
import {FormsModule} from '@angular/forms';
|
|
||||||
import {IonicModule} from '@ionic/angular';
|
|
||||||
import {TranslateModule} from '@ngx-translate/core';
|
|
||||||
import {IonIconModule} from 'src/app/util/ion-icon/ion-icon.module';
|
|
||||||
import {UtilModule} from 'src/app/util/util.module';
|
|
||||||
import {MailService} from './mail.service';
|
|
||||||
import {Observable, of, map, catchError, startWith, shareReplay, tap, take} from 'rxjs';
|
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'stapps-mail-login',
|
|
||||||
templateUrl: 'mail-login.html',
|
|
||||||
styleUrl: 'mail-login.scss',
|
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
||||||
standalone: true,
|
|
||||||
imports: [IonicModule, UtilModule, TranslateModule, TitleCasePipe, IonIconModule, FormsModule, AsyncPipe],
|
|
||||||
})
|
|
||||||
export class MailLoginComponent {
|
|
||||||
showPassword = signal(false);
|
|
||||||
|
|
||||||
email = signal('');
|
|
||||||
|
|
||||||
password = signal('');
|
|
||||||
|
|
||||||
// eslint-disable-next-line unicorn/no-useless-undefined
|
|
||||||
error: WritableSignal<Observable<string | undefined>> = signal(of(undefined));
|
|
||||||
|
|
||||||
loading = computed(() =>
|
|
||||||
this.error().pipe(
|
|
||||||
map(() => false),
|
|
||||||
startWith(true),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
mailService = inject(MailService);
|
|
||||||
|
|
||||||
router = inject(Router);
|
|
||||||
|
|
||||||
activatedRoute = inject(ActivatedRoute);
|
|
||||||
|
|
||||||
submit(event: SubmitEvent) {
|
|
||||||
event.preventDefault();
|
|
||||||
const form = event.target as HTMLFormElement;
|
|
||||||
if (form.checkValidity()) {
|
|
||||||
this.error.set(
|
|
||||||
this.mailService.login(this.email(), this.password()).pipe(
|
|
||||||
tap(success => {
|
|
||||||
if (success) {
|
|
||||||
this.activatedRoute.data.pipe(take(1)).subscribe(data => {
|
|
||||||
this.router.navigate(data.redirectTo);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
map(success => (success ? undefined : 'mail.login.error.INVALID_CREDENTIALS')),
|
|
||||||
catchError(error => of(error.message)),
|
|
||||||
shareReplay(1),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
form.reportValidity();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
<ion-header>
|
|
||||||
<ion-toolbar color="primary" mode="ios">
|
|
||||||
<ion-buttons slot="start">
|
|
||||||
<ion-back-button></ion-back-button>
|
|
||||||
</ion-buttons>
|
|
||||||
</ion-toolbar>
|
|
||||||
</ion-header>
|
|
||||||
|
|
||||||
<ion-content parallax>
|
|
||||||
<h1>{{ 'mail.login.TITLE' | translate | titlecase }}</h1>
|
|
||||||
<form (ngSubmit)="submit($event)">
|
|
||||||
<ion-input
|
|
||||||
[attr.aria-label]="'mail.login.PLACEHOLDER_USERNAME' | translate | titlecase"
|
|
||||||
[placeholder]="'mail.login.PLACEHOLDER_USERNAME' | translate | titlecase"
|
|
||||||
[(ngModel)]="email"
|
|
||||||
[required]="true"
|
|
||||||
[disabled]="(error() | async) !== null ? false : true"
|
|
||||||
autocomplete="username"
|
|
||||||
enterkeyhint="next"
|
|
||||||
color="primary"
|
|
||||||
name="username"
|
|
||||||
type="text"
|
|
||||||
>
|
|
||||||
<ion-icon slot="start" name="account_circle" aria-hiden="true"></ion-icon>
|
|
||||||
</ion-input>
|
|
||||||
<ion-input
|
|
||||||
[attr.aria-label]="'mail.login.PLACEHOLDER_PASSWORD' | translate | titlecase"
|
|
||||||
[placeholder]="'mail.login.PLACEHOLDER_PASSWORD' | translate | titlecase"
|
|
||||||
[(ngModel)]="password"
|
|
||||||
[required]="true"
|
|
||||||
[disabled]="(error() | async) !== null ? false : true"
|
|
||||||
autocomplete="current-password"
|
|
||||||
enterkeyhint="go"
|
|
||||||
name="password"
|
|
||||||
[type]="showPassword() ? 'text' : 'password'"
|
|
||||||
>
|
|
||||||
<ion-icon slot="start" name="password" aria-hidden="true"></ion-icon>
|
|
||||||
<ion-button
|
|
||||||
fill="clear"
|
|
||||||
slot="end"
|
|
||||||
color="medium"
|
|
||||||
aria-label="Show/hide"
|
|
||||||
(click)="showPassword.set(!showPassword())"
|
|
||||||
>
|
|
||||||
<ion-icon
|
|
||||||
[size]="20"
|
|
||||||
[fill]="!showPassword()"
|
|
||||||
slot="icon-only"
|
|
||||||
name="visibility"
|
|
||||||
aria-hidden="true"
|
|
||||||
></ion-icon>
|
|
||||||
</ion-button>
|
|
||||||
</ion-input>
|
|
||||||
@if (error() | async; as error) {
|
|
||||||
<ion-note color="danger">{{ error | translate | titlecase }}</ion-note>
|
|
||||||
}
|
|
||||||
<ion-button
|
|
||||||
fill="outline"
|
|
||||||
color="primary"
|
|
||||||
type="submit"
|
|
||||||
[disabled]="(error() | async) !== null ? false : true"
|
|
||||||
>
|
|
||||||
<ion-icon slot="start" name="login" aria-hidden="true"></ion-icon>
|
|
||||||
{{ 'mail.login.LOGIN' | translate | titlecase }}
|
|
||||||
</ion-button>
|
|
||||||
</form>
|
|
||||||
</ion-content>
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
h1 {
|
|
||||||
margin-inline: auto;
|
|
||||||
color: var(--ion-color-primary-contrast);
|
|
||||||
}
|
|
||||||
|
|
||||||
form {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: flex-end;
|
|
||||||
|
|
||||||
max-width: 30em;
|
|
||||||
margin: var(--spacing-xxl) auto;
|
|
||||||
padding: var(--spacing-xl);
|
|
||||||
|
|
||||||
background: var(--ion-item-background);
|
|
||||||
border-radius: var(--border-radius-default);
|
|
||||||
}
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
import {ChangeDetectionStrategy, Component, inject} from '@angular/core';
|
|
||||||
import {MailService} from './mail.service';
|
|
||||||
import {AsyncPipe, TitleCasePipe} from '@angular/common';
|
|
||||||
import {IonicModule} from '@ionic/angular';
|
|
||||||
import {DataModule} from '../data/data.module';
|
|
||||||
import {IonIconModule} from 'src/app/util/ion-icon/ion-icon.module';
|
|
||||||
import {UtilModule} from 'src/app/util/util.module';
|
|
||||||
import {FormatPurePipeModule, IsTodayPipeModule} from 'ngx-date-fns';
|
|
||||||
import {ActivatedRoute, RouterModule} from '@angular/router';
|
|
||||||
import {map, mergeMap} from 'rxjs';
|
|
||||||
import {MailStorageProvider} from './mail-storage.provider';
|
|
||||||
import {MailboxTreeItem} from './schema';
|
|
||||||
import {SCIcon} from 'src/app/util/ion-icon/icon';
|
|
||||||
import {TranslateModule} from '@ngx-translate/core';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'stapps-mail-page',
|
|
||||||
templateUrl: 'mail-page.html',
|
|
||||||
styleUrl: 'mail-page.scss',
|
|
||||||
standalone: true,
|
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
||||||
imports: [
|
|
||||||
AsyncPipe,
|
|
||||||
IonicModule,
|
|
||||||
DataModule,
|
|
||||||
IonIconModule,
|
|
||||||
UtilModule,
|
|
||||||
FormatPurePipeModule,
|
|
||||||
IsTodayPipeModule,
|
|
||||||
RouterModule,
|
|
||||||
TranslateModule,
|
|
||||||
TitleCasePipe,
|
|
||||||
],
|
|
||||||
})
|
|
||||||
export class MailPageComponent {
|
|
||||||
readonly activatedRoute = inject(ActivatedRoute);
|
|
||||||
|
|
||||||
readonly mailService = inject(MailService);
|
|
||||||
|
|
||||||
readonly mailStorage = inject(MailStorageProvider);
|
|
||||||
|
|
||||||
mailIcons: Record<Exclude<MailboxTreeItem['specialUse'], undefined>, keyof typeof SCIcon> = {
|
|
||||||
'\\Inbox': SCIcon.inbox,
|
|
||||||
'\\All': SCIcon.all_inbox,
|
|
||||||
'\\Archive': SCIcon.archive,
|
|
||||||
'\\Drafts': SCIcon.drafts,
|
|
||||||
'\\Flagged': SCIcon.flag,
|
|
||||||
'\\Junk': SCIcon.folder,
|
|
||||||
'\\Sent': SCIcon.send,
|
|
||||||
'\\Trash': SCIcon.delete,
|
|
||||||
};
|
|
||||||
|
|
||||||
mailbox = this.activatedRoute.paramMap.pipe(
|
|
||||||
mergeMap(parameters =>
|
|
||||||
this.mailStorage.mailboxes.pipe(
|
|
||||||
map(mailboxes => mailboxes.folders.find(it => it.path === parameters.get('mailbox')!)!),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
<ion-header>
|
|
||||||
<ion-toolbar>
|
|
||||||
<ion-buttons slot="start">
|
|
||||||
<ion-back-button></ion-back-button>
|
|
||||||
<ion-menu-button menu="mailboxes"></ion-menu-button>
|
|
||||||
</ion-buttons>
|
|
||||||
|
|
||||||
<ion-title>Mail</ion-title>
|
|
||||||
</ion-toolbar>
|
|
||||||
</ion-header>
|
|
||||||
|
|
||||||
<ion-content parallax>
|
|
||||||
<ion-split-pane contentId="mailbox-content">
|
|
||||||
<ion-menu contentId="mailbox-content" menuId="mailboxes">
|
|
||||||
@if (mailStorage.mailboxes | async; as mailboxes) {
|
|
||||||
<ion-list>
|
|
||||||
@for (folder of mailboxes.folders; track folder) {
|
|
||||||
<ion-item
|
|
||||||
[routerLink]="['/mail', folder.path]"
|
|
||||||
[class.active]="folder.path === (mailbox | async)?.path"
|
|
||||||
>
|
|
||||||
@if (folder.specialUse) {
|
|
||||||
<ion-icon
|
|
||||||
slot="start"
|
|
||||||
[fill]="folder.path === (mailbox | async)?.path"
|
|
||||||
[name]="mailIcons[folder.specialUse]"
|
|
||||||
></ion-icon>
|
|
||||||
<ion-label>{{ 'mail.mailboxes.' + folder.specialUse | translate | titlecase }}</ion-label>
|
|
||||||
} @else {
|
|
||||||
<ion-icon
|
|
||||||
slot="start"
|
|
||||||
[fill]="folder.path === (mailbox | async)?.path"
|
|
||||||
name="folder"
|
|
||||||
></ion-icon>
|
|
||||||
<ion-label>{{ folder.name }}</ion-label>
|
|
||||||
}
|
|
||||||
</ion-item>
|
|
||||||
}
|
|
||||||
</ion-list>
|
|
||||||
}
|
|
||||||
</ion-menu>
|
|
||||||
|
|
||||||
<ion-router-outlet id="mailbox-content"></ion-router-outlet>
|
|
||||||
</ion-split-pane>
|
|
||||||
</ion-content>
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
ion-list {
|
|
||||||
margin: var(--spacing-md);
|
|
||||||
border-radius: var(--border-radius-default);
|
|
||||||
}
|
|
||||||
|
|
||||||
ion-split-pane {
|
|
||||||
--border: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
ion-menu,
|
|
||||||
ion-menu::part(container),
|
|
||||||
ion-menu::part(backdrop) {
|
|
||||||
background: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
ion-menu:not(.menu-pane-visible) {
|
|
||||||
&::part(container) {
|
|
||||||
box-shadow: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
> ion-list {
|
|
||||||
height: 100%;
|
|
||||||
margin-inline-end: var(--spacing-xl);
|
|
||||||
box-shadow: rgba(0 0 0 / 18%) 4px 0 16px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,243 +0,0 @@
|
|||||||
/* eslint-disable unicorn/no-useless-undefined */
|
|
||||||
import {Injectable, inject} from '@angular/core';
|
|
||||||
import {Capacitor} from '@capacitor/core';
|
|
||||||
import {SecureStoragePlugin} from 'capacitor-secure-storage-plugin';
|
|
||||||
import {
|
|
||||||
BehaviorSubject,
|
|
||||||
Observable,
|
|
||||||
catchError,
|
|
||||||
defer,
|
|
||||||
distinctUntilChanged,
|
|
||||||
filter,
|
|
||||||
from,
|
|
||||||
fromEvent,
|
|
||||||
map,
|
|
||||||
merge,
|
|
||||||
mergeMap,
|
|
||||||
of,
|
|
||||||
shareReplay,
|
|
||||||
startWith,
|
|
||||||
take,
|
|
||||||
firstValueFrom,
|
|
||||||
Subject,
|
|
||||||
} from 'rxjs';
|
|
||||||
import {Email, EmailMeta, MailboxTreeRoot} from './schema';
|
|
||||||
import equal from 'fast-deep-equal';
|
|
||||||
import {MailAdapterService} from './mail-adapter.service';
|
|
||||||
import {StorageProvider} from '../storage/storage.provider';
|
|
||||||
|
|
||||||
@Injectable({providedIn: 'root'})
|
|
||||||
export class MailStorageProvider {
|
|
||||||
static readonly DB_NAME = 'mail';
|
|
||||||
|
|
||||||
static readonly MAILBOX_STORE_NAME = 'mailboxes';
|
|
||||||
|
|
||||||
static readonly EMAIL_STORE_NAME = 'emails';
|
|
||||||
|
|
||||||
static readonly CREDENTIALS_KEY = 'email-credentials';
|
|
||||||
|
|
||||||
static readonly EMAIL_MAILBOX_INDEX = 'email';
|
|
||||||
|
|
||||||
static readonly EMAIL_FLAGS_INDEX = 'flags';
|
|
||||||
|
|
||||||
static readonly EMAIL_DATE_INDEX = 'date';
|
|
||||||
|
|
||||||
storageProvider = inject(StorageProvider);
|
|
||||||
|
|
||||||
mailAdapter = inject(MailAdapterService);
|
|
||||||
|
|
||||||
database = defer(() => {
|
|
||||||
const request = indexedDB.open(MailStorageProvider.DB_NAME, 1);
|
|
||||||
return merge(
|
|
||||||
fromEvent(request, 'upgradeneeded').pipe(
|
|
||||||
map(event => {
|
|
||||||
const database = (event.target as IDBOpenDBRequest).result;
|
|
||||||
const mailStore = database.createObjectStore(MailStorageProvider.EMAIL_STORE_NAME, {
|
|
||||||
keyPath: ['id', 'mailbox'],
|
|
||||||
});
|
|
||||||
mailStore.createIndex(MailStorageProvider.EMAIL_MAILBOX_INDEX, 'mailbox', {unique: false});
|
|
||||||
mailStore.createIndex(MailStorageProvider.EMAIL_FLAGS_INDEX, 'flags', {
|
|
||||||
unique: false,
|
|
||||||
multiEntry: true,
|
|
||||||
});
|
|
||||||
mailStore.createIndex(MailStorageProvider.EMAIL_DATE_INDEX, 'date', {unique: false});
|
|
||||||
return database;
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
fromEvent(request, 'success').pipe(
|
|
||||||
take(1),
|
|
||||||
map(event => (event.target as IDBOpenDBRequest).result),
|
|
||||||
),
|
|
||||||
fromEvent(request, 'error').pipe(
|
|
||||||
take(1),
|
|
||||||
map(event => {
|
|
||||||
throw (event.target as IDBOpenDBRequest).error;
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
fromEvent(request, 'blocked').pipe(
|
|
||||||
take(1),
|
|
||||||
map(() => {
|
|
||||||
throw new Error('Database blocked');
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}).pipe(shareReplay(1));
|
|
||||||
|
|
||||||
private mailboxesChanged = new BehaviorSubject<void>(undefined);
|
|
||||||
|
|
||||||
mailboxes: Observable<MailboxTreeRoot> = this.mailboxesChanged.pipe(
|
|
||||||
mergeMap(() =>
|
|
||||||
this.storageProvider
|
|
||||||
.get<MailboxTreeRoot>(MailStorageProvider.MAILBOX_STORE_NAME)
|
|
||||||
.catch(() => undefined!),
|
|
||||||
),
|
|
||||||
filter(it => it !== undefined),
|
|
||||||
distinctUntilChanged((a, b) => equal(a, b)),
|
|
||||||
shareReplay(1),
|
|
||||||
);
|
|
||||||
|
|
||||||
async setMailboxes(root: MailboxTreeRoot | undefined): Promise<void> {
|
|
||||||
await this.storageProvider.put(MailStorageProvider.MAILBOX_STORE_NAME, root);
|
|
||||||
this.mailboxesChanged.next();
|
|
||||||
}
|
|
||||||
|
|
||||||
private credentialsChanged = new BehaviorSubject<void>(undefined);
|
|
||||||
|
|
||||||
credentials: Observable<string | undefined> = this.credentialsChanged.pipe(
|
|
||||||
mergeMap(() => {
|
|
||||||
return Capacitor.isNativePlatform()
|
|
||||||
? from(SecureStoragePlugin.get({key: MailStorageProvider.CREDENTIALS_KEY})).pipe(
|
|
||||||
map(({value}) => value),
|
|
||||||
catchError(() => of(undefined)),
|
|
||||||
)
|
|
||||||
: of(localStorage.getItem(MailStorageProvider.CREDENTIALS_KEY) ?? undefined);
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
async setCredentials(credentials: string | undefined): Promise<void> {
|
|
||||||
if (Capacitor.isNativePlatform()) {
|
|
||||||
await (credentials === undefined
|
|
||||||
? SecureStoragePlugin.remove({key: MailStorageProvider.CREDENTIALS_KEY})
|
|
||||||
: SecureStoragePlugin.set({key: MailStorageProvider.CREDENTIALS_KEY, value: credentials}));
|
|
||||||
} else {
|
|
||||||
if (credentials === undefined) {
|
|
||||||
localStorage.removeItem(MailStorageProvider.CREDENTIALS_KEY);
|
|
||||||
} else {
|
|
||||||
localStorage.setItem(MailStorageProvider.CREDENTIALS_KEY, credentials);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.credentialsChanged.next();
|
|
||||||
}
|
|
||||||
|
|
||||||
private emailChanged = new Subject<Set<string>>();
|
|
||||||
|
|
||||||
private mailboxContentChanged = new Subject<Set<string>>();
|
|
||||||
|
|
||||||
getEmails(mailbox: string): Observable<EmailMeta[]> {
|
|
||||||
return this.mailboxContentChanged.pipe(
|
|
||||||
filter(it => it.has(mailbox)),
|
|
||||||
startWith(undefined),
|
|
||||||
mergeMap(() => this.database),
|
|
||||||
mergeMap(database => {
|
|
||||||
return defer(() => {
|
|
||||||
const transaction = database.transaction([MailStorageProvider.EMAIL_STORE_NAME], 'readonly');
|
|
||||||
const store = transaction.objectStore(MailStorageProvider.EMAIL_STORE_NAME);
|
|
||||||
|
|
||||||
const index = store.index(MailStorageProvider.EMAIL_MAILBOX_INDEX);
|
|
||||||
const request = index.getAll(IDBKeyRange.only(mailbox));
|
|
||||||
|
|
||||||
return merge(
|
|
||||||
fromEvent(request, 'success').pipe(map(() => request.result as Array<EmailMeta | Email>)),
|
|
||||||
fromEvent(request, 'error').pipe(
|
|
||||||
map(event => {
|
|
||||||
throw (event.target as IDBRequest).error;
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
).pipe(take(1));
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
map<Array<Email | EmailMeta>, EmailMeta[]>(emails =>
|
|
||||||
emails
|
|
||||||
.map(email => ({id: email.id, mailbox: email.mailbox, incomplete: true}) satisfies EmailMeta)
|
|
||||||
.sort((a, b) => Number(b.id) - Number(a.id)),
|
|
||||||
),
|
|
||||||
shareReplay(1),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
getEmail(mailbox: string, id: string): Observable<Email> {
|
|
||||||
return this.emailChanged.pipe(
|
|
||||||
filter(it => it.has(JSON.stringify([id, mailbox]))),
|
|
||||||
startWith(undefined),
|
|
||||||
mergeMap(() => this.database),
|
|
||||||
mergeMap(database => {
|
|
||||||
return defer(() => {
|
|
||||||
const transaction = database.transaction([MailStorageProvider.EMAIL_STORE_NAME], 'readonly');
|
|
||||||
const store = transaction.objectStore(MailStorageProvider.EMAIL_STORE_NAME);
|
|
||||||
|
|
||||||
const request = store.get([id, mailbox]);
|
|
||||||
|
|
||||||
return merge(
|
|
||||||
fromEvent(request, 'success').pipe(map(() => request.result as EmailMeta | Email)),
|
|
||||||
fromEvent(request, 'error').pipe(
|
|
||||||
map(event => {
|
|
||||||
throw (event.target as IDBRequest).error;
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
).pipe(take(1));
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
mergeMap(email =>
|
|
||||||
'incomplete' in email
|
|
||||||
? this.credentials.pipe(
|
|
||||||
filter(it => it !== undefined),
|
|
||||||
take(1),
|
|
||||||
mergeMap(credentials =>
|
|
||||||
this.mailAdapter.getEmail(credentials!, mailbox, id).pipe(
|
|
||||||
mergeMap(async email => {
|
|
||||||
console.log('fetiching');
|
|
||||||
await this.setEmail(email, true);
|
|
||||||
console.log('done');
|
|
||||||
return email;
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: of(email),
|
|
||||||
),
|
|
||||||
shareReplay(1),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
async setEmail(email: Email | EmailMeta | Array<Email | EmailMeta>, quiet = false): Promise<void> {
|
|
||||||
const database = await firstValueFrom(this.database);
|
|
||||||
const transaction = database.transaction([MailStorageProvider.EMAIL_STORE_NAME], 'readwrite');
|
|
||||||
const store = transaction.objectStore(MailStorageProvider.EMAIL_STORE_NAME);
|
|
||||||
|
|
||||||
const mailboxesAffected = new Set<string>();
|
|
||||||
const emailsAffected = new Set<string>();
|
|
||||||
|
|
||||||
for (const it of Array.isArray(email) ? email : [email]) {
|
|
||||||
mailboxesAffected.add(it.mailbox);
|
|
||||||
emailsAffected.add(JSON.stringify([it.id, it.mailbox]));
|
|
||||||
store.put(it);
|
|
||||||
}
|
|
||||||
|
|
||||||
await firstValueFrom(
|
|
||||||
merge(
|
|
||||||
fromEvent(transaction, 'complete').pipe(
|
|
||||||
map(() => {
|
|
||||||
if (!quiet) {
|
|
||||||
this.emailChanged.next(emailsAffected);
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
fromEvent(transaction, 'error').pipe(
|
|
||||||
map(event => {
|
|
||||||
throw (event.target as IDBRequest).error;
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2024 StApps
|
|
||||||
* 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
|
|
||||||
* Software Foundation, version 3.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with
|
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
import {Router, RouterModule} from '@angular/router';
|
|
||||||
import {NgModule, inject} from '@angular/core';
|
|
||||||
import {MailService} from './mail.service';
|
|
||||||
import {map, take} from 'rxjs';
|
|
||||||
|
|
||||||
function mailLoginGuard() {
|
|
||||||
const router = inject(Router);
|
|
||||||
return inject(MailService).isLoggedIn.pipe(
|
|
||||||
map(isLoggedIn => (isLoggedIn ? true : router.createUrlTree(['/mail-login']))),
|
|
||||||
take(1),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
imports: [
|
|
||||||
RouterModule.forChild([
|
|
||||||
{
|
|
||||||
path: 'mail-login',
|
|
||||||
data: {redirectTo: ['/mail']},
|
|
||||||
loadComponent: () => import('./mail-login.component').then(m => m.MailLoginComponent),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'mail',
|
|
||||||
loadComponent: () => import('./mail-page.component').then(m => m.MailPageComponent),
|
|
||||||
canActivate: [mailLoginGuard],
|
|
||||||
canActivateChild: [mailLoginGuard],
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: '',
|
|
||||||
redirectTo: 'INBOX',
|
|
||||||
pathMatch: 'full',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: ':mailbox',
|
|
||||||
loadComponent: () => import('./mailbox-page.component').then(m => m.MailboxPageComponent),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: ':mailbox/:id',
|
|
||||||
loadComponent: () => import('./mail-detail.component').then(m => m.MailDetailComponent),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
]),
|
|
||||||
],
|
|
||||||
})
|
|
||||||
export class MailModule {}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
import {Pipe, PipeTransform, inject} from '@angular/core';
|
|
||||||
import {Observable} from 'rxjs';
|
|
||||||
import {MailStorageProvider} from './mail-storage.provider';
|
|
||||||
import {Email} from './schema';
|
|
||||||
|
|
||||||
@Pipe({
|
|
||||||
name: 'mail',
|
|
||||||
pure: true,
|
|
||||||
standalone: true,
|
|
||||||
})
|
|
||||||
export class MailPipe implements PipeTransform {
|
|
||||||
mailStorage = inject(MailStorageProvider);
|
|
||||||
|
|
||||||
transform(value: {mailbox: string; id: string}): Observable<Email> {
|
|
||||||
return this.mailStorage.getEmail(value.mailbox, value.id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
import {Injectable} from '@angular/core';
|
|
||||||
import {
|
|
||||||
Observable,
|
|
||||||
map,
|
|
||||||
mergeMap,
|
|
||||||
filter,
|
|
||||||
from,
|
|
||||||
combineLatest,
|
|
||||||
tap,
|
|
||||||
of,
|
|
||||||
catchError,
|
|
||||||
BehaviorSubject,
|
|
||||||
} from 'rxjs';
|
|
||||||
import {MailStorageProvider} from './mail-storage.provider';
|
|
||||||
import {MailAdapterService} from './mail-adapter.service';
|
|
||||||
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
|
|
||||||
import {EmailMeta} from './schema';
|
|
||||||
|
|
||||||
@Injectable({providedIn: 'root'})
|
|
||||||
export class MailService {
|
|
||||||
isLoggedIn = this.mailStorage.credentials.pipe(map(it => it !== undefined));
|
|
||||||
|
|
||||||
manualSync = new BehaviorSubject<void>(undefined);
|
|
||||||
|
|
||||||
constructor(
|
|
||||||
private mailStorage: MailStorageProvider,
|
|
||||||
private mailAdapter: MailAdapterService,
|
|
||||||
) {
|
|
||||||
this.mailStorage.credentials
|
|
||||||
.pipe(
|
|
||||||
takeUntilDestroyed(),
|
|
||||||
mergeMap(credentials => this.manualSync.pipe(map(() => credentials))),
|
|
||||||
mergeMap(credentials => {
|
|
||||||
return credentials === undefined
|
|
||||||
? of()
|
|
||||||
: this.mailAdapter
|
|
||||||
.listMailboxes(credentials)
|
|
||||||
.pipe(mergeMap(mailboxes => this.mailStorage.setMailboxes(mailboxes)));
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
.subscribe(() => {});
|
|
||||||
combineLatest([
|
|
||||||
this.mailStorage.credentials.pipe(filter(it => it !== undefined)),
|
|
||||||
this.mailStorage.mailboxes,
|
|
||||||
])
|
|
||||||
.pipe(
|
|
||||||
takeUntilDestroyed(),
|
|
||||||
mergeMap(([credentials, mailboxes]) =>
|
|
||||||
from(mailboxes.folders).pipe(
|
|
||||||
mergeMap(async mailbox => {
|
|
||||||
return this.mailAdapter.listRawEmails(credentials!, mailbox.path).pipe(
|
|
||||||
map<string[], EmailMeta[]>(emails =>
|
|
||||||
emails.map(it => ({id: it, mailbox: mailbox.path, incomplete: true}) satisfies EmailMeta),
|
|
||||||
),
|
|
||||||
catchError(error => {
|
|
||||||
console.error(error);
|
|
||||||
return of();
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
mergeMap(emails => emails),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
mergeMap(emails => this.mailStorage.setEmail(emails)),
|
|
||||||
)
|
|
||||||
.subscribe(() => {});
|
|
||||||
}
|
|
||||||
|
|
||||||
login(username: string, password: string): Observable<boolean> {
|
|
||||||
const credentials = btoa(`${username}:${password}`);
|
|
||||||
return this.mailAdapter.checkCredentials(credentials).pipe(
|
|
||||||
tap(success => {
|
|
||||||
if (success) {
|
|
||||||
this.mailStorage.setCredentials(credentials);
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
logout() {
|
|
||||||
this.mailStorage.setCredentials(undefined);
|
|
||||||
this.mailStorage.setMailboxes(undefined);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
import {ChangeDetectionStrategy, Component, inject} from '@angular/core';
|
|
||||||
import {ActivatedRoute, RouterModule} from '@angular/router';
|
|
||||||
import {MailService} from './mail.service';
|
|
||||||
import {MailStorageProvider} from './mail-storage.provider';
|
|
||||||
import {mergeMap, map, filter} from 'rxjs';
|
|
||||||
import {IonicModule} from '@ionic/angular';
|
|
||||||
import {IonIconModule} from 'src/app/util/ion-icon/ion-icon.module';
|
|
||||||
import {TranslateModule} from '@ngx-translate/core';
|
|
||||||
import {AsyncPipe, TitleCasePipe} from '@angular/common';
|
|
||||||
import {LazyComponent} from 'src/app/util/lazy.component';
|
|
||||||
import {MailPipe} from './mail.pipe';
|
|
||||||
import {FormatPurePipeModule, IsTodayPipeModule} from 'ngx-date-fns';
|
|
||||||
import {LazyLoadPipe} from 'src/app/util/lazy-load.pipe';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'stapps-mailbox-page',
|
|
||||||
templateUrl: 'mailbox-page.html',
|
|
||||||
styleUrl: 'mailbox-page.scss',
|
|
||||||
standalone: true,
|
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
||||||
imports: [
|
|
||||||
IonicModule,
|
|
||||||
IonIconModule,
|
|
||||||
TranslateModule,
|
|
||||||
AsyncPipe,
|
|
||||||
LazyComponent,
|
|
||||||
MailPipe,
|
|
||||||
IsTodayPipeModule,
|
|
||||||
FormatPurePipeModule,
|
|
||||||
RouterModule,
|
|
||||||
LazyLoadPipe,
|
|
||||||
TitleCasePipe,
|
|
||||||
],
|
|
||||||
})
|
|
||||||
export class MailboxPageComponent {
|
|
||||||
readonly activatedRoute = inject(ActivatedRoute);
|
|
||||||
|
|
||||||
readonly mailService = inject(MailService);
|
|
||||||
|
|
||||||
readonly mailStorage = inject(MailStorageProvider);
|
|
||||||
|
|
||||||
mailbox = this.activatedRoute.paramMap.pipe(
|
|
||||||
mergeMap(parameters =>
|
|
||||||
this.mailStorage.mailboxes.pipe(
|
|
||||||
map(mailboxes => mailboxes.folders.find(it => it.path === parameters.get('mailbox')!)!),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
mails = this.mailbox.pipe(
|
|
||||||
filter(mailbox => mailbox !== undefined),
|
|
||||||
mergeMap(mailbox => this.mailStorage.getEmails(mailbox.path)),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
<ion-content>
|
|
||||||
<h1>
|
|
||||||
@if (mailbox | async; as mailbox) {
|
|
||||||
@if (mailbox.specialUse) {
|
|
||||||
{{ 'mail.mailboxes.' + mailbox.specialUse | translate | titlecase }}
|
|
||||||
} @else {
|
|
||||||
{{ mailbox.name }}
|
|
||||||
}
|
|
||||||
} @else {
|
|
||||||
<ion-skeleton-text animated style="width: 100px; height: 20px"></ion-skeleton-text>
|
|
||||||
}
|
|
||||||
</h1>
|
|
||||||
|
|
||||||
@if (mails | async; as mails) {
|
|
||||||
<ion-list>
|
|
||||||
@for (mail of mails; track mail.id) {
|
|
||||||
<ion-item #item [routerLink]="['/mail', mail.mailbox, mail.id]">
|
|
||||||
@if (mail | mail | lazyLoad: item | async; as mail) {
|
|
||||||
<div slot="start" class="avatar">
|
|
||||||
@if (mail.from; as from) {
|
|
||||||
<div>
|
|
||||||
{{ (from.value.name || from.value.address)?.charAt(0)?.toUpperCase() }}
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
<ion-label>
|
|
||||||
<h2 [class.unread]="!mail.flags.has('\\Seen')">
|
|
||||||
{{ mail.from.value.name || mail.from.value.address }}
|
|
||||||
</h2>
|
|
||||||
@if (mail.subject) {
|
|
||||||
<p>{{ mail.subject.value }}</p>
|
|
||||||
}
|
|
||||||
</ion-label>
|
|
||||||
<ion-note slot="end">
|
|
||||||
@if (mail.date.value | dfnsIsToday) {
|
|
||||||
{{ mail.date.value | dfnsFormatPure: 'p' }}
|
|
||||||
} @else {
|
|
||||||
{{ mail.date.value | dfnsFormatPure: 'P' }}
|
|
||||||
}
|
|
||||||
</ion-note>
|
|
||||||
} @else {
|
|
||||||
<div slot="start" class="avatar">
|
|
||||||
<ion-skeleton-text animated></ion-skeleton-text>
|
|
||||||
</div>
|
|
||||||
<ion-label>
|
|
||||||
<h2><ion-skeleton-text animated></ion-skeleton-text></h2>
|
|
||||||
<p><ion-skeleton-text animated></ion-skeleton-text></p>
|
|
||||||
</ion-label>
|
|
||||||
}
|
|
||||||
</ion-item>
|
|
||||||
}
|
|
||||||
</ion-list>
|
|
||||||
}
|
|
||||||
</ion-content>
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
.avatar {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
width: 2em;
|
|
||||||
height: 2em;
|
|
||||||
|
|
||||||
color: var(--ion-color-light-contrast);
|
|
||||||
|
|
||||||
background: var(--ion-color-light);
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
margin-inline: var(--spacing-md);
|
|
||||||
color: var(--ion-color-primary-contrast);
|
|
||||||
}
|
|
||||||
|
|
||||||
h2 > ion-skeleton-text {
|
|
||||||
width: min(60%, 20em);
|
|
||||||
}
|
|
||||||
|
|
||||||
p > ion-skeleton-text {
|
|
||||||
width: min(80%, 20em);
|
|
||||||
}
|
|
||||||
|
|
||||||
.avatar > ion-skeleton-text {
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
ion-item.unread h2 {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
ion-item p {
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
ion-content::part(background) {
|
|
||||||
background: none;
|
|
||||||
}
|
|
||||||
@@ -1,128 +0,0 @@
|
|||||||
import {z} from 'zod';
|
|
||||||
|
|
||||||
export const RawEmailAddress = z.object({
|
|
||||||
name: z.optional(z.string()),
|
|
||||||
address: z.optional(z.string()),
|
|
||||||
});
|
|
||||||
|
|
||||||
export type RawEmailAddress = z.infer<typeof RawEmailAddress>;
|
|
||||||
|
|
||||||
export const RawEmailEnvelope = z.object({
|
|
||||||
date: z.coerce.date(),
|
|
||||||
subject: z.string(),
|
|
||||||
messageId: z.string(),
|
|
||||||
inReplyTo: z.optional(z.string()),
|
|
||||||
from: z.array(RawEmailAddress),
|
|
||||||
sender: z.array(RawEmailAddress),
|
|
||||||
replyTo: z.array(RawEmailAddress),
|
|
||||||
to: z.array(RawEmailAddress),
|
|
||||||
cc: z.optional(z.array(RawEmailAddress)),
|
|
||||||
bcc: z.optional(z.array(RawEmailAddress)),
|
|
||||||
});
|
|
||||||
|
|
||||||
export type RawEmailEnvelope = z.infer<typeof RawEmailEnvelope>;
|
|
||||||
|
|
||||||
const RawEmailBodyStructureBase = z.object({
|
|
||||||
part: z.optional(z.string()),
|
|
||||||
type: z.string(),
|
|
||||||
parameters: z.optional(z.record(z.string(), z.string())),
|
|
||||||
encoding: z.optional(z.enum(['7bit', '8bit', 'binary', 'base64', 'quoted-printable'])),
|
|
||||||
size: z.optional(z.number()),
|
|
||||||
envelope: z.optional(RawEmailEnvelope),
|
|
||||||
disposition: z.optional(z.string()),
|
|
||||||
dispositionParameters: z.optional(z.record(z.string(), z.string())),
|
|
||||||
});
|
|
||||||
|
|
||||||
export type RawEmailBodyStructure = z.infer<typeof RawEmailBodyStructureBase> & {
|
|
||||||
childNodes?: RawEmailBodyStructure[];
|
|
||||||
};
|
|
||||||
|
|
||||||
export const RawEmailBodyStructure: z.ZodType<RawEmailBodyStructure> = RawEmailBodyStructureBase.extend({
|
|
||||||
childNodes: z.optional(z.lazy(() => z.array(RawEmailBodyStructure))),
|
|
||||||
});
|
|
||||||
|
|
||||||
export const RawEmail = z.object({
|
|
||||||
bodyStructure: RawEmailBodyStructure,
|
|
||||||
labels: z.array(z.string()).transform(it => new Set(it)),
|
|
||||||
flags: z.array(z.string()).transform(it => new Set(it)),
|
|
||||||
envelope: RawEmailEnvelope,
|
|
||||||
seq: z.coerce.string(),
|
|
||||||
});
|
|
||||||
|
|
||||||
export type RawEmail = z.infer<typeof RawEmail>;
|
|
||||||
|
|
||||||
const MailboxTreeItemBase = z.object({
|
|
||||||
path: z.string(),
|
|
||||||
name: z.string(),
|
|
||||||
delimiter: z.string(),
|
|
||||||
flags: z.array(z.string()).or(z.object({})),
|
|
||||||
specialUse: z.optional(
|
|
||||||
z.enum(['\\All', '\\Archive', '\\Drafts', '\\Flagged', '\\Junk', '\\Sent', '\\Trash', '\\Inbox']),
|
|
||||||
),
|
|
||||||
listed: z.boolean(),
|
|
||||||
subscribed: z.boolean(),
|
|
||||||
disabled: z.boolean().optional(),
|
|
||||||
});
|
|
||||||
|
|
||||||
export type MailboxTreeItem = z.infer<typeof MailboxTreeItemBase> & {
|
|
||||||
folders?: MailboxTreeItem[];
|
|
||||||
};
|
|
||||||
|
|
||||||
export const MailboxTreeItem: z.ZodType<MailboxTreeItem> = MailboxTreeItemBase.extend({
|
|
||||||
folders: z.optional(z.lazy(() => z.array(MailboxTreeItem))),
|
|
||||||
});
|
|
||||||
|
|
||||||
export const MailboxTreeRoot = z.object({
|
|
||||||
path: z.literal('').default(''),
|
|
||||||
root: z.literal(true),
|
|
||||||
folders: z.array(MailboxTreeItem),
|
|
||||||
});
|
|
||||||
|
|
||||||
export type MailboxTreeRoot = z.infer<typeof MailboxTreeRoot>;
|
|
||||||
|
|
||||||
export interface Signature {
|
|
||||||
type: 'pkcs7';
|
|
||||||
valid: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SignedValue<T> {
|
|
||||||
value: T;
|
|
||||||
signature?: Signature;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface EmailAddress {
|
|
||||||
name?: string;
|
|
||||||
address?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface EmailAttachmentBase {
|
|
||||||
filename: string;
|
|
||||||
size: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface EmailAttachmentRemote extends EmailAttachmentBase {
|
|
||||||
part: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface EmailAttachmentLocal extends EmailAttachmentBase {
|
|
||||||
content: ArrayBuffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
export type EmailAttachment = EmailAttachmentRemote | EmailAttachmentLocal;
|
|
||||||
|
|
||||||
export interface Email {
|
|
||||||
id: string;
|
|
||||||
mailbox: string;
|
|
||||||
flags: Set<string>;
|
|
||||||
subject?: SignedValue<string>;
|
|
||||||
date: SignedValue<Date>;
|
|
||||||
from: SignedValue<EmailAddress>;
|
|
||||||
to?: SignedValue<EmailAddress>[];
|
|
||||||
cc?: SignedValue<EmailAddress>[];
|
|
||||||
bcc?: SignedValue<EmailAddress>[];
|
|
||||||
html?: SignedValue<string>;
|
|
||||||
text?: SignedValue<string>;
|
|
||||||
attachments: SignedValue<EmailAttachment>[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export type EmailMeta = Pick<Email, 'id' | 'mailbox'> & {incomplete: true};
|
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
import {Directive, Input, Host} from '@angular/core';
|
import {Directive, Input, Host} from '@angular/core';
|
||||||
import {MapComponent} from '@maplibre/ngx-maplibre-gl';
|
import {MapComponent} from '@maplibre/ngx-maplibre-gl';
|
||||||
import {environment} from '../../../environments/environment';
|
|
||||||
|
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: 'mgl-map[styleName]',
|
selector: 'mgl-map[styleName]',
|
||||||
@@ -11,7 +10,7 @@ export class MapStyleDirective {
|
|||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
set styleName(name: string) {
|
set styleName(name: string) {
|
||||||
const style = `${environment.backend_url}/_static/map/styles/${name}/style.json`;
|
const style = `https://maps.server.uni-frankfurt.de/static/styles/${name}/style.json`;
|
||||||
if (this.map.style) {
|
if (this.map.style) {
|
||||||
this.map.mapInstance.setStyle(style);
|
this.map.mapInstance.setStyle(style);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
import {ChangeDetectionStrategy, Component, ElementRef, Input} from '@angular/core';
|
import {ChangeDetectionStrategy, Component, Input} from '@angular/core';
|
||||||
import {SCIdCard} from '@openstapps/core';
|
import {SCIdCard} from '@openstapps/core';
|
||||||
|
import {FullScreenImageDirective} from '../../util/full-screen-image.directive';
|
||||||
import {ThingTranslateModule} from '../../translation/thing-translate.module';
|
import {ThingTranslateModule} from '../../translation/thing-translate.module';
|
||||||
import {AsyncPipe, TitleCasePipe} from '@angular/common';
|
import {AsyncPipe, TitleCasePipe} from '@angular/common';
|
||||||
import {IntervalIsNowPipe, ToDateIntervalPipe} from '../../util/in-range.pipe';
|
import {InRangeNowPipe, ToDateRangePipe} from '../../util/in-range.pipe';
|
||||||
import {TranslateModule} from '@ngx-translate/core';
|
import {TranslateModule} from '@ngx-translate/core';
|
||||||
import {AnimationController, ModalController} from '@ionic/angular';
|
|
||||||
import {ScreenBrightness} from '@capacitor-community/screen-brightness';
|
|
||||||
import {ScreenOrientation} from '@capacitor/screen-orientation';
|
|
||||||
import {Capacitor} from '@capacitor/core';
|
|
||||||
import {iosDuration, iosEasing, mdDuration, mdEasing} from 'src/app/animation/easings';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'stapps-id-card',
|
selector: 'stapps-id-card',
|
||||||
@@ -16,10 +12,12 @@ import {iosDuration, iosEasing, mdDuration, mdEasing} from 'src/app/animation/ea
|
|||||||
styleUrls: ['id-card.scss'],
|
styleUrls: ['id-card.scss'],
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
standalone: true,
|
standalone: true,
|
||||||
|
hostDirectives: [FullScreenImageDirective],
|
||||||
imports: [
|
imports: [
|
||||||
|
FullScreenImageDirective,
|
||||||
ThingTranslateModule,
|
ThingTranslateModule,
|
||||||
IntervalIsNowPipe,
|
InRangeNowPipe,
|
||||||
ToDateIntervalPipe,
|
ToDateRangePipe,
|
||||||
AsyncPipe,
|
AsyncPipe,
|
||||||
TranslateModule,
|
TranslateModule,
|
||||||
TitleCasePipe,
|
TitleCasePipe,
|
||||||
@@ -27,126 +25,4 @@ import {iosDuration, iosEasing, mdDuration, mdEasing} from 'src/app/animation/ea
|
|||||||
})
|
})
|
||||||
export class IdCardComponent {
|
export class IdCardComponent {
|
||||||
@Input({required: true}) item: SCIdCard;
|
@Input({required: true}) item: SCIdCard;
|
||||||
|
|
||||||
constructor(
|
|
||||||
private modalController: ModalController,
|
|
||||||
private animationController: AnimationController,
|
|
||||||
private elementRef: ElementRef,
|
|
||||||
) {}
|
|
||||||
|
|
||||||
async presentFullscreen() {
|
|
||||||
const top = await this.modalController.getTop();
|
|
||||||
const mode = document.querySelector('ion-app')!.getAttribute('mode');
|
|
||||||
if (top) return;
|
|
||||||
|
|
||||||
if (window.innerWidth >= 768) return;
|
|
||||||
|
|
||||||
if (Capacitor.isNativePlatform()) {
|
|
||||||
const orientation = await ScreenOrientation.orientation();
|
|
||||||
ScreenOrientation.lock({orientation: 'portrait'});
|
|
||||||
if (orientation.type.startsWith('landscape')) {
|
|
||||||
await new Promise(resolve => setTimeout(resolve, 500));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const img: HTMLImageElement = this.elementRef.nativeElement.querySelector('img')!;
|
|
||||||
|
|
||||||
const safeArea = (location: string) =>
|
|
||||||
Number(img.computedStyleMap().get(`--ion-safe-area-${location}`)!.toString().replace(/px$/, ''));
|
|
||||||
const safeAreaTop = safeArea('top');
|
|
||||||
const safeAreaBottom = safeArea('bottom');
|
|
||||||
const safeAreaLeft = safeArea('left');
|
|
||||||
const safeAreaRight = safeArea('right');
|
|
||||||
|
|
||||||
const windowWidth = window.innerWidth - safeAreaLeft - safeAreaRight;
|
|
||||||
const windowHeight = window.innerHeight - safeAreaTop - safeAreaBottom;
|
|
||||||
|
|
||||||
const isLandscape = windowWidth > windowHeight;
|
|
||||||
const nativeBounds = img.getBoundingClientRect();
|
|
||||||
const imageAspect = nativeBounds.width / nativeBounds.height;
|
|
||||||
const imgWidth = Math.min(windowHeight, windowWidth * imageAspect);
|
|
||||||
const imgHeight = imgWidth / imageAspect;
|
|
||||||
const fullscreenWidth = isLandscape ? imgHeight : imgWidth;
|
|
||||||
const fullscreenHeight = isLandscape ? imgWidth : imgHeight;
|
|
||||||
|
|
||||||
const scale = fullscreenWidth / windowWidth;
|
|
||||||
const animation = (modal: HTMLElement, leave = false) => {
|
|
||||||
const root = modal.shadowRoot!;
|
|
||||||
|
|
||||||
const sourceAnimation = this.animationController
|
|
||||||
.create()
|
|
||||||
.addElement(this.elementRef.nativeElement)
|
|
||||||
.fromTo('opacity', 0, 0);
|
|
||||||
const backdrop =
|
|
||||||
'linear-gradient(to bottom,' +
|
|
||||||
'transparent 16px,' +
|
|
||||||
'rgba(0, 0, 0, 0.3) 20%,' +
|
|
||||||
'rgba(0, 0, 0, 0.3) 80%,' +
|
|
||||||
'transparent 100%)';
|
|
||||||
const wrapperAnimation = this.animationController
|
|
||||||
.create()
|
|
||||||
.beforeStyles({'--background': 'transparent', 'margin': '0'})
|
|
||||||
.addElement(root.querySelector('.modal-wrapper')!)
|
|
||||||
.fromTo('transform', 'scale(1)', 'scale(1)')
|
|
||||||
.fromTo('opacity', '1', '1');
|
|
||||||
const backdropAnimation = this.animationController
|
|
||||||
.create()
|
|
||||||
.beforeStyles({background: backdrop, filter: 'blur(16px)'})
|
|
||||||
.addElement(root.querySelector('ion-backdrop')!)
|
|
||||||
.fromTo('opacity', leave ? 1 : 0, leave ? 0 : 1);
|
|
||||||
|
|
||||||
const small =
|
|
||||||
`translate(${nativeBounds.left - safeAreaLeft}px, ${nativeBounds.top - safeAreaTop}px) ` +
|
|
||||||
`scale(${nativeBounds.width / windowWidth}) ` +
|
|
||||||
`rotate(0) `;
|
|
||||||
const large =
|
|
||||||
`translate(${windowWidth - (windowWidth - fullscreenHeight) / 2}px, ${
|
|
||||||
(windowHeight - fullscreenWidth) / 2
|
|
||||||
}px)` +
|
|
||||||
`scale(${scale}) ` +
|
|
||||||
`rotate(${isLandscape ? 0 : 90}deg) `;
|
|
||||||
const cardAnimation = this.animationController
|
|
||||||
.create()
|
|
||||||
.addElement(modal.querySelector('stapps-id-card')!)
|
|
||||||
.beforeStyles({
|
|
||||||
'transform-origin': 'top left',
|
|
||||||
'filter': 'drop-shadow(0 0 16px rgba(0, 0, 0, 0.1))',
|
|
||||||
})
|
|
||||||
.fromTo('transform', leave ? large : small, leave ? small : large);
|
|
||||||
|
|
||||||
return this.animationController
|
|
||||||
.create()
|
|
||||||
.addElement(modal)
|
|
||||||
.easing(mode === 'ios' ? iosEasing : mdEasing)
|
|
||||||
.duration(2 * (mode === 'ios' ? iosDuration : mdDuration))
|
|
||||||
.addAnimation([wrapperAnimation, backdropAnimation, cardAnimation, sourceAnimation]);
|
|
||||||
};
|
|
||||||
|
|
||||||
const modal = await this.modalController.create({
|
|
||||||
component: IdCardComponent,
|
|
||||||
backdropDismiss: true,
|
|
||||||
mode: 'md',
|
|
||||||
componentProps: {
|
|
||||||
item: this.item,
|
|
||||||
},
|
|
||||||
presentingElement: this.elementRef.nativeElement,
|
|
||||||
enterAnimation: base => animation(base),
|
|
||||||
leaveAnimation: base => animation(base, true),
|
|
||||||
});
|
|
||||||
|
|
||||||
const dismiss = () => modal.dismiss();
|
|
||||||
window.addEventListener('click', dismiss);
|
|
||||||
modal.addEventListener('didDismiss', () => window.removeEventListener('click', dismiss));
|
|
||||||
|
|
||||||
if (Capacitor.isNativePlatform()) {
|
|
||||||
const brightness = (await ScreenBrightness.getBrightness()).brightness;
|
|
||||||
ScreenBrightness.setBrightness({brightness: 1});
|
|
||||||
modal.addEventListener('didDismiss', () => {
|
|
||||||
ScreenOrientation.unlock();
|
|
||||||
ScreenBrightness.setBrightness({brightness: brightness === 1 ? 0.5 : brightness});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
await modal.present();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
<img
|
<img [src]="item.image" [alt]="'name' | thingTranslate: item" draggable="false" />
|
||||||
[src]="item.image"
|
@if (item.validity && (item.validity | toDateRange | isInRangeNow | async) === false) {
|
||||||
[alt]="'name' | thingTranslate: item"
|
|
||||||
draggable="false"
|
|
||||||
(click)="presentFullscreen()"
|
|
||||||
/>
|
|
||||||
@if (item.validity && (item.validity | rangeToDateInterval | dfnsIntervalIsNow | async) === false) {
|
|
||||||
<div class="expired">{{ 'profile.userInfo.expired' | translate | titlecase }}</div>
|
<div class="expired">{{ 'profile.userInfo.expired' | translate | titlecase }}</div>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,11 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:host:fullscreen {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
border-radius: 3mm;
|
border-radius: 3mm;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import {IonicModule} from '@ionic/angular';
|
|||||||
import {AsyncPipe, TitleCasePipe} from '@angular/common';
|
import {AsyncPipe, TitleCasePipe} from '@angular/common';
|
||||||
import {ThingTranslateModule} from '../../translation/thing-translate.module';
|
import {ThingTranslateModule} from '../../translation/thing-translate.module';
|
||||||
import {UtilModule} from '../../util/util.module';
|
import {UtilModule} from '../../util/util.module';
|
||||||
|
import {FullScreenImageDirective} from '../../util/full-screen-image.directive';
|
||||||
import {IdCardComponent} from './id-card.component';
|
import {IdCardComponent} from './id-card.component';
|
||||||
import {TranslateModule} from '@ngx-translate/core';
|
import {TranslateModule} from '@ngx-translate/core';
|
||||||
import {Observable} from 'rxjs';
|
import {Observable} from 'rxjs';
|
||||||
@@ -35,6 +36,7 @@ import {Observable} from 'rxjs';
|
|||||||
AsyncPipe,
|
AsyncPipe,
|
||||||
ThingTranslateModule,
|
ThingTranslateModule,
|
||||||
UtilModule,
|
UtilModule,
|
||||||
|
FullScreenImageDirective,
|
||||||
IdCardComponent,
|
IdCardComponent,
|
||||||
TranslateModule,
|
TranslateModule,
|
||||||
TitleCasePipe,
|
TitleCasePipe,
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
import {Injectable} from '@angular/core';
|
import {Injectable} from '@angular/core';
|
||||||
import {SCIdCard, SCThingOriginType, SCThingType, SCUserConfiguration} from '@openstapps/core';
|
import {SCIdCard, SCThingOriginType, SCThingType, SCUserConfiguration} from '@openstapps/core';
|
||||||
import {from, of, Observable} from 'rxjs';
|
import {from, Observable, of} from 'rxjs';
|
||||||
import {AuthHelperService} from '../auth/auth-helper.service';
|
import {AuthHelperService} from '../auth/auth-helper.service';
|
||||||
import {mergeMap, concatWith, filter, map, startWith, catchError, tap} from 'rxjs/operators';
|
import {mergeMap, filter, map, startWith} from 'rxjs/operators';
|
||||||
import {ConfigProvider} from '../config/config.provider';
|
import {ConfigProvider} from '../config/config.provider';
|
||||||
import {HttpClient} from '@angular/common/http';
|
import {HttpClient} from '@angular/common/http';
|
||||||
import {EncryptedStorageProvider} from '../storage/encrypted-storage.provider';
|
|
||||||
|
|
||||||
@Injectable({providedIn: 'root'})
|
@Injectable({providedIn: 'root'})
|
||||||
export class IdCardsProvider {
|
export class IdCardsProvider {
|
||||||
@@ -13,27 +12,18 @@ export class IdCardsProvider {
|
|||||||
private authHelper: AuthHelperService,
|
private authHelper: AuthHelperService,
|
||||||
private config: ConfigProvider,
|
private config: ConfigProvider,
|
||||||
private httpClient: HttpClient,
|
private httpClient: HttpClient,
|
||||||
private encryptedStorageProvider: EncryptedStorageProvider,
|
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
getIdCards(): Observable<SCIdCard[]> {
|
getIdCards(): Observable<SCIdCard[]> {
|
||||||
const feature = this.config.config.app.features.extern?.['idCards'];
|
const feature = this.config.config.app.features.extern?.['idCards'];
|
||||||
const auth = this.authHelper.getProvider(feature?.authProvider ?? 'default');
|
const auth = this.authHelper.getProvider(feature?.authProvider ?? 'default');
|
||||||
const storedIdCards = from(
|
|
||||||
this.encryptedStorageProvider.get<SCIdCard[]>('id-cards') as Promise<SCIdCard[]>,
|
|
||||||
).pipe(filter(it => it !== undefined));
|
|
||||||
|
|
||||||
return auth.isAuthenticated$.pipe(
|
return auth.isAuthenticated$.pipe(
|
||||||
mergeMap(isAuthenticated =>
|
mergeMap(isAuthenticated =>
|
||||||
isAuthenticated
|
isAuthenticated
|
||||||
? feature
|
? feature
|
||||||
? storedIdCards.pipe(
|
? from(auth.getValidToken()).pipe(
|
||||||
concatWith(
|
|
||||||
from(auth.getValidToken()).pipe(
|
|
||||||
mergeMap(token => this.fetchIdCards(feature.url, token.accessToken)),
|
mergeMap(token => this.fetchIdCards(feature.url, token.accessToken)),
|
||||||
catchError(() => storedIdCards),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
: auth.user$.pipe(
|
: auth.user$.pipe(
|
||||||
filter(user => user !== undefined),
|
filter(user => user !== undefined),
|
||||||
@@ -41,20 +31,19 @@ export class IdCardsProvider {
|
|||||||
mergeMap(user => this.fetchFallbackIdCards(user)),
|
mergeMap(user => this.fetchFallbackIdCards(user)),
|
||||||
startWith([]),
|
startWith([]),
|
||||||
)
|
)
|
||||||
: of([]).pipe(tap({next: () => this.encryptedStorageProvider.delete('id-cards')})),
|
: // TODO: find a better solution here (async pipe stuff...)
|
||||||
|
of([]),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private fetchIdCards(url: string, token: string): Observable<SCIdCard[]> {
|
private fetchIdCards(url: string, token: string): Observable<SCIdCard[]> {
|
||||||
return this.httpClient
|
return this.httpClient.get<SCIdCard[]>(url, {
|
||||||
.get<SCIdCard[]>(url, {
|
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bearer ${token}`,
|
Authorization: `Bearer ${token}`,
|
||||||
},
|
},
|
||||||
responseType: 'json',
|
responseType: 'json',
|
||||||
})
|
});
|
||||||
.pipe(tap({next: idCards => this.encryptedStorageProvider.set('id-cards', idCards)}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fetchFallbackIdCards(user: SCUserConfiguration): Observable<SCIdCard[]> {
|
private fetchFallbackIdCards(user: SCUserConfiguration): Observable<SCIdCard[]> {
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import {HttpClient} from '@angular/common/http';
|
|||||||
import {AuthHelperService} from '../auth/auth-helper.service';
|
import {AuthHelperService} from '../auth/auth-helper.service';
|
||||||
import {BehaviorSubject, firstValueFrom, of} from 'rxjs';
|
import {BehaviorSubject, firstValueFrom, of} from 'rxjs';
|
||||||
import {SCAuthorizationProviderType} from '@openstapps/core';
|
import {SCAuthorizationProviderType} from '@openstapps/core';
|
||||||
import {EncryptedStorageProvider} from '../storage/encrypted-storage.provider';
|
|
||||||
|
|
||||||
class FakeAuth {
|
class FakeAuth {
|
||||||
isAuthenticated$ = new BehaviorSubject(false);
|
isAuthenticated$ = new BehaviorSubject(false);
|
||||||
@@ -17,7 +16,6 @@ describe('IdCards', () => {
|
|||||||
let configProvider: ConfigProvider;
|
let configProvider: ConfigProvider;
|
||||||
let httpClient: HttpClient;
|
let httpClient: HttpClient;
|
||||||
let authHelper: AuthHelperService;
|
let authHelper: AuthHelperService;
|
||||||
let encryptedStorageProvider: EncryptedStorageProvider;
|
|
||||||
let fakeAuth: FakeAuth;
|
let fakeAuth: FakeAuth;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@@ -29,14 +27,10 @@ describe('IdCards', () => {
|
|||||||
fakeAuth = new FakeAuth();
|
fakeAuth = new FakeAuth();
|
||||||
authHelper = jasmine.createSpyObj('AuthHelperService', ['getProvider']);
|
authHelper = jasmine.createSpyObj('AuthHelperService', ['getProvider']);
|
||||||
authHelper.getProvider = jasmine.createSpy().and.returnValue(fakeAuth);
|
authHelper.getProvider = jasmine.createSpy().and.returnValue(fakeAuth);
|
||||||
encryptedStorageProvider = jasmine.createSpyObj('EncryptedStorageProvider', ['get', 'set', 'delete']);
|
|
||||||
encryptedStorageProvider.get = jasmine.createSpy().and.resolveTo();
|
|
||||||
encryptedStorageProvider.set = jasmine.createSpy().and.resolveTo();
|
|
||||||
encryptedStorageProvider.delete = jasmine.createSpy().and.resolveTo();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should emit undefined if not logged in', async () => {
|
it('should emit undefined if not logged in', async () => {
|
||||||
const provider = new IdCardsProvider(authHelper, configProvider, httpClient, encryptedStorageProvider);
|
const provider = new IdCardsProvider(authHelper, configProvider, httpClient);
|
||||||
expect(await firstValueFrom(provider.getIdCards())).toEqual([]);
|
expect(await firstValueFrom(provider.getIdCards())).toEqual([]);
|
||||||
expect(authHelper.getProvider).toHaveBeenCalledOnceWith('fakeAuth' as SCAuthorizationProviderType);
|
expect(authHelper.getProvider).toHaveBeenCalledOnceWith('fakeAuth' as SCAuthorizationProviderType);
|
||||||
});
|
});
|
||||||
@@ -45,7 +39,7 @@ describe('IdCards', () => {
|
|||||||
fakeAuth.isAuthenticated$.next(true);
|
fakeAuth.isAuthenticated$.next(true);
|
||||||
httpClient.get = jasmine.createSpy().and.returnValue(of(['abc']));
|
httpClient.get = jasmine.createSpy().and.returnValue(of(['abc']));
|
||||||
fakeAuth.getValidToken = jasmine.createSpy().and.resolveTo({accessToken: 'fake-token'});
|
fakeAuth.getValidToken = jasmine.createSpy().and.resolveTo({accessToken: 'fake-token'});
|
||||||
const provider = new IdCardsProvider(authHelper, configProvider, httpClient, encryptedStorageProvider);
|
const provider = new IdCardsProvider(authHelper, configProvider, httpClient);
|
||||||
expect(await firstValueFrom(provider.getIdCards())).toEqual(['abc' as never]);
|
expect(await firstValueFrom(provider.getIdCards())).toEqual(['abc' as never]);
|
||||||
expect(authHelper.getProvider).toHaveBeenCalledOnceWith('fakeAuth' as SCAuthorizationProviderType);
|
expect(authHelper.getProvider).toHaveBeenCalledOnceWith('fakeAuth' as SCAuthorizationProviderType);
|
||||||
// eslint-disable-next-line unicorn/no-null
|
// eslint-disable-next-line unicorn/no-null
|
||||||
@@ -58,7 +52,7 @@ describe('IdCards', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should react to logins', async () => {
|
it('should react to logins', async () => {
|
||||||
const provider = new IdCardsProvider(authHelper, configProvider, httpClient, encryptedStorageProvider);
|
const provider = new IdCardsProvider(authHelper, configProvider, httpClient);
|
||||||
const observable = provider.getIdCards();
|
const observable = provider.getIdCards();
|
||||||
expect(await firstValueFrom(observable)).toEqual([]);
|
expect(await firstValueFrom(observable)).toEqual([]);
|
||||||
httpClient.get = jasmine.createSpy().and.returnValue(of(['abc']));
|
httpClient.get = jasmine.createSpy().and.returnValue(of(['abc']));
|
||||||
|
|||||||
@@ -39,11 +39,6 @@
|
|||||||
}
|
}
|
||||||
<ion-label>{{ 'name' | translateSimple: link }}</ion-label>
|
<ion-label>{{ 'name' | translateSimple: link }}</ion-label>
|
||||||
</div>
|
</div>
|
||||||
@if (link.beta) {
|
|
||||||
<ion-note>
|
|
||||||
<ion-badge color="warning">{{ 'beta' | translate }}</ion-badge>
|
|
||||||
</ion-note>
|
|
||||||
}
|
|
||||||
</ion-item>
|
</ion-item>
|
||||||
}
|
}
|
||||||
</simple-swiper>
|
</simple-swiper>
|
||||||
|
|||||||
@@ -50,13 +50,6 @@ ion-item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ion-note {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
padding: var(--spacing-xs);
|
|
||||||
}
|
|
||||||
|
|
||||||
simple-swiper {
|
simple-swiper {
|
||||||
--swiper-slide-width: #{$width};
|
--swiper-slide-width: #{$width};
|
||||||
|
|
||||||
|
|||||||
@@ -1,92 +0,0 @@
|
|||||||
import {Injectable} from '@angular/core';
|
|
||||||
import {StorageProvider} from './storage.provider';
|
|
||||||
import {Capacitor} from '@capacitor/core';
|
|
||||||
import {SecureStoragePlugin} from 'capacitor-secure-storage-plugin';
|
|
||||||
|
|
||||||
@Injectable({providedIn: 'root'})
|
|
||||||
export class EncryptedStorageProvider {
|
|
||||||
constructor(private storageProvider: StorageProvider) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve a large value from an encrypted storage
|
|
||||||
* Also returns undefined if a secure context is not available (i.e. web).
|
|
||||||
* @param key Unique identifier of the wanted resource in storage
|
|
||||||
* @returns The value of the resource, if found
|
|
||||||
*/
|
|
||||||
async get<T>(key: string): Promise<T | undefined> {
|
|
||||||
if (!Capacitor.isNativePlatform()) return undefined;
|
|
||||||
|
|
||||||
try {
|
|
||||||
const jwt = JSON.parse((await SecureStoragePlugin.get({key: `stapps:key:${key}`})).value);
|
|
||||||
const aesKey = await crypto.subtle.importKey('jwk', jwt, {name: 'AES-GCM'}, true, [
|
|
||||||
'encrypt',
|
|
||||||
'decrypt',
|
|
||||||
]);
|
|
||||||
const iv = await this.storageProvider.get<ArrayBuffer>(`encrypted:${key}:iv`);
|
|
||||||
|
|
||||||
const encryptedIdCards = await this.storageProvider.get<ArrayBuffer>(`encrypted:${key}`);
|
|
||||||
const decrypted = await crypto.subtle.decrypt({name: 'AES-GCM', iv}, aesKey, encryptedIdCards);
|
|
||||||
|
|
||||||
const decompressionStream = new DecompressionStream('gzip');
|
|
||||||
const writer = decompressionStream.writable.getWriter();
|
|
||||||
writer.write(decrypted);
|
|
||||||
writer.close();
|
|
||||||
|
|
||||||
const decompressed = await new Response(decompressionStream.readable).arrayBuffer();
|
|
||||||
return JSON.parse(new TextDecoder().decode(decompressed));
|
|
||||||
} catch (error) {
|
|
||||||
console.warn(error);
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Store a large value in an encrypted storage
|
|
||||||
* Does nothing if a secure context is not available (i.e. web).
|
|
||||||
* @param key Unique identifier of the resource in storage
|
|
||||||
* @param value The value to store
|
|
||||||
* @returns A promise that resolves when the value is stored
|
|
||||||
*/
|
|
||||||
async set<T>(key: string, value: T): Promise<void> {
|
|
||||||
if (!Capacitor.isNativePlatform()) return undefined;
|
|
||||||
|
|
||||||
try {
|
|
||||||
const compressionStream = new CompressionStream('gzip');
|
|
||||||
const writer = compressionStream.writable.getWriter();
|
|
||||||
writer.write(new TextEncoder().encode(JSON.stringify(value)));
|
|
||||||
writer.close();
|
|
||||||
const encoded = await new Response(compressionStream.readable).arrayBuffer();
|
|
||||||
|
|
||||||
const iv = crypto.getRandomValues(new Uint8Array(16));
|
|
||||||
const aesKey = await crypto.subtle.generateKey({name: 'AES-GCM', length: 256}, true, [
|
|
||||||
'encrypt',
|
|
||||||
'decrypt',
|
|
||||||
]);
|
|
||||||
|
|
||||||
await Promise.all([
|
|
||||||
SecureStoragePlugin.set({
|
|
||||||
key: `stapps:key:${key}`,
|
|
||||||
value: JSON.stringify(await crypto.subtle.exportKey('jwk', aesKey)),
|
|
||||||
}),
|
|
||||||
this.storageProvider.put(`encrypted:${key}:iv`, iv),
|
|
||||||
]);
|
|
||||||
|
|
||||||
this.storageProvider.put<ArrayBuffer>(
|
|
||||||
`encrypted:${key}`,
|
|
||||||
await crypto.subtle.encrypt({name: 'AES-GCM', iv}, aesKey, encoded),
|
|
||||||
);
|
|
||||||
} catch (error) {
|
|
||||||
alert(error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async delete(key: string): Promise<void> {
|
|
||||||
if (!Capacitor.isNativePlatform()) return;
|
|
||||||
|
|
||||||
await Promise.all([
|
|
||||||
SecureStoragePlugin.remove({key: `stapps:key:${key}`}),
|
|
||||||
this.storageProvider.delete(`encrypted:${key}:iv`),
|
|
||||||
this.storageProvider.delete(`encrypted:${key}`),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
import {Pipe, PipeTransform} from '@angular/core';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Format a data size in bytes to a human readable string
|
|
||||||
*/
|
|
||||||
export function formatDataSize(value: number, precision = 2): string {
|
|
||||||
const units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
||||||
let unit = 0;
|
|
||||||
while (value >= 1024 && unit < units.length - 1) {
|
|
||||||
value /= 1024;
|
|
||||||
unit++;
|
|
||||||
}
|
|
||||||
return `${value.toFixed(precision)} ${units[unit]}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Pipe({
|
|
||||||
name: 'dataSize',
|
|
||||||
pure: true,
|
|
||||||
standalone: true,
|
|
||||||
})
|
|
||||||
export class DataSizePipe implements PipeTransform {
|
|
||||||
transform(value: number, precision = 2): string {
|
|
||||||
return formatDataSize(value, precision);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import {Pipe, PipeTransform} from '@angular/core';
|
import {Pipe, PipeTransform} from '@angular/core';
|
||||||
import {SCRange, isInRange, SCISO8601DateRange} from '@openstapps/core';
|
import {SCRange, isInRange, SCISO8601DateRange} from '@openstapps/core';
|
||||||
import {NormalizedInterval, differenceInMilliseconds, interval, isEqual} from 'date-fns';
|
import {merge, Observable, timer} from 'rxjs';
|
||||||
import {EMPTY, Observable, SchedulerLike, asyncScheduler, concat, defer, map, of, timer} from 'rxjs';
|
import {distinctUntilChanged, map, startWith} from 'rxjs/operators';
|
||||||
|
|
||||||
@Pipe({
|
@Pipe({
|
||||||
name: 'isInRange',
|
name: 'isInRange',
|
||||||
@@ -14,49 +14,28 @@ export class InRangePipe implements PipeTransform {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const MIN_DATE = new Date(0);
|
|
||||||
export const MAX_DATE = new Date(1e15);
|
|
||||||
|
|
||||||
@Pipe({
|
@Pipe({
|
||||||
name: 'rangeToDateInterval',
|
name: 'toDateRange',
|
||||||
pure: true,
|
pure: true,
|
||||||
standalone: true,
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class ToDateIntervalPipe implements PipeTransform {
|
export class ToDateRangePipe implements PipeTransform {
|
||||||
transform(value: SCISO8601DateRange): NormalizedInterval {
|
transform(value: SCISO8601DateRange): SCRange<Date> {
|
||||||
return interval(new Date(value.gte ?? value.gt ?? MIN_DATE), new Date(value.lte ?? value.lt ?? MAX_DATE));
|
return Object.fromEntries(Object.entries(value).map(([key, value]) => [key, new Date(value)]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Pipe({
|
||||||
* Returns an Observable that will change its value when the current date is within the given interval.
|
name: 'isInRangeNow',
|
||||||
*/
|
pure: true,
|
||||||
export function isWithinIntervalObservable(
|
standalone: true,
|
||||||
value: NormalizedInterval,
|
})
|
||||||
scheduler: SchedulerLike = asyncScheduler,
|
export class InRangeNowPipe implements PipeTransform {
|
||||||
): Observable<boolean> {
|
transform(value: SCRange<Date>): Observable<boolean> {
|
||||||
return defer(() => {
|
return merge(timer(value.lte || value.lt || 0), timer(value.gte || value.gt || 0)).pipe(
|
||||||
const now = scheduler.now();
|
startWith(0),
|
||||||
const activate = differenceInMilliseconds(value.start, now);
|
map(() => isInRange(new Date(), value)),
|
||||||
const deactivate = differenceInMilliseconds(value.end, now);
|
distinctUntilChanged(),
|
||||||
|
|
||||||
return concat(
|
|
||||||
of(activate <= 0 && deactivate > 0),
|
|
||||||
activate <= 0 ? EMPTY : timer(value.start, scheduler).pipe(map(() => true)),
|
|
||||||
isEqual(value.end, MAX_DATE) || deactivate <= 0
|
|
||||||
? EMPTY
|
|
||||||
: timer(value.end, scheduler).pipe(map(() => false)),
|
|
||||||
);
|
);
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Pipe({
|
|
||||||
name: 'dfnsIntervalIsNow',
|
|
||||||
pure: true,
|
|
||||||
standalone: true,
|
|
||||||
})
|
|
||||||
export class IntervalIsNowPipe implements PipeTransform {
|
|
||||||
transform(value: NormalizedInterval): Observable<boolean> {
|
|
||||||
return isWithinIntervalObservable(value);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,42 +0,0 @@
|
|||||||
import {TestScheduler} from 'rxjs/testing';
|
|
||||||
import {MAX_DATE, MIN_DATE, isWithinIntervalObservable} from './in-range.pipe';
|
|
||||||
import {interval} from 'date-fns';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test macro
|
|
||||||
*/
|
|
||||||
function test(range: [number | undefined, number | undefined], subscribe: string, expected: string) {
|
|
||||||
const testScheduler = new TestScheduler((actual, expected) => {
|
|
||||||
expect(actual).withContext(actual.map(JSON.stringify).join('\n')).toEqual(expected);
|
|
||||||
});
|
|
||||||
|
|
||||||
it(`should emit "${expected}" when "${subscribe}" for range ${range[0] ?? ''}..${range[1] ?? ''}`, () => {
|
|
||||||
testScheduler.run(({expectObservable}) => {
|
|
||||||
expectObservable(
|
|
||||||
isWithinIntervalObservable(
|
|
||||||
interval(new Date(range[0] ?? MIN_DATE), new Date(range[1] ?? MAX_DATE)),
|
|
||||||
testScheduler,
|
|
||||||
),
|
|
||||||
subscribe,
|
|
||||||
).toBe(expected, {t: true, f: false});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
describe('isWithinIntervalObservable', () => {
|
|
||||||
test([500, undefined], '1s ^', '1s (t|)');
|
|
||||||
test([1000, undefined], '500ms ^', '500ms f 499ms (t|)');
|
|
||||||
|
|
||||||
test([undefined, 500], '1s ^', '1s (f|)');
|
|
||||||
test([undefined, 1000], '500ms ^', '500ms t 499ms (f|)');
|
|
||||||
|
|
||||||
test([1000, 2000], '500ms ^', '500ms f 499ms t 999ms (f|)');
|
|
||||||
|
|
||||||
test([500, 1000], '1500ms ^', '1500ms (f|)');
|
|
||||||
test([500, 1000], '1s ^', '1000ms (f|)');
|
|
||||||
test([500, 1000], '999ms ^', '999ms t (f|)');
|
|
||||||
test([500, 1000], '500ms ^', '500ms t 499ms (f|)');
|
|
||||||
test([500, 1000], '499ms ^', '499ms f t 499ms (f|)');
|
|
||||||
|
|
||||||
test([500, 1000], '^ 750ms !', 'f 499ms t');
|
|
||||||
});
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
import {OnDestroy, Pipe, PipeTransform} from '@angular/core';
|
|
||||||
import {Observable, Subject, mergeMap} from 'rxjs';
|
|
||||||
|
|
||||||
@Pipe({
|
|
||||||
name: 'lazyLoad',
|
|
||||||
pure: true,
|
|
||||||
standalone: true,
|
|
||||||
})
|
|
||||||
export class LazyLoadPipe implements PipeTransform, OnDestroy {
|
|
||||||
intersectionObserver?: IntersectionObserver;
|
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
transform<T>(value: Observable<T>, element: any): Observable<T> {
|
|
||||||
if (element.el instanceof Element) {
|
|
||||||
const isInView = new Subject<void>();
|
|
||||||
this.intersectionObserver?.disconnect();
|
|
||||||
this.intersectionObserver = new IntersectionObserver(entries => {
|
|
||||||
if (entries.some(it => it.isIntersecting)) {
|
|
||||||
this.intersectionObserver?.disconnect();
|
|
||||||
delete this.intersectionObserver;
|
|
||||||
isInView.next();
|
|
||||||
isInView.complete();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.intersectionObserver.observe(element.el);
|
|
||||||
return isInView.pipe(mergeMap(() => value));
|
|
||||||
} else {
|
|
||||||
console.error('LazyLoadPipe: not an element', element);
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnDestroy() {
|
|
||||||
this.intersectionObserver?.disconnect();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
import {NgTemplateOutlet} from '@angular/common';
|
|
||||||
import {
|
|
||||||
ChangeDetectionStrategy,
|
|
||||||
Component,
|
|
||||||
ContentChild,
|
|
||||||
ElementRef,
|
|
||||||
OnDestroy,
|
|
||||||
OnInit,
|
|
||||||
Renderer2,
|
|
||||||
TemplateRef,
|
|
||||||
signal,
|
|
||||||
} from '@angular/core';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'stapps-lazy',
|
|
||||||
templateUrl: 'lazy.html',
|
|
||||||
styleUrl: 'lazy.scss',
|
|
||||||
standalone: true,
|
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
||||||
imports: [NgTemplateOutlet],
|
|
||||||
})
|
|
||||||
export class LazyComponent implements OnInit, OnDestroy {
|
|
||||||
@ContentChild(TemplateRef) template!: TemplateRef<void>;
|
|
||||||
|
|
||||||
isIntersecting = signal(false);
|
|
||||||
|
|
||||||
intersectionObserver = new IntersectionObserver(entries => {
|
|
||||||
this.isIntersecting.set(this.isIntersecting() || entries.some(entry => entry.isIntersecting));
|
|
||||||
if (this.isIntersecting()) {
|
|
||||||
this.intersectionObserver.disconnect();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
constructor(
|
|
||||||
readonly element: ElementRef,
|
|
||||||
readonly renderer: Renderer2,
|
|
||||||
) {}
|
|
||||||
|
|
||||||
ngOnInit() {
|
|
||||||
this.intersectionObserver.observe(this.element.nativeElement);
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnDestroy() {
|
|
||||||
this.intersectionObserver.disconnect();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
@if (isIntersecting()) {
|
|
||||||
<ng-container *ngTemplateOutlet="template"></ng-container>
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
import {EMPTY, Observable, concat, defer, of} from 'rxjs';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Turns an IDBCursorWithValue into an Observable of values.
|
|
||||||
*
|
|
||||||
* Values are emitted lazily, i.e. the next value is only emitted when the
|
|
||||||
* previous one has been consumed.
|
|
||||||
* @example fromCursor(cursor).pipe(take(10)).subscribe(console.log);
|
|
||||||
*/
|
|
||||||
export function fromCursor<T>(cursor: IDBCursorWithValue): Observable<T> {
|
|
||||||
if (cursor.key === null) {
|
|
||||||
return EMPTY;
|
|
||||||
}
|
|
||||||
|
|
||||||
const value = cursor.value as T;
|
|
||||||
cursor.continue();
|
|
||||||
|
|
||||||
return concat(
|
|
||||||
of(value),
|
|
||||||
defer(() => fromCursor<T>(cursor)),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
import {Directive, ElementRef, Host, Input} from '@angular/core';
|
|
||||||
import {sanitize} from 'dompurify';
|
|
||||||
|
|
||||||
@Directive({
|
|
||||||
selector: '[shadowHTML]',
|
|
||||||
standalone: true,
|
|
||||||
})
|
|
||||||
export class ShadowHtmlDirective {
|
|
||||||
@Input({required: true})
|
|
||||||
set shadowHTML(content: string) {
|
|
||||||
this.shadowRoot.innerHTML = '';
|
|
||||||
this.shadowRoot.append(sanitize(content, {RETURN_DOM_FRAGMENT: true, USE_PROFILES: {html: true}}));
|
|
||||||
}
|
|
||||||
|
|
||||||
shadowRoot = (this.elementRef.nativeElement as HTMLElement).attachShadow({mode: 'open'});
|
|
||||||
|
|
||||||
constructor(@Host() readonly elementRef: ElementRef) {}
|
|
||||||
}
|
|
||||||
@@ -8,7 +8,6 @@
|
|||||||
"export": "Exportieren",
|
"export": "Exportieren",
|
||||||
"share": "Teilen",
|
"share": "Teilen",
|
||||||
"timeSuffix": "Uhr",
|
"timeSuffix": "Uhr",
|
||||||
"beta": "Beta",
|
|
||||||
"ratings": {
|
"ratings": {
|
||||||
"thank_you": "Vielen Dank für die Bewertung!"
|
"thank_you": "Vielen Dank für die Bewertung!"
|
||||||
},
|
},
|
||||||
@@ -337,15 +336,11 @@
|
|||||||
"title": "Titel",
|
"title": "Titel",
|
||||||
"about": "Mehr Informationen",
|
"about": "Mehr Informationen",
|
||||||
"label": "Signatur",
|
"label": "Signatur",
|
||||||
"starttime": "Vorgemerkt am",
|
|
||||||
"endtime": "Abzuholen bis",
|
"endtime": "Abzuholen bis",
|
||||||
"storage": "Abholtheke",
|
"storage": "Abholbereit"
|
||||||
"queue": "Position in der Warteschlange"
|
|
||||||
},
|
},
|
||||||
"holds": "Bestellungen",
|
"holds": "Bestellungen",
|
||||||
"reservations": "Vormerkungen",
|
"reservations": "Vormerkungen"
|
||||||
"ordered": "Bestellt",
|
|
||||||
"ready": "Abholbereit"
|
|
||||||
},
|
},
|
||||||
"checked_out": {
|
"checked_out": {
|
||||||
"title": "Deine Ausleihen",
|
"title": "Deine Ausleihen",
|
||||||
@@ -353,7 +348,7 @@
|
|||||||
"title": "Titel",
|
"title": "Titel",
|
||||||
"about": "Mehr Informationen",
|
"about": "Mehr Informationen",
|
||||||
"label": "Signatur",
|
"label": "Signatur",
|
||||||
"duedate": "Leihfristende",
|
"endtime": "Leihfristende",
|
||||||
"renewals": "Verlängerungen"
|
"renewals": "Verlängerungen"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -387,35 +382,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mail": {
|
|
||||||
"SIGNATURE_VALID": "Signatur gültig",
|
|
||||||
"SIGNATURE_INVALID": "Signatur ungültig",
|
|
||||||
"SIGNATURE_UNSUPPORTED": "Signatur nicht unterstützt",
|
|
||||||
"ID": "ID",
|
|
||||||
"FROM": "von",
|
|
||||||
"SENDER": "Absender",
|
|
||||||
"TO": "an",
|
|
||||||
"DATE": "Datum",
|
|
||||||
"login": {
|
|
||||||
"TITLE": "E-Mail Login",
|
|
||||||
"LOGIN": "Login",
|
|
||||||
"PLACEHOLDER_USERNAME": "Nutzername",
|
|
||||||
"PLACEHOLDER_PASSWORD": "Passwort",
|
|
||||||
"error": {
|
|
||||||
"INVALID_CREDENTIALS": "ungültige Zugangsdaten"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"mailboxes": {
|
|
||||||
"\\Inbox": "Posteingang",
|
|
||||||
"\\All": "Alle",
|
|
||||||
"\\Archive": "Archiv",
|
|
||||||
"\\Drafts": "Entwürfe",
|
|
||||||
"\\Flagged": "Markiert",
|
|
||||||
"\\Junk": "Spam",
|
|
||||||
"\\Sent": "Gesendet",
|
|
||||||
"\\Trash": "Papierkorb"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"menu": {
|
"menu": {
|
||||||
"context": {
|
"context": {
|
||||||
"title": "Kontext Menü",
|
"title": "Kontext Menü",
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
"back": "back",
|
"back": "back",
|
||||||
"export": "Export",
|
"export": "Export",
|
||||||
"share": "Share",
|
"share": "Share",
|
||||||
"beta": "beta",
|
|
||||||
"timeSuffix": "",
|
"timeSuffix": "",
|
||||||
"ratings": {
|
"ratings": {
|
||||||
"thank_you": "Thank you for your feedback!"
|
"thank_you": "Thank you for your feedback!"
|
||||||
@@ -337,15 +336,11 @@
|
|||||||
"title": "Title",
|
"title": "Title",
|
||||||
"about": "More information",
|
"about": "More information",
|
||||||
"label": "Shelfmark",
|
"label": "Shelfmark",
|
||||||
"starttime": "Reserved on",
|
|
||||||
"endtime": "Available for pickup until",
|
"endtime": "Available for pickup until",
|
||||||
"storage": "Pickup counter",
|
"storage": "Available for pickup"
|
||||||
"queue": "Position in the queue"
|
|
||||||
},
|
},
|
||||||
"holds": "orders",
|
"holds": "orders",
|
||||||
"reservations": "reservations",
|
"reservations": "reservations"
|
||||||
"ordered": "Ordered",
|
|
||||||
"ready": "Ready for pickup"
|
|
||||||
},
|
},
|
||||||
"checked_out": {
|
"checked_out": {
|
||||||
"title": "checked out items",
|
"title": "checked out items",
|
||||||
@@ -353,7 +348,7 @@
|
|||||||
"title": "Title",
|
"title": "Title",
|
||||||
"about": "More information",
|
"about": "More information",
|
||||||
"label": "Label",
|
"label": "Label",
|
||||||
"duedate": "Due date",
|
"endtime": "Due date",
|
||||||
"renewals": "Renewals"
|
"renewals": "Renewals"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -387,35 +382,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mail": {
|
|
||||||
"SIGNATURE_VALID": "signature valid",
|
|
||||||
"SIGNATURE_INVALID": "signature invalid",
|
|
||||||
"SIGNATURE_UNSUPPORTED": "signature unsupported",
|
|
||||||
"ID": "ID",
|
|
||||||
"FROM": "from",
|
|
||||||
"SENDER": "sender",
|
|
||||||
"TO": "to",
|
|
||||||
"DATE": "date",
|
|
||||||
"login": {
|
|
||||||
"TITLE": "email login",
|
|
||||||
"LOGIN": "login",
|
|
||||||
"PLACEHOLDER_USERNAME": "username",
|
|
||||||
"PLACEHOLDER_PASSWORD": "password",
|
|
||||||
"error": {
|
|
||||||
"INVALID_CREDENTIALS": "invalid credentials"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"mailboxes": {
|
|
||||||
"\\Inbox": "inbox",
|
|
||||||
"\\All": "all inboxes",
|
|
||||||
"\\Archive": "archive",
|
|
||||||
"\\Drafts": "drafts",
|
|
||||||
"\\Flagged": "flagged",
|
|
||||||
"\\Junk": "spam",
|
|
||||||
"\\Sent": "sent",
|
|
||||||
"\\Trash": "trash"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"menu": {
|
"menu": {
|
||||||
"context": {
|
"context": {
|
||||||
"title": "context menu",
|
"title": "context menu",
|
||||||
|
|||||||
Binary file not shown.
@@ -49,7 +49,6 @@ export interface SCSectionLink extends SCThing {
|
|||||||
link: string[];
|
link: string[];
|
||||||
needsAuth?: true;
|
needsAuth?: true;
|
||||||
icon?: string;
|
icon?: string;
|
||||||
beta?: true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SCSection extends SCThing {
|
export interface SCSection extends SCThing {
|
||||||
@@ -151,18 +150,6 @@ export const profilePageSections: SCSection[] = [
|
|||||||
},
|
},
|
||||||
...SCSectionLinkConstantValues,
|
...SCSectionLinkConstantValues,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'Mail',
|
|
||||||
icon: SCIcon.mail,
|
|
||||||
link: ['/mail'],
|
|
||||||
beta: true,
|
|
||||||
translations: {
|
|
||||||
de: {
|
|
||||||
name: 'Email',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
...SCSectionLinkConstantValues,
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
translations: {
|
translations: {
|
||||||
de: {
|
de: {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export const environment = {
|
|||||||
backend_url: 'https://mobile.server.uni-frankfurt.de',
|
backend_url: 'https://mobile.server.uni-frankfurt.de',
|
||||||
app_host: 'mobile.app.uni-frankfurt.de',
|
app_host: 'mobile.app.uni-frankfurt.de',
|
||||||
custom_url_scheme: 'de.anyschool.app',
|
custom_url_scheme: 'de.anyschool.app',
|
||||||
backend_version: '3.3.0',
|
backend_version: '3.1.0',
|
||||||
production: true,
|
production: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export const environment = {
|
|||||||
backend_url: 'https://mobile.server.uni-frankfurt.de',
|
backend_url: 'https://mobile.server.uni-frankfurt.de',
|
||||||
app_host: 'mobile.app.uni-frankfurt.de',
|
app_host: 'mobile.app.uni-frankfurt.de',
|
||||||
custom_url_scheme: 'de.anyschool.app',
|
custom_url_scheme: 'de.anyschool.app',
|
||||||
backend_version: '999.0.0',
|
backend_version: '3.1.0',
|
||||||
production: false,
|
production: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<meta name="format-detection" content="telephone=no" />
|
<meta name="format-detection" content="telephone=no" />
|
||||||
<meta name="msapplication-tap-highlight" content="no" />
|
<meta name="msapplication-tap-highlight" content="no" />
|
||||||
|
|
||||||
<link rel="icon" type="image/png" href="./assets/icon/favicon.png" />
|
<link rel="icon" type="image/png" href="assets/icon/favicon.png" />
|
||||||
|
|
||||||
<!-- add to homescreen for ios -->
|
<!-- add to homescreen for ios -->
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||||
|
|||||||
@@ -18,15 +18,15 @@
|
|||||||
@import './dark';
|
@import './dark';
|
||||||
|
|
||||||
@function to-rgb($color) {
|
@function to-rgb($color) {
|
||||||
@return color.red($color) + ',' + color.green($color) + ',' + color.blue($color);
|
@return red($color) + ',' + green($color) + ',' + blue($color);
|
||||||
}
|
}
|
||||||
|
|
||||||
@function to-shade($color) {
|
@function to-shade($color) {
|
||||||
@return color.adjust($color, $lightness: -$shade-amount);
|
@return darken($color, $shade-amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
@function to-tint($color) {
|
@function to-tint($color) {
|
||||||
@return color.adjust($color, $lightness: $tint-amount);
|
@return lighten($color, $tint-amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
@function to-contrast($color) {
|
@function to-contrast($color) {
|
||||||
@@ -35,11 +35,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@function fade($color, $amount) {
|
@function fade($color, $amount) {
|
||||||
@return if(
|
@return if(lightness($color) > $fade-threshold, darken($color, $amount), lighten($color, $amount));
|
||||||
color.lightness($color) > $fade-threshold,
|
|
||||||
color.adjust($color, $lightness: -$amount),
|
|
||||||
color.adjust($color, $lightness: $amount)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@function map-range($value, $input-min, $input-max, $output-min, $output-max) {
|
@function map-range($value, $input-min, $input-max, $output-min, $output-max) {
|
||||||
@@ -48,9 +44,9 @@
|
|||||||
|
|
||||||
@function interpolate-colors($from, $to, $progress, $progress-min: 0, $progress-max: 100) {
|
@function interpolate-colors($from, $to, $progress, $progress-min: 0, $progress-max: 100) {
|
||||||
@return rgb(
|
@return rgb(
|
||||||
map-range($progress, $progress-min, $progress-max, color.red($from), color.red($to)),
|
map-range($progress, $progress-min, $progress-max, red($from), red($to)),
|
||||||
map-range($progress, $progress-min, $progress-max, color.green($from), color.green($to)),
|
map-range($progress, $progress-min, $progress-max, green($from), green($to)),
|
||||||
map-range($progress, $progress-min, $progress-max, color.blue($from), color.blue($to))
|
map-range($progress, $progress-min, $progress-max, blue($from), blue($to))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user