@verdocs/js-sdk 4.1.6 → 4.1.8

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
@@ -384,6 +384,9 @@ interface IInitial {
384
384
  deleted_at: string | null;
385
385
  profile?: IProfile;
386
386
  }
387
+ interface IKbaPINRequired {
388
+ type: "pin";
389
+ }
387
390
  interface IRecipient {
388
391
  envelope_id: string;
389
392
  role_name: string;
@@ -417,10 +420,25 @@ interface IRecipient {
417
420
  last_attempt_at: string;
418
421
  /**
419
422
  * If set, "KBA required" will carry through to automatically enable the same setting in Envelopes
420
- * created from this template.
423
+ * created from this template. For privacy reasons, this field will only be visible to the creator
424
+ * of the envelope and the recipient referenced.
425
+ */
426
+ kba_method: "pin" | "identity" | null;
427
+ /**
428
+ * If KBA is set to "PIN" this will be set to the PIN code required. For security reasons, this
429
+ * field will only be visible to the creator of the envelope.
430
+ */
431
+ kba_pin?: string | null;
432
+ /**
433
+ * If KBA has been completed successfully, this will be set to true. For privacy reasons, this
434
+ * field will only be visible to the creator of the envelope and the recipient referenced.
421
435
  */
422
- kba_method: string | null;
423
436
  kba_completed: boolean;
437
+ /**
438
+ * If KBA has been completed (or partially successfully, this will contain metadata related to
439
+ * the questions and answers from the process. For privacy reasons, this field will only be visible
440
+ * to the recipient referenced.
441
+ */
424
442
  kba_details: Record<string, any>;
425
443
  envelope?: IEnvelope;
426
444
  profile?: IProfile;
@@ -467,7 +485,7 @@ interface IRole {
467
485
  * If set, "KBA required" will carry through to automatically enable the same setting in Envelopes
468
486
  * created from this template.
469
487
  */
470
- kba_method: string | null;
488
+ kba_method: "pin" | "identity" | null;
471
489
  }
472
490
  interface ISignature {
473
491
  id: string;
@@ -1346,6 +1364,105 @@ declare const getEnvelopesByTemplateId: (endpoint: VerdocsEndpoint, templateId:
1346
1364
  * to be "stamped" by the user.
1347
1365
  */
1348
1366
  declare const createInitials: (endpoint: VerdocsEndpoint, name: string, initials: Blob) => Promise<IInitial>;
1367
+ /**
1368
+ * KBA is not required at this time. Note that if there is a discrepancy between the `kba_required`
1369
+ * field here and that in the Recipient object, this object should be considered authoritative
1370
+ * (this can happen if the envelope sender updates the setting after the recipient has already
1371
+ * been invited).
1372
+ */
1373
+ interface IRecipientKbaStatusNotRequired {
1374
+ envelope_id: string;
1375
+ role_name: string;
1376
+ kba_required: false;
1377
+ }
1378
+ /**
1379
+ * KBA has been completed and no further action is required.
1380
+ */
1381
+ interface IRecipientKbaStatusComplete {
1382
+ envelope_id: string;
1383
+ role_name: string;
1384
+ kba_required: true;
1385
+ kba_completed: true;
1386
+ kba_method: string;
1387
+ }
1388
+ /**
1389
+ * A PIN code is required. Prompt the user to enter this PIN, and submit it via `submitKbaPin()`.
1390
+ */
1391
+ interface IRecipientKbaStatusPinRequired {
1392
+ envelope_id: string;
1393
+ role_name: string;
1394
+ kba_required: true;
1395
+ kba_completed: false;
1396
+ kba_method: "pin";
1397
+ }
1398
+ /**
1399
+ * A full identity verification is required. Prompt the user for their address and other (optional)
1400
+ * details and submit them via `submitKbaIdentity()`.
1401
+ */
1402
+ interface IRecipientKbaStatusIdentityRequired {
1403
+ envelope_id: string;
1404
+ role_name: string;
1405
+ kba_required: true;
1406
+ kba_completed: false;
1407
+ kba_method: "identity";
1408
+ }
1409
+ /**
1410
+ * Triggered by full identity verification if additional challenges are required. The recipient
1411
+ * should be shown the message and options, and submit a response via `submitKbaChallengeResponse()`.
1412
+ * Note that this response may be issued more than once if multiple challenges are required.
1413
+ */
1414
+ interface IRecipientKbaChallengeRequired {
1415
+ envelope_id: string;
1416
+ role_name: string;
1417
+ kba_required: true;
1418
+ kba_completed: false;
1419
+ kba_method: "challenge";
1420
+ message: string;
1421
+ options: string[];
1422
+ }
1423
+ /**
1424
+ * Identity verification has failed. The user should be shown the message included. No further
1425
+ * signing operations may be performed.
1426
+ */
1427
+ interface IRecipientKbaStatusFailed {
1428
+ envelope_id: string;
1429
+ role_name: string;
1430
+ kba_required: true;
1431
+ kba_completed: false;
1432
+ kba_method: "failed";
1433
+ meesage: string;
1434
+ }
1435
+ type TRecipientKbaStatus = IRecipientKbaStatusNotRequired | IRecipientKbaStatusComplete | IRecipientKbaStatusPinRequired | IRecipientKbaStatusIdentityRequired | IRecipientKbaChallengeRequired | IRecipientKbaStatusFailed;
1436
+ /**
1437
+ * Get the current KBA status. Note that this may only be called by the recipient and requires a
1438
+ * valid signing session to proceed. Although the Recipient object itself contains indications of
1439
+ * whether KBA is required, it will not contain the current status of the process. If
1440
+ * `recipient.kba_method` is set (not null), and `recipient.kba_completed` is false, this endpoint
1441
+ * should be called to determine the next KBA step required.
1442
+ */
1443
+ declare const getKbaStatus: (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string) => Promise<IRecipientKbaStatusNotRequired | IRecipientKbaStatusComplete | IRecipientKbaStatusPinRequired | IRecipientKbaStatusIdentityRequired | IRecipientKbaChallengeRequired | IRecipientKbaStatusFailed>;
1444
+ /**
1445
+ * Submit a response to a KBA PIN challenge.
1446
+ */
1447
+ declare const submitKbaPin: (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, pin: string) => Promise<IRecipientKbaStatusNotRequired | IRecipientKbaStatusComplete | IRecipientKbaStatusPinRequired | IRecipientKbaStatusIdentityRequired | IRecipientKbaChallengeRequired | IRecipientKbaStatusFailed>;
1448
+ interface IKbaIdentity {
1449
+ address1: string;
1450
+ address2?: string;
1451
+ city?: string;
1452
+ state?: string;
1453
+ postalCode?: string;
1454
+ country?: string;
1455
+ ssn?: string;
1456
+ ssnLast4?: string;
1457
+ }
1458
+ /**
1459
+ * Submit an identity response to a KBA challenge.
1460
+ */
1461
+ declare const submitKbaIdentity: (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, identity: IKbaIdentity) => Promise<IRecipientKbaStatusNotRequired | IRecipientKbaStatusComplete | IRecipientKbaStatusPinRequired | IRecipientKbaStatusIdentityRequired | IRecipientKbaChallengeRequired | IRecipientKbaStatusFailed>;
1462
+ /**
1463
+ * Submit an identity response to a KBA challenge.
1464
+ */
1465
+ declare const submitKbaChallengeResponse: (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, response: string) => Promise<IRecipientKbaStatusNotRequired | IRecipientKbaStatusComplete | IRecipientKbaStatusPinRequired | IRecipientKbaStatusIdentityRequired | IRecipientKbaChallengeRequired | IRecipientKbaStatusFailed>;
1349
1466
  /**
1350
1467
  * Update a recipient's status block
1351
1468
  */
@@ -1653,6 +1770,26 @@ declare const deleteOrganization: (endpoint: VerdocsEndpoint, organizationId: st
1653
1770
  * Update an organization.
1654
1771
  */
1655
1772
  declare const updateOrganization: (endpoint: VerdocsEndpoint, organizationId: string, params: Partial<IOrganization>) => Promise<IOrganization>;
1773
+ /**
1774
+ * Update the organization's logo. This can only be called by an admin or owner of the organization.
1775
+ *
1776
+ * ```typescript
1777
+ * import {uploadOrganizationLogo} from '@verdocs/js-sdk';
1778
+ *
1779
+ * await uploadOrganizationLogo((VerdocsEndpoint.getDefault(), file);
1780
+ * ```
1781
+ */
1782
+ declare const uploadOrganizationLogo: (endpoint: VerdocsEndpoint, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<IProfile>;
1783
+ /**
1784
+ * Update the organization's thumbnail. This can only be called by an admin or owner of the organization.
1785
+ *
1786
+ * ```typescript
1787
+ * import {uploadOrganizationThumbnail} from '@verdocs/js-sdk';
1788
+ *
1789
+ * await uploadOrganizationThumbnail((VerdocsEndpoint.getDefault(), file);
1790
+ * ```
1791
+ */
1792
+ declare const uploadOrganizationThumbnail: (endpoint: VerdocsEndpoint, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<IProfile>;
1656
1793
  /**
1657
1794
  * Get the registered Webhooks for the caller's organization.
1658
1795
  */
@@ -2315,14 +2452,6 @@ declare const isValidEmail: (email: string | undefined) => boolean;
2315
2452
  declare const isValidPhone: (phone: string | undefined) => boolean;
2316
2453
  declare const isValidRoleName: (value: string, roles: IRole[]) => boolean;
2317
2454
  declare const isValidTag: (value: string, tags: string[]) => boolean;
2318
- interface ISwitchProfileResponse {
2319
- profile: IProfile;
2320
- accessToken: string;
2321
- idToken: string;
2322
- refreshToken: string;
2323
- accessTokenExp: number;
2324
- refreshTokenExp: number;
2325
- }
2326
2455
  interface IUpdateProfileRequest {
2327
2456
  first_name?: string;
2328
2457
  last_name?: string;
@@ -2506,7 +2635,7 @@ declare const getProfile: (endpoint: VerdocsEndpoint, profileId: string) => Prom
2506
2635
  * const newProfile = await switchProfile('PROFILEID');
2507
2636
  * ```
2508
2637
  */
2509
- declare const switchProfile: (endpoint: VerdocsEndpoint, profileId: string) => Promise<ISwitchProfileResponse>;
2638
+ declare const switchProfile: (endpoint: VerdocsEndpoint, profileId: string) => Promise<IAuthenticateResponse>;
2510
2639
  /**
2511
2640
  * Update a profile. For future expansion, the profile ID to update is required, but currently
2512
2641
  * this must also be the "current" profile for the caller.
@@ -2559,4 +2688,14 @@ declare const createProfile: (endpoint: VerdocsEndpoint, params: ICreateAccountR
2559
2688
  profile: IProfile;
2560
2689
  organization: IOrganization;
2561
2690
  }>;
2562
- export { TRequestStatus, TTemplateSenderType, TTemplatePermission, TTemplateAction, TAccountPermission, TOrgPermission, TApiKeyPermission, TPermission, TRecipientAction, TEnvelopeStatus, TRecipientStatus, TRecipientType, TRole, TSortTemplateBy, TAccessKeyType, THistoryEvent, TEventDetail, TEnvelopeUpdateResult, TFieldType, IChannel, IDisabledChannel, INotification, IApiKey, IGroup, IGroupProfile, IOAuth2App, IOrganization, IOrganizationInvitation, IPendingWebhook, IProfile, IWebhookEvents, IWebhook, IInPersonAccessKey, IInAppAccessKey, IEmailAccessKey, ISMSAccessKey, TAccessKey, IEnvelope, IEnvelopeDocument, IEnvelopeField, IEnvelopeFieldOptions, IEnvelopeFieldSettings, IEnvelopeHistory, IInitial, IRecipient, IReminder, IRole, ISignature, ITemplate, ITemplateDocument, ITemplateField, ITextFieldSetting, ITemplateFieldSetting, IActivityEntry, TEnvironment, TSessionChangedListener, VerdocsEndpointOptions, VerdocsEndpoint, createEnvelope, getEnvelopesSummary, IEnvelopeSearchParams, searchEnvelopes, ISigningSessionResult, getSigningSession, getEnvelopeRecipients, getEnvelope, getEnvelopeDocument, getDocumentDownloadLink, getDocumentPreviewLink, cancelEnvelope, getEnvelopeFile, updateEnvelopeField, updateEnvelopeFieldSignature, updateEnvelopeFieldInitials, uploadEnvelopeFieldAttachment, deleteEnvelopeFieldAttachment, getFieldAttachment, getEnvelopeDocumentPageDisplayUri, throttledGetEnvelope, ITimeRange, IListEnvelopesParams, listEnvelopes, getEnvelopesByTemplateId, createInitials, updateRecipient, envelopeRecipientSubmit, envelopeRecipientDecline, envelopeRecipientChangeOwner, envelopeRecipientAgree, envelopeRecipientUpdateName, envelopeRecipientPrepare, ISignerTokenResponse, getSignerToken, getInPersonLink, sendDelegate, resendInvitation, createEnvelopeReminder, getEnvelopeReminder, updateEnvelopeReminder, deleteEnvelopeReminder, userIsEnvelopeOwner, userIsEnvelopeRecipient, envelopeIsActive, envelopeIsComplete, userCanCancelEnvelope, userCanFinishEnvelope, recipientHasAction, getRecipientsWithActions, recipientCanAct, userCanAct, userCanSignNow, getNextRecipient, createSignature, getSignatures, getSignature, deleteSignature, IEnvelopesSearchResultEntry, IEnvelopesSearchResult, IEnvelopesSummary, IDocumentSearchOptions, ICreateEnvelopeRole, IEnvelopeSummary, IEnvelopeSummaries, IInPersonLinkResponse, IUpdateRecipientSubmitParams, IUpdateRecipientDeclineParams, IUpdateRecipientClaimEnvelope, IUpdateRecipientStatus, IUpdateRecipientAgreedParams, IUpdateRecipientNameParams, IUpdateRecipientPrepareParams, ICreateEnvelopeReminderRequest, ICreateEnvelopeRequest, TEnvelopePermission, getApiKeys, createApiKey, rotateApiKey, updateApiKey, deleteApiKey, getGroups, getGroup, createGroup, addGroupMember, deleteGroupMember, updateGroup, getOrganizationInvitations, createOrganizationInvitation, deleteOrganizationInvitation, updateOrganizationInvitation, resendOrganizationInvitation, getOrganizationInvitation, acceptOrganizationInvitation, declineOrganizationInvitation, getOrganizationMembers, deleteOrganizationMember, updateOrganizationMember, getOrganizations, getOrganization, createOrganization, deleteOrganization, updateOrganization, ICreateApiKeyRequest, IUpdateApiKeyRequest, ICreateInvitationRequest, ISetWebhookRequest, getWebhooks, setWebhooks, userHasPermissions, ISigningSessionRequest, ISigningSession, IUserSession, 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, getTemplateRoles, getTemplateRole, updateTemplateRole, deleteTemplateRole, getTemplateRoleFields, getStars, toggleStar, addTemplateTag, getTemplateTags, deleteTemplateTag, createTag, getTag, getAllTags, IGetTemplatesParams, getTemplates, getTemplate, getTemplateOwnerInfo, IDocumentFromUri, IDocumentFromData, ITemplateCreateParams, createTemplate, createTemplatev2, ITemplateCreateFromSharepointParams, createTemplateFromSharepoint, updateTemplate, deleteTemplate, searchTemplates, ISearchTimeRange, IGetTemplateSummarySortBy, IGetTemplateSummaryParams, getTemplatesSummary, throttledGetTemplate, ITemplateListParams, listTemplates, getTemplateDocuments, getTemplateDocument, createTemplateDocument, deleteTemplateDocument, getTemplateDocumentFile, getTemplateDocumentThumbnail, getTemplateDocumentPageDisplayUri, ITemplateSummary, ITemplateSearchParams, ITemplateSummaries, ITemplateTag, ITag, IStar, ITemplateOwnerInfo, ITemplateSearchResult, IValidator, getValidators, getValidator, isValidEmail, isValidPhone, isValidRoleName, isValidTag, IROPCRequest, IClientCredentialsRequest, IRefreshTokenRequest, TAuthenticationRequest, authenticate, refreshToken, changePassword, resetPassword, verifyEmail, resendVerification, getNotifications, getProfiles, getCurrentProfile, getProfile, switchProfile, updateProfile, deleteProfile, createProfile, ISwitchProfileResponse, IUpdateProfileRequest, IAuthenticateResponse, IUpdatePasswordRequest, IUpdatePasswordResponse, ICreateAccountRequest, getRGB, getRGBA, nameToRGBA, getRoleColor, formatShortTimeAgo, timePeriod, 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, ITimePeriod };
2691
+ /**
2692
+ * Update the caller's profile photo. This can only be called for the user's "current" profile.
2693
+ *
2694
+ * ```typescript
2695
+ * import {uploadProfilePhoto} from '@verdocs/js-sdk';
2696
+ *
2697
+ * await uploadProfilePhoto((VerdocsEndpoint.getDefault(), file);
2698
+ * ```
2699
+ */
2700
+ declare const uploadProfilePhoto: (endpoint: VerdocsEndpoint, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<IProfile>;
2701
+ export { TRequestStatus, TTemplateSenderType, TTemplatePermission, TTemplateAction, TAccountPermission, TOrgPermission, TApiKeyPermission, TPermission, TRecipientAction, TEnvelopeStatus, TRecipientStatus, TRecipientType, TRole, TSortTemplateBy, TAccessKeyType, THistoryEvent, TEventDetail, TEnvelopeUpdateResult, TFieldType, IChannel, IDisabledChannel, INotification, IApiKey, IGroup, IGroupProfile, IOAuth2App, IOrganization, IOrganizationInvitation, IPendingWebhook, IProfile, IWebhookEvents, IWebhook, IInPersonAccessKey, IInAppAccessKey, IEmailAccessKey, ISMSAccessKey, TAccessKey, IEnvelope, IEnvelopeDocument, IEnvelopeField, IEnvelopeFieldOptions, IEnvelopeFieldSettings, IEnvelopeHistory, IInitial, IKbaPINRequired, IRecipient, IReminder, IRole, ISignature, ITemplate, ITemplateDocument, ITemplateField, ITextFieldSetting, ITemplateFieldSetting, IActivityEntry, TEnvironment, TSessionChangedListener, VerdocsEndpointOptions, VerdocsEndpoint, createEnvelope, getEnvelopesSummary, IEnvelopeSearchParams, searchEnvelopes, ISigningSessionResult, getSigningSession, getEnvelopeRecipients, getEnvelope, getEnvelopeDocument, getDocumentDownloadLink, getDocumentPreviewLink, cancelEnvelope, getEnvelopeFile, updateEnvelopeField, updateEnvelopeFieldSignature, updateEnvelopeFieldInitials, uploadEnvelopeFieldAttachment, deleteEnvelopeFieldAttachment, getFieldAttachment, getEnvelopeDocumentPageDisplayUri, throttledGetEnvelope, ITimeRange, IListEnvelopesParams, listEnvelopes, getEnvelopesByTemplateId, createInitials, IRecipientKbaStatusNotRequired, IRecipientKbaStatusComplete, IRecipientKbaStatusPinRequired, IRecipientKbaStatusIdentityRequired, IRecipientKbaChallengeRequired, IRecipientKbaStatusFailed, TRecipientKbaStatus, getKbaStatus, submitKbaPin, IKbaIdentity, submitKbaIdentity, submitKbaChallengeResponse, updateRecipient, envelopeRecipientSubmit, envelopeRecipientDecline, envelopeRecipientChangeOwner, envelopeRecipientAgree, envelopeRecipientUpdateName, envelopeRecipientPrepare, ISignerTokenResponse, getSignerToken, getInPersonLink, sendDelegate, resendInvitation, createEnvelopeReminder, getEnvelopeReminder, updateEnvelopeReminder, deleteEnvelopeReminder, userIsEnvelopeOwner, userIsEnvelopeRecipient, envelopeIsActive, envelopeIsComplete, userCanCancelEnvelope, userCanFinishEnvelope, recipientHasAction, getRecipientsWithActions, recipientCanAct, userCanAct, userCanSignNow, getNextRecipient, createSignature, getSignatures, getSignature, deleteSignature, IEnvelopesSearchResultEntry, IEnvelopesSearchResult, IEnvelopesSummary, IDocumentSearchOptions, ICreateEnvelopeRole, IEnvelopeSummary, IEnvelopeSummaries, IInPersonLinkResponse, IUpdateRecipientSubmitParams, IUpdateRecipientDeclineParams, IUpdateRecipientClaimEnvelope, IUpdateRecipientStatus, IUpdateRecipientAgreedParams, IUpdateRecipientNameParams, IUpdateRecipientPrepareParams, ICreateEnvelopeReminderRequest, ICreateEnvelopeRequest, TEnvelopePermission, getApiKeys, createApiKey, rotateApiKey, updateApiKey, deleteApiKey, getGroups, getGroup, createGroup, addGroupMember, deleteGroupMember, updateGroup, getOrganizationInvitations, createOrganizationInvitation, deleteOrganizationInvitation, updateOrganizationInvitation, resendOrganizationInvitation, getOrganizationInvitation, acceptOrganizationInvitation, declineOrganizationInvitation, getOrganizationMembers, deleteOrganizationMember, updateOrganizationMember, getOrganizations, getOrganization, createOrganization, deleteOrganization, updateOrganization, uploadOrganizationLogo, uploadOrganizationThumbnail, ICreateApiKeyRequest, IUpdateApiKeyRequest, ICreateInvitationRequest, ISetWebhookRequest, getWebhooks, setWebhooks, userHasPermissions, ISigningSessionRequest, ISigningSession, IUserSession, 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, getTemplateRoles, getTemplateRole, updateTemplateRole, deleteTemplateRole, getTemplateRoleFields, getStars, toggleStar, addTemplateTag, getTemplateTags, deleteTemplateTag, createTag, getTag, getAllTags, IGetTemplatesParams, getTemplates, getTemplate, getTemplateOwnerInfo, IDocumentFromUri, IDocumentFromData, ITemplateCreateParams, createTemplate, createTemplatev2, ITemplateCreateFromSharepointParams, createTemplateFromSharepoint, updateTemplate, deleteTemplate, searchTemplates, ISearchTimeRange, IGetTemplateSummarySortBy, IGetTemplateSummaryParams, getTemplatesSummary, throttledGetTemplate, ITemplateListParams, listTemplates, getTemplateDocuments, getTemplateDocument, createTemplateDocument, deleteTemplateDocument, getTemplateDocumentFile, getTemplateDocumentThumbnail, getTemplateDocumentPageDisplayUri, ITemplateSummary, ITemplateSearchParams, ITemplateSummaries, ITemplateTag, ITag, IStar, ITemplateOwnerInfo, ITemplateSearchResult, IValidator, getValidators, getValidator, isValidEmail, isValidPhone, isValidRoleName, isValidTag, IROPCRequest, IClientCredentialsRequest, IRefreshTokenRequest, TAuthenticationRequest, authenticate, refreshToken, changePassword, resetPassword, verifyEmail, resendVerification, getNotifications, getProfiles, getCurrentProfile, getProfile, switchProfile, updateProfile, deleteProfile, createProfile, uploadProfilePhoto, IUpdateProfileRequest, IAuthenticateResponse, IUpdatePasswordRequest, IUpdatePasswordResponse, ICreateAccountRequest, getRGB, getRGBA, nameToRGBA, getRoleColor, formatShortTimeAgo, timePeriod, 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, ITimePeriod };
package/dist/index.d.ts CHANGED
@@ -384,6 +384,9 @@ interface IInitial {
384
384
  deleted_at: string | null;
385
385
  profile?: IProfile;
386
386
  }
387
+ interface IKbaPINRequired {
388
+ type: "pin";
389
+ }
387
390
  interface IRecipient {
388
391
  envelope_id: string;
389
392
  role_name: string;
@@ -417,10 +420,25 @@ interface IRecipient {
417
420
  last_attempt_at: string;
418
421
  /**
419
422
  * If set, "KBA required" will carry through to automatically enable the same setting in Envelopes
420
- * created from this template.
423
+ * created from this template. For privacy reasons, this field will only be visible to the creator
424
+ * of the envelope and the recipient referenced.
425
+ */
426
+ kba_method: "pin" | "identity" | null;
427
+ /**
428
+ * If KBA is set to "PIN" this will be set to the PIN code required. For security reasons, this
429
+ * field will only be visible to the creator of the envelope.
430
+ */
431
+ kba_pin?: string | null;
432
+ /**
433
+ * If KBA has been completed successfully, this will be set to true. For privacy reasons, this
434
+ * field will only be visible to the creator of the envelope and the recipient referenced.
421
435
  */
422
- kba_method: string | null;
423
436
  kba_completed: boolean;
437
+ /**
438
+ * If KBA has been completed (or partially successfully, this will contain metadata related to
439
+ * the questions and answers from the process. For privacy reasons, this field will only be visible
440
+ * to the recipient referenced.
441
+ */
424
442
  kba_details: Record<string, any>;
425
443
  envelope?: IEnvelope;
426
444
  profile?: IProfile;
@@ -467,7 +485,7 @@ interface IRole {
467
485
  * If set, "KBA required" will carry through to automatically enable the same setting in Envelopes
468
486
  * created from this template.
469
487
  */
470
- kba_method: string | null;
488
+ kba_method: "pin" | "identity" | null;
471
489
  }
472
490
  interface ISignature {
473
491
  id: string;
@@ -1346,6 +1364,105 @@ declare const getEnvelopesByTemplateId: (endpoint: VerdocsEndpoint, templateId:
1346
1364
  * to be "stamped" by the user.
1347
1365
  */
1348
1366
  declare const createInitials: (endpoint: VerdocsEndpoint, name: string, initials: Blob) => Promise<IInitial>;
1367
+ /**
1368
+ * KBA is not required at this time. Note that if there is a discrepancy between the `kba_required`
1369
+ * field here and that in the Recipient object, this object should be considered authoritative
1370
+ * (this can happen if the envelope sender updates the setting after the recipient has already
1371
+ * been invited).
1372
+ */
1373
+ interface IRecipientKbaStatusNotRequired {
1374
+ envelope_id: string;
1375
+ role_name: string;
1376
+ kba_required: false;
1377
+ }
1378
+ /**
1379
+ * KBA has been completed and no further action is required.
1380
+ */
1381
+ interface IRecipientKbaStatusComplete {
1382
+ envelope_id: string;
1383
+ role_name: string;
1384
+ kba_required: true;
1385
+ kba_completed: true;
1386
+ kba_method: string;
1387
+ }
1388
+ /**
1389
+ * A PIN code is required. Prompt the user to enter this PIN, and submit it via `submitKbaPin()`.
1390
+ */
1391
+ interface IRecipientKbaStatusPinRequired {
1392
+ envelope_id: string;
1393
+ role_name: string;
1394
+ kba_required: true;
1395
+ kba_completed: false;
1396
+ kba_method: "pin";
1397
+ }
1398
+ /**
1399
+ * A full identity verification is required. Prompt the user for their address and other (optional)
1400
+ * details and submit them via `submitKbaIdentity()`.
1401
+ */
1402
+ interface IRecipientKbaStatusIdentityRequired {
1403
+ envelope_id: string;
1404
+ role_name: string;
1405
+ kba_required: true;
1406
+ kba_completed: false;
1407
+ kba_method: "identity";
1408
+ }
1409
+ /**
1410
+ * Triggered by full identity verification if additional challenges are required. The recipient
1411
+ * should be shown the message and options, and submit a response via `submitKbaChallengeResponse()`.
1412
+ * Note that this response may be issued more than once if multiple challenges are required.
1413
+ */
1414
+ interface IRecipientKbaChallengeRequired {
1415
+ envelope_id: string;
1416
+ role_name: string;
1417
+ kba_required: true;
1418
+ kba_completed: false;
1419
+ kba_method: "challenge";
1420
+ message: string;
1421
+ options: string[];
1422
+ }
1423
+ /**
1424
+ * Identity verification has failed. The user should be shown the message included. No further
1425
+ * signing operations may be performed.
1426
+ */
1427
+ interface IRecipientKbaStatusFailed {
1428
+ envelope_id: string;
1429
+ role_name: string;
1430
+ kba_required: true;
1431
+ kba_completed: false;
1432
+ kba_method: "failed";
1433
+ meesage: string;
1434
+ }
1435
+ type TRecipientKbaStatus = IRecipientKbaStatusNotRequired | IRecipientKbaStatusComplete | IRecipientKbaStatusPinRequired | IRecipientKbaStatusIdentityRequired | IRecipientKbaChallengeRequired | IRecipientKbaStatusFailed;
1436
+ /**
1437
+ * Get the current KBA status. Note that this may only be called by the recipient and requires a
1438
+ * valid signing session to proceed. Although the Recipient object itself contains indications of
1439
+ * whether KBA is required, it will not contain the current status of the process. If
1440
+ * `recipient.kba_method` is set (not null), and `recipient.kba_completed` is false, this endpoint
1441
+ * should be called to determine the next KBA step required.
1442
+ */
1443
+ declare const getKbaStatus: (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string) => Promise<IRecipientKbaStatusNotRequired | IRecipientKbaStatusComplete | IRecipientKbaStatusPinRequired | IRecipientKbaStatusIdentityRequired | IRecipientKbaChallengeRequired | IRecipientKbaStatusFailed>;
1444
+ /**
1445
+ * Submit a response to a KBA PIN challenge.
1446
+ */
1447
+ declare const submitKbaPin: (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, pin: string) => Promise<IRecipientKbaStatusNotRequired | IRecipientKbaStatusComplete | IRecipientKbaStatusPinRequired | IRecipientKbaStatusIdentityRequired | IRecipientKbaChallengeRequired | IRecipientKbaStatusFailed>;
1448
+ interface IKbaIdentity {
1449
+ address1: string;
1450
+ address2?: string;
1451
+ city?: string;
1452
+ state?: string;
1453
+ postalCode?: string;
1454
+ country?: string;
1455
+ ssn?: string;
1456
+ ssnLast4?: string;
1457
+ }
1458
+ /**
1459
+ * Submit an identity response to a KBA challenge.
1460
+ */
1461
+ declare const submitKbaIdentity: (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, identity: IKbaIdentity) => Promise<IRecipientKbaStatusNotRequired | IRecipientKbaStatusComplete | IRecipientKbaStatusPinRequired | IRecipientKbaStatusIdentityRequired | IRecipientKbaChallengeRequired | IRecipientKbaStatusFailed>;
1462
+ /**
1463
+ * Submit an identity response to a KBA challenge.
1464
+ */
1465
+ declare const submitKbaChallengeResponse: (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, response: string) => Promise<IRecipientKbaStatusNotRequired | IRecipientKbaStatusComplete | IRecipientKbaStatusPinRequired | IRecipientKbaStatusIdentityRequired | IRecipientKbaChallengeRequired | IRecipientKbaStatusFailed>;
1349
1466
  /**
1350
1467
  * Update a recipient's status block
1351
1468
  */
@@ -1653,6 +1770,26 @@ declare const deleteOrganization: (endpoint: VerdocsEndpoint, organizationId: st
1653
1770
  * Update an organization.
1654
1771
  */
1655
1772
  declare const updateOrganization: (endpoint: VerdocsEndpoint, organizationId: string, params: Partial<IOrganization>) => Promise<IOrganization>;
1773
+ /**
1774
+ * Update the organization's logo. This can only be called by an admin or owner of the organization.
1775
+ *
1776
+ * ```typescript
1777
+ * import {uploadOrganizationLogo} from '@verdocs/js-sdk';
1778
+ *
1779
+ * await uploadOrganizationLogo((VerdocsEndpoint.getDefault(), file);
1780
+ * ```
1781
+ */
1782
+ declare const uploadOrganizationLogo: (endpoint: VerdocsEndpoint, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<IProfile>;
1783
+ /**
1784
+ * Update the organization's thumbnail. This can only be called by an admin or owner of the organization.
1785
+ *
1786
+ * ```typescript
1787
+ * import {uploadOrganizationThumbnail} from '@verdocs/js-sdk';
1788
+ *
1789
+ * await uploadOrganizationThumbnail((VerdocsEndpoint.getDefault(), file);
1790
+ * ```
1791
+ */
1792
+ declare const uploadOrganizationThumbnail: (endpoint: VerdocsEndpoint, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<IProfile>;
1656
1793
  /**
1657
1794
  * Get the registered Webhooks for the caller's organization.
1658
1795
  */
@@ -2315,14 +2452,6 @@ declare const isValidEmail: (email: string | undefined) => boolean;
2315
2452
  declare const isValidPhone: (phone: string | undefined) => boolean;
2316
2453
  declare const isValidRoleName: (value: string, roles: IRole[]) => boolean;
2317
2454
  declare const isValidTag: (value: string, tags: string[]) => boolean;
2318
- interface ISwitchProfileResponse {
2319
- profile: IProfile;
2320
- accessToken: string;
2321
- idToken: string;
2322
- refreshToken: string;
2323
- accessTokenExp: number;
2324
- refreshTokenExp: number;
2325
- }
2326
2455
  interface IUpdateProfileRequest {
2327
2456
  first_name?: string;
2328
2457
  last_name?: string;
@@ -2506,7 +2635,7 @@ declare const getProfile: (endpoint: VerdocsEndpoint, profileId: string) => Prom
2506
2635
  * const newProfile = await switchProfile('PROFILEID');
2507
2636
  * ```
2508
2637
  */
2509
- declare const switchProfile: (endpoint: VerdocsEndpoint, profileId: string) => Promise<ISwitchProfileResponse>;
2638
+ declare const switchProfile: (endpoint: VerdocsEndpoint, profileId: string) => Promise<IAuthenticateResponse>;
2510
2639
  /**
2511
2640
  * Update a profile. For future expansion, the profile ID to update is required, but currently
2512
2641
  * this must also be the "current" profile for the caller.
@@ -2559,4 +2688,14 @@ declare const createProfile: (endpoint: VerdocsEndpoint, params: ICreateAccountR
2559
2688
  profile: IProfile;
2560
2689
  organization: IOrganization;
2561
2690
  }>;
2562
- export { TRequestStatus, TTemplateSenderType, TTemplatePermission, TTemplateAction, TAccountPermission, TOrgPermission, TApiKeyPermission, TPermission, TRecipientAction, TEnvelopeStatus, TRecipientStatus, TRecipientType, TRole, TSortTemplateBy, TAccessKeyType, THistoryEvent, TEventDetail, TEnvelopeUpdateResult, TFieldType, IChannel, IDisabledChannel, INotification, IApiKey, IGroup, IGroupProfile, IOAuth2App, IOrganization, IOrganizationInvitation, IPendingWebhook, IProfile, IWebhookEvents, IWebhook, IInPersonAccessKey, IInAppAccessKey, IEmailAccessKey, ISMSAccessKey, TAccessKey, IEnvelope, IEnvelopeDocument, IEnvelopeField, IEnvelopeFieldOptions, IEnvelopeFieldSettings, IEnvelopeHistory, IInitial, IRecipient, IReminder, IRole, ISignature, ITemplate, ITemplateDocument, ITemplateField, ITextFieldSetting, ITemplateFieldSetting, IActivityEntry, TEnvironment, TSessionChangedListener, VerdocsEndpointOptions, VerdocsEndpoint, createEnvelope, getEnvelopesSummary, IEnvelopeSearchParams, searchEnvelopes, ISigningSessionResult, getSigningSession, getEnvelopeRecipients, getEnvelope, getEnvelopeDocument, getDocumentDownloadLink, getDocumentPreviewLink, cancelEnvelope, getEnvelopeFile, updateEnvelopeField, updateEnvelopeFieldSignature, updateEnvelopeFieldInitials, uploadEnvelopeFieldAttachment, deleteEnvelopeFieldAttachment, getFieldAttachment, getEnvelopeDocumentPageDisplayUri, throttledGetEnvelope, ITimeRange, IListEnvelopesParams, listEnvelopes, getEnvelopesByTemplateId, createInitials, updateRecipient, envelopeRecipientSubmit, envelopeRecipientDecline, envelopeRecipientChangeOwner, envelopeRecipientAgree, envelopeRecipientUpdateName, envelopeRecipientPrepare, ISignerTokenResponse, getSignerToken, getInPersonLink, sendDelegate, resendInvitation, createEnvelopeReminder, getEnvelopeReminder, updateEnvelopeReminder, deleteEnvelopeReminder, userIsEnvelopeOwner, userIsEnvelopeRecipient, envelopeIsActive, envelopeIsComplete, userCanCancelEnvelope, userCanFinishEnvelope, recipientHasAction, getRecipientsWithActions, recipientCanAct, userCanAct, userCanSignNow, getNextRecipient, createSignature, getSignatures, getSignature, deleteSignature, IEnvelopesSearchResultEntry, IEnvelopesSearchResult, IEnvelopesSummary, IDocumentSearchOptions, ICreateEnvelopeRole, IEnvelopeSummary, IEnvelopeSummaries, IInPersonLinkResponse, IUpdateRecipientSubmitParams, IUpdateRecipientDeclineParams, IUpdateRecipientClaimEnvelope, IUpdateRecipientStatus, IUpdateRecipientAgreedParams, IUpdateRecipientNameParams, IUpdateRecipientPrepareParams, ICreateEnvelopeReminderRequest, ICreateEnvelopeRequest, TEnvelopePermission, getApiKeys, createApiKey, rotateApiKey, updateApiKey, deleteApiKey, getGroups, getGroup, createGroup, addGroupMember, deleteGroupMember, updateGroup, getOrganizationInvitations, createOrganizationInvitation, deleteOrganizationInvitation, updateOrganizationInvitation, resendOrganizationInvitation, getOrganizationInvitation, acceptOrganizationInvitation, declineOrganizationInvitation, getOrganizationMembers, deleteOrganizationMember, updateOrganizationMember, getOrganizations, getOrganization, createOrganization, deleteOrganization, updateOrganization, ICreateApiKeyRequest, IUpdateApiKeyRequest, ICreateInvitationRequest, ISetWebhookRequest, getWebhooks, setWebhooks, userHasPermissions, ISigningSessionRequest, ISigningSession, IUserSession, 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, getTemplateRoles, getTemplateRole, updateTemplateRole, deleteTemplateRole, getTemplateRoleFields, getStars, toggleStar, addTemplateTag, getTemplateTags, deleteTemplateTag, createTag, getTag, getAllTags, IGetTemplatesParams, getTemplates, getTemplate, getTemplateOwnerInfo, IDocumentFromUri, IDocumentFromData, ITemplateCreateParams, createTemplate, createTemplatev2, ITemplateCreateFromSharepointParams, createTemplateFromSharepoint, updateTemplate, deleteTemplate, searchTemplates, ISearchTimeRange, IGetTemplateSummarySortBy, IGetTemplateSummaryParams, getTemplatesSummary, throttledGetTemplate, ITemplateListParams, listTemplates, getTemplateDocuments, getTemplateDocument, createTemplateDocument, deleteTemplateDocument, getTemplateDocumentFile, getTemplateDocumentThumbnail, getTemplateDocumentPageDisplayUri, ITemplateSummary, ITemplateSearchParams, ITemplateSummaries, ITemplateTag, ITag, IStar, ITemplateOwnerInfo, ITemplateSearchResult, IValidator, getValidators, getValidator, isValidEmail, isValidPhone, isValidRoleName, isValidTag, IROPCRequest, IClientCredentialsRequest, IRefreshTokenRequest, TAuthenticationRequest, authenticate, refreshToken, changePassword, resetPassword, verifyEmail, resendVerification, getNotifications, getProfiles, getCurrentProfile, getProfile, switchProfile, updateProfile, deleteProfile, createProfile, ISwitchProfileResponse, IUpdateProfileRequest, IAuthenticateResponse, IUpdatePasswordRequest, IUpdatePasswordResponse, ICreateAccountRequest, getRGB, getRGBA, nameToRGBA, getRoleColor, formatShortTimeAgo, timePeriod, 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, ITimePeriod };
2691
+ /**
2692
+ * Update the caller's profile photo. This can only be called for the user's "current" profile.
2693
+ *
2694
+ * ```typescript
2695
+ * import {uploadProfilePhoto} from '@verdocs/js-sdk';
2696
+ *
2697
+ * await uploadProfilePhoto((VerdocsEndpoint.getDefault(), file);
2698
+ * ```
2699
+ */
2700
+ declare const uploadProfilePhoto: (endpoint: VerdocsEndpoint, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<IProfile>;
2701
+ export { TRequestStatus, TTemplateSenderType, TTemplatePermission, TTemplateAction, TAccountPermission, TOrgPermission, TApiKeyPermission, TPermission, TRecipientAction, TEnvelopeStatus, TRecipientStatus, TRecipientType, TRole, TSortTemplateBy, TAccessKeyType, THistoryEvent, TEventDetail, TEnvelopeUpdateResult, TFieldType, IChannel, IDisabledChannel, INotification, IApiKey, IGroup, IGroupProfile, IOAuth2App, IOrganization, IOrganizationInvitation, IPendingWebhook, IProfile, IWebhookEvents, IWebhook, IInPersonAccessKey, IInAppAccessKey, IEmailAccessKey, ISMSAccessKey, TAccessKey, IEnvelope, IEnvelopeDocument, IEnvelopeField, IEnvelopeFieldOptions, IEnvelopeFieldSettings, IEnvelopeHistory, IInitial, IKbaPINRequired, IRecipient, IReminder, IRole, ISignature, ITemplate, ITemplateDocument, ITemplateField, ITextFieldSetting, ITemplateFieldSetting, IActivityEntry, TEnvironment, TSessionChangedListener, VerdocsEndpointOptions, VerdocsEndpoint, createEnvelope, getEnvelopesSummary, IEnvelopeSearchParams, searchEnvelopes, ISigningSessionResult, getSigningSession, getEnvelopeRecipients, getEnvelope, getEnvelopeDocument, getDocumentDownloadLink, getDocumentPreviewLink, cancelEnvelope, getEnvelopeFile, updateEnvelopeField, updateEnvelopeFieldSignature, updateEnvelopeFieldInitials, uploadEnvelopeFieldAttachment, deleteEnvelopeFieldAttachment, getFieldAttachment, getEnvelopeDocumentPageDisplayUri, throttledGetEnvelope, ITimeRange, IListEnvelopesParams, listEnvelopes, getEnvelopesByTemplateId, createInitials, IRecipientKbaStatusNotRequired, IRecipientKbaStatusComplete, IRecipientKbaStatusPinRequired, IRecipientKbaStatusIdentityRequired, IRecipientKbaChallengeRequired, IRecipientKbaStatusFailed, TRecipientKbaStatus, getKbaStatus, submitKbaPin, IKbaIdentity, submitKbaIdentity, submitKbaChallengeResponse, updateRecipient, envelopeRecipientSubmit, envelopeRecipientDecline, envelopeRecipientChangeOwner, envelopeRecipientAgree, envelopeRecipientUpdateName, envelopeRecipientPrepare, ISignerTokenResponse, getSignerToken, getInPersonLink, sendDelegate, resendInvitation, createEnvelopeReminder, getEnvelopeReminder, updateEnvelopeReminder, deleteEnvelopeReminder, userIsEnvelopeOwner, userIsEnvelopeRecipient, envelopeIsActive, envelopeIsComplete, userCanCancelEnvelope, userCanFinishEnvelope, recipientHasAction, getRecipientsWithActions, recipientCanAct, userCanAct, userCanSignNow, getNextRecipient, createSignature, getSignatures, getSignature, deleteSignature, IEnvelopesSearchResultEntry, IEnvelopesSearchResult, IEnvelopesSummary, IDocumentSearchOptions, ICreateEnvelopeRole, IEnvelopeSummary, IEnvelopeSummaries, IInPersonLinkResponse, IUpdateRecipientSubmitParams, IUpdateRecipientDeclineParams, IUpdateRecipientClaimEnvelope, IUpdateRecipientStatus, IUpdateRecipientAgreedParams, IUpdateRecipientNameParams, IUpdateRecipientPrepareParams, ICreateEnvelopeReminderRequest, ICreateEnvelopeRequest, TEnvelopePermission, getApiKeys, createApiKey, rotateApiKey, updateApiKey, deleteApiKey, getGroups, getGroup, createGroup, addGroupMember, deleteGroupMember, updateGroup, getOrganizationInvitations, createOrganizationInvitation, deleteOrganizationInvitation, updateOrganizationInvitation, resendOrganizationInvitation, getOrganizationInvitation, acceptOrganizationInvitation, declineOrganizationInvitation, getOrganizationMembers, deleteOrganizationMember, updateOrganizationMember, getOrganizations, getOrganization, createOrganization, deleteOrganization, updateOrganization, uploadOrganizationLogo, uploadOrganizationThumbnail, ICreateApiKeyRequest, IUpdateApiKeyRequest, ICreateInvitationRequest, ISetWebhookRequest, getWebhooks, setWebhooks, userHasPermissions, ISigningSessionRequest, ISigningSession, IUserSession, 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, getTemplateRoles, getTemplateRole, updateTemplateRole, deleteTemplateRole, getTemplateRoleFields, getStars, toggleStar, addTemplateTag, getTemplateTags, deleteTemplateTag, createTag, getTag, getAllTags, IGetTemplatesParams, getTemplates, getTemplate, getTemplateOwnerInfo, IDocumentFromUri, IDocumentFromData, ITemplateCreateParams, createTemplate, createTemplatev2, ITemplateCreateFromSharepointParams, createTemplateFromSharepoint, updateTemplate, deleteTemplate, searchTemplates, ISearchTimeRange, IGetTemplateSummarySortBy, IGetTemplateSummaryParams, getTemplatesSummary, throttledGetTemplate, ITemplateListParams, listTemplates, getTemplateDocuments, getTemplateDocument, createTemplateDocument, deleteTemplateDocument, getTemplateDocumentFile, getTemplateDocumentThumbnail, getTemplateDocumentPageDisplayUri, ITemplateSummary, ITemplateSearchParams, ITemplateSummaries, ITemplateTag, ITag, IStar, ITemplateOwnerInfo, ITemplateSearchResult, IValidator, getValidators, getValidator, isValidEmail, isValidPhone, isValidRoleName, isValidTag, IROPCRequest, IClientCredentialsRequest, IRefreshTokenRequest, TAuthenticationRequest, authenticate, refreshToken, changePassword, resetPassword, verifyEmail, resendVerification, getNotifications, getProfiles, getCurrentProfile, getProfile, switchProfile, updateProfile, deleteProfile, createProfile, uploadProfilePhoto, IUpdateProfileRequest, IAuthenticateResponse, IUpdatePasswordRequest, IUpdatePasswordResponse, ICreateAccountRequest, getRGB, getRGBA, nameToRGBA, getRoleColor, formatShortTimeAgo, timePeriod, 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, ITimePeriod };
package/dist/index.js CHANGED
@@ -1385,6 +1385,35 @@ const createInitials = (endpoint, name, initials) => {
1385
1385
  .then((r) => r.data);
1386
1386
  };
1387
1387
 
1388
+ /**
1389
+ * Get the current KBA status. Note that this may only be called by the recipient and requires a
1390
+ * valid signing session to proceed. Although the Recipient object itself contains indications of
1391
+ * whether KBA is required, it will not contain the current status of the process. If
1392
+ * `recipient.kba_method` is set (not null), and `recipient.kba_completed` is false, this endpoint
1393
+ * should be called to determine the next KBA step required.
1394
+ */
1395
+ const getKbaStatus = (endpoint, envelopeId, roleName) => endpoint.api //
1396
+ .get(`/v2/kba/${envelopeId}/${encodeURIComponent(roleName)}`)
1397
+ .then((r) => r.data);
1398
+ /**
1399
+ * Submit a response to a KBA PIN challenge.
1400
+ */
1401
+ const submitKbaPin = (endpoint, envelopeId, roleName, pin) => endpoint.api //
1402
+ .post(`/v2/kba/pin`, { envelopeId, roleName, pin })
1403
+ .then((r) => r.data);
1404
+ /**
1405
+ * Submit an identity response to a KBA challenge.
1406
+ */
1407
+ const submitKbaIdentity = (endpoint, envelopeId, roleName, identity) => endpoint.api //
1408
+ .post(`/v2/kba/identity`, { envelopeId, roleName, identity })
1409
+ .then((r) => r.data);
1410
+ /**
1411
+ * Submit an identity response to a KBA challenge.
1412
+ */
1413
+ const submitKbaChallengeResponse = (endpoint, envelopeId, roleName, response) => endpoint.api //
1414
+ .post(`/v2/kba/response`, { envelopeId, roleName, response })
1415
+ .then((r) => r.data);
1416
+
1388
1417
  /**
1389
1418
  * Update a recipient's status block
1390
1419
  */
@@ -1770,6 +1799,52 @@ const deleteOrganization = (endpoint, organizationId) => endpoint.api //
1770
1799
  const updateOrganization = (endpoint, organizationId, params) => endpoint.api //
1771
1800
  .patch(`/v2/organizations/${organizationId}`, params)
1772
1801
  .then((r) => r.data);
1802
+ /**
1803
+ * Update the organization's logo. This can only be called by an admin or owner of the organization.
1804
+ *
1805
+ * ```typescript
1806
+ * import {uploadOrganizationLogo} from '@verdocs/js-sdk';
1807
+ *
1808
+ * await uploadOrganizationLogo((VerdocsEndpoint.getDefault(), file);
1809
+ * ```
1810
+ */
1811
+ const uploadOrganizationLogo = (endpoint, file, onUploadProgress) => {
1812
+ const formData = new FormData();
1813
+ formData.append('document', file, file.name);
1814
+ return endpoint.api //
1815
+ .post(`/v2/organizations/logo`, formData, {
1816
+ timeout: 120000,
1817
+ onUploadProgress: (event) => {
1818
+ const total = event.total || 1;
1819
+ const loaded = event.loaded || 0;
1820
+ onUploadProgress?.(Math.floor((loaded * 100) / (total || 1)), loaded, total || 1);
1821
+ },
1822
+ })
1823
+ .then((r) => r.data);
1824
+ };
1825
+ /**
1826
+ * Update the organization's thumbnail. This can only be called by an admin or owner of the organization.
1827
+ *
1828
+ * ```typescript
1829
+ * import {uploadOrganizationThumbnail} from '@verdocs/js-sdk';
1830
+ *
1831
+ * await uploadOrganizationThumbnail((VerdocsEndpoint.getDefault(), file);
1832
+ * ```
1833
+ */
1834
+ const uploadOrganizationThumbnail = (endpoint, file, onUploadProgress) => {
1835
+ const formData = new FormData();
1836
+ formData.append('document', file, file.name);
1837
+ return endpoint.api //
1838
+ .post(`/v2/organizations/thumbnail`, formData, {
1839
+ timeout: 120000,
1840
+ onUploadProgress: (event) => {
1841
+ const total = event.total || 1;
1842
+ const loaded = event.loaded || 0;
1843
+ onUploadProgress?.(Math.floor((loaded * 100) / (total || 1)), loaded, total || 1);
1844
+ },
1845
+ })
1846
+ .then((r) => r.data);
1847
+ };
1773
1848
 
1774
1849
  /**
1775
1850
  * Webhooks are callback triggers from Verdocs to your servers that notify your applications
@@ -2672,6 +2747,29 @@ const deleteProfile = (endpoint, profileId) => endpoint.api //
2672
2747
  const createProfile = (endpoint, params) => endpoint.api //
2673
2748
  .post('/v2/profiles', params)
2674
2749
  .then((r) => r.data);
2750
+ /**
2751
+ * Update the caller's profile photo. This can only be called for the user's "current" profile.
2752
+ *
2753
+ * ```typescript
2754
+ * import {uploadProfilePhoto} from '@verdocs/js-sdk';
2755
+ *
2756
+ * await uploadProfilePhoto((VerdocsEndpoint.getDefault(), file);
2757
+ * ```
2758
+ */
2759
+ const uploadProfilePhoto = (endpoint, file, onUploadProgress) => {
2760
+ const formData = new FormData();
2761
+ formData.append('document', file, file.name);
2762
+ return endpoint.api //
2763
+ .post(`/v2/profiles/picture`, formData, {
2764
+ timeout: 120000,
2765
+ onUploadProgress: (event) => {
2766
+ const total = event.total || 1;
2767
+ const loaded = event.loaded || 0;
2768
+ onUploadProgress?.(Math.floor((loaded * 100) / (total || 1)), loaded, total || 1);
2769
+ },
2770
+ })
2771
+ .then((r) => r.data);
2772
+ };
2675
2773
 
2676
2774
  exports.AtoB = AtoB;
2677
2775
  exports.Countries = Countries;
@@ -2754,6 +2852,7 @@ exports.getFieldsForRole = getFieldsForRole;
2754
2852
  exports.getGroup = getGroup;
2755
2853
  exports.getGroups = getGroups;
2756
2854
  exports.getInPersonLink = getInPersonLink;
2855
+ exports.getKbaStatus = getKbaStatus;
2757
2856
  exports.getMatchingCountry = getMatchingCountry;
2758
2857
  exports.getNextRecipient = getNextRecipient;
2759
2858
  exports.getNotifications = getNotifications;
@@ -2825,6 +2924,9 @@ exports.searchEnvelopes = searchEnvelopes;
2825
2924
  exports.searchTemplates = searchTemplates;
2826
2925
  exports.sendDelegate = sendDelegate;
2827
2926
  exports.setWebhooks = setWebhooks;
2927
+ exports.submitKbaChallengeResponse = submitKbaChallengeResponse;
2928
+ exports.submitKbaIdentity = submitKbaIdentity;
2929
+ exports.submitKbaPin = submitKbaPin;
2828
2930
  exports.switchProfile = switchProfile;
2829
2931
  exports.throttledGetEnvelope = throttledGetEnvelope;
2830
2932
  exports.throttledGetTemplate = throttledGetTemplate;
@@ -2846,6 +2948,9 @@ exports.updateTemplate = updateTemplate;
2846
2948
  exports.updateTemplateReminder = updateTemplateReminder;
2847
2949
  exports.updateTemplateRole = updateTemplateRole;
2848
2950
  exports.uploadEnvelopeFieldAttachment = uploadEnvelopeFieldAttachment;
2951
+ exports.uploadOrganizationLogo = uploadOrganizationLogo;
2952
+ exports.uploadOrganizationThumbnail = uploadOrganizationThumbnail;
2953
+ exports.uploadProfilePhoto = uploadProfilePhoto;
2849
2954
  exports.userCanAct = userCanAct;
2850
2955
  exports.userCanBuildTemplate = userCanBuildTemplate;
2851
2956
  exports.userCanCancelEnvelope = userCanCancelEnvelope;