More setup and an example componente

This commit is contained in:
Daniel Kluge
2023-10-16 18:29:16 +02:00
parent 2bf455b44a
commit 99fd86ff95
11 changed files with 1692 additions and 74 deletions
-7
View File
@@ -1,7 +0,0 @@
import type { types } from "@aas-core-works/aas-core3.0rc02-typescript";
type AASParsingType = types.Environment | types.AssetAdministrationShell | types.Submodel;
export interface Parser<T extends AASParsingType> {
parse(): T | T[];
}
-21
View File
@@ -1,21 +0,0 @@
import { readdir, readFile } from "fs/promises";
export async function getAllAASFiles(aasPath: string): Promise<string[]> {
const files = await readdir(aasPath);
return files.filter(file => file.endsWith(".json")).map(file => `${aasPath}/${file}`);
}
export async function getAASFileContent(aasPath: string): Promise<string> {
const content = await readFile(aasPath, { encoding: "utf-8" });
return content;
}
export async function getAllAASFileContents(aasPath: string): Promise<string[]> {
const files = await getAllAASFiles(aasPath)
const content = [];
for (const file of files) {
content.push(await getAASFileContent(file));
}
return content;
}
-12
View File
@@ -1,12 +0,0 @@
import type { types } from "@aas-core-works/aas-core3.0rc02-typescript";
type AASRequestType = types.Environment | types.Submodel;
type AASResponseType = types.BasicEventElement | types.ValueList;
interface RequestTransformer<T extends AASRequestType, U> {
transform(request: T): U;
}
interface NorthboundResponseTransformer<T, U extends AASResponseType> {
transform(response: T): U;
}