Skip to content

Commit

Permalink
fix(http) remove redundant JSDocs because Angular ngc compiler throws…
Browse files Browse the repository at this point in the history
… an error due to these redundant comments [#96]
  • Loading branch information
christophercr committed Mar 16, 2018
1 parent 1c4268e commit 1e8a6cf
Show file tree
Hide file tree
Showing 19 changed files with 104 additions and 111 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,36 @@ import {StarkLanguage} from "../language";
export interface StarkApplicationMetadata {
/**
* Application name
* @type string
*/
name: string;

/**
* Description
* @type string
*/
description: string;

/**
* Application version
* @type string
*/
version: string;

/**
* Target environment of the current build: Production, Development, ...
* @type string
*/
environment: string;

/**
* Timestamp when the current build was generated
* @type string
*/
buildTimestamp: string;

/**
* Timestamp when the current build was deployed
* @type string
*/
deploymentTimestamp: string;

/**
* Array of languages to be supported in the application
* @type Array<StarkLanguage>
*/
supportedLanguages: StarkLanguage[];
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,9 @@ export class StarkApplicationMetadataImpl implements StarkApplicationMetadata {

/**
* Callback method provided by cerialize in order to post-process the de-serialized json object
* @param instance {StarkApplicationMetadataImpl} instantiated object with its properties already
* @param instance - Instantiated object with its properties already
* set as defined via the serializer annotations
* @param json {Object} raw json object loaded from file
* @constructor
* @param json - Raw json object loaded from file
*/
public static OnDeserialized(instance: StarkApplicationMetadataImpl, json: any): void {
const supportedLanguages: string[] = json["supportedLanguages"];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,60 +6,60 @@ export interface StarkHttpBaseRequestBuilder<T extends StarkResource> {

/**
* Adds a header to the request
* @param name {string} Header name
* @param value {string} Header value
* @returns {this} The current builder
* @param name - Header name
* @param value - Header value
* @returns The current builder
*/
setHeader(name: string, value: string): this;

/**
* Adds a query parameter to the request (if the parameter already exists it will be overwritten)
* @param name {string} Query parameter name
* @param value {string|string[]|undefined} Query parameter value
* @param allowUndefined {boolean} Whether to include the query parameter even if it has an undefined value. Default: false.
* @param allowEmpty {boolean} Whether to include the query parameter even if it is an empty string. Default: false.
* @returns {this} The current builder
* @param name - Query parameter name
* @param value - Query parameter value
* @param allowUndefined - (Optional) Whether to include the query parameter even if it has an undefined value. Default: false.
* @param allowEmpty - (Optional) Whether to include the query parameter even if it is an empty string. Default: false.
* @returns The current builder
*/
addQueryParameter(name: string, value: string | string[] | undefined,
allowUndefined?: boolean, allowEmpty?: boolean): this;

/**
* Adds query parameters to the request (adds them to the existing query parameters)
* @param params {object} Object with the query parameters to be added to the request
* @param allowUndefined {boolean} Whether to include the query parameters even if they have undefined values. Default: false.
* @param allowEmpty {boolean} Whether to include the query parameter even if it is an empty string. Default: false.
* @returns {this} The current builder
* @param params - Object with the query parameters to be added to the request
* @param allowUndefined - (Optional) Whether to include the query parameters even if they have undefined values. Default: false.
* @param allowEmpty - (Optional) Whether to include the query parameter even if it is an empty string. Default: false.
* @returns The current builder
*/
addQueryParameters(params: { [param: string]: string | string[] | undefined },
allowUndefined?: boolean, allowEmpty?: boolean): this;

/**
* Sets query parameters to the request (all existing query parameters will be lost)
* @param params {object} Object with the query parameters to be added to the request
* @param allowUndefined {boolean} Whether to include the query parameters even if they have undefined values. Default: false.
* @param allowEmpty {boolean} Whether to include the query parameter even if it is an empty string. Default: false.
* @returns {this} The current builder
* @param params - Object with the query parameters to be added to the request
* @param allowUndefined - (Optional) Whether to include the query parameters even if they have undefined values. Default: false.
* @param allowEmpty - (Optional) Whether to include the query parameter even if it is an empty string. Default: false.
* @returns The current builder
*/
setQueryParameters(params: { [param: string]: string | string[] | undefined },
allowUndefined?: boolean, allowEmpty?: boolean): this;

/**
* Interpolates the parameters in the resource path with actual values
* @param params {object} Object with the values to interpolate in the resource path
* @returns {this} The current builder
* @param params - Object with the values to interpolate in the resource path
* @returns The current builder
*/
setPathParameters(params: { [param: string]: string }): this;

/**
* Sets the number of times the request should be retried in case of error before emitting the failure
* @param retryCount {number} Maximum number of attempts
* @returns {this} The current builder
* @param retryCount - Maximum number of attempts
* @returns The current builder
*/
retry(retryCount: number): this;

/**
* Returns an instance of the constructed StarkHttpRequest. It should be always the last method to be called.
* @returns {StarkHttpRequest} The constructed request
* @returns The constructed request
*/
build(): StarkHttpRequest<T>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,29 @@ import {StarkSortItem} from "../entities";
export interface StarkHttpFetchResourceRequestBuilder {
/**
* Adds language codes to the "Accept-Language" header
* @param languages {Array<StarkLanguage>} Language(s) in which the response should be returned
* @returns {this} The current builder
* @param languages - Language(s) in which the response should be returned
* @returns The current builder
*/
addAcceptedLanguage(...languages: StarkLanguage[]): this;

/**
* Adds the fields that should be included in the response
* @param fields {Array<string>} Name of the fields to be included
* @returns {this} The current builder
* @param fields - Name of the fields to be included
* @returns The current builder
*/
addFilterByInclude(...fields: string[]): this;

/**
* Adds the "style" (a label put on a set of fields) that should be included in the response
* @param style {string} Name of the style to be included
* @returns {this} The current builder
* @param style - Name of the style to be included
* @returns The current builder
*/
addFilterByStyle(style: string): this;

/**
* Adds a "sort" query parameter to the request
* @param sortItems {Array<StarkSortItem>} Sort parameters to define the order in which the items will be returned
* @returns {this} The current builder
* @param sortItems - Sort parameters to define the order in which the items will be returned
* @returns The current builder
*/
addSortBy(...sortItems: StarkSortItem[]): this;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {StarkResource} from "../entities/resource.entity.intf";
export interface StarkHttpCreateRequestBuilder<T extends StarkResource> extends StarkHttpBaseRequestBuilder<T> {
/**
* Adds an "echo" query parameter to the request
* @param echo {StarkHttpEchoType} Echo parameter to specify whether the response should contain a response body
* @returns {StarkHttpCreateRequestBuilder} The current builder
* @param echo - Echo parameter to specify whether the response should contain a response body
* @returns The current builder
*/
echo(echo: StarkHttpEchoType): this;
}
42 changes: 21 additions & 21 deletions packages/stark-core/src/http/builder/http-request-builder.intf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,42 +23,42 @@ import {StarkResource} from "../entities/resource.entity.intf";
export interface StarkHttpRequestBuilder<T extends StarkResource> {
/**
* Gets an instance of a suitable builder to perform a Create request
* @param item {object} Item to be sent in the Create request
* @param params {StarkHttpCreateRequestParams}
* @returns {StarkHttpCreateRequestBuilder}
* @param item - Item to be sent in the Create request
* @param params - Object containing additional parameters to construct the request to be sent
* @returns StarkHttpCreateRequestBuilder instance
*/
create(item: T, params?: StarkHttpCreateRequestParams): StarkHttpCreateRequestBuilder<T>;

/**
* Gets an instance of a suitable builder to perform an Update request
* @param item {object} Item to be sent in the Update request
* @param params {StarkHttpUpdateRequestParams}
* @returns {StarkHttpUpdateRequestBuilder}
* @param item - Item to be sent in the Update request
* @param params - Object containing additional parameters to construct the request to be sent
* @returns StarkHttpUpdateRequestBuilder instance
*/
update(item: T, params?: StarkHttpUpdateRequestParams): StarkHttpUpdateRequestBuilder<T>;

/**
* Gets an instance of a suitable builder to perform a Delete request
* @param item {object} Item to be sent in the Delete request
* @param params {StarkHttpDeleteRequestParams}
* @returns {StarkHttpDeleteRequestBuilder}
* @param item - Item to be sent in the Delete request
* @param params - Object containing additional parameters to construct the request to be sent
* @returns StarkHttpDeleteRequestBuilder instance
*/
delete(item: T, params?: StarkHttpDeleteRequestParams): StarkHttpDeleteRequestBuilder<T>;

/**
* Gets an instance of a suitable builder to perform a Get request
* @param uuid {string} UUID of the item to be fetched by the Get request
* @param params {StarkHttpGetRequestParams}
* @returns {StarkHttpGetRequestBuilder}
* @param uuid - UUID of the item to be fetched by the Get request
* @param params - Object containing additional parameters to construct the request to be sent
* @returns StarkHttpGetRequestBuilder instance
*/
get(uuid: string, params?: StarkHttpGetRequestParams): StarkHttpGetRequestBuilder<T>;

/**
* Gets an instance of a suitable builder to perform a GetCollection request
* @param limit {number} Maximum number of items to return
* @param offset {number} Index at which to begin the extraction of the collection to be returned
* @param params {StarkHttpGetCollectionRequestParams}
* @returns {StarkHttpGetCollectionRequestBuilder}
* @param limit - Maximum number of items to return
* @param offset - Index at which to begin the extraction of the collection to be returned
* @param params - Object containing additional parameters to construct the request to be sent
* @returns StarkHttpGetCollectionRequestBuilder instance
*/
getCollection(limit: number,
offset: number,
Expand All @@ -67,11 +67,11 @@ export interface StarkHttpRequestBuilder<T extends StarkResource> {
/**
* Gets an instance of a suitable builder to perform a Search request. Similar to a GetCollection request but the search
* parameters are sent in the request body payload whereas in the GetCollection request they are sent as URL query parameters
* @param criteria {object} Object containing the search criteria to be sent in the request body payload
* @param limit {number} Maximum number of items to return
* @param offset {number} Index at which to begin the extraction of the collection to be returned
* @param params {StarkHttpSearchRequestParams}
* @returns {StarkHttpSearchRequestBuilder}
* @param criteria - Object containing the search criteria to be sent in the request body payload
* @param limit - Maximum number of items to return
* @param offset - Index at which to begin the extraction of the collection to be returned
* @param params - Object containing additional parameters to construct the request to be sent
* @returns StarkHttpSearchRequestBuilder instance
*/
search(criteria: { [param: string]: string } | object,
limit: number,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,31 @@ import {StarkSerializable} from "../../serialization";
export interface StarkHttpRequestParams {
/**
* Whether to allow query parameters with undefined value or not. Default: false.
* @type {boolean}
*/
allowUndefinedQueryParams?: boolean;

/**
* Whether to allow query parameters with empty value ('') or not. Default: false.
* @type {boolean}
*/
allowEmptyQueryParams?: boolean;

/**
* Path parameters to be added in the url when working with nested resources
* @type {object}
*/
pathParameters?: { [param: string]: string };

/**
* Query parameters to be added to the request
* @type {Map}
*/
queryParameters?: { [param: string]: string | string[] | undefined };

/**
* Maximum number of times the request should be retried in case of error before emitting the failure. Default: 0
* @type {number}
*/
retryCount?: number;

/**
* Custom type to be used to serialize/deserialize the resource instead of the default serialization type for the request
* @type {object}
*/
serializationType?: StarkSerializable;
}
Expand All @@ -49,7 +43,6 @@ export interface StarkHttpGetRequestParams extends StarkHttpRequestParams {
export interface StarkHttpUpdateRequestParams extends StarkHttpRequestParams {
/**
* When true, the request-type uses HTTP PUT else it uses HTTP POST. Default: false
* @type boolean
*/
isIdempotent?: boolean;
}
Expand All @@ -59,7 +52,6 @@ export interface StarkHttpDeleteRequestParams extends StarkHttpRequestParams {
* Whether the delete should be enforced or not. Default: false
* When set to true, the ETag value is not passed.
* Only set this to true if it makes sense for the use case and if your back-end allows it!
* @type boolean
*/
force?: boolean;
}
Expand All @@ -70,7 +62,6 @@ export interface StarkHttpGetCollectionRequestParams extends StarkHttpRequestPar
export interface StarkHttpSearchRequestParams extends StarkHttpRequestParams {
/**
* Whether to allow criteria with empty value ('') or not. Default: false.
* @type {boolean}
*/
allowEmptyCriteria?: boolean;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ import {StarkHttpStatusCodes} from "../../enumerators";

export class StarkHttpErrorWrapperImpl implements StarkHttpErrorWrapper {

/** @internal */
private _starkHttpStatusCode: StarkHttpStatusCodes;
// TODO: return the Angular HttpHeaders or still return our own Map?
/** @internal */
private _starkHttpHeaders: Map<string, string>;
/** @internal */
private _httpError: StarkHttpError;

public constructor(starkHttpStatusCode: StarkHttpStatusCodes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ import {StarkCollectionMetadata} from "../metadata";
import {StarkHttpStatusCodes} from "../../enumerators";

export class StarkCollectionResponseWrapperImpl<T extends StarkResource> implements StarkCollectionResponseWrapper<T> {
/** @internal */
private _starkHttpStatusCode: StarkHttpStatusCodes;
// TODO: return the Angular HttpHeaders or still return our own Map?
/** @internal */
private _starkHttpHeaders: Map<string, string>;
/** @internal */
private _data: T[];
/** @internal */
private _metadata: StarkCollectionMetadata;

public constructor(starkHttpStatusCode: StarkHttpStatusCodes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ import {StarkResource} from "../resource.entity.intf";
import {StarkHttpStatusCodes} from "../../enumerators";

export class StarkSingleItemResponseWrapperImpl<T extends StarkResource> implements StarkSingleItemResponseWrapper<T> {
/** @internal */
private _starkHttpStatusCode: StarkHttpStatusCodes;
// TODO: return the Angular HttpHeaders or still return our own Map?
/** @internal */
private _starkHttpHeaders: Map<string, string>;
/** @internal */
private _data: T;

public constructor(starkHttpStatusCode: StarkHttpStatusCodes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export class StarkHttpDiscriminatorSerializer<T extends StarkResource> extends S

/**
*
* @param {string} discriminatorProperty The discriminator property
* @param {Map} typesMap Map of types based on the discriminator property value
* @param discriminatorProperty - The discriminator property
* @param typesMap - Map of types based on the discriminator property value
*/
public constructor(discriminatorProperty: string,
typesMap: Map<any, StarkSerializable>) {
Expand Down
Loading

0 comments on commit 1e8a6cf

Please sign in to comment.