Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 30x 30x 30x 2x 30x 1x | import { CountSchema } from '@loopback/repository'; import { getModelSchemaRef, SchemaRef } from '@loopback/rest'; import { Accounts, Leads, Payments, Roles, UserDetails } from '../../models'; export const string = { type: 'string' } export const number = { type: 'number' } export const boolean = { type: 'boolean' } export const array = { type: [] } export const any = { type: "any" } export const baseResponse = { responses: { 'Success Response': { description: `status: "Success",code: 200,response: "data"` }, 'Failure Response': { description: `status: "Failure",code:202,400,403,402,422,500,response: "message"` }, } } export const baseRequest: Function = (payload: object) => { const { properties = {}, required = [], title = "", modelName = Function, exclude = [], contentType = 'application/json', description = undefined, loadSchema = false } = { ...payload } let schema: SchemaRef | object = { title, properties, required } if (loadSchema) { schema = getModelSchemaRef(modelName, { exclude, title }) } return { description, required: true, properties, content: { [contentType]: { schema }, }, }; } // generic Request export const countReq = baseRequest({ loadSchema: true, modelName: CountSchema, title: 'Count' }) |