- 
                Notifications
    You must be signed in to change notification settings 
- Fork 0
clay/geoviz updates #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Closed
      
      
    
  
     Closed
                    Changes from 4 commits
      Commits
    
    
            Show all changes
          
          
            7 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      565ce70
              
                fix: return error message
              
              
                ClayMav 8d995e4
              
                chore: switch to cbor-x, for web support
              
              
                ClayMav b2b8e1a
              
                chore: switch to isomorphic-ws, for web support
              
              
                ClayMav b960cfd
              
                chore: switch to loglevel, for web support
              
              
                ClayMav 9fa9248
              
                chore: last changes from hackathon
              
              
                ClayMav 4fc2db7
              
                fix: format, examples use npx now, remove type module
              
              
                ClayMav 15acbed
              
                fix: format package.json
              
              
                ClayMav File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -1,25 +1,29 @@ | ||
| { | ||
| "extends": [ | ||
| "plugin:@typescript-eslint/recommended", | ||
| "plugin:prettier/recommended", | ||
| "plugin:node/recommended", | ||
| "plugin:security/recommended-legacy" | ||
| ], | ||
| "rules": { | ||
| "node/no-unsupported-features/es-syntax": "off", | ||
| // no-missing-import gets confused by typescript `paths` | ||
| "node/no-missing-import": "off", | ||
| "@typescript-eslint/no-unused-vars": [ | ||
| "error", | ||
| { | ||
| "ignoreRestSiblings": true | ||
| } | ||
| "extends": [ | ||
| "plugin:@typescript-eslint/recommended", | ||
| "plugin:prettier/recommended", | ||
| "plugin:node/recommended", | ||
| "plugin:security/recommended-legacy" | ||
| ], | ||
| "node/no-unpublished-import": [ | ||
| "error", | ||
| { | ||
| "allowModules": ["vitest", "vitest-fetch-mock"] | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| "rules": { | ||
| "node/no-unsupported-features/es-syntax": "off", | ||
| // no-missing-import gets confused by typescript `paths` | ||
| "node/no-missing-import": "off", | ||
| "@typescript-eslint/no-unused-vars": [ | ||
| "error", | ||
| { | ||
| "ignoreRestSiblings": true | ||
| } | ||
| ], | ||
| "node/no-unpublished-import": [ | ||
| "error", | ||
| { | ||
| "allowModules": [ | ||
| "vitest", | ||
| "vitest-fetch-mock" | ||
| ] | ||
| } | ||
| ], | ||
| "@typescript-eslint/no-explicit-any": "warn" | ||
| } | ||
| } | 
Large diffs are not rendered by default.
      
      Oops, something went wrong.
      
    
  
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -1,68 +1,65 @@ | ||
| { | ||
| "name": "wherobots-sql-driver", | ||
| "version": "0.4.2", | ||
| "description": "TypeScript SDK for Wherobots DB", | ||
| "license": "Apache-2.0", | ||
| "main": "dist/src/index.js", | ||
| "keywords": [ | ||
| "wherobots", | ||
| "sedona", | ||
| "geospatial", | ||
| "spatial sql" | ||
| ], | ||
| "homepage": "https://github.com/wherobots/wherobots-typescript-sdk", | ||
| "bugs": "https://github.com/wherobots/wherobots-typescript-sdk/issues", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/wherobots/wherobots-typescript-sdk" | ||
| }, | ||
| "engines": { | ||
| "node": ">=18.0.0" | ||
| }, | ||
| "scripts": { | ||
| "build": "tsc", | ||
| "build:check": "tsc --noEmit", | ||
| "lint": "eslint .", | ||
| "lint:fix": "eslint . --fix", | ||
| "format": "prettier --check .", | ||
| "format:fix": "prettier --write .", | ||
| "prepare": "husky", | ||
| "prepublish": "npm run build", | ||
| "test": "vitest" | ||
| }, | ||
| "devDependencies": { | ||
| "@commitlint/cli": "^19.4.0", | ||
| "@commitlint/config-conventional": "^19.2.2", | ||
| "@swc-node/register": "^1.10.9", | ||
| "@tsconfig/node-lts": "^20.1.3", | ||
| "@tsconfig/strictest": "^2.0.5", | ||
| "@types/uuid": "^10.0.0", | ||
| "@types/ws": "^8.5.12", | ||
| "@typescript-eslint/eslint-plugin": "^7.18.0", | ||
| "@typescript-eslint/parser": "^7.18.0", | ||
| "eslint": "^8.57.0", | ||
| "eslint-config-airbnb": "^19.0.4", | ||
| "eslint-config-airbnb-typescript": "^18.0.0", | ||
| "eslint-config-prettier": "^9.1.0", | ||
| "eslint-plugin-node": "^11.1.0", | ||
| "eslint-plugin-prettier": "^5.2.1", | ||
| "eslint-plugin-security": "^3.0.1", | ||
| "husky": "^9.1.4", | ||
| "lint-staged": "^15.2.9", | ||
| "prettier": "^3.3.3", | ||
| "typescript": "^5.5.4", | ||
| "vitest": "^3.0.5", | ||
| "vitest-fetch-mock": "^0.3.0" | ||
| }, | ||
| "dependencies": { | ||
| "apache-arrow": "^17.0.0", | ||
| "bufferutil": "^4.0.8", | ||
| "cbor": "^9.0.2", | ||
| "pino": "^9.3.2", | ||
| "pino-pretty": "^11.2.2", | ||
| "read-pkg-up": "^7.0.0", | ||
| "uuid": "^10.0.0", | ||
| "ws": "^8.18.0", | ||
| "zod": "^3.23.8" | ||
| } | ||
| "name": "wherobots-sql-driver", | ||
| "version": "0.4.2", | ||
| "description": "TypeScript SDK for Wherobots DB", | ||
| "license": "Apache-2.0", | ||
| "main": "dist/src/index.js", | ||
| "type": "module", | ||
| "keywords": [ | ||
| "wherobots", | ||
| "sedona", | ||
| "geospatial", | ||
| "spatial sql" | ||
| ], | ||
| "homepage": "https://github.com/wherobots/wherobots-typescript-sdk", | ||
| "bugs": "https://github.com/wherobots/wherobots-typescript-sdk/issues", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/wherobots/wherobots-typescript-sdk" | ||
| }, | ||
| "engines": { | ||
| "node": ">=18.0.0" | ||
| }, | ||
| "scripts": { | ||
| "build": "tsc", | ||
| "build:check": "tsc --noEmit", | ||
| "lint": "eslint .", | ||
| "lint:fix": "eslint . --fix", | ||
| "format": "prettier --check .", | ||
| "format:fix": "prettier --write .", | ||
| "prepare": "husky", | ||
| "prepublish": "npm run build", | ||
| "test": "vitest" | ||
| }, | ||
| "devDependencies": { | ||
| "@commitlint/cli": "^19.4.0", | ||
| "@commitlint/config-conventional": "^19.2.2", | ||
| "@swc-node/register": "^1.10.9", | ||
| "@tsconfig/node-lts": "^20.1.3", | ||
| "@tsconfig/strictest": "^2.0.5", | ||
| "@types/uuid": "^10.0.0", | ||
| "@typescript-eslint/eslint-plugin": "^7.18.0", | ||
| "@typescript-eslint/parser": "^7.18.0", | ||
| "eslint": "^8.57.0", | ||
| "eslint-config-airbnb": "^19.0.4", | ||
| "eslint-config-airbnb-typescript": "^18.0.0", | ||
| "eslint-config-prettier": "^9.1.0", | ||
| "eslint-plugin-node": "^11.1.0", | ||
| "eslint-plugin-prettier": "^5.2.1", | ||
| "eslint-plugin-security": "^3.0.1", | ||
| "husky": "^9.1.4", | ||
| "lint-staged": "^15.2.9", | ||
| "prettier": "^3.3.3", | ||
| "typescript": "^5.5.4", | ||
| "vitest": "^3.0.5", | ||
| "vitest-fetch-mock": "^0.3.0" | ||
| }, | ||
| "dependencies": { | ||
| "apache-arrow": "^17.0.0", | ||
| "cbor-x": "^1.6.0", | ||
| "isomorphic-ws": "^5.0.0", | ||
| "loglevel": "^1.9.2", | ||
| "uuid": "^10.0.0", | ||
| "zod": "^3.23.8" | ||
| } | ||
| } | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| import { decodeFirstSync } from "cbor"; | ||
| import { decode } from "cbor-x"; | ||
| import * as uuid from "uuid"; | ||
| import WebSocket from "ws"; | ||
| import WebSocket from "isomorphic-ws"; | ||
| import logger, { sessionContextLogger } from "./logger"; | ||
| import { | ||
| CancelExecutionEvent, | ||
|  | @@ -30,7 +30,6 @@ import { | |
| } from "./api-utils"; | ||
| import z from "zod"; | ||
| import { Table, TypeMap } from "apache-arrow"; | ||
| import readPackageUp from "read-pkg-up"; | ||
|  | ||
| // used to mock out the fetch and WebSocket APIs | ||
| // in a unit testing environment | ||
|  | @@ -46,14 +45,13 @@ type ConnectionTestHarness = { | |
| protocolVersion?: string | undefined; | ||
| }; | ||
|  | ||
| const { packageJson } = readPackageUp.sync({ cwd: __dirname }) || {}; | ||
| const API_URL = | ||
| process.env["WHEROBOTS_API_URL"] || "https://api.cloud.wherobots.com"; | ||
|  | ||
| const PROTOCOL_VERSION = "1.0.0"; | ||
| const OS_TYPE = `${process.platform};${process.arch}`; | ||
| const NODE_VERSION = process.version; | ||
| const USER_AGENT = `${packageJson?.name}/${packageJson?.version} os/${OS_TYPE} node/${NODE_VERSION}"`; | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i'd rather not lose the package version from the user agent string. is there a way we can inject this as a build-time variable? | ||
| const USER_AGENT = `os/${OS_TYPE} node/${NODE_VERSION}`; | ||
|  | ||
| const API_REQUEST_TIMEOUT = 10e3; | ||
|  | ||
|  | @@ -348,16 +346,28 @@ export class Connection { | |
| logger.child(errorEvent).error("Error event received"); | ||
| cleanup(); | ||
| abortSignal.removeEventListener("abort", handleSignalAborted); | ||
| reject(new Error("Error event received")); | ||
| reject(new Error(errorEvent.message)); | ||
| } | ||
| } | ||
| let toParse: unknown; | ||
| if (typeof e.data === "string") { | ||
| toParse = JSON.parse(e.data); | ||
| } else if (Array.isArray(e.data)) { | ||
| toParse = decodeFirstSync(Buffer.concat(e.data)); | ||
| const uint8ArrayArray = e.data.map( | ||
| (buffer) => | ||
| new Uint8Array( | ||
| buffer.buffer, | ||
| buffer.byteOffset, | ||
| buffer.byteLength, | ||
| ), | ||
| ); | ||
| toParse = decode(Buffer.concat(uint8ArrayArray)); | ||
| } else { | ||
| toParse = decodeFirstSync(e.data); | ||
| toParse = decode( | ||
| e.data instanceof Buffer | ||
| ? e.data | ||
| : new Uint8Array(e.data as ArrayBuffer), | ||
| ); | ||
| } | ||
| const data = schema.parse(toParse); | ||
| if (data["execution_id"] === executionId) { | ||
|  | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is
"type": "module"necessary? it breaks the running of the example scripts (e.g.node -r @swc-node/register examples/connectionWithDefaults.ts)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I needed to use it to be esm compatible for one of the packages. Will see if I can remove it. Also, I recommend we use npx for this so I have now replaced the command with npx tsx examples/connectionWithDefaults.ts (tsx runs ts files)