@mastra/nestjs 0.1.5-alpha.0 → 0.1.5-alpha.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # @mastra/nestjs
2
2
 
3
+ ## 0.1.5-alpha.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`090a647`](https://github.com/mastra-ai/mastra/commit/090a647ba5a66d36f203f9f49457e03a1ff4e6fb), [`090a647`](https://github.com/mastra-ai/mastra/commit/090a647ba5a66d36f203f9f49457e03a1ff4e6fb), [`f84447d`](https://github.com/mastra-ai/mastra/commit/f84447d6c80f3471836a9b300d246b331fb47e0d), [`a1a5b3e`](https://github.com/mastra-ai/mastra/commit/a1a5b3e42ab2ca5161ea21db59ebf28442680fa7), [`af84f57`](https://github.com/mastra-ai/mastra/commit/af84f571ed762e92e8e61c5f9a72363520914274), [`8b3c6f9`](https://github.com/mastra-ai/mastra/commit/8b3c6f90f7879833ba7d1bc70937e1d8f69d0804)]:
8
+ - @mastra/core@1.34.0-alpha.3
9
+ - @mastra/server@1.34.0-alpha.3
10
+
11
+ ## 0.1.5-alpha.2
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [[`bdb4cbf`](https://github.com/mastra-ai/mastra/commit/bdb4cbf8ba4b685d7481f28bb9dc3de6c79c9ed2)]:
16
+ - @mastra/core@1.34.0-alpha.2
17
+ - @mastra/server@1.34.0-alpha.2
18
+
19
+ ## 0.1.5-alpha.1
20
+
21
+ ### Patch Changes
22
+
23
+ - Fixed `@mastra/nestjs` coercing query parameter values to booleans, `null`, numbers, and parsed JSON objects/arrays before route schema validation. A route declaring `queryParamSchema: z.object({ filter: z.string() })` could reject a valid request like `?filter={"a":1}` because the adapter had already turned the string into an object. NestJS now forwards query values as the raw strings (or string arrays) the HTTP layer delivered — matching `@mastra/hono`, `@mastra/express`, `@mastra/fastify`, and `@mastra/koa`. ([#16268](https://github.com/mastra-ai/mastra/pull/16268))
24
+
25
+ Routes that want type coercion should opt in via the schema, e.g. `z.coerce.boolean()`, `z.coerce.number()`, or a JSON preprocessor on the field.
26
+
27
+ Fixes #16114.
28
+
29
+ - Updated dependencies [[`fceae1f`](https://github.com/mastra-ai/mastra/commit/fceae1f5f5db4722cb078a663c6eb4bd22944123), [`bf02acb`](https://github.com/mastra-ai/mastra/commit/bf02acbb8a6110f638ac844e89f1ebf04cb7fe74), [`0fd3fbe`](https://github.com/mastra-ai/mastra/commit/0fd3fbe40fb63657aedd72f6e7b38c8e8ee6940d), [`fed0475`](https://github.com/mastra-ai/mastra/commit/fed0475ccfea31e4fc251469ac05640d0742c1f0), [`522f44d`](https://github.com/mastra-ai/mastra/commit/522f44d947214bfc06cff50599bae1ef3494880d)]:
30
+ - @mastra/core@1.34.0-alpha.1
31
+ - @mastra/server@1.34.0-alpha.1
32
+
3
33
  ## 0.1.5-alpha.0
4
34
 
5
35
  ### Patch Changes
@@ -20,32 +20,15 @@ export declare class MastraController {
20
20
  handleRequest(req: Request, _res: Response): Promise<unknown>;
21
21
  /**
22
22
  * Parse and normalize query parameters.
23
- * Handles type coercion for numbers, booleans, arrays, and JSON strings.
24
- */
25
- private parseQueryParams;
26
- /**
27
- * Coerce a query parameter value to its appropriate type.
28
- *
29
- * Type coercion rules:
30
- * - "true"/"false" → boolean
31
- * - "null" → null
32
- * - Numeric strings → number (except IDs with leading zeros like "007")
33
- * - JSON objects/arrays → parsed object/array
34
23
  *
35
- * @example
36
- * // Numbers
37
- * coerceQueryValue("42") // 42
38
- * coerceQueryValue("3.14") // 3.14
39
- * coerceQueryValue("007") // "007" (preserved as string)
40
- *
41
- * // Booleans
42
- * coerceQueryValue("true") // → true
43
- * coerceQueryValue("false") // → false
44
- *
45
- * // JSON
46
- * coerceQueryValue('{"a":1}') // → { a: 1 }
24
+ * Values are forwarded as the raw strings (or string arrays) the HTTP layer
25
+ * delivered. The route's `queryParamSchema` decides whether and how to parse
26
+ * or coerce each field — exactly as in `@mastra/hono`, `@mastra/express`,
27
+ * `@mastra/fastify`, and `@mastra/koa`. Users who want booleans, numbers, or
28
+ * parsed JSON should opt in via `z.coerce.boolean()`, `z.coerce.number()`,
29
+ * or a JSON preprocessor on the field. See #16114.
47
30
  */
48
- private coerceQueryValue;
31
+ private parseQueryParams;
49
32
  /**
50
33
  * Parse request body, handling multipart/form-data and JSON.
51
34
  */
@@ -1 +1 @@
1
- {"version":3,"file":"mastra.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/mastra.controller.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAQjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAIxE;;;;;;GAMG;AACH,qBAIa,gBAAgB;IAED,OAAO,CAAC,QAAQ,CAAC,OAAO;IACnB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC3B,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAFrB,OAAO,EAAE,mBAAmB,EACvB,YAAY,EAAE,mBAAmB,EAC/B,cAAc,EAAE,qBAAqB;IAGvF;;OAEG;IAEG,aAAa,CAAQ,GAAG,EAAE,OAAO,EAA8B,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;IA+BtG;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAoBxB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,OAAO,CAAC,gBAAgB;IAoCxB;;OAEG;YACW,SAAS;CAsBxB"}
1
+ {"version":3,"file":"mastra.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/mastra.controller.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,C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