@welldot/core 0.2.2 → 0.3.0
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 +76 -53
- package/README.md +5 -3
- package/dist/index.cjs +26 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +117 -2
- package/dist/index.d.ts +117 -2
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -1
- package/docs/schema/v2/well.schema.json +51 -6
- package/docs/spec/v2/format-reference.md +38 -4
- package/docs/spec/v2/interoperability.md +4 -2
- package/docs/spec/v2/object-schemas.md +45 -14
- package/docs/spec/v2/overview.md +31 -4
- package/package.json +1 -1
package/LICENSE
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
Apache License
|
|
2
3
|
Version 2.0, January 2004
|
|
3
4
|
http://www.apache.org/licenses/
|
|
@@ -32,9 +33,10 @@
|
|
|
32
33
|
not limited to compiled object code, generated documentation,
|
|
33
34
|
and conversions to other media types.
|
|
34
35
|
|
|
35
|
-
"Work" shall mean the work of authorship
|
|
36
|
-
the License, as indicated by a
|
|
37
|
-
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
38
40
|
|
|
39
41
|
"Derivative Works" shall mean any work, whether in Source or Object
|
|
40
42
|
form, that is based on (or derived from) the Work and for which the
|
|
@@ -44,21 +46,23 @@
|
|
|
44
46
|
separable from, or merely link (or bind by name) to the interfaces of,
|
|
45
47
|
the Work and Derivative Works thereof.
|
|
46
48
|
|
|
47
|
-
"Contribution" shall mean
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
or
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
62
66
|
|
|
63
67
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
64
68
|
this License, each Contributor hereby grants to You a perpetual,
|
|
@@ -74,22 +78,22 @@
|
|
|
74
78
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
75
79
|
where such license applies only to those patent claims licensable
|
|
76
80
|
by such Contributor that are necessarily infringed by their
|
|
77
|
-
Contribution(s) alone or by
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
78
82
|
with the Work to which such Contribution(s) was submitted. If You
|
|
79
|
-
institute patent litigation against any entity (including a
|
|
80
|
-
or counterclaim in a lawsuit) alleging that the Work
|
|
81
|
-
Contribution
|
|
82
|
-
patent infringement, then any patent licenses
|
|
83
|
-
this License for that Work shall terminate
|
|
84
|
-
litigation is filed.
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
85
89
|
|
|
86
90
|
4. Redistribution. You may reproduce and distribute copies of the
|
|
87
91
|
Work or Derivative Works thereof in any medium, with or without
|
|
88
92
|
modifications, and in Source or Object form, provided that You
|
|
89
93
|
meet the following conditions:
|
|
90
94
|
|
|
91
|
-
(a) You must give any other recipients of the Work or
|
|
92
|
-
Works a copy of this License; and
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
93
97
|
|
|
94
98
|
(b) You must cause any modified files to carry prominent notices
|
|
95
99
|
stating that You changed the files; and
|
|
@@ -101,24 +105,28 @@
|
|
|
101
105
|
the Derivative Works; and
|
|
102
106
|
|
|
103
107
|
(d) If the Work includes a "NOTICE" text file as part of its
|
|
104
|
-
distribution,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
the
|
|
109
|
-
Derivative Works;
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
122
130
|
|
|
123
131
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
124
132
|
any Contribution intentionally submitted for inclusion in the Work
|
|
@@ -140,7 +148,7 @@
|
|
|
140
148
|
implied, including, without limitation, any warranties or conditions
|
|
141
149
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
142
150
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
143
|
-
appropriateness of using or
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
144
152
|
risks associated with Your exercise of permissions under this License.
|
|
145
153
|
|
|
146
154
|
8. Limitation of Liability. In no event and under no legal theory,
|
|
@@ -148,23 +156,38 @@
|
|
|
148
156
|
unless required by applicable law (such as deliberate and grossly
|
|
149
157
|
negligent acts) or agreed to in writing, shall any Contributor be
|
|
150
158
|
liable to You for damages, including any direct, indirect, special,
|
|
151
|
-
incidental, or
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
152
160
|
result of this License or out of the use or inability to use the
|
|
153
161
|
Work (including but not limited to damages for loss of goodwill,
|
|
154
|
-
work stoppage, computer failure or malfunction, or all
|
|
155
|
-
commercial damages or losses), even if such Contributor
|
|
156
|
-
advised of the possibility of such damages.
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
157
165
|
|
|
158
166
|
9. Accepting Warranty or Additional Liability. While redistributing
|
|
159
167
|
the Work or Derivative Works thereof, You may choose to offer,
|
|
160
168
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
161
169
|
or other liability obligations and/or rights consistent with this
|
|
162
|
-
License. However, in accepting such obligations, You may
|
|
163
|
-
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
164
176
|
|
|
165
177
|
END OF TERMS AND CONDITIONS
|
|
166
178
|
|
|
167
|
-
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2024 Rafael Neto
|
|
168
191
|
|
|
169
192
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
170
193
|
you may not use this file except in compliance with the License.
|
package/README.md
CHANGED
|
@@ -10,16 +10,16 @@ TypeScript types, Zod validators, and serialization utilities for the `.well` op
|
|
|
10
10
|
|
|
11
11
|
`.well` is an open file format for encoding the complete record of a water well as a single, self-describing JSON document. A `.well` file contains:
|
|
12
12
|
|
|
13
|
-
- **Constructive data** — borehole geometry, casing strings, screens, reducers, gravel packs, and cement pads
|
|
13
|
+
- **Constructive data** — borehole geometry, casing strings, screens, reducers, gravel packs, centralizers, and cement pads
|
|
14
14
|
- **Geologic data** — lithological column, discrete fractures, and cave zones
|
|
15
|
-
- **Administrative metadata** — well identity, authority-scoped IDs (`well_id`), driller, construction date, and geographic coordinates with explicit CRS
|
|
15
|
+
- **Administrative metadata** — well identity, construction type and purpose (`well_type`, `well_purpose`), authority-scoped IDs (`well_id`), driller, construction date, and geographic coordinates with explicit CRS
|
|
16
16
|
- **Hydrodynamic events** — append-only ledger of static level readings, pumping tests (constant-rate, step-drawdown, airlift), and recovery phases
|
|
17
17
|
- **Aquifer analysis** — interpreted parameter sets: transmissivity, specific capacity, storativity, and Jacob loss coefficients
|
|
18
18
|
- **Operational history** — timestamped log of maintenance, inspections, and incidents with HTTPS attachment references
|
|
19
19
|
|
|
20
20
|
The format is designed for three use cases: visualization of technical well profiles, registration with regulatory bodies, and hydrogeological research.
|
|
21
21
|
|
|
22
|
-
See the [v2 format specification](./docs/spec/v2/overview.md) for the complete schema reference and design rationale. The [v1 spec](./docs/spec/v1/well-format.md) remains available for reference.
|
|
22
|
+
See the [v2 format specification](./docs/spec/v2/overview.md) (current revision: v2.1) for the complete schema reference and design rationale. The [v1 spec](./docs/spec/v1/well-format.md) remains available for reference.
|
|
23
23
|
|
|
24
24
|
## Installation
|
|
25
25
|
|
|
@@ -80,6 +80,7 @@ All types are exported as TypeScript type-only exports (zero runtime cost).
|
|
|
80
80
|
| `SurfaceCase` | Protective casing near the surface |
|
|
81
81
|
| `HoleFill` | Annular fill material (`gravel_pack` or `seal`) |
|
|
82
82
|
| `CementPad` | Concrete wellhead pad dimensions |
|
|
83
|
+
| `Centralizer` | Casing/screen centralizers over a depth interval with spacing (v2.1) |
|
|
83
84
|
| `Lithology` | Geological description of a depth interval |
|
|
84
85
|
| `Texture` | `{ code: string \| number; vocabulary?: string }` — lithology texture reference |
|
|
85
86
|
| `Fracture` | A discrete fracture or fracture zone |
|
|
@@ -123,6 +124,7 @@ Each schema validates its corresponding type at runtime. All schemas are Zod obj
|
|
|
123
124
|
| `SurfaceCaseSchema` | `SurfaceCase` |
|
|
124
125
|
| `HoleFillSchema` | `HoleFill` |
|
|
125
126
|
| `CementPadSchema` | `CementPad` |
|
|
127
|
+
| `CentralizerSchema` | `Centralizer` |
|
|
126
128
|
| `LithologySchema` | `Lithology` |
|
|
127
129
|
| `TextureSchema` | `Texture` |
|
|
128
130
|
| `FractureSchema` | `Fracture` |
|
package/dist/index.cjs
CHANGED
|
@@ -26,6 +26,7 @@ __export(index_exports, {
|
|
|
26
26
|
BoreHoleSchema: () => BoreHoleSchema,
|
|
27
27
|
CaveSchema: () => CaveSchema,
|
|
28
28
|
CementPadSchema: () => CementPadSchema,
|
|
29
|
+
CentralizerSchema: () => CentralizerSchema,
|
|
29
30
|
ConstantRateEventSchema: () => ConstantRateEventSchema,
|
|
30
31
|
FGDC_TEXTURES_OPTIONS: () => FGDC_TEXTURES_OPTIONS,
|
|
31
32
|
FractureSchema: () => FractureSchema,
|
|
@@ -147,6 +148,14 @@ var SurfaceCaseSchema = import_zod.z.object({
|
|
|
147
148
|
to: import_zod.z.number(),
|
|
148
149
|
diameter: import_zod.z.number()
|
|
149
150
|
});
|
|
151
|
+
var CentralizerSchema = import_zod.z.object({
|
|
152
|
+
from: import_zod.z.number(),
|
|
153
|
+
to: import_zod.z.number(),
|
|
154
|
+
spacing: import_zod.z.number().positive().optional(),
|
|
155
|
+
type: import_zod.z.string(),
|
|
156
|
+
diameter: import_zod.z.number().optional(),
|
|
157
|
+
description: import_zod.z.string().optional()
|
|
158
|
+
});
|
|
150
159
|
var CementPadSchema = import_zod.z.object({
|
|
151
160
|
type: import_zod.z.string(),
|
|
152
161
|
width: import_zod.z.number(),
|
|
@@ -300,6 +309,7 @@ var WellSchema = import_zod.z.object({
|
|
|
300
309
|
})
|
|
301
310
|
).optional(),
|
|
302
311
|
well_type: import_zod.z.string().optional(),
|
|
312
|
+
well_purpose: import_zod.z.array(import_zod.z.string()).optional(),
|
|
303
313
|
name: import_zod.z.string().optional(),
|
|
304
314
|
well_driller: import_zod.z.string().optional(),
|
|
305
315
|
construction_date: import_zod.z.string().regex(/^\d{4}-\d{2}-\d{2}$/, "construction_date must be YYYY-MM-DD").optional(),
|
|
@@ -314,6 +324,7 @@ var WellSchema = import_zod.z.object({
|
|
|
314
324
|
well_screen: import_zod.z.array(WellScreenSchema),
|
|
315
325
|
surface_case: import_zod.z.array(SurfaceCaseSchema),
|
|
316
326
|
hole_fill: import_zod.z.array(HoleFillSchema),
|
|
327
|
+
centralizers: import_zod.z.array(CentralizerSchema).optional(),
|
|
317
328
|
cement_pad: CementPadSchema.optional(),
|
|
318
329
|
lithology: import_zod.z.array(LithologySchema),
|
|
319
330
|
fractures: import_zod.z.array(FractureSchema),
|
|
@@ -526,6 +537,9 @@ function decodeV2Well(raw) {
|
|
|
526
537
|
profiles: raw.profiles
|
|
527
538
|
},
|
|
528
539
|
...raw.well_type !== void 0 && { well_type: raw.well_type },
|
|
540
|
+
...raw.well_purpose !== void 0 && {
|
|
541
|
+
well_purpose: raw.well_purpose
|
|
542
|
+
},
|
|
529
543
|
...raw.name !== void 0 && { name: raw.name },
|
|
530
544
|
...raw.well_driller !== void 0 && {
|
|
531
545
|
well_driller: raw.well_driller
|
|
@@ -543,6 +557,9 @@ function decodeV2Well(raw) {
|
|
|
543
557
|
well_screen: normalizeWellScreens(rawScreens),
|
|
544
558
|
surface_case: raw.surface_case ?? [],
|
|
545
559
|
hole_fill: raw.hole_fill ?? [],
|
|
560
|
+
...raw.centralizers !== void 0 && {
|
|
561
|
+
centralizers: raw.centralizers
|
|
562
|
+
},
|
|
546
563
|
...raw.cement_pad ? { cement_pad: raw.cement_pad } : {},
|
|
547
564
|
lithology: normalizeLithology(raw.lithology ?? []),
|
|
548
565
|
fractures: raw.fractures ?? [],
|
|
@@ -604,6 +621,9 @@ function serializeWell(well) {
|
|
|
604
621
|
...well.location !== void 0 && { location: well.location },
|
|
605
622
|
...well.profiles !== void 0 && { profiles: well.profiles },
|
|
606
623
|
...well.well_type !== void 0 && { well_type: well.well_type },
|
|
624
|
+
...well.well_purpose !== void 0 && {
|
|
625
|
+
well_purpose: well.well_purpose
|
|
626
|
+
},
|
|
607
627
|
...well.name !== void 0 && { name: well.name },
|
|
608
628
|
...well.well_driller !== void 0 && { well_driller: well.well_driller },
|
|
609
629
|
...well.construction_date !== void 0 && {
|
|
@@ -617,6 +637,9 @@ function serializeWell(well) {
|
|
|
617
637
|
well_screen: well.well_screen,
|
|
618
638
|
surface_case: well.surface_case,
|
|
619
639
|
hole_fill: well.hole_fill,
|
|
640
|
+
...well.centralizers !== void 0 && {
|
|
641
|
+
centralizers: well.centralizers
|
|
642
|
+
},
|
|
620
643
|
...well.cement_pad && { cement_pad: well.cement_pad },
|
|
621
644
|
lithology: well.lithology,
|
|
622
645
|
fractures: well.fractures,
|
|
@@ -643,6 +666,7 @@ function redactWell(well, visibility) {
|
|
|
643
666
|
delete redacted.well_id;
|
|
644
667
|
delete redacted.location;
|
|
645
668
|
delete redacted.well_type;
|
|
669
|
+
delete redacted.well_purpose;
|
|
646
670
|
delete redacted.name;
|
|
647
671
|
delete redacted.well_driller;
|
|
648
672
|
delete redacted.construction_date;
|
|
@@ -658,6 +682,7 @@ function redactWell(well, visibility) {
|
|
|
658
682
|
redacted.well_screen = [];
|
|
659
683
|
redacted.surface_case = [];
|
|
660
684
|
redacted.hole_fill = [];
|
|
685
|
+
delete redacted.centralizers;
|
|
661
686
|
delete redacted.cement_pad;
|
|
662
687
|
delete redacted.well_depth;
|
|
663
688
|
}
|
|
@@ -1104,6 +1129,7 @@ function hoursToMinutes(h) {
|
|
|
1104
1129
|
BoreHoleSchema,
|
|
1105
1130
|
CaveSchema,
|
|
1106
1131
|
CementPadSchema,
|
|
1132
|
+
CentralizerSchema,
|
|
1107
1133
|
ConstantRateEventSchema,
|
|
1108
1134
|
FGDC_TEXTURES_OPTIONS,
|
|
1109
1135
|
FractureSchema,
|