@verdocs/js-sdk 4.2.75 → 4.2.79

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 CHANGED
@@ -1907,10 +1907,19 @@ declare const changePassword: (endpoint: VerdocsEndpoint, params: IChangePasswor
1907
1907
  * if (status !== 'OK') {
1908
1908
  * window.alert(`Please check your email for instructions on how to reset your password.`);
1909
1909
  * }
1910
+ *
1911
+ * // Collect code and new password from the user, then call:
1912
+ *
1913
+ * const {success} = await resetPassword({ email, code, new_password });
1914
+ * if (status !== 'OK') {
1915
+ * window.alert(`Please check your verification code and try again.`);
1916
+ * }
1910
1917
  * ```
1911
1918
  */
1912
1919
  declare const resetPassword: (endpoint: VerdocsEndpoint, params: {
1913
1920
  email: string;
1921
+ code?: string;
1922
+ new_password?: string;
1914
1923
  }) => Promise<{
1915
1924
  success: boolean;
1916
1925
  }>;
package/dist/index.d.ts CHANGED
@@ -1907,10 +1907,19 @@ declare const changePassword: (endpoint: VerdocsEndpoint, params: IChangePasswor
1907
1907
  * if (status !== 'OK') {
1908
1908
  * window.alert(`Please check your email for instructions on how to reset your password.`);
1909
1909
  * }
1910
+ *
1911
+ * // Collect code and new password from the user, then call:
1912
+ *
1913
+ * const {success} = await resetPassword({ email, code, new_password });
1914
+ * if (status !== 'OK') {
1915
+ * window.alert(`Please check your verification code and try again.`);
1916
+ * }
1910
1917
  * ```
1911
1918
  */
1912
1919
  declare const resetPassword: (endpoint: VerdocsEndpoint, params: {
1913
1920
  email: string;
1921
+ code?: string;
1922
+ new_password?: string;
1914
1923
  }) => Promise<{
1915
1924
  success: boolean;
1916
1925
  }>;
package/dist/index.js CHANGED
@@ -866,6 +866,13 @@ const changePassword = (endpoint, params) => endpoint.api //
866
866
  * if (status !== 'OK') {
867
867
  * window.alert(`Please check your email for instructions on how to reset your password.`);
868
868
  * }
869
+ *
870
+ * // Collect code and new password from the user, then call:
871
+ *
872
+ * const {success} = await resetPassword({ email, code, new_password });
873
+ * if (status !== 'OK') {
874
+ * window.alert(`Please check your verification code and try again.`);
875
+ * }
869
876
  * ```
870
877
  */
871
878
  const resetPassword = (endpoint, params) => endpoint.api //
@@ -1111,9 +1118,7 @@ class VerdocsEndpoint {
1111
1118
  static getDefault() {
1112
1119
  if (!globalThis$1[ENDPOINT_KEY]) {
1113
1120
  globalThis$1[ENDPOINT_KEY] = new VerdocsEndpoint();
1114
- // window.console.debug('[JS_SDK] Created default endpoint', globalThis[ENDPOINT_KEY].baseURL);
1115
1121
  }
1116
- window?.console?.debug('[JS_SDK] Getting default endpoint', globalThis$1[ENDPOINT_KEY].endpointId);
1117
1122
  return globalThis$1[ENDPOINT_KEY];
1118
1123
  }
1119
1124
  /**
@@ -1370,6 +1375,9 @@ class VerdocsEndpoint {
1370
1375
  this.nextListenerId++;
1371
1376
  const listenerSymbol = Symbol.for('' + this.nextListenerId);
1372
1377
  this.sessionListeners.set(listenerSymbol, listener);
1378
+ // Perform an immediate notification in case this listener subscribed after the endpoint's session was
1379
+ // already loaded.
1380
+ listener(this, this.session, this.profile);
1373
1381
  return () => {
1374
1382
  this.sessionListeners.delete(listenerSymbol);
1375
1383
  };