@twin.org/federated-catalogue-rest-client 0.0.3-next.21 → 0.0.3-next.22
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.
|
@@ -30,7 +30,7 @@ export class FederatedCatalogueRestClient extends BaseRestClient {
|
|
|
30
30
|
* Retrieve a specific dataset by its unique identifier.
|
|
31
31
|
* @param datasetId The unique identifier of the dataset.
|
|
32
32
|
* @param trustPayload Optional payload for trust evaluation, if applicable.
|
|
33
|
-
* @returns
|
|
33
|
+
* @returns A promise that resolves with the dataset if found, or a CatalogError if not found or an error occurs.
|
|
34
34
|
*/
|
|
35
35
|
async get(datasetId, trustPayload) {
|
|
36
36
|
Guards.stringValue(FederatedCatalogueRestClient.CLASS_NAME, "datasetId", datasetId);
|
|
@@ -50,7 +50,7 @@ export class FederatedCatalogueRestClient extends BaseRestClient {
|
|
|
50
50
|
* This method is internal and is not exposed via REST endpoints.
|
|
51
51
|
* @param dataset The dataset to store.
|
|
52
52
|
* @param trustPayload Optional payload for trust evaluation, if applicable.
|
|
53
|
-
* @returns
|
|
53
|
+
* @returns A promise that resolves with the unique identifier of the stored dataset, or a CatalogError if an error occurs.
|
|
54
54
|
*/
|
|
55
55
|
async set(dataset, trustPayload) {
|
|
56
56
|
Guards.object(FederatedCatalogueRestClient.CLASS_NAME, "dataset", dataset);
|
|
@@ -68,7 +68,7 @@ export class FederatedCatalogueRestClient extends BaseRestClient {
|
|
|
68
68
|
* This method is internal and is not exposed via REST endpoints.
|
|
69
69
|
* @param datasetId The unique identifier of the dataset to remove.
|
|
70
70
|
* @param trustPayload Optional payload for trust evaluation, if applicable.
|
|
71
|
-
* @returns
|
|
71
|
+
* @returns A promise that resolves with undefined on success, or a CatalogError if removal fails.
|
|
72
72
|
*/
|
|
73
73
|
async remove(datasetId, trustPayload) {
|
|
74
74
|
Guards.stringValue(FederatedCatalogueRestClient.CLASS_NAME, "datasetId", datasetId);
|
|
@@ -89,7 +89,7 @@ export class FederatedCatalogueRestClient extends BaseRestClient {
|
|
|
89
89
|
* @param cursor Optional cursor for pagination.
|
|
90
90
|
* @param limit Optional limit for pagination.
|
|
91
91
|
* @param trustPayload Optional payload for trust evaluation, if applicable.
|
|
92
|
-
* @returns
|
|
92
|
+
* @returns A promise that resolves with the catalog result and optional next-page cursor.
|
|
93
93
|
*/
|
|
94
94
|
async query(filter, cursor, limit, trustPayload) {
|
|
95
95
|
Guards.stringValue(FederatedCatalogueRestClient.CLASS_NAME, "trustPayload", trustPayload);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"federatedCatalogueRestClient.js","sourceRoot":"","sources":["../../src/federatedCatalogueRestClient.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAahD,OAAO,EACN,6BAA6B,EAC7B,yBAAyB,EAGzB,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE1D;;GAEG;AACH,MAAM,OAAO,4BACZ,SAAQ,cAAc;IAGtB;;OAEG;IACI,MAAM,CAAU,UAAU,kCAAkD;IAEnF;;;OAGG;IACH,YAAY,MAA6B;QACxC,KAAK,iCAAyC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAC9E,CAAC;IAED;;;OAGG;IACI,SAAS;QACf,OAAO,4BAA4B,CAAC,UAAU,CAAC;IAChD,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,GAAG,CACf,SAAiB,EACjB,YAAqB;QAErB,MAAM,CAAC,WAAW,CAAC,4BAA4B,CAAC,UAAU,eAAqB,SAAS,CAAC,CAAC;QAC1F,MAAM,CAAC,WAAW,CAAC,4BAA4B,CAAC,UAAU,kBAAwB,YAAY,CAAC,CAAC;QAEhG,MAAM,QAAQ,GAAG,M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AE;gBACX,SAAS;aACT;SACD,CACD,CAAC;QAEF,OAAO,MAAM,CAAC,IAAI,CAAC;IACpB,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,KAAK,CACjB,MAA6B,EAC7B,MAA0B,EAC1B,KAAyB,EACzB,YAAqB;QAKrB,MAAM,CAAC,WAAW,CAAC,4BAA4B,CAAC,UAAU,kBAAwB,YAAY,CAAC,CAAC;QAChG,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,KAAK,CAChC,UAAU,EACV,MAAM,EACN;YACC,OAAO,EAAE;gBACR,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,YAAY,CAAC,YAAY,CAAC,YAAY,CAAC;aACpE;YACD,KAAK,EAAE;gBACN,MAAM;gBACN,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;aAC3B;YACD,IAAI,EAAE;gBACL,UAAU,EAAE,CAAC,yBAAyB,CAAC,OAAO,CAAC;gBAC/C,OAAO,EAAE,6BAA6B,CAAC,qBAAqB;gBAC5D,MAAM;aACN;SACD,CACD,CAAC;QAEF,OAAO;YACN,MAAM,EAAE,QAAQ,CAAC,IAAI;YACrB,MAAM,EAAE,YAAY,CAAC,yBAAyB,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;gBAC3F,EAAE,cAAc,EAAE,MAAM;SACzB,CAAC;IACH,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { BaseRestClient } from \"@twin.org/api-core\";\nimport type { IBaseRestClientConfig } from \"@twin.org/api-models\";\nimport { Coerce, Guards } from \"@twin.org/core\";\nimport type {\n\tICatalogRequestRequest,\n\tICatalogRequestResponse,\n\tIDatasetGetRequest,\n\tIDatasetGetResponse,\n\tIDatasetRemoveRequest,\n\tIDatasetRemoveResponse,\n\tIDatasetSetRequest,\n\tIDatasetSetResponse,\n\tIFederatedCatalogueComponent\n} from \"@twin.org/federated-catalogue-models\";\nimport { nameof } from \"@twin.org/nameof\";\nimport {\n\tDataspaceProtocolCatalogTypes,\n\tDataspaceProtocolContexts,\n\ttype IDataspaceProtocolCatalog,\n\ttype IDataspaceProtocolCatalogError\n} from \"@twin.org/standards-dataspace-protocol\";\nimport type { IDcatDataset } from \"@twin.org/standards-w3c-dcat\";\nimport { HeaderHelper, HeaderTypes } from \"@twin.org/web\";\n\n/**\n * Client for performing federated catalogue operations through REST endpoints.\n */\nexport class FederatedCatalogueRestClient\n\textends BaseRestClient\n\timplements IFederatedCatalogueComponent\n{\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<FederatedCatalogueRestClient>();\n\n\t/**\n\t * Create a new instance of FederatedCatalogueRestClient.\n\t * @param config The configuration for the client.\n\t */\n\tconstructor(config: IBaseRestClientConfig) {\n\t\tsuper(nameof<FederatedCatalogueRestClient>(), config, \"federated-catalogue\");\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn FederatedCatalogueRestClient.CLASS_NAME;\n\t}\n\n\t/**\n\t * Retrieve a specific dataset by its unique identifier.\n\t * @param datasetId The unique identifier of the dataset.\n\t * @param trustPayload Optional payload for trust evaluation, if applicable.\n\t * @returns
|
|
1
|
+
{"version":3,"file":"federatedCatalogueRestClient.js","sourceRoot":"","sources":["../../src/federatedCatalogueRestClient.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAahD,OAAO,EACN,6BAA6B,EAC7B,yBAAyB,EAGzB,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE1D;;GAEG;AACH,MAAM,OAAO,4BAC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yBAAyB,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;gBAC3F,EAAE,cAAc,EAAE,MAAM;SACzB,CAAC;IACH,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { BaseRestClient } from \"@twin.org/api-core\";\nimport type { IBaseRestClientConfig } from \"@twin.org/api-models\";\nimport { Coerce, Guards } from \"@twin.org/core\";\nimport type {\n\tICatalogRequestRequest,\n\tICatalogRequestResponse,\n\tIDatasetGetRequest,\n\tIDatasetGetResponse,\n\tIDatasetRemoveRequest,\n\tIDatasetRemoveResponse,\n\tIDatasetSetRequest,\n\tIDatasetSetResponse,\n\tIFederatedCatalogueComponent\n} from \"@twin.org/federated-catalogue-models\";\nimport { nameof } from \"@twin.org/nameof\";\nimport {\n\tDataspaceProtocolCatalogTypes,\n\tDataspaceProtocolContexts,\n\ttype IDataspaceProtocolCatalog,\n\ttype IDataspaceProtocolCatalogError\n} from \"@twin.org/standards-dataspace-protocol\";\nimport type { IDcatDataset } from \"@twin.org/standards-w3c-dcat\";\nimport { HeaderHelper, HeaderTypes } from \"@twin.org/web\";\n\n/**\n * Client for performing federated catalogue operations through REST endpoints.\n */\nexport class FederatedCatalogueRestClient\n\textends BaseRestClient\n\timplements IFederatedCatalogueComponent\n{\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<FederatedCatalogueRestClient>();\n\n\t/**\n\t * Create a new instance of FederatedCatalogueRestClient.\n\t * @param config The configuration for the client.\n\t */\n\tconstructor(config: IBaseRestClientConfig) {\n\t\tsuper(nameof<FederatedCatalogueRestClient>(), config, \"federated-catalogue\");\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn FederatedCatalogueRestClient.CLASS_NAME;\n\t}\n\n\t/**\n\t * Retrieve a specific dataset by its unique identifier.\n\t * @param datasetId The unique identifier of the dataset.\n\t * @param trustPayload Optional payload for trust evaluation, if applicable.\n\t * @returns A promise that resolves with the dataset if found, or a CatalogError if not found or an error occurs.\n\t */\n\tpublic async get(\n\t\tdatasetId: string,\n\t\ttrustPayload: unknown\n\t): Promise<IDcatDataset | IDataspaceProtocolCatalogError> {\n\t\tGuards.stringValue(FederatedCatalogueRestClient.CLASS_NAME, nameof(datasetId), datasetId);\n\t\tGuards.stringValue(FederatedCatalogueRestClient.CLASS_NAME, nameof(trustPayload), trustPayload);\n\n\t\tconst response = await this.fetch<IDatasetGetRequest, IDatasetGetResponse>(\n\t\t\t\"/datasets/:datasetId\",\n\t\t\t\"GET\",\n\t\t\t{\n\t\t\t\theaders: {\n\t\t\t\t\t[HeaderTypes.Authorization]: HeaderHelper.createBearer(trustPayload)\n\t\t\t\t},\n\t\t\t\tpathParams: {\n\t\t\t\t\tdatasetId\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn response.body;\n\t}\n\n\t/**\n\t * Insert or update a dataset in the catalogue.\n\t * This method is internal and is not exposed via REST endpoints.\n\t * @param dataset The dataset to store.\n\t * @param trustPayload Optional payload for trust evaluation, if applicable.\n\t * @returns A promise that resolves with the unique identifier of the stored dataset, or a CatalogError if an error occurs.\n\t */\n\tpublic async set(\n\t\tdataset: IDcatDataset,\n\t\ttrustPayload: unknown\n\t): Promise<string | IDataspaceProtocolCatalogError> {\n\t\tGuards.object<IDcatDataset>(FederatedCatalogueRestClient.CLASS_NAME, nameof(dataset), dataset);\n\t\tGuards.stringValue(FederatedCatalogueRestClient.CLASS_NAME, nameof(trustPayload), trustPayload);\n\n\t\tconst response = await this.fetch<IDatasetSetRequest, IDatasetSetResponse>(\n\t\t\t\"/datasets\",\n\t\t\t\"POST\",\n\t\t\t{\n\t\t\t\theaders: {\n\t\t\t\t\t[HeaderTypes.Authorization]: HeaderHelper.createBearer(trustPayload)\n\t\t\t\t},\n\t\t\t\tbody: dataset\n\t\t\t}\n\t\t);\n\n\t\treturn response.headers?.[HeaderTypes.Location] ?? response.body ?? \"\";\n\t}\n\n\t/**\n\t * Remove a dataset from the catalogue by its unique identifier.\n\t * This method is internal and is not exposed via REST endpoints.\n\t * @param datasetId The unique identifier of the dataset to remove.\n\t * @param trustPayload Optional payload for trust evaluation, if applicable.\n\t * @returns A promise that resolves with undefined on success, or a CatalogError if removal fails.\n\t */\n\tpublic async remove(\n\t\tdatasetId: string,\n\t\ttrustPayload: unknown\n\t): Promise<IDataspaceProtocolCatalogError | undefined> {\n\t\tGuards.stringValue(FederatedCatalogueRestClient.CLASS_NAME, nameof(datasetId), datasetId);\n\t\tGuards.stringValue(FederatedCatalogueRestClient.CLASS_NAME, nameof(trustPayload), trustPayload);\n\n\t\tconst result = await this.fetch<IDatasetRemoveRequest, IDatasetRemoveResponse>(\n\t\t\t\"/datasets/:datasetId\",\n\t\t\t\"DELETE\",\n\t\t\t{\n\t\t\t\theaders: {\n\t\t\t\t\t[HeaderTypes.Authorization]: HeaderHelper.createBearer(trustPayload)\n\t\t\t\t},\n\t\t\t\tpathParams: {\n\t\t\t\t\tdatasetId\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn result.body;\n\t}\n\n\t/**\n\t * Query the federated catalogue with an optional filter.\n\t * @param filter Optional filter criteria for querying datasets.\n\t * @param cursor Optional cursor for pagination.\n\t * @param limit Optional limit for pagination.\n\t * @param trustPayload Optional payload for trust evaluation, if applicable.\n\t * @returns A promise that resolves with the catalog result and optional next-page cursor.\n\t */\n\tpublic async query(\n\t\tfilter: unknown[] | undefined,\n\t\tcursor: string | undefined,\n\t\tlimit: number | undefined,\n\t\ttrustPayload: unknown\n\t): Promise<{\n\t\tresult: IDataspaceProtocolCatalog | IDataspaceProtocolCatalogError;\n\t\tcursor?: string;\n\t}> {\n\t\tGuards.stringValue(FederatedCatalogueRestClient.CLASS_NAME, nameof(trustPayload), trustPayload);\n\t\tconst response = await this.fetch<ICatalogRequestRequest, ICatalogRequestResponse>(\n\t\t\t\"/request\",\n\t\t\t\"POST\",\n\t\t\t{\n\t\t\t\theaders: {\n\t\t\t\t\t[HeaderTypes.Authorization]: HeaderHelper.createBearer(trustPayload)\n\t\t\t\t},\n\t\t\t\tquery: {\n\t\t\t\t\tcursor,\n\t\t\t\t\tlimit: Coerce.string(limit)\n\t\t\t\t},\n\t\t\t\tbody: {\n\t\t\t\t\t\"@context\": [DataspaceProtocolContexts.Context],\n\t\t\t\t\t\"@type\": DataspaceProtocolCatalogTypes.CatalogRequestMessage,\n\t\t\t\t\tfilter\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn {\n\t\t\tresult: response.body,\n\t\t\tcursor: HeaderHelper.extractLinkHeaderRelation(response.headers?.[HeaderTypes.Link], \"next\")\n\t\t\t\t?.urlQueryParams?.cursor\n\t\t};\n\t}\n}\n"]}
|
|
@@ -25,7 +25,7 @@ export declare class FederatedCatalogueRestClient extends BaseRestClient impleme
|
|
|
25
25
|
* Retrieve a specific dataset by its unique identifier.
|
|
26
26
|
* @param datasetId The unique identifier of the dataset.
|
|
27
27
|
* @param trustPayload Optional payload for trust evaluation, if applicable.
|
|
28
|
-
* @returns
|
|
28
|
+
* @returns A promise that resolves with the dataset if found, or a CatalogError if not found or an error occurs.
|
|
29
29
|
*/
|
|
30
30
|
get(datasetId: string, trustPayload: unknown): Promise<IDcatDataset | IDataspaceProtocolCatalogError>;
|
|
31
31
|
/**
|
|
@@ -33,7 +33,7 @@ export declare class FederatedCatalogueRestClient extends BaseRestClient impleme
|
|
|
33
33
|
* This method is internal and is not exposed via REST endpoints.
|
|
34
34
|
* @param dataset The dataset to store.
|
|
35
35
|
* @param trustPayload Optional payload for trust evaluation, if applicable.
|
|
36
|
-
* @returns
|
|
36
|
+
* @returns A promise that resolves with the unique identifier of the stored dataset, or a CatalogError if an error occurs.
|
|
37
37
|
*/
|
|
38
38
|
set(dataset: IDcatDataset, trustPayload: unknown): Promise<string | IDataspaceProtocolCatalogError>;
|
|
39
39
|
/**
|
|
@@ -41,7 +41,7 @@ export declare class FederatedCatalogueRestClient extends BaseRestClient impleme
|
|
|
41
41
|
* This method is internal and is not exposed via REST endpoints.
|
|
42
42
|
* @param datasetId The unique identifier of the dataset to remove.
|
|
43
43
|
* @param trustPayload Optional payload for trust evaluation, if applicable.
|
|
44
|
-
* @returns
|
|
44
|
+
* @returns A promise that resolves with undefined on success, or a CatalogError if removal fails.
|
|
45
45
|
*/
|
|
46
46
|
remove(datasetId: string, trustPayload: unknown): Promise<IDataspaceProtocolCatalogError | undefined>;
|
|
47
47
|
/**
|
|
@@ -50,7 +50,7 @@ export declare class FederatedCatalogueRestClient extends BaseRestClient impleme
|
|
|
50
50
|
* @param cursor Optional cursor for pagination.
|
|
51
51
|
* @param limit Optional limit for pagination.
|
|
52
52
|
* @param trustPayload Optional payload for trust evaluation, if applicable.
|
|
53
|
-
* @returns
|
|
53
|
+
* @returns A promise that resolves with the catalog result and optional next-page cursor.
|
|
54
54
|
*/
|
|
55
55
|
query(filter: unknown[] | undefined, cursor: string | undefined, limit: number | undefined, trustPayload: unknown): Promise<{
|
|
56
56
|
result: IDataspaceProtocolCatalog | IDataspaceProtocolCatalogError;
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.22](https://github.com/iotaledger/twin-federated-catalogue/compare/federated-catalogue-rest-client-v0.0.3-next.21...federated-catalogue-rest-client-v0.0.3-next.22) (2026-06-18)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* **federated-catalogue-rest-client:** Synchronize repo versions
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/federated-catalogue-models bumped from 0.0.3-next.21 to 0.0.3-next.22
|
|
16
|
+
|
|
3
17
|
## [0.0.3-next.21](https://github.com/iotaledger/twin-federated-catalogue/compare/federated-catalogue-rest-client-v0.0.3-next.20...federated-catalogue-rest-client-v0.0.3-next.21) (2026-06-12)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -86,7 +86,7 @@ Optional payload for trust evaluation, if applicable.
|
|
|
86
86
|
|
|
87
87
|
`Promise`\<`IDcatDataset` \| `IDataspaceProtocolCatalogError`\>
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
A promise that resolves with the dataset if found, or a CatalogError if not found or an error occurs.
|
|
90
90
|
|
|
91
91
|
#### Implementation of
|
|
92
92
|
|
|
@@ -119,7 +119,7 @@ Optional payload for trust evaluation, if applicable.
|
|
|
119
119
|
|
|
120
120
|
`Promise`\<`string` \| `IDataspaceProtocolCatalogError`\>
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
A promise that resolves with the unique identifier of the stored dataset, or a CatalogError if an error occurs.
|
|
123
123
|
|
|
124
124
|
#### Implementation of
|
|
125
125
|
|
|
@@ -152,7 +152,7 @@ Optional payload for trust evaluation, if applicable.
|
|
|
152
152
|
|
|
153
153
|
`Promise`\<`IDataspaceProtocolCatalogError` \| `undefined`\>
|
|
154
154
|
|
|
155
|
-
|
|
155
|
+
A promise that resolves with undefined on success, or a CatalogError if removal fails.
|
|
156
156
|
|
|
157
157
|
#### Implementation of
|
|
158
158
|
|
|
@@ -196,7 +196,7 @@ Optional payload for trust evaluation, if applicable.
|
|
|
196
196
|
|
|
197
197
|
`Promise`\<\{ `result`: `IDataspaceProtocolCatalogError` \| `IDataspaceProtocolCatalog`; `cursor?`: `string`; \}\>
|
|
198
198
|
|
|
199
|
-
|
|
199
|
+
A promise that resolves with the catalog result and optional next-page cursor.
|
|
200
200
|
|
|
201
201
|
#### Implementation of
|
|
202
202
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/federated-catalogue-rest-client",
|
|
3
|
-
"version": "0.0.3-next.
|
|
3
|
+
"version": "0.0.3-next.22",
|
|
4
4
|
"description": "Federated Catalogue contract implementation which can connect to REST endpoints",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@twin.org/context": "next",
|
|
20
20
|
"@twin.org/core": "next",
|
|
21
21
|
"@twin.org/data-json-ld": "next",
|
|
22
|
-
"@twin.org/federated-catalogue-models": "0.0.3-next.
|
|
22
|
+
"@twin.org/federated-catalogue-models": "0.0.3-next.22",
|
|
23
23
|
"@twin.org/nameof": "next",
|
|
24
24
|
"@twin.org/standards-dataspace-protocol": "next",
|
|
25
25
|
"@twin.org/standards-w3c-dcat": "next",
|