@verdocs/js-sdk 4.0.11 → 4.1.1

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
@@ -1219,7 +1219,19 @@ const getEnvelopeRecipients = async (endpoint, envelopeId) => endpoint.api //
1219
1219
  */
1220
1220
  const getEnvelope = async (endpoint, envelopeId) => endpoint.api //
1221
1221
  .get(`/envelopes/${envelopeId}`)
1222
- .then((r) => r.data);
1222
+ .then((r) => {
1223
+ const envelope = r.data;
1224
+ // Post-process the envelope to upgrade to new data fields
1225
+ envelope.documents?.forEach((document) => {
1226
+ if (!document.order) {
1227
+ document.order = 0;
1228
+ }
1229
+ if (document.page_numbers) {
1230
+ document.pages = document.page_numbers;
1231
+ }
1232
+ });
1233
+ return envelope;
1234
+ });
1223
1235
  /**
1224
1236
  * Get an Envelope Document
1225
1237
  */
@@ -1575,61 +1587,61 @@ const deleteSignature = (endpoint, signatureId) => endpoint.api //
1575
1587
  * Get a list of keys for a given organization. The caller must have admin access to the organization.
1576
1588
  *
1577
1589
  * ```typescript
1578
- * import {ApiKeys} from '@verdocs/js-sdk/Organizations';
1590
+ * import {ApiKeys} from '@verdocs/js-sdk';
1579
1591
  *
1580
1592
  * const keys = await ApiKeys.getKeys(ORGID);
1581
1593
  * ```
1582
1594
  */
1583
- const getApiKeys = (endpoint, organizationId) => endpoint.api //
1584
- .get(`/organizations/${organizationId}/api_key`)
1595
+ const getApiKeys = (endpoint) => endpoint.api //
1596
+ .get(`/v2/api-keys`)
1585
1597
  .then((r) => r.data);
1586
1598
  /**
1587
1599
  * Create an API key.
1588
1600
  *
1589
1601
  * ```typescript
1590
- * import {ApiKeys} from '@verdocs/js-sdk/Organizations';
1602
+ * import {ApiKeys} from '@verdocs/js-sdk';
1591
1603
  *
1592
1604
  * await ApiKeys.createKey(ORGID, {name: NEWNAME});
1593
1605
  * ```
1594
1606
  */
1595
- const createApiKey = (endpoint, organizationId, params) => endpoint.api //
1596
- .post(`/organizations/${organizationId}/api_key`, params)
1607
+ const createApiKey = (endpoint, params) => endpoint.api //
1608
+ .post('/v2/api-keys', params)
1597
1609
  .then((r) => r.data);
1598
1610
  /**
1599
1611
  * Rotate the secret for an API key. The caller must have admin access to the organization.
1600
1612
  *
1601
1613
  * ```typescript
1602
- * import {ApiKeys} from '@verdocs/js-sdk/Organizations';
1614
+ * import {ApiKeys} from '@verdocs/js-sdk';
1603
1615
  *
1604
1616
  * const {client_secret: newSecret} = await ApiKeys.rotateKey(ORGID, CLIENTID);
1605
1617
  * ```
1606
1618
  */
1607
- const rotateApiKey = (endpoint, organizationId, clientId) => endpoint.api //
1608
- .put(`/organizations/${organizationId}/api_key/${clientId}/rotate`)
1619
+ const rotateApiKey = (endpoint, clientId) => endpoint.api //
1620
+ .post(`/v2/api-keys/${clientId}/rotate`)
1609
1621
  .then((r) => r.data);
1610
1622
  /**
1611
1623
  * Update an API key to change its assigned Profile ID or Name.
1612
1624
  *
1613
1625
  * ```typescript
1614
- * import {ApiKeys} from '@verdocs/js-sdk/Organizations';
1626
+ * import {ApiKeys} from '@verdocs/js-sdk';
1615
1627
  *
1616
1628
  * await ApiKeys.updateKey(ORGID, CLIENTID, {name: NEWNAME});
1617
1629
  * ```
1618
1630
  */
1619
- const updateApiKey = (endpoint, organizationId, clientId, params) => endpoint.api //
1620
- .patch(`/organizations/${organizationId}/api_key/${clientId}`, params)
1631
+ const updateApiKey = (endpoint, clientId, params) => endpoint.api //
1632
+ .patch(`/v2/api-keys/${clientId}`, params)
1621
1633
  .then((r) => r.data);
