@ram_28/kf-ai-sdk 1.0.11 → 1.0.12

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.
Files changed (193) hide show
  1. package/README.md +55 -48
  2. package/dist/api/client.d.ts +14 -14
  3. package/dist/api/client.d.ts.map +1 -1
  4. package/dist/api/datetime.d.ts +5 -5
  5. package/dist/api/datetime.d.ts.map +1 -1
  6. package/dist/api/index.d.ts +1 -1
  7. package/dist/api/index.d.ts.map +1 -1
  8. package/dist/api/metadata.d.ts +2 -2
  9. package/dist/api/metadata.d.ts.map +1 -1
  10. package/dist/api.cjs +1 -0
  11. package/dist/api.d.ts +4 -0
  12. package/dist/api.d.ts.map +1 -0
  13. package/dist/api.mjs +27 -0
  14. package/dist/api.types.cjs +1 -0
  15. package/dist/api.types.d.ts +4 -0
  16. package/dist/api.types.d.ts.map +1 -0
  17. package/dist/api.types.mjs +1 -0
  18. package/dist/auth/AuthProvider.d.ts +3 -3
  19. package/dist/auth/AuthProvider.d.ts.map +1 -1
  20. package/dist/auth/authClient.d.ts +4 -4
  21. package/dist/auth/authClient.d.ts.map +1 -1
  22. package/dist/auth/authConfig.d.ts +5 -5
  23. package/dist/auth/authConfig.d.ts.map +1 -1
  24. package/dist/auth/index.d.ts +1 -1
  25. package/dist/auth/index.d.ts.map +1 -1
  26. package/dist/auth/types.d.ts +21 -21
  27. package/dist/auth/types.d.ts.map +1 -1
  28. package/dist/auth/useAuth.d.ts +2 -2
  29. package/dist/auth/useAuth.d.ts.map +1 -1
  30. package/dist/auth.cjs +1 -0
  31. package/dist/auth.d.ts +5 -0
  32. package/dist/auth.d.ts.map +1 -0
  33. package/dist/auth.mjs +280 -0
  34. package/dist/auth.types.cjs +1 -0
  35. package/dist/auth.types.d.ts +2 -0
  36. package/dist/auth.types.d.ts.map +1 -0
  37. package/dist/auth.types.mjs +1 -0
  38. package/dist/base-types.d.ts +2 -0
  39. package/dist/base-types.d.ts.map +1 -0
  40. package/dist/client-C15j4O5B.cjs +1 -0
  41. package/dist/client-CfvLiGfP.js +233 -0
  42. package/dist/cn-Dr87sK3i.js +2775 -0
  43. package/dist/cn-mXUIg4vp.cjs +1 -0
  44. package/dist/components/hooks/index.d.ts +3 -3
  45. package/dist/components/hooks/index.d.ts.map +1 -1
  46. package/dist/components/hooks/useFilter/index.d.ts +2 -2
  47. package/dist/components/hooks/useFilter/index.d.ts.map +1 -1
  48. package/dist/components/hooks/useFilter/types.d.ts +19 -31
  49. package/dist/components/hooks/useFilter/types.d.ts.map +1 -1
  50. package/dist/components/hooks/useFilter/useFilter.d.ts +2 -2
  51. package/dist/components/hooks/useFilter/useFilter.d.ts.map +1 -1
  52. package/dist/components/hooks/useForm/apiClient.d.ts +6 -6
  53. package/dist/components/hooks/useForm/apiClient.d.ts.map +1 -1
  54. package/dist/components/hooks/useForm/expressionValidator.utils.d.ts +7 -7
  55. package/dist/components/hooks/useForm/expressionValidator.utils.d.ts.map +1 -1
  56. package/dist/components/hooks/useForm/index.d.ts +5 -5
  57. package/dist/components/hooks/useForm/index.d.ts.map +1 -1
  58. package/dist/components/hooks/useForm/optimizedExpressionValidator.utils.d.ts +10 -10
  59. package/dist/components/hooks/useForm/optimizedExpressionValidator.utils.d.ts.map +1 -1
  60. package/dist/components/hooks/useForm/ruleClassifier.utils.d.ts +7 -12
  61. package/dist/components/hooks/useForm/ruleClassifier.utils.d.ts.map +1 -1
  62. package/dist/components/hooks/useForm/schemaParser.utils.d.ts +7 -7
  63. package/dist/components/hooks/useForm/schemaParser.utils.d.ts.map +1 -1
  64. package/dist/components/hooks/useForm/types.d.ts +67 -76
  65. package/dist/components/hooks/useForm/types.d.ts.map +1 -1
  66. package/dist/components/hooks/useForm/useForm.d.ts +2 -2
  67. package/dist/components/hooks/useForm/useForm.d.ts.map +1 -1
  68. package/dist/components/hooks/useKanban/apiClient.d.ts +16 -16
  69. package/dist/components/hooks/useKanban/apiClient.d.ts.map +1 -1
  70. package/dist/components/hooks/useKanban/context.d.ts +3 -3
  71. package/dist/components/hooks/useKanban/context.d.ts.map +1 -1
  72. package/dist/components/hooks/useKanban/dragDropManager.d.ts +7 -7
  73. package/dist/components/hooks/useKanban/dragDropManager.d.ts.map +1 -1
  74. package/dist/components/hooks/useKanban/index.d.ts +1 -1
  75. package/dist/components/hooks/useKanban/index.d.ts.map +1 -1
  76. package/dist/components/hooks/useKanban/types.d.ts +65 -67
  77. package/dist/components/hooks/useKanban/types.d.ts.map +1 -1
  78. package/dist/components/hooks/useKanban/useKanban.d.ts +2 -2
  79. package/dist/components/hooks/useKanban/useKanban.d.ts.map +1 -1
  80. package/dist/components/hooks/useTable/index.d.ts +1 -1
  81. package/dist/components/hooks/useTable/index.d.ts.map +1 -1
  82. package/dist/components/hooks/useTable/types.d.ts +10 -10
  83. package/dist/components/hooks/useTable/types.d.ts.map +1 -1
  84. package/dist/components/hooks/useTable/useTable.d.ts +2 -2
  85. package/dist/components/hooks/useTable/useTable.d.ts.map +1 -1
  86. package/dist/filter.cjs +1 -0
  87. package/dist/filter.d.ts +3 -0
  88. package/dist/filter.d.ts.map +1 -0
  89. package/dist/filter.mjs +6 -0
  90. package/dist/filter.types.cjs +1 -0
  91. package/dist/filter.types.d.ts +2 -0
  92. package/dist/filter.types.d.ts.map +1 -0
  93. package/dist/filter.types.mjs +1 -0
  94. package/dist/form.cjs +1 -0
  95. package/dist/form.d.ts +3 -0
  96. package/dist/form.d.ts.map +1 -0
  97. package/dist/form.mjs +1346 -0
  98. package/dist/form.types.cjs +1 -0
  99. package/dist/form.types.d.ts +2 -0
  100. package/dist/form.types.d.ts.map +1 -0
  101. package/dist/form.types.mjs +1 -0
  102. package/dist/jsx-runtime-BYECrxsp.cjs +30 -0
  103. package/dist/jsx-runtime-DGlMoOmv.js +630 -0
  104. package/dist/kanban.cjs +13 -0
  105. package/dist/kanban.d.ts +5 -0
  106. package/dist/kanban.d.ts.map +1 -0
  107. package/dist/kanban.mjs +694 -0
  108. package/dist/kanban.types.cjs +1 -0
  109. package/dist/kanban.types.d.ts +2 -0
  110. package/dist/kanban.types.d.ts.map +1 -0
  111. package/dist/kanban.types.mjs +1 -0
  112. package/dist/kanban.ui.cjs +1 -0
  113. package/dist/kanban.ui.d.ts +2 -0
  114. package/dist/kanban.ui.d.ts.map +1 -0
  115. package/dist/kanban.ui.mjs +104 -0
  116. package/dist/metadata-2FLBsFcf.cjs +1 -0
  117. package/dist/metadata-DBcoDth-.js +43 -0
  118. package/dist/table.cjs +1 -0
  119. package/dist/table.d.ts +2 -0
  120. package/dist/table.d.ts.map +1 -0
  121. package/dist/table.mjs +148 -0
  122. package/dist/table.types.cjs +1 -0
  123. package/dist/table.types.d.ts +2 -0
  124. package/dist/table.types.d.ts.map +1 -0
  125. package/dist/table.types.mjs +1 -0
  126. package/dist/types/base-fields.d.ts +45 -45
  127. package/dist/types/base-fields.d.ts.map +1 -1
  128. package/dist/types/common.d.ts +45 -61
  129. package/dist/types/common.d.ts.map +1 -1
  130. package/dist/types.cjs +1 -0
  131. package/dist/types.mjs +1 -0
  132. package/dist/useFilter-CXFqEHyI.js +129 -0
  133. package/dist/useFilter-D-bCDo6Z.cjs +1 -0
  134. package/dist/utils/formatting.d.ts +4 -4
  135. package/dist/utils/formatting.d.ts.map +1 -1
  136. package/dist/utils.cjs +4 -0
  137. package/dist/utils.d.ts +3 -0
  138. package/dist/utils.d.ts.map +1 -0
  139. package/dist/utils.mjs +105 -0
  140. package/package.json +147 -9
  141. package/sdk/api/client.ts +51 -51
  142. package/sdk/api/datetime.ts +5 -5
  143. package/sdk/api/index.ts +28 -33
  144. package/sdk/api/metadata.ts +4 -4
  145. package/sdk/api.ts +24 -0
  146. package/sdk/api.types.ts +58 -0
  147. package/sdk/auth/AuthProvider.tsx +18 -18
  148. package/sdk/auth/authClient.ts +9 -9
  149. package/sdk/auth/authConfig.ts +9 -9
  150. package/sdk/auth/index.ts +5 -5
  151. package/sdk/auth/types.ts +21 -21
  152. package/sdk/auth/useAuth.ts +2 -2
  153. package/sdk/auth.ts +22 -0
  154. package/sdk/auth.types.ts +28 -0
  155. package/sdk/base-types.ts +45 -0
  156. package/sdk/components/hooks/index.ts +22 -22
  157. package/sdk/components/hooks/useFilter/index.ts +8 -14
  158. package/sdk/components/hooks/useFilter/types.ts +29 -58
  159. package/sdk/components/hooks/useFilter/useFilter.ts +41 -44
  160. package/sdk/components/hooks/useForm/apiClient.ts +8 -8
  161. package/sdk/components/hooks/useForm/expressionValidator.utils.ts +18 -18
  162. package/sdk/components/hooks/useForm/index.ts +24 -24
  163. package/sdk/components/hooks/useForm/optimizedExpressionValidator.utils.ts +22 -22
  164. package/sdk/components/hooks/useForm/ruleClassifier.utils.ts +26 -62
  165. package/sdk/components/hooks/useForm/schemaParser.utils.ts +24 -24
  166. package/sdk/components/hooks/useForm/types.ts +66 -82
  167. package/sdk/components/hooks/useForm/useForm.ts +15 -21
  168. package/sdk/components/hooks/useKanban/apiClient.ts +54 -54
  169. package/sdk/components/hooks/useKanban/context.ts +3 -3
  170. package/sdk/components/hooks/useKanban/dragDropManager.ts +19 -19
  171. package/sdk/components/hooks/useKanban/index.ts +26 -26
  172. package/sdk/components/hooks/useKanban/types.ts +69 -71
  173. package/sdk/components/hooks/useKanban/useKanban.ts +43 -51
  174. package/sdk/components/hooks/useKanban/useKanbanSimple.ts +4 -4
  175. package/sdk/components/hooks/useTable/index.ts +5 -1
  176. package/sdk/components/hooks/useTable/types.ts +10 -10
  177. package/sdk/components/hooks/useTable/useTable.ts +10 -10
  178. package/sdk/filter.ts +13 -0
  179. package/sdk/filter.types.ts +17 -0
  180. package/sdk/form.ts +15 -0
  181. package/sdk/form.types.ts +46 -0
  182. package/sdk/kanban.ts +23 -0
  183. package/sdk/kanban.types.ts +50 -0
  184. package/sdk/kanban.ui.ts +16 -0
  185. package/sdk/table.ts +7 -0
  186. package/sdk/table.types.ts +13 -0
  187. package/sdk/types/base-fields.ts +47 -47
  188. package/sdk/types/common.ts +47 -71
  189. package/sdk/types/index.ts +1 -1
  190. package/sdk/utils/formatting.ts +4 -4
  191. package/sdk/utils.ts +10 -0
  192. package/dist/index.cjs +0 -45
  193. package/dist/index.mjs +0 -6387
