Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Vonage/vonage-node-sdk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: @vonage/server-sdk@3.19.1
Choose a base ref
...
head repository: Vonage/vonage-node-sdk
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: @vonage/server-sdk@3.19.2
Choose a head ref
  • 4 commits
  • 9 files changed
  • 2 contributors

Commits on Nov 11, 2024

  1. Verified

    This commit was signed with the committer’s verified signature.
    manchuck Chuck Reeves
    Copy the full SHA
    051606a View commit details
  2. Publish

    manchuck committed Nov 11, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    manchuck Chuck Reeves
    Copy the full SHA
    5ab39f8 View commit details

Commits on Nov 12, 2024

  1. fix: create conversation was sending the request incorrectly (#967)

    manchuck authored Nov 12, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    4b81d74 View commit details
  2. Publish

     - @vonage/conversations@1.7.2
     - @vonage/number-insight-v2@1.8.3
     - @Vonage/server-sdk@3.19.2
    manchuck committed Nov 12, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    manchuck Chuck Reeves
    Copy the full SHA
    998c56b View commit details
41 changes: 40 additions & 1 deletion packages/conversations/__tests__/__dataSets__/post.ts
Original file line number Diff line number Diff line change
@@ -36,7 +36,10 @@ export default [
callback: {
url: conversationToCreate?.callback?.url,
event_mask: conversationToCreate?.callback?.eventMask,
params: conversationToCreate?.callback?.params,
params:{
applicationId: conversationToCreate?.callback?.params?.applicationId,
ncco_url: conversationToCreate?.callback?.params?.nccoUrl,
},
method: conversationToCreate?.callback?.method,
},
} as CreateConversationRequest,
@@ -109,4 +112,40 @@ export default [
error: false,
expected: event,
},
{
label: 'create conversation with callback',
requests: [
[
'/v1/conversations',
'POST',
{
name: conversationToCreate.name,
display_name: conversationToCreate.displayName,
image_url: conversationToCreate.imageUrl,
properties: {
ttl: conversationToCreate?.properties?.ttl,
type: conversationToCreate?.properties?.type,
custom_sort_key: conversationToCreate?.properties?.customSortKey,
custom_data: conversationToCreate?.properties?.customData,
},
numbers: conversationToCreate?.numbers,
callback: {
url: conversationToCreate?.callback?.url,
event_mask: conversationToCreate?.callback?.eventMask,
params: {
applicationId: conversationToCreate?.callback?.params?.applicationId,
ncco_url: conversationToCreate?.callback?.params?.nccoUrl,
},
method: conversationToCreate?.callback?.method,
},
} as CreateConversationRequest,
],
],
responses: [[200, conversationResponse]],
clientMethod: 'createConversation',
parameters: [conversationToCreate],
generator: false,
error: false,
expected: conversation,
},
];
5 changes: 4 additions & 1 deletion packages/conversations/__tests__/__dataSets__/put.ts
Original file line number Diff line number Diff line change
@@ -26,7 +26,10 @@ export default [
callback: {
url: conversationToCreate?.callback?.url,
event_mask: conversationToCreate?.callback?.eventMask,
params: conversationToCreate?.callback?.params,
params: {
applicationId: conversationToCreate?.callback?.params?.applicationId,
ncco_url: conversationToCreate?.callback?.params?.nccoUrl,
},
method: conversationToCreate?.callback?.method,
},
} as CreateConversationRequest,
5 changes: 4 additions & 1 deletion packages/conversations/__tests__/common.ts
Original file line number Diff line number Diff line change
@@ -40,7 +40,10 @@ export const conversationToCreate = Object.freeze({
callback: {
url: 'https://example.com/callback',
eventMask: EventType.AUDIO_PLAY,
params: {},
params: {
applicationId: 'APP-00000000-0000-0000-0000-000000000001',
nccoUrl: 'https://example.com/ncco',
},
method: 'POST',
}
}) as Conversation;
7 changes: 7 additions & 0 deletions packages/conversations/lib/conversations.ts
Original file line number Diff line number Diff line change
@@ -57,6 +57,13 @@ const conversationToApi = (
apiConversation.properties.custom_data = customData;
}