1622
1634
  /**
1623
1635
  * Delete an API key.
1624
1636
  *
1625
1637
  * ```typescript
1626
- * import {ApiKeys} from '@verdocs/js-sdk/Organizations';
1638
+ * import {ApiKeys} from '@verdocs/js-sdk';
1627
1639
  *
1628
1640
  * await ApiKeys.deleteKey(ORGID, CLIENTID);
1629
1641
  * ```
1630
1642
  */
1631
- const deleteApiKey = (endpoint, organizationId, clientId) => endpoint.api //
1632
- .delete(`/organizations/${organizationId}/api_key/${clientId}`)
1643
+ const deleteApiKey = (endpoint, clientId) => endpoint.api //
1644
+ .delete(`/v2/api-keys/${clientId}`)
1633
1645
  .then((r) => r.data);
1634
1646
 
1635
1647
  /**
@@ -1645,52 +1657,37 @@ const deleteApiKey = (endpoint, organizationId, clientId) => endpoint.api //
1645
1657
  * Get a list of groups for a given organization. The caller must have admin access to the organization.
1646
1658
  *
1647
1659
  * ```typescript
1648
- * import {Groups} from '@verdocs/js-sdk/Organizations';
1649
- *
1650
- * const groups = await Groups.getGroups(ORGID);
1651
- * ```
1652
- */
1653
- const getGroups = (endpoint, organizationId) => endpoint.api //
1654
- .get(`/organizations/${organizationId}/groups`)
1655
- .then((r) => r.data);
1656
- /**
1657
- * Get a single group by name. Returns a detail record.
1658
- *
1659
- * ```typescript
1660
- * import {Groups} from '@verdocs/js-sdk/Organizations';
1660
+ * import {getGroups} from '@verdocs/js-sdk';
1661
1661
  *
1662
- * const groups = await Groups.getGroups(ORGID);
1662
+ * const groups = await getGroups(ORGID);
1663
1663
  * ```
1664
1664
  */
1665
- const getGroupByName = (endpoint, organizationId, name) => endpoint.api //
1666
- .get(`/organizations/${organizationId}/groups`, { params: { name } })
1665
+ const getGroups = (endpoint) => endpoint.api //
1666
+ .get(`/v2/organization-groups`)
1667
1667
  .then((r) => r.data);
1668
1668
  /**
1669
- * Get the details for a group.
1669
+ * Get the details for a group, including its member profiles and list of permissions.
1670
1670
  *
1671
1671
  * ```typescript
1672
- * import {Groups} from '@verdocs/js-sdk/Organizations';
1672
+ * import {getGroup} from '@verdocs/js-sdk/v2/organization-groups';
1673
1673
  *
1674
- * const groups = await Groups.getGroups(ORGID);
1674
+ * const groups = await getGroup(GROUPID);
1675
1675
  * ```
1676
1676
  */
1677
- const getGroup = (endpoint, organizationId, groupId) => endpoint.api //
1678
- .get(`/organizations/${organizationId}/groups/${groupId}`)
1679
- .then((r) => r.data);
1680
- const getGroupMembers = (endpoint, organizationId, groupId) => endpoint.api //
1681
- .get(`/organizations/${organizationId}/groups/${groupId}/members`)
1677
+ const getGroup = (endpoint, groupId) => endpoint.api //
1678
+ .get(`/v2/organization-groups/${groupId}`)
1682
1679
  .then((r) => r.data);
1683
- const addGroupMembers = (endpoint, organizationId, groupId, params) => endpoint.api //
1684
- .post(`/organizations/${organizationId}/groups/${groupId}/members`, params)
1680
+ const createGroup = (endpoint, name) => endpoint.api //
1681
+ .post('/v2/organization-groups', { name })
1685
1682
  .then((r) => r.data);
1686
- const deleteGroupMembers = (endpoint, organizationId, groupId, params) => endpoint.api //
1687
- .put(`/organizations/${organizationId}/groups/${groupId}/delete_members`, params)
1683
+ const addGroupMember = (endpoint, groupId, profile_id) => endpoint.api //
1684
+ .post(`/v2/organization-groups/${groupId}/members`, { profile_id })
1688
1685
  .then((r) => r.data);
1689
- const addGroupPermission = (endpoint, organizationId, groupId, permission) => endpoint.api //
1690
- .post(`/organizations/${organizationId}/groups/${groupId}/permissions/${permission}`, {})
1686
+ const deleteGroupMember = (endpoint, groupId, profile_id) => endpoint.api //
1687
+ .delete(`/v2/organization-groups/${groupId}/members/${profile_id}`)
1691
1688
  .then((r) => r.data);
