@verdocs/js-sdk 1.0.8 → 1.0.12

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 (381) hide show
  1. package/.gitignore +4 -0
  2. package/.idea/.gitignore +8 -0
  3. package/.idea/inspectionProfiles/Project_Default.xml +12 -0
  4. package/.idea/js-sdk.iml +11 -0
  5. package/.idea/misc.xml +6 -0
  6. package/.idea/modules.xml +8 -0
  7. package/.idea/vcs.xml +6 -0
  8. package/.prettierrc.js +11 -0
  9. package/LICENSE +21 -0
  10. package/README.md +8 -5
  11. package/__mocks__/axios.ts +3 -0
  12. package/dist/.npmignore +5 -0
  13. package/{Documents → dist/Documents}/Documents.d.ts +9 -0
  14. package/{Documents → dist/Documents}/Documents.js +24 -7
  15. package/{Documents → dist/Documents}/Stars.d.ts +0 -0
  16. package/{Documents → dist/Documents}/Stars.js +2 -2
  17. package/{Documents → dist/Documents}/Templates.d.ts +0 -0
  18. package/{Documents → dist/Documents}/Templates.js +22 -10
  19. package/{Documents → dist/Documents}/Types.d.ts +0 -0
  20. package/{Api → dist/Documents}/Types.js +0 -0
  21. package/{Documents → dist/Documents}/index.d.ts +0 -0
  22. package/{Documents → dist/Documents}/index.js +0 -0
  23. package/dist/HTTP/Transport.d.ts +51 -0
  24. package/dist/HTTP/Transport.js +88 -0
  25. package/{HTTP → dist/HTTP}/Types.d.ts +0 -0
  26. package/{Documents → dist/HTTP}/Types.js +0 -0
  27. package/{HTTP → dist/HTTP}/index.d.ts +0 -0
  28. package/{HTTP → dist/HTTP}/index.js +0 -0
  29. package/{Organizations → dist/Organizations}/ApiKeys.d.ts +0 -0
  30. package/{Organizations → dist/Organizations}/ApiKeys.js +16 -6
  31. package/{Organizations → dist/Organizations}/Groups.d.ts +0 -0
  32. package/{Organizations → dist/Organizations}/Groups.js +22 -8
  33. package/{Organizations → dist/Organizations}/Invitations.d.ts +0 -0
  34. package/dist/Organizations/Invitations.js +36 -0
  35. package/{Organizations → dist/Organizations}/Members.d.ts +0 -0
  36. package/dist/Organizations/Members.js +26 -0
  37. package/{Organizations → dist/Organizations}/Organizations.d.ts +0 -0
  38. package/dist/Organizations/Organizations.js +31 -0
  39. package/{Organizations → dist/Organizations}/Types.d.ts +0 -0
  40. package/{HTTP → dist/Organizations}/Types.js +0 -0
  41. package/{Organizations → dist/Organizations}/Webhooks.d.ts +0 -0
  42. package/dist/Organizations/Webhooks.js +11 -0
  43. package/{Organizations → dist/Organizations}/index.d.ts +0 -0
  44. package/{Organizations → dist/Organizations}/index.js +0 -0
  45. package/dist/README.md +68 -0
  46. package/{Search → dist/Search}/Content.d.ts +0 -0
  47. package/{Search → dist/Search}/Content.js +22 -10
  48. package/{Search → dist/Search}/Types.d.ts +0 -0
  49. package/{Organizations → dist/Search}/Types.js +0 -0
  50. package/{Search → dist/Search}/index.d.ts +0 -0
  51. package/{Search → dist/Search}/index.js +0 -0
  52. package/{Signatures.d.ts → dist/Signatures.d.ts} +0 -0
  53. package/dist/Signatures.js +21 -0
  54. package/{Tags.d.ts → dist/Tags.d.ts} +0 -0
  55. package/dist/Tags.js +16 -0
  56. package/{Templates → dist/Templates}/Documents.d.ts +0 -0
  57. package/{Templates → dist/Templates}/Documents.js +13 -5
  58. package/{Templates → dist/Templates}/Fields.d.ts +0 -0
  59. package/dist/Templates/Fields.js +16 -0
  60. package/{Templates → dist/Templates}/Pages.d.ts +0 -0
  61. package/dist/Templates/Pages.js +21 -0
  62. package/{Templates → dist/Templates}/Reminders.d.ts +0 -0
  63. package/dist/Templates/Reminders.js +21 -0
  64. package/{Templates → dist/Templates}/Roles.d.ts +0 -0
  65. package/dist/Templates/Roles.js +36 -0
  66. package/{Templates → dist/Templates}/Stars.d.ts +0 -0
  67. package/dist/Templates/Stars.js +11 -0
  68. package/{Templates → dist/Templates}/Tags.d.ts +0 -0
  69. package/dist/Templates/Tags.js +16 -0
  70. package/{Templates → dist/Templates}/Templates.d.ts +0 -0
  71. package/{Templates → dist/Templates}/Templates.js +33 -11
  72. package/{Templates → dist/Templates}/Types.d.ts +0 -0
  73. package/{Templates → dist/Templates}/Types.js +0 -0
  74. package/{Templates → dist/Templates}/index.d.ts +0 -0
  75. package/{Templates → dist/Templates}/index.js +0 -0
  76. package/{Users → dist/Users}/Auth.d.ts +6 -6
  77. package/{Users → dist/Users}/Auth.js +27 -13
  78. package/{Users → dist/Users}/Billing.d.ts +0 -0
  79. package/{Users → dist/Users}/Billing.js +0 -0
  80. package/{Api → dist/Users}/Notifications.d.ts +0 -0
  81. package/{Api → dist/Users}/Notifications.js +8 -4
  82. package/{Users → dist/Users}/Profiles.d.ts +0 -0
  83. package/{Users → dist/Users}/Profiles.js +41 -11
  84. package/{Users → dist/Users}/Types.d.ts +13 -0
  85. package/{Search → dist/Users}/Types.js +0 -0
  86. package/{Users → dist/Users}/index.d.ts +0 -0
  87. package/{Users → dist/Users}/index.js +0 -0
  88. package/{Utils → dist/Utils}/DateTime.d.ts +0 -0
  89. package/{Utils → dist/Utils}/DateTime.js +0 -0
  90. package/{Utils → dist/Utils}/index.d.ts +0 -0
  91. package/{Utils → dist/Utils}/index.js +0 -0
  92. package/{Validators.d.ts → dist/Validators.d.ts} +0 -0
  93. package/dist/Validators.js +11 -0
  94. package/{Whitelabel.d.ts → dist/Whitelabel.d.ts} +0 -0
  95. package/dist/Whitelabel.js +11 -0
  96. package/{index.d.ts → dist/index.d.ts} +0 -0
  97. package/{index.js → dist/index.js} +0 -0
  98. package/dist/package.json +64 -0
  99. package/docs/.nojekyll +1 -0
  100. package/docs/README.md +70 -0
  101. package/docs/enums/Templates.Types.SortOptions.md +76 -0
  102. package/docs/enums/Templates.Types.Template.md +153 -0
  103. package/docs/enums/Templates.Types.TemplatePermissions.md +109 -0
  104. package/docs/enums/Templates.Types.TemplateSenderTypes.md +65 -0
  105. package/docs/interfaces/Documents.Documents-1.IActivityEntry.md +120 -0
  106. package/docs/interfaces/Documents.Documents-1.IDocument.md +175 -0
  107. package/docs/interfaces/Documents.Documents-1.IDocumentSearchOptions.md +98 -0
  108. package/docs/interfaces/Documents.Documents-1.IDocumentsSearchResult.md +43 -0
  109. package/docs/interfaces/Documents.Documents-1.IDocumentsSearchResultEntry.md +131 -0
  110. package/docs/interfaces/Documents.Documents-1.IDocumentsSummary.md +67 -0
  111. package/docs/interfaces/Documents.Documents-1.IHistory.md +76 -0
  112. package/docs/interfaces/Documents.Documents-1.IRecipient.md +208 -0
  113. package/docs/interfaces/Documents.Types.ITemplateSummaryEntry.md +186 -0
  114. package/docs/interfaces/Documents.Types.ITemplatesSummary.md +43 -0
  115. package/docs/interfaces/Organizations.Types.IApiKey.md +60 -0
  116. package/docs/interfaces/Organizations.Types.IApiKeyWithSecret.md +87 -0
  117. package/docs/interfaces/Organizations.Types.ICreateApiKeyRequest.md +32 -0
  118. package/docs/interfaces/Organizations.Types.IGroup.md +101 -0
  119. package/docs/interfaces/Organizations.Types.IGroupDetail.md +129 -0
  120. package/docs/interfaces/Organizations.Types.IOrganization.md +128 -0
  121. package/docs/interfaces/Organizations.Types.IUpdateApiKeyRequest.md +32 -0
  122. package/docs/interfaces/Signatures.ISignature.md +65 -0
  123. package/docs/interfaces/Tags.ITags.md +43 -0
  124. package/docs/interfaces/Templates.Types.IDocument.md +109 -0
  125. package/docs/interfaces/Templates.Types.IField.md +109 -0
  126. package/docs/interfaces/Templates.Types.IPage.md +87 -0
  127. package/docs/interfaces/Templates.Types.IReminder.md +109 -0
  128. package/docs/interfaces/Templates.Types.IRole.md +120 -0
  129. package/docs/interfaces/Templates.Types.ISetting.md +98 -0
  130. package/docs/interfaces/Templates.Types.IStar.md +32 -0
  131. package/docs/interfaces/Templates.Types.ITag.md +32 -0
  132. package/docs/interfaces/Templates.Types.ITemplate.md +219 -0
  133. package/docs/interfaces/Templates.Types.ITemplateSearchParams.md +197 -0
  134. package/docs/interfaces/Templates.Types.ITemplateSummaryEntry.md +186 -0
  135. package/docs/interfaces/Templates.Types.ITemplatesSearchResult.md +43 -0
  136. package/docs/interfaces/Templates.Types.ITemplatesSummary.md +43 -0
  137. package/docs/interfaces/Templates.Types.ITimePeriod.md +32 -0
  138. package/docs/interfaces/Users.Types.IActiveSession.md +131 -0
  139. package/docs/interfaces/Users.Types.IAuthenticateAppRequest.md +32 -0
  140. package/docs/interfaces/Users.Types.IAuthenticateResponse.md +43 -0
  141. package/docs/interfaces/Users.Types.IAuthenticateUserRequest.md +32 -0
  142. package/docs/interfaces/Users.Types.ICreateProfileRequest.md +54 -0
  143. package/docs/interfaces/Users.Types.IPermission.md +36 -0
  144. package/docs/interfaces/Users.Types.IProfile.md +173 -0
  145. package/docs/interfaces/Users.Types.IRole.md +36 -0
  146. package/docs/interfaces/Users.Types.ISwitchProfileResponse.md +54 -0
  147. package/docs/interfaces/Users.Types.IUpdateProfileRequest.md +43 -0
  148. package/docs/interfaces/Users.Types.TokenValidationRequest.md +21 -0
  149. package/docs/interfaces/Users.Types.TokenValidationResponse.md +36 -0
  150. package/docs/interfaces/Users.Types.UpdateEmailRequest.md +21 -0
  151. package/docs/interfaces/Users.Types.UpdateEmailResponse.md +21 -0
  152. package/docs/interfaces/Users.Types.UpdatePasswordRequest.md +43 -0
  153. package/docs/interfaces/Users.Types.UpdatePasswordResponse.md +34 -0
  154. package/docs/interfaces/Validators.IValidator.md +32 -0
  155. package/docs/modules/Documents.Documents-1.md +137 -0
  156. package/docs/modules/Documents.Stars.md +31 -0
  157. package/docs/modules/Documents.Templates.md +61 -0
  158. package/docs/modules/Documents.Types.md +12 -0
  159. package/docs/modules/Documents.md +12 -0
  160. package/docs/modules/HTTP.Transport.md +150 -0
  161. package/docs/modules/HTTP.Types.md +21 -0
  162. package/docs/modules/HTTP.md +10 -0
  163. package/docs/modules/Organizations.ApiKeys.md +169 -0
  164. package/docs/modules/Organizations.Groups.md +190 -0
  165. package/docs/modules/Organizations.Invitations.md +166 -0
  166. package/docs/modules/Organizations.Members.md +121 -0
  167. package/docs/modules/Organizations.Organizations-1.md +119 -0
  168. package/docs/modules/Organizations.Types.md +17 -0
  169. package/docs/modules/Organizations.Webhooks.md +53 -0
  170. package/docs/modules/Organizations.md +20 -0
  171. package/docs/modules/Signatures.md +90 -0
  172. package/docs/modules/Tags.md +75 -0
  173. package/docs/modules/Templates.Documents.md +129 -0
  174. package/docs/modules/Templates.Fields.md +77 -0
  175. package/docs/modules/Templates.Pages.md +98 -0
  176. package/docs/modules/Templates.Reminders.md +98 -0
  177. package/docs/modules/Templates.Roles.md +163 -0
  178. package/docs/modules/Templates.Stars.md +52 -0
  179. package/docs/modules/Templates.Tags.md +75 -0
  180. package/docs/modules/Templates.Templates-1.md +139 -0
  181. package/docs/modules/Templates.Types.md +31 -0
  182. package/docs/modules/Templates.md +17 -0
  183. package/docs/modules/Users.Auth.md +196 -0
  184. package/docs/modules/Users.Billing.md +5 -0
  185. package/docs/modules/Users.Notifications.md +25 -0
  186. package/docs/modules/Users.Profiles.md +286 -0
  187. package/docs/modules/Users.Types.md +62 -0
  188. package/docs/modules/Users.md +13 -0
  189. package/docs/modules/Utils.DateTime.md +31 -0
  190. package/docs/modules/Utils.md +9 -0
  191. package/docs/modules/Validators.md +48 -0
  192. package/docs/modules/Whitelabel.md +38 -0
  193. package/docs/modules.md +27 -0
  194. package/docs-html/.nojekyll +1 -0
  195. package/docs-html/assets/highlight.css +85 -0
  196. package/docs-html/assets/icons.css +1043 -0
  197. package/docs-html/assets/icons.png +0 -0
  198. package/docs-html/assets/icons@2x.png +0 -0
  199. package/docs-html/assets/main.js +52 -0
  200. package/docs-html/assets/search.js +1 -0
  201. package/docs-html/assets/style.css +1384 -0
  202. package/docs-html/assets/widgets.png +0 -0
  203. package/docs-html/assets/widgets@2x.png +0 -0
  204. package/docs-html/enums/Templates.Types.SortOptions.html +1 -0
  205. package/docs-html/enums/Templates.Types.Template.html +1 -0
  206. package/docs-html/enums/Templates.Types.TemplatePermissions.html +1 -0
  207. package/docs-html/enums/Templates.Types.TemplateSenderTypes.html +1 -0
  208. package/docs-html/index.html +64 -0
  209. package/docs-html/interfaces/Documents.Documents-1.IActivityEntry.html +1 -0
  210. package/docs-html/interfaces/Documents.Documents-1.IDocument.html +1 -0
  211. package/docs-html/interfaces/Documents.Documents-1.IDocumentSearchOptions.html +1 -0
  212. package/docs-html/interfaces/Documents.Documents-1.IDocumentsSearchResult.html +1 -0
  213. package/docs-html/interfaces/Documents.Documents-1.IDocumentsSearchResultEntry.html +1 -0
  214. package/docs-html/interfaces/Documents.Documents-1.IDocumentsSummary.html +1 -0
  215. package/docs-html/interfaces/Documents.Documents-1.IHistory.html +1 -0
  216. package/docs-html/interfaces/Documents.Documents-1.IRecipient.html +1 -0
  217. package/docs-html/interfaces/Documents.Types.ITemplateSummaryEntry.html +1 -0
  218. package/docs-html/interfaces/Documents.Types.ITemplatesSummary.html +1 -0
  219. package/docs-html/interfaces/Organizations.Types.IApiKey.html +1 -0
  220. package/docs-html/interfaces/Organizations.Types.IApiKeyWithSecret.html +1 -0
  221. package/docs-html/interfaces/Organizations.Types.ICreateApiKeyRequest.html +1 -0
  222. package/docs-html/interfaces/Organizations.Types.IGroup.html +9 -0
  223. package/docs-html/interfaces/Organizations.Types.IGroupDetail.html +9 -0
  224. package/docs-html/interfaces/Organizations.Types.IOrganization.html +9 -0
  225. package/docs-html/interfaces/Organizations.Types.IUpdateApiKeyRequest.html +1 -0
  226. package/docs-html/interfaces/Signatures.ISignature.html +1 -0
  227. package/docs-html/interfaces/Tags.ITags.html +1 -0
  228. package/docs-html/interfaces/Templates.Types.IDocument.html +1 -0
  229. package/docs-html/interfaces/Templates.Types.IField.html +1 -0
  230. package/docs-html/interfaces/Templates.Types.IPage.html +1 -0
  231. package/docs-html/interfaces/Templates.Types.IReminder.html +1 -0
  232. package/docs-html/interfaces/Templates.Types.IRole.html +1 -0
  233. package/docs-html/interfaces/Templates.Types.ISetting.html +1 -0
  234. package/docs-html/interfaces/Templates.Types.IStar.html +1 -0
  235. package/docs-html/interfaces/Templates.Types.ITag.html +1 -0
  236. package/docs-html/interfaces/Templates.Types.ITemplate.html +1 -0
  237. package/docs-html/interfaces/Templates.Types.ITemplateSearchParams.html +1 -0
  238. package/docs-html/interfaces/Templates.Types.ITemplateSummaryEntry.html +1 -0
  239. package/docs-html/interfaces/Templates.Types.ITemplatesSearchResult.html +1 -0
  240. package/docs-html/interfaces/Templates.Types.ITemplatesSummary.html +1 -0
  241. package/docs-html/interfaces/Templates.Types.ITimePeriod.html +1 -0
  242. package/docs-html/interfaces/Users.Types.IActiveSession.html +1 -0
  243. package/docs-html/interfaces/Users.Types.IAuthenticateAppRequest.html +1 -0
  244. package/docs-html/interfaces/Users.Types.IAuthenticateResponse.html +1 -0
  245. package/docs-html/interfaces/Users.Types.IAuthenticateUserRequest.html +1 -0
  246. package/docs-html/interfaces/Users.Types.ICreateProfileRequest.html +1 -0
  247. package/docs-html/interfaces/Users.Types.IPermission.html +5 -0
  248. package/docs-html/interfaces/Users.Types.IProfile.html +21 -0
  249. package/docs-html/interfaces/Users.Types.IRole.html +5 -0
  250. package/docs-html/interfaces/Users.Types.ISwitchProfileResponse.html +1 -0
  251. package/docs-html/interfaces/Users.Types.IUpdateProfileRequest.html +1 -0
  252. package/docs-html/interfaces/Users.Types.TokenValidationRequest.html +1 -0
  253. package/docs-html/interfaces/Users.Types.TokenValidationResponse.html +5 -0
  254. package/docs-html/interfaces/Users.Types.UpdateEmailRequest.html +1 -0
  255. package/docs-html/interfaces/Users.Types.UpdateEmailResponse.html +1 -0
  256. package/docs-html/interfaces/Users.Types.UpdatePasswordRequest.html +1 -0
  257. package/docs-html/interfaces/Users.Types.UpdatePasswordResponse.html +3 -0
  258. package/docs-html/interfaces/Validators.IValidator.html +1 -0
  259. package/docs-html/modules/Documents.Documents-1.html +9 -0
  260. package/docs-html/modules/Documents.Stars.html +1 -0
  261. package/docs-html/modules/Documents.Templates.html +1 -0
  262. package/docs-html/modules/Documents.Types.html +1 -0
  263. package/docs-html/modules/Documents.html +1 -0
  264. package/docs-html/modules/HTTP.Transport.html +22 -0
  265. package/docs-html/modules/HTTP.Types.html +1 -0
  266. package/docs-html/modules/HTTP.html +1 -0
  267. package/docs-html/modules/Organizations.ApiKeys.html +29 -0
  268. package/docs-html/modules/Organizations.Groups.html +15 -0
  269. package/docs-html/modules/Organizations.Invitations.html +1 -0
  270. package/docs-html/modules/Organizations.Members.html +1 -0
  271. package/docs-html/modules/Organizations.Organizations-1.html +1 -0
  272. package/docs-html/modules/Organizations.Types.html +1 -0
  273. package/docs-html/modules/Organizations.Webhooks.html +1 -0
  274. package/docs-html/modules/Organizations.html +6 -0
  275. package/docs-html/modules/Signatures.html +1 -0
  276. package/docs-html/modules/Tags.html +1 -0
  277. package/docs-html/modules/Templates.Documents.html +17 -0
  278. package/docs-html/modules/Templates.Fields.html +1 -0
  279. package/docs-html/modules/Templates.Pages.html +1 -0
  280. package/docs-html/modules/Templates.Reminders.html +1 -0
  281. package/docs-html/modules/Templates.Roles.html +1 -0
  282. package/docs-html/modules/Templates.Stars.html +1 -0
  283. package/docs-html/modules/Templates.Tags.html +1 -0
  284. package/docs-html/modules/Templates.Templates-1.html +5 -0
  285. package/docs-html/modules/Templates.Types.html +1 -0
  286. package/docs-html/modules/Templates.html +1 -0
  287. package/docs-html/modules/Users.Auth.html +31 -0
  288. package/docs-html/modules/Users.Billing.html +1 -0
  289. package/docs-html/modules/Users.Notifications.html +1 -0
  290. package/docs-html/modules/Users.Profiles.html +44 -0
  291. package/docs-html/modules/Users.Types.html +1 -0
  292. package/docs-html/modules/Users.html +1 -0
  293. package/docs-html/modules/Utils.DateTime.html +1 -0
  294. package/docs-html/modules/Utils.html +1 -0
  295. package/docs-html/modules/Validators.html +1 -0
  296. package/docs-html/modules/Whitelabel.html +1 -0
  297. package/docs-html/modules.html +11 -0
  298. package/jestconfig.json +11 -0
  299. package/package-lock.json +3421 -0
  300. package/package.json +6 -3
  301. package/src/Documents/Documents.ts +166 -0
  302. package/src/Documents/Stars.ts +5 -0
  303. package/src/Documents/Templates.ts +17 -0
  304. package/src/Documents/Types.ts +24 -0
  305. package/src/Documents/index.ts +4 -0
  306. package/src/HTTP/Transport.ts +95 -0
  307. package/src/HTTP/Types.ts +1 -0
  308. package/src/HTTP/index.ts +2 -0
  309. package/src/Organizations/ApiKeys.ts +85 -0
  310. package/src/Organizations/Groups.ts +65 -0
  311. package/src/Organizations/Invitations.ts +36 -0
  312. package/src/Organizations/Members.ts +26 -0
  313. package/src/Organizations/Organizations.ts +32 -0
  314. package/src/Organizations/Types.ts +63 -0
  315. package/src/Organizations/Webhooks.ts +11 -0
  316. package/src/Organizations/index.ts +16 -0
  317. package/src/Search/Content.ts +45 -0
  318. package/src/Search/Types.ts +83 -0
  319. package/src/Search/index.ts +2 -0
  320. package/src/Signatures.ts +29 -0
  321. package/src/Tags.ts +22 -0
  322. package/src/Templates/Documents.ts +58 -0
  323. package/src/Templates/Fields.ts +17 -0
  324. package/src/Templates/Pages.ts +22 -0
  325. package/src/Templates/Reminders.ts +22 -0
  326. package/src/Templates/Roles.ts +37 -0
  327. package/src/Templates/Stars.ts +12 -0
  328. package/src/Templates/Tags.ts +17 -0
  329. package/src/Templates/Templates.ts +42 -0
  330. package/src/Templates/Types.ts +201 -0
  331. package/src/Templates/index.ts +9 -0
  332. package/src/Users/Auth.ts +114 -0
  333. package/src/Users/Billing.ts +3 -0
  334. package/src/Users/Notifications.ts +6 -0
  335. package/src/Users/Profiles.ts +153 -0
  336. package/src/Users/Types.ts +156 -0
  337. package/src/Users/index.ts +5 -0
  338. package/src/Utils/DateTime.ts +43 -0
  339. package/src/Utils/index.ts +1 -0
  340. package/src/Validators.ts +16 -0
  341. package/src/Whitelabel.ts +11 -0
  342. package/src/__tests__/Organizations/Apikeys.spec.ts +84 -0
  343. package/src/__tests__/Users/Auth.spec.ts +89 -0
  344. package/src/__tests__/Users/Profiles.spec.ts +162 -0
  345. package/src/index.ts +23 -0
  346. package/tsconfig.json +20 -0
  347. package/tslint.json +3 -0
  348. package/Api/Auth.d.ts +0 -71
  349. package/Api/Auth.js +0 -24
  350. package/Api/Documents.d.ts +0 -124
  351. package/Api/Documents.js +0 -47
  352. package/Api/Endpoint.d.ts +0 -2
  353. package/Api/Endpoint.js +0 -9
  354. package/Api/Templates.d.ts +0 -33
  355. package/Api/Templates.js +0 -55
  356. package/Api/Types.d.ts +0 -182
  357. package/Api/index.d.ts +0 -2
  358. package/Api/index.js +0 -2
  359. package/AuthManager.d.ts +0 -14
  360. package/AuthManager.js +0 -53
  361. package/HTTP/Endpoint.d.ts +0 -4
  362. package/HTTP/Endpoint.js +0 -12
  363. package/HTTP/Transport.d.ts +0 -3
  364. package/HTTP/Transport.js +0 -12
  365. package/Organizations/Invitations.js +0 -22
  366. package/Organizations/Members.js +0 -16
  367. package/Organizations/Organizations.js +0 -13
  368. package/Organizations/Webhooks.js +0 -7
  369. package/Signatures.js +0 -7
  370. package/Tags.js +0 -4
  371. package/Templates/Fields.js +0 -10
  372. package/Templates/Pages.js +0 -13
  373. package/Templates/Reminders.js +0 -13
  374. package/Templates/Roles.js +0 -22
  375. package/Templates/Stars.js +0 -7
  376. package/Templates/Tags.js +0 -10
  377. package/Users/Notifications.d.ts +0 -1
  378. package/Users/Notifications.js +0 -40
  379. package/Users/Types.js +0 -1
  380. package/Validators.js +0 -5
  381. package/Whitelabel.js +0 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdocs/js-sdk",