@@ -3,7 +3,7 @@
3
3
  * Resolves to: string
4
4
  * Use this for all ID-type fields (user IDs, order IDs, etc.)
5
5
  */
6
- export type IdField = string;
6
+ export type IdFieldType = string;
7
7
 
8
8
  /**
9
9
  * String field with optional literal type constraint and length limits
@@ -14,11 +14,11 @@ export type IdField = string;
14
14
  * Storage: VARCHAR in database
15
15
  *
16
16
  * @example
17
- * StringField // => string
18
- * StringField<'active' | 'inactive'> // => 'active' | 'inactive'
19
- * StringField<string, 1, 100> // => string with length constraints
17
+ * StringFieldType // => string
18
+ * StringFieldType<'active' | 'inactive'> // => 'active' | 'inactive'
19
+ * StringFieldType<string, 1, 100> // => string with length constraints
20
20
  */
21
- export type StringField<
21
+ export type StringFieldType<
22
22
  T extends string = string,
23
23
  _MinLength extends number = never,
24
24
  _MaxLength extends number = never,
@@ -31,9 +31,9 @@ export type StringField<
31
31
  * Use this for descriptions, comments, rich text content
32
32
  *
33
33
  * @example
34
- * TextAreaField // => string (multi-line)
34
+ * TextAreaFieldType // => string (multi-line)
35
35
  */
