diff --git a/package.json b/package.json index 5c89bd6..a506d84 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "httpsms", - "version": "0.0.2", + "version": "0.0.4", "description": "Client for the httpSMS API", "license": "MIT", "funding": "https://github.com/sponsors/NdoleStudio", @@ -15,6 +15,7 @@ "types": "./dist/index.d.ts", "default": "./dist/index.js" }, + "types": "./dist/index.d.ts", "engines": { "node": ">=16" }, @@ -30,19 +31,19 @@ "httpsms" ], "devDependencies": { - "@sindresorhus/tsconfig": "^5.0.0", - "@types/chai": "^4.3.11", + "@sindresorhus/tsconfig": "^7.0.0", + "@types/chai": "^5.0.0", "@types/mocha": "^10.0.6", "chai": "^5.0.0", - "del-cli": "^5.1.0", - "mocha": "^10.2.0", + "del-cli": "^6.0.0", + "mocha": "^11.0.1", "msw": "^2.1.2", "ts-node": "^10.9.2", - "tsd": "^0.30.4", - "xo": "^0.54.2" + "tsd": "^0.32.0", + "xo": "^1.0.5" }, "dependencies": { - "@types/node": "^20.11.5", + "@types/node": "^22.0.2", "axios": "^1.6.5" }, "prettier": { diff --git a/readme.md b/readme.md index 51a6886..2b6ed7e 100644 --- a/readme.md +++ b/readme.md @@ -6,14 +6,14 @@ [](https://github.com/NdoleStudio/httpsms-node/blob/master/LICENSE) [](https://www.npmjs.com/package/httpsms) -This httpSMS library provides a server side javascript and typescript client for the [httpSMS](https://httpsms.com/) API. +This library provides a server side client for the [httpSMS](https://httpsms.com/) API to help you send and receive SMS messages from your Node.js applications in TypeScript or JavaScript. ## Install ```sh -pnpm install httpsms-node +pnpm install httpsms # or -yarn install httpsms-node +yarn install httpsms ``` ## Implemented diff --git a/src/cipher-service.ts b/src/cipher-service.ts index a5e3e6b..36aadf4 100644 --- a/src/cipher-service.ts +++ b/src/cipher-service.ts @@ -36,7 +36,7 @@ class CipherService { ]).toString(); } - private hash(value: string): Buffer { + private hash(value: string): Uint8Array { return createHash('sha256').update(value).digest(); } } diff --git a/src/models.ts b/src/models.ts index 6e86747..b68d4dd 100644 --- a/src/models.ts +++ b/src/models.ts @@ -3,20 +3,24 @@ export type MessageSendRequest = { content: string; /** @example "+18005550199" */ from: string; + /** @example "+18005550100" */ + to: string; /** - * RequestID is an optional parameter used to track a request from the client's perspective + * The request_id field is an optional parameter used to track a request from the client's perspective * @example "153554b5-ae44-44a0-8f4f-7bbac5657ad4" */ request_id?: string; /** - * SendAt is an optional parameter used to schedule a message to be sent at a later time + * The send_at field is an optional parameter used to schedule a message to be sent at a later time * @example "2022-06-05T14:26:09.527976+03:00" */ - send_at?: string; - /** @example "+18005550100" */ - to: string; - /** @example false */ - encrypted: boolean; + send_at?: Date; + /** + * This encrypted field is an optional parameter which determines weather or not the message content is encrypted. + * Note that you have to also set the encryption key on the Android app for this feature to work properly. + * @example false + */ + encrypted?: boolean; }; export type MessageResponse = {
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: