Changelog for Messaging Platform SDK

1.15.0

Publish Date: 25th of July 2024

Changes:

  • Adding oAuth2 authentication support: This release offers a new brand authentication mechanism using oAuth2. For more information please refer to the documentation about different authentication mechanisms.

1.14.1

Publish Date: 4th of July 2024

Changes:

  • Brand authentication using agent session data: This release offers a new brand authentication mechanism using agent session data. For more information please refer to the documentation about brand authentication with existing bearer token.
  • Brand Authentication using TokenMaintainer: Authentication information can now be shared between multiple brand
    connections. For more information please refer to the documentation about brand authentication using TokenMaintainer.
  • Emit warning instead of error when conversation is missing during delete: When a delete notification is received for an already closed conversation, a warning is emitted instead of an error. This change was made because it is possible for the conversation close event to be received before the last message.

1.14.0

Publish Date: 11th of June 2024

Changes:

  • Detailed subscription query documentation: All possible query properties are now explained and examples are provided.
  • Enhance get last consumer message example: The example does not pause execution while waiting for a conversation. See get last consumer message

Bug Fixes:

  • No message subscription for closed conversations: When a closed conversation is received on a consumer connection, there is no open dialog. The SDK will not subscribe to any message events of any closed conversations. This fixes, the error when a consumer closed a conversation and a step-up is performed on a new conversation.
  • Updated dependencies: Updated dependencies to versions which stay compatible with node version 16.

1.13.0

Publish Date: 4th of April 2024

Changes:

  • Consumer authentication and step up. This release changes how consumers can establish an authenticated connection. By default, consumers connections are unauthenticated and sometimes anonymous. For certain actions a brand has to verify the authenticity of a consumer. This verification can be done in two ways: Establish an authenticated connection or step up an unauthenticated one. For both of these cases a JSON Web Token is necessary. For more information please refer to the documentation about consumer auth flow and consumer step up. Note: If you have been using authenticated connections before this change, you need to adapt your implementation. The changes are explained in the consumer auth flow documentation.
  • Code examples. Starting from this release code examples for brand and consumer use cases are documented.

Bug Fixes:

  • Transfers to agents are more robust. When a conversation is transferred to a different agent, the agent id is always sent in the following format accountId.agentId.

1.12.13

Publish Date: 28th of February 2024

Bug Fixes:

  • Fixing missing messageAudience for the latest message while calling the queryMessages method. Instead of null the correct audience of the message will be returned.
  • Adding content-type header when using uploadFile method. Previews for preview able file types, for example PNG, are now properly created for conversations.

1.12.12

Publish Date: 7th of February 2024

Bug Fixes:

  • Fixed typo when emitting a warning about outdated conversations over a certain threshold. For example, if there were 200 outdated conversations for account accountId1, the connection will emit a warning in the following way:
    connection.on('warning', msg => {
       expect(message).toEqual('200 outdated conversations found for account accountId1, which is above the threshold of 100.');
    });
    

1.12.11

Publish Date: 5th of February 2024

Bug Fixes:

  • Added configuration parameter unsubscribeFromOutdatedConversationsOnReconnect (defaults to true) whether to close outdated conversations on reconnect or not. True is recommended, but should be set to false if issues with lost messages are encountered. For example:
    const connection = lpm.createConnection({
      appId: 'quick_start',
      accountId,
      userType: lpm.UserType.BRAND,
      authData,
      unsubscribeFromOutdatedConversationsOnReconnect: false
    });
    

    More information can be found in the documentation.

1.12.10

Publish Date: 30th of January 2024

Bug Fixes:

  • Updated URL path for all message/conversation related REST endpoints. From /v1/conversations/ to /messaging/v1/conversations/.
  • Fixed issue with agentId being null if message is sent by an agent that has been removed from the conversation before the connection. The agentId now contains the right agentId.

1.12.9

Publish Date: 17th of January 2024

