lua-cli 2.3.2 → 2.4.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.
@@ -25,7 +25,10 @@ export class GetBasketsTool implements LuaTool {
25
25
  status: z.enum(['active', 'checked_out', 'abandoned', 'expired']).optional()
26
26
  });
27
27
  async execute(input: z.infer<typeof this.inputSchema>) {
28
- return Baskets.get(input.status as BasketStatus);
28
+ const baskets = await Baskets.get(input.status as BasketStatus);
29
+ return {
30
+ baskets: baskets
31
+ };
29
32
  }
30
33
  }
31
34
 
@@ -9,7 +9,7 @@ export class SearchProductsTool implements LuaTool {
9
9
  query: z.string()
10
10
  });
11
11
 
12
- constructor() {}
12
+ constructor() { }
13
13
 
14
14
  async execute(input: z.infer<typeof this.inputSchema>) {
15
15
  return await Products.search(input.query);
@@ -19,13 +19,13 @@ export class SearchProductsTool implements LuaTool {
19
19
  export class GetAllProductsTool implements LuaTool {
20
20
  name = "get_all_products";
21
21
  description = "Get all products";
22
- inputSchema = z.object({
22
+ inputSchema = z.object({
23
23
  page: z.number().optional(),
24
24
  limit: z.number().optional()
25
25
  });
26
26
 
27
27
  async execute(input: z.infer<typeof this.inputSchema>) {
28
- return await Products.get(input.page, input.limit);
28
+ return await Products.get(input.limit, input.limit);
29
29
  }
30
30
  }
31
31
 
@@ -41,8 +41,8 @@ export class CreateProductTool implements LuaTool {
41
41
  });
42
42
 
43
43
  async execute(input: z.infer<typeof this.inputSchema>) {
44
- return Products.create({...input.product, id: uuidv4()});
45
- }
44
+ return Products.create({ ...input.product, id: uuidv4() });
45
+ }
46
46
  }
47
47
 
48
48
  export class UpdateProductTool implements LuaTool {
@@ -58,7 +58,7 @@ export class UpdateProductTool implements LuaTool {
58
58
  });
59
59
 
60
60
  async execute(input: z.infer<typeof this.inputSchema>) {
61
- return Products.update({...input.product, id: uuidv4()}, input.product.id);
61
+ return Products.update({ ...input.product }, input.product.id);
62
62
  }
63
63
  }
64
64
 
@@ -73,7 +73,7 @@ export class GetProductByIdTool implements LuaTool {
73
73
  return Products.getById(input.id);
74
74
  }
75
75
  }
76
-
76
+
77
77
  export class DeleteProductTool implements LuaTool {
78
78
  name = "delete_product";
79
79
  description = "Delete an existing product";