@mochabug/adapt-plugin-toolkit
Version:
The API toolkit to facilitate mochabug adapt plugin development
872 lines • 23.3 kB
TypeScript
import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
import type { Timestamp, TimestampJson } from "@bufbuild/protobuf/wkt";
import type { Message } from "@bufbuild/protobuf";
/**
* Describes the file mochabugapis/adapt/runtime/v1/store.proto.
*/
export declare const file_mochabugapis_adapt_runtime_v1_store: GenFile;
/**
* This represents a value to be stored
*
* @generated from message mochabugapis.adapt.runtime.v1.PutValue
*/
export type PutValue = Message<"mochabugapis.adapt.runtime.v1.PutValue"> & {
/**
* Data
*
* @generated from field: bytes value = 1;
*/
value: Uint8Array;
/**
* TTL seconds (0 = no expiration)
*
* @generated from field: int32 ttl = 2;
*/
ttl: number;
};
/**
* This represents a value to be stored
*
* @generated from message mochabugapis.adapt.runtime.v1.PutValue
*/
export type PutValueJson = {
/**
* Data
*
* @generated from field: bytes value = 1;
*/
value?: string;
/**
* TTL seconds (0 = no expiration)
*
* @generated from field: int32 ttl = 2;
*/
ttl?: number;
};
/**
* Describes the message mochabugapis.adapt.runtime.v1.PutValue.
* Use `create(PutValueSchema)` to create a new message.
*/
export declare const PutValueSchema: GenMessage<PutValue, {
jsonType: PutValueJson;
}>;
/**
* Retrieved value
*
* @generated from message mochabugapis.adapt.runtime.v1.GetValue
*/
export type GetValue = Message<"mochabugapis.adapt.runtime.v1.GetValue"> & {
/**
* Data
*
* @generated from field: bytes value = 1;
*/
value: Uint8Array;
/**
* The metadata for the written value
*
* @generated from field: mochabugapis.adapt.runtime.v1.ValueMetadata metadata = 2;
*/
metadata?: ValueMetadata;
};
/**
* Retrieved value
*
* @generated from message mochabugapis.adapt.runtime.v1.GetValue
*/
export type GetValueJson = {
/**
* Data
*
* @generated from field: bytes value = 1;
*/
value?: string;
/**
* The metadata for the written value
*
* @generated from field: mochabugapis.adapt.runtime.v1.ValueMetadata metadata = 2;
*/
metadata?: ValueMetadataJson;
};
/**
* Describes the message mochabugapis.adapt.runtime.v1.GetValue.
* Use `create(GetValueSchema)` to create a new message.
*/
export declare const GetValueSchema: GenMessage<GetValue, {
jsonType: GetValueJson;
}>;
/**
* Write metadata
*
* @generated from message mochabugapis.adapt.runtime.v1.ValueMetadata
*/
export type ValueMetadata = Message<"mochabugapis.adapt.runtime.v1.ValueMetadata"> & {
/**
* Remaining TTL seconds (0 = no expiration)
*
* @generated from field: int32 ttl = 1;
*/
ttl: number;
/**
* Last modified
*
* @generated from field: google.protobuf.Timestamp last_modified = 2;
*/
lastModified?: Timestamp;
/**
* ETag
*
* @generated from field: string etag = 3;
*/
etag: string;
};
/**
* Write metadata
*
* @generated from message mochabugapis.adapt.runtime.v1.ValueMetadata
*/
export type ValueMetadataJson = {
/**
* Remaining TTL seconds (0 = no expiration)
*
* @generated from field: int32 ttl = 1;
*/
ttl?: number;
/**
* Last modified
*
* @generated from field: google.protobuf.Timestamp last_modified = 2;
*/
lastModified?: TimestampJson;
/**
* ETag
*
* @generated from field: string etag = 3;
*/
etag?: string;
};
/**
* Describes the message mochabugapis.adapt.runtime.v1.ValueMetadata.
* Use `create(ValueMetadataSchema)` to create a new message.
*/
export declare const ValueMetadataSchema: GenMessage<ValueMetadata, {
jsonType: ValueMetadataJson;
}>;
/**
* Timestamp range
*
* @generated from message mochabugapis.adapt.runtime.v1.TimestampRange
*/
export type TimestampRange = Message<"mochabugapis.adapt.runtime.v1.TimestampRange"> & {
/**
* Start
*
* @generated from field: google.protobuf.Timestamp start = 1;
*/
start?: Timestamp;
/**
* End
*
* @generated from field: google.protobuf.Timestamp end = 2;
*/
end?: Timestamp;
/**
* Include start (>= vs >)
*
* @generated from field: bool start_inclusive = 3;
*/
startInclusive: boolean;
/**
* Include end (<= vs <)
*
* @generated from field: bool end_inclusive = 4;
*/
endInclusive: boolean;
};
/**
* Timestamp range
*
* @generated from message mochabugapis.adapt.runtime.v1.TimestampRange
*/
export type TimestampRangeJson = {
/**
* Start
*
* @generated from field: google.protobuf.Timestamp start = 1;
*/
start?: TimestampJson;
/**
* End
*
* @generated from field: google.protobuf.Timestamp end = 2;
*/
end?: TimestampJson;
/**
* Include start (>= vs >)
*
* @generated from field: bool start_inclusive = 3;
*/
startInclusive?: boolean;
/**
* Include end (<= vs <)
*
* @generated from field: bool end_inclusive = 4;
*/
endInclusive?: boolean;
};
/**
* Describes the message mochabugapis.adapt.runtime.v1.TimestampRange.
* Use `create(TimestampRangeSchema)` to create a new message.
*/
export declare const TimestampRangeSchema: GenMessage<TimestampRange, {
jsonType: TimestampRangeJson;
}>;
/**
* Range query on keys (lexicographic comparison)
* Examples: "user/" to "user/~", "logs/2024-01/" to "logs/2024-02/"
* not setting any start or end will scan the entire store
* Results are always returned in ascending order by key
*
* @generated from message mochabugapis.adapt.runtime.v1.SelectOp
*/
export type SelectOp = Message<"mochabugapis.adapt.runtime.v1.SelectOp"> & {
/**
* Not setting the start will be equivalent of fetching from the the empty key
*
* @generated from field: optional string start = 1;
*/
start?: string;
/**
* This is required to avoid unbounded queries
*
* @generated from field: optional string end = 2;
*/
end?: string;
/**
* Include start (>= vs >)
*
* @generated from field: optional bool start_inclusive = 3;
*/
startInclusive?: boolean;
/**
* Include end (<= vs <)
*
* @generated from field: optional bool end_inclusive = 4;
*/
endInclusive?: boolean;
/**
* Max results (1-1000), defaults to 100
*
* @generated from field: optional int32 limit = 5;
*/
limit?: number;
/**
* An optional page_token to continue the query
*
* @generated from field: optional string page_token = 6;
*/
pageToken?: string;
};
/**
* Range query on keys (lexicographic comparison)
* Examples: "user/" to "user/~", "logs/2024-01/" to "logs/2024-02/"
* not setting any start or end will scan the entire store
* Results are always returned in ascending order by key
*
* @generated from message mochabugapis.adapt.runtime.v1.SelectOp
*/
export type SelectOpJson = {
/**
* Not setting the start will be equivalent of fetching from the the empty key
*
* @generated from field: optional string start = 1;
*/
start?: string;
/**
* This is required to avoid unbounded queries
*
* @generated from field: optional string end = 2;
*/
end?: string;
/**
* Include start (>= vs >)
*
* @generated from field: optional bool start_inclusive = 3;
*/
startInclusive?: boolean;
/**
* Include end (<= vs <)
*
* @generated from field: optional bool end_inclusive = 4;
*/
endInclusive?: boolean;
/**
* Max results (1-1000), defaults to 100
*
* @generated from field: optional int32 limit = 5;
*/
limit?: number;
/**
* An optional page_token to continue the query
*
* @generated from field: optional string page_token = 6;
*/
pageToken?: string;
};
/**
* Describes the message mochabugapis.adapt.runtime.v1.SelectOp.
* Use `create(SelectOpSchema)` to create a new message.
*/
export declare const SelectOpSchema: GenMessage<SelectOp, {
jsonType: SelectOpJson;
}>;
/**
* Batch write (no preconditions)
* All operations in a batch share the same timestamp.
* Interfering operations on the same key have undefined order.
*
* @generated from message mochabugapis.adapt.runtime.v1.WriteOperation
*/
export type WriteOperation = Message<"mochabugapis.adapt.runtime.v1.WriteOperation"> & {
/**
* Operation
*
* @generated from oneof mochabugapis.adapt.runtime.v1.WriteOperation.operation
*/
operation: {
/**
* Insert
*
* @generated from field: mochabugapis.adapt.runtime.v1.InsertOp insert = 1;
*/
value: InsertOp;
case: "insert";
} | {
/**
* Delete
*
* @generated from field: mochabugapis.adapt.runtime.v1.DeleteOp delete = 2;
*/
value: DeleteOp;
case: "delete";
} | {
/**
* Range delete
*
* @generated from field: mochabugapis.adapt.runtime.v1.RangeDeleteOp range_delete = 3;
*/
value: RangeDeleteOp;
case: "rangeDelete";
} | {
case: undefined;
value?: undefined;
};
};
/**
* Batch write (no preconditions)
* All operations in a batch share the same timestamp.
* Interfering operations on the same key have undefined order.
*
* @generated from message mochabugapis.adapt.runtime.v1.WriteOperation
*/
export type WriteOperationJson = {
/**
* Insert
*
* @generated from field: mochabugapis.adapt.runtime.v1.InsertOp insert = 1;
*/
insert?: InsertOpJson;
/**
* Delete
*
* @generated from field: mochabugapis.adapt.runtime.v1.DeleteOp delete = 2;
*/
delete?: DeleteOpJson;
/**
* Range delete
*
* @generated from field: mochabugapis.adapt.runtime.v1.RangeDeleteOp range_delete = 3;
*/
rangeDelete?: RangeDeleteOpJson;
};
/**
* Describes the message mochabugapis.adapt.runtime.v1.WriteOperation.
* Use `create(WriteOperationSchema)` to create a new message.
*/
export declare const WriteOperationSchema: GenMessage<WriteOperation, {
jsonType: WriteOperationJson;
}>;
/**
* Single write (supports preconditions)
*
* @generated from message mochabugapis.adapt.runtime.v1.ConditionalWriteOperation
*/
export type ConditionalWriteOperation = Message<"mochabugapis.adapt.runtime.v1.ConditionalWriteOperation"> & {
/**
* Operation
*
* @generated from oneof mochabugapis.adapt.runtime.v1.ConditionalWriteOperation.operation
*/
operation: {
/**
* Insert
*
* @generated from field: mochabugapis.adapt.runtime.v1.ConditionalInsertOp insert = 1;
*/
value: ConditionalInsertOp;
case: "insert";
} | {
/**
* Delete
*
* @generated from field: mochabugapis.adapt.runtime.v1.ConditionalDeleteOp delete = 2;
*/
value: ConditionalDeleteOp;
case: "delete";
} | {
case: undefined;
value?: undefined;
};
};
/**
* Single write (supports preconditions)
*
* @generated from message mochabugapis.adapt.runtime.v1.ConditionalWriteOperation
*/
export type ConditionalWriteOperationJson = {
/**
* Insert
*
* @generated from field: mochabugapis.adapt.runtime.v1.ConditionalInsertOp insert = 1;
*/
insert?: ConditionalInsertOpJson;
/**
* Delete
*
* @generated from field: mochabugapis.adapt.runtime.v1.ConditionalDeleteOp delete = 2;
*/
delete?: ConditionalDeleteOpJson;
};
/**
* Describes the message mochabugapis.adapt.runtime.v1.ConditionalWriteOperation.
* Use `create(ConditionalWriteOperationSchema)` to create a new message.
*/
export declare const ConditionalWriteOperationSchema: GenMessage<ConditionalWriteOperation, {
jsonType: ConditionalWriteOperationJson;
}>;
/**
* Range delete, works like SelectOp for defining the range
* For example, to delete all keys with prefix "user/", set start="user/" and end="user/~"
*
* @generated from message mochabugapis.adapt.runtime.v1.RangeDeleteOp
*/
export type RangeDeleteOp = Message<"mochabugapis.adapt.runtime.v1.RangeDeleteOp"> & {
/**
* Not setting the start will be equivalent of deleting from the the empty key
*
* @generated from field: optional string start = 1;
*/
start?: string;
/**
* This is required to avoid unbounded deletes
*
* @generated from field: optional string end = 2;
*/
end?: string;
/**
* Include start (>= vs >)
*
* @generated from field: optional bool start_inclusive = 3;
*/
startInclusive?: boolean;
/**
* Include end (<= vs <)
*
* @generated from field: optional bool end_inclusive = 4;
*/
endInclusive?: boolean;
};
/**
* Range delete, works like SelectOp for defining the range
* For example, to delete all keys with prefix "user/", set start="user/" and end="user/~"
*
* @generated from message mochabugapis.adapt.runtime.v1.RangeDeleteOp
*/
export type RangeDeleteOpJson = {
/**
* Not setting the start will be equivalent of deleting from the the empty key
*
* @generated from field: optional string start = 1;
*/
start?: string;
/**
* This is required to avoid unbounded deletes
*
* @generated from field: optional string end = 2;
*/
end?: string;
/**
* Include start (>= vs >)
*
* @generated from field: optional bool start_inclusive = 3;
*/
startInclusive?: boolean;
/**
* Include end (<= vs <)
*
* @generated from field: optional bool end_inclusive = 4;
*/
endInclusive?: boolean;
};
/**
* Describes the message mochabugapis.adapt.runtime.v1.RangeDeleteOp.
* Use `create(RangeDeleteOpSchema)` to create a new message.
*/
export declare const RangeDeleteOpSchema: GenMessage<RangeDeleteOp, {
jsonType: RangeDeleteOpJson;
}>;
/**
* Insert
*
* @generated from message mochabugapis.adapt.runtime.v1.InsertOp
*/
export type InsertOp = Message<"mochabugapis.adapt.runtime.v1.InsertOp"> & {
/**
* Key
*
* @generated from field: string key = 1;
*/
key: string;
/**
* Value
*
* @generated from field: mochabugapis.adapt.runtime.v1.PutValue value = 2;
*/
value?: PutValue;
};
/**
* Insert
*
* @generated from message mochabugapis.adapt.runtime.v1.InsertOp
*/
export type InsertOpJson = {
/**
* Key
*
* @generated from field: string key = 1;
*/
key?: string;
/**
* Value
*
* @generated from field: mochabugapis.adapt.runtime.v1.PutValue value = 2;
*/
value?: PutValueJson;
};
/**
* Describes the message mochabugapis.adapt.runtime.v1.InsertOp.
* Use `create(InsertOpSchema)` to create a new message.
*/
export declare const InsertOpSchema: GenMessage<InsertOp, {
jsonType: InsertOpJson;
}>;
/**
* Delete
*
* @generated from message mochabugapis.adapt.runtime.v1.DeleteOp
*/
export type DeleteOp = Message<"mochabugapis.adapt.runtime.v1.DeleteOp"> & {
/**
* Key
*
* @generated from field: string key = 1;
*/
key: string;
};
/**
* Delete
*
* @generated from message mochabugapis.adapt.runtime.v1.DeleteOp
*/
export type DeleteOpJson = {
/**
* Key
*
* @generated from field: string key = 1;
*/
key?: string;
};
/**
* Describes the message mochabugapis.adapt.runtime.v1.DeleteOp.
* Use `create(DeleteOpSchema)` to create a new message.
*/
export declare const DeleteOpSchema: GenMessage<DeleteOp, {
jsonType: DeleteOpJson;
}>;
/**
* Conditional insert
*
* @generated from message mochabugapis.adapt.runtime.v1.ConditionalInsertOp
*/
export type ConditionalInsertOp = Message<"mochabugapis.adapt.runtime.v1.ConditionalInsertOp"> & {
/**
* Key
*
* @generated from field: string key = 1;
*/
key: string;
/**
* Value
*
* @generated from field: mochabugapis.adapt.runtime.v1.PutValue value = 2;
*/
value?: PutValue;
/**
* Precondition
*
* @generated from field: optional mochabugapis.adapt.runtime.v1.ConditionalInsertOp.Precondition precondition = 3;
*/
precondition?: ConditionalInsertOp_Precondition;
};
/**
* Conditional insert
*
* @generated from message mochabugapis.adapt.runtime.v1.ConditionalInsertOp
*/
export type ConditionalInsertOpJson = {
/**
* Key
*
* @generated from field: string key = 1;
*/
key?: string;
/**
* Value
*
* @generated from field: mochabugapis.adapt.runtime.v1.PutValue value = 2;
*/
value?: PutValueJson;
/**
* Precondition
*
* @generated from field: optional mochabugapis.adapt.runtime.v1.ConditionalInsertOp.Precondition precondition = 3;
*/
precondition?: ConditionalInsertOp_PreconditionJson;
};
/**
* Describes the message mochabugapis.adapt.runtime.v1.ConditionalInsertOp.
* Use `create(ConditionalInsertOpSchema)` to create a new message.
*/
export declare const ConditionalInsertOpSchema: GenMessage<ConditionalInsertOp, {
jsonType: ConditionalInsertOpJson;
}>;
/**
* Precondition
*
* @generated from message mochabugapis.adapt.runtime.v1.ConditionalInsertOp.Precondition
*/
export type ConditionalInsertOp_Precondition = Message<"mochabugapis.adapt.runtime.v1.ConditionalInsertOp.Precondition"> & {
/**
* Timestamp
*
* @generated from oneof mochabugapis.adapt.runtime.v1.ConditionalInsertOp.Precondition.timestamp_condition
*/
timestampCondition: {
/**
* Exact match
*
* @generated from field: google.protobuf.Timestamp last_modified_equals = 1;
*/
value: Timestamp;
case: "lastModifiedEquals";
} | {
/**
* Range
*
* @generated from field: mochabugapis.adapt.runtime.v1.TimestampRange last_modified_range = 2;
*/
value: TimestampRange;
case: "lastModifiedRange";
} | {
case: undefined;
value?: undefined;
};
/**
* ETag
*
* @generated from field: optional string etag = 4;
*/
etag?: string;
/**
* Fail if exists
*
* @generated from field: optional bool fail_if_exists = 5;
*/
failIfExists?: boolean;
};
/**
* Precondition
*
* @generated from message mochabugapis.adapt.runtime.v1.ConditionalInsertOp.Precondition
*/
export type ConditionalInsertOp_PreconditionJson = {
/**
* Exact match
*
* @generated from field: google.protobuf.Timestamp last_modified_equals = 1;
*/
lastModifiedEquals?: TimestampJson;
/**
* Range
*
* @generated from field: mochabugapis.adapt.runtime.v1.TimestampRange last_modified_range = 2;
*/
lastModifiedRange?: TimestampRangeJson;
/**
* ETag
*
* @generated from field: optional string etag = 4;
*/
etag?: string;
/**
* Fail if exists
*
* @generated from field: optional bool fail_if_exists = 5;
*/
failIfExists?: boolean;
};
/**
* Describes the message mochabugapis.adapt.runtime.v1.ConditionalInsertOp.Precondition.
* Use `create(ConditionalInsertOp_PreconditionSchema)` to create a new message.
*/
export declare const ConditionalInsertOp_PreconditionSchema: GenMessage<ConditionalInsertOp_Precondition, {
jsonType: ConditionalInsertOp_PreconditionJson;
}>;
/**
* Conditional delete
*
* @generated from message mochabugapis.adapt.runtime.v1.ConditionalDeleteOp
*/
export type ConditionalDeleteOp = Message<"mochabugapis.adapt.runtime.v1.ConditionalDeleteOp"> & {
/**
* Key
*
* @generated from field: string key = 1;
*/
key: string;
/**
* Precondition
*
* @generated from field: optional mochabugapis.adapt.runtime.v1.ConditionalDeleteOp.Precondition precondition = 2;
*/
precondition?: ConditionalDeleteOp_Precondition;
};
/**
* Conditional delete
*
* @generated from message mochabugapis.adapt.runtime.v1.ConditionalDeleteOp
*/
export type ConditionalDeleteOpJson = {
/**
* Key
*
* @generated from field: string key = 1;
*/
key?: string;
/**
* Precondition
*
* @generated from field: optional mochabugapis.adapt.runtime.v1.ConditionalDeleteOp.Precondition precondition = 2;
*/
precondition?: ConditionalDeleteOp_PreconditionJson;
};
/**
* Describes the message mochabugapis.adapt.runtime.v1.ConditionalDeleteOp.
* Use `create(ConditionalDeleteOpSchema)` to create a new message.
*/
export declare const ConditionalDeleteOpSchema: GenMessage<ConditionalDeleteOp, {
jsonType: ConditionalDeleteOpJson;
}>;
/**
* Precondition
*
* @generated from message mochabugapis.adapt.runtime.v1.ConditionalDeleteOp.Precondition
*/
export type ConditionalDeleteOp_Precondition = Message<"mochabugapis.adapt.runtime.v1.ConditionalDeleteOp.Precondition"> & {
/**
* Must exist
*
* @generated from field: optional bool must_exists = 1;
*/
mustExists?: boolean;
/**
* Timestamp
*
* @generated from oneof mochabugapis.adapt.runtime.v1.ConditionalDeleteOp.Precondition.timestamp_condition
*/
timestampCondition: {
/**
* Exact match
*
* @generated from field: google.protobuf.Timestamp last_modified_equals = 2;
*/
value: Timestamp;
case: "lastModifiedEquals";
} | {
/**
* Range
*
* @generated from field: mochabugapis.adapt.runtime.v1.TimestampRange last_modified_range = 3;
*/
value: TimestampRange;
case: "lastModifiedRange";
} | {
case: undefined;
value?: undefined;
};
/**
* ETag
*
* @generated from field: optional string etag = 4;
*/
etag?: string;
};
/**
* Precondition
*
* @generated from message mochabugapis.adapt.runtime.v1.ConditionalDeleteOp.Precondition
*/
export type ConditionalDeleteOp_PreconditionJson = {
/**
* Must exist
*
* @generated from field: optional bool must_exists = 1;
*/
mustExists?: boolean;
/**
* Exact match
*
* @generated from field: google.protobuf.Timestamp last_modified_equals = 2;
*/
lastModifiedEquals?: TimestampJson;
/**
* Range
*
* @generated from field: mochabugapis.adapt.runtime.v1.TimestampRange last_modified_range = 3;
*/
lastModifiedRange?: TimestampRangeJson;
/**
* ETag
*
* @generated from field: optional string etag = 4;
*/
etag?: string;
};
/**
* Describes the message mochabugapis.adapt.runtime.v1.ConditionalDeleteOp.Precondition.
* Use `create(ConditionalDeleteOp_PreconditionSchema)` to create a new message.
*/
export declare const ConditionalDeleteOp_PreconditionSchema: GenMessage<ConditionalDeleteOp_Precondition, {
jsonType: ConditionalDeleteOp_PreconditionJson;
}>;
//# sourceMappingURL=store_pb.d.ts.map