From 5e68896eea223aa137ae46314c5afb1c08f64ec9 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 13 Mar 2024 18:34:27 -0400 Subject: [PATCH] style: prettier --- src/account.ts | 14 +- src/account/swagger.yaml | 444 +++++++++++++++++++-------------------- src/sdk.ts | 2 +- 3 files changed, 229 insertions(+), 231 deletions(-) diff --git a/src/account.ts b/src/account.ts index 639eb50..7c02ab7 100644 --- a/src/account.ts +++ b/src/account.ts @@ -26,11 +26,9 @@ import { import { AxiosResponse } from "axios"; export class AccountApi { - private apiUrl: string; private _jwtToken?: string; - constructor(apiUrl: string) { let apiUrlParsed = new URL(apiUrl); @@ -38,12 +36,12 @@ export class AccountApi { this.apiUrl = apiUrlParsed.toString(); } - set jwtToken(value: string) { - this._jwtToken = value; - } - get jwtToken(): string { - return this._jwtToken; - } + set jwtToken(value: string) { + this._jwtToken = value; + } + get jwtToken(): string { + return this._jwtToken; + } public static create(apiUrl: string): AccountApi { return new AccountApi(apiUrl); diff --git a/src/account/swagger.yaml b/src/account/swagger.yaml index edd47ca..94dc919 100644 --- a/src/account/swagger.yaml +++ b/src/account/swagger.yaml @@ -1,227 +1,227 @@ openapi: 3.0.0 info: - title: Account Management API - version: "1.0" - description: API for managing user accounts, including login, registration, OTP operations, and password resets. + title: Account Management API + version: "1.0" + description: API for managing user accounts, including login, registration, OTP operations, and password resets. paths: - /api/auth/login: - post: - summary: Login to the system - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/LoginRequest' - responses: - '200': - description: Successfully logged in - content: - application/json: - schema: - $ref: '#/components/schemas/LoginResponse' - '401': - description: Unauthorized - /api/auth/register: - post: - summary: Register a new account - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterRequest' - responses: - '200': - description: Successfully registered - '400': - description: Bad Request - /api/auth/verify-email: - post: - summary: Verify email address - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/VerifyEmailRequest' - responses: - '200': - description: Email verified successfully - /api/auth/otp/generate: - get: - summary: Generate OTP for two-factor authentication - responses: - '200': - description: OTP generated successfully - content: - application/json: - schema: - $ref: '#/components/schemas/OTPGenerateResponse' - /api/auth/otp/verify: - post: - summary: Verify OTP for enabling two-factor authentication - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OTPVerifyRequest' - responses: - '200': - description: OTP verified successfully - /api/auth/otp/validate: - post: - summary: Validate OTP for two-factor authentication login - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OTPValidateRequest' - responses: - '200': - description: OTP validated successfully - /api/auth/otp/disable: - post: - summary: Disable OTP for two-factor authentication - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OTPDisableRequest' - responses: - '200': - description: OTP disabled successfully - /api/auth/password-reset/request: - post: - summary: Request a password reset - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/PasswordResetRequest' - responses: - '200': - description: Password reset requested successfully - /api/auth/password-reset/confirm: - post: - summary: Confirm a password reset - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/PasswordResetVerifyRequest' - responses: - '200': - description: Password reset successfully - /api/auth/ping: - post: - summary: Auth check endpoint - responses: - '200': - description: Pong - content: - application/json: - schema: - $ref: '#/components/schemas/PingResponse' - '401': - description: Unauthorized + /api/auth/login: + post: + summary: Login to the system + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/LoginRequest" + responses: + "200": + description: Successfully logged in + content: + application/json: + schema: + $ref: "#/components/schemas/LoginResponse" + "401": + description: Unauthorized + /api/auth/register: + post: + summary: Register a new account + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/RegisterRequest" + responses: + "200": + description: Successfully registered + "400": + description: Bad Request + /api/auth/verify-email: + post: + summary: Verify email address + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/VerifyEmailRequest" + responses: + "200": + description: Email verified successfully + /api/auth/otp/generate: + get: + summary: Generate OTP for two-factor authentication + responses: + "200": + description: OTP generated successfully + content: + application/json: + schema: + $ref: "#/components/schemas/OTPGenerateResponse" + /api/auth/otp/verify: + post: + summary: Verify OTP for enabling two-factor authentication + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/OTPVerifyRequest" + responses: + "200": + description: OTP verified successfully + /api/auth/otp/validate: + post: + summary: Validate OTP for two-factor authentication login + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/OTPValidateRequest" + responses: + "200": + description: OTP validated successfully + /api/auth/otp/disable: + post: + summary: Disable OTP for two-factor authentication + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/OTPDisableRequest" + responses: + "200": + description: OTP disabled successfully + /api/auth/password-reset/request: + post: + summary: Request a password reset + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PasswordResetRequest" + responses: + "200": + description: Password reset requested successfully + /api/auth/password-reset/confirm: + post: + summary: Confirm a password reset + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PasswordResetVerifyRequest" + responses: + "200": + description: Password reset successfully + /api/auth/ping: + post: + summary: Auth check endpoint + responses: + "200": + description: Pong + content: + application/json: + schema: + $ref: "#/components/schemas/PingResponse" + "401": + description: Unauthorized components: - schemas: - LoginRequest: - type: object - required: - - email - - password - properties: - email: - type: string - password: - type: string - LoginResponse: - type: object - properties: - token: - type: string - RegisterRequest: - type: object - required: - - first_name - - last_name - - email - - password - properties: - first_name: - type: string - last_name: - type: string - email: - type: string - password: - type: string - VerifyEmailRequest: - type: object - required: - - email - - token - properties: - email: - type: string - token: - type: string - OTPGenerateResponse: - type: object - properties: - OTP: - type: string - OTPVerifyRequest: - type: object - required: - - OTP - properties: - OTP: - type: string - OTPValidateRequest: - type: object - required: - - OTP - properties: - OTP: - type: string - OTPDisableRequest: - type: object - required: - - password - properties: - password: - type: string - PasswordResetRequest: - type: object - required: - - email - properties: - email: - type: string - PasswordResetVerifyRequest: - type: object - required: - - email - - token - - password - properties: - email: - type: string - token: - type: string - password: - type: string - PingResponse: - type: object - properties: - ping: - type: string + schemas: + LoginRequest: + type: object + required: + - email + - password + properties: + email: + type: string + password: + type: string + LoginResponse: + type: object + properties: + token: + type: string + RegisterRequest: + type: object + required: + - first_name + - last_name + - email + - password + properties: + first_name: + type: string + last_name: + type: string + email: + type: string + password: + type: string + VerifyEmailRequest: + type: object + required: + - email + - token + properties: + email: + type: string + token: + type: string + OTPGenerateResponse: + type: object + properties: + OTP: + type: string + OTPVerifyRequest: + type: object + required: + - OTP + properties: + OTP: + type: string + OTPValidateRequest: + type: object + required: + - OTP + properties: + OTP: + type: string + OTPDisableRequest: + type: object + required: + - password + properties: + password: + type: string + PasswordResetRequest: + type: object + required: + - email + properties: + email: + type: string + PasswordResetVerifyRequest: + type: object + required: + - email + - token + - password + properties: + email: + type: string + token: + type: string + password: + type: string + PingResponse: + type: object + properties: + ping: + type: string diff --git a/src/sdk.ts b/src/sdk.ts index 1f69bc1..7888c43 100644 --- a/src/sdk.ts +++ b/src/sdk.ts @@ -1,4 +1,4 @@ -import {AccountApi} from "./account.js"; +import { AccountApi } from "./account.js"; export class Sdk { private apiUrl: string;