Skip to content

Commit 689944b

Browse files
committed
Removed deprecated method getResultsAsItem in favor of getResultsAsStac, clean-up
1 parent 1bbd32a commit 689944b

File tree

4 files changed

+10
-54
lines changed

4 files changed

+10
-54
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818
- OpenID Connect authentication has been rewritten.
1919
- Default grant type for OpenID Connect is "AuthCode w/ PKCE" instead of "Implicit".
2020
- Support for OpenID Connect session renewal via refresh tokens.
21+
- Updated STAC support to STAC v1.0.0.
2122

2223
### Removed
2324

2425
- `OidcProvider`: Methods `getGrant`, `getScopes`, `getIssuer` and `getUser` removed. Use the properties `grant`, `scopes`, `issuer` and `user` instead.
26+
- Removed deprecated method `getResultsAsItem` in favor of `getResultsAsStac`.
2527

2628
## [1.3.2] - 2021-05-27
2729

openeo.d.ts

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -933,21 +933,10 @@ declare module OpenEO {
933933
* @throws {Error}
934934
*/
935935
stopJob(): Promise<Job>;
936-
/**
937-
* Retrieves the STAC Item produced for the job results.
938-
*
939-
* The Item returned always complies to the latest STAC version (currently 1.0.0-rc.1).
940-
*
941-
* @async
942-
* @returns {Promise<object.<string, *>>} The JSON-based response compatible to the API specification, but also including a `costs` property if present in the headers.
943-
* @throws {Error}
944-
* @deprecated
945-
*/
946-
getResultsAsItem(): Promise<any>;
947936
/**
948937
* Retrieves the STAC Item or Collection produced for the job results.
949938
*
950-
* The Item or Collection returned always complies to the latest STAC version (currently 1.0.0-rc.1).
939+
* The Item or Collection returned always complies to the latest STAC version (currently 1.0.0).
951940
*
952941
* @async
953942
* @returns {Promise<object.<string, *>>} The JSON-based response compatible to the API specification, but also including a `costs` property if present in the headers.
@@ -1839,7 +1828,7 @@ declare module OpenEO {
18391828
/**
18401829
* List all collections available on the back-end.
18411830
*
1842-
* The collections returned always comply to the latest STAC version (currently 1.0.0-rc.1).
1831+
* The collections returned always comply to the latest STAC version (currently 1.0.0).
18431832
*
18441833
* @async
18451834
* @returns {Promise<Collections>} A response compatible to the API specification.
@@ -1849,7 +1838,7 @@ declare module OpenEO {
18491838
/**
18501839
* Get further information about a single collection.
18511840
*
1852-
* The collection returned always complies to the latest STAC version (currently 1.0.0-rc.1).
1841+
* The collection returned always complies to the latest STAC version (currently 1.0.0).
18531842
*
18541843
* @async
18551844
* @param {string} collectionId - Collection ID to request further metadata for.
@@ -1861,7 +1850,7 @@ declare module OpenEO {
18611850
* Loads items for a specific image collection.
18621851
* May not be available for all collections.
18631852
*
1864-
* The items returned always comply to the latest STAC version (currently 1.0.0-rc.1).
1853+
* The items returned always comply to the latest STAC version (currently 1.0.0).
18651854
*
18661855
* This is an experimental API and is subject to change.
18671856
*

src/connection.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class Connection {
117117
/**
118118
* List all collections available on the back-end.
119119
*
120-
* The collections returned always comply to the latest STAC version (currently 1.0.0-rc.1).
120+
* The collections returned always comply to the latest STAC version (currently 1.0.0).
121121
*
122122
* @async
123123
* @returns {Promise<Collections>} A response compatible to the API specification.
@@ -134,7 +134,7 @@ class Connection {
134134
/**
135135
* Get further information about a single collection.
136136
*
137-
* The collection returned always complies to the latest STAC version (currently 1.0.0-rc.1).
137+
* The collection returned always complies to the latest STAC version (currently 1.0.0).
138138
*
139139
* @async
140140
* @param {string} collectionId - Collection ID to request further metadata for.
@@ -150,7 +150,7 @@ class Connection {
150150
* Loads items for a specific image collection.
151151
* May not be available for all collections.
152152
*
153-
* The items returned always comply to the latest STAC version (currently 1.0.0-rc.1).
153+
* The items returned always comply to the latest STAC version (currently 1.0.0).
154154
*
155155
* This is an experimental API and is subject to change.
156156
*

src/job.js

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -254,45 +254,10 @@ class Job extends BaseEntity {
254254
return this;
255255
}
256256

257-
/**
258-
* Retrieves the STAC Item produced for the job results.
259-
*
260-
* The Item returned always complies to the latest STAC version (currently 1.0.0-rc.1).
261-
*
262-
* @async
263-
* @returns {Promise<object.<string, *>>} The JSON-based response compatible to the API specification, but also including a `costs` property if present in the headers.
264-
* @throws {Error}
265-
* @deprecated
266-
*/
267-
async getResultsAsItem() {
268-
let data = await this.getResultsAsStac();
269-
if (data.type === 'Feature') { // Item
270-
return data;
271-
}
272-
else { // We got a Collection, try to make a minimal Item from it for backward-compatibility
273-
let item = Utils.pickFromObject(data, ['stac_version', 'id', 'assets', 'links']);
274-
item.type = 'Feature';
275-
item.geometry = null;
276-
item.properties = Utils.pickFromObject(data, ['title', 'description', 'license', 'providers', 'created', 'updated', 'expires', 'costs']);
277-
item.properties.datetime = null;
278-
if (Utils.isObject(data.extent) && Utils.isObject(data.extent.temporal) && Array.isArray(data.extent.temporal.interval) && Array.isArray(data.extent.temporal.interval[0])) {
279-
let temp = data.extent.temporal.interval[0];
280-
if (typeof temp[0] === 'string' && temp[1] === 'string') {
281-
item.properties.start_datetime = temp[0];
282-
item.properties.end_datetime = temp[1];
283-
}
284-
else {
285-
item.properties.datetime = temp[0] || temp[1];
286-
}
287-
}
288-
return StacMigrate.item(item);
289-
}
290-
}
291-
292257
/**
293258
* Retrieves the STAC Item or Collection produced for the job results.
294259
*
295-
* The Item or Collection returned always complies to the latest STAC version (currently 1.0.0-rc.1).
260+
* The Item or Collection returned always complies to the latest STAC version (currently 1.0.0).
296261
*
297262
* @async
298263
* @returns {Promise<object.<string, *>>} The JSON-based response compatible to the API specification, but also including a `costs` property if present in the headers.

0 commit comments

Comments
 (0)