UNPKG

@loopback/docs

Version:
932 lines (931 loc) 27.5 kB
{ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "7.2.1", "schemaVersion": 1001, "oldestForwardsCompatibleVersion": 1001 }, "kind": "Package", "canonicalReference": "@loopback/repository-json-schema", "docComment": "", "name": "@loopback/repository-json-schema", "members": [ { "kind": "EntryPoint", "canonicalReference": "", "name": "", "members": [ { "kind": "Function", "canonicalReference": "(getFieldsJsonSchemaFor:0)", "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": 0, "parameters": [ { "parameterName": "modelCtor", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 7 } } ], "name": "getFieldsJsonSchemaFor" }, { "kind": "Function", "canonicalReference": "(getFilterJsonSchemaFor:0)", "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": 0, "parameters": [ { "parameterName": "modelCtor", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 7 } } ], "name": "getFilterJsonSchemaFor" }, { "kind": "Function", "canonicalReference": "(getJsonSchema:0)", "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": "ctor" }, { "kind": "Content", "text": ": " }, { "kind": "Reference", "text": "Function" }, { "kind": "Content", "text": ", " }, { "kind": "Reference", "text": "options" }, { "kind": "Content", "text": "?: " }, { "kind": "Reference", "text": "JsonSchemaOptions" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "JSONSchema" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 11, "endIndex": 12 }, "releaseTag": "Public", "overloadIndex": 0, "parameters": [ { "parameterName": "ctor", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 } }, { "parameterName": "options", "parameterTypeTokenRange": { "startIndex": 9, "endIndex": 10 } } ], "name": "getJsonSchema" }, { "kind": "Function", "canonicalReference": "(getJsonSchemaRef:0)", "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": "modelCtor" }, { "kind": "Content", "text": ": " }, { "kind": "Reference", "text": "Function" }, { "kind": "Content", "text": ", " }, { "kind": "Reference", "text": "options" }, { "kind": "Content", "text": "?: " }, { "kind": "Reference", "text": "JsonSchemaOptions" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "JSONSchema" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 11, "endIndex": 12 }, "releaseTag": "Public", "overloadIndex": 0, "parameters": [ { "parameterName": "modelCtor", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 } }, { "parameterName": "options", "parameterTypeTokenRange": { "startIndex": 9, "endIndex": 10 } } ], "name": "getJsonSchemaRef" }, { "kind": "Function", "canonicalReference": "(getNavigationalPropertyForRelation:0)", "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": 0, "parameters": [ { "parameterName": "relMeta", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 } }, { "parameterName": "targetRef", "parameterTypeTokenRange": { "startIndex": 9, "endIndex": 10 } } ], "name": "getNavigationalPropertyForRelation" }, { "kind": "Function", "canonicalReference": "(getWhereJsonSchemaFor:0)", "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": 0, "parameters": [ { "parameterName": "modelCtor", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 7 } } ], "name": "getWhereJsonSchemaFor" }, { "kind": "Function", "canonicalReference": "(isArrayType:0)", "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": 0, "parameters": [ { "parameterName": "type", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 7 } } ], "name": "isArrayType" }, { "kind": "Interface", "canonicalReference": "(JsonSchemaOptions:interface)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export interface " }, { "kind": "Reference", "text": "JsonSchemaOptions" }, { "kind": "Content", "text": " " } ], "releaseTag": "Public", "name": "JsonSchemaOptions", "members": [ { "kind": "PropertySignature", "canonicalReference": "includeRelations", "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": "partial", "docComment": "/**\n * Set this flag to mark all model properties as optional. This is typically used to describe request body of PATCH endpoints.\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": "(metaToJsonProperty:0)", "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": 0, "parameters": [ { "parameterName": "meta", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 } } ], "name": "metaToJsonProperty" }, { "kind": "Enum", "canonicalReference": "(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": "ModelOnly", "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": "ModelWithRelations", "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": "(modelToJsonSchema:0)", "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": "ctor" }, { "kind": "Content", "text": ": " }, { "kind": "Reference", "text": "Function" }, { "kind": "Content", "text": ", " }, { "kind": "Reference", "text": "jsonSchemaOptions" }, { "kind": "Content", "text": "?: " }, { "kind": "Reference", "text": "JsonSchemaOptions" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "JSONSchema" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 11, "endIndex": 12 }, "releaseTag": "Public", "overloadIndex": 0, "parameters": [ { "parameterName": "ctor", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 } }, { "parameterName": "jsonSchemaOptions", "parameterTypeTokenRange": { "startIndex": 9, "endIndex": 10 } } ], "name": "modelToJsonSchema" }, { "kind": "Function", "canonicalReference": "(stringTypeToWrapper:0)", "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": 0, "parameters": [ { "parameterName": "type", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 7 } } ], "name": "stringTypeToWrapper" }, { "kind": "Variable", "canonicalReference": "JSON_SCHEMA_KEY", "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 } } ] } ] }