@powersync/service-core 1.27.1 → 1.28.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/CHANGELOG.md +32 -0
- package/LICENSE +201 -67
- package/dist/api/RouteAPI.d.ts +6 -0
- package/dist/api/api-metrics.js +4 -0
- package/dist/api/api-metrics.js.map +1 -1
- package/dist/api/diagnostics.d.ts +5 -0
- package/dist/api/diagnostics.js +17 -2
- package/dist/api/diagnostics.js.map +1 -1
- package/dist/metrics/connection-metrics.d.ts +28 -0
- package/dist/metrics/connection-metrics.js +55 -0
- package/dist/metrics/connection-metrics.js.map +1 -0
- package/dist/metrics/metrics-index.d.ts +1 -0
- package/dist/metrics/metrics-index.js +1 -0
- package/dist/metrics/metrics-index.js.map +1 -1
- package/dist/metrics/metrics-interfaces.d.ts +7 -1
- package/dist/metrics/metrics-interfaces.js.map +1 -1
- package/dist/modules/loader.js +8 -2
- package/dist/modules/loader.js.map +1 -1
- package/dist/replication/AbstractReplicationJob.d.ts +2 -0
- package/dist/replication/AbstractReplicationJob.js +17 -1
- package/dist/replication/AbstractReplicationJob.js.map +1 -1
- package/dist/replication/AbstractReplicator.d.ts +8 -18
- package/dist/replication/AbstractReplicator.js +63 -64
- package/dist/replication/AbstractReplicator.js.map +1 -1
- package/dist/replication/ReplicationModule.js +0 -6
- package/dist/replication/ReplicationModule.js.map +1 -1
- package/dist/routes/configure-fastify.js +5 -1
- package/dist/routes/configure-fastify.js.map +1 -1
- package/dist/routes/endpoints/admin.js +24 -22
- package/dist/routes/endpoints/admin.js.map +1 -1
- package/dist/routes/endpoints/socket-route.js +19 -27
- package/dist/routes/endpoints/socket-route.js.map +1 -1
- package/dist/routes/endpoints/sync-rules.js +17 -40
- package/dist/routes/endpoints/sync-rules.js.map +1 -1
- package/dist/routes/endpoints/sync-stream.js +25 -23
- package/dist/routes/endpoints/sync-stream.js.map +1 -1
- package/dist/routes/hooks.d.ts +1 -1
- package/dist/routes/hooks.js +2 -1
- package/dist/routes/hooks.js.map +1 -1
- package/dist/routes/sync-connection.d.ts +7 -0
- package/dist/routes/sync-connection.js +34 -0
- package/dist/routes/sync-connection.js.map +1 -0
- package/dist/storage/BucketStorageFactory.d.ts +30 -22
- package/dist/storage/BucketStorageFactory.js +14 -14
- package/dist/storage/BucketStorageFactory.js.map +1 -1
- package/dist/storage/PersistedSyncConfigContent.js +2 -2
- package/dist/storage/PersistedSyncConfigContent.js.map +1 -1
- package/dist/storage/SyncRulesBucketStorage.d.ts +23 -2
- package/dist/storage/SyncRulesBucketStorage.js.map +1 -1
- package/dist/streams/BroadcastIterable.js +8 -7
- package/dist/streams/BroadcastIterable.js.map +1 -1
- package/dist/streams/LastValueSink.d.ts +2 -2
- package/dist/streams/LastValueSink.js +8 -13
- package/dist/streams/LastValueSink.js.map +1 -1
- package/dist/streams/merge.d.ts +15 -31
- package/dist/streams/merge.js +136 -152
- package/dist/streams/merge.js.map +1 -1
- package/dist/sync/BucketChecksumState.d.ts +3 -2
- package/dist/sync/BucketChecksumState.js +12 -5
- package/dist/sync/BucketChecksumState.js.map +1 -1
- package/dist/sync/sync.js +48 -38
- package/dist/sync/sync.js.map +1 -1
- package/dist/sync/util.d.ts +1 -2
- package/dist/sync/util.js +2 -5
- package/dist/sync/util.js.map +1 -1
- package/dist/system/ServiceContext.d.ts +7 -0
- package/dist/system/ServiceContext.js +3 -3
- package/dist/system/ServiceContext.js.map +1 -1
- package/dist/system/SyncConfigEngine.d.ts +135 -0
- package/dist/system/SyncConfigEngine.js +186 -0
- package/dist/system/SyncConfigEngine.js.map +1 -0
- package/dist/system/system-index.d.ts +1 -0
- package/dist/system/system-index.js +1 -0
- package/dist/system/system-index.js.map +1 -1
- package/dist/util/config/types.d.ts +4 -0
- package/package.json +8 -9
- package/src/api/RouteAPI.ts +6 -0
- package/src/api/api-metrics.ts +5 -0
- package/src/api/diagnostics.ts +22 -2
- package/src/metrics/connection-metrics.ts +75 -0
- package/src/metrics/metrics-index.ts +1 -0
- package/src/metrics/metrics-interfaces.ts +8 -1
- package/src/modules/loader.ts +16 -2
- package/src/replication/AbstractReplicationJob.ts +17 -1
- package/src/replication/AbstractReplicator.ts +83 -81
- package/src/replication/ReplicationModule.ts +0 -5
- package/src/routes/configure-fastify.ts +7 -1
- package/src/routes/endpoints/admin.ts +27 -20
- package/src/routes/endpoints/socket-route.ts +26 -38
- package/src/routes/endpoints/sync-rules.ts +22 -46
- package/src/routes/endpoints/sync-stream.ts +31 -27
- package/src/routes/hooks.ts +5 -1
- package/src/routes/sync-connection.ts +39 -0
- package/src/storage/BucketStorageFactory.ts +45 -29
- package/src/storage/PersistedSyncConfigContent.ts +2 -2
- package/src/storage/SyncRulesBucketStorage.ts +23 -2
- package/src/streams/BroadcastIterable.ts +8 -7
- package/src/streams/LastValueSink.ts +10 -16
- package/src/streams/merge.ts +149 -169
- package/src/sync/BucketChecksumState.ts +17 -5
- package/src/sync/sync.ts +71 -57
- package/src/sync/util.ts +2 -7
- package/src/system/ServiceContext.ts +8 -3
- package/src/system/SyncConfigEngine.ts +247 -0
- package/src/system/system-index.ts +1 -0
- package/src/util/config/types.ts +4 -0
- package/test/src/AbstractReplicator.test.ts +375 -45
- package/test/src/PersistedSyncConfigContent.test.ts +5 -5
- package/test/src/SyncConfigEngine.test.ts +208 -0
- package/test/src/broadcast_iterable.test.ts +59 -31
- package/test/src/config.test.ts +65 -3
- package/test/src/connection-metrics-export.test.ts +76 -0
- package/test/src/connection-metrics.test.ts +184 -0
- package/test/src/diagnostics.test.ts +3 -3
- package/test/src/last_value_sink.test.ts +34 -0
- package/test/src/merge_iterable.test.ts +304 -55
- package/test/src/module-loader.test.ts +14 -1
- package/test/src/recording-metrics.ts +36 -0
- package/test/src/routes/admin.test.ts +2 -2
- package/test/src/routes/concurrency-limit.test.ts +108 -0
- package/test/src/routes/connection-metrics.test.ts +269 -0
- package/test/src/routes/invalid-config.test.ts +184 -0
- package/test/src/routes/mocks.ts +26 -13
- package/test/src/routes/stream-disconnect.integration.test.ts +129 -0
- package/test/src/routes/stream.test.ts +200 -107
- package/test/src/routes/sync-rules.test.ts +19 -1
- package/test/src/source_table_config.test.ts +7 -7
- package/test/src/sync/BucketChecksumState.test.ts +10 -10
- package/test/src/sync/stream_response.test.ts +389 -0
- package/test/src/sync/util.test.ts +14 -3
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @powersync/service-core
|
|
2
2
|
|
|
3
|
+
## 1.28.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- ebba2a3: Restructure replication in MongoDB V4 storage to avoid orphaned objects on S3.
|
|
8
|
+
- 85c5e12: Add `powersync_sync_connections_total` to track sync stream close outcomes and setup rejections across HTTP and RSocket.
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- 17a026d: Improve the error raised when loading an unrecognized connection or storage type: the message now lists the supported types, and is raised as a `ServiceError` with code `PSYNC_S3201` instead of a plain `Error`.
|
|
13
|
+
- 574ddbd: Change license from FSL to Apache-2.0
|
|
14
|
+
- 071507a: Reject sync configs with fatal parsing or source-capability errors before they enter replication. A context-owned `SyncConfigEngine` shares one source-aware parsed config and validation result between replication startup, diagnostics, and manual reprocess guards. The engine loads filesystem, Base64, or inline input on first use and caches the result.
|
|
15
|
+
|
|
16
|
+
With `exit_on_error: false`, a rejected startup submission stops pending processing work while preserving active replication, including when active and processing configs share a replication stream. This also stops invalid pending configs persisted by older services. Rejected content is exposed through diagnostics `deploying_sync_rules`. With `exit_on_error: true`, validation failures stop startup before storage changes. Warnings are advisory.
|
|
17
|
+
|
|
18
|
+
API-managed deployments share validation and reject fatal submissions before storage changes. Rejected API requests do not cancel accepted pending work or create a local diagnostic overlay.
|
|
19
|
+
|
|
20
|
+
- b64957d: Improve propagation of abort errors and fix some unhandled rejections.
|
|
21
|
+
- Updated dependencies [7cf585d]
|
|
22
|
+
- Updated dependencies [574ddbd]
|
|
23
|
+
- Updated dependencies [070ef34]
|
|
24
|
+
- Updated dependencies [85c5e12]
|
|
25
|
+
- Updated dependencies [d951049]
|
|
26
|
+
- Updated dependencies [a8d5c22]
|
|
27
|
+
- @powersync/service-sync-rules@0.45.0
|
|
28
|
+
- @powersync/service-rsocket-router@0.3.0
|
|
29
|
+
- @powersync/lib-services-framework@0.10.5
|
|
30
|
+
- @powersync/service-jsonbig@0.17.14
|
|
31
|
+
- @powersync/service-types@0.21.0
|
|
32
|
+
|
|
33
|
+
## 1.27.2
|
|
34
|
+
|
|
3
35
|
## 1.27.1
|
|
4
36
|
|
|
5
37
|
### Patch Changes
|
package/LICENSE
CHANGED
|
@@ -1,67 +1,201 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/dist/api/RouteAPI.d.ts
CHANGED
|
@@ -37,6 +37,12 @@ export interface RouteAPI {
|
|
|
37
37
|
/**
|
|
38
38
|
* Checks whether the source supports the capabilities required by this sync config.
|
|
39
39
|
* Must not modify the source. Return advisory warnings and fatal validation diagnostics.
|
|
40
|
+
* May receive a partial config with fatal parser diagnostics; report capability issues independently.
|
|
41
|
+
* SyncConfigEngine currently caches admission results for the configured snapshot until restart,
|
|
42
|
+
* including fatal diagnostics created from unexpected validation exceptions. Temporary failures
|
|
43
|
+
* can therefore leave diagnostics reporting a stale rejection. Retrying failed validation attempts
|
|
44
|
+
* from diagnostics without reloading the configured YAML is a future improvement.
|
|
45
|
+
* Check configured executor capabilities here; live connectivity and table metadata checks are separate.
|
|
40
46
|
* An empty array means no issues; throw only for unexpected failures.
|
|
41
47
|
*/
|
|
42
48
|
validateSourceCapabilities?(syncConfig: SyncConfig): Promise<types.ValidationDiagnostic[]>;
|
package/dist/api/api-metrics.js
CHANGED
|
@@ -22,6 +22,10 @@ export function createCoreAPIMetrics(engine) {
|
|
|
22
22
|
name: APIMetric.CONCURRENT_CONNECTIONS,
|
|
23
23
|
description: 'Number of concurrent sync connections'
|
|
24
24
|
});
|
|
25
|
+
engine.createCounter({
|
|
26
|
+
name: APIMetric.SYNC_CONNECTIONS,
|
|
27
|
+
description: 'Sync stream closes and setup rejections, by outcome, close_reason, error_code and transport'
|
|
28
|
+
});
|
|
25
29
|
}
|
|
26
30
|
/**
|
|
27
31
|
* Initialise the core API metrics. This should be called after the metrics have been created.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-metrics.js","sourceRoot":"","sources":["../../src/api/api-metrics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAGrD;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAqB;IACxD,MAAM,CAAC,aAAa,CAAC;QACnB,IAAI,EAAE,SAAS,CAAC,iBAAiB;QACjC,WAAW,EAAE,kCAAkC;QAC/C,IAAI,EAAE,OAAO;KACd,CAAC,CAAC;IAEH,MAAM,CAAC,aAAa,CAAC;QACnB,IAAI,EAAE,SAAS,CAAC,eAAe;QAC/B,WAAW,EAAE,+DAA+D;QAC5E,IAAI,EAAE,OAAO;KACd,CAAC,CAAC;IAEH,MAAM,CAAC,aAAa,CAAC;QACnB,IAAI,EAAE,SAAS,CAAC,iBAAiB;QACjC,WAAW,EAAE,6BAA6B;KAC3C,CAAC,CAAC;IAEH,MAAM,CAAC,mBAAmB,CAAC;QACzB,IAAI,EAAE,SAAS,CAAC,sBAAsB;QACtC,WAAW,EAAE,uCAAuC;KACrD,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,MAAqB;IAC5D,MAAM,sBAAsB,GAAG,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAC;IAEzF,yFAAyF;IACzF,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAChC,CAAC"}
|
|
1
|
+
{"version":3,"file":"api-metrics.js","sourceRoot":"","sources":["../../src/api/api-metrics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAGrD;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAqB;IACxD,MAAM,CAAC,aAAa,CAAC;QACnB,IAAI,EAAE,SAAS,CAAC,iBAAiB;QACjC,WAAW,EAAE,kCAAkC;QAC/C,IAAI,EAAE,OAAO;KACd,CAAC,CAAC;IAEH,MAAM,CAAC,aAAa,CAAC;QACnB,IAAI,EAAE,SAAS,CAAC,eAAe;QAC/B,WAAW,EAAE,+DAA+D;QAC5E,IAAI,EAAE,OAAO;KACd,CAAC,CAAC;IAEH,MAAM,CAAC,aAAa,CAAC;QACnB,IAAI,EAAE,SAAS,CAAC,iBAAiB;QACjC,WAAW,EAAE,6BAA6B;KAC3C,CAAC,CAAC;IAEH,MAAM,CAAC,mBAAmB,CAAC;QACzB,IAAI,EAAE,SAAS,CAAC,sBAAsB;QACtC,WAAW,EAAE,uCAAuC;KACrD,CAAC,CAAC;IAEH,MAAM,CAAC,aAAa,CAAC;QACnB,IAAI,EAAE,SAAS,CAAC,gBAAgB;QAChC,WAAW,EAAE,6FAA6F;KAC3G,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,MAAqB;IAC5D,MAAM,sBAAsB,GAAG,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAC;IAEzF,yFAAyF;IACzF,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SyncRulesStatus } from '@powersync/service-types';
|
|
2
2
|
import * as storage from '../storage/storage-index.js';
|
|
3
|
+
import { ConfiguredSyncConfigResult } from '../system/SyncConfigEngine.js';
|
|
3
4
|
import { RouteAPI } from './RouteAPI.js';
|
|
4
5
|
export interface DiagnosticsOptions {
|
|
5
6
|
/**
|
|
@@ -22,6 +23,10 @@ export interface DiagnosticsOptions {
|
|
|
22
23
|
check_connection: boolean;
|
|
23
24
|
}
|
|
24
25
|
export declare const DEFAULT_DATASOURCE_ID = "default";
|
|
26
|
+
/**
|
|
27
|
+
* Project the cached local admission result without creating a persisted deployment.
|
|
28
|
+
*/
|
|
29
|
+
export declare function getInvalidLocalSyncConfigStatus(result: ConfiguredSyncConfigResult, includeContent: boolean, versionLabel?: string): SyncRulesStatus | undefined;
|
|
25
30
|
export declare function getSyncRulesStatus(apiHandler: RouteAPI, syncConfig: storage.PersistedSyncConfigContent | null, options: DiagnosticsOptions,
|
|
26
31
|
/**
|
|
27
32
|
* Storage instance for the replication stream of this config.
|
package/dist/api/diagnostics.js
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import { logger, ServiceAssertionError } from '@powersync/lib-services-framework';
|
|
2
|
-
import { DEFAULT_TAG,
|
|
2
|
+
import { DEFAULT_TAG, SyncConfigErrors } from '@powersync/service-sync-rules';
|
|
3
|
+
import { SyncConfigResultStatus } from '../system/SyncConfigEngine.js';
|
|
3
4
|
import { syncConfigYamlErrorToReplicationError } from '../util/errors.js';
|
|
4
5
|
export const DEFAULT_DATASOURCE_ID = 'default';
|
|
6
|
+
/**
|
|
7
|
+
* Project the cached local admission result without creating a persisted deployment.
|
|
8
|
+
*/
|
|
9
|
+
export function getInvalidLocalSyncConfigStatus(result, includeContent, versionLabel) {
|
|
10
|
+
if (result.status !== SyncConfigResultStatus.REJECTED) {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
version_label: versionLabel,
|
|
15
|
+
content: includeContent ? result.content : undefined,
|
|
16
|
+
connections: [],
|
|
17
|
+
errors: result.diagnostics
|
|
18
|
+
};
|
|
19
|
+
}
|
|
5
20
|
export async function getSyncRulesStatus(apiHandler, syncConfig, options,
|
|
6
21
|
/**
|
|
7
22
|
* Storage instance for the replication stream of this config.
|
|
@@ -34,7 +49,7 @@ systemStorage) {
|
|
|
34
49
|
content: include_content ? syncConfig.sync_rules_content : undefined,
|
|
35
50
|
connections: [],
|
|
36
51
|
// Report each sync config error separately, retaining its source location.
|
|
37
|
-
errors: e instanceof
|
|
52
|
+
errors: e instanceof SyncConfigErrors
|
|
38
53
|
? e.errors.map((error) => syncConfigYamlErrorToReplicationError(error, now))
|
|
39
54
|
: [{ level: 'fatal', message: e.message, ts: now }]
|
|
40
55
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../../src/api/diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../../src/api/diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,EAAE,WAAW,EAAkB,gBAAgB,EAAwB,MAAM,+BAA+B,CAAC;AAIpH,OAAO,EAA8B,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACnG,OAAO,EAAE,qCAAqC,EAAE,MAAM,mBAAmB,CAAC;AA2B1E,MAAM,CAAC,MAAM,qBAAqB,GAAG,SAAS,CAAC;AAE/C;;GAEG;AACH,MAAM,UAAU,+BAA+B,CAC7C,MAAkC,EAClC,cAAuB,EACvB,YAAqB;IAErB,IAAI,MAAM,CAAC,MAAM,KAAK,sBAAsB,CAAC,QAAQ,EAAE,CAAC;QACtD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO;QACL,aAAa,EAAE,YAAY;QAC3B,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;QACpD,WAAW,EAAE,EAAE;QACf,MAAM,EAAE,MAAM,CAAC,WAAW;KAC3B,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,UAAoB,EACpB,UAAqD,EACrD,OAA2B;AAC3B;;;;;GAKG;AACH,aAA8C;IAE9C,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;QACvB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,eAAe,GAAG,OAAO,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vC,aAAa,EAAE,eAAe,EAAE,aAAa;gBAC7C,sBAAsB,EAAE,eAAe,EAAE,sBAAsB;gBAC/D,MAAM,EAAE,WAAW;aACpB;SACF;QACD,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC;KAC5B,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,MAA0B;IAC7C,IAAI,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC7B,IAAI,MAAM,GAAuB,EAAE,CAAC;IACpC,KAAK,IAAI,KAAK,IAAI,MAAM,EAAE,CAAC;QACzB,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAClC,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YAClB,SAAS;QACX,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACd,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { MetricsEngine } from './MetricsEngine.js';
|
|
2
|
+
export declare enum SyncCloseReason {
|
|
3
|
+
/** Routine client disconnect/reconnect. */
|
|
4
|
+
ClientClosed = "client_closed",
|
|
5
|
+
/** Server-side close: auth expiry or switch to a new sync config. */
|
|
6
|
+
ServiceClosed = "service_closed",
|
|
7
|
+
ProcessShutdown = "process_shutdown",
|
|
8
|
+
StreamError = "stream_error",
|
|
9
|
+
ServiceUnavailable = "service_unavailable",
|
|
10
|
+
NoSyncConfig = "no_sync_config",
|
|
11
|
+
StorageError = "storage_error",
|
|
12
|
+
SyncConfigError = "sync_config_error",
|
|
13
|
+
ConcurrencyLimit = "concurrency_limit",
|
|
14
|
+
Unknown = "unknown"
|
|
15
|
+
}
|
|
16
|
+
export declare enum SyncTransport {
|
|
17
|
+
HttpStream = "http_stream",
|
|
18
|
+
RSocket = "rsocket"
|
|
19
|
+
}
|
|
20
|
+
/** Wording used by existing log-based dashboards for the `close_reason` field. */
|
|
21
|
+
export declare function syncConnectionCloseReasonLogText(closeReason?: SyncCloseReason): string;
|
|
22
|
+
export interface SyncConnectionMetric {
|
|
23
|
+
transport: SyncTransport;
|
|
24
|
+
closeReason: SyncCloseReason;
|
|
25
|
+
/** The original failure, before any transport-specific wrapping. */
|
|
26
|
+
error?: unknown;
|
|
27
|
+
}
|
|
28
|
+
export declare function recordSyncConnection(engine: MetricsEngine, metric: SyncConnectionMetric): void;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ErrorCode, errors } from '@powersync/lib-services-framework';
|
|
2
|
+
import { APIMetric } from '@powersync/service-types';
|
|
3
|
+
export var SyncCloseReason;
|
|
4
|
+
(function (SyncCloseReason) {
|
|
5
|
+
/** Routine client disconnect/reconnect. */
|
|
6
|
+
SyncCloseReason["ClientClosed"] = "client_closed";
|
|
7
|
+
/** Server-side close: auth expiry or switch to a new sync config. */
|
|
8
|
+
SyncCloseReason["ServiceClosed"] = "service_closed";
|
|
9
|
+
SyncCloseReason["ProcessShutdown"] = "process_shutdown";
|
|
10
|
+
SyncCloseReason["StreamError"] = "stream_error";
|
|
11
|
+
SyncCloseReason["ServiceUnavailable"] = "service_unavailable";
|
|
12
|
+
SyncCloseReason["NoSyncConfig"] = "no_sync_config";
|
|
13
|
+
SyncCloseReason["StorageError"] = "storage_error";
|
|
14
|
+
SyncCloseReason["SyncConfigError"] = "sync_config_error";
|
|
15
|
+
SyncCloseReason["ConcurrencyLimit"] = "concurrency_limit";
|
|
16
|
+
SyncCloseReason["Unknown"] = "unknown";
|
|
17
|
+
})(SyncCloseReason || (SyncCloseReason = {}));
|
|
18
|
+
export var SyncTransport;
|
|
19
|
+
(function (SyncTransport) {
|
|
20
|
+
SyncTransport["HttpStream"] = "http_stream";
|
|
21
|
+
SyncTransport["RSocket"] = "rsocket";
|
|
22
|
+
})(SyncTransport || (SyncTransport = {}));
|
|
23
|
+
const SYNC_CONNECTION_REASON_POLICY = {
|
|
24
|
+
[SyncCloseReason.ClientClosed]: { outcome: 'ok', logText: 'client closing stream' },
|
|
25
|
+
[SyncCloseReason.ServiceClosed]: { outcome: 'ok', logText: 'service closing stream' },
|
|
26
|
+
[SyncCloseReason.ProcessShutdown]: { outcome: 'ok', logText: 'process shutdown' },
|
|
27
|
+
[SyncCloseReason.StreamError]: { outcome: 'error', logText: 'stream error' },
|
|
28
|
+
[SyncCloseReason.ServiceUnavailable]: { outcome: 'rejected', logText: 'service unavailable' },
|
|
29
|
+
[SyncCloseReason.NoSyncConfig]: { outcome: 'rejected', logText: 'no sync config' },
|
|
30
|
+
[SyncCloseReason.StorageError]: { outcome: 'rejected', logText: 'storage error' },
|
|
31
|
+
[SyncCloseReason.SyncConfigError]: { outcome: 'rejected', logText: 'sync config error' },
|
|
32
|
+
[SyncCloseReason.ConcurrencyLimit]: { outcome: 'rejected', logText: 'concurrency limit' },
|
|
33
|
+
// Nothing was thrown or reported, so the stream ended cleanly without a specific reason.
|
|
34
|
+
[SyncCloseReason.Unknown]: { outcome: 'ok', logText: 'unknown' }
|
|
35
|
+
};
|
|
36
|
+
/** Wording used by existing log-based dashboards for the `close_reason` field. */
|
|
37
|
+
export function syncConnectionCloseReasonLogText(closeReason) {
|
|
38
|
+
return SYNC_CONNECTION_REASON_POLICY[closeReason ?? SyncCloseReason.Unknown].logText;
|
|
39
|
+
}
|
|
40
|
+
const ERROR_CODES = new Set(Object.values(ErrorCode));
|
|
41
|
+
export function recordSyncConnection(engine, metric) {
|
|
42
|
+
const { outcome } = SYNC_CONNECTION_REASON_POLICY[metric.closeReason];
|
|
43
|
+
const attributes = {
|
|
44
|
+
outcome,
|
|
45
|
+
close_reason: metric.closeReason,
|
|
46
|
+
transport: metric.transport
|
|
47
|
+
};
|
|
48
|
+
if (outcome !== 'ok') {
|
|
49
|
+
const code = errors.ServiceError.isServiceError(metric.error) ? metric.error.errorData?.code : undefined;
|
|
50
|
+
const errorCode = typeof code == 'string' && ERROR_CODES.has(code) ? code : 'other';
|
|
51
|
+
attributes.error_code = errorCode;
|
|
52
|
+
}
|
|
53
|
+
engine.getCounter(APIMetric.SYNC_CONNECTIONS).add(1, attributes);
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=connection-metrics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection-metrics.js","sourceRoot":"","sources":["../../src/metrics/connection-metrics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAIrD,MAAM,CAAN,IAAY,eAaX;AAbD,WAAY,eAAe;IACzB,2CAA2C;IAC3C,iDAA8B,CAAA;IAC9B,qEAAqE;IACrE,mDAAgC,CAAA;IAChC,uDAAoC,CAAA;IACpC,+CAA4B,CAAA;IAC5B,6DAA0C,CAAA;IAC1C,kDAA+B,CAAA;IAC/B,iDAA8B,CAAA;IAC9B,wDAAqC,CAAA;IACrC,yDAAsC,CAAA;IACtC,sCAAmB,CAAA;AACrB,CAAC,EAbW,eAAe,KAAf,eAAe,QAa1B;AAED,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,2CAA0B,CAAA;IAC1B,oCAAmB,CAAA;AACrB,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB;AAOD,MAAM,6BAA6B,GAAG;IACpC,CAAC,eAAe,CAAC,YAAY,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,uBAAuB,EAAE;IACnF,CAAC,eAAe,CAAC,aAAa,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,wBAAwB,EAAE;IACrF,CAAC,eAAe,CAAC,eAAe,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,kBAAkB,EAAE;IACjF,CAAC,eAAe,CAAC,WAAW,CAAC,E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AAI,GAAG,MAAM,CAAC,YAAY,CAAC,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;QACzG,MAAM,SAAS,GAAG,OAAO,IAAI,IAAI,QAAQ,IAAI,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC;QACpF,UAAU,CAAC,UAAU,GAAG,SAAS,CAAC;IACpC,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;AACnE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metrics-index.js","sourceRoot":"","sources":["../../src/metrics/metrics-index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iDAAiD,CAAC;AAChE,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"metrics-index.js","sourceRoot":"","sources":["../../src/metrics/metrics-index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iDAAiD,CAAC;AAChE,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bounded-cardinality attributes (labels) attached to a metric data point.
|
|
3
|
+
* Only use low-cardinality enum-like values here — never user/client/request identifiers.
|
|
4
|
+
*/
|
|
5
|
+
export type MetricAttributes = Record<string, string | number | boolean>;
|
|
1
6
|
export interface Counter {
|
|
2
7
|
/**
|
|
3
8
|
* Increment the counter by the given value. Only positive numbers are valid.
|
|
4
9
|
* @param value
|
|
10
|
+
* @param attributes optional low-cardinality labels for this increment
|
|
5
11
|
*/
|
|
6
|
-
add(value: number): void;
|
|
12
|
+
add(value: number, attributes?: MetricAttributes): void;
|
|
7
13
|
}
|
|
8
14
|
export interface UpDownCounter {
|
|
9
15
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metrics-interfaces.js","sourceRoot":"","sources":["../../src/metrics/metrics-interfaces.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"metrics-interfaces.js","sourceRoot":"","sources":["../../src/metrics/metrics-interfaces.ts"],"names":[],"mappings":"AAoCA,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,8BAAiB,CAAA;AACnB,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB"}
|
package/dist/modules/loader.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { ErrorCode, ServiceError } from '@powersync/lib-services-framework';
|
|
2
|
+
function quoteList(values) {
|
|
3
|
+
return values.map((value) => `"${value}"`).join(', ');
|
|
4
|
+
}
|
|
1
5
|
/**
|
|
2
6
|
* Utility function to dynamically load and instantiate modules.
|
|
3
7
|
*/
|
|
@@ -18,13 +22,15 @@ export async function loadModules(config, loaders) {
|
|
|
18
22
|
});
|
|
19
23
|
// Fail if any connection types are not found.
|
|
20
24
|
if (missingConnectionModules.length > 0) {
|
|
21
|
-
|
|
25
|
+
const validConnections = Object.keys(loaders.connection);
|
|
26
|
+
throw new ServiceError(ErrorCode.PSYNC_S3201, `Invalid connection types: ${quoteList(missingConnectionModules)}${validConnections.length > 0 ? `. Supported types: ${quoteList(validConnections)}.` : ''}`);
|
|
22
27
|
}
|
|
23
28
|
if (loaders.storage[config.storage.type] !== undefined) {
|
|
24
29
|
modulePromises.push(loaders.storage[config.storage.type]());
|
|
25
30
|
}
|
|
26
31
|
else {
|
|
27
|
-
|
|
32
|
+
const validStorage = Object.keys(loaders.storage);
|
|
33
|
+
throw new ServiceError(ErrorCode.PSYNC_S3201, `Invalid storage type: "${config.storage.type}"${validStorage.length > 0 ? `. Supported types: ${quoteList(validStorage)}.` : ''}`);
|
|
28
34
|
}
|
|
29
35
|
// 2. Dynamically import and instantiate module classes and resolve all promises
|
|
30
36
|
// raising errors if any modules could not be imported.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../src/modules/loader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../src/modules/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAa5E,SAAS,SAAS,CAAC,MAAgB;IACjC,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACxD,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,MAA+B,EAAE,OAAsB;IACvF,MAAM,mBAAmB,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACzG,MAAM,wBAAwB,GAAa,EAAE,CAAC;IAC9C,MAAM,cAAc,GAA8B,EAAE,CAAC;IAErD,8EAA8E;IAC9E,4BAA4B;IAC5B,mBAAmB,CAAC,OAAO,CAAC,CAAC,cAAc,EAAE,EAAE;QAC7C,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;QACzD,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;YAChC,cAAc,CAAC,IAAI,CAAC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 @@ export declare abstract class AbstractReplicationJob {
|
|
|
33
33
|
get storage(): import("../index.js").SyncRulesBucketStorage;
|
|
34
34
|
protected get lock(): import("../index.js").ReplicationLock;
|
|
35
35
|
protected get rateLimiter(): ErrorRateLimiter;
|
|
36
|
+
/** Log expected restarts without reporting them as replication failures. */
|
|
37
|
+
protected shouldReportReplicationError(error: unknown): boolean;
|
|
36
38
|
get isStopped(): boolean;
|
|
37
39
|
/**
|
|
38
40
|
* Get replication lag for this job in ms.
|