Socket
Socket
Sign inDemoInstall

crisp-sdk-web

Package Overview
Dependencies
Maintainers
3
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crisp-sdk-web - npm Package Compare versions

Comparing version 1.0.22 to 1.0.23

15

dist/crisp.d.ts

@@ -47,2 +47,3 @@ type FileMessage = {

constructor(crisp: Crisp);
fillText(content: string): void;
send(type: string, content: string | FileMessage | AnimationMessage | AudioMessage): void;

@@ -65,5 +66,9 @@ sendText(content: string): void;

onMessageSent(callback: Function): void;
offMessageSent(): void;
onMessageReceived(callback: Function): void;
offMessageReceived(): void;
onMessageComposeSent(callback: Function): void;
offMessageComposeSent(): void;
onMessageComposeReceived(callback: Function): void;
offMessageComposeReceived(): void;
}

@@ -99,5 +104,9 @@

onEmailChanged(callback: Function): void;
offEmailChanged(): void;
onPhoneChanged(callback: Function): void;
offPhoneChanged(): void;
onNicknameChanged(callback: Function): void;
offNicknameChanged(): void;
onAvatarChanged(callback: Function): void;
offAvatarChanged(): void;
}

@@ -133,2 +142,3 @@

onLoaded(callback: Function): void;
offLoaded(): void;
private isValidDataValue;

@@ -151,5 +161,9 @@ }

onChatInitiated(callback: () => void): void;
offChatInitiated(): void;
onChatOpened(callback: () => void): void;
offChatOpened(): void;
onChatClosed(callback: () => void): void;
offChatClosed(): void;
onHelpdeskQueried(callback: Function): void;
offHelpdeskQueried(): void;
}

@@ -235,2 +249,3 @@

onWebsiteAvailabilityChanged(callback: Function): void;
offWebsiteAvailabilityChanged(): void;
createSingletonIfNecessary(): void;

@@ -237,0 +252,0 @@ autoInjectIfNecessary(): void;

94

dist/crisp.esm.js

@@ -5,2 +5,6 @@ var CrispMessage = /** @class */ (function () {

}
CrispMessage.prototype.fillText = function (content) {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["set", "message:text", [content]]);
};
CrispMessage.prototype.send = function (type, content) {

@@ -61,20 +65,36 @@ this.parent.createSingletonIfNecessary();

this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "message:sent"]);
this.offMessageSent();
window.$crisp.push(["on", "message:sent", callback]);
};
CrispMessage.prototype.offMessageSent = function () {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "message:sent"]);
};
CrispMessage.prototype.onMessageReceived = function (callback) {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "message:received"]);
this.offMessageReceived();
window.$crisp.push(["on", "message:received", callback]);
};
CrispMessage.prototype.offMessageReceived = function () {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "message:received"]);
};
CrispMessage.prototype.onMessageComposeSent = function (callback) {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "message:compose:sent"]);
this.offMessageComposeSent();
window.$crisp.push(["on", "message:compose:sent", callback]);
};
CrispMessage.prototype.offMessageComposeSent = function () {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "message:compose:sent"]);
};
CrispMessage.prototype.onMessageComposeReceived = function (callback) {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "message:compose:received"]);
this.offMessageComposeReceived();
window.$crisp.push(["on", "message:compose:received", callback]);
};
CrispMessage.prototype.offMessageComposeReceived = function () {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "message:compose:received"]);
};
return CrispMessage;

@@ -154,24 +174,44 @@ }());

if (this.parent.isCrispInjected()) {
window.$crisp.push(["off", "user:email:changed"]);
this.offEmailChanged();
window.$crisp.push(["on", "user:email:changed", callback]);
}
};
CrispUser.prototype.offEmailChanged = function () {
if (this.parent.isCrispInjected()) {
window.$crisp.push(["off", "user:email:changed"]);
}
};
CrispUser.prototype.onPhoneChanged = function (callback) {
if (this.parent.isCrispInjected()) {
window.$crisp.push(["off", "user:phone:changed"]);
this.offPhoneChanged();
window.$crisp.push(["on", "user:phone:changed", callback]);
}
};
CrispUser.prototype.offPhoneChanged = function () {
if (this.parent.isCrispInjected()) {
window.$crisp.push(["off", "user:phone:changed"]);
}
};
CrispUser.prototype.onNicknameChanged = function (callback) {
if (this.parent.isCrispInjected()) {
window.$crisp.push(["off", "user:nickname:changed"]);
this.offNicknameChanged();
window.$crisp.push(["on", "user:nickname:changed", callback]);
}
};
CrispUser.prototype.offNicknameChanged = function () {
if (this.parent.isCrispInjected()) {
window.$crisp.push(["off", "user:nickname:changed"]);
}
};
CrispUser.prototype.onAvatarChanged = function (callback) {
if (this.parent.isCrispInjected()) {
window.$crisp.push(["off", "user:avatar:changed"]);
this.offAvatarChanged();
window.$crisp.push(["on", "user:avatar:changed", callback]);
}
};
CrispUser.prototype.offAvatarChanged = function () {
if (this.parent.isCrispInjected()) {
window.$crisp.push(["off", "user:avatar:changed"]);
}
};
return CrispUser;

