From c517683acb9002e183a3f529b4569cccbab6a899 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20Prod=27homme?=
Date: Fri, 25 Oct 2024 15:17:43 +0200
Subject: [PATCH] feat(client): Install orval, Query, Axios and Husky
---
.husky/pre-commit | 2 +
client/.eslintignore | 3 +-
client/.eslintrc.json | 1 +
client/package.json | 11 +-
client/src/app/layout.tsx | 5 +-
client/src/app/react-query-provider.tsx | 43 +
client/src/orval.config.ts | 28 +
client/src/services/api.ts | 25 +
client/src/types/generated/dataset.ts | 353 ++++
client/src/types/generated/layer.ts | 353 ++++
client/src/types/generated/strapi.schemas.ts | 1375 +++++++++++++
client/src/types/generated/sub-topic.ts | 353 ++++
client/src/types/generated/topic.ts | 353 ++++
client/yarn.lock | 1910 +++++++++++++++++-
14 files changed, 4775 insertions(+), 40 deletions(-)
create mode 100644 .husky/pre-commit
create mode 100644 client/src/app/react-query-provider.tsx
create mode 100644 client/src/orval.config.ts
create mode 100644 client/src/services/api.ts
create mode 100644 client/src/types/generated/dataset.ts
create mode 100644 client/src/types/generated/layer.ts
create mode 100644 client/src/types/generated/strapi.schemas.ts
create mode 100644 client/src/types/generated/sub-topic.ts
create mode 100644 client/src/types/generated/topic.ts
diff --git a/.husky/pre-commit b/.husky/pre-commit
new file mode 100644
index 0000000..c68b9ec
--- /dev/null
+++ b/.husky/pre-commit
@@ -0,0 +1,2 @@
+cd ./cms && yarn config-sync export -y
+cd ../client && yarn types && yarn lint --fix && yarn check-types && git add src/types/generated/
\ No newline at end of file
diff --git a/client/.eslintignore b/client/.eslintignore
index d85a799..f458037 100644
--- a/client/.eslintignore
+++ b/client/.eslintignore
@@ -1,3 +1,4 @@
/.next
/node_modules
-/public
\ No newline at end of file
+/public
+/src/types/generated/
\ No newline at end of file
diff --git a/client/.eslintrc.json b/client/.eslintrc.json
index efff856..0d77ef9 100644
--- a/client/.eslintrc.json
+++ b/client/.eslintrc.json
@@ -3,6 +3,7 @@
"next/core-web-vitals",
"plugin:prettier/recommended",
"plugin:@typescript-eslint/recommended",
+ "plugin:@tanstack/query/recommended",
"plugin:import/recommended",
"plugin:import/typescript"
],
diff --git a/client/package.json b/client/package.json
index 3736928..91cd124 100644
--- a/client/package.json
+++ b/client/package.json
@@ -3,10 +3,13 @@
"version": "0.1.0",
"private": true,
"scripts": {
+ "prepare": "cd .. && husky",
"dev": "next dev",
"build": "next build",
"start": "next start",
- "lint": "next lint"
+ "lint": "next lint",
+ "types": "orval --config ./src/orval.config.ts",
+ "check-types": "tsc"
},
"dependencies": {
"@artsy/fresnel": "7.1.4",
@@ -18,7 +21,9 @@
"@radix-ui/react-slot": "1.1.0",
"@radix-ui/react-tooltip": "1.1.3",
"@t3-oss/env-nextjs": "0.11.1",
+ "@tanstack/react-query": "5.59.16",
"@types/mapbox-gl": "3.4.0",
+ "axios": "1.7.7",
"class-variance-authority": "0.7.0",
"clsx": "2.1.1",
"express": "4.21.1",
@@ -36,6 +41,7 @@
},
"devDependencies": {
"@svgr/webpack": "8.1.0",
+ "@tanstack/eslint-plugin-query": "5.59.7",
"@types/node": "22.7.6",
"@types/react": "18.3.1",
"@types/react-dom": "18.3.1",
@@ -47,7 +53,10 @@
"eslint-import-resolver-typescript": "3.6.3",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-prettier": "5.2.1",
+ "husky": "9.1.6",
"jiti": "1.21.6",
+ "orval": "7.2.0",
+ "pinst": "3.0.0",
"postcss": "^8",
"prettier": "3.3.3",
"prettier-plugin-tailwindcss": "0.6.8",
diff --git a/client/src/app/layout.tsx b/client/src/app/layout.tsx
index 7f7934d..5910464 100644
--- a/client/src/app/layout.tsx
+++ b/client/src/app/layout.tsx
@@ -1,6 +1,7 @@
import { Jost, DM_Serif_Text } from "next/font/google";
import { NuqsAdapter } from "nuqs/adapters/next/app";
+import ReactQueryProvider from "@/app/react-query-provider";
import Head from "@/components/head";
import type { Metadata } from "next";
@@ -37,7 +38,9 @@ export default function RootLayout({
- {children}
+
+ {children}
+
);
diff --git a/client/src/app/react-query-provider.tsx b/client/src/app/react-query-provider.tsx
new file mode 100644
index 0000000..018c5e9
--- /dev/null
+++ b/client/src/app/react-query-provider.tsx
@@ -0,0 +1,43 @@
+"use client";
+
+// Since QueryClientProvider relies on useContext under the hood, we have to put 'use client' on top
+import { isServer, QueryClient, QueryClientProvider } from "@tanstack/react-query";
+import { PropsWithChildren } from "react";
+
+function makeQueryClient() {
+ return new QueryClient({
+ defaultOptions: {
+ queries: {
+ // With SSR, we usually want to set some default staleTime
+ // above 0 to avoid refetching immediately on the client
+ staleTime: 60 * 1000,
+ },
+ },
+ });
+}
+
+let browserQueryClient: QueryClient | undefined = undefined;
+
+function getQueryClient() {
+ if (isServer) {
+ // Server: always make a new query client
+ return makeQueryClient();
+ } else {
+ // Browser: make a new query client if we don't already have one
+ // This is very important, so we don't re-make a new client if React
+ // suspends during the initial render. This may not be needed if we
+ // have a suspense boundary BELOW the creation of the query client
+ if (!browserQueryClient) browserQueryClient = makeQueryClient();
+ return browserQueryClient;
+ }
+}
+
+export default function ReactQueryProvider({ children }: PropsWithChildren) {
+ // NOTE: Avoid useState when initializing the query client if you don't
+ // have a suspense boundary between this and the code that may
+ // suspend because React will throw away the client on the initial
+ // render if it suspends and there is no boundary
+ const queryClient = getQueryClient();
+
+ return {children};
+}
diff --git a/client/src/orval.config.ts b/client/src/orval.config.ts
new file mode 100644
index 0000000..8f7e87d
--- /dev/null
+++ b/client/src/orval.config.ts
@@ -0,0 +1,28 @@
+import { defineConfig } from "orval";
+
+export default defineConfig({
+ cms: {
+ input: {
+ target: "../../cms/src/extensions/documentation/documentation/1.0.0/full_documentation.json",
+ filters: {
+ tags: ["Topic", "Sub-topic", "Dataset", "Layer"],
+ },
+ },
+ output: {
+ target: "./types/generated/strapi.ts",
+ mode: "tags",
+ client: "react-query",
+ clean: true,
+ override: {
+ mutator: {
+ path: "./services/api.ts",
+ name: "API",
+ },
+ query: {
+ useQuery: true,
+ signal: true,
+ },
+ },
+ },
+ },
+});
diff --git a/client/src/services/api.ts b/client/src/services/api.ts
new file mode 100644
index 0000000..59966ce
--- /dev/null
+++ b/client/src/services/api.ts
@@ -0,0 +1,25 @@
+import Axios, { AxiosError, AxiosRequestConfig } from "axios";
+
+export const AXIOS_INSTANCE = Axios.create({ baseURL: process.env.NEXT_PUBLIC_API_URL });
+
+export const API = (config: AxiosRequestConfig, options?: AxiosRequestConfig): Promise => {
+ // eslint-disable-next-line import/no-named-as-default-member
+ const source = Axios.CancelToken.source();
+ const promise = AXIOS_INSTANCE({
+ ...config,
+ ...options,
+ cancelToken: source.token,
+ }).then(({ data }) => data);
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
+ // @ts-ignore
+ promise.cancel = () => {
+ source.cancel("Query was cancelled");
+ };
+ return promise;
+};
+
+export type BodyType = BodyData;
+
+export type ErrorType = AxiosError;
+
+export default API;
diff --git a/client/src/types/generated/dataset.ts b/client/src/types/generated/dataset.ts
new file mode 100644
index 0000000..3c5a806
--- /dev/null
+++ b/client/src/types/generated/dataset.ts
@@ -0,0 +1,353 @@
+/**
+ * Generated by orval v7.2.0 🍺
+ * Do not edit manually.
+ * DOCUMENTATION
+ * OpenAPI spec version: 1.0.0
+ */
+import {
+ useMutation,
+ useQuery
+} from '@tanstack/react-query'
+import type {
+ DefinedInitialDataOptions,
+ DefinedUseQueryResult,
+ MutationFunction,
+ QueryFunction,
+ QueryKey,
+ UndefinedInitialDataOptions,
+ UseMutationOptions,
+ UseMutationResult,
+ UseQueryOptions,
+ UseQueryResult
+} from '@tanstack/react-query'
+import type {
+ DatasetListResponse,
+ DatasetRequest,
+ DatasetResponse,
+ Error,
+ GetDatasetsParams
+} from './strapi.schemas'
+import { API } from '../../services/api';
+import type { ErrorType, BodyType } from '../../services/api';
+
+
+
+type SecondParameter any> = Parameters[1];
+
+
+export const getDatasets = (
+ params?: GetDatasetsParams,
+ options?: SecondParameter,signal?: AbortSignal
+) => {
+
+
+ return API(
+ {url: `/datasets`, method: 'GET',
+ params, signal
+ },
+ options);
+ }
+
+
+export const getGetDatasetsQueryKey = (params?: GetDatasetsParams,) => {
+ return [`/datasets`, ...(params ? [params]: [])] as const;
+ }
+
+
+export const getGetDatasetsQueryOptions = >, TError = ErrorType>(params?: GetDatasetsParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter}
+) => {
+
+const {query: queryOptions, request: requestOptions} = options ?? {};
+
+ const queryKey = queryOptions?.queryKey ?? getGetDatasetsQueryKey(params);
+
+
+
+ const queryFn: QueryFunction>> = ({ signal }) => getDatasets(params, requestOptions, signal);
+
+
+
+
+
+ return { queryKey, queryFn, ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey }
+}
+
+export type GetDatasetsQueryResult = NonNullable>>
+export type GetDatasetsQueryError = ErrorType
+
+
+export function useGetDatasets>, TError = ErrorType>(
+ params: undefined | GetDatasetsParams, options: { query:Partial>, TError, TData>> & Pick<
+ DefinedInitialDataOptions<
+ Awaited>,
+ TError,
+ TData
+ > , 'initialData'
+ >, request?: SecondParameter}
+
+ ): DefinedUseQueryResult & { queryKey: QueryKey }
+export function useGetDatasets>, TError = ErrorType>(
+ params?: GetDatasetsParams, options?: { query?:Partial>, TError, TData>> & Pick<
+ UndefinedInitialDataOptions<
+ Awaited>,
+ TError,
+ TData
+ > , 'initialData'
+ >, request?: SecondParameter}
+
+ ): UseQueryResult & { queryKey: QueryKey }
+export function useGetDatasets>, TError = ErrorType>(
+ params?: GetDatasetsParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter}
+
+ ): UseQueryResult & { queryKey: QueryKey }
+
+export function useGetDatasets>, TError = ErrorType>(
+ params?: GetDatasetsParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter}
+
+ ): UseQueryResult & { queryKey: QueryKey } {
+
+ const queryOptions = getGetDatasetsQueryOptions(params,options)
+
+ const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey };
+
+ query.queryKey = queryOptions.queryKey ;
+
+ return query;
+}
+
+
+
+export const postDatasets = (
+ datasetRequest: BodyType,
+ options?: SecondParameter,) => {
+
+
+ return API(
+ {url: `/datasets`, method: 'POST',
+ headers: {'Content-Type': 'application/json', },
+ data: datasetRequest
+ },
+ options);
+ }
+
+
+
+export const getPostDatasetsMutationOptions = ,
+ TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{data: BodyType}, TContext>, request?: SecondParameter}
+): UseMutationOptions>, TError,{data: BodyType}, TContext> => {
+const {mutation: mutationOptions, request: requestOptions} = options ?? {};
+
+
+
+
+ const mutationFn: MutationFunction>, {data: BodyType}> = (props) => {
+ const {data} = props ?? {};
+
+ return postDatasets(data,requestOptions)
+ }
+
+
+
+
+ return { mutationFn, ...mutationOptions }}
+
+ export type PostDatasetsMutationResult = NonNullable>>
+ export type PostDatasetsMutationBody = BodyType
+ export type PostDatasetsMutationError = ErrorType
+
+ export const usePostDatasets = ,
+ TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{data: BodyType}, TContext>, request?: SecondParameter}
+): UseMutationResult<
+ Awaited>,
+ TError,
+ {data: BodyType},
+ TContext
+ > => {
+
+ const mutationOptions = getPostDatasetsMutationOptions(options);
+
+ return useMutation(mutationOptions);
+ }
+ export const getDatasetsId = (
+ id: number,
+ options?: SecondParameter,signal?: AbortSignal
+) => {
+
+
+ return API(
+ {url: `/datasets/${id}`, method: 'GET', signal
+ },
+ options);
+ }
+
+
+export const getGetDatasetsIdQueryKey = (id: number,) => {
+ return [`/datasets/${id}`] as const;
+ }
+
+
+export const getGetDatasetsIdQueryOptions = >, TError = ErrorType>(id: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter}
+) => {
+
+const {query: queryOptions, request: requestOptions} = options ?? {};
+
+ const queryKey = queryOptions?.queryKey ?? getGetDatasetsIdQueryKey(id);
+
+
+
+ const queryFn: QueryFunction>> = ({ signal }) => getDatasetsId(id, requestOptions, signal);
+
+
+
+
+
+ return { queryKey, queryFn, enabled: !!(id), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey }
+}
+
+export type GetDatasetsIdQueryResult = NonNullable>>
+export type GetDatasetsIdQueryError = ErrorType
+
+
+export function useGetDatasetsId>, TError = ErrorType>(
+ id: number, options: { query:Partial>, TError, TData>> & Pick<
+ DefinedInitialDataOptions<
+ Awaited>,
+ TError,
+ TData
+ > , 'initialData'
+ >, request?: SecondParameter}
+
+ ): DefinedUseQueryResult & { queryKey: QueryKey }
+export function useGetDatasetsId>, TError = ErrorType>(
+ id: number, options?: { query?:Partial>, TError, TData>> & Pick<
+ UndefinedInitialDataOptions<
+ Awaited>,
+ TError,
+ TData
+ > , 'initialData'
+ >, request?: SecondParameter}
+
+ ): UseQueryResult & { queryKey: QueryKey }
+export function useGetDatasetsId>, TError = ErrorType>(
+ id: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter}
+
+ ): UseQueryResult & { queryKey: QueryKey }
+
+export function useGetDatasetsId>, TError = ErrorType>(
+ id: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter}
+
+ ): UseQueryResult & { queryKey: QueryKey } {
+
+ const queryOptions = getGetDatasetsIdQueryOptions(id,options)
+
+ const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey };
+
+ query.queryKey = queryOptions.queryKey ;
+
+ return query;
+}
+
+
+
+export const putDatasetsId = (
+ id: number,
+ datasetRequest: BodyType,
+ options?: SecondParameter,) => {
+
+
+ return API(
+ {url: `/datasets/${id}`, method: 'PUT',
+ headers: {'Content-Type': 'application/json', },
+ data: datasetRequest
+ },
+ options);
+ }
+
+
+
+export const getPutDatasetsIdMutationOptions = ,
+ TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{id: number;data: BodyType}, TContext>, request?: SecondParameter}
+): UseMutationOptions>, TError,{id: number;data: BodyType}, TContext> => {
+const {mutation: mutationOptions, request: requestOptions} = options ?? {};
+
+
+
+
+ const mutationFn: MutationFunction>, {id: number;data: BodyType}> = (props) => {
+ const {id,data} = props ?? {};
+
+ return putDatasetsId(id,data,requestOptions)
+ }
+
+
+
+
+ return { mutationFn, ...mutationOptions }}
+
+ export type PutDatasetsIdMutationResult = NonNullable>>
+ export type PutDatasetsIdMutationBody = BodyType
+ export type PutDatasetsIdMutationError = ErrorType
+
+ export const usePutDatasetsId = ,
+ TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{id: number;data: BodyType}, TContext>, request?: SecondParameter}
+): UseMutationResult<
+ Awaited>,
+ TError,
+ {id: number;data: BodyType},
+ TContext
+ > => {
+
+ const mutationOptions = getPutDatasetsIdMutationOptions(options);
+
+ return useMutation(mutationOptions);
+ }
+ export const deleteDatasetsId = (
+ id: number,
+ options?: SecondParameter,) => {
+
+
+ return API(
+ {url: `/datasets/${id}`, method: 'DELETE'
+ },
+ options);
+ }
+
+
+
+export const getDeleteDatasetsIdMutationOptions = ,
+ TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{id: number}, TContext>, request?: SecondParameter}
+): UseMutationOptions>, TError,{id: number}, TContext> => {
+const {mutation: mutationOptions, request: requestOptions} = options ?? {};
+
+
+
+
+ const mutationFn: MutationFunction>, {id: number}> = (props) => {
+ const {id} = props ?? {};
+
+ return deleteDatasetsId(id,requestOptions)
+ }
+
+
+
+
+ return { mutationFn, ...mutationOptions }}
+
+ export type DeleteDatasetsIdMutationResult = NonNullable>>
+
+ export type DeleteDatasetsIdMutationError = ErrorType
+
+ export const useDeleteDatasetsId = ,
+ TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{id: number}, TContext>, request?: SecondParameter}
+): UseMutationResult<
+ Awaited>,
+ TError,
+ {id: number},
+ TContext
+ > => {
+
+ const mutationOptions = getDeleteDatasetsIdMutationOptions(options);
+
+ return useMutation(mutationOptions);
+ }
+
\ No newline at end of file
diff --git a/client/src/types/generated/layer.ts b/client/src/types/generated/layer.ts
new file mode 100644
index 0000000..d89ee35
--- /dev/null
+++ b/client/src/types/generated/layer.ts
@@ -0,0 +1,353 @@
+/**
+ * Generated by orval v7.2.0 🍺
+ * Do not edit manually.
+ * DOCUMENTATION
+ * OpenAPI spec version: 1.0.0
+ */
+import {
+ useMutation,
+ useQuery
+} from '@tanstack/react-query'
+import type {
+ DefinedInitialDataOptions,
+ DefinedUseQueryResult,
+ MutationFunction,
+ QueryFunction,
+ QueryKey,
+ UndefinedInitialDataOptions,
+ UseMutationOptions,
+ UseMutationResult,
+ UseQueryOptions,
+ UseQueryResult
+} from '@tanstack/react-query'
+import type {
+ Error,
+ GetLayersParams,
+ LayerListResponse,
+ LayerRequest,
+ LayerResponse
+} from './strapi.schemas'
+import { API } from '../../services/api';
+import type { ErrorType, BodyType } from '../../services/api';
+
+
+
+type SecondParameter any> = Parameters[1];
+
+
+export const getLayers = (
+ params?: GetLayersParams,
+ options?: SecondParameter,signal?: AbortSignal
+) => {
+
+
+ return API(
+ {url: `/layers`, method: 'GET',
+ params, signal
+ },
+ options);
+ }
+
+
+export const getGetLayersQueryKey = (params?: GetLayersParams,) => {
+ return [`/layers`, ...(params ? [params]: [])] as const;
+ }
+
+
+export const getGetLayersQueryOptions = >, TError = ErrorType>(params?: GetLayersParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter}
+) => {
+
+const {query: queryOptions, request: requestOptions} = options ?? {};
+
+ const queryKey = queryOptions?.queryKey ?? getGetLayersQueryKey(params);
+
+
+
+ const queryFn: QueryFunction>> = ({ signal }) => getLayers(params, requestOptions, signal);
+
+
+
+
+
+ return { queryKey, queryFn, ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey }
+}
+
+export type GetLayersQueryResult = NonNullable>>
+export type GetLayersQueryError = ErrorType
+
+
+export function useGetLayers>, TError = ErrorType>(
+ params: undefined | GetLayersParams, options: { query:Partial>, TError, TData>> & Pick<
+ DefinedInitialDataOptions<
+ Awaited>,
+ TError,
+ TData
+ > , 'initialData'
+ >, request?: SecondParameter}
+
+ ): DefinedUseQueryResult & { queryKey: QueryKey }
+export function useGetLayers>, TError = ErrorType>(
+ params?: GetLayersParams, options?: { query?:Partial>, TError, TData>> & Pick<
+ UndefinedInitialDataOptions<
+ Awaited>,
+ TError,
+ TData
+ > , 'initialData'
+ >, request?: SecondParameter}
+
+ ): UseQueryResult & { queryKey: QueryKey }
+export function useGetLayers>, TError = ErrorType>(
+ params?: GetLayersParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter}
+
+ ): UseQueryResult & { queryKey: QueryKey }
+
+export function useGetLayers>, TError = ErrorType>(
+ params?: GetLayersParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter}
+
+ ): UseQueryResult & { queryKey: QueryKey } {
+
+ const queryOptions = getGetLayersQueryOptions(params,options)
+
+ const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey };
+
+ query.queryKey = queryOptions.queryKey ;
+
+ return query;
+}
+
+
+
+export const postLayers = (
+ layerRequest: BodyType,
+ options?: SecondParameter,) => {
+
+
+ return API(
+ {url: `/layers`, method: 'POST',
+ headers: {'Content-Type': 'application/json', },
+ data: layerRequest
+ },
+ options);
+ }
+
+
+
+export const getPostLayersMutationOptions = ,
+ TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{data: BodyType}, TContext>, request?: SecondParameter}
+): UseMutationOptions>, TError,{data: BodyType}, TContext> => {
+const {mutation: mutationOptions, request: requestOptions} = options ?? {};
+
+
+
+
+ const mutationFn: MutationFunction>, {data: BodyType}> = (props) => {
+ const {data} = props ?? {};
+
+ return postLayers(data,requestOptions)
+ }
+
+
+
+
+ return { mutationFn, ...mutationOptions }}
+
+ export type PostLayersMutationResult = NonNullable>>
+ export type PostLayersMutationBody = BodyType
+ export type PostLayersMutationError = ErrorType
+
+ export const usePostLayers = ,
+ TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{data: BodyType}, TContext>, request?: SecondParameter}
+): UseMutationResult<
+ Awaited>,
+ TError,
+ {data: BodyType},
+ TContext
+ > => {
+
+ const mutationOptions = getPostLayersMutationOptions(options);
+
+ return useMutation(mutationOptions);
+ }
+ export const getLayersId = (
+ id: number,
+ options?: SecondParameter,signal?: AbortSignal
+) => {
+
+
+ return API(
+ {url: `/layers/${id}`, method: 'GET', signal
+ },
+ options);
+ }
+
+
+export const getGetLayersIdQueryKey = (id: number,) => {
+ return [`/layers/${id}`] as const;
+ }
+
+
+export const getGetLayersIdQueryOptions = >, TError = ErrorType>(id: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter}
+) => {
+
+const {query: queryOptions, request: requestOptions} = options ?? {};
+
+ const queryKey = queryOptions?.queryKey ?? getGetLayersIdQueryKey(id);
+
+
+
+ const queryFn: QueryFunction>> = ({ signal }) => getLayersId(id, requestOptions, signal);
+
+
+
+
+
+ return { queryKey, queryFn, enabled: !!(id), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey }
+}
+
+export type GetLayersIdQueryResult = NonNullable>>
+export type GetLayersIdQueryError = ErrorType
+
+
+export function useGetLayersId>, TError = ErrorType>(
+ id: number, options: { query:Partial>, TError, TData>> & Pick<
+ DefinedInitialDataOptions<
+ Awaited>,
+ TError,
+ TData
+ > , 'initialData'
+ >, request?: SecondParameter}
+
+ ): DefinedUseQueryResult & { queryKey: QueryKey }
+export function useGetLayersId>, TError = ErrorType>(
+ id: number, options?: { query?:Partial>, TError, TData>> & Pick<
+ UndefinedInitialDataOptions<
+ Awaited>,
+ TError,
+ TData
+ > , 'initialData'
+ >, request?: SecondParameter}
+
+ ): UseQueryResult & { queryKey: QueryKey }
+export function useGetLayersId>, TError = ErrorType>(
+ id: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter}
+
+ ): UseQueryResult & { queryKey: QueryKey }
+
+export function useGetLayersId>, TError = ErrorType>(
+ id: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter}
+
+ ): UseQueryResult & { queryKey: QueryKey } {
+
+ const queryOptions = getGetLayersIdQueryOptions(id,options)
+
+ const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey };
+
+ query.queryKey = queryOptions.queryKey ;
+
+ return query;
+}
+
+
+
+export const putLayersId = (
+ id: number,
+ layerRequest: BodyType,
+ options?: SecondParameter,) => {
+
+
+ return API(
+ {url: `/layers/${id}`, method: 'PUT',
+ headers: {'Content-Type': 'application/json', },
+ data: layerRequest
+ },
+ options);
+ }
+
+
+
+export const getPutLayersIdMutationOptions = ,
+ TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{id: number;data: BodyType}, TContext>, request?: SecondParameter}
+): UseMutationOptions>, TError,{id: number;data: BodyType}, TContext> => {
+const {mutation: mutationOptions, request: requestOptions} = options ?? {};
+
+
+
+
+ const mutationFn: MutationFunction>, {id: number;data: BodyType}> = (props) => {
+ const {id,data} = props ?? {};
+
+ return putLayersId(id,data,requestOptions)
+ }
+
+
+
+
+ return { mutationFn, ...mutationOptions }}
+
+ export type PutLayersIdMutationResult = NonNullable>>
+ export type PutLayersIdMutationBody = BodyType
+ export type PutLayersIdMutationError = ErrorType
+
+ export const usePutLayersId = ,
+ TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{id: number;data: BodyType}, TContext>, request?: SecondParameter}
+): UseMutationResult<
+ Awaited>,
+ TError,
+ {id: number;data: BodyType},
+ TContext
+ > => {
+
+ const mutationOptions = getPutLayersIdMutationOptions(options);
+
+ return useMutation(mutationOptions);
+ }
+ export const deleteLayersId = (
+ id: number,
+ options?: SecondParameter,) => {
+
+
+ return API(
+ {url: `/layers/${id}`, method: 'DELETE'
+ },
+ options);
+ }
+
+
+
+export const getDeleteLayersIdMutationOptions = ,
+ TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{id: number}, TContext>, request?: SecondParameter}
+): UseMutationOptions>, TError,{id: number}, TContext> => {
+const {mutation: mutationOptions, request: requestOptions} = options ?? {};
+
+
+
+
+ const mutationFn: MutationFunction>, {id: number}> = (props) => {
+ const {id} = props ?? {};
+
+ return deleteLayersId(id,requestOptions)
+ }
+
+
+
+
+ return { mutationFn, ...mutationOptions }}
+
+ export type DeleteLayersIdMutationResult = NonNullable>>
+
+ export type DeleteLayersIdMutationError = ErrorType
+
+ export const useDeleteLayersId = ,
+ TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{id: number}, TContext>, request?: SecondParameter}
+): UseMutationResult<
+ Awaited>,
+ TError,
+ {id: number},
+ TContext
+ > => {
+
+ const mutationOptions = getDeleteLayersIdMutationOptions(options);
+
+ return useMutation(mutationOptions);
+ }
+
\ No newline at end of file
diff --git a/client/src/types/generated/strapi.schemas.ts b/client/src/types/generated/strapi.schemas.ts
new file mode 100644
index 0000000..8160826
--- /dev/null
+++ b/client/src/types/generated/strapi.schemas.ts
@@ -0,0 +1,1375 @@
+/**
+ * Generated by orval v7.2.0 🍺
+ * Do not edit manually.
+ * DOCUMENTATION
+ * OpenAPI spec version: 1.0.0
+ */
+export type GetTopicsParams = {
+/**
+ * Sort by attributes ascending (asc) or descending (desc)
+ */
+sort?: string;
+/**
+ * Return page/pageSize (default: true)
+ */
+'pagination[withCount]'?: boolean;
+/**
+ * Page number (default: 0)
+ */
+'pagination[page]'?: number;
+/**
+ * Page size (default: 25)
+ */
+'pagination[pageSize]'?: number;
+/**
+ * Offset value (default: 0)
+ */
+'pagination[start]'?: number;
+/**
+ * Number of entities to return (default: 25)
+ */
+'pagination[limit]'?: number;
+/**
+ * Fields to return (ex: title,author)
+ */
+fields?: string;
+/**
+ * Relations to return
+ */
+populate?: string;
+/**
+ * Filters to apply
+ */
+filters?: { [key: string]: unknown };
+/**
+ * Locale to apply
+ */
+locale?: string;
+};
+
+export type GetSubTopicsParams = {
+/**
+ * Sort by attributes ascending (asc) or descending (desc)
+ */
+sort?: string;
+/**
+ * Return page/pageSize (default: true)
+ */
+'pagination[withCount]'?: boolean;
+/**
+ * Page number (default: 0)
+ */
+'pagination[page]'?: number;
+/**
+ * Page size (default: 25)
+ */
+'pagination[pageSize]'?: number;
+/**
+ * Offset value (default: 0)
+ */
+'pagination[start]'?: number;
+/**
+ * Number of entities to return (default: 25)
+ */
+'pagination[limit]'?: number;
+/**
+ * Fields to return (ex: title,author)
+ */
+fields?: string;
+/**
+ * Relations to return
+ */
+populate?: string;
+/**
+ * Filters to apply
+ */
+filters?: { [key: string]: unknown };
+/**
+ * Locale to apply
+ */
+locale?: string;
+};
+
+export type GetLayersParams = {
+/**
+ * Sort by attributes ascending (asc) or descending (desc)
+ */
+sort?: string;
+/**
+ * Return page/pageSize (default: true)
+ */
+'pagination[withCount]'?: boolean;
+/**
+ * Page number (default: 0)
+ */
+'pagination[page]'?: number;
+/**
+ * Page size (default: 25)
+ */
+'pagination[pageSize]'?: number;
+/**
+ * Offset value (default: 0)
+ */
+'pagination[start]'?: number;
+/**
+ * Number of entities to return (default: 25)
+ */
+'pagination[limit]'?: number;
+/**
+ * Fields to return (ex: title,author)
+ */
+fields?: string;
+/**
+ * Relations to return
+ */
+populate?: string;
+/**
+ * Filters to apply
+ */
+filters?: { [key: string]: unknown };
+/**
+ * Locale to apply
+ */
+locale?: string;
+};
+
+export type GetDatasetsParams = {
+/**
+ * Sort by attributes ascending (asc) or descending (desc)
+ */
+sort?: string;
+/**
+ * Return page/pageSize (default: true)
+ */
+'pagination[withCount]'?: boolean;
+/**
+ * Page number (default: 0)
+ */
+'pagination[page]'?: number;
+/**
+ * Page size (default: 25)
+ */
+'pagination[pageSize]'?: number;
+/**
+ * Offset value (default: 0)
+ */
+'pagination[start]'?: number;
+/**
+ * Number of entities to return (default: 25)
+ */
+'pagination[limit]'?: number;
+/**
+ * Fields to return (ex: title,author)
+ */
+fields?: string;
+/**
+ * Relations to return
+ */
+populate?: string;
+/**
+ * Filters to apply
+ */
+filters?: { [key: string]: unknown };
+/**
+ * Locale to apply
+ */
+locale?: string;
+};
+
+/**
+ * every controller of the api
+ */
+export type UsersPermissionsPermissionsTreeControllers = {[key: string]: {[key: string]: {
+ enabled?: boolean;
+ policy?: string;
+}}};
+
+export interface UsersPermissionsPermissionsTree {[key: string]: {
+ /** every controller of the api */
+ controllers?: UsersPermissionsPermissionsTreeControllers;
+}}
+
+export type UsersPermissionsRoleRequestBody = {
+ description?: string;
+ name?: string;
+ permissions?: UsersPermissionsPermissionsTree;
+ type?: string;
+};
+
+export interface UsersPermissionsUser {
+ blocked?: boolean;
+ confirmed?: boolean;
+ createdAt?: string;
+ email?: string;
+ id?: number;
+ provider?: string;
+ updatedAt?: string;
+ username?: string;
+}
+
+export interface UsersPermissionsUserRegistration {
+ jwt?: string;
+ user?: UsersPermissionsUser;
+}
+
+export interface UsersPermissionsRole {
+ createdAt?: string;
+ description?: string;
+ id?: number;
+ name?: string;
+ type?: string;
+ updatedAt?: string;
+}
+
+export type UploadFileProviderMetadata = { [key: string]: unknown };
+
+export interface UploadFile {
+ alternativeText?: string;
+ caption?: string;
+ createdAt?: string;
+ ext?: string;
+ formats?: number;
+ hash?: string;
+ height?: number;
+ id?: number;
+ mime?: string;
+ name?: string;
+ previewUrl?: string;
+ provider?: string;
+ provider_metadata?: UploadFileProviderMetadata;
+ size?: number;
+ updatedAt?: string;
+ url?: string;
+ width?: number;
+}
+
+export type TopicResponseMeta = { [key: string]: unknown };
+
+export interface TopicResponseDataObject {
+ attributes?: Topic;
+ id?: number;
+}
+
+export interface TopicResponse {
+ data?: TopicResponseDataObject;
+ meta?: TopicResponseMeta;
+}
+
+export type TopicUpdatedByDataAttributes = { [key: string]: unknown };
+
+export type TopicUpdatedByData = {
+ attributes?: TopicUpdatedByDataAttributes;
+ id?: number;
+};
+
+export type TopicUpdatedBy = {
+ data?: TopicUpdatedByData;
+};
+
+export type TopicCreatedBy = {
+ data?: TopicCreatedByData;
+};
+
+export interface Topic {
+ createdAt?: string;
+ createdBy?: TopicCreatedBy;
+ name: string;
+ slug: string;
+ updatedAt?: string;
+ updatedBy?: TopicUpdatedBy;
+}
+
+export type TopicCreatedByDataAttributesUpdatedByDataAttributes = { [key: string]: unknown };
+
+export type TopicCreatedByDataAttributesUpdatedByData = {
+ attributes?: TopicCreatedByDataAttributesUpdatedByDataAttributes;
+ id?: number;
+};
+
+export type TopicCreatedByDataAttributesUpdatedBy = {
+ data?: TopicCreatedByDataAttributesUpdatedByData;
+};
+
+export type TopicCreatedByDataAttributesRoles = {
+ data?: TopicCreatedByDataAttributesRolesDataItem[];
+};
+
+export type TopicCreatedByDataAttributes = {
+ blocked?: boolean;
+ createdAt?: string;
+ createdBy?: TopicCreatedByDataAttributesCreatedBy;
+ email?: string;
+ firstname?: string;
+ isActive?: boolean;
+ lastname?: string;
+ preferedLanguage?: string;
+ registrationToken?: string;
+ resetPasswordToken?: string;
+ roles?: TopicCreatedByDataAttributesRoles;
+ updatedAt?: string;
+ updatedBy?: TopicCreatedByDataAttributesUpdatedBy;
+ username?: string;
+};
+
+export type TopicCreatedByData = {
+ attributes?: TopicCreatedByDataAttributes;
+ id?: number;
+};
+
+export type TopicCreatedByDataAttributesRolesDataItemAttributesUsersDataItemAttributes = { [key: string]: unknown };
+
+export type TopicCreatedByDataAttributesRolesDataItemAttributesUsersDataItem = {
+ attributes?: TopicCreatedByDataAttributesRolesDataItemAttributesUsersDataItemAttributes;
+ id?: number;
+};
+
+export type TopicCreatedByDataAttributesRolesDataItemAttributesUsers = {
+ data?: TopicCreatedByDataAttributesRolesDataItemAttributesUsersDataItem[];
+};
+
+export type TopicCreatedByDataAttributesRolesDataItemAttributesUpdatedByDataAttributes = { [key: string]: unknown };
+
+export type TopicCreatedByDataAttributesRolesDataItemAttributesUpdatedByData = {
+ attributes?: TopicCreatedByDataAttributesRolesDataItemAttributesUpdatedByDataAttributes;
+ id?: number;
+};
+
+export type TopicCreatedByDataAttributesRolesDataItemAttributesUpdatedBy = {
+ data?: TopicCreatedByDataAttributesRolesDataItemAttributesUpdatedByData;
+};
+
+export type TopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItem = {
+ attributes?: TopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributes;
+ id?: number;
+};
+
+export type TopicCreatedByDataAttributesRolesDataItemAttributesPermissions = {
+ data?: TopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItem[];
+};
+
+export type TopicCreatedByDataAttributesRolesDataItemAttributes = {
+ code?: string;
+ createdAt?: string;
+ createdBy?: TopicCreatedByDataAttributesRolesDataItemAttributesCreatedBy;
+ description?: string;
+ name?: string;
+ permissions?: TopicCreatedByDataAttributesRolesDataItemAttributesPermissions;
+ updatedAt?: string;
+ updatedBy?: TopicCreatedByDataAttributesRolesDataItemAttributesUpdatedBy;
+ users?: TopicCreatedByDataAttributesRolesDataItemAttributesUsers;
+};
+
+export type TopicCreatedByDataAttributesRolesDataItem = {
+ attributes?: TopicCreatedByDataAttributesRolesDataItemAttributes;
+ id?: number;
+};
+
+export type TopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesUpdatedByDataAttributes = { [key: string]: unknown };
+
+export type TopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesUpdatedByData = {
+ attributes?: TopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesUpdatedByDataAttributes;
+ id?: number;
+};
+
+export type TopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesUpdatedBy = {
+ data?: TopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesUpdatedByData;
+};
+
+export type TopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesRoleDataAttributes = { [key: string]: unknown };
+
+export type TopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesRoleData = {
+ attributes?: TopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesRoleDataAttributes;
+ id?: number;
+};
+
+export type TopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesRole = {
+ data?: TopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesRoleData;
+};
+
+export type TopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesCreatedByDataAttributes = { [key: string]: unknown };
+
+export type TopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesCreatedByData = {
+ attributes?: TopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesCreatedByDataAttributes;
+ id?: number;
+};
+
+export type TopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesCreatedBy = {
+ data?: TopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesCreatedByData;
+};
+
+export type TopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributes = {
+ action?: string;
+ actionParameters?: unknown;
+ conditions?: unknown;
+ createdAt?: string;
+ createdBy?: TopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesCreatedBy;
+ properties?: unknown;
+ role?: TopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesRole;
+ subject?: string;
+ updatedAt?: string;
+ updatedBy?: TopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesUpdatedBy;
+};
+
+export type TopicCreatedByDataAttributesRolesDataItemAttributesCreatedByDataAttributes = { [key: string]: unknown };
+
+export type TopicCreatedByDataAttributesRolesDataItemAttributesCreatedByData = {
+ attributes?: TopicCreatedByDataAttributesRolesDataItemAttributesCreatedByDataAttributes;
+ id?: number;
+};
+
+export type TopicCreatedByDataAttributesRolesDataItemAttributesCreatedBy = {
+ data?: TopicCreatedByDataAttributesRolesDataItemAttributesCreatedByData;
+};
+
+export type TopicCreatedByDataAttributesCreatedByDataAttributes = { [key: string]: unknown };
+
+export type TopicCreatedByDataAttributesCreatedByData = {
+ attributes?: TopicCreatedByDataAttributesCreatedByDataAttributes;
+ id?: number;
+};
+
+export type TopicCreatedByDataAttributesCreatedBy = {
+ data?: TopicCreatedByDataAttributesCreatedByData;
+};
+
+export type TopicListResponseMetaPagination = {
+ page?: number;
+ /** @maximum 1 */
+ pageCount?: number;
+ /** @minimum 25 */
+ pageSize?: number;
+ total?: number;
+};
+
+export type TopicListResponseMeta = {
+ pagination?: TopicListResponseMetaPagination;
+};
+
+export interface TopicListResponseDataItem {
+ attributes?: Topic;
+ id?: number;
+}
+
+export interface TopicListResponse {
+ data?: TopicListResponseDataItem[];
+ meta?: TopicListResponseMeta;
+}
+
+export type TopicRequestData = {
+ name: string;
+ slug: string;
+};
+
+export interface TopicRequest {
+ data: TopicRequestData;
+}
+
+export type SubTopicResponseMeta = { [key: string]: unknown };
+
+export interface SubTopic {
+ createdAt?: string;
+ createdBy?: SubTopicCreatedBy;
+ name: string;
+ updatedAt?: string;
+ updatedBy?: SubTopicUpdatedBy;
+}
+
+export interface SubTopicResponseDataObject {
+ attributes?: SubTopic;
+ id?: number;
+}
+
+export interface SubTopicResponse {
+ data?: SubTopicResponseDataObject;
+ meta?: SubTopicResponseMeta;
+}
+
+export type SubTopicUpdatedByDataAttributes = { [key: string]: unknown };
+
+export type SubTopicUpdatedByData = {
+ attributes?: SubTopicUpdatedByDataAttributes;
+ id?: number;
+};
+
+export type SubTopicUpdatedBy = {
+ data?: SubTopicUpdatedByData;
+};
+
+export type SubTopicCreatedByDataAttributes = {
+ blocked?: boolean;
+ createdAt?: string;
+ createdBy?: SubTopicCreatedByDataAttributesCreatedBy;
+ email?: string;
+ firstname?: string;
+ isActive?: boolean;
+ lastname?: string;
+ preferedLanguage?: string;
+ registrationToken?: string;
+ resetPasswordToken?: string;
+ roles?: SubTopicCreatedByDataAttributesRoles;
+ updatedAt?: string;
+ updatedBy?: SubTopicCreatedByDataAttributesUpdatedBy;
+ username?: string;
+};
+
+export type SubTopicCreatedByData = {
+ attributes?: SubTopicCreatedByDataAttributes;
+ id?: number;
+};
+
+export type SubTopicCreatedBy = {
+ data?: SubTopicCreatedByData;
+};
+
+export type SubTopicCreatedByDataAttributesUpdatedByDataAttributes = { [key: string]: unknown };
+
+export type SubTopicCreatedByDataAttributesUpdatedByData = {
+ attributes?: SubTopicCreatedByDataAttributesUpdatedByDataAttributes;
+ id?: number;
+};
+
+export type SubTopicCreatedByDataAttributesUpdatedBy = {
+ data?: SubTopicCreatedByDataAttributesUpdatedByData;
+};
+
+export type SubTopicCreatedByDataAttributesRolesDataItem = {
+ attributes?: SubTopicCreatedByDataAttributesRolesDataItemAttributes;
+ id?: number;
+};
+
+export type SubTopicCreatedByDataAttributesRoles = {
+ data?: SubTopicCreatedByDataAttributesRolesDataItem[];
+};
+
+export type SubTopicCreatedByDataAttributesRolesDataItemAttributesUsersDataItemAttributes = { [key: string]: unknown };
+
+export type SubTopicCreatedByDataAttributesRolesDataItemAttributesUsersDataItem = {
+ attributes?: SubTopicCreatedByDataAttributesRolesDataItemAttributesUsersDataItemAttributes;
+ id?: number;
+};
+
+export type SubTopicCreatedByDataAttributesRolesDataItemAttributesUsers = {
+ data?: SubTopicCreatedByDataAttributesRolesDataItemAttributesUsersDataItem[];
+};
+
+export type SubTopicCreatedByDataAttributesRolesDataItemAttributesUpdatedByDataAttributes = { [key: string]: unknown };
+
+export type SubTopicCreatedByDataAttributesRolesDataItemAttributesUpdatedByData = {
+ attributes?: SubTopicCreatedByDataAttributesRolesDataItemAttributesUpdatedByDataAttributes;
+ id?: number;
+};
+
+export type SubTopicCreatedByDataAttributesRolesDataItemAttributesUpdatedBy = {
+ data?: SubTopicCreatedByDataAttributesRolesDataItemAttributesUpdatedByData;
+};
+
+export type SubTopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItem = {
+ attributes?: SubTopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributes;
+ id?: number;
+};
+
+export type SubTopicCreatedByDataAttributesRolesDataItemAttributesPermissions = {
+ data?: SubTopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItem[];
+};
+
+export type SubTopicCreatedByDataAttributesRolesDataItemAttributes = {
+ code?: string;
+ createdAt?: string;
+ createdBy?: SubTopicCreatedByDataAttributesRolesDataItemAttributesCreatedBy;
+ description?: string;
+ name?: string;
+ permissions?: SubTopicCreatedByDataAttributesRolesDataItemAttributesPermissions;
+ updatedAt?: string;
+ updatedBy?: SubTopicCreatedByDataAttributesRolesDataItemAttributesUpdatedBy;
+ users?: SubTopicCreatedByDataAttributesRolesDataItemAttributesUsers;
+};
+
+export type SubTopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesUpdatedByDataAttributes = { [key: string]: unknown };
+
+export type SubTopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesUpdatedByData = {
+ attributes?: SubTopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesUpdatedByDataAttributes;
+ id?: number;
+};
+
+export type SubTopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesUpdatedBy = {
+ data?: SubTopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesUpdatedByData;
+};
+
+export type SubTopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributes = {
+ action?: string;
+ actionParameters?: unknown;
+ conditions?: unknown;
+ createdAt?: string;
+ createdBy?: SubTopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesCreatedBy;
+ properties?: unknown;
+ role?: SubTopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesRole;
+ subject?: string;
+ updatedAt?: string;
+ updatedBy?: SubTopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesUpdatedBy;
+};
+
+export type SubTopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesRoleDataAttributes = { [key: string]: unknown };
+
+export type SubTopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesRoleData = {
+ attributes?: SubTopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesRoleDataAttributes;
+ id?: number;
+};
+
+export type SubTopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesRole = {
+ data?: SubTopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesRoleData;
+};
+
+export type SubTopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesCreatedByDataAttributes = { [key: string]: unknown };
+
+export type SubTopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesCreatedByData = {
+ attributes?: SubTopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesCreatedByDataAttributes;
+ id?: number;
+};
+
+export type SubTopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesCreatedBy = {
+ data?: SubTopicCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesCreatedByData;
+};
+
+export type SubTopicCreatedByDataAttributesRolesDataItemAttributesCreatedByDataAttributes = { [key: string]: unknown };
+
+export type SubTopicCreatedByDataAttributesRolesDataItemAttributesCreatedByData = {
+ attributes?: SubTopicCreatedByDataAttributesRolesDataItemAttributesCreatedByDataAttributes;
+ id?: number;
+};
+
+export type SubTopicCreatedByDataAttributesRolesDataItemAttributesCreatedBy = {
+ data?: SubTopicCreatedByDataAttributesRolesDataItemAttributesCreatedByData;
+};
+
+export type SubTopicCreatedByDataAttributesCreatedByDataAttributes = { [key: string]: unknown };
+
+export type SubTopicCreatedByDataAttributesCreatedByData = {
+ attributes?: SubTopicCreatedByDataAttributesCreatedByDataAttributes;
+ id?: number;
+};
+
+export type SubTopicCreatedByDataAttributesCreatedBy = {
+ data?: SubTopicCreatedByDataAttributesCreatedByData;
+};
+
+export type SubTopicListResponseMetaPagination = {
+ page?: number;
+ /** @maximum 1 */
+ pageCount?: number;
+ /** @minimum 25 */
+ pageSize?: number;
+ total?: number;
+};
+
+export type SubTopicListResponseMeta = {
+ pagination?: SubTopicListResponseMetaPagination;
+};
+
+export interface SubTopicListResponseDataItem {
+ attributes?: SubTopic;
+ id?: number;
+}
+
+export interface SubTopicListResponse {
+ data?: SubTopicListResponseDataItem[];
+ meta?: SubTopicListResponseMeta;
+}
+
+export type SubTopicRequestData = {
+ name: string;
+};
+
+export interface SubTopicRequest {
+ data: SubTopicRequestData;
+}
+
+export type LegendLegendConfigComponentType = typeof LegendLegendConfigComponentType[keyof typeof LegendLegendConfigComponentType];
+
+
+// eslint-disable-next-line @typescript-eslint/no-redeclare
+export const LegendLegendConfigComponentType = {
+ basic: 'basic',
+ choropleth: 'choropleth',
+ gradient: 'gradient',
+} as const;
+
+export type LegendLegendConfigComponentItemsItem = {
+ color?: string;
+ id?: number;
+ value?: string;
+};
+
+export interface LegendLegendConfigComponent {
+ id?: number;
+ items?: LegendLegendConfigComponentItemsItem[];
+ type?: LegendLegendConfigComponentType;
+}
+
+export type LayerResponseMeta = { [key: string]: unknown };
+
+export interface LayerResponseDataObject {
+ attributes?: Layer;
+ id?: number;
+}
+
+export interface LayerResponse {
+ data?: LayerResponseDataObject;
+ meta?: LayerResponseMeta;
+}
+
+export type LayerUpdatedByDataAttributes = { [key: string]: unknown };
+
+export type LayerUpdatedByData = {
+ attributes?: LayerUpdatedByDataAttributes;
+ id?: number;
+};
+
+export type LayerUpdatedBy = {
+ data?: LayerUpdatedByData;
+};
+
+export type LayerType = typeof LayerType[keyof typeof LayerType];
+
+
+// eslint-disable-next-line @typescript-eslint/no-redeclare
+export const LayerType = {
+ static: 'static',
+ animated: 'animated',
+} as const;
+
+export interface Layer {
+ createdAt?: string;
+ createdBy?: LayerCreatedBy;
+ legend_config: LegendLegendConfigComponent;
+ mapbox_config: unknown;
+ name: string;
+ params_config: unknown;
+ type: LayerType;
+ updatedAt?: string;
+ updatedBy?: LayerUpdatedBy;
+}
+
+export type LayerCreatedByDataAttributesUpdatedByDataAttributes = { [key: string]: unknown };
+
+export type LayerCreatedByDataAttributesUpdatedByData = {
+ attributes?: LayerCreatedByDataAttributesUpdatedByDataAttributes;
+ id?: number;
+};
+
+export type LayerCreatedByDataAttributesUpdatedBy = {
+ data?: LayerCreatedByDataAttributesUpdatedByData;
+};
+
+export type LayerCreatedByDataAttributes = {
+ blocked?: boolean;
+ createdAt?: string;
+ createdBy?: LayerCreatedByDataAttributesCreatedBy;
+ email?: string;
+ firstname?: string;
+ isActive?: boolean;
+ lastname?: string;
+ preferedLanguage?: string;
+ registrationToken?: string;
+ resetPasswordToken?: string;
+ roles?: LayerCreatedByDataAttributesRoles;
+ updatedAt?: string;
+ updatedBy?: LayerCreatedByDataAttributesUpdatedBy;
+ username?: string;
+};
+
+export type LayerCreatedByData = {
+ attributes?: LayerCreatedByDataAttributes;
+ id?: number;
+};
+
+export type LayerCreatedBy = {
+ data?: LayerCreatedByData;
+};
+
+export type LayerCreatedByDataAttributesRolesDataItemAttributes = {
+ code?: string;
+ createdAt?: string;
+ createdBy?: LayerCreatedByDataAttributesRolesDataItemAttributesCreatedBy;
+ description?: string;
+ name?: string;
+ permissions?: LayerCreatedByDataAttributesRolesDataItemAttributesPermissions;
+ updatedAt?: string;
+ updatedBy?: LayerCreatedByDataAttributesRolesDataItemAttributesUpdatedBy;
+ users?: LayerCreatedByDataAttributesRolesDataItemAttributesUsers;
+};
+
+export type LayerCreatedByDataAttributesRolesDataItem = {
+ attributes?: LayerCreatedByDataAttributesRolesDataItemAttributes;
+ id?: number;
+};
+
+export type LayerCreatedByDataAttributesRoles = {
+ data?: LayerCreatedByDataAttributesRolesDataItem[];
+};
+
+export type LayerCreatedByDataAttributesRolesDataItemAttributesUsersDataItemAttributes = { [key: string]: unknown };
+
+export type LayerCreatedByDataAttributesRolesDataItemAttributesUsersDataItem = {
+ attributes?: LayerCreatedByDataAttributesRolesDataItemAttributesUsersDataItemAttributes;
+ id?: number;
+};
+
+export type LayerCreatedByDataAttributesRolesDataItemAttributesUsers = {
+ data?: LayerCreatedByDataAttributesRolesDataItemAttributesUsersDataItem[];
+};
+
+export type LayerCreatedByDataAttributesRolesDataItemAttributesUpdatedByDataAttributes = { [key: string]: unknown };
+
+export type LayerCreatedByDataAttributesRolesDataItemAttributesUpdatedByData = {
+ attributes?: LayerCreatedByDataAttributesRolesDataItemAttributesUpdatedByDataAttributes;
+ id?: number;
+};
+
+export type LayerCreatedByDataAttributesRolesDataItemAttributesUpdatedBy = {
+ data?: LayerCreatedByDataAttributesRolesDataItemAttributesUpdatedByData;
+};
+
+export type LayerCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributes = {
+ action?: string;
+ actionParameters?: unknown;
+ conditions?: unknown;
+ createdAt?: string;
+ createdBy?: LayerCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesCreatedBy;
+ properties?: unknown;
+ role?: LayerCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesRole;
+ subject?: string;
+ updatedAt?: string;
+ updatedBy?: LayerCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesUpdatedBy;
+};
+
+export type LayerCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItem = {
+ attributes?: LayerCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributes;
+ id?: number;
+};
+
+export type LayerCreatedByDataAttributesRolesDataItemAttributesPermissions = {
+ data?: LayerCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItem[];
+};
+
+export type LayerCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesUpdatedByDataAttributes = { [key: string]: unknown };
+
+export type LayerCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesUpdatedByData = {
+ attributes?: LayerCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesUpdatedByDataAttributes;
+ id?: number;
+};
+
+export type LayerCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesUpdatedBy = {
+ data?: LayerCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesUpdatedByData;
+};
+
+export type LayerCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesRoleDataAttributes = { [key: string]: unknown };
+
+export type LayerCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesRoleData = {
+ attributes?: LayerCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesRoleDataAttributes;
+ id?: number;
+};
+
+export type LayerCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesRole = {
+ data?: LayerCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesRoleData;
+};
+
+export type LayerCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesCreatedByDataAttributes = { [key: string]: unknown };
+
+export type LayerCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesCreatedByData = {
+ attributes?: LayerCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesCreatedByDataAttributes;
+ id?: number;
+};
+
+export type LayerCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesCreatedBy = {
+ data?: LayerCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesCreatedByData;
+};
+
+export type LayerCreatedByDataAttributesRolesDataItemAttributesCreatedByDataAttributes = { [key: string]: unknown };
+
+export type LayerCreatedByDataAttributesRolesDataItemAttributesCreatedByData = {
+ attributes?: LayerCreatedByDataAttributesRolesDataItemAttributesCreatedByDataAttributes;
+ id?: number;
+};
+
+export type LayerCreatedByDataAttributesRolesDataItemAttributesCreatedBy = {
+ data?: LayerCreatedByDataAttributesRolesDataItemAttributesCreatedByData;
+};
+
+export type LayerCreatedByDataAttributesCreatedByDataAttributes = { [key: string]: unknown };
+
+export type LayerCreatedByDataAttributesCreatedByData = {
+ attributes?: LayerCreatedByDataAttributesCreatedByDataAttributes;
+ id?: number;
+};
+
+export type LayerCreatedByDataAttributesCreatedBy = {
+ data?: LayerCreatedByDataAttributesCreatedByData;
+};
+
+export type LayerListResponseMetaPagination = {
+ page?: number;
+ /** @maximum 1 */
+ pageCount?: number;
+ /** @minimum 25 */
+ pageSize?: number;
+ total?: number;
+};
+
+export type LayerListResponseMeta = {
+ pagination?: LayerListResponseMetaPagination;
+};
+
+export interface LayerListResponseDataItem {
+ attributes?: Layer;
+ id?: number;
+}
+
+export interface LayerListResponse {
+ data?: LayerListResponseDataItem[];
+ meta?: LayerListResponseMeta;
+}
+
+export type LayerRequestDataType = typeof LayerRequestDataType[keyof typeof LayerRequestDataType];
+
+
+// eslint-disable-next-line @typescript-eslint/no-redeclare
+export const LayerRequestDataType = {
+ static: 'static',
+ animated: 'animated',
+} as const;
+
+export type LayerRequestData = {
+ legend_config: LegendLegendConfigComponent;
+ mapbox_config: unknown;
+ name: string;
+ params_config: unknown;
+ type: LayerRequestDataType;
+};
+
+export interface LayerRequest {
+ data: LayerRequestData;
+}
+
+export type DatasetResponseMeta = { [key: string]: unknown };
+
+export interface DatasetResponse {
+ data?: DatasetResponseDataObject;
+ meta?: DatasetResponseMeta;
+}
+
+export interface Dataset {
+ createdAt?: string;
+ createdBy?: DatasetCreatedBy;
+ default_layer?: DatasetDefaultLayer;
+ layers?: DatasetLayers;
+ name: string;
+ sub_topic?: DatasetSubTopic;
+ topic?: DatasetTopic;
+ updatedAt?: string;
+ updatedBy?: DatasetUpdatedBy;
+}
+
+export interface DatasetResponseDataObject {
+ attributes?: Dataset;
+ id?: number;
+}
+
+export type DatasetUpdatedByDataAttributes = { [key: string]: unknown };
+
+export type DatasetUpdatedByData = {
+ attributes?: DatasetUpdatedByDataAttributes;
+ id?: number;
+};
+
+export type DatasetUpdatedBy = {
+ data?: DatasetUpdatedByData;
+};
+
+export type DatasetTopicData = {
+ attributes?: DatasetTopicDataAttributes;
+ id?: number;
+};
+
+export type DatasetTopic = {
+ data?: DatasetTopicData;
+};
+
+export type DatasetTopicDataAttributesUpdatedByDataAttributes = { [key: string]: unknown };
+
+export type DatasetTopicDataAttributesUpdatedByData = {
+ attributes?: DatasetTopicDataAttributesUpdatedByDataAttributes;
+ id?: number;
+};
+
+export type DatasetTopicDataAttributesUpdatedBy = {
+ data?: DatasetTopicDataAttributesUpdatedByData;
+};
+
+export type DatasetTopicDataAttributes = {
+ createdAt?: string;
+ createdBy?: DatasetTopicDataAttributesCreatedBy;
+ name?: string;
+ slug?: string;
+ updatedAt?: string;
+ updatedBy?: DatasetTopicDataAttributesUpdatedBy;
+};
+
+export type DatasetTopicDataAttributesCreatedByDataAttributes = { [key: string]: unknown };
+
+export type DatasetTopicDataAttributesCreatedByData = {
+ attributes?: DatasetTopicDataAttributesCreatedByDataAttributes;
+ id?: number;
+};
+
+export type DatasetTopicDataAttributesCreatedBy = {
+ data?: DatasetTopicDataAttributesCreatedByData;
+};
+
+export type DatasetSubTopicData = {
+ attributes?: DatasetSubTopicDataAttributes;
+ id?: number;
+};
+
+export type DatasetSubTopic = {
+ data?: DatasetSubTopicData;
+};
+
+export type DatasetSubTopicDataAttributesUpdatedByDataAttributes = { [key: string]: unknown };
+
+export type DatasetSubTopicDataAttributesUpdatedByData = {
+ attributes?: DatasetSubTopicDataAttributesUpdatedByDataAttributes;
+ id?: number;
+};
+
+export type DatasetSubTopicDataAttributesUpdatedBy = {
+ data?: DatasetSubTopicDataAttributesUpdatedByData;
+};
+
+export type DatasetSubTopicDataAttributes = {
+ createdAt?: string;
+ createdBy?: DatasetSubTopicDataAttributesCreatedBy;
+ name?: string;
+ updatedAt?: string;
+ updatedBy?: DatasetSubTopicDataAttributesUpdatedBy;
+};
+
+export type DatasetSubTopicDataAttributesCreatedByDataAttributes = { [key: string]: unknown };
+
+export type DatasetSubTopicDataAttributesCreatedByData = {
+ attributes?: DatasetSubTopicDataAttributesCreatedByDataAttributes;
+ id?: number;
+};
+
+export type DatasetSubTopicDataAttributesCreatedBy = {
+ data?: DatasetSubTopicDataAttributesCreatedByData;
+};
+
+export type DatasetLayersDataItemAttributes = {
+ createdAt?: string;
+ createdBy?: DatasetLayersDataItemAttributesCreatedBy;
+ legend_config?: DatasetLayersDataItemAttributesLegendConfig;
+ mapbox_config?: unknown;
+ name?: string;
+ params_config?: unknown;
+ type?: DatasetLayersDataItemAttributesType;
+ updatedAt?: string;
+ updatedBy?: DatasetLayersDataItemAttributesUpdatedBy;
+};
+
+export type DatasetLayersDataItem = {
+ attributes?: DatasetLayersDataItemAttributes;
+ id?: number;
+};
+
+export type DatasetLayers = {
+ data?: DatasetLayersDataItem[];
+};
+
+export type DatasetLayersDataItemAttributesUpdatedByDataAttributes = { [key: string]: unknown };
+
+export type DatasetLayersDataItemAttributesUpdatedByData = {
+ attributes?: DatasetLayersDataItemAttributesUpdatedByDataAttributes;
+ id?: number;
+};
+
+export type DatasetLayersDataItemAttributesUpdatedBy = {
+ data?: DatasetLayersDataItemAttributesUpdatedByData;
+};
+
+export type DatasetLayersDataItemAttributesType = typeof DatasetLayersDataItemAttributesType[keyof typeof DatasetLayersDataItemAttributesType];
+
+
+// eslint-disable-next-line @typescript-eslint/no-redeclare
+export const DatasetLayersDataItemAttributesType = {
+ static: 'static',
+ animated: 'animated',
+} as const;
+
+export type DatasetLayersDataItemAttributesLegendConfigType = typeof DatasetLayersDataItemAttributesLegendConfigType[keyof typeof DatasetLayersDataItemAttributesLegendConfigType];
+
+
+// eslint-disable-next-line @typescript-eslint/no-redeclare
+export const DatasetLayersDataItemAttributesLegendConfigType = {
+ basic: 'basic',
+ choropleth: 'choropleth',
+ gradient: 'gradient',
+} as const;
+
+export type DatasetLayersDataItemAttributesLegendConfigItemsItem = {
+ color?: string;
+ id?: number;
+ value?: string;
+};
+
+export type DatasetLayersDataItemAttributesLegendConfig = {
+ id?: number;
+ items?: DatasetLayersDataItemAttributesLegendConfigItemsItem[];
+ type?: DatasetLayersDataItemAttributesLegendConfigType;
+};
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributes = {
+ blocked?: boolean;
+ createdAt?: string;
+ createdBy?: DatasetLayersDataItemAttributesCreatedByDataAttributesCreatedBy;
+ email?: string;
+ firstname?: string;
+ isActive?: boolean;
+ lastname?: string;
+ preferedLanguage?: string;
+ registrationToken?: string;
+ resetPasswordToken?: string;
+ roles?: DatasetLayersDataItemAttributesCreatedByDataAttributesRoles;
+ updatedAt?: string;
+ updatedBy?: DatasetLayersDataItemAttributesCreatedByDataAttributesUpdatedBy;
+ username?: string;
+};
+
+export type DatasetLayersDataItemAttributesCreatedByData = {
+ attributes?: DatasetLayersDataItemAttributesCreatedByDataAttributes;
+ id?: number;
+};
+
+export type DatasetLayersDataItemAttributesCreatedBy = {
+ data?: DatasetLayersDataItemAttributesCreatedByData;
+};
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesUpdatedByDataAttributes = { [key: string]: unknown };
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesUpdatedByData = {
+ attributes?: DatasetLayersDataItemAttributesCreatedByDataAttributesUpdatedByDataAttributes;
+ id?: number;
+};
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesUpdatedBy = {
+ data?: DatasetLayersDataItemAttributesCreatedByDataAttributesUpdatedByData;
+};
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItem = {
+ attributes?: DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributes;
+ id?: number;
+};
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesRoles = {
+ data?: DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItem[];
+};
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesUsersDataItemAttributes = { [key: string]: unknown };
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesUsersDataItem = {
+ attributes?: DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesUsersDataItemAttributes;
+ id?: number;
+};
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesUsers = {
+ data?: DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesUsersDataItem[];
+};
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesUpdatedByDataAttributes = { [key: string]: unknown };
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesUpdatedByData = {
+ attributes?: DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesUpdatedByDataAttributes;
+ id?: number;
+};
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesUpdatedBy = {
+ data?: DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesUpdatedByData;
+};
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItem = {
+ attributes?: DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributes;
+ id?: number;
+};
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesPermissions = {
+ data?: DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItem[];
+};
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributes = {
+ code?: string;
+ createdAt?: string;
+ createdBy?: DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesCreatedBy;
+ description?: string;
+ name?: string;
+ permissions?: DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesPermissions;
+ updatedAt?: string;
+ updatedBy?: DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesUpdatedBy;
+ users?: DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesUsers;
+};
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesUpdatedByDataAttributes = { [key: string]: unknown };
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesUpdatedByData = {
+ attributes?: DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesUpdatedByDataAttributes;
+ id?: number;
+};
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesUpdatedBy = {
+ data?: DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesUpdatedByData;
+};
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributes = {
+ action?: string;
+ actionParameters?: unknown;
+ conditions?: unknown;
+ createdAt?: string;
+ createdBy?: DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesCreatedBy;
+ properties?: unknown;
+ role?: DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesRole;
+ subject?: string;
+ updatedAt?: string;
+ updatedBy?: DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesUpdatedBy;
+};
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesRoleDataAttributes = { [key: string]: unknown };
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesRoleData = {
+ attributes?: DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesRoleDataAttributes;
+ id?: number;
+};
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesRole = {
+ data?: DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesRoleData;
+};
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesCreatedByDataAttributes = { [key: string]: unknown };
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesCreatedByData = {
+ attributes?: DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesCreatedByDataAttributes;
+ id?: number;
+};
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesCreatedBy = {
+ data?: DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesPermissionsDataItemAttributesCreatedByData;
+};
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesCreatedByDataAttributes = { [key: string]: unknown };
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesCreatedByData = {
+ attributes?: DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesCreatedByDataAttributes;
+ id?: number;
+};
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesCreatedBy = {
+ data?: DatasetLayersDataItemAttributesCreatedByDataAttributesRolesDataItemAttributesCreatedByData;
+};
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesCreatedByDataAttributes = { [key: string]: unknown };
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesCreatedByData = {
+ attributes?: DatasetLayersDataItemAttributesCreatedByDataAttributesCreatedByDataAttributes;
+ id?: number;
+};
+
+export type DatasetLayersDataItemAttributesCreatedByDataAttributesCreatedBy = {
+ data?: DatasetLayersDataItemAttributesCreatedByDataAttributesCreatedByData;
+};
+
+export type DatasetDefaultLayerDataAttributes = { [key: string]: unknown };
+
+export type DatasetDefaultLayerData = {
+ attributes?: DatasetDefaultLayerDataAttributes;
+ id?: number;
+};
+
+export type DatasetDefaultLayer = {
+ data?: DatasetDefaultLayerData;
+};
+
+export type DatasetCreatedByDataAttributes = { [key: string]: unknown };
+
+export type DatasetCreatedByData = {
+ attributes?: DatasetCreatedByDataAttributes;
+ id?: number;
+};
+
+export type DatasetCreatedBy = {
+ data?: DatasetCreatedByData;
+};
+
+export type DatasetListResponseMetaPagination = {
+ page?: number;
+ /** @maximum 1 */
+ pageCount?: number;
+ /** @minimum 25 */
+ pageSize?: number;
+ total?: number;
+};
+
+export type DatasetListResponseMeta = {
+ pagination?: DatasetListResponseMetaPagination;
+};
+
+export interface DatasetListResponseDataItem {
+ attributes?: Dataset;
+ id?: number;
+}
+
+export interface DatasetListResponse {
+ data?: DatasetListResponseDataItem[];
+ meta?: DatasetListResponseMeta;
+}
+
+export interface DatasetRequest {
+ data: DatasetRequestData;
+}
+
+export type DatasetRequestDataTopic = number | string;
+
+export type DatasetRequestDataSubTopic = number | string;
+
+export type DatasetRequestDataLayersItem = number | string;
+
+export type DatasetRequestDataDefaultLayer = number | string;
+
+export type DatasetRequestData = {
+ default_layer?: DatasetRequestDataDefaultLayer;
+ layers?: DatasetRequestDataLayersItem[];
+ name: string;
+ sub_topic?: DatasetRequestDataSubTopic;
+ topic?: DatasetRequestDataTopic;
+};
+
+export type ErrorErrorDetails = { [key: string]: unknown };
+
+export type ErrorError = {
+ details?: ErrorErrorDetails;
+ message?: string;
+ name?: string;
+ status?: number;
+};
+
+export interface Error {
+ /** @nullable */
+ data?: ErrorData;
+ error: ErrorError;
+}
+
+export type ErrorDataOneOfTwoItem = { [key: string]: unknown };
+
+export type ErrorDataOneOf = { [key: string]: unknown };
+
+/**
+ * @nullable
+ */
+export type ErrorData = ErrorDataOneOf | ErrorDataOneOfTwoItem[] | null;
+
diff --git a/client/src/types/generated/sub-topic.ts b/client/src/types/generated/sub-topic.ts
new file mode 100644
index 0000000..f27f548
--- /dev/null
+++ b/client/src/types/generated/sub-topic.ts
@@ -0,0 +1,353 @@
+/**
+ * Generated by orval v7.2.0 🍺
+ * Do not edit manually.
+ * DOCUMENTATION
+ * OpenAPI spec version: 1.0.0
+ */
+import {
+ useMutation,
+ useQuery
+} from '@tanstack/react-query'
+import type {
+ DefinedInitialDataOptions,
+ DefinedUseQueryResult,
+ MutationFunction,
+ QueryFunction,
+ QueryKey,
+ UndefinedInitialDataOptions,
+ UseMutationOptions,
+ UseMutationResult,
+ UseQueryOptions,
+ UseQueryResult
+} from '@tanstack/react-query'
+import type {
+ Error,
+ GetSubTopicsParams,
+ SubTopicListResponse,
+ SubTopicRequest,
+ SubTopicResponse
+} from './strapi.schemas'
+import { API } from '../../services/api';
+import type { ErrorType, BodyType } from '../../services/api';
+
+
+
+type SecondParameter any> = Parameters[1];
+
+
+export const getSubTopics = (
+ params?: GetSubTopicsParams,
+ options?: SecondParameter,signal?: AbortSignal
+) => {
+
+
+ return API(
+ {url: `/sub-topics`, method: 'GET',
+ params, signal
+ },
+ options);
+ }
+
+
+export const getGetSubTopicsQueryKey = (params?: GetSubTopicsParams,) => {
+ return [`/sub-topics`, ...(params ? [params]: [])] as const;
+ }
+
+
+export const getGetSubTopicsQueryOptions = >, TError = ErrorType>(params?: GetSubTopicsParams, options?: { query?:Partial