@carto/api-client 0.5.1 → 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.
- package/build/api-client.cjs +79 -77
- package/build/api-client.cjs.map +1 -1
- package/build/api-client.d.cts +9 -1
- package/build/api-client.d.ts +9 -1
- package/build/api-client.js +77 -76
- package/build/api-client.js.map +1 -1
- package/build/worker.js +35 -33
- package/build/worker.js.map +1 -1
- package/package.json +3 -2
- package/src/filters.ts +37 -2
- package/src/utils.ts +0 -35
- package/src/widget-sources/widget-remote-source.ts +2 -1
- package/src/widget-sources/widget-tileset-source-impl.ts +2 -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() {
|