@verdocs/js-sdk 4.2.86 → 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">;
@@ -1380,7 +1380,7 @@ declare const getFieldAttachment: (endpoint: VerdocsEndpoint, envelopeId: string
1380
1380
  * into PNG resources suitable for display in IMG tags although they may be used elsewhere. Note that these are intended
1381
1381
  * for DISPLAY ONLY, are not legally binding documents, and do not contain any encoded metadata from participants.
1382
1382
  */
1383
- declare const getEnvelopeDocumentPageDisplayUri: (endpoint: VerdocsEndpoint, envelopeId: string, documentId: string, page: number, type?: "original" | "filled" | "certificate") => Promise<string>;
1383
+ declare const getEnvelopeDocumentPageDisplayUri: (endpoint: VerdocsEndpoint, documentId: string, page: number, variant?: "original" | "filled" | "certificate") => Promise<string>;
1384
1384
  interface ITimeRange {
1385
1385
  start: string;
1386
1386
  end: string;
@@ -2505,9 +2505,9 @@ interface ITemplateCreateParams {
2505
2505
  /** Optional (defaults to EVERYONE_AS_CREATOR). Who may create and send envelopes using this template. */
2506
2506
  sender?: TTemplateSenderType;
2507
2507
  /** Delay (in seconds) before the first reminder is sent (min: 4hrs). Set to 0 or null to disable. */
2508
- initial_reminder: number;
2508
+ initial_reminder?: number;
2509
2509
  /** Delay (in seconds) before subsequent remidners are sent (min: 12hrs). Set to 0 or null to disable. */
2510
- followup_reminders: number;
2510
+ followup_reminders?: number;
2511
2511
  /** Optional description for the template to help identify it. */
2512
2512
  description?: string;
2513
2513
  /**
@@ -2638,7 +2638,7 @@ declare const getTemplateDocumentThumbnail: (endpoint: VerdocsEndpoint, template
2638
2638
  * for DISPLAY ONLY, are not legally binding documents, and do not contain any encoded metadata from participants. The
2639
2639
  * original asset may be obtained by calling `getTemplateDocumentFile()` or similar.
2640
2640
  */
2641
- declare const getTemplateDocumentPageDisplayUri: (endpoint: VerdocsEndpoint, templateId: string, documentId: string, page: number) => Promise<string>;
2641
+ declare const getTemplateDocumentPageDisplayUri: (endpoint: VerdocsEndpoint, documentId: string, page: number, variant?: "original" | "tagged") => Promise<string>;
2642
2642
  interface IValidator {
2643
2643
  name: string;
2644
2644
  regex: string;
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">;
@@ -1380,7 +1380,7 @@ declare const getFieldAttachment: (endpoint: VerdocsEndpoint, envelopeId: string
1380
1380
  * into PNG resources suitable for display in IMG tags although they may be used elsewhere. Note that these are intended
1381
1381
  * for DISPLAY ONLY, are not legally binding documents, and do not contain any encoded metadata from participants.
1382
1382
  */
1383
- declare const getEnvelopeDocumentPageDisplayUri: (endpoint: VerdocsEndpoint, envelopeId: string, documentId: string, page: number, type?: "original" | "filled" | "certificate") => Promise<string>;
1383
+ declare const getEnvelopeDocumentPageDisplayUri: (endpoint: VerdocsEndpoint, documentId: string, page: number, variant?: "original" | "filled" | "certificate") => Promise<string>;
1384
1384
  interface ITimeRange {
1385
1385
  start: string;
1386
1386
  end: string;
@@ -2505,9 +2505,9 @@ interface ITemplateCreateParams {
2505
2505
  /** Optional (defaults to EVERYONE_AS_CREATOR). Who may create and send envelopes using this template. */
2506
2506
  sender?: TTemplateSenderType;
2507
2507
  /** Delay (in seconds) before the first reminder is sent (min: 4hrs). Set to 0 or null to disable. */
2508
- initial_reminder: number;
2508
+ initial_reminder?: number;
2509
2509
  /** Delay (in seconds) before subsequent remidners are sent (min: 12hrs). Set to 0 or null to disable. */
2510
- followup_reminders: number;
2510
+ followup_reminders?: number;
2511
2511
  /** Optional description for the template to help identify it. */
2512
2512
  description?: string;
2513
2513
  /**
@@ -2638,7 +2638,7 @@ declare const getTemplateDocumentThumbnail: (endpoint: VerdocsEndpoint, template
2638
2638
  * for DISPLAY ONLY, are not legally binding documents, and do not contain any encoded metadata from participants. The
2639
2639
  * original asset may be obtained by calling `getTemplateDocumentFile()` or similar.
2640
2640
  */
2641
- declare const getTemplateDocumentPageDisplayUri: (endpoint: VerdocsEndpoint, templateId: string, documentId: string, page: number) => Promise<string>;
2641
+ declare const getTemplateDocumentPageDisplayUri: (endpoint: VerdocsEndpoint, documentId: string, page: number, variant?: "original" | "tagged") => Promise<string>;
2642
2642
  interface IValidator {
2643
2643
  name: string;
2644
2644
  regex: string;
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;
@@ -1580,9 +1579,7 @@ const getFieldAttachment = async (endpoint, envelopeId, fieldName) => endpoint.a
1580
1579
  * into PNG resources suitable for display in IMG tags although they may be used elsewhere. Note that these are intended
1581
1580
  * for DISPLAY ONLY, are not legally binding documents, and do not contain any encoded metadata from participants.
1582
1581
  */
1583
- const getEnvelopeDocumentPageDisplayUri = async (endpoint, envelopeId, documentId, page, type = 'original') => endpoint.api
1584
- .get(`/envelopes/${envelopeId}/envelope_documents/${documentId}/pages/${page}/image?type=${type}`, { timeout: 20000 })
1585
- .then((r) => r.data);
1582
+ const getEnvelopeDocumentPageDisplayUri = async (endpoint, documentId, page, variant = 'original') => endpoint.api.get(`/v2/envelope-documents/page-image/${documentId}/${variant}/${page}`, { timeout: 20000 }).then((r) => r.data);
1586
1583
  /**
1587
1584
  * Lists all envelopes accessible by the caller, with optional filters.
1588
1585
  *
@@ -2898,7 +2895,7 @@ const getTemplateDocumentThumbnail = async (endpoint, templateId, documentId) =>
2898
2895
  * for DISPLAY ONLY, are not legally binding documents, and do not contain any encoded metadata from participants. The
2899
2896
  * original asset may be obtained by calling `getTemplateDocumentFile()` or similar.
2900
2897
  */
2901
- const getTemplateDocumentPageDisplayUri = async (endpoint, templateId, documentId, page) => endpoint.api.get(`/templates/${templateId}/documents/${documentId}/pages/${page}/image`).then((r) => r.data);
2898
+ const getTemplateDocumentPageDisplayUri = async (endpoint, documentId, page, variant = 'original') => endpoint.api.get(`/v2/template-documents/page-image/${documentId}/${variant}/${page}`, { timeout: 20000 }).then((r) => r.data);
2902
2899
 
2903
2900
  /**
2904
2901
  * Get all defined validators