@keeper-security/keeperapi 16.0.1 → 16.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/code/cache/07113f92cc3a9f5dc57b92f54542a63463f1fa9a +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/code/cache/1ba6467ba06d4bfc0c8581f4ee12c2c0f687214e +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/code/cache/1de1e40928c5c58c4f677d93986cdff01b3d0417 +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/code/cache/47382883a57ad5790d3fd6abd39f33f773726b3b +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/code/cache/4939a895ecf4daac58b0d73bccd49876515d41b8 +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/code/cache/592d89407340c5ec6ad006df327e588b3f442eca +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/code/cache/59783c8cc0cc9d984f5407c218d213bca4c98503 +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/code/cache/61fa6cf725249a1cae9b94b74a8c23aa3efd2ca1 +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/code/cache/77aced5528ce05fe900fdf7634042ec3c0f18255 +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/code/cache/b32ea8d6d3de0c6d8e178eff069fea4e11fa92b1 +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/code/cache/c05be8364ff56aba0298689783666ddb97a31285 +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/code/cache/e23bf49223ba8b7ec926e46c40b27b0353cfc50e +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/code/cache/eec92c105b2694c31bff21903ddc3ef81af8f056 +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/semanticDiagnostics/cache/07113f92cc3a9f5dc57b92f54542a63463f1fa9a +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/semanticDiagnostics/cache/1ba6467ba06d4bfc0c8581f4ee12c2c0f687214e +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/semanticDiagnostics/cache/1de1e40928c5c58c4f677d93986cdff01b3d0417 +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/semanticDiagnostics/cache/47382883a57ad5790d3fd6abd39f33f773726b3b +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/semanticDiagnostics/cache/4939a895ecf4daac58b0d73bccd49876515d41b8 +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/semanticDiagnostics/cache/592d89407340c5ec6ad006df327e588b3f442eca +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/semanticDiagnostics/cache/59783c8cc0cc9d984f5407c218d213bca4c98503 +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/semanticDiagnostics/cache/61fa6cf725249a1cae9b94b74a8c23aa3efd2ca1 +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/semanticDiagnostics/cache/77aced5528ce05fe900fdf7634042ec3c0f18255 +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/semanticDiagnostics/cache/b32ea8d6d3de0c6d8e178eff069fea4e11fa92b1 +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/semanticDiagnostics/cache/c05be8364ff56aba0298689783666ddb97a31285 +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/semanticDiagnostics/cache/e23bf49223ba8b7ec926e46c40b27b0353cfc50e +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/semanticDiagnostics/cache/eec92c105b2694c31bff21903ddc3ef81af8f056 +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/syntacticDiagnostics/cache/07113f92cc3a9f5dc57b92f54542a63463f1fa9a +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/syntacticDiagnostics/cache/1ba6467ba06d4bfc0c8581f4ee12c2c0f687214e +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/syntacticDiagnostics/cache/1de1e40928c5c58c4f677d93986cdff01b3d0417 +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/syntacticDiagnostics/cache/47382883a57ad5790d3fd6abd39f33f773726b3b +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/syntacticDiagnostics/cache/4939a895ecf4daac58b0d73bccd49876515d41b8 +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/syntacticDiagnostics/cache/592d89407340c5ec6ad006df327e588b3f442eca +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/syntacticDiagnostics/cache/59783c8cc0cc9d984f5407c218d213bca4c98503 +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/syntacticDiagnostics/cache/61fa6cf725249a1cae9b94b74a8c23aa3efd2ca1 +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/syntacticDiagnostics/cache/77aced5528ce05fe900fdf7634042ec3c0f18255 +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/syntacticDiagnostics/cache/b32ea8d6d3de0c6d8e178eff069fea4e11fa92b1 +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/syntacticDiagnostics/cache/c05be8364ff56aba0298689783666ddb97a31285 +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/syntacticDiagnostics/cache/e23bf49223ba8b7ec926e46c40b27b0353cfc50e +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/syntacticDiagnostics/cache/eec92c105b2694c31bff21903ddc3ef81af8f056 +1 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/types/cache/20b49cde4def23063b280689e4ff4d5a3803712b +0 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/types/cache/3809196a67de680945038f2b4846e2e3b4af35aa +0 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/types/cache/4ad5d47b1ce7bf45cc7d9ff8c970e1fc57f446f3 +0 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/types/cache/5a0816a3c916ff0e4961dc0ec2da48646f2ac5aa +0 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/types/cache/6182f5491d41e8f10acfbcf46ee875587904f5a3 +0 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/types/cache/7ca2e31bcece668dfa5de5e1349ba34a757b5140 +0 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/types/cache/86a4b0102f5568ac0a5b946d05c55f42c30b472d +0 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/types/cache/87fae47dd5b05377c04cfe377699d748414dc1c9 +0 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/types/cache/a7c23ecebcaf23c9346007731c5796b96c580738 +0 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/types/cache/ac4d101c3489192db3e0ec98430a2336cba9a741 +0 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/types/cache/b1eb441c5b806d06ba6bb36fcfd0cc4746c23a8a +0 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/types/cache/b7942903000069a51e317fef1595a8ea1d8b828d +0 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/types/cache/cee91236390168fd38b01aaae7bed3099bb4555a +0 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/types/cache/d7c87ce194d923e6f02c7e570008e88ade1cbabf +0 -0
- package/.rpt2_cache/rpt2_73ef004c41e5fb714e8076cf96455df4f040d49c/types/cache/fba70878178c036fb4e9e1f19bdb465a1270d258 +0 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/code/cache/05d17f791979143cbce20e3e3e811aa19ed8b492 +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/code/cache/07113f92cc3a9f5dc57b92f54542a63463f1fa9a +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/code/cache/1ba6467ba06d4bfc0c8581f4ee12c2c0f687214e +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/code/cache/1de1e40928c5c58c4f677d93986cdff01b3d0417 +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/code/cache/47382883a57ad5790d3fd6abd39f33f773726b3b +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/code/cache/4d58c1113d07816b1909aaef4395fd8b4d0ee13c +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/code/cache/4ee978699d6de2a60214b16c42d87f8e9309636b +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/code/cache/50f4a014d14ada987c125e6ea55d4e6e75605313 +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/code/cache/58aa8c228c99b690d3ca1f3b464585c41d1cd4bb +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/code/cache/592d89407340c5ec6ad006df327e588b3f442eca +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/code/cache/59783c8cc0cc9d984f5407c218d213bca4c98503 +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/code/cache/61fa6cf725249a1cae9b94b74a8c23aa3efd2ca1 +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/code/cache/89f8a81d9d078b69f9fa7fa95251b38ccc394a3b +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/code/cache/b32ea8d6d3de0c6d8e178eff069fea4e11fa92b1 +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/code/cache/c05be8364ff56aba0298689783666ddb97a31285 +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/code/cache/e23bf49223ba8b7ec926e46c40b27b0353cfc50e +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/code/cache/eec92c105b2694c31bff21903ddc3ef81af8f056 +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/semanticDiagnostics/cache/05d17f791979143cbce20e3e3e811aa19ed8b492 +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/semanticDiagnostics/cache/07113f92cc3a9f5dc57b92f54542a63463f1fa9a +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/semanticDiagnostics/cache/1ba6467ba06d4bfc0c8581f4ee12c2c0f687214e +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/semanticDiagnostics/cache/1de1e40928c5c58c4f677d93986cdff01b3d0417 +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/semanticDiagnostics/cache/47382883a57ad5790d3fd6abd39f33f773726b3b +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/semanticDiagnostics/cache/4d58c1113d07816b1909aaef4395fd8b4d0ee13c +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/semanticDiagnostics/cache/4ee978699d6de2a60214b16c42d87f8e9309636b +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/semanticDiagnostics/cache/50f4a014d14ada987c125e6ea55d4e6e75605313 +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/semanticDiagnostics/cache/58aa8c228c99b690d3ca1f3b464585c41d1cd4bb +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/semanticDiagnostics/cache/592d89407340c5ec6ad006df327e588b3f442eca +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/semanticDiagnostics/cache/59783c8cc0cc9d984f5407c218d213bca4c98503 +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/semanticDiagnostics/cache/61fa6cf725249a1cae9b94b74a8c23aa3efd2ca1 +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/semanticDiagnostics/cache/89f8a81d9d078b69f9fa7fa95251b38ccc394a3b +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/semanticDiagnostics/cache/b32ea8d6d3de0c6d8e178eff069fea4e11fa92b1 +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/semanticDiagnostics/cache/c05be8364ff56aba0298689783666ddb97a31285 +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/semanticDiagnostics/cache/e23bf49223ba8b7ec926e46c40b27b0353cfc50e +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/semanticDiagnostics/cache/eec92c105b2694c31bff21903ddc3ef81af8f056 +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/syntacticDiagnostics/cache/05d17f791979143cbce20e3e3e811aa19ed8b492 +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/syntacticDiagnostics/cache/07113f92cc3a9f5dc57b92f54542a63463f1fa9a +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/syntacticDiagnostics/cache/1ba6467ba06d4bfc0c8581f4ee12c2c0f687214e +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/syntacticDiagnostics/cache/1de1e40928c5c58c4f677d93986cdff01b3d0417 +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/syntacticDiagnostics/cache/47382883a57ad5790d3fd6abd39f33f773726b3b +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/syntacticDiagnostics/cache/4d58c1113d07816b1909aaef4395fd8b4d0ee13c +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/syntacticDiagnostics/cache/4ee978699d6de2a60214b16c42d87f8e9309636b +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/syntacticDiagnostics/cache/50f4a014d14ada987c125e6ea55d4e6e75605313 +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/syntacticDiagnostics/cache/58aa8c228c99b690d3ca1f3b464585c41d1cd4bb +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/syntacticDiagnostics/cache/592d89407340c5ec6ad006df327e588b3f442eca +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/syntacticDiagnostics/cache/59783c8cc0cc9d984f5407c218d213bca4c98503 +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/syntacticDiagnostics/cache/61fa6cf725249a1cae9b94b74a8c23aa3efd2ca1 +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/syntacticDiagnostics/cache/89f8a81d9d078b69f9fa7fa95251b38ccc394a3b +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/syntacticDiagnostics/cache/b32ea8d6d3de0c6d8e178eff069fea4e11fa92b1 +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/syntacticDiagnostics/cache/c05be8364ff56aba0298689783666ddb97a31285 +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/syntacticDiagnostics/cache/e23bf49223ba8b7ec926e46c40b27b0353cfc50e +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/syntacticDiagnostics/cache/eec92c105b2694c31bff21903ddc3ef81af8f056 +1 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/types/cache/20b49cde4def23063b280689e4ff4d5a3803712b +0 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/types/cache/3809196a67de680945038f2b4846e2e3b4af35aa +0 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/types/cache/4ad5d47b1ce7bf45cc7d9ff8c970e1fc57f446f3 +0 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/types/cache/5a0816a3c916ff0e4961dc0ec2da48646f2ac5aa +0 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/types/cache/6182f5491d41e8f10acfbcf46ee875587904f5a3 +0 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/types/cache/7ca2e31bcece668dfa5de5e1349ba34a757b5140 +0 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/types/cache/86a4b0102f5568ac0a5b946d05c55f42c30b472d +0 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/types/cache/87fae47dd5b05377c04cfe377699d748414dc1c9 +0 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/types/cache/a7c23ecebcaf23c9346007731c5796b96c580738 +0 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/types/cache/ac4d101c3489192db3e0ec98430a2336cba9a741 +0 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/types/cache/b1eb441c5b806d06ba6bb36fcfd0cc4746c23a8a +0 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/types/cache/b7942903000069a51e317fef1595a8ea1d8b828d +0 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/types/cache/cee91236390168fd38b01aaae7bed3099bb4555a +0 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/types/cache/d7c87ce194d923e6f02c7e570008e88ade1cbabf +0 -0
- package/.rpt2_cache/rpt2_e52dc086a65136b8064433446ffcd05307935b95/types/cache/fba70878178c036fb4e9e1f19bdb465a1270d258 +0 -0
- package/babel.config.js +6 -0
- package/package.json +7 -10
- package/rollup.config.js +50 -0
- package/scripts/cleanDistFolder.js +9 -0
- package/src/__tests__/utils.test.js +13 -0
- package/src/auth.ts +1514 -0
- package/src/browser/asn1hex.ts +296 -0
- package/src/browser/index.ts +17 -0
- package/src/browser/jsbn.ts +1213 -0
- package/src/browser/platform.ts +434 -0
- package/src/browser/rng.ts +15 -0
- package/src/browser/rsa.ts +262 -0
- package/src/commands.ts +1378 -0
- package/src/company.ts +244 -0
- package/src/configuration.ts +125 -0
- package/src/endpoint.ts +350 -0
- package/src/node/index.ts +17 -0
- package/src/node/platform.ts +283 -0
- package/src/platform.ts +76 -0
- package/{dist → src}/proto.d.ts +0 -0
- package/src/proto.js +136564 -0
- package/src/restMessages.ts +311 -0
- package/src/utils.ts +169 -0
- package/src/vault.ts +844 -0
- package/src/vendorContext.ts +69 -0
- package/src/vendorModel.ts +36 -0
- package/tsconfig.json +14 -0
- package/tsconfig.rollup.json +14 -0
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import {Writer} from 'protobufjs'
|
|
2
|
+
import {AccountSummary, Authentication, BreachWatch, Automator, Enterprise, Records, ServiceLogger, SsoCloud} from './proto'
|
|
3
|
+
|
|
4
|
+
export interface RestMessage<TIn, TOut> {
|
|
5
|
+
path: string
|
|
6
|
+
toBytes(): Uint8Array
|
|
7
|
+
fromBytes(data: Uint8Array): TOut
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
type encoderClass<T> = {
|
|
11
|
+
encode: (message: T, writer?: Writer) => Writer;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
type decoderClass<T> = {
|
|
15
|
+
decode: (reader: Uint8Array, length?: number) => T;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function createMessage<TIn, TOut>(data: TIn, path: string, encoder: encoderClass<TIn>, decoder: decoderClass<TOut>): RestMessage<TIn, TOut> {
|
|
19
|
+
return {
|
|
20
|
+
path: path,
|
|
21
|
+
toBytes(): Uint8Array {
|
|
22
|
+
return encoder ? encoder.encode(data).finish() : null
|
|
23
|
+
},
|
|
24
|
+
fromBytes(data: Uint8Array): TOut {
|
|
25
|
+
return decoder.decode(data)
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// new login
|
|
31
|
+
|
|
32
|
+
export const registerDeviceMessage = (data: Authentication.IDeviceRegistrationRequest): RestMessage<Authentication.IDeviceRegistrationRequest, Authentication.IDevice> =>
|
|
33
|
+
createMessage(data, 'authentication/register_device', Authentication.DeviceRegistrationRequest, Authentication.Device)
|
|
34
|
+
|
|
35
|
+
export const registerDeviceInRegionMessage = (data: Authentication.IRegisterDeviceInRegionRequest): RestMessage<Authentication.IRegisterDeviceInRegionRequest, {}> =>
|
|
36
|
+
createMessage(data, 'authentication/register_device_in_region', Authentication.RegisterDeviceInRegionRequest, null)
|
|
37
|
+
|
|
38
|
+
export const updateDeviceMessage = (data: Authentication.IDeviceUpdateRequest): RestMessage<Authentication.IDeviceUpdateRequest, {}> =>
|
|
39
|
+
createMessage(data, 'authentication/update_device', Authentication.DeviceUpdateRequest, null)
|
|
40
|
+
|
|
41
|
+
export const requestDeviceVerificationMessage = (data: Authentication.IDeviceVerificationRequest): RestMessage<Authentication.IDeviceVerificationRequest, {}> =>
|
|
42
|
+
createMessage(data, 'authentication/request_device_verification', Authentication.DeviceVerificationRequest, null)
|
|
43
|
+
|
|
44
|
+
export const requestCreateUserMessage = (data: Authentication.ICreateUserRequest, isSso: boolean): RestMessage<Authentication.ICreateUserRequest, {}> =>
|
|
45
|
+
createMessage(data, isSso ? 'authentication/create_user_sso' : 'authentication/request_create_user', Authentication.CreateUserRequest, null)
|
|
46
|
+
|
|
47
|
+
export const startLoginMessage = (data: Authentication.IStartLoginRequest): RestMessage<Authentication.IStartLoginRequest, Authentication.ILoginResponse> =>
|
|
48
|
+
createMessage(data, 'authentication/start_login', Authentication.StartLoginRequest, Authentication.LoginResponse)
|
|
49
|
+
|
|
50
|
+
export const validateAuthHashMessage = (data: Authentication.IValidateAuthHashRequest): RestMessage<Authentication.IValidateAuthHashRequest, Authentication.ILoginResponse> =>
|
|
51
|
+
createMessage(data, 'authentication/validate_auth_hash', Authentication.ValidateAuthHashRequest, Authentication.LoginResponse)
|
|
52
|
+
|
|
53
|
+
export const twoFactorValidateMessage = (data: Authentication.ITwoFactorValidateRequest): RestMessage<Authentication.ITwoFactorValidateRequest, Authentication.ITwoFactorValidateResponse> =>
|
|
54
|
+
createMessage(data, 'authentication/2fa_validate', Authentication.TwoFactorValidateRequest, Authentication.TwoFactorValidateResponse)
|
|
55
|
+
|
|
56
|
+
export const twoFactorSend2FAPushMessage = (data: Authentication.ITwoFactorSendPushRequest): RestMessage<Authentication.ITwoFactorSendPushRequest, {}> =>
|
|
57
|
+
createMessage(data, 'authentication/2fa_send_push', Authentication.TwoFactorSendPushRequest, null)
|
|
58
|
+
|
|
59
|
+
export const twoFactorAdd = (data: Authentication.ITwoFactorAddRequest): RestMessage<Authentication.ITwoFactorAddRequest, Authentication.ITwoFactorAddResponse> =>
|
|
60
|
+
createMessage(data, 'authentication/2fa_add', Authentication.TwoFactorAddRequest, Authentication.TwoFactorAddResponse)
|
|
61
|
+
|
|
62
|
+
export const twoFactorAddValidate = (data: Authentication.ITwoFactorValidateRequest): RestMessage<Authentication.ITwoFactorValidateRequest, Authentication.ITwoFactorAddResponse> =>
|
|
63
|
+
createMessage(data, 'authentication/2fa_add_validate', Authentication.TwoFactorValidateRequest, Authentication.TwoFactorAddResponse)
|
|
64
|
+
|
|
65
|
+
export const twoFactorList = (data: Authentication.ITwoFactorChannelInfo): RestMessage<Authentication.ITwoFactorChannelInfo, Authentication.ITwoFactorListResponse> =>
|
|
66
|
+
createMessage(data, 'authentication/2fa_list', Authentication.TwoFactorChannelInfo, Authentication.TwoFactorListResponse)
|
|
67
|
+
|
|
68
|
+
export const twoFactorRename = (data: Authentication.ITwoFactorRenameRequest): RestMessage<Authentication.ITwoFactorRenameRequest, {}> =>
|
|
69
|
+
createMessage(data, 'authentication/2fa_rename', Authentication.TwoFactorRenameRequest, null)
|
|
70
|
+
|
|
71
|
+
export const twoFactorDelete = (data: Authentication.ITwoFactorDeleteRequest): RestMessage<Authentication.ITwoFactorDeleteRequest, {}> =>
|
|
72
|
+
createMessage(data, 'authentication/2fa_delete', Authentication.TwoFactorDeleteRequest, null)
|
|
73
|
+
|
|
74
|
+
export const twoFactorDuoStatus = (data: Authentication.ITwoFactorDuoStatus): RestMessage<Authentication.ITwoFactorDuoStatus, {}> =>
|
|
75
|
+
createMessage(data, 'authentication/2fa_duo_status', Authentication.TwoFactorDuoStatus, null)
|
|
76
|
+
|
|
77
|
+
export const approveDeviceMessage = (data: Authentication.IApproveDeviceRequest): RestMessage<Authentication.IApproveDeviceRequest, {}> =>
|
|
78
|
+
createMessage(data, 'authentication/approve_device', Authentication.ApproveDeviceRequest, null)
|
|
79
|
+
|
|
80
|
+
export const approveDeviceInstantMessage = (data: Authentication.IApproveDeviceRequest): RestMessage<Authentication.IApproveDeviceRequest, {}> =>
|
|
81
|
+
createMessage(data, 'authentication/approve_device_instant', Authentication.ApproveDeviceRequest, null)
|
|
82
|
+
|
|
83
|
+
export const validateDeviceVerificationCodeMessage = (data: Authentication.IValidateDeviceVerificationCodeRequest): RestMessage<Authentication.IValidateDeviceVerificationCodeRequest, {}> =>
|
|
84
|
+
createMessage(data, 'authentication/validate_device_verification_code', Authentication.ValidateDeviceVerificationCodeRequest, null)
|
|
85
|
+
|
|
86
|
+
export const validateCreateUserVerificationCodeMessage = (data: Authentication.IValidateCreateUserVerificationCodeRequest): RestMessage<Authentication.IValidateCreateUserVerificationCodeRequest, {}> =>
|
|
87
|
+
createMessage(data, 'authentication/validate_create_user_verification_code', Authentication.ValidateCreateUserVerificationCodeRequest, null)
|
|
88
|
+
|
|
89
|
+
export const approveUserDevicesMessage = (data: Enterprise.IApproveUserDevicesRequest): RestMessage<Enterprise.IApproveUserDevicesRequest, Enterprise.IApproveUserDevicesResponse> =>
|
|
90
|
+
createMessage(data, 'enterprise/approve_user_devices', Enterprise.ApproveUserDevicesRequest, Enterprise.ApproveUserDevicesResponse)
|
|
91
|
+
|
|
92
|
+
export const registerEncryptedDataKeyForDeviceMessage = (data: Authentication.IRegisterDeviceDataKeyRequest): RestMessage<Authentication.IRegisterDeviceDataKeyRequest, {}> =>
|
|
93
|
+
createMessage(data, 'authentication/register_encrypted_data_key_for_device', Authentication.RegisterDeviceDataKeyRequest, null)
|
|
94
|
+
|
|
95
|
+
export const setUserSettingMessage = (data: Authentication.IUserSettingRequest): RestMessage<Authentication.IUserSettingRequest, {}> =>
|
|
96
|
+
createMessage(data, 'setting/set_user_setting', Authentication.UserSettingRequest, null)
|
|
97
|
+
|
|
98
|
+
export const requestDeviceAdminApprovalMessage = (data: Authentication.IDeviceVerificationRequest): RestMessage<Authentication.IDeviceVerificationRequest, {}> =>
|
|
99
|
+
createMessage(data, 'authentication/request_device_admin_approval', Authentication.DeviceVerificationRequest, null)
|
|
100
|
+
|
|
101
|
+
export const requestSaltAndIterations = (): RestMessage<{}, Authentication.Salt> =>
|
|
102
|
+
createMessage({}, 'authentication/get_salt_and_iterations', null, Authentication.Salt)
|
|
103
|
+
|
|
104
|
+
export const validateMasterPasswordMessage = (data: Authentication.IMasterPasswordReentryRequest): RestMessage<Authentication.IMasterPasswordReentryRequest, {}> =>
|
|
105
|
+
createMessage(data, 'authentication/validate_master_password', Authentication.MasterPasswordReentryRequest, null)
|
|
106
|
+
|
|
107
|
+
export const startLoginMessageFromSessionToken = (data: Authentication.IStartLoginRequest): RestMessage<Authentication.IStartLoginRequest, Authentication.ILoginResponse> =>
|
|
108
|
+
createMessage(data, 'authentication/login_from_existing_session_token', Authentication.StartLoginRequest, Authentication.LoginResponse)
|
|
109
|
+
|
|
110
|
+
export const keepAliveMessage = (): RestMessage< {}, {}> => createMessage({}, 'keep_alive', null, null)
|
|
111
|
+
|
|
112
|
+
export const logoutV3Message = (): RestMessage<{}, {}> => createMessage({}, 'vault/logout_v3', null, null)
|
|
113
|
+
|
|
114
|
+
// end new login
|
|
115
|
+
|
|
116
|
+
export const deviceMessage = (data: Authentication.IDeviceRequest): RestMessage<Authentication.IDeviceRequest, Authentication.IDeviceResponse> =>
|
|
117
|
+
createMessage(data, 'authentication/get_device_token', Authentication.DeviceRequest, Authentication.DeviceResponse)
|
|
118
|
+
|
|
119
|
+
export const preLoginMessage = (data: Authentication.IPreLoginRequest): RestMessage<Authentication.IPreLoginRequest, Authentication.IPreLoginResponse> =>
|
|
120
|
+
createMessage(data, 'authentication/pre_login', Authentication.PreLoginRequest, Authentication.PreLoginResponse)
|
|
121
|
+
|
|
122
|
+
export const securityReportMessage = (data: Authentication.ISecurityReportRequest): RestMessage<Authentication.ISecurityReportRequest, Authentication.ISecurityReportResponse> =>
|
|
123
|
+
createMessage(data, 'enterprise/get_security_report_data', Authentication.SecurityReportRequest, Authentication.SecurityReportResponse)
|
|
124
|
+
|
|
125
|
+
export const enterpriseNodeToManagedCompanyMessage = (data: Enterprise.INodeToManagedCompanyRequest): RestMessage<Enterprise.INodeToManagedCompanyRequest, {}> =>
|
|
126
|
+
createMessage(data, 'enterprise/node_to_managed_company', Enterprise.NodeToManagedCompanyRequest, null)
|
|
127
|
+
|
|
128
|
+
export const recordTypesGetMessage = (data: Records.IRecordTypesRequest): RestMessage<Records.IRecordTypesRequest, Records.IRecordTypesResponse> =>
|
|
129
|
+
createMessage(data, 'vault/get_record_types', Records.RecordTypesRequest, Records.RecordTypesResponse)
|
|
130
|
+
|
|
131
|
+
export const recordTypeAddMessage = (data: Records.IRecordType): RestMessage<Records.IRecordType, Records.IRecordTypeModifyResponse> =>
|
|
132
|
+
createMessage(data, 'vault/record_type_add', Records.RecordType, Records.RecordTypeModifyResponse)
|
|
133
|
+
|
|
134
|
+
export const recordTypeUpdateMessage = (data: Records.IRecordType): RestMessage<Records.IRecordType, Records.IRecordTypeModifyResponse> =>
|
|
135
|
+
createMessage(data, 'vault/record_type_update', Records.RecordType, Records.RecordTypeModifyResponse)
|
|
136
|
+
|
|
137
|
+
export const recordTypeDeleteMessage = (data: Records.IRecordType): RestMessage<Records.IRecordType, Records.IRecordTypeModifyResponse> =>
|
|
138
|
+
createMessage(data, 'vault/record_type_delete', Records.RecordType, Records.RecordTypeModifyResponse)
|
|
139
|
+
|
|
140
|
+
export const recordsGetMessage = (data: Records.IRecordsGetRequest): RestMessage<Records.IRecordsGetRequest, Records.IRecordsGetResponse> =>
|
|
141
|
+
createMessage(data, 'vault/records_get', Records.RecordsGetRequest, Records.RecordsGetResponse)
|
|
142
|
+
|
|
143
|
+
export const recordsAddMessage = (data: Records.IRecordsAddRequest): RestMessage<Records.IRecordsAddRequest, Records.IRecordsModifyResponse> =>
|
|
144
|
+
createMessage(data, 'vault/records_add', Records.RecordsAddRequest, Records.RecordsModifyResponse)
|
|
145
|
+
|
|
146
|
+
export const recordsUpdateMessage = (data: Records.IRecordsUpdateRequest): RestMessage<Records.IRecordsUpdateRequest, Records.IRecordsModifyResponse> =>
|
|
147
|
+
createMessage(data, 'vault/records_update', Records.RecordsUpdateRequest, Records.RecordsModifyResponse)
|
|
148
|
+
|
|
149
|
+
export const fileDownloadMessage = (data: Records.IFilesGetRequest): RestMessage<Records.IFilesGetRequest, Records.IFilesGetResponse> =>
|
|
150
|
+
createMessage(data, 'vault/files_download', Records.FilesGetRequest, Records.FilesGetResponse)
|
|
151
|
+
|
|
152
|
+
export const fileAddMessage = (data: Records.IFilesAddRequest): RestMessage<Records.IFilesAddRequest, Records.IFilesAddResponse> =>
|
|
153
|
+
createMessage(data, 'vault/files_add', Records.FilesAddRequest, Records.FilesAddResponse)
|
|
154
|
+
|
|
155
|
+
export const recordsConvert3Message = (data: Records.RecordsConvertToV3Request): RestMessage<Records.IRecordsConvertToV3Request, Records.RecordsModifyResponse> =>
|
|
156
|
+
createMessage(data, 'vault/records_convert3', Records.RecordsConvertToV3Request, Records.RecordsModifyResponse)
|
|
157
|
+
|
|
158
|
+
export const recordAddAuditData = (data: Records.AddAuditDataRequest): RestMessage<Records.IAddAuditDataRequest, {}> => createMessage(data, 'vault/record_add_audit_data', Records.AddAuditDataRequest, null)
|
|
159
|
+
|
|
160
|
+
export const accountSummaryMessage = (data: AccountSummary.IAccountSummaryRequest): RestMessage<AccountSummary.IAccountSummaryRequest, AccountSummary.IAccountSummaryElements> =>
|
|
161
|
+
createMessage(data, 'login/account_summary', AccountSummary.AccountSummaryRequest, AccountSummary.AccountSummaryElements)
|
|
162
|
+
|
|
163
|
+
export const sendSessionMessage = (data: Authentication.ISendSessionMessageRequest): RestMessage<Authentication.ISendSessionMessageRequest, {}> =>
|
|
164
|
+
createMessage(data, 'pushserver/send_session_message', Authentication.SendSessionMessageRequest, null)
|
|
165
|
+
|
|
166
|
+
export const setEncryptedTeamKeyMessage = (data: Enterprise.IEncryptedTeamKeyRequest): RestMessage<Enterprise.IEncryptedTeamKeyRequest, {}> =>
|
|
167
|
+
createMessage(data, 'enterprise/set_encrypted_team_key', Enterprise.EncryptedTeamKeyRequest, null)
|
|
168
|
+
|
|
169
|
+
export const getBackupMessage = (data: Enterprise.IBackupRequest): RestMessage<Enterprise.IBackupRequest, Enterprise.IBackupResponse> =>
|
|
170
|
+
createMessage(data, 'enterprise/get_backup', Enterprise.BackupRequest, Enterprise.BackupResponse)
|
|
171
|
+
|
|
172
|
+
export const getEnterprisePublicKeyMessage = (): RestMessage<{}, BreachWatch.IEnterprisePublicKeyResponse> =>
|
|
173
|
+
createMessage({}, 'enterprise/get_enterprise_public_key', null, BreachWatch.EnterprisePublicKeyResponse)
|
|
174
|
+
|
|
175
|
+
export const getEnterpriseDataForUserMessage = (data: Enterprise.IEnterpriseDataRequest): RestMessage<Enterprise.IEnterpriseDataRequest, Enterprise.IEnterpriseDataResponse> =>
|
|
176
|
+
createMessage(data, 'enterprise/get_enterprise_data_for_user', Enterprise.EnterpriseDataRequest, Enterprise.EnterpriseDataResponse)
|
|
177
|
+
|
|
178
|
+
export const setEnterpriseDataKeyMessage = (data: Enterprise.IEnterpriseUserDataKey): RestMessage<Enterprise.IEnterpriseUserDataKey, {}> =>
|
|
179
|
+
createMessage(data, 'enterprise/set_enterprise_user_data_key', Enterprise.EnterpriseUserDataKey, null)
|
|
180
|
+
|
|
181
|
+
export const setV2AlternatePasswordMessage = (data: Authentication.IUserAuthRequest): RestMessage<Authentication.IUserAuthRequest, {}> =>
|
|
182
|
+
createMessage(data, 'authentication/set_v2_alternate_password', Authentication.UserAuthRequest, null)
|
|
183
|
+
|
|
184
|
+
export const getMasterPasswordSaltMessage = (): RestMessage<{}, Authentication.ISalt> =>
|
|
185
|
+
createMessage({}, 'setting/get_master_password_salt', null, Authentication.Salt)
|
|
186
|
+
|
|
187
|
+
export const getPublicKeysMessage = (data: Authentication.IGetPublicKeysRequest): RestMessage<Authentication.IGetPublicKeysRequest, Authentication.IGetPublicKeysResponse> =>
|
|
188
|
+
createMessage(data, 'vault/get_public_keys', Authentication.GetPublicKeysRequest, Authentication.GetPublicKeysResponse)
|
|
189
|
+
|
|
190
|
+
export const setEccKeyPairMessage = (data: Authentication.ISetEccKeyPairRequest): RestMessage<Authentication.ISetEccKeyPairRequest, {}> =>
|
|
191
|
+
createMessage(data, 'vault/set_ecc_key_pair', Authentication.SetEccKeyPairRequest, null)
|
|
192
|
+
|
|
193
|
+
export const applicationAddMessage = (data: Records.IApplicationAddRequest): RestMessage<Records.IApplicationAddRequest, {}> =>
|
|
194
|
+
createMessage(data, 'vault/application_add', Records.ApplicationAddRequest, null)
|
|
195
|
+
|
|
196
|
+
export const addAppShareMessage = (data: Authentication.IAddAppSharesRequest): RestMessage<Authentication.IAddAppSharesRequest, {}> =>
|
|
197
|
+
createMessage(data, 'vault/app_share_add', Authentication.AddAppSharesRequest, null)
|
|
198
|
+
|
|
199
|
+
export const removeAppShareMessage = (data: Authentication.IRemoveAppSharesRequest): RestMessage<Authentication.IRemoveAppSharesRequest, {}> =>
|
|
200
|
+
createMessage(data, 'vault/app_share_remove', Authentication.RemoveAppSharesRequest, null)
|
|
201
|
+
|
|
202
|
+
export const addAppClientMessage = (data: Authentication.IAddAppClientRequest): RestMessage<Authentication.IAddAppClientRequest, Authentication.IDevice> =>
|
|
203
|
+
createMessage(data, 'vault/app_client_add', Authentication.AddAppClientRequest, Authentication.Device)
|
|
204
|
+
|
|
205
|
+
export const addExternalShareMessage = (data: Authentication.IAddExternalShareRequest): RestMessage<Authentication.IAddExternalShareRequest, Authentication.IDevice> =>
|
|
206
|
+
createMessage(data, 'vault/external_share_add', Authentication.AddExternalShareRequest, Authentication.Device)
|
|
207
|
+
|
|
208
|
+
export const removeExternalShareMessage = (data: Authentication.IRemoveAppClientsRequest): RestMessage<Authentication.IRemoveAppClientsRequest, {}> =>
|
|
209
|
+
createMessage(data, 'vault/external_share_remove', Authentication.RemoveAppClientsRequest, null)
|
|
210
|
+
|
|
211
|
+
export const removeAppClientMessage = (data: Authentication.IRemoveAppClientsRequest): RestMessage<Authentication.IRemoveAppClientsRequest, {}> =>
|
|
212
|
+
createMessage(data, 'vault/app_client_remove', Authentication.RemoveAppClientsRequest, null)
|
|
213
|
+
|
|
214
|
+
export const getAppInfoMessage = (data: Authentication.IGetAppInfoRequest): RestMessage<Authentication.IGetAppInfoRequest, Authentication.IGetAppInfoResponse> =>
|
|
215
|
+
createMessage(data, 'vault/get_app_info', Authentication.GetAppInfoRequest, Authentication.GetAppInfoResponse)
|
|
216
|
+
|
|
217
|
+
export const getApplicationsSummaryMessage = (): RestMessage<{}, Authentication.IGetApplicationsSummaryResponse> =>
|
|
218
|
+
createMessage({}, 'vault/get_applications_summary', null, Authentication.GetApplicationsSummaryResponse)
|
|
219
|
+
|
|
220
|
+
export const sendShareInviteMessage = (data: Authentication.ISendShareInviteRequest): RestMessage<Authentication.ISendShareInviteRequest, {}> =>
|
|
221
|
+
createMessage(data, 'vault/send_share_invite', Authentication.SendShareInviteRequest, null)
|
|
222
|
+
|
|
223
|
+
export const updateSecurityData = (data: Authentication.ISecurityDataRequest): RestMessage<Authentication.ISecurityDataRequest, Authentication.RevisionResponse> =>
|
|
224
|
+
createMessage(data, 'enterprise/update_security_data', Authentication.SecurityDataRequest, Authentication.RevisionResponse)
|
|
225
|
+
|
|
226
|
+
export const setReusedPasswords = (data: Authentication.IReusedPasswordsRequest): RestMessage<Authentication.IReusedPasswordsRequest, {}> =>
|
|
227
|
+
createMessage(data, 'enterprise/set_reused_passwords', Authentication.ReusedPasswordsRequest, null)
|
|
228
|
+
|
|
229
|
+
/* -- SERVICE LOGGER -- */
|
|
230
|
+
|
|
231
|
+
export const serviceLoggerGetMessage = (data: ServiceLogger.IServiceLogGetRequest): RestMessage<ServiceLogger.IServiceLogGetRequest, ServiceLogger.IServiceLogResponse> =>
|
|
232
|
+
createMessage(data, 'logger/get', ServiceLogger.ServiceLogGetRequest, ServiceLogger.ServiceLogResponse);
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
/* -- Cloud SSO Connect -- */
|
|
236
|
+
|
|
237
|
+
export const ssoSamlMessage = (endpoint: string): RestMessage<null, null> =>
|
|
238
|
+
createMessage(null, 'sso/saml/' + endpoint, null, null);
|
|
239
|
+
|
|
240
|
+
export const ssoConfigMessage = (endpoint: string): RestMessage<null, null> =>
|
|
241
|
+
createMessage(null, 'sso/config/' + endpoint, null, null);
|
|
242
|
+
|
|
243
|
+
export const ssoLoginMessageWithUrl = (url): RestMessage<null, null> =>
|
|
244
|
+
createMessage(null, url, null, null);
|
|
245
|
+
|
|
246
|
+
export const ssoLogoutMessage = (serviceProviderId, data): RestMessage<null, null> =>
|
|
247
|
+
createMessage(null, 'sso/saml/logout/' + serviceProviderId, null, null);
|
|
248
|
+
|
|
249
|
+
export const ssoGetMetadataMessage = (serviceProviderId): RestMessage<null, null> =>
|
|
250
|
+
createMessage(null, 'sso/saml/metadata/' + serviceProviderId, null, null);
|
|
251
|
+
|
|
252
|
+
export const ssoUploadIdpMetadataMessage = (data: SsoCloud.ISsoCloudIdpMetadataRequest): RestMessage<SsoCloud.ISsoCloudIdpMetadataRequest, SsoCloud.ISsoCloudConfigurationValidationResponse> =>
|
|
253
|
+
createMessage(data, 'sso/config/sso_cloud_upload_idp_metadata', SsoCloud.SsoCloudIdpMetadataRequest, SsoCloud.SsoCloudConfigurationValidationResponse);
|
|
254
|
+
|
|
255
|
+
export const ssoCloudServiceProviderUpdateRequestMessage = (data: SsoCloud.ISsoCloudServiceProviderUpdateRequest): RestMessage<SsoCloud.ISsoCloudServiceProviderUpdateRequest, SsoCloud.ISsoCloudConfigurationResponse> =>
|
|
256
|
+
createMessage(data, 'sso/config/sso_cloud_sp_configuration_set', SsoCloud.SsoCloudServiceProviderUpdateRequest, SsoCloud.SsoCloudConfigurationResponse);
|
|
257
|
+
|
|
258
|
+
export const ssoCloudConfigurationRequestMessage = (data: SsoCloud.ISsoCloudConfigurationRequest, url: string): RestMessage<SsoCloud.ISsoCloudConfigurationRequest, SsoCloud.ISsoCloudConfigurationResponse> =>
|
|
259
|
+
createMessage(data, url, SsoCloud.SsoCloudConfigurationRequest, SsoCloud.SsoCloudConfigurationResponse);
|
|
260
|
+
|
|
261
|
+
export const ssoCloudLogRequestMessage = (data: SsoCloud.ISsoCloudLogRequest, url: string): RestMessage<SsoCloud.ISsoCloudLogRequest, ServiceLogger.IServiceLogResponse> =>
|
|
262
|
+
createMessage(data, url, SsoCloud.SsoCloudLogRequest, ServiceLogger.ServiceLogResponse);
|
|
263
|
+
|
|
264
|
+
export const ssoCloudSAMLLogRequestMessage = (data: SsoCloud.ISsoCloudSAMLLogRequest, url: string): RestMessage<SsoCloud.ISsoCloudSAMLLogRequest, SsoCloud.ISsoCloudSAMLLogResponse> =>
|
|
265
|
+
createMessage(data, url, SsoCloud.SsoCloudSAMLLogRequest, SsoCloud.SsoCloudSAMLLogResponse);
|
|
266
|
+
|
|
267
|
+
export const ssoCloudServiceProviderConfigurationListRequestMessage = (data: SsoCloud.ISsoCloudServiceProviderConfigurationListRequest): RestMessage<SsoCloud.ISsoCloudServiceProviderConfigurationListRequest, SsoCloud.ISsoCloudServiceProviderConfigurationListResponse> =>
|
|
268
|
+
createMessage(data, 'sso/config/sso_cloud_sp_configuration_get', SsoCloud.SsoCloudServiceProviderConfigurationListRequest, SsoCloud.SsoCloudServiceProviderConfigurationListResponse);
|
|
269
|
+
|
|
270
|
+
export const ssoServiceProviderRequestMessage = (data: Authentication.ISsoServiceProviderRequest): RestMessage<Authentication.ISsoServiceProviderRequest, Authentication.ISsoServiceProviderResponse> =>
|
|
271
|
+
createMessage(data, 'enterprise/get_sso_service_provider', Authentication.SsoServiceProviderRequest, Authentication.SsoServiceProviderResponse);
|
|
272
|
+
|
|
273
|
+
export const ssoCloudRequestMessage = (data: SsoCloud.ISsoCloudRequest): RestMessage<SsoCloud.ISsoCloudRequest, null> =>
|
|
274
|
+
createMessage(data, null, SsoCloud.SsoCloudRequest, null);
|
|
275
|
+
|
|
276
|
+
export const ssoCloudValidationRequestMessage = (data: SsoCloud.ISsoCloudConfigurationValidationRequest, url:string): RestMessage<SsoCloud.ISsoCloudConfigurationValidationRequest, SsoCloud.ISsoCloudConfigurationValidationResponse> =>
|
|
277
|
+
createMessage(data, url, SsoCloud.SsoCloudConfigurationValidationRequest, SsoCloud.SsoCloudConfigurationValidationResponse);
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
/* -- Keeper Automator -- */
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
export const automatorApproveDeviceMessage = (data: Automator.ApproveDeviceRequest, url:string): RestMessage<Automator.IApproveDeviceRequest, Automator.IAutomatorResponse> =>
|
|
284
|
+
createMessage(data, url, Automator.ApproveDeviceRequest, Automator.AutomatorResponse);
|
|
285
|
+
|
|
286
|
+
export const automatorAdminCreateMessage = (data: Automator.AdminCreateAutomatorRequest, url:string): RestMessage<Automator.IAdminCreateAutomatorRequest, Automator.IAdminResponse> =>
|
|
287
|
+
createMessage(data, url, Automator.AdminCreateAutomatorRequest, Automator.AdminResponse);
|
|
288
|
+
|
|
289
|
+
export const automatorAdminDeleteMessage = (data: Automator.AdminDeleteAutomatorRequest, url:string): RestMessage<Automator.IAdminDeleteAutomatorRequest, Automator.IAdminResponse> =>
|
|
290
|
+
createMessage(data, url, Automator.AdminDeleteAutomatorRequest, Automator.AdminResponse);
|
|
291
|
+
|
|
292
|
+
export const automatorAdminEditMessage = (data: Automator.AdminEditAutomatorRequest, url:string): RestMessage<Automator.IAdminEditAutomatorRequest, Automator.IAdminResponse> =>
|
|
293
|
+
createMessage(data, url, Automator.AdminEditAutomatorRequest, Automator.AdminResponse);
|
|
294
|
+
|
|
295
|
+
export const automatorAdminEnableMessage = (data: Automator.AdminEnableAutomatorRequest, url:string): RestMessage<Automator.IAdminEnableAutomatorRequest, Automator.IAdminResponse> =>
|
|
296
|
+
createMessage(data, url, Automator.AdminEnableAutomatorRequest, Automator.AdminResponse);
|
|
297
|
+
|
|
298
|
+
export const automatorAdminGetMessage = (data: Automator.AdminGetAutomatorRequest, url:string): RestMessage<Automator.IAdminGetAutomatorRequest, Automator.IAdminResponse> =>
|
|
299
|
+
createMessage(data, url, Automator.AdminGetAutomatorRequest, Automator.AdminResponse);
|
|
300
|
+
|
|
301
|
+
export const automatorAdminGetAllOnNodeMessage = (data: Automator.AdminGetAutomatorsOnNodeRequest, url:string): RestMessage<Automator.IAdminGetAutomatorsOnNodeRequest, Automator.IAdminResponse> =>
|
|
302
|
+
createMessage(data, url, Automator.AdminGetAutomatorsOnNodeRequest, Automator.AdminResponse);
|
|
303
|
+
|
|
304
|
+
export const automatorAdminGetAllForEnterpriseMessage = (data: Automator.AdminGetAutomatorsForEnterpriseRequest, url:string): RestMessage<Automator.IAdminGetAutomatorsForEnterpriseRequest, Automator.IAdminResponse> =>
|
|
305
|
+
createMessage(data, url, Automator.AdminGetAutomatorsForEnterpriseRequest, Automator.AdminResponse);
|
|
306
|
+
|
|
307
|
+
export const automatorAdminInitializeMessage = (data: Automator.AdminInitializeAutomatorRequest, url:string): RestMessage<Automator.IAdminInitializeAutomatorRequest, Automator.IAdminResponse> =>
|
|
308
|
+
createMessage(data, url, Automator.AdminInitializeAutomatorRequest, Automator.AdminResponse);
|
|
309
|
+
|
|
310
|
+
export const automatorAdminResetMessage = (data: Automator.AdminResetAutomatorRequest, url:string): RestMessage<Automator.IAdminResetAutomatorRequest, Automator.IAdminResponse> =>
|
|
311
|
+
createMessage(data, url, Automator.AdminResetAutomatorRequest, Automator.AdminResponse);
|
package/src/utils.ts
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import {KeyWrapper, platform} from "./platform";
|
|
2
|
+
import {KeeperHost, TransmissionKey} from './configuration';
|
|
3
|
+
import { Authentication } from "./proto";
|
|
4
|
+
|
|
5
|
+
export function getKeeperUrl(host: KeeperHost, forPath: string) {
|
|
6
|
+
return `https://${host}/api/rest/${forPath}`;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function getKeeperSAMLUrl(host: KeeperHost, forPath: string, serviceProviderId: number = null) {
|
|
10
|
+
if (serviceProviderId) {
|
|
11
|
+
return getKeeperUrl(host, `sso/saml/${forPath}/${serviceProviderId}`);
|
|
12
|
+
} else {
|
|
13
|
+
return getKeeperUrl(host, `sso/saml/${forPath}`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function getKeeperSsoConfigUrl(host: KeeperHost, forPath: string, serviceProviderId: number = null) {
|
|
18
|
+
if (serviceProviderId) {
|
|
19
|
+
return getKeeperUrl(host, `sso/config/${forPath}/${serviceProviderId}`);
|
|
20
|
+
} else {
|
|
21
|
+
return getKeeperUrl(host, `sso/config/${forPath}`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function getKeeperAutomatorAdminUrl(host: KeeperHost, forPath: string, automatorId: number = null) {
|
|
26
|
+
if (automatorId) {
|
|
27
|
+
return getKeeperUrl(host, `automator/${forPath}/${automatorId}`);
|
|
28
|
+
} else {
|
|
29
|
+
return getKeeperUrl(host, `automator/${forPath}`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function generateTransmissionKey(keyNumber: number): TransmissionKey {
|
|
34
|
+
const transmissionKey = platform.getRandomBytes(32)
|
|
35
|
+
return {
|
|
36
|
+
publicKeyId: keyNumber,
|
|
37
|
+
key: transmissionKey,
|
|
38
|
+
encryptedKey: platform.publicEncrypt(transmissionKey, platform.keys[keyNumber - 1])
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function webSafe64(source: string): string {
|
|
43
|
+
return source.replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function webSafe64FromBytes(source: Uint8Array): string {
|
|
47
|
+
return webSafe64(platform.bytesToBase64(source));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function normal64(source: string): string {
|
|
51
|
+
return source.replace(/-/g, '+').replace(/_/g, '/') + '=='.substring(0, (3 * source.length) % 4);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function normal64Bytes(source: string): Uint8Array {
|
|
55
|
+
return platform.base64ToBytes(normal64(source));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function isTwoFactorResultCode(resultCode: string): boolean {
|
|
59
|
+
return ["need_totp", "invalid_device_token", "invalid_totp"].includes(resultCode);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function generateEncryptionKey(): Uint8Array {
|
|
63
|
+
return platform.getRandomBytes(32);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function generateUidBytes(): Uint8Array {
|
|
67
|
+
return platform.getRandomBytes(16);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function generateUid(): string {
|
|
71
|
+
return webSafe64FromBytes(generateUidBytes());
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function wrapPassword(key: string | Uint8Array): KeyWrapper {
|
|
75
|
+
if (typeof key === 'string') {
|
|
76
|
+
return platform.wrapPassword(platform.stringToBytes(key))
|
|
77
|
+
}
|
|
78
|
+
if (key instanceof Uint8Array) {
|
|
79
|
+
return platform.wrapPassword(key)
|
|
80
|
+
}
|
|
81
|
+
throw new Error('Error wrapping the password')
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export async function encryptKey(key: Uint8Array, withKey: Uint8Array): Promise<string> {
|
|
85
|
+
let encryptedKey = await platform.aesGcmEncrypt(key, withKey);
|
|
86
|
+
return webSafe64FromBytes(encryptedKey);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function shareKey(key: Uint8Array, publicKey: string): string {
|
|
90
|
+
let encryptedKey = platform.publicEncrypt(key, publicKey);
|
|
91
|
+
return webSafe64FromBytes(encryptedKey);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export async function shareKeyEC(key: Uint8Array, publicKey: Uint8Array): Promise<string> {
|
|
95
|
+
let encryptedKey = await platform.publicEncryptEC(key, publicKey);
|
|
96
|
+
return webSafe64FromBytes(encryptedKey);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export async function decryptKey(encryptedKey: string, withKey: Uint8Array): Promise<Uint8Array> {
|
|
100
|
+
return platform.aesGcmDecrypt(normal64Bytes(encryptedKey), withKey);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export async function encryptForStorage(data: Uint8Array, key: Uint8Array): Promise<string> {
|
|
104
|
+
return webSafe64FromBytes(await platform.aesCbcEncrypt(data, key, true));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export async function decryptFromStorage(data: string, key: Uint8Array): Promise<Uint8Array> {
|
|
108
|
+
return await platform.aesCbcDecrypt(normal64Bytes(data), key, true);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export async function decryptFromStorageGcm(data: string, key: Uint8Array): Promise<Uint8Array> {
|
|
112
|
+
return platform.aesGcmDecrypt(normal64Bytes(data), key);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export async function encryptObjectForStorage<T>(obj: T, key: Uint8Array): Promise<string> {
|
|
116
|
+
let s = JSON.stringify(obj);
|
|
117
|
+
let bytes = platform.stringToBytes(s);
|
|
118
|
+
return encryptForStorage(bytes, key);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export async function encryptObjectForStorageAsBytes<T>(obj: T, key: Uint8Array): Promise<Uint8Array> {
|
|
122
|
+
let s = JSON.stringify(obj);
|
|
123
|
+
let bytes = platform.stringToBytes(s);
|
|
124
|
+
return platform.aesCbcEncrypt(bytes, key, true)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export async function decryptObjectFromStorage<T>(data: string, key: Uint8Array): Promise<T> {
|
|
128
|
+
try {
|
|
129
|
+
let decrypted = await decryptFromStorage(data, key);
|
|
130
|
+
return JSON.parse(platform.bytesToString(decrypted));
|
|
131
|
+
}
|
|
132
|
+
catch (e) {
|
|
133
|
+
console.log(`Unable to decrypt ${data}`);
|
|
134
|
+
return {} as T
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export async function encryptObjectForStorageGCM<T>(obj: T, key: Uint8Array, usePadding: boolean = true): Promise<Uint8Array> {
|
|
139
|
+
let bytes = platform.stringToBytes(JSON.stringify(obj));
|
|
140
|
+
if (usePadding) {
|
|
141
|
+
const paddedSize = Math.ceil(Math.max(384, bytes.length) / 16) * 16
|
|
142
|
+
bytes = Uint8Array.of(...bytes, ...Array(paddedSize - bytes.length).fill(0x20))
|
|
143
|
+
}
|
|
144
|
+
return platform.aesGcmEncrypt(bytes, key)
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export function chooseErrorMessage(errorNumber:number){
|
|
148
|
+
switch (errorNumber){
|
|
149
|
+
case Authentication.LoginState.ACCOUNT_LOCKED:
|
|
150
|
+
return 'account_locked'
|
|
151
|
+
case Authentication.LoginState.DEVICE_ACCOUNT_LOCKED:
|
|
152
|
+
return 'device_account_locked'
|
|
153
|
+
case Authentication.LoginState.DEVICE_LOCKED:
|
|
154
|
+
return 'device_locked'
|
|
155
|
+
case Authentication.LoginState.INVALID_LOGINSTATE:
|
|
156
|
+
return 'invalid_loginstate'
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export function resolvablePromise(): { promise: Promise<void>, resolve: () => void } {
|
|
161
|
+
let resolver
|
|
162
|
+
const promise = new Promise<void>((resolve) => {
|
|
163
|
+
resolver = resolve
|
|
164
|
+
})
|
|
165
|
+
return {
|
|
166
|
+
promise: promise,
|
|
167
|
+
resolve: resolver
|
|
168
|
+
}
|
|
169
|
+
}
|