From 5a81d66cd96863ed5a38aa46de1b5b6cd20dd8ad Mon Sep 17 00:00:00 2001 From: Danny Rorabaugh Date: Thu, 16 Jan 2025 15:50:29 -0500 Subject: [PATCH 1/4] Move email, name from url to body to protect PII --- Backend/Controllers/SpeakerController.cs | 10 +-- Backend/Controllers/UserController.cs | 8 +-- Backend/Controllers/UserRoleController.cs | 2 +- src/api/api/speaker-api.ts | 78 +++++++++++++---------- src/api/api/user-api.ts | 76 ++++++++++++---------- src/backend/index.ts | 8 +-- 6 files changed, 103 insertions(+), 79 deletions(-) diff --git a/Backend/Controllers/SpeakerController.cs b/Backend/Controllers/SpeakerController.cs index 7eae5b76eb..57987d4a5b 100644 --- a/Backend/Controllers/SpeakerController.cs +++ b/Backend/Controllers/SpeakerController.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.ModelBinding; namespace BackendFramework.Controllers { @@ -96,9 +97,9 @@ public async Task GetSpeaker(string projectId, string speakerId) /// Creates a for the specified projectId /// Id of created Speaker - [HttpGet("create/{name}", Name = "CreateSpeaker")] + [HttpPut("create", Name = "CreateSpeaker")] [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(string))] - public async Task CreateSpeaker(string projectId, string name) + public async Task CreateSpeaker(string projectId, [FromBody, BindRequired] string name) { // Check permissions if (!await _permissionService.HasProjectPermission( @@ -193,9 +194,10 @@ public async Task RemoveConsent(string projectId, string speakerI /// Updates the 's name for the specified projectId and speakerId /// Id of updated Speaker - [HttpGet("update/{speakerId}/{name}", Name = "UpdateSpeakerName")] + [HttpPut("update/{speakerId}", Name = "UpdateSpeakerName")] [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(string))] - public async Task UpdateSpeakerName(string projectId, string speakerId, string name) + public async Task UpdateSpeakerName( + string projectId, string speakerId, [FromBody, BindRequired] string name) { // Check permissions if (!await _permissionService.HasProjectPermission( diff --git a/Backend/Controllers/UserController.cs b/Backend/Controllers/UserController.cs index 32c9c3ce47..55d23ba8f3 100644 --- a/Backend/Controllers/UserController.cs +++ b/Backend/Controllers/UserController.cs @@ -154,9 +154,9 @@ public async Task GetUser(string userId) } /// Returns with the specified email address. - [HttpGet("getemail/{email}", Name = "GetUserByEmail")] + [HttpPut("getbyemail", Name = "GetUserByEmail")] [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(User))] - public async Task GetUserByEmail(string email) + public async Task GetUserByEmail([FromBody, BindRequired] string email) { if (!_permissionService.IsCurrentUserAuthorized(HttpContext)) { @@ -200,9 +200,9 @@ public async Task CreateUser([FromBody, BindRequired] User user) /// Checks whether specified email address is taken or empty. [AllowAnonymous] - [HttpGet("isemailtaken/{email}", Name = "IsEmailUnavailable")] + [HttpPut("isemailtaken", Name = "IsEmailUnavailable")] [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(bool))] - public async Task IsEmailUnavailable(string email) + public async Task IsEmailUnavailable([FromBody, BindRequired] string email) { var isUnavailable = string.IsNullOrWhiteSpace(email) || await _userRepo.GetUserByEmail(email) is not null; return Ok(isUnavailable); diff --git a/Backend/Controllers/UserRoleController.cs b/Backend/Controllers/UserRoleController.cs index 290dd9d90d..8f60524323 100644 --- a/Backend/Controllers/UserRoleController.cs +++ b/Backend/Controllers/UserRoleController.cs @@ -366,7 +366,7 @@ public async Task ChangeOwner(string projectId, string oldUserId, if (newResult != ResultOfUpdate.Updated) { return StatusCode(StatusCodes.Status304NotModified, newRoleId); - }; + } // Change the old owner to a project admin oldUserRole.Role = Role.Administrator; diff --git a/src/api/api/speaker-api.ts b/src/api/api/speaker-api.ts index 86b20ac317..55b24269cf 100644 --- a/src/api/api/speaker-api.ts +++ b/src/api/api/speaker-api.ts @@ -49,22 +49,23 @@ export const SpeakerApiAxiosParamCreator = function ( /** * * @param {string} projectId - * @param {string} name + * @param {string} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ createSpeaker: async ( projectId: string, - name: string, + body: string, options: any = {} ): Promise => { // verify required parameter 'projectId' is not null or undefined assertParamExists("createSpeaker", "projectId", projectId); - // verify required parameter 'name' is not null or undefined - assertParamExists("createSpeaker", "name", name); - const localVarPath = `/v1/projects/{projectId}/speakers/create/{name}` - .replace(`{${"projectId"}}`, encodeURIComponent(String(projectId))) - .replace(`{${"name"}}`, encodeURIComponent(String(name))); + // verify required parameter 'body' is not null or undefined + assertParamExists("createSpeaker", "body", body); + const localVarPath = `/v1/projects/{projectId}/speakers/create`.replace( + `{${"projectId"}}`, + encodeURIComponent(String(projectId)) + ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -73,13 +74,15 @@ export const SpeakerApiAxiosParamCreator = function ( } const localVarRequestOptions = { - method: "GET", + method: "PUT", ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; + localVarHeaderParameter["Content-Type"] = "application/json"; + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; @@ -88,6 +91,11 @@ export const SpeakerApiAxiosParamCreator = function ( ...headersFromBaseOptions, ...options.headers, }; + localVarRequestOptions.data = serializeDataIfNeeded( + body, + localVarRequestOptions, + configuration + ); return { url: toPathString(localVarUrlObj), @@ -382,27 +390,26 @@ export const SpeakerApiAxiosParamCreator = function ( * * @param {string} projectId * @param {string} speakerId - * @param {string} name + * @param {string} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateSpeakerName: async ( projectId: string, speakerId: string, - name: string, + body: string, options: any = {} ): Promise => { // verify required parameter 'projectId' is not null or undefined assertParamExists("updateSpeakerName", "projectId", projectId); // verify required parameter 'speakerId' is not null or undefined assertParamExists("updateSpeakerName", "speakerId", speakerId); - // verify required parameter 'name' is not null or undefined - assertParamExists("updateSpeakerName", "name", name); + // verify required parameter 'body' is not null or undefined + assertParamExists("updateSpeakerName", "body", body); const localVarPath = - `/v1/projects/{projectId}/speakers/update/{speakerId}/{name}` + `/v1/projects/{projectId}/speakers/update/{speakerId}` .replace(`{${"projectId"}}`, encodeURIComponent(String(projectId))) - .replace(`{${"speakerId"}}`, encodeURIComponent(String(speakerId))) - .replace(`{${"name"}}`, encodeURIComponent(String(name))); + .replace(`{${"speakerId"}}`, encodeURIComponent(String(speakerId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -411,13 +418,15 @@ export const SpeakerApiAxiosParamCreator = function ( } const localVarRequestOptions = { - method: "GET", + method: "PUT", ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; + localVarHeaderParameter["Content-Type"] = "application/json"; + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; @@ -426,6 +435,11 @@ export const SpeakerApiAxiosParamCreator = function ( ...headersFromBaseOptions, ...options.headers, }; + localVarRequestOptions.data = serializeDataIfNeeded( + body, + localVarRequestOptions, + configuration + ); return { url: toPathString(localVarUrlObj), @@ -506,20 +520,20 @@ export const SpeakerApiFp = function (configuration?: Configuration) { /** * * @param {string} projectId - * @param {string} name + * @param {string} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createSpeaker( projectId: string, - name: string, + body: string, options?: any ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.createSpeaker( projectId, - name, + body, options ); return createRequestFunction( @@ -682,14 +696,14 @@ export const SpeakerApiFp = function (configuration?: Configuration) { * * @param {string} projectId * @param {string} speakerId - * @param {string} name + * @param {string} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateSpeakerName( projectId: string, speakerId: string, - name: string, + body: string, options?: any ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise @@ -698,7 +712,7 @@ export const SpeakerApiFp = function (configuration?: Configuration) { await localVarAxiosParamCreator.updateSpeakerName( projectId, speakerId, - name, + body, options ); return createRequestFunction( @@ -754,17 +768,17 @@ export const SpeakerApiFactory = function ( /** * * @param {string} projectId - * @param {string} name + * @param {string} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ createSpeaker( projectId: string, - name: string, + body: string, options?: any ): AxiosPromise { return localVarFp - .createSpeaker(projectId, name, options) + .createSpeaker(projectId, body, options) .then((request) => request(axios, basePath)); }, /** @@ -863,18 +877,18 @@ export const SpeakerApiFactory = function ( * * @param {string} projectId * @param {string} speakerId - * @param {string} name + * @param {string} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateSpeakerName( projectId: string, speakerId: string, - name: string, + body: string, options?: any ): AxiosPromise { return localVarFp - .updateSpeakerName(projectId, speakerId, name, options) + .updateSpeakerName(projectId, speakerId, body, options) .then((request) => request(axios, basePath)); }, /** @@ -916,7 +930,7 @@ export interface SpeakerApiCreateSpeakerRequest { * @type {string} * @memberof SpeakerApiCreateSpeaker */ - readonly name: string; + readonly body: string; } /** @@ -1056,7 +1070,7 @@ export interface SpeakerApiUpdateSpeakerNameRequest { * @type {string} * @memberof SpeakerApiUpdateSpeakerName */ - readonly name: string; + readonly body: string; } /** @@ -1108,7 +1122,7 @@ export class SpeakerApi extends BaseAPI { return SpeakerApiFp(this.configuration) .createSpeaker( requestParameters.projectId, - requestParameters.name, + requestParameters.body, options ) .then((request) => request(this.axios, this.basePath)); @@ -1241,7 +1255,7 @@ export class SpeakerApi extends BaseAPI { .updateSpeakerName( requestParameters.projectId, requestParameters.speakerId, - requestParameters.name, + requestParameters.body, options ) .then((request) => request(this.axios, this.basePath)); diff --git a/src/api/api/user-api.ts b/src/api/api/user-api.ts index 684e936992..80633142c4 100644 --- a/src/api/api/user-api.ts +++ b/src/api/api/user-api.ts @@ -275,20 +275,17 @@ export const UserApiAxiosParamCreator = function ( }, /** * - * @param {string} email + * @param {string} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ getUserByEmail: async ( - email: string, + body: string, options: any = {} ): Promise => { - // verify required parameter 'email' is not null or undefined - assertParamExists("getUserByEmail", "email", email); - const localVarPath = `/v1/users/getemail/{email}`.replace( - `{${"email"}}`, - encodeURIComponent(String(email)) - ); + // verify required parameter 'body' is not null or undefined + assertParamExists("getUserByEmail", "body", body); + const localVarPath = `/v1/users/getbyemail`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -297,13 +294,15 @@ export const UserApiAxiosParamCreator = function ( } const localVarRequestOptions = { - method: "GET", + method: "PUT", ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; + localVarHeaderParameter["Content-Type"] = "application/json"; + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; @@ -312,6 +311,11 @@ export const UserApiAxiosParamCreator = function ( ...headersFromBaseOptions, ...options.headers, }; + localVarRequestOptions.data = serializeDataIfNeeded( + body, + localVarRequestOptions, + configuration + ); return { url: toPathString(localVarUrlObj), @@ -320,20 +324,17 @@ export const UserApiAxiosParamCreator = function ( }, /** * - * @param {string} email + * @param {string} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ isEmailUnavailable: async ( - email: string, + body: string, options: any = {} ): Promise => { - // verify required parameter 'email' is not null or undefined - assertParamExists("isEmailUnavailable", "email", email); - const localVarPath = `/v1/users/isemailtaken/{email}`.replace( - `{${"email"}}`, - encodeURIComponent(String(email)) - ); + // verify required parameter 'body' is not null or undefined + assertParamExists("isEmailUnavailable", "body", body); + const localVarPath = `/v1/users/isemailtaken`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -342,13 +343,15 @@ export const UserApiAxiosParamCreator = function ( } const localVarRequestOptions = { - method: "GET", + method: "PUT", ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; + localVarHeaderParameter["Content-Type"] = "application/json"; + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; @@ -357,6 +360,11 @@ export const UserApiAxiosParamCreator = function ( ...headersFromBaseOptions, ...options.headers, }; + localVarRequestOptions.data = serializeDataIfNeeded( + body, + localVarRequestOptions, + configuration + ); return { url: toPathString(localVarUrlObj), @@ -774,18 +782,18 @@ export const UserApiFp = function (configuration?: Configuration) { }, /** * - * @param {string} email + * @param {string} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getUserByEmail( - email: string, + body: string, options?: any ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getUserByEmail( - email, + body, options ); return createRequestFunction( @@ -797,18 +805,18 @@ export const UserApiFp = function (configuration?: Configuration) { }, /** * - * @param {string} email + * @param {string} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ async isEmailUnavailable( - email: string, + body: string, options?: any ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = - await localVarAxiosParamCreator.isEmailUnavailable(email, options); + await localVarAxiosParamCreator.isEmailUnavailable(body, options); return createRequestFunction( localVarAxiosArgs, globalAxios, @@ -1020,24 +1028,24 @@ export const UserApiFactory = function ( }, /** * - * @param {string} email + * @param {string} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getUserByEmail(email: string, options?: any): AxiosPromise { + getUserByEmail(body: string, options?: any): AxiosPromise { return localVarFp - .getUserByEmail(email, options) + .getUserByEmail(body, options) .then((request) => request(axios, basePath)); }, /** * - * @param {string} email + * @param {string} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ - isEmailUnavailable(email: string, options?: any): AxiosPromise { + isEmailUnavailable(body: string, options?: any): AxiosPromise { return localVarFp - .isEmailUnavailable(email, options) + .isEmailUnavailable(body, options) .then((request) => request(axios, basePath)); }, /** @@ -1186,7 +1194,7 @@ export interface UserApiGetUserByEmailRequest { * @type {string} * @memberof UserApiGetUserByEmail */ - readonly email: string; + readonly body: string; } /** @@ -1200,7 +1208,7 @@ export interface UserApiIsEmailUnavailableRequest { * @type {string} * @memberof UserApiIsEmailUnavailable */ - readonly email: string; + readonly body: string; } /** @@ -1372,7 +1380,7 @@ export class UserApi extends BaseAPI { options?: any ) { return UserApiFp(this.configuration) - .getUserByEmail(requestParameters.email, options) + .getUserByEmail(requestParameters.body, options) .then((request) => request(this.axios, this.basePath)); } @@ -1388,7 +1396,7 @@ export class UserApi extends BaseAPI { options?: any ) { return UserApiFp(this.configuration) - .isEmailUnavailable(requestParameters.email, options) + .isEmailUnavailable(requestParameters.body, options) .then((request) => request(this.axios, this.basePath)); } diff --git a/src/backend/index.ts b/src/backend/index.ts index 33bf1c40bc..23d86c3352 100644 --- a/src/backend/index.ts +++ b/src/backend/index.ts @@ -499,7 +499,7 @@ export async function createSpeaker( projectId?: string ): Promise { projectId = projectId || LocalStorage.getProjectId(); - const params = { name, projectId }; + const params = { body: name, projectId }; return (await speakerApi.createSpeaker(params, defaultOptions())).data; } @@ -530,7 +530,7 @@ export async function updateSpeakerName( projectId?: string ): Promise { projectId = projectId || LocalStorage.getProjectId(); - const params = { name, projectId, speakerId }; + const params = { body: name, projectId, speakerId }; return (await speakerApi.updateSpeakerName(params, defaultOptions())).data; } @@ -655,7 +655,7 @@ export async function addUser(user: User): Promise { /** Returns true if the email address is in use already. */ export async function isEmailTaken(email: string): Promise { - return (await userApi.isEmailUnavailable({ email })).data; + return (await userApi.isEmailUnavailable({ body: email })).data; } export async function authenticateUser( @@ -683,7 +683,7 @@ export async function getUser(userId: string): Promise { } export async function getUserByEmail(email: string): Promise { - return (await userApi.getUserByEmail({ email }, defaultOptions())).data; + return (await userApi.getUserByEmail({ body: email }, defaultOptions())).data; } export async function updateUser(user: User): Promise { From ce0dd517276d3262c49b8fa7c1ad0c0e0e8e6475 Mon Sep 17 00:00:00 2001 From: Danny Rorabaugh Date: Fri, 17 Jan 2025 14:35:58 -0500 Subject: [PATCH 2/4] Disambiguate routes --- Backend/Controllers/UserController.cs | 2 +- src/api/api/speaker-api.ts | 78 +++++++++++---------------- src/api/api/user-api.ts | 76 ++++++++++++-------------- src/api/models/user.ts | 12 +++++ src/backend/index.ts | 8 +-- 5 files changed, 83 insertions(+), 93 deletions(-) diff --git a/Backend/Controllers/UserController.cs b/Backend/Controllers/UserController.cs index 55d23ba8f3..9d446d790d 100644 --- a/Backend/Controllers/UserController.cs +++ b/Backend/Controllers/UserController.cs @@ -210,7 +210,7 @@ public async Task IsEmailUnavailable([FromBody, BindRequired] str /// Updates with specified id. /// Id of updated user. - [HttpPut("{userId}", Name = "UpdateUser")] + [HttpPut("updateuser/{userId}", Name = "UpdateUser")] [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(string))] public async Task UpdateUser(string userId, [FromBody, BindRequired] User user) { diff --git a/src/api/api/speaker-api.ts b/src/api/api/speaker-api.ts index 55b24269cf..86b20ac317 100644 --- a/src/api/api/speaker-api.ts +++ b/src/api/api/speaker-api.ts @@ -49,23 +49,22 @@ export const SpeakerApiAxiosParamCreator = function ( /** * * @param {string} projectId - * @param {string} body + * @param {string} name * @param {*} [options] Override http request option. * @throws {RequiredError} */ createSpeaker: async ( projectId: string, - body: string, + name: string, options: any = {} ): Promise => { // verify required parameter 'projectId' is not null or undefined assertParamExists("createSpeaker", "projectId", projectId); - // verify required parameter 'body' is not null or undefined - assertParamExists("createSpeaker", "body", body); - const localVarPath = `/v1/projects/{projectId}/speakers/create`.replace( - `{${"projectId"}}`, - encodeURIComponent(String(projectId)) - ); + // verify required parameter 'name' is not null or undefined + assertParamExists("createSpeaker", "name", name); + const localVarPath = `/v1/projects/{projectId}/speakers/create/{name}` + .replace(`{${"projectId"}}`, encodeURIComponent(String(projectId))) + .replace(`{${"name"}}`, encodeURIComponent(String(name))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -74,15 +73,13 @@ export const SpeakerApiAxiosParamCreator = function ( } const localVarRequestOptions = { - method: "PUT", + method: "GET", ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - localVarHeaderParameter["Content-Type"] = "application/json"; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; @@ -91,11 +88,6 @@ export const SpeakerApiAxiosParamCreator = function ( ...headersFromBaseOptions, ...options.headers, }; - localVarRequestOptions.data = serializeDataIfNeeded( - body, - localVarRequestOptions, - configuration - ); return { url: toPathString(localVarUrlObj), @@ -390,26 +382,27 @@ export const SpeakerApiAxiosParamCreator = function ( * * @param {string} projectId * @param {string} speakerId - * @param {string} body + * @param {string} name * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateSpeakerName: async ( projectId: string, speakerId: string, - body: string, + name: string, options: any = {} ): Promise => { // verify required parameter 'projectId' is not null or undefined assertParamExists("updateSpeakerName", "projectId", projectId); // verify required parameter 'speakerId' is not null or undefined assertParamExists("updateSpeakerName", "speakerId", speakerId); - // verify required parameter 'body' is not null or undefined - assertParamExists("updateSpeakerName", "body", body); + // verify required parameter 'name' is not null or undefined + assertParamExists("updateSpeakerName", "name", name); const localVarPath = - `/v1/projects/{projectId}/speakers/update/{speakerId}` + `/v1/projects/{projectId}/speakers/update/{speakerId}/{name}` .replace(`{${"projectId"}}`, encodeURIComponent(String(projectId))) - .replace(`{${"speakerId"}}`, encodeURIComponent(String(speakerId))); + .replace(`{${"speakerId"}}`, encodeURIComponent(String(speakerId))) + .replace(`{${"name"}}`, encodeURIComponent(String(name))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -418,15 +411,13 @@ export const SpeakerApiAxiosParamCreator = function ( } const localVarRequestOptions = { - method: "PUT", + method: "GET", ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - localVarHeaderParameter["Content-Type"] = "application/json"; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; @@ -435,11 +426,6 @@ export const SpeakerApiAxiosParamCreator = function ( ...headersFromBaseOptions, ...options.headers, }; - localVarRequestOptions.data = serializeDataIfNeeded( - body, - localVarRequestOptions, - configuration - ); return { url: toPathString(localVarUrlObj), @@ -520,20 +506,20 @@ export const SpeakerApiFp = function (configuration?: Configuration) { /** * * @param {string} projectId - * @param {string} body + * @param {string} name * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createSpeaker( projectId: string, - body: string, + name: string, options?: any ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.createSpeaker( projectId, - body, + name, options ); return createRequestFunction( @@ -696,14 +682,14 @@ export const SpeakerApiFp = function (configuration?: Configuration) { * * @param {string} projectId * @param {string} speakerId - * @param {string} body + * @param {string} name * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateSpeakerName( projectId: string, speakerId: string, - body: string, + name: string, options?: any ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise @@ -712,7 +698,7 @@ export const SpeakerApiFp = function (configuration?: Configuration) { await localVarAxiosParamCreator.updateSpeakerName( projectId, speakerId, - body, + name, options ); return createRequestFunction( @@ -768,17 +754,17 @@ export const SpeakerApiFactory = function ( /** * * @param {string} projectId - * @param {string} body + * @param {string} name * @param {*} [options] Override http request option. * @throws {RequiredError} */ createSpeaker( projectId: string, - body: string, + name: string, options?: any ): AxiosPromise { return localVarFp - .createSpeaker(projectId, body, options) + .createSpeaker(projectId, name, options) .then((request) => request(axios, basePath)); }, /** @@ -877,18 +863,18 @@ export const SpeakerApiFactory = function ( * * @param {string} projectId * @param {string} speakerId - * @param {string} body + * @param {string} name * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateSpeakerName( projectId: string, speakerId: string, - body: string, + name: string, options?: any ): AxiosPromise { return localVarFp - .updateSpeakerName(projectId, speakerId, body, options) + .updateSpeakerName(projectId, speakerId, name, options) .then((request) => request(axios, basePath)); }, /** @@ -930,7 +916,7 @@ export interface SpeakerApiCreateSpeakerRequest { * @type {string} * @memberof SpeakerApiCreateSpeaker */ - readonly body: string; + readonly name: string; } /** @@ -1070,7 +1056,7 @@ export interface SpeakerApiUpdateSpeakerNameRequest { * @type {string} * @memberof SpeakerApiUpdateSpeakerName */ - readonly body: string; + readonly name: string; } /** @@ -1122,7 +1108,7 @@ export class SpeakerApi extends BaseAPI { return SpeakerApiFp(this.configuration) .createSpeaker( requestParameters.projectId, - requestParameters.body, + requestParameters.name, options ) .then((request) => request(this.axios, this.basePath)); @@ -1255,7 +1241,7 @@ export class SpeakerApi extends BaseAPI { .updateSpeakerName( requestParameters.projectId, requestParameters.speakerId, - requestParameters.body, + requestParameters.name, options ) .then((request) => request(this.axios, this.basePath)); diff --git a/src/api/api/user-api.ts b/src/api/api/user-api.ts index 80633142c4..684e936992 100644 --- a/src/api/api/user-api.ts +++ b/src/api/api/user-api.ts @@ -275,17 +275,20 @@ export const UserApiAxiosParamCreator = function ( }, /** * - * @param {string} body + * @param {string} email * @param {*} [options] Override http request option. * @throws {RequiredError} */ getUserByEmail: async ( - body: string, + email: string, options: any = {} ): Promise => { - // verify required parameter 'body' is not null or undefined - assertParamExists("getUserByEmail", "body", body); - const localVarPath = `/v1/users/getbyemail`; + // verify required parameter 'email' is not null or undefined + assertParamExists("getUserByEmail", "email", email); + const localVarPath = `/v1/users/getemail/{email}`.replace( + `{${"email"}}`, + encodeURIComponent(String(email)) + ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -294,15 +297,13 @@ export const UserApiAxiosParamCreator = function ( } const localVarRequestOptions = { - method: "PUT", + method: "GET", ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - localVarHeaderParameter["Content-Type"] = "application/json"; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; @@ -311,11 +312,6 @@ export const UserApiAxiosParamCreator = function ( ...headersFromBaseOptions, ...options.headers, }; - localVarRequestOptions.data = serializeDataIfNeeded( - body, - localVarRequestOptions, - configuration - ); return { url: toPathString(localVarUrlObj), @@ -324,17 +320,20 @@ export const UserApiAxiosParamCreator = function ( }, /** * - * @param {string} body + * @param {string} email * @param {*} [options] Override http request option. * @throws {RequiredError} */ isEmailUnavailable: async ( - body: string, + email: string, options: any = {} ): Promise => { - // verify required parameter 'body' is not null or undefined - assertParamExists("isEmailUnavailable", "body", body); - const localVarPath = `/v1/users/isemailtaken`; + // verify required parameter 'email' is not null or undefined + assertParamExists("isEmailUnavailable", "email", email); + const localVarPath = `/v1/users/isemailtaken/{email}`.replace( + `{${"email"}}`, + encodeURIComponent(String(email)) + ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -343,15 +342,13 @@ export const UserApiAxiosParamCreator = function ( } const localVarRequestOptions = { - method: "PUT", + method: "GET", ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - localVarHeaderParameter["Content-Type"] = "application/json"; - setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; @@ -360,11 +357,6 @@ export const UserApiAxiosParamCreator = function ( ...headersFromBaseOptions, ...options.headers, }; - localVarRequestOptions.data = serializeDataIfNeeded( - body, - localVarRequestOptions, - configuration - ); return { url: toPathString(localVarUrlObj), @@ -782,18 +774,18 @@ export const UserApiFp = function (configuration?: Configuration) { }, /** * - * @param {string} body + * @param {string} email * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getUserByEmail( - body: string, + email: string, options?: any ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getUserByEmail( - body, + email, options ); return createRequestFunction( @@ -805,18 +797,18 @@ export const UserApiFp = function (configuration?: Configuration) { }, /** * - * @param {string} body + * @param {string} email * @param {*} [options] Override http request option. * @throws {RequiredError} */ async isEmailUnavailable( - body: string, + email: string, options?: any ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = - await localVarAxiosParamCreator.isEmailUnavailable(body, options); + await localVarAxiosParamCreator.isEmailUnavailable(email, options); return createRequestFunction( localVarAxiosArgs, globalAxios, @@ -1028,24 +1020,24 @@ export const UserApiFactory = function ( }, /** * - * @param {string} body + * @param {string} email * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getUserByEmail(body: string, options?: any): AxiosPromise { + getUserByEmail(email: string, options?: any): AxiosPromise { return localVarFp - .getUserByEmail(body, options) + .getUserByEmail(email, options) .then((request) => request(axios, basePath)); }, /** * - * @param {string} body + * @param {string} email * @param {*} [options] Override http request option. * @throws {RequiredError} */ - isEmailUnavailable(body: string, options?: any): AxiosPromise { + isEmailUnavailable(email: string, options?: any): AxiosPromise { return localVarFp - .isEmailUnavailable(body, options) + .isEmailUnavailable(email, options) .then((request) => request(axios, basePath)); }, /** @@ -1194,7 +1186,7 @@ export interface UserApiGetUserByEmailRequest { * @type {string} * @memberof UserApiGetUserByEmail */ - readonly body: string; + readonly email: string; } /** @@ -1208,7 +1200,7 @@ export interface UserApiIsEmailUnavailableRequest { * @type {string} * @memberof UserApiIsEmailUnavailable */ - readonly body: string; + readonly email: string; } /** @@ -1380,7 +1372,7 @@ export class UserApi extends BaseAPI { options?: any ) { return UserApiFp(this.configuration) - .getUserByEmail(requestParameters.body, options) + .getUserByEmail(requestParameters.email, options) .then((request) => request(this.axios, this.basePath)); } @@ -1396,7 +1388,7 @@ export class UserApi extends BaseAPI { options?: any ) { return UserApiFp(this.configuration) - .isEmailUnavailable(requestParameters.body, options) + .isEmailUnavailable(requestParameters.email, options) .then((request) => request(this.axios, this.basePath)); } diff --git a/src/api/models/user.ts b/src/api/models/user.ts index b88fa4d43a..beac9e1573 100644 --- a/src/api/models/user.ts +++ b/src/api/models/user.ts @@ -92,6 +92,18 @@ export interface User { * @memberof User */ username: string; + /** + * + * @type {boolean} + * @memberof User + */ + analyticsOn?: boolean; + /** + * + * @type {boolean} + * @memberof User + */ + answeredConsent?: boolean; /** * * @type {string} diff --git a/src/backend/index.ts b/src/backend/index.ts index 23d86c3352..33bf1c40bc 100644 --- a/src/backend/index.ts +++ b/src/backend/index.ts @@ -499,7 +499,7 @@ export async function createSpeaker( projectId?: string ): Promise { projectId = projectId || LocalStorage.getProjectId(); - const params = { body: name, projectId }; + const params = { name, projectId }; return (await speakerApi.createSpeaker(params, defaultOptions())).data; } @@ -530,7 +530,7 @@ export async function updateSpeakerName( projectId?: string ): Promise { projectId = projectId || LocalStorage.getProjectId(); - const params = { body: name, projectId, speakerId }; + const params = { name, projectId, speakerId }; return (await speakerApi.updateSpeakerName(params, defaultOptions())).data; } @@ -655,7 +655,7 @@ export async function addUser(user: User): Promise { /** Returns true if the email address is in use already. */ export async function isEmailTaken(email: string): Promise { - return (await userApi.isEmailUnavailable({ body: email })).data; + return (await userApi.isEmailUnavailable({ email })).data; } export async function authenticateUser( @@ -683,7 +683,7 @@ export async function getUser(userId: string): Promise { } export async function getUserByEmail(email: string): Promise { - return (await userApi.getUserByEmail({ body: email }, defaultOptions())).data; + return (await userApi.getUserByEmail({ email }, defaultOptions())).data; } export async function updateUser(user: User): Promise { From 6a9cb60ef8111560f8d81a1ec42e769d33c26f68 Mon Sep 17 00:00:00 2001 From: Danny Rorabaugh Date: Fri, 17 Jan 2025 14:39:49 -0500 Subject: [PATCH 3/4] Rerun OpenAPI --- src/api/api/speaker-api.ts | 78 ++++++++++++++++++++++---------------- src/api/api/user-api.ts | 78 +++++++++++++++++++++----------------- src/api/models/user.ts | 12 ------ 3 files changed, 89 insertions(+), 79 deletions(-) diff --git a/src/api/api/speaker-api.ts b/src/api/api/speaker-api.ts index 86b20ac317..55b24269cf 100644 --- a/src/api/api/speaker-api.ts +++ b/src/api/api/speaker-api.ts @@ -49,22 +49,23 @@ export const SpeakerApiAxiosParamCreator = function ( /** * * @param {string} projectId - * @param {string} name + * @param {string} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ createSpeaker: async ( projectId: string, - name: string, + body: string, options: any = {} ): Promise => { // verify required parameter 'projectId' is not null or undefined assertParamExists("createSpeaker", "projectId", projectId); - // verify required parameter 'name' is not null or undefined - assertParamExists("createSpeaker", "name", name); - const localVarPath = `/v1/projects/{projectId}/speakers/create/{name}` - .replace(`{${"projectId"}}`, encodeURIComponent(String(projectId))) - .replace(`{${"name"}}`, encodeURIComponent(String(name))); + // verify required parameter 'body' is not null or undefined + assertParamExists("createSpeaker", "body", body); + const localVarPath = `/v1/projects/{projectId}/speakers/create`.replace( + `{${"projectId"}}`, + encodeURIComponent(String(projectId)) + ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -73,13 +74,15 @@ export const SpeakerApiAxiosParamCreator = function ( } const localVarRequestOptions = { - method: "GET", + method: "PUT", ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; + localVarHeaderParameter["Content-Type"] = "application/json"; + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; @@ -88,6 +91,11 @@ export const SpeakerApiAxiosParamCreator = function ( ...headersFromBaseOptions, ...options.headers, }; + localVarRequestOptions.data = serializeDataIfNeeded( + body, + localVarRequestOptions, + configuration + ); return { url: toPathString(localVarUrlObj), @@ -382,27 +390,26 @@ export const SpeakerApiAxiosParamCreator = function ( * * @param {string} projectId * @param {string} speakerId - * @param {string} name + * @param {string} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateSpeakerName: async ( projectId: string, speakerId: string, - name: string, + body: string, options: any = {} ): Promise => { // verify required parameter 'projectId' is not null or undefined assertParamExists("updateSpeakerName", "projectId", projectId); // verify required parameter 'speakerId' is not null or undefined assertParamExists("updateSpeakerName", "speakerId", speakerId); - // verify required parameter 'name' is not null or undefined - assertParamExists("updateSpeakerName", "name", name); + // verify required parameter 'body' is not null or undefined + assertParamExists("updateSpeakerName", "body", body); const localVarPath = - `/v1/projects/{projectId}/speakers/update/{speakerId}/{name}` + `/v1/projects/{projectId}/speakers/update/{speakerId}` .replace(`{${"projectId"}}`, encodeURIComponent(String(projectId))) - .replace(`{${"speakerId"}}`, encodeURIComponent(String(speakerId))) - .replace(`{${"name"}}`, encodeURIComponent(String(name))); + .replace(`{${"speakerId"}}`, encodeURIComponent(String(speakerId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -411,13 +418,15 @@ export const SpeakerApiAxiosParamCreator = function ( } const localVarRequestOptions = { - method: "GET", + method: "PUT", ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; + localVarHeaderParameter["Content-Type"] = "application/json"; + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; @@ -426,6 +435,11 @@ export const SpeakerApiAxiosParamCreator = function ( ...headersFromBaseOptions, ...options.headers, }; + localVarRequestOptions.data = serializeDataIfNeeded( + body, + localVarRequestOptions, + configuration + ); return { url: toPathString(localVarUrlObj), @@ -506,20 +520,20 @@ export const SpeakerApiFp = function (configuration?: Configuration) { /** * * @param {string} projectId - * @param {string} name + * @param {string} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createSpeaker( projectId: string, - name: string, + body: string, options?: any ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.createSpeaker( projectId, - name, + body, options ); return createRequestFunction( @@ -682,14 +696,14 @@ export const SpeakerApiFp = function (configuration?: Configuration) { * * @param {string} projectId * @param {string} speakerId - * @param {string} name + * @param {string} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateSpeakerName( projectId: string, speakerId: string, - name: string, + body: string, options?: any ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise @@ -698,7 +712,7 @@ export const SpeakerApiFp = function (configuration?: Configuration) { await localVarAxiosParamCreator.updateSpeakerName( projectId, speakerId, - name, + body, options ); return createRequestFunction( @@ -754,17 +768,17 @@ export const SpeakerApiFactory = function ( /** * * @param {string} projectId - * @param {string} name + * @param {string} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ createSpeaker( projectId: string, - name: string, + body: string, options?: any ): AxiosPromise { return localVarFp - .createSpeaker(projectId, name, options) + .createSpeaker(projectId, body, options) .then((request) => request(axios, basePath)); }, /** @@ -863,18 +877,18 @@ export const SpeakerApiFactory = function ( * * @param {string} projectId * @param {string} speakerId - * @param {string} name + * @param {string} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateSpeakerName( projectId: string, speakerId: string, - name: string, + body: string, options?: any ): AxiosPromise { return localVarFp - .updateSpeakerName(projectId, speakerId, name, options) + .updateSpeakerName(projectId, speakerId, body, options) .then((request) => request(axios, basePath)); }, /** @@ -916,7 +930,7 @@ export interface SpeakerApiCreateSpeakerRequest { * @type {string} * @memberof SpeakerApiCreateSpeaker */ - readonly name: string; + readonly body: string; } /** @@ -1056,7 +1070,7 @@ export interface SpeakerApiUpdateSpeakerNameRequest { * @type {string} * @memberof SpeakerApiUpdateSpeakerName */ - readonly name: string; + readonly body: string; } /** @@ -1108,7 +1122,7 @@ export class SpeakerApi extends BaseAPI { return SpeakerApiFp(this.configuration) .createSpeaker( requestParameters.projectId, - requestParameters.name, + requestParameters.body, options ) .then((request) => request(this.axios, this.basePath)); @@ -1241,7 +1255,7 @@ export class SpeakerApi extends BaseAPI { .updateSpeakerName( requestParameters.projectId, requestParameters.speakerId, - requestParameters.name, + requestParameters.body, options ) .then((request) => request(this.axios, this.basePath)); diff --git a/src/api/api/user-api.ts b/src/api/api/user-api.ts index 684e936992..43d131d57d 100644 --- a/src/api/api/user-api.ts +++ b/src/api/api/user-api.ts @@ -275,20 +275,17 @@ export const UserApiAxiosParamCreator = function ( }, /** * - * @param {string} email + * @param {string} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ getUserByEmail: async ( - email: string, + body: string, options: any = {} ): Promise => { - // verify required parameter 'email' is not null or undefined - assertParamExists("getUserByEmail", "email", email); - const localVarPath = `/v1/users/getemail/{email}`.replace( - `{${"email"}}`, - encodeURIComponent(String(email)) - ); + // verify required parameter 'body' is not null or undefined + assertParamExists("getUserByEmail", "body", body); + const localVarPath = `/v1/users/getbyemail`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -297,13 +294,15 @@ export const UserApiAxiosParamCreator = function ( } const localVarRequestOptions = { - method: "GET", + method: "PUT", ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; + localVarHeaderParameter["Content-Type"] = "application/json"; + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; @@ -312,6 +311,11 @@ export const UserApiAxiosParamCreator = function ( ...headersFromBaseOptions, ...options.headers, }; + localVarRequestOptions.data = serializeDataIfNeeded( + body, + localVarRequestOptions, + configuration + ); return { url: toPathString(localVarUrlObj), @@ -320,20 +324,17 @@ export const UserApiAxiosParamCreator = function ( }, /** * - * @param {string} email + * @param {string} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ isEmailUnavailable: async ( - email: string, + body: string, options: any = {} ): Promise => { - // verify required parameter 'email' is not null or undefined - assertParamExists("isEmailUnavailable", "email", email); - const localVarPath = `/v1/users/isemailtaken/{email}`.replace( - `{${"email"}}`, - encodeURIComponent(String(email)) - ); + // verify required parameter 'body' is not null or undefined + assertParamExists("isEmailUnavailable", "body", body); + const localVarPath = `/v1/users/isemailtaken`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -342,13 +343,15 @@ export const UserApiAxiosParamCreator = function ( } const localVarRequestOptions = { - method: "GET", + method: "PUT", ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; + localVarHeaderParameter["Content-Type"] = "application/json"; + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; @@ -357,6 +360,11 @@ export const UserApiAxiosParamCreator = function ( ...headersFromBaseOptions, ...options.headers, }; + localVarRequestOptions.data = serializeDataIfNeeded( + body, + localVarRequestOptions, + configuration + ); return { url: toPathString(localVarUrlObj), @@ -521,7 +529,7 @@ export const UserApiAxiosParamCreator = function ( assertParamExists("updateUser", "userId", userId); // verify required parameter 'user' is not null or undefined assertParamExists("updateUser", "user", user); - const localVarPath = `/v1/users/{userId}`.replace( + const localVarPath = `/v1/users/updateuser/{userId}`.replace( `{${"userId"}}`, encodeURIComponent(String(userId)) ); @@ -774,18 +782,18 @@ export const UserApiFp = function (configuration?: Configuration) { }, /** * - * @param {string} email + * @param {string} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getUserByEmail( - email: string, + body: string, options?: any ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getUserByEmail( - email, + body, options ); return createRequestFunction( @@ -797,18 +805,18 @@ export const UserApiFp = function (configuration?: Configuration) { }, /** * - * @param {string} email + * @param {string} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ async isEmailUnavailable( - email: string, + body: string, options?: any ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = - await localVarAxiosParamCreator.isEmailUnavailable(email, options); + await localVarAxiosParamCreator.isEmailUnavailable(body, options); return createRequestFunction( localVarAxiosArgs, globalAxios, @@ -1020,24 +1028,24 @@ export const UserApiFactory = function ( }, /** * - * @param {string} email + * @param {string} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getUserByEmail(email: string, options?: any): AxiosPromise { + getUserByEmail(body: string, options?: any): AxiosPromise { return localVarFp - .getUserByEmail(email, options) + .getUserByEmail(body, options) .then((request) => request(axios, basePath)); }, /** * - * @param {string} email + * @param {string} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ - isEmailUnavailable(email: string, options?: any): AxiosPromise { + isEmailUnavailable(body: string, options?: any): AxiosPromise { return localVarFp - .isEmailUnavailable(email, options) + .isEmailUnavailable(body, options) .then((request) => request(axios, basePath)); }, /** @@ -1186,7 +1194,7 @@ export interface UserApiGetUserByEmailRequest { * @type {string} * @memberof UserApiGetUserByEmail */ - readonly email: string; + readonly body: string; } /** @@ -1200,7 +1208,7 @@ export interface UserApiIsEmailUnavailableRequest { * @type {string} * @memberof UserApiIsEmailUnavailable */ - readonly email: string; + readonly body: string; } /** @@ -1372,7 +1380,7 @@ export class UserApi extends BaseAPI { options?: any ) { return UserApiFp(this.configuration) - .getUserByEmail(requestParameters.email, options) + .getUserByEmail(requestParameters.body, options) .then((request) => request(this.axios, this.basePath)); } @@ -1388,7 +1396,7 @@ export class UserApi extends BaseAPI { options?: any ) { return UserApiFp(this.configuration) - .isEmailUnavailable(requestParameters.email, options) + .isEmailUnavailable(requestParameters.body, options) .then((request) => request(this.axios, this.basePath)); } diff --git a/src/api/models/user.ts b/src/api/models/user.ts index beac9e1573..b88fa4d43a 100644 --- a/src/api/models/user.ts +++ b/src/api/models/user.ts @@ -92,18 +92,6 @@ export interface User { * @memberof User */ username: string; - /** - * - * @type {boolean} - * @memberof User - */ - analyticsOn?: boolean; - /** - * - * @type {boolean} - * @memberof User - */ - answeredConsent?: boolean; /** * * @type {string} From 1b16314a630da05129ca49ecddd437b1eb49c284 Mon Sep 17 00:00:00 2001 From: Danny Rorabaugh Date: Fri, 17 Jan 2025 14:49:49 -0500 Subject: [PATCH 4/4] Refix src/backend/index --- src/backend/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/backend/index.ts b/src/backend/index.ts index 33bf1c40bc..23d86c3352 100644 --- a/src/backend/index.ts +++ b/src/backend/index.ts @@ -499,7 +499,7 @@ export async function createSpeaker( projectId?: string ): Promise { projectId = projectId || LocalStorage.getProjectId(); - const params = { name, projectId }; + const params = { body: name, projectId }; return (await speakerApi.createSpeaker(params, defaultOptions())).data; } @@ -530,7 +530,7 @@ export async function updateSpeakerName( projectId?: string ): Promise { projectId = projectId || LocalStorage.getProjectId(); - const params = { name, projectId, speakerId }; + const params = { body: name, projectId, speakerId }; return (await speakerApi.updateSpeakerName(params, defaultOptions())).data; } @@ -655,7 +655,7 @@ export async function addUser(user: User): Promise { /** Returns true if the email address is in use already. */ export async function isEmailTaken(email: string): Promise { - return (await userApi.isEmailUnavailable({ email })).data; + return (await userApi.isEmailUnavailable({ body: email })).data; } export async function authenticateUser( @@ -683,7 +683,7 @@ export async function getUser(userId: string): Promise { } export async function getUserByEmail(email: string): Promise { - return (await userApi.getUserByEmail({ email }, defaultOptions())).data; + return (await userApi.getUserByEmail({ body: email }, defaultOptions())).data; } export async function updateUser(user: User): Promise {