@ram_28/kf-ai-sdk 2.0.14 → 2.0.15
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.
- package/README.md +2 -1
- package/dist/FileField-BWrSHNRq.js +296 -0
- package/dist/FileField-eDeuzln8.cjs +1 -0
- package/dist/api.cjs +1 -1
- package/dist/api.mjs +2 -2
- package/dist/auth.cjs +1 -1
- package/dist/auth.mjs +1 -1
- package/dist/bdo.cjs +1 -1
- package/dist/bdo.mjs +228 -472
- package/dist/{client-DnO2KKrw.cjs → client-D5k4SYuw.cjs} +1 -1
- package/dist/{client-iQTqFDNI.js → client-_ayziI1d.js} +33 -32
- package/dist/components/hooks/index.d.ts +9 -3
- package/dist/components/hooks/index.d.ts.map +1 -1
- package/dist/{workflow/components → components/hooks}/useActivityForm/createActivityItemProxy.d.ts +9 -5
- package/dist/components/hooks/useActivityForm/createActivityItemProxy.d.ts.map +1 -0
- package/dist/components/hooks/useActivityForm/createActivityResolver.d.ts +23 -0
- package/dist/components/hooks/useActivityForm/createActivityResolver.d.ts.map +1 -0
- package/dist/components/hooks/useActivityForm/index.d.ts.map +1 -0
- package/dist/{workflow/components → components/hooks}/useActivityForm/types.d.ts +11 -7
- package/dist/components/hooks/useActivityForm/types.d.ts.map +1 -0
- package/dist/{workflow/components → components/hooks}/useActivityForm/useActivityForm.d.ts +2 -2
- package/dist/components/hooks/useActivityForm/useActivityForm.d.ts.map +1 -0
- package/dist/components/hooks/useActivityTable/index.d.ts +4 -0
- package/dist/components/hooks/useActivityTable/index.d.ts.map +1 -0
- package/dist/components/hooks/useActivityTable/types.d.ts +36 -0
- package/dist/components/hooks/useActivityTable/types.d.ts.map +1 -0
- package/dist/components/hooks/useActivityTable/useActivityTable.d.ts +4 -0
- package/dist/components/hooks/useActivityTable/useActivityTable.d.ts.map +1 -0
- package/dist/components/hooks/useBDOTable/index.d.ts +3 -0
- package/dist/components/hooks/useBDOTable/index.d.ts.map +1 -0
- package/dist/components/hooks/useBDOTable/types.d.ts +26 -0
- package/dist/components/hooks/useBDOTable/types.d.ts.map +1 -0
- package/dist/components/hooks/useBDOTable/useBDOTable.d.ts +3 -0
- package/dist/components/hooks/useBDOTable/useBDOTable.d.ts.map +1 -0
- package/dist/components/hooks/useTable/index.d.ts +2 -2
- package/dist/components/hooks/useTable/index.d.ts.map +1 -1
- package/dist/components/hooks/useTable/types.d.ts +11 -10
- package/dist/components/hooks/useTable/types.d.ts.map +1 -1
- package/dist/components/hooks/useTable/useTable.d.ts +1 -1
- package/dist/components/hooks/useTable/useTable.d.ts.map +1 -1
- package/dist/createResolver-AIgUwoS6.cjs +1 -0
- package/dist/createResolver-ZHXQ7QMa.js +1078 -0
- package/dist/form.cjs +1 -1
- package/dist/form.mjs +252 -314
- package/dist/{metadata-DpfI3zRN.js → metadata-Cc1mBcLS.js} +1 -1
- package/dist/{metadata-DgLSJkF5.cjs → metadata-DWXQPDav.cjs} +1 -1
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts +1 -0
- package/dist/table.d.ts.map +1 -1
- package/dist/table.mjs +16 -192
- package/dist/table.types.d.ts +2 -1
- package/dist/table.types.d.ts.map +1 -1
- package/dist/types/base-fields.d.ts +4 -4
- package/dist/types/base-fields.d.ts.map +1 -1
- package/dist/useTable-CeRklbdT.cjs +1 -0
- package/dist/useTable-DS0-WInw.js +203 -0
- package/dist/workflow/Activity.d.ts +9 -9
- package/dist/workflow/Activity.d.ts.map +1 -1
- package/dist/workflow/client.d.ts.map +1 -1
- package/dist/workflow/createFieldFromMeta.d.ts +29 -0
- package/dist/workflow/createFieldFromMeta.d.ts.map +1 -0
- package/dist/workflow/index.d.ts +1 -2
- package/dist/workflow/index.d.ts.map +1 -1
- package/dist/workflow/types.d.ts +12 -12
- package/dist/workflow/types.d.ts.map +1 -1
- package/dist/workflow.cjs +1 -1
- package/dist/workflow.d.ts +5 -2
- package/dist/workflow.d.ts.map +1 -1
- package/dist/workflow.mjs +716 -338
- package/dist/workflow.types.d.ts +1 -0
- package/dist/workflow.types.d.ts.map +1 -1
- package/docs/gaps.md +410 -0
- package/docs/useActivityTable.md +481 -0
- package/docs/useBDOTable.md +317 -0
- package/docs/workflow.md +143 -34
- package/package.json +1 -1
- package/sdk/bdo/fields/UserField.ts +1 -1
- package/sdk/components/hooks/index.ts +28 -5
- package/sdk/components/hooks/useActivityForm/createActivityItemProxy.ts +400 -0
- package/sdk/components/hooks/useActivityForm/createActivityResolver.ts +87 -0
- package/sdk/{workflow/components → components/hooks}/useActivityForm/types.ts +21 -8
- package/sdk/components/hooks/useActivityForm/useActivityForm.ts +628 -0
- package/sdk/components/hooks/useActivityTable/index.ts +8 -0
- package/sdk/components/hooks/useActivityTable/types.ts +45 -0
- package/sdk/components/hooks/useActivityTable/useActivityTable.ts +71 -0
- package/sdk/components/hooks/useBDOTable/index.ts +2 -0
- package/sdk/components/hooks/useBDOTable/types.ts +24 -0
- package/sdk/components/hooks/useBDOTable/useBDOTable.ts +15 -0
- package/sdk/components/hooks/useTable/index.ts +3 -3
- package/sdk/components/hooks/useTable/types.ts +16 -12
- package/sdk/components/hooks/useTable/useTable.ts +56 -49
- package/sdk/table.ts +4 -1
- package/sdk/table.types.ts +7 -4
- package/sdk/types/base-fields.ts +4 -4
- package/sdk/workflow/Activity.ts +14 -13
- package/sdk/workflow/client.ts +21 -8
- package/sdk/workflow/createFieldFromMeta.ts +110 -0
- package/sdk/workflow/index.ts +1 -6
- package/sdk/workflow/types.ts +13 -12
- package/sdk/workflow.ts +11 -2
- package/sdk/workflow.types.ts +7 -0
- package/dist/BaseField-B6da88U7.js +0 -40
- package/dist/BaseField-Drp0-OxL.cjs +0 -1
- package/dist/error-handling-CAoD0Kwb.cjs +0 -1
- package/dist/error-handling-CrhTtD88.js +0 -14
- package/dist/index.esm-Cj63v5ny.js +0 -1014
- package/dist/index.esm-DuwT11sx.cjs +0 -1
- package/dist/workflow/components/useActivityForm/createActivityItemProxy.d.ts.map +0 -1
- package/dist/workflow/components/useActivityForm/createActivityResolver.d.ts +0 -22
- package/dist/workflow/components/useActivityForm/createActivityResolver.d.ts.map +0 -1
- package/dist/workflow/components/useActivityForm/index.d.ts.map +0 -1
- package/dist/workflow/components/useActivityForm/types.d.ts.map +0 -1
- package/dist/workflow/components/useActivityForm/useActivityForm.d.ts.map +0 -1
- package/docs/useTable.md +0 -369
- package/sdk/workflow/components/useActivityForm/createActivityItemProxy.ts +0 -130
- package/sdk/workflow/components/useActivityForm/createActivityResolver.ts +0 -61
- package/sdk/workflow/components/useActivityForm/useActivityForm.ts +0 -386
- /package/dist/{workflow/components → components/hooks}/useActivityForm/index.d.ts +0 -0
- /package/sdk/{workflow/components → components/hooks}/useActivityForm/index.ts +0 -0
package/dist/workflow.types.d.ts
CHANGED
|
@@ -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/gaps.md
ADDED
|
@@ -0,0 +1,410 @@
|
|
|
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/useForm.md
|
|
95
|
+
|
|
96
|
+
### 6. `UseFormOptionsType` 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/useForm/types.ts` lines 90-123
|
|
107
|
+
|
|
108
|
+
### 7. `UseFormReturnType` 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/useForm/types.ts` lines 190-232, `sdk/components/hooks/useForm/useForm.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/useForm/useForm.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/useForm/useForm.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
|
+
### 11. `ActivityRowType` has `{ ADO: E }` but API returns flat data
|
|
189
|
+
|
|
190
|
+
The type definition wraps entity fields under `ADO`:
|
|
191
|
+
```typescript
|
|
192
|
+
// sdk/components/hooks/useActivityTable/types.ts
|
|
193
|
+
type ActivityRowType<A> = ActivityInstanceFieldsType & { ADO: E }
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
But the API returns flat data (no `ADO` wrapper):
|
|
197
|
+
```typescript
|
|
198
|
+
// sdk/workflow/Activity.ts
|
|
199
|
+
async getInProgressList(): Promise<ListResponseType<ActivityInstanceFieldsType & TEntity>>
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
`useActivityTable` passes raw API data to `useTable` with **no transformation** — so runtime data is flat. All doc examples using `row.ADO.StartDate` may fail at runtime.
|
|
203
|
+
|
|
204
|
+
**Source**: `sdk/components/hooks/useActivityTable/types.ts` lines 22-25, `sdk/workflow/Activity.ts` line 130, `sdk/components/hooks/useActivityTable/index.ts` lines 19-40
|
|
205
|
+
|
|
206
|
+
### 12. Search, sort, filter, and pagination are non-functional
|
|
207
|
+
|
|
208
|
+
The backend currently only supports GET for activity list/metric endpoints. The `_options` parameter (underscore prefix = unused) is ignored in all four methods:
|
|
209
|
+
|
|
210
|
+
```typescript
|
|
211
|
+
// sdk/workflow/client.ts
|
|
212
|
+
// TODO: Backend currently only supports GET for list/metric endpoints.
|
|
213
|
+
async inProgressList(_options?: ListOptionsType): Promise<...> {
|
|
214
|
+
const response = await fetch(`${url}/inprogress/list`, {
|
|
215
|
+
method: "GET", // NOT POST — options are ignored
|
|
216
|
+
headers: getDefaultHeaders(),
|
|
217
|
+
});
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
The doc presents search, sort, filter, and pagination as working features with full examples, but none of these have any effect on the data returned.
|
|
221
|
+
|
|
222
|
+
**Source**: `sdk/workflow/client.ts` lines 112-164
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## docs/useFilter.md
|
|
227
|
+
|
|
228
|
+
### 13. `updateGroupOperator` method missing from `UseFilterReturnType`
|
|
229
|
+
|
|
230
|
+
Fully implemented and exported, but absent from the documented return type:
|
|
231
|
+
|
|
232
|
+
```typescript
|
|
233
|
+
updateGroupOperator: (id: string, operator: ConditionGroupOperatorType) => void;
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
Allows updating the operator ("And"/"Or"/"Not") of a nested condition group by ID.
|
|
237
|
+
|
|
238
|
+
**Source**: `sdk/components/hooks/useFilter/types.ts` lines 122-127, `sdk/components/hooks/useFilter/useFilter.ts` lines 241-253
|
|
239
|
+
|
|
240
|
+
### 14. `getCondition` method missing from `UseFilterReturnType`
|
|
241
|
+
|
|
242
|
+
Fully implemented and exported, but absent from the documented return type:
|
|
243
|
+
|
|
244
|
+
```typescript
|
|
245
|
+
getCondition: (id: string) => ConditionType<T> | ConditionGroupType<T> | undefined;
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
Looks up a condition or condition group by ID — essential for dynamic filter UIs.
|
|
249
|
+
|
|
250
|
+
**Source**: `sdk/components/hooks/useFilter/types.ts` lines 139-144, `sdk/components/hooks/useFilter/useFilter.ts` lines 263-268
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
## docs/useAuth.md
|
|
255
|
+
|
|
256
|
+
### 15. `login()` parameter types are wrong
|
|
257
|
+
|
|
258
|
+
Doc shows:
|
|
259
|
+
```typescript
|
|
260
|
+
login: (provider?: string, options?: { callbackUrl?: string }) => void;
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
Actual:
|
|
264
|
+
```typescript
|
|
265
|
+
login: (provider?: AuthProviderNameType, options?: LoginOptionsType) => void;
|
|
266
|
+
// AuthProviderNameType = "google" | "microsoft" | "github" | "custom"
|
|
267
|
+
// LoginOptionsType = { callbackUrl?: string; params?: Record<string, string> }
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
The `provider` is constrained to a union (not open `string`), and `options` has a `params` property the doc omits.
|
|
271
|
+
|
|
272
|
+
**Source**: `sdk/auth/types.ts` line 170, lines 32, 118-123
|
|
273
|
+
|
|
274
|
+
### 16. `refreshSession` return type is `Promise<any>` — should be `Promise<SessionResponseType | null>`
|
|
275
|
+
|
|
276
|
+
Doc shows:
|
|
277
|
+
```typescript
|
|
278
|
+
refreshSession: () => Promise<any>;
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
Actual:
|
|
282
|
+
```typescript
|
|
283
|
+
refreshSession: () => Promise<SessionResponseType | null>;
|
|
284
|
+
// SessionResponseType = { userDetails: UserDetailsType; staticBaseUrl: string; buildId: string }
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
**Source**: `sdk/auth/types.ts` line 181, `sdk/auth/AuthProvider.tsx` lines 167-168
|
|
288
|
+
|
|
289
|
+
### 17. `AuthProvider` props completely undocumented
|
|
290
|
+
|
|
291
|
+
`AuthProviderPropsType` has 7 props — none are documented or shown in any example:
|
|
292
|
+
|
|
293
|
+
```typescript
|
|
294
|
+
interface AuthProviderPropsType {
|
|
295
|
+
children: React.ReactNode;
|
|
296
|
+
config?: Partial<AuthConfigType>;
|
|
297
|
+
onAuthChange?: (status: AuthStatusType, user: UserDetailsType | null) => void;
|
|
298
|
+
onError?: (error: Error) => void;
|
|
299
|
+
loadingComponent?: React.ReactNode;
|
|
300
|
+
unauthenticatedComponent?: React.ReactNode;
|
|
301
|
+
skipInitialCheck?: boolean;
|
|
302
|
+
}
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
**Source**: `sdk/auth/types.ts` lines 93-113
|
|
306
|
+
|
|
307
|
+
### 18. `AuthConfigType` and `configureAuth()` completely undocumented
|
|
308
|
+
|
|
309
|
+
The entire auth configuration system is exported but absent from docs:
|
|
310
|
+
|
|
311
|
+
```typescript
|
|
312
|
+
// Exported from @ram_28/kf-ai-sdk/auth
|
|
313
|
+
configureAuth(config: Partial<AuthConfigType>): void
|
|
314
|
+
getAuthConfig(): AuthConfigType
|
|
315
|
+
setAuthProvider(provider: AuthProviderNameType): void
|
|
316
|
+
getAuthBaseUrl(): string
|
|
317
|
+
resetAuthConfig(): void
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
`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).
|
|
321
|
+
|
|
322
|
+
**Source**: `sdk/auth/authConfig.ts`, `sdk/auth.ts` lines 16-22
|
|
323
|
+
|
|
324
|
+
### 19. `QueryClientProvider` requirement not documented
|
|
325
|
+
|
|
326
|
+
`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.
|
|
327
|
+
|
|
328
|
+
**Source**: `sdk/auth/AuthProvider.tsx` lines 15-16, 64
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
## docs/workflow.md
|
|
333
|
+
|
|
334
|
+
### 20. `BPInstanceId` missing from `ActivityInstanceFieldsType`
|
|
335
|
+
|
|
336
|
+
Doc shows 4 fields. Source has 5:
|
|
337
|
+
|
|
338
|
+
```typescript
|
|
339
|
+
type ActivityInstanceFieldsType = {
|
|
340
|
+
_id: StringFieldType;
|
|
341
|
+
BPInstanceId: StringFieldType; // <-- MISSING from doc
|
|
342
|
+
Status: SelectFieldType<"InProgress" | "Completed">;
|
|
343
|
+
AssignedTo: UserFieldType[];
|
|
344
|
+
CompletedAt: DateTimeFieldType;
|
|
345
|
+
};
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
Also missing from the "ActivityInstance System Fields Reference" table at the bottom of the doc.
|
|
349
|
+
|
|
350
|
+
**Source**: `sdk/workflow/types.ts` lines 49-55
|
|
351
|
+
|
|
352
|
+
### 21. `getInProgressList()` / `getCompletedList()` return flat data, not ADO-nested
|
|
353
|
+
|
|
354
|
+
Doc examples use `item.ADO.StartDate` — this would fail at runtime. The API returns `ActivityInstanceFieldsType & TEntity` (flat):
|
|
355
|
+
|
|
356
|
+
```typescript
|
|
357
|
+
// Correct access
|
|
358
|
+
item.StartDate // not item.ADO.StartDate
|
|
359
|
+
|
|
360
|
+
// The ADO nesting only exists in ActivityRowType (useActivityTable hook type)
|
|
361
|
+
// NOT in the raw getInProgressList() / getCompletedList() responses
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
**Source**: `sdk/workflow/Activity.ts` line 130
|
|
365
|
+
|
|
366
|
+
### 22. List/metric endpoints use GET, not POST — options are ignored
|
|
367
|
+
|
|
368
|
+
Same issue as #12. The doc's "Filtering Reference" section claims POST with `ListOptionsType` body works. It does not — all four methods use GET and ignore options.
|
|
369
|
+
|
|
370
|
+
**Source**: `sdk/workflow/client.ts` lines 112-164
|
|
371
|
+
|
|
372
|
+
### 23. `activity.Field.meta.label` and `activity.Field.meta.id` don't exist
|
|
373
|
+
|
|
374
|
+
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`:
|
|
375
|
+
|
|
376
|
+
```typescript
|
|
377
|
+
// BaseFieldMetaType has:
|
|
378
|
+
_id: string; // NOT "id"
|
|
379
|
+
Name: string; // NOT "label"
|
|
380
|
+
|
|
381
|
+
// The convenience getters are on BaseField itself:
|
|
382
|
+
activity.StartDate.id // works (BaseField getter)
|
|
383
|
+
activity.StartDate.label // works (BaseField getter)
|
|
384
|
+
activity.StartDate.meta._id // works (raw meta)
|
|
385
|
+
activity.StartDate.meta.Name // works (raw meta)
|
|
386
|
+
|
|
387
|
+
// But the doc uses:
|
|
388
|
+
activity.StartDate.meta.id // undefined
|
|
389
|
+
activity.StartDate.meta.label // undefined
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
This affects **every** `register()` call and `<label>` in the doc's examples — they all pass `undefined`.
|
|
393
|
+
|
|
394
|
+
**Source**: `sdk/bdo/fields/BaseField.ts` lines 24-27, `sdk/bdo/core/types.ts` lines 35-43
|
|
395
|
+
|
|
396
|
+
---
|
|
397
|
+
|
|
398
|
+
## Summary
|
|
399
|
+
|
|
400
|
+
| Doc | Critical Count |
|
|
401
|
+
|-----|---------------|
|
|
402
|
+
| api.md | 2 |
|
|
403
|
+
| bdo.md | 3 |
|
|
404
|
+
| useForm.md | 4 |
|
|
405
|
+
| useBDOTable.md | 1 |
|
|
406
|
+
| useActivityTable.md | 2 |
|
|
407
|
+
| useFilter.md | 2 |
|
|
408
|
+
| useAuth.md | 5 |
|
|
409
|
+
| workflow.md | 4 |
|
|
410
|
+
| **Total** | **23** |
|