@verdocs/js-sdk 4.1.2 → 4.1.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../src/Utils/Colors.ts","../src/Utils/DateTime.ts","../src/Utils/Fields.ts","../src/Utils/Files.ts","../src/Utils/Locales.ts","../src/Utils/Strings.ts","../src/Utils/Primitives.ts","../src/Utils/Token.ts","../src/Utils/globalThis.js","../src/VerdocsEndpoint.ts","../src/Envelopes/Envelopes.ts","../src/Envelopes/Initials.ts","../src/Envelopes/Recipients.ts","../src/Envelopes/Reminders.ts","../src/Envelopes/Permissions.ts","../src/Envelopes/Signatures.ts","../src/Organizations/ApiKeys.ts","../src/Organizations/Groups.ts","../src/Organizations/Invitations.ts","../src/Organizations/Members.ts","../src/Organizations/Organizations.ts","../src/Organizations/Webhooks.ts","../src/Sessions/Permissions.ts","../src/Templates/Actions.ts","../src/Templates/Fields.ts","../src/Templates/Permissions.ts","../src/Templates/Reminders.ts","../src/Templates/Roles.ts","../src/Templates/Stars.ts","../src/Templates/Tags.ts","../src/Templates/Templates.ts","../src/Templates/TemplateDocuments.ts","../src/Templates/Validators.ts","../src/Users/Auth.ts","../src/Users/Notifications.ts","../src/Users/Profiles.ts"],"sourcesContent":["import type {TRole} from '../BaseTypes';\n\n/**\n * Given a `rgba(r,g,b,a)` string value, returns the hex equivalent, dropping the alpha channel.\n */\nexport function getRGB(rgba: string) {\n const rgbNumbers = rgba.replace('rgba(', '').replace(')', '').split(',');\n const rgbObject = {\n red: +rgbNumbers[0],\n green: +rgbNumbers[1],\n blue: +rgbNumbers[2],\n alpha: +rgbNumbers[3],\n };\n const alpha = 1 - rgbObject.alpha;\n const red = Math.round((rgbObject.alpha * (rgbObject.red / 255) + alpha) * 255);\n const green = Math.round((rgbObject.alpha * (rgbObject.green / 255) + alpha) * 255);\n const blue = Math.round((rgbObject.alpha * (rgbObject.blue / 255) + alpha) * 255);\n return '#' + rgbToHex(red) + rgbToHex(green) + rgbToHex(blue);\n}\n\n/**\n * Given an RGB string value, returns the hex equivalent.\n */\nfunction rgbToHex(rgb: number) {\n const hex = rgb.toString(16);\n if (hex.length < 2) {\n return '0' + hex;\n }\n return hex;\n}\n\n/**\n * Given a signer role index, return the color code for that signer.\n */\nexport function getRGBA(roleIndex: number) {\n switch (roleIndex % 10) {\n case 0:\n return roleIndex === 0 ? 'rgba(255, 193, 7, 0.4)' : 'rgba(134, 134, 134, 0.3)'; // #FFE69C\n case 1:\n return 'rgba(156, 39, 176, .4)'; // '#E3C3E9'\n case 2:\n return 'rgba(33, 150, 243, .4)'; // '#C1E1FB'\n case 3:\n return 'rgba(220, 231, 117, 0.3)';\n case 4:\n return 'rgba(121, 134, 203, 0.3)';\n case 5:\n return 'rgba(77, 182, 172, 0.3)';\n case 6:\n return 'rgba(255, 202, 165, 0.3)';\n case 7:\n return 'rgba(2, 247, 190, 0.3)';\n case 8:\n return 'rgba(255, 138, 101, 0.3)';\n case 9:\n return 'rgba(82, 255, 79, 0.3)';\n default:\n return 'rgba(229, 115, 155, 0.3)';\n }\n}\n\n/**\n * Given a role name, return a color code for it. This works by computing a hash code so the specific color returned\n * is not specified explicitly, but will be the same for every call with the same input value.\n */\nexport function nameToRGBA(str: string) {\n if (!!str) {\n const validNum = parseInt(str.slice(-1), 10);\n if (!isNaN(validNum)) {\n str += (validNum * 99).toString();\n }\n let hash = 0;\n for (let i = 0; i < str.length; i++) {\n // tslint:disable-next-line:no-bitwise\n hash = str.charCodeAt(i) + ((hash << 5) - hash);\n }\n hash = Math.round(hash / 1.3);\n // tslint:disable-next-line:no-bitwise\n const c = (hash & 0x00ffff08).toString(16).toUpperCase();\n const hex = '#' + '00000'.substring(0, 6 - c.length) + c;\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex) as any[];\n const color = {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16),\n };\n return `rgba(${color.r}, ${color.g}, ${color.b}, 0.2)`;\n }\n}\n\n/**\n * Helper function to obtain a color code given a role name given various possible inputs.\n */\nexport function getRoleColor(name: string, roles: TRole[], index?: number) {\n if (index) {\n return getRGBA(index);\n } else if (roles && roles.length > 0) {\n const roleIndex = roles.findIndex((role) => role === name);\n if (roleIndex > -1) {\n return getRGBA(roleIndex);\n } else {\n return nameToRGBA(name);\n }\n } else {\n return nameToRGBA(name);\n }\n}\n","import type {ITimePeriod} from './Types';\n\nconst YEAR = 365 * 24 * 60 * 60;\n// const MONTH = 30 * 24 * 60 * 60;\nconst WEEK = 7 * 24 * 60 * 60;\nconst DAY = 24 * 60 * 60;\nconst HOUR = 60 * 60;\nconst MINUTE = 60;\n\nexport const formatShortTimeAgo = (val: any) => {\n if (val === undefined || val === null) {\n return '';\n }\n\n let dateInput;\n if (typeof val === 'string' || typeof val === 'number') {\n dateInput = new Date(val);\n } else if (typeof val === 'object') {\n dateInput = val;\n } else {\n return '';\n }\n\n const timeDiff = Math.floor((new Date().getTime() - dateInput.getTime()) / 1000);\n if (timeDiff >= YEAR) {\n return Math.floor(timeDiff / YEAR) + 'Y';\n }\n // if (timeDiff >= MONTH) {\n // return Math.floor(timeDiff / MONTH) + 'M';\n // }\n if (timeDiff >= WEEK) {\n return Math.floor(timeDiff / WEEK) + 'W';\n }\n if (timeDiff >= DAY) {\n return Math.floor(timeDiff / DAY) + 'D';\n }\n if (timeDiff >= HOUR) {\n return Math.floor(timeDiff / HOUR) + 'H';\n }\n if (timeDiff >= MINUTE) {\n return Math.floor(timeDiff / MINUTE) + 'M';\n }\n\n return `${timeDiff}S`;\n};\n\nexport function timePeriod(type: string): ITimePeriod | null {\n let endDate = new Date().getTime();\n const today = new Date();\n const month = today.getMonth();\n const year = today.getFullYear();\n let startDate = null;\n switch (type) {\n case '30d':\n startDate = endDate - 60 * 60 * 24 * 30 * 1000;\n break;\n\n case '60d':\n startDate = endDate - 60 * 60 * 24 * 60 * 1000;\n break;\n\n case '6m':\n startDate = endDate - 60 * 60 * 24 * 30 * 6 * 1000;\n break;\n\n case 'this_month':\n startDate = new Date(year, month, 1).getTime();\n break;\n\n case 'last_month':\n startDate = new Date(year, month - 1, 1).getTime();\n endDate = new Date(year, month, 0).getTime();\n break;\n\n case 'this_year':\n startDate = new Date(year, 0, 1);\n break;\n\n case 'all_time':\n default:\n return null;\n }\n\n if (startDate === null && endDate === null) {\n return null;\n }\n\n return {\n start_time: new Date(startDate).toISOString(),\n end_time: new Date(endDate).toISOString(),\n } as ITimePeriod;\n}\n","export function getRTop(y: number, fieldHeight: number, iTextHeight: number, yRatio: number) {\n return iTextHeight - (y + fieldHeight) * yRatio;\n}\n\nexport function getRLeft(x: number, ratio: number) {\n return x * ratio;\n}\n\nexport function getRValue(y: number, ratio: number) {\n return y * ratio;\n}\n\nexport function blobToBase64(image: Blob) {\n const fileReader = new FileReader();\n return new Promise((resolve, reject) => {\n fileReader.onerror = () => {\n reject(new DOMException('Problem reading blob.'));\n };\n\n fileReader.onload = () => {\n resolve(fileReader.result);\n };\n\n fileReader.readAsDataURL(image);\n });\n}\n\nexport function rescale(r: number, n: number): number {\n return r * n;\n}\n","import type {IFileWithData} from './Types';\n\n/**\n * Given a File, extract the file's content as a base64 encoded data URL. The response will have a prefix that\n * includes the MIME type of the file, e.g. \"data:image/jpeg;base64,iVBORw0K......\"\n */\nexport const fileToDataUrl = (file: File): Promise<IFileWithData> =>\n new Promise((resolve, reject) => {\n const reader = new FileReader();\n\n reader.onload = () =>\n resolve({\n lastModified: file.lastModified,\n size: file.size,\n type: file.type,\n name: file.name,\n data: reader.result as string,\n });\n\n reader.onerror = reject;\n\n if (file) {\n reader.readAsDataURL(file);\n } else {\n reject(new Error('Invalid file'));\n }\n });\n\n/**\n * Trigger a download dialog to save a blob as a file on disk.\n */\nexport const downloadBlob = (blob: Blob, name = 'file.pdf') => {\n const blobUrl = URL.createObjectURL(blob);\n const link = document.createElement('a');\n\n link.href = blobUrl;\n link.download = name;\n document.body.appendChild(link);\n\n link.dispatchEvent(\n new MouseEvent('click', {\n bubbles: true,\n cancelable: true,\n view: window,\n }),\n );\n\n document.body.removeChild(link);\n};\n","import type {ICountry} from './Types';\n\nexport const Countries: ICountry[] = [\n {code: '+7 840', name: 'Abkhazia', value: '+7'},\n {code: '+93', name: 'Afghanistan', value: '+93'},\n {code: '+355', name: 'Albania', value: '+355'},\n {code: '+213', name: 'Algeria', value: '+213'},\n {code: '+1', name: 'American Samoa', value: '+1'},\n {code: '+376', name: 'Andorra', value: '+376'},\n {code: '+244', name: 'Angola', value: '+244'},\n {code: '+1', name: 'Anguilla', value: '+1'},\n {code: '+1', name: 'Antigua and Barbuda', value: '+1'},\n {code: '+54', name: 'Argentina', value: '+54'},\n {code: '+374', name: 'Armenia', value: '+374'},\n {code: '+297', name: 'Aruba', value: '+297'},\n {code: '+247', name: 'Ascension', value: '+247'},\n {code: '+61', name: 'Australia', value: '+61'},\n {code: '+672', name: 'Australian External Territories', value: '+672'},\n {code: '+43', name: 'Austria', value: '+43'},\n {code: '+994', name: 'Azerbaijan', value: '+994'},\n {code: '+1', name: 'Bahamas', value: '+1'},\n {code: '+973', name: 'Bahrain', value: '+973'},\n {code: '+880', name: 'Bangladesh', value: '+880'},\n {code: '+1', name: 'Barbados', value: '+1'},\n {code: '+1', name: 'Barbuda', value: '+1'},\n {code: '+375', name: 'Belarus', value: '+375'},\n {code: '+32', name: 'Belgium', value: '+32'},\n {code: '+501', name: 'Belize', value: '+501'},\n {code: '+229', name: 'Benin', value: '+229'},\n {code: '+1', name: 'Bermuda', value: '+1'},\n {code: '+975', name: 'Bhutan', value: '+975'},\n {code: '+591', name: 'Bolivia', value: '+591'},\n {code: '+387', name: 'Bosnia and Herzegovina', value: '+387'},\n {code: '+267', name: 'Botswana', value: '+267'},\n {code: '+55', name: 'Brazil', value: '+55'},\n {code: '+246', name: 'British Indian Ocean Territory', value: '+246'},\n {code: '+1', name: 'British Virgin Islands', value: '+1'},\n {code: '+673', name: 'Brunei', value: '+673'},\n {code: '+359', name: 'Bulgaria', value: '+359'},\n {code: '+226', name: 'Burkina Faso', value: '+226'},\n {code: '+257', name: 'Burundi', value: '+257'},\n {code: '+855', name: 'Cambodia', value: '+855'},\n {code: '+237', name: 'Cameroon', value: '+237'},\n {code: '+1', name: 'Canada', value: '+1'},\n {code: '+238', name: 'Cape Verde', value: '+238'},\n {code: '+1', name: 'Cayman Islands', value: '+1'},\n {code: '+236', name: 'Central African Republic', value: '+236'},\n {code: '+235', name: 'Chad', value: '+235'},\n {code: '+56', name: 'Chile', value: '+56'},\n {code: '+86', name: 'China', value: '+86'},\n {code: '+61', name: 'Christmas Island', value: '+61'},\n {code: '+61', name: 'Cocos-Keeling Islands', value: '+61'},\n {code: '+57', name: 'Colombia', value: '+57'},\n {code: '+269', name: 'Comoros', value: '+269'},\n {code: '+242', name: 'Congo', value: '+242'},\n {code: '+243', name: 'Congo, Dem. Rep. of (Zaire)', value: '+243'},\n {code: '+682', name: 'Cook Islands', value: '+682'},\n {code: '+506', name: 'Costa Rica', value: '+506'},\n {code: '+385', name: 'Croatia', value: '+385'},\n {code: '+53', name: 'Cuba', value: '+53'},\n {code: '+599', name: 'Curacao', value: '+599'},\n {code: '+537', name: 'Cyprus', value: '+537'},\n {code: '+420', name: 'Czech Republic', value: '+420'},\n {code: '+45', name: 'Denmark', value: '+45'},\n {code: '+246', name: 'Diego Garcia', value: '+246'},\n {code: '+253', name: 'Djibouti', value: '+253'},\n {code: '+1', name: 'Dominica', value: '+1'},\n {code: '+1', name: 'Dominican Republic', value: '+1'},\n {code: '+670', name: 'East Timor', value: '+670'},\n {code: '+56', name: 'Easter Island', value: '+56'},\n {code: '+593', name: 'Ecuador', value: '+593'},\n {code: '+20', name: 'Egypt', value: '+20'},\n {code: '+503', name: 'El Salvador', value: '+503'},\n {code: '+240', name: 'Equatorial Guinea', value: '+240'},\n {code: '+291', name: 'Eritrea', value: '+291'},\n {code: '+372', name: 'Estonia', value: '+372'},\n {code: '+251', name: 'Ethiopia', value: '+251'},\n {code: '+500', name: 'Falkland Islands', value: '+500'},\n {code: '+298', name: 'Faroe Islands', value: '+298'},\n {code: '+679', name: 'Fiji', value: '+679'},\n {code: '+358', name: 'Finland', value: '+358'},\n {code: '+33', name: 'France', value: '+33'},\n {code: '+596', name: 'Martinique', value: '+596'},\n {code: '+594', name: 'French Guiana', value: '+594'},\n {code: '+689', name: 'French Polynesia', value: '+689'},\n {code: '+241', name: 'Gabon', value: '+241'},\n {code: '+220', name: 'Gambia', value: '+220'},\n {code: '+995', name: 'Georgia', value: '+995'},\n {code: '+49', name: 'Germany', value: '+49'},\n {code: '+233', name: 'Ghana', value: '+233'},\n {code: '+350', name: 'Gibraltar', value: '+350'},\n {code: '+30', name: 'Greece', value: '+30'},\n {code: '+299', name: 'Greenland', value: '+299'},\n {code: '+1', name: 'Grenada', value: '+1'},\n {code: '+590', name: 'Guadeloupe', value: '+590'},\n {code: '+1', name: 'Guam', value: '+1'},\n {code: '+502', name: 'Guatemala', value: '+502'},\n {code: '+224', name: 'Guinea', value: '+224'},\n {code: '+245', name: 'Guinea-Bissau', value: '+245'},\n {code: '+595', name: 'Guyana', value: '+595'},\n {code: '+509', name: 'Haiti', value: '+509'},\n {code: '+504', name: 'Honduras', value: '+504'},\n {code: '+852', name: 'Hong Kong SAR China', value: '+852'},\n {code: '+36', name: 'Hungary', value: '+36'},\n {code: '+354', name: 'Iceland', value: '+354'},\n {code: '+91', name: 'India', value: '+91'},\n {code: '+62', name: 'Indonesia', value: '+62'},\n {code: '+98', name: 'Iran', value: '+98'},\n {code: '+964', name: 'Iraq', value: '+964'},\n {code: '+353', name: 'Ireland', value: '+353'},\n {code: '+972', name: 'Israel', value: '+972'},\n {code: '+39', name: 'Italy', value: '+39'},\n {code: '+225', name: 'Ivory Coast', value: '+225'},\n {code: '+1', name: 'Jamaica', value: '+1'},\n {code: '+81', name: 'Japan', value: '+81'},\n {code: '+962', name: 'Jordan', value: '+962'},\n {code: '+77', name: 'Kazakhstan', value: '+7'},\n {code: '+254', name: 'Kenya', value: '+254'},\n {code: '+686', name: 'Kiribati', value: '+686'},\n {code: '+965', name: 'Kuwait', value: '+965'},\n {code: '+996', name: 'Kyrgyzstan', value: '+996'},\n {code: '+856', name: 'Laos', value: '+856'},\n {code: '+371', name: 'Latvia', value: '+371'},\n {code: '+961', name: 'Lebanon', value: '+961'},\n {code: '+266', name: 'Lesotho', value: '+266'},\n {code: '+231', name: 'Liberia', value: '+231'},\n {code: '+218', name: 'Libya', value: '+218'},\n {code: '+423', name: 'Liechtenstein', value: '+423'},\n {code: '+370', name: 'Lithuania', value: '+370'},\n {code: '+352', name: 'Luxembourg', value: '+352'},\n {code: '+853', name: 'Macau SAR China', value: '+853'},\n {code: '+389', name: 'Macedonia', value: '+389'},\n {code: '+261', name: 'Madagascar', value: '+261'},\n {code: '+265', name: 'Malawi', value: '+265'},\n {code: '+60', name: 'Malaysia', value: '+60'},\n {code: '+960', name: 'Maldives', value: '+960'},\n {code: '+223', name: 'Mali', value: '+223'},\n {code: '+356', name: 'Malta', value: '+356'},\n {code: '+692', name: 'Marshall Islands', value: '+692'},\n {code: '+596', name: 'Martinique', value: '+596'},\n {code: '+222', name: 'Mauritania', value: '+222'},\n {code: '+230', name: 'Mauritius', value: '+230'},\n {code: '+262', name: 'Mayotte or Réunion', value: '+262'},\n {code: '+52', name: 'Mexico', value: '+52'},\n {code: '+691', name: 'Micronesia', value: '+691'},\n {code: '+1', name: 'Midway Island', value: '+1'},\n {code: '+373', name: 'Moldova', value: '+373'},\n {code: '+377', name: 'Monaco', value: '+377'},\n {code: '+976', name: 'Mongolia', value: '+976'},\n {code: '+382', name: 'Montenegro', value: '+382'},\n {code: '+1', name: 'Montserrat', value: '+1'},\n {code: '+212', name: 'Morocco', value: '+212'},\n {code: '+95', name: 'Myanmar', value: '+95'},\n {code: '+264', name: 'Namibia', value: '+264'},\n {code: '+674', name: 'Nauru', value: '+674'},\n {code: '+977', name: 'Nepal', value: '+977'},\n {code: '+31', name: 'Netherlands', value: '+31'},\n {code: '+599', name: 'Netherlands Antilles', value: '+599'},\n {code: '+1', name: 'Nevis', value: '+1'},\n {code: '+687', name: 'New Caledonia', value: '+687'},\n {code: '+64', name: 'New Zealand', value: '+64'},\n {code: '+505', name: 'Nicaragua', value: '+505'},\n {code: '+227', name: 'Niger', value: '+227'},\n {code: '+234', name: 'Nigeria', value: '+234'},\n {code: '+683', name: 'Niue', value: '+683'},\n {code: '+672', name: 'Norfolk Island', value: '+672'},\n {code: '+850', name: 'North Korea', value: '+850'},\n {code: '+1', name: 'Northern Mariana Islands', value: '+1'},\n {code: '+47', name: 'Norway', value: '+47'},\n {code: '+968', name: 'Oman', value: '+968'},\n {code: '+92', name: 'Pakistan', value: '+92'},\n {code: '+680', name: 'Palau', value: '+680'},\n {code: '+970', name: 'Palestinian Territory', value: '+970'},\n {code: '+507', name: 'Panama', value: '+507'},\n {code: '+675', name: 'Papua New Guinea', value: '+675'},\n {code: '+595', name: 'Paraguay', value: '+595'},\n {code: '+51', name: 'Peru', value: '+51'},\n {code: '+63', name: 'Philippines', value: '+63'},\n {code: '+48', name: 'Poland', value: '+48'},\n {code: '+351', name: 'Portugal', value: '+351'},\n {code: '+1', name: 'Puerto Rico', value: '+1'},\n {code: '+974', name: 'Qatar', value: '+974'},\n {code: '+40', name: 'Romania', value: '+40'},\n {code: '+7', name: 'Russia', value: '+7'},\n {code: '+250', name: 'Rwanda', value: '+250'},\n {code: '508', name: 'Saint Pierre and Miquelon', value: '508'},\n {code: '+685', name: 'Samoa', value: '+685'},\n {code: '+378', name: 'San Marino', value: '+378'},\n {code: '+966', name: 'Saudi Arabia', value: '+966'},\n {code: '+221', name: 'Senegal', value: '+221'},\n {code: '+381', name: 'Serbia', value: '+381'},\n {code: '+248', name: 'Seychelles', value: '+248'},\n {code: '+232', name: 'Sierra Leone', value: '+232'},\n {code: '+65', name: 'Singapore', value: '+65'},\n {code: '+421', name: 'Slovakia', value: '+421'},\n {code: '+386', name: 'Slovenia', value: '+386'},\n {code: '+677', name: 'Solomon Islands', value: '+677'},\n {code: '+27', name: 'South Africa', value: '+27'},\n {code: '+500', name: 'South Georgia and the South Sandwich Islands', value: '+500'},\n {code: '+82', name: 'South Korea', value: '+82'},\n {code: '+34', name: 'Spain', value: '+34'},\n {code: '+94', name: 'Sri Lanka', value: '+94'},\n {code: '+249', name: 'Sudan', value: '+249'},\n {code: '+597', name: 'Suriname', value: '+597'},\n {code: '+268', name: 'Swaziland', value: '+268'},\n {code: '+46', name: 'Sweden', value: '+46'},\n {code: '+41', name: 'Switzerland', value: '+41'},\n {code: '+963', name: 'Syria', value: '+963'},\n {code: '+886', name: 'Taiwan', value: '+886'},\n {code: '+992', name: 'Tajikistan', value: '+992'},\n {code: '+255', name: 'Tanzania', value: '+255'},\n {code: '+66', name: 'Thailand', value: '+66'},\n {code: '+670', name: 'Timor Leste', value: '+670'},\n {code: '+228', name: 'Togo', value: '+228'},\n {code: '+690', name: 'Tokelau', value: '+690'},\n {code: '+676', name: 'Tonga', value: '+676'},\n {code: '+1', name: 'Trinidad and Tobago', value: '+1'},\n {code: '+216', name: 'Tunisia', value: '+216'},\n {code: '+90', name: 'Turkey', value: '+90'},\n {code: '+993', name: 'Turkmenistan', value: '+993'},\n {code: '+1', name: 'Turks and Caicos Islands', value: '+1'},\n {code: '+688', name: 'Tuvalu', value: '+688'},\n {code: '+1', name: 'U.S. Virgin Islands', value: '+1'},\n {code: '+256', name: 'Uganda', value: '+256'},\n {code: '+380', name: 'Ukraine', value: '+380'},\n {code: '+971', name: 'United Arab Emirates', value: '+971'},\n {code: '+44', name: 'United Kingdom', value: '+44'},\n {code: '+1', name: 'United States', value: '+1'},\n {code: '+598', name: 'Uruguay', value: '+598'},\n {code: '+998', name: 'Uzbekistan', value: '+998'},\n {code: '+678', name: 'Vanuatu', value: '+678'},\n {code: '+58', name: 'Venezuela', value: '+58'},\n {code: '+84', name: 'Vietnam', value: '+84'},\n {code: '+1', name: 'Wake Island', value: '+1'},\n {code: '+681', name: 'Wallis and Futuna', value: '+681'},\n {code: '+967', name: 'Yemen', value: '+967'},\n {code: '+260', name: 'Zambia', value: '+260'},\n {code: '+255', name: 'Zanzibar', value: '+255'},\n {code: '+263', name: 'Zimbabwe', value: '+263'},\n];\n\nexport function getCountryByCode(code: string): ICountry | null {\n const found = Countries.find((country) => country.code === code);\n if (found) return found;\n\n if (isFrenchGuiana(code)) {\n return {code: '+594', name: 'French Guiana', value: '+594'};\n } else if (isGuadeloupe(code)) {\n return {code: '+590', name: 'Guadeloupe', value: '+590'};\n } else if (isMartinique(code)) {\n return {code: '+596', name: 'Martinique', value: '+596'};\n } else if (isMayotte(code)) {\n return {code: '+262', name: 'Mayotte or Réunion', value: '+262'};\n }\n\n return null;\n}\n\nexport function isFrenchGuiana(code: string) {\n return '+594' === code.substring(0, 4);\n}\n\nexport function isGuadeloupe(code: string) {\n return '+590' === code.substring(0, 4);\n}\n\nexport function isMartinique(code: string) {\n return '+596' === code.substring(0, 4);\n}\n\nexport function isMayotte(code: string) {\n return '+262' === code.substring(0, 4);\n}\n\nexport function getPlusOneCountry(code: string) {\n let info: ICountry | null = null;\n switch (code.substring(0, 5)) {\n case '+1684':\n info = {code: '+1', name: 'American Samoa', value: '+1'};\n break;\n case '+1264':\n info = {code: '+1', name: 'Anguilla', value: '+1'};\n break;\n case '+1268':\n info = {code: '+1', name: 'Antigua and Barbuda', value: '+1'};\n break;\n case '+1242':\n info = {code: '+1', name: 'Bahamas', value: '+1'};\n break;\n case '+1246':\n info = {code: '+1', name: 'Barbados', value: '+1'};\n break;\n case '+1441':\n info = {code: '+1', name: 'Bermuda', value: '+1'};\n break;\n case '+1284':\n info = {code: '+1', name: 'British Virgin Islands', value: '+1'};\n break;\n case '+1':\n info = {code: '+1', name: '', value: '+1'};\n break;\n default:\n break;\n }\n return info;\n}\n\nexport function isCanada(code: string) {\n const canadianAreaCodes = [\n '403',\n '587',\n '780',\n '825',\n '604',\n '250',\n '778',\n '236',\n '204',\n '431',\n '506',\n '709',\n '867',\n '782',\n '902',\n '867',\n '548',\n '705',\n '365',\n '613',\n '807',\n '226',\n '289',\n '437',\n '519',\n '647',\n '905',\n '249',\n '343',\n '416',\n '902',\n '782',\n '450',\n '418',\n '579',\n '873',\n '367',\n '514',\n '581',\n '819',\n '438',\n '639',\n '306',\n '867',\n ];\n const areaCode = code.substring(0, 5);\n return canadianAreaCodes.findIndex((x) => '+1' + x === areaCode) > -1;\n}\n\nexport function isAmericanSamoa(code: string) {\n return code.substring(0, 5) === '+1684';\n}\n\nexport function isDominicanRepublic(code: string) {\n return '+1809' === code.substring(0, 5) || '+1829' === code.substring(0, 5) || '+1849' === code.substring(0, 5);\n}\n\nexport function isPuertoRico(code: string) {\n return code.substring(0, 5) === '+' || code.substring(0, 5) === '+';\n}\n\n// need to finish\nexport function getMatchingCountry(code: string, substrings: number) {\n const toMatch = code.substring(0, substrings);\n return Countries.filter((c) => c.code === toMatch).length;\n}\n\n// const e164Regex = new RegExp(/\\+[1-9]\\d{6,14}/g);\n\n// export function simpleE164Validator(code: string) {\n// return (code !== null && code.length < 16 && code.length > 6 && e164Regex.test(code)) || code === '' || code === null;\n// }\n","/**\n * Capitalize the first letter of a string.\n */\nexport const capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);\n\n/**\n * Convert a phone-number-like string to E164 format.\n * @see https://46elks.com/kb/e164\n */\nexport const convertToE164 = (input: string) => {\n // \"(212) 555-1212\" => +12125551212\n // \"+46766861004\" => \"+46766861004\"\n // \"212-555-1212\" => +12125551212\n // \"212.555.1212\" => +12125551212\n // \"212 555 1212\" => +12125551212\n\n let temp = (input || '').trim();\n // If we are already prefixed, assume the user did it deliberately and attempt to use what they entered. We also short-circuit blanks.\n if (!temp || temp.startsWith('+')) {\n return temp;\n }\n\n // Remove any spaces, parenthesis or other punctuation.\n temp = temp.replace(/[^0-9]/g, '');\n\n // If the number begins with a zero, remove the leading zero. Do not combine this with the previous step because it needs to be removed\n // whether it's the actual first character e.g. `0(5)` or just the first digit e.g. `(05`.\n temp = temp.replace(/^0/g, '');\n\n // Prepend the country code and +. We're assuming US in this case given the target demographic. Users in other countries would/should be\n // already entering a prefix so they'd shortcut out of this routine via the + prefix check.\n return `+1${temp}`;\n};\n","import type {IProfile} from '../Models';\nimport {capitalize} from './Strings';\n\n/**\n * Create an array containing a sequence of integers, e.g. [START, START+1, START+2, ...] This is frequently useful\n * in rendering operations when there is no source array to .map() across.\n */\nexport const integerSequence = (start: number, count: number): number[] =>\n Array(count)\n .fill(1)\n .map((_, index) => index + start);\n\n/**\n * Format a profile's full name\n */\nexport const formatFullName = (profile?: IProfile) =>\n profile ? `${capitalize(profile.first_name)} ${capitalize(profile.last_name)}` : 'Invalid User';\n\n/**\n * Format a profile's initials\n */\nexport const formatInitials = (profile?: IProfile) =>\n profile ? `${capitalize(profile.first_name).charAt(0)} ${capitalize(profile.last_name).charAt(0)}` : '--';\n\n/**\n * Generate suggested initials for a full name, e.g. \"John Doe\" will yield \"JD\".\n */\nexport const fullNameToInitials = (name: string) =>\n name\n .split(' ')\n .map((word) => word[0])\n .join('');\n","/* tslint:disable:no-bitwise */\n\nimport type {TSession} from '../Sessions';\n\nconst b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n// Regular expression to check formal correctness of base64 encoded strings\nconst b64re = /^(?:[A-Za-z\\d+\\/]{4})*?(?:[A-Za-z\\d+\\/]{2}(?:==)?|[A-Za-z\\d+\\/]{3}=?)?$/;\n\n/**\n * Simplified, Node/Browser-safe alternative to atob() for base64 decoding.\n * Modified from https://github.com/MaxArt2501/base64-js/blob/master/base64.js\n */\nexport const AtoB = (str: string) => {\n // atob can work with strings with whitespaces, even inside the encoded part,\n // but only \\t, \\n, \\f, \\r and ' ', which can be stripped.\n str = String(str).replace(/[\\t\\n\\f\\r ]+/g, '');\n if (!b64re.test(str)) throw new TypeError(\"Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.\");\n\n // Adding the padding if missing, for semplicity\n str += '=='.slice(2 - (str.length & 3));\n let bitmap;\n let result = '';\n let r1;\n let r2;\n let i = 0;\n\n for (; i < str.length; ) {\n bitmap =\n (b64.indexOf(str.charAt(i++)) << 18) |\n (b64.indexOf(str.charAt(i++)) << 12) |\n ((r1 = b64.indexOf(str.charAt(i++))) << 6) |\n (r2 = b64.indexOf(str.charAt(i++)));\n\n result +=\n r1 === 64\n ? String.fromCharCode((bitmap >> 16) & 255)\n : r2 === 64\n ? String.fromCharCode((bitmap >> 16) & 255, (bitmap >> 8) & 255)\n : String.fromCharCode((bitmap >> 16) & 255, (bitmap >> 8) & 255, bitmap & 255);\n }\n return result;\n};\n\n/**\n * Decode the body of a JWT. This helper may allow front-end applications to avoid a dependency on `jsonwebtoken` in\n * many cases. Note that this should only be used for true JWTs. Opaque tokens will cause this to throw.\n */\nexport const decodeJWTBody = (token: string) => JSON.parse(AtoB((token || '').split('.')[1] || ''));\n\n/**\n * Decode the body of an Verdocs access token. Note that raw tokens contain namespaced fields, e.g.\n * `https://verdocs.com/profile_id`. To make these tokens easier to use in front-end code, this name-spacing\n * will be removed. Note that user and signing sessions have different access token formats. The calling\n * application should distinguish between the two based on the context of the authenticated session, or by\n * the presence of the `document_id` field, which will only be present for signing sessions.\n */\nexport const decodeAccessTokenBody = (token: string): TSession => {\n let decoded: any;\n try {\n decoded = decodeJWTBody(token) as TSession;\n if (decoded === null) {\n return null;\n }\n } catch (e) {\n return null;\n }\n\n Object.keys(decoded).forEach((key: any) => {\n if (typeof key === 'string' && key.startsWith('https://verdocs.com/')) {\n decoded[key.replace('https://verdocs.com/', '')] = decoded[key];\n delete decoded[key];\n }\n });\n\n return decoded;\n};\n","// This file provides a polyfill for managing globals in both NodeJS and browser environments. This is\n// an anti-pattern we'd hoped to avoid, but we have several projects dependending on one common library\n// (this js-sdk) and we want that library to provide a common endpoint to all callers (so authentication\n// tokens only need to be tracked in one place). The trouble is, one of those libraries is based on\n// StencilJS and is compiling its modules into Web Components. Because of how module resolution works,\n// when those Components load js-sdk they get a separate instance. Without messy options like having to\n// pass raw data from the caller to each Component, or pass around references to a common Endpoint, they\n// have no way to access authenticated sessions unless we make the Endpoint a true global.\n//\n// @credit https://github.com/medikoo/es5-ext/blob/master/global.js\n// @credit https://mathiasbynens.be/notes/globalthis\n\nvar naiveFallback = function () {\n if (typeof self === 'object' && self) return self;\n if (typeof window === 'object' && window) return window;\n throw new Error('Unable to resolve global `this`');\n};\n\nmodule.exports = (function () {\n if (this) return this;\n\n // Unexpected strict mode (may happen if e.g. bundled into ESM module)\n\n // Fallback to standard globalThis if available\n if (typeof globalThis === 'object' && globalThis) return globalThis;\n\n // Thanks @mathiasbynens -> https://mathiasbynens.be/notes/globalthis\n // In all ES5+ engines global object inherits from Object.prototype\n // (if you approached one that doesn't please report)\n try {\n Object.defineProperty(Object.prototype, '__global__', {\n get: function () {\n return this;\n },\n configurable: true,\n });\n } catch (error) {\n // Unfortunate case of updates to Object.prototype being restricted\n // via preventExtensions, seal or freeze\n return naiveFallback();\n }\n try {\n // Safari case (window.__global__ works, but __global__ does not)\n if (!__global__) return naiveFallback();\n return __global__;\n } finally {\n delete Object.prototype.__global__;\n }\n})();\n","import axios, {AxiosInstance} from 'axios';\nimport {TSession, TSessionType} from './Sessions';\nimport {decodeAccessTokenBody} from './Utils';\nimport globalThis from './Utils/globalThis';\n\n// @credit https://derickbailey.com/2016/03/09/creating-a-true-singleton-in-node-js-with-es6-symbols/\n// Also see globalThis for comments about why we're doing this in the first place.\nconst ENDPOINT_KEY = Symbol.for('vƒbaseerdocs-default-endpoint');\n\nconst requestLogger = (r: any) => {\n // tslint:disable-next-line\n console.debug(`[JS-SDK] ${r.method.toUpperCase()} ${r.baseURL}${r.url}`, r.data ? JSON.stringify(r.data) : '');\n return r;\n};\n\nexport type TEnvironment = 'verdocs' | 'verdocs-stage';\n\nexport type TSessionChangedListener = (endpoint: VerdocsEndpoint, session: TSession) => void;\n\nexport interface VerdocsEndpointOptions {\n baseURL?: string;\n baseURLv2?: string;\n timeout?: number;\n environment?: TEnvironment;\n sessionType?: TSessionType;\n clientID?: string;\n}\n\n/**\n * VerdocsEndpoint is a class wrapper for a specific connection and authorization context for calling the Verdocs APIs.\n * Endpoints can be used for isolated session tasks.\n *\n * For instance, ephemeral signing sessions may be created independently of a caller's status as an authenticated user.\n * In that case, an Endpoint can be created and authenticated, used for calls related to signing operations, then\n * discarded once signing is complete.\n *\n * Note that endpoint configuration functions return the instance, so they can be chained, e.g.\n *\n * ```typescript\n * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';\n *\n * const endpoint = new VerdocsEndpoint();\n * endpoint\n * .setSessionType('signing')\n * .logRequests(true)\n * .setClientID('1234)\n * .setTimeout(30000);\n * ```\n */\nexport class VerdocsEndpoint {\n private environment = 'verdocs' as TEnvironment;\n private sessionType = 'user' as TSessionType;\n private baseURL = (window.location.origin === 'https://beta.verdocs.com' || window.location.origin === 'https://stage.verdocs.com'\n ? 'https://stage-api.verdocs.com'\n : 'https://api.verdocs.com') as string;\n private baseURLv2 = (window.location.origin === 'https://beta.verdocs.com' || window.location.origin === 'https://stage.verdocs.com'\n ? 'https://stage-api.verdocs.com/v2'\n : 'https://api.verdocs.com/v2') as string;\n private clientID = 'not-set' as string;\n private timeout = 60000 as number;\n private token = null as string | null;\n private nextListenerId = 0;\n private sessionListeners = new Map<symbol, TSessionChangedListener>();\n private requestLoggerId: number | null = null;\n\n /**\n * The current user session, or null if not authenticated. May be either a User or Signing session. If set, the\n * presence of the `document_id` field can be used to differentiate the types. Only signing sessions are associated\n * with Envelopes.\n */\n public session = null as TSession;\n\n public api: AxiosInstance;\n\n /**\n * Create a new VerdocsEndpoint to call Verdocs platform services.\n *\n * ```typescript\n * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';\n * const endpoint = new VerdocsEndpoint();\n * ```\n */\n constructor(options?: VerdocsEndpointOptions) {\n this.baseURL = options?.baseURL || this.baseURL;\n this.timeout = options?.timeout || this.timeout;\n this.environment = options?.environment || this.environment;\n this.sessionType = options?.sessionType || this.sessionType;\n this.clientID = options?.clientID || this.clientID;\n this.api = axios.create({baseURL: this.baseURL, timeout: this.timeout});\n }\n\n public setDefault() {\n globalThis[ENDPOINT_KEY] = this;\n }\n\n public static getDefault(): VerdocsEndpoint {\n if (!globalThis[ENDPOINT_KEY]) {\n globalThis[ENDPOINT_KEY] = new VerdocsEndpoint();\n window.console.debug('[JS_SDK] Created default endpoint', globalThis[ENDPOINT_KEY].baseURL);\n }\n\n return globalThis[ENDPOINT_KEY];\n }\n\n /**\n * Get the current environment.\n */\n public getEnvironment() {\n return this.environment;\n }\n\n /**\n * Get the current session type.\n */\n public getSessionType() {\n return this.sessionType;\n }\n\n /**\n * Get the current base URL. This should rarely be anything other than 'https://api.verdocs.com'.\n */\n public getBaseURL() {\n return this.baseURL;\n }\n\n /**\n * Get the current base URL for the v2 APIs.\n * This should rarely be anything other than 'https://api-v2.verdocs.com'.\n */\n public getBaseURLv2() {\n return this.baseURLv2;\n }\n\n /**\n * Get the current client ID, if set.\n */\n public getClientID() {\n return this.clientID;\n }\n\n /**\n * Get the current timeout.\n */\n public getTimeout() {\n return this.timeout;\n }\n\n /**\n * Get the current session, if any.\n */\n public getSession() {\n return this.session;\n }\n\n /**\n * Set the operating environment. This should rarely be anything other than 'verdocs'.\n *\n * ```typescript\n * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';\n *\n * const endpoint = new VerdocsEndpoint();\n * endpoint.setEnvironment('verdocs-stage');\n * ```\n */\n public setEnvironment(environment: TEnvironment): VerdocsEndpoint {\n this.environment = environment;\n return this;\n }\n\n /**\n * Set the session type. In general this should be done immediately when the endpoint is created. Changing the\n * session type may be done at any time, but may have unintended consequences if the endpoint is shared between\n * multiple widgets.\n *\n * Changing the session type will clear/reload the action session. This may trigger notifications to session state\n * observers. Apps that use observers to trigger UI updates such as logging the user out should be prepared to\n * handle this event.\n *\n * ```typescript\n * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';\n *\n * const endpoint = new VerdocsEndpoint();\n * endpoint.setEnvironment('verdocs-stage');\n * ```\n */\n public setSessionType(sessionType: TSessionType): VerdocsEndpoint {\n this.sessionType = sessionType;\n return this;\n }\n\n /**\n * Set the base URL for API calls. Should be called only upon direction from Verdocs Customer Solutions Engineering.\n *\n * ```typescript\n * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';\n *\n * const endpoint = new VerdocsEndpoint();\n * endpoint.setBaseURL('https://api.verdocs.com');\n * ```\n */\n public setBaseURL(url: string): VerdocsEndpoint {\n this.baseURL = url;\n this.api.defaults.baseURL = url;\n return this;\n }\n\n /**\n * Set the base URL for API calls. Should be called only upon direction from Verdocs Customer Solutions Engineering.\n *\n * ```typescript\n * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';\n *\n * const endpoint = new VerdocsEndpoint();\n * endpoint.setBaseURL('https://api.verdocs.com');\n * ```\n */\n public setBaseURLv2(url: string): VerdocsEndpoint {\n this.baseURLv2 = url;\n // NOTE: We do not set this on the Axios instance because v1 is still the standard.\n return this;\n }\n\n /**\n * Set the Client ID for Verdocs API calls.\n *\n * ```typescript\n * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';\n *\n * const endpoint = new VerdocsEndpoint();\n * endpoint.setClientID('1234);\n * ```\n */\n setClientID(clientID: string): VerdocsEndpoint {\n this.clientID = clientID;\n this.api.defaults.headers.common['X-Client-ID'] = clientID;\n return this;\n }\n\n /**\n * Set the timeout for API calls in milliseconds. 5000-20000ms is recommended for most purposes. 15000ms is the default.\n * Note that some calls may involve rendering operations that require some time to complete, so very short timeouts\n * are not recommended.\n *\n * ```typescript\n * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';\n *\n * const endpoint = new VerdocsEndpoint();\n * endpoint.setTimeout(3000);\n * ```\n */\n public setTimeout(timeout: number): VerdocsEndpoint {\n this.timeout = timeout;\n this.api.defaults.timeout = timeout;\n return this;\n }\n\n /**\n * Enable or disable request logging. This may expose sensitive data in the console log, so it should only be used for debugging.\n *\n * ```typescript\n * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';\n *\n * const endpoint = new VerdocsEndpoint();\n * endpoint.logRequests(true);\n * ```\n */\n public logRequests(enable: boolean): VerdocsEndpoint {\n if (enable && this.requestLoggerId === null) {\n this.requestLoggerId = this.api.interceptors.request.use(requestLogger);\n } else if (!enable && this.requestLoggerId !== null) {\n this.api.interceptors.request.eject(this.requestLoggerId);\n }\n\n return this;\n }\n\n /**\n * Set the authorization token that will be used for Verdocs API calls. This will also set the session metadata\n * and notify any listeners of the new data.\n *\n * If this Endpoint will be used for non-default purposes (e.g. signing, or in an alternate environment) those\n * settings should be made before calling this. Sessions are persisted to localStorage, and the environment and\n * type become part of the storage key.\n *\n * ```typescript\n * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';\n *\n * const endpoint = new VerdocsEndpoint();\n * endpoint.setToken(accessToken);\n * ```\n */\n public setToken(token: string | null): VerdocsEndpoint {\n if (!token) {\n return this.clearSession();\n }\n\n const session = decodeAccessTokenBody(token);\n if (session === null || (session.exp && session.exp * 1000 < new Date().getTime())) {\n window.console.warn('[JS_SDK] Ignoring attempt to use expired session token');\n return this.clearSession();\n }\n\n this.token = token;\n this.session = session;\n if (this.sessionType === 'user') {\n this.api.defaults.headers.common.Authorization = `Bearer ${token}`;\n } else {\n this.api.defaults.headers.common.signer = `Bearer ${token}`;\n }\n\n localStorage.setItem(this.sessionStorageKey(), token);\n\n this.notifySessionListeners();\n return this;\n }\n\n /**\n * Retrieves the current session token, if any. Tokens should rarely be used for direct actions, but this is\n * required by the `<VerdocsView>` and other components to authorize requests to raw PDF files.\n */\n public getToken() {\n return this.token;\n }\n\n private sessionStorageKey() {\n return `verdocs-session-${this.getSessionType()}-${this.getEnvironment()}`;\n }\n\n /**\n * Clear the active session.\n */\n public clearSession() {\n localStorage.removeItem(this.sessionStorageKey());\n delete this.api.defaults.headers.common.Authorization;\n delete this.api.defaults.headers.common.signer;\n\n this.session = null;\n this.token = null;\n\n this.notifySessionListeners();\n\n return this;\n }\n\n /**\n * Clear the active signing session.\n */\n public clearSignerSession() {\n localStorage.removeItem(this.sessionStorageKey());\n delete this.api.defaults.headers.common.Authorization;\n\n this.session = null;\n this.token = null;\n\n this.notifySessionListeners();\n\n return this;\n }\n\n private notifySessionListeners() {\n this.sessionListeners.forEach((listener: TSessionChangedListener) => {\n try {\n listener(this, this.session);\n } catch (e) {\n // NOOP\n }\n });\n }\n\n /**\n * Subscribe to session state change events.\n */\n public onSessionChanged(listener: TSessionChangedListener) {\n // There's no value in randomizing this, a simple counter is fine\n this.nextListenerId++;\n const listenerSymbol = Symbol.for('' + this.nextListenerId);\n this.sessionListeners.set(listenerSymbol, listener);\n\n return () => {\n this.sessionListeners.delete(listenerSymbol);\n };\n }\n\n /**\n * Load a persisted session from localStorage. Typically called once after the endpoint is configured when the app\n * or component starts.\n */\n public loadSession() {\n const token = localStorage.getItem(this.sessionStorageKey());\n if (!token) {\n return this.clearSession();\n }\n\n return this.setToken(token);\n }\n}\n","import {IEnvelope, IEnvelopeDocument, IEnvelopeFieldSettings, IRecipient} from '../Models';\nimport {ICreateEnvelopeRequest, IEnvelopesSearchResult, IEnvelopesSummary} from './Types';\nimport {TEnvelopeStatus, TEnvelopeUpdateResult, TRecipientStatus} from '../BaseTypes';\nimport {ISigningSession, ISigningSessionRequest} from '../Sessions';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {decodeAccessTokenBody} from '../Utils';\n\n/**\n * Create an envelope\n *\n * ```typescript\n * import {Envelopes, ICreateEnvelopeRole, ICreateEnvelopeRequest} from '@verdocs/js-sdk/Envelopes';\n *\n * const role1: ICreateEnvelopeRole = {\n * type: 'signer',\n * name: 'Seller',\n * full_name: 'Paige Turner',\n * email: 'paige.turner@nomail.com',\n * phone: '',\n * sequence: 1,\n * delegator: false,\n * message: '',\n * };\n *\n * const role2: ICreateEnvelopeRole = {\n * type: 'signer',\n * name: 'Buyer',\n * full_name: 'Will Power',\n * email: 'will.power@nomail.com',\n * phone: '',\n * sequence: 2,\n * delegator: false,\n * message: '',\n * };\n *\n * const request: ICreateEnvelopeRequest = {template_id: 'd2338742-f3a1-465b-8592-806587413cc1', name: 'Bill of Sale', roles: [role1, role2]};\n * const {id, recipients} = await Envelopes.createEnvelope(VerdocsEndpoint.getDefault(), request);\n * ```\n */\nexport const createEnvelope = async (endpoint: VerdocsEndpoint, request: ICreateEnvelopeRequest) =>\n endpoint.api //\n .post<IEnvelope>('/envelopes', request)\n .then((r) => r.data);\n\n/**\n * Get a summary of currently active envelopes.\n *\n * ```typescript\n * import {Envelopes} from '@verdocs/js-sdk/Envelopes';\n *\n * const {action_required, completed, waiting_on_others} = await Envelopes.getSummary(VerdocsEndpoint.getDefault());\n * ```\n */\nexport const getEnvelopesSummary = async (endpoint: VerdocsEndpoint, page: number) =>\n endpoint.api //\n .post<IEnvelopesSummary>('/envelopes/summary', {page})\n .then((r) => r.data);\n\nexport interface IEnvelopeSearchParams {\n /** The envelope must have been created via the specified template ID. */\n template_id?: string;\n /** The envelope must match one of the specified statuses. */\n envelope_status?: TEnvelopeStatus[];\n /** At least one of the recipients must match one of the specified statuses. */\n recipient_status?: TRecipientStatus[];\n /** The envelope's name (inherited from the template) must match the specified string. */\n envelope_name?: string;\n /** At least one of the envelope's recipients must match the specified name. */\n recipient_name?: string;\n /** At least one of the envelope's recipients must match the specified email address. */\n recipient_email?: string;\n /** Match against envelope_name, recipient_name, or recipient_email all at once. */\n name?: string;\n /** At least one of the envelope's recipients must match the specified ID. */\n recipient_id?: string;\n /** The date-range in which the envelope was created. Values should be specified in ISO8601 \"UTC\" format. */\n created_at?: {\n start_time: string;\n end_time: string;\n };\n /**\n * The date-range in which the envelope was last updated. Values should be specified in ISO8601 \"UTC\" format.\n * Note that any operations that alter the envelope are considered \"updates\", including status changes (cancellation),\n * recipient actions (opening/signing), etc.\n */\n updated_at?: {\n start_time: string;\n end_time: string;\n };\n /** The date-range in which the envelope was canceled. Values should be specified in ISO8601 \"UTC\" format. */\n canceled_at?: {\n start_time: string;\n end_time: string;\n };\n /** Perform a \"contains\" search where any of the attached documents' fields contains the specified value. */\n text_field_value?: string;\n /** Set to true to retrieve only summary records (IEnvelopeSummary). */\n summary?: boolean;\n /** Set to true to retrieve only those envelopes owned by the caller. */\n is_owner?: boolean;\n /** Set to true to retrieve only those envelopes in which the caller is one of the recipients. */\n is_recipient?: boolean;\n /** Whether the recipient has \"claimed\" the envelope. */\n recipient_claimed?: boolean;\n /** The maximum number of records to return. Should be used in place of `row`. */\n limit?: number;\n /** The page number to return. Page numbers are 0-based. */\n page?: number;\n /** The field to sort the results by. */\n sort_by?: 'created_at' | 'updated_at' | 'envelope_name' | 'canceled_at' | 'envelope_status';\n /** Whether to sort in ascending (default) or descending order. */\n ascending?: boolean;\n}\n\n/**\n * Search for envelopes matching various criteria.\n *\n * ```typescript\n * import {Envelopes} from '@verdocs/js-sdk/Envelopes';\n *\n * const {result, page, total} = await Envelopes.search(VerdocsEndpoint.getDefault(), { ... });\n * ```\n */\nexport const searchEnvelopes = async (endpoint: VerdocsEndpoint, params: IEnvelopeSearchParams) =>\n endpoint.api //\n .post<IEnvelopesSearchResult>('/envelopes/search', params)\n .then((r) => r.data);\n\nexport interface ISigningSessionResult {\n recipient: IRecipient;\n session: ISigningSession;\n signerToken: string;\n}\n\n/**\n * Get a signing session for an Envelope.\n */\nexport const getSigningSession = async (endpoint: VerdocsEndpoint, params: ISigningSessionRequest) => {\n window.console.log('[JS_SDK] getSigningSession', params, endpoint.api);\n return endpoint.api //\n .get<IRecipient>(`/envelopes/${params.envelopeId}/recipients/${encodeURIComponent(params.roleId)}/invitation/${params.inviteCode}`)\n .then((r) => {\n // Avoiding a jsonwebtoken dependency here - we don't actually need the whole library\n const signerToken = r.headers?.signer_token || '';\n const session = decodeAccessTokenBody(signerToken) as ISigningSession;\n\n endpoint.setToken(signerToken);\n\n return {recipient: r.data, session, signerToken} as ISigningSessionResult;\n });\n};\n\n/**\n * Get the list of recipients for an Envelope.\n */\nexport const getEnvelopeRecipients = async (endpoint: VerdocsEndpoint, envelopeId: string) =>\n endpoint.api //\n .get<IRecipient[]>(`/envelopes/${envelopeId}/recipients`)\n .then((r) => r.data);\n\n/**\n * Get all metadata for an Envelope.\n */\nexport const getEnvelope = async (endpoint: VerdocsEndpoint, envelopeId: string) =>\n endpoint.api //\n .get<IEnvelope>(`/envelopes/${envelopeId}`)\n .then((r) => {\n const envelope = r.data;\n // Post-process the envelope to upgrade to new data fields\n envelope.documents?.forEach((document) => {\n if (!document.order) {\n document.order = 0;\n }\n\n if (document.page_numbers) {\n document.pages = document.page_numbers;\n }\n });\n\n return envelope;\n });\n\n\n/**\n * Get an Envelope Document\n */\nexport const getEnvelopeDocument = async (endpoint: VerdocsEndpoint, envelopeId: string, documentId: string) =>\n endpoint.api //\n .get<IEnvelopeDocument>(`/envelopes/${envelopeId}/envelope_documents/${documentId}`)\n .then((r) => r.data);\n\n/**\n * Get a pre-signed download link for an Envelope Document. This link expires quickly, so it should\n * be accessed immediately and never shared. Content-Disposition will be set to \"download\".\n */\nexport const getDocumentDownloadLink = async (endpoint: VerdocsEndpoint, envelopeId: string, documentId: string) =>\n endpoint.api //\n .get<string>(`/envelopes/${envelopeId}/envelope_documents/${documentId}?download=true`)\n .then((r) => r.data);\n\n/**\n * Get a pre-signed preview link for an Envelope Document. This link expires quickly, so it should\n * be accessed immediately and never shared. Content-Disposition will be set to \"inline\".\n */\nexport const getDocumentPreviewLink = async (endpoint: VerdocsEndpoint, envelopeId: string, documentId: string) =>\n endpoint.api //\n .get<string>(`/envelopes/${envelopeId}/envelope_documents/${documentId}?preview=true`)\n .then((r) => r.data);\n\n/**\n * Cancel an Envelope.\n */\nexport const cancelEnvelope = async (endpoint: VerdocsEndpoint, envelopeId: string) =>\n endpoint.api //\n .put<TEnvelopeUpdateResult>(`/envelopes/${envelopeId}`, {action: 'cancel'})\n .then((r) => r.data);\n\n/**\n * Get (binary download) a file attached to an Envelope. It is important to use this method\n * rather than a direct A HREF or similar link to set the authorization headers for the\n * request.\n */\nexport const getEnvelopeFile = async (endpoint: VerdocsEndpoint, envelopeId: string, documentId: string) =>\n endpoint.api //\n .get(`/envelopes/${envelopeId}/envelope_documents/${documentId}?file=true`, {responseType: 'blob'})\n .then((r) => r.data);\n\n/**\n * Update a Document field. Typically called during the signing process as a Recipient fills in fields.\n */\nexport const updateEnvelopeField = async (endpoint: VerdocsEndpoint, envelopeId: string, fieldName: string, value: any) =>\n endpoint.api //\n .put<IEnvelopeFieldSettings>(`/envelopes/${envelopeId}/fields/${fieldName}`, value)\n .then((r) => r.data);\n\n/**\n * Update a Document signature field. Signature fields are ID-driven. Call `Document.createSignature()` first to create a\n * signature for a Recipient, then call `Documents.updateDocumentFieldSignature()` to attach it to a field.\n */\nexport const updateEnvelopeFieldSignature = async (endpoint: VerdocsEndpoint, envelopeId: string, fieldName: string, signatureId: string) =>\n endpoint.api //\n .put<IEnvelopeFieldSettings>(`/envelopes/${envelopeId}/fields/${fieldName}/signature/${signatureId}`)\n .then((r) => r.data);\n\n/**\n * Update a Document signature field. Signature fields are ID-driven. Call `Document.createSignature()` first to create a\n * signature for a Recipient, then call `Documents.updateDocumentFieldSignature()` to attach it to a field.\n */\nexport const updateEnvelopeFieldInitials = async (endpoint: VerdocsEndpoint, envelopeId: string, fieldName: string, initialId: string) =>\n endpoint.api //\n .put<IEnvelopeFieldSettings>(`/envelopes/${envelopeId}/fields/${fieldName}/initial/${initialId}`)\n .then((r) => r.data);\n\n/**\n * Upload an attachment.\n */\nexport const uploadEnvelopeFieldAttachment = async (\n endpoint: VerdocsEndpoint,\n envelopeId: string,\n fieldName: string,\n file: File,\n onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void,\n) => {\n const formData = new FormData();\n formData.append('document', file, file.name);\n\n return endpoint.api //\n .put<IEnvelopeFieldSettings>(`/envelopes/${envelopeId}/fields/${fieldName}`, formData, {\n timeout: 120000,\n onUploadProgress: (event) => {\n const total = event.total || 1;\n const loaded = event.loaded || 0;\n onUploadProgress?.(Math.floor((loaded * 100) / (total || 1)), loaded, total || 1);\n },\n })\n .then((r) => r.data);\n};\n\n/**\n * Delete an attachment.\n */\nexport const deleteEnvelopeFieldAttachment = async (\n endpoint: VerdocsEndpoint,\n envelopeId: string,\n fieldName: string,\n file: File,\n onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void,\n) => {\n const formData = new FormData();\n // Omitting file is the trigger here\n\n return endpoint.api //\n .put<IEnvelopeFieldSettings>(`/envelopes/${envelopeId}/fields/${fieldName}`, formData, {\n timeout: 120000,\n onUploadProgress: (event) => {\n const total = event.total || 1;\n const loaded = event.loaded || 0;\n onUploadProgress?.(Math.floor((loaded * 100) / (total || 1)), loaded, total || 1);\n },\n })\n .then((r) => r.data);\n};\n\n/**\n * Get the attached file for an attachment field (if any)\n */\nexport const getFieldAttachment = async (endpoint: VerdocsEndpoint, envelopeId: string, fieldName: string) =>\n endpoint.api //\n .get(`/envelopes/${envelopeId}/fields/${fieldName}/document`, {responseType: 'blob'})\n .then((r) => r.data);\n\n/**\n * Get a display URI for a given page in a file attached to an envelope document. These pages are rendered server-side\n * into PNG resources suitable for display in IMG tags although they may be used elsewhere. Note that these are intended\n * for DISPLAY ONLY, are not legally binding documents, and do not contain any encoded metadata from participants.\n */\nexport const getEnvelopeDocumentPageDisplayUri = async (\n endpoint: VerdocsEndpoint,\n envelopeId: string,\n documentId: string,\n page: number,\n type: 'original' | 'filled' | 'certificate' = 'original',\n) =>\n endpoint.api\n .get<string>(`/envelopes/${envelopeId}/envelope_documents/${documentId}/pages/${page}/image?type=${type}`, {timeout: 20000})\n .then((r) => r.data);\n\nconst cachedEnvelopes: Record<string, {loaded: number; envelope: IEnvelope}> = {};\n\n/**\n * Wrapper for `getEnvelope()` that limits queries to one every 2 seconds per template ID.\n * This is intended for use in component hierarchies that all rely on the same template\n * to avoid unnecessary repeat server calls.\n */\nexport const throttledGetEnvelope = (endpoint: VerdocsEndpoint, envelopeId: string) => {\n if (cachedEnvelopes[envelopeId] && cachedEnvelopes[envelopeId].loaded + 2000 < new Date().getTime()) {\n return cachedEnvelopes[envelopeId].envelope;\n }\n\n return getEnvelope(endpoint, envelopeId).then((envelope) => {\n cachedEnvelopes[envelopeId] = {loaded: new Date().getTime(), envelope};\n return envelope;\n });\n};\n\nexport interface ITimeRange {\n start: string;\n end: string;\n}\n\n// /**\n// * Lists all templates accessible by the caller, with optional filters.\n// *\n// * ```typescript\n// * import {Envelopes} from '@verdocs/js-sdk/Templates';\n// *\n// * await Envelopes.listEnvelopes((VerdocsEndpoint.getDefault(), { name: 'test', sort: 'updated_at' });\n// * ```\n// */\n// export const listEnvelopes = (endpoint: VerdocsEndpoint, params?: IListEnvelopesParams) =>\n// endpoint.api //\n// .post<IEnvelopeSummaries>('/envelopes/list', params, {baseURL: endpoint.getBaseURLv2()})\n// .then((r) => r.data);\nexport interface IListEnvelopesParams {\n view?: 'inbox' | 'sent' | 'action' | 'waiting' | 'completed';\n q?: string;\n status?: string[];\n created_at?: ITimeRange;\n is_owner?: boolean;\n sort_by?: 'name' | 'created_at' | 'updated_at' | 'canceled_at' | 'status';\n template_id?: string;\n ascending?: boolean;\n rows?: number;\n page?: number;\n}\n\n/**a\n * Lists all envelopes accessible by the caller, with optional filters.\n *\n * ```typescript\n * import {Envelopes} from '@verdocs/js-sdk/Envelopes';\n *\n * const {totals, envelopes} = await Envelopes.listEnvelopes((VerdocsEndpoint.getDefault(), { q: 'test', sort: 'created_at' });\n * ```\n */\nexport const listEnvelopes = (endpoint: VerdocsEndpoint, params?: IListEnvelopesParams) =>\n endpoint.api //\n .post<{total: number; rows: number; page: number; envelopes: IEnvelope[]}>('/envelopes/list', params)\n .then((r) => r.data);\n\n/**\n * Get all of the envelopes that were sent using a given template.\n * NOTE: This endpoint will be retired soon. Its response is not paginated and it is typically used only to retrieve\n * \"submitted data\" for a template. A new endpoint will be introduced to provide this function more directly.\n * @deprecated\n */\nexport const getEnvelopesByTemplateId = async (endpoint: VerdocsEndpoint, templateId: string) =>\n endpoint.api //\n .get<IEnvelope[]>(`/envelopes?template_id=${templateId}`)\n .then((r) => r.data);\n","import {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {IInitial} from '../Models';\n\n/**\n * Create an initials block. In a typical signing workflow, the user is asked at the beginning of the process to \"adopt\"\n * an initials block to be used for all initials fields in the document. Thus, this is typically called one time to\n * create and store an initials block. Thereafter, the ID of the initials block may be re-used for each initials field\n * to be \"stamped\" by the user.\n */\nexport const createInitials = (endpoint: VerdocsEndpoint, name: string, initials: Blob) => {\n const data = new FormData();\n data.append('initial', initials, name);\n\n return endpoint.api //\n .post<IInitial>(`/initials`, data)\n .then((r) => r.data);\n};\n","import {\n IInPersonLinkResponse,\n IUpdateRecipientSubmitParams,\n IUpdateRecipientClaimEnvelope,\n IUpdateRecipientAgreedParams,\n IUpdateRecipientNameParams,\n IUpdateRecipientDeclineParams,\n IUpdateRecipientPrepareParams,\n} from './Types';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {IEnvelope, IInPersonAccessKey, IRecipient} from '../Models';\n\n/**\n * Update a recipient's status block\n */\nexport const updateRecipient = async (\n endpoint: VerdocsEndpoint,\n envelopeId: string,\n roleName: string,\n params:\n | IUpdateRecipientSubmitParams\n | IUpdateRecipientClaimEnvelope\n | IUpdateRecipientAgreedParams\n | IUpdateRecipientNameParams\n | IUpdateRecipientDeclineParams\n | IUpdateRecipientPrepareParams,\n) =>\n endpoint.api //\n .put<IRecipient>(`/envelopes/${envelopeId}/recipients/${roleName}`, params)\n .then((r) => r.data);\n\n/**\n * Submit an envelope (signing is finished). Note that all fields must be valid/completed for this to succeed.\n */\nexport const envelopeRecipientSubmit = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string) =>\n updateRecipient(endpoint, envelopeId, roleName, {action: 'submit'});\n\n/**\n * Decline to complete an envelope (signing will not terminated).\n */\nexport const envelopeRecipientDecline = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string) =>\n updateRecipient(endpoint, envelopeId, roleName, {action: 'decline'});\n\n/**\n * Claim / change ownership of an envelope. This is a special-case operation only available in certain workflows.\n */\nexport const envelopeRecipientChangeOwner = (\n endpoint: VerdocsEndpoint,\n envelopeId: string,\n roleName: string,\n email: string,\n fullName: string,\n) => updateRecipient(endpoint, envelopeId, roleName, {action: 'owner_update', email, full_name: fullName});\n\n/**\n * Agree to electronic signing.\n */\nexport const envelopeRecipientAgree = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, agreed: boolean) =>\n updateRecipient(endpoint, envelopeId, roleName, {action: 'update', agreed});\n\n/**\n * Change a recipient's name.\n */\nexport const envelopeRecipientUpdateName = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, fullName: string) =>\n updateRecipient(endpoint, envelopeId, roleName, {action: 'update', new_full_name: fullName});\n\n/**\n * Change a recipient's name.\n */\nexport const envelopeRecipientPrepare = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, recipients: IRecipient[]) =>\n updateRecipient(endpoint, envelopeId, roleName, {action: 'prepare', recipients});\n\nexport interface ISignerTokenResponse {\n recipient: IRecipient;\n envelope: IEnvelope;\n signerToken: string;\n inPersonAccessKey: IInPersonAccessKey;\n}\n\n/**\n * Get a signing token.\n */\nexport const getSignerToken = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string) =>\n endpoint.api //\n .get<ISignerTokenResponse>(`/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}/signer-token`)\n .then((r) => r.data);\n\n/**\n * Get an in-person signing link.\n */\nexport const getInPersonLink = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string) =>\n endpoint.api //\n .get<IInPersonLinkResponse>(`/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}?in_person_link=true`)\n .then((r) => r.data);\n\n/**\n * Send a delegation request.\n */\nexport const sendDelegate = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string) =>\n endpoint.api //\n .post<IEnvelope>(`/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}/delegate`)\n .then((r) => r.data);\n\n/**\n * Resend a recipient's invitation.\n */\nexport const resendInvitation = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string) =>\n endpoint.api //\n .post(`/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}/resend_invitation`)\n .then((r) => r.data);\n","import {ICreateEnvelopeReminderRequest} from './Types';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {IReminder} from '../Models';\n\n/**\n * Enable automatic reminders. setup_time is the number of days after the envelope is sent that the first reminder\n * should be sent. interval_time is the number of days between reminders.\n */\nexport const createEnvelopeReminder = (endpoint: VerdocsEndpoint, envelopeId: string, params: ICreateEnvelopeReminderRequest) =>\n endpoint.api //\n .post<IReminder>(`/envelopes/${envelopeId}/reminder/`, params)\n .then((r) => r.data);\n\n/**\n * Get the reminder configuration for an envelope.\n */\nexport const getEnvelopeReminder = (endpoint: VerdocsEndpoint, envelopeId: string, reminderId: string) =>\n endpoint.api //\n .get<IReminder>(`/envelopes/${envelopeId}/reminder/${reminderId}`)\n .then((r) => r.data);\n\n/**\n * Update the reminder configuration for an envelope.\n */\nexport const updateEnvelopeReminder = (\n endpoint: VerdocsEndpoint,\n envelopeId: string,\n reminderId: string,\n params: ICreateEnvelopeReminderRequest,\n) =>\n endpoint.api //\n .put<IReminder>(`/envelopes/${envelopeId}/reminder/${reminderId}`, params)\n .then((r) => r.data);\n\n/**\n * Delete the reminder configuration for an envelope.\n */\nexport const deleteEnvelopeReminder = (endpoint: VerdocsEndpoint, envelopeId: string, reminderId: string) =>\n endpoint.api //\n .delete(`/envelopes/${envelopeId}/reminder/${reminderId}`)\n .then((r) => r.data);\n","/**\n * Various helpers to identify available operations for an envelope by a user.\n *\n * @module\n */\n\nimport {IEnvelope, IRecipient} from '../Models';\nimport {TSession} from '../Sessions/Types';\nimport {IEnvelopeSummary} from './Types';\n\n/**\n * Check to see if the user owns the envelope.\n */\nexport const userIsEnvelopeOwner = (session: TSession, envelope: IEnvelope | IEnvelopeSummary) =>\n envelope.profile_id === session?.profile_id;\n\n/**\n * Check to see if the user owns the envelope.\n */\nexport const userIsEnvelopeRecipient = (session: TSession, envelope: IEnvelope | IEnvelopeSummary) =>\n envelope.profile_id === session?.profile_id;\n\n/**\n * Check to see if the envelope has pending actions.\n */\nexport const envelopeIsActive = (envelope: IEnvelope | IEnvelopeSummary) =>\n envelope.status !== 'complete' && envelope.status !== 'declined' && envelope.status !== 'canceled';\n\n/**\n * Check to see if the envelope has been completed.\n */\nexport const envelopeIsComplete = (envelope: IEnvelope | IEnvelopeSummary) => envelope.status !== 'complete';\n\n/**\n * Check to see if the user owns the envelope.\n */\nexport const userCanCancelEnvelope = (session: TSession, envelope: IEnvelope | IEnvelopeSummary) =>\n userIsEnvelopeOwner(session, envelope) &&\n envelope.status !== 'complete' &&\n envelope.status !== 'declined' &&\n envelope.status !== 'canceled';\n\n/**\n * Check to see if the user owns the envelope.\n */\nexport const userCanFinishEnvelope = (session: TSession, envelope: IEnvelope | IEnvelopeSummary) =>\n userIsEnvelopeOwner(session, envelope) &&\n envelope.status !== 'complete' &&\n envelope.status !== 'declined' &&\n envelope.status !== 'canceled';\n/**\n * Returns true if the recipient has a pending action. Note that this does not necessarily mean the recipient can act (yet).\n */\nexport const recipientHasAction = (recipient: IRecipient) => !['submitted', 'canceled', 'declined'].includes(recipient.status);\n\n/**\n * Returns the recipients who still have a pending action. Note that not all of these recipients may be able to act (yet).\n */\nexport const getRecipientsWithActions = (envelope: IEnvelope | IEnvelopeSummary) => (envelope?.recipients || []).filter(recipientHasAction);\n\n/**\n * Returns true if the recipient can act.\n */\nexport const recipientCanAct = (recipient: IRecipient, recipientsWithActions: IRecipient[]) =>\n recipient.sequence === recipientsWithActions?.[0]?.sequence;\n\n/**\n * Returns true if the user can act.\n */\nexport const userCanAct = (email: string, recipientsWithActions: IRecipient[]) => {\n const recipient = recipientsWithActions.find((r) => r.email === email);\n return recipient && recipient.sequence === recipientsWithActions?.[0]?.sequence;\n};\n\n/**\n * Returns true if the user can act.\n */\nexport const userCanSignNow = (session: TSession, envelope: IEnvelope | IEnvelopeSummary) => {\n if (!session) {\n return false;\n }\n\n const recipientsWithActions = getRecipientsWithActions(envelope);\n const myRecipient = recipientsWithActions.find((r) => r.profile_id === session?.profile_id || r.email === session?.email);\n return (\n myRecipient &&\n envelopeIsActive(envelope) &&\n userIsEnvelopeRecipient(session, envelope) &&\n recipientCanAct(myRecipient, recipientsWithActions)\n );\n};\n\nexport const getNextRecipient = (envelope: IEnvelope | IEnvelopeSummary) => {\n const recipientsWithActions = getRecipientsWithActions(envelope);\n return recipientsWithActions?.[0];\n};\n","import {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {ISignature} from '../Models';\n\n/**\n * Create a signature block. In a typical signing workflow, the user is asked at the beginning of the process to \"adopt\"\n * a signature block to be used for all signature fields in the document. Thus, this is typically called one time to\n * create and store a signature block. Thereafter, the ID of the signature block may be re-used for each signature field\n * to be \"stamped\" by the user.\n */\nexport const createSignature = (endpoint: VerdocsEndpoint, name: string, signature: Blob) => {\n const data = new FormData();\n data.append('signature', signature, name);\n\n return endpoint.api //\n .post<ISignature>(`/signatures`, data)\n .then((r) => r.data);\n};\n\n/**\n * Get the availbable signatures for a user.\n */\nexport const getSignatures = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<ISignature[]>('/signatures')\n .then((r) => r.data);\n\n/**\n * Get a user's signature by ID.\n */\nexport const getSignature = (endpoint: VerdocsEndpoint, signatureId: string) =>\n endpoint.api //\n .get(`/signatures/${signatureId}`)\n .then((r) => r.data);\n\n/**\n * Delete a user's signature.\n */\nexport const deleteSignature = (endpoint: VerdocsEndpoint, signatureId: string) =>\n endpoint.api //\n .delete(`/signatures/${signatureId}`)\n .then((r) => r.data);\n","/**\n * API keys are used to authenticate server-to-server calls. (API keys should **never** be used for client-to-server operations!)\n * To generate a key, either use the Verdocs admin interface and make note of the client_id and client_secret generated, or call\n * createKey as shown below. Then call {@link Users.Auth.authenticateApp} to obtain an access token using the provided ID and\n * secret. Note that server-to-server authentication requests return shorter-lived tokens, so it is important to check the `exp`\n * field and re-authenticate as needed for subsequent calls.\n *\n * API keys may be updated or rotated at any time. Regular rotation is recommended. Rotation will not expire or invalidate\n * existing server-to-server sessions, so it may be done at any time without disrupting your application.\n *\n * @module\n */\n\nimport {ICreateApiKeyRequest, IUpdateApiKeyRequest} from './Types';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {IApiKey} from '../Models';\n\n/**\n * Get a list of keys for a given organization. The caller must have admin access to the organization.\n *\n * ```typescript\n * import {ApiKeys} from '@verdocs/js-sdk';\n *\n * const keys = await ApiKeys.getKeys(ORGID);\n * ```\n */\nexport const getApiKeys = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IApiKey[]>(`/v2/api-keys`)\n .then((r) => r.data);\n\n/**\n * Create an API key.\n *\n * ```typescript\n * import {ApiKeys} from '@verdocs/js-sdk';\n *\n * await ApiKeys.createKey(ORGID, {name: NEWNAME});\n * ```\n */\nexport const createApiKey = (endpoint: VerdocsEndpoint, params: ICreateApiKeyRequest) =>\n endpoint.api //\n .post<IApiKey>('/v2/api-keys', params)\n .then((r) => r.data);\n\n/**\n * Rotate the secret for an API key. The caller must have admin access to the organization.\n *\n * ```typescript\n * import {ApiKeys} from '@verdocs/js-sdk';\n *\n * const {client_secret: newSecret} = await ApiKeys.rotateKey(ORGID, CLIENTID);\n * ```\n */\nexport const rotateApiKey = (endpoint: VerdocsEndpoint, clientId: string) =>\n endpoint.api //\n .post<IApiKey>(`/v2/api-keys/${clientId}/rotate`)\n .then((r) => r.data);\n\n/**\n * Update an API key to change its assigned Profile ID or Name.\n *\n * ```typescript\n * import {ApiKeys} from '@verdocs/js-sdk';\n *\n * await ApiKeys.updateKey(ORGID, CLIENTID, {name: NEWNAME});\n * ```\n */\nexport const updateApiKey = (endpoint: VerdocsEndpoint, clientId: string, params: IUpdateApiKeyRequest) =>\n endpoint.api //\n .patch<IApiKey>(`/v2/api-keys/${clientId}`, params)\n .then((r) => r.data);\n\n/**\n * Delete an API key.\n *\n * ```typescript\n * import {ApiKeys} from '@verdocs/js-sdk';\n *\n * await ApiKeys.deleteKey(ORGID, CLIENTID);\n * ```\n */\nexport const deleteApiKey = (endpoint: VerdocsEndpoint, clientId: string) =>\n endpoint.api //\n .delete(`/v2/api-keys/${clientId}`)\n .then((r) => r.data);\n","/**\n * Organizations may contain \"Groups\" of user profiles, called Members. Groups may have permissions assigned that\n * apply to all Members, making it easy to configure role-based access control (RBAC) within an Organization. Note\n * that permissions are **additive**. A user may be a member of more than one group, and may also have permissions\n * assigned directly. In that case, the user will have the combined set of all permissions inherited from all\n * sources.\n *\n * @module\n */\n\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {TPermission} from '../BaseTypes';\nimport {IGroup} from '../Models';\n\n/**\n * Get a list of groups for a given organization. The caller must have admin access to the organization.\n *\n * ```typescript\n * import {getGroups} from '@verdocs/js-sdk';\n *\n * const groups = await getGroups(ORGID);\n * ```\n */\nexport const getGroups = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IGroup[]>(`/v2/organization-groups`)\n .then((r) => r.data);\n\n/**\n * Get the details for a group, including its member profiles and list of permissions.\n *\n * ```typescript\n * import {getGroup} from '@verdocs/js-sdk/v2/organization-groups';\n *\n * const groups = await getGroup(GROUPID);\n * ```\n */\nexport const getGroup = (endpoint: VerdocsEndpoint, groupId: string) =>\n endpoint.api //\n .get<IGroup>(`/v2/organization-groups/${groupId}`)\n .then((r) => r.data);\n\nexport const createGroup = (endpoint: VerdocsEndpoint, name: string) =>\n endpoint.api //\n .post('/v2/organization-groups', {name})\n .then((r) => r.data);\n\nexport const addGroupMember = (endpoint: VerdocsEndpoint, groupId: string, profile_id: string) =>\n endpoint.api //\n .post(`/v2/organization-groups/${groupId}/members`, {profile_id})\n .then((r) => r.data);\n\nexport const deleteGroupMember = (endpoint: VerdocsEndpoint, groupId: string, profile_id: string) =>\n endpoint.api //\n .delete(`/v2/organization-groups/${groupId}/members/${profile_id}`)\n .then((r) => r.data);\n\nexport const updateGroup = (endpoint: VerdocsEndpoint, groupId: string, params: {permissions: TPermission[]}) =>\n endpoint.api //\n .patch(`/v2/organization-groups/${groupId}`, params)\n .then((r) => r.data);\n","import {IOrganizationInvitation, IProfile} from '../Models';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {ICreateInvitationRequest} from './Types';\n\n/**\n * An invitation represents an opportunity for a Member to join an Organization.\n *\n * @module\n */\n\nexport const getOrganizationInvitations = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IOrganizationInvitation[]>(`/v2/organization-invitations`)\n .then((r) => r.data);\n\nexport const createOrganizationInvitation = (endpoint: VerdocsEndpoint, params: ICreateInvitationRequest) =>\n endpoint.api //\n .post<IOrganizationInvitation>(`/v2/organization-invitations`, params)\n .then((r) => r.data);\n\nexport const deleteOrganizationInvitation = (endpoint: VerdocsEndpoint, email: string) =>\n endpoint.api //\n .delete(`/v2/organization-invitations/${email}`)\n .then((r) => r.data);\n\nexport const updateOrganizationInvitation = (endpoint: VerdocsEndpoint, email: string, params: Partial<ICreateInvitationRequest>) =>\n endpoint.api //\n .patch<IOrganizationInvitation>(`/v2/organization-invitations/${email}`, params)\n .then((r) => r.data);\n\nexport const resendOrganizationInvitation = (endpoint: VerdocsEndpoint, email: string) =>\n endpoint.api //\n .post('/v2/organization-invitations/resend', {email})\n .then((r) => r.data);\n\nexport const acceptOrganizationInvitation = (endpoint: VerdocsEndpoint, email: string, token: string) =>\n endpoint.api //\n .post<IProfile>('/v2/organization-invitations/accept', {email, token})\n .then((r) => r.data);\n\nexport const declineOrganizationInvitation = (endpoint: VerdocsEndpoint, email: string, token: string) =>\n endpoint.api //\n .post<{status: 'OK'}>('/v2/organization-invitations/decline', {email, token})\n .then((r) => r.data);\n","import {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {IProfile} from '../Models';\n\n/**\n * An Organization Member (aka Profile) is an individual user with access to an organization.\n *\n * @module\n */\n\nexport const getOrganizationMembers = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IProfile[]>(`/v2/organization-members`)\n .then((r) => r.data);\n\nexport const deleteOrganizationMember = (endpoint: VerdocsEndpoint, profileId: string) =>\n endpoint.api //\n .delete(`/v2/organization-members/${profileId}`)\n .then((r) => r.data);\n\nexport const updateOrganizationMember = (endpoint: VerdocsEndpoint, profileId: string, params: Pick<IProfile, 'roles' | 'permissions'>) =>\n endpoint.api //\n .patch(`/v2/organization-members/${profileId}`, params)\n .then((r) => r.data);\n","/**\n * An Organization is the top level object for ownership for Members, Documents, and Templates.\n *\n * @module\n */\n\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {IOrganization} from '../Models';\n\n/**\n * Get a list of organizations the caller is a member of.\n */\nexport const getOrganizations = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IOrganization[]>('/v2/organizations')\n .then((r) => r.data);\n\n/**\n * Get an organization by ID.\n */\nexport const getOrganization = (endpoint: VerdocsEndpoint, organizationId: string) =>\n endpoint.api //\n .get<IOrganization>(`/v2/organizations/${organizationId}`)\n .then((r) => r.data);\n\n/**\n * Create an organization.\n */\nexport const createOrganization = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .post<IOrganization>('/v2/organizations')\n .then((r) => r.data);\n\n/**\n * Delete an organization.\n */\nexport const deleteOrganization = (endpoint: VerdocsEndpoint, organizationId: string) =>\n endpoint.api //\n .delete(`/v2/organizations/${organizationId}`)\n .then((r) => r.data);\n\n/**\n * Update an organization.\n */\nexport const updateOrganization = (endpoint: VerdocsEndpoint, organizationId: string, params: Partial<IOrganization>) =>\n endpoint.api //\n .patch<IOrganization>(`/v2/organizations/${organizationId}`, params)\n .then((r) => r.data);\n","/**\n * Webhooks are callback triggers from Verdocs to your servers that notify your applications\n * of various events, such as signing operations.\n *\n * @module\n */\n\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {ISetWebhookRequest} from './Types';\nimport {IWebhook} from '../Models';\n\n/**\n * Get the registered Webhooks for the caller's organization.\n */\nexport const getWebhooks = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IWebhook>(`/v2/webhooks/organization`)\n .then((r) => r.data);\n\n/**\n * Update the registered Webhooks for the caller's organization.\n */\nexport const setWebhooks = (endpoint: VerdocsEndpoint, params: ISetWebhookRequest) =>\n endpoint.api //\n .patch<IWebhook>(`/v2/webhooks/organization`, params)\n .then((r) => r.data);\n","import {TPermission} from '../BaseTypes';\nimport {TSession} from './Types';\n\n/**\n * Confirm whether the user has all of the specified permissions.\n */\nexport const userHasPermissions = (session: TSession, permissions: TPermission[]) =>\n permissions.every((perm) => (session?.permissions || []).includes(perm));\n","import {TTemplateAction, TTemplatePermission} from '../BaseTypes';\nimport {ITemplateSummary} from './Types';\nimport {TSession} from '../Sessions';\nimport {ITemplate} from '../Models';\n\nexport const canPerformTemplateAction = (\n session: TSession,\n action: TTemplateAction,\n template?: ITemplate | ITemplateSummary,\n): {canPerform: boolean; message: string} => {\n if (!template && !action.includes('create')) {\n return {canPerform: false, message: 'Missing required template object'};\n }\n\n // We use BOGUS here to force the option-chain in things like template?.profile_id to NOT match profile?.profile_id because if both\n // were undefined, they would actually match.\n const profile_id = session?.profile_id || 'BOGUS';\n const organization_id = session?.organization_id || 'BOGUS';\n\n if (!profile_id) {\n return {canPerform: false, message: 'Active session required'};\n }\n\n const isCreator = template?.profile_id === profile_id;\n const isSameOrg = template?.organization_id === organization_id;\n const isPersonal = template?.is_personal ?? false;\n const isPublic = template?.is_public ?? false;\n\n const permissionsRequired: TTemplatePermission[] = [];\n switch (action) {\n case 'create_personal':\n permissionsRequired.push('template:creator:create:personal');\n break;\n case 'create_org':\n permissionsRequired.push('template:creator:create:org');\n break;\n case 'create_public':\n permissionsRequired.push('template:creator:create:public');\n break;\n case 'read':\n if (!isCreator) {\n if ((!isPersonal && isSameOrg) || !isPublic) {\n permissionsRequired.push('template:member:read');\n }\n }\n break;\n case 'write':\n if (!isCreator) {\n permissionsRequired.push('template:member:read');\n permissionsRequired.push('template:member:write');\n }\n break;\n case 'change_visibility_personal':\n if (isCreator) {\n permissionsRequired.push('template:creator:create:personal');\n } else {\n permissionsRequired.push('template:member:visibility');\n }\n break;\n case 'change_visibility_org':\n if (isCreator) {\n permissionsRequired.push('template:creator:create:org');\n } else {\n permissionsRequired.push('template:member:visibility');\n }\n break;\n case 'change_visibility_public':\n if (isCreator) {\n permissionsRequired.push('template:creator:create:public');\n permissionsRequired.push('template:creator:visibility');\n } else {\n permissionsRequired.push('template:member:visibility');\n }\n break;\n case 'delete':\n if (isCreator) {\n permissionsRequired.push('template:creator:delete');\n } else {\n permissionsRequired.push('template:member:delete');\n }\n break;\n default:\n return {canPerform: false, message: 'Action is not defined'};\n }\n\n if (hasRequiredPermissions(session, permissionsRequired)) {\n return {canPerform: true, message: ''};\n }\n\n return {canPerform: false, message: `Insufficient access to perform '${action}'. Needed permissions: ${permissionsRequired.toString()}`};\n};\n\nexport const hasRequiredPermissions = (session: TSession, permissions: string[]) =>\n permissions.every((perm) => (session?.permissions || []).includes(perm));\n","import {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {ITemplateField} from '../Models';\n\n/**\n * Add a field to a template.\n */\nexport const createField = (endpoint: VerdocsEndpoint, templateId: string, params: ITemplateField) =>\n endpoint.api //\n .post<ITemplateField>(`/templates/${templateId}/fields`, params)\n .then((r) => r.data);\n\n/**\n * Update a template field.\n */\nexport const updateField = (endpoint: VerdocsEndpoint, templateId: string, fieldName: string, params: Partial<ITemplateField>) =>\n endpoint.api //\n .put<ITemplateField>(`/templates/${templateId}/fields/${fieldName}`, params)\n .then((r) => r.data);\n\n/**\n * REmove a field from a template.\n */\nexport const deleteField = (endpoint: VerdocsEndpoint, templateId: string, fieldName: string) =>\n endpoint.api //\n .delete(`/templates/${templateId}/fields/${fieldName}`)\n .then((r) => r.data);\n","/**\n * Various helpers to identify available operations for a template by a user.\n *\n * @module\n */\n\nimport {TSession, userHasPermissions} from '../Sessions';\nimport {ITemplateSummary} from './Types';\nimport {ITemplate} from '../Models';\n\n/**\n * Check to see if the user created the template.\n */\nexport const userIsTemplateCreator = (session: TSession, template: ITemplate | ITemplateSummary) =>\n session && template && session.profile_id === template.profile_id;\n\n/**\n * Check to see if a template is \"shared\" with the user.\n */\nexport const userHasSharedTemplate = (session: TSession, template: ITemplate | ITemplateSummary) =>\n session && template && !template.is_personal && session.organization_id === template.organization_id;\n\n/**\n * Check to see if the user can create a personal/private template.\n */\nexport const userCanCreatePersonalTemplate = (session: TSession) => userHasPermissions(session, ['template:creator:create:personal']);\n\n/**\n * Check to see if the user can create an org-shared template.\n */\nexport const userCanCreateOrgTemplate = (session: TSession) => userHasPermissions(session, ['template:creator:create:org']);\n\n/**\n * Check to see if the user can create a public template.\n */\nexport const userCanCreatePublicTemplate = (session: TSession) => userHasPermissions(session, ['template:creator:create:public']);\n\n/**\n * Check to see if the user can read/view a template.\n */\nexport const userCanReadTemplate = (session: TSession, template: ITemplate | ITemplateSummary) =>\n template.is_public ||\n userIsTemplateCreator(session, template) ||\n (userHasSharedTemplate(session, template) && userHasPermissions(session, ['template:member:read']));\n\n/**\n * Check to see if the user can update a tempate.\n */\nexport const userCanUpdateTemplate = (session: TSession, template: ITemplate | ITemplateSummary) =>\n userIsTemplateCreator(session, template) ||\n (userHasSharedTemplate(session, template) && userHasPermissions(session, ['template:member:read', 'template:member:write']));\n\n/**\n * Check to see if the user can change whether a template is personal vs org-shared.\n */\nexport const userCanMakeTemplatePrivate = (session: TSession, template: ITemplate | ITemplateSummary) =>\n userIsTemplateCreator(session, template)\n ? userHasPermissions(session, ['template:creator:create:personal'])\n : userHasPermissions(session, ['template:member:visibility']);\n\n/**\n * Check to see if the user can change whether a template is personal vs org-shared.\n */\nexport const userCanMakeTemplateShared = (session: TSession, template: ITemplate | ITemplateSummary) =>\n userIsTemplateCreator(session, template)\n ? userHasPermissions(session, ['template:creator:create:org'])\n : userHasPermissions(session, ['template:member:visibility']);\n\n/**\n * Check to see if the user can change whether a template is personal vs org-shared.\n */\nexport const userCanMakeTemplatePublic = (session: TSession, template: ITemplate | ITemplateSummary) =>\n userIsTemplateCreator(session, template)\n ? userHasPermissions(session, ['template:creator:create:public'])\n : userHasPermissions(session, ['template:member:visibility']);\n\n/**\n * Check to see if the user can change whether a template is personal vs org-shared.\n */\nexport const userCanChangeOrgVisibility = (session: TSession, template: ITemplate | ITemplateSummary) =>\n userIsTemplateCreator(session, template) && userHasPermissions(session, ['template:creator:create:personal']);\n\n/**\n * Check to see if the user can change whether a template is personal vs org-shared.\n */\nexport const userCanDeleteTemplate = (session: TSession, template: ITemplate | ITemplateSummary) =>\n userIsTemplateCreator(session, template)\n ? userHasPermissions(session, ['template:creator:delete'])\n : userHasPermissions(session, ['template:member:delete']);\n\n/**\n * Confirm whether the user can create an envelope using the specified template.\n */\nexport const userCanSendTemplate = (session: TSession, template: ITemplate | ITemplateSummary) => {\n switch (template.sender) {\n case 'creator':\n return userIsTemplateCreator(session, template);\n case 'organization_member':\n case 'organization_member_as_creator':\n return userIsTemplateCreator(session, template) || template.organization_id === session?.organization_id;\n default:\n return true;\n }\n};\n\n/**\n * Confirm whether the user can create a new template.\n */\nexport const userCanCreateTemplate = (session: TSession) =>\n userCanCreatePersonalTemplate(session) || userCanCreateOrgTemplate(session) || userCanCreatePublicTemplate(session);\n\n/**\n * Check to see if the user can \"build\" the template (use the field builder). The user must have write access to the\n * template, and the template must have at least one signer role.\n */\nexport const userCanBuildTemplate = (session: TSession, template: ITemplate) =>\n userCanUpdateTemplate(session, template) && (template.roles || []).filter((role) => role.type === 'signer').length > 0;\n\nexport const getFieldsForRole = (template: ITemplate, role_name: string) =>\n (template.fields || []).filter((field) => field.role_name === role_name);\n\n/**\n * Check to see if the user can preview the template. The user must have read access to the template, the template must\n * have at least one signer, and every signer must have at least one field.\n */\nexport const userCanPreviewTemplate = (session: TSession, template: ITemplate) => {\n const hasPermission = userCanReadTemplate(session, template);\n const signers = (template.roles || []).filter((role) => role.type === 'signer');\n return hasPermission && signers.length > 0 && signers.every((signer) => getFieldsForRole(template, signer.name).length > 0);\n};\n","import {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {IReminder, ITemplate} from '../Models';\n\nexport interface ICreateTemplateReminderRequest {\n setup_time: number;\n interval_time: number;\n}\n\n/**\n * Enable automatic reminders. setup_time is the number of days after the envelope is sent that the first reminder\n * should be sent. interval_time is the number of days between reminders.\n */\nexport const createTemplateReminder = (endpoint: VerdocsEndpoint, templateId: string, params: ICreateTemplateReminderRequest) =>\n endpoint.api //\n .post<ITemplate>(`/templates/${templateId}/reminder/`, params)\n .then((r) => r.data);\n\n/**\n * Get the reminder configuration for a template.\n */\nexport const getTemplateReminder = (endpoint: VerdocsEndpoint, templateId: string, reminderId: string) =>\n endpoint.api //\n .get<IReminder>(`/templates/${templateId}/reminder/${reminderId}`)\n .then((r) => r.data);\n\n/**\n * Update the reminder configuration for a template.\n */\nexport const updateTemplateReminder = (\n endpoint: VerdocsEndpoint,\n templateId: string,\n reminderId: string,\n params: ICreateTemplateReminderRequest,\n) =>\n endpoint.api //\n .put<IReminder>(`/templates/${templateId}/reminder/${reminderId}`, params)\n .then((r) => r.data);\n\n/**\n * Delete the reminder configuration for a template.\n */\nexport const deleteTemplateReminder = (endpoint: VerdocsEndpoint, templateId: string, reminderId: string) =>\n endpoint.api //\n .delete(`/templates/${templateId}/reminder/${reminderId}`)\n .then((r) => r.data);\n","/**\n * A \"role\" is an individual participant in a signing flow, such as a signer or CC contact. Roles are identified by\n * their names, which must be unique (e.g. 'Recipient 1'). Template fields are assigned to roles for signing operations,\n * so you may have 'Recipient 1 Signature 1' and so forth.\n *\n * @module\n */\n\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {ITemplateField, IRole} from '../Models';\n\nexport const createTemplateRole = (endpoint: VerdocsEndpoint, templateId: string, params: IRole) =>\n endpoint.api //\n .post<IRole>(`/templates/${templateId}/roles`, params)\n .then((r) => r.data);\n\nexport const getTemplateRoles = (endpoint: VerdocsEndpoint, templateId: string) =>\n endpoint.api //\n .get<IRole[]>(`/templates/${templateId}/roles`)\n .then((r) => r.data);\n\nexport const getTemplateRole = (endpoint: VerdocsEndpoint, templateId: string, roleName: string) =>\n endpoint.api //\n .get<IRole>(`/templates/${templateId}/roles/${roleName}`)\n .then((r) => r.data);\n\nexport const updateTemplateRole = (endpoint: VerdocsEndpoint, templateId: string, roleName: string, params: Partial<IRole>) =>\n endpoint.api //\n .put<IRole>(`/templates/${templateId}/roles/${roleName}`, params)\n .then((r) => r.data);\n\nexport const deleteTemplateRole = (endpoint: VerdocsEndpoint, templateId: string, roleName: string) =>\n endpoint.api //\n .delete(`/templates/${templateId}/roles/${roleName}`)\n .then((r) => r.data);\n\nexport const getTemplateRoleFields = (endpoint: VerdocsEndpoint, templateId: string, roleName: string) =>\n endpoint.api //\n .get<ITemplateField[]>(`/templates/${templateId}/roles/${roleName}/fields`)\n .then((r) => r.data);\n","import {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {IStar, ITemplateSummary} from './Types';\n\n/**\n * Get the template stars for a template.\n */\nexport const getStars = (endpoint: VerdocsEndpoint, templateId: string) =>\n endpoint.api //\n .get<IStar[]>(`/templates/${templateId}/stars`)\n .then((r) => r.data);\n\n/**\n * Toggle the template star for a template.\n */\nexport const toggleStar = (endpoint: VerdocsEndpoint, templateId: string) =>\n endpoint.api //\n .post<ITemplateSummary>(`/templates/${templateId}/stars/toggle`)\n .then((r) => r.data);\n","/**\n * A Tag is a user-specified label applied to a template. Tags help users organize and find Templates.\n * recipients. Every Organization has a set of tags \"owned\" by that Organization and only visible inside it.\n * Verdocs also provides a set of system-wide \"featured\" tags available to all Organizations.\n *\n * @module\n */\n\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {ITemplateTag, ITag} from './Types';\n\n/**\n * Apply a tag to a template.\n */\nexport const addTemplateTag = (endpoint: VerdocsEndpoint, templateId: string, params: ITag) =>\n endpoint.api //\n .post<ITemplateTag>(`/templates/${templateId}/tags/`, params)\n .then((r) => r.data);\n\n/**\n * Get all tags for a template.\n */\nexport const getTemplateTags = (endpoint: VerdocsEndpoint, templateId: string) =>\n endpoint.api //\n .get<ITemplateTag[]>(`/templates/${templateId}/tags/`)\n .then((r) => r.data);\n\n/**\n * Remove a tag from a template.\n */\nexport const deleteTemplateTag = (endpoint: VerdocsEndpoint, templateId: string, tagName: string) =>\n endpoint.api //\n .post(`/templates/${templateId}/tags/${tagName}`)\n .then((r) => r.data);\n\n/**\n * Create an Organization-wide tag.\n */\nexport const createTag = (endpoint: VerdocsEndpoint, name: string) =>\n endpoint.api //\n .post<ITag>('/tags', {tag_name: name})\n .then((r) => r.data);\n\n/**\n * Get an Organization-wide tag.\n */\nexport const getTag = (endpoint: VerdocsEndpoint, name: string) =>\n endpoint.api //\n .get<ITag>(`/tags/${name}`)\n .then((r) => r.data);\n\n/**\n * Get all tags available for use by an Organization.\n */\nexport const getAllTags = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<ITag[]>('/tags')\n .then((r) => r.data);\n","/**\n * A Template defines how a Verdocs signing flow will be performed, including attachments, signing fields, and\n * recipients.\n *\n * @module\n */\n\nimport {ITemplateOwnerInfo, ITemplateSearchParams, ITemplateSearchResult, ITemplateSummary} from './Types';\nimport {TSortTemplateBy, TTemplateSenderType} from '../BaseTypes';\nimport {IRole, ITemplate, ITemplateField} from '../Models';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {ITimePeriod} from '../Utils';\n\nexport interface IGetTemplatesParams {\n is_starred?: boolean;\n is_creator?: boolean;\n is_organization?: boolean;\n}\n\n/**\n * Get all templates accessible by the caller, with optional filters.\n *\n * ```typescript\n * import {Templates} from '@verdocs/js-sdk/Templates';\n *\n * await Templates.getTemplates((VerdocsEndpoint.getDefault());\n * await Templates.getTemplates((VerdocsEndpoint.getDefault(), { is_starred: true });\n * await Templates.getTemplates((VerdocsEndpoint.getDefault(), { is_creator: true });\n * await Templates.getTemplates((VerdocsEndpoint.getDefault(), { is_organization: true });\n * ```\n */\nexport const getTemplates = (endpoint: VerdocsEndpoint, params?: IGetTemplatesParams) =>\n endpoint.api //\n .post<ITemplate[]>('/templates', {params})\n .then((r) => r.data);\n\n// export interface IListTemplatesParams {\n// name?: string;\n// sharing?: 'all' | 'personal' | 'shared' | 'public';\n// starred?: 'all' | 'starred' | 'unstarred';\n// sort?: 'name' | 'created_at' | 'updated_at' | 'last_used_at' | 'counter' | 'star_counter';\n// direction?: 'asc' | 'desc';\n// page?: number;\n// rows?: number;\n// }\n\n/**\n * Lists all templates accessible by the caller, with optional filters.\n *\n * ```typescript\n * import {Templates} from '@verdocs/js-sdk/Templates';\n *\n * await Templates.listTemplates((VerdocsEndpoint.getDefault(), { sharing: 'personal', sort: 'last_used_at' });\n * ```\n */\n// export const listTemplates = (endpoint: VerdocsEndpoint, params?: IListTemplatesParams) =>\n// endpoint.api //\n// .post<ITemplateSummaries>('/templates/list', params, {baseURL: endpoint.getBaseURLv2()})\n// .then((r) => r.data);\n\n/**\n * Get one template by its ID.\n *\n * ```typescript\n * import {Templates} from '@verdocs/js-sdk/Templates';\n *\n * const template = await Templates.getTemplate((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9');\n * ```\n */\nexport const getTemplate = (endpoint: VerdocsEndpoint, templateId: string) =>\n endpoint.api //\n .get<ITemplate>(`/templates/${templateId}`)\n .then((r) => {\n const template = r.data;\n\n window?.console?.log('[JS_SDK] Post-processing template', template);\n\n // Post-process the template to upgrade to new data fields\n if (!template.documents && template.template_documents) {\n template.documents = template.template_documents;\n }\n\n template.documents?.forEach((document) => {\n if (!document.order) {\n document.order = 0;\n }\n\n if (document.page_numbers) {\n document.pages = document.page_numbers;\n }\n });\n\n template.fields?.forEach((field) => {\n if (field.setting) {\n field.settings = field.setting;\n }\n });\n\n return template;\n });\n\n/**\n * Get owner information for a template.\n *\n * ```typescript\n * import {Templates} from '@verdocs/js-sdk/Templates';\n *\n * const template = await Templates.getTemplateOwnerInfo((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9');\n * ```\n */\nexport const getTemplateOwnerInfo = (endpoint: VerdocsEndpoint, templateId: string) =>\n endpoint.api //\n .get<ITemplateOwnerInfo>(`/templates/${templateId}`)\n .then((r) => r.data);\n\n/**\n * Represents a document to be attached to a template via an externally-accessible URI. A copy of the document will be\n * downloaded from the specified URI. Note that the URI will be accessed without headers or other authorization methods\n * set, so the URI itself must encode any security tokens or keys required to access the file.\n */\nexport interface IDocumentFromUri {\n /** The URI to retrieve the file from. */\n uri: string;\n /** A name for the attachment. */\n name: string;\n}\n\n/**\n * Represents a document to be attached to a template via a Base64-encoded string attachment. This is the best option\n * for maximum security but there is a 10MB size limit for the entire creation request. Requests attaching larger files\n * should use `IDocumentFromUri` or add attachments via `createTemplateDocument` after creating the template.\n */\nexport interface IDocumentFromData {\n /** Base64-encoded file data. */\n data: string;\n /** A name for the attachment. */\n name: string;\n}\n\nexport interface ITemplateCreateParams {\n /** Name for the template to create. */\n name: string;\n /**\n * Optional (defaults to true). Personal templates are only visible to the owner. Non-personal templates are shared\n * within the user's organization.\n */\n is_personal?: boolean;\n /**\n * Optional (defaults to false). Public templates may be found (via search) and viewed by anyone.\n */\n is_public?: boolean;\n /** Optional (defaults to EVERYONE_AS_CREATOR). Who may create and send envelopes using this template. */\n sender?: TTemplateSenderType;\n /** Optional description for the template to help identify it. */\n description?: string;\n /**\n * Optional list of roles to create. Documents are required if roles or fields will also be specified. Files may\n * be attached via a number of methods (browser File object, remote URI reference, or Base64-encoded string) but\n * all entries must of of the same type. If browser File objects are provided, the request will use a FORM POST\n * call, otherwise it will use traditional XHR.\n */\n documents?: File[] | IDocumentFromUri[] | IDocumentFromData[];\n /**\n * Optional list of roles to create. Note that if roles are not included in the request, fields will be ignored.\n */\n roles?: IRole[];\n /**\n * Optional list of fields to create.\n */\n fields?: ITemplateField[];\n}\n\nconst ALLOWED_CREATE_FIELDS: (keyof ITemplateCreateParams)[] = [\n 'name',\n 'is_personal',\n 'is_public',\n 'sender',\n 'description',\n 'roles',\n 'fields',\n];\n\n/**\n * Create a template.\n *\n * ```typescript\n * import {Templates} from '@verdocs/js-sdk/Templates';\n *\n * const newTemplate = await Templates.createTemplate((VerdocsEndpoint.getDefault(), {...});\n * ```\n */\nexport const createTemplate = (\n endpoint: VerdocsEndpoint,\n params: ITemplateCreateParams,\n onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void,\n) => {\n const options = {\n timeout: 120000,\n onUploadProgress: (event: any) => {\n const total = event.total || 1;\n const loaded = event.loaded || 0;\n onUploadProgress?.(Math.floor((loaded * 100) / (total || 1)), loaded, total || 1);\n },\n };\n\n if (params.documents && params.documents[0] instanceof File) {\n if (params.documents.length > 10) {\n throw new Error('createTemplate() has a maximum of 10 documents that can be attached.');\n }\n\n const formData = new FormData();\n ALLOWED_CREATE_FIELDS.forEach((allowedKey) => {\n if (params[allowedKey as keyof ITemplateCreateParams] !== undefined) {\n formData.append(allowedKey, params[allowedKey] as any);\n }\n });\n\n params.documents.forEach((file) => {\n formData.append('documents', file as never as File, file.name);\n });\n\n return endpoint.api.post<ITemplate>('/templates', formData, options).then((r) => r.data);\n } else {\n return endpoint.api.post<ITemplate>('/templates', params, options).then((r) => r.data);\n }\n};\n\n/**\n * Create a template.\n *\n * ```typescript\n * import {Templates} from '@verdocs/js-sdk/Templates';\n *\n * const newTemplate = await Templates.createTemplatev2((VerdocsEndpoint.getDefault(), {...});\n * ```\n */\nexport const createTemplatev2 = (\n endpoint: VerdocsEndpoint,\n params: ITemplateCreateParams,\n onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void,\n) => {\n const options = {\n timeout: 120000,\n onUploadProgress: (event: any) => {\n const total = event.total || 1;\n const loaded = event.loaded || 0;\n onUploadProgress?.(Math.floor((loaded * 100) / (total || 1)), loaded, total || 1);\n },\n };\n\n if (params.documents && params.documents[0] instanceof File) {\n const formData = new FormData();\n ALLOWED_CREATE_FIELDS.forEach((allowedKey) => {\n if (params[allowedKey as keyof ITemplateCreateParams] !== undefined) {\n formData.append(allowedKey, params[allowedKey] as any);\n }\n });\n\n params.documents.forEach((file) => {\n formData.append('documents', file as never as File, file.name);\n });\n\n return endpoint.api.post<ITemplate>('/v2/templates', formData, options).then((r) => r.data);\n } else {\n return endpoint.api.post<ITemplate>('/v2/templates', params, options).then((r) => r.data);\n }\n};\n\nexport interface ITemplateCreateFromSharepointParams {\n /** Name for the template to create. */\n name: string;\n /** The site ID the source file is in. */\n siteId: string;\n /** The item ID of the source file. */\n itemId: string;\n /**\n * On-Behalf-Of access token generated for the request. This must have an audience of \"https://graph.microsoft.com\"\n * with Read access to the source file. This token is used ephemerally and discarded after the request, but it is\n * still recommended that you generate it with the minimal permissions possible.\n */\n oboToken: string;\n}\n\n/**\n * Create a template from a Sharepoint asset.\n *\n * ```typescript\n * import {Templates} from '@verdocs/js-sdk/Templates';\n *\n * const newTemplate = await Templates.createTemplateFromSharepoint((VerdocsEndpoint.getDefault(), {...});\n * ```\n */\nexport const createTemplateFromSharepoint = (endpoint: VerdocsEndpoint, params: ITemplateCreateFromSharepointParams) => {\n const options = {\n timeout: 120000,\n };\n\n return endpoint.api.post<ITemplate>('/templates/from-sharepoint', params, options).then((r) => r.data);\n};\n\n/**\n * Update a template.\n *\n * ```typescript\n * import {Templates} from '@verdocs/js-sdk/Templates';\n *\n * const updatedTemplate = await Templates.updateTemplate((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9', { name: 'New Name' });\n * ```\n */\nexport const updateTemplate = (endpoint: VerdocsEndpoint, templateId: string, params: Partial<ITemplateCreateParams>) =>\n endpoint.api //\n .put<ITemplate>(`/templates/${templateId}`, params)\n .then((r) => r.data);\n\n/**\n * Delete a template.\n *\n * ```typescript\n * import {Templates} from '@verdocs/js-sdk/Templates';\n *\n * await Templates.deleteTemplate((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9');\n * ```\n */\nexport const deleteTemplate = (endpoint: VerdocsEndpoint, templateId: string) =>\n endpoint.api //\n .delete(`/templates/${templateId}`)\n .then((r) => r.data);\n\n/**\n * Search for templates matching various criteria.\n *\n * ```typescript\n * import {Templates} from '@verdocs/js-sdk/Templates';\n *\n * const {result, page, total} = await Templates.search((VerdocsEndpoint.getDefault(), { ... });\n * ```\n */\nexport const searchTemplates = async (endpoint: VerdocsEndpoint, params: ITemplateSearchParams) =>\n endpoint.api //\n .post<ITemplateSearchResult>('/templates/search', params)\n .then((r) => r.data);\n\nexport interface ISearchTimeRange {\n start_time: string;\n end_time: string;\n}\n\nexport type IGetTemplateSummarySortBy = 'created_at' | 'updated_at' | 'name' | 'last_used_at' | 'counter' | 'star_counter';\n\nexport interface IGetTemplateSummaryParams {\n id?: string;\n name?: string;\n sender?: string;\n profile_id?: string;\n organization_id?: string;\n description?: string;\n created_at?: ISearchTimeRange;\n updated_at?: ISearchTimeRange;\n last_used_at?: ISearchTimeRange;\n is_personal?: boolean;\n is_public?: boolean;\n is_starred?: boolean;\n sort_by?: IGetTemplateSummarySortBy;\n ascending?: boolean;\n row?: number;\n page?: number;\n}\n\n/**\n * Get a summary of template data, typically used to populate admin panel dashboard pages.\n *\n * ```typescript\n * import {Templates} from '@verdocs/js-sdk/Templates';\n *\n * const summary = await Templates.getSummary((VerdocsEndpoint.getDefault(), 0);\n * ```\n */\nexport const getTemplatesSummary = async (endpoint: VerdocsEndpoint, params: IGetTemplateSummaryParams = {}) =>\n endpoint.api //\n .post<ITemplateSummary>('/templates/summary', params)\n .then((r) => r.data);\n\nconst cachedTemplates: Record<string, {loaded: number; template: ITemplate}> = {};\n\n/**\n * Wrapper for `getTemplate()` that limits queries to one every 2 seconds per template ID.\n * This is intended for use in component hierarchies that all rely on the same template\n * to avoid unnecessary repeat server calls.\n */\nexport const throttledGetTemplate = (endpoint: VerdocsEndpoint, templateId: string) => {\n if (cachedTemplates[templateId] && cachedTemplates[templateId].loaded + 2000 < new Date().getTime()) {\n return cachedTemplates[templateId].template;\n }\n\n return getTemplate(endpoint, templateId).then((template) => {\n cachedTemplates[templateId] = {loaded: new Date().getTime(), template};\n return template;\n });\n};\n\nexport interface ITemplateListParams {\n status?: string[];\n q?: string;\n created_at?: ITimePeriod;\n is_personal?: boolean;\n is_public?: boolean;\n sort_by?: TSortTemplateBy;\n ascending?: boolean;\n rows?: number;\n page?: number;\n}\n\n/**\n * List templates.\n *\n * ```typescript\n * import {Templates} from '@verdocs/js-sdk/Templates';\n *\n * const {totals, templates} = await Templates.listTemplates((VerdocsEndpoint.getDefault(), { q: 'test', sort: 'created_at' }); * ```\n */\nexport const listTemplates = async (endpoint: VerdocsEndpoint, params: ITemplateListParams = {}) =>\n endpoint.api //\n .post<{total: number; rows: number; page: number; templates: ITemplate[]}>('/templates/list', params)\n .then((r) => r.data);\n","/**\n * A TemplateDocument represents a PDF or other attachment in a Template.\n *\n * @module\n */\n\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {ITemplateDocument} from '../Models';\n\n/**\n * Get all the Template Documents associated to a particular Template.\n *\n * ```typescript\n * import {TemplateDocument} from '@verdocs/js-sdk/Templates';\n *\n * await TemplateDocument.geTemplateDocuments((VerdocsEndpoint.getDefault(), templateId);\n * ```\n */\nexport const getTemplateDocuments = (endpoint: VerdocsEndpoint, templateId: string) =>\n endpoint.api //\n .get<ITemplateDocument[]>(`/templates/${templateId}/documents/`)\n .then((r) => r.data);\n\n/**\n * Get a specific Document.\n *\n * ```typescript\n * import {TemplateDocument} from '@verdocs/js-sdk/Templates';\n *\n * await TemplateDocument.geTemplateDocument((VerdocsEndpoint.getDefault(), templateId,documentId);\n * ```\n */\nexport const getTemplateDocument = (endpoint: VerdocsEndpoint, templateId: string, documentId: string) =>\n endpoint.api //\n .get<ITemplateDocument>(`/templates/${templateId}/documents/${documentId}`)\n .then((r) => r.data);\n\n/**\n * Create a Document for a particular Template.\n *\n * ```typescript\n * import {TemplateDocument} from '@verdocs/js-sdk/Templates';\n *\n * await TemplateDocument.createDocument((VerdocsEndpoint.getDefault(), templateID, params);\n * ```\n */\nexport const createTemplateDocument = (\n endpoint: VerdocsEndpoint,\n templateId: string,\n file: File,\n onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void,\n) => {\n const formData = new FormData();\n formData.append('document', file, file.name);\n\n return endpoint.api //\n .post<ITemplateDocument>(`/templates/${templateId}/documents`, formData, {\n timeout: 120000,\n onUploadProgress: (event) => {\n const total = event.total || 1;\n const loaded = event.loaded || 0;\n onUploadProgress?.(Math.floor((loaded * 100) / (total || 1)), loaded, total || 1);\n },\n })\n .then((r) => r.data);\n};\n\n/**\n * Delete a specific Document.\n *\n * ```typescript\n * import {TemplateDocument} from '@verdocs/js-sdk/Templates';\n *\n * await TemplateDocument.deleteDocument((VerdocsEndpoint.getDefault(), templateID, documentID);\n * ```\n */\nexport const deleteTemplateDocument = (endpoint: VerdocsEndpoint, templateId: string, documentId: string) =>\n endpoint.api //\n .delete(`/templates/${templateId}/documents/${documentId}`)\n .then((r) => r.data);\n\n/**\n * Get (binary download) a file attached to a Template. It is important to use this method\n * rather than a direct A HREF or similar link to set the authorization headers for the\n * request.\n */\nexport const getTemplateDocumentFile = async (endpoint: VerdocsEndpoint, templateId: string, documentId: string) =>\n endpoint.api //\n .get(`/templates/${templateId}/documents/${documentId}?file=true`, {responseType: 'blob'})\n .then((r) => r.data);\n\n/**\n * Get (binary download) a file attached to a Template. It is important to use this method\n * rather than a direct A HREF or similar link to set the authorization headers for the\n * request.\n */\nexport const getTemplateDocumentThumbnail = async (endpoint: VerdocsEndpoint, templateId: string, documentId: string) =>\n endpoint.api //\n .get(`/templates/${templateId}/documents/${documentId}?thumbnail=true`, {responseType: 'blob'})\n .then((r) => r.data);\n\n/**\n * Get a display URI for a given page in a file attached to a template document. These pages are rendered server-side\n * into PNG resources suitable for display in IMG tags although they may be used elsewhere. Note that these are intended\n * for DISPLAY ONLY, are not legally binding documents, and do not contain any encoded metadata from participants. The\n * original asset may be obtained by calling `getTemplateDocumentFile()` or similar.\n */\nexport const getTemplateDocumentPageDisplayUri = async (endpoint: VerdocsEndpoint, templateId: string, documentId: string, page: number) =>\n endpoint.api.get<string>(`/templates/${templateId}/documents/${documentId}/pages/${page}/image`).then((r) => r.data);\n","import {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {IRole} from '../Models';\n\nexport interface IValidator {\n name: string;\n regex: string;\n}\n\n/**\n * Get all defined validators\n *\n * ```typescript\n * import {Documents} from '@verdocs/js-sdk/Templates';\n *\n * await Documents.getDocuments(templateID);\n * ```\n */\nexport const getValidators = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IValidator[]>('/validators')\n .then((r) => r.data);\n\nexport const getValidator = (endpoint: VerdocsEndpoint, validatorName: string) =>\n endpoint.api //\n .get<IValidator>(`/validators/${validatorName}`)\n .then((r) => r.data);\n\nconst EMAIL_REGEX =\n /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n\nexport const isValidEmail = (email: string | undefined) => !!email && EMAIL_REGEX.test(email);\n\n// @see https://www.regextester.com/1978\nconst PHONE_REGEX =\n /((?:\\+|00)[17](?: |\\-)?|(?:\\+|00)[1-9]\\d{0,2}(?: |\\-)?|(?:\\+|00)1\\-\\d{3}(?: |\\-)?)?(0\\d|\\([0-9]{3}\\)|[1-9]{0,3})(?:((?: |\\-)[0-9]{2}){4}|((?:[0-9]{2}){4})|((?: |\\-)[0-9]{3}(?: |\\-)[0-9]{4})|([0-9]{7}))/;\n\nexport const isValidPhone = (phone: string | undefined) => !!phone && PHONE_REGEX.test(phone);\n\nexport const isValidRoleName = (value: string, roles: IRole[]) => roles.findIndex((role) => role.name === value) !== -1;\n\nconst TagRegEx = /^[a-zA-Z0-9-]{0,32}$/;\n\nexport const isValidTag = (value: string, tags: string[]) => TagRegEx.test(value) || tags.findIndex((tag) => tag === value) !== -1;\n","import type {IAuthenticateResponse, UpdatePasswordResponse, IAuthenticateAppRequest, IAuthenticateUserRequest} from './Types';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {IUpdatePasswordRequest} from './Types';\n\n/**\n * Authenticate to Verdocs via user/password authentication\n *\n * ```typescript\n * import {Auth} from '@verdocs/js-sdk/Auth';\n * import {Transport} from '@verdocs/js-sdk/HTTP';\n *\n * const {accessToken} = await Auth.authenticateUser({ username: 'test@test.com', password: 'PASSWORD' });\n * Transport.setAuthToken(accessToken);\n * ```\n */\nexport const authenticateUser = (endpoint: VerdocsEndpoint, params: IAuthenticateUserRequest) =>\n endpoint.api //\n .post<IAuthenticateResponse>('/authentication/login', params)\n .then((r) => r.data);\n\n/**\n * Authenticate to Verdocs via client ID / Secret authentication. **NOTE: This is only suitable for\n * NodeJS server-side applications. Never expose your Client Secret in a Web or Mobile app!** Also note\n * that access tokens may be cached by server-side apps (and this is recommended) but do expire after 2\n * hours. This expiration may change based on future security needs. Application developers are encouraged\n * to check the `exp` expiration field in the response, and renew tokens after they expire.\n *\n * ```typescript\n * import {Auth} from '@verdocs/js-sdk/Auth';\n * import {Transport} from '@verdocs/js-sdk/HTTP';\n *\n * const {accessToken} = await Auth.authenticateApp({ client_id: 'CLIENTID', client_secret: 'SECRET' });\n * Transport.setAuthToken(accessToken);\n * ```\n */\nexport const authenticateApp = (endpoint: VerdocsEndpoint, params: IAuthenticateAppRequest): Promise<IAuthenticateResponse> =>\n endpoint.api //\n .post('/authentication/login_client', {}, {headers: params as any})\n .then((r) => r.data);\n\n/**\n * If called before the session expires, this will refresh the caller's session and tokens.\n *\n * ```typescript\n * import {Auth} from '@verdocs/js-sdk/Auth';\n * import {Transport} from '@verdocs/js-sdk/HTTP';\n *\n * const {accessToken} = await Auth.refreshTokens();\n * Transport.setAuthToken(accessToken);\n * ```\n */\nexport const refreshTokens = (endpoint: VerdocsEndpoint): Promise<IAuthenticateResponse> =>\n endpoint.api //\n .get('/token')\n .then((r) => r.data);\n\n/**\n * Update the caller's password when the old password is known (typically for logged-in users).\n *\n * ```typescript\n * import {Auth} from '@verdocs/js-sdk/Auth';\n *\n * const {status, message} = await Auth.updatePassword({ email, oldPassword, newPassword });\n * if (status !== 'OK') {\n * window.alert(`Password reset error: ${message}`);\n * }\n * ```\n */\nexport const changePassword = (endpoint: VerdocsEndpoint, params: IUpdatePasswordRequest): Promise<UpdatePasswordResponse> =>\n endpoint.api //\n .put('/user/update_password', params)\n .then((r) => r.data);\n\n/**\n * Request a password reset, when the old password is not known (typically in login forms).\n *\n * ```typescript\n * import {Auth} from '@verdocs/js-sdk/Auth';\n *\n * const {success} = await Auth.resetPassword({ email });\n * if (status !== 'OK') {\n * window.alert(`Please check your email for instructions on how to reset your password.`);\n * }\n * ```\n */\nexport const resetPassword = (endpoint: VerdocsEndpoint, params: {email: string}): Promise<{success: boolean}> =>\n endpoint.api //\n .post('/user/reset_password', params)\n .then((r) => r.data);\n\n/**\n * Resend the email verification request. Note that to prevent certain forms of abuse, the email address is not\n * a parameter here. Instead, the caller must be authenticated as the (unverified) user. To simplify this process,\n * the access token to be used may be passed directly as a parameter here. This avoids the need to set it as the\n * active token on an endpoint, which may be inconvenient in workflows where it is preferable to keep the user in\n * \"anonymous\" mode while verification is being performed.\n *\n * ```typescript\n * import {Auth} from '@verdocs/js-sdk/Auth';\n *\n * const result = await Auth.resendVerification();\n * ```\n */\nexport const resendVerification = (endpoint: VerdocsEndpoint, accessToken?: string): Promise<{result: 'done'}> =>\n endpoint.api //\n .post('/user/email_verification', {}, accessToken ? {headers: {Authorization: `Bearer ${accessToken}`}} : {})\n .then((r) => r.data);\n","import {VerdocsEndpoint} from '../VerdocsEndpoint';\n\nexport const getNotifications = async (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get('/v2/notifications')\n .then((r) => r.data);\n","import type {ICreateAccountRequest, ICreateProfileRequest, ISwitchProfileResponse, IUpdateProfileRequest} from './Types';\nimport type {IOrganization, IProfile} from '../Models';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\n\n/**\n * Get the user's available profiles. The current profile will be marked with `current: true`.\n *\n * ```typescript\n * import {Profiles} from '@verdocs/js-sdk/Users';\n *\n * const profiles = await Profiles.getProfiles()\n * ```\n */\nexport const getProfiles = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IProfile[]>('/v2/profiles')\n .then((r) => r.data);\n\n/**\n * Get the user's available profiles. The current profile will be marked with `current: true`.\n *\n * ```typescript\n * import {Profiles} from '@verdocs/js-sdk/Users';\n *\n * const profiles = await Profiles.getCurrentProfile()\n * ```\n */\nexport const getCurrentProfile = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IProfile[]>('/v2/profiles')\n .then((r) => (r.data || []).find((profile) => profile.current));\n\n/**\n * Create a profile. If the caller does not have a \"current\" profile set, the new profile will be made current.\n *\n * ```typescript\n * import {Profiles} from '@verdocs/js-sdk/Users';\n *\n * const newProfile = await Profiles.createProfile({ first_name: 'FIRST', last_name: 'LAST', email: 'EMAIL' });\n * ```\n */\nexport const createProfile = (endpoint: VerdocsEndpoint, params: ICreateProfileRequest) =>\n endpoint.api //\n .post<IProfile>('/v2/profiles', params)\n .then((r) => r.data);\n\n/**\n * Get a profile. The caller must have admin access to the given profile.\n * TODO: Add a \"public\" profile endpoint for public pages\n *\n * ```typescript\n * import {Profiles} from '@verdocs/js-sdk/Users';\n *\n * const profile = await Profiles.getProfile('PROFILEID');\n * ```\n */\nexport const getProfile = (endpoint: VerdocsEndpoint, profileId: string) =>\n endpoint.api //\n .get<IProfile>(`/v2/profiles/${profileId}`)\n .then((r) => r.data);\n\n/**\n * Switch the caller's \"current\" profile. The current profile is used for permissions checking and profile_id field settings\n * for most operations in Verdocs. It is important to select the appropropriate profile before calling other API functions.\n *\n * ```typescript\n * import {Profiles} from '@verdocs/js-sdk/Users';\n *\n * const newProfile = await Profiles.switchProfile('PROFILEID');\n * ```\n */\nexport const switchProfile = (endpoint: VerdocsEndpoint, profileId: string) =>\n endpoint.api //\n .post<ISwitchProfileResponse>(`/v2/profiles/${profileId}/switch`)\n .then((r) => r.data);\n\n/**\n * Update a profile. For future expansion, the profile ID to update is required, but currently this must also be the\n * \"current\" profile for the caller.\n *\n * ```typescript\n * import {Profiles} from '@verdocs/js-sdk/Users';\n *\n * const newProfile = await Profiles.updateProfile('PROFILEID');\n * ```\n */\nexport const updateProfile = (endpoint: VerdocsEndpoint, profileId: string, params: IUpdateProfileRequest) =>\n endpoint.api //\n .patch<IProfile>(`/v2/profiles/${profileId}`, params)\n .then((r) => r.data);\n\n/**\n * Delete a profile. If the requested profile is the caller's curent profile, the next available profile will be selected.\n *\n * ```typescript\n * import {Profiles} from '@verdocs/js-sdk/Users';\n *\n * await Profiles.deleteProfile('PROFILEID');\n * ```\n */\nexport const deleteProfile = (endpoint: VerdocsEndpoint, profileId: string) =>\n endpoint.api //\n .delete(`/v2/profiles/${profileId}`)\n .then((r) => r.data);\n\n/**\n * Create a user account and parent organization. This endpoint is for creating a new organization. Users joining an\n * existing organization should be invited, and follow their invitation links/instructions to create their accounts.\n *\n * ```typescript\n * import {Profiles} from '@verdocs/js-sdk/Users';\n *\n * const newAccount = await Profiles.createBusinessAccount({\n * orgName: 'ORG', email: 'a@b.com', password: '12345678', firstName: 'FIRST', lastName: 'LAST'\n * });\n * ```\n */\nexport const createAccount = (endpoint: VerdocsEndpoint, params: ICreateAccountRequest) =>\n endpoint.api //\n .post<{profile: IProfile; organization: IOrganization}>('/user/business', params)\n .then((r) => r.data);\n\nexport interface ISignupSurvey {\n industry?: string;\n size?: string;\n source?: string;\n referral?: string;\n coupon?: string;\n reason?: string;\n hearabout?: string;\n}\n\nexport const recordSignupSurvey = (endpoint: VerdocsEndpoint, params: ISignupSurvey) =>\n endpoint.api //\n .post<{status: 'OK'}>('/user/signup', params)\n .then((r) => r.data);\n"],"names":["globalThis"],"mappings":";;AAEA;;AAEG;AACG,SAAU,MAAM,CAAC,IAAY,EAAA;IACjC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACzE,IAAA,MAAM,SAAS,GAAG;AAChB,QAAA,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;AACnB,QAAA,KAAK,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;AACrB,QAAA,IAAI,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;AACpB,QAAA,KAAK,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;KACtB,CAAC;AACF,IAAA,MAAM,KAAK,GAAG,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC;IAClC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,KAAK,IAAI,SAAS,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,KAAK,IAAI,GAAG,CAAC,CAAC;IAChF,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,KAAK,IAAI,SAAS,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,KAAK,IAAI,GAAG,CAAC,CAAC;IACpF,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,KAAK,IAAI,SAAS,CAAC,IAAI,GAAG,GAAG,CAAC,GAAG,KAAK,IAAI,GAAG,CAAC,CAAC;AAClF,IAAA,OAAO,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,KAAK,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ts","../src/Utils/Files.ts","../src/Utils/Locales.ts","../src/Utils/Strings.ts","../src/Utils/Primitives.ts","../src/Utils/Token.ts","../src/Utils/globalThis.js","../src/VerdocsEndpoint.ts","../src/Envelopes/Envelopes.ts","../src/Envelopes/Initials.ts","../src/Envelopes/Recipients.ts","../src/Envelopes/Reminders.ts","../src/Envelopes/Permissions.ts","../src/Envelopes/Signatures.ts","../src/Organizations/ApiKeys.ts","../src/Organizations/Groups.ts","../src/Organizations/Invitations.ts","../src/Organizations/Members.ts","../src/Organizations/Organizations.ts","../src/Organizations/Webhooks.ts","../src/Sessions/Permissions.ts","../src/Templates/Actions.ts","../src/Templates/Fields.ts","../src/Templates/Permissions.ts","../src/Templates/Reminders.ts","../src/Templates/Roles.ts","../src/Templates/Stars.ts","../src/Templates/Tags.ts","../src/Templates/Templates.ts","../src/Templates/TemplateDocuments.ts","../src/Templates/Validators.ts","../src/Users/Auth.ts","../src/Users/Notifications.ts","../src/Users/Profiles.ts"],"sourcesContent":["import type {TRole} from '../BaseTypes';\n\n/**\n * Given a `rgba(r,g,b,a)` string value, returns the hex equivalent, dropping the alpha channel.\n */\nexport function getRGB(rgba: string) {\n const rgbNumbers = rgba.replace('rgba(', '').replace(')', '').split(',');\n const rgbObject = {\n red: +rgbNumbers[0],\n green: +rgbNumbers[1],\n blue: +rgbNumbers[2],\n alpha: +rgbNumbers[3],\n };\n const alpha = 1 - rgbObject.alpha;\n const red = Math.round((rgbObject.alpha * (rgbObject.red / 255) + alpha) * 255);\n const green = Math.round((rgbObject.alpha * (rgbObject.green / 255) + alpha) * 255);\n const blue = Math.round((rgbObject.alpha * (rgbObject.blue / 255) + alpha) * 255);\n return '#' + rgbToHex(red) + rgbToHex(green) + rgbToHex(blue);\n}\n\n/**\n * Given an RGB string value, returns the hex equivalent.\n */\nfunction rgbToHex(rgb: number) {\n const hex = rgb.toString(16);\n if (hex.length < 2) {\n return '0' + hex;\n }\n return hex;\n}\n\n/**\n * Given a signer role index, return the color code for that signer.\n */\nexport function getRGBA(roleIndex: number) {\n switch (roleIndex % 10) {\n case 0:\n return roleIndex === 0 ? 'rgba(255, 193, 7, 0.4)' : 'rgba(134, 134, 134, 0.3)'; // #FFE69C\n case 1:\n return 'rgba(156, 39, 176, .4)'; // '#E3C3E9'\n case 2:\n return 'rgba(33, 150, 243, .4)'; // '#C1E1FB'\n case 3:\n return 'rgba(220, 231, 117, 0.3)';\n case 4:\n return 'rgba(121, 134, 203, 0.3)';\n case 5:\n return 'rgba(77, 182, 172, 0.3)';\n case 6:\n return 'rgba(255, 202, 165, 0.3)';\n case 7:\n return 'rgba(2, 247, 190, 0.3)';\n case 8:\n return 'rgba(255, 138, 101, 0.3)';\n case 9:\n return 'rgba(82, 255, 79, 0.3)';\n default:\n return 'rgba(229, 115, 155, 0.3)';\n }\n}\n\n/**\n * Given a role name, return a color code for it. This works by computing a hash code so the specific color returned\n * is not specified explicitly, but will be the same for every call with the same input value.\n */\nexport function nameToRGBA(str: string) {\n if (!!str) {\n const validNum = parseInt(str.slice(-1), 10);\n if (!isNaN(validNum)) {\n str += (validNum * 99).toString();\n }\n let hash = 0;\n for (let i = 0; i < str.length; i++) {\n // tslint:disable-next-line:no-bitwise\n hash = str.charCodeAt(i) + ((hash << 5) - hash);\n }\n hash = Math.round(hash / 1.3);\n // tslint:disable-next-line:no-bitwise\n const c = (hash & 0x00ffff08).toString(16).toUpperCase();\n const hex = '#' + '00000'.substring(0, 6 - c.length) + c;\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex) as any[];\n const color = {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16),\n };\n return `rgba(${color.r}, ${color.g}, ${color.b}, 0.2)`;\n }\n}\n\n/**\n * Helper function to obtain a color code given a role name given various possible inputs.\n */\nexport function getRoleColor(name: string, roles: TRole[], index?: number) {\n if (index) {\n return getRGBA(index);\n } else if (roles && roles.length > 0) {\n const roleIndex = roles.findIndex((role) => role === name);\n if (roleIndex > -1) {\n return getRGBA(roleIndex);\n } else {\n return nameToRGBA(name);\n }\n } else {\n return nameToRGBA(name);\n }\n}\n","import type {ITimePeriod} from './Types';\n\nconst YEAR = 365 * 24 * 60 * 60;\n// const MONTH = 30 * 24 * 60 * 60;\nconst WEEK = 7 * 24 * 60 * 60;\nconst DAY = 24 * 60 * 60;\nconst HOUR = 60 * 60;\nconst MINUTE = 60;\n\nexport const formatShortTimeAgo = (val: any) => {\n if (val === undefined || val === null) {\n return '';\n }\n\n let dateInput;\n if (typeof val === 'string' || typeof val === 'number') {\n dateInput = new Date(val);\n } else if (typeof val === 'object') {\n dateInput = val;\n } else {\n return '';\n }\n\n const timeDiff = Math.floor((new Date().getTime() - dateInput.getTime()) / 1000);\n if (timeDiff >= YEAR) {\n return Math.floor(timeDiff / YEAR) + 'Y';\n }\n // if (timeDiff >= MONTH) {\n // return Math.floor(timeDiff / MONTH) + 'M';\n // }\n if (timeDiff >= WEEK) {\n return Math.floor(timeDiff / WEEK) + 'W';\n }\n if (timeDiff >= DAY) {\n return Math.floor(timeDiff / DAY) + 'D';\n }\n if (timeDiff >= HOUR) {\n return Math.floor(timeDiff / HOUR) + 'H';\n }\n if (timeDiff >= MINUTE) {\n return Math.floor(timeDiff / MINUTE) + 'M';\n }\n\n return `${timeDiff}S`;\n};\n\nexport function timePeriod(type: string): ITimePeriod | null {\n let endDate = new Date().getTime();\n const today = new Date();\n const month = today.getMonth();\n const year = today.getFullYear();\n let startDate = null;\n switch (type) {\n case '30d':\n startDate = endDate - 60 * 60 * 24 * 30 * 1000;\n break;\n\n case '60d':\n startDate = endDate - 60 * 60 * 24 * 60 * 1000;\n break;\n\n case '6m':\n startDate = endDate - 60 * 60 * 24 * 30 * 6 * 1000;\n break;\n\n case 'this_month':\n startDate = new Date(year, month, 1).getTime();\n break;\n\n case 'last_month':\n startDate = new Date(year, month - 1, 1).getTime();\n endDate = new Date(year, month, 0).getTime();\n break;\n\n case 'this_year':\n startDate = new Date(year, 0, 1);\n break;\n\n case 'all_time':\n default:\n return null;\n }\n\n if (startDate === null && endDate === null) {\n return null;\n }\n\n return {\n start_time: new Date(startDate).toISOString(),\n end_time: new Date(endDate).toISOString(),\n } as ITimePeriod;\n}\n","export function getRTop(y: number, fieldHeight: number, iTextHeight: number, yRatio: number) {\n return iTextHeight - (y + fieldHeight) * yRatio;\n}\n\nexport function getRLeft(x: number, ratio: number) {\n return x * ratio;\n}\n\nexport function getRValue(y: number, ratio: number) {\n return y * ratio;\n}\n\nexport function blobToBase64(image: Blob) {\n const fileReader = new FileReader();\n return new Promise((resolve, reject) => {\n fileReader.onerror = () => {\n reject(new DOMException('Problem reading blob.'));\n };\n\n fileReader.onload = () => {\n resolve(fileReader.result);\n };\n\n fileReader.readAsDataURL(image);\n });\n}\n\nexport function rescale(r: number, n: number): number {\n return r * n;\n}\n","import type {IFileWithData} from './Types';\n\n/**\n * Given a File, extract the file's content as a base64 encoded data URL. The response will have a prefix that\n * includes the MIME type of the file, e.g. \"data:image/jpeg;base64,iVBORw0K......\"\n */\nexport const fileToDataUrl = (file: File): Promise<IFileWithData> =>\n new Promise((resolve, reject) => {\n const reader = new FileReader();\n\n reader.onload = () =>\n resolve({\n lastModified: file.lastModified,\n size: file.size,\n type: file.type,\n name: file.name,\n data: reader.result as string,\n });\n\n reader.onerror = reject;\n\n if (file) {\n reader.readAsDataURL(file);\n } else {\n reject(new Error('Invalid file'));\n }\n });\n\n/**\n * Trigger a download dialog to save a blob as a file on disk.\n */\nexport const downloadBlob = (blob: Blob, name = 'file.pdf') => {\n const blobUrl = URL.createObjectURL(blob);\n const link = document.createElement('a');\n\n link.href = blobUrl;\n link.download = name;\n document.body.appendChild(link);\n\n link.dispatchEvent(\n new MouseEvent('click', {\n bubbles: true,\n cancelable: true,\n view: window,\n }),\n );\n\n document.body.removeChild(link);\n};\n","import type {ICountry} from './Types';\n\nexport const Countries: ICountry[] = [\n {code: '+7 840', name: 'Abkhazia', value: '+7'},\n {code: '+93', name: 'Afghanistan', value: '+93'},\n {code: '+355', name: 'Albania', value: '+355'},\n {code: '+213', name: 'Algeria', value: '+213'},\n {code: '+1', name: 'American Samoa', value: '+1'},\n {code: '+376', name: 'Andorra', value: '+376'},\n {code: '+244', name: 'Angola', value: '+244'},\n {code: '+1', name: 'Anguilla', value: '+1'},\n {code: '+1', name: 'Antigua and Barbuda', value: '+1'},\n {code: '+54', name: 'Argentina', value: '+54'},\n {code: '+374', name: 'Armenia', value: '+374'},\n {code: '+297', name: 'Aruba', value: '+297'},\n {code: '+247', name: 'Ascension', value: '+247'},\n {code: '+61', name: 'Australia', value: '+61'},\n {code: '+672', name: 'Australian External Territories', value: '+672'},\n {code: '+43', name: 'Austria', value: '+43'},\n {code: '+994', name: 'Azerbaijan', value: '+994'},\n {code: '+1', name: 'Bahamas', value: '+1'},\n {code: '+973', name: 'Bahrain', value: '+973'},\n {code: '+880', name: 'Bangladesh', value: '+880'},\n {code: '+1', name: 'Barbados', value: '+1'},\n {code: '+1', name: 'Barbuda', value: '+1'},\n {code: '+375', name: 'Belarus', value: '+375'},\n {code: '+32', name: 'Belgium', value: '+32'},\n {code: '+501', name: 'Belize', value: '+501'},\n {code: '+229', name: 'Benin', value: '+229'},\n {code: '+1', name: 'Bermuda', value: '+1'},\n {code: '+975', name: 'Bhutan', value: '+975'},\n {code: '+591', name: 'Bolivia', value: '+591'},\n {code: '+387', name: 'Bosnia and Herzegovina', value: '+387'},\n {code: '+267', name: 'Botswana', value: '+267'},\n {code: '+55', name: 'Brazil', value: '+55'},\n {code: '+246', name: 'British Indian Ocean Territory', value: '+246'},\n {code: '+1', name: 'British Virgin Islands', value: '+1'},\n {code: '+673', name: 'Brunei', value: '+673'},\n {code: '+359', name: 'Bulgaria', value: '+359'},\n {code: '+226', name: 'Burkina Faso', value: '+226'},\n {code: '+257', name: 'Burundi', value: '+257'},\n {code: '+855', name: 'Cambodia', value: '+855'},\n {code: '+237', name: 'Cameroon', value: '+237'},\n {code: '+1', name: 'Canada', value: '+1'},\n {code: '+238', name: 'Cape Verde', value: '+238'},\n {code: '+1', name: 'Cayman Islands', value: '+1'},\n {code: '+236', name: 'Central African Republic', value: '+236'},\n {code: '+235', name: 'Chad', value: '+235'},\n {code: '+56', name: 'Chile', value: '+56'},\n {code: '+86', name: 'China', value: '+86'},\n {code: '+61', name: 'Christmas Island', value: '+61'},\n {code: '+61', name: 'Cocos-Keeling Islands', value: '+61'},\n {code: '+57', name: 'Colombia', value: '+57'},\n {code: '+269', name: 'Comoros', value: '+269'},\n {code: '+242', name: 'Congo', value: '+242'},\n {code: '+243', name: 'Congo, Dem. Rep. of (Zaire)', value: '+243'},\n {code: '+682', name: 'Cook Islands', value: '+682'},\n {code: '+506', name: 'Costa Rica', value: '+506'},\n {code: '+385', name: 'Croatia', value: '+385'},\n {code: '+53', name: 'Cuba', value: '+53'},\n {code: '+599', name: 'Curacao', value: '+599'},\n {code: '+537', name: 'Cyprus', value: '+537'},\n {code: '+420', name: 'Czech Republic', value: '+420'},\n {code: '+45', name: 'Denmark', value: '+45'},\n {code: '+246', name: 'Diego Garcia', value: '+246'},\n {code: '+253', name: 'Djibouti', value: '+253'},\n {code: '+1', name: 'Dominica', value: '+1'},\n {code: '+1', name: 'Dominican Republic', value: '+1'},\n {code: '+670', name: 'East Timor', value: '+670'},\n {code: '+56', name: 'Easter Island', value: '+56'},\n {code: '+593', name: 'Ecuador', value: '+593'},\n {code: '+20', name: 'Egypt', value: '+20'},\n {code: '+503', name: 'El Salvador', value: '+503'},\n {code: '+240', name: 'Equatorial Guinea', value: '+240'},\n {code: '+291', name: 'Eritrea', value: '+291'},\n {code: '+372', name: 'Estonia', value: '+372'},\n {code: '+251', name: 'Ethiopia', value: '+251'},\n {code: '+500', name: 'Falkland Islands', value: '+500'},\n {code: '+298', name: 'Faroe Islands', value: '+298'},\n {code: '+679', name: 'Fiji', value: '+679'},\n {code: '+358', name: 'Finland', value: '+358'},\n {code: '+33', name: 'France', value: '+33'},\n {code: '+596', name: 'Martinique', value: '+596'},\n {code: '+594', name: 'French Guiana', value: '+594'},\n {code: '+689', name: 'French Polynesia', value: '+689'},\n {code: '+241', name: 'Gabon', value: '+241'},\n {code: '+220', name: 'Gambia', value: '+220'},\n {code: '+995', name: 'Georgia', value: '+995'},\n {code: '+49', name: 'Germany', value: '+49'},\n {code: '+233', name: 'Ghana', value: '+233'},\n {code: '+350', name: 'Gibraltar', value: '+350'},\n {code: '+30', name: 'Greece', value: '+30'},\n {code: '+299', name: 'Greenland', value: '+299'},\n {code: '+1', name: 'Grenada', value: '+1'},\n {code: '+590', name: 'Guadeloupe', value: '+590'},\n {code: '+1', name: 'Guam', value: '+1'},\n {code: '+502', name: 'Guatemala', value: '+502'},\n {code: '+224', name: 'Guinea', value: '+224'},\n {code: '+245', name: 'Guinea-Bissau', value: '+245'},\n {code: '+595', name: 'Guyana', value: '+595'},\n {code: '+509', name: 'Haiti', value: '+509'},\n {code: '+504', name: 'Honduras', value: '+504'},\n {code: '+852', name: 'Hong Kong SAR China', value: '+852'},\n {code: '+36', name: 'Hungary', value: '+36'},\n {code: '+354', name: 'Iceland', value: '+354'},\n {code: '+91', name: 'India', value: '+91'},\n {code: '+62', name: 'Indonesia', value: '+62'},\n {code: '+98', name: 'Iran', value: '+98'},\n {code: '+964', name: 'Iraq', value: '+964'},\n {code: '+353', name: 'Ireland', value: '+353'},\n {code: '+972', name: 'Israel', value: '+972'},\n {code: '+39', name: 'Italy', value: '+39'},\n {code: '+225', name: 'Ivory Coast', value: '+225'},\n {code: '+1', name: 'Jamaica', value: '+1'},\n {code: '+81', name: 'Japan', value: '+81'},\n {code: '+962', name: 'Jordan', value: '+962'},\n {code: '+77', name: 'Kazakhstan', value: '+7'},\n {code: '+254', name: 'Kenya', value: '+254'},\n {code: '+686', name: 'Kiribati', value: '+686'},\n {code: '+965', name: 'Kuwait', value: '+965'},\n {code: '+996', name: 'Kyrgyzstan', value: '+996'},\n {code: '+856', name: 'Laos', value: '+856'},\n {code: '+371', name: 'Latvia', value: '+371'},\n {code: '+961', name: 'Lebanon', value: '+961'},\n {code: '+266', name: 'Lesotho', value: '+266'},\n {code: '+231', name: 'Liberia', value: '+231'},\n {code: '+218', name: 'Libya', value: '+218'},\n {code: '+423', name: 'Liechtenstein', value: '+423'},\n {code: '+370', name: 'Lithuania', value: '+370'},\n {code: '+352', name: 'Luxembourg', value: '+352'},\n {code: '+853', name: 'Macau SAR China', value: '+853'},\n {code: '+389', name: 'Macedonia', value: '+389'},\n {code: '+261', name: 'Madagascar', value: '+261'},\n {code: '+265', name: 'Malawi', value: '+265'},\n {code: '+60', name: 'Malaysia', value: '+60'},\n {code: '+960', name: 'Maldives', value: '+960'},\n {code: '+223', name: 'Mali', value: '+223'},\n {code: '+356', name: 'Malta', value: '+356'},\n {code: '+692', name: 'Marshall Islands', value: '+692'},\n {code: '+596', name: 'Martinique', value: '+596'},\n {code: '+222', name: 'Mauritania', value: '+222'},\n {code: '+230', name: 'Mauritius', value: '+230'},\n {code: '+262', name: 'Mayotte or Réunion', value: '+262'},\n {code: '+52', name: 'Mexico', value: '+52'},\n {code: '+691', name: 'Micronesia', value: '+691'},\n {code: '+1', name: 'Midway Island', value: '+1'},\n {code: '+373', name: 'Moldova', value: '+373'},\n {code: '+377', name: 'Monaco', value: '+377'},\n {code: '+976', name: 'Mongolia', value: '+976'},\n {code: '+382', name: 'Montenegro', value: '+382'},\n {code: '+1', name: 'Montserrat', value: '+1'},\n {code: '+212', name: 'Morocco', value: '+212'},\n {code: '+95', name: 'Myanmar', value: '+95'},\n {code: '+264', name: 'Namibia', value: '+264'},\n {code: '+674', name: 'Nauru', value: '+674'},\n {code: '+977', name: 'Nepal', value: '+977'},\n {code: '+31', name: 'Netherlands', value: '+31'},\n {code: '+599', name: 'Netherlands Antilles', value: '+599'},\n {code: '+1', name: 'Nevis', value: '+1'},\n {code: '+687', name: 'New Caledonia', value: '+687'},\n {code: '+64', name: 'New Zealand', value: '+64'},\n {code: '+505', name: 'Nicaragua', value: '+505'},\n {code: '+227', name: 'Niger', value: '+227'},\n {code: '+234', name: 'Nigeria', value: '+234'},\n {code: '+683', name: 'Niue', value: '+683'},\n {code: '+672', name: 'Norfolk Island', value: '+672'},\n {code: '+850', name: 'North Korea', value: '+850'},\n {code: '+1', name: 'Northern Mariana Islands', value: '+1'},\n {code: '+47', name: 'Norway', value: '+47'},\n {code: '+968', name: 'Oman', value: '+968'},\n {code: '+92', name: 'Pakistan', value: '+92'},\n {code: '+680', name: 'Palau', value: '+680'},\n {code: '+970', name: 'Palestinian Territory', value: '+970'},\n {code: '+507', name: 'Panama', value: '+507'},\n {code: '+675', name: 'Papua New Guinea', value: '+675'},\n {code: '+595', name: 'Paraguay', value: '+595'},\n {code: '+51', name: 'Peru', value: '+51'},\n {code: '+63', name: 'Philippines', value: '+63'},\n {code: '+48', name: 'Poland', value: '+48'},\n {code: '+351', name: 'Portugal', value: '+351'},\n {code: '+1', name: 'Puerto Rico', value: '+1'},\n {code: '+974', name: 'Qatar', value: '+974'},\n {code: '+40', name: 'Romania', value: '+40'},\n {code: '+7', name: 'Russia', value: '+7'},\n {code: '+250', name: 'Rwanda', value: '+250'},\n {code: '508', name: 'Saint Pierre and Miquelon', value: '508'},\n {code: '+685', name: 'Samoa', value: '+685'},\n {code: '+378', name: 'San Marino', value: '+378'},\n {code: '+966', name: 'Saudi Arabia', value: '+966'},\n {code: '+221', name: 'Senegal', value: '+221'},\n {code: '+381', name: 'Serbia', value: '+381'},\n {code: '+248', name: 'Seychelles', value: '+248'},\n {code: '+232', name: 'Sierra Leone', value: '+232'},\n {code: '+65', name: 'Singapore', value: '+65'},\n {code: '+421', name: 'Slovakia', value: '+421'},\n {code: '+386', name: 'Slovenia', value: '+386'},\n {code: '+677', name: 'Solomon Islands', value: '+677'},\n {code: '+27', name: 'South Africa', value: '+27'},\n {code: '+500', name: 'South Georgia and the South Sandwich Islands', value: '+500'},\n {code: '+82', name: 'South Korea', value: '+82'},\n {code: '+34', name: 'Spain', value: '+34'},\n {code: '+94', name: 'Sri Lanka', value: '+94'},\n {code: '+249', name: 'Sudan', value: '+249'},\n {code: '+597', name: 'Suriname', value: '+597'},\n {code: '+268', name: 'Swaziland', value: '+268'},\n {code: '+46', name: 'Sweden', value: '+46'},\n {code: '+41', name: 'Switzerland', value: '+41'},\n {code: '+963', name: 'Syria', value: '+963'},\n {code: '+886', name: 'Taiwan', value: '+886'},\n {code: '+992', name: 'Tajikistan', value: '+992'},\n {code: '+255', name: 'Tanzania', value: '+255'},\n {code: '+66', name: 'Thailand', value: '+66'},\n {code: '+670', name: 'Timor Leste', value: '+670'},\n {code: '+228', name: 'Togo', value: '+228'},\n {code: '+690', name: 'Tokelau', value: '+690'},\n {code: '+676', name: 'Tonga', value: '+676'},\n {code: '+1', name: 'Trinidad and Tobago', value: '+1'},\n {code: '+216', name: 'Tunisia', value: '+216'},\n {code: '+90', name: 'Turkey', value: '+90'},\n {code: '+993', name: 'Turkmenistan', value: '+993'},\n {code: '+1', name: 'Turks and Caicos Islands', value: '+1'},\n {code: '+688', name: 'Tuvalu', value: '+688'},\n {code: '+1', name: 'U.S. Virgin Islands', value: '+1'},\n {code: '+256', name: 'Uganda', value: '+256'},\n {code: '+380', name: 'Ukraine', value: '+380'},\n {code: '+971', name: 'United Arab Emirates', value: '+971'},\n {code: '+44', name: 'United Kingdom', value: '+44'},\n {code: '+1', name: 'United States', value: '+1'},\n {code: '+598', name: 'Uruguay', value: '+598'},\n {code: '+998', name: 'Uzbekistan', value: '+998'},\n {code: '+678', name: 'Vanuatu', value: '+678'},\n {code: '+58', name: 'Venezuela', value: '+58'},\n {code: '+84', name: 'Vietnam', value: '+84'},\n {code: '+1', name: 'Wake Island', value: '+1'},\n {code: '+681', name: 'Wallis and Futuna', value: '+681'},\n {code: '+967', name: 'Yemen', value: '+967'},\n {code: '+260', name: 'Zambia', value: '+260'},\n {code: '+255', name: 'Zanzibar', value: '+255'},\n {code: '+263', name: 'Zimbabwe', value: '+263'},\n];\n\nexport function getCountryByCode(code: string): ICountry | null {\n const found = Countries.find((country) => country.code === code);\n if (found) return found;\n\n if (isFrenchGuiana(code)) {\n return {code: '+594', name: 'French Guiana', value: '+594'};\n } else if (isGuadeloupe(code)) {\n return {code: '+590', name: 'Guadeloupe', value: '+590'};\n } else if (isMartinique(code)) {\n return {code: '+596', name: 'Martinique', value: '+596'};\n } else if (isMayotte(code)) {\n return {code: '+262', name: 'Mayotte or Réunion', value: '+262'};\n }\n\n return null;\n}\n\nexport function isFrenchGuiana(code: string) {\n return '+594' === code.substring(0, 4);\n}\n\nexport function isGuadeloupe(code: string) {\n return '+590' === code.substring(0, 4);\n}\n\nexport function isMartinique(code: string) {\n return '+596' === code.substring(0, 4);\n}\n\nexport function isMayotte(code: string) {\n return '+262' === code.substring(0, 4);\n}\n\nexport function getPlusOneCountry(code: string) {\n let info: ICountry | null = null;\n switch (code.substring(0, 5)) {\n case '+1684':\n info = {code: '+1', name: 'American Samoa', value: '+1'};\n break;\n case '+1264':\n info = {code: '+1', name: 'Anguilla', value: '+1'};\n break;\n case '+1268':\n info = {code: '+1', name: 'Antigua and Barbuda', value: '+1'};\n break;\n case '+1242':\n info = {code: '+1', name: 'Bahamas', value: '+1'};\n break;\n case '+1246':\n info = {code: '+1', name: 'Barbados', value: '+1'};\n break;\n case '+1441':\n info = {code: '+1', name: 'Bermuda', value: '+1'};\n break;\n case '+1284':\n info = {code: '+1', name: 'British Virgin Islands', value: '+1'};\n break;\n case '+1':\n info = {code: '+1', name: '', value: '+1'};\n break;\n default:\n break;\n }\n return info;\n}\n\nexport function isCanada(code: string) {\n const canadianAreaCodes = [\n '403',\n '587',\n '780',\n '825',\n '604',\n '250',\n '778',\n '236',\n '204',\n '431',\n '506',\n '709',\n '867',\n '782',\n '902',\n '867',\n '548',\n '705',\n '365',\n '613',\n '807',\n '226',\n '289',\n '437',\n '519',\n '647',\n '905',\n '249',\n '343',\n '416',\n '902',\n '782',\n '450',\n '418',\n '579',\n '873',\n '367',\n '514',\n '581',\n '819',\n '438',\n '639',\n '306',\n '867',\n ];\n const areaCode = code.substring(0, 5);\n return canadianAreaCodes.findIndex((x) => '+1' + x === areaCode) > -1;\n}\n\nexport function isAmericanSamoa(code: string) {\n return code.substring(0, 5) === '+1684';\n}\n\nexport function isDominicanRepublic(code: string) {\n return '+1809' === code.substring(0, 5) || '+1829' === code.substring(0, 5) || '+1849' === code.substring(0, 5);\n}\n\nexport function isPuertoRico(code: string) {\n return code.substring(0, 5) === '+' || code.substring(0, 5) === '+';\n}\n\n// need to finish\nexport function getMatchingCountry(code: string, substrings: number) {\n const toMatch = code.substring(0, substrings);\n return Countries.filter((c) => c.code === toMatch).length;\n}\n\n// const e164Regex = new RegExp(/\\+[1-9]\\d{6,14}/g);\n\n// export function simpleE164Validator(code: string) {\n// return (code !== null && code.length < 16 && code.length > 6 && e164Regex.test(code)) || code === '' || code === null;\n// }\n","/**\n * Capitalize the first letter of a string.\n */\nexport const capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);\n\n/**\n * Convert a phone-number-like string to E164 format.\n * @see https://46elks.com/kb/e164\n */\nexport const convertToE164 = (input: string) => {\n // \"(212) 555-1212\" => +12125551212\n // \"+46766861004\" => \"+46766861004\"\n // \"212-555-1212\" => +12125551212\n // \"212.555.1212\" => +12125551212\n // \"212 555 1212\" => +12125551212\n\n let temp = (input || '').trim();\n // If we are already prefixed, assume the user did it deliberately and attempt to use what they entered. We also short-circuit blanks.\n if (!temp || temp.startsWith('+')) {\n return temp;\n }\n\n // Remove any spaces, parenthesis or other punctuation.\n temp = temp.replace(/[^0-9]/g, '');\n\n // If the number begins with a zero, remove the leading zero. Do not combine this with the previous step because it needs to be removed\n // whether it's the actual first character e.g. `0(5)` or just the first digit e.g. `(05`.\n temp = temp.replace(/^0/g, '');\n\n // Prepend the country code and +. We're assuming US in this case given the target demographic. Users in other countries would/should be\n // already entering a prefix so they'd shortcut out of this routine via the + prefix check.\n return `+1${temp}`;\n};\n","import type {IProfile} from '../Models';\nimport {capitalize} from './Strings';\n\n/**\n * Create an array containing a sequence of integers, e.g. [START, START+1, START+2, ...] This is frequently useful\n * in rendering operations when there is no source array to .map() across.\n */\nexport const integerSequence = (start: number, count: number): number[] =>\n Array(count)\n .fill(1)\n .map((_, index) => index + start);\n\n/**\n * Format a profile's full name\n */\nexport const formatFullName = (profile?: IProfile) =>\n profile ? `${capitalize(profile.first_name)} ${capitalize(profile.last_name)}` : 'Invalid User';\n\n/**\n * Format a profile's initials\n */\nexport const formatInitials = (profile?: IProfile) =>\n profile ? `${capitalize(profile.first_name).charAt(0)} ${capitalize(profile.last_name).charAt(0)}` : '--';\n\n/**\n * Generate suggested initials for a full name, e.g. \"John Doe\" will yield \"JD\".\n */\nexport const fullNameToInitials = (name: string) =>\n name\n .split(' ')\n .map((word) => word[0])\n .join('');\n","/* tslint:disable:no-bitwise */\n\nimport type {TSession} from '../Sessions';\n\nconst b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n// Regular expression to check formal correctness of base64 encoded strings\nconst b64re = /^(?:[A-Za-z\\d+\\/]{4})*?(?:[A-Za-z\\d+\\/]{2}(?:==)?|[A-Za-z\\d+\\/]{3}=?)?$/;\n\n/**\n * Simplified, Node/Browser-safe alternative to atob() for base64 decoding.\n * Modified from https://github.com/MaxArt2501/base64-js/blob/master/base64.js\n */\nexport const AtoB = (str: string) => {\n // atob can work with strings with whitespaces, even inside the encoded part,\n // but only \\t, \\n, \\f, \\r and ' ', which can be stripped.\n str = String(str).replace(/[\\t\\n\\f\\r ]+/g, '');\n if (!b64re.test(str)) throw new TypeError(\"Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.\");\n\n // Adding the padding if missing, for semplicity\n str += '=='.slice(2 - (str.length & 3));\n let bitmap;\n let result = '';\n let r1;\n let r2;\n let i = 0;\n\n for (; i < str.length; ) {\n bitmap =\n (b64.indexOf(str.charAt(i++)) << 18) |\n (b64.indexOf(str.charAt(i++)) << 12) |\n ((r1 = b64.indexOf(str.charAt(i++))) << 6) |\n (r2 = b64.indexOf(str.charAt(i++)));\n\n result +=\n r1 === 64\n ? String.fromCharCode((bitmap >> 16) & 255)\n : r2 === 64\n ? String.fromCharCode((bitmap >> 16) & 255, (bitmap >> 8) & 255)\n : String.fromCharCode((bitmap >> 16) & 255, (bitmap >> 8) & 255, bitmap & 255);\n }\n return result;\n};\n\n/**\n * Decode the body of a JWT. This helper may allow front-end applications to avoid a dependency on `jsonwebtoken` in\n * many cases. Note that this should only be used for true JWTs. Opaque tokens will cause this to throw.\n */\nexport const decodeJWTBody = (token: string) => JSON.parse(AtoB((token || '').split('.')[1] || ''));\n\n/**\n * Decode the body of an Verdocs access token. Note that raw tokens contain namespaced fields, e.g.\n * `https://verdocs.com/profile_id`. To make these tokens easier to use in front-end code, this name-spacing\n * will be removed. Note that user and signing sessions have different access token formats. The calling\n * application should distinguish between the two based on the context of the authenticated session, or by\n * the presence of the `document_id` field, which will only be present for signing sessions.\n */\nexport const decodeAccessTokenBody = (token: string): TSession => {\n let decoded: any;\n try {\n decoded = decodeJWTBody(token) as TSession;\n if (decoded === null) {\n return null;\n }\n } catch (e) {\n return null;\n }\n\n Object.keys(decoded).forEach((key: any) => {\n if (typeof key === 'string' && key.startsWith('https://verdocs.com/')) {\n decoded[key.replace('https://verdocs.com/', '')] = decoded[key];\n delete decoded[key];\n }\n });\n\n return decoded;\n};\n","// This file provides a polyfill for managing globals in both NodeJS and browser environments. This is\n// an anti-pattern we'd hoped to avoid, but we have several projects dependending on one common library\n// (this js-sdk) and we want that library to provide a common endpoint to all callers (so authentication\n// tokens only need to be tracked in one place). The trouble is, one of those libraries is based on\n// StencilJS and is compiling its modules into Web Components. Because of how module resolution works,\n// when those Components load js-sdk they get a separate instance. Without messy options like having to\n// pass raw data from the caller to each Component, or pass around references to a common Endpoint, they\n// have no way to access authenticated sessions unless we make the Endpoint a true global.\n//\n// @credit https://github.com/medikoo/es5-ext/blob/master/global.js\n// @credit https://mathiasbynens.be/notes/globalthis\n\nvar naiveFallback = function () {\n if (typeof self === 'object' && self) return self;\n if (typeof window === 'object' && window) return window;\n throw new Error('Unable to resolve global `this`');\n};\n\nmodule.exports = (function () {\n if (this) return this;\n\n // Unexpected strict mode (may happen if e.g. bundled into ESM module)\n\n // Fallback to standard globalThis if available\n if (typeof globalThis === 'object' && globalThis) return globalThis;\n\n // Thanks @mathiasbynens -> https://mathiasbynens.be/notes/globalthis\n // In all ES5+ engines global object inherits from Object.prototype\n // (if you approached one that doesn't please report)\n try {\n Object.defineProperty(Object.prototype, '__global__', {\n get: function () {\n return this;\n },\n configurable: true,\n });\n } catch (error) {\n // Unfortunate case of updates to Object.prototype being restricted\n // via preventExtensions, seal or freeze\n return naiveFallback();\n }\n try {\n // Safari case (window.__global__ works, but __global__ does not)\n if (!__global__) return naiveFallback();\n return __global__;\n } finally {\n delete Object.prototype.__global__;\n }\n})();\n","import axios, {AxiosInstance} from 'axios';\nimport {TSession, TSessionType} from './Sessions';\nimport {decodeAccessTokenBody} from './Utils';\nimport globalThis from './Utils/globalThis';\n\n// @credit https://derickbailey.com/2016/03/09/creating-a-true-singleton-in-node-js-with-es6-symbols/\n// Also see globalThis for comments about why we're doing this in the first place.\nconst ENDPOINT_KEY = Symbol.for('vƒbaseerdocs-default-endpoint');\n\nconst requestLogger = (r: any) => {\n // tslint:disable-next-line\n console.debug(`[JS-SDK] ${r.method.toUpperCase()} ${r.baseURL}${r.url}`, r.data ? JSON.stringify(r.data) : '');\n return r;\n};\n\nexport type TEnvironment = 'verdocs' | 'verdocs-stage';\n\nexport type TSessionChangedListener = (endpoint: VerdocsEndpoint, session: TSession) => void;\n\nexport interface VerdocsEndpointOptions {\n baseURL?: string;\n baseURLv2?: string;\n timeout?: number;\n environment?: TEnvironment;\n sessionType?: TSessionType;\n clientID?: string;\n}\n\n/**\n * VerdocsEndpoint is a class wrapper for a specific connection and authorization context for calling the Verdocs APIs.\n * Endpoints can be used for isolated session tasks.\n *\n * For instance, ephemeral signing sessions may be created independently of a caller's status as an authenticated user.\n * In that case, an Endpoint can be created and authenticated, used for calls related to signing operations, then\n * discarded once signing is complete.\n *\n * Note that endpoint configuration functions return the instance, so they can be chained, e.g.\n *\n * ```typescript\n * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';\n *\n * const endpoint = new VerdocsEndpoint();\n * endpoint\n * .setSessionType('signing')\n * .logRequests(true)\n * .setClientID('1234)\n * .setTimeout(30000);\n * ```\n */\nexport class VerdocsEndpoint {\n private environment = 'verdocs' as TEnvironment;\n private sessionType = 'user' as TSessionType;\n private baseURL = (window.location.origin === 'https://beta.verdocs.com' || window.location.origin === 'https://stage.verdocs.com'\n ? 'https://stage-api.verdocs.com'\n : 'https://api.verdocs.com') as string;\n private baseURLv2 = (window.location.origin === 'https://beta.verdocs.com' || window.location.origin === 'https://stage.verdocs.com'\n ? 'https://stage-api.verdocs.com/v2'\n : 'https://api.verdocs.com/v2') as string;\n private clientID = 'not-set' as string;\n private timeout = 60000 as number;\n private token = null as string | null;\n private nextListenerId = 0;\n private sessionListeners = new Map<symbol, TSessionChangedListener>();\n private requestLoggerId: number | null = null;\n\n /**\n * The current user session, or null if not authenticated. May be either a User or Signing session. If set, the\n * presence of the `document_id` field can be used to differentiate the types. Only signing sessions are associated\n * with Envelopes.\n */\n public session = null as TSession;\n\n public api: AxiosInstance;\n\n /**\n * Create a new VerdocsEndpoint to call Verdocs platform services.\n *\n * ```typescript\n * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';\n * const endpoint = new VerdocsEndpoint();\n * ```\n */\n constructor(options?: VerdocsEndpointOptions) {\n this.baseURL = options?.baseURL || this.baseURL;\n this.timeout = options?.timeout || this.timeout;\n this.environment = options?.environment || this.environment;\n this.sessionType = options?.sessionType || this.sessionType;\n this.clientID = options?.clientID || this.clientID;\n this.api = axios.create({baseURL: this.baseURL, timeout: this.timeout});\n }\n\n public setDefault() {\n globalThis[ENDPOINT_KEY] = this;\n }\n\n public static getDefault(): VerdocsEndpoint {\n if (!globalThis[ENDPOINT_KEY]) {\n globalThis[ENDPOINT_KEY] = new VerdocsEndpoint();\n // window.console.debug('[JS_SDK] Created default endpoint', globalThis[ENDPOINT_KEY].baseURL);\n }\n\n return globalThis[ENDPOINT_KEY];\n }\n\n /**\n * Get the current environment.\n */\n public getEnvironment() {\n return this.environment;\n }\n\n /**\n * Get the current session type.\n */\n public getSessionType() {\n return this.sessionType;\n }\n\n /**\n * Get the current base URL. This should rarely be anything other than 'https://api.verdocs.com'.\n */\n public getBaseURL() {\n return this.baseURL;\n }\n\n /**\n * Get the current base URL for the v2 APIs.\n * This should rarely be anything other than 'https://api-v2.verdocs.com'.\n */\n public getBaseURLv2() {\n return this.baseURLv2;\n }\n\n /**\n * Get the current client ID, if set.\n */\n public getClientID() {\n return this.clientID;\n }\n\n /**\n * Get the current timeout.\n */\n public getTimeout() {\n return this.timeout;\n }\n\n /**\n * Get the current session, if any.\n */\n public getSession() {\n return this.session;\n }\n\n /**\n * Set the operating environment. This should rarely be anything other than 'verdocs'.\n *\n * ```typescript\n * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';\n *\n * const endpoint = new VerdocsEndpoint();\n * endpoint.setEnvironment('verdocs-stage');\n * ```\n */\n public setEnvironment(environment: TEnvironment): VerdocsEndpoint {\n this.environment = environment;\n return this;\n }\n\n /**\n * Set the session type. In general this should be done immediately when the endpoint is created. Changing the\n * session type may be done at any time, but may have unintended consequences if the endpoint is shared between\n * multiple widgets.\n *\n * Changing the session type will clear/reload the action session. This may trigger notifications to session state\n * observers. Apps that use observers to trigger UI updates such as logging the user out should be prepared to\n * handle this event.\n *\n * ```typescript\n * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';\n *\n * const endpoint = new VerdocsEndpoint();\n * endpoint.setEnvironment('verdocs-stage');\n * ```\n */\n public setSessionType(sessionType: TSessionType): VerdocsEndpoint {\n this.sessionType = sessionType;\n return this;\n }\n\n /**\n * Set the base URL for API calls. Should be called only upon direction from Verdocs Customer Solutions Engineering.\n *\n * ```typescript\n * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';\n *\n * const endpoint = new VerdocsEndpoint();\n * endpoint.setBaseURL('https://api.verdocs.com');\n * ```\n */\n public setBaseURL(url: string): VerdocsEndpoint {\n this.baseURL = url;\n this.api.defaults.baseURL = url;\n return this;\n }\n\n /**\n * Set the base URL for API calls. Should be called only upon direction from Verdocs Customer Solutions Engineering.\n *\n * ```typescript\n * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';\n *\n * const endpoint = new VerdocsEndpoint();\n * endpoint.setBaseURL('https://api.verdocs.com');\n * ```\n */\n public setBaseURLv2(url: string): VerdocsEndpoint {\n this.baseURLv2 = url;\n // NOTE: We do not set this on the Axios instance because v1 is still the standard.\n return this;\n }\n\n /**\n * Set the Client ID for Verdocs API calls.\n *\n * ```typescript\n * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';\n *\n * const endpoint = new VerdocsEndpoint();\n * endpoint.setClientID('1234);\n * ```\n */\n setClientID(clientID: string): VerdocsEndpoint {\n this.clientID = clientID;\n this.api.defaults.headers.common['X-Client-ID'] = clientID;\n return this;\n }\n\n /**\n * Set the timeout for API calls in milliseconds. 5000-20000ms is recommended for most purposes. 15000ms is the default.\n * Note that some calls may involve rendering operations that require some time to complete, so very short timeouts\n * are not recommended.\n *\n * ```typescript\n * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';\n *\n * const endpoint = new VerdocsEndpoint();\n * endpoint.setTimeout(3000);\n * ```\n */\n public setTimeout(timeout: number): VerdocsEndpoint {\n this.timeout = timeout;\n this.api.defaults.timeout = timeout;\n return this;\n }\n\n /**\n * Enable or disable request logging. This may expose sensitive data in the console log, so it should only be used for debugging.\n *\n * ```typescript\n * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';\n *\n * const endpoint = new VerdocsEndpoint();\n * endpoint.logRequests(true);\n * ```\n */\n public logRequests(enable: boolean): VerdocsEndpoint {\n if (enable && this.requestLoggerId === null) {\n this.requestLoggerId = this.api.interceptors.request.use(requestLogger);\n } else if (!enable && this.requestLoggerId !== null) {\n this.api.interceptors.request.eject(this.requestLoggerId);\n }\n\n return this;\n }\n\n /**\n * Set the authorization token that will be used for Verdocs API calls. This will also set the session metadata\n * and notify any listeners of the new data.\n *\n * If this Endpoint will be used for non-default purposes (e.g. signing, or in an alternate environment) those\n * settings should be made before calling this. Sessions are persisted to localStorage, and the environment and\n * type become part of the storage key.\n *\n * ```typescript\n * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';\n *\n * const endpoint = new VerdocsEndpoint();\n * endpoint.setToken(accessToken);\n * ```\n */\n public setToken(token: string | null): VerdocsEndpoint {\n if (!token) {\n return this.clearSession();\n }\n\n const session = decodeAccessTokenBody(token);\n if (session === null || (session.exp && session.exp * 1000 < new Date().getTime())) {\n window.console.warn('[JS_SDK] Ignoring attempt to use expired session token');\n return this.clearSession();\n }\n\n this.token = token;\n this.session = session;\n if (this.sessionType === 'user') {\n this.api.defaults.headers.common.Authorization = `Bearer ${token}`;\n } else {\n this.api.defaults.headers.common.signer = `Bearer ${token}`;\n }\n\n localStorage.setItem(this.sessionStorageKey(), token);\n\n this.notifySessionListeners();\n return this;\n }\n\n /**\n * Retrieves the current session token, if any. Tokens should rarely be used for direct actions, but this is\n * required by the `<VerdocsView>` and other components to authorize requests to raw PDF files.\n */\n public getToken() {\n return this.token;\n }\n\n private sessionStorageKey() {\n return `verdocs-session-${this.getSessionType()}-${this.getEnvironment()}`;\n }\n\n /**\n * Clear the active session.\n */\n public clearSession() {\n localStorage.removeItem(this.sessionStorageKey());\n delete this.api.defaults.headers.common.Authorization;\n delete this.api.defaults.headers.common.signer;\n\n this.session = null;\n this.token = null;\n\n this.notifySessionListeners();\n\n return this;\n }\n\n /**\n * Clear the active signing session.\n */\n public clearSignerSession() {\n localStorage.removeItem(this.sessionStorageKey());\n delete this.api.defaults.headers.common.Authorization;\n\n this.session = null;\n this.token = null;\n\n this.notifySessionListeners();\n\n return this;\n }\n\n private notifySessionListeners() {\n this.sessionListeners.forEach((listener: TSessionChangedListener) => {\n try {\n listener(this, this.session);\n } catch (e) {\n // NOOP\n }\n });\n }\n\n /**\n * Subscribe to session state change events.\n */\n public onSessionChanged(listener: TSessionChangedListener) {\n // There's no value in randomizing this, a simple counter is fine\n this.nextListenerId++;\n const listenerSymbol = Symbol.for('' + this.nextListenerId);\n this.sessionListeners.set(listenerSymbol, listener);\n\n return () => {\n this.sessionListeners.delete(listenerSymbol);\n };\n }\n\n /**\n * Load a persisted session from localStorage. Typically called once after the endpoint is configured when the app\n * or component starts.\n */\n public loadSession() {\n const token = localStorage.getItem(this.sessionStorageKey());\n if (!token) {\n return this.clearSession();\n }\n\n return this.setToken(token);\n }\n}\n","import {IEnvelope, IEnvelopeDocument, IEnvelopeFieldSettings, IRecipient} from '../Models';\nimport {ICreateEnvelopeRequest, IEnvelopesSearchResult, IEnvelopesSummary} from './Types';\nimport {TEnvelopeStatus, TEnvelopeUpdateResult, TRecipientStatus} from '../BaseTypes';\nimport {ISigningSession, ISigningSessionRequest} from '../Sessions';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {decodeAccessTokenBody} from '../Utils';\n\n/**\n * Create an envelope\n *\n * ```typescript\n * import {Envelopes, ICreateEnvelopeRole, ICreateEnvelopeRequest} from '@verdocs/js-sdk/Envelopes';\n *\n * const role1: ICreateEnvelopeRole = {\n * type: 'signer',\n * name: 'Seller',\n * full_name: 'Paige Turner',\n * email: 'paige.turner@nomail.com',\n * phone: '',\n * sequence: 1,\n * delegator: false,\n * message: '',\n * };\n *\n * const role2: ICreateEnvelopeRole = {\n * type: 'signer',\n * name: 'Buyer',\n * full_name: 'Will Power',\n * email: 'will.power@nomail.com',\n * phone: '',\n * sequence: 2,\n * delegator: false,\n * message: '',\n * };\n *\n * const request: ICreateEnvelopeRequest = {template_id: 'd2338742-f3a1-465b-8592-806587413cc1', name: 'Bill of Sale', roles: [role1, role2]};\n * const {id, recipients} = await Envelopes.createEnvelope(VerdocsEndpoint.getDefault(), request);\n * ```\n */\nexport const createEnvelope = async (endpoint: VerdocsEndpoint, request: ICreateEnvelopeRequest) =>\n endpoint.api //\n .post<IEnvelope>('/envelopes', request)\n .then((r) => r.data);\n\n/**\n * Get a summary of currently active envelopes.\n *\n * ```typescript\n * import {Envelopes} from '@verdocs/js-sdk/Envelopes';\n *\n * const {action_required, completed, waiting_on_others} = await Envelopes.getSummary(VerdocsEndpoint.getDefault());\n * ```\n */\nexport const getEnvelopesSummary = async (endpoint: VerdocsEndpoint, page: number) =>\n endpoint.api //\n .post<IEnvelopesSummary>('/envelopes/summary', {page})\n .then((r) => r.data);\n\nexport interface IEnvelopeSearchParams {\n /** The envelope must have been created via the specified template ID. */\n template_id?: string;\n /** The envelope must match one of the specified statuses. */\n envelope_status?: TEnvelopeStatus[];\n /** At least one of the recipients must match one of the specified statuses. */\n recipient_status?: TRecipientStatus[];\n /** The envelope's name (inherited from the template) must match the specified string. */\n envelope_name?: string;\n /** At least one of the envelope's recipients must match the specified name. */\n recipient_name?: string;\n /** At least one of the envelope's recipients must match the specified email address. */\n recipient_email?: string;\n /** Match against envelope_name, recipient_name, or recipient_email all at once. */\n name?: string;\n /** At least one of the envelope's recipients must match the specified ID. */\n recipient_id?: string;\n /** The date-range in which the envelope was created. Values should be specified in ISO8601 \"UTC\" format. */\n created_at?: {\n start_time: string;\n end_time: string;\n };\n /**\n * The date-range in which the envelope was last updated. Values should be specified in ISO8601 \"UTC\" format.\n * Note that any operations that alter the envelope are considered \"updates\", including status changes (cancellation),\n * recipient actions (opening/signing), etc.\n */\n updated_at?: {\n start_time: string;\n end_time: string;\n };\n /** The date-range in which the envelope was canceled. Values should be specified in ISO8601 \"UTC\" format. */\n canceled_at?: {\n start_time: string;\n end_time: string;\n };\n /** Perform a \"contains\" search where any of the attached documents' fields contains the specified value. */\n text_field_value?: string;\n /** Set to true to retrieve only summary records (IEnvelopeSummary). */\n summary?: boolean;\n /** Set to true to retrieve only those envelopes owned by the caller. */\n is_owner?: boolean;\n /** Set to true to retrieve only those envelopes in which the caller is one of the recipients. */\n is_recipient?: boolean;\n /** Whether the recipient has \"claimed\" the envelope. */\n recipient_claimed?: boolean;\n /** The maximum number of records to return. Should be used in place of `row`. */\n limit?: number;\n /** The page number to return. Page numbers are 0-based. */\n page?: number;\n /** The field to sort the results by. */\n sort_by?: 'created_at' | 'updated_at' | 'envelope_name' | 'canceled_at' | 'envelope_status';\n /** Whether to sort in ascending (default) or descending order. */\n ascending?: boolean;\n}\n\n/**\n * Search for envelopes matching various criteria.\n *\n * ```typescript\n * import {Envelopes} from '@verdocs/js-sdk/Envelopes';\n *\n * const {result, page, total} = await Envelopes.search(VerdocsEndpoint.getDefault(), { ... });\n * ```\n */\nexport const searchEnvelopes = async (endpoint: VerdocsEndpoint, params: IEnvelopeSearchParams) =>\n endpoint.api //\n .post<IEnvelopesSearchResult>('/envelopes/search', params)\n .then((r) => r.data);\n\nexport interface ISigningSessionResult {\n recipient: IRecipient;\n session: ISigningSession;\n signerToken: string;\n}\n\n/**\n * Get a signing session for an Envelope.\n */\nexport const getSigningSession = async (endpoint: VerdocsEndpoint, params: ISigningSessionRequest) => {\n window.console.log('[JS_SDK] getSigningSession', params, endpoint.api);\n return endpoint.api //\n .get<IRecipient>(`/envelopes/${params.envelopeId}/recipients/${encodeURIComponent(params.roleId)}/invitation/${params.inviteCode}`)\n .then((r) => {\n // Avoiding a jsonwebtoken dependency here - we don't actually need the whole library\n const signerToken = r.headers?.signer_token || '';\n const session = decodeAccessTokenBody(signerToken) as ISigningSession;\n\n endpoint.setToken(signerToken);\n\n return {recipient: r.data, session, signerToken} as ISigningSessionResult;\n });\n};\n\n/**\n * Get the list of recipients for an Envelope.\n */\nexport const getEnvelopeRecipients = async (endpoint: VerdocsEndpoint, envelopeId: string) =>\n endpoint.api //\n .get<IRecipient[]>(`/envelopes/${envelopeId}/recipients`)\n .then((r) => r.data);\n\n/**\n * Get all metadata for an Envelope.\n */\nexport const getEnvelope = async (endpoint: VerdocsEndpoint, envelopeId: string) =>\n endpoint.api //\n .get<IEnvelope>(`/envelopes/${envelopeId}`)\n .then((r) => {\n const envelope = r.data;\n // Post-process the envelope to upgrade to new data fields\n envelope.documents?.forEach((document) => {\n if (!document.order) {\n document.order = 0;\n }\n\n if (document.page_numbers) {\n document.pages = document.page_numbers;\n }\n });\n\n return envelope;\n });\n\n\n/**\n * Get an Envelope Document\n */\nexport const getEnvelopeDocument = async (endpoint: VerdocsEndpoint, envelopeId: string, documentId: string) =>\n endpoint.api //\n .get<IEnvelopeDocument>(`/envelopes/${envelopeId}/envelope_documents/${documentId}`)\n .then((r) => r.data);\n\n/**\n * Get a pre-signed download link for an Envelope Document. This link expires quickly, so it should\n * be accessed immediately and never shared. Content-Disposition will be set to \"download\".\n */\nexport const getDocumentDownloadLink = async (endpoint: VerdocsEndpoint, envelopeId: string, documentId: string) =>\n endpoint.api //\n .get<string>(`/envelopes/${envelopeId}/envelope_documents/${documentId}?download=true`)\n .then((r) => r.data);\n\n/**\n * Get a pre-signed preview link for an Envelope Document. This link expires quickly, so it should\n * be accessed immediately and never shared. Content-Disposition will be set to \"inline\".\n */\nexport const getDocumentPreviewLink = async (endpoint: VerdocsEndpoint, envelopeId: string, documentId: string) =>\n endpoint.api //\n .get<string>(`/envelopes/${envelopeId}/envelope_documents/${documentId}?preview=true`)\n .then((r) => r.data);\n\n/**\n * Cancel an Envelope.\n */\nexport const cancelEnvelope = async (endpoint: VerdocsEndpoint, envelopeId: string) =>\n endpoint.api //\n .put<TEnvelopeUpdateResult>(`/envelopes/${envelopeId}`, {action: 'cancel'})\n .then((r) => r.data);\n\n/**\n * Get (binary download) a file attached to an Envelope. It is important to use this method\n * rather than a direct A HREF or similar link to set the authorization headers for the\n * request.\n */\nexport const getEnvelopeFile = async (endpoint: VerdocsEndpoint, envelopeId: string, documentId: string) =>\n endpoint.api //\n .get(`/envelopes/${envelopeId}/envelope_documents/${documentId}?file=true`, {responseType: 'blob'})\n .then((r) => r.data);\n\n/**\n * Update a Document field. Typically called during the signing process as a Recipient fills in fields.\n */\nexport const updateEnvelopeField = async (endpoint: VerdocsEndpoint, envelopeId: string, fieldName: string, value: any) =>\n endpoint.api //\n .put<IEnvelopeFieldSettings>(`/envelopes/${envelopeId}/fields/${fieldName}`, value)\n .then((r) => r.data);\n\n/**\n * Update a Document signature field. Signature fields are ID-driven. Call `Document.createSignature()` first to create a\n * signature for a Recipient, then call `Documents.updateDocumentFieldSignature()` to attach it to a field.\n */\nexport const updateEnvelopeFieldSignature = async (endpoint: VerdocsEndpoint, envelopeId: string, fieldName: string, signatureId: string) =>\n endpoint.api //\n .put<IEnvelopeFieldSettings>(`/envelopes/${envelopeId}/fields/${fieldName}/signature/${signatureId}`)\n .then((r) => r.data);\n\n/**\n * Update a Document signature field. Signature fields are ID-driven. Call `Document.createSignature()` first to create a\n * signature for a Recipient, then call `Documents.updateDocumentFieldSignature()` to attach it to a field.\n */\nexport const updateEnvelopeFieldInitials = async (endpoint: VerdocsEndpoint, envelopeId: string, fieldName: string, initialId: string) =>\n endpoint.api //\n .put<IEnvelopeFieldSettings>(`/envelopes/${envelopeId}/fields/${fieldName}/initial/${initialId}`)\n .then((r) => r.data);\n\n/**\n * Upload an attachment.\n */\nexport const uploadEnvelopeFieldAttachment = async (\n endpoint: VerdocsEndpoint,\n envelopeId: string,\n fieldName: string,\n file: File,\n onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void,\n) => {\n const formData = new FormData();\n formData.append('document', file, file.name);\n\n return endpoint.api //\n .put<IEnvelopeFieldSettings>(`/envelopes/${envelopeId}/fields/${fieldName}`, formData, {\n timeout: 120000,\n onUploadProgress: (event) => {\n const total = event.total || 1;\n const loaded = event.loaded || 0;\n onUploadProgress?.(Math.floor((loaded * 100) / (total || 1)), loaded, total || 1);\n },\n })\n .then((r) => r.data);\n};\n\n/**\n * Delete an attachment.\n */\nexport const deleteEnvelopeFieldAttachment = async (\n endpoint: VerdocsEndpoint,\n envelopeId: string,\n fieldName: string,\n file: File,\n onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void,\n) => {\n const formData = new FormData();\n // Omitting file is the trigger here\n\n return endpoint.api //\n .put<IEnvelopeFieldSettings>(`/envelopes/${envelopeId}/fields/${fieldName}`, formData, {\n timeout: 120000,\n onUploadProgress: (event) => {\n const total = event.total || 1;\n const loaded = event.loaded || 0;\n onUploadProgress?.(Math.floor((loaded * 100) / (total || 1)), loaded, total || 1);\n },\n })\n .then((r) => r.data);\n};\n\n/**\n * Get the attached file for an attachment field (if any)\n */\nexport const getFieldAttachment = async (endpoint: VerdocsEndpoint, envelopeId: string, fieldName: string) =>\n endpoint.api //\n .get(`/envelopes/${envelopeId}/fields/${fieldName}/document`, {responseType: 'blob'})\n .then((r) => r.data);\n\n/**\n * Get a display URI for a given page in a file attached to an envelope document. These pages are rendered server-side\n * into PNG resources suitable for display in IMG tags although they may be used elsewhere. Note that these are intended\n * for DISPLAY ONLY, are not legally binding documents, and do not contain any encoded metadata from participants.\n */\nexport const getEnvelopeDocumentPageDisplayUri = async (\n endpoint: VerdocsEndpoint,\n envelopeId: string,\n documentId: string,\n page: number,\n type: 'original' | 'filled' | 'certificate' = 'original',\n) =>\n endpoint.api\n .get<string>(`/envelopes/${envelopeId}/envelope_documents/${documentId}/pages/${page}/image?type=${type}`, {timeout: 20000})\n .then((r) => r.data);\n\nconst cachedEnvelopes: Record<string, {loaded: number; envelope: IEnvelope}> = {};\n\n/**\n * Wrapper for `getEnvelope()` that limits queries to one every 2 seconds per template ID.\n * This is intended for use in component hierarchies that all rely on the same template\n * to avoid unnecessary repeat server calls.\n */\nexport const throttledGetEnvelope = (endpoint: VerdocsEndpoint, envelopeId: string) => {\n if (cachedEnvelopes[envelopeId] && cachedEnvelopes[envelopeId].loaded + 2000 < new Date().getTime()) {\n return cachedEnvelopes[envelopeId].envelope;\n }\n\n return getEnvelope(endpoint, envelopeId).then((envelope) => {\n cachedEnvelopes[envelopeId] = {loaded: new Date().getTime(), envelope};\n return envelope;\n });\n};\n\nexport interface ITimeRange {\n start: string;\n end: string;\n}\n\n// /**\n// * Lists all templates accessible by the caller, with optional filters.\n// *\n// * ```typescript\n// * import {Envelopes} from '@verdocs/js-sdk/Templates';\n// *\n// * await Envelopes.listEnvelopes((VerdocsEndpoint.getDefault(), { name: 'test', sort: 'updated_at' });\n// * ```\n// */\n// export const listEnvelopes = (endpoint: VerdocsEndpoint, params?: IListEnvelopesParams) =>\n// endpoint.api //\n// .post<IEnvelopeSummaries>('/envelopes/list', params, {baseURL: endpoint.getBaseURLv2()})\n// .then((r) => r.data);\nexport interface IListEnvelopesParams {\n view?: 'inbox' | 'sent' | 'action' | 'waiting' | 'completed';\n q?: string;\n status?: string[];\n created_at?: ITimeRange;\n is_owner?: boolean;\n sort_by?: 'name' | 'created_at' | 'updated_at' | 'canceled_at' | 'status';\n template_id?: string;\n ascending?: boolean;\n rows?: number;\n page?: number;\n}\n\n/**a\n * Lists all envelopes accessible by the caller, with optional filters.\n *\n * ```typescript\n * import {Envelopes} from '@verdocs/js-sdk/Envelopes';\n *\n * const {totals, envelopes} = await Envelopes.listEnvelopes((VerdocsEndpoint.getDefault(), { q: 'test', sort: 'created_at' });\n * ```\n */\nexport const listEnvelopes = (endpoint: VerdocsEndpoint, params?: IListEnvelopesParams) =>\n endpoint.api //\n .post<{total: number; rows: number; page: number; envelopes: IEnvelope[]}>('/envelopes/list', params)\n .then((r) => r.data);\n\n/**\n * Get all of the envelopes that were sent using a given template.\n * NOTE: This endpoint will be retired soon. Its response is not paginated and it is typically used only to retrieve\n * \"submitted data\" for a template. A new endpoint will be introduced to provide this function more directly.\n * @deprecated\n */\nexport const getEnvelopesByTemplateId = async (endpoint: VerdocsEndpoint, templateId: string) =>\n endpoint.api //\n .get<IEnvelope[]>(`/envelopes?template_id=${templateId}`)\n .then((r) => r.data);\n","import {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {IInitial} from '../Models';\n\n/**\n * Create an initials block. In a typical signing workflow, the user is asked at the beginning of the process to \"adopt\"\n * an initials block to be used for all initials fields in the document. Thus, this is typically called one time to\n * create and store an initials block. Thereafter, the ID of the initials block may be re-used for each initials field\n * to be \"stamped\" by the user.\n */\nexport const createInitials = (endpoint: VerdocsEndpoint, name: string, initials: Blob) => {\n const data = new FormData();\n data.append('initial', initials, name);\n\n return endpoint.api //\n .post<IInitial>(`/initials`, data)\n .then((r) => r.data);\n};\n","import {\n IInPersonLinkResponse,\n IUpdateRecipientSubmitParams,\n IUpdateRecipientClaimEnvelope,\n IUpdateRecipientAgreedParams,\n IUpdateRecipientNameParams,\n IUpdateRecipientDeclineParams,\n IUpdateRecipientPrepareParams,\n} from './Types';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {IEnvelope, IInPersonAccessKey, IRecipient} from '../Models';\n\n/**\n * Update a recipient's status block\n */\nexport const updateRecipient = async (\n endpoint: VerdocsEndpoint,\n envelopeId: string,\n roleName: string,\n params:\n | IUpdateRecipientSubmitParams\n | IUpdateRecipientClaimEnvelope\n | IUpdateRecipientAgreedParams\n | IUpdateRecipientNameParams\n | IUpdateRecipientDeclineParams\n | IUpdateRecipientPrepareParams,\n) =>\n endpoint.api //\n .put<IRecipient>(`/envelopes/${envelopeId}/recipients/${roleName}`, params)\n .then((r) => r.data);\n\n/**\n * Submit an envelope (signing is finished). Note that all fields must be valid/completed for this to succeed.\n */\nexport const envelopeRecipientSubmit = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string) =>\n updateRecipient(endpoint, envelopeId, roleName, {action: 'submit'});\n\n/**\n * Decline to complete an envelope (signing will not terminated).\n */\nexport const envelopeRecipientDecline = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string) =>\n updateRecipient(endpoint, envelopeId, roleName, {action: 'decline'});\n\n/**\n * Claim / change ownership of an envelope. This is a special-case operation only available in certain workflows.\n */\nexport const envelopeRecipientChangeOwner = (\n endpoint: VerdocsEndpoint,\n envelopeId: string,\n roleName: string,\n email: string,\n fullName: string,\n) => updateRecipient(endpoint, envelopeId, roleName, {action: 'owner_update', email, full_name: fullName});\n\n/**\n * Agree to electronic signing.\n */\nexport const envelopeRecipientAgree = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, agreed: boolean) =>\n updateRecipient(endpoint, envelopeId, roleName, {action: 'update', agreed});\n\n/**\n * Change a recipient's name.\n */\nexport const envelopeRecipientUpdateName = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, fullName: string) =>\n updateRecipient(endpoint, envelopeId, roleName, {action: 'update', new_full_name: fullName});\n\n/**\n * Change a recipient's name.\n */\nexport const envelopeRecipientPrepare = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, recipients: IRecipient[]) =>\n updateRecipient(endpoint, envelopeId, roleName, {action: 'prepare', recipients});\n\nexport interface ISignerTokenResponse {\n recipient: IRecipient;\n envelope: IEnvelope;\n signerToken: string;\n inPersonAccessKey: IInPersonAccessKey;\n}\n\n/**\n * Get a signing token.\n */\nexport const getSignerToken = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string) =>\n endpoint.api //\n .get<ISignerTokenResponse>(`/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}/signer-token`)\n .then((r) => r.data);\n\n/**\n * Get an in-person signing link.\n */\nexport const getInPersonLink = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string) =>\n endpoint.api //\n .get<IInPersonLinkResponse>(`/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}?in_person_link=true`)\n .then((r) => r.data);\n\n/**\n * Send a delegation request.\n */\nexport const sendDelegate = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string) =>\n endpoint.api //\n .post<IEnvelope>(`/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}/delegate`)\n .then((r) => r.data);\n\n/**\n * Resend a recipient's invitation.\n */\nexport const resendInvitation = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string) =>\n endpoint.api //\n .post(`/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}/resend_invitation`)\n .then((r) => r.data);\n","import {ICreateEnvelopeReminderRequest} from './Types';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {IReminder} from '../Models';\n\n/**\n * Enable automatic reminders. setup_time is the number of days after the envelope is sent that the first reminder\n * should be sent. interval_time is the number of days between reminders.\n */\nexport const createEnvelopeReminder = (endpoint: VerdocsEndpoint, envelopeId: string, params: ICreateEnvelopeReminderRequest) =>\n endpoint.api //\n .post<IReminder>(`/envelopes/${envelopeId}/reminder/`, params)\n .then((r) => r.data);\n\n/**\n * Get the reminder configuration for an envelope.\n */\nexport const getEnvelopeReminder = (endpoint: VerdocsEndpoint, envelopeId: string, reminderId: string) =>\n endpoint.api //\n .get<IReminder>(`/envelopes/${envelopeId}/reminder/${reminderId}`)\n .then((r) => r.data);\n\n/**\n * Update the reminder configuration for an envelope.\n */\nexport const updateEnvelopeReminder = (\n endpoint: VerdocsEndpoint,\n envelopeId: string,\n reminderId: string,\n params: ICreateEnvelopeReminderRequest,\n) =>\n endpoint.api //\n .put<IReminder>(`/envelopes/${envelopeId}/reminder/${reminderId}`, params)\n .then((r) => r.data);\n\n/**\n * Delete the reminder configuration for an envelope.\n */\nexport const deleteEnvelopeReminder = (endpoint: VerdocsEndpoint, envelopeId: string, reminderId: string) =>\n endpoint.api //\n .delete(`/envelopes/${envelopeId}/reminder/${reminderId}`)\n .then((r) => r.data);\n","/**\n * Various helpers to identify available operations for an envelope by a user.\n *\n * @module\n */\n\nimport {IEnvelope, IRecipient} from '../Models';\nimport {TSession} from '../Sessions/Types';\nimport {IEnvelopeSummary} from './Types';\n\n/**\n * Check to see if the user owns the envelope.\n */\nexport const userIsEnvelopeOwner = (session: TSession, envelope: IEnvelope | IEnvelopeSummary) =>\n envelope.profile_id === session?.profile_id;\n\n/**\n * Check to see if the user owns the envelope.\n */\nexport const userIsEnvelopeRecipient = (session: TSession, envelope: IEnvelope | IEnvelopeSummary) =>\n envelope.profile_id === session?.profile_id;\n\n/**\n * Check to see if the envelope has pending actions.\n */\nexport const envelopeIsActive = (envelope: IEnvelope | IEnvelopeSummary) =>\n envelope.status !== 'complete' && envelope.status !== 'declined' && envelope.status !== 'canceled';\n\n/**\n * Check to see if the envelope has been completed.\n */\nexport const envelopeIsComplete = (envelope: IEnvelope | IEnvelopeSummary) => envelope.status !== 'complete';\n\n/**\n * Check to see if the user owns the envelope.\n */\nexport const userCanCancelEnvelope = (session: TSession, envelope: IEnvelope | IEnvelopeSummary) =>\n userIsEnvelopeOwner(session, envelope) &&\n envelope.status !== 'complete' &&\n envelope.status !== 'declined' &&\n envelope.status !== 'canceled';\n\n/**\n * Check to see if the user owns the envelope.\n */\nexport const userCanFinishEnvelope = (session: TSession, envelope: IEnvelope | IEnvelopeSummary) =>\n userIsEnvelopeOwner(session, envelope) &&\n envelope.status !== 'complete' &&\n envelope.status !== 'declined' &&\n envelope.status !== 'canceled';\n/**\n * Returns true if the recipient has a pending action. Note that this does not necessarily mean the recipient can act (yet).\n */\nexport const recipientHasAction = (recipient: IRecipient) => !['submitted', 'canceled', 'declined'].includes(recipient.status);\n\n/**\n * Returns the recipients who still have a pending action. Note that not all of these recipients may be able to act (yet).\n */\nexport const getRecipientsWithActions = (envelope: IEnvelope | IEnvelopeSummary) => (envelope?.recipients || []).filter(recipientHasAction);\n\n/**\n * Returns true if the recipient can act.\n */\nexport const recipientCanAct = (recipient: IRecipient, recipientsWithActions: IRecipient[]) =>\n recipient.sequence === recipientsWithActions?.[0]?.sequence;\n\n/**\n * Returns true if the user can act.\n */\nexport const userCanAct = (email: string, recipientsWithActions: IRecipient[]) => {\n const recipient = recipientsWithActions.find((r) => r.email === email);\n return recipient && recipient.sequence === recipientsWithActions?.[0]?.sequence;\n};\n\n/**\n * Returns true if the user can act.\n */\nexport const userCanSignNow = (session: TSession, envelope: IEnvelope | IEnvelopeSummary) => {\n if (!session) {\n return false;\n }\n\n const recipientsWithActions = getRecipientsWithActions(envelope);\n const myRecipient = recipientsWithActions.find((r) => r.profile_id === session?.profile_id || r.email === session?.email);\n return (\n myRecipient &&\n envelopeIsActive(envelope) &&\n userIsEnvelopeRecipient(session, envelope) &&\n recipientCanAct(myRecipient, recipientsWithActions)\n );\n};\n\nexport const getNextRecipient = (envelope: IEnvelope | IEnvelopeSummary) => {\n const recipientsWithActions = getRecipientsWithActions(envelope);\n return recipientsWithActions?.[0];\n};\n","import {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {ISignature} from '../Models';\n\n/**\n * Create a signature block. In a typical signing workflow, the user is asked at the beginning of the process to \"adopt\"\n * a signature block to be used for all signature fields in the document. Thus, this is typically called one time to\n * create and store a signature block. Thereafter, the ID of the signature block may be re-used for each signature field\n * to be \"stamped\" by the user.\n */\nexport const createSignature = (endpoint: VerdocsEndpoint, name: string, signature: Blob) => {\n const data = new FormData();\n data.append('signature', signature, name);\n\n return endpoint.api //\n .post<ISignature>(`/signatures`, data)\n .then((r) => r.data);\n};\n\n/**\n * Get the availbable signatures for a user.\n */\nexport const getSignatures = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<ISignature[]>('/signatures')\n .then((r) => r.data);\n\n/**\n * Get a user's signature by ID.\n */\nexport const getSignature = (endpoint: VerdocsEndpoint, signatureId: string) =>\n endpoint.api //\n .get(`/signatures/${signatureId}`)\n .then((r) => r.data);\n\n/**\n * Delete a user's signature.\n */\nexport const deleteSignature = (endpoint: VerdocsEndpoint, signatureId: string) =>\n endpoint.api //\n .delete(`/signatures/${signatureId}`)\n .then((r) => r.data);\n","/**\n * API keys are used to authenticate server-to-server calls. (API keys should **never** be used for client-to-server operations!)\n * To generate a key, either use the Verdocs admin interface and make note of the client_id and client_secret generated, or call\n * createKey as shown below. Then call {@link Users.Auth.authenticateApp} to obtain an access token using the provided ID and\n * secret. Note that server-to-server authentication requests return shorter-lived tokens, so it is important to check the `exp`\n * field and re-authenticate as needed for subsequent calls.\n *\n * API keys may be updated or rotated at any time. Regular rotation is recommended. Rotation will not expire or invalidate\n * existing server-to-server sessions, so it may be done at any time without disrupting your application.\n *\n * @module\n */\n\nimport {ICreateApiKeyRequest, IUpdateApiKeyRequest} from './Types';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {IApiKey} from '../Models';\n\n/**\n * Get a list of keys for a given organization. The caller must have admin access to the organization.\n *\n * ```typescript\n * import {ApiKeys} from '@verdocs/js-sdk';\n *\n * const keys = await ApiKeys.getKeys(ORGID);\n * ```\n */\nexport const getApiKeys = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IApiKey[]>(`/v2/api-keys`)\n .then((r) => r.data);\n\n/**\n * Create an API key.\n *\n * ```typescript\n * import {ApiKeys} from '@verdocs/js-sdk';\n *\n * await ApiKeys.createKey(ORGID, {name: NEWNAME});\n * ```\n */\nexport const createApiKey = (endpoint: VerdocsEndpoint, params: ICreateApiKeyRequest) =>\n endpoint.api //\n .post<IApiKey>('/v2/api-keys', params)\n .then((r) => r.data);\n\n/**\n * Rotate the secret for an API key. The caller must have admin access to the organization.\n *\n * ```typescript\n * import {ApiKeys} from '@verdocs/js-sdk';\n *\n * const {client_secret: newSecret} = await ApiKeys.rotateKey(ORGID, CLIENTID);\n * ```\n */\nexport const rotateApiKey = (endpoint: VerdocsEndpoint, clientId: string) =>\n endpoint.api //\n .post<IApiKey>(`/v2/api-keys/${clientId}/rotate`)\n .then((r) => r.data);\n\n/**\n * Update an API key to change its assigned Profile ID or Name.\n *\n * ```typescript\n * import {ApiKeys} from '@verdocs/js-sdk';\n *\n * await ApiKeys.updateKey(ORGID, CLIENTID, {name: NEWNAME});\n * ```\n */\nexport const updateApiKey = (endpoint: VerdocsEndpoint, clientId: string, params: IUpdateApiKeyRequest) =>\n endpoint.api //\n .patch<IApiKey>(`/v2/api-keys/${clientId}`, params)\n .then((r) => r.data);\n\n/**\n * Delete an API key.\n *\n * ```typescript\n * import {ApiKeys} from '@verdocs/js-sdk';\n *\n * await ApiKeys.deleteKey(ORGID, CLIENTID);\n * ```\n */\nexport const deleteApiKey = (endpoint: VerdocsEndpoint, clientId: string) =>\n endpoint.api //\n .delete(`/v2/api-keys/${clientId}`)\n .then((r) => r.data);\n","/**\n * Organizations may contain \"Groups\" of user profiles, called Members. Groups may have permissions assigned that\n * apply to all Members, making it easy to configure role-based access control (RBAC) within an Organization. Note\n * that permissions are **additive**. A user may be a member of more than one group, and may also have permissions\n * assigned directly. In that case, the user will have the combined set of all permissions inherited from all\n * sources.\n *\n * @module\n */\n\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {TPermission} from '../BaseTypes';\nimport {IGroup} from '../Models';\n\n/**\n * Get a list of groups for a given organization. The caller must have admin access to the organization.\n *\n * ```typescript\n * import {getGroups} from '@verdocs/js-sdk';\n *\n * const groups = await getGroups(ORGID);\n * ```\n */\nexport const getGroups = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IGroup[]>(`/v2/organization-groups`)\n .then((r) => r.data);\n\n/**\n * Get the details for a group, including its member profiles and list of permissions.\n *\n * ```typescript\n * import {getGroup} from '@verdocs/js-sdk/v2/organization-groups';\n *\n * const groups = await getGroup(GROUPID);\n * ```\n */\nexport const getGroup = (endpoint: VerdocsEndpoint, groupId: string) =>\n endpoint.api //\n .get<IGroup>(`/v2/organization-groups/${groupId}`)\n .then((r) => r.data);\n\nexport const createGroup = (endpoint: VerdocsEndpoint, name: string) =>\n endpoint.api //\n .post('/v2/organization-groups', {name})\n .then((r) => r.data);\n\nexport const addGroupMember = (endpoint: VerdocsEndpoint, groupId: string, profile_id: string) =>\n endpoint.api //\n .post(`/v2/organization-groups/${groupId}/members`, {profile_id})\n .then((r) => r.data);\n\nexport const deleteGroupMember = (endpoint: VerdocsEndpoint, groupId: string, profile_id: string) =>\n endpoint.api //\n .delete(`/v2/organization-groups/${groupId}/members/${profile_id}`)\n .then((r) => r.data);\n\nexport const updateGroup = (endpoint: VerdocsEndpoint, groupId: string, params: {permissions: TPermission[]}) =>\n endpoint.api //\n .patch(`/v2/organization-groups/${groupId}`, params)\n .then((r) => r.data);\n","import {IOrganizationInvitation, IProfile} from '../Models';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {ICreateInvitationRequest} from './Types';\n\n/**\n * An invitation represents an opportunity for a Member to join an Organization.\n *\n * @module\n */\n\nexport const getOrganizationInvitations = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IOrganizationInvitation[]>(`/v2/organization-invitations`)\n .then((r) => r.data);\n\nexport const createOrganizationInvitation = (endpoint: VerdocsEndpoint, params: ICreateInvitationRequest) =>\n endpoint.api //\n .post<IOrganizationInvitation>(`/v2/organization-invitations`, params)\n .then((r) => r.data);\n\nexport const deleteOrganizationInvitation = (endpoint: VerdocsEndpoint, email: string) =>\n endpoint.api //\n .delete(`/v2/organization-invitations/${email}`)\n .then((r) => r.data);\n\nexport const updateOrganizationInvitation = (endpoint: VerdocsEndpoint, email: string, params: Partial<ICreateInvitationRequest>) =>\n endpoint.api //\n .patch<IOrganizationInvitation>(`/v2/organization-invitations/${email}`, params)\n .then((r) => r.data);\n\nexport const resendOrganizationInvitation = (endpoint: VerdocsEndpoint, email: string) =>\n endpoint.api //\n .post('/v2/organization-invitations/resend', {email})\n .then((r) => r.data);\n\nexport const getOrganizationInvitation = (endpoint: VerdocsEndpoint, email: string, token: string) =>\n endpoint.api //\n .get<IOrganizationInvitation>(`/v2/organization-invitations/${email}/${token}`)\n .then((r) => r.data);\n\nexport const acceptOrganizationInvitation = (endpoint: VerdocsEndpoint, email: string, token: string) =>\n endpoint.api //\n .post<IProfile>('/v2/organization-invitations/accept', {email, token})\n .then((r) => r.data);\n\nexport const declineOrganizationInvitation = (endpoint: VerdocsEndpoint, email: string, token: string) =>\n endpoint.api //\n .post<{status: 'OK'}>('/v2/organization-invitations/decline', {email, token})\n .then((r) => r.data);\n","import {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {IProfile} from '../Models';\n\n/**\n * An Organization Member (aka Profile) is an individual user with access to an organization.\n *\n * @module\n */\n\nexport const getOrganizationMembers = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IProfile[]>(`/v2/organization-members`)\n .then((r) => r.data);\n\nexport const deleteOrganizationMember = (endpoint: VerdocsEndpoint, profileId: string) =>\n endpoint.api //\n .delete(`/v2/organization-members/${profileId}`)\n .then((r) => r.data);\n\nexport const updateOrganizationMember = (endpoint: VerdocsEndpoint, profileId: string, params: Pick<IProfile, 'roles' | 'permissions'>) =>\n endpoint.api //\n .patch(`/v2/organization-members/${profileId}`, params)\n .then((r) => r.data);\n","/**\n * An Organization is the top level object for ownership for Members, Documents, and Templates.\n *\n * @module\n */\n\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {IOrganization} from '../Models';\n\n/**\n * Get a list of organizations the caller is a member of.\n */\nexport const getOrganizations = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IOrganization[]>('/v2/organizations')\n .then((r) => r.data);\n\n/**\n * Get an organization by ID.\n */\nexport const getOrganization = (endpoint: VerdocsEndpoint, organizationId: string) =>\n endpoint.api //\n .get<IOrganization>(`/v2/organizations/${organizationId}`)\n .then((r) => r.data);\n\n/**\n * Create an organization.\n */\nexport const createOrganization = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .post<IOrganization>('/v2/organizations')\n .then((r) => r.data);\n\n/**\n * Delete an organization.\n */\nexport const deleteOrganization = (endpoint: VerdocsEndpoint, organizationId: string) =>\n endpoint.api //\n .delete(`/v2/organizations/${organizationId}`)\n .then((r) => r.data);\n\n/**\n * Update an organization.\n */\nexport const updateOrganization = (endpoint: VerdocsEndpoint, organizationId: string, params: Partial<IOrganization>) =>\n endpoint.api //\n .patch<IOrganization>(`/v2/organizations/${organizationId}`, params)\n .then((r) => r.data);\n","/**\n * Webhooks are callback triggers from Verdocs to your servers that notify your applications\n * of various events, such as signing operations.\n *\n * @module\n */\n\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {ISetWebhookRequest} from './Types';\nimport {IWebhook} from '../Models';\n\n/**\n * Get the registered Webhooks for the caller's organization.\n */\nexport const getWebhooks = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IWebhook>(`/v2/webhooks/organization`)\n .then((r) => r.data);\n\n/**\n * Update the registered Webhooks for the caller's organization.\n */\nexport const setWebhooks = (endpoint: VerdocsEndpoint, params: ISetWebhookRequest) =>\n endpoint.api //\n .patch<IWebhook>(`/v2/webhooks/organization`, params)\n .then((r) => r.data);\n","import {TPermission} from '../BaseTypes';\nimport {TSession} from './Types';\n\n/**\n * Confirm whether the user has all of the specified permissions.\n */\nexport const userHasPermissions = (session: TSession, permissions: TPermission[]) =>\n permissions.every((perm) => (session?.permissions || []).includes(perm));\n","import {TTemplateAction, TTemplatePermission} from '../BaseTypes';\nimport {ITemplateSummary} from './Types';\nimport {TSession} from '../Sessions';\nimport {ITemplate} from '../Models';\n\nexport const canPerformTemplateAction = (\n session: TSession,\n action: TTemplateAction,\n template?: ITemplate | ITemplateSummary,\n): {canPerform: boolean; message: string} => {\n if (!template && !action.includes('create')) {\n return {canPerform: false, message: 'Missing required template object'};\n }\n\n // We use BOGUS here to force the option-chain in things like template?.profile_id to NOT match profile?.profile_id because if both\n // were undefined, they would actually match.\n const profile_id = session?.profile_id || 'BOGUS';\n const organization_id = session?.organization_id || 'BOGUS';\n\n if (!profile_id) {\n return {canPerform: false, message: 'Active session required'};\n }\n\n const isCreator = template?.profile_id === profile_id;\n const isSameOrg = template?.organization_id === organization_id;\n const isPersonal = template?.is_personal ?? false;\n const isPublic = template?.is_public ?? false;\n\n const permissionsRequired: TTemplatePermission[] = [];\n switch (action) {\n case 'create_personal':\n permissionsRequired.push('template:creator:create:personal');\n break;\n case 'create_org':\n permissionsRequired.push('template:creator:create:org');\n break;\n case 'create_public':\n permissionsRequired.push('template:creator:create:public');\n break;\n case 'read':\n if (!isCreator) {\n if ((!isPersonal && isSameOrg) || !isPublic) {\n permissionsRequired.push('template:member:read');\n }\n }\n break;\n case 'write':\n if (!isCreator) {\n permissionsRequired.push('template:member:read');\n permissionsRequired.push('template:member:write');\n }\n break;\n case 'change_visibility_personal':\n if (isCreator) {\n permissionsRequired.push('template:creator:create:personal');\n } else {\n permissionsRequired.push('template:member:visibility');\n }\n break;\n case 'change_visibility_org':\n if (isCreator) {\n permissionsRequired.push('template:creator:create:org');\n } else {\n permissionsRequired.push('template:member:visibility');\n }\n break;\n case 'change_visibility_public':\n if (isCreator) {\n permissionsRequired.push('template:creator:create:public');\n permissionsRequired.push('template:creator:visibility');\n } else {\n permissionsRequired.push('template:member:visibility');\n }\n break;\n case 'delete':\n if (isCreator) {\n permissionsRequired.push('template:creator:delete');\n } else {\n permissionsRequired.push('template:member:delete');\n }\n break;\n default:\n return {canPerform: false, message: 'Action is not defined'};\n }\n\n if (hasRequiredPermissions(session, permissionsRequired)) {\n return {canPerform: true, message: ''};\n }\n\n return {canPerform: false, message: `Insufficient access to perform '${action}'. Needed permissions: ${permissionsRequired.toString()}`};\n};\n\nexport const hasRequiredPermissions = (session: TSession, permissions: string[]) =>\n permissions.every((perm) => (session?.permissions || []).includes(perm));\n","import {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {ITemplateField} from '../Models';\n\n/**\n * Add a field to a template.\n */\nexport const createField = (endpoint: VerdocsEndpoint, templateId: string, params: ITemplateField) =>\n endpoint.api //\n .post<ITemplateField>(`/templates/${templateId}/fields`, params)\n .then((r) => r.data);\n\n/**\n * Update a template field.\n */\nexport const updateField = (endpoint: VerdocsEndpoint, templateId: string, fieldName: string, params: Partial<ITemplateField>) =>\n endpoint.api //\n .put<ITemplateField>(`/templates/${templateId}/fields/${fieldName}`, params)\n .then((r) => r.data);\n\n/**\n * REmove a field from a template.\n */\nexport const deleteField = (endpoint: VerdocsEndpoint, templateId: string, fieldName: string) =>\n endpoint.api //\n .delete(`/templates/${templateId}/fields/${fieldName}`)\n .then((r) => r.data);\n","/**\n * Various helpers to identify available operations for a template by a user.\n *\n * @module\n */\n\nimport {TSession, userHasPermissions} from '../Sessions';\nimport {ITemplateSummary} from './Types';\nimport {ITemplate} from '../Models';\n\n/**\n * Check to see if the user created the template.\n */\nexport const userIsTemplateCreator = (session: TSession, template: ITemplate | ITemplateSummary) =>\n session && template && session.profile_id === template.profile_id;\n\n/**\n * Check to see if a template is \"shared\" with the user.\n */\nexport const userHasSharedTemplate = (session: TSession, template: ITemplate | ITemplateSummary) =>\n session && template && !template.is_personal && session.organization_id === template.organization_id;\n\n/**\n * Check to see if the user can create a personal/private template.\n */\nexport const userCanCreatePersonalTemplate = (session: TSession) => userHasPermissions(session, ['template:creator:create:personal']);\n\n/**\n * Check to see if the user can create an org-shared template.\n */\nexport const userCanCreateOrgTemplate = (session: TSession) => userHasPermissions(session, ['template:creator:create:org']);\n\n/**\n * Check to see if the user can create a public template.\n */\nexport const userCanCreatePublicTemplate = (session: TSession) => userHasPermissions(session, ['template:creator:create:public']);\n\n/**\n * Check to see if the user can read/view a template.\n */\nexport const userCanReadTemplate = (session: TSession, template: ITemplate | ITemplateSummary) =>\n template.is_public ||\n userIsTemplateCreator(session, template) ||\n (userHasSharedTemplate(session, template) && userHasPermissions(session, ['template:member:read']));\n\n/**\n * Check to see if the user can update a tempate.\n */\nexport const userCanUpdateTemplate = (session: TSession, template: ITemplate | ITemplateSummary) =>\n userIsTemplateCreator(session, template) ||\n (userHasSharedTemplate(session, template) && userHasPermissions(session, ['template:member:read', 'template:member:write']));\n\n/**\n * Check to see if the user can change whether a template is personal vs org-shared.\n */\nexport const userCanMakeTemplatePrivate = (session: TSession, template: ITemplate | ITemplateSummary) =>\n userIsTemplateCreator(session, template)\n ? userHasPermissions(session, ['template:creator:create:personal'])\n : userHasPermissions(session, ['template:member:visibility']);\n\n/**\n * Check to see if the user can change whether a template is personal vs org-shared.\n */\nexport const userCanMakeTemplateShared = (session: TSession, template: ITemplate | ITemplateSummary) =>\n userIsTemplateCreator(session, template)\n ? userHasPermissions(session, ['template:creator:create:org'])\n : userHasPermissions(session, ['template:member:visibility']);\n\n/**\n * Check to see if the user can change whether a template is personal vs org-shared.\n */\nexport const userCanMakeTemplatePublic = (session: TSession, template: ITemplate | ITemplateSummary) =>\n userIsTemplateCreator(session, template)\n ? userHasPermissions(session, ['template:creator:create:public'])\n : userHasPermissions(session, ['template:member:visibility']);\n\n/**\n * Check to see if the user can change whether a template is personal vs org-shared.\n */\nexport const userCanChangeOrgVisibility = (session: TSession, template: ITemplate | ITemplateSummary) =>\n userIsTemplateCreator(session, template) && userHasPermissions(session, ['template:creator:create:personal']);\n\n/**\n * Check to see if the user can change whether a template is personal vs org-shared.\n */\nexport const userCanDeleteTemplate = (session: TSession, template: ITemplate | ITemplateSummary) =>\n userIsTemplateCreator(session, template)\n ? userHasPermissions(session, ['template:creator:delete'])\n : userHasPermissions(session, ['template:member:delete']);\n\n/**\n * Confirm whether the user can create an envelope using the specified template.\n */\nexport const userCanSendTemplate = (session: TSession, template: ITemplate | ITemplateSummary) => {\n switch (template.sender) {\n case 'creator':\n return userIsTemplateCreator(session, template);\n case 'organization_member':\n case 'organization_member_as_creator':\n return userIsTemplateCreator(session, template) || template.organization_id === session?.organization_id;\n default:\n return true;\n }\n};\n\n/**\n * Confirm whether the user can create a new template.\n */\nexport const userCanCreateTemplate = (session: TSession) =>\n userCanCreatePersonalTemplate(session) || userCanCreateOrgTemplate(session) || userCanCreatePublicTemplate(session);\n\n/**\n * Check to see if the user can \"build\" the template (use the field builder). The user must have write access to the\n * template, and the template must have at least one signer role.\n */\nexport const userCanBuildTemplate = (session: TSession, template: ITemplate) =>\n userCanUpdateTemplate(session, template) && (template.roles || []).filter((role) => role.type === 'signer').length > 0;\n\nexport const getFieldsForRole = (template: ITemplate, role_name: string) =>\n (template.fields || []).filter((field) => field.role_name === role_name);\n\n/**\n * Check to see if the user can preview the template. The user must have read access to the template, the template must\n * have at least one signer, and every signer must have at least one field.\n */\nexport const userCanPreviewTemplate = (session: TSession, template: ITemplate) => {\n const hasPermission = userCanReadTemplate(session, template);\n const signers = (template.roles || []).filter((role) => role.type === 'signer');\n return hasPermission && signers.length > 0 && signers.every((signer) => getFieldsForRole(template, signer.name).length > 0);\n};\n","import {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {IReminder, ITemplate} from '../Models';\n\nexport interface ICreateTemplateReminderRequest {\n setup_time: number;\n interval_time: number;\n}\n\n/**\n * Enable automatic reminders. setup_time is the number of days after the envelope is sent that the first reminder\n * should be sent. interval_time is the number of days between reminders.\n */\nexport const createTemplateReminder = (endpoint: VerdocsEndpoint, templateId: string, params: ICreateTemplateReminderRequest) =>\n endpoint.api //\n .post<ITemplate>(`/templates/${templateId}/reminder/`, params)\n .then((r) => r.data);\n\n/**\n * Get the reminder configuration for a template.\n */\nexport const getTemplateReminder = (endpoint: VerdocsEndpoint, templateId: string, reminderId: string) =>\n endpoint.api //\n .get<IReminder>(`/templates/${templateId}/reminder/${reminderId}`)\n .then((r) => r.data);\n\n/**\n * Update the reminder configuration for a template.\n */\nexport const updateTemplateReminder = (\n endpoint: VerdocsEndpoint,\n templateId: string,\n reminderId: string,\n params: ICreateTemplateReminderRequest,\n) =>\n endpoint.api //\n .put<IReminder>(`/templates/${templateId}/reminder/${reminderId}`, params)\n .then((r) => r.data);\n\n/**\n * Delete the reminder configuration for a template.\n */\nexport const deleteTemplateReminder = (endpoint: VerdocsEndpoint, templateId: string, reminderId: string) =>\n endpoint.api //\n .delete(`/templates/${templateId}/reminder/${reminderId}`)\n .then((r) => r.data);\n","/**\n * A \"role\" is an individual participant in a signing flow, such as a signer or CC contact. Roles are identified by\n * their names, which must be unique (e.g. 'Recipient 1'). Template fields are assigned to roles for signing operations,\n * so you may have 'Recipient 1 Signature 1' and so forth.\n *\n * @module\n */\n\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {ITemplateField, IRole} from '../Models';\n\nexport const createTemplateRole = (endpoint: VerdocsEndpoint, templateId: string, params: IRole) =>\n endpoint.api //\n .post<IRole>(`/templates/${templateId}/roles`, params)\n .then((r) => r.data);\n\nexport const getTemplateRoles = (endpoint: VerdocsEndpoint, templateId: string) =>\n endpoint.api //\n .get<IRole[]>(`/templates/${templateId}/roles`)\n .then((r) => r.data);\n\nexport const getTemplateRole = (endpoint: VerdocsEndpoint, templateId: string, roleName: string) =>\n endpoint.api //\n .get<IRole>(`/templates/${templateId}/roles/${roleName}`)\n .then((r) => r.data);\n\nexport const updateTemplateRole = (endpoint: VerdocsEndpoint, templateId: string, roleName: string, params: Partial<IRole>) =>\n endpoint.api //\n .put<IRole>(`/templates/${templateId}/roles/${roleName}`, params)\n .then((r) => r.data);\n\nexport const deleteTemplateRole = (endpoint: VerdocsEndpoint, templateId: string, roleName: string) =>\n endpoint.api //\n .delete(`/templates/${templateId}/roles/${roleName}`)\n .then((r) => r.data);\n\nexport const getTemplateRoleFields = (endpoint: VerdocsEndpoint, templateId: string, roleName: string) =>\n endpoint.api //\n .get<ITemplateField[]>(`/templates/${templateId}/roles/${roleName}/fields`)\n .then((r) => r.data);\n","import {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {IStar, ITemplateSummary} from './Types';\n\n/**\n * Get the template stars for a template.\n */\nexport const getStars = (endpoint: VerdocsEndpoint, templateId: string) =>\n endpoint.api //\n .get<IStar[]>(`/templates/${templateId}/stars`)\n .then((r) => r.data);\n\n/**\n * Toggle the template star for a template.\n */\nexport const toggleStar = (endpoint: VerdocsEndpoint, templateId: string) =>\n endpoint.api //\n .post<ITemplateSummary>(`/templates/${templateId}/stars/toggle`)\n .then((r) => r.data);\n","/**\n * A Tag is a user-specified label applied to a template. Tags help users organize and find Templates.\n * recipients. Every Organization has a set of tags \"owned\" by that Organization and only visible inside it.\n * Verdocs also provides a set of system-wide \"featured\" tags available to all Organizations.\n *\n * @module\n */\n\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {ITemplateTag, ITag} from './Types';\n\n/**\n * Apply a tag to a template.\n */\nexport const addTemplateTag = (endpoint: VerdocsEndpoint, templateId: string, params: ITag) =>\n endpoint.api //\n .post<ITemplateTag>(`/templates/${templateId}/tags/`, params)\n .then((r) => r.data);\n\n/**\n * Get all tags for a template.\n */\nexport const getTemplateTags = (endpoint: VerdocsEndpoint, templateId: string) =>\n endpoint.api //\n .get<ITemplateTag[]>(`/templates/${templateId}/tags/`)\n .then((r) => r.data);\n\n/**\n * Remove a tag from a template.\n */\nexport const deleteTemplateTag = (endpoint: VerdocsEndpoint, templateId: string, tagName: string) =>\n endpoint.api //\n .post(`/templates/${templateId}/tags/${tagName}`)\n .then((r) => r.data);\n\n/**\n * Create an Organization-wide tag.\n */\nexport const createTag = (endpoint: VerdocsEndpoint, name: string) =>\n endpoint.api //\n .post<ITag>('/tags', {tag_name: name})\n .then((r) => r.data);\n\n/**\n * Get an Organization-wide tag.\n */\nexport const getTag = (endpoint: VerdocsEndpoint, name: string) =>\n endpoint.api //\n .get<ITag>(`/tags/${name}`)\n .then((r) => r.data);\n\n/**\n * Get all tags available for use by an Organization.\n */\nexport const getAllTags = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<ITag[]>('/tags')\n .then((r) => r.data);\n","/**\n * A Template defines how a Verdocs signing flow will be performed, including attachments, signing fields, and\n * recipients.\n *\n * @module\n */\n\nimport {ITemplateOwnerInfo, ITemplateSearchParams, ITemplateSearchResult, ITemplateSummary} from './Types';\nimport {TSortTemplateBy, TTemplateSenderType} from '../BaseTypes';\nimport {IRole, ITemplate, ITemplateField} from '../Models';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {ITimePeriod} from '../Utils';\n\nexport interface IGetTemplatesParams {\n is_starred?: boolean;\n is_creator?: boolean;\n is_organization?: boolean;\n}\n\n/**\n * Get all templates accessible by the caller, with optional filters.\n *\n * ```typescript\n * import {Templates} from '@verdocs/js-sdk/Templates';\n *\n * await Templates.getTemplates((VerdocsEndpoint.getDefault());\n * await Templates.getTemplates((VerdocsEndpoint.getDefault(), { is_starred: true });\n * await Templates.getTemplates((VerdocsEndpoint.getDefault(), { is_creator: true });\n * await Templates.getTemplates((VerdocsEndpoint.getDefault(), { is_organization: true });\n * ```\n */\nexport const getTemplates = (endpoint: VerdocsEndpoint, params?: IGetTemplatesParams) =>\n endpoint.api //\n .post<ITemplate[]>('/templates', {params})\n .then((r) => r.data);\n\n// export interface IListTemplatesParams {\n// name?: string;\n// sharing?: 'all' | 'personal' | 'shared' | 'public';\n// starred?: 'all' | 'starred' | 'unstarred';\n// sort?: 'name' | 'created_at' | 'updated_at' | 'last_used_at' | 'counter' | 'star_counter';\n// direction?: 'asc' | 'desc';\n// page?: number;\n// rows?: number;\n// }\n\n/**\n * Lists all templates accessible by the caller, with optional filters.\n *\n * ```typescript\n * import {Templates} from '@verdocs/js-sdk/Templates';\n *\n * await Templates.listTemplates((VerdocsEndpoint.getDefault(), { sharing: 'personal', sort: 'last_used_at' });\n * ```\n */\n// export const listTemplates = (endpoint: VerdocsEndpoint, params?: IListTemplatesParams) =>\n// endpoint.api //\n// .post<ITemplateSummaries>('/templates/list', params, {baseURL: endpoint.getBaseURLv2()})\n// .then((r) => r.data);\n\n/**\n * Get one template by its ID.\n *\n * ```typescript\n * import {Templates} from '@verdocs/js-sdk/Templates';\n *\n * const template = await Templates.getTemplate((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9');\n * ```\n */\nexport const getTemplate = (endpoint: VerdocsEndpoint, templateId: string) =>\n endpoint.api //\n .get<ITemplate>(`/templates/${templateId}`)\n .then((r) => {\n const template = r.data;\n\n window?.console?.log('[JS_SDK] Post-processing template', template);\n\n // Post-process the template to upgrade to new data fields\n if (!template.documents && template.template_documents) {\n template.documents = template.template_documents;\n }\n\n template.documents?.forEach((document) => {\n if (!document.order) {\n document.order = 0;\n }\n\n if (document.page_numbers) {\n document.pages = document.page_numbers;\n }\n });\n\n template.fields?.forEach((field) => {\n if (field.setting) {\n field.settings = field.setting;\n }\n });\n\n return template;\n });\n\n/**\n * Get owner information for a template.\n *\n * ```typescript\n * import {Templates} from '@verdocs/js-sdk/Templates';\n *\n * const template = await Templates.getTemplateOwnerInfo((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9');\n * ```\n */\nexport const getTemplateOwnerInfo = (endpoint: VerdocsEndpoint, templateId: string) =>\n endpoint.api //\n .get<ITemplateOwnerInfo>(`/templates/${templateId}`)\n .then((r) => r.data);\n\n/**\n * Represents a document to be attached to a template via an externally-accessible URI. A copy of the document will be\n * downloaded from the specified URI. Note that the URI will be accessed without headers or other authorization methods\n * set, so the URI itself must encode any security tokens or keys required to access the file.\n */\nexport interface IDocumentFromUri {\n /** The URI to retrieve the file from. */\n uri: string;\n /** A name for the attachment. */\n name: string;\n}\n\n/**\n * Represents a document to be attached to a template via a Base64-encoded string attachment. This is the best option\n * for maximum security but there is a 10MB size limit for the entire creation request. Requests attaching larger files\n * should use `IDocumentFromUri` or add attachments via `createTemplateDocument` after creating the template.\n */\nexport interface IDocumentFromData {\n /** Base64-encoded file data. */\n data: string;\n /** A name for the attachment. */\n name: string;\n}\n\nexport interface ITemplateCreateParams {\n /** Name for the template to create. */\n name: string;\n /**\n * Optional (defaults to true). Personal templates are only visible to the owner. Non-personal templates are shared\n * within the user's organization.\n */\n is_personal?: boolean;\n /**\n * Optional (defaults to false). Public templates may be found (via search) and viewed by anyone.\n */\n is_public?: boolean;\n /** Optional (defaults to EVERYONE_AS_CREATOR). Who may create and send envelopes using this template. */\n sender?: TTemplateSenderType;\n /** Optional description for the template to help identify it. */\n description?: string;\n /**\n * Optional list of roles to create. Documents are required if roles or fields will also be specified. Files may\n * be attached via a number of methods (browser File object, remote URI reference, or Base64-encoded string) but\n * all entries must of of the same type. If browser File objects are provided, the request will use a FORM POST\n * call, otherwise it will use traditional XHR.\n */\n documents?: File[] | IDocumentFromUri[] | IDocumentFromData[];\n /**\n * Optional list of roles to create. Note that if roles are not included in the request, fields will be ignored.\n */\n roles?: IRole[];\n /**\n * Optional list of fields to create.\n */\n fields?: ITemplateField[];\n}\n\nconst ALLOWED_CREATE_FIELDS: (keyof ITemplateCreateParams)[] = [\n 'name',\n 'is_personal',\n 'is_public',\n 'sender',\n 'description',\n 'roles',\n 'fields',\n];\n\n/**\n * Create a template.\n *\n * ```typescript\n * import {Templates} from '@verdocs/js-sdk/Templates';\n *\n * const newTemplate = await Templates.createTemplate((VerdocsEndpoint.getDefault(), {...});\n * ```\n */\nexport const createTemplate = (\n endpoint: VerdocsEndpoint,\n params: ITemplateCreateParams,\n onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void,\n) => {\n const options = {\n timeout: 120000,\n onUploadProgress: (event: any) => {\n const total = event.total || 1;\n const loaded = event.loaded || 0;\n onUploadProgress?.(Math.floor((loaded * 100) / (total || 1)), loaded, total || 1);\n },\n };\n\n if (params.documents && params.documents[0] instanceof File) {\n if (params.documents.length > 10) {\n throw new Error('createTemplate() has a maximum of 10 documents that can be attached.');\n }\n\n const formData = new FormData();\n ALLOWED_CREATE_FIELDS.forEach((allowedKey) => {\n if (params[allowedKey as keyof ITemplateCreateParams] !== undefined) {\n formData.append(allowedKey, params[allowedKey] as any);\n }\n });\n\n params.documents.forEach((file) => {\n formData.append('documents', file as never as File, file.name);\n });\n\n return endpoint.api.post<ITemplate>('/templates', formData, options).then((r) => r.data);\n } else {\n return endpoint.api.post<ITemplate>('/templates', params, options).then((r) => r.data);\n }\n};\n\n/**\n * Create a template.\n *\n * ```typescript\n * import {Templates} from '@verdocs/js-sdk/Templates';\n *\n * const newTemplate = await Templates.createTemplatev2((VerdocsEndpoint.getDefault(), {...});\n * ```\n */\nexport const createTemplatev2 = (\n endpoint: VerdocsEndpoint,\n params: ITemplateCreateParams,\n onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void,\n) => {\n const options = {\n timeout: 120000,\n onUploadProgress: (event: any) => {\n const total = event.total || 1;\n const loaded = event.loaded || 0;\n onUploadProgress?.(Math.floor((loaded * 100) / (total || 1)), loaded, total || 1);\n },\n };\n\n if (params.documents && params.documents[0] instanceof File) {\n const formData = new FormData();\n ALLOWED_CREATE_FIELDS.forEach((allowedKey) => {\n if (params[allowedKey as keyof ITemplateCreateParams] !== undefined) {\n formData.append(allowedKey, params[allowedKey] as any);\n }\n });\n\n params.documents.forEach((file) => {\n formData.append('documents', file as never as File, file.name);\n });\n\n return endpoint.api.post<ITemplate>('/v2/templates', formData, options).then((r) => r.data);\n } else {\n return endpoint.api.post<ITemplate>('/v2/templates', params, options).then((r) => r.data);\n }\n};\n\nexport interface ITemplateCreateFromSharepointParams {\n /** Name for the template to create. */\n name: string;\n /** The site ID the source file is in. */\n siteId: string;\n /** The item ID of the source file. */\n itemId: string;\n /**\n * On-Behalf-Of access token generated for the request. This must have an audience of \"https://graph.microsoft.com\"\n * with Read access to the source file. This token is used ephemerally and discarded after the request, but it is\n * still recommended that you generate it with the minimal permissions possible.\n */\n oboToken: string;\n}\n\n/**\n * Create a template from a Sharepoint asset.\n *\n * ```typescript\n * import {Templates} from '@verdocs/js-sdk/Templates';\n *\n * const newTemplate = await Templates.createTemplateFromSharepoint((VerdocsEndpoint.getDefault(), {...});\n * ```\n */\nexport const createTemplateFromSharepoint = (endpoint: VerdocsEndpoint, params: ITemplateCreateFromSharepointParams) => {\n const options = {\n timeout: 120000,\n };\n\n return endpoint.api.post<ITemplate>('/templates/from-sharepoint', params, options).then((r) => r.data);\n};\n\n/**\n * Update a template.\n *\n * ```typescript\n * import {Templates} from '@verdocs/js-sdk/Templates';\n *\n * const updatedTemplate = await Templates.updateTemplate((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9', { name: 'New Name' });\n * ```\n */\nexport const updateTemplate = (endpoint: VerdocsEndpoint, templateId: string, params: Partial<ITemplateCreateParams>) =>\n endpoint.api //\n .put<ITemplate>(`/templates/${templateId}`, params)\n .then((r) => r.data);\n\n/**\n * Delete a template.\n *\n * ```typescript\n * import {Templates} from '@verdocs/js-sdk/Templates';\n *\n * await Templates.deleteTemplate((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9');\n * ```\n */\nexport const deleteTemplate = (endpoint: VerdocsEndpoint, templateId: string) =>\n endpoint.api //\n .delete(`/templates/${templateId}`)\n .then((r) => r.data);\n\n/**\n * Search for templates matching various criteria.\n *\n * ```typescript\n * import {Templates} from '@verdocs/js-sdk/Templates';\n *\n * const {result, page, total} = await Templates.search((VerdocsEndpoint.getDefault(), { ... });\n * ```\n */\nexport const searchTemplates = async (endpoint: VerdocsEndpoint, params: ITemplateSearchParams) =>\n endpoint.api //\n .post<ITemplateSearchResult>('/templates/search', params)\n .then((r) => r.data);\n\nexport interface ISearchTimeRange {\n start_time: string;\n end_time: string;\n}\n\nexport type IGetTemplateSummarySortBy = 'created_at' | 'updated_at' | 'name' | 'last_used_at' | 'counter' | 'star_counter';\n\nexport interface IGetTemplateSummaryParams {\n id?: string;\n name?: string;\n sender?: string;\n profile_id?: string;\n organization_id?: string;\n description?: string;\n created_at?: ISearchTimeRange;\n updated_at?: ISearchTimeRange;\n last_used_at?: ISearchTimeRange;\n is_personal?: boolean;\n is_public?: boolean;\n is_starred?: boolean;\n sort_by?: IGetTemplateSummarySortBy;\n ascending?: boolean;\n row?: number;\n page?: number;\n}\n\n/**\n * Get a summary of template data, typically used to populate admin panel dashboard pages.\n *\n * ```typescript\n * import {Templates} from '@verdocs/js-sdk/Templates';\n *\n * const summary = await Templates.getSummary((VerdocsEndpoint.getDefault(), 0);\n * ```\n */\nexport const getTemplatesSummary = async (endpoint: VerdocsEndpoint, params: IGetTemplateSummaryParams = {}) =>\n endpoint.api //\n .post<ITemplateSummary>('/templates/summary', params)\n .then((r) => r.data);\n\nconst cachedTemplates: Record<string, {loaded: number; template: ITemplate}> = {};\n\n/**\n * Wrapper for `getTemplate()` that limits queries to one every 2 seconds per template ID.\n * This is intended for use in component hierarchies that all rely on the same template\n * to avoid unnecessary repeat server calls.\n */\nexport const throttledGetTemplate = (endpoint: VerdocsEndpoint, templateId: string) => {\n if (cachedTemplates[templateId] && cachedTemplates[templateId].loaded + 2000 < new Date().getTime()) {\n return cachedTemplates[templateId].template;\n }\n\n return getTemplate(endpoint, templateId).then((template) => {\n cachedTemplates[templateId] = {loaded: new Date().getTime(), template};\n return template;\n });\n};\n\nexport interface ITemplateListParams {\n status?: string[];\n q?: string;\n created_at?: ITimePeriod;\n is_personal?: boolean;\n is_public?: boolean;\n sort_by?: TSortTemplateBy;\n ascending?: boolean;\n rows?: number;\n page?: number;\n}\n\n/**\n * List templates.\n *\n * ```typescript\n * import {Templates} from '@verdocs/js-sdk/Templates';\n *\n * const {totals, templates} = await Templates.listTemplates((VerdocsEndpoint.getDefault(), { q: 'test', sort: 'created_at' }); * ```\n */\nexport const listTemplates = async (endpoint: VerdocsEndpoint, params: ITemplateListParams = {}) =>\n endpoint.api //\n .post<{total: number; rows: number; page: number; templates: ITemplate[]}>('/templates/list', params)\n .then((r) => r.data);\n","/**\n * A TemplateDocument represents a PDF or other attachment in a Template.\n *\n * @module\n */\n\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {ITemplateDocument} from '../Models';\n\n/**\n * Get all the Template Documents associated to a particular Template.\n *\n * ```typescript\n * import {TemplateDocument} from '@verdocs/js-sdk/Templates';\n *\n * await TemplateDocument.geTemplateDocuments((VerdocsEndpoint.getDefault(), templateId);\n * ```\n */\nexport const getTemplateDocuments = (endpoint: VerdocsEndpoint, templateId: string) =>\n endpoint.api //\n .get<ITemplateDocument[]>(`/templates/${templateId}/documents/`)\n .then((r) => r.data);\n\n/**\n * Get a specific Document.\n *\n * ```typescript\n * import {TemplateDocument} from '@verdocs/js-sdk/Templates';\n *\n * await TemplateDocument.geTemplateDocument((VerdocsEndpoint.getDefault(), templateId,documentId);\n * ```\n */\nexport const getTemplateDocument = (endpoint: VerdocsEndpoint, templateId: string, documentId: string) =>\n endpoint.api //\n .get<ITemplateDocument>(`/templates/${templateId}/documents/${documentId}`)\n .then((r) => r.data);\n\n/**\n * Create a Document for a particular Template.\n *\n * ```typescript\n * import {TemplateDocument} from '@verdocs/js-sdk/Templates';\n *\n * await TemplateDocument.createDocument((VerdocsEndpoint.getDefault(), templateID, params);\n * ```\n */\nexport const createTemplateDocument = (\n endpoint: VerdocsEndpoint,\n templateId: string,\n file: File,\n onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void,\n) => {\n const formData = new FormData();\n formData.append('document', file, file.name);\n\n return endpoint.api //\n .post<ITemplateDocument>(`/templates/${templateId}/documents`, formData, {\n timeout: 120000,\n onUploadProgress: (event) => {\n const total = event.total || 1;\n const loaded = event.loaded || 0;\n onUploadProgress?.(Math.floor((loaded * 100) / (total || 1)), loaded, total || 1);\n },\n })\n .then((r) => r.data);\n};\n\n/**\n * Delete a specific Document.\n *\n * ```typescript\n * import {TemplateDocument} from '@verdocs/js-sdk/Templates';\n *\n * await TemplateDocument.deleteDocument((VerdocsEndpoint.getDefault(), templateID, documentID);\n * ```\n */\nexport const deleteTemplateDocument = (endpoint: VerdocsEndpoint, templateId: string, documentId: string) =>\n endpoint.api //\n .delete(`/templates/${templateId}/documents/${documentId}`)\n .then((r) => r.data);\n\n/**\n * Get (binary download) a file attached to a Template. It is important to use this method\n * rather than a direct A HREF or similar link to set the authorization headers for the\n * request.\n */\nexport const getTemplateDocumentFile = async (endpoint: VerdocsEndpoint, templateId: string, documentId: string) =>\n endpoint.api //\n .get(`/templates/${templateId}/documents/${documentId}?file=true`, {responseType: 'blob'})\n .then((r) => r.data);\n\n/**\n * Get (binary download) a file attached to a Template. It is important to use this method\n * rather than a direct A HREF or similar link to set the authorization headers for the\n * request.\n */\nexport const getTemplateDocumentThumbnail = async (endpoint: VerdocsEndpoint, templateId: string, documentId: string) =>\n endpoint.api //\n .get(`/templates/${templateId}/documents/${documentId}?thumbnail=true`, {responseType: 'blob'})\n .then((r) => r.data);\n\n/**\n * Get a display URI for a given page in a file attached to a template document. These pages are rendered server-side\n * into PNG resources suitable for display in IMG tags although they may be used elsewhere. Note that these are intended\n * for DISPLAY ONLY, are not legally binding documents, and do not contain any encoded metadata from participants. The\n * original asset may be obtained by calling `getTemplateDocumentFile()` or similar.\n */\nexport const getTemplateDocumentPageDisplayUri = async (endpoint: VerdocsEndpoint, templateId: string, documentId: string, page: number) =>\n endpoint.api.get<string>(`/templates/${templateId}/documents/${documentId}/pages/${page}/image`).then((r) => r.data);\n","import {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {IRole} from '../Models';\n\nexport interface IValidator {\n name: string;\n regex: string;\n}\n\n/**\n * Get all defined validators\n *\n * ```typescript\n * import {Documents} from '@verdocs/js-sdk/Templates';\n *\n * await Documents.getDocuments(templateID);\n * ```\n */\nexport const getValidators = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IValidator[]>('/validators')\n .then((r) => r.data);\n\nexport const getValidator = (endpoint: VerdocsEndpoint, validatorName: string) =>\n endpoint.api //\n .get<IValidator>(`/validators/${validatorName}`)\n .then((r) => r.data);\n\nconst EMAIL_REGEX =\n /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n\nexport const isValidEmail = (email: string | undefined) => !!email && EMAIL_REGEX.test(email);\n\n// @see https://www.regextester.com/1978\nconst PHONE_REGEX =\n /((?:\\+|00)[17](?: |\\-)?|(?:\\+|00)[1-9]\\d{0,2}(?: |\\-)?|(?:\\+|00)1\\-\\d{3}(?: |\\-)?)?(0\\d|\\([0-9]{3}\\)|[1-9]{0,3})(?:((?: |\\-)[0-9]{2}){4}|((?:[0-9]{2}){4})|((?: |\\-)[0-9]{3}(?: |\\-)[0-9]{4})|([0-9]{7}))/;\n\nexport const isValidPhone = (phone: string | undefined) => !!phone && PHONE_REGEX.test(phone);\n\nexport const isValidRoleName = (value: string, roles: IRole[]) => roles.findIndex((role) => role.name === value) !== -1;\n\nconst TagRegEx = /^[a-zA-Z0-9-]{0,32}$/;\n\nexport const isValidTag = (value: string, tags: string[]) => TagRegEx.test(value) || tags.findIndex((tag) => tag === value) !== -1;\n","import type {IAuthenticateResponse, IUpdatePasswordRequest, IUpdatePasswordResponse} from './Types';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\n\nexport interface IROPCRequest {\n grant_type: 'password';\n username: string;\n password: string;\n client_id?: string;\n scope?: string;\n}\n\nexport interface IClientCredentialsRequest {\n grant_type: 'client_credentials';\n client_id: string;\n client_secret: string;\n scope?: string;\n}\n\nexport interface IRefreshTokenRequest {\n grant_type: 'refresh_token';\n refresh_token: string;\n client_id?: string;\n scope?: string;\n}\n\nexport type TAuthenticationRequest = IROPCRequest | IClientCredentialsRequest | IRefreshTokenRequest;\n\n/**\n * Authenticate to Verdocs.\n *\n * ```typescript\n * import {authenticate, VerdocsEndpoint} from '@verdocs/js-sdk';\n *\n * // Client-side call, suitable for Web and mobile apps:\n * const {access_token} = await Auth.authenticate({ username: 'test@test.com', password: 'PASSWORD', grant_type:'password' });\n * VerdocsEndpoint.getDefault().setAuthToken(access_token);\n *\n * // Server-side call, suitable for server apps. NEVER EXPOSE client_secret IN FRONT-END CODE:\n * const {access_token} = await Auth.authenticate({ client_id: '...', client_secret: '...', grant_type:'client_credentials' });\n * VerdocsEndpoint.getDefault().setAuthToken(access_token);\n * ```\n */\nexport const authenticate = (endpoint: VerdocsEndpoint, params: TAuthenticationRequest) =>\n endpoint.api //\n .post<IAuthenticateResponse>('/v2/oauth2/token', params)\n .then((r) => r.data);\n\n/**\n * If called before the session expires, this will refresh the caller's session and tokens.\n *\n * ```typescript\n * import {Auth} from '@verdocs/js-sdk/Auth';\n * import {Transport} from '@verdocs/js-sdk/HTTP';\n *\n * const {accessToken} = await Auth.refreshTokens();\n * Transport.setAuthToken(accessToken);\n * ```\n */\nexport const refreshToken = (endpoint: VerdocsEndpoint, refreshToken: string) =>\n authenticate(endpoint, {grant_type: 'refresh_token', refresh_token: refreshToken});\n\n/**\n * Update the caller's password when the old password is known (typically for logged-in users).\n *\n * ```typescript\n * import {changePassword} from '@verdocs/js-sdk/Auth';\n *\n * const {status, message} = await changePassword({ email, oldPassword, newPassword });\n * if (status !== 'OK') {\n * window.alert(`Password reset error: ${message}`);\n * }\n * ```\n */\nexport const changePassword = (endpoint: VerdocsEndpoint, params: IUpdatePasswordRequest) =>\n endpoint.api //\n .post<IUpdatePasswordResponse>('/v2/users/change-password', params)\n .then((r) => r.data);\n\n/**\n * Request a password reset, when the old password is not known (typically in login forms).\n *\n * ```typescript\n * import {resetPassword} from '@verdocs/js-sdk/Auth';\n *\n * const {success} = await resetPassword({ email });\n * if (status !== 'OK') {\n * window.alert(`Please check your email for instructions on how to reset your password.`);\n * }\n * ```\n */\nexport const resetPassword = (endpoint: VerdocsEndpoint, params: {email: string}) =>\n endpoint.api //\n .post<{success: boolean}>('/v2/users/reset-password', params)\n .then((r) => r.data);\n\n/**\n * Resend the email verification request. Note that to prevent certain forms of abuse, the email address is not\n * a parameter here. Instead, the caller must be authenticated as the (unverified) user. To simplify this process,\n * the access token to be used may be passed directly as a parameter here. This avoids the need to set it as the\n * active token on an endpoint, which may be inconvenient in workflows where it is preferable to keep the user in\n * \"anonymous\" mode while verification is being performed.\n *\n * ```typescript\n * import {Auth} from '@verdocs/js-sdk/Auth';\n *\n * const result = await Auth.resendVerification();\n * ```\n */\nexport const resendVerification = (endpoint: VerdocsEndpoint, accessToken?: string) =>\n endpoint.api //\n .post<{result: 'done'}>('/v2/users/resend-verification', {}, accessToken ? {headers: {Authorization: `Bearer ${accessToken}`}} : {})\n .then((r) => r.data);\n","import {VerdocsEndpoint} from '../VerdocsEndpoint';\n\nexport const getNotifications = async (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get('/v2/notifications')\n .then((r) => r.data);\n","import type {ICreateAccountRequest, ICreateProfileRequest, ISwitchProfileResponse, IUpdateProfileRequest} from './Types';\nimport type {IOrganization, IProfile} from '../Models';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\n\n/**\n * Get the user's available profiles. The current profile will be marked with `current: true`.\n *\n * ```typescript\n * import {Profiles} from '@verdocs/js-sdk/Users';\n *\n * const profiles = await Profiles.getProfiles()\n * ```\n */\nexport const getProfiles = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IProfile[]>('/v2/profiles')\n .then((r) => r.data);\n\n/**\n * Get the user's available profiles. The current profile will be marked with `current: true`.\n *\n * ```typescript\n * import {Profiles} from '@verdocs/js-sdk/Users';\n *\n * const profiles = await Profiles.getCurrentProfile()\n * ```\n */\nexport const getCurrentProfile = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IProfile[]>('/v2/profiles')\n .then((r) => (r.data || []).find((profile) => profile.current));\n\n/**\n * Create a profile. If the caller does not have a \"current\" profile set, the new profile will be made current.\n *\n * ```typescript\n * import {Profiles} from '@verdocs/js-sdk/Users';\n *\n * const newProfile = await Profiles.createProfile({ first_name: 'FIRST', last_name: 'LAST', email: 'EMAIL' });\n * ```\n */\nexport const createProfile = (endpoint: VerdocsEndpoint, params: ICreateProfileRequest) =>\n endpoint.api //\n .post<IProfile>('/v2/profiles', params)\n .then((r) => r.data);\n\n/**\n * Get a profile. The caller must have admin access to the given profile.\n * TODO: Add a \"public\" profile endpoint for public pages\n *\n * ```typescript\n * import {Profiles} from '@verdocs/js-sdk/Users';\n *\n * const profile = await Profiles.getProfile('PROFILEID');\n * ```\n */\nexport const getProfile = (endpoint: VerdocsEndpoint, profileId: string) =>\n endpoint.api //\n .get<IProfile>(`/v2/profiles/${profileId}`)\n .then((r) => r.data);\n\n/**\n * Switch the caller's \"current\" profile. The current profile is used for permissions checking and profile_id field settings\n * for most operations in Verdocs. It is important to select the appropropriate profile before calling other API functions.\n *\n * ```typescript\n * import {Profiles} from '@verdocs/js-sdk/Users';\n *\n * const newProfile = await Profiles.switchProfile('PROFILEID');\n * ```\n */\nexport const switchProfile = (endpoint: VerdocsEndpoint, profileId: string) =>\n endpoint.api //\n .post<ISwitchProfileResponse>(`/v2/profiles/${profileId}/switch`)\n .then((r) => r.data);\n\n/**\n * Update a profile. For future expansion, the profile ID to update is required, but currently this must also be the\n * \"current\" profile for the caller.\n *\n * ```typescript\n * import {Profiles} from '@verdocs/js-sdk/Users';\n *\n * const newProfile = await Profiles.updateProfile('PROFILEID');\n * ```\n */\nexport const updateProfile = (endpoint: VerdocsEndpoint, profileId: string, params: IUpdateProfileRequest) =>\n endpoint.api //\n .patch<IProfile>(`/v2/profiles/${profileId}`, params)\n .then((r) => r.data);\n\n/**\n * Delete a profile. If the requested profile is the caller's curent profile, the next available profile will be selected.\n *\n * ```typescript\n * import {Profiles} from '@verdocs/js-sdk/Users';\n *\n * await Profiles.deleteProfile('PROFILEID');\n * ```\n */\nexport const deleteProfile = (endpoint: VerdocsEndpoint, profileId: string) =>\n endpoint.api //\n .delete(`/v2/profiles/${profileId}`)\n .then((r) => r.data);\n\n/**\n * Create a user account and parent organization. This endpoint is for creating a new organization. Users joining an\n * existing organization should be invited, and follow their invitation links/instructions to create their accounts.\n *\n * ```typescript\n * import {Profiles} from '@verdocs/js-sdk/Users';\n *\n * const newAccount = await Profiles.createBusinessAccount({\n * orgName: 'ORG', email: 'a@b.com', password: '12345678', firstName: 'FIRST', lastName: 'LAST'\n * });\n * ```\n */\nexport const createAccount = (endpoint: VerdocsEndpoint, params: ICreateAccountRequest) =>\n endpoint.api //\n .post<{profile: IProfile; organization: IOrganization}>('/user/business', params)\n .then((r) => r.data);\n\nexport interface ISignupSurvey {\n industry?: string;\n size?: string;\n source?: string;\n referral?: string;\n coupon?: string;\n reason?: string;\n hearabout?: string;\n}\n\nexport const recordSignupSurvey = (endpoint: VerdocsEndpoint, params: ISignupSurvey) =>\n endpoint.api //\n .post<{status: 'OK'}>('/user/signup', params)\n .then((r) => r.data);\n"],"names":["globalThis"],"mappings":";;AAEA;;A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