@verdocs/js-sdk 4.2.25 → 4.2.27
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 +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +85 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +82 -7
- package/dist/index.mjs.map +1 -1
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,80 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
|
|
3
|
+
const FIELD_TYPES = [
|
|
4
|
+
'textbox',
|
|
5
|
+
'signature',
|
|
6
|
+
'initial',
|
|
7
|
+
'date',
|
|
8
|
+
'dropdown',
|
|
9
|
+
'timestamp',
|
|
10
|
+
'textarea',
|
|
11
|
+
'checkbox',
|
|
12
|
+
'radio',
|
|
13
|
+
'attachment',
|
|
14
|
+
'payment',
|
|
15
|
+
];
|
|
16
|
+
const DEFAULT_FIELD_WIDTHS = {
|
|
17
|
+
signature: 71,
|
|
18
|
+
initial: 71,
|
|
19
|
+
date: 75,
|
|
20
|
+
timestamp: 130,
|
|
21
|
+
textbox: 150,
|
|
22
|
+
textarea: 150,
|
|
23
|
+
checkbox: 14,
|
|
24
|
+
checkbox_group: 14,
|
|
25
|
+
radio_button_group: 14,
|
|
26
|
+
radio: 14,
|
|
27
|
+
dropdown: 85,
|
|
28
|
+
attachment: 24,
|
|
29
|
+
payment: 24,
|
|
30
|
+
};
|
|
31
|
+
const DEFAULT_FIELD_HEIGHTS = {
|
|
32
|
+
signature: 36,
|
|
33
|
+
initial: 36,
|
|
34
|
+
date: 15,
|
|
35
|
+
timestamp: 15,
|
|
36
|
+
textbox: 15,
|
|
37
|
+
textarea: 41,
|
|
38
|
+
checkbox: 14,
|
|
39
|
+
checkbox_group: 14,
|
|
40
|
+
radio_button_group: 14,
|
|
41
|
+
radio: 14,
|
|
42
|
+
dropdown: 20,
|
|
43
|
+
attachment: 24,
|
|
44
|
+
payment: 24,
|
|
45
|
+
};
|
|
46
|
+
const DEFAULT_FIELD_SETTINGS = {
|
|
47
|
+
signature: { result: '' },
|
|
48
|
+
initial: { result: '' },
|
|
49
|
+
date: { width: 75, height: 15, result: '' },
|
|
50
|
+
timestamp: { width: 130, height: 15 },
|
|
51
|
+
textbox: { width: 150, height: 15, result: '', leading: 0, alignment: 0, upperCase: false },
|
|
52
|
+
textarea: { width: 150, height: 15, result: '', leading: 16, alignment: 0, upperCase: false },
|
|
53
|
+
checkbox: {},
|
|
54
|
+
checkbox_group: {
|
|
55
|
+
minimum_checked: 0,
|
|
56
|
+
maximum_checked: 1000,
|
|
57
|
+
options: [
|
|
58
|
+
// { id: `${field.name}-1`, value: 'Option 1', checked: false, x, y },
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
radio_button_group: {
|
|
62
|
+
options: [
|
|
63
|
+
// { id: `${field.name}-1`, value: 'Option 1', selected: false, x, y }
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
radio: {},
|
|
67
|
+
dropdown: {
|
|
68
|
+
width: 85,
|
|
69
|
+
height: 20,
|
|
70
|
+
value: null,
|
|
71
|
+
placeholder: 'Choose',
|
|
72
|
+
options: [{ id: 'option-1', value: 'Option 1' }],
|
|
73
|
+
},
|
|
74
|
+
attachment: {},
|
|
75
|
+
payment: {},
|
|
76
|
+
};
|
|
77
|
+
|
|
3
78
|
/**
|
|
4
79
|
* Given a `rgba(r,g,b,a)` string value, returns the hex equivalent, dropping the alpha channel.
|
|
5
80
|
*/
|
|
@@ -1072,12 +1147,12 @@ class VerdocsEndpoint {
|
|
|
1072
1147
|
* ```
|
|
1073
1148
|
*/
|
|
1074
1149
|
constructor(options) {
|
|
1075
|
-
this.baseURL = options?.baseURL
|
|
1076
|
-
this.timeout = options?.timeout
|
|
1077
|
-
this.environment = options?.environment
|
|
1078
|
-
this.sessionType = options?.sessionType
|
|
1079
|
-
this.clientID = options?.clientID
|
|
1080
|
-
this.persist = options?.persist
|
|
1150
|
+
this.baseURL = options?.baseURL ?? this.baseURL;
|
|
1151
|
+
this.timeout = options?.timeout ?? this.timeout;
|
|
1152
|
+
this.environment = options?.environment ?? this.environment;
|
|
1153
|
+
this.sessionType = options?.sessionType ?? this.sessionType;
|
|
1154
|
+
this.clientID = options?.clientID ?? this.clientID;
|
|
1155
|
+
this.persist = options?.persist ?? this.persist;
|
|
1081
1156
|
this.api = axios.create({ baseURL: this.baseURL, timeout: this.timeout });
|
|
1082
1157
|
}
|
|
1083
1158
|
setDefault() {
|
|
@@ -2842,5 +2917,5 @@ const isValidRoleName = (value, roles) => roles.findIndex((role) => role.name ==
|
|
|
2842
2917
|
const TagRegEx = /^[a-zA-Z0-9-]{0,32}$/;
|
|
2843
2918
|
const isValidTag = (value, tags) => TagRegEx.test(value) || tags.findIndex((tag) => tag === value) !== -1;
|
|
2844
2919
|
|
|
2845
|
-
export { AtoB, Countries, RolePermissions, VerdocsEndpoint, acceptOrganizationInvitation, addGroupMember, addTemplateTag, authenticate, blobToBase64, canPerformTemplateAction, cancelEnvelope, capitalize, changePassword, convertToE164, createApiKey, createEnvelope, createEnvelopeReminder, createField, createGroup, createInitials, createOrganizationInvitation, createProfile, createSignature, createTag, createTemplate, createTemplateDocument, createTemplateFromSharepoint, createTemplateReminder, createTemplateRole, declineOrganizationInvitation, decodeAccessTokenBody, decodeJWTBody, deleteApiKey, deleteEnvelopeFieldAttachment, deleteEnvelopeReminder, deleteField, deleteGroupMember, deleteOrganizationInvitation, deleteOrganizationMember, 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, getEnvelopes, getEnvelopesSummary, getFieldAttachment, getFieldsForRole, getGroup, getGroups, getInPersonLink, getKbaStep, getMatchingCountry, getMyUser, getNextRecipient, getNotifications, getOrganization, getOrganizationInvitation, getOrganizationInvitations, getOrganizationMembers, getPlusOneCountry, getProfiles, getRGB, getRGBA, getRLeft, getRTop, getRValue, getRecipientsWithActions, getRoleColor, getSignature, getSignatures, getSignerToken, getSigningSession, getStars, getTag, getTemplate, getTemplateDocument, getTemplateDocumentFile, getTemplateDocumentPageDisplayUri, getTemplateDocumentThumbnail, getTemplateDocuments, getTemplateReminder, getTemplateTags, getTemplates, getValidator, getValidators, getWebhooks, hasRequiredPermissions, integerSequence, isAmericanSamoa, isCanada, isDominicanRepublic, isFrenchGuiana, isGuadeloupe, isMartinique, isMayotte, isPuertoRico, isValidEmail, isValidPhone, isValidRoleName, isValidTag, listTemplates, nameToRGBA, recipientCanAct, recipientHasAction, refreshToken, rescale, resendInvitation, resendOrganizationInvitation, resendVerification, resetPassword, rotateApiKey, searchTemplates, sendDelegate, setWebhooks, submitKbaChallengeResponse, submitKbaIdentity, submitKbaPin, switchProfile, timePeriod, toggleStar, updateApiKey, updateEnvelopeField, updateEnvelopeFieldInitials, updateEnvelopeFieldSignature, updateEnvelopeReminder, updateField, updateGroup, updateOrganization, updateOrganizationInvitation, updateOrganizationLogo, updateOrganizationMember, updateOrganizationThumbnail, updateProfile, updateProfilePhoto, updateRecipient, updateTemplate, updateTemplateReminder, updateTemplateRole, uploadEnvelopeFieldAttachment, userCanAct, userCanBuildTemplate, userCanCancelEnvelope, userCanChangeOrgVisibility, userCanCreateOrgTemplate, userCanCreatePersonalTemplate, userCanCreatePublicTemplate, userCanCreateTemplate, userCanDeleteTemplate, userCanFinishEnvelope, userCanMakeTemplatePrivate, userCanMakeTemplatePublic, userCanMakeTemplateShared, userCanPreviewTemplate, userCanReadTemplate, userCanSendTemplate, userCanSignNow, userCanUpdateTemplate, userHasPermissions, userHasSharedTemplate, userIsEnvelopeOwner, userIsEnvelopeRecipient, userIsTemplateCreator, verifyEmail };
|
|
2920
|
+
export { AtoB, Countries, DEFAULT_FIELD_HEIGHTS, DEFAULT_FIELD_SETTINGS, DEFAULT_FIELD_WIDTHS, FIELD_TYPES, RolePermissions, VerdocsEndpoint, acceptOrganizationInvitation, addGroupMember, addTemplateTag, authenticate, blobToBase64, canPerformTemplateAction, cancelEnvelope, capitalize, changePassword, convertToE164, createApiKey, createEnvelope, createEnvelopeReminder, createField, createGroup, createInitials, createOrganizationInvitation, createProfile, createSignature, createTag, createTemplate, createTemplateDocument, createTemplateFromSharepoint, createTemplateReminder, createTemplateRole, declineOrganizationInvitation, decodeAccessTokenBody, decodeJWTBody, deleteApiKey, deleteEnvelopeFieldAttachment, deleteEnvelopeReminder, deleteField, deleteGroupMember, deleteOrganizationInvitation, deleteOrganizationMember, 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, getEnvelopes, getEnvelopesSummary, getFieldAttachment, getFieldsForRole, getGroup, getGroups, getInPersonLink, getKbaStep, getMatchingCountry, getMyUser, getNextRecipient, getNotifications, getOrganization, getOrganizationInvitation, getOrganizationInvitations, getOrganizationMembers, getPlusOneCountry, getProfiles, getRGB, getRGBA, getRLeft, getRTop, getRValue, getRecipientsWithActions, getRoleColor, getSignature, getSignatures, getSignerToken, getSigningSession, getStars, getTag, getTemplate, getTemplateDocument, getTemplateDocumentFile, getTemplateDocumentPageDisplayUri, getTemplateDocumentThumbnail, getTemplateDocuments, getTemplateReminder, getTemplateTags, getTemplates, getValidator, getValidators, getWebhooks, hasRequiredPermissions, integerSequence, isAmericanSamoa, isCanada, isDominicanRepublic, isFrenchGuiana, isGuadeloupe, isMartinique, isMayotte, isPuertoRico, isValidEmail, isValidPhone, isValidRoleName, isValidTag, listTemplates, nameToRGBA, recipientCanAct, recipientHasAction, refreshToken, rescale, resendInvitation, resendOrganizationInvitation, resendVerification, resetPassword, rotateApiKey, searchTemplates, sendDelegate, setWebhooks, submitKbaChallengeResponse, submitKbaIdentity, submitKbaPin, switchProfile, timePeriod, toggleStar, updateApiKey, updateEnvelopeField, updateEnvelopeFieldInitials, updateEnvelopeFieldSignature, updateEnvelopeReminder, updateField, updateGroup, updateOrganization, updateOrganizationInvitation, updateOrganizationLogo, updateOrganizationMember, updateOrganizationThumbnail, updateProfile, updateProfilePhoto, updateRecipient, updateTemplate, updateTemplateReminder, updateTemplateRole, uploadEnvelopeFieldAttachment, userCanAct, userCanBuildTemplate, userCanCancelEnvelope, userCanChangeOrgVisibility, userCanCreateOrgTemplate, userCanCreatePersonalTemplate, userCanCreatePublicTemplate, userCanCreateTemplate, userCanDeleteTemplate, userCanFinishEnvelope, userCanMakeTemplatePrivate, userCanMakeTemplatePublic, userCanMakeTemplateShared, userCanPreviewTemplate, userCanReadTemplate, userCanSendTemplate, userCanSignNow, userCanUpdateTemplate, userHasPermissions, userHasSharedTemplate, userIsEnvelopeOwner, userIsEnvelopeRecipient, userIsTemplateCreator, verifyEmail };
|
|
2846
2921
|
//# sourceMappingURL=index.mjs.map
|