Skip to content

Releases: sinch/sinch-sdk-node

v1.2.0

04 Oct 07:54
db3c5db
Compare
Choose a tag to compare

What's New

In version 1.2.0, we have introduced end-to-end tests for all the supported endpoints. The implementation of these Cucumber steps can be found in the /tests folder of each API package. These tests run on every push to the repository, providing enhanced protection against potential regressions.

This release also includes several updates to align with the latest API changes and to improve the developer experience. See below for detailed changes in each API package.

What’s changed since v1.1.0

SMS SDK

Highlights:
[Bugfix] Remove the values set by default by the SDK when formatting the API request.
[Bugfix] In the interface UpdateGroupRequest, the property name can also be set to null to remove an existing name set.
[Deprecation Notice] In the interface GetDeliveryReportByPhoneNumberRequestData, the request parameter recipient_msisdn is deprecated and should be replaced by phone_number.
[Deprecation Notice] All variations of a group response (GroupResponse, CreateGroupResponse, ReplaceGroupResponse and UpdateGroupResponse) are deprecated and replaced by the unique interface Group.

See full content here: SMS CHANGELOG.md

Numbers SDK

Highlights:
[Bugfix] Remove the "scheduledProvisioning" properties for SMS and Voice in the update number request.
[Deprecation notice] availableNumber and activeNumber subdomain are deprecated and all methods are now defined on the upper numbers service.
All the methods names are the same except availableNumber.list() -> searchForAvailableNumbers()

Deprecated New
numbersService.availableNumber.checkAvailability() numbersService.checkAvailability()
numbersService.availableNumber.list() numbersService.searchForAvailableNumbers()
numbersService.availableNumber.rent() numbersService.rent()
numbersService.availableNumber.rentAny() numbersService.rentAny()
numbersService.activeNumber.get() numbersService.get()
numbersService.activeNumber.list() numbersService.list()
numbersService.activeNumber.update() numbersService.update()
numbersService.activeNumber.release() numbersService.release()

See full content here: Numbers CHANGELOG.md

Conversation SDK

Highlights:
[Bugfix] Fix issue with pagination to iterate over multiple pages.
[Bugfix] conversations.listRecent(): Add a page_size value by default. Without it the API returns an empty list.
[Bugfix][Breaking] InjectConversationEvent interface: only AppEvent is allowed (ContactEvent and ContactMessageEvent are no longer allowed).
[Bugfix][Breaking]

  • Template V2: For "create" and "update" operations, the request bodies interface no longer accept read-only properties.
  • Webhooks: For "create" and "update" operations, the request bodies interface no longer accept read-only properties.

See full content here: Conversation CHANGELOG.md

Voice SDK

Highlights:
[Breaking] In the interface ConferenceCalloutRequest, the property mohClass was declared as a string and is now a MusicOnHold type;
[Deprecation Notice] The type VoiceCallback becomes VoiceCallbackEvent and is accessible on the Voice namespace.

See full content here: Voice CHANGELOG.md

Verification SDK

Highlights:
[Feature] Support the locale parameter in the SmsOptions interface when starting a verification with a SMS.
[Deprecation Notice] All the references to "callout" and "seamless" will be replaced by "phoneCall" and "data" respectively. This change is done to match the code to the online documentation and to enhance the developer experience.
[Deprecation Notice] The type VerificationCallback becomes VerificationCallbackEvent and is accessible on the Verification namespace.

See full content here: Verification CHANGELOG.md

Fax SDK

Highlights:
[Feature] Support date rage filter for listing faxes
[Bugfix] Fix faxes.send() to send one or several faxes over JSON or FormData. Add examples in the simple-examples package.
[Feature][Breaking] Update interfaces according to OAS updates.

See full content here: Fax CHANGELOG.md

Elastic SIP Trunking SDK

Highlights:
[Feature] Add the method accessControlList.get().
[Feature] Support date rage filter for listing calls.
[Bugfix][Breaking] callHistory.find(): the direction enum's values are in lower case. E.g.: INBOUND -> inbound.
[Bugfix][Breaking] The price amount is now a number instead of a string.

See full content here: Elastic SIP Trunking CHANGELOG.md

Full Changelog: v1.1.0...v1.2.0

v1.1.0

