@ram_28/kf-ai-sdk 2.0.14 → 2.0.16

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 (157) hide show
  1. package/README.md +10 -9
  2. package/dist/FileField-BWrSHNRq.js +296 -0
  3. package/dist/FileField-eDeuzln8.cjs +1 -0
  4. package/dist/api.cjs +1 -1
  5. package/dist/api.mjs +2 -2
  6. package/dist/auth.cjs +1 -1
  7. package/dist/auth.mjs +1 -1
  8. package/dist/bdo/core/BaseBdo.d.ts +1 -1
  9. package/dist/bdo.cjs +1 -1
  10. package/dist/bdo.mjs +230 -474
  11. package/dist/{client-DnO2KKrw.cjs → client-D5k4SYuw.cjs} +1 -1
  12. package/dist/{client-iQTqFDNI.js → client-_ayziI1d.js} +33 -32
  13. package/dist/components/hooks/index.d.ts +9 -3
  14. package/dist/components/hooks/index.d.ts.map +1 -1
  15. package/dist/{workflow/components → components/hooks}/useActivityForm/createActivityItemProxy.d.ts +9 -5
  16. package/dist/components/hooks/useActivityForm/createActivityItemProxy.d.ts.map +1 -0
  17. package/dist/components/hooks/useActivityForm/createActivityResolver.d.ts +23 -0
  18. package/dist/components/hooks/useActivityForm/createActivityResolver.d.ts.map +1 -0
  19. package/dist/components/hooks/useActivityForm/index.d.ts.map +1 -0
  20. package/dist/{workflow/components → components/hooks}/useActivityForm/types.d.ts +12 -8
  21. package/dist/components/hooks/useActivityForm/types.d.ts.map +1 -0
  22. package/dist/{workflow/components → components/hooks}/useActivityForm/useActivityForm.d.ts +2 -2
  23. package/dist/components/hooks/useActivityForm/useActivityForm.d.ts.map +1 -0
  24. package/dist/components/hooks/useActivityTable/index.d.ts +4 -0
  25. package/dist/components/hooks/useActivityTable/index.d.ts.map +1 -0
  26. package/dist/components/hooks/useActivityTable/types.d.ts +36 -0
  27. package/dist/components/hooks/useActivityTable/types.d.ts.map +1 -0
  28. package/dist/components/hooks/useActivityTable/useActivityTable.d.ts +4 -0
  29. package/dist/components/hooks/useActivityTable/useActivityTable.d.ts.map +1 -0
  30. package/dist/components/hooks/useBDOForm/createItemProxy.d.ts.map +1 -0
  31. package/dist/components/hooks/useBDOForm/createResolver.d.ts.map +1 -0
  32. package/dist/components/hooks/useBDOForm/index.d.ts +6 -0
  33. package/dist/components/hooks/useBDOForm/index.d.ts.map +1 -0
  34. package/dist/components/hooks/useBDOForm/shared.d.ts +50 -0
  35. package/dist/components/hooks/useBDOForm/shared.d.ts.map +1 -0
  36. package/dist/components/hooks/{useForm → useBDOForm}/types.d.ts +6 -6
  37. package/dist/components/hooks/useBDOForm/types.d.ts.map +1 -0
  38. package/dist/components/hooks/{useForm/useForm.d.ts → useBDOForm/useBDOForm.d.ts} +4 -4
  39. package/dist/components/hooks/useBDOForm/useBDOForm.d.ts.map +1 -0
  40. package/dist/components/hooks/useBDOTable/index.d.ts +3 -0
  41. package/dist/components/hooks/useBDOTable/index.d.ts.map +1 -0
  42. package/dist/components/hooks/useBDOTable/types.d.ts +24 -0
  43. package/dist/components/hooks/useBDOTable/types.d.ts.map +1 -0
  44. package/dist/components/hooks/useBDOTable/useBDOTable.d.ts +3 -0
  45. package/dist/components/hooks/useBDOTable/useBDOTable.d.ts.map +1 -0
  46. package/dist/components/hooks/useTable/index.d.ts +2 -2
  47. package/dist/components/hooks/useTable/index.d.ts.map +1 -1
  48. package/dist/components/hooks/useTable/types.d.ts +11 -10
  49. package/dist/components/hooks/useTable/types.d.ts.map +1 -1
  50. package/dist/components/hooks/useTable/useTable.d.ts +1 -1
  51. package/dist/components/hooks/useTable/useTable.d.ts.map +1 -1
  52. package/dist/form.cjs +1 -1
  53. package/dist/form.d.ts +1 -1
  54. package/dist/form.d.ts.map +1 -1
  55. package/dist/form.mjs +279 -344
  56. package/dist/form.types.d.ts +1 -1
  57. package/dist/form.types.d.ts.map +1 -1
  58. package/dist/{metadata-DpfI3zRN.js → metadata-Cc1mBcLS.js} +1 -1
  59. package/dist/{metadata-DgLSJkF5.cjs → metadata-DWXQPDav.cjs} +1 -1
  60. package/dist/shared-5a7UkED1.js +1180 -0
  61. package/dist/shared-nnmlRVs7.cjs +1 -0
  62. package/dist/table.cjs +1 -1
  63. package/dist/table.d.ts +1 -0
  64. package/dist/table.d.ts.map +1 -1
  65. package/dist/table.mjs +17 -192
  66. package/dist/table.types.d.ts +2 -1
  67. package/dist/table.types.d.ts.map +1 -1
  68. package/dist/types/base-fields.d.ts +4 -4
  69. package/dist/types/base-fields.d.ts.map +1 -1
  70. package/dist/types/constants.d.ts +3 -3
  71. package/dist/useTable-CeRklbdT.cjs +1 -0
  72. package/dist/useTable-DS0-WInw.js +203 -0
  73. package/dist/workflow/Activity.d.ts +19 -7
  74. package/dist/workflow/Activity.d.ts.map +1 -1
  75. package/dist/workflow/client.d.ts +2 -2
  76. package/dist/workflow/client.d.ts.map +1 -1
  77. package/dist/workflow/createFieldFromMeta.d.ts +29 -0
  78. package/dist/workflow/createFieldFromMeta.d.ts.map +1 -0
  79. package/dist/workflow/index.d.ts +1 -2
  80. package/dist/workflow/index.d.ts.map +1 -1
  81. package/dist/workflow/types.d.ts +16 -12
  82. package/dist/workflow/types.d.ts.map +1 -1
  83. package/dist/workflow.cjs +1 -1
  84. package/dist/workflow.d.ts +5 -2
  85. package/dist/workflow.d.ts.map +1 -1
  86. package/dist/workflow.mjs +687 -352
  87. package/dist/workflow.types.d.ts +1 -0
  88. package/dist/workflow.types.d.ts.map +1 -1
  89. package/docs/bdo.md +1 -1
  90. package/docs/gaps.md +360 -0
  91. package/docs/useActivityForm.md +393 -0
  92. package/docs/useActivityTable.md +418 -0
  93. package/docs/{useForm.md → useBDOForm.md} +24 -24
  94. package/docs/useBDOTable.md +284 -0
  95. package/docs/workflow.md +148 -297
  96. package/package.json +2 -2
  97. package/sdk/bdo/core/BaseBdo.ts +2 -2
  98. package/sdk/bdo/fields/UserField.ts +1 -1
  99. package/sdk/components/hooks/index.ts +28 -5
  100. package/sdk/components/hooks/useActivityForm/createActivityItemProxy.ts +400 -0
  101. package/sdk/components/hooks/useActivityForm/createActivityResolver.ts +87 -0
  102. package/sdk/{workflow/components → components/hooks}/useActivityForm/types.ts +24 -11
  103. package/sdk/components/hooks/useActivityForm/useActivityForm.ts +478 -0
  104. package/sdk/components/hooks/useActivityTable/index.ts +8 -0
  105. package/sdk/components/hooks/useActivityTable/types.ts +47 -0
  106. package/sdk/components/hooks/useActivityTable/useActivityTable.ts +40 -0
  107. package/sdk/components/hooks/{useForm → useBDOForm}/index.ts +4 -3
  108. package/sdk/components/hooks/useBDOForm/shared.ts +250 -0
  109. package/sdk/components/hooks/{useForm → useBDOForm}/types.ts +9 -9
  110. package/sdk/components/hooks/{useForm/useForm.ts → useBDOForm/useBDOForm.ts} +70 -96
  111. package/sdk/components/hooks/useBDOTable/index.ts +2 -0
  112. package/sdk/components/hooks/useBDOTable/types.ts +22 -0
  113. package/sdk/components/hooks/useBDOTable/useBDOTable.ts +16 -0
  114. package/sdk/components/hooks/useTable/index.ts +3 -3
  115. package/sdk/components/hooks/useTable/types.ts +16 -12
  116. package/sdk/components/hooks/useTable/useTable.ts +56 -49
  117. package/sdk/form.ts +2 -2
  118. package/sdk/form.types.ts +4 -4
  119. package/sdk/table.ts +4 -1
  120. package/sdk/table.types.ts +7 -4
  121. package/sdk/types/base-fields.ts +4 -4
  122. package/sdk/types/constants.ts +3 -3
  123. package/sdk/workflow/Activity.ts +36 -12
  124. package/sdk/workflow/client.ts +65 -12
  125. package/sdk/workflow/createFieldFromMeta.ts +110 -0
  126. package/sdk/workflow/index.ts +1 -6
  127. package/sdk/workflow/types.ts +20 -11
  128. package/sdk/workflow.ts +11 -2
  129. package/sdk/workflow.types.ts +7 -0
  130. package/dist/BaseField-B6da88U7.js +0 -40
  131. package/dist/BaseField-Drp0-OxL.cjs +0 -1
  132. package/dist/components/hooks/useForm/createItemProxy.d.ts.map +0 -1
  133. package/dist/components/hooks/useForm/createResolver.d.ts.map +0 -1
  134. package/dist/components/hooks/useForm/index.d.ts +0 -5
  135. package/dist/components/hooks/useForm/index.d.ts.map +0 -1
  136. package/dist/components/hooks/useForm/types.d.ts.map +0 -1
  137. package/dist/components/hooks/useForm/useForm.d.ts.map +0 -1
  138. package/dist/error-handling-CAoD0Kwb.cjs +0 -1
  139. package/dist/error-handling-CrhTtD88.js +0 -14
  140. package/dist/index.esm-Cj63v5ny.js +0 -1014
  141. package/dist/index.esm-DuwT11sx.cjs +0 -1
  142. package/dist/workflow/components/useActivityForm/createActivityItemProxy.d.ts.map +0 -1
  143. package/dist/workflow/components/useActivityForm/createActivityResolver.d.ts +0 -22
  144. package/dist/workflow/components/useActivityForm/createActivityResolver.d.ts.map +0 -1
  145. package/dist/workflow/components/useActivityForm/index.d.ts.map +0 -1
  146. package/dist/workflow/components/useActivityForm/types.d.ts.map +0 -1
  147. package/dist/workflow/components/useActivityForm/useActivityForm.d.ts.map +0 -1
  148. package/docs/useTable.md +0 -369
  149. package/sdk/workflow/components/useActivityForm/createActivityItemProxy.ts +0 -130
  150. package/sdk/workflow/components/useActivityForm/createActivityResolver.ts +0 -61
  151. package/sdk/workflow/components/useActivityForm/useActivityForm.ts +0 -386
  152. /package/dist/{workflow/components → components/hooks}/useActivityForm/index.d.ts +0 -0
  153. /package/dist/components/hooks/{useForm → useBDOForm}/createItemProxy.d.ts +0 -0
  154. /package/dist/components/hooks/{useForm → useBDOForm}/createResolver.d.ts +0 -0
  155. /package/sdk/{workflow/components → components/hooks}/useActivityForm/index.ts +0 -0
  156. /package/sdk/components/hooks/{useForm → useBDOForm}/createItemProxy.ts +0 -0
  157. /package/sdk/components/hooks/{useForm → useBDOForm}/createResolver.ts +0 -0
