lifeastroapi 0.4.0 → 0.6.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/index.js CHANGED
@@ -343,6 +343,26 @@ function qNatalTransit(i) {
343
343
  set(q, "ayanamsa", i.ayanamsa);
344
344
  return q;
345
345
  }
346
+ function qNatalTransitPlace(i) {
347
+ const q = qNatalTransit(i);
348
+ const b = i.birth ?? {};
349
+ set(q, "lat", b.lat);
350
+ set(q, "lon", b.lon);
351
+ return q;
352
+ }
353
+ function qNatalWindow(i) {
354
+ const q = {};
355
+ const b = i.birth ?? {};
356
+ set(q, "birth.date", b.date);
357
+ set(q, "birth.time", b.time);
358
+ set(q, "birth.tz", b.tz);
359
+ set(q, "birth.lat", b.lat);
360
+ set(q, "birth.lon", b.lon);
361
+ set(q, "from", i.from);
362
+ set(q, "tz", i.tz);
363
+ set(q, "ayanamsa", i.ayanamsa);
364
+ return q;
365
+ }
346
366
  function qInstant(i = {}) {
347
367
  const q = {};
348
368
  const tz = i.tz ?? "UTC";
@@ -367,7 +387,7 @@ var Ashtakavarga = class {
367
387
  }
368
388
  /** Get Kaksha (sub-division) level Ashtakavarga analysis — divides each sign into 8 equal 3°45′ segments, each ruled by a graha. */
369
389
  kaksha(input, opts) {
370
- return this._c.request("/v1/ashtakavarga/kaksha", applyExtras(qBirthPrefixed(input), input, [["date", "date"], ["tz", "tz"]]), opts);
390
+ return this._c.request("/v1/ashtakavarga/kaksha", qNatalTransit(input), opts);
371
391
  }
372
392
  /** Get the Sarvashtakavarga table — the combined 12-sign benefic-point grid from all 9 grahas. */
373
393
  sarva(input, opts) {
@@ -375,7 +395,7 @@ var Ashtakavarga = class {
375
395
  }
376
396
  /** Score current (or a given date's) planetary transits against a natal chart using Ashtakavarga benefic points. */
377
397
  transitScore(input, opts) {
378
- return this._c.request("/v1/ashtakavarga/transit-score", applyExtras(qBirthPrefixed(input), input, [["date", "date"], ["tz", "tz"]]), opts);
398
+ return this._c.request("/v1/ashtakavarga/transit-score", qNatalTransit(input), opts);
379
399
  }
380
400
  };
381
401
 
@@ -451,6 +471,10 @@ var Chart = class {
451
471
  divisional(input, opts) {
452
472
  return this._c.request(buildPath("/v1/chart/divisional/{varga}", input, ["varga"]), qBirth(input), opts);
453
473
  }
474
+ /** Doshas in a birth chart as data (20 credits): kaalsarp, mangal (from lagna, Moon and Venus with cancellation), pitra, combust, debilitation (with neecha bhanga), retrograde, gandanta, grahan, papakartari, mrityu bhaga, guru chandal, visha kanya, ganda moola. Same item fields as chart.yogas. all=true also lists absent ids. Ids only, no text: planets sun..ketu, sign_index 0-based (Aries=0), house 1-based whole-sign from the lagna, nakshatra index 0-based (Ashwini=0). */
475
+ doshas(input, opts) {
476
+ return this._c.request("/v1/chart/doshas", applyExtras(qBirth(input), input, [["all", "all"], ["gender", "gender"]]), opts);
477
+ }
454
478
  /** Ghatak Chakra (inauspicious indicators) for the chart. */
455
479
  ghatak(input, opts) {
456
480
  return this._c.request("/v1/chart/ghatak", qBirth(input), opts);
@@ -475,6 +499,10 @@ var Chart = class {
475
499
  kpSublord(input, opts) {
476
500
  return this._c.request("/v1/chart/kp-sublord", applyExtras(qBirth(input), input, [["planet", "planet"]]), opts);
477
501
  }
502
+ /** Whole birth chart as data in one call (50 credits): lagna; planets with sign, degree, house, nakshatra, pada, retrograde, combust, dignity, neecha bhanga, vargottama, houses ruled, shadbala, avastha and varga placements; houses with sign, lord, SAV bindus, bhava bala, occupants and aspecting planets; Jaimini chara karakas; avakhada. vargas: comma list (default D9, max 16, D1 rejected). include: shadbala, bhavabala, ashtakvarga, aspects, avastha, karakas, avakhada, yogas or all (default all but yogas). gender narrows Mahabhagya. Ids only, no text: planets sun..ketu, sign_index 0-based (Aries=0), house 1-based whole-sign from the lagna, nakshatra index 0-based (Ashwini=0). Anything not computable is in skipped. */
503
+ kundliFacts(input, opts) {
504
+ return this._c.request("/v1/chart/kundli-facts", applyExtras(qBirth(input), input, [["vargas", "vargas"], ["include", "include"], ["gender", "gender"]]), opts);
505
+ }
478
506
  /** Birth (Janma) nakshatra and pada. */
479
507
  nakshatra(input, opts) {
480
508
  return this._c.request("/v1/chart/nakshatra", qBirth(input), opts);
@@ -491,6 +519,10 @@ var Chart = class {
491
519
  planets(input, opts) {
492
520
  return this._c.request("/v1/chart/planets", qBirth(input), opts);
493
521
  }
522
+ /** Birth-time sensitivity (20 credits): for D1 and each varga (default D9,D10,D24) the lagna sign at birth and how many minutes before/after it stays the same, with the neighbouring signs; the same for the Moon's nakshatra and pada; planet sign changes inside the window. window: half-width in minutes (default 120, max 180). Use it to tell users how much a birth-time error matters. Every instant comes as *_local (RFC 3339 with offset) and *_jd (Julian Day, UT); fields that cannot be computed are listed in skipped. */
523
+ sensitivity(input, opts) {
524
+ return this._c.request("/v1/chart/sensitivity", applyExtras(qBirth(input), input, [["window", "window"], ["vargas", "vargas"], ["topocentricMoon", "topocentric_moon"]]), opts);
525
+ }
494
526
  /** Shadbala (six-fold strength) for all 7 planets with components. */
495
527
  shadbala(input, opts) {
496
528
  return this._c.request("/v1/chart/shadbala", qBirth(input), opts);
@@ -499,6 +531,10 @@ var Chart = class {
499
531
  shadbalaComponent(input, opts) {
500
532
  return this._c.request(buildPath("/v1/chart/shadbala/{component}", input, ["component"]), qBirth(input), opts);
501
533
  }
534
+ /** Yogas present in a birth chart as data (20 credits), from the same detectors as narrative.yogas: id, kind, category, present, planets, houses, strength, cancelled + cancel_reasons, variant, axes, sub_ids, source, details. Includes neecha_bhanga.<planet> and raja_yoga.kendra_trikona. all=true also lists every absent catalogue id with present:false. Ids only, no text: planets sun..ketu, sign_index 0-based (Aries=0), house 1-based whole-sign from the lagna, nakshatra index 0-based (Ashwini=0). */
535
+ yogas(input, opts) {
536
+ return this._c.request("/v1/chart/yogas", applyExtras(qBirth(input), input, [["all", "all"], ["gender", "gender"]]), opts);
537
+ }
502
538
  };
503
539
 
504
540
  // src/resources/dasha.ts
@@ -715,9 +751,9 @@ var Milan = class {
715
751
  ashtakootaTotal(input, opts) {
716
752
  return this._c.request("/v1/milan/ashtakoota/total", qBoyGirl(input), opts);
717
753
  }
718
- /** Check Dasha synchrony between two partners — are they running compatible mahadasha lords at the same time? Good dasha synchrony indicates the couple will flourish together during major life events. */
754
+ /** Current Vimshottari Maha Dasha of both partners and whether they overlap (20 credits); date/time/tz set the check moment (default now). timeline=true adds both partners' MD/AD periods on one aligned timeline from from for years (default 10, max 30), each span with md, ad and the running AD's start/end. marriageWindows=true (implies timeline) tags each span favourable, neutral or avoid with reason ids (rule D-MarriageWindows1). Each partner's Moon uses the ayanamsa of their own birth moment, so dates match dasha.vimshottari. */
719
755
  dashaSync(input, opts) {
720
- return this._c.request("/v1/milan/dasha-sync", qBoyGirl(input), opts);
756
+ return this._c.request("/v1/milan/dasha-sync", applyExtras(qBoyGirl(input), input, [["timeline", "timeline"], ["years", "years"], ["from", "from"], ["marriageWindows", "marriage_windows"], ["date", "date"], ["time", "time"], ["tz", "tz"]]), opts);
721
757
  }
722
758
  /** Check Dhan Yog (wealth yoga) for a single person's chart — assesses 2nd/11th house lord strength and Jupiter placement for prosperity. */
723
759
  dhanYog(input, opts) {
@@ -743,6 +779,10 @@ var Milan = class {
743
779
  navamsaCompat(input, opts) {
744
780
  return this._c.request("/v1/milan/navamsa-compat", qBoyGirl(input), opts);
745
781
  }
782
+ /** Couple chart overlay as data (20 credits): each partner's grahas in the other's whole-sign houses (with conjunct grahas), same-sign and same-nakshatra pairs, Moon sign relation (e.g. "2/12"), and each lagna lord's placement in the other's chart (sign, house, dignity, combust, retro). Each partner's chart uses the ayanamsa of their own birth moment. Ids only, no text: planets sun..ketu, sign_index 0-based (Aries=0), house 1-based whole-sign from the lagna, nakshatra index 0-based (Ashwini=0). */
783
+ overlay(input, opts) {
784
+ return this._c.request("/v1/milan/overlay", qBoyGirl(input), opts);
785
+ }
746
786
  /** Check Santan Yog for a single person's chart — assesses 5th house lord and Jupiter placement to indicate prospects for children. */
747
787
  santanYog(input, opts) {
748
788
  return this._c.request("/v1/milan/santan-yog", qBirthPrefixed(input), opts);
@@ -755,6 +795,10 @@ var Milan = class {
755
795
  streeDirgha(input, opts) {
756
796
  return this._c.request("/v1/milan/stree-dirgha", qBoyGirl(input), opts);
757
797
  }
798
+ /** Couple matching data in one call (60 credits), numbers identical to the separate routes: ashtakoota (every koota), navamsa_compat, mangal_dosha of both plus pair status, seventh_house facts of both (7th sign, occupants, 7th lord, Venus, Jupiter, D9 7th, D7 5th), and sade_sati windows of both for 10 years from from. include=kundli_facts adds both full charts. Ids only, no text: planets sun..ketu, sign_index 0-based (Aries=0), house 1-based whole-sign from the lagna, nakshatra index 0-based (Ashwini=0). */
799
+ summary(input, opts) {
800
+ return this._c.request("/v1/milan/summary", applyExtras(qBoyGirl(input), input, [["from", "from"], ["tz", "tz"], ["include", "include"]]), opts);
801
+ }
758
802
  /** Vivah Phal (marriage-outcome) assessment for one chart. */
759
803
  vivahPhal(input, opts) {
760
804
  return this._c.request("/v1/milan/vivah-phal", qBirthPrefixed(input), opts);
@@ -821,9 +865,9 @@ var Narrative = class {
821
865
  careerOutlook(input, opts) {
822
866
  return this._c.request("/v1/vedic/narrative/career-outlook", applyExtras(qBirth(input), input, [["lang", "lang"], ["lang", "locale"]]), opts);
823
867
  }
824
- /** Get the Dasha Phal (period interpretation) narrative for the currently running Vimshottari Mahadasha + Antardasha combination — a human-readable explanation of what this dasha pair typically brings and how it interacts with the natal chart. */
868
+ /** Get the Dasha Phal (period interpretation) narrative for the Vimshottari dasha running at the given moment — Mahadasha, Antardasha and Pratyantar down to the sookshma and prana levels, plus dasha-sandhi sections when a period change is near. `birth` is the natal chart; date/time/tz are the moment to read. */
825
869
  dashaPhal(input, opts) {
826
- return this._c.request("/v1/vedic/narrative/dasha-phal", applyExtras(qBirthPrefixed(input), input, [["date", "date"], ["tz", "tz"], ["lang", "lang"], ["lang", "locale"]]), opts);
870
+ return this._c.request("/v1/vedic/narrative/dasha-phal", applyExtras(qNatalTransitPlace(input), input, [["lang", "lang"], ["lang", "locale"]]), opts);
827
871
  }
828
872
  /** Get narrative interpretations for a specific dasha combination — pass mahadasha lord (and optionally antardasha lord) to get the meaning of that specific period for the natal chart. */
829
873
  dashaTreePhal(input, opts) {
@@ -885,7 +929,7 @@ var Narrative = class {
885
929
  marriageOutlook(input, opts) {
886
930
  return this._c.request("/v1/vedic/narrative/marriage-outlook", applyExtras(qBirth(input), input, [["lang", "lang"], ["lang", "locale"]]), opts);
887
931
  }
888
- /** Get a narrative compatibility analysis for a couple — goes beyond the numeric Ashtakoota score with a written interpretation of compatibility across all factors (guna milan, mangal dosha, dashas, navamsa). */
932
+ /** Get a narrative compatibility analysis for a couple — a written reading of the Ashtakoota result (verdict and each koota; Tara and Graha Maitri are scored both ways) plus synastry sections from the graha signs of both charts. */
889
933
  milan(input, opts) {
890
934
  return this._c.request("/v1/vedic/narrative/milan", applyExtras(qNone(input), input, [["boyDate", "boy.date"], ["boyTime", "boy.time"], ["boyTz", "boy.tz"], ["girlDate", "girl.date"], ["girlTime", "girl.time"], ["girlTz", "girl.tz"], ["lang", "lang"], ["lang", "locale"]]), opts);
891
935
  }
@@ -913,6 +957,10 @@ var Narrative = class {
913
957
  planetsInSigns(input, opts) {
914
958
  return this._c.request("/v1/vedic/narrative/planets-in-signs", applyExtras(qBirth(input), input, [["lang", "lang"], ["lang", "locale"]]), opts);
915
959
  }
960
+ /** Get a Prashna (horary) narrative for the moment and place a question is asked — the Prashna lagna and Moon sections, plus the topic reading for the Prashna lagna. topic: career, financial, health, litigation, marriage, missing_person, property or travel; or questionHouse 1-12 when topic is not given (with neither, only the lagna and Moon sections). An unknown topic or a house outside 1-12 returns 400. */
961
+ prashna(input, opts) {
962
+ return this._c.request("/v1/vedic/narrative/prashna", applyExtras(qMoment(input), input, [["topic", "topic"], ["questionHouse", "question_house"], ["lang", "lang"], ["lang", "locale"]]), opts);
963
+ }
916
964
  /** Get a holistic birth chart profile narrative — an executive summary of the entire chart covering lagna, Moon sign, key planetary strengths/weaknesses, dominant yogas, current dasha, and life-theme highlights in a single comprehensive reading. */
917
965
  profile(input, opts) {
918
966
  return this._c.request("/v1/vedic/narrative/profile", applyExtras(qBirth(input), input, [["lang", "lang"], ["lang", "locale"]]), opts);
@@ -927,15 +975,15 @@ var Narrative = class {
927
975
  }
928
976
  /** Get a narrative of all past and future Sade Sati periods for a birth chart — written descriptions of each 7.5-year Saturn transit cycle with dates, life themes expected, and which phase (rising/peak/setting) the person experienced. */
929
977
  sadeSatiHistory(input, opts) {
930
- return this._c.request("/v1/vedic/narrative/sade-sati-history", applyExtras(qBirthPrefixed(input), input, [["date", "date"], ["tz", "tz"], ["lang", "lang"], ["lang", "locale"]]), opts);
978
+ return this._c.request("/v1/vedic/narrative/sade-sati-history", applyExtras(qNatalTransit(input), input, [["lang", "lang"], ["lang", "locale"]]), opts);
931
979
  }
932
980
  /** Get a narrative interpretation of the current Sade Sati phase (rising, peak, or setting) — what the current phase typically brings and remedies. */
933
981
  sadeSatiPhase(input, opts) {
934
- return this._c.request("/v1/vedic/narrative/sade-sati-phase", applyExtras(qBirthPrefixed(input), input, [["date", "date"], ["tz", "tz"], ["lang", "lang"], ["lang", "locale"]]), opts);
982
+ return this._c.request("/v1/vedic/narrative/sade-sati-phase", applyExtras(qNatalTransit(input), input, [["lang", "lang"], ["lang", "locale"]]), opts);
935
983
  }
936
984
  /** Get the current Sade Sati status with narrative context — whether the person is in Sade Sati, which phase, start/end dates, and a written description of the current transit's meaning for their Moon sign. */
937
985
  sadeSatiStatus(input, opts) {
938
- return this._c.request("/v1/vedic/narrative/sade-sati-status", applyExtras(qBirthPrefixed(input), input, [["date", "date"], ["tz", "tz"], ["lang", "lang"], ["lang", "locale"]]), opts);
986
+ return this._c.request("/v1/vedic/narrative/sade-sati-status", applyExtras(qNatalTransit(input), input, [["lang", "lang"], ["lang", "locale"]]), opts);
939
987
  }
940
988
  /** Get a narrative interpretation of the natal Sun sign (Surya Rashi) — covers ego, identity, father, authority, vitality, and the life-purpose themes associated with the Sun's sidereal sign placement. */
941
989
  sunSign(input, opts) {
@@ -947,11 +995,11 @@ var Narrative = class {
947
995
  }
948
996
  /** Get a narrative of the Double Transit analysis — written explanation of which life events the current Jupiter-Saturn joint transit is activating in the chart, and when the confluence is strongest. */
949
997
  transitDouble(input, opts) {
950
- return this._c.request("/v1/vedic/narrative/transit-double", applyExtras(qBirthPrefixed(input), input, [["date", "date"], ["tz", "tz"], ["lang", "lang"], ["lang", "locale"]]), opts);
998
+ return this._c.request("/v1/vedic/narrative/transit-double", applyExtras(qNatalTransit(input), input, [["lang", "lang"], ["lang", "locale"]]), opts);
951
999
  }
952
- /** Get the Transit Phal (gochar results) narrative — a written analysis of all current major planetary transits over the natal chart, their house positions from Moon, and the classical effects expected from each transit. */
1000
+ /** Get the Transit Phal (gochar results) narrative — the slow grahas (Mars, Jupiter, Saturn, Rahu, Ketu) by sign, their transit counted from the natal Moon and from the natal lagna, Sade Sati while it runs, the Sun's transit house, and Jupiter/Saturn/Rahu passing over natal grahas. `birth` is the natal chart (its lat/lon are sent as the birth place for the lagna sections); date/time/tz are the transit moment. */
953
1001
  transitPhal(input, opts) {
954
- return this._c.request("/v1/vedic/narrative/transit-phal", applyExtras(qBirthPrefixed(input), input, [["date", "date"], ["tz", "tz"], ["lang", "lang"], ["lang", "locale"]]), opts);
1002
+ return this._c.request("/v1/vedic/narrative/transit-phal", applyExtras(qNatalTransitPlace(input), input, [["lang", "lang"], ["lang", "locale"]]), opts);
955
1003
  }
956
1004
  /** Get a narrative of the key themes for the current Varshaphal (solar-return) year — written analysis of the annual chart's varsha lord, muntha, annual lagna, and tajika yogas as a prediction for the year's major themes. */
957
1005
  varshaphalThemes(input, opts) {
@@ -1200,6 +1248,10 @@ var Remedies = class {
1200
1248
  daan(input, opts) {
1201
1249
  return this._c.request(buildPath("/v1/vedic/remedies/daan/{id}", input, ["id"]), applyExtras(qNone(input), input, [["locale", "locale"]]), opts);
1202
1250
  }
1251
+ /** Remedies for one graha by reason (10 credits): a filter over the remedy catalogue (same rows and languages as remedies.vedic). reason: debilitated, combust, dusthana, weak_shadbala, dasha or dosha:<id> (graha is optional with dosha:<id>). Each item adds kind (mantra, daan, vrat, pooja, pilgrimage, yantra, rudraksha), weekday (0 = Sunday, or null) and matched_by. Free kinds by default; include adds pooja, pilgrimage, yantra, rudraksha; category limits to one catalogue category. */
1252
+ forGraha(input = {}, opts) {
1253
+ return this._c.request("/v1/vedic/remedies/for-graha", applyExtras(qNone(input), input, [["graha", "graha"], ["reason", "reason"], ["include", "include"], ["category", "category"], ["lang", "lang"], ["lang", "locale"]]), opts);
1254
+ }
1203
1255
  /** Lal Kitab remedies for a specific planet-in-house placement (e.g. saturn in house 8). */
1204
1256
  lalkitabForPlacement(input, opts) {
1205
1257
  return this._c.request(buildPath("/v1/vedic/remedies/lal-kitab/{planet}/{house}", input, ["planet", "house"]), applyExtras(qNone(input), input, [["locale", "locale"]]), opts);
@@ -1337,9 +1389,13 @@ var Transit = class {
1337
1389
  sadeSati(input, opts) {
1338
1390
  return this._c.request("/v1/transit/sade-sati", qBirthPrefixed(input), opts);
1339
1391
  }
1392
+ /** Sade Sati and Dhaiya windows from the natal Moon (20 credits): intervals (one per stay of Saturn in a sign, kind sade_sati with phase rising/peak/setting, dhaiya_4 kantak or dhaiya_8 ashtama, exact ingress times, retro_reentry), cycles (merged passes with phase spans) and at_from (status at from). from defaults to now, years 25 (max 60); includePast starts at birth. Every instant comes as *_local (RFC 3339 with offset) and *_jd (Julian Day, UT); fields that cannot be computed are listed in skipped. */
1393
+ sadeSatiWindows(input, opts) {
1394
+ return this._c.request("/v1/transit/sade-sati/windows", applyExtras(qNatalWindow(input), input, [["years", "years"], ["includePast", "include_past"]]), opts);
1395
+ }
1340
1396
  /** Check whether a person is currently in Small Panoti (Ashtama Shani) — the 2.5-year Saturn transit through the 8th house from natal Moon, considered challenging. */
1341
1397
  smallPanoti(input, opts) {
1342
- return this._c.request("/v1/transit/small-panoti", applyExtras(qBirthPrefixed(input), input, [["date", "date"], ["time", "time"], ["tz", "tz"]]), opts);
1398
+ return this._c.request("/v1/transit/small-panoti", qNatalTransit(input), opts);
1343
1399
  }
1344
1400
  /** Get the complete history and future windows of Small Panoti (Ashtama Shani) for a natal chart — all past and upcoming 2.5-year periods when Saturn transits the 8th house from natal Moon. */
1345
1401
  smallPanotiHistory(input, opts) {
@@ -1353,6 +1409,10 @@ var Transit = class {
1353
1409
  vedha(input, opts) {
1354
1410
  return this._c.request("/v1/transit/vedha", qNatalTransit(input), opts);
1355
1411
  }
1412
+ /** Every stay of one planet (sun..ketu) in a sidereal sign that overlaps [from, from + years] (20 credits), with exact ingress times, retro_reentry and retrograde_at_start. With birth (date, time, tz) each window has house_from_moon; with birth lat/lon also house_from_lagna. years: default 25 / max 60 for jupiter, saturn, rahu, ketu; 5 / 20 for sun, mercury, venus, mars; 1 / 2 for moon. Every instant comes as *_local (RFC 3339 with offset) and *_jd (Julian Day, UT); fields that cannot be computed are listed in skipped. */
1413
+ windows(input, opts) {
1414
+ return this._c.request("/v1/transit/windows", applyExtras(qNatalWindow(input), input, [["planet", "planet"], ["years", "years"]]), opts);
1415
+ }
1356
1416
  };
1357
1417
 
1358
1418
  // src/resources/varshaphal.ts
@@ -1368,7 +1428,7 @@ var Varshaphal = class {
1368
1428
  harshaBala(input, opts) {
1369
1429
  return this._c.request("/v1/varshaphal/harsha-bala", applyExtras(qBirth(input), input, [["year", "year"]]), opts);
1370
1430
  }
1371
- /** Get the Varsha Lord (year ruler) for an annual chart — the planet that rules the Varshaphal year based on the Tajika system. */
1431
+ /** Get the Varsha Lord (Varshesha, year ruler) for an annual chart, chosen by the Tajika Panchadhikari rule from the five office-bearers (Munthesh, Janmesh, Varsha Lagnesh, Trirashipati, Dina/Ratripati); the response also lists the candidates and the hora lord of the return. */
1372
1432
  lord(input, opts) {
1373
1433
  return this._c.request("/v1/varshaphal/lord", applyExtras(qBirth(input), input, [["year", "year"]]), opts);
1374
1434
  }