@carto/api-client 0.5.8 → 0.5.9-alpha.PR193.2
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 +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/build/api-client.cjs
CHANGED
|
@@ -6083,7 +6083,8 @@ async function requestWithParameters({
|
|
|
6083
6083
|
headers: customHeaders = {},
|
|
6084
6084
|
errorContext,
|
|
6085
6085
|
maxLengthURL = DEFAULT_MAX_LENGTH_URL,
|
|
6086
|
-
localCache
|
|
6086
|
+
localCache,
|
|
6087
|
+
signal
|
|
6087
6088
|
}) {
|
|
6088
6089
|
parameters = {
|
|
6089
6090
|
v: V3_MINOR_VERSION,
|
|
@@ -6106,8 +6107,9 @@ async function requestWithParameters({
|
|
|
6106
6107
|
const fetchPromise = url.length > maxLengthURL ? fetch(baseUrl, {
|
|
6107
6108
|
method: "POST",
|
|
6108
6109
|
body: JSON.stringify(parameters),
|
|
6109
|
-
headers
|
|
6110
|
-
|
|
6110
|
+
headers,
|
|
6111
|
+
signal
|
|
6112
|
+
}) : fetch(url, { headers, signal });
|
|
6111
6113
|
let response;
|
|
6112
6114
|
let responseJson;
|
|
6113
6115
|
const jsonPromise = fetchPromise.then((_response) => {
|
|
@@ -6159,10 +6161,12 @@ function createURLWithParameters(baseUrlString, parameters) {
|
|
|
6159
6161
|
if (isPureObject(value) || Array.isArray(value)) {
|
|
6160
6162
|
baseUrl.searchParams.set(key, JSON.stringify(value));
|
|
6161
6163
|
} else {
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
|
|
6164
|
+
if (value !== null && value !== void 0) {
|
|
6165
|
+
baseUrl.searchParams.set(
|
|
6166
|
+
key,
|
|
6167
|
+
value.toString()
|
|
6168
|
+
);
|
|
6169
|
+
}
|
|
6166
6170
|
}
|
|
6167
6171
|
}
|
|
6168
6172
|
return baseUrl.toString();
|
|
@@ -6206,7 +6210,7 @@ async function baseSource(endpoint, options, urlParameters) {
|
|
|
6206
6210
|
Authorization: `Bearer ${options.accessToken}`,
|
|
6207
6211
|
...options.headers
|
|
6208
6212
|
};
|
|
6209
|
-
const parameters = { client: clientId, ...urlParameters };
|
|
6213
|
+
const parameters = { client: clientId, ...options.tags, ...urlParameters };
|
|
6210
6214
|
const errorContext = {
|
|
6211
6215
|
requestType: "Map instantiation",
|
|
6212
6216
|
connection: options.connectionName,
|
|
@@ -6427,7 +6431,8 @@ function executeModel(props) {
|
|
|
6427
6431
|
filtersLogicalOperator = "and",
|
|
6428
6432
|
spatialDataType = "geo",
|
|
6429
6433
|
spatialDataColumn = DEFAULT_GEO_COLUMN,
|
|
6430
|
-
spatialFiltersMode = "intersects"
|
|
6434
|
+
spatialFiltersMode = "intersects",
|
|
6435
|
+
tags
|
|
6431
6436
|
} = source;
|
|
6432
6437
|
const queryParams = {
|
|
6433
6438
|
type,
|
|
@@ -6436,7 +6441,8 @@ function executeModel(props) {
|
|
|
6436
6441
|
params,
|
|
6437
6442
|
queryParameters: source.queryParameters || "",
|
|
6438
6443
|
filters,
|
|
6439
|
-
filtersLogicalOperator
|
|
6444
|
+
filtersLogicalOperator,
|
|
6445
|
+
tags
|
|
6440
6446
|
};
|
|
6441
6447
|
queryParams.spatialDataType = spatialDataType;
|
|
6442
6448
|
queryParams.spatialDataColumn = spatialDataColumn;
|
|
@@ -6571,7 +6577,8 @@ var WidgetRemoteSource = class extends WidgetSource {
|
|
|
6571
6577
|
filters: getApplicableFilters(filterOwner, filters || props.filters),
|
|
6572
6578
|
filtersLogicalOperator: props.filtersLogicalOperator,
|
|
6573
6579
|
spatialDataType: props.spatialDataType,
|
|
6574
|
-
spatialDataColumn: props.spatialDataColumn
|
|
6580
|
+
spatialDataColumn: props.spatialDataColumn,
|
|
6581
|
+
tags: props.tags
|
|
6575
6582
|
};
|
|
6576
6583
|
}
|
|
6577
6584
|
async getCategories(options) {
|
|
@@ -8384,7 +8391,8 @@ var query = async function(options) {
|
|
|
8384
8391
|
localCache,
|
|
8385
8392
|
connectionName,
|
|
8386
8393
|
sqlQuery,
|
|
8387
|
-
queryParameters
|
|
8394
|
+
queryParameters,
|
|
8395
|
+
internalParameters
|
|
8388
8396
|
} = options;
|
|
8389
8397
|
const urlParameters = { q: sqlQuery };
|
|
8390
8398
|
if (queryParameters) {
|
|
@@ -8395,7 +8403,12 @@ var query = async function(options) {
|
|
|
8395
8403
|
Authorization: `Bearer ${options.accessToken}`,
|
|
8396
8404
|
...options.headers
|
|
8397
8405
|
};
|
|
8398
|
-
const parameters = {
|
|
8406
|
+
const parameters = {
|
|
8407
|
+
client: clientId,
|
|
8408
|
+
...options.tags,
|
|
8409
|
+
...internalParameters,
|
|
8410
|
+
...urlParameters
|
|
8411
|
+
};
|
|
8399
8412
|
const errorContext = {
|
|
8400
8413
|
requestType: "SQL",
|
|
8401
8414
|
connection: options.connectionName,
|
|
@@ -8408,7 +8421,8 @@ var query = async function(options) {
|
|
|
8408
8421
|
headers,
|
|
8409
8422
|
errorContext,
|
|
8410
8423
|
maxLengthURL,
|
|
8411
|
-
localCache
|
|
8424
|
+
localCache,
|
|
8425
|
+
signal: options.signal
|
|
8412
8426
|
});
|
|
8413
8427
|
};
|
|
8414
8428
|
|