@nsshunt/stsdatamanagement 1.18.127 → 1.18.129

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.
Files changed (2) hide show
  1. package/db-scripts/builddb.sql +132 -11
  2. package/package.json +13 -13
@@ -1,3 +1,4 @@
1
+ ---- stsresfhir ------------------------------------------------------------------------------------------
1
2
  -- This table will always hold the current version of a resource type.
2
3
  CREATE TABLE stsresfhir (
3
4
  PID UUID PRIMARY KEY,
@@ -13,6 +14,8 @@ CREATE TABLE stsresfhir (
13
14
  UNIQUE (RES_ID, RES_TYPE)
14
15
  );
15
16
 
17
+ ---- stsresfhirver ------------------------------------------------------------------------------------------
18
+
16
19
  -- This table holds all the versions of a resource type.
17
20
  CREATE TABLE stsresfhirver (
18
21
  PID UUID PRIMARY KEY,
@@ -27,6 +30,8 @@ CREATE TABLE stsresfhirver (
27
30
  FOREIGN KEY (RES_ID, RES_TYPE) REFERENCES stsresfhir(RES_ID, RES_TYPE)
28
31
  );
29
32
 
33
+ ---- stsresfhirlink ------------------------------------------------------------------------------------------
34
+
30
35
  CREATE TABLE stsresfhirlink (
31
36
  PID UUID PRIMARY KEY,
32
37
  PARTITION_ID INTEGER,
@@ -37,9 +42,12 @@ CREATE TABLE stsresfhirlink (
37
42
  TARGET_RESOURCE_TYPE TEXT NOT NULL,
38
43
  TARGET_RESOURCE_ID TEXT, -- Either ID or URL - not both
39
44
  TARGET_RESOURCE_URL TEXT, -- Either ID or URL - not both
40
- UPDATED BIGINT NOT NULL
45
+ UPDATED BIGINT NOT NULL,
46
+ SP_STR TEXT NOT NULL
41
47
  );
42
48
 
49
+ ---- stsresfhirstring ------------------------------------------------------------------------------------------
50
+
43
51
  CREATE TABLE stsresfhirstring (
44
52
  PID UUID PRIMARY KEY,
45
53
  PARTITION_ID INTEGER,
@@ -49,6 +57,7 @@ CREATE TABLE stsresfhirstring (
49
57
  RES_ID TEXT NOT NULL,
50
58
  RES_TYPE TEXT NOT NULL,
51
59
  SP_MISSING BOOLEAN NOT NULL,
60
+ SP_STR TEXT NOT NULL,
52
61
  HASH_IDENTITY BIGINT NOT NULL,
53
62
  HASH_EXACT BIGINT NOT NULL,
54
63
  SP_VALUE_NORMALIZED TEXT NOT NULL,
@@ -56,9 +65,11 @@ CREATE TABLE stsresfhirstring (
56
65
  UPDATED BIGINT NOT NULL
57
66
  );
58
67
 
59
- CREATE INDEX idx_stsstring_hash_identity ON stsresfhirstring (HASH_IDENTITY);
60
- CREATE INDEX idx_stsstring_hash_exact ON stsresfhirstring (HASH_EXACT);
61
- CREATE INDEX idx_hash_value ON stsresfhirstring (HASH_IDENTITY, SP_VALUE_NORMALIZED);
68
+ CREATE INDEX idx_stsresfhirstring_hash_identity ON stsresfhirstring (HASH_IDENTITY);
69
+ CREATE INDEX idx_stsresfhirstring_hash_exact ON stsresfhirstring (HASH_EXACT);
70
+ CREATE INDEX idx_stsresfhirstring_hash_value ON stsresfhirstring (HASH_IDENTITY, SP_VALUE_NORMALIZED);
71
+
72
+ ---- stsresfhirtoken ------------------------------------------------------------------------------------------
62
73
 
63
74
  CREATE TABLE stsresfhirtoken (
64
75
  PID UUID PRIMARY KEY,
@@ -73,15 +84,18 @@ CREATE TABLE stsresfhirtoken (
73
84
  HASH_IDENTITY BIGINT NOT NULL,
74
85
  SP_SYSTEM TEXT NOT NULL,
75
86
  SP_VALUE TEXT NOT NULL,
87
+ SP_STR TEXT NOT NULL,
76
88
  HASH_VALUE BIGINT NOT NULL,
77
89
  HASH_SYS BIGINT NOT NULL,
78
90
  HASH_SYS_AND_VALUE BIGINT NOT NULL
79
91
  );
80
92
 
81
- CREATE INDEX idx_ststoken_hash_identity ON stsresfhirtoken (HASH_IDENTITY);
82
- CREATE INDEX idx_ststoken_hash_value ON stsresfhirtoken (HASH_VALUE);
83
- CREATE INDEX idx_ststoken_hash_sys ON stsresfhirtoken (HASH_SYS);
84
- CREATE INDEX idx_ststoken_hash_sys_and_value ON stsresfhirtoken (HASH_SYS_AND_VALUE);
93
+ CREATE INDEX idx_stsresfhirtoken_hash_identity ON stsresfhirtoken (HASH_IDENTITY);
94
+ CREATE INDEX idx_stsresfhirtoken_hash_value ON stsresfhirtoken (HASH_VALUE);
95
+ CREATE INDEX idx_stsresfhirtoken_hash_sys ON stsresfhirtoken (HASH_SYS);
96
+ CREATE INDEX idx_stsresfhirtoken_hash_sys_and_value ON stsresfhirtoken (HASH_SYS_AND_VALUE);
97
+
98
+ ---- stsresfhirquantity ------------------------------------------------------------------------------------------
85
99
 
86
100
  CREATE TABLE stsresfhirquantity (
87
101
  PID UUID PRIMARY KEY,
@@ -97,13 +111,120 @@ CREATE TABLE stsresfhirquantity (
97
111
  SP_SYSTEM TEXT NOT NULL,
98
112
  SP_VALUE DECIMAL NOT NULL,
99
113
  SP_UNITS TEXT NOT NULL,
114
+ SP_STR TEXT NOT NULL,
100
115
  HASH_IDENTITY_AND_UNITS BIGINT NOT NULL,
101
116
  HASH_IDENTITY_SYS_UNITS BIGINT NOT NULL
102
117
  );
103
118
 
104
- CREATE INDEX idx_stsquantity_hash_identity ON stsresfhirquantity (HASH_IDENTITY);
105
- CREATE INDEX idx_stsquantity_hash_units ON stsresfhirquantity (HASH_IDENTITY_AND_UNITS);
106
- CREATE INDEX idx_stsquantity_hash_sys_units ON stsresfhirquantity (HASH_IDENTITY_SYS_UNITS);
119
+ CREATE INDEX idx_stsresfhirquantity_hash_identity ON stsresfhirquantity (HASH_IDENTITY);
120
+ CREATE INDEX idx_stsresfhirquantity_hash_units ON stsresfhirquantity (HASH_IDENTITY_AND_UNITS);
121
+ CREATE INDEX idx_stsresfhirquantity_hash_sys_units ON stsresfhirquantity (HASH_IDENTITY_SYS_UNITS);
122
+
123
+ ---- stsresfhirnumber ------------------------------------------------------------------------------------------
124
+
125
+ CREATE TABLE stsresfhirnumber (
126
+ PID UUID PRIMARY KEY,
127
+ PARTITION_ID INTEGER,
128
+ PARTITION_DATE INTEGER,
129
+ SP_NAME TEXT NOT NULL,
130
+ SP_PARAM_TYPE TEXT NOT NULL,
131
+ RES_ID TEXT NOT NULL,
132
+ RES_TYPE TEXT NOT NULL,
133
+ UPDATED BIGINT NOT NULL,
134
+ SP_MISSING BOOLEAN NOT NULL,
135
+ HASH_IDENTITY BIGINT NOT NULL,
136
+ SP_VALUE DECIMAL NOT NULL,
137
+ SP_STR TEXT NOT NULL
138
+ );
139
+
140
+ CREATE INDEX idx_stsresfhirnumber_hash_identity ON stsresfhirnumber (HASH_IDENTITY);
141
+
142
+ ---- stsresfhiruri ------------------------------------------------------------------------------------------
143
+
144
+ CREATE TABLE stsresfhiruri (
145
+ PID UUID PRIMARY KEY,
146
+ PARTITION_ID INTEGER,
147
+ PARTITION_DATE INTEGER,
148
+ SP_NAME TEXT NOT NULL,
149
+ SP_PARAM_TYPE TEXT NOT NULL,
150
+ RES_ID TEXT NOT NULL,
151
+ RES_TYPE TEXT NOT NULL,
152
+ UPDATED BIGINT NOT NULL,
153
+ SP_MISSING BOOLEAN NOT NULL,
154
+ HASH_IDENTITY BIGINT NOT NULL,
155
+ SP_URI TEXT NOT NULL,
156
+ HASH_URI BIGINT NOT NULL,
157
+ SP_STR TEXT NOT NULL
158
+ );
159
+
160
+ CREATE INDEX idx_stsresfhiruri_hash_identity ON stsresfhiruri (HASH_IDENTITY);
161
+ CREATE INDEX idx_stsresfhiruri_hash_uri ON stsresfhiruri (HASH_URI);
162
+
163
+ ---- stsresfhirdate ------------------------------------------------------------------------------------------
164
+
165
+ CREATE TABLE stsresfhirdate (
166
+ PID UUID PRIMARY KEY,
167
+ PARTITION_ID INTEGER,
168
+ PARTITION_DATE INTEGER,
169
+ SP_NAME TEXT NOT NULL,
170
+ SP_PARAM_TYPE TEXT NOT NULL,
171
+ RES_ID TEXT NOT NULL,
172
+ RES_TYPE TEXT NOT NULL,
173
+ UPDATED BIGINT NOT NULL,
174
+ SP_MISSING BOOLEAN NOT NULL,
175
+ HASH_IDENTITY BIGINT NOT NULL,
176
+ SP_VALUE_LOW timestamp with time zone,
177
+ SP_VALUE_HIGH timestamp with time zone,
178
+ SP_VALUE_LOW_DATE_ORDINAL INTEGER,
179
+ SP_VALUE_HIGH_DATE_ORDINAL INTEGER,
180
+ SP_STR TEXT NOT NULL
181
+ );
182
+
183
+ CREATE INDEX idx_stsresfhirdate_hash_identity ON stsresfhirdate (HASH_IDENTITY);
184
+
185
+ ---- stsresfhircoords ------------------------------------------------------------------------------------------
186
+
187
+ CREATE TABLE stsresfhircoords (
188
+ PID UUID PRIMARY KEY,
189
+ PARTITION_ID INTEGER,
190
+ PARTITION_DATE INTEGER,
191
+ SP_NAME TEXT NOT NULL,
192
+ SP_PARAM_TYPE TEXT NOT NULL,
193
+ RES_ID TEXT NOT NULL,
194
+ RES_TYPE TEXT NOT NULL,
195
+ UPDATED BIGINT NOT NULL,
196
+ SP_MISSING BOOLEAN NOT NULL,
197
+ HASH_IDENTITY BIGINT NOT NULL,
198
+ SP_LATITUDE double precision,
199
+ SP_LONGITUDE double precision,
200
+ SP_STR TEXT NOT NULL
201
+ );
202
+
203
+ CREATE INDEX idx_stsresfhircoords_hash_identity ON stsresfhircoords (HASH_IDENTITY);
204
+
205
+ ---- stsresfhircombo ------------------------------------------------------------------------------------------
206
+
207
+ -- When joining with other index tables, use RES_ID and SP_NAME
208
+ CREATE TABLE stsresfhircombo (
209
+ PID UUID PRIMARY KEY,
210
+ PARTITION_ID INTEGER,
211
+ PARTITION_DATE INTEGER,
212
+ SP_NAME TEXT NOT NULL,
213
+ SP_PARAM_TYPE TEXT NOT NULL,
214
+ RES_ID TEXT NOT NULL,
215
+ RES_TYPE TEXT NOT NULL,
216
+ UPDATED BIGINT NOT NULL,
217
+ SP_MISSING BOOLEAN NOT NULL,
218
+ HASH_IDENTITY BIGINT NOT NULL,
219
+ IDX_STRING TEXT,
220
+ HASH_COMPLETE BIGINT,
221
+ UNIQUE (RES_ID, SP_NAME, IDX_STRING)
222
+ );
223
+
224
+ CREATE INDEX idx_stsresfhircombo_hash_identity ON stsresfhircombo (HASH_IDENTITY);
225
+ CREATE INDEX idx_stsresfhircombo_hash_complete ON stsresfhircombo (HASH_COMPLETE);
226
+
227
+ ---- STS Generic Resource/Entity Tables and Procs ---------------------------------------------------------------
107
228
 
108
229
  -- SEQUENCE: public.stsentity_oid_seq
109
230
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nsshunt/stsdatamanagement",
3
- "version": "1.18.127",
3
+ "version": "1.18.129",
4
4
  "description": "STS Data Management Modules, Utilities and Services",
5
5
  "main": "./dist/dbaccess.js",
6
6
  "types": "./types/dbaccess.d.ts",
@@ -12,38 +12,38 @@
12
12
  "README.md"
13
13
  ],
14
14
  "dependencies": {
15
- "@aws-sdk/client-dynamodb": "^3.830.0",
16
- "@aws-sdk/lib-dynamodb": "^3.830.0",
15
+ "@aws-sdk/client-dynamodb": "^3.857.0",
16
+ "@aws-sdk/lib-dynamodb": "^3.857.0",
17
17
  "@nsshunt/stsconfig": "^1.27.24",
18
18
  "@nsshunt/stsutils": "^1.19.35",
19
- "axios": "^1.10.0",
19
+ "axios": "^1.11.0",
20
20
  "chalk": "^4.1.2",
21
21
  "cli-progress": "^3.12.0",
22
22
  "http-status-codes": "^2.3.0",
23
23
  "ioredis": "^5.6.1",
24
- "pg": "^8.16.2",
24
+ "pg": "^8.16.3",
25
25
  "pg-copy-streams": "^7.0.0",
26
26
  "prompts": "^2.4.2",
27
27
  "redis": "^4.7.0",
28
- "systeminformation": "^5.27.6",
28
+ "systeminformation": "^5.27.7",
29
29
  "tiny-emitter": "^2.1.0",
30
30
  "uuid": "^11.1.0",
31
31
  "winston": "^3.17.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/cli-progress": "^3.11.6",
35
- "@types/node": "^24.0.3",
36
- "@types/pg": "^8.15.4",
35
+ "@types/node": "^24.1.0",
36
+ "@types/pg": "^8.15.5",
37
37
  "@types/pg-copy-streams": "^1.2.5",
38
38
  "@types/prompts": "^2.4.9",
39
39
  "@types/uuid": "^10.0.0",
40
- "@typescript-eslint/eslint-plugin": "^8.34.1",
41
- "@typescript-eslint/parser": "^8.34.1",
42
- "eslint": "^9.29.0",
43
- "globals": "^16.2.0",
40
+ "@typescript-eslint/eslint-plugin": "^8.38.0",
41
+ "@typescript-eslint/parser": "^8.38.0",
42
+ "eslint": "^9.32.0",
43
+ "globals": "^16.3.0",
44
44
  "rollup-plugin-polyfill-node": "^0.13.0",
45
45
  "rollup-plugin-visualizer": "^6.0.3",
46
- "testcontainers": "^11.0.3",
46
+ "testcontainers": "^11.4.0",
47
47
  "typescript": "^5.8.3",
48
48
  "vite": "^6.3.5",
49
49
  "vitest": "^3.2.4"