36
- export type TextAreaField = string;
36
+ export type TextAreaFieldType = string;
37
37
 
38
38
  /**
39
39
  * Numeric field with optional precision constraints
@@ -43,10 +43,10 @@ export type TextAreaField = string;
43
43
  * Use this for quantities, measurements, calculations
44
44
  *
45
45
  * @example
46
- * NumberField // => number
47
- * NumberField<2> // => number with 2 decimal places
46
+ * NumberFieldType // => number
47
+ * NumberFieldType<2> // => number with 2 decimal places
48
48
  */
49
- export type NumberField<_Precision extends number = never> = number;
49
+ export type NumberFieldType<_Precision extends number = never> = number;
50
50
 
51
51
  /**
52
52
  * Large integer field for big numbers
@@ -55,9 +55,9 @@ export type NumberField<_Precision extends number = never> = number;
55
55
  * Use this for large counters, timestamps, file sizes
56
56
  *
57
57
  * @example
58
- * LongField // => number (large integer)
58
+ * LongFieldType // => number (large integer)
59
59
  */
60
- export type LongField = number;
60
+ export type LongFieldType = number;
61
61
 
62
62
  /**
63
63
  * Boolean field
@@ -65,7 +65,7 @@ export type LongField = number;
65
65
  * Storage: BOOLEAN in database
66
66
  * Use this for true/false values, flags, toggles
67
67
  */