@@ -1,2 +1,3 @@
1
1
  export type { ActivityInstanceFieldsType, ActivityOperations, ActivityProgressType, WorkflowStartResponseType, } from './workflow/types';
2
+ export type { UseActivityTableOptionsType, UseActivityTableReturnType, ActivityTableStatusType, ActivityRowType, } from './components/hooks/useActivityTable/types';
2
3
  //# sourceMappingURL=workflow.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.types.d.ts","sourceRoot":"","sources":["../sdk/workflow.types.ts"],"names":[],"mappings":"AAKA,YAAY,EACV,0BAA0B,EAC1B,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"workflow.types.d.ts","sourceRoot":"","sources":["../sdk/workflow.types.ts"],"names":[],"mappings":"AAKA,YAAY,EACV,0BAA0B,EAC1B,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACV,2BAA2B,EAC3B,0BAA0B,EAC1B,uBAAuB,EACvB,eAAe,GAChB,MAAM,2CAA2C,CAAC"}
package/docs/bdo.md CHANGED
@@ -125,7 +125,7 @@ product.product_name.defaultValue // unknown
125
125
 
126
126
  | Class | Extra Getters | Notes |
127
127
  |-------|--------------|-------|
128
- | `StringField` | `length` | May have `Constraint.Enum` — see useForm Mistake #3 |
128
+ | `StringField` | `length` | May have `Constraint.Enum` — see useBDOForm Mistake #3 |
129
129
  | `NumberField` | `integerPart`, `fractionPart` | |
