lifeastroapi 0.9.1 → 0.13.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/README.md +44 -3
- package/dist/index.cjs +45 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +46 -6
- package/dist/index.d.ts +46 -6
- package/dist/index.js +45 -4
- package/dist/index.js.map +1 -1
- package/package.json +8 -2
package/dist/index.d.cts
CHANGED
|
@@ -191,6 +191,34 @@ type QueryValue = string | number | boolean | null | undefined;
|
|
|
191
191
|
type QueryParams = Record<string, QueryValue>;
|
|
192
192
|
|
|
193
193
|
type FetchLike = (input: string, init?: RequestInit) => Promise<Response>;
|
|
194
|
+
/**
|
|
195
|
+
* What the API reported about one call besides its body: the request id, your credit balance
|
|
196
|
+
* after the call, your plan's per-minute rate limit and whether the answer came from the API's
|
|
197
|
+
* cache. Passed to `onResponse` (client option or per call) for every final HTTP response,
|
|
198
|
+
* success or error; not for network failures or for attempts that were retried.
|
|
199
|
+
*/
|
|
200
|
+
interface ResponseInfo {
|
|
201
|
+
/** HTTP status of the response. */
|
|
202
|
+
status: number;
|
|
203
|
+
/** Request path, e.g. `/v1/panchang/basic`. */
|
|
204
|
+
path: string;
|
|
205
|
+
/** `X-Request-ID`. Quote it to support. */
|
|
206
|
+
requestId?: string;
|
|
207
|
+
/** `X-Credits-Remaining`: the balance after this call (unchanged after a failed call). Absent on free-tier accounts, whose allowance is not a balance, and on calls that cost nothing. */
|
|
208
|
+
creditsRemaining?: number;
|
|
209
|
+
/** `X-RateLimit-*`: requests per minute for your plan, how many are left, and when the window resets. */
|
|
210
|
+
rateLimit?: {
|
|
211
|
+
limit: number;
|
|
212
|
+
remaining: number;
|
|
213
|
+
resetAt: Date;
|
|
214
|
+
};
|
|
215
|
+
/** `X-Cache`, e.g. `HIT` when the API answered from its cache (the call is billed the same). */
|
|
216
|
+
cache?: string;
|
|
217
|
+
/** `Content-Language`: the language the answer is in. */
|
|
218
|
+
language?: string;
|
|
219
|
+
}
|
|
220
|
+
/** Receives the {@link ResponseInfo} of each call. Errors thrown inside it are ignored. */
|
|
221
|
+
type ResponseHook = (info: ResponseInfo) => void;
|
|
194
222
|
interface RequestOptions {
|
|
195
223
|
/** Per-call abort signal (in addition to the timeout). */
|
|
196
224
|
signal?: AbortSignal;
|
|
@@ -198,6 +226,8 @@ interface RequestOptions {
|
|
|
198
226
|
timeoutMs?: number;
|
|
199
227
|
/** Return the response body exactly as received, without unwrapping a `{ data, meta }` envelope if one is present. */
|
|
200
228
|
raw?: boolean;
|
|
229
|
+
/** Called with this call's {@link ResponseInfo} (after the client-level `onResponse`). */
|
|
230
|
+
onResponse?: ResponseHook;
|
|
201
231
|
}
|
|
202
232
|
|
|
203
233
|
declare class Ashtakavarga {
|
|
@@ -326,14 +356,14 @@ declare class Chart {
|
|
|
326
356
|
houses<T = unknown>(input: BirthInput & VedicBirthSettings & {
|
|
327
357
|
lang?: Locale;
|
|
328
358
|
}, opts?: RequestOptions): Promise<T>;
|
|
329
|
-
/**
|
|
359
|
+
/** KP house significators for all 12 Placidus cusps (20 credits): each cusp's star, sub and sub-sub lords and its significator planets (four KP levels), the houses every planet signifies, and the KP 4-step chain. Pass ayanamsa krishnamurti for KP work. `cusp` is accepted for compatibility and ignored: all 12 cusps are returned. */
|
|
330
360
|
kpHouseSignificator<T = unknown>(input: BirthInput & VedicBirthSettings & {
|
|
331
|
-
cusp
|
|
361
|
+
cusp?: number;
|
|
332
362
|
lang?: Locale;
|
|
333
363
|
}, opts?: RequestOptions): Promise<T>;
|
|
334
|
-
/**
|
|
364
|
+
/** KP star, sub and sub-sub lords of every planet (10 credits), and the KP ruling planets for the moment and place (day lord, and the star, sign and sub lords of the ascendant and the Moon); send the moment of judgement for horary or timing. Pass ayanamsa krishnamurti for KP work. `planet` is accepted for compatibility and ignored: all planets are returned. */
|
|
335
365
|
kpSublord<T = unknown>(input: BirthInput & VedicBirthSettings & {
|
|
336
|
-
planet
|
|
366
|
+
planet?: string;
|
|
337
367
|
lang?: Locale;
|
|
338
368
|
}, opts?: RequestOptions): Promise<T>;
|
|
339
369
|
/** 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. */
|
|
@@ -1163,6 +1193,11 @@ declare class Prashna {
|
|
|
1163
1193
|
chart<T = unknown>(input: MomentInput & VedicMomentSettings & {
|
|
1164
1194
|
lang?: Locale;
|
|
1165
1195
|
}, opts?: RequestOptions): Promise<T>;
|
|
1196
|
+
/** KP horary chart for a number from 1 to 249 (30 credits), cast for the moment and place of judgement: the horary ascendant (the first degree of that number's sign/star/sub part), the 12 Placidus cusps with star, sub and sub-sub lords and significators, planets with KP lords and houses, planet significators, the 4-step chain and the ruling planets of the moment. Uses the Krishnamurti ayanamsa unless ayanamsa is sent. */
|
|
1197
|
+
kpHorary<T = unknown>(input: MomentInput & VedicMomentSettings & {
|
|
1198
|
+
number: number;
|
|
1199
|
+
lang?: Locale;
|
|
1200
|
+
}, opts?: RequestOptions): Promise<T>;
|
|
1166
1201
|
/** Get the lagna lord analysis for a Prashna chart — where the lagna lord is placed, its strength, and what it indicates about the querent's situation and chances of success. */
|
|
1167
1202
|
lagnaLord<T = unknown>(input: MomentInput & VedicMomentSettings & {
|
|
1168
1203
|
lang?: Locale;
|
|
@@ -2031,7 +2066,7 @@ declare class Resources {
|
|
|
2031
2066
|
*/
|
|
2032
2067
|
|
|
2033
2068
|
/** SDK version, surfaced in the User-Agent header. */
|
|
2034
|
-
declare const VERSION = "0.
|
|
2069
|
+
declare const VERSION = "0.13.0";
|
|
2035
2070
|
interface LifeAstroOptions {
|
|
2036
2071
|
/**
|
|
2037
2072
|
* API key (`dv_live_...`). Falls back to the `LIFEASTRO_API_KEY` environment
|
|
@@ -2048,6 +2083,11 @@ interface LifeAstroOptions {
|
|
|
2048
2083
|
fetch?: FetchLike;
|
|
2049
2084
|
/** Extra headers sent on every request. */
|
|
2050
2085
|
defaultHeaders?: Record<string, string>;
|
|
2086
|
+
/**
|
|
2087
|
+
* Called with the {@link ResponseInfo} of every call: request id, credits left, rate limit,
|
|
2088
|
+
* cache and language. Use it to log usage or warn when credits run low.
|
|
2089
|
+
*/
|
|
2090
|
+
onResponse?: ResponseHook;
|
|
2051
2091
|
}
|
|
2052
2092
|
/** The minimal surface a resource namespace needs from the client. @internal */
|
|
2053
2093
|
interface ClientCore {
|
|
@@ -2165,4 +2205,4 @@ declare class LifeAstroConnectionError extends LifeAstroError {
|
|
|
2165
2205
|
* @packageDocumentation
|
|
2166
2206
|
*/
|
|
2167
2207
|
|
|
2168
|
-
export { type ApiErrorBody, AuthenticationError, type Ayanamsa, BadRequestError, type BirthInput, type BoyGirlInput, type ClientCore, type DateRangeInput, type FetchLike, type HouseSystem, LifeAstro, LifeAstroConnectionError, LifeAstroError, type LifeAstroOptions, type Locale, type MomentInput, type MuhurtaInput, type NatalTransitInput, type NatalWindowBirth, type NatalWindowInput, NotFoundError, type NumerologyInput, type OptionalNatalWindowInput, PaymentRequiredError, PermissionError, type QueryParams, type QueryValue, type RashiInput, RateLimitError, type RequestOptions, type ResponseEnvelope, type ResponseMeta, ServerError, type TwoPersonInput, VERSION, type VedicBirthSettings, type VedicMomentSettings, type WesternMomentInput, type WesternNatalInput, LifeAstro as default };
|
|
2208
|
+
export { type ApiErrorBody, AuthenticationError, type Ayanamsa, BadRequestError, type BirthInput, type BoyGirlInput, type ClientCore, type DateRangeInput, type FetchLike, type HouseSystem, LifeAstro, LifeAstroConnectionError, LifeAstroError, type LifeAstroOptions, type Locale, type MomentInput, type MuhurtaInput, type NatalTransitInput, type NatalWindowBirth, type NatalWindowInput, NotFoundError, type NumerologyInput, type OptionalNatalWindowInput, PaymentRequiredError, PermissionError, type QueryParams, type QueryValue, type RashiInput, RateLimitError, type RequestOptions, type ResponseEnvelope, type ResponseHook, type ResponseInfo, type ResponseMeta, ServerError, type TwoPersonInput, VERSION, type VedicBirthSettings, type VedicMomentSettings, type WesternMomentInput, type WesternNatalInput, LifeAstro as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -191,6 +191,34 @@ type QueryValue = string | number | boolean | null | undefined;
|
|
|
191
191
|
type QueryParams = Record<string, QueryValue>;
|
|
192
192
|
|
|
193
193
|
type FetchLike = (input: string, init?: RequestInit) => Promise<Response>;
|
|
194
|
+
/**
|
|
195
|
+
* What the API reported about one call besides its body: the request id, your credit balance
|
|
196
|
+
* after the call, your plan's per-minute rate limit and whether the answer came from the API's
|
|
197
|
+
* cache. Passed to `onResponse` (client option or per call) for every final HTTP response,
|
|
198
|
+
* success or error; not for network failures or for attempts that were retried.
|
|
199
|
+
*/
|
|
200
|
+
interface ResponseInfo {
|
|
201
|
+
/** HTTP status of the response. */
|
|
202
|
+
status: number;
|
|
203
|
+
/** Request path, e.g. `/v1/panchang/basic`. */
|
|
204
|
+
path: string;
|
|
205
|
+
/** `X-Request-ID`. Quote it to support. */
|
|
206
|
+
requestId?: string;
|
|
207
|
+
/** `X-Credits-Remaining`: the balance after this call (unchanged after a failed call). Absent on free-tier accounts, whose allowance is not a balance, and on calls that cost nothing. */
|
|
208
|
+
creditsRemaining?: number;
|
|
209
|
+
/** `X-RateLimit-*`: requests per minute for your plan, how many are left, and when the window resets. */
|
|
210
|
+
rateLimit?: {
|
|
211
|
+
limit: number;
|
|
212
|
+
remaining: number;
|
|
213
|
+
resetAt: Date;
|
|
214
|
+
};
|
|
215
|
+
/** `X-Cache`, e.g. `HIT` when the API answered from its cache (the call is billed the same). */
|
|
216
|
+
cache?: string;
|
|
217
|
+
/** `Content-Language`: the language the answer is in. */
|
|
218
|
+
language?: string;
|
|
219
|
+
}
|
|
220
|
+
/** Receives the {@link ResponseInfo} of each call. Errors thrown inside it are ignored. */
|
|
221
|
+
type ResponseHook = (info: ResponseInfo) => void;
|
|
194
222
|
interface RequestOptions {
|
|
195
223
|
/** Per-call abort signal (in addition to the timeout). */
|
|
196
224
|
signal?: AbortSignal;
|
|
@@ -198,6 +226,8 @@ interface RequestOptions {
|
|
|
198
226
|
timeoutMs?: number;
|
|
199
227
|
/** Return the response body exactly as received, without unwrapping a `{ data, meta }` envelope if one is present. */
|
|
200
228
|
raw?: boolean;
|
|
229
|
+
/** Called with this call's {@link ResponseInfo} (after the client-level `onResponse`). */
|
|
230
|
+
onResponse?: ResponseHook;
|
|
201
231
|
}
|
|
202
232
|
|
|
203
233
|
declare class Ashtakavarga {
|
|
@@ -326,14 +356,14 @@ declare class Chart {
|
|
|
326
356
|
houses<T = unknown>(input: BirthInput & VedicBirthSettings & {
|
|
327
357
|
lang?: Locale;
|
|
328
358
|
}, opts?: RequestOptions): Promise<T>;
|
|
329
|
-
/**
|
|
359
|
+
/** KP house significators for all 12 Placidus cusps (20 credits): each cusp's star, sub and sub-sub lords and its significator planets (four KP levels), the houses every planet signifies, and the KP 4-step chain. Pass ayanamsa krishnamurti for KP work. `cusp` is accepted for compatibility and ignored: all 12 cusps are returned. */
|
|
330
360
|
kpHouseSignificator<T = unknown>(input: BirthInput & VedicBirthSettings & {
|
|
331
|
-
cusp
|
|
361
|
+
cusp?: number;
|
|
332
362
|
lang?: Locale;
|
|
333
363
|
}, opts?: RequestOptions): Promise<T>;
|
|
334
|
-
/**
|
|
364
|
+
/** KP star, sub and sub-sub lords of every planet (10 credits), and the KP ruling planets for the moment and place (day lord, and the star, sign and sub lords of the ascendant and the Moon); send the moment of judgement for horary or timing. Pass ayanamsa krishnamurti for KP work. `planet` is accepted for compatibility and ignored: all planets are returned. */
|
|
335
365
|
kpSublord<T = unknown>(input: BirthInput & VedicBirthSettings & {
|
|
336
|
-
planet
|
|
366
|
+
planet?: string;
|
|
337
367
|
lang?: Locale;
|
|
338
368
|
}, opts?: RequestOptions): Promise<T>;
|
|
339
369
|
/** 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. */
|
|
@@ -1163,6 +1193,11 @@ declare class Prashna {
|
|
|
1163
1193
|
chart<T = unknown>(input: MomentInput & VedicMomentSettings & {
|
|
1164
1194
|
lang?: Locale;
|
|
1165
1195
|
}, opts?: RequestOptions): Promise<T>;
|
|
1196
|
+
/** KP horary chart for a number from 1 to 249 (30 credits), cast for the moment and place of judgement: the horary ascendant (the first degree of that number's sign/star/sub part), the 12 Placidus cusps with star, sub and sub-sub lords and significators, planets with KP lords and houses, planet significators, the 4-step chain and the ruling planets of the moment. Uses the Krishnamurti ayanamsa unless ayanamsa is sent. */
|
|
1197
|
+
kpHorary<T = unknown>(input: MomentInput & VedicMomentSettings & {
|
|
1198
|
+
number: number;
|
|
1199
|
+
lang?: Locale;
|
|
1200
|
+
}, opts?: RequestOptions): Promise<T>;
|
|
1166
1201
|
/** Get the lagna lord analysis for a Prashna chart — where the lagna lord is placed, its strength, and what it indicates about the querent's situation and chances of success. */
|
|
1167
1202
|
lagnaLord<T = unknown>(input: MomentInput & VedicMomentSettings & {
|
|
1168
1203
|
lang?: Locale;
|
|
@@ -2031,7 +2066,7 @@ declare class Resources {
|
|
|
2031
2066
|
*/
|
|
2032
2067
|
|
|
2033
2068
|
/** SDK version, surfaced in the User-Agent header. */
|
|
2034
|
-
declare const VERSION = "0.
|
|
2069
|
+
declare const VERSION = "0.13.0";
|
|
2035
2070
|
interface LifeAstroOptions {
|
|
2036
2071
|
/**
|
|
2037
2072
|
* API key (`dv_live_...`). Falls back to the `LIFEASTRO_API_KEY` environment
|
|
@@ -2048,6 +2083,11 @@ interface LifeAstroOptions {
|
|
|
2048
2083
|
fetch?: FetchLike;
|
|
2049
2084
|
/** Extra headers sent on every request. */
|
|
2050
2085
|
defaultHeaders?: Record<string, string>;
|
|
2086
|
+
/**
|
|
2087
|
+
* Called with the {@link ResponseInfo} of every call: request id, credits left, rate limit,
|
|
2088
|
+
* cache and language. Use it to log usage or warn when credits run low.
|
|
2089
|
+
*/
|
|
2090
|
+
onResponse?: ResponseHook;
|
|
2051
2091
|
}
|
|
2052
2092
|
/** The minimal surface a resource namespace needs from the client. @internal */
|
|
2053
2093
|
interface ClientCore {
|
|
@@ -2165,4 +2205,4 @@ declare class LifeAstroConnectionError extends LifeAstroError {
|
|
|
2165
2205
|
* @packageDocumentation
|
|
2166
2206
|
*/
|
|
2167
2207
|
|
|
2168
|
-
export { type ApiErrorBody, AuthenticationError, type Ayanamsa, BadRequestError, type BirthInput, type BoyGirlInput, type ClientCore, type DateRangeInput, type FetchLike, type HouseSystem, LifeAstro, LifeAstroConnectionError, LifeAstroError, type LifeAstroOptions, type Locale, type MomentInput, type MuhurtaInput, type NatalTransitInput, type NatalWindowBirth, type NatalWindowInput, NotFoundError, type NumerologyInput, type OptionalNatalWindowInput, PaymentRequiredError, PermissionError, type QueryParams, type QueryValue, type RashiInput, RateLimitError, type RequestOptions, type ResponseEnvelope, type ResponseMeta, ServerError, type TwoPersonInput, VERSION, type VedicBirthSettings, type VedicMomentSettings, type WesternMomentInput, type WesternNatalInput, LifeAstro as default };
|
|
2208
|
+
export { type ApiErrorBody, AuthenticationError, type Ayanamsa, BadRequestError, type BirthInput, type BoyGirlInput, type ClientCore, type DateRangeInput, type FetchLike, type HouseSystem, LifeAstro, LifeAstroConnectionError, LifeAstroError, type LifeAstroOptions, type Locale, type MomentInput, type MuhurtaInput, type NatalTransitInput, type NatalWindowBirth, type NatalWindowInput, NotFoundError, type NumerologyInput, type OptionalNatalWindowInput, PaymentRequiredError, PermissionError, type QueryParams, type QueryValue, type RashiInput, RateLimitError, type RequestOptions, type ResponseEnvelope, type ResponseHook, type ResponseInfo, type ResponseMeta, ServerError, type TwoPersonInput, VERSION, type VedicBirthSettings, type VedicMomentSettings, type WesternMomentInput, type WesternNatalInput, LifeAstro as default };
|
package/dist/index.js
CHANGED
|
@@ -65,6 +65,40 @@ function httpStatusCode(status) {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
// src/http.ts
|
|
68
|
+
function responseInfo(res, path) {
|
|
69
|
+
const h = res.headers;
|
|
70
|
+
const num = (name) => {
|
|
71
|
+
const v = h.get(name);
|
|
72
|
+
if (v === null || v.trim() === "") return void 0;
|
|
73
|
+
const n = Number(v);
|
|
74
|
+
return Number.isFinite(n) ? n : void 0;
|
|
75
|
+
};
|
|
76
|
+
const info = { status: res.status, path };
|
|
77
|
+
const rid = h.get("x-request-id");
|
|
78
|
+
if (rid) info.requestId = rid;
|
|
79
|
+
const credits = num("x-credits-remaining");
|
|
80
|
+
if (credits !== void 0) info.creditsRemaining = credits;
|
|
81
|
+
const limit = num("x-ratelimit-limit");
|
|
82
|
+
const remaining = num("x-ratelimit-remaining");
|
|
83
|
+
const reset = num("x-ratelimit-reset");
|
|
84
|
+
if (limit !== void 0 && remaining !== void 0 && reset !== void 0) {
|
|
85
|
+
info.rateLimit = { limit, remaining, resetAt: new Date(reset * 1e3) };
|
|
86
|
+
}
|
|
87
|
+
const cache = h.get("x-cache");
|
|
88
|
+
if (cache) info.cache = cache;
|
|
89
|
+
const lang = h.get("content-language");
|
|
90
|
+
if (lang) info.language = lang;
|
|
91
|
+
return info;
|
|
92
|
+
}
|
|
93
|
+
function emit(hooks, info) {
|
|
94
|
+
for (const hook of hooks) {
|
|
95
|
+
if (!hook) continue;
|
|
96
|
+
try {
|
|
97
|
+
hook(info);
|
|
98
|
+
} catch {
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
68
102
|
var RETRYABLE_STATUS = /* @__PURE__ */ new Set([408, 425, 429, 500, 502, 503, 504]);
|
|
69
103
|
function encodeQuery(params) {
|
|
70
104
|
const usp = new URLSearchParams();
|
|
@@ -166,6 +200,7 @@ async function performRequest(config, path, query, opts = {}) {
|
|
|
166
200
|
body = text;
|
|
167
201
|
}
|
|
168
202
|
if (res.ok) {
|
|
203
|
+
emit([config.onResponse, opts.onResponse], responseInfo(res, path));
|
|
169
204
|
if (opts.raw) return body;
|
|
170
205
|
const envelope = body;
|
|
171
206
|
if (envelope && typeof envelope === "object" && "data" in envelope) {
|
|
@@ -179,6 +214,7 @@ async function performRequest(config, path, query, opts = {}) {
|
|
|
179
214
|
await sleep(backoffMs(attempt, retryAfter), opts.signal);
|
|
180
215
|
continue;
|
|
181
216
|
}
|
|
217
|
+
emit([config.onResponse, opts.onResponse], responseInfo(res, path));
|
|
182
218
|
throw lastError;
|
|
183
219
|
}
|
|
184
220
|
throw lastError ?? new LifeAstroConnectionError("Request failed after retries");
|
|
@@ -491,11 +527,11 @@ var Chart = class {
|
|
|
491
527
|
houses(input, opts) {
|
|
492
528
|
return this._c.request("/v1/chart/houses", applyExtras(qBirth(input), input, [["lang", "lang"], ["lang", "locale"]]), opts);
|
|
493
529
|
}
|
|
494
|
-
/**
|
|
530
|
+
/** KP house significators for all 12 Placidus cusps (20 credits): each cusp's star, sub and sub-sub lords and its significator planets (four KP levels), the houses every planet signifies, and the KP 4-step chain. Pass ayanamsa krishnamurti for KP work. `cusp` is accepted for compatibility and ignored: all 12 cusps are returned. */
|
|
495
531
|
kpHouseSignificator(input, opts) {
|
|
496
532
|
return this._c.request("/v1/chart/kp-house-significator", applyExtras(qBirth(input), input, [["cusp", "cusp"], ["lang", "lang"], ["lang", "locale"]]), opts);
|
|
497
533
|
}
|
|
498
|
-
/**
|
|
534
|
+
/** KP star, sub and sub-sub lords of every planet (10 credits), and the KP ruling planets for the moment and place (day lord, and the star, sign and sub lords of the ascendant and the Moon); send the moment of judgement for horary or timing. Pass ayanamsa krishnamurti for KP work. `planet` is accepted for compatibility and ignored: all planets are returned. */
|
|
499
535
|
kpSublord(input, opts) {
|
|
500
536
|
return this._c.request("/v1/chart/kp-sublord", applyExtras(qBirth(input), input, [["planet", "planet"], ["lang", "lang"], ["lang", "locale"]]), opts);
|
|
501
537
|
}
|
|
@@ -1225,6 +1261,10 @@ var Prashna = class {
|
|
|
1225
1261
|
chart(input, opts) {
|
|
1226
1262
|
return this._c.request("/v1/prashna/chart", applyExtras(qMoment(input), input, [["lang", "lang"], ["lang", "locale"]]), opts);
|
|
1227
1263
|
}
|
|
1264
|
+
/** KP horary chart for a number from 1 to 249 (30 credits), cast for the moment and place of judgement: the horary ascendant (the first degree of that number's sign/star/sub part), the 12 Placidus cusps with star, sub and sub-sub lords and significators, planets with KP lords and houses, planet significators, the 4-step chain and the ruling planets of the moment. Uses the Krishnamurti ayanamsa unless ayanamsa is sent. */
|
|
1265
|
+
kpHorary(input, opts) {
|
|
1266
|
+
return this._c.request("/v1/prashna/kp-horary", applyExtras(qMoment(input), input, [["number", "number"], ["lang", "lang"], ["lang", "locale"]]), opts);
|
|
1267
|
+
}
|
|
1228
1268
|
/** Get the lagna lord analysis for a Prashna chart — where the lagna lord is placed, its strength, and what it indicates about the querent's situation and chances of success. */
|
|
1229
1269
|
lagnaLord(input, opts) {
|
|
1230
1270
|
return this._c.request("/v1/prashna/lagna-lord", applyExtras(qMoment(input), input, [["lang", "lang"], ["lang", "locale"]]), opts);
|
|
@@ -1975,7 +2015,7 @@ var Resources = class {
|
|
|
1975
2015
|
};
|
|
1976
2016
|
|
|
1977
2017
|
// src/client.ts
|
|
1978
|
-
var VERSION = "0.
|
|
2018
|
+
var VERSION = "0.13.0";
|
|
1979
2019
|
var DEFAULT_BASE_URL = "https://api.lifeastroapi.com";
|
|
1980
2020
|
function resolveConfig(options) {
|
|
1981
2021
|
const opts = typeof options === "string" ? { apiKey: options } : options ?? {};
|
|
@@ -1999,7 +2039,8 @@ function resolveConfig(options) {
|
|
|
1999
2039
|
maxRetries: Math.max(0, opts.maxRetries ?? 2),
|
|
2000
2040
|
fetch: fetchImpl,
|
|
2001
2041
|
userAgent: `lifeastroapi-node/${VERSION}`,
|
|
2002
|
-
defaultHeaders: opts.defaultHeaders ?? {}
|
|
2042
|
+
defaultHeaders: opts.defaultHeaders ?? {},
|
|
2043
|
+
onResponse: opts.onResponse
|
|
2003
2044
|
};
|
|
2004
2045
|
}
|
|
2005
2046
|
var LifeAstro = class extends Resources {
|