fix: corrected JSDoc comments
This commit is contained in:
@@ -1,15 +1,58 @@
|
|||||||
import { FieldStatus } from '../enums/FieldStatus';
|
import { FieldStatus } from '../enums/FieldStatus';
|
||||||
import { FieldType } from '../enums/FieldType';
|
import { FieldType } from '../enums/FieldType';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @class Field - Represents a Field.
|
||||||
|
*/
|
||||||
export class Field {
|
export class Field {
|
||||||
|
/**
|
||||||
|
* @property {number} id - The id of the Field.
|
||||||
|
*/
|
||||||
public id: number;
|
public id: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property {number} appId - The id of the App that the Field belongs to.
|
||||||
|
*/
|
||||||
public appId: number;
|
public appId: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property {number} name - The name of the Field.
|
||||||
|
*/
|
||||||
public name: string;
|
public name: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property {FieldType} type - The type of the Field.
|
||||||
|
*/
|
||||||
public type: FieldType;
|
public type: FieldType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property {FieldStatus} status - The status of the Field.
|
||||||
|
*/
|
||||||
public status: FieldStatus;
|
public status: FieldStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property {boolean} isRequired - Indicates whether or not the Field is required.
|
||||||
|
*/
|
||||||
public isRequired: boolean;
|
public isRequired: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property {boolean} isUnique - Indicates whether or not the Field is required to be unique.
|
||||||
|
*/
|
||||||
public isUnique: boolean;
|
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(
|
public constructor(
|
||||||
id: number,
|
id: number,
|
||||||
appId: number,
|
appId: number,
|
||||||
|
|||||||
@@ -58,8 +58,8 @@ export class OnspringClient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @method getApps - Gets a paged list of apps.
|
* @method getApps - Gets a paged list of apps.
|
||||||
* @param pagingRequest - The paging request that will be used to get the apps.
|
* @param {PagingRequest} pagingRequest - The paging request that will be used to get the apps.
|
||||||
* @returns - A promise that resolves to an ApiResponse of type GetPagedAppsResponse.
|
* @returns {Promise<ApiResponse<GetPagedAppsResponse>>} - A promise that resolves to an ApiResponse of type GetPagedAppsResponse.
|
||||||
*/
|
*/
|
||||||
public async getApps(
|
public async getApps(
|
||||||
pagingRequest: PagingRequest = new PagingRequest(1, 50)
|
pagingRequest: PagingRequest = new PagingRequest(1, 50)
|
||||||
@@ -77,8 +77,8 @@ export class OnspringClient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @method getAppById - Gets an app by its id.
|
* @method getAppById - Gets an app by its id.
|
||||||
* @param appId - The id of the app to get.
|
* @param {number} appId - The id of the app to get.
|
||||||
* @returns - A promise that resolves to an ApiResponse of type App.
|
* @returns {Promise<ApiResponse<App>>} - A promise that resolves to an ApiResponse of type App.
|
||||||
*/
|
*/
|
||||||
public async getAppById(appId: number): Promise<ApiResponse<App>> {
|
public async getAppById(appId: number): Promise<ApiResponse<App>> {
|
||||||
const endpoint = EndpointFactory.getAppByIdEndpoint(appId);
|
const endpoint = EndpointFactory.getAppByIdEndpoint(appId);
|
||||||
@@ -94,14 +94,14 @@ export class OnspringClient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @method getAppsByIds - Gets a list of apps by their ids.
|
* @method getAppsByIds - Gets a list of apps by their ids.
|
||||||
* @param getAppsByIds - The ids of the apps to get.
|
* @param {number[]} appIds - The ids of the apps to get.
|
||||||
* @returns - A promise that resolves to an ApiResponse of type CollectionResponse<App>.
|
* @returns {Promise<ApiResponse<CollectionResponse<App>>>} - A promise that resolves to an ApiResponse of type CollectionResponse<App>.
|
||||||
*/
|
*/
|
||||||
public async getAppsByIds(
|
public async getAppsByIds(
|
||||||
getAppsByIds: number[]
|
appIds: number[]
|
||||||
): Promise<ApiResponse<CollectionResponse<App>>> {
|
): Promise<ApiResponse<CollectionResponse<App>>> {
|
||||||
const endpoint = EndpointFactory.getAppsByIdsEndpoint();
|
const endpoint = EndpointFactory.getAppsByIdsEndpoint();
|
||||||
const apiResponse = await this.post<any>(endpoint, getAppsByIds);
|
const apiResponse = await this.post<any>(endpoint, appIds);
|
||||||
|
|
||||||
if (apiResponse.isSuccessful === false) {
|
if (apiResponse.isSuccessful === false) {
|
||||||
return apiResponse;
|
return apiResponse;
|
||||||
@@ -110,6 +110,11 @@ export class OnspringClient {
|
|||||||
return apiResponse.AsAppCollectionType();
|
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>> {
|
public async getFieldById(fieldId: number): Promise<ApiResponse<Field>> {
|
||||||
const endpoint = EndpointFactory.getFieldByIdEndpoint(fieldId);
|
const endpoint = EndpointFactory.getFieldByIdEndpoint(fieldId);
|
||||||
const apiResponse = await this.get<any>(endpoint);
|
const apiResponse = await this.get<any>(endpoint);
|
||||||
@@ -137,11 +142,11 @@ export class OnspringClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* @method post - Makes a POST request to the specified endpoint.
|
||||||
* @param endpoint - The endpoint that will be used to make the request.
|
* @param {string} endpoint - The endpoint that will be used to make the request.
|
||||||
* @param data - The data that will be sent with the request.
|
* @param {any} data - The data that will be sent with the request.
|
||||||
* @param config - The configuration that will be used to make the request.
|
* @param {AxiosRequestConfig} config - The configuration that will be used to make the request.
|
||||||
* @returns - A promise that resolves to an ApiResponse of type T.
|
* @returns {Promise<ApiResponse<T>>} - A promise that resolves to an ApiResponse of type T.
|
||||||
*/
|
*/
|
||||||
private async post<T>(
|
private async post<T>(
|
||||||
endpoint: string,
|
endpoint: string,
|
||||||
|
|||||||
Reference in New Issue
Block a user