@ram_28/kf-ai-sdk 1.0.11 → 1.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.
Files changed (195) 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 +2355 -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 +1060 -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/useQuery-BScHEo7x.cjs +1 -0
  135. package/dist/useQuery-KpZFg80c.js +748 -0
  136. package/dist/utils/formatting.d.ts +4 -4
  137. package/dist/utils/formatting.d.ts.map +1 -1
  138. package/dist/utils.cjs +4 -0
  139. package/dist/utils.d.ts +3 -0
  140. package/dist/utils.d.ts.map +1 -0
  141. package/dist/utils.mjs +105 -0
  142. package/package.json +147 -9
  143. package/sdk/api/client.ts +51 -51
  144. package/sdk/api/datetime.ts +5 -5
  145. package/sdk/api/index.ts +28 -33
  146. package/sdk/api/metadata.ts +4 -4
  147. package/sdk/api.ts +24 -0
  148. package/sdk/api.types.ts +58 -0
  149. package/sdk/auth/AuthProvider.tsx +18 -18
  150. package/sdk/auth/authClient.ts +9 -9
  151. package/sdk/auth/authConfig.ts +9 -9
  152. package/sdk/auth/index.ts +5 -5
  153. package/sdk/auth/types.ts +21 -21
  154. package/sdk/auth/useAuth.ts +2 -2
  155. package/sdk/auth.ts +22 -0
  156. package/sdk/auth.types.ts +28 -0
  157. package/sdk/base-types.ts +45 -0
  158. package/sdk/components/hooks/index.ts +22 -22
  159. package/sdk/components/hooks/useFilter/index.ts +8 -14
  160. package/sdk/components/hooks/useFilter/types.ts +29 -58
  161. package/sdk/components/hooks/useFilter/useFilter.ts +41 -44
  162. package/sdk/components/hooks/useForm/apiClient.ts +8 -8
  163. package/sdk/components/hooks/useForm/expressionValidator.utils.ts +18 -18
  164. package/sdk/components/hooks/useForm/index.ts +24 -24
  165. package/sdk/components/hooks/useForm/optimizedExpressionValidator.utils.ts +22 -22
  166. package/sdk/components/hooks/useForm/ruleClassifier.utils.ts +26 -62
  167. package/sdk/components/hooks/useForm/schemaParser.utils.ts +24 -24
  168. package/sdk/components/hooks/useForm/types.ts +66 -82
  169. package/sdk/components/hooks/useForm/useForm.ts +15 -21
  170. package/sdk/components/hooks/useKanban/apiClient.ts +54 -54
  171. package/sdk/components/hooks/useKanban/context.ts +3 -3
  172. package/sdk/components/hooks/useKanban/dragDropManager.ts +19 -19
  173. package/sdk/components/hooks/useKanban/index.ts +26 -26
  174. package/sdk/components/hooks/useKanban/types.ts +69 -71
  175. package/sdk/components/hooks/useKanban/useKanban.ts +43 -51
  176. package/sdk/components/hooks/useKanban/useKanbanSimple.ts +4 -4
  177. package/sdk/components/hooks/useTable/index.ts +5 -1
  178. package/sdk/components/hooks/useTable/types.ts +10 -10
  179. package/sdk/components/hooks/useTable/useTable.ts +10 -10
  180. package/sdk/filter.ts +13 -0
  181. package/sdk/filter.types.ts +17 -0
  182. package/sdk/form.ts +15 -0
  183. package/sdk/form.types.ts +46 -0
  184. package/sdk/kanban.ts +23 -0
  185. package/sdk/kanban.types.ts +50 -0
  186. package/sdk/kanban.ui.ts +16 -0
  187. package/sdk/table.ts +7 -0
  188. package/sdk/table.types.ts +13 -0
  189. package/sdk/types/base-fields.ts +47 -47
  190. package/sdk/types/common.ts +47 -71
  191. package/sdk/types/index.ts +1 -1
  192. package/sdk/utils/formatting.ts +4 -4
  193. package/sdk/utils.ts +10 -0
  194. package/dist/index.cjs +0 -45
  195. package/dist/index.mjs +0 -6387
