@verdocs/js-sdk 4.1.9 → 4.1.11

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
@@ -1765,52 +1765,55 @@ const updateOrganizationMember = (endpoint, profileId, params) => endpoint.api /
1765
1765
  /**
1766
1766
  * An Organization is the top level object for ownership for Members, Documents, and Templates.
1767
1767
  *
1768
+ * NOTE: There is no call specifically to create an organization. Every organization must have
1769
+ * at least one "owner" type member. To create a new organization, call createProfile() with
1770
+ * the desired new orgName to create. The caller will become the first owner of the new org, and
1771
+ * can then invite new members to join as well.
1772
+ *
1773
+ * NOTE: There is no call to delete an organization. For safety, this is a manual process. Please
1774
+ * contact support@verdocs.com if you wish to completely delete an organization and all its records.
1775
+ *
1768
1776
  * @module
1769
1777
  */
1770
1778
  /**
1771
- * Get a list of organizations the caller is a member of.
1772
- */
1773
- const getOrganizations = (endpoint) => endpoint.api //
1774
- .get('/v2/organizations')
1775
- .then((r) => r.data);
1776
- /**
1777
- * Get an organization by ID.
1779
+ * Get an organization by ID. Note that this endpoint will return only a subset of fields
1780
+ * if the caller is not a member of the organization (the public fields).
1781
+ *
1782
+ * ```typescript
1783
+ * import {getOrganization} from '@verdocs/js-sdk';
1784
+ *
1785
+ * const organizations = await getOrganization(VerdocsEndpoint.getDefault(), 'ORGID');
1786
+ * ```
1778
1787
  */
1779
1788
  const getOrganization = (endpoint, organizationId) => endpoint.api //
1780
1789
  .get(`/v2/organizations/${organizationId}`)
1781
1790
  .then((r) => r.data);
1782
1791
  /**
1783
- * Create an organization.
1784
- */
1785
- const createOrganization = (endpoint) => endpoint.api //
1786
- .post('/v2/organizations')
1787
- .then((r) => r.data);
1788
- /**
1789
- * Delete an organization.
1790
- */
1791
- const deleteOrganization = (endpoint, organizationId) => endpoint.api //
1792
- .delete(`/v2/organizations/${organizationId}`)
1793
- .then((r) => r.data);
1794
- /**
1795
- * Update an organization.
1792
+ * Update an organization. This can only be called by an admin or owner.
1793
+ *
1794
+ * ```typescript
1795
+ * import {updateOrganization} from '@verdocs/js-sdk';
1796
+ *
1797
+ * const organizations = await updateOrganization(VerdocsEndpoint.getDefault(), organizationId, {name:'ORGNAME'});
1798
+ * ```
1796
1799
  */
1797
1800
  const updateOrganization = (endpoint, organizationId, params) => endpoint.api //
1798
1801
  .patch(`/v2/organizations/${organizationId}`, params)
1799
1802
  .then((r) => r.data);
1800
1803
  /**
1801
- * Update the organization's logo. This can only be called by an admin or owner of the organization.
1804
+ * Update the organization's logo. This can only be called by an admin or owner.
1802
1805
  *
1803
1806
  * ```typescript
1804
- * import {uploadOrganizationLogo} from '@verdocs/js-sdk';
1807
+ * import {updateOrganizationLogo} from '@verdocs/js-sdk';
1805
1808
  *
1806
- * await uploadOrganizationLogo((VerdocsEndpoint.getDefault(), file);
1809
+ * await updateOrganizationLogo((VerdocsEndpoint.getDefault(), organizationId, file);
1807
1810
  * ```
1808
1811
  */