68
- export type BooleanField = boolean;
68
+ export type BooleanFieldType = boolean;
69
69
 
70
70
  /**
71
71
  * Date field (date only, no time)
@@ -74,9 +74,9 @@ export type BooleanField = boolean;
74
74
  * Use this for birth dates, due dates, calendar events
75
75
  *
76
76
  * @example
77
- * DateField // => Date (date only)
77
+ * DateFieldType // => Date (date only)
78
78
  */
79
- export type DateField = Date;
79
+ export type DateFieldType = Date;
80
80
 
81
81
  /**
82
82
  * DateTime field (date and time)
@@ -85,9 +85,9 @@ export type DateField = Date;
85
85
  * Use this for created_at, updated_at, event timestamps
86
86
  *
87
87
  * @example
88
- * DateTimeField // => Date (with time)
88
+ * DateTimeFieldType // => Date (with time)
89
89
  */
90
- export type DateTimeField = Date;
90
+ export type DateTimeFieldType = Date;
91
91
 
92
92
  // ============================================================
93
93
  // COMPLEX FIELD TYPES
@@ -95,53 +95,53 @@ export type DateTimeField = Date;
95
95
 
96
96
  /**
97
97
  * Currency field supporting multiple value formats
98
- * Resolves to: CurrencyValue
98
+ * Resolves to: CurrencyValueType
99
99
  * Storage: JSON/VARCHAR in database
100
100
  * Use this for prices, monetary amounts, financial data
101
101
  *
102
102
  * @example
103
- * CurrencyField // => {value: number, currency: string} | string
103
+ * CurrencyFieldType // => {value: number, currency: string} | string
104
104
  */
105
- export type CurrencyField = CurrencyValue;
105
+ export type CurrencyFieldType = CurrencyValueType;
106
106
 
107
107
  /**
108
108
  * Currency value format - supports both object and string representations
109
109
  */
110
- export type CurrencyValue =
110
+ export type CurrencyValueType =
111
111
  | { value: number; currency: string } // Object format: {value: 100.50, currency: "USD"}
112
112
  | string; // String format: "100.50 USD" or "USD 100.50"
113
113
 
114
114
  /**
115
115
  * JSON field for structured data
116
116
  * @template T - Expected JSON structure (optional)
117
- * Resolves to: T or JSONValue
117
+ * Resolves to: T or JSONValueType
118
118
  * Storage: JSON/TEXT in database
119
119
  * Use this for configurations, metadata, flexible schemas
120
120
  *
121
121
  * @example
122
- * JSONField // => JSONValue (any valid JSON)
123
- * JSONField<{settings: {theme: string}}> // => {settings: {theme: string}}
122
+ * JSONFieldType // => JSONValueType (any valid JSON)
123
+ * JSONFieldType<{settings: {theme: string}}> // => {settings: {theme: string}}
124
124
  */
125
- export type JSONField<T = JSONValue> = T;
125
+ export type JSONFieldType<T = JSONValueType> = T;
126
126
 
127
- export type ReferenceField = string;
127
+ export type ReferenceFieldType = string;
128
128
 
129
129
  /**
130
130
  * Valid JSON value types
131
131
  */
132
- export type JSONValue =
132
+ export type JSONValueType =
133
133
  | string
134
134
  | number
135
135
  | boolean
136
136
  | null
