import { ServiceType } from "@protobuf-ts/runtime-rpc"; import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; import type { IBinaryWriter } from "@protobuf-ts/runtime"; import type { BinaryReadOptions } from "@protobuf-ts/runtime"; import type { IBinaryReader } from "@protobuf-ts/runtime"; import type { PartialMessage } from "@protobuf-ts/runtime"; import { MessageType } from "@protobuf-ts/runtime"; import { Struct } from "../../../google/protobuf/struct.js"; import { RelationshipUpdate } from "./core.js"; import { RelationshipFilter } from "./permission_service.js"; import { ZedToken } from "./core.js"; /** * WatchRequest specifies what mutations to watch for, and an optional start point for when to start * watching. * * @generated from protobuf message authzed.api.v1.WatchRequest */ export interface WatchRequest { /** * optional_object_types is a filter of resource object types to watch for relationship changes. * If specified, only changes to the specified object types will be returned and * optional_relationship_filters cannot be used. * * @generated from protobuf field: repeated string optional_object_types = 1; */ optionalObjectTypes: string[]; /** * optional_start_cursor is the ZedToken holding the point-in-time at * which to start watching for changes. * If not specified, the watch will start from the current SpiceDB revision time of the request ("head revision"). * Note that if this cursor references a point-in-time containing data * that has been garbage collected, an error will be returned. * * @generated from protobuf field: authzed.api.v1.ZedToken optional_start_cursor = 2; */ optionalStartCursor?: ZedToken; /** * optional_relationship_filters, if specified, indicates the * filter(s) to apply to each relationship to be returned by watch. * The relationship will be returned as long as at least one filter matches, * this allows clients to match relationships on multiple filters on a single watch call. * If specified, optional_object_types cannot be used. * * @generated from protobuf field: repeated authzed.api.v1.RelationshipFilter optional_relationship_filters = 3; */ optionalRelationshipFilters: RelationshipFilter[]; /** * optional_update_kinds, if specified, indicates what kinds of mutations to include. * If your SpiceDB instance is running behind a proxy that aborts idle connections, * we recommend including Checkpoints to keep the stream alive even when there are no changes. * * @generated from protobuf field: repeated authzed.api.v1.WatchKind optional_update_kinds = 4; */ optionalUpdateKinds: WatchKind[]; } /** * WatchResponse contains all mutation events in ascending timestamp order. * This excludes relationships that were deleted because they expired. * The response includes a field that can be used to resume * watching from that point. * * @generated from protobuf message authzed.api.v1.WatchResponse */ export interface WatchResponse { /** * updates are the RelationshipUpdate events that have occurred since the * call was made, or since the point in time specified by changes_through. * * @generated from protobuf field: repeated authzed.api.v1.RelationshipUpdate updates = 1; */ updates: RelationshipUpdate[]; /** * changes_through is the ZedToken that represents the point in time * that the watch response is current through. This token can be used * in a subsequent WatchRequest to resume watching from this point. * * @generated from protobuf field: authzed.api.v1.ZedToken changes_through = 2; */ changesThrough?: ZedToken; /** * optional_transaction_metadata is an optional field that returns the transaction metadata * given to SpiceDB during the transaction that produced the changes in this response. * This field may not exist if no transaction metadata was provided, or if multiple pieces * of metadata were found during the transaction (in which case it is ambiguous which to return). * * @generated from protobuf field: google.protobuf.Struct optional_transaction_metadata = 3; */ optionalTransactionMetadata?: Struct; /** * schema_updated, if true, indicates that the schema was changed in this revision. * * @generated from protobuf field: bool schema_updated = 4; */ schemaUpdated: boolean; /** * is_checkpoint, if true, indicates that a checkpoint was reached. * A checkpoint indicates that the server guarantees that the client * will not observe any changes at a revision below or equal to the revision in this response. * * @generated from protobuf field: bool is_checkpoint = 5; */ isCheckpoint: boolean; /** * full_revision_metadata contains all transaction metadata given to SpiceDB during the * revision that produced the changes in this response. Some datastores (such as CockroachDB) * can "merge" multiple transactions into a single revision (if the changes occurred concurrently), * so this field is a list of all transaction metadata seen during the revision. * * @generated from protobuf field: repeated google.protobuf.Struct full_revision_metadata = 6; */ fullRevisionMetadata: Struct[]; } /** * @generated from protobuf enum authzed.api.v1.WatchKind */ export declare enum WatchKind { /** * Default, just relationship updates (for backwards compatibility) * * @generated from protobuf enum value: WATCH_KIND_UNSPECIFIED = 0; */ UNSPECIFIED = 0, /** * @generated from protobuf enum value: WATCH_KIND_INCLUDE_RELATIONSHIP_UPDATES = 1; */ INCLUDE_RELATIONSHIP_UPDATES = 1, /** * @generated from protobuf enum value: WATCH_KIND_INCLUDE_SCHEMA_UPDATES = 2; */ INCLUDE_SCHEMA_UPDATES = 2, /** * @generated from protobuf enum value: WATCH_KIND_INCLUDE_CHECKPOINTS = 3; */ INCLUDE_CHECKPOINTS = 3 } declare class WatchRequest$Type extends MessageType { constructor(); create(value?: PartialMessage): WatchRequest; internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: WatchRequest): WatchRequest; internalBinaryWrite(message: WatchRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; } /** * @generated MessageType for protobuf message authzed.api.v1.WatchRequest */ export declare const WatchRequest: WatchRequest$Type; declare class WatchResponse$Type extends MessageType { constructor(); create(value?: PartialMessage): WatchResponse; internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: WatchResponse): WatchResponse; internalBinaryWrite(message: WatchResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; } /** * @generated MessageType for protobuf message authzed.api.v1.WatchResponse */ export declare const WatchResponse: WatchResponse$Type; /** * @generated ServiceType for protobuf service authzed.api.v1.WatchService */ export declare const WatchService: ServiceType; export {};