@neaps/tide-database 0.0.20251221 → 0.1.20260107
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/LICENSE +2 -2
- package/README.md +56 -36
- package/dist/index.cjs +494810 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +57 -0
- package/dist/index.d.ts +51 -43
- package/dist/index.js +494807 -46288
- package/dist/index.js.map +1 -0
- package/package.json +17 -6
- package/schemas/station.schema.json +63 -31
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neaps/tide-database",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.20260107",
|
|
4
4
|
"description": "A public database of tide harmonics",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tides",
|
|
@@ -16,25 +16,36 @@
|
|
|
16
16
|
"url": "git+https://github.com/neaps/tide-database.git"
|
|
17
17
|
},
|
|
18
18
|
"license": "MIT",
|
|
19
|
-
"author": "",
|
|
19
|
+
"author": "Brandon Keepers <brandon@openwaters.io>",
|
|
20
20
|
"type": "module",
|
|
21
|
-
"main": "dist/index.
|
|
21
|
+
"main": "dist/index.cjs",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"import": "./dist/index.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
22
28
|
"directories": {
|
|
23
29
|
"doc": "docs"
|
|
24
30
|
},
|
|
25
31
|
"scripts": {
|
|
26
|
-
"build": "
|
|
32
|
+
"build": "tsc -b && tsc -p tsconfig.node.json && tsdown",
|
|
27
33
|
"prepare": "npm run build",
|
|
28
34
|
"test": "vitest"
|
|
29
35
|
},
|
|
30
36
|
"devDependencies": {
|
|
37
|
+
"@neaps/tide-predictor": "^0.2.1",
|
|
38
|
+
"@types/make-fetch-happen": "^10.0.4",
|
|
39
|
+
"@types/node": "^25.0.3",
|
|
31
40
|
"ajv": "^8.17.1",
|
|
32
41
|
"ajv-formats": "^3.0.1",
|
|
42
|
+
"country-code-lookup": "^0.1.3",
|
|
33
43
|
"geo-tz": "^8.1.4",
|
|
34
44
|
"make-fetch-happen": "^15.0.3",
|
|
35
45
|
"moment": "^2.30.1",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
46
|
+
"sort-object-keys": "^2.0.1",
|
|
47
|
+
"tsdown": "^0.19.0-beta.3",
|
|
48
|
+
"typescript": "^5.9.3",
|
|
38
49
|
"vitest": "^4.0.15"
|
|
39
50
|
},
|
|
40
51
|
"files": [
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"$defs": {
|
|
20
20
|
"offsets": {
|
|
21
21
|
"type": "object",
|
|
22
|
+
"description": "Offsets for subordinate stations relative to a reference station",
|
|
22
23
|
"required": [
|
|
23
24
|
"reference",
|
|
24
25
|
"height",
|
|
@@ -27,10 +28,12 @@
|
|
|
27
28
|
"additionalProperties": false,
|
|
28
29
|
"properties": {
|
|
29
30
|
"reference": {
|
|
30
|
-
"type": "string"
|
|
31
|
+
"type": "string",
|
|
32
|
+
"description": "The ID of the reference station"
|
|
31
33
|
},
|
|
32
34
|
"height": {
|
|
33
35
|
"type": "object",
|
|
36
|
+
"description": "Defines the values to add or multiply with water levels (depending on type)",
|
|
34
37
|
"required": [
|
|
35
38
|
"high",
|
|
36
39
|
"low",
|
|
@@ -39,10 +42,12 @@
|
|
|
39
42
|
"additionalProperties": false,
|
|
40
43
|
"properties": {
|
|
41
44
|
"high": {
|
|
42
|
-
"type": "number"
|
|
45
|
+
"type": "number",
|
|
46
|
+
"description": "Height offset/multiplier for high tide - if type is 'ratio', this is a multiplier; if 'fixed', this is an offset to add (can be negative)"
|
|
43
47
|
},
|
|
44
48
|
"low": {
|
|
45
|
-
"type": "number"
|
|
49
|
+
"type": "number",
|
|
50
|
+
"description": "Height offset/multiplier for low tide - if type is 'ratio', this is a multiplier; if 'fixed', this is an offset to add (can be negative)"
|
|
46
51
|
},
|
|
47
52
|
"type": {
|
|
48
53
|
"enum": [
|
|
@@ -54,6 +59,7 @@
|
|
|
54
59
|
},
|
|
55
60
|
"time": {
|
|
56
61
|
"type": "object",
|
|
62
|
+
"description": "Defines the time to add to when a high or low tide will occur",
|
|
57
63
|
"required": [
|
|
58
64
|
"high",
|
|
59
65
|
"low"
|
|
@@ -61,10 +67,12 @@
|
|
|
61
67
|
"additionalProperties": false,
|
|
62
68
|
"properties": {
|
|
63
69
|
"high": {
|
|
64
|
-
"type": "number"
|
|
70
|
+
"type": "number",
|
|
71
|
+
"description": "Time offset, in minutes, to add to the high tide (can be negative)"
|
|
65
72
|
},
|
|
66
73
|
"low": {
|
|
67
|
-
"type": "number"
|
|
74
|
+
"type": "number",
|
|
75
|
+
"description": "Time offset, in minutes, to add to the low tide (can be negative)"
|
|
68
76
|
}
|
|
69
77
|
}
|
|
70
78
|
}
|
|
@@ -74,7 +82,12 @@
|
|
|
74
82
|
"properties": {
|
|
75
83
|
"id": {
|
|
76
84
|
"type": "string",
|
|
77
|
-
"
|
|
85
|
+
"description": "Unique station ID for this database only, in the format of `country/region/station-name`.",
|
|
86
|
+
"examples": [
|
|
87
|
+
"us-ma-boston",
|
|
88
|
+
"ar-u-puerto-madryn"
|
|
89
|
+
],
|
|
90
|
+
"minLength": 4
|
|
78
91
|
},
|
|
79
92
|
"name": {
|
|
80
93
|
"type": "string",
|
|
@@ -82,68 +95,77 @@
|
|
|
82
95
|
},
|
|
83
96
|
"continent": {
|
|
84
97
|
"type": "string",
|
|
98
|
+
"description": "Continent name in title case (e.g., `North America`, `Asia`, `Europe`)",
|
|
85
99
|
"minLength": 1
|
|
86
100
|
},
|
|
87
101
|
"country": {
|
|
88
102
|
"type": "string",
|
|
103
|
+
"description": "Full country name (e.g., `United States`)",
|
|
89
104
|
"minLength": 1
|
|
90
105
|
},
|
|
91
106
|
"region": {
|
|
92
|
-
"type": "string"
|
|
107
|
+
"type": "string",
|
|
108
|
+
"description": "ISO 3166-2 region code, if available. If not, whatever local postal codes"
|
|
93
109
|
},
|
|
94
110
|
"timezone": {
|
|
95
|
-
"type": "string"
|
|
111
|
+
"type": "string",
|
|
112
|
+
"description": "IANA time zone code (e.g. `America/Los_Angeles`)"
|
|
96
113
|
},
|
|
97
114
|
"disclaimers": {
|
|
98
|
-
"type": "string"
|
|
115
|
+
"type": "string",
|
|
116
|
+
"description": "Any disclaimers about using this data"
|
|
99
117
|
},
|
|
100
118
|
"type": {
|
|
119
|
+
"type": "string",
|
|
101
120
|
"enum": [
|
|
102
121
|
"reference",
|
|
103
122
|
"subordinate"
|
|
104
123
|
]
|
|
105
124
|
},
|
|
106
125
|
"latitude": {
|
|
107
|
-
"type": "number"
|
|
126
|
+
"type": "number",
|
|
127
|
+
"description": "Latitude, in decimal degrees"
|
|
108
128
|
},
|
|
109
129
|
"longitude": {
|
|
110
|
-
"type": "number"
|
|
130
|
+
"type": "number",
|
|
131
|
+
"description": "Longitude, in decimal degrees"
|
|
111
132
|
},
|
|
112
133
|
"source": {
|
|
113
134
|
"type": "object",
|
|
135
|
+
"description": "",
|
|
114
136
|
"required": [
|
|
115
137
|
"name",
|
|
116
138
|
"id",
|
|
117
139
|
"published_harmonics",
|
|
118
|
-
"url"
|
|
119
|
-
"source_url"
|
|
140
|
+
"url"
|
|
120
141
|
],
|
|
121
142
|
"additionalProperties": true,
|
|
122
143
|
"properties": {
|
|
123
144
|
"name": {
|
|
124
|
-
"type": "string"
|
|
145
|
+
"type": "string",
|
|
146
|
+
"name": "Name of the source, i.e. `NOAA`"
|
|
125
147
|
},
|
|
126
148
|
"id": {
|
|
127
149
|
"type": [
|
|
128
150
|
"string",
|
|
129
151
|
"number"
|
|
130
|
-
]
|
|
152
|
+
],
|
|
153
|
+
"description": "The identifier used by the source for this station."
|
|
131
154
|
},
|
|
132
155
|
"published_harmonics": {
|
|
133
|
-
"type": "boolean"
|
|
156
|
+
"type": "boolean",
|
|
157
|
+
"description": "Are the harmonics from published harmonic data? False means harmonics were computed."
|
|
134
158
|
},
|
|
135
159
|
"url": {
|
|
136
160
|
"type": "string",
|
|
137
|
-
"format": "uri"
|
|
138
|
-
|
|
139
|
-
"source_url": {
|
|
140
|
-
"type": "string",
|
|
141
|
-
"format": "uri"
|
|
161
|
+
"format": "uri",
|
|
162
|
+
"description": "URL to this station's data or information in the source's website"
|
|
142
163
|
}
|
|
143
164
|
}
|
|
144
165
|
},
|
|
145
166
|
"license": {
|
|
146
167
|
"type": "object",
|
|
168
|
+
"description": "Defines the license and whatever restrictions are placed on use of the data.",
|
|
147
169
|
"required": [
|
|
148
170
|
"type",
|
|
149
171
|
"commercial_use",
|
|
@@ -152,17 +174,21 @@
|
|
|
152
174
|
"additionalProperties": true,
|
|
153
175
|
"properties": {
|
|
154
176
|
"type": {
|
|
155
|
-
"type": "string"
|
|
177
|
+
"type": "string",
|
|
178
|
+
"description": "A short description of the type of license (i.e. MIT, public domain, etc)"
|
|
156
179
|
},
|
|
157
180
|
"commercial_use": {
|
|
158
|
-
"type": "boolean"
|
|
181
|
+
"type": "boolean",
|
|
182
|
+
"description": "If `true` then there are no restrictions on commercial use."
|
|
159
183
|
},
|
|
160
184
|
"url": {
|
|
161
185
|
"type": "string",
|
|
162
|
-
"format": "uri"
|
|
186
|
+
"format": "uri",
|
|
187
|
+
"description": "A URL to the license information"
|
|
163
188
|
},
|
|
164
189
|
"notes": {
|
|
165
|
-
"type": "string"
|
|
190
|
+
"type": "string",
|
|
191
|
+
"description": "Any additional restrictions or information on the license."
|
|
166
192
|
}
|
|
167
193
|
}
|
|
168
194
|
},
|
|
@@ -179,26 +205,32 @@
|
|
|
179
205
|
"additionalProperties": false,
|
|
180
206
|
"properties": {
|
|
181
207
|
"name": {
|
|
182
|
-
"type": "string"
|
|
208
|
+
"type": "string",
|
|
209
|
+
"description": "Harmonic Constituent code (i.e. M2) - should be upper-case"
|
|
183
210
|
},
|
|
184
211
|
"description": {
|
|
185
212
|
"type": [
|
|
186
213
|
"string",
|
|
187
214
|
"number",
|
|
188
215
|
"null"
|
|
189
|
-
]
|
|
216
|
+
],
|
|
217
|
+
"description": "Human-friendly description of the constituent"
|
|
190
218
|
},
|
|
191
219
|
"amplitude": {
|
|
192
|
-
"type": "number"
|
|
220
|
+
"type": "number",
|
|
221
|
+
"description": "Amplitude"
|
|
193
222
|
},
|
|
194
223
|
"phase_UTC": {
|
|
195
|
-
"type": "number"
|
|
224
|
+
"type": "number",
|
|
225
|
+
"description": "Phase in UTC"
|
|
196
226
|
},
|
|
197
227
|
"phase_local": {
|
|
198
|
-
"type": "number"
|
|
228
|
+
"type": "number",
|
|
229
|
+
"description": "Phase for local timezone"
|
|
199
230
|
},
|
|
200
231
|
"speed": {
|
|
201
|
-
"type": "number"
|
|
232
|
+
"type": "number",
|
|
233
|
+
"description": "Angular speed"
|
|
202
234
|
},
|
|
203
235
|
"comments": {
|
|
204
236
|
"type": "string"
|