1692
- const deleteGroupPermission = (endpoint, organizationId, groupId, permission) => endpoint.api //
1693
- .delete(`/organizations/${organizationId}/groups/${groupId}/permissions/${permission}`)
1689
+ const updateGroup = (endpoint, groupId, params) => endpoint.api //
1690
+ .patch(`/v2/organization-groups/${groupId}`, params)
1694
1691
  .then((r) => r.data);
1695
1692
 
1696
1693
  /**
@@ -1698,32 +1695,26 @@ const deleteGroupPermission = (endpoint, organizationId, groupId, permission) =>
1698
1695
  *
1699
1696
  * @module
1700
1697
  */
1701
- const getOrganizationInvitations = (endpoint, organizationId) => endpoint.api //
1702
- .get(`/organizations/${organizationId}/invitation`)
1703
- .then((r) => r.data);
1704
- const createOrganizationInvitation = (endpoint, organizationId, params) => endpoint.api //
1705
- .post(`/organizations/${organizationId}/invitation`, params)
1706
- .then((r) => r.data);
1707
- const deleteOrganizationInvitation = (endpoint, organizationId, email) => endpoint.api //
1708
- .delete(`/organizations/${organizationId}/invitation/${email}`)
1698
+ const getOrganizationInvitations = (endpoint) => endpoint.api //
1699
+ .get(`/v2/organization-invitations`)
1709
1700
  .then((r) => r.data);
1710
- const updateOrganizationInvitation = (endpoint, organizationId, email, params) => endpoint.api //
1711
- .patch(`/organizations/${organizationId}/invitation/${email}`, params)
1701
+ const createOrganizationInvitation = (endpoint, params) => endpoint.api //
1702
+ .post(`/v2/organization-invitations`, params)
1712
1703
  .then((r) => r.data);
1713
- const resendOrganizationInvitation = (endpoint, organizationId, email) => endpoint.api //
1714
- .post(`/organizations/${organizationId}/invitation/${email}/resend`)
1704
+ const deleteOrganizationInvitation = (endpoint, email) => endpoint.api //
1705
+ .delete(`/v2/organization-invitations/${email}`)
1715
1706
  .then((r) => r.data);
1716
- const getOrganizationInvitation = (endpoint, organizationId, email, token) => endpoint.api //
1717
- .get(`/organizations/${organizationId}/invitation/${email}/accept/${token}`)
1707
+ const updateOrganizationInvitation = (endpoint, email, params) => endpoint.api //
1708
+ .patch(`/v2/organization-invitations/${email}`, params)
1718
1709
  .then((r) => r.data);
1719
- const acceptOrganizationInvitation = (endpoint, organizationId, email, token) => endpoint.api //
1720
- .post(`/organizations/${organizationId}/invitation/${email}/accept/${token}`)
1710
+ const resendOrganizationInvitation = (endpoint, email) => endpoint.api //
1711
+ .post('/v2/organization-invitations/resend', { email })
1721
1712
  .then((r) => r.data);
1722
- const declineOrganizationInvitation = (endpoint, organizationId, email, token) => endpoint.api //
1723
- .post(`/organizations/${organizationId}/invitation/${email}/decline/${token}`)
1713
+ const acceptOrganizationInvitation = (endpoint, email, token) => endpoint.api //
1714
+ .post('/v2/organization-invitations/accept', { email, token })
1724
1715
  .then((r) => r.data);
1725
- const claimNewUser = (endpoint, organizationId, email, token) => endpoint.api //
1726
- .put(`/organizations/${organizationId}/invitation/${email}/token/${token}/new_user`)
1716
+ const declineOrganizationInvitation = (endpoint, email, token) => endpoint.api //
1717
+ .post('/v2/organization-invitations/decline', { email, token })
1727
1718
  .then((r) => r.data);
1728
1719
 
1729
1720
  /**
@@ -1731,20 +1722,14 @@ const claimNewUser = (endpoint, organizationId, email, token) => endpoint.api //
1731
1722
  *
1732
1723
  * @module
1733
1724
  */
1734
- const getOrganizationMembers = (endpoint, organizationId) => endpoint.api //
1735
- .get(`/organizations/${organizationId}/profiles`)
1725
+ const getOrganizationMembers = (endpoint) => endpoint.api //
1726
+ .get(`/v2/organization-members`)
1736
1727
  .then((r) => r.data);
1737
- const deleteOrganizationMember = (endpoint, organizationId, profileId) => endpoint.api //
1738
- .delete(`/organizations/${organizationId}/profiles/${profileId}`)
1728
+ const deleteOrganizationMember = (endpoint, profileId) => endpoint.api //
1729
+ .delete(`/v2/organization-members/${profileId}`)
1739
1730
  .then((r) => r.data);
