Skip to content

Commit

Permalink
fix: update Angular 18.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ralfaron committed Jul 14, 2024
1 parent d849af0 commit d90177a
Show file tree
Hide file tree
Showing 13 changed files with 5,894 additions and 10,242 deletions.
70 changes: 56 additions & 14 deletions aasportal.mdx

Large diffs are not rendered by default.

Binary file modified docs/source/images/aas-portal-project.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15,932 changes: 5,751 additions & 10,181 deletions package-lock.json

Large diffs are not rendered by default.

64 changes: 32 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@
"projects/aas-portal"
],
"dependencies": {
"@angular/animations": "^18.0.4",
"@angular/common": "^18.0.4",
"@angular/compiler": "^18.0.4",
"@angular/core": "^18.0.4",
"@angular/forms": "^18.0.4",
"@angular/localize": "^18.0.4",
"@angular/platform-browser": "^18.0.4",
"@angular/platform-browser-dynamic": "^18.0.4",
"@angular/router": "^18.0.4",
"@angular/animations": "^18.1.0",
"@angular/common": "^18.1.0",
"@angular/compiler": "^18.1.0",
"@angular/core": "^18.1.0",
"@angular/forms": "^18.1.0",
"@angular/localize": "^18.1.0",
"@angular/platform-browser": "^18.1.0",
"@angular/platform-browser-dynamic": "^18.1.0",
"@angular/router": "^18.1.0",
"@babel/polyfill": "^7.4.4",
"@ng-bootstrap/ng-bootstrap": "^17.0.0",
"@ngx-translate/core": "^15.0.0",
Expand All @@ -66,11 +66,11 @@
"jwt-decode": "^4.0.0",
"lodash-es": "^4.17.21",
"lowdb": "^7.0.1",
"mongoose": "^8.4.3",
"mongoose": "^8.5.1",
"morgan": "^1.10.0",
"multer": "^1.4.5-lts.1",
"mysql2": "^3.10.1",
"node-opcua": "^2.126.0",
"mysql2": "^3.10.2",
"node-opcua": "^2.128.0",
"node-opcua-client-crawler": "^2.124.0",
"nodemailer": "^6.9.14",
"reflect-metadata": "^0.2.2",
Expand All @@ -81,25 +81,25 @@
"tsyringe": "^4.8.0",
"uuid": "^10.0.0",
"webdav": "^5.6.0",
"winston": "^3.13.0",
"winston": "^3.13.1",
"winston-daily-rotate-file": "^5.0.0",
"ws": "^8.17.1",
"ws": "^8.18.0",
"xpath": "^0.0.34",
"zone.js": "~0.14.7"
},
"devDependencies": {
"@angular-devkit/build-angular": "^18.0.5",
"@angular-eslint/builder": "18.0.1",
"@angular-eslint/eslint-plugin": "18.0.1",
"@angular-eslint/eslint-plugin-template": "18.0.1",
"@angular-eslint/schematics": "18.0.1",
"@angular-eslint/template-parser": "18.0.1",
"@angular/cli": "^18.0.5",
"@angular/compiler-cli": "^18.0.4",
"@angular-devkit/build-angular": "^18.1.0",
"@angular-eslint/builder": "18.1.0",
"@angular-eslint/eslint-plugin": "18.1.0",
"@angular-eslint/eslint-plugin-template": "18.1.0",
"@angular-eslint/schematics": "18.1.0",
"@angular-eslint/template-parser": "18.1.0",
"@angular/cli": "^18.1.0",
"@angular/compiler-cli": "^18.1.0",
"@babel/plugin-syntax-import-attributes": "^7.24.7",
"@jest/globals": "^29.7.0",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^10.0.6",
"@semantic-release/github": "^10.1.0",
"@types/bcryptjs": "^2.4.6",
"@types/bootstrap": "^5.2.10",
"@types/cors": "^2.8.17",
Expand All @@ -110,16 +110,16 @@
"@types/lodash-es": "^4.17.12",
"@types/morgan": "^1.9.9",
"@types/multer": "^1.4.11",
"@types/node": "^20.14.8",
"@types/node": "^20.14.10",
"@types/nodemailer": "^6.4.15",
"@types/supertest": "^6.0.2",
"@types/swagger-ui-express": "^4.1.6",
"@types/uuid": "^10.0.0",
"@types/ws": "^8.5.10",
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
"@types/ws": "^8.5.11",
"@typescript-eslint/eslint-plugin": "^7.16.0",
"@typescript-eslint/parser": "^7.16.0",
"babel-plugin-transform-import-meta": "^2.2.1",
"esbuild": "^0.21.5",
"esbuild": "^0.23.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
Expand All @@ -134,12 +134,12 @@
"karma-jasmine": "^5.1.0",
"karma-jasmine-html-reporter": "^2.1.0",
"karma-junit-reporter": "^2.0.1",
"ng-packagr": "^18.0.0",
"prettier": "^3.3.2",
"rimraf": "^5.0.7",
"ng-packagr": "^18.1.0",
"prettier": "^3.3.3",
"rimraf": "^6.0.1",
"semantic-release": "^24.0.0",
"supertest": "^7.0.0",
"ts-jest": "^29.1.5",
"ts-jest": "^29.2.2",
"ts-node": "^10.9.2",
"typescript": "^5.4.5"
}
Expand Down
18 changes: 9 additions & 9 deletions projects/aas-portal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^18.0.4",
"@angular/common": "^18.0.4",
"@angular/compiler": "^18.0.4",
"@angular/core": "^18.0.4",
"@angular/forms": "^18.0.4",
"@angular/localize": "^18.0.4",
"@angular/platform-browser": "^18.0.4",
"@angular/platform-browser-dynamic": "^18.0.4",
"@angular/router": "^18.0.4",
"@angular/animations": "^18.1.0",
"@angular/common": "^18.1.0",
"@angular/compiler": "^18.1.0",
"@angular/core": "^18.1.0",
"@angular/forms": "^18.1.0",
"@angular/localize": "^18.1.0",
"@angular/platform-browser": "^18.1.0",
"@angular/platform-browser-dynamic": "^18.1.0",
"@angular/router": "^18.1.0",
"@ng-bootstrap/ng-bootstrap": "^17.0.0",
"@ngx-translate/core": "^15.0.0",
"@ngx-translate/http-loader": "^8.0.0",
Expand Down
5 changes: 5 additions & 0 deletions projects/aas-portal/src/app/start/start-api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,9 @@ export class StartApiService {
`/api/v1/containers/${encodeBase64Url(endpointName)}/documents/${encodeBase64Url(id)}/hierarchy`,
);
}

