@autumnsgrove/groveengine 0.6.5 → 0.8.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.
Files changed (183) hide show
  1. package/LICENSE +378 -0
  2. package/dist/auth/index.d.ts +1 -2
  3. package/dist/auth/index.js +8 -4
  4. package/dist/auth/session.d.ts +12 -31
  5. package/dist/auth/session.js +5 -103
  6. package/dist/components/custom/ContentWithGutter.svelte +22 -25
  7. package/dist/ui/components/content/RoadmapPreview.svelte +91 -0
  8. package/dist/ui/components/content/RoadmapPreview.svelte.d.ts +36 -0
  9. package/dist/ui/components/content/index.d.ts +1 -0
  10. package/dist/ui/components/content/index.js +1 -0
  11. package/dist/ui/components/nature/Logo.svelte +224 -0
  12. package/dist/ui/components/nature/Logo.svelte.d.ts +14 -0
  13. package/dist/ui/components/nature/botanical/Acorn.svelte +48 -0
  14. package/dist/ui/components/nature/botanical/Acorn.svelte.d.ts +8 -0
  15. package/dist/ui/components/nature/botanical/Berry.svelte +67 -0
  16. package/dist/ui/components/nature/botanical/Berry.svelte.d.ts +8 -0
  17. package/dist/ui/components/nature/botanical/DandelionPuff.svelte +98 -0
  18. package/dist/ui/components/nature/botanical/DandelionPuff.svelte.d.ts +8 -0
  19. package/dist/ui/components/nature/botanical/FallingLeavesLayer.svelte +170 -0
  20. package/dist/ui/components/nature/botanical/FallingLeavesLayer.svelte.d.ts +35 -0
  21. package/dist/ui/components/nature/botanical/FallingPetalsLayer.svelte +174 -0
  22. package/dist/ui/components/nature/botanical/FallingPetalsLayer.svelte.d.ts +25 -0
  23. package/dist/ui/components/nature/botanical/Leaf.svelte +77 -0
  24. package/dist/ui/components/nature/botanical/Leaf.svelte.d.ts +10 -0
  25. package/dist/ui/components/nature/botanical/LeafFalling.svelte +186 -0
  26. package/dist/ui/components/nature/botanical/LeafFalling.svelte.d.ts +22 -0
  27. package/dist/ui/components/nature/botanical/PetalFalling.svelte +266 -0
  28. package/dist/ui/components/nature/botanical/PetalFalling.svelte.d.ts +25 -0
  29. package/dist/ui/components/nature/botanical/PineCone.svelte +61 -0
  30. package/dist/ui/components/nature/botanical/PineCone.svelte.d.ts +7 -0
  31. package/dist/ui/components/nature/botanical/Vine.svelte +102 -0
  32. package/dist/ui/components/nature/botanical/Vine.svelte.d.ts +11 -0
  33. package/dist/ui/components/nature/botanical/index.d.ts +10 -0
  34. package/dist/ui/components/nature/botanical/index.js +11 -0
  35. package/dist/ui/components/nature/creatures/Bee.svelte +78 -0
  36. package/dist/ui/components/nature/creatures/Bee.svelte.d.ts +9 -0
  37. package/dist/ui/components/nature/creatures/Bird.svelte +94 -0
  38. package/dist/ui/components/nature/creatures/Bird.svelte.d.ts +11 -0
  39. package/dist/ui/components/nature/creatures/BirdFlying.svelte +83 -0
  40. package/dist/ui/components/nature/creatures/BirdFlying.svelte.d.ts +9 -0
  41. package/dist/ui/components/nature/creatures/Bluebird.svelte +95 -0
  42. package/dist/ui/components/nature/creatures/Bluebird.svelte.d.ts +12 -0
  43. package/dist/ui/components/nature/creatures/Butterfly.svelte +87 -0
  44. package/dist/ui/components/nature/creatures/Butterfly.svelte.d.ts +9 -0
  45. package/dist/ui/components/nature/creatures/Cardinal.svelte +95 -0
  46. package/dist/ui/components/nature/creatures/Cardinal.svelte.d.ts +12 -0
  47. package/dist/ui/components/nature/creatures/Chickadee.svelte +97 -0
  48. package/dist/ui/components/nature/creatures/Chickadee.svelte.d.ts +12 -0
  49. package/dist/ui/components/nature/creatures/Deer.svelte +95 -0
  50. package/dist/ui/components/nature/creatures/Deer.svelte.d.ts +9 -0
  51. package/dist/ui/components/nature/creatures/Firefly.svelte +111 -0
  52. package/dist/ui/components/nature/creatures/Firefly.svelte.d.ts +10 -0
  53. package/dist/ui/components/nature/creatures/Owl.svelte +91 -0
  54. package/dist/ui/components/nature/creatures/Owl.svelte.d.ts +9 -0
  55. package/dist/ui/components/nature/creatures/Rabbit.svelte +90 -0
  56. package/dist/ui/components/nature/creatures/Rabbit.svelte.d.ts +9 -0
  57. package/dist/ui/components/nature/creatures/Robin.svelte +98 -0
  58. package/dist/ui/components/nature/creatures/Robin.svelte.d.ts +12 -0
  59. package/dist/ui/components/nature/creatures/Squirrel.svelte +97 -0
  60. package/dist/ui/components/nature/creatures/Squirrel.svelte.d.ts +9 -0
  61. package/dist/ui/components/nature/creatures/index.d.ts +13 -0
  62. package/dist/ui/components/nature/creatures/index.js +14 -0
  63. package/dist/ui/components/nature/ground/Bush.svelte +57 -0
  64. package/dist/ui/components/nature/ground/Bush.svelte.d.ts +10 -0
  65. package/dist/ui/components/nature/ground/Crocus.svelte +83 -0
  66. package/dist/ui/components/nature/ground/Crocus.svelte.d.ts +12 -0
  67. package/dist/ui/components/nature/ground/Daffodil.svelte +75 -0
  68. package/dist/ui/components/nature/ground/Daffodil.svelte.d.ts +11 -0
  69. package/dist/ui/components/nature/ground/Fern.svelte +72 -0
  70. package/dist/ui/components/nature/ground/Fern.svelte.d.ts +10 -0
  71. package/dist/ui/components/nature/ground/FlowerWild.svelte +60 -0
  72. package/dist/ui/components/nature/ground/FlowerWild.svelte.d.ts +10 -0
  73. package/dist/ui/components/nature/ground/GrassTuft.svelte +49 -0
  74. package/dist/ui/components/nature/ground/GrassTuft.svelte.d.ts +10 -0
  75. package/dist/ui/components/nature/ground/Log.svelte +42 -0
  76. package/dist/ui/components/nature/ground/Log.svelte.d.ts +7 -0
  77. package/dist/ui/components/nature/ground/Mushroom.svelte +48 -0
  78. package/dist/ui/components/nature/ground/Mushroom.svelte.d.ts +9 -0
  79. package/dist/ui/components/nature/ground/MushroomCluster.svelte +41 -0
  80. package/dist/ui/components/nature/ground/MushroomCluster.svelte.d.ts +8 -0
  81. package/dist/ui/components/nature/ground/Rock.svelte +59 -0
  82. package/dist/ui/components/nature/ground/Rock.svelte.d.ts +8 -0
  83. package/dist/ui/components/nature/ground/Stump.svelte +44 -0
  84. package/dist/ui/components/nature/ground/Stump.svelte.d.ts +8 -0
  85. package/dist/ui/components/nature/ground/Tulip.svelte +79 -0
  86. package/dist/ui/components/nature/ground/Tulip.svelte.d.ts +11 -0
  87. package/dist/ui/components/nature/ground/index.d.ts +12 -0
  88. package/dist/ui/components/nature/ground/index.js +13 -0
  89. package/dist/ui/components/nature/index.d.ts +28 -0
  90. package/dist/ui/components/nature/index.js +38 -0
  91. package/dist/ui/components/nature/palette.d.ts +491 -0
  92. package/dist/ui/components/nature/palette.js +384 -0
  93. package/dist/ui/components/nature/sky/Cloud.svelte +122 -0
  94. package/dist/ui/components/nature/sky/Cloud.svelte.d.ts +11 -0
  95. package/dist/ui/components/nature/sky/CloudWispy.svelte +79 -0
  96. package/dist/ui/components/nature/sky/CloudWispy.svelte.d.ts +9 -0
  97. package/dist/ui/components/nature/sky/Moon.svelte +60 -0
  98. package/dist/ui/components/nature/sky/Moon.svelte.d.ts +9 -0
  99. package/dist/ui/components/nature/sky/Rainbow.svelte +101 -0
  100. package/dist/ui/components/nature/sky/Rainbow.svelte.d.ts +8 -0
  101. package/dist/ui/components/nature/sky/Star.svelte +84 -0
  102. package/dist/ui/components/nature/sky/Star.svelte.d.ts +10 -0
  103. package/dist/ui/components/nature/sky/StarCluster.svelte +85 -0
  104. package/dist/ui/components/nature/sky/StarCluster.svelte.d.ts +9 -0
  105. package/dist/ui/components/nature/sky/StarShooting.svelte +90 -0
  106. package/dist/ui/components/nature/sky/StarShooting.svelte.d.ts +9 -0
  107. package/dist/ui/components/nature/sky/Sun.svelte +70 -0
  108. package/dist/ui/components/nature/sky/Sun.svelte.d.ts +9 -0
  109. package/dist/ui/components/nature/sky/index.d.ts +8 -0
  110. package/dist/ui/components/nature/sky/index.js +9 -0
  111. package/dist/ui/components/nature/structural/Birdhouse.svelte +53 -0
  112. package/dist/ui/components/nature/structural/Birdhouse.svelte.d.ts +8 -0
  113. package/dist/ui/components/nature/structural/Bridge.svelte +65 -0
  114. package/dist/ui/components/nature/structural/Bridge.svelte.d.ts +7 -0
  115. package/dist/ui/components/nature/structural/FencePost.svelte +54 -0
  116. package/dist/ui/components/nature/structural/FencePost.svelte.d.ts +8 -0
  117. package/dist/ui/components/nature/structural/GardenGate.svelte +70 -0
  118. package/dist/ui/components/nature/structural/GardenGate.svelte.d.ts +8 -0
  119. package/dist/ui/components/nature/structural/Lantern.svelte +113 -0
  120. package/dist/ui/components/nature/structural/Lantern.svelte.d.ts +10 -0
  121. package/dist/ui/components/nature/structural/Lattice.svelte +89 -0
  122. package/dist/ui/components/nature/structural/Lattice.svelte.d.ts +8 -0
  123. package/dist/ui/components/nature/structural/LatticeWithVine.svelte +89 -0
  124. package/dist/ui/components/nature/structural/LatticeWithVine.svelte.d.ts +11 -0
  125. package/dist/ui/components/nature/structural/StonePath.svelte +48 -0
  126. package/dist/ui/components/nature/structural/StonePath.svelte.d.ts +7 -0
  127. package/dist/ui/components/nature/structural/index.d.ts +8 -0
  128. package/dist/ui/components/nature/structural/index.js +9 -0
  129. package/dist/ui/components/nature/trees/TreeAspen.svelte +163 -0
  130. package/dist/ui/components/nature/trees/TreeAspen.svelte.d.ts +11 -0
  131. package/dist/ui/components/nature/trees/TreeBirch.svelte +186 -0
  132. package/dist/ui/components/nature/trees/TreeBirch.svelte.d.ts +11 -0
  133. package/dist/ui/components/nature/trees/TreeCherry.svelte +108 -0
  134. package/dist/ui/components/nature/trees/TreeCherry.svelte.d.ts +11 -0
  135. package/dist/ui/components/nature/trees/TreePine.svelte +79 -0
  136. package/dist/ui/components/nature/trees/TreePine.svelte.d.ts +11 -0
  137. package/dist/ui/components/nature/trees/index.d.ts +4 -0
  138. package/dist/ui/components/nature/trees/index.js +5 -0
  139. package/dist/ui/components/nature/water/LilyPad.svelte +99 -0
  140. package/dist/ui/components/nature/water/LilyPad.svelte.d.ts +10 -0
  141. package/dist/ui/components/nature/water/Pond.svelte +104 -0
  142. package/dist/ui/components/nature/water/Pond.svelte.d.ts +8 -0
  143. package/dist/ui/components/nature/water/Reeds.svelte +85 -0
  144. package/dist/ui/components/nature/water/Reeds.svelte.d.ts +11 -0
  145. package/dist/ui/components/nature/water/Stream.svelte +98 -0
  146. package/dist/ui/components/nature/water/Stream.svelte.d.ts +8 -0
  147. package/dist/ui/components/nature/water/index.d.ts +4 -0
  148. package/dist/ui/components/nature/water/index.js +5 -0
  149. package/dist/ui/components/nature/weather/SnowfallLayer.svelte +175 -0
  150. package/dist/ui/components/nature/weather/SnowfallLayer.svelte.d.ts +25 -0
  151. package/dist/ui/components/nature/weather/Snowflake.svelte +99 -0
  152. package/dist/ui/components/nature/weather/Snowflake.svelte.d.ts +11 -0
  153. package/dist/ui/components/nature/weather/SnowflakeFalling.svelte +162 -0
  154. package/dist/ui/components/nature/weather/SnowflakeFalling.svelte.d.ts +23 -0
  155. package/dist/ui/components/nature/weather/index.d.ts +3 -0
  156. package/dist/ui/components/nature/weather/index.js +4 -0
  157. package/dist/ui/components/ui/Glass.svelte +158 -0
  158. package/dist/ui/components/ui/Glass.svelte.d.ts +52 -0
  159. package/dist/ui/components/ui/GlassButton.svelte +157 -0
  160. package/dist/ui/components/ui/GlassButton.svelte.d.ts +39 -0
  161. package/dist/ui/components/ui/GlassCard.svelte +160 -0
  162. package/dist/ui/components/ui/GlassCard.svelte.d.ts +39 -0
  163. package/dist/ui/components/ui/GlassConfirmDialog.svelte +208 -0
  164. package/dist/ui/components/ui/GlassConfirmDialog.svelte.d.ts +52 -0
  165. package/dist/ui/components/ui/GlassLogo.svelte +422 -0
  166. package/dist/ui/components/ui/GlassLogo.svelte.d.ts +23 -0
  167. package/dist/ui/components/ui/GlassNavbar.svelte +120 -0
  168. package/dist/ui/components/ui/GlassNavbar.svelte.d.ts +42 -0
  169. package/dist/ui/components/ui/GlassOverlay.svelte +93 -0
  170. package/dist/ui/components/ui/GlassOverlay.svelte.d.ts +33 -0
  171. package/dist/ui/components/ui/Logo.svelte +47 -52
  172. package/dist/ui/components/ui/Logo.svelte.d.ts +4 -3
  173. package/dist/ui/components/ui/index.d.ts +7 -0
  174. package/dist/ui/components/ui/index.js +8 -0
  175. package/dist/ui/styles/grove.css +151 -1
  176. package/dist/utils/gutter.d.ts +2 -8
  177. package/dist/utils/markdown.d.ts +1 -0
  178. package/dist/utils/markdown.js +32 -11
  179. package/package.json +31 -22
  180. package/static/fonts/alagard.ttf +0 -0
  181. package/static/robots.txt +34 -1
  182. package/dist/auth/jwt.d.ts +0 -20
  183. package/dist/auth/jwt.js +0 -123
