@hebcal/rest-api 5.0.5 → 5.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/bundle.js +1276 -982
- package/dist/bundle.min.js +2 -2
- package/dist/classic-rest-api.d.ts +10 -0
- package/dist/common.d.ts +88 -0
- package/dist/countryNames.json.d.ts +203 -0
- package/dist/csv.d.ts +7 -0
- package/dist/fullcalendar.d.ts +5 -0
- package/dist/fullcalendar.js +638 -252
- package/dist/fullcalendar.min.js +2 -2
- package/dist/holidays.json.d.ts +70 -0
- package/dist/index.cjs +1276 -982
- package/dist/index.d.ts +6 -0
- package/dist/index.mjs +1277 -983
- package/dist/rss.d.ts +4 -0
- package/package.json +17 -13
- package/rest-api.d.ts +0 -95
package/dist/rss.d.ts
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hebcal/rest-api",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"author": "Michael J. Radwin (https://github.com/mjradwin)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hebcal"
|
|
@@ -15,12 +15,11 @@
|
|
|
15
15
|
"exports": {
|
|
16
16
|
"import": "./dist/index.mjs",
|
|
17
17
|
"require": "./dist/index.cjs",
|
|
18
|
-
"types": "./
|
|
18
|
+
"types": "./dist/index.d.ts"
|
|
19
19
|
},
|
|
20
|
-
"typings": "
|
|
20
|
+
"typings": "dist/index.d.ts",
|
|
21
21
|
"files": [
|
|
22
|
-
"dist"
|
|
23
|
-
"rest-api.d.ts"
|
|
22
|
+
"dist"
|
|
24
23
|
],
|
|
25
24
|
"repository": {
|
|
26
25
|
"type": "git",
|
|
@@ -30,31 +29,36 @@
|
|
|
30
29
|
"url": "https://github.com/hebcal/hebcal-rest-api/issues"
|
|
31
30
|
},
|
|
32
31
|
"dependencies": {
|
|
33
|
-
"@hebcal/core": "^5.4.
|
|
32
|
+
"@hebcal/core": "^5.4.5",
|
|
34
33
|
"@hebcal/leyning": "^8.1.9",
|
|
35
34
|
"@hebcal/triennial": "^5.0.5"
|
|
36
35
|
},
|
|
37
36
|
"scripts": {
|
|
38
37
|
"build:rollup": "rollup -c",
|
|
39
|
-
"build:json2js": "for f in src/*.json; do echo 'export default' > $f.
|
|
38
|
+
"build:json2js": "for f in src/*.json; do echo 'export default' > $f.ts && cat $f >> $f.ts; done",
|
|
40
39
|
"build": "npm run build:json2js && npm run build:rollup",
|
|
41
40
|
"prepublish": "npm run build",
|
|
42
41
|
"pretest": "npm run build",
|
|
43
42
|
"readme": "npx jsdoc2md dist/index.js",
|
|
44
|
-
"test": "
|
|
43
|
+
"test": "jest"
|
|
45
44
|
},
|
|
46
45
|
"license": "BSD-2-Clause",
|
|
47
46
|
"devDependencies": {
|
|
47
|
+
"@babel/preset-env": "^7.24.7",
|
|
48
|
+
"@babel/preset-typescript": "^7.24.7",
|
|
48
49
|
"@hebcal/learning": "^5.0.8",
|
|
49
|
-
"@rollup/plugin-commonjs": "^
|
|
50
|
+
"@rollup/plugin-commonjs": "^26.0.1",
|
|
50
51
|
"@rollup/plugin-json": "^6.1.0",
|
|
51
52
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
52
53
|
"@rollup/plugin-terser": "^0.4.4",
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
54
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
55
|
+
"@types/jest": "^29.5.12",
|
|
56
|
+
"gts": "^5.3.1",
|
|
57
|
+
"jest": "^29.7.0",
|
|
56
58
|
"jsdoc": "^4.0.3",
|
|
57
59
|
"jsdoc-to-markdown": "^8.0.1",
|
|
58
|
-
"rollup": "^4.18.0"
|
|
60
|
+
"rollup": "^4.18.0",
|
|
61
|
+
"ts-jest": "^29.1.5",
|
|
62
|
+
"typescript": "^5.5.3"
|
|
59
63
|
}
|
|
60
64
|
}
|
package/rest-api.d.ts
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/// <reference types="node"/>
|
|
2
|
-
|
|
3
|
-
import {Event, Location, CalOptions} from '@hebcal/core';
|
|
4
|
-
|
|
5
|
-
declare module '@hebcal/rest-api' {
|
|
6
|
-
/**
|
|
7
|
-
* Renders an Event as a string
|
|
8
|
-
*/
|
|
9
|
-
export function eventToCsv(e: Event, options: CalOptions): string;
|
|
10
|
-
export function eventsToCsv(events: Event[], options: CalOptions): string;
|
|
11
|
-
/**
|
|
12
|
-
* Formats a list events for the classic Hebcal.com JSON API response
|
|
13
|
-
*/
|
|
14
|
-
export function eventsToClassicApi(events: Event[], options: CalOptions, leyning?: boolean): any;
|
|
15
|
-
/**
|
|
16
|
-
* Converts a Hebcal event to a classic Hebcal.com JSON API object
|
|
17
|
-
*/
|
|
18
|
-
export function eventToClassicApiObject(ev: Event, options: CalOptions, leyning?: boolean): any;
|
|
19
|
-
/**
|
|
20
|
-
* Converts a Hebcal event to a FullCalendar.io object
|
|
21
|
-
* @param tzid - timeZone identifier
|
|
22
|
-
* @param il - true if Israel
|
|
23
|
-
*/
|
|
24
|
-
export function eventToFullCalendar(ev: Event, tzid: string, il: boolean): any;
|
|
25
|
-
/**
|
|
26
|
-
* Makes mulit-line text that summarizes Torah & Haftarah
|
|
27
|
-
*/
|
|
28
|
-
export function makeTorahMemoText(ev: Event, il: boolean): string;
|
|
29
|
-
/**
|
|
30
|
-
* Appends utm_source and utm_medium parameters to a URL
|
|
31
|
-
*/
|
|
32
|
-
export function appendIsraelAndTracking(url: string, il: boolean, utmSource: string, utmMedium: string, utmCampaign?: string): string;
|
|
33
|
-
/**
|
|
34
|
-
* @private
|
|
35
|
-
*/
|
|
36
|
-
export function shouldRenderBrief(ev: Event): boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Extends `CalOptions` with
|
|
39
|
-
* `lang` - language such as 'he' (default 'en-US')
|
|
40
|
-
* `evPubDate` - if true, use event time as pubDate (false uses lastBuildDate)
|
|
41
|
-
*/
|
|
42
|
-
export function eventsToRss2(events: Event[], options: CalOptions): string;
|
|
43
|
-
export function eventToRssItem2(ev: Event, options: CalOptions): string;
|
|
44
|
-
export function getDownloadFilename(options: CalOptions): string;
|
|
45
|
-
export function pad2(number: number): string;
|
|
46
|
-
export function pad4(number: number): string;
|
|
47
|
-
/**
|
|
48
|
-
* Helper function to transform a string to make it more usable in a URL or filename.
|
|
49
|
-
* Converts to lowercase and replaces non-word characters with hyphen ('-').
|
|
50
|
-
*/
|
|
51
|
-
export function makeAnchor(s: string): string;
|
|
52
|
-
/**
|
|
53
|
-
* Returns just the date portion as YYYY-MM-DD
|
|
54
|
-
*/
|
|
55
|
-
export function toISOString(d: Date): string;
|
|
56
|
-
/**
|
|
57
|
-
* Returns a category and subcategory name
|
|
58
|
-
*/
|
|
59
|
-
export function getEventCategories(ev: Event): string[];
|
|
60
|
-
/**
|
|
61
|
-
* Generates a title like "Hebcal 2020 Israel" or "Hebcal May 1993 Providence"
|
|
62
|
-
*/
|
|
63
|
-
export function getCalendarTitle(events: Event[], options: CalOptions): string;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Returns an English language description of the holiday
|
|
67
|
-
* @param [firstSentence=false]
|
|
68
|
-
*/
|
|
69
|
-
export function getHolidayDescription(ev: Event, firstSentence?: boolean): string;
|
|
70
|
-
|
|
71
|
-
export type LocationPlainObj = {
|
|
72
|
-
title: string;
|
|
73
|
-
city: string;
|
|
74
|
-
tzid: string;
|
|
75
|
-
latitude: number;
|
|
76
|
-
longitude: number;
|
|
77
|
-
cc: string;
|
|
78
|
-
country: string;
|
|
79
|
-
admin1?: string;
|
|
80
|
-
asciiname?: string;
|
|
81
|
-
geo?: string;
|
|
82
|
-
zip?: string;
|
|
83
|
-
state?: string;
|
|
84
|
-
stateName?: string;
|
|
85
|
-
geonameid?: number;
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
export function locationToPlainObj(location: Location): LocationPlainObj;
|
|
89
|
-
|
|
90
|
-
export interface StringMap {
|
|
91
|
-
[key: string]: string;
|
|
92
|
-
}
|
|
93
|
-
export const countryNames: StringMap;
|
|
94
|
-
export const holidayDescription: StringMap;
|
|
95
|
-
}
|