@verdocs/js-sdk 6.0.1 → 6.0.3

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
@@ -1683,30 +1683,34 @@ declare const getEnvelope: (endpoint: VerdocsEndpoint, envelopeId: string) => Pr
1683
1683
  * this will return only the **metadata** the caller is allowed to view.
1684
1684
  *
1685
1685
  * @group Envelope Documents
1686
- * @api GET /envelopes/:id Get envelope document
1687
- * @apiParam string(format: 'uuid') id The ID of the document to retrieve.
1686
+ * @api GET /v2/envelope-documents/:id Get envelope document
1687
+ * @apiParam string(format: 'uuid') document_id The ID of the document to retrieve.
1688
1688
  * @apiSuccess IEnvelopeDocument . The detailed metadata for the document requested
1689
1689
  */
1690
- declare const getEnvelopeDocument: (endpoint: VerdocsEndpoint, envelopeId: string, documentId: string) => Promise<IEnvelopeDocument>;
1690
+ declare const getEnvelopeDocument: (endpoint: VerdocsEndpoint, _envelopeId: string, documentId: string) => Promise<IEnvelopeDocument>;
1691
+ /**
1692
+ * Download a document directly.
1693
+ */
1694
+ declare const downloadDocument: (endpoint: VerdocsEndpoint, _envelopeId: string, documentId: string) => Promise<string>;
1691
1695
  /**
1692
- * Get a pre-signed download link for an Envelope Document. This link expires quickly, so it should
1693
- * be accessed immediately and never shared. Content-Disposition will be set to "download".
1696
+ * Get an envelope document's metadata, or the document itself. If no "type" parameter is specified,
1697
+ * the document metadata is returned. If "type" is set to "file", the document binary content is
1698
+ * returned with Content-Type set to the MIME type of the file. If "type" is set to "download", a
1699
+ * string download link will be returned. If "type" is set to "preview" a string preview link will
1700
+ * be returned. This link expires quickly, so it should be accessed immediately and never shared.
1694
1701
  *
1695
1702
  * @group Envelope Documents
1696
- * @api GET /envelopes/:envelope_id/envelope_documents/:document_id Preview, Download, or Link to a Document
1697
- * @apiParam string(format: 'uuid') envelope_id The ID of the envelope to retrieve.
1703
+ * @api GET /v2/envelope-documents/:document_id Preview, Download, or Link to a Document
1698
1704
  * @apiParam string(format: 'uuid') document_id The ID of the document to retrieve.
1699
- * @apiQuery boolean download? Set to true to generate a download link (content-disposition: download).
1700
- * @apiQuery boolean preview? Set to true to generate a preview link (content-disposition: inline).
1701
- * @apiQuery boolean file? Set to true to return the raw binary BLOB data of the file rather than a link.
1705
+ * @apiQuery string(enum:'file'|'download'|'preview') type? Download the file directly, generate a download link, or generate a preview link.
1702
1706
  * @apiSuccess string . The generated link.
1703
1707
  */
1704
- declare const getDocumentDownloadLink: (endpoint: VerdocsEndpoint, envelopeId: string, documentId: string) => Promise<string>;
1708
+ declare const getDocumentDownloadLink: (endpoint: VerdocsEndpoint, _envelopeId: string, documentId: string) => Promise<string>;
1705
1709
  /**
1706
1710
  * Get a pre-signed preview link for an Envelope Document. This link expires quickly, so it should
1707
1711
  * be accessed immediately and never shared. Content-Disposition will be set to "inline".
1708
1712
  */
1709
- declare const getDocumentPreviewLink: (endpoint: VerdocsEndpoint, envelopeId: string, documentId: string) => Promise<string>;
1713
+ declare const getDocumentPreviewLink: (endpoint: VerdocsEndpoint, _envelopeId: string, documentId: string) => Promise<string>;
1710
1714
  /**
1711
1715
  * Cancel an Envelope.
1712
1716
  *
@@ -1866,8 +1870,12 @@ declare const getEnvelopes: (endpoint: VerdocsEndpoint, params?: IListEnvelopesP
1866
1870
  * create and store an initials block. Thereafter, the ID of the initials block may be re-used for each initials field
1867
1871
  * to be "stamped" by the user.
1868
1872
  *
1873
+ * Note: Both "guest" signers and authenticated users can create initials blocks. Guest signers
1874
+ * typically only ever have one, tied to that session. But authenticated users can create more than
1875
+ * one, and can use them interchangeably.
1876
+ *
1869
1877
  * @group Signatures and Initials
1870
- * @api POST /initials Create Initial Block
1878
+ * @api POST /v2/profiles/initials Create Initial Block
1871
1879
  * @apiBody string initial Blob containing initials image to store.
1872
1880
  * @apiSuccess IInitial . The newly-created initial block.
1873
1881
  */
@@ -2184,9 +2192,12 @@ declare const getNextRecipient: (envelope: IEnvelope) => IRecipient;
2184
2192
  * create and store a signature block. Thereafter, the ID of the signature block may be re-used for each signature field
2185
2193
  * to be "stamped" by the user.
2186
2194
  *
2187
- * @group Signatures and Initials
2188
- * @api POST /signatures Create Signature Block
2195
+ * Note: Both "guest" signers and authenticated users can create initials blocks. Guest signers
2196
+ * typically only ever have one, tied to that session. But authenticated users can create more than
2197
+ * one, and can use them interchangeably.
2189
2198
  *
2199
+ * @group Signatures and Initials
2200
+ * @api POST /v2/profiles/signatures Create Signature Block
2190
2201
  * @apiBody string signature Blob containing signature image to store.
2191
2202
  * @apiSuccess ISignature . The newly-created signature block.
2192
2203
  */
@@ -3826,4 +3837,4 @@ declare const decodeJWTBody: (token: string) => any;
3826
3837
  * the presence of the `document_id` field, which will only be present for signing sessions.
3827
3838
  */
3828
3839
  declare const decodeAccessTokenBody: (token: string) => TSession;
