@carto/api-client 0.5.1-alpha.2 → 0.5.2-alpha.0

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.
Files changed (36) hide show
  1. package/CHANGELOG.md +7 -2
  2. package/build/api-client.cjs +101 -106
  3. package/build/api-client.cjs.map +1 -1
  4. package/build/api-client.d.cts +46 -15
  5. package/build/api-client.d.ts +46 -15
  6. package/build/api-client.js +95 -105
  7. package/build/api-client.js.map +1 -1
  8. package/build/worker.js +38 -33
  9. package/build/worker.js.map +1 -1
  10. package/package.json +3 -3
  11. package/src/fetch-map/fetch-map.ts +1 -7
  12. package/src/fetch-map/parse-map.ts +2 -1
  13. package/src/fetch-map/source.ts +12 -3
  14. package/src/fetch-map/types.ts +3 -2
  15. package/src/filters.ts +37 -2
  16. package/src/index.ts +1 -0
  17. package/src/sources/base-source.ts +8 -22
  18. package/src/sources/boundary-query-source.ts +1 -5
  19. package/src/sources/boundary-table-source.ts +1 -5
  20. package/src/sources/h3-query-source.ts +1 -1
  21. package/src/sources/h3-table-source.ts +1 -1
  22. package/src/sources/h3-tileset-source.ts +2 -2
  23. package/src/sources/index.ts +18 -10
  24. package/src/sources/quadbin-query-source.ts +1 -1
  25. package/src/sources/quadbin-table-source.ts +1 -1
  26. package/src/sources/quadbin-tileset-source.ts +2 -2
  27. package/src/sources/raster-source.ts +3 -3
  28. package/src/sources/types.ts +6 -8
  29. package/src/sources/vector-query-source.ts +1 -1
  30. package/src/sources/vector-table-source.ts +1 -1
  31. package/src/sources/vector-tileset-source.ts +2 -2
  32. package/src/types-internal.ts +0 -24
  33. package/src/utils.ts +0 -35
  34. package/src/widget-sources/types.ts +2 -2
  35. package/src/widget-sources/widget-remote-source.ts +2 -1
  36. package/src/widget-sources/widget-tileset-source-impl.ts +6 -6
package/build/worker.js CHANGED
@@ -76,40 +76,7 @@ var require_thenBy_module = __commonJS({
76
76
  }
77
77
  });
78
78
 
79
- // src/constants.ts
80
- var FilterType = /* @__PURE__ */ ((FilterType2) => {
81
- FilterType2["IN"] = "in";
82
- FilterType2["BETWEEN"] = "between";
83
- FilterType2["CLOSED_OPEN"] = "closed_open";
84
- FilterType2["TIME"] = "time";
85
- FilterType2["STRING_SEARCH"] = "stringSearch";
86
- return FilterType2;
87
- })(FilterType || {});
88
- var DEFAULT_API_BASE_URL = "https://gcp-us-east1.api.carto.com";
89
- var SpatialIndexColumn = Object.freeze({
90
- ["h3" /* H3 */]: ["h3", "hex", "h3id", "hex_id", "h3hex"],
91
- ["quadbin" /* QUADBIN */]: ["quadbin"]
92
- });
93
-
94
79
  // src/utils.ts
95
- var FILTER_TYPES = new Set(Object.values(FilterType));
96
- var isFilterType = (type) => FILTER_TYPES.has(type);
97
- function getApplicableFilters(owner, filters) {
98
- if (!filters) return {};
99
- const applicableFilters = {};
100
- for (const column in filters) {
101
- for (const type in filters[column]) {
102
- if (!isFilterType(type)) continue;
103
- const filter = filters[column][type];
104
- const isApplicable = !owner || !filter?.owner || filter?.owner !== owner;
105
- if (filter && isApplicable) {
106
- applicableFilters[column] || (applicableFilters[column] = {});
107
- applicableFilters[column][type] = filter;
108
- }
109
- }
110
- }
111
- return applicableFilters;
112
- }
113
80
  function assert(condition, message) {
114
81
  if (!condition) {
115
82
  throw new Error(message);
@@ -137,6 +104,21 @@ function assignOptional(target, ...sources) {
137
104
  return target;
138
105
  }
139
106
 
107
+ // src/constants.ts
108
+ var FilterType = /* @__PURE__ */ ((FilterType2) => {
109
+ FilterType2["IN"] = "in";
110
+ FilterType2["BETWEEN"] = "between";
111
+ FilterType2["CLOSED_OPEN"] = "closed_open";
112
+ FilterType2["TIME"] = "time";
113
+ FilterType2["STRING_SEARCH"] = "stringSearch";
114
+ return FilterType2;
115
+ })(FilterType || {});
116
+ var DEFAULT_API_BASE_URL = "https://gcp-us-east1.api.carto.com";
117
+ var SpatialIndexColumn = Object.freeze({
118
+ ["h3" /* H3 */]: ["h3", "hex", "h3id", "hex_id", "h3hex"],
119
+ ["quadbin" /* QUADBIN */]: ["quadbin"]
120
+ });
121
+
140
122
  // src/utils/makeIntervalComplete.ts
141
123
  function makeIntervalComplete(intervals) {
142
124
  return intervals.map((val) => {
@@ -6148,6 +6130,26 @@ function booleanEqual(feature1, feature2, options = {}) {
6148
6130
  });
6149
6131
  }
6150
6132
 
6133
+ // src/filters.ts
6134
+ var FILTER_TYPES = new Set(Object.values(FilterType));
6135
+ var isFilterType = (type) => FILTER_TYPES.has(type);
6136
+ function getApplicableFilters(owner, filters) {
6137
+ if (!filters) return {};
6138
+ const applicableFilters = {};
6139
+ for (const column in filters) {
6140
+ for (const type in filters[column]) {
6141
+ if (!isFilterType(type)) continue;
6142
+ const filter = filters[column][type];
6143
+ const isApplicable = !owner || !filter?.owner || filter?.owner !== owner;
6144
+ if (filter && isApplicable) {
6145
+ applicableFilters[column] || (applicableFilters[column] = {});
6146
+ applicableFilters[column][type] = filter;
6147
+ }
6148
+ }
6149
+ }
6150
+ return applicableFilters;
6151
+ }
6152
+
6151
6153
  // src/widget-sources/widget-tileset-source-impl.ts
6152
6154
  var WidgetTilesetSourceImpl = class extends WidgetSource {
6153
6155
  constructor() {
@@ -6330,6 +6332,9 @@ var WidgetTilesetSourceImpl = class extends WidgetSource {
6330
6332
  return { rows: [], totalCount: 0 };
6331
6333
  }
6332
6334
  if (searchFilterColumn && searchFilterText) {
6335
+ console.warn(
6336
+ 'WidgetTilesetSource: "searchFilterText" is deprecated, use "filters" and FilterType.STRING_SEARCH instead.'
6337
+ );
6333
6338
  filteredFeatures = filteredFeatures.filter(
6334
6339
  (row) => row[searchFilterColumn] && String(row[searchFilterColumn]).toLowerCase().includes(String(searchFilterText).toLowerCase())
6335
6340
  );