@verdocs/js-sdk 4.0.3 → 4.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -636,37 +636,176 @@ interface IActivityEntry {
636
636
  type: TRecipientType;
637
637
  };
638
638
  }
639
- type TRequestStatus = "OK" | "ERROR";
640
- type TTemplateSenderType = "creator" | "organization_member" | "organization_member_as_creator" | "everyone" | "everyone_as_creator";
641
- type TTemplatePermission = "template:creator:create:public" | "template:creator:create:org" | "template:creator:create:personal" | "template:creator:delete" | "template:creator:visibility" | "template:member:read" | "template:member:write" | "template:member:delete" | "template:member:visibility";
642
- type TTemplateAction = "create_personal" | "create_org" | "create_public" | "read" | "write" | "delete" | "change_visibility_personal" | "change_visibility_org" | "change_visibility_public";
643
- type TAccountPermission = "owner:add" | "owner:remove" | "admin:add" | "admin:remove" | "member:view" | "member:add" | "member:remove";
644
- type TOrgPermission = "org:create" | "org:view" | "org:update" | "org:delete" | "org:transfer" | "org:list";
645
- type TApiKeyPermission = "personal" | "global_read" | "global_write";
646
- /**
647
- * Operation within Verdocs that users may perform.
648
- */
649
- type TPermission = TTemplatePermission | TOrgPermission | TAccountPermission;
650
- type TRecipientAction = "submit" | "decline" | "prepare" | "update";
651
- type TEnvelopeStatus = "complete" | "pending" | "in progress" | "declined" | "canceled";
652
- type TRecipientStatus = "invited" | "opened" | "signed" | "submitted" | "canceled" | "pending" | "declined";
653
- type TRecipientType = "signer" | "cc" | "approver";
654
639
  /**
655
- * Plans provide access to Verdocs product features.
656
- */
657
- type TPlan = "env:essential" | "org:standard";
658
- /**
659
- * Roles provide access to groups of permissions. Note that for historical reasons there is some overlap in the
660
- * use of the term "role". TRole refers to a user type. A "Role" (IRole) is a Template participant placeholder.
640
+ * One entry in an envelope search result.
641
+ * NOTE: Many of the fields here are undefined unless "summary=true" is included in the search terms
661
642
  */