3829
- export { TRequestStatus, TTemplateSender, TTemplateAction, TRecipientAction, TEnvelopeStatus, TRecipientStatus, TRecipientType, TSortTemplateBy, TAccessKeyType, TApiKeyPermission, TDeprecatedHistoryEvent, THistoryEvent, TEventDetail, TEnvelopeUpdateResult, TFieldType, TWebhookEvent, TTemplateVisibility, TEntitlement, TRecipientAuthMethod, TRecipientAuthStep, TUsageType, FIELD_TYPES, DEFAULT_FIELD_WIDTHS, DEFAULT_FIELD_HEIGHTS, WEBHOOK_EVENTS, ALL_PERMISSIONS, IChannel, IDisabledChannel, INotification, IApiKey, IGroup, IGroupProfile, IOAuth2App, IEntitlement, IOrganization, IOrganizationInvitation, IPendingWebhook, IProfile, IUser, IWebhookEvents, IWebhook, IInPersonAccessKey, IInAppAccessKey, IEmailAccessKey, ISMSAccessKey, TAccessKey, IEnvelope, IEnvelopeDocument, IDropdownOption, IEnvelopeField, IEnvelopeFieldOptions, IEnvelopeFieldSettings, IEnvelopeHistory, IInitial, IKbaPINRequired, IKBAQuestion, IRecipient, IRole, ISignature, ITemplate, ITemplateDocument, ITemplateField, ITextFieldSetting, ITemplateFieldSetting, TOrganizationUsage, TEnvironment, TSessionChangedListener, VerdocsEndpointOptions, VerdocsEndpoint, createEnvelope, getEnvelope, getEnvelopeDocument, getDocumentDownloadLink, getDocumentPreviewLink, cancelEnvelope, getEnvelopeFile, updateEnvelope, updateEnvelopeField, updateEnvelopeFieldSignature, updateEnvelopeFieldInitials, uploadEnvelopeFieldAttachment, deleteEnvelopeFieldAttachment, getFieldAttachment, getEnvelopeDocumentPageDisplayUri, ITimeRange, IListEnvelopesParams, getEnvelopes, createInitials, IRecipientKbaStepNone, IRecipientKbaStepComplete, IRecipientKbaStepPin, IRecipientKbaStepIdentity, IRecipientKbaStepChallenge, IRecipientKbaStepFailed, TRecipientKbaStep, getKbaStep, submitKbaPin, IKbaIdentity, submitKbaIdentity, IKbaChallengeResponse, submitKbaChallengeResponse, updateRecipientStatus, envelopeRecipientSubmit, envelopeRecipientDecline, envelopeRecipientChangeOwner, envelopeRecipientAgree, envelopeRecipientUpdateName, envelopeRecipientPrepare, startSigningSession, getInPersonLink, verifySigner, resendInvitation, delegateRecipient, updateRecipient, userIsEnvelopeOwner, userIsEnvelopeRecipient, envelopeIsActive, envelopeIsComplete, userCanCancelEnvelope, userCanFinishEnvelope, recipientHasAction, getRecipientsWithActions, recipientCanAct, userCanAct, userCanSignNow, getNextRecipient, createSignature, getSignatures, getSignature, deleteSignature, IEnvelopesSearchResult, IDocumentSearchOptions, ICreateEnvelopeRecipientFromTemplate, ICreateEnvelopeRecipientDirectly, ISignerTokenResponse, IInPersonLinkResponse, IUpdateRecipientSubmitParams, IUpdateRecipientDeclineParams, IUpdateRecipientClaimEnvelope, IUpdateRecipientStatus, IUpdateRecipientAgreedParams, IUpdateRecipientNameParams, IUpdateRecipientPrepareParams, ICreateEnvelopeReminderRequest, IUpdateRecipientParams, ICreateEnvelopeDocumentFromData, ICreateEnvelopeDocumentFromUri, ICreateEnvelopeDocumentFromFile, ICreateEnvelopeFieldFromTemplate, ICreateEnvelopeFieldDirectly, ICreateEnvelopeFromTemplateRequest, ICreateEnvelopeDirectlyRequest, TCreateEnvelopeRequest, IAuthenticateRecipientViaPasscodeRequest, IAuthenticateRecipientViaEmailRequest, IAuthenticateRecipientViaSMSRequest, IKBAResponse, IAuthenticateRecipientViaKBARequest, TAuthenticateRecipientRequest, getApiKeys, createApiKey, rotateApiKey, updateApiKey, deleteApiKey, getOrganizationContacts, deleteOrganizationContact, createOrganizationContact, updateOrganizationContact, getGroups, getGroup, createGroup, updateGroup, deleteGroup, addGroupMember, deleteGroupMember, getOrganizationInvitations, createOrganizationInvitation, deleteOrganizationInvitation, updateOrganizationInvitation, resendOrganizationInvitation, getOrganizationInvitation, acceptOrganizationInvitation, declineOrganizationInvitation, getOrganizationMembers, deleteOrganizationMember, updateOrganizationMember, getOrganization, getOrganizationChildren, getOrganizationUsage, createOrganization, updateOrganization, deleteOrganization, updateOrganizationLogo, updateOrganizationThumbnail, getEntitlements, getActiveEntitlements, ICreateApiKeyRequest, IUpdateApiKeyRequest, ICreateInvitationRequest, IAcceptOrganizationInvitationRequest, ISetWebhookRequest, getWebhooks, setWebhooks, TTemplatePermissionCreatePublic, TTemplatePermissionCreateOrg, TTemplatePermissionCreatePersonal, TTemplatePermissionDelete, TTemplatePermissionVisibility, TTemplateMemberRead, TTemplateMemberWrite, TTemplateMemberDelete, TTemplateMemberVisibility, TTemplatePermission, TAccountPermissionOwnerAdd, TAccountPermissionOwnerRemove, TAccountPermissionAdminAdd, TAccountPermissionAdminRemove, TAccountPermissionMemberView, TAccountPermissionMemberAdd, TAccountPermissionMemberRemove, TAccountPermission, TOrgPermissionCreate, TOrgPermissionView, TOrgPermissionUpdate, TOrgPermissionDelete, TOrgPermissionTransfer, TOrgPermissionList, TOrgPermission, TEnvelopePermissionCreate, TEnvelopePermissionCancel, TEnvelopePermissionView, TEnvelopePermissionOrg, TEnvelopePermission, TPermission, TRole, RolePermissions, userHasPermissions, ISigningSession, IUserSession, IIdToken, TSessionType, TSession, TActiveSession, canPerformTemplateAction, hasRequiredPermissions, createField, updateField, deleteField, userIsTemplateCreator, userHasSharedTemplate, userCanCreatePersonalTemplate, userCanCreateOrgTemplate, userCanCreatePublicTemplate, userCanReadTemplate, userCanUpdateTemplate, userCanMakeTemplatePrivate, userCanMakeTemplateShared, userCanMakeTemplatePublic, userCanChangeOrgVisibility, userCanDeleteTemplate, userCanSendTemplate, userCanCreateTemplate, userCanBuildTemplate, getFieldsForRole, userCanPreviewTemplate, createTemplateRole, updateTemplateRole, deleteTemplateRole, getStars, toggleStar, addTemplateTag, getTemplateTags, deleteTemplateTag, createTag, getTag, getAllTags, ITemplateSortBy, TTemplateVisibilityFilter, IGetTemplatesParams, getTemplates, getTemplate, IDocumentFromUri, IDocumentFromData, ITemplateCreateParams, createTemplate, duplicateTemplate, ITemplateCreateFromSharepointParams, createTemplateFromSharepoint, updateTemplate, deleteTemplate, getTemplateDocuments, getTemplateDocument, createTemplateDocument, deleteTemplateDocument, getTemplateDocumentFile, getTemplateDocumentThumbnail, getTemplateDocumentPageDisplayUri, ITemplateTag, ITag, IStar, ITemplateSearchResult, IValidator, getValidators, getValidator, isValidEmail, isValidPhone, isValidRoleName, isValidTag, IROPCRequest, IClientCredentialsRequest, IRefreshTokenRequest, TAuthenticationRequest, authenticate, refreshToken, changePassword, resetPassword, resendVerification, verifyEmail, getMyUser, getNotifications, getProfiles, getCurrentProfile, switchProfile, updateProfile, deleteProfile, createProfile, updateProfilePhoto, ICreateProfileRequest, IUpdateProfileRequest, IAuthenticateResponse, IChangePasswordRequest, IChangePasswordResponse, IResetPasswordRequest, IResetPasswordResponse, IVerifyEmailRequest, getRGB, getRGBA, nameToRGBA, getRoleColor, formatShortTimeAgo, collapseEntitlements, getRTop, getRLeft, getRValue, blobToBase64, rescale, sortFields, fileToDataUrl, downloadBlob, Countries, getCountryByCode, isFrenchGuiana, isGuadeloupe, isMartinique, isMayotte, getPlusOneCountry, isCanada, isAmericanSamoa, isDominicanRepublic, isPuertoRico, getMatchingCountry, integerSequence, formatFullName, formatInitials, fullNameToInitials, capitalize, convertToE164, randomString, AtoB, decodeJWTBody, decodeAccessTokenBody, IFileWithData, ICountry };
3840
+ export { TRequestStatus, TTemplateSender, TTemplateAction, TRecipientAction, TEnvelopeStatus, TRecipientStatus, TRecipientType, TSortTemplateBy, TAccessKeyType, TApiKeyPermission, TDeprecatedHistoryEvent, THistoryEvent, TEventDetail, TEnvelopeUpdateResult, TFieldType, TWebhookEvent, TTemplateVisibility, TEntitlement, TRecipientAuthMethod, TRecipientAuthStep, TUsageType, FIELD_TYPES, DEFAULT_FIELD_WIDTHS, DEFAULT_FIELD_HEIGHTS, WEBHOOK_EVENTS, ALL_PERMISSIONS, IChannel, IDisabledChannel, INotification, IApiKey, IGroup, IGroupProfile, IOAuth2App, IEntitlement, IOrganization, IOrganizationInvitation, IPendingWebhook, IProfile, IUser, IWebhookEvents, IWebhook, IInPersonAccessKey, IInAppAccessKey, IEmailAccessKey, ISMSAccessKey, TAccessKey, IEnvelope, IEnvelopeDocument, IDropdownOption, IEnvelopeField, IEnvelopeFieldOptions, IEnvelopeFieldSettings, IEnvelopeHistory, IInitial, IKbaPINRequired, IKBAQuestion, IRecipient, IRole, ISignature, ITemplate, ITemplateDocument, ITemplateField, ITextFieldSetting, ITemplateFieldSetting, TOrganizationUsage, TEnvironment, TSessionChangedListener, VerdocsEndpointOptions, VerdocsEndpoint, createEnvelope, getEnvelope, getEnvelopeDocument, downloadDocument, getDocumentDownloadLink, getDocumentPreviewLink, cancelEnvelope, getEnvelopeFile, updateEnvelope, updateEnvelopeField, updateEnvelopeFieldSignature, updateEnvelopeFieldInitials, uploadEnvelopeFieldAttachment, deleteEnvelopeFieldAttachment, getFieldAttachment, getEnvelopeDocumentPageDisplayUri, ITimeRange, IListEnvelopesParams, getEnvelopes, createInitials, IRecipientKbaStepNone, IRecipientKbaStepComplete, IRecipientKbaStepPin, IRecipientKbaStepIdentity, IRecipientKbaStepChallenge, IRecipientKbaStepFailed, TRecipientKbaStep, getKbaStep, submitKbaPin, IKbaIdentity, submitKbaIdentity, IKbaChallengeResponse, submitKbaChallengeResponse, updateRecipientStatus, envelopeRecipientSubmit, envelopeRecipientDecline, envelopeRecipientChangeOwner, envelopeRecipientAgree, envelopeRecipientUpdateName, envelopeRecipientPrepare, startSigningSession, getInPersonLink, verifySigner, resendInvitation, delegateRecipient, updateRecipient, userIsEnvelopeOwner, userIsEnvelopeRecipient, envelopeIsActive, envelopeIsComplete, userCanCancelEnvelope, userCanFinishEnvelope, recipientHasAction, getRecipientsWithActions, recipientCanAct, userCanAct, userCanSignNow, getNextRecipient, createSignature, getSignatures, getSignature, deleteSignature, IEnvelopesSearchResult, IDocumentSearchOptions, ICreateEnvelopeRecipientFromTemplate, ICreateEnvelopeRecipientDirectly, ISignerTokenResponse, IInPersonLinkResponse, IUpdateRecipientSubmitParams, IUpdateRecipientDeclineParams, IUpdateRecipientClaimEnvelope, IUpdateRecipientStatus, IUpdateRecipientAgreedParams, IUpdateRecipientNameParams, IUpdateRecipientPrepareParams, ICreateEnvelopeReminderRequest, IUpdateRecipientParams, ICreateEnvelopeDocumentFromData, ICreateEnvelopeDocumentFromUri, ICreateEnvelopeDocumentFromFile, ICreateEnvelopeFieldFromTemplate, ICreateEnvelopeFieldDirectly, ICreateEnvelopeFromTemplateRequest, ICreateEnvelopeDirectlyRequest, TCreateEnvelopeRequest, IAuthenticateRecipientViaPasscodeRequest, IAuthenticateRecipientViaEmailRequest, IAuthenticateRecipientViaSMSRequest, IKBAResponse, IAuthenticateRecipientViaKBARequest, TAuthenticateRecipientRequest, getApiKeys, createApiKey, rotateApiKey, updateApiKey, deleteApiKey, getOrganizationContacts, deleteOrganizationContact, createOrganizationContact, updateOrganizationContact, getGroups, getGroup, createGroup, updateGroup, deleteGroup, addGroupMember, deleteGroupMember, getOrganizationInvitations, createOrganizationInvitation, deleteOrganizationInvitation, updateOrganizationInvitation, resendOrganizationInvitation, getOrganizationInvitation, acceptOrganizationInvitation, declineOrganizationInvitation, getOrganizationMembers, deleteOrganizationMember, updateOrganizationMember, getOrganization, getOrganizationChildren, getOrganizationUsage, createOrganization, updateOrganization, deleteOrganization, updateOrganizationLogo, updateOrganizationThumbnail, getEntitlements, getActiveEntitlements, ICreateApiKeyRequest, IUpdateApiKeyRequest, ICreateInvitationRequest, IAcceptOrganizationInvitationRequest, ISetWebhookRequest, getWebhooks, setWebhooks, TTemplatePermissionCreatePublic, TTemplatePermissionCreateOrg, TTemplatePermissionCreatePersonal, TTemplatePermissionDelete, TTemplatePermissionVisibility, TTemplateMemberRead, TTemplateMemberWrite, TTemplateMemberDelete, TTemplateMemberVisibility, TTemplatePermission, TAccountPermissionOwnerAdd, TAccountPermissionOwnerRemove, TAccountPermissionAdminAdd, TAccountPermissionAdminRemove, TAccountPermissionMemberView, TAccountPermissionMemberAdd, TAccountPermissionMemberRemove, TAccountPermission, TOrgPermissionCreate, TOrgPermissionView, TOrgPermissionUpdate, TOrgPermissionDelete, TOrgPermissionTransfer, TOrgPermissionList, TOrgPermission, TEnvelopePermissionCreate, TEnvelopePermissionCancel, TEnvelopePermissionView, TEnvelopePermissionOrg, TEnvelopePermission, TPermission, TRole, RolePermissions, userHasPermissions, ISigningSession, IUserSession, IIdToken, TSessionType, TSession, TActiveSession, canPerformTemplateAction, hasRequiredPermissions, createField, updateField, deleteField, userIsTemplateCreator, userHasSharedTemplate, userCanCreatePersonalTemplate, userCanCreateOrgTemplate, userCanCreatePublicTemplate, userCanReadTemplate, userCanUpdateTemplate, userCanMakeTemplatePrivate, userCanMakeTemplateShared, userCanMakeTemplatePublic, userCanChangeOrgVisibility, userCanDeleteTemplate, userCanSendTemplate, userCanCreateTemplate, userCanBuildTemplate, getFieldsForRole, userCanPreviewTemplate, createTemplateRole, updateTemplateRole, deleteTemplateRole, getStars, toggleStar, addTemplateTag, getTemplateTags, deleteTemplateTag, createTag, getTag, getAllTags, ITemplateSortBy, TTemplateVisibilityFilter, IGetTemplatesParams, getTemplates, getTemplate, IDocumentFromUri, IDocumentFromData, ITemplateCreateParams, createTemplate, duplicateTemplate, ITemplateCreateFromSharepointParams, createTemplateFromSharepoint, updateTemplate, deleteTemplate, getTemplateDocuments, getTemplateDocument, createTemplateDocument, deleteTemplateDocument, getTemplateDocumentFile, getTemplateDocumentThumbnail, getTemplateDocumentPageDisplayUri, ITemplateTag, ITag, IStar, ITemplateSearchResult, IValidator, getValidators, getValidator, isValidEmail, isValidPhone, isValidRoleName, isValidTag, IROPCRequest, IClientCredentialsRequest, IRefreshTokenRequest, TAuthenticationRequest, authenticate, refreshToken, changePassword, resetPassword, resendVerification, verifyEmail, getMyUser, getNotifications, getProfiles, getCurrentProfile, switchProfile, updateProfile, deleteProfile, createProfile, updateProfilePhoto, ICreateProfileRequest, IUpdateProfileRequest, IAuthenticateResponse, IChangePasswordRequest, IChangePasswordResponse, IResetPasswordRequest, IResetPasswordResponse, IVerifyEmailRequest, getRGB, getRGBA, nameToRGBA, getRoleColor, formatShortTimeAgo, collapseEntitlements, getRTop, getRLeft, getRValue, blobToBase64, rescale, sortFields, fileToDataUrl, downloadBlob, Countries, getCountryByCode, isFrenchGuiana, isGuadeloupe, isMartinique, isMayotte, getPlusOneCountry, isCanada, isAmericanSamoa, isDominicanRepublic, isPuertoRico, getMatchingCountry, integerSequence, formatFullName, formatInitials, fullNameToInitials, capitalize, convertToE164, randomString, AtoB, decodeJWTBody, decodeAccessTokenBody, IFileWithData, ICountry };
package/dist/index.d.ts CHANGED
@@ -1683,30 +1683,34 @@ declare const getEnvelope: (endpoint: VerdocsEndpoint, envelopeId: string) => Pr
1683
1683
  * this will return only the **metadata** the caller is allowed to view.
