/** * This is the format of an OADA websocket request (client to server) * * * File automatically generated using json-schema-to-typescript. * ! DO NOT MODIFY IT BY HAND ! * Instead, modify the source file ./oada/websockets/request.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/request.schema.json} */ export declare const $id = "https://formats.openag.io/oada/websockets/request.schema.json"; /** * JSON Schema used to generate this type * @see {@link https://formats.openag.io/oada/websockets/request.schema.json} */ export declare const schema: { readonly $id: "https://formats.openag.io/oada/websockets/request.schema.json"; readonly $schema: "http://json-schema.org/draft-07/schema#"; readonly description: "This is the format of an OADA websocket request (client to server)"; readonly definitions: { readonly id: { readonly type: "string"; }; }; readonly type: "object"; readonly required: readonly ["requestId", "path", "method", "headers"]; readonly properties: { readonly requestId: { readonly $ref: "#/definitions/id"; }; readonly path: { readonly $ref: "../../oada.schema.json#/definitions/path"; }; readonly method: { readonly anyOf: readonly [{ readonly $comment: "Standard HTTP methods"; readonly $ref: "../../oada.schema.json#/definitions/method"; }, { readonly $comment: "WebSocket only methods"; readonly enum: readonly ["watch", "head-watch", "get-watch", "put-watch", "post-watch", "delete-watch", "unwatch", "ping"]; }]; }; readonly headers: { readonly type: "object"; readonly required: readonly ["authorization"]; readonly properties: { readonly authorization: { readonly type: "string"; }; }; }; readonly data: { readonly description: "The optional data payload of the request"; }; }; }; /** * Returns true if `val` is a @type `RequestSchema`, false otherwise */ export declare function is(val: unknown): val is RequestSchema; /** * Asserts that `val` is a @type `RequestSchema` */ export declare function assert(val: unknown): asserts val is RequestSchema; /** * This is the format of an OADA websocket request (client to server) * */ export default RequestSchema; /** * This interface was referenced by `RequestSchema`'s JSON-Schema * via the `definition` "id". */ export type Id = string; /** * This is the format of an OADA websocket request (client to server) */ export interface RequestSchema { requestId: Id; /** * The representation of a path within an OADA server */ path: string; method: ('head' | 'get' | 'put' | 'post' | 'delete') | ('watch' | 'head-watch' | 'get-watch' | 'put-watch' | 'post-watch' | 'delete-watch' | 'unwatch' | 'ping'); headers: { authorization: string; [k: string]: unknown; }; /** * The optional data payload of the request */ data?: { [k: string]: unknown; }; [k: string]: unknown; }