@verdocs/js-sdk 6.0.3 → 6.0.5

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
@@ -1691,7 +1691,7 @@ declare const getEnvelopeDocument: (endpoint: VerdocsEndpoint, _envelopeId: stri
1691
1691
  /**
1692
1692
  * Download a document directly.
1693
1693
  */
1694
- declare const downloadDocument: (endpoint: VerdocsEndpoint, _envelopeId: string, documentId: string) => Promise<string>;
1694
+ declare const downloadDocument: (endpoint: VerdocsEndpoint, _envelopeId: string, documentId: string) => Promise<any>;
1695
1695
  /**
1696
1696
  * Get an envelope document's metadata, or the document itself. If no "type" parameter is specified,
1697
1697
  * the document metadata is returned. If "type" is set to "file", the document binary content is
@@ -1725,6 +1725,8 @@ declare const cancelEnvelope: (endpoint: VerdocsEndpoint, envelopeId: string) =>
1725
1725
  * Get (binary download) a file attached to an Envelope. It is important to use this method
1726
1726
  * rather than a direct A HREF or similar link to set the authorization headers for the
1727
1727
  * request.
1728
+ *
1729
+ * @deprecated Use getDocumentPreviewLink/getDocumentDownloadLink/downloadDocument instead.
1728
1730
  */
1729
1731
  declare const getEnvelopeFile: (endpoint: VerdocsEndpoint, envelopeId: string, documentId: string) => Promise<any>;
1730
1732
  /**
@@ -2069,21 +2071,7 @@ declare const getInPersonLink: (endpoint: VerdocsEndpoint, envelope_id: string,
2069
2071
  * @apiSuccess ISignerTokenResponse . Updated signing session.
2070
2072
  */
2071
2073
  declare const verifySigner: (endpoint: VerdocsEndpoint, params: TAuthenticateRecipientRequest) => Promise<ISignerTokenResponse>;
2072
- // TODO: Use "oneOf" to describe the unions of these two calls.
2073
- /**
2074
- * Resend a recipient's invitation. NOTE: User interfaces should rate-limit this operation to
2075
- * avoid spamming recipients. Excessive use of this endpoint may result in Verdocs rate-limiting
2076
- * the calling application to prevent abuse. This endpoint will return a 200 OK even if the
2077
- * no_contact flag is set on the envelope (in which case the call will be ignored).
2078
- *
2079
- * @group Recipients
2080
- * @api PUT /v2/envelopes/:envelope_id/recipients/:role_name Resend Invitation
2081
- * @apiParam string(format:uuid) envelope_id The envelope to operate on.
2082
- * @apiParam string role_name The role to operate on.
2083
- * @apiBody string(enum:'resend') action The operation to perform (resend).
2084
- * @apiSuccess string . Success message.
2085
- */
2086
- declare const resendInvitation: (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string) => Promise<{
2074
+ declare const resendInvitation: (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, message: string) => Promise<{
2087
2075
  status: "OK";
2088
2076
  }>;
2089
2077
  /**
@@ -2117,10 +2105,13 @@ declare const delegateRecipient: (endpoint: VerdocsEndpoint, envelopeId: string,
2117
2105
  status: "OK";
2118
2106
  }>;
2119
2107
  /**
2120
- * Update a recipient. NOTE: User interfaces should rate-limit this operation to
2121
- * avoid spamming recipients. Excessive use of this endpoint may result in Verdocs rate-limiting
2122
- * the calling application to prevent abuse. This endpoint will return a 200 OK even if the
2123
- * no_contact flag is set on the envelope (in which case the call will be ignored).
2108
+ * Update a recipient. NOTE: User interfaces should rate-limit this operation to avoid spamming recipients.
2109
+ * Excessive use of this endpoint may result in Verdocs rate-limiting the calling application to prevent
2110
+ * abuse. This endpoint will return a 200 OK even if the no_contact flag is set on the envelope (in which
2111
+ * case the call will be silently ignored).
2112
+ *
2113
+ * If the recipient's first_name, last_name, email, or message are updated, a new invitation will be sent
2114
+ * to the recipient. This may also be used to trigger a reminder.
2124
2115
  *
2125
2116
  * @group Recipients
2126
2117
  * @api PATCH /envelopes/:envelope_id/recipients/:role_name Update Recipient
@@ -2141,14 +2132,30 @@ declare const delegateRecipient: (endpoint: VerdocsEndpoint, envelopeId: string,
2141
2132
  * @apiSuccess IRecipient . The updated Recipient.
2142
2133
  */
2143
2134
  declare const updateRecipient: (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, params: IUpdateRecipientParams) => Promise<IRecipient>;
2135
+ /**
2136
+ * Check to see if the profile ID owns the envelope.
2137
+ */
2138
+ declare const isEnvelopeOwner: (profile_id: string | null | undefined, envelope: IEnvelope) => boolean;
2139
+ /**
2140
+ * Check to see if the profile ID is a recipient within the envelope.
2141
+ */
2142
+ declare const isEnvelopeRecipient: (profile_id: string | null | undefined, envelope: IEnvelope) => boolean;
2143
+ /**
2144
+ * Check to see if the profile ID is the envelope's sender or one of the recipients.
2145
+ */
2146
+ declare const canAccessEnvelope: (profile_id: string | null | undefined, envelope: IEnvelope) => boolean;
2144
2147
  /**
2145
2148
  * Check to see if the user owns the envelope.
2146
2149
  */
2147
2150
  declare const userIsEnvelopeOwner: (profile: IProfile | null | undefined, envelope: IEnvelope) => boolean;
2148
2151
  /**
2149
- * Check to see if the user owns the envelope.
2152
+ * Check to see if the user is a recipient within the envelope.
2150
2153
  */
2151
2154
  declare const userIsEnvelopeRecipient: (profile: IProfile | null | undefined, envelope: IEnvelope) => boolean;
2155
+ /**
2156
+ * Check to see if the profile ID is the envelope's sender or one of the recipients.
2157
+ */
2158
+ declare const useCanAccessEnvelope: (profile: IProfile | null | undefined, envelope: IEnvelope) => boolean;
2152
2159
  /**
2153
2160
  * Check to see if the envelope has pending actions.
2154
2161
  */
@@ -3837,4 +3844,4 @@ declare const decodeJWTBody: (token: string) => any;
3837
3844
  * the presence of the `document_id` field, which will only be present for signing sessions.
3838
3845
  */
3839
3846
  declare const decodeAccessTokenBody: (token: string) => TSession;
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 };
3847
+ 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, isEnvelopeOwner, isEnvelopeRecipient, canAccessEnvelope, userIsEnvelopeOwner, userIsEnvelopeRecipient, useCanAccessEnvelope, 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
@@ -1691,7 +1691,7 @@ declare const getEnvelopeDocument: (endpoint: VerdocsEndpoint, _envelopeId: stri
1691
1691
  /**
1692
1692
  * Download a document directly.
1693
1693
  */
1694
- declare const downloadDocument: (endpoint: VerdocsEndpoint, _envelopeId: string, documentId: string) => Promise<string>;
1694
+ declare const downloadDocument: (endpoint: VerdocsEndpoint, _envelopeId: string, documentId: string) => Promise<any>;
1695
1695
  /**
1696
1696
  * Get an envelope document's metadata, or the document itself. If no "type" parameter is specified,
1697
1697
  * the document metadata is returned. If "type" is set to "file", the document binary content is
@@ -1725,6 +1725,8 @@ declare const cancelEnvelope: (endpoint: VerdocsEndpoint, envelopeId: string) =>
1725
1725
  * Get (binary download) a file attached to an Envelope. It is important to use this method
1726
1726
  * rather than a direct A HREF or similar link to set the authorization headers for the
1727
1727
  * request.
1728
+ *
1729
+ * @deprecated Use getDocumentPreviewLink/getDocumentDownloadLink/downloadDocument instead.
1728
1730
  */
1729
1731
  declare const getEnvelopeFile: (endpoint: VerdocsEndpoint, envelopeId: string, documentId: string) => Promise<any>;
1730
1732
  /**
@@ -2069,21 +2071,7 @@ declare const getInPersonLink: (endpoint: VerdocsEndpoint, envelope_id: string,
2069
2071
  * @apiSuccess ISignerTokenResponse . Updated signing session.
2070
2072
  */
2071
2073
  declare const verifySigner: (endpoint: VerdocsEndpoint, params: TAuthenticateRecipientRequest) => Promise<ISignerTokenResponse>;
2072
- // TODO: Use "oneOf" to describe the unions of these two calls.
2073
- /**
2074
- * Resend a recipient's invitation. NOTE: User interfaces should rate-limit this operation to
2075
- * avoid spamming recipients. Excessive use of this endpoint may result in Verdocs rate-limiting
2076
- * the calling application to prevent abuse. This endpoint will return a 200 OK even if the
2077
- * no_contact flag is set on the envelope (in which case the call will be ignored).
2078
- *
2079
- * @group Recipients
2080
- * @api PUT /v2/envelopes/:envelope_id/recipients/:role_name Resend Invitation
2081
- * @apiParam string(format:uuid) envelope_id The envelope to operate on.
2082
- * @apiParam string role_name The role to operate on.
2083
- * @apiBody string(enum:'resend') action The operation to perform (resend).
2084
- * @apiSuccess string . Success message.
2085
- */
2086
- declare const resendInvitation: (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string) => Promise<{
2074
+ declare const resendInvitation: (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, message: string) => Promise<{
2087
2075
  status: "OK";
2088
2076
  }>;
2089
2077
  /**
@@ -2117,10 +2105,13 @@ declare const delegateRecipient: (endpoint: VerdocsEndpoint, envelopeId: string,
2117
2105
  status: "OK";
2118
2106
  }>;
2119
2107
  /**
2120
- * Update a recipient. NOTE: User interfaces should rate-limit this operation to
2121
- * avoid spamming recipients. Excessive use of this endpoint may result in Verdocs rate-limiting
2122
- * the calling application to prevent abuse. This endpoint will return a 200 OK even if the
2123
- * no_contact flag is set on the envelope (in which case the call will be ignored).
2108
+ * Update a recipient. NOTE: User interfaces should rate-limit this operation to avoid spamming recipients.
2109
+ * Excessive use of this endpoint may result in Verdocs rate-limiting the calling application to prevent
2110
+ * abuse. This endpoint will return a 200 OK even if the no_contact flag is set on the envelope (in which
2111
+ * case the call will be silently ignored).
2112
+ *
2113
+ * If the recipient's first_name, last_name, email, or message are updated, a new invitation will be sent
2114
+ * to the recipient. This may also be used to trigger a reminder.
2124
2115
  *
2125
2116
  * @group Recipients
2126
2117
  * @api PATCH /envelopes/:envelope_id/recipients/:role_name Update Recipient
@@ -2141,14 +2132,30 @@ declare const delegateRecipient: (endpoint: VerdocsEndpoint, envelopeId: string,
2141
2132
  * @apiSuccess IRecipient . The updated Recipient.
2142
2133
  */
2143
2134
  declare const updateRecipient: (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, params: IUpdateRecipientParams) => Promise<IRecipient>;
2135
+ /**
2136
+ * Check to see if the profile ID owns the envelope.
2137
+ */
2138
+ declare const isEnvelopeOwner: (profile_id: string | null | undefined, envelope: IEnvelope) => boolean;
2139
+ /**
2140
+ * Check to see if the profile ID is a recipient within the envelope.
2141
+ */
2142
+ declare const isEnvelopeRecipient: (profile_id: string | null | undefined, envelope: IEnvelope) => boolean;
2143
+ /**
2144
+ * Check to see if the profile ID is the envelope's sender or one of the recipients.
2145
+ */
2146
+ declare const canAccessEnvelope: (profile_id: string | null | undefined, envelope: IEnvelope) => boolean;
2144
2147
  /**
2145
2148
  * Check to see if the user owns the envelope.
2146
2149
  */
2147
2150
  declare const userIsEnvelopeOwner: (profile: IProfile | null | undefined, envelope: IEnvelope) => boolean;
2148
2151
  /**
2149
- * Check to see if the user owns the envelope.
2152
+ * Check to see if the user is a recipient within the envelope.
2150
2153
  */
2151
2154
  declare const userIsEnvelopeRecipient: (profile: IProfile | null | undefined, envelope: IEnvelope) => boolean;
2155
+ /**
2156
+ * Check to see if the profile ID is the envelope's sender or one of the recipients.
2157
+ */
2158
+ declare const useCanAccessEnvelope: (profile: IProfile | null | undefined, envelope: IEnvelope) => boolean;
2152
2159
  /**
2153
2160
  * Check to see if the envelope has pending actions.
2154
2161
  */
@@ -3837,4 +3844,4 @@ declare const decodeJWTBody: (token: string) => any;
3837
3844
  * the presence of the `document_id` field, which will only be present for signing sessions.
3838
3845
  */
3839
3846
  declare const decodeAccessTokenBody: (token: string) => TSession;
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 };
3847
+ 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, isEnvelopeOwner, isEnvelopeRecipient, canAccessEnvelope, userIsEnvelopeOwner, userIsEnvelopeRecipient, useCanAccessEnvelope, 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
@@ -1617,7 +1617,7 @@ const getEnvelopeDocument = async (endpoint, _envelopeId, documentId) => endpoin
1617
1617
  * Download a document directly.
1618
1618
  */
1619
1619
  const downloadDocument = async (endpoint, _envelopeId, documentId) => endpoint.api //
1620
- .get(`/v2/envelope-documents/${documentId}?type=file`)
1620
+ .get(`/v2/envelope-documents/${documentId}?type=file`, { responseType: 'blob' })
1621
1621
  .then((r) => r.data);
1622
1622
  /**
1623
1623
  * Get an envelope document's metadata, or the document itself. If no "type" parameter is specified,
@@ -1658,9 +1658,11 @@ const cancelEnvelope = async (endpoint, envelopeId) => endpoint.api //
1658
1658
  * Get (binary download) a file attached to an Envelope. It is important to use this method
1659
1659
  * rather than a direct A HREF or similar link to set the authorization headers for the
1660
1660
  * request.
1661
+ *
1662
+ * @deprecated Use getDocumentPreviewLink/getDocumentDownloadLink/downloadDocument instead.
1661
1663
  */
1662
1664
  const getEnvelopeFile = async (endpoint, envelopeId, documentId) => endpoint.api //
1663
- .get(`/envelopes/${envelopeId}/envelope_documents/${documentId}?file=true`, { responseType: 'blob' })
1665
+ .get(`/v2/envelope-documents/${documentId}?type=file`, { responseType: 'blob' })
1664
1666
  .then((r) => r.data);
1665
1667
  /**
1666
1668
  * Update an envelope. Currently, only reminder settings may be changed.
@@ -1973,22 +1975,8 @@ const getInPersonLink = (endpoint, envelope_id, role_name) => endpoint.api //
1973
1975
  const verifySigner = (endpoint, params) => endpoint.api //
1974
1976
  .post(`/v2/sign/verify`, params)
1975
1977
  .then((r) => r.data);
1976
- // TODO: Use "oneOf" to describe the unions of these two calls.
1977
- /**
1978
- * Resend a recipient's invitation. NOTE: User interfaces should rate-limit this operation to
1979
- * avoid spamming recipients. Excessive use of this endpoint may result in Verdocs rate-limiting
1980
- * the calling application to prevent abuse. This endpoint will return a 200 OK even if the
1981
- * no_contact flag is set on the envelope (in which case the call will be ignored).
1982
- *
1983
- * @group Recipients
1984
- * @api PUT /v2/envelopes/:envelope_id/recipients/:role_name Resend Invitation
1985
- * @apiParam string(format:uuid) envelope_id The envelope to operate on.
1986
- * @apiParam string role_name The role to operate on.
1987
- * @apiBody string(enum:'resend') action The operation to perform (resend).
1988
- * @apiSuccess string . Success message.
1989
- */
1990
- const resendInvitation = (endpoint, envelopeId, roleName) => endpoint.api //
1991
- .put(`/v2/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}`, { action: 'resend' })
1978
+ const resendInvitation = (endpoint, envelopeId, roleName, message) => endpoint.api //
1979
+ .patch(`/v2/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}`, { message })
1992
1980
  .then((r) => r.data);
1993
1981
  /**
1994
1982
  * Delegate a recipient's signing responsibility. The envelope sender must enable this before the
@@ -2015,10 +2003,13 @@ const delegateRecipient = (endpoint, envelopeId, roleName, params) => endpoint.a
2015
2003
  .put(`/v2/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}`, { action: 'delegate', ...params })
2016
2004
  .then((r) => r.data);
2017
2005
  /**
2018
- * Update a recipient. NOTE: User interfaces should rate-limit this operation to
2019
- * avoid spamming recipients. Excessive use of this endpoint may result in Verdocs rate-limiting
2020
- * the calling application to prevent abuse. This endpoint will return a 200 OK even if the
2021
- * no_contact flag is set on the envelope (in which case the call will be ignored).
2006
+ * Update a recipient. NOTE: User interfaces should rate-limit this operation to avoid spamming recipients.
2007
+ * Excessive use of this endpoint may result in Verdocs rate-limiting the calling application to prevent
2008
+ * abuse. This endpoint will return a 200 OK even if the no_contact flag is set on the envelope (in which
2009
+ * case the call will be silently ignored).
2010
+ *
2011
+ * If the recipient's first_name, last_name, email, or message are updated, a new invitation will be sent
2012
+ * to the recipient. This may also be used to trigger a reminder.
2022
2013
  *
2023
2014
  * @group Recipients
2024
2015
  * @api PATCH /envelopes/:envelope_id/recipients/:role_name Update Recipient
@@ -2047,14 +2038,30 @@ const updateRecipient = (endpoint, envelopeId, roleName, params) => endpoint.api
2047
2038
  *
2048
2039
  * @module
2049
2040
  */
2041
+ /**
2042
+ * Check to see if the profile ID owns the envelope.
2043
+ */
2044
+ const isEnvelopeOwner = (profile_id, envelope) => envelope.profile_id === profile_id;
2045
+ /**
2046
+ * Check to see if the profile ID is a recipient within the envelope.
2047
+ */
2048
+ const isEnvelopeRecipient = (profile_id, envelope) => (envelope.recipients || []).some((recipient) => recipient.profile_id === profile_id);
2049
+ /**
2050
+ * Check to see if the profile ID is the envelope's sender or one of the recipients.
2051
+ */
2052
+ const canAccessEnvelope = (profile_id, envelope) => isEnvelopeOwner(profile_id, envelope) || isEnvelopeRecipient(profile_id, envelope);
2050
2053
  /**
2051
2054
  * Check to see if the user owns the envelope.
2052
2055
  */
2053
2056
  const userIsEnvelopeOwner = (profile, envelope) => envelope.profile_id === profile?.id;
2054
2057
  /**
2055
- * Check to see if the user owns the envelope.
2058
+ * Check to see if the user is a recipient within the envelope.
2059
+ */
2060
+ const userIsEnvelopeRecipient = (profile, envelope) => (envelope.recipients || []).some((recipient) => recipient.profile_id === profile?.id);
2061
+ /**
2062
+ * Check to see if the profile ID is the envelope's sender or one of the recipients.
2056
2063
  */
2057
- const userIsEnvelopeRecipient = (profile, envelope) => envelope.profile_id === profile?.id;
2064
+ const useCanAccessEnvelope = (profile, envelope) => userIsEnvelopeOwner(profile, envelope) || userIsEnvelopeRecipient(profile, envelope);
2058
2065
  /**
2059
2066
  * Check to see if the envelope has pending actions.
2060
2067
  */
@@ -3707,6 +3714,7 @@ exports.addGroupMember = addGroupMember;
3707
3714
  exports.addTemplateTag = addTemplateTag;
3708
3715
  exports.authenticate = authenticate;
3709
3716
  exports.blobToBase64 = blobToBase64;
3717
+ exports.canAccessEnvelope = canAccessEnvelope;
3710
3718
  exports.canPerformTemplateAction = canPerformTemplateAction;
3711
3719
  exports.cancelEnvelope = cancelEnvelope;
3712
3720
  exports.capitalize = capitalize;
@@ -3822,6 +3830,8 @@ exports.integerSequence = integerSequence;
3822
3830
  exports.isAmericanSamoa = isAmericanSamoa;
3823
3831
  exports.isCanada = isCanada;
3824
3832
  exports.isDominicanRepublic = isDominicanRepublic;
3833
+ exports.isEnvelopeOwner = isEnvelopeOwner;
3834
+ exports.isEnvelopeRecipient = isEnvelopeRecipient;
3825
3835
  exports.isFrenchGuiana = isFrenchGuiana;
3826
3836
  exports.isGuadeloupe = isGuadeloupe;
3827
3837
  exports.isMartinique = isMartinique;
@@ -3870,6 +3880,7 @@ exports.updateRecipientStatus = updateRecipientStatus;
3870
3880
  exports.updateTemplate = updateTemplate;
3871
3881
  exports.updateTemplateRole = updateTemplateRole;
3872
3882
  exports.uploadEnvelopeFieldAttachment = uploadEnvelopeFieldAttachment;
3883
+ exports.useCanAccessEnvelope = useCanAccessEnvelope;
3873
3884
  exports.userCanAct = userCanAct;
3874
3885
  exports.userCanBuildTemplate = userCanBuildTemplate;
3875
3886
  exports.userCanCancelEnvelope = userCanCancelEnvelope;