@dxtmisha/functional 1.11.11 → 1.11.13
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/CHANGELOG.md +19 -0
- package/ai-description.txt +3 -3
- package/ai-doc.ru.txt +11 -0
- package/ai-doc.txt +11 -0
- package/ai-types.txt +665 -289
- package/dist/library.js +406 -390
- package/dist/src/composables/ref/useApiAsyncRef.d.ts +64 -12
- package/dist/src/composables/ref/useApiDelete.d.ts +10 -2
- package/dist/src/composables/ref/useApiGet.d.ts +10 -2
- package/dist/src/composables/ref/useApiManagementAsyncRef.d.ts +11 -4
- package/dist/src/composables/ref/useApiManagementRef.d.ts +5 -3
- package/dist/src/composables/ref/useApiPost.d.ts +10 -2
- package/dist/src/composables/ref/useApiPut.d.ts +10 -2
- package/dist/src/composables/ref/useApiRef.d.ts +65 -12
- package/dist/src/composables/ref/useApiRequest.d.ts +9 -2
- package/dist/src/functions/dxtFunctionalPlugin.d.ts +6 -1
- package/dist/src/functions/ref/getApiErrorRef.d.ts +10 -0
- package/dist/src/library.d.ts +1 -0
- package/dist/src/types/apiTypes.d.ts +5 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.11.13] - 2026-05-18
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **Error Handlers Integration**: Added `errorHandlers` option (of type `ErrorCenterHandlerList`) to `FunctionalPluginOptions` for registering custom global error handlers via `ErrorCenter.addHandlerList` during plugin installation.
|
|
9
|
+
- **Unit Tests**: Added comprehensive test cases verifying correct registration of error handlers during plugin installation.
|
|
10
|
+
|
|
11
|
+
### Changed / Improved
|
|
12
|
+
- **Documentation**: Extensively updated the plugin documentation in three languages (English, Russian, Vietnamese) to cover the new `errorCauses` and `errorHandlers` parameters and describe their integration with the `ErrorCenter`.
|
|
13
|
+
|
|
14
|
+
## [1.11.12] - 2026-05-17
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
- **getApiErrorRef**: Added a new helper function for reactive extraction of error objects (`ApiErrorItem`) from API response data, simplifying error handling in components.
|
|
18
|
+
|
|
19
|
+
### Changed / Improved
|
|
20
|
+
- **API Composables Refactoring**: Refactored `useApiRequest`, `useApiRef`, and all HTTP method-specific composables (`useApiGet`, `useApiPost`, `useApiPut`, `useApiDelete`) to support the new `ErrorCenter` and `ApiErrorStorage` contracts.
|
|
21
|
+
- **Documentation**: Substantially expanded bilingual (EN/RU) JSDoc documentation for all API composables. Added detailed examples for validating response contracts using `@effect/schema` (`validateResponseContract`) and managing potential request errors via `errorContract` (`ApiErrorStorageList`).
|
|
22
|
+
- **Tests**: Significantly expanded test coverage with new comprehensive unit tests for `useApiGet`, `useApiPost`, `useApiPut`, and `useApiDelete`.
|
|
23
|
+
|
|
5
24
|
## [1.11.11] - 2026-05-14
|
|
6
25
|
|
|
7
26
|
### Added
|
package/ai-description.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
This library
|
|
1
|
+
This library is a low-level framework for Vue 3 component architecture and reactive state management, extending the @dxtmisha/functional-basic suite with Vue-specific reactive bindings. Its core purpose is to provide a standardized "Constructor" pattern for building UI components and a comprehensive set of composables for API orchestration, localization, and data list management.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The library is indispensable for implementing class-based component logic via DesignConstructorAbstract to decouple business logic from templates. An AI should study its API when handling: 1) Complex API management requiring integrated CRUD operations, SSR pre-fetching, response contract validation, and skeleton state handling (useApiManagementRef); 2) Advanced reactive list manipulation including hierarchical data, multi-selection, and search highlighting (ListDataRef, useSearchRef); 3) Internationalization and localization of dates, numbers, and currencies using reactive Intl wrappers (GeoIntlRef, DatetimeRef); 4) SEO meta tag management with automatic DOM synchronization and SSR support (useMeta); or 5) Managed singletons and shared state across component sub-trees (executeUse, executeUseProvide).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
It integrates directly with the Vue 3 Reactivity API, Vue Router, and the @dxtmisha/functional-basic core. It provides infrastructure for design systems to manage component modifications, style/class injection, and reactive persistence via cookies, local storage, and broadcast channels.
|
package/ai-doc.ru.txt
CHANGED
|
@@ -32,3 +32,14 @@
|
|
|
32
32
|
});
|
|
33
33
|
```
|
|
34
34
|
5. В самом Vue-компоненте просто импортируйте и вызывайте созданный синглтон-хук: `const { list, loading, sendPost } = useUserManagement();`
|
|
35
|
+
|
|
36
|
+
ВЫБОР СТРАТЕГИИ executeUse:
|
|
37
|
+
1. `executeUseLocal` (ПРЕДПОЧТИТЕЛЬНО):
|
|
38
|
+
- Когда использовать: Для большинства API-запросов и сервисов.
|
|
39
|
+
- Особенности: Работает «лениво» (lazy) — инициализируется только в момент первого вызова. Экземпляр сохраняется до конца сессии. Это позволяет не перегружать старт приложения лишними запросами.
|
|
40
|
+
2. `executeUseGlobal`:
|
|
41
|
+
- Когда использовать: Когда данные или сервис должны быть загружены/инициализированы СРАЗУ при старте приложения (например: критические настройки, SDK).
|
|
42
|
+
- Особенности: Создает один экземпляр на всё приложение. Все глобальные синглтоны инициализируются принудительно через `executeUseGlobalInit()`.
|
|
43
|
+
3. `executeUseProvide`:
|
|
44
|
+
- Когда использовать: Для состояния, разделяемого между родителем и группой дочерних компонентов (например: табы, сложные формы с подкомпонентами).
|
|
45
|
+
- Особенности: Использует provide/inject. Первый компонент в дереве, вызвавший хук, становится «провайдером», остальные — потребителями.
|
package/ai-doc.txt
CHANGED
|
@@ -32,3 +32,14 @@ Strictly follow these rules for their application:
|
|
|
32
32
|
});
|
|
33
33
|
```
|
|
34
34
|
5. Within the Vue component itself, simply import and call your custom singleton composable: `const { list, loading, sendPost } = useUserManagement();`
|
|
35
|
+
|
|
36
|
+
CHOOSING THE executeUse STRATEGY:
|
|
37
|
+
1. `executeUseLocal` (PREFERRED):
|
|
38
|
+
- When to use: For most API requests and services.
|
|
39
|
+
- Key Features: Works "lazily" (lazy initialization) — initializes only when first called. The instance persists until the end of the session. This prevents overloading the application start with unnecessary requests.
|
|
40
|
+
2. `executeUseGlobal`:
|
|
41
|
+
- When to use: When data or a service must be loaded/initialized IMMEDIATELY at application start (e.g., critical settings, SDKs).
|
|
42
|
+
- Key Features: Creates a single instance for the entire application. All global singletons are forcibly initialized via `executeUseGlobalInit()`.
|
|
43
|
+
3. `executeUseProvide`:
|
|
44
|
+
- When to use: For state shared between a parent and a group of child components (e.g., tabs, complex forms with sub-components).
|
|
45
|
+
- Key Features: Uses provide/inject. The first component in the tree that calls the hook becomes the "provider", others become consumers.
|