1809
- const uploadOrganizationLogo = (endpoint, file, onUploadProgress) => {
1812
+ const updateOrganizationLogo = (endpoint, organizationId, file, onUploadProgress) => {
1810
1813
  const formData = new FormData();
1811
- formData.append('document', file, file.name);
1814
+ formData.append('logo', file, file.name);
1812
1815
  return endpoint.api //
1813
- .post(`/v2/organizations/logo`, formData, {
1816
+ .patch(`/v2/organizations/${organizationId}`, formData, {
1814
1817
  timeout: 120000,
1815
1818
  onUploadProgress: (event) => {
1816
1819
  const total = event.total || 1;
@@ -1821,19 +1824,19 @@ const uploadOrganizationLogo = (endpoint, file, onUploadProgress) => {
1821
1824
  .then((r) => r.data);
1822
1825
  };
1823
1826
  /**
1824
- * Update the organization's thumbnail. This can only be called by an admin or owner of the organization.
1827
+ * Update the organization's thumbnail. This can only be called by an admin or owner.
1825
1828
  *
1826
1829
  * ```typescript
1827
- * import {uploadOrganizationThumbnail} from '@verdocs/js-sdk';
1830
+ * import {updateOrganizationThumbnail} from '@verdocs/js-sdk';
1828
1831
  *
1829
- * await uploadOrganizationThumbnail((VerdocsEndpoint.getDefault(), file);
1832
+ * await updateOrganizationThumbnail((VerdocsEndpoint.getDefault(), organizationId, file);
1830
1833
  * ```
1831
1834
  */
1832
- const uploadOrganizationThumbnail = (endpoint, file, onUploadProgress) => {
1835
+ const updateOrganizationThumbnail = (endpoint, organizationId, file, onUploadProgress) => {
1833
1836
  const formData = new FormData();
1834
- formData.append('document', file, file.name);
1837
+ formData.append('thumbnail', file, file.name);
1835
1838
  return endpoint.api //
1836
- .post(`/v2/organizations/thumbnail`, formData, {
1839
+ .patch(`/v2/organizations/${organizationId}`, formData, {
1837
1840
  timeout: 120000,
1838
1841
  onUploadProgress: (event) => {
1839
1842
  const total = event.total || 1;
@@ -2660,7 +2663,7 @@ const getProfiles = (endpoint) => endpoint.api //
2660
2663
  * ```typescript
2661
2664
  * import {getCurrentProfile} from '@verdocs/js-sdk';
2662
2665
  *
2663
- * const profiles = await getCurrentProfile();
2666
+ * const profiles = await getCurrentProfile(VerdocsEndpoint.getDefault());
2664
2667
  * ```
2665
2668
  */
2666
2669
  const getCurrentProfile = (endpoint) => endpoint.api //
@@ -2668,12 +2671,11 @@ const getCurrentProfile = (endpoint) => endpoint.api //
2668
2671
  .then((r) => (r.data || []).find((profile) => profile.current));
2669
2672
  /**
2670
2673
  * Get a profile. The caller must have admin access to the given profile.
2671
- * TODO: Add a "public" profile endpoint for public pages
2672
2674
  *
2673
2675
  * ```typescript
2674
2676
  * import {getProfile} from '@verdocs/js-sdk';
2675
2677
  *
2676
- * const profile = await getProfile('PROFILEID');
2678
+ * const profile = await getProfile(VerdocsEndpoint.getDefault(), 'PROFILEID');
2677
2679
  * ```
2678
2680
  */
2679
2681
  const getProfile = (endpoint, profileId) => endpoint.api //
@@ -2687,7 +2689,7 @@ const getProfile = (endpoint, profileId) => endpoint.api //
2687
2689
  * ```typescript
2688
2690
  * import {switchProfile} from '@verdocs/js-sdk';
2689
2691
  *
2690
- * const newProfile = await switchProfile('PROFILEID');
2692
+ * const newProfile = await switchProfile(VerdocsEndpoint.getDefault(), 'PROFILEID');
2691
2693
  * ```
2692
2694
  */
2693
2695
  const switchProfile = (endpoint, profileId) => endpoint.api //
@@ -2700,7 +2702,7 @@ const switchProfile = (endpoint, profileId) => endpoint.api //
2700
2702
  * ```typescript
2701
2703
  * import {updateProfile} from '@verdocs/js-sdk/Users';
2702
2704
  *
2703
- * const newProfile = await updateProfile('PROFILEID');
2705
+ * const newProfile = await updateProfile(VerdocsEndpoint.getDefault(), 'PROFILEID');
2704
2706
  * ```
2705
2707
  */
2706
2708
  const updateProfile = (endpoint, profileId, params) => endpoint.api //
@@ -2713,7 +2715,7 @@ const updateProfile = (endpoint, profileId, params) => endpoint.api //
2713
2715
  * ```typescript
2714
2716
  * import {deleteProfile} from '@verdocs/js-sdk';
2715
2717
  *
2716
- * await deleteProfile('PROFILEID');
2718
+ * await deleteProfile(VerdocsEndpoint.getDefault(), 'PROFILEID');
2717
2719
  * ```
2718
2720
  */
2719
2721
  const deleteProfile = (endpoint, profileId) => endpoint.api //
@@ -2737,7 +2739,7 @@ const deleteProfile = (endpoint, profileId) => endpoint.api //
2737
2739
  * ```typescript
2738
2740
  * import {createProfile} from '@verdocs/js-sdk';
2739
2741
  *
2740
- * const newSession = await createProfile({
2742
+ * const newSession = await createProfile(VerdocsEndpoint.getDefault(), {
2741
2743
  * orgName: 'NEW ORG', email: 'a@b.com', password: '12345678', firstName: 'FIRST', lastName: 'LAST'
2742
2744
  * });
2743
2745
  * ```
@@ -2769,5 +2771,5 @@ const updateProfilePhoto = (endpoint, profileId, file, onUploadProgress) => {
2769
2771
  .then((r) => r.data);
2770
2772
  };
2771
2773
 
2772
- export { AtoB, Countries, VerdocsEndpoint, acceptOrganizationInvitation, addGroupMember, addTemplateTag, authenticate, blobToBase64, canPerformTemplateAction, cancelEnvelope, capitalize, changePassword, convertToE164, createApiKey, createEnvelope, createEnvelopeReminder, createField, createGroup, createInitials, createOrganization, createOrganizationInvitation, createProfile, createSignature, createTag, createTemplate, createTemplateDocument, createTemplateFromSharepoint, createTemplateReminder, createTemplateRole, createTemplatev2, declineOrganizationInvitation, decodeAccessTokenBody, decodeJWTBody, deleteApiKey, deleteEnvelopeFieldAttachment, deleteEnvelopeReminder, deleteField, deleteGroupMember, deleteOrganization, deleteOrganizationInvitation, deleteOrganizationMember, deleteProfile, deleteSignature, deleteTemplate, deleteTemplateDocument, deleteTemplateReminder, deleteTemplateRole, deleteTemplateTag, downloadBlob, envelopeIsActive, envelopeIsComplete, envelopeRecipientAgree, envelopeRecipientChangeOwner, envelopeRecipientDecline, envelopeRecipientPrepare, envelopeRecipientSubmit, envelopeRecipientUpdateName, fileToDataUrl, formatFullName, formatInitials, formatShortTimeAgo, fullNameToInitials, getAllTags, getApiKeys, getCountryByCode, getCurrentProfile, getDocumentDownloadLink, getDocumentPreviewLink, getEnvelope, getEnvelopeDocument, getEnvelopeDocumentPageDisplayUri, getEnvelopeFile, getEnvelopeRecipients, getEnvelopeReminder, getEnvelopesByTemplateId, getEnvelopesSummary, getFieldAttachment, getFieldsForRole, getGroup, getGroups, getInPersonLink, getKbaStatus, getMatchingCountry, getNextRecipient, getNotifications, getOrganization, getOrganizationInvitation, getOrganizationInvitations, getOrganizationMembers, getOrganizations, getPlusOneCountry, getProfile, getProfiles, getRGB, getRGBA, getRLeft, getRTop, getRValue, getRecipientsWithActions, getRoleColor, getSignature, getSignatures, getSignerToken, getSigningSession, getStars, getTag, getTemplate, getTemplateDocument, getTemplateDocumentFile, getTemplateDocumentPageDisplayUri, getTemplateDocumentThumbnail, getTemplateDocuments, getTemplateOwnerInfo, getTemplateReminder, getTemplateRole, getTemplateRoleFields, getTemplateRoles, getTemplateTags, getTemplates, getTemplatesSummary, getValidator, getValidators, getWebhooks, hasRequiredPermissions, integerSequence, isAmericanSamoa, isCanada, isDominicanRepublic, isFrenchGuiana, isGuadeloupe, isMartinique, isMayotte, isPuertoRico, isValidEmail, isValidPhone, isValidRoleName, isValidTag, listEnvelopes, listTemplates, nameToRGBA, recipientCanAct, recipientHasAction, refreshToken, rescale, resendInvitation, resendOrganizationInvitation, resendVerification, resetPassword, rotateApiKey, searchEnvelopes, searchTemplates, sendDelegate, setWebhooks, submitKbaChallengeResponse, submitKbaIdentity, submitKbaPin, switchProfile, throttledGetEnvelope, throttledGetTemplate, timePeriod, toggleStar, updateApiKey, updateEnvelopeField, updateEnvelopeFieldInitials, updateEnvelopeFieldSignature, updateEnvelopeReminder, updateField, updateGroup, updateOrganization, updateOrganizationInvitation, updateOrganizationMember, updateProfile, updateProfilePhoto, updateRecipient, updateTemplate, updateTemplateReminder, updateTemplateRole, uploadEnvelopeFieldAttachment, uploadOrganizationLogo, uploadOrganizationThumbnail, userCanAct, userCanBuildTemplate, userCanCancelEnvelope, userCanChangeOrgVisibility, userCanCreateOrgTemplate, userCanCreatePersonalTemplate, userCanCreatePublicTemplate, userCanCreateTemplate, userCanDeleteTemplate, userCanFinishEnvelope, userCanMakeTemplatePrivate, userCanMakeTemplatePublic, userCanMakeTemplateShared, userCanPreviewTemplate, userCanReadTemplate, userCanSendTemplate, userCanSignNow, userCanUpdateTemplate, userHasPermissions, userHasSharedTemplate, userIsEnvelopeOwner, userIsEnvelopeRecipient, userIsTemplateCreator, verifyEmail };
2774
+ export { AtoB, Countries, VerdocsEndpoint, acceptOrganizationInvitation, addGroupMember, addTemplateTag, authenticate, blobToBase64, canPerformTemplateAction, cancelEnvelope, capitalize, changePassword, convertToE164, createApiKey, createEnvelope, createEnvelopeReminder, createField, createGroup, createInitials, createOrganizationInvitation, createProfile, createSignature, createTag, createTemplate, createTemplateDocument, createTemplateFromSharepoint, createTemplateReminder, createTemplateRole, createTemplatev2, declineOrganizationInvitation, decodeAccessTokenBody, decodeJWTBody, deleteApiKey, deleteEnvelopeFieldAttachment, deleteEnvelopeReminder, deleteField, deleteGroupMember, deleteOrganizationInvitation, deleteOrganizationMember, deleteProfile, deleteSignature, deleteTemplate, deleteTemplateDocument, deleteTemplateReminder, deleteTemplateRole, deleteTemplateTag, downloadBlob, envelopeIsActive, envelopeIsComplete, envelopeRecipientAgree, envelopeRecipientChangeOwner, envelopeRecipientDecline, envelopeRecipientPrepare, envelopeRecipientSubmit, envelopeRecipientUpdateName, fileToDataUrl, formatFullName, formatInitials, formatShortTimeAgo, fullNameToInitials, getAllTags, getApiKeys, getCountryByCode, getCurrentProfile, getDocumentDownloadLink, getDocumentPreviewLink, getEnvelope, getEnvelopeDocument, getEnvelopeDocumentPageDisplayUri, getEnvelopeFile, getEnvelopeRecipients, getEnvelopeReminder, getEnvelopesByTemplateId, getEnvelopesSummary, getFieldAttachment, getFieldsForRole, getGroup, getGroups, getInPersonLink, getKbaStatus, getMatchingCountry, getNextRecipient, getNotifications, getOrganization, getOrganizationInvitation, getOrganizationInvitations, getOrganizationMembers, getPlusOneCountry, getProfile, getProfiles, getRGB, getRGBA, getRLeft, getRTop, getRValue, getRecipientsWithActions, getRoleColor, getSignature, getSignatures, getSignerToken, getSigningSession, getStars, getTag, getTemplate, getTemplateDocument, getTemplateDocumentFile, getTemplateDocumentPageDisplayUri, getTemplateDocumentThumbnail, getTemplateDocuments, getTemplateOwnerInfo, getTemplateReminder, getTemplateRole, getTemplateRoleFields, getTemplateRoles, getTemplateTags, getTemplates, getTemplatesSummary, getValidator, getValidators, getWebhooks, hasRequiredPermissions, integerSequence, isAmericanSamoa, isCanada, isDominicanRepublic, isFrenchGuiana, isGuadeloupe, isMartinique, isMayotte, isPuertoRico, isValidEmail, isValidPhone, isValidRoleName, isValidTag, listEnvelopes, listTemplates, nameToRGBA, recipientCanAct, recipientHasAction, refreshToken, rescale, resendInvitation, resendOrganizationInvitation, resendVerification, resetPassword, rotateApiKey, searchEnvelopes, searchTemplates, sendDelegate, setWebhooks, submitKbaChallengeResponse, submitKbaIdentity, submitKbaPin, switchProfile, throttledGetEnvelope, throttledGetTemplate, timePeriod, toggleStar, updateApiKey, updateEnvelopeField, updateEnvelopeFieldInitials, updateEnvelopeFieldSignature, updateEnvelopeReminder, updateField, updateGroup, updateOrganization, updateOrganizationInvitation, updateOrganizationLogo, updateOrganizationMember, updateOrganizationThumbnail, updateProfile, updateProfilePhoto, updateRecipient, updateTemplate, updateTemplateReminder, updateTemplateRole, uploadEnvelopeFieldAttachment, userCanAct, userCanBuildTemplate, userCanCancelEnvelope, userCanChangeOrgVisibility, userCanCreateOrgTemplate, userCanCreatePersonalTemplate, userCanCreatePublicTemplate, userCanCreateTemplate, userCanDeleteTemplate, userCanFinishEnvelope, userCanMakeTemplatePrivate, userCanMakeTemplatePublic, userCanMakeTemplateShared, userCanPreviewTemplate, userCanReadTemplate, userCanSendTemplate, userCanSignNow, userCanUpdateTemplate, userHasPermissions, userHasSharedTemplate, userIsEnvelopeOwner, userIsEnvelopeRecipient, userIsTemplateCreator, verifyEmail };
2773
2775
  //# sourceMappingURL=index.mjs.map