Skip to content

Commit

Permalink
Merge pull request #58 from permitio/asaf/cto-120-update-tsdoc-in-per…
Browse files Browse the repository at this point in the history
…mit-node

update tsdoc in permit node + instructions
  • Loading branch information
Asaf Cohen authored Oct 9, 2023
2 parents 0602686 + 0340ca2 commit 1419ea1
Show file tree
Hide file tree
Showing 127 changed files with 2,270 additions and 983 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Node.js client library for the Permit.io full-stack permissions platform.

## Installation

```
npm install permitio
```
Expand All @@ -11,11 +12,13 @@ npm install permitio

1. Update the version in `package.json`
2. Execute `yarn run build`
3. Execute `yarn publish --access public`
3. Execute `yarn docs ; git add docs/ ; git commit -m "update tsdoc"` to update the auto generated docs
4. Execute `yarn publish --access public`

## Documentation

[Read the documentation at Permit.io website](https://docs.permit.io/sdk/nodejs/quickstart-nodejs#add-the-sdk-to-your-js-code)

## API Reference

[Check out the tsdoc reference here.](https://permitio.github.io/permit-node/classes/Permit.html)
16 changes: 8 additions & 8 deletions docs/assets/highlight.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
--dark-hl-1: #D4D4D4;
--light-hl-2: #AF00DB;
--dark-hl-2: #C586C0;
--light-hl-3: #A31515;
--dark-hl-3: #CE9178;
--light-hl-4: #0000FF;
--dark-hl-4: #569CD6;
--light-hl-5: #0070C1;
--dark-hl-5: #4FC1FF;
--light-hl-6: #795E26;
--dark-hl-6: #DCDCAA;
--light-hl-3: #795E26;
--dark-hl-3: #DCDCAA;
--light-hl-4: #A31515;
--dark-hl-4: #CE9178;
--light-hl-5: #0000FF;
--dark-hl-5: #569CD6;
--light-hl-6: #0070C1;
--dark-hl-6: #4FC1FF;
--light-hl-7: #008000;
--dark-hl-7: #6A9955;
--light-hl-8: #098658;
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/search.js

Large diffs are not rendered by default.

183 changes: 139 additions & 44 deletions docs/classes/ApiClient.html

Large diffs are not rendered by default.

92 changes: 77 additions & 15 deletions docs/classes/ApiContext.html

Large diffs are not rendered by default.

55 changes: 50 additions & 5 deletions docs/classes/ConditionSetRulesApi.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h4>Implements</h4>
<ul class="tsd-hierarchy">
<li><a href="../interfaces/IConditionSetRulesApi.html" class="tsd-signature-type tsd-kind-interface">IConditionSetRulesApi</a></li></ul></section><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/permitio/permit-node/blob/89199c0/src/api/condition-set-rules.ts#L68">src/api/condition-set-rules.ts:68</a></li></ul></aside>
<li>Defined in <a href="https://github.com/permitio/permit-node/blob/0602686/src/api/condition-set-rules.ts#L68">src/api/condition-set-rules.ts:68</a></li></ul></aside>
<section class="tsd-panel-group tsd-index-group">
<section class="tsd-panel tsd-index-panel">
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
Expand All @@ -43,6 +43,8 @@ <h3 class="tsd-index-heading">Constructors</h3>
<h3 class="tsd-index-heading">Methods</h3>
<div class="tsd-index-list"><a href="ConditionSetRulesApi.html#create" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="#FF4DB8" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12" id="icon-2048-path"></rect><path d="M9.162 16V7.24H10.578L11.514 10.072C11.602 10.328 11.674 10.584 11.73 10.84C11.794 11.088 11.842 11.28 11.874 11.416C11.906 11.28 11.954 11.088 12.018 10.84C12.082 10.584 12.154 10.324 12.234 10.06L13.122 7.24H14.538V16H13.482V12.82C13.482 12.468 13.49 12.068 13.506 11.62C13.53 11.172 13.558 10.716 13.59 10.252C13.622 9.78 13.654 9.332 13.686 8.908C13.726 8.476 13.762 8.1 13.794 7.78L12.366 12.16H11.334L9.894 7.78C9.934 8.092 9.97 8.456 10.002 8.872C10.042 9.28 10.078 9.716 10.11 10.18C10.142 10.636 10.166 11.092 10.182 11.548C10.206 12.004 10.218 12.428 10.218 12.82V16H9.162Z" fill="var(--color-text)" id="icon-2048-text"></path></svg><span>create</span></a>
<a href="ConditionSetRulesApi.html#delete" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>delete</span></a>
<a href="ConditionSetRulesApi.html#ensureAccessLevel" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>ensure<wbr/>Access<wbr/>Level</span></a>
<a href="ConditionSetRulesApi.html#ensureContext" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>ensure<wbr/>Context</span></a>
<a href="ConditionSetRulesApi.html#list" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>list</span></a>
</div></section></div></details></section></section>
<section class="tsd-panel-group tsd-member-group">
Expand All @@ -68,7 +70,7 @@ <h5><span class="tsd-kind-parameter">logger</span>: <span class="tsd-signature-t
<h4 class="tsd-returns-title">Returns <a href="ConditionSetRulesApi.html" class="tsd-signature-type tsd-kind-class">ConditionSetRulesApi</a></h4><aside class="tsd-sources">
<p>Overrides BasePermitApi.constructor</p>
<ul>
<li>Defined in <a href="https://github.com/permitio/permit-node/blob/89199c0/src/api/condition-set-rules.ts#L76">src/api/condition-set-rules.ts:76</a></li></ul></aside></li></ul></section></section>
<li>Defined in <a href="https://github.com/permitio/permit-node/blob/0602686/src/api/condition-set-rules.ts#L76">src/api/condition-set-rules.ts:76</a></li></ul></aside></li></ul></section></section>
<section class="tsd-panel-group tsd-member-group">
<h2>Methods</h2>
<section class="tsd-panel tsd-member"><a id="create" class="tsd-anchor"></a>
Expand All @@ -93,7 +95,7 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise<
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/IConditionSetRulesApi.html">IConditionSetRulesApi</a>.<a href="../interfaces/IConditionSetRulesApi.html#create">create</a></p>
<ul>
<li>Defined in <a href="https://github.com/permitio/permit-node/blob/89199c0/src/api/condition-set-rules.ts#L120">src/api/condition-set-rules.ts:120</a></li></ul></aside></li></ul></section>
<li>Defined in <a href="https://github.com/permitio/permit-node/blob/0602686/src/api/condition-set-rules.ts#L121">src/api/condition-set-rules.ts:121</a></li></ul></aside></li></ul></section>
<section class="tsd-panel tsd-member"><a id="delete" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>delete</span><a href="#delete" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<ul class="tsd-signatures">
Expand All @@ -116,7 +118,48 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise<
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/IConditionSetRulesApi.html">IConditionSetRulesApi</a>.<a href="../interfaces/IConditionSetRulesApi.html#delete">delete</a></p>
<ul>
<li>Defined in <a href="https://github.com/permitio/permit-node/blob/89199c0/src/api/condition-set-rules.ts#L142">src/api/condition-set-rules.ts:142</a></li></ul></aside></li></ul></section>
<li>Defined in <a href="https://github.com/permitio/permit-node/blob/0602686/src/api/condition-set-rules.ts#L144">src/api/condition-set-rules.ts:144</a></li></ul></aside></li></ul></section>
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="ensureAccessLevel" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>ensure<wbr/>Access<wbr/>Level</span><a href="#ensureAccessLevel" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<ul class="tsd-signatures tsd-is-inherited">
<li class="tsd-signature tsd-anchor-link" id="ensureAccessLevel.ensureAccessLevel-1"><span class="tsd-kind-call-signature">ensure<wbr/>Access<wbr/>Level</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">requiredAccessLevel</span><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><a href="#ensureAccessLevel.ensureAccessLevel-1" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></li>
<li class="tsd-description">
<div class="tsd-comment tsd-typography"><p>Ensure that the API Key has the necessary permissions to successfully call the API endpoint.
Note that this check is not foolproof, and the API may still throw 401.</p>

<h3>Throws</h3><p>PermitContextError If the currently set API key access level does not match the required access level.</p>
</div>
<div class="tsd-parameters">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameter-list">
<li>
<h5><span class="tsd-kind-parameter">requiredAccessLevel</span>: <a href="../enums/ApiKeyLevel.html" class="tsd-signature-type tsd-kind-enum">ApiKeyLevel</a></h5>
<div class="tsd-comment tsd-typography"><p>The required API Key Access level for the endpoint.</p>
</div></li></ul></div>
<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><aside class="tsd-sources">
<p>Inherited from BasePermitApi.ensureAccessLevel</p>
<ul>
<li>Defined in <a href="https://github.com/permitio/permit-node/blob/0602686/src/api/base.ts#L116">src/api/base.ts:116</a></li></ul></aside></li></ul></section>
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="ensureContext" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>ensure<wbr/>Context</span><a href="#ensureContext" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<ul class="tsd-signatures tsd-is-inherited">
<li class="tsd-signature tsd-anchor-link" id="ensureContext.ensureContext-1"><span class="tsd-kind-call-signature">ensure<wbr/>Context</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">requiredContext</span><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><a href="#ensureContext.ensureContext-1" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></li>
<li class="tsd-description">
<div class="tsd-comment tsd-typography"><p>Ensure that the API context matches the required endpoint context.</p>

<h3>Throws</h3><p>PermitContextError If the currently set API context level does not match the required context level.</p>
</div>
<div class="tsd-parameters">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameter-list">
<li>
<h5><span class="tsd-kind-parameter">requiredContext</span>: <span class="tsd-signature-type ">ApiContextLevel</span></h5>
<div class="tsd-comment tsd-typography"><p>The required API context level for the endpoint.</p>
</div></li></ul></div>
<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><aside class="tsd-sources">
<p>Inherited from BasePermitApi.ensureContext</p>
<ul>
<li>Defined in <a href="https://github.com/permitio/permit-node/blob/0602686/src/api/base.ts#L143">src/api/base.ts:143</a></li></ul></aside></li></ul></section>
<section class="tsd-panel tsd-member"><a id="list" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>list</span><a href="#list" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<ul class="tsd-signatures">
Expand All @@ -141,7 +184,7 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise<
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/IConditionSetRulesApi.html">IConditionSetRulesApi</a>.<a href="../interfaces/IConditionSetRulesApi.html#list">list</a></p>
<ul>
<li>Defined in <a href="https://github.com/permitio/permit-node/blob/89199c0/src/api/condition-set-rules.ts#L93">src/api/condition-set-rules.ts:93</a></li></ul></aside></li></ul></section></section></div>
<li>Defined in <a href="https://github.com/permitio/permit-node/blob/0602686/src/api/condition-set-rules.ts#L93">src/api/condition-set-rules.ts:93</a></li></ul></aside></li></ul></section></section></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
Expand All @@ -162,6 +205,8 @@ <h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.9389
<li><a href="#constructor" class=""><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-512-path"></use><use href="#icon-512-text"></use></svg><span>constructor</span></a></li>
<li><a href="#create" class=""><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>create</span></a></li>
<li><a href="#delete" class=""><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>delete</span></a></li>
<li><a href="#ensureAccessLevel" class="tsd-is-inherited"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>ensure<wbr/>Access<wbr/>Level</span></a></li>
<li><a href="#ensureContext" class="tsd-is-inherited"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>ensure<wbr/>Context</span></a></li>
<li><a href="#list" class=""><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>list</span></a></li></ul></div></details></div>
<div class="site-menu">
<nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-4-path"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)" id="icon-4-text"></path></svg><span>permitio</span></a>
Expand Down
Loading

0 comments on commit 1419ea1

Please sign in to comment.