1740
- const addOrganizationMemberRole = (endpoint, organizationId, profileId, roleId) => endpoint.api //
1741
- .post(`/organizations/${organizationId}/profiles/${profileId}/role/${roleId}`)
1742
- .then((r) => r.data);
1743
- const deleteOrganizationMemberRole = (endpoint, organizationId, profileId, roleId) => endpoint.api //
1744
- .delete(`/organizations/${organizationId}/profiles/${profileId}/role/${roleId}`)
1745
- .then((r) => r.data);
1746
- const getOrganizationMemberPlans = (endpoint, organizationId, profileId) => endpoint.api //
1747
- .get(`/organizations/${organizationId}/profiles/${profileId}/plans`)
1731
+ const updateOrganizationMember = (endpoint, profileId, params) => endpoint.api //
1732
+ .patch(`/v2/organization-members/${profileId}`, params)
1748
1733
  .then((r) => r.data);
1749
1734
 
1750
1735
  /**
@@ -1753,41 +1738,53 @@ const getOrganizationMemberPlans = (endpoint, organizationId, profileId) => endp
1753
1738
  * @module
1754
1739
  */
1755
1740
  /**
1756
- * Get a list of organizations the user has access to.
1741
+ * Get a list of organizations the caller is a member of.
1757
1742
  */
1758
1743
  const getOrganizations = (endpoint) => endpoint.api //
1759
- .get('/organizations')
1744
+ .get('/v2/organizations')
1745
+ .then((r) => r.data);
1746
+ /**
1747
+ * Get an organization by ID.
1748
+ */
1749
+ const getOrganization = (endpoint, organizationId) => endpoint.api //
1750
+ .get(`/v2/organizations/${organizationId}`)
1760
1751
  .then((r) => r.data);
1761
1752
  /**
1762
1753
  * Create an organization.
1763
1754
  */
1764
1755
  const createOrganization = (endpoint) => endpoint.api //
1765
- .post('/organizations')
1756
+ .post('/v2/organizations')
1766
1757
  .then((r) => r.data);
1767
1758
  /**
1768
1759
  * Delete an organization.
1769
1760
  */
1770
1761
  const deleteOrganization = (endpoint, organizationId) => endpoint.api //
1771
- .delete(`/organizations/${organizationId}`)
1772
- .then((r) => r.data);
1773
- /**
1774
- * Get an organization by ID.
1775
- */
1776
- const getOrganization = (endpoint, organizationId) => endpoint.api //
1777
- .get(`/organizations/${organizationId}`)
1762
+ .delete(`/v2/organizations/${organizationId}`)
1778
1763
  .then((r) => r.data);
1779
1764
  /**
1780
1765
  * Update an organization.
1781
1766
  */
1782
1767
  const updateOrganization = (endpoint, organizationId, params) => endpoint.api //
1783
- .patch(`/organizations/${organizationId}`, params)
1768
+ .patch(`/v2/organizations/${organizationId}`, params)
1784
1769
  .then((r) => r.data);
1785
1770
 
1771
+ /**
1772
+ * Webhooks are callback triggers from Verdocs to your servers that notify your applications
1773
+ * of various events, such as signing operations.
1774
+ *
1775
+ * @module
1776
+ */
1777
+ /**
1778
+ * Get the registered Webhooks for the caller's organization.
1779
+ */
1786
1780
  const getWebhooks = (endpoint) => endpoint.api //
1787
1781
  .get(`/v2/webhooks/organization`)
1788
1782
  .then((r) => r.data);
1783
+ /**
1784
+ * Update the registered Webhooks for the caller's organization.
1785
+ */
1789
1786
  const setWebhooks = (endpoint, params) => endpoint.api //
1790
- .post(`/v2/webhooks/organization`, params)
1787
+ .patch(`/v2/webhooks/organization`, params)
1791
1788
  .then((r) => r.data);
1792
1789
 
1793
1790
  /**
@@ -2157,7 +2154,27 @@ const getTemplates = (endpoint, params) => endpoint.api //
2157
2154
  */
2158
2155
  const getTemplate = (endpoint, templateId) => endpoint.api //
2159
2156
  .get(`/templates/${templateId}`)
