intercom-client
Advanced tools
Comparing version 3.0.1 to 3.1.0
@@ -11,4 +11,6 @@ export interface AdminObject { | ||
team_ids: Array<number>; | ||
avatar: string; | ||
avatar: string | { | ||
image_url: string; | ||
}; | ||
} | ||
//# sourceMappingURL=admin.types.d.ts.map |
import { Client } from '.'; | ||
import { ArticleObject, TranslatedContentObject } from './article/article.types'; | ||
import { GenericDeletedResponse, Paginated } from './common/common.types'; | ||
import { GenericDeletedResponse, OperationById, Paginated } from './common/common.types'; | ||
export default class Article { | ||
@@ -24,5 +24,2 @@ private readonly client; | ||
} | ||
interface OperationById { | ||
id: string; | ||
} | ||
declare type ArticleFindByIdData = OperationById; | ||
@@ -29,0 +26,0 @@ declare type UpdateArticleData = Partial<CreateArticleData> & OperationById; |
@@ -5,11 +5,14 @@ import { Axios, AxiosDefaults } from 'axios'; | ||
import Company from './company'; | ||
import Contact from './contact'; | ||
import Conversation from './conversation'; | ||
import Contact from './contact'; | ||
import Count from './count'; | ||
import DataAttribute from './dataAttribute'; | ||
import Event from './event'; | ||
import HelpCenter from './helpCenter'; | ||
import Message from './message'; | ||
import Note from './note'; | ||
import Segment from './segment'; | ||
import Message from './message'; | ||
import Team from './team'; | ||
import Tag from './tag'; | ||
import Visitor from './visitor'; | ||
interface RequestOptions { | ||
@@ -43,2 +46,3 @@ url: string; | ||
conversations: Conversation; | ||
counts: Count; | ||
dataAttributes: DataAttribute; | ||
@@ -48,2 +52,3 @@ events: Event; | ||
messages: Message; | ||
notes: Note; | ||
segments: Segment; | ||
@@ -57,2 +62,3 @@ passwordPart?: string; | ||
usernamePart?: string; | ||
visitors: Visitor; | ||
constructor(args: Constructor); | ||
@@ -59,0 +65,0 @@ initiateAxiosInstance(): Axios; |
@@ -10,11 +10,14 @@ "use strict"; | ||
var company_1 = (0, tslib_1.__importDefault)(require("./company")); | ||
var contact_1 = (0, tslib_1.__importDefault)(require("./contact")); | ||
var conversation_1 = (0, tslib_1.__importDefault)(require("./conversation")); | ||
var contact_1 = (0, tslib_1.__importDefault)(require("./contact")); | ||
var count_1 = (0, tslib_1.__importDefault)(require("./count")); | ||
var dataAttribute_1 = (0, tslib_1.__importDefault)(require("./dataAttribute")); | ||
var event_1 = (0, tslib_1.__importDefault)(require("./event")); | ||
var helpCenter_1 = (0, tslib_1.__importDefault)(require("./helpCenter")); | ||
var message_1 = (0, tslib_1.__importDefault)(require("./message")); | ||
var note_1 = (0, tslib_1.__importDefault)(require("./note")); | ||
var segment_1 = (0, tslib_1.__importDefault)(require("./segment")); | ||
var message_1 = (0, tslib_1.__importDefault)(require("./message")); | ||
var team_1 = (0, tslib_1.__importDefault)(require("./team")); | ||
var tag_1 = (0, tslib_1.__importDefault)(require("./tag")); | ||
var visitor_1 = (0, tslib_1.__importDefault)(require("./visitor")); | ||
var packageJson = (0, tslib_1.__importStar)(require("../package.json")); | ||
@@ -36,2 +39,3 @@ var badResponse_error_1 = require("./errors/badResponse.error"); | ||
this.conversations = new conversation_1.default(this); | ||
this.counts = new count_1.default(this); | ||
this.dataAttributes = new dataAttribute_1.default(this); | ||
@@ -41,5 +45,7 @@ this.events = new event_1.default(this); | ||
this.messages = new message_1.default(this); | ||
this.notes = new note_1.default(this); | ||
this.segments = new segment_1.default(this); | ||
this.tags = new tag_1.default(this); | ||
this.teams = new team_1.default(this); | ||
this.visitors = new visitor_1.default(this); | ||
this.requestOpts = { | ||
@@ -46,0 +52,0 @@ baseURL: 'https://api.intercom.io', |
@@ -63,3 +63,6 @@ export declare type StringifiedTimestamp = string; | ||
} | ||
export interface OperationById { | ||
id: string; | ||
} | ||
export {}; | ||
//# sourceMappingURL=common.types.d.ts.map |
import { Client } from '.'; | ||
import { GenericDeletedResponse, Paginated } from './common/common.types'; | ||
import { GenericDeletedResponse, OperationById, Paginated } from './common/common.types'; | ||
import { CollectionObject, GroupTranslatedContentObject, SectionObject } from './helpCenter/helpCenter.types'; | ||
@@ -57,6 +57,3 @@ export default class HelpCenter { | ||
declare type SectionListResponse = Paginated<SectionObject>; | ||
interface OperationById { | ||
id: string; | ||
} | ||
export {}; | ||
//# sourceMappingURL=helpCenter.d.ts.map |
@@ -14,2 +14,3 @@ export declare class IdentityVerification { | ||
export * from './conversation/conversation.types'; | ||
export * from './count/count.types'; | ||
export * from './dataAttribute/dataAttribute.types'; | ||
@@ -19,2 +20,3 @@ export * from './event/event.types'; | ||
export * from './message/message.types'; | ||
export * from './note/note.types'; | ||
export * from './segment/segment.types'; | ||
@@ -24,5 +26,7 @@ export * from './subscription/subscription.types'; | ||
export * from './team/team.types'; | ||
export * from './visitor/visitor.types'; | ||
export { SearchContactOrderBy } from './contact'; | ||
export { ReplyToConversationMessageType, ReplyToConversationUserType, AssignToConversationMessageType, AssignToConversationUserType, SnoozeConversationMessageType, CloseConversationMessageType, CloseConversationType, OpenConversationMessageType, SearchConversationOrderBy, SortBy, RedactConversationPartType, } from './conversation'; | ||
export { RecepientType } from './message'; | ||
export { ContactObjectForMerge, MergeVisitorToContactData, VisitorObjectForMerge, IdentificationForVisitor, } from './visitor'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -34,2 +34,3 @@ "use strict"; | ||
(0, tslib_1.__exportStar)(require("./conversation/conversation.types"), exports); | ||
(0, tslib_1.__exportStar)(require("./count/count.types"), exports); | ||
(0, tslib_1.__exportStar)(require("./dataAttribute/dataAttribute.types"), exports); | ||
@@ -39,2 +40,3 @@ (0, tslib_1.__exportStar)(require("./event/event.types"), exports); | ||
(0, tslib_1.__exportStar)(require("./message/message.types"), exports); | ||
(0, tslib_1.__exportStar)(require("./note/note.types"), exports); | ||
(0, tslib_1.__exportStar)(require("./segment/segment.types"), exports); | ||
@@ -44,2 +46,3 @@ (0, tslib_1.__exportStar)(require("./subscription/subscription.types"), exports); | ||
(0, tslib_1.__exportStar)(require("./team/team.types"), exports); | ||
(0, tslib_1.__exportStar)(require("./visitor/visitor.types"), exports); | ||
// Export enums needed for requests | ||
@@ -46,0 +49,0 @@ var contact_1 = require("./contact"); |
{ | ||
"name": "intercom-client", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"description": "Official Node bindings to the Intercom API", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/intercom/intercom-node", |
{ | ||
"name": "intercom-client", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"description": "Official Node bindings to the Intercom API", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/intercom/intercom-node", |
132
README.md
@@ -749,2 +749,58 @@ # intercom-node | ||
### Counts | ||
#### [App Total Count](https://developers.intercom.com/intercom-api-reference/reference/company-user-counts) | ||
```typescript | ||
const response = await client.counts.forApp(); | ||
``` | ||
#### [Conversation Count Model](https://developers.intercom.com/intercom-api-reference/reference/conversation-counts) | ||
```typescript | ||
const response = await client.counts.countConversation(); | ||
``` | ||
#### [Admin Conversation Count Model](https://developers.intercom.com/intercom-api-reference/reference/admin-conversations) | ||
```typescript | ||
const response = await client.counts.countAdminConversation(); | ||
``` | ||
#### [User Segment/Tag Count Model](https://developers.intercom.com/intercom-api-reference/reference/user-tag-counts) | ||
##### Count User Segment | ||
```typescript | ||
const response = await client.counts.countUserSegment(); | ||
``` | ||
##### Count User Tag | ||
```typescript | ||
const response = await client.counts.countUserTag(); | ||
``` | ||
#### [Company User/Segment/Tag Count Model](https://developers.intercom.com/intercom-api-reference/reference/company-tag-counts) | ||
##### Count Company Segment | ||
```typescript | ||
const response = await client.counts.countCompanySegment(); | ||
const response = await client.counts.countCompanyTag(); | ||
const response = await client.counts.countCompanyUser(); | ||
``` | ||
##### Count Company Tag | ||
```typescript | ||
const response = await client.counts.countCompanyTag(); | ||
``` | ||
##### Count Company User | ||
```typescript | ||
const response = await client.counts.countCompanyUser(); | ||
``` | ||
### Data Attributes | ||
@@ -952,2 +1008,30 @@ | ||
### Notes | ||
#### [Create a note](https://developers.intercom.com/intercom-api-reference/reference/create-note-for-contact) | ||
```typescript | ||
const response = await client.notes.create({ | ||
adminId: '12345', | ||
body: 'Shiny', | ||
contactId: '5678', | ||
}); | ||
``` | ||
#### [Retrieve a note](https://developers.intercom.com/intercom-api-reference/reference/view-a-note) | ||
```typescript | ||
const response = await client.notes.find({ id: '123' }); | ||
``` | ||
#### [List all notes](https://developers.intercom.com/intercom-api-reference/reference/list-notes-of-contact) | ||
```typescript | ||
const response = await client.notes.list({ | ||
contactId: '123', | ||
page: 2, | ||
perPage: 3, | ||
}); | ||
``` | ||
### Segments | ||
@@ -1072,2 +1156,50 @@ | ||
### Visitors | ||
#### [Retrieve a Visitor](https://developers.intercom.com/intercom-api-reference/reference/view-a-visitor) | ||
```typescript | ||
const response = await client.visitors.find({ id: '123' }); | ||
``` | ||
OR | ||
```typescript | ||
const response = await client.visitors.find({ userId: '123' }); | ||
``` | ||
#### [Update a Visitor](https://developers.intercom.com/intercom-api-reference/reference/update-a-visitor) | ||
```typescript | ||
const response = await client.visitors.update({ | ||
userId: '123', | ||
name: 'anonymous bruh', | ||
customAttributes: { | ||
paid_subscriber: true, | ||
}, | ||
}); | ||
``` | ||
#### [Delete a Visitor](https://developers.intercom.com/intercom-api-reference/reference/delete-a-visitor) | ||
```typescript | ||
const response = await client.visitors.delete({ | ||
id, | ||
}); | ||
``` | ||
#### [Convert a Visitor](https://developers.intercom.com/intercom-api-reference/reference/convert-a-visitor-to-a-user) | ||
```typescript | ||
const response = await client.visitors.mergeToContact({ | ||
visitor: { | ||
id: '123', | ||
}, | ||
user: { | ||
userId: '123', | ||
}, | ||
type: Role.USER, | ||
}); | ||
``` | ||
### Identity verification | ||
@@ -1074,0 +1206,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
257477
156
3423
1234