@matreshka/bff 0.25.0 → 0.25.3

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.
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FileUploadArea = void 0;
4
4
  exports.fileUploadArea = fileUploadArea;
5
5
  const server_component_class_1 = require("@matreshka/shared/enums/server-component-class");
6
- const v4_1 = require("zod/v4");
6
+ const zod_1 = require("zod");
7
7
  const core_1 = require("../core");
8
8
  const component_1 = require("./component");
9
9
  function fileUploadArea(arg0, arg1) {
@@ -23,13 +23,13 @@ class FileUploadArea extends component_1.Component {
23
23
  super(config);
24
24
  this.uploadMap = new Map();
25
25
  this.onInteraction("start", ({ payload }) => {
26
- const schema = v4_1.z.strictObject({
27
- id: v4_1.z.string(),
28
- type: v4_1.z.string(),
29
- size: v4_1.z.number(),
30
- name: v4_1.z.string(),
31
- lastModified: v4_1.z.number(),
32
- url: v4_1.z.string().refine((val) => val.startsWith("blob:"), {
26
+ const schema = zod_1.z.strictObject({
27
+ id: zod_1.z.string(),
28
+ type: zod_1.z.string(),
29
+ size: zod_1.z.number(),
30
+ name: zod_1.z.string(),
31
+ lastModified: zod_1.z.number(),
32
+ url: zod_1.z.string().refine((val) => val.startsWith("blob:"), {
33
33
  message: "url must be a blob",
34
34
  }),
35
35
  });
@@ -38,10 +38,10 @@ class FileUploadArea extends component_1.Component {
38
38
  this.config.onStart?.(safePayload);
39
39
  });
40
40
  this.onInteraction("progress", ({ payload }) => {
41
- const schema = v4_1.z
41
+ const schema = zod_1.z
42
42
  .strictObject({
43
- id: v4_1.z.string(),
44
- progress: v4_1.z.number().min(0).max(100),
43
+ id: zod_1.z.string(),
44
+ progress: zod_1.z.number().min(0).max(100),
45
45
  })
46
46
  .refine((data) => this.uploadMap.has(data.id), {
47
47
  message: "Unknown upload id",
@@ -54,10 +54,10 @@ class FileUploadArea extends component_1.Component {
54
54
  });
55
55
  });
56
56
  this.onInteraction("complete", ({ payload }) => {
57
- const schema = v4_1.z
57
+ const schema = zod_1.z
58
58
  .strictObject({
59
- id: v4_1.z.string(),
60
- response: v4_1.z.unknown(),
59
+ id: zod_1.z.string(),
60
+ response: zod_1.z.unknown(),
61
61
  })
62
62
  .refine((data) => this.uploadMap.has(data.id), {
63
63
  message: "Unknown upload id",
@@ -70,11 +70,11 @@ class FileUploadArea extends component_1.Component {
70
70
  });
71
71
  });
72
72
  this.onInteraction("error", ({ payload }) => {
73
- const schema = v4_1.z
73
+ const schema = zod_1.z
74
74
  .strictObject({
75
- id: v4_1.z.string(),
76
- response: v4_1.z.unknown(),
77
- code: v4_1.z.number(), // Не StatusCode, потому что может быть 0, который не содержится в словаре
75
+ id: zod_1.z.string(),
76
+ response: zod_1.z.unknown(),
77
+ code: zod_1.z.number(), // Не StatusCode, потому что может быть 0, который не содержится в словаре
78
78
  })
79
79
  .refine((data) => this.uploadMap.has(data.id), {
80
80
  message: "Unknown upload id",
@@ -4,7 +4,7 @@ exports.ForEach = exports.forEach = void 0;
4
4
  const server_component_class_1 = require("@matreshka/shared/enums/server-component-class");
5
5
  const for_each_sync_components_message_1 = require("@matreshka/shared/messages/bff-to-client/components/for-each/for-each-sync-components-message");
6
6
  const rxjs_1 = require("rxjs");
7
- const v4_1 = require("zod/v4");
7
+ const zod_1 = require("zod");
8
8
  const core_1 = require("../core");
9
9
  const serialize_component_tree_1 = require("../core/utils/serialize-component-tree");
10
10
  const track_created_instances_1 = require("../core/utils/track-created-instances");
@@ -47,7 +47,7 @@ class ForEachContext extends core_1.Context {
47
47
  super({
48
48
  data: async () => ({}),
49
49
  preload: preload,
50
- schema: v4_1.z.strictObject({}), // Запрет изменения из внешних источников
50
+ schema: zod_1.z.strictObject({}), // Запрет изменения из внешних источников
51
51
  });
52
52
  }
53
53
  }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ItemListIndexStore = void 0;
4
4
  const rxjs_1 = require("rxjs");
5
- const v4_1 = require("zod/v4");
5
+ const zod_1 = require("zod");
6
6
  const core_1 = require("../../core");
7
7
  /** Контекст индексов элементов ItemList; данные не загружаются снаружи. */
8
8
  class ItemListIndexStore extends core_1.Context {
@@ -22,7 +22,7 @@ class ItemListIndexStore extends core_1.Context {
22
22
  super({
23
23
  data: async () => ({}),
24
24
  preload,
25
- schema: v4_1.z.strictObject({}),
25
+ schema: zod_1.z.strictObject({}),
26
26
  });
27
27
  }
28
28
  }
@@ -1,7 +1,7 @@
1
1
  import { WebMcpToolAnnotation } from "@matreshka/shared/enums/web-mcp-tool-annotation";
2
2
  import type { Condition as SerializedCondition } from "@matreshka/shared/types/condition";
3
3
  import type { WebMcpToolConfig } from "@matreshka/shared/types/web-mcp-tool-config";
4
- import { z } from "zod/v4";
4
+ import { z } from "zod";
5
5
  import type { Client } from "../../core/client";
6
6
  import { Condition } from "../../core/conditions/condition";
7
7
  export { WebMcpToolAnnotation };
@@ -44,12 +44,15 @@ const web_mcp_tool_error_message_1 = require("@matreshka/shared/messages/bff-to-
44
44
  const web_mcp_tool_result_message_1 = require("@matreshka/shared/messages/bff-to-client/webmcp/web-mcp-tool-result-message");
45
45
  const crypto = __importStar(require("node:crypto"));
46
46
  const zod_1 = require("zod");
47
- const v4_1 = require("zod/v4");
47
+ /** MCP: латиница, цифры, `-`, `_` (после trim). */
48
+ const WEB_MCP_TOOL_NAME_PATTERN = /^[A-Za-z0-9_-]+$/;
48
49
  const webMcpToolSchema = zod_1.z.object({
49
- name: zod_1.z.string().trim().min(1),
50
+ name: zod_1.z.string().trim().min(1).regex(WEB_MCP_TOOL_NAME_PATTERN, {
51
+ message: "Tool name must contain only Latin letters, digits, hyphens (-), and underscores (_)",
52
+ }),
50
53
  description: zod_1.z.string().trim().min(1),
51
54
  annotations: zod_1.z
52
- .array(zod_1.z.custom(() => true))
55
+ .array(zod_1.z.enum(web_mcp_tool_annotation_1.WebMcpToolAnnotation))
53
56
  .refine((items) => new Set(items).size === items.length, {
54
57
  message: "Annotations must be unique",
55
58
  })
@@ -106,7 +109,7 @@ function resolveWebMcpToolConditions(conditions) {
106
109
  return list.map((condition) => condition.toJSON());
107
110
  }
108
111
  function webMcpInputJsonSchema(schema) {
109
- return v4_1.z.toJSONSchema(schema);
112
+ return zod_1.z.toJSONSchema(schema);
110
113
  }
111
114
  /** Проверяет input, вызывает execute и отвечает клиенту результатом или ошибкой. */
112
115
  async function dispatchWebMcpToolCall(client, tool, callId, input) {
@@ -7,7 +7,7 @@ import { AnyBffToClientMessage, BffToClientMessage } from "@matreshka/shared/mes
7
7
  import { AnyClientToBffMessage } from "@matreshka/shared/messages/client-to-bff/client-to-bff-message";
8
8
  import { ClientState } from "@matreshka/shared/types/client-state";
9
9
  import { BehaviorSubject, Observable, Subject } from "rxjs";
10
- import { z } from "zod/v4";
10
+ import { z } from "zod";
11
11
  import { Page } from "../components";
12
12
  import { App } from "../components/app";
13
13
  import { ClientStorage } from "./client-storage";
@@ -102,7 +102,8 @@ export declare class Client {
102
102
  */
103
103
  newMessage(messageString: string): void;
104
104
  /**
105
- * Переход на другую страницу: снимает обработчики с предыдущей страницы и запоминает id новой.
105
+ * Переход на другую страницу: запоминает id новой страницы.
106
+ * Предыдущий page instance снимается по interaction `leave` с клиента (см. EntryComponent.emitInteraction).
106
107
  */
107
108
  switchPage(newPageInstance: ComponentInstance<Page>): void;
108
109
  /**
@@ -12,7 +12,7 @@ const message_received_message_2 = require("@matreshka/shared/messages/client-to
12
12
  const parse_client_to_bff_message_1 = require("@matreshka/shared/messages/client-to-bff/parse-client-to-bff-message");
13
13
  const reliable_delivery_1 = require("@matreshka/shared/messages/reliable-delivery");
14
14
  const rxjs_1 = require("rxjs");
15
- const v4_1 = require("zod/v4");
15
+ const zod_1 = require("zod");
16
16
  const app_1 = require("../components/app");
17
17
  const component_1 = require("../components/component");
18
18
  const client_context_1 = require("./client-context");
@@ -36,22 +36,22 @@ const resolveDeviceTypeFromUserAgent = shared_1.getDeviceTypeFromUserAgent;
36
36
  * @property platform.id Идентификатор платформы.
37
37
  * @property platform.payload Дополнительные данные о платформе.
38
38
  */
39
- exports.ClientHandshakePayloadSchema = v4_1.z.strictObject({
40
- applicationId: v4_1.z.string(),
39
+ exports.ClientHandshakePayloadSchema = zod_1.z.strictObject({
40
+ applicationId: zod_1.z.string(),
41
41
  });
42
- exports.ClientStateSchema = v4_1.z.strictObject({
43
- route: v4_1.z.strictObject({
44
- visitedAt: v4_1.z.number(),
45
- path: v4_1.z.string(),
46
- query: v4_1.z.record(v4_1.z.string(), v4_1.z.string()),
42
+ exports.ClientStateSchema = zod_1.z.strictObject({
43
+ route: zod_1.z.strictObject({
44
+ visitedAt: zod_1.z.number(),
45
+ path: zod_1.z.string(),
46
+ query: zod_1.z.record(zod_1.z.string(), zod_1.z.string()),
47
47
  }),
48
- storage: v4_1.z.record(v4_1.z.string(), v4_1.z.string()),
49
- language: v4_1.z.string(),
50
- userAgent: v4_1.z.string(),
51
- prefersColorScheme: v4_1.z.literal(["light", "dark", "system"]),
52
- platform: v4_1.z.strictObject({
53
- id: v4_1.z.enum(platform_id_1.PlatformId),
54
- payload: v4_1.z.unknown(),
48
+ storage: zod_1.z.record(zod_1.z.string(), zod_1.z.string()),
49
+ language: zod_1.z.string(),
50
+ userAgent: zod_1.z.string(),
51
+ prefersColorScheme: zod_1.z.literal(["light", "dark", "system"]),
52
+ platform: zod_1.z.strictObject({
53
+ id: zod_1.z.enum(platform_id_1.PlatformId),
54
+ payload: zod_1.z.unknown(),
55
55
  }),
56
56
  });
57
57
  class Client {
@@ -174,13 +174,13 @@ class Client {
174
174
  */
175
175
  newMessage(messageString) {
176
176
  try {
177
- const abstractMessageSchema = v4_1.z.object({
178
- type: v4_1.z.string(),
179
- payload: v4_1.z.unknown().optional(),
180
- target: v4_1.z.string().optional(),
181
- id: v4_1.z.string().optional(),
182
- attempt: v4_1.z.number().int().positive().optional(),
183
- handlers: v4_1.z.array(v4_1.z.number().int().nonnegative()).optional(),
177
+ const abstractMessageSchema = zod_1.z.object({
178
+ type: zod_1.z.string(),
179
+ payload: zod_1.z.unknown().optional(),
180
+ target: zod_1.z.string().optional(),
181
+ id: zod_1.z.string().optional(),
182
+ attempt: zod_1.z.number().int().positive().optional(),
183
+ handlers: zod_1.z.array(zod_1.z.number().int().nonnegative()).optional(),
184
184
  });
185
185
  const message = abstractMessageSchema.parse(JSON.parse(messageString));
186
186
  (0, client_context_1.runWithClient)(this, () => {
@@ -195,13 +195,10 @@ class Client {
195
195
  }
196
196
  }
197
197
  /**
198
- * Переход на другую страницу: снимает обработчики с предыдущей страницы и запоминает id новой.
198
+ * Переход на другую страницу: запоминает id новой страницы.
199
+ * Предыдущий page instance снимается по interaction `leave` с клиента (см. EntryComponent.emitInteraction).
199
200
  */
200
201
  switchPage(newPageInstance) {
201
- // Вообще эта логика не обязательна, т.к. releaseInstances вызывается при получении leave interaction, это скорее защита от недобросовестных клиентов чтобы не копились лишние обработчики в памяти
202
- this.currentPageInstance?.component.releaseInstances([
203
- this.currentPageInstance,
204
- ]);
205
202
  this.currentPageInstance = newPageInstance;
206
203
  }
207
204
  /**
@@ -1,7 +1,7 @@
1
1
  import { JsonObject } from "@matreshka/shared/types/json";
2
2
  import { BehaviorSubject, Observable } from "rxjs";
3
3
  import { Paths, PathValue } from "ts-essentials";
4
- import { ZodObject } from "zod/v4";
4
+ import { ZodObject } from "zod";
5
5
  import { ActionConfig } from "../actions/action";
6
6
  import { LocalContextPathPatch } from "../actions/set-context";
7
7
  import type { Client } from "../client";
@@ -6,7 +6,7 @@ const index_2 = require("@matreshka/shared/messages/client-to-bff/context/index"
6
6
  const targeted_message_1 = require("@matreshka/shared/messages/targeted-message");
7
7
  const fetch_from_object_1 = require("@matreshka/shared/utils/fetch-from-object");
8
8
  const rxjs_1 = require("rxjs");
9
- const v4_1 = require("zod/v4");
9
+ const zod_1 = require("zod");
10
10
  const dec_context_value_1 = require("../actions/dec-context-value");
11
11
  const inc_context_value_1 = require("../actions/inc-context-value");
12
12
  const set_context_1 = require("../actions/set-context");
@@ -215,7 +215,7 @@ class Context {
215
215
  return;
216
216
  }
217
217
  if (unsafeMessage instanceof index_2.ContextValuesMessage) {
218
- const payloadSchema = v4_1.z.array(v4_1.z.strictObject({ key: v4_1.z.string(), value: v4_1.z.unknown() }));
218
+ const payloadSchema = zod_1.z.array(zod_1.z.strictObject({ key: zod_1.z.string(), value: zod_1.z.unknown() }));
219
219
  const changes = payloadSchema.parse(unsafeMessage.payload);
220
220
  const patch = {};
221
221
  changes.forEach((change) => {
@@ -1,2 +1,2 @@
1
- import { z } from "zod/v4";
1
+ import { z } from "zod";
2
2
  export declare function zodDeepPick(schema: z.ZodTypeAny, propertyPath: string): z.ZodTypeAny;
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.zodDeepPick = zodDeepPick;
4
- const v4_1 = require("zod/v4");
4
+ const zod_1 = require("zod");
5
5
  function isZodObject(schema) {
6
- return schema instanceof v4_1.z.ZodObject;
6
+ return schema instanceof zod_1.z.ZodObject;
7
7
  }
8
8
  function isZodArray(schema) {
9
- return schema instanceof v4_1.z.ZodArray;
9
+ return schema instanceof zod_1.z.ZodArray;
10
10
  }
11
11
  function pickObject(schema, path) {
12
12
  if (!isZodObject(schema))
@@ -6,10 +6,10 @@ const action_completed_message_1 = require("@matreshka/shared/messages/client-to
6
6
  const error_message_1 = require("@matreshka/shared/messages/client-to-bff/error-message");
7
7
  const targeted_message_1 = require("@matreshka/shared/messages/targeted-message");
8
8
  const rxjs_1 = require("rxjs");
9
- const v4_1 = require("zod/v4");
9
+ const zod_1 = require("zod");
10
10
  const incoming_message_observer_1 = require("./incoming-message-observer");
11
- const errorMessagePayloadSchema = v4_1.z.strictObject({
12
- message: v4_1.z.string(),
11
+ const errorMessagePayloadSchema = zod_1.z.strictObject({
12
+ message: zod_1.z.string(),
13
13
  });
14
14
  function createTargetedActionScope(prefix) {
15
15
  return prefix + crypto.randomUUID();
@@ -14,16 +14,16 @@ const browser_get_geolocation_success_message_1 = require("@matreshka/shared/mes
14
14
  const browser_request_push_notifications_action_granted_message_1 = require("@matreshka/shared/messages/client-to-bff/platforms/browser/browser-request-push-notifications-action-granted-message");
15
15
  const platform_webauthn_create_credential_success_message_1 = require("@matreshka/shared/messages/client-to-bff/platforms/platform-webauthn-create-credential-success-message");
16
16
  const platform_webauthn_get_credential_success_message_1 = require("@matreshka/shared/messages/client-to-bff/platforms/platform-webauthn-get-credential-success-message");
17
- const v4_1 = require("zod/v4");
17
+ const zod_1 = require("zod");
18
18
  const targeted_client_platform_action_1 = require("./utils/targeted-client-platform-action");
19
19
  const web_platform_1 = require("./web-platform");
20
- const pushSubscriptionGrantedMessageSchema = v4_1.z.strictObject({
21
- subscription: v4_1.z.strictObject({
22
- endpoint: v4_1.z.string(),
23
- expirationTime: v4_1.z.number().nullable().optional(),
24
- keys: v4_1.z.strictObject({
25
- auth: v4_1.z.string(),
26
- p256dh: v4_1.z.string(),
20
+ const pushSubscriptionGrantedMessageSchema = zod_1.z.strictObject({
21
+ subscription: zod_1.z.strictObject({
22
+ endpoint: zod_1.z.string(),
23
+ expirationTime: zod_1.z.number().nullable().optional(),
24
+ keys: zod_1.z.strictObject({
25
+ auth: zod_1.z.string(),
26
+ p256dh: zod_1.z.string(),
27
27
  }),
28
28
  }),
29
29
  });
@@ -42,10 +42,10 @@ class BrowserPlatform extends web_platform_1.WebPlatform {
42
42
  outgoingMessage: (scope) => new browser_get_geolocation_message_1.BrowserGetGeolocationMessage(scope),
43
43
  parseSuccess: (unsafeMessage) => {
44
44
  if (unsafeMessage instanceof browser_get_geolocation_success_message_1.BrowserGetGeolocationSuccessMessage) {
45
- return v4_1.z
45
+ return zod_1.z
46
46
  .strictObject({
47
- latitude: v4_1.z.number(),
48
- longitude: v4_1.z.number(),
47
+ latitude: zod_1.z.number(),
48
+ longitude: zod_1.z.number(),
49
49
  })
50
50
  .parse(unsafeMessage.payload);
51
51
  }
@@ -159,10 +159,10 @@ class BrowserPlatform extends web_platform_1.WebPlatform {
159
159
  }
160
160
  }
161
161
  exports.BrowserPlatform = BrowserPlatform;
162
- const webAuthnJsonObjectSchema = v4_1.z.record(v4_1.z.string(), v4_1.z.unknown());
163
- const webAuthnRegistrationResponseSchema = v4_1.z.strictObject({
162
+ const webAuthnJsonObjectSchema = zod_1.z.record(zod_1.z.string(), zod_1.z.unknown());
163
+ const webAuthnRegistrationResponseSchema = zod_1.z.strictObject({
164
164
  credentialJSON: webAuthnJsonObjectSchema,
165
165
  });
166
- const webAuthnAuthenticationResponseSchema = v4_1.z.strictObject({
166
+ const webAuthnAuthenticationResponseSchema = zod_1.z.strictObject({
167
167
  credentialJSON: webAuthnJsonObjectSchema,
168
168
  });
@@ -1,5 +1,5 @@
1
1
  import type { Observable } from "rxjs";
2
- import { z } from "zod/v4";
2
+ import { z } from "zod";
3
3
  import { WebPlatform } from "./web-platform";
4
4
  /**
5
5
  * Входящее сообщение с данными пользователя после успешного запроса контакта.
@@ -7,14 +7,14 @@ exports.MaxMiniAppPlatform = void 0;
7
7
  const max_mini_app_request_contact_message_1 = require("@matreshka/shared/messages/bff-to-client/platforms/max-mini-app/max-mini-app-request-contact-message");
8
8
  const max_mini_app_request_contact_action_success_message_1 = require("@matreshka/shared/messages/client-to-bff/platforms/max-mini-app/max-mini-app-request-contact-action-success-message");
9
9
  const crypto_1 = __importDefault(require("crypto"));
10
- const v4_1 = require("zod/v4");
10
+ const zod_1 = require("zod");
11
11
  const targeted_client_platform_action_1 = require("./utils/targeted-client-platform-action");
12
12
  const web_platform_1 = require("./web-platform");
13
13
  /**
14
14
  * Входящее сообщение с данными пользователя после успешного запроса контакта.
15
15
  */
16
- const requestContactSuccessMessageSchema = v4_1.z.strictObject({
17
- phone: v4_1.z.string(),
16
+ const requestContactSuccessMessageSchema = zod_1.z.strictObject({
17
+ phone: zod_1.z.string(),
18
18
  });
19
19
  /**
20
20
  * Платформа для Max Mini App.
@@ -1,6 +1,6 @@
1
1
  import type { MobileBleService } from "@matreshka/shared/types/mobile-ble-services";
2
2
  import { Observable, Subject } from "rxjs";
3
- import { z } from "zod/v4";
3
+ import { z } from "zod";
4
4
  import { Client } from "../core";
5
5
  import { ClientPlatform } from "./client-platform";
6
6
  /**
@@ -22,7 +22,7 @@ const mobile_get_geolocation_success_message_1 = require("@matreshka/shared/mess
22
22
  const mobile_request_push_notifications_action_granted_message_1 = require("@matreshka/shared/messages/client-to-bff/platforms/mobile/mobile-request-push-notifications-action-granted-message");
23
23
  const targeted_message_1 = require("@matreshka/shared/messages/targeted-message");
24
24
  const rxjs_1 = require("rxjs");
25
- const v4_1 = require("zod/v4");
25
+ const zod_1 = require("zod");
26
26
  const incoming_message_observer_1 = require("../core/utils/incoming-message-observer");
27
27
  const client_platform_1 = require("./client-platform");
28
28
  const mobile_ble_services_1 = require("./utils/mobile-ble-services");
@@ -31,27 +31,27 @@ const targeted_client_platform_stream_1 = require("./utils/targeted-client-platf
31
31
  /**
32
32
  * Входящее сообщение, содержащее успешно полученный push-токен.
33
33
  */
34
- const pushTokenGrantedMessageSchema = v4_1.z.strictObject({
35
- token: v4_1.z.strictObject({
36
- value: v4_1.z.string(),
34
+ const pushTokenGrantedMessageSchema = zod_1.z.strictObject({
35
+ token: zod_1.z.strictObject({
36
+ value: zod_1.z.string(),
37
37
  }),
38
38
  });
39
39
  /**
40
40
  * Входящее сообщение с найденным устройством BLE
41
41
  */
42
- exports.bleScanResultSchema = v4_1.z.object({
42
+ exports.bleScanResultSchema = zod_1.z.object({
43
43
  // Не strictObject, потому что на андройде еще прилетает rawAdvertisement
44
44
  // https://github.com/capacitor-community/bluetooth-le?tab=readme-ov-file#scanresult
45
- device: v4_1.z.strictObject({
46
- name: v4_1.z.string().optional(),
47
- deviceId: v4_1.z.string(),
45
+ device: zod_1.z.strictObject({
46
+ name: zod_1.z.string().optional(),
47
+ deviceId: zod_1.z.string(),
48
48
  }),
49
- localName: v4_1.z.string().optional(),
50
- txPower: v4_1.z.number(),
51
- rssi: v4_1.z.number(),
52
- manufacturerData: v4_1.z.record(v4_1.z.string(), v4_1.z.unknown()).optional(),
53
- serviceData: v4_1.z.record(v4_1.z.string(), v4_1.z.unknown()).optional(),
54
- uuids: v4_1.z.array(v4_1.z.string()),
49
+ localName: zod_1.z.string().optional(),
50
+ txPower: zod_1.z.number(),
51
+ rssi: zod_1.z.number(),
52
+ manufacturerData: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
53
+ serviceData: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
54
+ uuids: zod_1.z.array(zod_1.z.string()),
55
55
  });
56
56
  /**
57
57
  * Абстрактная платформа, реализующая функции взаимодействия с нативной мобильной средой.
@@ -98,10 +98,10 @@ class MobilePlatform extends client_platform_1.ClientPlatform {
98
98
  outgoingMessage: (scope) => new mobile_get_geolocation_message_1.MobileGetGeolocationMessage(scope),
99
99
  parseSuccess: (unsafeMessage) => {
100
100
  if (unsafeMessage instanceof mobile_get_geolocation_success_message_1.MobileGetGeolocationSuccessMessage) {
101
- return v4_1.z
101
+ return zod_1.z
102
102
  .strictObject({
103
- latitude: v4_1.z.number(),
104
- longitude: v4_1.z.number(),
103
+ latitude: zod_1.z.number(),
104
+ longitude: zod_1.z.number(),
105
105
  })
106
106
  .parse(unsafeMessage.payload);
107
107
  }
@@ -207,9 +207,9 @@ class BLEDevice {
207
207
  }),
208
208
  parseSuccess: (unsafeMessage) => {
209
209
  if (unsafeMessage instanceof mobile_ble_value_message_1.MobileBleValueMessage) {
210
- const payload = v4_1.z
210
+ const payload = zod_1.z
211
211
  .strictObject({
212
- value: v4_1.z.number(),
212
+ value: zod_1.z.number(),
213
213
  })
214
214
  .parse(unsafeMessage.payload);
215
215
  return payload.value;
@@ -222,7 +222,7 @@ class BLEDevice {
222
222
  outgoingMessage: (scope) => new mobile_get_ble_services_message_1.MobileGetBleServicesMessage(scope, { deviceId: this.id }),
223
223
  parseSuccess: (unsafeMessage) => {
224
224
  if (unsafeMessage instanceof mobile_ble_services_message_1.MobileBleServicesMessage) {
225
- const payload = v4_1.z
225
+ const payload = zod_1.z
226
226
  .strictObject({ services: mobile_ble_services_1.mobileBleServicesSchema })
227
227
  .parse(unsafeMessage.payload);
228
228
  return payload.services;
@@ -235,7 +235,7 @@ class BLEDevice {
235
235
  outgoingMessage: (scope) => new mobile_discover_ble_services_message_1.MobileDiscoverBleServicesMessage(scope, { deviceId: this.id }),
236
236
  parseSuccess: (unsafeMessage) => {
237
237
  if (unsafeMessage instanceof mobile_ble_services_message_1.MobileBleServicesMessage) {
238
- const payload = v4_1.z
238
+ const payload = zod_1.z
239
239
  .strictObject({ services: mobile_ble_services_1.mobileBleServicesSchema })
240
240
  .parse(unsafeMessage.payload);
241
241
  return payload.services;
@@ -13,7 +13,7 @@ const platform_show_native_picker_message_1 = require("@matreshka/shared/message
13
13
  const platform_enumerate_devices_success_message_1 = require("@matreshka/shared/messages/client-to-bff/platforms/platform-enumerate-devices-success-message");
14
14
  const web_mcp_tool_call_message_1 = require("@matreshka/shared/messages/client-to-bff/webmcp/web-mcp-tool-call-message");
15
15
  const rxjs_1 = require("rxjs");
16
- const v4_1 = require("zod/v4");
16
+ const zod_1 = require("zod");
17
17
  const web_mcp_tool_1 = require("../components/webmcp/web-mcp-tool");
18
18
  const core_1 = require("../core");
19
19
  const incoming_message_observer_1 = require("../core/utils/incoming-message-observer");
@@ -22,13 +22,13 @@ const client_back_platform_action_1 = require("./utils/client-back-platform-acti
22
22
  const client_navigate_platform_action_1 = require("./utils/client-navigate-platform-action");
23
23
  const client_reload_platform_action_1 = require("./utils/client-reload-platform-action");
24
24
  const targeted_client_platform_action_1 = require("./utils/targeted-client-platform-action");
25
- const enumeratedDeviceSchema = v4_1.z.strictObject({
26
- kind: v4_1.z.enum(["audioinput", "audiooutput", "videoinput"]),
27
- deviceId: v4_1.z.string(),
28
- groupId: v4_1.z.string(),
29
- label: v4_1.z.string().optional(),
30
- capabilities: v4_1.z.record(v4_1.z.string(), v4_1.z.unknown()).optional(),
31
- settings: v4_1.z.record(v4_1.z.string(), v4_1.z.unknown()).optional(),
25
+ const enumeratedDeviceSchema = zod_1.z.strictObject({
26
+ kind: zod_1.z.enum(["audioinput", "audiooutput", "videoinput"]),
27
+ deviceId: zod_1.z.string(),
28
+ groupId: zod_1.z.string(),
29
+ label: zod_1.z.string().optional(),
30
+ capabilities: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
31
+ settings: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
32
32
  });
33
33
  /**
34
34
  * Абстрактный класс платформы, управляющий клиентом и его состоянием.
@@ -206,9 +206,9 @@ class Platform {
206
206
  outgoingMessage: (scope) => new platform_enumerate_devices_message_1.PlatformEnumerateDevicesMessage(scope),
207
207
  parseSuccess: (unsafeMessage) => {
208
208
  if (unsafeMessage instanceof platform_enumerate_devices_success_message_1.PlatformEnumerateDevicesSuccessMessage) {
209
- const payload = v4_1.z
209
+ const payload = zod_1.z
210
210
  .strictObject({
211
- devices: v4_1.z.array(enumeratedDeviceSchema),
211
+ devices: zod_1.z.array(enumeratedDeviceSchema),
212
212
  })
213
213
  .parse(unsafeMessage.payload);
214
214
  return payload.devices.map((d) => toDeviceInstance(d));
@@ -1,5 +1,5 @@
1
1
  import type { Observable } from "rxjs";
2
- import { z } from "zod/v4";
2
+ import { z } from "zod";
3
3
  import { WebPlatform } from "./web-platform";
4
4
  /**
5
5
  * Входящее сообщение с данными пользователя после успешного запроса контакта.
@@ -12,28 +12,28 @@ const telegram_mini_app_get_geolocation_success_message_1 = require("@matreshka/
12
12
  const telegram_mini_app_request_contact_action_cancel_message_1 = require("@matreshka/shared/messages/client-to-bff/platforms/telegram-mini-app/telegram-mini-app-request-contact-action-cancel-message");
13
13
  const telegram_mini_app_request_contact_action_success_message_1 = require("@matreshka/shared/messages/client-to-bff/platforms/telegram-mini-app/telegram-mini-app-request-contact-action-success-message");
14
14
  const crypto_1 = __importDefault(require("crypto"));
15
- const v4_1 = require("zod/v4");
15
+ const zod_1 = require("zod");
16
16
  const targeted_client_platform_action_1 = require("./utils/targeted-client-platform-action");
17
17
  const web_platform_1 = require("./web-platform");
18
18
  /**
19
19
  * Входящее сообщение с данными пользователя после успешного запроса контакта.
20
20
  */
21
- const requestContactSuccessMessageSchema = v4_1.z.strictObject({
22
- phone_number: v4_1.z.string(),
23
- first_name: v4_1.z.string(),
24
- last_name: v4_1.z.string().optional(),
25
- user_id: v4_1.z.number(),
21
+ const requestContactSuccessMessageSchema = zod_1.z.strictObject({
22
+ phone_number: zod_1.z.string(),
23
+ first_name: zod_1.z.string(),
24
+ last_name: zod_1.z.string().optional(),
25
+ user_id: zod_1.z.number(),
26
26
  });
27
- const telegramGeolocationSuccessSchema = v4_1.z.strictObject({
28
- latitude: v4_1.z.number(),
29
- longitude: v4_1.z.number(),
30
- altitude: v4_1.z.number().nullable(),
31
- course: v4_1.z.number().nullable(),
32
- speed: v4_1.z.number().nullable(),
33
- horizontal_accuracy: v4_1.z.number().nullable(),
34
- vertical_accuracy: v4_1.z.number().nullable(),
35
- course_accuracy: v4_1.z.number().nullable(),
36
- speed_accuracy: v4_1.z.number().nullable(),
27
+ const telegramGeolocationSuccessSchema = zod_1.z.strictObject({
28
+ latitude: zod_1.z.number(),
29
+ longitude: zod_1.z.number(),
30
+ altitude: zod_1.z.number().nullable(),
31
+ course: zod_1.z.number().nullable(),
32
+ speed: zod_1.z.number().nullable(),
33
+ horizontal_accuracy: zod_1.z.number().nullable(),
34
+ vertical_accuracy: zod_1.z.number().nullable(),
35
+ course_accuracy: zod_1.z.number().nullable(),
36
+ speed_accuracy: zod_1.z.number().nullable(),
37
37
  });
38
38
  /**
39
39
  * Платформа для Telegram Mini App.
@@ -1,3 +1,3 @@
1
- import { z } from "zod/v4";
1
+ import { z } from "zod";
2
2
  import type { MobileBleService } from "@matreshka/shared/types/mobile-ble-services";
3
3
  export declare const mobileBleServicesSchema: z.ZodType<MobileBleService[]>;
@@ -1,30 +1,30 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.mobileBleServicesSchema = void 0;
4
- const v4_1 = require("zod/v4");
5
- exports.mobileBleServicesSchema = v4_1.z.array(v4_1.z
4
+ const zod_1 = require("zod");
5
+ exports.mobileBleServicesSchema = zod_1.z.array(zod_1.z
6
6
  .object({
7
- uuid: v4_1.z.string(),
8
- characteristics: v4_1.z.array(v4_1.z
7
+ uuid: zod_1.z.string(),
8
+ characteristics: zod_1.z.array(zod_1.z
9
9
  .object({
10
- uuid: v4_1.z.string(),
11
- properties: v4_1.z
10
+ uuid: zod_1.z.string(),
11
+ properties: zod_1.z
12
12
  .object({
13
- broadcast: v4_1.z.boolean().optional(),
14
- read: v4_1.z.boolean().optional(),
15
- writeWithoutResponse: v4_1.z.boolean().optional(),
16
- write: v4_1.z.boolean().optional(),
17
- notify: v4_1.z.boolean().optional(),
18
- indicate: v4_1.z.boolean().optional(),
19
- authenticatedSignedWrites: v4_1.z.boolean().optional(),
20
- reliableWrite: v4_1.z.boolean().optional(),
21
- writableAuxiliaries: v4_1.z.boolean().optional(),
22
- extendedProperties: v4_1.z.boolean().optional(),
23
- notifyEncryptionRequired: v4_1.z.boolean().optional(),
24
- indicateEncryptionRequired: v4_1.z.boolean().optional(),
13
+ broadcast: zod_1.z.boolean().optional(),
14
+ read: zod_1.z.boolean().optional(),
15
+ writeWithoutResponse: zod_1.z.boolean().optional(),
16
+ write: zod_1.z.boolean().optional(),
17
+ notify: zod_1.z.boolean().optional(),
18
+ indicate: zod_1.z.boolean().optional(),
19
+ authenticatedSignedWrites: zod_1.z.boolean().optional(),
20
+ reliableWrite: zod_1.z.boolean().optional(),
21
+ writableAuxiliaries: zod_1.z.boolean().optional(),
22
+ extendedProperties: zod_1.z.boolean().optional(),
23
+ notifyEncryptionRequired: zod_1.z.boolean().optional(),
24
+ indicateEncryptionRequired: zod_1.z.boolean().optional(),
25
25
  })
26
26
  .passthrough(),
27
- descriptors: v4_1.z.array(v4_1.z.object({ uuid: v4_1.z.string() })),
27
+ descriptors: zod_1.z.array(zod_1.z.object({ uuid: zod_1.z.string() })),
28
28
  })
29
29
  .passthrough()),
30
30
  })
@@ -5,10 +5,10 @@ const action_completed_message_1 = require("@matreshka/shared/messages/client-to
5
5
  const error_message_1 = require("@matreshka/shared/messages/client-to-bff/error-message");
6
6
  const targeted_message_1 = require("@matreshka/shared/messages/targeted-message");
7
7
  const rxjs_1 = require("rxjs");
8
- const v4_1 = require("zod/v4");
8
+ const zod_1 = require("zod");
9
9
  const incoming_message_observer_1 = require("../../core/utils/incoming-message-observer");
10
- const errorMessagePayloadSchema = v4_1.z.strictObject({
11
- message: v4_1.z.string(),
10
+ const errorMessagePayloadSchema = zod_1.z.strictObject({
11
+ message: zod_1.z.string(),
12
12
  });
13
13
  /**
14
14
  * Hot platform-action stream: исходящее сообщение при вызове, много входящих с тем же target.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@matreshka/bff",
3
- "version": "0.25.0",
3
+ "version": "0.25.3",
4
4
  "description": "Matreshka BFF: server-driven UI runtime — routing, pages, context, component DSL, and platform APIs",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -68,7 +68,7 @@
68
68
  "fast-xml-parser": "^5.3.3",
69
69
  "rxjs": "^7.8.2",
70
70
  "ws": "^8.14.2",
71
- "zod": "^3.25.28"
71
+ "zod": "^4.6.7"
72
72
  },
73
73
  "exports": {
74
74
  ".": {