UNPKG

cberg

Version:

Node.js Client for the Codeberg API

431 lines (296 loc) 17.7 kB
# NotificationApi All URIs are relative to */api/v1* |Method | HTTP request | Description| |------------- | ------------- | -------------| |[**notifyGetList**](#notifygetlist) | **GET** /notifications | List users\&#39;s notification threads| |[**notifyGetRepoList**](#notifygetrepolist) | **GET** /repos/{owner}/{repo}/notifications | List users\&#39;s notification threads on a specific repo| |[**notifyGetThread**](#notifygetthread) | **GET** /notifications/threads/{id} | Get notification thread by ID| |[**notifyNewAvailable**](#notifynewavailable) | **GET** /notifications/new | Check if unread notifications exist| |[**notifyReadList**](#notifyreadlist) | **PUT** /notifications | Mark notification threads as read, pinned or unread| |[**notifyReadRepoList**](#notifyreadrepolist) | **PUT** /repos/{owner}/{repo}/notifications | Mark notification threads as read, pinned or unread on a specific repo| |[**notifyReadThread**](#notifyreadthread) | **PATCH** /notifications/threads/{id} | Mark notification thread as read by ID| # **notifyGetList** > Array<NotificationThread> notifyGetList() ### Example ```typescript import { NotificationApi, Configuration } from 'berg'; const configuration = new Configuration(); const apiInstance = new NotificationApi(configuration); let all: boolean; //If true, show notifications marked as read. Default value is false (optional) (default to undefined) let statusTypes: Array<string>; //Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread \\u0026 pinned. (optional) (default to undefined) let subjectType: Array<'issue' | 'pull' | 'commit' | 'repository'>; //filter notifications by subject type (optional) (default to undefined) let since: string; //Only show notifications updated after the given time. This is a timestamp in RFC 3339 format (optional) (default to undefined) let before: string; //Only show notifications updated before the given time. This is a timestamp in RFC 3339 format (optional) (default to undefined) let page: number; //page number of results to return (1-based) (optional) (default to undefined) let limit: number; //page size of results (optional) (default to undefined) const { status, data } = await apiInstance.notifyGetList( all, statusTypes, subjectType, since, before, page, limit ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **all** | [**boolean**] | If true, show notifications marked as read. Default value is false | (optional) defaults to undefined| | **statusTypes** | **Array&lt;string&gt;** | Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread \\u0026 pinned. | (optional) defaults to undefined| | **subjectType** | **Array<&#39;issue&#39; &#124; &#39;pull&#39; &#124; &#39;commit&#39; &#124; &#39;repository&#39;>** | filter notifications by subject type | (optional) defaults to undefined| | **since** | [**string**] | Only show notifications updated after the given time. This is a timestamp in RFC 3339 format | (optional) defaults to undefined| | **before** | [**string**] | Only show notifications updated before the given time. This is a timestamp in RFC 3339 format | (optional) defaults to undefined| | **page** | [**number**] | page number of results to return (1-based) | (optional) defaults to undefined| | **limit** | [**number**] | page size of results | (optional) defaults to undefined| ### Return type **Array<NotificationThread>** ### Authorization [TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| |**200** | NotificationThreadList | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **notifyGetRepoList** > Array<NotificationThread> notifyGetRepoList() ### Example ```typescript import { NotificationApi, Configuration } from 'berg'; const configuration = new Configuration(); const apiInstance = new NotificationApi(configuration); let owner: string; //owner of the repo (default to undefined) let repo: string; //name of the repo (default to undefined) let all: boolean; //If true, show notifications marked as read. Default value is false (optional) (default to undefined) let statusTypes: Array<string>; //Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread \\u0026 pinned (optional) (default to undefined) let subjectType: Array<'issue' | 'pull' | 'commit' | 'repository'>; //filter notifications by subject type (optional) (default to undefined) let since: string; //Only show notifications updated after the given time. This is a timestamp in RFC 3339 format (optional) (default to undefined) let before: string; //Only show notifications updated before the given time. This is a timestamp in RFC 3339 format (optional) (default to undefined) let page: number; //page number of results to return (1-based) (optional) (default to undefined) let limit: number; //page size of results (optional) (default to undefined) const { status, data } = await apiInstance.notifyGetRepoList( owner, repo, all, statusTypes, subjectType, since, before, page, limit ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **owner** | [**string**] | owner of the repo | defaults to undefined| | **repo** | [**string**] | name of the repo | defaults to undefined| | **all** | [**boolean**] | If true, show notifications marked as read. Default value is false | (optional) defaults to undefined| | **statusTypes** | **Array&lt;string&gt;** | Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread \\u0026 pinned | (optional) defaults to undefined| | **subjectType** | **Array<&#39;issue&#39; &#124; &#39;pull&#39; &#124; &#39;commit&#39; &#124; &#39;repository&#39;>** | filter notifications by subject type | (optional) defaults to undefined| | **since** | [**string**] | Only show notifications updated after the given time. This is a timestamp in RFC 3339 format | (optional) defaults to undefined| | **before** | [**string**] | Only show notifications updated before the given time. This is a timestamp in RFC 3339 format | (optional) defaults to undefined| | **page** | [**number**] | page number of results to return (1-based) | (optional) defaults to undefined| | **limit** | [**number**] | page size of results | (optional) defaults to undefined| ### Return type **Array<NotificationThread>** ### Authorization [TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| |**200** | NotificationThreadList | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **notifyGetThread** > NotificationThread notifyGetThread() ### Example ```typescript import { NotificationApi, Configuration } from 'berg'; const configuration = new Configuration(); const apiInstance = new NotificationApi(configuration); let id: string; //id of notification thread (default to undefined) const { status, data } = await apiInstance.notifyGetThread( id ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **id** | [**string**] | id of notification thread | defaults to undefined| ### Return type **NotificationThread** ### Authorization [TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| |**200** | NotificationThread | - | |**403** | APIForbiddenError is a forbidden error response | - | |**404** | APINotFound is a not found error response | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **notifyNewAvailable** > NotificationCount notifyNewAvailable() ### Example ```typescript import { NotificationApi, Configuration } from 'berg'; const configuration = new Configuration(); const apiInstance = new NotificationApi(configuration); const { status, data } = await apiInstance.notifyNewAvailable(); ``` ### Parameters This endpoint does not have any parameters. ### Return type **NotificationCount** ### Authorization [TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json, text/html ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| |**200** | Number of unread notifications | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **notifyReadList** > Array<NotificationThread> notifyReadList() ### Example ```typescript import { NotificationApi, Configuration } from 'berg'; const configuration = new Configuration(); const apiInstance = new NotificationApi(configuration); let lastReadAt: string; //Describes the last point that notifications were checked. Anything updated since this time will not be updated. (optional) (default to undefined) let all: string; //If true, mark all notifications on this repo. Default value is false (optional) (default to undefined) let statusTypes: Array<string>; //Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread. (optional) (default to undefined) let toStatus: string; //Status to mark notifications as, Defaults to read. (optional) (default to undefined) const { status, data } = await apiInstance.notifyReadList( lastReadAt, all, statusTypes, toStatus ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **lastReadAt** | [**string**] | Describes the last point that notifications were checked. Anything updated since this time will not be updated. | (optional) defaults to undefined| | **all** | [**string**] | If true, mark all notifications on this repo. Default value is false | (optional) defaults to undefined| | **statusTypes** | **Array&lt;string&gt;** | Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread. | (optional) defaults to undefined| | **toStatus** | [**string**] | Status to mark notifications as, Defaults to read. | (optional) defaults to undefined| ### Return type **Array<NotificationThread>** ### Authorization [TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| |**205** | NotificationThreadList | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **notifyReadRepoList** > Array<NotificationThread> notifyReadRepoList() ### Example ```typescript import { NotificationApi, Configuration } from 'berg'; const configuration = new Configuration(); const apiInstance = new NotificationApi(configuration); let owner: string; //owner of the repo (default to undefined) let repo: string; //name of the repo (default to undefined) let all: string; //If true, mark all notifications on this repo. Default value is false (optional) (default to undefined) let statusTypes: Array<string>; //Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread. (optional) (default to undefined) let toStatus: string; //Status to mark notifications as. Defaults to read. (optional) (default to undefined) let lastReadAt: string; //Describes the last point that notifications were checked. Anything updated since this time will not be updated. (optional) (default to undefined) const { status, data } = await apiInstance.notifyReadRepoList( owner, repo, all, statusTypes, toStatus, lastReadAt ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **owner** | [**string**] | owner of the repo | defaults to undefined| | **repo** | [**string**] | name of the repo | defaults to undefined| | **all** | [**string**] | If true, mark all notifications on this repo. Default value is false | (optional) defaults to undefined| | **statusTypes** | **Array&lt;string&gt;** | Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread. | (optional) defaults to undefined| | **toStatus** | [**string**] | Status to mark notifications as. Defaults to read. | (optional) defaults to undefined| | **lastReadAt** | [**string**] | Describes the last point that notifications were checked. Anything updated since this time will not be updated. | (optional) defaults to undefined| ### Return type **Array<NotificationThread>** ### Authorization [TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| |**205** | NotificationThreadList | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **notifyReadThread** > NotificationThread notifyReadThread() ### Example ```typescript import { NotificationApi, Configuration } from 'berg'; const configuration = new Configuration(); const apiInstance = new NotificationApi(configuration); let id: string; //id of notification thread (default to undefined) let toStatus: string; //Status to mark notifications as (optional) (default to 'read') const { status, data } = await apiInstance.notifyReadThread( id, toStatus ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **id** | [**string**] | id of notification thread | defaults to undefined| | **toStatus** | [**string**] | Status to mark notifications as | (optional) defaults to 'read'| ### Return type **NotificationThread** ### Authorization [TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| |**205** | NotificationThread | - | |**403** | APIForbiddenError is a forbidden error response | - | |**404** | APINotFound is a not found error response | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)