FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
astro-api-nodejs-client/src/types.ts at master · astrologyapi/astro-api-nodejs-client · GitHub
astrologyapi
/
astro-api-nodejs-client
Public
Notifications
You must be signed in to change notification settings
Fork
9
Star
9
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
astro-api-nodejs-client
/
src
/
types.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
214 lines (198 loc) · 6.23 KB
Breadcrumbs
astro-api-nodejs-client
/
src
/
types.ts
Copy path
File metadata and controls
214 lines (198 loc) · 6.23 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
// ─────────────────────────────────────────────────────────────────────────────
// Core input types shared across all namespaces
// ─────────────────────────────────────────────────────────────────────────────
/**
* Birth data required by most Vedic and Western astrology endpoints.
*/
export
interface
BirthData
{
/** Day of birth (1–31) */
day
:
number
;
/** Month of birth (1–12) */
month
:
number
;
/** Year of birth (e.g. 1990) */
year
:
number
;
/** Hour of birth in 24-hour format (0–23) */
hour
:
number
;
/** Minute of birth (0–59) */
min
:
number
;
/** Latitude of birth place (e.g. 19.20 for Mumbai) */
lat
:
number
;
/** Longitude of birth place (e.g. 72.83 for Mumbai) */
lon
:
number
;
/** Timezone offset from UTC (e.g. 5.5 for IST) */
tzone
:
number
;
}
/**
* Two birth data objects for matchmaking / compatibility endpoints.
*/
export
interface
MatchBirthData
{
male
:
BirthData
;
female
:
BirthData
;
}
/**
* Birth data required by Western compatibility endpoints (person 1 & person 2).
*/
export
interface
CoupleBirthData
{
person1
:
BirthData
;
person2
:
BirthData
;
}
/**
* Input for Vedic numerology endpoints.
*/
export
interface
NumerologyData
{
day
:
number
;
month
:
number
;
year
:
number
;
/** Full name of the person */
name
:
string
;
}
/**
* Input for Varshaphal (annual chart) endpoints.
* `varshaphal_year` is the preferred field.
* `year_count` is kept for backward compatibility and is converted to `birthYear + year_count`.
*/
export
interface
VarshaphalData
extends
BirthData
{
/** Target calendar year for the Varshaphal chart/report (preferred). */
varshaphal_year
?:
number
;
/** Legacy year offset from birth year. */
year_count
?:
number
;
/** Ayanamsha system. Defaults to LAHIRI when omitted. */
ayanamsha
?:
string
;
}
/**
* Input for Papasamyam details.
* The live API expects a single profile plus `full_name`, `day`/`date`, and `ayanamsha`.
*/
export
interface
PapasamyamData
extends
BirthData
{
/** Full name used by the API. If omitted, SDK will reuse `name` when available. */
full_name
?:
string
;
/** Compatibility alias retained for callers already using `name`. */
name
?:
string
;
/** Some examples include both `day` and `date`; defaults to `day`. */
date
?:
number
;
/** Ayanamsha system. Defaults to LAHIRI when omitted. */
ayanamsha
?:
string
;
}
/**
* White-label branding options for PDF report endpoints.
* All fields are optional — only provided values are sent to the API.
*/
export
interface
PDFBranding
{
/** URL of company logo to embed in the PDF */
logoUrl
?:
string
;
/** Company or brand name printed on the report */
companyName
?:
string
;
/** Short company description */
companyInfo
?:
string
;
/** Company website URL shown in the footer */
domainUrl
?:
string
;
/** Contact email shown in the report */
companyEmail
?:
string
;
/** Landline number shown in the report */
companyLandline
?:
string
;
/** Mobile number shown in the report */
companyMobile
?:
string
;
/** Custom footer link */
footerLink
?:
string
;
/** Chart rendering style: "NORTH_INDIAN" | "SOUTH_INDIAN" | "EAST_INDIAN" */
chartStyle
?:
"NORTH_INDIAN"
|
"SOUTH_INDIAN"
|
"EAST_INDIAN"
;
}
// ─────────────────────────────────────────────────────────────────────────────
// Domain-specific literal types
// ─────────────────────────────────────────────────────────────────────────────
/** Divisional (Varga) chart identifiers. D1 is the Lagna (main) chart. */
export
type
ChartId
=
|
"D1"
|
"D2"
|
"D3"
|
"D4"
|
"D5"
|
"D7"
|
"D9"
|
"D10"
|
"D12"
|
"D16"
|
"D20"
|
"D24"
|
"D27"
|
"D30"
|
"D40"
|
"D45"
|
"D60"
;
/** Western / tropical zodiac sign names (lowercase). */
export
type
ZodiacSign
=
|
"aries"
|
"taurus"
|
"gemini"
|
"cancer"
|
"leo"
|
"virgo"
|
"libra"
|
"scorpio"
|
"sagittarius"
|
"capricorn"
|
"aquarius"
|
"pisces"
;
/** Planet names used in parameterised endpoints. */
export
type
PlanetName
=
|
"sun"
|
"moon"
|
"mars"
|
"mercury"
|
"jupiter"
|
"venus"
|
"saturn"
|
"rahu"
|
"ketu"
|
"ascendant"
;
/** Vimshottari major-dasha planet names (used in sub-dasha endpoints). */
export
type
MajorDashaPlanet
=
|
"sun"
|
"moon"
|
"mars"
|
"rahu"
|
"jupiter"
|
"saturn"
|
"mercury"
|
"ketu"
|
"venus"
;
/** Backward-compatible alias for Vimshottari dasha path parameters. */
export
type
DashaPlanet
=
MajorDashaPlanet
;
/** Language codes accepted by the API for localised responses. */
export
type
Language
=
|
"en"
|
"hi"
|
"te"
|
"ta"
|
"ml"
|
"kn"
|
"mr"
|
"bn"
|
"gu"
|
"or"
|
"pa"
;
// ─────────────────────────────────────────────────────────────────────────────
// SDK configuration
// ─────────────────────────────────────────────────────────────────────────────
export
interface
AstrologyAPIConfig
{
/**
* Your AstrologyAPI user ID.
* Falls back to the ASTROLOGYAPI_USER_ID environment variable.
*/
userId
?:
string
;
/**
* Your AstrologyAPI key.
* Falls back to the ASTROLOGYAPI_API_KEY environment variable.
*/
apiKey
?:
string
;
/**
* Access token for direct header-based authentication.
* Falls back to the ASTROLOGYAPI_ACCESS_TOKEN environment variable.
* When provided, userId is not required and the SDK sends x-astrologyapi-key.
*/
access_token
?:
string
;
/**
* API version string. Defaults to "v1".
*/
version
?:
string
;
}
Back
|
FazBrowse Home
|
New Git URL