@nextsparkjs/theme-blog 0.1.0-beta.50 → 0.1.0-beta.51

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.
@@ -9,6 +9,7 @@
9
9
 
10
10
  import { NextRequest, NextResponse } from 'next/server'
11
11
  import { queryWithRLS } from '@nextsparkjs/core/lib/db'
12
+ import { withRateLimitTier } from '@nextsparkjs/core/lib/api/rate-limit'
12
13
 
13
14
  interface Author {
14
15
  id: string
@@ -39,10 +40,10 @@ interface RouteContext {
39
40
  }>
40
41
  }
41
42
 
42
- export async function GET(
43
+ const getHandler = async (
43
44
  request: NextRequest,
44
45
  context: RouteContext
45
- ) {
46
+ ) => {
46
47
  try {
47
48
  const { username } = await context.params
48
49
 
@@ -148,3 +149,5 @@ export async function GET(
148
149
  )
149
150
  }
150
151
  }
152
+
153
+ export const GET = withRateLimitTier(getHandler, 'read')
@@ -9,6 +9,7 @@
9
9
 
10
10
  import { NextRequest, NextResponse } from 'next/server'
11
11
  import { queryWithRLS } from '@nextsparkjs/core/lib/db'
12
+ import { withRateLimitTier } from '@nextsparkjs/core/lib/api/rate-limit'
12
13
 
13
14
  interface AuthorWithCount {
14
15
  id: string
@@ -19,7 +20,7 @@ interface AuthorWithCount {
19
20
  postCount: number
20
21
  }
21
22
 
22
- export async function GET(request: NextRequest) {
23
+ const getHandler = async (request: NextRequest) => {
23
24
  try {
24
25
  // Get all authors who have at least one published post
25
26
  const authorsQuery = `
@@ -61,3 +62,5 @@ export async function GET(request: NextRequest) {
61
62
  )
62
63
  }
63
64
  }
65
+
66
+ export const GET = withRateLimitTier(getHandler, 'read')
@@ -10,6 +10,7 @@
10
10
 
11
11
  import { NextRequest, NextResponse } from 'next/server'
12
12
  import { queryWithRLS } from '@nextsparkjs/core/lib/db'
13
+ import { withRateLimitTier } from '@nextsparkjs/core/lib/api/rate-limit'
13
14
 
14
15
  interface Post {
15
16
  id: string
@@ -31,7 +32,7 @@ interface Post {
31
32
  authorImage: string | null
32
33
  }
33
34
 
34
- export async function GET(request: NextRequest) {
35
+ const getHandler = async (request: NextRequest) => {
35
36
  try {
36
37
  const { searchParams } = new URL(request.url)
37
38
 
@@ -149,3 +150,5 @@ export async function GET(request: NextRequest) {
149
150
  )
150
151
  }
151
152
  }
153
+
154
+ export const GET = withRateLimitTier(getHandler, 'read')
@@ -48,6 +48,19 @@ export const DASHBOARD_CONFIG = {
48
48
  devtoolsAccess: {
49
49
  enabled: true,
50
50
  },
51
+ /**
52
+ * Settings menu dropdown (gear icon)
53
+ */
54
+ settingsMenu: {
55
+ enabled: true,
56
+ links: [
57
+ {
58
+ label: 'navigation.patterns',
59
+ href: '/dashboard/patterns',
60
+ icon: 'layers',
61
+ },
62
+ ],
63
+ },
51
64
  userMenu: {
52
65
  enabled: true,
53
66
  showAvatar: true,
@@ -48,6 +48,17 @@ export const PERMISSIONS_CONFIG_OVERRIDES: ThemePermissionsConfig = {
48
48
  { action: 'update', label: 'Edit categories', description: 'Can modify category information', roles: ['owner'] },
49
49
  { action: 'delete', label: 'Delete categories', description: 'Can delete categories', roles: ['owner'], dangerous: true },
50
50
  ],
51
+
52
+ // ------------------------------------------
53
+ // PATTERNS
54
+ // ------------------------------------------
55
+ patterns: [
56
+ { action: 'create', label: 'Create Patterns', description: 'Can create reusable patterns', roles: ['owner'] },
57
+ { action: 'read', label: 'View Patterns', description: 'Can view pattern details', roles: ['owner'] },
58
+ { action: 'list', label: 'List Patterns', description: 'Can see the patterns list', roles: ['owner'] },
59
+ { action: 'update', label: 'Edit Patterns', description: 'Can modify patterns', roles: ['owner'] },
60
+ { action: 'delete', label: 'Delete Patterns', description: 'Can delete patterns', roles: ['owner'], dangerous: true },
61
+ ],
51
62
  },
52
63
 
53
64
  // ==========================================
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextsparkjs/theme-blog",
3
- "version": "0.1.0-beta.50",
3
+ "version": "0.1.0-beta.51",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./config/theme.config.ts",
@@ -13,8 +13,8 @@
13
13
  "react": "^19.0.0",
14
14
  "react-dom": "^19.0.0",
15
15
  "zod": "^4.0.0",
16
- "@nextsparkjs/core": "0.1.0-beta.50",
17
- "@nextsparkjs/testing": "0.1.0-beta.50"
16
+ "@nextsparkjs/core": "0.1.0-beta.51",
17
+ "@nextsparkjs/testing": "0.1.0-beta.51"
18
18
  },
19
19
  "nextspark": {
20
20
  "type": "theme",