@sovity.de/edc-client 7.2.2 → 7.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
@@ -24,7 +24,7 @@ You can find our API Wrapper Project
24
24
 
25
25
  ## How to install
26
26
 
27
- Requires a NodeJS / NPM project.
27
+ Requires global fetch API (provided by Node.js 18+ or browser).
28
28
 
29
29
  ```shell script
30
30
  npm i --save @sovity.de/edc-client
@@ -34,6 +34,8 @@ npm i --save @sovity.de/edc-client
34
34
 
35
35
  Configure your EDC Client and use endpoints of our API Wrapper Extension:
36
36
 
37
+ ### Example Using API Key Auth
38
+
37
39
  ```typescript
38
40
  const edcClient: EdcClient = buildEdcClient({
39
41
  managementApiUrl: 'http://localhost:11002/api/management/v2',
@@ -46,6 +48,21 @@ let kpiData: KpiResult = await edcClient.useCaseApi.getKpis();
46
48
  A minimal example project using the typescript API client can be found
47
49
  [here](https://github.com/sovity/edc-extensions/tree/main/extensions/wrapper/clients/typescript-client-example).
48
50
 
51
+ ### Example Using OAuth2 Client Credentials
52
+
53
+ ```typescript
54
+ const edcClient: EdcClient = buildEdcClient({
55
+ managementApiUrl: 'http://localhost:11002/api/management/v2',
56
+ clientCredentials: {
57
+ tokenUrl: 'http://localhost:11002/token',
58
+ clientId: '{{your-connector}}-app',
59
+ clientSecret: '...',
60
+ },
61
+ });
62
+
63
+ let kpiData: KpiResult = await edcClient.useCaseApi.getKpis();
64
+ ```
65
+
49
66
  ## License
50
67
 
51
68
  Apache License 2.0 - see
@@ -82,6 +82,15 @@ export declare function buildEdcClient(opts: EdcClientOptions): EdcClient;
82
82
 
83
83
  export declare function canConsumeForm(consumes: Consume[]): boolean;
84
84
 
85
+ /**
86
+ * Credentials for connecting to the EDC via the OAuth2 "Client Credentials" flow.
87
+ */
88
+ declare interface ClientCredentials {
89
+ tokenUrl: string;
90
+ clientId: string;
91
+ clientSecret: string;
92
+ }
93
+
85
94
  export declare const COLLECTION_FORMATS: {
86
95
  csv: string;
87
96
  ssv: string;
@@ -734,6 +743,7 @@ export declare interface EdcClient {
734
743
  export declare interface EdcClientOptions {
735
744
  managementApiUrl: string;
736
745
  managementApiKey?: string;
746
+ clientCredentials?: ClientCredentials;
737
747
  configOverrides?: Partial<ConfigurationParameters>;
738
748
  }
739
749
 
@@ -1921,43 +1931,35 @@ export declare interface UiAsset {
1921
1931
  */
1922
1932
  temporalCoverageToInclusive?: Date;
1923
1933
  /**
1924
- * Unhandled Asset Properties (that were strings)
1925
- * @type {{ [key: string]: string; }}
1934
+ * Contains the entire asset in the JSON-LD format
1935
+ * @type {string}
1926
1936
  * @memberof UiAsset
1927
1937
  */
1928
- additionalProperties?: {
1929
- [key: string]: string;
1930
- };
1938
+ assetJsonLd?: string;
1931
1939
  /**
1932
- * Unhandled Asset Properties (that were not strings but other JSON values)
1933
- * @type {{ [key: string]: string; }}
1940
+ * Contains serialized custom properties in the JSON format.
1941
+ * @type {string}
1934
1942
  * @memberof UiAsset
1935
1943
  */
1936
- additionalJsonProperties?: {
1937
- [key: string]: string;
1938
- };
1944
+ customJsonAsString?: string;
1939
1945
  /**
1940
- * Private Asset Properties (that were strings)
1941
- * @type {{ [key: string]: string; }}
1946
+ * Contains serialized custom properties in the JSON LD format. Contrary to the customJsonAsString field, this string must represent a JSON LD object and will be affected by JSON LD compaction and expansion. Due to a technical limitation, the properties can't be booleans.
1947
+ * @type {string}
1942
1948
  * @memberof UiAsset
1943
1949
  */
1944
- privateProperties?: {
1945
- [key: string]: string;
1946
- };
1950
+ customJsonLdAsString?: string;
1947
1951
  /**
1948
- * Private Asset Properties (that were not strings but other JSON values)
1949
- * @type {{ [key: string]: string; }}
1952
+ * Same as customJsonAsString but the data will be stored in the private properties.
1953
+ * @type {string}
1950
1954
  * @memberof UiAsset
1951
1955
  */
1952
- privateJsonProperties?: {
1953
- [key: string]: string;
1954
- };
1956
+ privateCustomJsonAsString?: string;
1955
1957
  /**
1956
- * Contains the entire asset in the JSON-LD format
1958
+ * Same as customJsonLdAsString but the data will be stored in the private properties. The same limitations apply.
1957
1959
  * @type {string}
1958
1960
  * @memberof UiAsset
1959
1961
  */
1960
- assetJsonLd?: string;
1962
+ privateCustomJsonLdAsString?: string;
1961
1963
  }
1962
1964
 
1963
1965
  /**
@@ -2125,37 +2127,29 @@ export declare interface UiAssetCreateRequest {
2125
2127
  [key: string]: string;
2126
2128
  };
2127
2129
  /**
2128
- * Custom Asset Properties (that are strings)
2129
- * @type {{ [key: string]: string; }}
2130
+ * Contains serialized custom properties in the JSON format.
2131
+ * @type {string}
2130
2132
  * @memberof UiAssetCreateRequest
2131
2133
  */
2132
- additionalProperties?: {
2133
- [key: string]: string;
2134
- };
2134
+ customJsonAsString?: string;
2135
2135
  /**
2136
- * Custom Asset Properties (that are not strings but other JSON values)
2137
- * @type {{ [key: string]: string; }}
2136
+ * Contains serialized custom properties in the JSON LD format. Contrary to the customJsonAsString field, this string must represent a JSON LD object and will be affected by JSON LD compaction and expansion. Due to a technical limitation, the properties can't be booleans.
2137
+ * @type {string}
2138
2138
  * @memberof UiAssetCreateRequest
2139
2139
  */
2140
- additionalJsonProperties?: {
2141
- [key: string]: string;
2142
- };
2140
+ customJsonLdAsString?: string;
2143
2141
  /**
2144
- * Private Asset Properties (that are strings)
2145
- * @type {{ [key: string]: string; }}
2142
+ * Same as customJsonAsString but the data will be stored in the private properties.
2143
+ * @type {string}
2146
2144
  * @memberof UiAssetCreateRequest
2147
2145
  */
2148
- privateProperties?: {
2149
- [key: string]: string;
2150
- };
2146
+ privateCustomJsonAsString?: string;
2151
2147
  /**
2152
- * Private Asset Properties (that are not strings but other JSON values)
2153
- * @type {{ [key: string]: string; }}
2148
+ * Same as customJsonLdAsString but the data will be stored in the private properties. The same limitations apply.
2149
+ * @type {string}
2154
2150
  * @memberof UiAssetCreateRequest
2155
2151
  */
2156
- privateJsonProperties?: {
2157
- [key: string]: string;
2158
- };
2152
+ privateCustomJsonLdAsString?: string;
2159
2153
  }
2160
2154
 
2161
2155
  export declare function UiAssetCreateRequestFromJSON(json: any): UiAssetCreateRequest;
@@ -2315,37 +2309,29 @@ export declare interface UiAssetEditMetadataRequest {
2315
2309
  */
2316
2310
  temporalCoverageToInclusive?: Date;
2317
2311
  /**
2318
- * Custom Asset Properties (that are strings)
2319
- * @type {{ [key: string]: string; }}
2312
+ * Contains serialized custom properties in the JSON format.
2313
+ * @type {string}
2320
2314
  * @memberof UiAssetEditMetadataRequest
2321
2315
  */
2322
- additionalProperties?: {
2323
- [key: string]: string;
2324
- };
2316
+ customJsonAsString?: string;
2325
2317
  /**
2326
- * Custom Asset Properties (that are not strings but other JSON values)
2327
- * @type {{ [key: string]: string; }}
2318
+ * Contains serialized custom properties in the JSON LD format. Contrary to the customJsonAsString field, this string must represent a JSON LD object and will be affected by JSON LD compaction and expansion. Due to a technical limitation, the properties can't be booleans.
2319
+ * @type {string}
2328
2320
  * @memberof UiAssetEditMetadataRequest
2329
2321
  */
2330
- additionalJsonProperties?: {
2331
- [key: string]: string;
2332
- };
2322
+ customJsonLdAsString?: string;
2333
2323
  /**
2334
- * Private Asset Properties (that are strings)
2335
- * @type {{ [key: string]: string; }}
2324
+ * Same as customJsonAsString but the data will be stored in the private properties.
2325
+ * @type {string}
2336
2326
  * @memberof UiAssetEditMetadataRequest
2337
2327
  */
2338
- privateProperties?: {
2339
- [key: string]: string;
2340
- };
2328
+ privateCustomJsonAsString?: string;
2341
2329
  /**
2342
- * Private Asset Properties (that are not strings but other JSON values)
2343
- * @type {{ [key: string]: string; }}
2330
+ * Same as customJsonLdAsString but the data will be stored in the private properties. The same limitations apply.
2331
+ * @type {string}
2344
2332
  * @memberof UiAssetEditMetadataRequest
2345
2333
  */
2346
- privateJsonProperties?: {
2347
- [key: string]: string;
2348
- };
2334
+ privateCustomJsonLdAsString?: string;
2349
2335
  }
2350
2336
 
2351
2337
  export declare function UiAssetEditMetadataRequestFromJSON(json: any): UiAssetEditMetadataRequest;