@verdocs/js-sdk 4.2.40 → 4.2.41

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
@@ -496,11 +496,6 @@ interface IEnvelopeDocument {
496
496
  mime: string;
497
497
  created_at: string;
498
498
  updated_at: string;
499
- // @deprecated. Use pages instead.
500
- page_numbers: number;
501
- envelope?: IEnvelope | null;
502
- template_document?: ITemplateDocument | null;
503
- fields?: IEnvelopeField[];
504
499
  }
505
500
  interface IDropdownOption {
506
501
  label: string;
@@ -1121,23 +1116,6 @@ interface IEnvelopesSearchResult {
1121
1116
  total: number;
1122
1117
  result: IEnvelope[];
1123
1118
  }
1124
- interface IEnvelopesSummary {
1125
- action_required: {
1126
- page: number;
1127
- total: number;
1128
- result: IEnvelope[];
1129
- };
1130
- completed: {
1131
- page: number;
1132
- total: number;
1133
- result: IEnvelope[];
1134
- };
1135
- waiting_others: {
1136
- page: number;
1137
- total: number;
1138
- result: IEnvelope[];
1139
- };
1140
- }
1141
1119
  interface IDocumentSearchOptions {
1142
1120
  rows?: number;
1143
1121
  page?: number;
@@ -1148,7 +1126,7 @@ interface IDocumentSearchOptions {
1148
1126
  envelope_status?: TEnvelopeStatus[];
1149
1127
  recipient_status?: TEnvelopeStatus[];
1150
1128
  }
1151
- interface ICreateEnvelopeRole {
1129
+ interface ICreateEnvelopeRecipient {
1152
1130
  /** The type of role to create. Most participants in standard flows will be "signer" recipients. */
1153
1131
  type: TRecipientType;
1154
1132
  /**
@@ -1156,8 +1134,9 @@ interface ICreateEnvelopeRole {
1156
1134
  * 'Recipient 1', 'Seller', etc. This must match one of the pre-defined roles in the template's Recipients list.
1157
1135
  */
1158
1136
  name: string;
1159
- /** The full name of the recipient as it will be displayed in reports and queries, e.g. 'Paige Turner'. */
1160
- full_name: string;
1137
+ /** The name of the recipient as it will be displayed in reports and queries, e.g. 'Paige Turner'. */
1138
+ first_name: string;
1139
+ last_name: string;
1161
1140
  /** The email address of the recipient. One of `email` or `phone` must be provided. */
1162
1141
  email?: string;
1163
1142
  /**
@@ -1166,22 +1145,25 @@ interface ICreateEnvelopeRole {
1166
1145
  */
1167
1146
  phone?: string;
1168
1147
  /**
1169
- * The 1-based sequence number for the recipient. This can be used to override the template's workflow. Recipients
1170
- * are processed in parallel for each matching sequence number (e.g. all recipients at level "1" may act in parallel)
1171
- * and in series between sequence numbers (e.g. all recipients at level "1" must complete their tasks before
1172
- * recipients at level "2" may act).
1148
+ * The 1-based sequence number for the recipient. This can be used to override the template's workflow. Recipients
1149
+ * are processed in parallel for each matching sequence number (e.g. all recipients at level "1" may act in parallel)
1150
+ * and in series between sequence numbers (e.g. all recipients at level "1" must complete their tasks before
1151
+ * recipients at level "2" may act).
1173
1152
  */
1174
1153
  sequence: number;
1154
+ /**
1155
+ * The 1-based order within the sequence for the recipient. Recipients at the same sequence act in parallel, so
1156
+ * this is only for display purposes.
1157
+ */
1158
+ order: number;
1175
1159
  /** Whether the recipient may delegate their tasks to others. Should be false for most standard workflows. */
1176
- delegator: boolean;
1160
+ delegator?: boolean;
1177
1161
  /** A custom message to include in the email or SMS invitation. May be left blank for a default message. */
1178
- message: string;
1179
- }
1180
- interface IEnvelopeSummaries {
1181
- page: number;
1182
- count: number;
1183
- total: number;
1184
- records: IEnvelope[];
1162
+ message?: string;
1163
+ /** To enable KBA for the recipient, set to 'pin' or 'identity'. */
1164
+ kba_method?: "pin" | "identity" | null;
1165
+ /** If PIN-based KBA is used, the PIN to challenge the user to enter. */
1166
+ kba_pin?: string;
1185
1167
  }
1186
1168
  interface IInPersonLinkResponse {
1187
1169
  link: string;
@@ -1224,16 +1206,26 @@ interface ICreateEnvelopeReminderRequest {
1224
1206
  setup_time: number;
1225
1207
  interval_time: number;
1226
1208
  }
1227
- interface ICreateEnvelopeRequest {
1209
+ interface ICreateEnvelopeFromTemplateRequest {
1228
1210
  template_id: string;
1229
- roles: ICreateEnvelopeRole[];
1211
+ recipients: ICreateEnvelopeRecipient[];
1230
1212
  name: string;
1213
+ description?: string;
1214
+ fields?: Pick<IEnvelopeField, "name" | "recipient_role" | "default">[];
1231
1215
  environment?: string;
1232
- prepared_fields?: {
1233
- name: string;
1234
- value: string;
1235
- }[];
1216
+ no_contact?: boolean;
1236
1217
  }
1218
+ interface ICreateEnvelopeDirectlyRequest {
1219
+ name: string;
1220
+ description?: string;
1221
+ visiblity?: "private" | "shared";
1222
+ recipients: ICreateEnvelopeRecipient[];
1223
+ documents: IEnvelopeDocument[];
1224
+ fields: Pick<IEnvelopeField, "name" | "recipient_role" | "default">[];
1225
+ environment?: string;
1226
+ no_contact?: boolean;
1227
+ }
1228
+ type TCreateEnvelopeRequest = ICreateEnvelopeFromTemplateRequest | ICreateEnvelopeDirectlyRequest;
1237
1229
  /**
1238
1230
  * Create an envelope
1239
1231
  *
@@ -1266,17 +1258,7 @@ interface ICreateEnvelopeRequest {
1266
1258
  * const {id, recipients} = await Envelopes.createEnvelope(VerdocsEndpoint.getDefault(), request);
1267
1259
  * ```
1268
1260
  */
1269
- declare const createEnvelope: (endpoint: VerdocsEndpoint, request: ICreateEnvelopeRequest) => Promise<IEnvelope>;
1270
- /**
1271
- * Get a summary of currently active envelopes.
1272
- *
1273
- * ```typescript
1274
- * import {getEnvelopesSummary} from '@verdocs/js-sdk/Envelopes';
1275
- *
1276
- * const {action_required, completed, waiting_on_others} = await getEnvelopesSummary(VerdocsEndpoint.getDefault());
1277
- * ```
1278
- */
1279
- declare const getEnvelopesSummary: (endpoint: VerdocsEndpoint, page: number) => Promise<IEnvelopesSummary>;
1261
+ declare const createEnvelope: (endpoint: VerdocsEndpoint, request: TCreateEnvelopeRequest) => Promise<IEnvelope>;
1280
1262
  /**
1281
1263
  * Get the list of recipients for an Envelope.
1282
1264
  */
@@ -2660,4 +2642,4 @@ declare const decodeJWTBody: (token: string) => any;
2660
2642
  * the presence of the `document_id` field, which will only be present for signing sessions.
2661
2643
  */
2662
2644
  declare const decodeAccessTokenBody: (token: string) => TSession;
2663
- export { TRequestStatus, TTemplateSenderType, TTemplateAction, TRecipientAction, TEnvelopeStatus, TRecipientStatus, TRecipientType, TSortTemplateBy, TAccessKeyType, TApiKeyPermission, THistoryEvent, TEventDetail, TEnvelopeUpdateResult, TFieldType, FIELD_TYPES, DEFAULT_FIELD_WIDTHS, DEFAULT_FIELD_HEIGHTS, IChannel, IDisabledChannel, INotification, IApiKey, IGroup, IGroupProfile, IOAuth2App, IOrganization, IOrganizationInvitation, IPendingWebhook, IProfile, IUser, IWebhookEvents, IWebhook, IInPersonAccessKey, IInAppAccessKey, IEmailAccessKey, ISMSAccessKey, TAccessKey, IEnvelope, IEnvelopeDocument, IDropdownOption, IEnvelopeField, IEnvelopeFieldOptions, IEnvelopeFieldSettings, IEnvelopeHistory, IInitial, IKbaPINRequired, IRecipient, IReminder, IRole, ISignature, ITemplate, ITemplateDocument, ITemplateField, ITextFieldSetting, ITemplateFieldSetting, TEnvironment, TSessionChangedListener, VerdocsEndpointOptions, VerdocsEndpoint, createEnvelope, getEnvelopesSummary, getEnvelopeRecipients, getEnvelope, getEnvelopeDocument, getDocumentDownloadLink, getDocumentPreviewLink, cancelEnvelope, getEnvelopeFile, updateEnvelopeField, updateEnvelopeFieldSignature, updateEnvelopeFieldInitials, uploadEnvelopeFieldAttachment, deleteEnvelopeFieldAttachment, getFieldAttachment, getEnvelopeDocumentPageDisplayUri, ITimeRange, IListEnvelopesParams, getEnvelopes, createInitials, IRecipientKbaStepNone, IRecipientKbaStepComplete, IRecipientKbaStepPin, IRecipientKbaStepIdentity, IRecipientKbaStepChallenge, IRecipientKbaStepFailed, TRecipientKbaStep, getKbaStep, submitKbaPin, IKbaIdentity, submitKbaIdentity, IKbaChallengeResponse, submitKbaChallengeResponse, updateRecipient, envelopeRecipientSubmit, envelopeRecipientDecline, envelopeRecipientChangeOwner, envelopeRecipientAgree, envelopeRecipientUpdateName, envelopeRecipientPrepare, ISignerTokenResponse, getSigningSession, getSignerToken, getInPersonLink, sendDelegate, resendInvitation, createEnvelopeReminder, getEnvelopeReminder, updateEnvelopeReminder, deleteEnvelopeReminder, userIsEnvelopeOwner, userIsEnvelopeRecipient, envelopeIsActive, envelopeIsComplete, userCanCancelEnvelope, userCanFinishEnvelope, recipientHasAction, getRecipientsWithActions, recipientCanAct, userCanAct, userCanSignNow, getNextRecipient, createSignature, getSignatures, getSignature, deleteSignature, IEnvelopesSearchResult, IEnvelopesSummary, IDocumentSearchOptions, ICreateEnvelopeRole, IEnvelopeSummaries, IInPersonLinkResponse, IUpdateRecipientSubmitParams, IUpdateRecipientDeclineParams, IUpdateRecipientClaimEnvelope, IUpdateRecipientStatus, IUpdateRecipientAgreedParams, IUpdateRecipientNameParams, IUpdateRecipientPrepareParams, ICreateEnvelopeReminderRequest, ICreateEnvelopeRequest, getApiKeys, createApiKey, rotateApiKey, updateApiKey, deleteApiKey, getGroups, getGroup, createGroup, addGroupMember, deleteGroupMember, updateGroup, getOrganizationInvitations, createOrganizationInvitation, deleteOrganizationInvitation, updateOrganizationInvitation, resendOrganizationInvitation, getOrganizationInvitation, acceptOrganizationInvitation, declineOrganizationInvitation, getOrganizationMembers, deleteOrganizationMember, updateOrganizationMember, getOrganization, updateOrganization, updateOrganizationLogo, updateOrganizationThumbnail, 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, ICreateTemplateReminderRequest, createTemplateReminder, getTemplateReminder, updateTemplateReminder, deleteTemplateReminder, createTemplateRole, updateTemplateRole, deleteTemplateRole, getStars, toggleStar, addTemplateTag, getTemplateTags, deleteTemplateTag, createTag, getTag, getAllTags, ITemplateSortBy, IGetTemplatesParams, getTemplates, getTemplate, IDocumentFromUri, IDocumentFromData, ITemplateCreateParams, createTemplate, 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, getRTop, getRLeft, getRValue, blobToBase64, rescale, fileToDataUrl, downloadBlob, Countries, getCountryByCode, isFrenchGuiana, isGuadeloupe, isMartinique, isMayotte, getPlusOneCountry, isCanada, isAmericanSamoa, isDominicanRepublic, isPuertoRico, getMatchingCountry, integerSequence, formatFullName, formatInitials, fullNameToInitials, capitalize, convertToE164, AtoB, decodeJWTBody, decodeAccessTokenBody, IFileWithData, ICountry };
2645
+ export { TRequestStatus, TTemplateSenderType, TTemplateAction, TRecipientAction, TEnvelopeStatus, TRecipientStatus, TRecipientType, TSortTemplateBy, TAccessKeyType, TApiKeyPermission, THistoryEvent, TEventDetail, TEnvelopeUpdateResult, TFieldType, FIELD_TYPES, DEFAULT_FIELD_WIDTHS, DEFAULT_FIELD_HEIGHTS, IChannel, IDisabledChannel, INotification, IApiKey, IGroup, IGroupProfile, IOAuth2App, IOrganization, IOrganizationInvitation, IPendingWebhook, IProfile, IUser, IWebhookEvents, IWebhook, IInPersonAccessKey, IInAppAccessKey, IEmailAccessKey, ISMSAccessKey, TAccessKey, IEnvelope, IEnvelopeDocument, IDropdownOption, IEnvelopeField, IEnvelopeFieldOptions, IEnvelopeFieldSettings, IEnvelopeHistory, IInitial, IKbaPINRequired, IRecipient, IReminder, IRole, ISignature, ITemplate, ITemplateDocument, ITemplateField, ITextFieldSetting, ITemplateFieldSetting, TEnvironment, TSessionChangedListener, VerdocsEndpointOptions, VerdocsEndpoint, createEnvelope, getEnvelopeRecipients, getEnvelope, getEnvelopeDocument, getDocumentDownloadLink, getDocumentPreviewLink, cancelEnvelope, getEnvelopeFile, updateEnvelopeField, updateEnvelopeFieldSignature, updateEnvelopeFieldInitials, uploadEnvelopeFieldAttachment, deleteEnvelopeFieldAttachment, getFieldAttachment, getEnvelopeDocumentPageDisplayUri, ITimeRange, IListEnvelopesParams, getEnvelopes, createInitials, IRecipientKbaStepNone, IRecipientKbaStepComplete, IRecipientKbaStepPin, IRecipientKbaStepIdentity, IRecipientKbaStepChallenge, IRecipientKbaStepFailed, TRecipientKbaStep, getKbaStep, submitKbaPin, IKbaIdentity, submitKbaIdentity, IKbaChallengeResponse, submitKbaChallengeResponse, updateRecipient, envelopeRecipientSubmit, envelopeRecipientDecline, envelopeRecipientChangeOwner, envelopeRecipientAgree, envelopeRecipientUpdateName, envelopeRecipientPrepare, ISignerTokenResponse, getSigningSession, getSignerToken, getInPersonLink, sendDelegate, resendInvitation, createEnvelopeReminder, getEnvelopeReminder, updateEnvelopeReminder, deleteEnvelopeReminder, userIsEnvelopeOwner, userIsEnvelopeRecipient, envelopeIsActive, envelopeIsComplete, userCanCancelEnvelope, userCanFinishEnvelope, recipientHasAction, getRecipientsWithActions, recipientCanAct, userCanAct, userCanSignNow, getNextRecipient, createSignature, getSignatures, getSignature, deleteSignature, IEnvelopesSearchResult, IDocumentSearchOptions, ICreateEnvelopeRecipient, IInPersonLinkResponse, IUpdateRecipientSubmitParams, IUpdateRecipientDeclineParams, IUpdateRecipientClaimEnvelope, IUpdateRecipientStatus, IUpdateRecipientAgreedParams, IUpdateRecipientNameParams, IUpdateRecipientPrepareParams, ICreateEnvelopeReminderRequest, ICreateEnvelopeFromTemplateRequest, ICreateEnvelopeDirectlyRequest, TCreateEnvelopeRequest, getApiKeys, createApiKey, rotateApiKey, updateApiKey, deleteApiKey, getGroups, getGroup, createGroup, addGroupMember, deleteGroupMember, updateGroup, getOrganizationInvitations, createOrganizationInvitation, deleteOrganizationInvitation, updateOrganizationInvitation, resendOrganizationInvitation, getOrganizationInvitation, acceptOrganizationInvitation, declineOrganizationInvitation, getOrganizationMembers, deleteOrganizationMember, updateOrganizationMember, getOrganization, updateOrganization, updateOrganizationLogo, updateOrganizationThumbnail, 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, ICreateTemplateReminderRequest, createTemplateReminder, getTemplateReminder, updateTemplateReminder, deleteTemplateReminder, createTemplateRole, updateTemplateRole, deleteTemplateRole, getStars, toggleStar, addTemplateTag, getTemplateTags, deleteTemplateTag, createTag, getTag, getAllTags, ITemplateSortBy, IGetTemplatesParams, getTemplates, getTemplate, IDocumentFromUri, IDocumentFromData, ITemplateCreateParams, createTemplate, 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, getRTop, getRLeft, getRValue, blobToBase64, rescale, fileToDataUrl, downloadBlob, Countries, getCountryByCode, isFrenchGuiana, isGuadeloupe, isMartinique, isMayotte, getPlusOneCountry, isCanada, isAmericanSamoa, isDominicanRepublic, isPuertoRico, getMatchingCountry, integerSequence, formatFullName, formatInitials, fullNameToInitials, capitalize, convertToE164, AtoB, decodeJWTBody, decodeAccessTokenBody, IFileWithData, ICountry };
package/dist/index.d.ts CHANGED
@@ -496,11 +496,6 @@ interface IEnvelopeDocument {
496
496
  mime: string;
497
497
  created_at: string;
498
498
  updated_at: string;
499
- // @deprecated. Use pages instead.
500
- page_numbers: number;
501
- envelope?: IEnvelope | null;
502
- template_document?: ITemplateDocument | null;
503
- fields?: IEnvelopeField[];
504
499
  }
505
500
  interface IDropdownOption {
506
501
  label: string;
@@ -1121,23 +1116,6 @@ interface IEnvelopesSearchResult {
1121
1116
  total: number;
1122
1117
  result: IEnvelope[];
1123
1118
  }
1124
- interface IEnvelopesSummary {
1125
- action_required: {
1126
- page: number;
1127
- total: number;
1128
- result: IEnvelope[];
1129
- };
1130
- completed: {
1131
- page: number;
1132
- total: number;
1133
- result: IEnvelope[];
1134
- };
1135
- waiting_others: {
1136
- page: number;
1137
- total: number;
1138
- result: IEnvelope[];
1139
- };
1140
- }
1141
1119
  interface IDocumentSearchOptions {
1142
1120
  rows?: number;
1143
1121
  page?: number;
@@ -1148,7 +1126,7 @@ interface IDocumentSearchOptions {
1148
1126
  envelope_status?: TEnvelopeStatus[];
1149
1127
  recipient_status?: TEnvelopeStatus[];
1150
1128
  }
1151
- interface ICreateEnvelopeRole {
1129
+ interface ICreateEnvelopeRecipient {
1152
1130
  /** The type of role to create. Most participants in standard flows will be "signer" recipients. */
1153
1131
  type: TRecipientType;
1154
1132
  /**
@@ -1156,8 +1134,9 @@ interface ICreateEnvelopeRole {
1156
1134
  * 'Recipient 1', 'Seller', etc. This must match one of the pre-defined roles in the template's Recipients list.
1157
1135
  */
1158
1136
  name: string;
1159
- /** The full name of the recipient as it will be displayed in reports and queries, e.g. 'Paige Turner'. */
1160
- full_name: string;
1137
+ /** The name of the recipient as it will be displayed in reports and queries, e.g. 'Paige Turner'. */
1138
+ first_name: string;
1139
+ last_name: string;
1161
1140
  /** The email address of the recipient. One of `email` or `phone` must be provided. */
1162
1141
  email?: string;
1163
1142
  /**
@@ -1166,22 +1145,25 @@ interface ICreateEnvelopeRole {
1166
1145
  */
1167
1146
  phone?: string;
1168
1147
  /**
1169
- * The 1-based sequence number for the recipient. This can be used to override the template's workflow. Recipients
1170
- * are processed in parallel for each matching sequence number (e.g. all recipients at level "1" may act in parallel)
1171
- * and in series between sequence numbers (e.g. all recipients at level "1" must complete their tasks before
1172
- * recipients at level "2" may act).
1148
+ * The 1-based sequence number for the recipient. This can be used to override the template's workflow. Recipients
1149
+ * are processed in parallel for each matching sequence number (e.g. all recipients at level "1" may act in parallel)
1150
+ * and in series between sequence numbers (e.g. all recipients at level "1" must complete their tasks before
1151
+ * recipients at level "2" may act).
1173
1152
  */
1174
1153
  sequence: number;
1154
+ /**
1155
+ * The 1-based order within the sequence for the recipient. Recipients at the same sequence act in parallel, so
1156
+ * this is only for display purposes.
1157
+ */
1158
+ order: number;
1175
1159
  /** Whether the recipient may delegate their tasks to others. Should be false for most standard workflows. */
1176
- delegator: boolean;
1160
+ delegator?: boolean;
1177
1161
  /** A custom message to include in the email or SMS invitation. May be left blank for a default message. */
1178
- message: string;
1179
- }
1180
- interface IEnvelopeSummaries {
1181
- page: number;
1182
- count: number;
1183
- total: number;
1184
- records: IEnvelope[];
1162
+ message?: string;
1163
+ /** To enable KBA for the recipient, set to 'pin' or 'identity'. */
1164
+ kba_method?: "pin" | "identity" | null;
1165
+ /** If PIN-based KBA is used, the PIN to challenge the user to enter. */
1166
+ kba_pin?: string;
1185
1167
  }
1186
1168
  interface IInPersonLinkResponse {
1187
1169
  link: string;
@@ -1224,16 +1206,26 @@ interface ICreateEnvelopeReminderRequest {
1224
1206
  setup_time: number;
1225
1207
  interval_time: number;
1226
1208
  }
1227
- interface ICreateEnvelopeRequest {
1209
+ interface ICreateEnvelopeFromTemplateRequest {
1228
1210
  template_id: string;
1229
- roles: ICreateEnvelopeRole[];
1211
+ recipients: ICreateEnvelopeRecipient[];
1230
1212
  name: string;
1213
+ description?: string;
1214
+ fields?: Pick<IEnvelopeField, "name" | "recipient_role" | "default">[];
1231
1215
  environment?: string;
1232
- prepared_fields?: {
1233
- name: string;
1234
- value: string;
1235
- }[];
1216
+ no_contact?: boolean;
1236
1217
  }
1218
+ interface ICreateEnvelopeDirectlyRequest {
1219
+ name: string;
1220
+ description?: string;
1221
+ visiblity?: "private" | "shared";
1222
+ recipients: ICreateEnvelopeRecipient[];
1223
+ documents: IEnvelopeDocument[];
1224
+ fields: Pick<IEnvelopeField, "name" | "recipient_role" | "default">[];
1225
+ environment?: string;
1226
+ no_contact?: boolean;
1227
+ }
1228
+ type TCreateEnvelopeRequest = ICreateEnvelopeFromTemplateRequest | ICreateEnvelopeDirectlyRequest;
1237
1229
  /**
1238
1230
  * Create an envelope
1239
1231
  *
@@ -1266,17 +1258,7 @@ interface ICreateEnvelopeRequest {
1266
1258
  * const {id, recipients} = await Envelopes.createEnvelope(VerdocsEndpoint.getDefault(), request);
1267
1259
  * ```
1268
1260
  */
1269
- declare const createEnvelope: (endpoint: VerdocsEndpoint, request: ICreateEnvelopeRequest) => Promise<IEnvelope>;
1270
- /**
1271
- * Get a summary of currently active envelopes.
1272
- *
1273
- * ```typescript
1274
- * import {getEnvelopesSummary} from '@verdocs/js-sdk/Envelopes';
1275
- *
1276
- * const {action_required, completed, waiting_on_others} = await getEnvelopesSummary(VerdocsEndpoint.getDefault());
1277
- * ```
1278
- */
1279
- declare const getEnvelopesSummary: (endpoint: VerdocsEndpoint, page: number) => Promise<IEnvelopesSummary>;
1261
+ declare const createEnvelope: (endpoint: VerdocsEndpoint, request: TCreateEnvelopeRequest) => Promise<IEnvelope>;
1280
1262
  /**
1281
1263
  * Get the list of recipients for an Envelope.
1282
1264
  */
@@ -2660,4 +2642,4 @@ declare const decodeJWTBody: (token: string) => any;
2660
2642
  * the presence of the `document_id` field, which will only be present for signing sessions.
2661
2643
  */
2662
2644
  declare const decodeAccessTokenBody: (token: string) => TSession;
2663
- export { TRequestStatus, TTemplateSenderType, TTemplateAction, TRecipientAction, TEnvelopeStatus, TRecipientStatus, TRecipientType, TSortTemplateBy, TAccessKeyType, TApiKeyPermission, THistoryEvent, TEventDetail, TEnvelopeUpdateResult, TFieldType, FIELD_TYPES, DEFAULT_FIELD_WIDTHS, DEFAULT_FIELD_HEIGHTS, IChannel, IDisabledChannel, INotification, IApiKey, IGroup, IGroupProfile, IOAuth2App, IOrganization, IOrganizationInvitation, IPendingWebhook, IProfile, IUser, IWebhookEvents, IWebhook, IInPersonAccessKey, IInAppAccessKey, IEmailAccessKey, ISMSAccessKey, TAccessKey, IEnvelope, IEnvelopeDocument, IDropdownOption, IEnvelopeField, IEnvelopeFieldOptions, IEnvelopeFieldSettings, IEnvelopeHistory, IInitial, IKbaPINRequired, IRecipient, IReminder, IRole, ISignature, ITemplate, ITemplateDocument, ITemplateField, ITextFieldSetting, ITemplateFieldSetting, TEnvironment, TSessionChangedListener, VerdocsEndpointOptions, VerdocsEndpoint, createEnvelope, getEnvelopesSummary, getEnvelopeRecipients, getEnvelope, getEnvelopeDocument, getDocumentDownloadLink, getDocumentPreviewLink, cancelEnvelope, getEnvelopeFile, updateEnvelopeField, updateEnvelopeFieldSignature, updateEnvelopeFieldInitials, uploadEnvelopeFieldAttachment, deleteEnvelopeFieldAttachment, getFieldAttachment, getEnvelopeDocumentPageDisplayUri, ITimeRange, IListEnvelopesParams, getEnvelopes, createInitials, IRecipientKbaStepNone, IRecipientKbaStepComplete, IRecipientKbaStepPin, IRecipientKbaStepIdentity, IRecipientKbaStepChallenge, IRecipientKbaStepFailed, TRecipientKbaStep, getKbaStep, submitKbaPin, IKbaIdentity, submitKbaIdentity, IKbaChallengeResponse, submitKbaChallengeResponse, updateRecipient, envelopeRecipientSubmit, envelopeRecipientDecline, envelopeRecipientChangeOwner, envelopeRecipientAgree, envelopeRecipientUpdateName, envelopeRecipientPrepare, ISignerTokenResponse, getSigningSession, getSignerToken, getInPersonLink, sendDelegate, resendInvitation, createEnvelopeReminder, getEnvelopeReminder, updateEnvelopeReminder, deleteEnvelopeReminder, userIsEnvelopeOwner, userIsEnvelopeRecipient, envelopeIsActive, envelopeIsComplete, userCanCancelEnvelope, userCanFinishEnvelope, recipientHasAction, getRecipientsWithActions, recipientCanAct, userCanAct, userCanSignNow, getNextRecipient, createSignature, getSignatures, getSignature, deleteSignature, IEnvelopesSearchResult, IEnvelopesSummary, IDocumentSearchOptions, ICreateEnvelopeRole, IEnvelopeSummaries, IInPersonLinkResponse, IUpdateRecipientSubmitParams, IUpdateRecipientDeclineParams, IUpdateRecipientClaimEnvelope, IUpdateRecipientStatus, IUpdateRecipientAgreedParams, IUpdateRecipientNameParams, IUpdateRecipientPrepareParams, ICreateEnvelopeReminderRequest, ICreateEnvelopeRequest, getApiKeys, createApiKey, rotateApiKey, updateApiKey, deleteApiKey, getGroups, getGroup, createGroup, addGroupMember, deleteGroupMember, updateGroup, getOrganizationInvitations, createOrganizationInvitation, deleteOrganizationInvitation, updateOrganizationInvitation, resendOrganizationInvitation, getOrganizationInvitation, acceptOrganizationInvitation, declineOrganizationInvitation, getOrganizationMembers, deleteOrganizationMember, updateOrganizationMember, getOrganization, updateOrganization, updateOrganizationLogo, updateOrganizationThumbnail, 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, ICreateTemplateReminderRequest, createTemplateReminder, getTemplateReminder, updateTemplateReminder, deleteTemplateReminder, createTemplateRole, updateTemplateRole, deleteTemplateRole, getStars, toggleStar, addTemplateTag, getTemplateTags, deleteTemplateTag, createTag, getTag, getAllTags, ITemplateSortBy, IGetTemplatesParams, getTemplates, getTemplate, IDocumentFromUri, IDocumentFromData, ITemplateCreateParams, createTemplate, 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, getRTop, getRLeft, getRValue, blobToBase64, rescale, fileToDataUrl, downloadBlob, Countries, getCountryByCode, isFrenchGuiana, isGuadeloupe, isMartinique, isMayotte, getPlusOneCountry, isCanada, isAmericanSamoa, isDominicanRepublic, isPuertoRico, getMatchingCountry, integerSequence, formatFullName, formatInitials, fullNameToInitials, capitalize, convertToE164, AtoB, decodeJWTBody, decodeAccessTokenBody, IFileWithData, ICountry };
2645
+ export { TRequestStatus, TTemplateSenderType, TTemplateAction, TRecipientAction, TEnvelopeStatus, TRecipientStatus, TRecipientType, TSortTemplateBy, TAccessKeyType, TApiKeyPermission, THistoryEvent, TEventDetail, TEnvelopeUpdateResult, TFieldType, FIELD_TYPES, DEFAULT_FIELD_WIDTHS, DEFAULT_FIELD_HEIGHTS, IChannel, IDisabledChannel, INotification, IApiKey, IGroup, IGroupProfile, IOAuth2App, IOrganization, IOrganizationInvitation, IPendingWebhook, IProfile, IUser, IWebhookEvents, IWebhook, IInPersonAccessKey, IInAppAccessKey, IEmailAccessKey, ISMSAccessKey, TAccessKey, IEnvelope, IEnvelopeDocument, IDropdownOption, IEnvelopeField, IEnvelopeFieldOptions, IEnvelopeFieldSettings, IEnvelopeHistory, IInitial, IKbaPINRequired, IRecipient, IReminder, IRole, ISignature, ITemplate, ITemplateDocument, ITemplateField, ITextFieldSetting, ITemplateFieldSetting, TEnvironment, TSessionChangedListener, VerdocsEndpointOptions, VerdocsEndpoint, createEnvelope, getEnvelopeRecipients, getEnvelope, getEnvelopeDocument, getDocumentDownloadLink, getDocumentPreviewLink, cancelEnvelope, getEnvelopeFile, updateEnvelopeField, updateEnvelopeFieldSignature, updateEnvelopeFieldInitials, uploadEnvelopeFieldAttachment, deleteEnvelopeFieldAttachment, getFieldAttachment, getEnvelopeDocumentPageDisplayUri, ITimeRange, IListEnvelopesParams, getEnvelopes, createInitials, IRecipientKbaStepNone, IRecipientKbaStepComplete, IRecipientKbaStepPin, IRecipientKbaStepIdentity, IRecipientKbaStepChallenge, IRecipientKbaStepFailed, TRecipientKbaStep, getKbaStep, submitKbaPin, IKbaIdentity, submitKbaIdentity, IKbaChallengeResponse, submitKbaChallengeResponse, updateRecipient, envelopeRecipientSubmit, envelopeRecipientDecline, envelopeRecipientChangeOwner, envelopeRecipientAgree, envelopeRecipientUpdateName, envelopeRecipientPrepare, ISignerTokenResponse, getSigningSession, getSignerToken, getInPersonLink, sendDelegate, resendInvitation, createEnvelopeReminder, getEnvelopeReminder, updateEnvelopeReminder, deleteEnvelopeReminder, userIsEnvelopeOwner, userIsEnvelopeRecipient, envelopeIsActive, envelopeIsComplete, userCanCancelEnvelope, userCanFinishEnvelope, recipientHasAction, getRecipientsWithActions, recipientCanAct, userCanAct, userCanSignNow, getNextRecipient, createSignature, getSignatures, getSignature, deleteSignature, IEnvelopesSearchResult, IDocumentSearchOptions, ICreateEnvelopeRecipient, IInPersonLinkResponse, IUpdateRecipientSubmitParams, IUpdateRecipientDeclineParams, IUpdateRecipientClaimEnvelope, IUpdateRecipientStatus, IUpdateRecipientAgreedParams, IUpdateRecipientNameParams, IUpdateRecipientPrepareParams, ICreateEnvelopeReminderRequest, ICreateEnvelopeFromTemplateRequest, ICreateEnvelopeDirectlyRequest, TCreateEnvelopeRequest, getApiKeys, createApiKey, rotateApiKey, updateApiKey, deleteApiKey, getGroups, getGroup, createGroup, addGroupMember, deleteGroupMember, updateGroup, getOrganizationInvitations, createOrganizationInvitation, deleteOrganizationInvitation, updateOrganizationInvitation, resendOrganizationInvitation, getOrganizationInvitation, acceptOrganizationInvitation, declineOrganizationInvitation, getOrganizationMembers, deleteOrganizationMember, updateOrganizationMember, getOrganization, updateOrganization, updateOrganizationLogo, updateOrganizationThumbnail, 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, ICreateTemplateReminderRequest, createTemplateReminder, getTemplateReminder, updateTemplateReminder, deleteTemplateReminder, createTemplateRole, updateTemplateRole, deleteTemplateRole, getStars, toggleStar, addTemplateTag, getTemplateTags, deleteTemplateTag, createTag, getTag, getAllTags, ITemplateSortBy, IGetTemplatesParams, getTemplates, getTemplate, IDocumentFromUri, IDocumentFromData, ITemplateCreateParams, createTemplate, 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, getRTop, getRLeft, getRValue, blobToBase64, rescale, fileToDataUrl, downloadBlob, Countries, getCountryByCode, isFrenchGuiana, isGuadeloupe, isMartinique, isMayotte, getPlusOneCountry, isCanada, isAmericanSamoa, isDominicanRepublic, isPuertoRico, getMatchingCountry, integerSequence, formatFullName, formatInitials, fullNameToInitials, capitalize, convertToE164, AtoB, decodeJWTBody, decodeAccessTokenBody, IFileWithData, ICountry };
package/dist/index.js CHANGED
@@ -1391,18 +1391,6 @@ class VerdocsEndpoint {
1391
1391
  const createEnvelope = async (endpoint, request) => endpoint.api //
1392
1392
  .post('/envelopes', request)
1393
1393
  .then((r) => r.data);
1394
- /**
1395
- * Get a summary of currently active envelopes.
1396
- *
1397
- * ```typescript
1398
- * import {getEnvelopesSummary} from '@verdocs/js-sdk/Envelopes';
1399
- *
1400
- * const {action_required, completed, waiting_on_others} = await getEnvelopesSummary(VerdocsEndpoint.getDefault());
1401
- * ```
1402
- */
1403
- const getEnvelopesSummary = async (endpoint, page) => endpoint.api //
1404
- .post('/envelopes/summary', { page })
1405
- .then((r) => r.data);
1406
1394
  /**
1407
1395
  * Get the list of recipients for an Envelope.
1408
1396
  */
@@ -2885,7 +2873,6 @@ exports.getEnvelopeFile = getEnvelopeFile;
2885
2873
  exports.getEnvelopeRecipients = getEnvelopeRecipients;
2886
2874
  exports.getEnvelopeReminder = getEnvelopeReminder;
2887
2875
  exports.getEnvelopes = getEnvelopes;
2888
- exports.getEnvelopesSummary = getEnvelopesSummary;
2889
2876
  exports.getFieldAttachment = getFieldAttachment;
2890
2877
  exports.getFieldsForRole = getFieldsForRole;
2891
2878
  exports.getGroup = getGroup;