refactor: clean up patents module
LocationBasedServices/smartguide/pipeline/head This commit looks good

This commit is contained in:
2026-06-17 09:55:01 +02:00
parent 6d3e68a759
commit e9935207ea
15 changed files with 275 additions and 1662 deletions
-45
View File
@@ -33,20 +33,7 @@ export interface PatentEntry {
ipc: string[];
country: string | null;
confidence_score: number;
match_signals?: string[];
}
export interface PatentSearchMeta {
epo_total_hits: number;
uspto_total_hits: number;
epo_returned_hits: number;
uspto_returned_hits: number;
matched_count: number;
epo_truncated: boolean;
uspto_truncated: boolean;
coauthor_signals: number;
publication_keywords: number;
rebuild_failed?: boolean;
}
export interface PatentsByAuthorResponse {
@@ -54,16 +41,12 @@ export interface PatentsByAuthorResponse {
author_name: string | null;
patent_count: number;
patents: PatentEntry[];
from_cache?: boolean;
last_built_at?: string | null;
search_meta?: PatentSearchMeta | null;
}
type GetPatentsByAuthorOptions = {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
refresh?: boolean;
};
@Injectable({
@@ -155,18 +138,12 @@ export class PatentsService extends BaseService {
dataFormat: undefined,
})}/patents`;
let localVarQueryParameters = new HttpParams({ encoder: new CustomHttpParameterCodec() });
if (options?.refresh) {
localVarQueryParameters = localVarQueryParameters.set('refresh', 'true');
}
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<PatentsByAuthorResponse>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
@@ -178,26 +155,4 @@ export class PatentsService extends BaseService {
},
);
}
public rebuildPatentsByAuthor(authorId: string): Observable<PatentsByAuthorResponse> {
const localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({
name: 'authorId',
value: authorId,
in: 'path',
style: 'simple',
explode: false,
dataType: 'string',
dataFormat: undefined,
})}/patents/rebuild`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.post<PatentsByAuthorResponse>(
`${basePath}${localVarPath}`,
null,
{
...(withCredentials ? { withCredentials } : {}),
headers: this.defaultHeaders,
},
);
}
}