@@ -9,7 +9,9 @@ const renderer = new marked.Renderer();
9
9
  renderer.code = function (token) {
10
10
  // Handle both old (code, language) and new (token) API signatures
11
11
  const code = typeof token === "string" ? token : token.text;
12
- const language = typeof token === "string" ? arguments[1] : token.lang;
12
+ const language = typeof token === "string"
13
+ ? arguments[1]
14
+ : token.lang;
13
15
  const lang = language || "text";
14
16
  // Render markdown/md code blocks as formatted HTML (like GitHub)
15
17
  if (lang === "markdown" || lang === "md") {
@@ -177,7 +179,9 @@ export function processGutterContent(slug, manifestModules, markdownModules, ima
177
179
  });
178
180
  if (mdEntry) {
179
181
  const markdownContent = mdEntry[1];
180
- const htmlContent = marked.parse(markdownContent, { async: false });
182
+ const htmlContent = marked.parse(markdownContent, {
183
+ async: false,
184
+ });
181
185
  return {
182
186
  ...baseItem,
183
187
  content: htmlContent,
@@ -285,7 +289,11 @@ export function processGutterContent(slug, manifestModules, markdownModules, ima
285
289
  }
286
290
  return baseItem;
287
291
  })
288
- .filter((item) => item !== null && (!!item.content || !!item.src || !!item.images || item.type === "emoji"));
292
+ .filter((item) => item !== null &&
293
+ (!!item.content ||
294
+ !!item.src ||
295
+ !!item.images ||
296
+ item.type === "emoji"));
289
297
  }
