@ram_28/kf-ai-sdk 2.0.27 → 2.0.28

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.
@@ -82,7 +82,7 @@ const filtered = await product.count({
82
82
  Filter: {
83
83
  Operator: "And",
84
84
  Condition: [
85
- { Operator: "eq", LHSField: "Category", RHSValue: "Electronics" },
85
+ { Operator: "EQ", LHSField: "Category", RHSValue: "Electronics", RHSType: "Constant" },
86
86
  ],
87
87
  },
88
88
  });
@@ -125,8 +125,8 @@ const items = await product.list({
125
125
  Filter: {
126
126
  Operator: "And",
127
127
  Condition: [
128
- { Operator: "eq", LHSField: "Category", RHSValue: "Electronics" },
129
- { Operator: "gte", LHSField: "Price", RHSValue: 10 },
128
+ { Operator: "EQ", LHSField: "Category", RHSValue: "Electronics", RHSType: "Constant" },
129
+ { Operator: "GTE", LHSField: "Price", RHSValue: 10, RHSType: "Constant" },
130
130
  ],
131
131
  },
132
132
  Sort: [{ Price: "DESC" }],
@@ -140,7 +140,7 @@ interface ConditionGroupType {
140
140
  }
141
141
 
142
142
  interface ConditionType {
143
- Operator: string; // "eq", "neq", "gt", "gte", "lt", "lte", "contains", "startswith", etc.
143
+ Operator: string; // "EQ", "NE", "GT", "GTE", "LT", "LTE", "Contains", "StartsWith", "IN", "NIN", "Empty", "NotEmpty"
144
144
  LHSField: string; // field name
145
145
  RHSValue: any; // comparison value
146
146
  RHSType?: string; // defaults to "Constant"
@@ -6,7 +6,7 @@
6
6
  import { useState, useMemo } from "react";
7
7
  import { useBDOTable } from "@ram_28/kf-ai-sdk/table";
8
8
  import type { UseBDOTableReturnType } from "@ram_28/kf-ai-sdk/table/types";
9
- import { ConditionOperator, RHSType } from "@ram_28/kf-ai-sdk/filter";
9
+ import { ConditionOperator, RHSType } from "@ram_28/kf-ai-sdk/table";
10
10
  import { BuyerProduct } from "@/bdo/buyer/Product";
11
11
 
12
12
  export default function FilteredProductTable() {
@@ -6,7 +6,7 @@
6
6
  import { useState, useMemo } from "react";
7
7
  import { useActivityTable, ActivityTableStatus } from "@ram_28/kf-ai-sdk/workflow";
8
8
  import type { UseActivityTableReturnType } from "@ram_28/kf-ai-sdk/workflow";
9
- import { ConditionOperator, RHSType } from "@ram_28/kf-ai-sdk/filter";
9
+ import { ConditionOperator, RHSType } from "@ram_28/kf-ai-sdk/table";
10
10
  import { EmployeeInputActivity } from "@/workflow/leave";
11
11
 
12
12
  export default function FilteredActivityTable() {
@@ -161,14 +161,14 @@ Sorting is controlled through the `sort` object. Column headers typically use `t
161
161
  The table includes an integrated [`useFilter`](../useFilter/README.md) instance at `table.filter`. Use it to build filter conditions that narrow down the table results:
162
162
 
163
163
  ```tsx
164
- import { ConditionOperator } from "@ram_28/kf-ai-sdk/table";
164
+ import { ConditionOperator, RHSType } from "@ram_28/kf-ai-sdk/table";
165
165
 
166
166
  // Filter by leave type
167
167
  table.filter.addCondition({
168
168
  Operator: ConditionOperator.EQ,
169
169
  LHSField: activity.LeaveType.id,
170
170
  RHSValue: "PTO",
171
- RHSType: "Constant",
171
+ RHSType: RHSType.Constant,
172
172
  });
173
173
 
174
174
  // Date range filter
@@ -176,7 +176,7 @@ table.filter.addCondition({
176
176
  Operator: ConditionOperator.GTE,
177
177
  LHSField: activity.StartDate.id,
178
178
  RHSValue: "2026-01-01",
179
- RHSType: "Constant",
179
+ RHSType: RHSType.Constant,
180
180
  });
181
181
 
182
182
  // Clear all filters
@@ -141,14 +141,14 @@ Sorting is controlled through the `sort` object. Column headers typically use `t
141
141
  The table includes an integrated [`useFilter`](../useFilter/README.md) instance at `table.filter`. Use it to build filter conditions that narrow down the table results:
142
142
 
143
143
  ```tsx
144
- import { ConditionOperator } from "@ram_28/kf-ai-sdk/table";
144
+ import { ConditionOperator, RHSType } from "@ram_28/kf-ai-sdk/table";
145
145
 
146
146
  // Exact match
147
147
  table.filter.addCondition({
148
148
  Operator: ConditionOperator.EQ,
149
149
  LHSField: product.Category.id,
150
150
  RHSValue: "Electronics",
151
- RHSType: "Constant",
151
+ RHSType: RHSType.Constant,
152
152
  });
153
153
 
154
154
  // Range filter
@@ -156,6 +156,7 @@ table.filter.addCondition({
156
156
  Operator: ConditionOperator.GTE,
157
157
  LHSField: product.Price.id,
158
158
  RHSValue: 100,
159
+ RHSType: RHSType.Constant,
159
160
  });
160
161
 
161
162
  // Clear all filters
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ram_28/kf-ai-sdk",
3
- "version": "2.0.27",
3
+ "version": "2.0.28",
4
4
  "description": "Type-safe, AI-driven SDK for building modern web applications with role-based access control",
5
5
  "author": "Ramprasad",
6
6
  "license": "MIT",