@verdocs/js-sdk 3.9.5 → 3.9.6

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/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
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdocs/js-sdk",
3
- "version": "3.9.5",
3
+ "version": "3.9.6",
4
4
  "private": false,
5
5
  "homepage": "https://github.com/Verdocs/js-sdk",
6
6
  "description": "Verdocs JS SDK",