@openeo/js-client 2.5.1 → 2.7.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.
- package/LICENSE +201 -201
- package/README.md +94 -84
- package/openeo.d.ts +310 -72
- package/openeo.js +5412 -5191
- package/openeo.min.js +1 -1
- package/package.json +72 -70
- package/src/authprovider.js +147 -138
- package/src/baseentity.js +162 -162
- package/src/basicprovider.js +69 -48
- package/src/browser.js +168 -168
- package/src/builder/builder.js +400 -400
- package/src/builder/formula.js +211 -211
- package/src/builder/node.js +268 -268
- package/src/builder/parameter.js +144 -144
- package/src/builder/tapdigit.js +489 -489
- package/src/capabilities.js +274 -220
- package/src/connection.js +1290 -1211
- package/src/env.js +16 -6
- package/src/filetypes.js +111 -111
- package/src/job.js +323 -322
- package/src/logs.js +109 -68
- package/src/node.js +168 -168
- package/src/oidcprovider.js +387 -375
- package/src/openeo.js +137 -138
- package/src/pages.js +349 -0
- package/src/service.js +222 -221
- package/src/typedefs.js +271 -243
- package/src/userfile.js +128 -128
- package/src/userprocess.js +166 -166
package/src/env.js
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
let Environment = null;
|
|
2
|
+
if (typeof window === 'undefined') {
|
|
3
|
+
Environment = require('./node');
|
|
4
|
+
}
|
|
5
|
+
else {
|
|
6
|
+
Environment = require('./browser');
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The axios instance to use for HTTP requests.
|
|
10
|
+
*
|
|
11
|
+
* @type {object}
|
|
12
|
+
* @static
|
|
13
|
+
*/
|
|
14
|
+
Environment.axios = require('axios');
|
|
15
|
+
|
|
16
|
+
module.exports = Environment;
|
package/src/filetypes.js
CHANGED
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
const Utils = require('@openeo/js-commons/src/utils');
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Manages the files types supported by the back-end.
|
|
5
|
-
*/
|
|
6
|
-
class FileTypes {
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Creates a new FileTypes object from an API-compatible JSON response.
|
|
10
|
-
*
|
|
11
|
-
* @param {FileTypesAPI} data - A capabilities response compatible to the API specification for `GET /file_formats`.
|
|
12
|
-
*/
|
|
13
|
-
constructor(data) {
|
|
14
|
-
/**
|
|
15
|
-
* @protected
|
|
16
|
-
* @type {FileTypesAPI}
|
|
17
|
-
*/
|
|
18
|
-
this.data = {
|
|
19
|
-
input: {},
|
|
20
|
-
output: {}
|
|
21
|
-
};
|
|
22
|
-
if(!Utils.isObject(data)) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
for(let io of ['input', 'output']) {
|
|
26
|
-
for(let type in data[io]) {
|
|
27
|
-
if(!Utils.isObject(data[io])) {
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
30
|
-
this.data[io][type.toUpperCase()] = data[io][type];
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* A list of backends from the federation that are missing in the response data.
|
|
35
|
-
*
|
|
36
|
-
* @public
|
|
37
|
-
* @type {Array.<string>}
|
|
38
|
-
*/
|
|
39
|
-
this['federation:missing'] = data['federation:missing'];
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Returns the file types response as a JSON serializable representation of the data that is API compliant.
|
|
44
|
-
*
|
|
45
|
-
* @returns {FileTypesAPI}
|
|
46
|
-
*/
|
|
47
|
-
toJSON() {
|
|
48
|
-
return this.data;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Returns the input file formats.
|
|
53
|
-
*
|
|
54
|
-
* @returns {object.<string, FileType>}
|
|
55
|
-
*/
|
|
56
|
-
getInputTypes() {
|
|
57
|
-
return this.data.input;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Returns the output file formats.
|
|
62
|
-
*
|
|
63
|
-
* @returns {object.<string, FileType>}
|
|
64
|
-
*/
|
|
65
|
-
getOutputTypes() {
|
|
66
|
-
return this.data.output;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Returns a single input file format for a given identifier.
|
|
71
|
-
*
|
|
72
|
-
* Returns null if no input file format was found for the given identifier.
|
|
73
|
-
*
|
|
74
|
-
* @param {string} type - Case-insensitive file format identifier
|
|
75
|
-
* @returns {FileType | null}
|
|
76
|
-
*/
|
|
77
|
-
getInputType(type) {
|
|
78
|
-
return this._findType(type, 'input');
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Returns a single output file format for a given identifier.
|
|
83
|
-
*
|
|
84
|
-
* Returns null if no output file format was found for the given identifier.
|
|
85
|
-
*
|
|
86
|
-
* @param {string} type - Case-insensitive file format identifier
|
|
87
|
-
* @returns {FileType | null}
|
|
88
|
-
*/
|
|
89
|
-
getOutputType(type) {
|
|
90
|
-
return this._findType(type, 'output');
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Get a file type object from the list of input or output file formats.
|
|
95
|
-
*
|
|
96
|
-
* @param {string} type - Identifier of the file type
|
|
97
|
-
* @param {string} io - Either `input` or `output`
|
|
98
|
-
* @returns {FileType | null}
|
|
99
|
-
* @protected
|
|
100
|
-
*/
|
|
101
|
-
_findType(type, io) {
|
|
102
|
-
type = type.toUpperCase();
|
|
103
|
-
if (type in this.data[io]) {
|
|
104
|
-
return this.data[io][type];
|
|
105
|
-
}
|
|
106
|
-
return null;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
module.exports = FileTypes;
|
|
1
|
+
const Utils = require('@openeo/js-commons/src/utils');
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Manages the files types supported by the back-end.
|
|
5
|
+
*/
|
|
6
|
+
class FileTypes {
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Creates a new FileTypes object from an API-compatible JSON response.
|
|
10
|
+
*
|
|
11
|
+
* @param {FileTypesAPI} data - A capabilities response compatible to the API specification for `GET /file_formats`.
|
|
12
|
+
*/
|
|
13
|
+
constructor(data) {
|
|
14
|
+
/**
|
|
15
|
+
* @protected
|
|
16
|
+
* @type {FileTypesAPI}
|
|
17
|
+
*/
|
|
18
|
+
this.data = {
|
|
19
|
+
input: {},
|
|
20
|
+
output: {}
|
|
21
|
+
};
|
|
22
|
+
if(!Utils.isObject(data)) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
for(let io of ['input', 'output']) {
|
|
26
|
+
for(let type in data[io]) {
|
|
27
|
+
if(!Utils.isObject(data[io])) {
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
this.data[io][type.toUpperCase()] = data[io][type];
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A list of backends from the federation that are missing in the response data.
|
|
35
|
+
*
|
|
36
|
+
* @public
|
|
37
|
+
* @type {Array.<string>}
|
|
38
|
+
*/
|
|
39
|
+
this['federation:missing'] = data['federation:missing'];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Returns the file types response as a JSON serializable representation of the data that is API compliant.
|
|
44
|
+
*
|
|
45
|
+
* @returns {FileTypesAPI}
|
|
46
|
+
*/
|
|
47
|
+
toJSON() {
|
|
48
|
+
return this.data;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Returns the input file formats.
|
|
53
|
+
*
|
|
54
|
+
* @returns {object.<string, FileType>}
|
|
55
|
+
*/
|
|
56
|
+
getInputTypes() {
|
|
57
|
+
return this.data.input;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Returns the output file formats.
|
|
62
|
+
*
|
|
63
|
+
* @returns {object.<string, FileType>}
|
|
64
|
+
*/
|
|
65
|
+
getOutputTypes() {
|
|
66
|
+
return this.data.output;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Returns a single input file format for a given identifier.
|
|
71
|
+
*
|
|
72
|
+
* Returns null if no input file format was found for the given identifier.
|
|
73
|
+
*
|
|
74
|
+
* @param {string} type - Case-insensitive file format identifier
|
|
75
|
+
* @returns {FileType | null}
|
|
76
|
+
*/
|
|
77
|
+
getInputType(type) {
|
|
78
|
+
return this._findType(type, 'input');
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Returns a single output file format for a given identifier.
|
|
83
|
+
*
|
|
84
|
+
* Returns null if no output file format was found for the given identifier.
|
|
85
|
+
*
|
|
86
|
+
* @param {string} type - Case-insensitive file format identifier
|
|
87
|
+
* @returns {FileType | null}
|
|
88
|
+
*/
|
|
89
|
+
getOutputType(type) {
|
|
90
|
+
return this._findType(type, 'output');
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Get a file type object from the list of input or output file formats.
|
|
95
|
+
*
|
|
96
|
+
* @param {string} type - Identifier of the file type
|
|
97
|
+
* @param {string} io - Either `input` or `output`
|
|
98
|
+
* @returns {FileType | null}
|
|
99
|
+
* @protected
|
|
100
|
+
*/
|
|
101
|
+
_findType(type, io) {
|
|
102
|
+
type = type.toUpperCase();
|
|
103
|
+
if (type in this.data[io]) {
|
|
104
|
+
return this.data[io][type];
|
|
105
|
+
}
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
module.exports = FileTypes;
|