@swisseph/node 1.0.1 → 1.0.2

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.
@@ -0,0 +1,118 @@
1
+ /* Copyright (C) 1997 - 2021 Astrodienst AG, Switzerland. All rights reserved.
2
+
3
+ License conditions
4
+ ------------------
5
+
6
+ This file is part of Swiss Ephemeris.
7
+
8
+ Swiss Ephemeris is distributed with NO WARRANTY OF ANY KIND. No author
9
+ or distributor accepts any responsibility for the consequences of using it,
10
+ or for whether it serves any particular purpose or works at all, unless he
11
+ or she says so in writing.
12
+
13
+ Swiss Ephemeris is made available by its authors under a dual licensing
14
+ system. The software developer, who uses any part of Swiss Ephemeris
15
+ in his or her software, must choose between one of the two license models,
16
+ which are
17
+ a) GNU Affero General Public License (AGPL)
18
+ b) Swiss Ephemeris Professional License
19
+
20
+ The choice must be made before the software developer distributes software
21
+ containing parts of Swiss Ephemeris to others, and before any public
22
+ service using the developed software is activated.
23
+
24
+ If the developer choses the AGPL software license, he or she must fulfill
25
+ the conditions of that license, which includes the obligation to place his
26
+ or her whole software project under the AGPL or a compatible license.
27
+ See https://www.gnu.org/licenses/agpl-3.0.html
28
+
29
+ If the developer choses the Swiss Ephemeris Professional license,
30
+ he must follow the instructions as found in http://www.astro.com/swisseph/
31
+ and purchase the Swiss Ephemeris Professional Edition from Astrodienst
32
+ and sign the corresponding license contract.
33
+
34
+ The License grants you the right to use, copy, modify and redistribute
35
+ Swiss Ephemeris, but only under certain conditions described in the License.
36
+ Among other things, the License requires that the copyright notices and
37
+ this notice be preserved on all copies.
38
+
39
+ Authors of the Swiss Ephemeris: Dieter Koch and Alois Treindl
40
+
41
+ The authors of Swiss Ephemeris have no control or influence over any of
42
+ the derived works, i.e. over software or services created by other
43
+ programmers which use Swiss Ephemeris functions.
44
+
45
+ The names of the authors or of the copyright holder (Astrodienst) must not
46
+ be used for promoting any software, product or service which uses or contains
47
+ the Swiss Ephemeris. This copyright notice is the ONLY place where the
48
+ names of the authors can legally appear, except in cases where they have
49
+ given special permission in writing.
50
+
51
+ The trademarks 'Swiss Ephemeris' and 'Swiss Ephemeris inside' may be used
52
+ for promoting such software, products or services.
53
+ */
54
+ #define TTINY 0.000001
55
+ #define TENTHOFSEC (1.0 / 86400.0)
56
+ #define HUNDTHOFSEC (1.0 / 864000.0)
57
+
58
+ #define NEVENTMAX 100000
59
+ #define EVENT struct event
60
+ struct event {
61
+ double tjd;
62
+ int32 evtype;
63
+ int32 ipla;
64
+ int32 iplb; /* needed for aspects, occultations, */
65
+ char stnama[40];
66
+ char stnamb[40];
67
+ int32 iasp;
68
+ int32 bpind; /* body pair index: ipl1 * 50 + ipl2 */
69
+ double dasp;
70
+ double dang;
71
+ int32 isign; /* needed for ingresses */
72
+ int32 backward; /* needed for ingresses */
73
+ double dorb;
74
+ double dret; /* content depends on event type */
75
+ };
76
+
77
+ struct aspdat {
78
+ double tjd;
79
+ int32 iasp;
80
+ double tjd_pre;
81
+ double tjd_post;
82
+ int32 fpos_tjd_post;
83
+ };
84
+
85
+ #define CTYP_MASPECTS 0
86
+ #define CTYP_INGRESSES 1
87
+ #define CTYP_TRANSITS 2
88
+ #define CTYP_VOC 3
89
+
90
+ #define SPLAN_INGRESS "0123456789mtAFD"
91
+ #define SPLAN_ASPECTS "0123456789mtAFD,a[136199],f[Gal]"
92
+ /*#define SPLAN_ASPECTS "0123456789mtAFD,f[Gal],f[Ald],a[136199],a[433]"*/
93
+ #define SASP_ASPECTS "1234567"
94
+
95
+ /* void-of-course moon calculation */
96
+ #define VOC struct voc
97
+
98
+ VOC {
99
+ double tvoc; /* time of begin of voc phase */
100
+ double tingr; /* time of ingress that ends voc phase */
101
+ double tingr0; /* time of first ingress, if there are two ingresses
102
+ * during voc phase */
103
+ char casp, cpl; /* aspect and planet that marks begin of voc phase */
104
+ int isign_voc; /* sign in which moon begins voc phase */
105
+ int isign_ingr; /* sign of ingress that ends voc phase */
106
+ int isign_ingr0; /* sign of first ingress, if there are two ingresses
107
+ * during voc phase */
108
+ };
109
+
110
+ #define INGRESS struct ingress
111
+
112
+ INGRESS {
113
+ int ipl; /* planet that makes ingress */
114
+ double tingr; /* time of ingress */
115
+ int isign; /* sign of ingress */
116
+ int direction; /* direct/retrograde: 1 or -1 */
117
+ int ino; /* number of transit over this sign boundary */
118
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swisseph/node",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Swiss Ephemeris for Node.js - high precision astronomical calculations with native bindings",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -17,6 +17,7 @@
17
17
  "binding",
18
18
  "binding.gyp",
19
19
  "ephemeris",
20
+ "libswe",
20
21
  "README.md"
21
22
  ],
22
23
  "keywords": [
@@ -46,8 +47,8 @@
46
47
  "access": "public"
47
48
  },
48
49
  "dependencies": {
49
- "@swisseph/core": "^1.0.1",
50
- "node-addon-api": "^7.1.0"
50
+ "node-addon-api": "^7.1.0",
51
+ "@swisseph/core": "1.0.4"
51
52
  },
52
53
  "devDependencies": {
53
54
  "@types/jest": "^29.5.11",
@@ -62,14 +63,16 @@
62
63
  "node": ">=14.0.0"
63
64
  },
64
65
  "scripts": {
65
- "install": "node-gyp rebuild",
66
+ "install": "npm run copy:libswe && node-gyp rebuild",
67
+ "copy:libswe": "mkdir -p libswe && cp ../../native/libswe/* libswe/",
68
+ "prebuild": "npm run copy:libswe",
66
69
  "build": "node-gyp rebuild && tsc",
67
70
  "build:native": "node-gyp rebuild",
68
71
  "build:js": "tsc",
69
72
  "test": "jest",
70
- "example": "npm run build && ts-node examples/basic-usage.ts",
71
- "example:chart": "npm run build && ts-node examples/birth-chart.ts",
72
- "example:moshier": "npm run build && ts-node examples/moshier-ephemeris.ts",
73
+ "example": "npm run build && ts-node -P tsconfig.test.json examples/basic-usage.ts",
74
+ "example:chart": "npm run build && ts-node -P tsconfig.test.json examples/birth-chart.ts",
75
+ "example:moshier": "npm run build && ts-node -P tsconfig.test.json examples/moshier-ephemeris.ts",
73
76
  "clean": "rm -rf dist build"
74
77
  }
75
78
  }