/** * The format for ainz orchestation rules * @example * ```json * { * "type": "reindex", * "list": "/bookmarks/stuff", * "schema": { * "const": { * "foo": "bar" * } * }, * "destination": "/bookmarks/foo" * } * ``` * * @example * ```json * { * "type": "job", * "list": "/bookmarks/stuff", * "schema": { * "const": { * "foo": "bar" * } * }, * "pointer": "/resource", * "job": { * "service": "coolservice", * "type": "cool", * "config": { * "foo": "bar" * } * } * } * ``` * * * File automatically generated using json-schema-to-typescript. * ! DO NOT MODIFY IT BY HAND ! * Instead, modify the source file ./oada/ainz/rule.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/ainz/rule.schema.json} */ export declare const $id = "https://formats.openag.io/oada/ainz/rule.schema.json"; /** * JSON Schema used to generate this type * @see {@link https://formats.openag.io/oada/ainz/rule.schema.json} */ export declare const schema: { readonly $id: "https://formats.openag.io/oada/ainz/rule.schema.json"; readonly $schema: "http://json-schema.org/draft-07/schema#"; readonly description: "The format for ainz orchestation rules"; readonly type: "object"; readonly properties: { readonly type: { readonly description: "A field for discriminating the different types of rules"; }; readonly list: { readonly description: "A path to an OADA list to watch for changes"; readonly $ref: "../../oada.schema.json#/definitions/path"; }; readonly schema: { readonly description: "A JSON Schema to which to compare new items in list"; readonly $ref: "https://json-schema.org/draft/2019-09/schema"; }; }; readonly oneOf: readonly [{ readonly description: "A rule which \"moves\" (re-indexes) a resource"; readonly type: "object"; readonly properties: { readonly type: { readonly enum: readonly ["reindex"]; }; readonly destination: { readonly description: "A path to an OADA list to which to add maching items"; readonly type: "string"; }; readonly tree: { readonly description: "A tree to use for \"tree PUTs\""; readonly type: "object"; readonly $comment: "Recursive schema breaks schema to TS compiler"; }; readonly itemsPath: { readonly description: "A JSONPath for resolving the items of an indexed list"; readonly type: "string"; readonly examples: readonly ["$.day-index.*.*"]; readonly default: "$.*"; }; readonly meta: { readonly description: "An object to PUT on matching items's _meta"; readonly type: "object"; }; }; }, { readonly description: "A rule which creates an OADA job when a resource matches"; readonly type: "object"; readonly properties: { readonly type: { readonly enum: readonly ["job"]; }; readonly pointer: { readonly description: "A JSON pointer of where in the job config to create a link to the resource"; readonly type: "string"; readonly format: "json-pointer"; }; readonly job: { readonly description: "The job to create. A link to the matching resource will be added to the job."; readonly $ref: "../service/job.schema.json#"; }; }; }]; readonly required: readonly ["type", "list", "schema"]; readonly examples: readonly [{ readonly type: "reindex"; readonly list: "/bookmarks/stuff"; readonly schema: { readonly const: { readonly foo: "bar"; }; }; readonly destination: "/bookmarks/foo"; }, { readonly type: "job"; readonly list: "/bookmarks/stuff"; readonly schema: { readonly const: { readonly foo: "bar"; }; }; readonly pointer: "/resource"; readonly job: { readonly service: "coolservice"; readonly type: "cool"; readonly config: { readonly foo: "bar"; }; }; }]; }; /** * Returns true if `val` is a @type `RuleSchema`, false otherwise */ export declare function is(val: unknown): val is RuleSchema; /** * Asserts that `val` is a @type `RuleSchema` */ export declare function assert(val: unknown): asserts val is RuleSchema; /** * The format for ainz orchestation rules * @example * ```json * { * "type": "reindex", * "list": "/bookmarks/stuff", * "schema": { * "const": { * "foo": "bar" * } * }, * "destination": "/bookmarks/foo" * } * ``` * * @example * ```json * { * "type": "job", * "list": "/bookmarks/stuff", * "schema": { * "const": { * "foo": "bar" * } * }, * "pointer": "/resource", * "job": { * "service": "coolservice", * "type": "cool", * "config": { * "foo": "bar" * } * } * } * ``` * */ export default RuleSchema; /** * The format for ainz orchestation rules */ export type RuleSchema = { /** * A field for discriminating the different types of rules */ type: { [k: string]: unknown; }; /** * A path to an OADA list to watch for changes */ list: string; schema: CoreAndValidationSpecificationsMetaSchema; [k: string]: unknown; } & ({ type?: 'reindex'; /** * A path to an OADA list to which to add maching items */ destination?: string; /** * A tree to use for "tree PUTs" */ tree?: { [k: string]: unknown; }; /** * A JSONPath for resolving the items of an indexed list */ itemsPath?: string; /** * An object to PUT on matching items's _meta */ meta?: { [k: string]: unknown; }; [k: string]: unknown; } | { type?: 'job'; /** * A JSON pointer of where in the job config to create a link to the resource */ pointer?: string; job?: HttpsFormatsOpenagIoOadaServiceJobSchemaJson; [k: string]: unknown; }); /** * A JSON Schema to which to compare new items in list */ export type CoreAndValidationSpecificationsMetaSchema = CoreVocabularyMetaSchema & ApplicatorVocabularyMetaSchema & ValidationVocabularyMetaSchema & MetaDataVocabularyMetaSchema & FormatVocabularyMetaSchema & ContentVocabularyMetaSchema & { definitions?: { [k: string]: { [k: string]: unknown; }; }; dependencies?: { [k: string]: { [k: string]: unknown; } | string[]; }; [k: string]: unknown; } & ({ definitions?: { [k: string]: { [k: string]: unknown; }; }; dependencies?: { [k: string]: { [k: string]: unknown; } | string[]; }; [k: string]: unknown; } | boolean); export type CoreVocabularyMetaSchema = { $id?: string; $schema?: string; $anchor?: string; $ref?: string; $recursiveRef?: string; $recursiveAnchor?: boolean; $vocabulary?: { [k: string]: boolean; }; $comment?: string; $defs?: { [k: string]: { [k: string]: unknown; }; }; [k: string]: unknown; } & ({ $id?: string; $schema?: string; $anchor?: string; $ref?: string; $recursiveRef?: string; $recursiveAnchor?: boolean; $vocabulary?: { [k: string]: boolean; }; $comment?: string; $defs?: { [k: string]: { [k: string]: unknown; }; }; [k: string]: unknown; } | boolean); export type ApplicatorVocabularyMetaSchema = { additionalItems?: { [k: string]: unknown; }; unevaluatedItems?: { [k: string]: unknown; }; items?: { [k: string]: unknown; } | SchemaArray; contains?: { [k: string]: unknown; }; additionalProperties?: { [k: string]: unknown; }; unevaluatedProperties?: { [k: string]: unknown; }; properties?: { [k: string]: { [k: string]: unknown; }; }; patternProperties?: { [k: string]: { [k: string]: unknown; }; }; dependentSchemas?: { [k: string]: { [k: string]: unknown; }; }; propertyNames?: { [k: string]: unknown; }; if?: { [k: string]: unknown; }; then?: { [k: string]: unknown; }; else?: { [k: string]: unknown; }; allOf?: SchemaArray; anyOf?: SchemaArray; oneOf?: SchemaArray; not?: { [k: string]: unknown; }; [k: string]: unknown; } & ({ additionalItems?: { [k: string]: unknown; }; unevaluatedItems?: { [k: string]: unknown; }; items?: { [k: string]: unknown; } | SchemaArray; contains?: { [k: string]: unknown; }; additionalProperties?: { [k: string]: unknown; }; unevaluatedProperties?: { [k: string]: unknown; }; properties?: { [k: string]: { [k: string]: unknown; }; }; patternProperties?: { [k: string]: { [k: string]: unknown; }; }; dependentSchemas?: { [k: string]: { [k: string]: unknown; }; }; propertyNames?: { [k: string]: unknown; }; if?: { [k: string]: unknown; }; then?: { [k: string]: unknown; }; else?: { [k: string]: unknown; }; allOf?: SchemaArray; anyOf?: SchemaArray; oneOf?: SchemaArray; not?: { [k: string]: unknown; }; [k: string]: unknown; } | boolean); /** * @minItems 1 * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "schemaArray". * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "schemaArray". */ export type SchemaArray = [ { [k: string]: unknown; }, ...{ [k: string]: unknown; }[] ]; export type ValidationVocabularyMetaSchema = { multipleOf?: number; maximum?: number; exclusiveMaximum?: number; minimum?: number; exclusiveMinimum?: number; /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "nonNegativeInteger". * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "nonNegativeInteger". */ maxLength?: number; minLength?: number; pattern?: string; /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "nonNegativeInteger". * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "nonNegativeInteger". */ maxItems?: number; minItems?: number; uniqueItems?: boolean; /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "nonNegativeInteger". * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "nonNegativeInteger". */ maxContains?: number; minContains?: number; /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "nonNegativeInteger". * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "nonNegativeInteger". */ maxProperties?: number; minProperties?: number; /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "stringArray". * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "stringArray". */ required?: string[]; dependentRequired?: { /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "stringArray". * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "stringArray". */ [k: string]: string[]; }; const?: unknown; enum?: unknown[]; type?: ('array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string') | [ 'array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string', ...('array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string')[] ]; [k: string]: unknown; } & ({ multipleOf?: number; maximum?: number; exclusiveMaximum?: number; minimum?: number; exclusiveMinimum?: number; /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "nonNegativeInteger". * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "nonNegativeInteger". */ maxLength?: number; minLength?: number; pattern?: string; /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "nonNegativeInteger". * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "nonNegativeInteger". */ maxItems?: number; minItems?: number; uniqueItems?: boolean; /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "nonNegativeInteger". * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "nonNegativeInteger". */ maxContains?: number; minContains?: number; /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "nonNegativeInteger". * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "nonNegativeInteger". */ maxProperties?: number; minProperties?: number; /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "stringArray". * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "stringArray". */ required?: string[]; dependentRequired?: { /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "stringArray". * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "stringArray". */ [k: string]: string[]; }; const?: unknown; enum?: unknown[]; type?: ('array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string') | [ 'array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string', ...('array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string')[] ]; [k: string]: unknown; } | boolean); export type MetaDataVocabularyMetaSchema = { title?: string; description?: string; default?: unknown; deprecated?: boolean; readOnly?: boolean; writeOnly?: boolean; examples?: unknown[]; [k: string]: unknown; } & ({ title?: string; description?: string; default?: unknown; deprecated?: boolean; readOnly?: boolean; writeOnly?: boolean; examples?: unknown[]; [k: string]: unknown; } | boolean); export type FormatVocabularyMetaSchema = { format?: string; [k: string]: unknown; } & ({ format?: string; [k: string]: unknown; } | boolean); export type ContentVocabularyMetaSchema = { contentMediaType?: string; contentEncoding?: string; contentSchema?: { [k: string]: unknown; }; [k: string]: unknown; } & ({ contentMediaType?: string; contentEncoding?: string; contentSchema?: { [k: string]: unknown; }; [k: string]: unknown; } | boolean); /** * The job to create. A link to the matching resource will be added to the job. */ export interface HttpsFormatsOpenagIoOadaServiceJobSchemaJson { /** * 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; }