Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@evo/chat-prom-desktop
Advanced tools
Desktop view package of @evo chat, with main data control module @evo/chat-core. All styles, images and translations are in build, so u don't need to worry about. It`s easy to mount, and push/subscribe on the events, through BesidaChat class. To quick start , follow basic usage guide.
npm install --save -E @evo/chat-prom-desktop
import { getUserInfo, init as initUserFetch } from '@evo/user-info';
import { BesidaChat } from '@evo/chat-prom-desktop';
// if u already have user, this step is unnecessary
initUserFetch(window.location.host);
let userInfo = {};
try { userInfo = await getUserInfo(); }
catch (_) { userInfo = null; }
if (userInfo && userInfo.id) {
config.initAppData.user_id = userInfo.id;
}
// some root node to mount in
const besidaRoot = document.getElementById('besida');
// it`s important to know, are u a company or a buyer
const userRoles = BesidaChat.userRoles/*.(company|buyer)*/;
const besidaObj = new BesidaChat(
initAppData, // base data for app to run, like context, theme, etc
config, // includes flags and temp deps to inject, like analytics
userRoles.buyer,
besidaRoot
);
In case u have mwa, first steps for init chat is similar to on DOM node rendering, except u must omit last node
param.
import React from 'react';
const besidaObj = new BesidaChat(
initAppData,
config,
userRoles.buyer
);
const BesidaChatApp = besidaObj.chatAppComponent;
class AwesomeApp extends React.Component {
render() {
return (
<React.Fragment>
<Header />
<Body> {BesidaChatApp} </Body>
<Footer />
</React.Fragment>
);
}
}
Once u create a valid BesidaChat instance, u can import it in any numbers of ur modules, it`ll be the same chat, u have created on ur app start.
BesidaChat.instance.dispatchEvent('openDialog', params || { node: target });
U can pick, from public actions
list, for now there are:
openDialog
- open chat window, if u want to open room with cntx send, u should give this obj as arg:
const params = {
theme: '345345_buyer' // first part, before `_` is company id
// rest is product data, u want to see in cntx msg
contextItemId: 456234,
contextItemType: 'product',
contextItemPrice: '100.34',
contextItemCurrency: 'грн',
contextDescription: 'Magic gout`s lag',
contextMeta: 'prosaleHashe'
}
openRoom
- open direct chat room, takes one arg roomIdent
,
setLocale
- change actual language, takes one of languages in same name static field.
Methods of subscription are static, coz u may not know the order of components to init, but u want for some reason, to add callback function right in that place. U are free to do this:
const removeLister = BesidaChat.addInitListener(() => /* Doing stuff here */void 0);
//it`s actual for SPA to remove event listeners on page change, in case u do not have chat there
// or some other reason, u just call returned remove lister with bind index on ur func
removeLister();
There are one more method for subscribing, addUpdateListener
, it`s conveniently to use, when u need to sync
state with some outer components.
List of all required and custom properties u should provide to Chat.
{
// from CS config
promConfig: {
// urls, used for HTTP transports
defaultOrigin,
currentDomain,
portalHomePage,
personalDataProcessDoc,
komoraUrl,
//boolean data
besidaIsMobile,
userIsSudoMode,
isRuprom,
isBelprom,
isKzprom,
isDebug,
// page depends data
defaultCurrencyText
// feature flags
coreBesidaRoomBan,
vasNewRussianPolicyLaw,
contentPowerEnabled,
coreBesidaImageUpload,
coreBannedSKKNotification,
// inited Swindon connection object getter and connection status callback
getSocketConnectionObj,
addStateCallback,
},
tempDeps: {
// All of this deps will be removed,
// as soon as they will get packges
FormTracker,
tracking
}
}
{
auto_knock_knock, // room auto join `url`, u can look in Besida serv, how it`s formed
user_id, // user ident, if u have it
onPortal, // boolean statement
withoutButton, // boolean statement, don't render button in mount node
userHasCompany, // boolean statement
userHasC2CCompany, // boolean statement
context_item_id, // product params, for cntx send
context_item_type,
context_item_price,
context_item_currency,
context_description,
context_meta,
social_auth, // list of obj, for social auth
theme, // room ident, `${oponentId}_${role}`
isInBuyerCabinet, // boolean, buyer is under /cabinet url, but basicly it`s client chat
pageType, // from AppState, for analytics
device, initialAppData.isMobile ? 'phone' : 'desktop' // for analytics
locale initialAppData.locale || c.DEFAULT_LOCALE, // u can set start up locations, from static languages list
}
FAQs
prom desktop chat view mechanizm
The npm package @evo/chat-prom-desktop receives a total of 9 weekly downloads. As such, @evo/chat-prom-desktop popularity was classified as not popular.
We found that @evo/chat-prom-desktop demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 12 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.