@verdocs/js-sdk 4.0.11 → 4.1.0
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.d.mts +62 -149
- package/dist/index.d.ts +62 -149
- package/dist/index.js +96 -185
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +90 -167
- package/dist/index.mjs.map +1 -1
- package/dist/package.json +2 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -1575,61 +1575,61 @@ const deleteSignature = (endpoint, signatureId) => endpoint.api //
|
|
|
1575
1575
|
* Get a list of keys for a given organization. The caller must have admin access to the organization.
|
|
1576
1576
|
*
|
|
1577
1577
|
* ```typescript
|
|
1578
|
-
* import {ApiKeys} from '@verdocs/js-sdk
|
|
1578
|
+
* import {ApiKeys} from '@verdocs/js-sdk';
|
|
1579
1579
|
*
|
|
1580
1580
|
* const keys = await ApiKeys.getKeys(ORGID);
|
|
1581
1581
|
* ```
|
|
1582
1582
|
*/
|
|
1583
|
-
const getApiKeys = (endpoint
|
|
1584
|
-
.get(`/
|
|
1583
|
+
const getApiKeys = (endpoint) => endpoint.api //
|
|
1584
|
+
.get(`/v2/api-keys`)
|
|
1585
1585
|
.then((r) => r.data);
|
|
1586
1586
|
/**
|
|
1587
1587
|
* Create an API key.
|
|
1588
1588
|
*
|
|
1589
1589
|
* ```typescript
|
|
1590
|
-
* import {ApiKeys} from '@verdocs/js-sdk
|
|
1590
|
+
* import {ApiKeys} from '@verdocs/js-sdk';
|
|
1591
1591
|
*
|
|
1592
1592
|
* await ApiKeys.createKey(ORGID, {name: NEWNAME});
|
|
1593
1593
|
* ```
|
|
1594
1594
|
*/
|
|
1595
|
-
const createApiKey = (endpoint,
|
|
1596
|
-
.post(
|
|
1595
|
+
const createApiKey = (endpoint, params) => endpoint.api //
|
|
1596
|
+
.post('/v2/api-keys', params)
|
|
1597
1597
|
.then((r) => r.data);
|
|
1598
1598
|
/**
|
|
1599
1599
|
* Rotate the secret for an API key. The caller must have admin access to the organization.
|
|
1600
1600
|
*
|
|
1601
1601
|
* ```typescript
|
|
1602
|
-
* import {ApiKeys} from '@verdocs/js-sdk
|
|
1602
|
+
* import {ApiKeys} from '@verdocs/js-sdk';
|
|
1603
1603
|
*
|
|
1604
1604
|
* const {client_secret: newSecret} = await ApiKeys.rotateKey(ORGID, CLIENTID);
|
|
1605
1605
|
* ```
|
|
1606
1606
|
*/
|
|
1607
|
-
const rotateApiKey = (endpoint,
|
|
1608
|
-
.
|
|
1607
|
+
const rotateApiKey = (endpoint, clientId) => endpoint.api //
|
|
1608
|
+
.post(`/v2/api-keys/${clientId}/rotate`)
|
|
1609
1609
|
.then((r) => r.data);
|
|
1610
1610
|
/**
|
|
1611
1611
|
* Update an API key to change its assigned Profile ID or Name.
|
|
1612
1612
|
*
|
|
1613
1613
|
* ```typescript
|
|
1614
|
-
* import {ApiKeys} from '@verdocs/js-sdk
|
|
1614
|
+
* import {ApiKeys} from '@verdocs/js-sdk';
|
|
1615
1615
|
*
|
|
1616
1616
|
* await ApiKeys.updateKey(ORGID, CLIENTID, {name: NEWNAME});
|
|
1617
1617
|
* ```
|
|
1618
1618
|
*/
|
|
1619
|
-
const updateApiKey = (endpoint,
|
|
1620
|
-
.patch(`/
|
|
1619
|
+
const updateApiKey = (endpoint, clientId, params) => endpoint.api //
|
|
1620
|
+
.patch(`/v2/api-keys/${clientId}`, params)
|
|
1621
1621
|
.then((r) => r.data);
|
|
1622
1622
|
/**
|
|
1623
1623
|
* Delete an API key.
|
|
1624
1624
|
*
|
|
1625
1625
|
* ```typescript
|
|
1626
|
-
* import {ApiKeys} from '@verdocs/js-sdk
|
|
1626
|
+
* import {ApiKeys} from '@verdocs/js-sdk';
|
|
1627
1627
|
*
|
|
1628
1628
|
* await ApiKeys.deleteKey(ORGID, CLIENTID);
|
|
1629
1629
|
* ```
|
|
1630
1630
|
*/
|
|
1631
|
-
const deleteApiKey = (endpoint,
|
|
1632
|
-
.delete(`/
|
|
1631
|
+
const deleteApiKey = (endpoint, clientId) => endpoint.api //
|
|
1632
|
+
.delete(`/v2/api-keys/${clientId}`)
|
|
1633
1633
|
.then((r) => r.data);
|
|
1634
1634
|
|
|
1635
1635
|
/**
|
|
@@ -1645,52 +1645,37 @@ const deleteApiKey = (endpoint, organizationId, clientId) => endpoint.api //
|
|
|
1645
1645
|
* Get a list of groups for a given organization. The caller must have admin access to the organization.
|
|
1646
1646
|
*
|
|
1647
1647
|
* ```typescript
|
|
1648
|
-
* import {
|
|
1648
|
+
* import {getGroups} from '@verdocs/js-sdk';
|
|
1649
1649
|
*
|
|
1650
|
-
* const groups = await
|
|
1650
|
+
* const groups = await getGroups(ORGID);
|
|
1651
1651
|
* ```
|
|
1652
1652
|
*/
|
|
1653
|
-
const getGroups = (endpoint
|
|
1654
|
-
.get(`/
|
|
1653
|
+
const getGroups = (endpoint) => endpoint.api //
|
|
1654
|
+
.get(`/v2/organization-groups`)
|
|
1655
1655
|
.then((r) => r.data);
|
|
1656
1656
|
/**
|
|
1657
|
-
* Get a
|
|
1657
|
+
* Get the details for a group, including its member profiles and list of permissions.
|
|
1658
1658
|
*
|
|
1659
1659
|
* ```typescript
|
|
1660
|
-
* import {
|
|
1660
|
+
* import {getGroup} from '@verdocs/js-sdk/v2/organization-groups';
|
|
1661
1661
|
*
|
|
1662
|
-
* const groups = await
|
|
1662
|
+
* const groups = await getGroup(GROUPID);
|
|
1663
1663
|
* ```
|
|
1664
1664
|
*/
|
|
1665
|
-
const
|
|
1666
|
-
.get(`/
|
|
1665
|
+
const getGroup = (endpoint, groupId) => endpoint.api //
|
|
1666
|
+
.get(`/v2/organization-groups/${groupId}`)
|
|
1667
1667
|
.then((r) => r.data);
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
*
|
|
1671
|
-
* ```typescript
|
|
1672
|
-
* import {Groups} from '@verdocs/js-sdk/Organizations';
|
|
1673
|
-
*
|
|
1674
|
-
* const groups = await Groups.getGroups(ORGID);
|
|
1675
|
-
* ```
|
|
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`)
|
|
1668
|
+
const createGroup = (endpoint, name) => endpoint.api //
|
|
1669
|
+
.post('/v2/organization-groups', { name })
|
|
1682
1670
|
.then((r) => r.data);
|
|
1683
|
-
const
|
|
1684
|
-
.post(`/
|
|
1671
|
+
const addGroupMember = (endpoint, groupId, profile_id) => endpoint.api //
|
|
1672
|
+
.post(`/v2/organization-groups/${groupId}/members`, { profile_id })
|
|
1685
1673
|
.then((r) => r.data);
|
|
1686
|
-
const
|
|
1687
|
-
.
|
|
1674
|
+
const deleteGroupMember = (endpoint, groupId, profile_id) => endpoint.api //
|
|
1675
|
+
.delete(`/v2/organization-groups/${groupId}/members/${profile_id}`)
|
|
1688
1676
|
.then((r) => r.data);
|
|
1689
|
-
const
|
|
1690
|
-
.
|
|
1691
|
-
.then((r) => r.data);
|
|
1692
|
-
const deleteGroupPermission = (endpoint, organizationId, groupId, permission) => endpoint.api //
|
|
1693
|
-
.delete(`/organizations/${organizationId}/groups/${groupId}/permissions/${permission}`)
|
|
1677
|
+
const updateGroup = (endpoint, groupId, params) => endpoint.api //
|
|
1678
|
+
.patch(`/v2/organization-groups/${groupId}`, params)
|
|
1694
1679
|
.then((r) => r.data);
|
|
1695
1680
|
|
|
1696
1681
|
/**
|
|
@@ -1698,32 +1683,26 @@ const deleteGroupPermission = (endpoint, organizationId, groupId, permission) =>
|
|
|
1698
1683
|
*
|
|
1699
1684
|
* @module
|
|
1700
1685
|
*/
|
|
1701
|
-
const getOrganizationInvitations = (endpoint
|
|
1702
|
-
.get(`/
|
|
1703
|
-
.then((r) => r.data);
|
|
1704
|
-
const createOrganizationInvitation = (endpoint, organizationId, params) => endpoint.api //
|
|
1705
|
-
.post(`/organizations/${organizationId}/invitation`, params)
|
|
1686
|
+
const getOrganizationInvitations = (endpoint) => endpoint.api //
|
|
1687
|
+
.get(`/v2/organization-invitations`)
|
|
1706
1688
|
.then((r) => r.data);
|
|
1707
|
-
const
|
|
1708
|
-
.
|
|
1689
|
+
const createOrganizationInvitation = (endpoint, params) => endpoint.api //
|
|
1690
|
+
.post(`/v2/organization-invitations`, params)
|
|
1709
1691
|
.then((r) => r.data);
|
|
1710
|
-
const
|
|
1711
|
-
.
|
|
1692
|
+
const deleteOrganizationInvitation = (endpoint, email) => endpoint.api //
|
|
1693
|
+
.delete(`/v2/organization-invitations/${email}`)
|
|
1712
1694
|
.then((r) => r.data);
|
|
1713
|
-
const
|
|
1714
|
-
.
|
|
1695
|
+
const updateOrganizationInvitation = (endpoint, email, params) => endpoint.api //
|
|
1696
|
+
.patch(`/v2/organization-invitations/${email}`, params)
|
|
1715
1697
|
.then((r) => r.data);
|
|
1716
|
-
const
|
|
1717
|
-
.
|
|
1698
|
+
const resendOrganizationInvitation = (endpoint, email) => endpoint.api //
|
|
1699
|
+
.post('/v2/organization-invitations/resend', { email })
|
|
1718
1700
|
.then((r) => r.data);
|
|
1719
|
-
const acceptOrganizationInvitation = (endpoint,
|
|
1720
|
-
.post(
|
|
1701
|
+
const acceptOrganizationInvitation = (endpoint, email, token) => endpoint.api //
|
|
1702
|
+
.post('/v2/organization-invitations/accept', { email, token })
|
|
1721
1703
|
.then((r) => r.data);
|
|
1722
|
-
const declineOrganizationInvitation = (endpoint,
|
|
1723
|
-
.post(
|
|
1724
|
-
.then((r) => r.data);
|
|
1725
|
-
const claimNewUser = (endpoint, organizationId, email, token) => endpoint.api //
|
|
1726
|
-
.put(`/organizations/${organizationId}/invitation/${email}/token/${token}/new_user`)
|
|
1704
|
+
const declineOrganizationInvitation = (endpoint, email, token) => endpoint.api //
|
|
1705
|
+
.post('/v2/organization-invitations/decline', { email, token })
|
|
1727
1706
|
.then((r) => r.data);
|
|
1728
1707
|
|
|
1729
1708
|
/**
|
|
@@ -1731,20 +1710,14 @@ const claimNewUser = (endpoint, organizationId, email, token) => endpoint.api //
|
|
|
1731
1710
|
*
|
|
1732
1711
|
* @module
|
|
1733
1712
|
*/
|
|
1734
|
-
const getOrganizationMembers = (endpoint
|
|
1735
|
-
.get(`/
|
|
1736
|
-
.then((r) => r.data);
|
|
1737
|
-
const deleteOrganizationMember = (endpoint, organizationId, profileId) => endpoint.api //
|
|
1738
|
-
.delete(`/organizations/${organizationId}/profiles/${profileId}`)
|
|
1713
|
+
const getOrganizationMembers = (endpoint) => endpoint.api //
|
|
1714
|
+
.get(`/v2/organization-members`)
|
|
1739
1715
|
.then((r) => r.data);
|
|
1740
|
-
const
|
|
1741
|
-
.
|
|
1716
|
+
const deleteOrganizationMember = (endpoint, profileId) => endpoint.api //
|
|
1717
|
+
.delete(`/v2/organization-members/${profileId}`)
|
|
1742
1718
|
.then((r) => r.data);
|
|
1743
|
-
const
|
|
1744
|
-
.
|
|
1745
|
-
.then((r) => r.data);
|
|
1746
|
-
const getOrganizationMemberPlans = (endpoint, organizationId, profileId) => endpoint.api //
|
|
1747
|
-
.get(`/organizations/${organizationId}/profiles/${profileId}/plans`)
|
|
1719
|
+
const updateOrganizationMember = (endpoint, profileId, params) => endpoint.api //
|
|
1720
|
+
.patch(`/v2/organization-members/${profileId}`, params)
|
|
1748
1721
|
.then((r) => r.data);
|
|
1749
1722
|
|
|
1750
1723
|
/**
|
|
@@ -1753,41 +1726,53 @@ const getOrganizationMemberPlans = (endpoint, organizationId, profileId) => endp
|
|
|
1753
1726
|
* @module
|
|
1754
1727
|
*/
|
|
1755
1728
|
/**
|
|
1756
|
-
* Get a list of organizations the
|
|
1729
|
+
* Get a list of organizations the caller is a member of.
|
|
1757
1730
|
*/
|
|
1758
1731
|
const getOrganizations = (endpoint) => endpoint.api //
|
|
1759
|
-
.get('/organizations')
|
|
1732
|
+
.get('/v2/organizations')
|
|
1733
|
+
.then((r) => r.data);
|
|
1734
|
+
/**
|
|
1735
|
+
* Get an organization by ID.
|
|
1736
|
+
*/
|
|
1737
|
+
const getOrganization = (endpoint, organizationId) => endpoint.api //
|
|
1738
|
+
.get(`/v2/organizations/${organizationId}`)
|
|
1760
1739
|
.then((r) => r.data);
|
|
1761
1740
|
/**
|
|
1762
1741
|
* Create an organization.
|
|
1763
1742
|
*/
|
|
1764
1743
|
const createOrganization = (endpoint) => endpoint.api //
|
|
1765
|
-
.post('/organizations')
|
|
1744
|
+
.post('/v2/organizations')
|
|
1766
1745
|
.then((r) => r.data);
|
|
1767
1746
|
/**
|
|
1768
1747
|
* Delete an organization.
|
|
1769
1748
|
*/
|
|
1770
1749
|
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}`)
|
|
1750
|
+
.delete(`/v2/organizations/${organizationId}`)
|
|
1778
1751
|
.then((r) => r.data);
|
|
1779
1752
|
/**
|
|
1780
1753
|
* Update an organization.
|
|
1781
1754
|
*/
|
|
1782
1755
|
const updateOrganization = (endpoint, organizationId, params) => endpoint.api //
|
|
1783
|
-
.patch(`/organizations/${organizationId}`, params)
|
|
1756
|
+
.patch(`/v2/organizations/${organizationId}`, params)
|
|
1784
1757
|
.then((r) => r.data);
|
|
1785
1758
|
|
|
1759
|
+
/**
|
|
1760
|
+
* Webhooks are callback triggers from Verdocs to your servers that notify your applications
|
|
1761
|
+
* of various events, such as signing operations.
|
|
1762
|
+
*
|
|
1763
|
+
* @module
|
|
1764
|
+
*/
|
|
1765
|
+
/**
|
|
1766
|
+
* Get the registered Webhooks for the caller's organization.
|
|
1767
|
+
*/
|
|
1786
1768
|
const getWebhooks = (endpoint) => endpoint.api //
|
|
1787
1769
|
.get(`/v2/webhooks/organization`)
|
|
1788
1770
|
.then((r) => r.data);
|
|
1771
|
+
/**
|
|
1772
|
+
* Update the registered Webhooks for the caller's organization.
|
|
1773
|
+
*/
|
|
1789
1774
|
const setWebhooks = (endpoint, params) => endpoint.api //
|
|
1790
|
-
.
|
|
1775
|
+
.patch(`/v2/webhooks/organization`, params)
|
|
1791
1776
|
.then((r) => r.data);
|
|
1792
1777
|
|
|
1793
1778
|
/**
|
|
@@ -2471,7 +2456,7 @@ const authenticateUser = (endpoint, params) => endpoint.api //
|
|
|
2471
2456
|
* NodeJS server-side applications. Never expose your Client Secret in a Web or Mobile app!** Also note
|
|
2472
2457
|
* that access tokens may be cached by server-side apps (and this is recommended) but do expire after 2
|
|
2473
2458
|
* hours. This expiration may change based on future security needs. Application developers are encouraged
|
|
2474
|
-
* to check the `exp` expiration field in the response
|
|
2459
|
+
* to check the `exp` expiration field in the response, and renew tokens after they expire.
|
|
2475
2460
|
*
|
|
2476
2461
|
* ```typescript
|
|
2477
2462
|
* import {Auth} from '@verdocs/js-sdk/Auth';
|
|
@@ -2484,23 +2469,6 @@ const authenticateUser = (endpoint, params) => endpoint.api //
|
|
|
2484
2469
|
const authenticateApp = (endpoint, params) => endpoint.api //
|
|
2485
2470
|
.post('/authentication/login_client', {}, { headers: params })
|
|
2486
2471
|
.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
2472
|
/**
|
|
2505
2473
|
* If called before the session expires, this will refresh the caller's session and tokens.
|
|
2506
2474
|
*
|
|
@@ -2516,7 +2484,7 @@ const refreshTokens = (endpoint) => endpoint.api //
|
|
|
2516
2484
|
.get('/token')
|
|
2517
2485
|
.then((r) => r.data);
|
|
2518
2486
|
/**
|
|
2519
|
-
* Update the caller's password
|
|
2487
|
+
* Update the caller's password when the old password is known (typically for logged-in users).
|
|
2520
2488
|
*
|
|
2521
2489
|
* ```typescript
|
|
2522
2490
|
* import {Auth} from '@verdocs/js-sdk/Auth';
|
|
@@ -2527,11 +2495,11 @@ const refreshTokens = (endpoint) => endpoint.api //
|
|
|
2527
2495
|
* }
|
|
2528
2496
|
* ```
|
|
2529
2497
|
*/
|
|
2530
|
-
const
|
|
2498
|
+
const changePassword = (endpoint, params) => endpoint.api //
|
|
2531
2499
|
.put('/user/update_password', params)
|
|
2532
2500
|
.then((r) => r.data);
|
|
2533
2501
|
/**
|
|
2534
|
-
*
|
|
2502
|
+
* Request a password reset, when the old password is not known (typically in login forms).
|
|
2535
2503
|
*
|
|
2536
2504
|
* ```typescript
|
|
2537
2505
|
* import {Auth} from '@verdocs/js-sdk/Auth';
|
|
@@ -2545,18 +2513,6 @@ const updatePassword = (endpoint, params) => endpoint.api //
|
|
|
2545
2513
|
const resetPassword = (endpoint, params) => endpoint.api //
|
|
2546
2514
|
.post('/user/reset_password', params)
|
|
2547
2515
|
.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
2516
|
/**
|
|
2561
2517
|
* Resend the email verification request. Note that to prevent certain forms of abuse, the email address is not
|
|
2562
2518
|
* a parameter here. Instead, the caller must be authenticated as the (unverified) user. To simplify this process,
|
|
@@ -2573,15 +2529,9 @@ const updateEmail = (endpoint, params) => endpoint.api //
|
|
|
2573
2529
|
const resendVerification = (endpoint, accessToken) => endpoint.api //
|
|
2574
2530
|
.post('/user/email_verification', {}, accessToken ? { headers: { Authorization: `Bearer ${accessToken}` } } : {})
|
|
2575
2531
|
.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
2532
|
|
|
2583
2533
|
const getNotifications = async (endpoint) => endpoint.api //
|
|
2584
|
-
.get('/notifications')
|
|
2534
|
+
.get('/v2/notifications')
|
|
2585
2535
|
.then((r) => r.data);
|
|
2586
2536
|
|
|
2587
2537
|
/**
|
|
@@ -2594,7 +2544,7 @@ const getNotifications = async (endpoint) => endpoint.api //
|
|
|
2594
2544
|
* ```
|
|
2595
2545
|
*/
|
|
2596
2546
|
const getProfiles = (endpoint) => endpoint.api //
|
|
2597
|
-
.get('/profiles')
|
|
2547
|
+
.get('/v2/profiles')
|
|
2598
2548
|
.then((r) => r.data);
|
|
2599
2549
|
/**
|
|
2600
2550
|
* Get the user's available profiles. The current profile will be marked with `current: true`.
|
|
@@ -2606,20 +2556,8 @@ const getProfiles = (endpoint) => endpoint.api //
|
|
|
2606
2556
|
* ```
|
|
2607
2557
|
*/
|
|
2608
2558
|
const getCurrentProfile = (endpoint) => endpoint.api //
|
|
2609
|
-
.get('/profiles')
|
|
2559
|
+
.get('/v2/profiles')
|
|
2610
2560
|
.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
2561
|
/**
|
|
2624
2562
|
* Create a profile. If the caller does not have a "current" profile set, the new profile will be made current.
|
|
2625
2563
|
*
|
|
@@ -2630,7 +2568,7 @@ const getRoles = (endpoint) => endpoint.api //
|
|
|
2630
2568
|
* ```
|
|
2631
2569
|
*/
|
|
2632
2570
|
const createProfile = (endpoint, params) => endpoint.api //
|
|
2633
|
-
.post('/profiles', params)
|
|
2571
|
+
.post('/v2/profiles', params)
|
|
2634
2572
|
.then((r) => r.data);
|
|
2635
2573
|
/**
|
|
2636
2574
|
* Get a profile. The caller must have admin access to the given profile.
|
|
@@ -2643,19 +2581,7 @@ const createProfile = (endpoint, params) => endpoint.api //
|
|
|
2643
2581
|
* ```
|
|
2644
2582
|
*/
|
|
2645
2583
|
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`)
|
|
2584
|
+
.get(`/v2/profiles/${profileId}`)
|
|
2659
2585
|
.then((r) => r.data);
|
|
2660
2586
|
/**
|
|
2661
2587
|
* Switch the caller's "current" profile. The current profile is used for permissions checking and profile_id field settings
|
|
@@ -2668,7 +2594,7 @@ const getProfileGroups = (endpoint, profileId) => endpoint.api //
|
|
|
2668
2594
|
* ```
|
|
2669
2595
|
*/
|
|
2670
2596
|
const switchProfile = (endpoint, profileId) => endpoint.api //
|
|
2671
|
-
.post(`/profiles/${profileId}/switch`)
|
|
2597
|
+
.post(`/v2/profiles/${profileId}/switch`)
|
|
2672
2598
|
.then((r) => r.data);
|
|
2673
2599
|
/**
|
|
2674
2600
|
* Update a profile. For future expansion, the profile ID to update is required, but currently this must also be the
|
|
@@ -2681,11 +2607,8 @@ const switchProfile = (endpoint, profileId) => endpoint.api //
|
|
|
2681
2607
|
* ```
|
|
2682
2608
|
*/
|
|
2683
2609
|
const updateProfile = (endpoint, profileId, params) => endpoint.api //
|
|
2684
|
-
.
|
|
2610
|
+
.patch(`/v2/profiles/${profileId}`, params)
|
|
2685
2611
|
.then((r) => r.data);
|
|
2686
|
-
// endpoint.api //
|
|
2687
|
-
// .post<IEnvelopeSummaries>('/envelopes/list', params, {baseURL: endpoint.getBaseURLv2()})
|
|
2688
|
-
// .then((r) => r.data);
|
|
2689
2612
|
/**
|
|
2690
2613
|
* Delete a profile. If the requested profile is the caller's curent profile, the next available profile will be selected.
|
|
2691
2614
|
*
|
|
@@ -2696,7 +2619,7 @@ const updateProfile = (endpoint, profileId, params) => endpoint.api //
|
|
|
2696
2619
|
* ```
|
|
2697
2620
|
*/
|
|
2698
2621
|
const deleteProfile = (endpoint, profileId) => endpoint.api //
|
|
2699
|
-
.delete(`/profiles/${profileId}`)
|
|
2622
|
+
.delete(`/v2/profiles/${profileId}`)
|
|
2700
2623
|
.then((r) => r.data);
|
|
2701
2624
|
/**
|
|
2702
2625
|
* Create a user account and parent organization. This endpoint is for creating a new organization. Users joining an
|
|
@@ -2710,7 +2633,7 @@ const deleteProfile = (endpoint, profileId) => endpoint.api //
|
|
|
2710
2633
|
* });
|
|
2711
2634
|
* ```
|
|
2712
2635
|
*/
|
|
2713
|
-
const
|
|
2636
|
+
const createAccount = (endpoint, params) => endpoint.api //
|
|
2714
2637
|
.post('/user/business', params)
|
|
2715
2638
|
.then((r) => r.data);
|
|
2716
2639
|
const recordSignupSurvey = (endpoint, params) => endpoint.api //
|
|
@@ -2721,24 +2644,22 @@ exports.AtoB = AtoB;
|
|
|
2721
2644
|
exports.Countries = Countries;
|
|
2722
2645
|
exports.VerdocsEndpoint = VerdocsEndpoint;
|
|
2723
2646
|
exports.acceptOrganizationInvitation = acceptOrganizationInvitation;
|
|
2724
|
-
exports.
|
|
2725
|
-
exports.addGroupPermission = addGroupPermission;
|
|
2726
|
-
exports.addOrganizationMemberRole = addOrganizationMemberRole;
|
|
2647
|
+
exports.addGroupMember = addGroupMember;
|
|
2727
2648
|
exports.addTemplateTag = addTemplateTag;
|
|
2728
2649
|
exports.authenticateApp = authenticateApp;
|
|
2729
2650
|
exports.authenticateUser = authenticateUser;
|
|
2730
|
-
exports.billingPlaceholder = billingPlaceholder;
|
|
2731
2651
|
exports.blobToBase64 = blobToBase64;
|
|
2732
2652
|
exports.canPerformTemplateAction = canPerformTemplateAction;
|
|
2733
2653
|
exports.cancelEnvelope = cancelEnvelope;
|
|
2734
2654
|
exports.capitalize = capitalize;
|
|
2735
|
-
exports.
|
|
2655
|
+
exports.changePassword = changePassword;
|
|
2736
2656
|
exports.convertToE164 = convertToE164;
|
|
2657
|
+
exports.createAccount = createAccount;
|
|
2737
2658
|
exports.createApiKey = createApiKey;
|
|
2738
|
-
exports.createBusinessAccount = createBusinessAccount;
|
|
2739
2659
|
exports.createEnvelope = createEnvelope;
|
|
2740
2660
|
exports.createEnvelopeReminder = createEnvelopeReminder;
|
|
2741
2661
|
exports.createField = createField;
|
|
2662
|
+
exports.createGroup = createGroup;
|
|
2742
2663
|
exports.createInitials = createInitials;
|
|
2743
2664
|
exports.createOrganization = createOrganization;
|
|
2744
2665
|
exports.createOrganizationInvitation = createOrganizationInvitation;
|
|
@@ -2751,7 +2672,6 @@ exports.createTemplateFromSharepoint = createTemplateFromSharepoint;
|
|
|
2751
2672
|
exports.createTemplateReminder = createTemplateReminder;
|
|
2752
2673
|
exports.createTemplateRole = createTemplateRole;
|
|
2753
2674
|
exports.createTemplatev2 = createTemplatev2;
|
|
2754
|
-
exports.createUser = createUser;
|
|
2755
2675
|
exports.declineOrganizationInvitation = declineOrganizationInvitation;
|
|
2756
2676
|
exports.decodeAccessTokenBody = decodeAccessTokenBody;
|
|
2757
2677
|
exports.decodeJWTBody = decodeJWTBody;
|
|
@@ -2759,12 +2679,10 @@ exports.deleteApiKey = deleteApiKey;
|
|
|
2759
2679
|
exports.deleteEnvelopeFieldAttachment = deleteEnvelopeFieldAttachment;
|
|
2760
2680
|
exports.deleteEnvelopeReminder = deleteEnvelopeReminder;
|
|
2761
2681
|
exports.deleteField = deleteField;
|
|
2762
|
-
exports.
|
|
2763
|
-
exports.deleteGroupPermission = deleteGroupPermission;
|
|
2682
|
+
exports.deleteGroupMember = deleteGroupMember;
|
|
2764
2683
|
exports.deleteOrganization = deleteOrganization;
|
|
2765
2684
|
exports.deleteOrganizationInvitation = deleteOrganizationInvitation;
|
|
2766
2685
|
exports.deleteOrganizationMember = deleteOrganizationMember;
|
|
2767
|
-
exports.deleteOrganizationMemberRole = deleteOrganizationMemberRole;
|
|
2768
2686
|
exports.deleteProfile = deleteProfile;
|
|
2769
2687
|
exports.deleteSignature = deleteSignature;
|
|
2770
2688
|
exports.deleteTemplate = deleteTemplate;
|
|
@@ -2803,22 +2721,17 @@ exports.getEnvelopesSummary = getEnvelopesSummary;
|
|
|
2803
2721
|
exports.getFieldAttachment = getFieldAttachment;
|
|
2804
2722
|
exports.getFieldsForRole = getFieldsForRole;
|
|
2805
2723
|
exports.getGroup = getGroup;
|
|
2806
|
-
exports.getGroupByName = getGroupByName;
|
|
2807
|
-
exports.getGroupMembers = getGroupMembers;
|
|
2808
2724
|
exports.getGroups = getGroups;
|
|
2809
2725
|
exports.getInPersonLink = getInPersonLink;
|
|
2810
2726
|
exports.getMatchingCountry = getMatchingCountry;
|
|
2811
2727
|
exports.getNextRecipient = getNextRecipient;
|
|
2812
2728
|
exports.getNotifications = getNotifications;
|
|
2813
2729
|
exports.getOrganization = getOrganization;
|
|
2814
|
-
exports.getOrganizationInvitation = getOrganizationInvitation;
|
|
2815
2730
|
exports.getOrganizationInvitations = getOrganizationInvitations;
|
|
2816
|
-
exports.getOrganizationMemberPlans = getOrganizationMemberPlans;
|
|
2817
2731
|
exports.getOrganizationMembers = getOrganizationMembers;
|
|
2818
2732
|
exports.getOrganizations = getOrganizations;
|
|
2819
2733
|
exports.getPlusOneCountry = getPlusOneCountry;
|
|
2820
2734
|
exports.getProfile = getProfile;
|
|
2821
|
-
exports.getProfileGroups = getProfileGroups;
|
|
2822
2735
|
exports.getProfiles = getProfiles;
|
|
2823
2736
|
exports.getRGB = getRGB;
|
|
2824
2737
|
exports.getRGBA = getRGBA;
|
|
@@ -2827,7 +2740,6 @@ exports.getRTop = getRTop;
|
|
|
2827
2740
|
exports.getRValue = getRValue;
|
|
2828
2741
|
exports.getRecipientsWithActions = getRecipientsWithActions;
|
|
2829
2742
|
exports.getRoleColor = getRoleColor;
|
|
2830
|
-
exports.getRoles = getRoles;
|
|
2831
2743
|
exports.getSignature = getSignature;
|
|
2832
2744
|
exports.getSignatures = getSignatures;
|
|
2833
2745
|
exports.getSignerToken = getSignerToken;
|
|
@@ -2888,15 +2800,15 @@ exports.throttledGetTemplate = throttledGetTemplate;
|
|
|
2888
2800
|
exports.timePeriod = timePeriod;
|
|
2889
2801
|
exports.toggleStar = toggleStar;
|
|
2890
2802
|
exports.updateApiKey = updateApiKey;
|
|
2891
|
-
exports.updateEmail = updateEmail;
|
|
2892
2803
|
exports.updateEnvelopeField = updateEnvelopeField;
|
|
2893
2804
|
exports.updateEnvelopeFieldInitials = updateEnvelopeFieldInitials;
|
|
2894
2805
|
exports.updateEnvelopeFieldSignature = updateEnvelopeFieldSignature;
|
|
2895
2806
|
exports.updateEnvelopeReminder = updateEnvelopeReminder;
|
|
2896
2807
|
exports.updateField = updateField;
|
|
2808
|
+
exports.updateGroup = updateGroup;
|
|
2897
2809
|
exports.updateOrganization = updateOrganization;
|
|
2898
2810
|
exports.updateOrganizationInvitation = updateOrganizationInvitation;
|
|
2899
|
-
exports.
|
|
2811
|
+
exports.updateOrganizationMember = updateOrganizationMember;
|
|
2900
2812
|
exports.updateProfile = updateProfile;
|
|
2901
2813
|
exports.updateRecipient = updateRecipient;
|
|
2902
2814
|
exports.updateTemplate = updateTemplate;
|
|
@@ -2926,5 +2838,4 @@ exports.userHasSharedTemplate = userHasSharedTemplate;
|
|
|
2926
2838
|
exports.userIsEnvelopeOwner = userIsEnvelopeOwner;
|
|
2927
2839
|
exports.userIsEnvelopeRecipient = userIsEnvelopeRecipient;
|
|
2928
2840
|
exports.userIsTemplateCreator = userIsTemplateCreator;
|
|
2929
|
-
exports.validateToken = validateToken;
|
|
2930
2841
|
//# sourceMappingURL=index.js.map
|