Wrapper for LiturgicalCalendarAPI to implement Directus-like filtering.
This project began as a quick and dirty attempt at implementing/demonstrating this suggestion in deno/Typescript, but it ended up being a fairly complete solution that met my use case.
The best way to experiment with this wrapper is to test out some queries using the playground. It does not support all features, since the filter options are practically endless, but it has the most popular options.
GET https://litcal.deno.dev/api/fetch
Query Params:
endpoint
The LitCal API endpoint you wish to use. E.gcalendar
. Required.filter
Takes in a data field key, a filter type, and a filter value. E.gfilter[grade_lcl][_eq]=SOLEMNITY
. Filter keys from Directus (Since they are similar enough) can be found here. Data keys can be found in this schema. Multiplefilter
query params can be sent in a single request. E.g?filter[grade_lcl][_eq]=SOLEMNITY&filter[name][_icontains]=Sunday
will provide all events that satisfy BOTHgrade_lcl=SOLEMNITY
AND haveSunday
in thename
field. If two filters are of the same field and operator, the wrapper returns results of EITHER filter. E.g?filter[grade_lcl][_eq]=SOLEMNITY&filter[name][_eq]=FEAST
gives any results with EITHERgrade_lcl=SOLEMNITY
ORgrade_lcl=FEAST
. Default, none.fields
CSV string of data field keys to include in each object. E.gname,date,month_short
. Default, all.returnType
Only supports json or ics. E.greturnType=ics
. Default,json
.- Any other query params will be sent to LitCal api. E.g
locale
,year_type
.
Requires Deno.
deno task start
I recommend using the free tier of Deno Deploy.