2160
- .then((r) => r.data);
2157
+ .then((r) => {
2158
+ const template = r.data;
2159
+ // Post-process the template to upgrade to new data fields
2160
+ if (!template.documents && template.template_documents) {
2161
+ template.documents = template.template_documents;
2162
+ }
2163
+ template.documents?.forEach((document) => {
2164
+ if (!document.order) {
2165
+ document.order = 0;
2166
+ }
2167
+ if (document.page_numbers) {
2168
+ document.pages = document.page_numbers;
2169
+ }
2170
+ });
2171
+ template.fields?.forEach((field) => {
2172
+ if (field.setting) {
2173
+ field.settings = field.setting;
2174
+ }
2175
+ });
2176
+ return template;
2177
+ });
2161
2178
  /**
2162
2179
  * Get owner information for a template.
2163
2180
  *
@@ -2471,7 +2488,7 @@ const authenticateUser = (endpoint, params) => endpoint.api //
2471
2488
  * NodeJS server-side applications. Never expose your Client Secret in a Web or Mobile app!** Also note
2472
2489
  * that access tokens may be cached by server-side apps (and this is recommended) but do expire after 2
2473
2490
  * hours. This expiration may change based on future security needs. Application developers are encouraged
2474
- * to check the `exp` expiration field in the response accessToken and renew tokens after they expire.
2491
+ * to check the `exp` expiration field in the response, and renew tokens after they expire.
2475
2492
  *
2476
2493
  * ```typescript
2477
2494
  * import {Auth} from '@verdocs/js-sdk/Auth';
@@ -2484,23 +2501,6 @@ const authenticateUser = (endpoint, params) => endpoint.api //
2484
2501
  const authenticateApp = (endpoint, params) => endpoint.api //
2485
2502
  .post('/authentication/login_client', {}, { headers: params })
2486
2503
  .then((r) => r.data);
2487
- /**
2488
- * Validate a token. Only Verdocs tokens will be accepted. Most applications can decode tokens locally,
2489
- * because tokens will be validated when API calls are made anyway. However, high-security applications
2490
- * may use this endpoint to check if a token has been revoked.
2491
- *
2492
- * ```typescript
2493
- * import {Auth} from '@verdocs/js-sdk/Auth';
2494
- *
2495
- * const {valid} = await Auth.validateToken({ token });
2496
- * if (!valid) {
2497
- * window.alert('Session invalid or expired. Please re-authenticate.');
2498
- * }
2499
- * ```
2500
- */
2501
- const validateToken = (endpoint, params) => endpoint.api //
2502
- .post('/token/isValid', params)
2503
- .then((r) => r.data);
2504
2504
  /**
2505
2505
  * If called before the session expires, this will refresh the caller's session and tokens.
2506
2506
  *
@@ -2516,7 +2516,7 @@ const refreshTokens = (endpoint) => endpoint.api //
2516
2516
  .get('/token')
2517
2517
  .then((r) => r.data);
2518
2518
  /**
2519
- * Update the caller's password. To help prevent CSRF attack vectors, the user's old password and email address are required.
2519
+ * Update the caller's password when the old password is known (typically for logged-in users).
2520
2520
  *
2521
2521
  * ```typescript
2522
2522
  * import {Auth} from '@verdocs/js-sdk/Auth';
@@ -2527,11 +2527,11 @@ const refreshTokens = (endpoint) => endpoint.api //
2527
2527
  * }
2528
2528
  * ```
2529
2529
  */
2530
- const updatePassword = (endpoint, params) => endpoint.api //
2530
+ const changePassword = (endpoint, params) => endpoint.api //
2531
2531
  .put('/user/update_password', params)
2532
2532
  .then((r) => r.data);
