Skip to content

Commit

Permalink
Use 0.1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
esme committed Oct 23, 2023
2 parents 9ed1a8e + 3a337e6 commit 50bae54
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "arrowParens": "avoid" }
{ "arrowParens": "avoid", "trailingComma": "all" }
9 changes: 9 additions & 0 deletions demos/demo-minimal-js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ const cti = new CallingExtensions({
state.engagementId = engagementId;
},
onCreateEngagementFailed: (data, rawEvent) => {},
onUpdateEngagementSucceeded: (data, rawEvent) => {
const { engagementId } = data;
state.engagementId = engagementId;
},
onUpdateEngagementFailed: (data, rawEvent) => {},
},
});

Expand Down Expand Up @@ -163,6 +168,10 @@ export function completeCall() {
cti.callCompleted({
engagementId: state.engagementId,
hideWidget: false,
engagementProperties: {
hs_call_title: "Demo call",
hs_call_body: "Resolved issue",
},
});
disableButtons([COMPLETE_CALL]);
enableButtons([OUTGOING_CALL, INCOMING_CALL, USER_UNAVAILABLE]);
Expand Down
14 changes: 7 additions & 7 deletions demos/demo-minimal-js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion demos/demo-minimal-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"webpack-dev-server": "^4.11.1"
},
"dependencies": {
"@hubspot/calling-extensions-sdk": "^0.1.8-alpha.0"
"@hubspot/calling-extensions-sdk": "^0.1.8"
}
}
14 changes: 7 additions & 7 deletions demos/demo-react-ts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion demos/demo-react-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"node": ">=14"
},
"dependencies": {
"@hubspot/calling-extensions-sdk": "0.1.7",
"@hubspot/calling-extensions-sdk": "^0.1.8",
"react": "^18.2.0",
"react-aria": "^3.22.0",
"react-dom": "^18.2.0",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hubspot/calling-extensions-sdk",
"version": "0.1.8-alpha.0",
"version": "0.1.8",
"description": "HubSpot calling extensions sdk for call widget integration.",
"publishConfig": {
"access": "public"
Expand Down
12 changes: 11 additions & 1 deletion src/CallingExtensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class CallingExtensions {
const { onSetCallState } = eventHandlers;
handler = onSetCallState;
break;
}
},
case messageType.CREATE_ENGAGEMENT_SUCCEEDED: {
const { onCreateEngagementSucceeded } = eventHandlers;
handler = onCreateEngagementSucceeded;
Expand All @@ -173,6 +173,16 @@ class CallingExtensions {
const { onCreateEngagementFailed } = eventHandlers;
handler = onCreateEngagementFailed;
break;
},
case messageType.UPDATE_ENGAGEMENT_FAILED: {
const { onUpdateEngagementFailed } = eventHandlers;
handler = onUpdateEngagementFailed;
break;
}
case messageType.UPDATE_ENGAGEMENT_SUCCEEDED: {
const { onUpdateEngagementSucceeded } = eventHandlers;
handler = onUpdateEngagementSucceeded;
break;
}
default: {
// Send back a message indicating an unknown event is received
Expand Down
9 changes: 7 additions & 2 deletions src/Constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ export const messageType = {
CALL_COMPLETED: "CALL_COMPLETED",
CALL_DATA: "CALL_DATA",
CALL_ENDED: "CALL_ENDED",
CREATE_ENGAGEMENT_FAILED: "CREATE_ENGAGEMENT_FAILED",
CREATE_ENGAGEMENT_SUCCEEDED: "CREATE_ENGAGEMENT_SUCCEEDED",
DIAL_NUMBER: "DIAL_NUMBER",
END_CALL: "END_CALL",
/**
* @deprecated use CREATE_ENGAGEMENT_SUCCEEDED instead
*/
ENGAGEMENT_CREATED: "ENGAGEMENT_CREATED",
ERROR: "ERROR",
INCOMING_CALL: "INCOMING_CALL",
Expand All @@ -27,9 +32,9 @@ export const messageType = {
UNLOADING: "UNLOADING",
USER_AVAILABLE: "USER_AVAILABLE",
USER_UNAVAILABLE: "USER_UNAVAILABLE",
UPDATE_ENGAGEMENT_FAILED: "UPDATE_ENGAGEMENT_FAILED",
UPDATE_ENGAGEMENT_SUCCEEDED: "UPDATE_ENGAGEMENT_SUCCEEDED",
VISIBILITY_CHANGED: "VISIBILITY_CHANGED",
CREATE_ENGAGEMENT_SUCCEEDED: "CREATE_ENGAGEMENT_SUCCEEDED",
CREATE_ENGAGEMENT_FAILED: "CREATE_ENGAGEMENT_FAILED",
};

export const errorType = {
Expand Down

0 comments on commit 50bae54

Please sign in to comment.