@hebcal/rest-api 7.0.0 → 7.1.0
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/dist/esm/classic-rest-api.d.ts +53 -2
- package/dist/esm/classic-rest-api.js +20 -2
- package/dist/esm/classic-rest-api.js.map +1 -1
- package/dist/esm/common.d.ts +80 -12
- package/dist/esm/common.js +25 -18
- package/dist/esm/common.js.map +1 -1
- package/dist/esm/csv.d.ts +21 -2
- package/dist/esm/csv.js +16 -2
- package/dist/esm/csv.js.map +1 -1
- package/dist/esm/holiday.d.ts +7 -0
- package/dist/esm/holiday.js +7 -0
- package/dist/esm/holiday.js.map +1 -1
- package/dist/esm/location.d.ts +27 -2
- package/dist/esm/location.js +10 -1
- package/dist/esm/location.js.map +1 -1
- package/dist/esm/url.d.ts +24 -1
- package/dist/esm/url.js +24 -1
- package/dist/esm/url.js.map +1 -1
- package/package.json +2 -2
|
@@ -3,17 +3,32 @@ import { TachanunResult } from '@hebcal/core/dist/esm/tachanun';
|
|
|
3
3
|
import { StringMap } from '@hebcal/leyning/dist/esm/types';
|
|
4
4
|
import { RestApiOptions } from './common.js';
|
|
5
5
|
import type { LocationPlainObj } from './location.js';
|
|
6
|
+
/**
|
|
7
|
+
* A single event as rendered for the classic Hebcal.com JSON API, as
|
|
8
|
+
* produced by `eventToClassicApiObject()`
|
|
9
|
+
*/
|
|
6
10
|
export type ClassicApiItem = {
|
|
11
|
+
/** rendered event title, e.g. `'Rosh Hashana'` or `'Candle lighting: 7:14pm'` */
|
|
7
12
|
title: string;
|
|
13
|
+
/** ISO 8601 date (or date+time, for timed events) */
|
|
8
14
|
date: string;
|
|
15
|
+
/** Hebrew date rendered as a string, omitted for timed events */
|
|
9
16
|
hdate?: string;
|
|
17
|
+
/** category, e.g. `'holiday'`, `'roshchodesh'`, `'candles'` (see `getEventCategories()`) */
|
|
10
18
|
category: string;
|
|
19
|
+
/** subcategory, e.g. `'major'`, `'minor'` */
|
|
11
20
|
subcat?: string;
|
|
21
|
+
/** `true` if this is a Yom Tov holiday */
|
|
12
22
|
yomtov?: boolean;
|
|
23
|
+
/** original (non-brief) event description, present when it differs from `title` */
|
|
13
24
|
title_orig?: string;
|
|
25
|
+
/** Hebrew rendering of the title (`he-x-NoNikud` locale, no vowel points) */
|
|
14
26
|
hebrew?: string;
|
|
27
|
+
/** Torah/Haftarah readings, when applicable */
|
|
15
28
|
leyning?: StringMap;
|
|
29
|
+
/** URL with tracking parameters appended, for events that have one (see `appendIsraelAndTracking()`) */
|
|
16
30
|
link?: string;
|
|
31
|
+
/** Sefirat HaOmer count details, present only for Omer-count events */
|
|
17
32
|
omer?: {
|
|
18
33
|
count: {
|
|
19
34
|
he: string;
|
|
@@ -28,6 +43,7 @@ export type ClassicApiItem = {
|
|
|
28
43
|
lamnatzeachWord: string;
|
|
29
44
|
lamnatzeachLetter: string;
|
|
30
45
|
};
|
|
46
|
+
/** Molad (new moon) details, present only for Molad announcement events */
|
|
31
47
|
molad?: {
|
|
32
48
|
hy: number;
|
|
33
49
|
hm: string;
|
|
@@ -37,32 +53,67 @@ export type ClassicApiItem = {
|
|
|
37
53
|
chalakim: number;
|
|
38
54
|
instant: string;
|
|
39
55
|
};
|
|
56
|
+
/**
|
|
57
|
+
* Hebrew date broken into gematriya-rendered parts, present when
|
|
58
|
+
* `RestApiEventOptions.heDateParts` is set (or the event itself is a
|
|
59
|
+
* Hebrew-date event)
|
|
60
|
+
*/
|
|
40
61
|
heDateParts?: {
|
|
41
62
|
y: string;
|
|
42
63
|
m: string;
|
|
43
64
|
d: string;
|
|
44
65
|
};
|
|
66
|
+
/** holiday description or linked-event text, when available */
|
|
45
67
|
memo?: string;
|
|
68
|
+
/** the underlying `Event` object, present only when `RestApiEventOptions.includeEvent` is set */
|
|
46
69
|
ev?: Event;
|
|
47
70
|
};
|
|
71
|
+
/**
|
|
72
|
+
* The classic Hebcal.com JSON API response envelope, as produced by
|
|
73
|
+
* `eventsToClassicApiHeader()` and `eventsToClassicApi()`
|
|
74
|
+
*/
|
|
48
75
|
export type ClassicApiResult = {
|
|
76
|
+
/** calendar title, see `getCalendarTitle()` */
|
|
49
77
|
title: string;
|
|
78
|
+
/** ISO 8601 timestamp of when this response was generated */
|
|
50
79
|
date: string;
|
|
80
|
+
/** `@hebcal/core` package version */
|
|
51
81
|
version: string;
|
|
52
82
|
location: LocationPlainObj;
|
|
83
|
+
/** whether Tachanun is recited, present when `RestApiEventOptions.tachanun` is set and the range is a single day */
|
|
53
84
|
tachanun?: TachanunResult;
|
|
85
|
+
/** ISO 8601 start/end dates spanned by `items` */
|
|
54
86
|
range?: {
|
|
55
87
|
start: string;
|
|
56
88
|
end: string;
|
|
57
89
|
};
|
|
90
|
+
/** the events, present when generated via `eventsToClassicApi()` */
|
|
58
91
|
items?: ClassicApiItem[];
|
|
59
92
|
};
|
|
60
93
|
/**
|
|
61
|
-
* Formats a list events for the classic Hebcal.com JSON API response
|
|
94
|
+
* Formats a list of events for the classic Hebcal.com JSON API response,
|
|
95
|
+
* including both the header fields and the `items` array.
|
|
96
|
+
* @param events - the events to render
|
|
97
|
+
* @param options - controls title, location, tracking, and per-item rendering
|
|
98
|
+
* @param leyning - `false` to omit Torah/Haftarah readings from each item
|
|
99
|
+
* @returns the full classic API response object
|
|
62
100
|
*/
|
|
63
101
|
export declare function eventsToClassicApi(events: Event[], options: RestApiOptions, leyning?: boolean): ClassicApiResult;
|
|
102
|
+
/**
|
|
103
|
+
* Builds just the header fields (title, date, version, location, range,
|
|
104
|
+
* tachanun) of the classic Hebcal.com JSON API response, without the
|
|
105
|
+
* `items` array.
|
|
106
|
+
* @param events - the events used to determine title and date range
|
|
107
|
+
* @param options - controls title, location, and tachanun rendering
|
|
108
|
+
* @returns the classic API response object, without `items`
|
|
109
|
+
*/
|
|
64
110
|
export declare function eventsToClassicApiHeader(events: Event[], options: RestApiOptions): ClassicApiResult;
|
|
65
111
|
/**
|
|
66
|
-
* Converts a Hebcal event to a classic Hebcal.com JSON API object
|
|
112
|
+
* Converts a single Hebcal event to a classic Hebcal.com JSON API object
|
|
113
|
+
* @param ev - the event to convert
|
|
114
|
+
* @param options - controls locale, tracking parameters, and which optional
|
|
115
|
+
* fields (`heDateParts`, `ev`) are included
|
|
116
|
+
* @param leyning - `false` to omit Torah/Haftarah readings
|
|
117
|
+
* @returns the rendered API item
|
|
67
118
|
*/
|
|
68
119
|
export declare function eventToClassicApiObject(ev: Event, options: RestApiOptions, leyning?: boolean): ClassicApiItem;
|
|
@@ -18,13 +18,26 @@ function eventIsoDate(ev) {
|
|
|
18
18
|
return isoDateString(ev.greg());
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
|
-
* Formats a list events for the classic Hebcal.com JSON API response
|
|
21
|
+
* Formats a list of events for the classic Hebcal.com JSON API response,
|
|
22
|
+
* including both the header fields and the `items` array.
|
|
23
|
+
* @param events - the events to render
|
|
24
|
+
* @param options - controls title, location, tracking, and per-item rendering
|
|
25
|
+
* @param leyning - `false` to omit Torah/Haftarah readings from each item
|
|
26
|
+
* @returns the full classic API response object
|
|
22
27
|
*/
|
|
23
28
|
export function eventsToClassicApi(events, options, leyning = true) {
|
|
24
29
|
const result = eventsToClassicApiHeader(events, options);
|
|
25
30
|
result.items = events.map(ev => eventToClassicApiObject(ev, options, leyning));
|
|
26
31
|
return result;
|
|
27
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Builds just the header fields (title, date, version, location, range,
|
|
35
|
+
* tachanun) of the classic Hebcal.com JSON API response, without the
|
|
36
|
+
* `items` array.
|
|
37
|
+
* @param events - the events used to determine title and date range
|
|
38
|
+
* @param options - controls title, location, and tachanun rendering
|
|
39
|
+
* @returns the classic API response object, without `items`
|
|
40
|
+
*/
|
|
28
41
|
export function eventsToClassicApiHeader(events, options) {
|
|
29
42
|
const result = {
|
|
30
43
|
title: getCalendarTitle(events, options),
|
|
@@ -44,7 +57,12 @@ export function eventsToClassicApiHeader(events, options) {
|
|
|
44
57
|
return result;
|
|
45
58
|
}
|
|
46
59
|
/**
|
|
47
|
-
* Converts a Hebcal event to a classic Hebcal.com JSON API object
|
|
60
|
+
* Converts a single Hebcal event to a classic Hebcal.com JSON API object
|
|
61
|
+
* @param ev - the event to convert
|
|
62
|
+
* @param options - controls locale, tracking parameters, and which optional
|
|
63
|
+
* fields (`heDateParts`, `ev`) are included
|
|
64
|
+
* @param leyning - `false` to omit Torah/Haftarah readings
|
|
65
|
+
* @returns the rendered API item
|
|
48
66
|
*/
|
|
49
67
|
export function eventToClassicApiObject(ev, options, leyning = true) {
|
|
50
68
|
const timedEv = ev;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"classic-rest-api.js","sourceRoot":"","sources":["../../src/classic-rest-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAE,SAAS,EAAE,aAAa,EAAC,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAC,MAAM,EAAC,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAQ,KAAK,EAAC,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAC,OAAO,EAAC,MAAM,kCAAkC,CAAC;AACzD,OAAO,EAAC,MAAM,EAAC,MAAM,8BAA8B,CAAC;AAKpD,OAAO,EAAC,eAAe,EAAC,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAC,QAAQ,EAAC,MAAM,gCAAgC,CAAC;AAExD,OAAO,EAAC,oBAAoB,EAAC,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAC,2BAA2B,EAAC,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EAAC,oBAAoB,EAAC,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAC,oBAAoB,EAAC,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAEL,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAC,uBAAuB,EAAC,MAAM,UAAU,CAAC;AACjD,OAAO,EAAC,kBAAkB,EAAC,M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C5C,CAAC;IACD,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;QACrB,MAAM,CAAC,kBAAkB,IAAI,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC;IACxD,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAClB,MAAM,CAAC,eAAe,IAAI,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;IAClD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,mBAAmB,CAAC,OAAgB;IAC3C,MAAM,MAAM,GAAc,EAAE,CAAC;IAC7B,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC;IACjC,CAAC;IACD,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;IACpC,CAAC;IACD,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;QACtB,MAAM,CAAC,kBAAkB,GAAG,OAAO,CAAC,SAAS,CAAC;IAChD,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACnB,MAAM,CAAC,eAAe,GAAG,oBAAoB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAChE,CAAC;IACD,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;QACvB,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAC3C,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACnB,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/esm/common.d.ts
CHANGED
|
@@ -1,43 +1,111 @@
|
|
|
1
1
|
import { Event } from '@hebcal/core/dist/esm/event';
|
|
2
2
|
import { CalOptions } from '@hebcal/core/dist/esm/CalOptions';
|
|
3
|
+
/**
|
|
4
|
+
* A simple string-to-string dictionary
|
|
5
|
+
*/
|
|
3
6
|
export type StringMap = Record<string, string>;
|
|
7
|
+
/**
|
|
8
|
+
* Options specific to rendering events for the REST API, as opposed to
|
|
9
|
+
* options in `CalOptions` that control which events are generated
|
|
10
|
+
*/
|
|
4
11
|
export type RestApiEventOptions = {
|
|
12
|
+
/**
|
|
13
|
+
* value for the `utm_source` (or hebcal.com-internal `us`) tracking
|
|
14
|
+
* parameter appended to event links
|
|
15
|
+
*/
|
|
5
16
|
utmSource?: string;
|
|
17
|
+
/**
|
|
18
|
+
* value for the `utm_medium` (or hebcal.com-internal `um`) tracking
|
|
19
|
+
* parameter appended to event links (default `'api'`)
|
|
20
|
+
*/
|
|
6
21
|
utmMedium?: string;
|
|
22
|
+
/**
|
|
23
|
+
* value for the `utm_campaign` (or hebcal.com-internal `uc`) tracking
|
|
24
|
+
* parameter appended to event links
|
|
25
|
+
*/
|
|
7
26
|
utmCampaign?: string;
|
|
27
|
+
/**
|
|
28
|
+
* include a `tachanun` field in the classic API response describing
|
|
29
|
+
* whether Tachanun is recited (only applies when the result covers a
|
|
30
|
+
* single day)
|
|
31
|
+
*/
|
|
8
32
|
tachanun?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* append the Hebrew rendering of the event title to the CSV subject line
|
|
35
|
+
*/
|
|
9
36
|
appendHebrewToSubject?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* `true` if this calendar is a Yahrzeit/Anniversary calendar; changes the
|
|
39
|
+
* generated calendar title
|
|
40
|
+
*/
|
|
10
41
|
yahrzeit?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* `true`, `'1'`, or `1` marks this calendar as a recurring subscription
|
|
44
|
+
* (e.g. a webcal feed); suppresses the year from the generated calendar
|
|
45
|
+
* title since the feed is perpetually up to date
|
|
46
|
+
*/
|
|
11
47
|
subscribe?: string | number | boolean;
|
|
48
|
+
/**
|
|
49
|
+
* include a `heDateParts` field (Hebrew year/month/day rendered with
|
|
50
|
+
* `gematriya`) on each classic API event
|
|
51
|
+
*/
|
|
12
52
|
heDateParts?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* include the underlying `Event` object as the `ev` field on each
|
|
55
|
+
* classic API event
|
|
56
|
+
*/
|
|
13
57
|
includeEvent?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* render CSV dates as `DD/MM/YYYY` (European order) instead of the
|
|
60
|
+
* default `MM/DD/YYYY`
|
|
61
|
+
*/
|
|
14
62
|
euro?: boolean;
|
|
15
|
-
|
|
16
|
-
|
|
63
|
+
/**
|
|
64
|
+
* prefer a location's ASCII name over its short display name when
|
|
65
|
+
* generating a calendar title or download filename
|
|
66
|
+
*/
|
|
17
67
|
preferAsciiName?: boolean;
|
|
18
68
|
};
|
|
19
|
-
export type RestApiOptions = CalOptions & RestApiEventOptions;
|
|
20
|
-
export declare function getDownloadFilename(options: RestApiOptions): string;
|
|
21
69
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
70
|
+
* Combines `@hebcal/core`'s `CalOptions` (which control which events are
|
|
71
|
+
* generated) with `RestApiEventOptions` (which control how events are
|
|
72
|
+
* rendered by this package)
|
|
24
73
|
*/
|
|
25
|
-
export
|
|
74
|
+
export type RestApiOptions = CalOptions & RestApiEventOptions;
|
|
26
75
|
/**
|
|
27
|
-
*
|
|
76
|
+
* Generates a base filename (without extension) for a calendar download,
|
|
77
|
+
* incorporating the year, date range, and/or location as available.
|
|
78
|
+
* @param options - the year/date-range/location used to construct the
|
|
79
|
+
* filename; typically the same options passed to the calendar generator
|
|
80
|
+
* @returns a filename like `hebcal_2020` or `hebcal_1993_providence`
|
|
28
81
|
*/
|
|
29
|
-
export declare function
|
|
82
|
+
export declare function getDownloadFilename(options: RestApiOptions): string;
|
|
30
83
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
84
|
+
* Returns a category and subcategory name for an event, e.g.
|
|
85
|
+
* `['holiday', 'major']` or `['roshchodesh']`.
|
|
86
|
+
* @param ev - the event to categorize
|
|
87
|
+
* @returns an array of 1 or 2 category strings
|
|
33
88
|
*/
|
|
34
|
-
export declare function
|
|
89
|
+
export declare function getEventCategories(ev: Event): string[];
|
|
35
90
|
/**
|
|
36
91
|
* Generates a title like "Hebcal 2020 Israel" or "Hebcal May 1993 Providence"
|
|
92
|
+
* @param events - the events in the calendar, used to determine the date
|
|
93
|
+
* range shown in the title
|
|
94
|
+
* @param options - controls location name, `il`/Diaspora, and whether this
|
|
95
|
+
* is a Yahrzeit calendar or a subscription (see `RestApiEventOptions`)
|
|
96
|
+
* @returns the generated calendar title
|
|
37
97
|
*/
|
|
38
98
|
export declare function getCalendarTitle(events: Event[], options: RestApiOptions): string;
|
|
39
99
|
/**
|
|
40
100
|
* Bitmask for learning events (Daf Yomi, Nach Yomi, Mishna Yomi, Daily Learning, Yerushalmi Yomi)
|
|
41
101
|
*/
|
|
42
102
|
export declare const LEARNING_MASK: number;
|
|
103
|
+
/**
|
|
104
|
+
* Determines whether an event's title should be rendered with `Event.renderBrief()`
|
|
105
|
+
* instead of `Event.render()` — for example timed events, non-1st-of-month
|
|
106
|
+
* Hebrew date events, learning-schedule events, Shabbat Mevarchim, and Yom
|
|
107
|
+
* Kippur Katan.
|
|
108
|
+
* @param ev - the event to check
|
|
109
|
+
* @returns `true` if the brief rendering should be used
|
|
110
|
+
*/
|
|
43
111
|
export declare function shouldRenderBrief(ev: Event): boolean;
|
package/dist/esm/common.js
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { flags } from '@hebcal/core/dist/esm/event';
|
|
2
|
-
import { HDate
|
|
2
|
+
import { HDate } from '@hebcal/hdate';
|
|
3
3
|
import { makeAnchor } from './makeAnchor.js';
|
|
4
|
+
/**
|
|
5
|
+
* Generates a base filename (without extension) for a calendar download,
|
|
6
|
+
* incorporating the year, date range, and/or location as available.
|
|
7
|
+
* @param options - the year/date-range/location used to construct the
|
|
8
|
+
* filename; typically the same options passed to the calendar generator
|
|
9
|
+
* @returns a filename like `hebcal_2020` or `hebcal_1993_providence`
|
|
10
|
+
*/
|
|
4
11
|
export function getDownloadFilename(options) {
|
|
5
12
|
let fileName = 'hebcal';
|
|
6
13
|
if (options.year) {
|
|
@@ -35,14 +42,10 @@ export function getDownloadFilename(options) {
|
|
|
35
42
|
return fileName;
|
|
36
43
|
}
|
|
37
44
|
/**
|
|
38
|
-
* Returns
|
|
39
|
-
*
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return isoDateString(d);
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Returns a category and subcategory name
|
|
45
|
+
* Returns a category and subcategory name for an event, e.g.
|
|
46
|
+
* `['holiday', 'major']` or `['roshchodesh']`.
|
|
47
|
+
* @param ev - the event to categorize
|
|
48
|
+
* @returns an array of 1 or 2 category strings
|
|
46
49
|
*/
|
|
47
50
|
export function getEventCategories(ev) {
|
|
48
51
|
const s = ev.getDesc();
|
|
@@ -51,15 +54,6 @@ export function getEventCategories(ev) {
|
|
|
51
54
|
}
|
|
52
55
|
return ev.getCategories();
|
|
53
56
|
}
|
|
54
|
-
/**
|
|
55
|
-
* Renders the event title in default locale, but strips off time
|
|
56
|
-
* @deprecated
|
|
57
|
-
*/
|
|
58
|
-
export function renderTitleWithoutTime(ev, locale) {
|
|
59
|
-
return ev.eventTime === undefined
|
|
60
|
-
? ev.render(locale)
|
|
61
|
-
: ev.renderBrief(locale);
|
|
62
|
-
}
|
|
63
57
|
function shortLocationName(options) {
|
|
64
58
|
const loc = options.location;
|
|
65
59
|
if (!loc) {
|
|
@@ -75,6 +69,11 @@ function shortLocationName(options) {
|
|
|
75
69
|
}
|
|
76
70
|
/**
|
|
77
71
|
* Generates a title like "Hebcal 2020 Israel" or "Hebcal May 1993 Providence"
|
|
72
|
+
* @param events - the events in the calendar, used to determine the date
|
|
73
|
+
* range shown in the title
|
|
74
|
+
* @param options - controls location name, `il`/Diaspora, and whether this
|
|
75
|
+
* is a Yahrzeit calendar or a subscription (see `RestApiEventOptions`)
|
|
76
|
+
* @returns the generated calendar title
|
|
78
77
|
*/
|
|
79
78
|
export function getCalendarTitle(events, options) {
|
|
80
79
|
let title = 'Hebcal';
|
|
@@ -123,6 +122,14 @@ export const LEARNING_MASK = flags.DAF_YOMI |
|
|
|
123
122
|
flags.MISHNA_YOMI |
|
|
124
123
|
flags.DAILY_LEARNING |
|
|
125
124
|
flags.YERUSHALMI_YOMI;
|
|
125
|
+
/**
|
|
126
|
+
* Determines whether an event's title should be rendered with `Event.renderBrief()`
|
|
127
|
+
* instead of `Event.render()` — for example timed events, non-1st-of-month
|
|
128
|
+
* Hebrew date events, learning-schedule events, Shabbat Mevarchim, and Yom
|
|
129
|
+
* Kippur Katan.
|
|
130
|
+
* @param ev - the event to check
|
|
131
|
+
* @returns `true` if the brief rendering should be used
|
|
132
|
+
*/
|
|
126
133
|
export function shouldRenderBrief(ev) {
|
|
127
134
|
if (ev.eventTime !== undefined) {
|
|
128
135
|
return true;
|
package/dist/esm/common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,EAAC,MAAM,6BAA6B,CAAC;AAGzD,OAAO,EAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,EAAC,MAAM,6BAA6B,CAAC;AAGzD,OAAO,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AACpC,OAAO,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAC;AA8E3C;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAuB;IACzD,IAAI,QAAQ,GAAG,QAAQ,CAAC;IACxB,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,QAAQ,IAAI,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;QAC/B,IAAI,OAAO,CAAC,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;IACd,KAAK,CAAC,SAAS;IACf,KAAK,CAAC,WAAW;IACjB,KAAK,CAAC,cAAc;IACpB,KAAK,CAAC,eAAe,CAAC;AAExB;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAAS;IACzC,IAAK,EAAiB,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QAC/C,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,IAAI,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;IAC3B,IAAI,IAAI,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;QAC7B,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;QACxB,OAAO,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;SAAM,IAAI,IAAI,GAAG,CAAC,aAAa,GAAG,KAAK,CAAC,iBAAiB,CAAC,EAAE,CAAC;QAC5D,OAAO,IAAI,CAAC;IACd,CAAC;SAAM,IACL,IAAI,GAAG,KAAK,CAAC,UAAU;QACvB,EAAE,CAAC,OAAO,EAAE,CAAC,UAAU,CAAC,kBAAkB,CAAC,EAC3C,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;SAAM,CAAC;QACN,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/dist/esm/csv.d.ts
CHANGED
|
@@ -1,7 +1,26 @@
|
|
|
1
1
|
import { Event } from '@hebcal/core/dist/esm/event';
|
|
2
2
|
import { RestApiOptions } from './common.js';
|
|
3
|
+
/** Options for `eventToCsv()`, extending `RestApiOptions` with an override for the memo/description field. */
|
|
4
|
+
export type EventToCsvOptions = RestApiOptions & {
|
|
5
|
+
/** if specified, takes precedence over `ev.memo` */
|
|
6
|
+
memo?: string;
|
|
7
|
+
};
|
|
3
8
|
/**
|
|
4
|
-
* Renders
|
|
9
|
+
* Renders a single event as one line of Outlook-compatible CSV
|
|
10
|
+
* (no trailing newline).
|
|
11
|
+
* @param ev - the event to render
|
|
12
|
+
* @param options - controls locale, date format (`euro`), whether to
|
|
13
|
+
* append the Hebrew title (`appendHebrewToSubject`), and an optional
|
|
14
|
+
* `memo` that takes precedence over `ev.memo`
|
|
15
|
+
* @returns a CSV row: subject, start/end date/time, all-day flag,
|
|
16
|
+
* description, "show time as", and location
|
|
17
|
+
*/
|
|
18
|
+
export declare function eventToCsv(ev: Event, options: EventToCsvOptions): string;
|
|
19
|
+
/**
|
|
20
|
+
* Renders a list of events as an Outlook-compatible CSV document, including
|
|
21
|
+
* the header row and a trailing CRLF.
|
|
22
|
+
* @param events - the events to render
|
|
23
|
+
* @param options - see `eventToCsv()`
|
|
24
|
+
* @returns the full CSV document, using CRLF line endings
|
|
5
25
|
*/
|
|
6
|
-
export declare function eventToCsv(ev: Event, options: RestApiOptions): string;
|
|
7
26
|
export declare function eventsToCsv(events: Event[], options: RestApiOptions): string;
|
package/dist/esm/csv.js
CHANGED
|
@@ -19,7 +19,14 @@ const CATEGORY = {
|
|
|
19
19
|
zmanim: '',
|
|
20
20
|
};
|
|
21
21
|
/**
|
|
22
|
-
* Renders
|
|
22
|
+
* Renders a single event as one line of Outlook-compatible CSV
|
|
23
|
+
* (no trailing newline).
|
|
24
|
+
* @param ev - the event to render
|
|
25
|
+
* @param options - controls locale, date format (`euro`), whether to
|
|
26
|
+
* append the Hebrew title (`appendHebrewToSubject`), and an optional
|
|
27
|
+
* `memo` that takes precedence over `ev.memo`
|
|
28
|
+
* @returns a CSV row: subject, start/end date/time, all-day flag,
|
|
29
|
+
* description, "show time as", and location
|
|
23
30
|
*/
|
|
24
31
|
export function eventToCsv(ev, options) {
|
|
25
32
|
const d = ev.greg();
|
|
@@ -69,7 +76,7 @@ export function eventToCsv(ev, options) {
|
|
|
69
76
|
subj += ` / ${hebrew}`;
|
|
70
77
|
}
|
|
71
78
|
}
|
|
72
|
-
let memo0 = ev.memo || getHolidayDescription(ev, true, options.locale);
|
|
79
|
+
let memo0 = options.memo || ev.memo || getHolidayDescription(ev, true, options.locale);
|
|
73
80
|
if (!memo0 && timedEv.linkedEvent !== undefined) {
|
|
74
81
|
memo0 = timedEv.linkedEvent.render(options.locale);
|
|
75
82
|
}
|
|
@@ -81,6 +88,13 @@ export function eventToCsv(ev, options) {
|
|
|
81
88
|
const showTimeAs = timed || isChag ? 4 : 3;
|
|
82
89
|
return `"${subj}",${date},${startTime},${endDate},${endTime},${allDay},"${memo}","${showTimeAs}","${loc}"`;
|
|
83
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Renders a list of events as an Outlook-compatible CSV document, including
|
|
93
|
+
* the header row and a trailing CRLF.
|
|
94
|
+
* @param events - the events to render
|
|
95
|
+
* @param options - see `eventToCsv()`
|
|
96
|
+
* @returns the full CSV document, using CRLF line endings
|
|
97
|
+
*/
|
|
84
98
|
export function eventsToCsv(events, options) {
|
|
85
99
|
return ([csvHeader].concat(events.map(ev => eventToCsv(ev, options))).join('\r\n') +
|
|
86
100
|
'\r\n');
|
package/dist/esm/csv.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"csv.js","sourceRoot":"","sources":["../../src/csv.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,EAAC,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAC,eAAe,EAAC,MAAM,uCAAuC,CAAC;AAEtE,OAAO,EAGL,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAC,qBAAqB,EAAC,MAAM,cAAc,CAAC;AAEnD,MAAM,SAAS,GACb,mHAAmH,CAAC;AAEtH,MAAM,QAAQ,GAAc;IAC1B,OAAO,EAAE,UAAU;IACnB,UAAU,EAAE,aAAa;IACzB,QAAQ,EAAE,WAAW;IACrB,UAAU,EAAE,iBAAiB;IAC7B,OAAO,EAAE,aAAa;IACtB,OAAO,EAAE,iBAAiB;IAC1B,SAAS,EAAE,EAAE;IACb,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,EAAE;IACR,QAAQ,E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UAAU,MAAM,GAAG,GAAG,CAAC;AAC7G,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,MAAe,EAAE,OAAuB;IAClE,OAAO,CACL,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;QAC1E,MAAM,CACP,CAAC;AACJ,CAAC"}
|
package/dist/esm/holiday.d.ts
CHANGED
|
@@ -2,5 +2,12 @@ import { Event } from '@hebcal/core/dist/esm/event';
|
|
|
2
2
|
/**
|
|
3
3
|
* Returns a description of the holiday. Uses the English description by
|
|
4
4
|
* default, or the Hebrew description when `locale` is a Hebrew locale.
|
|
5
|
+
* Returns an empty string if no description is available.
|
|
6
|
+
* @param ev - the holiday event to describe
|
|
7
|
+
* @param firstSentence - `true` to truncate the description at the first
|
|
8
|
+
* sentence (up to and excluding the first `.`)
|
|
9
|
+
* @param locale - the locale to render the description in; Hebrew locales
|
|
10
|
+
* (e.g. `'he'`) get the Hebrew description, everything else gets English
|
|
11
|
+
* @returns the holiday description, or `''` if none is found
|
|
5
12
|
*/
|
|
6
13
|
export declare function getHolidayDescription(ev: Event, firstSentence?: boolean, locale?: string): string;
|
package/dist/esm/holiday.js
CHANGED
|
@@ -11,6 +11,13 @@ Locale.addTranslations('he', poHe);
|
|
|
11
11
|
/**
|
|
12
12
|
* Returns a description of the holiday. Uses the English description by
|
|
13
13
|
* default, or the Hebrew description when `locale` is a Hebrew locale.
|
|
14
|
+
* Returns an empty string if no description is available.
|
|
15
|
+
* @param ev - the holiday event to describe
|
|
16
|
+
* @param firstSentence - `true` to truncate the description at the first
|
|
17
|
+
* sentence (up to and excluding the first `.`)
|
|
18
|
+
* @param locale - the locale to render the description in; Hebrew locales
|
|
19
|
+
* (e.g. `'he'`) get the Hebrew description, everything else gets English
|
|
20
|
+
* @returns the holiday description, or `''` if none is found
|
|
14
21
|
*/
|
|
15
22
|
export function getHolidayDescription(ev, firstSentence = false, locale) {
|
|
16
23
|
const localeName = Locale.isHebrewLocale(locale) ? 'he' : 'en';
|
package/dist/esm/holiday.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"holiday.js","sourceRoot":"","sources":["../../src/holiday.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,EAAC,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AACrC,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,IAAI,MAAM,YAAY,CAAC;AAE9B,qEAAqE;AACrE,uEAAuE;AACvE,sDAAsD;AACtD,MAAM,WAAW,GAAG,OAAO,CAAC;AAE5B,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACnC,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAEnC
|
|
1
|
+
{"version":3,"file":"holiday.js","sourceRoot":"","sources":["../../src/holiday.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,EAAC,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AACrC,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,IAAI,MAAM,YAAY,CAAC;AAE9B,qEAAqE;AACrE,uEAAuE;AACvE,sDAAsD;AACtD,MAAM,WAAW,GAAG,OAAO,CAAC;AAE5B,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACnC,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAEnC;;;;;;;;;;GAUG;AACH,MAAM,UAAU,qBAAqB,CACnC,EAAS,EACT,aAAa,GAAG,KAAK,EACrB,MAAe;IAEf,MAAM,UAAU,GAAG,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IAC/D,MAAM,GAAG,GACP,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,CAAC,iBAAiB;QACrC,CAAC,CAAC,2BAA2B;QAC7B,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC;IACnB,MAAM,IAAI,GACR,MAAM,CAAC,iBAAiB,CAAC,WAAW,GAAG,GAAG,EAAE,UAAU,CAAC;QACvD,MAAM,CAAC,iBAAiB,CAAC,WAAW,GAAG,EAAE,CAAC,QAAQ,EAAE,EAAE,UAAU,CAAC;QACjE,EAAE,CAAC;IACL,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;IAC7B,IAAI,aAAa,IAAI,GAAG,EAAE,CAAC;QACzB,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC7B,IAAI,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC;YACf,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/esm/location.d.ts
CHANGED
|
@@ -1,26 +1,51 @@
|
|
|
1
1
|
import { Location } from '@hebcal/core/dist/esm/location';
|
|
2
2
|
import type { StringMap } from './common.js';
|
|
3
|
+
/**
|
|
4
|
+
* Maps a 2-letter ISO 3166 country code (e.g. `'FR'`) to its English name
|
|
5
|
+
* (e.g. `'France'`)
|
|
6
|
+
*/
|
|
3
7
|
export declare const countryNames: StringMap;
|
|
4
8
|
/**
|
|
5
|
-
* Location
|
|
9
|
+
* JSON-serializable representation of a `@hebcal/core` `Location`, as
|
|
10
|
+
* returned by `locationToPlainObj()`. When `locationToPlainObj()` is
|
|
11
|
+
* called without a location, only `geo: 'none'` is set.
|
|
6
12
|
*/
|
|
7
13
|
export type LocationPlainObj = {
|
|
14
|
+
/** display name, e.g. `'Providence, RI'` */
|
|
8
15
|
title?: string | null;
|
|
16
|
+
/** short city name, e.g. `'Providence'` */
|
|
9
17
|
city?: string | null;
|
|
18
|
+
/** Olson timezone ID, e.g. `'America/New_York'` */
|
|
10
19
|
tzid?: string;
|
|
11
20
|
latitude?: number;
|
|
12
21
|
longitude?: number;
|
|
22
|
+
/** 2-letter ISO 3166 country code, e.g. `'US'` */
|
|
13
23
|
cc?: string;
|
|
24
|
+
/** English country name, e.g. `'United States'` */
|
|
14
25
|
country?: string;
|
|
26
|
+
/** elevation in meters, when known */
|
|
27
|
+
elevation?: number;
|
|
28
|
+
/** GeoNames admin1 code (roughly, US state or subnational region) */
|
|
15
29
|
admin1?: string;
|
|
30
|
+
/** ASCII-only spelling of the location name */
|
|
16
31
|
asciiname?: string;
|
|
32
|
+
/** geocoding method or source, e.g. `'zip'`, `'city'`, or `'none'` */
|
|
17
33
|
geo?: string;
|
|
34
|
+
/** US ZIP code, when the location was looked up by ZIP */
|
|
18
35
|
zip?: string;
|
|
36
|
+
/** 2-letter US state abbreviation */
|
|
19
37
|
state?: string;
|
|
38
|
+
/** full US state name */
|
|
20
39
|
stateName?: string;
|
|
40
|
+
/** GeoNames.org geonameid */
|
|
21
41
|
geonameid?: number;
|
|
22
42
|
};
|
|
23
43
|
/**
|
|
24
|
-
* Converts a
|
|
44
|
+
* Converts a `@hebcal/core` `Location` to a plain, JSON-serializable object.
|
|
45
|
+
* Some fields (e.g. `elevation`, `state`, `geonameid`) are only present when
|
|
46
|
+
* the `Location` was constructed with that extra metadata attached (as done
|
|
47
|
+
* by GeoNames-backed location lookups).
|
|
48
|
+
* @param location - the location to convert, or `undefined`
|
|
49
|
+
* @returns a plain object, or `{geo: 'none'}` if `location` is `undefined`
|
|
25
50
|
*/
|
|
26
51
|
export declare function locationToPlainObj(location: Location | undefined): LocationPlainObj;
|
package/dist/esm/location.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import countryNames0 from './countryNames.json.js';
|
|
2
|
+
/**
|
|
3
|
+
* Maps a 2-letter ISO 3166 country code (e.g. `'FR'`) to its English name
|
|
4
|
+
* (e.g. `'France'`)
|
|
5
|
+
*/
|
|
2
6
|
export const countryNames = countryNames0;
|
|
3
7
|
const LOC_FIELDS = [
|
|
4
8
|
'elevation',
|
|
@@ -11,7 +15,12 @@ const LOC_FIELDS = [
|
|
|
11
15
|
'geonameid',
|
|
12
16
|
];
|
|
13
17
|
/**
|
|
14
|
-
* Converts a
|
|
18
|
+
* Converts a `@hebcal/core` `Location` to a plain, JSON-serializable object.
|
|
19
|
+
* Some fields (e.g. `elevation`, `state`, `geonameid`) are only present when
|
|
20
|
+
* the `Location` was constructed with that extra metadata attached (as done
|
|
21
|
+
* by GeoNames-backed location lookups).
|
|
22
|
+
* @param location - the location to convert, or `undefined`
|
|
23
|
+
* @returns a plain object, or `{geo: 'none'}` if `location` is `undefined`
|
|
15
24
|
*/
|
|
16
25
|
export function locationToPlainObj(location) {
|
|
17
26
|
if (typeof location === 'object' &&
|
package/dist/esm/location.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"location.js","sourceRoot":"","sources":["../../src/location.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,MAAM,wBAAwB,CAAC;AAEnD,MAAM,CAAC,MAAM,YAAY,GAAc,aAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"location.js","sourceRoot":"","sources":["../../src/location.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,MAAM,wBAAwB,CAAC;AAEnD;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAc,aAA0B,CAAC;AAsClE,MAAM,UAAU,GAAG;IACjB,WAAW;IACX,QAAQ;IACR,WAAW;IACX,KAAK;IACL,KAAK;IACL,OAAO;IACP,WAAW;IACX,WAAW;CACZ,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAChC,QAA8B;IAE9B,IACE,OAAO,QAAQ,KAAK,QAAQ;QAC5B,QAAQ,KAAK,IAAI;QACjB,OAAO,QAAQ,CAAC,WAAW,KAAK,UAAU,EAC1C,CAAC;QACD,MAAM,EAAE,GAAW,QAAQ,CAAC,cAAc,EAAG,CAAC;QAC9C,MAAM,CAAC,GAAqB;YAC1B,KAAK,EAAE,QAAQ,CAAC,OAAO,EAAE;YACzB,IAAI,EAAE,QAAQ,CAAC,YAAY,EAAE;YAC7B,IAAI,EAAE,QAAQ,CAAC,OAAO,EAAE;YACxB,QAAQ,EAAE,QAAQ,CAAC,WAAW,EAAE;YAChC,SAAS,EAAE,QAAQ,CAAC,YAAY,EAAE;YAClC,EAAE,EAAE,EAAE;YACN,OAAO,EAAE,YAAY,CAAC,EAAE,CAAC;SAC1B,CAAC;QACF,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC;YAC3B,MAAM,GAAG,GAAI,QAAgB,CAAC,CAAC,CAAC,CAAC;YACjC,IAAI,GAAG,EAAE,CAAC;gBACP,CAAS,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;YACtB,CAAC;QACH,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC;SAAM,CAAC;QACN,OAAO,EAAC,GAAG,EAAE,MAAM,EAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
|
package/dist/esm/url.d.ts
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rewrites a long-form `hebcal.com/sedrot/<parsha>-<YYYYMMDD>` URL in place
|
|
3
|
+
* to the short `hebcal.com/s/<year>[i]/<parsha-id>[d]` form, e.g.
|
|
4
|
+
* `/sedrot/bereshit-20201017` becomes `/s/5781/1`. Falls back to trimming
|
|
5
|
+
* the `/sedrot/` prefix to `/s/` if the path doesn't match the expected
|
|
6
|
+
* `<parsha>-<8-digit-date>` shape.
|
|
7
|
+
* @param u - the URL to rewrite; mutated in place via `u.pathname`
|
|
8
|
+
*/
|
|
1
9
|
export declare function shortenSedrotUrl(u: URL): void;
|
|
2
10
|
/**
|
|
3
|
-
*
|
|
11
|
+
* Adjusts a Hebcal.com event link for Israel/Diaspora and appends UTM
|
|
12
|
+
* tracking parameters. For `www.hebcal.com` holiday/sedrot/omer links, this
|
|
13
|
+
* also sets `i=on` when `il` is true, rewrites the host to the shorter
|
|
14
|
+
* `hebcal.com` and shortens the path (see `shortenSedrotUrl()` for sedrot),
|
|
15
|
+
* and uses the abbreviated `us`/`um`/`uc` parameter names instead of the
|
|
16
|
+
* full `utm_source`/`utm_medium`/`utm_campaign` (the `us`/`um` params are
|
|
17
|
+
* omitted when `utmCampaign` starts with `'ical-'` or `'pdf-'`, since those
|
|
18
|
+
* campaigns are tracked by `uc` alone). For all other URLs, the standard
|
|
19
|
+
* `utm_source`/`utm_medium`/`utm_campaign` parameters are appended, and
|
|
20
|
+
* `utm_source` defaults to `'hebcal.com'` when not otherwise specified.
|
|
21
|
+
* @param url - the event URL to rewrite
|
|
22
|
+
* @param il - `true` to mark the link as using the Israel holiday schedule
|
|
23
|
+
* @param utmSource - tracking source, e.g. `'js'`
|
|
24
|
+
* @param utmMedium - tracking medium, e.g. `'api'`
|
|
25
|
+
* @param utmCampaign - tracking campaign, e.g. `'ical-foo'`
|
|
26
|
+
* @returns the rewritten URL as a string
|
|
4
27
|
*/
|
|
5
28
|
export declare function appendIsraelAndTracking(url: string, il: boolean, utmSource?: string, utmMedium?: string, utmCampaign?: string): string;
|
package/dist/esm/url.js
CHANGED
|
@@ -36,6 +36,14 @@ function parse8digitDateStr(date) {
|
|
|
36
36
|
}
|
|
37
37
|
return dt;
|
|
38
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Rewrites a long-form `hebcal.com/sedrot/<parsha>-<YYYYMMDD>` URL in place
|
|
41
|
+
* to the short `hebcal.com/s/<year>[i]/<parsha-id>[d]` form, e.g.
|
|
42
|
+
* `/sedrot/bereshit-20201017` becomes `/s/5781/1`. Falls back to trimming
|
|
43
|
+
* the `/sedrot/` prefix to `/s/` if the path doesn't match the expected
|
|
44
|
+
* `<parsha>-<8-digit-date>` shape.
|
|
45
|
+
* @param u - the URL to rewrite; mutated in place via `u.pathname`
|
|
46
|
+
*/
|
|
39
47
|
export function shortenSedrotUrl(u) {
|
|
40
48
|
const path = u.pathname;
|
|
41
49
|
const dash = path.lastIndexOf('-');
|
|
@@ -62,7 +70,22 @@ export function shortenSedrotUrl(u) {
|
|
|
62
70
|
}
|
|
63
71
|
}
|
|
64
72
|
/**
|
|
65
|
-
*
|
|
73
|
+
* Adjusts a Hebcal.com event link for Israel/Diaspora and appends UTM
|
|
74
|
+
* tracking parameters. For `www.hebcal.com` holiday/sedrot/omer links, this
|
|
75
|
+
* also sets `i=on` when `il` is true, rewrites the host to the shorter
|
|
76
|
+
* `hebcal.com` and shortens the path (see `shortenSedrotUrl()` for sedrot),
|
|
77
|
+
* and uses the abbreviated `us`/`um`/`uc` parameter names instead of the
|
|
78
|
+
* full `utm_source`/`utm_medium`/`utm_campaign` (the `us`/`um` params are
|
|
79
|
+
* omitted when `utmCampaign` starts with `'ical-'` or `'pdf-'`, since those
|
|
80
|
+
* campaigns are tracked by `uc` alone). For all other URLs, the standard
|
|
81
|
+
* `utm_source`/`utm_medium`/`utm_campaign` parameters are appended, and
|
|
82
|
+
* `utm_source` defaults to `'hebcal.com'` when not otherwise specified.
|
|
83
|
+
* @param url - the event URL to rewrite
|
|
84
|
+
* @param il - `true` to mark the link as using the Israel holiday schedule
|
|
85
|
+
* @param utmSource - tracking source, e.g. `'js'`
|
|
86
|
+
* @param utmMedium - tracking medium, e.g. `'api'`
|
|
87
|
+
* @param utmCampaign - tracking campaign, e.g. `'ical-foo'`
|
|
88
|
+
* @returns the rewritten URL as a string
|
|
66
89
|
*/
|
|
67
90
|
export function appendIsraelAndTracking(url, il, utmSource, utmMedium, utmCampaign) {
|
|
68
91
|
const u = new URL(url);
|
package/dist/esm/url.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.js","sourceRoot":"","s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AC;YACH,CAAC;YACD,IAAI,WAAW,EAAE,CAAC;gBAChB,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;YACxC,CAAC;YACD,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC;QACtB,CAAC;IACH,CAAC;IACD,IAAI,CAAC,SAAS,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC5B,SAAS,GAAG,YAAY,CAAC,CAAC,6CAA6C;IACzE,CAAC;IACD,IAAI,SAAS,EAAE,CAAC;QACd,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IAC9C,CAAC;IACD,IAAI,SAAS,EAAE,CAAC;QACd,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IAC9C,CAAC;IACD,IAAI,WAAW,EAAE,CAAC;QAChB,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC;AACtB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hebcal/rest-api",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"author": "Michael J. Radwin (https://github.com/mjradwin)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hebcal"
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@hebcal/learning": "^6.9.5",
|
|
51
51
|
"@hebcal/locales": "^6.5.1",
|
|
52
|
-
"@types/node": "^26.1.
|
|
52
|
+
"@types/node": "^26.1.2",
|
|
53
53
|
"gettext-parser": "^9.1.1",
|
|
54
54
|
"oxlint": "^1.76.0",
|
|
55
55
|
"prettier": "^3.9.6",
|