2533
2533
  /**
2534
- * Reset the caller's password.
2534
+ * Request a password reset, when the old password is not known (typically in login forms).
2535
2535
  *
2536
2536
  * ```typescript
2537
2537
  * import {Auth} from '@verdocs/js-sdk/Auth';
@@ -2545,18 +2545,6 @@ const updatePassword = (endpoint, params) => endpoint.api //
2545
2545
  const resetPassword = (endpoint, params) => endpoint.api //
2546
2546
  .post('/user/reset_password', params)
2547
2547
  .then((r) => r.data);
2548
- /**
2549
- * Update the caller's email address.
2550
- *
2551
- * ```typescript
2552
- * import {Auth} from '@verdocs/js-sdk/Auth';
2553
- *
2554
- * const {profiles} = await Auth.updateEmail({ email: newEmail });
2555
- * ```
2556
- */
2557
- const updateEmail = (endpoint, params) => endpoint.api //
2558
- .put('/user/update_email', params)
2559
- .then((r) => r.data);
2560
2548
  /**
2561
2549
  * Resend the email verification request. Note that to prevent certain forms of abuse, the email address is not
2562
2550
  * a parameter here. Instead, the caller must be authenticated as the (unverified) user. To simplify this process,
@@ -2573,15 +2561,9 @@ const updateEmail = (endpoint, params) => endpoint.api //
2573
2561
  const resendVerification = (endpoint, accessToken) => endpoint.api //
2574
2562
  .post('/user/email_verification', {}, accessToken ? { headers: { Authorization: `Bearer ${accessToken}` } } : {})
2575
2563
  .then((r) => r.data);
2576
- const createUser = (endpoint, params) => endpoint.api //
2577
- .post('/user', params)
2578
- .then((r) => r.data);
2579
-
2580
- // TODO
2581
- const billingPlaceholder = {};
2582
2564
 
2583
2565
  const getNotifications = async (endpoint) => endpoint.api //
2584
- .get('/notifications')
2566
+ .get('/v2/notifications')
2585
2567
  .then((r) => r.data);
2586
2568
 
2587
2569
  /**
@@ -2594,7 +2576,7 @@ const getNotifications = async (endpoint) => endpoint.api //
2594
2576
  * ```
2595
2577
  */
2596
2578
  const getProfiles = (endpoint) => endpoint.api //
2597
- .get('/profiles')
2579
+ .get('/v2/profiles')
2598
2580
  .then((r) => r.data);
2599
2581
  /**
2600
2582
  * Get the user's available profiles. The current profile will be marked with `current: true`.
@@ -2606,20 +2588,8 @@ const getProfiles = (endpoint) => endpoint.api //
2606
2588
  * ```
2607
2589
  */
2608
2590
  const getCurrentProfile = (endpoint) => endpoint.api //
2609
- .get('/profiles')
2591
+ .get('/v2/profiles')
2610
2592
  .then((r) => (r.data || []).find((profile) => profile.current));
2611
- /**
2612
- * Get a list of system roles.
2613
- *
2614
- * ```typescript
2615
- * import {Profiles} from '@verdocs/js-sdk/Users';
2616
- *
2617
- * const roles = await Profiles.getRoles();
2618
- * ```
2619
- */
2620
- const getRoles = (endpoint) => endpoint.api //
2621
- .get('/roles')
2622
- .then((r) => r.data);
2623
2593
  /**
2624
2594
  * Create a profile. If the caller does not have a "current" profile set, the new profile will be made current.
2625
2595
  *
@@ -2630,7 +2600,7 @@ const getRoles = (endpoint) => endpoint.api //
2630
2600
  * ```
2631
2601
  */
2632
2602
  const createProfile = (endpoint, params) => endpoint.api //
2633
- .post('/profiles', params)
2603
+ .post('/v2/profiles', params)
2634
2604
  .then((r) => r.data);
2635
2605
  /**
2636
2606
  * Get a profile. The caller must have admin access to the given profile.
@@ -2643,19 +2613,7 @@ const createProfile = (endpoint, params) => endpoint.api //
2643
2613
  * ```
2644
2614
  */
2645
2615
  const getProfile = (endpoint, profileId) => endpoint.api //
2646
- .get(`/profiles/${profileId}`)
2647
- .then((r) => r.data);
2648
- /**
2649
- * Get a profile's groups.
2650
- *
2651
- * ```typescript
2652
- * import {Profiles} from '@verdocs/js-sdk/Users';
2653
- *
2654
- * const groups = await Profiles.getProfileGroups('PROFILEID');
2655
- * ```
2656
- */
2657
- const getProfileGroups = (endpoint, profileId) => endpoint.api //
2658
- .get(`/profiles/${profileId}/groups`)
2616
+ .get(`/v2/profiles/${profileId}`)
2659
2617
  .then((r) => r.data);
2660
2618
  /**
2661
2619
  * Switch the caller's "current" profile. The current profile is used for permissions checking and profile_id field settings
@@ -2668,7 +2626,7 @@ const getProfileGroups = (endpoint, profileId) => endpoint.api //
2668
2626
  * ```
2669
2627
  */
2670
2628
  const switchProfile = (endpoint, profileId) => endpoint.api //
2671
- .post(`/profiles/${profileId}/switch`)
2629
+ .post(`/v2/profiles/${profileId}/switch`)
2672
2630
  .then((r) => r.data);
2673
2631
  /**
2674
2632
  * Update a profile. For future expansion, the profile ID to update is required, but currently this must also be the
@@ -2681,11 +2639,8 @@ const switchProfile = (endpoint, profileId) => endpoint.api //
2681
2639
  * ```
2682
2640
  */