1684
1684
  *
1685
1685
  * @group Envelope Documents
1686
- * @api GET /envelopes/:id Get envelope document
1687
- * @apiParam string(format: 'uuid') id The ID of the document to retrieve.
1686
+ * @api GET /v2/envelope-documents/:id Get envelope document
1687
+ * @apiParam string(format: 'uuid') document_id The ID of the document to retrieve.
1688
1688
  * @apiSuccess IEnvelopeDocument . The detailed metadata for the document requested
1689
1689
  */
1690
- declare const getEnvelopeDocument: (endpoint: VerdocsEndpoint, envelopeId: string, documentId: string) => Promise<IEnvelopeDocument>;
1690
+ declare const getEnvelopeDocument: (endpoint: VerdocsEndpoint, _envelopeId: string, documentId: string) => Promise<IEnvelopeDocument>;
1691
+ /**
1692
+ * Download a document directly.
1693
+ */
1694
+ declare const downloadDocument: (endpoint: VerdocsEndpoint, _envelopeId: string, documentId: string) => Promise<string>;
1691
1695
  /**
1692
- * Get a pre-signed download link for an Envelope Document. This link expires quickly, so it should
1693
- * be accessed immediately and never shared. Content-Disposition will be set to "download".
1696
+ * Get an envelope document's metadata, or the document itself. If no "type" parameter is specified,
1697
+ * the document metadata is returned. If "type" is set to "file", the document binary content is
1698
+ * returned with Content-Type set to the MIME type of the file. If "type" is set to "download", a
1699
+ * string download link will be returned. If "type" is set to "preview" a string preview link will
1700
+ * be returned. This link expires quickly, so it should be accessed immediately and never shared.
1694
1701
  *
1695
1702
  * @group Envelope Documents
1696
- * @api GET /envelopes/:envelope_id/envelope_documents/:document_id Preview, Download, or Link to a Document
1697
- * @apiParam string(format: 'uuid') envelope_id The ID of the envelope to retrieve.
1703
+ * @api GET /v2/envelope-documents/:document_id Preview, Download, or Link to a Document
1698
1704
  * @apiParam string(format: 'uuid') document_id The ID of the document to retrieve.
1699
- * @apiQuery boolean download? Set to true to generate a download link (content-disposition: download).
1700
- * @apiQuery boolean preview? Set to true to generate a preview link (content-disposition: inline).
1701
- * @apiQuery boolean file? Set to true to return the raw binary BLOB data of the file rather than a link.
1705
+ * @apiQuery string(enum:'file'|'download'|'preview') type? Download the file directly, generate a download link, or generate a preview link.
1702
1706
  * @apiSuccess string . The generated link.
1703
1707
  */
