diff --git a/src/binders/Binder.ts b/src/binders/Binder.ts index 36232e01..d218d0f1 100644 --- a/src/binders/Binder.ts +++ b/src/binders/Binder.ts @@ -10,7 +10,7 @@ export default class Binder> { /** * Injects `nextPage`, `nextPageCursor`, `previousPage`, and `previousPageCursor` into the passed list. */ - protected injectPaginationHelpers

(input: Array & Pick, 'count' | 'links'>, list: (parameters: P) => Promise>, selfParameters: P = {} as P): Page { + protected injectPaginationHelpers

(input: Array & Pick, 'links'>, list: (parameters: P) => Promise>, selfParameters: P = {} as P): Page { const { links } = input; let nextPage: Maybe<() => Promise>>; let nextPageCursor: Maybe; diff --git a/src/communication/NetworkClient.ts b/src/communication/NetworkClient.ts index a88165c2..ca6db27f 100644 --- a/src/communication/NetworkClient.ts +++ b/src/communication/NetworkClient.ts @@ -175,18 +175,15 @@ export default class NetworkClient { return embedded[binderName] as R[]; } - async page(pathname: string, binderName: string, query?: SearchParameters): Promise, 'links' | 'count'>> { + async page(pathname: string, binderName: string, query?: SearchParameters): Promise, 'links'>> { const data = await this.request(buildUrl(pathname, query)); try { /* eslint-disable-next-line no-var */ - var { _embedded: embedded, _links: links, count } = data; + var { _embedded: embedded, _links: links } = data; } catch (error) { throw new ApiError('Received unexpected response from the server'); } - return Object.assign(embedded[binderName] as R[], { - links, - count, - }); + return Object.assign(embedded[binderName] as R[], { links }); } iterate(pathname: string, binderName: string, query: Maybe, valuesPerMinute = 5000): HelpfulIterator { diff --git a/src/communication/TransformingNetworkClient.ts b/src/communication/TransformingNetworkClient.ts index bf0e6d33..f43c354a 100644 --- a/src/communication/TransformingNetworkClient.ts +++ b/src/communication/TransformingNetworkClient.ts @@ -50,8 +50,8 @@ export default class TransformingNetworkClient { async page, U>(...passingArguments: Parameters) { const response = await this.networkClient.page(...passingArguments); - const { count, links } = response; - return Object.assign(response.map(this.transform) as U[], { count, links }); + const { links } = response; + return Object.assign(response.map(this.transform) as U[], { links }); } iterate, U>(...passingArguments: Parameters) { diff --git a/src/data/page/Page.ts b/src/data/page/Page.ts index 6c8361b0..251422ab 100644 --- a/src/data/page/Page.ts +++ b/src/data/page/Page.ts @@ -4,10 +4,6 @@ import { type Links, type Url } from '../global'; export default interface Page extends Array { links: PageLinks; - /** - * @deprecated Use `list.length` instead. - */ - count: number; nextPageCursor: Maybe; previousPageCursor: Maybe; nextPage: Maybe<() => Promise>>;