2683
2641
  const updateProfile = (endpoint, profileId, params) => endpoint.api //
2684
- .put(`/profiles/${profileId}`, params, { baseURL: endpoint.getBaseURLv2() })
2642
+ .patch(`/v2/profiles/${profileId}`, params)
2685
2643
  .then((r) => r.data);
2686
- // endpoint.api //
2687
- // .post<IEnvelopeSummaries>('/envelopes/list', params, {baseURL: endpoint.getBaseURLv2()})
2688
- // .then((r) => r.data);
2689
2644
  /**
2690
2645
  * Delete a profile. If the requested profile is the caller's curent profile, the next available profile will be selected.
2691
2646
  *
@@ -2696,7 +2651,7 @@ const updateProfile = (endpoint, profileId, params) => endpoint.api //
2696
2651
  * ```
2697
2652
  */
2698
2653
  const deleteProfile = (endpoint, profileId) => endpoint.api //
2699
- .delete(`/profiles/${profileId}`)
2654
+ .delete(`/v2/profiles/${profileId}`)
2700
2655
  .then((r) => r.data);
2701
2656
  /**
2702
2657
  * Create a user account and parent organization. This endpoint is for creating a new organization. Users joining an
@@ -2710,7 +2665,7 @@ const deleteProfile = (endpoint, profileId) => endpoint.api //
2710
2665
  * });
2711
2666
  * ```
2712
2667
  */
2713
- const createBusinessAccount = (endpoint, params) => endpoint.api //
2668
+ const createAccount = (endpoint, params) => endpoint.api //
2714
2669
  .post('/user/business', params)
2715
2670
  .then((r) => r.data);
2716
2671
  const recordSignupSurvey = (endpoint, params) => endpoint.api //
@@ -2721,24 +2676,22 @@ exports.AtoB = AtoB;
2721
2676
  exports.Countries = Countries;
2722
2677
  exports.VerdocsEndpoint = VerdocsEndpoint;
2723
2678
  exports.acceptOrganizationInvitation = acceptOrganizationInvitation;
2724
- exports.addGroupMembers = addGroupMembers;
2725
- exports.addGroupPermission = addGroupPermission;
2726
- exports.addOrganizationMemberRole = addOrganizationMemberRole;
2679
+ exports.addGroupMember = addGroupMember;
2727
2680
  exports.addTemplateTag = addTemplateTag;
2728
2681
  exports.authenticateApp = authenticateApp;
2729
2682
  exports.authenticateUser = authenticateUser;
2730
- exports.billingPlaceholder = billingPlaceholder;
2731
2683
  exports.blobToBase64 = blobToBase64;
2732
2684
  exports.canPerformTemplateAction = canPerformTemplateAction;
2733
2685
  exports.cancelEnvelope = cancelEnvelope;
2734
2686
  exports.capitalize = capitalize;
2735
- exports.claimNewUser = claimNewUser;
2687
+ exports.changePassword = changePassword;
2736
2688
  exports.convertToE164 = convertToE164;
2689
+ exports.createAccount = createAccount;
2737
2690
  exports.createApiKey = createApiKey;
2738
- exports.createBusinessAccount = createBusinessAccount;
2739
2691
  exports.createEnvelope = createEnvelope;
2740
2692
  exports.createEnvelopeReminder = createEnvelopeReminder;
2741
2693
  exports.createField = createField;
2694
+ exports.createGroup = createGroup;
2742
2695
  exports.createInitials = createInitials;
2743
2696
  exports.createOrganization = createOrganization;
2744
2697
  exports.createOrganizationInvitation = createOrganizationInvitation;
@@ -2751,7 +2704,6 @@ exports.createTemplateFromSharepoint = createTemplateFromSharepoint;
2751
2704
  exports.createTemplateReminder = createTemplateReminder;
2752
2705
  exports.createTemplateRole = createTemplateRole;
2753
2706
  exports.createTemplatev2 = createTemplatev2;
2754
- exports.createUser = createUser;
2755
2707
  exports.declineOrganizationInvitation = declineOrganizationInvitation;
2756
2708
  exports.decodeAccessTokenBody = decodeAccessTokenBody;
2757
2709
  exports.decodeJWTBody = decodeJWTBody;
@@ -2759,12 +2711,10 @@ exports.deleteApiKey = deleteApiKey;
2759
2711
  exports.deleteEnvelopeFieldAttachment = deleteEnvelopeFieldAttachment;
2760
2712
  exports.deleteEnvelopeReminder = deleteEnvelopeReminder;
2761
2713
  exports.deleteField = deleteField;
