@xfloor/memory-sdk-js 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -0
- package/README.md +220 -0
- package/dist/ApiClient.js +701 -0
- package/dist/api/DefaultApi.js +734 -0
- package/dist/api/EditFloorApi.js +103 -0
- package/dist/api/EventApi.js +86 -0
- package/dist/api/GetFloorInformationApi.js +89 -0
- package/dist/api/GetRecentEventsApi.js +88 -0
- package/dist/api/QueryApi.js +81 -0
- package/dist/index.js +412 -0
- package/dist/model/BlockDetails.js +144 -0
- package/dist/model/ChangePassword200Response.js +113 -0
- package/dist/model/ConversationThreads200Response.js +144 -0
- package/dist/model/ConversationThreads200ResponseThreadsInner.js +140 -0
- package/dist/model/EditFloor400Response.js +114 -0
- package/dist/model/EditFloor400ResponseError.js +158 -0
- package/dist/model/Event400Response.js +114 -0
- package/dist/model/Event400ResponseError.js +155 -0
- package/dist/model/EventResponse.js +112 -0
- package/dist/model/FloorInfo.js +202 -0
- package/dist/model/GetConversations200Response.js +158 -0
- package/dist/model/GetConversations200ResponseConversationInner.js +105 -0
- package/dist/model/GetConversations200ResponseConversationInnerAssistant.js +226 -0
- package/dist/model/GetConversations200ResponseConversationInnerAssistantChoicesInner.js +139 -0
- package/dist/model/GetConversations200ResponseConversationInnerAssistantChoicesInnerAiModelDetails.js +210 -0
- package/dist/model/GetConversations200ResponseConversationInnerAssistantChoicesInnerMessage.js +126 -0
- package/dist/model/GetConversations200ResponseConversationInnerAssistantChoicesInnerPromptDetails.js +126 -0
- package/dist/model/GetConversations200ResponseConversationInnerAssistantFetchMultiplePosts.js +186 -0
- package/dist/model/GetConversations200ResponseConversationInnerAssistantFetchMultiplePostsResultsInner.js +216 -0
- package/dist/model/GetConversations200ResponseConversationInnerUser.js +170 -0
- package/dist/model/GetConversations200ResponseConversationInnerUserContext.js +168 -0
- package/dist/model/GetFloorInformation200Response.js +201 -0
- package/dist/model/GetRecentEvents200Response.js +146 -0
- package/dist/model/GetRecentEvents200ResponseItemsInner.js +217 -0
- package/dist/model/GetRecentEvents200ResponseItemsInnerAuthor.js +131 -0
- package/dist/model/GetRecentEvents400Response.js +114 -0
- package/dist/model/GetRecentEvents400ResponseError.js +154 -0
- package/dist/model/Media.js +128 -0
- package/dist/model/Model400ErrorCode.js +158 -0
- package/dist/model/PostAdd.js +173 -0
- package/dist/model/Query422Response.js +114 -0
- package/dist/model/Query422ResponseError.js +113 -0
- package/dist/model/QueryRequest.js +196 -0
- package/dist/model/QueryRequestFilters.js +159 -0
- package/dist/model/QueryResponse.js +124 -0
- package/dist/model/QueryResponseItemsInner.js +213 -0
- package/dist/model/SendSignInValidationCode200Response.js +141 -0
- package/dist/model/SendSignInValidationCode400Response.js +158 -0
- package/dist/model/SendValidationCode200Response.js +113 -0
- package/dist/model/SendValidationCodeRequest.js +128 -0
- package/dist/model/SignInWithEmail200Response.js +145 -0
- package/dist/model/SignInWithEmail200ResponseProfile.js +230 -0
- package/dist/model/SignInWithEmail200ResponseProfileAvatar.js +129 -0
- package/dist/model/SignUp200Response.js +128 -0
- package/dist/model/SignUpResponse.js +128 -0
- package/dist/model/Threads.js +140 -0
- package/dist/model/UserDetails.js +145 -0
- package/dist/model/ValidateCode400Response.js +114 -0
- package/dist/model/ValidateCode400ResponseError.js +156 -0
- package/dist/model/ValidateCode412Response.js +113 -0
- package/dist/model/ValidateCodeRequest.js +158 -0
- package/package.json +64 -0
|
@@ -0,0 +1,734 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
+
var _ChangePassword200Response = _interopRequireDefault(require("../model/ChangePassword200Response"));
|
|
9
|
+
var _ConversationThreads200Response = _interopRequireDefault(require("../model/ConversationThreads200Response"));
|
|
10
|
+
var _EditFloor400Response = _interopRequireDefault(require("../model/EditFloor400Response"));
|
|
11
|
+
var _GetConversations200Response = _interopRequireDefault(require("../model/GetConversations200Response"));
|
|
12
|
+
var _GetFloorInformation200Response = _interopRequireDefault(require("../model/GetFloorInformation200Response"));
|
|
13
|
+
var _GetRecentEvents400Response = _interopRequireDefault(require("../model/GetRecentEvents400Response"));
|
|
14
|
+
var _SendSignInValidationCode200Response = _interopRequireDefault(require("../model/SendSignInValidationCode200Response"));
|
|
15
|
+
var _SendSignInValidationCode400Response = _interopRequireDefault(require("../model/SendSignInValidationCode400Response"));
|
|
16
|
+
var _SendValidationCode200Response = _interopRequireDefault(require("../model/SendValidationCode200Response"));
|
|
17
|
+
var _SendValidationCodeRequest = _interopRequireDefault(require("../model/SendValidationCodeRequest"));
|
|
18
|
+
var _SignInWithEmail200Response = _interopRequireDefault(require("../model/SignInWithEmail200Response"));
|
|
19
|
+
var _SignUp200Response = _interopRequireDefault(require("../model/SignUp200Response"));
|
|
20
|
+
var _UserDetails = _interopRequireDefault(require("../model/UserDetails"));
|
|
21
|
+
var _ValidateCode400Response = _interopRequireDefault(require("../model/ValidateCode400Response"));
|
|
22
|
+
var _ValidateCode412Response = _interopRequireDefault(require("../model/ValidateCode412Response"));
|
|
23
|
+
var _ValidateCodeRequest = _interopRequireDefault(require("../model/ValidateCodeRequest"));
|
|
24
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
25
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
26
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
27
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
28
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
29
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
30
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
|
31
|
+
* Floor Memory
|
|
32
|
+
* The set APIs are used to develop Floor pds which can be used as their personal assistants. This set of APIs are divided into two parts. - Memory and - Registration. The developer has two ways of using the APIs for the app development. Developer can choose to the Registration APIs for using the existing xfloor infracture or can implement custom Registration process. In the case of custom registration process, the developer is bound to provide proper authentication mechanisms and then send the user information to xlfoor.
|
|
33
|
+
*
|
|
34
|
+
* The version of the OpenAPI document: 1.0.0
|
|
35
|
+
* Contact: contact@ipomo.in
|
|
36
|
+
*
|
|
37
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
38
|
+
* https://openapi-generator.tech
|
|
39
|
+
* Do not edit the class manually.
|
|
40
|
+
*
|
|
41
|
+
*/
|
|
42
|
+
/**
|
|
43
|
+
* Default service.
|
|
44
|
+
* @module api/DefaultApi
|
|
45
|
+
* @version 1.0.1
|
|
46
|
+
*/
|
|
47
|
+
var DefaultApi = exports["default"] = /*#__PURE__*/function () {
|
|
48
|
+
/**
|
|
49
|
+
* Constructs a new DefaultApi.
|
|
50
|
+
* @alias module:api/DefaultApi
|
|
51
|
+
* @class
|
|
52
|
+
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
|
|
53
|
+
* default to {@link module:ApiClient#instance} if unspecified.
|
|
54
|
+
*/
|
|
55
|
+
function DefaultApi(apiClient) {
|
|
56
|
+
_classCallCheck(this, DefaultApi);
|
|
57
|
+
this.apiClient = apiClient || _ApiClient["default"].instance;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Callback function to receive the result of the apiDeveloperCreateAppPost operation.
|
|
62
|
+
* @callback module:api/DefaultApi~apiDeveloperCreateAppPostCallback
|
|
63
|
+
* @param {String} error Error message, if any.
|
|
64
|
+
* @param {Object} data The data returned by the service call.
|
|
65
|
+
* @param {String} response The complete HTTP response.
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Create App
|
|
70
|
+
* 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.
|
|
71
|
+
* @param {String} inputInfo
|
|
72
|
+
* @param {Object} opts Optional parameters
|
|
73
|
+
* @param {File} [icon]
|
|
74
|
+
* @param {module:api/DefaultApi~apiDeveloperCreateAppPostCallback} callback The callback function, accepting three arguments: error, data, response
|
|
75
|
+
* data is of type: {@link Object}
|
|
76
|
+
*/
|
|
77
|
+
return _createClass(DefaultApi, [{
|
|
78
|
+
key: "apiDeveloperCreateAppPost",
|
|
79
|
+
value: function apiDeveloperCreateAppPost(inputInfo, opts, callback) {
|
|
80
|
+
opts = opts || {};
|
|
81
|
+
var postBody = null;
|
|
82
|
+
// verify the required parameter 'inputInfo' is set
|
|
83
|
+
if (inputInfo === undefined || inputInfo === null) {
|
|
84
|
+
throw new Error("Missing the required parameter 'inputInfo' when calling apiDeveloperCreateAppPost");
|
|
85
|
+
}
|
|
86
|
+
var pathParams = {};
|
|
87
|
+
var queryParams = {};
|
|
88
|
+
var headerParams = {};
|
|
89
|
+
var formParams = {
|
|
90
|
+
'input_info': inputInfo,
|
|
91
|
+
'icon': opts['icon']
|
|
92
|
+
};
|
|
93
|
+
var authNames = [];
|
|
94
|
+
var contentTypes = ['multipart/form-data'];
|
|
95
|
+
var accepts = ['application/json'];
|
|
96
|
+
var returnType = Object;
|
|
97
|
+
return this.apiClient.callApi('/api/developer/create/app', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Callback function to receive the result of the apiDeveloperModifyAppPost operation.
|
|
102
|
+
* @callback module:api/DefaultApi~apiDeveloperModifyAppPostCallback
|
|
103
|
+
* @param {String} error Error message, if any.
|
|
104
|
+
* @param {Object} data The data returned by the service call.
|
|
105
|
+
* @param {String} response The complete HTTP response.
|
|
106
|
+
*/
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Modify Floorpod App
|
|
110
|
+
* Modify title, details or the app icon
|
|
111
|
+
* @param {String} inputInfo User ID, App ID, Title, Details. User ID and App ID are required parameters. Title/details are optional.
|
|
112
|
+
* @param {Object} opts Optional parameters
|
|
113
|
+
* @param {File} [file] Upload the new PNG icon file.
|
|
114
|
+
* @param {module:api/DefaultApi~apiDeveloperModifyAppPostCallback} callback The callback function, accepting three arguments: error, data, response
|
|
115
|
+
* data is of type: {@link Object}
|
|
116
|
+
*/
|
|
117
|
+
}, {
|
|
118
|
+
key: "apiDeveloperModifyAppPost",
|
|
119
|
+
value: function apiDeveloperModifyAppPost(inputInfo, opts, callback) {
|
|
120
|
+
opts = opts || {};
|
|
121
|
+
var postBody = null;
|
|
122
|
+
// verify the required parameter 'inputInfo' is set
|
|
123
|
+
if (inputInfo === undefined || inputInfo === null) {
|
|
124
|
+
throw new Error("Missing the required parameter 'inputInfo' when calling apiDeveloperModifyAppPost");
|
|
125
|
+
}
|
|
126
|
+
var pathParams = {};
|
|
127
|
+
var queryParams = {};
|
|
128
|
+
var headerParams = {};
|
|
129
|
+
var formParams = {
|
|
130
|
+
'input_info': inputInfo,
|
|
131
|
+
'file': opts['file']
|
|
132
|
+
};
|
|
133
|
+
var authNames = [];
|
|
134
|
+
var contentTypes = ['multipart/form-data'];
|
|
135
|
+
var accepts = ['application/json'];
|
|
136
|
+
var returnType = Object;
|
|
137
|
+
return this.apiClient.callApi('/api/developer/modify/app', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Callback function to receive the result of the changeEmail operation.
|
|
142
|
+
* @callback module:api/DefaultApi~changeEmailCallback
|
|
143
|
+
* @param {String} error Error message, if any.
|
|
144
|
+
* @param {Object} data The data returned by the service call.
|
|
145
|
+
* @param {String} response The complete HTTP response.
|
|
146
|
+
*/
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Change email ID
|
|
150
|
+
* 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.
|
|
151
|
+
* @param {String} newEmailId New Email ID
|
|
152
|
+
* @param {String} activationCode Validation code
|
|
153
|
+
* @param {module:api/DefaultApi~changeEmailCallback} callback The callback function, accepting three arguments: error, data, response
|
|
154
|
+
* data is of type: {@link Object}
|
|
155
|
+
*/
|
|
156
|
+
}, {
|
|
157
|
+
key: "changeEmail",
|
|
158
|
+
value: function changeEmail(newEmailId, activationCode, callback) {
|
|
159
|
+
var postBody = null;
|
|
160
|
+
// verify the required parameter 'newEmailId' is set
|
|
161
|
+
if (newEmailId === undefined || newEmailId === null) {
|
|
162
|
+
throw new Error("Missing the required parameter 'newEmailId' when calling changeEmail");
|
|
163
|
+
}
|
|
164
|
+
// verify the required parameter 'activationCode' is set
|
|
165
|
+
if (activationCode === undefined || activationCode === null) {
|
|
166
|
+
throw new Error("Missing the required parameter 'activationCode' when calling changeEmail");
|
|
167
|
+
}
|
|
168
|
+
var pathParams = {};
|
|
169
|
+
var queryParams = {};
|
|
170
|
+
var headerParams = {};
|
|
171
|
+
var formParams = {
|
|
172
|
+
'new_email_id': newEmailId,
|
|
173
|
+
'activation_code': activationCode
|
|
174
|
+
};
|
|
175
|
+
var authNames = ['bearer'];
|
|
176
|
+
var contentTypes = ['multipart/form-data'];
|
|
177
|
+
var accepts = ['application/json'];
|
|
178
|
+
var returnType = Object;
|
|
179
|
+
return this.apiClient.callApi('/auth-service/change/email', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Callback function to receive the result of the changeMobileNumber operation.
|
|
184
|
+
* @callback module:api/DefaultApi~changeMobileNumberCallback
|
|
185
|
+
* @param {String} error Error message, if any.
|
|
186
|
+
* @param {Object} data The data returned by the service call.
|
|
187
|
+
* @param {String} response The complete HTTP response.
|
|
188
|
+
*/
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Change Mobile number
|
|
192
|
+
* Updates the mobile number associated with an existing user account after validating a one-time activation code sent to the **new mobile number**. This operation can only be performed by a **logged-in user**. When a user initiates a mobile number change, an activation code is sent to the newly provided mobile number. The mobile number update takes effect only after the activation code is successfully validated. If the activation code validation fails, the mobile number remains unchanged. --- ### **Authentication** This endpoint requires **Bearer Token authentication**. ``` Authorization: Bearer <access_token> ``` --- ### **Request Body** ```json { \"user_id\": \"string\", \"new_mobile_number\": \"string\", \"activation_code\": \"string\" } ``` **Field Description** * `user_id` – Unique identifier of the logged-in user * `new_mobile_number` – New mobile number to be associated with the account * `activation_code` – One-time activation code sent to the new mobile number for verification --- ### **Flow Summary** 1. User is authenticated and logged in 2. User requests to change mobile number 3. System sends an activation code to the **new mobile number** 4. User submits the activation code via this API 5. On successful validation, the mobile number is updated --- ### **Successful Response** On successful validation: * The activation code is verified * The user’s mobile number is updated immediately * A `success` string is returned confirming the mobile number 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 mobile number * The new mobile number is already in use * Authorization fails or the bearer token is missing or invalid In all error cases, the existing mobile number 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 * Mobile number changes require prior authentication * Rate limiting may be applied to prevent abuse --- ### **One-Line Summary** > Changes a user’s mobile number after validating an activation code sent to the new mobile number.
|
|
193
|
+
* @param {Object.<String, Object>} body
|
|
194
|
+
* @param {module:api/DefaultApi~changeMobileNumberCallback} callback The callback function, accepting three arguments: error, data, response
|
|
195
|
+
* data is of type: {@link Object}
|
|
196
|
+
*/
|
|
197
|
+
}, {
|
|
198
|
+
key: "changeMobileNumber",
|
|
199
|
+
value: function changeMobileNumber(body, callback) {
|
|
200
|
+
var postBody = body;
|
|
201
|
+
// verify the required parameter 'body' is set
|
|
202
|
+
if (body === undefined || body === null) {
|
|
203
|
+
throw new Error("Missing the required parameter 'body' when calling changeMobileNumber");
|
|
204
|
+
}
|
|
205
|
+
var pathParams = {};
|
|
206
|
+
var queryParams = {};
|
|
207
|
+
var headerParams = {};
|
|
208
|
+
var formParams = {};
|
|
209
|
+
var authNames = ['bearer'];
|
|
210
|
+
var contentTypes = ['application/json'];
|
|
211
|
+
var accepts = ['application/json'];
|
|
212
|
+
var returnType = Object;
|
|
213
|
+
return this.apiClient.callApi('/auth-service/change/mobile', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Callback function to receive the result of the changePassword operation.
|
|
218
|
+
* @callback module:api/DefaultApi~changePasswordCallback
|
|
219
|
+
* @param {String} error Error message, if any.
|
|
220
|
+
* @param {module:model/ChangePassword200Response} data The data returned by the service call.
|
|
221
|
+
* @param {String} response The complete HTTP response.
|
|
222
|
+
*/
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Change Password
|
|
226
|
+
* Changes the password of an existing user after validating a one-time password change activation code. This API validates the provided `activation_code` for the given `user_id`. If the activation code is valid and not expired, the user’s password is updated to the supplied `new_password` and takes effect immediately. If the activation code validation fails, the password remains unchanged and an error response is returned. --- ### **Authentication** This endpoint requires **Bearer Token authentication**. ``` Authorization: Bearer <access_token> ``` --- ### **Request Body (Form Data)** | Field | Type | Required | Description | | ------------ | ------------- | -------- | ----------------------------------------------------------------- | | `user_id` | string | Yes | User ID | | `new_password` | string | Yes | New Password | | `activation_code` | string | Yes | Activation code | **Field Description** * `user_id` – Unique identifier of the user requesting the password change * `new_password` – New password to be set for the user * `activation_code` – One-time activation code generated for password change verification --- ### **Successful Response** On successful validation: * The activation code is verified * The user password is updated immediately * The API returns a `success` string indicating that the password change was completed --- ### **Error Response** The API returns an error response if: * The activation code is invalid or expired * The activation code does not match the specified user * The password does not meet security or policy requirements * Authorization fails or the bearer token is missing or invalid In all error cases, the existing password remains unchanged. --- ### **Behavior Notes** * Requires a prior call to `/auth-service/send/validation/code` with the proper mode. --- ### **Security Notes** * Activation codes are single-use and time-bound * Passwords are never returned in API responses * Rate limiting may be applied to prevent brute-force attempts --- ### **One-Line Summary** > Updates a user’s password after validating a one-time activation code.
|
|
227
|
+
* @param {Object} opts Optional parameters
|
|
228
|
+
* @param {String} [userId] User ID
|
|
229
|
+
* @param {String} [newPassword] New Password
|
|
230
|
+
* @param {String} [acticationCode] Validation code
|
|
231
|
+
* @param {module:api/DefaultApi~changePasswordCallback} callback The callback function, accepting three arguments: error, data, response
|
|
232
|
+
* data is of type: {@link module:model/ChangePassword200Response}
|
|
233
|
+
*/
|
|
234
|
+
}, {
|
|
235
|
+
key: "changePassword",
|
|
236
|
+
value: function changePassword(opts, callback) {
|
|
237
|
+
opts = opts || {};
|
|
238
|
+
var postBody = null;
|
|
239
|
+
var pathParams = {};
|
|
240
|
+
var queryParams = {};
|
|
241
|
+
var headerParams = {};
|
|
242
|
+
var formParams = {
|
|
243
|
+
'user_id': opts['userId'],
|
|
244
|
+
'new_password': opts['newPassword'],
|
|
245
|
+
'actication_code': opts['acticationCode']
|
|
246
|
+
};
|
|
247
|
+
var authNames = ['bearer'];
|
|
248
|
+
var contentTypes = ['multipart/form-data'];
|
|
249
|
+
var accepts = ['application/json'];
|
|
250
|
+
var returnType = _ChangePassword200Response["default"];
|
|
251
|
+
return this.apiClient.callApi('/auth-service/change/password', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Callback function to receive the result of the conversationThreads operation.
|
|
256
|
+
* @callback module:api/DefaultApi~conversationThreadsCallback
|
|
257
|
+
* @param {String} error Error message, if any.
|
|
258
|
+
* @param {module:model/ConversationThreads200Response} data The data returned by the service call.
|
|
259
|
+
* @param {String} response The complete HTTP response.
|
|
260
|
+
*/
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Get the conversational threads
|
|
264
|
+
* ### 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\" } ```
|
|
265
|
+
* @param {String} userId User ID
|
|
266
|
+
* @param {String} floorId Floor ID
|
|
267
|
+
* @param {module:api/DefaultApi~conversationThreadsCallback} callback The callback function, accepting three arguments: error, data, response
|
|
268
|
+
* data is of type: {@link module:model/ConversationThreads200Response}
|
|
269
|
+
*/
|
|
270
|
+
}, {
|
|
271
|
+
key: "conversationThreads",
|
|
272
|
+
value: function conversationThreads(userId, floorId, callback) {
|
|
273
|
+
var postBody = null;
|
|
274
|
+
// verify the required parameter 'userId' is set
|
|
275
|
+
if (userId === undefined || userId === null) {
|
|
276
|
+
throw new Error("Missing the required parameter 'userId' when calling conversationThreads");
|
|
277
|
+
}
|
|
278
|
+
// verify the required parameter 'floorId' is set
|
|
279
|
+
if (floorId === undefined || floorId === null) {
|
|
280
|
+
throw new Error("Missing the required parameter 'floorId' when calling conversationThreads");
|
|
281
|
+
}
|
|
282
|
+
var pathParams = {};
|
|
283
|
+
var queryParams = {
|
|
284
|
+
'user_id': userId,
|
|
285
|
+
'floor_id': floorId
|
|
286
|
+
};
|
|
287
|
+
var headerParams = {};
|
|
288
|
+
var formParams = {};
|
|
289
|
+
var authNames = ['bearer'];
|
|
290
|
+
var contentTypes = [];
|
|
291
|
+
var accepts = ['application/json'];
|
|
292
|
+
var returnType = _ConversationThreads200Response["default"];
|
|
293
|
+
return this.apiClient.callApi('/agent/memory/threads', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Callback function to receive the result of the getConversations operation.
|
|
298
|
+
* @callback module:api/DefaultApi~getConversationsCallback
|
|
299
|
+
* @param {String} error Error message, if any.
|
|
300
|
+
* @param {module:model/GetConversations200Response} data The data returned by the service call.
|
|
301
|
+
* @param {String} response The complete HTTP response.
|
|
302
|
+
*/
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Conversations
|
|
306
|
+
* 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.
|
|
307
|
+
* @param {Object} opts Optional parameters
|
|
308
|
+
* @param {String} [userId]
|
|
309
|
+
* @param {String} [threadId]
|
|
310
|
+
* @param {module:api/DefaultApi~getConversationsCallback} callback The callback function, accepting three arguments: error, data, response
|
|
311
|
+
* data is of type: {@link module:model/GetConversations200Response}
|
|
312
|
+
*/
|
|
313
|
+
}, {
|
|
314
|
+
key: "getConversations",
|
|
315
|
+
value: function getConversations(opts, callback) {
|
|
316
|
+
opts = opts || {};
|
|
317
|
+
var postBody = null;
|
|
318
|
+
var pathParams = {};
|
|
319
|
+
var queryParams = {
|
|
320
|
+
'user_id': opts['userId'],
|
|
321
|
+
'thread_id': opts['threadId']
|
|
322
|
+
};
|
|
323
|
+
var headerParams = {};
|
|
324
|
+
var formParams = {};
|
|
325
|
+
var authNames = ['bearer'];
|
|
326
|
+
var contentTypes = [];
|
|
327
|
+
var accepts = ['application/json'];
|
|
328
|
+
var returnType = _GetConversations200Response["default"];
|
|
329
|
+
return this.apiClient.callApi('/agent/memory/conversations', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Callback function to receive the result of the makeFloorPrivate operation.
|
|
334
|
+
* @callback module:api/DefaultApi~makeFloorPrivateCallback
|
|
335
|
+
* @param {String} error Error message, if any.
|
|
336
|
+
* @param {module:model/GetFloorInformation200Response} data The data returned by the service call.
|
|
337
|
+
* @param {String} response The complete HTTP response.
|
|
338
|
+
*/
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Make floor Private
|
|
342
|
+
* 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).
|
|
343
|
+
* @param {Object} opts Optional parameters
|
|
344
|
+
* @param {String} [floorId] Floor ID
|
|
345
|
+
* @param {String} [userId] User ID
|
|
346
|
+
* @param {String} [appId] App ID
|
|
347
|
+
* @param {module:api/DefaultApi~makeFloorPrivateCallback} callback The callback function, accepting three arguments: error, data, response
|
|
348
|
+
* data is of type: {@link module:model/GetFloorInformation200Response}
|
|
349
|
+
*/
|
|
350
|
+
}, {
|
|
351
|
+
key: "makeFloorPrivate",
|
|
352
|
+
value: function makeFloorPrivate(opts, callback) {
|
|
353
|
+
opts = opts || {};
|
|
354
|
+
var postBody = null;
|
|
355
|
+
var pathParams = {};
|
|
356
|
+
var queryParams = {
|
|
357
|
+
'floor_id': opts['floorId'],
|
|
358
|
+
'user_id': opts['userId'],
|
|
359
|
+
'app_id': opts['appId']
|
|
360
|
+
};
|
|
361
|
+
var headerParams = {};
|
|
362
|
+
var formParams = {};
|
|
363
|
+
var authNames = ['bearer'];
|
|
364
|
+
var contentTypes = [];
|
|
365
|
+
var accepts = ['application/json'];
|
|
366
|
+
var returnType = _GetFloorInformation200Response["default"];
|
|
367
|
+
return this.apiClient.callApi('/api/memory/make/floor/private', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Callback function to receive the result of the makeFloorPublic operation.
|
|
372
|
+
* @callback module:api/DefaultApi~makeFloorPublicCallback
|
|
373
|
+
* @param {String} error Error message, if any.
|
|
374
|
+
* @param {module:model/GetFloorInformation200Response} data The data returned by the service call.
|
|
375
|
+
* @param {String} response The complete HTTP response.
|
|
376
|
+
*/
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* Make floor public
|
|
380
|
+
* This API changes a floor’s visibility to **PUBLIC**. It is used when a floor owner wants to **make a private floor accessible to everyone**. After the update, the floor becomes public and can be viewed and discovered by any user, subject to platform rules (search, feeds, pods, etc.). This endpoint performs a **visibility state transition**: * **PRIVATE → PUBLIC** * If the floor is already public, the operation is treated as **idempotent** (no state change). This API is typically used from: * Floor settings → Privacy / Visibility controls * Owner or admin tools * Developer or pod-based applications using `app_id` --- ## Request Method `POST` --- ## Content-Type `application/x-www-form-urlencoded` (or `multipart/form-data`, depending on your implementation) --- ## 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 whose visibility is to be changed. | | `app_id` | String | No | Identifier of the calling application (used mainly for pod/developer contexts). | --- ## Authorization Rules (Critical) * The caller must be authenticated as `user_id` * **Only the floor owner** is allowed to change the floor’s visibility * Requests from non-owners must be rejected --- ## Behavior Rules * Converts floor visibility from **PRIVATE → PUBLIC** * Does not modify floor content, blocks, or ownership * Visibility change takes effect immediately ### Idempotency * If the floor is already public, the API should: * Return success with a message indicating no change, or * Return a specific “already public” status (implementation-dependent) --- ## Response Format `application/json` --- ## Sample Success Response ```json { \"status\": \"SUCCESS\", \"floor_id\": \"my_floor\", \"visibility\": \"PUBLIC\", \"message\": \"Floor is now public\" } ``` --- ## Sample No-Op Response (Already Public) ```json { \"status\": \"SUCCESS\", \"floor_id\": \"my_floor\", \"visibility\": \"PUBLIC\", \"message\": \"Floor is already public\" } ``` --- ## 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 for Developers * This API controls **visibility only**. Membership, invitations, and moderation rules are handled by separate APIs. * `app_id` is optional and primarily used for developer-managed or pod floors. * Clients should refresh floor metadata (e.g., via `/api/floor/info`) after a successful visibility change. --- ### Mental Model (One Line) > **This API answers: “Make this floor visible to everyone.”**
|
|
381
|
+
* @param {Object} opts Optional parameters
|
|
382
|
+
* @param {String} [floorId] Floor ID
|
|
383
|
+
* @param {String} [userId] User ID
|
|
384
|
+
* @param {String} [appId] App ID
|
|
385
|
+
* @param {module:api/DefaultApi~makeFloorPublicCallback} callback The callback function, accepting three arguments: error, data, response
|
|
386
|
+
* data is of type: {@link module:model/GetFloorInformation200Response}
|
|
387
|
+
*/
|
|
388
|
+
}, {
|
|
389
|
+
key: "makeFloorPublic",
|
|
390
|
+
value: function makeFloorPublic(opts, callback) {
|
|
391
|
+
opts = opts || {};
|
|
392
|
+
var postBody = null;
|
|
393
|
+
var pathParams = {};
|
|
394
|
+
var queryParams = {
|
|
395
|
+
'floor_id': opts['floorId'],
|
|
396
|
+
'user_id': opts['userId'],
|
|
397
|
+
'app_id': opts['appId']
|
|
398
|
+
};
|
|
399
|
+
var headerParams = {};
|
|
400
|
+
var formParams = {};
|
|
401
|
+
var authNames = ['bearer'];
|
|
402
|
+
var contentTypes = [];
|
|
403
|
+
var accepts = ['application/json'];
|
|
404
|
+
var returnType = _GetFloorInformation200Response["default"];
|
|
405
|
+
return this.apiClient.callApi('/api/memory/make/floor/public', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* Callback function to receive the result of the registerExternalUserIdentity operation.
|
|
410
|
+
* @callback module:api/DefaultApi~registerExternalUserIdentityCallback
|
|
411
|
+
* @param {String} error Error message, if any.
|
|
412
|
+
* @param {module:model/SignInWithEmail200Response} data The data returned by the service call.
|
|
413
|
+
* @param {String} response The complete HTTP response.
|
|
414
|
+
*/
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* External User Registration
|
|
418
|
+
* 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.
|
|
419
|
+
* @param {Object} opts Optional parameters
|
|
420
|
+
* @param {String} [mobileNumber]
|
|
421
|
+
* @param {String} [emailId]
|
|
422
|
+
* @param {String} [name]
|
|
423
|
+
* @param {String} [appId]
|
|
424
|
+
* @param {module:api/DefaultApi~registerExternalUserIdentityCallback} callback The callback function, accepting three arguments: error, data, response
|
|
425
|
+
* data is of type: {@link module:model/SignInWithEmail200Response}
|
|
426
|
+
*/
|
|
427
|
+
}, {
|
|
428
|
+
key: "registerExternalUserIdentity",
|
|
429
|
+
value: function registerExternalUserIdentity(opts, callback) {
|
|
430
|
+
opts = opts || {};
|
|
431
|
+
var postBody = null;
|
|
432
|
+
var pathParams = {};
|
|
433
|
+
var queryParams = {};
|
|
434
|
+
var headerParams = {};
|
|
435
|
+
var formParams = {
|
|
436
|
+
'mobile_number': opts['mobileNumber'],
|
|
437
|
+
'email_id': opts['emailId'],
|
|
438
|
+
'name': opts['name'],
|
|
439
|
+
'app_id': opts['appId']
|
|
440
|
+
};
|
|
441
|
+
var authNames = ['bearer'];
|
|
442
|
+
var contentTypes = ['multipart/form-data'];
|
|
443
|
+
var accepts = ['application/json'];
|
|
444
|
+
var returnType = _SignInWithEmail200Response["default"];
|
|
445
|
+
return this.apiClient.callApi('/memory/identity/external-user', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* Callback function to receive the result of the renameFloor operation.
|
|
450
|
+
* @callback module:api/DefaultApi~renameFloorCallback
|
|
451
|
+
* @param {String} error Error message, if any.
|
|
452
|
+
* @param {module:model/GetFloorInformation200Response} data The data returned by the service call.
|
|
453
|
+
* @param {String} response The complete HTTP response.
|
|
454
|
+
*/
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* Rename floor
|
|
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.”**
|
|
459
|
+
* @param {Object} opts Optional parameters
|
|
460
|
+
* @param {String} [userId] User ID
|
|
461
|
+
* @param {String} [appId] App ID
|
|
462
|
+
* @param {String} [from] Old floor ID
|
|
463
|
+
* @param {String} [to] New floor ID
|
|
464
|
+
* @param {module:api/DefaultApi~renameFloorCallback} callback The callback function, accepting three arguments: error, data, response
|
|
465
|
+
* data is of type: {@link module:model/GetFloorInformation200Response}
|
|
466
|
+
*/
|
|
467
|
+
}, {
|
|
468
|
+
key: "renameFloor",
|
|
469
|
+
value: function renameFloor(opts, callback) {
|
|
470
|
+
opts = opts || {};
|
|
471
|
+
var postBody = null;
|
|
472
|
+
var pathParams = {};
|
|
473
|
+
var queryParams = {
|
|
474
|
+
'user_id': opts['userId'],
|
|
475
|
+
'app_id': opts['appId'],
|
|
476
|
+
'from': opts['from'],
|
|
477
|
+
'to': opts['to']
|
|
478
|
+
};
|
|
479
|
+
var headerParams = {};
|
|
480
|
+
var formParams = {};
|
|
481
|
+
var authNames = [];
|
|
482
|
+
var contentTypes = [];
|
|
483
|
+
var accepts = ['application/json'];
|
|
484
|
+
var returnType = _GetFloorInformation200Response["default"];
|
|
485
|
+
return this.apiClient.callApi('/api/memory/change/floor/id', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* Callback function to receive the result of the sendSignInValidationCode operation.
|
|
490
|
+
* @callback module:api/DefaultApi~sendSignInValidationCodeCallback
|
|
491
|
+
* @param {String} error Error message, if any.
|
|
492
|
+
* @param {module:model/SendSignInValidationCode200Response} data The data returned by the service call.
|
|
493
|
+
* @param {String} response The complete HTTP response.
|
|
494
|
+
*/
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* Send Sign-In Validation Code (OTP)
|
|
498
|
+
* 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
|
|
499
|
+
* @param {String} appId App ID
|
|
500
|
+
* @param {Object} opts Optional parameters
|
|
501
|
+
* @param {String} [mobileNumber] Mobile number
|
|
502
|
+
* @param {String} [emailId] Email ID
|
|
503
|
+
* @param {module:api/DefaultApi~sendSignInValidationCodeCallback} callback The callback function, accepting three arguments: error, data, response
|
|
504
|
+
* data is of type: {@link module:model/SendSignInValidationCode200Response}
|
|
505
|
+
*/
|
|
506
|
+
}, {
|
|
507
|
+
key: "sendSignInValidationCode",
|
|
508
|
+
value: function sendSignInValidationCode(appId, opts, callback) {
|
|
509
|
+
opts = opts || {};
|
|
510
|
+
var postBody = null;
|
|
511
|
+
// verify the required parameter 'appId' is set
|
|
512
|
+
if (appId === undefined || appId === null) {
|
|
513
|
+
throw new Error("Missing the required parameter 'appId' when calling sendSignInValidationCode");
|
|
514
|
+
}
|
|
515
|
+
var pathParams = {};
|
|
516
|
+
var queryParams = {};
|
|
517
|
+
var headerParams = {};
|
|
518
|
+
var formParams = {
|
|
519
|
+
'mobile_number': opts['mobileNumber'],
|
|
520
|
+
'email_id': opts['emailId'],
|
|
521
|
+
'app_id': appId
|
|
522
|
+
};
|
|
523
|
+
var authNames = ['bearer'];
|
|
524
|
+
var contentTypes = ['multipart/form-data'];
|
|
525
|
+
var accepts = ['application/json'];
|
|
526
|
+
var returnType = _SendSignInValidationCode200Response["default"];
|
|
527
|
+
return this.apiClient.callApi('/auth-service/send/sign/in/validation/code', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* Callback function to receive the result of the sendValidationCode operation.
|
|
532
|
+
* @callback module:api/DefaultApi~sendValidationCodeCallback
|
|
533
|
+
* @param {String} error Error message, if any.
|
|
534
|
+
* @param {module:model/SendValidationCode200Response} data The data returned by the service call.
|
|
535
|
+
* @param {String} response The complete HTTP response.
|
|
536
|
+
*/
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* Send Validation code
|
|
540
|
+
* Generates and sends a one-time validation code to the user for verification of sensitive or critical account operations. This API is used across multiple authentication and account-management flows. The validation code is delivered to the user via the appropriate channel (**email or mobile number**), based on the requested operation mode and the input provided. The generated code is **time-bound**, **single-use**, and must be validated using the corresponding verification APIs to complete the requested action. --- ### **Usage Scenarios (Mode Definition)** | Mode | Purpose | | ---- | ----------------------------- | | `0` | Email or mobile number change | | `1` | Password change | | `2` | Delete account | | `3` | Clear account | | `4` | Signup Verification | **Mode `5` – Signup Verification** For login verification, the validation code is sent to **either the email ID or the mobile number provided in the request**. At least **one of email or mobile number must be supplied** for this mode. --- ### **Behavior** * Generates a secure, one-time validation code * Sends the code to the appropriate channel: * Email or mobile number, depending on the operation mode and input * Associates the code with: * User identity (or login identifier) * Requested operation (`mode`) * Application context (if applicable) * Validation codes are valid for a limited duration and **cannot be reused** --- ### **Authentication** This endpoint requires **Bearer Token authentication**, **except** where explicitly allowed (for example, login-related flows). ``` Authorization: Bearer <access_token> ``` --- ### **Successful Response** On success, the API confirms that the validation code has been generated and successfully dispatched to the user. --- ### **Error Response** The API returns an error response if: * The user does not exist or is not eligible for the requested operation * The requested mode is invalid or unsupported * Required identifiers (email or mobile number for login verification) are missing * Rate limits are exceeded * Authorization fails (where applicable) --- ### **Security Notes (Recommended)** * Validation codes are single-use and time-bound * Rate limiting is enforced to prevent abuse * Repeated failures may trigger temporary blocking or additional verification --- ### **One-Line Summary** > Sends a one-time validation code for secure account and authentication operations, including login via email or mobile number.
|
|
541
|
+
* @param {module:model/SendValidationCodeRequest} sendValidationCodeRequest
|
|
542
|
+
* @param {module:api/DefaultApi~sendValidationCodeCallback} callback The callback function, accepting three arguments: error, data, response
|
|
543
|
+
* data is of type: {@link module:model/SendValidationCode200Response}
|
|
544
|
+
*/
|
|
545
|
+
}, {
|
|
546
|
+
key: "sendValidationCode",
|
|
547
|
+
value: function sendValidationCode(sendValidationCodeRequest, callback) {
|
|
548
|
+
var postBody = sendValidationCodeRequest;
|
|
549
|
+
// verify the required parameter 'sendValidationCodeRequest' is set
|
|
550
|
+
if (sendValidationCodeRequest === undefined || sendValidationCodeRequest === null) {
|
|
551
|
+
throw new Error("Missing the required parameter 'sendValidationCodeRequest' when calling sendValidationCode");
|
|
552
|
+
}
|
|
553
|
+
var pathParams = {};
|
|
554
|
+
var queryParams = {};
|
|
555
|
+
var headerParams = {};
|
|
556
|
+
var formParams = {};
|
|
557
|
+
var authNames = ['bearer'];
|
|
558
|
+
var contentTypes = ['application/json'];
|
|
559
|
+
var accepts = ['application/json'];
|
|
560
|
+
var returnType = _SendValidationCode200Response["default"];
|
|
561
|
+
return this.apiClient.callApi('/auth-service/send/validation/code', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* Callback function to receive the result of the signInWithEmail operation.
|
|
566
|
+
* @callback module:api/DefaultApi~signInWithEmailCallback
|
|
567
|
+
* @param {String} error Error message, if any.
|
|
568
|
+
* @param {module:model/SignInWithEmail200Response} data The data returned by the service call.
|
|
569
|
+
* @param {String} response The complete HTTP response.
|
|
570
|
+
*/
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* Sign In with email ID
|
|
574
|
+
* Authenticates a user using a registered email ID. The authentication mechanism is determined by the specified `mode`. * When `login_type` is set to **`1`**, the user is authenticated using the provided **password**. * When `login_type` is set to **`2`**, the user is authenticated using a **one-time activation code (OTP)**. For OTP-based authentication (`login_type = 2`), the client **must first invoke the Send Validation Code API** with the appropriate login mode to generate and deliver the activation code to the user. --- ### **Request Body** | Field | Type | Required | Description | | ------------ | ------------- | -------- | ----------------------------------------------------------------- | | `email_id` | string | Yes | Email ID | | `pass_code` | string | Yes | Password/Validation code depending on the login_type| | `login_type` | string | Yes | login type 1 for password 2 for validation code| |`app_id` | string | Yes | App ID | **Field Description** * `email_id` – Registered email address of the user * `pass_code` – password or activation code (this is password if it is 1 and 2 it is validation code) * `app_id` - App ID which is a 13 digit numeric value * `login_type` – Login type * `1` → Password-based login * `2` → Activation code (OTP)–based login --- ### **Behavior Notes** * When `login_type = 2`, password validation is bypassed. * OTP-based login requires a prior call to ` /auth-service/send/sign/in/validation/code`. * If the required credentials for the selected mode are missing or invalid, authentication fails. --- ### **Successful Response** On successful authentication, the user is signed in and a success response is returned as per the authentication flow. --- ### **Error Response** The API returns an error response if: * The email ID is not registered * The password is incorrect (`login_type = 1 `) * The activation code is missing, invalid, or expired (`login_type = 2`) * The mode value is invalid or unsupported --- ### **One-Line Summary** > Signs in a user using an email ID with either password-based or OTP-based authentication, based on the selected mode.
|
|
575
|
+
* @param {String} emailId Email ID
|
|
576
|
+
* @param {String} passCode Validation code or password depends on the login_type
|
|
577
|
+
* @param {String} loginType 1 is for password, 2 is for validation code
|
|
578
|
+
* @param {Object} opts Optional parameters
|
|
579
|
+
* @param {String} [appId] App ID
|
|
580
|
+
* @param {module:api/DefaultApi~signInWithEmailCallback} callback The callback function, accepting three arguments: error, data, response
|
|
581
|
+
* data is of type: {@link module:model/SignInWithEmail200Response}
|
|
582
|
+
*/
|
|
583
|
+
}, {
|
|
584
|
+
key: "signInWithEmail",
|
|
585
|
+
value: function signInWithEmail(emailId, passCode, loginType, opts, callback) {
|
|
586
|
+
opts = opts || {};
|
|
587
|
+
var postBody = null;
|
|
588
|
+
// verify the required parameter 'emailId' is set
|
|
589
|
+
if (emailId === undefined || emailId === null) {
|
|
590
|
+
throw new Error("Missing the required parameter 'emailId' when calling signInWithEmail");
|
|
591
|
+
}
|
|
592
|
+
// verify the required parameter 'passCode' is set
|
|
593
|
+
if (passCode === undefined || passCode === null) {
|
|
594
|
+
throw new Error("Missing the required parameter 'passCode' when calling signInWithEmail");
|
|
595
|
+
}
|
|
596
|
+
// verify the required parameter 'loginType' is set
|
|
597
|
+
if (loginType === undefined || loginType === null) {
|
|
598
|
+
throw new Error("Missing the required parameter 'loginType' when calling signInWithEmail");
|
|
599
|
+
}
|
|
600
|
+
var pathParams = {};
|
|
601
|
+
var queryParams = {};
|
|
602
|
+
var headerParams = {};
|
|
603
|
+
var formParams = {
|
|
604
|
+
'email_id': emailId,
|
|
605
|
+
'pass_code': passCode,
|
|
606
|
+
'login_type': loginType,
|
|
607
|
+
'app_id': opts['appId']
|
|
608
|
+
};
|
|
609
|
+
var authNames = ['bearer'];
|
|
610
|
+
var contentTypes = ['multipart/form-data'];
|
|
611
|
+
var accepts = ['application/json'];
|
|
612
|
+
var returnType = _SignInWithEmail200Response["default"];
|
|
613
|
+
return this.apiClient.callApi('/auth-service/sign/in/with/email', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* Callback function to receive the result of the signInWithMobileNumber operation.
|
|
618
|
+
* @callback module:api/DefaultApi~signInWithMobileNumberCallback
|
|
619
|
+
* @param {String} error Error message, if any.
|
|
620
|
+
* @param {module:model/SignInWithEmail200Response} data The data returned by the service call.
|
|
621
|
+
* @param {String} response The complete HTTP response.
|
|
622
|
+
*/
|
|
623
|
+
|
|
624
|
+
/**
|
|
625
|
+
* Sign In with Mobile number
|
|
626
|
+
* Authenticates a user using a registered mobile number. The authentication method is determined by the specified `mode`. * When `login_type` is set to **`1`**, the user is authenticated using the **password** associated with the account. * When `login_type` is set to **`2`**, the user is authenticated using a **one-time activation code (OTP)** sent to the registered mobile number. For OTP-based authentication (`login_type = 1`), the client **must first call the Send Validation Code API** with the appropriate login mode to generate and deliver the activation code. --- ### **Request Formdata** | Field | Type | Required | Description | | ------------ | ------------- | -------- | ----------------------------------------------------------------- | | `mobile_number` | string | Yes | Mobile number| | `pass_code` | string | Yes | Password/Validation code depending on the login_type| | `login_type` | string | Yes | login type 1 for password 2 for validation code| |`app_id` | string | Yes | App ID | **Field Description** * `mobile_number` – Registered mobile number of the user * `pass_code` – Password / Validation code (password when `login_type= 1`; validation code when `login_type = 2`) * `login_type` – Login type * `1` → Password-based login * `2` → Activation code (OTP)–based login --- ### **Behavior Notes** * When `login_type = 2`, password validation is skipped. * OTP-based login requires a prior call to `/auth-service/send/sign/in/validation/code`. * Missing or invalid credentials for the selected mode will result in authentication failure. --- ### **Successful Response** On successful authentication, the user is signed in and a success response is returned according to the authentication flow. --- ### **Error Response** The API returns an error response if: * The mobile number is not registered * The password is incorrect (`login_type = 1`) * The activation code is missing, invalid, or expired (`login_type = 2`) * An invalid or unsupported mode is provided --- ### **One-Line Summary** > Signs in a user using a mobile number with either password-based or OTP-based authentication, based on the selected mode.
|
|
627
|
+
* @param {Object.<String, Object>} body
|
|
628
|
+
* @param {module:api/DefaultApi~signInWithMobileNumberCallback} callback The callback function, accepting three arguments: error, data, response
|
|
629
|
+
* data is of type: {@link module:model/SignInWithEmail200Response}
|
|
630
|
+
*/
|
|
631
|
+
}, {
|
|
632
|
+
key: "signInWithMobileNumber",
|
|
633
|
+
value: function signInWithMobileNumber(body, callback) {
|
|
634
|
+
var postBody = body;
|
|
635
|
+
// verify the required parameter 'body' is set
|
|
636
|
+
if (body === undefined || body === null) {
|
|
637
|
+
throw new Error("Missing the required parameter 'body' when calling signInWithMobileNumber");
|
|
638
|
+
}
|
|
639
|
+
var pathParams = {};
|
|
640
|
+
var queryParams = {};
|
|
641
|
+
var headerParams = {};
|
|
642
|
+
var formParams = {};
|
|
643
|
+
var authNames = ['bearer'];
|
|
644
|
+
var contentTypes = ['application/json'];
|
|
645
|
+
var accepts = ['application/json'];
|
|
646
|
+
var returnType = _SignInWithEmail200Response["default"];
|
|
647
|
+
return this.apiClient.callApi('/auth-service/sign/in/with/mobile/number', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* Callback function to receive the result of the signUp operation.
|
|
652
|
+
* @callback module:api/DefaultApi~signUpCallback
|
|
653
|
+
* @param {String} error Error message, if any.
|
|
654
|
+
* @param {module:model/SignUp200Response} data The data returned by the service call.
|
|
655
|
+
* @param {String} response The complete HTTP response.
|
|
656
|
+
*/
|
|
657
|
+
|
|
658
|
+
/**
|
|
659
|
+
* Sign Up
|
|
660
|
+
* Creates a new user account in the Floor POD using **either a mobile number or an email ID**. At least **one of `mobile_number` or `email_id` is required** to register a user. Both may be provided if available. The API registers the user under the specified application context and prepares the account for subsequent authentication and usage. Upon successful registration, the API returns: - a unique user_id identifying the newly created user, and - a success string indicating the outcome of the sign-up operation. The user account is created under the specified application context and can be used for subsequent interactions with Floor POD APIs. --- ### **Parameter Clarification (Recommended)** * `name` is mandatory for user profile creation * Either `mobile_number` **or** `email_id` must be present * `app_id` is optional and used to associate the user with a specific application
|
|
661
|
+
* @param {String} name New User Name
|
|
662
|
+
* @param {String} password Password
|
|
663
|
+
* @param {Object} opts Optional parameters
|
|
664
|
+
* @param {String} [emailId] Email ID of the user
|
|
665
|
+
* @param {String} [mobileNumber] Mobile number
|
|
666
|
+
* @param {String} [appId] Registered App ID
|
|
667
|
+
* @param {module:api/DefaultApi~signUpCallback} callback The callback function, accepting three arguments: error, data, response
|
|
668
|
+
* data is of type: {@link module:model/SignUp200Response}
|
|
669
|
+
*/
|
|
670
|
+
}, {
|
|
671
|
+
key: "signUp",
|
|
672
|
+
value: function signUp(name, password, opts, callback) {
|
|
673
|
+
opts = opts || {};
|
|
674
|
+
var postBody = null;
|
|
675
|
+
// verify the required parameter 'name' is set
|
|
676
|
+
if (name === undefined || name === null) {
|
|
677
|
+
throw new Error("Missing the required parameter 'name' when calling signUp");
|
|
678
|
+
}
|
|
679
|
+
// verify the required parameter 'password' is set
|
|
680
|
+
if (password === undefined || password === null) {
|
|
681
|
+
throw new Error("Missing the required parameter 'password' when calling signUp");
|
|
682
|
+
}
|
|
683
|
+
var pathParams = {};
|
|
684
|
+
var queryParams = {};
|
|
685
|
+
var headerParams = {};
|
|
686
|
+
var formParams = {
|
|
687
|
+
'name': name,
|
|
688
|
+
'email_id': opts['emailId'],
|
|
689
|
+
'mobile_number': opts['mobileNumber'],
|
|
690
|
+
'password': password,
|
|
691
|
+
'app_id': opts['appId']
|
|
692
|
+
};
|
|
693
|
+
var authNames = ['bearer'];
|
|
694
|
+
var contentTypes = ['multipart/form-data'];
|
|
695
|
+
var accepts = ['application/json'];
|
|
696
|
+
var returnType = _SignUp200Response["default"];
|
|
697
|
+
return this.apiClient.callApi('/auth-service/sign/up', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
/**
|
|
701
|
+
* Callback function to receive the result of the validateCode operation.
|
|
702
|
+
* @callback module:api/DefaultApi~validateCodeCallback
|
|
703
|
+
* @param {String} error Error message, if any.
|
|
704
|
+
* @param {module:model/UserDetails} data The data returned by the service call.
|
|
705
|
+
* @param {String} response The complete HTTP response.
|
|
706
|
+
*/
|
|
707
|
+
|
|
708
|
+
/**
|
|
709
|
+
* Validation
|
|
710
|
+
* Validates the activation code submitted by a newly registered user and completes the account activation process. This API verifies the provided `activation_code` against the specified `user_id` and activation `mode` (e.g., email or mobile). Upon successful validation, the user account is activated and the API returns the associated **POD information** along with the user’s **profile details**. If the activation code is invalid, expired, or does not match the user context, the API returns an appropriate error response and the account remains inactive. --- ### **Authentication** This endpoint requires **Bearer Token authentication**. * The token must be included in the `Authorization` header: ``` Authorization: Bearer <access_token> ``` --- ### **Request Body** ```json { \"user_id\": \"string\", \"activation_code\": \"string\", \"app_id\": \"string\", \"mode\": \"string\" } ``` **Field Description** * `user_id` – Unique identifier of the newly registered user * `activation_code` – One-time validation code sent to the user * `app_id` – Application identifier (optional or context-specific) * `mode` – Activation channel used (e.g., `email`, `mobile`) --- ### **Usage Scenarios (Mode Definition)** | Mode | Purpose | | ---- | ----------------------------- | | `0` | Email or mobile number change | | `1` | Password change | | `2` | Delete account | | `3` | Clear account | | `5` | Login verification | ### **Successful Response** On successful validation: * The user account is activated * The API returns: * `pod_info` associated with the user * User `profile` information The activated account can now be used for login and other Floor POD operations. --- ### **Error Response** The API returns an error response when: * The activation code is invalid or expired * The activation code does not match the user or mode * The user is already activated * Authorization fails or the bearer token is missing/invalid In all error cases, **account activation is not completed**. --- ### **One-Line Summary** > Validates a user’s activation code, activates the account, and returns POD and profile details on success.
|
|
711
|
+
* @param {module:model/ValidateCodeRequest} validateCodeRequest
|
|
712
|
+
* @param {module:api/DefaultApi~validateCodeCallback} callback The callback function, accepting three arguments: error, data, response
|
|
713
|
+
* data is of type: {@link module:model/UserDetails}
|
|
714
|
+
*/
|
|
715
|
+
}, {
|
|
716
|
+
key: "validateCode",
|
|
717
|
+
value: function validateCode(validateCodeRequest, callback) {
|
|
718
|
+
var postBody = validateCodeRequest;
|
|
719
|
+
// verify the required parameter 'validateCodeRequest' is set
|
|
720
|
+
if (validateCodeRequest === undefined || validateCodeRequest === null) {
|
|
721
|
+
throw new Error("Missing the required parameter 'validateCodeRequest' when calling validateCode");
|
|
722
|
+
}
|
|
723
|
+
var pathParams = {};
|
|
724
|
+
var queryParams = {};
|
|
725
|
+
var headerParams = {};
|
|
726
|
+
var formParams = {};
|
|
727
|
+
var authNames = ['bearer'];
|
|
728
|
+
var contentTypes = ['application/json'];
|
|
729
|
+
var accepts = ['application/json'];
|
|
730
|
+
var returnType = _UserDetails["default"];
|
|
731
|
+
return this.apiClient.callApi('/auth-service/validate/activation/code', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
732
|
+
}
|
|
733
|
+
}]);
|
|
734
|
+
}();
|