@knowledge-stack/ksapi 3.9.0 → 3.10.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.
@@ -26,6 +26,50 @@ import { OnboardingCompanyRequestToJSON, OnboardingProfileRequestToJSON, UpdateU
26
26
  *
27
27
  */
28
28
  export class UsersApi extends runtime.BaseAPI {
29
+ /**
30
+ * Creates request options for deleteMyAvatar without sending the request
31
+ */
32
+ deleteMyAvatarRequestOpts() {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ const queryParameters = {};
35
+ const headerParameters = {};
36
+ if (this.configuration && this.configuration.accessToken) {
37
+ const token = this.configuration.accessToken;
38
+ const tokenString = yield token("bearerAuth", []);
39
+ if (tokenString) {
40
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
41
+ }
42
+ }
43
+ let urlPath = `/v1/users/me/avatar`;
44
+ return {
45
+ path: urlPath,
46
+ method: 'DELETE',
47
+ headers: headerParameters,
48
+ query: queryParameters,
49
+ };
50
+ });
51
+ }
52
+ /**
53
+ * Remove the profile photo for the current tenant. No photo is a no-op.
54
+ * Delete My Avatar Handler
55
+ */
56
+ deleteMyAvatarRaw(initOverrides) {
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ const requestOptions = yield this.deleteMyAvatarRequestOpts();
59
+ const response = yield this.request(requestOptions, initOverrides);
60
+ return new runtime.JSONApiResponse(response, (jsonValue) => UserResponseFromJSON(jsonValue));
61
+ });
62
+ }
63
+ /**
64
+ * Remove the profile photo for the current tenant. No photo is a no-op.
65
+ * Delete My Avatar Handler
66
+ */
67
+ deleteMyAvatar(initOverrides) {
68
+ return __awaiter(this, void 0, void 0, function* () {
69
+ const response = yield this.deleteMyAvatarRaw(initOverrides);
70
+ return yield response.value();
71
+ });
72
+ }
29
73
  /**
30
74
  * Creates request options for getMe without sending the request
31
75
  */
@@ -143,7 +187,7 @@ export class UsersApi extends runtime.BaseAPI {
143
187
  });
144
188
  }
145
189
  /**
146
- * Update the user\'s profile (default tenant, name fields). When updating default_tenant_id, the user must belong to the specified tenant.
190
+ * Update the user\'s name and default tenant, and the membership\'s profile. When updating default_tenant_id, the user must belong to the specified tenant.
147
191
  * Update Me Handler
148
192
  */
149
193
  updateMeRaw(requestParameters, initOverrides) {
@@ -154,7 +198,7 @@ export class UsersApi extends runtime.BaseAPI {
154
198
  });
155
199
  }
156
200
  /**
157
- * Update the user\'s profile (default tenant, name fields). When updating default_tenant_id, the user must belong to the specified tenant.
201
+ * Update the user\'s name and default tenant, and the membership\'s profile. When updating default_tenant_id, the user must belong to the specified tenant.
158
202
  * Update Me Handler
159
203
  */
160
204
  updateMe(requestParameters, initOverrides) {
@@ -241,7 +285,7 @@ export class UsersApi extends runtime.BaseAPI {
241
285
  });
242
286
  }
243
287
  /**
244
- * 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).
288
+ * 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.
245
289
  * Update Onboarding Profile Handler
246
290
  */
247
291
  updateOnboardingProfileRaw(requestParameters, initOverrides) {
@@ -252,7 +296,7 @@ export class UsersApi extends runtime.BaseAPI {
252
296
  });
253
297
  }
254
298
  /**
255
- * 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).
299
+ * 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.
256
300
  * Update Onboarding Profile Handler
257
301
  */
258
302
  updateOnboardingProfile(requestParameters, initOverrides) {
@@ -261,4 +305,70 @@ export class UsersApi extends runtime.BaseAPI {
261
305
  return yield response.value();
262
306
  });
263
307
  }
