@xfloor/floor-memory-sdk-ts 1.0.16 → 1.0.18

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 (41) hide show
  1. package/README.md +17 -60
  2. package/dist/apis/DefaultApi.d.ts +12 -94
  3. package/dist/apis/DefaultApi.js +74 -427
  4. package/dist/models/index.d.ts +0 -17
  5. package/dist/models/index.js +0 -17
  6. package/dist/runtime.js +1 -1
  7. package/package.json +1 -1
  8. package/dist/models/ConversationThreads200Response.d.ts +0 -41
  9. package/dist/models/ConversationThreads200Response.js +0 -58
  10. package/dist/models/ConversationThreads200ResponseThreadsInner.d.ts +0 -46
  11. package/dist/models/ConversationThreads200ResponseThreadsInner.js +0 -61
  12. package/dist/models/GetConversations200Response.d.ts +0 -47
  13. package/dist/models/GetConversations200Response.js +0 -62
  14. package/dist/models/GetConversations200ResponseConversationInner.d.ts +0 -42
  15. package/dist/models/GetConversations200ResponseConversationInner.js +0 -55
  16. package/dist/models/GetConversations200ResponseConversationInnerAssistant.d.ts +0 -78
  17. package/dist/models/GetConversations200ResponseConversationInnerAssistant.js +0 -83
  18. package/dist/models/GetConversations200ResponseConversationInnerAssistantChoicesInner.d.ts +0 -61
  19. package/dist/models/GetConversations200ResponseConversationInnerAssistantChoicesInner.js +0 -62
  20. package/dist/models/GetConversations200ResponseConversationInnerAssistantChoicesInnerAiModelDetails.d.ts +0 -76
  21. package/dist/models/GetConversations200ResponseConversationInnerAssistantChoicesInnerAiModelDetails.js +0 -81
  22. package/dist/models/GetConversations200ResponseConversationInnerAssistantChoicesInnerMessage.d.ts +0 -40
  23. package/dist/models/GetConversations200ResponseConversationInnerAssistantChoicesInnerMessage.js +0 -57
  24. package/dist/models/GetConversations200ResponseConversationInnerAssistantChoicesInnerPromptDetails.d.ts +0 -40
  25. package/dist/models/GetConversations200ResponseConversationInnerAssistantChoicesInnerPromptDetails.js +0 -57
  26. package/dist/models/GetConversations200ResponseConversationInnerAssistantFetchMultiplePosts.d.ts +0 -59
  27. package/dist/models/GetConversations200ResponseConversationInnerAssistantFetchMultiplePosts.js +0 -70
  28. package/dist/models/GetConversations200ResponseConversationInnerAssistantFetchMultiplePostsResultsInner.d.ts +0 -82
  29. package/dist/models/GetConversations200ResponseConversationInnerAssistantFetchMultiplePostsResultsInner.js +0 -85
  30. package/dist/models/GetConversations200ResponseConversationInnerUser.d.ts +0 -59
  31. package/dist/models/GetConversations200ResponseConversationInnerUser.js +0 -70
  32. package/dist/models/GetConversations200ResponseConversationInnerUserContext.d.ts +0 -58
  33. package/dist/models/GetConversations200ResponseConversationInnerUserContext.js +0 -69
  34. package/dist/models/PostAdd.d.ts +0 -58
  35. package/dist/models/PostAdd.js +0 -69
  36. package/dist/models/SendSignInValidationCode200Response.d.ts +0 -46
  37. package/dist/models/SendSignInValidationCode200Response.js +0 -59
  38. package/dist/models/Threads.d.ts +0 -46
  39. package/dist/models/Threads.js +0 -61
  40. package/dist/models/ValidateCodeRequest.d.ts +0 -52
  41. package/dist/models/ValidateCodeRequest.js +0 -65
