@roxyapi/sdk 1.2.24 → 1.2.25
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/AGENTS.md +13 -2
- package/README.md +4 -4
- package/dist/factory.cjs +1 -1
- package/dist/factory.js +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/version.ts +1 -1
package/AGENTS.md
CHANGED
|
@@ -57,6 +57,16 @@ Type `roxy.` to see all available namespaces. Type `roxy.{domain}.` to see every
|
|
|
57
57
|
|
|
58
58
|
**Total:** 130 endpoints across 10 product domains plus usage and languages. Counts auto-sync from `specs/openapi.json` at release time.
|
|
59
59
|
|
|
60
|
+
## Quality guidelines for agents
|
|
61
|
+
|
|
62
|
+
Five rules to follow when writing any call with this SDK. Get these right and the generated types do the rest.
|
|
63
|
+
|
|
64
|
+
- **One options object, hey-api wrapped.** Every method takes a single object with `path`, `query`, and `body` keys. Path params go in `path`, query params in `query`, request body in `body`. Never flat named args. Right: `roxy.astrology.getDailyHoroscope({ path: { sign: 'aries' } })`. Wrong: `roxy.astrology.getDailyHoroscope({ sign: 'aries' })`.
|
|
65
|
+
- **Always `await`. Always destructure `{ data, error, response }`.** All methods are async. `data` is the typed success response (undefined on error). `error` is the typed API error (`{ error: string, code: string }`, undefined on success). `response` is the raw `fetch` Response. Switch on `error.code`, not on `error.error`.
|
|
66
|
+
- **Method names match the OpenAPI `operationId` verbatim.** When in doubt, autocomplete `roxy.{domain}.` in your editor or `grep 'public ' node_modules/@roxyapi/sdk/dist/factory.d.ts`. Never invent a method from the URL path or a guess.
|
|
67
|
+
- **Response field names come from the spec's response schema.** Field access is typed dot syntax (`data.cities[0].timezone`). TypeScript will catch any invented field at compile time via the generated types - if `tsc` complains, the field does not exist.
|
|
68
|
+
- **Do not hand-roll requests.** No raw `fetch`, no axios. The SDK injects auth, base URL, retries, and typed responses. Use `createRoxy(key)` for the common case, or `new Roxy({ client })` with `createClient` from `@roxyapi/sdk/client` when you need a custom fetch or interceptors.
|
|
69
|
+
|
|
60
70
|
## Critical patterns
|
|
61
71
|
|
|
62
72
|
### Two-step pattern for coordinate-dependent endpoints
|
|
@@ -192,13 +202,14 @@ These are the fields AI agents most often get wrong. Copy the format column exac
|
|
|
192
202
|
| `latitude` | Decimal degrees (number) | `28.6139` (Delhi), `-33.8688` (Sydney), `40.7128` (NYC) | `"28°36'N"`, `"28 36 50"`, strings |
|
|
193
203
|
| `longitude` | Decimal degrees (number) | `77.209` (Delhi), `-74.006` (NYC), `139.6917` (Tokyo) | Same as latitude - no DMS strings |
|
|
194
204
|
| `sign` (horoscope path) | Lowercase zodiac name | `aries`, `taurus`, `gemini`, ... `pisces` | `"Aries"`, `"♈"`, `"1"`, `"ARIES"` (case-insensitive but prefer lowercase) |
|
|
205
|
+
| `chakra` (crystals path) | Title-case English name from the fixed enum | `"Root"`, `"Sacral"`, `"Solar Plexus"`, `"Heart"`, `"Throat"`, `"Third Eye"`, `"Crown"` | `"heart"`, `"third-eye"`, `"solar plexus"` - route is case-insensitive at runtime, but the generated TS enum is title-case; lowercase fails `tsc --strict`. |
|
|
195
206
|
| `fullName` (numerology) | Birth-certificate name | `"John William Smith"`, `"Priya Rajesh Sharma"` | Nickname, married name, partial name - affects all letter-based calcs |
|
|
196
207
|
| `seed` | Any string (deterministic) | `"user-42"`, `"session-abc-123"`, email hash | Numbers, objects - must be string |
|
|
197
208
|
| `number` (angel numbers path) | String | `"1111"`, `"777"`, `"1234"` | `1111` (int) fails path validation |
|
|
198
209
|
| `id` (nakshatra / dream / tarot) | Slug | `"ashwini"`, `"flying"`, `"the-fool"`, `"three-of-cups"` | Display names, uppercase, spaces |
|
|
199
210
|
| `houseSystem` | Enum | `"placidus"` (default), `"whole-sign"`, `"equal"`, `"koch"` | `"Placidus"`, `"whole_sign"`, `"WS"` |
|
|
200
211
|
| `ayanamsa` (KP) | Enum | `"kp-newcomb"` (default), `"kp-old"`, `"lahiri"`, `"custom"` | `"KP"`, `"New Comb"`, `"Lahiri"` |
|
|
201
|
-
| `nodeType` | Enum | `"
|
|
212
|
+
| `nodeType` (KP) | Enum | `"mean"` (default, traditional Vedic), `"true"` (osculating with perturbation corrections) | `"true-node"`, `"mean-node"`, `"True Node"` |
|
|
202
213
|
| `count` (tarot draw) | Integer 1 to 78 | `3`, `10`, `78` | `0`, `79`, strings, floats |
|
|
203
214
|
| `mahadasha` (path) | Planet name | `"Ketu"`, `"Venus"`, `"Sun"`, `"Moon"`, `"Mars"`, `"Rahu"`, `"Jupiter"`, `"Saturn"`, `"Mercury"` | `"KETU"` (works, case-insensitive), `"ke"`, `"Ke-tu"` |
|
|
204
215
|
| `person1` / `person2` | Object with full birth data | `{ date, time, latitude, longitude, timezone }` (Western) or `{ date, time, latitude, longitude }` (Vedic) | Separate top-level fields, missing time, partial object |
|
|
@@ -229,7 +240,7 @@ LLMs hallucinate confidently in this category. These are the specific traps you
|
|
|
229
240
|
|
|
230
241
|
- **Ayanamsa is server-side in Vedic.** LLMs default to tropical / Western math. Vedic endpoints apply sidereal Lahiri ayanamsa server-side. KP endpoints accept `ayanamsa` of `kp-newcomb` (default), `kp-old`, `lahiri`, or `custom`. Do not try to "correct" server output by subtracting ayanamsa in client code.
|
|
231
242
|
- **Tithi count is 30, not 2.** 15 Shukla (waxing) plus 15 Krishna (waning). Older LLM training data conflates Purnima and Amavasya as single tithis. Our panchang response carries a `paksha` field (`"Shukla"` or `"Krishna"`) plus a tithi number, so there are 30 distinct tithis in a lunar month.
|
|
232
|
-
- **Rahu and Ketu are shadow points, not planets.** They do not appear in a real ephemeris. Endpoints accept `nodeType` of `
|
|
243
|
+
- **Rahu and Ketu are shadow points, not planets.** They do not appear in a real ephemeris. Endpoints accept `nodeType` of `"mean"` (smooth mean node, traditional Vedic default) or `"true"` (osculating node with perturbation corrections) to select which calculation to use.
|
|
233
244
|
- **Nakshatra count is 27.** Abhijit is sometimes treated as a 28th in some schools, but this API uses the standard 27. `roxy.vedicAstrology.listNakshatras()` returns an array of length 27.
|
|
234
245
|
- **Retrograde is per-planet, not global.** Natal chart planets and Vedic `meta` include `isRetrograde: boolean` per planet. KP planet lists use `retrograde`. Never generate "Mercury retrograde globally" UI copy, check the specific planet in the response.
|
|
235
246
|
- **Tarot reversals are a product choice.** `allowReversals: false` on a tarot draw means no reversed cards in that draw, period. It is not cosmically meaningful, it is a config flag.
|
package/README.md
CHANGED
|
@@ -124,7 +124,7 @@ const { data: synastry } = await roxy.astrology.calculateSynastry({
|
|
|
124
124
|
person2: { date: '1992-07-22', time: '09:00:00', latitude: 19.07, longitude: 72.87, timezone: 5.5 },
|
|
125
125
|
},
|
|
126
126
|
});
|
|
127
|
-
// synastry.compatibilityScore, synastry.interAspects, synastry.strengths
|
|
127
|
+
// synastry.compatibilityScore, synastry.interAspects, synastry.analysis.strengths
|
|
128
128
|
|
|
129
129
|
// Moon phase. Viral for wellness, cycle-tracking, and meditation apps.
|
|
130
130
|
const { data: moon } = await roxy.astrology.getCurrentMoonPhase({});
|
|
@@ -198,7 +198,7 @@ High search volume, evergreen. The tarot card database is the highest per-endpoi
|
|
|
198
198
|
```typescript
|
|
199
199
|
// Daily card. Stickiest tarot feature. Seed per user for deterministic once-per-day behavior.
|
|
200
200
|
const { data: card } = await roxy.tarot.getDailyCard({ body: { seed: 'user-42' } });
|
|
201
|
-
// card.card.name, card.card.imageUrl, card.
|
|
201
|
+
// card.card.name, card.card.imageUrl, card.dailyMessage
|
|
202
202
|
|
|
203
203
|
// Celtic Cross. Professional-reader spread. Premium-tier, ten positions.
|
|
204
204
|
const { data: cc } = await roxy.tarot.castCelticCross({
|
|
@@ -252,10 +252,10 @@ Crystal retail and metaphysical shops use these to build "crystals for [sign]" a
|
|
|
252
252
|
```typescript
|
|
253
253
|
// By zodiac. Highest-search crystal query pattern.
|
|
254
254
|
const { data: bySign } = await roxy.crystals.getCrystalsByZodiac({ path: { sign: 'scorpio' } });
|
|
255
|
-
// bySign.crystals is a list of id, name,
|
|
255
|
+
// bySign.crystals is a list of { id, name, imageUrl, colors }. Use /crystals/{id} for full properties.
|
|
256
256
|
|
|
257
257
|
// By chakra. Second-highest crystal query pattern.
|
|
258
|
-
const { data: byChakra } = await roxy.crystals.getCrystalsByChakra({ path: { chakra: '
|
|
258
|
+
const { data: byChakra } = await roxy.crystals.getCrystalsByChakra({ path: { chakra: 'Heart' } });
|
|
259
259
|
|
|
260
260
|
// Birthstone. Evergreen gift and jewelry SEO.
|
|
261
261
|
const { data: birthstone } = await roxy.crystals.getBirthstones({ path: { month: 4 } });
|
package/dist/factory.cjs
CHANGED
package/dist/factory.js
CHANGED
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.2.
|
|
1
|
+
export declare const VERSION = "1.2.25";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '1.2.
|
|
1
|
+
export const VERSION = '1.2.25';
|