/** * This is the format of an OADA websocket response (server to client) * * * File automatically generated using json-schema-to-typescript. * ! DO NOT MODIFY IT BY HAND ! * Instead, modify the source file ./oada/websockets/response.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/websockets/response.schema.json} */ export declare const $id = "https://formats.openag.io/oada/websockets/response.schema.json"; /** * JSON Schema used to generate this type * @see {@link https://formats.openag.io/oada/websockets/response.schema.json} */ export declare const schema: { readonly $id: "https://formats.openag.io/oada/websockets/response.schema.json"; readonly $schema: "http://json-schema.org/draft-07/schema#"; readonly description: "This is the format of an OADA websocket response (server to client)"; readonly definitions: { readonly id: { readonly $ref: "request.schema.json#/properties/requestId"; }; }; readonly type: "object"; readonly required: readonly ["requestId", "status"]; readonly properties: { readonly requestId: { readonly description: "Array of request IDs to which this response pertains. A single string is supported only for legacy purposes."; readonly anyOf: readonly [{ readonly type: "array"; readonly minItems: 1; readonly items: { readonly $ref: "#/definitions/id"; }; }, { readonly $ref: "#/definitions/id"; }]; }; readonly status: { readonly type: "integer"; }; readonly statusText: { readonly type: "string"; }; readonly headers: { readonly type: "object"; readonly additionalProperties: { readonly type: "string"; }; }; readonly resourceId: { readonly $ref: "../../oada.schema.json#/definitions/_id"; }; readonly resource: { readonly $comment: "Not sure if this is always actually a resource..."; }; readonly data: { readonly description: "The optional data payload of the request"; }; }; }; /** * Returns true if `val` is a @type `ResponseSchema`, false otherwise */ export declare function is(val: unknown): val is ResponseSchema; /** * Asserts that `val` is a @type `ResponseSchema` */ export declare function assert(val: unknown): asserts val is ResponseSchema; /** * This is the format of an OADA websocket response (server to client) * */ export default ResponseSchema; /** * This interface was referenced by `ResponseSchema`'s JSON-Schema * via the `definition` "id". */ export type Id = string; /** * This is the format of an OADA websocket response (server to client) */ export interface ResponseSchema { /** * Array of request IDs to which this response pertains. A single string is supported only for legacy purposes. */ requestId: [Id, ...Id[]] | Id; status: number; statusText?: string; headers?: { [k: string]: string; }; /** * _id identifies a resource in the OADA API. */ resourceId?: string; resource?: { [k: string]: unknown; }; /** * The optional data payload of the request */ data?: { [k: string]: unknown; }; [k: string]: unknown; }