@@ -77,140 +77,6 @@ var DefaultApi = /** @class */ (function (_super) {
77
77
  function DefaultApi() {
78
78
  return _super !== null && _super.apply(this, arguments) || this;
79
79
  }
80
- /**
81
- * Create a custom app using APIs. A 13 digit app ID gets created which takes title and description the app. An icon of specified size needs to be uploaded.
82
- * Create App
83
- */
84
- DefaultApi.prototype.apiDeveloperCreateAppPostRaw = function (requestParameters, initOverrides) {
85
- return __awaiter(this, void 0, void 0, function () {
86
- var queryParameters, headerParameters, consumes, canConsumeForm, formParams, useForm, urlPath, response;
87
- return __generator(this, function (_a) {
88
- switch (_a.label) {
89
- case 0:
90
- if (requestParameters['inputInfo'] == null) {
91
- throw new runtime.RequiredError('inputInfo', 'Required parameter "inputInfo" was null or undefined when calling apiDeveloperCreateAppPost().');
92
- }
93
- queryParameters = {};
94
- headerParameters = {};
95
- consumes = [
96
- { contentType: 'multipart/form-data' },
97
- ];
98
- canConsumeForm = runtime.canConsumeForm(consumes);
99
- useForm = false;
100
- // use FormData to transmit files using content-type "multipart/form-data"
101
- useForm = canConsumeForm;
102
- if (useForm) {
103
- formParams = new FormData();
104
- }
105
- else {
106
- formParams = new URLSearchParams();
107
- }
108
- if (requestParameters['inputInfo'] != null) {
109
- formParams.append('input_info', requestParameters['inputInfo']);
110
- }
111
- if (requestParameters['icon'] != null) {
112
- formParams.append('icon', requestParameters['icon']);
113
- }
114
- urlPath = "/api/developer/create/app";
115
- return [4 /*yield*/, this.request({
116
- path: urlPath,
117
- method: 'POST',
118
- headers: headerParameters,
119
- query: queryParameters,
120
- body: formParams,
121
- }, initOverrides)];
122
- case 1:
123
- response = _a.sent();
124
- return [2 /*return*/, new runtime.JSONApiResponse(response)];
125
- }
126
- });
127
- });
128
- };
129
- /**
130
- * Create a custom app using APIs. A 13 digit app ID gets created which takes title and description the app. An icon of specified size needs to be uploaded.
131
- * Create App
132
- */
133
- DefaultApi.prototype.apiDeveloperCreateAppPost = function (requestParameters, initOverrides) {
134
- return __awaiter(this, void 0, void 0, function () {
135
- var response;
136
- return __generator(this, function (_a) {
137
- switch (_a.label) {
138
- case 0: return [4 /*yield*/, this.apiDeveloperCreateAppPostRaw(requestParameters, initOverrides)];
139
- case 1:
140
- response = _a.sent();
141
- return [4 /*yield*/, response.value()];
142
- case 2: return [2 /*return*/, _a.sent()];
143
- }
144
- });
145
- });
146
- };
147
- /**
148
- * Modify title, details or the app icon
149
- * Modify Floorpod App
150
- */
151
- DefaultApi.prototype.apiDeveloperModifyAppPostRaw = function (requestParameters, initOverrides) {
152
- return __awaiter(this, void 0, void 0, function () {
153
- var queryParameters, headerParameters, consumes, canConsumeForm, formParams, useForm, urlPath, response;
154
- return __generator(this, function (_a) {
155
- switch (_a.label) {
156
- case 0:
157
- if (requestParameters['inputInfo'] == null) {
158
- throw new runtime.RequiredError('inputInfo', 'Required parameter "inputInfo" was null or undefined when calling apiDeveloperModifyAppPost().');
159
- }
160
- queryParameters = {};
161
- headerParameters = {};
162
- consumes = [
163
- { contentType: 'multipart/form-data' },
164
- ];
165
- canConsumeForm = runtime.canConsumeForm(consumes);
166
- useForm = false;
167
- // use FormData to transmit files using content-type "multipart/form-data"
168
- useForm = canConsumeForm;
169
- if (useForm) {
170
- formParams = new FormData();
171
- }
172
- else {
173
- formParams = new URLSearchParams();
174
- }
175
- if (requestParameters['inputInfo'] != null) {
176
- formParams.append('input_info', requestParameters['inputInfo']);
177
- }
178
- if (requestParameters['file'] != null) {
179
- formParams.append('file', requestParameters['file']);
180
- }
181
- urlPath = "/api/developer/modify/app";
182
- return [4 /*yield*/, this.request({
183
- path: urlPath,
184
- method: 'POST',
185
- headers: headerParameters,
186
- query: queryParameters,
187
- body: formParams,
188
- }, initOverrides)];
189
- case 1:
190
- response = _a.sent();
191
- return [2 /*return*/, new runtime.JSONApiResponse(response)];
192
- }
193
- });
194
- });
195
- };
196
- /**
197
- * Modify title, details or the app icon
198
- * Modify Floorpod App
199
- */
200
- DefaultApi.prototype.apiDeveloperModifyAppPost = function (requestParameters, initOverrides) {
201
- return __awaiter(this, void 0, void 0, function () {
202
- var response;
203
- return __generator(this, function (_a) {
204
- switch (_a.label) {
205
- case 0: return [4 /*yield*/, this.apiDeveloperModifyAppPostRaw(requestParameters, initOverrides)];
206
- case 1:
207
- response = _a.sent();
208
- return [4 /*yield*/, response.value()];
209
- case 2: return [2 /*return*/, _a.sent()];
210
- }
211
- });
212
- });
213
- };
214
80
  /**
215
81
  * Updates the email ID associated with an existing user account after validating a one-time activation code sent to the **new email address**. This operation can only be performed by a **logged-in user**. When a user initiates an email change, an activation code is sent to the newly provided email ID. The email update takes effect only after the activation code is successfully validated. If the activation code validation fails, the email ID remains unchanged. --- ### **Authentication** This endpoint requires **Bearer Token authentication**. ``` Authorization: Bearer <access_token> ``` --- ### **Request Body** ```json { \"user_id\": \"string\", \"new_email_id\": \"string\", \"activation_code\": \"string\", \"app_id\":\"string\" } ``` **Field Description** * `user_id` – Unique identifier of the logged-in user * `new_email_id` – New email address to be associated with the account * `activation_code` – One-time activation code sent to the new email ID for verification --- ### **Flow Summary** 1. User is authenticated and logged in 2. User requests to change email ID 3. System sends an activation code to the **new email address** 4. User submits the activation code via this API 5. On successful validation, the email ID is updated --- ### **Successful Response** On successful validation: * The activation code is verified * The user’s email ID is updated immediately * A `success` string is returned confirming the email change --- ### **Error Response** The API returns an error response if: * The activation code is invalid or expired * The activation code does not match the user or email * The new email ID is already in use * Authorization fails or the bearer token is missing or invalid In all error cases, the existing email ID remains unchanged. --- ### **Behavior Notes** * Requires a prior call to `/auth-service/send/validation/code` with the proper mode. --- ### **Security Notes (Recommended)** * Activation codes are single-use and time-bound * Email changes require prior authentication * Rate limiting may be applied to prevent abuse --- ### **One-Line Summary** > Changes a user’s email ID after validating an activation code sent to the new email address.
216
82
  * Change email ID
@@ -295,16 +161,18 @@ var DefaultApi = /** @class */ (function (_super) {
295
161
  */
296
162
  DefaultApi.prototype.changeMobileNumberRaw = function (requestParameters, initOverrides) {
297
163
  return __awaiter(this, void 0, void 0, function () {
298
- var queryParameters, headerParameters, token, tokenString, urlPath, response;
164
+ var queryParameters, headerParameters, token, tokenString, consumes, canConsumeForm, formParams, useForm, urlPath, response;
299
165
  return __generator(this, function (_a) {
300
166
  switch (_a.label) {
301
167
  case 0:
302
- if (requestParameters['body'] == null) {
303
- throw new runtime.RequiredError('body', 'Required parameter "body" was null or undefined when calling changeMobileNumber().');
168
+ if (requestParameters['newMobileNumber'] == null) {
169
+ throw new runtime.RequiredError('newMobileNumber', 'Required parameter "newMobileNumber" was null or undefined when calling changeMobileNumber().');
170
+ }
171
+ if (requestParameters['activationCode'] == null) {
172
+ throw new runtime.RequiredError('activationCode', 'Required parameter "activationCode" was null or undefined when calling changeMobileNumber().');
304
173
  }
305
174
  queryParameters = {};
306
175
  headerParameters = {};
307
- headerParameters['Content-Type'] = 'application/json';
308
176
  if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
309
177
  token = this.configuration.accessToken;
310
178
  return [4 /*yield*/, token("bearer", [])];
@@ -315,13 +183,30 @@ var DefaultApi = /** @class */ (function (_super) {
315
183
  }
316
184
  _a.label = 2;
317
185
  case 2:
186
+ consumes = [
187
+ { contentType: 'multipart/form-data' },
188
+ ];
189
+ canConsumeForm = runtime.canConsumeForm(consumes);
190
+ useForm = false;
191
+ if (useForm) {
192
+ formParams = new FormData();
193
+ }
194
+ else {
195
+ formParams = new URLSearchParams();
196
+ }
197
+ if (requestParameters['newMobileNumber'] != null) {
198
+ formParams.append('new_mobile_number', requestParameters['newMobileNumber']);
199
+ }
200
+ if (requestParameters['activationCode'] != null) {
201
+ formParams.append('activation_code', requestParameters['activationCode']);
202
+ }
318
203
  urlPath = "/auth-service/change/mobile";
319
204
  return [4 /*yield*/, this.request({
320
205
  path: urlPath,
321
206
  method: 'POST',
322
207
  headers: headerParameters,
323
208
  query: queryParameters,
324
- body: requestParameters['body'],
209
+ body: formParams,
325
210
  }, initOverrides)];
326
211
  case 3:
327
212
  response = _a.sent();
@@ -429,133 +314,6 @@ var DefaultApi = /** @class */ (function (_super) {
429
314
  });
430
315
  });
431
316
  };
432
- /**
433
- * ### Conversation Model - A **Thread** represents a single conversational context. - A **Conversation** is the ordered exchange of messages within a thread. - Threads are scoped per user and per floor. This API retrieves the list of **conversational threads** associated with a specific **user** within a specific **floor**. A **thread** represents a persistent conversation context between the user and the system (agent/assistant) inside a floor. Each thread maintains its own history and state, allowing users to resume previous conversations without losing context. The API returns **only thread metadata**, not the message content itself. This makes it suitable for: * Displaying a conversation list or sidebar * Allowing users to select and resume past conversations * Managing conversational memory per floor --- ## Key Concepts * **Thread**: A long-lived conversational context tied to a user and a floor * **Floor-scoped memory**: Conversations are isolated per floor; threads from one floor are not visible in another * **User-specific**: Threads are private to the requesting user --- ## Request Method `GET` --- ## Request Parameters (Query Parameters) | Parameter Name | Type | Required | Description | | -------------- | ------ | -------- | ---------------------------------------------------------------------------- | | `user_id` | String | **Yes** | Unique identifier of the user whose conversation threads are being requested | | `floor_id` | String | **Yes** | Identifier of the floor in which the conversations exist | --- ## Authorization & Access Rules * The caller must be authenticated as the given `user_id` * A user can retrieve **only their own threads** * Threads are scoped to the provided `floor_id` * Threads from other floors or other users are not accessible --- ## Response Format `application/json` --- ## Response Description The response contains: * The `user_id` for which threads were fetched * A list of thread metadata objects, sorted by **most recently updated first** --- ## Response Structure ### Top-Level Fields | Field | Type | Description | | --------- | ------ | ------------------------------------------------------------------------- | | `user_id` | String | Identifier of the user | | `threads` | Array | List of conversation threads belonging to the user in the specified floor | --- ### Thread Object (`threads[]`) | Field | Type | Description | | -------------- | ------------------- | ------------------------------------------------- | | `thread_id` | String | Unique identifier of the conversation thread | | `title` | String | Human-readable title summarizing the conversation | | `last_updated` | String (YYYY-MM-DD) | Date when the thread was last updated | --- ## Sample Success Response ```json { \"user_id\": \"59\", \"threads\": [ { \"thread_id\": \"55\", \"title\": \"elegant potentially hopelessly ambitious sneak\", \"last_updated\": \"2025-04-26\" }, { \"thread_id\": \"79\", \"title\": \"sans profitable alienated by even overstay miserly practical\", \"last_updated\": \"2025-04-24\" }, { \"thread_id\": \"89\", \"title\": \"although light uh-huh despite instead vol sorrowful\", \"last_updated\": \"2025-02-16\" } ] } ``` --- ## Typical Use Cases * Show a **list of past conversations** in a chat UI * Allow users to **resume a previous thread** * Display conversation history grouped by floor * Build agent dashboards with user-specific memory --- ## Notes * This API returns **metadata only**; message history is retrieved using a separate thread-messages API * If no threads exist, the `threads` array will be empty * Thread titles may be system-generated or user-editable depending on implementation --- ## Common Error Responses (Examples) ### Missing Parameters ```json { \"status\": \"ERROR\", \"message\": \"user_id and floor_id are required\" } ``` ### Unauthorised Access ```json { \"status\": \"ERROR\", \"message\": \"Unauthorized access to conversation threads\" } ```
434
- * Get the conversational threads
435
- */
436
- DefaultApi.prototype.conversationThreadsRaw = function (requestParameters, initOverrides) {
437
- return __awaiter(this, void 0, void 0, function () {
438
- var queryParameters, headerParameters, token, tokenString, urlPath, response;
439
- return __generator(this, function (_a) {
440
- switch (_a.label) {
441
- case 0:
442
- if (requestParameters['userId'] == null) {
443
- throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling conversationThreads().');
444
- }
445
- if (requestParameters['floorId'] == null) {
446
- throw new runtime.RequiredError('floorId', 'Required parameter "floorId" was null or undefined when calling conversationThreads().');
447
- }
448
- queryParameters = {};
449
- if (requestParameters['userId'] != null) {
450
- queryParameters['user_id'] = requestParameters['userId'];
451
- }
452
- if (requestParameters['floorId'] != null) {
453
- queryParameters['floor_id'] = requestParameters['floorId'];
454
- }
455
- headerParameters = {};
456
- if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
457
- token = this.configuration.accessToken;
458
- return [4 /*yield*/, token("bearer", [])];
459
- case 1:
460
- tokenString = _a.sent();
461
- if (tokenString) {
462
- headerParameters["Authorization"] = "Bearer ".concat(tokenString);
463
- }
464
- _a.label = 2;
465
- case 2:
466
- urlPath = "/agent/memory/threads";
467
- return [4 /*yield*/, this.request({
468
- path: urlPath,
469
- method: 'GET',
470
- headers: headerParameters,
471
- query: queryParameters,
472
- }, initOverrides)];
473
- case 3:
474
- response = _a.sent();
475
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.ConversationThreads200ResponseFromJSON)(jsonValue); })];
476
- }
477
- });
478
- });
479
- };
480
- /**
481
- * ### Conversation Model - A **Thread** represents a single conversational context. - A **Conversation** is the ordered exchange of messages within a thread. - Threads are scoped per user and per floor. This API retrieves the list of **conversational threads** associated with a specific **user** within a specific **floor**. A **thread** represents a persistent conversation context between the user and the system (agent/assistant) inside a floor. Each thread maintains its own history and state, allowing users to resume previous conversations without losing context. The API returns **only thread metadata**, not the message content itself. This makes it suitable for: * Displaying a conversation list or sidebar * Allowing users to select and resume past conversations * Managing conversational memory per floor --- ## Key Concepts * **Thread**: A long-lived conversational context tied to a user and a floor * **Floor-scoped memory**: Conversations are isolated per floor; threads from one floor are not visible in another * **User-specific**: Threads are private to the requesting user --- ## Request Method `GET` --- ## Request Parameters (Query Parameters) | Parameter Name | Type | Required | Description | | -------------- | ------ | -------- | ---------------------------------------------------------------------------- | | `user_id` | String | **Yes** | Unique identifier of the user whose conversation threads are being requested | | `floor_id` | String | **Yes** | Identifier of the floor in which the conversations exist | --- ## Authorization & Access Rules * The caller must be authenticated as the given `user_id` * A user can retrieve **only their own threads** * Threads are scoped to the provided `floor_id` * Threads from other floors or other users are not accessible --- ## Response Format `application/json` --- ## Response Description The response contains: * The `user_id` for which threads were fetched * A list of thread metadata objects, sorted by **most recently updated first** --- ## Response Structure ### Top-Level Fields | Field | Type | Description | | --------- | ------ | ------------------------------------------------------------------------- | | `user_id` | String | Identifier of the user | | `threads` | Array | List of conversation threads belonging to the user in the specified floor | --- ### Thread Object (`threads[]`) | Field | Type | Description | | -------------- | ------------------- | ------------------------------------------------- | | `thread_id` | String | Unique identifier of the conversation thread | | `title` | String | Human-readable title summarizing the conversation | | `last_updated` | String (YYYY-MM-DD) | Date when the thread was last updated | --- ## Sample Success Response ```json { \"user_id\": \"59\", \"threads\": [ { \"thread_id\": \"55\", \"title\": \"elegant potentially hopelessly ambitious sneak\", \"last_updated\": \"2025-04-26\" }, { \"thread_id\": \"79\", \"title\": \"sans profitable alienated by even overstay miserly practical\", \"last_updated\": \"2025-04-24\" }, { \"thread_id\": \"89\", \"title\": \"although light uh-huh despite instead vol sorrowful\", \"last_updated\": \"2025-02-16\" } ] } ``` --- ## Typical Use Cases * Show a **list of past conversations** in a chat UI * Allow users to **resume a previous thread** * Display conversation history grouped by floor * Build agent dashboards with user-specific memory --- ## Notes * This API returns **metadata only**; message history is retrieved using a separate thread-messages API * If no threads exist, the `threads` array will be empty * Thread titles may be system-generated or user-editable depending on implementation --- ## Common Error Responses (Examples) ### Missing Parameters ```json { \"status\": \"ERROR\", \"message\": \"user_id and floor_id are required\" } ``` ### Unauthorised Access ```json { \"status\": \"ERROR\", \"message\": \"Unauthorized access to conversation threads\" } ```
482
- * Get the conversational threads
483
- */
484
- DefaultApi.prototype.conversationThreads = function (requestParameters, initOverrides) {
485
- return __awaiter(this, void 0, void 0, function () {
486
- var response;
487
- return __generator(this, function (_a) {
488
- switch (_a.label) {
489
- case 0: return [4 /*yield*/, this.conversationThreadsRaw(requestParameters, initOverrides)];
490
- case 1:
491
- response = _a.sent();
492
- return [4 /*yield*/, response.value()];
493
- case 2: return [2 /*return*/, _a.sent()];
494
- }
495
- });
496
- });
497
- };
498
- /**
499
- * This API returns the **full conversation history** for a specific **thread** belonging to a user within a floor. A **thread** represents a persistent conversation session. Each item in the returned `conversation` array contains: * The **user request payload** (user query + context) * The **assistant response payload** (full LLM completion object) * The **retrieval trace** (metadata of posts fetched/used for the answer, including scores and identifiers) This endpoint is intended for **developers** building custom conversational UIs and tooling that require: * Full conversation replay * Debug visibility into the assistant output object (`choices`, model info, etc.) * RAG explainability via `fetch_multiple_posts.results[]` --- ## Request Method `GET` --- ## Query Parameters | Parameter | Type | Required | Description | | ----------- | ------ | -------- | --------------------------------------------------------------------------- | | `user_id` | String | **Yes** | Owner of the conversation thread. The thread must belong to this user. | | `floor_id` | String | **Yes** | Floor identifier in which the thread exists. Threads are scoped to a floor. | | `thread_id` | String | **Yes** | Thread identifier whose conversations should be returned. | --- ## Authorization & Access Rules * The caller must be authenticated as the given `user_id` (or have equivalent developer/system permission). * A user can access **only their own threads**. * Cross-user or cross-floor access must be rejected. --- ## Response Format `application/json` --- ## Response Description Returns the thread-level conversation payload: * `user_id`: the user who owns the thread * `thread_id`: the requested thread * `conversation`: ordered list of conversation entries (each entry = user object + assistant object) --- ## Response Schema ### Top-Level Fields | Field | Type | Description | | -------------- | ------ | ---------------------------- | | `user_id` | String | Owner of the thread | | `thread_id` | String | Thread identifier | | `conversation` | Array | List of conversation entries | --- ## `conversation[]` Entry Structure Each entry contains two objects: `user` and `assistant`. --- ### `user` Object | Field | Type | Description | | ------------------ | ------ | ------------------------------------------------------------------- | | `context` | Object | Context used when processing the query (floor metadata, mode, etc.) | | `user_query` | String | The user’s query message | | `user_id` | String | User identifier (should match top-level `user_id`) | | `user_thread` | String | Thread identifier (should match top-level `thread_id`) | | `recorded_content` | String | Persisted user content (often same as `user_query`) | #### `user.context` | Field | Type | Description | | ---------------- | ------ | ---------------------------------------------- | | `floor_id` | String | Floor UID/slug where the conversation occurred | | `title` | String | Floor title at the time of the query | | `fid` | String | Immutable internal floor ID | | `floor_category` | String | Floor category identifier | | `floor_mode` | String | Floor mode indicator (example: `\"1\"`) | --- ### `assistant` Object This contains the **full completion response** plus retrieval details. | Field | Type | Description | | ---------------------- | ------ | --------------------------------------------------- | | `id` | String | Completion id (e.g., `chatcmpl-*`) | | `object` | String | Response type (e.g., `chat.completion`) | | `created` | Number | Timestamp when response was created (epoch seconds) | | `floor_mode` | String | Floor mode applied for generation | | `model` | String | Model identifier used | | `choices` | Array | Generated outputs and metadata | | `fetch_multiple_posts` | Object | Retrieval trace (if retrieval was performed) | | `content_type` | String | Retrieved content type (e.g., `post`) | --- ## `assistant.choices[]` | Field | Type | Description | | ------------------ | ------ | -------------------------------------------------------------------------- | | `index` | Number | Choice index | | `message` | Object | Assistant message content | | `finish_reason` | String | Why generation stopped (`stop`, `length`, etc.) | | `ai_model_details` | Object | Model runtime parameters (temperature, top_p, max_tokens, penalties, etc.) | | `prompt_details` | Object | Prompt configuration used (system prompt, system_prompt_id, etc.) | > **Note:** `prompt_details.system_prompt` may be large and is returned as-is for developer inspection. --- ## `assistant.fetch_multiple_posts` Describes the retrieval operation performed for the query. | Field | Type | Description | | -------------- | ------ | -------------------------------------- | | `content_type` | String | Type of retrieved content (`post`) | | `query` | String | Query used for retrieval | | `status` | String | Retrieval status (`success`, `failed`) | | `message` | String | Retrieval message | | `results` | Array | List of matched posts and metadata | --- ## `assistant.fetch_multiple_posts.results[]` | Field | Type | Description | | ------------ | ------ | ----------------------------------------------------------------- | | `from_floor` | String | Indicates source floor relation (e.g., same floor / linked floor) | | `content` | String | Raw JSON string of the matched post metadata/content | | `author` | String | Author id of the matched post | | `block_type` | Number | Block type of the matched post | | `pid` | String | Post/document id | | `bid` | String | Block id containing the post | | `fid` | String | Floor internal id where the post belongs | | `score` | Number | Similarity score | | `match_type` | String | Match type (`text`, etc.) | --- ## Sample Success Response Your provided payload is the canonical example. It includes: * the user query and floor context * the full assistant completion object * the full retrieval results with post metadata * the response shown covers a few important items. --- ## Common Error Responses ### Missing Parameters ```json { \"status\": \"ERROR\", \"message\": \"user_id, floor_id, and thread_id are required\" } ``` ### Unauthorized Access ```json { \"status\": \"ERROR\", \"message\": \"Unauthorized access to thread\" } ``` ### Thread Not Found ```json { \"status\": \"ERROR\", \"message\": \"Thread not found\" } ``` --- ## Developer Notes (Important) * The `content` field inside retrieval results is a **stringified JSON**. Developers may parse it to access fields such as `post_title`, `post_details`, etc. * `choices` may contain multiple outputs depending on backend configuration. * This API returns a “full debug payload” suitable for developers. If you later create a lightweight UI endpoint, it should strip execution details and return only `user_query`, `assistant.content`, and curated post references.
500
- * Conversations
501
- */
502
- DefaultApi.prototype.getConversationsRaw = function (requestParameters, initOverrides) {
503
- return __awaiter(this, void 0, void 0, function () {
504
- var queryParameters, headerParameters, token, tokenString, urlPath, response;
505
- return __generator(this, function (_a) {
506
- switch (_a.label) {
507
- case 0:
508
- queryParameters = {};
509
- if (requestParameters['userId'] != null) {
510
- queryParameters['user_id'] = requestParameters['userId'];
511
- }
512
- if (requestParameters['threadId'] != null) {
513
- queryParameters['thread_id'] = requestParameters['threadId'];
514
- }
515
- headerParameters = {};
516
- if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
517
- token = this.configuration.accessToken;
518
- return [4 /*yield*/, token("bearer", [])];
519
- case 1:
520
- tokenString = _a.sent();
521
- if (tokenString) {
522
- headerParameters["Authorization"] = "Bearer ".concat(tokenString);
523
- }
524
- _a.label = 2;
525
- case 2:
526
- urlPath = "/agent/memory/conversations";
527
- return [4 /*yield*/, this.request({
528
- path: urlPath,
529
- method: 'GET',
530
- headers: headerParameters,
531
- query: queryParameters,
532
- }, initOverrides)];
533
- case 3:
534
- response = _a.sent();
535
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.GetConversations200ResponseFromJSON)(jsonValue); })];
536
- }
537
- });
538
- });
539
- };
540
- /**
541
- * This API returns the **full conversation history** for a specific **thread** belonging to a user within a floor. A **thread** represents a persistent conversation session. Each item in the returned `conversation` array contains: * The **user request payload** (user query + context) * The **assistant response payload** (full LLM completion object) * The **retrieval trace** (metadata of posts fetched/used for the answer, including scores and identifiers) This endpoint is intended for **developers** building custom conversational UIs and tooling that require: * Full conversation replay * Debug visibility into the assistant output object (`choices`, model info, etc.) * RAG explainability via `fetch_multiple_posts.results[]` --- ## Request Method `GET` --- ## Query Parameters | Parameter | Type | Required | Description | | ----------- | ------ | -------- | --------------------------------------------------------------------------- | | `user_id` | String | **Yes** | Owner of the conversation thread. The thread must belong to this user. | | `floor_id` | String | **Yes** | Floor identifier in which the thread exists. Threads are scoped to a floor. | | `thread_id` | String | **Yes** | Thread identifier whose conversations should be returned. | --- ## Authorization & Access Rules * The caller must be authenticated as the given `user_id` (or have equivalent developer/system permission). * A user can access **only their own threads**. * Cross-user or cross-floor access must be rejected. --- ## Response Format `application/json` --- ## Response Description Returns the thread-level conversation payload: * `user_id`: the user who owns the thread * `thread_id`: the requested thread * `conversation`: ordered list of conversation entries (each entry = user object + assistant object) --- ## Response Schema ### Top-Level Fields | Field | Type | Description | | -------------- | ------ | ---------------------------- | | `user_id` | String | Owner of the thread | | `thread_id` | String | Thread identifier | | `conversation` | Array | List of conversation entries | --- ## `conversation[]` Entry Structure Each entry contains two objects: `user` and `assistant`. --- ### `user` Object | Field | Type | Description | | ------------------ | ------ | ------------------------------------------------------------------- | | `context` | Object | Context used when processing the query (floor metadata, mode, etc.) | | `user_query` | String | The user’s query message | | `user_id` | String | User identifier (should match top-level `user_id`) | | `user_thread` | String | Thread identifier (should match top-level `thread_id`) | | `recorded_content` | String | Persisted user content (often same as `user_query`) | #### `user.context` | Field | Type | Description | | ---------------- | ------ | ---------------------------------------------- | | `floor_id` | String | Floor UID/slug where the conversation occurred | | `title` | String | Floor title at the time of the query | | `fid` | String | Immutable internal floor ID | | `floor_category` | String | Floor category identifier | | `floor_mode` | String | Floor mode indicator (example: `\"1\"`) | --- ### `assistant` Object This contains the **full completion response** plus retrieval details. | Field | Type | Description | | ---------------------- | ------ | --------------------------------------------------- | | `id` | String | Completion id (e.g., `chatcmpl-*`) | | `object` | String | Response type (e.g., `chat.completion`) | | `created` | Number | Timestamp when response was created (epoch seconds) | | `floor_mode` | String | Floor mode applied for generation | | `model` | String | Model identifier used | | `choices` | Array | Generated outputs and metadata | | `fetch_multiple_posts` | Object | Retrieval trace (if retrieval was performed) | | `content_type` | String | Retrieved content type (e.g., `post`) | --- ## `assistant.choices[]` | Field | Type | Description | | ------------------ | ------ | -------------------------------------------------------------------------- | | `index` | Number | Choice index | | `message` | Object | Assistant message content | | `finish_reason` | String | Why generation stopped (`stop`, `length`, etc.) | | `ai_model_details` | Object | Model runtime parameters (temperature, top_p, max_tokens, penalties, etc.) | | `prompt_details` | Object | Prompt configuration used (system prompt, system_prompt_id, etc.) | > **Note:** `prompt_details.system_prompt` may be large and is returned as-is for developer inspection. --- ## `assistant.fetch_multiple_posts` Describes the retrieval operation performed for the query. | Field | Type | Description | | -------------- | ------ | -------------------------------------- | | `content_type` | String | Type of retrieved content (`post`) | | `query` | String | Query used for retrieval | | `status` | String | Retrieval status (`success`, `failed`) | | `message` | String | Retrieval message | | `results` | Array | List of matched posts and metadata | --- ## `assistant.fetch_multiple_posts.results[]` | Field | Type | Description | | ------------ | ------ | ----------------------------------------------------------------- | | `from_floor` | String | Indicates source floor relation (e.g., same floor / linked floor) | | `content` | String | Raw JSON string of the matched post metadata/content | | `author` | String | Author id of the matched post | | `block_type` | Number | Block type of the matched post | | `pid` | String | Post/document id | | `bid` | String | Block id containing the post | | `fid` | String | Floor internal id where the post belongs | | `score` | Number | Similarity score | | `match_type` | String | Match type (`text`, etc.) | --- ## Sample Success Response Your provided payload is the canonical example. It includes: * the user query and floor context * the full assistant completion object * the full retrieval results with post metadata * the response shown covers a few important items. --- ## Common Error Responses ### Missing Parameters ```json { \"status\": \"ERROR\", \"message\": \"user_id, floor_id, and thread_id are required\" } ``` ### Unauthorized Access ```json { \"status\": \"ERROR\", \"message\": \"Unauthorized access to thread\" } ``` ### Thread Not Found ```json { \"status\": \"ERROR\", \"message\": \"Thread not found\" } ``` --- ## Developer Notes (Important) * The `content` field inside retrieval results is a **stringified JSON**. Developers may parse it to access fields such as `post_title`, `post_details`, etc. * `choices` may contain multiple outputs depending on backend configuration. * This API returns a “full debug payload” suitable for developers. If you later create a lightweight UI endpoint, it should strip execution details and return only `user_query`, `assistant.content`, and curated post references.
542
- * Conversations
543
- */
544
- DefaultApi.prototype.getConversations = function () {
545
- return __awaiter(this, arguments, void 0, function (requestParameters, initOverrides) {
546
- var response;
547
- if (requestParameters === void 0) { requestParameters = {}; }
548
- return __generator(this, function (_a) {
549
- switch (_a.label) {
550
- case 0: return [4 /*yield*/, this.getConversationsRaw(requestParameters, initOverrides)];
551
- case 1:
552
- response = _a.sent();
553
- return [4 /*yield*/, response.value()];
554
- case 2: return [2 /*return*/, _a.sent()];
555
- }
556
- });
557
- });
558
- };
559
317
  /**
560
318
  * This API changes a floor’s visibility to **PRIVATE**. It is used when a floor owner wants to **restrict access** to a floor that is currently public. After the update, the floor becomes private and is no longer accessible to non-authorized users (based on your platform’s access rules). This endpoint is **state-changing**: * If the floor is **PUBLIC**, it will be converted to **PRIVATE** * If the floor is already **PRIVATE**, the API returns success (idempotent) or an “already private” response depending on implementation This API is commonly used in: * Floor settings → “Privacy” toggle * Developer-managed pod workflows (app_id context) * Admin tools (if applicable) --- ## Request Method `POST` --- ## Content-Type `application/x-www-form-urlencoded` (or `multipart/form-data` if your system uses form-data) *(Document whichever you actually accept; below assumes standard form fields.)* --- ## Request Parameters (Form Fields) | Field | Type | Required | Description | | ---------- | ------ | -------- | -------------------------------------------------------------------- | | `user_id` | String | **Yes** | User requesting the change. Must be the **owner** of the floor. | | `floor_id` | String | **Yes** | Public identifier of the floor to update. | | `app_id` | String | No | Calling application identifier (used for developer/pod integration). | --- ## Authorization Rules (Critical) * The caller must be authenticated as `user_id` * **Only the floor owner** can change floor visibility * If the user is not the owner, the request must be rejected --- ## Behavior Rules * Converts visibility from **PUBLIC → PRIVATE** * Does not modify floor content or blocks * Access enforcement for private floors is applied immediately after the change **Idempotency** * Calling this API multiple times should not cause repeated changes * If already private, the API should either: * return success with a message like `\"already private\"`, or * return a specific error/status indicating no-op --- ## Response Format `application/json` --- ## Sample Success Response *(Example — adjust to match your actual response format)* ```json { \"status\": \"SUCCESS\", \"floor_id\": \"my_floor\", \"visibility\": \"PRIVATE\", \"message\": \"Floor is now private\" } ``` --- ## Sample No-Op Response (Already Private) ```json { \"status\": \"SUCCESS\", \"floor_id\": \"my_floor\", \"visibility\": \"PRIVATE\", \"message\": \"Floor is already private\" } ``` --- ## Error Responses (Examples) ### Not Authorized (Not Owner) ```json { \"status\": \"ERROR\", \"message\": \"Only the floor owner can change floor visibility\" } ``` ### Floor Not Found ```json { \"status\": \"ERROR\", \"message\": \"Floor not found\" } ``` ### Invalid Request ```json { \"status\": \"ERROR\", \"message\": \"user_id and floor_id are required\" } ``` --- ## Notes * This API is intended to control floor visibility only; membership/invite rules (for private floors) are handled elsewhere. * `app_id` is provided for developer/pod applications and is optional unless enforced by your app model. * If you support floor types like `POD`, document whether pods are allowed to be private or not (some platforms restrict this).
561
319
  * Make floor Private
@@ -696,85 +454,6 @@ var DefaultApi = /** @class */ (function (_super) {
696
454
  });
697
455
  });
