Skip to content

Commit

Permalink
Deploying to gh-pages from @ 941c8a3 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
bischofmax committed May 21, 2024
1 parent 8deaa2c commit c0799db
Show file tree
Hide file tree
Showing 146 changed files with 4,589 additions and 3,363 deletions.
215 changes: 203 additions & 12 deletions classes/EtherpadResponseMapper.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,14 @@ <h6><b>Methods</b></h6>
<tr>
<td class="col-md-4">
<ul class="index-list">
<li>
<span class="modifier">Static</span>
<a href="#mapEtherpadSessionsToSessions" >mapEtherpadSessionsToSessions</a>
</li>
<li>
<span class="modifier">Static</span>
<a href="#mapEtherpadSessionToSession" >mapEtherpadSessionToSession</a>
</li>
<li>
<span class="modifier">Static</span>
<a href="#mapResponseToException" >mapResponseToException</a>
Expand Down Expand Up @@ -177,6 +185,139 @@ <h6><b>Methods</b></h6>
<h3 id="methods">
Methods
</h3>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="mapEtherpadSessionsToSessions"></a>
<span class="name">
<span class="modifier">Static</span>
<span ><b>mapEtherpadSessionsToSessions</b></span>
<a href="#mapEtherpadSessionsToSessions"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<span class="modifier-icon icon ion-ios-reset"></span>
<code>mapEtherpadSessionsToSessions(etherpadSessions)</code>
</td>
</tr>


<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="64"
class="link-to-prism">apps/server/src/infra/etherpad-client/mappers/etherpad-response.mapper.ts:64</a></div>
</td>
</tr>


<tr>
<td class="col-md-4">

<div class="io-description">
<b>Parameters :</b>

<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>etherpadSessions</td>

<td>
No
</td>


</tr>
</tbody>
</table>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="../interfaces/Session.html" target="_self" >Session[]</a></code>

</div>
<div class="io-description">

</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="mapEtherpadSessionToSession"></a>
<span class="name">
<span class="modifier">Static</span>
<span ><b>mapEtherpadSessionToSession</b></span>
<a href="#mapEtherpadSessionToSession"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<span class="modifier-icon icon ion-ios-reset"></span>
<code>mapEtherpadSessionToSession(undefined: [string, ])</code>
</td>
</tr>


<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="80"
class="link-to-prism">apps/server/src/infra/etherpad-client/mappers/etherpad-response.mapper.ts:80</a></div>
</td>
</tr>


<tr>
<td class="col-md-4">

<div class="io-description">
<b>Parameters :</b>

<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>[string, ]</code>
</td>

<td>
No
</td>


</tr>
</tbody>
</table>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="../interfaces/Session.html" target="_self" >Session</a></code>

</div>
<div class="io-description">

</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
Expand All @@ -199,8 +340,8 @@ <h3 id="methods">

<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="45"
class="link-to-prism">apps/server/src/infra/etherpad-client/mappers/etherpad-response.mapper.ts:45</a></div>
<div class="io-line">Defined in <a href="" data-line="56"
class="link-to-prism">apps/server/src/infra/etherpad-client/mappers/etherpad-response.mapper.ts:56</a></div>
</td>
</tr>

Expand Down Expand Up @@ -300,8 +441,8 @@ <h3 id="methods">

<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="16"
class="link-to-prism">apps/server/src/infra/etherpad-client/mappers/etherpad-response.mapper.ts:16</a></div>
<div class="io-line">Defined in <a href="" data-line="27"
class="link-to-prism">apps/server/src/infra/etherpad-client/mappers/etherpad-response.mapper.ts:27</a></div>
</td>
</tr>

Expand Down Expand Up @@ -369,8 +510,8 @@ <h3 id="methods">

<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="25"
class="link-to-prism">apps/server/src/infra/etherpad-client/mappers/etherpad-response.mapper.ts:25</a></div>
<div class="io-line">Defined in <a href="" data-line="36"
class="link-to-prism">apps/server/src/infra/etherpad-client/mappers/etherpad-response.mapper.ts:36</a></div>
</td>
</tr>

Expand Down Expand Up @@ -438,8 +579,8 @@ <h3 id="methods">

