@verdocs/js-sdk 6.3.3 → 6.4.0

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
@@ -433,6 +433,7 @@ interface IWebhook {
433
433
  id: string;
434
434
  organization_id: string;
435
435
  url: string;
436
+ secret_key?: string;
436
437
  active: boolean;
437
438
  events: IWebhookEvents;
438
439
  status: string | null;
@@ -3122,6 +3123,35 @@ declare const getWebhooks: (endpoint: VerdocsEndpoint) => Promise<IWebhook>;
3122
3123
  * @apiSuccess IWebhook . The updated Webhooks config for the caller's organization.
3123
3124
  */
3124
3125
  declare const setWebhooks: (endpoint: VerdocsEndpoint, params: ISetWebhookRequest) => Promise<IWebhook>;
3126
+ /**
3127
+ * Rotate the secret key used to authenticate Webhooks. If a secret key has not yet been set,
3128
+ * it will be created. Until this is done, Webhook calls will not have a signature applied to
3129
+ * their headers. Please note that pending Webhook deliveries will not be affected until the
3130
+ * next Webhook is triggered.
3131
+ *
3132
+ * To authenticate a Webhook call, compute an HMAC-256 hash of the JSON payload `body` field
3133
+ * as follows:
3134
+ *
3135
+ * ```typescript
3136
+ * // NOTE: Hash the `body` field INSIDE the payload. In many frameworks the payload is also called
3137
+ * // `body`, which can be confusing.
3138
+ * const jsonBody = JSON.stringify(req.body.body);
3139
+ * const hash = createHmac('sha256', SECRET_KEY).update(jsonBody).digest('hex');
3140
+ * if (hash !== req.headers['x-webhook-signature']) {
3141
+ * // Handle error here
3142
+ * }
3143
+ *
3144
+ * // It is important to return a 200 status code anyway, to avoid the sender trying to resend
3145
+ * // the same data.
3146
+ * res.status(200).send();
3147
+ * ```
3148
+ *
3149
+ * @group Webhooks
3150
+ * @api PATCH /v2/webhooks Rotate Webhook secret key
3151
+ * @apiDescription Note that Webhooks cannot currently be deleted, but may be easily disabled by setting `active` to `false` and/or setting the `url` to an empty string.
3152
+ * @apiSuccess IWebhook . The updated Webhooks config for the caller's organization, including the secret_key.
3153
+ */
3154
+ declare const rotateWebhookSecret: (endpoint: VerdocsEndpoint) => Promise<IWebhook>;
3125
3155
  declare const canPerformTemplateAction: (profile: IProfile | null | undefined, action: TTemplateAction, template?: ITemplate) => {
3126
3156
  canPerform: boolean;
3127
3157
  message: string;
@@ -3814,4 +3844,4 @@ declare const decodeJWTBody: (token: string) => any;
3814
3844
  * the presence of the `document_id` field, which will only be present for signing sessions.
3815
3845
  */
3816
3846
  declare const decodeAccessTokenBody: (token: string) => TSession;
3817
- 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, downloadEnvelopeDocument, getEnvelopeDocumentDownloadLink, getEnvelopeDocumentPreviewLink, cancelEnvelope, getEnvelopeFile, updateEnvelope, updateEnvelopeField, uploadEnvelopeFieldAttachment, deleteEnvelopeFieldAttachment, getEnvelopeDocumentPageDisplayUri, ITimeRange, IListEnvelopesParams, getEnvelopes, getEnvelopesZip, isFieldFilled, isFieldValid, createInitials, IRecipientKbaStepNone, IRecipientKbaStepComplete, IRecipientKbaStepPin, IRecipientKbaStepIdentity, IRecipientKbaStepChallenge, IRecipientKbaStepFailed, TRecipientKbaStep, getKbaStep, submitKbaPin, IKbaIdentity, submitKbaIdentity, IKbaChallengeResponse, submitKbaChallengeResponse, envelopeRecipientAgree, envelopeRecipientDecline, envelopeRecipientSubmit, startSigningSession, getInPersonLink, verifySigner, delegateRecipient, updateRecipient, remindRecipient, resetRecipient, askQuestion, isEnvelopeOwner, isEnvelopeRecipient, canAccessEnvelope, userIsEnvelopeOwner, userIsEnvelopeRecipient, useCanAccessEnvelope, envelopeIsActive, envelopeIsComplete, userCanCancelEnvelope, userCanFinishEnvelope, recipientHasAction, getRecipientsWithActions, recipientCanAct, userCanAct, userCanSignNow, getNextRecipient, createSignature, IEnvelopesSearchResult, IDocumentSearchOptions, ICreateEnvelopeRecipientFromTemplate, ICreateEnvelopeRecipientDirectly, ISignerTokenResponse, IInPersonLinkResponse, IUpdateRecipientStatus, ICreateEnvelopeReminderRequest, IUpdateRecipientParams, ICreateEnvelopeDocumentFromData, ICreateEnvelopeDocumentFromUri, ICreateEnvelopeDocumentFromFile, ICreateEnvelopeFieldFromTemplate, ICreateEnvelopeFieldDirectly, ICreateEnvelopeFromTemplateRequest, ICreateEnvelopeDirectlyRequest, TCreateEnvelopeRequest, IAuthenticateRecipientViaPasscodeRequest, IAuthenticateRecipientViaEmailRequest, IAuthenticateRecipientViaSMSRequest, IKBAResponse, IAuthenticateRecipientViaKBARequest, TAuthenticateRecipientRequest, DEFAULT_DISCLOSURES, 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, ITemplateSortBy, TTemplateVisibilityFilter, IGetTemplatesParams, getTemplates, getTemplate, IDocumentFromUri, IDocumentFromData, ITemplateCreateParams, createTemplate, duplicateTemplate, ITemplateCreateFromSharepointParams, createTemplateFromSharepoint, updateTemplate, deleteTemplate, toggleTemplateStar, createTemplateDocument, deleteTemplateDocument, getTemplateDocument, downloadTemplateDocument, getTemplateDocumentDownloadLink, getTemplateDocumentPreviewLink, getTemplateDocumentFile, getTemplateDocumentThumbnail, getTemplateDocumentPageDisplayUri, ITemplateTag, ITag, IStar, ITemplateSearchResult, IValidator, isValidInput, getValidators, 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, downloadEnvelopeDocument, getEnvelopeDocumentDownloadLink, getEnvelopeDocumentPreviewLink, cancelEnvelope, getEnvelopeFile, updateEnvelope, updateEnvelopeField, uploadEnvelopeFieldAttachment, deleteEnvelopeFieldAttachment, getEnvelopeDocumentPageDisplayUri, ITimeRange, IListEnvelopesParams, getEnvelopes, getEnvelopesZip, isFieldFilled, isFieldValid, createInitials, IRecipientKbaStepNone, IRecipientKbaStepComplete, IRecipientKbaStepPin, IRecipientKbaStepIdentity, IRecipientKbaStepChallenge, IRecipientKbaStepFailed, TRecipientKbaStep, getKbaStep, submitKbaPin, IKbaIdentity, submitKbaIdentity, IKbaChallengeResponse, submitKbaChallengeResponse, envelopeRecipientAgree, envelopeRecipientDecline, envelopeRecipientSubmit, startSigningSession, getInPersonLink, verifySigner, delegateRecipient, updateRecipient, remindRecipient, resetRecipient, askQuestion, isEnvelopeOwner, isEnvelopeRecipient, canAccessEnvelope, userIsEnvelopeOwner, userIsEnvelopeRecipient, useCanAccessEnvelope, envelopeIsActive, envelopeIsComplete, userCanCancelEnvelope, userCanFinishEnvelope, recipientHasAction, getRecipientsWithActions, recipientCanAct, userCanAct, userCanSignNow, getNextRecipient, createSignature, IEnvelopesSearchResult, IDocumentSearchOptions, ICreateEnvelopeRecipientFromTemplate, ICreateEnvelopeRecipientDirectly, ISignerTokenResponse, IInPersonLinkResponse, IUpdateRecipientStatus, ICreateEnvelopeReminderRequest, IUpdateRecipientParams, ICreateEnvelopeDocumentFromData, ICreateEnvelopeDocumentFromUri, ICreateEnvelopeDocumentFromFile, ICreateEnvelopeFieldFromTemplate, ICreateEnvelopeFieldDirectly, ICreateEnvelopeFromTemplateRequest, ICreateEnvelopeDirectlyRequest, TCreateEnvelopeRequest, IAuthenticateRecipientViaPasscodeRequest, IAuthenticateRecipientViaEmailRequest, IAuthenticateRecipientViaSMSRequest, IKBAResponse, IAuthenticateRecipientViaKBARequest, TAuthenticateRecipientRequest, DEFAULT_DISCLOSURES, 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, rotateWebhookSecret, 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, ITemplateSortBy, TTemplateVisibilityFilter, IGetTemplatesParams, getTemplates, getTemplate, IDocumentFromUri, IDocumentFromData, ITemplateCreateParams, createTemplate, duplicateTemplate, ITemplateCreateFromSharepointParams, createTemplateFromSharepoint, updateTemplate, deleteTemplate, toggleTemplateStar, createTemplateDocument, deleteTemplateDocument, getTemplateDocument, downloadTemplateDocument, getTemplateDocumentDownloadLink, getTemplateDocumentPreviewLink, getTemplateDocumentFile, getTemplateDocumentThumbnail, getTemplateDocumentPageDisplayUri, ITemplateTag, ITag, IStar, ITemplateSearchResult, IValidator, isValidInput, getValidators, 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
@@ -433,6 +433,7 @@ interface IWebhook {
433
433
  id: string;
434
434
  organization_id: string;
435
435
  url: string;
436
+ secret_key?: string;
436
437
  active: boolean;
437
438
  events: IWebhookEvents;
438
439
  status: string | null;
@@ -3122,6 +3123,35 @@ declare const getWebhooks: (endpoint: VerdocsEndpoint) => Promise<IWebhook>;
3122
3123
  * @apiSuccess IWebhook . The updated Webhooks config for the caller's organization.
3123
3124
  */
3124
3125
  declare const setWebhooks: (endpoint: VerdocsEndpoint, params: ISetWebhookRequest) => Promise<IWebhook>;
3126
+ /**
3127
+ * Rotate the secret key used to authenticate Webhooks. If a secret key has not yet been set,
3128
+ * it will be created. Until this is done, Webhook calls will not have a signature applied to
3129
+ * their headers. Please note that pending Webhook deliveries will not be affected until the
3130
+ * next Webhook is triggered.
3131
+ *
3132
+ * To authenticate a Webhook call, compute an HMAC-256 hash of the JSON payload `body` field
3133
+ * as follows:
3134
+ *
3135
+ * ```typescript
3136
+ * // NOTE: Hash the `body` field INSIDE the payload. In many frameworks the payload is also called
3137
+ * // `body`, which can be confusing.
3138
+ * const jsonBody = JSON.stringify(req.body.body);
3139
+ * const hash = createHmac('sha256', SECRET_KEY).update(jsonBody).digest('hex');
3140
+ * if (hash !== req.headers['x-webhook-signature']) {
3141
+ * // Handle error here
3142
+ * }
3143
+ *
3144
+ * // It is important to return a 200 status code anyway, to avoid the sender trying to resend
3145
+ * // the same data.
3146
+ * res.status(200).send();
3147
+ * ```
3148
+ *
3149
+ * @group Webhooks
3150
+ * @api PATCH /v2/webhooks Rotate Webhook secret key
3151
+ * @apiDescription Note that Webhooks cannot currently be deleted, but may be easily disabled by setting `active` to `false` and/or setting the `url` to an empty string.
3152
+ * @apiSuccess IWebhook . The updated Webhooks config for the caller's organization, including the secret_key.
3153
+ */
3154
+ declare const rotateWebhookSecret: (endpoint: VerdocsEndpoint) => Promise<IWebhook>;
3125
3155
  declare const canPerformTemplateAction: (profile: IProfile | null | undefined, action: TTemplateAction, template?: ITemplate) => {
3126
3156
  canPerform: boolean;
3127
3157
  message: string;
@@ -3814,4 +3844,4 @@ declare const decodeJWTBody: (token: string) => any;
3814
3844
  * the presence of the `document_id` field, which will only be present for signing sessions.
3815
3845
  */
3816
3846
  declare const decodeAccessTokenBody: (token: string) => TSession;
3817
- 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, downloadEnvelopeDocument, getEnvelopeDocumentDownloadLink, getEnvelopeDocumentPreviewLink, cancelEnvelope, getEnvelopeFile, updateEnvelope, updateEnvelopeField, uploadEnvelopeFieldAttachment, deleteEnvelopeFieldAttachment, getEnvelopeDocumentPageDisplayUri, ITimeRange, IListEnvelopesParams, getEnvelopes, getEnvelopesZip, isFieldFilled, isFieldValid, createInitials, IRecipientKbaStepNone, IRecipientKbaStepComplete, IRecipientKbaStepPin, IRecipientKbaStepIdentity, IRecipientKbaStepChallenge, IRecipientKbaStepFailed, TRecipientKbaStep, getKbaStep, submitKbaPin, IKbaIdentity, submitKbaIdentity, IKbaChallengeResponse, submitKbaChallengeResponse, envelopeRecipientAgree, envelopeRecipientDecline, envelopeRecipientSubmit, startSigningSession, getInPersonLink, verifySigner, delegateRecipient, updateRecipient, remindRecipient, resetRecipient, askQuestion, isEnvelopeOwner, isEnvelopeRecipient, canAccessEnvelope, userIsEnvelopeOwner, userIsEnvelopeRecipient, useCanAccessEnvelope, envelopeIsActive, envelopeIsComplete, userCanCancelEnvelope, userCanFinishEnvelope, recipientHasAction, getRecipientsWithActions, recipientCanAct, userCanAct, userCanSignNow, getNextRecipient, createSignature, IEnvelopesSearchResult, IDocumentSearchOptions, ICreateEnvelopeRecipientFromTemplate, ICreateEnvelopeRecipientDirectly, ISignerTokenResponse, IInPersonLinkResponse, IUpdateRecipientStatus, ICreateEnvelopeReminderRequest, IUpdateRecipientParams, ICreateEnvelopeDocumentFromData, ICreateEnvelopeDocumentFromUri, ICreateEnvelopeDocumentFromFile, ICreateEnvelopeFieldFromTemplate, ICreateEnvelopeFieldDirectly, ICreateEnvelopeFromTemplateRequest, ICreateEnvelopeDirectlyRequest, TCreateEnvelopeRequest, IAuthenticateRecipientViaPasscodeRequest, IAuthenticateRecipientViaEmailRequest, IAuthenticateRecipientViaSMSRequest, IKBAResponse, IAuthenticateRecipientViaKBARequest, TAuthenticateRecipientRequest, DEFAULT_DISCLOSURES, 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, ITemplateSortBy, TTemplateVisibilityFilter, IGetTemplatesParams, getTemplates, getTemplate, IDocumentFromUri, IDocumentFromData, ITemplateCreateParams, createTemplate, duplicateTemplate, ITemplateCreateFromSharepointParams, createTemplateFromSharepoint, updateTemplate, deleteTemplate, toggleTemplateStar, createTemplateDocument, deleteTemplateDocument, getTemplateDocument, downloadTemplateDocument, getTemplateDocumentDownloadLink, getTemplateDocumentPreviewLink, getTemplateDocumentFile, getTemplateDocumentThumbnail, getTemplateDocumentPageDisplayUri, ITemplateTag, ITag, IStar, ITemplateSearchResult, IValidator, isValidInput, getValidators, 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, downloadEnvelopeDocument, getEnvelopeDocumentDownloadLink, getEnvelopeDocumentPreviewLink, cancelEnvelope, getEnvelopeFile, updateEnvelope, updateEnvelopeField, uploadEnvelopeFieldAttachment, deleteEnvelopeFieldAttachment, getEnvelopeDocumentPageDisplayUri, ITimeRange, IListEnvelopesParams, getEnvelopes, getEnvelopesZip, isFieldFilled, isFieldValid, createInitials, IRecipientKbaStepNone, IRecipientKbaStepComplete, IRecipientKbaStepPin, IRecipientKbaStepIdentity, IRecipientKbaStepChallenge, IRecipientKbaStepFailed, TRecipientKbaStep, getKbaStep, submitKbaPin, IKbaIdentity, submitKbaIdentity, IKbaChallengeResponse, submitKbaChallengeResponse, envelopeRecipientAgree, envelopeRecipientDecline, envelopeRecipientSubmit, startSigningSession, getInPersonLink, verifySigner, delegateRecipient, updateRecipient, remindRecipient, resetRecipient, askQuestion, isEnvelopeOwner, isEnvelopeRecipient, canAccessEnvelope, userIsEnvelopeOwner, userIsEnvelopeRecipient, useCanAccessEnvelope, envelopeIsActive, envelopeIsComplete, userCanCancelEnvelope, userCanFinishEnvelope, recipientHasAction, getRecipientsWithActions, recipientCanAct, userCanAct, userCanSignNow, getNextRecipient, createSignature, IEnvelopesSearchResult, IDocumentSearchOptions, ICreateEnvelopeRecipientFromTemplate, ICreateEnvelopeRecipientDirectly, ISignerTokenResponse, IInPersonLinkResponse, IUpdateRecipientStatus, ICreateEnvelopeReminderRequest, IUpdateRecipientParams, ICreateEnvelopeDocumentFromData, ICreateEnvelopeDocumentFromUri, ICreateEnvelopeDocumentFromFile, ICreateEnvelopeFieldFromTemplate, ICreateEnvelopeFieldDirectly, ICreateEnvelopeFromTemplateRequest, ICreateEnvelopeDirectlyRequest, TCreateEnvelopeRequest, IAuthenticateRecipientViaPasscodeRequest, IAuthenticateRecipientViaEmailRequest, IAuthenticateRecipientViaSMSRequest, IKBAResponse, IAuthenticateRecipientViaKBARequest, TAuthenticateRecipientRequest, DEFAULT_DISCLOSURES, 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, rotateWebhookSecret, 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, ITemplateSortBy, TTemplateVisibilityFilter, IGetTemplatesParams, getTemplates, getTemplate, IDocumentFromUri, IDocumentFromData, ITemplateCreateParams, createTemplate, duplicateTemplate, ITemplateCreateFromSharepointParams, createTemplateFromSharepoint, updateTemplate, deleteTemplate, toggleTemplateStar, createTemplateDocument, deleteTemplateDocument, getTemplateDocument, downloadTemplateDocument, getTemplateDocumentDownloadLink, getTemplateDocumentPreviewLink, getTemplateDocumentFile, getTemplateDocumentThumbnail, getTemplateDocumentPageDisplayUri, ITemplateTag, ITag, IStar, ITemplateSearchResult, IValidator, isValidInput, getValidators, 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
@@ -3716,6 +3716,37 @@ const getWebhooks = (endpoint) => endpoint.api //
3716
3716
  const setWebhooks = (endpoint, params) => endpoint.api //
3717
3717
  .patch(`/v2/webhooks`, params)
3718
3718
  .then((r) => r.data);
3719
+ /**
3720
+ * Rotate the secret key used to authenticate Webhooks. If a secret key has not yet been set,
3721
+ * it will be created. Until this is done, Webhook calls will not have a signature applied to
3722
+ * their headers. Please note that pending Webhook deliveries will not be affected until the
3723
+ * next Webhook is triggered.
3724
+ *
3725
+ * To authenticate a Webhook call, compute an HMAC-256 hash of the JSON payload `body` field
3726
+ * as follows:
3727
+ *
3728
+ * ```typescript
3729
+ * // NOTE: Hash the `body` field INSIDE the payload. In many frameworks the payload is also called
3730
+ * // `body`, which can be confusing.
3731
+ * const jsonBody = JSON.stringify(req.body.body);
3732
+ * const hash = createHmac('sha256', SECRET_KEY).update(jsonBody).digest('hex');
3733
+ * if (hash !== req.headers['x-webhook-signature']) {
3734
+ * // Handle error here
3735
+ * }
3736
+ *
3737
+ * // It is important to return a 200 status code anyway, to avoid the sender trying to resend
3738
+ * // the same data.
3739
+ * res.status(200).send();
3740
+ * ```
3741
+ *
3742
+ * @group Webhooks
3743
+ * @api PATCH /v2/webhooks Rotate Webhook secret key
3744
+ * @apiDescription Note that Webhooks cannot currently be deleted, but may be easily disabled by setting `active` to `false` and/or setting the `url` to an empty string.
3745
+ * @apiSuccess IWebhook . The updated Webhooks config for the caller's organization, including the secret_key.
3746
+ */
3747
+ const rotateWebhookSecret = (endpoint) => endpoint.api //
3748
+ .put(`/v2/webhooks/rotate-secret`)
3749
+ .then((r) => r.data);
3719
3750
 
3720
3751
  exports.ALL_PERMISSIONS = ALL_PERMISSIONS;
3721
3752
  exports.AtoB = AtoB;
@@ -3863,6 +3894,7 @@ exports.resendVerification = resendVerification;
3863
3894
  exports.resetPassword = resetPassword;
3864
3895
  exports.resetRecipient = resetRecipient;
3865
3896
  exports.rotateApiKey = rotateApiKey;
3897
+ exports.rotateWebhookSecret = rotateWebhookSecret;
3866
3898
  exports.setWebhooks = setWebhooks;
3867
3899
  exports.sortFields = sortFields;
3868
3900
  exports.startSigningSession = startSigningSession;