IframeBridgeProtocol
- Description:
Gemeinsames Protokoll für Message-Validierung und -Erzeugung. Wird intern von Host und Client genutzt.
- Source:
Members
(static) LEGACY_TYPE_MAP :Object.<string, string>
- Description:
Mapping von alten Message-Typen auf neue Namespace:Action-Typen. Ermöglicht Abwärtskompatibilität während der Migration.
- Source:
Mapping von alten Message-Typen auf neue Namespace:Action-Typen. Ermöglicht Abwärtskompatibilität während der Migration.
Type:
- Object.<string, string>
(static) MARKER :string
- Description:
Marker-Feld zur Erkennung von Bridge-Messages
- Source:
Marker-Feld zur Erkennung von Bridge-Messages
Type:
- string
(static) VERSION :string
- Description:
Bridge-Protokollversion
- Source:
Bridge-Protokollversion
Type:
- string
Methods
(static) convertLegacyMessage(data) → {Object|null}
- Description:
Konvertiert eine Legacy-Message in das neue Format. Gibt null zurück wenn keine Konvertierung möglich ist.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Object | Das rohe event.data-Objekt (ohne _bridge) |
Returns:
Konvertierte Message oder null
- Type
- Object | null
(static) createMessage(type, payloadopt, sourceIdopt) → {Object}
- Description:
Erzeugt ein standardisiertes Message-Objekt.
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
type |
string | Hierarchischer Typ im Format NAMESPACE:ACTION |
||
payload |
Object |
<optional> |
{}
|
Beliebiges Datenobjekt |
sourceId |
string |
<optional> |
''
|
Eindeutige Absender-Kennung |
Returns:
- Type
- Object
(static) isValidMessage(data) → {boolean}
- Description:
Prüft ob ein eingehendes Datenobjekt eine gültige Bridge-Message ist.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
data |
* | Das rohe event.data-Objekt |
Returns:
- Type
- boolean