@liftitapp/lms-http-client
Advanced tools
Comparing version 1.1.0 to 1.1.1
import { ApiResponse } from 'apisauce'; | ||
import { ReasonType } from '../models/reasonType'; | ||
import { ApiOPtions } from '../service'; | ||
import { IGetDocumentsRejectionReasonsParams } from '../types'; | ||
export declare class ApiSecurityDocument { | ||
@@ -8,3 +10,4 @@ private options; | ||
getSecurityDocuments(authorization: string, userProspectId: number): Promise<ApiResponse<any, any>>; | ||
getDocumentsRejectionReasons(authorization: string, paramsObject: IGetDocumentsRejectionReasonsParams): Promise<ApiResponse<ReasonType[], any>>; | ||
} | ||
//# sourceMappingURL=apiSecurityDocument.d.ts.map |
@@ -10,4 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
}; | ||
import { isNonEmptyArray } from 'ramda-adjunct'; | ||
import { deserialize } from 'typescript-json-serializer'; | ||
import { SecurityCategory, ApiError } from '../models'; | ||
import { ReasonType } from '../models/reasonType'; | ||
import { Api } from '../service'; | ||
@@ -40,2 +42,20 @@ export class ApiSecurityDocument { | ||
} | ||
getDocumentsRejectionReasons(authorization, paramsObject) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
try { | ||
const response = yield this.api.getDocumentsRejectionReasons(authorization, paramsObject); | ||
if (response.ok) { | ||
const itemsList = isNonEmptyArray(response.data) ? response.data : []; | ||
response.data = itemsList.map(item => deserialize(item, ReasonType)); | ||
} | ||
else { | ||
response.data = deserialize(response.data.error, ApiError); | ||
} | ||
return response; | ||
} | ||
catch (error) { | ||
throw error; | ||
} | ||
}); | ||
} | ||
} |
@@ -15,2 +15,3 @@ export { AdditionalData } from './additionalData'; | ||
export { SecurityCategory } from './securityCategory'; | ||
export { ReasonType } from './reasonType'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -15,1 +15,2 @@ export { AdditionalData } from './additionalData'; | ||
export { SecurityCategory } from './securityCategory'; | ||
export { ReasonType } from './reasonType'; |
@@ -0,1 +1,2 @@ | ||
import { IGetDocumentsRejectionReasonsParams } from '../types'; | ||
import { ApiOPtions } from './'; | ||
@@ -7,4 +8,5 @@ export declare class Api { | ||
getSecurityDocuments: (authorization: string, userProspectId: number) => any; | ||
getDocumentsRejectionReasons: (authorization: string, paramsObject: IGetDocumentsRejectionReasonsParams) => any; | ||
private _setHeaders; | ||
} | ||
//# sourceMappingURL=api.d.ts.map |
import apisauce from 'apisauce'; | ||
import getQueryParamsString from '../utils/getQueryParamsString'; | ||
export class Api { | ||
@@ -14,2 +15,7 @@ constructor(options) { | ||
this.getSecurityDocuments = (authorization, userProspectId) => this.api.get(`/onboarding/document_list/security?user_prospect_id=${userProspectId}`, {}, this._setHeaders(authorization)); | ||
this.getDocumentsRejectionReasons = (authorization, paramsObject) => { | ||
const paramsString = getQueryParamsString(paramsObject); | ||
const url = `/onboarding/reason_types/rejection${paramsString}`; | ||
return this.api.get(url, {}, this._setHeaders(authorization)); | ||
}; | ||
this._setHeaders = (authorization) => { | ||
@@ -16,0 +22,0 @@ return { |
{ | ||
"name": "@liftitapp/lms-http-client", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Client http library for mf modules", | ||
@@ -12,6 +12,6 @@ "main": "lib/index.js", | ||
"prepare": "npm run build", | ||
"prepublishOnly" : "npm run lint", | ||
"preversion" : "npm run lint", | ||
"version" : "npm run format && git add -A src", | ||
"postversion" : "git push && git push --tags" | ||
"prepublishOnly": "npm run lint", | ||
"preversion": "npm run lint", | ||
"version": "npm run format && git add -A src", | ||
"postversion": "git push && git push --tags" | ||
}, | ||
@@ -22,6 +22,10 @@ "repository": { | ||
}, | ||
"keywords": ["lms-http-client"], | ||
"keywords": [ | ||
"lms-http-client" | ||
], | ||
"author": "Liftit", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"@types/query-string": "^5.1.0", | ||
"@types/ramda": "^0.27.32", | ||
"prettier": "^2.1.2", | ||
@@ -35,2 +39,5 @@ "tslint": "^6.1.3", | ||
"apisauce": "^2.0.0", | ||
"query-string": "^5.1.1", | ||
"ramda": "^0.27.1", | ||
"ramda-adjunct": "^2.28.0", | ||
"typescript-json-serializer": "^2.5.0" | ||
@@ -37,0 +44,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
62065
89
1110
6
6
+ Addedquery-string@^5.1.1
+ Addedramda@^0.27.1
+ Addedramda-adjunct@^2.28.0
+ Addeddecode-uri-component@0.2.2(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedquery-string@5.1.1(transitive)
+ Addedramda@0.27.2(transitive)
+ Addedramda-adjunct@2.36.0(transitive)
+ Addedstrict-uri-encode@1.1.0(transitive)