@teamvortexsoftware/vortex-node-22-sdk 0.8.2 → 0.8.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/README.md +47 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -337,6 +337,53 @@ app.post('/signup', async (req, res) => {
|
|
|
337
337
|
});
|
|
338
338
|
```
|
|
339
339
|
|
|
340
|
+
### Sync Internal Invitation
|
|
341
|
+
|
|
342
|
+
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.
|
|
343
|
+
|
|
344
|
+
This is useful when:
|
|
345
|
+
- You handle invitation delivery through your own in-app notifications or UI
|
|
346
|
+
- Users accept/decline invitations within your application
|
|
347
|
+
- You need to keep Vortex updated with the invitation status
|
|
348
|
+
|
|
349
|
+
```ts
|
|
350
|
+
app.post('/invitations/sync-internal', async (req, res) => {
|
|
351
|
+
const { creatorId, targetValue, action, componentId } = req.body;
|
|
352
|
+
|
|
353
|
+
if (!creatorId || !targetValue || !action || !componentId) {
|
|
354
|
+
return res.status(400).send('Required: creatorId, targetValue, action, componentId');
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
try {
|
|
358
|
+
// Sync the invitation decision back to Vortex
|
|
359
|
+
const result = await vortex.syncInternalInvitation({
|
|
360
|
+
creatorId, // The inviter's user ID in your system
|
|
361
|
+
targetValue, // The invitee's user ID in your system
|
|
362
|
+
action, // "accepted" or "declined"
|
|
363
|
+
componentId // The widget component UUID
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
res.setHeader('Content-Type', 'application/json');
|
|
367
|
+
res.end(JSON.stringify({
|
|
368
|
+
processed: result.processed, // Number of invitations processed
|
|
369
|
+
invitationIds: result.invitationIds // Array of processed invitation IDs
|
|
370
|
+
}));
|
|
371
|
+
} catch (error) {
|
|
372
|
+
res.status(500).send('Failed to sync invitation');
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
**Parameters:**
|
|
378
|
+
- `creatorId` (string) — The inviter's user ID in your system
|
|
379
|
+
- `targetValue` (string) — The invitee's user ID in your system
|
|
380
|
+
- `action` ("accepted" | "declined") — The invitation decision
|
|
381
|
+
- `componentId` (string) — The widget component UUID
|
|
382
|
+
|
|
383
|
+
**Response:**
|
|
384
|
+
- `processed` (number) — Count of invitations processed
|
|
385
|
+
- `invitationIds` (string[]) — IDs of processed invitations
|
|
386
|
+
|
|
340
387
|
### Fetch invitations by group
|
|
341
388
|
|
|
342
389
|
Perhaps you want to allow your users to see all outstanding invitations for a group that they are a member of. Or perhaps you want this exclusively for admins of the group. However you choose to do it, this SDK feature will allow you to fetch all outstanding invitations for a group.
|
package/dist/index.js
CHANGED
|
@@ -38,7 +38,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
38
38
|
var import_node_crypto = __toESM(require("crypto"));
|
|
39
39
|
var import_uuid = require("uuid");
|
|
40
40
|
var SDK_NAME = "vortex-node-sdk";
|
|
41
|
-
var SDK_VERSION = true ? "0.8.
|
|
41
|
+
var SDK_VERSION = true ? "0.8.3" : "0.8.2";
|
|
42
42
|
var Vortex = class {
|
|
43
43
|
constructor(apiKey) {
|
|
44
44
|
this.apiKey = apiKey;
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import crypto from "crypto";
|
|
3
3
|
import { stringify as uuidStringify } from "uuid";
|
|
4
4
|
var SDK_NAME = "vortex-node-sdk";
|
|
5
|
-
var SDK_VERSION = true ? "0.8.
|
|
5
|
+
var SDK_VERSION = true ? "0.8.3" : "0.8.2";
|
|
6
6
|
var Vortex = class {
|
|
7
7
|
constructor(apiKey) {
|
|
8
8
|
this.apiKey = apiKey;
|
package/package.json
CHANGED