308
+ /**
309
+ * Creates request options for uploadMyAvatar without sending the request
310
+ */
311
+ uploadMyAvatarRequestOpts(requestParameters) {
312
+ return __awaiter(this, void 0, void 0, function* () {
313
+ if (requestParameters['file'] == null) {
314
+ throw new runtime.RequiredError('file', 'Required parameter "file" was null or undefined when calling uploadMyAvatar().');
315
+ }
316
+ const queryParameters = {};
317
+ const headerParameters = {};
318
+ if (this.configuration && this.configuration.accessToken) {
319
+ const token = this.configuration.accessToken;
320
+ const tokenString = yield token("bearerAuth", []);
321
+ if (tokenString) {
322
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
323
+ }
324
+ }
325
+ const consumes = [
326
+ { contentType: 'multipart/form-data' },
327
+ ];
328
+ // @ts-ignore: canConsumeForm may be unused
329
+ const canConsumeForm = runtime.canConsumeForm(consumes);
330
+ let formParams;
331
+ let useForm = false;
332
+ // use FormData to transmit files using content-type "multipart/form-data"
333
+ useForm = canConsumeForm;
334
+ if (useForm) {
335
+ formParams = new FormData();
336
+ }
337
+ else {
338
+ formParams = new URLSearchParams();
339
+ }
340
+ if (requestParameters['file'] != null) {
341
+ formParams.append('file', requestParameters['file']);
342
+ }
343
+ let urlPath = `/v1/users/me/avatar`;
344
+ return {
345
+ path: urlPath,
346
+ method: 'POST',
347
+ headers: headerParameters,
348
+ query: queryParameters,
349
+ body: formParams,
350
+ };
351
+ });
352
+ }
353
+ /**
354
+ * Set the profile photo for the current tenant. PNG, JPEG, WebP or GIF, at most 2 MB and 4096 px per side; the format is read from the bytes, not the content type.
355
+ * Upload My Avatar Handler
356
+ */
357
+ uploadMyAvatarRaw(requestParameters, initOverrides) {
358
+ return __awaiter(this, void 0, void 0, function* () {
359
+ const requestOptions = yield this.uploadMyAvatarRequestOpts(requestParameters);
360
+ const response = yield this.request(requestOptions, initOverrides);
361
+ return new runtime.JSONApiResponse(response, (jsonValue) => UserResponseFromJSON(jsonValue));
362
+ });
363
+ }
364
+ /**
365
+ * Set the profile photo for the current tenant. PNG, JPEG, WebP or GIF, at most 2 MB and 4096 px per side; the format is read from the bytes, not the content type.
366
+ * Upload My Avatar Handler
367
+ */
368
+ uploadMyAvatar(requestParameters, initOverrides) {
369
+ return __awaiter(this, void 0, void 0, function* () {
370
+ const response = yield this.uploadMyAvatarRaw(requestParameters, initOverrides);
371
+ return yield response.value();
372
+ });
373
+ }
264
374
  }
@@ -28,11 +28,29 @@ export interface UpdateUserRequest {
28
28
  */
29
29
  firstName?: string | null;
30
30
  /**
31
- * Last name of the user
31
+ * Last name of the user. Directory-synced users cannot set it.
32
32
  * @type {string}
33
33
  * @memberof UpdateUserRequest
34
34
  */
35
35
  lastName?: string | null;
36
+ /**
37
+ * Job title at the current tenant; omit to leave unchanged, empty string to clear. Directory-synced users cannot set it.
38
+ * @type {string}
39
+ * @memberof UpdateUserRequest
40
+ */
41
+ jobTitle?: string | null;
42
+ /**
43
+ * Department at the current tenant; omit to leave unchanged, empty string to clear. Directory-synced users cannot set it.
44
+ * @type {string}
45
+ * @memberof UpdateUserRequest
46
+ */
47
+ department?: string | null;
48
+ /**
49
+ * About the user at the current tenant, read by the chat agent; omit to leave unchanged, empty string to clear.
50
+ * @type {string}
51
+ * @memberof UpdateUserRequest
52
+ */
53
+ bio?: string | null;
36
54
  }
