@verdocs/web-sdk 2.2.47 → 2.3.1

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.
Files changed (245) hide show
  1. package/dist/cjs/{TemplateStore-d9936a68.js → TemplateStore-d5dd1621.js} +1 -1
  2. package/dist/cjs/{Types-ee5afdf8.js → Types-fb95ed6b.js} +2 -1
  3. package/dist/cjs/{VerdocsEndpoint-2d85658d.js → VerdocsEndpoint-8495a05a.js} +294 -436
  4. package/dist/cjs/{_commonjsHelpers-0c557e26.js → _commonjsHelpers-1fbbf0eb.js} +0 -5
  5. package/dist/cjs/interact.min-7c05ff8a.js +12 -0
  6. package/dist/cjs/ipc-test.cjs.entry.js +2 -2
  7. package/dist/cjs/{utils-2ddfdf9e.js → utils-a3f0b70a.js} +2 -2
  8. package/dist/cjs/verdocs-activity-box.cjs.entry.js +1 -1
  9. package/dist/cjs/verdocs-auth.cjs.entry.js +5 -8
  10. package/dist/cjs/verdocs-build.cjs.entry.js +2 -2
  11. package/dist/cjs/verdocs-button-panel_2.cjs.entry.js +3 -3
  12. package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +4 -4
  13. package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +4 -4
  14. package/dist/cjs/verdocs-envelope-recipient-link_2.cjs.entry.js +1 -1
  15. package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +2 -2
  16. package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +4 -4
  17. package/dist/cjs/verdocs-field-attachment.cjs.entry.js +3 -3
  18. package/dist/cjs/verdocs-field-checkbox.cjs.entry.js +3 -3
  19. package/dist/cjs/verdocs-field-date.cjs.entry.js +4 -4
  20. package/dist/cjs/verdocs-field-dropdown.cjs.entry.js +3 -3
  21. package/dist/cjs/verdocs-field-initial.cjs.entry.js +3 -3
  22. package/dist/cjs/verdocs-field-payment.cjs.entry.js +3 -3
  23. package/dist/cjs/verdocs-field-radio-button.cjs.entry.js +3 -3
  24. package/dist/cjs/verdocs-field-signature.cjs.entry.js +3 -3
  25. package/dist/cjs/verdocs-field-textarea.cjs.entry.js +7 -7
  26. package/dist/cjs/verdocs-field-textbox.cjs.entry.js +7 -7
  27. package/dist/cjs/verdocs-field-timestamp.cjs.entry.js +4 -4
  28. package/dist/cjs/verdocs-file-chooser_2.cjs.entry.js +1 -1
  29. package/dist/cjs/verdocs-pagination_2.cjs.entry.js +3 -3
  30. package/dist/cjs/verdocs-preview_8.cjs.entry.js +6 -6
  31. package/dist/cjs/verdocs-quick-functions_3.cjs.entry.js +1 -1
  32. package/dist/cjs/verdocs-search.cjs.entry.js +1 -1
  33. package/dist/cjs/verdocs-settings-api-keys_4.cjs.entry.js +44 -33
  34. package/dist/cjs/verdocs-settings.cjs.entry.js +1 -1
  35. package/dist/cjs/verdocs-sign.cjs.entry.js +4 -4
  36. package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +4 -4
  37. package/dist/cjs/verdocs-template-fields_4.cjs.entry.js +11 -11
  38. package/dist/cjs/verdocs-template-star.cjs.entry.js +1 -1
  39. package/dist/cjs/verdocs-templates-list.cjs.entry.js +1 -1
  40. package/dist/cjs/verdocs-view.cjs.entry.js +4 -4
  41. package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +4 -7
  42. package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.css +1 -0
  43. package/dist/collection/components/fields/verdocs-field-timestamp/verdocs-field-timestamp.css +1 -0
  44. package/dist/collection/components/templates/verdocs-template-create/verdocs-template-create.js +2 -2
  45. package/dist/collection/utils/Types.js +2 -1
  46. package/dist/components/Types2.js +2 -1
  47. package/dist/components/VerdocsEndpoint.js +294 -436
  48. package/dist/components/_commonjsHelpers.js +1 -5
  49. package/dist/components/index3.js +40 -29
  50. package/dist/components/interact.min.js +5 -6
  51. package/dist/components/verdocs-auth.js +4 -7
  52. package/dist/components/verdocs-field-date.js +1 -1
  53. package/dist/components/verdocs-field-textarea.js +3 -3
  54. package/dist/components/verdocs-field-textbox.js +3 -3
  55. package/dist/components/verdocs-field-timestamp.js +1 -1
  56. package/dist/components/verdocs-template-create2.js +2 -2
  57. package/dist/components/verdocs-template-fields2.js +3 -3
  58. package/dist/components/verdocs-template-roles2.js +4 -4
  59. package/dist/docs.json +1 -1
  60. package/dist/esm/{TemplateStore-018fc1db.js → TemplateStore-18b6dbe3.js} +1 -1
  61. package/dist/esm/Types-1628dc71.js +5 -0
  62. package/dist/esm/{VerdocsEndpoint-b011af25.js → VerdocsEndpoint-140b14d7.js} +294 -436
  63. package/dist/esm/{_commonjsHelpers-5ec8f9b7.js → _commonjsHelpers-8a9f3b18.js} +1 -5
  64. package/dist/esm/interact.min-ef5402f3.js +10 -0
  65. package/dist/esm/ipc-test.entry.js +2 -2
  66. package/dist/esm/{utils-d269cea3.js → utils-e0ce2c22.js} +2 -2
  67. package/dist/esm/verdocs-activity-box.entry.js +1 -1
  68. package/dist/esm/verdocs-auth.entry.js +5 -8
  69. package/dist/esm/verdocs-build.entry.js +2 -2
  70. package/dist/esm/verdocs-button-panel_2.entry.js +3 -3
  71. package/dist/esm/verdocs-contact-picker_2.entry.js +4 -4
  72. package/dist/esm/verdocs-envelope-document-page.entry.js +4 -4
  73. package/dist/esm/verdocs-envelope-recipient-link_2.entry.js +1 -1
  74. package/dist/esm/verdocs-envelope-sidebar.entry.js +2 -2
  75. package/dist/esm/verdocs-envelopes-list.entry.js +4 -4
  76. package/dist/esm/verdocs-field-attachment.entry.js +3 -3
  77. package/dist/esm/verdocs-field-checkbox.entry.js +3 -3
  78. package/dist/esm/verdocs-field-date.entry.js +4 -4
  79. package/dist/esm/verdocs-field-dropdown.entry.js +3 -3
  80. package/dist/esm/verdocs-field-initial.entry.js +3 -3
  81. package/dist/esm/verdocs-field-payment.entry.js +3 -3
  82. package/dist/esm/verdocs-field-radio-button.entry.js +3 -3
  83. package/dist/esm/verdocs-field-signature.entry.js +3 -3
  84. package/dist/esm/verdocs-field-textarea.entry.js +7 -7
  85. package/dist/esm/verdocs-field-textbox.entry.js +7 -7
  86. package/dist/esm/verdocs-field-timestamp.entry.js +4 -4
  87. package/dist/esm/verdocs-file-chooser_2.entry.js +1 -1
  88. package/dist/esm/verdocs-pagination_2.entry.js +3 -3
  89. package/dist/esm/verdocs-preview_8.entry.js +6 -6
  90. package/dist/esm/verdocs-quick-functions_3.entry.js +1 -1
  91. package/dist/esm/verdocs-search.entry.js +1 -1
  92. package/dist/esm/verdocs-settings-api-keys_4.entry.js +44 -33
  93. package/dist/esm/verdocs-settings.entry.js +1 -1
  94. package/dist/esm/verdocs-sign.entry.js +4 -4
  95. package/dist/esm/verdocs-template-document-page_2.entry.js +4 -4
  96. package/dist/esm/verdocs-template-fields_4.entry.js +11 -11
  97. package/dist/esm/verdocs-template-star.entry.js +1 -1
  98. package/dist/esm/verdocs-templates-list.entry.js +1 -1
  99. package/dist/esm/verdocs-view.entry.js +4 -4
  100. package/dist/esm-es5/{TemplateStore-018fc1db.js → TemplateStore-18b6dbe3.js} +1 -1
  101. package/dist/esm-es5/Types-1628dc71.js +1 -0
  102. package/dist/esm-es5/VerdocsEndpoint-140b14d7.js +1 -0
  103. package/dist/esm-es5/_commonjsHelpers-8a9f3b18.js +1 -0
  104. package/dist/esm-es5/interact.min-ef5402f3.js +1 -0
  105. package/dist/esm-es5/ipc-test.entry.js +1 -1
  106. package/dist/esm-es5/{utils-d269cea3.js → utils-e0ce2c22.js} +1 -1
  107. package/dist/esm-es5/verdocs-activity-box.entry.js +1 -1
  108. package/dist/esm-es5/verdocs-auth.entry.js +1 -1
  109. package/dist/esm-es5/verdocs-build.entry.js +1 -1
  110. package/dist/esm-es5/verdocs-button-panel_2.entry.js +1 -1
  111. package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
  112. package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
  113. package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js +1 -1
  114. package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
  115. package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
  116. package/dist/esm-es5/verdocs-field-attachment.entry.js +1 -1
  117. package/dist/esm-es5/verdocs-field-checkbox.entry.js +1 -1
  118. package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
  119. package/dist/esm-es5/verdocs-field-dropdown.entry.js +1 -1
  120. package/dist/esm-es5/verdocs-field-initial.entry.js +1 -1
  121. package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
  122. package/dist/esm-es5/verdocs-field-radio-button.entry.js +1 -1
  123. package/dist/esm-es5/verdocs-field-signature.entry.js +1 -1
  124. package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
  125. package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
  126. package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
  127. package/dist/esm-es5/verdocs-file-chooser_2.entry.js +1 -1
  128. package/dist/esm-es5/verdocs-pagination_2.entry.js +1 -1
  129. package/dist/esm-es5/verdocs-preview_8.entry.js +1 -1
  130. package/dist/esm-es5/verdocs-quick-functions_3.entry.js +1 -1
  131. package/dist/esm-es5/verdocs-search.entry.js +1 -1
  132. package/dist/esm-es5/verdocs-settings-api-keys_4.entry.js +1 -1
  133. package/dist/esm-es5/verdocs-settings.entry.js +1 -1
  134. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  135. package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
  136. package/dist/esm-es5/verdocs-template-fields_4.entry.js +1 -1
  137. package/dist/esm-es5/verdocs-template-star.entry.js +1 -1
  138. package/dist/esm-es5/verdocs-templates-list.entry.js +1 -1
  139. package/dist/esm-es5/verdocs-view.entry.js +1 -1
  140. package/dist/types/utils/Types.d.ts +1 -1
  141. package/dist/types/utils/utils.d.ts +1 -1
  142. package/dist/verdocs-web-sdk/{p-5c50a778.system.entry.js → p-0002c8d5.system.entry.js} +1 -1
  143. package/dist/verdocs-web-sdk/{p-35769d0c.system.entry.js → p-026eb575.system.entry.js} +1 -1
  144. package/dist/verdocs-web-sdk/{p-bd0bc3dd.system.entry.js → p-07432832.system.entry.js} +1 -1
  145. package/dist/verdocs-web-sdk/{p-af3e9624.entry.js → p-120f75b1.entry.js} +1 -1
  146. package/dist/verdocs-web-sdk/p-16724702.js +1 -0
  147. package/dist/verdocs-web-sdk/{p-aa51514f.system.entry.js → p-16849f44.system.entry.js} +1 -1
  148. package/dist/verdocs-web-sdk/p-1ba9f457.system.js +1 -0
  149. package/dist/verdocs-web-sdk/{p-23be436b.entry.js → p-1bb86e1a.entry.js} +1 -1
  150. package/dist/verdocs-web-sdk/{p-76907130.entry.js → p-1cd6f713.entry.js} +1 -1
  151. package/dist/verdocs-web-sdk/{p-609c7fab.system.entry.js → p-1df623d7.system.entry.js} +1 -1
  152. package/dist/verdocs-web-sdk/{p-77abc3ce.entry.js → p-1eb38c2e.entry.js} +1 -1
  153. package/dist/verdocs-web-sdk/{p-50ac71f3.system.entry.js → p-23ff8991.system.entry.js} +1 -1
  154. package/dist/verdocs-web-sdk/{p-409e992a.entry.js → p-2979d6eb.entry.js} +1 -1
  155. package/dist/verdocs-web-sdk/{p-17d0e5f4.entry.js → p-2ec00680.entry.js} +1 -1
  156. package/dist/verdocs-web-sdk/{p-0df58c57.entry.js → p-2ec8a9be.entry.js} +1 -1
  157. package/dist/verdocs-web-sdk/p-32b26f8f.system.entry.js +1 -0
  158. package/dist/verdocs-web-sdk/p-32f1c0a6.entry.js +1 -0
  159. package/dist/verdocs-web-sdk/{p-961708ac.entry.js → p-36f7c8c6.entry.js} +1 -1
  160. package/dist/verdocs-web-sdk/{p-79dc4f76.entry.js → p-38272a03.entry.js} +1 -1
  161. package/dist/verdocs-web-sdk/{p-b73415c3.system.entry.js → p-393a9a2a.system.entry.js} +1 -1
  162. package/dist/verdocs-web-sdk/{p-a310f65b.entry.js → p-3a8c1133.entry.js} +1 -1
  163. package/dist/verdocs-web-sdk/{p-f1257cd0.system.entry.js → p-4aeea02f.system.entry.js} +1 -1
  164. package/dist/verdocs-web-sdk/{p-6bda7dce.entry.js → p-4ddbb290.entry.js} +1 -1
  165. package/dist/verdocs-web-sdk/{p-7b63017c.js → p-571f4e12.js} +1 -1
  166. package/dist/verdocs-web-sdk/{p-4a94ee00.system.entry.js → p-576a4517.system.entry.js} +1 -1
  167. package/dist/verdocs-web-sdk/p-59baf5ed.system.entry.js +1 -0
  168. package/dist/verdocs-web-sdk/{p-ee195e5e.entry.js → p-5c2b1e35.entry.js} +1 -1
  169. package/dist/verdocs-web-sdk/{p-df6a373e.system.entry.js → p-5cce8ddb.system.entry.js} +1 -1
  170. package/dist/verdocs-web-sdk/p-5ed0a61e.system.js +1 -0
  171. package/dist/verdocs-web-sdk/{p-e3a9d167.system.entry.js → p-5f736f85.system.entry.js} +1 -1
  172. package/dist/verdocs-web-sdk/{p-04d7d759.system.entry.js → p-65b96820.system.entry.js} +1 -1
  173. package/dist/verdocs-web-sdk/{p-70a3a6c1.entry.js → p-66b2899b.entry.js} +1 -1
  174. package/dist/verdocs-web-sdk/{p-0f94d635.entry.js → p-686139a0.entry.js} +1 -1
  175. package/dist/verdocs-web-sdk/{p-8da1555a.entry.js → p-764045ab.entry.js} +1 -1
  176. package/dist/verdocs-web-sdk/{p-3a702f79.entry.js → p-7b3fed68.entry.js} +1 -1
  177. package/dist/verdocs-web-sdk/p-7d5dbd9a.js +1 -0
  178. package/dist/verdocs-web-sdk/{p-126ba5d2.system.entry.js → p-7db74d5e.system.entry.js} +1 -1
  179. package/dist/verdocs-web-sdk/p-839f6f0d.js +1 -0
  180. package/dist/verdocs-web-sdk/{p-ace35be6.entry.js → p-853a8c73.entry.js} +1 -1
  181. package/dist/verdocs-web-sdk/{p-01166179.system.entry.js → p-878edeb5.system.entry.js} +1 -1
  182. package/dist/verdocs-web-sdk/{p-89aa696c.system.entry.js → p-8ad78ada.system.entry.js} +1 -1
  183. package/dist/verdocs-web-sdk/{p-6307e6ae.entry.js → p-8b28f85b.entry.js} +1 -1
  184. package/dist/verdocs-web-sdk/{p-3abfff14.entry.js → p-8ceccd53.entry.js} +1 -1
  185. package/dist/verdocs-web-sdk/{p-14aefeb2.system.entry.js → p-8e0d6152.system.entry.js} +1 -1
  186. package/dist/verdocs-web-sdk/{p-1406ffd2.entry.js → p-8f8504e2.entry.js} +1 -1
  187. package/dist/verdocs-web-sdk/p-999fbe79.js +1 -0
  188. package/dist/verdocs-web-sdk/{p-cf765153.entry.js → p-9aff3ff0.entry.js} +1 -1
  189. package/dist/verdocs-web-sdk/{p-a171983b.system.entry.js → p-9b66a84a.system.entry.js} +1 -1
  190. package/dist/verdocs-web-sdk/{p-3f9fbf94.entry.js → p-a7134b10.entry.js} +1 -1
  191. package/dist/verdocs-web-sdk/{p-b17a20b8.entry.js → p-a8533019.entry.js} +1 -1
  192. package/dist/verdocs-web-sdk/{p-a0b02d83.system.entry.js → p-aca795cb.system.entry.js} +1 -1
  193. package/dist/verdocs-web-sdk/{p-a5425a9b.entry.js → p-acac85fc.entry.js} +1 -1
  194. package/dist/verdocs-web-sdk/{p-62f090c7.system.entry.js → p-ad0805b6.system.entry.js} +1 -1
  195. package/dist/verdocs-web-sdk/{p-7805f0e0.entry.js → p-ad18bb44.entry.js} +1 -1
  196. package/dist/verdocs-web-sdk/{p-c694cf93.system.js → p-b0bf091c.system.js} +1 -1
  197. package/dist/verdocs-web-sdk/{p-9b07a2a7.entry.js → p-b10db51e.entry.js} +1 -1
  198. package/dist/verdocs-web-sdk/{p-4f439363.entry.js → p-b2139ec5.entry.js} +1 -1
  199. package/dist/verdocs-web-sdk/{p-343672f5.system.entry.js → p-be083d74.system.entry.js} +1 -1
  200. package/dist/verdocs-web-sdk/{p-37187046.system.entry.js → p-c01196f9.system.entry.js} +1 -1
  201. package/dist/verdocs-web-sdk/{p-2f04fb38.system.entry.js → p-c48b67ab.system.entry.js} +1 -1
  202. package/dist/verdocs-web-sdk/{p-a52a832b.system.entry.js → p-c58916d2.system.entry.js} +1 -1
  203. package/dist/verdocs-web-sdk/{p-eef694e8.entry.js → p-c58e4861.entry.js} +1 -1
  204. package/dist/verdocs-web-sdk/{p-261d376e.system.entry.js → p-c7f6bb1d.system.entry.js} +1 -1
  205. package/dist/verdocs-web-sdk/p-d0865aca.entry.js +1 -0
  206. package/dist/verdocs-web-sdk/p-d8cd6b59.system.js +1 -0
  207. package/dist/verdocs-web-sdk/{p-7b40bf68.system.entry.js → p-dc37ce85.system.entry.js} +1 -1
  208. package/dist/verdocs-web-sdk/{p-39cbfe15.entry.js → p-e4432f87.entry.js} +1 -1
  209. package/dist/verdocs-web-sdk/{p-5df0fa7a.system.entry.js → p-e7481777.system.entry.js} +1 -1
  210. package/dist/verdocs-web-sdk/{p-bb2c866b.system.entry.js → p-ed2d0a49.system.entry.js} +1 -1
  211. package/dist/verdocs-web-sdk/{p-137cedc8.entry.js → p-ed639a7c.entry.js} +1 -1
  212. package/dist/verdocs-web-sdk/{p-a35314fe.js → p-ee159b14.js} +1 -1
  213. package/dist/verdocs-web-sdk/p-f04bf956.system.js +1 -1
  214. package/dist/verdocs-web-sdk/{p-10af7aec.system.entry.js → p-f0b826a2.system.entry.js} +1 -1
  215. package/dist/verdocs-web-sdk/p-f1aa1551.system.entry.js +1 -0
  216. package/dist/verdocs-web-sdk/{p-fde6b724.entry.js → p-f269c7c4.entry.js} +1 -1
  217. package/dist/verdocs-web-sdk/{p-dd8845d4.system.entry.js → p-f83a0c6e.system.entry.js} +1 -1
  218. package/dist/verdocs-web-sdk/{p-eb595245.system.js → p-f83e5b8f.system.js} +1 -1
  219. package/dist/verdocs-web-sdk/{p-0e5449d1.system.entry.js → p-fc6629e5.system.entry.js} +1 -1
  220. package/dist/verdocs-web-sdk/{p-ecf04564.system.entry.js → p-fc94492b.system.entry.js} +1 -1
  221. package/dist/verdocs-web-sdk/p-fcd0a40a.system.js +1 -0
  222. package/dist/verdocs-web-sdk/{p-0ad1fd33.entry.js → p-fff35c6b.entry.js} +1 -1
  223. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  224. package/package.json +7 -6
  225. package/dist/cjs/interact.min-ba5cc513.js +0 -13
  226. package/dist/custom-elements.json +0 -2059
  227. package/dist/esm/Types-de18e225.js +0 -4
  228. package/dist/esm/interact.min-cf83fa88.js +0 -11
  229. package/dist/esm-es5/Types-de18e225.js +0 -1
  230. package/dist/esm-es5/VerdocsEndpoint-b011af25.js +0 -1
  231. package/dist/esm-es5/_commonjsHelpers-5ec8f9b7.js +0 -1
  232. package/dist/esm-es5/interact.min-cf83fa88.js +0 -1
  233. package/dist/verdocs-web-sdk/p-0d28cf05.js +0 -1
  234. package/dist/verdocs-web-sdk/p-15cb963a.system.entry.js +0 -1
  235. package/dist/verdocs-web-sdk/p-30b4bd45.js +0 -1
  236. package/dist/verdocs-web-sdk/p-3305a941.system.js +0 -1
  237. package/dist/verdocs-web-sdk/p-66d66e2b.entry.js +0 -1
  238. package/dist/verdocs-web-sdk/p-7fd7152d.system.js +0 -1
  239. package/dist/verdocs-web-sdk/p-9934f3ec.system.entry.js +0 -1
  240. package/dist/verdocs-web-sdk/p-b2d698f7.system.entry.js +0 -1
  241. package/dist/verdocs-web-sdk/p-bbee73c8.system.js +0 -1
  242. package/dist/verdocs-web-sdk/p-bfcf8ad2.entry.js +0 -1
  243. package/dist/verdocs-web-sdk/p-cbbf849f.system.js +0 -1
  244. package/dist/verdocs-web-sdk/p-de60d3a8.js +0 -1
  245. package/dist/verdocs-web-sdk/p-eab67c09.js +0 -1
