@verdocs/js-sdk 5.3.2 → 5.3.4

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.mjs CHANGED
@@ -1573,7 +1573,7 @@ class VerdocsEndpoint {
1573
1573
  * @group Envelopes
1574
1574
  * @api POST /v2/envelopes Create Envelope
1575
1575
  * @apiBody string(format:uuid) template_id If using a template, the ID of the template to copy
1576
- * @apiBody array(items:ICreateEnvelopeRecipient) recipients A list of recipients to include in the workflow. Must specify one recipient to match each template Role.
1576
+ * @apiBody array(items:ICreateEnvelopeRecipientDirectly) recipients A list of recipients to include in the workflow. Must specify one recipient to match each template Role.
1577
1577
  * @apiBody array(items:IEnvelopeDocument) documents? If not using a template, a list of documents to include in the envelope.
1578
1578
  * @apiBody array(items:IEnvelopeField) fields? If not using a template, a list of fields to include in the envelope.
1579
1579
  * @apiBody string name? Override the name of the envelope (defaults to the template name).
@@ -1959,12 +1959,7 @@ const getInPersonLink = (endpoint, envelope_id, role_name) => endpoint.api //
1959
1959
  const verifySigner = (endpoint, params) => endpoint.api //
1960
1960
  .post(`/v2/sign/verify`, params)
1961
1961
  .then((r) => r.data);
1962
- /**
1963
- * Send a delegation request.
1964
- */
1965
- const sendDelegate = (endpoint, envelopeId, roleName) => endpoint.api //
1966
- .post(`/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}`)
1967
- .then((r) => r.data);
1962
+ // TODO: Use "oneOf" to describe the unions of these two calls.
1968
1963
  /**
1969
1964
  * Resend a recipient's invitation. NOTE: User interfaces should rate-limit this operation to
1970
1965
  * avoid spamming recipients. Excessive use of this endpoint may result in Verdocs rate-limiting
@@ -1975,12 +1970,36 @@ const sendDelegate = (endpoint, envelopeId, roleName) => endpoint.api //
1975
1970
  * @api PUT /v2/envelopes/:envelope_id/recipients/:role_name Resend Invitation
1976
1971
  * @apiParam string(format:uuid) envelope_id The envelope to operate on.
1977
1972
  * @apiParam string role_name The role to operate on.
1978
- * @apiBody string(enum:'resend') action The operation to perform.
1973
+ * @apiBody string(enum:'resend') action The operation to perform (resend).
1979
1974
  * @apiSuccess string . Success message.
1980
1975
  */
1981
1976
  const resendInvitation = (endpoint, envelopeId, roleName) => endpoint.api //
1982
1977
  .put(`/v2/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}`, { action: 'resend' })
1983
1978
  .then((r) => r.data);
1979
+ /**
1980
+ * Delegate a recipient's signing responsibility. The envelope sender must enable this before the
1981
+ * recipient calls this endpoint, and only the recipient may call it, or the call will be rejected.
1982
+ * The recipient's role will be renamed and configured to indicate to whom the delegation was made,
1983
+ * and a new recipient entry with the updated details (e.g. name and email address) will be added
1984
+ * to the flow with the same role_name, order, and sequence of the original recipient. Unless
1985
+ * no_contact is set on the envelope, the delegation recipient and envelope creator will also be
1986
+ * notified.
1987
+ *
1988
+ * @group Recipients
1989
+ * @api PUT /v2/envelopes/:envelope_id/recipients/:role_name Delegate Recipient
1990
+ * @apiParam string(format:uuid) envelope_id The envelope to operate on.
1991
+ * @apiParam string role_name The role to operate on.
1992
+ * @apiBody string(enum:'delegate') action The operation to perform (delegate).
1993
+ * @apiBody string first_name The first name of the new recipient.
1994
+ * @apiBody string last_name The last name of the new recipient.
1995
+ * @apiBody string email The email address of the new recipient.
1996
+ * @apiBody string phone? Optional phone number for the new recipient.
1997
+ * @apiBody string message? Optional phone number for the new recipient's invitation.
1998
+ * @apiSuccess string . Success message.
1999
+ */
2000
+ const delegateRecipient = (endpoint, envelopeId, roleName, params) => endpoint.api //
2001
+ .put(`/v2/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}`, { action: 'delegate', ...params })
2002
+ .then((r) => r.data);
1984
2003
  /**
1985
2004
  * Update a recipient. NOTE: User interfaces should rate-limit this operation to
1986
2005
  * avoid spamming recipients. Excessive use of this endpoint may result in Verdocs rate-limiting
@@ -3657,5 +3676,5 @@ const isValidRoleName = (value, roles) => roles.findIndex((role) => role.name ==
3657
3676
  const TagRegEx = /^[a-zA-Z0-9-]{0,32}$/;
3658
3677
  const isValidTag = (value, tags) => TagRegEx.test(value) || tags.findIndex((tag) => tag === value) !== -1;
3659
3678
 
3660
- export { ALL_PERMISSIONS, AtoB, Countries, DEFAULT_FIELD_HEIGHTS, DEFAULT_FIELD_WIDTHS, FIELD_TYPES, RolePermissions, VerdocsEndpoint, WEBHOOK_EVENTS, acceptOrganizationInvitation, addGroupMember, addTemplateTag, authenticate, blobToBase64, canPerformTemplateAction, cancelEnvelope, capitalize, changePassword, collapseEntitlements, convertToE164, createApiKey, createEnvelope, createField, createGroup, createInitials, createOrganization, createOrganizationContact, createOrganizationInvitation, createProfile, createSignature, createTag, createTemplate, createTemplateDocument, createTemplateFromSharepoint, createTemplateRole, declineOrganizationInvitation, decodeAccessTokenBody, decodeJWTBody, deleteApiKey, deleteEnvelopeFieldAttachment, deleteField, deleteGroup, deleteGroupMember, deleteOrganization, deleteOrganizationContact, deleteOrganizationInvitation, deleteOrganizationMember, deleteProfile, deleteSignature, deleteTemplate, deleteTemplateDocument, deleteTemplateRole, deleteTemplateTag, downloadBlob, duplicateTemplate, envelopeIsActive, envelopeIsComplete, envelopeRecipientAgree, envelopeRecipientChangeOwner, envelopeRecipientDecline, envelopeRecipientPrepare, envelopeRecipientSubmit, envelopeRecipientUpdateName, fileToDataUrl, formatFullName, formatInitials, formatShortTimeAgo, fullNameToInitials, getActiveEntitlements, getAllTags, getApiKeys, getCountryByCode, getCurrentProfile, getDocumentDownloadLink, getDocumentPreviewLink, getEntitlements, getEnvelope, getEnvelopeDocument, getEnvelopeDocumentPageDisplayUri, getEnvelopeFile, getEnvelopes, getFieldAttachment, getFieldsForRole, getGroup, getGroups, getInPersonLink, getKbaStep, getMatchingCountry, getMyUser, getNextRecipient, getNotifications, getOrganization, getOrganizationChildren, getOrganizationContacts, getOrganizationInvitation, getOrganizationInvitations, getOrganizationMembers, getOrganizationUsage, getPlusOneCountry, getProfiles, getRGB, getRGBA, getRLeft, getRTop, getRValue, getRecipientsWithActions, getRoleColor, getSignature, getSignatures, getStars, getTag, getTemplate, getTemplateDocument, getTemplateDocumentFile, getTemplateDocumentPageDisplayUri, getTemplateDocumentThumbnail, getTemplateDocuments, getTemplateTags, getTemplates, getValidator, getValidators, getWebhooks, hasRequiredPermissions, integerSequence, isAmericanSamoa, isCanada, isDominicanRepublic, isFrenchGuiana, isGuadeloupe, isMartinique, isMayotte, isPuertoRico, isValidEmail, isValidPhone, isValidRoleName, isValidTag, nameToRGBA, randomString, recipientCanAct, recipientHasAction, refreshToken, rescale, resendInvitation, resendOrganizationInvitation, resendVerification, resetPassword, rotateApiKey, sendDelegate, setWebhooks, sortFields, startSigningSession, submitKbaChallengeResponse, submitKbaIdentity, submitKbaPin, switchProfile, toggleStar, updateApiKey, updateEnvelope, updateEnvelopeField, updateEnvelopeFieldInitials, updateEnvelopeFieldSignature, updateField, updateGroup, updateOrganization, updateOrganizationContact, updateOrganizationInvitation, updateOrganizationLogo, updateOrganizationMember, updateOrganizationThumbnail, updateProfile, updateProfilePhoto, updateRecipient, updateRecipientStatus, updateTemplate, updateTemplateRole, uploadEnvelopeFieldAttachment, userCanAct, userCanBuildTemplate, userCanCancelEnvelope, userCanChangeOrgVisibility, userCanCreateOrgTemplate, userCanCreatePersonalTemplate, userCanCreatePublicTemplate, userCanCreateTemplate, userCanDeleteTemplate, userCanFinishEnvelope, userCanMakeTemplatePrivate, userCanMakeTemplatePublic, userCanMakeTemplateShared, userCanPreviewTemplate, userCanReadTemplate, userCanSendTemplate, userCanSignNow, userCanUpdateTemplate, userHasPermissions, userHasSharedTemplate, userIsEnvelopeOwner, userIsEnvelopeRecipient, userIsTemplateCreator, verifyEmail, verifySigner };
3679
+ export { ALL_PERMISSIONS, AtoB, Countries, DEFAULT_FIELD_HEIGHTS, DEFAULT_FIELD_WIDTHS, FIELD_TYPES, RolePermissions, VerdocsEndpoint, WEBHOOK_EVENTS, acceptOrganizationInvitation, addGroupMember, addTemplateTag, authenticate, blobToBase64, canPerformTemplateAction, cancelEnvelope, capitalize, changePassword, collapseEntitlements, convertToE164, createApiKey, createEnvelope, createField, createGroup, createInitials, createOrganization, createOrganizationContact, createOrganizationInvitation, createProfile, createSignature, createTag, createTemplate, createTemplateDocument, createTemplateFromSharepoint, createTemplateRole, declineOrganizationInvitation, decodeAccessTokenBody, decodeJWTBody, delegateRecipient, deleteApiKey, deleteEnvelopeFieldAttachment, deleteField, deleteGroup, deleteGroupMember, deleteOrganization, deleteOrganizationContact, deleteOrganizationInvitation, deleteOrganizationMember, deleteProfile, deleteSignature, deleteTemplate, deleteTemplateDocument, deleteTemplateRole, deleteTemplateTag, downloadBlob, duplicateTemplate, envelopeIsActive, envelopeIsComplete, envelopeRecipientAgree, envelopeRecipientChangeOwner, envelopeRecipientDecline, envelopeRecipientPrepare, envelopeRecipientSubmit, envelopeRecipientUpdateName, fileToDataUrl, formatFullName, formatInitials, formatShortTimeAgo, fullNameToInitials, getActiveEntitlements, getAllTags, getApiKeys, getCountryByCode, getCurrentProfile, getDocumentDownloadLink, getDocumentPreviewLink, getEntitlements, getEnvelope, getEnvelopeDocument, getEnvelopeDocumentPageDisplayUri, getEnvelopeFile, getEnvelopes, getFieldAttachment, getFieldsForRole, getGroup, getGroups, getInPersonLink, getKbaStep, getMatchingCountry, getMyUser, getNextRecipient, getNotifications, getOrganization, getOrganizationChildren, getOrganizationContacts, getOrganizationInvitation, getOrganizationInvitations, getOrganizationMembers, getOrganizationUsage, getPlusOneCountry, getProfiles, getRGB, getRGBA, getRLeft, getRTop, getRValue, getRecipientsWithActions, getRoleColor, getSignature, getSignatures, getStars, getTag, getTemplate, getTemplateDocument, getTemplateDocumentFile, getTemplateDocumentPageDisplayUri, getTemplateDocumentThumbnail, getTemplateDocuments, getTemplateTags, getTemplates, getValidator, getValidators, getWebhooks, hasRequiredPermissions, integerSequence, isAmericanSamoa, isCanada, isDominicanRepublic, isFrenchGuiana, isGuadeloupe, isMartinique, isMayotte, isPuertoRico, isValidEmail, isValidPhone, isValidRoleName, isValidTag, nameToRGBA, randomString, recipientCanAct, recipientHasAction, refreshToken, rescale, resendInvitation, resendOrganizationInvitation, resendVerification, resetPassword, rotateApiKey, setWebhooks, sortFields, startSigningSession, submitKbaChallengeResponse, submitKbaIdentity, submitKbaPin, switchProfile, toggleStar, updateApiKey, updateEnvelope, updateEnvelopeField, updateEnvelopeFieldInitials, updateEnvelopeFieldSignature, updateField, updateGroup, updateOrganization, updateOrganizationContact, updateOrganizationInvitation, updateOrganizationLogo, updateOrganizationMember, updateOrganizationThumbnail, updateProfile, updateProfilePhoto, updateRecipient, updateRecipientStatus, updateTemplate, updateTemplateRole, uploadEnvelopeFieldAttachment, userCanAct, userCanBuildTemplate, userCanCancelEnvelope, userCanChangeOrgVisibility, userCanCreateOrgTemplate, userCanCreatePersonalTemplate, userCanCreatePublicTemplate, userCanCreateTemplate, userCanDeleteTemplate, userCanFinishEnvelope, userCanMakeTemplatePrivate, userCanMakeTemplatePublic, userCanMakeTemplateShared, userCanPreviewTemplate, userCanReadTemplate, userCanSendTemplate, userCanSignNow, userCanUpdateTemplate, userHasPermissions, userHasSharedTemplate, userIsEnvelopeOwner, userIsEnvelopeRecipient, userIsTemplateCreator, verifyEmail, verifySigner };
3661
3680
  //# sourceMappingURL=index.mjs.map