diff --git a/src/models/EndpointFactory.ts b/src/models/EndpointFactory.ts index 79418b4..cf4af85 100644 --- a/src/models/EndpointFactory.ts +++ b/src/models/EndpointFactory.ts @@ -13,7 +13,7 @@ export class EndpointFactory { /** * @param {string} baseUrl - The base url that will be used to create the apps endpoint. * @returns {string} - The apps endpoint. - */ + */ public static getAppsEndpoint(baseUrl: string): string { return `${baseUrl}/Apps`; } @@ -30,7 +30,7 @@ export class EndpointFactory { /** * @param {string} baseUrl - The base url that will be used to create the apps by ids endpoint. * @returns {string} - The apps by ids endpoint. - */ + */ public static getAppsByIdsEndpoint(baseUrl: string): string { return `${baseUrl}/Apps/batch-get`; } @@ -47,40 +47,111 @@ export class EndpointFactory { /** * @param {string} baseUrl - The base url that will be used to create the fields by ids endpoint. * @returns {string} - The fields by ids endpoint. - */ + */ public static getFieldsByIdsEndpoint(baseUrl: string): string { return `${baseUrl}/Fields/batch-get`; } + /** + * @param {string} baseUrl - The base url that will be used to create the fields by app id endpoint. + * @param {number} id - The id of the app. + * @returns {string} - The fields by app id endpoint. + */ public static getFieldsByAppIdEndpoint(baseUrl: string, id: number): string { return `${baseUrl}/Fields/appId/${id}`; } - public static getFileInfoByIdEndpoint(baseUrl: string, recordId: number, fieldId: number, fileId: number): string { + /** + * @param {string} baseUrl - The base url that will be used to create the file info by id endpoint. + * @param {number} recordId - The id of the record. + * @param {number} fieldId - The id of the field. + * @param {number} fileId - The id of the file. + * @returns {string} - The file info by id endpoint. + */ + public static getFileInfoByIdEndpoint( + baseUrl: string, + recordId: number, + fieldId: number, + fileId: number + ): string { return `${baseUrl}/Files/recordId/${recordId}/fieldId/${fieldId}/fileId/${fileId}`; } - public static getDeleteFileByIdEndpoint(baseUrl: string, recordId: number, fieldId: number, fileId: number): string { + /** + * @param {string} baseUrl - The base url that will be used to create the delete file by id endpoint. + * @param {number} recordId - The id of the record. + * @param {number} fieldId - The id of the field. + * @param {number} fileId - The id of the file. + * @returns {string} - The delete file by id endpoint. + */ + public static getDeleteFileByIdEndpoint( + baseUrl: string, + recordId: number, + fieldId: number, + fileId: number + ): string { return `${baseUrl}/Files/recordId/${recordId}/fieldId/${fieldId}/fileId/${fileId}/file`; } - public static getFileByIdEndpoint(baseUrl: string, recordId: number, fieldId: number, fileId: number): string { + /** + * @param {string} baseUrl - The base url that will be used to create the get file by id endpoint. + * @param {number} recordId - The id of the record. + * @param {number} fieldId - The id of the field. + * @param {number} fileId - The id of the file. + * @returns {string} - The file by id endpoint. + */ + public static getFileByIdEndpoint( + baseUrl: string, + recordId: number, + fieldId: number, + fileId: number + ): string { return `${baseUrl}/Files/recordId/${recordId}/fieldId/${fieldId}/fileId/${fileId}/file`; } + /** + * @param {string} baseUrl - The base url that will be used to create the save file endpoint. + * @returns {string} - The save file endpoint. + */ public static getSaveFileEndpoint(baseUrl: string): string { return `${baseUrl}/Files`; } - public static getAddOrUpdateListItemEndpoint(baseUrl: string, listId: number): string { + /** + * @param {string} baseUrl - The base url that will be used to create the add or update list item endpoint. + * @param {number} listId - The id of the list. + * @returns {string} - The add or update list item endpoint. + */ + public static getAddOrUpdateListItemEndpoint( + baseUrl: string, + listId: number + ): string { return `${baseUrl}/Lists/id/${listId}/items`; } - public static getDeleteListItemEndpoint(baseUrl: string, listId: number, itemId: string): string { + /** + * @param {string} baseUrl - The base url that will be used to create the delete list item endpoint. + * @param {number} listId - The id of the list. + * @param {string} itemId - The id of the list item. + * @returns {string} - The delete list item endpoint. + */ + public static getDeleteListItemEndpoint( + baseUrl: string, + listId: number, + itemId: string + ): string { return `${baseUrl}/Lists/id/${listId}/itemId/${itemId}`; } - public static getRecordsByAppIdEndpoint(baseUrl: string, appId: number): string { + /** + * @param {string} baseUrl - The base url that will be used to create the get records by app id endpoint. + * @param {number} appId - The id of the app. + * @returns {string} - The get records by app id endpoint. + */ + public static getRecordsByAppIdEndpoint( + baseUrl: string, + appId: number + ): string { return `${baseUrl}/Records/appId/${appId}`; } } diff --git a/src/models/PagingRequest.ts b/src/models/PagingRequest.ts index 85ce1e1..a7cb8c9 100644 --- a/src/models/PagingRequest.ts +++ b/src/models/PagingRequest.ts @@ -20,8 +20,7 @@ export class PagingRequest { * @param {number} pageSize - The page size of the request. Must be greater than 0 and less than 1001. * @returns {PagingRequest} - A new instance of the PagingRequest class. * @throws {Error} - Thrown when the pageNumber is less than 1. - * @throws {Error} - Thrown when the pageSize is less than 1. - * @throws {Error} - Thrown when the pageSize is greater than 1000. + * @throws {Error} - Thrown when the pageSize is less than 1 or greater than 1000. */ constructor(pageNumber: number, pageSize: number) { if (ArgumentValidator.isValidPageNumber(pageNumber) === false) {