290
298
  /**
291
299
  * Process a list of markdown files into post/recipe objects
@@ -364,9 +372,12 @@ export function getItemBySlug(slug, modules, options = {}) {
364
372
  });
365
373
  if (sidecarEntry) {
366
374
  const sidecarData = sidecarEntry[1];
367
- result.sidecar = typeof sidecarData === "object" && sidecarData !== null && "default" in sidecarData
368
- ? sidecarData.default
369
- : sidecarData;
375
+ result.sidecar =
376
+ typeof sidecarData === "object" &&
377
+ sidecarData !== null &&
378
+ "default" in sidecarData
379
+ ? sidecarData.default
380
+ : sidecarData;
370
381
  }
371
382
  }
372
383
  return result;
@@ -463,7 +474,9 @@ export function createContentLoader(config) {
463
474
  */
464
475
  getPostBySlug(slug) {
465
476
  return getItemBySlug(slug, posts, {
466
- gutterModules: postGutter.manifest ? postGutter : undefined,
477
+ gutterModules: postGutter.manifest
478
+ ? postGutter
479
+ : undefined,
467
480
  });
468
481
  },
469
482
  /**
@@ -471,7 +484,9 @@ export function createContentLoader(config) {
471
484
  */
472
485
  getRecipeBySlug(slug) {
473
486
  return getItemBySlug(slug, recipes, {
474
- gutterModules: recipeGutter.manifest ? recipeGutter : undefined,
487
+ gutterModules: recipeGutter.manifest
488
+ ? recipeGutter
489
+ : undefined,
475
490
  sidecarModules: recipeMetadata,
476
491
  });
477
492
  },
