/** * The format for an @oada/jobs job queue job. * @example * ```json * { * "_id": "resources/123", * "_type": "application/vnd.oada.service.job.1+json", * "_meta": { * "_id": "resources/123/_meta", * "_rev": 3 * }, * "_rev": 3, * "service": "shares", * "type": "trading-partner", * "config": { * "resource": { * "_id": "resources/TESTCOI1" * }, * "trading-partner": { * "_id": "resources/1b0yRTKhv21Rkbkt32PSokJOOrs_TP_LEGACYFARM" * }, * "path": "/bookmarks/trellisfw/trading-partners/1b0yRTKhv21Rkbkt32PSokJOOrs_TP_LEGACYFARM/bookmarks/trellisfw/cois" * }, * "status": "pending", * "updates": { * "1bF4ELuQwqU3CjDOsn2NF0d7Deu": { * "status": "started", * "time": "2018-11-14T20:20:39+00:00" * }, * "1bF4GjXWJvj6FJEXCiAj8DatQTD": { * "status": "pending", * "time": "2018-11-13T20:20:39+00:00", * "information": "Share requires manual approval" * } * } * } * ``` * * @example * ```json * { * "_id": "resources/123", * "_type": "application/vnd.oada.service.job.1+json", * "_meta": { * "_id": "resources/123/_meta", * "_rev": 3 * }, * "_rev": 3, * "service": "shares", * "type": "trading-partner", * "config": { * "resource": { * "_id": "resources/TESTCOI1" * }, * "trading-partner": { * "_id": "resources/1b0yRTKhv21Rkbkt32PSokJOOrs_TP_LEGACYFARM" * }, * "path": "/bookmarks/trellisfw/trading-partners/1b0yRTKhv21Rkbkt32PSokJOOrs_TP_LEGACYFARM/bookmarks/trellisfw/cois" * }, * "status": "success", * "results": { * "path": "/bookmarks/new/path" * }, * "updates": { * "1bWH1wv07R4XEhwyK2T3wJ2kLMo": { * "status": "success", * "time": "2018-11-15T20:20:39+00:00", * "information": { * "approved": "john" * } * }, * "1bF4ELuQwqU3CjDOsn2NF0d7Deu": { * "status": "started", * "time": "2018-11-14T20:20:39+00:00" * }, * "1bF4GjXWJvj6FJEXCiAj8DatQTD": { * "status": "pending", * "time": "2018-11-13T20:20:39+00:00", * "information": "Share requires manual approval" * } * } * } * ``` * * * File automatically generated using json-schema-to-typescript. * ! DO NOT MODIFY IT BY HAND ! * Instead, modify the source file ./oada/service/job.schema.json of @oada/formats * and run `$ yarn build` to regenerate this file. * * @packageDocumentation */ /** * `$id` of the source schema * @see {@link https://formats.openag.io/oada/service/job.schema.json} */ export declare const $id = "https://formats.openag.io/oada/service/job.schema.json"; /** * JSON Schema used to generate this type * @see {@link https://formats.openag.io/oada/service/job.schema.json} */ export declare const schema: { readonly $id: "https://formats.openag.io/oada/service/job.schema.json"; readonly $schema: "http://json-schema.org/draft-07/schema#"; readonly description: "The format for an @oada/jobs job queue job."; readonly type: "object"; readonly properties: { readonly service: { readonly description: "Service name which job is for"; readonly type: "string"; }; readonly type: { readonly description: "Service specific identifier of job type"; readonly type: "string"; }; readonly config: { readonly description: "Job specific configuration object"; readonly type: "object"; }; readonly result: { readonly description: "Final result of job"; readonly type: "object"; }; readonly status: { readonly description: "Current status of job"; readonly type: "string"; }; readonly updates: { readonly description: "A list of updates as job progresses. Keys shall be sorted in time order."; readonly type: "object"; readonly additionalProperties: { readonly $ref: "./job/update.schema.json"; }; }; }; readonly required: readonly ["service", "type"]; readonly examples: readonly [{ readonly _id: "resources/123"; readonly _type: "application/vnd.oada.service.job.1+json"; readonly _meta: { readonly _id: "resources/123/_meta"; readonly _rev: 3; }; readonly _rev: 3; readonly service: "shares"; readonly type: "trading-partner"; readonly config: { readonly resource: { readonly _id: "resources/TESTCOI1"; }; readonly 'trading-partner': { readonly _id: "resources/1b0yRTKhv21Rkbkt32PSokJOOrs_TP_LEGACYFARM"; }; readonly path: "/bookmarks/trellisfw/trading-partners/1b0yRTKhv21Rkbkt32PSokJOOrs_TP_LEGACYFARM/bookmarks/trellisfw/cois"; }; readonly status: "pending"; readonly updates: { readonly '1bF4ELuQwqU3CjDOsn2NF0d7Deu': { readonly status: "started"; readonly time: "2018-11-14T20:20:39+00:00"; }; readonly '1bF4GjXWJvj6FJEXCiAj8DatQTD': { readonly status: "pending"; readonly time: "2018-11-13T20:20:39+00:00"; readonly information: "Share requires manual approval"; }; }; }, { readonly _id: "resources/123"; readonly _type: "application/vnd.oada.service.job.1+json"; readonly _meta: { readonly _id: "resources/123/_meta"; readonly _rev: 3; }; readonly _rev: 3; readonly service: "shares"; readonly type: "trading-partner"; readonly config: { readonly resource: { readonly _id: "resources/TESTCOI1"; }; readonly 'trading-partner': { readonly _id: "resources/1b0yRTKhv21Rkbkt32PSokJOOrs_TP_LEGACYFARM"; }; readonly path: "/bookmarks/trellisfw/trading-partners/1b0yRTKhv21Rkbkt32PSokJOOrs_TP_LEGACYFARM/bookmarks/trellisfw/cois"; }; readonly status: "success"; readonly results: { readonly path: "/bookmarks/new/path"; }; readonly updates: { readonly '1bWH1wv07R4XEhwyK2T3wJ2kLMo': { readonly status: "success"; readonly time: "2018-11-15T20:20:39+00:00"; readonly information: { readonly approved: "john"; }; }; readonly '1bF4ELuQwqU3CjDOsn2NF0d7Deu': { readonly status: "started"; readonly time: "2018-11-14T20:20:39+00:00"; }; readonly '1bF4GjXWJvj6FJEXCiAj8DatQTD': { readonly status: "pending"; readonly time: "2018-11-13T20:20:39+00:00"; readonly information: "Share requires manual approval"; }; }; }]; }; /** * Returns true if `val` is a @type `JobSchema`, false otherwise */ export declare function is(val: unknown): val is JobSchema; /** * Asserts that `val` is a @type `JobSchema` */ export declare function assert(val: unknown): asserts val is JobSchema; /** * The format for an @oada/jobs job queue job. * @example * ```json * { * "_id": "resources/123", * "_type": "application/vnd.oada.service.job.1+json", * "_meta": { * "_id": "resources/123/_meta", * "_rev": 3 * }, * "_rev": 3, * "service": "shares", * "type": "trading-partner", * "config": { * "resource": { * "_id": "resources/TESTCOI1" * }, * "trading-partner": { * "_id": "resources/1b0yRTKhv21Rkbkt32PSokJOOrs_TP_LEGACYFARM" * }, * "path": "/bookmarks/trellisfw/trading-partners/1b0yRTKhv21Rkbkt32PSokJOOrs_TP_LEGACYFARM/bookmarks/trellisfw/cois" * }, * "status": "pending", * "updates": { * "1bF4ELuQwqU3CjDOsn2NF0d7Deu": { * "status": "started", * "time": "2018-11-14T20:20:39+00:00" * }, * "1bF4GjXWJvj6FJEXCiAj8DatQTD": { * "status": "pending", * "time": "2018-11-13T20:20:39+00:00", * "information": "Share requires manual approval" * } * } * } * ``` * * @example * ```json * { * "_id": "resources/123", * "_type": "application/vnd.oada.service.job.1+json", * "_meta": { * "_id": "resources/123/_meta", * "_rev": 3 * }, * "_rev": 3, * "service": "shares", * "type": "trading-partner", * "config": { * "resource": { * "_id": "resources/TESTCOI1" * }, * "trading-partner": { * "_id": "resources/1b0yRTKhv21Rkbkt32PSokJOOrs_TP_LEGACYFARM" * }, * "path": "/bookmarks/trellisfw/trading-partners/1b0yRTKhv21Rkbkt32PSokJOOrs_TP_LEGACYFARM/bookmarks/trellisfw/cois" * }, * "status": "success", * "results": { * "path": "/bookmarks/new/path" * }, * "updates": { * "1bWH1wv07R4XEhwyK2T3wJ2kLMo": { * "status": "success", * "time": "2018-11-15T20:20:39+00:00", * "information": { * "approved": "john" * } * }, * "1bF4ELuQwqU3CjDOsn2NF0d7Deu": { * "status": "started", * "time": "2018-11-14T20:20:39+00:00" * }, * "1bF4GjXWJvj6FJEXCiAj8DatQTD": { * "status": "pending", * "time": "2018-11-13T20:20:39+00:00", * "information": "Share requires manual approval" * } * } * } * ``` * */ export default JobSchema; /** * The format for an @oada/jobs job queue job. */ export interface JobSchema { /** * Service name which job is for */ service: string; /** * Service specific identifier of job type */ type: string; /** * Job specific configuration object */ config?: { [k: string]: unknown; }; /** * Final result of job */ result?: { [k: string]: unknown; }; /** * Current status of job */ status?: string; /** * A list of updates as job progresses. Keys shall be sorted in time order. */ updates?: { [k: string]: HttpsFormatsOpenagIoOadaServiceJobUpdateSchemaJson; }; [k: string]: unknown; } /** * A list of updates as job progresses. Keys shall be sorted in time order. */ export interface HttpsFormatsOpenagIoOadaServiceJobUpdateSchemaJson { /** * Status of job at the time of update */ status: string; /** * ISO8601 UTC date-time of update time */ time: string; /** * Additional meta data about the status update */ meta?: { [k: string]: unknown; }; [k: string]: unknown; }