api-core-lib 10.10.10 → 11.0.0

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.
package/dist/index.d.mts CHANGED
@@ -88,7 +88,6 @@ interface MiddlewareContext {
88
88
  req: InternalAxiosRequestConfig;
89
89
  res?: AxiosResponse;
90
90
  error?: any;
91
- logger: Logger;
92
91
  custom?: Record<string, any>;
93
92
  }
94
93
  /**
@@ -197,20 +196,6 @@ type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent';
197
196
  * An interface for a custom logger, compatible with the standard `console` object.
198
197
  * It now includes a `debug` method for more granular logging.
199
198
  */
200
- interface Logger {
201
- /** Logs a standard message. In our wrapper, this is often an alias for `info` or `debug`. */
202
- log(message?: any, ...optionalParams: any[]): void;
203
- /** Logs an informational message. */
204
- info(message?: any, ...optionalParams: any[]): void;
205
- /** Logs a warning message. */
206
- warn(message?: any, ...optionalParams: any[]): void;
207
- /** Logs an error message. */
208
- error(message?: any, ...optionalParams: any[]): void;
209
- /**
210
- * Logs a debug message, typically for verbose, development-only output.
211
- */
212
- debug(message?: any, ...optionalParams: any[]): void;
213
- }
214
199
  /**
215
200
  * The main configuration object for the `createApiClient` factory function.
216
201
  */
@@ -230,7 +215,6 @@ interface ApiClientConfig {
230
215
  /** A callback function executed if the token refresh process fails. */
231
216
  onRefreshError?: (error: any) => void;
232
217
  /** A custom logger instance. Defaults to the browser `console`. */
233
- logger?: Logger;
234
218
  /** An array of middleware functions to be executed with every request. */
235
219
  middleware?: Middleware[];
236
220
  /**
@@ -244,19 +228,10 @@ interface ApiClientConfig {
244
228
  * @default false
245
229
  */
246
230
  defaultIsPublic?: boolean;
231
+ maxTokenRefreshRetries?: number;
232
+ maxQueueSize?: number;
247
233
  }
248
234
 
249
- /**
250
- * @file src/core/client.ts
251
- * @description This is the heart of the API client library.
252
- * The `createApiClient` function constructs and configures a sophisticated Axios instance.
253
- * It features intelligent, security-first token management, a flexible middleware system,
254
- * and customizable logging, all designed to work seamlessly in modern web frameworks like Next.js.
255
- */
256
-
257
- /**
258
- * Creates and configures a new Axios instance with advanced features.
259
- */
260
235
  declare function createApiClient(config: ApiClientConfig): AxiosInstance;
261
236
 
262
237
  /**
@@ -327,122 +302,52 @@ interface UseApiReturn<T> {
327
302
  query: UseApiQuery;
328
303
  }
329
304
 
330
- /**
331
- * يصف إجراءً واحدًا داخل وحدة API، مع أنواع دقيقة للإدخال والإخراج.
332
- * @template TInput نوع بيانات الإدخال (الجسم أو معاملات الاستعلام).
333
- * @template TOutput نوع البيانات التي يتم إرجاعها في `data` عند النجاح.
334
- */
335
305
  interface ActionConfig<TInput = any, TOutput = any> {
336
- /** نوع طلب HTTP. */
337
306
  method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
338
- /**
339
- * المسار النسبي للإجراء. يمكن أن يحتوي على متغيرات مثل `{id}` أو `{tenantId}`.
340
- * مثال: '/{id}/activate'
341
- */
342
307
  path: string;
343
- /**
344
- * وصف للإجراء، مفيد للتوثيق وتلميحات محرر الكود.
345
- */
346
308
  description?: string;
347
- /**
348
- * إذا كان `true`، فهذا يعني أن الإجراء يجلب قائمة بيانات ويدعم معاملات الاستعلام (pagination, sorting).
349
- * سيتم تزويد هذا الإجراء بأدوات التحكم `query` تلقائيًا.
350
- */
351
309
  isList?: boolean;
352
- /**
353
- * قائمة بأسماء الإجراءات (من نفس الموديول) التي يجب إبطال بياناتها في الـ Cache بعد نجاح هذا الإجراء.
354
- * أساسي لمزامنة البيانات تلقائيًا بعد عمليات التعديل (Mutations).
355
- * مثال: إجراء `update` يجب أن يبطل `getOne` و `list`.
356
- */
357
310
  invalidates?: string[];
358
311
  }