1704
- declare const getDocumentDownloadLink: (endpoint: VerdocsEndpoint, envelopeId: string, documentId: string) => Promise<string>;
1708
+ declare const getDocumentDownloadLink: (endpoint: VerdocsEndpoint, _envelopeId: string, documentId: string) => Promise<string>;
1705
1709
  /**
1706
1710
  * Get a pre-signed preview link for an Envelope Document. This link expires quickly, so it should
1707
1711
  * be accessed immediately and never shared. Content-Disposition will be set to "inline".
1708
1712
  */
1709
- declare const getDocumentPreviewLink: (endpoint: VerdocsEndpoint, envelopeId: string, documentId: string) => Promise<string>;
1713
+ declare const getDocumentPreviewLink: (endpoint: VerdocsEndpoint, _envelopeId: string, documentId: string) => Promise<string>;
1710
1714
  /**
1711
1715
  * Cancel an Envelope.
1712
1716
  *
@@ -1866,8 +1870,12 @@ declare const getEnvelopes: (endpoint: VerdocsEndpoint, params?: IListEnvelopesP
1866
1870
  * create and store an initials block. Thereafter, the ID of the initials block may be re-used for each initials field
1867
1871
  * to be "stamped" by the user.
1868
1872
  *
1873
+ * Note: Both "guest" signers and authenticated users can create initials blocks. Guest signers
1874
+ * typically only ever have one, tied to that session. But authenticated users can create more than
1875
+ * one, and can use them interchangeably.
1876
+ *
1869
1877
  * @group Signatures and Initials
1870
- * @api POST /initials Create Initial Block
1878
+ * @api POST /v2/profiles/initials Create Initial Block
1871
1879
  * @apiBody string initial Blob containing initials image to store.
1872
1880
  * @apiSuccess IInitial . The newly-created initial block.
1873
1881
  */