662
- type TRole = "contact" | "basic_user" | "member" | "admin" | "owner";
663
- type TSortTemplateBy = "created_at" | "updated_at" | "name" | "last_used_at" | "counter" | "star_counter";
664
- type TAccessKeyType = "email" | "in_app" | "in_person_link" | "sms";
665
- type THistoryEvent = "recipient:signed" | "recipient:opened" | "recipient:submitted" | "recipient:prepared" | "recipient:claimed" | "recipient:agreed" | "recipient:invited" | "recipient:delegated" | "recipient:updated_info" | "recipient:declined" | "invitation:resent" | "envelope:cc" | "created" | "completed" | "canceled" | "owner:updated_recipient_info" | "owner:canceled" | "owner:get_in_person_link";
666
- type TEventDetail = "in_app" | "mail" | "signer" | "sms" | "reminder" | "preparer" | "manual" | "in_person_link" | "guest" | "email" | "" | string; // Modification events have a string description
667
- // Modification events have a string description
668
- type TEnvelopeUpdateResult = Omit<IEnvelope, "histories" | "recipients" | "certificate" | "document" | "fields" | "profile">;
669
- type TFieldType = "signature" | "initial" | "checkbox_group" | "radio_button_group" | "textbox" | "timestamp" | "date" | "dropdown" | "textarea" | "attachment" | "payment";
643
+ interface IEnvelopesSearchResultEntry {
644
+ id: string;
645
+ canceled_at: string;
646
+ certificate_document_id: string;
647
+ created_at: string;
648
+ histories: IEnvelopeHistory[];
649
+ indexed_at: string;
650
+ name: string;
651
+ no_contact: boolean;
652
+ organization_id: string;
653
+ profile_id: string;
654
+ recipients: IRecipient[];
655
+ reminder_id: string | null;
656
+ status: TEnvelopeStatus;
657
+ /** Defaults to 'private'. If set to 'shared', this envelope will be visible to other users in the same organization. Ignored for personal profiles. */
658
+ visibility: "private" | "shared";
659
+ next_recipient: {
660
+ claimed: boolean;
661
+ email: string;
662
+ name: string;
663
+ profile_id: string;
664
+ status: TRecipientStatus;
665
+ type: TRecipientType;
666
+ };
667
+ template_id: string;
668
+ total_count: number;
669
+ updated_at: string;
670
+ }
671
+ interface IEnvelopesSearchResult {
672
+ page: number;
673
+ total: number;
674
+ result: IEnvelopesSearchResultEntry[];
675
+ }
676
+ interface IEnvelopesSummary {
677
+ action_required: {
678
+ page: number;
679
+ total: number;
680
+ result: IActivityEntry[];
681
+ };
682
+ completed: {
683
+ page: number;
684
+ total: number;
685
+ result: IActivityEntry[];
686
+ };
687
+ waiting_others: {
688
+ page: number;
689
+ total: number;
690
+ result: IActivityEntry[];
691
+ };
692
+ }
693
+ interface IDocumentSearchOptions {
694
+ rows?: number;
695
+ page?: number;
696
+ sort_by?: "updated_at" | "created_at";
697
+ ascending?: boolean;
698
+ is_owner?: boolean;
699
+ is_recipient?: boolean;
700
+ envelope_status?: TEnvelopeStatus[];
701
+ recipient_status?: TEnvelopeStatus[];
702
+ }
703
+ interface ICreateEnvelopeRole {
704
+ /** The type of role to create. Most participants in standard flows will be "signer" recipients. */
705
+ type: TRecipientType;
706
+ /**
707
+ * The Role name of the recipient. Please note this is not the person's name. It is the ID of the role, e.g.
708
+ * 'Recipient 1', 'Seller', etc. This must match one of the pre-defined roles in the template's Recipients list.
709
+ */
710
+ name: string;
711
+ /** The full name of the recipient as it will be displayed in reports and queries, e.g. 'Paige Turner'. */
712
+ full_name: string;
713
+ /** The email address of the recipient. One of `email` or `phone` must be provided. */
714
+ email?: string;
715
+ /**
716
+ * The phone number of the recipient. One of `email` or `phone` must be provided. If `phone` is included, the
717
+ * recipient will receive an SMS notification for the document.
718
+ */
719
+ phone?: string;
720
+ /**
721
+ * The 1-based sequence number for the recipient. This can be used to override the template's workflow. Recipients
722
+ * are processed in parallel for each matching sequence number (e.g. all recipients at level "1" may act in parallel)
723
+ * and in series between sequence numbers (e.g. all recipients at level "1" must complete their tasks before
724
+ * recipients at level "2" may act).
725
+ */
726
+ sequence: number;
727
+ /** Whether the recipient may delegate their tasks to others. Should be false for most standard workflows. */
728
+ delegator: boolean;
729
+ /** A custom message to include in the email or SMS invitation. May be left blank for a default message. */
730
+ message: string;
731
+ }
732
+ interface IEnvelopeSummary {
733
+ id: string;
734
+ profile_id: string;
735
+ organization_id: string | null;
736
+ name: string;
737
+ status: TEnvelopeStatus;
738
+ template_id: string;
739
+ created_at: string;
740
+ updated_at: string;
741
+ canceled_at: string;
742
+ envelope_document_id: string;
743
+ certificate_document_id: string | null;
744
+ reminder_id: string | null;
745
+ no_contact: boolean;
746
+ visibility: "private" | "shared";
747
+ documents: IEnvelopeDocument[];
748
+ recipients: IRecipient[];
749
+ fields: IEnvelopeField[];
750
+ }
751
+ interface IEnvelopeSummaries {
752
+ page: number;
753
+ count: number;
754
+ total: number;
755
+ records: IEnvelopeSummary[];
756
+ }
757
+ interface IInPersonLinkResponse {
758
+ link: string;
759
+ envelope_id: string;
760
+ profile_id: string;
761
+ role_name: string;
762
+ access_key: string;
763
+ expiration_date: string;
764
+ type: TAccessKey;
765
+ }
766
+ interface IUpdateRecipientSubmitParams {
767
+ action: "submit";
768
+ }
769
+ interface IUpdateRecipientDeclineParams {
770
+ action: "decline";
771
+ }
772
+ interface IUpdateRecipientClaimEnvelope {
773
+ action: "owner_update";
774
+ full_name: string;
775
+ email: string;
776
+ }
777
+ interface IUpdateRecipientStatus {
778
+ new_full_name?: string;
779
+ agreed?: boolean;
780
+ action?: "prepare" | "update";
781
+ }
782
+ interface IUpdateRecipientAgreedParams {
783
+ action: "update";
784
+ agreed: boolean;
785
+ }
786
+ interface IUpdateRecipientNameParams {
787
+ action: "update";
788
+ new_full_name: string;
789
+ }
790
+ interface IUpdateRecipientPrepareParams {
791
+ action: "prepare";
792
+ recipients: IRecipient[];
793
+ }
794
+ interface ICreateEnvelopeReminderRequest {
795
+ setup_time: number;
796
+ interval_time: number;
797
+ }
798
+ interface ICreateEnvelopeRequest {
799
+ template_id: string;
800
+ roles: ICreateEnvelopeRole[];
801
+ name: string;
802
+ environment?: string;
803
+ prepared_fields?: {
804
+ name: string;
805
+ value: string;
806
+ }[];
807
+ }
808
+ type TEnvelopePermission = "envelope:create" | "envelope:cancel" | "envelope:view";
670
809
  interface ISigningSessionRequest {
671
810
  envelopeId: string;
672
811
  roleId: string;
@@ -720,6 +859,10 @@ type TSession = IUserSession | ISigningSession | null;
720
859
  * An active authenticated session within Verdocs, either for signing or regular user-based operations.
721
860
  */
722
861
  type TActiveSession = IUserSession | ISigningSession;
862
+ /**
863
+ * Confirm whether the user has all of the specified permissions.
864
+ */
865
+ declare const userHasPermissions: (session: TSession, permissions: TPermission[]) => boolean;
723
866
  type TEnvironment = "verdocs" | "verdocs-stage";
724
867
  type TSessionChangedListener = (endpoint: VerdocsEndpoint, session: TSession) => void;
725
868
  interface VerdocsEndpointOptions {
@@ -917,179 +1060,6 @@ declare class VerdocsEndpoint {
917
1060
  */
918
1061
  loadSession(): VerdocsEndpoint;
919
1062
  }
920
- /**
921
- * One entry in an envelope search result.
922
- * NOTE: Many of the fields here are undefined unless "summary=true" is included in the search terms
923
- */
924
- interface IEnvelopesSearchResultEntry {
925
- id: string;
926
- canceled_at: string;
927
- certificate_document_id: string;
928
- created_at: string;
929
- histories: IEnvelopeHistory[];
930
- indexed_at: string;
931
- name: string;
932
- no_contact: boolean;
933
- organization_id: string;
934
- profile_id: string;
935
- recipients: IRecipient[];
936
- reminder_id: string | null;
937
- status: TEnvelopeStatus;
938
- /** Defaults to 'private'. If set to 'shared', this envelope will be visible to other users in the same organization. Ignored for personal profiles. */
939
- visibility: "private" | "shared";
940
- next_recipient: {
941
- claimed: boolean;
942
- email: string;
943
- name: string;
944
- profile_id: string;
945
- status: TRecipientStatus;
946
- type: TRecipientType;
947
- };
948
- template_id: string;
949
- total_count: number;
950
- updated_at: string;
951
- }
952
- interface IEnvelopesSearchResult {
953
- page: number;
954
- total: number;
955
- result: IEnvelopesSearchResultEntry[];
956
- }
957
- interface IEnvelopesSummary {
958
- action_required: {
959
- page: number;
960
- total: number;
961
- result: IActivityEntry[];
962
- };
963
- completed: {
964
- page: number;
965
- total: number;
966
- result: IActivityEntry[];
967
- };
968
- waiting_others: {
969
- page: number;
970
- total: number;
971
- result: IActivityEntry[];
972
- };
973
- }
974
- interface IDocumentSearchOptions {
975
- rows?: number;
976
- page?: number;
977
- sort_by?: "updated_at" | "created_at";
978
- ascending?: boolean;
979
- is_owner?: boolean;
980
- is_recipient?: boolean;
981
- envelope_status?: TEnvelopeStatus[];
982
- recipient_status?: TEnvelopeStatus[];
983
- }
984
- interface ICreateEnvelopeRole {
985
- /** The type of role to create. Most participants in standard flows will be "signer" recipients. */
986
- type: TRecipientType;
987
- /**
988
- * The Role name of the recipient. Please note this is not the person's name. It is the ID of the role, e.g.
989
- * 'Recipient 1', 'Seller', etc. This must match one of the pre-defined roles in the template's Recipients list.
990
- */
991
- name: string;
992
- /** The full name of the recipient as it will be displayed in reports and queries, e.g. 'Paige Turner'. */
993
- full_name: string;
994
- /** The email address of the recipient. One of `email` or `phone` must be provided. */
995
- email?: string;
996
- /**
997
- * The phone number of the recipient. One of `email` or `phone` must be provided. If `phone` is included, the
998
- * recipient will receive an SMS notification for the document.
999
- */
1000
- phone?: string;
1001
- /**
1002
- * The 1-based sequence number for the recipient. This can be used to override the template's workflow. Recipients
1003
- * are processed in parallel for each matching sequence number (e.g. all recipients at level "1" may act in parallel)
1004
- * and in series between sequence numbers (e.g. all recipients at level "1" must complete their tasks before
1005
- * recipients at level "2" may act).
1006
- */
1007
- sequence: number;
1008
- /** Whether the recipient may delegate their tasks to others. Should be false for most standard workflows. */
1009
- delegator: boolean;
1010
- /** A custom message to include in the email or SMS invitation. May be left blank for a default message. */
1011
- message: string;
1012
- }
1013
- interface IEnvelopeSummary {
1014
- id: string;
1015
- profile_id: string;
1016
- organization_id: string | null;
1017
- name: string;
1018
- status: TEnvelopeStatus;
1019
- template_id: string;
1020
- created_at: string;
1021
- updated_at: string;
1022
- canceled_at: string;
1023
- envelope_document_id: string;
1024
- certificate_document_id: string | null;
1025
- reminder_id: string | null;
1026
- no_contact: boolean;
1027
- visibility: "private" | "shared";
1028
- documents: IEnvelopeDocument[];
1029
- recipients: IRecipient[];
1030
- fields: IEnvelopeField[];
1031
- }
1032
- interface IEnvelopeSummaries {
1033
- page: number;
1034
- count: number;
1035
- total: number;
1036
- records: IEnvelopeSummary[];
1037
- }
1038
- interface IInPersonLinkResponse {
1039
- link: string;
1040
- envelope_id: string;
1041
- profile_id: string;
1042
- role_name: string;
1043
- access_key: string;
1044
- expiration_date: string;
1045
- type: TAccessKey;
1046
- }
1047
- interface IUpdateRecipientSubmitParams {
1048
- action: "submit";
1049
- }
1050
- interface IUpdateRecipientDeclineParams {
1051
- action: "decline";
1052
- }
1053
- interface IUpdateRecipientClaimEnvelope {
1054
- action: "owner_update";
1055
- full_name: string;
1056
- email: string;
1057
- }
1058
- interface IUpdateRecipientStatus {
1059
- new_full_name?: string;
1060
- agreed?: boolean;
1061
- action?: "prepare" | "update";
1062
- }
1063
- interface IUpdateRecipientAgreedParams {
1064
- action: "update";
1065
- agreed: boolean;
1066
- }
1067
- interface IUpdateRecipientNameParams {
1068
- action: "update";
1069
- new_full_name: string;
1070
- }
1071
- interface IUpdateRecipientPrepareParams {
1072
- action: "prepare";
1073
- recipients: IRecipient[];
1074
- }
1075
- interface ICreateEnvelopeReminderRequest {
1076
- setup_time: number;
1077
- interval_time: number;
1078
- }
1079
- interface ICreateEnvelopeRequest {
1080
- template_id: string;
1081
- roles: ICreateEnvelopeRole[];
1082
- name: string;
1083
- environment?: string;
1084
- prepared_fields?: {
1085
- name: string;
1086
- value: string;
1087
- }[];
1088
- }
1089
- /**
1090
- * Confirm whether the user has all of the specified permissions.
1091
- */
1092
- declare const userHasPermissions: (session: TSession, permissions: TPermission[]) => boolean;
1093
1063
  /**
1094
1064
  * Create an envelope
1095
1065
  *
@@ -1459,6 +1429,37 @@ declare const getSignature: (endpoint: VerdocsEndpoint, signatureId: string) =>
1459
1429
  * Delete a user's signature.
1460
1430
  */
1461
1431
  declare const deleteSignature: (endpoint: VerdocsEndpoint, signatureId: string) => Promise<any>;
1432
+ type TRequestStatus = "OK" | "ERROR";
1433
+ type TTemplateSenderType = "creator" | "organization_member" | "organization_member_as_creator" | "everyone" | "everyone_as_creator";
1434
+ type TTemplatePermission = "template:creator:create:public" | "template:creator:create:org" | "template:creator:create:personal" | "template:creator:delete" | "template:creator:visibility" | "template:member:read" | "template:member:write" | "template:member:delete" | "template:member:visibility";
1435
+ type TTemplateAction = "create_personal" | "create_org" | "create_public" | "read" | "write" | "delete" | "change_visibility_personal" | "change_visibility_org" | "change_visibility_public";
1436
+ type TAccountPermission = "owner:add" | "owner:remove" | "admin:add" | "admin:remove" | "member:view" | "member:add" | "member:remove";
1437
+ type TOrgPermission = "org:create" | "org:view" | "org:update" | "org:delete" | "org:transfer" | "org:list";
1438
+ type TApiKeyPermission = "personal" | "global_read" | "global_write";
1439
+ /**
1440
+ * Operation within Verdocs that users may perform.
1441
+ */
1442
+ type TPermission = TTemplatePermission | TOrgPermission | TAccountPermission | TEnvelopePermission;
1443
+ type TRecipientAction = "submit" | "decline" | "prepare" | "update";
1444
+ type TEnvelopeStatus = "complete" | "pending" | "in progress" | "declined" | "canceled";
1445
+ type TRecipientStatus = "invited" | "opened" | "signed" | "submitted" | "canceled" | "pending" | "declined";
1446
+ type TRecipientType = "signer" | "cc" | "approver";
1447
+ /**
1448
+ * Plans provide access to Verdocs product features.
1449
+ */
1450
+ type TPlan = "env:essential" | "org:standard";
1451
+ /**
1452
+ * Roles provide access to groups of permissions. Note that for historical reasons there is some overlap in the
1453
+ * use of the term "role". TRole refers to a user type. A "Role" (IRole) is a Template participant placeholder.
1454
+ */
1455
+ type TRole = "contact" | "basic_user" | "member" | "admin" | "owner";
1456
+ type TSortTemplateBy = "created_at" | "updated_at" | "name" | "last_used_at" | "counter" | "star_counter";
1457
+ type TAccessKeyType = "email" | "in_app" | "in_person_link" | "sms";
1458
+ type THistoryEvent = "recipient:signed" | "recipient:opened" | "recipient:submitted" | "recipient:prepared" | "recipient:claimed" | "recipient:agreed" | "recipient:invited" | "recipient:delegated" | "recipient:updated_info" | "recipient:declined" | "invitation:resent" | "envelope:cc" | "created" | "completed" | "canceled" | "owner:updated_recipient_info" | "owner:canceled" | "owner:get_in_person_link";
1459
+ type TEventDetail = "in_app" | "mail" | "signer" | "sms" | "reminder" | "preparer" | "manual" | "in_person_link" | "guest" | "email" | "" | string; // Modification events have a string description
1460
+ // Modification events have a string description
1461
+ type TEnvelopeUpdateResult = Omit<IEnvelope, "histories" | "recipients" | "certificate" | "document" | "fields" | "profile">;
1462
+ type TFieldType = "signature" | "initial" | "checkbox_group" | "radio_button_group" | "textbox" | "timestamp" | "date" | "dropdown" | "textarea" | "attachment" | "payment";
1462
1463
  interface ICreateApiKeyRequest {
1463
1464
  name: string;
1464
1465
  permission: TApiKeyPermission;
@@ -2529,4 +2530,4 @@ interface ISignupSurvey {
2529
2530
  declare const recordSignupSurvey: (endpoint: VerdocsEndpoint, params: ISignupSurvey) => Promise<{
2530
2531
  status: "OK";
2531
2532
  }>;
2532
- export { TRequestStatus, TTemplateSenderType, TTemplatePermission, TTemplateAction, TAccountPermission, TOrgPermission, TApiKeyPermission, TPermission, TRecipientAction, TEnvelopeStatus, TRecipientStatus, TRecipientType, TPlan, 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, 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, getApiKeys, createApiKey, rotateApiKey, updateApiKey, deleteApiKey, getGroups, getGroupByName, getGroup, getGroupMembers, addGroupMembers, deleteGroupMembers, addGroupPermission, deleteGroupPermission, getOrganizationInvitations, createOrganizationInvitation, deleteOrganizationInvitation, updateOrganizationInvitation, resendOrganizationInvitation, getOrganizationInvitation, acceptOrganizationInvitation, declineOrganizationInvitation, claimNewUser, getOrganizationMembers, deleteOrganizationMember, addOrganizationMemberRole, deleteOrganizationMemberRole, getOrganizationMemberPlans, getOrganizations, createOrganization, deleteOrganization, getOrganization, updateOrganization, ICreateApiKeyRequest, IUpdateApiKeyRequest, ICreateInvitationRequest, ISetWebhookRequest, getWebhooks, setWebhooks, userHasPermissions, ISigningSessionRequest, ISigningSession, IUserSession, TSessionType, TSession, TActiveSession, canPerformTemplateAction, hasRequiredPermissions, createField, updateField, deleteField, 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, authenticateUser, authenticateApp, validateToken, refreshTokens, updatePassword, resetPassword, updateEmail, resendVerification, createUser, billingPlaceholder, getNotifications, getProfiles, getCurrentProfile, getRoles, getPermissions, createProfile, getProfile, getProfilePermissions, getProfileGroups, switchProfile, updateProfile, deleteProfile, createBusinessAccount, ISignupSurvey, recordSignupSurvey, ICreateProfileRequest, ISwitchProfileResponse, IUpdateProfileRequest, IAuthenticateUserRequest, IAuthenticateAppRequest, IAuthenticateResponse, TokenValidationRequest, TokenValidationResponse, IUpdatePasswordRequest, UpdatePasswordResponse, UpdateEmailRequest, UpdateEmailResponse, ICreateBusinessAccountRequest, ICreateUserRequest, 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 };
2533
+ export { TRequestStatus, TTemplateSenderType, TTemplatePermission, TTemplateAction, TAccountPermission, TOrgPermission, TApiKeyPermission, TPermission, TRecipientAction, TEnvelopeStatus, TRecipientStatus, TRecipientType, TPlan, 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, 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, getGroupByName, getGroup, getGroupMembers, addGroupMembers, deleteGroupMembers, addGroupPermission, deleteGroupPermission, getOrganizationInvitations, createOrganizationInvitation, deleteOrganizationInvitation, updateOrganizationInvitation, resendOrganizationInvitation, getOrganizationInvitation, acceptOrganizationInvitation, declineOrganizationInvitation, claimNewUser, getOrganizationMembers, deleteOrganizationMember, addOrganizationMemberRole, deleteOrganizationMemberRole, getOrganizationMemberPlans, getOrganizations, createOrganization, deleteOrganization, getOrganization, updateOrganization, ICreateApiKeyRequest, IUpdateApiKeyRequest, ICreateInvitationRequest, ISetWebhookRequest, getWebhooks, setWebhooks, userHasPermissions, ISigningSessionRequest, ISigningSession, IUserSession, TSessionType, TSession, TActiveSession, canPerformTemplateAction, hasRequiredPermissions, createField, updateField, deleteField, 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, authenticateUser, authenticateApp, validateToken, refreshTokens, updatePassword, resetPassword, updateEmail, resendVerification, createUser, billingPlaceholder, getNotifications, getProfiles, getCurrentProfile, getRoles, getPermissions, createProfile, getProfile, getProfilePermissions, getProfileGroups, switchProfile, updateProfile, deleteProfile, createBusinessAccount, ISignupSurvey, recordSignupSurvey, ICreateProfileRequest, ISwitchProfileResponse, IUpdateProfileRequest, IAuthenticateUserRequest, IAuthenticateAppRequest, IAuthenticateResponse, TokenValidationRequest, TokenValidationResponse, IUpdatePasswordRequest, UpdatePasswordResponse, UpdateEmailRequest, UpdateEmailResponse, ICreateBusinessAccountRequest, ICreateUserRequest, 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
@@ -636,37 +636,176 @@ interface IActivityEntry {
636
636
  type: TRecipientType;
637
637
  };
638
638
  }
639
- type TRequestStatus = "OK" | "ERROR";
640
- type TTemplateSenderType = "creator" | "organization_member" | "organization_member_as_creator" | "everyone" | "everyone_as_creator";
641
- type TTemplatePermission = "template:creator:create:public" | "template:creator:create:org" | "template:creator:create:personal" | "template:creator:delete" | "template:creator:visibility" | "template:member:read" | "template:member:write" | "template:member:delete" | "template:member:visibility";
642
- type TTemplateAction = "create_personal" | "create_org" | "create_public" | "read" | "write" | "delete" | "change_visibility_personal" | "change_visibility_org" | "change_visibility_public";
643
- type TAccountPermission = "owner:add" | "owner:remove" | "admin:add" | "admin:remove" | "member:view" | "member:add" | "member:remove";
644
- type TOrgPermission = "org:create" | "org:view" | "org:update" | "org:delete" | "org:transfer" | "org:list";
645
- type TApiKeyPermission = "personal" | "global_read" | "global_write";
646
- /**
647
- * Operation within Verdocs that users may perform.
648
- */
649
- type TPermission = TTemplatePermission | TOrgPermission | TAccountPermission;
650
- type TRecipientAction = "submit" | "decline" | "prepare" | "update";
651
- type TEnvelopeStatus = "complete" | "pending" | "in progress" | "declined" | "canceled";
652
- type TRecipientStatus = "invited" | "opened" | "signed" | "submitted" | "canceled" | "pending" | "declined";
653
- type TRecipientType = "signer" | "cc" | "approver";
654
639
  /**
655
- * Plans provide access to Verdocs product features.
656
- */
657
- type TPlan = "env:essential" | "org:standard";
658
- /**
659
- * Roles provide access to groups of permissions. Note that for historical reasons there is some overlap in the
660
- * use of the term "role". TRole refers to a user type. A "Role" (IRole) is a Template participant placeholder.
640
+ * One entry in an envelope search result.
641
+ * NOTE: Many of the fields here are undefined unless "summary=true" is included in the search terms
661
642
  */
662
- type TRole = "contact" | "basic_user" | "member" | "admin" | "owner";
663
- type TSortTemplateBy = "created_at" | "updated_at" | "name" | "last_used_at" | "counter" | "star_counter";
664
- type TAccessKeyType = "email" | "in_app" | "in_person_link" | "sms";
665
- type THistoryEvent = "recipient:signed" | "recipient:opened" | "recipient:submitted" | "recipient:prepared" | "recipient:claimed" | "recipient:agreed" | "recipient:invited" | "recipient:delegated" | "recipient:updated_info" | "recipient:declined" | "invitation:resent" | "envelope:cc" | "created" | "completed" | "canceled" | "owner:updated_recipient_info" | "owner:canceled" | "owner:get_in_person_link";
666
- type TEventDetail = "in_app" | "mail" | "signer" | "sms" | "reminder" | "preparer" | "manual" | "in_person_link" | "guest" | "email" | "" | string; // Modification events have a string description
667
- // Modification events have a string description
668
- type TEnvelopeUpdateResult = Omit<IEnvelope, "histories" | "recipients" | "certificate" | "document" | "fields" | "profile">;
669
- type TFieldType = "signature" | "initial" | "checkbox_group" | "radio_button_group" | "textbox" | "timestamp" | "date" | "dropdown" | "textarea" | "attachment" | "payment";
643
+ interface IEnvelopesSearchResultEntry {
644
+ id: string;
645
+ canceled_at: string;
646
+ certificate_document_id: string;
647
+ created_at: string;
648
+ histories: IEnvelopeHistory[];
649
+ indexed_at: string;
650
+ name: string;
651
+ no_contact: boolean;
652
+ organization_id: string;
653
+ profile_id: string;
654
+ recipients: IRecipient[];
655
+ reminder_id: string | null;
656
+ status: TEnvelopeStatus;
657
+ /** Defaults to 'private'. If set to 'shared', this envelope will be visible to other users in the same organization. Ignored for personal profiles. */
658
+ visibility: "private" | "shared";
659
+ next_recipient: {
660
+ claimed: boolean;
661
+ email: string;
662
+ name: string;
663
+ profile_id: string;
664
+ status: TRecipientStatus;
665
+ type: TRecipientType;
666
+ };
667
+ template_id: string;
668
+ total_count: number;
669
+ updated_at: string;
670
+ }
671
+ interface IEnvelopesSearchResult {
672
+ page: number;
673
+ total: number;
674
+ result: IEnvelopesSearchResultEntry[];
675
+ }
676
+ interface IEnvelopesSummary {
677
+ action_required: {
678
+ page: number;
679
+ total: number;
680
+ result: IActivityEntry[];
681
+ };
682
+ completed: {
683
+ page: number;
684
+ total: number;
685
+ result: IActivityEntry[];
686
+ };
687
+ waiting_others: {
688
+ page: number;
689
+ total: number;
690
+ result: IActivityEntry[];
691
+ };
692
+ }
693
+ interface IDocumentSearchOptions {
694
+ rows?: number;
695
+ page?: number;
696
+ sort_by?: "updated_at" | "created_at";
697
+ ascending?: boolean;
698
+ is_owner?: boolean;
699
+ is_recipient?: boolean;
700
+ envelope_status?: TEnvelopeStatus[];
701
+ recipient_status?: TEnvelopeStatus[];
702
+ }
703
+ interface ICreateEnvelopeRole {
704
+ /** The type of role to create. Most participants in standard flows will be "signer" recipients. */
705
+ type: TRecipientType;
706
+ /**
707
+ * The Role name of the recipient. Please note this is not the person's name. It is the ID of the role, e.g.
708
+ * 'Recipient 1', 'Seller', etc. This must match one of the pre-defined roles in the template's Recipients list.
709
+ */
710
+ name: string;
711
+ /** The full name of the recipient as it will be displayed in reports and queries, e.g. 'Paige Turner'. */
712
+ full_name: string;
713
+ /** The email address of the recipient. One of `email` or `phone` must be provided. */
714
+ email?: string;
715
+ /**
716
+ * The phone number of the recipient. One of `email` or `phone` must be provided. If `phone` is included, the
717
+ * recipient will receive an SMS notification for the document.
718
+ */
719
+ phone?: string;
720
+ /**
721
+ * The 1-based sequence number for the recipient. This can be used to override the template's workflow. Recipients
722
+ * are processed in parallel for each matching sequence number (e.g. all recipients at level "1" may act in parallel)
723
+ * and in series between sequence numbers (e.g. all recipients at level "1" must complete their tasks before
724
+ * recipients at level "2" may act).
725
+ */
726
+ sequence: number;
727
+ /** Whether the recipient may delegate their tasks to others. Should be false for most standard workflows. */
728
+ delegator: boolean;
729
+ /** A custom message to include in the email or SMS invitation. May be left blank for a default message. */
730
+ message: string;
731
+ }
732
+ interface IEnvelopeSummary {
733
+ id: string;
734
+ profile_id: string;
735
+ organization_id: string | null;
736
+ name: string;
737
+ status: TEnvelopeStatus;
738
+ template_id: string;
739
+ created_at: string;
740
+ updated_at: string;
741
+ canceled_at: string;
742
+ envelope_document_id: string;
743
+ certificate_document_id: string | null;
744
+ reminder_id: string | null;
745
+ no_contact: boolean;
746
+ visibility: "private" | "shared";
747
+ documents: IEnvelopeDocument[];
748
+ recipients: IRecipient[];
749
+ fields: IEnvelopeField[];
750
+ }
751
+ interface IEnvelopeSummaries {
752
+ page: number;
753
+ count: number;
754
+ total: number;
755
+ records: IEnvelopeSummary[];
756
+ }
757
+ interface IInPersonLinkResponse {
758
+ link: string;
759
+ envelope_id: string;
760
+ profile_id: string;
761
+ role_name: string;
762
+ access_key: string;
763
+ expiration_date: string;
764
+ type: TAccessKey;
765
+ }
766
+ interface IUpdateRecipientSubmitParams {
767
+ action: "submit";
768
+ }
769
+ interface IUpdateRecipientDeclineParams {
770
+ action: "decline";
771
+ }
772
+ interface IUpdateRecipientClaimEnvelope {
773
+ action: "owner_update";
774
+ full_name: string;
775
+ email: string;
776
+ }
777
+ interface IUpdateRecipientStatus {
778
+ new_full_name?: string;
779
+ agreed?: boolean;
780
+ action?: "prepare" | "update";
781
+ }
782
+ interface IUpdateRecipientAgreedParams {
783
+ action: "update";
784
+ agreed: boolean;
785
+ }
786
+ interface IUpdateRecipientNameParams {
787
+ action: "update";
788
+ new_full_name: string;
789
+ }
790
+ interface IUpdateRecipientPrepareParams {
791
+ action: "prepare";
792
+ recipients: IRecipient[];
793
+ }
794
+ interface ICreateEnvelopeReminderRequest {
795
+ setup_time: number;
796
+ interval_time: number;
797
+ }
798
+ interface ICreateEnvelopeRequest {
799
+ template_id: string;
800
+ roles: ICreateEnvelopeRole[];
801
+ name: string;
802
+ environment?: string;
803
+ prepared_fields?: {
804
+ name: string;
805
+ value: string;
806
+ }[];
807
+ }
808
+ type TEnvelopePermission = "envelope:create" | "envelope:cancel" | "envelope:view";
670
809
  interface ISigningSessionRequest {
671
810
  envelopeId: string;
672
811
  roleId: string;
@@ -720,6 +859,10 @@ type TSession = IUserSession | ISigningSession | null;
720
859
  * An active authenticated session within Verdocs, either for signing or regular user-based operations.
721
860
  */
722
861
  type TActiveSession = IUserSession | ISigningSession;
862
+ /**
863
+ * Confirm whether the user has all of the specified permissions.
864
+ */
865
+ declare const userHasPermissions: (session: TSession, permissions: TPermission[]) => boolean;
723
866
  type TEnvironment = "verdocs" | "verdocs-stage";
724
867
  type TSessionChangedListener = (endpoint: VerdocsEndpoint, session: TSession) => void;
725
868
  interface VerdocsEndpointOptions {
@@ -917,179 +1060,6 @@ declare class VerdocsEndpoint {
917
1060
  */
918
1061
  loadSession(): VerdocsEndpoint;
919
1062
  }
920
- /**
921
- * One entry in an envelope search result.
922
- * NOTE: Many of the fields here are undefined unless "summary=true" is included in the search terms
923
- */
924
- interface IEnvelopesSearchResultEntry {
925
- id: string;
926
- canceled_at: string;
927
- certificate_document_id: string;
928
- created_at: string;
929
- histories: IEnvelopeHistory[];
930
- indexed_at: string;
931
- name: string;
932
- no_contact: boolean;
933
- organization_id: string;
934
- profile_id: string;
935
- recipients: IRecipient[];
936
- reminder_id: string | null;
937
- status: TEnvelopeStatus;
938
- /** Defaults to 'private'. If set to 'shared', this envelope will be visible to other users in the same organization. Ignored for personal profiles. */
939
- visibility: "private" | "shared";
940
- next_recipient: {
941
- claimed: boolean;
942
- email: string;
943
- name: string;
944
- profile_id: string;
945
- status: TRecipientStatus;
946
- type: TRecipientType;
947
- };
948
- template_id: string;
949
- total_count: number;
950
- updated_at: string;
951
- }
952
- interface IEnvelopesSearchResult {
953
- page: number;
954
- total: number;
955
- result: IEnvelopesSearchResultEntry[];
956
- }
957
- interface IEnvelopesSummary {
958
- action_required: {
959
- page: number;
960
- total: number;
961
- result: IActivityEntry[];
962
- };
963
- completed: {
964
- page: number;
965
- total: number;
966
- result: IActivityEntry[];
967
- };
968
- waiting_others: {
969
- page: number;
970
- total: number;
971
- result: IActivityEntry[];
972
- };
973
- }
974
- interface IDocumentSearchOptions {
975
- rows?: number;
976
- page?: number;
977
- sort_by?: "updated_at" | "created_at";
978
- ascending?: boolean;
979
- is_owner?: boolean;
980
- is_recipient?: boolean;
981
- envelope_status?: TEnvelopeStatus[];
982
- recipient_status?: TEnvelopeStatus[];
983
- }
984
- interface ICreateEnvelopeRole {
985
- /** The type of role to create. Most participants in standard flows will be "signer" recipients. */
986
- type: TRecipientType;
987
- /**
988
- * The Role name of the recipient. Please note this is not the person's name. It is the ID of the role, e.g.
989
- * 'Recipient 1', 'Seller', etc. This must match one of the pre-defined roles in the template's Recipients list.
990
- */
991
- name: string;
992
- /** The full name of the recipient as it will be displayed in reports and queries, e.g. 'Paige Turner'. */
993
- full_name: string;
994
- /** The email address of the recipient. One of `email` or `phone` must be provided. */
995
- email?: string;
996
- /**
997
- * The phone number of the recipient. One of `email` or `phone` must be provided. If `phone` is included, the
998
- * recipient will receive an SMS notification for the document.
999
- */
1000
- phone?: string;
1001
- /**
1002
- * The 1-based sequence number for the recipient. This can be used to override the template's workflow. Recipients
1003
- * are processed in parallel for each matching sequence number (e.g. all recipients at level "1" may act in parallel)
1004
- * and in series between sequence numbers (e.g. all recipients at level "1" must complete their tasks before
1005
- * recipients at level "2" may act).
1006
- */
1007
- sequence: number;
1008
- /** Whether the recipient may delegate their tasks to others. Should be false for most standard workflows. */
1009
- delegator: boolean;
1010
- /** A custom message to include in the email or SMS invitation. May be left blank for a default message. */
1011
- message: string;
1012
- }
1013
- interface IEnvelopeSummary {
1014
- id: string;
1015
- profile_id: string;
1016
- organization_id: string | null;
1017
- name: string;
1018
- status: TEnvelopeStatus;
1019
- template_id: string;
1020
- created_at: string;
1021
- updated_at: string;
1022
- canceled_at: string;
1023
- envelope_document_id: string;
1024
- certificate_document_id: string | null;
1025
- reminder_id: string | null;
1026
- no_contact: boolean;
1027
- visibility: "private" | "shared";
1028
- documents: IEnvelopeDocument[];
1029
- recipients: IRecipient[];
1030
- fields: IEnvelopeField[];
1031
- }
1032
- interface IEnvelopeSummaries {
1033
- page: number;
1034
- count: number;
1035
- total: number;
1036
- records: IEnvelopeSummary[];
1037
- }
1038
- interface IInPersonLinkResponse {
1039
- link: string;
1040
- envelope_id: string;
1041
- profile_id: string;
1042
- role_name: string;
1043
- access_key: string;
1044
- expiration_date: string;
1045
- type: TAccessKey;
1046
- }
1047
- interface IUpdateRecipientSubmitParams {
1048
- action: "submit";
1049
- }
1050
- interface IUpdateRecipientDeclineParams {
1051
- action: "decline";
1052
- }
1053
- interface IUpdateRecipientClaimEnvelope {
1054
- action: "owner_update";
1055
- full_name: string;
1056
- email: string;
1057
- }
1058
- interface IUpdateRecipientStatus {
1059
- new_full_name?: string;
1060
- agreed?: boolean;
1061
- action?: "prepare" | "update";
1062
- }
1063
- interface IUpdateRecipientAgreedParams {
1064
- action: "update";
1065
- agreed: boolean;
1066
- }
1067
- interface IUpdateRecipientNameParams {
1068
- action: "update";
1069
- new_full_name: string;
1070
- }
1071
- interface IUpdateRecipientPrepareParams {
1072
- action: "prepare";
1073
- recipients: IRecipient[];
1074
- }
1075
- interface ICreateEnvelopeReminderRequest {
1076
- setup_time: number;
1077
- interval_time: number;
1078
- }
1079
- interface ICreateEnvelopeRequest {
1080
- template_id: string;
1081
- roles: ICreateEnvelopeRole[];
1082
- name: string;
1083
- environment?: string;
1084
- prepared_fields?: {
1085
- name: string;
1086
- value: string;
1087
- }[];
1088
- }
1089
- /**
1090
- * Confirm whether the user has all of the specified permissions.
1091
- */
1092
- declare const userHasPermissions: (session: TSession, permissions: TPermission[]) => boolean;
1093
1063
  /**
1094
1064
  * Create an envelope
1095
1065
  *
@@ -1459,6 +1429,37 @@ declare const getSignature: (endpoint: VerdocsEndpoint, signatureId: string) =>
1459
1429
  * Delete a user's signature.
1460
1430
  */
1461
1431
  declare const deleteSignature: (endpoint: VerdocsEndpoint, signatureId: string) => Promise<any>;
1432
+ type TRequestStatus = "OK" | "ERROR";
1433
+ type TTemplateSenderType = "creator" | "organization_member" | "organization_member_as_creator" | "everyone" | "everyone_as_creator";
1434
+ type TTemplatePermission = "template:creator:create:public" | "template:creator:create:org" | "template:creator:create:personal" | "template:creator:delete" | "template:creator:visibility" | "template:member:read" | "template:member:write" | "template:member:delete" | "template:member:visibility";
1435
+ type TTemplateAction = "create_personal" | "create_org" | "create_public" | "read" | "write" | "delete" | "change_visibility_personal" | "change_visibility_org" | "change_visibility_public";
1436
+ type TAccountPermission = "owner:add" | "owner:remove" | "admin:add" | "admin:remove" | "member:view" | "member:add" | "member:remove";
1437
+ type TOrgPermission = "org:create" | "org:view" | "org:update" | "org:delete" | "org:transfer" | "org:list";
1438
+ type TApiKeyPermission = "personal" | "global_read" | "global_write";
1439
+ /**
1440
+ * Operation within Verdocs that users may perform.
1441
+ */
1442
+ type TPermission = TTemplatePermission | TOrgPermission | TAccountPermission | TEnvelopePermission;
1443
+ type TRecipientAction = "submit" | "decline" | "prepare" | "update";
1444
+ type TEnvelopeStatus = "complete" | "pending" | "in progress" | "declined" | "canceled";
1445
+ type TRecipientStatus = "invited" | "opened" | "signed" | "submitted" | "canceled" | "pending" | "declined";
1446
+ type TRecipientType = "signer" | "cc" | "approver";
1447
+ /**
1448
+ * Plans provide access to Verdocs product features.
1449
+ */
1450
+ type TPlan = "env:essential" | "org:standard";
1451
+ /**
1452
+ * Roles provide access to groups of permissions. Note that for historical reasons there is some overlap in the
1453
+ * use of the term "role". TRole refers to a user type. A "Role" (IRole) is a Template participant placeholder.
1454
+ */
1455
+ type TRole = "contact" | "basic_user" | "member" | "admin" | "owner";
1456
+ type TSortTemplateBy = "created_at" | "updated_at" | "name" | "last_used_at" | "counter" | "star_counter";
1457
+ type TAccessKeyType = "email" | "in_app" | "in_person_link" | "sms";
1458
+ type THistoryEvent = "recipient:signed" | "recipient:opened" | "recipient:submitted" | "recipient:prepared" | "recipient:claimed" | "recipient:agreed" | "recipient:invited" | "recipient:delegated" | "recipient:updated_info" | "recipient:declined" | "invitation:resent" | "envelope:cc" | "created" | "completed" | "canceled" | "owner:updated_recipient_info" | "owner:canceled" | "owner:get_in_person_link";
1459
+ type TEventDetail = "in_app" | "mail" | "signer" | "sms" | "reminder" | "preparer" | "manual" | "in_person_link" | "guest" | "email" | "" | string; // Modification events have a string description
1460
+ // Modification events have a string description
1461
+ type TEnvelopeUpdateResult = Omit<IEnvelope, "histories" | "recipients" | "certificate" | "document" | "fields" | "profile">;
1462
+ type TFieldType = "signature" | "initial" | "checkbox_group" | "radio_button_group" | "textbox" | "timestamp" | "date" | "dropdown" | "textarea" | "attachment" | "payment";
1462
1463
  interface ICreateApiKeyRequest {
1463
1464
  name: string;
1464
1465
  permission: TApiKeyPermission;
@@ -2529,4 +2530,4 @@ interface ISignupSurvey {
2529
2530
  declare const recordSignupSurvey: (endpoint: VerdocsEndpoint, params: ISignupSurvey) => Promise<{
2530
2531
  status: "OK";
2531
2532
  }>;
2532
- export { TRequestStatus, TTemplateSenderType, TTemplatePermission, TTemplateAction, TAccountPermission, TOrgPermission, TApiKeyPermission, TPermission, TRecipientAction, TEnvelopeStatus, TRecipientStatus, TRecipientType, TPlan, 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, 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, getApiKeys, createApiKey, rotateApiKey, updateApiKey, deleteApiKey, getGroups, getGroupByName, getGroup, getGroupMembers, addGroupMembers, deleteGroupMembers, addGroupPermission, deleteGroupPermission, getOrganizationInvitations, createOrganizationInvitation, deleteOrganizationInvitation, updateOrganizationInvitation, resendOrganizationInvitation, getOrganizationInvitation, acceptOrganizationInvitation, declineOrganizationInvitation, claimNewUser, getOrganizationMembers, deleteOrganizationMember, addOrganizationMemberRole, deleteOrganizationMemberRole, getOrganizationMemberPlans, getOrganizations, createOrganization, deleteOrganization, getOrganization, updateOrganization, ICreateApiKeyRequest, IUpdateApiKeyRequest, ICreateInvitationRequest, ISetWebhookRequest, getWebhooks, setWebhooks, userHasPermissions, ISigningSessionRequest, ISigningSession, IUserSession, TSessionType, TSession, TActiveSession, canPerformTemplateAction, hasRequiredPermissions, createField, updateField, deleteField, 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, authenticateUser, authenticateApp, validateToken, refreshTokens, updatePassword, resetPassword, updateEmail, resendVerification, createUser, billingPlaceholder, getNotifications, getProfiles, getCurrentProfile, getRoles, getPermissions, createProfile, getProfile, getProfilePermissions, getProfileGroups, switchProfile, updateProfile, deleteProfile, createBusinessAccount, ISignupSurvey, recordSignupSurvey, ICreateProfileRequest, ISwitchProfileResponse, IUpdateProfileRequest, IAuthenticateUserRequest, IAuthenticateAppRequest, IAuthenticateResponse, TokenValidationRequest, TokenValidationResponse, IUpdatePasswordRequest, UpdatePasswordResponse, UpdateEmailRequest, UpdateEmailResponse, ICreateBusinessAccountRequest, ICreateUserRequest, 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 };
2533
+ export { TRequestStatus, TTemplateSenderType, TTemplatePermission, TTemplateAction, TAccountPermission, TOrgPermission, TApiKeyPermission, TPermission, TRecipientAction, TEnvelopeStatus, TRecipientStatus, TRecipientType, TPlan, 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, 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, getGroupByName, getGroup, getGroupMembers, addGroupMembers, deleteGroupMembers, addGroupPermission, deleteGroupPermission, getOrganizationInvitations, createOrganizationInvitation, deleteOrganizationInvitation, updateOrganizationInvitation, resendOrganizationInvitation, getOrganizationInvitation, acceptOrganizationInvitation, declineOrganizationInvitation, claimNewUser, getOrganizationMembers, deleteOrganizationMember, addOrganizationMemberRole, deleteOrganizationMemberRole, getOrganizationMemberPlans, getOrganizations, createOrganization, deleteOrganization, getOrganization, updateOrganization, ICreateApiKeyRequest, IUpdateApiKeyRequest, ICreateInvitationRequest, ISetWebhookRequest, getWebhooks, setWebhooks, userHasPermissions, ISigningSessionRequest, ISigningSession, IUserSession, TSessionType, TSession, TActiveSession, canPerformTemplateAction, hasRequiredPermissions, createField, updateField, deleteField, 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, authenticateUser, authenticateApp, validateToken, refreshTokens, updatePassword, resetPassword, updateEmail, resendVerification, createUser, billingPlaceholder, getNotifications, getProfiles, getCurrentProfile, getRoles, getPermissions, createProfile, getProfile, getProfilePermissions, getProfileGroups, switchProfile, updateProfile, deleteProfile, createBusinessAccount, ISignupSurvey, recordSignupSurvey, ICreateProfileRequest, ISwitchProfileResponse, IUpdateProfileRequest, IAuthenticateUserRequest, IAuthenticateAppRequest, IAuthenticateResponse, TokenValidationRequest, TokenValidationResponse, IUpdatePasswordRequest, UpdatePasswordResponse, UpdateEmailRequest, UpdateEmailResponse, ICreateBusinessAccountRequest, ICreateUserRequest, 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdocs/js-sdk",
3
- "version": "4.0.3",
3
+ "version": "4.0.4",
4
4
  "private": false,
5
5
  "homepage": "https://github.com/Verdocs/js-sdk",
6
6
  "description": "Isomorphic JS SDK providing types and API wrappers for the Verdocs platform for Node and Browser clients",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdocs/js-sdk",
3
- "version": "4.0.3",
3
+ "version": "4.0.4",
4
4
  "private": false,
5
5
  "homepage": "https://github.com/Verdocs/js-sdk",
6
6
  "description": "Isomorphic JS SDK providing types and API wrappers for the Verdocs platform for Node and Browser clients",