0.2.0-canary.21 • Published 8 months ago

@jackdbd/fastify-media-endpoint v0.2.0-canary.21

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

@jackdbd/fastify-media-endpoint

npm version install size CodeCov badge Socket Badge

Fastify plugin that adds a Micropub Media endpoint to a Fastify server.

Installation

npm install @jackdbd/fastify-media-endpoint

Fastify plugin media-endpoint options

Options for the Fastify media-endpoint plugin

Properties

NameTypeDescriptionRequired
ajvInstance of Ajvno
deleteMedia(Delete post)FunctionDeletes a post published at a URL.yes
includeErrorDescriptionbooleanWhether to include an error_description property in all error responses. This is meant to assist the client developer in understanding the error. This is NOT meant to be shown to the end user.Default: falseno
isAccessTokenRevokedFunctionPredicate function that returns true if a jti (JSON Web Token ID) is revoked.yes
logPrefixstringDefault: "[media-endpoint] "no
meyes
multipartFormDataMaxFileSize(multipart/form-data max file size)numberMax file size (in bytes) for multipart/form-data requests.Default: 10000000Minimum: 0no
reportAllAjvErrors(report all AJV errors)booleanWhether to report all AJV validation errors.Default: falseno
uploadMedia(Upload file)FunctionUploads a file to the Micropub server.yes

Example

{
    "includeErrorDescription": false,
    "logPrefix": "[media-endpoint] ",
    "multipartFormDataMaxFileSize": 10000000,
    "reportAllAjvErrors": false
}

Dependencies

PackageVersion
@fastify/multipart^9.0.3
@fastify/response-validation^3.0.3
@jackdbd/canonical-url0.2.0-canary.8
@jackdbd/fastify-hooks0.2.0-canary.16
@jackdbd/fastify-utils0.2.0-canary.10
@jackdbd/indieauth0.2.0-canary.14
@jackdbd/micropub0.2.0-canary.13
@jackdbd/oauth2-error-responses0.2.0-canary.9
@jackdbd/schema-validators0.2.0-canary.12
@sinclair/typebox^0.34.14
ajv^8.17.1
ajv-formats^3.0.1
fastify-plugin^5.0.1

!WARNING This package defines 2 peer dependencies.

PeerVersion range
@fastify/request-context>=6.0.0
fastify>=5.0.0

References

License

© 2024 - 2025 Giacomo Debidda // MIT License