130
130
  | `BooleanField` | — | |
131
131
  | `DateField` | — | Format: YYYY-MM-DD |
package/docs/gaps.md ADDED
@@ -0,0 +1,360 @@
1
+ # Documentation Gaps — Critical Issues
2
+
3
+ Audit of all 8 docs against the source code. Only **critical** issues listed (wrong code, broken imports, missing major features).
4
+
5
+ ---
6
+
7
+ ## docs/api.md
8
+
9
+ ### 1. Most API client methods are undocumented
10
+
11
+ The doc only covers `get`, `list`, `create`, `update`, `delete`. These 13 methods are completely missing:
12
+
13
+ | Method | Return Type |
14
+ |--------|------------|
15
+ | `count(options?)` | `CountResponseType` |
16
+ | `draft(data)` | `DraftResponseType` |
17
+ | `draftUpdate(id, data)` | `CreateUpdateResponseType` |
18
+ | `draftPatch(id, data)` | `DraftResponseType` |
19
+ | `draftInteraction(data)` | `DraftResponseType & { _id: string }` |
20
+ | `metric(options)` | `MetricResponseType` |
21
+ | `pivot(options)` | `PivotResponseType` |
22
+ | `fields()` | `FieldsResponseType` |
23
+ | `fetchField(instanceId, fieldId)` | `TResult[]` |
24
+ | `getUploadUrl(instanceId, fieldId, files)` | `FileUploadResponseType[]` |
25
+ | `getDownloadUrl(instanceId, fieldId, attachmentId, viewType?)` | `FileDownloadResponseType` |
26
+ | `getDownloadUrls(instanceId, fieldId, viewType?)` | `FileDownloadResponseType[]` |
27
+ | `deleteAttachment(instanceId, fieldId, attachmentId)` | `void` |
28
+
29
+ **Source**: `sdk/api/client.ts` lines 28-167 (`ResourceClientType` interface)
30
+
31
+ ### 2. API configuration functions are undocumented
32
+
33
+ The most fundamental setup step — telling the SDK where the API lives — is not documented:
34
+
35
+ ```typescript
36
+ // These are exported from @ram_28/kf-ai-sdk/api but not in the doc
37
+ setApiBaseUrl(url: string): void
38
+ getApiBaseUrl(): string
39
+ setDefaultHeaders(headers: Record<string, string>): void
40
+ getDefaultHeaders(): Record<string, string>
41
+ ```
42
+
43
+ **Source**: `sdk/api/client.ts` lines 190-213, `sdk/api.ts` lines 9-13
44
+
45
+ ---
46
+
47
+ ## docs/bdo.md
48
+
49
+ ### 3. `ArrayField` and `ObjectField` missing from field classes table
50
+
51
+ Two entire field classes are undocumented:
52
+
53
+ - `ArrayField<T>` — has `elementType` getter (returns `BaseFieldMetaType | undefined`)
54
+ - `ObjectField<T>` — has `properties` getter (returns `Record<string, unknown> | undefined`)
55
+
56
+ **Source**: `sdk/bdo/fields/ArrayField.ts`, `sdk/bdo/fields/ObjectField.ts`
57
+
58
+ ### 4. `draftUpdate` method undocumented
59
+
60
+ Protected CRUD method on `BaseBdo` that commits changes on an existing draft record:
61
+
62
+ ```typescript
63
+ protected async draftUpdate(id: string, data: Partial<TEditable>): Promise<CreateUpdateResponseType>
64
+ ```
65
+
66
+ **Source**: `sdk/bdo/core/BaseBdo.ts` lines 275-280
67
+
68
+ ### 5. File/Image attachment methods on Item accessors are undocumented
69
+
70
+ When an Item field is Image or File type, the accessor gets enriched with attachment methods. None are documented:
71
+
72
+ **Image field accessor (editable)**:
73
+ - `upload(file: File): Promise<FileType>`
74
+ - `getDownloadUrl(viewType?): Promise<FileDownloadResponseType>`
75
+ - `deleteAttachment(): Promise<void>`
76
+
77
+ **Image field accessor (readonly)**:
78
+ - `getDownloadUrl(viewType?): Promise<FileDownloadResponseType>`
79
+
80
+ **File field accessor (editable)**:
81
+ - `upload(files: File[]): Promise<FileType[]>`
82
+ - `getDownloadUrl(attachmentId, viewType?): Promise<FileDownloadResponseType>`
83
+ - `getDownloadUrls(viewType?): Promise<FileDownloadResponseType[]>`
84
+ - `deleteAttachment(attachmentId): Promise<void>`
85
+
86
+ **File field accessor (readonly)**:
87
+ - `getDownloadUrl(attachmentId, viewType?): Promise<FileDownloadResponseType>`
88
+ - `getDownloadUrls(viewType?): Promise<FileDownloadResponseType[]>`
89
+
90
+ **Source**: `sdk/bdo/core/types.ts` lines 194-235, `sdk/bdo/core/Item.ts` lines 293-463
91
+
92
+ ---
93
+
94
+ ## docs/useBDOForm.md
95
+
96
+ ### 6. `UseBDOFormOptionsType` missing 3 feature flags
97
+
98
+ All three variants of the options type are missing these properties:
99
+
100
+ ```typescript
101
+ enableDraft?: boolean; // default: false (currently unused internally)
102
+ enableConstraintValidation?: boolean; // default: true (required, length, etc.)
103
+ enableExpressionValidation?: boolean; // default: true (backend expression rules)
104
+ ```
105
+
106
+ **Source**: `sdk/components/hooks/useBDOForm/types.ts` lines 90-123
107
+
108
+ ### 7. `UseBDOFormReturnType` missing ~half its properties
109
+
110
+ These properties are returned by the hook but not in the doc:
111
+
112
+ | Property | Type |
113
+ |----------|------|
114
+ | `bdo` | `B` (the BDO reference) |
115
+ | `operation` | `"create" \| "update"` |
116
+ | `recordId` | `string \| undefined` |
117
+ | `reset` | `UseFormReset` |
118
+ | `trigger` | `UseFormTrigger` |
119
+ | `isValid` | `boolean` |
120
+ | `isSubmitSuccessful` | `boolean` |
121
+ | `dirtyFields` | `Partial<Record<keyof AllFieldsType<B>, boolean>>` |
122
+ | `isFetching` | `boolean` (separate from isLoading) |
123
+ | `draftId` | `string \| undefined` |
124
+ | `isCreatingDraft` | `boolean` |
125
+
126
+ **Source**: `sdk/components/hooks/useBDOForm/types.ts` lines 190-232, `sdk/components/hooks/useBDOForm/useBDOForm.ts` lines 320-352
127
+
128
+ ### 8. `handleSubmit` behavior is wrong — doc says `bdo.create()`/`bdo.update()`, actual uses `api()` directly
129
+
130
+ The doc says handleSubmit "auto-calls `bdo.create()` or `bdo.update()`". The actual implementation:
131
+
132
+ ```typescript
133
+ // Create mode — uses api().draft(), NOT bdo.create()
134
+ filteredData._id = draftData?._id;
135
+ result = await api(bdo.meta._id).draft(filteredData);
136
+
137
+ // Update mode — uses api().update() directly, NOT bdo.update()
138
+ result = await api(bdo.meta._id).update(recordId!, filteredData);
139
+ ```
140
+
141
+ **Source**: `sdk/components/hooks/useBDOForm/useBDOForm.ts` lines 296-301
142
+
143
+ ### 9. Draft mode is completely undocumented
144
+
145
+ The entire draft-based creation flow is absent from the doc:
146
+
147
+ 1. On form open (create mode), a draft is auto-created via `api().draftInteraction({})`
148
+ 2. The draft `_id` is set into the form via `form.setValue("_id", draftData._id)`
149
+ 3. Dirty fields are auto-patched to the draft on change (800ms debounce)
150
+ 4. On submit, `api().draft(filteredData)` is called with the draft `_id`
151
+ 5. `isLoading` reflects `isCreatingDraft` state
152
+ 6. `draftId` and `isCreatingDraft` are returned
153
+
154
+ **Source**: `sdk/components/hooks/useBDOForm/useBDOForm.ts` lines 125-138, 186-190, 222-261, 296-298
155
+
156
+ ---
157
+
158
+ ## docs/useBDOTable.md
159
+
160
+ ### 10. `RHSType` import path is broken — will fail at build time
161
+
162
+ The doc shows:
163
+ ```typescript
164
+ import { ConditionOperator, RHSType } from "@ram_28/kf-ai-sdk/filter";
165
+ ```
166
+
167
+ `RHSType` is **not** exported from the filter module under that name. It is renamed to `FilterValueSource` on export:
168
+
169
+ ```typescript
170
+ // sdk/filter.ts
171
+ export { RHSType as FilterValueSource } from './types/constants';
172
+ ```
173
+
174
+ `RHSType` IS exported (under its original name) from `@ram_28/kf-ai-sdk/table`:
175
+ ```typescript
176
+ // sdk/table.ts
177
+ export { ConditionOperator, RHSType } from './types/constants';
178
+ ```
179
+
180
+ The complete example at line 121 has the same broken import, so the entire example won't compile.
181
+
182
+ **Source**: `sdk/filter.ts` line 19, `sdk/table.ts` line 17
183
+
184
+ ---
185
+
186
+ ## docs/useActivityTable.md
187
+
188
+ *No remaining critical gaps — #11 (GET endpoints ignoring options) was resolved when list/metric endpoints were switched to POST.*
189
+
190
+ ---
191
+
192
+ ## docs/useFilter.md
193
+
194
+ ### 13. `updateGroupOperator` method missing from `UseFilterReturnType`
195
+
196
+ Fully implemented and exported, but absent from the documented return type:
197
+
198
+ ```typescript
199
+ updateGroupOperator: (id: string, operator: ConditionGroupOperatorType) => void;
200
+ ```
201
+
202
+ Allows updating the operator ("And"/"Or"/"Not") of a nested condition group by ID.
203
+
204
+ **Source**: `sdk/components/hooks/useFilter/types.ts` lines 122-127, `sdk/components/hooks/useFilter/useFilter.ts` lines 241-253
205
+
206
+ ### 14. `getCondition` method missing from `UseFilterReturnType`
207
+
208
+ Fully implemented and exported, but absent from the documented return type:
209
+
210
+ ```typescript
211
+ getCondition: (id: string) => ConditionType<T> | ConditionGroupType<T> | undefined;
212
+ ```
213
+
214
+ Looks up a condition or condition group by ID — essential for dynamic filter UIs.
215
+
216
+ **Source**: `sdk/components/hooks/useFilter/types.ts` lines 139-144, `sdk/components/hooks/useFilter/useFilter.ts` lines 263-268
217
+
218
+ ---
219
+
220
+ ## docs/useAuth.md
221
+
222
+ ### 15. `login()` parameter types are wrong
223
+
224
+ Doc shows:
225
+ ```typescript
226
+ login: (provider?: string, options?: { callbackUrl?: string }) => void;
227
+ ```
228
+
229
+ Actual:
230
+ ```typescript
231
+ login: (provider?: AuthProviderNameType, options?: LoginOptionsType) => void;
232
+ // AuthProviderNameType = "google" | "microsoft" | "github" | "custom"
233
+ // LoginOptionsType = { callbackUrl?: string; params?: Record<string, string> }
234
+ ```
235
+
236
+ The `provider` is constrained to a union (not open `string`), and `options` has a `params` property the doc omits.
237
+
238
+ **Source**: `sdk/auth/types.ts` line 170, lines 32, 118-123
239
+
240
+ ### 16. `refreshSession` return type is `Promise<any>` — should be `Promise<SessionResponseType | null>`
241
+
242
+ Doc shows:
243
+ ```typescript
244
+ refreshSession: () => Promise<any>;
245
+ ```
246
+
247
+ Actual:
248
+ ```typescript
249
+ refreshSession: () => Promise<SessionResponseType | null>;
250
+ // SessionResponseType = { userDetails: UserDetailsType; staticBaseUrl: string; buildId: string }
251
+ ```
252
+
253
+ **Source**: `sdk/auth/types.ts` line 181, `sdk/auth/AuthProvider.tsx` lines 167-168
254
+
255
+ ### 17. `AuthProvider` props completely undocumented
256
+
257
+ `AuthProviderPropsType` has 7 props — none are documented or shown in any example:
258
+
259
+ ```typescript
260
+ interface AuthProviderPropsType {
261
+ children: React.ReactNode;
262
+ config?: Partial<AuthConfigType>;
263
+ onAuthChange?: (status: AuthStatusType, user: UserDetailsType | null) => void;
264
+ onError?: (error: Error) => void;
265
+ loadingComponent?: React.ReactNode;
266
+ unauthenticatedComponent?: React.ReactNode;
267
+ skipInitialCheck?: boolean;
268
+ }
269
+ ```
270
+
271
+ **Source**: `sdk/auth/types.ts` lines 93-113
272
+
273
+ ### 18. `AuthConfigType` and `configureAuth()` completely undocumented
274
+
275
+ The entire auth configuration system is exported but absent from docs:
276
+
277
+ ```typescript
278
+ // Exported from @ram_28/kf-ai-sdk/auth
279
+ configureAuth(config: Partial<AuthConfigType>): void
280
+ getAuthConfig(): AuthConfigType
281
+ setAuthProvider(provider: AuthProviderNameType): void
282
+ getAuthBaseUrl(): string
283
+ resetAuthConfig(): void
284
+ ```
285
+
286
+ `AuthConfigType` has 12 properties (session endpoint, providers map, default provider, auto-redirect, login redirect URL, callback URL, session check interval, retry config, stale time, refetch on focus, refetch on reconnect, base URL).
287
+
288
+ **Source**: `sdk/auth/authConfig.ts`, `sdk/auth.ts` lines 16-22
289
+
290
+ ### 19. `QueryClientProvider` requirement not documented
291
+
292
+ `AuthProvider` calls `useQueryClient()` from `@tanstack/react-query`. A `QueryClientProvider` must wrap `AuthProvider`, or users get a runtime error on mount. No setup/bootstrap example exists.
293
+
294
+ **Source**: `sdk/auth/AuthProvider.tsx` lines 15-16, 64
295
+
296
+ ---
297
+
298
+ ## docs/workflow.md
299
+
300
+ ### 20. `BPInstanceId` missing from `ActivityInstanceFieldsType`
301
+
302
+ Doc shows 4 fields. Source has 5:
303
+
304
+ ```typescript
305
+ type ActivityInstanceFieldsType = {
306
+ _id: StringFieldType;
307
+ BPInstanceId: StringFieldType; // <-- MISSING from doc
308
+ Status: SelectFieldType<"InProgress" | "Completed">;
309
+ AssignedTo: UserFieldType[];
310
+ CompletedAt: DateTimeFieldType;
311
+ };
312
+ ```
313
+
314
+ Also missing from the "ActivityInstance System Fields Reference" table at the bottom of the doc.
315
+
316
+ **Source**: `sdk/workflow/types.ts` lines 49-55
317
+
318
+ ### ~~21. List/metric endpoints use GET, not POST — options are ignored~~
319
+
320
+ **RESOLVED**: All four list/metric endpoints now use POST with proper request bodies. Count methods construct `{ Type: "Metric", Metric: [{Field: "_id", Type: "Count"}] }` and transform the response correctly.
321
+
322
+ ### 23. `activity.Field.meta.label` and `activity.Field.meta.id` don't exist
323
+
324
+ All form examples use `activity.StartDate.meta.label` and `activity.StartDate.meta.id`. These return `undefined` because `BaseFieldMetaType` has `_id` and `Name`, not `id` and `label`:
325
+
326
+ ```typescript
327
+ // BaseFieldMetaType has:
328
+ _id: string; // NOT "id"
329
+ Name: string; // NOT "label"
330
+
331
+ // The convenience getters are on BaseField itself:
332
+ activity.StartDate.id // works (BaseField getter)
333
+ activity.StartDate.label // works (BaseField getter)
334
+ activity.StartDate.meta._id // works (raw meta)
335
+ activity.StartDate.meta.Name // works (raw meta)
336
+
337
+ // But the doc uses:
338
+ activity.StartDate.meta.id // undefined
339
+ activity.StartDate.meta.label // undefined
340
+ ```
341
+
342
+ This affects **every** `register()` call and `<label>` in the doc's examples — they all pass `undefined`.
343
+
344
+ **Source**: `sdk/bdo/fields/BaseField.ts` lines 24-27, `sdk/bdo/core/types.ts` lines 35-43
345
+
346
+ ---
347
+
348
+ ## Summary
349
+
350
+ | Doc | Critical Count |
351
+ |-----|---------------|
352
+ | api.md | 2 |
353
+ | bdo.md | 3 |
354
+ | useBDOForm.md | 4 |
355
+ | useBDOTable.md | 1 |
356
+ | useActivityTable.md | 0 (resolved) |
357
+ | useFilter.md | 2 |
358
+ | useAuth.md | 5 |
359
+ | workflow.md | 2 |
360
+ | **Total** | **19** |