@teamvortexsoftware/vortex-fastify-5-sdk 0.4.1 → 0.4.2
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 +27 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -294,6 +294,33 @@ const { invitations } = await response.json();
|
|
|
294
294
|
await fetch(`/api/vortex/invitations/${invitationId}`, { method: 'DELETE' });
|
|
295
295
|
```
|
|
296
296
|
|
|
297
|
+
### Sync Internal Invitation
|
|
298
|
+
|
|
299
|
+
If you're using `internal` delivery type invitations and managing the invitation flow within your own application, you can sync invitation decisions back to Vortex when users accept or decline invitations in your system.
|
|
300
|
+
|
|
301
|
+
```typescript
|
|
302
|
+
// Sync an internal invitation action (accept or decline)
|
|
303
|
+
const response = await fetch('/api/vortex/invitation-actions/sync-internal-invitation', {
|
|
304
|
+
method: 'POST',
|
|
305
|
+
headers: { 'Content-Type': 'application/json' },
|
|
306
|
+
body: JSON.stringify({
|
|
307
|
+
creatorId: 'user-123', // The inviter's user ID in your system
|
|
308
|
+
targetValue: 'user-456', // The invitee's user ID in your system
|
|
309
|
+
action: 'accepted', // "accepted" or "declined"
|
|
310
|
+
componentId: 'component-uuid' // The widget component UUID
|
|
311
|
+
})
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
const result = await response.json();
|
|
315
|
+
// result.processed - Number of invitations processed
|
|
316
|
+
// result.invitationIds - Array of processed invitation IDs
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
**Use cases:**
|
|
320
|
+
- You handle invitation delivery through your own in-app notifications or UI
|
|
321
|
+
- Users accept/decline invitations within your application
|
|
322
|
+
- You need to keep Vortex updated with the invitation status
|
|
323
|
+
|
|
297
324
|
## 🚀 Fastify-Specific Features
|
|
298
325
|
|
|
299
326
|
### Plugin Architecture
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@teamvortexsoftware/vortex-fastify-5-sdk",
|
|
3
3
|
"description": "Drop-in Fastify module for Vortex API integration",
|
|
4
4
|
"author": "@teamvortexsoftware",
|
|
5
|
-
"version": "0.4.
|
|
5
|
+
"version": "0.4.2",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"exports": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"typescript-eslint": "8.50.1"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@teamvortexsoftware/vortex-node-22-sdk": "^0.8.
|
|
41
|
+
"@teamvortexsoftware/vortex-node-22-sdk": "^0.8.3"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"fastify": ">=5.0.0"
|