Merge remote-tracking branch 'origin/main' into main-2
# Conflicts: # docs/SERVERS.md
This commit is contained in:
commit
840188e4ae
82 files changed
+4185
-78
No files matched your search
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { CrawlerBotRowBot } from "./crawlerBotRowBot";
|
||||
import type { CrawlerBotRowVendor } from "./crawlerBotRowVendor";
|
||||
|
||||
export interface CrawlerBotRow {
|
||||
bot?: CrawlerBotRowBot;
|
||||
vendor?: CrawlerBotRowVendor;
|
||||
purpose: string;
|
||||
hits: number;
|
||||
last_at: string;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type CrawlerBotRowBot = string | null;
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type CrawlerBotRowVendor = string | null;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface CrawlerDaily {
|
||||
day: string;
|
||||
purpose: string;
|
||||
hits: number;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { CrawlerHitRowBot } from "./crawlerHitRowBot";
|
||||
import type { CrawlerHitRowVendor } from "./crawlerHitRowVendor";
|
||||
|
||||
export interface CrawlerHitRow {
|
||||
created_at: string;
|
||||
kind: string;
|
||||
bot?: CrawlerHitRowBot;
|
||||
vendor?: CrawlerHitRowVendor;
|
||||
purpose: string;
|
||||
path: string;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type CrawlerHitRowBot = string | null;
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type CrawlerHitRowVendor = string | null;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface CrawlerPathRow {
|
||||
path: string;
|
||||
hits: number;
|
||||
last_at: string;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { CrawlerRootRowBot } from "./crawlerRootRowBot";
|
||||
|
||||
export interface CrawlerRootRow {
|
||||
kind: string;
|
||||
bot?: CrawlerRootRowBot;
|
||||
purpose: string;
|
||||
hits: number;
|
||||
last_at: string;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type CrawlerRootRowBot = string | null;
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface CrawlerSiteRow {
|
||||
site_id: string;
|
||||
place_id: string;
|
||||
name: string;
|
||||
hits: number;
|
||||
ai_hits: number;
|
||||
last_at: string;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type CrawlerStatsParams = {
|
||||
/**
|
||||
* KST 날짜, 기본 to-6일
|
||||
*/
|
||||
from?: string | null;
|
||||
/**
|
||||
* KST 날짜, 기본 오늘
|
||||
*/
|
||||
to?: string | null;
|
||||
};
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { CrawlerSummaryLastAt } from "./crawlerSummaryLastAt";
|
||||
|
||||
export interface CrawlerSummary {
|
||||
total?: number;
|
||||
ai?: number;
|
||||
bots?: number;
|
||||
last_at?: CrawlerSummaryLastAt;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type CrawlerSummaryLastAt = string | null;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface CrawlerUaRow {
|
||||
user_agent: string;
|
||||
hits: number;
|
||||
last_at: string;
|
||||
}
|
||||
@@ -14,6 +14,21 @@ export * from "./buildStatus";
|
||||
export * from "./checkSlugParams";
|
||||
export * from "./confirm";
|
||||
export * from "./confirmArgs";
|
||||
export * from "./crawlerBotRow";
|
||||
export * from "./crawlerBotRowBot";
|
||||
export * from "./crawlerBotRowVendor";
|
||||
export * from "./crawlerDaily";
|
||||
export * from "./crawlerHitRow";
|
||||
export * from "./crawlerHitRowBot";
|
||||
export * from "./crawlerHitRowVendor";
|
||||
export * from "./crawlerPathRow";
|
||||
export * from "./crawlerRootRow";
|
||||
export * from "./crawlerRootRowBot";
|
||||
export * from "./crawlerSiteRow";
|
||||
export * from "./crawlerStatsParams";
|
||||
export * from "./crawlerSummary";
|
||||
export * from "./crawlerSummaryLastAt";
|
||||
export * from "./crawlerUaRow";
|
||||
export * from "./decision";
|
||||
export * from "./editRedirectParams";
|
||||
export * from "./errorInfo";
|
||||
@@ -258,6 +273,10 @@ export * from "./resCategorySchema";
|
||||
export * from "./resCategorySchemaCategory";
|
||||
export * from "./resCategorySchemaLabel";
|
||||
export * from "./resCategorySchemaMsg";
|
||||
export * from "./resCrawlerStats";
|
||||
export * from "./resCrawlerStatsDateFrom";
|
||||
export * from "./resCrawlerStatsDateTo";
|
||||
export * from "./resCrawlerStatsMsg";
|
||||
export * from "./resExtractFacts";
|
||||
export * from "./resExtractFactsMsg";
|
||||
export * from "./resExtractedFact";
|
||||
@@ -382,6 +401,10 @@ export * from "./resVerifyCandidates";
|
||||
export * from "./resVerifyCandidatesMsg";
|
||||
export * from "./resVerifyCandidatesReason";
|
||||
export * from "./resVerifyCandidatesSource";
|
||||
export * from "./resVisitStats";
|
||||
export * from "./resVisitStatsDateFrom";
|
||||
export * from "./resVisitStatsDateTo";
|
||||
export * from "./resVisitStatsMsg";
|
||||
export * from "./resWeather";
|
||||
export * from "./resWeatherMsg";
|
||||
export * from "./resWeatherWeather";
|
||||
@@ -391,6 +414,7 @@ export * from "./searchPlacesPublicParams";
|
||||
export * from "./showcaseItem";
|
||||
export * from "./showcaseItemRegion";
|
||||
export * from "./showcaseItemThumbnailUrl";
|
||||
export * from "./siteCrawlerStatsParams";
|
||||
export * from "./siteData";
|
||||
export * from "./siteDataCurrentVersionId";
|
||||
export * from "./siteDataDomain";
|
||||
@@ -404,6 +428,7 @@ export * from "./siteVersionData";
|
||||
export * from "./siteVersionDataBuildError";
|
||||
export * from "./siteVersionDataBuiltAt";
|
||||
export * from "./siteVersionDataCreatedAt";
|
||||
export * from "./siteVisitStatsParams";
|
||||
export * from "./sourceType";
|
||||
export * from "./testPost";
|
||||
export * from "./unitData";
|
||||
@@ -413,6 +438,15 @@ export * from "./validationError";
|
||||
export * from "./validationErrorCtx";
|
||||
export * from "./validationErrorLocItem";
|
||||
export * from "./verifyCandidatesParams";
|
||||
export * from "./visitDaily";
|
||||
export * from "./visitDeviceRow";
|
||||
export * from "./visitPathRow";
|
||||
export * from "./visitReferrerRow";
|
||||
export * from "./visitSiteRow";
|
||||
export * from "./visitStatsParams";
|
||||
export * from "./visitSummary";
|
||||
export * from "./visitSummaryLastAt";
|
||||
export * from "./visitUtmRow";
|
||||
export * from "./weatherData";
|
||||
export * from "./weatherDataTimezone";
|
||||
export * from "./weatherDataWindSpeed";
|
||||
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { ErrorInfo } from "./errorInfo";
|
||||
import type { ResCrawlerStatsMsg } from "./resCrawlerStatsMsg";
|
||||
import type { ResCrawlerStatsDateFrom } from "./resCrawlerStatsDateFrom";
|
||||
import type { ResCrawlerStatsDateTo } from "./resCrawlerStatsDateTo";
|
||||
import type { CrawlerSummary } from "./crawlerSummary";
|
||||
import type { CrawlerDaily } from "./crawlerDaily";
|
||||
import type { CrawlerBotRow } from "./crawlerBotRow";
|
||||
import type { CrawlerSiteRow } from "./crawlerSiteRow";
|
||||
import type { CrawlerRootRow } from "./crawlerRootRow";
|
||||
import type { CrawlerUaRow } from "./crawlerUaRow";
|
||||
import type { CrawlerPathRow } from "./crawlerPathRow";
|
||||
import type { CrawlerHitRow } from "./crawlerHitRow";
|
||||
|
||||
/**
|
||||
* 전체(sites·root_files·others)와 사이트별(pages·recent)이 같은 모델을 쓴다 — 해당 없는 칸은 비어 있다.
|
||||
*/
|
||||
export interface ResCrawlerStats {
|
||||
result?: ErrorInfo;
|
||||
msg?: ResCrawlerStatsMsg;
|
||||
date_from?: ResCrawlerStatsDateFrom;
|
||||
date_to?: ResCrawlerStatsDateTo;
|
||||
summary?: CrawlerSummary;
|
||||
daily?: CrawlerDaily[];
|
||||
bots?: CrawlerBotRow[];
|
||||
sites?: CrawlerSiteRow[];
|
||||
root_files?: CrawlerRootRow[];
|
||||
others?: CrawlerUaRow[];
|
||||
pages?: CrawlerPathRow[];
|
||||
recent?: CrawlerHitRow[];
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type ResCrawlerStatsDateFrom = string | null;
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type ResCrawlerStatsDateTo = string | null;
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type ResCrawlerStatsMsg = string | null;
|
||||
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { ErrorInfo } from "./errorInfo";
|
||||
import type { ResVisitStatsMsg } from "./resVisitStatsMsg";
|
||||
import type { ResVisitStatsDateFrom } from "./resVisitStatsDateFrom";
|
||||
import type { ResVisitStatsDateTo } from "./resVisitStatsDateTo";
|
||||
import type { VisitSummary } from "./visitSummary";
|
||||
import type { VisitDaily } from "./visitDaily";
|
||||
import type { VisitSiteRow } from "./visitSiteRow";
|
||||
import type { VisitPathRow } from "./visitPathRow";
|
||||
import type { VisitReferrerRow } from "./visitReferrerRow";
|
||||
import type { VisitUtmRow } from "./visitUtmRow";
|
||||
import type { VisitDeviceRow } from "./visitDeviceRow";
|
||||
|
||||
/**
|
||||
* 전체(sites)와 사이트별(pages·utm)이 같은 모델을 쓴다 — 해당 없는 칸은 비어 있다.
|
||||
*/
|
||||
export interface ResVisitStats {
|
||||
result?: ErrorInfo;
|
||||
msg?: ResVisitStatsMsg;
|
||||
date_from?: ResVisitStatsDateFrom;
|
||||
date_to?: ResVisitStatsDateTo;
|
||||
realtime?: number;
|
||||
summary?: VisitSummary;
|
||||
daily?: VisitDaily[];
|
||||
sites?: VisitSiteRow[];
|
||||
pages?: VisitPathRow[];
|
||||
referrers?: VisitReferrerRow[];
|
||||
utm?: VisitUtmRow[];
|
||||
devices?: VisitDeviceRow[];
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type ResVisitStatsDateFrom = string | null;
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type ResVisitStatsDateTo = string | null;
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type ResVisitStatsMsg = string | null;
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type SiteCrawlerStatsParams = {
|
||||
/**
|
||||
* KST 날짜, 기본 to-6일
|
||||
*/
|
||||
from?: string | null;
|
||||
/**
|
||||
* KST 날짜, 기본 오늘
|
||||
*/
|
||||
to?: string | null;
|
||||
};
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type SiteVisitStatsParams = {
|
||||
/**
|
||||
* KST 날짜, 기본 to-6일
|
||||
*/
|
||||
from?: string | null;
|
||||
/**
|
||||
* KST 날짜, 기본 오늘
|
||||
*/
|
||||
to?: string | null;
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface VisitDaily {
|
||||
day: string;
|
||||
views: number;
|
||||
visitors: number;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface VisitDeviceRow {
|
||||
device: string;
|
||||
views: number;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface VisitPathRow {
|
||||
path: string;
|
||||
views: number;
|
||||
visitors: number;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface VisitReferrerRow {
|
||||
domain: string;
|
||||
views: number;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface VisitSiteRow {
|
||||
site_id: string;
|
||||
place_id: string;
|
||||
name: string;
|
||||
views: number;
|
||||
visitors: number;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type VisitStatsParams = {
|
||||
/**
|
||||
* KST 날짜, 기본 to-6일
|
||||
*/
|
||||
from?: string | null;
|
||||
/**
|
||||
* KST 날짜, 기본 오늘
|
||||
*/
|
||||
to?: string | null;
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { VisitSummaryLastAt } from "./visitSummaryLastAt";
|
||||
|
||||
export interface VisitSummary {
|
||||
views?: number;
|
||||
visitors?: number;
|
||||
last_at?: VisitSummaryLastAt;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type VisitSummaryLastAt = string | null;
|
||||
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface VisitUtmRow {
|
||||
source: string;
|
||||
views: number;
|
||||
}
|
||||
@@ -18,11 +18,17 @@ import type {
|
||||
} from "@tanstack/react-query";
|
||||
|
||||
import type {
|
||||
CrawlerStatsParams,
|
||||
HTTPValidationError,
|
||||
ListSitesParams,
|
||||
ListUsersParams,
|
||||
ResCrawlerStats,
|
||||
ResOpsSites,
|
||||
ResOpsUsers,
|
||||
ResVisitStats,
|
||||
SiteCrawlerStatsParams,
|
||||
SiteVisitStatsParams,
|
||||
VisitStatsParams,
|
||||
} from ".././model";
|
||||
|
||||
import { customFetch } from "../../mutator/custom-fetch";
|
||||
@@ -312,3 +318,641 @@ export function useListUsers<
|
||||
|
||||
return query;
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary 전체 크롤러 통계(개발자 전용)
|
||||
*/
|
||||
export const crawlerStats = (
|
||||
params?: CrawlerStatsParams,
|
||||
options?: SecondParameter<typeof customFetch>,
|
||||
signal?: AbortSignal,
|
||||
) => {
|
||||
return customFetch<ResCrawlerStats>(
|
||||
{ url: `/v1/ops/stats/crawlers`, method: "GET", params, signal },
|
||||
options,
|
||||
);
|
||||
};
|
||||
|
||||
export const getCrawlerStatsQueryKey = (params?: CrawlerStatsParams) => {
|
||||
return [`/v1/ops/stats/crawlers`, ...(params ? [params] : [])] as const;
|
||||
};
|
||||
|
||||
export const getCrawlerStatsQueryOptions = <
|
||||
TData = Awaited<ReturnType<typeof crawlerStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
params?: CrawlerStatsParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<Awaited<ReturnType<typeof crawlerStats>>, TError, TData>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
) => {
|
||||
const { query: queryOptions, request: requestOptions } = options ?? {};
|
||||
|
||||
const queryKey = queryOptions?.queryKey ?? getCrawlerStatsQueryKey(params);
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof crawlerStats>>> = ({
|
||||
signal,
|
||||
}) => crawlerStats(params, requestOptions, signal);
|
||||
|
||||
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
|
||||
Awaited<ReturnType<typeof crawlerStats>>,
|
||||
TError,
|
||||
TData
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
};
|
||||
|
||||
export type CrawlerStatsQueryResult = NonNullable<
|
||||
Awaited<ReturnType<typeof crawlerStats>>
|
||||
>;
|
||||
export type CrawlerStatsQueryError = HTTPValidationError;
|
||||
|
||||
export function useCrawlerStats<
|
||||
TData = Awaited<ReturnType<typeof crawlerStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
params: undefined | CrawlerStatsParams,
|
||||
options: {
|
||||
query: Partial<
|
||||
UseQueryOptions<Awaited<ReturnType<typeof crawlerStats>>, TError, TData>
|
||||
> &
|
||||
Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof crawlerStats>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof crawlerStats>>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): DefinedUseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useCrawlerStats<
|
||||
TData = Awaited<ReturnType<typeof crawlerStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
params?: CrawlerStatsParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<Awaited<ReturnType<typeof crawlerStats>>, TError, TData>
|
||||
> &
|
||||
Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof crawlerStats>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof crawlerStats>>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useCrawlerStats<
|
||||
TData = Awaited<ReturnType<typeof crawlerStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
params?: CrawlerStatsParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<Awaited<ReturnType<typeof crawlerStats>>, TError, TData>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
/**
|
||||
* @summary 전체 크롤러 통계(개발자 전용)
|
||||
*/
|
||||
|
||||
export function useCrawlerStats<
|
||||
TData = Awaited<ReturnType<typeof crawlerStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
params?: CrawlerStatsParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<Awaited<ReturnType<typeof crawlerStats>>, TError, TData>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
} {
|
||||
const queryOptions = getCrawlerStatsQueryOptions(params, options);
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
|
||||
TData,
|
||||
TError
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
query.queryKey = queryOptions.queryKey;
|
||||
|
||||
return query;
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary 사이트별 크롤러 통계(개발자 전용)
|
||||
*/
|
||||
export const siteCrawlerStats = (
|
||||
placeId: string,
|
||||
params?: SiteCrawlerStatsParams,
|
||||
options?: SecondParameter<typeof customFetch>,
|
||||
signal?: AbortSignal,
|
||||
) => {
|
||||
return customFetch<ResCrawlerStats>(
|
||||
{
|
||||
url: `/v1/ops/sites/${placeId}/stats/crawlers`,
|
||||
method: "GET",
|
||||
params,
|
||||
signal,
|
||||
},
|
||||
options,
|
||||
);
|
||||
};
|
||||
|
||||
export const getSiteCrawlerStatsQueryKey = (
|
||||
placeId?: string,
|
||||
params?: SiteCrawlerStatsParams,
|
||||
) => {
|
||||
return [
|
||||
`/v1/ops/sites/${placeId}/stats/crawlers`,
|
||||
...(params ? [params] : []),
|
||||
] as const;
|
||||
};
|
||||
|
||||
export const getSiteCrawlerStatsQueryOptions = <
|
||||
TData = Awaited<ReturnType<typeof siteCrawlerStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
placeId: string,
|
||||
params?: SiteCrawlerStatsParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof siteCrawlerStats>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
) => {
|
||||
const { query: queryOptions, request: requestOptions } = options ?? {};
|
||||
|
||||
const queryKey =
|
||||
queryOptions?.queryKey ?? getSiteCrawlerStatsQueryKey(placeId, params);
|
||||
|
||||
const queryFn: QueryFunction<
|
||||
Awaited<ReturnType<typeof siteCrawlerStats>>
|
||||
> = ({ signal }) => siteCrawlerStats(placeId, params, requestOptions, signal);
|
||||
|
||||
return {
|
||||
queryKey,
|
||||
queryFn,
|
||||
enabled: !!placeId,
|
||||
...queryOptions,
|
||||
} as UseQueryOptions<
|
||||
Awaited<ReturnType<typeof siteCrawlerStats>>,
|
||||
TError,
|
||||
TData
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
};
|
||||
|
||||
export type SiteCrawlerStatsQueryResult = NonNullable<
|
||||
Awaited<ReturnType<typeof siteCrawlerStats>>
|
||||
>;
|
||||
export type SiteCrawlerStatsQueryError = HTTPValidationError;
|
||||
|
||||
export function useSiteCrawlerStats<
|
||||
TData = Awaited<ReturnType<typeof siteCrawlerStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
placeId: string,
|
||||
params: undefined | SiteCrawlerStatsParams,
|
||||
options: {
|
||||
query: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof siteCrawlerStats>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
> &
|
||||
Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof siteCrawlerStats>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof siteCrawlerStats>>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): DefinedUseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useSiteCrawlerStats<
|
||||
TData = Awaited<ReturnType<typeof siteCrawlerStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
placeId: string,
|
||||
params?: SiteCrawlerStatsParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof siteCrawlerStats>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
> &
|
||||
Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof siteCrawlerStats>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof siteCrawlerStats>>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useSiteCrawlerStats<
|
||||
TData = Awaited<ReturnType<typeof siteCrawlerStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
placeId: string,
|
||||
params?: SiteCrawlerStatsParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof siteCrawlerStats>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
/**
|
||||
* @summary 사이트별 크롤러 통계(개발자 전용)
|
||||
*/
|
||||
|
||||
export function useSiteCrawlerStats<
|
||||
TData = Awaited<ReturnType<typeof siteCrawlerStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
placeId: string,
|
||||
params?: SiteCrawlerStatsParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof siteCrawlerStats>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
} {
|
||||
const queryOptions = getSiteCrawlerStatsQueryOptions(
|
||||
placeId,
|
||||
params,
|
||||
options,
|
||||
);
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
|
||||
TData,
|
||||
TError
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
query.queryKey = queryOptions.queryKey;
|
||||
|
||||
return query;
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary 전체 방문 통계(개발자 전용)
|
||||
*/
|
||||
export const visitStats = (
|
||||
params?: VisitStatsParams,
|
||||
options?: SecondParameter<typeof customFetch>,
|
||||
signal?: AbortSignal,
|
||||
) => {
|
||||
return customFetch<ResVisitStats>(
|
||||
{ url: `/v1/ops/stats/visits`, method: "GET", params, signal },
|
||||
options,
|
||||
);
|
||||
};
|
||||
|
||||
export const getVisitStatsQueryKey = (params?: VisitStatsParams) => {
|
||||
return [`/v1/ops/stats/visits`, ...(params ? [params] : [])] as const;
|
||||
};
|
||||
|
||||
export const getVisitStatsQueryOptions = <
|
||||
TData = Awaited<ReturnType<typeof visitStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
params?: VisitStatsParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<Awaited<ReturnType<typeof visitStats>>, TError, TData>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
) => {
|
||||
const { query: queryOptions, request: requestOptions } = options ?? {};
|
||||
|
||||
const queryKey = queryOptions?.queryKey ?? getVisitStatsQueryKey(params);
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof visitStats>>> = ({
|
||||
signal,
|
||||
}) => visitStats(params, requestOptions, signal);
|
||||
|
||||
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
|
||||
Awaited<ReturnType<typeof visitStats>>,
|
||||
TError,
|
||||
TData
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
};
|
||||
|
||||
export type VisitStatsQueryResult = NonNullable<
|
||||
Awaited<ReturnType<typeof visitStats>>
|
||||
>;
|
||||
export type VisitStatsQueryError = HTTPValidationError;
|
||||
|
||||
export function useVisitStats<
|
||||
TData = Awaited<ReturnType<typeof visitStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
params: undefined | VisitStatsParams,
|
||||
options: {
|
||||
query: Partial<
|
||||
UseQueryOptions<Awaited<ReturnType<typeof visitStats>>, TError, TData>
|
||||
> &
|
||||
Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof visitStats>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof visitStats>>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): DefinedUseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useVisitStats<
|
||||
TData = Awaited<ReturnType<typeof visitStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
params?: VisitStatsParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<Awaited<ReturnType<typeof visitStats>>, TError, TData>
|
||||
> &
|
||||
Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof visitStats>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof visitStats>>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useVisitStats<
|
||||
TData = Awaited<ReturnType<typeof visitStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
params?: VisitStatsParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<Awaited<ReturnType<typeof visitStats>>, TError, TData>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
/**
|
||||
* @summary 전체 방문 통계(개발자 전용)
|
||||
*/
|
||||
|
||||
export function useVisitStats<
|
||||
TData = Awaited<ReturnType<typeof visitStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
params?: VisitStatsParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<Awaited<ReturnType<typeof visitStats>>, TError, TData>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
} {
|
||||
const queryOptions = getVisitStatsQueryOptions(params, options);
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
|
||||
TData,
|
||||
TError
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
query.queryKey = queryOptions.queryKey;
|
||||
|
||||
return query;
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary 사이트별 방문 통계(개발자 전용)
|
||||
*/
|
||||
export const siteVisitStats = (
|
||||
placeId: string,
|
||||
params?: SiteVisitStatsParams,
|
||||
options?: SecondParameter<typeof customFetch>,
|
||||
signal?: AbortSignal,
|
||||
) => {
|
||||
return customFetch<ResVisitStats>(
|
||||
{
|
||||
url: `/v1/ops/sites/${placeId}/stats/visits`,
|
||||
method: "GET",
|
||||
params,
|
||||
signal,
|
||||
},
|
||||
options,
|
||||
);
|
||||
};
|
||||
|
||||
export const getSiteVisitStatsQueryKey = (
|
||||
placeId?: string,
|
||||
params?: SiteVisitStatsParams,
|
||||
) => {
|
||||
return [
|
||||
`/v1/ops/sites/${placeId}/stats/visits`,
|
||||
...(params ? [params] : []),
|
||||
] as const;
|
||||
};
|
||||
|
||||
export const getSiteVisitStatsQueryOptions = <
|
||||
TData = Awaited<ReturnType<typeof siteVisitStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
placeId: string,
|
||||
params?: SiteVisitStatsParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<Awaited<ReturnType<typeof siteVisitStats>>, TError, TData>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
) => {
|
||||
const { query: queryOptions, request: requestOptions } = options ?? {};
|
||||
|
||||
const queryKey =
|
||||
queryOptions?.queryKey ?? getSiteVisitStatsQueryKey(placeId, params);
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof siteVisitStats>>> = ({
|
||||
signal,
|
||||
}) => siteVisitStats(placeId, params, requestOptions, signal);
|
||||
|
||||
return {
|
||||
queryKey,
|
||||
queryFn,
|
||||
enabled: !!placeId,
|
||||
...queryOptions,
|
||||
} as UseQueryOptions<
|
||||
Awaited<ReturnType<typeof siteVisitStats>>,
|
||||
TError,
|
||||
TData
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
};
|
||||
|
||||
export type SiteVisitStatsQueryResult = NonNullable<
|
||||
Awaited<ReturnType<typeof siteVisitStats>>
|
||||
>;
|
||||
export type SiteVisitStatsQueryError = HTTPValidationError;
|
||||
|
||||
export function useSiteVisitStats<
|
||||
TData = Awaited<ReturnType<typeof siteVisitStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
placeId: string,
|
||||
params: undefined | SiteVisitStatsParams,
|
||||
options: {
|
||||
query: Partial<
|
||||
UseQueryOptions<Awaited<ReturnType<typeof siteVisitStats>>, TError, TData>
|
||||
> &
|
||||
Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof siteVisitStats>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof siteVisitStats>>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): DefinedUseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useSiteVisitStats<
|
||||
TData = Awaited<ReturnType<typeof siteVisitStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
placeId: string,
|
||||
params?: SiteVisitStatsParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<Awaited<ReturnType<typeof siteVisitStats>>, TError, TData>
|
||||
> &
|
||||
Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof siteVisitStats>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof siteVisitStats>>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useSiteVisitStats<
|
||||
TData = Awaited<ReturnType<typeof siteVisitStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
placeId: string,
|
||||
params?: SiteVisitStatsParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<Awaited<ReturnType<typeof siteVisitStats>>, TError, TData>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
/**
|
||||
* @summary 사이트별 방문 통계(개발자 전용)
|
||||
*/
|
||||
|
||||
export function useSiteVisitStats<
|
||||
TData = Awaited<ReturnType<typeof siteVisitStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
placeId: string,
|
||||
params?: SiteVisitStatsParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<Awaited<ReturnType<typeof siteVisitStats>>, TError, TData>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
} {
|
||||
const queryOptions = getSiteVisitStatsQueryOptions(placeId, params, options);
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
|
||||
TData,
|
||||
TError
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
query.queryKey = queryOptions.queryKey;
|
||||
|
||||
return query;
|
||||
}
|
||||
Reference in new issue
Block a user