@@ -211,3 +251,3 @@ }());

if (this.parent.isCrispInjected()) {
window.$crisp.do("session:reset", [reload]);
window.$crisp.push(["do", "session:reset", [reload]]);
}

@@ -251,5 +291,9 @@ };

this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "session:loaded"]);
this.offLoaded();
window.$crisp.push(["on", "session:loaded", callback]);
};
CrispSession.prototype.offLoaded = function () {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "session:loaded"]);
};
CrispSession.prototype.isValidDataValue = function (value) {

@@ -316,20 +360,36 @@ return (typeof value === "string" ||

this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "chat:initiated"]);
this.offChatInitiated();
window.$crisp.push(["on", "chat:initiated", callback]);
};
CrispChat.prototype.offChatInitiated = function () {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "chat:initiated"]);
};
CrispChat.prototype.onChatOpened = function (callback) {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "chat:opened"]);
this.offChatOpened();
window.$crisp.push(["on", "chat:opened", callback]);
};
CrispChat.prototype.offChatOpened = function () {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "chat:opened"]);
};
CrispChat.prototype.onChatClosed = function (callback) {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "chat:closed"]);
this.offChatClosed();
window.$crisp.push(["on", "chat:closed", callback]);
};
CrispChat.prototype.offChatClosed = function () {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "chat:closed"]);
};
CrispChat.prototype.onHelpdeskQueried = function (callback) {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "helpdesk:queried"]);
this.offHelpdeskQueried();
window.$crisp.push(["on", "helpdesk:queried", callback]);
};
CrispChat.prototype.offHelpdeskQueried = function () {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "helpdesk:queried"]);
};
return CrispChat;

@@ -501,5 +561,9 @@ }());

this.createSingletonIfNecessary();
window.$crisp.push(["off", "website:availability:changed"]);
this.offWebsiteAvailabilityChanged();
window.$crisp.push(["on", "website:availability:changed", callback]);
};
Crisp.prototype.offWebsiteAvailabilityChanged = function () {
this.createSingletonIfNecessary();
window.$crisp.push(["off", "website:availability:changed"]);
};
Crisp.prototype.createSingletonIfNecessary = function () {

@@ -506,0 +570,0 @@ // Assigns $crisp singleton

@@ -11,2 +11,6 @@ (function (global, factory) {

}
CrispMessage.prototype.fillText = function (content) {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["set", "message:text", [content]]);
};
CrispMessage.prototype.send = function (type, content) {

@@ -67,20 +71,36 @@ this.parent.createSingletonIfNecessary();

this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "message:sent"]);
this.offMessageSent();
window.$crisp.push(["on", "message:sent", callback]);
};
CrispMessage.prototype.offMessageSent = function () {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "message:sent"]);
};
CrispMessage.prototype.onMessageReceived = function (callback) {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "message:received"]);
this.offMessageReceived();
window.$crisp.push(["on", "message:received", callback]);
};
CrispMessage.prototype.offMessageReceived = function () {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "message:received"]);
};
CrispMessage.prototype.onMessageComposeSent = function (callback) {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "message:compose:sent"]);
this.offMessageComposeSent();
window.$crisp.push(["on", "message:compose:sent", callback]);
};
CrispMessage.prototype.offMessageComposeSent = function () {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "message:compose:sent"]);
};
CrispMessage.prototype.onMessageComposeReceived = function (callback) {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "message:compose:received"]);
this.offMessageComposeReceived();
window.$crisp.push(["on", "message:compose:received", callback]);
};
CrispMessage.prototype.offMessageComposeReceived = function () {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "message:compose:received"]);
};
return CrispMessage;

@@ -160,24 +180,44 @@ }());

