From 0c58aa5aef8c29a79674f1fc93d3f0b0d2922c84 Mon Sep 17 00:00:00 2001 From: Capplequoppe Date: Fri, 25 Feb 2022 06:31:26 +0100 Subject: [PATCH] Fixed typing issues Fixed typing issues that prevented mappers from using cursor based pagination in TypeScript --- lib/mapping/index.d.ts | 2 +- lib/mapping/model-mapper.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/mapping/index.d.ts b/lib/mapping/index.d.ts index 694e789cf..bd42e72c3 100644 --- a/lib/mapping/index.d.ts +++ b/lib/mapping/index.d.ts @@ -59,7 +59,7 @@ export namespace mapping { logged?: boolean; timestamp?: number | Long; fetchSize?: number; - pageState?: number; + pageState?: string | Buffer; } interface ModelTables { diff --git a/lib/mapping/model-mapper.js b/lib/mapping/model-mapper.js index 8a4d04194..24f51d29d 100644 --- a/lib/mapping/model-mapper.js +++ b/lib/mapping/model-mapper.js @@ -81,7 +81,7 @@ class ModelMapper { * execution or a string representing the name of the execution profile. * @param {String} [executionOptions.executionProfile] The name of the execution profile. * @param {Number} [executionOptions.fetchSize] The amount of rows to retrieve per page. - * @param {Number} [executionOptions.pageState] A Buffer instance or a string token representing the paging state. + * @param {String|Buffer} [executionOptions.pageState] A Buffer instance or a string token representing the paging state. *

When provided, the query will be executed starting from a given paging state.

* @return {Promise} A Promise that resolves to a [Result]{@link module:mapping~Result} instance. * @example Get user's videos @@ -121,7 +121,7 @@ class ModelMapper { * execution or a string representing the name of the execution profile. * @param {String} [executionOptions.executionProfile] The name of the execution profile. * @param {Number} [executionOptions.fetchSize] The mount of rows to retrieve per page. - * @param {Number} [executionOptions.pageState] A Buffer instance or a string token representing the paging state. + * @param {String|Buffer} [executionOptions.pageState] A Buffer instance or a string token representing the paging state. *

When provided, the query will be executed starting from a given paging state.

* @return {Promise} A Promise that resolves to a [Result]{@link module:mapping~Result} instance. */ @@ -290,7 +290,7 @@ class ModelMapper { * @param {Number} [executionOptions.fetchSize] Amount of rows to retrieve per page. * @param {Boolean} [executionOptions.isIdempotent] Defines whether the query can be applied multiple times * without changing the result beyond the initial application. - * @param {Number} [executionOptions.pageState] Buffer or string token representing the paging state. + * @param {String|Buffer} [executionOptions.pageState] Buffer or string token representing the paging state. *

When provided, the query will be executed starting from a given paging state.

* @param {Number|Long} [executionOptions.timestamp] The default timestamp for the query in microseconds from the * unix epoch (00:00:00, January 1st, 1970).