diff --git a/1.json b/1.json new file mode 100644 index 0000000..d9c1488 --- /dev/null +++ b/1.json @@ -0,0 +1,967 @@ +{ + "data": { + "astros": { + "sun": { + "name": "sun", + "position": { + "longitude": 340.9716706221829, + "degrees": 10, + "minutes": 58, + "seconds": 18 + }, + "speed": 0, + "retrograde": false, + "sign": 12, + "nakshatra": { + "name": "Uttara Bhadrapada", + "pada": 3 + }, + "type": "luminary" + }, + "moon": { + "name": "moon", + "position": { + "longitude": 193.0454787167021, + "degrees": 13, + "minutes": 2, + "seconds": 43 + }, + "speed": 0, + "retrograde": false, + "sign": 7, + "nakshatra": { + "name": "Swati", + "pada": 2 + }, + "type": "luminary" + }, + "mercury": { + "name": "mercury", + "position": { + "longitude": 331.08102678247786, + "degrees": 1, + "minutes": 4, + "seconds": 51 + }, + "speed": 0, + "retrograde": false, + "sign": 12, + "nakshatra": { + "name": "Purva Bhadrapada", + "pada": 4 + }, + "type": "personal" + }, + "venus": { + "name": "venus", + "position": { + "longitude": 338.2714030984113, + "degrees": 8, + "minutes": 16, + "seconds": 17 + }, + "speed": 0, + "retrograde": false, + "sign": 12, + "nakshatra": { + "name": "Uttara Bhadrapada", + "pada": 2 + }, + "type": "personal" + }, + "mars": { + "name": "mars", + "position": { + "longitude": 44.837572204557105, + "degrees": 14, + "minutes": 50, + "seconds": 15 + }, + "speed": 0, + "retrograde": false, + "sign": 2, + "nakshatra": { + "name": "Rohini", + "pada": 2 + }, + "type": "personal" + }, + "jupiter": { + "name": "jupiter", + "position": { + "longitude": 38.56674233083174, + "degrees": 8, + "minutes": 34, + "seconds": 0 + }, + "speed": 0, + "retrograde": false, + "sign": 2, + "nakshatra": { + "name": "Krittika", + "pada": 4 + }, + "type": "social" + }, + "saturn": { + "name": "saturn", + "position": { + "longitude": 259.55334721418666, + "degrees": 19, + "minutes": 33, + "seconds": 12 + }, + "speed": 0, + "retrograde": false, + "sign": 9, + "nakshatra": { + "name": "Purva Ashadha", + "pada": 2 + }, + "type": "social" + }, + "uranus": { + "name": "uranus", + "position": { + "longitude": 251.52802368413438, + "degrees": 11, + "minutes": 31, + "seconds": 40 + }, + "speed": 0, + "retrograde": false, + "sign": 9, + "nakshatra": { + "name": "Mula", + "pada": 4 + }, + "type": "transpersonal" + }, + "neptune": { + "name": "neptune", + "position": { + "longitude": 258.5690101483659, + "degrees": 18, + "minutes": 34, + "seconds": 8 + }, + "speed": 0, + "retrograde": false, + "sign": 9, + "nakshatra": { + "name": "Purva Ashadha", + "pada": 2 + }, + "type": "transpersonal" + }, + "pluto": { + "name": "pluto", + "position": { + "longitude": 201.0982557130891, + "degrees": 21, + "minutes": 5, + "seconds": 53 + }, + "speed": 0, + "retrograde": false, + "sign": 7, + "nakshatra": { + "name": "Vishaka", + "pada": 1 + }, + "type": "transpersonal" + }, + "chiron": { + "name": "chiron", + "position": { + "longitude": 67.83512652147589, + "degrees": 7, + "minutes": 50, + "seconds": 6 + }, + "speed": 0, + "retrograde": false, + "sign": 3, + "nakshatra": { + "name": "Ardra", + "pada": 1 + }, + "type": "other" + }, + "lilith": { + "name": "lilith", + "position": { + "longitude": 161.2666788411198, + "degrees": 11, + "minutes": 16, + "seconds": 0 + }, + "speed": 0, + "retrograde": false, + "sign": 6, + "nakshatra": { + "name": "Hasta", + "pada": 1 + }, + "type": "other" + }, + "ceres": { + "name": "ceres", + "position": { + "longitude": 0.6305656724047676, + "degrees": 0, + "minutes": 37, + "seconds": 50 + }, + "speed": 0, + "retrograde": false, + "sign": 1, + "nakshatra": { + "name": "Ashwini", + "pada": 1 + }, + "type": "other" + }, + "vesta": { + "name": "vesta", + "position": { + "longitude": 248.38803029786786, + "degrees": 8, + "minutes": 23, + "seconds": 16 + }, + "speed": 0, + "retrograde": false, + "sign": 9, + "nakshatra": { + "name": "Mula", + "pada": 3 + }, + "type": "other" + }, + "pallas": { + "name": "pallas", + "position": { + "longitude": 322.67213594250154, + "degrees": 22, + "minutes": 40, + "seconds": 19 + }, + "speed": 0, + "retrograde": false, + "sign": 11, + "nakshatra": { + "name": "Purva Bhadrapada", + "pada": 1 + }, + "type": "other" + }, + "juno": { + "name": "juno", + "position": { + "longitude": 122.3595135694967, + "degrees": 2, + "minutes": 21, + "seconds": 34 + }, + "speed": 0, + "retrograde": false, + "sign": 5, + "nakshatra": { + "name": "Magha", + "pada": 1 + }, + "type": "other" + }, + "rahu": { + "name": "rahu", + "position": { + "longitude": 309.66519605072966, + "degrees": 9, + "minutes": 39, + "seconds": 54 + }, + "speed": 0, + "retrograde": false, + "sign": 11, + "nakshatra": { + "name": "Shatabhishak", + "pada": 1 + }, + "type": "personal" + }, + "ketu": { + "name": "ketu", + "position": { + "longitude": 129.66519605072966, + "degrees": 9, + "minutes": 39, + "seconds": 54 + }, + "speed": 0, + "retrograde": false, + "sign": 5, + "nakshatra": { + "name": "Magha", + "pada": 3 + }, + "type": "personal" + } + }, + "axes": { + "asc": { + "position": { + "degrees": 8, + "minutes": 48, + "seconds": 7, + "longitude": 98.80208155440693 + }, + "sign": 4, + "nakshatra": { + "name": "Pushya", + "pada": 2 + } + }, + "mc": { + "position": { + "degrees": 6, + "minutes": 18, + "seconds": 14, + "longitude": 6.304023874554858 + }, + "sign": 1, + "nakshatra": { + "name": "Ashwini", + "pada": 2 + } + }, + "dc": { + "position": { + "degrees": 8, + "minutes": 48, + "seconds": 7, + "longitude": 278.8020815544069 + }, + "sign": 10, + "nakshatra": { + "name": "Uttara Ashadha", + "pada": 4 + } + }, + "ic": { + "position": { + "degrees": 6, + "minutes": 18, + "seconds": 14, + "longitude": 186.30402387455487 + }, + "sign": 7, + "nakshatra": { + "name": "Chitra", + "pada": 4 + } + }, + "armc": { + "position": { + "degrees": 27, + "minutes": 55, + "seconds": 19, + "longitude": 27.921960107824532 + }, + "sign": 1, + "nakshatra": { + "name": "Krittika", + "pada": 1 + } + }, + "vertex": { + "position": { + "degrees": 25, + "minutes": 44, + "seconds": 59, + "longitude": 205.74992139315898 + }, + "sign": 7, + "nakshatra": { + "name": "Vishaka", + "pada": 2 + } + }, + "equasc": { + "position": { + "degrees": 2, + "minutes": 13, + "seconds": 16, + "longitude": 92.22121630815109 + }, + "sign": 4, + "nakshatra": { + "name": "Punarvasu", + "pada": 4 + } + }, + "coasc1": { + "position": { + "degrees": 24, + "minutes": 49, + "seconds": 2, + "longitude": 84.81749944744077 + }, + "sign": 3, + "nakshatra": { + "name": "Punarvasu", + "pada": 2 + } + }, + "coasc2": { + "position": { + "degrees": 7, + "minutes": 36, + "seconds": 27, + "longitude": 127.6076176249474 + }, + "sign": 5, + "nakshatra": { + "name": "Magha", + "pada": 3 + } + }, + "polasc": { + "position": { + "degrees": 24, + "minutes": 49, + "seconds": 2, + "longitude": 264.81749944744075 + }, + "sign": 9, + "nakshatra": { + "name": "Purva Ashadha", + "pada": 4 + } + } + }, + "houses": [ + { + "position": { + "degrees": 8, + "minutes": 48, + "seconds": 7, + "longitude": 98.80208155440693 + }, + "sign": 4, + "nakshatra": { + "name": "Pushya", + "pada": 2 + } + }, + { + "position": { + "degrees": 4, + "minutes": 47, + "seconds": 8, + "longitude": 124.78568651824439 + }, + "sign": 5, + "nakshatra": { + "name": "Magha", + "pada": 2 + } + }, + { + "position": { + "degrees": 4, + "minutes": 7, + "seconds": 52, + "longitude": 154.13129681561625 + }, + "sign": 6, + "nakshatra": { + "name": "Uttara Phalguni", + "pada": 3 + } + }, + { + "position": { + "degrees": 6, + "minutes": 18, + "seconds": 14, + "longitude": 186.30402387455487 + }, + "sign": 7, + "nakshatra": { + "name": "Chitra", + "pada": 4 + } + }, + { + "position": { + "degrees": 8, + "minutes": 42, + "seconds": 35, + "longitude": 218.70987058608887 + }, + "sign": 8, + "nakshatra": { + "name": "Anuradha", + "pada": 2 + } + }, + { + "position": { + "degrees": 9, + "minutes": 29, + "seconds": 39, + "longitude": 249.49431381672164 + }, + "sign": 9, + "nakshatra": { + "name": "Mula", + "pada": 3 + } + }, + { + "position": { + "degrees": 8, + "minutes": 48, + "seconds": 7, + "longitude": 278.8020815544069 + }, + "sign": 10, + "nakshatra": { + "name": "Uttara Ashadha", + "pada": 4 + } + }, + { + "position": { + "degrees": 4, + "minutes": 47, + "seconds": 8, + "longitude": 304.78568651824435 + }, + "sign": 11, + "nakshatra": { + "name": "Dhanishta", + "pada": 4 + } + }, + { + "position": { + "degrees": 4, + "minutes": 7, + "seconds": 52, + "longitude": 334.1312968156162 + }, + "sign": 12, + "nakshatra": { + "name": "Uttara Bhadrapada", + "pada": 1 + } + }, + { + "position": { + "degrees": 6, + "minutes": 18, + "seconds": 14, + "longitude": 6.304023874554858 + }, + "sign": 1, + "nakshatra": { + "name": "Ashwini", + "pada": 2 + } + }, + { + "position": { + "degrees": 8, + "minutes": 42, + "seconds": 35, + "longitude": 38.709870586088854 + }, + "sign": 2, + "nakshatra": { + "name": "Krittika", + "pada": 4 + } + }, + { + "position": { + "degrees": 9, + "minutes": 29, + "seconds": 39, + "longitude": 69.4943138167216 + }, + "sign": 3, + "nakshatra": { + "name": "Ardra", + "pada": 1 + } + } + ], + "aspects": { + "sun": [ + { + "name": "quincunx", + "direction": "bidirectional", + "first": { + "name": "sun", + "exist": true + }, + "second": { + "name": "moon", + "exist": true + } + }, + { + "name": "conjunction", + "direction": "bidirectional", + "first": { + "name": "sun", + "exist": true + }, + "second": { + "name": "venus", + "exist": true + } + }, + { + "name": "sextile", + "direction": "unidirectional", + "first": { + "name": "sun", + "exist": true + }, + "second": { + "name": "jupiter", + "exist": false + } + }, + { + "name": "quadrature", + "direction": "bidirectional", + "first": { + "name": "sun", + "exist": true + }, + "second": { + "name": "uranus", + "exist": true + } + }, + { + "name": "opposition", + "direction": "bidirectional", + "first": { + "name": "sun", + "exist": true + }, + "second": { + "name": "lilith", + "exist": true + } + }, + { + "name": "quadrature", + "direction": "unidirectional", + "first": { + "name": "sun", + "exist": true + }, + "second": { + "name": "vesta", + "exist": false + } + }, + { + "name": "semisextile", + "direction": "unidirectional", + "first": { + "name": "sun", + "exist": true + }, + "second": { + "name": "rahu", + "exist": false + } + }, + { + "name": "quincunx", + "direction": "unidirectional", + "first": { + "name": "sun", + "exist": true + }, + "second": { + "name": "ketu", + "exist": false + } + } + ], + "moon": [ + { + "name": "sextile", + "direction": "unidirectional", + "first": { + "name": "moon", + "exist": true + }, + "second": { + "name": "uranus", + "exist": false + } + }, + { + "name": "trigone", + "direction": "unidirectional", + "first": { + "name": "moon", + "exist": true + }, + "second": { + "name": "rahu", + "exist": false + } + } + ], + "mercury": [ + { + "name": "semisextile", + "direction": "bidirectional", + "first": { + "name": "mercury", + "exist": true + }, + "second": { + "name": "ceres", + "exist": true + } + } + ], + "venus": [ + { + "name": "sextile", + "direction": "bidirectional", + "first": { + "name": "venus", + "exist": true + }, + "second": { + "name": "jupiter", + "exist": true + } + }, + { + "name": "quadrature", + "direction": "bidirectional", + "first": { + "name": "venus", + "exist": true + }, + "second": { + "name": "chiron", + "exist": true + } + }, + { + "name": "opposition", + "direction": "unidirectional", + "first": { + "name": "venus", + "exist": true + }, + "second": { + "name": "lilith", + "exist": false + } + }, + { + "name": "quadrature", + "direction": "bidirectional", + "first": { + "name": "venus", + "exist": true + }, + "second": { + "name": "vesta", + "exist": true + } + } + ], + "mars": [], + "jupiter": [ + { + "name": "semisextile", + "direction": "unidirectional", + "first": { + "name": "jupiter", + "exist": true + }, + "second": { + "name": "chiron", + "exist": false + } + }, + { + "name": "quincunx", + "direction": "bidirectional", + "first": { + "name": "jupiter", + "exist": true + }, + "second": { + "name": "vesta", + "exist": true + } + }, + { + "name": "quadrature", + "direction": "bidirectional", + "first": { + "name": "jupiter", + "exist": true + }, + "second": { + "name": "rahu", + "exist": true + } + }, + { + "name": "quadrature", + "direction": "bidirectional", + "first": { + "name": "jupiter", + "exist": true + }, + "second": { + "name": "ketu", + "exist": true + } + } + ], + "saturn": [ + { + "name": "conjunction", + "direction": "bidirectional", + "first": { + "name": "saturn", + "exist": true + }, + "second": { + "name": "neptune", + "exist": true + } + } + ], + "uranus": [ + { + "direction": "unidirectional", + "first": { + "name": "uranus", + "exist": false + }, + "second": { + "name": "rahu", + "exist": true + } + } + ], + "neptune": [], + "pluto": [ + { + "name": "trigone", + "direction": "bidirectional", + "first": { + "name": "pluto", + "exist": true + }, + "second": { + "name": "pallas", + "exist": true + } + } + ], + "chiron": [ + { + "name": "opposition", + "direction": "bidirectional", + "first": { + "name": "chiron", + "exist": true + }, + "second": { + "name": "vesta", + "exist": true + } + }, + { + "name": "trigone", + "direction": "bidirectional", + "first": { + "name": "chiron", + "exist": true + }, + "second": { + "name": "rahu", + "exist": true + } + }, + { + "direction": "unidirectional", + "first": { + "name": "chiron", + "exist": false + }, + "second": { + "name": "ketu", + "exist": true + } + } + ], + "lilith": [], + "ceres": [ + { + "name": "trigone", + "direction": "bidirectional", + "first": { + "name": "ceres", + "exist": true + }, + "second": { + "name": "juno", + "exist": true + } + } + ], + "vesta": [ + { + "direction": "unidirectional", + "first": { + "name": "vesta", + "exist": false + }, + "second": { + "name": "rahu", + "exist": true + } + } + ], + "pallas": [], + "juno": [], + "rahu": [ + { + "name": "opposition", + "direction": "bidirectional", + "first": { + "name": "rahu", + "exist": true + }, + "second": { + "name": "ketu", + "exist": true + } + } + ], + "ketu": [] + } + } +} \ No newline at end of file diff --git a/README.md b/README.md index 8b8dd20..807eea8 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,11 @@ In UTC: `1993-08-06T20:50:00Z` Then, you need to select the house system from the houses system table.. in this case for the placidus system you need to send the `P` value in the `houseSystem` query param. +For SideReal Year System You have to send `S` for Tropical `T` in the `yearSystem` query param. + + also Send Ayanamsha value as per given below table suppose `"Lahiri" SE_SIDM_LAHIRI` ayanamsha + you want to used the add `1` as `ayanamsa` query param. + Now you can send this... ##### Using cURL @@ -58,13 +63,13 @@ Now you can send this... ```bash # escaped curl --request GET \ - --url 'http://localhost:3000/horoscope?time=1993-08-06T16%3A50%3A00-04%3A00&latitude=-33.41167&longitude=-70.66647&houseSystem=P' + --url 'http://localhost:3000/horoscope?time=1993-08-06T16%3A50%3A00-04%3A00&latitude=-33.41167&longitude=-70.66647&houseSystem=P&yearSystem=S&ayanamsa=1' ``` ```bash # in utc curl --request GET \ - --url 'http://localhost:3000/horoscope?time=1993-08-06T20:50:00Z&latitude=-33.41167&longitude=-70.66647&houseSystem=P' + --url 'http://localhost:3000/horoscope?time=1993-08-06T20:50:00Z&latitude=-33.41167&longitude=-70.66647&houseSystem=P&yearSystem=S&ayanamsa=1' ``` @@ -97,4 +102,59 @@ The values from each house system is extracted from sweph source code | V | equal/Vehlow | | W | equal/ whole sign | | X | axial rotation system/Meridian houses | -| Y | APC houses | \ No newline at end of file +| Y | APC houses | + + +### Ayanamsha Value table + +The values from each Ayanamsha is extracted from sweph source code + +| Ayanamsha Name | Ayanamsha value | Ayanamsha constant | +|--------------------- | ----------------- |-------------------- +|"Fagan/Bradley”, | 0 | SE_SIDM_FAGAN_BRADLEY | +|"Lahiri”, | 1 | SE_SIDM_LAHIRI | +|"De Luce”, | 2 | SE_SIDM_DELUCE | +|"Raman”, | 3 | SE_SIDM_RAMAN | +|"Usha/Shashi”, | 4 | SE_SIDM_USHASHASHI | +|"Krishnamurti”, | 5 | SE_SIDM_KRISHNAMURTI +|"Djwhal Khul”, | 6 | SE_SIDM_DJWHAL_KHUL +|"Yukteshwar”, | 7 | SE_SIDM_YUKTESHWAR +"J.N. Bhasin”, | 8 | SE_SIDM_JN_BHASIN +"Babylonian/Kugler 1”, | 9 | SE_SIDM_BABYL_KUGLER1 +"Babylonian/Kugler 2”, | 10 | SE_SIDM_BABYL_KUGLER2 +"Babylonian/Kugler 3”, | 11 | SE_SIDM_BABYL_KUGLER3 +"Babylonian/Huber”, | 12 | SE_SIDM_BABYL_HUBER +"Babylonian/Eta Piscium”, | 13 | SE_SIDM_BABYL_ETPSC +"Babylonian/Aldebaran = 15 Tau”, | 14 | SE_SIDM_ALDEBARAN_15TAU +"Hipparchos”, | 15 | SE_SIDM_HIPPARCHOS +"Sassanian”, | 16 | SE_SIDM_SASSANIAN +"Galact. Center = 0 Sag”, | 17 | SE_SIDM_GALCENT_0SAG +"J2000”, | 18 | SE_SIDM_J2000 +"J1900”, | 19 | SE_SIDM_J1900 +"B1950”, | 20 | SE_SIDM_B1950 +"Suryasiddhanta”, | 21 | SE_SIDM_SURYASIDDHANTA +"Suryasiddhanta, mean Sun”, | 22 | SE_SIDM_SURYASIDDHANTA_MSUN +"Aryabhata”, | 23 | SE_SIDM_ARYABHATA +"Aryabhata, mean Sun”, | 24 | SE_SIDM_ARYABHATA_MSUN +"SS Revati”, | 25 | SE_SIDM_SS_REVATI +"SS Citra”, | 26 | SE_SIDM_SS_CITRA +"True Citra”, | 27 | SE_SIDM_TRUE_CITRA +"True Revati”, | 28 | SE_SIDM_TRUE_REVATI +"True Pushya (PVRN Rao) ”, | 29 | SE_SIDM_TRUE_PUSHYA +"Galactic Center (Gil Brand) ”, | 30 | SE_SIDM_GALCENT_RGBRAND +"Galactic Equator (IAU1958) ”, | 31 | SE_SIDM_GALEQU_IAU1958 +"Galactic Equator”, | 32 | SE_SIDM_GALEQU_TRUE +"Galactic Equator mid-Mula”, | 33 | SE_SIDM_GALEQU_MULA +"Skydram (Mardyks) ”, | 34 | SE_SIDM_GALALIGN_MARDYKS +"True Mula (Chandra Hari) ”, | 35 | SE_SIDM_TRUE_MULA +"Dhruva/Gal.Center/Mula (Wilhelm) ”, | 36 | SE_SIDM_GALCENT_MULA_WILHELM +"Aryabhata 522”, | 37 | SE_SIDM_ARYABHATA_522 +"Babylonian/Britton”, | 38 | SE_SIDM_BABYL_BRITTON +"\"Vedic\"/Sheoran | 39 | SE_SIDM_TRUE_SHEORAN +"Cochrane (Gal.Center = 0 Cap)" | 40 | SE_SIDM_GALCENT_COCHRANE +"Galactic Equator (Fiorenza)", | 41 | SE_SIDM_GALEQU_FIORENZA +"Vettius Valens", | 42 | SE_SIDM_VALENS_MOON +"Lahiri 1940", | 43 | SE_SIDM_LAHIRI_1940 +"Lahiri VP285", | 44 | SE_SIDM_LAHIRI_VP285 +"Krishnamurti-Senthilathiban", | 45 | SE_SIDM_KRISHNAMURTI_VP291 +"Lahiri ICRC", | 46 | SE_SIDM_LAHIRI_ICRC \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index dc988fc..3f318d2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,18 +1,19 @@ { "name": "astrology_api", - "version": "1.0.0", + "version": "1.3.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "astrology_api", - "version": "1.0.0", + "version": "1.3.0", "dependencies": { "cors": "^2.8.5", "express": "^4.17.1", "express-promise-router": "^3.0.3", "helmet": "^3.21.3", "morgan": "^1.9.1", + "node-geocoder": "^4.2.0", "sweph": "^2.10.0-5" }, "devDependencies": { @@ -1660,6 +1661,11 @@ "node": ">=8" } }, + "node_modules/bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" + }, "node_modules/body-parser": { "version": "1.20.0", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz", @@ -5207,6 +5213,37 @@ "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.0.0.tgz", "integrity": "sha512-CvkDw2OEnme7ybCykJpVcKH+uAOLV2qLqiyla128dN9TkEWfrYmxG6C2boDe5KcNQqZF3orkqzGgOMvZ/JNekA==" }, + "node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-geocoder": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/node-geocoder/-/node-geocoder-4.2.0.tgz", + "integrity": "sha512-ZvUiOHWHLVGlrYPvazXj+VQ9oK+EOMinh/5vWoBwOQiV0eCU7GPtEWrMRNnKvmBVOzZHb1eFe9uoKMFeyygMVA==", + "dependencies": { + "bluebird": "^3.5.2", + "node-fetch": "^2.6.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -6588,6 +6625,11 @@ "node": ">=0.8" } }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, "node_modules/tsconfig-paths": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", @@ -6803,6 +6845,20 @@ "makeerror": "1.0.12" } }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -8235,6 +8291,11 @@ "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true }, + "bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" + }, "body-parser": { "version": "1.20.0", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz", @@ -10919,6 +10980,23 @@ "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.0.0.tgz", "integrity": "sha512-CvkDw2OEnme7ybCykJpVcKH+uAOLV2qLqiyla128dN9TkEWfrYmxG6C2boDe5KcNQqZF3orkqzGgOMvZ/JNekA==" }, + "node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "requires": { + "whatwg-url": "^5.0.0" + } + }, + "node-geocoder": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/node-geocoder/-/node-geocoder-4.2.0.tgz", + "integrity": "sha512-ZvUiOHWHLVGlrYPvazXj+VQ9oK+EOMinh/5vWoBwOQiV0eCU7GPtEWrMRNnKvmBVOzZHb1eFe9uoKMFeyygMVA==", + "requires": { + "bluebird": "^3.5.2", + "node-fetch": "^2.6.0" + } + }, "node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -11969,6 +12047,11 @@ "punycode": "^2.1.1" } }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, "tsconfig-paths": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", @@ -12142,6 +12225,20 @@ "makeerror": "1.0.12" } }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/package.json b/package.json index cb503eb..dde91cf 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "express-promise-router": "^3.0.3", "helmet": "^3.21.3", "morgan": "^1.9.1", + "node-geocoder": "^4.2.0", "sweph": "^2.10.0-5" } } diff --git a/src/api/index.js b/src/api/index.js index 6cf8ee7..2e9403c 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -7,9 +7,9 @@ router.get('/', async (req, res) => res.status(200).json({ message: 'Welcome to router.get('/horoscope', async (req, res) => { const date = new Date(req.query.time) - const { latitude, longitude, houseSystem } = req.query + const { latitude, longitude, houseSystem, yearSystem, ayanamsa } = req.query - const chart = astrologer.natalChart(date, latitude, longitude, houseSystem) + const chart = astrologer.natalChart(date, latitude, longitude, houseSystem, yearSystem, ayanamsa) res.status(200).json({ data: chart diff --git a/src/astrologer/astros.js b/src/astrologer/astros.js index 69a3106..341f891 100644 --- a/src/astrologer/astros.js +++ b/src/astrologer/astros.js @@ -1,9 +1,8 @@ const sweph = require('sweph') -const { utcToJulianEt, zodiacSign, degreesToDms } = require('./utils') +const { utcToJulianEt, zodiacSign, degreesToDms, nakshatra } = require('./utils') const path = require('path') - -sweph.set_ephe_path(path.join(__dirname, '/../../eph')) - +var yearSystem +var ayanamsha const { SE_SUN, SE_MOON, @@ -21,9 +20,14 @@ const { SE_CHIRON, SE_CERES, SE_PALLAS, + SEFLG_SIDEREAL, + SEFLG_SPEED, SEFLG_SWIEPH, - SEFLG_SPEED -} = sweph.constants + SE_MEAN_NODE +} = require('./swephConstants') + +sweph.set_ephe_path(path.join(__dirname, '/../../eph')) + const PLANETS = { sun: SE_SUN, @@ -41,7 +45,9 @@ const PLANETS = { ceres: SE_CERES, vesta: SE_VESTA, pallas: SE_PALLAS, - juno: SE_JUNO + juno: SE_JUNO, + rahu: SE_MEAN_NODE, + ketu: SE_MEAN_NODE } const planetsByType = { @@ -60,19 +66,37 @@ const planetsByType = { ceres: 'other', vesta: 'other', pallas: 'other', - juno: 'other' + juno: 'other', + rahu: 'personal', // Lunar North Node + ketu: 'personal' // Lunar South Node } -const FLAG = SEFLG_SPEED | SEFLG_SWIEPH +var FLAG = SEFLG_SPEED | SEFLG_SWIEPH -const getPositionOfAstro = (astro, julianDay) => sweph.calc(julianDay, PLANETS[astro], FLAG) + +const getPositionOfAstro = (astro, julianDay) => +{ + // Condition For SideReal Chart Positions + // setting ayanamsha and sidereal flag + if (yearSystem == 'S') { + sweph.set_sid_mode(Number(ayanamsha), 0, 0) + FLAG = SEFLG_SIDEREAL + } + return sweph.calc(julianDay, PLANETS[astro], FLAG) +} const isRetrograde = (speed) => speed < 0 const position = (astrologyObject, moment) => { const julianDay = utcToJulianEt(moment) const { data } = getPositionOfAstro(astrologyObject, julianDay) - const longitude = data[0] + var longitude = data[0] + + //To calculate South Node (Ketu) opposite to North Node + if(astrologyObject == 'ketu') { + longitude = ( longitude + 180 ) % 360 + } + const speed = data[3] const dms = degreesToDms(longitude) const retrograde = isRetrograde(speed) @@ -84,11 +108,15 @@ const position = (astrologyObject, moment) => { }, speed, retrograde, - sign: zodiacSign(longitude) + sign: zodiacSign(longitude), + nakshatra: nakshatra(longitude), } } -const planets = (date) => { +const planets = (date, yearSystemValue, aynamshaValue) => { + // sets the YearSystem and Ayanamsha values + yearSystem = yearSystemValue + ayanamsha = aynamshaValue return Object.keys(PLANETS) .reduce( (accumulator, name) => { diff --git a/src/astrologer/charts.js b/src/astrologer/charts.js index a442fef..6c854b0 100644 --- a/src/astrologer/charts.js +++ b/src/astrologer/charts.js @@ -1,9 +1,13 @@ const { houses } = require('./houses') const { aspects } = require('./aspects') const { planets } = require('./astros') +const { SE_SIDM_LAHIRI } = require('./swephConstants') -const natalChart = (date, latitude, longitude, houseSystem = 'P') => { - const astrosList = planets(date) +// Default value for yearSystem is = SideReal 'S' +// Default value for ayanamsha is Lahiri = SE_SIDM_LAHIRI + +const natalChart = (date, latitude, longitude, houseSystem = 'P', yearSystem = 'T', ayanamsha = SE_SIDM_LAHIRI) => { + const astrosList = planets(date, yearSystem, ayanamsha) const aspectsList = aspects(astrosList) const housesList = houses( date, @@ -11,7 +15,9 @@ const natalChart = (date, latitude, longitude, houseSystem = 'P') => { latitude: parseFloat(latitude), longitude: parseFloat(longitude) }, - houseSystem + houseSystem, + yearSystem, + ayanamsha, ) return { diff --git a/src/astrologer/houses.js b/src/astrologer/houses.js index dbb37be..243225e 100644 --- a/src/astrologer/houses.js +++ b/src/astrologer/houses.js @@ -1,39 +1,68 @@ const sweph = require('sweph') const path = require('path') +const { SE_SIDM_LAHIRI } = require('./swephConstants') sweph.set_ephe_path(path.join(__dirname, '/../../eph')) -const { utcToJulianUt, degreesToDms, zodiacSign } = require('./utils') -const houses = (date, position, houseSystem = 'P') => { - const julianDayUT = utcToJulianUt(date) +const { utcToJulianUt, degreesToDms, zodiacSign, nakshatra } = require('./utils') + +// Condition For SideReal Chart Positions +// setting ayanamsha and sidereal flag +const houses = (date, position, houseSystem = 'P', yearSystem = 'T', ayanamsha = SE_SIDM_LAHIRI ) => { +const julianDayUT = utcToJulianUt(date) const withoutGeoposition = !(position?.latitude && position?.longitude) + var FLAG = SEFLG_SPEED | SEFLG_SWIEPH if (withoutGeoposition) { return { - axes: { - asc: undefined, + axes:{ + asc: undefined, // Ascendant + mc: undefined, // Midheaven dc: undefined, - mc: undefined, - ic: undefined - }, + ic: undefined, + armc: undefined, // Right Ascension of the midheaven + vertex: undefined, // Vertex + equasc: undefined, // Equatorial Ascendant + coasc1: undefined, // Co-Ascendant (Walter Koch) + coasc2: undefined, // Co-Ascendant (Michael Munkasey) + polasc: undefined, // Polar Ascendant (Michael Munkasey), + }, houses: [] } } + // Condition For SideReal Chart Positions + // setting ayanamsha and sidereal flag + if (yearSystem == 'S') { + sweph.set_sid_mode(Number(ayanamsha), 0, 0) + FLAG = SEFLG_SIDEREAL + } - const { houses: housesPositions } = sweph.houses( + const { houses, points } = sweph.houses_ex( julianDayUT, + FLAG, position.latitude, position.longitude, houseSystem // placidus system... ).data - - const houseCollection = housesPositions.map((cuspid) => ({ position: degreesToDms(cuspid), sign: zodiacSign(cuspid) })) - + + const houseCollection = houses.map((cuspid) => ({ position: degreesToDms(cuspid), sign: zodiacSign(cuspid), nakshatra: nakshatra(cuspid) })) + + let i = 0 const axes = { - asc: houseCollection[0], dc: houseCollection[6], mc: houseCollection[9], ic: houseCollection[3] - } + asc: axesPosition(points[i++]), // Ascendant + mc: axesPosition(points[i++]), // Midheaven + dc: houseCollection[6], + ic: houseCollection[3], + armc: axesPosition(points[i++]), // Right Ascension of the midheaven + vertex: axesPosition(points[i++]), // Vertex + equasc: axesPosition(points[i++]), // Equatorial Ascendant + coasc1: axesPosition(points[i++]), // Co-Ascendant (Walter Koch) + coasc2: axesPosition(points[i++]), // Co-Ascendant (Michael Munkasey) + polasc: axesPosition(points[i++]), // Polar Ascendant (Michael Munkasey), + } + return { axes, @@ -41,6 +70,10 @@ const houses = (date, position, houseSystem = 'P') => { } } +var axesPosition = (cuspid) => { + return { position: degreesToDms(cuspid), sign: zodiacSign(cuspid), nakshatra: nakshatra(cuspid) } +} + module.exports = { houses } diff --git a/src/astrologer/nakshatra.js b/src/astrologer/nakshatra.js new file mode 100644 index 0000000..e73bf30 --- /dev/null +++ b/src/astrologer/nakshatra.js @@ -0,0 +1,47 @@ +const nakshatras = ["Ashwini", + "Bharani", + "Krittika", + "Rohini", + "Mrigashira", + "Ardra", + "Punarvasu", + "Pushya", + "Ashlesha", + "Magha", + "Purva Phalguni", + "Uttara Phalguni", + "Hasta", + "Chitra", + "Swati", + "Vishaka", + "Anuradha", + "Jyeshta", + "Mula", + "Purva Ashadha", + "Uttara Ashadha", + "Shravana", + "Dhanishta", + "Shatabhishak", + "Purva Bhadrapada", + "Uttara Bhadrapada", + "Revati" +] + +const nakshatraLength = 360 / 27 +const padaLength = (360 / 27) / 4 + +const getNakshatras = (longitude) => { + let nakshatraNumber = getNakshatrasNumber(longitude) + let pada = (getPadaNumber(longitude) % 4) + 1 + return {name : nakshatras[nakshatraNumber], pada: pada} +} + +const getNakshatrasNumber = (longitude) => { + return (Math.floor(longitude / nakshatraLength) % 27) +} + +const getPadaNumber = (longitude) => { + return (Math.floor(longitude / padaLength ) % 108) +} + +module.exports = getNakshatras \ No newline at end of file diff --git a/src/astrologer/swephConstants.js b/src/astrologer/swephConstants.js new file mode 100644 index 0000000..72264e4 --- /dev/null +++ b/src/astrologer/swephConstants.js @@ -0,0 +1,31 @@ +const sweph = require('sweph') +module.exports = { + SE_SUN, + SE_MOON, + SE_MEAN_APOG, + SE_MERCURY, + SE_VENUS, + SE_MARS, + SE_JUPITER, + SE_SATURN, + SE_URANUS, + SE_NEPTUNE, + SE_PLUTO, + SE_VESTA, + SE_JUNO, + SE_CHIRON, + SE_CERES, + SE_PALLAS, + SE_SIDM_LAHIRI, + SEFLG_SIDEREAL, + SE_SIDM_RAMAN, + SE_SIDM_KRISHNAMURTI, + SEFLG_SPEED, + SEFLG_SWIEPH, + SE_NODBIT_MEAN, + SE_MEAN_NODE, + SE_GREG_CAL + } = sweph.constants + + + \ No newline at end of file diff --git a/src/astrologer/utils.js b/src/astrologer/utils.js index 4fef73b..2b1a40e 100644 --- a/src/astrologer/utils.js +++ b/src/astrologer/utils.js @@ -1,5 +1,7 @@ const sweph = require('sweph') const path = require('path') +const getNakshatras = require('./nakshatra') +const {SE_GREG_CAL} = require('./swephConstants') sweph.set_ephe_path(path.join(__dirname, '/../../eph')) @@ -15,7 +17,7 @@ const utcToJulianUt = (utcDate) => { utcDate.getUTCMonth() + 1, utcDate.getUTCDate(), hours, - sweph.constants.SE_GREG_CAL + SE_GREG_CAL ) } @@ -38,6 +40,8 @@ const degreesToDms = (value) => { const zodiacSign = (degrees) => (Math.floor(degrees / 30) % 12) + 1 +const nakshatra = (degrees) => getNakshatras(degrees) + const normalizeDegrees = (degrees) => { if (degrees < -180) { return degrees + 360 @@ -54,5 +58,6 @@ module.exports = { degreesToDms, zodiacSign, normalizeDegrees, - utcToJulianEt + utcToJulianEt, + nakshatra } diff --git a/test/features/empty-houses-and-axes-when-not-send-geoposition.test.js b/test/features/empty-houses-and-axes-when-not-send-geoposition.test.js index f022af8..1fe8c92 100644 --- a/test/features/empty-houses-and-axes-when-not-send-geoposition.test.js +++ b/test/features/empty-houses-and-axes-when-not-send-geoposition.test.js @@ -8,7 +8,7 @@ describe('Get houses empty and axes as undefined when geolocation is not send', response = await request(app) .get('/horoscope') .query({ - time: '1991-07-06T16:50:00-04:00' + time: '1991-07-06T16:50:00-04:00', }) .send() }) @@ -36,4 +36,4 @@ describe('Get houses empty and axes as undefined when geolocation is not send', it('/horoscope return the houses elements empty', () => { expect(response.body.data.houses.length).toBe(0) }) -}) +}) diff --git a/test/features/get-house-cuspids-in-sidereal-yearSystem.spec.js b/test/features/get-house-cuspids-in-sidereal-yearSystem.spec.js new file mode 100644 index 0000000..8129930 --- /dev/null +++ b/test/features/get-house-cuspids-in-sidereal-yearSystem.spec.js @@ -0,0 +1,97 @@ +const request = require('supertest') +const app = require('./../../app') + +describe('Get SideReal Year system cuspids for 1989-03-25T14:15:00+0:30', () => { + let response + + beforeEach(async () => { + response = await request(app) + .get('/horoscope') + .query({ + time: '1989-03-25T14:15:00+05:30', + latitude: '18.5529', + longitude: '73.8797', + yearSystem: 'S', + }) + .send() + }) + + const expectCuspids = ( + cuspid, + expectedSign, + expectedDegrees, + expectedMinutes, + expectedSeconds + ) => { + expect(cuspid.position.degrees).toBe(expectedDegrees) + expect(cuspid.position.minutes).toBe(expectedMinutes) + expect(cuspid.position.seconds).toBe(expectedSeconds) + expect(cuspid.position.longitude).not.toBeNull() + expect(cuspid.position.longitude).not.toBeUndefined() + expect(cuspid.sign).toBe(expectedSign) + } + + it('/horoscope return the ASC axis (cuspid of the house I)', () => { + expectCuspids(response.body.data.axes.asc, 4, 8, 48, 7) + }) + + it('/horoscope return the DC axis (cuspid of the house VII)', () => { + expectCuspids(response.body.data.axes.dc, 10, 8, 48, 7) + }) + + it('/horoscope return the MC axis (cuspid of the house X)', () => { + expectCuspids(response.body.data.axes.mc, 1, 6, 18, 14) + }) + + it('/horoscope return the IC axis (cuspid of the house IV)', () => { + expectCuspids(response.body.data.axes.ic, 7, 6, 18, 14) + }) + + it('/horoscope response has cuspid of house I', () => { + expectCuspids(response.body.data.houses[0], 4, 8, 48, 7) + }) + + it('/horoscope response has cuspid of house II', () => { + expectCuspids(response.body.data.houses[1], 5, 4, 47, 8) + }) + + it('/horoscope response has cuspid of house III', () => { + expectCuspids(response.body.data.houses[2], 6, 4, 7, 52) + }) + + it('/horoscope response has cuspid of house IV', () => { + expectCuspids(response.body.data.houses[3], 7, 6, 18, 14) + }) + + it('/horoscope response has cuspid of house V', () => { + expectCuspids(response.body.data.houses[4], 8, 8, 42, 35) + }) + + it('/horoscope response has cuspid of house VI', () => { + expectCuspids(response.body.data.houses[5], 9, 9, 29, 39) + }) + + it('/horoscope response has cuspid of house VII', () => { + expectCuspids(response.body.data.houses[6], 10, 8, 48, 7) + }) + + it('/horoscope response has cuspid of house VIII', () => { + expectCuspids(response.body.data.houses[7], 11, 4, 47, 8) + }) + + it('/horoscope response has cuspid of house IX', () => { + expectCuspids(response.body.data.houses[8], 12, 4, 7, 52) + }) + + it('/horoscope response has cuspid of house X', () => { + expectCuspids(response.body.data.houses[9], 1, 6, 18, 14) + }) + + it('/horoscope response has cuspid of house XI', () => { + expectCuspids(response.body.data.houses[10], 2, 8, 42, 35) + }) + + it('/horoscope response has cuspid of house XII', () => { + expectCuspids(response.body.data.houses[11], 3, 9, 29, 39) + }) +}) diff --git a/test/features/get-houses-cuspids-in-placidus-system.spec.js b/test/features/get-houses-cuspids-in-placidus-system.spec.js index e033a6f..da810dd 100644 --- a/test/features/get-houses-cuspids-in-placidus-system.spec.js +++ b/test/features/get-houses-cuspids-in-placidus-system.spec.js @@ -10,7 +10,8 @@ describe('Get placidus houses system cuspids for 1991-07-06T16:50:00-04:00', () .query({ time: '1991-07-06T16:50:00-04:00', latitude: '-33.41167', - longitude: '-70.66647' + longitude: '-70.66647', + yearSystem:'T', }) .send() }) diff --git a/test/features/get-planet-position-sidereal-yearSystem.spec.js b/test/features/get-planet-position-sidereal-yearSystem.spec.js new file mode 100644 index 0000000..941479a --- /dev/null +++ b/test/features/get-planet-position-sidereal-yearSystem.spec.js @@ -0,0 +1,96 @@ +const request = require('supertest') +const app = require('../../app') + +describe('Get the planets position for 1989-03-25T14:15:00+05:30', () => { + let response + + beforeEach(async () => { + response = await request(app) + .get('/horoscope') + .query({ + time: '1989-03-25T14:15:00+05:30', + latitude: '18.5529', + longitude: '73.8797', + yearSystem: 'S', + }) + .send() + }) + + const expectAstro = (astroName, sign, position) => { + expect(response.body.data.astros[astroName]).not.toBeUndefined() + expect(response.body.data.astros[astroName].position.degrees).toBe( + position.degrees + ) + expect(response.body.data.astros[astroName].position.minutes).toBe( + position.minutes + ) + expect(response.body.data.astros[astroName].position.seconds).toBe( + position.seconds + ) + expect(response.body.data.astros[astroName].sign).toBe(sign) + } + + test('get the sun position', async () => { + expectAstro('sun', 12, { degrees: 10, minutes: 58, seconds: 18 }) + }) + + test('get the moon position', async () => { + expectAstro('moon', 7, { degrees: 13, minutes: 2, seconds: 43 }) + }) + + test('get the mercury position', async () => { + expectAstro('mercury', 12, { degrees: 1, minutes: 4, seconds: 51 }) + }) + + test('get the venus position', async () => { + expectAstro('venus', 12, { degrees: 8, minutes: 16, seconds: 17 }) + }) + + test('get the mars position', async () => { + expectAstro('mars', 2, { degrees: 14, minutes: 50, seconds: 15 }) + }) + + test('get the jupiter position', async () => { + expectAstro('jupiter', 2, { degrees: 8, minutes: 34, seconds: 0 }) + }) + + test('get the saturn position', async () => { + expectAstro('saturn', 9, { degrees: 19, minutes: 33, seconds: 12 }) + }) + + test('get the uranus position', async () => { + expectAstro('uranus', 9, { degrees: 11, minutes: 31, seconds: 40 }) + }) + + test('get the neptune position', async () => { + expectAstro('neptune', 9, { degrees: 18, minutes: 34, seconds: 8 }) + }) + + test('get the pluto position', async () => { + expectAstro('pluto', 7, { degrees: 21, minutes: 5, seconds: 53 }) + }) + + test('get the chiron position', async () => { + expectAstro('chiron', 3, { degrees: 7, minutes: 50, seconds: 6 }) + }) + + test('get the lilith position', async () => { + expectAstro('lilith', 6, { degrees: 11, minutes: 16, seconds: 0 }) + }) + + test('get the ceres position', async () => { + expectAstro('ceres', 1, { degrees: 0, minutes: 37, seconds: 50 }) + }) + + test('get the pallas position', async () => { + expectAstro('pallas', 11, { degrees: 22, minutes: 40, seconds: 19 }) + }) + + test('get the juno position', async () => { + expectAstro('juno', 5, { degrees: 2, minutes: 21, seconds: 34 }) + }) + + test('get the vesta position', async () => { + expectAstro('vesta', 9, { degrees: 8, minutes: 23, seconds: 16 }) + }) +}) diff --git a/test/features/support-additionals-house-systems.spec.js b/test/features/support-additionals-house-systems.spec.js index 1e970d1..76b7a30 100644 --- a/test/features/support-additionals-house-systems.spec.js +++ b/test/features/support-additionals-house-systems.spec.js @@ -11,7 +11,8 @@ describe('Get Koch houses system cuspids for 1991-07-06T16:50:00-04:00', () => { time: '1991-07-06T16:50:00-04:00', latitude: '-33.41167', longitude: '-70.66647', - houseSystem: 'K' // Koch system... + houseSystem: 'K', // Koch system... + }) .send() })