@86d-app/products 0.0.6 → 0.0.13

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.
@@ -34,12 +34,11 @@ export declare const storeEndpoints: {
34
34
  "/products/search": import("better-call").StrictEndpoint<"/products/search", {
35
35
  method: "GET";
36
36
  query: import("zod").ZodObject<{
37
- q: import("zod").ZodString;
37
+ q: import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string, string>>;
38
38
  limit: import("zod").ZodOptional<import("zod").ZodString>;
39
39
  }, import("zod/v4/core").$strip>;
40
40
  }, {
41
41
  products: unknown;
42
- query: string;
43
42
  }>;
44
43
  "/products/store-search": import("better-call").StrictEndpoint<"/products/store-search", {
45
44
  method: "GET";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/store/endpoints/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAW1B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/store/endpoints/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAW1B,CAAC"}
@@ -2,11 +2,10 @@ import { z } from "@86d-app/core";
2
2
  export declare const searchProducts: import("better-call").StrictEndpoint<"/products/search", {
3
3
  method: "GET";
4
4
  query: z.ZodObject<{
5
- q: z.ZodString;
5
+ q: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
6
6
  limit: z.ZodOptional<z.ZodString>;
7
7
  }, z.core.$strip>;
8
8
  }, {
9
9
  products: unknown;
10
- query: string;
11
10
  }>;
12
11
  //# sourceMappingURL=search-products.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"search-products.d.ts","sourceRoot":"","sources":["../../../src/store/endpoints/search-products.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,CAAC,EAAE,MAAM,eAAe,CAAC;AAEvD,eAAO,MAAM,cAAc;;;;;;;;;EAe1B,CAAC"}
1
+ {"version":3,"file":"search-products.d.ts","sourceRoot":"","sources":["../../../src/store/endpoints/search-products.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,CAAC,EAAE,MAAM,eAAe,CAAC;AAErE,eAAO,MAAM,cAAc;;;;;;;;EAa1B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@86d-app/products",
3
- "version": "0.0.6",
3
+ "version": "0.0.13",
4
4
  "description": "Product catalog module for 86d commerce platform",
5
5
  "keywords": [
6
6
  "commerce",
@@ -1,18 +1,16 @@
1
- import { createStoreEndpoint, z } from "@86d-app/core";
1
+ import { createStoreEndpoint, sanitizeText, z } from "@86d-app/core";
2
2
 
3
3
  export const searchProducts = createStoreEndpoint(
4
4
  "/products/search",
5
5
  {
6
6
  method: "GET",
7
7
  query: z.object({
8
- q: z.string().min(1).max(500),
9
- limit: z.string().optional(),
8
+ q: z.string().min(1).max(500).transform(sanitizeText),
9
+ limit: z.string().max(10).optional(),
10
10
  }),
11
11
  },
12
12
  async (ctx) => {
13
- const { query } = ctx;
14
- // Call the controller directly
15
13
  const products = await ctx.context.controllers.product.search(ctx);
16
- return { products, query: query.q };
14
+ return { products };
17
15
  },
18
16
  );