/* * Copyright 2025 Adobe. All rights reserved. * This file is licensed to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. You may obtain a copy * of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS * OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ import type { BaseCollection, BaseModel } from '../base'; import type { ScrapeUrl } from '../scrape-url'; export interface ScrapeJob extends BaseModel { getBaseURL(): string, getCustomHeaders(): IOptions, getDuration(): number, getEndedAt(): string, getFailedCount(): number, getOptions(): string, getProcessingType(): string, getRedirectCount(): number, getResults(): string, getAbortInfo(): object | null, getScrapeQueueId(): string, getScrapeUrls(): Promise, getScrapeUrlsByStatus(status: string): Promise, getStartedAt(): string, getStatus(): string, getSuccessCount(): number, getUrlCount(): number, setBaseURL(baseURL: string): void, setCustomHeaders(customHeaders: IOptions): void, setDuration(duration: number): void, setEndedAt(endTime: string): void, setFailedCount(failedCount: number): void, setOptions(options: string): void, setProcessingType(processingType: string): void, setRedirectCount(redirectCount: number): void, setResults(results: string): void, setAbortInfo(abortInfo: object | null): void, setScrapeQueueId(ScrapeQueueId: string): void, setStatus(status: string): void, setSuccessCount(successCount: number): void, setUrlCount(urlCount: number): void, } export interface ScrapeJobCollection extends BaseCollection { allByBaseURL(baseURL: string): Promise; allByBaseURLAndProcessingType(baseURL: string, processingType: string): Promise; allByBaseURLAndProcessingTypeAndOptEnableJavascriptAndOptHideConsentBanner( baseURL: string, processingType: string, optEnableJavascript: string, optHideConsentBanner: string): Promise; allByDateRange(startDate: string, endDate: string): Promise; allByStartedAt(startDate: string): Promise; allByStatus(status: string): Promise; allByStatusAndUpdatedAt(status: string, updatedAt: string): Promise; findByBaseURL(baseURL: string): Promise; findByBaseURLAndProcessingType(baseURL: string, processingType: string): Promise; findByBaseURLAndProcessingTypeAndOptEnableJavascriptAndOptHideConsentBanner( baseURL: string, processingType: string, optEnableJavascript: string, optHideConsentBanner: string): Promise; findByStartedAt(startDate: string): Promise; findByStatus(status: string): Promise; findByStatusAndUpdatedAt(status: string, updatedAt: string): Promise; }