@saysimple/node-sdk
Advanced tools
Comparing version
# š§ Changelog š§ | ||
## Latest | ||
**5 march 2021** | ||
## latest | ||
**23 March 2021** | ||
- Added get tags | ||
## V0.0.9 | ||
**5 March 2021** | ||
- Added active contacts distributions | ||
## V0.0.8 | ||
**3 march 2021** | ||
**3 March 2021** | ||
- Added conversations tags used | ||
@@ -10,0 +14,0 @@ |
@@ -6,2 +6,3 @@ import { Domain } from "../domain"; | ||
import { AgentList } from "../../types/responses/intelligence/list-agents-response"; | ||
import { TagList } from "../../types/responses/intelligence/list-tags-response"; | ||
import { ListChannelsResponseInterface } from "../../types/responses/intelligence/list-channels-response"; | ||
@@ -22,2 +23,3 @@ export declare class Intelligence extends Domain { | ||
getChannels(): Promise<Response<ListChannelsResponseInterface[]>>; | ||
getTags(): Promise<Response<TagList>>; | ||
getMessageDistribution(opts?: MetricMessageParametersInterface): Promise<MetricDataResponseInterface>; | ||
@@ -42,2 +44,3 @@ getConversationsResolved(opts?: MetricMessageParametersInterface): Promise<MetricDataResponseInterface>; | ||
channel?: "*" | string[]; | ||
tag?: "*" | string[]; | ||
provider?: "*" | string[]; | ||
@@ -44,0 +47,0 @@ identifier?: "*" | string[]; |
@@ -101,2 +101,5 @@ "use strict"; | ||
}; | ||
Intelligence.prototype.getTags = function () { | ||
return this.getData("/tags"); | ||
}; | ||
Intelligence.prototype.getMessageDistribution = function (opts) { | ||
@@ -103,0 +106,0 @@ return this.getData("/metrics/messages/distribution", opts); |
@@ -6,3 +6,3 @@ { | ||
"repository": "https://github.com/saysimple/node-sdk", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "The official SaySimple Node SDK. Want to use our awesome customer conversations platform? Please visit: https://saysimple.com", | ||
@@ -9,0 +9,0 @@ "main": "dist/index.js", |
@@ -44,11 +44,19 @@ # SaySimple SDK for JavaScript | ||
|----------|------------| | ||
| addMessage | See [**Add A Message** in the API Docs](https://api.saysimple.io/docs/intelligence/#operation/postMessage) | | ||
| getMessagesSummed | See [**Total Messages Summed** in the API Docs](https://api.saysimple.io/docs/intelligence/#operation/getTotalMessagesSummed) | | ||
| getActiveContactsSummed | See [**Total Active Contacts** in the API Docs](https://api.saysimple.io/docs/intelligence/#operation/getTotalActiveContacts) | | ||
| getSendPaidTemplatesSummed | See [**Total Paid Templates Send** in the API Docs](https://api.saysimple.io/docs/intelligence/#operation/getTotalPaidTemplatesSend) | | ||
| getAgents | See [**List Agents** in the API Docs](https://api.saysimple.io/docs/intelligence/#operation/getAgents) | | ||
| getChannels | See [**List Channels** in the API Docs](https://api.saysimple.io/docs/intelligence/#operation/getChannels) | | ||
| getConversationsResolved | See [**Get Converasations Resolved** in the API Docs](https://api.saysimple.io/docs/intelligence/#operation/getConversationsResolved) | | ||
| getConversationsResolveTimesAverage | See [**Get Conversations Resolve Times Average** in the API Docs](https://api.saysimple.io/docs/intelligence/#operation/getConversationsResolveTimesAverage) | | ||
| getConversationsResolveTimesMedian | See [**Get Conversations Resolve Times Median** in the API Docs](https://api.saysimple.io/docs/intelligence/#operation/getConversationsResolveTimesMedian) | | ||
| addMessage | See [**Add A Message** in the API Docs](https://docs.saysimple.io/insights/index.html#operation/postMessage) | | ||
| getMessagesSummed | See [**Total Messages Summed** in the API Docs](https://docs.saysimple.io/insights/index.html#operation/getTotalMessagesSummed) | | ||
| getActiveContactsSummed | See [**Total Active Contacts** in the API Docs](https://docs.saysimple.io/insights/index.html#operation/getTotalActiveContacts) | | ||
| getActiveContactsDistribution| See [**Total Active Contacts Distribution** in the API Docs](https://docs.saysimple.io/insights/index.html#operation/getActiveContactsDistributions) | | ||
| getSendPaidTemplatesSummed | See [**Total Paid Templates Sent** in the API Docs](https://docs.saysimple.io/insights/index.html#operation/getTotalPaidTemplatesSent) | | ||
| getAgents | See [**List all Agents** in the API Docs](https://docs.saysimple.io/insights/index.html#operation/getAgents) | | ||
| getChannels | See [**List all Channels** in the API Docs](https://docs.saysimple.io/insights/index.html#operation/getChannels) | | ||
| getMessageDistribution | See [**Message Distribution** in the API Docs](https://docs.saysimple.io/insights/index.html#operation/getMessageDistribution) | | ||
| getConversationsResolved | See [**Total Resolved Conversations** in the API Docs](https://docs.saysimple.io/insights/index.html#operation/getResolvedCoversations) | | ||
| getConversationsResolveTimesAverage | See [**Get Conversations Resolve Times (Average)** in the API Docs](https://docs.saysimple.io/insights/index.html#operation/getConversationResolveTimesAverage) | | ||
| getConversationsResolveTimesMedian | See [**Get Conversations Resolve Times (Median)** in the API Docs](https://docs.saysimple.io/insights/index.html#operation/getConversationResolveTimesMedian) | | ||
| resolveConversation | See [**Resolve a Conversation** in the API Docs](https://docs.saysimple.io/insights/index.html#operation/postEventsConversationsResolve) | | ||
| getConversationsFirstReplyTimesAverage | See [**Get Conversations Reply Times (Average)** in the API Docs](https://docs.saysimple.io/insights/index.html#operation/getConversationsFirstReplyTimesAverage) | | ||
| getConversationsFirstReplyTimesMedian | See [**Get Conversations Reply Times (Median)** in the API Docs](https://docs.saysimple.io/insights/index.html#operation/getConversationsFirstReplyTimesMedian) | | ||
| getConversationsMessagesAverage | See [**Average Messages per Conversation** in the API Docs](https://docs.saysimple.io/insights/index.html#operation/getConversationsMessagesAverage) | | ||
| getConversationsTagsUsed | See [**Conversations Tags Used** in the API Docs](https://docs.saysimple.io/insights/index.html#operation/getConversationsTags) | | ||
| getMessagesResponseTimesAverage | See [**Response Times (Average)** in the API Docs](https://docs.saysimple.io/insights/index.html#operation/getMessagesResponseTimesAverage) | | ||
@@ -74,3 +82,3 @@ To get all messages summed you can run the following code | ||
_Will be implemented as soon as possible. | ||
For now please refer to the [API documentation](https://api.saysimple.io/docs/messaging)._ | ||
For now please refer to the [API documentation](https://docs.saysimple.io/messaging/index.html)._ | ||
@@ -104,2 +112,3 @@ ## Showcasing š | ||
Copyright 2019 - 2020 Just Internet B.V. or its affiliates. All Rights Reserved. | ||
Copyright 2019 - 2021 Just Internet B.V. or its affiliates. All Rights Reserved. | ||
@@ -6,2 +6,3 @@ import { Domain } from "../domain"; | ||
import { AgentList } from "../../types/responses/intelligence/list-agents-response"; | ||
import { TagList } from "../../types/responses/intelligence/list-tags-response"; | ||
import { ListChannelsResponseInterface } from "../../types/responses/intelligence/list-channels-response"; | ||
@@ -58,2 +59,6 @@ | ||
public getTags(): Promise<Response<TagList>> { | ||
return this.getData<Response<TagList>>("/tags"); | ||
} | ||
public getMessageDistribution(opts?: MetricMessageParametersInterface): Promise<MetricDataResponseInterface> { | ||
@@ -105,2 +110,3 @@ return this.getData<MetricDataResponseInterface, MetricMessageParametersInterface>("/metrics/messages/distribution", opts); | ||
channel? : "*" | string[]; | ||
tag? : "*" | string[]; | ||
provider? : "*" | string[]; | ||
@@ -107,0 +113,0 @@ identifier? : "*" | string[]; |
@@ -225,2 +225,15 @@ import { | ||
it("should be able to get tags", async () => { | ||
const mockedClient = new HttpClient(); | ||
jest.spyOn(mockedClient, "get") | ||
.mockResolvedValue(new Response(200, "[\"support\", \"finance\"]")); | ||
const client = new Intelligence(mockedClient); | ||
const result = await client.getTags(); | ||
expect(mockedClient.get).toBeCalledWith("/tags", undefined); | ||
expect(result).toEqual([ "support", "finance" ]); | ||
}); | ||
it("should be able to get paid templates sent", async () => { | ||
@@ -227,0 +240,0 @@ const mockedClient = new HttpClient(); |
105662
2.78%61
5.17%1928
1.69%112
8.74%