@unlimited-messaging/sdk 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +20 -9
- package/package.json +34 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Unlimited Messaging
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -5,7 +5,10 @@ Official TypeScript / Node.js client for the [Unlimited Messaging](https://unlim
|
|
|
5
5
|
[](https://www.npmjs.com/package/@unlimited-messaging/sdk)
|
|
6
6
|
[](https://www.npmjs.com/package/@unlimited-messaging/sdk)
|
|
7
7
|
[](https://www.npmjs.com/package/@unlimited-messaging/sdk)
|
|
8
|
+
[](https://bundlephobia.com/package/@unlimited-messaging/sdk)
|
|
9
|
+
[](https://github.com/unlimitedmessaging/unlimited-messaging-sdk/actions/workflows/release.yml)
|
|
8
10
|
[](https://github.com/unlimitedmessaging/unlimited-messaging-sdk/blob/main/LICENSE)
|
|
11
|
+
[](https://socket.dev/npm/package/@unlimited-messaging/sdk)
|
|
9
12
|
|
|
10
13
|
- **Website:** [unlimitedmessaging.app](https://unlimitedmessaging.app)
|
|
11
14
|
- **Docs:** [docs.unlimitedmessaging.app](https://docs.unlimitedmessaging.app)
|
|
@@ -29,7 +32,7 @@ const client = new UnlimitedMessagingApiClient({
|
|
|
29
32
|
});
|
|
30
33
|
|
|
31
34
|
// Send a WhatsApp message
|
|
32
|
-
const message = await client.message.
|
|
35
|
+
const message = await client.message.send({
|
|
33
36
|
recipient: "+33612345678",
|
|
34
37
|
text: "Hello!",
|
|
35
38
|
});
|
|
@@ -52,7 +55,7 @@ const client = new UnlimitedMessagingApiClient({
|
|
|
52
55
|
### Send a message
|
|
53
56
|
|
|
54
57
|
```typescript
|
|
55
|
-
const message = await client.message.
|
|
58
|
+
const message = await client.message.send({
|
|
56
59
|
recipient: "+33612345678",
|
|
57
60
|
text: "Hello from the SDK!",
|
|
58
61
|
simId: "optional-sim-id", // force a specific SIM
|
|
@@ -62,7 +65,7 @@ const message = await client.message.messageControllerSend({
|
|
|
62
65
|
### List messages
|
|
63
66
|
|
|
64
67
|
```typescript
|
|
65
|
-
const result = await client.message.
|
|
68
|
+
const result = await client.message.findAll({
|
|
66
69
|
page: 1,
|
|
67
70
|
limit: 20,
|
|
68
71
|
status: "DELIVERED", // PENDING | SENDING | SENT | DELIVERED | READ | FAILED
|
|
@@ -75,10 +78,17 @@ for (const msg of result.data) {
|
|
|
75
78
|
}
|
|
76
79
|
```
|
|
77
80
|
|
|
81
|
+
### Get a single message
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
const msg = await client.message.findOne("message-id");
|
|
85
|
+
console.log(msg.id, msg.status, msg.text);
|
|
86
|
+
```
|
|
87
|
+
|
|
78
88
|
### List linked SIMs
|
|
79
89
|
|
|
80
90
|
```typescript
|
|
81
|
-
const sims = await client.sim.
|
|
91
|
+
const sims = await client.sim.getLinkedSims();
|
|
82
92
|
|
|
83
93
|
for (const sim of sims) {
|
|
84
94
|
console.log(sim.id, sim.phoneNumber);
|
|
@@ -87,11 +97,12 @@ for (const sim of sims) {
|
|
|
87
97
|
|
|
88
98
|
## API reference
|
|
89
99
|
|
|
90
|
-
| Method
|
|
91
|
-
|
|
|
92
|
-
| `message.
|
|
93
|
-
| `message.
|
|
94
|
-
| `
|
|
100
|
+
| Method | Description |
|
|
101
|
+
| ------------------- | ----------------------------------------- |
|
|
102
|
+
| `message.send` | Send a WhatsApp message |
|
|
103
|
+
| `message.findAll` | List messages with pagination and filters |
|
|
104
|
+
| `message.findOne` | Get a single message by ID |
|
|
105
|
+
| `sim.getLinkedSims` | List linked SIMs |
|
|
95
106
|
|
|
96
107
|
Official documentation: [docs.unlimitedmessaging.app](https://docs.unlimitedmessaging.app)
|
|
97
108
|
|
package/package.json
CHANGED
|
@@ -1,22 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unlimited-messaging/sdk",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "TypeScript SDK for the Unlimited Messaging API
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "TypeScript / Node.js SDK for the Unlimited Messaging API — send and receive WhatsApp messages programmatically",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"require": "./src/index.js",
|
|
10
|
+
"types": "./src/index.d.ts"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"sideEffects": false,
|
|
14
|
+
"keywords": [
|
|
15
|
+
"whatsapp",
|
|
16
|
+
"messaging",
|
|
17
|
+
"sms",
|
|
18
|
+
"api",
|
|
19
|
+
"sdk",
|
|
20
|
+
"client",
|
|
21
|
+
"whatsapp-api",
|
|
22
|
+
"send-message",
|
|
23
|
+
"unlimited-messaging",
|
|
24
|
+
"typescript",
|
|
25
|
+
"nodejs"
|
|
26
|
+
],
|
|
27
|
+
"author": {
|
|
28
|
+
"name": "Ilian",
|
|
29
|
+
"email": "ilian572@gmail.com",
|
|
30
|
+
"url": "https://ilianazz.com"
|
|
31
|
+
},
|
|
7
32
|
"license": "MIT",
|
|
8
|
-
"homepage": "https://
|
|
33
|
+
"homepage": "https://unlimitedmessaging.app",
|
|
9
34
|
"repository": {
|
|
10
35
|
"type": "git",
|
|
11
|
-
"url": "https://github.com/
|
|
36
|
+
"url": "https://github.com/UnlimitedMessaging/unlimited-messaging-sdk.git"
|
|
12
37
|
},
|
|
13
38
|
"bugs": {
|
|
14
|
-
"url": "https://github.com/
|
|
39
|
+
"url": "https://github.com/UnlimitedMessaging/unlimited-messaging-sdk/issues"
|
|
40
|
+
},
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=18"
|
|
15
43
|
},
|
|
16
44
|
"files": [
|
|
17
45
|
"src/**/*.js",
|
|
18
46
|
"src/**/*.d.ts",
|
|
19
47
|
"README.md",
|
|
48
|
+
"LICENSE",
|
|
20
49
|
"!node_modules/**",
|
|
21
50
|
"!**/*.test.*"
|
|
22
51
|
],
|