Changes:

  • Adding anonymous async function as param of the ring which could be resolved if rings need to use directly the conversation
  • Adding ringConversationTimeout param to createConnection so brands can configure it.
  • Adding conversation.getLatestConsumerMessage() to allow brand users to get latest consumer message.

Example:

  • The code below showcases how a conversation can be accepted on the ring and how to retrieve the last consumer message:
      // connect as admin for brand
      const connection = lpm.createConnection({appId: 'quick_start', userType: lpm.UserType.BRAND, accountId, authData, ringConversationTimeout: 2000});
      await connection.open();
        
      // agent state must be "ONLINE" in order to receive rings
      await connection.setAgentState({agentState: lpm.AgentState.ONLINE});
        
      // subscribe to routing tasks (rings)
      const taskRoutingSubscription = await connection.createRoutingTaskSubscription();
        
      // process the rings as they arrive
      connection.on('ring', async ring => {
        
          // ignore old rings
          if (ring.ringState !== lpm.RingState.WAITING) return;
            
          // accept the ring
          await ring.accept();
        
          // await conversation or null if waiting times out after 2000 ms
          const conversation = await ring.conversation();
            
          // Get the latest consumer message
          const latestConsumerMessage = conversation.getLatestConsumerMessage();
      });
    

    More information can be found in the documentation.

1.12.8

Publish Date: 15th of January 2024

Bug Fixes:

  • Fixed issue with consumer connection not properly reflecting assigned agent change on skill transfer.
  • conversation-deleted now emitted when DELETE notification is received, previously this was only emitted when a conversation was removed during disconnect.

1.12.7

Publish Date: 9th of January 2024

Bug Fixes:

  • Bumped axios version to 1.6.5 due to security vulnerabilities.

1.12.6

Publish Date: 12th of December 2023

Bug Fixes:

  • Adding check for existing dialog before trying to transfer conversation on the transfer method. If there is no open dialog an error will be emitted:
    conversation.on('error', err => expect(err.message).toEqual('Cannot transfer without open dialog present.'));
    

1.12.5

Publish Date: 7th of December 2023

Bug Fixes:

  • Omit Accept-Encoding header when invoking UMS REST API

1.12.4

Publish Date: 6th of December 2023

Bug Fixes:

  • Support additional query parameters for getMessages in BrandRestConnection

1.12.3

Publish Date: 28th of November 2023

Bug Fixes:

  • Fixing proxy web socket connection configuration issue

1.12.2

Publish Date: 22nd of November 2023

Changes:

  • Adding responseTimeout param to createConnection so brands can configure it.

1.12.1

Publish Date: 10th of November 2023

Changes:

  • Add support for proxy http request

Bug Fixes:

  • Fix documenting example inside of the README about createConversationSubscription

1.11.3

  • Fixing missing metadata for some messages while calling the queryMessages method.

1.11.2

  • Fix a race condition when creating a new conversation which caused some conversations to have multiple conversation objects
  • add originatorId and originatorRole as optional args for the rest publishMessage

1.11.1

  • RoutingTaskSubscriptions are now restored upon reconnect.

1.11.0

  • For Brand Rest Connections, getConversationById will now make a fetch call, parse the data, and return a conversation object. Previously it would only return the raw result of the HTTP request.

1.10.0

  • Added await connection.getMessageStatisticsForUser() and await connection.getMessageStatisticsForBrand() to allow brand users to get message statistics information.
  • Added conversation.resumeConversation() to allow brand users to resume previously closed conversation with a consumer.
  • Added connection.on('failed-to-connect') event which will fire when moving to FAILED_TO_CONNECT state, ie when failed attempt occurs while trying to establish websocket connection.

1.9.6

  • connection.closeConversation(conversationId) is now available. With this function conversations can be closed without a conversation object.

1.9.5

  • Conversation.assignedAgent should return active assigned agent only. Also handled edge case where suggested agents do not have userId

1.9.4

  • Fix chatStateEvent for unknown participant undefined error after moving message originator transformation in 1.9.2

