breviarium 3.0.8 → 3.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +240 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -70,7 +70,7 @@ Liturgy of the hours: functions to retrieve the information of the library:
70
70
  | `getSexta` | `date?: Date` | Returns the Sexta prayer for a given date. | `prayers.getSexta(new Date());` |
71
71
  | `getNona` | `date?: Date` | Returns the Nona prayer for a given date. | `prayers.getNona();` |
72
72
  | `getCompletorium` | `date?: Date` | Returns the Completorium prayer for a given date. | `prayers.getCompletorium();` |
73
- | `getMissaleLectiones` | `date?: Date` | Returns the Mass readings prayer for a given date. | `prayers.getMissaleLectiones();` |
73
+ | `getLectures` | `date?: Date` | Returns the Mass readings for a given date. | `prayers.getLectures();` |
74
74
  | `getEvangelium` | `date?: Date` | Returns the Gospel text for a given date. | `prayers.getEvangelium(new Date(2025, 5, 1));` |
75
75
 
76
76
  _(1)_: Some liturgical days, contains different options to pray: memory (example: a saint), and ferial (ordinary time). The Library displays both options and user can choose what version use.
@@ -94,4 +94,242 @@ See [Changelog.md](./CHANGELOG.md) for breaking changes.
94
94
 
95
95
  ## Debug
96
96
 
