@hebcal/rest-api 5.1.0 → 5.1.1

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.
package/README.md CHANGED
@@ -29,335 +29,4 @@ const csv = eventsToCsv(events, options);
29
29
  console.log(JSON.stringify(csv));
30
30
  ```
31
31
 
32
- ## Functions
33
-
34
- <dl>
35
- <dt><a href="#locationToPlainObj">locationToPlainObj(location)</a> ⇒ <code><a href="#LocationPlainObj">LocationPlainObj</a></code></dt>
36
- <dd><p>Converts a @hebcal/core <code>Location</code> to a plain JS object.</p>
37
- </dd>
38
- <dt><a href="#makeAnchor">makeAnchor(s)</a> ⇒ <code>string</code></dt>
39
- <dd><p>Helper function to transform a string to make it more usable in a URL or filename.
40
- Converts to lowercase and replaces non-word characters with hyphen (&#39;-&#39;).</p>
41
- </dd>
42
- <dt><a href="#getDownloadFilename">getDownloadFilename(options)</a> ⇒ <code>string</code></dt>
43
- <dd></dd>
44
- <dt><a href="#pad2">pad2(number)</a> ⇒ <code>string</code></dt>
45
- <dd></dd>
46
- <dt><a href="#pad4">pad4(number)</a> ⇒ <code>string</code></dt>
47
- <dd></dd>
48
- <dt><a href="#toISOString">toISOString(d)</a> ⇒ <code>string</code></dt>
49
- <dd><p>Returns just the date portion as YYYY-MM-DD</p>
50
- </dd>
51
- <dt><a href="#getEventCategories">getEventCategories(ev)</a> ⇒ <code>Array.&lt;string&gt;</code></dt>
52
- <dd><p>Returns a category and subcategory name</p>
53
- </dd>
54
- <dt><a href="#renderTitleWithoutTime">renderTitleWithoutTime(ev)</a> ⇒ <code>string</code></dt>
55
- <dd><p>Renders the event title in default locale, but strips off time</p>
56
- </dd>
57
- <dt><a href="#getCalendarTitle">getCalendarTitle(events, options)</a> ⇒ <code>string</code></dt>
58
- <dd><p>Generates a title like &quot;Hebcal 2020 Israel&quot; or &quot;Hebcal May 1993 Providence&quot;</p>
59
- </dd>
60
- <dt><a href="#getHolidayDescription">getHolidayDescription(ev, [firstSentence])</a> ⇒ <code>string</code></dt>
61
- <dd><p>Returns an English language description of the holiday</p>
62
- </dd>
63
- <dt><a href="#makeTorahMemoText">makeTorahMemoText(ev, il)</a> ⇒ <code>string</code></dt>
64
- <dd><p>Makes mulit-line text that summarizes Torah &amp; Haftarah</p>
65
- </dd>
66
- <dt><a href="#appendIsraelAndTracking">appendIsraelAndTracking(url, il, utmSource, utmMedium, utmCampaign)</a> ⇒ <code>string</code></dt>
67
- <dd><p>Appends utm_source and utm_medium parameters to a URL</p>
68
- </dd>
69
- <dt><a href="#eventToCsv">eventToCsv(e, options)</a> ⇒ <code>string</code></dt>
70
- <dd><p>Renders an Event as a string</p>
71
- </dd>
72
- <dt><a href="#eventsToCsv">eventsToCsv(events, options)</a> ⇒ <code>string</code></dt>
73
- <dd></dd>
74
- <dt><a href="#eventsToClassicApi">eventsToClassicApi(events, options, [leyning])</a> ⇒ <code>Object</code></dt>
75
- <dd><p>Formats a list events for the classic Hebcal.com JSON API response</p>
76
- </dd>
77
- <dt><a href="#eventToClassicApiObject">eventToClassicApiObject(ev, options, [leyning])</a> ⇒ <code>Object</code></dt>
78
- <dd><p>Converts a Hebcal event to a classic Hebcal.com JSON API object</p>
79
- </dd>
80
- <dt><a href="#formatAliyot">formatAliyot(result, aliyot)</a> ⇒ <code>Object</code></dt>
81
- <dd></dd>
82
- <dt><a href="#formatLeyningResult">formatLeyningResult(reading)</a> ⇒ <code>Object</code></dt>
83
- <dd></dd>
84
- <dt><a href="#eventsToRss2">eventsToRss2(events, options)</a> ⇒ <code>string</code></dt>
85
- <dd></dd>
86
- <dt><a href="#eventToRssItem2">eventToRssItem2(ev, options)</a> ⇒ <code>string</code></dt>
87
- <dd></dd>
88
- <dt><a href="#eventToFullCalendar">eventToFullCalendar(ev, tzid, il)</a> ⇒ <code>Object</code></dt>
89
- <dd><p>Converts a Hebcal event to a FullCalendar.io object</p>
90
- </dd>
91
- </dl>
92
-
93
- ## Typedefs
94
-
95
- <dl>
96
- <dt><a href="#LocationPlainObj">LocationPlainObj</a> : <code>Object</code></dt>
97
- <dd><p>Location information</p>
98
- </dd>
99
- </dl>
100
-
101
- <a name="locationToPlainObj"></a>
102
-
103
- ## locationToPlainObj(location) ⇒ [<code>LocationPlainObj</code>](#LocationPlainObj)
104
- Converts a @hebcal/core `Location` to a plain JS object.
105
-
106
- **Kind**: global function
107
-
108
- | Param | Type |
109
- | --- | --- |
110
- | location | <code>Location</code> |
111
-
112
- <a name="makeAnchor"></a>
113
-
114
- ## makeAnchor(s) ⇒ <code>string</code>
115
- Helper function to transform a string to make it more usable in a URL or filename.
116
- Converts to lowercase and replaces non-word characters with hyphen ('-').
117
-
118
- **Kind**: global function
119
-
120
- | Param | Type |
121
- | --- | --- |
122
- | s | <code>string</code> |
123
-
124
- **Example**
125
- ```js
126
- makeAnchor('Rosh Chodesh Adar II') // 'rosh-chodesh-adar-ii'
127
- ```
128
- <a name="getDownloadFilename"></a>
129
-
130
- ## getDownloadFilename(options) ⇒ <code>string</code>
131
- **Kind**: global function
132
-
133
- | Param | Type |
134
- | --- | --- |
135
- | options | <code>CalOptions</code> |
136
-
137
- <a name="pad2"></a>
138
-
139
- ## pad2(number) ⇒ <code>string</code>
140
- **Kind**: global function
141
-
142
- | Param | Type |
143
- | --- | --- |
144
- | number | <code>number</code> |
145
-
146
- <a name="pad4"></a>
147
-
148
- ## pad4(number) ⇒ <code>string</code>
149
- **Kind**: global function
150
-
151
- | Param | Type |
152
- | --- | --- |
153
- | number | <code>number</code> |
154
-
155
- <a name="toISOString"></a>
156
-
157
- ## toISOString(d) ⇒ <code>string</code>
158
- Returns just the date portion as YYYY-MM-DD
159
-
160
- **Kind**: global function
161
-
162
- | Param | Type |
163
- | --- | --- |
164
- | d | <code>Date</code> |
165
-
166
- <a name="getEventCategories"></a>
167
-
168
- ## getEventCategories(ev) ⇒ <code>Array.&lt;string&gt;</code>
169
- Returns a category and subcategory name
170
-
171
- **Kind**: global function
172
-
173
- | Param | Type |
174
- | --- | --- |
175
- | ev | <code>Event</code> |
176
-
177
- <a name="renderTitleWithoutTime"></a>
178
-
179
- ## renderTitleWithoutTime(ev) ⇒ <code>string</code>
180
- Renders the event title in default locale, but strips off time
181
-
182
- **Kind**: global function
183
-
184
- | Param | Type |
185
- | --- | --- |
186
- | ev | <code>Event</code> |
187
-
188
- <a name="getCalendarTitle"></a>
189
-
190
- ## getCalendarTitle(events, options) ⇒ <code>string</code>
191
- Generates a title like "Hebcal 2020 Israel" or "Hebcal May 1993 Providence"
192
-
193
- **Kind**: global function
194
-
195
- | Param | Type |
196
- | --- | --- |
197
- | events | <code>Array.&lt;Event&gt;</code> |
198
- | options | <code>CalOptions</code> |
199
-
200
- <a name="getHolidayDescription"></a>
201
-
202
- ## getHolidayDescription(ev, [firstSentence]) ⇒ <code>string</code>
203
- Returns an English language description of the holiday
204
-
205
- **Kind**: global function
206
-
207
- | Param | Type | Default |
208
- | --- | --- | --- |
209
- | ev | <code>Event</code> | |
210
- | [firstSentence] | <code>boolean</code> | <code>false</code> |
211
-
212
- <a name="makeTorahMemoText"></a>
213
-
214
- ## makeTorahMemoText(ev, il) ⇒ <code>string</code>
215
- Makes mulit-line text that summarizes Torah & Haftarah
216
-
217
- **Kind**: global function
218
-
219
- | Param | Type |
220
- | --- | --- |
221
- | ev | <code>Event</code> |
222
- | il | <code>boolean</code> |
223
-
224
- <a name="appendIsraelAndTracking"></a>
225
-
226
- ## appendIsraelAndTracking(url, il, utmSource, utmMedium, utmCampaign) ⇒ <code>string</code>
227
- Appends utm_source and utm_medium parameters to a URL
228
-
229
- **Kind**: global function
230
-
231
- | Param | Type |
232
- | --- | --- |
233
- | url | <code>string</code> |
234
- | il | <code>boolean</code> |
235
- | utmSource | <code>string</code> |
236
- | utmMedium | <code>string</code> |
237
- | utmCampaign | <code>string</code> |
238
-
239
- <a name="eventToCsv"></a>
240
-
241
- ## eventToCsv(e, options) ⇒ <code>string</code>
242
- Renders an Event as a string
243
-
244
- **Kind**: global function
245
-
246
- | Param | Type |
247
- | --- | --- |
248
- | e | <code>Event</code> |
249
- | options | <code>CalOptions</code> |
250
-
251
- <a name="eventsToCsv"></a>
252
-
253
- ## eventsToCsv(events, options) ⇒ <code>string</code>
254
- **Kind**: global function
255
-
256
- | Param | Type |
257
- | --- | --- |
258
- | events | <code>Array.&lt;Event&gt;</code> |
259
- | options | <code>HebcalOptions</code> |
260
-
261
- <a name="eventsToClassicApi"></a>
262
-
263
- ## eventsToClassicApi(events, options, [leyning]) ⇒ <code>Object</code>
264
- Formats a list events for the classic Hebcal.com JSON API response
265
-
266
- **Kind**: global function
267
-
268
- | Param | Type | Default |
269
- | --- | --- | --- |
270
- | events | <code>Array.&lt;Event&gt;</code> | |
271
- | options | <code>CalOptions</code> | |
272
- | [leyning] | <code>boolean</code> | <code>true</code> |
273
-
274
- <a name="eventToClassicApiObject"></a>
275
-
276
- ## eventToClassicApiObject(ev, options, [leyning]) ⇒ <code>Object</code>
277
- Converts a Hebcal event to a classic Hebcal.com JSON API object
278
-
279
- **Kind**: global function
280
-
281
- | Param | Type | Default |
282
- | --- | --- | --- |
283
- | ev | <code>Event</code> | |
284
- | options | <code>CalOptions</code> | |
285
- | [leyning] | <code>boolean</code> | <code>true</code> |
286
-
287
- <a name="formatAliyot"></a>
288
-
289
- ## formatAliyot(result, aliyot) ⇒ <code>Object</code>
290
- **Kind**: global function
291
-
292
- | Param | Type |
293
- | --- | --- |
294
- | result | <code>Object</code> |
295
- | aliyot | <code>Object</code> |
296
-
297
- <a name="formatLeyningResult"></a>
298
-
299
- ## formatLeyningResult(reading) ⇒ <code>Object</code>
300
- **Kind**: global function
301
-
302
- | Param | Type |
303
- | --- | --- |
304
- | reading | <code>Leyning</code> |
305
-
306
- <a name="eventsToRss2"></a>
307
-
308
- ## eventsToRss2(events, options) ⇒ <code>string</code>
309
- **Kind**: global function
310
-
311
- | Param | Type |
312
- | --- | --- |
313
- | events | <code>Array.&lt;Event&gt;</code> |
314
- | options | <code>CalOptions</code> |
315
-
316
- <a name="eventToRssItem2"></a>
317
-
318
- ## eventToRssItem2(ev, options) ⇒ <code>string</code>
319
- **Kind**: global function
320
-
321
- | Param | Type |
322
- | --- | --- |
323
- | ev | <code>Event</code> |
324
- | options | <code>CalOptions</code> |
325
-
326
- <a name="eventToFullCalendar"></a>
327
-
328
- ## eventToFullCalendar(ev, tzid, il) ⇒ <code>Object</code>
329
- Converts a Hebcal event to a FullCalendar.io object
330
-
331
- **Kind**: global function
332
-
333
- | Param | Type | Description |
334
- | --- | --- | --- |
335
- | ev | <code>Event</code> | |
336
- | tzid | <code>string</code> | timeZone identifier |
337
- | il | <code>boolean</code> | true if Israel |
338
-
339
- <a name="LocationPlainObj"></a>
340
-
341
- ## LocationPlainObj : <code>Object</code>
342
- Location information
343
-
344
- **Kind**: global typedef
345
- **Properties**
346
-
347
- | Name | Type |
348
- | --- | --- |
349
- | title | <code>string</code> |
350
- | city | <code>string</code> |
351
- | tzid | <code>string</code> |
352
- | latitude | <code>number</code> |
353
- | longitude | <code>number</code> |
354
- | cc | <code>string</code> |
355
- | country | <code>string</code> |
356
- | admin1 | <code>string</code> |
357
- | asciiname | <code>string</code> |
358
- | geo | <code>string</code> |
359
- | zip | <code>string</code> |
360
- | state | <code>string</code> |
361
- | stateName | <code>string</code> |
362
- | geonameid | <code>number</code> |
363
-
32
+ ## [API Documentation](https://hebcal.github.io/api/rest-api/index.html)