astromansion 0.1.0-alpha.1 → 0.1.0-alpha.3

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 CHANGED
@@ -802,7 +802,7 @@ list of one:
802
802
 
803
803
  ## Every endpoint
804
804
 
805
- Every published operation, 67 of them, has a method on the client and a
805
+ Every published operation, 68 of them, has a method on the client and a
806
806
  module-level shortcut, all generated from the schema. They are the Python
807
807
  SDK's methods under the same names, written in camelCase: `natal`,
808
808
  `transits`, `synastry`, `composite`, `solarReturn`, `progression`,
package/dist/index.cjs CHANGED
@@ -77,6 +77,7 @@ __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,
@@ -392,7 +393,7 @@ var KEY_MASK = Object.freeze({
392
393
 
393
394
  // package.json
394
395
  var name = "astromansion";
395
- var version = "0.1.0-alpha.1";
396
+ var version = "0.1.0-alpha.3";
396
397
 
397
398
  // src/models/constants/package.ts
398
399
  var PACKAGE_IDENTITY = Object.freeze({
@@ -955,12 +956,36 @@ function isBatchResponse(value) {
955
956
  function isBodyRow(value) {
956
957
  return isJsonObject(value) && typeof value["name"] === "string" && (value["sign"] === void 0 || typeof value["sign"] === "string" || value["sign"] === null) && (value["dms"] === void 0 || typeof value["dms"] === "string" || value["dms"] === null) && (value["house"] === void 0 || Number.isInteger(value["house"]) || value["house"] === null) && typeof value["retrograde"] === "boolean";
957
958
  }
959
+ function isCustomBodyAspect(value) {
960
+ return isJsonObject(value) && typeof value["a"] === "string" && typeof value["b"] === "string" && typeof value["aspect"] === "string" && typeof value["orb"] === "number";
961
+ }
962
+ function isCustomBodyDeleteResponse(value) {
963
+ return isJsonObject(value) && typeof value["deleted"] === "boolean";
964
+ }
965
+ function isCustomBodyListResponse(value) {
966
+ return isJsonObject(value) && Number.isInteger(value["count"]) && isJsonArrayOf(value["bodies"], (item0) => isSavedCustomBody(item0));
967
+ }
968
+ function isCustomBodyPlacedResponse(value) {
969
+ return isJsonObject(value) && isCustomBodyPlacement(value["result"]);
970
+ }
971
+ function isCustomBodyPlacement(value) {
972
+ return isJsonObject(value) && isCustomBodyReading(value["body"]) && (value["wheel"] === void 0 || typeof value["wheel"] === "string") && (value["aspects"] === void 0 || isJsonArrayOf(value["aspects"], (item0) => isCustomBodyAspect(item0)));
973
+ }
974
+ function isCustomBodyReading(value) {
975
+ return isJsonObject(value) && typeof value["name"] === "string" && typeof value["lon"] === "number" && typeof value["lat"] === "number" && typeof value["sign"] === "string" && typeof value["dms"] === "string" && (value["house"] === void 0 || Number.isInteger(value["house"]) || value["house"] === null) && typeof value["speed"] === "number" && typeof value["retrograde"] === "boolean" && typeof value["type"] === "string";
976
+ }
977
+ function isCustomBodySaveResponse(value) {
978
+ return isJsonObject(value) && isCustomBodyPlacement(value["result"]) && typeof value["saved"] === "boolean";
979
+ }
958
980
  function isEclipseEvent(value) {
959
981
  return isJsonObject(value) && typeof value["kind"] === "string" && typeof value["type"] === "string" && typeof value["date"] === "string" && typeof value["time"] === "string" && typeof value["timestamp_utc"] === "string" && typeof value["sign"] === "string" && typeof value["dms"] === "string";
960
982
  }
961
983
  function isEclipsesResponse(value) {
962
984
  return isJsonObject(value) && Number.isInteger(value["year"]) && (value["timezone"] === void 0 || typeof value["timezone"] === "string") && isJsonArrayOf(value["events"], (item0) => isEclipseEvent(item0));
963
985
  }
986
+ function isGeocentricFrame(value) {
987
+ return isJsonObject(value) && typeof value["frame_id"] === "string" && typeof value["correction"] === "string" && typeof value["has_houses"] === "boolean";
988
+ }
964
989
  function isGeoSearchResponse(value) {
965
990
  return isJsonObject(value) && isJsonArrayOf(value["results"], (item0) => isPlaceRow(item0));
966
991
  }
@@ -1000,9 +1025,18 @@ function isMoonPhasesResponse(value) {
1000
1025
  function isNatalResponse(value) {
1001
1026
  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);
1002
1027
  }
1028
+ function isParentcentricFrame(value) {
1029
+ return isJsonObject(value) && typeof value["frame_id"] === "string" && typeof value["correction"] === "string" && Number.isInteger(value["center"]) && typeof value["has_houses"] === "boolean";
1030
+ }
1003
1031
  function isPlaceRow(value) {
1004
1032
  return isJsonObject(value) && typeof value["name"] === "string" && typeof value["label"] === "string" && typeof value["lat"] === "number" && typeof value["lon"] === "number" && typeof value["timezone"] === "string";
1005
1033
  }
1034
+ function isPlanetarySystemResponse(value) {
1035
+ return isJsonObject(value) && isSystemParent(value["parent"]) && isSystemEphemeris(value["ephemeris"]) && isSystemTime(value["time"]) && isSystemFrames(value["frames"]) && isJsonArrayOf(value["satellites"], (item0) => isSatelliteRow(item0));
1036
+ }
1037
+ function isProjectedFrame(value) {
1038
+ 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";
1039
+ }
1006
1040
  function isRetrogradeBody(value) {
1007
1041
  return isJsonObject(value) && typeof value["body"] === "string" && isJsonArrayOf(value["cycles"], (item0) => isRetrogradeCycle(item0));
1008
1042
  }
@@ -1012,15 +1046,45 @@ function isRetrogradeCycle(value) {
1012
1046
  function isRetrogradesResponse(value) {
1013
1047
  return isJsonObject(value) && Number.isInteger(value["year"]) && (value["timezone"] === void 0 || typeof value["timezone"] === "string") && isJsonArrayOf(value["bodies"], (item0) => isRetrogradeBody(item0));
1014
1048
  }
1049
+ function isSatelliteGeocentric(value) {
1050
+ 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"]) && 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";
1051
+ }
1052
+ function isSatelliteParentcentric(value) {
1053
+ 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";
1054
+ }
1055
+ function isSatelliteProjected(value) {
1056
+ 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);
1057
+ }
1058
+ function isSatelliteRow(value) {
1059
+ 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"]);
1060
+ }
1015
1061
  function isSaturnReturnEvent(value) {
1016
1062
  return isJsonObject(value) && Number.isInteger(value["return"]) && typeof value["date"] === "string" && typeof value["time"] === "string" && typeof value["sign"] === "string" && typeof value["dms"] === "string";
1017
1063
  }
1018
1064
  function isSaturnReturnResponse(value) {
1019
1065
  return isJsonObject(value) && isJsonArrayOf(value["returns"], (item0) => isSaturnReturnEvent(item0));
1020
1066
  }
1067
+ function isSavedCustomBody(value) {
1068
+ return isJsonObject(value) && typeof value["name"] === "string" && typeof value["heliocentric"] === "boolean" && isJsonRecordOf(value["elements"], (member0) => typeof member0 === "number");
1069
+ }
1021
1070
  function isSummaryRow(value) {
1022
1071
  return isJsonObject(value) && typeof value["sign"] === "string" && typeof value["dms"] === "string";
1023
1072
  }
1073
+ function isSystemEphemeris(value) {
1074
+ 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(
1075
+ value["coverage_jd"],
1076
+ (item0) => isJsonArrayOf(item0) && item0.length === 2 && typeof item0[0] === "number" && typeof item0[1] === "number"
1077
+ );
1078
+ }
1079
+ function isSystemFrames(value) {
1080
+ return isJsonObject(value) && isGeocentricFrame(value["geocentric"]) && isParentcentricFrame(value["parentcentric"]) && isProjectedFrame(value["natal_parent_projected"]);
1081
+ }
1082
+ function isSystemParent(value) {
1083
+ 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);
1084
+ }
1085
+ function isSystemTime(value) {
1086
+ return isJsonObject(value) && typeof value["scale"] === "string" && typeof value["model"] === "string" && typeof value["et_seconds"] === "number" && typeof value["jd"] === "number";
1087
+ }
1024
1088
  function isTechniqueEnvelope(value) {
1025
1089
  return isJsonObject(value) && typeof value["technique"] === "string" && value["result"] !== void 0;
1026
1090
  }
@@ -1416,7 +1480,7 @@ var EndpointMethods = class {
1416
1480
  * @param name - The name segment of the path, escaped into it.
1417
1481
  * @param fields - The request body, as {@link CustomBodyByNameRequest} describes it, sent as given. signal may stand beside its fields.
1418
1482
  * @param keywords - signal, and output for a document, when they come apart from the body.
1419
- * @returns The answer as a Result, checked against JsonObject.
1483
+ * @returns The answer as a Result, checked against {@link CustomBodyPlacedResponse}.
1420
1484
  * @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.
1421
1485
  */
1422
1486
  async chartWithCustomBody(name2, fields, keywords) {
@@ -1432,10 +1496,15 @@ var EndpointMethods = class {
1432
1496
  {
1433
1497
  json: call.json,
1434
1498
  technique: "chart_with_custom_body",
1499
+ enveloped: false,
1435
1500
  signal: call.signal
1436
1501
  }
1437
1502
  );
1438
- return readFreeForm(answer, isJsonObject, "chartWithCustomBody");
1503
+ return readResult(
1504
+ answer,
1505
+ isCustomBodyPlacedResponse,
1506
+ "chartWithCustomBody"
1507
+ );
1439
1508
  }
1440
1509
  /**
1441
1510
  * Compatibility score from 0 to 100.
@@ -1508,7 +1577,7 @@ var EndpointMethods = class {
1508
1577
  * Return every custom body saved by the current identity.
1509
1578
  *
1510
1579
  * @param params - signal, which cancels the call.
1511
- * @returns The answer as a Result, checked against JsonObject.
1580
+ * @returns The answer as a Result, checked against {@link CustomBodyListResponse}.
1512
1581
  * @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.
1513
1582
  */
1514
1583
  async customBodies(params2) {
@@ -1516,9 +1585,10 @@ var EndpointMethods = class {
1516
1585
  const answer = await this.request("GET", "/v1/custom-body/list", {
1517
1586
  params: call.params,
1518
1587
  technique: "custom_bodies",
1588
+ enveloped: false,
1519
1589
  signal: call.signal
1520
1590
  });
1521
- return readFreeForm(answer, isJsonObject, "customBodies");
1591
+ return readResult(answer, isCustomBodyListResponse, "customBodies");
1522
1592
  }
1523
1593
  /**
1524
1594
  * Custom elliptic or hyperbolic Keplerian body.
@@ -1626,7 +1696,7 @@ var EndpointMethods = class {
1626
1696
  *
1627
1697
  * @param name - The name segment of the path, escaped into it.
1628
1698
  * @param params - signal, which cancels the call.
1629
- * @returns The answer as a Result, checked against JsonObject.
1699
+ * @returns The answer as a Result, checked against {@link CustomBodyDeleteResponse}.
1630
1700
  * @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.
1631
1701
  */
1632
1702
  async deleteCustomBody(name2, params2) {
@@ -1637,10 +1707,11 @@ var EndpointMethods = class {
1637
1707
  {
1638
1708
  params: call.params,
1639
1709
  technique: "delete_custom_body",
1710
+ enveloped: false,
1640
1711
  signal: call.signal
1641
1712
  }
1642
1713
  );
1643
- return readFreeForm(answer, isJsonObject, "deleteCustomBody");
1714
+ return readResult(answer, isCustomBodyDeleteResponse, "deleteCustomBody");
1644
1715
  }
1645
1716
  /**
1646
1717
  * Classical dignities and almuten.
@@ -2305,6 +2376,38 @@ var EndpointMethods = class {
2305
2376
  });
2306
2377
  return readWrapped(answer, isTechniqueEnvelope, "patterns");
2307
2378
  }
2379
+ /**
2380
+ * A planet's satellites, in three frames at once.
2381
+ *
2382
+ * @remarks
2383
+ * Sends `POST /v1/planetary-system`. The Python SDK names it planetary_system.
2384
+ *
2385
+ * Calculate a planet's satellite system for a birth moment.
2386
+ *
2387
+ * Three answers come back for every satellite and they are not versions of
2388
+ * one another. From Earth the Galilean moons sit within arcminutes of
2389
+ * Jupiter, so the observed longitude repeats the planet's own. The
2390
+ * planet-centred longitude says where the moon is in its orbit but has no
2391
+ * horizon and therefore no houses. And the projected layer carries that
2392
+ * orbital phase onto the natal circle from Jupiter's own degree, which is
2393
+ * an AstroMansion derivation rather than a received rule. The request names
2394
+ * no language, so the signs are named in English.
2395
+ *
2396
+ * @param fields - The request body, as {@link PlanetarySystemRequest} describes it, sent as given. signal may stand beside its fields.
2397
+ * @param keywords - signal, and output for a document, when they come apart from the body.
2398
+ * @returns The answer as a Result, checked against {@link PlanetarySystemResponse}.
2399
+ * @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.
2400
+ */
2401
+ async planetarySystem(fields, keywords) {
2402
+ const call = RequestBodies.body("planetarySystem", fields, keywords, false);
2403
+ const answer = await this.request("POST", "/v1/planetary-system", {
2404
+ json: call.json,
2405
+ technique: "planetary_system",
2406
+ enveloped: false,
2407
+ signal: call.signal
2408
+ });
2409
+ return readResult(answer, isPlanetarySystemResponse, "planetarySystem");
2410
+ }
2308
2411
  /**
2309
2412
  * Annual profections.
2310
2413
  *
@@ -2582,7 +2685,7 @@ var EndpointMethods = class {
2582
2685
  *
2583
2686
  * @param fields - The request body, as {@link CustomBodySaveRequest} describes it, sent as given. signal may stand beside its fields.
2584
2687
  * @param keywords - signal, and output for a document, when they come apart from the body.
2585
- * @returns The answer as a Result, checked against JsonObject.
2688
+ * @returns The answer as a Result, checked against {@link CustomBodySaveResponse}.
2586
2689
  * @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.
2587
2690
  */
2588
2691
  async saveCustomBody(fields, keywords) {
@@ -2590,9 +2693,10 @@ var EndpointMethods = class {
2590
2693
  const answer = await this.request("POST", "/v1/custom-body/save", {
2591
2694
  json: call.json,
2592
2695
  technique: "save_custom_body",
2696
+ enveloped: false,
2593
2697
  signal: call.signal
2594
2698
  });
2595
- return readFreeForm(answer, isJsonObject, "saveCustomBody");
2699
+ return readResult(answer, isCustomBodySaveResponse, "saveCustomBody");
2596
2700
  }
2597
2701
  /**
2598
2702
  * Search place names.
@@ -3861,6 +3965,9 @@ async function parans(...args) {
3861
3965
  async function patterns(...args) {
3862
3966
  return defaultClient().patterns(...args);
3863
3967
  }
3968
+ async function planetarySystem(...args) {
3969
+ return defaultClient().planetarySystem(...args);
3970
+ }
3864
3971
  async function profection(...args) {
3865
3972
  return defaultClient().profection(...args);
3866
3973
  }