if (conversation?.callback?.params?.applicationId && apiConversation?.callback?.params) {
apiConversation.callback.params = {
applicationId: conversation.callback.params.applicationId,
ncco_url: conversation.callback.params.nccoUrl,
};
}

return apiConversation;
};

Original file line number Diff line number Diff line change
@@ -19,12 +19,12 @@ export type ConversationCallbackRequest = {
/**
* The application ID for the callback.
*/
application_id: string;
applicationId?: string;

/**
* The NCCO URL for the callback.
*/
ncco_url: string;
ncco_url?: string;
};

/**
2 changes: 1 addition & 1 deletion packages/conversations/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@vonage/conversations",
"version": "1.7.1",
"version": "1.7.2",
"description": "The Vonage Conversation API enables you to build conversation features where communication can take place across multiple mediums including IP Messaging, PSTN Voice, SMS and WebRTC Audio and Video. The context of the conversations is maintained though each communication event taking place within a conversation, no matter the medium.",
"homepage": "https://github.com/vonage/vonage-node-sdk/tree/main/packages/conversations#readme",
"bugs": {
29 changes: 1 addition & 28 deletions packages/number-insight-v2/README.md
Original file line number Diff line number Diff line change
@@ -33,34 +33,7 @@ yarn add @vonage/number-insight-v2

## Usage

### As part of the Vonage Server SDK

If you are using this SDK as part of the Vonage Server SDK, you can access it as the `numberInsightV2` property off of the client that you instantiate.

```js
const { Auth } = require('@vonage/auth');
const { Vonage } = require('@vonage/server-sdk');
const { Insight } = require('@vonage/number-insight-v2');

const credentials = new Auth({
apiKey: API_KEY,
apiSecret: API_SECRET
});
const options = {};
const vonage = new Vonage(credentials, options);

vonage.numberInsightV2.checkForFraud({
type: 'phone',
phone: PHONE_NUMBER,
insights: [Insight.SIM_SWAP, Insight.FRAUD_SCORE],
})
.then(resp => console.log(resp))
.catch(err => console.error(err));
```

### Standalone

The SDK can be used standalone from the main [Vonage Server SDK for Node.js](https://github.com/vonage/vonage-node-sdk) if you only need to use the Number Insight v2 API. All you need to do is `require('@vonage/number-insight-v2')`, and use the returned object to create your own client.
Unlike the other SDK's this package is not include in the [Vonage Server SDK for Node.js](https://github.com/vonage/vonage-node-sdk)

```js
const { Auth } = require('@vonage/auth');
2 changes: 1 addition & 1 deletion packages/number-insight-v2/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@vonage/number-insight-v2",
"version": "1.8.1",
"version": "1.8.3",
"description": "Number Insight v2 is designed to give fraud scores for Application Integrations.",
"homepage": "https://github.com/vonage/vonage-node-sdk/tree/main/packages/number-insight-v2#readme",
"bugs": {
4 changes: 2 additions & 2 deletions packages/server-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@vonage/server-sdk",
"version": "3.19.1",
"version": "3.19.2",
"description": "Node.js Client for the Vonage API Platform",
"homepage": "https://developer.vonage.com",
"bugs": {
@@ -41,7 +41,7 @@
"@vonage/accounts": "^1.16.1",
"@vonage/applications": "^1.16.1",
"@vonage/auth": "^1.12.0",
"@vonage/conversations": "^1.7.1",
"@vonage/conversations": "^1.7.2",
"@vonage/messages": "^1.18.1",
"@vonage/number-insights": "^1.16.1",
"@vonage/numbers": "^1.16.1",