Skip to content

Commit

Permalink
feat(delete): method to delete individual data by their key
Browse files Browse the repository at this point in the history
  • Loading branch information
willgm committed Jul 20, 2020
1 parent 89f9728 commit 74efe28
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docs/assets/js/search.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"kinds":{"128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method","4194304":"Type alias"},"rows":[{"id":0,"kind":256,"name":"CryptoStorageConfig","url":"interfaces/cryptostorageconfig.html","classes":"tsd-kind-interface"},{"id":1,"kind":1024,"name":"baseKey","url":"interfaces/cryptostorageconfig.html#basekey","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"CryptoStorageConfig"},{"id":2,"kind":1024,"name":"dbName","url":"interfaces/cryptostorageconfig.html#dbname","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"CryptoStorageConfig"},{"id":3,"kind":1024,"name":"storeName","url":"interfaces/cryptostorageconfig.html#storename","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"CryptoStorageConfig"},{"id":4,"kind":1024,"name":"salt","url":"interfaces/cryptostorageconfig.html#salt","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"CryptoStorageConfig"},{"id":5,"kind":1024,"name":"encryptIterations","url":"interfaces/cryptostorageconfig.html#encryptiterations","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"CryptoStorageConfig"},{"id":6,"kind":128,"name":"CryptoStorage","url":"classes/cryptostorage.html","classes":"tsd-kind-class"},{"id":7,"kind":1024,"name":"AuthenticityError","url":"classes/cryptostorage.html#authenticityerror","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-static","parent":"CryptoStorage"},{"id":8,"kind":1024,"name":"CryptoKeyError","url":"classes/cryptostorage.html#cryptokeyerror","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-static","parent":"CryptoStorage"},{"id":9,"kind":512,"name":"constructor","url":"classes/cryptostorage.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"CryptoStorage"},{"id":10,"kind":2048,"name":"get","url":"classes/cryptostorage.html#get","classes":"tsd-kind-method tsd-parent-kind-class","parent":"CryptoStorage"},{"id":11,"kind":2048,"name":"set","url":"classes/cryptostorage.html#set","classes":"tsd-kind-method tsd-parent-kind-class","parent":"CryptoStorage"},{"id":12,"kind":2048,"name":"clear","url":"classes/cryptostorage.html#clear","classes":"tsd-kind-method tsd-parent-kind-class","parent":"CryptoStorage"},{"id":13,"kind":2048,"name":"close","url":"classes/cryptostorage.html#close","classes":"tsd-kind-method tsd-parent-kind-class","parent":"CryptoStorage"},{"id":14,"kind":2048,"name":"deleteDB","url":"classes/cryptostorage.html#deletedb","classes":"tsd-kind-method tsd-parent-kind-class","parent":"CryptoStorage"},{"id":15,"kind":4194304,"name":"InputData","url":"globals.html#inputdata","classes":"tsd-kind-type-alias"}],"index":{"version":"2.3.8","fields":["name","parent"],"fieldVectors":[["name/0",[0,9.614]],["parent/0",[]],["name/1",[1,24.277]],["parent/1",[0,0.878]],["name/2",[2,24.277]],["parent/2",[0,0.878]],["name/3",[3,24.277]],["parent/3",[0,0.878]],["name/4",[4,24.277]],["parent/4",[0,0.878]],["name/5",[5,24.277]],["parent/5",[0,0.878]],["name/6",[6,5.819]],["parent/6",[]],["name/7",[7,24.277]],["parent/7",[6,0.532]],["name/8",[8,24.277]],["parent/8",[6,0.532]],["name/9",[9,24.277]],["parent/9",[6,0.532]],["name/10",[10,24.277]],["parent/10",[6,0.532]],["name/11",[11,24.277]],["parent/11",[6,0.532]],["name/12",[12,24.277]],["parent/12",[6,0.532]],["name/13",[13,24.277]],["parent/13",[6,0.532]],["name/14",[14,24.277]],["parent/14",[6,0.532]],["name/15",[15,24.277]],["parent/15",[]]],"invertedIndex":[["authenticityerror",{"_index":7,"name":{"7":{}},"parent":{}}],["basekey",{"_index":1,"name":{"1":{}},"parent":{}}],["clear",{"_index":12,"name":{"12":{}},"parent":{}}],["close",{"_index":13,"name":{"13":{}},"parent":{}}],["constructor",{"_index":9,"name":{"9":{}},"parent":{}}],["cryptokeyerror",{"_index":8,"name":{"8":{}},"parent":{}}],["cryptostorage",{"_index":6,"name":{"6":{}},"parent":{"7":{},"8":{},"9":{},"10":{},"11":{},"12":{},"13":{},"14":{}}}],["cryptostorageconfig",{"_index":0,"name":{"0":{}},"parent":{"1":{},"2":{},"3":{},"4":{},"5":{}}}],["dbname",{"_index":2,"name":{"2":{}},"parent":{}}],["deletedb",{"_index":14,"name":{"14":{}},"parent":{}}],["encryptiterations",{"_index":5,"name":{"5":{}},"parent":{}}],["get",{"_index":10,"name":{"10":{}},"parent":{}}],["inputdata",{"_index":15,"name":{"15":{}},"parent":{}}],["salt",{"_index":4,"name":{"4":{}},"parent":{}}],["set",{"_index":11,"name":{"11":{}},"parent":{}}],["storename",{"_index":3,"name":{"3":{}},"parent":{}}]],"pipeline":[]}}
{"kinds":{"128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method","4194304":"Type alias"},"rows":[{"id":0,"kind":256,"name":"CryptoStorageConfig","url":"interfaces/cryptostorageconfig.html","classes":"tsd-kind-interface"},{"id":1,"kind":1024,"name":"baseKey","url":"interfaces/cryptostorageconfig.html#basekey","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"CryptoStorageConfig"},{"id":2,"kind":1024,"name":"dbName","url":"interfaces/cryptostorageconfig.html#dbname","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"CryptoStorageConfig"},{"id":3,"kind":1024,"name":"storeName","url":"interfaces/cryptostorageconfig.html#storename","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"CryptoStorageConfig"},{"id":4,"kind":1024,"name":"salt","url":"interfaces/cryptostorageconfig.html#salt","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"CryptoStorageConfig"},{"id":5,"kind":1024,"name":"encryptIterations","url":"interfaces/cryptostorageconfig.html#encryptiterations","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"CryptoStorageConfig"},{"id":6,"kind":128,"name":"CryptoStorage","url":"classes/cryptostorage.html","classes":"tsd-kind-class"},{"id":7,"kind":1024,"name":"AuthenticityError","url":"classes/cryptostorage.html#authenticityerror","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-static","parent":"CryptoStorage"},{"id":8,"kind":1024,"name":"CryptoKeyError","url":"classes/cryptostorage.html#cryptokeyerror","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-static","parent":"CryptoStorage"},{"id":9,"kind":512,"name":"constructor","url":"classes/cryptostorage.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"CryptoStorage"},{"id":10,"kind":2048,"name":"get","url":"classes/cryptostorage.html#get","classes":"tsd-kind-method tsd-parent-kind-class","parent":"CryptoStorage"},{"id":11,"kind":2048,"name":"set","url":"classes/cryptostorage.html#set","classes":"tsd-kind-method tsd-parent-kind-class","parent":"CryptoStorage"},{"id":12,"kind":2048,"name":"clear","url":"classes/cryptostorage.html#clear","classes":"tsd-kind-method tsd-parent-kind-class","parent":"CryptoStorage"},{"id":13,"kind":2048,"name":"close","url":"classes/cryptostorage.html#close","classes":"tsd-kind-method tsd-parent-kind-class","parent":"CryptoStorage"},{"id":14,"kind":2048,"name":"delete","url":"classes/cryptostorage.html#delete","classes":"tsd-kind-method tsd-parent-kind-class","parent":"CryptoStorage"},{"id":15,"kind":2048,"name":"deleteDB","url":"classes/cryptostorage.html#deletedb","classes":"tsd-kind-method tsd-parent-kind-class","parent":"CryptoStorage"},{"id":16,"kind":4194304,"name":"InputData","url":"globals.html#inputdata","classes":"tsd-kind-type-alias"}],"index":{"version":"2.3.8","fields":["name","parent"],"fieldVectors":[["name/0",[0,10.186]],["parent/0",[]],["name/1",[1,24.849]],["parent/1",[0,0.936]],["name/2",[2,24.849]],["parent/2",[0,0.936]],["name/3",[3,24.849]],["parent/3",[0,0.936]],["name/4",[4,24.849]],["parent/4",[0,0.936]],["name/5",[5,24.849]],["parent/5",[0,0.936]],["name/6",[6,5.39]],["parent/6",[]],["name/7",[7,24.849]],["parent/7",[6,0.496]],["name/8",[8,24.849]],["parent/8",[6,0.496]],["name/9",[9,24.849]],["parent/9",[6,0.496]],["name/10",[10,24.849]],["parent/10",[6,0.496]],["name/11",[11,24.849]],["parent/11",[6,0.496]],["name/12",[12,24.849]],["parent/12",[6,0.496]],["name/13",[13,24.849]],["parent/13",[6,0.496]],["name/14",[14,24.849]],["parent/14",[6,0.496]],["name/15",[15,24.849]],["parent/15",[6,0.496]],["name/16",[16,24.849]],["parent/16",[]]],"invertedIndex":[["authenticityerror",{"_index":7,"name":{"7":{}},"parent":{}}],["basekey",{"_index":1,"name":{"1":{}},"parent":{}}],["clear",{"_index":12,"name":{"12":{}},"parent":{}}],["close",{"_index":13,"name":{"13":{}},"parent":{}}],["constructor",{"_index":9,"name":{"9":{}},"parent":{}}],["cryptokeyerror",{"_index":8,"name":{"8":{}},"parent":{}}],["cryptostorage",{"_index":6,"name":{"6":{}},"parent":{"7":{},"8":{},"9":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{}}}],["cryptostorageconfig",{"_index":0,"name":{"0":{}},"parent":{"1":{},"2":{},"3":{},"4":{},"5":{}}}],["dbname",{"_index":2,"name":{"2":{}},"parent":{}}],["delete",{"_index":14,"name":{"14":{}},"parent":{}}],["deletedb",{"_index":15,"name":{"15":{}},"parent":{}}],["encryptiterations",{"_index":5,"name":{"5":{}},"parent":{}}],["get",{"_index":10,"name":{"10":{}},"parent":{}}],["inputdata",{"_index":16,"name":{"16":{}},"parent":{}}],["salt",{"_index":4,"name":{"4":{}},"parent":{}}],["set",{"_index":11,"name":{"11":{}},"parent":{}}],["storename",{"_index":3,"name":{"3":{}},"parent":{}}]],"pipeline":[]}}
54 changes: 45 additions & 9 deletions docs/classes/cryptostorage.html
Original file line number Diff line number Diff line change
Expand Up @@ -2740,6 +2740,9 @@
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="cryptostorage.html#close" class="tsd-kind-icon">close</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="cryptostorage.html#delete" class="tsd-kind-icon">delete</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="cryptostorage.html#deletedb" class="tsd-kind-icon">deleteDB</a>
</li>
Expand Down Expand Up @@ -2798,6 +2801,7 @@ <h3>Methods</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-method tsd-parent-kind-class"><a href="cryptostorage.html#clear" class="tsd-kind-icon">clear</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="cryptostorage.html#close" class="tsd-kind-icon">close</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="cryptostorage.html#delete" class="tsd-kind-icon">delete</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="cryptostorage.html#deletedb" class="tsd-kind-icon">deleteDB</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="cryptostorage.html#get" class="tsd-kind-icon">get</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="cryptostorage.html#set" class="tsd-kind-icon">set</a></li>
Expand All @@ -2819,7 +2823,7 @@ <h3>constructor</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/willgm/web-crypto-store/blob/04fdf87/src/web-crypto-storage.ts#L66">web-crypto-storage.ts:66</a></li>
<li>Defined in <a href="https://github.com/willgm/web-crypto-store/blob/5ae6601/src/web-crypto-storage.ts#L66">web-crypto-storage.ts:66</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -2838,7 +2842,7 @@ <h4 class="tsd-returns-title">Returns <a href="cryptostorage.html" class="tsd-si
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/willgm/web-crypto-store/blob/04fdf87/src/web-crypto-storage.ts#L71">web-crypto-storage.ts:71</a></li>
<li>Defined in <a href="https://github.com/willgm/web-crypto-store/blob/5ae6601/src/web-crypto-storage.ts#L71">web-crypto-storage.ts:71</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -2892,7 +2896,7 @@ <h3><span class="tsd-flag ts-flagStatic">Static</span> Authenticity<wbr>Error</h
<div class="tsd-signature tsd-kind-icon">Authenticity<wbr>Error<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &quot;Integrity/Authenticity check failed!&quot;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/willgm/web-crypto-store/blob/04fdf87/src/web-crypto-storage.ts#L56">web-crypto-storage.ts:56</a></li>
<li>Defined in <a href="https://github.com/willgm/web-crypto-store/blob/5ae6601/src/web-crypto-storage.ts#L56">web-crypto-storage.ts:56</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -2907,7 +2911,7 @@ <h3><span class="tsd-flag ts-flagStatic">Static</span> Crypto<wbr>Key<wbr>Error<
<div class="tsd-signature tsd-kind-icon">Crypto<wbr>Key<wbr>Error<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &quot;CryptoStorage needs a base key to work properly&quot;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/willgm/web-crypto-store/blob/04fdf87/src/web-crypto-storage.ts#L61">web-crypto-storage.ts:61</a></li>
<li>Defined in <a href="https://github.com/willgm/web-crypto-store/blob/5ae6601/src/web-crypto-storage.ts#L61">web-crypto-storage.ts:61</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -2929,7 +2933,7 @@ <h3>clear</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/willgm/web-crypto-store/blob/04fdf87/src/web-crypto-storage.ts#L160">web-crypto-storage.ts:160</a></li>
<li>Defined in <a href="https://github.com/willgm/web-crypto-store/blob/5ae6601/src/web-crypto-storage.ts#L160">web-crypto-storage.ts:160</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -2952,7 +2956,7 @@ <h3>close</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/willgm/web-crypto-store/blob/04fdf87/src/web-crypto-storage.ts#L171">web-crypto-storage.ts:171</a></li>
<li>Defined in <a href="https://github.com/willgm/web-crypto-store/blob/5ae6601/src/web-crypto-storage.ts#L171">web-crypto-storage.ts:171</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -2965,6 +2969,38 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="delete" class="tsd-anchor"></a>
<h3>delete</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">delete<span class="tsd-signature-symbol">(</span>key<span class="tsd-signature-symbol">: </span><a href="../globals.html#inputdata" class="tsd-signature-type">InputData</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/willgm/web-crypto-store/blob/5ae6601/src/web-crypto-storage.ts#L182">web-crypto-storage.ts:182</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Delete individual data that match the given key.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>key: <a href="../globals.html#inputdata" class="tsd-signature-type">InputData</a></h5>
<div class="tsd-comment tsd-typography">
<p>The given key to find the data.</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4>
<p>Promise to know when the process was complete.</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="deletedb" class="tsd-anchor"></a>
<h3>deleteDB</h3>
Expand All @@ -2975,7 +3011,7 @@ <h3>deleteDB</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/willgm/web-crypto-store/blob/04fdf87/src/web-crypto-storage.ts#L182">web-crypto-storage.ts:182</a></li>
<li>Defined in <a href="https://github.com/willgm/web-crypto-store/blob/5ae6601/src/web-crypto-storage.ts#L197">web-crypto-storage.ts:197</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -2999,7 +3035,7 @@ <h3>get</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/willgm/web-crypto-store/blob/04fdf87/src/web-crypto-storage.ts#L113">web-crypto-storage.ts:113</a></li>
<li>Defined in <a href="https://github.com/willgm/web-crypto-store/blob/5ae6601/src/web-crypto-storage.ts#L113">web-crypto-storage.ts:113</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -3031,7 +3067,7 @@ <h3>set</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/willgm/web-crypto-store/blob/04fdf87/src/web-crypto-storage.ts#L143">web-crypto-storage.ts:143</a></li>
<li>Defined in <a href="https://github.com/willgm/web-crypto-store/blob/5ae6601/src/web-crypto-storage.ts#L143">web-crypto-storage.ts:143</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down
2 changes: 1 addition & 1 deletion docs/globals.html
Original file line number Diff line number Diff line change
Expand Up @@ -2810,7 +2810,7 @@ <h3>Input<wbr>Data</h3>
<div class="tsd-signature tsd-kind-icon">Input<wbr>Data<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">TypedArray</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/willgm/web-crypto-store/blob/04fdf87/src/web-crypto-storage.ts#L16">web-crypto-storage.ts:16</a></li>
<li>Defined in <a href="https://github.com/willgm/web-crypto-store/blob/5ae6601/src/web-crypto-storage.ts#L16">web-crypto-storage.ts:16</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2811,7 +2811,7 @@ <h3>Input<wbr>Data</h3>
<div class="tsd-signature tsd-kind-icon">Input<wbr>Data<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">TypedArray</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/willgm/web-crypto-store/blob/04fdf87/src/web-crypto-storage.ts#L16">web-crypto-storage.ts:16</a></li>
<li>Defined in <a href="https://github.com/willgm/web-crypto-store/blob/5ae6601/src/web-crypto-storage.ts#L16">web-crypto-storage.ts:16</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down
Loading

0 comments on commit 74efe28

Please sign in to comment.