@azure/communication-signaling
Advanced tools
Comparing version 1.0.0-beta.5 to 1.0.0-beta.6
{ | ||
"name": "@azure/communication-signaling", | ||
"version": "1.0.0-beta.5", | ||
"version": "1.0.0-beta.6", | ||
"description": "Azure Communication Signaling Client", | ||
@@ -113,4 +113,5 @@ "sdk-type": "client", | ||
"typescript": "~3.8.3", | ||
"@types/sinon": "^7.5.1" | ||
"@types/sinon": "^7.5.1", | ||
"ts-node": "^8.7.0" | ||
} | ||
} |
@@ -116,2 +116,7 @@ // Copyright (c) Microsoft Corporation. | ||
message: string; | ||
/** | ||
* Metadata of the message. | ||
*/ | ||
metadata: Record<string, string>; | ||
} | ||
@@ -129,2 +134,7 @@ | ||
/** | ||
* Metadata of the message. | ||
*/ | ||
metadata: Record<string, string>; | ||
/** | ||
@@ -131,0 +141,0 @@ * The timestamp when the message was edited. The timestamp is in RFC3339 format: |
@@ -5,5 +5,5 @@ // Copyright (c) Microsoft Corporation. | ||
export interface BasePayload { | ||
_eventId: number; | ||
eventId: number; | ||
senderId: string; | ||
recipientId: string; | ||
recipientMri: string; | ||
groupId: string; | ||
@@ -20,2 +20,3 @@ } | ||
originalArrivalTime: string; | ||
acsChatMessageMetadata: string; | ||
} | ||
@@ -32,2 +33,3 @@ | ||
originalArrivalTime: string; | ||
acsChatMessageMetadata: string; | ||
} | ||
@@ -47,2 +49,3 @@ | ||
version: string; | ||
senderDisplayName: string; | ||
originalArrivalTime: string; | ||
@@ -65,3 +68,3 @@ } | ||
export interface ChatThreadPayload { | ||
_eventId: number; | ||
eventId: number; | ||
threadId: string; | ||
@@ -68,0 +71,0 @@ version: string; |
@@ -12,3 +12,3 @@ // Copyright (c) Microsoft Corporation. | ||
pnhAppId: "AcsWeb", | ||
pnhTemplate: "AcsWeb_Chat_1.0", | ||
pnhTemplate: "AcsWeb_Chat_1.2", | ||
platform: "SPOOL", | ||
@@ -15,0 +15,0 @@ platformUIVersion: "0.0.0", |
@@ -81,3 +81,3 @@ // Copyright (c) Microsoft Corporation. | ||
} | ||
if (genericPayload === null || genericPayload._eventId !== eventId) { | ||
if (genericPayload === null || genericPayload.eventId !== eventId) { | ||
return undefined; | ||
@@ -102,3 +102,3 @@ } | ||
senderDisplayName: payload.senderDisplayName, | ||
recipient: constructIdentifierKindFromMri(`8:${payload.recipientId}`), // TODO: Need to fix this inconsistency in CNS/PNH | ||
recipient: constructIdentifierKindFromMri(payload.recipientMri), | ||
id: payload.messageId, | ||
@@ -108,3 +108,4 @@ createdOn: new Date(payload.originalArrivalTime), | ||
type: payload.messageType, | ||
message: payload.messageBody | ||
message: payload.messageBody, | ||
metadata: parseMetadata(payload.acsChatMessageMetadata) | ||
}; | ||
@@ -120,3 +121,3 @@ return eventPayload; | ||
senderDisplayName: payload.senderDisplayName, | ||
recipient: constructIdentifierKindFromMri(`8:${payload.recipientId}`), // TODO: Need to fix this inconsistency in CNS/PNH | ||
recipient: constructIdentifierKindFromMri(payload.recipientMri), | ||
id: payload.messageId, | ||
@@ -127,3 +128,4 @@ createdOn: new Date(payload.originalArrivalTime), | ||
editedOn: new Date(payload.edittime), | ||
type: payload.messageType | ||
type: payload.messageType, | ||
metadata: parseMetadata(payload.acsChatMessageMetadata) | ||
}; | ||
@@ -139,3 +141,3 @@ return eventPayload; | ||
senderDisplayName: payload.senderDisplayName, | ||
recipient: constructIdentifierKindFromMri(`8:${payload.recipientId}`), // TODO: Need to fix this inconsistency in CNS/PNH | ||
recipient: constructIdentifierKindFromMri(payload.recipientMri), | ||
id: payload.messageId, | ||
@@ -155,4 +157,4 @@ createdOn: new Date(payload.originalArrivalTime), | ||
sender: constructIdentifierKindFromMri(payload.senderId), | ||
senderDisplayName: "", | ||
recipient: constructIdentifierKindFromMri(`8:${payload.recipientId}`), // TODO: Need to fix this inconsistency in CNS/PNH | ||
senderDisplayName: payload.senderDisplayName, | ||
recipient: constructIdentifierKindFromMri(payload.recipientMri), | ||
version: payload.version, | ||
@@ -172,3 +174,3 @@ receivedOn: new Date(payload.originalArrivalTime) | ||
senderDisplayName: "", | ||
recipient: constructIdentifierKindFromMri(`8:${payload.recipientId}`), // TODO: Need to fix this inconsistency in CNS/PNH | ||
recipient: constructIdentifierKindFromMri(payload.recipientMri), | ||
chatMessageId: payload.messageId, | ||
@@ -323,2 +325,10 @@ readOn: new Date(+consumptionHorizon[1]) | ||
} | ||
} | ||
}; | ||
const parseMetadata = (metadata: string): Record<string, string> => { | ||
if (metadata === undefined || metadata === null || metadata === "" || metadata === "null") { | ||
return {} as Record<string, string>; | ||
} | ||
return JSON.parse(metadata) as Record<string, string>; | ||
}; |
@@ -96,2 +96,6 @@ import { CommunicationIdentifierKind } from "./identifierModels"; | ||
message: string; | ||
/** | ||
* Metadata of the message. | ||
*/ | ||
metadata: Record<string, string>; | ||
} | ||
@@ -108,2 +112,6 @@ /** | ||
/** | ||
* Metadata of the message. | ||
*/ | ||
metadata: Record<string, string>; | ||
/** | ||
* The timestamp when the message was edited. The timestamp is in RFC3339 format: | ||
@@ -110,0 +118,0 @@ * `yyyy-MM-ddTHH:mm:ssZ`. |
export interface BasePayload { | ||
_eventId: number; | ||
eventId: number; | ||
senderId: string; | ||
recipientId: string; | ||
recipientMri: string; | ||
groupId: string; | ||
@@ -15,2 +15,3 @@ } | ||
originalArrivalTime: string; | ||
acsChatMessageMetadata: string; | ||
} | ||
@@ -26,2 +27,3 @@ export interface MessageEditedPayload extends BasePayload { | ||
originalArrivalTime: string; | ||
acsChatMessageMetadata: string; | ||
} | ||
@@ -39,2 +41,3 @@ export interface MessageDeletedPayload extends BasePayload { | ||
version: string; | ||
senderDisplayName: string; | ||
originalArrivalTime: string; | ||
@@ -54,3 +57,3 @@ } | ||
export interface ChatThreadPayload { | ||
_eventId: number; | ||
eventId: number; | ||
threadId: string; | ||
@@ -57,0 +60,0 @@ version: string; |
@@ -93,2 +93,6 @@ import { AbortSignalLike } from '@azure/core-http'; | ||
/** | ||
* Metadata of the message. | ||
*/ | ||
metadata: Record<string, string>; | ||
/** | ||
* The timestamp when the message was edited. The timestamp is in RFC3339 format: | ||
@@ -109,2 +113,6 @@ * `yyyy-MM-ddTHH:mm:ssZ`. | ||
message: string; | ||
/** | ||
* Metadata of the message. | ||
*/ | ||
metadata: Record<string, string>; | ||
} | ||
@@ -111,0 +119,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2966601
11756
48