@verdocs/js-sdk 4.1.11 → 4.1.13
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 +385 -330
- package/dist/index.d.ts +385 -330
- package/dist/index.js +46 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +46 -2
- package/dist/index.mjs.map +1 -1
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -107,6 +107,8 @@ interface IOrganization {
|
|
|
107
107
|
interface IOrganizationInvitation {
|
|
108
108
|
organization_id: string;
|
|
109
109
|
email: string;
|
|
110
|
+
first_name: string;
|
|
111
|
+
last_name: string;
|
|
110
112
|
status: "pending";
|
|
111
113
|
role: TRole;
|
|
112
114
|
generated_at: string;
|
|
@@ -1636,8 +1638,17 @@ interface IUpdateApiKeyRequest {
|
|
|
1636
1638
|
}
|
|
1637
1639
|
interface ICreateInvitationRequest {
|
|
1638
1640
|
email: string;
|
|
1641
|
+
first_name: string;
|
|
1642
|
+
last_name: string;
|
|
1639
1643
|
role: TRole;
|
|
1640
1644
|
}
|
|
1645
|
+
interface IAcceptOrganizationInvitationRequest {
|
|
1646
|
+
email: string;
|
|
1647
|
+
token: string;
|
|
1648
|
+
first_name: string;
|
|
1649
|
+
last_name: string;
|
|
1650
|
+
password: string;
|
|
1651
|
+
}
|
|
1641
1652
|
interface ISetWebhookRequest {
|
|
1642
1653
|
url: string;
|
|
1643
1654
|
active: boolean;
|
|
@@ -1727,133 +1738,422 @@ declare const deleteGroupMember: (endpoint: VerdocsEndpoint, groupId: string, pr
|
|
|
1727
1738
|
declare const updateGroup: (endpoint: VerdocsEndpoint, groupId: string, params: {
|
|
1728
1739
|
permissions: TPermission[];
|
|
1729
1740
|
}) => Promise<any>;
|
|
1741
|
+
interface IUpdateProfileRequest {
|
|
1742
|
+
first_name?: string;
|
|
1743
|
+
last_name?: string;
|
|
1744
|
+
// email?: string;
|
|
1745
|
+
phone?: string;
|
|
1746
|
+
permissions?: TPermission[];
|
|
1747
|
+
roles?: TRole[];
|
|
1748
|
+
}
|
|
1749
|
+
interface IAuthenticateResponse {
|
|
1750
|
+
access_token: string;
|
|
1751
|
+
id_token: string;
|
|
1752
|
+
refresh_token: string;
|
|
1753
|
+
expires_in: number;
|
|
1754
|
+
access_token_exp: number;
|
|
1755
|
+
refresh_token_exp: number;
|
|
1756
|
+
}
|
|
1757
|
+
interface IUpdatePasswordRequest {
|
|
1758
|
+
email: string;
|
|
1759
|
+
oldPassword: string;
|
|
1760
|
+
newPassword: string;
|
|
1761
|
+
}
|
|
1762
|
+
interface IUpdatePasswordResponse {
|
|
1763
|
+
status: TRequestStatus;
|
|
1764
|
+
/** Success or failure message */
|
|
1765
|
+
message: string;
|
|
1766
|
+
}
|
|
1767
|
+
interface ICreateAccountRequest {
|
|
1768
|
+
email: string;
|
|
1769
|
+
password: string;
|
|
1770
|
+
firstName: string;
|
|
1771
|
+
lastName: string;
|
|
1772
|
+
orgName: string;
|
|
1773
|
+
}
|
|
1774
|
+
interface IROPCRequest {
|
|
1775
|
+
grant_type: "password";
|
|
1776
|
+
username: string;
|
|
1777
|
+
password: string;
|
|
1778
|
+
client_id?: string;
|
|
1779
|
+
scope?: string;
|
|
1780
|
+
}
|
|
1781
|
+
interface IClientCredentialsRequest {
|
|
1782
|
+
grant_type: "client_credentials";
|
|
1783
|
+
client_id: string;
|
|
1784
|
+
client_secret: string;
|
|
1785
|
+
scope?: string;
|
|
1786
|
+
}
|
|
1787
|
+
interface IRefreshTokenRequest {
|
|
1788
|
+
grant_type: "refresh_token";
|
|
1789
|
+
refresh_token: string;
|
|
1790
|
+
client_id?: string;
|
|
1791
|
+
scope?: string;
|
|
1792
|
+
}
|
|
1793
|
+
type TAuthenticationRequest = IROPCRequest | IClientCredentialsRequest | IRefreshTokenRequest;
|
|
1730
1794
|
/**
|
|
1731
|
-
*
|
|
1795
|
+
* Authenticate to Verdocs.
|
|
1732
1796
|
*
|
|
1733
|
-
*
|
|
1734
|
-
|
|
1735
|
-
declare const getOrganizationInvitations: (endpoint: VerdocsEndpoint) => Promise<IOrganizationInvitation[]>;
|
|
1736
|
-
declare const createOrganizationInvitation: (endpoint: VerdocsEndpoint, params: ICreateInvitationRequest) => Promise<IOrganizationInvitation>;
|
|
1737
|
-
declare const deleteOrganizationInvitation: (endpoint: VerdocsEndpoint, email: string) => Promise<any>;
|
|
1738
|
-
declare const updateOrganizationInvitation: (endpoint: VerdocsEndpoint, email: string, params: Partial<ICreateInvitationRequest>) => Promise<IOrganizationInvitation>;
|
|
1739
|
-
declare const resendOrganizationInvitation: (endpoint: VerdocsEndpoint, email: string) => Promise<any>;
|
|
1740
|
-
declare const getOrganizationInvitation: (endpoint: VerdocsEndpoint, email: string, token: string) => Promise<IOrganizationInvitation>;
|
|
1741
|
-
declare const acceptOrganizationInvitation: (endpoint: VerdocsEndpoint, email: string, token: string) => Promise<IProfile>;
|
|
1742
|
-
declare const declineOrganizationInvitation: (endpoint: VerdocsEndpoint, email: string, token: string) => Promise<{
|
|
1743
|
-
status: "OK";
|
|
1744
|
-
}>;
|
|
1745
|
-
/**
|
|
1746
|
-
* An Organization Member (aka Profile) is an individual user with access to an organization.
|
|
1797
|
+
* ```typescript
|
|
1798
|
+
* import {authenticate, VerdocsEndpoint} from '@verdocs/js-sdk';
|
|
1747
1799
|
*
|
|
1748
|
-
*
|
|
1800
|
+
* // Client-side call, suitable for Web and mobile apps:
|
|
1801
|
+
* const {access_token} = await Auth.authenticate({ username: 'test@test.com', password: 'PASSWORD', grant_type:'password' });
|
|
1802
|
+
* VerdocsEndpoint.getDefault().setAuthToken(access_token);
|
|
1803
|
+
*
|
|
1804
|
+
* // Server-side call, suitable for server apps. NEVER EXPOSE client_secret IN FRONT-END CODE:
|
|
1805
|
+
* const {access_token} = await Auth.authenticate({ client_id: '...', client_secret: '...', grant_type:'client_credentials' });
|
|
1806
|
+
* VerdocsEndpoint.getDefault().setAuthToken(access_token);
|
|
1807
|
+
* ```
|
|
1749
1808
|
*/
|
|
1750
|
-
declare const
|
|
1751
|
-
declare const deleteOrganizationMember: (endpoint: VerdocsEndpoint, profileId: string) => Promise<any>;
|
|
1752
|
-
declare const updateOrganizationMember: (endpoint: VerdocsEndpoint, profileId: string, params: Pick<IProfile, "roles" | "permissions">) => Promise<any>;
|
|
1809
|
+
declare const authenticate: (endpoint: VerdocsEndpoint, params: TAuthenticationRequest) => Promise<IAuthenticateResponse>;
|
|
1753
1810
|
/**
|
|
1754
|
-
*
|
|
1755
|
-
* if the caller is not a member of the organization (the public fields).
|
|
1811
|
+
* If called before the session expires, this will refresh the caller's session and tokens.
|
|
1756
1812
|
*
|
|
1757
1813
|
* ```typescript
|
|
1758
|
-
* import {
|
|
1814
|
+
* import {Auth, VerdocsEndpoint} from '@verdocs/js-sdk';
|
|
1759
1815
|
*
|
|
1760
|
-
* const
|
|
1816
|
+
* const {accessToken} = await Auth.refreshTokens();
|
|
1817
|
+
* VerdocsEndpoint.setAuthToken(accessToken);
|
|
1761
1818
|
* ```
|
|
1762
1819
|
*/
|
|
1763
|
-
declare const
|
|
1820
|
+
declare const refreshToken: (endpoint: VerdocsEndpoint, refreshToken: string) => Promise<IAuthenticateResponse>;
|
|
1764
1821
|
/**
|
|
1765
|
-
* Update
|
|
1822
|
+
* Update the caller's password when the old password is known (typically for logged-in users).
|
|
1766
1823
|
*
|
|
1767
1824
|
* ```typescript
|
|
1768
|
-
* import {
|
|
1825
|
+
* import {changePassword} from '@verdocs/js-sdk';
|
|
1769
1826
|
*
|
|
1770
|
-
* const
|
|
1827
|
+
* const {status, message} = await changePassword({ email, oldPassword, newPassword });
|
|
1828
|
+
* if (status !== 'OK') {
|
|
1829
|
+
* window.alert(`Password reset error: ${message}`);
|
|
1830
|
+
* }
|
|
1771
1831
|
* ```
|
|
1772
1832
|
*/
|
|
1773
|
-
declare const
|
|
1833
|
+
declare const changePassword: (endpoint: VerdocsEndpoint, params: IUpdatePasswordRequest) => Promise<IUpdatePasswordResponse>;
|
|
1774
1834
|
/**
|
|
1775
|
-
*
|
|
1835
|
+
* Request a password reset, when the old password is not known (typically in login forms).
|
|
1776
1836
|
*
|
|
1777
1837
|
* ```typescript
|
|
1778
|
-
* import {
|
|
1838
|
+
* import {resetPassword} from '@verdocs/js-sdk';
|
|
1779
1839
|
*
|
|
1780
|
-
* await
|
|
1840
|
+
* const {success} = await resetPassword({ email });
|
|
1841
|
+
* if (status !== 'OK') {
|
|
1842
|
+
* window.alert(`Please check your email for instructions on how to reset your password.`);
|
|
1843
|
+
* }
|
|
1781
1844
|
* ```
|
|
1782
1845
|
*/
|
|
1783
|
-
declare const
|
|
1846
|
+
declare const resetPassword: (endpoint: VerdocsEndpoint, params: {
|
|
1847
|
+
email: string;
|
|
1848
|
+
}) => Promise<{
|
|
1849
|
+
success: boolean;
|
|
1850
|
+
}>;
|
|
1784
1851
|
/**
|
|
1785
|
-
*
|
|
1852
|
+
* Resend the email verification request. Note that to prevent certain forms of abuse, the email address is not
|
|
1853
|
+
* a parameter here. Instead, the caller must be authenticated as the (unverified) user. To simplify this process,
|
|
1854
|
+
* the access token to be used may be passed directly as a parameter here. This avoids the need to set it as the
|
|
1855
|
+
* active token on an endpoint, which may be inconvenient in workflows where it is preferable to keep the user in
|
|
1856
|
+
* "anonymous" mode while verification is being performed.
|
|
1786
1857
|
*
|
|
1787
1858
|
* ```typescript
|
|
1788
|
-
* import {
|
|
1859
|
+
* import {resendVerification} from '@verdocs/js-sdk';
|
|
1789
1860
|
*
|
|
1790
|
-
* await
|
|
1861
|
+
* const result = await resendVerification();
|
|
1791
1862
|
* ```
|
|
1792
1863
|
*/
|
|
1793
|
-
declare const
|
|
1864
|
+
declare const verifyEmail: (endpoint: VerdocsEndpoint, email: string, code: string) => Promise<IAuthenticateResponse>;
|
|
1794
1865
|
/**
|
|
1795
|
-
*
|
|
1866
|
+
* Resend the email verification request. Note that to prevent certain forms of abuse, the email address is not
|
|
1867
|
+
* a parameter here. Instead, the caller must be authenticated as the (unverified) user. To simplify this process,
|
|
1868
|
+
* the access token to be used may be passed directly as a parameter here. This avoids the need to set it as the
|
|
1869
|
+
* active token on an endpoint, which may be inconvenient in workflows where it is preferable to keep the user in
|
|
1870
|
+
* "anonymous" mode while verification is being performed.
|
|
1871
|
+
*
|
|
1872
|
+
* ```typescript
|
|
1873
|
+
* import {resendVerification} from '@verdocs/js-sdk';
|
|
1874
|
+
*
|
|
1875
|
+
* const result = await resendVerification();
|
|
1876
|
+
* ```
|
|
1796
1877
|
*/
|
|
1797
|
-
declare const
|
|
1878
|
+
declare const resendVerification: (endpoint: VerdocsEndpoint, accessToken?: string) => Promise<{
|
|
1879
|
+
result: "done";
|
|
1880
|
+
}>;
|
|
1881
|
+
declare const getNotifications: (endpoint: VerdocsEndpoint) => Promise<any>;
|
|
1798
1882
|
/**
|
|
1799
|
-
*
|
|
1883
|
+
* Get the user's available profiles. The current profile will be marked with `current: true`.
|
|
1884
|
+
*
|
|
1885
|
+
* ```typescript
|
|
1886
|
+
* import {getProfiles} from '@verdocs/js-sdk';
|
|
1887
|
+
*
|
|
1888
|
+
* const profiles = await getProfiles();
|
|
1889
|
+
* ```
|
|
1800
1890
|
*/
|
|
1801
|
-
declare const
|
|
1891
|
+
declare const getProfiles: (endpoint: VerdocsEndpoint) => Promise<IProfile[]>;
|
|
1802
1892
|
/**
|
|
1803
|
-
*
|
|
1893
|
+
* Get the user's available profiles. The current profile will be marked with `current: true`.
|
|
1894
|
+
*
|
|
1895
|
+
* ```typescript
|
|
1896
|
+
* import {getCurrentProfile} from '@verdocs/js-sdk';
|
|
1897
|
+
*
|
|
1898
|
+
* const profiles = await getCurrentProfile(VerdocsEndpoint.getDefault());
|
|
1899
|
+
* ```
|
|
1804
1900
|
*/
|
|
1805
|
-
declare
|
|
1901
|
+
declare const getCurrentProfile: (endpoint: VerdocsEndpoint) => Promise<IProfile | undefined>;
|
|
1806
1902
|
/**
|
|
1807
|
-
*
|
|
1903
|
+
* Get a profile. The caller must have admin access to the given profile.
|
|
1904
|
+
*
|
|
1905
|
+
* ```typescript
|
|
1906
|
+
* import {getProfile} from '@verdocs/js-sdk';
|
|
1907
|
+
*
|
|
1908
|
+
* const profile = await getProfile(VerdocsEndpoint.getDefault(), 'PROFILEID');
|
|
1909
|
+
* ```
|
|
1808
1910
|
*/
|
|
1809
|
-
declare
|
|
1911
|
+
declare const getProfile: (endpoint: VerdocsEndpoint, profileId: string) => Promise<IProfile>;
|
|
1810
1912
|
/**
|
|
1811
|
-
*
|
|
1812
|
-
*
|
|
1913
|
+
* Switch the caller's "current" profile. The current profile is used for permissions checking
|
|
1914
|
+
* and profile_id field settings for most operations in Verdocs. It is important to select the
|
|
1915
|
+
* appropropriate profile before calling other API functions.
|
|
1916
|
+
*
|
|
1917
|
+
* ```typescript
|
|
1918
|
+
* import {switchProfile} from '@verdocs/js-sdk';
|
|
1919
|
+
*
|
|
1920
|
+
* const newProfile = await switchProfile(VerdocsEndpoint.getDefault(), 'PROFILEID');
|
|
1921
|
+
* ```
|
|
1813
1922
|
*/
|
|
1814
|
-
declare
|
|
1923
|
+
declare const switchProfile: (endpoint: VerdocsEndpoint, profileId: string) => Promise<IAuthenticateResponse>;
|
|
1815
1924
|
/**
|
|
1816
|
-
*
|
|
1925
|
+
* Update a profile. For future expansion, the profile ID to update is required, but currently
|
|
1926
|
+
* this must also be the "current" profile for the caller.
|
|
1927
|
+
*
|
|
1928
|
+
* ```typescript
|
|
1929
|
+
* import {updateProfile} from '@verdocs/js-sdk/Users';
|
|
1930
|
+
*
|
|
1931
|
+
* const newProfile = await updateProfile(VerdocsEndpoint.getDefault(), 'PROFILEID');
|
|
1932
|
+
* ```
|
|
1817
1933
|
*/
|
|
1818
|
-
declare
|
|
1819
|
-
interface IFileWithData {
|
|
1820
|
-
lastModified: number;
|
|
1821
|
-
size: number;
|
|
1822
|
-
type: string;
|
|
1823
|
-
name: string;
|
|
1824
|
-
data: string;
|
|
1825
|
-
}
|
|
1826
|
-
interface ICountry {
|
|
1827
|
-
code: string;
|
|
1828
|
-
name: string;
|
|
1829
|
-
value: string;
|
|
1830
|
-
}
|
|
1831
|
-
interface ITimePeriod {
|
|
1832
|
-
start_time: string;
|
|
1833
|
-
end_time: string;
|
|
1834
|
-
}
|
|
1835
|
-
declare const formatShortTimeAgo: (val: any) => string;
|
|
1836
|
-
declare function timePeriod(type: string): ITimePeriod | null;
|
|
1837
|
-
declare function getRTop(y: number, fieldHeight: number, iTextHeight: number, yRatio: number): number;
|
|
1838
|
-
declare function getRLeft(x: number, ratio: number): number;
|
|
1839
|
-
declare function getRValue(y: number, ratio: number): number;
|
|
1840
|
-
declare function blobToBase64(image: Blob): Promise<unknown>;
|
|
1841
|
-
declare function rescale(r: number, n: number): number;
|
|
1934
|
+
declare const updateProfile: (endpoint: VerdocsEndpoint, profileId: string, params: IUpdateProfileRequest) => Promise<IProfile>;
|
|
1842
1935
|
/**
|
|
1843
|
-
*
|
|
1844
|
-
*
|
|
1936
|
+
* Delete a profile. If the requested profile is the caller's curent profile, the next
|
|
1937
|
+
* available profile will be selected.
|
|
1938
|
+
*
|
|
1939
|
+
* ```typescript
|
|
1940
|
+
* import {deleteProfile} from '@verdocs/js-sdk';
|
|
1941
|
+
*
|
|
1942
|
+
* await deleteProfile(VerdocsEndpoint.getDefault(), 'PROFILEID');
|
|
1943
|
+
* ```
|
|
1845
1944
|
*/
|
|
1846
|
-
declare const
|
|
1945
|
+
declare const deleteProfile: (endpoint: VerdocsEndpoint, profileId: string) => Promise<IAuthenticateResponse | {
|
|
1946
|
+
status: "OK";
|
|
1947
|
+
message: "Your last profile has been deleted. You are now logged out.";
|
|
1948
|
+
}>;
|
|
1847
1949
|
/**
|
|
1848
|
-
*
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1950
|
+
* Create a new user account. Note that there are two registration paths for creation:
|
|
1951
|
+
* - Get invited to an organization, by an admin or owner of that org.
|
|
1952
|
+
* - Created a new organization. The caller will become the first owner of the new org.
|
|
1953
|
+
*
|
|
1954
|
+
* This endpoint is for the second path, so an organization name is required. It is NOT
|
|
1955
|
+
* required to be unique because it is very common for businesses to have the same names,
|
|
1956
|
+
* without conflicting (e.g. "Delta" could be Delta Faucet or Delta Airlines).
|
|
1957
|
+
*
|
|
1958
|
+
* The new profile will automatically be set as the user's "current" profile, and new
|
|
1959
|
+
* session tokens will be returned to the caller. However, the caller's email may not yet
|
|
1960
|
+
* be verified. In that case, the caller will not yet be able to call other endpoints in
|
|
1961
|
+
* the Verdocs API. The caller will need to check their email for a verification code,
|
|
1962
|
+
* which should be submitted via the `verifyEmail` endpoint.
|
|
1963
|
+
*
|
|
1964
|
+
* ```typescript
|
|
1965
|
+
* import {createProfile} from '@verdocs/js-sdk';
|
|
1966
|
+
*
|
|
1967
|
+
* const newSession = await createProfile(VerdocsEndpoint.getDefault(), {
|
|
1968
|
+
* orgName: 'NEW ORG', email: 'a@b.com', password: '12345678', firstName: 'FIRST', lastName: 'LAST'
|
|
1969
|
+
* });
|
|
1970
|
+
* ```
|
|
1971
|
+
*/
|
|
1972
|
+
declare const createProfile: (endpoint: VerdocsEndpoint, params: ICreateAccountRequest) => Promise<{
|
|
1973
|
+
profile: IProfile;
|
|
1974
|
+
organization: IOrganization;
|
|
1975
|
+
}>;
|
|
1976
|
+
/**
|
|
1977
|
+
* Update the caller's profile photo. This can only be called for the user's "current" profile.
|
|
1978
|
+
*
|
|
1979
|
+
* ```typescript
|
|
1980
|
+
* import {uploadProfilePhoto} from '@verdocs/js-sdk';
|
|
1981
|
+
*
|
|
1982
|
+
* await uploadProfilePhoto((VerdocsEndpoint.getDefault(), profileId, file);
|
|
1983
|
+
* ```
|
|
1984
|
+
*/
|
|
1985
|
+
declare const updateProfilePhoto: (endpoint: VerdocsEndpoint, profileId: string, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<IProfile>;
|
|
1986
|
+
/**
|
|
1987
|
+
* An invitation represents an opportunity for a Member to join an Organization.
|
|
1988
|
+
*
|
|
1989
|
+
* @module
|
|
1990
|
+
*/
|
|
1991
|
+
/**
|
|
1992
|
+
* Get a list of invitations pending for the caller's organization. The caller must be an admin or owner.
|
|
1993
|
+
*/
|
|
1994
|
+
declare const getOrganizationInvitations: (endpoint: VerdocsEndpoint) => Promise<IOrganizationInvitation[]>;
|
|
1995
|
+
/**
|
|
1996
|
+
* Invite a new user to join the organization.
|
|
1997
|
+
*/
|
|
1998
|
+
declare const createOrganizationInvitation: (endpoint: VerdocsEndpoint, params: ICreateInvitationRequest) => Promise<IOrganizationInvitation>;
|
|
1999
|
+
/**
|
|
2000
|
+
* Delete an invitation. Note that no cancellation message will be sent. Invitations are also one-time-use.
|
|
2001
|
+
* If the invitee attempts to join after the invitation is deleted, accepted, or decline, they will be
|
|
2002
|
+
* shown an error.
|
|
2003
|
+
*/
|
|
2004
|
+
declare const deleteOrganizationInvitation: (endpoint: VerdocsEndpoint, email: string) => Promise<any>;
|
|
2005
|
+
/**
|
|
2006
|
+
* Update an invitation. Note that email may not be changed after the invite is sent. To change
|
|
2007
|
+
* an invitee's email, delete the incorrect entry and create one with the correct value.
|
|
2008
|
+
*/
|
|
2009
|
+
declare const updateOrganizationInvitation: (endpoint: VerdocsEndpoint, email: string, params: Pick<ICreateInvitationRequest, "role" | "first_name" | "last_name">) => Promise<IOrganizationInvitation>;
|
|
2010
|
+
/**
|
|
2011
|
+
* Send a reminder to the invitee to join the organization.
|
|
2012
|
+
*/
|
|
2013
|
+
declare const resendOrganizationInvitation: (endpoint: VerdocsEndpoint, email: string) => Promise<any>;
|
|
2014
|
+
/**
|
|
2015
|
+
* Get an invitation's details. This is generally used as the first step of accepting the invite.
|
|
2016
|
+
* A successful response will indicate that the invite token is still valid, and include some
|
|
2017
|
+
* metadata for the organization to style the acceptance screen.
|
|
2018
|
+
*/
|
|
2019
|
+
declare const getOrganizationInvitation: (endpoint: VerdocsEndpoint, email: string, token: string) => Promise<IOrganizationInvitation>;
|
|
2020
|
+
/**
|
|
2021
|
+
* Accept an invitation. This will automatically create an Auth0 user for the caller as well as a profile
|
|
2022
|
+
* with the appropriate role as specified in the invite. The profile will be set as "current" for the caller,
|
|
2023
|
+
* and session tokens will be returned to access the new profile. The profile's email_verified flag will
|
|
2024
|
+
* also be set to true.
|
|
2025
|
+
*/
|
|
2026
|
+
declare const acceptOrganizationInvitation: (endpoint: VerdocsEndpoint, params: IAcceptOrganizationInvitationRequest) => Promise<IAuthenticateResponse>;
|
|
2027
|
+
/**
|
|
2028
|
+
* Decline an invitation. This will mark the status "declined," providing a visual indication to the
|
|
2029
|
+
* organization's admins that the invite was declined, preventing further invites from being created
|
|
2030
|
+
* to the same email address, and also preventing the invitee from receiving reminders to join.
|
|
2031
|
+
*/
|
|
2032
|
+
declare const declineOrganizationInvitation: (endpoint: VerdocsEndpoint, email: string, token: string) => Promise<{
|
|
2033
|
+
status: "OK";
|
|
2034
|
+
}>;
|
|
2035
|
+
/**
|
|
2036
|
+
* An Organization Member (aka Profile) is an individual user with access to an organization.
|
|
2037
|
+
*
|
|
2038
|
+
* @module
|
|
2039
|
+
*/
|
|
2040
|
+
/**
|
|
2041
|
+
* Get a list of the members in the caller's organization.
|
|
2042
|
+
*/
|
|
2043
|
+
declare const getOrganizationMembers: (endpoint: VerdocsEndpoint) => Promise<IProfile[]>;
|
|
2044
|
+
/**
|
|
2045
|
+
* Delete a member from the caller's organization. Note that the caller must be an admin or owner,
|
|
2046
|
+
* may not delete him/herself
|
|
2047
|
+
*/
|
|
2048
|
+
declare const deleteOrganizationMember: (endpoint: VerdocsEndpoint, profileId: string) => Promise<any>;
|
|
2049
|
+
/**
|
|
2050
|
+
* Update a member.
|
|
2051
|
+
*/
|
|
2052
|
+
declare const updateOrganizationMember: (endpoint: VerdocsEndpoint, profileId: string, params: Pick<IProfile, "roles" | "first_name" | "last_name">) => Promise<any>;
|
|
2053
|
+
/**
|
|
2054
|
+
* Get an organization by ID. Note that this endpoint will return only a subset of fields
|
|
2055
|
+
* if the caller is not a member of the organization (the public fields).
|
|
2056
|
+
*
|
|
2057
|
+
* ```typescript
|
|
2058
|
+
* import {getOrganization} from '@verdocs/js-sdk';
|
|
2059
|
+
*
|
|
2060
|
+
* const organizations = await getOrganization(VerdocsEndpoint.getDefault(), 'ORGID');
|
|
2061
|
+
* ```
|
|
2062
|
+
*/
|
|
2063
|
+
declare const getOrganization: (endpoint: VerdocsEndpoint, organizationId: string) => Promise<IOrganization>;
|
|
2064
|
+
/**
|
|
2065
|
+
* Update an organization. This can only be called by an admin or owner.
|
|
2066
|
+
*
|
|
2067
|
+
* ```typescript
|
|
2068
|
+
* import {updateOrganization} from '@verdocs/js-sdk';
|
|
2069
|
+
*
|
|
2070
|
+
* const organizations = await updateOrganization(VerdocsEndpoint.getDefault(), organizationId, {name:'ORGNAME'});
|
|
2071
|
+
* ```
|
|
2072
|
+
*/
|
|
2073
|
+
declare const updateOrganization: (endpoint: VerdocsEndpoint, organizationId: string, params: Partial<IOrganization>) => Promise<IOrganization>;
|
|
2074
|
+
/**
|
|
2075
|
+
* Update the organization's logo. This can only be called by an admin or owner.
|
|
2076
|
+
*
|
|
2077
|
+
* ```typescript
|
|
2078
|
+
* import {updateOrganizationLogo} from '@verdocs/js-sdk';
|
|
2079
|
+
*
|
|
2080
|
+
* await updateOrganizationLogo((VerdocsEndpoint.getDefault(), organizationId, file);
|
|
2081
|
+
* ```
|
|
2082
|
+
*/
|
|
2083
|
+
declare const updateOrganizationLogo: (endpoint: VerdocsEndpoint, organizationId: string, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<IProfile>;
|
|
2084
|
+
/**
|
|
2085
|
+
* Update the organization's thumbnail. This can only be called by an admin or owner.
|
|
2086
|
+
*
|
|
2087
|
+
* ```typescript
|
|
2088
|
+
* import {updateOrganizationThumbnail} from '@verdocs/js-sdk';
|
|
2089
|
+
*
|
|
2090
|
+
* await updateOrganizationThumbnail((VerdocsEndpoint.getDefault(), organizationId, file);
|
|
2091
|
+
* ```
|
|
2092
|
+
*/
|
|
2093
|
+
declare const updateOrganizationThumbnail: (endpoint: VerdocsEndpoint, organizationId: string, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<IProfile>;
|
|
2094
|
+
/**
|
|
2095
|
+
* Get the registered Webhooks for the caller's organization.
|
|
2096
|
+
*/
|
|
2097
|
+
declare const getWebhooks: (endpoint: VerdocsEndpoint) => Promise<IWebhook>;
|
|
2098
|
+
/**
|
|
2099
|
+
* Update the registered Webhooks for the caller's organization.
|
|
2100
|
+
*/
|
|
2101
|
+
declare const setWebhooks: (endpoint: VerdocsEndpoint, params: ISetWebhookRequest) => Promise<IWebhook>;
|
|
2102
|
+
/**
|
|
2103
|
+
* Given a `rgba(r,g,b,a)` string value, returns the hex equivalent, dropping the alpha channel.
|
|
2104
|
+
*/
|
|
2105
|
+
declare function getRGB(rgba: string): string;
|
|
2106
|
+
/**
|
|
2107
|
+
* Given a signer role index, return the color code for that signer.
|
|
2108
|
+
*/
|
|
2109
|
+
declare function getRGBA(roleIndex: number): "rgba(255, 193, 7, 0.4)" | "rgba(134, 134, 134, 0.3)" | "rgba(156, 39, 176, .4)" | "rgba(33, 150, 243, .4)" | "rgba(220, 231, 117, 0.3)" | "rgba(121, 134, 203, 0.3)" | "rgba(77, 182, 172, 0.3)" | "rgba(255, 202, 165, 0.3)" | "rgba(2, 247, 190, 0.3)" | "rgba(255, 138, 101, 0.3)" | "rgba(82, 255, 79, 0.3)" | "rgba(229, 115, 155, 0.3)";
|
|
2110
|
+
/**
|
|
2111
|
+
* Given a role name, return a color code for it. This works by computing a hash code so the specific color returned
|
|
2112
|
+
* is not specified explicitly, but will be the same for every call with the same input value.
|
|
2113
|
+
*/
|
|
2114
|
+
declare function nameToRGBA(str: string): string | undefined;
|
|
2115
|
+
/**
|
|
2116
|
+
* Helper function to obtain a color code given a role name given various possible inputs.
|
|
2117
|
+
*/
|
|
2118
|
+
declare function getRoleColor(name: string, roles: TRole[], index?: number): string | undefined;
|
|
2119
|
+
interface IFileWithData {
|
|
2120
|
+
lastModified: number;
|
|
2121
|
+
size: number;
|
|
2122
|
+
type: string;
|
|
2123
|
+
name: string;
|
|
2124
|
+
data: string;
|
|
2125
|
+
}
|
|
2126
|
+
interface ICountry {
|
|
2127
|
+
code: string;
|
|
2128
|
+
name: string;
|
|
2129
|
+
value: string;
|
|
2130
|
+
}
|
|
2131
|
+
interface ITimePeriod {
|
|
2132
|
+
start_time: string;
|
|
2133
|
+
end_time: string;
|
|
2134
|
+
}
|
|
2135
|
+
declare const formatShortTimeAgo: (val: any) => string;
|
|
2136
|
+
declare function timePeriod(type: string): ITimePeriod | null;
|
|
2137
|
+
declare function getRTop(y: number, fieldHeight: number, iTextHeight: number, yRatio: number): number;
|
|
2138
|
+
declare function getRLeft(x: number, ratio: number): number;
|
|
2139
|
+
declare function getRValue(y: number, ratio: number): number;
|
|
2140
|
+
declare function blobToBase64(image: Blob): Promise<unknown>;
|
|
2141
|
+
declare function rescale(r: number, n: number): number;
|
|
2142
|
+
/**
|
|
2143
|
+
* Given a File, extract the file's content as a base64 encoded data URL. The response will have a prefix that
|
|
2144
|
+
* includes the MIME type of the file, e.g. "data:image/jpeg;base64,iVBORw0K......"
|
|
2145
|
+
*/
|
|
2146
|
+
declare const fileToDataUrl: (file: File) => Promise<IFileWithData>;
|
|
2147
|
+
/**
|
|
2148
|
+
* Trigger a download dialog to save a blob as a file on disk.
|
|
2149
|
+
*/
|
|
2150
|
+
declare const downloadBlob: (blob: Blob, name?: string) => void;
|
|
2151
|
+
declare const Countries: ICountry[];
|
|
2152
|
+
declare function getCountryByCode(code: string): ICountry | null;
|
|
2153
|
+
declare function isFrenchGuiana(code: string): boolean;
|
|
2154
|
+
declare function isGuadeloupe(code: string): boolean;
|
|
2155
|
+
declare function isMartinique(code: string): boolean;
|
|
2156
|
+
declare function isMayotte(code: string): boolean;
|
|
1857
2157
|
declare function getPlusOneCountry(code: string): ICountry | null;
|
|
1858
2158
|
declare function isCanada(code: string): boolean;
|
|
1859
2159
|
declare function isAmericanSamoa(code: string): boolean;
|
|
@@ -2453,249 +2753,4 @@ declare const isValidEmail: (email: string | undefined) => boolean;
|
|
|
2453
2753
|
declare const isValidPhone: (phone: string | undefined) => boolean;
|
|
2454
2754
|
declare const isValidRoleName: (value: string, roles: IRole[]) => boolean;
|
|
2455
2755
|
declare const isValidTag: (value: string, tags: string[]) => boolean;
|
|
2456
|
-
|
|
2457
|
-
first_name?: string;
|
|
2458
|
-
last_name?: string;
|
|
2459
|
-
// email?: string;
|
|
2460
|
-
phone?: string;
|
|
2461
|
-
permissions?: TPermission[];
|
|
2462
|
-
roles?: TRole[];
|
|
2463
|
-
}
|
|
2464
|
-
interface IAuthenticateResponse {
|
|
2465
|
-
access_token: string;
|
|
2466
|
-
id_token: string;
|
|
2467
|
-
refresh_token: string;
|
|
2468
|
-
expires_in: number;
|
|
2469
|
-
access_token_exp: number;
|
|
2470
|
-
refresh_token_exp: number;
|
|
2471
|
-
}
|
|
2472
|
-
interface IUpdatePasswordRequest {
|
|
2473
|
-
email: string;
|
|
2474
|
-
oldPassword: string;
|
|
2475
|
-
newPassword: string;
|
|
2476
|
-
}
|
|
2477
|
-
interface IUpdatePasswordResponse {
|
|
2478
|
-
status: TRequestStatus;
|
|
2479
|
-
/** Success or failure message */
|
|
2480
|
-
message: string;
|
|
2481
|
-
}
|
|
2482
|
-
interface ICreateAccountRequest {
|
|
2483
|
-
email: string;
|
|
2484
|
-
password: string;
|
|
2485
|
-
firstName: string;
|
|
2486
|
-
lastName: string;
|
|
2487
|
-
orgName: string;
|
|
2488
|
-
}
|
|
2489
|
-
interface IROPCRequest {
|
|
2490
|
-
grant_type: "password";
|
|
2491
|
-
username: string;
|
|
2492
|
-
password: string;
|
|
2493
|
-
client_id?: string;
|
|
2494
|
-
scope?: string;
|
|
2495
|
-
}
|
|
2496
|
-
interface IClientCredentialsRequest {
|
|
2497
|
-
grant_type: "client_credentials";
|
|
2498
|
-
client_id: string;
|
|
2499
|
-
client_secret: string;
|
|
2500
|
-
scope?: string;
|
|
2501
|
-
}
|
|
2502
|
-
interface IRefreshTokenRequest {
|
|
2503
|
-
grant_type: "refresh_token";
|
|
2504
|
-
refresh_token: string;
|
|
2505
|
-
client_id?: string;
|
|
2506
|
-
scope?: string;
|
|
2507
|
-
}
|
|
2508
|
-
type TAuthenticationRequest = IROPCRequest | IClientCredentialsRequest | IRefreshTokenRequest;
|
|
2509
|
-
/**
|
|
2510
|
-
* Authenticate to Verdocs.
|
|
2511
|
-
*
|
|
2512
|
-
* ```typescript
|
|
2513
|
-
* import {authenticate, VerdocsEndpoint} from '@verdocs/js-sdk';
|
|
2514
|
-
*
|
|
2515
|
-
* // Client-side call, suitable for Web and mobile apps:
|
|
2516
|
-
* const {access_token} = await Auth.authenticate({ username: 'test@test.com', password: 'PASSWORD', grant_type:'password' });
|
|
2517
|
-
* VerdocsEndpoint.getDefault().setAuthToken(access_token);
|
|
2518
|
-
*
|
|
2519
|
-
* // Server-side call, suitable for server apps. NEVER EXPOSE client_secret IN FRONT-END CODE:
|
|
2520
|
-
* const {access_token} = await Auth.authenticate({ client_id: '...', client_secret: '...', grant_type:'client_credentials' });
|
|
2521
|
-
* VerdocsEndpoint.getDefault().setAuthToken(access_token);
|
|
2522
|
-
* ```
|
|
2523
|
-
*/
|
|
2524
|
-
declare const authenticate: (endpoint: VerdocsEndpoint, params: TAuthenticationRequest) => Promise<IAuthenticateResponse>;
|
|
2525
|
-
/**
|
|
2526
|
-
* If called before the session expires, this will refresh the caller's session and tokens.
|
|
2527
|
-
*
|
|
2528
|
-
* ```typescript
|
|
2529
|
-
* import {Auth, VerdocsEndpoint} from '@verdocs/js-sdk';
|
|
2530
|
-
*
|
|
2531
|
-
* const {accessToken} = await Auth.refreshTokens();
|
|
2532
|
-
* VerdocsEndpoint.setAuthToken(accessToken);
|
|
2533
|
-
* ```
|
|
2534
|
-
*/
|
|
2535
|
-
declare const refreshToken: (endpoint: VerdocsEndpoint, refreshToken: string) => Promise<IAuthenticateResponse>;
|
|
2536
|
-
/**
|
|
2537
|
-
* Update the caller's password when the old password is known (typically for logged-in users).
|
|
2538
|
-
*
|
|
2539
|
-
* ```typescript
|
|
2540
|
-
* import {changePassword} from '@verdocs/js-sdk';
|
|
2541
|
-
*
|
|
2542
|
-
* const {status, message} = await changePassword({ email, oldPassword, newPassword });
|
|
2543
|
-
* if (status !== 'OK') {
|
|
2544
|
-
* window.alert(`Password reset error: ${message}`);
|
|
2545
|
-
* }
|
|
2546
|
-
* ```
|
|
2547
|
-
*/
|
|
2548
|
-
declare const changePassword: (endpoint: VerdocsEndpoint, params: IUpdatePasswordRequest) => Promise<IUpdatePasswordResponse>;
|
|
2549
|
-
/**
|
|
2550
|
-
* Request a password reset, when the old password is not known (typically in login forms).
|
|
2551
|
-
*
|
|
2552
|
-
* ```typescript
|
|
2553
|
-
* import {resetPassword} from '@verdocs/js-sdk';
|
|
2554
|
-
*
|
|
2555
|
-
* const {success} = await resetPassword({ email });
|
|
2556
|
-
* if (status !== 'OK') {
|
|
2557
|
-
* window.alert(`Please check your email for instructions on how to reset your password.`);
|
|
2558
|
-
* }
|
|
2559
|
-
* ```
|
|
2560
|
-
*/
|
|
2561
|
-
declare const resetPassword: (endpoint: VerdocsEndpoint, params: {
|
|
2562
|
-
email: string;
|
|
2563
|
-
}) => Promise<{
|
|
2564
|
-
success: boolean;
|
|
2565
|
-
}>;
|
|
2566
|
-
/**
|
|
2567
|
-
* Resend the email verification request. Note that to prevent certain forms of abuse, the email address is not
|
|
2568
|
-
* a parameter here. Instead, the caller must be authenticated as the (unverified) user. To simplify this process,
|
|
2569
|
-
* the access token to be used may be passed directly as a parameter here. This avoids the need to set it as the
|
|
2570
|
-
* active token on an endpoint, which may be inconvenient in workflows where it is preferable to keep the user in
|
|
2571
|
-
* "anonymous" mode while verification is being performed.
|
|
2572
|
-
*
|
|
2573
|
-
* ```typescript
|
|
2574
|
-
* import {resendVerification} from '@verdocs/js-sdk';
|
|
2575
|
-
*
|
|
2576
|
-
* const result = await resendVerification();
|
|
2577
|
-
* ```
|
|
2578
|
-
*/
|
|
2579
|
-
declare const verifyEmail: (endpoint: VerdocsEndpoint, email: string, code: string) => Promise<IAuthenticateResponse>;
|
|
2580
|
-
/**
|
|
2581
|
-
* Resend the email verification request. Note that to prevent certain forms of abuse, the email address is not
|
|
2582
|
-
* a parameter here. Instead, the caller must be authenticated as the (unverified) user. To simplify this process,
|
|
2583
|
-
* the access token to be used may be passed directly as a parameter here. This avoids the need to set it as the
|
|
2584
|
-
* active token on an endpoint, which may be inconvenient in workflows where it is preferable to keep the user in
|
|
2585
|
-
* "anonymous" mode while verification is being performed.
|
|
2586
|
-
*
|
|
2587
|
-
* ```typescript
|
|
2588
|
-
* import {resendVerification} from '@verdocs/js-sdk';
|
|
2589
|
-
*
|
|
2590
|
-
* const result = await resendVerification();
|
|
2591
|
-
* ```
|
|
2592
|
-
*/
|
|
2593
|
-
declare const resendVerification: (endpoint: VerdocsEndpoint, accessToken?: string) => Promise<{
|
|
2594
|
-
result: "done";
|
|
2595
|
-
}>;
|
|
2596
|
-
declare const getNotifications: (endpoint: VerdocsEndpoint) => Promise<any>;
|
|
2597
|
-
/**
|
|
2598
|
-
* Get the user's available profiles. The current profile will be marked with `current: true`.
|
|
2599
|
-
*
|
|
2600
|
-
* ```typescript
|
|
2601
|
-
* import {getProfiles} from '@verdocs/js-sdk';
|
|
2602
|
-
*
|
|
2603
|
-
* const profiles = await getProfiles();
|
|
2604
|
-
* ```
|
|
2605
|
-
*/
|
|
2606
|
-
declare const getProfiles: (endpoint: VerdocsEndpoint) => Promise<IProfile[]>;
|
|
2607
|
-
/**
|
|
2608
|
-
* Get the user's available profiles. The current profile will be marked with `current: true`.
|
|
2609
|
-
*
|
|
2610
|
-
* ```typescript
|
|
2611
|
-
* import {getCurrentProfile} from '@verdocs/js-sdk';
|
|
2612
|
-
*
|
|
2613
|
-
* const profiles = await getCurrentProfile(VerdocsEndpoint.getDefault());
|
|
2614
|
-
* ```
|
|
2615
|
-
*/
|
|
2616
|
-
declare const getCurrentProfile: (endpoint: VerdocsEndpoint) => Promise<IProfile | undefined>;
|
|
2617
|
-
/**
|
|
2618
|
-
* Get a profile. The caller must have admin access to the given profile.
|
|
2619
|
-
*
|
|
2620
|
-
* ```typescript
|
|
2621
|
-
* import {getProfile} from '@verdocs/js-sdk';
|
|
2622
|
-
*
|
|
2623
|
-
* const profile = await getProfile(VerdocsEndpoint.getDefault(), 'PROFILEID');
|
|
2624
|
-
* ```
|
|
2625
|
-
*/
|
|
2626
|
-
declare const getProfile: (endpoint: VerdocsEndpoint, profileId: string) => Promise<IProfile>;
|
|
2627
|
-
/**
|
|
2628
|
-
* Switch the caller's "current" profile. The current profile is used for permissions checking
|
|
2629
|
-
* and profile_id field settings for most operations in Verdocs. It is important to select the
|
|
2630
|
-
* appropropriate profile before calling other API functions.
|
|
2631
|
-
*
|
|
2632
|
-
* ```typescript
|
|
2633
|
-
* import {switchProfile} from '@verdocs/js-sdk';
|
|
2634
|
-
*
|
|
2635
|
-
* const newProfile = await switchProfile(VerdocsEndpoint.getDefault(), 'PROFILEID');
|
|
2636
|
-
* ```
|
|
2637
|
-
*/
|
|
2638
|
-
declare const switchProfile: (endpoint: VerdocsEndpoint, profileId: string) => Promise<IAuthenticateResponse>;
|
|
2639
|
-
/**
|
|
2640
|
-
* Update a profile. For future expansion, the profile ID to update is required, but currently
|
|
2641
|
-
* this must also be the "current" profile for the caller.
|
|
2642
|
-
*
|
|
2643
|
-
* ```typescript
|
|
2644
|
-
* import {updateProfile} from '@verdocs/js-sdk/Users';
|
|
2645
|
-
*
|
|
2646
|
-
* const newProfile = await updateProfile(VerdocsEndpoint.getDefault(), 'PROFILEID');
|
|
2647
|
-
* ```
|
|
2648
|
-
*/
|
|
2649
|
-
declare const updateProfile: (endpoint: VerdocsEndpoint, profileId: string, params: IUpdateProfileRequest) => Promise<IProfile>;
|
|
2650
|
-
/**
|
|
2651
|
-
* Delete a profile. If the requested profile is the caller's curent profile, the next
|
|
2652
|
-
* available profile will be selected.
|
|
2653
|
-
*
|
|
2654
|
-
* ```typescript
|
|
2655
|
-
* import {deleteProfile} from '@verdocs/js-sdk';
|
|
2656
|
-
*
|
|
2657
|
-
* await deleteProfile(VerdocsEndpoint.getDefault(), 'PROFILEID');
|
|
2658
|
-
* ```
|
|
2659
|
-
*/
|
|
2660
|
-
declare const deleteProfile: (endpoint: VerdocsEndpoint, profileId: string) => Promise<IAuthenticateResponse | {
|
|
2661
|
-
status: "OK";
|
|
2662
|
-
message: "Your last profile has been deleted. You are now logged out.";
|
|
2663
|
-
}>;
|
|
2664
|
-
/**
|
|
2665
|
-
* Create a new user account. Note that there are two registration paths for creation:
|
|
2666
|
-
* - Get invited to an organization, by an admin or owner of that org.
|
|
2667
|
-
* - Created a new organization. The caller will become the first owner of the new org.
|
|
2668
|
-
*
|
|
2669
|
-
* This endpoint is for the second path, so an organization name is required. It is NOT
|
|
2670
|
-
* required to be unique because it is very common for businesses to have the same names,
|
|
2671
|
-
* without conflicting (e.g. "Delta" could be Delta Faucet or Delta Airlines).
|
|
2672
|
-
*
|
|
2673
|
-
* The new profile will automatically be set as the user's "current" profile, and new
|
|
2674
|
-
* session tokens will be returned to the caller. However, the caller's email may not yet
|
|
2675
|
-
* be verified. In that case, the caller will not yet be able to call other endpoints in
|
|
2676
|
-
* the Verdocs API. The caller will need to check their email for a verification code,
|
|
2677
|
-
* which should be submitted via the `verifyEmail` endpoint.
|
|
2678
|
-
*
|
|
2679
|
-
* ```typescript
|
|
2680
|
-
* import {createProfile} from '@verdocs/js-sdk';
|
|
2681
|
-
*
|
|
2682
|
-
* const newSession = await createProfile(VerdocsEndpoint.getDefault(), {
|
|
2683
|
-
* orgName: 'NEW ORG', email: 'a@b.com', password: '12345678', firstName: 'FIRST', lastName: 'LAST'
|
|
2684
|
-
* });
|
|
2685
|
-
* ```
|
|
2686
|
-
*/
|
|
2687
|
-
declare const createProfile: (endpoint: VerdocsEndpoint, params: ICreateAccountRequest) => Promise<{
|
|
2688
|
-
profile: IProfile;
|
|
2689
|
-
organization: IOrganization;
|
|
2690
|
-
}>;
|
|
2691
|
-
/**
|
|
2692
|
-
* Update the caller's profile photo. This can only be called for the user's "current" profile.
|
|
2693
|
-
*
|
|
2694
|
-
* ```typescript
|
|
2695
|
-
* import {uploadProfilePhoto} from '@verdocs/js-sdk';
|
|
2696
|
-
*
|
|
2697
|
-
* await uploadProfilePhoto((VerdocsEndpoint.getDefault(), profileId, file);
|
|
2698
|
-
* ```
|
|
2699
|
-
*/
|
|
2700
|
-
declare const updateProfilePhoto: (endpoint: VerdocsEndpoint, profileId: string, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<IProfile>;
|
|
2701
|
-
export { TRequestStatus, TTemplateSenderType, TTemplatePermission, TTemplateAction, TAccountPermission, TOrgPermission, TApiKeyPermission, TPermission, TRecipientAction, TEnvelopeStatus, TRecipientStatus, TRecipientType, TRole, TSortTemplateBy, TAccessKeyType, THistoryEvent, TEventDetail, TEnvelopeUpdateResult, TFieldType, IChannel, IDisabledChannel, INotification, IApiKey, IGroup, IGroupProfile, IOAuth2App, IOrganization, IOrganizationInvitation, IPendingWebhook, IProfile, IWebhookEvents, IWebhook, IInPersonAccessKey, IInAppAccessKey, IEmailAccessKey, ISMSAccessKey, TAccessKey, IEnvelope, IEnvelopeDocument, IEnvelopeField, IEnvelopeFieldOptions, IEnvelopeFieldSettings, IEnvelopeHistory, IInitial, IKbaPINRequired, IRecipient, IReminder, IRole, ISignature, ITemplate, ITemplateDocument, ITemplateField, ITextFieldSetting, ITemplateFieldSetting, IActivityEntry, TEnvironment, TSessionChangedListener, VerdocsEndpointOptions, VerdocsEndpoint, createEnvelope, getEnvelopesSummary, IEnvelopeSearchParams, searchEnvelopes, ISigningSessionResult, getSigningSession, getEnvelopeRecipients, getEnvelope, getEnvelopeDocument, getDocumentDownloadLink, getDocumentPreviewLink, cancelEnvelope, getEnvelopeFile, updateEnvelopeField, updateEnvelopeFieldSignature, updateEnvelopeFieldInitials, uploadEnvelopeFieldAttachment, deleteEnvelopeFieldAttachment, getFieldAttachment, getEnvelopeDocumentPageDisplayUri, throttledGetEnvelope, ITimeRange, IListEnvelopesParams, listEnvelopes, getEnvelopesByTemplateId, createInitials, IRecipientKbaStatusNotRequired, IRecipientKbaStatusComplete, IRecipientKbaStatusPinRequired, IRecipientKbaStatusIdentityRequired, IRecipientKbaChallengeRequired, IRecipientKbaStatusFailed, TRecipientKbaStatus, getKbaStatus, submitKbaPin, IKbaIdentity, submitKbaIdentity, submitKbaChallengeResponse, updateRecipient, envelopeRecipientSubmit, envelopeRecipientDecline, envelopeRecipientChangeOwner, envelopeRecipientAgree, envelopeRecipientUpdateName, envelopeRecipientPrepare, ISignerTokenResponse, getSignerToken, getInPersonLink, sendDelegate, resendInvitation, createEnvelopeReminder, getEnvelopeReminder, updateEnvelopeReminder, deleteEnvelopeReminder, userIsEnvelopeOwner, userIsEnvelopeRecipient, envelopeIsActive, envelopeIsComplete, userCanCancelEnvelope, userCanFinishEnvelope, recipientHasAction, getRecipientsWithActions, recipientCanAct, userCanAct, userCanSignNow, getNextRecipient, createSignature, getSignatures, getSignature, deleteSignature, IEnvelopesSearchResultEntry, IEnvelopesSearchResult, IEnvelopesSummary, IDocumentSearchOptions, ICreateEnvelopeRole, IEnvelopeSummary, IEnvelopeSummaries, IInPersonLinkResponse, IUpdateRecipientSubmitParams, IUpdateRecipientDeclineParams, IUpdateRecipientClaimEnvelope, IUpdateRecipientStatus, IUpdateRecipientAgreedParams, IUpdateRecipientNameParams, IUpdateRecipientPrepareParams, ICreateEnvelopeReminderRequest, ICreateEnvelopeRequest, TEnvelopePermission, getApiKeys, createApiKey, rotateApiKey, updateApiKey, deleteApiKey, getGroups, getGroup, createGroup, addGroupMember, deleteGroupMember, updateGroup, getOrganizationInvitations, createOrganizationInvitation, deleteOrganizationInvitation, updateOrganizationInvitation, resendOrganizationInvitation, getOrganizationInvitation, acceptOrganizationInvitation, declineOrganizationInvitation, getOrganizationMembers, deleteOrganizationMember, updateOrganizationMember, getOrganization, updateOrganization, updateOrganizationLogo, updateOrganizationThumbnail, ICreateApiKeyRequest, IUpdateApiKeyRequest, ICreateInvitationRequest, ISetWebhookRequest, getWebhooks, setWebhooks, userHasPermissions, ISigningSessionRequest, ISigningSession, IUserSession, TSessionType, TSession, TActiveSession, canPerformTemplateAction, hasRequiredPermissions, createField, updateField, deleteField, userIsTemplateCreator, userHasSharedTemplate, userCanCreatePersonalTemplate, userCanCreateOrgTemplate, userCanCreatePublicTemplate, userCanReadTemplate, userCanUpdateTemplate, userCanMakeTemplatePrivate, userCanMakeTemplateShared, userCanMakeTemplatePublic, userCanChangeOrgVisibility, userCanDeleteTemplate, userCanSendTemplate, userCanCreateTemplate, userCanBuildTemplate, getFieldsForRole, userCanPreviewTemplate, ICreateTemplateReminderRequest, createTemplateReminder, getTemplateReminder, updateTemplateReminder, deleteTemplateReminder, createTemplateRole, getTemplateRoles, getTemplateRole, updateTemplateRole, deleteTemplateRole, getTemplateRoleFields, getStars, toggleStar, addTemplateTag, getTemplateTags, deleteTemplateTag, createTag, getTag, getAllTags, IGetTemplatesParams, getTemplates, getTemplate, getTemplateOwnerInfo, IDocumentFromUri, IDocumentFromData, ITemplateCreateParams, createTemplate, createTemplatev2, ITemplateCreateFromSharepointParams, createTemplateFromSharepoint, updateTemplate, deleteTemplate, searchTemplates, ISearchTimeRange, IGetTemplateSummarySortBy, IGetTemplateSummaryParams, getTemplatesSummary, throttledGetTemplate, ITemplateListParams, listTemplates, getTemplateDocuments, getTemplateDocument, createTemplateDocument, deleteTemplateDocument, getTemplateDocumentFile, getTemplateDocumentThumbnail, getTemplateDocumentPageDisplayUri, ITemplateSummary, ITemplateSearchParams, ITemplateSummaries, ITemplateTag, ITag, IStar, ITemplateOwnerInfo, ITemplateSearchResult, IValidator, getValidators, getValidator, isValidEmail, isValidPhone, isValidRoleName, isValidTag, IROPCRequest, IClientCredentialsRequest, IRefreshTokenRequest, TAuthenticationRequest, authenticate, refreshToken, changePassword, resetPassword, verifyEmail, resendVerification, getNotifications, getProfiles, getCurrentProfile, getProfile, switchProfile, updateProfile, deleteProfile, createProfile, updateProfilePhoto, IUpdateProfileRequest, IAuthenticateResponse, IUpdatePasswordRequest, IUpdatePasswordResponse, ICreateAccountRequest, getRGB, getRGBA, nameToRGBA, getRoleColor, formatShortTimeAgo, timePeriod, getRTop, getRLeft, getRValue, blobToBase64, rescale, fileToDataUrl, downloadBlob, Countries, getCountryByCode, isFrenchGuiana, isGuadeloupe, isMartinique, isMayotte, getPlusOneCountry, isCanada, isAmericanSamoa, isDominicanRepublic, isPuertoRico, getMatchingCountry, integerSequence, formatFullName, formatInitials, fullNameToInitials, capitalize, convertToE164, AtoB, decodeJWTBody, decodeAccessTokenBody, IFileWithData, ICountry, ITimePeriod };
|
|
2756
|
+
export { TRequestStatus, TTemplateSenderType, TTemplatePermission, TTemplateAction, TAccountPermission, TOrgPermission, TApiKeyPermission, TPermission, TRecipientAction, TEnvelopeStatus, TRecipientStatus, TRecipientType, TRole, TSortTemplateBy, TAccessKeyType, THistoryEvent, TEventDetail, TEnvelopeUpdateResult, TFieldType, IChannel, IDisabledChannel, INotification, IApiKey, IGroup, IGroupProfile, IOAuth2App, IOrganization, IOrganizationInvitation, IPendingWebhook, IProfile, IWebhookEvents, IWebhook, IInPersonAccessKey, IInAppAccessKey, IEmailAccessKey, ISMSAccessKey, TAccessKey, IEnvelope, IEnvelopeDocument, IEnvelopeField, IEnvelopeFieldOptions, IEnvelopeFieldSettings, IEnvelopeHistory, IInitial, IKbaPINRequired, IRecipient, IReminder, IRole, ISignature, ITemplate, ITemplateDocument, ITemplateField, ITextFieldSetting, ITemplateFieldSetting, IActivityEntry, TEnvironment, TSessionChangedListener, VerdocsEndpointOptions, VerdocsEndpoint, createEnvelope, getEnvelopesSummary, IEnvelopeSearchParams, searchEnvelopes, ISigningSessionResult, getSigningSession, getEnvelopeRecipients, getEnvelope, getEnvelopeDocument, getDocumentDownloadLink, getDocumentPreviewLink, cancelEnvelope, getEnvelopeFile, updateEnvelopeField, updateEnvelopeFieldSignature, updateEnvelopeFieldInitials, uploadEnvelopeFieldAttachment, deleteEnvelopeFieldAttachment, getFieldAttachment, getEnvelopeDocumentPageDisplayUri, throttledGetEnvelope, ITimeRange, IListEnvelopesParams, listEnvelopes, getEnvelopesByTemplateId, createInitials, IRecipientKbaStatusNotRequired, IRecipientKbaStatusComplete, IRecipientKbaStatusPinRequired, IRecipientKbaStatusIdentityRequired, IRecipientKbaChallengeRequired, IRecipientKbaStatusFailed, TRecipientKbaStatus, getKbaStatus, submitKbaPin, IKbaIdentity, submitKbaIdentity, submitKbaChallengeResponse, updateRecipient, envelopeRecipientSubmit, envelopeRecipientDecline, envelopeRecipientChangeOwner, envelopeRecipientAgree, envelopeRecipientUpdateName, envelopeRecipientPrepare, ISignerTokenResponse, getSignerToken, getInPersonLink, sendDelegate, resendInvitation, createEnvelopeReminder, getEnvelopeReminder, updateEnvelopeReminder, deleteEnvelopeReminder, userIsEnvelopeOwner, userIsEnvelopeRecipient, envelopeIsActive, envelopeIsComplete, userCanCancelEnvelope, userCanFinishEnvelope, recipientHasAction, getRecipientsWithActions, recipientCanAct, userCanAct, userCanSignNow, getNextRecipient, createSignature, getSignatures, getSignature, deleteSignature, IEnvelopesSearchResultEntry, IEnvelopesSearchResult, IEnvelopesSummary, IDocumentSearchOptions, ICreateEnvelopeRole, IEnvelopeSummary, IEnvelopeSummaries, IInPersonLinkResponse, IUpdateRecipientSubmitParams, IUpdateRecipientDeclineParams, IUpdateRecipientClaimEnvelope, IUpdateRecipientStatus, IUpdateRecipientAgreedParams, IUpdateRecipientNameParams, IUpdateRecipientPrepareParams, ICreateEnvelopeReminderRequest, ICreateEnvelopeRequest, TEnvelopePermission, getApiKeys, createApiKey, rotateApiKey, updateApiKey, deleteApiKey, getGroups, getGroup, createGroup, addGroupMember, deleteGroupMember, updateGroup, getOrganizationInvitations, createOrganizationInvitation, deleteOrganizationInvitation, updateOrganizationInvitation, resendOrganizationInvitation, getOrganizationInvitation, acceptOrganizationInvitation, declineOrganizationInvitation, getOrganizationMembers, deleteOrganizationMember, updateOrganizationMember, getOrganization, updateOrganization, updateOrganizationLogo, updateOrganizationThumbnail, ICreateApiKeyRequest, IUpdateApiKeyRequest, ICreateInvitationRequest, IAcceptOrganizationInvitationRequest, ISetWebhookRequest, getWebhooks, setWebhooks, userHasPermissions, ISigningSessionRequest, ISigningSession, IUserSession, TSessionType, TSession, TActiveSession, canPerformTemplateAction, hasRequiredPermissions, createField, updateField, deleteField, userIsTemplateCreator, userHasSharedTemplate, userCanCreatePersonalTemplate, userCanCreateOrgTemplate, userCanCreatePublicTemplate, userCanReadTemplate, userCanUpdateTemplate, userCanMakeTemplatePrivate, userCanMakeTemplateShared, userCanMakeTemplatePublic, userCanChangeOrgVisibility, userCanDeleteTemplate, userCanSendTemplate, userCanCreateTemplate, userCanBuildTemplate, getFieldsForRole, userCanPreviewTemplate, ICreateTemplateReminderRequest, createTemplateReminder, getTemplateReminder, updateTemplateReminder, deleteTemplateReminder, createTemplateRole, getTemplateRoles, getTemplateRole, updateTemplateRole, deleteTemplateRole, getTemplateRoleFields, getStars, toggleStar, addTemplateTag, getTemplateTags, deleteTemplateTag, createTag, getTag, getAllTags, IGetTemplatesParams, getTemplates, getTemplate, getTemplateOwnerInfo, IDocumentFromUri, IDocumentFromData, ITemplateCreateParams, createTemplate, createTemplatev2, ITemplateCreateFromSharepointParams, createTemplateFromSharepoint, updateTemplate, deleteTemplate, searchTemplates, ISearchTimeRange, IGetTemplateSummarySortBy, IGetTemplateSummaryParams, getTemplatesSummary, throttledGetTemplate, ITemplateListParams, listTemplates, getTemplateDocuments, getTemplateDocument, createTemplateDocument, deleteTemplateDocument, getTemplateDocumentFile, getTemplateDocumentThumbnail, getTemplateDocumentPageDisplayUri, ITemplateSummary, ITemplateSearchParams, ITemplateSummaries, ITemplateTag, ITag, IStar, ITemplateOwnerInfo, ITemplateSearchResult, IValidator, getValidators, getValidator, isValidEmail, isValidPhone, isValidRoleName, isValidTag, IROPCRequest, IClientCredentialsRequest, IRefreshTokenRequest, TAuthenticationRequest, authenticate, refreshToken, changePassword, resetPassword, verifyEmail, resendVerification, getNotifications, getProfiles, getCurrentProfile, getProfile, switchProfile, updateProfile, deleteProfile, createProfile, updateProfilePhoto, IUpdateProfileRequest, IAuthenticateResponse, IUpdatePasswordRequest, IUpdatePasswordResponse, ICreateAccountRequest, getRGB, getRGBA, nameToRGBA, getRoleColor, formatShortTimeAgo, timePeriod, getRTop, getRLeft, getRValue, blobToBase64, rescale, fileToDataUrl, downloadBlob, Countries, getCountryByCode, isFrenchGuiana, isGuadeloupe, isMartinique, isMayotte, getPlusOneCountry, isCanada, isAmericanSamoa, isDominicanRepublic, isPuertoRico, getMatchingCountry, integerSequence, formatFullName, formatInitials, fullNameToInitials, capitalize, convertToE164, AtoB, decodeJWTBody, decodeAccessTokenBody, IFileWithData, ICountry, ITimePeriod };
|