@powersync/service-errors 0.3.0 → 0.3.1
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/dist/codes.d.ts +26 -5
- package/dist/codes.js +27 -6
- package/dist/codes.js.map +1 -1
- package/package.json +1 -1
package/dist/codes.d.ts
CHANGED
|
@@ -129,6 +129,17 @@ export declare enum ErrorCode {
|
|
|
129
129
|
* Either upgrade the Postgres server to version 14 or above, or use a different Postgres server for sync bucket storage.
|
|
130
130
|
*/
|
|
131
131
|
PSYNC_S1144 = "PSYNC_S1144",
|
|
132
|
+
/**
|
|
133
|
+
* Table has RLS enabled, but the replication role does not have the BYPASSRLS attribute.
|
|
134
|
+
*
|
|
135
|
+
* We recommend using a dedicated replication role with the BYPASSRLS attribute for replication:
|
|
136
|
+
*
|
|
137
|
+
* ALTER ROLE powersync_role BYPASSRLS
|
|
138
|
+
*
|
|
139
|
+
* An alternative is to create explicit policies for the replication role. If you have done that,
|
|
140
|
+
* you may ignore this warning.
|
|
141
|
+
*/
|
|
142
|
+
PSYNC_S1145 = "PSYNC_S1145",
|
|
132
143
|
/**
|
|
133
144
|
* Generic MongoServerError.
|
|
134
145
|
*/
|
|
@@ -140,7 +151,7 @@ export declare enum ErrorCode {
|
|
|
140
151
|
/**
|
|
141
152
|
* MongoDB internal TLS error.
|
|
142
153
|
*
|
|
143
|
-
* If connection to a shared cluster on MongoDB Atlas, this could be an IP
|
|
154
|
+
* If connection to a shared cluster on MongoDB Atlas, this could be an IP Access List issue.
|
|
144
155
|
* Check that the service IP is allowed to connect to the cluster.
|
|
145
156
|
*/
|
|
146
157
|
PSYNC_S1303 = "PSYNC_S1303",
|
|
@@ -165,7 +176,7 @@ export declare enum ErrorCode {
|
|
|
165
176
|
/**
|
|
166
177
|
* MongoDB authorization error.
|
|
167
178
|
*
|
|
168
|
-
* Check that the user has the required
|
|
179
|
+
* Check that the user has the required privileges.
|
|
169
180
|
*/
|
|
170
181
|
PSYNC_S1307 = "PSYNC_S1307",
|
|
171
182
|
/**
|
|
@@ -173,7 +184,7 @@ export declare enum ErrorCode {
|
|
|
173
184
|
*/
|
|
174
185
|
PSYNC_S1341 = "PSYNC_S1341",
|
|
175
186
|
/**
|
|
176
|
-
* Standalone MongoDB instances are not supported - use a
|
|
187
|
+
* Standalone MongoDB instances are not supported - use a replica-set.
|
|
177
188
|
*/
|
|
178
189
|
PSYNC_S1342 = "PSYNC_S1342",
|
|
179
190
|
/**
|
|
@@ -213,6 +224,12 @@ export declare enum ErrorCode {
|
|
|
213
224
|
* See the error cause for more details.
|
|
214
225
|
*/
|
|
215
226
|
PSYNC_S1346 = "PSYNC_S1346",
|
|
227
|
+
/**
|
|
228
|
+
* Timeout while getting a resume token for an initial snapshot.
|
|
229
|
+
*
|
|
230
|
+
* This may happen if there is very high load on the source database.
|
|
231
|
+
*/
|
|
232
|
+
PSYNC_S1347 = "PSYNC_S1347",
|
|
216
233
|
/**
|
|
217
234
|
* Max transaction tries exceeded.
|
|
218
235
|
*/
|
|
@@ -268,7 +285,7 @@ export declare enum ErrorCode {
|
|
|
268
285
|
/**
|
|
269
286
|
* No token provided. An auth token is required for every request.
|
|
270
287
|
*
|
|
271
|
-
* The
|
|
288
|
+
* The Authorization header must start with "Token" or "Bearer", followed by the JWT.
|
|
272
289
|
*/
|
|
273
290
|
PSYNC_S2106 = "PSYNC_S2106",
|
|
274
291
|
/**
|
|
@@ -284,7 +301,7 @@ export declare enum ErrorCode {
|
|
|
284
301
|
/**
|
|
285
302
|
* IPs in this range are not supported.
|
|
286
303
|
*
|
|
287
|
-
* Make sure to use a
|
|
304
|
+
* Make sure to use a publicly-accessible JWKS URI.
|
|
288
305
|
*/
|
|
289
306
|
PSYNC_S2203 = "PSYNC_S2203",
|
|
290
307
|
/**
|
|
@@ -315,6 +332,10 @@ export declare enum ErrorCode {
|
|
|
315
332
|
* Could not get clusterTime.
|
|
316
333
|
*/
|
|
317
334
|
PSYNC_S2401 = "PSYNC_S2401",
|
|
335
|
+
/**
|
|
336
|
+
* Failed to connect to the MongoDB storage database.
|
|
337
|
+
*/
|
|
338
|
+
PSYNC_S2402 = "PSYNC_S2402",
|
|
318
339
|
/**
|
|
319
340
|
* Invalid jwks_uri.
|
|
320
341
|
*/
|
package/dist/codes.js
CHANGED
|
@@ -140,6 +140,17 @@ export var ErrorCode;
|
|
|
140
140
|
* Either upgrade the Postgres server to version 14 or above, or use a different Postgres server for sync bucket storage.
|
|
141
141
|
*/
|
|
142
142
|
ErrorCode["PSYNC_S1144"] = "PSYNC_S1144";
|
|
143
|
+
/**
|
|
144
|
+
* Table has RLS enabled, but the replication role does not have the BYPASSRLS attribute.
|
|
145
|
+
*
|
|
146
|
+
* We recommend using a dedicated replication role with the BYPASSRLS attribute for replication:
|
|
147
|
+
*
|
|
148
|
+
* ALTER ROLE powersync_role BYPASSRLS
|
|
149
|
+
*
|
|
150
|
+
* An alternative is to create explicit policies for the replication role. If you have done that,
|
|
151
|
+
* you may ignore this warning.
|
|
152
|
+
*/
|
|
153
|
+
ErrorCode["PSYNC_S1145"] = "PSYNC_S1145";
|
|
143
154
|
// ## PSYNC_S12xx: MySQL replication issues
|
|
144
155
|
// ## PSYNC_S13xx: MongoDB replication issues
|
|
145
156
|
/**
|
|
@@ -153,7 +164,7 @@ export var ErrorCode;
|
|
|
153
164
|
/**
|
|
154
165
|
* MongoDB internal TLS error.
|
|
155
166
|
*
|
|
156
|
-
* If connection to a shared cluster on MongoDB Atlas, this could be an IP
|
|
167
|
+
* If connection to a shared cluster on MongoDB Atlas, this could be an IP Access List issue.
|
|
157
168
|
* Check that the service IP is allowed to connect to the cluster.
|
|
158
169
|
*/
|
|
159
170
|
ErrorCode["PSYNC_S1303"] = "PSYNC_S1303";
|
|
@@ -178,7 +189,7 @@ export var ErrorCode;
|
|
|
178
189
|
/**
|
|
179
190
|
* MongoDB authorization error.
|
|
180
191
|
*
|
|
181
|
-
* Check that the user has the required
|
|
192
|
+
* Check that the user has the required privileges.
|
|
182
193
|
*/
|
|
183
194
|
ErrorCode["PSYNC_S1307"] = "PSYNC_S1307";
|
|
184
195
|
/**
|
|
@@ -186,7 +197,7 @@ export var ErrorCode;
|
|
|
186
197
|
*/
|
|
187
198
|
ErrorCode["PSYNC_S1341"] = "PSYNC_S1341";
|
|
188
199
|
/**
|
|
189
|
-
* Standalone MongoDB instances are not supported - use a
|
|
200
|
+
* Standalone MongoDB instances are not supported - use a replica-set.
|
|
190
201
|
*/
|
|
191
202
|
ErrorCode["PSYNC_S1342"] = "PSYNC_S1342";
|
|
192
203
|
/**
|
|
@@ -226,6 +237,12 @@ export var ErrorCode;
|
|
|
226
237
|
* See the error cause for more details.
|
|
227
238
|
*/
|
|
228
239
|
ErrorCode["PSYNC_S1346"] = "PSYNC_S1346";
|
|
240
|
+
/**
|
|
241
|
+
* Timeout while getting a resume token for an initial snapshot.
|
|
242
|
+
*
|
|
243
|
+
* This may happen if there is very high load on the source database.
|
|
244
|
+
*/
|
|
245
|
+
ErrorCode["PSYNC_S1347"] = "PSYNC_S1347";
|
|
229
246
|
// ## PSYNC_S14xx: MongoDB storage replication issues
|
|
230
247
|
/**
|
|
231
248
|
* Max transaction tries exceeded.
|
|
@@ -286,7 +303,7 @@ export var ErrorCode;
|
|
|
286
303
|
/**
|
|
287
304
|
* No token provided. An auth token is required for every request.
|
|
288
305
|
*
|
|
289
|
-
* The
|
|
306
|
+
* The Authorization header must start with "Token" or "Bearer", followed by the JWT.
|
|
290
307
|
*/
|
|
291
308
|
ErrorCode["PSYNC_S2106"] = "PSYNC_S2106";
|
|
292
309
|
// ## PSYNC_S22xx: Auth integration errors
|
|
@@ -303,7 +320,7 @@ export var ErrorCode;
|
|
|
303
320
|
/**
|
|
304
321
|
* IPs in this range are not supported.
|
|
305
322
|
*
|
|
306
|
-
* Make sure to use a
|
|
323
|
+
* Make sure to use a publicly-accessible JWKS URI.
|
|
307
324
|
*/
|
|
308
325
|
ErrorCode["PSYNC_S2203"] = "PSYNC_S2203";
|
|
309
326
|
/**
|
|
@@ -336,6 +353,10 @@ export var ErrorCode;
|
|
|
336
353
|
* Could not get clusterTime.
|
|
337
354
|
*/
|
|
338
355
|
ErrorCode["PSYNC_S2401"] = "PSYNC_S2401";
|
|
356
|
+
/**
|
|
357
|
+
* Failed to connect to the MongoDB storage database.
|
|
358
|
+
*/
|
|
359
|
+
ErrorCode["PSYNC_S2402"] = "PSYNC_S2402";
|
|
339
360
|
// ## PSYNC_S23xx: Sync API errors - Postgres Storage
|
|
340
361
|
// ## PSYNC_S3xxx: Service configuration issues
|
|
341
362
|
// ## PSYNC_S31xx: Auth configuration issues
|
|
@@ -352,7 +373,7 @@ export var ErrorCode;
|
|
|
352
373
|
* Failed to validate module configuration.
|
|
353
374
|
*/
|
|
354
375
|
ErrorCode["PSYNC_S3201"] = "PSYNC_S3201";
|
|
355
|
-
// ## PSYNC_S4000:
|
|
376
|
+
// ## PSYNC_S4000: Management / Dev APIs
|
|
356
377
|
/**
|
|
357
378
|
* Internal assertion error.
|
|
358
379
|
*
|
package/dist/codes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codes.js","sourceRoot":"","sources":["../src/codes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"codes.js","sourceRoot":"","sources":["../src/codes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAN,IAAY,SAmdX;AAndD,WAAY,SAAS;IACnB,mCAAmC;IAEnC;;OAEG;IACH,wCAA2B,CAAA;IAE3B,qCAAqC;IAErC,iDAAiD;IAEjD,oCAAoC;IAEpC,+CAA+C;IAE/C,6CAA6C;IAE7C,wCAAwC;IAExC,gCAAgC;IAEhC;;;;OAIG;IACH,wCAA2B,CAAA;IAE3B;;;;;;;;OAQG;IACH,wCAA2B,CAAA;IAE3B,qCAAqC;IAErC;;;;;OAKG;IACH,wCAA2B,CAAA;IAE3B;;;;;;;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