
Research
/Security News
11 Malicious NuGet Tools Pose as Game Cheats to Drop a Windows Host-Surveillance Payload
11 malicious NuGet tools pose as game cheats to deploy Windows payloads, track hosts, and use Google Sheets for telemetry and control.
@cuser/client
Advanced tools
Cuser client instance which provides an interface to read, publish,
edit and delete messages through ipfs. By default the client will be only
allowed to read messages unless you provide a CuserServer url,
which will enable the publishing capabilities to the users.
Note To enable publisher capabilities, you need deploy a
CuserServer, please refer to getting started section to gets more information.
example
const { create } = require('ipfs');
const node = create({ ...ipfsOptions });
const cuserId = 'CUSER_SERVER_IDENTIFIER';
const client = new CuserClient(node, cuserId);
const topicId = 'custom-topic-id';
client.getMessages(topicId).then((messages) => {
console.log(messages);
// should return empty array when no comments
});
↳ CuserClient
+ new CuserClient(node: IPFSAPI | Promise<IPFSAPI>, cuserId: string, opts?: CuserClientOptions & CuserReaderOptions & CuserCoreOptions): CuserClient
Overrides void
Defined in client/client.js:53
| Name | Type | Default value |
|---|---|---|
node | IPFSAPI | Promise<IPFSAPI> | - |
cuserId | string | - |
opts | CuserClientOptions & CuserReaderOptions & CuserCoreOptions | {} |
Returns: CuserClient
• _core: CuserCore
Inherited from CuserClient._core
Defined in reader/reader.d.ts:44
• _process: (message: any, cursor: string) => Promise<CuserReaderMessageIteratorResult>
Inherited from CuserClient._process
Defined in reader/reader.d.ts:48
▸ authenticate(username: string, avatar: string): Promise<any>
Defined in client/client.js:80
Authenticates a user with the required fields of username and avatar, this will epect to recieve an access_token to be used in publishing operations
| Name | Type | Description |
|---|---|---|
username | string | |
avatar | string | data url scheme https://tools.ietf.org/html/rfc2397 |
Returns: Promise<any>
▸ deleteMessage(topicId: string, accessToken: string, messageId: string): Promise<[any, Response]>
Defined in client/client.js:142
Deletes message for certain topic using topicId as identifier and accessToken to identify the user
| Name | Type |
|---|---|
topicId | string |
accessToken | string |
messageId | string |
Returns: Promise<[any, Response]>
▸ getMessage(cid: string): Promise<GraphMessage>
Inherited from CuserClient.getMessage
Defined in reader/reader.d.ts:76
Gets the message from ipfs using the CID given by parameter
| Name | Type |
|---|---|
cid | string |
Returns: Promise<GraphMessage>
▸ getMessages(topicId: string, opts: CuserReaderMessagesIteratorOptions): Promise<CuserReaderMessageIteratorResult[]> | AsyncIterable<CuserReaderMessageIteratorResult>
Inherited from CuserClient.getMessages
Defined in reader/reader.d.ts:70
Gets messages from ipfs layer
example
const messages = reader.getMessages('custom_topic_id');
console.log(messages);
const messages = reader.getMessages('custom_topic_id', {
iterator: true,
});
for await (let value of messages) {
console.log(value);
}
| Name | Type |
|---|---|
topicId | string |
opts | CuserReaderMessagesIteratorOptions |
Returns: Promise<CuserReaderMessageIteratorResult[]> | AsyncIterable<CuserReaderMessageIteratorResult>
▸ publishMessage(topicId: string, accessToken: string, content: string): Promise<[any, Response]>
Defined in client/client.js:97
Publish a new message for certain topic using topicId as identifier and accessToken to identify the user
| Name | Type |
|---|---|
topicId | string |
accessToken | string |
content | string |
Returns: Promise<[any, Response]>
▸ subscribe(topicId: string, subscriber: CuserClientSubscriber): function
Defined in client/client.js:184
Subscribe to message changes of a certain topic.
example
This will attach the listener to three types of events:
created when a user publish a messageupdated when a user updates a messagedeleted when a user removes a messageclient.subscribe('CUSTOM_TOPIC_ID', ({ type, messageCid }) => {
switch(type) {
case 'created':
// when a user publish a message
// console.log(client.getMessage(messageCid));
break;
case 'updated':
// when a user updates a message
// console.log(client.getMessage(messageCid));
break;
case 'deleted':
// when a user removes a message
// console.log(client.getMessage(messageCid));
break;
}
});
| Name | Type | Description |
|---|---|---|
topicId | string | topic identifier |
subscriber | CuserClientSubscriber | function event subscriber |
Returns: function
▸ updateMessage(topicId: string, accessToken: string, messageId: string, content: string): Promise<[any, Response]>
Defined in client/client.js:120
Updates message for certain topic using topicId as identifier and accessToken to identify the user
| Name | Type |
|---|---|
topicId | string |
accessToken | string |
messageId | string |
content | string |
Returns: Promise<[any, Response]>
FAQs
client logic for reading and publishing message using restfull transport
We found that @cuser/client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
11 malicious NuGet tools pose as game cheats to deploy Windows payloads, track hosts, and use Google Sheets for telemetry and control.

Research
/Security News
4 compromised asyncapi packages deliver miasma botnet loader on macOS, Linux and Windows.

Research
/Security News
A compromised jscrambler npm release added a malicious preinstall hook that runs hidden native binaries on Linux, macOS, and Windows.