@allbluecn/admin-app 0.3.8 → 0.5.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 (53) hide show
  1. package/package.json +3 -3
  2. package/src/components/admin/developer-log.tsx +2 -2
  3. package/src/components/dependency/dependency-table.tsx +21 -3
  4. package/src/components/invitations/invitations-page.tsx +16 -4
  5. package/src/components/knowledge/public/kp-crud-page.tsx +208 -0
  6. package/src/components/market/market-app-form.tsx +1 -1
  7. package/src/components/user/settings-profile.tsx +1 -1
  8. package/src/components/user/user-create-dialog.tsx +1 -1
  9. package/src/components/user/user-detail/user-detail-dialogs.tsx +9 -9
  10. package/src/paraglide/messages/_index.js +8 -8
  11. package/src/paraglide/messages/admin_invitations_filter_showdisabled1.js +30 -0
  12. package/src/paraglide/messages/admin_users_action_deactivate.js +30 -0
  13. package/src/paraglide/messages/admin_users_dialog_deactivate_confirm.js +30 -0
  14. package/src/paraglide/messages/admin_users_dialog_deactivate_description.js +30 -0
  15. package/src/paraglide/messages/admin_users_dialog_deactivate_placeholder.js +30 -0
  16. package/src/paraglide/messages/admin_users_dialog_deactivate_title.js +30 -0
  17. package/src/paraglide/messages/admin_users_toast_deactivatefailed1.js +30 -0
  18. package/src/paraglide/messages/admin_users_toast_userdeactivated1.js +30 -0
  19. package/src/routes/_nav/knowledge-public/bookmarks/route.lazy.tsx +36 -111
  20. package/src/routes/_nav/knowledge-public/compliance/route.lazy.tsx +29 -105
  21. package/src/routes/_nav/knowledge-public/legal/route.lazy.tsx +30 -108
  22. package/src/routes/_nav/monitoring/errors/route.lazy.tsx +1 -1
  23. package/src/routes/_nav/monitoring/logs/route.lazy.tsx +1 -1
  24. package/src/routes/_nav/monitoring/metrics/route.lazy.tsx +1 -1
  25. package/src/routes/_nav/permissions/route.lazy.tsx +1 -1
  26. package/src/routes/_nav/sso/route.lazy.tsx +1 -1
  27. package/src/routes/_nav/users/$userId/route.lazy.tsx +10 -10
  28. package/src/server/knowledge/public/kp-factory.ts +134 -0
  29. package/src/server/serverFns/dependency/sync.ts +2 -2
  30. package/src/server/serverFns/knowledge/public/bookmarks/create.ts +23 -25
  31. package/src/server/serverFns/knowledge/public/bookmarks/delete.ts +2 -14
  32. package/src/server/serverFns/knowledge/public/bookmarks/detail.ts +2 -11
  33. package/src/server/serverFns/knowledge/public/bookmarks/list.ts +32 -38
  34. package/src/server/serverFns/knowledge/public/bookmarks/update.ts +23 -22
  35. package/src/server/serverFns/knowledge/public/compliance/create.ts +10 -15
  36. package/src/server/serverFns/knowledge/public/compliance/delete.ts +2 -14
  37. package/src/server/serverFns/knowledge/public/compliance/detail.ts +2 -11
  38. package/src/server/serverFns/knowledge/public/compliance/list.ts +24 -31
  39. package/src/server/serverFns/knowledge/public/compliance/update.ts +22 -22
  40. package/src/server/serverFns/knowledge/public/legal/create.ts +11 -15
  41. package/src/server/serverFns/knowledge/public/legal/delete.ts +2 -14
  42. package/src/server/serverFns/knowledge/public/legal/detail.ts +2 -11
  43. package/src/server/serverFns/knowledge/public/legal/list.ts +24 -32
  44. package/src/server/serverFns/knowledge/public/legal/update.ts +20 -22
  45. package/src/server/serverFns/user/{delete.ts → deactivate.ts} +2 -2
  46. package/src/paraglide/messages/admin_users_dialog_delete_confirm.js +0 -30
  47. package/src/paraglide/messages/admin_users_dialog_delete_description.js +0 -30
  48. package/src/paraglide/messages/admin_users_dialog_delete_placeholder.js +0 -30
  49. package/src/paraglide/messages/admin_users_dialog_delete_title.js +0 -30
  50. package/src/paraglide/messages/admin_users_toast_deletefailed1.js +0 -30
  51. package/src/paraglide/messages/admin_users_toast_userdeleted1.js +0 -30
  52. package/src/paraglide/messages/common_button_cancel.js +0 -29
  53. package/src/paraglide/messages/common_dependency_table_pagination_total.js +0 -29
