@knowledge-stack/ksapi 1.80.1 → 1.82.0

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 (89) hide show
  1. package/.openapi-generator/FILES +6 -0
  2. package/README.md +8 -2
  3. package/dist/apis/UsersApi.d.ts +130 -1
  4. package/dist/apis/UsersApi.js +130 -0
  5. package/dist/apis/WorkflowDefinitionsApi.d.ts +4 -1
  6. package/dist/apis/WorkflowDefinitionsApi.js +2 -0
  7. package/dist/esm/apis/UsersApi.d.ts +130 -1
  8. package/dist/esm/apis/UsersApi.js +131 -1
  9. package/dist/esm/apis/WorkflowDefinitionsApi.d.ts +4 -1
  10. package/dist/esm/apis/WorkflowDefinitionsApi.js +2 -0
  11. package/dist/esm/models/CreateWorkflowDefinitionRequest.d.ts +8 -1
  12. package/dist/esm/models/CreateWorkflowDefinitionRequest.js +1 -4
  13. package/dist/esm/models/InstructionSnapshot.d.ts +71 -0
  14. package/dist/esm/models/InstructionSnapshot.js +57 -0
  15. package/dist/esm/models/InvokeWorkflowRequest.d.ts +6 -0
  16. package/dist/esm/models/InvokeWorkflowRequest.js +6 -0
  17. package/dist/esm/models/OnboardingCompanyRequest.d.ts +53 -0
  18. package/dist/esm/models/OnboardingCompanyRequest.js +51 -0
  19. package/dist/esm/models/OnboardingProfileRequest.d.ts +59 -0
  20. package/dist/esm/models/OnboardingProfileRequest.js +50 -0
  21. package/dist/esm/models/TenantSettingsResponse.d.ts +6 -0
  22. package/dist/esm/models/TenantSettingsResponse.js +2 -0
  23. package/dist/esm/models/TenantSettingsUpdate.d.ts +6 -0
  24. package/dist/esm/models/TenantSettingsUpdate.js +10 -1
  25. package/dist/esm/models/UpdateWorkflowDefinitionRequest.d.ts +6 -1
  26. package/dist/esm/models/UserResponse.d.ts +12 -0
  27. package/dist/esm/models/UserResponse.js +4 -0
  28. package/dist/esm/models/WorkflowRunResponse.d.ts +17 -0
  29. package/dist/esm/models/WorkflowRunResponse.js +8 -0
  30. package/dist/esm/models/WorkflowRunSnapshot.d.ts +3 -2
  31. package/dist/esm/models/WorkflowRunSnapshot.js +3 -2
  32. package/dist/esm/models/WorkflowRunnerType.d.ts +1 -0
  33. package/dist/esm/models/WorkflowRunnerType.js +2 -1
  34. package/dist/esm/models/index.d.ts +3 -0
  35. package/dist/esm/models/index.js +3 -0
  36. package/dist/models/CreateWorkflowDefinitionRequest.d.ts +8 -1
  37. package/dist/models/CreateWorkflowDefinitionRequest.js +1 -4
  38. package/dist/models/InstructionSnapshot.d.ts +71 -0
  39. package/dist/models/InstructionSnapshot.js +65 -0
  40. package/dist/models/InvokeWorkflowRequest.d.ts +6 -0
  41. package/dist/models/InvokeWorkflowRequest.js +6 -0
  42. package/dist/models/OnboardingCompanyRequest.d.ts +53 -0
  43. package/dist/models/OnboardingCompanyRequest.js +59 -0
  44. package/dist/models/OnboardingProfileRequest.d.ts +59 -0
  45. package/dist/models/OnboardingProfileRequest.js +58 -0
  46. package/dist/models/TenantSettingsResponse.d.ts +6 -0
  47. package/dist/models/TenantSettingsResponse.js +2 -0
  48. package/dist/models/TenantSettingsUpdate.d.ts +6 -0
  49. package/dist/models/TenantSettingsUpdate.js +10 -1
  50. package/dist/models/UpdateWorkflowDefinitionRequest.d.ts +6 -1
  51. package/dist/models/UserResponse.d.ts +12 -0
  52. package/dist/models/UserResponse.js +4 -0
  53. package/dist/models/WorkflowRunResponse.d.ts +17 -0
  54. package/dist/models/WorkflowRunResponse.js +8 -0
  55. package/dist/models/WorkflowRunSnapshot.d.ts +3 -2
  56. package/dist/models/WorkflowRunSnapshot.js +3 -2
  57. package/dist/models/WorkflowRunnerType.d.ts +1 -0
  58. package/dist/models/WorkflowRunnerType.js +2 -1
  59. package/dist/models/index.d.ts +3 -0
  60. package/dist/models/index.js +3 -0
  61. package/docs/CreateWorkflowDefinitionRequest.md +1 -1
  62. package/docs/InstructionSnapshot.md +41 -0
  63. package/docs/InvokeWorkflowRequest.md +2 -0
  64. package/docs/OnboardingCompanyRequest.md +37 -0
  65. package/docs/OnboardingProfileRequest.md +39 -0
  66. package/docs/TenantSettingsResponse.md +2 -0
  67. package/docs/TenantSettingsUpdate.md +2 -0
  68. package/docs/UpdateWorkflowDefinitionRequest.md +1 -1
  69. package/docs/UserResponse.md +4 -0
  70. package/docs/UsersApi.md +222 -0
  71. package/docs/WorkflowDefinitionsApi.md +2 -0
  72. package/docs/WorkflowRunResponse.md +5 -1
  73. package/docs/WorkflowRunSnapshot.md +1 -1
  74. package/package.json +1 -1
  75. package/src/apis/UsersApi.ts +254 -0
  76. package/src/apis/WorkflowDefinitionsApi.ts +4 -1
  77. package/src/models/CreateWorkflowDefinitionRequest.ts +9 -4
  78. package/src/models/InstructionSnapshot.ts +125 -0
  79. package/src/models/InvokeWorkflowRequest.ts +12 -0
  80. package/src/models/OnboardingCompanyRequest.ts +96 -0
  81. package/src/models/OnboardingProfileRequest.ts +101 -0
  82. package/src/models/TenantSettingsResponse.ts +8 -0
  83. package/src/models/TenantSettingsUpdate.ts +14 -0
  84. package/src/models/UpdateWorkflowDefinitionRequest.ts +6 -1
  85. package/src/models/UserResponse.ts +16 -0
  86. package/src/models/WorkflowRunResponse.ts +23 -0
  87. package/src/models/WorkflowRunSnapshot.ts +11 -4
  88. package/src/models/WorkflowRunnerType.ts +2 -1
  89. package/src/models/index.ts +3 -0