<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="34"
class="link-to-prism">apps/server/src/infra/etherpad-client/mappers/etherpad-response.mapper.ts:34</a></div>
<div class="io-line">Defined in <a href="" data-line="45"
class="link-to-prism">apps/server/src/infra/etherpad-client/mappers/etherpad-response.mapper.ts:45</a></div>
</td>
</tr>

Expand Down Expand Up @@ -507,8 +648,8 @@ <h3 id="methods">

<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="7"
class="link-to-prism">apps/server/src/infra/etherpad-client/mappers/etherpad-response.mapper.ts:7</a></div>
<div class="io-line">Defined in <a href="" data-line="18"
class="link-to-prism">apps/server/src/infra/etherpad-client/mappers/etherpad-response.mapper.ts:18</a></div>
</td>
</tr>

Expand Down Expand Up @@ -564,9 +705,20 @@ <h3 id="methods">


<div class="tab-pane fade tab-source-code" id="source">
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { ErrorUtils } from &#x27;@src/core/error/utils&#x27;;
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { InternalServerErrorException } from &#x27;@nestjs/common&#x27;;
import { TypeGuard } from &#x27;@shared/common&#x27;;
import { ErrorUtils } from &#x27;@src/core/error/utils&#x27;;
import { InlineResponse2003Data, InlineResponse2004Data, InlineResponse200Data } from &#x27;../etherpad-api-client&#x27;;
import { AuthorId, EtherpadErrorType, EtherpadParams, EtherpadResponse, GroupId, PadId, SessionId } from &#x27;../interface&#x27;;
import {
AuthorId,
EtherpadErrorType,
EtherpadParams,
EtherpadResponse,
GroupId,
PadId,
Session,
SessionId,
} from &#x27;../interface&#x27;;
import { EtherpadErrorLoggableException } from &#x27;../loggable&#x27;;

export class EtherpadResponseMapper {
Expand Down Expand Up @@ -615,6 +767,45 @@ <h3 id="methods">
): EtherpadErrorLoggableException {
return new EtherpadErrorLoggableException(type, payload, ErrorUtils.createHttpExceptionOptions(response.message));
}

static mapEtherpadSessionsToSessions(etherpadSessions: unknown): Session[] {
try {
const isObject &#x3D; TypeGuard.isObject(etherpadSessions);
if (!isObject) return [];

const sessions &#x3D; Object.entries(etherpadSessions)
// eslint-disable-next-line @typescript-eslint/no-unused-vars
.filter(([key, value]) &#x3D;&gt; value !&#x3D;&#x3D; null)
.map(([key, value]) &#x3D;&gt; this.mapEtherpadSessionToSession([key, value]));

return sessions;
} catch (error) {
throw new InternalServerErrorException(&#x27;Etherpad session data is not valid&#x27;, { cause: error });
}
}

static mapEtherpadSessionToSession([etherpadId, etherpadSession]: [string, unknown | undefined]): Session {
if (
!TypeGuard.isObject(etherpadSession) ||
!(&#x27;groupID&#x27; in etherpadSession) ||
!(&#x27;authorID&#x27; in etherpadSession) ||
!(&#x27;validUntil&#x27; in etherpadSession)
)
throw new Error(&#x27;Etherpad session is missing required properties&#x27;);

const groupId &#x3D; TypeGuard.checkString(etherpadSession.groupID);
const authorId &#x3D; TypeGuard.checkString(etherpadSession.authorID);
const validUntil &#x3D; TypeGuard.checkNumber(etherpadSession.validUntil);

const session: Session &#x3D; {
id: etherpadId,
groupId,
authorId,
validUntil,
};

return session;
}
}
</code></pre>
</div>
Expand Down
2 changes: 1 addition & 1 deletion classes/OauthProviderService.html
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@ <h3 id="methods">
</table>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="../interfaces/ProviderConsentSessionResponse.html" target="_self" >Promise&lt;ProviderConsentSessionResponse[]&gt;</a></code>
<b>Returns : </b> <code><a href="../classes/ConsentSessionResponse.html" target="_self" >Promise&lt;ProviderConsentSessionResponse[]&gt;</a></code>

</div>
<div class="io-description">
Expand Down
Loading

0 comments on commit c0799db

Please sign in to comment.