From 41ba52a5914616dd83d42d284ca928958e022fbe Mon Sep 17 00:00:00 2001 From: Ilya Pakhomov Date: Mon, 24 Nov 2025 21:16:36 +0600 Subject: [PATCH 1/2] fix: adjusted types and deprecation notices --- src/create-entity-api.ts | 1 - src/types/custom-hooks.ts | 3 +++ src/types/entity-api-utils.ts | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/create-entity-api.ts b/src/create-entity-api.ts index 49c5ab2..673c613 100644 --- a/src/create-entity-api.ts +++ b/src/create-entity-api.ts @@ -37,7 +37,6 @@ import { * @param {((pagination: Pagination, request: TSearchRequest) => number) | undefined} [options.getCurrentPage=((pagination) => pagination.currentPage)] - The function to get current page. * @returns {Omit, keyof EntityApiCustomHooks> & EntityApiCustomHooks} The entity API. */ - export function createEntityApi< TEntity extends BaseEntity, TSearchRequest extends PaginationRequest = PaginationRequest, diff --git a/src/types/custom-hooks.ts b/src/types/custom-hooks.ts index 785f607..8828d45 100644 --- a/src/types/custom-hooks.ts +++ b/src/types/custom-hooks.ts @@ -6,5 +6,8 @@ export type EntityApiCustomHooks< TSearchRequest extends PaginationRequest = PaginationRequest, TSearchResponse extends PaginationResponse = PaginationResponse, > = { + /** + * @deprecated This hook will be removed. Instead, use 'useSearchPaginatedInfiniteQuery' hook in your entity API + */ useSearchInfiniteQuery: ReturnType>; }; diff --git a/src/types/entity-api-utils.ts b/src/types/entity-api-utils.ts index 102d252..fc7da8b 100644 --- a/src/types/entity-api-utils.ts +++ b/src/types/entity-api-utils.ts @@ -75,7 +75,7 @@ export type EntityApiUtils< */ handleEntityUpdate: ( arg: EntityPartial | TEntity['id'], - endpointLifecycle: LifecycleApi, EntityPartial | TEntity['id']>, + endpointLifecycle: LifecycleApi | void, EntityPartial | TEntity['id']>, options?: { optimistic?: boolean; shouldRefetchEntity?: boolean; From 2d07532893810d87e953d541c543c745f93e9917 Mon Sep 17 00:00:00 2001 From: Ilya Pakhomov Date: Mon, 24 Nov 2025 21:18:45 +0600 Subject: [PATCH 2/2] chore: bump version to 1.0.0-alpha.2 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index fdc44aa..1930f2c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@ronas-it/rtkq-entity-api", - "version": "1.0.0-alpha.1", + "version": "1.0.0-alpha.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@ronas-it/rtkq-entity-api", - "version": "1.0.0-alpha.1", + "version": "1.0.0-alpha.2", "license": "MIT", "dependencies": { "@reduxjs/toolkit": "^2.9.0", diff --git a/package.json b/package.json index 5ced969..b880df7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ronas-it/rtkq-entity-api", - "version": "1.0.0-alpha.1", + "version": "1.0.0-alpha.2", "description": "Wrapper utilities for CRUD operations with REST APIs entities using RTK Query", "license": "MIT", "author": "Ronas IT",