@@ -215,10 +215,10 @@ var ALLOWED_CREATE_FIELDS = [
215
215
  * ```typescript
216
216
  * import {Templates} from '@verdocs/js-sdk/Templates';
217
217
  *
218
- * const newTemplate = await Templates.createTemplate((VerdocsEndpoint.getDefault(), {...});
218
+ * const newTemplate = await Templates.createTemplatev2((VerdocsEndpoint.getDefault(), {...});
219
219
  * ```
220
220
  */
221
- var createTemplate = function (endpoint, params, onUploadProgress) {
221
+ var createTemplatev2 = function (endpoint, params, onUploadProgress) {
222
222
  var options = {
223
223
  timeout: 120000,
224
224
  onUploadProgress: function (event) {
@@ -228,22 +228,19 @@ var createTemplate = function (endpoint, params, onUploadProgress) {
228
228
  },
229
229
  };
230
230
  if (params.documents && params.documents[0] instanceof File) {
231
- if (params.documents.length > 10) {
232
- throw new Error('createTemplate() has a maximum of 10 documents that can be attached.');
233
- }
234
- var formData_1 = new FormData();
231
+ var formData_2 = new FormData();
235
232
  ALLOWED_CREATE_FIELDS.forEach(function (allowedKey) {
236
233
  if (params[allowedKey] !== undefined) {
237
- formData_1.append(allowedKey, params[allowedKey]);
234
+ formData_2.append(allowedKey, params[allowedKey]);
238
235
  }
239
236
  });
240
237
  params.documents.forEach(function (file) {
241
- formData_1.append('documents', file, file.name);
238
+ formData_2.append('documents', file, file.name);
242
239
  });
243
- return endpoint.api.post('/templates', formData_1, options).then(function (r) { return r.data; });
240
+ return endpoint.api.post('/v2/templates', formData_2, options).then(function (r) { return r.data; });
244
241
  }
245
242
  else {
246
- return endpoint.api.post('/templates', params, options).then(function (r) { return r.data; });
243
+ return endpoint.api.post('/v2/templates', params, options).then(function (r) { return r.data; });
247
244
  }
248
245
  };
249
246
  /**
@@ -418,277 +415,137 @@ const denyList = new Set([
418
415
  // TODO: Use `error?.code` when targeting Node.js 14
419
416
  var isRetryAllowed = error => !denyList.has(error && error.code);
420
417
 
421
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
422
-
423
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
424
-
425
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
426
-
427
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
428
-
429
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
430
- var namespace = 'axios-retry';
431
- /**
432
- * @param {Error} error
433
- * @return {boolean}
434
- */
435
-
418
+ const namespace = 'axios-retry';
436
419
  function isNetworkError(error) {
437
- return !error.response && Boolean(error.code) && // Prevents retrying cancelled requests
438
- error.code !== 'ECONNABORTED' && // Prevents retrying timed out requests
439
- isRetryAllowed(error); // Prevents retrying unsafe errors
420
+ const CODE_EXCLUDE_LIST = ['ERR_CANCELED', 'ECONNABORTED'];
421
+ if (error.response) {
422
+ return false;
423
+ }
424
+ if (!error.code) {
425
+ return false;
426
+ }
427
+ // Prevents retrying timed out & cancelled requests
428
+ if (CODE_EXCLUDE_LIST.includes(error.code)) {
429
+ return false;
430
+ }
431
+ // Prevents retrying unsafe errors
432
+ return isRetryAllowed(error);
440
433
  }
441
- var SAFE_HTTP_METHODS = ['get', 'head', 'options'];
442
- var IDEMPOTENT_HTTP_METHODS = SAFE_HTTP_METHODS.concat(['put', 'delete']);
443
- /**
444
- * @param {Error} error
445
- * @return {boolean}
446
- */
447
-
434
+ const SAFE_HTTP_METHODS = ['get', 'head', 'options'];
435
+ const IDEMPOTENT_HTTP_METHODS = SAFE_HTTP_METHODS.concat(['put', 'delete']);
448
436
  function isRetryableError(error) {
449
- return error.code !== 'ECONNABORTED' && (!error.response || error.response.status >= 500 && error.response.status <= 599);
437
+ return (error.code !== 'ECONNABORTED' &&
438
+ (!error.response || (error.response.status >= 500 && error.response.status <= 599)));
450
439
  }
451
- /**
452
- * @param {Error} error
453
- * @return {boolean}
454
- */
455
-
456
440
  function isSafeRequestError(error) {
457
- if (!error.config) {
458
- // Cannot determine if the request can be retried
459
- return false;
460
- }
461
-
462
- return isRetryableError(error) && SAFE_HTTP_METHODS.indexOf(error.config.method) !== -1;
441
+ if (!error.config?.method) {
442
+ // Cannot determine if the request can be retried
443
+ return false;
444
+ }
445
+ return isRetryableError(error) && SAFE_HTTP_METHODS.indexOf(error.config.method) !== -1;
463
446
  }
464
- /**
465
- * @param {Error} error
466
- * @return {boolean}
467
- */
468
-
469
447
  function isIdempotentRequestError(error) {
470
- if (!error.config) {
471
- // Cannot determine if the request can be retried
472
- return false;
473
- }
474
-
475
- return isRetryableError(error) && IDEMPOTENT_HTTP_METHODS.indexOf(error.config.method) !== -1;
448
+ if (!error.config?.method) {
449
+ // Cannot determine if the request can be retried
450
+ return false;
451
+ }
452
+ return isRetryableError(error) && IDEMPOTENT_HTTP_METHODS.indexOf(error.config.method) !== -1;
476
453
  }
477
- /**
478
- * @param {Error} error
479
- * @return {boolean}
480
- */
481
-
482
454
  function isNetworkOrIdempotentRequestError(error) {
483
- return isNetworkError(error) || isIdempotentRequestError(error);
455
+ return isNetworkError(error) || isIdempotentRequestError(error);
484
456
  }
485
- /**
486
- * @return {number} - delay in milliseconds, always 0
487
- */
488
-
489
457
  function noDelay() {
490
- return 0;
491
- }
492
- /**
493
- * @param {number} [retryNumber=0]
494
- * @return {number} - delay in milliseconds
495
- */
496
-
497
-
498
- function exponentialDelay() {
499
- var retryNumber = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
500
- var delay = Math.pow(2, retryNumber) * 100;
501
- var randomSum = delay * 0.2 * Math.random(); // 0-20% of the delay
502
-
503
- return delay + randomSum;
458
+ return 0;
504
459
  }
505
- /**
506
- * Initializes and returns the retry state for the given request/config
507
- * @param {AxiosRequestConfig} config
508
- * @return {Object}
509
- */
510
-
511
- function getCurrentState(config) {
512
- var currentState = config[namespace] || {};
513
- currentState.retryCount = currentState.retryCount || 0;
514
- config[namespace] = currentState;
515
- return currentState;
460
+ function exponentialDelay(retryNumber = 0, _error = undefined, delayFactor = 100) {
461
+ const delay = 2 ** retryNumber * delayFactor;
462
+ const randomSum = delay * 0.2 * Math.random(); // 0-20% of the delay
463
+ return delay + randomSum;
516
464
  }
517
- /**
518
- * Returns the axios-retry options for the current request
519
- * @param {AxiosRequestConfig} config
520
- * @param {AxiosRetryConfig} defaultOptions
521
- * @return {AxiosRetryConfig}
522
- */
523
-
524
-
465
+ const DEFAULT_OPTIONS = {
466
+ retries: 3,
467
+ retryCondition: isNetworkOrIdempotentRequestError,
468
+ retryDelay: noDelay,
469
+ shouldResetTimeout: false,
470
+ onRetry: () => { }
471
+ };
525
472
  function getRequestOptions(config, defaultOptions) {
526
- return _objectSpread(_objectSpread({}, defaultOptions), config[namespace]);
473
+ return { ...DEFAULT_OPTIONS, ...defaultOptions, ...config[namespace] };
527
474
  }
528
- /**
529
- * @param {Axios} axios
530
- * @param {AxiosRequestConfig} config
531
- */
532
-
533
-
534
- function fixConfig(axios, config) {
535
- if (axios.defaults.agent === config.agent) {
536
- delete config.agent;
537
- }
538
-
539
- if (axios.defaults.httpAgent === config.httpAgent) {
540
- delete config.httpAgent;
541
- }
542
-
543
- if (axios.defaults.httpsAgent === config.httpsAgent) {
544
- delete config.httpsAgent;
545
- }
475
+ function setCurrentState(config, defaultOptions) {
476
+ const currentState = getRequestOptions(config, defaultOptions || {});
477
+ currentState.retryCount = currentState.retryCount || 0;
478
+ currentState.lastRequestTime = currentState.lastRequestTime || Date.now();
479
+ config[namespace] = currentState;
480
+ return currentState;
546
481
  }
547
- /**
548
- * Checks retryCondition if request can be retried. Handles it's retruning value or Promise.
549
- * @param {number} retries
550
- * @param {Function} retryCondition
551
- * @param {Object} currentState
552
- * @param {Error} error
553
- * @return {boolean}
554
- */
555
-
556
-
557
- function shouldRetry(_x, _x2, _x3, _x4) {
558
- return _shouldRetry.apply(this, arguments);
482
+ function fixConfig(axiosInstance, config) {
483
+ // @ts-ignore
484
+ if (axiosInstance.defaults.agent === config.agent) {
485
+ // @ts-ignore
486
+ delete config.agent;
487
+ }
488
+ if (axiosInstance.defaults.httpAgent === config.httpAgent) {
489
+ delete config.httpAgent;
490
+ }
491
+ if (axiosInstance.defaults.httpsAgent === config.httpsAgent) {
492
+ delete config.httpsAgent;
493
+ }
559
494
  }
560
- /**
561
- * Adds response interceptors to an axios instance to retry requests failed due to network issues
562
- *
563
- * @example
564
- *
565
- * import axios from 'axios';
566
- *
567
- * axiosRetry(axios, { retries: 3 });
568
- *
569
- * axios.get('http://example.com/test') // The first request fails and the second returns 'ok'
570
- * .then(result => {
571
- * result.data; // 'ok'
572
- * });
573
- *
574
- * // Exponential back-off retry delay between requests
575
- * axiosRetry(axios, { retryDelay : axiosRetry.exponentialDelay});
576
- *
577
- * // Custom retry delay
578
- * axiosRetry(axios, { retryDelay : (retryCount) => {
579
- * return retryCount * 1000;
580
- * }});
581
- *
582
- * // Also works with custom axios instances
583
- * const client = axios.create({ baseURL: 'http://example.com' });
584
- * axiosRetry(client, { retries: 3 });
585
- *
586
- * client.get('/test') // The first request fails and the second returns 'ok'
587
- * .then(result => {
588
- * result.data; // 'ok'
589
- * });
590
- *
591
- * // Allows request-specific configuration
592
- * client
593
- * .get('/test', {
594
- * 'axios-retry': {
595
- * retries: 0
596
- * }
597
- * })
598
- * .catch(error => { // The first request fails
599
- * error !== undefined
600
- * });
601
- *
602
- * @param {Axios} axios An axios instance (the axios object or one created from axios.create)
603
- * @param {Object} [defaultOptions]
604
- * @param {number} [defaultOptions.retries=3] Number of retries
605
- * @param {boolean} [defaultOptions.shouldResetTimeout=false]
606
- * Defines if the timeout should be reset between retries
607
- * @param {Function} [defaultOptions.retryCondition=isNetworkOrIdempotentRequestError]
608
- * A function to determine if the error can be retried
609
- * @param {Function} [defaultOptions.retryDelay=noDelay]
610
- * A function to determine the delay between retry requests
611
- * @param {Function} [defaultOptions.onRetry=()=>{}]
612
- * A function to get notified when a retry occurs
613
- */
614
-
615
-
616
- function _shouldRetry() {
617
- _shouldRetry = _asyncToGenerator(function* (retries, retryCondition, currentState, error) {
618
- var shouldRetryOrPromise = currentState.retryCount < retries && retryCondition(error); // This could be a promise
619
-
495
+ async function shouldRetry(currentState, error) {
496
+ const { retries, retryCondition } = currentState;
497
+ const shouldRetryOrPromise = (currentState.retryCount || 0) < retries && retryCondition(error);
498
+ // This could be a promise
620
499
  if (typeof shouldRetryOrPromise === 'object') {
621
- try {
622
- var shouldRetryPromiseResult = yield shouldRetryOrPromise; // keep return true unless shouldRetryPromiseResult return false for compatibility
623
-
624
- return shouldRetryPromiseResult !== false;
625
- } catch (_err) {
626
- return false;
627
- }
500
+ try {
501
+ const shouldRetryPromiseResult = await shouldRetryOrPromise;
502
+ // keep return true unless shouldRetryPromiseResult return false for compatibility
503
+ return shouldRetryPromiseResult !== false;
504
+ }
505
+ catch (_err) {
506
+ return false;
507
+ }
628
508
  }
629
-
630
509
  return shouldRetryOrPromise;
631
- });
632
- return _shouldRetry.apply(this, arguments);
633
510
  }
634
-
635
- function axiosRetry(axios, defaultOptions) {
636
- axios.interceptors.request.use(config => {
637
- var currentState = getCurrentState(config);
638
- currentState.lastRequestTime = Date.now();
639
- return config;
640
- });
641
- axios.interceptors.response.use(null, /*#__PURE__*/function () {
642
- var _ref = _asyncToGenerator(function* (error) {
643
- var {
644
- config
645
- } = error; // If we have no information to retry the request
646
-
647
- if (!config) {
648
- return Promise.reject(error);
649
- }
650
-
651
- var {
652
- retries = 3,
653
- retryCondition = isNetworkOrIdempotentRequestError,
654
- retryDelay = noDelay,
655
- shouldResetTimeout = false,
656
- onRetry = () => {}
657
- } = getRequestOptions(config, defaultOptions);
658
- var currentState = getCurrentState(config);
659
-
660
- if (yield shouldRetry(retries, retryCondition, currentState, error)) {
661
- currentState.retryCount += 1;
662
- var delay = retryDelay(currentState.retryCount, error); // Axios fails merging this configuration to the default configuration because it has an issue
663
- // with circular structures: https://github.com/mzabriskie/axios/issues/370
664
-
665
- fixConfig(axios, config);
666
-
667
- if (!shouldResetTimeout && config.timeout && currentState.lastRequestTime) {
668
- var lastRequestDuration = Date.now() - currentState.lastRequestTime;
669
- var timeout = config.timeout - lastRequestDuration - delay;
670
-
671
- if (timeout <= 0) {
511
+ const axiosRetry = (axiosInstance, defaultOptions) => {
512
+ const requestInterceptorId = axiosInstance.interceptors.request.use((config) => {
513
+ setCurrentState(config, defaultOptions);
514
+ return config;
515
+ });
516
+ const responseInterceptorId = axiosInstance.interceptors.response.use(null, async (error) => {
517
+ const { config } = error;
518
+ // If we have no information to retry the request
519
+ if (!config) {
672
520
  return Promise.reject(error);
673
- }
674
-
675
- config.timeout = timeout;
676
521
  }
677
-
678
- config.transformRequest = [data => data];
679
- onRetry(currentState.retryCount, error, config);
680
- return new Promise(resolve => setTimeout(() => resolve(axios(config)), delay));
681
- }
682
-
683
- return Promise.reject(error);
522
+ const currentState = setCurrentState(config, defaultOptions);
523
+ if (await shouldRetry(currentState, error)) {
524
+ currentState.retryCount += 1;
525
+ const { retryDelay, shouldResetTimeout, onRetry } = currentState;
526
+ const delay = retryDelay(currentState.retryCount, error);
527
+ // Axios fails merging this configuration to the default configuration because it has an issue
528
+ // with circular structures: https://github.com/mzabriskie/axios/issues/370
529
+ fixConfig(axiosInstance, config);
530
+ if (!shouldResetTimeout && config.timeout && currentState.lastRequestTime) {
531
+ const lastRequestDuration = Date.now() - currentState.lastRequestTime;
532
+ const timeout = config.timeout - lastRequestDuration - delay;
533
+ if (timeout <= 0) {
534
+ return Promise.reject(error);
535
+ }
536
+ config.timeout = timeout;
537
+ }
538
+ config.transformRequest = [(data) => data];
539
+ await onRetry(currentState.retryCount, error, config);
540
+ return new Promise((resolve) => {
541
+ setTimeout(() => resolve(axiosInstance(config)), delay);
542
+ });
543
+ }
544
+ return Promise.reject(error);
684
545
  });
685
-
686
- return function (_x5) {
687
- return _ref.apply(this, arguments);
688
- };
689
- }());
690
- } // Compatibility with CommonJS
691
-
546
+ return { requestInterceptorId, responseInterceptorId };
547
+ };
548
+ // Compatibility with CommonJS
692
549
  axiosRetry.isNetworkError = isNetworkError;
693
550
  axiosRetry.isSafeRequestError = isSafeRequestError;
694
551
  axiosRetry.isIdempotentRequestError = isIdempotentRequestError;
@@ -1368,7 +1225,7 @@ const isAsyncFn = kindOfTest('AsyncFunction');
1368
1225
  const isThenable = (thing) =>
1369
1226
  thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
1370
1227
 
1371
- const utils = {
1228
+ const utils$1 = {
1372
1229
  isArray,
1373
1230
  isArrayBuffer,
1374
1231
  isBuffer,
@@ -1450,7 +1307,7 @@ function AxiosError(message, code, config, request, response) {
1450
1307
  response && (this.response = response);
1451
1308
  }
1452
1309
 
1453
- utils.inherits(AxiosError, Error, {
1310
+ utils$1.inherits(AxiosError, Error, {
1454
1311
  toJSON: function toJSON() {
1455
1312
  return {
1456
1313
  // Standard
@@ -1465,7 +1322,7 @@ utils.inherits(AxiosError, Error, {
1465
1322
  columnNumber: this.columnNumber,
1466
1323
  stack: this.stack,
1467
1324
  // Axios
1468
- config: utils.toJSONObject(this.config),
1325
+ config: utils$1.toJSONObject(this.config),
1469
1326
  code: this.code,
1470
1327
  status: this.response && this.response.status ? this.response.status : null
1471
1328
  };
@@ -1500,7 +1357,7 @@ Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
1500
1357
  AxiosError.from = (error, code, config, request, response, customProps) => {
1501
1358
  const axiosError = Object.create(prototype$1);
1502
1359
 
1503
- utils.toFlatObject(error, axiosError, function filter(obj) {
1360
+ utils$1.toFlatObject(error, axiosError, function filter(obj) {
1504
1361
  return obj !== Error.prototype;
1505
1362
  }, prop => {
1506
1363
  return prop !== 'isAxiosError';
@@ -1528,7 +1385,7 @@ const httpAdapter = null;
1528
1385
  * @returns {boolean}
1529
1386
  */
1530
1387
  function isVisitable(thing) {
1531
- return utils.isPlainObject(thing) || utils.isArray(thing);
1388
+ return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
1532
1389
  }
1533
1390
 
1534
1391
  /**
@@ -1539,7 +1396,7 @@ function isVisitable(thing) {
1539
1396
  * @returns {string} the key without the brackets.
1540
1397
  */
1541
1398
  function removeBrackets(key) {
1542
- return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;
1399
+ return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
1543
1400
  }
1544
1401
 
1545
1402
  /**
@@ -1568,10 +1425,10 @@ function renderKey(path, key, dots) {
1568
1425
  * @returns {boolean}
1569
1426
  */
1570
1427
  function isFlatArray(arr) {
1571
- return utils.isArray(arr) && !arr.some(isVisitable);
1428
+ return utils$1.isArray(arr) && !arr.some(isVisitable);
1572
1429
  }
1573
1430
 
1574
- const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
1431
+ const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
1575
1432
  return /^is[A-Z]/.test(prop);
1576
1433
  });
1577
1434
 
@@ -1599,7 +1456,7 @@ const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
1599
1456
  * @returns
1600
1457
  */
1601
1458
  function toFormData(obj, formData, options) {
1602
- if (!utils.isObject(obj)) {
1459
+ if (!utils$1.isObject(obj)) {
1603
1460
  throw new TypeError('target must be an object');
1604
1461
  }
1605
1462
 
@@ -1607,13 +1464,13 @@ function toFormData(obj, formData, options) {
1607
1464
  formData = formData || new (FormData)();
1608
1465
 
1609
1466
  // eslint-disable-next-line no-param-reassign
1610
- options = utils.toFlatObject(options, {
1467
+ options = utils$1.toFlatObject(options, {
1611
1468
  metaTokens: true,
1612
1469
  dots: false,
1613
1470
  indexes: false
1614
1471
  }, false, function defined(option, source) {
1615
1472
  // eslint-disable-next-line no-eq-null,eqeqeq
1616
- return !utils.isUndefined(source[option]);
1473
+ return !utils$1.isUndefined(source[option]);
1617
1474
  });
1618
1475
 
1619
1476
  const metaTokens = options.metaTokens;
@@ -1622,24 +1479,24 @@ function toFormData(obj, formData, options) {
1622
1479
  const dots = options.dots;
1623
1480
  const indexes = options.indexes;
1624
1481
  const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
1625
- const useBlob = _Blob && utils.isSpecCompliantForm(formData);
1482
+ const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
1626
1483
 
1627
- if (!utils.isFunction(visitor)) {
1484
+ if (!utils$1.isFunction(visitor)) {
1628
1485
  throw new TypeError('visitor must be a function');
1629
1486
  }
1630
1487
 
1631
1488
  function convertValue(value) {
1632
1489
  if (value === null) return '';
1633
1490
 
1634
- if (utils.isDate(value)) {
1491
+ if (utils$1.isDate(value)) {
1635
1492
  return value.toISOString();
1636
1493
  }
1637
1494
 
1638
- if (!useBlob && utils.isBlob(value)) {
1495
+ if (!useBlob && utils$1.isBlob(value)) {
1639
1496
  throw new AxiosError('Blob is not supported. Use a Buffer instead.');
1640
1497
  }
1641
1498
 
1642
- if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
1499
+ if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
1643
1500
  return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
1644
1501
  }
1645
1502
 
@@ -1660,20 +1517,20 @@ function toFormData(obj, formData, options) {
1660
1517
  let arr = value;
1661
1518
 
1662
1519
  if (value && !path && typeof value === 'object') {
1663
- if (utils.endsWith(key, '{}')) {
1520
+ if (utils$1.endsWith(key, '{}')) {
1664
1521
  // eslint-disable-next-line no-param-reassign
1665
1522
  key = metaTokens ? key : key.slice(0, -2);
1666
1523
  // eslint-disable-next-line no-param-reassign
1667
1524
  value = JSON.stringify(value);
1668
1525
  } else if (
1669
- (utils.isArray(value) && isFlatArray(value)) ||
1670
- ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))
1526
+ (utils$1.isArray(value) && isFlatArray(value)) ||
1527
+ ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
1671
1528
  )) {
1672
1529
  // eslint-disable-next-line no-param-reassign
1673
1530
  key = removeBrackets(key);
1674
1531
 
1675
1532
  arr.forEach(function each(el, index) {
1676
- !(utils.isUndefined(el) || el === null) && formData.append(
1533
+ !(utils$1.isUndefined(el) || el === null) && formData.append(
1677
1534
  // eslint-disable-next-line no-nested-ternary
1678
1535
  indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
1679
1536
  convertValue(el)
@@ -1701,7 +1558,7 @@ function toFormData(obj, formData, options) {
1701
1558
  });
1702
1559
 
1703
1560
  function build(value, path) {
1704
- if (utils.isUndefined(value)) return;
1561
+ if (utils$1.isUndefined(value)) return;
1705
1562
 
1706
1563
  if (stack.indexOf(value) !== -1) {
1707
1564
  throw Error('Circular reference detected in ' + path.join('.'));
@@ -1709,9 +1566,9 @@ function toFormData(obj, formData, options) {
1709
1566
 
1710
1567
  stack.push(value);
1711
1568
 
1712
- utils.forEach(value, function each(el, key) {
1713
- const result = !(utils.isUndefined(el) || el === null) && visitor.call(
1714
- formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers
1569
+ utils$1.forEach(value, function each(el, key) {
1570
+ const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
1571
+ formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers
1715
1572
  );
1716
1573
 
1717
1574
  if (result === true) {
@@ -1722,7 +1579,7 @@ function toFormData(obj, formData, options) {
1722
1579
  stack.pop();
1723
1580
  }
1724
1581
 
1725
- if (!utils.isObject(obj)) {
1582
+ if (!utils$1.isObject(obj)) {
1726
1583
  throw new TypeError('data must be an object');
1727
1584
  }
1728
1585
 
@@ -1826,7 +1683,7 @@ function buildURL(url, params, options) {
1826
1683
  if (serializeFn) {
1827
1684
  serializedParams = serializeFn(params, options);
1828
1685
  } else {
1829
- serializedParams = utils.isURLSearchParams(params) ?
1686
+ serializedParams = utils$1.isURLSearchParams(params) ?
1830
1687
  params.toString() :
1831
1688
  new AxiosURLSearchParams(params, options).toString(_encode);
1832
1689
  }
@@ -1901,7 +1758,7 @@ class InterceptorManager {
1901
1758
  * @returns {void}
1902
1759
  */
1903
1760
  forEach(fn) {
1904
- utils.forEach(this.handlers, function forEachHandler(h) {
1761
+ utils$1.forEach(this.handlers, function forEachHandler(h) {
1905
1762
  if (h !== null) {
1906
1763
  fn(h);
1907
1764
  }
@@ -1921,6 +1778,18 @@ const FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
1921
1778
 
1922
1779
  const Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
1923
1780
 
1781
+ const platform$1 = {
1782
+ isBrowser: true,
1783
+ classes: {
1784
+ URLSearchParams: URLSearchParams$1,
1785
+ FormData: FormData$1,
1786
+ Blob: Blob$1
1787
+ },
1788
+ protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
1789
+ };
1790
+
1791
+ const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
1792
+
1924
1793
  /**
1925
1794
  * Determine if we're running in a standard browser environment
1926
1795
  *
@@ -1938,18 +1807,10 @@ const Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
1938
1807
  *
1939
1808
  * @returns {boolean}
1940
1809
  */
1941
- const isStandardBrowserEnv = (() => {
1942
- let product;
1943
- if (typeof navigator !== 'undefined' && (
1944
- (product = navigator.product) === 'ReactNative' ||
1945
- product === 'NativeScript' ||
1946
- product === 'NS')
1947
- ) {
1948
- return false;
1949
- }
1950
-
1951
- return typeof window !== 'undefined' && typeof document !== 'undefined';
1952
- })();
1810
+ const hasStandardBrowserEnv = (
1811
+ (product) => {
1812
+ return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
1813
+ })(typeof navigator !== 'undefined' && navigator.product);
1953
1814
 
1954
1815
  /**
1955
1816
  * Determine if we're running in a standard browser webWorker environment
@@ -1960,7 +1821,7 @@ const isStandardBrowserEnv = (() => {
1960
1821
  * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
1961
1822
  * This leads to a problem when axios post `FormData` in webWorker
1962
1823
  */
1963
- const isStandardBrowserWebWorkerEnv = (() => {
1824
+ const hasStandardBrowserWebWorkerEnv = (() => {
1964
1825
  return (
1965
1826
  typeof WorkerGlobalScope !== 'undefined' &&
1966
1827
  // eslint-disable-next-line no-undef
@@ -1969,22 +1830,25 @@ const isStandardBrowserEnv = (() => {
1969
1830
  );
1970
1831
  })();
1971
1832
 
1833
+ const utils = /*#__PURE__*/Object.freeze({
1834
+ __proto__: null,
1835
+ hasBrowserEnv: hasBrowserEnv,
1836
+ hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
1837
+ hasStandardBrowserEnv: hasStandardBrowserEnv
1838
+ });
1972
1839
 
1973
1840
  const platform = {
1974
- isBrowser: true,
1975
- classes: {
1976
- URLSearchParams: URLSearchParams$1,
1977
- FormData: FormData$1,
1978
- Blob: Blob$1
1979
- },
1980
- isStandardBrowserEnv,
1981
- isStandardBrowserWebWorkerEnv,
1982
- protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
1841
+ ...utils,
1842
+ ...platform$1
1983
1843
  };
1984
1844
 
1985
1845
  function toURLEncodedForm(data, options) {
1986
1846
  return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
1987
1847
  visitor: function(value, key, path, helpers) {
1848
+ if (platform.isNode && utils$1.isBuffer(value)) {
1849
+ this.append(key, value.toString('base64'));
1850
+ return false;
1851
+ }
1988
1852
 
1989
1853
  return helpers.defaultVisitor.apply(this, arguments);
1990
1854
  }
@@ -2003,7 +1867,7 @@ function parsePropPath(name) {
2003
1867
  // foo.x.y.z
2004
1868
  // foo-x-y-z
2005
1869
  // foo x y z
2006
- return utils.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
1870
+ return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
2007
1871
  return match[0] === '[]' ? '' : match[1] || match[0];
2008
1872
  });
2009
1873
  }
@@ -2040,10 +1904,10 @@ function formDataToJSON(formData) {
2040
1904
  let name = path[index++];
2041
1905
  const isNumericKey = Number.isFinite(+name);
2042
1906
  const isLast = index >= path.length;
2043
- name = !name && utils.isArray(target) ? target.length : name;
1907
+ name = !name && utils$1.isArray(target) ? target.length : name;
2044
1908
 
2045
1909
  if (isLast) {
2046
- if (utils.hasOwnProp(target, name)) {
1910
+ if (utils$1.hasOwnProp(target, name)) {
2047
1911
  target[name] = [target[name], value];
2048
1912
  } else {
2049
1913
  target[name] = value;
@@ -2052,23 +1916,23 @@ function formDataToJSON(formData) {
2052
1916
  return !isNumericKey;
2053
1917
  }
2054
1918
 
2055
- if (!target[name] || !utils.isObject(target[name])) {
1919
+ if (!target[name] || !utils$1.isObject(target[name])) {
2056
1920
  target[name] = [];
2057
1921
  }
2058
1922
 
2059
1923
  const result = buildPath(path, value, target[name], index);
2060
1924
 
2061
- if (result && utils.isArray(target[name])) {
1925
+ if (result && utils$1.isArray(target[name])) {
2062
1926
  target[name] = arrayToObject(target[name]);
2063
1927
  }
2064
1928
 
2065
1929
  return !isNumericKey;
2066
1930
  }
2067
1931
 
2068
- if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {
1932
+ if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
2069
1933
  const obj = {};
2070
1934
 
2071
- utils.forEachEntry(formData, (name, value) => {
1935
+ utils$1.forEachEntry(formData, (name, value) => {
2072
1936
  buildPath(parsePropPath(name), value, obj, 0);
2073
1937
  });
2074
1938
 
@@ -2089,10 +1953,10 @@ function formDataToJSON(formData) {
2089
1953
  * @returns {string} A stringified version of the rawValue.
2090
1954
  */
2091
1955
  function stringifySafely(rawValue, parser, encoder) {
2092
- if (utils.isString(rawValue)) {
1956
+ if (utils$1.isString(rawValue)) {
2093
1957
  try {
2094
1958
  (parser || JSON.parse)(rawValue);
2095
- return utils.trim(rawValue);
1959
+ return utils$1.trim(rawValue);
2096
1960
  } catch (e) {
2097
1961
  if (e.name !== 'SyntaxError') {
2098
1962
  throw e;
@@ -2112,13 +1976,13 @@ const defaults = {
2112
1976
  transformRequest: [function transformRequest(data, headers) {
2113
1977
  const contentType = headers.getContentType() || '';
2114
1978
  const hasJSONContentType = contentType.indexOf('application/json') > -1;
2115
- const isObjectPayload = utils.isObject(data);
1979
+ const isObjectPayload = utils$1.isObject(data);
2116
1980
 
2117
- if (isObjectPayload && utils.isHTMLForm(data)) {
1981
+ if (isObjectPayload && utils$1.isHTMLForm(data)) {
2118
1982
  data = new FormData(data);
2119
1983
  }
2120
1984
 
2121
- const isFormData = utils.isFormData(data);
1985
+ const isFormData = utils$1.isFormData(data);
2122
1986
 
2123
1987
  if (isFormData) {
2124
1988
  if (!hasJSONContentType) {
@@ -2127,18 +1991,18 @@ const defaults = {
2127
1991
  return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
2128
1992
  }
2129
1993
 
2130
- if (utils.isArrayBuffer(data) ||
2131
- utils.isBuffer(data) ||
2132
- utils.isStream(data) ||
2133
- utils.isFile(data) ||
2134
- utils.isBlob(data)
1994
+ if (utils$1.isArrayBuffer(data) ||
1995
+ utils$1.isBuffer(data) ||
1996
+ utils$1.isStream(data) ||
1997
+ utils$1.isFile(data) ||
1998
+ utils$1.isBlob(data)
2135
1999
  ) {
2136
2000
  return data;
2137
2001
  }
2138
- if (utils.isArrayBufferView(data)) {
2002
+ if (utils$1.isArrayBufferView(data)) {
2139
2003
  return data.buffer;
2140
2004
  }
2141
- if (utils.isURLSearchParams(data)) {
2005
+ if (utils$1.isURLSearchParams(data)) {
2142
2006
  headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
2143
2007
  return data.toString();
2144
2008
  }
@@ -2150,7 +2014,7 @@ const defaults = {
2150
2014
  return toURLEncodedForm(data, this.formSerializer).toString();
2151
2015
  }
2152
2016
 
2153
- if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
2017
+ if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
2154
2018
  const _FormData = this.env && this.env.FormData;
2155
2019
 
2156
2020
  return toFormData(
@@ -2174,7 +2038,7 @@ const defaults = {
2174
2038
  const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
2175
2039
  const JSONRequested = this.responseType === 'json';
2176
2040
 
2177
- if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
2041
+ if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
2178
2042
  const silentJSONParsing = transitional && transitional.silentJSONParsing;
2179
2043
  const strictJSONParsing = !silentJSONParsing && JSONRequested;
2180
2044
 
@@ -2222,13 +2086,13 @@ const defaults = {
2222
2086
  }
2223
2087
  };
2224
2088
 
2225
- utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
2089
+ utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
2226
2090
  defaults.headers[method] = {};
2227
2091
  });
2228
2092
 
2229
2093
  // RawAxiosHeaders whose duplicates are ignored by node
2230
2094
  // c.f. https://nodejs.org/api/http.html#http_message_headers
2231
- const ignoreDuplicateOf = utils.toObjectSet([
2095
+ const ignoreDuplicateOf = utils$1.toObjectSet([
2232
2096
  'age', 'authorization', 'content-length', 'content-type', 'etag',
2233
2097
  'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
2234
2098
  'last-modified', 'location', 'max-forwards', 'proxy-authorization',
@@ -2289,7 +2153,7 @@ function normalizeValue(value) {
2289
2153
  return value;
2290
2154
  }
2291
2155
 
2292
- return utils.isArray(value) ? value.map(normalizeValue) : String(value);
2156
+ return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
2293
2157
  }
2294
2158
 
2295
2159
  function parseTokens(str) {
@@ -2307,7 +2171,7 @@ function parseTokens(str) {
2307
2171
  const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
2308
2172
 
2309
2173
  function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
2310
- if (utils.isFunction(filter)) {
2174
+ if (utils$1.isFunction(filter)) {
2311
2175
  return filter.call(this, value, header);
2312
2176
  }
2313
2177
 
@@ -2315,13 +2179,13 @@ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
2315
2179
  value = header;
2316
2180
  }
2317
2181
 
2318
- if (!utils.isString(value)) return;
2182
+ if (!utils$1.isString(value)) return;
2319
2183
 
2320
- if (utils.isString(filter)) {
2184
+ if (utils$1.isString(filter)) {
2321
2185
  return value.indexOf(filter) !== -1;
2322
2186
  }
2323
2187
 
2324
- if (utils.isRegExp(filter)) {
2188
+ if (utils$1.isRegExp(filter)) {
2325
2189
  return filter.test(value);
2326
2190
  }
2327
2191
  }
@@ -2334,7 +2198,7 @@ function formatHeader(header) {
2334
2198
  }
2335
2199
 
2336
2200
  function buildAccessors(obj, header) {
2337
- const accessorName = utils.toCamelCase(' ' + header);
2201
+ const accessorName = utils$1.toCamelCase(' ' + header);
2338
2202
 
2339
2203
  ['get', 'set', 'has'].forEach(methodName => {
2340
2204
  Object.defineProperty(obj, methodName + accessorName, {
@@ -2361,7 +2225,7 @@ class AxiosHeaders {
2361
2225
  throw new Error('header name must be a non-empty string');
2362
2226
  }
2363
2227
 
2364
- const key = utils.findKey(self, lHeader);
2228
+ const key = utils$1.findKey(self, lHeader);
2365
2229
 
2366
2230
  if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
2367
2231
  self[key || _header] = normalizeValue(_value);
@@ -2369,11 +2233,11 @@ class AxiosHeaders {
2369
2233
  }
2370
2234
 
2371
2235
  const setHeaders = (headers, _rewrite) =>
2372
- utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
2236
+ utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
2373
2237
 
2374
- if (utils.isPlainObject(header) || header instanceof this.constructor) {
2238
+ if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
2375
2239
  setHeaders(header, valueOrRewrite);
2376
- } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
2240
+ } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
2377
2241
  setHeaders(parseHeaders(header), valueOrRewrite);
2378
2242
  } else {
2379
2243
  header != null && setHeader(valueOrRewrite, header, rewrite);
@@ -2386,7 +2250,7 @@ class AxiosHeaders {
2386
2250
  header = normalizeHeader(header);
2387
2251
 
2388
2252
  if (header) {
2389
- const key = utils.findKey(this, header);
2253
+ const key = utils$1.findKey(this, header);
2390
2254
 
2391
2255
  if (key) {
2392
2256
  const value = this[key];
@@ -2399,11 +2263,11 @@ class AxiosHeaders {
2399
2263
  return parseTokens(value);
2400
2264
  }
2401
2265
 
2402
- if (utils.isFunction(parser)) {
2266
+ if (utils$1.isFunction(parser)) {
2403
2267
  return parser.call(this, value, key);
2404
2268
  }
2405
2269
 
2406
- if (utils.isRegExp(parser)) {
2270
+ if (utils$1.isRegExp(parser)) {
2407
2271
  return parser.exec(value);
2408
2272
  }
2409
2273
 
@@ -2416,7 +2280,7 @@ class AxiosHeaders {
2416
2280
  header = normalizeHeader(header);
2417
2281
 
2418
2282
  if (header) {
2419
- const key = utils.findKey(this, header);
2283
+ const key = utils$1.findKey(this, header);
2420
2284
 
2421
2285
  return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
2422
2286
  }
@@ -2432,7 +2296,7 @@ class AxiosHeaders {
2432
2296
  _header = normalizeHeader(_header);
2433
2297
 
2434
2298
  if (_header) {
2435
- const key = utils.findKey(self, _header);
2299
+ const key = utils$1.findKey(self, _header);
2436
2300
 
2437
2301
  if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
2438
2302
  delete self[key];
@@ -2442,7 +2306,7 @@ class AxiosHeaders {
2442
2306
  }
2443
2307
  }
2444
2308
 
2445
- if (utils.isArray(header)) {
2309
+ if (utils$1.isArray(header)) {
2446
2310
  header.forEach(deleteHeader);
2447
2311
  } else {
2448
2312
  deleteHeader(header);
@@ -2471,8 +2335,8 @@ class AxiosHeaders {
2471
2335
  const self = this;
2472
2336
  const headers = {};
2473
2337
 
2474
- utils.forEach(this, (value, header) => {
2475
- const key = utils.findKey(headers, header);
2338
+ utils$1.forEach(this, (value, header) => {
2339
+ const key = utils$1.findKey(headers, header);
2476
2340
 
2477
2341
  if (key) {
2478
2342
  self[key] = normalizeValue(value);
@@ -2501,8 +2365,8 @@ class AxiosHeaders {
2501
2365
  toJSON(asStrings) {
2502
2366
  const obj = Object.create(null);
2503
2367
 
2504
- utils.forEach(this, (value, header) => {
2505
- value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);
2368
+ utils$1.forEach(this, (value, header) => {
2369
+ value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
2506
2370
  });
2507
2371
 
2508
2372
  return obj;
@@ -2549,7 +2413,7 @@ class AxiosHeaders {
2549
2413
  }
2550
2414
  }
2551
2415
 
2552
- utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
2416
+ utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
2553
2417
 
2554
2418
  return this;
2555
2419
  }
@@ -2558,7 +2422,7 @@ class AxiosHeaders {
2558
2422
  AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
2559
2423
 
2560
2424
  // reserved names hotfix
2561
- utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
2425
+ utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
2562
2426
  let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
2563
2427
  return {
2564
2428
  get: () => value,
@@ -2568,7 +2432,7 @@ utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
2568
2432
  }
2569
2433
  });
2570
2434
 
2571
- utils.freezeMethods(AxiosHeaders);
2435
+ utils$1.freezeMethods(AxiosHeaders);
2572
2436
 
2573
2437
  /**
2574
2438
  * Transform the data for a request or a response
@@ -2584,7 +2448,7 @@ function transformData(fns, response) {
2584
2448
  const headers = AxiosHeaders.from(context.headers);
2585
2449
  let data = context.data;
2586
2450
 
2587
- utils.forEach(fns, function transform(fn) {
2451
+ utils$1.forEach(fns, function transform(fn) {
2588
2452
  data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
2589
2453
  });
2590
2454
 
@@ -2612,7 +2476,7 @@ function CanceledError(message, config, request) {
2612
2476
  this.name = 'CanceledError';
2613
2477
  }
2614
2478
 
2615
- utils.inherits(CanceledError, AxiosError, {
2479
+ utils$1.inherits(CanceledError, AxiosError, {
2616
2480
  __CANCEL__: true
2617
2481
  });
2618
2482
 
@@ -2640,53 +2504,44 @@ function settle(resolve, reject, response) {
2640
2504
  }
2641
2505
  }
2642
2506
 
2643
- const cookies = platform.isStandardBrowserEnv ?
2507
+ const cookies = platform.hasStandardBrowserEnv ?
2644
2508
 
2645
- // Standard browser envs support document.cookie
2646
- (function standardBrowserEnv() {
2647
- return {
2648
- write: function write(name, value, expires, path, domain, secure) {
2649
- const cookie = [];
2650
- cookie.push(name + '=' + encodeURIComponent(value));
2509
+ // Standard browser envs support document.cookie
2510
+ {
2511
+ write(name, value, expires, path, domain, secure) {
2512
+ const cookie = [name + '=' + encodeURIComponent(value)];
2651
2513
 
2652
- if (utils.isNumber(expires)) {
2653
- cookie.push('expires=' + new Date(expires).toGMTString());
2654
- }
2514
+ utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
2655
2515
 
2656
- if (utils.isString(path)) {
2657
- cookie.push('path=' + path);
2658
- }
2516
+ utils$1.isString(path) && cookie.push('path=' + path);
2659
2517
 
2660
- if (utils.isString(domain)) {
2661
- cookie.push('domain=' + domain);
2662
- }
2518
+ utils$1.isString(domain) && cookie.push('domain=' + domain);
2663
2519
 
2664
- if (secure === true) {
2665
- cookie.push('secure');
2666
- }
2520
+ secure === true && cookie.push('secure');
2667
2521
 
2668
- document.cookie = cookie.join('; ');
2669
- },
2522
+ document.cookie = cookie.join('; ');
2523
+ },
2670
2524
 
2671
- read: function read(name) {
2672
- const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
2673
- return (match ? decodeURIComponent(match[3]) : null);
2674
- },
2525
+ read(name) {
2526
+ const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
2527
+ return (match ? decodeURIComponent(match[3]) : null);
2528
+ },
2675
2529
 
2676
- remove: function remove(name) {
2677
- this.write(name, '', Date.now() - 86400000);
2678
- }
2679
- };
2680
- })() :
2530
+ remove(name) {
2531
+ this.write(name, '', Date.now() - 86400000);
2532
+ }
2533
+ }
2681
2534
 
2682
- // Non standard browser env (web workers, react-native) lack needed support.
2683
- (function nonStandardBrowserEnv() {
2684
- return {
2685
- write: function write() {},
2686
- read: function read() { return null; },
2687
- remove: function remove() {}
2688
- };
2689
- })();
2535
+ :
2536
+
2537
+ // Non-standard browser env (web workers, react-native) lack needed support.
2538
+ {
2539
+ write() {},
2540
+ read() {
2541
+ return null;
2542
+ },
2543
+ remove() {}
2544
+ };
2690
2545
 
2691
2546
  /**
2692
2547
  * Determines whether the specified URL is absolute
@@ -2733,7 +2588,7 @@ function buildFullPath(baseURL, requestedURL) {
2733
2588
  return requestedURL;
2734
2589
  }
2735
2590
 
2736
- const isURLSameOrigin = platform.isStandardBrowserEnv ?
2591
+ const isURLSameOrigin = platform.hasStandardBrowserEnv ?
2737
2592
 
2738
2593
  // Standard browser envs have full support of the APIs needed to test
2739
2594
  // whether the request URL is of the same origin as current location.
@@ -2743,7 +2598,7 @@ const isURLSameOrigin = platform.isStandardBrowserEnv ?
2743
2598
  let originURL;
2744
2599
 
2745
2600
  /**
2746
- * Parse a URL to discover it's components
2601
+ * Parse a URL to discover its components
2747
2602
  *
2748
2603
  * @param {String} url The URL to be parsed
2749
2604
  * @returns {Object}
@@ -2783,7 +2638,7 @@ const isURLSameOrigin = platform.isStandardBrowserEnv ?
2783
2638
  * @returns {boolean} True if URL shares the same origin, otherwise false
2784
2639
  */
2785
2640
  return function isURLSameOrigin(requestURL) {
2786
- const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
2641
+ const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
2787
2642
  return (parsed.protocol === originURL.protocol &&
2788
2643
  parsed.host === originURL.host);
2789
2644
  };
@@ -2888,7 +2743,7 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
2888
2743
  return new Promise(function dispatchXhrRequest(resolve, reject) {
2889
2744
  let requestData = config.data;
2890
2745
  const requestHeaders = AxiosHeaders.from(config.headers).normalize();
2891
- const responseType = config.responseType;
2746
+ let {responseType, withXSRFToken} = config;
2892
2747
  let onCanceled;
2893
2748
  function done() {
2894
2749
  if (config.cancelToken) {
@@ -2902,14 +2757,13 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
2902
2757
 
2903
2758
  let contentType;
2904
2759
 
2905
- if (utils.isFormData(requestData)) {
2906
- if (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv) {
2760
+ if (utils$1.isFormData(requestData)) {
2761
+ if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
2907
2762
  requestHeaders.setContentType(false); // Let the browser set it
2908
- } else if(!requestHeaders.getContentType(/^\s*multipart\/form-data/)){
2909
- requestHeaders.setContentType('multipart/form-data'); // mobile/desktop app frameworks
2910
- } else if(utils.isString(contentType = requestHeaders.getContentType())){
2763
+ } else if ((contentType = requestHeaders.getContentType()) !== false) {
2911
2764
  // fix semicolon duplication issue for ReactNative FormData implementation
2912
- requestHeaders.setContentType(contentType.replace(/^\s*(multipart\/form-data);+/, '$1'));
2765
+ const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
2766
+ requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
2913
2767
  }
2914
2768
  }
2915
2769
 
@@ -3025,13 +2879,16 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
3025
2879
  // Add xsrf header
3026
2880
  // This is only done if running in a standard browser environment.
3027
2881
  // Specifically not if we're in a web worker, or react-native.
3028
- if (platform.isStandardBrowserEnv) {
3029
- // Add xsrf header
3030
- const xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath))
3031
- && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
2882
+ if(platform.hasStandardBrowserEnv) {
2883
+ withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
3032
2884
 
3033
- if (xsrfValue) {
3034
- requestHeaders.set(config.xsrfHeaderName, xsrfValue);
2885
+ if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {
2886
+ // Add xsrf header
2887
+ const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
2888
+
2889
+ if (xsrfValue) {
2890
+ requestHeaders.set(config.xsrfHeaderName, xsrfValue);
2891
+ }
3035
2892
  }
3036
2893
  }
3037
2894
 
@@ -3040,13 +2897,13 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
3040
2897
 
3041
2898
  // Add headers to the request
3042
2899
  if ('setRequestHeader' in request) {
3043
- utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
2900
+ utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
3044
2901
  request.setRequestHeader(key, val);
3045
2902
  });
3046
2903
  }
3047
2904
 
3048
2905
  // Add withCredentials to request if needed
3049
- if (!utils.isUndefined(config.withCredentials)) {
2906
+ if (!utils$1.isUndefined(config.withCredentials)) {
3050
2907
  request.withCredentials = !!config.withCredentials;
3051
2908
  }
3052
2909
 
@@ -3101,7 +2958,7 @@ const knownAdapters = {
3101
2958
  xhr: xhrAdapter
3102
2959
  };
3103
2960
 
3104
- utils.forEach(knownAdapters, (fn, value) => {
2961
+ utils$1.forEach(knownAdapters, (fn, value) => {
3105
2962
  if (fn) {
3106
2963
  try {
3107
2964
  Object.defineProperty(fn, 'name', {value});
@@ -3114,11 +2971,11 @@ utils.forEach(knownAdapters, (fn, value) => {
3114
2971
 
3115
2972
  const renderReason = (reason) => `- ${reason}`;
3116
2973
 
3117
- const isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;
2974
+ const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
3118
2975
 
3119
2976
  const adapters = {
3120
2977
  getAdapter: (adapters) => {
3121
- adapters = utils.isArray(adapters) ? adapters : [adapters];
2978
+ adapters = utils$1.isArray(adapters) ? adapters : [adapters];
3122
2979
 
3123
2980
  const {length} = adapters;
3124
2981
  let nameOrAdapter;
@@ -3259,11 +3116,11 @@ function mergeConfig(config1, config2) {
3259
3116
  const config = {};
3260
3117
 
3261
3118
  function getMergedValue(target, source, caseless) {
3262
- if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
3263
- return utils.merge.call({caseless}, target, source);
3264
- } else if (utils.isPlainObject(source)) {
3265
- return utils.merge({}, source);
3266
- } else if (utils.isArray(source)) {
3119
+ if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
3120
+ return utils$1.merge.call({caseless}, target, source);
3121
+ } else if (utils$1.isPlainObject(source)) {
3122
+ return utils$1.merge({}, source);
3123
+ } else if (utils$1.isArray(source)) {
3267
3124
  return source.slice();
3268
3125
  }
3269
3126
  return source;
@@ -3271,25 +3128,25 @@ function mergeConfig(config1, config2) {
3271
3128
 
3272
3129
  // eslint-disable-next-line consistent-return
3273
3130
  function mergeDeepProperties(a, b, caseless) {
3274
- if (!utils.isUndefined(b)) {
3131
+ if (!utils$1.isUndefined(b)) {
3275
3132
  return getMergedValue(a, b, caseless);
3276
- } else if (!utils.isUndefined(a)) {
3133
+ } else if (!utils$1.isUndefined(a)) {
3277
3134
  return getMergedValue(undefined, a, caseless);
3278
3135
  }
3279
3136
  }
3280
3137
 
3281
3138
  // eslint-disable-next-line consistent-return
3282
3139
  function valueFromConfig2(a, b) {
3283
- if (!utils.isUndefined(b)) {
3140
+ if (!utils$1.isUndefined(b)) {
3284
3141
  return getMergedValue(undefined, b);
3285
3142
  }
3286
3143
  }
3287
3144
 
3288
3145
  // eslint-disable-next-line consistent-return
3289
3146
  function defaultToConfig2(a, b) {
3290
- if (!utils.isUndefined(b)) {
3147
+ if (!utils$1.isUndefined(b)) {
3291
3148
  return getMergedValue(undefined, b);
3292
- } else if (!utils.isUndefined(a)) {
3149
+ } else if (!utils$1.isUndefined(a)) {
3293
3150
  return getMergedValue(undefined, a);
3294
3151
  }
3295
3152
  }
@@ -3314,6 +3171,7 @@ function mergeConfig(config1, config2) {
3314
3171
  timeout: defaultToConfig2,
3315
3172
  timeoutMessage: defaultToConfig2,
3316
3173
  withCredentials: defaultToConfig2,
3174
+ withXSRFToken: defaultToConfig2,
3317
3175
  adapter: defaultToConfig2,
3318
3176
  responseType: defaultToConfig2,
3319
3177
  xsrfCookieName: defaultToConfig2,
@@ -3334,16 +3192,16 @@ function mergeConfig(config1, config2) {
3334
3192
  headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
3335
3193
  };
3336
3194
 
3337
- utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
3195
+ utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
3338
3196
  const merge = mergeMap[prop] || mergeDeepProperties;
3339
3197
  const configValue = merge(config1[prop], config2[prop], prop);
3340
- (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
3198
+ (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
3341
3199
  });
3342
3200
 
3343
3201
  return config;
3344
3202
  }
3345
3203
 
3346
- const VERSION = "1.5.1";
3204
+ const VERSION = "1.6.2";
3347
3205
 
3348
3206
  const validators$1 = {};
3349
3207
 
@@ -3481,7 +3339,7 @@ class Axios {
3481
3339
  }
3482
3340
 
3483
3341
  if (paramsSerializer != null) {
3484
- if (utils.isFunction(paramsSerializer)) {
3342
+ if (utils$1.isFunction(paramsSerializer)) {
3485
3343
  config.paramsSerializer = {
3486
3344
  serialize: paramsSerializer
3487
3345
  };
@@ -3497,12 +3355,12 @@ class Axios {
3497
3355
  config.method = (config.method || this.defaults.method || 'get').toLowerCase();
3498
3356
 
3499
3357
  // Flatten headers
3500
- let contextHeaders = headers && utils.merge(
3358
+ let contextHeaders = headers && utils$1.merge(
3501
3359
  headers.common,
3502
3360
  headers[config.method]
3503
3361
  );
3504
3362
 
3505
- headers && utils.forEach(
3363
+ headers && utils$1.forEach(
3506
3364
  ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
3507
3365
  (method) => {
3508
3366
  delete headers[method];
@@ -3589,7 +3447,7 @@ class Axios {
3589
3447
  }
3590
3448
 
3591
3449
  // Provide aliases for supported request methods
3592
- utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
3450
+ utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
3593
3451
  /*eslint func-names:0*/
3594
3452
  Axios.prototype[method] = function(url, config) {
3595
3453
  return this.request(mergeConfig(config || {}, {
@@ -3600,7 +3458,7 @@ utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData
3600
3458
  };
3601
3459
  });
3602
3460
 
3603
- utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
3461
+ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
3604
3462
  /*eslint func-names:0*/
3605
3463
 
3606
3464
  function generateHTTPMethod(isForm) {
@@ -3772,7 +3630,7 @@ function spread(callback) {
3772
3630
  * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
3773
3631
  */
3774
3632
  function isAxiosError(payload) {
3775
- return utils.isObject(payload) && (payload.isAxiosError === true);
3633
+ return utils$1.isObject(payload) && (payload.isAxiosError === true);
3776
3634
  }
3777
3635
 
3778
3636
  const HttpStatusCode = {
@@ -3857,10 +3715,10 @@ function createInstance(defaultConfig) {
3857
3715
  const instance = bind(Axios.prototype.request, context);
3858
3716
 
3859
3717
  // Copy axios.prototype to instance
3860
- utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});
3718
+ utils$1.extend(instance, Axios.prototype, context, {allOwnKeys: true});
3861
3719
 
3862
3720
  // Copy context to instance
3863
- utils.extend(instance, context, null, {allOwnKeys: true});
3721
+ utils$1.extend(instance, context, null, {allOwnKeys: true});
3864
3722
 
3865
3723
  // Factory for creating new instances
3866
3724
  instance.create = function create(instanceConfig) {
@@ -3904,7 +3762,7 @@ axios.mergeConfig = mergeConfig;
3904
3762
 
3905
3763
  axios.AxiosHeaders = AxiosHeaders;
3906
3764
 
3907
- axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
3765
+ axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
3908
3766
 
3909
3767
  axios.getAdapter = adapters.getAdapter;
3910
3768
 
@@ -4310,4 +4168,4 @@ var VerdocsEndpoint = /** @class */ (function () {
4310
4168
  return VerdocsEndpoint;
4311
4169
  }());
4312
4170
 
4313
- export { TemplateSenderTypes as T, VerdocsEndpoint as V, TemplateActions as a, createTemplate as b, canPerformTemplateAction as c, deleteTemplate as d, getTemplates as e, getTemplate as g, listTemplates as l, updateTemplate as u };
4171
+ export { TemplateSenderTypes as T, VerdocsEndpoint as V, TemplateActions as a, createTemplatev2 as b, canPerformTemplateAction as c, deleteTemplate as d, getTemplates as e, getTemplate as g, listTemplates as l, updateTemplate as u };