package/docs/UsersApi.md CHANGED
@@ -5,7 +5,10 @@ All URIs are relative to *http://localhost:8000*
5
5
  | Method | HTTP request | Description |
6
6
  |------------- | ------------- | -------------|
7
7
  | [**getMe**](UsersApi.md#getme) | **GET** /v1/users/me | Get Me Handler |
8
+ | [**skipOnboarding**](UsersApi.md#skiponboarding) | **POST** /v1/users/me/onboarding/skip | Skip Onboarding Handler |
8
9
  | [**updateMe**](UsersApi.md#updateme) | **PATCH** /v1/users | Update Me Handler |
10
+ | [**updateOnboardingCompany**](UsersApi.md#updateonboardingcompany) | **PATCH** /v1/users/me/onboarding/company | Update Onboarding Company Handler |
11
+ | [**updateOnboardingProfile**](UsersApi.md#updateonboardingprofile) | **PATCH** /v1/users/me/onboarding/profile | Update Onboarding Profile Handler |
9
12
 
10
13
 
11
14
 
@@ -80,6 +83,77 @@ No authorization required
80
83
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
81
84
 
82
85
 
86
+ ## skipOnboarding
87
+
88
+ > UserResponse skipOnboarding(authorization, ksUat)
89
+
90
+ Skip Onboarding Handler
91
+
92
+ Mark onboarding complete without writing any profile/company fields. Idempotent — calling this after onboarding is already complete returns the current state unchanged (the CRUD only stamps the timestamp when it is NULL).
93
+
94
+ ### Example
95
+
96
+ ```ts
97
+ import {
98
+ Configuration,
99
+ UsersApi,
100
+ } from '@knowledge-stack/ksapi';
101
+ import type { SkipOnboardingRequest } from '@knowledge-stack/ksapi';
102
+
103
+ async function example() {
104
+ console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
105
+ const api = new UsersApi();
106
+
107
+ const body = {
108
+ // string (optional)
109
+ authorization: authorization_example,
110
+ // string (optional)
111
+ ksUat: ksUat_example,
112
+ } satisfies SkipOnboardingRequest;
113
+
114
+ try {
115
+ const data = await api.skipOnboarding(body);
116
+ console.log(data);
117
+ } catch (error) {
118
+ console.error(error);
119
+ }
120
+ }
121
+
122
+ // Run the test
123
+ example().catch(console.error);
124
+ ```
125
+
126
+ ### Parameters
127
+
128
+
129
+ | Name | Type | Description | Notes |
130
+ |------------- | ------------- | ------------- | -------------|
131
+ | **authorization** | `string` | | [Optional] [Defaults to `undefined`] |
132
+ | **ksUat** | `string` | | [Optional] [Defaults to `undefined`] |
133
+
134
+ ### Return type
135
+
136
+ [**UserResponse**](UserResponse.md)
137
+
138
+ ### Authorization
139
+
140
+ No authorization required
141
+
142
+ ### HTTP request headers
143
+
144
+ - **Content-Type**: Not defined
145
+ - **Accept**: `application/json`
146
+
147
+
148
+ ### HTTP response details
149
+ | Status code | Description | Response headers |
150
+ |-------------|-------------|------------------|
151
+ | **200** | Successful Response | - |
152
+ | **422** | Validation Error | - |
153
+
154
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
155
+
156
+
83
157
  ## updateMe
84
158
 
85
159
  > UserResponse updateMe(updateUserRequest, authorization, ksUat)
@@ -153,3 +227,151 @@ No authorization required
153
227
 
154
228
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
155
229
 
230
+
231
+ ## updateOnboardingCompany
232
+
233
+ > UserResponse updateOnboardingCompany(onboardingCompanyRequest, authorization, ksUat)
234
+
235
+ Update Onboarding Company Handler
236
+
237
+ Step 1 of onboarding: tenant-wide company info. Writes ``industry`` and ``description`` into the current tenant\'s settings JSONB. Restricted to OWNER and ADMIN — invited USERs see a pre-filled, read-only step on the frontend instead. Does not mark onboarding complete; the user finishes via the profile step. Re-running while the wizard is still open overwrites prior values; once onboarding has been completed/skipped, this endpoint returns 409. Post-onboarding edits go through PATCH /v1/tenants/{id}.
238
+
239
+ ### Example
240
+
241
+ ```ts
242
+ import {
243
+ Configuration,
244
+ UsersApi,
245
+ } from '@knowledge-stack/ksapi';
246
+ import type { UpdateOnboardingCompanyRequest } from '@knowledge-stack/ksapi';
247
+
248
+ async function example() {
249
+ console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
250
+ const api = new UsersApi();
251
+
252
+ const body = {
253
+ // OnboardingCompanyRequest
254
+ onboardingCompanyRequest: ...,
255
+ // string (optional)
256
+ authorization: authorization_example,
257
+ // string (optional)
258
+ ksUat: ksUat_example,
259
+ } satisfies UpdateOnboardingCompanyRequest;
260
+
261
+ try {
262
+ const data = await api.updateOnboardingCompany(body);
263
+ console.log(data);
264
+ } catch (error) {
265
+ console.error(error);
266
+ }
267
+ }
268
+
269
+ // Run the test
270
+ example().catch(console.error);
271
+ ```
272
+
273
+ ### Parameters
274
+
275
+
276
+ | Name | Type | Description | Notes |
277
+ |------------- | ------------- | ------------- | -------------|
278
+ | **onboardingCompanyRequest** | [OnboardingCompanyRequest](OnboardingCompanyRequest.md) | | |
279
+ | **authorization** | `string` | | [Optional] [Defaults to `undefined`] |
280
+ | **ksUat** | `string` | | [Optional] [Defaults to `undefined`] |
281
+
282
+ ### Return type
283
+
284
+ [**UserResponse**](UserResponse.md)
285
+
286
+ ### Authorization
287
+
288
+ No authorization required
289
+
290
+ ### HTTP request headers
291
+
292
+ - **Content-Type**: `application/json`
293
+ - **Accept**: `application/json`
294
+
295
+
296
+ ### HTTP response details
297
+ | Status code | Description | Response headers |
298
+ |-------------|-------------|------------------|
299
+ | **200** | Successful Response | - |
300
+ | **422** | Validation Error | - |
301
+
302
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
303
+
304
+
305
+ ## updateOnboardingProfile
306
+
307
+ > UserResponse updateOnboardingProfile(onboardingProfileRequest, authorization, ksUat)
308
+
309
+ Update Onboarding Profile Handler
310
+
311
+ Step 2 (final) of onboarding: per-user profile for the current tenant. Writes name to the User row (global) and job_title to the TenantUser row (per-tenant), then stamps ``onboarding_completed_at`` on the membership. Returns 409 if onboarding has already been completed or skipped — post-onboarding edits go through PATCH /v1/users (name) or a future per-membership profile endpoint (job_title).
312
+
313
+ ### Example
314
+
315
+ ```ts
316
+ import {
317
+ Configuration,
318
+ UsersApi,
319
+ } from '@knowledge-stack/ksapi';
320
+ import type { UpdateOnboardingProfileRequest } from '@knowledge-stack/ksapi';
321
+
322
+ async function example() {
323
+ console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
324
+ const api = new UsersApi();
325
+
326
+ const body = {
327
+ // OnboardingProfileRequest
328
+ onboardingProfileRequest: ...,
329
+ // string (optional)
330
+ authorization: authorization_example,
331
+ // string (optional)
332
+ ksUat: ksUat_example,
333
+ } satisfies UpdateOnboardingProfileRequest;
334
+
335
+ try {
336
+ const data = await api.updateOnboardingProfile(body);
337
+ console.log(data);
338
+ } catch (error) {
339
+ console.error(error);
340
+ }
341
+ }
342
+
343
+ // Run the test
344
+ example().catch(console.error);
345
+ ```
346
+
347
+ ### Parameters
348
+
349
+
350
+ | Name | Type | Description | Notes |
351
+ |------------- | ------------- | ------------- | -------------|
352
+ | **onboardingProfileRequest** | [OnboardingProfileRequest](OnboardingProfileRequest.md) | | |
353
+ | **authorization** | `string` | | [Optional] [Defaults to `undefined`] |
354
+ | **ksUat** | `string` | | [Optional] [Defaults to `undefined`] |
355
+
356
+ ### Return type
357
+
358
+ [**UserResponse**](UserResponse.md)
359
+
360
+ ### Authorization
361
+
362
+ No authorization required
363
+
364
+ ### HTTP request headers
365
+
366
+ - **Content-Type**: `application/json`
367
+ - **Accept**: `application/json`
368
+
369
+
370
+ ### HTTP response details
371
+ | Status code | Description | Response headers |
372
+ |-------------|-------------|------------------|
373
+ | **200** | Successful Response | - |
374
+ | **422** | Validation Error | - |
375
+
376
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
377
+
@@ -236,6 +236,8 @@ No authorization required
236
236
 
237
237
  Invoke Workflow Handler
238
238
 
239
+ Trigger a workflow run. All business logic lives in ``WorkflowInvocationService``. This handler only orchestrates the two phases: 1. **Phase 1 (in-session):** validate, build snapshot, persist run row, mint JWT. Wrapped in a single DB session so the run insert and the idempotency-race resolution share a transaction. 2. **Phase 2 (out-of-session):** dispatch HTTP call to the SELF_HOSTED runner. Best-effort — the run is already persisted, so failures here transition the run to ``FAILED`` rather than rejecting the request.
240
+
239
241
  ### Example
240
242
 
241
243
  ```ts
@@ -1,7 +1,7 @@
1
1
 
2
2
  # WorkflowRunResponse
3
3
 
4
- Workflow run response.
4
+ Workflow run response. Note: ``run_token_jti`` is intentionally NOT exposed. It\'s an internal token identifier persisted on the run row for callback auth — clients should treat run dispatch state as observable via ``status`` (RUNNING => dispatched), not via JTI presence.
5
5
 
6
6
  ## Properties
7
7
 
@@ -16,6 +16,8 @@ Name | Type
16
16
  `completedAt` | Date
17
17
  `runSnapshot` | [WorkflowRunSnapshot](WorkflowRunSnapshot.md)
18
18
  `error` | string
19
+ `inputPathPartIds` | Array<string>
20
+ `inputVersionIds` | Array<string>
19
21
  `createdAt` | Date
20
22
  `updatedAt` | Date
21
23
 
@@ -35,6 +37,8 @@ const example = {
35
37
  "completedAt": null,
36
38
  "runSnapshot": null,
37
39
  "error": null,
40
+ "inputPathPartIds": null,
41
+ "inputVersionIds": null,
38
42
  "createdAt": null,
39
43
  "updatedAt": null,
40
44
  } satisfies WorkflowRunResponse
@@ -13,7 +13,7 @@ Name | Type
13
13
  `userId` | string
14
14
  `maxRunDurationSeconds` | number
15
15
  `sources` | [Array<ABCDPathSnapshot>](ABCDPathSnapshot.md)
16
- `instructions` | [Array<ABCDPathSnapshot>](ABCDPathSnapshot.md)
16
+ `instructions` | [Array<InstructionSnapshot>](InstructionSnapshot.md)
17
17
  `outputs` | [Array<ABCDPathSnapshot>](ABCDPathSnapshot.md)
18
18
  `template` | [ABCDPathSnapshot](ABCDPathSnapshot.md)
19
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowledge-stack/ksapi",
3
- "version": "1.80.1",
3
+ "version": "1.82.0",
4
4
  "description": "OpenAPI client for @knowledge-stack/ksapi",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -16,12 +16,18 @@
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
18
  HTTPValidationError,
19
+ OnboardingCompanyRequest,
20
+ OnboardingProfileRequest,
19
21
  UpdateUserRequest,
20
22
  UserResponse,
21
23
  } from '../models/index';
22
24
  import {
23
25
  HTTPValidationErrorFromJSON,
24
26
  HTTPValidationErrorToJSON,
27
+ OnboardingCompanyRequestFromJSON,
28
+ OnboardingCompanyRequestToJSON,
29
+ OnboardingProfileRequestFromJSON,
30
+ OnboardingProfileRequestToJSON,
25
31
  UpdateUserRequestFromJSON,
26
32
  UpdateUserRequestToJSON,
27
33
  UserResponseFromJSON,
@@ -33,12 +39,29 @@ export interface GetMeRequest {
33
39
  ksUat?: string | null;
34
40
  }
35
41
 
42
+ export interface SkipOnboardingRequest {
43
+ authorization?: string | null;
44
+ ksUat?: string | null;
45
+ }
46
+
36
47
  export interface UpdateMeRequest {
37
48
  updateUserRequest: UpdateUserRequest;
38
49
  authorization?: string | null;
39
50
  ksUat?: string | null;
40
51
  }
41
52
 
53
+ export interface UpdateOnboardingCompanyRequest {
54
+ onboardingCompanyRequest: OnboardingCompanyRequest;
55
+ authorization?: string | null;
56
+ ksUat?: string | null;
57
+ }
58
+
59
+ export interface UpdateOnboardingProfileRequest {
60
+ onboardingProfileRequest: OnboardingProfileRequest;
61
+ authorization?: string | null;
62
+ ksUat?: string | null;
63
+ }
64
+
42
65
  /**
43
66
  * UsersApi - interface
44
67
  *
@@ -72,6 +95,32 @@ export interface UsersApiInterface {
72
95
  */
73
96
  getMe(requestParameters: GetMeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserResponse>;
74
97
 
98
+ /**
99
+ * Creates request options for skipOnboarding without sending the request
100
+ * @param {string} [authorization]
101
+ * @param {string} [ksUat]
102
+ * @throws {RequiredError}
103
+ * @memberof UsersApiInterface
104
+ */
105
+ skipOnboardingRequestOpts(requestParameters: SkipOnboardingRequest): Promise<runtime.RequestOpts>;
106
+
107
+ /**
108
+ * Mark onboarding complete without writing any profile/company fields. Idempotent — calling this after onboarding is already complete returns the current state unchanged (the CRUD only stamps the timestamp when it is NULL).
109
+ * @summary Skip Onboarding Handler
110
+ * @param {string} [authorization]
111
+ * @param {string} [ksUat]
112
+ * @param {*} [options] Override http request option.
113
+ * @throws {RequiredError}
114
+ * @memberof UsersApiInterface
115
+ */
116
+ skipOnboardingRaw(requestParameters: SkipOnboardingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserResponse>>;
117
+
118
+ /**
119
+ * Mark onboarding complete without writing any profile/company fields. Idempotent — calling this after onboarding is already complete returns the current state unchanged (the CRUD only stamps the timestamp when it is NULL).
120
+ * Skip Onboarding Handler
121
+ */
122
+ skipOnboarding(requestParameters: SkipOnboardingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserResponse>;
123
+
75
124
  /**
76
125
  * Creates request options for updateMe without sending the request
77
126
  * @param {UpdateUserRequest} updateUserRequest
@@ -100,6 +149,62 @@ export interface UsersApiInterface {
100
149
  */
101
150
  updateMe(requestParameters: UpdateMeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserResponse>;
102
151
 
152
+ /**
153
+ * Creates request options for updateOnboardingCompany without sending the request
154
+ * @param {OnboardingCompanyRequest} onboardingCompanyRequest
155
+ * @param {string} [authorization]
156
+ * @param {string} [ksUat]
157
+ * @throws {RequiredError}
158
+ * @memberof UsersApiInterface
159
+ */
160
+ updateOnboardingCompanyRequestOpts(requestParameters: UpdateOnboardingCompanyRequest): Promise<runtime.RequestOpts>;
161
+
162
+ /**
163
+ * Step 1 of onboarding: tenant-wide company info. Writes ``industry`` and ``description`` into the current tenant\'s settings JSONB. Restricted to OWNER and ADMIN — invited USERs see a pre-filled, read-only step on the frontend instead. Does not mark onboarding complete; the user finishes via the profile step. Re-running while the wizard is still open overwrites prior values; once onboarding has been completed/skipped, this endpoint returns 409. Post-onboarding edits go through PATCH /v1/tenants/{id}.
164
+ * @summary Update Onboarding Company Handler
165
+ * @param {OnboardingCompanyRequest} onboardingCompanyRequest
166
+ * @param {string} [authorization]
167
+ * @param {string} [ksUat]
168
+ * @param {*} [options] Override http request option.
169
+ * @throws {RequiredError}
170
+ * @memberof UsersApiInterface
171
+ */
172
+ updateOnboardingCompanyRaw(requestParameters: UpdateOnboardingCompanyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserResponse>>;
173
+
174
+ /**
175
+ * Step 1 of onboarding: tenant-wide company info. Writes ``industry`` and ``description`` into the current tenant\'s settings JSONB. Restricted to OWNER and ADMIN — invited USERs see a pre-filled, read-only step on the frontend instead. Does not mark onboarding complete; the user finishes via the profile step. Re-running while the wizard is still open overwrites prior values; once onboarding has been completed/skipped, this endpoint returns 409. Post-onboarding edits go through PATCH /v1/tenants/{id}.
176
+ * Update Onboarding Company Handler
177
+ */
178
+ updateOnboardingCompany(requestParameters: UpdateOnboardingCompanyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserResponse>;
179
+
180
+ /**
181
+ * Creates request options for updateOnboardingProfile without sending the request
182
+ * @param {OnboardingProfileRequest} onboardingProfileRequest
183
+ * @param {string} [authorization]
184
+ * @param {string} [ksUat]
185
+ * @throws {RequiredError}
186
+ * @memberof UsersApiInterface
187
+ */
188
+ updateOnboardingProfileRequestOpts(requestParameters: UpdateOnboardingProfileRequest): Promise<runtime.RequestOpts>;
189
+
190
+ /**
191
+ * Step 2 (final) of onboarding: per-user profile for the current tenant. Writes name to the User row (global) and job_title to the TenantUser row (per-tenant), then stamps ``onboarding_completed_at`` on the membership. Returns 409 if onboarding has already been completed or skipped — post-onboarding edits go through PATCH /v1/users (name) or a future per-membership profile endpoint (job_title).
192
+ * @summary Update Onboarding Profile Handler
193
+ * @param {OnboardingProfileRequest} onboardingProfileRequest
194
+ * @param {string} [authorization]
195
+ * @param {string} [ksUat]
196
+ * @param {*} [options] Override http request option.
197
+ * @throws {RequiredError}
198
+ * @memberof UsersApiInterface
199
+ */
200
+ updateOnboardingProfileRaw(requestParameters: UpdateOnboardingProfileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserResponse>>;
201
+
202
+ /**
203
+ * Step 2 (final) of onboarding: per-user profile for the current tenant. Writes name to the User row (global) and job_title to the TenantUser row (per-tenant), then stamps ``onboarding_completed_at`` on the membership. Returns 409 if onboarding has already been completed or skipped — post-onboarding edits go through PATCH /v1/users (name) or a future per-membership profile endpoint (job_title).
204
+ * Update Onboarding Profile Handler
205
+ */
206
+ updateOnboardingProfile(requestParameters: UpdateOnboardingProfileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserResponse>;
207
+
103
208
  }
104
209
 
105
210
  /**
@@ -150,6 +255,49 @@ export class UsersApi extends runtime.BaseAPI implements UsersApiInterface {
150
255
  return await response.value();
151
256
  }
152
257
 
258
+ /**
259
+ * Creates request options for skipOnboarding without sending the request
260
+ */
261
+ async skipOnboardingRequestOpts(requestParameters: SkipOnboardingRequest): Promise<runtime.RequestOpts> {
262
+ const queryParameters: any = {};
263
+
264
+ const headerParameters: runtime.HTTPHeaders = {};
265
+
266
+ if (requestParameters['authorization'] != null) {
267
+ headerParameters['authorization'] = String(requestParameters['authorization']);
268
+ }
269
+
270
+
271
+ let urlPath = `/v1/users/me/onboarding/skip`;
272
+
273
+ return {
274
+ path: urlPath,
275
+ method: 'POST',
276
+ headers: headerParameters,
277
+ query: queryParameters,
278
+ };
279
+ }
280
+
281
+ /**
282
+ * Mark onboarding complete without writing any profile/company fields. Idempotent — calling this after onboarding is already complete returns the current state unchanged (the CRUD only stamps the timestamp when it is NULL).
283
+ * Skip Onboarding Handler
284
+ */
285
+ async skipOnboardingRaw(requestParameters: SkipOnboardingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserResponse>> {
286
+ const requestOptions = await this.skipOnboardingRequestOpts(requestParameters);
287
+ const response = await this.request(requestOptions, initOverrides);
288
+
289
+ return new runtime.JSONApiResponse(response, (jsonValue) => UserResponseFromJSON(jsonValue));
290
+ }
291
+
292
+ /**
293
+ * Mark onboarding complete without writing any profile/company fields. Idempotent — calling this after onboarding is already complete returns the current state unchanged (the CRUD only stamps the timestamp when it is NULL).
294
+ * Skip Onboarding Handler
295
+ */
296
+ async skipOnboarding(requestParameters: SkipOnboardingRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserResponse> {
297
+ const response = await this.skipOnboardingRaw(requestParameters, initOverrides);
298
+ return await response.value();
299
+ }
300
+
153
301
  /**
154
302
  * Creates request options for updateMe without sending the request
155
303
  */
@@ -203,4 +351,110 @@ export class UsersApi extends runtime.BaseAPI implements UsersApiInterface {
203
351
  return await response.value();
204
352
  }
205
353
 
354
+ /**
355
+ * Creates request options for updateOnboardingCompany without sending the request
356
+ */
357
+ async updateOnboardingCompanyRequestOpts(requestParameters: UpdateOnboardingCompanyRequest): Promise<runtime.RequestOpts> {
358
+ if (requestParameters['onboardingCompanyRequest'] == null) {
359
+ throw new runtime.RequiredError(
360
+ 'onboardingCompanyRequest',
361
+ 'Required parameter "onboardingCompanyRequest" was null or undefined when calling updateOnboardingCompany().'
362
+ );
363
+ }
364
+
365
+ const queryParameters: any = {};
366
+
367
+ const headerParameters: runtime.HTTPHeaders = {};
368
+
369
+ headerParameters['Content-Type'] = 'application/json';
370
+
371
+ if (requestParameters['authorization'] != null) {
372
+ headerParameters['authorization'] = String(requestParameters['authorization']);
373
+ }
374
+
375
+
376
+ let urlPath = `/v1/users/me/onboarding/company`;
377
+
378
+ return {
379
+ path: urlPath,
380
+ method: 'PATCH',
381
+ headers: headerParameters,
382
+ query: queryParameters,
383
+ body: OnboardingCompanyRequestToJSON(requestParameters['onboardingCompanyRequest']),
384
+ };
385
+ }
386
+
387
+ /**
388
+ * Step 1 of onboarding: tenant-wide company info. Writes ``industry`` and ``description`` into the current tenant\'s settings JSONB. Restricted to OWNER and ADMIN — invited USERs see a pre-filled, read-only step on the frontend instead. Does not mark onboarding complete; the user finishes via the profile step. Re-running while the wizard is still open overwrites prior values; once onboarding has been completed/skipped, this endpoint returns 409. Post-onboarding edits go through PATCH /v1/tenants/{id}.
389
+ * Update Onboarding Company Handler
390
+ */
391
+ async updateOnboardingCompanyRaw(requestParameters: UpdateOnboardingCompanyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserResponse>> {
392
+ const requestOptions = await this.updateOnboardingCompanyRequestOpts(requestParameters);
393
+ const response = await this.request(requestOptions, initOverrides);
394
+
395
+ return new runtime.JSONApiResponse(response, (jsonValue) => UserResponseFromJSON(jsonValue));
396
+ }
397
+
398
+ /**
399
+ * Step 1 of onboarding: tenant-wide company info. Writes ``industry`` and ``description`` into the current tenant\'s settings JSONB. Restricted to OWNER and ADMIN — invited USERs see a pre-filled, read-only step on the frontend instead. Does not mark onboarding complete; the user finishes via the profile step. Re-running while the wizard is still open overwrites prior values; once onboarding has been completed/skipped, this endpoint returns 409. Post-onboarding edits go through PATCH /v1/tenants/{id}.
400
+ * Update Onboarding Company Handler
401
+ */
402
+ async updateOnboardingCompany(requestParameters: UpdateOnboardingCompanyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserResponse> {
403
+ const response = await this.updateOnboardingCompanyRaw(requestParameters, initOverrides);
404
+ return await response.value();
405
+ }
406
+
407
+ /**
408
+ * Creates request options for updateOnboardingProfile without sending the request
409
+ */
410
+ async updateOnboardingProfileRequestOpts(requestParameters: UpdateOnboardingProfileRequest): Promise<runtime.RequestOpts> {
411
+ if (requestParameters['onboardingProfileRequest'] == null) {
412
+ throw new runtime.RequiredError(
413
+ 'onboardingProfileRequest',
414
+ 'Required parameter "onboardingProfileRequest" was null or undefined when calling updateOnboardingProfile().'
415
+ );
416
+ }
417
+
418
+ const queryParameters: any = {};
419
+
420
+ const headerParameters: runtime.HTTPHeaders = {};
421
+
422
+ headerParameters['Content-Type'] = 'application/json';
423
+
424
+ if (requestParameters['authorization'] != null) {
425
+ headerParameters['authorization'] = String(requestParameters['authorization']);
426
+ }
427
+
428
+
429
+ let urlPath = `/v1/users/me/onboarding/profile`;
430
+
431
+ return {
432
+ path: urlPath,
433
+ method: 'PATCH',
434
+ headers: headerParameters,
435
+ query: queryParameters,
436
+ body: OnboardingProfileRequestToJSON(requestParameters['onboardingProfileRequest']),
437
+ };
438
+ }
439
+
440
+ /**
441
+ * Step 2 (final) of onboarding: per-user profile for the current tenant. Writes name to the User row (global) and job_title to the TenantUser row (per-tenant), then stamps ``onboarding_completed_at`` on the membership. Returns 409 if onboarding has already been completed or skipped — post-onboarding edits go through PATCH /v1/users (name) or a future per-membership profile endpoint (job_title).
442
+ * Update Onboarding Profile Handler
443
+ */
444
+ async updateOnboardingProfileRaw(requestParameters: UpdateOnboardingProfileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserResponse>> {
445
+ const requestOptions = await this.updateOnboardingProfileRequestOpts(requestParameters);
446
+ const response = await this.request(requestOptions, initOverrides);
447
+
448
+ return new runtime.JSONApiResponse(response, (jsonValue) => UserResponseFromJSON(jsonValue));
449
+ }
450
+
451
+ /**
452
+ * Step 2 (final) of onboarding: per-user profile for the current tenant. Writes name to the User row (global) and job_title to the TenantUser row (per-tenant), then stamps ``onboarding_completed_at`` on the membership. Returns 409 if onboarding has already been completed or skipped — post-onboarding edits go through PATCH /v1/users (name) or a future per-membership profile endpoint (job_title).
453
+ * Update Onboarding Profile Handler
454
+ */
455
+ async updateOnboardingProfile(requestParameters: UpdateOnboardingProfileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserResponse> {
456
+ const response = await this.updateOnboardingProfileRaw(requestParameters, initOverrides);
457
+ return await response.value();
458
+ }
459
+
206
460
  }
@@ -190,7 +190,7 @@ export interface WorkflowDefinitionsApiInterface {
190
190
  invokeWorkflowRequestOpts(requestParameters: InvokeWorkflowOperationRequest): Promise<runtime.RequestOpts>;
191
191
 
192
192
  /**
193
- *
193
+ * Trigger a workflow run. All business logic lives in ``WorkflowInvocationService``. This handler only orchestrates the two phases: 1. **Phase 1 (in-session):** validate, build snapshot, persist run row, mint JWT. Wrapped in a single DB session so the run insert and the idempotency-race resolution share a transaction. 2. **Phase 2 (out-of-session):** dispatch HTTP call to the SELF_HOSTED runner. Best-effort — the run is already persisted, so failures here transition the run to ``FAILED`` rather than rejecting the request.
194
194
  * @summary Invoke Workflow Handler
195
195
  * @param {string} definitionId
196
196
  * @param {InvokeWorkflowRequest} invokeWorkflowRequest
@@ -203,6 +203,7 @@ export interface WorkflowDefinitionsApiInterface {
203
203
  invokeWorkflowRaw(requestParameters: InvokeWorkflowOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
204
204
 
205
205
  /**
206
+ * Trigger a workflow run. All business logic lives in ``WorkflowInvocationService``. This handler only orchestrates the two phases: 1. **Phase 1 (in-session):** validate, build snapshot, persist run row, mint JWT. Wrapped in a single DB session so the run insert and the idempotency-race resolution share a transaction. 2. **Phase 2 (out-of-session):** dispatch HTTP call to the SELF_HOSTED runner. Best-effort — the run is already persisted, so failures here transition the run to ``FAILED`` rather than rejecting the request.
206
207
  * Invoke Workflow Handler
207
208
  */
208
209
  invokeWorkflow(requestParameters: InvokeWorkflowOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
@@ -493,6 +494,7 @@ export class WorkflowDefinitionsApi extends runtime.BaseAPI implements WorkflowD
493
494
  }
494
495
 
495
496
  /**
497
+ * Trigger a workflow run. All business logic lives in ``WorkflowInvocationService``. This handler only orchestrates the two phases: 1. **Phase 1 (in-session):** validate, build snapshot, persist run row, mint JWT. Wrapped in a single DB session so the run insert and the idempotency-race resolution share a transaction. 2. **Phase 2 (out-of-session):** dispatch HTTP call to the SELF_HOSTED runner. Best-effort — the run is already persisted, so failures here transition the run to ``FAILED`` rather than rejecting the request.
496
498
  * Invoke Workflow Handler
497
499
  */
498
500
  async invokeWorkflowRaw(requestParameters: InvokeWorkflowOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>> {
@@ -503,6 +505,7 @@ export class WorkflowDefinitionsApi extends runtime.BaseAPI implements WorkflowD
503
505
  }
504
506
 
505
507
  /**
508
+ * Trigger a workflow run. All business logic lives in ``WorkflowInvocationService``. This handler only orchestrates the two phases: 1. **Phase 1 (in-session):** validate, build snapshot, persist run row, mint JWT. Wrapped in a single DB session so the run insert and the idempotency-race resolution share a transaction. 2. **Phase 2 (out-of-session):** dispatch HTTP call to the SELF_HOSTED runner. Best-effort — the run is already persisted, so failures here transition the run to ``FAILED`` rather than rejecting the request.
506
509
  * Invoke Workflow Handler
507
510
  */
508
511
  async invokeWorkflow(requestParameters: InvokeWorkflowOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse> {
@@ -30,6 +30,13 @@ import {
30
30
 
31
31
  /**
32
32
  * Create a new workflow definition.
33
+ *
34
+ * ``instruction_path_part_ids`` semantics depend on ``runner_type``:
35
+ *
36
+ * - ``KS_INTERNAL``: must be empty (``[]``); the server auto-provisions a
37
+ * single ``instruction.md`` and stores ``[doc.path_part_id]``.
38
+ * - ``SELF_HOSTED``: caller-supplied list of one-or-more document
39
+ * PathPart IDs. Must contain at least one entry.
33
40
  * @export
34
41
  * @interface CreateWorkflowDefinitionRequest
35
42
  */
@@ -75,7 +82,7 @@ export interface CreateWorkflowDefinitionRequest {
75
82
  * @type {Array<string>}
76
83
  * @memberof CreateWorkflowDefinitionRequest
77
84
  */
78
- instructionPathPartIds: Array<string>;
85
+ instructionPathPartIds?: Array<string>;
79
86
  /**
80
87
  *
81
88
  * @type {Array<string>}
@@ -122,7 +129,6 @@ export const CreateWorkflowDefinitionRequestPropertyValidationAttributesMap: {
122
129
  },
123
130
  instructionPathPartIds: {
124
131
  maxItems: 20,
125
- minItems: 1,
126
132
  uniqueItems: false,
127
133
  },
128
134
  outputPathPartIds: {
@@ -140,7 +146,6 @@ export function instanceOfCreateWorkflowDefinitionRequest(value: object): value
140
146
  if (!('name' in value) || value['name'] === undefined) return false;
141
147
  if (!('runnerType' in value) || value['runnerType'] === undefined) return false;
142
148
  if (!('sourcePathPartIds' in value) || value['sourcePathPartIds'] === undefined) return false;
143
- if (!('instructionPathPartIds' in value) || value['instructionPathPartIds'] === undefined) return false;
144
149
  if (!('outputPathPartIds' in value) || value['outputPathPartIds'] === undefined) return false;
145
150
  return true;
146
151
  }
@@ -161,7 +166,7 @@ export function CreateWorkflowDefinitionRequestFromJSONTyped(json: any, ignoreDi
161
166
  'runnerConfig': json['runner_config'] == null ? undefined : SelfHostedRunnerConfigFromJSON(json['runner_config']),
162
167
  'maxRunDurationSeconds': json['max_run_duration_seconds'] == null ? undefined : json['max_run_duration_seconds'],
163
168
  'sourcePathPartIds': json['source_path_part_ids'],
164
- 'instructionPathPartIds': json['instruction_path_part_ids'],
169
+ 'instructionPathPartIds': json['instruction_path_part_ids'] == null ? undefined : json['instruction_path_part_ids'],
165
170
  'outputPathPartIds': json['output_path_part_ids'],
166
171
  'templatePathPartId': json['template_path_part_id'] == null ? undefined : json['template_path_part_id'],
167
172
  };