14 May 13:38
2360660
Compare
Choose a tag to compare

What's New

With the version 1.1, we have added support for the Elastic SIP Trunking API.

Warning: Although the SDK is released with a major version, the underlying API product is still in beta. You can request access from the dashboard.

What’s changed since v1.0.0

Number SDK

The VoiceConfiguration and ScheduledVoiceProvisioning models have been updated to reflect the “Unified Numbers” API updates: they now hold values for Fax and Elastic SIP Trunking configuration (respectively with the properties serviceId and trunkId) on top of the Voice configuration (which is still using the property appId).

Full Changelog: v1.0.0...v1.1.0

v1.0.0

19 Apr 16:23
1ef01f8
Compare
Choose a tag to compare

What's New

We are pleased to announce the first major release of the Node.js SDK for the Sinch APIs. If you haven't followed the previous development versions, here is a brief summary of what is supported:

What's changed since v0.0.5

Conversation API

  • [Feature][Breaking TS] Refactor OmniMessage interface to OmniMessageOverride to highlight its override nature
  • [Feature][Breaking TS] Refactor the section array elements interface of a "List Message": the new interfaces are now called ChoiceItemWrapper and ProductItemWrapper and contain a ChoiceItem and a ProductItem in their respective properties choice and product
  • [Feature] Add helpers to build ChoiceItemWrapper and ProductItemWrapper objects.

Verification API

  • [Feature] Update SDK from the latest specification
    • Add smsOptions and calloutOptions to the respective Start Verification operations
    • Provide dedicated response interfaces for Report Verification operations dissociated from Verification Status responses

Full Changelog: v0.0.5...v1.0.0

v0.0.5

12 Apr 13:15
1dcee5f
Compare
Choose a tag to compare
v0.0.5 Pre-release
Pre-release