@@ -2184,9 +2192,12 @@ declare const getNextRecipient: (envelope: IEnvelope) => IRecipient;
2184
2192
  * create and store a signature block. Thereafter, the ID of the signature block may be re-used for each signature field
2185
2193
  * to be "stamped" by the user.
2186
2194
  *
2187
- * @group Signatures and Initials
2188
- * @api POST /signatures Create Signature Block
2195
+ * Note: Both "guest" signers and authenticated users can create initials blocks. Guest signers
2196
+ * typically only ever have one, tied to that session. But authenticated users can create more than
2197
+ * one, and can use them interchangeably.
2189
2198
  *
2199
+ * @group Signatures and Initials
2200
+ * @api POST /v2/profiles/signatures Create Signature Block
2190
2201
  * @apiBody string signature Blob containing signature image to store.
2191
2202
  * @apiSuccess ISignature . The newly-created signature block.
2192
2203
  */
@@ -3826,4 +3837,4 @@ declare const decodeJWTBody: (token: string) => any;
3826
3837
  * the presence of the `document_id` field, which will only be present for signing sessions.
3827
3838
  */
3828
3839
  declare const decodeAccessTokenBody: (token: string) => TSession;
3829
- export { TRequestStatus, TTemplateSender, TTemplateAction, TRecipientAction, TEnvelopeStatus, TRecipientStatus, TRecipientType, TSortTemplateBy, TAccessKeyType, TApiKeyPermission, TDeprecatedHistoryEvent, THistoryEvent, TEventDetail, TEnvelopeUpdateResult, TFieldType, TWebhookEvent, TTemplateVisibility, TEntitlement, TRecipientAuthMethod, TRecipientAuthStep, TUsageType, FIELD_TYPES, DEFAULT_FIELD_WIDTHS, DEFAULT_FIELD_HEIGHTS, WEBHOOK_EVENTS, ALL_PERMISSIONS, IChannel, IDisabledChannel, INotification, IApiKey, IGroup, IGroupProfile, IOAuth2App, IEntitlement, IOrganization, IOrganizationInvitation, IPendingWebhook, IProfile, IUser, IWebhookEvents, IWebhook, IInPersonAccessKey, IInAppAccessKey, IEmailAccessKey, ISMSAccessKey, TAccessKey, IEnvelope, IEnvelopeDocument, IDropdownOption, IEnvelopeField, IEnvelopeFieldOptions, IEnvelopeFieldSettings, IEnvelopeHistory, IInitial, IKbaPINRequired, IKBAQuestion, IRecipient, IRole, ISignature, ITemplate, ITemplateDocument, ITemplateField, ITextFieldSetting, ITemplateFieldSetting, TOrganizationUsage, TEnvironment, TSessionChangedListener, VerdocsEndpointOptions, VerdocsEndpoint, createEnvelope, getEnvelope, getEnvelopeDocument, getDocumentDownloadLink, getDocumentPreviewLink, cancelEnvelope, getEnvelopeFile, updateEnvelope, updateEnvelopeField, updateEnvelopeFieldSignature, updateEnvelopeFieldInitials, uploadEnvelopeFieldAttachment, deleteEnvelopeFieldAttachment, getFieldAttachment, getEnvelopeDocumentPageDisplayUri, ITimeRange, IListEnvelopesParams, getEnvelopes, createInitials, IRecipientKbaStepNone, IRecipientKbaStepComplete, IRecipientKbaStepPin, IRecipientKbaStepIdentity, IRecipientKbaStepChallenge, IRecipientKbaStepFailed, TRecipientKbaStep, getKbaStep, submitKbaPin, IKbaIdentity, submitKbaIdentity, IKbaChallengeResponse, submitKbaChallengeResponse, updateRecipientStatus, envelopeRecipientSubmit, envelopeRecipientDecline, envelopeRecipientChangeOwner, envelopeRecipientAgree, envelopeRecipientUpdateName, envelopeRecipientPrepare, startSigningSession, getInPersonLink, verifySigner, resendInvitation, delegateRecipient, updateRecipient, userIsEnvelopeOwner, userIsEnvelopeRecipient, envelopeIsActive, envelopeIsComplete, userCanCancelEnvelope, userCanFinishEnvelope, recipientHasAction, getRecipientsWithActions, recipientCanAct, userCanAct, userCanSignNow, getNextRecipient, createSignature, getSignatures, getSignature, deleteSignature, IEnvelopesSearchResult, IDocumentSearchOptions, ICreateEnvelopeRecipientFromTemplate, ICreateEnvelopeRecipientDirectly, ISignerTokenResponse, IInPersonLinkResponse, IUpdateRecipientSubmitParams, IUpdateRecipientDeclineParams, IUpdateRecipientClaimEnvelope, IUpdateRecipientStatus, IUpdateRecipientAgreedParams, IUpdateRecipientNameParams, IUpdateRecipientPrepareParams, ICreateEnvelopeReminderRequest, IUpdateRecipientParams, ICreateEnvelopeDocumentFromData, ICreateEnvelopeDocumentFromUri, ICreateEnvelopeDocumentFromFile, ICreateEnvelopeFieldFromTemplate, ICreateEnvelopeFieldDirectly, ICreateEnvelopeFromTemplateRequest, ICreateEnvelopeDirectlyRequest, TCreateEnvelopeRequest, IAuthenticateRecipientViaPasscodeRequest, IAuthenticateRecipientViaEmailRequest, IAuthenticateRecipientViaSMSRequest, IKBAResponse, IAuthenticateRecipientViaKBARequest, TAuthenticateRecipientRequest, getApiKeys, createApiKey, rotateApiKey, updateApiKey, deleteApiKey, getOrganizationContacts, deleteOrganizationContact, createOrganizationContact, updateOrganizationContact, getGroups, getGroup, createGroup, updateGroup, deleteGroup, addGroupMember, deleteGroupMember, getOrganizationInvitations, createOrganizationInvitation, deleteOrganizationInvitation, updateOrganizationInvitation, resendOrganizationInvitation, getOrganizationInvitation, acceptOrganizationInvitation, declineOrganizationInvitation, getOrganizationMembers, deleteOrganizationMember, updateOrganizationMember, getOrganization, getOrganizationChildren, getOrganizationUsage, createOrganization, updateOrganization, deleteOrganization, updateOrganizationLogo, updateOrganizationThumbnail, getEntitlements, getActiveEntitlements, ICreateApiKeyRequest, IUpdateApiKeyRequest, ICreateInvitationRequest, IAcceptOrganizationInvitationRequest, ISetWebhookRequest, getWebhooks, setWebhooks, TTemplatePermissionCreatePublic, TTemplatePermissionCreateOrg, TTemplatePermissionCreatePersonal, TTemplatePermissionDelete, TTemplatePermissionVisibility, TTemplateMemberRead, TTemplateMemberWrite, TTemplateMemberDelete, TTemplateMemberVisibility, TTemplatePermission, TAccountPermissionOwnerAdd, TAccountPermissionOwnerRemove, TAccountPermissionAdminAdd, TAccountPermissionAdminRemove, TAccountPermissionMemberView, TAccountPermissionMemberAdd, TAccountPermissionMemberRemove, TAccountPermission, TOrgPermissionCreate, TOrgPermissionView, TOrgPermissionUpdate, TOrgPermissionDelete, TOrgPermissionTransfer, TOrgPermissionList, TOrgPermission, TEnvelopePermissionCreate, TEnvelopePermissionCancel, TEnvelopePermissionView, TEnvelopePermissionOrg, TEnvelopePermission, TPermission, TRole, RolePermissions, userHasPermissions, ISigningSession, IUserSession, IIdToken, TSessionType, TSession, TActiveSession, canPerformTemplateAction, hasRequiredPermissions, createField, updateField, deleteField, userIsTemplateCreator, userHasSharedTemplate, userCanCreatePersonalTemplate, userCanCreateOrgTemplate, userCanCreatePublicTemplate, userCanReadTemplate, userCanUpdateTemplate, userCanMakeTemplatePrivate, userCanMakeTemplateShared, userCanMakeTemplatePublic, userCanChangeOrgVisibility, userCanDeleteTemplate, userCanSendTemplate, userCanCreateTemplate, userCanBuildTemplate, getFieldsForRole, userCanPreviewTemplate, createTemplateRole, updateTemplateRole, deleteTemplateRole, getStars, toggleStar, addTemplateTag, getTemplateTags, deleteTemplateTag, createTag, getTag, getAllTags, ITemplateSortBy, TTemplateVisibilityFilter, IGetTemplatesParams, getTemplates, getTemplate, IDocumentFromUri, IDocumentFromData, ITemplateCreateParams, createTemplate, duplicateTemplate, ITemplateCreateFromSharepointParams, createTemplateFromSharepoint, updateTemplate, deleteTemplate, getTemplateDocuments, getTemplateDocument, createTemplateDocument, deleteTemplateDocument, getTemplateDocumentFile, getTemplateDocumentThumbnail, getTemplateDocumentPageDisplayUri, ITemplateTag, ITag, IStar, ITemplateSearchResult, IValidator, getValidators, getValidator, isValidEmail, isValidPhone, isValidRoleName, isValidTag, IROPCRequest, IClientCredentialsRequest, IRefreshTokenRequest, TAuthenticationRequest, authenticate, refreshToken, changePassword, resetPassword, resendVerification, verifyEmail, getMyUser, getNotifications, getProfiles, getCurrentProfile, switchProfile, updateProfile, deleteProfile, createProfile, updateProfilePhoto, ICreateProfileRequest, IUpdateProfileRequest, IAuthenticateResponse, IChangePasswordRequest, IChangePasswordResponse, IResetPasswordRequest, IResetPasswordResponse, IVerifyEmailRequest, getRGB, getRGBA, nameToRGBA, getRoleColor, formatShortTimeAgo, collapseEntitlements, getRTop, getRLeft, getRValue, blobToBase64, rescale, sortFields, fileToDataUrl, downloadBlob, Countries, getCountryByCode, isFrenchGuiana, isGuadeloupe, isMartinique, isMayotte, getPlusOneCountry, isCanada, isAmericanSamoa, isDominicanRepublic, isPuertoRico, getMatchingCountry, integerSequence, formatFullName, formatInitials, fullNameToInitials, capitalize, convertToE164, randomString, AtoB, decodeJWTBody, decodeAccessTokenBody, IFileWithData, ICountry };
3840
+ export { TRequestStatus, TTemplateSender, TTemplateAction, TRecipientAction, TEnvelopeStatus, TRecipientStatus, TRecipientType, TSortTemplateBy, TAccessKeyType, TApiKeyPermission, TDeprecatedHistoryEvent, THistoryEvent, TEventDetail, TEnvelopeUpdateResult, TFieldType, TWebhookEvent, TTemplateVisibility, TEntitlement, TRecipientAuthMethod, TRecipientAuthStep, TUsageType, FIELD_TYPES, DEFAULT_FIELD_WIDTHS, DEFAULT_FIELD_HEIGHTS, WEBHOOK_EVENTS, ALL_PERMISSIONS, IChannel, IDisabledChannel, INotification, IApiKey, IGroup, IGroupProfile, IOAuth2App, IEntitlement, IOrganization, IOrganizationInvitation, IPendingWebhook, IProfile, IUser, IWebhookEvents, IWebhook, IInPersonAccessKey, IInAppAccessKey, IEmailAccessKey, ISMSAccessKey, TAccessKey, IEnvelope, IEnvelopeDocument, IDropdownOption, IEnvelopeField, IEnvelopeFieldOptions, IEnvelopeFieldSettings, IEnvelopeHistory, IInitial, IKbaPINRequired, IKBAQuestion, IRecipient, IRole, ISignature, ITemplate, ITemplateDocument, ITemplateField, ITextFieldSetting, ITemplateFieldSetting, TOrganizationUsage, TEnvironment, TSessionChangedListener, VerdocsEndpointOptions, VerdocsEndpoint, createEnvelope, getEnvelope, getEnvelopeDocument, downloadDocument, getDocumentDownloadLink, getDocumentPreviewLink, cancelEnvelope, getEnvelopeFile, updateEnvelope, updateEnvelopeField, updateEnvelopeFieldSignature, updateEnvelopeFieldInitials, uploadEnvelopeFieldAttachment, deleteEnvelopeFieldAttachment, getFieldAttachment, getEnvelopeDocumentPageDisplayUri, ITimeRange, IListEnvelopesParams, getEnvelopes, createInitials, IRecipientKbaStepNone, IRecipientKbaStepComplete, IRecipientKbaStepPin, IRecipientKbaStepIdentity, IRecipientKbaStepChallenge, IRecipientKbaStepFailed, TRecipientKbaStep, getKbaStep, submitKbaPin, IKbaIdentity, submitKbaIdentity, IKbaChallengeResponse, submitKbaChallengeResponse, updateRecipientStatus, envelopeRecipientSubmit, envelopeRecipientDecline, envelopeRecipientChangeOwner, envelopeRecipientAgree, envelopeRecipientUpdateName, envelopeRecipientPrepare, startSigningSession, getInPersonLink, verifySigner, resendInvitation, delegateRecipient, updateRecipient, userIsEnvelopeOwner, userIsEnvelopeRecipient, envelopeIsActive, envelopeIsComplete, userCanCancelEnvelope, userCanFinishEnvelope, recipientHasAction, getRecipientsWithActions, recipientCanAct, userCanAct, userCanSignNow, getNextRecipient, createSignature, getSignatures, getSignature, deleteSignature, IEnvelopesSearchResult, IDocumentSearchOptions, ICreateEnvelopeRecipientFromTemplate, ICreateEnvelopeRecipientDirectly, ISignerTokenResponse, IInPersonLinkResponse, IUpdateRecipientSubmitParams, IUpdateRecipientDeclineParams, IUpdateRecipientClaimEnvelope, IUpdateRecipientStatus, IUpdateRecipientAgreedParams, IUpdateRecipientNameParams, IUpdateRecipientPrepareParams, ICreateEnvelopeReminderRequest, IUpdateRecipientParams, ICreateEnvelopeDocumentFromData, ICreateEnvelopeDocumentFromUri, ICreateEnvelopeDocumentFromFile, ICreateEnvelopeFieldFromTemplate, ICreateEnvelopeFieldDirectly, ICreateEnvelopeFromTemplateRequest, ICreateEnvelopeDirectlyRequest, TCreateEnvelopeRequest, IAuthenticateRecipientViaPasscodeRequest, IAuthenticateRecipientViaEmailRequest, IAuthenticateRecipientViaSMSRequest, IKBAResponse, IAuthenticateRecipientViaKBARequest, TAuthenticateRecipientRequest, getApiKeys, createApiKey, rotateApiKey, updateApiKey, deleteApiKey, getOrganizationContacts, deleteOrganizationContact, createOrganizationContact, updateOrganizationContact, getGroups, getGroup, createGroup, updateGroup, deleteGroup, addGroupMember, deleteGroupMember, getOrganizationInvitations, createOrganizationInvitation, deleteOrganizationInvitation, updateOrganizationInvitation, resendOrganizationInvitation, getOrganizationInvitation, acceptOrganizationInvitation, declineOrganizationInvitation, getOrganizationMembers, deleteOrganizationMember, updateOrganizationMember, getOrganization, getOrganizationChildren, getOrganizationUsage, createOrganization, updateOrganization, deleteOrganization, updateOrganizationLogo, updateOrganizationThumbnail, getEntitlements, getActiveEntitlements, ICreateApiKeyRequest, IUpdateApiKeyRequest, ICreateInvitationRequest, IAcceptOrganizationInvitationRequest, ISetWebhookRequest, getWebhooks, setWebhooks, TTemplatePermissionCreatePublic, TTemplatePermissionCreateOrg, TTemplatePermissionCreatePersonal, TTemplatePermissionDelete, TTemplatePermissionVisibility, TTemplateMemberRead, TTemplateMemberWrite, TTemplateMemberDelete, TTemplateMemberVisibility, TTemplatePermission, TAccountPermissionOwnerAdd, TAccountPermissionOwnerRemove, TAccountPermissionAdminAdd, TAccountPermissionAdminRemove, TAccountPermissionMemberView, TAccountPermissionMemberAdd, TAccountPermissionMemberRemove, TAccountPermission, TOrgPermissionCreate, TOrgPermissionView, TOrgPermissionUpdate, TOrgPermissionDelete, TOrgPermissionTransfer, TOrgPermissionList, TOrgPermission, TEnvelopePermissionCreate, TEnvelopePermissionCancel, TEnvelopePermissionView, TEnvelopePermissionOrg, TEnvelopePermission, TPermission, TRole, RolePermissions, userHasPermissions, ISigningSession, IUserSession, IIdToken, TSessionType, TSession, TActiveSession, canPerformTemplateAction, hasRequiredPermissions, createField, updateField, deleteField, userIsTemplateCreator, userHasSharedTemplate, userCanCreatePersonalTemplate, userCanCreateOrgTemplate, userCanCreatePublicTemplate, userCanReadTemplate, userCanUpdateTemplate, userCanMakeTemplatePrivate, userCanMakeTemplateShared, userCanMakeTemplatePublic, userCanChangeOrgVisibility, userCanDeleteTemplate, userCanSendTemplate, userCanCreateTemplate, userCanBuildTemplate, getFieldsForRole, userCanPreviewTemplate, createTemplateRole, updateTemplateRole, deleteTemplateRole, getStars, toggleStar, addTemplateTag, getTemplateTags, deleteTemplateTag, createTag, getTag, getAllTags, ITemplateSortBy, TTemplateVisibilityFilter, IGetTemplatesParams, getTemplates, getTemplate, IDocumentFromUri, IDocumentFromData, ITemplateCreateParams, createTemplate, duplicateTemplate, ITemplateCreateFromSharepointParams, createTemplateFromSharepoint, updateTemplate, deleteTemplate, getTemplateDocuments, getTemplateDocument, createTemplateDocument, deleteTemplateDocument, getTemplateDocumentFile, getTemplateDocumentThumbnail, getTemplateDocumentPageDisplayUri, ITemplateTag, ITag, IStar, ITemplateSearchResult, IValidator, getValidators, getValidator, isValidEmail, isValidPhone, isValidRoleName, isValidTag, IROPCRequest, IClientCredentialsRequest, IRefreshTokenRequest, TAuthenticationRequest, authenticate, refreshToken, changePassword, resetPassword, resendVerification, verifyEmail, getMyUser, getNotifications, getProfiles, getCurrentProfile, switchProfile, updateProfile, deleteProfile, createProfile, updateProfilePhoto, ICreateProfileRequest, IUpdateProfileRequest, IAuthenticateResponse, IChangePasswordRequest, IChangePasswordResponse, IResetPasswordRequest, IResetPasswordResponse, IVerifyEmailRequest, getRGB, getRGBA, nameToRGBA, getRoleColor, formatShortTimeAgo, collapseEntitlements, getRTop, getRLeft, getRValue, blobToBase64, rescale, sortFields, fileToDataUrl, downloadBlob, Countries, getCountryByCode, isFrenchGuiana, isGuadeloupe, isMartinique, isMayotte, getPlusOneCountry, isCanada, isAmericanSamoa, isDominicanRepublic, isPuertoRico, getMatchingCountry, integerSequence, formatFullName, formatInitials, fullNameToInitials, capitalize, convertToE164, randomString, AtoB, decodeJWTBody, decodeAccessTokenBody, IFileWithData, ICountry };
package/dist/index.js CHANGED
@@ -1606,35 +1606,41 @@ const getEnvelope = async (endpoint, envelopeId) => endpoint.api //
1606
1606
  * this will return only the **metadata** the caller is allowed to view.
