@verdocs/js-sdk 4.2.87 → 4.2.88

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
@@ -901,7 +901,7 @@ type TRecipientType = "signer" | "cc" | "approver";
901
901
  type TSortTemplateBy = "created_at" | "updated_at" | "name" | "last_used_at" | "counter" | "star_counter";
902
902
  type TAccessKeyType = "email" | "in_app" | "in_person_link" | "sms";
903
903
  type TApiKeyPermission = "personal" | "global_read" | "global_write";
904
- type THistoryEvent = "recipient:signed" | "recipient:opened" | "recipient:submitted" | "recipient:prepared" | "recipient:claimed" | "recipient:agreed" | "recipient:invited" | "recipient:delegated" | "recipient:updated_info" | "recipient:declined" | "invitation:resent" | "envelope:cc" | "created" | "completed" | "canceled" | "owner:updated_recipient_info" | "owner:canceled" | "owner:get_in_person_link";
904
+ type THistoryEvent = "recipient:signed" | "recipient:opened" | "recipient:submitted" | "recipient:prepared" | "recipient:claimed" | "recipient:agreed" | "recipient:invited" | "recipient:reminder" | "recipient:delegated" | "recipient:updated_info" | "recipient:declined" | "invitation:resent" | "envelope:cc" | "created" | "completed" | "canceled" | "owner:updated_recipient_info" | "owner:canceled" | "owner:get_in_person_link";
905
905
  type TEventDetail = "in_app" | "mail" | "signer" | "sms" | "reminder" | "preparer" | "manual" | "in_person_link" | "guest" | "email" | "" | string; // Modification events have a string description
906
906
  // Modification events have a string description
907
907
  type TEnvelopeUpdateResult = Omit<IEnvelope, "histories" | "recipients" | "certificate" | "document" | "fields" | "profile">;
package/dist/index.d.ts CHANGED
@@ -901,7 +901,7 @@ type TRecipientType = "signer" | "cc" | "approver";
901
901
  type TSortTemplateBy = "created_at" | "updated_at" | "name" | "last_used_at" | "counter" | "star_counter";
902
902
  type TAccessKeyType = "email" | "in_app" | "in_person_link" | "sms";
903
903
  type TApiKeyPermission = "personal" | "global_read" | "global_write";
904
- type THistoryEvent = "recipient:signed" | "recipient:opened" | "recipient:submitted" | "recipient:prepared" | "recipient:claimed" | "recipient:agreed" | "recipient:invited" | "recipient:delegated" | "recipient:updated_info" | "recipient:declined" | "invitation:resent" | "envelope:cc" | "created" | "completed" | "canceled" | "owner:updated_recipient_info" | "owner:canceled" | "owner:get_in_person_link";
904
+ type THistoryEvent = "recipient:signed" | "recipient:opened" | "recipient:submitted" | "recipient:prepared" | "recipient:claimed" | "recipient:agreed" | "recipient:invited" | "recipient:reminder" | "recipient:delegated" | "recipient:updated_info" | "recipient:declined" | "invitation:resent" | "envelope:cc" | "created" | "completed" | "canceled" | "owner:updated_recipient_info" | "owner:canceled" | "owner:get_in_person_link";
905
905
  type TEventDetail = "in_app" | "mail" | "signer" | "sms" | "reminder" | "preparer" | "manual" | "in_person_link" | "guest" | "email" | "" | string; // Modification events have a string description
906
906
  // Modification events have a string description
907
907
  type TEnvelopeUpdateResult = Omit<IEnvelope, "histories" | "recipients" | "certificate" | "document" | "fields" | "profile">;
package/dist/index.js CHANGED
@@ -1069,6 +1069,7 @@ const updateProfilePhoto = (endpoint, profileId, file, onUploadProgress) => {
1069
1069
  // @credit https://derickbailey.com/2016/03/09/creating-a-true-singleton-in-node-js-with-es6-symbols/
1070
1070
  // Also see globalThis for comments about why we're doing this in the first place.
1071
1071
  const ENDPOINT_KEY = Symbol.for('verdocs-default-endpoint');
1072
+ const BETA_ORIGINS = ['https://beta.verdocs.com', 'https://stage.verdocs.com', 'http://localhost:6006', 'http://localhost:5173'];
1072
1073
  const requestLogger = (r) => {
1073
1074
  // tslint:disable-next-line
1074
1075
  console.debug(`[JS-SDK] ${r.method.toUpperCase()} ${r.baseURL}${r.url}`, r.data ? JSON.stringify(r.data) : '');
@@ -1099,9 +1100,7 @@ class VerdocsEndpoint {
1099
1100
  environment = 'verdocs';
1100
1101
  sessionType = 'user';
1101
1102
  persist = true;
1102
- baseURL = (window.location.origin === 'https://beta.verdocs.com' || window.location.origin === 'https://stage.verdocs.com'
1103
- ? 'https://stage-api.verdocs.com'
1104
- : 'https://api.verdocs.com');
1103
+ baseURL = BETA_ORIGINS.includes(window.location.origin) ? 'https://stage-api.verdocs.com' : 'https://api.verdocs.com';
1105
1104
  clientID = 'not-set';
1106
1105
  timeout = 60000;
1107
1106
  token = null;