698
456
  };
699
- /**
700
- * This API allows a calling application to **pass externally authenticated user identity information to xfloor** after completing authentication within its own system. xfloor **does not perform authentication, credential verification, or session management** as part of this API. The calling application is fully responsible for validating the user and ensuring the correctness of the identity data provided. Upon invocation, xfloor will: * **Create a new user profile** if no matching user exists, or * **Update the existing user profile** if the user is already present. xfloor returns a unique `xfloor_user_id`, which serves as the **canonical user identifier** and must be used in all subsequent xfloor APIs, including floors, blocks, conversations, memory interactions, and analytics.
701
- * External User Registration
702
- */
703
- DefaultApi.prototype.registerExternalUserIdentityRaw = function (requestParameters, initOverrides) {
704
- return __awaiter(this, void 0, void 0, function () {
705
- var queryParameters, headerParameters, token, tokenString, consumes, canConsumeForm, formParams, useForm, urlPath, response;
706
- return __generator(this, function (_a) {
707
- switch (_a.label) {
708
- case 0:
709
- queryParameters = {};
710
- headerParameters = {};
711
- if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
712
- token = this.configuration.accessToken;
713
- return [4 /*yield*/, token("bearer", [])];
714
- case 1:
715
- tokenString = _a.sent();
716
- if (tokenString) {
717
- headerParameters["Authorization"] = "Bearer ".concat(tokenString);
718
- }
719
- _a.label = 2;
720
- case 2:
721
- consumes = [
722
- { contentType: 'multipart/form-data' },
723
- ];
724
- canConsumeForm = runtime.canConsumeForm(consumes);
725
- useForm = false;
726
- if (useForm) {
727
- formParams = new FormData();
728
- }
729
- else {
730
- formParams = new URLSearchParams();
731
- }
732
- if (requestParameters['mobileNumber'] != null) {
733
- formParams.append('mobile_number', requestParameters['mobileNumber']);
734
- }
735
- if (requestParameters['emailId'] != null) {
736
- formParams.append('email_id', requestParameters['emailId']);
737
- }
738
- if (requestParameters['name'] != null) {
739
- formParams.append('name', requestParameters['name']);
740
- }
741
- if (requestParameters['appId'] != null) {
742
- formParams.append('app_id', requestParameters['appId']);
743
- }
744
- urlPath = "/memory/identity/external-user";
745
- return [4 /*yield*/, this.request({
746
- path: urlPath,
747
- method: 'POST',
748
- headers: headerParameters,
749
- query: queryParameters,
750
- body: formParams,
751
- }, initOverrides)];
752
- case 3:
753
- response = _a.sent();
754
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.SignInWithEmail200ResponseFromJSON)(jsonValue); })];
755
- }
756
- });
757
- });
758
- };
759
- /**
760
- * This API allows a calling application to **pass externally authenticated user identity information to xfloor** after completing authentication within its own system. xfloor **does not perform authentication, credential verification, or session management** as part of this API. The calling application is fully responsible for validating the user and ensuring the correctness of the identity data provided. Upon invocation, xfloor will: * **Create a new user profile** if no matching user exists, or * **Update the existing user profile** if the user is already present. xfloor returns a unique `xfloor_user_id`, which serves as the **canonical user identifier** and must be used in all subsequent xfloor APIs, including floors, blocks, conversations, memory interactions, and analytics.
761
- * External User Registration
762
- */
763
- DefaultApi.prototype.registerExternalUserIdentity = function () {
764
- return __awaiter(this, arguments, void 0, function (requestParameters, initOverrides) {
765
- var response;
766
- if (requestParameters === void 0) { requestParameters = {}; }
767
- return __generator(this, function (_a) {
768
- switch (_a.label) {
769
- case 0: return [4 /*yield*/, this.registerExternalUserIdentityRaw(requestParameters, initOverrides)];
770
- case 1:
771
- response = _a.sent();
772
- return [4 /*yield*/, response.value()];
773
- case 2: return [2 /*return*/, _a.sent()];
774
- }
775
- });
776
- });
777
- };
778
457
  /**
779
458
  * This API renames a floor by changing knowing the **floor identifier (floor_id)**. It allows the **floor owner** to update the public-facing floor ID (slug/handle) from an old value to a new value. This is typically used when the owner wants to rebrand, reorganize, or correct the floor’s identifier. ⚠️ **This operation affects how the floor is accessed and referenced externally**, so it must be performed carefully. --- ## Ownership & Authorization (Critical) * The caller **must be authenticated** * **Only the floor owner** is allowed to rename a floor * Members, followers, or non-owners **cannot** perform this operation * Ownership is validated internally using `user_id` > If the user is not the owner, the request must be rejected. --- ## Request Method `POST` --- ## Content-Type `application/x-www-form-urlencoded` (or equivalent form-data encoding) --- ## Request Parameters (Form Fields) | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------------------------------------------------------- | | `user_id` | String | **Yes** | User requesting the rename. Must be the **owner** of the floor. | | `from` | String | **Yes** | Existing floor ID (current identifier to be renamed). | | `to` | String | **Yes** | New floor ID to assign to the floor. | | `app_id` | String | No | Identifier of the calling application (used mainly for pod/developer contexts). | --- ## Rename Rules & Constraints * The `from` floor ID **must exist** * The `to` floor ID **must be unique** and not already in use * The rename operation updates **only the floor ID** * Floor ownership, blocks, posts, and internal `fid` remain unchanged * Any links or references using the old floor ID may no longer be valid after rename --- ## Behavior Summary | Scenario | Result | | ---------------------------- | ------------------------------------------------- | | Valid owner + unique new ID | Floor ID renamed successfully | | Non-owner user | Request rejected | | `from` floor ID not found | Error | | `to` floor ID already exists | Error | | `from` == `to` | No-op or validation error (implementation choice) | --- ## Response Format `application/json` --- ## Sample Success Response ```json { \"status\": \"SUCCESS\", \"old_floor_id\": \"oldfloorid\", \"new_floor_id\": \"newfloorid\", \"message\": \"Floor ID renamed successfully\" } ``` --- ## Sample Error Responses ### Not Floor Owner ```json { \"status\": \"ERROR\", \"message\": \"Only the floor owner can rename the floor\" } ``` --- ### Floor Not Found ```json { \"status\": \"ERROR\", \"message\": \"Source floor ID does not exist\" } ``` --- ### Floor ID Already Exists ```json { \"status\": \"ERROR\", \"message\": \"Target floor ID is already in use\" } ``` --- ### Invalid Request ```json { \"status\": \"ERROR\", \"message\": \"user_id, from, and to are required\" } ``` --- ## Notes for Developers * This API **renames the public identifier only**; the internal immutable floor ID (`fid`) is not affected. * Clients should refresh cached floor metadata after a successful rename. * If your platform supports deep links or bookmarks, consider redirect or alias handling for old floor IDs (if supported). --- ### One-Line Mental Model > **This API answers: “Change the public identity (ID) of a floor, owner-only.”**
780
459
  * Rename floor
@@ -859,84 +538,18 @@ var DefaultApi = /** @class */ (function (_super) {
859
538
  */
860
539
  DefaultApi.prototype.resetPasswordRaw = function (requestParameters, initOverrides) {
861
540
  return __awaiter(this, void 0, void 0, function () {
862
- var queryParameters, headerParameters, urlPath, response;
541
+ var queryParameters, headerParameters, consumes, canConsumeForm, formParams, useForm, urlPath, response;
863
542
  return __generator(this, function (_a) {
864
543
  switch (_a.label) {
865
544
  case 0:
545
+ if (requestParameters['newPassword'] == null) {
546
+ throw new runtime.RequiredError('newPassword', 'Required parameter "newPassword" was null or undefined when calling resetPassword().');
547
+ }
866
548
  if (requestParameters['activationCode'] == null) {
867
549
  throw new runtime.RequiredError('activationCode', 'Required parameter "activationCode" was null or undefined when calling resetPassword().');
868
550
  }
869
551
  queryParameters = {};
870
- if (requestParameters['emailId'] != null) {
871
- queryParameters['email_id'] = requestParameters['emailId'];
872
- }
873
- if (requestParameters['mobileNumber'] != null) {
874
- queryParameters['mobile_number'] = requestParameters['mobileNumber'];
875
- }
876
- if (requestParameters['activationCode'] != null) {
877
- queryParameters['activation_code'] = requestParameters['activationCode'];
878
- }
879
- if (requestParameters['appId'] != null) {
880
- queryParameters['app_id'] = requestParameters['appId'];
881
- }
882
- headerParameters = {};
883
- urlPath = "/auth-service/password/reset";
884
- return [4 /*yield*/, this.request({
885
- path: urlPath,
886
- method: 'POST',
887
- headers: headerParameters,
888
- query: queryParameters,
889
- }, initOverrides)];
890
- case 1:
891
- response = _a.sent();
892
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.ResetPassword200ResponseFromJSON)(jsonValue); })];
893
- }
894
- });
895
- });
896
- };
897
- /**
898
- * --- ## Reset Password (Forgot Password, Not Logged In) Resets the password of a user who **cannot log in** and is using a **forgot-password** flow. This endpoint is used when the user is not authenticated and requests a password reset using a verified identity channel such as **email** or **mobile number**. The system validates a **one-time reset verification code** (`activation_code`) issued for the reset-password flow. If valid and not expired, the password is updated to `new_password` and takes effect immediately. If verification fails, the password remains unchanged and an error response is returned. ### Authentication ✅ **Recommended** (better security): a short-lived **reset token** issued after initiating reset ``` Authorization: Bearer <reset_token> ``` > If you don’t use a reset token, you must enforce strong rate limiting + OTP attempt throttling on this endpoint. ### Request Body (Form Data) * `email_id` or `mobile_number` (required to identify user) * `activation_code` (required) * `new_password` (required) * `user_id` (optional, if your reset flow already resolved it) ### Behavior Notes * Requires a prior call to **initiate reset** and send OTP/code (mode = forgot password). * Must enforce code attempt limits and expiration strictly. ### One-Line Summary > Resets a user’s password (forgot-password flow) after validating a one-time reset code sent to email or mobile.
899
- * Reset Password
900
- */
901
- DefaultApi.prototype.resetPassword = function (requestParameters, initOverrides) {
902
- return __awaiter(this, void 0, void 0, function () {
903
- var response;
904
- return __generator(this, function (_a) {
905
- switch (_a.label) {
906
- case 0: return [4 /*yield*/, this.resetPasswordRaw(requestParameters, initOverrides)];
907
- case 1:
908
- response = _a.sent();
909
- return [4 /*yield*/, response.value()];
910
- case 2: return [2 /*return*/, _a.sent()];
911
- }
912
- });
913
- });
914
- };
915
- /**
916
- * This API initiates the **sign-in validation process** by sending a **one-time validation code (OTP)** to the user. The OTP is delivered to **either the mobile number or the email address** provided in the request. This endpoint is typically called **before completing sign-in**, to verify that the user owns the supplied contact identifier. The calling application is responsible for: * Collecting the OTP from the user * Submitting it to the OTP verification API (handled separately) --- ## **Use Case** * User attempts to sign in * User provides **mobile number or email** * System sends a **validation code (OTP)** * User enters OTP to complete sign-in --- ## **Request Method** `POST` --- ## **Formdata Parameters** | Parameter Name | Type | Required | Description | | --------------- | ------ | --------- | ------------------------------------------- | | `mobile_number` | String | Optional* | Mobile number to which the OTP will be sent | | `email_id` | String | Optional* | Email address to which the OTP will be sent | | `app_id` | String | Optional | Identifier of the calling application | * **Either `mobile_number` or `email_id` must be provided.** Providing both is allowed; the system may choose one based on configuration. --- ## **Request Rules** * At least **one** of `mobile_number` or `email_id` is mandatory * If both are missing, the request will be rejected * OTP delivery channel depends on the provided identifier --- ## **Response Format** `application/json` --- ## **Sample Success Response** ```json { \"status\": \"SUCCESS\", \"message\": \"Validation code sent successfully\" } ``` --- ## **Sample Error Responses** ### Missing Identifier ```json { \"status\": \"ERROR\", \"message\": \"Either mobile_number or email_id must be provided\" } ``` ### Invalid Identifier ```json { \"status\": \"ERROR\", \"message\": \"Invalid mobile number or email address\" } ``` --- ## **Notes** * This API **only sends** the validation code * OTP verification must be performed using the corresponding **verify validation code** API * Rate limiting and retry restrictions may apply to prevent abuse
917
- * Send Sign-In Validation Code (OTP)
918
- */
919
- DefaultApi.prototype.sendSignInValidationCodeRaw = function (requestParameters, initOverrides) {
920
- return __awaiter(this, void 0, void 0, function () {
921
- var queryParameters, headerParameters, token, tokenString, consumes, canConsumeForm, formParams, useForm, urlPath, response;
922
- return __generator(this, function (_a) {
923
- switch (_a.label) {
924
- case 0:
925
- if (requestParameters['appId'] == null) {
926
- throw new runtime.RequiredError('appId', 'Required parameter "appId" was null or undefined when calling sendSignInValidationCode().');
927
- }
928
- queryParameters = {};
929
552
  headerParameters = {};
930
- if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
931
- token = this.configuration.accessToken;
932
- return [4 /*yield*/, token("bearer", [])];
933
- case 1:
934
- tokenString = _a.sent();
935
- if (tokenString) {
936
- headerParameters["Authorization"] = "Bearer ".concat(tokenString);
937
- }
938
- _a.label = 2;
939
- case 2:
940
553
  consumes = [
941
554
  { contentType: 'multipart/form-data' },
942
555
  ];
@@ -954,10 +567,16 @@ var DefaultApi = /** @class */ (function (_super) {
954
567
  if (requestParameters['emailId'] != null) {
955
568
  formParams.append('email_id', requestParameters['emailId']);
956
569
  }
570
+ if (requestParameters['newPassword'] != null) {
571
+ formParams.append('new_password', requestParameters['newPassword']);
572
+ }
573
+ if (requestParameters['activationCode'] != null) {
574
+ formParams.append('activation_code', requestParameters['activationCode']);
575
+ }
957
576
  if (requestParameters['appId'] != null) {
958
577
  formParams.append('app_id', requestParameters['appId']);
959
578
  }
960
- urlPath = "/auth-service/send/sign/in/validation/code";
579
+ urlPath = "/auth-service/password/reset";
961
580
  return [4 /*yield*/, this.request({
962
581
  path: urlPath,
963
582
  method: 'POST',
@@ -965,23 +584,23 @@ var DefaultApi = /** @class */ (function (_super) {
965
584
  query: queryParameters,
966
585
  body: formParams,
967
586
  }, initOverrides)];
968
- case 3:
587
+ case 1:
969
588
  response = _a.sent();
970
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.SendSignInValidationCode200ResponseFromJSON)(jsonValue); })];
589
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.ResetPassword200ResponseFromJSON)(jsonValue); })];
971
590
  }
972
591
  });
