@carto/api-client 0.5.25 → 0.5.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "homepage": "https://github.com/CartoDB/carto-api-client#readme",
9
9
  "author": "Don McCurdy <donmccurdy@carto.com>",
10
10
  "packageManager": "yarn@4.3.1",
11
- "version": "0.5.25",
11
+ "version": "0.5.26",
12
12
  "license": "MIT",
13
13
  "publishConfig": {
14
14
  "access": "public"
@@ -113,6 +113,11 @@ export interface FeaturesRequestOptions extends BaseRequestOptions {
113
113
  */
114
114
  limit?: number;
115
115
 
116
+ /**
117
+ * Number of objects to skip in the result set.
118
+ */
119
+ offset?: number;
120
+
116
121
  /**
117
122
  * Must match `tileResolution` used when obtaining the `_carto_feature_id`
118
123
  * column, typically in a layer's tile requests.
@@ -239,7 +244,10 @@ export type ExtentRequestOptions = BaseRequestOptions;
239
244
  * @experimental
240
245
  * @internal
241
246
  */
242
- export type FeaturesResponse = {rows: Record<string, unknown>[]};
247
+ export type FeaturesResponse = {
248
+ rows: Record<string, unknown>[];
249
+ metadata: {total?: number};
250
+ };
243
251
 
244
252
  /** Response from {@link WidgetRemoteSource#getFormula}. */
245
253
  export type FormulaResponse = {value: number | null};
@@ -140,9 +140,8 @@ export abstract class WidgetRemoteSource<
140
140
  spatialFiltersMode,
141
141
  ...params
142
142
  } = options;
143
- const {columns, dataType, featureIds, z, limit, tileResolution} = params;
144
-
145
- type FeaturesModelResponse = {rows: Record<string, unknown>[]};
143
+ const {columns, dataType, featureIds, z, limit, tileResolution, offset} =
144
+ params;
146
145
 
147
146
  return executeModel({
148
147
  model: 'pick',
@@ -156,12 +155,13 @@ export abstract class WidgetRemoteSource<
156
155
  dataType,
157
156
  featureIds,
158
157
  z,
158
+ offset,
159
159
  limit: limit || 1000,
160
160
  tileResolution: tileResolution || DEFAULT_TILE_RESOLUTION,
161
161
  },
162
162
  opts: {signal, headers: this.props.headers},
163
163
  // Avoid `normalizeObjectKeys()`, which changes column names.
164
- }).then(({rows}: FeaturesModelResponse) => ({rows}));
164
+ }).then(({rows, metadata}: FeaturesResponse) => ({rows, metadata}));
165
165
  }
166
166
 
167
167
  async getFormula(options: FormulaRequestOptions): Promise<FormulaResponse> {