2762
- exports.deleteGroupMembers = deleteGroupMembers;
2763
- exports.deleteGroupPermission = deleteGroupPermission;
2714
+ exports.deleteGroupMember = deleteGroupMember;
2764
2715
  exports.deleteOrganization = deleteOrganization;
2765
2716
  exports.deleteOrganizationInvitation = deleteOrganizationInvitation;
2766
2717
  exports.deleteOrganizationMember = deleteOrganizationMember;
2767
- exports.deleteOrganizationMemberRole = deleteOrganizationMemberRole;
2768
2718
  exports.deleteProfile = deleteProfile;
2769
2719
  exports.deleteSignature = deleteSignature;
2770
2720
  exports.deleteTemplate = deleteTemplate;
@@ -2803,22 +2753,17 @@ exports.getEnvelopesSummary = getEnvelopesSummary;
2803
2753
  exports.getFieldAttachment = getFieldAttachment;
2804
2754
  exports.getFieldsForRole = getFieldsForRole;
2805
2755
  exports.getGroup = getGroup;
2806
- exports.getGroupByName = getGroupByName;
2807
- exports.getGroupMembers = getGroupMembers;
2808
2756
  exports.getGroups = getGroups;
2809
2757
  exports.getInPersonLink = getInPersonLink;
2810
2758
  exports.getMatchingCountry = getMatchingCountry;
2811
2759
  exports.getNextRecipient = getNextRecipient;
2812
2760
  exports.getNotifications = getNotifications;
2813
2761
  exports.getOrganization = getOrganization;
2814
- exports.getOrganizationInvitation = getOrganizationInvitation;
2815
2762
  exports.getOrganizationInvitations = getOrganizationInvitations;
2816
- exports.getOrganizationMemberPlans = getOrganizationMemberPlans;
2817
2763
  exports.getOrganizationMembers = getOrganizationMembers;
2818
2764
  exports.getOrganizations = getOrganizations;
2819
2765
  exports.getPlusOneCountry = getPlusOneCountry;
2820
2766
  exports.getProfile = getProfile;
2821
- exports.getProfileGroups = getProfileGroups;
2822
2767
  exports.getProfiles = getProfiles;
2823
2768
  exports.getRGB = getRGB;
2824
2769
  exports.getRGBA = getRGBA;
@@ -2827,7 +2772,6 @@ exports.getRTop = getRTop;
2827
2772
  exports.getRValue = getRValue;
2828
2773
  exports.getRecipientsWithActions = getRecipientsWithActions;
2829
2774
  exports.getRoleColor = getRoleColor;
2830
- exports.getRoles = getRoles;
2831
2775
  exports.getSignature = getSignature;
2832
2776
  exports.getSignatures = getSignatures;
2833
2777
  exports.getSignerToken = getSignerToken;
@@ -2888,15 +2832,15 @@ exports.throttledGetTemplate = throttledGetTemplate;
2888
2832
  exports.timePeriod = timePeriod;
2889
2833
  exports.toggleStar = toggleStar;
2890
2834
  exports.updateApiKey = updateApiKey;
2891
- exports.updateEmail = updateEmail;
2892
2835
  exports.updateEnvelopeField = updateEnvelopeField;
2893
2836
  exports.updateEnvelopeFieldInitials = updateEnvelopeFieldInitials;
2894
2837
  exports.updateEnvelopeFieldSignature = updateEnvelopeFieldSignature;
2895
2838
  exports.updateEnvelopeReminder = updateEnvelopeReminder;
2896
2839
  exports.updateField = updateField;
2840
+ exports.updateGroup = updateGroup;
2897
2841
  exports.updateOrganization = updateOrganization;
2898
2842
  exports.updateOrganizationInvitation = updateOrganizationInvitation;
2899
- exports.updatePassword = updatePassword;
2843
+ exports.updateOrganizationMember = updateOrganizationMember;
2900
2844
  exports.updateProfile = updateProfile;
2901
2845
  exports.updateRecipient = updateRecipient;
2902
2846
  exports.updateTemplate = updateTemplate;
@@ -2926,5 +2870,4 @@ exports.userHasSharedTemplate = userHasSharedTemplate;
2926
2870
  exports.userIsEnvelopeOwner = userIsEnvelopeOwner;
2927
2871
  exports.userIsEnvelopeRecipient = userIsEnvelopeRecipient;
2928
2872
  exports.userIsTemplateCreator = userIsTemplateCreator;
2929
- exports.validateToken = validateToken;
2930
2873
  //# sourceMappingURL=index.js.map