Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cedx/free-mobile

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cedx/free-mobile - npm Package Compare versions

Comparing version 15.2.0 to 16.0.0

lib/client.d.ts

32

lib/index.d.ts

@@ -1,31 +0,1 @@

/**
* Sends messages by SMS to a [FreeMobile](https://mobile.free.fr) account.
*/
export declare class Client {
/**
* The Free Mobile account.
*/
readonly account: string;
/**
* The Free Mobile API key.
*/
readonly apiKey: string;
/**
* The base URL of the remote API endpoint.
*/
readonly baseUrl: URL;
/**
* Creates a new client.
* @param account The Free Mobile account.
* @param apiKey The Free Mobile API key.
* @param baseUrl The base URL of the remote API endpoint.
*/
constructor(account: string, apiKey: string, baseUrl?: string | URL);
/**
* Sends an SMS message to the underlying account.
* @param message The message text.
* @returns Resolves when the message has been sent.
*/
sendMessage(message: string): Promise<void>;
}
//# sourceMappingURL=index.d.ts.map
export * from "./client.js";

@@ -1,40 +0,1 @@

/**
* Sends messages by SMS to a [FreeMobile](https://mobile.free.fr) account.
*/
export class Client {
/**
* The Free Mobile account.
*/
account;
/**
* The Free Mobile API key.
*/
apiKey;
/**
* The base URL of the remote API endpoint.
*/
baseUrl;
/**
* Creates a new client.
* @param account The Free Mobile account.
* @param apiKey The Free Mobile API key.
* @param baseUrl The base URL of the remote API endpoint.
*/
constructor(account, apiKey, baseUrl = "https://smsapi.free-mobile.fr") {
const url = baseUrl instanceof URL ? baseUrl.href : baseUrl;
this.account = account;
this.apiKey = apiKey;
this.baseUrl = new URL(url.endsWith("/") ? url : `${url}/`);
}
/**
* Sends an SMS message to the underlying account.
* @param message The message text.
* @returns Resolves when the message has been sent.
*/
async sendMessage(message) {
const query = new URLSearchParams({ msg: message.trim().slice(0, 160), pass: this.apiKey, user: this.account });
const response = await fetch(new URL(`sendmsg?${query}`, this.baseUrl), { headers: { "user-agent": navigator.userAgent } });
if (!response.ok)
throw Error(`${response.status} ${response.statusText}`);
}
}
export * from "./client.js";

@@ -9,3 +9,3 @@ {

"type": "module",
"version": "15.2.0",
"version": "16.0.0",
"author": {

@@ -17,10 +17,5 @@ "email": "cedric@belin.io",

"devDependencies": {
"@types/eslint__js": "^8.42.3",
"@types/gulp": "^4.0.17",
"@types/node": "^20.14.12",
"del": "^7.1.0",
"execa": "^9.3.0",
"gulp": "^5.0.0",
"typescript": "^5.5.4",
"typescript-eslint": "^8.0.0-alpha.54"
"@coffeelint/cli": "^5.2.11",
"@types/node": "^22.9.0",
"coffeescript": "^2.7.0"
},

@@ -46,5 +41,4 @@ "engines": {

"scripts": {
"prepack": "gulp",
"test": "gulp build && node --test --test-reporter=spec"
"test": "cake test"
}
}
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