@unboundcx/sdk 4.13.43 → 4.13.45
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/package.json +1 -1
- package/services/objects.js +15 -1
- package/services/portals.js +59 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unboundcx/sdk",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.45",
|
|
4
4
|
"description": "Official JavaScript SDK for the Unbound API - A comprehensive toolkit for integrating with Unbound's communication, AI, and data management services",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
package/services/objects.js
CHANGED
|
@@ -1032,14 +1032,25 @@ export class ObjectsService {
|
|
|
1032
1032
|
isBotAccessible = null,
|
|
1033
1033
|
isPublicBot = null,
|
|
1034
1034
|
description = null,
|
|
1035
|
+
feedPostChanges = null,
|
|
1036
|
+
feedPostWindowSeconds = null,
|
|
1035
1037
|
}) {
|
|
1036
1038
|
this.sdk.validateParams(
|
|
1037
|
-
{
|
|
1039
|
+
{
|
|
1040
|
+
objectName,
|
|
1041
|
+
isBotAccessible,
|
|
1042
|
+
isPublicBot,
|
|
1043
|
+
description,
|
|
1044
|
+
feedPostChanges,
|
|
1045
|
+
feedPostWindowSeconds,
|
|
1046
|
+
},
|
|
1038
1047
|
{
|
|
1039
1048
|
objectName: { type: 'string', required: true },
|
|
1040
1049
|
isBotAccessible: { type: 'boolean', required: false },
|
|
1041
1050
|
isPublicBot: { type: 'boolean', required: false },
|
|
1042
1051
|
description: { type: 'string', required: false },
|
|
1052
|
+
feedPostChanges: { type: 'boolean', required: false },
|
|
1053
|
+
feedPostWindowSeconds: { type: 'number', required: false },
|
|
1043
1054
|
},
|
|
1044
1055
|
);
|
|
1045
1056
|
|
|
@@ -1047,6 +1058,9 @@ export class ObjectsService {
|
|
|
1047
1058
|
if (isBotAccessible !== null) body.isBotAccessible = isBotAccessible;
|
|
1048
1059
|
if (isPublicBot !== null) body.isPublicBot = isPublicBot;
|
|
1049
1060
|
if (description !== null) body.description = description;
|
|
1061
|
+
if (feedPostChanges !== null) body.feedPostChanges = feedPostChanges;
|
|
1062
|
+
if (feedPostWindowSeconds !== null)
|
|
1063
|
+
body.feedPostWindowSeconds = feedPostWindowSeconds;
|
|
1050
1064
|
|
|
1051
1065
|
const params = { body };
|
|
1052
1066
|
|
package/services/portals.js
CHANGED
|
@@ -617,6 +617,18 @@ export class PortalsService {
|
|
|
617
617
|
* portal with no login surface, e.g. `marketing`, is never included);
|
|
618
618
|
* `matches` is whether this person currently passes that portal's
|
|
619
619
|
* people-access filter.
|
|
620
|
+
* sessions: Array<{
|
|
621
|
+
* id: string,
|
|
622
|
+
* portalId: string,
|
|
623
|
+
* portalName: string,
|
|
624
|
+
* ip: string,
|
|
625
|
+
* browser: string,
|
|
626
|
+
* os: string,
|
|
627
|
+
* device: string,
|
|
628
|
+
* createdAt: string|null,
|
|
629
|
+
* lastSeenAt: string|null,
|
|
630
|
+
* expiresAt: string|null
|
|
631
|
+
* }>
|
|
620
632
|
*/
|
|
621
633
|
async getPeopleAccess(peopleId) {
|
|
622
634
|
this.sdk.validateParams(
|
|
@@ -737,9 +749,55 @@ export class PortalsService {
|
|
|
737
749
|
);
|
|
738
750
|
}
|
|
739
751
|
|
|
752
|
+
/**
|
|
753
|
+
* Revokes one portal login session for the person (logs that browser out).
|
|
754
|
+
*
|
|
755
|
+
* @param {string} peopleId
|
|
756
|
+
* @param {string} sessionId
|
|
757
|
+
* @returns {Promise<{ ok: true }>}
|
|
758
|
+
*/
|
|
759
|
+
async revokePeoplePortalSession(peopleId, sessionId) {
|
|
760
|
+
this.sdk.validateParams(
|
|
761
|
+
{ peopleId, sessionId },
|
|
762
|
+
{
|
|
763
|
+
peopleId: { type: "string", required: true },
|
|
764
|
+
sessionId: { type: "string", required: true },
|
|
765
|
+
},
|
|
766
|
+
);
|
|
767
|
+
|
|
768
|
+
return internalRequest(
|
|
769
|
+
this.sdk,
|
|
770
|
+
`/portals/people/${encodeURIComponent(peopleId)}/sessions/${encodeURIComponent(sessionId)}`,
|
|
771
|
+
"DELETE",
|
|
772
|
+
);
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
/**
|
|
776
|
+
* Revokes every active portal login session for the person (logs them
|
|
777
|
+
* out of all browsers). Does not delete their credential — they can
|
|
778
|
+
* sign in again.
|
|
779
|
+
*
|
|
780
|
+
* @param {string} peopleId
|
|
781
|
+
* @returns {Promise<{ ok: true }>}
|
|
782
|
+
*/
|
|
783
|
+
async revokeAllPeoplePortalSessions(peopleId) {
|
|
784
|
+
this.sdk.validateParams(
|
|
785
|
+
{ peopleId },
|
|
786
|
+
{
|
|
787
|
+
peopleId: { type: "string", required: true },
|
|
788
|
+
},
|
|
789
|
+
);
|
|
790
|
+
|
|
791
|
+
return internalRequest(
|
|
792
|
+
this.sdk,
|
|
793
|
+
`/portals/people/${encodeURIComponent(peopleId)}/sessions`,
|
|
794
|
+
"DELETE",
|
|
795
|
+
);
|
|
796
|
+
}
|
|
797
|
+
|
|
740
798
|
/**
|
|
741
799
|
* Revokes a person's portal access (soft-deletes their credential across
|
|
742
|
-
* every portal on
|
|
800
|
+
* every portal on this account). Idempotent — revoking someone with no
|
|
743
801
|
* credential is a no-op, not an error.
|
|
744
802
|
*
|
|
745
803
|
* @param {string} peopleId
|