@carto/api-client 0.4.7-0 → 0.4.7-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 (90) hide show
  1. package/CHANGELOG.md +17 -1
  2. package/build/api/carto-api-error.d.ts +26 -0
  3. package/build/api/endpoints.d.ts +24 -0
  4. package/build/api/index.d.ts +5 -0
  5. package/build/api/query.d.ts +3 -0
  6. package/build/api/request-with-parameters.d.ts +10 -0
  7. package/build/api-client.cjs +2910 -2741
  8. package/build/api-client.cjs.map +1 -1
  9. package/build/api-client.modern.js +3718 -0
  10. package/build/api-client.modern.js.map +1 -0
  11. package/build/client.d.ts +14 -0
  12. package/build/constants-internal.d.ts +26 -0
  13. package/build/constants.d.ts +53 -0
  14. package/build/deck/get-data-filter-extension-props.d.ts +28 -0
  15. package/build/deck/index.d.ts +1 -0
  16. package/build/filters/Filter.d.ts +25 -0
  17. package/build/filters/FilterTypes.d.ts +3 -0
  18. package/build/filters/geosjonFeatures.d.ts +8 -0
  19. package/build/filters/index.d.ts +6 -0
  20. package/build/filters/tileFeatures.d.ts +20 -0
  21. package/build/filters/tileFeaturesGeometries.d.ts +13 -0
  22. package/build/filters/tileFeaturesSpatialIndex.d.ts +10 -0
  23. package/build/filters.d.ts +39 -0
  24. package/build/geo.d.ts +19 -0
  25. package/build/index.d.ts +16 -0
  26. package/build/models/common.d.ts +28 -0
  27. package/build/models/index.d.ts +3 -0
  28. package/build/models/model.d.ts +37 -0
  29. package/build/operations/aggregation.d.ts +8 -0
  30. package/build/operations/applySorting.d.ts +20 -0
  31. package/build/operations/groupBy.d.ts +15 -0
  32. package/build/operations/groupByDate.d.ts +11 -0
  33. package/build/operations/histogram.d.ts +13 -0
  34. package/build/operations/index.d.ts +6 -0
  35. package/build/operations/scatterPlot.d.ts +14 -0
  36. package/build/sources/base-source.d.ts +4 -0
  37. package/build/sources/boundary-query-source.d.ts +10 -0
  38. package/build/sources/boundary-table-source.d.ts +8 -0
  39. package/build/sources/h3-query-source.d.ts +5 -0
  40. package/build/sources/h3-table-source.d.ts +5 -0
  41. package/build/sources/h3-tileset-source.d.ts +4 -0
  42. package/build/sources/index.d.ts +26 -0
  43. package/build/sources/quadbin-query-source.d.ts +5 -0
  44. package/build/sources/quadbin-table-source.d.ts +5 -0
  45. package/build/sources/quadbin-tileset-source.d.ts +4 -0
  46. package/build/sources/raster-source.d.ts +4 -0
  47. package/build/sources/types.d.ts +366 -0
  48. package/build/sources/vector-query-source.d.ts +5 -0
  49. package/build/sources/vector-table-source.d.ts +5 -0
  50. package/build/sources/vector-tileset-source.d.ts +4 -0
  51. package/build/spatial-index.d.ts +14 -0
  52. package/build/types-internal.d.ts +56 -0
  53. package/build/types.d.ts +140 -0
  54. package/build/utils/dateUtils.d.ts +10 -0
  55. package/build/utils/getTileFormat.d.ts +3 -0
  56. package/build/utils/makeIntervalComplete.d.ts +2 -0
  57. package/build/utils/transformTileCoordsToWGS84.d.ts +8 -0
  58. package/build/utils/transformToTileCoords.d.ts +9 -0
  59. package/build/utils.d.ts +32 -0
  60. package/build/widget-sources/index.d.ts +6 -0
  61. package/build/widget-sources/types.d.ts +162 -0
  62. package/build/widget-sources/widget-query-source.d.ts +34 -0
  63. package/build/widget-sources/widget-remote-source.d.ts +18 -0
  64. package/build/widget-sources/widget-source.d.ts +74 -0
  65. package/build/widget-sources/widget-table-source.d.ts +34 -0
  66. package/build/widget-sources/widget-tileset-source.d.ts +75 -0
  67. package/package.json +18 -19
  68. package/src/constants-internal.ts +6 -0
  69. package/src/deck/get-data-filter-extension-props.ts +27 -9
  70. package/src/filters/tileFeatures.ts +0 -1
  71. package/src/global.d.ts +8 -3
  72. package/src/sources/h3-tileset-source.ts +6 -18
  73. package/src/sources/quadbin-tileset-source.ts +6 -18
  74. package/src/sources/types.ts +0 -6
  75. package/src/sources/vector-tileset-source.ts +6 -19
  76. package/src/widget-sources/types.ts +2 -0
  77. package/src/widget-sources/widget-remote-source.ts +16 -42
  78. package/src/widget-sources/widget-source.ts +40 -12
  79. package/src/widget-sources/widget-tileset-source.ts +341 -196
  80. package/build/api-client.d.cts +0 -1389
  81. package/build/api-client.d.ts +0 -1389
  82. package/build/api-client.js +0 -3676
  83. package/build/api-client.js.map +0 -1
  84. package/build/worker.d.ts +0 -2
  85. package/build/worker.js +0 -1949
  86. package/build/worker.js.map +0 -1
  87. package/src/widget-sources/widget-tileset-source-impl.ts +0 -417
  88. package/src/workers/constants.ts +0 -13
  89. package/src/workers/types.ts +0 -19
  90. package/src/workers/widget-tileset-worker.ts +0 -40
