@kepler.gl/processors 3.3.0-alpha.1 → 3.3.0-alpha.11

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.
@@ -0,0 +1,76 @@
1
+ import { ProcessorResult } from '@kepler.gl/types';
2
+ export type KeplerRemoteFile = File & {
3
+ keplerSourceUrl?: string;
4
+ keplerFormat?: string;
5
+ keplerRefreshIntervalMs?: number;
6
+ keplerEtag?: string;
7
+ keplerLastModified?: string;
8
+ };
9
+ export type FetchRemoteFileOptions = {
10
+ format?: string | null;
11
+ onProgress?: (progress: {
12
+ loaded: number;
13
+ total?: number;
14
+ percent: number;
15
+ }) => void;
16
+ etag?: string;
17
+ lastModified?: string;
18
+ /** Bypass the HTTP cache. Used for poll/reload, not the first remote URL load. */
19
+ bypassCache?: boolean;
20
+ };
21
+ export type FetchRemoteFileResult = {
22
+ file: KeplerRemoteFile | null;
23
+ notModified: boolean;
24
+ etag?: string;
25
+ lastModified?: string;
26
+ size?: number;
27
+ };
28
+ export type LoadExternallyHostedDatasetResult = {
29
+ data: NonNullable<ProcessorResult> | null;
30
+ notModified: boolean;
31
+ etag?: string;
32
+ lastModified?: string;
33
+ size?: number;
34
+ };
35
+ export declare function getExtensionFromUrl(url: string): string;
36
+ export declare function getMimeTypeForFormat(format?: string | null): string | undefined;
37
+ export declare function isRemoteDatasetUrl(url: string): boolean;
38
+ /**
39
+ * Build a filename loaders.gl can use to pick a parser.
40
+ * Prefers an explicit format, then the URL path extension, then Content-Type.
41
+ */
42
+ export declare function getFileNameForRemoteUrl(url: string, format?: string | null, mimeType?: string | null): string;
43
+ /**
44
+ * Fetch a remote dataset URL. Honors If-None-Match / If-Modified-Since when etag
45
+ * or lastModified are provided so unchanged files can skip a re-parse.
46
+ */
47
+ export declare function fetchRemoteFile(url: string, options?: FetchRemoteFileOptions): Promise<FetchRemoteFileResult>;
48
+ /**
49
+ * Fetch a remote dataset URL and wrap it as a File the existing loadFiles pipeline can parse.
50
+ * Sets File.type from an explicit format or the response Content-Type so extensionless
51
+ * URLs (SAS keys) still select the right loader.
52
+ */
53
+ export declare function fetchRemoteFileAsKeplerFile(url: string, format?: string | null, onProgress?: (progress: {
54
+ loaded: number;
55
+ total?: number;
56
+ percent: number;
57
+ }) => void): Promise<KeplerRemoteFile>;
58
+ /**
59
+ * Fetch, parse, and process a remote file into Kepler dataset data.
60
+ * Used when reloading an `externally-hosted` dataset from a saved map config
61
+ * and when refreshing a live remote dataset.
62
+ */
63
+ export declare function loadExternallyHostedDataset(metadata: {
64
+ source: string;
65
+ format?: string;
66
+ size?: number;
67
+ etag?: string;
68
+ lastModified?: string;
69
+ bypassCache?: boolean;
70
+ onProgress?: (progress: {
71
+ loaded: number;
72
+ total?: number;
73
+ percent: number;
74
+ }) => void;
75
+ }): Promise<LoadExternallyHostedDatasetResult>;
76
+ export declare function isExternallyHostedFile(file: File): file is KeplerRemoteFile;
package/dist/types.d.ts CHANGED
@@ -4,6 +4,13 @@ export type FileCacheItem = {
4
4
  id?: string;
5
5
  label: string;
6
6
  format: string;
7
+ type?: string;
8
+ };
9
+ metadata?: {
10
+ source?: string;
11
+ format?: string;
12
+ sourceFormat?: string;
13
+ [key: string]: unknown;
7
14
  };
8
15
  };
