fix: corrected JSDoc comments

This commit is contained in:
StevanFreeborn
2023-02-02 22:52:14 -06:00
parent a1d3683603
commit 923cb27c33
2 changed files with 61 additions and 13 deletions
+43
View File
@@ -1,15 +1,58 @@
import { FieldStatus } from '../enums/FieldStatus';
import { FieldType } from '../enums/FieldType';
/**
* @class Field - Represents a Field.
*/
export class Field {
/**
* @property {number} id - The id of the Field.
*/
public id: number;
/**
* @property {number} appId - The id of the App that the Field belongs to.
*/
public appId: number;
/**
* @property {number} name - The name of the Field.
*/
public name: string;
/**
* @property {FieldType} type - The type of the Field.
*/
public type: FieldType;
/**
* @property {FieldStatus} status - The status of the Field.
*/
public status: FieldStatus;
/**
* @property {boolean} isRequired - Indicates whether or not the Field is required.
*/
public isRequired: boolean;
/**
* @property {boolean} isUnique - Indicates whether or not the Field is required to be unique.
*/
public isUnique: boolean;
/**
* @constructor - Creates a new Field.
* @param {number} id - The id of the Field.
* @param {number} appId - The id of the App that the Field belongs to.
* @param {string} name - The name of the Field.
* @param {string} type - The type of the Field.
* @param {string} status - The status of the Field.
* @param {boolean} isRequired - Indicates whether or not the Field is required.
* @param {boolean} isUnique - Indicates whether or not the Field is required to be unique.
* @returns {Field} - A new Field.
* @throws {Error} - Throws an error if the type is not valid.
* @throws {Error} - Throws an error if the status is not valid.
*/
public constructor(
id: number,
appId: number,
+18 -13
View File
@@ -58,8 +58,8 @@ export class OnspringClient {
/**
* @method getApps - Gets a paged list of apps.
* @param pagingRequest - The paging request that will be used to get the apps.
* @returns - A promise that resolves to an ApiResponse of type GetPagedAppsResponse.
* @param {PagingRequest} pagingRequest - The paging request that will be used to get the apps.
* @returns {Promise<ApiResponse<GetPagedAppsResponse>>} - A promise that resolves to an ApiResponse of type GetPagedAppsResponse.
*/
public async getApps(
pagingRequest: PagingRequest = new PagingRequest(1, 50)
@@ -77,8 +77,8 @@ export class OnspringClient {
/**
* @method getAppById - Gets an app by its id.
* @param appId - The id of the app to get.
* @returns - A promise that resolves to an ApiResponse of type App.
* @param {number} appId - The id of the app to get.
* @returns {Promise<ApiResponse<App>>} - A promise that resolves to an ApiResponse of type App.
*/
public async getAppById(appId: number): Promise<ApiResponse<App>> {
const endpoint = EndpointFactory.getAppByIdEndpoint(appId);
@@ -94,14 +94,14 @@ export class OnspringClient {
/**
* @method getAppsByIds - Gets a list of apps by their ids.
* @param getAppsByIds - The ids of the apps to get.
* @returns - A promise that resolves to an ApiResponse of type CollectionResponse<App>.
* @param {number[]} appIds - The ids of the apps to get.
* @returns {Promise<ApiResponse<CollectionResponse<App>>>} - A promise that resolves to an ApiResponse of type CollectionResponse<App>.
*/
public async getAppsByIds(
getAppsByIds: number[]
appIds: number[]
): Promise<ApiResponse<CollectionResponse<App>>> {
const endpoint = EndpointFactory.getAppsByIdsEndpoint();
const apiResponse = await this.post<any>(endpoint, getAppsByIds);
const apiResponse = await this.post<any>(endpoint, appIds);
if (apiResponse.isSuccessful === false) {
return apiResponse;
@@ -110,6 +110,11 @@ export class OnspringClient {
return apiResponse.AsAppCollectionType();
}
/**
* @method getFields - Gets a paged list of fields.
* @param {PagingRequest} pagingRequest - The paging request that will be used to get the fields.
* @returns {Promise<ApiResponse<Field>>} - A promise that resolves to an ApiResponse of type Field.
*/
public async getFieldById(fieldId: number): Promise<ApiResponse<Field>> {
const endpoint = EndpointFactory.getFieldByIdEndpoint(fieldId);
const apiResponse = await this.get<any>(endpoint);
@@ -137,11 +142,11 @@ export class OnspringClient {
}
/**
*
* @param endpoint - The endpoint that will be used to make the request.
* @param data - The data that will be sent with the request.
* @param config - The configuration that will be used to make the request.
* @returns - A promise that resolves to an ApiResponse of type T.
* @method post - Makes a POST request to the specified endpoint.
* @param {string} endpoint - The endpoint that will be used to make the request.
* @param {any} data - The data that will be sent with the request.
* @param {AxiosRequestConfig} config - The configuration that will be used to make the request.
* @returns {Promise<ApiResponse<T>>} - A promise that resolves to an ApiResponse of type T.
*/
private async post<T>(
endpoint: string,