3
- "version": "1.0.8",
3
+ "version": "1.0.12",
4
4
  "private": false,
5
5
  "homepage": "https://github.com/Verdocs/js-sdk",
6
6
  "description": "Verdocs JS SDK",
@@ -26,7 +26,9 @@
26
26
  "url": "https://github.com/Verdocs/js-sdk/issues"
27
27
  },
28
28
  "scripts": {
29
- "build": "tsc && cp README.md package.json .npmignore dist",
29
+ "build": "rm -rf dist/* && tsc && cp README.md package.json .npmignore dist",
30
+ "Xprepare": "npm run build",
31
+ "XprepublishOnly": "npm test && npm run lint",
30
32
  "preversion": "npm run lint",
31
33
  "version": "npm run format && git add -A src",
32
34
  "postversion": "git push && git push --tags",
@@ -35,7 +37,8 @@
35
37
  "lint": "tslint -p tsconfig.json",
36
38
  "docs-md": "typedoc && git add --all docs",
37
39
  "docs-html": "typedoc --plugin none --out docs-html",
38
- "docs": "npm run docs-md && npm run docs-html && cp -aR docs-html/* ../partner-portal/site/static/js-sdk/"
40
+ "docs": "npm run docs-md && npm run docs-html && cp -aR docs-html/* ../partner-portal/site/static/js-sdk/",
41
+ "pub": "npm version patch && npm run build && npm run docs"
39
42
  },