37
55
  export declare const UpdateUserRequestPropertyValidationAttributesMap: {
38
56
  [property: string]: {
@@ -11,7 +11,23 @@
11
11
  * https://openapi-generator.tech
12
12
  * Do not edit the class manually.
13
13
  */
14
- export const UpdateUserRequestPropertyValidationAttributesMap = {};
14
+ export const UpdateUserRequestPropertyValidationAttributesMap = {
15
+ firstName: {
16
+ maxLength: 255,
17
+ },
18
+ lastName: {
19
+ maxLength: 255,
20
+ },
21
+ jobTitle: {
22
+ maxLength: 120,
23
+ },
24
+ department: {
25
+ maxLength: 120,
26
+ },
27
+ bio: {
28
+ maxLength: 1000,
29
+ },
30
+ };
15
31
  /**
16
32
  * Check if a given object implements the UpdateUserRequest interface.
17
33
  */
@@ -29,6 +45,9 @@ export function UpdateUserRequestFromJSONTyped(json, ignoreDiscriminator) {
29
45
  'defaultTenantId': json['default_tenant_id'] == null ? undefined : json['default_tenant_id'],
30
46
  'firstName': json['first_name'] == null ? undefined : json['first_name'],
31
47
  'lastName': json['last_name'] == null ? undefined : json['last_name'],
48
+ 'jobTitle': json['job_title'] == null ? undefined : json['job_title'],
49
+ 'department': json['department'] == null ? undefined : json['department'],
50
+ 'bio': json['bio'] == null ? undefined : json['bio'],
32
51
  };
33
52
  }
34
53
  export function UpdateUserRequestToJSON(json) {
@@ -42,5 +61,8 @@ export function UpdateUserRequestToJSONTyped(value, ignoreDiscriminator = false)
42
61
  'default_tenant_id': value['defaultTenantId'],
43
62
  'first_name': value['firstName'],
44
63
  'last_name': value['lastName'],
64
+ 'job_title': value['jobTitle'],
65
+ 'department': value['department'],
66
+ 'bio': value['bio'],
45
67
  };
46
68
  }
@@ -77,6 +77,24 @@ export interface UserResponse {
77
77
  * @memberof UserResponse
78
78
  */
79
79
  jobTitle?: string | null;
80
+ /**
81
+ * User's department at the current tenant (per-membership)
82
+ * @type {string}
83
+ * @memberof UserResponse
84
+ */
85
+ department?: string | null;
86
+ /**
87
+ * What the user wrote about themselves at the current tenant. The chat agent reads it on every turn.
88
+ * @type {string}
89
+ * @memberof UserResponse
90
+ */
91
+ bio?: string | null;
92
+ /**
93
+ * Presigned URL of the user's profile photo at the current tenant. Expires after six hours; read GET /v1/users/me again for a fresh one.
94
+ * @type {string}
95
+ * @memberof UserResponse
96
+ */
97
+ avatarUrl?: string | null;
80
98
  /**
81
99
  * When the user finished onboarding for the current tenant. NULL = wizard should be shown.
82
100
  * @type {Date}
@@ -54,6 +54,9 @@ export function UserResponseFromJSONTyped(json, ignoreDiscriminator) {
54
54
  'currentTenantRole': TenantUserRoleFromJSON(json['current_tenant_role']),
55
55
  'defaultTenantId': json['default_tenant_id'],
56
56
  'jobTitle': json['job_title'] == null ? undefined : json['job_title'],
57
+ 'department': json['department'] == null ? undefined : json['department'],
58
+ 'bio': json['bio'] == null ? undefined : json['bio'],
59
+ 'avatarUrl': json['avatar_url'] == null ? undefined : json['avatar_url'],
57
60
  'onboardingCompletedAt': json['onboarding_completed_at'] == null ? undefined : (new Date(json['onboarding_completed_at'])),
58
61
  };
59
62
  }
@@ -75,6 +78,9 @@ export function UserResponseToJSONTyped(value, ignoreDiscriminator = false) {
75
78
  'current_tenant_role': TenantUserRoleToJSON(value['currentTenantRole']),
76
79
  'default_tenant_id': value['defaultTenantId'],
77
80
  'job_title': value['jobTitle'],
81
+ 'department': value['department'],
82
+ 'bio': value['bio'],
83
+ 'avatar_url': value['avatarUrl'],
78
84
  'onboarding_completed_at': value['onboardingCompletedAt'] == null ? value['onboardingCompletedAt'] : value['onboardingCompletedAt'].toISOString(),
79
85
  };
80
86
  }
@@ -28,11 +28,29 @@ export interface UpdateUserRequest {
28
28
  */
29
29
  firstName?: string | null;
30
30
  /**
31
- * Last name of the user
31
+ * Last name of the user. Directory-synced users cannot set it.
32
32
  * @type {string}
33
33
  * @memberof UpdateUserRequest
34
34
  */
35
35
  lastName?: string | null;
36
+ /**
37
+ * Job title at the current tenant; omit to leave unchanged, empty string to clear. Directory-synced users cannot set it.
38
+ * @type {string}
39
+ * @memberof UpdateUserRequest
40
+ */
41
+ jobTitle?: string | null;
42
+ /**
43
+ * Department at the current tenant; omit to leave unchanged, empty string to clear. Directory-synced users cannot set it.
44
+ * @type {string}
45
+ * @memberof UpdateUserRequest
46
+ */
47
+ department?: string | null;
48
+ /**
49
+ * About the user at the current tenant, read by the chat agent; omit to leave unchanged, empty string to clear.
50
+ * @type {string}
51
+ * @memberof UpdateUserRequest
52
+ */
53
+ bio?: string | null;
36
54
  }