@@ -15,12 +15,11 @@
15
15
  // You should have received a copy of the GNU Affero General Public License
16
16
  // along with this program. If not, see <https://www.gnu.org/licenses/>.
17
17
 
18
+
18
19
  import { createServerFn } from '@tanstack/react-start'
19
20
  import { z } from 'zod'
20
- import { getPrisma } from '@allbluecn/database/get-prisma'
21
- import { Prisma } from '@allbluecn/database'
22
- import { requireAdmin } from '@/server/auth-helpers'
23
21
  import { complianceCanonicalId } from '@/server/knowledge/public/canonical-id'
22
+ import { kpUpdateHandler } from '@/server/knowledge/public/kp-factory'
24
23
 
25
24
  const updateSchema = z.object({
26
25
  id: z.string(),
@@ -38,22 +37,23 @@ const updateSchema = z.object({
38
37
 
39
38
  export const adminUpdateComplianceFn = createServerFn({ method: 'POST' })
40
39
  .validator(updateSchema)
41
- .handler(async ({ data }) => {
42
- const prisma = await getPrisma()
43
- await requireAdmin()
44
- const { id, code, ...rest } = data
45
- const existing = await prisma.industryCompliance.findUnique({ where: { id } })
46
- if (!existing) throw new Error('未找到')
47
- const updateData: Prisma.IndustryComplianceUncheckedUpdateInput = { ...rest }
48
- if (code !== undefined || data.title !== undefined) {
49
- // code 不落库(canonicalId = code || title):canonicalId !== title.trim() ⟺ 创建时
50
- // 提供了 code(canonicalId 即原 code)。只改 title 时必须回落旧 code 重算,
51
- // 否则 canonicalId 与 title/code 组合脱钩,破坏上游按 canonicalId 去重/同步的语义
52
- const existingCode = existing.canonicalId === existing.title.trim() ? undefined : existing.canonicalId
53
- updateData.canonicalId = complianceCanonicalId({
54
- title: data.title ?? existing.title,
55
- code: code ?? existingCode,
56
- })
57
- }
58
- return prisma.industryCompliance.update({ where: { id }, data: updateData, select: { id: true } })
59
- })
40
+ .handler(
41
+ kpUpdateHandler<z.infer<typeof updateSchema>>({
42
+ getDelegate: (prisma) => prisma.industryCompliance,
43
+ buildUpdateData: (data, existing) => {
44
+ const { id: _id, code, ...rest } = data
45
+ const updateData: Record<string, unknown> = { ...rest }
46
+ if (code !== undefined || data.title !== undefined) {
47
+ // code 不落库(canonicalId = code || title):canonicalId !== title.trim() ⟺ 创建时
48
+ // 提供了 code(canonicalId 即原 code)。只改 title 时必须回落旧 code 重算,
49
+ // 否则 canonicalId 与 title/code 组合脱钩,破坏上游按 canonicalId 去重/同步的语义
50
+ const existingCode = existing.canonicalId === existing.title.trim() ? undefined : existing.canonicalId
51
+ updateData.canonicalId = complianceCanonicalId({
52
+ title: data.title ?? existing.title,
53
+ code: code ?? existingCode,
54
+ })
55
+ }
56
+ return updateData
57
+ },
58
+ }),
59
+ )
@@ -17,9 +17,8 @@
17
17
 
18
18
  import { createServerFn } from '@tanstack/react-start'
19
19
  import { z } from 'zod'
20
- import { getPrisma } from '@allbluecn/database/get-prisma'
21
- import { requireAdmin, UnauthorizedError } from '@/server/auth-helpers'
22
20
  import { legalCanonicalId } from '@/server/knowledge/public/canonical-id'
21
+ import { kpCreateHandler } from '@/server/knowledge/public/kp-factory'
23
22
 
24
23
  const createSchema = z.object({
25
24
  title: z.string().min(1).max(200),
@@ -38,28 +37,25 @@ const createSchema = z.object({
38
37
 
39
38
  export const adminCreateLegalFn = createServerFn({ method: 'POST' })
40
39
  .validator(createSchema)
41
- .handler(async ({ data }) => {
42
- const prisma = await getPrisma()
43
- const session = await requireAdmin()
44
- const userId = session.user?.id
45
- if (!userId) throw new UnauthorizedError()
46
- return prisma.legalRegulation.create({
47
- data: {
40
+ .handler(
41
+ kpCreateHandler<z.infer<typeof createSchema>>({
42
+ getDelegate: (prisma) => prisma.legalRegulation,
43
+ buildData: (data, userId) => ({
48
44
  canonicalId: legalCanonicalId({ title: data.title, code: data.code }),
49
45
  title: data.title,
46
+ code: data.code ?? null,
50
47
  jurisdiction: data.jurisdiction,
51
48
  region: data.region || null,
52
49
  country: data.country || null,
53
50
  category: data.category,
54
51
  issuingAuthority: data.issuingAuthority || null,
55
52
  effectiveDate: data.effectiveDate ?? null,
56
- summary: data.summary || null,
57
- content: data.content || null,
53
+ summary: data.summary ?? null,
54
+ content: data.content ?? null,
58
55
  sourceUrl: data.sourceUrl || null,
59
56
  tags: data.tags,
60
57
  visibility: 'public',
61
58
  userId,
62
- },
63
- select: { id: true },
64
- })
65
- })
59
+ }),
60
+ }),
61
+ )
@@ -17,20 +17,8 @@
17
17
 
18
18
  import { createServerFn } from '@tanstack/react-start'
19
19
  import { z } from 'zod'
20
- import { getPrisma } from '@allbluecn/database/get-prisma'
21
- import { requireAdmin } from '@/server/auth-helpers'
20
+ import { kpDeleteHandler } from '@/server/knowledge/public/kp-factory'
22
21
 
23
22
  export const adminDeleteLegalFn = createServerFn({ method: 'POST' })
24
23
  .validator(z.object({ id: z.string() }))
25
- .handler(async ({ data }) => {
26
- const prisma = await getPrisma()
27
- await requireAdmin()
28
- // 直接软删,不存在由 P2025 转错误(省一次 findUnique 往返)
29
- try {
30
- await prisma.legalRegulation.update({ where: { id: data.id }, data: { isDeleted: true } })
31
- } catch (e) {
32
- if ((e as { code?: string }).code === 'P2025') throw new Error('未找到')
33
- throw e
34
- }
35
- return { success: true }
36
- })
24
+ .handler(kpDeleteHandler((prisma) => prisma.legalRegulation))
@@ -17,17 +17,8 @@
17
17
 
18
18
  import { createServerFn } from '@tanstack/react-start'
19
19
  import { z } from 'zod'
20
- import { getPrisma } from '@allbluecn/database/get-prisma'
21
- import { requireAdmin } from '@/server/auth-helpers'
20
+ import { kpDetailHandler } from '@/server/knowledge/public/kp-factory'
22
21
 
23
22
  export const adminGetLegalDetailFn = createServerFn({ method: 'GET' })
24
23
  .validator(z.object({ id: z.string() }))
25
- .handler(async ({ data }) => {
26
- const prisma = await getPrisma()
27
- await requireAdmin()
28
- const item = await prisma.legalRegulation.findFirst({
29
- where: { id: data.id, visibility: 'public', isDeleted: false },
30
- })
31
- if (!item) throw new Error('未找到')
32
- return item
33
- })
24
+ .handler(kpDetailHandler((prisma) => prisma.legalRegulation))
@@ -15,11 +15,10 @@
15
15
  // You should have received a copy of the GNU Affero General Public License
16
16
  // along with this program. If not, see <https://www.gnu.org/licenses/>.
17
17
 
18
+
18
19
  import { createServerFn } from '@tanstack/react-start'
19
20
  import { z } from 'zod'
20
- import { getPrisma } from '@allbluecn/database/get-prisma'
21
- import { Prisma } from '@allbluecn/database'
22
- import { requireAdmin } from '@/server/auth-helpers'
21
+ import { kpListHandler } from '@/server/knowledge/public/kp-factory'
23
22
 
24
23
  const listSchema = z.object({
25
24
  search: z.string().optional(),
@@ -31,32 +30,25 @@ const listSchema = z.object({
31
30
 
32
31
  export const adminListLegalFn = createServerFn({ method: 'GET' })
33
32
  .validator(listSchema)
34
- .handler(async ({ data }) => {
35
- const prisma = await getPrisma()
36
- await requireAdmin()
37
- const where: Prisma.LegalRegulationWhereInput = { visibility: 'public', isDeleted: false }
38
- if (data.search) {
39
- where.OR = [
40
- { title: { contains: data.search, mode: 'insensitive' } },
41
- { summary: { contains: data.search, mode: 'insensitive' } },
42
- ]
43
- }
44
- if (data.jurisdiction) where.jurisdiction = data.jurisdiction
45
- if (data.category) where.category = data.category
46
- const [items, total] = await Promise.all([
47
- prisma.legalRegulation.findMany({
48
- where,
49
- select: {
50
- id: true, canonicalId: true, title: true, jurisdiction: true,
51
- region: true, country: true, category: true, summary: true,
52
- issuingAuthority: true, effectiveDate: true, sourceUrl: true,
53
- tags: true, visibility: true, userId: true, createdAt: true,
54
- },
55
- orderBy: { createdAt: 'desc' },
56
- skip: (data.page - 1) * data.pageSize,
57
- take: data.pageSize,
58
- }),
59
- prisma.legalRegulation.count({ where }),
60
- ])
61
- return { items, total, page: data.page, pageSize: data.pageSize }
62
- })
33
+ .handler(
34
+ kpListHandler<z.infer<typeof listSchema>>({
35
+ getDelegate: (prisma) => prisma.legalRegulation,
36
+ buildWhere: (data) => {
37
+ const where: Record<string, unknown> = {}
38
+ if (data.search) {
39
+ where.OR = [
40
+ { title: { contains: data.search, mode: 'insensitive' } },
41
+ { summary: { contains: data.search, mode: 'insensitive' } },
42
+ ]
43
+ }
44
+ if (data.jurisdiction) where.jurisdiction = data.jurisdiction
45
+ if (data.category) where.category = data.category
46
+ return where
47
+ },
48
+ select: {
49
+ id: true, canonicalId: true, title: true, jurisdiction: true,
50
+ category: true, country: true, issuingAuthority: true, effectiveDate: true,
51
+ summary: true, sourceUrl: true, tags: true, visibility: true, userId: true, createdAt: true,
52
+ },
53
+ }),
54
+ )
@@ -15,12 +15,11 @@
15
15
  // You should have received a copy of the GNU Affero General Public License
16
16
  // along with this program. If not, see <https://www.gnu.org/licenses/>.
17
17
 
18
+
18
19
  import { createServerFn } from '@tanstack/react-start'
19
20
  import { z } from 'zod'
20
- import { getPrisma } from '@allbluecn/database/get-prisma'
21
- import { Prisma } from '@allbluecn/database'
22
- import { requireAdmin } from '@/server/auth-helpers'
23
21
  import { legalCanonicalId } from '@/server/knowledge/public/canonical-id'
22
+ import { kpUpdateHandler } from '@/server/knowledge/public/kp-factory'
24
23
 
25
24
  const updateSchema = z.object({
26
25
  id: z.string(),
@@ -40,22 +39,21 @@ const updateSchema = z.object({
40
39
 
41
40
  export const adminUpdateLegalFn = createServerFn({ method: 'POST' })
42
41
  .validator(updateSchema)
43
- .handler(async ({ data }) => {
44
- const prisma = await getPrisma()
45
- await requireAdmin()
46
- const { id, code, ...rest } = data
47
- const existing = await prisma.legalRegulation.findUnique({ where: { id } })
48
- if (!existing) throw new Error('未找到')
49
- const updateData: Prisma.LegalRegulationUncheckedUpdateInput = { ...rest }
50
- if (code !== undefined || data.title !== undefined) {
51
- // code 不落库(canonicalId = code || title):canonicalId !== title.trim() ⟺ 创建时
52
- // 提供了 code(canonicalId 即原 code)。只改 title 时必须回落旧 code 重算,
53
- // 否则 canonicalId 与 title/code 组合脱钩,破坏上游按 canonicalId 去重/同步的语义
54
- const existingCode = existing.canonicalId === existing.title.trim() ? undefined : existing.canonicalId
55
- updateData.canonicalId = legalCanonicalId({
56
- title: data.title ?? existing.title,
57
- code: code ?? existingCode,
58
- })
59
- }
60
- return prisma.legalRegulation.update({ where: { id }, data: updateData, select: { id: true } })
61
- })
42
+ .handler(
43
+ kpUpdateHandler<z.infer<typeof updateSchema>>({
44
+ getDelegate: (prisma) => prisma.legalRegulation,
45
+ buildUpdateData: (data, existing) => {
46
+ const { id: _id, code, ...rest } = data
47
+ const updateData: Record<string, unknown> = { ...rest }
48
+ if (code !== undefined || data.title !== undefined) {
49
+ // 同 compliance:只改 title 时回落旧 code 重算(code 不落库)
50
+ const existingCode = existing.canonicalId === existing.title.trim() ? undefined : existing.canonicalId
51
+ updateData.canonicalId = legalCanonicalId({
52
+ title: data.title ?? existing.title,
53
+ code: code ?? existingCode,
54
+ })
55
+ }
56
+ return updateData
57
+ },
58
+ }),
59
+ )
@@ -20,11 +20,11 @@ import { z } from 'zod'
20
20
  import { requireAdmin } from '@/server/auth-helpers'
21
21
  import { updateUserGuarded } from '@/server/user-admin-guard'
22
22
 
23
- export const deleteUserFn = createServerFn({ method: 'POST' })
23
+ export const deactivateUserFn = createServerFn({ method: 'POST' })
24
24
  .validator(z.object({ userId: z.string() }))
25
25
  .handler(async ({ data }) => {
26
26
  const session = await requireAdmin()
27
- // 自保护:不能停用自己的账号(软删语义,误操作即自锁)
27
+ // 自保护:不能停用自己的账号(软停用语义,误操作即自锁)
28
28
  if (data.userId === session.user?.id) throw new Error('不能停用自己的账号')
29
29
  // 软删 = INACTIVE:同受「不得触碰超管 / 不得清空最后一名启用超管」约束
30
30
  return updateUserGuarded(session.user?.role, data.userId, { status: 'INACTIVE' }, (tx) =>
@@ -1,30 +0,0 @@
1
- /* eslint-disable */
2
- import { getLocale, experimentalStaticLocale } from '../runtime.js';
3
-
4
- /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
5
-
6
- /** @typedef {{}} Admin_Users_Dialog_Delete_ConfirmInputs */
7
-
8
- const zh_admin_users_dialog_delete_confirm = /** @type {(inputs: Admin_Users_Dialog_Delete_ConfirmInputs) => LocalizedString} */ () => {
9
- return /** @type {LocalizedString} */ (`确认删除`)
10
- };
11
-
12
- const en_admin_users_dialog_delete_confirm = /** @type {(inputs: Admin_Users_Dialog_Delete_ConfirmInputs) => LocalizedString} */ () => {
13
- return /** @type {LocalizedString} */ (`Confirm Delete`)
14
- };
15
-
16
- /**
17
- * | output |
18
- * | --- |
19
- * | "Confirm Delete" |
20
- *
21
- * @param {Admin_Users_Dialog_Delete_ConfirmInputs} inputs
22
- * @param {{ locale?: "zh" | "en" }} options
23
- * @returns {LocalizedString}
24
- */
25
- const admin_users_dialog_delete_confirm = /** @type {((inputs?: Admin_Users_Dialog_Delete_ConfirmInputs, options?: { locale?: "zh" | "en" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Admin_Users_Dialog_Delete_ConfirmInputs, { locale?: "zh" | "en" }, {}>} */ ((inputs = {}, options = {}) => {
26
- const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
27
- if (locale === "en") return en_admin_users_dialog_delete_confirm(inputs)
28
- return zh_admin_users_dialog_delete_confirm(inputs)
29
- });
30
- export { admin_users_dialog_delete_confirm as "admin-users_dialog_delete_confirm" }
@@ -1,30 +0,0 @@
1
- /* eslint-disable */
2
- import { getLocale, experimentalStaticLocale } from '../runtime.js';
3
-
4
- /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
5
-
6
- /** @typedef {{ username: NonNullable<unknown> }} Admin_Users_Dialog_Delete_DescriptionInputs */
7
-
8
- const zh_admin_users_dialog_delete_description = /** @type {(inputs: Admin_Users_Dialog_Delete_DescriptionInputs) => LocalizedString} */ (i) => {
9
- return /** @type {LocalizedString} */ (`此操作不可撤销。将删除用户 <strong>${i?.username}</strong> 及其所有关联数据。请输入用户名 <strong>${i?.username}</strong> 以确认。`)
10
- };
11
-
12
- const en_admin_users_dialog_delete_description = /** @type {(inputs: Admin_Users_Dialog_Delete_DescriptionInputs) => LocalizedString} */ (i) => {
13
- return /** @type {LocalizedString} */ (`This action cannot be undone. This will delete user <strong>${i?.username}</strong> and all associated data. Please enter <strong>${i?.username}</strong> to confirm.`)
14
- };
15
-
16
- /**
17
- * | output |
18
- * | --- |
19
- * | "This action cannot be undone. This will delete user <strong>{username}</strong> and all associated data. Please enter <strong>{username}</strong> to confirm." |
20
- *
21
- * @param {Admin_Users_Dialog_Delete_DescriptionInputs} inputs
22
- * @param {{ locale?: "zh" | "en" }} options
23
- * @returns {LocalizedString}
24
- */
25
- const admin_users_dialog_delete_description = /** @type {((inputs: Admin_Users_Dialog_Delete_DescriptionInputs, options?: { locale?: "zh" | "en" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Admin_Users_Dialog_Delete_DescriptionInputs, { locale?: "zh" | "en" }, {}>} */ ((inputs, options = {}) => {
26
- const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
27
- if (locale === "en") return en_admin_users_dialog_delete_description(inputs)
28
- return zh_admin_users_dialog_delete_description(inputs)
29
- });
30
- export { admin_users_dialog_delete_description as "admin-users_dialog_delete_description" }
@@ -1,30 +0,0 @@
1
- /* eslint-disable */
2
- import { getLocale, experimentalStaticLocale } from '../runtime.js';
3
-
4
- /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
5
-
6
- /** @typedef {{}} Admin_Users_Dialog_Delete_PlaceholderInputs */
7
-
8
- const zh_admin_users_dialog_delete_placeholder = /** @type {(inputs: Admin_Users_Dialog_Delete_PlaceholderInputs) => LocalizedString} */ () => {
9
- return /** @type {LocalizedString} */ (`输入用户名确认`)
10
- };
11
-
12
- const en_admin_users_dialog_delete_placeholder = /** @type {(inputs: Admin_Users_Dialog_Delete_PlaceholderInputs) => LocalizedString} */ () => {
13
- return /** @type {LocalizedString} */ (`Enter username to confirm`)
14
- };
15
-
16
- /**
17
- * | output |
18
- * | --- |
19
- * | "Enter username to confirm" |
20
- *
21
- * @param {Admin_Users_Dialog_Delete_PlaceholderInputs} inputs
22
- * @param {{ locale?: "zh" | "en" }} options
23
- * @returns {LocalizedString}
24
- */
25
- const admin_users_dialog_delete_placeholder = /** @type {((inputs?: Admin_Users_Dialog_Delete_PlaceholderInputs, options?: { locale?: "zh" | "en" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Admin_Users_Dialog_Delete_PlaceholderInputs, { locale?: "zh" | "en" }, {}>} */ ((inputs = {}, options = {}) => {
26
- const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
27
- if (locale === "en") return en_admin_users_dialog_delete_placeholder(inputs)
28
- return zh_admin_users_dialog_delete_placeholder(inputs)
29
- });
30
- export { admin_users_dialog_delete_placeholder as "admin-users_dialog_delete_placeholder" }
@@ -1,30 +0,0 @@
1
- /* eslint-disable */
2
- import { getLocale, experimentalStaticLocale } from '../runtime.js';
3
-
4
- /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
5
-
6
- /** @typedef {{}} Admin_Users_Dialog_Delete_TitleInputs */
7
-
8
- const zh_admin_users_dialog_delete_title = /** @type {(inputs: Admin_Users_Dialog_Delete_TitleInputs) => LocalizedString} */ () => {
9
- return /** @type {LocalizedString} */ (`确认删除用户`)
10
- };
11
-
12
- const en_admin_users_dialog_delete_title = /** @type {(inputs: Admin_Users_Dialog_Delete_TitleInputs) => LocalizedString} */ () => {
13
- return /** @type {LocalizedString} */ (`Confirm Delete User`)
14
- };
15
-
16
- /**
17
- * | output |
18
- * | --- |
19
- * | "Confirm Delete User" |
20
- *
21
- * @param {Admin_Users_Dialog_Delete_TitleInputs} inputs
22
- * @param {{ locale?: "zh" | "en" }} options
23
- * @returns {LocalizedString}
24
- */
25
- const admin_users_dialog_delete_title = /** @type {((inputs?: Admin_Users_Dialog_Delete_TitleInputs, options?: { locale?: "zh" | "en" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Admin_Users_Dialog_Delete_TitleInputs, { locale?: "zh" | "en" }, {}>} */ ((inputs = {}, options = {}) => {
26
- const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
27
- if (locale === "en") return en_admin_users_dialog_delete_title(inputs)
28
- return zh_admin_users_dialog_delete_title(inputs)
29
- });
30
- export { admin_users_dialog_delete_title as "admin-users_dialog_delete_title" }
@@ -1,30 +0,0 @@
1
- /* eslint-disable */
2
- import { getLocale, experimentalStaticLocale } from '../runtime.js';
3
-
4
- /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
5
-
6
- /** @typedef {{}} Admin_Users_Toast_Deletefailed1Inputs */
7
-
8
- const zh_admin_users_toast_deletefailed1 = /** @type {(inputs: Admin_Users_Toast_Deletefailed1Inputs) => LocalizedString} */ () => {
9
- return /** @type {LocalizedString} */ (`删除失败`)
10
- };
11
-
12
- const en_admin_users_toast_deletefailed1 = /** @type {(inputs: Admin_Users_Toast_Deletefailed1Inputs) => LocalizedString} */ () => {
13
- return /** @type {LocalizedString} */ (`Deletion failed`)
14
- };
15
-
16
- /**
17
- * | output |
18
- * | --- |
19
- * | "Deletion failed" |
20
- *
21
- * @param {Admin_Users_Toast_Deletefailed1Inputs} inputs
22
- * @param {{ locale?: "zh" | "en" }} options
23
- * @returns {LocalizedString}
24
- */
25
- const admin_users_toast_deletefailed1 = /** @type {((inputs?: Admin_Users_Toast_Deletefailed1Inputs, options?: { locale?: "zh" | "en" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Admin_Users_Toast_Deletefailed1Inputs, { locale?: "zh" | "en" }, {}>} */ ((inputs = {}, options = {}) => {
26
- const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
27
- if (locale === "en") return en_admin_users_toast_deletefailed1(inputs)
28
- return zh_admin_users_toast_deletefailed1(inputs)
29
- });
30
- export { admin_users_toast_deletefailed1 as "admin-users_toast_deleteFailed" }
@@ -1,30 +0,0 @@
1
- /* eslint-disable */
2
- import { getLocale, experimentalStaticLocale } from '../runtime.js';
3
-
4
- /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
5
-
6
- /** @typedef {{}} Admin_Users_Toast_Userdeleted1Inputs */
7
-
8
- const zh_admin_users_toast_userdeleted1 = /** @type {(inputs: Admin_Users_Toast_Userdeleted1Inputs) => LocalizedString} */ () => {
9
- return /** @type {LocalizedString} */ (`用户已删除`)
10
- };
11
-
12
- const en_admin_users_toast_userdeleted1 = /** @type {(inputs: Admin_Users_Toast_Userdeleted1Inputs) => LocalizedString} */ () => {
13
- return /** @type {LocalizedString} */ (`User deleted`)
14
- };
15
-
16
- /**
17
- * | output |
18
- * | --- |
19
- * | "User deleted" |
20
- *
21
- * @param {Admin_Users_Toast_Userdeleted1Inputs} inputs
22
- * @param {{ locale?: "zh" | "en" }} options
23
- * @returns {LocalizedString}
24
- */
25
- const admin_users_toast_userdeleted1 = /** @type {((inputs?: Admin_Users_Toast_Userdeleted1Inputs, options?: { locale?: "zh" | "en" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Admin_Users_Toast_Userdeleted1Inputs, { locale?: "zh" | "en" }, {}>} */ ((inputs = {}, options = {}) => {
26
- const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
27
- if (locale === "en") return en_admin_users_toast_userdeleted1(inputs)
28
- return zh_admin_users_toast_userdeleted1(inputs)
29
- });
30
- export { admin_users_toast_userdeleted1 as "admin-users_toast_userDeleted" }
@@ -1,29 +0,0 @@
1
- /* eslint-disable */
2
- import { getLocale, experimentalStaticLocale } from '../runtime.js';
3
-
4
- /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
5
-
6
- /** @typedef {{}} Common_Button_CancelInputs */
7
-
8
- const zh_common_button_cancel = /** @type {(inputs: Common_Button_CancelInputs) => LocalizedString} */ () => {
9
- return /** @type {LocalizedString} */ (`取消`)
10
- };
11
-
12
- const en_common_button_cancel = /** @type {(inputs: Common_Button_CancelInputs) => LocalizedString} */ () => {
13
- return /** @type {LocalizedString} */ (`Cancel`)
14
- };
15
-
16
- /**
17
- * | output |
18
- * | --- |
19
- * | "Cancel" |
20
- *
21
- * @param {Common_Button_CancelInputs} inputs
22
- * @param {{ locale?: "zh" | "en" }} options
23
- * @returns {LocalizedString}
24
- */
25
- export const common_button_cancel = /** @type {((inputs?: Common_Button_CancelInputs, options?: { locale?: "zh" | "en" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Common_Button_CancelInputs, { locale?: "zh" | "en" }, {}>} */ ((inputs = {}, options = {}) => {
26
- const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
27
- if (locale === "en") return en_common_button_cancel(inputs)
28
- return zh_common_button_cancel(inputs)
29
- });
@@ -1,29 +0,0 @@
1
- /* eslint-disable */
2
- import { getLocale, experimentalStaticLocale } from '../runtime.js';
3
-
4
- /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
5
-
6
- /** @typedef {{ total: NonNullable<unknown>, page: NonNullable<unknown>, totalPages: NonNullable<unknown> }} Common_Dependency_Table_Pagination_TotalInputs */
7
-
8
- const zh_common_dependency_table_pagination_total = /** @type {(inputs: Common_Dependency_Table_Pagination_TotalInputs) => LocalizedString} */ (i) => {
9
- return /** @type {LocalizedString} */ (`共 ${i?.total} 条,第 ${i?.page}/${i?.totalPages} 页`)
10
- };
11
-
12
- const en_common_dependency_table_pagination_total = /** @type {(inputs: Common_Dependency_Table_Pagination_TotalInputs) => LocalizedString} */ (i) => {
13
- return /** @type {LocalizedString} */ (`${i?.total} total, page ${i?.page}/${i?.totalPages}`)
14
- };
15
-
16
- /**
17
- * | output |
18
- * | --- |
19
- * | "{total} total, page {page}/{totalPages}" |
20
- *
21
- * @param {Common_Dependency_Table_Pagination_TotalInputs} inputs
22
- * @param {{ locale?: "zh" | "en" }} options
23
- * @returns {LocalizedString}
24
- */
25
- export const common_dependency_table_pagination_total = /** @type {((inputs: Common_Dependency_Table_Pagination_TotalInputs, options?: { locale?: "zh" | "en" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Common_Dependency_Table_Pagination_TotalInputs, { locale?: "zh" | "en" }, {}>} */ ((inputs, options = {}) => {
26
- const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
27
- if (locale === "en") return en_common_dependency_table_pagination_total(inputs)
28
- return zh_common_dependency_table_pagination_total(inputs)
29
- });