@verdocs/js-sdk 4.1.10 → 4.1.12

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.js CHANGED
@@ -1724,27 +1724,61 @@ const updateGroup = (endpoint, groupId, params) => endpoint.api //
1724
1724
  *
1725
1725
  * @module
1726
1726
  */
1727
+ /**
1728
+ * Get a list of invitations pending for the caller's organization. The caller must be an admin or owner.
1729
+ */
1727
1730
  const getOrganizationInvitations = (endpoint) => endpoint.api //
1728
1731
  .get(`/v2/organization-invitations`)
1729
1732
  .then((r) => r.data);
1733
+ /**
1734
+ * Invite a new user to join the organization.
1735
+ */
1730
1736
  const createOrganizationInvitation = (endpoint, params) => endpoint.api //
1731
1737
  .post(`/v2/organization-invitations`, params)
1732
1738
  .then((r) => r.data);
1739
+ /**
1740
+ * Delete an invitation. Note that no cancellation message will be sent. Invitations are also one-time-use.
1741
+ * If the invitee attempts to join after the invitation is deleted, accepted, or decline, they will be
1742
+ * shown an error.
1743
+ */
1733
1744
  const deleteOrganizationInvitation = (endpoint, email) => endpoint.api //
1734
1745
  .delete(`/v2/organization-invitations/${email}`)
1735
1746
  .then((r) => r.data);
1747
+ /**
1748
+ * Update an invitation. Note that email may not be changed after the invite is sent. To change
1749
+ * an invitee's email, delete the incorrect entry and create one with the correct value.
1750
+ */
1736
1751
  const updateOrganizationInvitation = (endpoint, email, params) => endpoint.api //
1737
1752
  .patch(`/v2/organization-invitations/${email}`, params)
1738
1753
  .then((r) => r.data);
1754
+ /**
1755
+ * Send a reminder to the invitee to join the organization.
1756
+ */
1739
1757
  const resendOrganizationInvitation = (endpoint, email) => endpoint.api //
1740
1758
  .post('/v2/organization-invitations/resend', { email })
1741
1759
  .then((r) => r.data);
1760
+ /**
1761
+ * Get an invitation's details. This is generally used as the first step of accepting the invite.
1762
+ * A successful response will indicate that the invite token is still valid, and include some
1763
+ * metadata for the organization to style the acceptance screen.
1764
+ */
1742
1765
  const getOrganizationInvitation = (endpoint, email, token) => endpoint.api //
1743
1766
  .get(`/v2/organization-invitations/${email}/${token}`)
1744
1767
  .then((r) => r.data);
1768
+ /**
1769
+ * Accept an invitation. This will automatically create an Auth0 user for the caller as well as a profile
1770
+ * with the appropriate role as specified in the invite. The profile will be set as "current" for the caller,
1771
+ * and session tokens will be returned to access the new profile. The profile's email_verified flag will
1772
+ * also be set to true.
1773
+ */
1745
1774
  const acceptOrganizationInvitation = (endpoint, email, token) => endpoint.api //
1746
1775
  .post('/v2/organization-invitations/accept', { email, token })
1747
1776
  .then((r) => r.data);
1777
+ /**
1778
+ * Decline an invitation. This will mark the status "declined," providing a visual indication to the
1779
+ * organization's admins that the invite was declined, preventing further invites from being created
1780
+ * to the same email address, and also preventing the invitee from receiving reminders to join.
1781
+ */
1748
1782
  const declineOrganizationInvitation = (endpoint, email, token) => endpoint.api //
1749
1783
  .post('/v2/organization-invitations/decline', { email, token })
1750
1784
  .then((r) => r.data);
@@ -1754,12 +1788,22 @@ const declineOrganizationInvitation = (endpoint, email, token) => endpoint.api /
1754
1788
  *
1755
1789
  * @module
1756
1790
  */
1791
+ /**
1792
+ * Get a list of the members in the caller's organization.
1793
+ */
1757
1794
  const getOrganizationMembers = (endpoint) => endpoint.api //
1758
1795
  .get(`/v2/organization-members`)
1759
1796
  .then((r) => r.data);
1797
+ /**
1798
+ * Delete a member from the caller's organization. Note that the caller must be an admin or owner,
1799
+ * may not delete him/herself
1800
+ */
1760
1801
  const deleteOrganizationMember = (endpoint, profileId) => endpoint.api //
1761
1802
  .delete(`/v2/organization-members/${profileId}`)
1762
1803
  .then((r) => r.data);
1804
+ /**
1805
+ * Update a member.
1806
+ */
1763
1807
  const updateOrganizationMember = (endpoint, profileId, params) => endpoint.api //
1764
1808
  .patch(`/v2/organization-members/${profileId}`, params)
1765
1809
  .then((r) => r.data);
@@ -1778,19 +1822,8 @@ const updateOrganizationMember = (endpoint, profileId, params) => endpoint.api /
1778
1822
  * @module
1779
1823
  */
