@loopback/docs
Version:
Documentation for LoopBack 4
773 lines (772 loc) • 24.6 kB
JSON
{
"metadata": {
"toolPackage": "@microsoft/api-extractor",
"toolVersion": "7.6.2",
"schemaVersion": 1003,
"oldestForwardsCompatibleVersion": 1001
},
"kind": "Package",
"canonicalReference": "@loopback/rest-crud!",
"docComment": "",
"name": "@loopback/rest-crud",
"members": [
{
"kind": "EntryPoint",
"canonicalReference": "@loopback/rest-crud!",
"name": "",
"members": [
{
"kind": "Interface",
"canonicalReference": "@loopback/rest-crud!CrudRestController:interface",
"docComment": "/**\n * This interface describes prototype members of the controller class returned by `defineCrudRestController`.\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export interface CrudRestController<T extends "
},
{
"kind": "Reference",
"text": "Entity",
"canonicalReference": "@loopback/repository!Entity:class"
},
{
"kind": "Content",
"text": ", IdType, IdName extends "
},
{
"kind": "Content",
"text": "keyof T"
},
{
"kind": "Content",
"text": ", Relations extends "
},
{
"kind": "Content",
"text": "object "
},
{
"kind": "Content",
"text": "= "
},
{
"kind": "Content",
"text": "{}"
},
{
"kind": "Content",
"text": "> "
}
],
"releaseTag": "Public",
"typeParameters": [
{
"typeParameterName": "T",
"constraintTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
},
{
"typeParameterName": "IdType",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
},
{
"typeParameterName": "IdName",
"constraintTokenRange": {
"startIndex": 3,
"endIndex": 4
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
},
{
"typeParameterName": "Relations",
"constraintTokenRange": {
"startIndex": 5,
"endIndex": 6
},
"defaultTypeTokenRange": {
"startIndex": 7,
"endIndex": 8
}
}
],
"name": "CrudRestController",
"members": [
{
"kind": "MethodSignature",
"canonicalReference": "@loopback/rest-crud!CrudRestController#create:member(1)",
"docComment": "/**\n * Implementation of the endpoint `POST /`.\n *\n * @param - data Model data\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "create(data: "
},
{
"kind": "Reference",
"text": "Omit",
"canonicalReference": "!Omit:type"
},
{
"kind": "Content",
"text": "<T, IdName>"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Reference",
"text": "Promise",
"canonicalReference": "!Promise:interface"
},
{
"kind": "Content",
"text": "<T>"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 4,
"endIndex": 6
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "data",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 3
}
}
],
"name": "create"
},
{
"kind": "PropertySignature",
"canonicalReference": "@loopback/rest-crud!CrudRestController#repository:member",
"docComment": "/**\n * The backing repository used to access & modify model data.\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "readonly repository: "
},
{
"kind": "Reference",
"text": "EntityCrudRepository",
"canonicalReference": "@loopback/repository!EntityCrudRepository:interface"
},
{
"kind": "Content",
"text": "<T, IdType>"
},
{
"kind": "Content",
"text": ";"
}
],
"releaseTag": "Public",
"name": "repository",
"propertyTypeTokenRange": {
"startIndex": 1,
"endIndex": 3
}
}
],
"extendsTokenRanges": []
},
{
"kind": "Interface",
"canonicalReference": "@loopback/rest-crud!CrudRestControllerCtor:interface",
"docComment": "/**\n * Constructor of the controller class returned by `defineCrudRestController`.\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export interface CrudRestControllerCtor<T extends "
},
{
"kind": "Reference",
"text": "Entity",
"canonicalReference": "@loopback/repository!Entity:class"
},
{
"kind": "Content",
"text": ", IdType, IdName extends "
},
{
"kind": "Content",
"text": "keyof T"
},
{
"kind": "Content",
"text": ", Relations extends "
},
{
"kind": "Content",
"text": "object "
},
{
"kind": "Content",
"text": "= "
},
{
"kind": "Content",
"text": "{}"
},
{
"kind": "Content",
"text": "> "
}
],
"releaseTag": "Public",
"typeParameters": [
{
"typeParameterName": "T",
"constraintTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
},
{
"typeParameterName": "IdType",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
},
{
"typeParameterName": "IdName",
"constraintTokenRange": {
"startIndex": 3,
"endIndex": 4
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
},
{
"typeParameterName": "Relations",
"constraintTokenRange": {
"startIndex": 5,
"endIndex": 6
},
"defaultTypeTokenRange": {
"startIndex": 7,
"endIndex": 8
}
}
],
"name": "CrudRestControllerCtor",
"members": [
{
"kind": "ConstructSignature",
"canonicalReference": "@loopback/rest-crud!CrudRestControllerCtor:new(1)",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "new (repository: "
},
{
"kind": "Reference",
"text": "EntityCrudRepository",
"canonicalReference": "@loopback/repository!EntityCrudRepository:interface"
},
{
"kind": "Content",
"text": "<T, IdType, Relations>"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Reference",
"text": "CrudRestController",
"canonicalReference": "@loopback/rest-crud!CrudRestController:interface"
},
{
"kind": "Content",
"text": "<T, IdType, IdName, Relations>"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 4,
"endIndex": 6
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "repository",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 3
}
}
]
}
],
"extendsTokenRanges": []
},
{
"kind": "Interface",
"canonicalReference": "@loopback/rest-crud!CrudRestControllerOptions:interface",
"docComment": "/**\n * Options to configure different aspects of a CRUD REST Controller.\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export interface CrudRestControllerOptions "
}
],
"releaseTag": "Public",
"name": "CrudRestControllerOptions",
"members": [
{
"kind": "PropertySignature",
"canonicalReference": "@loopback/rest-crud!CrudRestControllerOptions#basePath:member",
"docComment": "/**\n * The base path where to \"mount\" the controller.\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "basePath: "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": ";"
}
],
"releaseTag": "Public",
"name": "basePath",
"propertyTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
],
"extendsTokenRanges": []
},
{
"kind": "Function",
"canonicalReference": "@loopback/rest-crud!defineCrudRepositoryClass:function(1)",
"docComment": "/**\n * Create (define) a repository class for the given model.\n *\n * Example usage:\n * ```ts\n * const ProductRepository = defineCrudRepositoryClass(Product);\n * ```\n *\n * @param - modelCtor A model class, e.g. `Product`.\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function defineCrudRepositoryClass<T extends "
},
{
"kind": "Reference",
"text": "Entity",
"canonicalReference": "@loopback/repository!Entity:class"
},
{
"kind": "Content",
"text": ", IdType, Relations extends "
},
{
"kind": "Content",
"text": "object "
},
{
"kind": "Content",
"text": "= "
},
{
"kind": "Content",
"text": "{}"
},
{
"kind": "Content",
"text": ">(entityClass: "
},
{
"kind": "Content",
"text": "typeof "
},
{
"kind": "Reference",
"text": "Entity",
"canonicalReference": "@loopback/repository!Entity:class"
},
{
"kind": "Content",
"text": " & {\n prototype: T;\n}"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Reference",
"text": "RepositoryClass",
"canonicalReference": "@loopback/rest-crud!RepositoryClass:interface"
},
{
"kind": "Content",
"text": "<T, IdType, Relations>"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 11,
"endIndex": 13
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "entityClass",
"parameterTypeTokenRange": {
"startIndex": 7,
"endIndex": 10
}
}
],
"typeParameters": [
{
"typeParameterName": "T",
"constraintTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
},
{
"typeParameterName": "IdType",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
},
{
"typeParameterName": "Relations",
"constraintTokenRange": {
"startIndex": 3,
"endIndex": 4
},
"defaultTypeTokenRange": {
"startIndex": 5,
"endIndex": 6
}
}
],
"name": "defineCrudRepositoryClass"
},
{
"kind": "Function",
"canonicalReference": "@loopback/rest-crud!defineCrudRestController:function(1)",
"docComment": "/**\n * Create (define) a CRUD Controller class for the given model.\n *\n * Example usage:\n * ```ts\n * const ProductController = defineCrudRestController<\n * Product,\n * typeof Product.prototype.id,\n * 'id'\n * >(Product, {basePath: '/products'});\n *\n * inject('repositories.ProductRepository')(\n * ProductController,\n * undefined,\n * 0,\n * );\n *\n * app.controller(ProductController);\n * ```\n *\n * @param - modelCtor A model class, e.g. `Product`.\n *\n * @param - options Configuration options, e.g. `{basePath: '/products'}`.\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function defineCrudRestController<T extends "
},
{
"kind": "Reference",
"text": "Entity",
"canonicalReference": "@loopback/repository!Entity:class"
},
{
"kind": "Content",
"text": ", IdType, IdName extends "
},
{
"kind": "Content",
"text": "keyof T"
},
{
"kind": "Content",
"text": ", Relations extends "
},
{
"kind": "Content",
"text": "object "
},
{
"kind": "Content",
"text": "= "
},
{
"kind": "Content",
"text": "{}"
},
{
"kind": "Content",
"text": ">(modelCtor: "
},
{
"kind": "Content",
"text": "typeof "
},
{
"kind": "Reference",
"text": "Entity",
"canonicalReference": "@loopback/repository!Entity:class"
},
{
"kind": "Content",
"text": " & {\n prototype: T & {\n [key in IdName]: IdType;\n };\n}"
},
{
"kind": "Content",
"text": ", options: "
},
{
"kind": "Reference",
"text": "CrudRestControllerOptions",
"canonicalReference": "@loopback/rest-crud!CrudRestControllerOptions:interface"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Reference",
"text": "CrudRestControllerCtor",
"canonicalReference": "@loopback/rest-crud!CrudRestControllerCtor:interface"
},
{
"kind": "Content",
"text": "<T, IdType, IdName, Relations>"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 15,
"endIndex": 17
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "modelCtor",
"parameterTypeTokenRange": {
"startIndex": 9,
"endIndex": 12
}
},
{
"parameterName": "options",
"parameterTypeTokenRange": {
"startIndex": 13,
"endIndex": 14
}
}
],
"typeParameters": [
{
"typeParameterName": "T",
"constraintTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
},
{
"typeParameterName": "IdType",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
},
{
"typeParameterName": "IdName",
"constraintTokenRange": {
"startIndex": 3,
"endIndex": 4
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
},
{
"typeParameterName": "Relations",
"constraintTokenRange": {
"startIndex": 5,
"endIndex": 6
},
"defaultTypeTokenRange": {
"startIndex": 7,
"endIndex": 8
}
}
],
"name": "defineCrudRestController"
},
{
"kind": "Interface",
"canonicalReference": "@loopback/rest-crud!RepositoryClass:interface",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "export interface RepositoryClass<T extends "
},
{
"kind": "Reference",
"text": "Entity",
"canonicalReference": "@loopback/repository!Entity:class"
},
{
"kind": "Content",
"text": ", IdType, Relations extends "
},
{
"kind": "Content",
"text": "object"
},
{
"kind": "Content",
"text": "> "
}
],
"releaseTag": "Public",
"typeParameters": [
{
"typeParameterName": "T",
"constraintTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
},
{
"typeParameterName": "IdType",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
},
{
"typeParameterName": "Relations",
"constraintTokenRange": {
"startIndex": 3,
"endIndex": 4
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
}
],
"name": "RepositoryClass",
"members": [
{
"kind": "ConstructSignature",
"canonicalReference": "@loopback/rest-crud!RepositoryClass:new(1)",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "new (ds: "
},
{
"kind": "Reference",
"text": "juggler.DataSource",
"canonicalReference": "loopback-datasource-juggler!DataSource:class"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Reference",
"text": "EntityCrudRepository",
"canonicalReference": "@loopback/repository!EntityCrudRepository:interface"
},
{
"kind": "Content",
"text": "<T, IdType, Relations>"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 3,
"endIndex": 5
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "ds",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
]
}
],
"extendsTokenRanges": []
}
]
}
]
}