@powersync/service-module-postgres-storage 0.0.0-dev-20250825132649 → 0.0.0-dev-20250827072023
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/CHANGELOG.md +11 -9
- package/dist/.tsbuildinfo +1 -1
- package/dist/@types/types/models/SyncRules.d.ts +2 -2
- package/dist/storage/PostgresReportStorageFactory.js +1 -1
- package/package.json +9 -9
- package/src/storage/PostgresReportStorageFactory.ts +1 -1
- package/test/src/__snapshots__/connection-report-storage.test.ts.snap +42 -77
- package/test/src/connection-report-storage.test.ts +125 -226
|
@@ -33,13 +33,13 @@ export declare const SyncRules: t.ObjectCodec<{
|
|
|
33
33
|
*
|
|
34
34
|
* This may be old if no data is incoming.
|
|
35
35
|
*/
|
|
36
|
-
last_checkpoint_ts: t.Union<t.Codec<null, null, string, t.CodecProps>, t.Codec<Date, string, string, t.CodecProps>>;
|
|
36
|
+
last_checkpoint_ts: t.Union<t.Codec<null, null, string, t.CodecProps>, t.Codec<Date, string | import("@powersync/service-sync-rules").DateTimeValue, string, t.CodecProps>>;
|
|
37
37
|
/**
|
|
38
38
|
* Last time we persisted a checkpoint or keepalive.
|
|
39
39
|
*
|
|
40
40
|
* This should stay fairly current while replicating.
|
|
41
41
|
*/
|
|
42
|
-
last_keepalive_ts: t.Union<t.Codec<null, null, string, t.CodecProps>, t.Codec<Date, string, string, t.CodecProps>>;
|
|
42
|
+
last_keepalive_ts: t.Union<t.Codec<null, null, string, t.CodecProps>, t.Codec<Date, string | import("@powersync/service-sync-rules").DateTimeValue, string, t.CodecProps>>;
|
|
43
43
|
/**
|
|
44
44
|
* If an error is stopping replication, it will be stored here.
|
|
45
45
|
*/
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@powersync/service-module-postgres-storage",
|
|
3
3
|
"repository": "https://github.com/powersync-ja/powersync-service",
|
|
4
4
|
"types": "dist/@types/index.d.ts",
|
|
5
|
-
"version": "0.0.0-dev-
|
|
5
|
+
"version": "0.0.0-dev-20250827072023",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"publishConfig": {
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
"p-defer": "^4.0.1",
|
|
29
29
|
"ts-codec": "^1.3.0",
|
|
30
30
|
"uuid": "^11.1.0",
|
|
31
|
-
"@powersync/lib-service-postgres": "0.0.0-dev-
|
|
32
|
-
"@powersync/lib-services-framework": "0.0.0-dev-
|
|
33
|
-
"@powersync/service-core": "0.0.0-dev-
|
|
34
|
-
"@powersync/service-types": "0.0.0-dev-
|
|
35
|
-
"@powersync/service-core-tests": "0.0.0-dev-
|
|
36
|
-
"@powersync/service-jpgwire": "0.0.0-dev-
|
|
37
|
-
"@powersync/service-jsonbig": "0.0.0-dev-
|
|
38
|
-
"@powersync/service-sync-rules": "0.0.0-dev-
|
|
31
|
+
"@powersync/lib-service-postgres": "0.0.0-dev-20250827072023",
|
|
32
|
+
"@powersync/lib-services-framework": "0.0.0-dev-20250827072023",
|
|
33
|
+
"@powersync/service-core": "0.0.0-dev-20250827072023",
|
|
34
|
+
"@powersync/service-types": "0.0.0-dev-20250827072023",
|
|
35
|
+
"@powersync/service-core-tests": "0.0.0-dev-20250827072023",
|
|
36
|
+
"@powersync/service-jpgwire": "0.0.0-dev-20250827072023",
|
|
37
|
+
"@powersync/service-jsonbig": "0.0.0-dev-20250827072023",
|
|
38
|
+
"@powersync/service-sync-rules": "0.0.0-dev-20250827072023"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"typescript": "^5.7.3"
|
|
@@ -55,43 +55,29 @@ exports[`Connection report storage > Should delete rows older than specified ran
|
|
|
55
55
|
}
|
|
56
56
|
`;
|
|
57
57
|
|
|
58
|
-
exports[`Connection report storage > Should
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"clients": 1,
|
|
68
|
-
"sdk": "powersync-js/1.21.1",
|
|
69
|
-
"users": 1,
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
"clients": 1,
|
|
73
|
-
"sdk": "unknown",
|
|
74
|
-
"users": 1,
|
|
75
|
-
},
|
|
76
|
-
],
|
|
77
|
-
"users": 2,
|
|
78
|
-
}
|
|
58
|
+
exports[`Connection report storage > Should update a connection event and make it disconnected 1`] = `
|
|
59
|
+
[
|
|
60
|
+
{
|
|
61
|
+
"client_id": "client_three",
|
|
62
|
+
"sdk": "powersync-js/1.21.2",
|
|
63
|
+
"user_agent": "powersync-js/1.21.0 powersync-web Firefox/141 linux",
|
|
64
|
+
"user_id": "user_three",
|
|
65
|
+
},
|
|
66
|
+
]
|
|
79
67
|
`;
|
|
80
68
|
|
|
81
|
-
exports[`Connection report storage > Should
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
"users": 1,
|
|
91
|
-
}
|
|
69
|
+
exports[`Connection report storage > Should update a connection event if its within a day 1`] = `
|
|
70
|
+
[
|
|
71
|
+
{
|
|
72
|
+
"client_id": "client_one",
|
|
73
|
+
"sdk": "powersync-dart/1.6.4",
|
|
74
|
+
"user_agent": "powersync-dart/1.6.4 Dart (flutter-web) Chrome/128 android",
|
|
75
|
+
"user_id": "user_one",
|
|
76
|
+
},
|
|
77
|
+
]
|
|
92
78
|
`;
|
|
93
79
|
|
|
94
|
-
exports[`
|
|
80
|
+
exports[`Report storage tests > Should show connection report data for user over the past day 1`] = `
|
|
95
81
|
{
|
|
96
82
|
"sdks": [
|
|
97
83
|
{
|
|
@@ -119,7 +105,7 @@ exports[`Connection report storage > Should show connection report data for user
|
|
|
119
105
|
}
|
|
120
106
|
`;
|
|
121
107
|
|
|
122
|
-
exports[`
|
|
108
|
+
exports[`Report storage tests > Should show connection report data for user over the past month 1`] = `
|
|
123
109
|
{
|
|
124
110
|
"sdks": [
|
|
125
111
|
{
|
|
@@ -167,7 +153,7 @@ exports[`Connection report storage > Should show connection report data for user
|
|
|
167
153
|
}
|
|
168
154
|
`;
|
|
169
155
|
|
|
170
|
-
exports[`
|
|
156
|
+
exports[`Report storage tests > Should show connection report data for user over the past week 1`] = `
|
|
171
157
|
{
|
|
172
158
|
"sdks": [
|
|
173
159
|
{
|
|
@@ -205,46 +191,25 @@ exports[`Connection report storage > Should show connection report data for user
|
|
|
205
191
|
}
|
|
206
192
|
`;
|
|
207
193
|
|
|
208
|
-
exports[`
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
exports[`Connection report storage > Should update a connection event if its within a day 1`] = `
|
|
231
|
-
[
|
|
232
|
-
{
|
|
233
|
-
"client_id": "client_one",
|
|
234
|
-
"sdk": "powersync-dart/1.6.4",
|
|
235
|
-
"user_agent": "powersync-dart/1.6.4 Dart (flutter-web) Chrome/128 android",
|
|
236
|
-
"user_id": "user_one",
|
|
237
|
-
},
|
|
238
|
-
]
|
|
239
|
-
`;
|
|
240
|
-
|
|
241
|
-
exports[`Connection report storage > Should update a sdk event if its within a day 1`] = `
|
|
242
|
-
[
|
|
243
|
-
{
|
|
244
|
-
"client_id": "client_one",
|
|
245
|
-
"sdk": "powersync-dart/1.6.4",
|
|
246
|
-
"user_agent": "powersync-dart/1.6.4 Dart (flutter-web) Chrome/128 android",
|
|
247
|
-
"user_id": "user_one",
|
|
248
|
-
},
|
|
249
|
-
]
|
|
194
|
+
exports[`Report storage tests > Should show currently connected users 1`] = `
|
|
195
|
+
{
|
|
196
|
+
"sdks": [
|
|
197
|
+
{
|
|
198
|
+
"clients": 1,
|
|
199
|
+
"sdk": "powersync-dart/1.6.4",
|
|
200
|
+
"users": 1,
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"clients": 1,
|
|
204
|
+
"sdk": "powersync-js/1.21.1",
|
|
205
|
+
"users": 1,
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"clients": 1,
|
|
209
|
+
"sdk": "unknown",
|
|
210
|
+
"users": 1,
|
|
211
|
+
},
|
|
212
|
+
],
|
|
213
|
+
"users": 2,
|
|
214
|
+
}
|
|
250
215
|
`;
|