if (this.parent.isCrispInjected()) {
window.$crisp.push(["off", "user:email:changed"]);
this.offEmailChanged();
window.$crisp.push(["on", "user:email:changed", callback]);
}
};
CrispUser.prototype.offEmailChanged = function () {
if (this.parent.isCrispInjected()) {
window.$crisp.push(["off", "user:email:changed"]);
}
};
CrispUser.prototype.onPhoneChanged = function (callback) {
if (this.parent.isCrispInjected()) {
window.$crisp.push(["off", "user:phone:changed"]);
this.offPhoneChanged();
window.$crisp.push(["on", "user:phone:changed", callback]);
}
};
CrispUser.prototype.offPhoneChanged = function () {
if (this.parent.isCrispInjected()) {
window.$crisp.push(["off", "user:phone:changed"]);
}
};
CrispUser.prototype.onNicknameChanged = function (callback) {
if (this.parent.isCrispInjected()) {
window.$crisp.push(["off", "user:nickname:changed"]);
this.offNicknameChanged();
window.$crisp.push(["on", "user:nickname:changed", callback]);
}
};
CrispUser.prototype.offNicknameChanged = function () {
if (this.parent.isCrispInjected()) {
window.$crisp.push(["off", "user:nickname:changed"]);
}
};
CrispUser.prototype.onAvatarChanged = function (callback) {
if (this.parent.isCrispInjected()) {
window.$crisp.push(["off", "user:avatar:changed"]);
this.offAvatarChanged();
window.$crisp.push(["on", "user:avatar:changed", callback]);
}
};
CrispUser.prototype.offAvatarChanged = function () {
if (this.parent.isCrispInjected()) {
window.$crisp.push(["off", "user:avatar:changed"]);
}
};
return CrispUser;

@@ -217,3 +257,3 @@ }());

if (this.parent.isCrispInjected()) {
window.$crisp.do("session:reset", [reload]);
window.$crisp.push(["do", "session:reset", [reload]]);
}

@@ -257,5 +297,9 @@ };

this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "session:loaded"]);
this.offLoaded();
window.$crisp.push(["on", "session:loaded", callback]);
};
CrispSession.prototype.offLoaded = function () {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "session:loaded"]);
};
CrispSession.prototype.isValidDataValue = function (value) {

@@ -322,20 +366,36 @@ return (typeof value === "string" ||

this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "chat:initiated"]);
this.offChatInitiated();
window.$crisp.push(["on", "chat:initiated", callback]);
};
CrispChat.prototype.offChatInitiated = function () {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "chat:initiated"]);
};
CrispChat.prototype.onChatOpened = function (callback) {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "chat:opened"]);
this.offChatOpened();
window.$crisp.push(["on", "chat:opened", callback]);
};
CrispChat.prototype.offChatOpened = function () {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "chat:opened"]);
};
CrispChat.prototype.onChatClosed = function (callback) {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "chat:closed"]);
this.offChatClosed();
window.$crisp.push(["on", "chat:closed", callback]);
};
CrispChat.prototype.offChatClosed = function () {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "chat:closed"]);
};
CrispChat.prototype.onHelpdeskQueried = function (callback) {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "helpdesk:queried"]);
this.offHelpdeskQueried();
window.$crisp.push(["on", "helpdesk:queried", callback]);
};
CrispChat.prototype.offHelpdeskQueried = function () {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "helpdesk:queried"]);
};
return CrispChat;

@@ -507,5 +567,9 @@ }());

this.createSingletonIfNecessary();
window.$crisp.push(["off", "website:availability:changed"]);
this.offWebsiteAvailabilityChanged();
window.$crisp.push(["on", "website:availability:changed", callback]);
};
Crisp.prototype.offWebsiteAvailabilityChanged = function () {
this.createSingletonIfNecessary();
window.$crisp.push(["off", "website:availability:changed"]);
};
Crisp.prototype.createSingletonIfNecessary = function () {

@@ -512,0 +576,0 @@ // Assigns $crisp singleton

2

package.json
{
"name": "crisp-sdk-web",
"version": "1.0.22",
"version": "1.0.23",
"description": "Include Crisp chat widget inside web frameworks.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -79,26 +79,54 @@ import { CrispClass as Crisp } from "./index";

window.$crisp.push(["off", "chat:initiated"]);
this.offChatInitiated();
window.$crisp.push(["on", "chat:initiated", callback]);
}
offChatInitiated() {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "chat:initiated"]);
}
onChatOpened(callback: () => void) {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "chat:opened"]);
this.offChatOpened();
window.$crisp.push(["on", "chat:opened", callback]);
}
offChatOpened() {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "chat:opened"]);
}
onChatClosed(callback: () => void) {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "chat:closed"]);
this.offChatClosed();
window.$crisp.push(["on", "chat:closed", callback]);
}
offChatClosed() {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "chat:closed"]);
}
onHelpdeskQueried(callback: Function) {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "helpdesk:queried"]);
this.offHelpdeskQueried();
window.$crisp.push(["on", "helpdesk:queried", callback]);
}
offHelpdeskQueried() {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "helpdesk:queried"]);
}
}