37
55
  export declare const UpdateUserRequestPropertyValidationAttributesMap: {
38
56
  [property: string]: {
@@ -19,7 +19,23 @@ exports.UpdateUserRequestFromJSON = UpdateUserRequestFromJSON;
19
19
  exports.UpdateUserRequestFromJSONTyped = UpdateUserRequestFromJSONTyped;
20
20
  exports.UpdateUserRequestToJSON = UpdateUserRequestToJSON;
21
21
  exports.UpdateUserRequestToJSONTyped = UpdateUserRequestToJSONTyped;
22
- exports.UpdateUserRequestPropertyValidationAttributesMap = {};
22
+ exports.UpdateUserRequestPropertyValidationAttributesMap = {
23
+ firstName: {
24
+ maxLength: 255,
25
+ },
26
+ lastName: {
27
+ maxLength: 255,
28
+ },
29
+ jobTitle: {
30
+ maxLength: 120,
31
+ },
32
+ department: {
33
+ maxLength: 120,
34
+ },
35
+ bio: {
36
+ maxLength: 1000,
37
+ },
38
+ };
23
39
  /**
24
40
  * Check if a given object implements the UpdateUserRequest interface.
25
41
  */
@@ -37,6 +53,9 @@ function UpdateUserRequestFromJSONTyped(json, ignoreDiscriminator) {
37
53
  'defaultTenantId': json['default_tenant_id'] == null ? undefined : json['default_tenant_id'],
38
54
  'firstName': json['first_name'] == null ? undefined : json['first_name'],
39
55
  'lastName': json['last_name'] == null ? undefined : json['last_name'],
56
+ 'jobTitle': json['job_title'] == null ? undefined : json['job_title'],
57
+ 'department': json['department'] == null ? undefined : json['department'],
58
+ 'bio': json['bio'] == null ? undefined : json['bio'],
40
59
  };
41
60
  }
42
61
  function UpdateUserRequestToJSON(json) {
@@ -50,5 +69,8 @@ function UpdateUserRequestToJSONTyped(value, ignoreDiscriminator = false) {
50
69
  'default_tenant_id': value['defaultTenantId'],
51
70
  'first_name': value['firstName'],
52
71
  'last_name': value['lastName'],
72
+ 'job_title': value['jobTitle'],
73
+ 'department': value['department'],
74
+ 'bio': value['bio'],
53
75
  };
54
76
  }
@@ -77,6 +77,24 @@ export interface UserResponse {
77
77
  * @memberof UserResponse
78
78
  */
79
79
  jobTitle?: string | null;
80
+ /**
81
+ * User's department at the current tenant (per-membership)
82
+ * @type {string}
83
+ * @memberof UserResponse
84
+ */
85
+ department?: string | null;
86
+ /**
87
+ * What the user wrote about themselves at the current tenant. The chat agent reads it on every turn.
88
+ * @type {string}
89
+ * @memberof UserResponse
90
+ */
91
+ bio?: string | null;
92
+ /**
93
+ * Presigned URL of the user's profile photo at the current tenant. Expires after six hours; read GET /v1/users/me again for a fresh one.
94
+ * @type {string}
95
+ * @memberof UserResponse
96
+ */
97
+ avatarUrl?: string | null;
80
98
  /**
81
99
  * When the user finished onboarding for the current tenant. NULL = wizard should be shown.
82
100
  * @type {Date}
@@ -62,6 +62,9 @@ function UserResponseFromJSONTyped(json, ignoreDiscriminator) {
62
62
  'currentTenantRole': (0, TenantUserRole_1.TenantUserRoleFromJSON)(json['current_tenant_role']),
63
63
  'defaultTenantId': json['default_tenant_id'],
64
64
  'jobTitle': json['job_title'] == null ? undefined : json['job_title'],
65
+ 'department': json['department'] == null ? undefined : json['department'],
66
+ 'bio': json['bio'] == null ? undefined : json['bio'],
67
+ 'avatarUrl': json['avatar_url'] == null ? undefined : json['avatar_url'],
65
68
  'onboardingCompletedAt': json['onboarding_completed_at'] == null ? undefined : (new Date(json['onboarding_completed_at'])),
66
69
  };
67
70
  }
@@ -83,6 +86,9 @@ function UserResponseToJSONTyped(value, ignoreDiscriminator = false) {
83
86
  'current_tenant_role': (0, TenantUserRole_1.TenantUserRoleToJSON)(value['currentTenantRole']),
84
87
  'default_tenant_id': value['defaultTenantId'],
85
88
  'job_title': value['jobTitle'],
89
+ 'department': value['department'],
90
+ 'bio': value['bio'],
91
+ 'avatar_url': value['avatarUrl'],
86
92
  'onboarding_completed_at': value['onboardingCompletedAt'] == null ? value['onboardingCompletedAt'] : value['onboardingCompletedAt'].toISOString(),
87
93
  };
88
94
  }
@@ -9,6 +9,9 @@ Name | Type
9
9
  `defaultTenantId` | string
10
10
  `firstName` | string
11
11
  `lastName` | string
12
+ `jobTitle` | string
13
+ `department` | string
14
+ `bio` | string
12
15
 
13
16
  ## Example
14
17
 
@@ -20,6 +23,9 @@ const example = {
20
23
  "defaultTenantId": null,
21
24
  "firstName": null,
22
25
  "lastName": null,
26
+ "jobTitle": null,
27
+ "department": null,
28
+ "bio": null,
23
29
  } satisfies UpdateUserRequest
24
30
 
25
31
  console.log(example)
@@ -16,6 +16,9 @@ Name | Type
16
16
  `currentTenantRole` | [TenantUserRole](TenantUserRole.md)
17
17
  `defaultTenantId` | string
18
18
  `jobTitle` | string
19
+ `department` | string
20
+ `bio` | string
21
+ `avatarUrl` | string
19
22
  `onboardingCompletedAt` | Date
20
23
 
21
24
  ## Example
@@ -35,6 +38,9 @@ const example = {
35
38
  "currentTenantRole": null,
36
39
  "defaultTenantId": null,
37
40
  "jobTitle": null,
41
+ "department": null,
42
+ "bio": null,
43
+ "avatarUrl": null,
38
44
  "onboardingCompletedAt": null,
39
45
  } satisfies UserResponse
40
46
 
package/docs/UsersApi.md CHANGED
@@ -4,14 +4,82 @@ All URIs are relative to *http://localhost:8000*
4
4
 
5
5
  | Method | HTTP request | Description |
6
6
  |------------- | ------------- | -------------|
7
+ | [**deleteMyAvatar**](UsersApi.md#deletemyavatar) | **DELETE** /v1/users/me/avatar | Delete My Avatar Handler |
7
8
  | [**getMe**](UsersApi.md#getme) | **GET** /v1/users/me | Get Me Handler |
8
9
  | [**skipOnboarding**](UsersApi.md#skiponboarding) | **POST** /v1/users/me/onboarding/skip | Skip Onboarding Handler |
9
10
  | [**updateMe**](UsersApi.md#updateme) | **PATCH** /v1/users | Update Me Handler |
10
11
  | [**updateOnboardingCompany**](UsersApi.md#updateonboardingcompany) | **PATCH** /v1/users/me/onboarding/company | Update Onboarding Company Handler |
11
12
  | [**updateOnboardingProfile**](UsersApi.md#updateonboardingprofile) | **PATCH** /v1/users/me/onboarding/profile | Update Onboarding Profile Handler |
13
+ | [**uploadMyAvatar**](UsersApi.md#uploadmyavatar) | **POST** /v1/users/me/avatar | Upload My Avatar Handler |
12
14
 
13
15
 
14
16
 
17
+ ## deleteMyAvatar
18
+
19
+ > UserResponse deleteMyAvatar()
20
+
21
+ Delete My Avatar Handler
22
+
23
+ Remove the profile photo for the current tenant. No photo is a no-op.
24
+
25
+ ### Example
26
+
27
+ ```ts
28
+ import {
29
+ Configuration,
30
+ UsersApi,
31
+ } from '@knowledge-stack/ksapi';
32
+ import type { DeleteMyAvatarRequest } from '@knowledge-stack/ksapi';
33
+
34
+ async function example() {
35
+ console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
36
+ const config = new Configuration({
37
+ // To configure API key authorization: cookieAuth
38
+ apiKey: "YOUR API KEY",
39
+ // Configure HTTP bearer authorization: bearerAuth
40
+ accessToken: "YOUR BEARER TOKEN",
41
+ });
42
+ const api = new UsersApi(config);
43
+
44
+ try {
45
+ const data = await api.deleteMyAvatar();
46
+ console.log(data);
47
+ } catch (error) {
48
+ console.error(error);
49
+ }
50
+ }
51
+
52
+ // Run the test
53
+ example().catch(console.error);
54
+ ```
55
+
56
+ ### Parameters
57
+
58
+ This endpoint does not need any parameter.
59
+
60
+ ### Return type
61
+
62
+ [**UserResponse**](UserResponse.md)
63
+
64
+ ### Authorization
65
+
66
+ [cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
67
+
68
+ ### HTTP request headers
69
+
70
+ - **Content-Type**: Not defined
71
+ - **Accept**: `application/json`
72
+
73
+
74
+ ### HTTP response details
75
+ | Status code | Description | Response headers |
76
+ |-------------|-------------|------------------|
77
+ | **200** | Successful Response | - |
78
+ | **0** | Error response. | - |
79
+
80
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
81
+
82
+
15
83
  ## getMe
16
84
 
17
85
  > UserResponse getMe()
@@ -150,7 +218,7 @@ This endpoint does not need any parameter.
150
218
 
151
219
  Update Me Handler
152
220
 
153
- Update the user\'s profile (default tenant, name fields). When updating default_tenant_id, the user must belong to the specified tenant.
221
+ Update the user\'s name and default tenant, and the membership\'s profile. When updating default_tenant_id, the user must belong to the specified tenant.
154
222
 
155
223
  ### Example
156
224
 
@@ -300,7 +368,7 @@ example().catch(console.error);
300
368
 
301
369
  Update Onboarding Profile Handler
302
370
 
303
- 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).
371
+ 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.
304
372
 
305
373
  ### Example
306
374
 
@@ -368,3 +436,78 @@ example().catch(console.error);
368
436
 
369
437
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
370
438
 
439
+
440
+ ## uploadMyAvatar
441
+
442
+ > UserResponse uploadMyAvatar(file)
443
+
444
+ Upload My Avatar Handler
445
+
446
+ Set the profile photo for the current tenant. PNG, JPEG, WebP or GIF, at most 2 MB and 4096 px per side; the format is read from the bytes, not the content type.
447
+
448
+ ### Example
449
+
450
+ ```ts
451
+ import {
452
+ Configuration,
453
+ UsersApi,
454
+ } from '@knowledge-stack/ksapi';
455
+ import type { UploadMyAvatarRequest } from '@knowledge-stack/ksapi';
456
+
457
+ async function example() {
458
+ console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
459
+ const config = new Configuration({
460
+ // To configure API key authorization: cookieAuth
461
+ apiKey: "YOUR API KEY",
462
+ // Configure HTTP bearer authorization: bearerAuth
463
+ accessToken: "YOUR BEARER TOKEN",
464
+ });
465
+ const api = new UsersApi(config);
466
+
467
+ const body = {
468
+ // Blob
469
+ file: BINARY_DATA_HERE,
470
+ } satisfies UploadMyAvatarRequest;
471
+
472
+ try {
473
+ const data = await api.uploadMyAvatar(body);
474
+ console.log(data);
475
+ } catch (error) {
476
+ console.error(error);
477
+ }
478
+ }
479
+
480
+ // Run the test
481
+ example().catch(console.error);
482
+ ```
483
+
484
+ ### Parameters
485
+
486
+
487
+ | Name | Type | Description | Notes |
488
+ |------------- | ------------- | ------------- | -------------|
489
+ | **file** | `Blob` | | [Defaults to `undefined`] |
490
+
491
+ ### Return type
492
+
493
+ [**UserResponse**](UserResponse.md)
494
+
495
+ ### Authorization
496
+
497
+ [cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
498
+
499
+ ### HTTP request headers
500
+
501
+ - **Content-Type**: `multipart/form-data`
502
+ - **Accept**: `application/json`
503
+
504
+
505
+ ### HTTP response details
506
+ | Status code | Description | Response headers |
507
+ |-------------|-------------|------------------|
508
+ | **200** | Successful Response | - |
509
+ | **422** | Validation Error | - |
510
+ | **0** | Error response. | - |
511
+
512
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
513
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowledge-stack/ksapi",
3
- "version": "3.9.0",
3
+ "version": "3.10.0",
4
4
  "description": "OpenAPI client for @knowledge-stack/ksapi",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {