@jant/core 0.3.28 → 0.3.30
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/bin/reset-password.js +22 -0
- package/dist/index.js +10 -7
- package/package.json +5 -1
- package/src/lib/media-helpers.ts +7 -1
- package/src/lib/view.ts +3 -2
- package/src/routes/api/posts.ts +3 -2
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { randomBytes } from "crypto";
|
|
4
|
+
import { execSync } from "child_process";
|
|
5
|
+
|
|
6
|
+
const isRemote = process.argv.includes("--remote");
|
|
7
|
+
const flag = isRemote ? "--remote" : "--local";
|
|
8
|
+
|
|
9
|
+
const token = randomBytes(32).toString("hex");
|
|
10
|
+
const expiry = Math.floor(Date.now() / 1000) + 15 * 60; // 15 minutes
|
|
11
|
+
const value = `${token}:${expiry}`;
|
|
12
|
+
const timestamp = Math.floor(Date.now() / 1000);
|
|
13
|
+
|
|
14
|
+
const sql = `INSERT OR REPLACE INTO settings (key, value, updated_at) VALUES ('PASSWORD_RESET_TOKEN', '${value}', ${timestamp})`;
|
|
15
|
+
|
|
16
|
+
execSync(`npx wrangler d1 execute DB ${flag} --command "${sql}"`, {
|
|
17
|
+
stdio: "inherit",
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
console.log("");
|
|
21
|
+
console.log("Password reset token generated (expires in 15 minutes).");
|
|
22
|
+
console.log(`Visit: /reset?token=${token}`);
|
package/dist/index.js
CHANGED
|
@@ -4692,7 +4692,7 @@ const I18nProvider = ({ c, children })=>{
|
|
|
4692
4692
|
}
|
|
4693
4693
|
|
|
4694
4694
|
const IS_VITE_DEV = typeof __JANT_DEV__ !== "undefined" && __JANT_DEV__ === true;
|
|
4695
|
-
const CORE_VERSION = "0.3.
|
|
4695
|
+
const CORE_VERSION = "0.3.30";
|
|
4696
4696
|
|
|
4697
4697
|
const BaseLayout = ({ title, description, lang, c, toast, faviconUrl, faviconVersion, noindex, isAuthenticated = false, children })=>{
|
|
4698
4698
|
// Read lang from Hono context if available, otherwise use prop or default
|
|
@@ -6435,10 +6435,11 @@ const sqid = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
|
6435
6435
|
const publicUrl = getPublicUrlForProvider(media.provider, ctx.r2PublicUrl, ctx.s3PublicUrl);
|
|
6436
6436
|
const url = getMediaUrl(media.storageKey, publicUrl);
|
|
6437
6437
|
const thumbnailUrl = getImageUrl(url, ctx.imageTransformUrl, {
|
|
6438
|
-
width:
|
|
6438
|
+
width: 1200,
|
|
6439
|
+
height: 768,
|
|
6439
6440
|
quality: 80,
|
|
6440
6441
|
format: "auto",
|
|
6441
|
-
fit: "
|
|
6442
|
+
fit: "scale-down"
|
|
6442
6443
|
});
|
|
6443
6444
|
return {
|
|
6444
6445
|
id: media.id,
|
|
@@ -7231,10 +7232,11 @@ const SiteLayout = ({ siteName, siteDescription, links, currentPath, isAuthentic
|
|
|
7231
7232
|
id: m.id,
|
|
7232
7233
|
url: getMediaUrl(m.storageKey, publicUrl),
|
|
7233
7234
|
previewUrl: getImageUrl(getMediaUrl(m.storageKey, publicUrl), imageTransformUrl, {
|
|
7234
|
-
width:
|
|
7235
|
+
width: 1200,
|
|
7236
|
+
height: 768,
|
|
7235
7237
|
quality: 80,
|
|
7236
7238
|
format: "auto",
|
|
7237
|
-
fit: "
|
|
7239
|
+
fit: "scale-down"
|
|
7238
7240
|
}),
|
|
7239
7241
|
alt: m.alt,
|
|
7240
7242
|
blurhash: m.blurhash,
|
|
@@ -13780,10 +13782,11 @@ const postsApiRoutes = new Hono();
|
|
|
13780
13782
|
const publicUrl = getPublicUrlForProvider(m.provider, r2PublicUrl, s3PublicUrl);
|
|
13781
13783
|
const url = getMediaUrl(m.storageKey, publicUrl);
|
|
13782
13784
|
const previewUrl = getImageUrl(url, imageTransformUrl, {
|
|
13783
|
-
width:
|
|
13785
|
+
width: 1200,
|
|
13786
|
+
height: 768,
|
|
13784
13787
|
quality: 80,
|
|
13785
13788
|
format: "auto",
|
|
13786
|
-
fit: "
|
|
13789
|
+
fit: "scale-down"
|
|
13787
13790
|
});
|
|
13788
13791
|
return {
|
|
13789
13792
|
id: m.id,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jant/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.30",
|
|
4
4
|
"description": "A modern, open-source microblogging platform built on Cloudflare Workers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -10,7 +10,11 @@
|
|
|
10
10
|
},
|
|
11
11
|
"./i18n": "./src/i18n/index.ts"
|
|
12
12
|
},
|
|
13
|
+
"bin": {
|
|
14
|
+
"jant-reset-password": "bin/reset-password.js"
|
|
15
|
+
},
|
|
13
16
|
"files": [
|
|
17
|
+
"bin",
|
|
14
18
|
"dist",
|
|
15
19
|
"src"
|
|
16
20
|
],
|
package/src/lib/media-helpers.ts
CHANGED
|
@@ -49,7 +49,13 @@ export function buildMediaMap(
|
|
|
49
49
|
previewUrl: getImageUrl(
|
|
50
50
|
getMediaUrl(m.storageKey, publicUrl),
|
|
51
51
|
imageTransformUrl,
|
|
52
|
-
{
|
|
52
|
+
{
|
|
53
|
+
width: 1200,
|
|
54
|
+
height: 768,
|
|
55
|
+
quality: 80,
|
|
56
|
+
format: "auto",
|
|
57
|
+
fit: "scale-down",
|
|
58
|
+
},
|
|
53
59
|
),
|
|
54
60
|
alt: m.alt,
|
|
55
61
|
blurhash: m.blurhash,
|
package/src/lib/view.ts
CHANGED
|
@@ -79,10 +79,11 @@ export function toMediaView(media: Media, ctx: MediaContext): MediaView {
|
|
|
79
79
|
);
|
|
80
80
|
const url = getMediaUrl(media.storageKey, publicUrl);
|
|
81
81
|
const thumbnailUrl = getImageUrl(url, ctx.imageTransformUrl, {
|
|
82
|
-
width:
|
|
82
|
+
width: 1200,
|
|
83
|
+
height: 768,
|
|
83
84
|
quality: 80,
|
|
84
85
|
format: "auto",
|
|
85
|
-
fit: "
|
|
86
|
+
fit: "scale-down",
|
|
86
87
|
});
|
|
87
88
|
|
|
88
89
|
return {
|
package/src/routes/api/posts.ts
CHANGED
|
@@ -44,10 +44,11 @@ function toMediaAttachment(
|
|
|
44
44
|
);
|
|
45
45
|
const url = getMediaUrl(m.storageKey, publicUrl);
|
|
46
46
|
const previewUrl = getImageUrl(url, imageTransformUrl, {
|
|
47
|
-
width:
|
|
47
|
+
width: 1200,
|
|
48
|
+
height: 768,
|
|
48
49
|
quality: 80,
|
|
49
50
|
format: "auto",
|
|
50
|
-
fit: "
|
|
51
|
+
fit: "scale-down",
|
|
51
52
|
});
|
|
52
53
|
|
|
53
54
|
return {
|