Files
Testing/html5-chat1/nodeMulti/node_modules/@pm2/js-api/docs/Auth.html

982 lines
32 KiB
HTML
Raw Normal View History

2026-11-17 16:15:01 -05:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Auth - Documentation</title>
<script src="scripts/prettify/prettify.js"></script>
<script src="scripts/prettify/lang-css.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
</head>
<body>
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
<div class="navicon"></div>
</label>
<label for="nav-trigger" class="overlay"></label>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="Actions.html">Actions</a><ul class='methods'><li data-type='method'><a href="Actions.html#triggerAction">triggerAction</a></li><li data-type='method'><a href="Actions.html#triggerPM2Action">triggerPM2Action</a></li><li data-type='method'><a href="Actions.html#triggerScopedAction">triggerScopedAction</a></li></ul></li><li><a href="Auth.html">Auth</a><ul class='methods'><li data-type='method'><a href="Auth.html#register">register</a></li><li data-type='method'><a href="Auth.html#revoke">revoke</a></li></ul></li><li><a href="Bucket.html">Bucket</a><ul class='methods'><li data-type='method'><a href="Bucket.html#claimTrial">claimTrial</a></li><li data-type='method'><a href="Bucket.html#destroy">destroy</a></li><li data-type='method'><a href="Bucket.html#removeInvitation">removeInvitation</a></li><li data-type='method'><a href="Bucket.html#removeUser">removeUser</a></li><li data-type='method'><a href="Bucket.html#retrieveCharges">retrieveCharges</a></li><li data-type='method'><a href="Bucket.html#sendFeedback">sendFeedback</a></li><li data-type='method'><a href="Bucket.html#setNotificationState">setNotificationState</a></li><li data-type='method'><a href="Bucket.html#setUserRole">setUserRole</a></li><li data-type='method'><a href="Bucket.html#transferOwnership">transferOwnership</a></li><li data-type='method'><a href="Bucket.html#update">update</a></li><li data-type='method'><a href="Bucket.html#updateUserOptions">updateUserOptions</a></li></ul></li><li><a href="Bucket.alert.html">alert</a><ul class='methods'><li data-type='method'><a href="Bucket.alert.html#create">create</a></li><li data-type='method'><a href="Bucket.alert.html#delete">delete</a></li><li data-type='method'><a href="Bucket.alert.html#deleteEvent">deleteEvent</a></li><li data-type='method'><a href="Bucket.alert.html#get">get</a></li><li data-type='method'><a href="Bucket.alert.html#list">list</a></li><li data-type='method'><a href="Bucket.alert.html#sendReport">sendReport</a></li><li data-type='method'><a href="Bucket.alert.html#triggerSample">triggerSample</a></li><li data-type='method'><a href="Bucket.alert.html#update">update</a></li><li data-type='method'><a href="Bucket.alert.html#updateAlert">updateAlert</a></li><li data-type='method'><a href="Bucket.alert.html#updateSlack">updateSlack</a></li><li data-type='method'><a href="Bucket.alert.html#updateWebhooks">updateWebhooks</a></li></ul></li><li><a href="Bucket.alert.analyzer.html">analyzer</a><ul class='methods'><li data-type='method'><a href="Bucket.alert.analyzer.html#editState">editState</a></li><li data-type='method'><a href="Bucket.alert.analyzer.html#list">list</a></li><li data-type='method'><a href="Bucket.alert.analyzer.html#updateConfig">updateConfig</a></li></ul></li><li><a href="Bucket.application.html">application</a><ul class='methods'><li data-type='method'><a href="Bucket.application.html#create">create</a></li><li data-type='method'><a href="Bucket.application.html#delete">delete</a></li><li data-type='method'><a href="Bucket.application.html#get">get</a></li><li data-type='method'><a href="Bucket.application.html#getPreview">getPreview</a></li><li data-type='method'><a href="Bucket.application.html#getReports">getReports</a></li><li data-type='method'><a href="Bucket.application.html#list">list</a></li><li data-type='method'><a href="Bucket.application.html#update">update</a></li></ul></li><li><a href="Bucket.billing.html">billing</a><ul class='methods'><li data-type='method'><a href="Bucket.billing.html#attachBankAccount">attachBankAccount</a></li><li data-type='method'><a href="Bucket.billing.html#attachCreditCard">attachCreditCard</a></li><li data-type='method'><a href="Bucket.billing.html#deleteBankAccount">deleteBankAccount</a></li><li data-type='method'><a href="Bucket.billing.html#deleteCreditCard">deleteCreditCard</a></li><li data-type='method'><a href="Bucket.billing.html#fetchBankAccount">fetchBankAccount</a></li><li data-type='method'><a href="Bucket.billing.html#fetchCreditCard">fetchCreditCard</a>
</nav>
<div id="main">
<h1 class="page-title">Auth</h1>
<section>
<header>
<h2>
Auth
</h2>
</header>
<article>
<div class="container-overview">
<dl class="details">
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id="requestNewPassword"><span class="type-signature">(route) </span>requestNewPassword<span class="type-signature"></span></h4>
<dl class="details">
</dl>
<div class="description">
<h5>Route:</h5>
<table class="params">
<thead><tr><th>Method</th><th class="last">Path</th></tr></thead>
<tr>
<td class="type">POST</td>
<td class="name last">/api/oauth/reset_password</td>
</tr>
</table>
Send a request to reset the password of a account via its email
<h5>Service:</h5>
<p>Any call to this endpoint need to be done on service : <b>OAUTH</b></p>
<h5>Body Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tr>
<td class="name">email</td>
<td class="type">String</td>
<td class="description last">email of the account that want a password reset</td>
</tr>
</table>
<h5>Response Code:</h5>
<table class="params">
<thead>
<tr>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tr>
<td class="type">500</td>
<td class="description last">the database failed to register the token to reset the mail</td>
</tr><tr>
<td class="type">400</td>
<td class="description last">missing parameters</td>
</tr><tr>
<td class="type">404</td>
<td class="description last">no user account where found with the provided email</td>
</tr><tr>
<td class="type">200</td>
<td class="description last">the mail has been sent to the provided email</td>
</tr>
</table>
</div>
<h4 class="name" id="retrieveToken"><span class="type-signature">(route) </span>retrieveToken<span class="type-signature"></span></h4>
<dl class="details">
</dl>
<div class="description">
<h5>Route:</h5>
<table class="params">
<thead><tr><th>Method</th><th class="last">Path</th></tr></thead>
<tr>
<td class="type">POST</td>
<td class="name last">/api/oauth/token</td>
</tr>
</table>
Ask for an access token on the behalf of an user using a refresh token
<h5>Service:</h5>
<p>Any call to this endpoint need to be done on service : <b>OAUTH</b></p>
<h5>Body Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tr>
<td class="name">client_id</td>
<td class="type">String</td>
<td class="default"></td>
<td class="description last">the public id of your oauth application</td>
</tr><tr>
<td class="name">refresh_token</td>
<td class="type">String</td>
<td class="default"></td>
<td class="description last">refresh token you retrieved via authorize endpoint</td>
</tr><tr>
<td class="name">grant_type</td>
<td class="type">String</td>
<td class="default">refresh_token</td>
<td class="description last"></td>
</tr>
</table>
<h5>Response:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tr>
<td class="name">access_token</td>
<td class="type">String</td>
<td class="description last">a fresh access_token</td>
</tr><tr>
<td class="name">refresh_token</td>
<td class="type">String</td>
<td class="description last">the refresh token you used</td>
</tr><tr>
<td class="name">expire_at</td>
<td class="type">String</td>
<td class="description last">UTC date at which the token will be considered
as invalid</td>
</tr><tr>
<td class="name">token_type</td>
<td class="type">String</td>
<td class="description last">the type of token to use, for now its always Bearer</td>
</tr>
</table>
<h5>Response Code:</h5>
<table class="params">
<thead>
<tr>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tr>
<td class="type">400</td>
<td class="description last">invalid parameters (missing or not correct)</td>
</tr>
</table>
</div>
<h4 class="name" id="sendEmailLink"><span class="type-signature">(route) </span>sendEmailLink<span class="type-signature"></span></h4>
<dl class="details">
</dl>
<div class="description">
<h5>Route:</h5>
<table class="params">
<thead><tr><th>Method</th><th class="last">Path</th></tr></thead>
<tr>
<td class="type">POST</td>
<td class="name last">/api/oauth/send_email_link</td>
</tr>
</table>
Send a request to valid account via its email
<h5>Service:</h5>
<p>Any call to this endpoint need to be done on service : <b>OAUTH</b></p>
<h5>Response Code:</h5>
<table class="params">
<thead>
<tr>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tr>
<td class="type">500</td>
<td class="description last">the database failed to register the token to reset the mail</td>
</tr><tr>
<td class="type">401</td>
<td class="description last">need to authenticated</td>
</tr><tr>
<td class="type">200</td>
<td class="description last">the mail has been sent to the provided email</td>
</tr>
</table>
</div>
<h4 class="name" id="validEmail"><span class="type-signature">(route) </span>validEmail<span class="type-signature"></span></h4>
<dl class="details">
</dl>
<div class="description">
<h5>Route:</h5>
<table class="params">
<thead><tr><th>Method</th><th class="last">Path</th></tr></thead>
<tr>
<td class="type">GET</td>
<td class="name last">/api/oauth/valid_email/:token</td>
</tr>
</table>
Valid user email with a token
<h5>Service:</h5>
<p>Any call to this endpoint need to be done on service : <b>OAUTH</b></p>
<h5>Route Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tr>
<td class="name">:token</td>
<td class="type">undefined</td>
<td class="description last">the token to validate the account</td>
</tr>
</table>
<h5>Response Code:</h5>
<table class="params">
<thead>
<tr>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tr>
<td class="type">500</td>
<td class="description last">the database failed to valid email</td>
</tr><tr>
<td class="type">404</td>
<td class="description last">need to authenticated</td>
</tr><tr>
<td class="type">301</td>
<td class="description last">the email has been valided</td>
</tr>
</table>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="register"><span class="type-signature">(route) </span>register<span class="signature">()</span><span class="type-signature"></span></h4>
<dl class="details">
</dl>
<div class="description">
<h5>Route:</h5>
<table class="params">
<thead><tr><th>Method</th><th class="last">Path</th></tr></thead>
<tr>
<td class="type">GET</td>
<td class="name last">/api/oauth/register</td>
</tr>
</table>
Register a new user
<h5>Service:</h5>
<p>Any call to this endpoint need to be done on service : <b>OAUTH</b></p>
<h5>Body Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tr>
<td class="name">username</td>
<td class="type">String</td>
<td class="attributes"></td>
<td class="description last"></td>
</tr><tr>
<td class="name">email</td>
<td class="type">String</td>
<td class="attributes"></td>
<td class="description last"></td>
</tr><tr>
<td class="name">password</td>
<td class="type">String</td>
<td class="attributes"></td>
<td class="description last"></td>
</tr><tr>
<td class="name">role</td>
<td class="type">String</td>
<td class="attributes">optional</td>
<td class="description last">job title in user company</td>
</tr><tr>
<td class="name">company</td>
<td class="type">String</td>
<td class="attributes">optional</td>
<td class="description last">company name</td>
</tr><tr>
<td class="name">accept_terms</td>
<td class="type">Integer</td>
<td class="attributes"></td>
<td class="description last"></td>
</tr>
</table>
<h5>Response:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tr>
<td class="name">user</td>
<td class="type">Object</td>
<td class="description last">user model</td>
</tr><tr>
<td class="name">access_token</td>
<td class="type">Object</td>
<td class="description last">access token issued for the user</td>
</tr><tr>
<td class="name">refreshToken</td>
<td class="type">Object</td>
<td class="description last">refresh token issued for the user</td>
</tr>
</table>
<h5>Response Code:</h5>
<table class="params">
<thead>
<tr>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tr>
<td class="type">500</td>
<td class="description last">either the registeration of new user is disabled or
the database failed to register the user</td>
</tr><tr>
<td class="type">409</td>
<td class="description last">the user field are already used by another user</td>
</tr><tr>
<td class="type">200</td>
<td class="description last">the user has been created</td>
</tr>
</table>
</div>
<h4 class="name" id="revoke"><span class="type-signature">(route) </span>revoke<span class="signature">()</span><span class="type-signature"></span></h4>
<dl class="details">
</dl>
<div class="description">
<h5>Route:</h5>
<table class="params">
<thead><tr><th>Method</th><th class="last">Path</th></tr></thead>
<tr>
<td class="type">POST</td>
<td class="name last">/api/oauth/revoke</td>
</tr>
</table>
Revoke a refresh token
<h5>Authentication</h5>
<p>A authentication is needed to access this endpoint</p>
<h5>Service:</h5>
<p>Any call to this endpoint need to be done on service : <b>OAUTH</b></p>
<h5>Header Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tr>
<td class="name">Authorization</td>
<td class="type">String</td>
<td class="description last">bearer access token issued for the user</td>
</tr>
</table>
<h5>Response Code:</h5>
<table class="params">
<thead>
<tr>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tr>
<td class="type">404</td>
<td class="description last">token not found</td>
</tr><tr>
<td class="type">500</td>
<td class="description last">database error</td>
</tr><tr>
<td class="type">200</td>
<td class="description last">the token has been succesfully deleted,
if there was access token generated with this token, they
have been deleted too</td>
</tr>
</table>
</div>
</article>
</section>
</div>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Jun 13 2019 12:24:19 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>
<script>prettyPrint();</script>
<script src="scripts/linenumber.js"></script>
</body>
</html>