astro-integration-pocketbase 2.1.4-next.1 → 2.1.4-next.3
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro-integration-pocketbase",
|
|
3
|
-
"version": "2.1.4-next.
|
|
3
|
+
"version": "2.1.4-next.3",
|
|
4
4
|
"description": "An Astro integration to support developers working with astro-loader-pocketbase.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"astro",
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@commitlint/cli": "20.1.0",
|
|
43
43
|
"@commitlint/config-conventional": "20.0.0",
|
|
44
|
-
"@types/node": "24.
|
|
45
|
-
"astro": "5.
|
|
44
|
+
"@types/node": "24.9.1",
|
|
45
|
+
"astro": "5.15.1",
|
|
46
46
|
"eventsource": "4.0.0",
|
|
47
47
|
"globals": "16.4.0",
|
|
48
48
|
"husky": "9.1.7",
|
|
49
|
-
"lint-staged": "16.2.
|
|
50
|
-
"oxlint": "1.
|
|
49
|
+
"lint-staged": "16.2.6",
|
|
50
|
+
"oxlint": "1.24.0",
|
|
51
51
|
"prettier": "3.6.2",
|
|
52
52
|
"prettier-plugin-organize-imports": "4.3.0",
|
|
53
53
|
"prettier-plugin-packagejson": "2.5.19",
|
|
@@ -35,6 +35,19 @@ export async function getSuperuserToken(
|
|
|
35
35
|
|
|
36
36
|
// If the login request was not successful, print the error message and return undefined
|
|
37
37
|
if (!loginRequest.ok) {
|
|
38
|
+
if (loginRequest.status === 429) {
|
|
39
|
+
const info =
|
|
40
|
+
"A rate limit was hit while trying to authenticate with PocketBase. Consider using an `impersonateToken` as credentials to avoid this issue.";
|
|
41
|
+
logger.info(info);
|
|
42
|
+
|
|
43
|
+
// Random wait between 3 (default rate limit interval) and 8 seconds
|
|
44
|
+
const retryAfter = Math.random() * 5 + 3;
|
|
45
|
+
// oxlint-disable-next-line promise/avoid-new
|
|
46
|
+
await new Promise((resolve) => setTimeout(resolve, retryAfter * 1000));
|
|
47
|
+
|
|
48
|
+
return getSuperuserToken(url, superuserCredentials, logger);
|
|
49
|
+
}
|
|
50
|
+
|
|
38
51
|
const reason = await loginRequest.json().then((data) => data.message);
|
|
39
52
|
const errorMessage = `The given email / password for ${url} was not correct. Astro may not have access to all resources and permissions.\nReason: ${reason}`;
|
|
40
53
|
logger.error(errorMessage);
|