@dxtmisha/functional 1.11.13 → 1.12.1
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 +21 -0
- package/ai-description.txt +3 -3
- package/ai-types.txt +279 -430
- package/dist/library.js +58 -25
- package/dist/src/classes/ref/GeoFlagRef.d.ts +4 -4
- package/dist/src/composables/ref/useApiDelete.d.ts +11 -16
- package/dist/src/composables/ref/useApiGet.d.ts +11 -16
- package/dist/src/composables/ref/useApiPost.d.ts +11 -16
- package/dist/src/composables/ref/useApiPut.d.ts +11 -16
- package/dist/src/composables/ref/useApiRequest.d.ts +85 -15
- package/dist/src/types/apiTypes.d.ts +5 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.12.1] - 2026-05-21
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- **`GeoFlagRef`**: Methods `get()`, `getFlag()`, `getList()`, and `getNational()` now accept `RefOrNormal<...>` reactive arguments instead of plain values. Parameters are unwrapped internally via `getRef()`, enabling reactive bindings to be passed directly without manual `.value` access.
|
|
9
|
+
|
|
10
|
+
## [1.12.0] - 2026-05-19
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **`UseApiRequestSetup` interface**: Introduced a new exported interface that centralises all configuration for `useApiRequest` into a single typed options object (`path`, `method`, `action`, `transformation`, `validateRequestContract`, `validateResponseContract`, `errorContract`).
|
|
14
|
+
- **`validateRequestContract`**: Added to both `UseApiRequestSetup` and `ApiManagementRequest` — a validation function that verifies the outgoing request payload matches the expected structure before the request is sent.
|
|
15
|
+
- **`validateResponseContract`**: Added to both `UseApiRequestSetup` and `ApiManagementRequest` — a validation function (recommended for use with `@effect/schema`) that verifies the API response matches the expected structure and returns an `ApiDataValidation` result.
|
|
16
|
+
- **`isApiSuccess` import**: Integrated `isApiSuccess` from `@dxtmisha/functional-basic` into `useApiRequest` for internal contract-validation branching.
|
|
17
|
+
|
|
18
|
+
### Changed / Improved
|
|
19
|
+
- **`useApiRequest` (Breaking)**: Refactored to accept a single `UseApiRequestSetup<T>` options object instead of multiple positional parameters. All call sites must be updated.
|
|
20
|
+
- **`useApiGet`, `useApiPost`, `useApiPut`, `useApiDelete`**: Updated to accept their own dedicated setup objects aligned with the new `UseApiRequestSetup` signature, forwarding `validateRequestContract` and `validateResponseContract` down the chain.
|
|
21
|
+
- **`useApiManagementRef`**: Refactored to forward the new `validateRequestContract` and `validateResponseContract` properties when constructing request setup objects.
|
|
22
|
+
- **`ApiManagementRequest` type**: Extended with a `Request` generic parameter and the two new contract-validation fields.
|
|
23
|
+
- **Tests**: Updated all unit test suites (`useApiRequest`, `useApiGet`, `useApiPost`, `useApiPut`, `useApiDelete`) to follow the new single-object signature and correctly mock `getStatus`.
|
|
24
|
+
- **Documentation**: Updated multilingual MDX docs (EN / RU / VI) for `useApiRequest`, `useApiGet`, `useApiPost`, `useApiPut`, `useApiDelete`, and `useApiManagementRef` to reflect the refactored API.
|
|
25
|
+
|
|
5
26
|
## [1.11.13] - 2026-05-18
|
|
6
27
|
|
|
7
28
|
### Added
|
package/ai-description.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
This library is a
|
|
1
|
+
This library is a technical SDK for Vue 3 that facilitates the construction of design systems and complex application states through reactive abstractions. Its primary function is to provide a standardized architecture for API orchestration, design component construction, and reactive utility management. It extends low-level logic from @dxtmisha/functional-basic into the Vue reactivity ecosystem.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Study this library when implementing robust API integration layers that require built-in SSR support, response contract validation, and automated mutation handling (POST/PUT/DELETE). It is indispensable for developing design systems that need base classes for tracking property changes and rendering dynamic component trees. Use its API for reactive localization (i18n), geographic data handling, SEO meta tag synchronization, and implementing singleton service patterns via provide/inject or global scopes.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The library integrates deeply with the Vue 3 composition API and vue-router. It operates as a Vue plugin, managing global services for icons, translations, and error handling. It bridges the gap between pure functional utilities and reactive UI requirements, specifically targeting environments where SSR consistency and strict data validation are priorities.
|