@verdocs/js-sdk 4.0.2 → 4.0.3
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 +1570 -30628
- package/dist/index.d.ts +1570 -30628
- package/dist/index.js +315 -553
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +123 -548
- package/dist/index.mjs.map +1 -1
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -68,13 +68,6 @@ const decodeAccessTokenBody = (token) => {
|
|
|
68
68
|
return decoded;
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
-
var Token = /*#__PURE__*/Object.freeze({
|
|
72
|
-
__proto__: null,
|
|
73
|
-
AtoB: AtoB,
|
|
74
|
-
decodeAccessTokenBody: decodeAccessTokenBody,
|
|
75
|
-
decodeJWTBody: decodeJWTBody
|
|
76
|
-
});
|
|
77
|
-
|
|
78
71
|
function getDefaultExportFromCjs (x) {
|
|
79
72
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
80
73
|
}
|
|
@@ -491,7 +484,7 @@ const createEnvelope = async (endpoint, request) => endpoint.api //
|
|
|
491
484
|
* const {action_required, completed, waiting_on_others} = await Envelopes.getSummary(VerdocsEndpoint.getDefault());
|
|
492
485
|
* ```
|
|
493
486
|
*/
|
|
494
|
-
const
|
|
487
|
+
const getEnvelopesSummary = async (endpoint, page) => endpoint.api //
|
|
495
488
|
.post('/envelopes/summary', { page })
|
|
496
489
|
.then((r) => r.data);
|
|
497
490
|
/**
|
|
@@ -663,119 +656,20 @@ const listEnvelopes = (endpoint, params) => endpoint.api //
|
|
|
663
656
|
.post('/envelopes/list', params)
|
|
664
657
|
.then((r) => r.data);
|
|
665
658
|
|
|
666
|
-
var Envelopes = /*#__PURE__*/Object.freeze({
|
|
667
|
-
__proto__: null,
|
|
668
|
-
cancelEnvelope: cancelEnvelope,
|
|
669
|
-
createEnvelope: createEnvelope,
|
|
670
|
-
deleteEnvelopeFieldAttachment: deleteEnvelopeFieldAttachment,
|
|
671
|
-
getDocumentDownloadLink: getDocumentDownloadLink,
|
|
672
|
-
getDocumentPreviewLink: getDocumentPreviewLink,
|
|
673
|
-
getEnvelope: getEnvelope,
|
|
674
|
-
getEnvelopeDocument: getEnvelopeDocument,
|
|
675
|
-
getEnvelopeDocumentPageDisplayUri: getEnvelopeDocumentPageDisplayUri,
|
|
676
|
-
getEnvelopeFile: getEnvelopeFile,
|
|
677
|
-
getEnvelopeRecipients: getEnvelopeRecipients,
|
|
678
|
-
getFieldAttachment: getFieldAttachment,
|
|
679
|
-
getSigningSession: getSigningSession,
|
|
680
|
-
getSummary: getSummary$1,
|
|
681
|
-
listEnvelopes: listEnvelopes,
|
|
682
|
-
searchEnvelopes: searchEnvelopes,
|
|
683
|
-
throttledGetEnvelope: throttledGetEnvelope,
|
|
684
|
-
updateEnvelopeField: updateEnvelopeField,
|
|
685
|
-
updateEnvelopeFieldInitials: updateEnvelopeFieldInitials,
|
|
686
|
-
updateEnvelopeFieldSignature: updateEnvelopeFieldSignature,
|
|
687
|
-
uploadEnvelopeFieldAttachment: uploadEnvelopeFieldAttachment
|
|
688
|
-
});
|
|
689
|
-
|
|
690
|
-
/**
|
|
691
|
-
* Various helpers to identify available operations for an envelope by a user.
|
|
692
|
-
*
|
|
693
|
-
* @module
|
|
694
|
-
*/
|
|
695
|
-
/**
|
|
696
|
-
* Check to see if the user owns the envelope.
|
|
697
|
-
*/
|
|
698
|
-
const userIsEnvelopeOwner = (session, envelope) => envelope.profile_id === session?.profile_id;
|
|
699
|
-
/**
|
|
700
|
-
* Check to see if the user owns the envelope.
|
|
701
|
-
*/
|
|
702
|
-
const userIsEnvelopeRecipient = (session, envelope) => envelope.profile_id === session?.profile_id;
|
|
703
659
|
/**
|
|
704
|
-
*
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
* Check to see if the envelope has been completed.
|
|
709
|
-
*/
|
|
710
|
-
const envelopeIsComplete = (envelope) => envelope.status !== 'complete';
|
|
711
|
-
/**
|
|
712
|
-
* Check to see if the user owns the envelope.
|
|
713
|
-
*/
|
|
714
|
-
const userCanCancelEnvelope = (session, envelope) => userIsEnvelopeOwner(session, envelope) &&
|
|
715
|
-
envelope.status !== 'complete' &&
|
|
716
|
-
envelope.status !== 'declined' &&
|
|
717
|
-
envelope.status !== 'canceled';
|
|
718
|
-
/**
|
|
719
|
-
* Check to see if the user owns the envelope.
|
|
720
|
-
*/
|
|
721
|
-
const userCanFinishEnvelope = (session, envelope) => userIsEnvelopeOwner(session, envelope) &&
|
|
722
|
-
envelope.status !== 'complete' &&
|
|
723
|
-
envelope.status !== 'declined' &&
|
|
724
|
-
envelope.status !== 'canceled';
|
|
725
|
-
/**
|
|
726
|
-
* Returns true if the recipient has a pending action. Note that this does not necessarily mean the recipient can act (yet).
|
|
727
|
-
*/
|
|
728
|
-
const recipientHasAction = (recipient) => !['submitted', 'canceled', 'declined'].includes(recipient.status);
|
|
729
|
-
/**
|
|
730
|
-
* Returns the recipients who still have a pending action. Note that not all of these recipients may be able to act (yet).
|
|
731
|
-
*/
|
|
732
|
-
const getRecipientsWithActions = (envelope) => (envelope?.recipients || []).filter(recipientHasAction);
|
|
733
|
-
/**
|
|
734
|
-
* Returns true if the recipient can act.
|
|
735
|
-
*/
|
|
736
|
-
const recipientCanAct = (recipient, recipientsWithActions) => recipient.sequence === recipientsWithActions?.[0]?.sequence;
|
|
737
|
-
/**
|
|
738
|
-
* Returns true if the user can act.
|
|
739
|
-
*/
|
|
740
|
-
const userCanAct = (email, recipientsWithActions) => {
|
|
741
|
-
const recipient = recipientsWithActions.find((r) => r.email === email);
|
|
742
|
-
return recipient && recipient.sequence === recipientsWithActions?.[0]?.sequence;
|
|
743
|
-
};
|
|
744
|
-
/**
|
|
745
|
-
* Returns true if the user can act.
|
|
660
|
+
* Create an initials block. In a typical signing workflow, the user is asked at the beginning of the process to "adopt"
|
|
661
|
+
* an initials block to be used for all initials fields in the document. Thus, this is typically called one time to
|
|
662
|
+
* create and store an initials block. Thereafter, the ID of the initials block may be re-used for each initials field
|
|
663
|
+
* to be "stamped" by the user.
|
|
746
664
|
*/
|
|
747
|
-
const
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
return (myRecipient &&
|
|
754
|
-
envelopeIsActive(envelope) &&
|
|
755
|
-
userIsEnvelopeRecipient(session, envelope) &&
|
|
756
|
-
recipientCanAct(myRecipient, recipientsWithActions));
|
|
757
|
-
};
|
|
758
|
-
const getNextRecipient = (envelope) => {
|
|
759
|
-
const recipientsWithActions = getRecipientsWithActions(envelope);
|
|
760
|
-
return recipientsWithActions?.[0];
|
|
665
|
+
const createInitials = (endpoint, name, initials) => {
|
|
666
|
+
const data = new FormData();
|
|
667
|
+
data.append('initial', initials, name);
|
|
668
|
+
return endpoint.api //
|
|
669
|
+
.post(`/initials`, data)
|
|
670
|
+
.then((r) => r.data);
|
|
761
671
|
};
|
|
762
672
|
|
|
763
|
-
var Permissions = /*#__PURE__*/Object.freeze({
|
|
764
|
-
__proto__: null,
|
|
765
|
-
envelopeIsActive: envelopeIsActive,
|
|
766
|
-
envelopeIsComplete: envelopeIsComplete,
|
|
767
|
-
getNextRecipient: getNextRecipient,
|
|
768
|
-
getRecipientsWithActions: getRecipientsWithActions,
|
|
769
|
-
recipientCanAct: recipientCanAct,
|
|
770
|
-
recipientHasAction: recipientHasAction,
|
|
771
|
-
userCanAct: userCanAct,
|
|
772
|
-
userCanCancelEnvelope: userCanCancelEnvelope,
|
|
773
|
-
userCanFinishEnvelope: userCanFinishEnvelope,
|
|
774
|
-
userCanSignNow: userCanSignNow,
|
|
775
|
-
userIsEnvelopeOwner: userIsEnvelopeOwner,
|
|
776
|
-
userIsEnvelopeRecipient: userIsEnvelopeRecipient
|
|
777
|
-
});
|
|
778
|
-
|
|
779
673
|
/**
|
|
780
674
|
* Update a recipient's status block
|
|
781
675
|
*/
|
|
@@ -827,58 +721,108 @@ const sendDelegate = (endpoint, envelopeId, roleName) => endpoint.api //
|
|
|
827
721
|
/**
|
|
828
722
|
* Resend a recipient's invitation.
|
|
829
723
|
*/
|
|
830
|
-
const resendInvitation
|
|
724
|
+
const resendInvitation = (endpoint, envelopeId, roleName) => endpoint.api //
|
|
831
725
|
.post(`/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}/resend_invitation`)
|
|
832
726
|
.then((r) => r.data);
|
|
833
727
|
|
|
834
|
-
var Recipients = /*#__PURE__*/Object.freeze({
|
|
835
|
-
__proto__: null,
|
|
836
|
-
envelopeRecipientAgree: envelopeRecipientAgree,
|
|
837
|
-
envelopeRecipientChangeOwner: envelopeRecipientChangeOwner,
|
|
838
|
-
envelopeRecipientDecline: envelopeRecipientDecline,
|
|
839
|
-
envelopeRecipientPrepare: envelopeRecipientPrepare,
|
|
840
|
-
envelopeRecipientSubmit: envelopeRecipientSubmit,
|
|
841
|
-
envelopeRecipientUpdateName: envelopeRecipientUpdateName,
|
|
842
|
-
getInPersonLink: getInPersonLink,
|
|
843
|
-
getSignerToken: getSignerToken,
|
|
844
|
-
resendInvitation: resendInvitation$1,
|
|
845
|
-
sendDelegate: sendDelegate,
|
|
846
|
-
updateRecipient: updateRecipient
|
|
847
|
-
});
|
|
848
|
-
|
|
849
728
|
/**
|
|
850
729
|
* Enable automatic reminders. setup_time is the number of days after the envelope is sent that the first reminder
|
|
851
730
|
* should be sent. interval_time is the number of days between reminders.
|
|
852
731
|
*/
|
|
853
|
-
const
|
|
732
|
+
const createEnvelopeReminder = (endpoint, envelopeId, params) => endpoint.api //
|
|
854
733
|
.post(`/envelopes/${envelopeId}/reminder/`, params)
|
|
855
734
|
.then((r) => r.data);
|
|
856
735
|
/**
|
|
857
736
|
* Get the reminder configuration for an envelope.
|
|
858
737
|
*/
|
|
859
|
-
const
|
|
738
|
+
const getEnvelopeReminder = (endpoint, envelopeId, reminderId) => endpoint.api //
|
|
860
739
|
.get(`/envelopes/${envelopeId}/reminder/${reminderId}`)
|
|
861
740
|
.then((r) => r.data);
|
|
862
741
|
/**
|
|
863
742
|
* Update the reminder configuration for an envelope.
|
|
864
743
|
*/
|
|
865
|
-
const
|
|
744
|
+
const updateEnvelopeReminder = (endpoint, envelopeId, reminderId, params) => endpoint.api //
|
|
866
745
|
.put(`/envelopes/${envelopeId}/reminder/${reminderId}`, params)
|
|
867
746
|
.then((r) => r.data);
|
|
868
747
|
/**
|
|
869
748
|
* Delete the reminder configuration for an envelope.
|
|
870
749
|
*/
|
|
871
|
-
const
|
|
750
|
+
const deleteEnvelopeReminder = (endpoint, envelopeId, reminderId) => endpoint.api //
|
|
872
751
|
.delete(`/envelopes/${envelopeId}/reminder/${reminderId}`)
|
|
873
752
|
.then((r) => r.data);
|
|
874
753
|
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
754
|
+
/**
|
|
755
|
+
* Various helpers to identify available operations for an envelope by a user.
|
|
756
|
+
*
|
|
757
|
+
* @module
|
|
758
|
+
*/
|
|
759
|
+
/**
|
|
760
|
+
* Check to see if the user owns the envelope.
|
|
761
|
+
*/
|
|
762
|
+
const userIsEnvelopeOwner = (session, envelope) => envelope.profile_id === session?.profile_id;
|
|
763
|
+
/**
|
|
764
|
+
* Check to see if the user owns the envelope.
|
|
765
|
+
*/
|
|
766
|
+
const userIsEnvelopeRecipient = (session, envelope) => envelope.profile_id === session?.profile_id;
|
|
767
|
+
/**
|
|
768
|
+
* Check to see if the envelope has pending actions.
|
|
769
|
+
*/
|
|
770
|
+
const envelopeIsActive = (envelope) => envelope.status !== 'complete' && envelope.status !== 'declined' && envelope.status !== 'canceled';
|
|
771
|
+
/**
|
|
772
|
+
* Check to see if the envelope has been completed.
|
|
773
|
+
*/
|
|
774
|
+
const envelopeIsComplete = (envelope) => envelope.status !== 'complete';
|
|
775
|
+
/**
|
|
776
|
+
* Check to see if the user owns the envelope.
|
|
777
|
+
*/
|
|
778
|
+
const userCanCancelEnvelope = (session, envelope) => userIsEnvelopeOwner(session, envelope) &&
|
|
779
|
+
envelope.status !== 'complete' &&
|
|
780
|
+
envelope.status !== 'declined' &&
|
|
781
|
+
envelope.status !== 'canceled';
|
|
782
|
+
/**
|
|
783
|
+
* Check to see if the user owns the envelope.
|
|
784
|
+
*/
|
|
785
|
+
const userCanFinishEnvelope = (session, envelope) => userIsEnvelopeOwner(session, envelope) &&
|
|
786
|
+
envelope.status !== 'complete' &&
|
|
787
|
+
envelope.status !== 'declined' &&
|
|
788
|
+
envelope.status !== 'canceled';
|
|
789
|
+
/**
|
|
790
|
+
* Returns true if the recipient has a pending action. Note that this does not necessarily mean the recipient can act (yet).
|
|
791
|
+
*/
|
|
792
|
+
const recipientHasAction = (recipient) => !['submitted', 'canceled', 'declined'].includes(recipient.status);
|
|
793
|
+
/**
|
|
794
|
+
* Returns the recipients who still have a pending action. Note that not all of these recipients may be able to act (yet).
|
|
795
|
+
*/
|
|
796
|
+
const getRecipientsWithActions = (envelope) => (envelope?.recipients || []).filter(recipientHasAction);
|
|
797
|
+
/**
|
|
798
|
+
* Returns true if the recipient can act.
|
|
799
|
+
*/
|
|
800
|
+
const recipientCanAct = (recipient, recipientsWithActions) => recipient.sequence === recipientsWithActions?.[0]?.sequence;
|
|
801
|
+
/**
|
|
802
|
+
* Returns true if the user can act.
|
|
803
|
+
*/
|
|
804
|
+
const userCanAct = (email, recipientsWithActions) => {
|
|
805
|
+
const recipient = recipientsWithActions.find((r) => r.email === email);
|
|
806
|
+
return recipient && recipient.sequence === recipientsWithActions?.[0]?.sequence;
|
|
807
|
+
};
|
|
808
|
+
/**
|
|
809
|
+
* Returns true if the user can act.
|
|
810
|
+
*/
|
|
811
|
+
const userCanSignNow = (session, envelope) => {
|
|
812
|
+
if (!session) {
|
|
813
|
+
return false;
|
|
814
|
+
}
|
|
815
|
+
const recipientsWithActions = getRecipientsWithActions(envelope);
|
|
816
|
+
const myRecipient = recipientsWithActions.find((r) => r.profile_id === session?.profile_id || r.email === session?.email);
|
|
817
|
+
return (myRecipient &&
|
|
818
|
+
envelopeIsActive(envelope) &&
|
|
819
|
+
userIsEnvelopeRecipient(session, envelope) &&
|
|
820
|
+
recipientCanAct(myRecipient, recipientsWithActions));
|
|
821
|
+
};
|
|
822
|
+
const getNextRecipient = (envelope) => {
|
|
823
|
+
const recipientsWithActions = getRecipientsWithActions(envelope);
|
|
824
|
+
return recipientsWithActions?.[0];
|
|
825
|
+
};
|
|
882
826
|
|
|
883
827
|
/**
|
|
884
828
|
* Create a signature block. In a typical signing workflow, the user is asked at the beginning of the process to "adopt"
|
|
@@ -912,48 +856,6 @@ const deleteSignature = (endpoint, signatureId) => endpoint.api //
|
|
|
912
856
|
.delete(`/signatures/${signatureId}`)
|
|
913
857
|
.then((r) => r.data);
|
|
914
858
|
|
|
915
|
-
var Signatures = /*#__PURE__*/Object.freeze({
|
|
916
|
-
__proto__: null,
|
|
917
|
-
createSignature: createSignature,
|
|
918
|
-
deleteSignature: deleteSignature,
|
|
919
|
-
getSignature: getSignature,
|
|
920
|
-
getSignatures: getSignatures
|
|
921
|
-
});
|
|
922
|
-
|
|
923
|
-
/**
|
|
924
|
-
* Create an initials block. In a typical signing workflow, the user is asked at the beginning of the process to "adopt"
|
|
925
|
-
* an initials block to be used for all initials fields in the document. Thus, this is typically called one time to
|
|
926
|
-
* create and store an initials block. Thereafter, the ID of the initials block may be re-used for each initials field
|
|
927
|
-
* to be "stamped" by the user.
|
|
928
|
-
*/
|
|
929
|
-
const createInitials = (endpoint, name, initials) => {
|
|
930
|
-
const data = new FormData();
|
|
931
|
-
data.append('initial', initials, name);
|
|
932
|
-
return endpoint.api //
|
|
933
|
-
.post(`/initials`, data)
|
|
934
|
-
.then((r) => r.data);
|
|
935
|
-
};
|
|
936
|
-
|
|
937
|
-
var Initials = /*#__PURE__*/Object.freeze({
|
|
938
|
-
__proto__: null,
|
|
939
|
-
createInitials: createInitials
|
|
940
|
-
});
|
|
941
|
-
|
|
942
|
-
var Types$5 = /*#__PURE__*/Object.freeze({
|
|
943
|
-
__proto__: null
|
|
944
|
-
});
|
|
945
|
-
|
|
946
|
-
var index$5 = /*#__PURE__*/Object.freeze({
|
|
947
|
-
__proto__: null,
|
|
948
|
-
Envelopes: Envelopes,
|
|
949
|
-
Initials: Initials,
|
|
950
|
-
Permissions: Permissions,
|
|
951
|
-
Recipients: Recipients,
|
|
952
|
-
Reminders: Reminders$1,
|
|
953
|
-
Signatures: Signatures,
|
|
954
|
-
Types: Types$5
|
|
955
|
-
});
|
|
956
|
-
|
|
957
859
|
/**
|
|
958
860
|
* API keys are used to authenticate server-to-server calls. (API keys should **never** be used for client-to-server operations!)
|
|
959
861
|
* To generate a key, either use the Verdocs admin interface and make note of the client_id and client_secret generated, or call
|
|
@@ -975,7 +877,7 @@ var index$5 = /*#__PURE__*/Object.freeze({
|
|
|
975
877
|
* const keys = await ApiKeys.getKeys(ORGID);
|
|
976
878
|
* ```
|
|
977
879
|
*/
|
|
978
|
-
const
|
|
880
|
+
const getApiKeys = (endpoint, organizationId) => endpoint.api //
|
|
979
881
|
.get(`/organizations/${organizationId}/api_key`)
|
|
980
882
|
.then((r) => r.data);
|
|
981
883
|
/**
|
|
@@ -987,7 +889,7 @@ const getKeys = (endpoint, organizationId) => endpoint.api //
|
|
|
987
889
|
* await ApiKeys.createKey(ORGID, {name: NEWNAME});
|
|
988
890
|
* ```
|
|
989
891
|
*/
|
|
990
|
-
const
|
|
892
|
+
const createApiKey = (endpoint, organizationId, params) => endpoint.api //
|
|
991
893
|
.post(`/organizations/${organizationId}/api_key`, params)
|
|
992
894
|
.then((r) => r.data);
|
|
993
895
|
/**
|
|
@@ -999,7 +901,7 @@ const createKey = (endpoint, organizationId, params) => endpoint.api //
|
|
|
999
901
|
* const {client_secret: newSecret} = await ApiKeys.rotateKey(ORGID, CLIENTID);
|
|
1000
902
|
* ```
|
|
1001
903
|
*/
|
|
1002
|
-
const
|
|
904
|
+
const rotateApiKey = (endpoint, organizationId, clientId) => endpoint.api //
|
|
1003
905
|
.put(`/organizations/${organizationId}/api_key/${clientId}/rotate`)
|
|
1004
906
|
.then((r) => r.data);
|
|
1005
907
|
/**
|
|
@@ -1011,7 +913,7 @@ const rotateKey = (endpoint, organizationId, clientId) => endpoint.api //
|
|
|
1011
913
|
* await ApiKeys.updateKey(ORGID, CLIENTID, {name: NEWNAME});
|
|
1012
914
|
* ```
|
|
1013
915
|
*/
|
|
1014
|
-
const
|
|
916
|
+
const updateApiKey = (endpoint, organizationId, clientId, params) => endpoint.api //
|
|
1015
917
|
.patch(`/organizations/${organizationId}/api_key/${clientId}`, params)
|
|
1016
918
|
.then((r) => r.data);
|
|
1017
919
|
/**
|
|
@@ -1023,19 +925,10 @@ const updateKey = (endpoint, organizationId, clientId, params) => endpoint.api /
|
|
|
1023
925
|
* await ApiKeys.deleteKey(ORGID, CLIENTID);
|
|
1024
926
|
* ```
|
|
1025
927
|
*/
|
|
1026
|
-
const
|
|
928
|
+
const deleteApiKey = (endpoint, organizationId, clientId) => endpoint.api //
|
|
1027
929
|
.delete(`/organizations/${organizationId}/api_key/${clientId}`)
|
|
1028
930
|
.then((r) => r.data);
|
|
1029
931
|
|
|
1030
|
-
var ApiKeys = /*#__PURE__*/Object.freeze({
|
|
1031
|
-
__proto__: null,
|
|
1032
|
-
createKey: createKey,
|
|
1033
|
-
deleteKey: deleteKey,
|
|
1034
|
-
getKeys: getKeys,
|
|
1035
|
-
rotateKey: rotateKey,
|
|
1036
|
-
updateKey: updateKey
|
|
1037
|
-
});
|
|
1038
|
-
|
|
1039
932
|
/**
|
|
1040
933
|
* Organizations may contain "Groups" of user profiles, called Members. Groups may have permissions assigned that
|
|
1041
934
|
* apply to all Members, making it easy to configure role-based access control (RBAC) within an Organization. Note
|
|
@@ -1081,110 +974,76 @@ const getGroupByName = (endpoint, organizationId, name) => endpoint.api //
|
|
|
1081
974
|
const getGroup = (endpoint, organizationId, groupId) => endpoint.api //
|
|
1082
975
|
.get(`/organizations/${organizationId}/groups/${groupId}`)
|
|
1083
976
|
.then((r) => r.data);
|
|
1084
|
-
const
|
|
977
|
+
const getGroupMembers = (endpoint, organizationId, groupId) => endpoint.api //
|
|
1085
978
|
.get(`/organizations/${organizationId}/groups/${groupId}/members`)
|
|
1086
979
|
.then((r) => r.data);
|
|
1087
|
-
const
|
|
980
|
+
const addGroupMembers = (endpoint, organizationId, groupId, params) => endpoint.api //
|
|
1088
981
|
.post(`/organizations/${organizationId}/groups/${groupId}/members`, params)
|
|
1089
982
|
.then((r) => r.data);
|
|
1090
|
-
const
|
|
983
|
+
const deleteGroupMembers = (endpoint, organizationId, groupId, params) => endpoint.api //
|
|
1091
984
|
.put(`/organizations/${organizationId}/groups/${groupId}/delete_members`, params)
|
|
1092
985
|
.then((r) => r.data);
|
|
1093
|
-
const
|
|
986
|
+
const addGroupPermission = (endpoint, organizationId, groupId, permission) => endpoint.api //
|
|
1094
987
|
.post(`/organizations/${organizationId}/groups/${groupId}/permissions/${permission}`, {})
|
|
1095
988
|
.then((r) => r.data);
|
|
1096
|
-
const
|
|
989
|
+
const deleteGroupPermission = (endpoint, organizationId, groupId, permission) => endpoint.api //
|
|
1097
990
|
.delete(`/organizations/${organizationId}/groups/${groupId}/permissions/${permission}`)
|
|
1098
991
|
.then((r) => r.data);
|
|
1099
992
|
|
|
1100
|
-
var Groups = /*#__PURE__*/Object.freeze({
|
|
1101
|
-
__proto__: null,
|
|
1102
|
-
addMembers: addMembers,
|
|
1103
|
-
addPermission: addPermission,
|
|
1104
|
-
deleteMembers: deleteMembers,
|
|
1105
|
-
deletePermission: deletePermission,
|
|
1106
|
-
getGroup: getGroup,
|
|
1107
|
-
getGroupByName: getGroupByName,
|
|
1108
|
-
getGroups: getGroups,
|
|
1109
|
-
getMembers: getMembers$1
|
|
1110
|
-
});
|
|
1111
|
-
|
|
1112
993
|
/**
|
|
1113
994
|
* An invitation represents an opportunity for a Member to join an Organization.
|
|
1114
995
|
*
|
|
1115
996
|
* @module
|
|
1116
997
|
*/
|
|
1117
|
-
const
|
|
998
|
+
const getOrganizationInvitations = (endpoint, organizationId) => endpoint.api //
|
|
1118
999
|
.get(`/organizations/${organizationId}/invitation`)
|
|
1119
1000
|
.then((r) => r.data);
|
|
1120
|
-
const
|
|
1001
|
+
const createOrganizationInvitation = (endpoint, organizationId, params) => endpoint.api //
|
|
1121
1002
|
.post(`/organizations/${organizationId}/invitation`, params)
|
|
1122
1003
|
.then((r) => r.data);
|
|
1123
|
-
const
|
|
1004
|
+
const deleteOrganizationInvitation = (endpoint, organizationId, email) => endpoint.api //
|
|
1124
1005
|
.delete(`/organizations/${organizationId}/invitation/${email}`)
|
|
1125
1006
|
.then((r) => r.data);
|
|
1126
|
-
const
|
|
1007
|
+
const updateOrganizationInvitation = (endpoint, organizationId, email, params) => endpoint.api //
|
|
1127
1008
|
.patch(`/organizations/${organizationId}/invitation/${email}`, params)
|
|
1128
1009
|
.then((r) => r.data);
|
|
1129
|
-
const
|
|
1010
|
+
const resendOrganizationInvitation = (endpoint, organizationId, email) => endpoint.api //
|
|
1130
1011
|
.post(`/organizations/${organizationId}/invitation/${email}/resend`)
|
|
1131
1012
|
.then((r) => r.data);
|
|
1132
|
-
const
|
|
1013
|
+
const getOrganizationInvitation = (endpoint, organizationId, email, token) => endpoint.api //
|
|
1133
1014
|
.get(`/organizations/${organizationId}/invitation/${email}/accept/${token}`)
|
|
1134
1015
|
.then((r) => r.data);
|
|
1135
|
-
const
|
|
1016
|
+
const acceptOrganizationInvitation = (endpoint, organizationId, email, token) => endpoint.api //
|
|
1136
1017
|
.post(`/organizations/${organizationId}/invitation/${email}/accept/${token}`)
|
|
1137
1018
|
.then((r) => r.data);
|
|
1138
|
-
const
|
|
1019
|
+
const declineOrganizationInvitation = (endpoint, organizationId, email, token) => endpoint.api //
|
|
1139
1020
|
.post(`/organizations/${organizationId}/invitation/${email}/decline/${token}`)
|
|
1140
1021
|
.then((r) => r.data);
|
|
1141
1022
|
const claimNewUser = (endpoint, organizationId, email, token) => endpoint.api //
|
|
1142
1023
|
.put(`/organizations/${organizationId}/invitation/${email}/token/${token}/new_user`)
|
|
1143
1024
|
.then((r) => r.data);
|
|
1144
1025
|
|
|
1145
|
-
var Invitations = /*#__PURE__*/Object.freeze({
|
|
1146
|
-
__proto__: null,
|
|
1147
|
-
acceptInvitation: acceptInvitation,
|
|
1148
|
-
claimNewUser: claimNewUser,
|
|
1149
|
-
createInvitation: createInvitation,
|
|
1150
|
-
declineInvitation: declineInvitation,
|
|
1151
|
-
deleteInvitation: deleteInvitation,
|
|
1152
|
-
getInvitation: getInvitation,
|
|
1153
|
-
getInvitations: getInvitations,
|
|
1154
|
-
resendInvitation: resendInvitation,
|
|
1155
|
-
updateInvitation: updateInvitation
|
|
1156
|
-
});
|
|
1157
|
-
|
|
1158
1026
|
/**
|
|
1159
1027
|
* An Organization Member (aka Profile) is an individual user with access to an organization.
|
|
1160
1028
|
*
|
|
1161
1029
|
* @module
|
|
1162
1030
|
*/
|
|
1163
|
-
const
|
|
1031
|
+
const getOrganizationMembers = (endpoint, organizationId) => endpoint.api //
|
|
1164
1032
|
.get(`/organizations/${organizationId}/profiles`)
|
|
1165
1033
|
.then((r) => r.data);
|
|
1166
|
-
const
|
|
1034
|
+
const deleteOrganizationMember = (endpoint, organizationId, profileId) => endpoint.api //
|
|
1167
1035
|
.delete(`/organizations/${organizationId}/profiles/${profileId}`)
|
|
1168
1036
|
.then((r) => r.data);
|
|
1169
|
-
const
|
|
1037
|
+
const addOrganizationMemberRole = (endpoint, organizationId, profileId, roleId) => endpoint.api //
|
|
1170
1038
|
.post(`/organizations/${organizationId}/profiles/${profileId}/role/${roleId}`)
|
|
1171
1039
|
.then((r) => r.data);
|
|
1172
|
-
const
|
|
1040
|
+
const deleteOrganizationMemberRole = (endpoint, organizationId, profileId, roleId) => endpoint.api //
|
|
1173
1041
|
.delete(`/organizations/${organizationId}/profiles/${profileId}/role/${roleId}`)
|
|
1174
1042
|
.then((r) => r.data);
|
|
1175
|
-
const
|
|
1043
|
+
const getOrganizationMemberPlans = (endpoint, organizationId, profileId) => endpoint.api //
|
|
1176
1044
|
.get(`/organizations/${organizationId}/profiles/${profileId}/plans`)
|
|
1177
1045
|
.then((r) => r.data);
|
|
1178
1046
|
|
|
1179
|
-
var Members = /*#__PURE__*/Object.freeze({
|
|
1180
|
-
__proto__: null,
|
|
1181
|
-
addMemberRole: addMemberRole,
|
|
1182
|
-
deleteMember: deleteMember,
|
|
1183
|
-
deleteMemberRole: deleteMemberRole,
|
|
1184
|
-
getMemberPlans: getMemberPlans,
|
|
1185
|
-
getMembers: getMembers
|
|
1186
|
-
});
|
|
1187
|
-
|
|
1188
1047
|
/**
|
|
1189
1048
|
* An Organization is the top level object for ownership for Members, Documents, and Templates.
|
|
1190
1049
|
*
|
|
@@ -1221,19 +1080,6 @@ const updateOrganization = (endpoint, organizationId, params) => endpoint.api //
|
|
|
1221
1080
|
.patch(`/organizations/${organizationId}`, params)
|
|
1222
1081
|
.then((r) => r.data);
|
|
1223
1082
|
|
|
1224
|
-
var Organizations = /*#__PURE__*/Object.freeze({
|
|
1225
|
-
__proto__: null,
|
|
1226
|
-
createOrganization: createOrganization,
|
|
1227
|
-
deleteOrganization: deleteOrganization,
|
|
1228
|
-
getOrganization: getOrganization,
|
|
1229
|
-
getOrganizations: getOrganizations,
|
|
1230
|
-
updateOrganization: updateOrganization
|
|
1231
|
-
});
|
|
1232
|
-
|
|
1233
|
-
var Types$4 = /*#__PURE__*/Object.freeze({
|
|
1234
|
-
__proto__: null
|
|
1235
|
-
});
|
|
1236
|
-
|
|
1237
1083
|
const getWebhooks = (endpoint) => endpoint.api //
|
|
1238
1084
|
.get(`/v2/webhooks/organization`)
|
|
1239
1085
|
.then((r) => r.data);
|
|
@@ -1241,47 +1087,11 @@ const setWebhooks = (endpoint, params) => endpoint.api //
|
|
|
1241
1087
|
.post(`/v2/webhooks/organization`, params)
|
|
1242
1088
|
.then((r) => r.data);
|
|
1243
1089
|
|
|
1244
|
-
var Webhooks = /*#__PURE__*/Object.freeze({
|
|
1245
|
-
__proto__: null,
|
|
1246
|
-
getWebhooks: getWebhooks,
|
|
1247
|
-
setWebhooks: setWebhooks
|
|
1248
|
-
});
|
|
1249
|
-
|
|
1250
|
-
/**
|
|
1251
|
-
* An Organization is a high-level container within Verdocs that groups together Templates, Documents, Profiles, Billing, and
|
|
1252
|
-
* other settings. A User may be a member of more than one Organization. Each membership is tracked by a Profile representing
|
|
1253
|
-
* that user's settings within that organization. It is important to select the correct Profile before performing operations
|
|
1254
|
-
* against the Verdocs API, as this also sets the Organization that will be operated on, and the user's permissions within it.
|
|
1255
|
-
*
|
|
1256
|
-
* @module
|
|
1257
|
-
*/
|
|
1258
|
-
|
|
1259
|
-
var index$4 = /*#__PURE__*/Object.freeze({
|
|
1260
|
-
__proto__: null,
|
|
1261
|
-
ApiKeys: ApiKeys,
|
|
1262
|
-
Groups: Groups,
|
|
1263
|
-
Invitations: Invitations,
|
|
1264
|
-
Members: Members,
|
|
1265
|
-
Organizations: Organizations,
|
|
1266
|
-
Types: Types$4,
|
|
1267
|
-
Webhooks: Webhooks
|
|
1268
|
-
});
|
|
1269
|
-
|
|
1270
|
-
var Types$3 = /*#__PURE__*/Object.freeze({
|
|
1271
|
-
__proto__: null
|
|
1272
|
-
});
|
|
1273
|
-
|
|
1274
1090
|
/**
|
|
1275
1091
|
* Confirm whether the user has all of the specified permissions.
|
|
1276
1092
|
*/
|
|
1277
1093
|
const userHasPermissions = (session, permissions) => permissions.every((perm) => (session?.permissions || []).includes(perm));
|
|
1278
1094
|
|
|
1279
|
-
var index$3 = /*#__PURE__*/Object.freeze({
|
|
1280
|
-
__proto__: null,
|
|
1281
|
-
Types: Types$3,
|
|
1282
|
-
userHasPermissions: userHasPermissions
|
|
1283
|
-
});
|
|
1284
|
-
|
|
1285
1095
|
const canPerformTemplateAction = (session, action, template) => {
|
|
1286
1096
|
if (!template && !action.includes('create')) {
|
|
1287
1097
|
return { canPerform: false, message: 'Missing required template object' };
|
|
@@ -1364,12 +1174,6 @@ const canPerformTemplateAction = (session, action, template) => {
|
|
|
1364
1174
|
};
|
|
1365
1175
|
const hasRequiredPermissions = (session, permissions) => permissions.every((perm) => (session?.permissions || []).includes(perm));
|
|
1366
1176
|
|
|
1367
|
-
var Actions = /*#__PURE__*/Object.freeze({
|
|
1368
|
-
__proto__: null,
|
|
1369
|
-
canPerformTemplateAction: canPerformTemplateAction,
|
|
1370
|
-
hasRequiredPermissions: hasRequiredPermissions
|
|
1371
|
-
});
|
|
1372
|
-
|
|
1373
1177
|
/**
|
|
1374
1178
|
* Add a field to a template.
|
|
1375
1179
|
*/
|
|
@@ -1389,47 +1193,32 @@ const deleteField = (endpoint, templateId, fieldName) => endpoint.api //
|
|
|
1389
1193
|
.delete(`/templates/${templateId}/fields/${fieldName}`)
|
|
1390
1194
|
.then((r) => r.data);
|
|
1391
1195
|
|
|
1392
|
-
var Fields$1 = /*#__PURE__*/Object.freeze({
|
|
1393
|
-
__proto__: null,
|
|
1394
|
-
createField: createField,
|
|
1395
|
-
deleteField: deleteField,
|
|
1396
|
-
updateField: updateField
|
|
1397
|
-
});
|
|
1398
|
-
|
|
1399
1196
|
/**
|
|
1400
1197
|
* Enable automatic reminders. setup_time is the number of days after the envelope is sent that the first reminder
|
|
1401
1198
|
* should be sent. interval_time is the number of days between reminders.
|
|
1402
1199
|
*/
|
|
1403
|
-
const
|
|
1200
|
+
const createTemplateReminder = (endpoint, templateId, params) => endpoint.api //
|
|
1404
1201
|
.post(`/templates/${templateId}/reminder/`, params)
|
|
1405
1202
|
.then((r) => r.data);
|
|
1406
1203
|
/**
|
|
1407
1204
|
* Get the reminder configuration for a template.
|
|
1408
1205
|
*/
|
|
1409
|
-
const
|
|
1206
|
+
const getTemplateReminder = (endpoint, templateId, reminderId) => endpoint.api //
|
|
1410
1207
|
.get(`/templates/${templateId}/reminder/${reminderId}`)
|
|
1411
1208
|
.then((r) => r.data);
|
|
1412
1209
|
/**
|
|
1413
1210
|
* Update the reminder configuration for a template.
|
|
1414
1211
|
*/
|
|
1415
|
-
const
|
|
1212
|
+
const updateTemplateReminder = (endpoint, templateId, reminderId, params) => endpoint.api //
|
|
1416
1213
|
.put(`/templates/${templateId}/reminder/${reminderId}`, params)
|
|
1417
1214
|
.then((r) => r.data);
|
|
1418
1215
|
/**
|
|
1419
1216
|
* Delete the reminder configuration for a template.
|
|
1420
1217
|
*/
|
|
1421
|
-
const
|
|
1218
|
+
const deleteTemplateReminder = (endpoint, templateId, reminderId) => endpoint.api //
|
|
1422
1219
|
.delete(`/templates/${templateId}/reminder/${reminderId}`)
|
|
1423
1220
|
.then((r) => r.data);
|
|
1424
1221
|
|
|
1425
|
-
var Reminders = /*#__PURE__*/Object.freeze({
|
|
1426
|
-
__proto__: null,
|
|
1427
|
-
createReminder: createReminder,
|
|
1428
|
-
deleteReminder: deleteReminder,
|
|
1429
|
-
getReminder: getReminder,
|
|
1430
|
-
updateReminder: updateReminder
|
|
1431
|
-
});
|
|
1432
|
-
|
|
1433
1222
|
/**
|
|
1434
1223
|
* A "role" is an individual participant in a signing flow, such as a signer or CC contact. Roles are identified by
|
|
1435
1224
|
* their names, which must be unique (e.g. 'Recipient 1'). Template fields are assigned to roles for signing operations,
|
|
@@ -1437,38 +1226,24 @@ var Reminders = /*#__PURE__*/Object.freeze({
|
|
|
1437
1226
|
*
|
|
1438
1227
|
* @module
|
|
1439
1228
|
*/
|
|
1440
|
-
const
|
|
1229
|
+
const createTemplateRole = (endpoint, templateId, params) => endpoint.api //
|
|
1441
1230
|
.post(`/templates/${templateId}/roles`, params)
|
|
1442
1231
|
.then((r) => r.data);
|
|
1443
|
-
const
|
|
1232
|
+
const getTemplateRoles = (endpoint, templateId) => endpoint.api //
|
|
1444
1233
|
.get(`/templates/${templateId}/roles`)
|
|
1445
1234
|
.then((r) => r.data);
|
|
1446
|
-
const
|
|
1235
|
+
const getTemplateRole = (endpoint, templateId, roleName) => endpoint.api //
|
|
1447
1236
|
.get(`/templates/${templateId}/roles/${roleName}`)
|
|
1448
1237
|
.then((r) => r.data);
|
|
1449
|
-
const
|
|
1238
|
+
const updateTemplateRole = (endpoint, templateId, roleName, params) => endpoint.api //
|
|
1450
1239
|
.put(`/templates/${templateId}/roles/${roleName}`, params)
|
|
1451
1240
|
.then((r) => r.data);
|
|
1452
|
-
const
|
|
1241
|
+
const deleteTemplateRole = (endpoint, templateId, roleName) => endpoint.api //
|
|
1453
1242
|
.delete(`/templates/${templateId}/roles/${roleName}`)
|
|
1454
1243
|
.then((r) => r.data);
|
|
1455
|
-
const
|
|
1244
|
+
const getTemplateRoleFields = (endpoint, templateId, roleName) => endpoint.api //
|
|
1456
1245
|
.get(`/templates/${templateId}/roles/${roleName}/fields`)
|
|
1457
1246
|
.then((r) => r.data);
|
|
1458
|
-
const deleteSequence = (endpoint, templateId) => endpoint.api //
|
|
1459
|
-
.delete(`/templates/${templateId}/roles`)
|
|
1460
|
-
.then((r) => r.data);
|
|
1461
|
-
|
|
1462
|
-
var Roles = /*#__PURE__*/Object.freeze({
|
|
1463
|
-
__proto__: null,
|
|
1464
|
-
createRole: createRole,
|
|
1465
|
-
deleteRole: deleteRole,
|
|
1466
|
-
deleteSequence: deleteSequence,
|
|
1467
|
-
getRole: getRole,
|
|
1468
|
-
getRoleFields: getRoleFields,
|
|
1469
|
-
getRoles: getRoles$1,
|
|
1470
|
-
updateRole: updateRole
|
|
1471
|
-
});
|
|
1472
1247
|
|
|
1473
1248
|
/**
|
|
1474
1249
|
* Get the template stars for a template.
|
|
@@ -1483,12 +1258,6 @@ const toggleStar = (endpoint, templateId) => endpoint.api //
|
|
|
1483
1258
|
.post(`/templates/${templateId}/stars/toggle`)
|
|
1484
1259
|
.then((r) => r.data);
|
|
1485
1260
|
|
|
1486
|
-
var Stars = /*#__PURE__*/Object.freeze({
|
|
1487
|
-
__proto__: null,
|
|
1488
|
-
getStars: getStars,
|
|
1489
|
-
toggleStar: toggleStar
|
|
1490
|
-
});
|
|
1491
|
-
|
|
1492
1261
|
/**
|
|
1493
1262
|
* A Tag is a user-specified label applied to a template. Tags help users organize and find Templates.
|
|
1494
1263
|
* recipients. Every Organization has a set of tags "owned" by that Organization and only visible inside it.
|
|
@@ -1533,16 +1302,6 @@ const getAllTags = (endpoint) => endpoint.api //
|
|
|
1533
1302
|
.get('/tags')
|
|
1534
1303
|
.then((r) => r.data);
|
|
1535
1304
|
|
|
1536
|
-
var Tags = /*#__PURE__*/Object.freeze({
|
|
1537
|
-
__proto__: null,
|
|
1538
|
-
addTemplateTag: addTemplateTag,
|
|
1539
|
-
createTag: createTag,
|
|
1540
|
-
deleteTemplateTag: deleteTemplateTag,
|
|
1541
|
-
getAllTags: getAllTags,
|
|
1542
|
-
getTag: getTag,
|
|
1543
|
-
getTemplateTags: getTemplateTags
|
|
1544
|
-
});
|
|
1545
|
-
|
|
1546
1305
|
/**
|
|
1547
1306
|
* A Template defines how a Verdocs signing flow will be performed, including attachments, signing fields, and
|
|
1548
1307
|
* recipients.
|
|
@@ -1750,7 +1509,7 @@ const searchTemplates = async (endpoint, params) => endpoint.api //
|
|
|
1750
1509
|
* const summary = await Templates.getSummary((VerdocsEndpoint.getDefault(), 0);
|
|
1751
1510
|
* ```
|
|
1752
1511
|
*/
|
|
1753
|
-
const
|
|
1512
|
+
const getTemplatesSummary = async (endpoint, params = {}) => endpoint.api //
|
|
1754
1513
|
.post('/templates/summary', params)
|
|
1755
1514
|
.then((r) => r.data);
|
|
1756
1515
|
const cachedTemplates = {};
|
|
@@ -1780,22 +1539,6 @@ const listTemplates = async (endpoint, params = {}) => endpoint.api //
|
|
|
1780
1539
|
.post('/templates/list', params)
|
|
1781
1540
|
.then((r) => r.data);
|
|
1782
1541
|
|
|
1783
|
-
var Templates = /*#__PURE__*/Object.freeze({
|
|
1784
|
-
__proto__: null,
|
|
1785
|
-
createTemplate: createTemplate,
|
|
1786
|
-
createTemplateFromSharepoint: createTemplateFromSharepoint,
|
|
1787
|
-
createTemplatev2: createTemplatev2,
|
|
1788
|
-
deleteTemplate: deleteTemplate,
|
|
1789
|
-
getSummary: getSummary,
|
|
1790
|
-
getTemplate: getTemplate,
|
|
1791
|
-
getTemplateOwnerInfo: getTemplateOwnerInfo,
|
|
1792
|
-
getTemplates: getTemplates,
|
|
1793
|
-
listTemplates: listTemplates,
|
|
1794
|
-
searchTemplates: searchTemplates,
|
|
1795
|
-
throttledGetTemplate: throttledGetTemplate,
|
|
1796
|
-
updateTemplate: updateTemplate
|
|
1797
|
-
});
|
|
1798
|
-
|
|
1799
1542
|
/**
|
|
1800
1543
|
* A TemplateDocument represents a PDF or other attachment in a Template.
|
|
1801
1544
|
*
|
|
@@ -1884,21 +1627,6 @@ const getTemplateDocumentThumbnail = async (endpoint, templateId, documentId) =>
|
|
|
1884
1627
|
*/
|
|
1885
1628
|
const getTemplateDocumentPageDisplayUri = async (endpoint, templateId, documentId, page) => endpoint.api.get(`/templates/${templateId}/documents/${documentId}/pages/${page}/image`).then((r) => r.data);
|
|
1886
1629
|
|
|
1887
|
-
var TemplateDocuments = /*#__PURE__*/Object.freeze({
|
|
1888
|
-
__proto__: null,
|
|
1889
|
-
createTemplateDocument: createTemplateDocument,
|
|
1890
|
-
deleteTemplateDocument: deleteTemplateDocument,
|
|
1891
|
-
getTemplateDocument: getTemplateDocument,
|
|
1892
|
-
getTemplateDocumentFile: getTemplateDocumentFile,
|
|
1893
|
-
getTemplateDocumentPageDisplayUri: getTemplateDocumentPageDisplayUri,
|
|
1894
|
-
getTemplateDocumentThumbnail: getTemplateDocumentThumbnail,
|
|
1895
|
-
getTemplateDocuments: getTemplateDocuments
|
|
1896
|
-
});
|
|
1897
|
-
|
|
1898
|
-
var Types$2 = /*#__PURE__*/Object.freeze({
|
|
1899
|
-
__proto__: null
|
|
1900
|
-
});
|
|
1901
|
-
|
|
1902
1630
|
/**
|
|
1903
1631
|
* Get all defined validators
|
|
1904
1632
|
*
|
|
@@ -1923,30 +1651,6 @@ const isValidRoleName = (value, roles) => roles.findIndex((role) => role.name ==
|
|
|
1923
1651
|
const TagRegEx = /^[a-zA-Z0-9-]{0,32}$/;
|
|
1924
1652
|
const isValidTag = (value, tags) => TagRegEx.test(value) || tags.findIndex((tag) => tag === value) !== -1;
|
|
1925
1653
|
|
|
1926
|
-
var Validators = /*#__PURE__*/Object.freeze({
|
|
1927
|
-
__proto__: null,
|
|
1928
|
-
getValidator: getValidator,
|
|
1929
|
-
getValidators: getValidators,
|
|
1930
|
-
isValidEmail: isValidEmail,
|
|
1931
|
-
isValidPhone: isValidPhone,
|
|
1932
|
-
isValidRoleName: isValidRoleName,
|
|
1933
|
-
isValidTag: isValidTag
|
|
1934
|
-
});
|
|
1935
|
-
|
|
1936
|
-
var index$2 = /*#__PURE__*/Object.freeze({
|
|
1937
|
-
__proto__: null,
|
|
1938
|
-
Actions: Actions,
|
|
1939
|
-
Fields: Fields$1,
|
|
1940
|
-
Reminders: Reminders,
|
|
1941
|
-
Roles: Roles,
|
|
1942
|
-
Stars: Stars,
|
|
1943
|
-
Tags: Tags,
|
|
1944
|
-
TemplateDocuments: TemplateDocuments,
|
|
1945
|
-
Templates: Templates,
|
|
1946
|
-
Types: Types$2,
|
|
1947
|
-
Validators: Validators
|
|
1948
|
-
});
|
|
1949
|
-
|
|
1950
1654
|
/**
|
|
1951
1655
|
* Authenticate to Verdocs via user/password authentication
|
|
1952
1656
|
*
|
|
@@ -2072,36 +1776,13 @@ const createUser = (endpoint, params) => endpoint.api //
|
|
|
2072
1776
|
.post('/user', params)
|
|
2073
1777
|
.then((r) => r.data);
|
|
2074
1778
|
|
|
2075
|
-
var Auth = /*#__PURE__*/Object.freeze({
|
|
2076
|
-
__proto__: null,
|
|
2077
|
-
authenticateApp: authenticateApp,
|
|
2078
|
-
authenticateUser: authenticateUser,
|
|
2079
|
-
createUser: createUser,
|
|
2080
|
-
refreshTokens: refreshTokens,
|
|
2081
|
-
resendVerification: resendVerification,
|
|
2082
|
-
resetPassword: resetPassword,
|
|
2083
|
-
updateEmail: updateEmail,
|
|
2084
|
-
updatePassword: updatePassword,
|
|
2085
|
-
validateToken: validateToken
|
|
2086
|
-
});
|
|
2087
|
-
|
|
2088
1779
|
// TODO
|
|
2089
1780
|
const billingPlaceholder = {};
|
|
2090
1781
|
|
|
2091
|
-
var Billing = /*#__PURE__*/Object.freeze({
|
|
2092
|
-
__proto__: null,
|
|
2093
|
-
billingPlaceholder: billingPlaceholder
|
|
2094
|
-
});
|
|
2095
|
-
|
|
2096
1782
|
const getNotifications = async (endpoint) => endpoint.api //
|
|
2097
1783
|
.get('/notifications')
|
|
2098
1784
|
.then((r) => r.data);
|
|
2099
1785
|
|
|
2100
|
-
var Notifications = /*#__PURE__*/Object.freeze({
|
|
2101
|
-
__proto__: null,
|
|
2102
|
-
getNotifications: getNotifications
|
|
2103
|
-
});
|
|
2104
|
-
|
|
2105
1786
|
/**
|
|
2106
1787
|
* Get the user's available profiles. The current profile will be marked with `current: true`.
|
|
2107
1788
|
*
|
|
@@ -2256,36 +1937,6 @@ const recordSignupSurvey = (endpoint, params) => endpoint.api //
|
|
|
2256
1937
|
.post('/user/signup', params)
|
|
2257
1938
|
.then((r) => r.data);
|
|
2258
1939
|
|
|
2259
|
-
var Profiles = /*#__PURE__*/Object.freeze({
|
|
2260
|
-
__proto__: null,
|
|
2261
|
-
createBusinessAccount: createBusinessAccount,
|
|
2262
|
-
createProfile: createProfile,
|
|
2263
|
-
deleteProfile: deleteProfile,
|
|
2264
|
-
getCurrentProfile: getCurrentProfile,
|
|
2265
|
-
getPermissions: getPermissions,
|
|
2266
|
-
getProfile: getProfile,
|
|
2267
|
-
getProfileGroups: getProfileGroups,
|
|
2268
|
-
getProfilePermissions: getProfilePermissions,
|
|
2269
|
-
getProfiles: getProfiles,
|
|
2270
|
-
getRoles: getRoles,
|
|
2271
|
-
recordSignupSurvey: recordSignupSurvey,
|
|
2272
|
-
switchProfile: switchProfile,
|
|
2273
|
-
updateProfile: updateProfile
|
|
2274
|
-
});
|
|
2275
|
-
|
|
2276
|
-
var Types$1 = /*#__PURE__*/Object.freeze({
|
|
2277
|
-
__proto__: null
|
|
2278
|
-
});
|
|
2279
|
-
|
|
2280
|
-
var index$1 = /*#__PURE__*/Object.freeze({
|
|
2281
|
-
__proto__: null,
|
|
2282
|
-
Auth: Auth,
|
|
2283
|
-
Billing: Billing,
|
|
2284
|
-
Notifications: Notifications,
|
|
2285
|
-
Profiles: Profiles,
|
|
2286
|
-
Types: Types$1
|
|
2287
|
-
});
|
|
2288
|
-
|
|
2289
1940
|
/**
|
|
2290
1941
|
* Given a `rgba(r,g,b,a)` string value, returns the hex equivalent, dropping the alpha channel.
|
|
2291
1942
|
*/
|
|
@@ -2391,14 +2042,6 @@ function getRoleColor(name, roles, index) {
|
|
|
2391
2042
|
}
|
|
2392
2043
|
}
|
|
2393
2044
|
|
|
2394
|
-
var Colors = /*#__PURE__*/Object.freeze({
|
|
2395
|
-
__proto__: null,
|
|
2396
|
-
getRGB: getRGB,
|
|
2397
|
-
getRGBA: getRGBA,
|
|
2398
|
-
getRoleColor: getRoleColor,
|
|
2399
|
-
nameToRGBA: nameToRGBA
|
|
2400
|
-
});
|
|
2401
|
-
|
|
2402
2045
|
const YEAR = 365 * 24 * 60 * 60;
|
|
2403
2046
|
// const MONTH = 30 * 24 * 60 * 60;
|
|
2404
2047
|
const WEEK = 7 * 24 * 60 * 60;
|
|
@@ -2479,12 +2122,6 @@ function timePeriod(type) {
|
|
|
2479
2122
|
};
|
|
2480
2123
|
}
|
|
2481
2124
|
|
|
2482
|
-
var DateTime = /*#__PURE__*/Object.freeze({
|
|
2483
|
-
__proto__: null,
|
|
2484
|
-
formatShortTimeAgo: formatShortTimeAgo,
|
|
2485
|
-
timePeriod: timePeriod
|
|
2486
|
-
});
|
|
2487
|
-
|
|
2488
2125
|
function getRTop(y, fieldHeight, iTextHeight, yRatio) {
|
|
2489
2126
|
return iTextHeight - (y + fieldHeight) * yRatio;
|
|
2490
2127
|
}
|
|
@@ -2510,15 +2147,6 @@ function rescale(r, n) {
|
|
|
2510
2147
|
return r * n;
|
|
2511
2148
|
}
|
|
2512
2149
|
|
|
2513
|
-
var Fields = /*#__PURE__*/Object.freeze({
|
|
2514
|
-
__proto__: null,
|
|
2515
|
-
blobToBase64: blobToBase64,
|
|
2516
|
-
getRLeft: getRLeft,
|
|
2517
|
-
getRTop: getRTop,
|
|
2518
|
-
getRValue: getRValue,
|
|
2519
|
-
rescale: rescale
|
|
2520
|
-
});
|
|
2521
|
-
|
|
2522
2150
|
/**
|
|
2523
2151
|
* Given a File, extract the file's content as a base64 encoded data URL. The response will have a prefix that
|
|
2524
2152
|
* includes the MIME type of the file, e.g. "data:image/jpeg;base64,iVBORw0K......"
|
|
@@ -2557,12 +2185,6 @@ const downloadBlob = (blob, name = 'file.pdf') => {
|
|
|
2557
2185
|
document.body.removeChild(link);
|
|
2558
2186
|
};
|
|
2559
2187
|
|
|
2560
|
-
var Files = /*#__PURE__*/Object.freeze({
|
|
2561
|
-
__proto__: null,
|
|
2562
|
-
downloadBlob: downloadBlob,
|
|
2563
|
-
fileToDataUrl: fileToDataUrl
|
|
2564
|
-
});
|
|
2565
|
-
|
|
2566
2188
|
const Countries = [
|
|
2567
2189
|
{ code: '+7 840', name: 'Abkhazia', value: '+7' },
|
|
2568
2190
|
{ code: '+93', name: 'Afghanistan', value: '+93' },
|
|
@@ -2930,22 +2552,6 @@ function getMatchingCountry(code, substrings) {
|
|
|
2930
2552
|
// return (code !== null && code.length < 16 && code.length > 6 && e164Regex.test(code)) || code === '' || code === null;
|
|
2931
2553
|
// }
|
|
2932
2554
|
|
|
2933
|
-
var Locales = /*#__PURE__*/Object.freeze({
|
|
2934
|
-
__proto__: null,
|
|
2935
|
-
Countries: Countries,
|
|
2936
|
-
getCountryByCode: getCountryByCode,
|
|
2937
|
-
getMatchingCountry: getMatchingCountry,
|
|
2938
|
-
getPlusOneCountry: getPlusOneCountry,
|
|
2939
|
-
isAmericanSamoa: isAmericanSamoa,
|
|
2940
|
-
isCanada: isCanada,
|
|
2941
|
-
isDominicanRepublic: isDominicanRepublic,
|
|
2942
|
-
isFrenchGuiana: isFrenchGuiana,
|
|
2943
|
-
isGuadeloupe: isGuadeloupe,
|
|
2944
|
-
isMartinique: isMartinique,
|
|
2945
|
-
isMayotte: isMayotte,
|
|
2946
|
-
isPuertoRico: isPuertoRico
|
|
2947
|
-
});
|
|
2948
|
-
|
|
2949
2555
|
/**
|
|
2950
2556
|
* Capitalize the first letter of a string.
|
|
2951
2557
|
*/
|
|
@@ -2975,12 +2581,6 @@ const convertToE164 = (input) => {
|
|
|
2975
2581
|
return `+1${temp}`;
|
|
2976
2582
|
};
|
|
2977
2583
|
|
|
2978
|
-
var Strings = /*#__PURE__*/Object.freeze({
|
|
2979
|
-
__proto__: null,
|
|
2980
|
-
capitalize: capitalize,
|
|
2981
|
-
convertToE164: convertToE164
|
|
2982
|
-
});
|
|
2983
|
-
|
|
2984
2584
|
/**
|
|
2985
2585
|
* Create an array containing a sequence of integers, e.g. [START, START+1, START+2, ...] This is frequently useful
|
|
2986
2586
|
* in rendering operations when there is no source array to .map() across.
|
|
@@ -3004,30 +2604,5 @@ const fullNameToInitials = (name) => name
|
|
|
3004
2604
|
.map((word) => word[0])
|
|
3005
2605
|
.join('');
|
|
3006
2606
|
|
|
3007
|
-
|
|
3008
|
-
__proto__: null,
|
|
3009
|
-
formatFullName: formatFullName,
|
|
3010
|
-
formatInitials: formatInitials,
|
|
3011
|
-
fullNameToInitials: fullNameToInitials,
|
|
3012
|
-
integerSequence: integerSequence
|
|
3013
|
-
});
|
|
3014
|
-
|
|
3015
|
-
var Types = /*#__PURE__*/Object.freeze({
|
|
3016
|
-
__proto__: null
|
|
3017
|
-
});
|
|
3018
|
-
|
|
3019
|
-
var index = /*#__PURE__*/Object.freeze({
|
|
3020
|
-
__proto__: null,
|
|
3021
|
-
Colors: Colors,
|
|
3022
|
-
DateTime: DateTime,
|
|
3023
|
-
Fields: Fields,
|
|
3024
|
-
Files: Files,
|
|
3025
|
-
Locales: Locales,
|
|
3026
|
-
Primitives: Primitives,
|
|
3027
|
-
Strings: Strings,
|
|
3028
|
-
Token: Token,
|
|
3029
|
-
Types: Types
|
|
3030
|
-
});
|
|
3031
|
-
|
|
3032
|
-
export { index$5 as Envelopes, index$4 as Organizations, index$3 as Sessions, index$2 as Templates, index$1 as Users, index as Utils, VerdocsEndpoint };
|
|
2607
|
+
export { AtoB, Countries, VerdocsEndpoint, acceptOrganizationInvitation, addGroupMembers, addGroupPermission, addOrganizationMemberRole, addTemplateTag, authenticateApp, authenticateUser, billingPlaceholder, blobToBase64, canPerformTemplateAction, cancelEnvelope, capitalize, claimNewUser, convertToE164, createApiKey, createBusinessAccount, createEnvelope, createEnvelopeReminder, createField, createInitials, createOrganization, createOrganizationInvitation, createProfile, createSignature, createTag, createTemplate, createTemplateDocument, createTemplateFromSharepoint, createTemplateReminder, createTemplateRole, createTemplatev2, createUser, declineOrganizationInvitation, decodeAccessTokenBody, decodeJWTBody, deleteApiKey, deleteEnvelopeFieldAttachment, deleteEnvelopeReminder, deleteField, deleteGroupMembers, deleteGroupPermission, deleteOrganization, deleteOrganizationInvitation, deleteOrganizationMember, deleteOrganizationMemberRole, deleteProfile, deleteSignature, deleteTemplate, deleteTemplateDocument, deleteTemplateReminder, deleteTemplateRole, deleteTemplateTag, downloadBlob, envelopeIsActive, envelopeIsComplete, envelopeRecipientAgree, envelopeRecipientChangeOwner, envelopeRecipientDecline, envelopeRecipientPrepare, envelopeRecipientSubmit, envelopeRecipientUpdateName, fileToDataUrl, formatFullName, formatInitials, formatShortTimeAgo, fullNameToInitials, getAllTags, getApiKeys, getCountryByCode, getCurrentProfile, getDocumentDownloadLink, getDocumentPreviewLink, getEnvelope, getEnvelopeDocument, getEnvelopeDocumentPageDisplayUri, getEnvelopeFile, getEnvelopeRecipients, getEnvelopeReminder, getEnvelopesSummary, getFieldAttachment, getGroup, getGroupByName, getGroupMembers, getGroups, getInPersonLink, getMatchingCountry, getNextRecipient, getNotifications, getOrganization, getOrganizationInvitation, getOrganizationInvitations, getOrganizationMemberPlans, getOrganizationMembers, getOrganizations, getPermissions, getPlusOneCountry, getProfile, getProfileGroups, getProfilePermissions, getProfiles, getRGB, getRGBA, getRLeft, getRTop, getRValue, getRecipientsWithActions, getRoleColor, getRoles, getSignature, getSignatures, getSignerToken, getSigningSession, getStars, getTag, getTemplate, getTemplateDocument, getTemplateDocumentFile, getTemplateDocumentPageDisplayUri, getTemplateDocumentThumbnail, getTemplateDocuments, getTemplateOwnerInfo, getTemplateReminder, getTemplateRole, getTemplateRoleFields, getTemplateRoles, getTemplateTags, getTemplates, getTemplatesSummary, getValidator, getValidators, getWebhooks, hasRequiredPermissions, integerSequence, isAmericanSamoa, isCanada, isDominicanRepublic, isFrenchGuiana, isGuadeloupe, isMartinique, isMayotte, isPuertoRico, isValidEmail, isValidPhone, isValidRoleName, isValidTag, listEnvelopes, listTemplates, nameToRGBA, recipientCanAct, recipientHasAction, recordSignupSurvey, refreshTokens, rescale, resendInvitation, resendOrganizationInvitation, resendVerification, resetPassword, rotateApiKey, searchEnvelopes, searchTemplates, sendDelegate, setWebhooks, switchProfile, throttledGetEnvelope, throttledGetTemplate, timePeriod, toggleStar, updateApiKey, updateEmail, updateEnvelopeField, updateEnvelopeFieldInitials, updateEnvelopeFieldSignature, updateEnvelopeReminder, updateField, updateOrganization, updateOrganizationInvitation, updatePassword, updateProfile, updateRecipient, updateTemplate, updateTemplateReminder, updateTemplateRole, uploadEnvelopeFieldAttachment, userCanAct, userCanCancelEnvelope, userCanFinishEnvelope, userCanSignNow, userHasPermissions, userIsEnvelopeOwner, userIsEnvelopeRecipient, validateToken };
|
|
3033
2608
|
//# sourceMappingURL=index.mjs.map
|