359
- /**
360
- * يمثل الإعداد الكامل لوحدة API. هذا هو "مصدر الحقيقة" لمجموعة من نقاط النهاية.
361
- */
362
312
  interface ApiModuleConfig {
363
- /** نقطة النهاية الأساسية للموديول (مثل '/api/v1/products'). */
364
313
  baseEndpoint: string;
365
- /** قاموس يحتوي على جميع الإجراءات المتاحة في هذا الموديول. المفتاح هو اسم الإجراء. */
366
314
  actions: Record<string, ActionConfig<any, any>>;
367
315
  }
368
- /**
369
- * إعدادات اختيارية لتخصيص سلوك الهوك `useApiModule`.
370
- */
371
316
  interface UseApiModuleOptions {
372
- /**
373
- * دالة callback تُنفذ عند نجاح أي إجراء.
374
- * @param actionName اسم الإجراء الذي نجح.
375
- * @param message رسالة النجاح من الـ API.
376
- * @param data البيانات المُرجعة.
377
- */
378
317
  onSuccess?: (actionName: string, message: string, data: any) => void;
379
- /**
380
- * دالة callback تُنفذ عند فشل أي إجراء.
381
- * @param actionName اسم الإجراء الذي فشل.
382
- * @param message رسالة الخطأ من الـ API.
383
- * @param error كائن الخطأ الموحد.
384
- */
385
318
  onError?: (actionName: string, message: string, error?: ApiError | null) => void;
386
- /**
387
- * المدة التي تعتبر فيها البيانات "حية" (fresh) بالمللي ثانية.
388
- * خلال هذه المدة، لن يتم إرسال طلب شبكة جديد لنفس البيانات.
389
- * الافتراضي: `0` (مما يعني أنها تعتبر "قديمة" stale فورًا).
390
- */
391
319
  staleTime?: number;
392
- /**
393
- * مدة بقاء البيانات في الـ Cache (بالمللي ثانية) قبل أن يتم حذفها تلقائيًا.
394
- * يمرر إلى `cacheManager.set`. إذا لم يتم تحديده، يستخدم `CacheManager` قيمته الافتراضية.
395
- */
396
320
  cacheTime?: number;
397
- /**
398
- * إذا كان `true`، سيتم إعادة جلب جميع الإجراءات التي تم استدعاؤها عند عودة المستخدم إلى نافذة التطبيق.
399
- * الافتراضي: `true`.
400
- */
401
321
  refetchOnWindowFocus?: boolean;
402
322
  }
403
- /**
404
- * الحالة التي يديرها كل إجراء على حدة.
405
- * @template TOutput نوع بيانات الإخراج.
406
- */
407
323
  interface ActionState<TOutput> {
408
- /** البيانات التي تم جلبها بنجاح. تكون `null` في البداية أو عند حدوث خطأ. */
409
324
  data: TOutput | null;
410
- /** كائن الخطأ في حال فشل الطلب. */
411
325
  error: ApiError | null;
412
- /** `true` أثناء تنفيذ طلب الشبكة. */
413
326
  loading: boolean;
414
- /** `true` إذا كان آخر طلب قد نجح. */
415
327
  success: boolean;
416
- /** `true` إذا تم استدعاء الإجراء مرة واحدة على الأقل. مفيد للتمييز بين الحالة الأولية وحالة "لم يتم العثور على بيانات". */
417
328
  called: boolean;
418
329
  }
