@ts4nfdi/terminology-service-suite 7.6.1 → 7.7.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.
@@ -1,5 +1,6 @@
1
1
  export declare const TIB_API_ENDPOINT = "https://api.terminology.tib.eu/api/";
2
2
  export declare const GATEWAY_API_OLS_ENDPOINT = "https://terminology.services.base4nfdi.de/api-gateway/ols4/api/";
3
+ export declare const GATEWAY_API_MOD_ENDPOINT = "https://terminology.services.base4nfdi.de/api-gateway/";
3
4
  export declare const ZBMED_OLS4_API = "https://semanticlookup.zbmed.de/ols/api/";
4
5
  export declare const ZBMED_OLS3_API = "https://ols3-semanticlookup.zbmed.de/ols/api/";
5
6
  export declare const ZBMED_OLS4_GATEWAY_API = "https://semanticlookup.zbmed.de/api/";
@@ -4,7 +4,7 @@ import { EuiComboBoxProps } from '@elastic/eui/src/components/combo_box/combo_bo
4
4
  import { EuiLinkColor } from '@elastic/eui/src/components/link/link';
5
5
  import { EuiTextProps } from '@elastic/eui/src/components/text/text';
6
6
  import { EntityValue } from '../components/widgets/AutocompleteWidget/AutocompleteWidget';
7
- import { Entity, Ontology, Ontologies, Individual, Thing } from '../model/interfaces';
7
+ import { Entity, Individual, Ontologies, Ontology, Thing } from '../model/interfaces';
8
8
  import { BuildHierarchyProps, HierarchyIriProp } from '../model/interfaces/HierarchyBuilder';
9
9
  import { EntityTypeName, ThingTypeName } from '../model/ModelTypeCheck';
10
10
  import { default as Reified } from '../model/Reified';
@@ -189,7 +189,18 @@ export type AutocompleteWidgetProps = Partial<EuiComboBoxProps<EntityValue>> & P
189
189
  */
190
190
  showApiRequestButton?: boolean;
191
191
  };
192
- export type DataContentWidgetProps = ApiObj & ParameterObj;
192
+ export type DataContentWidgetProps = {
193
+ /**
194
+ * The API instance for the API call.
195
+ */
196
+ api?: string;
197
+ } & ParameterObj & {
198
+ /**
199
+ * The id of a TS4NFDI API Gateway collection. If set, the statistics of
200
+ * that collection are shown instead of the OLS ontologies data.
201
+ */
202
+ collectionId?: string;
203
+ };
193
204
  export type DataContentPresentationProps = EuiTextProps & {
194
205
  ontologiesData?: Ontologies;
195
206
  isLoading?: boolean;
@@ -940,4 +951,28 @@ export type UseEntityProviderResult = {
940
951
  */
941
952
  error?: Error;
942
953
  };
954
+ export type UseCollectionStatisticsProps = {
955
+ /**
956
+ * The API instance for the API call. Defaults to the TS4NFDI API Gateway.
957
+ */
958
+ api?: string;
959
+ /**
960
+ * The id of the collection whose statistics are shown.
961
+ */
962
+ collectionId?: string;
963
+ /**
964
+ * If false, no request is made and the result stays empty. Default is true.
965
+ */
966
+ enabled?: boolean;
967
+ };
968
+ export type UseCollectionStatisticsResult = {
969
+ /**
970
+ * The latest statistics of the collection, in the shape expected by the
971
+ * DataContentPresentation.
972
+ */
973
+ ontologiesData?: Ontologies;
974
+ isLoading: boolean;
975
+ isError: boolean;
976
+ dataUpdatedAt?: number;
977
+ };
943
978
  export {};
@@ -23,5 +23,6 @@ declare const meta: {
23
23
  export default meta;
24
24
  type Story = StoryObj<typeof meta>;
25
25
  export declare const NFDI4HealthDataContentWidget: Story;
26
- export declare const SafetyDataContentWidget: Story;
27
26
  export declare const ErrorDataContentWidget: Story;
27
+ export declare const DataContentFAIRagroCollection: Story;
28
+ export declare const DataContentCollectionWithoutProperties: Story;
@@ -9,11 +9,17 @@ export declare const NFDI4HealthDataContentWidgetArgs: {
9
9
  api: string;
10
10
  parameter: string;
11
11
  };
12
- export declare const SafetyDataContentWidgetArgs: {
12
+ export declare const ErrorDataContentWidgetArgs: {
13
13
  api: string;
14
14
  parameter: string;
15
15
  };
16
- export declare const ErrorDataContentWidgetArgs: {
16
+ export declare const DataContentFAIRagroCollectionArgs: {
17
+ collectionId: string;
18
+ api: string;
19
+ parameter: string;
20
+ };
21
+ export declare const DataContentCollectionWithoutPropertiesArgs: {
22
+ collectionId: string;
17
23
  api: string;
18
24
  parameter: string;
19
25
  };
@@ -1,2 +1,3 @@
1
1
  export { DataContentPresentation } from './DataContentPresentation';
2
2
  export { DataContentWidget } from './DataContentWidget';
3
+ export { useCollectionStatistics } from './useCollectionStatistics';
@@ -0,0 +1,15 @@
1
+ import { UseCollectionStatisticsResult } from '../../../app';
2
+ /**
3
+ * React hook returning the statistics of a collection of the TS4NFDI API
4
+ * Gateway.
5
+ *
6
+ * @example
7
+ * const { ontologiesData, isLoading } = useCollectionStatistics({
8
+ * collectionId: "dc45621d-7e40-47ce-9616-4133f0b54edf",
9
+ * });
10
+ */
11
+ export declare function useCollectionStatistics(props: {
12
+ statisticsApi: any;
13
+ collectionId: string | undefined;
14
+ enabled: boolean;
15
+ }): UseCollectionStatisticsResult;