@xk2800/nextjs-template 0.7.2-beta.11 → 0.7.2-beta.12

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.
@@ -20,9 +20,13 @@ interface ConfiguredAuthFlags {
20
20
  oneTap: boolean
21
21
  }
22
22
 
23
+ export type SettingsSection = 'maintenance' | 'auth' | 'privacy' | 'diagnostics'
24
+
23
25
  interface SystemSettingsFormProps {
24
26
  initialSettings: SystemSettings
25
27
  configuredFlags: ConfiguredAuthFlags
28
+ /** Which sections to show. Default: all four. Hide ones your app doesn't use (e.g. consent when it has its own banner wiring). */
29
+ sections?: SettingsSection[]
26
30
  /** Per-control env requirements (see getControlStatuses); a failing one disables its toggle and explains why. */
27
31
  controlStatus?: Record<string, ControlStatus>
28
32
  }
@@ -38,7 +42,7 @@ type ToggleKey =
38
42
  | 'feedbackAttachErrors'
39
43
  | 'consentRequired'
40
44
 
41
- const SECTIONS = [
45
+ const SECTIONS: { id: SettingsSection; label: string }[] = [
42
46
  { id: 'maintenance', label: 'Maintenance' },
43
47
  { id: 'auth', label: 'Auth & Sessions' },
44
48
  { id: 'privacy', label: 'Privacy & Consent' },
@@ -118,7 +122,10 @@ const LABELS: Record<ToggleKey, string> = {
118
122
  consentRequired: 'Consent requirement',
119
123
  }
120
124
 
121
- export default function SystemSettingsForm({ initialSettings, configuredFlags, controlStatus = {} }: SystemSettingsFormProps) {
125
+ const ALL_SECTIONS: SettingsSection[] = ['maintenance', 'auth', 'privacy', 'diagnostics']
126
+
127
+ export default function SystemSettingsForm({ initialSettings, configuredFlags, controlStatus = {}, sections = ALL_SECTIONS }: SystemSettingsFormProps) {
128
+ const show = (id: SettingsSection) => sections.includes(id)
122
129
  const router = useRouter()
123
130
  const [settings, setSettings] = useState(initialSettings)
124
131
  const [rowState, setRowState] = useState<Partial<Record<ToggleKey, 'saving' | 'saved'>>>({})
@@ -179,184 +186,192 @@ export default function SystemSettingsForm({ initialSettings, configuredFlags, c
179
186
  return (
180
187
  <div className="space-y-6">
181
188
  <nav className="sticky top-0 z-10 -mx-1 flex flex-wrap gap-1 rounded-lg border bg-background/90 p-1 backdrop-blur" aria-label="Settings sections">
182
- {SECTIONS.map((sec) => (
189
+ {SECTIONS.filter((sec) => show(sec.id)).map((sec) => (
183
190
  <a key={sec.id} href={`#${sec.id}`} className="rounded-md px-3 py-1.5 text-sm text-muted-foreground hover:bg-muted hover:text-foreground">
184
191
  {sec.label}
185
192
  </a>
186
193
  ))}
187
194
  </nav>
188
195
 
189
- <Card id="maintenance" className="scroll-mt-16">
190
- <CardHeader>
191
- <CardTitle>Maintenance Mode</CardTitle>
192
- <CardDescription>
193
- Blocks every page and API route except the paths kept open below, and shows a
194
- maintenance page instead — admins keep full access
195
- </CardDescription>
196
- </CardHeader>
197
- <CardContent className="space-y-4">
198
- <SettingRow
199
- id="maintenance-toggle"
200
- label="Maintenance mode"
201
- description="Non-admins are redirected to /maintenance"
202
- badge={settings.maintenanceMode ? <Badge variant="destructive">Site locked</Badge> : <Badge variant="outline">Off</Badge>}
203
- checked={settings.maintenanceMode}
204
- state={rowState.maintenanceMode}
205
- onChange={(v) => saveToggle('maintenanceMode', v)}
206
- />
207
-
208
- <div className="space-y-2">
209
- <Label htmlFor="maintenance-message">Message shown to visitors (optional)</Label>
210
- <Textarea
211
- id="maintenance-message"
212
- value={settings.maintenanceMessage ?? ''}
213
- onChange={(e) => setSettings({ ...settings, maintenanceMessage: e.target.value || null })}
214
- placeholder="We'll be back shortly."
215
- maxLength={2000}
196
+ {show('maintenance') && (
197
+ <Card id="maintenance" className="scroll-mt-16">
198
+ <CardHeader>
199
+ <CardTitle>Maintenance Mode</CardTitle>
200
+ <CardDescription>
201
+ Blocks every page and API route except the paths kept open below, and shows a
202
+ maintenance page instead — admins keep full access
203
+ </CardDescription>
204
+ </CardHeader>
205
+ <CardContent className="space-y-4">
206
+ <SettingRow
207
+ id="maintenance-toggle"
208
+ label="Maintenance mode"
209
+ description="Non-admins are redirected to /maintenance"
210
+ badge={settings.maintenanceMode ? <Badge variant="destructive">Site locked</Badge> : <Badge variant="outline">Off</Badge>}
211
+ checked={settings.maintenanceMode}
212
+ state={rowState.maintenanceMode}
213
+ onChange={(v) => saveToggle('maintenanceMode', v)}
216
214
  />
217
- </div>
218
215
 
219
- <div className="space-y-2">
220
- <Label htmlFor="maintenance-exempt">Paths that stay open during maintenance</Label>
221
- <p className="text-sm text-gray-500">
222
- One per line. <code>/foo</code> also opens <code>/foo/...</code>; <code>/</code> opens
223
- only the home page. Always open regardless: {ALWAYS_OPEN_PATHS.join(', ')}
224
- </p>
225
- <Textarea
226
- id="maintenance-exempt"
227
- value={exemptPathsText}
228
- onChange={(e) => setExemptPathsText(e.target.value)}
229
- rows={6}
230
- className="font-mono text-sm"
231
- />
232
- </div>
216
+ <div className="space-y-2">
217
+ <Label htmlFor="maintenance-message">Message shown to visitors (optional)</Label>
218
+ <Textarea
219
+ id="maintenance-message"
220
+ value={settings.maintenanceMessage ?? ''}
221
+ onChange={(e) => setSettings({ ...settings, maintenanceMessage: e.target.value || null })}
222
+ placeholder="We'll be back shortly."
223
+ maxLength={2000}
224
+ />
225
+ </div>
233
226
 
234
- <div className="flex items-center justify-between gap-2">
235
- <Button
236
- type="button"
237
- variant="outline"
238
- size="sm"
239
- onClick={() => setExemptPathsText(DEFAULT_MAINTENANCE_EXEMPT_PATHS.join('\n'))}
240
- >
241
- Reset to public pages
242
- </Button>
243
- <Button size="sm" onClick={saveMaintenanceText} disabled={isSavingMaintenance}>
244
- {isSavingMaintenance ? 'Saving...' : 'Save message & paths'}
245
- </Button>
246
- </div>
247
- </CardContent>
248
- </Card>
227
+ <div className="space-y-2">
228
+ <Label htmlFor="maintenance-exempt">Paths that stay open during maintenance</Label>
229
+ <p className="text-sm text-gray-500">
230
+ One per line. <code>/foo</code> also opens <code>/foo/...</code>; <code>/</code> opens
231
+ only the home page. Always open regardless: {ALWAYS_OPEN_PATHS.join(', ')}
232
+ </p>
233
+ <Textarea
234
+ id="maintenance-exempt"
235
+ value={exemptPathsText}
236
+ onChange={(e) => setExemptPathsText(e.target.value)}
237
+ rows={6}
238
+ className="font-mono text-sm"
239
+ />
240
+ </div>
249
241
 
250
- <Card id="auth" className="scroll-mt-16">
251
- <CardHeader>
252
- <CardTitle>Authentication & Sessions</CardTitle>
253
- <CardDescription>
254
- Live toggles on top of what&apos;s configured via environment variables —
255
- a method disabled here stops working immediately, without a redeploy
256
- </CardDescription>
257
- </CardHeader>
258
- <CardContent className="space-y-4">
259
- <SettingRow
260
- id="google-toggle"
261
- label="Google sign-in"
262
- description="Show the Google button and accept sign-ins"
263
- {...envProps(controlStatus.authEnableGoogle, settings.authEnableGoogle)}
264
- checked={settings.authEnableGoogle}
265
- state={rowState.authEnableGoogle}
266
- onChange={(v) => saveToggle('authEnableGoogle', v)}
267
- />
242
+ <div className="flex items-center justify-between gap-2">
243
+ <Button
244
+ type="button"
245
+ variant="outline"
246
+ size="sm"
247
+ onClick={() => setExemptPathsText(DEFAULT_MAINTENANCE_EXEMPT_PATHS.join('\n'))}
248
+ >
249
+ Reset to public pages
250
+ </Button>
251
+ <Button size="sm" onClick={saveMaintenanceText} disabled={isSavingMaintenance}>
252
+ {isSavingMaintenance ? 'Saving...' : 'Save message & paths'}
253
+ </Button>
254
+ </div>
255
+ </CardContent>
256
+ </Card>
257
+ )}
268
258
 
269
- <SettingRow
270
- id="email-toggle"
271
- label="Email & password sign-in"
272
- description="Show the email/password form and signup page"
273
- {...envProps(controlStatus.authEnableEmailPassword, settings.authEnableEmailPassword)}
274
- checked={settings.authEnableEmailPassword}
275
- state={rowState.authEnableEmailPassword}
276
- onChange={(v) => saveToggle('authEnableEmailPassword', v)}
277
- />
259
+ {show('auth') && (
260
+ <Card id="auth" className="scroll-mt-16">
261
+ <CardHeader>
262
+ <CardTitle>Authentication & Sessions</CardTitle>
263
+ <CardDescription>
264
+ Live toggles on top of what&apos;s configured via environment variables —
265
+ a method disabled here stops working immediately, without a redeploy
266
+ </CardDescription>
267
+ </CardHeader>
268
+ <CardContent className="space-y-4">
269
+ <SettingRow
270
+ id="google-toggle"
271
+ label="Google sign-in"
272
+ description="Show the Google button and accept sign-ins"
273
+ {...envProps(controlStatus.authEnableGoogle, settings.authEnableGoogle)}
274
+ checked={settings.authEnableGoogle}
275
+ state={rowState.authEnableGoogle}
276
+ onChange={(v) => saveToggle('authEnableGoogle', v)}
277
+ />
278
278
 
279
- <SettingRow
280
- id="onetap-toggle"
281
- label="Google One Tap"
282
- description="Show the One Tap prompt on load — a shortcut into Google sign-in, not a separate method; it stops working if Google sign-in above is off"
283
- {...envProps(controlStatus.authEnableOneTap, settings.authEnableOneTap)}
284
- note={!settings.authEnableGoogle && (
285
- <p className="text-sm text-amber-600 dark:text-amber-500">
286
- Requires Google sign-in to be enabled above
287
- </p>
288
- )}
289
- checked={settings.authEnableOneTap}
290
- state={rowState.authEnableOneTap}
291
- onChange={(v) => saveToggle('authEnableOneTap', v)}
292
- />
279
+ <SettingRow
280
+ id="email-toggle"
281
+ label="Email & password sign-in"
282
+ description="Show the email/password form and signup page"
283
+ {...envProps(controlStatus.authEnableEmailPassword, settings.authEnableEmailPassword)}
284
+ checked={settings.authEnableEmailPassword}
285
+ state={rowState.authEnableEmailPassword}
286
+ onChange={(v) => saveToggle('authEnableEmailPassword', v)}
287
+ />
293
288
 
294
- <SettingRow
295
- id="revoke-toggle"
296
- label="Session revocation"
297
- description="Let users revoke their own sessions from Settings"
298
- checked={settings.enableSessionRevocation}
299
- state={rowState.enableSessionRevocation}
300
- onChange={(v) => saveToggle('enableSessionRevocation', v)}
301
- />
289
+ <SettingRow
290
+ id="onetap-toggle"
291
+ label="Google One Tap"
292
+ description="Show the One Tap prompt on load — a shortcut into Google sign-in, not a separate method; it stops working if Google sign-in above is off"
293
+ {...envProps(controlStatus.authEnableOneTap, settings.authEnableOneTap)}
294
+ note={!settings.authEnableGoogle && (
295
+ <p className="text-sm text-amber-600 dark:text-amber-500">
296
+ Requires Google sign-in to be enabled above
297
+ </p>
298
+ )}
299
+ checked={settings.authEnableOneTap}
300
+ state={rowState.authEnableOneTap}
301
+ onChange={(v) => saveToggle('authEnableOneTap', v)}
302
+ />
302
303
 
303
- {!anySignInMethodLeft && (
304
- <p className="text-sm text-destructive">
305
- At least one sign-in method must stay enabled, or nobody will be able to sign in.
306
- </p>
307
- )}
308
- </CardContent>
309
- </Card>
304
+ <SettingRow
305
+ id="revoke-toggle"
306
+ label="Session revocation"
307
+ description="Let users revoke their own sessions from Settings"
308
+ checked={settings.enableSessionRevocation}
309
+ state={rowState.enableSessionRevocation}
310
+ onChange={(v) => saveToggle('enableSessionRevocation', v)}
311
+ />
310
312
 
311
- <Card id="privacy" className="scroll-mt-16">
312
- <CardHeader>
313
- <CardTitle>Privacy &amp; Consent</CardTitle>
314
- <CardDescription>
315
- Whether visitors must opt in before device fingerprinting and Google One Tap run
316
- </CardDescription>
317
- </CardHeader>
318
- <CardContent className="space-y-4">
319
- <SettingRow
320
- id="consent-toggle"
321
- label="Require consent (GDPR / ePrivacy)"
322
- description="On: cookie banner where visitors allow fingerprinting and One Tap separately, and the device record is erased if fingerprint consent is withdrawn. Off: no banner, everything runs for every visitor."
323
- note={!settings.consentRequired && (
324
- <p className="text-sm text-amber-600 dark:text-amber-500">
325
- Only turn this off if none of your users are in the EU, the UK or another region with
326
- consent rules. Fingerprinting without consent breaks those laws.
313
+ {!anySignInMethodLeft && (
314
+ <p className="text-sm text-destructive">
315
+ At least one sign-in method must stay enabled, or nobody will be able to sign in.
327
316
  </p>
328
317
  )}
329
- checked={settings.consentRequired ?? true}
330
- state={rowState.consentRequired}
331
- onChange={(v) => saveToggle('consentRequired', v)}
332
- />
333
- </CardContent>
334
- </Card>
318
+ </CardContent>
319
+ </Card>
320
+ )}
335
321
 
336
- <Card id="diagnostics" className="scroll-mt-16">
337
- <CardHeader>
338
- <CardTitle>Integrations &amp; Diagnostics</CardTitle>
339
- <CardDescription>
340
- Feedback reporting (applies when FEEDBACK_DISCORD_WEBHOOK_URL or FEEDBACK_EMAIL is set) and developer test tools
341
- </CardDescription>
342
- </CardHeader>
343
- <CardContent className="space-y-4">
344
- <SettingRow
345
- id="feedback-errors-toggle"
346
- label="Attach error details"
347
- description="When a user reports a problem from an error, send the error message with their report, even if they edit it out of the text"
348
- {...envProps(controlStatus.feedbackAttachErrors, settings.feedbackAttachErrors)}
349
- checked={settings.feedbackAttachErrors}
350
- state={rowState.feedbackAttachErrors}
351
- onChange={(v) => saveToggle('feedbackAttachErrors', v)}
352
- />
353
- {process.env.NODE_ENV === "development" ? (
354
- <FeedbackTestForm />
355
- ) : (
356
- <p className="text-sm text-muted-foreground">Error-pipeline test tools are available in development builds.</p>
357
- )}
358
- </CardContent>
359
- </Card>
322
+ {show('privacy') && (
323
+ <Card id="privacy" className="scroll-mt-16">
324
+ <CardHeader>
325
+ <CardTitle>Privacy &amp; Consent</CardTitle>
326
+ <CardDescription>
327
+ Whether visitors must opt in before device fingerprinting and Google One Tap run
328
+ </CardDescription>
329
+ </CardHeader>
330
+ <CardContent className="space-y-4">
331
+ <SettingRow
332
+ id="consent-toggle"
333
+ label="Require consent (GDPR / ePrivacy)"
334
+ description="On: cookie banner where visitors allow fingerprinting and One Tap separately, and the device record is erased if fingerprint consent is withdrawn. Off: no banner, everything runs for every visitor."
335
+ note={!settings.consentRequired && (
336
+ <p className="text-sm text-amber-600 dark:text-amber-500">
337
+ Only turn this off if none of your users are in the EU, the UK or another region with
338
+ consent rules. Fingerprinting without consent breaks those laws.
339
+ </p>
340
+ )}
341
+ checked={settings.consentRequired ?? true}
342
+ state={rowState.consentRequired}
343
+ onChange={(v) => saveToggle('consentRequired', v)}
344
+ />
345
+ </CardContent>
346
+ </Card>
347
+ )}
348
+
349
+ {show('diagnostics') && (
350
+ <Card id="diagnostics" className="scroll-mt-16">
351
+ <CardHeader>
352
+ <CardTitle>Integrations &amp; Diagnostics</CardTitle>
353
+ <CardDescription>
354
+ Feedback reporting (applies when FEEDBACK_DISCORD_WEBHOOK_URL or FEEDBACK_EMAIL is set) and developer test tools
355
+ </CardDescription>
356
+ </CardHeader>
357
+ <CardContent className="space-y-4">
358
+ <SettingRow
359
+ id="feedback-errors-toggle"
360
+ label="Attach error details"
361
+ description="When a user reports a problem from an error, send the error message with their report, even if they edit it out of the text"
362
+ {...envProps(controlStatus.feedbackAttachErrors, settings.feedbackAttachErrors)}
363
+ checked={settings.feedbackAttachErrors}
364
+ state={rowState.feedbackAttachErrors}
365
+ onChange={(v) => saveToggle('feedbackAttachErrors', v)}
366
+ />
367
+ {process.env.NODE_ENV === "development" ? (
368
+ <FeedbackTestForm />
369
+ ) : (
370
+ <p className="text-sm text-muted-foreground">Error-pipeline test tools are available in development builds.</p>
371
+ )}
372
+ </CardContent>
373
+ </Card>
374
+ )}
360
375
  </div>
361
376
  )
362
377
  }
@@ -1,7 +1,8 @@
1
1
  import { getSystemSettings, getConfiguredAuthFlags, getControlStatuses, isConsentRequired } from "@xk2800/nextjs-template/settings/queries"
2
- import SystemSettingsForm from "./system-settings-form"
2
+ import SystemSettingsForm, { type SettingsSection } from "./system-settings-form"
3
3
 
4
- export default async function SystemSettingsSection() {
4
+ /** Admin settings page body. `sections` limits which parts show (default: all). */
5
+ export default async function SystemSettingsSection({ sections }: { sections?: SettingsSection[] } = {}) {
5
6
  const settings = await getSystemSettings()
6
7
  const configuredFlags = getConfiguredAuthFlags()
7
8
 
@@ -11,6 +12,7 @@ export default async function SystemSettingsSection() {
11
12
  initialSettings={{ ...settings, consentRequired: isConsentRequired(settings) }}
12
13
  configuredFlags={configuredFlags}
13
14
  controlStatus={getControlStatuses()}
15
+ sections={sections}
14
16
  />
15
17
  )
16
18
  }
@@ -43,8 +43,8 @@ declare const getCurrentSession: () => Promise<{
43
43
  image?: string | null | undefined | undefined;
44
44
  role: string | null | undefined;
45
45
  banned: boolean | null | undefined;
46
- banReason?: string | null | undefined;
47
46
  banExpires?: Date | null | undefined;
47
+ banReason?: string | null | undefined;
48
48
  twoFactorEnabled: boolean | null | undefined;
49
49
  };
50
50
  } | null>;
@@ -66,8 +66,8 @@ declare const requireAuth: () => Promise<{
66
66
  name: string;
67
67
  image?: string | null | undefined | undefined;
68
68
  banned: boolean | null | undefined;
69
- banReason?: string | null | undefined;
70
69
  banExpires?: Date | null | undefined;
70
+ banReason?: string | null | undefined;
71
71
  twoFactorEnabled: boolean | null | undefined;
72
72
  };
73
73
  session: {
@@ -96,8 +96,8 @@ declare function requireRole(requiredRole: 'user' | 'admin'): Promise<{
96
96
  name: string;
97
97
  image?: string | null | undefined | undefined;
98
98
  banned: boolean | null | undefined;
99
- banReason?: string | null | undefined;
100
99
  banExpires?: Date | null | undefined;
100
+ banReason?: string | null | undefined;
101
101
  twoFactorEnabled: boolean | null | undefined;
102
102
  };
103
103
  session: {
@@ -142,8 +142,8 @@ declare function requireAdminApi(): Promise<{
142
142
  image?: string | null | undefined | undefined;
143
143
  role: string | null | undefined;
144
144
  banned: boolean | null | undefined;
145
- banReason?: string | null | undefined;
146
145
  banExpires?: Date | null | undefined;
146
+ banReason?: string | null | undefined;
147
147
  twoFactorEnabled: boolean | null | undefined;
148
148
  };
149
149
  } | NextResponse<{
@@ -43,8 +43,8 @@ declare const getCurrentSession: () => Promise<{
43
43
  image?: string | null | undefined | undefined;
44
44
  role: string | null | undefined;
45
45
  banned: boolean | null | undefined;
46
- banReason?: string | null | undefined;
47
46
  banExpires?: Date | null | undefined;
47
+ banReason?: string | null | undefined;
48
48
  twoFactorEnabled: boolean | null | undefined;
49
49
  };
50
50
  } | null>;
@@ -66,8 +66,8 @@ declare const requireAuth: () => Promise<{
66
66
  name: string;
67
67
  image?: string | null | undefined | undefined;
68
68
  banned: boolean | null | undefined;
69
- banReason?: string | null | undefined;
70
69
  banExpires?: Date | null | undefined;
70
+ banReason?: string | null | undefined;
71
71
  twoFactorEnabled: boolean | null | undefined;
72
72
  };
73
73
  session: {
@@ -96,8 +96,8 @@ declare function requireRole(requiredRole: 'user' | 'admin'): Promise<{
96
96
  name: string;
97
97
  image?: string | null | undefined | undefined;
98
98
  banned: boolean | null | undefined;
99
- banReason?: string | null | undefined;
100
99
  banExpires?: Date | null | undefined;
100
+ banReason?: string | null | undefined;
101
101
  twoFactorEnabled: boolean | null | undefined;
102
102
  };
103
103
  session: {
@@ -142,8 +142,8 @@ declare function requireAdminApi(): Promise<{
142
142
  image?: string | null | undefined | undefined;
143
143
  role: string | null | undefined;
144
144
  banned: boolean | null | undefined;
145
- banReason?: string | null | undefined;
146
145
  banExpires?: Date | null | undefined;
146
+ banReason?: string | null | undefined;
147
147
  twoFactorEnabled: boolean | null | undefined;
148
148
  };
149
149
  } | NextResponse<{
@@ -826,7 +826,7 @@ declare const authClient: better_auth_react.ReactAuthClient<{
826
826
  $Infer: {
827
827
  body: {
828
828
  permissions: {
829
- readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "delete" | "set-password" | "set-email" | "set-phone" | "get" | "update")[] | undefined;
829
+ readonly user?: ("set-role" | "create" | "list" | "ban" | "impersonate" | "impersonate-admins" | "delete" | "set-password" | "set-email" | "set-phone" | "get" | "update")[] | undefined;
830
830
  readonly session?: ("list" | "delete" | "revoke")[] | undefined;
831
831
  };
832
832
  } & {
@@ -918,7 +918,7 @@ declare const authClient: better_auth_react.ReactAuthClient<{
918
918
  admin: {
919
919
  checkRolePermission: <R extends "user" | "admin">(data: {
920
920
  permissions: {
921
- readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "delete" | "set-password" | "set-email" | "set-phone" | "get" | "update")[] | undefined;
921
+ readonly user?: ("set-role" | "create" | "list" | "ban" | "impersonate" | "impersonate-admins" | "delete" | "set-password" | "set-email" | "set-phone" | "get" | "update")[] | undefined;
922
922
  readonly session?: ("list" | "delete" | "revoke")[] | undefined;
923
923
  };
924
924
  } & {
@@ -1767,8 +1767,8 @@ declare const useSession: () => {
1767
1767
  banned: boolean | null | undefined;
1768
1768
  } & {
1769
1769
  role?: string | null | undefined;
1770
- banReason?: string | null | undefined;
1771
1770
  banExpires?: Date | null | undefined;
1771
+ banReason?: string | null | undefined;
1772
1772
  } & {
1773
1773
  twoFactorEnabled: boolean | null | undefined;
1774
1774
  } & {}>;
@@ -1877,8 +1877,8 @@ declare const signIn: {
1877
1877
  banned: boolean | null | undefined;
1878
1878
  } & {
1879
1879
  role?: string | null | undefined;
1880
- banReason?: string | null | undefined;
1881
1880
  banExpires?: Date | null | undefined;
1881
+ banReason?: string | null | undefined;
1882
1882
  } & {
1883
1883
  twoFactorEnabled: boolean | null | undefined;
1884
1884
  } & {}>;
@@ -1925,8 +1925,8 @@ declare const signIn: {
1925
1925
  banned: boolean | null | undefined;
1926
1926
  } & {
1927
1927
  role?: string | null | undefined;
1928
- banReason?: string | null | undefined;
1929
1928
  banExpires?: Date | null | undefined;
1929
+ banReason?: string | null | undefined;
1930
1930
  } & {
1931
1931
  twoFactorEnabled: boolean | null | undefined;
1932
1932
  } & {}>;
@@ -2825,7 +2825,7 @@ declare const signUp: {
2825
2825
  $Infer: {
2826
2826
  body: {
2827
2827
  permissions: {
2828
- readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "delete" | "set-password" | "set-email" | "set-phone" | "get" | "update")[] | undefined;
2828
+ readonly user?: ("set-role" | "create" | "list" | "ban" | "impersonate" | "impersonate-admins" | "delete" | "set-password" | "set-email" | "set-phone" | "get" | "update")[] | undefined;
2829
2829
  readonly session?: ("list" | "delete" | "revoke")[] | undefined;
2830
2830
  };
2831
2831
  } & {
@@ -2917,7 +2917,7 @@ declare const signUp: {
2917
2917
  admin: {
2918
2918
  checkRolePermission: <R extends "user" | "admin">(data: {
2919
2919
  permissions: {
2920
- readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "delete" | "set-password" | "set-email" | "set-phone" | "get" | "update")[] | undefined;
2920
+ readonly user?: ("set-role" | "create" | "list" | "ban" | "impersonate" | "impersonate-admins" | "delete" | "set-password" | "set-email" | "set-phone" | "get" | "update")[] | undefined;
2921
2921
  readonly session?: ("list" | "delete" | "revoke")[] | undefined;
2922
2922
  };
2923
2923
  } & {
@@ -3843,8 +3843,8 @@ declare const signUp: {
3843
3843
  banned: boolean | null | undefined;
3844
3844
  } & {
3845
3845
  role?: string | null | undefined;
3846
- banReason?: string | null | undefined;
3847
3846
  banExpires?: Date | null | undefined;
3847
+ banReason?: string | null | undefined;
3848
3848
  } & {
3849
3849
  twoFactorEnabled: boolean | null | undefined;
3850
3850
  } & {}>;
@@ -3872,8 +3872,8 @@ declare const signUp: {
3872
3872
  banned: boolean | null | undefined;
3873
3873
  } & {
3874
3874
  role?: string | null | undefined;
3875
- banReason?: string | null | undefined;
3876
3875
  banExpires?: Date | null | undefined;
3876
+ banReason?: string | null | undefined;
3877
3877
  } & {
3878
3878
  twoFactorEnabled: boolean | null | undefined;
3879
3879
  } & {}>;
@@ -826,7 +826,7 @@ declare const authClient: better_auth_react.ReactAuthClient<{
826
826
  $Infer: {
827
827
  body: {
828
828
  permissions: {
829
- readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "delete" | "set-password" | "set-email" | "set-phone" | "get" | "update")[] | undefined;
829
+ readonly user?: ("set-role" | "create" | "list" | "ban" | "impersonate" | "impersonate-admins" | "delete" | "set-password" | "set-email" | "set-phone" | "get" | "update")[] | undefined;
830
830
  readonly session?: ("list" | "delete" | "revoke")[] | undefined;
831
831
  };
832
832
  } & {
@@ -918,7 +918,7 @@ declare const authClient: better_auth_react.ReactAuthClient<{
918
918
  admin: {
919
919
  checkRolePermission: <R extends "user" | "admin">(data: {
920
920
  permissions: {
921
- readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "delete" | "set-password" | "set-email" | "set-phone" | "get" | "update")[] | undefined;
921
+ readonly user?: ("set-role" | "create" | "list" | "ban" | "impersonate" | "impersonate-admins" | "delete" | "set-password" | "set-email" | "set-phone" | "get" | "update")[] | undefined;
922
922
  readonly session?: ("list" | "delete" | "revoke")[] | undefined;
923
923
  };
924
924
  } & {
@@ -1767,8 +1767,8 @@ declare const useSession: () => {
1767
1767
  banned: boolean | null | undefined;
1768
1768
  } & {
1769
1769
  role?: string | null | undefined;
1770
- banReason?: string | null | undefined;
1771
1770
  banExpires?: Date | null | undefined;
1771
+ banReason?: string | null | undefined;
1772
1772
  } & {
1773
1773
  twoFactorEnabled: boolean | null | undefined;
1774
1774
  } & {}>;
@@ -1877,8 +1877,8 @@ declare const signIn: {
1877
1877
  banned: boolean | null | undefined;
1878
1878
  } & {
1879
1879
  role?: string | null | undefined;
1880
- banReason?: string | null | undefined;
1881
1880
  banExpires?: Date | null | undefined;
1881
+ banReason?: string | null | undefined;
1882
1882
  } & {
1883
1883
  twoFactorEnabled: boolean | null | undefined;
1884
1884
  } & {}>;
@@ -1925,8 +1925,8 @@ declare const signIn: {
1925
1925
  banned: boolean | null | undefined;
1926
1926
  } & {
1927
1927
  role?: string | null | undefined;
1928
- banReason?: string | null | undefined;
1929
1928
  banExpires?: Date | null | undefined;
1929
+ banReason?: string | null | undefined;
1930
1930
  } & {
1931
1931
  twoFactorEnabled: boolean | null | undefined;
1932
1932
  } & {}>;
@@ -2825,7 +2825,7 @@ declare const signUp: {
2825
2825
  $Infer: {
2826
2826
  body: {
2827
2827
  permissions: {
2828
- readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "delete" | "set-password" | "set-email" | "set-phone" | "get" | "update")[] | undefined;
2828
+ readonly user?: ("set-role" | "create" | "list" | "ban" | "impersonate" | "impersonate-admins" | "delete" | "set-password" | "set-email" | "set-phone" | "get" | "update")[] | undefined;
2829
2829
  readonly session?: ("list" | "delete" | "revoke")[] | undefined;
2830
2830
  };
2831
2831
  } & {
@@ -2917,7 +2917,7 @@ declare const signUp: {
2917
2917
  admin: {
2918
2918
  checkRolePermission: <R extends "user" | "admin">(data: {
2919
2919
  permissions: {
2920
- readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "delete" | "set-password" | "set-email" | "set-phone" | "get" | "update")[] | undefined;
2920
+ readonly user?: ("set-role" | "create" | "list" | "ban" | "impersonate" | "impersonate-admins" | "delete" | "set-password" | "set-email" | "set-phone" | "get" | "update")[] | undefined;
2921
2921
  readonly session?: ("list" | "delete" | "revoke")[] | undefined;
2922
2922
  };
2923
2923
  } & {
@@ -3843,8 +3843,8 @@ declare const signUp: {
3843
3843
  banned: boolean | null | undefined;
3844
3844
  } & {
3845
3845
  role?: string | null | undefined;
3846
- banReason?: string | null | undefined;
3847
3846
  banExpires?: Date | null | undefined;
3847
+ banReason?: string | null | undefined;
3848
3848
  } & {
3849
3849
  twoFactorEnabled: boolean | null | undefined;
3850
3850
  } & {}>;
@@ -3872,8 +3872,8 @@ declare const signUp: {
3872
3872
  banned: boolean | null | undefined;
3873
3873
  } & {
3874
3874
  role?: string | null | undefined;
3875
- banReason?: string | null | undefined;
3876
3875
  banExpires?: Date | null | undefined;
3876
+ banReason?: string | null | undefined;
3877
3877
  } & {
3878
3878
  twoFactorEnabled: boolean | null | undefined;
3879
3879
  } & {}>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xk2800/nextjs-template",
3
- "version": "0.7.2-beta.11",
3
+ "version": "0.7.2-beta.12",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -45,7 +45,9 @@ try {
45
45
  outdated.push({ name, installed, wanted, dev, prefix });
46
46
  }
47
47
  }
48
- if (outdated.length) {
48
+ if (process.argv.includes('--json')) {
49
+ console.log(JSON.stringify(outdated)); // read by `create-nextjs upgrade`
50
+ } else if (outdated.length) {
49
51
  const rows = [['package', 'yours', 'template'], ...outdated.map((o) => [o.name, o.installed, o.wanted])];
50
52
  const [nameWidth, yoursWidth] = [0, 1].map((i) => Math.max(...rows.map((r) => r[i].length)));
51
53
  const commands = new Map();