Fixing all the stuff

This commit is contained in:
Daniel Kluge
2023-12-09 17:45:36 +01:00
parent e6c5e739bd
commit d7aa44228f
5 changed files with 41 additions and 26 deletions
+4 -2
View File
@@ -191,8 +191,10 @@ export default class MultiMessageBroker {
}
}
else {
const mapping = getMapping(request.target);
mapping.forms = mapping.forms.filter((form: InterfaceForm) => form.op.toLocaleLowerCase() === request.type.toLocaleLowerCase());
// Because of references we need to clone this thing as we will modify it
const mappingOrig = getMapping(request.target);
const mapping = { ...mappingOrig };
mapping.forms = mappingOrig.forms.filter((form) => form.op.toLocaleLowerCase() === request.type.toLocaleLowerCase()) as any;
if (mapping.forms.length === 0) throw new ReferenceError(`No form found for ${(request.target as any).idShort} with operation ${request.type}`);
+3 -2
View File
@@ -1,5 +1,5 @@
import type { types } from "@aas-core-works/aas-core3.0-typescript";
import type { EndpointMetadata, InterfaceForm } from "./aidConf";
import type { EndpointMetadata, InterfaceAction, InterfaceEvent, InterfaceForm, InterfaceProperty } from "./aidConf";
/**
* Read Property Request
@@ -144,7 +144,8 @@ export type Request = GetRequest | WriteRequest | ObserveRequest | UnobserveRequ
*/
export type OnRequestCallback = (request: Request) => any & GetRequestCallback & WriteRequestCallback & ObserveRequestCallback & UnobserveRequestCallback & CallRequestCallback & AsyncStateRequestCallback & AsyncResultRequestCallback & SubscribeRequestCallback & UnsubscribeRequestCallback;
export type ConnectionConfiguration = EndpointMetadata & InterfaceForm; // Wenn Transformationen implementiert werden, dann hier anpassen
type InterfaceElement = InterfaceProperty | InterfaceAction | InterfaceEvent;
export type ConnectionConfiguration = EndpointMetadata & InterfaceElement; // Wenn Transformationen implementiert werden, dann hier anpassen
export type MMBEvent = {
type: "changed" | "event";