/** Gets the total amount of documents. */
public getDocumentCount(): Observable<number> {
return this.http.get<number>('/api/v1/documents/count');
}
}
10 changes: 5 additions & 5 deletions projects/aas-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
"jszip": "^3.10.1",
"lodash-es": "^4.17.21",
"lowdb": "^7.0.1",
"mongoose": "^8.4.3",
"mongoose": "^8.5.0",
"morgan": "^1.10.0",
"multer": "^1.4.5-lts.1",
"mysql2": "^3.10.1",
"node-opcua": "^2.126.0",
"mysql2": "^3.10.2",
"node-opcua": "^2.128.0",
"node-opcua-client-crawler": "^2.124.0",
"nodemailer": "^6.9.14",
"reflect-metadata": "^0.2.2",
Expand All @@ -46,9 +46,9 @@
"tsyringe": "^4.8.0",
"uuid": "^10.0.0",
"webdav": "^5.6.0",
"winston": "^3.13.0",
"winston": "^3.13.1",
"winston-daily-rotate-file": "^5.0.0",
"ws": "^8.17.1",
"ws": "^8.18.0",
"xpath": "^0.0.34"
}
}
2 changes: 2 additions & 0 deletions projects/aas-server/src/app/aas-index/aas-index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import {
} from 'aas-core';

export abstract class AASIndex {
public abstract getCount(query?: string): Promise<number>;

public abstract getEndpoints(): Promise<AASEndpoint[]>;

public abstract getEndpoint(name: string): Promise<AASEndpoint>;
Expand Down
4 changes: 4 additions & 0 deletions projects/aas-server/src/app/aas-index/lowdb/lowdb-index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ export class LowDbIndex extends AASIndex {
this.promise = this.initialize();
}

public override getCount(): Promise<number> {
return Promise.resolve(this.db.data.documents.length);
}

public override async getEndpoints(): Promise<AASEndpoint[]> {
await this.promise;
return this.db.data.endpoints;
Expand Down
7 changes: 6 additions & 1 deletion projects/aas-server/src/app/aas-index/mysql/mysql-index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { AASIndex } from '../aas-index.js';
import { Variable } from '../../variable.js';
import { urlToEndpoint } from '../../configuration.js';
import { MySqlQuery } from './mysql-query.js';
import { MySqlDocument, MySqlEndpoint } from './mysql-types.js';
import { DocumentCount, MySqlDocument, MySqlEndpoint } from './mysql-types.js';

export class MySqlIndex extends AASIndex {
private readonly connection: Promise<Connection>;
Expand All @@ -25,6 +25,11 @@ export class MySqlIndex extends AASIndex {
this.connection = this.initialize();
}

public override async getCount(): Promise<number> {
return (await (await this.connection).query<DocumentCount[]>('SELECT COUNT(*) FROM `documents` AS count'))[0][0]
.count;
}

public override async getEndpoints(): Promise<AASEndpoint[]> {
return (await (await this.connection).query<MySqlEndpoint[]>('SELECT * FROM `endpoints`'))[0].map(
row =>
Expand Down
4 changes: 4 additions & 0 deletions projects/aas-server/src/app/aas-index/mysql/mysql-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ export interface MySqlElement extends RowDataPacket {
dateValue?: Date;
booleanValue?: boolean;
}

export interface DocumentCount extends RowDataPacket {
count: number;
}
4 changes: 4 additions & 0 deletions projects/aas-server/src/app/aas-provider/aas-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ export class AASProvider {
return this.index.getDocuments(cursor);
}

public async getDocumentCountAsync(filter?: string): Promise<number> {
return this.index.getCount(filter);
}

public async getDocumentAsync(id: string, name?: string): Promise<AASDocument> {
const document = await this.index.get(name, id);
const endpoint = await this.index.getEndpoint(document.endpoint);
Expand Down
16 changes: 16 additions & 0 deletions projects/aas-server/src/app/controller/documents-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,22 @@ export class DocumentsController extends AASController {
}
}

@Get('count')
@Security('bearerAuth', ['guest'])
@OperationId('getDocumentCount')
public async getDocumentCount(@Query() filter?: string): Promise<AASPage> {
try {
this.logger.start('getDocuments');
if (filter) {
filter = decodeBase64Url(filter);
}

return await this.aasProvider.getDocumentCountAsync(filter);
} finally {
this.logger.stop();
}
}

/**
* Gets the first occurrence of an AAS document with the specified identifier.
* @param id The AAS identifier.
Expand Down

0 comments on commit d90177a

Please sign in to comment.