1.9.3

  • Exposed TTRType enum
  • Added message.sentByCurrentUser method to the Message class
  • Added getConversationById & getAllKnownConversations methods to Connection
  • Added notificationType of child for deferred notifications from child subscriptions

1.9.2

  • Move message originator transformation from connection to MessageFactory, fixes issues where Message objects created from lastContentEventNotification and queryMessages did not have the correct sender

1.9.1

  • Use HTTPS for the baseURI call to CSDS

1.9.0

  • Rename waitForFirstNotification to waitForReady. waitForFirstNotification will still function to ensure backwards compatibility, but is now deprecated.
  • Use of notificationType in ConversationSubscription to determine notification type, fixes issues around onFirstNotification and child subscriptions
  • userId for brand connections is now userId uuid, rather than the un-prefixed agentId
  • Fix limit-break chain for subscriptions with more than 2002 conversations

1.8.2

  • Truncate setAgentNote to 5000-character limit, throw error if note cannot be added

1.8.1

  • Don't delete lastContentEventNotification when emitting it to subscriptions
  • Update participant role when they are removed and then re-added

1.8.0

  • Add setAgentNote method to conversation, which deprecates setNote
  • BrandWebsocketConnection now has userProfile parameter, available after opening the connection
  • Fix to allow connection with existing unauthenticated token to step up
  • Added documentation for continuing an anonymous user session between two connections

1.7.2

  • Add consumer-step-up event to the conversation

1.7.1

  • Removed reference to a test module that was preventing code execution

1.7.0

  • File sharing - Upload and Download for both node.js and browser
  • Authenticated consumer flow
  • Consumer stepup via connection.stepUp() function
  • participant.getUserProfile() is now available
  • dialog.leave() and conversation.leave() are now available
  • Arbitrary websocket requests with connection.send()
  • Listen to all websocket notifications via connection.on('notification')
  • Expanded documentation

1.6.6

  • added conversation.consumer getter to help get the conversation's consumer participant

1.6.5

  • Fixed bug in 1001 conversation limit break for LP originating disconnects
  • Lower default max reconnection time limit from 4 hours to 10 minutes

1.6.4

  • Bug fixes
    • When reconnecting, only drop conversations that have actually been closed while we were disconnected
    • When a conversation is dropped for any reason and it is later seen in a notification, re-add it to the cache

1.6.3

  • Added assignedAgent getter to Conversation class

1.6.2

  • Update appId with correct capitalization

1.6.1

  • appId must be limited to alphanumeric plus special characters -_.

1.6.0

  • MA-238 appId is now a required argument when calling createConnection

1.5.7

  • Handle notifications that have missing participantsDetails

1.5.5

  • Add support for quickReplies, available by setting the third argument on sendMessage and sendRichText conversation.sendMessage('test', null, quickReplies);

1.5.4

  • Pass through getShiftStatus#response & getShiftStatus#error events to the connection

1.5.3

  • TokenMaintainer fixes - prevent caching token generation errors to allow reconnections
  • getToken now blocks until token generation succeeds or TokenMaintainer is stopped

1.5.2

  • CO-6234: Add APIs to change TTR and ManualETTR of a conversation, which consequently emits ttr-change and manual-ettr-change events respectively
  • Whitelist dialog:close event and bubble up to conversation & connection

1.5.1

  • CO-6394: fix for conversation.sendRichText, metadata was populated with message audience
  • expose ConversationContextType, add conversationContext and campaignInfo to readme

1.5.0

  • shift-status polling now encapsulated and exposed in lpmsdk.ShiftStatusPoller
  • rest helper functions exposed through lpmsdk.rest

1.4.6

  • Bubble up dialog and conversation events to the connection. These will have a conversation: prefix to them e.g. conversation:close
  • Minor refactor of refreshSession internal method

1.4.5

  • Fix for serialization of rich content events

1.4.4

  • TokenMaintainer ctor now expects an object. Also added getAuthSessionInfo() method and extended support for refreshing tokens when authSessionInfo is passed in ctor

