@verdocs/js-sdk 3.9.5 → 3.9.7
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/Organizations/Organizations.d.ts +3 -1
- package/Users/Auth.d.ts +16 -0
- package/Users/Auth.js +18 -0
- package/package.json +1 -1
|
@@ -29,4 +29,6 @@ export declare const updateOrganization: (endpoint: VerdocsEndpoint, organizatio
|
|
|
29
29
|
* Check if an organization name is available. Typically used during the sign-up process. This endpoint is rate-limited
|
|
30
30
|
* to prevent abuse. Developers experiencing problems with testing new applications should contact support.
|
|
31
31
|
*/
|
|
32
|
-
export declare const isOrgAvailable: (endpoint: VerdocsEndpoint, name: string) => Promise<
|
|
32
|
+
export declare const isOrgAvailable: (endpoint: VerdocsEndpoint, name: string) => Promise<{
|
|
33
|
+
result: 'TAKEN' | 'AVAILABLE';
|
|
34
|
+
}>;
|
package/Users/Auth.d.ts
CHANGED
|
@@ -97,3 +97,19 @@ export declare const resetPassword: (endpoint: VerdocsEndpoint, params: {
|
|
|
97
97
|
* ```
|
|
98
98
|
*/
|
|
99
99
|
export declare const updateEmail: (endpoint: VerdocsEndpoint, params: UpdateEmailRequest) => Promise<UpdateEmailResponse>;
|
|
100
|
+
/**
|
|
101
|
+
* Resend the email verification request. Note that to prevent certain forms of abuse, the email address is not
|
|
102
|
+
* a parameter here. Instead, the caller must be authenticated as the (unverified) user. To simplify this process,
|
|
103
|
+
* the access token to be used may be passed directly as a parameter here. This avoids the need to set it as the
|
|
104
|
+
* active token on an endpoint, which may be inconvenient in workflows where it is preferable to keep the user in
|
|
105
|
+
* "anonymous" mode while verification is being performed.
|
|
106
|
+
*
|
|
107
|
+
* ```typescript
|
|
108
|
+
* import {Auth} from '@verdocs/js-sdk/Auth';
|
|
109
|
+
*
|
|
110
|
+
* const result = await Auth.resendVerification();
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
export declare const resendVerification: (endpoint: VerdocsEndpoint, accessToken?: string) => Promise<{
|
|
114
|
+
result: 'done';
|
|
115
|
+
}>;
|
package/Users/Auth.js
CHANGED
|
@@ -117,3 +117,21 @@ export var updateEmail = function (endpoint, params) {
|
|
|
117
117
|
.put('/user/update_email', params)
|
|
118
118
|
.then(function (r) { return r.data; });
|
|
119
119
|
};
|
|
120
|
+
/**
|
|
121
|
+
* Resend the email verification request. Note that to prevent certain forms of abuse, the email address is not
|
|
122
|
+
* a parameter here. Instead, the caller must be authenticated as the (unverified) user. To simplify this process,
|
|
123
|
+
* the access token to be used may be passed directly as a parameter here. This avoids the need to set it as the
|
|
124
|
+
* active token on an endpoint, which may be inconvenient in workflows where it is preferable to keep the user in
|
|
125
|
+
* "anonymous" mode while verification is being performed.
|
|
126
|
+
*
|
|
127
|
+
* ```typescript
|
|
128
|
+
* import {Auth} from '@verdocs/js-sdk/Auth';
|
|
129
|
+
*
|
|
130
|
+
* const result = await Auth.resendVerification();
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
export var resendVerification = function (endpoint, accessToken) {
|
|
134
|
+
return endpoint.api //
|
|
135
|
+
.post('/user/email_verification', {}, accessToken ? { headers: { Authorization: "Bearer ".concat(accessToken) } } : {})
|
|
136
|
+
.then(function (r) { return r.data; });
|
|
137
|
+
};
|