@@ -480,7 +495,9 @@ export function createContentLoader(config) {
480
495
  */
481
496
  getHomePage() {
482
497
  return getPageByFilename("home.md", home, {
483
- gutterModules: homeGutter.manifest ? homeGutter : undefined,
498
+ gutterModules: homeGutter.manifest
499
+ ? homeGutter
500
+ : undefined,
484
501
  slug: "home",
485
502
  });
486
503
  },
@@ -489,7 +506,9 @@ export function createContentLoader(config) {
489
506
  */
490
507
  getAboutPage() {
491
508
  return getPageByFilename("about.md", about, {
492
- gutterModules: aboutGutter.manifest ? aboutGutter : undefined,
509
+ gutterModules: aboutGutter.manifest
510
+ ? aboutGutter
511
+ : undefined,
493
512
  slug: "about",
494
513
  });
495
514
  },
@@ -498,7 +517,9 @@ export function createContentLoader(config) {
498
517
  */
499
518
  getContactPage() {
500
519
  return getPageByFilename("contact.md", contact, {
501
- gutterModules: contactGutter.manifest ? contactGutter : undefined,
520
+ gutterModules: contactGutter.manifest
521
+ ? contactGutter
522
+ : undefined,
502
523
  slug: "contact",
503
524
  });
504
525
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autumnsgrove/groveengine",
3
- "version": "0.6.5",
3
+ "version": "0.8.0",
4
4
  "description": "Multi-tenant blog engine for Grove Platform. Features gutter annotations, markdown editing, magic code auth, and Cloudflare Workers deployment.",
5
5
  "author": "AutumnsGrove",
6
6
  "license": "AGPL-3.0-only",
@@ -73,6 +73,16 @@
73
73
  "svelte": "./dist/ui/components/states/index.js",
74
74
  "default": "./dist/ui/components/states/index.js"
75
75
  },
76
+ "./ui/nature": {
77
+ "types": "./dist/ui/components/nature/index.d.ts",
78
+ "svelte": "./dist/ui/components/nature/index.js",
79
+ "default": "./dist/ui/components/nature/index.js"
80
+ },
81
+ "./ui/nature/*": {
82
+ "types": "./dist/ui/components/nature/*/index.d.ts",
83
+ "svelte": "./dist/ui/components/nature/*/index.js",
84
+ "default": "./dist/ui/components/nature/*/index.js"
85
+ },
76
86
  "./ui/tokens": {
77
87
  "types": "./dist/ui/tokens/index.d.ts",
78
88
  "default": "./dist/ui/tokens/index.js"
@@ -138,26 +148,6 @@
138
148
  "static",
139
149
  "!dist/**/*.test.*"
140
150
  ],
141
- "scripts": {
142
- "dev": "vite dev",
143
- "dev:wrangler": "wrangler pages dev -- vite dev",
144
- "build": "vite build",
145
- "build:package": "svelte-kit sync && svelte-package -o dist",
146
- "package": "svelte-kit sync && svelte-package -o dist",
147
- "prepublishOnly": "pnpm run package",
148
- "preview": "vite preview",
149
- "deploy": "wrangler pages deploy .svelte-kit/cloudflare --project-name groveengine",
150
- "audit": "pnpm audit --audit-level=moderate",
151
- "audit:fix": "pnpm audit --fix",
152
- "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
153
- "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
154
- "test": "vitest",
155
- "test:ui": "vitest --ui",
156
- "test:run": "vitest run",
157
- "test:security": "vitest run tests/security",
158
- "test:coverage": "vitest run --coverage",
159
- "test:watch": "vitest watch"
160
- },
161
151
  "peerDependencies": {
162
152
  "@sveltejs/kit": "^2.0.0",
163
153
  "svelte": "^5.0.0",
@@ -198,5 +188,24 @@
198
188
  "marked": "^17.0.1",
199
189
  "svelte-sonner": "^1.0.7",
200
190
  "tailwind-merge": "^3.4.0"
191
+ },
192
+ "scripts": {
193
+ "dev": "vite dev",
194
+ "dev:wrangler": "wrangler pages dev -- vite dev",
195
+ "build": "vite build",
196
+ "build:package": "svelte-kit sync && svelte-package -o dist",
197
+ "package": "svelte-kit sync && svelte-package -o dist",
198
+ "preview": "vite preview",
199
+ "deploy": "wrangler pages deploy .svelte-kit/cloudflare --project-name groveengine",
200
+ "audit": "pnpm audit --audit-level=moderate",
201
+ "audit:fix": "pnpm audit --fix",
202
+ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
203
+ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
204
+ "test": "vitest",
205
+ "test:ui": "vitest --ui",
206
+ "test:run": "vitest run",
207
+ "test:security": "vitest run tests/security",
208
+ "test:coverage": "vitest run --coverage",
209
+ "test:watch": "vitest watch"
201
210
  }
202
- }
211
+ }
File without changes
package/static/robots.txt CHANGED
@@ -186,12 +186,45 @@ User-agent: Perplexity-User
186
186
  Disallow: /
187
187
 
188
188
  # =============================================================================
189
- # COMMON CRAWL (used for ML training datasets)
189
+ # COMMON CRAWL (used for ML training datasets and archiving)
190
190
  # =============================================================================
191
191
 
192
192
  User-agent: CCBot
193
193
  Disallow: /
194
194
 
195
+ # =============================================================================
196
+ # WEB ARCHIVING SERVICES
197
+ # These services crawl and archive web content for public access
198
+ # NOTE: Blocking these will RETROACTIVELY remove existing archives
199
+ # =============================================================================
200
+
201
+ # Internet Archive / Wayback Machine
202
+ User-agent: archive.org_bot
203
+ Disallow: /
204
+
205
+ User-agent: ia_archiver
206
+ Disallow: /
207
+
208
+ # Archive-It (Internet Archive's subscription service)
209
+ User-agent: archive.org
210
+ Disallow: /
211
+
212
+ User-agent: ArchiveBot
213
+ Disallow: /
214
+
215
+ User-agent: Archive-It
216
+ Disallow: /
217
+
218
+ # Note: CCBot (Common Crawl) is already blocked above - it serves both
219
+ # archiving and AI training purposes
220
+
221
+ # archive.today / archive.is / archive.ph:
222
+ # Does NOT respect robots.txt - would require IP-based blocking via WAF
223
+ # Not recommended to pursue unless critical
224
+
225
+ # Personal archiving tools (Raindrop, Pocket, ArchiveBox, browser extensions):
226
+ # CANNOT be blocked via robots.txt - they use normal browser sessions
227
+
195
228
  # =============================================================================
196
229
  # MISTRAL
197
230
  # =============================================================================
@@ -1,20 +0,0 @@
1
- /**
2
- * Sign a JWT payload
3
- * @param {JwtPayload} payload - The payload to sign
4
- * @param {string} secret - The secret key
5
- * @returns {Promise<string>} - The signed JWT token
6
- */
7
- export function signJwt(payload: JwtPayload, secret: string): Promise<string>;
8
- /**
9
- * Verify and decode a JWT token
10
- * @param {string} token - The JWT token to verify
11
- * @param {string} secret - The secret key
12
- * @returns {Promise<JwtPayload|null>} - The decoded payload or null if invalid
13
- */
14
- export function verifyJwt(token: string, secret: string): Promise<JwtPayload | null>;
15
- export type JwtPayload = {
16
- sub?: string | undefined;
17
- email?: string | undefined;
18
- exp?: number | undefined;
19
- iat?: number | undefined;
20
- };
package/dist/auth/jwt.js DELETED
@@ -1,123 +0,0 @@
1
- /**
2
- * JWT utilities using Web Crypto API (Cloudflare Workers compatible)
3
- */
4
-
5
- /**
6
- * @typedef {Object} JwtPayload
7
- * @property {string} [sub]
8
- * @property {string} [email]
9
- * @property {number} [exp]
10
- * @property {number} [iat]
11
- */
12
-
13
- const encoder = new TextEncoder();
14
- const decoder = new TextDecoder();
15
-
16
- /**
17
- * Base64URL encode
18
- * @param {ArrayBuffer} data
19
- * @returns {string}
20
- */
21
- function base64UrlEncode(data) {
22
- const base64 = btoa(String.fromCharCode(...new Uint8Array(data)));
23
- return base64.replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
24
- }
25
-
26
- /**
27
- * Base64URL decode
28
- * @param {string} str
29
- * @returns {Uint8Array}
30
- */
31
- function base64UrlDecode(str) {
32
- const base64 = str.replace(/-/g, "+").replace(/_/g, "/");
33
- const padding = "=".repeat((4 - (base64.length % 4)) % 4);
34
- const binary = atob(base64 + padding);
35
- return Uint8Array.from(binary, (c) => c.charCodeAt(0));
36
- }
37
-
38
- /**
39
- * Create HMAC key from secret
40
- * @param {string} secret
41
- * @returns {Promise<CryptoKey>}
42
- */
43
- async function createKey(secret) {
44
- return await crypto.subtle.importKey(
45
- "raw",
46
- encoder.encode(secret),
47
- { name: "HMAC", hash: "SHA-256" },
48
- false,
49
- ["sign", "verify"],
50
- );
51
- }
52
-
53
- /**
54
- * Sign a JWT payload
55
- * @param {JwtPayload} payload - The payload to sign
56
- * @param {string} secret - The secret key
57
- * @returns {Promise<string>} - The signed JWT token
58
- */
59
- export async function signJwt(payload, secret) {
60
- const header = { alg: "HS256", typ: "JWT" };
61
-
62
- const headerEncoded = base64UrlEncode(encoder.encode(JSON.stringify(header)).buffer);
63
- const payloadEncoded = base64UrlEncode(
64
- encoder.encode(JSON.stringify(payload)).buffer,
65
- );
66
-
67
- const message = `${headerEncoded}.${payloadEncoded}`;
68
- const key = await createKey(secret);
69
-
70
- const signature = await crypto.subtle.sign(
71
- "HMAC",
72
- key,
73
- encoder.encode(message),
74
- );
75
-
76
- const signatureEncoded = base64UrlEncode(signature);
77
-
78
- return `${message}.${signatureEncoded}`;
79
- }
80
-
81
- /**
82
- * Verify and decode a JWT token
83
- * @param {string} token - The JWT token to verify
84
- * @param {string} secret - The secret key
85
- * @returns {Promise<JwtPayload|null>} - The decoded payload or null if invalid
86
- */
87
- export async function verifyJwt(token, secret) {
88
- try {
89
- const parts = token.split(".");
90
- if (parts.length !== 3) {
91
- return null;
92
- }
93
-
94
- const [headerEncoded, payloadEncoded, signatureEncoded] = parts;
95
- const message = `${headerEncoded}.${payloadEncoded}`;
96
-
97
- const key = await createKey(secret);
98
- const signature = base64UrlDecode(signatureEncoded);
99
-
100
- const isValid = await crypto.subtle.verify(
101
- "HMAC",
102
- key,
103
- signature,
104
- encoder.encode(message),
105
- );
106
-
107
- if (!isValid) {
108
- return null;
109
- }
110
-
111
- const payload = JSON.parse(decoder.decode(base64UrlDecode(payloadEncoded)));
112
-
113
- // Check expiration
114
- if (payload.exp && payload.exp < Math.floor(Date.now() / 1000)) {
115
- return null;
116
- }
117
-
118
- return payload;
119
- } catch (error) {
120
- console.error("JWT verification error:", error);
121
- return null;
122
- }
123
- }