@hebcal/rest-api 5.0.5 → 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/dist/rss.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import { Event } from '@hebcal/core';
2
+ import { RestApiOptions } from './common';
3
+ export declare function eventsToRss2(events: Event[], options: RestApiOptions): string;
4
+ export declare function eventToRssItem2(ev: Event, options: RestApiOptions): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hebcal/rest-api",
3
- "version": "5.0.5",
3
+ "version": "5.1.1",
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": "./rest-api.d.ts"
18
+ "types": "./dist/index.d.ts"
19
19
  },
20
- "typings": "rest-api.d.ts",
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,35 @@
30
29
  "url": "https://github.com/hebcal/hebcal-rest-api/issues"
31
30
  },
32
31
  "dependencies": {
33
- "@hebcal/core": "^5.4.4",
34
- "@hebcal/leyning": "^8.1.9",
35
- "@hebcal/triennial": "^5.0.5"
32
+ "@hebcal/core": "^5.4.9",
33
+ "@hebcal/leyning": "^8.2.2",
34
+ "@hebcal/triennial": "^5.1.1"
36
35
  },
37
36
  "scripts": {
38
37
  "build:rollup": "rollup -c",
39
- "build:json2js": "for f in src/*.json; do echo 'export default' > $f.js && cat $f >> $f.js; done",
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
- "readme": "npx jsdoc2md dist/index.js",
44
- "test": "ava"
42
+ "docs": "typedoc",
43
+ "test": "jest"
45
44
  },
46
45
  "license": "BSD-2-Clause",
47
46
  "devDependencies": {
48
- "@hebcal/learning": "^5.0.8",
49
- "@rollup/plugin-commonjs": "^25.0.8",
47
+ "@babel/preset-env": "^7.24.7",
48
+ "@babel/preset-typescript": "^7.24.7",
49
+ "@hebcal/learning": "^5.1.1",
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
- "ava": "^6.1.3",
54
- "eslint": "^8.57.0",
55
- "eslint-config-google": "^0.14.0",
56
- "jsdoc": "^4.0.3",
57
- "jsdoc-to-markdown": "^8.0.1",
58
- "rollup": "^4.18.0"
54
+ "@rollup/plugin-typescript": "^11.1.6",
55
+ "@types/jest": "^29.5.12",
56
+ "gts": "^5.3.1",
57
+ "jest": "^29.7.0",
58
+ "rollup": "^4.18.1",
59
+ "ts-jest": "^29.2.0",
60
+ "typedoc": "^0.26.3",
61
+ "typescript": "^5.5.3"
59
62
  }
60
63
  }
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
- }