diff --git a/src/__generated__/changes_pb.ts b/src/__generated__/changes_pb.ts index 3d1426d..f88653f 100644 --- a/src/__generated__/changes_pb.ts +++ b/src/__generated__/changes_pb.ts @@ -7,6 +7,7 @@ import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialM import { Message, proto3, Timestamp } from "@bufbuild/protobuf"; import { Edge, Health, Item, Query, Reference } from "./items_pb.ts"; import { BlastRadiusConfig } from "./config_pb.ts"; +import { PaginationRequest, PaginationResponse } from "./util_pb.ts"; import { Bookmark } from "./bookmarks_pb.ts"; import { Snapshot } from "./snapshots_pb.ts"; @@ -910,6 +911,11 @@ export class GetAppSummariesResponse extends Message { * @generated from message changes.ListHomeChangesRequest */ export class ListHomeChangesRequest extends Message { + /** + * @generated from field: PaginationRequest pagination = 1; + */ + pagination?: PaginationRequest; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -918,6 +924,7 @@ export class ListHomeChangesRequest extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "changes.ListHomeChangesRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "pagination", kind: "message", T: PaginationRequest }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ListHomeChangesRequest { @@ -946,6 +953,11 @@ export class ListHomeChangesResponse extends Message { */ changes: ChangeSummary[] = []; + /** + * @generated from field: PaginationResponse pagination = 2; + */ + pagination?: PaginationResponse; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -955,6 +967,7 @@ export class ListHomeChangesResponse extends Message { static readonly typeName = "changes.ListHomeChangesResponse"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "changes", kind: "message", T: ChangeSummary, repeated: true }, + { no: 2, name: "pagination", kind: "message", T: PaginationResponse }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ListHomeChangesResponse { diff --git a/src/__generated__/util_pb.ts b/src/__generated__/util_pb.ts new file mode 100644 index 0000000..e532a0a --- /dev/null +++ b/src/__generated__/util_pb.ts @@ -0,0 +1,121 @@ +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts,import_extension=.ts" +// @generated from file util.proto (syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from message PaginationRequest + */ +export class PaginationRequest extends Message { + /** + * The number of items to return in a single page. The minimum is 10 and the maximum is 100. + * + * @generated from field: int32 pageSize = 1; + */ + pageSize = 0; + + /** + * The page number to return. the first page is 0. + * if the page number is larger than the total number of pages, the last page is returned. + * if the page number is negative, the first page 0 is returned. + * + * @generated from field: int32 page = 2; + */ + page = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "PaginationRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "pageSize", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "page", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PaginationRequest { + return new PaginationRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PaginationRequest { + return new PaginationRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PaginationRequest { + return new PaginationRequest().fromJsonString(jsonString, options); + } + + static equals(a: PaginationRequest | PlainMessage | undefined, b: PaginationRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(PaginationRequest, a, b); + } +} + +/** + * @generated from message PaginationResponse + */ +export class PaginationResponse extends Message { + /** + * The number of items in the current page + * + * @generated from field: int32 pageSize = 1; + */ + pageSize = 0; + + /** + * The total number of items available. Expensive to calculate https://www.cybertec-postgresql.com/en/pagination-problem-total-result-count/ + * this is done as a separate query + * + * @generated from field: int32 totalItems = 2; + */ + totalItems = 0; + + /** + * The current page number + * + * @generated from field: int32 page = 3; + */ + page = 0; + + /** + * The total number of pages available. based on the totalItems and pageSize. + * + * @generated from field: int32 totalPages = 4; + */ + totalPages = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "PaginationResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "pageSize", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "totalItems", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 3, name: "page", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 4, name: "totalPages", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PaginationResponse { + return new PaginationResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PaginationResponse { + return new PaginationResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PaginationResponse { + return new PaginationResponse().fromJsonString(jsonString, options); + } + + static equals(a: PaginationResponse | PlainMessage | undefined, b: PaginationResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(PaginationResponse, a, b); + } +} +