973
592
  });
974
593
  };
975
594
  /**
976
- * This API initiates the **sign-in validation process** by sending a **one-time validation code (OTP)** to the user. The OTP is delivered to **either the mobile number or the email address** provided in the request. This endpoint is typically called **before completing sign-in**, to verify that the user owns the supplied contact identifier. The calling application is responsible for: * Collecting the OTP from the user * Submitting it to the OTP verification API (handled separately) --- ## **Use Case** * User attempts to sign in * User provides **mobile number or email** * System sends a **validation code (OTP)** * User enters OTP to complete sign-in --- ## **Request Method** `POST` --- ## **Formdata Parameters** | Parameter Name | Type | Required | Description | | --------------- | ------ | --------- | ------------------------------------------- | | `mobile_number` | String | Optional* | Mobile number to which the OTP will be sent | | `email_id` | String | Optional* | Email address to which the OTP will be sent | | `app_id` | String | Optional | Identifier of the calling application | * **Either `mobile_number` or `email_id` must be provided.** Providing both is allowed; the system may choose one based on configuration. --- ## **Request Rules** * At least **one** of `mobile_number` or `email_id` is mandatory * If both are missing, the request will be rejected * OTP delivery channel depends on the provided identifier --- ## **Response Format** `application/json` --- ## **Sample Success Response** ```json { \"status\": \"SUCCESS\", \"message\": \"Validation code sent successfully\" } ``` --- ## **Sample Error Responses** ### Missing Identifier ```json { \"status\": \"ERROR\", \"message\": \"Either mobile_number or email_id must be provided\" } ``` ### Invalid Identifier ```json { \"status\": \"ERROR\", \"message\": \"Invalid mobile number or email address\" } ``` --- ## **Notes** * This API **only sends** the validation code * OTP verification must be performed using the corresponding **verify validation code** API * Rate limiting and retry restrictions may apply to prevent abuse
977
- * Send Sign-In Validation Code (OTP)
595
+ * --- ## Reset Password (Forgot Password, Not Logged In) Resets the password of a user who **cannot log in** and is using a **forgot-password** flow. This endpoint is used when the user is not authenticated and requests a password reset using a verified identity channel such as **email** or **mobile number**. The system validates a **one-time reset verification code** (`activation_code`) issued for the reset-password flow. If valid and not expired, the password is updated to `new_password` and takes effect immediately. If verification fails, the password remains unchanged and an error response is returned. ### Authentication ✅ **Recommended** (better security): a short-lived **reset token** issued after initiating reset ``` Authorization: Bearer <reset_token> ``` > If you don’t use a reset token, you must enforce strong rate limiting + OTP attempt throttling on this endpoint. ### Request Body (Form Data) * `email_id` or `mobile_number` (required to identify user) * `activation_code` (required) * `new_password` (required) * `user_id` (optional, if your reset flow already resolved it) ### Behavior Notes * Requires a prior call to **initiate reset** and send OTP/code (mode = forgot password). * Must enforce code attempt limits and expiration strictly. ### One-Line Summary > Resets a user’s password (forgot-password flow) after validating a one-time reset code sent to email or mobile.
596
+ * Reset Password
978
597
  */
