mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat: add watchlist entity diagram
This commit is contained in:
@@ -64,13 +64,22 @@ export interface User {
|
||||
roles: string[]
|
||||
}
|
||||
|
||||
export interface Watchlist {
|
||||
export interface WatchlistRequest {
|
||||
name?: string
|
||||
domains: string[],
|
||||
triggers: { event: EventAction, action: TriggerAction }[],
|
||||
connector?: string
|
||||
}
|
||||
|
||||
export interface Watchlist {
|
||||
token: string
|
||||
name?: string
|
||||
domains: Domain[],
|
||||
triggers: { event: EventAction, action: TriggerAction }[],
|
||||
connector?: string
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
export interface InstanceConfig {
|
||||
ssoLogin: boolean
|
||||
limtedFeatures: boolean
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {request, Watchlist} from "./index";
|
||||
import {request, Watchlist, WatchlistRequest} from "./index";
|
||||
|
||||
export async function getWatchlists() {
|
||||
const response = await request({
|
||||
@@ -8,13 +8,13 @@ export async function getWatchlists() {
|
||||
}
|
||||
|
||||
export async function getWatchlist(token: string) {
|
||||
const response = await request<Watchlist & { token: string }>({
|
||||
const response = await request<Watchlist>({
|
||||
url: 'watchlists/' + token
|
||||
})
|
||||
return response.data
|
||||
}
|
||||
|
||||
export async function postWatchlist(watchlist: Watchlist) {
|
||||
export async function postWatchlist(watchlist: WatchlistRequest) {
|
||||
const response = await request<{ token: string }>({
|
||||
method: 'POST',
|
||||
url: 'watchlists',
|
||||
@@ -33,8 +33,8 @@ export async function deleteWatchlist(token: string): Promise<void> {
|
||||
})
|
||||
}
|
||||
|
||||
export async function putWatchlist(watchlist: Partial<Watchlist> & { token: string }) {
|
||||
const response = await request<Watchlist>({
|
||||
export async function putWatchlist(watchlist: Partial<WatchlistRequest> & { token: string }) {
|
||||
const response = await request<WatchlistRequest>({
|
||||
method: 'PUT',
|
||||
url: 'watchlists/' + watchlist.token,
|
||||
data: watchlist,
|
||||
|
||||
Reference in New Issue
Block a user