@verdocs/js-sdk 6.4.4 → 6.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/Lists.ts","../src/Utils/Colors.ts","../src/Utils/DateTime.ts","../src/Utils/Entitlements.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/Users/Auth.ts","../src/Users/Notifications.ts","../src/Users/Profiles.ts","../src/VerdocsEndpoint.ts","../src/Envelopes/Envelopes.ts","../src/Templates/Actions.ts","../src/Templates/Fields.ts","../src/Sessions/Permissions.ts","../src/Templates/Permissions.ts","../src/Templates/Roles.ts","../src/Templates/Templates.ts","../src/Templates/TemplateDocuments.ts","../src/Templates/Validators.ts","../src/Envelopes/Fields.ts","../src/Envelopes/Initials.ts","../src/Envelopes/KBA.ts","../src/Envelopes/Recipients.ts","../src/Envelopes/Permissions.ts","../src/Envelopes/Signatures.ts","../src/Envelopes/Types.ts","../src/Organizations/ApiKeys.ts","../src/Organizations/Contacts.ts","../src/Organizations/Groups.ts","../src/Organizations/Invitations.ts","../src/Organizations/Members.ts","../src/Organizations/Organizations.ts","../src/Organizations/Webhooks.ts"],"sourcesContent":["import type {TFieldType} from './BaseTypes';\n\nexport const FIELD_TYPES: TFieldType[] = [\n 'textbox',\n 'signature',\n 'initial',\n 'date',\n 'dropdown',\n 'timestamp',\n /** @deprecated. Use `textbox` with multiLine set to > 1 */\n 'textarea',\n 'checkbox',\n 'radio',\n 'attachment',\n 'payment',\n];\n\nexport const DEFAULT_FIELD_WIDTHS: Record<TFieldType, number> = {\n signature: 71,\n initial: 71,\n date: 75,\n timestamp: 130,\n textbox: 150,\n textarea: 150,\n checkbox: 14,\n radio: 14,\n dropdown: 85,\n attachment: 24,\n payment: 24,\n};\n\nexport const DEFAULT_FIELD_HEIGHTS: Record<TFieldType, number> = {\n signature: 36,\n initial: 36,\n date: 15,\n timestamp: 15,\n textbox: 15,\n textarea: 41,\n checkbox: 14,\n radio: 14,\n dropdown: 20,\n attachment: 24,\n payment: 24,\n};\n\nexport const WEBHOOK_EVENTS = [\n 'envelope_created',\n 'envelope_completed',\n 'envelope_canceled',\n\n 'template_created',\n 'template_updated',\n 'template_deleted',\n 'template_used',\n];\n\nexport const ALL_PERMISSIONS = [\n // TODO: Are these permissions still relevant?\n // 'member:view',\n // 'org:create',\n // 'org:view',\n // 'org:list',\n // 'org:transfer',\n\n 'template:creator:create:public',\n 'template:creator:create:org',\n 'template:creator:create:personal',\n 'template:creator:delete',\n 'template:creator:visibility',\n 'template:member:read',\n 'template:member:write',\n 'template:member:delete',\n 'template:member:visibility',\n 'owner:add',\n 'owner:remove',\n 'admin:add',\n 'admin:remove',\n 'member:view',\n 'member:add',\n 'member:remove',\n 'org:create',\n 'org:view',\n 'org:update',\n 'org:delete',\n 'org:transfer',\n 'org:list',\n 'envelope:create',\n 'envelope:cancel',\n 'envelope:view',\n];\n","import type {TRole} from '../Sessions';\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","const 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","import {TEntitlement} from '../BaseTypes';\nimport {IEntitlement} from '../Models';\n\nexport const collapseEntitlements = (entitlements: IEntitlement[]) => {\n const now = new Date();\n const activeEntitlements: Partial<Record<TEntitlement, IEntitlement>> = {};\n\n entitlements.forEach((entitlement) => {\n const start = new Date(entitlement.starts_at);\n const end = new Date(entitlement.ends_at);\n if (now >= start && now <= end && !activeEntitlements[entitlement.feature]) {\n activeEntitlements[entitlement.feature] = entitlement;\n }\n });\n\n return activeEntitlements;\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\n// Generate a random string of a given length. This is NOT cryptographically strong. It is meant for light-duty\n// uses such as assigning IDs to DOM elements.\nexport const randomString = (length: number) =>\n Math.random()\n .toString(36)\n .substring(2, 2 + length + 1);\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 = (source?: {first_name?: string | null; last_name?: string | null; [key: string]: any} | null) =>\n `${capitalize(source?.first_name || '')} ${capitalize(source?.last_name || '')}`.trim();\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 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 {IAuthenticateResponse, IChangePasswordRequest, IChangePasswordResponse, IVerifyEmailRequest} from './Types';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {IUser} from '../Models';\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 *\n * @group Authentication\n * @api POST /v2/oauth2/token Authenticate\n * @apiBody string(enum: 'client_credentials'|'refresh_token'|'password') grant_type The type of grant to request. API callers should nearly always use 'client_credentials'.\n * @apiBody string(format: 'uuid') client_id? If grant_type is client_credentials or refresh_token, the client ID of the API key to use.\n * @apiBody string(format: 'uuid') client_secret? If grant_type is client_credentials, the secret key of the API key to use.\n * @apiBody string username? If grant_type is password, the username to authenticate with.\n * @apiBody string password? If grant_type is password, the password to authenticate with.\n * @apiBody string password? If grant_type is password, the password to authenticate with.\n * @apiBody string scope? Optional scope to limit the auth token to. Do not specify this unless you are instructed to by a Verdocs Support rep.\n * @apiSuccess IAuthenticateResponse . The detailed metadata for the envelope requested\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, VerdocsEndpoint} from '@verdocs/js-sdk';\n *\n * const {accessToken} = await Auth.refreshTokens();\n * VerdocsEndpoint.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';\n *\n * const {status, message} = await changePassword({ old_password, new_password });\n * if (status !== 'OK') {\n * window.alert(`Password reset error: ${message}`);\n * }\n * ```\n *\n * @group Authentication\n * @api POST /v2/users/change-password Change the caller's password\n * @apiBody string old_password Current password for the caller\n * @apiBody string new_password New password to set for the caller. Must meet strength requirements.\n * @apiSuccess string . Success\n */\nexport const changePassword = (endpoint: VerdocsEndpoint, params: IChangePasswordRequest) =>\n endpoint.api //\n .post<IChangePasswordResponse>('/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';\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 * // Collect code and new password from the user, then call:\n *\n * const {success} = await resetPassword({ email, code, new_password });\n * if (status !== 'OK') {\n * window.alert(`Please check your verification code and try again.`);\n * }\n * ```\n *\n * @group Authentication\n * @api POST /v2/users/reset-password Reset a password for a user\n * @apiBody string email Email address for the user account\n * @apiBody string code? To initiate a reset request, omit this field. To complete it, provide the emailed code received by the user.\n * @apiBody string new_password? To initiate a reset request, omit this field. To complete it, provide the new password the user wishes to use.\n * @apiSuccess string . Success\n */\nexport const resetPassword = (endpoint: VerdocsEndpoint, params: {email: string; code?: string; new_password?: 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 if the email or token are unknown. Instead, an accessToken\n * may be supplied through which the user will be identified. This is intended to be used in post-signup\n * cases where the user is \"partially\" authenticated (has a session, but is not yet verified).\n *\n * ```typescript\n * import {resendVerification} from '@verdocs/js-sdk';\n *\n * const result = await resendVerification();\n * ```\n *\n * @group Authentication\n * @api POST /v2/users/verify Resend an email verification request for a \"partially\" authenticated user (authenticated, but not yet verified)\n * @apiSuccess string . Success\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\n/**\n * Resend the email verification request if the user is unauthenticated, but the email and token are known.\n * Used if the token is valid but has expired.\n *\n * ```typescript\n * import {resendVerification} from '@verdocs/js-sdk';\n *\n * const result = await resendVerification();\n * ```\n *\n * @group Authentication\n * @api POST /v2/users/verify Resend the email verification request if both the email and token are known. Used if the token is valid but has expired.\n * @apiSuccess IAuthenticateResponse . Updated authentication details\n */\nexport const verifyEmail = (endpoint: VerdocsEndpoint, params: IVerifyEmailRequest) =>\n endpoint.api //\n .post<IAuthenticateResponse>('/v2/users/verify', params)\n .then((r) => r.data);\n\n/**\n * Get the caller's current user record.\n *\n * @group Authentication\n * @api GET /v2/users/me Get the caller's user record.\n * @apiSuccess IUser . User record\n */\nexport const getMyUser = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IUser>('/v2/users/me')\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 {IAuthenticateResponse, IUpdateProfileRequest, ICreateProfileRequest} from './Types';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport type {IProfile} from '../Models';\n\n/**\n * Get the caller's available profiles. The current profile will be marked with `current: true`.\n *\n * ```typescript\n * import {getProfiles} from '@verdocs/js-sdk';\n *\n * const profiles = await getProfiles();\n * ```\n *\n * @group Profiles\n * @api GET /v2/profiles Get the caller's profiles\n * @apiDescription A user may have multiple profiles, one for each organization of which they are a member. Only one profile may be \"current\" at a time.\n * @apiSuccess array(items: IProfile) . The caller's profiles\n */\nexport const getProfiles = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IProfile[]>('/v2/profiles')\n .then((r) => r.data);\n\n/**\n * Get the caller's current profile. This is just a convenience accessor that calls `getProfiles()`\n * and returns the first `current: true` entry.\n *\n * ```typescript\n * import {getCurrentProfile} from '@verdocs/js-sdk';\n *\n * const profiles = await getCurrentProfile(VerdocsEndpoint.getDefault());\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 * Switch the caller's \"current\" profile. The current profile is used for permissions checking\n * and profile_id field settings for most operations in Verdocs. It is important to select the\n * appropropriate profile before calling other API functions.\n *\n * ```typescript\n * import {switchProfile} from '@verdocs/js-sdk';\n *\n * const newProfile = await switchProfile(VerdocsEndpoint.getDefault(), 'PROFILEID');\n * ```\n *\n * @group Profiles\n * @api POST /v2/profiles/:profile_id/switch Change the \"current\" profile for the caller\n * @apiSuccess IAuthenticateResponse . New authentication credentials\n */\nexport const switchProfile = (endpoint: VerdocsEndpoint, profileId: string) =>\n endpoint.api //\n .post<IAuthenticateResponse>(`/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\n * this must also be the \"current\" profile for the caller.\n *\n * ```typescript\n * import {updateProfile} from '@verdocs/js-sdk/Users';\n *\n * const newProfile = await updateProfile(VerdocsEndpoint.getDefault(), 'PROFILEID');\n * ```\n *\n * @group Profiles\n * @api PATCH /v2/profiles/:profile_id Update a profile\n * @apiBody string first_name? First name\n * @apiBody string last_name? Last name\n * @apiBody string phone? Phone number\n * @apiBody array(items:TPermission) permissions? New permissions to directly apply to the profile\n * @apiBody array(items:TRole) roles? New roles to assign to the profile\n * @apiSuccess IProfile . The updated profile\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\n * available profile will be selected.\n *\n * ```typescript\n * import {deleteProfile} from '@verdocs/js-sdk';\n *\n * await deleteProfile(VerdocsEndpoint.getDefault(), 'PROFILEID');\n * ```\n *\n * @group Profiles\n * @api DELETE /v2/profiles/:profile_id Delete a profile\n * @apiSuccess IAuthenticateResponse . New session tokens for the next available profile for the caller, or null if none.\n */\nexport const deleteProfile = (endpoint: VerdocsEndpoint, profileId: string) =>\n endpoint.api //\n .delete<IAuthenticateResponse | {status: 'OK'; message: 'Your last profile has been deleted. You are now logged out.'}>(\n `/v2/profiles/${profileId}`,\n )\n .then((r) => r.data);\n\n/**\n * Create a new profile. Note that there are two registration paths for creation:\n * - Get invited to an organization, by an admin or owner of that org.\n * - Created a new organization. The caller will become the first owner of the new org.\n *\n * This endpoint is for the second path, so an organization name is required. It is NOT\n * required to be unique because it is very common for businesses to have the same names,\n * without conflicting (e.g. \"Delta\" could be Delta Faucet or Delta Airlines).\n *\n * The new profile will automatically be set as the user's \"current\" profile, and new\n * session tokens will be returned to the caller. However, the caller's email may not yet\n * be verified. In that case, the caller will not yet be able to call other endpoints in\n * the Verdocs API. The caller will need to check their email for a verification code,\n * which should be submitted via the `verifyEmail` endpoint.\n *\n * ```typescript\n * import {createProfile} from '@verdocs/js-sdk';\n *\n * const newSession = await createProfile(VerdocsEndpoint.getDefault(), {\n * orgName: 'NEW ORG', email: 'a@b.com', password: '12345678', firstName: 'FIRST', lastName: 'LAST'\n * });\n * ```\n */\nexport const createProfile = (endpoint: VerdocsEndpoint, params: ICreateProfileRequest) =>\n endpoint.api //\n .post<IAuthenticateResponse>('/v2/profiles', params)\n .then((r) => r.data);\n\n/**\n * Update the caller's profile photo. This can only be called for the user's \"current\" profile.\n *\n * ```typescript\n * import {uploadProfilePhoto} from '@verdocs/js-sdk';\n *\n * await uploadProfilePhoto((VerdocsEndpoint.getDefault(), profileId, file);\n * ```\n *\n * @group Profiles\n * @api PATCH /v2/templates/:template_id Change a profile's photo\n * @apiBody string(format:binary) file File to upload\n * @apiSuccess IProfile . The updated profile\n */\nexport const updateProfilePhoto = (\n endpoint: VerdocsEndpoint,\n profileId: string,\n file: File,\n onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void,\n) => {\n const formData = new FormData();\n formData.append('picture', file, file.name);\n\n return endpoint.api //\n .patch<IProfile>(`/v2/profiles/${profileId}`, 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","import axios, {AxiosInstance} from 'axios';\nimport {TSession, TSessionType} from './Sessions';\nimport {decodeAccessTokenBody, randomString} from './Utils';\nimport globalThis from './Utils/globalThis';\nimport {getCurrentProfile} from './Users';\nimport {IProfile} from './Models';\nimport axiosRetry from 'axios-retry';\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('verdocs-default-endpoint');\n\nconst BETA_ORIGINS = [\n //\n 'https://beta.verdocs.com',\n 'https://stage.verdocs.com',\n 'http://localhost:6006',\n 'http://localhost:5173',\n];\n\nconst requestLogger = (r: any) => {\n // TODO: Re-activate logging via an isomorphic approach\n return r;\n};\n\nconst isBrowser = typeof globalThis.window !== 'undefined';\n\nexport type TEnvironment = '' | 'beta';\n\nexport type TSessionChangedListener = (endpoint: VerdocsEndpoint, session: TSession, profile: IProfile | null) => void;\n\nexport interface VerdocsEndpointOptions {\n baseURL?: string;\n timeout?: number;\n environment?: TEnvironment;\n sessionType?: TSessionType;\n clientID?: string;\n /** By default, sessions will be persisted to localStorage. Set `persist` to false to bypass this. */\n persist?: boolean;\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 persist = true;\n private baseURL = BETA_ORIGINS.includes(globalThis.window?.location?.origin || '')\n ? 'https://stage-api.verdocs.com'\n : 'https://api.verdocs.com';\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 public endpointId = randomString(8);\n\n /**\n * The current user's userId (NOT profileId), or null if not authenticated.\n */\n public sub = null as string | 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 /**\n * The current user's profile, if known. Note that while sessions are loaded and handled synchronously,\n * profiles are loaded asynchronously and may not be available immediately after a session is loaded.\n * To ensure both are available, developers should subscribe to the `onSessionChanged` event, which\n * will not be fired until the profile is loaded and verified.\n */\n public profile = null as IProfile | null;\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.persist = options?.persist ?? this.persist;\n this.api = axios.create({baseURL: this.baseURL, timeout: this.timeout});\n\n // Enable the module but not for any requests, only a few get this\n axiosRetry(this.api, {retries: 0});\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 }\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 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 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, sessionType: TSessionType = 'user'): 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 return this.clearSession();\n }\n\n this.token = token;\n this.session = session;\n this.sub = session.sub;\n this.sessionType = sessionType;\n if (this.sessionType === 'user') {\n this.api.defaults.headers.common.Authorization = `Bearer ${token}`;\n if (this.persist && isBrowser) {\n globalThis.localStorage.setItem(this.sessionStorageKey(), token);\n }\n } else {\n // Required for legacy calls to rForm\n this.api.defaults.headers.common.signer = `Bearer ${token}`;\n // TODO: Once we confirm rForm doesn't react badly to this, we can switch over\n // this.api.defaults.headers.common.Authorization = `Bearer ${token}`;\n }\n\n if (this.sessionType === 'user') {\n getCurrentProfile(this)\n .then((r) => {\n this.profile = r || null;\n this.notifySessionListeners();\n })\n .catch((e) => {\n this.profile = null;\n this.sub = null;\n\n // We can't clear the token verdocs-auth may be using temporarily during registration\n if (this.persist) {\n this.clearSession();\n }\n });\n } else {\n this.notifySessionListeners();\n }\n\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 if (this.persist) {\n localStorage.removeItem(this.sessionStorageKey());\n }\n\n delete this.api.defaults.headers.common.Authorization;\n delete this.api.defaults.headers.common.signer;\n\n this.session = null;\n this.profile = null;\n this.token = null;\n this.sub = null;\n\n this.notifySessionListeners();\n\n return this;\n }\n\n /**\n * Clear the active signing session.\n */\n public clearSignerSession() {\n if (this.persist) {\n localStorage.removeItem(this.sessionStorageKey());\n }\n\n delete this.api.defaults.headers.common.Authorization;\n\n this.session = null;\n this.profile = null;\n this.token = null;\n this.sub = 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, this.profile);\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 // Perform an immediate notification if this listener subscribed after the session was already loaded.\n if (this.profile) {\n listener(this, this.session, this.profile);\n }\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\n * when the app or component starts. Ignored if the endpoint is configured to not persist sessions.\n */\n public loadSession() {\n if (!this.persist) {\n return this;\n }\n\n const token = localStorage.getItem(this.sessionStorageKey());\n if (!token) {\n return this.clearSession();\n }\n\n // We sometimes get multiple loadSession calls from stacked components all needing to just ensure\n // we've done our best to load it. We only set it the first time to avoid dupe profile reloads\n // and upstream component notifications.\n return this.token ? this : this.setToken(token);\n }\n}\n","import {IEnvelope, IEnvelopeDocument, IEnvelopeField, IEnvelopeFieldSettings} from '../Models';\nimport {TEnvelopeUpdateResult} from '../BaseTypes';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {TCreateEnvelopeRequest} from './Types';\nimport axiosRetry from 'axios-retry';\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 * first_name: 'Paige',\n * last_name: '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 * first_name: 'Power',\n * last_name: '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 *\n * @group Envelopes\n * @api POST /v2/envelopes Create Envelope\n * @apiBody string(format:uuid) template_id If using a template, the ID of the template to copy\n * @apiBody array(items:ICreateEnvelopeRecipientDirectly) recipients A list of recipients to include in the workflow. Must specify one recipient to match each template Role.\n * @apiBody array(items:IEnvelopeDocument) documents? If not using a template, a list of documents to include in the envelope.\n * @apiBody array(items:IEnvelopeField) fields? If not using a template, a list of fields to include in the envelope.\n * @apiBody string name? Override the name of the envelope (defaults to the template name).\n * @apiBody string description? Override the description of the envelope (defaults to the template description).\n * @apiBody boolean no_contact? If set to true, no email or SMS messages will be sent to any recipients.\n * @apiBody integer(min: 0) initial_reminder? Override the template initial-reminder setting in ms.\n * @apiBody integer(min: 0) followup_reminders? Override the template initial-reminder setting in ms.\n * @apiBody string expires_at? If set, the envelope will automatically expire (be canceled) at this date and time. Expirations must be at least 1 day in the future.\n * @apiSuccess IEnvelope . The newly-created envelope.\n */\nexport const createEnvelope = async (endpoint: VerdocsEndpoint, request: TCreateEnvelopeRequest) =>\n endpoint.api //\n .post<IEnvelope>('/v2/envelopes', request)\n .then((r) => r.data);\n\n/**\n * Get all metadata for an envelope. Note that when called by non-creators (e.g. Recipients)\n * this will return only the **metadata** the caller is allowed to view.\n *\n * @group Envelopes\n * @api GET /v2/envelopes/:id Get envelope details\n * @apiParam string(format: 'uuid') id The ID of the envelope to retrieve.\n * @apiSuccess IEnvelope . The detailed metadata for the envelope requested\n */\nexport const getEnvelope = async (endpoint: VerdocsEndpoint, envelopeId: string) =>\n endpoint.api //\n .get<IEnvelope>(`/v2/envelopes/${envelopeId}`)\n .then((r) => r.data);\n\n/**\n * Get all metadata for an envelope document. Note that when called by non-creators (e.g. Recipients)\n * this will return only the **metadata** the caller is allowed to view.\n *\n * @group Envelope Documents\n * @api GET /v2/envelope-documents/:id Get envelope document\n * @apiParam string(format: 'uuid') document_id The ID of the document to retrieve.\n * @apiSuccess IEnvelopeDocument . The detailed metadata for the document requested\n */\nexport const getEnvelopeDocument = async (endpoint: VerdocsEndpoint, documentId: string) =>\n endpoint.api //\n .get<IEnvelopeDocument>(`/v2/envelope-documents/${documentId}`)\n .then((r) => r.data);\n\n/**\n * Download a document directly.\n */\nexport const downloadEnvelopeDocument = async (endpoint: VerdocsEndpoint, documentId: string) =>\n endpoint.api //\n .get(`/v2/envelope-documents/${documentId}?type=file`, {\n responseType: 'blob',\n 'axios-retry': {retries: 5, retryDelay: axiosRetry.linearDelay(3000)},\n })\n .then((r) => r.data);\n\n/**\n * Get an envelope document's metadata, or the document itself. If no \"type\" parameter is specified,\n * the document metadata is returned. If \"type\" is set to \"file\", the document binary content is\n * returned with Content-Type set to the MIME type of the file. If \"type\" is set to \"download\", a\n * string download link will be returned. If \"type\" is set to \"preview\" a string preview link will\n * be returned. This link expires quickly, so it should be accessed immediately and never shared.\n *\n * @group Envelope Documents\n * @api GET /v2/envelope-documents/:document_id Preview, Download, or Link to a Document\n * @apiParam string(format: 'uuid') document_id The ID of the document to retrieve.\n * @apiQuery string(enum:'file'|'download'|'preview') type? Download the file directly, generate a download link, or generate a preview link.\n * @apiSuccess string . The generated link.\n */\nexport const getEnvelopeDocumentDownloadLink = async (endpoint: VerdocsEndpoint, documentId: string) =>\n endpoint.api //\n .get<string>(`/v2/envelope-documents/${documentId}?type=download`, {\n 'axios-retry': {retries: 5, retryDelay: axiosRetry.linearDelay(3000)},\n })\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 getEnvelopeDocumentPreviewLink = async (endpoint: VerdocsEndpoint, documentId: string) =>\n endpoint.api //\n .get<string>(`/v2/envelope-documents/${documentId}?type=preview`, {\n 'axios-retry': {retries: 5, retryDelay: axiosRetry.linearDelay(3000)},\n })\n .then((r) => r.data);\n\n/**\n * Cancel an Envelope.\n *\n * @group Envelopes\n * @api PUT /v2/envelopes/:id Cancel envelope\n * @apiParam string(format: 'uuid') id The ID of the envelope to cancel.\n * @apiBody string(enum: 'cancel') action The action to perform (currently only \"cancel\" is supported).\n * @apiSuccess IEnvelope . The updated envelope.\n */\nexport const cancelEnvelope = async (endpoint: VerdocsEndpoint, envelopeId: string) =>\n endpoint.api //\n .put<TEnvelopeUpdateResult>(`/v2/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 *\n * @deprecated Use getDocumentPreviewLink/getDocumentDownloadLink/downloadDocument instead.\n */\nexport const getEnvelopeFile = async (endpoint: VerdocsEndpoint, documentId: string) =>\n endpoint.api //\n .get(`/v2/envelope-documents/${documentId}?type=file`, {responseType: 'blob'})\n .then((r) => r.data);\n\n/**\n * Update an envelope. Currently, only reminder settings may be changed.\n *\n * @group Envelopes\n * @api PATCH /v2/envelopes/:id Update Envelope\n * @apiParam string(format: 'uuid') id The ID of the envelope to update.\n * @apiBody string name? New name for the envelope\n * @apiBody string sender_name? New Sender Name for the envelope\n * @apiBody string sender_email? New Sender Email for the envelope\n * @apiBody integer(min: 0) initial_reminder? Change the initial-reminder setting (in ms).\n * @apiBody integer(min: 0) followup_reminders? Change the followup-reminder setting (in ms).\n * @apiBody string expires_at? If set, the envelope will automatically expire (be canceled) at this date and time. Expirations must be at least 1 day in the future.\n * @apiBody string(enum:'private'|'shared') visibility? Change the envelope's visibility setting\n * @apiBody boolean no_contact? If set to true, no email or SMS messages will be sent to any recipients.\n * @apiBody object data? Update the developer-supplied metadata attached to the envelope.\n * @apiSuccess IEnvelope . A copy of the newly-updated envelope.\n */\nexport const updateEnvelope = async (\n endpoint: VerdocsEndpoint,\n envelopeId: string,\n params: Partial<\n Pick<\n IEnvelope,\n | 'name'\n | 'sender_name'\n | 'sender_email'\n | 'initial_reminder'\n | 'followup_reminders'\n | 'expires_at'\n | 'visibility'\n | 'no_contact'\n | 'data'\n >\n >,\n) =>\n endpoint.api //\n .patch<IEnvelope>(`/v2/envelopes/${envelopeId}`, params)\n .then((r) => r.data);\n\n/**\n * Update an Envelope field. Typically called during the signing process as a Recipient fills in fields.\n *\n * @group Envelopes\n * @api PUT /v2/envelopes/:envelope_id/fields/:field_name Update Envelope Field\n * @apiParam string(format: 'uuid') envelope_id The ID of the envelope to retrieve.\n * @apiParam string role_name The role to submit. Be sure to URL-encode the value.\n * @apiParam string field_name The name of the field to update. Be sure to URL-encode the value.\n * @apiParam string value The value to set. For signature/initial fields, the UUID of the signature/initial block. For attachment fields, a file uploaded in a FORM-POST field named \"document\". For checkbox/radio buttons, a boolean. For all other fields, a string.\n * @apiBody string value Value to set.\n * @apiSuccess IEnvelopeField . A copy of the newly-updated field.\n */\nexport const updateEnvelopeField = async (\n endpoint: VerdocsEndpoint,\n envelopeId: string,\n roleName: string,\n fieldName: string,\n value: string,\n prepared: boolean,\n) =>\n endpoint.api //\n .put<IEnvelopeField>(`/v2/envelopes/${envelopeId}/recipients/${roleName}/fields/${fieldName}`, {value, prepared})\n .then((r) => r.data);\n\n/**\n * Upload an attachment to an attachment field.\n */\nexport const uploadEnvelopeFieldAttachment = async (\n endpoint: VerdocsEndpoint,\n envelopeId: string,\n roleName: 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 formData.append('value', '');\n\n return endpoint.api //\n .put<IEnvelopeFieldSettings>(`/v2/envelopes/${envelopeId}/recipients/${roleName}/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. Note that this is not a DELETE endpoint because the field itself is not\n * being deleted. Instead, it is a similar operation to uploading a new attachment, but the\n * omission of the attachment signals the server to delete the current entry.\n */\nexport const deleteEnvelopeFieldAttachment = async (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, fieldName: string) => {\n const formData = new FormData();\n // Omitting file is the trigger here\n\n return endpoint.api //\n .put<IEnvelopeFieldSettings>(`/v2/envelopes/${envelopeId}/recipients/${roleName}/fields/${fieldName}`, formData)\n .then((r) => r.data);\n};\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 *\n * @group Envelopes\n * @api GET /v2/envelope-documnets/page-image/:document_id/:variant/:page Get envelope document page display URI\n * @apiParam string(format: 'uuid') document_id The ID of the document to retrieve.\n * @apiParam string(enum: 'original'|'filled') variant The variant of the document to retrieve.\n * @apiParam integer page The page number to retrieve\n * @apiSuccess string . The page display URI. Note that this is a signed URL with a short expiration. It should be used immediately and never databased or cached.\n */\nexport const getEnvelopeDocumentPageDisplayUri = async (\n endpoint: VerdocsEndpoint,\n documentId: string,\n page: number,\n variant: 'original' | 'filled' | 'certificate' = 'original',\n) => endpoint.api.get<string>(`/v2/envelope-documents/page-image/${documentId}/${variant}/${page}`, {timeout: 20000}).then((r) => r.data);\n\nexport interface ITimeRange {\n start: string;\n end: string;\n}\n\nexport interface IListEnvelopesParams {\n q?: string;\n view?: 'inbox' | 'sent' | 'action' | 'waiting' | 'completed';\n status?: ('complete' | 'pending' | 'in progress' | 'declined' | 'canceled')[];\n include_org?: boolean;\n template_id?: string;\n created_before?: string;\n created_after?: string;\n sort_by?: 'name' | 'created_at' | 'updated_at' | 'canceled_at' | 'status';\n ascending?: boolean;\n rows?: number;\n page?: number;\n}\n\n/**\n * Lists all envelopes accessible by the caller, with optional filters.\n *\n * ```typescript\n * import {getEnvelopes} from '@verdocs/js-sdk/Envelopes';\n *\n * const {count, envelopes} = await getEnvelopes((VerdocsEndpoint.getDefault(), { q: 'test' });\n * ```\n *\n * @group Envelopes\n * @api GET /v2/envelopes List envelopes\n * @apiQuery string q? Match envelopes whose name contains this string\n * @apiQuery string(enum: 'inbox' | 'sent' | 'action' | 'waiting' | 'completed') view? Request pre-defined view. `inbox` returns envelopes where action is required by the caller. `sent` returns envelopes created by the caller. `action` returns envelopes where action is required by the caller. `waiting` returns envelopes where action is required by anyone. `completed` returns envelopes where all actions are complete.\n * @apiQuery array(items: 'complete' | 'pending' | 'in progress' | 'declined' | 'canceled') status? Match envelopes in one of the specified states.\n * @apiQuery boolean(default: false) include_org? If true, include organizations-shared envelopes\n * @apiQuery string(format: uuid) template_id? Match envelopes created from the specified template ID\n * @apiQuery string(format: date-time) created_before? Match envelopes created before this date\n * @apiQuery string(format: date-time) created_after? Match envelopes created after this date\n * @apiQuery string(enum: 'name' | 'created_at' | 'updated_at' | 'canceled_at' | 'status') sort_by? Return results sorted by this criteria\n * @apiQuery boolean ascending? Set true/false to override the sort direction. Note that the default depends on `sort_by`. Date-based sorts default to descending, while name and status default to ascending.\n * @apiQuery integer(default: 20) rows? Limit the number of rows returned\n * @apiQuery integer(default: 0) page? Specify which page of results to return\n * @apiSuccess integer(format: int32) count The total number of records matching the query, helpful for pagination\n * @apiSuccess integer(format: int32) rows The number of rows returned in this response page\n * @apiSuccess integer(format: int32) page The page number of this response\n * @apiSuccess array(items: IEnvelope) envelopes List of envelopes found\n */\nexport const getEnvelopes = (endpoint: VerdocsEndpoint, params?: IListEnvelopesParams) =>\n endpoint.api //\n .get<{count: number; rows: number; page: number; envelopes: IEnvelope[]}>('/v2/envelopes', {params})\n .then((r) => r.data);\n\n/**\n * Generate a ZIP file containing all data for the specified envelopes. The caller must be the\n * owner of each envelope. The returned ZIP file contains a folder for each envelope.\n */\nexport const getEnvelopesZip = (endpoint: VerdocsEndpoint, envelope_ids: string[]) =>\n endpoint.api //\n .get(`/v2/envelopes/zip/${envelope_ids.join(',')}`, {responseType: 'blob', timeout: 120000});\n\n/**\n * Utility function to sort fields by page, then by Y coordinate, then by X coordinate.\n * NOTE: This function mutates the input array.\n */\nexport function sortFields(\n fields: {\n page?: number | null | undefined;\n x?: number | null | undefined;\n y?: number | null | undefined;\n height?: number | null | undefined;\n }[],\n) {\n fields.sort((a, b) => {\n const aPage = a.page || 0;\n const bPage = b.page || 0;\n const aX = a.x || 0;\n const aY = (a.y || 0) + (a.height || 0);\n const bX = b.x || 0;\n const bY = (b.y || 0) + (b.height || 0);\n\n if (aPage !== bPage) {\n return aPage - bPage;\n }\n\n // NOTE: Logic looks a little strange X vs Y. It's because we go top down,\n // left to right. But Y coordinates are inverted in PDFs. The reason for\n // the division is because no human makes perfect templates and frequently\n // two fields on the \"same line\" will be slightly offset vertically.\n const divaY = Math.floor(aY / 5);\n const divbY = Math.floor(bY / 5);\n if (divaY !== divbY) {\n return divbY - divaY;\n }\n\n return aX - bX;\n });\n\n return fields;\n}\n\n/**\n * Utility function to sort documents by their order, falling back to created_at.\n * NOTE: This function mutates the input array.\n */\nexport function sortDocuments(documents: {order: number; created_at: Date | string}[]) {\n return documents.sort((a, b) =>\n // The Date conversion is unnecessary 90% of the time but is safer, and this isn't something\n // we do much of so in reality it has almmost no impact.\n a.order !== b.order ? a.order - b.order : new Date(a.created_at).getTime() - new Date(b.created_at).getTime(),\n );\n}\n\n/**\n * Utility function to sort documents by their order, falling back to created_at.\n * NOTE: This function mutates the input array.\n */\nexport function sortRecipients(recipients?: {sequence: number; order: number}[]) {\n return recipients?.sort((a, b) => (a.sequence !== b.sequence ? b.sequence - a.sequence : b.order - a.order));\n}\n","import {TPermission, TTemplatePermission} from '../Sessions';\nimport {TTemplateAction} from '../BaseTypes';\nimport {IProfile, ITemplate} from '../Models';\n\nexport const canPerformTemplateAction = (\n profile: IProfile | null | undefined,\n action: TTemplateAction,\n template?: ITemplate,\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 = profile?.id || 'BOGUS';\n const organization_id = profile?.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(profile, 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 = (profile: IProfile | null | undefined, permissions: TPermission[]) =>\n permissions.every((perm) => (profile?.permissions || []).includes(perm));\n","import {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {ITemplateField} from '../Models';\n\n/**\n * Add a field to a template.\n *\n * ```typescript\n * import {createField} from '@verdocs/js-sdk/Templates';\n *\n * await createField((VerdocsEndpoint.getDefault(), template_id, { ... });\n * ```\n *\n * @group Fields\n * @api POST /v2/fields/:template_id Add a field to a template\n * @apiBody string name Name for the new field. Field names must be unique within a template. Although special characters are allowed, they must be URL-encoded in subsequent requests, so it is recommended to use only alphanumeric characters and hyphens if possible.\n * @apiBody string role_name Role to assign to the field. Role names must be valid, so it is recommended to create roles before fields.\n * @apiBody string document_id ID of the document upon which to place the field.\n * @apiBody string(enum: 'signature' | 'initial' | 'checkbox' | 'radio' | 'textbox' | 'timestamp' | 'date' | 'dropdown' | 'textarea' | 'attachment' | 'payment') type Type of field to create\n * @apiBody boolean(default: false) required Whether the field is required\n * @apiBody integer(min: 0) page 0-based page number upon which to place the field\n * @apiBody integer(min: 0) x X position for the field (left to right)\n * @apiBody integer(min: 0) y Y position for the field (_bottom to top!_)\n * @apiBody string label? Optional label to display above the field\n * @apiBody integer(min: 50) width? Width of the field. Note that all fields have built-in defaults, and it is recommended that this only be set on text fields.\n * @apiBody integer(min: 15) height? Height of the field. Note that all fields have built-in defaults, and it is recommended that this only be set on text fields.\n * @apiBody string placeholder? Optional placeholder to display in text fields\n * @apiBody string group? For fields that support grouping (radio buttons and check boxes) the value selected will be stored under this name\n * @apiBody array(items:IDropdownOption) options? For dropdown fields, the options to display\n * @apiBody string value? Optional default value to set on the field\n * @apiSuccess ITemplateField . Template field\n */\nexport const createField = (endpoint: VerdocsEndpoint, templateId: string, params: ITemplateField) =>\n endpoint.api //\n .post<ITemplateField>(`/v2/fields/${templateId}`, params)\n .then((r) => r.data);\n\n/**\n * Update a template field.\n *\n * ```typescript\n * import {updateField} from '@verdocs/js-sdk/Templates';\n *\n * await updateField((VerdocsEndpoint.getDefault(), template_id, field_name, { ... });\n * ```\n *\n * @group Fields\n * @api PATCH /v2/fields/:template_id/:field_name Update a field. See createField for additional details on the supported parameters.\n * @apiBody string name? Rename the field. Note that template field names must be unique within a template.\n * @apiBody string role_name Role to assign to the field.\n * @apiBody string document_id ID of the document upon which to place the field.\n * @apiBody string(enum: 'signature' | 'initial' | 'checkbox' | 'radio' | 'textbox' | 'timestamp' | 'date' | 'dropdown' | 'textarea' | 'attachment' | 'payment') type? Change the field type. Note that while this is technically allowed, fields have different behaviors, validators, default sizes, etc. It is usually easier to add a new field and delete the old one.\n * @apiBody boolean(default: false) required? Whether the field is required\n * @apiBody integer(min: 0) page? 0-based page number upon which to place the field\n * @apiBody integer(min: 0) x? X position for the field (left to right)\n * @apiBody integer(min: 0) y? Y position for the field (_bottom to top!_)\n * @apiBody string label? Optional label to display above the field\n * @apiBody integer(min: 50) width? Width of the field. Note that all fields have built-in defaults, and it is recommended that this only be set on text fields.\n * @apiBody integer(min: 15) height? Height of the field. Note that all fields have built-in defaults, and it is recommended that this only be set on text fields.\n * @apiBody string placeholder? Optional placeholder to display in text fields\n * @apiBody string group? For fields that support grouping (radio buttons and check boxes) the value selected will be stored under this name\n * @apiBody array(items:IDropdownOption) options? For dropdown fields, the options to display\n * @apiBody string value? Optional default value to set on the field\n * @apiSuccess ITemplateField . Updated template field\n */\nexport const updateField = (endpoint: VerdocsEndpoint, templateId: string, name: string, params: Partial<ITemplateField>) =>\n endpoint.api //\n .patch<ITemplateField>(`/v2/fields/${templateId}/${encodeURIComponent(name)}`, params)\n .then((r) => r.data);\n\n/**\n * Remove a field from a template.\n *\n * ```typescript\n * import {deleteField} from '@verdocs/js-sdk/Templates';\n *\n * await deleteField((VerdocsEndpoint.getDefault(), template_id, field_name);\n * ```\n *\n * @group Fields\n * @api DELETE /v2/fields/:template_id/:field_name Delete a field\n * @apiSuccess string . Success\n */\nexport const deleteField = (endpoint: VerdocsEndpoint, templateId: string, name: string) =>\n endpoint.api //\n .delete(`/v2/fields/${templateId}/${encodeURIComponent(name)}`)\n .then((r) => r.data);\n","import {IProfile} from '../Models';\n\n/**\n * Create public templates. Public templates are still owned and managed by the creator,\n * but may be searched for and used to create envelopes by other users.\n */\nexport type TTemplatePermissionCreatePublic = 'template:creator:create:public';\n\n/**\n * Create templates shared with other users of the same organization.\n */\nexport type TTemplatePermissionCreateOrg = 'template:creator:create:org';\n\n/**\n * Create templates private to the creator.\n */\nexport type TTemplatePermissionCreatePersonal = 'template:creator:create:personal';\n\n/**\n * Create templates private to the creator.\n */\nexport type TTemplatePermissionDelete = 'template:creator:delete';\n\n/**\n * Alter the visiiblity settings on a template.\n */\nexport type TTemplatePermissionVisibility = 'template:creator:visibility';\n\n/**\n * View templates shared by other members of the same organization. Those templates must also\n * have `is_personal` set to false to be visible.\n */\nexport type TTemplateMemberRead = 'template:member:read';\n\n/**\n * Edit templates shared by other members of the same organization. Those templates must also\n * have `is_personal` set to false to be editable.\n */\nexport type TTemplateMemberWrite = 'template:member:write';\n\n/**\n * Edit templates shared by other members of the same organization. Those templates must also\n * have `is_personal` set to false to be editable.\n */\nexport type TTemplateMemberDelete = 'template:member:delete';\n\n/**\n * Edit templates shared by other members of the same organization. Those templates must also\n * have `is_personal` set to false to be editable.\n */\nexport type TTemplateMemberVisibility = 'template:member:visibility';\n\nexport type TTemplatePermission =\n | TTemplatePermissionCreatePublic\n | TTemplatePermissionCreateOrg\n | TTemplatePermissionCreatePersonal\n | TTemplatePermissionDelete\n | TTemplatePermissionVisibility\n | TTemplateMemberRead\n | TTemplateMemberWrite\n | TTemplateMemberDelete\n | TTemplateMemberVisibility;\n\n/**\n * Grant the \"owner\" role to other organization members.\n */\nexport type TAccountPermissionOwnerAdd = 'owner:add';\n\n/**\n * Remove the \"owner\" role from other organization members.\n */\nexport type TAccountPermissionOwnerRemove = 'owner:remove';\n\n/**\n * Grant the \"admin\" role to other organization members.\n */\nexport type TAccountPermissionAdminAdd = 'admin:add';\n\n/**\n * Remove the \"admin\" role from other organization members.\n */\nexport type TAccountPermissionAdminRemove = 'admin:remove';\n\n/**\n * View the members of an organization.\n */\nexport type TAccountPermissionMemberView = 'member:view';\n\n/**\n * Grant the \"member\" role to other organization members.\n */\nexport type TAccountPermissionMemberAdd = 'member:add';\n\n/**\n * Remove the \"member\" role from other organization members.\n */\nexport type TAccountPermissionMemberRemove = 'member:remove';\n\nexport type TAccountPermission =\n | TAccountPermissionOwnerAdd\n | TAccountPermissionOwnerRemove\n | TAccountPermissionAdminAdd\n | TAccountPermissionAdminRemove\n | TAccountPermissionMemberAdd\n | TAccountPermissionMemberRemove\n | TAccountPermissionMemberView;\n\n/**\n * Create a new organization.\n * @deprecated This is a system-wide setting and organization owners cannot prevent their\n * members from listing other organizations that they may have separate profiles in.\n */\nexport type TOrgPermissionCreate = 'org:create';\n\n/**\n * View the organization.\n */\nexport type TOrgPermissionView = 'org:view';\n\n/**\n * Update the organization.\n */\nexport type TOrgPermissionUpdate = 'org:update';\n\n/**\n * Delete the organization.\n */\nexport type TOrgPermissionDelete = 'org:delete';\n\n/**\n * Transfer ownership of the organization. This primarily allows the holder to remove his/her own\n * Owner role or add new Owners even if the holder is not one themselves. This is primarily intended\n * to be used for reseller scenarios.\n */\nexport type TOrgPermissionTransfer = 'org:transfer';\n\n/**\n * List organizations.\n * @deprecated This is a system-wide setting and organization owners cannot prevent their\n * members from listing other organizations that they may have separate profiles in.\n */\nexport type TOrgPermissionList = 'org:list';\n\nexport type TOrgPermission =\n | TOrgPermissionCreate\n | TOrgPermissionView\n | TOrgPermissionUpdate\n | TOrgPermissionDelete\n | TOrgPermissionTransfer\n | TOrgPermissionList;\n\n/**\n * Create envelopes.\n */\nexport type TEnvelopePermissionCreate = 'envelope:create';\n\n/**\n * Cancel envelopes. This is a default permission for most users, but it may be removed for\n * highly regulated environments where envelope activities must be audited, and should not\n * be canceled.\n */\nexport type TEnvelopePermissionCancel = 'envelope:cancel';\n\n/**\n * View envelopes. This is a default permission for most users, but it may be removed for\n * highly regulated environments where once sent, envelopes may only be viewed by specific\n * users.\n */\nexport type TEnvelopePermissionView = 'envelope:view';\n\n/**\n * View envelopes created by other members of the same organization. By default, only templates\n * having sharing settings controlled by their creators. Envelopes are usually private to the\n * callers who created them. In some organizations it may be useful to have users who can see\n * \"all activity\" by all organization members. This is particularly useful when applied to API\n * keys to develop applications that can access all data across the organization.\n */\nexport type TEnvelopePermissionOrg = 'envelope:org:view';\n\nexport type TEnvelopePermission = TEnvelopePermissionCreate | TEnvelopePermissionCancel | TEnvelopePermissionView | TEnvelopePermissionOrg;\n\n/**\n * Operation within Verdocs that users may perform.\n */\nexport type TPermission = TTemplatePermission | TOrgPermission | TAccountPermission | TEnvelopePermission;\n\n/**\n * Roles provide access to groups of permissions. Note that for historical reasons there is some overlap in the\n * use of the term \"role\". TRole refers to a user type. A \"Role\" (IRole) is a Template participant placeholder.\n */\nexport type TRole = 'contact' | 'basic_user' | 'member' | 'admin' | 'owner';\n\n/**\n * A map of the permissions each role confers.\n */\nexport const RolePermissions: Record<TRole, TPermission[]> = {\n owner: [\n 'template:creator:create:public',\n 'template:creator:create:org',\n 'template:creator:create:personal',\n 'template:creator:delete',\n 'template:creator:visibility',\n 'template:member:read',\n 'template:member:write',\n 'template:member:delete',\n 'template:member:visibility',\n 'owner:add',\n 'owner:remove',\n 'admin:add',\n 'admin:remove',\n 'member:view',\n 'member:add',\n 'member:remove',\n 'org:create',\n 'org:view',\n 'org:update',\n 'org:delete',\n 'org:transfer',\n 'org:list',\n 'envelope:create',\n 'envelope:cancel',\n 'envelope:view',\n ],\n admin: [\n 'template:creator:create:public',\n 'template:creator:create:org',\n 'template:creator:create:personal',\n 'template:creator:delete',\n 'template:creator:visibility',\n 'template:member:read',\n 'template:member:write',\n 'template:member:delete',\n 'template:member:visibility',\n 'admin:add',\n 'admin:remove',\n 'member:view',\n 'member:add',\n 'member:remove',\n 'org:create',\n 'org:view',\n 'org:update',\n 'org:list',\n 'envelope:create',\n 'envelope:cancel',\n 'envelope:view',\n ],\n member: [\n 'template:creator:create:public',\n 'template:creator:create:org',\n 'template:creator:create:personal',\n 'template:creator:delete',\n 'template:creator:visibility',\n 'template:member:read',\n 'template:member:write',\n 'template:member:delete',\n 'member:view',\n 'org:create',\n 'org:view',\n 'org:list',\n 'envelope:create',\n 'envelope:cancel',\n 'envelope:view',\n ],\n basic_user: ['template:member:read', 'member:view', 'org:view', 'org:list'],\n contact: ['org:view', 'org:list', 'org:create'],\n};\n\n/**\n * Confirm whether the user has all of the specified permissions.\n */\nexport const userHasPermissions = (profile: IProfile | null | undefined, permissions: TPermission[]) => {\n // No need to de-dupe here, we're just checking present-at-least-once set membership.\n const netPermissions = [...(profile?.permissions || [])];\n (profile?.roles || []).forEach((role) => {\n netPermissions.push(...(RolePermissions[role] || []));\n });\n\n (profile?.group_profiles || []).forEach((groupProfile) => {\n netPermissions.push(...(groupProfile.group?.permissions || []));\n });\n\n return permissions.every((perm) => netPermissions.includes(perm));\n};\n","/**\n * Various helpers to identify available operations for a template by a user.\n *\n * @module\n */\n\nimport {userHasPermissions} from '../Sessions';\nimport {IProfile, ITemplate} from '../Models';\n\n/**\n * Check to see if the user created the template.\n */\nexport const userIsTemplateCreator = (profile: IProfile | null | undefined, template: ITemplate) =>\n profile && template && profile.id === template.profile_id;\n\n/**\n * Check to see if a template is \"shared\" with the user.\n */\nexport const userHasSharedTemplate = (profile: IProfile | null | undefined, template: ITemplate) =>\n profile && template && !template.is_personal && profile.organization_id === template.organization_id;\n\n/**\n * Check to see if the user can create a personal/private template.\n */\nexport const userCanCreatePersonalTemplate = (profile: IProfile | null | undefined) =>\n userHasPermissions(profile, ['template:creator:create:personal']);\n\n/**\n * Check to see if the user can create an org-shared template.\n */\nexport const userCanCreateOrgTemplate = (profile: IProfile | null | undefined) =>\n userHasPermissions(profile, ['template:creator:create:org']);\n\n/**\n * Check to see if the user can create a public template.\n */\nexport const userCanCreatePublicTemplate = (profile: IProfile | null | undefined) =>\n userHasPermissions(profile, ['template:creator:create:public']);\n\n/**\n * Check to see if the user can read/view a template.\n */\nexport const userCanReadTemplate = (profile: IProfile | null | undefined, template: ITemplate) =>\n template.is_public ||\n userIsTemplateCreator(profile, template) ||\n (userHasSharedTemplate(profile, template) && userHasPermissions(profile, ['template:member:read']));\n\n/**\n * Check to see if the user can update a tempate.\n */\nexport const userCanUpdateTemplate = (profile: IProfile | null | undefined, template: ITemplate) =>\n userIsTemplateCreator(profile, template) ||\n (userHasSharedTemplate(profile, template) && userHasPermissions(profile, ['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 = (profile: IProfile | null | undefined, template: ITemplate) =>\n userIsTemplateCreator(profile, template)\n ? userHasPermissions(profile, ['template:creator:create:personal'])\n : userHasPermissions(profile, ['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 = (profile: IProfile | null | undefined, template: ITemplate) =>\n userIsTemplateCreator(profile, template)\n ? userHasPermissions(profile, ['template:creator:create:org'])\n : userHasPermissions(profile, ['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 = (profile: IProfile | null | undefined, template: ITemplate) =>\n userIsTemplateCreator(profile, template)\n ? userHasPermissions(profile, ['template:creator:create:public'])\n : userHasPermissions(profile, ['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 = (profile: IProfile | null | undefined, template: ITemplate) =>\n userIsTemplateCreator(profile, template) && userHasPermissions(profile, ['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 = (profile: IProfile | null | undefined, template: ITemplate) =>\n userIsTemplateCreator(profile, template)\n ? userHasPermissions(profile, ['template:creator:delete'])\n : userHasPermissions(profile, ['template:member:delete']);\n\n/**\n * Confirm whether the user can create an envelope using the specified template.\n */\nexport const userCanSendTemplate = (profile: IProfile | null | undefined, template: ITemplate) => {\n switch (template.visibility) {\n case 'private':\n return userIsTemplateCreator(profile, template);\n\n case 'shared':\n return userIsTemplateCreator(profile, template) || template.organization_id === profile?.organization_id;\n\n case 'public':\n return true;\n }\n};\n\n/**\n * Confirm whether the user can create a new template.\n */\nexport const userCanCreateTemplate = (profile: IProfile | null | undefined) =>\n userCanCreatePersonalTemplate(profile) || userCanCreateOrgTemplate(profile) || userCanCreatePublicTemplate(profile);\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 = (profile: IProfile | null | undefined, template: ITemplate) =>\n userCanUpdateTemplate(profile, 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 = (profile: IProfile | null | undefined, template: ITemplate) => {\n const hasPermission = userCanReadTemplate(profile, 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","/**\n * A \"role\" is an individual participant in a signing flow, such as a signer or CC contact.\n * A role is a placeholder that will eventually become a named recipient. For example, \"Tenant 1\"\n * might be replaced with \"John Smith\" when the document is sent out for signature.\n *\n * Role names must be unique within a template, e.g. 'Recipient 1'. They may contain any [a-zA-Z0-9_- ]\n * characters, although it is recommended to keep them simple and human-readable, and to avoid\n * spaces (although they are allowed). If spaces are used in role names, be sure to URL-encode them\n * when calling endpoints like `updateRole()` e.g. 'Recipient%201'.\n *\n * NOTE: Roles are always enumerated under Template objects, so there are no \"list\" or \"get\" endpoints\n * for them. To get a template's latest role list, simply call `getTemplate()`.\n *\n * @module\n */\n\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {IRole} from '../Models';\n\n/**\n * Create a role.\n *\n * ```typescript\n * import {createTemplateRole} from '@verdocs/js-sdk';\n *\n * const role = await createTemplateRole(VerdocsEndpoint.getDefault(), template_id, params...);\n * ```\n *\n * @group Roles\n * @api POST /v2/roles/:template_id Add a role to a template\n * @apiBody string name Name for the new role. Must be unique within the template. May include spaces, but later calls must URL-encode any references to this role, so it is recomended that special characters be avoided.\n * @apiBody string(enum:'signer' | 'cc' | 'approver') type Type of role to create. Signers act on documents by filling and signing fields. CC recipients receive a copy but do not act on the document. Approvers control the final submission of a document, but do not have fields of their own to fill out.\n * @apiBody string full_name? Default full name for the role. May be completed/overridden later, when envelopes are made from the template.\n * @apiBody string email? Default email address for the role. May be completed/overridden later, when envelopes are made from the template.\n * @apiBody string phone? Default (SMS-capable) phone number for the role. May be completed/overridden later, when envelopes are made from the template.\n * @apiBody string message? Optional message to include in email and SMS signing invitations.\n * @apiBody integer(min: 1, default: 1) sequence? Optional 1-based sequence number for the role. Roles that share the same sequence number act in parallel, and will receive invitations at the same time.\n * @apiBody integer(min: 1, default: 1) order? Optional 1-based order number for the role. Controls the left-to-right display order of roles at the same sequence number in the UI components e.g. `<verdocs-template-roles />`.\n * @apiBody boolean delegator? If true, the role may delegate their signing responsibility to another party.\n * @apiSuccess IRole . The newly-created role\n */\nexport const createTemplateRole = (endpoint: VerdocsEndpoint, template_id: string, params: IRole) =>\n endpoint.api //\n .post<IRole>(`/v2/roles/${template_id}`, params)\n .then((r) => r.data);\n\n/**\n * Update a role.\n *\n * ```typescript\n * import {updateTemplateRole} from '@verdocs/js-sdk';\n *\n * const role = await updateTemplateRole(VerdocsEndpoint.getDefault(), template_id, name, params...);\n * ```\n *\n * @group Roles\n * @api PATCH /v2/roles/:template_id/:role_id Update a role. See createRole for additional details on the parameters available.\n * @apiBody string name? Rename the role. Note that role names must be unique within a template, so this may fail if the new name is already in use.\n * @apiBody string(enum:'signer' | 'cc' | 'approver') type? Type of role.\n * @apiBody string full_name? Default full name for the role.\n * @apiBody string email? Default email address for the role.\n * @apiBody string phone? Default (SMS-capable) phone number for the role.\n * @apiBody string message? Optional message to include in email and SMS signing invitations.\n * @apiBody integer(min: 1, default: 1) sequence? Optional 1-based sequence number for the role.\n * @apiBody integer(min: 1, default: 1) order? Optional 1-based order number for the role.\n * @apiBody boolean delegator? If true, the role may delegate their signing responsibility to another party.\n * @apiBody string(enum:'pin'|'identity'|'') kba_method? Active PIN- or Identity-based KBA for the role.\n * @apiSuccess IRole . The newly-created role\n */\nexport const updateTemplateRole = (endpoint: VerdocsEndpoint, template_id: string, name: string, params: Partial<IRole>) =>\n endpoint.api //\n .patch<IRole>(`/v2/roles/${template_id}/${encodeURIComponent(name)}`, params)\n .then((r) => r.data);\n\n/**\n * Delete a role.\n *\n * ```typescript\n * import {deleteTemplateRole} from '@verdocs/js-sdk';\n *\n * const profiles = await deleteTemplateRole(VerdocsEndpoint.getDefault(), template_id, name);\n * ```\n *\n * @group Roles\n * @api DELETE /v2/roles/:template_id/:role_id Delete a role.\n * @apiSuccess string . Success\n */\nexport const deleteTemplateRole = (endpoint: VerdocsEndpoint, template_id: string, name: string) =>\n endpoint.api //\n .delete(`/v2/roles/${template_id}/${encodeURIComponent(name)}`)\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 type {TSortTemplateBy, TTemplateSender, TTemplateVisibility} from '../BaseTypes';\nimport type {IRole, ITemplate, ITemplateField} from '../Models';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\n\nexport type ITemplateSortBy = 'created_at' | 'updated_at' | 'name' | 'last_used_at' | 'counter' | 'star_counter';\n\nexport type TTemplateVisibilityFilter = 'private_shared' | 'private' | 'shared' | 'public';\n\nexport interface IGetTemplatesParams {\n /** List only those templates whose names, descriptions, etc contain this search term. */\n q?: string;\n /** List only those templates with at least one \"star\". */\n is_starred?: boolean;\n /** List only those templates created by the caller. */\n is_creator?: boolean;\n /** Visibility status of templates to include. private_shared is the default (private + shared) */\n visibility?: TTemplateVisibilityFilter;\n /** Sort order */\n sort_by?: TSortTemplateBy;\n /** Set to true or false to control the sort order. Omit this field to sort dates descending, names ascending. */\n ascending?: boolean;\n /** Number of rows to retrieve. Defaults to 10. */\n rows?: number;\n /** Page to retrieve (0-based). Defaults to 0. */\n page?: number;\n}\n\n/**\n * Get all templates accessible by the caller, with optional filters.\n *\n * ```typescript\n * import {getTemplates} from '@verdocs/js-sdk/Templates';\n *\n * await getTemplates((VerdocsEndpoint.getDefault());\n * await getTemplates((VerdocsEndpoint.getDefault(), { is_starred: true });\n * await getTemplates((VerdocsEndpoint.getDefault(), { is_creator: true });\n * await getTemplates((VerdocsEndpoint.getDefault(), { is_organization: true });\n * ```\n *\n * @group Templates\n * @api GET /v2/templates Get Templates\n * @apiQuery string q? Find templates whose names/descriptions contain the specified query string\n * @apiQuery boolean is_starred? If true, returns only templates with at least one \"star\".\n * @apiQuery boolean is_creator? If true, returns only templates that the caller created.\n * @apiQuery string(enum: 'private_shared' | 'private' | 'shared' | 'public') visibility? Return only templates with the specified visibility.\n * @apiQuery string(enum: 'created_at' | 'updated_at' | 'name' | 'last_used_at' | 'counter' | 'star_counter') sort_by? Return results sorted by this criteria\n * @apiQuery boolean ascending? Set true/false to override the sort direction. Note that the default depends on `sort_by`. Date-based sorts default to descending, while name defaults to ascending.\n * @apiQuery integer(default: 20) rows? Limit the number of rows returned\n * @apiQuery integer(default: 0) page? Specify which page of results to return\n * @apiSuccess integer(format: int32) count The total number of records matching the query, helpful for pagination\n * @apiSuccess integer(format: int32) rows The number of rows returned in this response page\n * @apiSuccess integer(format: int32) page The page number of this response\n * @apiSuccess array(items: ITemplate) templates List of templates found\n */\nexport const getTemplates = (endpoint: VerdocsEndpoint, params?: IGetTemplatesParams) =>\n endpoint.api //\n .get<{count: number; rows: number; page: number; templates: ITemplate[]}>('/v2/templates', {params})\n .then((r) => r.data);\n\n/**\n * Get one template by its ID.\n *\n * ```typescript\n * import {getTemplate} from '@verdocs/js-sdk/Templates';\n *\n * const template = await getTemplate((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9');\n * ```\n *\n * @group Templates\n * @api GET /v2/templates/:template_id Get a template. Note that the caller must have at least View access to the template.\n * @apiSuccess ITemplate . The requested template\n */\nexport const getTemplate = (endpoint: VerdocsEndpoint, templateId: string) => {\n return endpoint.api //\n .get<ITemplate>(`/v2/templates/${templateId}`)\n .then((r) => {\n const template = r.data;\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 // Temporary upgrade from legacy app\n template.fields?.forEach((field) => {\n if ((field as any).setting) {\n field.settings = (field as any).setting;\n }\n });\n\n return template;\n });\n};\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 * If set, the visibility level for the template.\n */\n visibility?: TTemplateVisibility;\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 * @deprecated. See visibility.\n */\n is_personal?: boolean;\n /**\n * Optional (defaults to false). Public templates may be found (via search) and viewed by anyone.\n * @deprecated. See visibility.\n */\n is_public?: boolean;\n /** Optional (defaults to EVERYONE_AS_CREATOR). Who may create and send envelopes using this template. */\n sender?: TTemplateSender;\n /** Delay (in seconds) before the first reminder is sent (min: 4hrs). Set to 0 or null to disable. */\n initial_reminder?: number;\n /** Delay (in seconds) before subsequent remidners are sent (min: 12hrs). Set to 0 or null to disable. */\n followup_reminders?: number;\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 {createTemplate} from '@verdocs/js-sdk/Templates';\n *\n * const newTemplate = await createTemplate((VerdocsEndpoint.getDefault(), {...});\n * ```\n *\n * @group Templates\n * @api POST /v2/templates Create a template\n * @apiBody string name Template name\n * @apiBody string description? Optional description\n * @apiBody TTemplateVisibility visibility? Visibility setting\n * @apiBody boolean is_personal? Deprecated. If true, the template is personal and can only be seen by the caller. (Use \"visibility\" for new calls.)\n * @apiBody boolean is_public? Deprecated. If true, the template is public and can be seen by anybody. (Use \"visibility\" for new calls.)\n * @apiBody TTemplateSender sender? Who may send envelopes using this template\n * @apiBody number initial_reminder? Delay (in seconds) before the first reminder is sent (min: 4hrs). Set to 0 or null to disable.\n * @apiBody number followup_reminders? Delay (in seconds) before the subsequent reminders are sent (min: 12hrs). Set to 0 or null to disable.\n * @apiBody array(items:object) documents? Optional list of documents to attach to the template\n * @apiBody array(items:IRole) roles? Optional list of roles to create. Note that if roles are not included in the request, fields will be ignored.\n * @apiBody array(fields:ITemplateField) fields? Optional list of fields to create. Note that if fields that do not match a role will be ignored.\n * @apiSuccess ITemplate . The newly-created template\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 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\n/**\n * Duplicate a template. Creates a complete clone, including all settings (e.g. reminders), fields,\n * roles, and documents.\n *\n * ```typescript\n * import {duplicateTemplate} from '@verdocs/js-sdk/Templates';\n *\n * const newTemplate = await duplicateTemplate((VerdocsEndpoint.getDefault(), originalTemplateId, 'My Template Copy');\n * ```\n *\n * @group Templates\n * @api PUT /v2/templates/:template_id Perform an operation on a template\n * @apiBody string(enum:'duplicate') action Action to perform\n * @apiBody string name? If duplicating the template, a name for the new copy\n * @apiSuccess ITemplate . The newly-copied template\n */\nexport const duplicateTemplate = (endpoint: VerdocsEndpoint, templateId: string, name: string) =>\n endpoint.api //\n .put<ITemplate>(`/v2/templates/${templateId}`, {action: 'duplicate', name})\n .then((r) => r.data);\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 {createTemplateFromSharepoint} from '@verdocs/js-sdk/Templates';\n *\n * const newTemplate = await createTemplateFromSharepoint((VerdocsEndpoint.getDefault(), {...});\n * ```\n *\n * @group Templates\n * @api POST /v2/templates/from-sharepoint Create a template from an asset in Sharepoint\n * @apiBody string name Name for the new template\n * @apiBody string siteId Name for the new template\n * @apiBody string itemId Name for the new template\n * @apiBody string oboToken On-Behalf-Of token for calls to Sharepoint. Should be generated as a short-expiration token with at least Read privileges to the siteId/itemId. This token will be discarded after being used.\n * @apiSuccess ITemplate . The newly-created template\n */\nexport const createTemplateFromSharepoint = (endpoint: VerdocsEndpoint, params: ITemplateCreateFromSharepointParams) => {\n const options = {\n timeout: 120000,\n };\n\n return endpoint.api.post<ITemplate>('/v2/templates/from-sharepoint', params, options).then((r) => r.data);\n};\n\n/**\n * Update a template.\n *\n * ```typescript\n * import {updateTemplate} from '@verdocs/js-sdk/Templates';\n *\n * const updatedTemplate = await updateTemplate((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9', { name: 'New Name' });\n * ```\n *\n * @group Templates\n * @api PATCH /v2/templates/:template_id Update a template\n * @apiBody string name? Template name\n * @apiBody string description? Optional description\n * @apiBody TTemplateVisibility visibility? Visibility setting\n * @apiBody boolean is_personal? Deprecated. If true, the template is personal and can only be seen by the caller. (Use \"visibility\" for new calls.)\n * @apiBody boolean is_public? Deprecated. If true, the template is public and can be seen by anybody. (Use \"visibility\" for new calls.)\n * @apiBody TTemplateSender sender? Who may send envelopes using this template\n * @apiBody number initial_reminder? Delay in ms before the first reminder is sent (min: 4hrs). Set to 0 or null to disable.\n * @apiBody number followup_reminders? Delay in ms before the subsequent reminders are sent (min: 12hrs). Set to 0 or null to disable.\n * @apiSuccess ITemplate . The updated template\n */\nexport const updateTemplate = (endpoint: VerdocsEndpoint, templateId: string, params: Partial<ITemplateCreateParams>) =>\n endpoint.api //\n .patch<ITemplate>(`/v2/templates/${templateId}`, params)\n .then((r) => r.data);\n\n/**\n * Delete a template.\n *\n * ```typescript\n * import {deleteTemplate} from '@verdocs/js-sdk/Templates';\n *\n * await deleteTemplate((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9');\n * ```\n *\n * @group Templates\n * @api DELETE /v2/templates/:template_id Delete a template\n * @apiSuccess string . Success\n */\nexport const deleteTemplate = (endpoint: VerdocsEndpoint, templateId: string) =>\n endpoint.api //\n .delete<string>(`/v2/templates/${templateId}`)\n .then((r) => r.data);\n\n/**\n * Toggle the template star for a template.\n *\n * ```typescript\n * import {toggleTemplateStar} from '@verdocs/js-sdk/Templates';\n *\n * await toggleTemplateStar((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9');\n * ```\n *\n * @group Templates\n * @api POST /v2/templates/:template_id/star Star or unstar a template (toggle state)\n * @apiSuccess ITemplate . Success\n */\nexport const toggleTemplateStar = (endpoint: VerdocsEndpoint, templateId: string) =>\n endpoint.api //\n .post<ITemplate>(`/v2/templates/${templateId}/stars/toggle`)\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 {ITemplate, ITemplateDocument} from '../Models';\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 *\n * @group Template Documents\n * @api POST /v2/templates/:template_id/documents Attach a document to a template\n * @apiBody string(format:binary) file Document file to attach. The file name will automatically be used as the document name.\n * @apiBody string(format:uuid) template_id Template ID to attach the document to\n * @apiSuccess ITemplateDocument . Template document\n */\nexport const createTemplateDocument = (\n endpoint: VerdocsEndpoint,\n template_id: string,\n file: File,\n onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void,\n) => {\n const formData = new FormData();\n formData.append('file', file, file.name);\n formData.append('template_id', template_id);\n\n return endpoint.api //\n .post<ITemplateDocument>(`/v2/template-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 {deleteTemplateDocument} from '@verdocs/js-sdk/Templates';\n *\n * await deleteTemplateDocument(VerdocsEndpoint.getDefault(), documentID);\n * ```\n *\n * @group Template Documents\n * @api DELETE /v2/template-documents/:document_id Delete a template document\n * @apiSuccess string . Success\n */\nexport const deleteTemplateDocument = (endpoint: VerdocsEndpoint, documentId: string) =>\n endpoint.api //\n .delete<ITemplate>(`/v2/template-documents/${documentId}`)\n .then((r) => r.data);\n\n/**\n * Get all metadata for a template document. Note that when called by non-creators (e.g. Org Collaborators)\n * this will return only the **metadata** the caller is allowed to view.\n *\n * @group Template Documents\n * @api GET /v2/envelope-documents/:id Get envelope document\n * @apiParam string(format: 'uuid') document_id The ID of the document to retrieve.\n * @apiSuccess IEnvelopeDocument . The detailed metadata for the document requested\n */\nexport const getTemplateDocument = async (endpoint: VerdocsEndpoint, documentId: string) =>\n endpoint.api //\n .get<ITemplateDocument>(`/v2/template-documents/${documentId}`)\n .then((r) => r.data);\n\n/**\n * Download a document directly.\n */\nexport const downloadTemplateDocument = async (endpoint: VerdocsEndpoint, documentId: string) =>\n endpoint.api //\n .get(`/v2/template-documents/${documentId}?type=file`, {responseType: 'blob'})\n .then((r) => r.data);\n\n/**\n * Get an envelope document's metadata, or the document itself. If no \"type\" parameter is specified,\n * the document metadata is returned. If \"type\" is set to \"file\", the document binary content is\n * returned with Content-Type set to the MIME type of the file. If \"type\" is set to \"download\", a\n * string download link will be returned. If \"type\" is set to \"preview\" a string preview link will\n * be returned. This link expires quickly, so it should be accessed immediately and never shared.\n *\n * @group Template Documents\n * @api GET /v2/envelope-documents/:document_id Preview, Download, or Link to a Document\n * @apiParam string(format: 'uuid') document_id The ID of the document to retrieve.\n * @apiQuery string(enum:'file'|'download'|'preview') type? Download the file directly, generate a download link, or generate a preview link.\n * @apiSuccess string . The generated link.\n */\nexport const getTemplateDocumentDownloadLink = async (endpoint: VerdocsEndpoint, _envelopeId: string, documentId: string) =>\n endpoint.api //\n .get<string>(`/v2/template-documents/${documentId}?type=download`)\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 getTemplateDocumentPreviewLink = async (endpoint: VerdocsEndpoint, _envelopeId: string, documentId: string) =>\n endpoint.api //\n .get<string>(`/v2/envelope-documents/${documentId}?type=preview`)\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(`/v2/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(`/v2/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 (\n endpoint: VerdocsEndpoint,\n documentId: string,\n page: number,\n variant: 'original' | 'tagged' = 'original',\n) => endpoint.api.get<string>(`/v2/template-documents/page-image/${documentId}/${variant}/${page}`, {timeout: 20000}).then((r) => r.data);\n","import {IRole} from '../Models';\n\nexport interface IValidator {\n name: string;\n regex: string;\n}\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\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\nconst URL_REGEX = /https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)/;\n\nconst POSTAL_CODE_REGEX = /^[A-Za-z0-9-\\s]{3,10}$/;\n\nconst NUMBER_REGEX = /^\\d+$/;\n\nconst DATE_REGEX = /^(\\d{4}[-\\/]\\d{2}[-\\/]\\d{2})|(\\d{2}[-\\/]\\d{2}[-\\/]\\d{4})$/;\n\nconst VALIDATORS = {\n email: {regex: EMAIL_REGEX, label: 'Email Address'},\n phone: {regex: PHONE_REGEX, label: 'Phone Number'},\n url: {regex: URL_REGEX, label: 'URL'},\n postal_code: {regex: POSTAL_CODE_REGEX, label: 'Zip/Postal Code'},\n number: {regex: NUMBER_REGEX, label: 'Number'},\n date: {regex: DATE_REGEX, label: 'Date'},\n};\n\nexport const isValidInput = (value: string, validator: string) =>\n Object.keys(VALIDATORS).includes(validator) && VALIDATORS[validator as keyof typeof VALIDATORS].regex.test(value);\n\n/**\n * Get a list of available validators for field inputs. Note that validators always check strings,\n * because that is all a user can enter in an HTML input field. Numeric-format validators should\n * perform any necessary conversions internally. Validators never throw - they just return a boolean.\n * indicating whether the value is valid.\n */\nexport const getValidators = () => Object.keys(VALIDATORS);\n\nexport const isValidEmail = (email: string | undefined) => !!email && EMAIL_REGEX.test(email);\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 {isValidInput} from '../Templates';\nimport {IEnvelopeField} from '../Models';\n\nexport const isFieldFilled = (field: IEnvelopeField, allRecipientFields: IEnvelopeField[]) => {\n const {value = ''} = field;\n switch (field.type as any) {\n case 'textarea':\n case 'textbox':\n switch (field.validator || '') {\n case 'email':\n return value && isValidInput(value, 'email');\n case 'phone':\n return value && isValidInput(value, 'phone');\n default:\n return (value || '').trim() !== '';\n }\n\n case 'signature':\n return value === 'signed';\n\n case 'initial':\n return value === 'initialed';\n\n // Timestamp fields get automatically filled when the envelope is submitted.\n case 'timestamp':\n return true;\n\n case 'date':\n return !!value;\n\n case 'attachment':\n return value === 'attached';\n\n case 'dropdown':\n return value !== '';\n\n case 'checkbox':\n return value === 'true';\n\n case 'radio':\n if (!!field.group) {\n return allRecipientFields.filter((f) => f.group === field.group).some((field) => field.value === 'true');\n }\n\n return field.value === 'true';\n\n default:\n return false;\n }\n};\n\n// TODO: Only allow !required to bypass validation if the field is empty.\nexport const isFieldValid = (field: IEnvelopeField, allRecipientFields: IEnvelopeField[]) => {\n return !field.required || isFieldFilled(field, allRecipientFields);\n};\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\n * \"adopt\" an initials block to be used for all initials fields in the document. Thus, this is typically called\n * one time to create and store an initials block. Thereafter, the ID of the initials block may be re-used for each\n * initials field to be \"stamped\" by the user.\n *\n * Note: Both \"guest\" signers and authenticated users can create initials blocks. Guest signers\n * typically only ever have one, tied to that session. But authenticated users can create more than\n * one, and can use them interchangeably.\n *\n * @group Signatures and Initials\n * @api POST /v2/profiles/initials Create Initial Block\n * @apiBody string initial Blob containing initials image to store.\n * @apiSuccess IInitial . The newly-created initial block.\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>(`/v2/profiles/initials`, data)\n .then((r) => r.data);\n};\n","import {VerdocsEndpoint} from '../VerdocsEndpoint';\n\n/**\n * KBA is not required at this time.\n */\nexport interface IRecipientKbaStepNone {\n envelope_id: string;\n role_name: string;\n kba_step: 'none';\n}\n\n/**\n * KBA has been completed and no further action is required.\n */\nexport interface IRecipientKbaStepComplete {\n envelope_id: string;\n role_name: string;\n kba_step: 'complete';\n}\n\n/**\n * A PIN code is required. Prompt the user to enter this PIN, and submit it via `submitKbaPin()`.\n */\nexport interface IRecipientKbaStepPin {\n envelope_id: string;\n role_name: string;\n kba_step: 'pin';\n}\n\n/**\n * A full identity verification is required. Prompt the user for their address and other (optional)\n * details and submit them via `submitKbaIdentity()`.\n */\nexport interface IRecipientKbaStepIdentity {\n envelope_id: string;\n role_name: string;\n kba_step: 'identity';\n}\n\n/**\n * If a positive identification was not possible, the user may be asked to answer 1 or more\n * challenge questions via this response. They should be submitted via `submitKbaChallengeResponse()`.\n */\nexport interface IRecipientKbaStepChallenge {\n envelope_id: string;\n role_name: string;\n kba_step: 'challenge';\n questions: {\n type: string;\n message: string;\n options: (string | number)[];\n }[];\n}\n\n/**\n * Identity verification has failed. The user should be shown the message included. No further\n * signing operations may be performed.\n */\nexport interface IRecipientKbaStepFailed {\n envelope_id: string;\n role_name: string;\n kba_step: 'failed';\n message: string;\n}\n\nexport type TRecipientKbaStep =\n | IRecipientKbaStepNone\n | IRecipientKbaStepComplete\n | IRecipientKbaStepPin\n | IRecipientKbaStepIdentity\n | IRecipientKbaStepChallenge\n | IRecipientKbaStepFailed;\n\n/**\n * Get the current KBA status. Note that this may only be called by the recipient and requires a\n * valid signing session to proceed. Although the Recipient object itself contains indications of\n * whether KBA is required, it will not contain the current status of the process. If\n * `recipient.auth_methods` is set (not empty), and `recipient.kba_completed` is false, this endpoint\n * should be called to determine the next KBA step required.\n */\nexport const getKbaStep = (endpoint: VerdocsEndpoint, envelope_id: string, role_name: string) =>\n endpoint.api //\n .get<TRecipientKbaStep>(`/v2/kba/${envelope_id}/${encodeURIComponent(role_name)}`)\n .then((r) => r.data);\n\n/**\n * Submit a response to a KBA PIN challenge.\n */\nexport const submitKbaPin = (endpoint: VerdocsEndpoint, envelope_id: string, role_name: string, pin: string) =>\n endpoint.api //\n .post<TRecipientKbaStep>(`/v2/kba/pin`, {envelope_id, role_name, pin})\n .then((r) => r.data);\n\nexport interface IKbaIdentity {\n firstName: string;\n lastName: string;\n address: string;\n city?: string;\n state?: string;\n zip?: string;\n ssnLast4?: string;\n email?: string;\n}\n\n/**\n * Submit an identity response to a KBA challenge.\n */\nexport const submitKbaIdentity = (endpoint: VerdocsEndpoint, envelope_id: string, role_name: string, identity: IKbaIdentity) =>\n endpoint.api //\n .post<TRecipientKbaStep>(`/v2/kba/identity`, {envelope_id, role_name, identity})\n .then((r) => r.data);\n\nexport interface IKbaChallengeResponse {\n type: string;\n answer: string | number;\n}\n\n/**\n * Submit an identity response to a KBA challenge. Answers should be submitted in the same order as\n * the challenges were listed in `IRecipientKbaStepChallenge.questions`.\n */\nexport const submitKbaChallengeResponse = (\n endpoint: VerdocsEndpoint,\n envelope_id: string,\n role_name: string,\n responses: IKbaChallengeResponse[],\n) =>\n endpoint.api //\n .post<TRecipientKbaStep>(`/v2/kba/response`, {envelope_id, role_name, responses})\n .then((r) => r.data);\n","import type {IInPersonLinkResponse, ISignerTokenResponse, TAuthenticateRecipientRequest, IUpdateRecipientParams} from './Types';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport type {IRecipient} from '../Models';\n\n/**\n * Agree to electronic signing dislosures.\n *\n * @group Recipients\n * @api POST /envelopes/:envelope_id/recipients/:role_name/agree Agree to e-Signing Disclosures\n * @apiParam string(format:uuid) envelope_id The envelope to operate on.\n * @apiParam string role_name The role to operate on.\n * @apiSuccess IRecipient . The updated Recipient.\n */\nexport const envelopeRecipientAgree = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, disclosures?: string) =>\n endpoint.api //\n .post<IRecipient>(`/v2/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}/agree`, {disclosures})\n .then((r) => r.data);\n\n/**\n * Decline electronic signing dislosures. Note that if any recipient declines, the entire envelope\n * becomes non-viable and later recipients may no longer act. The creator will receive a notification\n * when this occurs.\n *\n * @group Recipients\n * @api POST /envelopes/:envelope_id/recipients/:role_name/decline Decline e-Signing Disclosures\n * @apiParam string(format:uuid) envelope_id The envelope to operate on.\n * @apiParam string role_name The role to adjust.\n * @apiSuccess IRecipient . The updated Recipient.\n */\nexport const envelopeRecipientDecline = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string) =>\n endpoint.api //\n .post<IRecipient>(`/v2/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}/decline`)\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 *\n * @group Recipients\n * @api POST /envelopes/:envelope_id/recipients/:role_name/submit Submit envelope\n * @apiParam string(format:uuid) envelope_id The envelope to operate on.\n * @apiParam string role_name The role to submit.\n * @apiSuccess IRecipient . The updated Recipient.\n */\nexport const envelopeRecipientSubmit = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string) =>\n endpoint.api //\n .post<IRecipient>(`/v2/envelopes/${envelopeId}/recipients/${roleName}/submit`)\n .then((r) => r.data);\n\n/**\n * Begin a signing session for an Envelope. This path requires an invite code, and should generally\n * be called with a NON-default Endpoint to avoid conflicting with any active user session the user\n * may have. To initiate in-person signing by an authenticated user (e.g. self-signing), call\n * getInPersonLink() instead. The response from that call includes both a link for direct signing\n * via a Web browser as well as an in-person access_key. That access_key.key may be used here as well.\n *\n * @group Recipients\n * @api POST /v2/sign/unauth/:envelope_id/:role_name/:key Start Signing Session\n * @apiParam string(format:uuid) envelope_id The envelope to operate on.\n * @apiParam string role_name The role to request.\n * @apiParam string key Access key generated by the envelope creator or email/SMS invite.\n * @apiSuccess ISignerTokenResponse . Signing session token and envelope/recipient metadata.\n */\nexport const startSigningSession = async (endpoint: VerdocsEndpoint, envelope_id: string, role_name: string, key: string) => {\n return endpoint.api //\n .post<ISignerTokenResponse>(`/v2/sign/unauth/${envelope_id}/${encodeURIComponent(role_name)}/${key}`)\n .then((r) => {\n endpoint.setToken(r.data.access_token, 'signing');\n return r.data;\n });\n};\n\n/**\n * Get an in-person signing link. Must be called by the owner/creator of the envelope. The response\n * also includes the raw access key that may be used to directly initiate a signing session (see\n * `startSigningSession`) as well as an access token representing a valid signing session for\n * immediate use in embeds or other applications. Note that in-person signing is considered a\n * lower-security operation than authenticated signing, and the final envelope certificate will\n * reflect this.\n *\n * @group Recipients\n * @api POST /v2/sign/in-person/:envelope_id/:role_name Get In-Person Signing Link\n * @apiParam string(format:uuid) envelope_id The envelope to operate on.\n * @apiParam string role_name The role to request.\n * @apiSuccess IInPersonLinkResponse . Signing session token and envelope/recipient metadata.\n */\nexport const getInPersonLink = (endpoint: VerdocsEndpoint, envelope_id: string, role_name: string) =>\n endpoint.api //\n .post<IInPersonLinkResponse>(`/v2/sign/in-person/${envelope_id}/${encodeURIComponent(role_name)}`)\n .then((r) => r.data);\n\n/**\n * Verify a recipient within a signing session. All signing sessions use an invite code at a minimum,\n * but many scenarios require more robust verification of recipients, so one or more verification\n * methods may be attached to each recipient. If an authentication method is enabled, the\n * signer must first accept the e-signature disclosures, then complete each verification step\n * before attempting to view/display documents, complete any fields, or submit the envelope.\n * This endpoint should be called to complete each step. If the call fails an error will be\n * thrown.\n *\n * @group Recipients\n * @api POST /v2/sign/verify Verify recipient/signer\n * @apiParam string(enum:'passcode'|'email'|'sms'|'kba'|'id') auth_method The authentication method being completed\n * @apiParam string code? The passcode or OTP entered. Required for passcode, email, and SMS methods.\n * @apiParam boolean resend? For SMS or email methods, set to send a new code.\n * @apiParam boolean first_name? For KBA, the recipient's first name\n * @apiParam boolean last_name? For KBA, the recipient's last name\n * @apiParam boolean address? For KBA, the recipient's address\n * @apiParam boolean city? For KBA, the recipient's city\n * @apiParam boolean state? For KBA, the recipient's state\n * @apiParam boolean zip? For KBA, the recipient's zip code\n * @apiParam boolean ssn_last_4? For KBA, the last 4 digits of the recipient's SSN\n * @apiParam boolean dob? For KBA, the recipient's date of birth\n * @apiParam array(items:IKBAResponse) responses? For KBA, responses to any challenge questions presented\n * @apiSuccess ISignerTokenResponse . Updated signing session.\n */\nexport const verifySigner = (endpoint: VerdocsEndpoint, params: TAuthenticateRecipientRequest) =>\n endpoint.api //\n .post<ISignerTokenResponse>(`/v2/sign/verify`, params)\n .then((r) => r.data);\n\n/**\n * Delegate a recipient's signing responsibility. The envelope sender must enable this before the\n * recipient calls this endpoint, and only the recipient may call it, or the call will be rejected.\n * The recipient's role will be renamed and configured to indicate to whom the delegation was made,\n * and a new recipient entry with the updated details (e.g. name and email address) will be added\n * to the flow with the same role_name, order, and sequence of the original recipient. Unless\n * no_contact is set on the envelope, the delegation recipient and envelope creator will also be\n * notified.\n *\n * @group Recipients\n * @api PUT /v2/envelopes/:envelope_id/recipients/:role_name Delegate Recipient\n * @apiParam string(format:uuid) envelope_id The envelope to operate on.\n * @apiParam string role_name The role to operate on.\n * @apiBody string(enum:'delegate') action The operation to perform (delegate).\n * @apiBody string first_name The first name of the new recipient.\n * @apiBody string last_name The last name of the new recipient.\n * @apiBody string email The email address of the new recipient.\n * @apiBody string phone? Optional phone number for the new recipient.\n * @apiBody string message? Optional phone number for the new recipient's invitation.\n * @apiSuccess string . Success message.\n */\nexport const delegateRecipient = (\n endpoint: VerdocsEndpoint,\n envelopeId: string,\n roleName: string,\n params: {\n first_name: string;\n last_name: string;\n email: string;\n phone?: string;\n message?: string;\n },\n) =>\n endpoint.api //\n .post<{status: 'OK'}>(`/v2/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}/delegate`, params)\n .then((r) => r.data);\n\n/**\n * Update a recipient. NOTE: User interfaces should rate-limit this operation to avoid spamming recipients.\n * Excessive use of this endpoint may result in Verdocs rate-limiting the calling application to prevent\n * abuse. This endpoint will return a 200 OK even if the no_contact flag is set on the envelope (in which\n * case the call will be silently ignored).\n *\n * @group Recipients\n * @api PATCH /envelopes/:envelope_id/recipients/:role_name Update Recipient\n * @apiParam string(format:uuid) envelope_id The envelope to operate on.\n * @apiParam string role_name The role name to update.\n * @apiBody string(enum:'remind'|'reset') action? Trigger a reminder, or fully reset the recipient\n * @apiBody string first_name? Update the recipient's first name.\n * @apiBody string last_name? Update the recipient's last name.\n * @apiBody string email? Update the recipient's email address.\n * @apiBody string message? Update the recipient's invite message.\n * @apiBody string phone? Update the recipient's phone number.\n * @apiBody string passcode? If passcode authentication is used, the recipient's address to prefill. May only be changed if the recipient has not already completed passcode-based auth.\n * @apiBody string address? If KBA-based authentication is used, the recipient's address to prefill. May only be changed if the recipient has not already completed KBA-based auth.\n * @apiBody string city? If KBA-based authentication is used, the recipient's city to prefill. May only be changed if the recipient has not already completed KBA-based auth.\n * @apiBody string state? If KBA-based authentication is used, the recipient's state to prefill. May only be changed if the recipient has not already completed KBA-based auth.\n * @apiBody string zip? If KBA-based authentication is used, the recipient's zip code to prefill. May only be changed if the recipient has not already completed KBA-based auth.\n * @apiBody string dob? If KBA-based authentication is used, the recipient's date of birth to prefill. May only be changed if the recipient has not already completed KBA-based auth.\n * @apiBody string ssn_last_4? If KBA-based authentication is used, the recipient's SSN-last-4 to prefill. May only be changed if the recipient has not already completed KBA-based auth.\n * @apiSuccess IRecipient . The updated Recipient.\n */\nexport const updateRecipient = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, params: IUpdateRecipientParams) =>\n endpoint.api //\n .patch<IRecipient>(`/v2/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}`, params)\n .then((r) => r.data);\n\n/**\n * Send a reminder to a recipient. The recipient must still be an active member of the signing flow\n * (e.g. not declined, already submitted, etc.)\n */\nexport const remindRecipient = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string) =>\n endpoint.api //\n .patch<{status: 'OK'}>(`/v2/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}`, {action: 'remind'})\n .then((r) => r.data);\n\n/**\n * Fully reset a recipient. This allows the recipient to restart failed KBA flows, change\n * fields they may have filled in incorrectly while signing, etc. This cannot be used on a\n * canceled or completed envelope, but may be used to restart an envelope marked declined.\n */\nexport const resetRecipient = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string) =>\n endpoint.api //\n .patch<{status: 'OK'}>(`/v2/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}`, {action: 'reset'})\n .then((r) => r.data);\n\n/**\n * Ask the sender a question. This will email the envelope's sender (via sender_email, if set when\n * the envelope was created) with the recipient's information and their question. It is up to the\n * sender to determine how to reply.\n *\n * @group Recipients\n * @api POST /envelopes/:envelope_id/recipients/:role_name/ask-question Ask Sender a Question\n * @apiParam string(format:uuid) envelope_id The envelope to operate on.\n * @apiParam string role_name The role name to update.\n * @apiBody string question The question to ask.\n * @apiSuccess string . Success message.\n */\nexport const askQuestion = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, params: {question: string}) =>\n endpoint.api //\n .post<IRecipient>(`/v2/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}/ask-question`, params)\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, IProfile, IRecipient} from '../Models';\n\n/**\n * Check to see if the profile ID owns the envelope.\n */\nexport const isEnvelopeOwner = (profile_id: string | null | undefined, envelope: IEnvelope) => envelope.profile_id === profile_id;\n\n/**\n * Check to see if the profile ID is a recipient within the envelope.\n */\nexport const isEnvelopeRecipient = (profile_id: string | null | undefined, envelope: IEnvelope) =>\n (envelope.recipients || []).some((recipient) => recipient.profile_id === profile_id);\n\n/**\n * Check to see if the profile ID is the envelope's sender or one of the recipients.\n */\nexport const canAccessEnvelope = (profile_id: string | null | undefined, envelope: IEnvelope) =>\n isEnvelopeOwner(profile_id, envelope) || isEnvelopeRecipient(profile_id, envelope);\n\n/**\n * Check to see if the user owns the envelope.\n */\nexport const userIsEnvelopeOwner = (profile: IProfile | null | undefined, envelope: IEnvelope) => envelope.profile_id === profile?.id;\n\n/**\n * Check to see if the user is a recipient within the envelope.\n */\nexport const userIsEnvelopeRecipient = (profile: IProfile | null | undefined, envelope: IEnvelope) =>\n (envelope.recipients || []).some((recipient) => recipient.profile_id === profile?.id);\n\n/**\n * Check to see if the profile ID is the envelope's sender or one of the recipients.\n */\nexport const useCanAccessEnvelope = (profile: IProfile | null | undefined, envelope: IEnvelope) =>\n userIsEnvelopeOwner(profile, envelope) || userIsEnvelopeRecipient(profile, envelope);\n\n/**\n * Check to see if the envelope has pending actions.\n */\nexport const envelopeIsActive = (envelope: IEnvelope) =>\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) => envelope.status !== 'complete';\n\n/**\n * Check to see if the user owns the envelope.\n */\nexport const userCanCancelEnvelope = (profile: IProfile | null | undefined, envelope: IEnvelope) =>\n userIsEnvelopeOwner(profile, 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 = (profile: IProfile | null | undefined, envelope: IEnvelope) =>\n userIsEnvelopeOwner(profile, 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) =>\n ['complete', 'declined', 'canceled'].includes(envelope.status) ? [] : (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 = (profile: IProfile | null | undefined, envelope: IEnvelope) => {\n if (!profile) {\n return false;\n }\n\n const recipientsWithActions = getRecipientsWithActions(envelope);\n const myRecipient = recipientsWithActions.find((r) => r.profile_id === profile?.id || r.email === profile?.email);\n return (\n myRecipient &&\n envelopeIsActive(envelope) &&\n userIsEnvelopeRecipient(profile, envelope) &&\n recipientCanAct(myRecipient, recipientsWithActions)\n );\n};\n\nexport const getNextRecipient = (envelope: IEnvelope) => {\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\n * \"adopt\" a signature block to be used for all signature fields in the document. Thus, this is typically called one\n * time to create and store a signature block. Thereafter, the ID of the signature block may be re-used for each\n * signature field to be \"stamped\" by the user.\n *\n * Note: Both \"guest\" signers and authenticated users can create initials blocks. Guest signers\n * typically only ever have one, tied to that session. But authenticated users can create more than\n * one, and can use them interchangeably.\n *\n * @group Signatures and Initials\n * @api POST /v2/profiles/signatures Create Signature Block\n * @apiBody string signature Blob containing signature image to store.\n * @apiSuccess ISignature . The newly-created signature block.\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>(`/v2/profiles/signatures`, data)\n .then((r) => r.data);\n};\n","import type {TEnvelopeStatus, TFieldType, TRecipientAuthMethod, TRecipientStatus, TRecipientType} from '../BaseTypes';\nimport type {IDropdownOption, IEnvelope, IInitial, IRecipient, ISignature, TAccessKey} from '../Models';\n\nexport interface IEnvelopesSearchResult {\n page: number;\n total: number;\n result: IEnvelope[];\n}\n\nexport interface IDocumentSearchOptions {\n rows?: number;\n page?: number;\n sort_by?: 'updated_at' | 'created_at';\n ascending?: boolean;\n is_owner?: boolean;\n is_recipient?: boolean;\n envelope_status?: TEnvelopeStatus[];\n recipient_status?: TRecipientStatus[];\n}\n\nexport interface ICreateEnvelopeRecipientFromTemplate {\n /**\n * Unique identifier for the recipient. When using a template, must match one of the pre-defined roles in the template's Recipients list.\n */\n role_name: string;\n\n /** The name of the recipient as it will be displayed in reports and queries, e.g. 'Paige Turner'. */\n first_name: string;\n last_name: string;\n\n /** The email address of the recipient. One of `email` or `phone` must be provided. */\n email?: string;\n\n /**\n * The phone number of the recipient. One of `email` or `phone` must be provided. If `phone` is included, the\n * recipient will receive an SMS notification for the document.\n */\n phone?: string;\n\n /** Whether the recipient may delegate their tasks to others. Should be false for most standard workflows. */\n delegator?: boolean;\n\n /** A custom message to include in the email or SMS invitation. May be left blank for a default message. */\n message?: string;\n\n /** To enable authentication for the recipient, set to 'pin' or 'identity'. */\n auth_methods?: TRecipientAuthMethod[];\n\n /** If Passcode-based authentication is used, the passcode to challenge the user to enter. */\n passcode?: string;\n\n /**\n * If SMS-based authentication is used, the phone number to which one-time codes should be sent.\n * NOTE: This may be different from the phone number used for notifications, but leaving it blank\n * will trigger an error rather than defaulting to the notifications phone number to avoid mistaken\n * assumptions (e.g. if SMS notifications are not enabled for the organization, but SMS authentication\n * is).\n */\n phone_auth?: string;\n\n /** Pre-fill KBA address for the recipient, if known. */\n address?: string;\n /** Pre-fill KBA city for the recipient, if known. */\n city?: string;\n /** Pre-fill KBA state for the recipient, if known. */\n state?: string;\n /** Pre-fill KBA zip for the recipient, if known. */\n zip?: string;\n /** Pre-fill KBA date-of-birth for the recipient, if known. */\n dob?: string;\n /** Pre-fill KBA SSN-Last-4 for the recipient, if known. */\n ssn_last_4?: string;\n}\n\nexport interface ICreateEnvelopeRecipientDirectly {\n /** The type of role to create. Most participants in standard flows will be \"signer\" recipients. */\n type: TRecipientType;\n\n /**\n * Unique identifier for the recipient. When using a template, must match one of the pre-defined roles in the template's Recipients list.\n */\n role_name: string;\n\n /** The name of the recipient as it will be displayed in reports and queries, e.g. 'Paige Turner'. */\n first_name: string;\n last_name: string;\n\n /** The email address of the recipient. One of `email` or `phone` must be provided. */\n email?: string;\n\n /**\n * The phone number of the recipient. One of `email` or `phone` must be provided. If `phone` is included, the\n * recipient will receive an SMS notification for the document.\n */\n phone?: string;\n\n /**\n * The 1-based sequence number for the recipient. This can be used to override the template's workflow. Recipients\n * are processed in parallel for each matching sequence number (e.g. all recipients at level \"1\" may act in parallel)\n * and in series between sequence numbers (e.g. all recipients at level \"1\" must complete their tasks before\n * recipients at level \"2\" may act).\n */\n sequence?: number;\n\n /**\n * The 1-based order within the sequence for the recipient. Recipients at the same sequence act in parallel, so\n * this is only for display purposes.\n */\n order?: number;\n\n /** Whether the recipient may delegate their tasks to others. Should be false for most standard workflows. */\n delegator?: boolean;\n\n /** A custom message to include in the email or SMS invitation. May be left blank for a default message. */\n message?: string;\n\n /** To enable authentication for the recipient, set to 'pin' or 'identity'. */\n auth_methods?: TRecipientAuthMethod[];\n\n /** If Passcode-based authentication is used, the passcode to challenge the user to enter. */\n passcode?: string;\n\n /**\n * If SMS-based authentication is used, the phone number to which one-time codes should be sent.\n * NOTE: This may be different from the phone number used for notifications, but leaving it blank\n * will trigger an error rather than defaulting to the notifications phone number to avoid mistaken\n * assumptions (e.g. if SMS notifications are not enabled for the organization, but SMS authentication\n * is).\n */\n phone_auth?: string;\n\n /** Pre-fill KBA address for the recipient, if known. */\n address?: string;\n /** Pre-fill KBA city for the recipient, if known. */\n city?: string;\n /** Pre-fill KBA state for the recipient, if known. */\n state?: string;\n /** Pre-fill KBA zip for the recipient, if known. */\n zip?: string;\n /** Pre-fill KBA date-of-birth for the recipient, if known. */\n dob?: string;\n /** Pre-fill KBA SSN-Last-4 for the recipient, if known. */\n ssn_last_4?: string;\n}\n\nexport interface ISignerTokenResponse {\n /**\n * An access token that may be used with a VerdocsEndpoint to perform signing operations.\n * When signing, the caller's \"authentication\" status will be recorded as \"in-person\".\n */\n access_token: string;\n /**\n * A copy of the envelope related to the signing session. This is almost always needed when\n * a signing session is being started, so it is included here for convenience.\n */\n envelope: IEnvelope;\n /**\n * A copy of the recipient record related to the signing session. This is almost always needed when\n * a signing session is being started, so it is included here for convenience.\n */\n recipient: IRecipient;\n /**\n * Stored signature blocks for the recipient. All entries are returned to support workflows in\n * which that is required, but for most use-cases, only the first entry should be used.\n */\n signatures?: ISignature[];\n /**\n * Stored initials blocks for the recipient. All entries are returned to support workflows in\n * which that is required, but for most use-cases, only the first entry should be used.\n */\n initials?: IInitial[];\n}\n\nexport interface IInPersonLinkResponse {\n /** A valid Verdocs Web URL that hosts a signing experience. */\n link: string;\n /**\n * An access token that may be used with a VerdocsEndpoint to perform signing operations.\n * When signing, the caller's \"authentication\" status will be recorded as \"in-person\".\n */\n access_token: string;\n /**\n * The access key that matches the signing session. May be used for later initiation requests\n * if in-person signing was desired, but not necessarily instant (e.g. to hand-off to a\n * companion application. **NOTE: Access keys are as sensitive as Bearer Tokens and must be\n * protected from theft and unauthorized sharing!**\n */\n access_key: TAccessKey;\n /**\n * A copy of the envelope related to the signing session. This is almost always needed when\n * a signing session is being started, so it is included here for convenience.\n */\n envelope: IEnvelope;\n /**\n * A copy of the recipient record related to the signing session. This is almost always needed when\n * a signing session is being started, so it is included here for convenience.\n */\n recipient: IRecipient;\n}\n\nexport interface IUpdateRecipientStatus {\n first_name?: string;\n last_name?: string;\n agreed?: boolean;\n action?: 'prepare' | 'update';\n}\n\nexport interface ICreateEnvelopeReminderRequest {\n setup_time: number;\n interval_time: number;\n}\n\nexport interface IUpdateRecipientParams {\n /** Trigger a reminder invite, or fully reset the recipient's status. */\n action?: 'remind' | 'reset';\n /** The name of the recipient as it will be displayed in reports and queries, e.g. 'Paige Turner'. */\n first_name?: string;\n last_name?: string;\n /** The email address of the recipient. If changed, a new invite will be sent. */\n email?: string;\n /** The phone number of the recipient. If changed, a new invite will be sent. */\n phone?: string;\n /** A custom message to include in the email or SMS invitation. May be left blank for a default message. */\n message?: string;\n /** If Passcode-based authentication is used, the passcode to challenge the user to enter. May only be changed if the recipient has not already completed passcode-based auth. */\n passcode?: string;\n /** If KBA-based authentication is used, the recipient's address to prefill. May only be changed if the recipient has not already completed KBA-based auth. */\n address?: string;\n /** If KBA-based authentication is used, the recipient's city to prefill. May only be changed if the recipient has not already completed KBA-based auth. */\n city?: string;\n /** If KBA-based authentication is used, the recipient's state to prefill. May only be changed if the recipient has not already completed KBA-based auth. */\n state?: string;\n /** If KBA-based authentication is used, the recipient's zip code to prefill. May only be changed if the recipient has not already completed KBA-based auth. */\n zip?: string;\n /** If KBA-based authentication is used, the recipient's date of birth to prefill. May only be changed if the recipient has not already completed KBA-based auth. */\n dob?: string;\n /** If KBA-based authentication is used, the recipient's SSN-Last-4 to prefill. May only be changed if the recipient has not already completed KBA-based auth. */\n ssn_last_4?: string;\n}\n\nexport interface ICreateEnvelopeDocumentFromData {\n /** The order in which the document should be displayed. */\n order?: number;\n /** Override the detected MIME type for the document. */\n mime?: string;\n /** The name of the document. Will be used to generate the final filename. */\n name?: string;\n /** Base-64 encoded content of the document. */\n data: string;\n}\n\nexport interface ICreateEnvelopeDocumentFromUri {\n /** The order in which the document should be displayed. */\n order?: number;\n /** Override the detected MIME type for the document. */\n mime?: string;\n /** The name of the document. Will be used to generate the final filename. */\n name?: string;\n /** URI from which Verdocs should download a copy of the document. Pre-signed URLs with short (<60s) expirations are strongly recommended. */\n uri: string;\n}\n\nexport interface ICreateEnvelopeDocumentFromFile {\n /** The order in which the document should be displayed. */\n order?: number;\n /** Override the detected MIME type for the document. */\n mime?: string;\n /** The name of the document. Will be used to generate the final filename. */\n name?: string;\n /** Directly attach a file via form-url-encoded POST attachment. */\n file?: any;\n}\n\nexport interface ICreateEnvelopeFieldFromTemplate {\n /** The machine name of the field, e.g. `Buyer-textbox-1` */\n name: string;\n /** The ID of the role in the recipients list, e.g. `Recipient 2` */\n role_name: string;\n /** Override the \"required\" setting from the template. */\n required?: boolean;\n /** Override the \"readonly\" setting from the template. */\n readonly?: boolean;\n /** Override the \"label\" setting from the template. */\n label?: string;\n /** Override the \"default\" setting from the template. If a default is provided, the field will be marked as \"prepared\". */\n default?: string;\n /** Override the \"placeholder\" setting from the template. */\n placeholder?: string;\n /** Override the \"multiline\" setting from the template. */\n multiline?: boolean;\n /** For fields that support grouping (radio buttons and check boxes) the value selected will be stored under this name. */\n group?: string;\n /** Override the \"options\" setting from the template. */\n options?: IDropdownOption[] | null;\n}\n\nexport interface ICreateEnvelopeFieldDirectly {\n /** The array index of the document the field is for. */\n document_id: number;\n /** The machine name of the field, e.g. `Buyer-textbox-1` */\n name: string;\n /** The ID of the role in the recipients list, e.g. `Recipient 2` */\n role_name: string;\n /** The type of the field */\n type: TFieldType;\n /** The 1-based page number the field is displayed on. \"Self-placed\" fields that the user must apply will be on page 0. */\n page: number;\n /** The X position of the field. */\n x: number;\n /** The Y position of the field. */\n y: number;\n /** The width of the field. */\n width?: number;\n /** The height of the field. */\n height?: number;\n /** If true, the field will be required */\n required?: boolean;\n /** If true, the field will be not be editable by the participant(s). NOTE: Fields may not be both required and readonly. */\n readonly?: boolean;\n /** If set, the placeholder/label for the field. */\n label?: string;\n /** The default value for the field. */\n default?: string;\n /** The placeholder to show in the field. */\n placeholder?: string;\n /** For text boxes, allows more than one line of text to be entered. */\n multiline?: boolean;\n /** For fields that support grouping (radio buttons and check boxes) the value selected will be stored under this name. */\n group?: string;\n /** For dropdowns, the options that are selectable. */\n options?: IDropdownOption[] | null;\n}\n\nexport interface ICreateEnvelopeFromTemplateRequest {\n template_id: string;\n /** Override the name of the envelope to create. */\n name?: string;\n /** Override the description of the envelope to create. */\n description?: string;\n /** Override the sender name of the envelope in email and other notifications. NOTE: To prevent spam filters from blocking messages, only the NAME may be overidden. The \"from\" email address will be notifications@verdocs.com and cannot be changed. */\n sender_name?: string;\n /** Override the sender email of the envelope in email and other notifications. NOTE: This will change areas that reflect the sender's email in the Web UI and certificate. It cannot change the email address used for notifications. */\n sender_email?: string;\n /** If set, Verdocs will not attempt to contact the recipient via email or SMS. */\n no_contact?: boolean;\n /** If set, the envelope will automatically expire at the specified date/time (ISO8601, UTC) */\n expires_at?: string;\n /** Environment in which to execute the envelope. Do not set this unless instructed to do so by Verdocs support. */\n environment?: string;\n /** Visibility of the envelope. If set to 'shared', the envelope will be visible to all users in the organization. If set to 'private', only the creator and recipients will see it. */\n visibility?: 'private' | 'shared';\n /** Delay (in seconds) before the first reminder is sent (min: 4hrs). Set to 0 or null to disable. */\n initial_reminder?: number;\n /** Delay (in seconds) before subsequent remidners are sent (min: 12hrs). Set to 0 or null to disable. */\n followup_reminders?: number;\n /** List of recipients to configure. */\n recipients: ICreateEnvelopeRecipientFromTemplate[];\n /** Optional metadata to attach to the envelope. This is not used by Verdocs, but may be used for internal tracking purposes by the caller. This is not shown to recipients, but is not private and should not be used to store sensitive data. */\n data?: any;\n /** Fields to create in the envelope. Note that document_id is a number in this call and should match the index of the document in the documents array. */\n fields?: ICreateEnvelopeFieldFromTemplate;\n}\n\nexport interface ICreateEnvelopeDirectlyRequest {\n /** The name of the envelope to create. */\n name: string;\n /** The description of the envelope to create. */\n description?: string;\n /** Override the sender name of the envelope in email and other notifications. NOTE: To prevent spam filters from blocking messages, only the NAME may be overidden. The \"from\" email address will be notifications@verdocs.com and cannot be changed. */\n sender_name?: string;\n /** Override the sender email of the envelope in email and other notifications. NOTE: This will change areas that reflect the sender's email in the Web UI and certificate. It cannot change the email address used for notifications. */\n sender_email?: string;\n /** If set, Verdocs will not attempt to contact the recipient via email or SMS. */\n no_contact?: boolean;\n /** If set, the envelope will automatically expire at the specified date/time (ISO8601, UTC) */\n expires_at?: string;\n /** Environment in which to execute the envelope. Do not set this unless instructed to do so by Verdocs support. */\n environment?: string;\n /** Visibility of the envelope. If set to 'shared', the envelope will be visible to all users in the organization. If set to 'private', only the creator and recipients will see it. */\n visibility?: 'private' | 'shared';\n /** Delay (in seconds) before the first reminder is sent (min: 4hrs). Set to 0 or null to disable. */\n initial_reminder: number;\n /** Delay (in seconds) before subsequent remidners are sent (min: 12hrs). Set to 0 or null to disable. */\n followup_reminders: number;\n /** Optional metadata to attach to the envelope. This is not used by Verdocs, but may be used for internal tracking purposes by the caller. This is not shown to recipients, but is not private and should not be used to store sensitive data. */\n data?: any;\n /** List of recipients to configure. */\n recipients: ICreateEnvelopeRecipientDirectly[];\n /** Documents to attach to the envelope. */\n documents: (ICreateEnvelopeDocumentFromData | ICreateEnvelopeDocumentFromUri | ICreateEnvelopeDocumentFromFile)[];\n /** Fields to create in the envelope. Note that document_id is a number in this call and should match the index of the document in the documents array. */\n fields: ICreateEnvelopeFieldDirectly[];\n}\n\nexport type TCreateEnvelopeRequest = ICreateEnvelopeFromTemplateRequest | ICreateEnvelopeDirectlyRequest;\n\nexport interface IAuthenticateRecipientViaPasscodeRequest {\n auth_method: 'passcode';\n code: string;\n}\n\nexport interface IAuthenticateRecipientViaEmailRequest {\n auth_method: 'email';\n code: string;\n resend?: boolean;\n}\n\nexport interface IAuthenticateRecipientViaSMSRequest {\n auth_method: 'sms';\n code: string;\n resend?: boolean;\n}\n\nexport interface IKBAResponse {\n type: string;\n answer: string | number;\n}\n\nexport interface IAuthenticateRecipientViaKBARequest {\n auth_method: 'kba';\n first_name?: string;\n last_name?: string;\n address?: string;\n city?: string;\n state?: string;\n zip?: string;\n ssn_last_4?: string;\n dob?: string;\n responses?: IKBAResponse[];\n}\n\nexport type TAuthenticateRecipientRequest =\n | IAuthenticateRecipientViaPasscodeRequest\n | IAuthenticateRecipientViaEmailRequest\n | IAuthenticateRecipientViaSMSRequest\n | IAuthenticateRecipientViaKBARequest;\n\n/**\n * These disclosures will be used if no overrides are supplied by the caller. Overrides must\n * be applied at the Organization level before creating an envelope.\n */\nexport const DEFAULT_DISCLOSURES = `\n<ul>\n <li>\n Agree to use electronic records and signatures, and confirm you have read the\n <a href=\"https://verdocs.com/en/electronic-record-signature-disclosure/\" target=\"_blank\">\n Electronic Record and Signatures Disclosure</a>.</li>\n <li>\n Agree to Verdocs'\n <a href=\"https://verdocs.com/en/eula\" target=\"_blank\">\n End User License Agreement</a>\n and confirm you have read Verdocs'\n <a href=\"https://verdocs.com/en/privacy-policy/\" target=\"_blank\">\n Privacy Policy</a>.\n </li>\n</ul>`;\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 {getApiKeys} from '@verdocs/js-sdk';\n *\n * const keys = await getApiKeys(ORGID);\n * ```\n *\n * @group API Keys\n * @api GET /v2/api-keys Get API keys\n * @apiSuccess array(items: IApiKey) . A list of the API keys for the caller's organization. Secrets will not be included.\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 {createApiKey} from '@verdocs/js-sdk';\n *\n * await createApiKey(ORGID, {name: NEWNAME});\n * ```\n *\n * @group API Keys\n * @api POST /v2/api-keys Create API key\n * @apiBody string name A name used to identify the key in the Verdocs Web App\n * @apiBody string(format:uuid) profile_id The profile ID that calls made using the key will act as\n * @apiBody array(items:string) permission An array of permissions to assign to the new key. Extends (but does not override) the API key's profile permissions.\n * @apiSuccess IApiKey . The newly-created API key, including its secret.\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 {rotateApiKey} from '@verdocs/js-sdk';\n *\n * const {client_secret: newSecret} = await rotateApiKey(ORGID, CLIENTID);\n * ```\n *\n * @group API Keys\n * @api POST /v2/api-keys/:client_id/rotate Rotate API key\n * @apiParam string(format:uuid) client_id The client ID of the key to rotate\n * @apiSuccess IApiKey . The updated API key with its new secret.\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 {updateApiKey} from '@verdocs/js-sdk';\n *\n * await updateApiKey(ORGID, CLIENTID, {name: NEWNAME});\n * ```\n *\n * @group API Keys\n * @api PATCH /v2/api-keys/:client_id Update API key\n * @apiBody string name? New name for the API key\n * @apiBody array(items:string) permission New array of permissions to assign to the new key. Extends (but does not override) the API key's profile permissions.\n * @apiSuccess IApiKey . The updated API key. The secret will not be included.\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 {deleteApiKey} from '@verdocs/js-sdk';\n *\n * await deleteApiKey(ORGID, CLIENTID);\n * ```\n *\n * @group API Keys\n * @api DELETE /v2/api-keys/:client_id Delete API key\n * @apiSuccess string . Success.\n */\nexport const deleteApiKey = (endpoint: VerdocsEndpoint, clientId: string) =>\n endpoint.api //\n .delete(`/v2/api-keys/${clientId}`)\n .then((r) => r.data);\n","import {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {IProfile} from '../Models';\n\n/**\n * An Organization Contact (aka Profile) is an individual user with no access to an organization. These entries\n * appear only in contact lists, usually to populate quick-search dropdowns when sending envelopes.\n *\n * @module\n */\n\n/**\n * Get a list of the contacts in the caller's organization.\n *\n * ```typescript\n * import {getOrganizationContacts} from '@verdocs/js-sdk';\n *\n * const members = await getOrganizationContacts(VerdocsEndpoint.getDefault()});\n * ```\n *\n * @group Organization Contacts\n * @api GET /v2/organization-contacts Get a list of organization contacts\n * @apiBody string email Email address for the invitee\n * @apiBody string token Invite token for the invitee\n * @apiSuccess string . Success. The invitation will be marked declined and the token will be invalidated.\n */\nexport const getOrganizationContacts = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IProfile[]>(`/v2/organization-contacts`)\n .then((r) => r.data);\n\n/**\n * Delete a contact from the caller's organization. Note that the caller must be an admin or owner.\n *\n * ```typescript\n * import {deleteOrganizationContact} from '@verdocs/js-sdk';\n *\n * await deleteOrganizationContact(VerdocsEndpoint.getDefault(), 'PROFILEID'});\n * ```\n *\n * @group Organization Contacts\n * @api POST /v2/organization-invitations/decline GET a list of pending invitations\n * @apiBody string email Email address for the invitee\n * @apiBody string token Invite token for the invitee\n * @apiSuccess string . Success. The invitation will be marked declined and the token will be invalidated.\n */\nexport const deleteOrganizationContact = (endpoint: VerdocsEndpoint, profileId: string) =>\n endpoint.api //\n .delete(`/v2/organization-contacts/${profileId}`)\n .then((r) => r.data);\n\n/**\n * Update a member.\n *\n * ```typescript\n * import {createOrganizationContact} from '@verdocs/js-sdk';\n *\n * const result = await createOrganizationContact(VerdocsEndpoint.getDefault(), 'PROFILEID', {first_name:'First', last_name:'Last', email:'a@b.com'});\n * ```\n */\nexport const createOrganizationContact = (\n endpoint: VerdocsEndpoint,\n params: Pick<IProfile, 'first_name' | 'last_name' | 'email' | 'phone'>,\n) =>\n endpoint.api //\n .post(`/v2/organization-contacts`, params)\n .then((r) => r.data);\n\n/**\n * Update a member.\n *\n * ```typescript\n * import {updateOrganizationContact} from '@verdocs/js-sdk';\n *\n * const result = await updateOrganizationContact(VerdocsEndpoint.getDefault(), 'PROFILEID', {first_name:'NewFirst'});\n * ```\n */\nexport const updateOrganizationContact = (\n endpoint: VerdocsEndpoint,\n profileId: string,\n params: Pick<IProfile, 'first_name' | 'last_name' | 'email' | 'phone'>,\n) =>\n endpoint.api //\n .patch(`/v2/organization-contacts/${profileId}`, params)\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 '../Sessions';\nimport {IGroup} from '../Models';\n\n/**\n * Get a list of groups for the caller's organization. NOTE: Any organization member may request\n * the list of groups, but only Owners and Admins may update them.\n *\n * ```typescript\n * import {getGroups} from '@verdocs/js-sdk';\n *\n * const groups = await getGroups();\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 group = 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\n/**\n * Create a group. Note that \"everyone\" is a reserved name and may not be created.\n *\n * ```typescript\n * import {createGroup} from '@verdocs/js-sdk';\n *\n * const group = await createGroup(VerdocsEndpoint.getDefault(), {name:'newgroup'});\n * ```\n */\nexport const createGroup = (endpoint: VerdocsEndpoint, params: {name: string; permissions: TPermission[]}) =>\n endpoint.api //\n .post('/v2/organization-groups', params)\n .then((r) => r.data);\n\n/**\n * Update a group. Note that \"everyone\" is a reserved name and may not be changed.\n *\n * ```typescript\n * import {updateGroup} from '@verdocs/js-sdk';\n *\n * const updated = await updateGroup(VerdocsEndpoint.getDefault(), {name:'newname'});\n * ```\n */\nexport const updateGroup = (endpoint: VerdocsEndpoint, groupId: string, params: {name: string; permissions: TPermission[]}) =>\n endpoint.api //\n .patch(`/v2/organization-groups/${groupId}`, params)\n .then((r) => r.data);\n\n/**\n * Get an organization by ID. Note that the \"everyone\" group cannot be deleted.\n *\n * ```typescript\n * import {deleteGroup} from '@verdocs/js-sdk';\n *\n * await deleteGroup(VerdocsEndpoint.getDefault(), 'ORGID');\n * ```\n */\nexport const deleteGroup = (endpoint: VerdocsEndpoint, groupId: string) =>\n endpoint.api //\n .delete(`/v2/organization-groups/${groupId}`)\n .then((r) => r.data);\n\n/**\n * Add a member to a group.\n *\n * ```typescript\n * import {addGroupMember} from '@verdocs/js-sdk';\n *\n * await addGroupMember(VerdocsEndpoint.getDefault(), 'GROUPID', 'PROFILEID');\n * ```\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\n/**\n * Remove a member from a group.\n *\n * ```typescript\n * import {deleteGroupMember} from '@verdocs/js-sdk';\n *\n * await deleteGroupMember(VerdocsEndpoint.getDefault(), 'GROUPID', 'PROFILEID');\n * ```\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","import {IAcceptOrganizationInvitationRequest, ICreateInvitationRequest} from './Types';\nimport type {IAuthenticateResponse} from '../Users';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {IOrganizationInvitation} from '../Models';\n\n/**\n * An invitation represents an opportunity for a Member to join an Organization.\n *\n * @module\n */\n\n/**\n * Get a list of invitations pending for the caller's organization. The caller must be an admin or owner.\n *\n * @group Organization Invitations\n * @api GET /v2/organization-invitations Get a list of pending invitations\n * @apiBody array(items:TRole) roles URL to send Webhook events to. An empty or invalid URL will disable Webhook calls.\n * @apiBody string first_name First name. The user may override this after accepting the invitation.\n * @apiBody string last_name Last name. The user may override this after accepting the invitation.\n * @apiSuccess array(items:IProfile) . List of caller's current organization's members\n */\nexport const getOrganizationInvitations = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IOrganizationInvitation[]>(`/v2/organization-invitations`)\n .then((r) => r.data);\n\n/**\n * Invite a new user to join the organization.\n *\n * @group Organization Invitations\n * @api POST /v2/organization-invitations Invite a new user to join the organization\n * @apiBody string email Email address to send the invitation to\n * @apiBody string first_name First name. The user may override this after accepting the invitation.\n * @apiBody string last_name Last name. The user may override this after accepting the invitation.\n * @apiBody TRole role Initial role to assign to the user once they accept.\n * @apiSuccess IOrganizationInvitation . The newly-created invitation.\n */\nexport const createOrganizationInvitation = (endpoint: VerdocsEndpoint, params: ICreateInvitationRequest) =>\n endpoint.api //\n .post<IOrganizationInvitation>(`/v2/organization-invitations`, params)\n .then((r) => r.data);\n\n/**\n * Delete an invitation. Note that no cancellation message will be sent. Invitations are also one-time-use.\n * If the invitee attempts to join after the invitation is deleted, accepted, or decline, they will be\n * shown an error.\n *\n * @group Organization Invitations\n * @api DELETE /v2/organization-invitations/:email Delete a pending invitation\n * @apiSuccess string . Success\n */\nexport const deleteOrganizationInvitation = (endpoint: VerdocsEndpoint, email: string) =>\n endpoint.api //\n .delete(`/v2/organization-invitations/${email}`)\n .then((r) => r.data);\n\n/**\n * Update an invitation. Note that email may not be changed after the invite is sent. To change\n * an invitee's email, delete the incorrect entry and create one with the correct value.\n *\n * @group Organization Invitations\n * @api PATCH /v2/organization-invitations/:email Update a pending invitation\n * @apiBody string first_name First name. The user may override this after accepting the invitation.\n * @apiBody string last_name Last name. The user may override this after accepting the invitation.\n * @apiBody TRole role Initial role to assign to the user once they accept.\n * @apiSuccess IOrganizationInvitation . The updated invitation.\n */\nexport const updateOrganizationInvitation = (\n endpoint: VerdocsEndpoint,\n email: string,\n params: Pick<ICreateInvitationRequest, 'role' | 'first_name' | 'last_name'>,\n) =>\n endpoint.api //\n .patch<IOrganizationInvitation>(`/v2/organization-invitations/${email}`, params)\n .then((r) => r.data);\n\n/**\n * Send a reminder to the invitee to join the organization.\n *\n * @group Organization Invitations\n * @api POST /v2/organization-invitations/resend Send a reminder to a pending invitee\n * @apiBody string email The recipient to send the reminder to\n * @apiSuccess IOrganizationInvitation . The updated invitation\n */\nexport const resendOrganizationInvitation = (endpoint: VerdocsEndpoint, email: string) =>\n endpoint.api //\n .post<IOrganizationInvitation>('/v2/organization-invitations/resend', {email})\n .then((r) => r.data);\n\n/**\n * Get an invitation's details. This is generally used as the first step of accepting the invite.\n * A successful response will indicate that the invite token is still valid, and include some\n * metadata for the organization to style the acceptance screen.\n *\n * @group Organization Invitations\n * @api GET /v2/organization-invitations/:email/:token Get a pending invitation (_Authenticated via invite token, not an active session._). Intended to be called by the invitee to get details about the invitation they are about to accept.\n * @apiSuccess IOrganizationInvitation . Requested invitation's details. Will always include summary details for the organization, to be used for branding the accept-invite view.\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\n/**\n * Accept an invitation. This will automatically create a user record for the caller as well as a profile\n * with the appropriate role as specified in the invite. The profile will be set as \"current\" for the caller,\n * and session tokens will be returned to access the new profile. The profile's email_verified flag will\n * also be set to true.\n *\n * @group Organization Invitations\n * @api POST /v2/organization-invitations/accept Accept an invitation\n * @apiBody string email Email address for the invitee\n * @apiBody string token Invite token for the invitee\n * @apiBody string first_name First name\n * @apiBody string last_name Last name\n * @apiBody string password Password\n * @apiSuccess IAuthenticateResponse . Session credentials for the newly-created user's profile. If the user already had a profile for another organization, the new profile will be made \"current\" automatically.\n */\nexport const acceptOrganizationInvitation = (endpoint: VerdocsEndpoint, params: IAcceptOrganizationInvitationRequest) =>\n endpoint.api //\n .post<IAuthenticateResponse>('/v2/organization-invitations/accept', params)\n .then((r) => r.data);\n\n/**\n * Decline an invitation. This will mark the status \"declined,\" providing a visual indication to the\n * organization's admins that the invite was declined, preventing further invites from being created\n * to the same email address, and also preventing the invitee from receiving reminders to join.\n *\n * @group Organization Invitations\n * @api POST /v2/organization-invitations/decline Decline an invitation\n * @apiDescription Mark the status \"declined,\" providing a visual indication to the organization's admins that the invite was declined, preventing further invites from being created to the same email address, and also preventing the invitee from receiving reminders to join.\n * @apiBody string email Email address for the invitee\n * @apiBody string token Invite token for the invitee\n * @apiSuccess string . Success. The invitation will be marked declined and the token will be invalidated.\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\n/**\n * Get a list of the members in the caller's organization.\n *\n * ```typescript\n * import {getOrganizationMembers} from '@verdocs/js-sdk';\n *\n * const members = await getOrganizationMembers(VerdocsEndpoint.getDefault()});\n * ```\n *\n * @group Organization Members\n * @api GET /v2/organization-members List current organization's members\n * @apiSuccess array(items:IProfile) . List of caller's current organization's members\n */\nexport const getOrganizationMembers = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IProfile[]>(`/v2/organization-members`)\n .then((r) => r.data);\n\n/**\n * Delete a member from the caller's organization. Note that the caller must be an admin or owner,\n * may not delete him/herself.\n *\n * ```typescript\n * import {deleteOrganizationMember} from '@verdocs/js-sdk';\n *\n * await deleteOrganizationMember(VerdocsEndpoint.getDefault(), 'PROFILEID'});\n * ```\n *\n * @group Organization Members\n * @api DELETE /v2/organization-members/:profile_id Delete a member from the organization\n * @apiSuccess string . Success\n */\nexport const deleteOrganizationMember = (endpoint: VerdocsEndpoint, profileId: string) =>\n endpoint.api //\n .delete(`/v2/organization-members/${profileId}`)\n .then((r) => r.data);\n\n/**\n * Update a member.\n *\n * ```typescript\n * import {updateOrganizationMember} from '@verdocs/js-sdk';\n *\n * const result = await updateOrganizationMember(VerdocsEndpoint.getDefault(), 'PROFILEID', {roles:['member']});\n * ```\n *\n * @group Organization Members\n * @api PATCH /v2/organization-members/:profile_id Update an organization member.\n * @apiBody array(items:TRole) roles URL to send Webhook events to. An empty or invalid URL will disable Webhook calls.\n * @apiBody string first_name Set to true to enable Webhooks calls.\n * @apiBody string last_name Record<TWebhookEvent, boolean> map of events to enable/disable.\n * @apiSuccess array(items:IProfile) . List of caller's current organization's members\n */\nexport const updateOrganizationMember = (\n endpoint: VerdocsEndpoint,\n profileId: string,\n params: Pick<IProfile, 'roles' | 'first_name' | 'last_name'>,\n) =>\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 * NOTE: There is no call specifically to create an organization. Every organization must have\n * at least one \"owner\" type member. To create a new organization, call createProfile() with\n * the desired new orgName to create. The caller will become the first owner of the new org, and\n * can then invite new members to join as well.\n *\n * NOTE: There is no call to delete an organization. For safety, this is a manual process. Please\n * contact support@verdocs.com if you wish to completely delete an organization and all its records.\n *\n * @module\n */\n\nimport {IEntitlement, IOrganization, IProfile, TOrganizationUsage} from '../Models';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {IAuthenticateResponse} from '../Users';\nimport {collapseEntitlements} from '../Utils';\nimport {TUsageType} from '../BaseTypes';\n\n/**\n * Get an organization by ID. Note that this endpoint will return only a subset of fields\n * if the caller is not a member of the organization (the public fields).\n *\n * ```typescript\n * import {getOrganization} from '@verdocs/js-sdk';\n *\n * const organizations = await getOrganization(VerdocsEndpoint.getDefault(), 'ORGID');\n * ```\n *\n * @group Organizations\n * @api GET /v2/organizations/:organization_id Get organization\n * @apiSuccess IOrganization . The requested organization. The caller must be a member.\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 * Get an organization's \"children\".\n *\n * ```typescript\n * import {getOrganizationChildren} from '@verdocs/js-sdk';\n *\n * const children = await getOrganizationChildren(VerdocsEndpoint.getDefault(), 'ORGID');\n * ```\n *\n * @group Organizations\n * @api GET /v2/organizations/:organization_id/children Get an organization's children\n * @apiSuccess IOrganization[] . Any child organizations found.\n */\nexport const getOrganizationChildren = (endpoint: VerdocsEndpoint, organizationId: string) =>\n endpoint.api //\n .get<IOrganization>(`/v2/organizations/${organizationId}/children`)\n .then((r) => r.data);\n\n/**\n * Get an organization's usage data. If the organization is a parent, usage data for children\n * will be included as well. The response will be a nested object keyed by organization ID,\n * with each entry being a dictionary of usageType:count entries.\n *\n * ```typescript\n * import {getOrganizationUsage} from '@verdocs/js-sdk';\n *\n * const usage = await getOrganizationUsage(VerdocsEndpoint.getDefault(), 'ORGID');\n * ```\n *\n * @group Organizations\n * @api GET /v2/organizations/:organization_id/usage Get an organization's usage metrics\n * @apiSuccess TOrganizationUsage . Usage data grouped by organization ID\n */\nexport const getOrganizationUsage = (\n endpoint: VerdocsEndpoint,\n organizationId: string,\n params?: {start_date?: string; end_date?: string; usage_type?: TUsageType},\n) =>\n endpoint.api //\n .get<TOrganizationUsage>(`/v2/organizations/${organizationId}/usage`, {params})\n .then((r) => r.data);\n\n/**\n * Create an organization. The caller will be assigned an \"Owner\" profile in the new organization,\n * and it will be set to \"current\" automatically. A new set of session tokens will be issued to\n * the caller, and the caller should update their endpoint to use the new tokens.\n *\n * ```typescript\n * import {createOrganization} from '@verdocs/js-sdk';\n *\n * const organization = await createOrganization(VerdocsEndpoint.getDefault(), {name: 'NewOrg'});\n * ```\n *\n * @group Organizations\n * @api POST /v2/organizations Create organization\n * @apiDescription The caller will be assigned an \"Owner\" profile in the new organization, and it will be set to \"current\" automatically. A new set of session tokens will be issued to the caller, and the caller should update their endpoint to use the new tokens.\n * @apiBody string name The name of the new organization\n * @apiBody string parent_id? If set, the new organization will be created as a child of the specified parent organization. The caller must be an admin of the parent organization.\n * @apiBody string contact_email? Contact email for the new organization\n * @apiBody string url? URL for the new organization\n * @apiBody string full_logo_url? URL of a large-format PNG logo\n * @apiBody string thumbnail_url? URL of a small-format (square is recommended) PNG logo\n * @apiBody string primary_color? URL of a small-format (square is recommended) PNG logo\n * @apiBody string secondary_color? URL of a small-format (square is recommended) PNG logo\n * @apiBody string terms_use_url? URL of a Terms of Use page, shown in bottom-right of signing experience. Hidden if not set.\n * @apiBody string privacy_policy_url? URL of a Privacy Policy page, shown in bottom-right of signing experience. Hidden if not set.\n * @apiBody string powered_by_label? \"Powered-by...\" label, shown in bottom-left of signing experience. Hidden if not set.\n * @apiBody string powered_by_url? URL for the Powered By label to show when clicked. Rendered as a static label if not set.\n * @apiSuccess IAuthenticateResponse . Authentication credentials for user in the new organization. The user will be made an Owner automatically.\n */\nexport const createOrganization = (\n endpoint: VerdocsEndpoint,\n params: {name: string} & Partial<\n Pick<\n IOrganization,\n | 'address'\n | 'address2'\n | 'phone'\n | 'contact_email'\n | 'url'\n | 'full_logo_url'\n | 'thumbnail_url'\n | 'primary_color'\n | 'secondary_color'\n | 'terms_use_url'\n | 'privacy_policy_url'\n | 'powered_by_label'\n | 'powered_by_url'\n | 'parent_id'\n >\n >,\n) =>\n endpoint.api //\n .post<IAuthenticateResponse & {profile: IProfile; organization: IOrganization}>(`/v2/organizations`, params)\n .then((r) => r.data);\n\n/**\n * Update an organization. This can only be called by an admin or owner.\n *\n * ```typescript\n * import {updateOrganization} from '@verdocs/js-sdk';\n *\n * const organizations = await updateOrganization(VerdocsEndpoint.getDefault(), organizationId, {name:'ORGNAME'});\n * ```\n *\n * @group Organizations\n * @api PATCH /v2/organizations/:organization_id Update organization\n * @apiBody string name The name of the new organization\n * @apiBody string contact_email? Contact email for the new organization\n * @apiBody string url? URL for the new organization\n * @apiBody string full_logo_url? URL of a large-format PNG logo\n * @apiBody string thumbnail_url? URL of a small-format (square is recommended) PNG logo\n * @apiBody string primary_color? URL of a small-format (square is recommended) PNG logo\n * @apiBody string secondary_color? URL of a small-format (square is recommended) PNG logo\n * @apiBody string terms_use_url? URL of a Terms of Use page, shown in bottom-right of signing experience. Hidden if not set.\n * @apiBody string privacy_policy_url? URL of a Privacy Policy page, shown in bottom-right of signing experience. Hidden if not set.\n * @apiBody string powered_by_label? \"Powered-by...\" label, shown in bottom-left of signing experience. Hidden if not set.\n * @apiBody string powered_by_url? URL for the Powered By label to show when clicked. Rendered as a static label if not set.\n * @apiSuccess IOrganization . The details for the updated 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/**\n * Delete an organization. This can only be called by an owner. Inclusion of the organization ID to delete\n * is just a safety check. The caller may only delete the organization they have currently selected.\n *\n * ```typescript\n * import {deleteOrganization} from '@verdocs/js-sdk';\n *\n * const newSession = await deleteOrganization(VerdocsEndpoint.getDefault(), organizationId);\n * ```\n *\n * @group Organizations\n * @api DELETE /v2/organizations/:organization_id Delete organization\n * @apiSuccess IAuthenticateResponse . If the caller is a member of another organization, authentication credentials for the next organization available. If not, this will be null and the caller will be logged out.\n */\nexport const deleteOrganization = (endpoint: VerdocsEndpoint, organizationId: string) =>\n endpoint.api //\n .delete<IAuthenticateResponse | null>(`/v2/organizations/${organizationId}`)\n .then((r) => r.data);\n\n/**\n * Update the organization's full or thumbnail logo. This can only be called by an admin or owner.\n *\n * ```typescript\n * import {updateOrganizationLogo} from '@verdocs/js-sdk';\n *\n * await updateOrganizationLogo((VerdocsEndpoint.getDefault(), organizationId, file);\n * ```\n *\n * @group Organizations\n * @api PATCH /v2/organizations/:organization_id Update organization full or thumbnail logo.\n * @apiBody image/png logo? Form-url-encoded file to upload\n * @apiBody image/png thumbnail? Form-url-encoded file to upload\n * @apiSuccess IOrganization . The updated organization.\n */\nexport const updateOrganizationLogo = (\n endpoint: VerdocsEndpoint,\n organizationId: string,\n file: File,\n onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void,\n) => {\n const formData = new FormData();\n formData.append('logo', file, file.name);\n\n return endpoint.api //\n .patch<IOrganization>(`/v2/organizations/${organizationId}`, 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 * Update the organization's thumbnail. This can only be called by an admin or owner.\n *\n * ```typescript\n * import {updateOrganizationThumbnail} from '@verdocs/js-sdk';\n *\n * await updateOrganizationThumbnail((VerdocsEndpoint.getDefault(), organizationId, file);\n * ```\n */\nexport const updateOrganizationThumbnail = (\n endpoint: VerdocsEndpoint,\n organizationId: string,\n file: File,\n onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void,\n) => {\n const formData = new FormData();\n formData.append('thumbnail', file, file.name);\n\n return endpoint.api //\n .patch<IOrganization>(`/v2/organizations/${organizationId}`, 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\nexport const getEntitlements = async (endpoint: VerdocsEndpoint) =>\n endpoint.api.get<IEntitlement[]>(`/v2/organizations/entitlements`).then((r) => r.data);\n\n/**\n * Largely intended to be used internally by Web SDK components but may be informative for other cases.\n * Entitlements are feature grants such as \"ID-based KBA\" that require paid contracts to enable, typically\n * because the underlying services that support them are fee-based. Entitlements may run concurrently,\n * and may have different start/end dates e.g. \"ID-based KBA\" may run 1/1/2026-12/31/2026 while\n * \"SMS Authentication\" may be added later and run 6/1/2026-5/31/2027. The entitlements list is a simple\n * array of enablements and may include entries that are not YET enabled or have now expired.\n *\n * In client code it is helpful to simply know \"is XYZ feature currently enabled?\" This function collapses\n * the entitlements list to a simplified dictionary of current/active entitlements. Note that it is async\n * because it calls the server to obtain the \"most current\" entitlements list. Existence of an entry in the\n * resulting dictionary implies the feature is active. Metadata inside each entry can be used to determine\n * limits, etc.\n *\n * ```typescript\n * import {getActiveEntitlements} from '@verdocs/js-sdk';\n *\n * const activeEntitlements = await getActiveEntitlements((VerdocsEndpoint.getDefault());\n * const isSMSEnabled = !!activeEntitlements.sms_auth;\n * const monthlyKBALimit = activeEntitlements.kba_auth?.monthly_max;\n * ```\n */\nexport const getActiveEntitlements = async (endpoint: VerdocsEndpoint) => {\n if (!endpoint.session) {\n throw new Error('No active session');\n }\n\n const entitlements = await getEntitlements(endpoint);\n return collapseEntitlements(entitlements);\n};\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 Webhook configuration for the caller's organization.\n *\n * ```typescript\n * import {getWebhooks} from '@verdocs/js-sdk';\n *\n * await getWebhooks(ORGID, params);\n * ```\n *\n * @group Webhooks\n * @api GET /v2/webhooks Get organization Webhooks config\n * @apiSuccess IWebhook . The current Webhooks config for the caller's organization.\n */\nexport const getWebhooks = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IWebhook>(`/v2/webhooks`)\n .then((r) => r.data);\n\n/**\n * Update the registered Webhook configuration for the caller's organization. Note that\n * Webhooks cannot currently be deleted, but may be easily disabled by setting `active`\n * to `false` and/or setting the `url` to an empty string.\n *\n * ```typescript\n * import {setWebhooks} from '@verdocs/js-sdk';\n *\n * await setWebhooks(ORGID, params);\n * ```\n *\n * @group Webhooks\n * @api PATCH /v2/webhooks Update organization Webhooks config\n * @apiDescription Note that Webhooks cannot currently be deleted, but may be easily disabled by setting `active` to `false` and/or setting the `url` to an empty string.\n * @apiBody string url URL to send Webhook events to. An empty or invalid URL will disable Webhook calls.\n * @apiBody boolean active Set to true to enable Webhooks calls.\n * @apiBody object events Record<TWebhookEvent, boolean> map of events to enable/disable.\n * @apiSuccess IWebhook . The updated Webhooks config for the caller's organization.\n */\nexport const setWebhooks = (endpoint: VerdocsEndpoint, params: ISetWebhookRequest) =>\n endpoint.api //\n .patch<IWebhook>(`/v2/webhooks`, params)\n .then((r) => r.data);\n\n/**\n * Rotate the secret key used to authenticate Webhooks. If a secret key has not yet been set,\n * it will be created. Until this is done, Webhook calls will not have a signature applied to\n * their headers. Please note that pending Webhook deliveries will not be affected until the\n * next Webhook is triggered.\n *\n * To authenticate a Webhook call, compute an HMAC-256 hash of the JSON payload `body` field\n * as follows:\n *\n * ```typescript\n * // NOTE: Hash the `body` field INSIDE the payload. In many frameworks the payload is also called\n * // `body`, which can be confusing.\n * const jsonBody = JSON.stringify(req.body.body);\n * const hash = createHmac('sha256', SECRET_KEY).update(jsonBody).digest('hex');\n * if (hash !== req.headers['x-webhook-signature']) {\n * // Handle error here\n * }\n *\n * // It is important to return a 200 status code anyway, to avoid the sender trying to resend\n * // the same data.\n * res.status(200).send();\n * ```\n *\n * @group Webhooks\n * @api PATCH /v2/webhooks Rotate Webhook secret key\n * @apiDescription Note that Webhooks cannot currently be deleted, but may be easily disabled by setting `active` to `false` and/or setting the `url` to an empty string.\n * @apiSuccess IWebhook . The updated Webhooks config for the caller's organization, including the secret_key.\n */\nexport const rotateWebhookSecret = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .put<IWebhook>(`/v2/webhooks/rotate-secret`)\n .then((r) => r.data);\n"],"names":["globalThis"],"mappings":";;;;;AAEO,MAAM,WAAW,GAAiB;IACvC,SAAS;IACT,WAAW;IACX,SAAS;IACT,MAAM;IACN,UAAU;IACV,WAAW;;IAEX,UAAU;IACV,UAAU;IACV,OAAO;IACP,YAAY;IACZ,SAAS;;AAGJ,MAAM,oBAAoB,GAA+B;AAC9D,IAAA,SAAS,EAAE,EAAE;AACb,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,IAAI,EAAE,EAAE;AACR,IAAA,SAAS,EAAE,GAAG;AACd,IAAA,OAAO,EAAE,GAAG;AACZ,IAAA,QAAQ,EAAE,GAAG;AACb,IAAA,QAAQ,EAAE,EAAE;AACZ,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,QAAQ,EAAE,EAAE;AACZ,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,OAAO,EAAE,EAAE;;AAGN,MAAM,qBAAqB,GAA+B;AAC/D,IAAA,SAAS,EAAE,EAAE;AACb,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,IAAI,EAAE,EAAE;AACR,IAAA,SAAS,EAAE,EAAE;AACb,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,QAAQ,EAAE,EAAE;AACZ,IAAA,QAAQ,EAAE,EAAE;AACZ,IAAA,KAAK,EAAE,EAAE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../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/Users/Auth.ts","../src/Users/Notifications.ts","../src/Users/Profiles.ts","../src/VerdocsEndpoint.ts","../src/Envelopes/Envelopes.ts","../src/Templates/Actions.ts","../src/Templates/Fields.ts","../src/Sessions/Permissions.ts","../src/Templates/Permissions.ts","../src/Templates/Roles.ts","../src/Templates/Templates.ts","../src/Templates/TemplateDocuments.ts","../src/Templates/Validators.ts","../src/Envelopes/Fields.ts","../src/Envelopes/Initials.ts","../src/Envelopes/KBA.ts","../src/Envelopes/Recipients.ts","../src/Envelopes/Permissions.ts","../src/Envelopes/Signatures.ts","../src/Envelopes/Types.ts","../src/Organizations/ApiKeys.ts","../src/Organizations/Contacts.ts","../src/Organizations/Groups.ts","../src/Organizations/Invitations.ts","../src/Organizations/Members.ts","../src/Organizations/Organizations.ts","../src/Organizations/Webhooks.ts"],"sourcesContent":["import type {TFieldType} from './BaseTypes';\n\nexport const FIELD_TYPES: TFieldType[] = [\n 'textbox',\n 'signature',\n 'initial',\n 'date',\n 'dropdown',\n 'timestamp',\n /** @deprecated. Use `textbox` with multiLine set to > 1 */\n 'textarea',\n 'checkbox',\n 'radio',\n 'attachment',\n 'payment',\n];\n\nexport const DEFAULT_FIELD_WIDTHS: Record<TFieldType, number> = {\n signature: 71,\n initial: 71,\n date: 75,\n timestamp: 130,\n textbox: 150,\n textarea: 150,\n checkbox: 14,\n radio: 14,\n dropdown: 85,\n attachment: 24,\n payment: 24,\n};\n\nexport const DEFAULT_FIELD_HEIGHTS: Record<TFieldType, number> = {\n signature: 36,\n initial: 36,\n date: 15,\n timestamp: 15,\n textbox: 15,\n textarea: 41,\n checkbox: 14,\n radio: 14,\n dropdown: 20,\n attachment: 24,\n payment: 24,\n};\n\nexport const WEBHOOK_EVENTS = [\n 'envelope_created',\n 'envelope_completed',\n 'envelope_canceled',\n\n 'template_created',\n 'template_updated',\n 'template_deleted',\n 'template_used',\n];\n\nexport const ALL_PERMISSIONS = [\n // TODO: Are these permissions still relevant?\n // 'member:view',\n // 'org:create',\n // 'org:view',\n // 'org:list',\n // 'org:transfer',\n\n 'template:creator:create:public',\n 'template:creator:create:org',\n 'template:creator:create:personal',\n 'template:creator:delete',\n 'template:creator:visibility',\n 'template:member:read',\n 'template:member:write',\n 'template:member:delete',\n 'template:member:visibility',\n 'owner:add',\n 'owner:remove',\n 'admin:add',\n 'admin:remove',\n 'member:view',\n 'member:add',\n 'member:remove',\n 'org:create',\n 'org:view',\n 'org:update',\n 'org:delete',\n 'org:transfer',\n 'org:list',\n 'envelope:create',\n 'envelope:cancel',\n 'envelope:view',\n];\n","import type {TRole} from '../Sessions';\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","const 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","import {TEntitlement} from '../BaseTypes';\nimport {IEntitlement} from '../Models';\n\nexport const collapseEntitlements = (entitlements: IEntitlement[]) => {\n const now = new Date();\n const activeEntitlements: Partial<Record<TEntitlement, IEntitlement>> = {};\n\n entitlements.forEach((entitlement) => {\n const start = new Date(entitlement.starts_at);\n const end = new Date(entitlement.ends_at);\n if (now >= start && now <= end && !activeEntitlements[entitlement.feature]) {\n activeEntitlements[entitlement.feature] = entitlement;\n }\n });\n\n return activeEntitlements;\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\n// Generate a random string of a given length. This is NOT cryptographically strong. It is meant for light-duty\n// uses such as assigning IDs to DOM elements.\nexport const randomString = (length: number) =>\n Math.random()\n .toString(36)\n .substring(2, 2 + length + 1);\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 = (source?: {first_name?: string | null; last_name?: string | null; [key: string]: any} | null) =>\n `${capitalize(source?.first_name || '')} ${capitalize(source?.last_name || '')}`.trim();\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 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 {IAuthenticateResponse, IChangePasswordRequest, IChangePasswordResponse, IVerifyEmailRequest} from './Types';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {IUser} from '../Models';\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 *\n * @group Authentication\n * @api POST /v2/oauth2/token Authenticate\n * @apiBody string(enum: 'client_credentials'|'refresh_token'|'password') grant_type The type of grant to request. API callers should nearly always use 'client_credentials'.\n * @apiBody string(format: 'uuid') client_id? If grant_type is client_credentials or refresh_token, the client ID of the API key to use.\n * @apiBody string(format: 'uuid') client_secret? If grant_type is client_credentials, the secret key of the API key to use.\n * @apiBody string username? If grant_type is password, the username to authenticate with.\n * @apiBody string password? If grant_type is password, the password to authenticate with.\n * @apiBody string password? If grant_type is password, the password to authenticate with.\n * @apiBody string scope? Optional scope to limit the auth token to. Do not specify this unless you are instructed to by a Verdocs Support rep.\n * @apiSuccess IAuthenticateResponse . The detailed metadata for the envelope requested\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, VerdocsEndpoint} from '@verdocs/js-sdk';\n *\n * const {accessToken} = await Auth.refreshTokens();\n * VerdocsEndpoint.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';\n *\n * const {status, message} = await changePassword({ old_password, new_password });\n * if (status !== 'OK') {\n * window.alert(`Password reset error: ${message}`);\n * }\n * ```\n *\n * @group Authentication\n * @api POST /v2/users/change-password Change the caller's password\n * @apiBody string old_password Current password for the caller\n * @apiBody string new_password New password to set for the caller. Must meet strength requirements.\n * @apiSuccess string . Success\n */\nexport const changePassword = (endpoint: VerdocsEndpoint, params: IChangePasswordRequest) =>\n endpoint.api //\n .post<IChangePasswordResponse>('/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';\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 * // Collect code and new password from the user, then call:\n *\n * const {success} = await resetPassword({ email, code, new_password });\n * if (status !== 'OK') {\n * window.alert(`Please check your verification code and try again.`);\n * }\n * ```\n *\n * @group Authentication\n * @api POST /v2/users/reset-password Reset a password for a user\n * @apiBody string email Email address for the user account\n * @apiBody string code? To initiate a reset request, omit this field. To complete it, provide the emailed code received by the user.\n * @apiBody string new_password? To initiate a reset request, omit this field. To complete it, provide the new password the user wishes to use.\n * @apiSuccess string . Success\n */\nexport const resetPassword = (endpoint: VerdocsEndpoint, params: {email: string; code?: string; new_password?: 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 if the email or token are unknown. Instead, an accessToken\n * may be supplied through which the user will be identified. This is intended to be used in post-signup\n * cases where the user is \"partially\" authenticated (has a session, but is not yet verified).\n *\n * ```typescript\n * import {resendVerification} from '@verdocs/js-sdk';\n *\n * const result = await resendVerification();\n * ```\n *\n * @group Authentication\n * @api POST /v2/users/verify Resend an email verification request for a \"partially\" authenticated user (authenticated, but not yet verified)\n * @apiSuccess string . Success\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\n/**\n * Resend the email verification request if the user is unauthenticated, but the email and token are known.\n * Used if the token is valid but has expired.\n *\n * ```typescript\n * import {resendVerification} from '@verdocs/js-sdk';\n *\n * const result = await resendVerification();\n * ```\n *\n * @group Authentication\n * @api POST /v2/users/verify Resend the email verification request if both the email and token are known. Used if the token is valid but has expired.\n * @apiSuccess IAuthenticateResponse . Updated authentication details\n */\nexport const verifyEmail = (endpoint: VerdocsEndpoint, params: IVerifyEmailRequest) =>\n endpoint.api //\n .post<IAuthenticateResponse>('/v2/users/verify', params)\n .then((r) => r.data);\n\n/**\n * Get the caller's current user record.\n *\n * @group Authentication\n * @api GET /v2/users/me Get the caller's user record.\n * @apiSuccess IUser . User record\n */\nexport const getMyUser = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IUser>('/v2/users/me')\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 {IAuthenticateResponse, IUpdateProfileRequest, ICreateProfileRequest} from './Types';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport type {IProfile} from '../Models';\n\n/**\n * Get the caller's available profiles. The current profile will be marked with `current: true`.\n *\n * ```typescript\n * import {getProfiles} from '@verdocs/js-sdk';\n *\n * const profiles = await getProfiles();\n * ```\n *\n * @group Profiles\n * @api GET /v2/profiles Get the caller's profiles\n * @apiDescription A user may have multiple profiles, one for each organization of which they are a member. Only one profile may be \"current\" at a time.\n * @apiSuccess array(items: IProfile) . The caller's profiles\n */\nexport const getProfiles = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IProfile[]>('/v2/profiles')\n .then((r) => r.data);\n\n/**\n * Get the caller's current profile. This is just a convenience accessor that calls `getProfiles()`\n * and returns the first `current: true` entry.\n *\n * ```typescript\n * import {getCurrentProfile} from '@verdocs/js-sdk';\n *\n * const profiles = await getCurrentProfile(VerdocsEndpoint.getDefault());\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 * Switch the caller's \"current\" profile. The current profile is used for permissions checking\n * and profile_id field settings for most operations in Verdocs. It is important to select the\n * appropropriate profile before calling other API functions.\n *\n * ```typescript\n * import {switchProfile} from '@verdocs/js-sdk';\n *\n * const newProfile = await switchProfile(VerdocsEndpoint.getDefault(), 'PROFILEID');\n * ```\n *\n * @group Profiles\n * @api POST /v2/profiles/:profile_id/switch Change the \"current\" profile for the caller\n * @apiSuccess IAuthenticateResponse . New authentication credentials\n */\nexport const switchProfile = (endpoint: VerdocsEndpoint, profileId: string) =>\n endpoint.api //\n .post<IAuthenticateResponse>(`/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\n * this must also be the \"current\" profile for the caller.\n *\n * ```typescript\n * import {updateProfile} from '@verdocs/js-sdk/Users';\n *\n * const newProfile = await updateProfile(VerdocsEndpoint.getDefault(), 'PROFILEID');\n * ```\n *\n * @group Profiles\n * @api PATCH /v2/profiles/:profile_id Update a profile\n * @apiBody string first_name? First name\n * @apiBody string last_name? Last name\n * @apiBody string phone? Phone number\n * @apiBody array(items:TPermission) permissions? New permissions to directly apply to the profile\n * @apiBody array(items:TRole) roles? New roles to assign to the profile\n * @apiSuccess IProfile . The updated profile\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\n * available profile will be selected.\n *\n * ```typescript\n * import {deleteProfile} from '@verdocs/js-sdk';\n *\n * await deleteProfile(VerdocsEndpoint.getDefault(), 'PROFILEID');\n * ```\n *\n * @group Profiles\n * @api DELETE /v2/profiles/:profile_id Delete a profile\n * @apiSuccess IAuthenticateResponse . New session tokens for the next available profile for the caller, or null if none.\n */\nexport const deleteProfile = (endpoint: VerdocsEndpoint, profileId: string) =>\n endpoint.api //\n .delete<IAuthenticateResponse | {status: 'OK'; message: 'Your last profile has been deleted. You are now logged out.'}>(\n `/v2/profiles/${profileId}`,\n )\n .then((r) => r.data);\n\n/**\n * Create a new profile. Note that there are two registration paths for creation:\n * - Get invited to an organization, by an admin or owner of that org.\n * - Created a new organization. The caller will become the first owner of the new org.\n *\n * This endpoint is for the second path, so an organization name is required. It is NOT\n * required to be unique because it is very common for businesses to have the same names,\n * without conflicting (e.g. \"Delta\" could be Delta Faucet or Delta Airlines).\n *\n * The new profile will automatically be set as the user's \"current\" profile, and new\n * session tokens will be returned to the caller. However, the caller's email may not yet\n * be verified. In that case, the caller will not yet be able to call other endpoints in\n * the Verdocs API. The caller will need to check their email for a verification code,\n * which should be submitted via the `verifyEmail` endpoint.\n *\n * ```typescript\n * import {createProfile} from '@verdocs/js-sdk';\n *\n * const newSession = await createProfile(VerdocsEndpoint.getDefault(), {\n * orgName: 'NEW ORG', email: 'a@b.com', password: '12345678', firstName: 'FIRST', lastName: 'LAST'\n * });\n * ```\n */\nexport const createProfile = (endpoint: VerdocsEndpoint, params: ICreateProfileRequest) =>\n endpoint.api //\n .post<IAuthenticateResponse>('/v2/profiles', params)\n .then((r) => r.data);\n\n/**\n * Update the caller's profile photo. This can only be called for the user's \"current\" profile.\n *\n * ```typescript\n * import {uploadProfilePhoto} from '@verdocs/js-sdk';\n *\n * await uploadProfilePhoto((VerdocsEndpoint.getDefault(), profileId, file);\n * ```\n *\n * @group Profiles\n * @api PATCH /v2/templates/:template_id Change a profile's photo\n * @apiBody string(format:binary) file File to upload\n * @apiSuccess IProfile . The updated profile\n */\nexport const updateProfilePhoto = (\n endpoint: VerdocsEndpoint,\n profileId: string,\n file: File,\n onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void,\n) => {\n const formData = new FormData();\n formData.append('picture', file, file.name);\n\n return endpoint.api //\n .patch<IProfile>(`/v2/profiles/${profileId}`, 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","import axios, {AxiosInstance} from 'axios';\nimport {TSession, TSessionType} from './Sessions';\nimport {decodeAccessTokenBody, randomString} from './Utils';\nimport globalThis from './Utils/globalThis';\nimport {getCurrentProfile} from './Users';\nimport {IProfile} from './Models';\nimport axiosRetry from 'axios-retry';\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('verdocs-default-endpoint');\n\nconst BETA_ORIGINS = [\n //\n 'https://beta.verdocs.com',\n 'https://stage.verdocs.com',\n 'http://localhost:6006',\n 'http://localhost:5173',\n];\n\nconst requestLogger = (r: any) => {\n // TODO: Re-activate logging via an isomorphic approach\n return r;\n};\n\nconst isBrowser = typeof globalThis.window !== 'undefined';\n\nexport type TEnvironment = '' | 'beta';\n\nexport type TSessionChangedListener = (endpoint: VerdocsEndpoint, session: TSession, profile: IProfile | null) => void;\n\nexport interface VerdocsEndpointOptions {\n baseURL?: string;\n timeout?: number;\n environment?: TEnvironment;\n sessionType?: TSessionType;\n clientID?: string;\n /** By default, sessions will be persisted to localStorage. Set `persist` to false to bypass this. */\n persist?: boolean;\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 persist = true;\n private baseURL = BETA_ORIGINS.includes(globalThis.window?.location?.origin || '')\n ? 'https://stage-api.verdocs.com'\n : 'https://api.verdocs.com';\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 public endpointId = randomString(8);\n\n /**\n * The current user's userId (NOT profileId), or null if not authenticated.\n */\n public sub = null as string | 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 /**\n * The current user's profile, if known. Note that while sessions are loaded and handled synchronously,\n * profiles are loaded asynchronously and may not be available immediately after a session is loaded.\n * To ensure both are available, developers should subscribe to the `onSessionChanged` event, which\n * will not be fired until the profile is loaded and verified.\n */\n public profile = null as IProfile | null;\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.persist = options?.persist ?? this.persist;\n this.api = axios.create({baseURL: this.baseURL, timeout: this.timeout});\n\n // Enable the module but not for any requests, only a few get this\n axiosRetry(this.api, {retries: 0});\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 }\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 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 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, sessionType: TSessionType = 'user'): 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 return this.clearSession();\n }\n\n this.token = token;\n this.session = session;\n this.sub = session.sub;\n this.sessionType = sessionType;\n if (this.sessionType === 'user') {\n this.api.defaults.headers.common.Authorization = `Bearer ${token}`;\n if (this.persist && isBrowser) {\n globalThis.localStorage.setItem(this.sessionStorageKey(), token);\n }\n } else {\n // Required for legacy calls to rForm\n this.api.defaults.headers.common.signer = `Bearer ${token}`;\n // TODO: Once we confirm rForm doesn't react badly to this, we can switch over\n // this.api.defaults.headers.common.Authorization = `Bearer ${token}`;\n }\n\n if (this.sessionType === 'user') {\n getCurrentProfile(this)\n .then((r) => {\n this.profile = r || null;\n this.notifySessionListeners();\n })\n .catch((e) => {\n this.profile = null;\n this.sub = null;\n\n // We can't clear the token verdocs-auth may be using temporarily during registration\n if (this.persist) {\n this.clearSession();\n }\n });\n } else {\n this.notifySessionListeners();\n }\n\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 if (this.persist) {\n localStorage.removeItem(this.sessionStorageKey());\n }\n\n delete this.api.defaults.headers.common.Authorization;\n delete this.api.defaults.headers.common.signer;\n\n this.session = null;\n this.profile = null;\n this.token = null;\n this.sub = null;\n\n this.notifySessionListeners();\n\n return this;\n }\n\n /**\n * Clear the active signing session.\n */\n public clearSignerSession() {\n if (this.persist) {\n localStorage.removeItem(this.sessionStorageKey());\n }\n\n delete this.api.defaults.headers.common.Authorization;\n\n this.session = null;\n this.profile = null;\n this.token = null;\n this.sub = 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, this.profile);\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 // Perform an immediate notification if this listener subscribed after the session was already loaded.\n if (this.profile) {\n listener(this, this.session, this.profile);\n }\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\n * when the app or component starts. Ignored if the endpoint is configured to not persist sessions.\n */\n public loadSession() {\n if (!this.persist) {\n return this;\n }\n\n const token = localStorage.getItem(this.sessionStorageKey());\n if (!token) {\n return this.clearSession();\n }\n\n // We sometimes get multiple loadSession calls from stacked components all needing to just ensure\n // we've done our best to load it. We only set it the first time to avoid dupe profile reloads\n // and upstream component notifications.\n return this.token ? this : this.setToken(token);\n }\n}\n","import {IEnvelope, IEnvelopeDocument, IEnvelopeField, IEnvelopeFieldSettings} from '../Models';\nimport {TEnvelopeUpdateResult} from '../BaseTypes';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {TCreateEnvelopeRequest} from './Types';\nimport axiosRetry from 'axios-retry';\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 * first_name: 'Paige',\n * last_name: '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 * first_name: 'Power',\n * last_name: '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 *\n * @group Envelopes\n * @api POST /v2/envelopes Create Envelope\n * @apiBody string(format:uuid) template_id If using a template, the ID of the template to copy\n * @apiBody array(items:ICreateEnvelopeRecipientDirectly) recipients A list of recipients to include in the workflow. Must specify one recipient to match each template Role.\n * @apiBody array(items:IEnvelopeDocument) documents? If not using a template, a list of documents to include in the envelope.\n * @apiBody array(items:IEnvelopeField) fields? If not using a template, a list of fields to include in the envelope.\n * @apiBody string name? Override the name of the envelope (defaults to the template name).\n * @apiBody string description? Override the description of the envelope (defaults to the template description).\n * @apiBody boolean no_contact? If set to true, no email or SMS messages will be sent to any recipients.\n * @apiBody integer(min: 0) initial_reminder? Override the template initial-reminder setting in ms.\n * @apiBody integer(min: 0) followup_reminders? Override the template initial-reminder setting in ms.\n * @apiBody string expires_at? If set, the envelope will automatically expire (be canceled) at this date and time. Expirations must be at least 1 day in the future.\n * @apiSuccess IEnvelope . The newly-created envelope.\n */\nexport const createEnvelope = async (endpoint: VerdocsEndpoint, request: TCreateEnvelopeRequest) =>\n endpoint.api //\n .post<IEnvelope>('/v2/envelopes', request)\n .then((r) => r.data);\n\n/**\n * Get all metadata for an envelope. Note that when called by non-creators (e.g. Recipients)\n * this will return only the **metadata** the caller is allowed to view.\n *\n * @group Envelopes\n * @api GET /v2/envelopes/:id Get envelope details\n * @apiParam string(format: 'uuid') id The ID of the envelope to retrieve.\n * @apiSuccess IEnvelope . The detailed metadata for the envelope requested\n */\nexport const getEnvelope = async (endpoint: VerdocsEndpoint, envelopeId: string) =>\n endpoint.api //\n .get<IEnvelope>(`/v2/envelopes/${envelopeId}`)\n .then((r) => r.data);\n\n/**\n * Get all metadata for an envelope document. Note that when called by non-creators (e.g. Recipients)\n * this will return only the **metadata** the caller is allowed to view.\n *\n * @group Envelope Documents\n * @api GET /v2/envelope-documents/:id Get envelope document\n * @apiParam string(format: 'uuid') document_id The ID of the document to retrieve.\n * @apiSuccess IEnvelopeDocument . The detailed metadata for the document requested\n */\nexport const getEnvelopeDocument = async (endpoint: VerdocsEndpoint, documentId: string) =>\n endpoint.api //\n .get<IEnvelopeDocument>(`/v2/envelope-documents/${documentId}`)\n .then((r) => r.data);\n\n/**\n * Download a document directly.\n */\nexport const downloadEnvelopeDocument = async (endpoint: VerdocsEndpoint, documentId: string) =>\n endpoint.api //\n .get(`/v2/envelope-documents/${documentId}?type=file`, {\n responseType: 'blob',\n 'axios-retry': {retries: 5, retryDelay: axiosRetry.linearDelay(3000)},\n })\n .then((r) => r.data);\n\n/**\n * Get an envelope document's metadata, or the document itself. If no \"type\" parameter is specified,\n * the document metadata is returned. If \"type\" is set to \"file\", the document binary content is\n * returned with Content-Type set to the MIME type of the file. If \"type\" is set to \"download\", a\n * string download link will be returned. If \"type\" is set to \"preview\" a string preview link will\n * be returned. This link expires quickly, so it should be accessed immediately and never shared.\n *\n * @group Envelope Documents\n * @api GET /v2/envelope-documents/:document_id Preview, Download, or Link to a Document\n * @apiParam string(format: 'uuid') document_id The ID of the document to retrieve.\n * @apiQuery string(enum:'file'|'download'|'preview') type? Download the file directly, generate a download link, or generate a preview link.\n * @apiSuccess string . The generated link.\n */\nexport const getEnvelopeDocumentDownloadLink = async (endpoint: VerdocsEndpoint, documentId: string) =>\n endpoint.api //\n .get<string>(`/v2/envelope-documents/${documentId}?type=download`, {\n 'axios-retry': {retries: 5, retryDelay: axiosRetry.linearDelay(3000)},\n })\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 getEnvelopeDocumentPreviewLink = async (endpoint: VerdocsEndpoint, documentId: string) =>\n endpoint.api //\n .get<string>(`/v2/envelope-documents/${documentId}?type=preview`, {\n 'axios-retry': {retries: 5, retryDelay: axiosRetry.linearDelay(3000)},\n })\n .then((r) => r.data);\n\n/**\n * Cancel an Envelope.\n *\n * @group Envelopes\n * @api PUT /v2/envelopes/:id Cancel envelope\n * @apiParam string(format: 'uuid') id The ID of the envelope to cancel.\n * @apiBody string(enum: 'cancel') action The action to perform (currently only \"cancel\" is supported).\n * @apiSuccess IEnvelope . The updated envelope.\n */\nexport const cancelEnvelope = async (endpoint: VerdocsEndpoint, envelopeId: string) =>\n endpoint.api //\n .put<TEnvelopeUpdateResult>(`/v2/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 *\n * @deprecated Use getDocumentPreviewLink/getDocumentDownloadLink/downloadDocument instead.\n */\nexport const getEnvelopeFile = async (endpoint: VerdocsEndpoint, documentId: string) =>\n endpoint.api //\n .get(`/v2/envelope-documents/${documentId}?type=file`, {responseType: 'blob'})\n .then((r) => r.data);\n\n/**\n * Update an envelope. Currently, only reminder settings may be changed.\n *\n * @group Envelopes\n * @api PATCH /v2/envelopes/:id Update Envelope\n * @apiParam string(format: 'uuid') id The ID of the envelope to update.\n * @apiBody string name? New name for the envelope\n * @apiBody string sender_name? New Sender Name for the envelope\n * @apiBody string sender_email? New Sender Email for the envelope\n * @apiBody integer(min: 0) initial_reminder? Change the initial-reminder setting (in ms).\n * @apiBody integer(min: 0) followup_reminders? Change the followup-reminder setting (in ms).\n * @apiBody string expires_at? If set, the envelope will automatically expire (be canceled) at this date and time. Expirations must be at least 1 day in the future.\n * @apiBody string(enum:'private'|'shared') visibility? Change the envelope's visibility setting\n * @apiBody boolean no_contact? If set to true, no email or SMS messages will be sent to any recipients.\n * @apiBody object data? Update the developer-supplied metadata attached to the envelope.\n * @apiSuccess IEnvelope . A copy of the newly-updated envelope.\n */\nexport const updateEnvelope = async (\n endpoint: VerdocsEndpoint,\n envelopeId: string,\n params: Partial<\n Pick<\n IEnvelope,\n | 'name'\n | 'sender_name'\n | 'sender_email'\n | 'initial_reminder'\n | 'followup_reminders'\n | 'expires_at'\n | 'visibility'\n | 'no_contact'\n | 'data'\n >\n >,\n) =>\n endpoint.api //\n .patch<IEnvelope>(`/v2/envelopes/${envelopeId}`, params)\n .then((r) => r.data);\n\n/**\n * Update an Envelope field. Typically called during the signing process as a Recipient fills in fields.\n *\n * @group Envelopes\n * @api PUT /v2/envelopes/:envelope_id/fields/:field_name Update Envelope Field\n * @apiParam string(format: 'uuid') envelope_id The ID of the envelope to retrieve.\n * @apiParam string role_name The role to submit. Be sure to URL-encode the value.\n * @apiParam string field_name The name of the field to update. Be sure to URL-encode the value.\n * @apiParam string value The value to set. For signature/initial fields, the UUID of the signature/initial block. For attachment fields, a file uploaded in a FORM-POST field named \"document\". For checkbox/radio buttons, a boolean. For all other fields, a string.\n * @apiBody string value Value to set.\n * @apiSuccess IEnvelopeField . A copy of the newly-updated field.\n */\nexport const updateEnvelopeField = async (\n endpoint: VerdocsEndpoint,\n envelopeId: string,\n roleName: string,\n fieldName: string,\n value: string,\n prepared: boolean,\n) =>\n endpoint.api //\n .put<IEnvelopeField>(`/v2/envelopes/${envelopeId}/recipients/${roleName}/fields/${fieldName}`, {value, prepared})\n .then((r) => r.data);\n\n/**\n * Upload an attachment to an attachment field.\n */\nexport const uploadEnvelopeFieldAttachment = async (\n endpoint: VerdocsEndpoint,\n envelopeId: string,\n roleName: 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 formData.append('value', '');\n\n return endpoint.api //\n .put<IEnvelopeFieldSettings>(`/v2/envelopes/${envelopeId}/recipients/${roleName}/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. Note that this is not a DELETE endpoint because the field itself is not\n * being deleted. Instead, it is a similar operation to uploading a new attachment, but the\n * omission of the attachment signals the server to delete the current entry.\n */\nexport const deleteEnvelopeFieldAttachment = async (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, fieldName: string) => {\n const formData = new FormData();\n // Omitting file is the trigger here\n\n return endpoint.api //\n .put<IEnvelopeFieldSettings>(`/v2/envelopes/${envelopeId}/recipients/${roleName}/fields/${fieldName}`, formData)\n .then((r) => r.data);\n};\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 *\n * @group Envelopes\n * @api GET /v2/envelope-documnets/page-image/:document_id/:variant/:page Get envelope document page display URI\n * @apiParam string(format: 'uuid') document_id The ID of the document to retrieve.\n * @apiParam string(enum: 'original'|'filled') variant The variant of the document to retrieve.\n * @apiParam integer page The page number to retrieve\n * @apiSuccess string . The page display URI. Note that this is a signed URL with a short expiration. It should be used immediately and never databased or cached.\n */\nexport const getEnvelopeDocumentPageDisplayUri = async (\n endpoint: VerdocsEndpoint,\n documentId: string,\n page: number,\n variant: 'original' | 'filled' | 'certificate' = 'original',\n) => endpoint.api.get<string>(`/v2/envelope-documents/page-image/${documentId}/${variant}/${page}`, {timeout: 20000}).then((r) => r.data);\n\nexport interface ITimeRange {\n start: string;\n end: string;\n}\n\nexport interface IListEnvelopesParams {\n q?: string;\n view?: 'inbox' | 'sent' | 'action' | 'waiting' | 'completed';\n status?: ('complete' | 'pending' | 'in progress' | 'declined' | 'canceled')[];\n include_org?: boolean;\n template_id?: string;\n created_before?: string;\n created_after?: string;\n sort_by?: 'name' | 'created_at' | 'updated_at' | 'canceled_at' | 'status';\n ascending?: boolean;\n rows?: number;\n page?: number;\n}\n\n/**\n * Lists all envelopes accessible by the caller, with optional filters.\n *\n * ```typescript\n * import {getEnvelopes} from '@verdocs/js-sdk/Envelopes';\n *\n * const {count, envelopes} = await getEnvelopes((VerdocsEndpoint.getDefault(), { q: 'test' });\n * ```\n *\n * @group Envelopes\n * @api GET /v2/envelopes List envelopes\n * @apiQuery string q? Match envelopes whose name contains this string\n * @apiQuery string(enum: 'inbox' | 'sent' | 'action' | 'waiting' | 'completed') view? Request pre-defined view. `inbox` returns envelopes where action is required by the caller. `sent` returns envelopes created by the caller. `action` returns envelopes where action is required by the caller. `waiting` returns envelopes where action is required by anyone. `completed` returns envelopes where all actions are complete.\n * @apiQuery array(items: 'complete' | 'pending' | 'in progress' | 'declined' | 'canceled') status? Match envelopes in one of the specified states.\n * @apiQuery boolean(default: false) include_org? If true, include organizations-shared envelopes\n * @apiQuery string(format: uuid) template_id? Match envelopes created from the specified template ID\n * @apiQuery string(format: date-time) created_before? Match envelopes created before this date\n * @apiQuery string(format: date-time) created_after? Match envelopes created after this date\n * @apiQuery string(enum: 'name' | 'created_at' | 'updated_at' | 'canceled_at' | 'status') sort_by? Return results sorted by this criteria\n * @apiQuery boolean ascending? Set true/false to override the sort direction. Note that the default depends on `sort_by`. Date-based sorts default to descending, while name and status default to ascending.\n * @apiQuery integer(default: 20) rows? Limit the number of rows returned\n * @apiQuery integer(default: 0) page? Specify which page of results to return\n * @apiSuccess integer(format: int32) count The total number of records matching the query, helpful for pagination\n * @apiSuccess integer(format: int32) rows The number of rows returned in this response page\n * @apiSuccess integer(format: int32) page The page number of this response\n * @apiSuccess array(items: IEnvelope) envelopes List of envelopes found\n */\nexport const getEnvelopes = (endpoint: VerdocsEndpoint, params?: IListEnvelopesParams) =>\n endpoint.api //\n .get<{count: number; rows: number; page: number; envelopes: IEnvelope[]}>('/v2/envelopes', {params})\n .then((r) => r.data);\n\n/**\n * Generate a ZIP file containing all data for the specified envelopes. The caller must be the\n * owner of each envelope. The returned ZIP file contains a folder for each envelope.\n */\nexport const getEnvelopesZip = (endpoint: VerdocsEndpoint, envelope_ids: string[]) =>\n endpoint.api //\n .get(`/v2/envelopes/zip/${envelope_ids.join(',')}`, {responseType: 'blob', timeout: 120000});\n\n/**\n * Utility function to sort fields by page, then by Y coordinate, then by X coordinate.\n * NOTE: This function mutates the input array.\n */\nexport function sortFields(\n fields: {\n page?: number | null | undefined;\n x?: number | null | undefined;\n y?: number | null | undefined;\n height?: number | null | undefined;\n }[],\n) {\n fields.sort((a, b) => {\n const aPage = a.page || 0;\n const bPage = b.page || 0;\n const aX = a.x || 0;\n const aY = (a.y || 0) + (a.height || 0);\n const bX = b.x || 0;\n const bY = (b.y || 0) + (b.height || 0);\n\n if (aPage !== bPage) {\n return aPage - bPage;\n }\n\n const divaY = Math.floor(aY / 5);\n const divbY = Math.floor(bY / 5);\n if (divaY !== divbY) {\n // Unlike the other properties, Y coordinates have 0,0 at the BOTTOM LEFT corner, so\n // we need to sort descending (b first) on this one.\n return divbY - divaY;\n }\n\n return aX - bX;\n });\n\n return fields;\n}\n\n/**\n * Utility function to sort documents by their order, falling back to created_at.\n * NOTE: This function mutates the input array.\n */\nexport function sortDocuments(documents: {order: number; created_at: Date | string}[]) {\n // The Date conversion is unnecessary 90% of the time but is safer, and this isn't something\n // we do much of so in reality it has almmost no impact.\n return documents.sort((a, b) => a.order - b.order || new Date(a.created_at).getTime() - new Date(b.created_at).getTime());\n}\n\n/**\n * Utility function to sort documents by their order, falling back to created_at.\n * NOTE: This function mutates the input array.\n */\nexport function sortRecipients(recipients?: {sequence: number; order: number}[]) {\n return recipients?.sort((a, b) => a.sequence - b.sequence || a.order - b.order);\n}\n","import {TPermission, TTemplatePermission} from '../Sessions';\nimport {TTemplateAction} from '../BaseTypes';\nimport {IProfile, ITemplate} from '../Models';\n\nexport const canPerformTemplateAction = (\n profile: IProfile | null | undefined,\n action: TTemplateAction,\n template?: ITemplate,\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 = profile?.id || 'BOGUS';\n const organization_id = profile?.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(profile, 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 = (profile: IProfile | null | undefined, permissions: TPermission[]) =>\n permissions.every((perm) => (profile?.permissions || []).includes(perm));\n","import {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {ITemplateField} from '../Models';\n\n/**\n * Add a field to a template.\n *\n * ```typescript\n * import {createField} from '@verdocs/js-sdk/Templates';\n *\n * await createField((VerdocsEndpoint.getDefault(), template_id, { ... });\n * ```\n *\n * @group Fields\n * @api POST /v2/fields/:template_id Add a field to a template\n * @apiBody string name Name for the new field. Field names must be unique within a template. Although special characters are allowed, they must be URL-encoded in subsequent requests, so it is recommended to use only alphanumeric characters and hyphens if possible.\n * @apiBody string role_name Role to assign to the field. Role names must be valid, so it is recommended to create roles before fields.\n * @apiBody string document_id ID of the document upon which to place the field.\n * @apiBody string(enum: 'signature' | 'initial' | 'checkbox' | 'radio' | 'textbox' | 'timestamp' | 'date' | 'dropdown' | 'textarea' | 'attachment' | 'payment') type Type of field to create\n * @apiBody boolean(default: false) required Whether the field is required\n * @apiBody integer(min: 0) page 0-based page number upon which to place the field\n * @apiBody integer(min: 0) x X position for the field (left to right)\n * @apiBody integer(min: 0) y Y position for the field (_bottom to top!_)\n * @apiBody string label? Optional label to display above the field\n * @apiBody integer(min: 50) width? Width of the field. Note that all fields have built-in defaults, and it is recommended that this only be set on text fields.\n * @apiBody integer(min: 15) height? Height of the field. Note that all fields have built-in defaults, and it is recommended that this only be set on text fields.\n * @apiBody string placeholder? Optional placeholder to display in text fields\n * @apiBody string group? For fields that support grouping (radio buttons and check boxes) the value selected will be stored under this name\n * @apiBody array(items:IDropdownOption) options? For dropdown fields, the options to display\n * @apiBody string value? Optional default value to set on the field\n * @apiSuccess ITemplateField . Template field\n */\nexport const createField = (endpoint: VerdocsEndpoint, templateId: string, params: ITemplateField) =>\n endpoint.api //\n .post<ITemplateField>(`/v2/fields/${templateId}`, params)\n .then((r) => r.data);\n\n/**\n * Update a template field.\n *\n * ```typescript\n * import {updateField} from '@verdocs/js-sdk/Templates';\n *\n * await updateField((VerdocsEndpoint.getDefault(), template_id, field_name, { ... });\n * ```\n *\n * @group Fields\n * @api PATCH /v2/fields/:template_id/:field_name Update a field. See createField for additional details on the supported parameters.\n * @apiBody string name? Rename the field. Note that template field names must be unique within a template.\n * @apiBody string role_name Role to assign to the field.\n * @apiBody string document_id ID of the document upon which to place the field.\n * @apiBody string(enum: 'signature' | 'initial' | 'checkbox' | 'radio' | 'textbox' | 'timestamp' | 'date' | 'dropdown' | 'textarea' | 'attachment' | 'payment') type? Change the field type. Note that while this is technically allowed, fields have different behaviors, validators, default sizes, etc. It is usually easier to add a new field and delete the old one.\n * @apiBody boolean(default: false) required? Whether the field is required\n * @apiBody integer(min: 0) page? 0-based page number upon which to place the field\n * @apiBody integer(min: 0) x? X position for the field (left to right)\n * @apiBody integer(min: 0) y? Y position for the field (_bottom to top!_)\n * @apiBody string label? Optional label to display above the field\n * @apiBody integer(min: 50) width? Width of the field. Note that all fields have built-in defaults, and it is recommended that this only be set on text fields.\n * @apiBody integer(min: 15) height? Height of the field. Note that all fields have built-in defaults, and it is recommended that this only be set on text fields.\n * @apiBody string placeholder? Optional placeholder to display in text fields\n * @apiBody string group? For fields that support grouping (radio buttons and check boxes) the value selected will be stored under this name\n * @apiBody array(items:IDropdownOption) options? For dropdown fields, the options to display\n * @apiBody string value? Optional default value to set on the field\n * @apiSuccess ITemplateField . Updated template field\n */\nexport const updateField = (endpoint: VerdocsEndpoint, templateId: string, name: string, params: Partial<ITemplateField>) =>\n endpoint.api //\n .patch<ITemplateField>(`/v2/fields/${templateId}/${encodeURIComponent(name)}`, params)\n .then((r) => r.data);\n\n/**\n * Remove a field from a template.\n *\n * ```typescript\n * import {deleteField} from '@verdocs/js-sdk/Templates';\n *\n * await deleteField((VerdocsEndpoint.getDefault(), template_id, field_name);\n * ```\n *\n * @group Fields\n * @api DELETE /v2/fields/:template_id/:field_name Delete a field\n * @apiSuccess string . Success\n */\nexport const deleteField = (endpoint: VerdocsEndpoint, templateId: string, name: string) =>\n endpoint.api //\n .delete(`/v2/fields/${templateId}/${encodeURIComponent(name)}`)\n .then((r) => r.data);\n","import {IProfile} from '../Models';\n\n/**\n * Create public templates. Public templates are still owned and managed by the creator,\n * but may be searched for and used to create envelopes by other users.\n */\nexport type TTemplatePermissionCreatePublic = 'template:creator:create:public';\n\n/**\n * Create templates shared with other users of the same organization.\n */\nexport type TTemplatePermissionCreateOrg = 'template:creator:create:org';\n\n/**\n * Create templates private to the creator.\n */\nexport type TTemplatePermissionCreatePersonal = 'template:creator:create:personal';\n\n/**\n * Create templates private to the creator.\n */\nexport type TTemplatePermissionDelete = 'template:creator:delete';\n\n/**\n * Alter the visiiblity settings on a template.\n */\nexport type TTemplatePermissionVisibility = 'template:creator:visibility';\n\n/**\n * View templates shared by other members of the same organization. Those templates must also\n * have `is_personal` set to false to be visible.\n */\nexport type TTemplateMemberRead = 'template:member:read';\n\n/**\n * Edit templates shared by other members of the same organization. Those templates must also\n * have `is_personal` set to false to be editable.\n */\nexport type TTemplateMemberWrite = 'template:member:write';\n\n/**\n * Edit templates shared by other members of the same organization. Those templates must also\n * have `is_personal` set to false to be editable.\n */\nexport type TTemplateMemberDelete = 'template:member:delete';\n\n/**\n * Edit templates shared by other members of the same organization. Those templates must also\n * have `is_personal` set to false to be editable.\n */\nexport type TTemplateMemberVisibility = 'template:member:visibility';\n\nexport type TTemplatePermission =\n | TTemplatePermissionCreatePublic\n | TTemplatePermissionCreateOrg\n | TTemplatePermissionCreatePersonal\n | TTemplatePermissionDelete\n | TTemplatePermissionVisibility\n | TTemplateMemberRead\n | TTemplateMemberWrite\n | TTemplateMemberDelete\n | TTemplateMemberVisibility;\n\n/**\n * Grant the \"owner\" role to other organization members.\n */\nexport type TAccountPermissionOwnerAdd = 'owner:add';\n\n/**\n * Remove the \"owner\" role from other organization members.\n */\nexport type TAccountPermissionOwnerRemove = 'owner:remove';\n\n/**\n * Grant the \"admin\" role to other organization members.\n */\nexport type TAccountPermissionAdminAdd = 'admin:add';\n\n/**\n * Remove the \"admin\" role from other organization members.\n */\nexport type TAccountPermissionAdminRemove = 'admin:remove';\n\n/**\n * View the members of an organization.\n */\nexport type TAccountPermissionMemberView = 'member:view';\n\n/**\n * Grant the \"member\" role to other organization members.\n */\nexport type TAccountPermissionMemberAdd = 'member:add';\n\n/**\n * Remove the \"member\" role from other organization members.\n */\nexport type TAccountPermissionMemberRemove = 'member:remove';\n\nexport type TAccountPermission =\n | TAccountPermissionOwnerAdd\n | TAccountPermissionOwnerRemove\n | TAccountPermissionAdminAdd\n | TAccountPermissionAdminRemove\n | TAccountPermissionMemberAdd\n | TAccountPermissionMemberRemove\n | TAccountPermissionMemberView;\n\n/**\n * Create a new organization.\n * @deprecated This is a system-wide setting and organization owners cannot prevent their\n * members from listing other organizations that they may have separate profiles in.\n */\nexport type TOrgPermissionCreate = 'org:create';\n\n/**\n * View the organization.\n */\nexport type TOrgPermissionView = 'org:view';\n\n/**\n * Update the organization.\n */\nexport type TOrgPermissionUpdate = 'org:update';\n\n/**\n * Delete the organization.\n */\nexport type TOrgPermissionDelete = 'org:delete';\n\n/**\n * Transfer ownership of the organization. This primarily allows the holder to remove his/her own\n * Owner role or add new Owners even if the holder is not one themselves. This is primarily intended\n * to be used for reseller scenarios.\n */\nexport type TOrgPermissionTransfer = 'org:transfer';\n\n/**\n * List organizations.\n * @deprecated This is a system-wide setting and organization owners cannot prevent their\n * members from listing other organizations that they may have separate profiles in.\n */\nexport type TOrgPermissionList = 'org:list';\n\nexport type TOrgPermission =\n | TOrgPermissionCreate\n | TOrgPermissionView\n | TOrgPermissionUpdate\n | TOrgPermissionDelete\n | TOrgPermissionTransfer\n | TOrgPermissionList;\n\n/**\n * Create envelopes.\n */\nexport type TEnvelopePermissionCreate = 'envelope:create';\n\n/**\n * Cancel envelopes. This is a default permission for most users, but it may be removed for\n * highly regulated environments where envelope activities must be audited, and should not\n * be canceled.\n */\nexport type TEnvelopePermissionCancel = 'envelope:cancel';\n\n/**\n * View envelopes. This is a default permission for most users, but it may be removed for\n * highly regulated environments where once sent, envelopes may only be viewed by specific\n * users.\n */\nexport type TEnvelopePermissionView = 'envelope:view';\n\n/**\n * View envelopes created by other members of the same organization. By default, only templates\n * having sharing settings controlled by their creators. Envelopes are usually private to the\n * callers who created them. In some organizations it may be useful to have users who can see\n * \"all activity\" by all organization members. This is particularly useful when applied to API\n * keys to develop applications that can access all data across the organization.\n */\nexport type TEnvelopePermissionOrg = 'envelope:org:view';\n\nexport type TEnvelopePermission = TEnvelopePermissionCreate | TEnvelopePermissionCancel | TEnvelopePermissionView | TEnvelopePermissionOrg;\n\n/**\n * Operation within Verdocs that users may perform.\n */\nexport type TPermission = TTemplatePermission | TOrgPermission | TAccountPermission | TEnvelopePermission;\n\n/**\n * Roles provide access to groups of permissions. Note that for historical reasons there is some overlap in the\n * use of the term \"role\". TRole refers to a user type. A \"Role\" (IRole) is a Template participant placeholder.\n */\nexport type TRole = 'contact' | 'basic_user' | 'member' | 'admin' | 'owner';\n\n/**\n * A map of the permissions each role confers.\n */\nexport const RolePermissions: Record<TRole, TPermission[]> = {\n owner: [\n 'template:creator:create:public',\n 'template:creator:create:org',\n 'template:creator:create:personal',\n 'template:creator:delete',\n 'template:creator:visibility',\n 'template:member:read',\n 'template:member:write',\n 'template:member:delete',\n 'template:member:visibility',\n 'owner:add',\n 'owner:remove',\n 'admin:add',\n 'admin:remove',\n 'member:view',\n 'member:add',\n 'member:remove',\n 'org:create',\n 'org:view',\n 'org:update',\n 'org:delete',\n 'org:transfer',\n 'org:list',\n 'envelope:create',\n 'envelope:cancel',\n 'envelope:view',\n ],\n admin: [\n 'template:creator:create:public',\n 'template:creator:create:org',\n 'template:creator:create:personal',\n 'template:creator:delete',\n 'template:creator:visibility',\n 'template:member:read',\n 'template:member:write',\n 'template:member:delete',\n 'template:member:visibility',\n 'admin:add',\n 'admin:remove',\n 'member:view',\n 'member:add',\n 'member:remove',\n 'org:create',\n 'org:view',\n 'org:update',\n 'org:list',\n 'envelope:create',\n 'envelope:cancel',\n 'envelope:view',\n ],\n member: [\n 'template:creator:create:public',\n 'template:creator:create:org',\n 'template:creator:create:personal',\n 'template:creator:delete',\n 'template:creator:visibility',\n 'template:member:read',\n 'template:member:write',\n 'template:member:delete',\n 'member:view',\n 'org:create',\n 'org:view',\n 'org:list',\n 'envelope:create',\n 'envelope:cancel',\n 'envelope:view',\n ],\n basic_user: ['template:member:read', 'member:view', 'org:view', 'org:list'],\n contact: ['org:view', 'org:list', 'org:create'],\n};\n\n/**\n * Confirm whether the user has all of the specified permissions.\n */\nexport const userHasPermissions = (profile: IProfile | null | undefined, permissions: TPermission[]) => {\n // No need to de-dupe here, we're just checking present-at-least-once set membership.\n const netPermissions = [...(profile?.permissions || [])];\n (profile?.roles || []).forEach((role) => {\n netPermissions.push(...(RolePermissions[role] || []));\n });\n\n (profile?.group_profiles || []).forEach((groupProfile) => {\n netPermissions.push(...(groupProfile.group?.permissions || []));\n });\n\n return permissions.every((perm) => netPermissions.includes(perm));\n};\n","/**\n * Various helpers to identify available operations for a template by a user.\n *\n * @module\n */\n\nimport {userHasPermissions} from '../Sessions';\nimport {IProfile, ITemplate} from '../Models';\n\n/**\n * Check to see if the user created the template.\n */\nexport const userIsTemplateCreator = (profile: IProfile | null | undefined, template: ITemplate) =>\n profile && template && profile.id === template.profile_id;\n\n/**\n * Check to see if a template is \"shared\" with the user.\n */\nexport const userHasSharedTemplate = (profile: IProfile | null | undefined, template: ITemplate) =>\n profile && template && !template.is_personal && profile.organization_id === template.organization_id;\n\n/**\n * Check to see if the user can create a personal/private template.\n */\nexport const userCanCreatePersonalTemplate = (profile: IProfile | null | undefined) =>\n userHasPermissions(profile, ['template:creator:create:personal']);\n\n/**\n * Check to see if the user can create an org-shared template.\n */\nexport const userCanCreateOrgTemplate = (profile: IProfile | null | undefined) =>\n userHasPermissions(profile, ['template:creator:create:org']);\n\n/**\n * Check to see if the user can create a public template.\n */\nexport const userCanCreatePublicTemplate = (profile: IProfile | null | undefined) =>\n userHasPermissions(profile, ['template:creator:create:public']);\n\n/**\n * Check to see if the user can read/view a template.\n */\nexport const userCanReadTemplate = (profile: IProfile | null | undefined, template: ITemplate) =>\n template.is_public ||\n userIsTemplateCreator(profile, template) ||\n (userHasSharedTemplate(profile, template) && userHasPermissions(profile, ['template:member:read']));\n\n/**\n * Check to see if the user can update a tempate.\n */\nexport const userCanUpdateTemplate = (profile: IProfile | null | undefined, template: ITemplate) =>\n userIsTemplateCreator(profile, template) ||\n (userHasSharedTemplate(profile, template) && userHasPermissions(profile, ['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 = (profile: IProfile | null | undefined, template: ITemplate) =>\n userIsTemplateCreator(profile, template)\n ? userHasPermissions(profile, ['template:creator:create:personal'])\n : userHasPermissions(profile, ['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 = (profile: IProfile | null | undefined, template: ITemplate) =>\n userIsTemplateCreator(profile, template)\n ? userHasPermissions(profile, ['template:creator:create:org'])\n : userHasPermissions(profile, ['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 = (profile: IProfile | null | undefined, template: ITemplate) =>\n userIsTemplateCreator(profile, template)\n ? userHasPermissions(profile, ['template:creator:create:public'])\n : userHasPermissions(profile, ['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 = (profile: IProfile | null | undefined, template: ITemplate) =>\n userIsTemplateCreator(profile, template) && userHasPermissions(profile, ['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 = (profile: IProfile | null | undefined, template: ITemplate) =>\n userIsTemplateCreator(profile, template)\n ? userHasPermissions(profile, ['template:creator:delete'])\n : userHasPermissions(profile, ['template:member:delete']);\n\n/**\n * Confirm whether the user can create an envelope using the specified template.\n */\nexport const userCanSendTemplate = (profile: IProfile | null | undefined, template: ITemplate) => {\n switch (template.visibility) {\n case 'private':\n return userIsTemplateCreator(profile, template);\n\n case 'shared':\n return userIsTemplateCreator(profile, template) || template.organization_id === profile?.organization_id;\n\n case 'public':\n return true;\n }\n};\n\n/**\n * Confirm whether the user can create a new template.\n */\nexport const userCanCreateTemplate = (profile: IProfile | null | undefined) =>\n userCanCreatePersonalTemplate(profile) || userCanCreateOrgTemplate(profile) || userCanCreatePublicTemplate(profile);\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 = (profile: IProfile | null | undefined, template: ITemplate) =>\n userCanUpdateTemplate(profile, 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 = (profile: IProfile | null | undefined, template: ITemplate) => {\n const hasPermission = userCanReadTemplate(profile, 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","/**\n * A \"role\" is an individual participant in a signing flow, such as a signer or CC contact.\n * A role is a placeholder that will eventually become a named recipient. For example, \"Tenant 1\"\n * might be replaced with \"John Smith\" when the document is sent out for signature.\n *\n * Role names must be unique within a template, e.g. 'Recipient 1'. They may contain any [a-zA-Z0-9_- ]\n * characters, although it is recommended to keep them simple and human-readable, and to avoid\n * spaces (although they are allowed). If spaces are used in role names, be sure to URL-encode them\n * when calling endpoints like `updateRole()` e.g. 'Recipient%201'.\n *\n * NOTE: Roles are always enumerated under Template objects, so there are no \"list\" or \"get\" endpoints\n * for them. To get a template's latest role list, simply call `getTemplate()`.\n *\n * @module\n */\n\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {IRole} from '../Models';\n\n/**\n * Create a role.\n *\n * ```typescript\n * import {createTemplateRole} from '@verdocs/js-sdk';\n *\n * const role = await createTemplateRole(VerdocsEndpoint.getDefault(), template_id, params...);\n * ```\n *\n * @group Roles\n * @api POST /v2/roles/:template_id Add a role to a template\n * @apiBody string name Name for the new role. Must be unique within the template. May include spaces, but later calls must URL-encode any references to this role, so it is recomended that special characters be avoided.\n * @apiBody string(enum:'signer' | 'cc' | 'approver') type Type of role to create. Signers act on documents by filling and signing fields. CC recipients receive a copy but do not act on the document. Approvers control the final submission of a document, but do not have fields of their own to fill out.\n * @apiBody string full_name? Default full name for the role. May be completed/overridden later, when envelopes are made from the template.\n * @apiBody string email? Default email address for the role. May be completed/overridden later, when envelopes are made from the template.\n * @apiBody string phone? Default (SMS-capable) phone number for the role. May be completed/overridden later, when envelopes are made from the template.\n * @apiBody string message? Optional message to include in email and SMS signing invitations.\n * @apiBody integer(min: 1, default: 1) sequence? Optional 1-based sequence number for the role. Roles that share the same sequence number act in parallel, and will receive invitations at the same time.\n * @apiBody integer(min: 1, default: 1) order? Optional 1-based order number for the role. Controls the left-to-right display order of roles at the same sequence number in the UI components e.g. `<verdocs-template-roles />`.\n * @apiBody boolean delegator? If true, the role may delegate their signing responsibility to another party.\n * @apiSuccess IRole . The newly-created role\n */\nexport const createTemplateRole = (endpoint: VerdocsEndpoint, template_id: string, params: IRole) =>\n endpoint.api //\n .post<IRole>(`/v2/roles/${template_id}`, params)\n .then((r) => r.data);\n\n/**\n * Update a role.\n *\n * ```typescript\n * import {updateTemplateRole} from '@verdocs/js-sdk';\n *\n * const role = await updateTemplateRole(VerdocsEndpoint.getDefault(), template_id, name, params...);\n * ```\n *\n * @group Roles\n * @api PATCH /v2/roles/:template_id/:role_id Update a role. See createRole for additional details on the parameters available.\n * @apiBody string name? Rename the role. Note that role names must be unique within a template, so this may fail if the new name is already in use.\n * @apiBody string(enum:'signer' | 'cc' | 'approver') type? Type of role.\n * @apiBody string full_name? Default full name for the role.\n * @apiBody string email? Default email address for the role.\n * @apiBody string phone? Default (SMS-capable) phone number for the role.\n * @apiBody string message? Optional message to include in email and SMS signing invitations.\n * @apiBody integer(min: 1, default: 1) sequence? Optional 1-based sequence number for the role.\n * @apiBody integer(min: 1, default: 1) order? Optional 1-based order number for the role.\n * @apiBody boolean delegator? If true, the role may delegate their signing responsibility to another party.\n * @apiBody string(enum:'pin'|'identity'|'') kba_method? Active PIN- or Identity-based KBA for the role.\n * @apiSuccess IRole . The newly-created role\n */\nexport const updateTemplateRole = (endpoint: VerdocsEndpoint, template_id: string, name: string, params: Partial<IRole>) =>\n endpoint.api //\n .patch<IRole>(`/v2/roles/${template_id}/${encodeURIComponent(name)}`, params)\n .then((r) => r.data);\n\n/**\n * Delete a role.\n *\n * ```typescript\n * import {deleteTemplateRole} from '@verdocs/js-sdk';\n *\n * const profiles = await deleteTemplateRole(VerdocsEndpoint.getDefault(), template_id, name);\n * ```\n *\n * @group Roles\n * @api DELETE /v2/roles/:template_id/:role_id Delete a role.\n * @apiSuccess string . Success\n */\nexport const deleteTemplateRole = (endpoint: VerdocsEndpoint, template_id: string, name: string) =>\n endpoint.api //\n .delete(`/v2/roles/${template_id}/${encodeURIComponent(name)}`)\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 type {TSortTemplateBy, TTemplateSender, TTemplateVisibility} from '../BaseTypes';\nimport type {IRole, ITemplate, ITemplateField} from '../Models';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\n\nexport type ITemplateSortBy = 'created_at' | 'updated_at' | 'name' | 'last_used_at' | 'counter' | 'star_counter';\n\nexport type TTemplateVisibilityFilter = 'private_shared' | 'private' | 'shared' | 'public';\n\nexport interface IGetTemplatesParams {\n /** List only those templates whose names, descriptions, etc contain this search term. */\n q?: string;\n /** List only those templates with at least one \"star\". */\n is_starred?: boolean;\n /** List only those templates created by the caller. */\n is_creator?: boolean;\n /** Visibility status of templates to include. private_shared is the default (private + shared) */\n visibility?: TTemplateVisibilityFilter;\n /** Sort order */\n sort_by?: TSortTemplateBy;\n /** Set to true or false to control the sort order. Omit this field to sort dates descending, names ascending. */\n ascending?: boolean;\n /** Number of rows to retrieve. Defaults to 10. */\n rows?: number;\n /** Page to retrieve (0-based). Defaults to 0. */\n page?: number;\n}\n\n/**\n * Get all templates accessible by the caller, with optional filters.\n *\n * ```typescript\n * import {getTemplates} from '@verdocs/js-sdk/Templates';\n *\n * await getTemplates((VerdocsEndpoint.getDefault());\n * await getTemplates((VerdocsEndpoint.getDefault(), { is_starred: true });\n * await getTemplates((VerdocsEndpoint.getDefault(), { is_creator: true });\n * await getTemplates((VerdocsEndpoint.getDefault(), { is_organization: true });\n * ```\n *\n * @group Templates\n * @api GET /v2/templates Get Templates\n * @apiQuery string q? Find templates whose names/descriptions contain the specified query string\n * @apiQuery boolean is_starred? If true, returns only templates with at least one \"star\".\n * @apiQuery boolean is_creator? If true, returns only templates that the caller created.\n * @apiQuery string(enum: 'private_shared' | 'private' | 'shared' | 'public') visibility? Return only templates with the specified visibility.\n * @apiQuery string(enum: 'created_at' | 'updated_at' | 'name' | 'last_used_at' | 'counter' | 'star_counter') sort_by? Return results sorted by this criteria\n * @apiQuery boolean ascending? Set true/false to override the sort direction. Note that the default depends on `sort_by`. Date-based sorts default to descending, while name defaults to ascending.\n * @apiQuery integer(default: 20) rows? Limit the number of rows returned\n * @apiQuery integer(default: 0) page? Specify which page of results to return\n * @apiSuccess integer(format: int32) count The total number of records matching the query, helpful for pagination\n * @apiSuccess integer(format: int32) rows The number of rows returned in this response page\n * @apiSuccess integer(format: int32) page The page number of this response\n * @apiSuccess array(items: ITemplate) templates List of templates found\n */\nexport const getTemplates = (endpoint: VerdocsEndpoint, params?: IGetTemplatesParams) =>\n endpoint.api //\n .get<{count: number; rows: number; page: number; templates: ITemplate[]}>('/v2/templates', {params})\n .then((r) => r.data);\n\n/**\n * Get one template by its ID.\n *\n * ```typescript\n * import {getTemplate} from '@verdocs/js-sdk/Templates';\n *\n * const template = await getTemplate((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9');\n * ```\n *\n * @group Templates\n * @api GET /v2/templates/:template_id Get a template. Note that the caller must have at least View access to the template.\n * @apiSuccess ITemplate . The requested template\n */\nexport const getTemplate = (endpoint: VerdocsEndpoint, templateId: string) => {\n return endpoint.api //\n .get<ITemplate>(`/v2/templates/${templateId}`)\n .then((r) => {\n const template = r.data;\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 // Temporary upgrade from legacy app\n template.fields?.forEach((field) => {\n if ((field as any).setting) {\n field.settings = (field as any).setting;\n }\n });\n\n return template;\n });\n};\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 * If set, the visibility level for the template.\n */\n visibility?: TTemplateVisibility;\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 * @deprecated. See visibility.\n */\n is_personal?: boolean;\n /**\n * Optional (defaults to false). Public templates may be found (via search) and viewed by anyone.\n * @deprecated. See visibility.\n */\n is_public?: boolean;\n /** Optional (defaults to EVERYONE_AS_CREATOR). Who may create and send envelopes using this template. */\n sender?: TTemplateSender;\n /** Delay (in seconds) before the first reminder is sent (min: 4hrs). Set to 0 or null to disable. */\n initial_reminder?: number;\n /** Delay (in seconds) before subsequent remidners are sent (min: 12hrs). Set to 0 or null to disable. */\n followup_reminders?: number;\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 {createTemplate} from '@verdocs/js-sdk/Templates';\n *\n * const newTemplate = await createTemplate((VerdocsEndpoint.getDefault(), {...});\n * ```\n *\n * @group Templates\n * @api POST /v2/templates Create a template\n * @apiBody string name Template name\n * @apiBody string description? Optional description\n * @apiBody TTemplateVisibility visibility? Visibility setting\n * @apiBody boolean is_personal? Deprecated. If true, the template is personal and can only be seen by the caller. (Use \"visibility\" for new calls.)\n * @apiBody boolean is_public? Deprecated. If true, the template is public and can be seen by anybody. (Use \"visibility\" for new calls.)\n * @apiBody TTemplateSender sender? Who may send envelopes using this template\n * @apiBody number initial_reminder? Delay (in seconds) before the first reminder is sent (min: 4hrs). Set to 0 or null to disable.\n * @apiBody number followup_reminders? Delay (in seconds) before the subsequent reminders are sent (min: 12hrs). Set to 0 or null to disable.\n * @apiBody array(items:object) documents? Optional list of documents to attach to the template\n * @apiBody array(items:IRole) roles? Optional list of roles to create. Note that if roles are not included in the request, fields will be ignored.\n * @apiBody array(fields:ITemplateField) fields? Optional list of fields to create. Note that if fields that do not match a role will be ignored.\n * @apiSuccess ITemplate . The newly-created template\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 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\n/**\n * Duplicate a template. Creates a complete clone, including all settings (e.g. reminders), fields,\n * roles, and documents.\n *\n * ```typescript\n * import {duplicateTemplate} from '@verdocs/js-sdk/Templates';\n *\n * const newTemplate = await duplicateTemplate((VerdocsEndpoint.getDefault(), originalTemplateId, 'My Template Copy');\n * ```\n *\n * @group Templates\n * @api PUT /v2/templates/:template_id Perform an operation on a template\n * @apiBody string(enum:'duplicate') action Action to perform\n * @apiBody string name? If duplicating the template, a name for the new copy\n * @apiSuccess ITemplate . The newly-copied template\n */\nexport const duplicateTemplate = (endpoint: VerdocsEndpoint, templateId: string, name: string) =>\n endpoint.api //\n .put<ITemplate>(`/v2/templates/${templateId}`, {action: 'duplicate', name})\n .then((r) => r.data);\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 {createTemplateFromSharepoint} from '@verdocs/js-sdk/Templates';\n *\n * const newTemplate = await createTemplateFromSharepoint((VerdocsEndpoint.getDefault(), {...});\n * ```\n *\n * @group Templates\n * @api POST /v2/templates/from-sharepoint Create a template from an asset in Sharepoint\n * @apiBody string name Name for the new template\n * @apiBody string siteId Name for the new template\n * @apiBody string itemId Name for the new template\n * @apiBody string oboToken On-Behalf-Of token for calls to Sharepoint. Should be generated as a short-expiration token with at least Read privileges to the siteId/itemId. This token will be discarded after being used.\n * @apiSuccess ITemplate . The newly-created template\n */\nexport const createTemplateFromSharepoint = (endpoint: VerdocsEndpoint, params: ITemplateCreateFromSharepointParams) => {\n const options = {\n timeout: 120000,\n };\n\n return endpoint.api.post<ITemplate>('/v2/templates/from-sharepoint', params, options).then((r) => r.data);\n};\n\n/**\n * Update a template.\n *\n * ```typescript\n * import {updateTemplate} from '@verdocs/js-sdk/Templates';\n *\n * const updatedTemplate = await updateTemplate((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9', { name: 'New Name' });\n * ```\n *\n * @group Templates\n * @api PATCH /v2/templates/:template_id Update a template\n * @apiBody string name? Template name\n * @apiBody string description? Optional description\n * @apiBody TTemplateVisibility visibility? Visibility setting\n * @apiBody boolean is_personal? Deprecated. If true, the template is personal and can only be seen by the caller. (Use \"visibility\" for new calls.)\n * @apiBody boolean is_public? Deprecated. If true, the template is public and can be seen by anybody. (Use \"visibility\" for new calls.)\n * @apiBody TTemplateSender sender? Who may send envelopes using this template\n * @apiBody number initial_reminder? Delay in ms before the first reminder is sent (min: 4hrs). Set to 0 or null to disable.\n * @apiBody number followup_reminders? Delay in ms before the subsequent reminders are sent (min: 12hrs). Set to 0 or null to disable.\n * @apiSuccess ITemplate . The updated template\n */\nexport const updateTemplate = (endpoint: VerdocsEndpoint, templateId: string, params: Partial<ITemplateCreateParams>) =>\n endpoint.api //\n .patch<ITemplate>(`/v2/templates/${templateId}`, params)\n .then((r) => r.data);\n\n/**\n * Delete a template.\n *\n * ```typescript\n * import {deleteTemplate} from '@verdocs/js-sdk/Templates';\n *\n * await deleteTemplate((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9');\n * ```\n *\n * @group Templates\n * @api DELETE /v2/templates/:template_id Delete a template\n * @apiSuccess string . Success\n */\nexport const deleteTemplate = (endpoint: VerdocsEndpoint, templateId: string) =>\n endpoint.api //\n .delete<string>(`/v2/templates/${templateId}`)\n .then((r) => r.data);\n\n/**\n * Toggle the template star for a template.\n *\n * ```typescript\n * import {toggleTemplateStar} from '@verdocs/js-sdk/Templates';\n *\n * await toggleTemplateStar((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9');\n * ```\n *\n * @group Templates\n * @api POST /v2/templates/:template_id/star Star or unstar a template (toggle state)\n * @apiSuccess ITemplate . Success\n */\nexport const toggleTemplateStar = (endpoint: VerdocsEndpoint, templateId: string) =>\n endpoint.api //\n .post<ITemplate>(`/v2/templates/${templateId}/stars/toggle`)\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 {ITemplate, ITemplateDocument} from '../Models';\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 *\n * @group Template Documents\n * @api POST /v2/templates/:template_id/documents Attach a document to a template\n * @apiBody string(format:binary) file Document file to attach. The file name will automatically be used as the document name.\n * @apiBody string(format:uuid) template_id Template ID to attach the document to\n * @apiSuccess ITemplateDocument . Template document\n */\nexport const createTemplateDocument = (\n endpoint: VerdocsEndpoint,\n template_id: string,\n file: File,\n onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void,\n) => {\n const formData = new FormData();\n formData.append('file', file, file.name);\n formData.append('template_id', template_id);\n\n return endpoint.api //\n .post<ITemplateDocument>(`/v2/template-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 {deleteTemplateDocument} from '@verdocs/js-sdk/Templates';\n *\n * await deleteTemplateDocument(VerdocsEndpoint.getDefault(), documentID);\n * ```\n *\n * @group Template Documents\n * @api DELETE /v2/template-documents/:document_id Delete a template document\n * @apiSuccess string . Success\n */\nexport const deleteTemplateDocument = (endpoint: VerdocsEndpoint, documentId: string) =>\n endpoint.api //\n .delete<ITemplate>(`/v2/template-documents/${documentId}`)\n .then((r) => r.data);\n\n/**\n * Get all metadata for a template document. Note that when called by non-creators (e.g. Org Collaborators)\n * this will return only the **metadata** the caller is allowed to view.\n *\n * @group Template Documents\n * @api GET /v2/envelope-documents/:id Get envelope document\n * @apiParam string(format: 'uuid') document_id The ID of the document to retrieve.\n * @apiSuccess IEnvelopeDocument . The detailed metadata for the document requested\n */\nexport const getTemplateDocument = async (endpoint: VerdocsEndpoint, documentId: string) =>\n endpoint.api //\n .get<ITemplateDocument>(`/v2/template-documents/${documentId}`)\n .then((r) => r.data);\n\n/**\n * Download a document directly.\n */\nexport const downloadTemplateDocument = async (endpoint: VerdocsEndpoint, documentId: string) =>\n endpoint.api //\n .get(`/v2/template-documents/${documentId}?type=file`, {responseType: 'blob'})\n .then((r) => r.data);\n\n/**\n * Get an envelope document's metadata, or the document itself. If no \"type\" parameter is specified,\n * the document metadata is returned. If \"type\" is set to \"file\", the document binary content is\n * returned with Content-Type set to the MIME type of the file. If \"type\" is set to \"download\", a\n * string download link will be returned. If \"type\" is set to \"preview\" a string preview link will\n * be returned. This link expires quickly, so it should be accessed immediately and never shared.\n *\n * @group Template Documents\n * @api GET /v2/envelope-documents/:document_id Preview, Download, or Link to a Document\n * @apiParam string(format: 'uuid') document_id The ID of the document to retrieve.\n * @apiQuery string(enum:'file'|'download'|'preview') type? Download the file directly, generate a download link, or generate a preview link.\n * @apiSuccess string . The generated link.\n */\nexport const getTemplateDocumentDownloadLink = async (endpoint: VerdocsEndpoint, _envelopeId: string, documentId: string) =>\n endpoint.api //\n .get<string>(`/v2/template-documents/${documentId}?type=download`)\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 getTemplateDocumentPreviewLink = async (endpoint: VerdocsEndpoint, _envelopeId: string, documentId: string) =>\n endpoint.api //\n .get<string>(`/v2/envelope-documents/${documentId}?type=preview`)\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(`/v2/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(`/v2/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 (\n endpoint: VerdocsEndpoint,\n documentId: string,\n page: number,\n variant: 'original' | 'tagged' = 'original',\n) => endpoint.api.get<string>(`/v2/template-documents/page-image/${documentId}/${variant}/${page}`, {timeout: 20000}).then((r) => r.data);\n","import {IRole} from '../Models';\n\nexport interface IValidator {\n name: string;\n regex: string;\n}\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\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\nconst URL_REGEX = /https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)/;\n\nconst POSTAL_CODE_REGEX = /^[A-Za-z0-9-\\s]{3,10}$/;\n\nconst NUMBER_REGEX = /^\\d+$/;\n\nconst DATE_REGEX = /^(\\d{4}[-\\/]\\d{2}[-\\/]\\d{2})|(\\d{2}[-\\/]\\d{2}[-\\/]\\d{4})$/;\n\nconst VALIDATORS = {\n email: {regex: EMAIL_REGEX, label: 'Email Address'},\n phone: {regex: PHONE_REGEX, label: 'Phone Number'},\n url: {regex: URL_REGEX, label: 'URL'},\n postal_code: {regex: POSTAL_CODE_REGEX, label: 'Zip/Postal Code'},\n number: {regex: NUMBER_REGEX, label: 'Number'},\n date: {regex: DATE_REGEX, label: 'Date'},\n};\n\nexport const isValidInput = (value: string, validator: string) =>\n Object.keys(VALIDATORS).includes(validator) && VALIDATORS[validator as keyof typeof VALIDATORS].regex.test(value);\n\n/**\n * Get a list of available validators for field inputs. Note that validators always check strings,\n * because that is all a user can enter in an HTML input field. Numeric-format validators should\n * perform any necessary conversions internally. Validators never throw - they just return a boolean.\n * indicating whether the value is valid.\n */\nexport const getValidators = () => Object.keys(VALIDATORS);\n\nexport const isValidEmail = (email: string | undefined) => !!email && EMAIL_REGEX.test(email);\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 {isValidInput} from '../Templates';\nimport {IEnvelopeField} from '../Models';\n\nexport const isFieldFilled = (field: IEnvelopeField, allRecipientFields: IEnvelopeField[]) => {\n const {value = ''} = field;\n switch (field.type as any) {\n case 'textarea':\n case 'textbox':\n switch (field.validator || '') {\n case 'email':\n return value && isValidInput(value, 'email');\n case 'phone':\n return value && isValidInput(value, 'phone');\n default:\n return (value || '').trim() !== '';\n }\n\n case 'signature':\n return value === 'signed';\n\n case 'initial':\n return value === 'initialed';\n\n // Timestamp fields get automatically filled when the envelope is submitted.\n case 'timestamp':\n return true;\n\n case 'date':\n return !!value;\n\n case 'attachment':\n return value === 'attached';\n\n case 'dropdown':\n return value !== '';\n\n case 'checkbox':\n return value === 'true';\n\n case 'radio':\n if (!!field.group) {\n return allRecipientFields.filter((f) => f.group === field.group).some((field) => field.value === 'true');\n }\n\n return field.value === 'true';\n\n default:\n return false;\n }\n};\n\n// TODO: Only allow !required to bypass validation if the field is empty.\nexport const isFieldValid = (field: IEnvelopeField, allRecipientFields: IEnvelopeField[]) => {\n return !field.required || isFieldFilled(field, allRecipientFields);\n};\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\n * \"adopt\" an initials block to be used for all initials fields in the document. Thus, this is typically called\n * one time to create and store an initials block. Thereafter, the ID of the initials block may be re-used for each\n * initials field to be \"stamped\" by the user.\n *\n * Note: Both \"guest\" signers and authenticated users can create initials blocks. Guest signers\n * typically only ever have one, tied to that session. But authenticated users can create more than\n * one, and can use them interchangeably.\n *\n * @group Signatures and Initials\n * @api POST /v2/profiles/initials Create Initial Block\n * @apiBody string initial Blob containing initials image to store.\n * @apiSuccess IInitial . The newly-created initial block.\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>(`/v2/profiles/initials`, data)\n .then((r) => r.data);\n};\n","import {VerdocsEndpoint} from '../VerdocsEndpoint';\n\n/**\n * KBA is not required at this time.\n */\nexport interface IRecipientKbaStepNone {\n envelope_id: string;\n role_name: string;\n kba_step: 'none';\n}\n\n/**\n * KBA has been completed and no further action is required.\n */\nexport interface IRecipientKbaStepComplete {\n envelope_id: string;\n role_name: string;\n kba_step: 'complete';\n}\n\n/**\n * A PIN code is required. Prompt the user to enter this PIN, and submit it via `submitKbaPin()`.\n */\nexport interface IRecipientKbaStepPin {\n envelope_id: string;\n role_name: string;\n kba_step: 'pin';\n}\n\n/**\n * A full identity verification is required. Prompt the user for their address and other (optional)\n * details and submit them via `submitKbaIdentity()`.\n */\nexport interface IRecipientKbaStepIdentity {\n envelope_id: string;\n role_name: string;\n kba_step: 'identity';\n}\n\n/**\n * If a positive identification was not possible, the user may be asked to answer 1 or more\n * challenge questions via this response. They should be submitted via `submitKbaChallengeResponse()`.\n */\nexport interface IRecipientKbaStepChallenge {\n envelope_id: string;\n role_name: string;\n kba_step: 'challenge';\n questions: {\n type: string;\n message: string;\n options: (string | number)[];\n }[];\n}\n\n/**\n * Identity verification has failed. The user should be shown the message included. No further\n * signing operations may be performed.\n */\nexport interface IRecipientKbaStepFailed {\n envelope_id: string;\n role_name: string;\n kba_step: 'failed';\n message: string;\n}\n\nexport type TRecipientKbaStep =\n | IRecipientKbaStepNone\n | IRecipientKbaStepComplete\n | IRecipientKbaStepPin\n | IRecipientKbaStepIdentity\n | IRecipientKbaStepChallenge\n | IRecipientKbaStepFailed;\n\n/**\n * Get the current KBA status. Note that this may only be called by the recipient and requires a\n * valid signing session to proceed. Although the Recipient object itself contains indications of\n * whether KBA is required, it will not contain the current status of the process. If\n * `recipient.auth_methods` is set (not empty), and `recipient.kba_completed` is false, this endpoint\n * should be called to determine the next KBA step required.\n */\nexport const getKbaStep = (endpoint: VerdocsEndpoint, envelope_id: string, role_name: string) =>\n endpoint.api //\n .get<TRecipientKbaStep>(`/v2/kba/${envelope_id}/${encodeURIComponent(role_name)}`)\n .then((r) => r.data);\n\n/**\n * Submit a response to a KBA PIN challenge.\n */\nexport const submitKbaPin = (endpoint: VerdocsEndpoint, envelope_id: string, role_name: string, pin: string) =>\n endpoint.api //\n .post<TRecipientKbaStep>(`/v2/kba/pin`, {envelope_id, role_name, pin})\n .then((r) => r.data);\n\nexport interface IKbaIdentity {\n firstName: string;\n lastName: string;\n address: string;\n city?: string;\n state?: string;\n zip?: string;\n ssnLast4?: string;\n email?: string;\n}\n\n/**\n * Submit an identity response to a KBA challenge.\n */\nexport const submitKbaIdentity = (endpoint: VerdocsEndpoint, envelope_id: string, role_name: string, identity: IKbaIdentity) =>\n endpoint.api //\n .post<TRecipientKbaStep>(`/v2/kba/identity`, {envelope_id, role_name, identity})\n .then((r) => r.data);\n\nexport interface IKbaChallengeResponse {\n type: string;\n answer: string | number;\n}\n\n/**\n * Submit an identity response to a KBA challenge. Answers should be submitted in the same order as\n * the challenges were listed in `IRecipientKbaStepChallenge.questions`.\n */\nexport const submitKbaChallengeResponse = (\n endpoint: VerdocsEndpoint,\n envelope_id: string,\n role_name: string,\n responses: IKbaChallengeResponse[],\n) =>\n endpoint.api //\n .post<TRecipientKbaStep>(`/v2/kba/response`, {envelope_id, role_name, responses})\n .then((r) => r.data);\n","import type {IInPersonLinkResponse, ISignerTokenResponse, TAuthenticateRecipientRequest, IUpdateRecipientParams} from './Types';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport type {IRecipient} from '../Models';\n\n/**\n * Agree to electronic signing dislosures.\n *\n * @group Recipients\n * @api POST /envelopes/:envelope_id/recipients/:role_name/agree Agree to e-Signing Disclosures\n * @apiParam string(format:uuid) envelope_id The envelope to operate on.\n * @apiParam string role_name The role to operate on.\n * @apiSuccess IRecipient . The updated Recipient.\n */\nexport const envelopeRecipientAgree = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, disclosures?: string) =>\n endpoint.api //\n .post<IRecipient>(`/v2/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}/agree`, {disclosures})\n .then((r) => r.data);\n\n/**\n * Decline electronic signing dislosures. Note that if any recipient declines, the entire envelope\n * becomes non-viable and later recipients may no longer act. The creator will receive a notification\n * when this occurs.\n *\n * @group Recipients\n * @api POST /envelopes/:envelope_id/recipients/:role_name/decline Decline e-Signing Disclosures\n * @apiParam string(format:uuid) envelope_id The envelope to operate on.\n * @apiParam string role_name The role to adjust.\n * @apiSuccess IRecipient . The updated Recipient.\n */\nexport const envelopeRecipientDecline = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string) =>\n endpoint.api //\n .post<IRecipient>(`/v2/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}/decline`)\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 *\n * @group Recipients\n * @api POST /envelopes/:envelope_id/recipients/:role_name/submit Submit envelope\n * @apiParam string(format:uuid) envelope_id The envelope to operate on.\n * @apiParam string role_name The role to submit.\n * @apiSuccess IRecipient . The updated Recipient.\n */\nexport const envelopeRecipientSubmit = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string) =>\n endpoint.api //\n .post<IRecipient>(`/v2/envelopes/${envelopeId}/recipients/${roleName}/submit`)\n .then((r) => r.data);\n\n/**\n * Begin a signing session for an Envelope. This path requires an invite code, and should generally\n * be called with a NON-default Endpoint to avoid conflicting with any active user session the user\n * may have. To initiate in-person signing by an authenticated user (e.g. self-signing), call\n * getInPersonLink() instead. The response from that call includes both a link for direct signing\n * via a Web browser as well as an in-person access_key. That access_key.key may be used here as well.\n *\n * @group Recipients\n * @api POST /v2/sign/unauth/:envelope_id/:role_name/:key Start Signing Session\n * @apiParam string(format:uuid) envelope_id The envelope to operate on.\n * @apiParam string role_name The role to request.\n * @apiParam string key Access key generated by the envelope creator or email/SMS invite.\n * @apiSuccess ISignerTokenResponse . Signing session token and envelope/recipient metadata.\n */\nexport const startSigningSession = async (endpoint: VerdocsEndpoint, envelope_id: string, role_name: string, key: string) => {\n return endpoint.api //\n .post<ISignerTokenResponse>(`/v2/sign/unauth/${envelope_id}/${encodeURIComponent(role_name)}/${key}`)\n .then((r) => {\n endpoint.setToken(r.data.access_token, 'signing');\n return r.data;\n });\n};\n\n/**\n * Get an in-person signing link. Must be called by the owner/creator of the envelope. The response\n * also includes the raw access key that may be used to directly initiate a signing session (see\n * `startSigningSession`) as well as an access token representing a valid signing session for\n * immediate use in embeds or other applications. Note that in-person signing is considered a\n * lower-security operation than authenticated signing, and the final envelope certificate will\n * reflect this.\n *\n * @group Recipients\n * @api POST /v2/sign/in-person/:envelope_id/:role_name Get In-Person Signing Link\n * @apiParam string(format:uuid) envelope_id The envelope to operate on.\n * @apiParam string role_name The role to request.\n * @apiSuccess IInPersonLinkResponse . Signing session token and envelope/recipient metadata.\n */\nexport const getInPersonLink = (endpoint: VerdocsEndpoint, envelope_id: string, role_name: string) =>\n endpoint.api //\n .post<IInPersonLinkResponse>(`/v2/sign/in-person/${envelope_id}/${encodeURIComponent(role_name)}`)\n .then((r) => r.data);\n\n/**\n * Verify a recipient within a signing session. All signing sessions use an invite code at a minimum,\n * but many scenarios require more robust verification of recipients, so one or more verification\n * methods may be attached to each recipient. If an authentication method is enabled, the\n * signer must first accept the e-signature disclosures, then complete each verification step\n * before attempting to view/display documents, complete any fields, or submit the envelope.\n * This endpoint should be called to complete each step. If the call fails an error will be\n * thrown.\n *\n * @group Recipients\n * @api POST /v2/sign/verify Verify recipient/signer\n * @apiParam string(enum:'passcode'|'email'|'sms'|'kba'|'id') auth_method The authentication method being completed\n * @apiParam string code? The passcode or OTP entered. Required for passcode, email, and SMS methods.\n * @apiParam boolean resend? For SMS or email methods, set to send a new code.\n * @apiParam boolean first_name? For KBA, the recipient's first name\n * @apiParam boolean last_name? For KBA, the recipient's last name\n * @apiParam boolean address? For KBA, the recipient's address\n * @apiParam boolean city? For KBA, the recipient's city\n * @apiParam boolean state? For KBA, the recipient's state\n * @apiParam boolean zip? For KBA, the recipient's zip code\n * @apiParam boolean ssn_last_4? For KBA, the last 4 digits of the recipient's SSN\n * @apiParam boolean dob? For KBA, the recipient's date of birth\n * @apiParam array(items:IKBAResponse) responses? For KBA, responses to any challenge questions presented\n * @apiSuccess ISignerTokenResponse . Updated signing session.\n */\nexport const verifySigner = (endpoint: VerdocsEndpoint, params: TAuthenticateRecipientRequest) =>\n endpoint.api //\n .post<ISignerTokenResponse>(`/v2/sign/verify`, params)\n .then((r) => r.data);\n\n/**\n * Delegate a recipient's signing responsibility. The envelope sender must enable this before the\n * recipient calls this endpoint, and only the recipient may call it, or the call will be rejected.\n * The recipient's role will be renamed and configured to indicate to whom the delegation was made,\n * and a new recipient entry with the updated details (e.g. name and email address) will be added\n * to the flow with the same role_name, order, and sequence of the original recipient. Unless\n * no_contact is set on the envelope, the delegation recipient and envelope creator will also be\n * notified.\n *\n * @group Recipients\n * @api PUT /v2/envelopes/:envelope_id/recipients/:role_name Delegate Recipient\n * @apiParam string(format:uuid) envelope_id The envelope to operate on.\n * @apiParam string role_name The role to operate on.\n * @apiBody string(enum:'delegate') action The operation to perform (delegate).\n * @apiBody string first_name The first name of the new recipient.\n * @apiBody string last_name The last name of the new recipient.\n * @apiBody string email The email address of the new recipient.\n * @apiBody string phone? Optional phone number for the new recipient.\n * @apiBody string message? Optional phone number for the new recipient's invitation.\n * @apiSuccess string . Success message.\n */\nexport const delegateRecipient = (\n endpoint: VerdocsEndpoint,\n envelopeId: string,\n roleName: string,\n params: {\n first_name: string;\n last_name: string;\n email: string;\n phone?: string;\n message?: string;\n },\n) =>\n endpoint.api //\n .post<{status: 'OK'}>(`/v2/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}/delegate`, params)\n .then((r) => r.data);\n\n/**\n * Update a recipient. NOTE: User interfaces should rate-limit this operation to avoid spamming recipients.\n * Excessive use of this endpoint may result in Verdocs rate-limiting the calling application to prevent\n * abuse. This endpoint will return a 200 OK even if the no_contact flag is set on the envelope (in which\n * case the call will be silently ignored).\n *\n * @group Recipients\n * @api PATCH /envelopes/:envelope_id/recipients/:role_name Update Recipient\n * @apiParam string(format:uuid) envelope_id The envelope to operate on.\n * @apiParam string role_name The role name to update.\n * @apiBody string(enum:'remind'|'reset') action? Trigger a reminder, or fully reset the recipient\n * @apiBody string first_name? Update the recipient's first name.\n * @apiBody string last_name? Update the recipient's last name.\n * @apiBody string email? Update the recipient's email address.\n * @apiBody string message? Update the recipient's invite message.\n * @apiBody string phone? Update the recipient's phone number.\n * @apiBody string passcode? If passcode authentication is used, the recipient's address to prefill. May only be changed if the recipient has not already completed passcode-based auth.\n * @apiBody string address? If KBA-based authentication is used, the recipient's address to prefill. May only be changed if the recipient has not already completed KBA-based auth.\n * @apiBody string city? If KBA-based authentication is used, the recipient's city to prefill. May only be changed if the recipient has not already completed KBA-based auth.\n * @apiBody string state? If KBA-based authentication is used, the recipient's state to prefill. May only be changed if the recipient has not already completed KBA-based auth.\n * @apiBody string zip? If KBA-based authentication is used, the recipient's zip code to prefill. May only be changed if the recipient has not already completed KBA-based auth.\n * @apiBody string dob? If KBA-based authentication is used, the recipient's date of birth to prefill. May only be changed if the recipient has not already completed KBA-based auth.\n * @apiBody string ssn_last_4? If KBA-based authentication is used, the recipient's SSN-last-4 to prefill. May only be changed if the recipient has not already completed KBA-based auth.\n * @apiSuccess IRecipient . The updated Recipient.\n */\nexport const updateRecipient = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, params: IUpdateRecipientParams) =>\n endpoint.api //\n .patch<IRecipient>(`/v2/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}`, params)\n .then((r) => r.data);\n\n/**\n * Send a reminder to a recipient. The recipient must still be an active member of the signing flow\n * (e.g. not declined, already submitted, etc.)\n */\nexport const remindRecipient = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string) =>\n endpoint.api //\n .patch<{status: 'OK'}>(`/v2/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}`, {action: 'remind'})\n .then((r) => r.data);\n\n/**\n * Fully reset a recipient. This allows the recipient to restart failed KBA flows, change\n * fields they may have filled in incorrectly while signing, etc. This cannot be used on a\n * canceled or completed envelope, but may be used to restart an envelope marked declined.\n */\nexport const resetRecipient = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string) =>\n endpoint.api //\n .patch<{status: 'OK'}>(`/v2/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}`, {action: 'reset'})\n .then((r) => r.data);\n\n/**\n * Ask the sender a question. This will email the envelope's sender (via sender_email, if set when\n * the envelope was created) with the recipient's information and their question. It is up to the\n * sender to determine how to reply.\n *\n * @group Recipients\n * @api POST /envelopes/:envelope_id/recipients/:role_name/ask-question Ask Sender a Question\n * @apiParam string(format:uuid) envelope_id The envelope to operate on.\n * @apiParam string role_name The role name to update.\n * @apiBody string question The question to ask.\n * @apiSuccess string . Success message.\n */\nexport const askQuestion = (endpoint: VerdocsEndpoint, envelopeId: string, roleName: string, params: {question: string}) =>\n endpoint.api //\n .post<IRecipient>(`/v2/envelopes/${envelopeId}/recipients/${encodeURIComponent(roleName)}/ask-question`, params)\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, IProfile, IRecipient} from '../Models';\n\n/**\n * Check to see if the profile ID owns the envelope.\n */\nexport const isEnvelopeOwner = (profile_id: string | null | undefined, envelope: IEnvelope) => envelope.profile_id === profile_id;\n\n/**\n * Check to see if the profile ID is a recipient within the envelope.\n */\nexport const isEnvelopeRecipient = (profile_id: string | null | undefined, envelope: IEnvelope) =>\n (envelope.recipients || []).some((recipient) => recipient.profile_id === profile_id);\n\n/**\n * Check to see if the profile ID is the envelope's sender or one of the recipients.\n */\nexport const canAccessEnvelope = (profile_id: string | null | undefined, envelope: IEnvelope) =>\n isEnvelopeOwner(profile_id, envelope) || isEnvelopeRecipient(profile_id, envelope);\n\n/**\n * Check to see if the user owns the envelope.\n */\nexport const userIsEnvelopeOwner = (profile: IProfile | null | undefined, envelope: IEnvelope) => envelope.profile_id === profile?.id;\n\n/**\n * Check to see if the user is a recipient within the envelope.\n */\nexport const userIsEnvelopeRecipient = (profile: IProfile | null | undefined, envelope: IEnvelope) =>\n (envelope.recipients || []).some((recipient) => recipient.profile_id === profile?.id);\n\n/**\n * Check to see if the profile ID is the envelope's sender or one of the recipients.\n */\nexport const useCanAccessEnvelope = (profile: IProfile | null | undefined, envelope: IEnvelope) =>\n userIsEnvelopeOwner(profile, envelope) || userIsEnvelopeRecipient(profile, envelope);\n\n/**\n * Check to see if the envelope has pending actions.\n */\nexport const envelopeIsActive = (envelope: IEnvelope) =>\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) => envelope.status !== 'complete';\n\n/**\n * Check to see if the user owns the envelope.\n */\nexport const userCanCancelEnvelope = (profile: IProfile | null | undefined, envelope: IEnvelope) =>\n userIsEnvelopeOwner(profile, 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 = (profile: IProfile | null | undefined, envelope: IEnvelope) =>\n userIsEnvelopeOwner(profile, 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) =>\n ['complete', 'declined', 'canceled'].includes(envelope.status) ? [] : (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 = (profile: IProfile | null | undefined, envelope: IEnvelope) => {\n if (!profile) {\n return false;\n }\n\n const recipientsWithActions = getRecipientsWithActions(envelope);\n const myRecipient = recipientsWithActions.find((r) => r.profile_id === profile?.id || r.email === profile?.email);\n return (\n myRecipient &&\n envelopeIsActive(envelope) &&\n userIsEnvelopeRecipient(profile, envelope) &&\n recipientCanAct(myRecipient, recipientsWithActions)\n );\n};\n\nexport const getNextRecipient = (envelope: IEnvelope) => {\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\n * \"adopt\" a signature block to be used for all signature fields in the document. Thus, this is typically called one\n * time to create and store a signature block. Thereafter, the ID of the signature block may be re-used for each\n * signature field to be \"stamped\" by the user.\n *\n * Note: Both \"guest\" signers and authenticated users can create initials blocks. Guest signers\n * typically only ever have one, tied to that session. But authenticated users can create more than\n * one, and can use them interchangeably.\n *\n * @group Signatures and Initials\n * @api POST /v2/profiles/signatures Create Signature Block\n * @apiBody string signature Blob containing signature image to store.\n * @apiSuccess ISignature . The newly-created signature block.\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>(`/v2/profiles/signatures`, data)\n .then((r) => r.data);\n};\n","import type {TEnvelopeStatus, TFieldType, TRecipientAuthMethod, TRecipientStatus, TRecipientType} from '../BaseTypes';\nimport type {IDropdownOption, IEnvelope, IInitial, IRecipient, ISignature, TAccessKey} from '../Models';\n\nexport interface IEnvelopesSearchResult {\n page: number;\n total: number;\n result: IEnvelope[];\n}\n\nexport interface IDocumentSearchOptions {\n rows?: number;\n page?: number;\n sort_by?: 'updated_at' | 'created_at';\n ascending?: boolean;\n is_owner?: boolean;\n is_recipient?: boolean;\n envelope_status?: TEnvelopeStatus[];\n recipient_status?: TRecipientStatus[];\n}\n\nexport interface ICreateEnvelopeRecipientFromTemplate {\n /**\n * Unique identifier for the recipient. When using a template, must match one of the pre-defined roles in the template's Recipients list.\n */\n role_name: string;\n\n /** The name of the recipient as it will be displayed in reports and queries, e.g. 'Paige Turner'. */\n first_name: string;\n last_name: string;\n\n /** The email address of the recipient. One of `email` or `phone` must be provided. */\n email?: string;\n\n /**\n * The phone number of the recipient. One of `email` or `phone` must be provided. If `phone` is included, the\n * recipient will receive an SMS notification for the document.\n */\n phone?: string;\n\n /** Whether the recipient may delegate their tasks to others. Should be false for most standard workflows. */\n delegator?: boolean;\n\n /** A custom message to include in the email or SMS invitation. May be left blank for a default message. */\n message?: string;\n\n /** To enable authentication for the recipient, set to 'pin' or 'identity'. */\n auth_methods?: TRecipientAuthMethod[];\n\n /** If Passcode-based authentication is used, the passcode to challenge the user to enter. */\n passcode?: string;\n\n /**\n * If SMS-based authentication is used, the phone number to which one-time codes should be sent.\n * NOTE: This may be different from the phone number used for notifications, but leaving it blank\n * will trigger an error rather than defaulting to the notifications phone number to avoid mistaken\n * assumptions (e.g. if SMS notifications are not enabled for the organization, but SMS authentication\n * is).\n */\n phone_auth?: string;\n\n /** Pre-fill KBA address for the recipient, if known. */\n address?: string;\n /** Pre-fill KBA city for the recipient, if known. */\n city?: string;\n /** Pre-fill KBA state for the recipient, if known. */\n state?: string;\n /** Pre-fill KBA zip for the recipient, if known. */\n zip?: string;\n /** Pre-fill KBA date-of-birth for the recipient, if known. */\n dob?: string;\n /** Pre-fill KBA SSN-Last-4 for the recipient, if known. */\n ssn_last_4?: string;\n}\n\nexport interface ICreateEnvelopeRecipientDirectly {\n /** The type of role to create. Most participants in standard flows will be \"signer\" recipients. */\n type: TRecipientType;\n\n /**\n * Unique identifier for the recipient. When using a template, must match one of the pre-defined roles in the template's Recipients list.\n */\n role_name: string;\n\n /** The name of the recipient as it will be displayed in reports and queries, e.g. 'Paige Turner'. */\n first_name: string;\n last_name: string;\n\n /** The email address of the recipient. One of `email` or `phone` must be provided. */\n email?: string;\n\n /**\n * The phone number of the recipient. One of `email` or `phone` must be provided. If `phone` is included, the\n * recipient will receive an SMS notification for the document.\n */\n phone?: string;\n\n /**\n * The 1-based sequence number for the recipient. This can be used to override the template's workflow. Recipients\n * are processed in parallel for each matching sequence number (e.g. all recipients at level \"1\" may act in parallel)\n * and in series between sequence numbers (e.g. all recipients at level \"1\" must complete their tasks before\n * recipients at level \"2\" may act).\n */\n sequence?: number;\n\n /**\n * The 1-based order within the sequence for the recipient. Recipients at the same sequence act in parallel, so\n * this is only for display purposes.\n */\n order?: number;\n\n /** Whether the recipient may delegate their tasks to others. Should be false for most standard workflows. */\n delegator?: boolean;\n\n /** A custom message to include in the email or SMS invitation. May be left blank for a default message. */\n message?: string;\n\n /** To enable authentication for the recipient, set to 'pin' or 'identity'. */\n auth_methods?: TRecipientAuthMethod[];\n\n /** If Passcode-based authentication is used, the passcode to challenge the user to enter. */\n passcode?: string;\n\n /**\n * If SMS-based authentication is used, the phone number to which one-time codes should be sent.\n * NOTE: This may be different from the phone number used for notifications, but leaving it blank\n * will trigger an error rather than defaulting to the notifications phone number to avoid mistaken\n * assumptions (e.g. if SMS notifications are not enabled for the organization, but SMS authentication\n * is).\n */\n phone_auth?: string;\n\n /** Pre-fill KBA address for the recipient, if known. */\n address?: string;\n /** Pre-fill KBA city for the recipient, if known. */\n city?: string;\n /** Pre-fill KBA state for the recipient, if known. */\n state?: string;\n /** Pre-fill KBA zip for the recipient, if known. */\n zip?: string;\n /** Pre-fill KBA date-of-birth for the recipient, if known. */\n dob?: string;\n /** Pre-fill KBA SSN-Last-4 for the recipient, if known. */\n ssn_last_4?: string;\n}\n\nexport interface ISignerTokenResponse {\n /**\n * An access token that may be used with a VerdocsEndpoint to perform signing operations.\n * When signing, the caller's \"authentication\" status will be recorded as \"in-person\".\n */\n access_token: string;\n /**\n * A copy of the envelope related to the signing session. This is almost always needed when\n * a signing session is being started, so it is included here for convenience.\n */\n envelope: IEnvelope;\n /**\n * A copy of the recipient record related to the signing session. This is almost always needed when\n * a signing session is being started, so it is included here for convenience.\n */\n recipient: IRecipient;\n /**\n * Stored signature blocks for the recipient. All entries are returned to support workflows in\n * which that is required, but for most use-cases, only the first entry should be used.\n */\n signatures?: ISignature[];\n /**\n * Stored initials blocks for the recipient. All entries are returned to support workflows in\n * which that is required, but for most use-cases, only the first entry should be used.\n */\n initials?: IInitial[];\n}\n\nexport interface IInPersonLinkResponse {\n /** A valid Verdocs Web URL that hosts a signing experience. */\n link: string;\n /**\n * An access token that may be used with a VerdocsEndpoint to perform signing operations.\n * When signing, the caller's \"authentication\" status will be recorded as \"in-person\".\n */\n access_token: string;\n /**\n * The access key that matches the signing session. May be used for later initiation requests\n * if in-person signing was desired, but not necessarily instant (e.g. to hand-off to a\n * companion application. **NOTE: Access keys are as sensitive as Bearer Tokens and must be\n * protected from theft and unauthorized sharing!**\n */\n access_key: TAccessKey;\n /**\n * A copy of the envelope related to the signing session. This is almost always needed when\n * a signing session is being started, so it is included here for convenience.\n */\n envelope: IEnvelope;\n /**\n * A copy of the recipient record related to the signing session. This is almost always needed when\n * a signing session is being started, so it is included here for convenience.\n */\n recipient: IRecipient;\n}\n\nexport interface IUpdateRecipientStatus {\n first_name?: string;\n last_name?: string;\n agreed?: boolean;\n action?: 'prepare' | 'update';\n}\n\nexport interface ICreateEnvelopeReminderRequest {\n setup_time: number;\n interval_time: number;\n}\n\nexport interface IUpdateRecipientParams {\n /** Trigger a reminder invite, or fully reset the recipient's status. */\n action?: 'remind' | 'reset';\n /** The name of the recipient as it will be displayed in reports and queries, e.g. 'Paige Turner'. */\n first_name?: string;\n last_name?: string;\n /** The email address of the recipient. If changed, a new invite will be sent. */\n email?: string;\n /** The phone number of the recipient. If changed, a new invite will be sent. */\n phone?: string;\n /** A custom message to include in the email or SMS invitation. May be left blank for a default message. */\n message?: string;\n /** If Passcode-based authentication is used, the passcode to challenge the user to enter. May only be changed if the recipient has not already completed passcode-based auth. */\n passcode?: string;\n /** If KBA-based authentication is used, the recipient's address to prefill. May only be changed if the recipient has not already completed KBA-based auth. */\n address?: string;\n /** If KBA-based authentication is used, the recipient's city to prefill. May only be changed if the recipient has not already completed KBA-based auth. */\n city?: string;\n /** If KBA-based authentication is used, the recipient's state to prefill. May only be changed if the recipient has not already completed KBA-based auth. */\n state?: string;\n /** If KBA-based authentication is used, the recipient's zip code to prefill. May only be changed if the recipient has not already completed KBA-based auth. */\n zip?: string;\n /** If KBA-based authentication is used, the recipient's date of birth to prefill. May only be changed if the recipient has not already completed KBA-based auth. */\n dob?: string;\n /** If KBA-based authentication is used, the recipient's SSN-Last-4 to prefill. May only be changed if the recipient has not already completed KBA-based auth. */\n ssn_last_4?: string;\n}\n\nexport interface ICreateEnvelopeDocumentFromData {\n /** The order in which the document should be displayed. */\n order?: number;\n /** Override the detected MIME type for the document. */\n mime?: string;\n /** The name of the document. Will be used to generate the final filename. */\n name?: string;\n /** Base-64 encoded content of the document. */\n data: string;\n}\n\nexport interface ICreateEnvelopeDocumentFromUri {\n /** The order in which the document should be displayed. */\n order?: number;\n /** Override the detected MIME type for the document. */\n mime?: string;\n /** The name of the document. Will be used to generate the final filename. */\n name?: string;\n /** URI from which Verdocs should download a copy of the document. Pre-signed URLs with short (<60s) expirations are strongly recommended. */\n uri: string;\n}\n\nexport interface ICreateEnvelopeDocumentFromFile {\n /** The order in which the document should be displayed. */\n order?: number;\n /** Override the detected MIME type for the document. */\n mime?: string;\n /** The name of the document. Will be used to generate the final filename. */\n name?: string;\n /** Directly attach a file via form-url-encoded POST attachment. */\n file?: any;\n}\n\nexport interface ICreateEnvelopeFieldFromTemplate {\n /** The machine name of the field, e.g. `Buyer-textbox-1` */\n name: string;\n /** The ID of the role in the recipients list, e.g. `Recipient 2` */\n role_name: string;\n /** Override the \"required\" setting from the template. */\n required?: boolean;\n /** Override the \"readonly\" setting from the template. */\n readonly?: boolean;\n /** Override the \"label\" setting from the template. */\n label?: string;\n /** Override the \"default\" setting from the template. If a default is provided, the field will be marked as \"prepared\". */\n default?: string;\n /** Override the \"placeholder\" setting from the template. */\n placeholder?: string;\n /** Override the \"multiline\" setting from the template. */\n multiline?: boolean;\n /** For fields that support grouping (radio buttons and check boxes) the value selected will be stored under this name. */\n group?: string;\n /** Override the \"options\" setting from the template. */\n options?: IDropdownOption[] | null;\n}\n\nexport interface ICreateEnvelopeFieldDirectly {\n /** The array index of the document the field is for. */\n document_id: number;\n /** The machine name of the field, e.g. `Buyer-textbox-1` */\n name: string;\n /** The ID of the role in the recipients list, e.g. `Recipient 2` */\n role_name: string;\n /** The type of the field */\n type: TFieldType;\n /** The 1-based page number the field is displayed on. \"Self-placed\" fields that the user must apply will be on page 0. */\n page: number;\n /** The X position of the field. */\n x: number;\n /** The Y position of the field. */\n y: number;\n /** The width of the field. */\n width?: number;\n /** The height of the field. */\n height?: number;\n /** If true, the field will be required */\n required?: boolean;\n /** If true, the field will be not be editable by the participant(s). NOTE: Fields may not be both required and readonly. */\n readonly?: boolean;\n /** If set, the placeholder/label for the field. */\n label?: string;\n /** The default value for the field. */\n default?: string;\n /** The placeholder to show in the field. */\n placeholder?: string;\n /** For text boxes, allows more than one line of text to be entered. */\n multiline?: boolean;\n /** For fields that support grouping (radio buttons and check boxes) the value selected will be stored under this name. */\n group?: string;\n /** For dropdowns, the options that are selectable. */\n options?: IDropdownOption[] | null;\n}\n\nexport interface ICreateEnvelopeFromTemplateRequest {\n template_id: string;\n /** Override the name of the envelope to create. */\n name?: string;\n /** Override the description of the envelope to create. */\n description?: string;\n /** Override the sender name of the envelope in email and other notifications. NOTE: To prevent spam filters from blocking messages, only the NAME may be overidden. The \"from\" email address will be notifications@verdocs.com and cannot be changed. */\n sender_name?: string;\n /** Override the sender email of the envelope in email and other notifications. NOTE: This will change areas that reflect the sender's email in the Web UI and certificate. It cannot change the email address used for notifications. */\n sender_email?: string;\n /** If set, Verdocs will not attempt to contact the recipient via email or SMS. */\n no_contact?: boolean;\n /** If set, the envelope will automatically expire at the specified date/time (ISO8601, UTC) */\n expires_at?: string;\n /** Environment in which to execute the envelope. Do not set this unless instructed to do so by Verdocs support. */\n environment?: string;\n /** Visibility of the envelope. If set to 'shared', the envelope will be visible to all users in the organization. If set to 'private', only the creator and recipients will see it. */\n visibility?: 'private' | 'shared';\n /** Delay (in seconds) before the first reminder is sent (min: 4hrs). Set to 0 or null to disable. */\n initial_reminder?: number;\n /** Delay (in seconds) before subsequent remidners are sent (min: 12hrs). Set to 0 or null to disable. */\n followup_reminders?: number;\n /** List of recipients to configure. */\n recipients: ICreateEnvelopeRecipientFromTemplate[];\n /** Optional metadata to attach to the envelope. This is not used by Verdocs, but may be used for internal tracking purposes by the caller. This is not shown to recipients, but is not private and should not be used to store sensitive data. */\n data?: any;\n /** Fields to create in the envelope. Note that document_id is a number in this call and should match the index of the document in the documents array. */\n fields?: ICreateEnvelopeFieldFromTemplate;\n}\n\nexport interface ICreateEnvelopeDirectlyRequest {\n /** The name of the envelope to create. */\n name: string;\n /** The description of the envelope to create. */\n description?: string;\n /** Override the sender name of the envelope in email and other notifications. NOTE: To prevent spam filters from blocking messages, only the NAME may be overidden. The \"from\" email address will be notifications@verdocs.com and cannot be changed. */\n sender_name?: string;\n /** Override the sender email of the envelope in email and other notifications. NOTE: This will change areas that reflect the sender's email in the Web UI and certificate. It cannot change the email address used for notifications. */\n sender_email?: string;\n /** If set, Verdocs will not attempt to contact the recipient via email or SMS. */\n no_contact?: boolean;\n /** If set, the envelope will automatically expire at the specified date/time (ISO8601, UTC) */\n expires_at?: string;\n /** Environment in which to execute the envelope. Do not set this unless instructed to do so by Verdocs support. */\n environment?: string;\n /** Visibility of the envelope. If set to 'shared', the envelope will be visible to all users in the organization. If set to 'private', only the creator and recipients will see it. */\n visibility?: 'private' | 'shared';\n /** Delay (in seconds) before the first reminder is sent (min: 4hrs). Set to 0 or null to disable. */\n initial_reminder: number;\n /** Delay (in seconds) before subsequent remidners are sent (min: 12hrs). Set to 0 or null to disable. */\n followup_reminders: number;\n /** Optional metadata to attach to the envelope. This is not used by Verdocs, but may be used for internal tracking purposes by the caller. This is not shown to recipients, but is not private and should not be used to store sensitive data. */\n data?: any;\n /** List of recipients to configure. */\n recipients: ICreateEnvelopeRecipientDirectly[];\n /** Documents to attach to the envelope. */\n documents: (ICreateEnvelopeDocumentFromData | ICreateEnvelopeDocumentFromUri | ICreateEnvelopeDocumentFromFile)[];\n /** Fields to create in the envelope. Note that document_id is a number in this call and should match the index of the document in the documents array. */\n fields: ICreateEnvelopeFieldDirectly[];\n}\n\nexport type TCreateEnvelopeRequest = ICreateEnvelopeFromTemplateRequest | ICreateEnvelopeDirectlyRequest;\n\nexport interface IAuthenticateRecipientViaPasscodeRequest {\n auth_method: 'passcode';\n code: string;\n}\n\nexport interface IAuthenticateRecipientViaEmailRequest {\n auth_method: 'email';\n code: string;\n resend?: boolean;\n}\n\nexport interface IAuthenticateRecipientViaSMSRequest {\n auth_method: 'sms';\n code: string;\n resend?: boolean;\n}\n\nexport interface IKBAResponse {\n type: string;\n answer: string | number;\n}\n\nexport interface IAuthenticateRecipientViaKBARequest {\n auth_method: 'kba';\n first_name?: string;\n last_name?: string;\n address?: string;\n city?: string;\n state?: string;\n zip?: string;\n ssn_last_4?: string;\n dob?: string;\n responses?: IKBAResponse[];\n}\n\nexport type TAuthenticateRecipientRequest =\n | IAuthenticateRecipientViaPasscodeRequest\n | IAuthenticateRecipientViaEmailRequest\n | IAuthenticateRecipientViaSMSRequest\n | IAuthenticateRecipientViaKBARequest;\n\n/**\n * These disclosures will be used if no overrides are supplied by the caller. Overrides must\n * be applied at the Organization level before creating an envelope.\n */\nexport const DEFAULT_DISCLOSURES = `\n<ul>\n <li>\n Agree to use electronic records and signatures, and confirm you have read the\n <a href=\"https://verdocs.com/en/electronic-record-signature-disclosure/\" target=\"_blank\">\n Electronic Record and Signatures Disclosure</a>.</li>\n <li>\n Agree to Verdocs'\n <a href=\"https://verdocs.com/en/eula\" target=\"_blank\">\n End User License Agreement</a>\n and confirm you have read Verdocs'\n <a href=\"https://verdocs.com/en/privacy-policy/\" target=\"_blank\">\n Privacy Policy</a>.\n </li>\n</ul>`;\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 {getApiKeys} from '@verdocs/js-sdk';\n *\n * const keys = await getApiKeys(ORGID);\n * ```\n *\n * @group API Keys\n * @api GET /v2/api-keys Get API keys\n * @apiSuccess array(items: IApiKey) . A list of the API keys for the caller's organization. Secrets will not be included.\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 {createApiKey} from '@verdocs/js-sdk';\n *\n * await createApiKey(ORGID, {name: NEWNAME});\n * ```\n *\n * @group API Keys\n * @api POST /v2/api-keys Create API key\n * @apiBody string name A name used to identify the key in the Verdocs Web App\n * @apiBody string(format:uuid) profile_id The profile ID that calls made using the key will act as\n * @apiBody array(items:string) permission An array of permissions to assign to the new key. Extends (but does not override) the API key's profile permissions.\n * @apiSuccess IApiKey . The newly-created API key, including its secret.\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 {rotateApiKey} from '@verdocs/js-sdk';\n *\n * const {client_secret: newSecret} = await rotateApiKey(ORGID, CLIENTID);\n * ```\n *\n * @group API Keys\n * @api POST /v2/api-keys/:client_id/rotate Rotate API key\n * @apiParam string(format:uuid) client_id The client ID of the key to rotate\n * @apiSuccess IApiKey . The updated API key with its new secret.\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 {updateApiKey} from '@verdocs/js-sdk';\n *\n * await updateApiKey(ORGID, CLIENTID, {name: NEWNAME});\n * ```\n *\n * @group API Keys\n * @api PATCH /v2/api-keys/:client_id Update API key\n * @apiBody string name? New name for the API key\n * @apiBody array(items:string) permission New array of permissions to assign to the new key. Extends (but does not override) the API key's profile permissions.\n * @apiSuccess IApiKey . The updated API key. The secret will not be included.\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 {deleteApiKey} from '@verdocs/js-sdk';\n *\n * await deleteApiKey(ORGID, CLIENTID);\n * ```\n *\n * @group API Keys\n * @api DELETE /v2/api-keys/:client_id Delete API key\n * @apiSuccess string . Success.\n */\nexport const deleteApiKey = (endpoint: VerdocsEndpoint, clientId: string) =>\n endpoint.api //\n .delete(`/v2/api-keys/${clientId}`)\n .then((r) => r.data);\n","import {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {IProfile} from '../Models';\n\n/**\n * An Organization Contact (aka Profile) is an individual user with no access to an organization. These entries\n * appear only in contact lists, usually to populate quick-search dropdowns when sending envelopes.\n *\n * @module\n */\n\n/**\n * Get a list of the contacts in the caller's organization.\n *\n * ```typescript\n * import {getOrganizationContacts} from '@verdocs/js-sdk';\n *\n * const members = await getOrganizationContacts(VerdocsEndpoint.getDefault()});\n * ```\n *\n * @group Organization Contacts\n * @api GET /v2/organization-contacts Get a list of organization contacts\n * @apiBody string email Email address for the invitee\n * @apiBody string token Invite token for the invitee\n * @apiSuccess string . Success. The invitation will be marked declined and the token will be invalidated.\n */\nexport const getOrganizationContacts = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IProfile[]>(`/v2/organization-contacts`)\n .then((r) => r.data);\n\n/**\n * Delete a contact from the caller's organization. Note that the caller must be an admin or owner.\n *\n * ```typescript\n * import {deleteOrganizationContact} from '@verdocs/js-sdk';\n *\n * await deleteOrganizationContact(VerdocsEndpoint.getDefault(), 'PROFILEID'});\n * ```\n *\n * @group Organization Contacts\n * @api POST /v2/organization-invitations/decline GET a list of pending invitations\n * @apiBody string email Email address for the invitee\n * @apiBody string token Invite token for the invitee\n * @apiSuccess string . Success. The invitation will be marked declined and the token will be invalidated.\n */\nexport const deleteOrganizationContact = (endpoint: VerdocsEndpoint, profileId: string) =>\n endpoint.api //\n .delete(`/v2/organization-contacts/${profileId}`)\n .then((r) => r.data);\n\n/**\n * Update a member.\n *\n * ```typescript\n * import {createOrganizationContact} from '@verdocs/js-sdk';\n *\n * const result = await createOrganizationContact(VerdocsEndpoint.getDefault(), 'PROFILEID', {first_name:'First', last_name:'Last', email:'a@b.com'});\n * ```\n */\nexport const createOrganizationContact = (\n endpoint: VerdocsEndpoint,\n params: Pick<IProfile, 'first_name' | 'last_name' | 'email' | 'phone'>,\n) =>\n endpoint.api //\n .post(`/v2/organization-contacts`, params)\n .then((r) => r.data);\n\n/**\n * Update a member.\n *\n * ```typescript\n * import {updateOrganizationContact} from '@verdocs/js-sdk';\n *\n * const result = await updateOrganizationContact(VerdocsEndpoint.getDefault(), 'PROFILEID', {first_name:'NewFirst'});\n * ```\n */\nexport const updateOrganizationContact = (\n endpoint: VerdocsEndpoint,\n profileId: string,\n params: Pick<IProfile, 'first_name' | 'last_name' | 'email' | 'phone'>,\n) =>\n endpoint.api //\n .patch(`/v2/organization-contacts/${profileId}`, params)\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 '../Sessions';\nimport {IGroup} from '../Models';\n\n/**\n * Get a list of groups for the caller's organization. NOTE: Any organization member may request\n * the list of groups, but only Owners and Admins may update them.\n *\n * ```typescript\n * import {getGroups} from '@verdocs/js-sdk';\n *\n * const groups = await getGroups();\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 group = 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\n/**\n * Create a group. Note that \"everyone\" is a reserved name and may not be created.\n *\n * ```typescript\n * import {createGroup} from '@verdocs/js-sdk';\n *\n * const group = await createGroup(VerdocsEndpoint.getDefault(), {name:'newgroup'});\n * ```\n */\nexport const createGroup = (endpoint: VerdocsEndpoint, params: {name: string; permissions: TPermission[]}) =>\n endpoint.api //\n .post('/v2/organization-groups', params)\n .then((r) => r.data);\n\n/**\n * Update a group. Note that \"everyone\" is a reserved name and may not be changed.\n *\n * ```typescript\n * import {updateGroup} from '@verdocs/js-sdk';\n *\n * const updated = await updateGroup(VerdocsEndpoint.getDefault(), {name:'newname'});\n * ```\n */\nexport const updateGroup = (endpoint: VerdocsEndpoint, groupId: string, params: {name: string; permissions: TPermission[]}) =>\n endpoint.api //\n .patch(`/v2/organization-groups/${groupId}`, params)\n .then((r) => r.data);\n\n/**\n * Get an organization by ID. Note that the \"everyone\" group cannot be deleted.\n *\n * ```typescript\n * import {deleteGroup} from '@verdocs/js-sdk';\n *\n * await deleteGroup(VerdocsEndpoint.getDefault(), 'ORGID');\n * ```\n */\nexport const deleteGroup = (endpoint: VerdocsEndpoint, groupId: string) =>\n endpoint.api //\n .delete(`/v2/organization-groups/${groupId}`)\n .then((r) => r.data);\n\n/**\n * Add a member to a group.\n *\n * ```typescript\n * import {addGroupMember} from '@verdocs/js-sdk';\n *\n * await addGroupMember(VerdocsEndpoint.getDefault(), 'GROUPID', 'PROFILEID');\n * ```\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\n/**\n * Remove a member from a group.\n *\n * ```typescript\n * import {deleteGroupMember} from '@verdocs/js-sdk';\n *\n * await deleteGroupMember(VerdocsEndpoint.getDefault(), 'GROUPID', 'PROFILEID');\n * ```\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","import {IAcceptOrganizationInvitationRequest, ICreateInvitationRequest} from './Types';\nimport type {IAuthenticateResponse} from '../Users';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {IOrganizationInvitation} from '../Models';\n\n/**\n * An invitation represents an opportunity for a Member to join an Organization.\n *\n * @module\n */\n\n/**\n * Get a list of invitations pending for the caller's organization. The caller must be an admin or owner.\n *\n * @group Organization Invitations\n * @api GET /v2/organization-invitations Get a list of pending invitations\n * @apiBody array(items:TRole) roles URL to send Webhook events to. An empty or invalid URL will disable Webhook calls.\n * @apiBody string first_name First name. The user may override this after accepting the invitation.\n * @apiBody string last_name Last name. The user may override this after accepting the invitation.\n * @apiSuccess array(items:IProfile) . List of caller's current organization's members\n */\nexport const getOrganizationInvitations = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IOrganizationInvitation[]>(`/v2/organization-invitations`)\n .then((r) => r.data);\n\n/**\n * Invite a new user to join the organization.\n *\n * @group Organization Invitations\n * @api POST /v2/organization-invitations Invite a new user to join the organization\n * @apiBody string email Email address to send the invitation to\n * @apiBody string first_name First name. The user may override this after accepting the invitation.\n * @apiBody string last_name Last name. The user may override this after accepting the invitation.\n * @apiBody TRole role Initial role to assign to the user once they accept.\n * @apiSuccess IOrganizationInvitation . The newly-created invitation.\n */\nexport const createOrganizationInvitation = (endpoint: VerdocsEndpoint, params: ICreateInvitationRequest) =>\n endpoint.api //\n .post<IOrganizationInvitation>(`/v2/organization-invitations`, params)\n .then((r) => r.data);\n\n/**\n * Delete an invitation. Note that no cancellation message will be sent. Invitations are also one-time-use.\n * If the invitee attempts to join after the invitation is deleted, accepted, or decline, they will be\n * shown an error.\n *\n * @group Organization Invitations\n * @api DELETE /v2/organization-invitations/:email Delete a pending invitation\n * @apiSuccess string . Success\n */\nexport const deleteOrganizationInvitation = (endpoint: VerdocsEndpoint, email: string) =>\n endpoint.api //\n .delete(`/v2/organization-invitations/${email}`)\n .then((r) => r.data);\n\n/**\n * Update an invitation. Note that email may not be changed after the invite is sent. To change\n * an invitee's email, delete the incorrect entry and create one with the correct value.\n *\n * @group Organization Invitations\n * @api PATCH /v2/organization-invitations/:email Update a pending invitation\n * @apiBody string first_name First name. The user may override this after accepting the invitation.\n * @apiBody string last_name Last name. The user may override this after accepting the invitation.\n * @apiBody TRole role Initial role to assign to the user once they accept.\n * @apiSuccess IOrganizationInvitation . The updated invitation.\n */\nexport const updateOrganizationInvitation = (\n endpoint: VerdocsEndpoint,\n email: string,\n params: Pick<ICreateInvitationRequest, 'role' | 'first_name' | 'last_name'>,\n) =>\n endpoint.api //\n .patch<IOrganizationInvitation>(`/v2/organization-invitations/${email}`, params)\n .then((r) => r.data);\n\n/**\n * Send a reminder to the invitee to join the organization.\n *\n * @group Organization Invitations\n * @api POST /v2/organization-invitations/resend Send a reminder to a pending invitee\n * @apiBody string email The recipient to send the reminder to\n * @apiSuccess IOrganizationInvitation . The updated invitation\n */\nexport const resendOrganizationInvitation = (endpoint: VerdocsEndpoint, email: string) =>\n endpoint.api //\n .post<IOrganizationInvitation>('/v2/organization-invitations/resend', {email})\n .then((r) => r.data);\n\n/**\n * Get an invitation's details. This is generally used as the first step of accepting the invite.\n * A successful response will indicate that the invite token is still valid, and include some\n * metadata for the organization to style the acceptance screen.\n *\n * @group Organization Invitations\n * @api GET /v2/organization-invitations/:email/:token Get a pending invitation (_Authenticated via invite token, not an active session._). Intended to be called by the invitee to get details about the invitation they are about to accept.\n * @apiSuccess IOrganizationInvitation . Requested invitation's details. Will always include summary details for the organization, to be used for branding the accept-invite view.\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\n/**\n * Accept an invitation. This will automatically create a user record for the caller as well as a profile\n * with the appropriate role as specified in the invite. The profile will be set as \"current\" for the caller,\n * and session tokens will be returned to access the new profile. The profile's email_verified flag will\n * also be set to true.\n *\n * @group Organization Invitations\n * @api POST /v2/organization-invitations/accept Accept an invitation\n * @apiBody string email Email address for the invitee\n * @apiBody string token Invite token for the invitee\n * @apiBody string first_name First name\n * @apiBody string last_name Last name\n * @apiBody string password Password\n * @apiSuccess IAuthenticateResponse . Session credentials for the newly-created user's profile. If the user already had a profile for another organization, the new profile will be made \"current\" automatically.\n */\nexport const acceptOrganizationInvitation = (endpoint: VerdocsEndpoint, params: IAcceptOrganizationInvitationRequest) =>\n endpoint.api //\n .post<IAuthenticateResponse>('/v2/organization-invitations/accept', params)\n .then((r) => r.data);\n\n/**\n * Decline an invitation. This will mark the status \"declined,\" providing a visual indication to the\n * organization's admins that the invite was declined, preventing further invites from being created\n * to the same email address, and also preventing the invitee from receiving reminders to join.\n *\n * @group Organization Invitations\n * @api POST /v2/organization-invitations/decline Decline an invitation\n * @apiDescription Mark the status \"declined,\" providing a visual indication to the organization's admins that the invite was declined, preventing further invites from being created to the same email address, and also preventing the invitee from receiving reminders to join.\n * @apiBody string email Email address for the invitee\n * @apiBody string token Invite token for the invitee\n * @apiSuccess string . Success. The invitation will be marked declined and the token will be invalidated.\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\n/**\n * Get a list of the members in the caller's organization.\n *\n * ```typescript\n * import {getOrganizationMembers} from '@verdocs/js-sdk';\n *\n * const members = await getOrganizationMembers(VerdocsEndpoint.getDefault()});\n * ```\n *\n * @group Organization Members\n * @api GET /v2/organization-members List current organization's members\n * @apiSuccess array(items:IProfile) . List of caller's current organization's members\n */\nexport const getOrganizationMembers = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IProfile[]>(`/v2/organization-members`)\n .then((r) => r.data);\n\n/**\n * Delete a member from the caller's organization. Note that the caller must be an admin or owner,\n * may not delete him/herself.\n *\n * ```typescript\n * import {deleteOrganizationMember} from '@verdocs/js-sdk';\n *\n * await deleteOrganizationMember(VerdocsEndpoint.getDefault(), 'PROFILEID'});\n * ```\n *\n * @group Organization Members\n * @api DELETE /v2/organization-members/:profile_id Delete a member from the organization\n * @apiSuccess string . Success\n */\nexport const deleteOrganizationMember = (endpoint: VerdocsEndpoint, profileId: string) =>\n endpoint.api //\n .delete(`/v2/organization-members/${profileId}`)\n .then((r) => r.data);\n\n/**\n * Update a member.\n *\n * ```typescript\n * import {updateOrganizationMember} from '@verdocs/js-sdk';\n *\n * const result = await updateOrganizationMember(VerdocsEndpoint.getDefault(), 'PROFILEID', {roles:['member']});\n * ```\n *\n * @group Organization Members\n * @api PATCH /v2/organization-members/:profile_id Update an organization member.\n * @apiBody array(items:TRole) roles URL to send Webhook events to. An empty or invalid URL will disable Webhook calls.\n * @apiBody string first_name Set to true to enable Webhooks calls.\n * @apiBody string last_name Record<TWebhookEvent, boolean> map of events to enable/disable.\n * @apiSuccess array(items:IProfile) . List of caller's current organization's members\n */\nexport const updateOrganizationMember = (\n endpoint: VerdocsEndpoint,\n profileId: string,\n params: Pick<IProfile, 'roles' | 'first_name' | 'last_name'>,\n) =>\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 * NOTE: There is no call specifically to create an organization. Every organization must have\n * at least one \"owner\" type member. To create a new organization, call createProfile() with\n * the desired new orgName to create. The caller will become the first owner of the new org, and\n * can then invite new members to join as well.\n *\n * NOTE: There is no call to delete an organization. For safety, this is a manual process. Please\n * contact support@verdocs.com if you wish to completely delete an organization and all its records.\n *\n * @module\n */\n\nimport {IEntitlement, IOrganization, IProfile, TOrganizationUsage} from '../Models';\nimport {VerdocsEndpoint} from '../VerdocsEndpoint';\nimport {IAuthenticateResponse} from '../Users';\nimport {collapseEntitlements} from '../Utils';\nimport {TUsageType} from '../BaseTypes';\n\n/**\n * Get an organization by ID. Note that this endpoint will return only a subset of fields\n * if the caller is not a member of the organization (the public fields).\n *\n * ```typescript\n * import {getOrganization} from '@verdocs/js-sdk';\n *\n * const organizations = await getOrganization(VerdocsEndpoint.getDefault(), 'ORGID');\n * ```\n *\n * @group Organizations\n * @api GET /v2/organizations/:organization_id Get organization\n * @apiSuccess IOrganization . The requested organization. The caller must be a member.\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 * Get an organization's \"children\".\n *\n * ```typescript\n * import {getOrganizationChildren} from '@verdocs/js-sdk';\n *\n * const children = await getOrganizationChildren(VerdocsEndpoint.getDefault(), 'ORGID');\n * ```\n *\n * @group Organizations\n * @api GET /v2/organizations/:organization_id/children Get an organization's children\n * @apiSuccess IOrganization[] . Any child organizations found.\n */\nexport const getOrganizationChildren = (endpoint: VerdocsEndpoint, organizationId: string) =>\n endpoint.api //\n .get<IOrganization>(`/v2/organizations/${organizationId}/children`)\n .then((r) => r.data);\n\n/**\n * Get an organization's usage data. If the organization is a parent, usage data for children\n * will be included as well. The response will be a nested object keyed by organization ID,\n * with each entry being a dictionary of usageType:count entries.\n *\n * ```typescript\n * import {getOrganizationUsage} from '@verdocs/js-sdk';\n *\n * const usage = await getOrganizationUsage(VerdocsEndpoint.getDefault(), 'ORGID');\n * ```\n *\n * @group Organizations\n * @api GET /v2/organizations/:organization_id/usage Get an organization's usage metrics\n * @apiSuccess TOrganizationUsage . Usage data grouped by organization ID\n */\nexport const getOrganizationUsage = (\n endpoint: VerdocsEndpoint,\n organizationId: string,\n params?: {start_date?: string; end_date?: string; usage_type?: TUsageType},\n) =>\n endpoint.api //\n .get<TOrganizationUsage>(`/v2/organizations/${organizationId}/usage`, {params})\n .then((r) => r.data);\n\n/**\n * Create an organization. The caller will be assigned an \"Owner\" profile in the new organization,\n * and it will be set to \"current\" automatically. A new set of session tokens will be issued to\n * the caller, and the caller should update their endpoint to use the new tokens.\n *\n * ```typescript\n * import {createOrganization} from '@verdocs/js-sdk';\n *\n * const organization = await createOrganization(VerdocsEndpoint.getDefault(), {name: 'NewOrg'});\n * ```\n *\n * @group Organizations\n * @api POST /v2/organizations Create organization\n * @apiDescription The caller will be assigned an \"Owner\" profile in the new organization, and it will be set to \"current\" automatically. A new set of session tokens will be issued to the caller, and the caller should update their endpoint to use the new tokens.\n * @apiBody string name The name of the new organization\n * @apiBody string parent_id? If set, the new organization will be created as a child of the specified parent organization. The caller must be an admin of the parent organization.\n * @apiBody string contact_email? Contact email for the new organization\n * @apiBody string url? URL for the new organization\n * @apiBody string full_logo_url? URL of a large-format PNG logo\n * @apiBody string thumbnail_url? URL of a small-format (square is recommended) PNG logo\n * @apiBody string primary_color? URL of a small-format (square is recommended) PNG logo\n * @apiBody string secondary_color? URL of a small-format (square is recommended) PNG logo\n * @apiBody string terms_use_url? URL of a Terms of Use page, shown in bottom-right of signing experience. Hidden if not set.\n * @apiBody string privacy_policy_url? URL of a Privacy Policy page, shown in bottom-right of signing experience. Hidden if not set.\n * @apiBody string powered_by_label? \"Powered-by...\" label, shown in bottom-left of signing experience. Hidden if not set.\n * @apiBody string powered_by_url? URL for the Powered By label to show when clicked. Rendered as a static label if not set.\n * @apiSuccess IAuthenticateResponse . Authentication credentials for user in the new organization. The user will be made an Owner automatically.\n */\nexport const createOrganization = (\n endpoint: VerdocsEndpoint,\n params: {name: string} & Partial<\n Pick<\n IOrganization,\n | 'address'\n | 'address2'\n | 'phone'\n | 'contact_email'\n | 'url'\n | 'full_logo_url'\n | 'thumbnail_url'\n | 'primary_color'\n | 'secondary_color'\n | 'terms_use_url'\n | 'privacy_policy_url'\n | 'powered_by_label'\n | 'powered_by_url'\n | 'parent_id'\n >\n >,\n) =>\n endpoint.api //\n .post<IAuthenticateResponse & {profile: IProfile; organization: IOrganization}>(`/v2/organizations`, params)\n .then((r) => r.data);\n\n/**\n * Update an organization. This can only be called by an admin or owner.\n *\n * ```typescript\n * import {updateOrganization} from '@verdocs/js-sdk';\n *\n * const organizations = await updateOrganization(VerdocsEndpoint.getDefault(), organizationId, {name:'ORGNAME'});\n * ```\n *\n * @group Organizations\n * @api PATCH /v2/organizations/:organization_id Update organization\n * @apiBody string name The name of the new organization\n * @apiBody string contact_email? Contact email for the new organization\n * @apiBody string url? URL for the new organization\n * @apiBody string full_logo_url? URL of a large-format PNG logo\n * @apiBody string thumbnail_url? URL of a small-format (square is recommended) PNG logo\n * @apiBody string primary_color? URL of a small-format (square is recommended) PNG logo\n * @apiBody string secondary_color? URL of a small-format (square is recommended) PNG logo\n * @apiBody string terms_use_url? URL of a Terms of Use page, shown in bottom-right of signing experience. Hidden if not set.\n * @apiBody string privacy_policy_url? URL of a Privacy Policy page, shown in bottom-right of signing experience. Hidden if not set.\n * @apiBody string powered_by_label? \"Powered-by...\" label, shown in bottom-left of signing experience. Hidden if not set.\n * @apiBody string powered_by_url? URL for the Powered By label to show when clicked. Rendered as a static label if not set.\n * @apiSuccess IOrganization . The details for the updated 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/**\n * Delete an organization. This can only be called by an owner. Inclusion of the organization ID to delete\n * is just a safety check. The caller may only delete the organization they have currently selected.\n *\n * ```typescript\n * import {deleteOrganization} from '@verdocs/js-sdk';\n *\n * const newSession = await deleteOrganization(VerdocsEndpoint.getDefault(), organizationId);\n * ```\n *\n * @group Organizations\n * @api DELETE /v2/organizations/:organization_id Delete organization\n * @apiSuccess IAuthenticateResponse . If the caller is a member of another organization, authentication credentials for the next organization available. If not, this will be null and the caller will be logged out.\n */\nexport const deleteOrganization = (endpoint: VerdocsEndpoint, organizationId: string) =>\n endpoint.api //\n .delete<IAuthenticateResponse | null>(`/v2/organizations/${organizationId}`)\n .then((r) => r.data);\n\n/**\n * Update the organization's full or thumbnail logo. This can only be called by an admin or owner.\n *\n * ```typescript\n * import {updateOrganizationLogo} from '@verdocs/js-sdk';\n *\n * await updateOrganizationLogo((VerdocsEndpoint.getDefault(), organizationId, file);\n * ```\n *\n * @group Organizations\n * @api PATCH /v2/organizations/:organization_id Update organization full or thumbnail logo.\n * @apiBody image/png logo? Form-url-encoded file to upload\n * @apiBody image/png thumbnail? Form-url-encoded file to upload\n * @apiSuccess IOrganization . The updated organization.\n */\nexport const updateOrganizationLogo = (\n endpoint: VerdocsEndpoint,\n organizationId: string,\n file: File,\n onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void,\n) => {\n const formData = new FormData();\n formData.append('logo', file, file.name);\n\n return endpoint.api //\n .patch<IOrganization>(`/v2/organizations/${organizationId}`, 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 * Update the organization's thumbnail. This can only be called by an admin or owner.\n *\n * ```typescript\n * import {updateOrganizationThumbnail} from '@verdocs/js-sdk';\n *\n * await updateOrganizationThumbnail((VerdocsEndpoint.getDefault(), organizationId, file);\n * ```\n */\nexport const updateOrganizationThumbnail = (\n endpoint: VerdocsEndpoint,\n organizationId: string,\n file: File,\n onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void,\n) => {\n const formData = new FormData();\n formData.append('thumbnail', file, file.name);\n\n return endpoint.api //\n .patch<IOrganization>(`/v2/organizations/${organizationId}`, 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\nexport const getEntitlements = async (endpoint: VerdocsEndpoint) =>\n endpoint.api.get<IEntitlement[]>(`/v2/organizations/entitlements`).then((r) => r.data);\n\n/**\n * Largely intended to be used internally by Web SDK components but may be informative for other cases.\n * Entitlements are feature grants such as \"ID-based KBA\" that require paid contracts to enable, typically\n * because the underlying services that support them are fee-based. Entitlements may run concurrently,\n * and may have different start/end dates e.g. \"ID-based KBA\" may run 1/1/2026-12/31/2026 while\n * \"SMS Authentication\" may be added later and run 6/1/2026-5/31/2027. The entitlements list is a simple\n * array of enablements and may include entries that are not YET enabled or have now expired.\n *\n * In client code it is helpful to simply know \"is XYZ feature currently enabled?\" This function collapses\n * the entitlements list to a simplified dictionary of current/active entitlements. Note that it is async\n * because it calls the server to obtain the \"most current\" entitlements list. Existence of an entry in the\n * resulting dictionary implies the feature is active. Metadata inside each entry can be used to determine\n * limits, etc.\n *\n * ```typescript\n * import {getActiveEntitlements} from '@verdocs/js-sdk';\n *\n * const activeEntitlements = await getActiveEntitlements((VerdocsEndpoint.getDefault());\n * const isSMSEnabled = !!activeEntitlements.sms_auth;\n * const monthlyKBALimit = activeEntitlements.kba_auth?.monthly_max;\n * ```\n */\nexport const getActiveEntitlements = async (endpoint: VerdocsEndpoint) => {\n if (!endpoint.session) {\n throw new Error('No active session');\n }\n\n const entitlements = await getEntitlements(endpoint);\n return collapseEntitlements(entitlements);\n};\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 Webhook configuration for the caller's organization.\n *\n * ```typescript\n * import {getWebhooks} from '@verdocs/js-sdk';\n *\n * await getWebhooks(ORGID, params);\n * ```\n *\n * @group Webhooks\n * @api GET /v2/webhooks Get organization Webhooks config\n * @apiSuccess IWebhook . The current Webhooks config for the caller's organization.\n */\nexport const getWebhooks = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .get<IWebhook>(`/v2/webhooks`)\n .then((r) => r.data);\n\n/**\n * Update the registered Webhook configuration for the caller's organization. Note that\n * Webhooks cannot currently be deleted, but may be easily disabled by setting `active`\n * to `false` and/or setting the `url` to an empty string.\n *\n * ```typescript\n * import {setWebhooks} from '@verdocs/js-sdk';\n *\n * await setWebhooks(ORGID, params);\n * ```\n *\n * @group Webhooks\n * @api PATCH /v2/webhooks Update organization Webhooks config\n * @apiDescription Note that Webhooks cannot currently be deleted, but may be easily disabled by setting `active` to `false` and/or setting the `url` to an empty string.\n * @apiBody string url URL to send Webhook events to. An empty or invalid URL will disable Webhook calls.\n * @apiBody boolean active Set to true to enable Webhooks calls.\n * @apiBody object events Record<TWebhookEvent, boolean> map of events to enable/disable.\n * @apiSuccess IWebhook . The updated Webhooks config for the caller's organization.\n */\nexport const setWebhooks = (endpoint: VerdocsEndpoint, params: ISetWebhookRequest) =>\n endpoint.api //\n .patch<IWebhook>(`/v2/webhooks`, params)\n .then((r) => r.data);\n\n/**\n * Rotate the secret key used to authenticate Webhooks. If a secret key has not yet been set,\n * it will be created. Until this is done, Webhook calls will not have a signature applied to\n * their headers. Please note that pending Webhook deliveries will not be affected until the\n * next Webhook is triggered.\n *\n * To authenticate a Webhook call, compute an HMAC-256 hash of the JSON payload `body` field\n * as follows:\n *\n * ```typescript\n * // NOTE: Hash the `body` field INSIDE the payload. In many frameworks the payload is also called\n * // `body`, which can be confusing.\n * const jsonBody = JSON.stringify(req.body.body);\n * const hash = createHmac('sha256', SECRET_KEY).update(jsonBody).digest('hex');\n * if (hash !== req.headers['x-webhook-signature']) {\n * // Handle error here\n * }\n *\n * // It is important to return a 200 status code anyway, to avoid the sender trying to resend\n * // the same data.\n * res.status(200).send();\n * ```\n *\n * @group Webhooks\n * @api PATCH /v2/webhooks Rotate Webhook secret key\n * @apiDescription Note that Webhooks cannot currently be deleted, but may be easily disabled by setting `active` to `false` and/or setting the `url` to an empty string.\n * @apiSuccess IWebhook . The updated Webhooks config for the caller's organization, including the secret_key.\n */\nexport const rotateWebhookSecret = (endpoint: VerdocsEndpoint) =>\n endpoint.api //\n .put<IWebhook>(`/v2/webhooks/rotate-secret`)\n .then((r) => r.data);\n"],"names":["globalThis"],"mappings":";;;;;AAEO,MAAM,WAAW,GAAiB;IACvC,SAAS;IACT,WAAW;IACX,SAAS;IACT,MAAM;IACN,UAAU;IACV,WAAW;;IAEX,UAAU;IACV,UAAU;IACV,OAAO;IACP,YAAY;IACZ,SAAS;;AAGJ,MAAM,oBAAoB,GAA+B;AAC9D,IAAA,SAAS,EAAE,EAAE;AACb,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,IAAI,EAAE,EAAE;AACR,IAAA,SAAS,EAAE,GAAG;AACd,IAAA,OAAO,EAAE,GAAG;AACZ,IAAA,QAAQ,EAAE,GAAG;AACb,IAAA,QAAQ,EAAE,EAAE;AACZ,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,QAAQ,EAAE,EAAE;AACZ,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,OAAO,EAAE,EAAE;;AAGN,MAAM,qBAAqB,GAA+B;AAC/D,IAAA,SAAS,EAAE,EAAE;AACb,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,IAAI,EAAE,EAAE;AACR,IAAA,SAAS,EAAE,EAAE;AACb,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,QAAQ,EAAE,EAAE;AACZ,IAAA,QAAQ,EAAE,EAAE;AACZ,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,QAAQ,EAAE,EAAE;AACZ,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,OAAO,EAAE,EAAE;;AAGN,MAAM,cAAc,GAAG;IAC5B,kBAAkB;IAClB,oBAAoB;IACpB,mBAAmB;IAEnB,kBAAkB;IAClB,kBAAkB;IAClB,kBAAkB;IAClB,eAAe;;AAGV,MAAM,eAAe,GAAG;;;;;;;IAQ7B,gCAAgC;IAChC,6BAA6B;IAC7B,kCAAkC;IAClC,yBAAyB;IACzB,6BAA6B;IAC7B,s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