@@ -0,0 +1,233 @@
1
+ let o = {
2
+ baseUrl: "",
3
+ headers: {
4
+ "Content-Type": "application/json"
5
+ }
6
+ };
7
+ function u(e) {
8
+ o.baseUrl = e;
9
+ }
10
+ function h(e) {
11
+ o.headers = { ...o.headers, ...e };
12
+ }
13
+ function d() {
14
+ return { ...o.headers };
15
+ }
16
+ function y() {
17
+ return o.baseUrl || "";
18
+ }
19
+ function i(e) {
20
+ if (e == null)
21
+ return e;
22
+ if (Array.isArray(e))
23
+ return e.map((s) => i(s));
24
+ if (typeof e == "object") {
25
+ if ("$__dt__" in e)
26
+ return new Date(e.$__dt__ * 1e3);
27
+ if ("$__d__" in e)
28
+ return new Date(e.$__d__);
29
+ const s = {};
30
+ for (const [n, t] of Object.entries(e))
31
+ s[n] = i(t);
32
+ return s;
33
+ }
34
+ return e;
35
+ }
36
+ function w(e) {
37
+ const s = o.baseUrl, n = o.headers;
38
+ return {
39
+ async get(t) {
40
+ const r = await fetch(`${s}/api/app/${e}/${t}/read`, {
41
+ method: "GET",
42
+ headers: n
43
+ });
44
+ if (!r.ok)
45
+ throw new Error(`Failed to get ${e} ${t}: ${r.statusText}`);
46
+ const a = await r.json();
47
+ return i(a.Data);
48
+ },
49
+ async create(t) {
50
+ const r = await fetch(`${s}/api/app/${e}/create`, {
51
+ method: "POST",
52
+ headers: n,
53
+ body: JSON.stringify(t)
54
+ });
55
+ if (!r.ok)
56
+ throw new Error(`Failed to create ${e}: ${r.statusText}`);
57
+ return r.json();
58
+ },
59
+ async update(t, r) {
60
+ const a = await fetch(`${s}/api/app/${e}/${t}/update`, {
61
+ method: "POST",
62
+ headers: n,
63
+ body: JSON.stringify(r)
64
+ });
65
+ if (!a.ok)
66
+ throw new Error(
67
+ `Failed to update ${e} ${t}: ${a.statusText}`
68
+ );
69
+ return a.json();
70
+ },
71
+ async delete(t) {
72
+ const r = await fetch(`${s}/api/app/${e}/${t}/delete`, {
73
+ method: "DELETE",
74
+ headers: n
75
+ });
76
+ if (!r.ok)
77
+ throw new Error(
78
+ `Failed to delete ${e} ${t}: ${r.statusText}`
79
+ );
80
+ return r.json();
81
+ },
82
+ async list(t) {
83
+ const r = {
84
+ Type: "List",
85
+ ...t
86
+ }, a = await fetch(`${s}/api/app/${e}/list`, {
87
+ method: "POST",
88
+ headers: n,
89
+ body: JSON.stringify(r)
90
+ });
91
+ if (!a.ok)
92
+ throw new Error(`Failed to list ${e}: ${a.statusText}`);
93
+ return {
94
+ Data: (await a.json()).Data.map((f) => i(f))
95
+ };
96
+ },
97
+ async count(t) {
98
+ var p, $;
99
+ const r = {
100
+ Type: "Metric",
101
+ GroupBy: [],
102
+ Metric: [{ Field: "_id", Type: "Count" }],
103
+ ...(t == null ? void 0 : t.Filter) && { Filter: t.Filter }
104
+ }, a = await fetch(`${s}/api/app/${e}/metric`, {
105
+ method: "POST",
106
+ headers: n,
107
+ body: JSON.stringify(r)
108
+ });
109
+ if (!a.ok)
110
+ throw new Error(`Failed to count ${e}: ${a.statusText}`);
111
+ return { Count: (($ = (p = (await a.json()).Data) == null ? void 0 : p[0]) == null ? void 0 : $.count__id) ?? 0 };
112
+ },
113
+ // ============================================================
114
+ // DRAFT/INTERACTIVE OPERATIONS
115
+ // ============================================================
116
+ async draft(t) {
117
+ const r = await fetch(`${s}/api/app/${e}/draft`, {
118
+ method: "POST",
119
+ headers: n,
120
+ body: JSON.stringify(t)
121
+ });
122
+ if (!r.ok)
123
+ throw new Error(
124
+ `Failed to create draft for ${e}: ${r.statusText}`
125
+ );
126
+ return r.json();
127
+ },
128
+ async draftUpdate(t, r) {
129
+ const a = await fetch(`${s}/api/app/${e}/${t}/draft`, {
130
+ method: "POST",
131
+ headers: n,
132
+ body: JSON.stringify(r)
133
+ });
134
+ if (!a.ok)
135
+ throw new Error(
136
+ `Failed to update draft for ${e} ${t}: ${a.statusText}`
137
+ );
138
+ return a.json();
139
+ },
140
+ async draftPatch(t, r) {
141
+ const a = await fetch(`${s}/api/app/${e}/${t}/draft`, {
142
+ method: "PATCH",
143
+ headers: n,
144
+ body: JSON.stringify(r)
145
+ });
146
+ if (!a.ok)
147
+ throw new Error(
148
+ `Failed to patch draft for ${e} ${t}: ${a.statusText}`
149
+ );
150
+ return a.json();
151
+ },
152
+ async draftInteraction(t) {
153
+ const r = await fetch(`${s}/api/app/${e}/draft`, {
154
+ method: "PATCH",
155
+ headers: n,
156
+ body: JSON.stringify(t)
157
+ });
158
+ if (!r.ok)
159
+ throw new Error(
160
+ `Failed to create interactive draft for ${e}: ${r.statusText}`
161
+ );
162
+ return r.json();
163
+ },
164
+ // ============================================================
165
+ // QUERY OPERATIONS
166
+ // ============================================================
167
+ async metric(t) {
168
+ const r = {
169
+ Type: "Metric",
170
+ ...t
171
+ }, a = await fetch(`${s}/api/app/${e}/metric`, {
172
+ method: "POST",
173
+ headers: n,
174
+ body: JSON.stringify(r)
175
+ });
176
+ if (!a.ok)
177
+ throw new Error(
178
+ `Failed to get metrics for ${e}: ${a.statusText}`
179
+ );
180
+ return a.json();
181
+ },
182
+ async pivot(t) {
183
+ const r = {
184
+ Type: "Pivot",
185
+ ...t
186
+ }, a = await fetch(`${s}/api/app/${e}/pivot`, {
187
+ method: "POST",
188
+ headers: n,
189
+ body: JSON.stringify(r)
190
+ });
191
+ if (!a.ok)
192
+ throw new Error(
193
+ `Failed to get pivot data for ${e}: ${a.statusText}`
194
+ );
195
+ return a.json();
196
+ },
197
+ // ============================================================
198
+ // METADATA OPERATIONS
199
+ // ============================================================
200
+ async fields() {
201
+ const t = await fetch(`${s}/api/app/${e}/fields`, {
202
+ method: "GET",
203
+ headers: n
204
+ });
205
+ if (!t.ok)
206
+ throw new Error(
207
+ `Failed to get fields for ${e}: ${t.statusText}`
208
+ );
209
+ return t.json();
210
+ },
211
+ async fetchField(t, r) {
212
+ const a = await fetch(
213
+ `${s}/api/app/${e}/${t}/field/${r}/fetch`,
214
+ {
215
+ method: "GET",
216
+ headers: n
217
+ }
218
+ );
219
+ if (!a.ok)
220
+ throw new Error(
221
+ `Failed to fetch field ${r} for ${e}: ${a.statusText}`
222
+ );
223
+ return (await a.json()).Data;
224
+ }
225
+ };
226
+ }
227
+ export {
228
+ w as a,
229
+ h as b,
230
+ y as c,
231
+ d as g,
232
+ u as s
233
+ };