419
330
  /**
420
- * الكائن التنفيذي للإجراء، يجمع بين دالة التنفيذ وحالته الخاصة.
421
- * @template TInput نوع بيانات الإدخال.
422
- * @template TOutput نوع بيانات الإخراج.
331
+ * The unified object for a single action, containing its state, executor, and controls.
332
+ * This is the new, more ergonomic return structure.
423
333
  */
424
334
  interface ExecutableAction<TInput, TOutput> {
425
- /**
426
- * الدالة الرئيسية لتنفيذ الإجراء.
427
- * @param input بيانات الإدخال (الجسم أو معاملات الاستعلام).
428
- * @param options خيارات إضافية للطلب مثل `pathParams` و `config` Axios.
429
- * @returns `Promise` يحتوي على الاستجابة الموحدة `StandardResponse`.
430
- */
335
+ /** The reactive state for this specific action. */
336
+ state: ActionState<TOutput>;
337
+ /** The stable function to execute the API call. */
431
338
  execute: (input?: TInput, options?: {
432
339
  pathParams?: Record<string, any>;
433
340
  config?: AxiosRequestConfig;
434
341
  query?: QueryOptions;
435
342
  }) => Promise<StandardResponse<TOutput>>;
436
- /** الحالة الحالية لهذا الإجراء المحدد. */
437
- state: ActionState<TOutput>;
438
- /** دالة لإعادة حالة هذا الإجراء إلى وضعها الأولي. */
343
+ /** A stable function to reset the action's state to its initial value. */
439
344
  reset: () => void;
440
- /** أدوات التحكم بالاستعلام (pagination, sorting) متاحة فقط للإجراءات المعرفة بـ `isList: true`. */
345
+ /** Query controls (pagination, sorting, etc.) available only if `isList: true`. */
441
346
  query?: UseApiQuery;
442
347
  }
443
348
  /**
444
- * النوع النهائي الذي يتم إرجاعه من الهوك `useApiModule`.
445
- * وهو عبارة عن قاموس من الإجراءات القابلة للتنفيذ، مع أنواع مستنتجة بالكامل.
349
+ * The final, fully-typed object returned by the useApiModule hook.
350
+ * It's a dictionary of executable actions.
446
351
  */
