@lokalise/maestro-expert-tenant-lib 14.1.2 → 14.2.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.
@@ -1,16 +1,21 @@
1
- import { type ZodObject, type ZodRawShape, z } from 'zod/v4';
1
+ import { type EventPayloadSchema, type RejectAnyPayload } from '@message-queue-toolkit/schemas';
2
+ import { z } from 'zod/v4';
2
3
  /**
3
- * Same as enrichMessageSchemaWithBase, but with the runId metadata field
4
+ * Same as enrichMessageSchemaWithBase, but with the runId metadata field.
5
+ *
6
+ * The payload parameter mirrors the toolkit's own signature: `RejectAnyPayload` collapses to
7
+ * `never` for schemas whose output is `any` (e.g. `z.any()`), so such payloads are rejected at
8
+ * the call site instead of silently disabling type-checking for every handler and publisher.
4
9
  */
5
- export declare function enrichMessageSchemaWithBaseAndRunId<T extends ZodObject<Y>, Y extends ZodRawShape, Z extends string>(type: Z, payloadSchema: T, description: string): {
6
- consumerSchema: ZodObject<{
10
+ export declare function enrichMessageSchemaWithBaseAndRunId<T extends EventPayloadSchema, Z extends string>(type: Z, payloadSchema: T & RejectAnyPayload<T>, description: string): {
11
+ consumerSchema: z.ZodObject<{
7
12
  id: z.ZodString;
8
13
  timestamp: z.ZodISODateTime;
9
14
  type: z.ZodLiteral<Z>;
10
15
  deduplicationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
16
  deduplicationOptions: z.ZodOptional<z.ZodNullable<typeof import("@message-queue-toolkit/schemas").MESSAGE_DEDUPLICATION_OPTIONS_SCHEMA>>;
12
- payload: T;
13
- metadata: ZodObject<{
17
+ payload: T & RejectAnyPayload<T>;
18
+ metadata: z.ZodObject<{
14
19
  schemaVersion: z.ZodString;
15
20
  producedBy: z.ZodString;
16
21
  originatedFrom: z.ZodString;
@@ -18,14 +23,14 @@ export declare function enrichMessageSchemaWithBaseAndRunId<T extends ZodObject<
18
23
  runId: z.ZodOptional<z.ZodString>;
19
24
  }, z.core.$strip>;
20
25
  }, z.core.$strip>;
21
- publisherSchema: ZodObject<{
26
+ publisherSchema: z.ZodObject<{
22
27
  id: z.ZodOptional<z.ZodString>;
23
28
  timestamp: z.ZodOptional<z.ZodISODateTime>;
24
29
  type: z.ZodLiteral<Z>;
25
30
  deduplicationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
26
31
  deduplicationOptions: z.ZodOptional<z.ZodNullable<typeof import("@message-queue-toolkit/schemas").MESSAGE_DEDUPLICATION_OPTIONS_SCHEMA>>;
27
- payload: T;
28
- metadata: z.ZodOptional<ZodObject<{
32
+ payload: T & RejectAnyPayload<T>;
33
+ metadata: z.ZodOptional<z.ZodObject<{
29
34
  schemaVersion: z.ZodOptional<z.ZodString>;
30
35
  producedBy: z.ZodOptional<z.ZodString>;
31
36
  originatedFrom: z.ZodOptional<z.ZodString>;
@@ -1,7 +1,11 @@
1
1
  import { CONSUMER_MESSAGE_METADATA_SCHEMA, enrichMessageSchemaWithBase, PUBLISHER_MESSAGE_METADATA_SCHEMA, } from '@message-queue-toolkit/schemas';
2
2
  import { z } from 'zod/v4';
3
3
  /**
4
- * Same as enrichMessageSchemaWithBase, but with the runId metadata field
4
+ * Same as enrichMessageSchemaWithBase, but with the runId metadata field.
5
+ *
6
+ * The payload parameter mirrors the toolkit's own signature: `RejectAnyPayload` collapses to
7
+ * `never` for schemas whose output is `any` (e.g. `z.any()`), so such payloads are rejected at
8
+ * the call site instead of silently disabling type-checking for every handler and publisher.
5
9
  */
6
10
  export function enrichMessageSchemaWithBaseAndRunId(type, payloadSchema, description) {
7
11
  const runId = z.string().optional().describe('unique identifier of the current message chain');
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/event-schemas/common.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gCAAgC,EAChC,2BAA2B,EAC3B,iCAAiC,GAClC,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAoC,CAAC,EAAE,MAAM,QAAQ,CAAA;AAE5D;;GAEG;AACH,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AAC;QACF,eAAe,EAAE,eAAe,CAAC,MAAM,CAAC;YACtC,QAAQ,EAAE,iCAAiC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,QAAQ,EAAE;SACzE,CAAC;KACH,CAAA;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lokalise/maestro-expert-tenant-lib",
3
- "version": "14.1.2",
3
+ "version": "14.2.0",
4
4
  "license": "Apache-2.0",
5
5
  "homepage": "https://github.com/lokalise/maestro",
6
6
  "description": "This library provides shared objects, types and zod schemas for Maestro",
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@lokalise/api-common": "^7.1.1",
29
- "@message-queue-toolkit/schemas": "^8.0.0"
29
+ "@message-queue-toolkit/schemas": "^8.1.0"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "@lokalise/api-contracts": ">=7.2.0",
@@ -38,7 +38,7 @@
38
38
  "@biomejs/biome": "2.5.13",
39
39
  "@lokalise/api-contracts": "^8.0.0",
40
40
  "@lokalise/biome-config": "^3.1.1",
41
- "@lokalise/maestro-common": "13.1.2",
41
+ "@lokalise/maestro-common": "13.2.0",
42
42
  "@lokalise/tsconfig": "~5.0.0",
43
43
  "@types/node": "^26.5.0",
44
44
  "@vitest/coverage-v8": "5.0.0",