UNPKG

@loopback/docs

Version:
1,218 lines (1,217 loc) 36.1 kB
{ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "7.3.8", "schemaVersion": 1003, "oldestForwardsCompatibleVersion": 1001 }, "kind": "Package", "canonicalReference": "@loopback/repository-json-schema!", "docComment": "", "name": "@loopback/repository-json-schema", "members": [ { "kind": "EntryPoint", "canonicalReference": "@loopback/repository-json-schema!", "name": "", "members": [ { "kind": "Function", "canonicalReference": "@loopback/repository-json-schema!getFieldsJsonSchemaFor:function(1)", "docComment": "/**\n * Build a JSON schema describing the format of the \"fields\" object used to include or exclude properties of model instances.\n *\n * @param modelCtor - The model constructor to build the filter schema for.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function " }, { "kind": "Reference", "text": "getFieldsJsonSchemaFor" }, { "kind": "Content", "text": "(" }, { "kind": "Reference", "text": "modelCtor" }, { "kind": "Content", "text": ": " }, { "kind": "Content", "text": "typeof " }, { "kind": "Reference", "text": "Model" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "JsonSchema" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 8, "endIndex": 9 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "modelCtor", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 7 } } ], "name": "getFieldsJsonSchemaFor" }, { "kind": "Function", "canonicalReference": "@loopback/repository-json-schema!getFilterJsonSchemaFor:function(1)", "docComment": "/**\n * Build a JSON schema describing the format of the \"filter\" object used to query model instances.\n *\n * Note we don't take the model properties into account yet and return a generic json schema allowing any \"where\" condition.\n *\n * @param modelCtor - The model constructor to build the filter schema for.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function " }, { "kind": "Reference", "text": "getFilterJsonSchemaFor" }, { "kind": "Content", "text": "(" }, { "kind": "Reference", "text": "modelCtor" }, { "kind": "Content", "text": ": " }, { "kind": "Content", "text": "typeof " }, { "kind": "Reference", "text": "Model" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "JsonSchema" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 8, "endIndex": 9 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "modelCtor", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 7 } } ], "name": "getFilterJsonSchemaFor" }, { "kind": "Function", "canonicalReference": "@loopback/repository-json-schema!getJsonSchema:function(1)", "docComment": "/**\n * Gets the JSON Schema of a TypeScript model/class by seeing if one exists in a cache. If not, one is generated and then cached.\n *\n * @param ctor - Contructor of class to get JSON Schema from\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function " }, { "kind": "Reference", "text": "getJsonSchema" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "T" }, { "kind": "Content", "text": " extends " }, { "kind": "Content", "text": "object" }, { "kind": "Content", "text": ">(" }, { "kind": "Reference", "text": "ctor" }, { "kind": "Content", "text": ": " }, { "kind": "Reference", "text": "Function" }, { "kind": "Content", "text": " & {\n " }, { "kind": "Reference", "text": "prototype" }, { "kind": "Content", "text": ": " }, { "kind": "Reference", "text": "T" }, { "kind": "Content", "text": ";\n}" }, { "kind": "Content", "text": ", " }, { "kind": "Reference", "text": "options" }, { "kind": "Content", "text": "?: " }, { "kind": "Reference", "text": "JsonSchemaOptions" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "T" }, { "kind": "Content", "text": ">" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "JSONSchema" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 23, "endIndex": 24 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "ctor", "parameterTypeTokenRange": { "startIndex": 9, "endIndex": 15 } }, { "parameterName": "options", "parameterTypeTokenRange": { "startIndex": 18, "endIndex": 22 } } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 5, "endIndex": 6 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "getJsonSchema" }, { "kind": "Function", "canonicalReference": "@loopback/repository-json-schema!getJsonSchemaRef:function(1)", "docComment": "/**\n * Describe the provided Model as a reference to a definition shared by multiple endpoints. The definition is included in the returned schema.\n *\n * @param modelCtor - The model constructor (e.g. `Product`)\n *\n * @param options - Additional options\n *\n * @example\n * ```ts\n * const schema = {\n * $ref: '/definitions/Product',\n * definitions: {\n * Product: {\n * title: 'Product',\n * properties: {\n * // etc.\n * }\n * }\n * }\n * }\n * ```\n *\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function " }, { "kind": "Reference", "text": "getJsonSchemaRef" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "T" }, { "kind": "Content", "text": " extends " }, { "kind": "Content", "text": "object" }, { "kind": "Content", "text": ">(" }, { "kind": "Reference", "text": "modelCtor" }, { "kind": "Content", "text": ": " }, { "kind": "Reference", "text": "Function" }, { "kind": "Content", "text": " & {\n " }, { "kind": "Reference", "text": "prototype" }, { "kind": "Content", "text": ": " }, { "kind": "Reference", "text": "T" }, { "kind": "Content", "text": ";\n}" }, { "kind": "Content", "text": ", " }, { "kind": "Reference", "text": "options" }, { "kind": "Content", "text": "?: " }, { "kind": "Reference", "text": "JsonSchemaOptions" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "T" }, { "kind": "Content", "text": ">" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "JSONSchema" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 23, "endIndex": 24 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "modelCtor", "parameterTypeTokenRange": { "startIndex": 9, "endIndex": 15 } }, { "parameterName": "options", "parameterTypeTokenRange": { "startIndex": 18, "endIndex": 22 } } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 5, "endIndex": 6 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "getJsonSchemaRef" }, { "kind": "Function", "canonicalReference": "@loopback/repository-json-schema!getNavigationalPropertyForRelation:function(1)", "docComment": "/**\n * Checks and return navigational property definition for the relation\n *\n * @param - relMeta Relation metadata object\n *\n * @param - targetRef Schema definition for the target model\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function " }, { "kind": "Reference", "text": "getNavigationalPropertyForRelation" }, { "kind": "Content", "text": "(" }, { "kind": "Reference", "text": "relMeta" }, { "kind": "Content", "text": ": " }, { "kind": "Reference", "text": "RelationMetadata" }, { "kind": "Content", "text": ", " }, { "kind": "Reference", "text": "targetRef" }, { "kind": "Content", "text": ": " }, { "kind": "Reference", "text": "JSONSchema" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "JSONSchema" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 11, "endIndex": 12 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "relMeta", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 } }, { "parameterName": "targetRef", "parameterTypeTokenRange": { "startIndex": 9, "endIndex": 10 } } ], "name": "getNavigationalPropertyForRelation" }, { "kind": "Function", "canonicalReference": "@loopback/repository-json-schema!getWhereJsonSchemaFor:function(1)", "docComment": "/**\n * Build a JSON schema describing the format of the \"where\" object used to filter model instances to query, update or delete.\n *\n * Note we don't take the model properties into account yet and return a generic json schema allowing any \"where\" condition.\n *\n * @param modelCtor - The model constructor to build the filter schema for.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function " }, { "kind": "Reference", "text": "getWhereJsonSchemaFor" }, { "kind": "Content", "text": "(" }, { "kind": "Reference", "text": "modelCtor" }, { "kind": "Content", "text": ": " }, { "kind": "Content", "text": "typeof " }, { "kind": "Reference", "text": "Model" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "JsonSchema" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 8, "endIndex": 9 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "modelCtor", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 7 } } ], "name": "getWhereJsonSchemaFor" }, { "kind": "Function", "canonicalReference": "@loopback/repository-json-schema!isArrayType:function(1)", "docComment": "/**\n * Determines whether a given string or constructor is array type or not\n *\n * @param type - Type as string or wrapper\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function " }, { "kind": "Reference", "text": "isArrayType" }, { "kind": "Content", "text": "(" }, { "kind": "Reference", "text": "type" }, { "kind": "Content", "text": ": " }, { "kind": "Content", "text": "string | " }, { "kind": "Reference", "text": "Function" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 8, "endIndex": 9 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "type", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 7 } } ], "name": "isArrayType" }, { "kind": "Variable", "canonicalReference": "@loopback/repository-json-schema!JSON_SCHEMA_KEY:var", "docComment": "/**\n * Metadata key used to set or retrieve repository JSON Schema\n */\n", "excerptTokens": [ { "kind": "Reference", "text": "JSON_SCHEMA_KEY" }, { "kind": "Content", "text": ": " }, { "kind": "Reference", "text": "MetadataAccessor" }, { "kind": "Content", "text": "<{\n [" }, { "kind": "Reference", "text": "key" }, { "kind": "Content", "text": ": string]: " }, { "kind": "Reference", "text": "JSONSchema" }, { "kind": "Content", "text": ";\n}, " }, { "kind": "Reference", "text": "ClassDecorator" }, { "kind": "Content", "text": ">" } ], "releaseTag": "Public", "name": "JSON_SCHEMA_KEY", "variableTypeTokenRange": { "startIndex": 2, "endIndex": 10 } }, { "kind": "Interface", "canonicalReference": "@loopback/repository-json-schema!JsonSchemaOptions:interface", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export interface " }, { "kind": "Reference", "text": "JsonSchemaOptions" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "T" }, { "kind": "Content", "text": " extends " }, { "kind": "Content", "text": "object" }, { "kind": "Content", "text": "> " } ], "releaseTag": "Public", "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 5, "endIndex": 6 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "JsonSchemaOptions", "members": [ { "kind": "PropertySignature", "canonicalReference": "@loopback/repository-json-schema!JsonSchemaOptions#exclude:member", "docComment": "/**\n * List of model properties to exclude from the schema.\n */\n", "excerptTokens": [ { "kind": "Reference", "text": "exclude" }, { "kind": "Content", "text": "?: " }, { "kind": "Content", "text": "(keyof " }, { "kind": "Reference", "text": "T" }, { "kind": "Content", "text": ")[]" }, { "kind": "Content", "text": ";" } ], "releaseTag": "Public", "name": "exclude", "propertyTypeTokenRange": { "startIndex": 2, "endIndex": 5 } }, { "kind": "PropertySignature", "canonicalReference": "@loopback/repository-json-schema!JsonSchemaOptions#includeRelations:member", "docComment": "/**\n * Set this flag if you want the schema to define navigational properties for model relations.\n */\n", "excerptTokens": [ { "kind": "Reference", "text": "includeRelations" }, { "kind": "Content", "text": "?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "releaseTag": "Public", "name": "includeRelations", "propertyTypeTokenRange": { "startIndex": 2, "endIndex": 3 } }, { "kind": "PropertySignature", "canonicalReference": "@loopback/repository-json-schema!JsonSchemaOptions#optional:member", "docComment": "/**\n * List of model properties to mark as optional. Overrides the \"partial\" option if it is not empty.\n */\n", "excerptTokens": [ { "kind": "Reference", "text": "optional" }, { "kind": "Content", "text": "?: " }, { "kind": "Content", "text": "(keyof " }, { "kind": "Reference", "text": "T" }, { "kind": "Content", "text": ")[]" }, { "kind": "Content", "text": ";" } ], "releaseTag": "Public", "name": "optional", "propertyTypeTokenRange": { "startIndex": 2, "endIndex": 5 } }, { "kind": "PropertySignature", "canonicalReference": "@loopback/repository-json-schema!JsonSchemaOptions#partial:member", "docComment": "/**\n * Set this flag to mark all model properties as optional. This is typically used to describe request body of PATCH endpoints. This option will be overridden by the \"optional\" option if it is set and non-empty.\n */\n", "excerptTokens": [ { "kind": "Reference", "text": "partial" }, { "kind": "Content", "text": "?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "releaseTag": "Public", "name": "partial", "propertyTypeTokenRange": { "startIndex": 2, "endIndex": 3 } } ], "extendsTokenRanges": [] }, { "kind": "Function", "canonicalReference": "@loopback/repository-json-schema!metaToJsonProperty:function(1)", "docComment": "/**\n * Converts property metadata into a JSON property definition\n *\n * @param - meta\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function " }, { "kind": "Reference", "text": "metaToJsonProperty" }, { "kind": "Content", "text": "(" }, { "kind": "Reference", "text": "meta" }, { "kind": "Content", "text": ": " }, { "kind": "Reference", "text": "PropertyDefinition" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "JSONSchema" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "meta", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 } } ], "name": "metaToJsonProperty" }, { "kind": "Enum", "canonicalReference": "@loopback/repository-json-schema!MODEL_TYPE_KEYS:enum", "docComment": "/**\n * TODO(semver-major) remove these constants in the next major version\n *\n * @deprecated\n *\n * Use the helper `buildModelCacheKey` to obtain the cache key for a given set of schema options.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare const enum " }, { "kind": "Reference", "text": "MODEL_TYPE_KEYS" }, { "kind": "Content", "text": " " } ], "releaseTag": "Public", "name": "MODEL_TYPE_KEYS", "members": [ { "kind": "EnumMember", "canonicalReference": "@loopback/repository-json-schema!MODEL_TYPE_KEYS.ModelOnly:member", "docComment": "", "excerptTokens": [ { "kind": "Reference", "text": "ModelOnly" }, { "kind": "Content", "text": " = " }, { "kind": "Content", "text": "\"modelOnly\"" } ], "releaseTag": "Public", "name": "ModelOnly", "initializerTokenRange": { "startIndex": 2, "endIndex": 3 } }, { "kind": "EnumMember", "canonicalReference": "@loopback/repository-json-schema!MODEL_TYPE_KEYS.ModelWithRelations:member", "docComment": "", "excerptTokens": [ { "kind": "Reference", "text": "ModelWithRelations" }, { "kind": "Content", "text": " = " }, { "kind": "Content", "text": "\"modelWithRelations\"" } ], "releaseTag": "Public", "name": "ModelWithRelations", "initializerTokenRange": { "startIndex": 2, "endIndex": 3 } } ] }, { "kind": "Function", "canonicalReference": "@loopback/repository-json-schema!modelToJsonSchema:function(1)", "docComment": "/**\n * Converts a TypeScript class into a JSON Schema using TypeScript's reflection API\n *\n * @param ctor - Constructor of class to convert from\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function " }, { "kind": "Reference", "text": "modelToJsonSchema" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "T" }, { "kind": "Content", "text": " extends " }, { "kind": "Content", "text": "object" }, { "kind": "Content", "text": ">(" }, { "kind": "Reference", "text": "ctor" }, { "kind": "Content", "text": ": " }, { "kind": "Reference", "text": "Function" }, { "kind": "Content", "text": " & {\n " }, { "kind": "Reference", "text": "prototype" }, { "kind": "Content", "text": ": " }, { "kind": "Reference", "text": "T" }, { "kind": "Content", "text": ";\n}" }, { "kind": "Content", "text": ", " }, { "kind": "Reference", "text": "jsonSchemaOptions" }, { "kind": "Content", "text": "?: " }, { "kind": "Reference", "text": "JsonSchemaOptions" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "T" }, { "kind": "Content", "text": ">" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "JSONSchema" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 23, "endIndex": 24 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "ctor", "parameterTypeTokenRange": { "startIndex": 9, "endIndex": 15 } }, { "parameterName": "jsonSchemaOptions", "parameterTypeTokenRange": { "startIndex": 18, "endIndex": 22 } } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 5, "endIndex": 6 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "modelToJsonSchema" }, { "kind": "Function", "canonicalReference": "@loopback/repository-json-schema!stringTypeToWrapper:function(1)", "docComment": "/**\n * Gets the wrapper function of primitives string, number, and boolean\n *\n * @param type - Name of type\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function " }, { "kind": "Reference", "text": "stringTypeToWrapper" }, { "kind": "Content", "text": "(" }, { "kind": "Reference", "text": "type" }, { "kind": "Content", "text": ": " }, { "kind": "Content", "text": "string | " }, { "kind": "Reference", "text": "Function" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "Function" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 8, "endIndex": 9 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "type", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 7 } } ], "name": "stringTypeToWrapper" } ] } ] }