
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
wingbot-mongodb
Advanced tools
Contains storage for tokens, chat states, bot config and chat logs.
Storage for chat states
Storage for webview tokens
Storage for conversation logs
Storage for wingbot.ai conversation config
Cache storage for Facebook attachments
Storage for audit logs with signatures chain
object
object
object
module:mongodb/lib/db
module:mongodb/lib/db
module:mongodb/lib/collection
module:mongodb/lib/db
object
object
object
object
Promise.<boolean>
JWT Verifier
object
Promise
Audit Log Callback
Object
Object
object
Object
module:mongodb/lib/db
module:mongodb/lib/collection
Storage for chat states
Kind: global class
Promise.<(State|null)>
Promise.<object>
Promise.<{Array.<data:State>, lastKey:string}>
Promise.<object>
Param | Type | Default | Description |
---|---|---|---|
mongoDb | mongodb.Db | Object | ||
collectionName | string | "states" | |
[log] | Object | console like logger | |
isCosmo | boolean | false |
Deprecated
Add custom indexing rule
Kind: instance method of StateStorage
Param | Type |
---|---|
index | object |
options | object |
options.name | string |
Promise.<(State|null)>
Kind: instance method of StateStorage
Param | Type |
---|---|
senderId | string |
pageId | string |
Promise.<object>
Load state from database and lock it to prevent another reads
Kind: instance method of StateStorage
Returns: Promise.<object>
- - conversation state
Param | Type | Default | Description |
---|---|---|---|
senderId | string | sender identifier | |
pageId | string | page identifier | |
[defaultState] | object | default state of the conversation | |
[timeout] | number | 300 | given default state |
Promise.<{Array.<data:State>, lastKey:string}>
Kind: instance method of StateStorage
Param | Type | Default |
---|---|---|
condition | StateCondition | |
limit | number | 20 |
lastKey | string | null |
Promise.<object>
Save the state to database
Kind: instance method of StateStorage
Param | Type | Description |
---|---|---|
state | object | conversation state |
Storage for webview tokens
Kind: global class
mongodb.Collection
Promise.<mongodb.Collection>
Promise.<(Token|null)>
Promise.<(Token|null)>
Param | Type | Default |
---|---|---|
mongoDb | mongodb.Db | Object | |
collectionName | string | "tokens" |
mongodb.Collection
Kind: instance property of BotTokenStorage
Promise.<mongodb.Collection>
Kind: instance method of BotTokenStorage
Promise.<(Token|null)>
Kind: instance method of BotTokenStorage
Param | Type |
---|---|
token | string |
Promise.<(Token|null)>
Kind: instance method of BotTokenStorage
Param | Type |
---|---|
senderId | string |
pageId | string |
createToken | Object |
Storage for conversation logs
Kind: global class
Param | Type | Default | Description |
---|---|---|---|
mongoDb | Db | Object | ||
collectionName | string | "chatlogs" | |
[log] | Object | console like logger | |
[isCosmo] | boolean | false | |
[secret] | string | Promise.<string> | null |
Promise.<Array.<object>>
Interate history all limits are inclusive
Kind: instance method of ChatLogStorage
Param | Type | Default | Description |
---|---|---|---|
senderId | string | ||
pageId | string | ||
[limit] | number | 10 | |
[endAt] | number |
| iterate backwards to history |
[startAt] | number |
| iterate forward to last interaction |
Promise
Log single event
Kind: instance method of ChatLogStorage
Param | Type | Description |
---|---|---|
senderId | string | |
responses | Array.<object> | list of sent responses |
request | object | event request |
[metadata] | object | request metadata |
Storage for wingbot.ai conversation config
Kind: global class
Collection
Promise.<Collection>
Object
Promise
Promise.<number>
Promise.<T>
Promise.<(object|null)>
Param | Type | Default |
---|---|---|
mongoDb | Db | Object | |
collectionName | string | "botconfig" |
Collection
Kind: instance property of BotConfigStorage
Promise.<Collection>
Kind: instance method of BotConfigStorage
Object
Returns botUpdate API for wingbot
Kind: instance method of BotConfigStorage
Param | Type | Description |
---|---|---|
[onUpdate] | function | async update handler function |
[acl] | function | Array.<string> | acl configuration |
Promise
Invalidates current configuration
Kind: instance method of BotConfigStorage
Promise.<number>
Kind: instance method of BotConfigStorage
Promise.<T>
Kind: instance method of BotConfigStorage
Param | Type |
---|---|
newConfig | T |
[id] | string |
Kind: instance method of BotConfigStorage
Param | Type |
---|---|
id | string |
newConfig | object |
Promise.<(object|null)>
Kind: instance method of BotConfigStorage
Param | Type |
---|---|
[id] | string |
Cache storage for Facebook attachments
Kind: global class
mongodb.Collection
Promise.<mongodb.Collection>
Promise.<(number|null)>
Promise
Param | Type | Default |
---|---|---|
mongoDb | mongodb.Db | Object | |
collectionName | string | "attachments" |
mongodb.Collection
Kind: instance property of AttachmentCache
Promise.<mongodb.Collection>
Kind: instance method of AttachmentCache
Promise.<(number|null)>
Kind: instance method of AttachmentCache
Param | Type |
---|---|
url | string |
Promise
Kind: instance method of AttachmentCache
Param | Type |
---|---|
url | string |
attachmentId | number |
Storage for audit logs with signatures chain
Kind: global class
Param | Type | Default | Description |
---|---|---|---|
mongoDb | Db | Object | ||
collectionName | string | "auditlog" | |
[log] | Object | console like logger | |
[isCosmo] | boolean | false | |
[secret] | string | Promise.<string> | null | |
[jwtVerifier] | string | Promise.<string> | null |
JwtVerifier
Kind: instance property of AuditLogStorage
AuditLogCallback
Kind: instance property of AuditLogStorage
Promise
Add a log
Kind: instance method of AuditLogStorage
Param | Type | Description |
---|---|---|
event | TrackingEvent | |
user | User | |
[meta] | Meta | |
[wid] | string | workspace ID |
[type] | string | |
[level] | string | |
[date] | Date |
Promise.<Array.<LogEntry>>
Kind: instance method of AuditLogStorage
Param | Type | Default | Description |
---|---|---|---|
[wid] | string | workspace id | |
[fromSeq] | number | 0 | for paging |
[limit] | number | 40 |
Kind: global class
Map.<string, Promise.<mongodb.Collection>>
Promise.<mongodb.Collection>
Promise.<Array.<Task>>
Promise.<(Task|null)>
Promise.<(Task|null)>
Promise.<Array.<string>>
Promise.<Array.<Task>>
Promise.<Campaign>
Promise
Promise
Promise.<(Campaign|null)>
Promise.<(Campaign|null)>
Promise.<(null|Campaign)>
Promise.<Array.<Campaign>>
Promise.<{Array.<data:Campaign>, lastKey:string}>
Promise
Promise.<Array.<string>>
Promise.<number>
Promise.<{data: Array.<Target>, lastKey: string}>
Promise.<Array.<string>>
Param | Type | Default | Description |
---|---|---|---|
mongoDb | mongodb.Db | Object | ||
collectionsPrefix | string | ||
[log] | Object | console like logger | |
isCosmo | boolean | false |
Map.<string, Promise.<mongodb.Collection>>
Kind: instance property of NotificationsStorage
Promise.<mongodb.Collection>
Kind: instance method of NotificationsStorage
Param | Type |
---|---|
collectionName | string |
Promise.<Array.<Task>>
Kind: instance method of NotificationsStorage
Param | Type |
---|---|
tasks | object |
Kind: instance method of NotificationsStorage
Param | Type | Default |
---|---|---|
campaignId | string | |
[sentWithoutReaction] | boolean | false |
[pageId] | string | null |
Promise.<(Task|null)>
Return Task By Id
Kind: instance method of NotificationsStorage
Param | Type |
---|---|
taskId | string |
Kind: instance method of NotificationsStorage
Param | Type |
---|---|
taskId | string |
data | object |
Promise.<(Task|null)>
Get last sent task from campaign
Kind: instance method of NotificationsStorage
Param | Type |
---|---|
pageId | string |
senderId | string |
campaignId | string |
Promise.<Array.<string>>
Kind: instance method of NotificationsStorage
Param | Type |
---|---|
pageId | string |
senderId | string |
checkCampaignIds | Array.<string> |
Promise.<Array.<Task>>
Kind: instance method of NotificationsStorage
Param | Type |
---|---|
senderId | string |
pageId | string |
watermark | number |
eventType | 'read' | 'delivery' |
ts | number |
Promise.<Campaign>
Kind: instance method of NotificationsStorage
Param | Type | Default |
---|---|---|
campaign | object | |
[updateCampaign] | object |
|
Promise
Kind: instance method of NotificationsStorage
Param | Type |
---|---|
campaignId | string |
Promise
Kind: instance method of NotificationsStorage
Param | Type |
---|---|
campaignId | string |
increment | object |
Promise.<(Campaign|null)>
Kind: instance method of NotificationsStorage
Param | Type |
---|---|
campaignId | string |
data | object |
Promise.<(Campaign|null)>
Kind: instance method of NotificationsStorage
Param | Type |
---|---|
[now] | number |
Promise.<(null|Campaign)>
Kind: instance method of NotificationsStorage
Param | Type |
---|---|
campaignId | string |
Promise.<Array.<Campaign>>
Kind: instance method of NotificationsStorage
Param | Type |
---|---|
campaignIds | Array.<string> |
Promise.<{Array.<data:Campaign>, lastKey:string}>
Kind: instance method of NotificationsStorage
Param | Type | Default |
---|---|---|
condition | object | |
[limit] | number |
|
[lastKey] | object |
|
Promise
Kind: instance method of NotificationsStorage
Param | Type |
---|---|
senderId | string |
pageId | string |
tag | string |
Promise.<Array.<string>>
Kind: instance method of NotificationsStorage
Param | Type | Default |
---|---|---|
senderId | string | |
pageId | string | |
[tag] | string | null |
Promise.<number>
Kind: instance method of NotificationsStorage
Param | Type | Default |
---|---|---|
include | Array.<string> | |
exclude | Array.<string> | |
[pageId] | string | null |
Promise.<{data: Array.<Target>, lastKey: string}>
Kind: instance method of NotificationsStorage
Param | Type | Default |
---|---|---|
include | Array.<string> | |
exclude | Array.<string> | |
limit | number | |
[pageId] | string | null |
lastKey | * |
|
Promise.<Array.<string>>
Kind: instance method of NotificationsStorage
Param | Type |
---|---|
senderId | string |
pageId | string |
Kind: global class
Param | Type | Default | Description |
---|---|---|---|
mongoDb | Db | Object | ||
collectionName | string | ||
[log] | Object | console like logger | |
[isCosmo] | boolean | false |
Example
const { BaseStorage } = require('winbot-mongodb');
class MyCoolDataStorage extends BaseStorage {
constructor (mongoDb, collectionName = 'myCoolData', log = console, isCosmo = false) {
super(mongoDb, collectionName, log, isCosmo);
this.addIndex({
foo: -1
}, {
name: 'foo_1'
});
this.addIndex({
bar: -1,
baz: 1
}, {
name: 'bar_-1_baz_1'
});
}
}
Collection
| Promise.<Collection>
Kind: instance property of BaseStorage
Insert defalt document to DB
Kind: instance method of BaseStorage
Param | Type |
---|---|
...objects | any |
Add custom indexing rule
Kind: instance method of BaseStorage
Param | Type |
---|---|
index | object |
options | mongodb.IndexOptions |
Promise.<Collection>
Returns the collection to operate with
Kind: instance method of BaseStorage
object
Kind: global typedef
Properties
Name | Type |
---|---|
senderId | string |
pageId | string |
state | object |
object
Kind: global typedef
Properties
Name | Type |
---|---|
[search] | string |
object
Kind: global typedef
Properties
Name | Type |
---|---|
senderId | string |
pageId | string |
token | string |
module:mongodb/lib/db
module:mongodb/lib/db
module:mongodb/lib/collection
module:mongodb/lib/db
object
Kind: global typedef
Properties
Name | Type | Default |
---|---|---|
[type] | string | "'audit'" |
category | string | |
action | string | |
[label] | string | |
[payload] | object |
object
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
[id] | string | |
[senderId] | string | |
[pageId] | string | |
[jwt] | string | jwt to check the authorship |
object
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
[ip] | string | |
[ua] | string | |
[ro] | string | referrer |
object
Kind: global typedef
Properties
Name | Type | Default | Description |
---|---|---|---|
date | string | ISO date | |
delta | number | time skew in ms if there was a write conflict | |
[eventType] | string | "'audit'" | |
category | string | ||
action | string | ||
[label] | string | ||
[payload] | object | ||
level | string | (Critical | |
ok | boolean | signature matches | |
seq | number | sequence number | |
type | string | (Error | |
user | User | ||
wid | string | workspace id | |
meta | Meta |
Promise.<boolean>
JWT Verifier
Kind: global typedef
Param | Type |
---|---|
token | string |
userId | string |
[user] | User |
object
Kind: global typedef
Properties
Name | Type | Default | Description |
---|---|---|---|
date | string | ISO date | |
[eventType] | string | "'audit'" | |
category | string | ||
action | string | ||
[label] | string | ||
[payload] | object | ||
level | string | (Critical | |
type | string | (Error | |
user | User | ||
wid | string | workspace id | |
meta | Meta |
Promise
Audit Log Callback
Kind: global typedef
Param | Type |
---|---|
entry | AuditLogEntry |
Object
Kind: global typedef
Properties
Name | Type |
---|---|
senderId | string |
pageId | string |
Object
Kind: global typedef
Properties
Name | Type |
---|---|
senderId | string |
pageId | string |
subs | Array.<string> |
object
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
id | string | |
name | string | Tatgeting |
include | Array.<string> | |
exclude | Array.<string> | Stats |
sent | number | |
succeeded | number | |
failed | number | |
unsubscribed | number | |
delivery | number | |
read | number | |
notSent | number | |
leaved | number | |
queued | number | Interaction |
action | string | |
[data] | object | Setup |
sliding | boolean | |
slide | number | |
slideRound | number | |
active | boolean | |
in24hourWindow | boolean | |
startAt | number |
Object
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
id | string | |
pageId | string | |
senderId | string | |
campaignId | string | |
enqueue | number | |
[read] | number | |
[delivery] | number | |
[sent] | number | |
[insEnqueue] | number | |
[reaction] | boolean | user reacted |
[leaved] | number | time the event was not sent because user left |
module:mongodb/lib/db
module:mongodb/lib/collection
Kind: global typedef
FAQs
MongoDB storage for wingbot.ai
We found that wingbot-mongodb demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.