astromansion 0.1.0-alpha.2 → 0.1.0-alpha.4
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 +133 -3
- package/dist/index.cjs +163 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +351 -9
- package/dist/index.d.ts +351 -9
- package/dist/index.js +163 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-

|
|
2
2
|
|
|
3
3
|
# AstroMansion
|
|
4
4
|
|
|
@@ -430,6 +430,68 @@ There is no ceiling on how many you may read this way. `options.all_bodies`
|
|
|
430
430
|
walks every category at once and needs the full-catalog scope that comes with
|
|
431
431
|
Pro and Enterprise. Naming the categories yourself does not.
|
|
432
432
|
|
|
433
|
+
## A planet's moons
|
|
434
|
+
|
|
435
|
+
`planetarySystem` reads one planet's satellites at the birth moment. It
|
|
436
|
+
covers Mars, Jupiter, Saturn, Uranus, Neptune and Pluto, and it needs the
|
|
437
|
+
`extended` scope that comes with Basic, Pro and Enterprise. With the `birth`
|
|
438
|
+
object from the examples above:
|
|
439
|
+
|
|
440
|
+
```js
|
|
441
|
+
const system = await client.planetarySystem({ birth, parent: "jupiter" });
|
|
442
|
+
|
|
443
|
+
system.parent.natal_sign; // "Aries"
|
|
444
|
+
system.time.utc; // "2000-01-01T12:00:00Z"
|
|
445
|
+
|
|
446
|
+
for (const moon of system.satellites) {
|
|
447
|
+
console.log(
|
|
448
|
+
moon.name,
|
|
449
|
+
moon.geocentric?.longitude?.toFixed(2),
|
|
450
|
+
moon.parentcentric.longitude?.toFixed(2),
|
|
451
|
+
moon.natal_parent_projected.sign,
|
|
452
|
+
);
|
|
453
|
+
}
|
|
454
|
+
// Io 25.24 18.11 Libra
|
|
455
|
+
// Europa 25.25 212.49 Taurus
|
|
456
|
+
// Ganymede 25.23 219.91 Taurus
|
|
457
|
+
// Callisto 25.38 80.07 Sagittarius
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
Every satellite carries three answers, and they are not versions of one
|
|
461
|
+
another:
|
|
462
|
+
|
|
463
|
+
- `geocentric` is where the moon is seen from Earth, on the ecliptic of
|
|
464
|
+
date, with the light time solved. From Earth the Galilean moons sit within
|
|
465
|
+
a fraction of a degree of Jupiter, so this longitude nearly repeats the
|
|
466
|
+
planet's own.
|
|
467
|
+
- `parentcentric` is where the moon is in its orbit, measured on the
|
|
468
|
+
planet's equator. A planet-centred frame has no horizon, so it has no
|
|
469
|
+
houses.
|
|
470
|
+
- `natal_parent_projected` carries that orbital phase onto the natal circle
|
|
471
|
+
from the planet's own natal degree. It is an AstroMansion derivation rather
|
|
472
|
+
than a received rule, and its `tradition` field says so.
|
|
473
|
+
|
|
474
|
+
`system.frames` names each frame. The planet-centred one also publishes the
|
|
475
|
+
pole its equator is built on, so the plane can be checked:
|
|
476
|
+
|
|
477
|
+
```js
|
|
478
|
+
const frame = system.frames.parentcentric;
|
|
479
|
+
frame.frame_id; // "jupiter_equator_iau2015_j2000_fixed"
|
|
480
|
+
[frame.pole.ra_deg, frame.pole.dec_deg]; // [268.057204, 64.49581]
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
`options` narrows the answer. `satellites` names the moons and their order,
|
|
484
|
+
and `include_geocentric: false` leaves the view from Earth out, so
|
|
485
|
+
`geocentric` comes back as `null`:
|
|
486
|
+
|
|
487
|
+
```js
|
|
488
|
+
await client.planetarySystem({
|
|
489
|
+
birth,
|
|
490
|
+
parent: "saturn",
|
|
491
|
+
options: { satellites: ["titan", "enceladus"], include_geocentric: false },
|
|
492
|
+
});
|
|
493
|
+
```
|
|
494
|
+
|
|
433
495
|
## MansionSQL
|
|
434
496
|
|
|
435
497
|
A chart is a table of bodies, a table of houses and a table of aspects, and
|
|
@@ -802,7 +864,7 @@ list of one:
|
|
|
802
864
|
|
|
803
865
|
## Every endpoint
|
|
804
866
|
|
|
805
|
-
Every published operation,
|
|
867
|
+
Every published operation, 69 of them, has a method on the client and a
|
|
806
868
|
module-level shortcut, all generated from the schema. They are the Python
|
|
807
869
|
SDK's methods under the same names, written in camelCase: `natal`,
|
|
808
870
|
`transits`, `synastry`, `composite`, `solarReturn`, `progression`,
|
|
@@ -898,7 +960,7 @@ await client.exportPdf({
|
|
|
898
960
|
|
|
899
961
|
Every endpoint that answers with a document takes `output` the same way:
|
|
900
962
|
`exportPdf`, `exportCsv`, `exportReport`, `renderSvg`, `renderPng`,
|
|
901
|
-
`renderBiwheel`, `renderAstrocartography` and `renderSharecard`, and their
|
|
963
|
+
`renderBiwheel`, `renderChart`, `renderAstrocartography` and `renderSharecard`, and their
|
|
902
964
|
module-level shortcuts.
|
|
903
965
|
|
|
904
966
|
```js
|
|
@@ -919,6 +981,74 @@ before the request is sent, so no quota is spent. The refusal is a
|
|
|
919
981
|
`ValidationError` that says "output needs a file system, and this runtime has
|
|
920
982
|
none. Leave output out to get the bytes."
|
|
921
983
|
|
|
984
|
+
### Styled chart wheels
|
|
985
|
+
|
|
986
|
+
`renderChart` draws a chart as SVG or PNG. Its body is typed as
|
|
987
|
+
`ChartRenderRequest`, exported by the package, and includes the chart kind,
|
|
988
|
+
the birth and the drawing's options.
|
|
989
|
+
|
|
990
|
+
```ts
|
|
991
|
+
const birth = {
|
|
992
|
+
date: "1990-07-15",
|
|
993
|
+
time: "14:30",
|
|
994
|
+
lat: 51.5074,
|
|
995
|
+
lon: -0.1278,
|
|
996
|
+
timezone: "Europe/London",
|
|
997
|
+
};
|
|
998
|
+
|
|
999
|
+
await client.renderChart({
|
|
1000
|
+
type: "natal",
|
|
1001
|
+
format: "svg",
|
|
1002
|
+
birth,
|
|
1003
|
+
options: {
|
|
1004
|
+
theme: "light",
|
|
1005
|
+
style: {
|
|
1006
|
+
preset: "ink",
|
|
1007
|
+
colors: { house_lines: "#123456" },
|
|
1008
|
+
show: { ticks: false, watermark: false, canvas_background: false },
|
|
1009
|
+
},
|
|
1010
|
+
},
|
|
1011
|
+
output: "styled-chart.svg",
|
|
1012
|
+
});
|
|
1013
|
+
|
|
1014
|
+
await client.renderChart({
|
|
1015
|
+
type: "natal",
|
|
1016
|
+
format: "png",
|
|
1017
|
+
birth,
|
|
1018
|
+
options: { width: 800, style: { preset: "premium" } },
|
|
1019
|
+
output: "styled-chart.png",
|
|
1020
|
+
});
|
|
1021
|
+
```
|
|
1022
|
+
|
|
1023
|
+
The kinds are `natal`, `rising`, `transits`, `synastry`, `composite`,
|
|
1024
|
+
`solar_return`, `lunar_return`, `saturn_return`, `progressions` and `solar_arc`. Synastry and
|
|
1025
|
+
composite need a second birth as `partner`. Moment options belong under
|
|
1026
|
+
`options`: `date` and `time` for transits, `year` for solar returns, `date`
|
|
1027
|
+
for lunar returns, and either `date` or `age` for progressions and solar arcs.
|
|
1028
|
+
Saturn returns use `cycle: 1`, `2` or `3`, defaulting to the first return.
|
|
1029
|
+
`custom_bodies` accepts up to eight Keplerian bodies on the first ring,
|
|
1030
|
+
using the custom-body endpoint's orbital fields. Their positions follow
|
|
1031
|
+
the chart's actual moment; a composite uses the midpoint of both placements.
|
|
1032
|
+
Rising-sign charts accept no bodies.
|
|
1033
|
+
|
|
1034
|
+
Presets are `classic`, `minimal`, `ink`, `editorial` and `premium`. With no
|
|
1035
|
+
style the server uses `minimal`. Colours use six hexadecimal digits, such
|
|
1036
|
+
as `#123456`. The server validates style sections, ring order and the
|
|
1037
|
+
options each kind reads. `renderSvg` and `renderPng` also take `style`
|
|
1038
|
+
inside their `options`.
|
|
1039
|
+
|
|
1040
|
+
`style.show.watermark` controls the faint centre logo. Set
|
|
1041
|
+
`style.show.canvas_background` to `false` for a painted wheel with
|
|
1042
|
+
transparent surroundings. Both default to `true` in the API. The designer
|
|
1043
|
+
starts with transparent surroundings and writes that choice into its JSON.
|
|
1044
|
+
For other outputs, use `options.watermark` in `natal` and `exportPdf`,
|
|
1045
|
+
and `watermark` in `renderBiwheel` and `exportReport`. White-label
|
|
1046
|
+
reports always omit the centre logo.
|
|
1047
|
+
|
|
1048
|
+
Use the [chart designer](https://astromansion.com/en/chart-designer) to edit
|
|
1049
|
+
every setting and copy its JSON. A timeline, firdaria and zodiacal releasing
|
|
1050
|
+
are not wheel kinds in this version.
|
|
1051
|
+
|
|
922
1052
|
## Security
|
|
923
1053
|
|
|
924
1054
|
The key travels in the `X-API-Key` header, never in a URL. It is masked in
|
package/dist/index.cjs
CHANGED
|
@@ -77,12 +77,14 @@ __export(index_exports, {
|
|
|
77
77
|
pairAspects: () => pairAspects,
|
|
78
78
|
parans: () => parans,
|
|
79
79
|
patterns: () => patterns,
|
|
80
|
+
planetarySystem: () => planetarySystem,
|
|
80
81
|
profection: () => profection,
|
|
81
82
|
progression: () => progression,
|
|
82
83
|
query: () => query,
|
|
83
84
|
rectification: () => rectification,
|
|
84
85
|
renderAstrocartography: () => renderAstrocartography,
|
|
85
86
|
renderBiwheel: () => renderBiwheel,
|
|
87
|
+
renderChart: () => renderChart,
|
|
86
88
|
renderPng: () => renderPng,
|
|
87
89
|
renderSharecard: () => renderSharecard,
|
|
88
90
|
renderSvg: () => renderSvg,
|
|
@@ -392,7 +394,7 @@ var KEY_MASK = Object.freeze({
|
|
|
392
394
|
|
|
393
395
|
// package.json
|
|
394
396
|
var name = "astromansion";
|
|
395
|
-
var version = "0.1.0-alpha.
|
|
397
|
+
var version = "0.1.0-alpha.4";
|
|
396
398
|
|
|
397
399
|
// src/models/constants/package.ts
|
|
398
400
|
var PACKAGE_IDENTITY = Object.freeze({
|
|
@@ -982,6 +984,12 @@ function isEclipseEvent(value) {
|
|
|
982
984
|
function isEclipsesResponse(value) {
|
|
983
985
|
return isJsonObject(value) && Number.isInteger(value["year"]) && (value["timezone"] === void 0 || typeof value["timezone"] === "string") && isJsonArrayOf(value["events"], (item0) => isEclipseEvent(item0));
|
|
984
986
|
}
|
|
987
|
+
function isFramePole(value) {
|
|
988
|
+
return isJsonObject(value) && typeof value["ra_deg"] === "number" && typeof value["dec_deg"] === "number" && typeof value["model"] === "string" && typeof value["epoch"] === "string" && typeof value["fixed"] === "boolean";
|
|
989
|
+
}
|
|
990
|
+
function isGeocentricFrame(value) {
|
|
991
|
+
return isJsonObject(value) && typeof value["frame_id"] === "string" && typeof value["correction"] === "string" && typeof value["has_houses"] === "boolean";
|
|
992
|
+
}
|
|
985
993
|
function isGeoSearchResponse(value) {
|
|
986
994
|
return isJsonObject(value) && isJsonArrayOf(value["results"], (item0) => isPlaceRow(item0));
|
|
987
995
|
}
|
|
@@ -1021,9 +1029,18 @@ function isMoonPhasesResponse(value) {
|
|
|
1021
1029
|
function isNatalResponse(value) {
|
|
1022
1030
|
return isJsonObject(value) && isJsonRecordOf(value["summary"], (member0) => isSummaryRow(member0)) && isJsonArrayOf(value["planets"], (item0) => isBodyRow(item0)) && isJsonArrayOf(value["aspects"], (item0) => isAspectRow(item0)) && (value["wheel"] === void 0 || typeof value["wheel"] === "string" || value["wheel"] === null);
|
|
1023
1031
|
}
|
|
1032
|
+
function isParentcentricFrame(value) {
|
|
1033
|
+
return isJsonObject(value) && typeof value["frame_id"] === "string" && typeof value["correction"] === "string" && Number.isInteger(value["center"]) && isFramePole(value["pole"]) && typeof value["has_houses"] === "boolean";
|
|
1034
|
+
}
|
|
1024
1035
|
function isPlaceRow(value) {
|
|
1025
1036
|
return isJsonObject(value) && typeof value["name"] === "string" && typeof value["label"] === "string" && typeof value["lat"] === "number" && typeof value["lon"] === "number" && typeof value["timezone"] === "string";
|
|
1026
1037
|
}
|
|
1038
|
+
function isPlanetarySystemResponse(value) {
|
|
1039
|
+
return isJsonObject(value) && isSystemParent(value["parent"]) && isSystemEphemeris(value["ephemeris"]) && isSystemTime(value["time"]) && isSystemFrames(value["frames"]) && isJsonArrayOf(value["satellites"], (item0) => isSatelliteRow(item0));
|
|
1040
|
+
}
|
|
1041
|
+
function isProjectedFrame(value) {
|
|
1042
|
+
return isJsonObject(value) && typeof value["frame_id"] === "string" && typeof value["technique"] === "string" && typeof value["tradition"] === "string" && typeof value["zero_reference"] === "string" && (value["zero_longitude"] === void 0 || typeof value["zero_longitude"] === "number" || value["zero_longitude"] === null) && typeof value["has_houses"] === "boolean";
|
|
1043
|
+
}
|
|
1027
1044
|
function isRetrogradeBody(value) {
|
|
1028
1045
|
return isJsonObject(value) && typeof value["body"] === "string" && isJsonArrayOf(value["cycles"], (item0) => isRetrogradeCycle(item0));
|
|
1029
1046
|
}
|
|
@@ -1033,6 +1050,21 @@ function isRetrogradeCycle(value) {
|
|
|
1033
1050
|
function isRetrogradesResponse(value) {
|
|
1034
1051
|
return isJsonObject(value) && Number.isInteger(value["year"]) && (value["timezone"] === void 0 || typeof value["timezone"] === "string") && isJsonArrayOf(value["bodies"], (item0) => isRetrogradeBody(item0));
|
|
1035
1052
|
}
|
|
1053
|
+
function isSatelliteGeocentric(value) {
|
|
1054
|
+
return isJsonObject(value) && typeof value["frame_id"] === "string" && typeof value["correction"] === "string" && typeof value["correction_label"] === "string" && Number.isInteger(value["observer"]) && Number.isInteger(value["origin"]) && (value["longitude"] === void 0 || typeof value["longitude"] === "number" || value["longitude"] === null) && (value["latitude"] === void 0 || typeof value["latitude"] === "number" || value["latitude"] === null) && (value["position_icrf_km"] === void 0 || isJsonArrayOf(
|
|
1055
|
+
value["position_icrf_km"],
|
|
1056
|
+
(item0) => typeof item0 === "number"
|
|
1057
|
+
) || value["position_icrf_km"] === null) && typeof value["distance_km"] === "number" && typeof value["light_time_seconds"] === "number" && typeof value["target_epoch_et"] === "number" && Number.isInteger(value["iterations"]) && typeof value["has_houses"] === "boolean";
|
|
1058
|
+
}
|
|
1059
|
+
function isSatelliteParentcentric(value) {
|
|
1060
|
+
return isJsonObject(value) && typeof value["frame_id"] === "string" && typeof value["correction"] === "string" && (value["longitude"] === void 0 || typeof value["longitude"] === "number" || value["longitude"] === null) && (value["latitude"] === void 0 || typeof value["latitude"] === "number" || value["latitude"] === null) && typeof value["distance_km"] === "number" && Number.isInteger(value["sector"]) && (value["degree_in_sector"] === void 0 || typeof value["degree_in_sector"] === "number" || value["degree_in_sector"] === null) && typeof value["has_houses"] === "boolean";
|
|
1061
|
+
}
|
|
1062
|
+
function isSatelliteProjected(value) {
|
|
1063
|
+
return isJsonObject(value) && typeof value["frame_id"] === "string" && typeof value["technique"] === "string" && typeof value["tradition"] === "string" && typeof value["zero_reference"] === "string" && (value["orbital_phase"] === void 0 || typeof value["orbital_phase"] === "number" || value["orbital_phase"] === null) && (value["longitude"] === void 0 || typeof value["longitude"] === "number" || value["longitude"] === null) && (value["sign"] === void 0 || typeof value["sign"] === "string" || value["sign"] === null) && (value["house"] === void 0 || Number.isInteger(value["house"]) || value["house"] === null);
|
|
1064
|
+
}
|
|
1065
|
+
function isSatelliteRow(value) {
|
|
1066
|
+
return isJsonObject(value) && typeof value["name"] === "string" && Number.isInteger(value["naif_id"]) && (value["geocentric"] === void 0 || isSatelliteGeocentric(value["geocentric"]) || value["geocentric"] === null) && isSatelliteParentcentric(value["parentcentric"]) && isSatelliteProjected(value["natal_parent_projected"]);
|
|
1067
|
+
}
|
|
1036
1068
|
function isSaturnReturnEvent(value) {
|
|
1037
1069
|
return isJsonObject(value) && Number.isInteger(value["return"]) && typeof value["date"] === "string" && typeof value["time"] === "string" && typeof value["sign"] === "string" && typeof value["dms"] === "string";
|
|
1038
1070
|
}
|
|
@@ -1045,6 +1077,21 @@ function isSavedCustomBody(value) {
|
|
|
1045
1077
|
function isSummaryRow(value) {
|
|
1046
1078
|
return isJsonObject(value) && typeof value["sign"] === "string" && typeof value["dms"] === "string";
|
|
1047
1079
|
}
|
|
1080
|
+
function isSystemEphemeris(value) {
|
|
1081
|
+
return isJsonObject(value) && typeof value["kernel"] === "string" && typeof value["source"] === "string" && typeof value["planetary_kernel"] === "string" && typeof value["matches_horizons"] === "boolean" && (value["horizons_delta_km"] === void 0 || typeof value["horizons_delta_km"] === "number" || value["horizons_delta_km"] === null) && isJsonArrayOf(
|
|
1082
|
+
value["coverage_jd"],
|
|
1083
|
+
(item0) => isJsonArrayOf(item0) && item0.length === 2 && typeof item0[0] === "number" && typeof item0[1] === "number"
|
|
1084
|
+
);
|
|
1085
|
+
}
|
|
1086
|
+
function isSystemFrames(value) {
|
|
1087
|
+
return isJsonObject(value) && isGeocentricFrame(value["geocentric"]) && isParentcentricFrame(value["parentcentric"]) && isProjectedFrame(value["natal_parent_projected"]);
|
|
1088
|
+
}
|
|
1089
|
+
function isSystemParent(value) {
|
|
1090
|
+
return isJsonObject(value) && typeof value["name"] === "string" && Number.isInteger(value["naif_id"]) && typeof value["natal_longitude"] === "number" && typeof value["natal_sign"] === "string" && (value["parentcentric_longitude"] === void 0 || value["parentcentric_longitude"] === null);
|
|
1091
|
+
}
|
|
1092
|
+
function isSystemTime(value) {
|
|
1093
|
+
return isJsonObject(value) && typeof value["scale"] === "string" && typeof value["model"] === "string" && typeof value["et_seconds"] === "number" && typeof value["jd"] === "number" && Number.isInteger(value["offset_seconds"]) && typeof value["utc"] === "string" && typeof value["local"] === "string";
|
|
1094
|
+
}
|
|
1048
1095
|
function isTechniqueEnvelope(value) {
|
|
1049
1096
|
return isJsonObject(value) && typeof value["technique"] === "string" && value["result"] !== void 0;
|
|
1050
1097
|
}
|
|
@@ -1800,6 +1847,9 @@ var EndpointMethods = class {
|
|
|
1800
1847
|
*
|
|
1801
1848
|
* Export a chart as a PDF report.
|
|
1802
1849
|
*
|
|
1850
|
+
* `options.watermark` defaults to true. Set it to false to omit the
|
|
1851
|
+
* centre logo. The document's paper remains painted.
|
|
1852
|
+
*
|
|
1803
1853
|
* @param fields - The birth fields, flat: date, time, lat, lon, timezone, and houses. options and signal may stand beside them. output, the path to write the document to, is allowed among them.
|
|
1804
1854
|
* @param keywords - The method's other arguments, when they come apart from the birth fields.
|
|
1805
1855
|
* @returns The document's bytes, sent as application/pdf, or the path it was written to when output is given.
|
|
@@ -1831,13 +1881,16 @@ var EndpointMethods = class {
|
|
|
1831
1881
|
* is charged only once the document exists, and a chart already paid for is
|
|
1832
1882
|
* drawn again for free. Developer keys never spend credits.
|
|
1833
1883
|
*
|
|
1834
|
-
*
|
|
1884
|
+
* Removing the document's AstroMansion branding or embedding a custom logo additionally
|
|
1835
1885
|
* requires `Scope.WHITE_LABEL`. The plan that grants it is read from
|
|
1836
1886
|
* `TierConstants`, so the error, the schema, and the pricing page name the same
|
|
1837
1887
|
* plan. A request without that scope is rejected with 403 rather than
|
|
1838
1888
|
* silently ignored: a machine caller cannot see a dropped field, and would
|
|
1839
|
-
* ship a branded document it never got.
|
|
1840
|
-
*
|
|
1889
|
+
* ship a branded document it never got. White-label access means applying
|
|
1890
|
+
* the caller's brand and also removes the centre watermark.
|
|
1891
|
+
*
|
|
1892
|
+
* `watermark` defaults to true. Set it to false to omit only the faint
|
|
1893
|
+
* centre logo. This switch requires no additional branding scope.
|
|
1841
1894
|
*
|
|
1842
1895
|
* @param fields - The request body, as {@link ReportExportRequest} describes it, sent as given. signal may stand beside its fields. output, the path to write the document to, is allowed among them.
|
|
1843
1896
|
* @param keywords - signal, and output for a document, when they come apart from the body.
|
|
@@ -2336,6 +2389,38 @@ var EndpointMethods = class {
|
|
|
2336
2389
|
});
|
|
2337
2390
|
return readWrapped(answer, isTechniqueEnvelope, "patterns");
|
|
2338
2391
|
}
|
|
2392
|
+
/**
|
|
2393
|
+
* A planet's satellites, in three frames at once.
|
|
2394
|
+
*
|
|
2395
|
+
* @remarks
|
|
2396
|
+
* Sends `POST /v1/planetary-system`. The Python SDK names it planetary_system.
|
|
2397
|
+
*
|
|
2398
|
+
* Calculate a planet's satellite system for a birth moment.
|
|
2399
|
+
*
|
|
2400
|
+
* Three answers come back for every satellite and they are not versions of
|
|
2401
|
+
* one another. From Earth the Galilean moons sit within arcminutes of
|
|
2402
|
+
* Jupiter, so the observed longitude repeats the planet's own. The
|
|
2403
|
+
* planet-centred longitude says where the moon is in its orbit but has no
|
|
2404
|
+
* horizon and therefore no houses. And the projected layer carries that
|
|
2405
|
+
* orbital phase onto the natal circle from Jupiter's own degree, which is
|
|
2406
|
+
* an AstroMansion derivation rather than a received rule. The request names
|
|
2407
|
+
* no language, so the signs are named in English.
|
|
2408
|
+
*
|
|
2409
|
+
* @param fields - The request body, as {@link PlanetarySystemRequest} describes it, sent as given. signal may stand beside its fields.
|
|
2410
|
+
* @param keywords - signal, and output for a document, when they come apart from the body.
|
|
2411
|
+
* @returns The answer as a Result, checked against {@link PlanetarySystemResponse}.
|
|
2412
|
+
* @throws {@link AstroMansionError} or the subclass that names the cause, as {@link AstroMansion.request} describes. The code unexpected_answer means the answer did not have its published shape.
|
|
2413
|
+
*/
|
|
2414
|
+
async planetarySystem(fields, keywords) {
|
|
2415
|
+
const call = RequestBodies.body("planetarySystem", fields, keywords, false);
|
|
2416
|
+
const answer = await this.request("POST", "/v1/planetary-system", {
|
|
2417
|
+
json: call.json,
|
|
2418
|
+
technique: "planetary_system",
|
|
2419
|
+
enveloped: false,
|
|
2420
|
+
signal: call.signal
|
|
2421
|
+
});
|
|
2422
|
+
return readResult(answer, isPlanetarySystemResponse, "planetarySystem");
|
|
2423
|
+
}
|
|
2339
2424
|
/**
|
|
2340
2425
|
* Annual profections.
|
|
2341
2426
|
*
|
|
@@ -2475,6 +2560,9 @@ var EndpointMethods = class {
|
|
|
2475
2560
|
*
|
|
2476
2561
|
* Render a bi-wheel SVG with natal and outer charts.
|
|
2477
2562
|
*
|
|
2563
|
+
* `watermark` defaults to true. Set it to false to omit the centre logo.
|
|
2564
|
+
* Use render/chart for the full style and transparent surroundings options.
|
|
2565
|
+
*
|
|
2478
2566
|
* @param birth - The first person's birth fields, as natal takes them.
|
|
2479
2567
|
* @param partner - The second person's birth fields.
|
|
2480
2568
|
* @param keywords - The options, signal, and the body's further fields. output, the path to write the document to, is allowed among them.
|
|
@@ -2503,6 +2591,57 @@ var EndpointMethods = class {
|
|
|
2503
2591
|
writer
|
|
2504
2592
|
);
|
|
2505
2593
|
}
|
|
2594
|
+
/**
|
|
2595
|
+
* Any kind of chart as a styled wheel: natal, rising sign, transits, synastry, and more.
|
|
2596
|
+
*
|
|
2597
|
+
* @remarks
|
|
2598
|
+
* Sends `POST /v1/render/chart`. The Python SDK names it render_chart.
|
|
2599
|
+
*
|
|
2600
|
+
* Draw a chart of any kind as one wheel, in a style, as SVG or PNG.
|
|
2601
|
+
*
|
|
2602
|
+
* `type` names the kind. Each is cast by the technique of its own
|
|
2603
|
+
* endpoint, so the wheel shows what that endpoint answers. A wheel of two
|
|
2604
|
+
* charts draws the second on a ring of its own around the first one's
|
|
2605
|
+
* houses, with the chords between them. `options` takes the drawing's
|
|
2606
|
+
* settings of render/svg and render/png, `style` among them, and the
|
|
2607
|
+
* moment the kind is drawn for. An option the kind or the image does not
|
|
2608
|
+
* read is refused.
|
|
2609
|
+
*
|
|
2610
|
+
* Every heading names the drawn frame's Ascendant sign and degree.
|
|
2611
|
+
* `options.lang` selects `en` (the default) or `tr` for the heading
|
|
2612
|
+
* and rising centre caption. Body labels retain their published names.
|
|
2613
|
+
*
|
|
2614
|
+
* `options.style.show.watermark` controls faint branding: the centre
|
|
2615
|
+
* logo, or a wordmark below the zodiac on a rising-sign chart.
|
|
2616
|
+
* `options.style.show.canvas_background` defaults to true. Set it to false
|
|
2617
|
+
* to keep the wheel painted and its surroundings transparent in SVG or PNG.
|
|
2618
|
+
*
|
|
2619
|
+
* `saturn_return` reads `options.cycle` from 1 through 3, defaulting to
|
|
2620
|
+
* the first return. `options.custom_bodies` accepts up to eight Keplerian
|
|
2621
|
+
* bodies with the custom-body endpoint's orbital fields. They join the first
|
|
2622
|
+
* ring at its actual chart moment. A composite uses the midpoint of both
|
|
2623
|
+
* placements. Rising-sign charts accept no body selection or custom bodies.
|
|
2624
|
+
*
|
|
2625
|
+
* @param fields - The request body, as {@link ChartRenderRequest} describes it, sent as given. signal may stand beside its fields. output, the path to write the document to, is allowed among them.
|
|
2626
|
+
* @param keywords - signal, and output for a document, when they come apart from the body.
|
|
2627
|
+
* @returns The document's bytes, sent as image/svg+xml or image/png, or the path it was written to when output is given.
|
|
2628
|
+
* @throws {@link AstroMansionError} or the subclass that names the cause, as {@link AstroMansion.request} describes. The code unexpected_answer means the answer did not have its published shape.
|
|
2629
|
+
*/
|
|
2630
|
+
async renderChart(fields, keywords) {
|
|
2631
|
+
const call = RequestBodies.body("renderChart", fields, keywords, true);
|
|
2632
|
+
const writer = documentWriter(call.output);
|
|
2633
|
+
const answer = await this.request("POST", "/v1/render/chart", {
|
|
2634
|
+
json: call.json,
|
|
2635
|
+
binary: true,
|
|
2636
|
+
technique: "render_chart",
|
|
2637
|
+
signal: call.signal
|
|
2638
|
+
});
|
|
2639
|
+
return saveDocument(
|
|
2640
|
+
readDocument(answer, "renderChart"),
|
|
2641
|
+
call.output,
|
|
2642
|
+
writer
|
|
2643
|
+
);
|
|
2644
|
+
}
|
|
2506
2645
|
/**
|
|
2507
2646
|
* Chart wheel PNG image.
|
|
2508
2647
|
*
|
|
@@ -2511,6 +2650,15 @@ var EndpointMethods = class {
|
|
|
2511
2650
|
*
|
|
2512
2651
|
* Render a chart wheel as PNG.
|
|
2513
2652
|
*
|
|
2653
|
+
* Every heading names the drawn frame's Ascendant sign and degree.
|
|
2654
|
+
* `options.lang` selects `en` (the default) or `tr` for the heading
|
|
2655
|
+
* and rising centre caption. Body labels retain their published names.
|
|
2656
|
+
*
|
|
2657
|
+
* `options.style.show.watermark` controls faint branding: the centre
|
|
2658
|
+
* logo, or a wordmark below the zodiac on a rising-sign chart.
|
|
2659
|
+
* `options.style.show.canvas_background` defaults to true. Set it to false
|
|
2660
|
+
* for transparent pixels outside the painted wheel.
|
|
2661
|
+
*
|
|
2514
2662
|
* @param fields - The birth fields, flat: date, time, lat, lon, timezone, and houses. options and signal may stand beside them. output, the path to write the document to, is allowed among them.
|
|
2515
2663
|
* @param keywords - The method's other arguments, when they come apart from the birth fields.
|
|
2516
2664
|
* @returns The document's bytes, sent as image/png, or the path it was written to when output is given.
|
|
@@ -2536,6 +2684,11 @@ var EndpointMethods = class {
|
|
|
2536
2684
|
*
|
|
2537
2685
|
* Render a chart wheel as SVG or interactive HTML.
|
|
2538
2686
|
*
|
|
2687
|
+
* `options.style.show.watermark` controls the faint centre logo.
|
|
2688
|
+
* `options.style.show.canvas_background` controls the rectangular ground
|
|
2689
|
+
* outside the wheel. Both default to true. Set the latter to false to keep
|
|
2690
|
+
* the wheel painted and its surroundings transparent.
|
|
2691
|
+
*
|
|
2539
2692
|
* @param fields - The birth fields, flat: date, time, lat, lon, timezone, and houses. options and signal may stand beside them. output, the path to write the document to, is allowed among them.
|
|
2540
2693
|
* @param keywords - The method's other arguments, when they come apart from the birth fields.
|
|
2541
2694
|
* @returns The document's bytes, sent as image/svg+xml or text/html, or the path it was written to when output is given.
|
|
@@ -3893,6 +4046,9 @@ async function parans(...args) {
|
|
|
3893
4046
|
async function patterns(...args) {
|
|
3894
4047
|
return defaultClient().patterns(...args);
|
|
3895
4048
|
}
|
|
4049
|
+
async function planetarySystem(...args) {
|
|
4050
|
+
return defaultClient().planetarySystem(...args);
|
|
4051
|
+
}
|
|
3896
4052
|
async function profection(...args) {
|
|
3897
4053
|
return defaultClient().profection(...args);
|
|
3898
4054
|
}
|
|
@@ -3911,6 +4067,9 @@ async function renderAstrocartography(...args) {
|
|
|
3911
4067
|
async function renderBiwheel(...args) {
|
|
3912
4068
|
return defaultClient().renderBiwheel(...args);
|
|
3913
4069
|
}
|
|
4070
|
+
async function renderChart(...args) {
|
|
4071
|
+
return defaultClient().renderChart(...args);
|
|
4072
|
+
}
|
|
3914
4073
|
async function renderPng(...args) {
|
|
3915
4074
|
return defaultClient().renderPng(...args);
|
|
3916
4075
|
}
|