From ec7a2b0f259663bc3285ce7846c1ff399531597a Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Tue, 22 Oct 2024 16:22:43 +0200 Subject: [PATCH] OGC API draft --- .gitignore | 8 +- CHANGELOG.md | 5 + README.md | 8 +- examples/node/discovery.js | 6 +- examples/oidc/openid-connect-popup.html | 4 +- examples/oidc/openid-connect-redirect.html | 4 +- examples/typescript/discovery.ts | 8 +- examples/web/discovery.html | 6 +- examples/web/workflow.html | 6 +- openeo.d.ts | 45 +---- package.json | 10 +- src/basicprovider.js | 2 +- src/builder/builder.js | 2 +- src/builder/node.js | 2 +- src/capabilities.js | 212 ++++++++------------ src/{openeo.js => client.js} | 74 ++++--- src/connection.js | 204 +++---------------- src/const.js | 22 +++ src/filetypes.js | 2 +- src/gdc/capabilities.js | 219 --------------------- src/job.js | 2 +- src/logs.js | 2 +- src/ogc/capabilities.js | 83 ++++++++ src/ogc/connection.js | 121 ++++++++++++ src/{gdc => ogc}/migrate.js | 77 ++++++-- src/{gdc => ogc}/parser.js | 38 +++- src/oidcprovider.js | 2 +- src/openeo/capabilities.js | 168 ++++++++++++++++ src/typedefs.js | 2 +- src/userprocess.js | 2 +- src/utils.js | 70 +++++++ tests/basic.test.js | 4 +- tests/builder.array_create.test.js | 2 +- tests/builder.evi.test.js | 4 +- tests/builder.misc.test.js | 2 +- tests/builder.namespaces.test.js | 2 +- tests/builder.s1.test.js | 2 +- tests/earthengine.test.js | 14 +- tests/eodc.test.js | 6 +- tests/vito.test.js | 4 +- tsconfig.json | 2 +- webpack.config.js | 4 +- 42 files changed, 795 insertions(+), 667 deletions(-) rename src/{openeo.js => client.js} (54%) create mode 100644 src/const.js delete mode 100644 src/gdc/capabilities.js create mode 100644 src/ogc/capabilities.js create mode 100644 src/ogc/connection.js rename src/{gdc => ogc}/migrate.js (71%) rename src/{gdc => ogc}/parser.js (77%) create mode 100644 src/openeo/capabilities.js create mode 100644 src/utils.js diff --git a/.gitignore b/.gitignore index 6173d1f2..815302b6 100644 --- a/.gitignore +++ b/.gitignore @@ -4,10 +4,10 @@ node_modules/ # Build related /report.html -/openeo.js -/openeo.min.js -/openeo.node.js -/openeo.node.min.js +/client.js +/client.min.js +/client.node.js +/client.node.min.js # Reports coverage/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 480e4474..b89b5f9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Class `OpenEO` renamed to `Client` (i.e. use `Client.connect` instead of `OpenEO.connect`) +- Moved `makeLinksAbsolute` and `getLinKHref` to `Utils` class + ## [2.6.0] - 2024-07-11 ### Added diff --git a/README.md b/README.md index 441727b6..de529670 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ To use it in a browser environment simply add the following code to your HTML fi - + ``` ### NodeJS @@ -30,7 +30,7 @@ To install it in a NodeJS environment run: `npm install @openeo/js-client` Afterwards, you can import the package: -`const { OpenEO } = require('@openeo/js-client');` +`const { Client } = require('@openeo/js-client');` ### TypeScript @@ -40,7 +40,7 @@ To install it in a TypeScript environment run: `npm install @openeo/js-client` Afterwards, you can import the package: -`import { OpenEO } from '@openeo/js-client';` +`import { Client } from '@openeo/js-client';` ### Examples @@ -63,7 +63,7 @@ More information can be found in the [documentation](https://open-eo.github.io/o Always make sure to adapt changes in the *.js files to the openeo.d.ts file. If changes are larger you may want to run `npm run tsd` and regenerate the declaration file and cherry-pick your changes from there. -Generate a build: `npm run build` (generates `openeo.js` and `openeo.min.js`) +Generate a build: `npm run build` (generates `client.js` and `client.min.js`) Generate the documentation to the `docs/` folder: `npm run docs` diff --git a/examples/node/discovery.js b/examples/node/discovery.js index 2453287f..ecd7f9cb 100644 --- a/examples/node/discovery.js +++ b/examples/node/discovery.js @@ -1,13 +1,13 @@ // Import the JS client -const { OpenEO } = require('@openeo/js-client'); +const { Client } = require('@openeo/js-client'); const url = "https://earthengine.openeo.org"; // Insert the openEO server URL here let connection = null; console.log('URL: ' + url); -console.log('Client Version: ' + OpenEO.clientVersion()); +console.log('Client Version: ' + Client.clientVersion()); -OpenEO.connect(url) +Client.connect(url) .then(c => { connection = c; return connection.capabilities(); diff --git a/examples/oidc/openid-connect-popup.html b/examples/oidc/openid-connect-popup.html index 652f27f2..38843886 100644 --- a/examples/oidc/openid-connect-popup.html +++ b/examples/oidc/openid-connect-popup.html @@ -7,7 +7,7 @@ - + - + - + - +