40
43
  "publishConfig": {
41
44
  "access": "public"
@@ -0,0 +1,166 @@
1
+ import {getEndpoint} from '../HTTP/Transport';
2
+
3
+ export type IDocumentStatus = 'complete' | 'pending' | 'progress';
4
+
5
+ export type IRecipientStatus = 'invited' | 'opened' | 'signed' | 'submitted';
6
+
7
+ export type IRecipientType = 'signer' | 'cc';
8
+
9
+ export interface IDocumentsSearchResultEntry {
10
+ id: string;
11
+ canceled_at: string;
12
+ created_at: string;
13
+ name: string;
14
+ profile_id: string;
15
+ status: IDocumentStatus;
16
+ next_recipient: {
17
+ claimed: boolean;
18
+ email: string;
19
+ name: string;
20
+ profile_id: string;
21
+ status: IRecipientStatus;
22
+ type: IRecipientType;
23
+ };
24
+ template_id: string;
25
+ total_count: number;
26
+ updated_at: string;
27
+ }
28
+
29
+ export interface IDocumentsSearchResult {
30
+ page: number;
31
+ total: number;
32
+ result: IDocumentsSearchResultEntry[];
33
+ }
34
+
35
+ export interface IDocumentsSummary {
36
+ action_required: {
37
+ page: number;
38
+ total: number;
39
+ result: IActivityEntry[];
40
+ };
41
+ completed: {
42
+ page: number;
43
+ total: number;
44
+ result: IActivityEntry[];
45
+ };
46
+ waiting_others: {
47
+ page: number;
48
+ total: number;
49
+ result: IActivityEntry[];
50
+ };
51
+ }
52
+
53
+ export interface IRecipient {
54
+ agreed: boolean;
55
+ claimed: boolean;
56
+ created_at: string;
57
+ delegated_to: string | null;
58
+ delegator: boolean;
59
+ email: string;
60
+ envelope_id: string;
61
+ full_name: string;
62
+ in_app_access_key: string;
63
+ key_used_to_conclude: string;
64
+ message: string | null;
65
+ phone: string;
66
+ profile_id: string;
67
+ role_name: string;
68
+ sequence: number;
69
+ status: IRecipientStatus;
70
+ type: IRecipientType;
71
+ updated_at: string;
72
+ }
73
+
74
+ export interface IDocument {
75
+ id: string;
76
+ created_at: string;
77
+ canceled_at: string;
78
+ envelope_document_id: string;
79
+ certificate_document_id: string | null;
80
+ histories: IHistory[];
81
+ recipients: IRecipient[];
82
+ name: string;
83
+ no_contact: boolean;
84
+ profile_id: string;
85
+ reminder_id: string | null;
86
+ status: IDocumentStatus;
87
+ template_id: string;
88
+ updated_at: string;
89
+ organization_id: string | null;
90
+ }
91
+
92
+ export interface IActivityEntry {
93
+ id: string;
94
+ name: string;
95
+ canceled_at: string;
96
+ created_at: string;
97
+ updated_at: string;
98
+ profile_id: string;
99
+ status: IDocumentStatus;
100
+ template_id: string;
101
+ recipient: {
102
+ claimed: boolean;
103
+ email: string;
104
+ name: string;
105
+ profile_id: string;
106
+ status: IRecipientStatus;
107
+ type: IRecipientType;
108
+ };
109
+ }
110
+
111
+ export interface IHistory {
112
+ created_at: string;
113
+ envelope_id: string;
114
+ event: IHistoryEvent;
115
+ event_detail: IEventDetail;
116
+ id: string;
117
+ role_name: string;
118
+ }
119
+
120
+ export interface IDocumentSearchOptions {
121
+ rows?: number;
122
+ page?: number;
123
+ sort_by?: 'updated_at' | 'created_at';
124
+ ascending?: boolean;
125
+ is_owner?: boolean;
126
+ is_recipient?: boolean;
127
+ envelope_status: IDocumentStatus[];
128
+ recipient_status: IDocumentStatus[];
129
+ }
130
+
131
+ export type IHistoryEvent =
132
+ | 'recipient:invited'
133
+ | 'recipient:opened'
134
+ | 'recipient:agreed'
135
+ | 'recipient:signed'
136
+ | 'recipient:submitted';
137
+
138
+ export type IEventDetail = 'in_app' | 'mail' | 'signer' | '';
139
+
140
+ /**
141
+ * Get a summary of currently active documents.
142
+ *
143
+ * ```typescript
144
+ * import {Documents} from '@verdocs/js-sdk/Documents';
145
+ *
146
+ * const {action_required, completed, waiting_on_others} = await Documents.getSummary();
147
+ * ```
148
+ */
149
+ export const getSummary = async (page: number) =>
150
+ getEndpoint()
151
+ .post<IDocumentsSummary>('/documents/summary', {page})
152
+ .then((r) => r.data);
153
+
154
+ /**
155
+ * Search for documents matching various criteria.
156
+ *
157
+ * ```typescript
158
+ * import {Documents} from '@verdocs/js-sdk/Documents';
159
+ *
160
+ * const {result, page, total} = await Documents.search({ ... });
161
+ * ```
162
+ */
163
+ export const search = async (params: any) =>
164
+ getEndpoint()
165
+ .post<IDocumentsSearchResult>('/documents/search', params)
166
+ .then((r) => r.data);
@@ -0,0 +1,5 @@
1
+ import {getEndpoint} from '../HTTP/Transport';
2
+ import {ITemplateSummaryEntry} from './Types';
3
+
4
+ export const toggleStar = async (templateId: string) =>
5
+ getEndpoint().post<ITemplateSummaryEntry>(`/templates/${templateId}/stars/toggle`).then((r) => r.data);
@@ -0,0 +1,17 @@
1
+ import {getEndpoint} from '../HTTP/Transport';
2
+ import {ITemplatesSummary} from './Types';
3
+
4
+ export const getTemplates = async () =>
5
+ getEndpoint()
6
+ .get('/templates')
7
+ .then((r) => r.data);
8
+
9
+ export const searchTemplates = async () =>
10
+ getEndpoint()
11
+ .post('/templates/search')
12
+ .then((r) => r.data);
13
+
14
+ export const getSummary = async (page: number): Promise<ITemplatesSummary> =>
15
+ getEndpoint()
16
+ .post('/templates/summary', {page})
17
+ .then((r) => r.data);
@@ -0,0 +1,24 @@
1
+ export interface ITemplateSummaryEntry {
2
+ id: string;
3
+ name: string;
4
+ sender: string;
5
+ counter: number;
6
+ description: string | null;
7
+ created_at: string;
8
+ updated_at: string;
9
+ is_personal: boolean;
10
+ is_public: boolean;
11
+ profile_id: string;
12
+ organization_id: string;
13
+ last_used_at: string | null;
14
+ document_name: string | null;
15
+ star_counter: number;
16
+ tag_name: string | null;
17
+ is_starred: boolean;
18
+ }
19
+
20
+ export interface ITemplatesSummary {
21
+ page: number;
22
+ total: number;
23
+ result: ITemplateSummaryEntry[];
24
+ }
@@ -0,0 +1,4 @@
1
+ export * as Documents from './Documents';
2
+ export * as Stars from './Stars';
3
+ export * as Templates from './Templates';
4
+ export * as Types from './Types';
@@ -0,0 +1,95 @@
1
+ import axios from 'axios';
2
+
3
+ const config = {
4
+ baseURL: 'https://api.verdocs.com/',
5
+ timeout: 3000,
6
+ headers: {'X-Client-ID': 'NONE'} as Record<string, string>,
7
+ };
8
+ let endpoint = axios.create(config);
9
+
10
+ /**
11
+ * Set the auth token that will be used for Verdocs API calls.
12
+ *
13
+ * ```typescript
14
+ * import {Transport} from '@verdocs/js-sdk/HTTP';
15
+ *
16
+ * Transport.setAuthorization(accessToken);
17
+ * ```
18
+ */
19
+ export const setAuthorization = (accessToken: string | null) => {
20
+ if (accessToken) {
21
+ config.headers['Authorization'] = `Bearer ${accessToken}`;
22
+ } else {
23
+ delete config.headers['Authorization'];
24
+ }
25
+
26
+ if (endpoint) {
27
+ endpoint = axios.create(config);
28
+ }
29
+ };
30
+
31
+ /**
32
+ * Set the Client ID for Verdocs API calls.
33
+ *
34
+ * ```typescript
35
+ * import {Transport} from '@verdocs/js-sdk/HTTP';
36
+ *
37
+ * Transport.setClientID('1234);
38
+ * ```
39
+ */
40
+ export const setClientID = (clientID: string) => {
41
+ config.headers['X-Client-ID'] = clientID;
42
+ if (endpoint) {
43
+ endpoint = axios.create(config);
44
+ }
45
+ };
46
+
47
+ /**
48
+ * Set the base URL for API calls. Typically this is https://api.verdocs.com/ and is the default. Change this only after consultation
49
+ * with Verdocs Developer Support.
50
+ *
51
+ * ```typescript
52
+ * import {Transport} from '@verdocs/js-sdk/HTTP';
53
+ *
54
+ * Transport.setBaseUrl('https://api.verdiocs.com');
55
+ * ```
56
+ */
57
+ export const setBaseUrl = (baseUrl: string) => {
58
+ config.baseURL = baseUrl;
59
+ if (endpoint) {
60
+ endpoint = axios.create(config);
61
+ }
62
+ };
63
+
64
+ /**
65
+ * Set the timeout for API calls in milliseconds. 2000-4000ms is recommended for most purposes. 3000ms is the default.
66
+ *
67
+ * ```typescript
68
+ * import {Transport} from '@verdocs/js-sdk/HTTP';
69
+ *
70
+ * Transport.setTimeout(3000);
71
+ * ```
72
+ */
73
+ export const setTimeout = (timeout: number) => {
74
+ config.timeout = timeout;
75
+ if (endpoint) {
76
+ endpoint = axios.create(config);
77
+ }
78
+ };
79
+
80
+ /**
81
+ * Helper to get the endpoint for direct access to HTTP functions.
82
+ *
83
+ * ```typescript
84
+ * import {Transport} from '@verdocs/js-sdk/HTTP';
85
+ *
86
+ * console.log('Current timeout', Transport.getEndpoint().defaults.timeout);
87
+ * ```
88
+ */
89
+ export const getEndpoint = () => {
90
+ if (!endpoint) {
91
+ endpoint = axios.create(config);
92
+ }
93
+
94
+ return endpoint;
95
+ };
@@ -0,0 +1 @@
1
+ export type TRequestStatus = 'OK' | 'ERROR';
@@ -0,0 +1,2 @@
1
+ export * as Transport from './Transport';
2
+ export * as Types from './Types';
@@ -0,0 +1,85 @@
1
+ /**
2
+ * API keys are used to authenticate server-to-server calls. (API keys should **never** be used for client-to-server operations!)
3
+ * To generate a key, either use the Verdocs admin interface and make note of the client_id and client_secret generated, or call
4
+ * createKey as shown below. Then call {@link Users.Auth.authenticateApp} to obtain an access token using the provided ID and
5
+ * secret. Note that server-to-server authentication requests return shorter-lived tokens, so it is important to check the `exp`
6
+ * field and re-authenticate as needed for subsequent calls.
7
+ *
8
+ * API keys may be updated or rotated at any time. Regular rotation is recommended. Rotation will not expire or invalidate
9
+ * existing server-to-server sessions, so it may be done at any time without disrupting your application.
10
+ *
11
+ * @module
12
+ */
13
+
14
+ import {getEndpoint} from '../HTTP/Transport';
15
+ import {IApiKey, IApiKeyWithSecret, ICreateApiKeyRequest, IUpdateApiKeyRequest} from './Types';
16
+
17
+ /**
18
+ * Get a list of keys for a given organization. The caller must have admin access to the organization.
19
+ *
20
+ * ```typescript
21
+ * import {ApiKeys} from '@verdocs/js-sdk/Organizations';
22
+ *
23
+ * const keys = await ApiKeys.getKeys(ORGID);
24
+ * ```
25
+ */
26
+ export const getKeys = (organizationId: string) =>
27
+ getEndpoint()
28
+ .get<IApiKey[]>(`/organizations/${organizationId}/api_key`)
29
+ .then((r) => r.data);
30
+
31
+ /**
32
+ * Create an API key.
33
+ *
34
+ * ```typescript
35
+ * import {ApiKeys} from '@verdocs/js-sdk/Organizations';
36
+ *
37
+ * await ApiKeys.createKey(ORGID, {name: NEWNAME});
38
+ * ```
39
+ */
40
+ export const createKey = (organizationId: string, params: ICreateApiKeyRequest) =>
41
+ getEndpoint()
42
+ .post<IApiKeyWithSecret>(`/organizations/${organizationId}/api_key`, params)
43
+ .then((r) => r.data);
44
+
45
+ /**
46
+ * Rotate the secret for an API key. The caller must have admin access to the organization.
47
+ *
48
+ * ```typescript
49
+ * import {ApiKeys} from '@verdocs/js-sdk/Organizations';
50
+ *
51
+ * const {client_secret: newSecret} = await ApiKeys.rotateKey(ORGID, CLIENTID);
52
+ * ```
53
+ */
54
+ export const rotateKey = (organizationId: string, clientId: string) =>
55
+ getEndpoint()
56
+ .put<IApiKeyWithSecret>(`/organizations/${organizationId}/api_key/${clientId}/rotate`)
57
+ .then((r) => r.data);
58
+
59
+ /**
60
+ * Update an API key to change its assigned Profile ID or Name.
61
+ *
62
+ * ```typescript
63
+ * import {ApiKeys} from '@verdocs/js-sdk/Organizations';
64
+ *
65
+ * await ApiKeys.updateKey(ORGID, CLIENTID, {name: NEWNAME});
66
+ * ```
67
+ */
68
+ export const updateKey = (organizationId: string, clientId: string, params: IUpdateApiKeyRequest) =>
69
+ getEndpoint()
70
+ .patch<IApiKey>(`/organizations/${organizationId}/api_key/${clientId}`, params)
71
+ .then((r) => r.data);
72
+
73
+ /**
74
+ * Delete an API key.
75
+ *
76
+ * ```typescript
77
+ * import {ApiKeys} from '@verdocs/js-sdk/Organizations';
78
+ *
79
+ * await ApiKeys.deleteKey(ORGID, CLIENTID);
80
+ * ```
81
+ */
82
+ export const deleteKey = (organizationId: string, clientId: string) =>
83
+ getEndpoint()
84
+ .delete(`/organizations/${organizationId}/api_key/${clientId}`)
85
+ .then((r) => r.data);
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Organizations may contain "Groups" of user profiles, called Members. Groups may have permissions assigned that
3
+ * apply to all Members, making it easy to configure role-based access control (RBAC) within an Organization. Note
4
+ * that permissions are **additive**. A user may be a member of more than one group, and may also have permissions
5
+ * assigned directly. In that case, the user will have the combined set of all permissions inherited from all
6
+ * sources.
7
+ *
8
+ * @module
9
+ */
10
+
11
+ import {getEndpoint} from '../HTTP/Transport';
12
+ import {IGroup, IGroupDetail} from './Types';
13
+
14
+ /**
15
+ * Get a list of groups for a given organization. The caller must have admin access to the organization.
16
+ *
17
+ * ```typescript
18
+ * import {Groups} from '@verdocs/js-sdk/Organizations';
19
+ *
20
+ * const groups = await Groups.getGroups(ORGID);
21
+ * ```
22
+ */
23
+ export const getGroups = (organizationId: string) =>
24
+ getEndpoint()
25
+ .get<IGroup[]>(`/organizations/${organizationId}/groups`)
26
+ .then((r) => r.data);
27
+
28
+ /**
29
+ * Get the details for a group.
30
+ *
31
+ * ```typescript
32
+ * import {Groups} from '@verdocs/js-sdk/Organizations';
33
+ *
34
+ * const groups = await Groups.getGroups(ORGID);
35
+ * ```
36
+ */
37
+ export const getGroup = (organizationId: string, groupId: string) =>
38
+ getEndpoint()
39
+ .get<IGroupDetail>(`/organizations/${organizationId}/groups/${groupId}`)
40
+ .then((r) => r.data);
41
+
42
+ export const getMembers = (organizationId: string, groupId: string) =>
43
+ getEndpoint()
44
+ .get(`/organizations/${organizationId}/groups/${groupId}/members`)
45
+ .then((r) => r.data);
46
+
47
+ export const addMembers = (organizationId: string, groupId: string, params: any) =>
48
+ getEndpoint()
49
+ .post(`/organizations/${organizationId}/groups/${groupId}/members`, params)
50
+ .then((r) => r.data);
51
+
52
+ export const deleteMembers = (organizationId: string, groupId: string, params: any) =>
53
+ getEndpoint()
54
+ .put(`/organizations/${organizationId}/groups/${groupId}/delete_members`, params)
55
+ .then((r) => r.data);
56
+
57
+ export const addPermission = (organizationId: string, groupId: string, permissionId: string, params: any) =>
58
+ getEndpoint()
59
+ .post(`/organizations/${organizationId}/groups/${groupId}/permissions/${permissionId}`, params)
60
+ .then((r) => r.data);
61
+
62
+ export const deletePermission = (organizationId: string, groupId: string, permissionId: string) =>
63
+ getEndpoint()
64
+ .delete(`/organizations/${organizationId}/groups/${groupId}/permissions/${permissionId}`)
65
+ .then((r) => r.data);
@@ -0,0 +1,36 @@
1
+ import {getEndpoint} from '../HTTP/Transport';
2
+
3
+ export const getInvitations = (organizationId: string) =>
4
+ getEndpoint()
5
+ .get(`/organizations/${organizationId}/invitation`)
6
+ .then((r) => r.data);
7
+
8
+ export const createInvitation = (organizationId: string, params: any) =>
9
+ getEndpoint()
10
+ .post(`/organizations/${organizationId}/invitation`, params)
11
+ .then((r) => r.data);
12
+
13
+ export const deleteInvitation = (organizationId: string, email: string) =>
14
+ getEndpoint()
15
+ .delete(`/organizations/${organizationId}/invitation/${email}`)
16
+ .then((r) => r.data);
17
+
18
+ export const updateInvitation = (organizationId: string, email: string, params: any) =>
19
+ getEndpoint()
20
+ .patch(`/organizations/${organizationId}/invitation/${email}`, params)
21
+ .then((r) => r.data);
22
+
23
+ export const resendInvitation = (organizationId: string, email: string) =>
24
+ getEndpoint()
25
+ .post(`/organizations/${organizationId}/invitation/${email}/resend`)
26
+ .then((r) => r.data);
27
+
28
+ export const claimInvitation = (organizationId: string, email: string, params: any) =>
29
+ getEndpoint()
30
+ .put(`/organizations/${organizationId}/invitation/${email}`, params)
31
+ .then((r) => r.data);
32
+
33
+ export const claimNewUser = (organizationId: string, email: string, token: string) =>
34
+ getEndpoint()
35
+ .put(`/organizations/${organizationId}/invitation/${email}/token/${token}/new_user`)
36
+ .then((r) => r.data);
@@ -0,0 +1,26 @@
1
+ import {getEndpoint} from '../HTTP/Transport';
2
+
3
+ export const getMembers = (organizationId: string) =>
4
+ getEndpoint()
5
+ .get(`/organizations/${organizationId}/profiles`)
6
+ .then((r) => r.data);
7
+
8
+ export const deleteMember = (organizationId: string, profileId: string) =>
9
+ getEndpoint()
10
+ .delete(`/organizations/${organizationId}/profiles/${profileId}`)
11
+ .then((r) => r.data);
12
+
13
+ export const addMemberRole = (organizationId: string, profileId: string, roleId: string) =>
14
+ getEndpoint()
15
+ .post(`/organizations/${organizationId}/profiles/${profileId}/roles/${roleId}`)
16
+ .then((r) => r.data);
17
+
18
+ export const deleteMemberRole = (organizationId: string, profileId: string, roleId: string) =>
19
+ getEndpoint()
20
+ .delete(`/organizations/${organizationId}/profiles/${profileId}/roles/${roleId}`)
21
+ .then((r) => r.data);
22
+
23
+ export const getMemberPlans = (organizationId: string, profileId: string) =>
24
+ getEndpoint()
25
+ .get(`/organizations/${organizationId}/profiles/${profileId}/plans`)
26
+ .then((r) => r.data);
@@ -0,0 +1,32 @@
1
+ import {getEndpoint} from '../HTTP/Transport';
2
+ import {IOrganization} from './Types';
3
+
4
+ export const getOrganizations = () =>
5
+ getEndpoint()
6
+ .get<IOrganization[]>('/organizations')
7
+ .then((r) => r.data);
8
+
9
+ export const createOrganization = () =>
10
+ getEndpoint()
11
+ .post<IOrganization>('/organizations')
12
+ .then((r) => r.data);
13
+
14
+ export const validateOrganization = () =>
15
+ getEndpoint()
16
+ .get<IOrganization>('/organizations/is_valid')
17
+ .then((r) => r.data);
18
+
19
+ export const deleteOrganization = (organizationId: string) =>
20
+ getEndpoint()
21
+ .delete(`/organizations/${organizationId}`)
22
+ .then((r) => r.data);
23
+
24
+ export const getOrganization = (organizationId: string) =>
25
+ getEndpoint()
26
+ .get(`/organizations/${organizationId}`)
27
+ .then((r) => r.data);
28
+
29
+ export const updateOrganization = (organizationId: string, params: any) =>
30
+ getEndpoint()
31
+ .patch(`/organizations/${organizationId}`, params)
32
+ .then((r) => r.data);
@@ -0,0 +1,63 @@
1
+ import {IProfile, TPermission, TRole} from '../Users/Types';
2
+
3
+ export interface IOrganization {
4
+ /** The unique ID of the organization */
5
+ id: string;
6
+ /** The organization's name. */
7
+ name: string;
8
+ address: string | null;
9
+ phone: string | null;
10
+ /** If the organization is a business, its name. Note that a business name can be different from an organization name. */
11
+ business_name: string | null;
12
+ /** If true, the organization is a business */
13
+ is_business: boolean;
14
+ address2: string | null;
15
+ contact_email: string | null;
16
+ timezone: string | null;
17
+ envelope_responsible: boolean;
18
+ }
19
+
20
+ export interface ICreateApiKeyRequest {
21
+ name: string;
22
+ profile_id: string;
23
+ }
24
+
25
+ export interface IUpdateApiKeyRequest {
26
+ name?: string;
27
+ profile_id?: string;
28
+ }
29
+
30
+ export interface IApiKey {
31
+ client_id: string;
32
+ name: string;
33
+ profile_id: string;
34
+ organization_id: string;
35
+ }
36
+
37
+ export interface IApiKeyWithSecret extends IApiKey {
38
+ client_id: string;
39
+ client_secret: string;
40
+ name: string;
41
+ profile_id: string;
42
+ organization_id: string;
43
+ }
44
+
45
+ export interface IGroup {
46
+ id: string;
47
+ name: string;
48
+ organization_id: string;
49
+ /** For future expansion. In the future, Verdocs may support group hierarchies. Until then this field is always null. */
50
+ parent_id: string | null;
51
+ /** Some operations will additionally return a list of permissions. */
52
+ permissions?: TPermission[];
53
+ /** Some operations will additionally return a list of roles. */
54
+ roles?: TRole[];
55
+ /** Some operations will additionally return a list of profiles. */
56
+ profiles?: IProfile[];
57
+ }
58
+
59
+ export interface IGroupDetail extends IGroup {
60
+ permissions: TPermission[];
61
+ roles: TRole[];
62
+ profiles: IProfile[];
63
+ }
@@ -0,0 +1,11 @@
1
+ import {getEndpoint} from '../HTTP/Transport';
2
+
3
+ export const getWebhook = (organizationId: string) =>
4
+ getEndpoint()
5
+ .get(`/organizations/${organizationId}/webhook`)
6
+ .then((r) => r.data);
7
+
8
+ export const updateWebhook = (organizationId: string, params: any) =>
9
+ getEndpoint()
10
+ .post(`/organizations/${organizationId}/webhook`, params)
11
+ .then((r) => r.data);