/** * A description of a condtion which can be used in OADA rules * * * File automatically generated using json-schema-to-typescript. * ! DO NOT MODIFY IT BY HAND ! * Instead, modify the source file ./trellis/rules/condition.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/trellis/rules/condition.schema.json} */ export declare const $id = "https://formats.openag.io/trellis/rules/condition.schema.json"; /** * JSON Schema used to generate this type * @see {@link https://formats.openag.io/trellis/rules/condition.schema.json} */ export declare const schema: { readonly $id: "https://formats.openag.io/trellis/rules/condition.schema.json"; readonly $schema: "http://json-schema.org/draft-07/schema#"; readonly description: "A description of a condtion which can be used in OADA rules"; readonly allOf: readonly [{ readonly $ref: "../../oada/resource.schema.json"; }]; readonly properties: { readonly name: { readonly description: "Name of the condition"; readonly type: "string"; readonly examples: readonly ["signature_valid"]; }; readonly service: { readonly description: "Name of the service implementing/performing the condition"; readonly type: "string"; readonly $comment: "service conditions not yet implemented"; }; readonly schema: { readonly description: "A JSON Schema to which implements this condition"; readonly $ref: "https://json-schema.org/draft/2019-09/schema"; }; readonly type: { readonly description: "Content-type(s) with which this condition works"; readonly oneOf: readonly [{ readonly type: "string"; }, { readonly type: "array"; readonly items: { readonly type: "string"; }; }]; }; readonly description: { readonly description: "Human description of the condition for UI etc."; readonly type: "string"; readonly examples: readonly ["has a valid signature"]; }; readonly uischema: { readonly description: "UISchema for the params"; readonly $comment: "Not sure this is a good idea"; readonly type: "object"; }; readonly params: { readonly description: "Input parameters for the condition"; readonly $ref: "https://json-schema.org/draft/2019-09/schema"; }; readonly pointers: { readonly description: "A map for applying params to schema."; readonly type: "object"; readonly $comment: "Is there a way to specify the keys are JSON pointers?"; readonly additionalProperties: { readonly type: "object"; readonly required: readonly ["name", "iskey"]; readonly properties: { readonly name: { readonly description: "Name of the input to apply at this path."; readonly type: "string"; }; readonly iskey: { readonly description: "Wether to replace the key or the value."; readonly type: "boolean"; }; }; }; readonly examples: readonly [{ readonly '/a/b/c': { readonly name: "s1"; readonly iskey: true; }; readonly '/d/e': { readonly name: "s2"; readonly iskey: false; }; }]; }; }; readonly required: readonly ["name", "type", "description"]; }; /** * Returns true if `val` is a @type `ConditionSchema`, false otherwise */ export declare function is(val: unknown): val is ConditionSchema; /** * Asserts that `val` is a @type `ConditionSchema` */ export declare function assert(val: unknown): asserts val is ConditionSchema; /** * A description of a condtion which can be used in OADA rules * */ export default ConditionSchema; /** * A description of a condtion which can be used in OADA rules */ export type ConditionSchema = OADAResource & { /** * Name of the condition */ name: string; /** * Name of the service implementing/performing the condition */ service?: string; schema?: CoreAndValidationSpecificationsMetaSchema; /** * Content-type(s) with which this condition works */ type: string | string[]; /** * Human description of the condition for UI etc. */ description: string; /** * UISchema for the params */ uischema?: { [k: string]: unknown; }; params?: CoreAndValidationSpecificationsMetaSchema1; /** * A map for applying params to schema. */ pointers?: { [k: string]: { /** * Name of the input to apply at this path. */ name: string; /** * Wether to replace the key or the value. */ iskey: boolean; [k: string]: unknown; }; }; [k: string]: unknown; }; /** * A JSON Schema to which implements this condition */ 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); /** * Input parameters for the condition */ export type CoreAndValidationSpecificationsMetaSchema1 = 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 interface OADAResource { /** * _id identifies a resource in the OADA API. */ _id: string; /** * _rev is the revision for a resource in the OADA API. */ _rev: number; _meta: Versioned; /** * _type identifies the content-type of a resource in the OADA API. */ _type: string; [k: string]: unknown; } export interface Versioned { /** * _rev is the revision for a resource in the OADA API. */ _rev: number; /** * _id identifies a resource in the OADA API. */ _id?: string; /** * _type identifies the content-type of a resource in the OADA API. */ _type?: string; }