1607
1607
  *
1608
1608
  * @group Envelope Documents
1609
- * @api GET /envelopes/:id Get envelope document
1610
- * @apiParam string(format: 'uuid') id The ID of the document to retrieve.
1609
+ * @api GET /v2/envelope-documents/:id Get envelope document
1610
+ * @apiParam string(format: 'uuid') document_id The ID of the document to retrieve.
1611
1611
  * @apiSuccess IEnvelopeDocument . The detailed metadata for the document requested
1612
1612
  */
1613
- const getEnvelopeDocument = async (endpoint, envelopeId, documentId) => endpoint.api //
1614
- .get(`/envelopes/${envelopeId}/envelope_documents/${documentId}`)
1613
+ const getEnvelopeDocument = async (endpoint, _envelopeId, documentId) => endpoint.api //
1614
+ .get(`/v2/envelope-documents/${documentId}`)
1615
+ .then((r) => r.data);
1616
+ /**
1617
+ * Download a document directly.
1618
+ */
1619
+ const downloadDocument = async (endpoint, _envelopeId, documentId) => endpoint.api //
1620
+ .get(`/v2/envelope-documents/${documentId}?type=file`)
1615
1621
  .then((r) => r.data);
1616
1622
  /**
1617
- * Get a pre-signed download link for an Envelope Document. This link expires quickly, so it should
1618
- * be accessed immediately and never shared. Content-Disposition will be set to "download".
1623
+ * Get an envelope document's metadata, or the document itself. If no "type" parameter is specified,
1624
+ * the document metadata is returned. If "type" is set to "file", the document binary content is
1625
+ * returned with Content-Type set to the MIME type of the file. If "type" is set to "download", a
1626
+ * string download link will be returned. If "type" is set to "preview" a string preview link will
1627
+ * be returned. This link expires quickly, so it should be accessed immediately and never shared.
1619
1628
  *
1620
1629
  * @group Envelope Documents
1621
- * @api GET /envelopes/:envelope_id/envelope_documents/:document_id Preview, Download, or Link to a Document
1622
- * @apiParam string(format: 'uuid') envelope_id The ID of the envelope to retrieve.
1630
+ * @api GET /v2/envelope-documents/:document_id Preview, Download, or Link to a Document
1623
1631
  * @apiParam string(format: 'uuid') document_id The ID of the document to retrieve.
1624
- * @apiQuery boolean download? Set to true to generate a download link (content-disposition: download).
1625
- * @apiQuery boolean preview? Set to true to generate a preview link (content-disposition: inline).
1626
- * @apiQuery boolean file? Set to true to return the raw binary BLOB data of the file rather than a link.
1632
+ * @apiQuery string(enum:'file'|'download'|'preview') type? Download the file directly, generate a download link, or generate a preview link.
1627
1633
  * @apiSuccess string . The generated link.
1628
1634
  */
