/** * Wrapper type for any version of an OADA change document. * @example * ```json * { * "body": { * "test": "abc", * "_rev": 1 * }, * "type": "merge" * } * ``` * * @example * ```json * [ * { * "resource_id": "resources/default:resources_bookmarks_123", * "path": "", * "body": { * "rocks": { * "_rev": 1 * }, * "_rev": 1 * }, * "type": "merge" * }, * { * "resource_id": "resources/default:resources_rocks_123", * "path": "/rocks", * "body": { * "test": "abc", * "_rev": 1 * }, * "type": "merge" * } * ] * ``` * * * File automatically generated using json-schema-to-typescript. * ! DO NOT MODIFY IT BY HAND ! * Instead, modify the source file ./oada/change.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/change.schema.json} */ export declare const $id = "https://formats.openag.io/oada/change.schema.json"; /** * JSON Schema used to generate this type * @see {@link https://formats.openag.io/oada/change.schema.json} */ export declare const schema: { readonly $id: "https://formats.openag.io/oada/change.schema.json"; readonly $schema: "http://json-schema.org/draft-07/schema#"; readonly description: "Wrapper type for any version of an OADA change document."; readonly oneOf: readonly [{ readonly $ref: "./change/v1.schema.json"; }, { readonly $ref: "./change/v2.schema.json"; }]; readonly examples: readonly [{ readonly body: { readonly test: "abc"; readonly _rev: 1; }; readonly type: "merge"; }, readonly [{ readonly resource_id: "resources/default:resources_bookmarks_123"; readonly path: ""; readonly body: { readonly rocks: { readonly _rev: 1; }; readonly _rev: 1; }; readonly type: "merge"; }, { readonly resource_id: "resources/default:resources_rocks_123"; readonly path: "/rocks"; readonly body: { readonly test: "abc"; readonly _rev: 1; }; readonly type: "merge"; }]]; }; /** * Returns true if `val` is a @type `ChangeSchema`, false otherwise */ export declare function is(val: unknown): val is ChangeSchema; /** * Asserts that `val` is a @type `ChangeSchema` */ export declare function assert(val: unknown): asserts val is ChangeSchema; /** * Wrapper type for any version of an OADA change document. * @example * ```json * { * "body": { * "test": "abc", * "_rev": 1 * }, * "type": "merge" * } * ``` * * @example * ```json * [ * { * "resource_id": "resources/default:resources_bookmarks_123", * "path": "", * "body": { * "rocks": { * "_rev": 1 * }, * "_rev": 1 * }, * "type": "merge" * }, * { * "resource_id": "resources/default:resources_rocks_123", * "path": "/rocks", * "body": { * "test": "abc", * "_rev": 1 * }, * "type": "merge" * } * ] * ``` * */ export default ChangeSchema; /** * Wrapper type for any version of an OADA change document. */ export type ChangeSchema = HttpsFormatsOpenagIoOadaChangeV1SchemaJson | ArrayBasedChangeRepresentationOADAV2; /** * Array of the changes to this resource and its ancestor changes to descendant resources */ export type ArrayBasedChangeRepresentationOADAV2 = ({ /** * Indicates the type of change that occurred. */ type: 'merge' | 'delete'; /** * JSON Pointer to the descendant of this resource which changed (or "" for this resource) */ path: string; /** * The `_id` of the resource which actually changed */ resource_id: string; [k: string]: unknown; } & ({ /** * The contents of what changed */ body: { /** * _rev is the revision for a resource in the OADA API. */ _rev: number; [k: string]: unknown; }; [k: string]: unknown; } | { type: 'delete'; body: null; [k: string]: unknown; }))[]; /** * Tree-based change representation (OADA v1) */ export interface HttpsFormatsOpenagIoOadaChangeV1SchemaJson { /** * Indicates the type of change that occurred. * * This interface was referenced by `HttpsFormatsOpenagIoOadaChangeV1SchemaJson`'s JSON-Schema * via the `definition` "type". */ type: 'merge' | 'delete'; /** * The contents of what was changed. */ body: { [k: string]: unknown; }; [k: string]: unknown; }