1.4.3

  • loadConversation(serializedConversationData) function on connection, which allows previously serialized conversations to be resumed by the connection.
  • unload() function on conversation that allows a conversation to bemanually removed from the SDK's memory.

1.4.2

  • Expose TokenMaintainer class

1.4.1

  • Added a queue when processing onNotificationPart

1.4.0

  • CO-6062: Create ConversationNotificationFeed, WebhooksIntake, and NullConnection classes to consume notifications from webhooks/kafka. Accessed via connection.processWebhooksNotification(notification)

1.3.0

  • Public documentation now available @ www.npmjs.com/package/lp-messaging-sdk
  • Introduced TokenMaintainer class to keep bearer tokens valid
  • TokenMaintainer now used in BrandWebsocketConnection & BrandRestConnection
  • Bug fixes for simple-websocket library related to retrieving close and error codes
  • CO-6063: Add setCsat function to conversation, available for consumers
  • CO-6099: Expose connection.getToken() async method to obtain token from connection
  • CO-5613: Static deserialize function to recreate a hydrated Conversation object from DB

1.2.31

  • add "consumer" getter helper to dialog
  • expose ParticipantChatState enum

1.2.30

  • CO-5950: Always create context and attach clientProperties

1.2.29

  • CO-5989: Add setNote function to conversation

1.2.28

  • CO-5907: Allow campaignInfo argument on createConversation to pass through correctly
  • CO-5880: RoutingTaskSubscriptions and Rings are now available
  • Browser stand alone build is now available /web/lpm-sdk.js
  • Websocket library "ws" has been replaced with "simple-websocket" for browser compatibility
  • CO-5987: use v2.1 of the WS API to allow suggested agents
  • Increased default wait to reconnect time to 2 seconds, as per UMS recommendation

1.2.23

  • Added Conversation REST APIs under lib/api/rest/conversation

1.2.22

  • Minor fix so conversationContext is passed in correctly when consumers create conversations

1.2.19

  • BrandWebsocketConnection now emits skill-entered-work-hours and skill-entered-off-hours for any of its skills

1.2.18

  • Allow access to ParticipantRole enum
  • CO-5713: Added ability to attach metadata to messages in sendMessage, sendPrivateMessage, and sendRichText
  • CO-5612: serialize method added for Conversation object to allow it to be persisted in DBs
  • Added Messaging & General REST APIs under lib/api/rest

1.2.17

  • CO-5322: Subscriptions now have a process to get more than 1001 conversations, there is now no limit to the number of conversations. This feature is enabled by default, but can be disabled by passing limitBreakEnabled: false as an option to createConnection
  • CO-5603: Removed errors when receiving duplicate read or accept message notifications from UMS
  • CO-5604: Fixed issue where onReconnect calls could be doubled up in certain scenarios

1.2.14

  • CO-5512: maintainConnection is now true by default when calling createConnection

1.2.11

  • CO-4981: Added tracking info to WS connection URL params
  • CO-5532: Mock stepup: automatic consumer take over
  • CO-5463: Shift-status will now start and retrieve initial data before default subscription is created

1.2.10

  • CO-5436: Skill.isInOffHours helper function

1.2.7

  • CO-5517: Conversation Deleted Event

1.2.5

  • CO-5295: Media Handler File upload requests
  • CO-5013: Wait for the first MS notification

1.2.4

  • CO-5322: Conversation subscriptions async .init() which must be called to create subscription

1.2.3

  • _callShiftStatus now has a return value
  • CO-5321: dialog.getAll() retrieves all messages

1.2.2

  • CO-5470: Remove optional chaining parameter for compatibility with old versions of node.js
  • CO-5470: add wait option to createSubscription

1.2.1

  • CO-4978: dialog.setChatState function
  • Shift-status poller

1.1.1

  • CO-4866: Resubscribe Subscriptions on Reconnect
  • CO-5232: Private messages
  • CO-5154: Support for Multiple Dialogs of the same Type