@verdocs/js-sdk 4.2.71 → 4.2.73
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 +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +13 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -5
- package/dist/index.mjs.map +1 -1
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -655,6 +655,11 @@ const convertToE164 = (input) => {
|
|
|
655
655
|
// already entering a prefix so they'd shortcut out of this routine via the + prefix check.
|
|
656
656
|
return `+1${temp}`;
|
|
657
657
|
};
|
|
658
|
+
// Generate a random string of a given length. This is NOT cryptographically strong. It is meant for light-duty
|
|
659
|
+
// uses such as assigning IDs to DOM elements.
|
|
660
|
+
const randomString = (length) => Math.random()
|
|
661
|
+
.toString(36)
|
|
662
|
+
.substring(2, 2 + length + 1);
|
|
658
663
|
|
|
659
664
|
/**
|
|
660
665
|
* Create an array containing a sequence of integers, e.g. [START, START+1, START+2, ...] This is frequently useful
|
|
@@ -1061,6 +1066,7 @@ class VerdocsEndpoint {
|
|
|
1061
1066
|
nextListenerId = 0;
|
|
1062
1067
|
sessionListeners = new Map();
|
|
1063
1068
|
requestLoggerId = null;
|
|
1069
|
+
endpointId = randomString(8);
|
|
1064
1070
|
/**
|
|
1065
1071
|
* The current user's userId (NOT profileId), or null if not authenticated.
|
|
1066
1072
|
*/
|
|
@@ -1098,14 +1104,14 @@ class VerdocsEndpoint {
|
|
|
1098
1104
|
}
|
|
1099
1105
|
setDefault() {
|
|
1100
1106
|
globalThis$1[ENDPOINT_KEY] = this;
|
|
1101
|
-
window?.console?.debug('[JS_SDK] Set default endpoint',
|
|
1107
|
+
window?.console?.debug('[JS_SDK] Set default endpoint', this.endpointId);
|
|
1102
1108
|
}
|
|
1103
1109
|
static getDefault() {
|
|
1104
1110
|
if (!globalThis$1[ENDPOINT_KEY]) {
|
|
1105
1111
|
globalThis$1[ENDPOINT_KEY] = new VerdocsEndpoint();
|
|
1106
1112
|
// window.console.debug('[JS_SDK] Created default endpoint', globalThis[ENDPOINT_KEY].baseURL);
|
|
1107
1113
|
}
|
|
1108
|
-
window?.console?.debug('[JS_SDK] Getting default endpoint',
|
|
1114
|
+
window?.console?.debug('[JS_SDK] Getting default endpoint', globalThis$1[ENDPOINT_KEY].endpointId);
|
|
1109
1115
|
return globalThis$1[ENDPOINT_KEY];
|
|
1110
1116
|
}
|
|
1111
1117
|
/**
|
|
@@ -1285,11 +1291,11 @@ class VerdocsEndpoint {
|
|
|
1285
1291
|
// to load it. We expose it in case it's useful, but have to set it here instead of in the async callbacks
|
|
1286
1292
|
// even though their might be a brief window of time where it's set but something might go wrong (profile
|
|
1287
1293
|
// doesn't load) because we need it to serve that original purpose more.
|
|
1294
|
+
window?.console?.debug('[JS_SDK] userId changed, loading current profile...', this.endpointId, this.sub, session.sub);
|
|
1288
1295
|
this.sub = session.sub;
|
|
1289
|
-
window?.console?.debug('[JS_SDK] userId changed, loading current profile...', session.sub);
|
|
1290
1296
|
getCurrentProfile(this)
|
|
1291
1297
|
.then((r) => {
|
|
1292
|
-
window?.console?.debug('[JS_SDK] Loaded profile', r);
|
|
1298
|
+
window?.console?.debug('[JS_SDK] Loaded profile', this.endpointId, r);
|
|
1293
1299
|
this.profile = r || null;
|
|
1294
1300
|
this.notifySessionListeners();
|
|
1295
1301
|
})
|
|
@@ -1316,6 +1322,7 @@ class VerdocsEndpoint {
|
|
|
1316
1322
|
* Clear the active session.
|
|
1317
1323
|
*/
|
|
1318
1324
|
clearSession() {
|
|
1325
|
+
window?.console?.debug('[JS_SDK] Clearing session', this.endpointId);
|
|
1319
1326
|
if (this.persist) {
|
|
1320
1327
|
localStorage.removeItem(this.sessionStorageKey());
|
|
1321
1328
|
}
|
|
@@ -1332,6 +1339,7 @@ class VerdocsEndpoint {
|
|
|
1332
1339
|
* Clear the active signing session.
|
|
1333
1340
|
*/
|
|
1334
1341
|
clearSignerSession() {
|
|
1342
|
+
window?.console?.debug('[JS_SDK] Clearing signer session', this.endpointId);
|
|
1335
1343
|
if (this.persist) {
|
|
1336
1344
|
localStorage.removeItem(this.sessionStorageKey());
|
|
1337
1345
|
}
|
|
@@ -2873,5 +2881,5 @@ const isValidRoleName = (value, roles) => roles.findIndex((role) => role.name ==
|
|
|
2873
2881
|
const TagRegEx = /^[a-zA-Z0-9-]{0,32}$/;
|
|
2874
2882
|
const isValidTag = (value, tags) => TagRegEx.test(value) || tags.findIndex((tag) => tag === value) !== -1;
|
|
2875
2883
|
|
|
2876
|
-
export { AtoB, Countries, DEFAULT_FIELD_HEIGHTS, DEFAULT_FIELD_WIDTHS, FIELD_TYPES, RolePermissions, VerdocsEndpoint, WEBHOOK_EVENTS, acceptOrganizationInvitation, addGroupMember, addTemplateTag, authenticate, blobToBase64, canPerformTemplateAction, cancelEnvelope, capitalize, changePassword, convertToE164, createApiKey, createEnvelope, createEnvelopeReminder, createField, createGroup, createInitials, createOrganizationContact, createOrganizationInvitation, createProfile, createSignature, createTag, createTemplate, createTemplateDocument, createTemplateFromSharepoint, createTemplateReminder, createTemplateRole, declineOrganizationInvitation, decodeAccessTokenBody, decodeJWTBody, deleteApiKey, deleteEnvelopeFieldAttachment, deleteEnvelopeReminder, deleteField, deleteGroupMember, deleteOrganizationContact, 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, getEnvelopeReminder, getEnvelopes, getFieldAttachment, getFieldsForRole, getGroup, getGroups, getInPersonLink, getKbaStep, getMatchingCountry, getMyUser, getNextRecipient, getNotifications, getOrganization, getOrganizationContacts, getOrganizationInvitation, getOrganizationInvitations, getOrganizationMembers, getPlusOneCountry, getProfiles, getRGB, getRGBA, getRLeft, getRTop, getRValue, getRecipientsWithActions, getRoleColor, getSignature, getSignatures, 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, nameToRGBA, recipientCanAct, recipientHasAction, refreshToken, rescale, resendInvitation, resendOrganizationInvitation, resendVerification, resetPassword, rotateApiKey, sendDelegate, setWebhooks, startSigningSession, submitKbaChallengeResponse, submitKbaIdentity, submitKbaPin, switchProfile, toggleStar, updateApiKey, updateEnvelopeField, updateEnvelopeFieldInitials, updateEnvelopeFieldSignature, updateEnvelopeReminder, updateField, updateGroup, updateOrganization, updateOrganizationContact, 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 };
|
|
2884
|
+
export { AtoB, Countries, DEFAULT_FIELD_HEIGHTS, DEFAULT_FIELD_WIDTHS, FIELD_TYPES, RolePermissions, VerdocsEndpoint, WEBHOOK_EVENTS, acceptOrganizationInvitation, addGroupMember, addTemplateTag, authenticate, blobToBase64, canPerformTemplateAction, cancelEnvelope, capitalize, changePassword, convertToE164, createApiKey, createEnvelope, createEnvelopeReminder, createField, createGroup, createInitials, createOrganizationContact, createOrganizationInvitation, createProfile, createSignature, createTag, createTemplate, createTemplateDocument, createTemplateFromSharepoint, createTemplateReminder, createTemplateRole, declineOrganizationInvitation, decodeAccessTokenBody, decodeJWTBody, deleteApiKey, deleteEnvelopeFieldAttachment, deleteEnvelopeReminder, deleteField, deleteGroupMember, deleteOrganizationContact, 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, getEnvelopeReminder, getEnvelopes, getFieldAttachment, getFieldsForRole, getGroup, getGroups, getInPersonLink, getKbaStep, getMatchingCountry, getMyUser, getNextRecipient, getNotifications, getOrganization, getOrganizationContacts, getOrganizationInvitation, getOrganizationInvitations, getOrganizationMembers, getPlusOneCountry, getProfiles, getRGB, getRGBA, getRLeft, getRTop, getRValue, getRecipientsWithActions, getRoleColor, getSignature, getSignatures, 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, nameToRGBA, randomString, recipientCanAct, recipientHasAction, refreshToken, rescale, resendInvitation, resendOrganizationInvitation, resendVerification, resetPassword, rotateApiKey, sendDelegate, setWebhooks, startSigningSession, submitKbaChallengeResponse, submitKbaIdentity, submitKbaPin, switchProfile, toggleStar, updateApiKey, updateEnvelopeField, updateEnvelopeFieldInitials, updateEnvelopeFieldSignature, updateEnvelopeReminder, updateField, updateGroup, updateOrganization, updateOrganizationContact, 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 };
|
|
2877
2885
|
//# sourceMappingURL=index.mjs.map
|