This repository has been archived by the owner on Sep 16, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* removed install state for rebasing * slack integration with refactored code * removed cert.pem * client side updated with respect to slack integration * localhost https configs removed * Refactored code worked successfully with hubspot * Added PubSub for chat feature * removed install-state to fix rebase * make improvements & fixes post testing * update header text --------- Co-authored-by: Ashutosh Dhande <[email protected]>
- Loading branch information
1 parent
a8a5faf
commit 1176f76
Showing
37 changed files
with
909 additions
and
89 deletions.
There are no files selected for viewing
Binary file not shown.
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,45 @@ | ||
imports: | ||
errors: ../common/errors.yml | ||
types: ../common/types.yml | ||
unified: ../common/unified.yml | ||
associations: ../common/associations.yml | ||
|
||
types: | ||
GetChannelsResponse: | ||
properties: | ||
status: types.ResponseStatus | ||
next: optional<string> | ||
previous: optional<string> | ||
results: list<unified.Channel> | ||
|
||
service: | ||
base-path: /chat/channels | ||
auth: false | ||
headers: | ||
x-revert-api-token: | ||
type: string | ||
docs: Your official API key for accessing revert apis. | ||
x-revert-t-id: | ||
type: string | ||
docs: The unique customer id used when the customer linked their account. | ||
x-api-version: | ||
type: optional<string> | ||
docs: Optional Revert API version you're using. If missing we default to the latest version of the API. | ||
audiences: | ||
- external | ||
endpoints: | ||
getChannels: | ||
docs: Get all the channels | ||
method: GET | ||
path: '' | ||
request: | ||
name: GetChannelsRequest | ||
query-parameters: | ||
fields: optional<string> | ||
pageSize: optional<string> | ||
cursor: optional<string> | ||
response: GetChannelsResponse | ||
errors: | ||
- errors.UnAuthorizedError | ||
- errors.InternalServerError | ||
- errors.NotFoundError |
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,43 @@ | ||
imports: | ||
errors: ../common/errors.yml | ||
types: ../common/types.yml | ||
unified: ../common/unified.yml | ||
associations: ../common/associations.yml | ||
|
||
types: | ||
CreateorUpdateMessageRequest: | ||
extends: unified.Message | ||
CreateorUpdateMessageResponse: | ||
properties: | ||
status: types.ResponseStatus | ||
result: unified.Message | ||
|
||
service: | ||
base-path: /chat/message | ||
auth: false | ||
headers: | ||
x-revert-api-token: | ||
type: string | ||
docs: Your official API key for accessing revert apis. | ||
x-revert-t-id: | ||
type: string | ||
docs: The unique customer id used when the customer linked their account. | ||
x-api-version: | ||
type: optional<string> | ||
docs: Optional Revert API version you're using. If missing we default to the latest version of the API. | ||
audiences: | ||
- external | ||
endpoints: | ||
createMessage: | ||
docs: Create a new message | ||
method: POST | ||
path: '' | ||
request: | ||
name: CreateMessageRequest | ||
body: CreateorUpdateMessageRequest | ||
response: CreateorUpdateMessageResponse | ||
errors: | ||
- errors.UnAuthorizedError | ||
- errors.InternalServerError | ||
- errors.NotFoundError | ||
- errors.BadRequestError |
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,45 @@ | ||
imports: | ||
errors: ../common/errors.yml | ||
types: ../common/types.yml | ||
unified: ../common/unified.yml | ||
associations: ../common/associations.yml | ||
|
||
types: | ||
GetUsersResponse: | ||
properties: | ||
status: types.ResponseStatus | ||
next: optional<string> | ||
previous: optional<string> | ||
results: list<unified.UserChat> | ||
|
||
service: | ||
base-path: /chat/users | ||
auth: false | ||
headers: | ||
x-revert-api-token: | ||
type: string | ||
docs: Your official API key for accessing revert apis. | ||
x-revert-t-id: | ||
type: string | ||
docs: The unique customer id used when the customer linked their account. | ||
x-api-version: | ||
type: optional<string> | ||
docs: Optional Revert API version you're using. If missing we default to the latest version of the API. | ||
audiences: | ||
- external | ||
endpoints: | ||
getUsers: | ||
docs: Get all the users | ||
method: GET | ||
path: '' | ||
request: | ||
name: GetUsersRequest | ||
query-parameters: | ||
fields: optional<string> | ||
pageSize: optional<string> | ||
cursor: optional<string> | ||
response: GetUsersResponse | ||
errors: | ||
- errors.UnAuthorizedError | ||
- errors.InternalServerError | ||
- errors.NotFoundError |
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 |
---|---|---|
|
@@ -49,6 +49,7 @@ types: | |
- zohocrm | ||
- sfdc | ||
- pipedrive | ||
- slack | ||
StandardObject: | ||
enum: | ||
- company | ||
|
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
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,24 @@ | ||
export interface UnifiedChannel { | ||
id: string; | ||
name: string; | ||
createdTimeStamp: string; | ||
additional: any; | ||
} | ||
|
||
export function unifyChannel(channel: any) { | ||
const unifiedChannel: UnifiedChannel = { | ||
id: channel.id, | ||
name: channel.name_normalized, | ||
createdTimeStamp: new Date(channel.created * 1000).toISOString(), | ||
additional: {}, | ||
}; | ||
|
||
// Map additional fields | ||
Object.keys(channel).forEach((key) => { | ||
if (!(key in unifiedChannel)) { | ||
unifiedChannel['additional'][key] = channel[key]; | ||
} | ||
}); | ||
|
||
return unifiedChannel; | ||
} |
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,24 @@ | ||
export interface UnifiedChatUser { | ||
id: string; | ||
name: string; | ||
createdTimeStamp: string; | ||
additional: any; | ||
} | ||
|
||
export function unifyChatUser(user: any): UnifiedChatUser { | ||
const unifiedUser: UnifiedChatUser = { | ||
id: user.id, | ||
name: user.real_name, | ||
createdTimeStamp: new Date(user.updated * 1000).toISOString(), | ||
additional: {}, | ||
}; | ||
|
||
// Map additional fields | ||
Object.keys(user).forEach((key) => { | ||
if (!(key in unifiedUser)) { | ||
unifiedUser['additional'][key] = user[key]; | ||
} | ||
}); | ||
|
||
return unifiedUser; | ||
} |
Oops, something went wrong.
1176f76
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
revert-client – ./
revert-client-revertdev.vercel.app
revert-client-git-main-revertdev.vercel.app
app.revert.dev