137
- | JSONObject
138
- | JSONArray;
137
+ | JSONObjectType
138
+ | JSONArrayType;
139
139
 
140
- export interface JSONObject {
141
- [key: string]: JSONValue;
140
+ export interface JSONObjectType {
141
+ [key: string]: JSONValueType;
142
142
  }
143
143
 
144
- export interface JSONArray extends Array<JSONValue> {}
144
+ export interface JSONArrayType extends Array<JSONValueType> {}
145
145
 
146
146
  /**
147
147
  * Select field for single choice from predefined options
@@ -151,9 +151,9 @@ export interface JSONArray extends Array<JSONValue> {}
151
151
  * Use this for status fields, categories, enum-like values
152
152
  *
153
153
  * @example
154
- * SelectField<'active' | 'inactive' | 'pending'> // => 'active' | 'inactive' | 'pending'
154
+ * SelectFieldType<'active' | 'inactive' | 'pending'> // => 'active' | 'inactive' | 'pending'
155
155
  */
156
- export type SelectField<T extends string> = T;
156
+ export type SelectFieldType<T extends string> = T;
157
157
 
158
158
  /**
159
159
  * Lookup field for references to other records
@@ -163,10 +163,10 @@ export type SelectField<T extends string> = T;
163
163
  * Use this for foreign keys, relationships, references
164
164
  *
165
165
  * @example
166
- * LookupField // => string (referenced record ID)
167
- * LookupField<IdField> // => string (typed as IdField)
166
+ * LookupFieldType // => string (referenced record ID)
167
+ * LookupFieldType<IdFieldType> // => string (typed as IdFieldType)
168
168
  */
169
- export type LookupField<T extends string = string> = T;
169
+ export type LookupFieldType<T extends string = string> = T;
170
170
 
171
171
  // ============================================================
172
172
  // CONTAINER AND UTILITY TYPES
@@ -180,11 +180,11 @@ export type LookupField<T extends string = string> = T;
180
180
  * Use this for tags, categories, multiple selections
181
181
  *
182
182
  * @example
183
- * ArrayField<string> // => string[]
184
- * ArrayField<IdField> // => string[]
185
- * ArrayField<SelectField<'tag1' | 'tag2'>> // => ('tag1' | 'tag2')[]
183
+ * ArrayFieldType<string> // => string[]
184
+ * ArrayFieldType<IdFieldType> // => string[]
185
+ * ArrayFieldType<SelectFieldType<'tag1' | 'tag2'>> // => ('tag1' | 'tag2')[]
186
186
  */
187
- export type ArrayField<T> = T[];
187
+ export type ArrayFieldType<T> = T[];
188
188
 
189
189
  /**
190
190
  * Nested object field
@@ -194,9 +194,9 @@ export type ArrayField<T> = T[];
194
194
  * Use this for complex nested structures, embedded documents
195
195
  *
196
196
  * @example
197
- * ObjectField<{ name: string; age: number }> // => { name: string; age: number }
197
+ * ObjectFieldType<{ name: string; age: number }> // => { name: string; age: number }
198
198
  */
199
- export type ObjectField<T extends Record<string, any>> = T;
199
+ export type ObjectFieldType<T extends Record<string, any>> = T;
200
200
 
201
201
  /**
202
202
  * Optional field wrapper
@@ -205,10 +205,10 @@ export type ObjectField<T extends Record<string, any>> = T;
205
205
  * Use this for fields that may not have values
206
206
  *
207
207
  * @example
208
- * OptionalField<StringField> // => string | undefined
209
- * OptionalField<NumberField> // => number | undefined
208
+ * OptionalFieldType<StringFieldType> // => string | undefined
209
+ * OptionalFieldType<NumberFieldType> // => number | undefined
210
210
  */
211
- export type OptionalField<T> = T | undefined;
211
+ export type OptionalFieldType<T> = T | undefined;
212
212
 
213
213
  // ============================================================
214
214
  // UTILITY TYPES FOR FIELD VALIDATION
@@ -218,4 +218,4 @@ export type OptionalField<T> = T | undefined;
218
218
  * Utility type to extract the base type from a field type
219
219
  * Useful for runtime validation and type guards
220
220
  */
221
- export type ExtractFieldType<T> = T extends OptionalField<infer U> ? U : T;
221
+ export type ExtractFieldTypeType<T> = T extends OptionalFieldType<infer U> ? U : T;
@@ -1,24 +1,24 @@
1
1
  /**
2
2
  * Sort direction for API queries (matching API spec)
3
3
  */
4
- export type SortDirection = "ASC" | "DESC";
4
+ export type SortDirectionType = "ASC" | "DESC";
5
5
 
6
6
  /**
7
7
  * Sort configuration: array of field-direction mappings
8
8
  * Format: [{ "fieldName": "ASC" }, { "anotherField": "DESC" }]
9
9
  */
10
- export type SortOption = Record<string, SortDirection>;
10
+ export type SortOptionType = Record<string, SortDirectionType>;
11
11
 
12
12
  /**
13
13
  * Sort configuration: array of sort options
14
14
  */
15
- export type Sort = SortOption[];
15
+ export type SortType = SortOptionType[];
16
16
 
17
17
  /**
18
18
  * Condition operators for individual conditions (leaf nodes)
19
19
  * Used in Condition.Operator
20
20
  */
21
- export type ConditionOperator =
21
+ export type ConditionOperatorType =
22
22
  | "EQ" | "NE" | "GT" | "GTE" | "LT" | "LTE"
23
23
  | "Between" | "NotBetween" | "IN" | "NIN"
24
24
  | "Empty" | "NotEmpty" | "Contains" | "NotContains"
@@ -28,81 +28,57 @@ export type ConditionOperator =
28
28
  * Operators for combining conditions in a group (tree nodes)
29
29
  * Used in ConditionGroup.Operator
30
30
  */
31
- export type ConditionGroupOperator = "And" | "Or" | "Not";
31
+ export type ConditionGroupOperatorType = "And" | "Or" | "Not";
32
32
 
33
33
  /**
34
34
  * RHS value type for filter conditions
35
35
  */
36
- export type FilterRHSType = "Constant" | "BOField" | "AppVariable";
36
+ export type FilterRHSTypeType = "Constant" | "BOField" | "AppVariable";
37
37
 
38
38
  /**
39
39
  * Leaf condition (actual field comparison)
40
40
  */
41
- export interface Condition {
41
+ export interface ConditionType {
42
42
  /** Optional ID for hook state management (omitted in API payload) */
43
43
  id?: string;
44
44
  /** Condition operator */
45
- Operator: ConditionOperator;
45
+ Operator: ConditionOperatorType;
46
46
  /** Left-hand side field name */
47
47
  LHSField: string;
48
48
  /** Right-hand side value */
49
49
  RHSValue: any;
50
50
  /** Right-hand side type (optional, defaults to Constant) */
51
- RHSType?: FilterRHSType;
51
+ RHSType?: FilterRHSTypeType;
52
52
  }
53
53
 
54
54
  /**
55
55
  * Group combining conditions (recursive structure)
56
56
  */
57
- export interface ConditionGroup {
57
+ export interface ConditionGroupType {
58
58
  /** Optional ID for hook state management (omitted in API payload) */
59
59
  id?: string;
60
60
  /** Group operator (And, Or, Not) */
61
- Operator: ConditionGroupOperator;
61
+ Operator: ConditionGroupOperatorType;
62
62
  /** Nested conditions (can be Condition or ConditionGroup) */
63
- Condition: Array<Condition | ConditionGroup>;
63
+ Condition: Array<ConditionType | ConditionGroupType>;
64
64
  }
65
65
 
66
66
  /**
67
67
  * Root filter type (alias for ConditionGroup)
68
68
  */
69
- export type Filter = ConditionGroup;
70
-
71
- // ============================================================
72
- // LEGACY TYPE ALIASES (for backwards compatibility)
73
- // ============================================================
74
-
75
- /**
76
- * @deprecated Use `Condition` instead
77
- */
78
- export type FilterCondition = Condition;
79
-
80
- /**
81
- * @deprecated Use `ConditionGroup` instead
82
- */
83
- export type FilterLogical = ConditionGroup;
84
-
85
- /**
86
- * @deprecated Use `ConditionGroupOperator` instead
87
- */
88
- export type FilterOperator = ConditionGroupOperator;
89
-
90
- /**
91
- * @deprecated Use `Condition | ConditionGroup` instead
92
- */
93
- export type FilterNode = Condition | ConditionGroup;
69
+ export type FilterType = ConditionGroupType;
94
70
 
95
71
  /**
96
72
  * DateTime encoding format used by the API
97
73
  */
98
- export interface DateTimeEncoded {
74
+ export interface DateTimeEncodedType {
99
75
  $__dt__: number;
100
76
  }
101
77
 
102
78
  /**
103
- * Date encoding format used by the API
79
+ * Date encoding format used by the API
104
80
  */
105
- export interface DateEncoded {
81
+ export interface DateEncodedType {
106
82
  $__d__: string;
107
83
  }
108
84
 
@@ -110,7 +86,7 @@ export interface DateEncoded {
110
86
  * Standard paginated list response
111
87
  * @template T - Type of items in the list
112
88
  */
113
- export interface ListResponse<T> {
89
+ export interface ListResponseType<T> {
114
90
  /** Array of items for current page */
115
91
  Data: T[];
116
92
  }
@@ -119,7 +95,7 @@ export interface ListResponse<T> {
119
95
  * Read API response wrapper
120
96
  * @template T - Type of the data object
121
97
  */
122
- export interface ReadResponse<T> {
98
+ export interface ReadResponseType<T> {
123
99
  /** The data object */
124
100
  Data: T;
125
101
  }
@@ -127,7 +103,7 @@ export interface ReadResponse<T> {
127
103
  /**
128
104
  * Create/Update API response
129
105
  */
130
- export interface CreateUpdateResponse {
106
+ export interface CreateUpdateResponseType {
131
107
  /** ID of the created/updated record */
132
108
  _id: string;
133
109
  }
@@ -135,7 +111,7 @@ export interface CreateUpdateResponse {
135
111
  /**
136
112
  * Delete API response
137
113
  */
138
- export interface DeleteResponse {
114
+ export interface DeleteResponseType {
139
115
  /** Status of the delete operation */
140
116
  status: "success";
141
117
  }
@@ -143,7 +119,7 @@ export interface DeleteResponse {
143
119
  /**
144
120
  * Count API response
145
121
  */
146
- export interface CountResponse {
122
+ export interface CountResponseType {
147
123
  /** Total count of matching records */
148
124
  Count: number;
149
125
  }
@@ -151,7 +127,7 @@ export interface CountResponse {
151
127
  /**
152
128
  * Options for list queries (API request format)
153
129
  */
154
- export interface ListOptions {
130
+ export interface ListOptionsType {
155
131
  /** Query type (defaults to "List") */
156
132
  Type?: "List";
157
133
 
@@ -159,10 +135,10 @@ export interface ListOptions {
159
135
  Field?: string[];
160
136
 
161
137
  /** Filter criteria */
162
- Filter?: Filter;
138
+ Filter?: FilterType;
163
139
 
164
140
  /** Sort configuration */
165
- Sort?: Sort;
141
+ Sort?: SortType;
166
142
 
167
143
  /** Search query (separate from filters) */
168
144
  Search?: string;
@@ -181,7 +157,7 @@ export interface ListOptions {
181
157
  /**
182
158
  * Metric aggregation function types
183
159
  */
184
- export type MetricType =
160
+ export type MetricTypeType =
185
161
  | "Sum"
186
162
  | "Avg"
187
163
  | "Count"
@@ -196,31 +172,31 @@ export type MetricType =
196
172
  /**
197
173
  * Metric field configuration
198
174
  */
199
- export interface MetricField {
175
+ export interface MetricFieldType {
200
176
  /** Field to aggregate */
201
177
  Field: string;
202
178
  /** Aggregation function type */
203
- Type: MetricType;
179
+ Type: MetricTypeType;
204
180
  }
205
181
 
206
182
  /**
207
183
  * Options for metric/aggregate queries
208
184
  */
209
- export interface MetricOptions {
185
+ export interface MetricOptionsType {
210
186
  /** Query type (always "Metric") */
211
187
  Type: "Metric";
212
188
  /** Fields to group by */
213
189
  GroupBy: string[];
214
190
  /** Metric definitions */
215
- Metric: MetricField[];
191
+ Metric: MetricFieldType[];
216
192
  /** Optional filter criteria */
217
- Filter?: Filter;
193
+ Filter?: FilterType;
218
194
  }
219
195
 
220
196
  /**
221
197
  * Response from metric endpoint
222
198
  */
223
- export interface MetricResponse {
199
+ export interface MetricResponseType {
224
200
  /** Aggregated data rows */
225
201
  Data: Record<string, any>[];
226
202
  }
@@ -232,21 +208,21 @@ export interface MetricResponse {
232
208
  /**
233
209
  * Pivot table header item (hierarchical)
234
210
  */
235
- export interface PivotHeaderItem {
211
+ export interface PivotHeaderItemType {
236
212
  /** Header key/label */
237
213
  Key: string;
238
214
  /** Child headers for nested grouping */
239
- Children?: PivotHeaderItem[] | null;
215
+ Children?: PivotHeaderItemType[] | null;
240
216
  }
241
217
 
242
218
  /**
243
219
  * Pivot response data structure
244
220
  */
245
- export interface PivotResponseData {
221
+ export interface PivotResponseDataType {
246
222
  /** Row headers */
247
- RowHeader: PivotHeaderItem[];
223
+ RowHeader: PivotHeaderItemType[];
248
224
  /** Column headers */
249
- ColumnHeader: PivotHeaderItem[];
225
+ ColumnHeader: PivotHeaderItemType[];
250
226
  /** Value matrix [row][column] */
251
227
  Value: (number | string | null)[][];
252
228
  }
@@ -254,7 +230,7 @@ export interface PivotResponseData {
254
230
  /**
255
231
  * Options for pivot queries
256
232
  */
257
- export interface PivotOptions {
233
+ export interface PivotOptionsType {
258
234
  /** Query type (always "Pivot") */
259
235
  Type: "Pivot";
260
236
  /** Row dimension fields */
@@ -262,17 +238,17 @@ export interface PivotOptions {
262
238
  /** Column dimension fields */
263
239
  Column: string[];
264
240
  /** Metric definitions */
265
- Metric: MetricField[];
241
+ Metric: MetricFieldType[];
266
242
  /** Optional filter criteria */
267
- Filter?: Filter;
243
+ Filter?: FilterType;
268
244
  }
269
245
 
270
246
  /**
271
247
  * Response from pivot endpoint
272
248
  */
273
- export interface PivotResponse {
249
+ export interface PivotResponseType {
274
250
  /** Pivot data including headers and values */
275
- Data: PivotResponseData;
251
+ Data: PivotResponseDataType;
276
252
  }
277
253
 
278
254
  // ============================================================
@@ -282,7 +258,7 @@ export interface PivotResponse {
282
258
  /**
283
259
  * Response from draft operations
284
260
  */
285
- export interface DraftResponse {
261
+ export interface DraftResponseType {
286
262
  /** Computed field values */
287
263
  [fieldName: string]: any;
288
264
  }
@@ -294,7 +270,7 @@ export interface DraftResponse {
294
270
  /**
295
271
  * Response from fields endpoint
296
272
  */
297
- export interface FieldsResponse {
273
+ export interface FieldsResponseType {
298
274
  /** Field metadata */
299
275
  Data: Record<string, any>[];
300
276
  }
@@ -306,7 +282,7 @@ export interface FieldsResponse {
306
282
  /**
307
283
  * Single option returned from fetch field endpoint
308
284
  */
309
- export interface FetchFieldOption {
285
+ export interface FetchFieldOptionType {
310
286
  /** The value to be stored */
311
287
  Value: string;
312
288
  /** The display label */
@@ -316,7 +292,7 @@ export interface FetchFieldOption {
316
292
  /**
317
293
  * Response from fetch field endpoint
318
294
  */
319
- export interface FetchFieldResponse {
295
+ export interface FetchFieldResponseType {
320
296
  /** Array of field options */
321
- Data: FetchFieldOption[];
322
- }
297
+ Data: FetchFieldOptionType[];
298
+ }
@@ -2,4 +2,4 @@
2
2
  export * from './base-fields';
3
3
 
4
4
  // Common API types
5
- export * from './common';
5
+ export * from './common';
@@ -1,4 +1,4 @@
1
- import type { CurrencyValue, JSONValue } from '../types/base-fields';
1
+ import type { CurrencyValueType, JSONValueType } from '../types/base-fields';
2
2
 
3
3
  /**
4
4
  * Data formatting utilities for display and conversion
@@ -7,7 +7,7 @@ import type { CurrencyValue, JSONValue } from '../types/base-fields';
7
7
  /**
8
8
  * Format currency value for display
9
9
  */
10
- export function formatCurrency(value: CurrencyValue): string {
10
+ export function formatCurrency(value: CurrencyValueType): string {
11
11
  if (typeof value === 'string') {
12
12
  return value; // Already formatted
13
13
  }
@@ -26,7 +26,7 @@ export function formatCurrency(value: CurrencyValue): string {
26
26
  /**
27
27
  * Parse currency string to currency object
28
28
  */
29
- export function parseCurrency(value: string): CurrencyValue | null {
29
+ export function parseCurrency(value: string): CurrencyValueType | null {
30
30
  // Try to parse "USD 100.50" or "100.50 USD" format
31
31
  const match = value.match(/^(?:([A-Z]{3})\s+(\d+\.?\d*))|(?:(\d+\.?\d*)\s+([A-Z]{3}))$/);
32
32
 
@@ -90,7 +90,7 @@ export function formatNumber(value: number, precision: number = 2): string {
90
90
  /**
91
91
  * Format JSON value for display
92
92
  */
93
- export function formatJSON(value: JSONValue, indent: number = 2): string {
93
+ export function formatJSON(value: JSONValueType, indent: number = 2): string {
94
94
  try {
95
95
  return JSON.stringify(value, null, indent);
96
96
  } catch {
package/sdk/utils.ts ADDED
@@ -0,0 +1,10 @@
1
+ // ============================================================
2
+ // UTILS MODULE - Main Entry Point
3
+ // @ram_28/kf-ai-sdk/utils
4
+ // ============================================================
5
+
6
+ // Formatting utilities
7
+ export * from './utils/formatting';
8
+
9
+ // Class name utilities
10
+ export * from './utils/cn';