UNPKG

postgres-api

Version:
146 lines (104 loc) 4.99 kB
## Functions <dl> <dt><a href="#createService">createService(obj)</a><code>Promise</code></dt> <dd></dd> <dt><a href="#deletePostgresApp">deletePostgresApp(id)</a><code>Promise</code></dt> <dd><p>Deletes a service in postgres by service id</p> </dd> <dt><a href="#updatePostgresApp">updatePostgresApp(id, obj)</a><code>Promise</code></dt> <dd><p>Updates service properties in postgres keyed by service id</p> </dd> <dt><a href="#getService">getService(id)</a><code><a href="#Service">Promise.&lt;Service&gt;</a></code></dt> <dd><p>Returns a Service object in postgres keyed by service id</p> </dd> <dt><a href="#getServiceByName">getServiceByName(name)</a><code><a href="#Service">Promise.&lt;Service&gt;</a></code></dt> <dd><p>Returns a Service object in postgres keyed by service name</p> </dd> <dt><a href="#getAllPermissions">getAllPermissions()</a><code><a href="#Permission">Promise.&lt;Permission&gt;</a></code></dt> <dd><p>Returns an array of permission ids</p> </dd> </dl> ## Typedefs <dl> <dt><a href="#Permission">Permission</a> : <code>Object</code></dt> <dd></dd> <dt><a href="#Service">Service</a> : <code>Object</code></dt> <dd></dd> </dl> <a name="createService"></a> ## createService(obj) ⇒ <code>Promise</code> **Kind**: global function **Returns**: <code>Promise</code> - resolved promise with saved object | Param | Type | | --- | --- | | obj | [<code>Service</code>](#Service) | <a name="deletePostgresApp"></a> ## deletePostgresApp(id) ⇒ <code>Promise</code> Deletes a service in postgres by service id **Kind**: global function **Returns**: <code>Promise</code> - Resolved promise on success containing JSON formatted response **Throws**: - <code>exception</code> | Param | Type | Description | | --- | --- | --- | | id | <code>string</code> | Service id to delete | <a name="updatePostgresApp"></a> ## updatePostgresApp(id, obj) ⇒ <code>Promise</code> Updates service properties in postgres keyed by service id **Kind**: global function **Returns**: <code>Promise</code> - Resolved promise on success containing JSON formatted response containing the new Service object **Throws**: - <code>exception</code> | Param | Type | Description | | --- | --- | --- | | id | <code>string</code> | Service id to delete | | obj | <code>Object</code> | the property or properties of the Service object to update. Note that the name property and id properties cannot be updated | <a name="getService"></a> ## getService(id) ⇒ [<code>Promise.&lt;Service&gt;</code>](#Service) Returns a Service object in postgres keyed by service id **Kind**: global function **Returns**: [<code>Promise.&lt;Service&gt;</code>](#Service) - Resolved promise on success containing JSON formatted response containing the Service object **Throws**: - <code>exception</code> | Param | Type | Description | | --- | --- | --- | | id | <code>string</code> | Service id | <a name="getServiceByName"></a> ## getServiceByName(name) ⇒ [<code>Promise.&lt;Service&gt;</code>](#Service) Returns a Service object in postgres keyed by service name **Kind**: global function **Returns**: [<code>Promise.&lt;Service&gt;</code>](#Service) - Resolved promise on success containing JSON formatted response containing the Service object **Throws**: - <code>exception</code> | Param | Type | Description | | --- | --- | --- | | name | <code>string</code> | string to query | <a name="getAllPermissions"></a> ## getAllPermissions() ⇒ [<code>Promise.&lt;Permission&gt;</code>](#Permission) Returns an array of permission ids **Kind**: global function **Returns**: [<code>Promise.&lt;Permission&gt;</code>](#Permission) - Resolved promise on success containing JSON formatted list of permissions **Throws**: - <code>exception</code> <a name="Permission"></a> ## Permission : <code>Object</code> **Kind**: global typedef **Properties** | Name | Type | Description | | --- | --- | --- | | id | <code>string</code> | required - unique id of the permission | | name | <code>string</code> | required - Name of permission | | description | <code>string</code> | required - Description of the permission | <a name="Service"></a> ## Service : <code>Object</code> **Kind**: global typedef **Properties** | Name | Type | Default | Description | | --- | --- | --- | --- | | id | <code>string</code> | | required - unique id of the service | | name | <code>string</code> | | required - Name of service | | description | <code>string</code> | | required - Description of the service | | callbackUrl | <code>string</code> | | required - Base callback path | | websiteUrl | <code>string</code> | | required - Link to developer's website | | [enabled] | <code>Boolean</code> | <code>&quot;true&quot;</code> | optional - indicates whether service is enabled or not (enabled meaning active) | | [termsLink] | <code>string</code> \| <code>null</code> | <code>null</code> | optional - link to developer terms and conditions |