@zi2/relay-sdk 1.0.0 → 1.0.1
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/README.md +8 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -391,9 +391,11 @@ const result = await sdk.sendSMS({
|
|
|
391
391
|
});
|
|
392
392
|
|
|
393
393
|
console.log(result.messageId); // 'msg_xyz'
|
|
394
|
-
console.log(result.status); // 'delivered'
|
|
394
|
+
console.log(result.status); // 'delivered' | 'queued' | 'sent_to_device' | 'failed'
|
|
395
395
|
```
|
|
396
396
|
|
|
397
|
+
> **Note:** When a relay is offline, `sendSMS` does NOT throw `RELAY_OFFLINE`. Instead, it queues the message and returns `status: "queued"`. The message is sent automatically when the device reconnects.
|
|
398
|
+
|
|
397
399
|
### Message Statuses
|
|
398
400
|
|
|
399
401
|
| Status | Description |
|
|
@@ -536,7 +538,11 @@ const sdk = createRelay({
|
|
|
536
538
|
});
|
|
537
539
|
|
|
538
540
|
await app.register(websocket);
|
|
539
|
-
|
|
541
|
+
|
|
542
|
+
// Register with Fastify's prefix option
|
|
543
|
+
await app.register(async (instance) => {
|
|
544
|
+
await relayPlugin(instance, { sdk });
|
|
545
|
+
}, { prefix: '/phone-relay' });
|
|
540
546
|
|
|
541
547
|
await app.listen({ port: 3000 });
|
|
542
548
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zi2/relay-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Enterprise SMS relay SDK with E2E encryption, provider fallback, and PCI DSS v4 compliance",
|
|
5
5
|
"author": "Zenith Intelligence Technologies <dev@zisquare.app>",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|