97
- > You can debug or see the libraries responses in: https://escribano.breviarium.es/debug select a day, the hour or prayer and display the JSON response
97
+ > You can debug or see the libraries responses in: https://escribano.breviarium.es/debug select a day, the hour or prayer and display the JSON response
98
+
99
+ ## API Reference — Breviarium
100
+
101
+ Below is a comprehensive reference for the public API. Each function lists parameters, return type, and a compact output sample. All methods that accept a `date?: Date` will use the instance’s current date when omitted.
102
+
103
+ ### Construction & Date Utilities
104
+
105
+ - `new Breviarium(selectedDate?: Date)`
106
+ - Parameters:
107
+ - `selectedDate?: Date` — if omitted, today is used.
108
+ - Returns: `Breviarium`
109
+
110
+ - `setDate(date: Date): void`
111
+ - Parameters: `date: Date`
112
+ - Returns: `void`
113
+
114
+ - `getCurrentDate(): Date`
115
+ - Parameters: none
116
+ - Returns: `Date`
117
+
118
+ Usage:
119
+
120
+ ```ts
121
+ const breviarium = new Breviarium();
122
+ breviarium.setDate(new Date(2025, 6, 30));
123
+ console.log(breviarium.getCurrentDate());
124
+ ```
125
+
126
+ ### Liturgy of the Hours — Core Retrieval Methods
127
+
128
+ - `getInvitatorium(date?: Date): Promise<InvitatoriumSchemaOutput | undefined>`
129
+ - Returns: one Invitatorium entry or `undefined` if not available.
130
+ - Output sample:
131
+ ```json
132
+ {
133
+ "id": "mary_mother_of_god",
134
+ "val": "Antiphon and invitatory text..."
135
+ }
136
+ ```
137
+
138
+ - `getLaudes(date?: Date): Promise<LaudesSchemaOutput[] | undefined>`
139
+ - Returns: array of Laudes options (some days have multiple options) or `undefined`.
140
+ - Output sample:
141
+ ```json
142
+ [{
143
+ "id": "mary_mother_of_god",
144
+ "cycle": "ANY",
145
+ "himno": "Hymn text...",
146
+ "primer_salmo_cita": "Ps 63",
147
+ "primer_salmo_antifona": "Ant. ...",
148
+ "primer_salmo_texto": "Psalm text...",
149
+ "segundo_salmo_cita": "Cantico",
150
+ "segundo_salmo_antifona": "Ant. ...",
151
+ "segundo_salmo_texto": "...",
152
+ "tercer_salmo_cita": "Ps 149",
153
+ "tercer_salmo_antifona": "Ant. ...",
154
+ "tercer_salmo_texto": "...",
155
+ "lectura_biblica_cita": "1Th 5,16-18",
156
+ "lectura_biblica": "Reading text...",
157
+ "responsorios": ["V. ... R. ..."],
158
+ "cantico_evangelico_antifona": "Ant. ...",
159
+ "preces_intro": "Intro...",
160
+ "preces_respuesta": "Resp...",
161
+ "preces_contenido": ["Petition 1", "Petition 2"],
162
+ "invitacion_padrenuestro": "Intro...",
163
+ "oracion_final": "Collect text..."
164
+ }]
165
+ ```
166
+
167
+ - `getVesperae(date?: Date): Promise<VesperaeSchemaOutput[] | undefined>`
168
+ - Returns: array of Vespers options or `undefined`.
169
+ - Output sample:
170
+ ```json
171
+ [{
172
+ "id": "lent_5_monday",
173
+ "cycle": "ANY",
174
+ "primeras_visperas": false,
175
+ "himno": "Hymn text...",
176
+ "primer_salmo_cita": "Ps 110",
177
+ "primer_salmo_antifona": "Ant. ...",
178
+ "primer_salmo_texto": "...",
179
+ "segundo_salmo_cita": "Ps 111",
180
+ "segundo_salmo_antifona": "Ant. ...",
181
+ "segundo_salmo_texto": "...",
182
+ "tercer_salmo_cita": "Cantico",
183
+ "tercer_salmo_antifona": "Ant. ...",
184
+ "tercer_salmo_texto": "...",
185
+ "lectura_biblica_cita": "Eph 1,3-10",
186
+ "lectura_biblica": "Reading text...",
187
+ "responsorios": ["V. ... R. ..."],
188
+ "cantico_evangelico_antifona": "Ant. ...",
189
+ "preces_intro": "Intro...",
190
+ "preces_respuesta": "Resp...",
191
+ "preces_contenido": ["Petition 1"],
192
+ "invitacion_padrenuestro": "Intro...",
193
+ "oracion_final": "Collect text..."
194
+ }]
195
+ ```
196
+
197
+ - `getOfficium(date?: Date): Promise<OfficiumSchemaOutput | undefined>`
198
+ - Returns: Office of Readings object or `undefined`.
199
+ - Output sample:
200
+ ```json
201
+ {
202
+ "id": "mary_mother_of_god",
203
+ "cycle": "ANY",
204
+ "himno": "Hymn text...",
205
+ "primer_salmo_cita": "Ps ...",
206
+ "primer_salmo_antifona": "Ant. ...",
207
+ "primer_salmo_texto": "...",
208
+ "segundo_salmo_cita": "Ps ...",
209
+ "segundo_salmo_antifona": "Ant. ...",
210
+ "segundo_salmo_texto": "...",
211
+ "tercer_salmo_cita": "Ps ...",
212
+ "tercer_salmo_antifona": "Ant. ...",
213
+ "tercer_salmo_texto": "...",
214
+ "lectura_biblica_titulo_a": "Title ...",
215
+ "lectura_biblica_cita_a": "Ref ...",
216
+ "lectura_biblica_texto_a": "Text ...",
217
+ "lectura_patristica_titulo_a": "Title ...",
218
+ "lectura_patristica_cita_a": "Ref ...",
219
+ "lectura_patristica_texto_a": "Text ...",
220
+ "responsorio1": ["V. ... R. ..."],
221
+ "responsorio2_a": ["..."],
222
+ "responsorio3_a": ["..."],
223
+ "oracion_final": "Prayer text..."
224
+ }
225
+ ```
226
+
227
+ - `getTertia(date?: Date): Promise<IntermediateSchemaOutput | undefined>`
228
+ - `getSexta(date?: Date): Promise<IntermediateSchemaOutput | undefined>`
229
+ - `getNona(date?: Date): Promise<IntermediateSchemaOutput | undefined>`
230
+ - Returns: Midday prayer object or `undefined`.
231
+ - Output sample:
232
+ ```json
233
+ {
234
+ "id": "lent_2_monday",
235
+ "cycle": "ANY",
236
+ "himno": "Hymn text...",
237
+ "primer_salmo_cita": "Ps ...",
238
+ "primer_salmo_antifona": "Ant. ...",
239
+ "primer_salmo_texto": "...",
240
+ "segundo_salmo_cita": "Ps ...",
241
+ "segundo_salmo_antifona": "Ant. ...",
242
+ "segundo_salmo_texto": "...",
243
+ "tercer_salmo_cita": "Ps ...",
244
+ "tercer_salmo_antifona": "Ant. ...",
245
+ "tercer_salmo_texto": "...",
246
+ "lectura_biblica_cita": "Ref ...",
247
+ "lectura_biblica": "Reading text...",
248
+ "responsorios": ["V. ... R. ..."],
249
+ "oracion_final": "Prayer text..."
250
+ }
251
+ ```
252
+
253
+ - `getCompletorium(date?: Date): Promise<CompletoriumSchemaOutput | undefined>`
254
+ - Returns: Night Prayer object or `undefined`.
255
+ - Output sample:
256
+ ```json
257
+ {
258
+ "idd": 4,
259
+ "himno": "Hymn text...",
260
+ "primer_salmo_cita": "Ps ...",
261
+ "primer_salmo_antifona": "Ant. ...",
262
+ "primer_salmo_texto": "...",
263
+ "segundo_salmo_cita": "Ps ...",
264
+ "segundo_salmo_antifona": "Ant. ...",
265
+ "segundo_salmo_texto": "...",
266
+ "lectura_biblica_cita": "Ref ...",
267
+ "lectura_biblica_texto": "Reading text...",
268
+ "responsorio": ["..."],
269
+ "responsorio_pascua": ["..."],
270
+ "antifona_triduo": "...",
271
+ "antifona_inalbis": "...",
272
+ "cantico_evangelico_antifona": "Ant. ...",
273
+ "final": "Prayer text..."
274
+ }
275
+ ```
276
+
277
+ ### Mass Readings and Gospel
278
+
279
+ - `getLectures(date?: Date): Promise<LecturesSchemaOutput[] | undefined>`
280
+ - Returns: array with the day’s readings sets or `undefined`.
281
+ - Output sample:
282
+ ```json
283
+ [{
284
+ "id": "lent_5_monday",
285
+ "cycle": "ANY",
286
+ "lecturas": [
287
+ { "ref": "Jer 14,17-22", "texto": "Reading text...", "type": "FIRSTLECTURE" },
288
+ { "ref": "Ps 79", "texto": "Psalm text...", "type": "PSALM" },
289
+ { "ref": "Mt 13,36-43", "texto": "Gospel text...", "type": "GOSPEL" }
290
+ ]
291
+ }]
292
+ ```
293
+
294
+ - `getEvangelium(date?: Date): Promise<EvangeliumSchemaOutput | undefined>`
295
+ - Returns: Gospel object (subset of lectures) or `undefined`.
296
+ - Output sample:
297
+ ```json
298
+ {
299
+ "id": "mary_mother_of_god",
300
+ "cycle": "ANY",
301
+ "evangelium_lectiones": [
302
+ { "ref": "Mt 13,36-43", "texto": "Gospel text...", "type": "GOSPEL" }
303
+ ]
304
+ }
305
+ ```
306
+
307
+ ### Commons & Liturgy Info
308
+
309
+ - `getInvitatoriumPsalms(): Promise<any[]>`
310
+ - Returns: list of invitatory psalms (Spanish content in current DB).
311
+ - Output sample:
312
+ ```json
313
+ [
314
+ { "id": "psalm94", "title": "Salmo 94: Invitación a la alabanza divina", "psalm": "<p>Venid, aclamemos...</p>" },
315
+ { "id": "psalm99", "title": "Salmo 99: Alegría de los que entran en el templo", "psalm": "<p>Aclama al Señor...</p>" }
316
+ ]
317
+ ```
318
+
319
+ - `getLiturgyInformation(date?: Date): Promise<LiturgyInformationOutput>`
320
+ - Returns: metadata about the day: psalter week, cycle, color, celebration, etc. Always returns an object (with minimal defaults when unknown).
321
+ - Output sample:
322
+ ```json
323
+ {
324
+ "psaltery_week": "I",
325
+ "cycle": "A",
326
+ "color": "GREEN",
327
+ "color_hex": "#008000",
328
+ "celebration": "Feria",
329
+ "rank": "weekday",
330
+ "seasons": ["ORDINARY_TIME"],
331
+ "precedence": "weekday",
332
+ "periods": ["ORDINARY_TIME"],
333
+ "calendar": { "endOfLiturgycalSeason": "2025-11-29" }
334
+ }
335
+ ```
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "seasons",
15
15
  "liturgical"
16
16
  ],
17
- "version": "3.0.8",
17
+ "version": "3.0.13",
18
18
  "main": "dist/breviarium.cjs.js",
19
19
  "module": "dist/breviarium.es.js",
20
20
  "types": "dist/breviarium.d.ts",