@carto/api-client 0.5.23 → 0.5.25-alpha.d96c26c.111

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.
@@ -1383,6 +1383,10 @@ interface FeaturesRequestOptions extends BaseRequestOptions {
1383
1383
  * given in the request.
1384
1384
  */
1385
1385
  limit?: number;
1386
+ /**
1387
+ * Number of objects to skip in the result set.
1388
+ */
1389
+ offset?: number;
1386
1390
  /**
1387
1391
  * Must match `tileResolution` used when obtaining the `_carto_feature_id`
1388
1392
  * column, typically in a layer's tile requests.
@@ -1499,6 +1503,9 @@ type ExtentRequestOptions = BaseRequestOptions;
1499
1503
  */
1500
1504
  type FeaturesResponse = {
1501
1505
  rows: Record<string, unknown>[];
1506
+ metadata: {
1507
+ total?: number;
1508
+ };
1502
1509
  };
1503
1510
  /** Response from {@link WidgetRemoteSource#getFormula}. */
1504
1511
  type FormulaResponse = {
@@ -1383,6 +1383,10 @@ interface FeaturesRequestOptions extends BaseRequestOptions {
1383
1383
  * given in the request.
1384
1384
  */
1385
1385
  limit?: number;
1386
+ /**
1387
+ * Number of objects to skip in the result set.
1388
+ */
1389
+ offset?: number;
1386
1390
  /**
1387
1391
  * Must match `tileResolution` used when obtaining the `_carto_feature_id`
1388
1392
  * column, typically in a layer's tile requests.
@@ -1499,6 +1503,9 @@ type ExtentRequestOptions = BaseRequestOptions;
1499
1503
  */
1500
1504
  type FeaturesResponse = {
1501
1505
  rows: Record<string, unknown>[];
1506
+ metadata: {
1507
+ total?: number;
1508
+ };
1502
1509
  };
1503
1510
  /** Response from {@link WidgetRemoteSource#getFormula}. */
1504
1511
  type FormulaResponse = {
@@ -6379,7 +6379,7 @@ var WidgetRemoteSource = class extends WidgetSource {
6379
6379
  spatialFiltersMode,
6380
6380
  ...params
6381
6381
  } = options;
6382
- const { columns, dataType, featureIds, z, limit, tileResolution } = params;
6382
+ const { columns, dataType, featureIds, z, limit, tileResolution, offset } = params;
6383
6383
  return executeModel({
6384
6384
  model: "pick",
6385
6385
  source: {
@@ -6392,12 +6392,13 @@ var WidgetRemoteSource = class extends WidgetSource {
6392
6392
  dataType,
6393
6393
  featureIds,
6394
6394
  z,
6395
+ offset,
6395
6396
  limit: limit || 1e3,
6396
6397
  tileResolution: tileResolution || DEFAULT_TILE_RESOLUTION
6397
6398
  },
6398
6399
  opts: { signal, headers: this.props.headers }
6399
6400
  // Avoid `normalizeObjectKeys()`, which changes column names.
6400
- }).then(({ rows }) => ({ rows }));
6401
+ }).then(({ rows, metadata }) => ({ rows, metadata }));
6401
6402
  }
6402
6403
  async getFormula(options) {
6403
6404
  const {
@@ -9513,7 +9514,7 @@ function domainFromAttribute(attribute, scaleType, scaleLength) {
9513
9514
  if (!attribute.categories) {
9514
9515
  return [0, 1];
9515
9516
  }
9516
- return attribute.categories.map((c) => c.category).filter((c) => c !== void 0 && c !== null);
9517
+ return attribute.categories.map((c) => c.category).filter((c) => c !== void 0 && c !== null).slice(0, scaleLength);
9517
9518
  }
9518
9519
  if (scaleType === "quantile" && attribute.quantiles) {
9519
9520
  const quantiles = "global" in attribute.quantiles ? attribute.quantiles.global : attribute.quantiles;
@@ -11035,7 +11036,7 @@ async function fetchMap({
11035
11036
  const pointType = layer.props?.pointType || "";
11036
11037
  return pointType.includes("text");
11037
11038
  });
11038
- if (textLayers.length && window.FontFace && !document.fonts.check("12px Inter")) {
11039
+ if (textLayers.length && typeof window !== "undefined" && typeof document !== "undefined" && window.FontFace && document.fonts && !document.fonts.check("12px Inter")) {
11039
11040
  const font = new FontFace(
11040
11041
  "Inter",
11041
11042
  "url(https://fonts.gstatic.com/s/inter/v12/UcC73FwrK3iLTeHuS_fvQtMwCp50KnMa1ZL7W0Q5nw.woff2)"