@openeo/js-client 2.0.0 → 2.3.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/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.0/).
5
+ * [Documentation](https://open-eo.github.io/openeo-js-client/latest/).
6
6
 
7
- The version of this client is **2.0.0** and supports **openEO API versions 1.x.x**.
7
+ The version of this client is **2.3.0** 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.0/).
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
  /**
@@ -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,13 +1356,15 @@ 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
1365
  * Parameters can be accessed simply by name.
1355
- * 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.
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.
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.
1356
1368
  *
1357
1369
  * An example that computes an EVI (assuming the labels for the bands are `NIR`, `RED` and `BLUE`): `2.5 * ($NIR - $RED) / (1 + $NIR + 6 * $RED + (-7.5 * $BLUE))`
1358
1370
  */
@@ -1429,8 +1441,9 @@ declare module OpenEO {
1429
1441
  * @param {string} processId
1430
1442
  * @param {object.<string, *>} [processArgs={}]
1431
1443
  * @param {?string} [processDescription=null]
1444
+ * @param {?string} [processNamespace=null]
1432
1445
  */
1433
- constructor(parent: Builder, processId: string, processArgs?: any, processDescription?: string | null);
1446
+ constructor(parent: Builder, processId: string, processArgs?: any, processDescription?: string | null, processNamespace?: string | null);
1434
1447
  /**
1435
1448
  * The parent builder.
1436
1449
  * @type {Builder}
@@ -1447,6 +1460,11 @@ declare module OpenEO {
1447
1460
  * @type {string}
1448
1461
  */
1449
1462
  id: string;
1463
+ /**
1464
+ * The namespace of the process - EXPERIMENTAL!
1465
+ * @type {string}
1466
+ */
1467
+ namespace: string;
1450
1468
  /**
1451
1469
  * The arguments for the process.
1452
1470
  * @type {object.<string, *>}
@@ -1507,7 +1525,7 @@ declare module OpenEO {
1507
1525
  *
1508
1526
  * @protected
1509
1527
  * @param {?BuilderNode} [parentNode=null]
1510
- * @param {?string} parentParameter
1528
+ * @param {?string} [parentParameter=null]
1511
1529
  * @returns {BuilderNode}
1512
1530
  */
1513
1531
  protected createBuilder(parentNode?: BuilderNode | null, parentParameter?: string | null): BuilderNode;
@@ -1607,7 +1625,7 @@ declare module OpenEO {
1607
1625
  *
1608
1626
  * @async
1609
1627
  * @static
1610
- * @param {?string} version
1628
+ * @param {?string} [version=null]
1611
1629
  * @returns {Promise<Builder>}
1612
1630
  * @throws {Error}
1613
1631
  */
@@ -1620,7 +1638,7 @@ declare module OpenEO {
1620
1638
  *
1621
1639
  * @async
1622
1640
  * @static
1623
- * @param {?string} url
1641
+ * @param {string | null} url
1624
1642
  * @returns {Promise<Builder>}
1625
1643
  * @throws {Error}
1626
1644
  */
@@ -1630,16 +1648,17 @@ declare module OpenEO {
1630
1648
  *
1631
1649
  * Each process passed to the constructor is made available as object method.
1632
1650
  *
1633
- * @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.
1634
1652
  * @param {?Builder} parent - The parent builder, usually only used by the Builder itself.
1635
1653
  * @param {string} id - A unique identifier for the process.
1636
1654
  */
1637
- constructor(processes: Array<Process> | Processes, parent?: Builder | null, id?: string);
1655
+ constructor(processes: Array<Process> | Processes | ProcessRegistry, parent?: Builder | null, id?: string);
1638
1656
  /**
1639
- * List of all process specifications.
1640
- * @type {Array.<Process>}
1657
+ * A unique identifier for the process.
1658
+ * @public
1659
+ * @type {string}
1641
1660
  */
1642
- processes: Array<Process>;
1661
+ public id: string;
1643
1662
  /**
1644
1663
  * The parent builder.
1645
1664
  * @type {?Builder}
@@ -1660,18 +1679,25 @@ declare module OpenEO {
1660
1679
  callbackParameterCache: {};
1661
1680
  parameters: any;
1662
1681
  /**
1663
- * A unique identifier for the process.
1664
- * @public
1665
- * @type {string}
1682
+ * List of all non-namespaced process specifications.
1683
+ * @type {ProcessRegistry}
1666
1684
  */
1667
- 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;
1668
1693
  /**
1669
1694
  * Adds a process specification to the builder so that it can be used to create a process graph.
1670
1695
  *
1671
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!
1672
1698
  * @throws {Error}
1673
1699
  */
1674
- addProcessSpec(process: Process): void;
1700
+ addProcessSpec(process: Process, namespace?: string | null): void;
1675
1701
  /**
1676
1702
  * Sets the parent for this Builder.
1677
1703
  *
@@ -1704,12 +1730,13 @@ declare module OpenEO {
1704
1730
  */
1705
1731
  addParameter(parameter: any, root?: boolean): void;
1706
1732
  /**
1707
- * Returns the process specification for the given process identifier.
1733
+ * Returns the process specification for the given process identifier and namespace (or `null`).
1708
1734
  *
1709
- * @param {string} id
1710
- * @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}
1711
1738
  */
1712
- spec(id: string): Process;
1739
+ spec(id: string, namespace?: string | null): Process | null;
1713
1740
  /**
1714
1741
  * Adds a mathematical formula to the process.
1715
1742
  *
@@ -1722,18 +1749,19 @@ declare module OpenEO {
1722
1749
  */
1723
1750
  math(formula: string): BuilderNode;
1724
1751
  /**
1725
- * 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.
1726
1753
  *
1727
- * @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!
1728
1756
  * @returns {boolean}
1729
1757
  */
1730
- supports(processId: string): boolean;
1758
+ supports(processId: string, namespace?: string | null): boolean;
1731
1759
  /**
1732
1760
  * Adds another process call to the process chain.
1733
1761
  *
1734
- * @param {string} processId - The id of the process to call.
1735
- * @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.
1736
- * @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.
1737
1765
  * @returns {BuilderNode}
1738
1766
  */
1739
1767
  process(processId: string, args?: any | any[], description?: string | null): BuilderNode;
@@ -1761,27 +1789,69 @@ declare module OpenEO {
1761
1789
  /**
1762
1790
  * Creates a new Connection.
1763
1791
  *
1764
- * @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.
1765
1795
  */
1766
- constructor(baseUrl: string);
1796
+ constructor(baseUrl: string, options?: Options, url?: string | null);
1767
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
1768
1810
  * @type {string}
1769
1811
  */
1770
- baseUrl: string;
1812
+ protected baseUrl: string;
1771
1813
  /**
1814
+ * Auth Provider cache
1815
+ *
1816
+ * @protected
1772
1817
  * @type {?Array.<AuthProvider>}
1773
1818
  */
1774
- authProviderList: Array<AuthProvider> | null;
1819
+ protected authProviderList: Array<AuthProvider> | null;
1775
1820
  /**
1821
+ * Current auth provider
1822
+ *
1823
+ * @protected
1776
1824
  * @type {?AuthProvider}
1777
1825
  */
1778
- authProvider: AuthProvider | null;
1826
+ protected authProvider: AuthProvider | null;
1779
1827
  /**
1828
+ * Capability cache
1829
+ *
1830
+ * @protected
1780
1831
  * @type {?Capabilities}
1781
1832
  */
1782
- capabilitiesObject: Capabilities | null;
1783
- processes: any;
1784
- 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;
1785
1855
  /**
1786
1856
  * Initializes the connection by requesting the capabilities.
1787
1857
  *
@@ -1790,11 +1860,17 @@ declare module OpenEO {
1790
1860
  */
1791
1861
  init(): Promise<Capabilities>;
1792
1862
  /**
1793
- * Returns the URL of the back-end currently connected to.
1863
+ * Returns the URL of the versioned back-end instance currently connected to.
1794
1864
  *
1795
- * @returns {string} The URL or the back-end.
1865
+ * @returns {string} The versioned URL or the back-end instance.
1796
1866
  */
1797
1867
  getBaseUrl(): string;
1868
+ /**
1869
+ * Returns the user-provided URL of the back-end currently connected to.
1870
+ *
1871
+ * @returns {string} The URL or the back-end.
1872
+ */
1873
+ getUrl(): string;
1798
1874
  /**
1799
1875
  * Returns the capabilities of the back-end.
1800
1876
  *
@@ -1856,42 +1932,48 @@ declare module OpenEO {
1856
1932
  *
1857
1933
  * @async
1858
1934
  * @param {string} collectionId - Collection ID to request items for.
1859
- * @param {?Array.<number>} spatialExtent - Limits the items to the given bounding box in WGS84:
1935
+ * @param {?Array.<number>} [spatialExtent=null] - Limits the items to the given bounding box in WGS84:
1860
1936
  * 1. Lower left corner, coordinate axis 1
1861
1937
  * 2. Lower left corner, coordinate axis 2
1862
1938
  * 3. Upper right corner, coordinate axis 1
1863
1939
  * 4. Upper right corner, coordinate axis 2
1864
- * @param {?Array.<*>} temporalExtent - Limits the items to the specified temporal interval.
1940
+ * @param {?Array.<*>} [temporalExtent=null] - Limits the items to the specified temporal interval.
1865
1941
  * The interval has to be specified as an array with exactly two elements (start, end) and
1866
1942
  * each must be either an RFC 3339 compatible string or a Date object.
1867
1943
  * Also supports open intervals by setting one of the boundaries to `null`, but never both.
1868
- * @param {?number} limit - The amount of items per request/page as integer. If `null` (default), the back-end decides.
1944
+ * @param {?number} [limit=null] - The amount of items per request/page as integer. If `null` (default), the back-end decides.
1869
1945
  * @yields {Promise<ItemCollection>} A response compatible to the API specification.
1870
1946
  * @throws {Error}
1871
1947
  */
1872
1948
  listCollectionItems(collectionId: string, spatialExtent?: Array<number> | null, temporalExtent?: Array<any> | null, limit?: number | null): AsyncGenerator<any, void, unknown>;
1873
1949
  /**
1874
- * List all processes available on the back-end.
1950
+ * List processes available on the back-end.
1875
1951
  *
1876
- * Data is cached in memory.
1952
+ * Requests pre-defined processes by default.
1953
+ * Set the namespace parameter to request processes from a specific namespace.
1954
+ *
1955
+ * Note: The list of namespaces can be retrieved by calling `listProcesses` without a namespace given.
1956
+ * The namespaces are then listed in the property `namespaces`.
1877
1957
  *
1878
1958
  * @async
1959
+ * @param {?string} [namespace=null] - Namespace of the processes (default to `null`, i.e. pre-defined processes). EXPERIMENTAL!
1879
1960
  * @returns {Promise<Processes>} - A response compatible to the API specification.
1880
1961
  * @throws {Error}
1881
1962
  */
1882
- listProcesses(): Promise<Processes>;
1963
+ listProcesses(namespace?: string | null): Promise<Processes>;
1883
1964
  /**
1884
1965
  * Get information about a single process.
1885
1966
  *
1886
1967
  * @async
1887
1968
  * @param {string} processId - Collection ID to request further metadata for.
1969
+ * @param {?string} [namespace=null] - Namespace of the process (default to `null`, i.e. pre-defined processes). EXPERIMENTAL!
1888
1970
  * @returns {Promise<?Process>} - A single process as object, or `null` if none is found.
1889
1971
  * @throws {Error}
1890
1972
  * @see Connection#listProcesses
1891
1973
  */
1892
- describeProcess(processId: string): Promise<Process | null>;
1974
+ describeProcess(processId: string, namespace?: string | null): Promise<Process | null>;
1893
1975
  /**
1894
- * Returns an object to simply build user-defined processes.
1976
+ * Returns an object to simply build user-defined processes based upon pre-defined processes.
1895
1977
  *
1896
1978
  * @async
1897
1979
  * @param {string} id - A name for the process.
@@ -1921,7 +2003,7 @@ declare module OpenEO {
1921
2003
  *
1922
2004
  * @callback oidcProviderFactoryFunction
1923
2005
  * @param {object.<string, *>} providerInfo - The provider information as provided by the API, having the properties `id`, `issuer`, `title` etc.
1924
- * @returns {?AuthProvider}
2006
+ * @returns {AuthProvider | null}
1925
2007
  */
1926
2008
  /**
1927
2009
  * Sets a factory function that creates custom OpenID Connect provider instances.
@@ -1930,21 +2012,21 @@ declare module OpenEO {
1930
2012
  * on the AuthProvider interface (or OIDCProvider class), e.g. to use a
1931
2013
  * OIDC library other than oidc-client-js.
1932
2014
  *
1933
- * @param {?oidcProviderFactoryFunction} providerFactoryFunc
2015
+ * @param {?oidcProviderFactoryFunction} [providerFactoryFunc=null]
1934
2016
  * @see AuthProvider
1935
2017
  */
1936
- setOidcProviderFactory(providerFactoryFunc: (providerInfo: any) => AuthProvider | null): void;
1937
- oidcProviderFactory: (providerInfo: any) => AuthProvider | null;
2018
+ setOidcProviderFactory(providerFactoryFunc?: oidcProviderFactoryFunction | null): void;
2019
+ oidcProviderFactory: oidcProviderFactoryFunction;
1938
2020
  /**
1939
2021
  * Get the OpenID Connect provider factory.
1940
2022
  *
1941
2023
  * Returns `null` if OIDC is not supported by the client or an instance
1942
2024
  * can't be created for whatever reason.
1943
2025
  *
1944
- * @returns {?oidcProviderFactoryFunction}
2026
+ * @returns {oidcProviderFactoryFunction | null}
1945
2027
  * @see AuthProvider
1946
2028
  */
1947
- getOidcProviderFactory(): (providerInfo: any) => AuthProvider | null;
2029
+ getOidcProviderFactory(): oidcProviderFactoryFunction | null;
1948
2030
  /**
1949
2031
  * Authenticates with username and password against a back-end supporting HTTP Basic Authentication.
1950
2032
  *
@@ -1978,6 +2060,7 @@ declare module OpenEO {
1978
2060
  * Currently supported:
1979
2061
  * - authProviderChanged(provider): Raised when the auth provider has changed.
1980
2062
  * - tokenChanged(token): Raised when the access token has changed.
2063
+ * - processesChanged(type, data, namespace): Raised when the process registry has changed (i.e. a process was added, updated or deleted).
1981
2064
  *
1982
2065
  * @param {string} event
1983
2066
  * @param {Function} callback
@@ -1992,7 +2075,7 @@ declare module OpenEO {
1992
2075
  /**
1993
2076
  * Returns the AuthProvider.
1994
2077
  *
1995
- * @returns {?AuthProvider}
2078
+ * @returns {AuthProvider | null}
1996
2079
  */
1997
2080
  getAuthProvider(): AuthProvider | null;
1998
2081
  /**
@@ -2052,10 +2135,11 @@ declare module OpenEO {
2052
2135
  * @param {*} source - The source, see method description for details.
2053
2136
  * @param {?string} [targetPath=null] - The target path on the server, relative to the user workspace. Defaults to the file name of the source file.
2054
2137
  * @param {?uploadStatusCallback} [statusCallback=null] - Optionally, a callback that is executed on upload progress updates.
2138
+ * @param {?AbortController} [abortController=null] - An AbortController object that can be used to cancel the processing request.
2055
2139
  * @returns {Promise<UserFile>}
2056
2140
  * @throws {Error}
2057
2141
  */
2058
- uploadFile(source: any, targetPath?: string | null, statusCallback?: (percentCompleted: number) => any): Promise<UserFile>;
2142
+ uploadFile(source: any, targetPath?: string | null, statusCallback?: uploadStatusCallback | null, abortController?: AbortController | null): Promise<UserFile>;
2059
2143
  /**
2060
2144
  * Opens a (existing or non-existing) file without reading any information or creating a new file at the back-end.
2061
2145
  *
@@ -2120,9 +2204,10 @@ declare module OpenEO {
2120
2204
  * @param {Process} process - A user-defined process.
2121
2205
  * @param {?string} [plan=null] - The billing plan to use for this computation.
2122
2206
  * @param {?number} [budget=null] - The maximum budget allowed to spend for this computation.
2207
+ * @param {?AbortController} [abortController=null] - An AbortController object that can be used to cancel the processing request.
2123
2208
  * @returns {Promise<SyncResult>} - An object with the data and some metadata.
2124
2209
  */
2125
- computeResult(process: Process, plan?: string | null, budget?: number | null): Promise<SyncResult>;
2210
+ computeResult(process: Process, plan?: string | null, budget?: number | null, abortController?: AbortController | null): Promise<SyncResult>;
2126
2211
  /**
2127
2212
  * Executes a process synchronously and downloads to result the given path.
2128
2213
  *
@@ -2137,9 +2222,10 @@ declare module OpenEO {
2137
2222
  * @param {string} targetPath - The target, see method description for details.
2138
2223
  * @param {?string} [plan=null] - The billing plan to use for this computation.
2139
2224
  * @param {?number} [budget=null] - The maximum budget allowed to spend for this computation.
2225
+ * @param {?AbortController} [abortController=null] - An AbortController object that can be used to cancel the processing request.
2140
2226
  * @throws {Error}
2141
2227
  */
2142
- downloadResult(process: Process, targetPath: string, plan?: string | null, budget?: number | null): Promise<void>;
2228
+ downloadResult(process: Process, targetPath: string, plan?: string | null, budget?: number | null, abortController?: AbortController | null): Promise<void>;
2143
2229
  /**
2144
2230
  * Lists all batch jobs of the authenticated user.
2145
2231
  *
@@ -2210,7 +2296,7 @@ declare module OpenEO {
2210
2296
  *
2211
2297
  * @param {Array.<Link>} links - An array of links.
2212
2298
  * @param {string} rel - Relation type to find, defaults to `next`.
2213
- * @returns {?string}
2299
+ * @returns {string | null}
2214
2300
  * @throws {Error}
2215
2301
  */
2216
2302
  _getLinkHref(links: Array<Link>, rel?: string): string | null;
@@ -2233,11 +2319,12 @@ declare module OpenEO {
2233
2319
  * @param {string} path
2234
2320
  * @param {*} body
2235
2321
  * @param {string} responseType - Response type according to axios, defaults to `json`.
2322
+ * @param {?AbortController} [abortController=null] - An AbortController object that can be used to cancel the request.
2236
2323
  * @returns {Promise<AxiosResponse>}
2237
2324
  * @throws {Error}
2238
2325
  * @see https://github.com/axios/axios#request-config
2239
2326
  */
2240
- _post(path: string, body: any, responseType: string): Promise<AxiosResponse>;
2327
+ _post(path: string, body: any, responseType: string, abortController?: AbortController | null): Promise<AxiosResponse>;
2241
2328
  /**
2242
2329
  * Sends a PUT request.
2243
2330
  *
@@ -2292,12 +2379,27 @@ declare module OpenEO {
2292
2379
  *
2293
2380
  * @async
2294
2381
  * @param {object.<string, *>} options
2382
+ * @param {?AbortController} [abortController=null] - An AbortController object that can be used to cancel the request.
2295
2383
  * @returns {Promise<AxiosResponse>}
2296
2384
  * @throws {Error}
2297
2385
  * @see https://github.com/axios/axios
2298
2386
  */
2299
- _send(options: any): Promise<AxiosResponse>;
2387
+ _send(options: any, abortController?: AbortController | null): Promise<AxiosResponse>;
2388
+ }
2389
+ namespace Connection {
2390
+ export { oidcProviderFactoryFunction, uploadStatusCallback };
2300
2391
  }
2392
+ /**
2393
+ * This function is meant to create the OIDC providers used for authentication.
2394
+ *
2395
+ * The function gets passed a single argument that contains the
2396
+ * provider information as provided by the API, e.g. having the properties
2397
+ * `id`, `issuer`, `title` etc.
2398
+ *
2399
+ * The function must return an instance of AuthProvider or any derived class.
2400
+ * May return `null` if the instance can't be created.
2401
+ */
2402
+ type oidcProviderFactoryFunction = (providerInfo: any) => AuthProvider | null;
2301
2403
  /**
2302
2404
  * Main class to start with openEO. Allows to connect to a server.
2303
2405
  *
@@ -2312,11 +2414,12 @@ declare module OpenEO {
2312
2414
  *
2313
2415
  * @async
2314
2416
  * @param {string} url - The server URL to connect to.
2417
+ * @param {Options} [options={}] - Additional options for the connection.
2315
2418
  * @returns {Promise<Connection>}
2316
2419
  * @throws {Error}
2317
2420
  * @static
2318
2421
  */
2319
- static connect(url: string): Promise<Connection>;
2422
+ static connect(url: string, options?: Options): Promise<Connection>;
2320
2423
  /**
2321
2424
  * Connects directly to a back-end instance, without version discovery (NOT recommended).
2322
2425
  *
@@ -2324,11 +2427,12 @@ declare module OpenEO {
2324
2427
  *
2325
2428
  * @async
2326
2429
  * @param {string} versionedUrl - The server URL to connect to.
2430
+ * @param {Options} [options={}] - Additional options for the connection.
2327
2431
  * @returns {Promise<Connection>}
2328
2432
  * @throws {Error}
2329
2433
  * @static
2330
2434
  */
2331
- static connectDirect(versionedUrl: string): Promise<Connection>;
2435
+ static connectDirect(versionedUrl: string, options?: Options): Promise<Connection>;
2332
2436
  /**
2333
2437
  * Returns the version number of the client.
2334
2438
  *
@@ -2568,9 +2672,22 @@ declare module OpenEO {
2568
2672
  */
2569
2673
  links: Array<Link>;
2570
2674
  };
2675
+ /**
2676
+ * Connection options.
2677
+ */
2678
+ export type Options = {
2679
+ /**
2680
+ * Add a namespace property to processes if set to `true`. Defaults to `false`.
2681
+ */
2682
+ addNamespaceToProcess: boolean;
2683
+ };
2571
2684
  export type Processes = {
2572
2685
  processes: Array<Process>;
2573
2686
  links: Array<Link>;
2687
+ /**
2688
+ * EXPERIMENTAL!
2689
+ */
2690
+ namespaces: Array<string> | null;
2574
2691
  };
2575
2692
  /**
2576
2693
  * An openEO processing chain.
@@ -2608,10 +2725,11 @@ declare module OpenEO {
2608
2725
  };
2609
2726
  export type UserAccount = {
2610
2727
  user_id: string;
2611
- name: string;
2612
- storage: UserAccountStorage;
2728
+ name: string | null;
2729
+ default_plan: string | null;
2730
+ storage: UserAccountStorage | null;
2613
2731
  budget: number | null;
2614
- links: Array<Link>;
2732
+ links: Array<Link> | null;
2615
2733
  };
2616
2734
 
2617
2735
  }