What's Changed

  • [Feature][All APIs] Support hostname override in SinchClient parameters (#51)
    • OAuth2: authHostname
    • Conversation: conversationHostname and conversationTemplatesHostname
    • Fax: faxHostname
    • Numbers: numbersHostname
    • Sms: smsHostname
    • Verification: verificationHostname
    • Voice: voiceHostname and voiceApplicationManagementHostname
  • [Tech][All APIs] Support plugins addition in SinchClient parameters (preparation work for E2E tests) (#52)
  • [Tech] Export the AdditionalHeaders request plugin (preparation work for E2E tests) (#57)
  • [Feature][Breaking Change] Flexible enums for regions (#54)
    • The generic Region enum has been deleted in favor of API specific enums
    • Conversation: ConversationRegion
    • Fax:FaxRegion
    • Sms: SmsRegion
    • Voice: VoiceRegion
    • Note the enums are now "flexible": any string value is also accepted and will be used to build the URL (only is the hostname has not been overridden)
  • [Feature][Breaking Change] Change package exports - see migration guide below (#55)

Conversation API

  • [Feature][Conversation API] Align Conversation SDK with latest documentation (#49)
    • Support channel_specific_message property in the AppMessage interface and the WhatsApp flow messages
    • Support channel_specific_message and product_response_message properties in the ContactMessage interface and the WhatsApp interactive NFM reply
    • [Bugfix][Breaking Change] Remove AppMessageMessage interface and reconciliate the model in the AppMessage interface
  • [Feature][Conversation API] Enhance DX for ttl field in SendMessageRequest: it's now allowed to input directly a number or a string representing a number. The SDK will take care of the formatting expected by the backend (#56)
  • [Feature][Conversation API] Add setRegion() method on the ConversationService (#57)

Fax API

  • [Bugfix][Fax API] Fix Fax API issues (#50)
    • Fix pagination
    • Fix faxes.send() when using multipart/form-data: boolean was not allowed in the request
  • [Feature][Fax API] Support regions for Fax API (#53)
  • [Feature][Fax API] Add setRegion() method on the FaxService (#57)

Numbers API

  • [Breaking Change] Change body property for activeNumber.update() from activeNumberRequestBody to updateActiveNumberRequestBody (#59)

Sms API

  • [Feature][Sms API] Add setRegion() method on the SmsService (#57)

Verification API

  • [Breaking Change] Split the helper per action (#61)
    • The verificationsHelper does not exist anymore
    • New helpers are: startVerificationHelper, reportVerificationByIdHelper, reportVerificationByIdentityHelper

Voice API

  • [Bugfix][Voice API] Fix the setRegion() method on the VoiceService to update the region on all the subdomains that support it (#57)

Documentation

  • [Examples] Refactor webhooks examples to showcase the usage of Services (#48)

Migration guide - new package exports

Due to the increasing number of APIs supported in the SDK and the variety of concepts that can be cross-domains (Email for Fax can conflict with Email for Mailgun APIs), all the model interfaces are now exported under the API namespace.

  • There is no need to import all the interfaces one by one from @sinch/sdk-core, only the namespace is required
  • To use an interface or a helper, it needs to be prefixed by the imported namespace: e.g.:
    • messageBuilder.text() -> Conversation.messageBuilder.text()
    • MOText -> Sms. MOText
    • Fax -> Fax.Fax

Here is an example of code before and after the migration:

Before

import {
    SinchClient,                // This import will stay: it's a class defined in the sdk-core
    Region,                     // This import will change: the generic Region is replaced by API specific flexible enums
    ContactId,                  // This model interface can't be imported: it must use the API's namespace
    SendTextMessageRequestData, // Same as above
    messageBuilder,             // Same thing for the helpers
} from '@sinch/sdk-core';

(async() => {
    const sinch = new SinchClient({
        keyId: 'myProjectId',
        keySecret: 'myKeyId',
        projectId: 'myKeySecret',
    });

    const conversationService = sinch.conversation;
    // Sets the region for the message API only. The method to set the region for the whole API is missing in v0.0.4
    conversationService.messages.setRegion(Region.EUROPE);  

    const requestData: SendTextMessageRequestData<ContactId> = {
        sendMessageRequestBody: {
            app_id: 'myConversationAppId',
            recipient: {
                contact_id: 'theContactId',
            },
            message: messageBuilder.text({
                text: 'Hello from Sinch',
            }),
        },
    };
    const response = await conversationService.messages.sendTextMessage(requestData);
    console.log(response);
})();

After

import {
  SinchClient,
  ConversationRegion, // This is the new flexible enum for the Conversation API
  Conversation,       // This is the namespace for the Conversation API
} from '@sinch/sdk-core';

(async() => {
  const sinch = new SinchClient({
    keyId: 'myProjectId',
    keySecret: 'myKeyId',
    projectId: 'myKeySecret',
    conversationRegion: ConversationRegion.EUROPE, // Set the region for the whole Conversation API
  });

  const conversationService = sinch.conversation;
  // The region can also be set at service level in v0.0.5
  // conversationService.setRegion(ConversationRegion.EUROPE);

  // Note the `Conversation.` prefix in front of the types
  const requestData: Conversation.SendTextMessageRequestData<Conversation.ContactId> = {
    sendMessageRequestBody: {
      app_id: 'myConversationAppId',
      recipient: {
        contact_id: 'theContactId',
      },
      // Note the `Conversation.` prefix in front of the helper
      message: Conversation.messageBuilder.text({
        text: 'Hello from Sinch',
      }),
    },
  };
  const response = await conversationService.messages.sendTextMessage(requestData);
  console.log(response);
})();

Full Changelog: v0.0.4...v0.0.5

v0.0.4

22 Mar 14:07
32bf1a7
Compare
Choose a tag to compare
v0.0.4 Pre-release
Pre-release

What's Changed

  • [Feature] Support the Fax API in #30
  • [Tech] Set strictNullChecks to true for webhooks package in #36
  • [Tech] Improve oneOf handling in #37
  • [Feature] Add missing occurence of ContactEventMessage in #38
  • [Tech] Refactor conversation events in #39
  • [Fix] Do not transform to a Date object in the plugin in #41
  • [Feature] Composed functions for sendSMS in #40
  • [Feature] Rename getByPhoneNumber method in #42
  • [Feature] Remove support for SMS credentials in #43
  • [Feature] Add composed functions for messages and events in #35
  • [Feature] Promote usage of services in #44
  • [Tech] Prepare release 0.0.3 with Fax API in #45
  • [Tech] Add form_data dependency and bump version to 0.0.4 in #46

Full Changelog: v0.0.2...v0.0.4