Skip to content

Releases: rocketbase-io/commons-rest

3.5.3

23 Sep 09:35

Choose a tag to compare

  • fixed PageableResult client detection

3.5.2

22 Sep 12:43

Choose a tag to compare

  • upgraded spring-boot 3.5.6 and spring-doc 2.8.13
  • improved generic handling within typescript client generation

3.5.1

23 Jul 07:53

Choose a tag to compare

  • fixed an issue with infinite hooks and types in case of react-query v5
  • missing wrapper for TData with InfiniteData<..>

3.5.0

22 Jul 17:43

Choose a tag to compare

  • Extended React Query code generation for v5
    • queryOptions and infiniteQueryOptions are now generated and reused by existing useQuery / useInfiniteQuery hooks.
    • Enables better integration with @tanstack/router and other libraries. You can also use them with useSuspenseQuery, etc.
    • Example:
      /**
        * [GET] /download/ppt
        */
      export const queryOptionDownloadDownloadPpt= <TData = unknown, TError = Error>(openApiModuleApi:OpenApiModuleApi,  options: Omit<UseQueryOptions<unknown, TError, TData>, "queryFn" | "queryKey"> = {}) => queryOptions(
      {
            queryKey: [`download`, `ppt`],
            queryFn: ({ signal }) => openApiModuleApi.download.downloadPpt({  overrides: { signal }}),
            ...options
      });
      
      export function useQueryDownloadDownloadPpt<TData = unknown, TError = Error>( options: Omit<UseQueryOptions<unknown, TError, TData>, "queryFn" | "queryKey"> = {}) {
          const { openApiModuleApi } = useApi();
          return useQuery<unknown, TError, TData>(queryOptionDownloadDownloadPpt(openApiModuleApi, options));
      }
      
      /**
        * [GET] /activity
        * list all tiles (pinboards, searchconfigs, briefings or showrooms a user has access to
        */
      export const queryOptionActivityFindAll= <TData=PageableResult<ActivityUnion>, TError = Error>(openApiModuleApi:OpenApiModuleApi, filter: ActivityFindAll, options: Omit<UseInfiniteQueryOptions<PageableResult<ActivityUnion>, TError, TData>, "queryFn" | "queryKey"  | "getPreviousPageParam" | "getNextPageParam" | "initialPageParam"> = {}) => infiniteQueryOptions(
      {
          queryKey: [`activity`, `list`, filter ],
          queryFn: ({ pageParam, signal }) => {
              return openApiModuleApi.activity.findAll({ ...filter, page: pageParam, overrides: { signal } })
          },
          staleTime: 2 * 1000,     ...options,
          ...createPaginationOptions()});
      
      export function useInfiniteActivityFindAll<TData = PageableResult<ActivityUnion>, TError = Error>(filter: ActivityFindAll, options: Omit<UseInfiniteQueryOptions<PageableResult<ActivityUnion>, TError, TData>, "queryFn" | "queryKey"  | "getPreviousPageParam" | "getNextPageParam" | "initialPageParam"> = {}) {
          const { openApiModuleApi } = useApi();
          return useInfiniteQuery<PageableResult<ActivityUnion>, TError, TData>(queryOptionActivityFindAll(openApiModuleApi, filter, options));
      }
    • Works for both regular and infinite query hooks.
    • Naming convention: queryOption{ControllerNameSimplified}{MethodName}

3.4.3

05 Jul 21:40

Choose a tag to compare

  • upgraded spring-boot 3.5.3 + all other
  • fixed some minor issues with client-generation
  • changed to new maven-central published pipeline (that why some versions fail/missing)

3.3.2

17 Apr 19:36

Choose a tag to compare

  • openapi-generation fixed inifinite generic for react-query > 4

3.3.1

16 Apr 21:21

Choose a tag to compare

  • openapi-generation fixed mutation cache invalidation for react-query v5

3.3.0

12 Apr 08:58

Choose a tag to compare

  • upgraded versions spring-boot 3.2.4 and spring-doc 2.5.0
  • fixed issue after upgrade with BeanValidationException
    • instead of MethodArgumentNotValidException a HandlerMethodValidationException is been thrown
    • the BeanValidationExceptionHandler now handls both
  • improved openapi-generator to support react-query 5
  • a working example is also added to the project

3.2.1

21 Feb 12:28

Choose a tag to compare

  • improved openapi generator
    • you can specify custom type imports

@Service
public class CustomOpenApiConverter extends DefaultOpenApiConverter {
    
    @Override
    public String getImportPackage(String type) {
        if (type != null && type.contains("io.productspace.backoffice.dto") ) {
            return "@rcktbs/ps-backoffice-api";
        }
        return super.getImportPackage(type);
    }
}

thins clients-generation it looks then like

import { CreateAnswerGroupCmd} from "../../model";
import { AnswerGroup } from "@rcktbs/ps-backoffice-api";

3.2.0

14 Dec 13:38

Choose a tag to compare

  • upgraded spring-boot 3.2.0, spring-doc 2.3.0 and other
  • deprecated NotFoundException + BadRequestException in favour for javax.rs versions
  • added openapi-generator convert-types for tsid as string + JsonNode as any