@xfloor/floor-memory-sdk-ts 1.0.19 → 1.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -50
- package/dist/apis/{DefaultApi.d.ts → AuthApi.d.ts} +21 -51
- package/dist/apis/{DefaultApi.js → AuthApi.js} +57 -196
- package/dist/apis/EventApi.d.ts +16 -1
- package/dist/apis/EventApi.js +69 -0
- package/dist/apis/FloorApi.d.ts +99 -0
- package/dist/apis/FloorApi.js +460 -0
- package/dist/apis/index.d.ts +2 -4
- package/dist/apis/index.js +2 -4
- package/dist/models/ChangeEmail200Response.d.ts +48 -0
- package/dist/models/ChangeEmail200Response.js +61 -0
- package/dist/models/{SignInWithEmail200ResponsePodInfo.d.ts → ChangeEmail200ResponsePodInfo.d.ts} +16 -16
- package/dist/models/{SignInWithEmail200ResponsePodInfo.js → ChangeEmail200ResponsePodInfo.js} +13 -13
- package/dist/models/ChangeEmail200ResponseProfile.d.ts +84 -0
- package/dist/models/{SignInWithEmail200ResponseProfile.js → ChangeEmail200ResponseProfile.js} +20 -20
- package/dist/models/ChangeEmail200ResponseProfileAvatar.d.ts +40 -0
- package/dist/models/{SignInWithEmail200ResponseProfileAvatar.js → ChangeEmail200ResponseProfileAvatar.js} +13 -13
- package/dist/models/{GetFloorInformation200Response.d.ts → EditFloor200Response.d.ts} +17 -17
- package/dist/models/{GetFloorInformation200Response.js → EditFloor200Response.js} +13 -13
- package/dist/models/SignInResponse.d.ts +48 -0
- package/dist/models/SignInResponse.js +61 -0
- package/dist/models/UserDetails.d.ts +6 -6
- package/dist/models/UserDetails.js +6 -6
- package/dist/models/index.d.ts +6 -5
- package/dist/models/index.js +6 -5
- package/package.json +1 -1
- package/dist/apis/EditFloorApi.d.ts +0 -38
- package/dist/apis/EditFloorApi.js +0 -175
- package/dist/apis/GetFloorInformationApi.d.ts +0 -35
- package/dist/apis/GetFloorInformationApi.js +0 -149
- package/dist/apis/GetRecentEventsApi.d.ts +0 -35
- package/dist/apis/GetRecentEventsApi.js +0 -151
- package/dist/models/SignInWithEmail200Response.d.ts +0 -48
- package/dist/models/SignInWithEmail200Response.js +0 -61
- package/dist/models/SignInWithEmail200ResponseProfile.d.ts +0 -84
- package/dist/models/SignInWithEmail200ResponseProfileAvatar.d.ts +0 -40
|
@@ -66,22 +66,22 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
68
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
69
|
-
exports.
|
|
69
|
+
exports.AuthApi = void 0;
|
|
70
70
|
var runtime = require("../runtime");
|
|
71
71
|
var index_1 = require("../models/index");
|
|
72
72
|
/**
|
|
73
73
|
*
|
|
74
74
|
*/
|
|
75
|
-
var
|
|
76
|
-
__extends(
|
|
77
|
-
function
|
|
75
|
+
var AuthApi = /** @class */ (function (_super) {
|
|
76
|
+
__extends(AuthApi, _super);
|
|
77
|
+
function AuthApi() {
|
|
78
78
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
81
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.
|
|
82
82
|
* Change email ID
|
|
83
83
|
*/
|
|
84
|
-
|
|
84
|
+
AuthApi.prototype.changeEmailRaw = function (requestParameters, initOverrides) {
|
|
85
85
|
return __awaiter(this, void 0, void 0, function () {
|
|
86
86
|
var queryParameters, headerParameters, token, tokenString, consumes, canConsumeForm, formParams, useForm, urlPath, response;
|
|
87
87
|
return __generator(this, function (_a) {
|
|
@@ -132,7 +132,7 @@ var DefaultApi = /** @class */ (function (_super) {
|
|
|
132
132
|
}, initOverrides)];
|
|
133
133
|
case 3:
|
|
134
134
|
response = _a.sent();
|
|
135
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.
|
|
135
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.ChangeEmail200ResponseFromJSON)(jsonValue); })];
|
|
136
136
|
}
|
|
137
137
|
});
|
|
138
138
|
});
|
|
@@ -141,7 +141,7 @@ var DefaultApi = /** @class */ (function (_super) {
|
|
|
141
141
|
* 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.
|
|
142
142
|
* Change email ID
|
|
143
143
|
*/
|
|
144
|
-
|
|
144
|
+
AuthApi.prototype.changeEmail = function (requestParameters, initOverrides) {
|
|
145
145
|
return __awaiter(this, void 0, void 0, function () {
|
|
146
146
|
var response;
|
|
147
147
|
return __generator(this, function (_a) {
|
|
@@ -159,7 +159,7 @@ var DefaultApi = /** @class */ (function (_super) {
|
|
|
159
159
|
* 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.
|
|
160
160
|
* Change Mobile number
|
|
161
161
|
*/
|
|
162
|
-
|
|
162
|
+
AuthApi.prototype.changeMobileNumberRaw = function (requestParameters, initOverrides) {
|
|
163
163
|
return __awaiter(this, void 0, void 0, function () {
|
|
164
164
|
var queryParameters, headerParameters, token, tokenString, consumes, canConsumeForm, formParams, useForm, urlPath, response;
|
|
165
165
|
return __generator(this, function (_a) {
|
|
@@ -210,7 +210,7 @@ var DefaultApi = /** @class */ (function (_super) {
|
|
|
210
210
|
}, initOverrides)];
|
|
211
211
|
case 3:
|
|
212
212
|
response = _a.sent();
|
|
213
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.
|
|
213
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.ChangeEmail200ResponseFromJSON)(jsonValue); })];
|
|
214
214
|
}
|
|
215
215
|
});
|
|
216
216
|
});
|
|
@@ -219,7 +219,7 @@ var DefaultApi = /** @class */ (function (_super) {
|
|
|
219
219
|
* 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.
|
|
220
220
|
* Change Mobile number
|
|
221
221
|
*/
|
|
222
|
-
|
|
222
|
+
AuthApi.prototype.changeMobileNumber = function (requestParameters, initOverrides) {
|
|
223
223
|
return __awaiter(this, void 0, void 0, function () {
|
|
224
224
|
var response;
|
|
225
225
|
return __generator(this, function (_a) {
|
|
@@ -237,7 +237,7 @@ var DefaultApi = /** @class */ (function (_super) {
|
|
|
237
237
|
* ## 1) `POST /password/change` — Change Password (Logged-in User) Changes the password of an **authenticated user** who is currently logged in. This endpoint is used when a user is already signed in and wants to update their password as a security or preference action. The system validates a **one-time password-change verification code** (`activation_code`) issued specifically for the change-password flow. If the code is valid and not expired, the user’s password is updated to `new_password` and takes effect immediately. If verification fails, the password remains unchanged and an error response is returned. ### Authentication ✅ **Required**: Bearer token for the logged-in session ``` Authorization: Bearer <access_token> ``` ### Request Body (Form Data) * `user_id` (optional if derived from token) * `activation_code` (required) * `new_password` (required) ### Behavior Notes * Typically requires a prior call to **send a verification code** for password change (mode = password change). * `user_id` can be taken from the access token; include it only if your system requires it explicitly. ### One-Line Summary > Changes the password for a logged-in user after validating a one-time password-change code.
|
|
238
238
|
* Change Password
|
|
239
239
|
*/
|
|
240
|
-
|
|
240
|
+
AuthApi.prototype.changePasswordRaw = function (requestParameters, initOverrides) {
|
|
241
241
|
return __awaiter(this, void 0, void 0, function () {
|
|
242
242
|
var queryParameters, headerParameters, token, tokenString, consumes, canConsumeForm, formParams, useForm, urlPath, response;
|
|
243
243
|
return __generator(this, function (_a) {
|
|
@@ -300,7 +300,7 @@ var DefaultApi = /** @class */ (function (_super) {
|
|
|
300
300
|
* ## 1) `POST /password/change` — Change Password (Logged-in User) Changes the password of an **authenticated user** who is currently logged in. This endpoint is used when a user is already signed in and wants to update their password as a security or preference action. The system validates a **one-time password-change verification code** (`activation_code`) issued specifically for the change-password flow. If the code is valid and not expired, the user’s password is updated to `new_password` and takes effect immediately. If verification fails, the password remains unchanged and an error response is returned. ### Authentication ✅ **Required**: Bearer token for the logged-in session ``` Authorization: Bearer <access_token> ``` ### Request Body (Form Data) * `user_id` (optional if derived from token) * `activation_code` (required) * `new_password` (required) ### Behavior Notes * Typically requires a prior call to **send a verification code** for password change (mode = password change). * `user_id` can be taken from the access token; include it only if your system requires it explicitly. ### One-Line Summary > Changes the password for a logged-in user after validating a one-time password-change code.
|
|
301
301
|
* Change Password
|
|
302
302
|
*/
|
|
303
|
-
|
|
303
|
+
AuthApi.prototype.changePassword = function (requestParameters, initOverrides) {
|
|
304
304
|
return __awaiter(this, void 0, void 0, function () {
|
|
305
305
|
var response;
|
|
306
306
|
return __generator(this, function (_a) {
|
|
@@ -315,101 +315,16 @@ var DefaultApi = /** @class */ (function (_super) {
|
|
|
315
315
|
});
|
|
316
316
|
};
|
|
317
317
|
/**
|
|
318
|
-
* This API
|
|
319
|
-
*
|
|
318
|
+
* 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.
|
|
319
|
+
* External User Registration
|
|
320
320
|
*/
|
|
321
|
-
|
|
321
|
+
AuthApi.prototype.registerExternalUserIdentityRaw = function (requestParameters, initOverrides) {
|
|
322
322
|
return __awaiter(this, void 0, void 0, function () {
|
|
323
|
-
var queryParameters, headerParameters, token, tokenString, urlPath, response;
|
|
324
|
-
return __generator(this, function (_a) {
|
|
325
|
-
switch (_a.label) {
|
|
326
|
-
case 0:
|
|
327
|
-
if (requestParameters['floorId'] == null) {
|
|
328
|
-
throw new runtime.RequiredError('floorId', 'Required parameter "floorId" was null or undefined when calling makeFloorPrivate().');
|
|
329
|
-
}
|
|
330
|
-
if (requestParameters['userId'] == null) {
|
|
331
|
-
throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling makeFloorPrivate().');
|
|
332
|
-
}
|
|
333
|
-
if (requestParameters['appId'] == null) {
|
|
334
|
-
throw new runtime.RequiredError('appId', 'Required parameter "appId" was null or undefined when calling makeFloorPrivate().');
|
|
335
|
-
}
|
|
336
|
-
queryParameters = {};
|
|
337
|
-
if (requestParameters['userId'] != null) {
|
|
338
|
-
queryParameters['user_id'] = requestParameters['userId'];
|
|
339
|
-
}
|
|
340
|
-
if (requestParameters['appId'] != null) {
|
|
341
|
-
queryParameters['app_id'] = requestParameters['appId'];
|
|
342
|
-
}
|
|
343
|
-
headerParameters = {};
|
|
344
|
-
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
|
|
345
|
-
token = this.configuration.accessToken;
|
|
346
|
-
return [4 /*yield*/, token("bearer", [])];
|
|
347
|
-
case 1:
|
|
348
|
-
tokenString = _a.sent();
|
|
349
|
-
if (tokenString) {
|
|
350
|
-
headerParameters["Authorization"] = "Bearer ".concat(tokenString);
|
|
351
|
-
}
|
|
352
|
-
_a.label = 2;
|
|
353
|
-
case 2:
|
|
354
|
-
urlPath = "/api/memory/make/floor/private/{floor_id}";
|
|
355
|
-
urlPath = urlPath.replace("{".concat("floor_id", "}"), encodeURIComponent(String(requestParameters['floorId'])));
|
|
356
|
-
return [4 /*yield*/, this.request({
|
|
357
|
-
path: urlPath,
|
|
358
|
-
method: 'POST',
|
|
359
|
-
headers: headerParameters,
|
|
360
|
-
query: queryParameters,
|
|
361
|
-
}, initOverrides)];
|
|
362
|
-
case 3:
|
|
363
|
-
response = _a.sent();
|
|
364
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.GetFloorInformation200ResponseFromJSON)(jsonValue); })];
|
|
365
|
-
}
|
|
366
|
-
});
|
|
367
|
-
});
|
|
368
|
-
};
|
|
369
|
-
/**
|
|
370
|
-
* 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).
|
|
371
|
-
* Make floor Private
|
|
372
|
-
*/
|
|
373
|
-
DefaultApi.prototype.makeFloorPrivate = function (requestParameters, initOverrides) {
|
|
374
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
375
|
-
var response;
|
|
376
|
-
return __generator(this, function (_a) {
|
|
377
|
-
switch (_a.label) {
|
|
378
|
-
case 0: return [4 /*yield*/, this.makeFloorPrivateRaw(requestParameters, initOverrides)];
|
|
379
|
-
case 1:
|
|
380
|
-
response = _a.sent();
|
|
381
|
-
return [4 /*yield*/, response.value()];
|
|
382
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
383
|
-
}
|
|
384
|
-
});
|
|
385
|
-
});
|
|
386
|
-
};
|
|
387
|
-
/**
|
|
388
|
-
* 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.”**
|
|
389
|
-
* Make floor public
|
|
390
|
-
*/
|
|
391
|
-
DefaultApi.prototype.makeFloorPublicRaw = function (requestParameters, initOverrides) {
|
|
392
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
393
|
-
var queryParameters, headerParameters, token, tokenString, urlPath, response;
|
|
323
|
+
var queryParameters, headerParameters, token, tokenString, consumes, canConsumeForm, formParams, useForm, urlPath, response;
|
|
394
324
|
return __generator(this, function (_a) {
|
|
395
325
|
switch (_a.label) {
|
|
396
326
|
case 0:
|
|
397
|
-
if (requestParameters['floorId'] == null) {
|
|
398
|
-
throw new runtime.RequiredError('floorId', 'Required parameter "floorId" was null or undefined when calling makeFloorPublic().');
|
|
399
|
-
}
|
|
400
|
-
if (requestParameters['userId'] == null) {
|
|
401
|
-
throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling makeFloorPublic().');
|
|
402
|
-
}
|
|
403
|
-
if (requestParameters['appId'] == null) {
|
|
404
|
-
throw new runtime.RequiredError('appId', 'Required parameter "appId" was null or undefined when calling makeFloorPublic().');
|
|
405
|
-
}
|
|
406
327
|
queryParameters = {};
|
|
407
|
-
if (requestParameters['userId'] != null) {
|
|
408
|
-
queryParameters['user_id'] = requestParameters['userId'];
|
|
409
|
-
}
|
|
410
|
-
if (requestParameters['appId'] != null) {
|
|
411
|
-
queryParameters['app_id'] = requestParameters['appId'];
|
|
412
|
-
}
|
|
413
328
|
headerParameters = {};
|
|
414
329
|
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
|
|
415
330
|
token = this.configuration.accessToken;
|
|
@@ -421,109 +336,55 @@ var DefaultApi = /** @class */ (function (_super) {
|
|
|
421
336
|
}
|
|
422
337
|
_a.label = 2;
|
|
423
338
|
case 2:
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
}, initOverrides)];
|
|
432
|
-
case 3:
|
|
433
|
-
response = _a.sent();
|
|
434
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.GetFloorInformation200ResponseFromJSON)(jsonValue); })];
|
|
435
|
-
}
|
|
436
|
-
});
|
|
437
|
-
});
|
|
438
|
-
};
|
|
439
|
-
/**
|
|
440
|
-
* 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.”**
|
|
441
|
-
* Make floor public
|
|
442
|
-
*/
|
|
443
|
-
DefaultApi.prototype.makeFloorPublic = function (requestParameters, initOverrides) {
|
|
444
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
445
|
-
var response;
|
|
446
|
-
return __generator(this, function (_a) {
|
|
447
|
-
switch (_a.label) {
|
|
448
|
-
case 0: return [4 /*yield*/, this.makeFloorPublicRaw(requestParameters, initOverrides)];
|
|
449
|
-
case 1:
|
|
450
|
-
response = _a.sent();
|
|
451
|
-
return [4 /*yield*/, response.value()];
|
|
452
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
453
|
-
}
|
|
454
|
-
});
|
|
455
|
-
});
|
|
456
|
-
};
|
|
457
|
-
/**
|
|
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
|
-
* Rename floor
|
|
460
|
-
*/
|
|
461
|
-
DefaultApi.prototype.renameFloorRaw = function (requestParameters, initOverrides) {
|
|
462
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
463
|
-
var queryParameters, headerParameters, token, tokenString, urlPath, response;
|
|
464
|
-
return __generator(this, function (_a) {
|
|
465
|
-
switch (_a.label) {
|
|
466
|
-
case 0:
|
|
467
|
-
if (requestParameters['userId'] == null) {
|
|
468
|
-
throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling renameFloor().');
|
|
339
|
+
consumes = [
|
|
340
|
+
{ contentType: 'multipart/form-data' },
|
|
341
|
+
];
|
|
342
|
+
canConsumeForm = runtime.canConsumeForm(consumes);
|
|
343
|
+
useForm = false;
|
|
344
|
+
if (useForm) {
|
|
345
|
+
formParams = new FormData();
|
|
469
346
|
}
|
|
470
|
-
|
|
471
|
-
|
|
347
|
+
else {
|
|
348
|
+
formParams = new URLSearchParams();
|
|
472
349
|
}
|
|
473
|
-
if (requestParameters['
|
|
474
|
-
|
|
350
|
+
if (requestParameters['mobileNumber'] != null) {
|
|
351
|
+
formParams.append('mobile_number', requestParameters['mobileNumber']);
|
|
475
352
|
}
|
|
476
|
-
if (requestParameters['
|
|
477
|
-
|
|
353
|
+
if (requestParameters['emailId'] != null) {
|
|
354
|
+
formParams.append('email_id', requestParameters['emailId']);
|
|
478
355
|
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
queryParameters['user_id'] = requestParameters['userId'];
|
|
356
|
+
if (requestParameters['name'] != null) {
|
|
357
|
+
formParams.append('name', requestParameters['name']);
|
|
482
358
|
}
|
|
483
359
|
if (requestParameters['appId'] != null) {
|
|
484
|
-
|
|
485
|
-
}
|
|
486
|
-
if (requestParameters['from'] != null) {
|
|
487
|
-
queryParameters['from'] = requestParameters['from'];
|
|
488
|
-
}
|
|
489
|
-
if (requestParameters['to'] != null) {
|
|
490
|
-
queryParameters['to'] = requestParameters['to'];
|
|
491
|
-
}
|
|
492
|
-
headerParameters = {};
|
|
493
|
-
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
|
|
494
|
-
token = this.configuration.accessToken;
|
|
495
|
-
return [4 /*yield*/, token("bearer", [])];
|
|
496
|
-
case 1:
|
|
497
|
-
tokenString = _a.sent();
|
|
498
|
-
if (tokenString) {
|
|
499
|
-
headerParameters["Authorization"] = "Bearer ".concat(tokenString);
|
|
360
|
+
formParams.append('app_id', requestParameters['appId']);
|
|
500
361
|
}
|
|
501
|
-
|
|
502
|
-
case 2:
|
|
503
|
-
urlPath = "/api/memory/change/floor/id";
|
|
362
|
+
urlPath = "/memory/identity/external-user";
|
|
504
363
|
return [4 /*yield*/, this.request({
|
|
505
364
|
path: urlPath,
|
|
506
365
|
method: 'POST',
|
|
507
366
|
headers: headerParameters,
|
|
508
367
|
query: queryParameters,
|
|
368
|
+
body: formParams,
|
|
509
369
|
}, initOverrides)];
|
|
510
370
|
case 3:
|
|
511
371
|
response = _a.sent();
|
|
512
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.
|
|
372
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.ChangeEmail200ResponseFromJSON)(jsonValue); })];
|
|
513
373
|
}
|
|
514
374
|
});
|
|
515
375
|
});
|
|
516
376
|
};
|
|
517
377
|
/**
|
|
518
|
-
* This API
|
|
519
|
-
*
|
|
378
|
+
* 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.
|
|
379
|
+
* External User Registration
|
|
520
380
|
*/
|
|
521
|
-
|
|
522
|
-
return __awaiter(this,
|
|
381
|
+
AuthApi.prototype.registerExternalUserIdentity = function () {
|
|
382
|
+
return __awaiter(this, arguments, void 0, function (requestParameters, initOverrides) {
|
|
523
383
|
var response;
|
|
384
|
+
if (requestParameters === void 0) { requestParameters = {}; }
|
|
524
385
|
return __generator(this, function (_a) {
|
|
525
386
|
switch (_a.label) {
|
|
526
|
-
case 0: return [4 /*yield*/, this.
|
|
387
|
+
case 0: return [4 /*yield*/, this.registerExternalUserIdentityRaw(requestParameters, initOverrides)];
|
|
527
388
|
case 1:
|
|
528
389
|
response = _a.sent();
|
|
529
390
|
return [4 /*yield*/, response.value()];
|
|
@@ -536,7 +397,7 @@ var DefaultApi = /** @class */ (function (_super) {
|
|
|
536
397
|
* --- ## 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.
|
|
537
398
|
* Reset Password
|
|
538
399
|
*/
|
|
539
|
-
|
|
400
|
+
AuthApi.prototype.resetPasswordRaw = function (requestParameters, initOverrides) {
|
|
540
401
|
return __awaiter(this, void 0, void 0, function () {
|
|
541
402
|
var queryParameters, headerParameters, consumes, canConsumeForm, formParams, useForm, urlPath, response;
|
|
542
403
|
return __generator(this, function (_a) {
|
|
@@ -595,7 +456,7 @@ var DefaultApi = /** @class */ (function (_super) {
|
|
|
595
456
|
* --- ## 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
457
|
* Reset Password
|
|
597
458
|
*/
|
|
598
|
-
|
|
459
|
+
AuthApi.prototype.resetPassword = function (requestParameters, initOverrides) {
|
|
599
460
|
return __awaiter(this, void 0, void 0, function () {
|
|
600
461
|
var response;
|
|
601
462
|
return __generator(this, function (_a) {
|
|
@@ -613,7 +474,7 @@ var DefaultApi = /** @class */ (function (_super) {
|
|
|
613
474
|
* 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 | | `5` | Using OTP for Login | | `6` | OTP for forgot password | **Mode `4` – 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.
|
|
614
475
|
* Send Validation code
|
|
615
476
|
*/
|
|
616
|
-
|
|
477
|
+
AuthApi.prototype.sendValidationCodeRaw = function (requestParameters, initOverrides) {
|
|
617
478
|
return __awaiter(this, void 0, void 0, function () {
|
|
618
479
|
var queryParameters, headerParameters, token, tokenString, consumes, canConsumeForm, formParams, useForm, urlPath, response;
|
|
619
480
|
return __generator(this, function (_a) {
|
|
@@ -679,7 +540,7 @@ var DefaultApi = /** @class */ (function (_super) {
|
|
|
679
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 | | `5` | Using OTP for Login | | `6` | OTP for forgot password | **Mode `4` – 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.
|
|
680
541
|
* Send Validation code
|
|
681
542
|
*/
|
|
682
|
-
|
|
543
|
+
AuthApi.prototype.sendValidationCode = function (requestParameters, initOverrides) {
|
|
683
544
|
return __awaiter(this, void 0, void 0, function () {
|
|
684
545
|
var response;
|
|
685
546
|
return __generator(this, function (_a) {
|
|
@@ -697,7 +558,7 @@ var DefaultApi = /** @class */ (function (_super) {
|
|
|
697
558
|
* 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.
|
|
698
559
|
* Sign In with email ID
|
|
699
560
|
*/
|
|
700
|
-
|
|
561
|
+
AuthApi.prototype.signInWithEmailRaw = function (requestParameters, initOverrides) {
|
|
701
562
|
return __awaiter(this, void 0, void 0, function () {
|
|
702
563
|
var queryParameters, headerParameters, token, tokenString, consumes, canConsumeForm, formParams, useForm, urlPath, response;
|
|
703
564
|
return __generator(this, function (_a) {
|
|
@@ -757,7 +618,7 @@ var DefaultApi = /** @class */ (function (_super) {
|
|
|
757
618
|
}, initOverrides)];
|
|
758
619
|
case 3:
|
|
759
620
|
response = _a.sent();
|
|
760
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.
|
|
621
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.SignInResponseFromJSON)(jsonValue); })];
|
|
761
622
|
}
|
|
762
623
|
});
|
|
763
624
|
});
|
|
@@ -766,7 +627,7 @@ var DefaultApi = /** @class */ (function (_super) {
|
|
|
766
627
|
* 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.
|
|
767
628
|
* Sign In with email ID
|
|
768
629
|
*/
|
|
769
|
-
|
|
630
|
+
AuthApi.prototype.signInWithEmail = function (requestParameters, initOverrides) {
|
|
770
631
|
return __awaiter(this, void 0, void 0, function () {
|
|
771
632
|
var response;
|
|
772
633
|
return __generator(this, function (_a) {
|
|
@@ -784,7 +645,7 @@ var DefaultApi = /** @class */ (function (_super) {
|
|
|
784
645
|
* 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.
|
|
785
646
|
* Sign In with Mobile number
|
|
786
647
|
*/
|
|
787
|
-
|
|
648
|
+
AuthApi.prototype.signInWithMobileNumberRaw = function (requestParameters, initOverrides) {
|
|
788
649
|
return __awaiter(this, void 0, void 0, function () {
|
|
789
650
|
var queryParameters, headerParameters, token, tokenString, consumes, canConsumeForm, formParams, useForm, urlPath, response;
|
|
790
651
|
return __generator(this, function (_a) {
|
|
@@ -844,7 +705,7 @@ var DefaultApi = /** @class */ (function (_super) {
|
|
|
844
705
|
}, initOverrides)];
|
|
845
706
|
case 3:
|
|
846
707
|
response = _a.sent();
|
|
847
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.
|
|
708
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.SignInResponseFromJSON)(jsonValue); })];
|
|
848
709
|
}
|
|
849
710
|
});
|
|
850
711
|
});
|
|
@@ -853,7 +714,7 @@ var DefaultApi = /** @class */ (function (_super) {
|
|
|
853
714
|
* 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.
|
|
854
715
|
* Sign In with Mobile number
|
|
855
716
|
*/
|
|
856
|
-
|
|
717
|
+
AuthApi.prototype.signInWithMobileNumber = function (requestParameters, initOverrides) {
|
|
857
718
|
return __awaiter(this, void 0, void 0, function () {
|
|
858
719
|
var response;
|
|
859
720
|
return __generator(this, function (_a) {
|
|
@@ -871,7 +732,7 @@ var DefaultApi = /** @class */ (function (_super) {
|
|
|
871
732
|
* 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
|
|
872
733
|
* Sign Up
|
|
873
734
|
*/
|
|
874
|
-
|
|
735
|
+
AuthApi.prototype.signUpRaw = function (requestParameters, initOverrides) {
|
|
875
736
|
return __awaiter(this, void 0, void 0, function () {
|
|
876
737
|
var queryParameters, headerParameters, token, tokenString, consumes, canConsumeForm, formParams, useForm, urlPath, response;
|
|
877
738
|
return __generator(this, function (_a) {
|
|
@@ -940,7 +801,7 @@ var DefaultApi = /** @class */ (function (_super) {
|
|
|
940
801
|
* 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
|
|
941
802
|
* Sign Up
|
|
942
803
|
*/
|
|
943
|
-
|
|
804
|
+
AuthApi.prototype.signUp = function (requestParameters, initOverrides) {
|
|
944
805
|
return __awaiter(this, void 0, void 0, function () {
|
|
945
806
|
var response;
|
|
946
807
|
return __generator(this, function (_a) {
|
|
@@ -958,7 +819,7 @@ var DefaultApi = /** @class */ (function (_super) {
|
|
|
958
819
|
* ## **Validate Activation / Verification Code** This API **validates a one-time verification code** submitted by a user and **executes the corresponding account operation** based on the specified **mode**. Depending on the mode, the API may: * Activate a newly registered account * Confirm a login attempt * Verify a password change or reset * Validate email or mobile updates * Confirm account deletion or clearing requests The API verifies the provided `activation_code` against the given `user_id`, `mode`, and application context. If validation succeeds, the requested operation is completed and the API returns the relevant **POD information** and **user profile details** (where applicable). If validation fails, the operation is **not performed** and an appropriate error response is returned. --- ## **Authentication** This endpoint requires **Bearer Token authentication**. **Header** ``` Authorization: Bearer <access_token> ``` --- ## **Request Body** ```json { \"user_id\": \"string\", \"activation_code\": \"string\", \"app_id\": \"string\", \"mode\": \"string\" } ``` ### **Field Descriptions** * **user_id** – Unique identifier of the user initiating the operation * **activation_code** – One-time verification code sent to the user * **app_id** – Application identifier (optional or context-specific) * **mode** – Operation context for which the verification is being performed --- ## **Usage Scenarios (Mode Definitions)** | Mode | Purpose | | ---- | ---------------------------------------- | | 0 | Email or mobile number change | | 1 | Password change | | 2 | Delete account | | 3 | Clear account | | 4 | Signup verification (account activation) | | 5 | Login verification | | 6 | Forgot password verification | --- ## **Successful Response** On successful validation: * The requested operation (based on `mode`) is completed * The API returns: * **POD information** associated with the user (if applicable) * **User profile details** (if applicable) Examples: * For **signup verification**, the user account is activated * For **login**, access is confirmed * For **password reset**, the user may proceed to set a new password * For **account deletion**, the request is confirmed --- ## **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 operation mode * The requested operation is already completed (e.g., user already activated) * Authorization fails or the bearer token is missing or invalid ⚠️ In all error cases, **no account state change occurs**. --- ## **One-Line Summary** > Validates a one-time verification code and securely completes the requested user account operation (signup, login, password change, or account actions), returning POD and profile details on success.
|
|
959
820
|
* Validation
|
|
960
821
|
*/
|
|
961
|
-
|
|
822
|
+
AuthApi.prototype.validateCodeRaw = function (requestParameters, initOverrides) {
|
|
962
823
|
return __awaiter(this, void 0, void 0, function () {
|
|
963
824
|
var queryParameters, headerParameters, token, tokenString, consumes, canConsumeForm, formParams, useForm, urlPath, response;
|
|
964
825
|
return __generator(this, function (_a) {
|
|
@@ -1027,7 +888,7 @@ var DefaultApi = /** @class */ (function (_super) {
|
|
|
1027
888
|
* ## **Validate Activation / Verification Code** This API **validates a one-time verification code** submitted by a user and **executes the corresponding account operation** based on the specified **mode**. Depending on the mode, the API may: * Activate a newly registered account * Confirm a login attempt * Verify a password change or reset * Validate email or mobile updates * Confirm account deletion or clearing requests The API verifies the provided `activation_code` against the given `user_id`, `mode`, and application context. If validation succeeds, the requested operation is completed and the API returns the relevant **POD information** and **user profile details** (where applicable). If validation fails, the operation is **not performed** and an appropriate error response is returned. --- ## **Authentication** This endpoint requires **Bearer Token authentication**. **Header** ``` Authorization: Bearer <access_token> ``` --- ## **Request Body** ```json { \"user_id\": \"string\", \"activation_code\": \"string\", \"app_id\": \"string\", \"mode\": \"string\" } ``` ### **Field Descriptions** * **user_id** – Unique identifier of the user initiating the operation * **activation_code** – One-time verification code sent to the user * **app_id** – Application identifier (optional or context-specific) * **mode** – Operation context for which the verification is being performed --- ## **Usage Scenarios (Mode Definitions)** | Mode | Purpose | | ---- | ---------------------------------------- | | 0 | Email or mobile number change | | 1 | Password change | | 2 | Delete account | | 3 | Clear account | | 4 | Signup verification (account activation) | | 5 | Login verification | | 6 | Forgot password verification | --- ## **Successful Response** On successful validation: * The requested operation (based on `mode`) is completed * The API returns: * **POD information** associated with the user (if applicable) * **User profile details** (if applicable) Examples: * For **signup verification**, the user account is activated * For **login**, access is confirmed * For **password reset**, the user may proceed to set a new password * For **account deletion**, the request is confirmed --- ## **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 operation mode * The requested operation is already completed (e.g., user already activated) * Authorization fails or the bearer token is missing or invalid ⚠️ In all error cases, **no account state change occurs**. --- ## **One-Line Summary** > Validates a one-time verification code and securely completes the requested user account operation (signup, login, password change, or account actions), returning POD and profile details on success.
|
|
1028
889
|
* Validation
|
|
1029
890
|
*/
|
|
1030
|
-
|
|
891
|
+
AuthApi.prototype.validateCode = function (requestParameters, initOverrides) {
|
|
1031
892
|
return __awaiter(this, void 0, void 0, function () {
|
|
1032
893
|
var response;
|
|
1033
894
|
return __generator(this, function (_a) {
|
|
@@ -1041,6 +902,6 @@ var DefaultApi = /** @class */ (function (_super) {
|
|
|
1041
902
|
});
|
|
1042
903
|
});
|
|
1043
904
|
};
|
|
1044
|
-
return
|
|
905
|
+
return AuthApi;
|
|
1045
906
|
}(runtime.BaseAPI));
|
|
1046
|
-
exports.
|
|
907
|
+
exports.AuthApi = AuthApi;
|