Research
Recent Trends in Malicious Packages Targeting Discord
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
nestjs-unifonic
Advanced tools
Readme
A Unifonic API wrapper for Nest.js
Implementing the UnifonicModule
from this package you gain access to Unifonic services through dependency injection with minimal setup.
Note: Only SMS APIs are covered currently. Other Unifonic services are intended for future releases. Meanwhile, you're welcome to contribute for these.
$ npm install --save nestjs-unifonic
$ yarn add nestjs-unifonic
To use Unifonic client we need to register module for example in app.module.ts
import { UnifonicModule } from "nestjs-unifonic";
@Module({
imports: [
UnifonicModule.forRoot({
appSid: process.env.UNIFONIC_APP_SID,
senderId: process.env.UNIFONIC_SENDER_ID,
}),
],
})
export class AppModule {}
If you are using the @nestjs/config package
from nest, you can use the ConfigModule
using the forRootAsync()
function to inject your environment variables like this in your custom module:
import { UnifonicModule } from "nestjs-unifonic";
@Module({
imports: [
UnifonicModule.forRootAsync({
imports: [ConfigModule],
useFactory: (configService: ConfigService) => ({
appSid: configService.get("UNIFONIC_APP_SID"),
senderId: configService.get("UNIFONIC_SENDER_ID"),
}),
inject: [ConfigService],
}),
],
})
export class AppModule {}
Example usage in service.
import { UnifonicService } from "nestjs-unifonic";
@Injectable()
export class AppService {
public constructor(private readonly unifonicService: UnifonicService) {}
async sendSMS() {
return await this.unifonicService.SendMessage(phoneNumber, body);
}
}
Following methods are available currently:
/**
* Send text message, if timeScheduled given than it will be a Scheduled message.
* @param recipient Required - Destination mobile number, mobile numbers must be in international format without 00 or + Example: (4452023498)
* @param body Required - Message body supports both English and unicodes characters, concatenated messages is supported
* @param timeScheduled Optional - Schedule send messages, in the following format yyyy-mm-dd HH:mm:ss
* @param correlationId Optional - Is a unique identifier value that is attached to requests and messages
*/
SendMessage(
recipient: string,
body: string,
timeScheduled?: string,
correlationId?: string
): Promise<UnifonicSmsResponse>;
/**
* Cancel previously scheduled message. If messageId is given,
* then only that scheduled message is canceled, otherwise all messages are
* cancelled that have been scheduled previously.
* @param messageId Optional - A unique ID that identifies a message
*/
StopScheduledMessage(messageId?: string): Promise<UnifonicSmsResponse>;
/**
* Get details of previously scheduled messages.
*/
GetScheduledMessages(): Promise<UnifonicSmsResponse>;
/**
* Get the status details of a previously sent messages. Optional parameters working as search filters could be specified.
* @param messageId Optional - A unique ID that identifies a message
* @param senderId Optional - The Sender ID to send from, App default SenderID is used unless else stated
* @param recipient Optional - Destination mobile number, mobile numbers must be in international format without 00 or + Example: (4452023498)
* @param dateFrom Optional - The start date for the report time interval, date format should be yyyy-mm-dd
* @param dateTo Optional - The end date for the report time interval, date format should be yyyy-mm-dd
* @param correlationId Optional - Is a unique identifier value that is attached to requests and messages
*/
GetPreviousMessages(
messageId?: string,
senderId?: string,
recipient?: string,
dateFrom?: string,
dateTo?: string,
correlationId?: string
): Promise<UnifonicSmsResponse>;
MIT © sheikh566
FAQs
An API wrapper of Unifonic for Nest.js
We found that nestjs-unifonic demonstrated a healthy version release cadence and project activity because the last version was released less than 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
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
Security News
Socket CEO Feross Aboukhadijeh joins a16z partners to discuss how modern, sophisticated supply chain attacks require AI-driven defenses and explore the challenges and solutions in leveraging AI for threat detection early in the development life cycle.
Security News
NIST's new AI Risk Management Framework aims to enhance the security and reliability of generative AI systems and address the unique challenges of malicious AI exploits.