package/CHANGELOG.md CHANGED
@@ -1,9 +1,25 @@
1
1
  # CHANGELOG
2
2
 
3
- ## Not released
3
+ ## 0.5 (Unreleased)
4
+
5
+ ### 0.5.0 (Unreleased)
6
+
7
+ - BREAKING CHANGE: Replace 'abortController' with 'signal' parameter (#110)
8
+ - feat: Add widget calculations for tileset sources (#50)
9
+ - feat: Add widget calculations for raster sources (#119)
10
+ - feat: Enable Web Workers for local tileset and raster widget calculations (#119)
4
11
 
5
12
  ## 0.4
6
13
 
14
+ ### 0.4.7
15
+
16
+ - fix: Fix clientId customization in table and query widget calls (#120)
17
+ - feat: Add getDataFilterExtensionProps (#105, #113)
18
+ - feat: Add option to override HTTP headers in widget calls (#100, #111)
19
+ - feat: Add filters parameter in widget calls (#103)
20
+ - chore: Update to turf.js v7.2 (#98)
21
+ - chore: Enable compatibility with moduleResolution=nodenext (#106)
22
+
7
23
  ### 0.4.6
8
24
 
9
25
  - chore: Add repository and homepage in npm package metadata
@@ -0,0 +1,26 @@
1
+ import { MapType } from '../types.js';
2
+ export type APIRequestType = 'Map data' | 'Map instantiation' | 'Public map' | 'Tile stats' | 'SQL' | 'Basemap style';
3
+ export type APIErrorContext = {
4
+ requestType: APIRequestType;
5
+ mapId?: string;
6
+ connection?: string;
7
+ source?: string;
8
+ type?: MapType;
9
+ };
10
+ /**
11
+ *
12
+ * Custom error for reported errors in CARTO Maps API.
13
+ * Provides useful debugging information in console and context for applications.
14
+ *
15
+ */
16
+ export declare class CartoAPIError extends Error {
17
+ /** Source error from server */
18
+ error: Error;
19
+ /** Context (API call & parameters) in which error occured */
20
+ errorContext: APIErrorContext;
21
+ /** Response from server */
22
+ response?: Response;
23
+ /** JSON Response from server */
24
+ responseJson?: any;
25
+ constructor(error: Error, errorContext: APIErrorContext, response?: Response, responseJson?: any);
26
+ }
@@ -0,0 +1,24 @@
1
+ import { MapType } from '../types.js';
2
+ export type V3Endpoint = 'maps' | 'stats' | 'sql';
3
+ /** @internal Required by fetchMap(). */
4
+ export declare function buildPublicMapUrl({ apiBaseUrl, cartoMapId, }: {
5
+ apiBaseUrl: string;
6
+ cartoMapId: string;
7
+ }): string;
8
+ /** @internal Required by fetchMap(). */
9
+ export declare function buildStatsUrl({ attribute, apiBaseUrl, connectionName, source, type, }: {
10
+ attribute: string;
11
+ apiBaseUrl: string;
12
+ connectionName: string;
13
+ source: string;
14
+ type: MapType;
15
+ }): string;
16
+ export declare function buildSourceUrl({ apiBaseUrl, connectionName, endpoint, }: {
17
+ apiBaseUrl: string;
18
+ connectionName: string;
19
+ endpoint: MapType;
20
+ }): string;
21
+ export declare function buildQueryUrl({ apiBaseUrl, connectionName, }: {
22
+ apiBaseUrl: string;
23
+ connectionName: string;
24
+ }): string;
@@ -0,0 +1,5 @@
1
+ export { CartoAPIError, APIErrorContext, APIRequestType, } from './carto-api-error.js';
2
+ export { buildPublicMapUrl, buildStatsUrl } from './endpoints.js';
3
+ export { query } from './query.js';
4
+ export type { QueryOptions } from './query.js';
5
+ export { requestWithParameters } from './request-with-parameters.js';
@@ -0,0 +1,3 @@
1
+ import type { SourceOptions, QuerySourceOptions, QueryResult } from '../sources/types.js';
2
+ export type QueryOptions = SourceOptions & QuerySourceOptions;
3
+ export declare const query: (options: QueryOptions) => Promise<QueryResult>;
@@ -0,0 +1,10 @@
1
+ import { APIErrorContext } from './carto-api-error.js';
2
+ import { LocalCacheOptions } from '../sources/types.js';
3
+ export declare function requestWithParameters<T = any>({ baseUrl, parameters, headers: customHeaders, errorContext, maxLengthURL, localCache, }: {
4
+ baseUrl: string;
5
+ parameters?: Record<string, unknown>;
6
+ headers?: Record<string, string>;
7
+ errorContext: APIErrorContext;
8
+ maxLengthURL?: number;
9
+ localCache?: LocalCacheOptions;
10
+ }): Promise<T>;