@dxtmisha/functional 1.12.0 → 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 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/dist/library.js CHANGED
@@ -341,19 +341,19 @@ var Oe = class {
341
341
  return this.code;
342
342
  }
343
343
  get(e = this.code.value) {
344
- return I(() => this.flag.get(e));
344
+ return I(() => this.flag.get(U(e)));
345
345
  }
346
346
  getFlag(e = this.code.value) {
347
347
  return I(() => {
348
348
  var t;
349
- return (t = this.flag.get(e)) == null ? void 0 : t.icon;
349
+ return (t = this.flag.get(U(e))) == null ? void 0 : t.icon;
350
350
  });
351
351
  }
352
352
  getList(e) {
353
- return I(() => this.flag.getList(e));
353
+ return I(() => this.flag.getList(U(e)));
354
354
  }
355
355
  getNational(e) {
356
- return I(() => this.flag.getNational(e));
356
+ return I(() => this.flag.getNational(U(e)));
357
357
  }
358
358
  }, J, Y = class {
359
359
  static get() {
@@ -26,26 +26,26 @@ export declare class GeoFlagRef {
26
26
  * Возвращает информацию о стране и её флаге.
27
27
  * @param code country code/ код страны
28
28
  */
29
- get(code?: string): ComputedRef<GeoFlagItem | undefined>;
29
+ get(code?: RefOrNormal<string>): ComputedRef<GeoFlagItem | undefined>;
30
30
  /**
31
31
  * Getting a link to the flag.
32
32
  *
33
33
  * Получение ссылки на флаг.
34
34
  * @param code country code/ код страны
35
35
  */
36
- getFlag(code?: string): ComputedRef<string | undefined>;
36
+ getFlag(code?: RefOrNormal<string>): ComputedRef<string | undefined>;
37
37
  /**
38
38
  * Getting a list of countries by an array of codes.
39
39
  *
40
40
  * Получение списка стран по массиву с кодами.
41
41
  * @param codes country code/ код страны
42
42
  */
43
- getList(codes?: string[]): ComputedRef<GeoFlagItem[]>;
43
+ getList(codes?: RefOrNormal<string[] | undefined>): ComputedRef<GeoFlagItem[]>;
44
44
  /**
45
45
  * Getting a list of countries by an array of codes in national language.
46
46
  *
47
47
  * Получение списка стран по массиву с кодами на национальный язык.
48
48
  * @param codes country code/ код страны.
49
49
  */
50
- getNational(codes?: string[]): ComputedRef<GeoFlagNational[]>;
50
+ getNational(codes?: RefOrNormal<string[] | undefined>): ComputedRef<GeoFlagNational[]>;
51
51
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dxtmisha/functional",
3
3
  "private": false,
4
- "version": "1.12.0",
4
+ "version": "1.12.1",
5
5
  "type": "module",
6
6
  "description": "A comprehensive library of utilities, base classes, and Vue 3 composables for reactive web development. Extends @dxtmisha/functional-basic with Composition API.",
7
7
  "keywords": [