9
16
  export type ValidKeplerGlMap = {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@kepler.gl/processors",
3
3
  "author": "Shan He <shan@uber.com>",
4
- "version": "3.3.0-alpha.1",
4
+ "version": "3.3.0-alpha.11",
5
5
  "description": "kepler.gl constants used by kepler.gl components, actions and reducers",
6
6
  "license": "MIT",
7
- "main": "dist/index.js",
7
+ "main": "dist/cjs/index.js",
8
8
  "types": "dist/index.d.ts",
9
9
  "keywords": [
10
10
  "babel",
@@ -19,35 +19,34 @@
19
19
  "url": "https://github.com/keplergl/kepler.gl.git"
20
20
  },
21
21
  "scripts": {
22
- "build": "rm -fr dist && babel src --out-dir dist --source-maps inline --extensions '.ts,.tsx,.js,.jsx' --ignore '**/*.d.ts'",
23
- "build:umd": "NODE_OPTIONS=--openssl-legacy-provider webpack --config ./webpack/umd.js --progress --env.prod",
22
+ "build": "rm -fr dist && babel src --out-dir dist/cjs --source-maps inline --extensions '.ts,.tsx,.js,.jsx' --ignore '**/*.d.ts' && BABEL_ENV=esm babel src --out-dir dist/esm --source-maps inline --extensions '.ts,.tsx,.js,.jsx' --ignore '**/*.d.ts'",
24
23
  "build:types": "tsc --project ./tsconfig.production.json",
25
24
  "prepublishOnly": "babel-node ../../scripts/license-header/bin --license ../../FILE-HEADER && yarn build && yarn build:types",
26
- "stab": "mkdir -p dist && touch dist/index.js"
25
+ "stab": "mkdir -p dist/cjs dist/esm && touch dist/cjs/index.js dist/esm/index.js"
27
26
  },
28
27
  "files": [
29
- "dist",
30
- "umd"
28
+ "dist"
31
29
  ],
32
30
  "dependencies": {
33
- "@deck.gl-community/editable-layers": "9.2.8",
34
- "@kepler.gl/common-utils": "3.3.0-alpha.1",
35
- "@kepler.gl/constants": "3.3.0-alpha.1",
36
- "@kepler.gl/schemas": "3.3.0-alpha.1",
37
- "@kepler.gl/table": "3.3.0-alpha.1",
38
- "@kepler.gl/types": "3.3.0-alpha.1",
39
- "@kepler.gl/utils": "3.3.0-alpha.1",
31
+ "@deck.gl-community/editable-layers": "9.3.8",
32
+ "@kepler.gl/common-utils": "3.3.0-alpha.11",
33
+ "@kepler.gl/constants": "3.3.0-alpha.11",
34
+ "@kepler.gl/schemas": "3.3.0-alpha.11",
35
+ "@kepler.gl/table": "3.3.0-alpha.11",
36
+ "@kepler.gl/types": "3.3.0-alpha.11",
37
+ "@kepler.gl/utils": "3.3.0-alpha.11",
40
38
  "@loaders.gl/arrow": "^4.4.1",
41
39
  "@loaders.gl/core": "^4.4.1",
42
40
  "@loaders.gl/csv": "^4.4.1",
43
41
  "@loaders.gl/gis": "^4.4.1",
44
42
  "@loaders.gl/json": "^4.4.1",
43
+ "@loaders.gl/kml": "^4.4.1",
45
44
  "@loaders.gl/loader-utils": "^4.4.1",
46
45
  "@loaders.gl/parquet": "^4.4.1",
47
46
  "@loaders.gl/schema": "^4.4.1",
48
47
  "@loaders.gl/wkt": "^4.4.1",
49
48
  "@mapbox/geojson-normalize": "0.0.1",
50
- "@turf/helpers": "^6.1.4",
49
+ "@turf/helpers": "^7.2.0",
51
50
  "apache-arrow": ">=15.0.0",
52
51
  "d3-dsv": "^2.0.0",
53
52
  "type-analyzer": "0.4.0"
@@ -69,5 +68,14 @@
69
68
  "node": "20.19.3",
70
69
  "yarn": "4.4.0"
71
70
  },
72
- "packageManager": "yarn@4.4.0"
71
+ "packageManager": "yarn@4.4.0",
72
+ "module": "dist/esm/index.js",
73
+ "exports": {
74
+ ".": {
75
+ "types": "./dist/index.d.ts",
76
+ "import": "./dist/esm/index.js",
77
+ "require": "./dist/cjs/index.js",
78
+ "default": "./dist/cjs/index.js"
79
+ }
80
+ }
73
81
  }