@openeo/js-client 2.0.1 → 2.3.1

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/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  JavaScript/TypeScript client for the openEO API.
4
4
 
5
- * [Documentation](https://open-eo.github.io/openeo-js-client/2.0.1/).
5
+ * [Documentation](https://open-eo.github.io/openeo-js-client/latest/).
6
6
 
7
- The version of this client is **2.0.1** and supports **openEO API versions 1.x.x**.
7
+ The version of this client is **2.3.1** and supports **openEO API versions 1.x.x**.
8
8
  Legacy versions are available as releases.
9
9
  See the [CHANGELOG](CHANGELOG.md) for recent changes.
10
10
 
@@ -20,6 +20,7 @@ To use it in a browser environment simply add the following code to your HTML fi
20
20
  ```html
21
21
  <script src="https://cdn.jsdelivr.net/npm/axios@0.21/dist/axios.min.js"></script>
22
22
  <script src="https://cdn.jsdelivr.net/npm/oidc-client@1/dist/oidc-client.min.js"></script> <!-- Only required if you'd like to enable authentication via OpenID Connect -->
23
+ <script src="https://cdn.jsdelivr.net/npm/multihashes@3/src/index.min.js"></script> <!-- Only required if you have checksums in the STAC metadata -->
23
24
  <script src="https://cdn.jsdelivr.net/npm/@openeo/js-client@2/openeo.min.js"></script>
24
25
  ```
25
26
 
@@ -53,7 +54,7 @@ In Node.js:
53
54
  In Typescript:
54
55
  * [Basic Discovery (promises)](examples/typescript/discovery.ts)
55
56
 
56
- More information can be found in the [documentation](https://open-eo.github.io/openeo-js-client/2.0.1/).
57
+ More information can be found in the [documentation](https://open-eo.github.io/openeo-js-client/latest/).
57
58
 
58
59
  ## Development
59
60
 
package/openeo.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  /// <reference types="node" />
2
2
 
3
3
  import { User, UserManager } from 'oidc-client';
4
+ import { ProcessRegistry } from '@openeo/js-commons';
4
5
  import { Readable } from 'stream';
6
+ import { AbortController } from "node-abort-controller";
5
7
 
6
8
  declare module OpenEO {
7
9
  /**
@@ -63,7 +65,7 @@ declare module OpenEO {
63
65
  *
64
66
  * Returns `null` if no access token has been set yet (i.e. not authenticated any longer).
65
67
  *
66
- * @returns {?string}
68
+ * @returns {string | null}
67
69
  */
68
70
  getToken(): string | null;
69
71
  /**
@@ -387,7 +389,7 @@ declare module OpenEO {
387
389
  /**
388
390
  * Get the billing currency.
389
391
  *
390
- * @returns {?string} The billing currency or `null` if not available.
392
+ * @returns {string | null} The billing currency or `null` if not available.
391
393
  */
392
394
  currency(): string | null;
393
395
  /**
@@ -499,8 +501,8 @@ declare module OpenEO {
499
501
  * Adds a listener to one of the following events:
500
502
  *
501
503
  * - AccessTokenExpiring: Raised prior to the access token expiring.
502
- * - accessTokenExpired: Raised after the access token has expired.
503
- * - silentRenewError: Raised when the automatic silent renew has failed.
504
+ * - AccessTokenExpired: Raised after the access token has expired.
505
+ * - SilentRenewError: Raised when the automatic silent renew has failed.
504
506
  *
505
507
  * @param {string} event
506
508
  * @param {Function} callback
@@ -545,14 +547,14 @@ declare module OpenEO {
545
547
  *
546
548
  * This may override a detected default client ID.
547
549
  *
548
- * @param {?string} clientId
550
+ * @param {string | null} clientId
549
551
  */
550
552
  setClientId(clientId: string | null): void;
551
553
  /**
552
554
  * Sets the OIDC User.
553
555
  *
554
556
  * @see https://github.com/IdentityModel/oidc-client-js/wiki#user
555
- * @param {?User} user - The OIDC User. Passing `null` resets OIDC authentication details.
557
+ * @param {User | null} user - The OIDC User. Passing `null` resets OIDC authentication details.
556
558
  */
557
559
  setUser(user: User | null): void;
558
560
  /**
@@ -560,7 +562,7 @@ declare module OpenEO {
560
562
  *
561
563
  * Sets the grant and client ID accordingly.
562
564
  *
563
- * @returns {?OidcClient}
565
+ * @returns {OidcClient | null}
564
566
  * @see OidcProvider#setGrant
565
567
  * @see OidcProvider#setClientId
566
568
  */
@@ -609,7 +611,7 @@ declare module OpenEO {
609
611
  * Returns null if no input file format was found for the given identifier.
610
612
  *
611
613
  * @param {string} type - Case-insensitive file format identifier
612
- * @returns {?FileType}
614
+ * @returns {FileType | null}
613
615
  */
614
616
  getInputType(type: string): FileType | null;
615
617
  /**
@@ -618,7 +620,7 @@ declare module OpenEO {
618
620
  * Returns null if no output file format was found for the given identifier.
619
621
  *
620
622
  * @param {string} type - Case-insensitive file format identifier
621
- * @returns {?FileType}
623
+ * @returns {FileType | null}
622
624
  */
623
625
  getOutputType(type: string): FileType | null;
624
626
  /**
@@ -626,7 +628,7 @@ declare module OpenEO {
626
628
  *
627
629
  * @param {string} type - Identifier of the file type
628
630
  * @param {string} io - Either `input` or `output`
629
- * @returns {?FileType}
631
+ * @returns {FileType | null}
630
632
  * @protected
631
633
  */
632
634
  protected _findType(type: string, io: string): FileType | null;
@@ -707,10 +709,11 @@ declare module OpenEO {
707
709
  * @async
708
710
  * @param {*} source - The source, see method description for details.
709
711
  * @param {?uploadStatusCallback} statusCallback - Optionally, a callback that is executed on upload progress updates.
712
+ * @param {?AbortController} [abortController=null] - An AbortController object that can be used to cancel the upload process.
710
713
  * @returns {Promise<UserFile>}
711
714
  * @throws {Error}
712
715
  */
713
- uploadFile(source: any, statusCallback?: (percentCompleted: number, file: UserFile) => any): Promise<UserFile>;
716
+ uploadFile(source: any, statusCallback?: uploadStatusCallback | null, abortController?: AbortController | null): Promise<UserFile>;
714
717
  /**
715
718
  * Deletes the file from the user workspace.
716
719
  *
@@ -719,6 +722,13 @@ declare module OpenEO {
719
722
  */
720
723
  deleteFile(): Promise<void>;
721
724
  }
725
+ /**
726
+ * A callback that is executed on upload progress updates.
727
+ */
728
+ type uploadStatusCallback = (percentCompleted: number, file: UserFile) => any;
729
+ namespace UserFile {
730
+ export { uploadStatusCallback };
731
+ }
722
732
  /**
723
733
  * Interface to loop through the logs.
724
734
  */
@@ -1346,12 +1356,13 @@ declare module OpenEO {
1346
1356
  * Operators: - (subtract), + (add), / (divide), * (multiply), ^ (power)
1347
1357
  *
1348
1358
  * It supports all mathematical functions (i.e. expects a number and returns a number) the back-end implements, e.g. `sqrt(x)`.
1359
+ * For namespaced processes, use for example `process@namespace(x)` - EXPERIMENTAL!
1349
1360
  *
1350
1361
  * Only available if a builder is specified in the constructor:
1351
1362
  * You can refer to output from processes with a leading `#`, e.g. `#loadco1` if the node to refer to has the key `loadco1`.
1352
1363
  *
1353
1364
  * Only available if a parent node is set via `setNode()`:
1354
- * Parameters can be accessed simply by name.
1365
+ * Parameters can be accessed simply by name.
1355
1366
  * If the first parameter is a (labeled) array, the value for a specific index or label can be accessed by typing the numeric index or textual label with a `$` in front, for example `$B1` for the label `B1` or `$0` for the first element in the array. Numeric labels are not supported.
1356
1367
  * You can access subsequent parameters by adding additional `$` at the beginning, e.g. `$$0` to access the first element of an array in the second parameter, `$$$0` for the same in the third parameter etc.
1357
1368
  *
@@ -1430,8 +1441,9 @@ declare module OpenEO {
1430
1441
  * @param {string} processId
1431
1442
  * @param {object.<string, *>} [processArgs={}]
1432
1443
  * @param {?string} [processDescription=null]
1444
+ * @param {?string} [processNamespace=null]
1433
1445
  */
1434
- constructor(parent: Builder, processId: string, processArgs?: any, processDescription?: string | null);
1446
+ constructor(parent: Builder, processId: string, processArgs?: any, processDescription?: string | null, processNamespace?: string | null);
1435
1447
  /**
1436
1448
  * The parent builder.
1437
1449
  * @type {Builder}
@@ -1448,6 +1460,11 @@ declare module OpenEO {
1448
1460
  * @type {string}
1449
1461
  */
1450
1462
  id: string;
1463
+ /**
1464
+ * The namespace of the process - EXPERIMENTAL!
1465
+ * @type {string}
1466
+ */
1467
+ namespace: string;
1451
1468
  /**
1452
1469
  * The arguments for the process.
1453
1470
  * @type {object.<string, *>}
@@ -1508,7 +1525,7 @@ declare module OpenEO {
1508
1525
  *
1509
1526
  * @protected
1510
1527
  * @param {?BuilderNode} [parentNode=null]
1511
- * @param {?string} parentParameter
1528
+ * @param {?string} [parentParameter=null]
1512
1529
  * @returns {BuilderNode}
1513
1530
  */
1514
1531
  protected createBuilder(parentNode?: BuilderNode | null, parentParameter?: string | null): BuilderNode;
@@ -1608,7 +1625,7 @@ declare module OpenEO {
1608
1625
  *
1609
1626
  * @async
1610
1627
  * @static
1611
- * @param {?string} version
1628
+ * @param {?string} [version=null]
1612
1629
  * @returns {Promise<Builder>}
1613
1630
  * @throws {Error}
1614
1631
  */
@@ -1621,7 +1638,7 @@ declare module OpenEO {
1621
1638
  *
1622
1639
  * @async
1623
1640
  * @static
1624
- * @param {?string} url
1641
+ * @param {string | null} url
1625
1642
  * @returns {Promise<Builder>}
1626
1643
  * @throws {Error}
1627
1644
  */
@@ -1631,16 +1648,17 @@ declare module OpenEO {
1631
1648
  *
1632
1649
  * Each process passed to the constructor is made available as object method.
1633
1650
  *
1634
- * @param {Array.<Process>|Processes} processes - Either an array containing processes or an object compatible with `GET /processes` of the API.
1651
+ * @param {Array.<Process>|Processes|ProcessRegistry} processes - Either an array containing processes or an object compatible with `GET /processes` of the API.
1635
1652
  * @param {?Builder} parent - The parent builder, usually only used by the Builder itself.
1636
1653
  * @param {string} id - A unique identifier for the process.
1637
1654
  */
1638
- constructor(processes: Array<Process> | Processes, parent?: Builder | null, id?: string);
1655
+ constructor(processes: Array<Process> | Processes | ProcessRegistry, parent?: Builder | null, id?: string);
1639
1656
  /**
1640
- * List of all process specifications.
1641
- * @type {Array.<Process>}
1657
+ * A unique identifier for the process.
1658
+ * @public
1659
+ * @type {string}
1642
1660
  */
1643
- processes: Array<Process>;
1661
+ public id: string;
1644
1662
  /**
1645
1663
  * The parent builder.
1646
1664
  * @type {?Builder}
@@ -1661,18 +1679,25 @@ declare module OpenEO {
1661
1679
  callbackParameterCache: {};
1662
1680
  parameters: any;
1663
1681
  /**
1664
- * A unique identifier for the process.
1665
- * @public
1666
- * @type {string}
1682
+ * List of all non-namespaced process specifications.
1683
+ * @type {ProcessRegistry}
1667
1684
  */
1668
- public id: string;
1685
+ processes: ProcessRegistry;
1686
+ /**
1687
+ * Creates a callable function on the builder object for a process.
1688
+ *
1689
+ * @param {Process} process
1690
+ * @throws {Error}
1691
+ */
1692
+ createFunction(process: any): void;
1669
1693
  /**
1670
1694
  * Adds a process specification to the builder so that it can be used to create a process graph.
1671
1695
  *
1672
1696
  * @param {Process} process - Process specification compliant to openEO API
1697
+ * @param {?string} [namespace=null] - Namespace of the process (default to `null`, i.e. pre-defined processes). EXPERIMENTAL!
1673
1698
  * @throws {Error}
1674
1699
  */
1675
- addProcessSpec(process: Process): void;
1700
+ addProcessSpec(process: Process, namespace?: string | null): void;
1676
1701
  /**
1677
1702
  * Sets the parent for this Builder.
1678
1703
  *
@@ -1705,12 +1730,13 @@ declare module OpenEO {
1705
1730
  */
1706
1731
  addParameter(parameter: any, root?: boolean): void;
1707
1732
  /**
1708
- * Returns the process specification for the given process identifier.
1733
+ * Returns the process specification for the given process identifier and namespace (or `null`).
1709
1734
  *
1710
- * @param {string} id
1711
- * @returns {Process}
1735
+ * @param {string} id - Process identifier
1736
+ * @param {?string} [namespace=null] - Namespace of the process (default to `null`, i.e. user or backend namespace). EXPERIMENTAL!
1737
+ * @returns {Process | null}
1712
1738
  */
1713
- spec(id: string): Process;
1739
+ spec(id: string, namespace?: string | null): Process | null;
1714
1740
  /**
1715
1741
  * Adds a mathematical formula to the process.
1716
1742
  *
@@ -1723,18 +1749,19 @@ declare module OpenEO {
1723
1749
  */
1724
1750
  math(formula: string): BuilderNode;
1725
1751
  /**
1726
- * Checks whether a process with the given id is supported by the back-end.
1752
+ * Checks whether a process with the given id and namespace is supported by the back-end.
1727
1753
  *
1728
- * @param {string} processId - The id of the process to call.
1754
+ * @param {string} processId - The id of the process.
1755
+ * @param {?string} [namespace=null] - Namespace of the process (default to `null`, i.e. pre-defined processes). EXPERIMENTAL!
1729
1756
  * @returns {boolean}
1730
1757
  */
1731
- supports(processId: string): boolean;
1758
+ supports(processId: string, namespace?: string | null): boolean;
1732
1759
  /**
1733
1760
  * Adds another process call to the process chain.
1734
1761
  *
1735
- * @param {string} processId - The id of the process to call.
1736
- * @param {object.<string, *>|Array} args - The arguments as key-value pairs or as array. For objects, they keys must be the parameter names and the values must be the arguments. For arrays, arguments must be specified in the same order as in the corresponding process.
1737
- * @param {?string} description - An optional description for the process call.
1762
+ * @param {string} processId - The id of the process to call. To access a namespaced process, use the `process@namespace` notation.
1763
+ * @param {object.<string, *>|Array} [args={}] - The arguments as key-value pairs or as array. For objects, they keys must be the parameter names and the values must be the arguments. For arrays, arguments must be specified in the same order as in the corresponding process.
1764
+ * @param {?string} [description=null] - An optional description for the process call.
1738
1765
  * @returns {BuilderNode}
1739
1766
  */
1740
1767
  process(processId: string, args?: any | any[], description?: string | null): BuilderNode;
@@ -1762,40 +1789,97 @@ declare module OpenEO {
1762
1789
  /**
1763
1790
  * Creates a new Connection.
1764
1791
  *
1765
- * @param {string} baseUrl - URL to the back-end
1792
+ * @param {string} baseUrl - The versioned URL or the back-end instance.
1793
+ * @param {Options} [options={}] - Additional options for the connection.
1794
+ * @param {?string} [url=null] - User-provided URL of the backend connected to.
1766
1795
  */
1767
- constructor(baseUrl: string);
1796
+ constructor(baseUrl: string, options?: Options, url?: string | null);
1768
1797
  /**
1798
+ * User-provided URL of the backend connected to.
1799
+ *
1800
+ * `null` if not given and the connection was directly made to a versioned instance of the back-end.
1801
+ *
1802
+ * @protected
1803
+ * @type {string | null}
1804
+ */
1805
+ protected url: string | null;
1806
+ /**
1807
+ * The versioned URL or the back-end instance.
1808
+ *
1809
+ * @protected
1769
1810
  * @type {string}
1770
1811
  */
1771
- baseUrl: string;
1812
+ protected baseUrl: string;
1772
1813
  /**
1814
+ * Auth Provider cache
1815
+ *
1816
+ * @protected
1773
1817
  * @type {?Array.<AuthProvider>}
1774
1818
  */
1775
- authProviderList: Array<AuthProvider> | null;
1819
+ protected authProviderList: Array<AuthProvider> | null;
1776
1820
  /**
1821
+ * Current auth provider
1822
+ *
1823
+ * @protected
1777
1824
  * @type {?AuthProvider}
1778
1825
  */
1779
- authProvider: AuthProvider | null;
1826
+ protected authProvider: AuthProvider | null;
1780
1827
  /**
1828
+ * Capability cache
1829
+ *
1830
+ * @protected
1781
1831
  * @type {?Capabilities}
1782
1832
  */
1783
- capabilitiesObject: Capabilities | null;
1784
- processes: any;
1785
- listeners: {};
1833
+ protected capabilitiesObject: Capabilities | null;
1834
+ /**
1835
+ * Process cache
1836
+ *
1837
+ * @protected
1838
+ * @type {ProcessRegistry}
1839
+ */
1840
+ protected processes: any;
1841
+ /**
1842
+ * Listeners for events.
1843
+ *
1844
+ * @protected
1845
+ * @type {object.<string|Function>}
1846
+ */
1847
+ protected listeners: any;
1848
+ /**
1849
+ * Additional options for the connection.
1850
+ *
1851
+ * @protected
1852
+ * @type {Options}
1853
+ */
1854
+ protected options: Options;
1786
1855
  /**
1787
1856
  * Initializes the connection by requesting the capabilities.
1788
1857
  *
1789
1858
  * @async
1859
+ * @protected
1790
1860
  * @returns {Promise<Capabilities>} Capabilities
1791
1861
  */
1792
1862
  init(): Promise<Capabilities>;
1793
1863
  /**
1794
- * Returns the URL of the back-end currently connected to.
1864
+ * Refresh the cache for processes.
1865
+ *
1866
+ * @async
1867
+ * @protected
1868
+ * @returns {Promise}
1869
+ */
1870
+ refreshProcessCache(): Promise;
1871
+ /**
1872
+ * Returns the URL of the versioned back-end instance currently connected to.
1795
1873
  *
1796
- * @returns {string} The URL or the back-end.
1874
+ * @returns {string} The versioned URL or the back-end instance.
1797
1875
  */
1798
1876
  getBaseUrl(): string;
1877
+ /**
1878
+ * Returns the user-provided URL of the back-end currently connected to.
1879
+ *
1880
+ * @returns {string} The URL or the back-end.
1881
+ */
1882
+ getUrl(): string;
1799
1883
  /**
1800
1884
  * Returns the capabilities of the back-end.
1801
1885
  *
@@ -1857,42 +1941,48 @@ declare module OpenEO {
1857
1941
  *
1858
1942
  * @async
1859
1943
  * @param {string} collectionId - Collection ID to request items for.
1860
- * @param {?Array.<number>} spatialExtent - Limits the items to the given bounding box in WGS84:
1944
+ * @param {?Array.<number>} [spatialExtent=null] - Limits the items to the given bounding box in WGS84:
1861
1945
  * 1. Lower left corner, coordinate axis 1
1862
1946
  * 2. Lower left corner, coordinate axis 2
1863
1947
  * 3. Upper right corner, coordinate axis 1
1864
1948
  * 4. Upper right corner, coordinate axis 2
1865
- * @param {?Array.<*>} temporalExtent - Limits the items to the specified temporal interval.
1949
+ * @param {?Array.<*>} [temporalExtent=null] - Limits the items to the specified temporal interval.
1866
1950
  * The interval has to be specified as an array with exactly two elements (start, end) and
1867
1951
  * each must be either an RFC 3339 compatible string or a Date object.
1868
1952
  * Also supports open intervals by setting one of the boundaries to `null`, but never both.
1869
- * @param {?number} limit - The amount of items per request/page as integer. If `null` (default), the back-end decides.
1953
+ * @param {?number} [limit=null] - The amount of items per request/page as integer. If `null` (default), the back-end decides.
1870
1954
  * @yields {Promise<ItemCollection>} A response compatible to the API specification.
1871
1955
  * @throws {Error}
1872
1956
  */
1873
1957
  listCollectionItems(collectionId: string, spatialExtent?: Array<number> | null, temporalExtent?: Array<any> | null, limit?: number | null): AsyncGenerator<any, void, unknown>;
1874
1958
  /**
1875
- * List all processes available on the back-end.
1959
+ * List processes available on the back-end.
1960
+ *
1961
+ * Requests pre-defined processes by default.
1962
+ * Set the namespace parameter to request processes from a specific namespace.
1876
1963
  *
1877
- * Data is cached in memory.
1964
+ * Note: The list of namespaces can be retrieved by calling `listProcesses` without a namespace given.
1965
+ * The namespaces are then listed in the property `namespaces`.
1878
1966
  *
1879
1967
  * @async
1968
+ * @param {?string} [namespace=null] - Namespace of the processes (default to `null`, i.e. pre-defined processes). EXPERIMENTAL!
1880
1969
  * @returns {Promise<Processes>} - A response compatible to the API specification.
1881
1970
  * @throws {Error}
1882
1971
  */
1883
- listProcesses(): Promise<Processes>;
1972
+ listProcesses(namespace?: string | null): Promise<Processes>;
1884
1973
  /**
1885
1974
  * Get information about a single process.
1886
1975
  *
1887
1976
  * @async
1888
1977
  * @param {string} processId - Collection ID to request further metadata for.
1978
+ * @param {?string} [namespace=null] - Namespace of the process (default to `null`, i.e. pre-defined processes). EXPERIMENTAL!
1889
1979
  * @returns {Promise<?Process>} - A single process as object, or `null` if none is found.
1890
1980
  * @throws {Error}
1891
1981
  * @see Connection#listProcesses
1892
1982
  */
1893
- describeProcess(processId: string): Promise<Process | null>;
1983
+ describeProcess(processId: string, namespace?: string | null): Promise<Process | null>;
1894
1984
  /**
1895
- * Returns an object to simply build user-defined processes.
1985
+ * Returns an object to simply build user-defined processes based upon pre-defined processes.
1896
1986
  *
1897
1987
  * @async
1898
1988
  * @param {string} id - A name for the process.
@@ -1922,7 +2012,7 @@ declare module OpenEO {
1922
2012
  *
1923
2013
  * @callback oidcProviderFactoryFunction
1924
2014
  * @param {object.<string, *>} providerInfo - The provider information as provided by the API, having the properties `id`, `issuer`, `title` etc.
1925
- * @returns {?AuthProvider}
2015
+ * @returns {AuthProvider | null}
1926
2016
  */
1927
2017
  /**
1928
2018
  * Sets a factory function that creates custom OpenID Connect provider instances.
@@ -1931,21 +2021,21 @@ declare module OpenEO {
1931
2021
  * on the AuthProvider interface (or OIDCProvider class), e.g. to use a
1932
2022
  * OIDC library other than oidc-client-js.
1933
2023
  *
1934
- * @param {?oidcProviderFactoryFunction} providerFactoryFunc
2024
+ * @param {?oidcProviderFactoryFunction} [providerFactoryFunc=null]
1935
2025
  * @see AuthProvider
1936
2026
  */
1937
- setOidcProviderFactory(providerFactoryFunc: (providerInfo: any) => AuthProvider | null): void;
1938
- oidcProviderFactory: (providerInfo: any) => AuthProvider | null;
2027
+ setOidcProviderFactory(providerFactoryFunc?: oidcProviderFactoryFunction | null): void;
2028
+ oidcProviderFactory: oidcProviderFactoryFunction;
1939
2029
  /**
1940
2030
  * Get the OpenID Connect provider factory.
1941
2031
  *
1942
2032
  * Returns `null` if OIDC is not supported by the client or an instance
1943
2033
  * can't be created for whatever reason.
1944
2034
  *
1945
- * @returns {?oidcProviderFactoryFunction}
2035
+ * @returns {oidcProviderFactoryFunction | null}
1946
2036
  * @see AuthProvider
1947
2037
  */
1948
- getOidcProviderFactory(): (providerInfo: any) => AuthProvider | null;
2038
+ getOidcProviderFactory(): oidcProviderFactoryFunction | null;
1949
2039
  /**
1950
2040
  * Authenticates with username and password against a back-end supporting HTTP Basic Authentication.
1951
2041
  *
@@ -1979,6 +2069,7 @@ declare module OpenEO {
1979
2069
  * Currently supported:
1980
2070
  * - authProviderChanged(provider): Raised when the auth provider has changed.
1981
2071
  * - tokenChanged(token): Raised when the access token has changed.
2072
+ * - processesChanged(type, data, namespace): Raised when the process registry has changed (i.e. a process was added, updated or deleted).
1982
2073
  *
1983
2074
  * @param {string} event
1984
2075
  * @param {Function} callback
@@ -1993,7 +2084,7 @@ declare module OpenEO {
1993
2084
  /**
1994
2085
  * Returns the AuthProvider.
1995
2086
  *
1996
- * @returns {?AuthProvider}
2087
+ * @returns {AuthProvider | null}
1997
2088
  */
1998
2089
  getAuthProvider(): AuthProvider | null;
1999
2090
  /**
@@ -2053,10 +2144,11 @@ declare module OpenEO {
2053
2144
  * @param {*} source - The source, see method description for details.
2054
2145
  * @param {?string} [targetPath=null] - The target path on the server, relative to the user workspace. Defaults to the file name of the source file.
2055
2146
  * @param {?uploadStatusCallback} [statusCallback=null] - Optionally, a callback that is executed on upload progress updates.
2147
+ * @param {?AbortController} [abortController=null] - An AbortController object that can be used to cancel the processing request.
2056
2148
  * @returns {Promise<UserFile>}
2057
2149
  * @throws {Error}
2058
2150
  */
2059
- uploadFile(source: any, targetPath?: string | null, statusCallback?: (percentCompleted: number) => any): Promise<UserFile>;
2151
+ uploadFile(source: any, targetPath?: string | null, statusCallback?: uploadStatusCallback | null, abortController?: AbortController | null): Promise<UserFile>;
2060
2152
  /**
2061
2153
  * Opens a (existing or non-existing) file without reading any information or creating a new file at the back-end.
2062
2154
  *
@@ -2121,9 +2213,10 @@ declare module OpenEO {
2121
2213
  * @param {Process} process - A user-defined process.
2122
2214
  * @param {?string} [plan=null] - The billing plan to use for this computation.
2123
2215
  * @param {?number} [budget=null] - The maximum budget allowed to spend for this computation.
2216
+ * @param {?AbortController} [abortController=null] - An AbortController object that can be used to cancel the processing request.
2124
2217
  * @returns {Promise<SyncResult>} - An object with the data and some metadata.
2125
2218
  */
2126
- computeResult(process: Process, plan?: string | null, budget?: number | null): Promise<SyncResult>;
2219
+ computeResult(process: Process, plan?: string | null, budget?: number | null, abortController?: AbortController | null): Promise<SyncResult>;
2127
2220
  /**
2128
2221
  * Executes a process synchronously and downloads to result the given path.
2129
2222
  *
@@ -2138,9 +2231,10 @@ declare module OpenEO {
2138
2231
  * @param {string} targetPath - The target, see method description for details.
2139
2232
  * @param {?string} [plan=null] - The billing plan to use for this computation.
2140
2233
  * @param {?number} [budget=null] - The maximum budget allowed to spend for this computation.
2234
+ * @param {?AbortController} [abortController=null] - An AbortController object that can be used to cancel the processing request.
2141
2235
  * @throws {Error}
2142
2236
  */
2143
- downloadResult(process: Process, targetPath: string, plan?: string | null, budget?: number | null): Promise<void>;
2237
+ downloadResult(process: Process, targetPath: string, plan?: string | null, budget?: number | null, abortController?: AbortController | null): Promise<void>;
2144
2238
  /**
2145
2239
  * Lists all batch jobs of the authenticated user.
2146
2240
  *
@@ -2211,7 +2305,7 @@ declare module OpenEO {
2211
2305
  *
2212
2306
  * @param {Array.<Link>} links - An array of links.
2213
2307
  * @param {string} rel - Relation type to find, defaults to `next`.
2214
- * @returns {?string}
2308
+ * @returns {string | null}
2215
2309
  * @throws {Error}
2216
2310
  */
2217
2311
  _getLinkHref(links: Array<Link>, rel?: string): string | null;
@@ -2234,11 +2328,12 @@ declare module OpenEO {
2234
2328
  * @param {string} path
2235
2329
  * @param {*} body
2236
2330
  * @param {string} responseType - Response type according to axios, defaults to `json`.
2331
+ * @param {?AbortController} [abortController=null] - An AbortController object that can be used to cancel the request.
2237
2332
  * @returns {Promise<AxiosResponse>}
2238
2333
  * @throws {Error}
2239
2334
  * @see https://github.com/axios/axios#request-config
2240
2335
  */
2241
- _post(path: string, body: any, responseType: string): Promise<AxiosResponse>;
2336
+ _post(path: string, body: any, responseType: string, abortController?: AbortController | null): Promise<AxiosResponse>;
2242
2337
  /**
2243
2338
  * Sends a PUT request.
2244
2339
  *
@@ -2293,12 +2388,27 @@ declare module OpenEO {
2293
2388
  *
2294
2389
  * @async
2295
2390
  * @param {object.<string, *>} options
2391
+ * @param {?AbortController} [abortController=null] - An AbortController object that can be used to cancel the request.
2296
2392
  * @returns {Promise<AxiosResponse>}
2297
2393
  * @throws {Error}
2298
2394
  * @see https://github.com/axios/axios
2299
2395
  */
2300
- _send(options: any): Promise<AxiosResponse>;
2396
+ _send(options: any, abortController?: AbortController | null): Promise<AxiosResponse>;
2397
+ }
2398
+ namespace Connection {
2399
+ export { oidcProviderFactoryFunction, uploadStatusCallback };
2301
2400
  }
2401
+ /**
2402
+ * This function is meant to create the OIDC providers used for authentication.
2403
+ *
2404
+ * The function gets passed a single argument that contains the
2405
+ * provider information as provided by the API, e.g. having the properties
2406
+ * `id`, `issuer`, `title` etc.
2407
+ *
2408
+ * The function must return an instance of AuthProvider or any derived class.
2409
+ * May return `null` if the instance can't be created.
2410
+ */
2411
+ type oidcProviderFactoryFunction = (providerInfo: any) => AuthProvider | null;
2302
2412
  /**
2303
2413
  * Main class to start with openEO. Allows to connect to a server.
2304
2414
  *
@@ -2313,11 +2423,12 @@ declare module OpenEO {
2313
2423
  *
2314
2424
  * @async
2315
2425
  * @param {string} url - The server URL to connect to.
2426
+ * @param {Options} [options={}] - Additional options for the connection.
2316
2427
  * @returns {Promise<Connection>}
2317
2428
  * @throws {Error}
2318
2429
  * @static
2319
2430
  */
2320
- static connect(url: string): Promise<Connection>;
2431
+ static connect(url: string, options?: Options): Promise<Connection>;
2321
2432
  /**
2322
2433
  * Connects directly to a back-end instance, without version discovery (NOT recommended).
2323
2434
  *
@@ -2325,11 +2436,12 @@ declare module OpenEO {
2325
2436
  *
2326
2437
  * @async
2327
2438
  * @param {string} versionedUrl - The server URL to connect to.
2439
+ * @param {Options} [options={}] - Additional options for the connection.
2328
2440
  * @returns {Promise<Connection>}
2329
2441
  * @throws {Error}
2330
2442
  * @static
2331
2443
  */
2332
- static connectDirect(versionedUrl: string): Promise<Connection>;
2444
+ static connectDirect(versionedUrl: string, options?: Options): Promise<Connection>;
2333
2445
  /**
2334
2446
  * Returns the version number of the client.
2335
2447
  *
@@ -2569,9 +2681,22 @@ declare module OpenEO {
2569
2681
  */
2570
2682
  links: Array<Link>;
2571
2683
  };
2684
+ /**
2685
+ * Connection options.
2686
+ */
2687
+ export type Options = {
2688
+ /**
2689
+ * Add a namespace property to processes if set to `true`. Defaults to `false`.
2690
+ */
2691
+ addNamespaceToProcess: boolean;
2692
+ };
2572
2693
  export type Processes = {
2573
2694
  processes: Array<Process>;
2574
2695
  links: Array<Link>;
2696
+ /**
2697
+ * EXPERIMENTAL!
2698
+ */
2699
+ namespaces: Array<string> | null;
2575
2700
  };
2576
2701
  /**
2577
2702
  * An openEO processing chain.
@@ -2609,10 +2734,11 @@ declare module OpenEO {
2609
2734
  };
2610
2735
  export type UserAccount = {
2611
2736
  user_id: string;
2612
- name: string;
2613
- storage: UserAccountStorage;
2737
+ name: string | null;
2738
+ default_plan: string | null;
2739
+ storage: UserAccountStorage | null;
2614
2740
  budget: number | null;
2615
- links: Array<Link>;
2741
+ links: Array<Link> | null;
2616
2742
  };
2617
2743
 
2618
2744
  }