1629
- const getDocumentDownloadLink = async (endpoint, envelopeId, documentId) => endpoint.api //
1630
- .get(`/envelopes/${envelopeId}/envelope_documents/${documentId}?download=true`)
1635
+ const getDocumentDownloadLink = async (endpoint, _envelopeId, documentId) => endpoint.api //
1636
+ .get(`/v2/envelope-documents/${documentId}?type=download`)
1631
1637
  .then((r) => r.data);
1632
1638
  /**
1633
1639
  * Get a pre-signed preview link for an Envelope Document. This link expires quickly, so it should
1634
1640
  * be accessed immediately and never shared. Content-Disposition will be set to "inline".
1635
1641
  */
1636
- const getDocumentPreviewLink = async (endpoint, envelopeId, documentId) => endpoint.api //
1637
- .get(`/envelopes/${envelopeId}/envelope_documents/${documentId}?preview=true`)
1642
+ const getDocumentPreviewLink = async (endpoint, _envelopeId, documentId) => endpoint.api //
1643
+ .get(`/v2/envelope-documents/${documentId}?type=preview`)
1638
1644
  .then((r) => r.data);
1639
1645
  /**
1640
1646
  * Cancel an Envelope.
@@ -1809,8 +1815,12 @@ const getEnvelopes = (endpoint, params) => endpoint.api //
1809
1815
  * create and store an initials block. Thereafter, the ID of the initials block may be re-used for each initials field
1810
1816
  * to be "stamped" by the user.
1811
1817
  *
1818
+ * Note: Both "guest" signers and authenticated users can create initials blocks. Guest signers
1819
+ * typically only ever have one, tied to that session. But authenticated users can create more than
1820
+ * one, and can use them interchangeably.
1821
+ *
1812
1822
  * @group Signatures and Initials
1813
- * @api POST /initials Create Initial Block
1823
+ * @api POST /v2/profiles/initials Create Initial Block
1814
1824
  * @apiBody string initial Blob containing initials image to store.
1815
1825
  * @apiSuccess IInitial . The newly-created initial block.
1816
1826
  */
