@carto/api-client 0.5.9-alpha.orderby.1 → 0.5.10-alpha.PR193.4
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/CHANGELOG.md +4 -0
- package/build/api-client.cjs +28 -14
- package/build/api-client.cjs.map +1 -1
- package/build/api-client.d.cts +15 -2
- package/build/api-client.d.ts +15 -2
- package/build/api-client.js +28 -14
- package/build/api-client.js.map +1 -1
- package/package.json +1 -1
- package/src/api/query.ts +19 -2
- package/src/api/request-with-parameters.ts +10 -5
- package/src/models/model.ts +3 -0
- package/src/sources/base-source.ts +1 -1
- package/src/sources/types.ts +3 -0
- package/src/widget-sources/widget-remote-source.ts +1 -0
package/CHANGELOG.md
CHANGED
package/build/api-client.cjs
CHANGED
|
@@ -6084,7 +6084,8 @@ async function requestWithParameters({
|
|
|
6084
6084
|
headers: customHeaders = {},
|
|
6085
6085
|
errorContext,
|
|
6086
6086
|
maxLengthURL = DEFAULT_MAX_LENGTH_URL,
|
|
6087
|
-
localCache
|
|
6087
|
+
localCache,
|
|
6088
|
+
signal
|
|
6088
6089
|
}) {
|
|
6089
6090
|
parameters = {
|
|
6090
6091
|
v: V3_MINOR_VERSION,
|
|
@@ -6107,8 +6108,9 @@ async function requestWithParameters({
|
|
|
6107
6108
|
const fetchPromise = url.length > maxLengthURL ? fetch(baseUrl, {
|
|
6108
6109
|
method: "POST",
|
|
6109
6110
|
body: JSON.stringify(parameters),
|
|
6110
|
-
headers
|
|
6111
|
-
|
|
6111
|
+
headers,
|
|
6112
|
+
signal
|
|
6113
|
+
}) : fetch(url, { headers, signal });
|
|
6112
6114
|
let response;
|
|
6113
6115
|
let responseJson;
|
|
6114
6116
|
const jsonPromise = fetchPromise.then((_response) => {
|
|
@@ -6160,10 +6162,12 @@ function createURLWithParameters(baseUrlString, parameters) {
|
|
|
6160
6162
|
if (isPureObject(value) || Array.isArray(value)) {
|
|
6161
6163
|
baseUrl.searchParams.set(key, JSON.stringify(value));
|
|
6162
6164
|
} else {
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6165
|
+
if (value !== null && value !== void 0) {
|
|
6166
|
+
baseUrl.searchParams.set(
|
|
6167
|
+
key,
|
|
6168
|
+
value.toString()
|
|
6169
|
+
);
|
|
6170
|
+
}
|
|
6167
6171
|
}
|
|
6168
6172
|
}
|
|
6169
6173
|
return baseUrl.toString();
|
|
@@ -6207,7 +6211,7 @@ async function baseSource(endpoint, options, urlParameters) {
|
|
|
6207
6211
|
Authorization: `Bearer ${options.accessToken}`,
|
|
6208
6212
|
...options.headers
|
|
6209
6213
|
};
|
|
6210
|
-
const parameters = { client: clientId, ...urlParameters };
|
|
6214
|
+
const parameters = { client: clientId, ...options.tags, ...urlParameters };
|
|
6211
6215
|
const errorContext = {
|
|
6212
6216
|
requestType: "Map instantiation",
|
|
6213
6217
|
connection: options.connectionName,
|
|
@@ -6428,7 +6432,8 @@ function executeModel(props) {
|
|
|
6428
6432
|
filtersLogicalOperator = "and",
|
|
6429
6433
|
spatialDataType = "geo",
|
|
6430
6434
|
spatialDataColumn = DEFAULT_GEO_COLUMN,
|
|
6431
|
-
spatialFiltersMode = "intersects"
|
|
6435
|
+
spatialFiltersMode = "intersects",
|
|
6436
|
+
tags
|
|
6432
6437
|
} = source;
|
|
6433
6438
|
const queryParams = {
|
|
6434
6439
|
type,
|
|
@@ -6437,7 +6442,8 @@ function executeModel(props) {
|
|
|
6437
6442
|
params,
|
|
6438
6443
|
queryParameters: source.queryParameters || "",
|
|
6439
6444
|
filters,
|
|
6440
|
-
filtersLogicalOperator
|
|
6445
|
+
filtersLogicalOperator,
|
|
6446
|
+
...tags ?? {}
|
|
6441
6447
|
};
|
|
6442
6448
|
queryParams.spatialDataType = spatialDataType;
|
|
6443
6449
|
queryParams.spatialDataColumn = spatialDataColumn;
|
|
@@ -6572,7 +6578,8 @@ var WidgetRemoteSource = class extends WidgetSource {
|
|
|
6572
6578
|
filters: getApplicableFilters(filterOwner, filters || props.filters),
|
|
6573
6579
|
filtersLogicalOperator: props.filtersLogicalOperator,
|
|
6574
6580
|
spatialDataType: props.spatialDataType,
|
|
6575
|
-
spatialDataColumn: props.spatialDataColumn
|
|
6581
|
+
spatialDataColumn: props.spatialDataColumn,
|
|
6582
|
+
tags: props.tags
|
|
6576
6583
|
};
|
|
6577
6584
|
}
|
|
6578
6585
|
async getCategories(options) {
|
|
@@ -8411,7 +8418,8 @@ var query = async function(options) {
|
|
|
8411
8418
|
localCache,
|
|
8412
8419
|
connectionName,
|
|
8413
8420
|
sqlQuery,
|
|
8414
|
-
queryParameters
|
|
8421
|
+
queryParameters,
|
|
8422
|
+
internalParameters
|
|
8415
8423
|
} = options;
|
|
8416
8424
|
const urlParameters = { q: sqlQuery };
|
|
8417
8425
|
if (queryParameters) {
|
|
@@ -8422,7 +8430,12 @@ var query = async function(options) {
|
|
|
8422
8430
|
Authorization: `Bearer ${options.accessToken}`,
|
|
8423
8431
|
...options.headers
|
|
8424
8432
|
};
|
|
8425
|
-
const parameters = {
|
|
8433
|
+
const parameters = {
|
|
8434
|
+
client: clientId,
|
|
8435
|
+
...options.tags,
|
|
8436
|
+
...internalParameters,
|
|
8437
|
+
...urlParameters
|
|
8438
|
+
};
|
|
8426
8439
|
const errorContext = {
|
|
8427
8440
|
requestType: "SQL",
|
|
8428
8441
|
connection: options.connectionName,
|
|
@@ -8435,7 +8448,8 @@ var query = async function(options) {
|
|
|
8435
8448
|
headers,
|
|
8436
8449
|
errorContext,
|
|
8437
8450
|
maxLengthURL,
|
|
8438
|
-
localCache
|
|
8451
|
+
localCache,
|
|
8452
|
+
signal: options.signal
|
|
8439
8453
|
});
|
|
8440
8454
|
};
|
|
8441
8455
|
|