/** * @license * Copyright 2023 Open Ag Data Alliance * * Licensed 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 CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import type { OADAClient } from '@oada/client'; import type OADAJob from '@oada/types/oada/service/job.js'; import type { Json } from './index.js'; export interface FromOada { job: Job; isJob: boolean; } export interface JobUpdate { status: string; time: string; meta?: unknown; } /** * Holds job data */ export declare class Job { readonly oadaId: string; static readonly Statuses: readonly ["queued", "running", "success", "failure"]; /** * Fetch a Job from an OADA resource ID * @param oada Authenticated OADAClient to fetch Job object * @param id OADA resource ID of job */ static fromOada(oada: OADAClient, oadaId: string): Promise; readonly service: string; readonly type: string; readonly config: Json; readonly status?: string; readonly updates?: Record; /** * Creates a Job class * @param oadaId Job ID * @param job OADA Job object */ constructor(oadaId: string, job: OADAJob); }