447
352
  type ModuleActions<TModule extends ApiModuleConfig> = {
448
353
  [K in keyof TModule['actions']]: TModule['actions'][K] extends ActionConfig<infer TInput, infer TOutput> ? ExecutableAction<TInput, TOutput> : never;
@@ -539,21 +444,14 @@ declare class CacheManager {
539
444
  }
540
445
  declare const cacheManager: CacheManager;
541
446
 
542
- /**
543
- * A smart response processor that normalizes API responses.
544
- * It intelligently unwraps nested data from standard API envelopes
545
- * (like { success: true, data: {...} }) and provides direct access
546
- * to the core data, while still handling errors consistently.
547
- *
548
- * @param responseOrError The raw Axios response or a pre-processed ApiError.
549
- * @returns A standardized `StandardResponse` object with direct access to `.data`.
550
- */
551
- declare const processResponse: <T>(responseOrError: AxiosResponse<any> | ApiError, log?: boolean) => StandardResponse<T>;
447
+ declare const processResponse: <T>(responseOrError: AxiosResponse<any> | ApiError) => StandardResponse<T>;
552
448
 
553
449
  declare function useApi<T>(axiosInstance: AxiosInstance, config: UseApiConfig<T>): UseApiReturn<T>;
554
450
 
555
451
  /**
556
- * هوك متقدم يقوم ببناء مجموعة من الإجراءات القابلة للتنفيذ من إعدادات موديول API.
452
+ * A production-ready custom hook that dynamically builds a set of executable and fully-typed API actions.
453
+ * It provides a unified, ergonomic API for each action, collocating state and execution logic,
454
+ * while guaranteeing stable function references to prevent re-renders.
557
455
  */
558
456
  declare function useApiModule<TModule extends ApiModuleConfig>(axiosInstance: AxiosInstance, moduleConfig: TModule, options?: UseApiModuleOptions): ModuleActions<TModule>;
559
457
 
@@ -603,4 +501,4 @@ interface UseApiResourceReturn<T, TCreate, TUpdate, TPathParams> {
603
501
  setQuery: React.Dispatch<React.SetStateAction<QueryOptions>>;
604
502
  }
605
503
 
606
- export { type ActionConfig, type ActionOptions, type ActionState, type ApiClientConfig, type ApiError, type ApiModuleConfig, type ApiResourceStatus, type ApiResponse, type ExecutableAction, type LogLevel, type Logger, type Middleware, type MiddlewareContext, type ModuleActions, type PaginationMeta, type QueryOptions, type RefreshTokenConfig, type RequestConfig, type StandardResponse, type TokenManager, type Tokens, type UseApiActions, type UseApiConfig, type UseApiModuleOptions, type UseApiQuery, type UseApiResourceActions, type UseApiResourceConfig, type UseApiResourceReturn, type UseApiResourceState, type UseApiReturn, type UseApiState, type ValidationError, buildPaginateQuery, cacheManager, createApiActions, createApiClient, createApiServices, processResponse, useApi, useApiModule };
504
+ export { type ActionConfig, type ActionOptions, type ActionState, type ApiClientConfig, type ApiError, type ApiModuleConfig, type ApiResourceStatus, type ApiResponse, type ExecutableAction, type LogLevel, type Middleware, type MiddlewareContext, type ModuleActions, type PaginationMeta, type QueryOptions, type RefreshTokenConfig, type RequestConfig, type StandardResponse, type TokenManager, type Tokens, type UseApiActions, type UseApiConfig, type UseApiModuleOptions, type UseApiQuery, type UseApiResourceActions, type UseApiResourceConfig, type UseApiResourceReturn, type UseApiResourceState, type UseApiReturn, type UseApiState, type ValidationError, buildPaginateQuery, cacheManager, createApiActions, createApiClient, createApiServices, processResponse, useApi, useApiModule };
package/dist/index.d.ts CHANGED
@@ -88,7 +88,6 @@ interface MiddlewareContext {
88
88
  req: InternalAxiosRequestConfig;
89
89
  res?: AxiosResponse;
90
90
  error?: any;
91
- logger: Logger;
92
91
  custom?: Record<string, any>;
93
92
  }
94
93
  /**
@@ -197,20 +196,6 @@ type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent';
197
196
  * An interface for a custom logger, compatible with the standard `console` object.
198
197
  * It now includes a `debug` method for more granular logging.
199
198
  */
200
- interface Logger {
201
- /** Logs a standard message. In our wrapper, this is often an alias for `info` or `debug`. */
202
- log(message?: any, ...optionalParams: any[]): void;
203
- /** Logs an informational message. */
204
- info(message?: any, ...optionalParams: any[]): void;
205
- /** Logs a warning message. */
206
- warn(message?: any, ...optionalParams: any[]): void;
207
- /** Logs an error message. */
208
- error(message?: any, ...optionalParams: any[]): void;
209
- /**
210
- * Logs a debug message, typically for verbose, development-only output.
211
- */
212
- debug(message?: any, ...optionalParams: any[]): void;
213
- }
214
199
  /**
215
200
  * The main configuration object for the `createApiClient` factory function.
216
201
  */
@@ -230,7 +215,6 @@ interface ApiClientConfig {
230
215
  /** A callback function executed if the token refresh process fails. */
231
216
  onRefreshError?: (error: any) => void;
232
217
  /** A custom logger instance. Defaults to the browser `console`. */
233
- logger?: Logger;
234
218
  /** An array of middleware functions to be executed with every request. */
235
219
  middleware?: Middleware[];
236
220
  /**
@@ -244,19 +228,10 @@ interface ApiClientConfig {
244
228
  * @default false
245
229
  */
246
230
  defaultIsPublic?: boolean;
231
+ maxTokenRefreshRetries?: number;
232
+ maxQueueSize?: number;
247
233
  }
248
234
 
249
- /**
250
- * @file src/core/client.ts
251
- * @description This is the heart of the API client library.
252
- * The `createApiClient` function constructs and configures a sophisticated Axios instance.
253
- * It features intelligent, security-first token management, a flexible middleware system,
254
- * and customizable logging, all designed to work seamlessly in modern web frameworks like Next.js.
255
- */
256
-
257
- /**
258
- * Creates and configures a new Axios instance with advanced features.
259
- */
260
235
  declare function createApiClient(config: ApiClientConfig): AxiosInstance;
261
236
 
262
237
  /**
@@ -327,122 +302,52 @@ interface UseApiReturn<T> {
327
302
  query: UseApiQuery;
328
303
  }
329
304
 
330
- /**
331
- * يصف إجراءً واحدًا داخل وحدة API، مع أنواع دقيقة للإدخال والإخراج.
332
- * @template TInput نوع بيانات الإدخال (الجسم أو معاملات الاستعلام).
333
- * @template TOutput نوع البيانات التي يتم إرجاعها في `data` عند النجاح.
334
- */
335
305
  interface ActionConfig<TInput = any, TOutput = any> {
336
- /** نوع طلب HTTP. */
337
306
  method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
338
- /**
339
- * المسار النسبي للإجراء. يمكن أن يحتوي على متغيرات مثل `{id}` أو `{tenantId}`.
340
- * مثال: '/{id}/activate'
341
- */
342
307
  path: string;
343
- /**
344
- * وصف للإجراء، مفيد للتوثيق وتلميحات محرر الكود.
345
- */
346
308
  description?: string;
347
- /**
348
- * إذا كان `true`، فهذا يعني أن الإجراء يجلب قائمة بيانات ويدعم معاملات الاستعلام (pagination, sorting).
349
- * سيتم تزويد هذا الإجراء بأدوات التحكم `query` تلقائيًا.
350
- */
351
309
  isList?: boolean;
352
- /**
353
- * قائمة بأسماء الإجراءات (من نفس الموديول) التي يجب إبطال بياناتها في الـ Cache بعد نجاح هذا الإجراء.
354
- * أساسي لمزامنة البيانات تلقائيًا بعد عمليات التعديل (Mutations).
355
- * مثال: إجراء `update` يجب أن يبطل `getOne` و `list`.
356
- */
357
310
  invalidates?: string[];
358
311
  }
359
- /**
360
- * يمثل الإعداد الكامل لوحدة API. هذا هو "مصدر الحقيقة" لمجموعة من نقاط النهاية.
361
- */
362
312
  interface ApiModuleConfig {
363
- /** نقطة النهاية الأساسية للموديول (مثل '/api/v1/products'). */
364
313
  baseEndpoint: string;
365
- /** قاموس يحتوي على جميع الإجراءات المتاحة في هذا الموديول. المفتاح هو اسم الإجراء. */
366
314
  actions: Record<string, ActionConfig<any, any>>;
367
315
  }
368
- /**
369
- * إعدادات اختيارية لتخصيص سلوك الهوك `useApiModule`.
370
- */
371
316
  interface UseApiModuleOptions {
372
- /**
373
- * دالة callback تُنفذ عند نجاح أي إجراء.
374
- * @param actionName اسم الإجراء الذي نجح.
375
- * @param message رسالة النجاح من الـ API.
376
- * @param data البيانات المُرجعة.
377
- */
378
317
  onSuccess?: (actionName: string, message: string, data: any) => void;
379
- /**
380
- * دالة callback تُنفذ عند فشل أي إجراء.
381
- * @param actionName اسم الإجراء الذي فشل.
382
- * @param message رسالة الخطأ من الـ API.
383
- * @param error كائن الخطأ الموحد.
384
- */
385
318
  onError?: (actionName: string, message: string, error?: ApiError | null) => void;
386
- /**
387
- * المدة التي تعتبر فيها البيانات "حية" (fresh) بالمللي ثانية.
388
- * خلال هذه المدة، لن يتم إرسال طلب شبكة جديد لنفس البيانات.
389
- * الافتراضي: `0` (مما يعني أنها تعتبر "قديمة" stale فورًا).
390
- */
391
319
  staleTime?: number;
392
- /**
393
- * مدة بقاء البيانات في الـ Cache (بالمللي ثانية) قبل أن يتم حذفها تلقائيًا.
394
- * يمرر إلى `cacheManager.set`. إذا لم يتم تحديده، يستخدم `CacheManager` قيمته الافتراضية.
395
- */
396
320
  cacheTime?: number;
397
- /**
398
- * إذا كان `true`، سيتم إعادة جلب جميع الإجراءات التي تم استدعاؤها عند عودة المستخدم إلى نافذة التطبيق.
399
- * الافتراضي: `true`.
400
- */
401
321
  refetchOnWindowFocus?: boolean;
402
322
  }
403
- /**
404
- * الحالة التي يديرها كل إجراء على حدة.
405
- * @template TOutput نوع بيانات الإخراج.
406
- */
407
323
  interface ActionState<TOutput> {
408
- /** البيانات التي تم جلبها بنجاح. تكون `null` في البداية أو عند حدوث خطأ. */
409
324
  data: TOutput | null;
410
- /** كائن الخطأ في حال فشل الطلب. */
411
325
  error: ApiError | null;
412
- /** `true` أثناء تنفيذ طلب الشبكة. */
413
326
  loading: boolean;
414
- /** `true` إذا كان آخر طلب قد نجح. */
415
327
  success: boolean;
416
- /** `true` إذا تم استدعاء الإجراء مرة واحدة على الأقل. مفيد للتمييز بين الحالة الأولية وحالة "لم يتم العثور على بيانات". */
417
328
  called: boolean;
418
329
  }
419
330
  /**
420
- * الكائن التنفيذي للإجراء، يجمع بين دالة التنفيذ وحالته الخاصة.
421
- * @template TInput نوع بيانات الإدخال.
422
- * @template TOutput نوع بيانات الإخراج.
331
+ * The unified object for a single action, containing its state, executor, and controls.
332
+ * This is the new, more ergonomic return structure.
423
333
  */
424
334
  interface ExecutableAction<TInput, TOutput> {
425
- /**
426
- * الدالة الرئيسية لتنفيذ الإجراء.
427
- * @param input بيانات الإدخال (الجسم أو معاملات الاستعلام).
428
- * @param options خيارات إضافية للطلب مثل `pathParams` و `config` Axios.
429
- * @returns `Promise` يحتوي على الاستجابة الموحدة `StandardResponse`.
430
- */
335
+ /** The reactive state for this specific action. */
336
+ state: ActionState<TOutput>;
337
+ /** The stable function to execute the API call. */
431
338
  execute: (input?: TInput, options?: {
432
339
  pathParams?: Record<string, any>;
433
340
  config?: AxiosRequestConfig;
434
341
  query?: QueryOptions;
435
342
  }) => Promise<StandardResponse<TOutput>>;
436
- /** الحالة الحالية لهذا الإجراء المحدد. */
437
- state: ActionState<TOutput>;
438
- /** دالة لإعادة حالة هذا الإجراء إلى وضعها الأولي. */
343
+ /** A stable function to reset the action's state to its initial value. */
439
344
  reset: () => void;
440
- /** أدوات التحكم بالاستعلام (pagination, sorting) متاحة فقط للإجراءات المعرفة بـ `isList: true`. */
345
+ /** Query controls (pagination, sorting, etc.) available only if `isList: true`. */
441
346
  query?: UseApiQuery;
442
347
  }
443
348
  /**
444
- * النوع النهائي الذي يتم إرجاعه من الهوك `useApiModule`.
445
- * وهو عبارة عن قاموس من الإجراءات القابلة للتنفيذ، مع أنواع مستنتجة بالكامل.
349
+ * The final, fully-typed object returned by the useApiModule hook.
350
+ * It's a dictionary of executable actions.
446
351
  */
447
352
  type ModuleActions<TModule extends ApiModuleConfig> = {
448
353
  [K in keyof TModule['actions']]: TModule['actions'][K] extends ActionConfig<infer TInput, infer TOutput> ? ExecutableAction<TInput, TOutput> : never;
@@ -539,21 +444,14 @@ declare class CacheManager {
539
444
  }
540
445
  declare const cacheManager: CacheManager;
541
446
 
542
- /**
543
- * A smart response processor that normalizes API responses.
544
- * It intelligently unwraps nested data from standard API envelopes
545
- * (like { success: true, data: {...} }) and provides direct access
546
- * to the core data, while still handling errors consistently.
547
- *
548
- * @param responseOrError The raw Axios response or a pre-processed ApiError.
549
- * @returns A standardized `StandardResponse` object with direct access to `.data`.
550
- */
551
- declare const processResponse: <T>(responseOrError: AxiosResponse<any> | ApiError, log?: boolean) => StandardResponse<T>;
447
+ declare const processResponse: <T>(responseOrError: AxiosResponse<any> | ApiError) => StandardResponse<T>;
552
448
 
553
449
  declare function useApi<T>(axiosInstance: AxiosInstance, config: UseApiConfig<T>): UseApiReturn<T>;
554
450
 
555
451
  /**
556
- * هوك متقدم يقوم ببناء مجموعة من الإجراءات القابلة للتنفيذ من إعدادات موديول API.
452
+ * A production-ready custom hook that dynamically builds a set of executable and fully-typed API actions.
453
+ * It provides a unified, ergonomic API for each action, collocating state and execution logic,
454
+ * while guaranteeing stable function references to prevent re-renders.
557
455
  */
558
456
  declare function useApiModule<TModule extends ApiModuleConfig>(axiosInstance: AxiosInstance, moduleConfig: TModule, options?: UseApiModuleOptions): ModuleActions<TModule>;
559
457
 
@@ -603,4 +501,4 @@ interface UseApiResourceReturn<T, TCreate, TUpdate, TPathParams> {
603
501
  setQuery: React.Dispatch<React.SetStateAction<QueryOptions>>;
604
502
  }
605
503
 
606
- export { type ActionConfig, type ActionOptions, type ActionState, type ApiClientConfig, type ApiError, type ApiModuleConfig, type ApiResourceStatus, type ApiResponse, type ExecutableAction, type LogLevel, type Logger, type Middleware, type MiddlewareContext, type ModuleActions, type PaginationMeta, type QueryOptions, type RefreshTokenConfig, type RequestConfig, type StandardResponse, type TokenManager, type Tokens, type UseApiActions, type UseApiConfig, type UseApiModuleOptions, type UseApiQuery, type UseApiResourceActions, type UseApiResourceConfig, type UseApiResourceReturn, type UseApiResourceState, type UseApiReturn, type UseApiState, type ValidationError, buildPaginateQuery, cacheManager, createApiActions, createApiClient, createApiServices, processResponse, useApi, useApiModule };
504
+ export { type ActionConfig, type ActionOptions, type ActionState, type ApiClientConfig, type ApiError, type ApiModuleConfig, type ApiResourceStatus, type ApiResponse, type ExecutableAction, type LogLevel, type Middleware, type MiddlewareContext, type ModuleActions, type PaginationMeta, type QueryOptions, type RefreshTokenConfig, type RequestConfig, type StandardResponse, type TokenManager, type Tokens, type UseApiActions, type UseApiConfig, type UseApiModuleOptions, type UseApiQuery, type UseApiResourceActions, type UseApiResourceConfig, type UseApiResourceReturn, type UseApiResourceState, type UseApiReturn, type UseApiState, type ValidationError, buildPaginateQuery, cacheManager, createApiActions, createApiClient, createApiServices, processResponse, useApi, useApiModule };