1780
1824
  /**
1781
- * Get a list of organizations the caller is a member of.
1782
- *
1783
- * ```typescript
1784
- * import {getOrganizations} from '@verdocs/js-sdk';
1785
- *
1786
- * const organizations = await getOrganizations(VerdocsEndpoint.getDefault());
1787
- * ```
1788
- */
1789
- const getOrganizations = (endpoint) => endpoint.api //
1790
- .get('/v2/organizations')
1791
- .then((r) => r.data);
1792
- /**
1793
- * Get an organization by ID.
1825
+ * Get an organization by ID. Note that this endpoint will return only a subset of fields
1826
+ * if the caller is not a member of the organization (the public fields).
1794
1827
  *
1795
1828
  * ```typescript
1796
1829
  * import {getOrganization} from '@verdocs/js-sdk';
@@ -1817,12 +1850,12 @@ const updateOrganization = (endpoint, organizationId, params) => endpoint.api //
1817
1850
  * Update the organization's logo. This can only be called by an admin or owner.
1818
1851
  *
1819
1852
  * ```typescript
1820
- * import {uploadOrganizationLogo} from '@verdocs/js-sdk';
1853
+ * import {updateOrganizationLogo} from '@verdocs/js-sdk';
1821
1854
  *
1822
- * await uploadOrganizationLogo((VerdocsEndpoint.getDefault(), organizationId, file);
1855
+ * await updateOrganizationLogo((VerdocsEndpoint.getDefault(), organizationId, file);
1823
1856
  * ```
1824
1857
  */
1825
- const uploadOrganizationLogo = (endpoint, organizationId, file, onUploadProgress) => {
1858
+ const updateOrganizationLogo = (endpoint, organizationId, file, onUploadProgress) => {
1826
1859
  const formData = new FormData();
1827
1860
  formData.append('logo', file, file.name);
1828
1861
  return endpoint.api //
@@ -1840,12 +1873,12 @@ const uploadOrganizationLogo = (endpoint, organizationId, file, onUploadProgress
1840
1873
  * Update the organization's thumbnail. This can only be called by an admin or owner.
1841
1874
  *
1842
1875
  * ```typescript
1843
- * import {uploadOrganizationThumbnail} from '@verdocs/js-sdk';
1876
+ * import {updateOrganizationThumbnail} from '@verdocs/js-sdk';
1844
1877
  *
1845
- * await uploadOrganizationThumbnail((VerdocsEndpoint.getDefault(), organizationId, file);
1878
+ * await updateOrganizationThumbnail((VerdocsEndpoint.getDefault(), organizationId, file);
1846
1879
  * ```
1847
1880
  */
1848
- const uploadOrganizationThumbnail = (endpoint, organizationId, file, onUploadProgress) => {
1881
+ const updateOrganizationThumbnail = (endpoint, organizationId, file, onUploadProgress) => {
1849
1882
  const formData = new FormData();
1850
1883
  formData.append('thumbnail', file, file.name);
1851
1884
  return endpoint.api //
@@ -2871,7 +2904,6 @@ exports.getOrganization = getOrganization;
2871
2904
  exports.getOrganizationInvitation = getOrganizationInvitation;
2872
2905
  exports.getOrganizationInvitations = getOrganizationInvitations;
2873
2906
  exports.getOrganizationMembers = getOrganizationMembers;
2874
- exports.getOrganizations = getOrganizations;
2875
2907
  exports.getPlusOneCountry = getPlusOneCountry;
2876
2908
  exports.getProfile = getProfile;
2877
2909
  exports.getProfiles = getProfiles;
@@ -2952,7 +2984,9 @@ exports.updateField = updateField;
2952
2984
  exports.updateGroup = updateGroup;
2953
2985
  exports.updateOrganization = updateOrganization;
2954
2986
  exports.updateOrganizationInvitation = updateOrganizationInvitation;
2987
+ exports.updateOrganizationLogo = updateOrganizationLogo;
2955
2988
  exports.updateOrganizationMember = updateOrganizationMember;
2989
+ exports.updateOrganizationThumbnail = updateOrganizationThumbnail;
2956
2990
  exports.updateProfile = updateProfile;
2957
2991
  exports.updateProfilePhoto = updateProfilePhoto;
2958
2992
  exports.updateRecipient = updateRecipient;
@@ -2960,8 +2994,6 @@ exports.updateTemplate = updateTemplate;
2960
2994
  exports.updateTemplateReminder = updateTemplateReminder;
2961
2995
  exports.updateTemplateRole = updateTemplateRole;
2962
2996
  exports.uploadEnvelopeFieldAttachment = uploadEnvelopeFieldAttachment;
2963
- exports.uploadOrganizationLogo = uploadOrganizationLogo;
2964
- exports.uploadOrganizationThumbnail = uploadOrganizationThumbnail;
2965
2997
  exports.userCanAct = userCanAct;
2966
2998
  exports.userCanBuildTemplate = userCanBuildTemplate;
2967
2999
  exports.userCanCancelEnvelope = userCanCancelEnvelope;