@@ -1818,7 +1828,7 @@ const createInitials = (endpoint, name, initials) => {
1818
1828
  const data = new FormData();
1819
1829
  data.append('initial', initials, name);
1820
1830
  return endpoint.api //
1821
- .post(`/initials`, data)
1831
+ .post(`/v2/profiles/initials`, data)
1822
1832
  .then((r) => r.data);
1823
1833
  };
1824
1834
 
@@ -2111,9 +2121,12 @@ const getNextRecipient = (envelope) => {
2111
2121
  * create and store a signature block. Thereafter, the ID of the signature block may be re-used for each signature field
2112
2122
  * to be "stamped" by the user.
2113
2123
  *
2114
- * @group Signatures and Initials
2115
- * @api POST /signatures Create Signature Block
2124
+ * Note: Both "guest" signers and authenticated users can create initials blocks. Guest signers
2125
+ * typically only ever have one, tied to that session. But authenticated users can create more than
2126
+ * one, and can use them interchangeably.
2116
2127
  *
2128
+ * @group Signatures and Initials
2129
+ * @api POST /v2/profiles/signatures Create Signature Block
2117
2130
  * @apiBody string signature Blob containing signature image to store.
2118
2131
  * @apiSuccess ISignature . The newly-created signature block.
2119
2132
  */
@@ -2121,7 +2134,7 @@ const createSignature = (endpoint, name, signature) => {
2121
2134
  const data = new FormData();
2122
2135
  data.append('signature', signature, name);
2123
2136
  return endpoint.api //
2124
- .post(`/signatures`, data)
2137
+ .post(`/v2/profiles/signatures`, data)
2125
2138
  .then((r) => r.data);
2126
2139
  };
2127
2140
  /**
@@ -3735,6 +3748,7 @@ exports.deleteTemplateDocument = deleteTemplateDocument;
3735
3748
  exports.deleteTemplateRole = deleteTemplateRole;
3736
3749
  exports.deleteTemplateTag = deleteTemplateTag;
3737
3750
  exports.downloadBlob = downloadBlob;
3751
+ exports.downloadDocument = downloadDocument;
3738
3752
  exports.duplicateTemplate = duplicateTemplate;
3739
3753
  exports.envelopeIsActive = envelopeIsActive;
3740
3754
  exports.envelopeIsComplete = envelopeIsComplete;