@verdocs/js-sdk 4.1.11 → 4.1.13

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/dist/index.mjs CHANGED
@@ -1722,27 +1722,61 @@ const updateGroup = (endpoint, groupId, params) => endpoint.api //
1722
1722
  *
1723
1723
  * @module
1724
1724
  */
1725
+ /**
1726
+ * Get a list of invitations pending for the caller's organization. The caller must be an admin or owner.
1727
+ */
1725
1728
  const getOrganizationInvitations = (endpoint) => endpoint.api //
1726
1729
  .get(`/v2/organization-invitations`)
1727
1730
  .then((r) => r.data);
1731
+ /**
1732
+ * Invite a new user to join the organization.
1733
+ */
1728
1734
  const createOrganizationInvitation = (endpoint, params) => endpoint.api //
1729
1735
  .post(`/v2/organization-invitations`, params)
1730
1736
  .then((r) => r.data);
1737
+ /**
1738
+ * Delete an invitation. Note that no cancellation message will be sent. Invitations are also one-time-use.
1739
+ * If the invitee attempts to join after the invitation is deleted, accepted, or decline, they will be
1740
+ * shown an error.
1741
+ */
1731
1742
  const deleteOrganizationInvitation = (endpoint, email) => endpoint.api //
1732
1743
  .delete(`/v2/organization-invitations/${email}`)
1733
1744
  .then((r) => r.data);
1745
+ /**
1746
+ * Update an invitation. Note that email may not be changed after the invite is sent. To change
1747
+ * an invitee's email, delete the incorrect entry and create one with the correct value.
1748
+ */
1734
1749
  const updateOrganizationInvitation = (endpoint, email, params) => endpoint.api //
1735
1750
  .patch(`/v2/organization-invitations/${email}`, params)
1736
1751
  .then((r) => r.data);
1752
+ /**
1753
+ * Send a reminder to the invitee to join the organization.
1754
+ */
1737
1755
  const resendOrganizationInvitation = (endpoint, email) => endpoint.api //
1738
1756
  .post('/v2/organization-invitations/resend', { email })
1739
1757
  .then((r) => r.data);
1758
+ /**
1759
+ * Get an invitation's details. This is generally used as the first step of accepting the invite.
1760
+ * A successful response will indicate that the invite token is still valid, and include some
1761
+ * metadata for the organization to style the acceptance screen.
1762
+ */
1740
1763
  const getOrganizationInvitation = (endpoint, email, token) => endpoint.api //
1741
1764
  .get(`/v2/organization-invitations/${email}/${token}`)
1742
1765
  .then((r) => r.data);
1743
- const acceptOrganizationInvitation = (endpoint, email, token) => endpoint.api //
1744
- .post('/v2/organization-invitations/accept', { email, token })
1766
+ /**
1767
+ * Accept an invitation. This will automatically create an Auth0 user for the caller as well as a profile
1768
+ * with the appropriate role as specified in the invite. The profile will be set as "current" for the caller,
1769
+ * and session tokens will be returned to access the new profile. The profile's email_verified flag will
1770
+ * also be set to true.
1771
+ */
1772
+ const acceptOrganizationInvitation = (endpoint, params) => endpoint.api //
1773
+ .post('/v2/organization-invitations/accept', params)
1745
1774
  .then((r) => r.data);
1775
+ /**
1776
+ * Decline an invitation. This will mark the status "declined," providing a visual indication to the
1777
+ * organization's admins that the invite was declined, preventing further invites from being created
1778
+ * to the same email address, and also preventing the invitee from receiving reminders to join.
1779
+ */
1746
1780
  const declineOrganizationInvitation = (endpoint, email, token) => endpoint.api //
1747
1781
  .post('/v2/organization-invitations/decline', { email, token })
1748
1782
  .then((r) => r.data);
@@ -1752,12 +1786,22 @@ const declineOrganizationInvitation = (endpoint, email, token) => endpoint.api /
1752
1786
  *
1753
1787
  * @module
1754
1788
  */
1789
+ /**
1790
+ * Get a list of the members in the caller's organization.
1791
+ */
1755
1792
  const getOrganizationMembers = (endpoint) => endpoint.api //
1756
1793
  .get(`/v2/organization-members`)
1757
1794
  .then((r) => r.data);
1795
+ /**
1796
+ * Delete a member from the caller's organization. Note that the caller must be an admin or owner,
1797
+ * may not delete him/herself
1798
+ */
1758
1799
  const deleteOrganizationMember = (endpoint, profileId) => endpoint.api //
1759
1800
  .delete(`/v2/organization-members/${profileId}`)
1760
1801
  .then((r) => r.data);
1802
+ /**
1803
+ * Update a member.
1804
+ */
1761
1805
  const updateOrganizationMember = (endpoint, profileId, params) => endpoint.api //
1762
1806
  .patch(`/v2/organization-members/${profileId}`, params)
1763
1807
  .then((r) => r.data);