979
- DefaultApi.prototype.sendSignInValidationCode = function (requestParameters, initOverrides) {
598
+ DefaultApi.prototype.resetPassword = function (requestParameters, initOverrides) {
980
599
  return __awaiter(this, void 0, void 0, function () {
981
600
  var response;
982
601
  return __generator(this, function (_a) {
983
602
  switch (_a.label) {
984
- case 0: return [4 /*yield*/, this.sendSignInValidationCodeRaw(requestParameters, initOverrides)];
603
+ case 0: return [4 /*yield*/, this.resetPasswordRaw(requestParameters, initOverrides)];
985
604
  case 1:
986
605
  response = _a.sent();
987
606
  return [4 /*yield*/, response.value()];
@@ -1341,16 +960,21 @@ var DefaultApi = /** @class */ (function (_super) {
1341
960
  */
1342
961
  DefaultApi.prototype.validateCodeRaw = function (requestParameters, initOverrides) {
1343
962
  return __awaiter(this, void 0, void 0, function () {
1344
- var queryParameters, headerParameters, token, tokenString, urlPath, response;
963
+ var queryParameters, headerParameters, token, tokenString, consumes, canConsumeForm, formParams, useForm, urlPath, response;
1345
964
  return __generator(this, function (_a) {
1346
965
  switch (_a.label) {
1347
966
  case 0:
1348
- if (requestParameters['validateCodeRequest'] == null) {
1349
- throw new runtime.RequiredError('validateCodeRequest', 'Required parameter "validateCodeRequest" was null or undefined when calling validateCode().');
967
+ if (requestParameters['userId'] == null) {
968
+ throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling validateCode().');
969
+ }
970
+ if (requestParameters['activationCode'] == null) {
971
+ throw new runtime.RequiredError('activationCode', 'Required parameter "activationCode" was null or undefined when calling validateCode().');
972
+ }
973
+ if (requestParameters['mode'] == null) {
974
+ throw new runtime.RequiredError('mode', 'Required parameter "mode" was null or undefined when calling validateCode().');
1350
975
  }
1351
976
  queryParameters = {};
1352
977
  headerParameters = {};
1353
- headerParameters['Content-Type'] = 'application/json';
1354
978
  if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
1355
979
  token = this.configuration.accessToken;
1356
980
  return [4 /*yield*/, token("bearer", [])];
@@ -1361,13 +985,36 @@ var DefaultApi = /** @class */ (function (_super) {
1361
985
  }
1362
986
  _a.label = 2;
1363
987
  case 2:
988
+ consumes = [
989
+ { contentType: 'multipart/form-data' },
990
+ ];
991
+ canConsumeForm = runtime.canConsumeForm(consumes);
992
+ useForm = false;
993
+ if (useForm) {
994
+ formParams = new FormData();
995
+ }
996
+ else {
997
+ formParams = new URLSearchParams();
998
+ }
999
+ if (requestParameters['userId'] != null) {
1000
+ formParams.append('user_id', requestParameters['userId']);
1001
+ }
1002
+ if (requestParameters['activationCode'] != null) {
1003
+ formParams.append('activation_code', requestParameters['activationCode']);
1004
+ }
1005
+ if (requestParameters['mode'] != null) {
1006
+ formParams.append('mode', requestParameters['mode']);
1007
+ }
1008
+ if (requestParameters['appId'] != null) {
1009
+ formParams.append('app_id', requestParameters['appId']);
1010
+ }
1364
1011
  urlPath = "/auth-service/validate/activation/code";
1365
1012
  return [4 /*yield*/, this.request({
1366
1013
  path: urlPath,
1367
1014
  method: 'POST',
1368
1015
  headers: headerParameters,
1369
1016
  query: queryParameters,
1370
- body: (0, index_1.ValidateCodeRequestToJSON)(requestParameters['validateCodeRequest']),
1017
+ body: formParams,
1371
1018
  }, initOverrides)];
1372
1019
  case 3:
1373
1020
  response = _a.sent();