Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEVEXP-585: Backward compatible fixes #139

Merged
merged 3 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class VerificationEventService {
res.status(200).json(smsRequestEventResponse);
break;
case 'callout':
const calloutRequestEventResponse: Verification.CalloutRequestEventResponse = {
const calloutRequestEventResponse: Verification.PhoneCallRequestEventResponse = {
action: 'allow',
callout: {
code: '123456',
Expand Down
12 changes: 12 additions & 0 deletions packages/conversation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## Version 1.2.0
- [Tech] Update dependency `@sinch/sdk-client` to `1.2.0`.
- [Bugfix] Fix issue with pagination to iterate over multiple pages.
- [Bugfix] `ListConversationsRequestData`: the property `only_active` becomes optional.
- [Bugfix] Template V2: add an optional `id` property to the `V2Template` interface.
- [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.
- [E2E] Add Cucumber steps implementation.

## Version 1.1.0
- [Tech] Update dependency `@sinch/sdk-client` to `1.1.0`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ export interface Conversation {
/**
* Arbitrary data set by the Conversation API clients. Up to 1024 characters long.
* NOTE: This field has been deprecated due to changes in the system architecture or functionality.
* It is no longer actively maintained and may be removed in future versions. Please avoid relying on this field in new code.
* @deprecated
* @deprecated It is no longer actively maintained and may be removed in future versions. Please avoid relying on this field in new code.
*/
metadata?: string;
/** Arbitrary data set by the Conversation API clients and/or provided in the `conversation_metadata` field of a SendMessageRequest. A valid JSON object. */
Expand Down
13 changes: 13 additions & 0 deletions packages/elastic-sip-trunking/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## Version 1.2.0
- [Tech] Update dependency `@sinch/sdk-client` to `1.2.0`.
- [Feature] Add the method `accessControlList.get()`.
- Calls History:
- [Bugfix][Breaking] The `DirectionEnum` values are in lower case. E.g: INBOUND -> inbound.
- [Bugfix][Breaking] The price `amount` is now a `number` instead of a `string`.
- [Feature] Support date range filter for listing calls.
- [Bugfix][Breaking]
- ACLs: For "create", "update" and "addIPRange" operations, the request bodies interface no longer accept read-only properties.
- SIP endpoints: For "create" and "update" operations, the request bodies interface no longer accept read-only properties.
- SIP Trunks: For "create" and "update" operations, the request bodies interface no longer accept read-only properties.
- [E2E] Add Cucumber steps implementation.

# Version 1.1.0
- Initial version. Support for:
- SIP Trunks
Expand Down
10 changes: 9 additions & 1 deletion packages/fax/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## Version 1.2.0
- [Tech] Update dependency `@sinch/sdk-client` to `1.2.0`.
- [Feature] Support date range filter for listing faxes.
- [Feature] Add `emails.listForNumber()` method (identical to `services.listEmailsForNumber()`).
- [Bugfix] Fix `faxes.send()` to send one or several faxes over JSON or FormData. Add examples in the [simple-examples](https://github.com/sinch/sinch-sdk-node/tree/main/examples/simple-examples/src/fax/faxes) package.
- [Feature][Breaking] Update interfaces according to OAS updates.
- [E2E] Add Cucumber steps implementation.

## Version 1.1.0
- [Tech] Update dependency `@sinch/sdk-client` to `1.1.0`

Expand All @@ -6,7 +14,7 @@

## Version 0.0.5
- [Tech] Update dependency `@sinch/sdk-client` to `0.0.5`
- [Tech][Breaking] Export all model interfaces under the namespace `Fax`
- [Tech][Breaking TS] Export all model interfaces under the namespace `Fax`
- [Bugfix] Fix pagination
- [Bugfix] Fix content format sent when using `multipart/form-data`: boolean is not allowed
- [Feature] Support hostname override
Expand Down
18 changes: 18 additions & 0 deletions packages/numbers/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## Version 1.2.0
- [Tech] Update dependency `@sinch/sdk-client` to `1.2.0`.
- [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()` |

- [E2E] Add Cucumber steps implementation.

## Version 1.1.0
- [Tech] Update dependency `@sinch/sdk-client` to `1.1.0`
- [Feature] Update voiceConfiguration object to support Fax and EST configuration properties
Expand Down
4 changes: 2 additions & 2 deletions packages/numbers/src/rest/v1/numbers-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import {
export class NumbersService {
public readonly availableRegions: AvailableRegionsApi;
public readonly callbacks: CallbacksApi;
/** @deprecated use the methods exposed at the Numbers Service level instead */
/** @deprecated Use the methods exposed at the Numbers Service level instead */
public readonly availableNumber: AvailableNumberApi;
/** @deprecated use the methods exposed at the Numbers Service level instead */
/** @deprecated Use the methods exposed at the Numbers Service level instead */
public readonly activeNumber: ActiveNumberApi;

/**
Expand Down
6 changes: 6 additions & 0 deletions packages/sdk-client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Version 1.2.0
- [Feature] Support a new mode of pagination to support the Conversation API.
- [Feature] Remove the `TimezoneResponse` plugin and autocorrect the timezones when reviving the dates in the API responses.
- [Feature] Add utility methods to support the dateRange filters for EST and Fax APIs.
- [Bugfix] Handle HTTP status 202 in the `ExceptionResponse` plugin.

## Version 1.1.0
- [Feature] Add new pagination type support specific to EST

Expand Down
9 changes: 9 additions & 0 deletions packages/sdk-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## Version 1.2.0
- Update dependency `@sinch/numbers` to version `1.2.0`
- Update dependency `@sinch/sms` to version `1.2.0`
- Update dependency `@sinch/verification` to version `1.2.0`
- Update dependency `@sinch/voice` to version `1.2.0`
- Update dependency `@sinch/conversation` to version `1.2.0`
- Update dependency `@sinch/fax` to version `1.2.0`
- Update dependency `@sinch/elastic-sip-trunking` to version `1.2.0`

## Version 1.1.0
- Update dependency `@sinch/numbers` to version `1.1.0`
- Update dependency `@sinch/sms` to version `1.1.0`
Expand Down
12 changes: 12 additions & 0 deletions packages/sms/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## Version 1.2.0
- [Tech] Update dependency `@sinch/sdk-client` to `1.2.0`.
- [Feature] Align "Dry Run" response interface with OAS update: `message_part?: string` becomes `number_of_parts?: number`.
- [Feature] In the interface `MessageDeliveryStatus`, the property `recipients` becomes optional.
- [Feature] In the interface `GetDeliveryReportByBatchIdRequestData`, the property `code` can also be a `number` or a `number[]` on top of a `string`.
- [Feature] In the interface `ListInboundMessagesRequestData`, the property `to` can also be a `string[]` on top of a `string`.
- [Bugfix] Remove default values set by the SDK when forging 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] All variations of a group response (`GroupResponse`, `CreateGroupResponse`, `ReplaceGroupResponse` and `UpdateGroupResponse`) are deprecated and replaced by the unique interface `Group`.
- [Deprecation Notice] In the interface `GetDeliveryReportByPhoneNumberRequestData`, the request parameter `recipient_msisdn` is deprecated and should be replaced by `phone_number`.
- [E2E] Add Cucumber steps implementation.

## Version 1.1.0
- [Tech] Update dependency `@sinch/sdk-client` to `1.1.0`

Expand Down
12 changes: 12 additions & 0 deletions packages/sms/src/models/v1/group/group.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
import { GroupAutoUpdate } from '../group-auto-update';

/** @deprecated Use Group instead */
export type CreateGroupResponse = Group;

/** @deprecated Use Group instead */
export type GroupResponse = Group;

/** @deprecated Use Group instead */
export type ReplaceGroupResponse = Group;

/** @deprecated Use Group instead */
export type UpdateGroupResponse = Group;

export interface Group {

/** The ID used to reference this group. */
Expand Down
2 changes: 1 addition & 1 deletion packages/sms/src/models/v1/group/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export type { Group } from './group';
export type { Group, GroupResponse, CreateGroupResponse, ReplaceGroupResponse, UpdateGroupResponse } from './group';
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,28 @@ export interface GetDeliveryReportByBatchIdRequestData {
/** Comma separated list of delivery_receipt_error_codes to include */
'code'?: string | number | number[];
}
export interface GetDeliveryReportByPhoneNumberRequestData {

export type GetDeliveryReportByPhoneNumberRequestData =
GetDeliveryReportByPhoneNumberRequestDataBC | GetDeliveryReportByPhoneNumberRequestDataDeprecated;

export interface GetDeliveryReportByPhoneNumberRequestDataBC {
/** The batch ID you received from sending a message. */
'batch_id': string;
/** Phone number for which you to want to search. */
'phone_number': string;
/** @deprecated Use phone_number instead */
recipient_msisdn?: never;
}

export interface GetDeliveryReportByPhoneNumberRequestDataDeprecated {
/** The batch ID you received from sending a message. */
'batch_id': string;
/** @deprecated: use phone_number instead */
recipient_msisdn: string;
/** Phone number for which you to want to search. */
phone_number?: never;
}

export interface ListDeliveryReportsRequestData {
/** The page number starting from 0. */
'page'?: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,17 @@ export class DeliveryReportsApi extends SmsDomainApi {
'Accept': 'application/json',
};

// TODO: Remove in v2.0
let phoneNumber;
if (data['phone_number']) {
phoneNumber = data['phone_number'];
}
else if (data['recipient_msisdn']) {
phoneNumber = data['recipient_msisdn'];
}

const body: RequestBody = '';
const basePathUrl = `${this.client.apiClientOptions.hostname}/xms/v1/${this.client.apiClientOptions.projectId}/batches/${data['batch_id']}/delivery_report/${data['phone_number']}`;
const basePathUrl = `${this.client.apiClientOptions.hostname}/xms/v1/${this.client.apiClientOptions.projectId}/batches/${data['batch_id']}/delivery_report/${phoneNumber}`;

const requestOptions
= await this.client.prepareOptions(basePathUrl, 'GET', getParams, headers, body || undefined);
Expand Down
Loading
Loading