-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #303 from intercom/3.1.0
3.1.0 Release
- Loading branch information
Showing
17 changed files
with
752 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import { | ||
Client, | ||
CompanySegmentCountResponse, | ||
CompanyTagCountResponse, | ||
CompanyUserCountResponse, | ||
UserCountResponse, | ||
UserSegmentCountResponse, | ||
UserTagCountResponse, | ||
} from '.'; | ||
import { | ||
AdminConversationCountResponse, | ||
AppTotalCountResponse, | ||
CompanyCountResponse, | ||
ConversationCountResponse, | ||
CountEntity, | ||
CountType, | ||
} from './count/count.types'; | ||
|
||
export default class Count { | ||
public readonly baseUrl = 'counts'; | ||
|
||
constructor(private readonly client: Client) { | ||
this.client = client; | ||
} | ||
|
||
forApp() { | ||
return this.client.get<AppTotalCountResponse>({ | ||
url: `/${this.baseUrl}`, | ||
}); | ||
} | ||
|
||
countCompany() { | ||
return this.client.get<CompanyCountResponse>({ | ||
url: `/${this.baseUrl}`, | ||
params: { type: CountType.COMPANY }, | ||
}); | ||
} | ||
countCompanySegment() { | ||
return this.client.get<CompanySegmentCountResponse>({ | ||
url: `/${this.baseUrl}`, | ||
params: { type: CountType.COMPANY, count: CountEntity.SEGMENT }, | ||
}); | ||
} | ||
countCompanyTag() { | ||
return this.client.get<CompanyTagCountResponse>({ | ||
url: `/${this.baseUrl}`, | ||
params: { type: CountType.COMPANY, count: CountEntity.TAG }, | ||
}); | ||
} | ||
countCompanyUser() { | ||
return this.client.get<CompanyUserCountResponse>({ | ||
url: `/${this.baseUrl}`, | ||
params: { type: CountType.COMPANY, count: CountEntity.USER }, | ||
}); | ||
} | ||
countConversation() { | ||
return this.client.get<ConversationCountResponse>({ | ||
url: `/${this.baseUrl}`, | ||
params: { type: CountType.CONVERSATION }, | ||
}); | ||
} | ||
countAdminConversation() { | ||
return this.client.get<AdminConversationCountResponse>({ | ||
url: `/${this.baseUrl}`, | ||
params: { type: CountType.CONVERSATION, count: CountEntity.ADMIN }, | ||
}); | ||
} | ||
countUser() { | ||
return this.client.get<UserCountResponse>({ | ||
url: `/${this.baseUrl}`, | ||
params: { type: CountType.USER }, | ||
}); | ||
} | ||
countUserSegment() { | ||
return this.client.get<UserSegmentCountResponse>({ | ||
url: `/${this.baseUrl}`, | ||
params: { type: CountType.USER, count: CountEntity.SEGMENT }, | ||
}); | ||
} | ||
countUserTag() { | ||
return this.client.get<UserTagCountResponse>({ | ||
url: `/${this.baseUrl}`, | ||
params: { type: CountType.USER, count: CountEntity.TAG }, | ||
}); | ||
} | ||
} |
Oops, something went wrong.