@@ -278,6 +278,13 @@ import CrispMessage from "./message";

window.$crisp.push(["off", "website:availability:changed"]);
this.offWebsiteAvailabilityChanged();
window.$crisp.push(["on", "website:availability:changed", callback]);
}
offWebsiteAvailabilityChanged() {
this.createSingletonIfNecessary();
window.$crisp.push(["off", "website:availability:changed"]);
}
createSingletonIfNecessary() {

@@ -284,0 +291,0 @@ // Assigns $crisp singleton

@@ -62,2 +62,8 @@ import { CrispClass as Crisp } from "./index";

fillText(content: string) {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["set", "message:text", [content]]);
}
send(type: string, content: string | FileMessage | AnimationMessage | AudioMessage) {

@@ -140,26 +146,54 @@ this.parent.createSingletonIfNecessary();

window.$crisp.push(["off", "message:sent"]);
this.offMessageSent();
window.$crisp.push(["on", "message:sent", callback]);
}
offMessageSent() {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "message:sent"]);
}
onMessageReceived(callback: Function) {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "message:received"]);
this.offMessageReceived();
window.$crisp.push(["on", "message:received", callback]);
}
offMessageReceived() {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "message:received"]);
}
onMessageComposeSent(callback: Function) {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "message:compose:sent"]);
this.offMessageComposeSent();
window.$crisp.push(["on", "message:compose:sent", callback]);
}
offMessageComposeSent() {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "message:compose:sent"]);
}
onMessageComposeReceived(callback: Function) {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "message:compose:received"]);
this.offMessageComposeReceived();
window.$crisp.push(["on", "message:compose:received", callback]);
}
offMessageComposeReceived() {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "message:compose:received"]);
}
}

@@ -25,3 +25,3 @@ import { CrispClass as Crisp } from "./index";

if (this.parent.isCrispInjected()) {
window.$crisp.do("session:reset", [reload]);
window.$crisp.push(["do", "session:reset", [reload]]);
}

@@ -72,10 +72,16 @@ }

onLoaded(callback: Function) {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "session:loaded"]);
this.offLoaded();
window.$crisp.push(["on", "session:loaded", callback]);
}
offLoaded() {
this.parent.createSingletonIfNecessary();
window.$crisp.push(["off", "session:loaded"]);
}
private isValidDataValue(value: string): boolean {

@@ -82,0 +88,0 @@ return (

@@ -119,3 +119,4 @@ import { CrispClass as Crisp } from "./index";

if (this.parent.isCrispInjected()) {
window.$crisp.push(["off", "user:email:changed"]);
this.offEmailChanged();
window.$crisp.push(["on", "user:email:changed", callback]);

@@ -125,5 +126,12 @@ }

offEmailChanged() {
if (this.parent.isCrispInjected()) {
window.$crisp.push(["off", "user:email:changed"]);
}
}
onPhoneChanged(callback: Function) {
if (this.parent.isCrispInjected()) {
window.$crisp.push(["off", "user:phone:changed"]);
this.offPhoneChanged();
window.$crisp.push(["on", "user:phone:changed", callback]);

@@ -133,5 +141,12 @@ }

offPhoneChanged() {
if (this.parent.isCrispInjected()) {
window.$crisp.push(["off", "user:phone:changed"]);
}
}
onNicknameChanged(callback: Function) {
if (this.parent.isCrispInjected()) {
window.$crisp.push(["off", "user:nickname:changed"]);
this.offNicknameChanged();
window.$crisp.push(["on", "user:nickname:changed", callback]);

@@ -141,8 +156,21 @@ }

offNicknameChanged() {
if (this.parent.isCrispInjected()) {
window.$crisp.push(["off", "user:nickname:changed"]);
}
}
onAvatarChanged(callback: Function) {
if (this.parent.isCrispInjected()) {
window.$crisp.push(["off", "user:avatar:changed"]);
this.offAvatarChanged();
window.$crisp.push(["on", "user:avatar:changed", callback]);
}
}
offAvatarChanged() {
if (this.parent.isCrispInjected()) {
window.$crisp.push(["off", "user:avatar:changed"]);
}
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc