@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.mjs
CHANGED
|
@@ -1573,61 +1573,61 @@ const deleteSignature = (endpoint, signatureId) => endpoint.api //
|
|
|
1573
1573
|
* Get a list of keys for a given organization. The caller must have admin access to the organization.
|
|
1574
1574
|
*
|
|
1575
1575
|
* ```typescript
|
|
1576
|
-
* import {ApiKeys} from '@verdocs/js-sdk
|
|
1576
|
+
* import {ApiKeys} from '@verdocs/js-sdk';
|
|
1577
1577
|
*
|
|
1578
1578
|
* const keys = await ApiKeys.getKeys(ORGID);
|
|
1579
1579
|
* ```
|
|
1580
1580
|
*/
|
|
1581
|
-
const getApiKeys = (endpoint
|
|
1582
|
-
.get(`/
|
|
1581
|
+
const getApiKeys = (endpoint) => endpoint.api //
|
|
1582
|
+
.get(`/v2/api-keys`)
|
|
1583
1583
|
.then((r) => r.data);
|
|
1584
1584
|
/**
|
|
1585
1585
|
* Create an API key.
|
|
1586
1586
|
*
|
|
1587
1587
|
* ```typescript
|
|
1588
|
-
* import {ApiKeys} from '@verdocs/js-sdk
|
|
1588
|
+
* import {ApiKeys} from '@verdocs/js-sdk';
|
|
1589
1589
|
*
|
|
1590
1590
|
* await ApiKeys.createKey(ORGID, {name: NEWNAME});
|
|
1591
1591
|
* ```
|
|
1592
1592
|
*/
|
|
1593
|
-
const createApiKey = (endpoint,
|
|
1594
|
-
.post(
|
|
1593
|
+
const createApiKey = (endpoint, params) => endpoint.api //
|
|
1594
|
+
.post('/v2/api-keys', params)
|
|
1595
1595
|
.then((r) => r.data);
|
|
1596
1596
|
/**
|
|
1597
1597
|
* Rotate the secret for an API key. The caller must have admin access to the organization.
|
|
1598
1598
|
*
|
|
1599
1599
|
* ```typescript
|
|
1600
|
-
* import {ApiKeys} from '@verdocs/js-sdk
|
|
1600
|
+
* import {ApiKeys} from '@verdocs/js-sdk';
|
|
1601
1601
|
*
|
|
1602
1602
|
* const {client_secret: newSecret} = await ApiKeys.rotateKey(ORGID, CLIENTID);
|
|
1603
1603
|
* ```
|
|
1604
1604
|
*/
|
|
1605
|
-
const rotateApiKey = (endpoint,
|
|
1606
|
-
.
|
|
1605
|
+
const rotateApiKey = (endpoint, clientId) => endpoint.api //
|
|
1606
|
+
.post(`/v2/api-keys/${clientId}/rotate`)
|
|
1607
1607
|
.then((r) => r.data);
|
|
1608
1608
|
/**
|
|
1609
1609
|
* Update an API key to change its assigned Profile ID or Name.
|
|
1610
1610
|
*
|
|
1611
1611
|
* ```typescript
|
|
1612
|
-
* import {ApiKeys} from '@verdocs/js-sdk
|
|
1612
|
+
* import {ApiKeys} from '@verdocs/js-sdk';
|
|
1613
1613
|
*
|
|
1614
1614
|
* await ApiKeys.updateKey(ORGID, CLIENTID, {name: NEWNAME});
|
|
1615
1615
|
* ```
|
|
1616
1616
|
*/
|
|
1617
|
-
const updateApiKey = (endpoint,
|
|
1618
|
-
.patch(`/
|
|
1617
|
+
const updateApiKey = (endpoint, clientId, params) => endpoint.api //
|
|
1618
|
+
.patch(`/v2/api-keys/${clientId}`, params)
|
|
1619
1619
|
.then((r) => r.data);
|
|
1620
1620
|
/**
|
|
1621
1621
|
* Delete an API key.
|
|
1622
1622
|
*
|
|
1623
1623
|
* ```typescript
|
|
1624
|
-
* import {ApiKeys} from '@verdocs/js-sdk
|
|
1624
|
+
* import {ApiKeys} from '@verdocs/js-sdk';
|
|
1625
1625
|
*
|
|
1626
1626
|
* await ApiKeys.deleteKey(ORGID, CLIENTID);
|
|
1627
1627
|
* ```
|
|
1628
1628
|
*/
|
|
1629
|
-
const deleteApiKey = (endpoint,
|
|
1630
|
-
.delete(`/
|
|
1629
|
+
const deleteApiKey = (endpoint, clientId) => endpoint.api //
|
|
1630
|
+
.delete(`/v2/api-keys/${clientId}`)
|
|
1631
1631
|
.then((r) => r.data);
|
|
1632
1632
|
|
|
1633
1633
|
/**
|
|
@@ -1643,52 +1643,37 @@ const deleteApiKey = (endpoint, organizationId, clientId) => endpoint.api //
|
|
|
1643
1643
|
* Get a list of groups for a given organization. The caller must have admin access to the organization.
|
|
1644
1644
|
*
|
|
1645
1645
|
* ```typescript
|
|
1646
|
-
* import {
|
|
1646
|
+
* import {getGroups} from '@verdocs/js-sdk';
|
|
1647
1647
|
*
|
|
1648
|
-
* const groups = await
|
|
1648
|
+
* const groups = await getGroups(ORGID);
|
|
1649
1649
|
* ```
|
|
1650
1650
|
*/
|
|
1651
|
-
const getGroups = (endpoint
|
|
1652
|
-
.get(`/
|
|
1651
|
+
const getGroups = (endpoint) => endpoint.api //
|
|
1652
|
+
.get(`/v2/organization-groups`)
|
|
1653
1653
|
.then((r) => r.data);
|
|
1654
1654
|
/**
|
|
1655
|
-
* Get a
|
|
1655
|
+
* Get the details for a group, including its member profiles and list of permissions.
|
|
1656
1656
|
*
|
|
1657
1657
|
* ```typescript
|
|
1658
|
-
* import {
|
|
1658
|
+
* import {getGroup} from '@verdocs/js-sdk/v2/organization-groups';
|
|
1659
1659
|
*
|
|
1660
|
-
* const groups = await
|
|
1660
|
+
* const groups = await getGroup(GROUPID);
|
|
1661
1661
|
* ```
|
|
1662
1662
|
*/
|
|
1663
|
-
const
|
|
1664
|
-
.get(`/
|
|
1663
|
+
const getGroup = (endpoint, groupId) => endpoint.api //
|
|
1664
|
+
.get(`/v2/organization-groups/${groupId}`)
|
|
1665
1665
|
.then((r) => r.data);
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
*
|
|
1669
|
-
* ```typescript
|
|
1670
|
-
* import {Groups} from '@verdocs/js-sdk/Organizations';
|
|
1671
|
-
*
|
|
1672
|
-
* const groups = await Groups.getGroups(ORGID);
|
|
1673
|
-
* ```
|
|
1674
|
-
*/
|
|
1675
|
-
const getGroup = (endpoint, organizationId, groupId) => endpoint.api //
|
|
1676
|
-
.get(`/organizations/${organizationId}/groups/${groupId}`)
|
|
1677
|
-
.then((r) => r.data);
|
|
1678
|
-
const getGroupMembers = (endpoint, organizationId, groupId) => endpoint.api //
|
|
1679
|
-
.get(`/organizations/${organizationId}/groups/${groupId}/members`)
|
|
1666
|
+
const createGroup = (endpoint, name) => endpoint.api //
|
|
1667
|
+
.post('/v2/organization-groups', { name })
|
|
1680
1668
|
.then((r) => r.data);
|
|
1681
|
-
const
|
|
1682
|
-
.post(`/
|
|
1669
|
+
const addGroupMember = (endpoint, groupId, profile_id) => endpoint.api //
|
|
1670
|
+
.post(`/v2/organization-groups/${groupId}/members`, { profile_id })
|
|
1683
1671
|
.then((r) => r.data);
|
|
1684
|
-
const
|
|
1685
|
-
.
|
|
1672
|
+
const deleteGroupMember = (endpoint, groupId, profile_id) => endpoint.api //
|
|
1673
|
+
.delete(`/v2/organization-groups/${groupId}/members/${profile_id}`)
|
|
1686
1674
|
.then((r) => r.data);
|
|
1687
|
-
const
|
|
1688
|
-
.
|
|
1689
|
-
.then((r) => r.data);
|
|
1690
|
-
const deleteGroupPermission = (endpoint, organizationId, groupId, permission) => endpoint.api //
|
|
1691
|
-
.delete(`/organizations/${organizationId}/groups/${groupId}/permissions/${permission}`)
|
|
1675
|
+
const updateGroup = (endpoint, groupId, params) => endpoint.api //
|
|
1676
|
+
.patch(`/v2/organization-groups/${groupId}`, params)
|
|
1692
1677
|
.then((r) => r.data);
|
|
1693
1678
|
|
|
1694
1679
|
/**
|
|
@@ -1696,32 +1681,26 @@ const deleteGroupPermission = (endpoint, organizationId, groupId, permission) =>
|
|
|
1696
1681
|
*
|
|
1697
1682
|
* @module
|
|
1698
1683
|
*/
|
|
1699
|
-
const getOrganizationInvitations = (endpoint
|
|
1700
|
-
.get(`/
|
|
1701
|
-
.then((r) => r.data);
|
|
1702
|
-
const createOrganizationInvitation = (endpoint, organizationId, params) => endpoint.api //
|
|
1703
|
-
.post(`/organizations/${organizationId}/invitation`, params)
|
|
1684
|
+
const getOrganizationInvitations = (endpoint) => endpoint.api //
|
|
1685
|
+
.get(`/v2/organization-invitations`)
|
|
1704
1686
|
.then((r) => r.data);
|
|
1705
|
-
const
|
|
1706
|
-
.
|
|
1687
|
+
const createOrganizationInvitation = (endpoint, params) => endpoint.api //
|
|
1688
|
+
.post(`/v2/organization-invitations`, params)
|
|
1707
1689
|
.then((r) => r.data);
|
|
1708
|
-
const
|
|
1709
|
-
.
|
|
1690
|
+
const deleteOrganizationInvitation = (endpoint, email) => endpoint.api //
|
|
1691
|
+
.delete(`/v2/organization-invitations/${email}`)
|
|
1710
1692
|
.then((r) => r.data);
|
|
1711
|
-
const
|
|
1712
|
-
.
|
|
1693
|
+
const updateOrganizationInvitation = (endpoint, email, params) => endpoint.api //
|
|
1694
|
+
.patch(`/v2/organization-invitations/${email}`, params)
|
|
1713
1695
|
.then((r) => r.data);
|
|
1714
|
-
const
|
|
1715
|
-
.
|
|
1696
|
+
const resendOrganizationInvitation = (endpoint, email) => endpoint.api //
|
|
1697
|
+
.post('/v2/organization-invitations/resend', { email })
|
|
1716
1698
|
.then((r) => r.data);
|
|
1717
|
-
const acceptOrganizationInvitation = (endpoint,
|
|
1718
|
-
.post(
|
|
1699
|
+
const acceptOrganizationInvitation = (endpoint, email, token) => endpoint.api //
|
|
1700
|
+
.post('/v2/organization-invitations/accept', { email, token })
|
|
1719
1701
|
.then((r) => r.data);
|
|
1720
|
-
const declineOrganizationInvitation = (endpoint,
|
|
1721
|
-
.post(
|
|
1722
|
-
.then((r) => r.data);
|
|
1723
|
-
const claimNewUser = (endpoint, organizationId, email, token) => endpoint.api //
|
|
1724
|
-
.put(`/organizations/${organizationId}/invitation/${email}/token/${token}/new_user`)
|
|
1702
|
+
const declineOrganizationInvitation = (endpoint, email, token) => endpoint.api //
|
|
1703
|
+
.post('/v2/organization-invitations/decline', { email, token })
|
|
1725
1704
|
.then((r) => r.data);
|
|
1726
1705
|
|
|
1727
1706
|
/**
|
|
@@ -1729,20 +1708,14 @@ const claimNewUser = (endpoint, organizationId, email, token) => endpoint.api //
|
|
|
1729
1708
|
*
|
|
1730
1709
|
* @module
|
|
1731
1710
|
*/
|
|
1732
|
-
const getOrganizationMembers = (endpoint
|
|
1733
|
-
.get(`/
|
|
1734
|
-
.then((r) => r.data);
|
|
1735
|
-
const deleteOrganizationMember = (endpoint, organizationId, profileId) => endpoint.api //
|
|
1736
|
-
.delete(`/organizations/${organizationId}/profiles/${profileId}`)
|
|
1711
|
+
const getOrganizationMembers = (endpoint) => endpoint.api //
|
|
1712
|
+
.get(`/v2/organization-members`)
|
|
1737
1713
|
.then((r) => r.data);
|
|
1738
|
-
const
|
|
1739
|
-
.
|
|
1714
|
+
const deleteOrganizationMember = (endpoint, profileId) => endpoint.api //
|
|
1715
|
+
.delete(`/v2/organization-members/${profileId}`)
|
|
1740
1716
|
.then((r) => r.data);
|
|
1741
|
-
const
|
|
1742
|
-
.
|
|
1743
|
-
.then((r) => r.data);
|
|
1744
|
-
const getOrganizationMemberPlans = (endpoint, organizationId, profileId) => endpoint.api //
|
|
1745
|
-
.get(`/organizations/${organizationId}/profiles/${profileId}/plans`)
|
|
1717
|
+
const updateOrganizationMember = (endpoint, profileId, params) => endpoint.api //
|
|
1718
|
+
.patch(`/v2/organization-members/${profileId}`, params)
|
|
1746
1719
|
.then((r) => r.data);
|
|
1747
1720
|
|
|
1748
1721
|
/**
|
|
@@ -1751,41 +1724,53 @@ const getOrganizationMemberPlans = (endpoint, organizationId, profileId) => endp
|
|
|
1751
1724
|
* @module
|
|
1752
1725
|
*/
|
|
1753
1726
|
/**
|
|
1754
|
-
* Get a list of organizations the
|
|
1727
|
+
* Get a list of organizations the caller is a member of.
|
|
1755
1728
|
*/
|
|
1756
1729
|
const getOrganizations = (endpoint) => endpoint.api //
|
|
1757
|
-
.get('/organizations')
|
|
1730
|
+
.get('/v2/organizations')
|
|
1731
|
+
.then((r) => r.data);
|
|
1732
|
+
/**
|
|
1733
|
+
* Get an organization by ID.
|
|
1734
|
+
*/
|
|
1735
|
+
const getOrganization = (endpoint, organizationId) => endpoint.api //
|
|
1736
|
+
.get(`/v2/organizations/${organizationId}`)
|
|
1758
1737
|
.then((r) => r.data);
|
|
1759
1738
|
/**
|
|
1760
1739
|
* Create an organization.
|
|
1761
1740
|
*/
|
|
1762
1741
|
const createOrganization = (endpoint) => endpoint.api //
|
|
1763
|
-
.post('/organizations')
|
|
1742
|
+
.post('/v2/organizations')
|
|
1764
1743
|
.then((r) => r.data);
|
|
1765
1744
|
/**
|
|
1766
1745
|
* Delete an organization.
|
|
1767
1746
|
*/
|
|
1768
1747
|
const deleteOrganization = (endpoint, organizationId) => endpoint.api //
|
|
1769
|
-
.delete(`/organizations/${organizationId}`)
|
|
1770
|
-
.then((r) => r.data);
|
|
1771
|
-
/**
|
|
1772
|
-
* Get an organization by ID.
|
|
1773
|
-
*/
|
|
1774
|
-
const getOrganization = (endpoint, organizationId) => endpoint.api //
|
|
1775
|
-
.get(`/organizations/${organizationId}`)
|
|
1748
|
+
.delete(`/v2/organizations/${organizationId}`)
|
|
1776
1749
|
.then((r) => r.data);
|
|
1777
1750
|
/**
|
|
1778
1751
|
* Update an organization.
|
|
1779
1752
|
*/
|
|
1780
1753
|
const updateOrganization = (endpoint, organizationId, params) => endpoint.api //
|
|
1781
|
-
.patch(`/organizations/${organizationId}`, params)
|
|
1754
|
+
.patch(`/v2/organizations/${organizationId}`, params)
|
|
1782
1755
|
.then((r) => r.data);
|
|
1783
1756
|
|
|
1757
|
+
/**
|
|
1758
|
+
* Webhooks are callback triggers from Verdocs to your servers that notify your applications
|
|
1759
|
+
* of various events, such as signing operations.
|
|
1760
|
+
*
|
|
1761
|
+
* @module
|
|
1762
|
+
*/
|
|
1763
|
+
/**
|
|
1764
|
+
* Get the registered Webhooks for the caller's organization.
|
|
1765
|
+
*/
|
|
1784
1766
|
const getWebhooks = (endpoint) => endpoint.api //
|
|
1785
1767
|
.get(`/v2/webhooks/organization`)
|
|
1786
1768
|
.then((r) => r.data);
|
|
1769
|
+
/**
|
|
1770
|
+
* Update the registered Webhooks for the caller's organization.
|
|
1771
|
+
*/
|
|
1787
1772
|
const setWebhooks = (endpoint, params) => endpoint.api //
|
|
1788
|
-
.
|
|
1773
|
+
.patch(`/v2/webhooks/organization`, params)
|
|
1789
1774
|
.then((r) => r.data);
|
|
1790
1775
|
|
|
1791
1776
|
/**
|
|
@@ -2469,7 +2454,7 @@ const authenticateUser = (endpoint, params) => endpoint.api //
|
|
|
2469
2454
|
* NodeJS server-side applications. Never expose your Client Secret in a Web or Mobile app!** Also note
|
|
2470
2455
|
* that access tokens may be cached by server-side apps (and this is recommended) but do expire after 2
|
|
2471
2456
|
* hours. This expiration may change based on future security needs. Application developers are encouraged
|
|
2472
|
-
* to check the `exp` expiration field in the response
|
|
2457
|
+
* to check the `exp` expiration field in the response, and renew tokens after they expire.
|
|
2473
2458
|
*
|
|
2474
2459
|
* ```typescript
|
|
2475
2460
|
* import {Auth} from '@verdocs/js-sdk/Auth';
|
|
@@ -2482,23 +2467,6 @@ const authenticateUser = (endpoint, params) => endpoint.api //
|
|
|
2482
2467
|
const authenticateApp = (endpoint, params) => endpoint.api //
|
|
2483
2468
|
.post('/authentication/login_client', {}, { headers: params })
|
|
2484
2469
|
.then((r) => r.data);
|
|
2485
|
-
/**
|
|
2486
|
-
* Validate a token. Only Verdocs tokens will be accepted. Most applications can decode tokens locally,
|
|
2487
|
-
* because tokens will be validated when API calls are made anyway. However, high-security applications
|
|
2488
|
-
* may use this endpoint to check if a token has been revoked.
|
|
2489
|
-
*
|
|
2490
|
-
* ```typescript
|
|
2491
|
-
* import {Auth} from '@verdocs/js-sdk/Auth';
|
|
2492
|
-
*
|
|
2493
|
-
* const {valid} = await Auth.validateToken({ token });
|
|
2494
|
-
* if (!valid) {
|
|
2495
|
-
* window.alert('Session invalid or expired. Please re-authenticate.');
|
|
2496
|
-
* }
|
|
2497
|
-
* ```
|
|
2498
|
-
*/
|
|
2499
|
-
const validateToken = (endpoint, params) => endpoint.api //
|
|
2500
|
-
.post('/token/isValid', params)
|
|
2501
|
-
.then((r) => r.data);
|
|
2502
2470
|
/**
|
|
2503
2471
|
* If called before the session expires, this will refresh the caller's session and tokens.
|
|
2504
2472
|
*
|
|
@@ -2514,7 +2482,7 @@ const refreshTokens = (endpoint) => endpoint.api //
|
|
|
2514
2482
|
.get('/token')
|
|
2515
2483
|
.then((r) => r.data);
|
|
2516
2484
|
/**
|
|
2517
|
-
* Update the caller's password
|
|
2485
|
+
* Update the caller's password when the old password is known (typically for logged-in users).
|
|
2518
2486
|
*
|
|
2519
2487
|
* ```typescript
|
|
2520
2488
|
* import {Auth} from '@verdocs/js-sdk/Auth';
|
|
@@ -2525,11 +2493,11 @@ const refreshTokens = (endpoint) => endpoint.api //
|
|
|
2525
2493
|
* }
|
|
2526
2494
|
* ```
|
|
2527
2495
|
*/
|
|
2528
|
-
const
|
|
2496
|
+
const changePassword = (endpoint, params) => endpoint.api //
|
|
2529
2497
|
.put('/user/update_password', params)
|
|
2530
2498
|
.then((r) => r.data);
|
|
2531
2499
|
/**
|
|
2532
|
-
*
|
|
2500
|
+
* Request a password reset, when the old password is not known (typically in login forms).
|
|
2533
2501
|
*
|
|
2534
2502
|
* ```typescript
|
|
2535
2503
|
* import {Auth} from '@verdocs/js-sdk/Auth';
|
|
@@ -2543,18 +2511,6 @@ const updatePassword = (endpoint, params) => endpoint.api //
|
|
|
2543
2511
|
const resetPassword = (endpoint, params) => endpoint.api //
|
|
2544
2512
|
.post('/user/reset_password', params)
|
|
2545
2513
|
.then((r) => r.data);
|
|
2546
|
-
/**
|
|
2547
|
-
* Update the caller's email address.
|
|
2548
|
-
*
|
|
2549
|
-
* ```typescript
|
|
2550
|
-
* import {Auth} from '@verdocs/js-sdk/Auth';
|
|
2551
|
-
*
|
|
2552
|
-
* const {profiles} = await Auth.updateEmail({ email: newEmail });
|
|
2553
|
-
* ```
|
|
2554
|
-
*/
|
|
2555
|
-
const updateEmail = (endpoint, params) => endpoint.api //
|
|
2556
|
-
.put('/user/update_email', params)
|
|
2557
|
-
.then((r) => r.data);
|
|
2558
2514
|
/**
|
|
2559
2515
|
* Resend the email verification request. Note that to prevent certain forms of abuse, the email address is not
|
|
2560
2516
|
* a parameter here. Instead, the caller must be authenticated as the (unverified) user. To simplify this process,
|
|
@@ -2571,15 +2527,9 @@ const updateEmail = (endpoint, params) => endpoint.api //
|
|
|
2571
2527
|
const resendVerification = (endpoint, accessToken) => endpoint.api //
|
|
2572
2528
|
.post('/user/email_verification', {}, accessToken ? { headers: { Authorization: `Bearer ${accessToken}` } } : {})
|
|
2573
2529
|
.then((r) => r.data);
|
|
2574
|
-
const createUser = (endpoint, params) => endpoint.api //
|
|
2575
|
-
.post('/user', params)
|
|
2576
|
-
.then((r) => r.data);
|
|
2577
|
-
|
|
2578
|
-
// TODO
|
|
2579
|
-
const billingPlaceholder = {};
|
|
2580
2530
|
|
|
2581
2531
|
const getNotifications = async (endpoint) => endpoint.api //
|
|
2582
|
-
.get('/notifications')
|
|
2532
|
+
.get('/v2/notifications')
|
|
2583
2533
|
.then((r) => r.data);
|
|
2584
2534
|
|
|
2585
2535
|
/**
|
|
@@ -2592,7 +2542,7 @@ const getNotifications = async (endpoint) => endpoint.api //
|
|
|
2592
2542
|
* ```
|
|
2593
2543
|
*/
|
|
2594
2544
|
const getProfiles = (endpoint) => endpoint.api //
|
|
2595
|
-
.get('/profiles')
|
|
2545
|
+
.get('/v2/profiles')
|
|
2596
2546
|
.then((r) => r.data);
|
|
2597
2547
|
/**
|
|
2598
2548
|
* Get the user's available profiles. The current profile will be marked with `current: true`.
|
|
@@ -2604,20 +2554,8 @@ const getProfiles = (endpoint) => endpoint.api //
|
|
|
2604
2554
|
* ```
|
|
2605
2555
|
*/
|
|
2606
2556
|
const getCurrentProfile = (endpoint) => endpoint.api //
|
|
2607
|
-
.get('/profiles')
|
|
2557
|
+
.get('/v2/profiles')
|
|
2608
2558
|
.then((r) => (r.data || []).find((profile) => profile.current));
|
|
2609
|
-
/**
|
|
2610
|
-
* Get a list of system roles.
|
|
2611
|
-
*
|
|
2612
|
-
* ```typescript
|
|
2613
|
-
* import {Profiles} from '@verdocs/js-sdk/Users';
|
|
2614
|
-
*
|
|
2615
|
-
* const roles = await Profiles.getRoles();
|
|
2616
|
-
* ```
|
|
2617
|
-
*/
|
|
2618
|
-
const getRoles = (endpoint) => endpoint.api //
|
|
2619
|
-
.get('/roles')
|
|
2620
|
-
.then((r) => r.data);
|
|
2621
2559
|
/**
|
|
2622
2560
|
* Create a profile. If the caller does not have a "current" profile set, the new profile will be made current.
|
|
2623
2561
|
*
|
|
@@ -2628,7 +2566,7 @@ const getRoles = (endpoint) => endpoint.api //
|
|
|
2628
2566
|
* ```
|
|
2629
2567
|
*/
|
|
2630
2568
|
const createProfile = (endpoint, params) => endpoint.api //
|
|
2631
|
-
.post('/profiles', params)
|
|
2569
|
+
.post('/v2/profiles', params)
|
|
2632
2570
|
.then((r) => r.data);
|
|
2633
2571
|
/**
|
|
2634
2572
|
* Get a profile. The caller must have admin access to the given profile.
|
|
@@ -2641,19 +2579,7 @@ const createProfile = (endpoint, params) => endpoint.api //
|
|
|
2641
2579
|
* ```
|
|
2642
2580
|
*/
|
|
2643
2581
|
const getProfile = (endpoint, profileId) => endpoint.api //
|
|
2644
|
-
.get(`/profiles/${profileId}`)
|
|
2645
|
-
.then((r) => r.data);
|
|
2646
|
-
/**
|
|
2647
|
-
* Get a profile's groups.
|
|
2648
|
-
*
|
|
2649
|
-
* ```typescript
|
|
2650
|
-
* import {Profiles} from '@verdocs/js-sdk/Users';
|
|
2651
|
-
*
|
|
2652
|
-
* const groups = await Profiles.getProfileGroups('PROFILEID');
|
|
2653
|
-
* ```
|
|
2654
|
-
*/
|
|
2655
|
-
const getProfileGroups = (endpoint, profileId) => endpoint.api //
|
|
2656
|
-
.get(`/profiles/${profileId}/groups`)
|
|
2582
|
+
.get(`/v2/profiles/${profileId}`)
|
|
2657
2583
|
.then((r) => r.data);
|
|
2658
2584
|
/**
|
|
2659
2585
|
* Switch the caller's "current" profile. The current profile is used for permissions checking and profile_id field settings
|
|
@@ -2666,7 +2592,7 @@ const getProfileGroups = (endpoint, profileId) => endpoint.api //
|
|
|
2666
2592
|
* ```
|
|
2667
2593
|
*/
|
|
2668
2594
|
const switchProfile = (endpoint, profileId) => endpoint.api //
|
|
2669
|
-
.post(`/profiles/${profileId}/switch`)
|
|
2595
|
+
.post(`/v2/profiles/${profileId}/switch`)
|
|
2670
2596
|
.then((r) => r.data);
|
|
2671
2597
|
/**
|
|
2672
2598
|
* Update a profile. For future expansion, the profile ID to update is required, but currently this must also be the
|
|
@@ -2679,11 +2605,8 @@ const switchProfile = (endpoint, profileId) => endpoint.api //
|
|
|
2679
2605
|
* ```
|
|
2680
2606
|
*/
|
|
2681
2607
|
const updateProfile = (endpoint, profileId, params) => endpoint.api //
|
|
2682
|
-
.
|
|
2608
|
+
.patch(`/v2/profiles/${profileId}`, params)
|
|
2683
2609
|
.then((r) => r.data);
|
|
2684
|
-
// endpoint.api //
|
|
2685
|
-
// .post<IEnvelopeSummaries>('/envelopes/list', params, {baseURL: endpoint.getBaseURLv2()})
|
|
2686
|
-
// .then((r) => r.data);
|
|
2687
2610
|
/**
|
|
2688
2611
|
* Delete a profile. If the requested profile is the caller's curent profile, the next available profile will be selected.
|
|
2689
2612
|
*
|
|
@@ -2694,7 +2617,7 @@ const updateProfile = (endpoint, profileId, params) => endpoint.api //
|
|
|
2694
2617
|
* ```
|
|
2695
2618
|
*/
|
|
2696
2619
|
const deleteProfile = (endpoint, profileId) => endpoint.api //
|
|
2697
|
-
.delete(`/profiles/${profileId}`)
|
|
2620
|
+
.delete(`/v2/profiles/${profileId}`)
|
|
2698
2621
|
.then((r) => r.data);
|
|
2699
2622
|
/**
|
|
2700
2623
|
* Create a user account and parent organization. This endpoint is for creating a new organization. Users joining an
|
|
@@ -2708,12 +2631,12 @@ const deleteProfile = (endpoint, profileId) => endpoint.api //
|
|
|
2708
2631
|
* });
|
|
2709
2632
|
* ```
|
|
2710
2633
|
*/
|
|
2711
|
-
const
|
|
2634
|
+
const createAccount = (endpoint, params) => endpoint.api //
|
|
2712
2635
|
.post('/user/business', params)
|
|
2713
2636
|
.then((r) => r.data);
|
|
2714
2637
|
const recordSignupSurvey = (endpoint, params) => endpoint.api //
|
|
2715
2638
|
.post('/user/signup', params)
|
|
2716
2639
|
.then((r) => r.data);
|
|
2717
2640
|
|
|
2718
|
-
export { AtoB, Countries, VerdocsEndpoint, acceptOrganizationInvitation,
|
|
2641
|
+
export { AtoB, Countries, VerdocsEndpoint, acceptOrganizationInvitation, addGroupMember, addTemplateTag, authenticateApp, authenticateUser, blobToBase64, canPerformTemplateAction, cancelEnvelope, capitalize, changePassword, convertToE164, createAccount, 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, getMatchingCountry, getNextRecipient, getNotifications, getOrganization, 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, recordSignupSurvey, refreshTokens, rescale, resendInvitation, resendOrganizationInvitation, resendVerification, resetPassword, rotateApiKey, searchEnvelopes, searchTemplates, sendDelegate, setWebhooks, switchProfile, throttledGetEnvelope, throttledGetTemplate, timePeriod, toggleStar, updateApiKey, updateEnvelopeField, updateEnvelopeFieldInitials, updateEnvelopeFieldSignature, updateEnvelopeReminder, updateField, updateGroup, updateOrganization, updateOrganizationInvitation, updateOrganizationMember, updateProfile, 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 };
|
|
2719
2642
|
//# sourceMappingURL=index.mjs.map
|