@vitnode/blog 1.2.0-canary.10 → 1.2.0-canary.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.
- package/package.json +19 -5
- package/dist/src/api/modules/categories/categories.module.d.ts +0 -343
- package/dist/src/api/modules/categories/categories.module.d.ts.map +0 -1
- package/dist/src/api/modules/categories/categories.module.js +0 -1
- package/dist/src/api/modules/categories/routes/create.route.d.ts +0 -79
- package/dist/src/api/modules/categories/routes/create.route.d.ts.map +0 -1
- package/dist/src/api/modules/categories/routes/create.route.js +0 -1
- package/dist/src/api/modules/categories/routes/delete.route.d.ts +0 -40
- package/dist/src/api/modules/categories/routes/delete.route.d.ts.map +0 -1
- package/dist/src/api/modules/categories/routes/delete.route.js +0 -1
- package/dist/src/api/modules/categories/routes/edit.route.d.ts +0 -100
- package/dist/src/api/modules/categories/routes/edit.route.d.ts.map +0 -1
- package/dist/src/api/modules/categories/routes/edit.route.js +0 -1
- package/dist/src/api/modules/categories/routes/get.route.d.ts +0 -148
- package/dist/src/api/modules/categories/routes/get.route.d.ts.map +0 -1
- package/dist/src/api/modules/categories/routes/get.route.js +0 -1
- package/dist/src/api/modules/categories/utils/generate-unique-title-seo.d.ts +0 -1
- package/dist/src/api/modules/categories/utils/generate-unique-title-seo.d.ts.map +0 -1
- package/dist/src/app_admin/blog/categories/page.d.ts +0 -5
- package/dist/src/app_admin/blog/categories/page.d.ts.map +0 -1
- package/dist/src/app_admin/blog/categories/page.js +0 -1
- package/dist/src/config.api.d.ts +0 -2
- package/dist/src/config.api.d.ts.map +0 -1
- package/dist/src/config.api.js +0 -1
- package/dist/src/config.d.ts +0 -4
- package/dist/src/config.d.ts.map +0 -1
- package/dist/src/config.js +0 -1
- package/dist/src/database/categories.d.ts +0 -97
- package/dist/src/database/categories.d.ts.map +0 -1
- package/dist/src/database/categories.js +0 -1
- package/dist/src/plugin.d.ts +0 -2
- package/dist/src/plugin.d.ts.map +0 -1
- package/dist/src/plugin.js +0 -1
- package/dist/src/views/admin/categories/actions/actions.d.ts +0 -2
- package/dist/src/views/admin/categories/actions/actions.d.ts.map +0 -1
- package/dist/src/views/admin/categories/actions/actions.js +0 -1
- package/dist/src/views/admin/categories/actions/create/create-edit.d.ts +0 -2
- package/dist/src/views/admin/categories/actions/create/create-edit.d.ts.map +0 -1
- package/dist/src/views/admin/categories/actions/create/create.d.ts +0 -1
- package/dist/src/views/admin/categories/actions/create/create.d.ts.map +0 -1
- package/dist/src/views/admin/categories/actions/create-edit/create-edit.d.ts +0 -8
- package/dist/src/views/admin/categories/actions/create-edit/create-edit.d.ts.map +0 -1
- package/dist/src/views/admin/categories/actions/create-edit/create-edit.js +0 -1
- package/dist/src/views/admin/categories/actions/create-edit/create-mutation-api.d.ts +0 -6
- package/dist/src/views/admin/categories/actions/create-edit/create-mutation-api.d.ts.map +0 -1
- package/dist/src/views/admin/categories/actions/create-edit/mutation-api.d.ts +0 -11
- package/dist/src/views/admin/categories/actions/create-edit/mutation-api.d.ts.map +0 -1
- package/dist/src/views/admin/categories/actions/create-edit/mutation-api.js +0 -1
- package/dist/src/views/admin/categories/actions/create-edit.d.ts +0 -2
- package/dist/src/views/admin/categories/actions/create-edit.d.ts.map +0 -1
- package/dist/src/views/admin/categories/actions.d.ts +0 -2
- package/dist/src/views/admin/categories/actions.d.ts.map +0 -1
- package/dist/src/views/admin/categories/categories-admin-view.d.ts +0 -4
- package/dist/src/views/admin/categories/categories-admin-view.d.ts.map +0 -1
- package/dist/src/views/admin/categories/categories-admin-view.js +0 -1
- package/dist/src/views/admin/categories/row-actions/delete/delete-action.d.ts +0 -5
- package/dist/src/views/admin/categories/row-actions/delete/delete-action.d.ts.map +0 -1
- package/dist/src/views/admin/categories/row-actions/delete/delete-action.js +0 -1
- package/dist/src/views/admin/categories/row-actions/delete/mutation-api.d.ts +0 -4
- package/dist/src/views/admin/categories/row-actions/delete/mutation-api.d.ts.map +0 -1
- package/dist/src/views/admin/categories/row-actions/delete/mutation-api.js +0 -1
- package/dist/src/views/admin/categories/row-actions/edit-action.d.ts +0 -9
- package/dist/src/views/admin/categories/row-actions/edit-action.d.ts.map +0 -1
- package/dist/src/views/admin/categories/row-actions/edit-action.js +0 -1
- package/dist/src/views/admin/categories/row-actions/mutation-api.d.ts +0 -4
- package/dist/src/views/admin/categories/row-actions/mutation-api.d.ts.map +0 -1
- package/dist/src/views/admin/categories/row-actions/row-actions.d.ts +0 -3
- package/dist/src/views/admin/categories/row-actions/row-actions.d.ts.map +0 -1
- package/dist/src/views/admin/categories-admin-view.d.ts +0 -4
- package/dist/src/views/admin/categories-admin-view.d.ts.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { z } from '@hono/zod-openapi';
|
|
2
|
-
export declare const categoriesRoute: {
|
|
3
|
-
handler: (c: import("hono").Context<import("@vitnode/core/api/middlewares/global/global").EnvVitNode, "/", {
|
|
4
|
-
in: {
|
|
5
|
-
query: {
|
|
6
|
-
cursor?: string | undefined;
|
|
7
|
-
first?: string | undefined;
|
|
8
|
-
last?: string | undefined;
|
|
9
|
-
order?: "asc" | "desc" | undefined;
|
|
10
|
-
orderBy?: "updatedAt" | undefined;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
out: {
|
|
14
|
-
query: {
|
|
15
|
-
cursor?: string | undefined;
|
|
16
|
-
first?: string | undefined;
|
|
17
|
-
last?: string | undefined;
|
|
18
|
-
order?: "asc" | "desc" | undefined;
|
|
19
|
-
orderBy?: "updatedAt" | undefined;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
}>) => Promise<Response & import("hono").TypedResponse<{
|
|
23
|
-
edges: {
|
|
24
|
-
id: number;
|
|
25
|
-
title: string;
|
|
26
|
-
createdAt: string;
|
|
27
|
-
updatedAt: string;
|
|
28
|
-
titleSeo: string;
|
|
29
|
-
}[];
|
|
30
|
-
pageInfo: {
|
|
31
|
-
count: number;
|
|
32
|
-
endCursor: null | number;
|
|
33
|
-
hasNextPage: boolean;
|
|
34
|
-
hasPreviousPage: boolean;
|
|
35
|
-
startCursor: null | number;
|
|
36
|
-
totalCount: number;
|
|
37
|
-
};
|
|
38
|
-
}, 200, "json">>;
|
|
39
|
-
pluginId: "@vitnode/blog";
|
|
40
|
-
route: {
|
|
41
|
-
method: "get";
|
|
42
|
-
path: "/";
|
|
43
|
-
request: {
|
|
44
|
-
query: z.ZodObject<{
|
|
45
|
-
cursor: z.ZodOptional<z.ZodString>;
|
|
46
|
-
first: z.ZodOptional<z.ZodString>;
|
|
47
|
-
last: z.ZodOptional<z.ZodString>;
|
|
48
|
-
} & {
|
|
49
|
-
order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
50
|
-
orderBy: z.ZodOptional<z.ZodEnum<["updatedAt"]>>;
|
|
51
|
-
}, "strip", z.ZodTypeAny, {
|
|
52
|
-
cursor?: string | undefined;
|
|
53
|
-
first?: string | undefined;
|
|
54
|
-
last?: string | undefined;
|
|
55
|
-
order?: "asc" | "desc" | undefined;
|
|
56
|
-
orderBy?: "updatedAt" | undefined;
|
|
57
|
-
}, {
|
|
58
|
-
cursor?: string | undefined;
|
|
59
|
-
first?: string | undefined;
|
|
60
|
-
last?: string | undefined;
|
|
61
|
-
order?: "asc" | "desc" | undefined;
|
|
62
|
-
orderBy?: "updatedAt" | undefined;
|
|
63
|
-
}>;
|
|
64
|
-
};
|
|
65
|
-
responses: {
|
|
66
|
-
200: {
|
|
67
|
-
content: {
|
|
68
|
-
'application/json': {
|
|
69
|
-
schema: z.ZodObject<{
|
|
70
|
-
edges: z.ZodArray<z.ZodObject<{
|
|
71
|
-
id: z.ZodNumber;
|
|
72
|
-
title: z.ZodString;
|
|
73
|
-
createdAt: z.ZodDate;
|
|
74
|
-
updatedAt: z.ZodDate;
|
|
75
|
-
}, "strip", z.ZodTypeAny, {
|
|
76
|
-
id: number;
|
|
77
|
-
title: string;
|
|
78
|
-
createdAt: Date;
|
|
79
|
-
updatedAt: Date;
|
|
80
|
-
}, {
|
|
81
|
-
id: number;
|
|
82
|
-
title: string;
|
|
83
|
-
createdAt: Date;
|
|
84
|
-
updatedAt: Date;
|
|
85
|
-
}>, "many">;
|
|
86
|
-
pageInfo: z.ZodObject<{
|
|
87
|
-
totalCount: z.ZodNumber;
|
|
88
|
-
count: z.ZodNumber;
|
|
89
|
-
hasNextPage: z.ZodBoolean;
|
|
90
|
-
hasPreviousPage: z.ZodBoolean;
|
|
91
|
-
startCursor: z.ZodNullable<z.ZodNumber>;
|
|
92
|
-
endCursor: z.ZodNullable<z.ZodNumber>;
|
|
93
|
-
}, "strip", z.ZodTypeAny, {
|
|
94
|
-
count: number;
|
|
95
|
-
totalCount: number;
|
|
96
|
-
hasNextPage: boolean;
|
|
97
|
-
hasPreviousPage: boolean;
|
|
98
|
-
startCursor: number | null;
|
|
99
|
-
endCursor: number | null;
|
|
100
|
-
}, {
|
|
101
|
-
count: number;
|
|
102
|
-
totalCount: number;
|
|
103
|
-
hasNextPage: boolean;
|
|
104
|
-
hasPreviousPage: boolean;
|
|
105
|
-
startCursor: number | null;
|
|
106
|
-
endCursor: number | null;
|
|
107
|
-
}>;
|
|
108
|
-
}, "strip", z.ZodTypeAny, {
|
|
109
|
-
edges: {
|
|
110
|
-
id: number;
|
|
111
|
-
title: string;
|
|
112
|
-
createdAt: Date;
|
|
113
|
-
updatedAt: Date;
|
|
114
|
-
}[];
|
|
115
|
-
pageInfo: {
|
|
116
|
-
count: number;
|
|
117
|
-
totalCount: number;
|
|
118
|
-
hasNextPage: boolean;
|
|
119
|
-
hasPreviousPage: boolean;
|
|
120
|
-
startCursor: number | null;
|
|
121
|
-
endCursor: number | null;
|
|
122
|
-
};
|
|
123
|
-
}, {
|
|
124
|
-
edges: {
|
|
125
|
-
id: number;
|
|
126
|
-
title: string;
|
|
127
|
-
createdAt: Date;
|
|
128
|
-
updatedAt: Date;
|
|
129
|
-
}[];
|
|
130
|
-
pageInfo: {
|
|
131
|
-
count: number;
|
|
132
|
-
totalCount: number;
|
|
133
|
-
hasNextPage: boolean;
|
|
134
|
-
hasPreviousPage: boolean;
|
|
135
|
-
startCursor: number | null;
|
|
136
|
-
endCursor: number | null;
|
|
137
|
-
};
|
|
138
|
-
}>;
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
|
-
description: string;
|
|
142
|
-
};
|
|
143
|
-
};
|
|
144
|
-
} & {
|
|
145
|
-
getRoutingPath: () => "/";
|
|
146
|
-
};
|
|
147
|
-
};
|
|
148
|
-
//# sourceMappingURL=get.route.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get.route.d.ts","sourceRoot":"","sources":["../../../../../../src/api/modules/categories/routes/get.route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAkBtC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqD1B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{z}from"@hono/zod-openapi";import{buildRoute}from"@vitnode/core/api/lib/route";import{withPagination,zodPaginationPageInfo,zodPaginationQuery}from"@vitnode/core/api/lib/with-pagination";import{CONFIG_PLUGIN}from"../../../../config";import{blog_categories}from"../../../../database/categories";const zodCategorySchema=z.object({id:z.number(),title:z.string(),createdAt:z.date(),updatedAt:z.date()});export const categoriesRoute=buildRoute({...CONFIG_PLUGIN,route:{method:"get",path:"/",request:{query:zodPaginationQuery.extend({order:z.enum(["asc","desc"]).optional(),orderBy:z.enum(["updatedAt"]).optional()})},responses:{200:{content:{"application/json":{schema:z.object({edges:z.array(zodCategorySchema),pageInfo:zodPaginationPageInfo})}},description:"Categories retrieved successfully"}}},handler:async c=>{const query=c.req.valid("query");const data=await withPagination({c,params:{query},primaryCursor:blog_categories.id,query:async({limit,where,orderBy})=>await c.get("db").select().from(blog_categories).where(where).orderBy(orderBy).limit(limit),table:blog_categories,orderBy:{column:query.orderBy?blog_categories[query.orderBy]:blog_categories.updatedAt,order:query.order??"desc"}});return c.json(data)}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=generate-unique-title-seo.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-unique-title-seo.d.ts","sourceRoot":"","sources":["../../../../../../src/api/modules/categories/utils/generate-unique-title-seo.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { Metadata } from 'next';
|
|
2
|
-
import { CategoriesAdminView } from '../../../views/admin/categories/categories-admin-view';
|
|
3
|
-
export declare const generateMetadata: () => Promise<Metadata>;
|
|
4
|
-
export default function CategoriesPage(params: React.ComponentProps<typeof CategoriesAdminView>): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
5
|
-
//# sourceMappingURL=page.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../../src/app_admin/blog/categories/page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAMrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAIrF,eAAO,MAAM,gBAAgB,QAAa,OAAO,CAAC,QAAQ,CAMzD,CAAC;AAEF,wBAA8B,cAAc,CAC1C,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,oDAkBzD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{I18nProvider}from"@vitnode/core/components/i18n-provider";import{HeaderContent}from"@vitnode/core/components/ui/header-content";import{getTranslations}from"next-intl/server";import{CategoriesAdminView}from"../../../views/admin/categories/categories-admin-view";import{ActionsCategoriesAdmin}from"../../../views/admin/categories/actions/actions";export const generateMetadata=async()=>{const t=await getTranslations("@vitnode/blog.admin.nav");return{title:t("categories")}};export default async function CategoriesPage(params){const[t,tNav]=await Promise.all([getTranslations("@vitnode/blog.admin.categories"),getTranslations("@vitnode/blog.admin.nav")]);return _jsx(I18nProvider,{namespaces:["@vitnode/blog.admin.categories"],children:_jsxs("div",{className:"container mx-auto p-4",children:[_jsx(HeaderContent,{desc:t("desc"),h1:tNav("categories"),children:_jsx(ActionsCategoriesAdmin,{})}),_jsx(CategoriesAdminView,{...params})]})})}
|
package/dist/src/config.api.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.api.d.ts","sourceRoot":"","sources":["../../src/config.api.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa,mEAKzB,CAAC"}
|
package/dist/src/config.api.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{buildApiPlugin}from"@vitnode/core/api/lib/plugin";import{CONFIG_PLUGIN}from"./config";import{categoriesModule}from"./api/modules/categories/categories.module";export const blogApiPlugin=()=>{return buildApiPlugin({...CONFIG_PLUGIN,modules:[categoriesModule]})};
|
package/dist/src/config.d.ts
DELETED
package/dist/src/config.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;CAEzB,CAAC"}
|
package/dist/src/config.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const CONFIG_PLUGIN={pluginId:"@vitnode/blog"};
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
export declare const blog_categories: Omit<import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
2
|
-
name: "blog_categories";
|
|
3
|
-
schema: undefined;
|
|
4
|
-
columns: {
|
|
5
|
-
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
6
|
-
name: "id";
|
|
7
|
-
tableName: "blog_categories";
|
|
8
|
-
dataType: "number";
|
|
9
|
-
columnType: "PgSerial";
|
|
10
|
-
data: number;
|
|
11
|
-
driverParam: number;
|
|
12
|
-
notNull: true;
|
|
13
|
-
hasDefault: true;
|
|
14
|
-
isPrimaryKey: true;
|
|
15
|
-
isAutoincrement: false;
|
|
16
|
-
hasRuntimeDefault: false;
|
|
17
|
-
enumValues: undefined;
|
|
18
|
-
baseColumn: never;
|
|
19
|
-
identity: undefined;
|
|
20
|
-
generated: undefined;
|
|
21
|
-
}, {}, {}>;
|
|
22
|
-
title: import("drizzle-orm/pg-core").PgColumn<{
|
|
23
|
-
name: "title";
|
|
24
|
-
tableName: "blog_categories";
|
|
25
|
-
dataType: "string";
|
|
26
|
-
columnType: "PgVarchar";
|
|
27
|
-
data: string;
|
|
28
|
-
driverParam: string;
|
|
29
|
-
notNull: true;
|
|
30
|
-
hasDefault: false;
|
|
31
|
-
isPrimaryKey: false;
|
|
32
|
-
isAutoincrement: false;
|
|
33
|
-
hasRuntimeDefault: false;
|
|
34
|
-
enumValues: [string, ...string[]];
|
|
35
|
-
baseColumn: never;
|
|
36
|
-
identity: undefined;
|
|
37
|
-
generated: undefined;
|
|
38
|
-
}, {}, {
|
|
39
|
-
length: 100;
|
|
40
|
-
}>;
|
|
41
|
-
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
42
|
-
name: "createdAt";
|
|
43
|
-
tableName: "blog_categories";
|
|
44
|
-
dataType: "date";
|
|
45
|
-
columnType: "PgTimestamp";
|
|
46
|
-
data: Date;
|
|
47
|
-
driverParam: string;
|
|
48
|
-
notNull: true;
|
|
49
|
-
hasDefault: true;
|
|
50
|
-
isPrimaryKey: false;
|
|
51
|
-
isAutoincrement: false;
|
|
52
|
-
hasRuntimeDefault: false;
|
|
53
|
-
enumValues: undefined;
|
|
54
|
-
baseColumn: never;
|
|
55
|
-
identity: undefined;
|
|
56
|
-
generated: undefined;
|
|
57
|
-
}, {}, {}>;
|
|
58
|
-
updatedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
59
|
-
name: "updatedAt";
|
|
60
|
-
tableName: "blog_categories";
|
|
61
|
-
dataType: "date";
|
|
62
|
-
columnType: "PgTimestamp";
|
|
63
|
-
data: Date;
|
|
64
|
-
driverParam: string;
|
|
65
|
-
notNull: true;
|
|
66
|
-
hasDefault: true;
|
|
67
|
-
isPrimaryKey: false;
|
|
68
|
-
isAutoincrement: false;
|
|
69
|
-
hasRuntimeDefault: false;
|
|
70
|
-
enumValues: undefined;
|
|
71
|
-
baseColumn: never;
|
|
72
|
-
identity: undefined;
|
|
73
|
-
generated: undefined;
|
|
74
|
-
}, {}, {}>;
|
|
75
|
-
titleSeo: import("drizzle-orm/pg-core").PgColumn<{
|
|
76
|
-
name: "titleSeo";
|
|
77
|
-
tableName: "blog_categories";
|
|
78
|
-
dataType: "string";
|
|
79
|
-
columnType: "PgVarchar";
|
|
80
|
-
data: string;
|
|
81
|
-
driverParam: string;
|
|
82
|
-
notNull: true;
|
|
83
|
-
hasDefault: true;
|
|
84
|
-
isPrimaryKey: false;
|
|
85
|
-
isAutoincrement: false;
|
|
86
|
-
hasRuntimeDefault: false;
|
|
87
|
-
enumValues: [string, ...string[]];
|
|
88
|
-
baseColumn: never;
|
|
89
|
-
identity: undefined;
|
|
90
|
-
generated: undefined;
|
|
91
|
-
}, {}, {
|
|
92
|
-
length: 100;
|
|
93
|
-
}>;
|
|
94
|
-
};
|
|
95
|
-
dialect: "pg";
|
|
96
|
-
}>, "enableRLS">;
|
|
97
|
-
//# sourceMappingURL=categories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"categories.d.ts","sourceRoot":"","sources":["../../../src/database/categories.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBASb,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{pgTable}from"drizzle-orm/pg-core";export const blog_categories=pgTable("blog_categories",t=>({id:t.serial().primaryKey(),title:t.varchar({length:100}).notNull(),createdAt:t.timestamp().notNull().defaultNow(),updatedAt:t.timestamp().notNull().$onUpdate(()=>new Date),titleSeo:t.varchar({length:100}).notNull().unique().default("")})).enableRLS();
|
package/dist/src/plugin.d.ts
DELETED
package/dist/src/plugin.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/plugin.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,UAAU,6EAatB,CAAC"}
|
package/dist/src/plugin.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as _jsx}from"react/jsx-runtime";import{buildPlugin}from"@vitnode/core/lib/plugin";import{ListIcon}from"lucide-react";import{CONFIG_PLUGIN}from"./config";export const blogPlugin=()=>{return buildPlugin({...CONFIG_PLUGIN,admin:{nav:[{id:"categories",href:"/admin/blog/categories",icon:_jsx(ListIcon,{})}]}})};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../../../src/views/admin/categories/actions/actions.tsx"],"names":[],"mappings":"AAsBA,eAAO,MAAM,sBAAsB,+CAwBlC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{Button}from"@vitnode/core/components/ui/button";import{Dialog,DialogContent,DialogDescription,DialogHeader,DialogTitle,DialogTrigger}from"@vitnode/core/components/ui/dialog";import{Loader}from"@vitnode/core/components/ui/loader";import{PlusIcon}from"lucide-react";import{useTranslations}from"next-intl";import React from"react";const CreateEditActionCategoriesAdmin=React.lazy(async()=>import("./create-edit/create-edit").then(mod=>({default:mod.CreateEditActionCategoriesAdmin})));export const ActionsCategoriesAdmin=()=>{const t=useTranslations("@vitnode/blog.admin.categories.create");return _jsxs(Dialog,{children:[_jsx(DialogTrigger,{asChild:true,children:_jsxs(Button,{children:[_jsx(PlusIcon,{}),t("title")]})}),_jsxs(DialogContent,{children:[_jsxs(DialogHeader,{children:[_jsx(DialogTitle,{children:t("title")}),_jsx(DialogDescription,{children:t("desc")})]}),_jsx(React.Suspense,{fallback:_jsx(Loader,{}),children:_jsx(CreateEditActionCategoriesAdmin,{})})]})]})};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-edit.d.ts","sourceRoot":"","sources":["../../../../../../../src/views/admin/categories/actions/create/create-edit.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,+BAA+B,+CAE3C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=create.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../../../../../src/views/admin/categories/actions/create/create.tsx"],"names":[],"mappings":""}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import type { zodCreateCategorySchema } from '../../../../../api/modules/categories/routes/create.route';
|
|
3
|
-
export declare const CreateEditActionCategoriesAdmin: ({ data, }: {
|
|
4
|
-
data?: z.infer<typeof zodCreateCategorySchema> & {
|
|
5
|
-
id: number;
|
|
6
|
-
};
|
|
7
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
//# sourceMappingURL=create-edit.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-edit.d.ts","sourceRoot":"","sources":["../../../../../../../src/views/admin/categories/actions/create-edit/create-edit.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAI5F,eAAO,MAAM,+BAA+B,GAAI,WAE7C;IACD,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;CACjE,4CA4EA,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as _jsx}from"react/jsx-runtime";import{AutoForm}from"@vitnode/core/components/form/auto-form";import{AutoFormInput}from"@vitnode/core/components/form/fields/input";import{useDialog}from"@vitnode/core/components/ui/dialog";import{usePathname,useRouter}from"@vitnode/core/lib/navigation";import{useTranslations}from"next-intl";import{toast}from"sonner";import{z}from"zod";import{createMutationApi,editMutationApi}from"./mutation-api";export const CreateEditActionCategoriesAdmin=({data})=>{const t=useTranslations("@vitnode/blog.admin.categories");const tCore=useTranslations("core.global.errors");const{setOpen}=useDialog();const{push}=useRouter();const pathname=usePathname();const formSchema=z.object({title:z.string().min(3,{message:tCore("field_min_length",{min:3})}).default(data?.title??"")});const onSubmit=async(values,form)=>{let error="";if(data?.id){const mutation=await editMutationApi({id:data.id,...values});if(mutation?.error){error=mutation.error}}else{const mutation=await createMutationApi(values);if(mutation?.error){error=mutation.error}}if(error){if(error.includes("already exists")){form.setError("title",{type:"manual",message:t("create.form.title.already_exists")});return}toast.error(tCore("title"),{description:tCore("internal_server_error")});return}setOpen?.(false);push(pathname)};return _jsx(AutoForm,{fields:[{id:"title",component:props=>_jsx(AutoFormInput,{label:t("create.form.title.label"),...props})}],formSchema:formSchema,onSubmit:onSubmit,submitButtonProps:{children:t(`${data?"edit":"create"}.submit`)}})};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { z } from 'zod';
|
|
2
|
-
import type { zodCreateCategorySchema } from '../../../../../api/modules/categories/routes/create.route';
|
|
3
|
-
export declare const mutationApi: (body: z.infer<typeof zodCreateCategorySchema>) => Promise<{
|
|
4
|
-
message: string;
|
|
5
|
-
} | undefined>;
|
|
6
|
-
//# sourceMappingURL=create-mutation-api.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-mutation-api.d.ts","sourceRoot":"","sources":["../../../../../../../src/views/admin/categories/actions/create-edit/create-mutation-api.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAK7B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAI5F,eAAO,MAAM,WAAW,GACtB,MAAM,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC;;cAmB9C,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { z } from 'zod';
|
|
2
|
-
import type { zodCreateCategorySchema } from '../../../../../api/modules/categories/routes/create.route';
|
|
3
|
-
export declare const createMutationApi: (body: z.infer<typeof zodCreateCategorySchema>) => Promise<{
|
|
4
|
-
error: string;
|
|
5
|
-
} | undefined>;
|
|
6
|
-
export declare const editMutationApi: ({ id, ...body }: z.infer<typeof zodCreateCategorySchema> & {
|
|
7
|
-
id: number;
|
|
8
|
-
}) => Promise<{
|
|
9
|
-
error: string;
|
|
10
|
-
} | undefined>;
|
|
11
|
-
//# sourceMappingURL=mutation-api.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mutation-api.d.ts","sourceRoot":"","sources":["../../../../../../../src/views/admin/categories/actions/create-edit/mutation-api.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAK7B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAI5F,eAAO,MAAM,iBAAiB,GAC5B,MAAM,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC;;cAmB9C,CAAC;AAEF,eAAO,MAAM,eAAe,GAAU,iBAGnC,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE;;cAqB1D,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use server";import{fetcher}from"@vitnode/core/lib/fetcher";import{revalidatePath}from"next/cache";import{categoriesModule}from"../../../../../api/modules/categories/categories.module";export const createMutationApi=async body=>{const res=await fetcher(categoriesModule,{method:"post",module:"categories",path:"/",args:{body}});if(res.status!==201){return{error:await res.text()}}revalidatePath("/[locale]/admin/(auth)/(plugins)/(vitnode-blog)/blog/categories","page")};export const editMutationApi=async({id,...body})=>{const res=await fetcher(categoriesModule,{method:"put",module:"categories",path:"/{id}",args:{params:{id},body}});if(res.status!==200){return{error:await res.text()}}revalidatePath("/[locale]/admin/(auth)/(plugins)/(vitnode-blog)/blog/categories","page")};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-edit.d.ts","sourceRoot":"","sources":["../../../../../../src/views/admin/categories/actions/create-edit.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,+BAA+B,+CA0B3C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../../src/views/admin/categories/actions.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,+CAElC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"categories-admin-view.d.ts","sourceRoot":"","sources":["../../../../../src/views/admin/categories/categories-admin-view.tsx"],"names":[],"mappings":"AAUA,eAAO,MAAM,mBAAmB,GAAU,mBAEvC;IACD,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC;CACtE,qDA0DA,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";import{DateFormat}from"@vitnode/core/components/date-format";import{DataTable}from"@vitnode/core/components/table/data-table";import{fetcher}from"@vitnode/core/lib/fetcher";import{getTranslations}from"next-intl/server";import{categoriesModule}from"../../../api/modules/categories/categories.module";import{DeleteAction}from"./row-actions/delete/delete-action";import{EditAction}from"./row-actions/edit-action";export const CategoriesAdminView=async({searchParams})=>{const t=await getTranslations("@vitnode/blog.admin.categories.table");const query=await searchParams;const res=await fetcher(categoriesModule,{path:"/",method:"get",module:"categories",args:{query},withPagination:true,options:{cache:"force-cache"}});const data=await res.json();return _jsx(DataTable,{columns:[{id:"id",label:"ID",className:"w-24"},{id:"title",label:t("title")},{id:"updatedAt",label:t("updated_at"),className:"w-48",cell:({row})=>_jsx(DateFormat,{date:row.updatedAt})},{id:"actions",label:"",className:"w-10",cell:({row})=>_jsxs(_Fragment,{children:[_jsx(EditAction,{data:row}),_jsx(DeleteAction,{...row})]})}],edges:data.edges.map(edge=>({...edge})),order:{columns:["createdAt","updatedAt"],defaultOrder:{column:"createdAt",order:"desc"}},pageInfo:data.pageInfo})};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-action.d.ts","sourceRoot":"","sources":["../../../../../../../src/views/admin/categories/row-actions/delete/delete-action.tsx"],"names":[],"mappings":"AA0BA,eAAO,MAAM,YAAY,GAAI,eAAe;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,4CAsDxE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{AlertDialog,AlertDialogAction,AlertDialogCancel,AlertDialogContent,AlertDialogDescription,AlertDialogFooter,AlertDialogHeader,AlertDialogTitle,AlertDialogTrigger}from"@vitnode/core/components/ui/alert-dialog";import{Button}from"@vitnode/core/components/ui/button";import{Tooltip,TooltipContent,TooltipProvider,TooltipTrigger}from"@vitnode/core/components/ui/tooltip";import{Trash2Icon}from"lucide-react";import{useTranslations}from"next-intl";import{toast}from"sonner";import{mutationApi}from"./mutation-api";export const DeleteAction=({title,id})=>{const t=useTranslations("@vitnode/blog.admin.categories.delete");const tGlobal=useTranslations("core.global");return _jsxs(AlertDialog,{children:[_jsx(TooltipProvider,{children:_jsxs(Tooltip,{children:[_jsx(TooltipTrigger,{asChild:true,children:_jsx(AlertDialogTrigger,{asChild:true,children:_jsx(Button,{size:"icon",variant:"destructive",children:_jsx(Trash2Icon,{className:"size-4"})})})}),_jsx(TooltipContent,{children:t("title")})]})}),_jsxs(AlertDialogContent,{children:[_jsxs(AlertDialogHeader,{children:[_jsx(AlertDialogTitle,{children:t("title")}),_jsx(AlertDialogDescription,{children:t.rich("desc",{title:()=>_jsx("span",{className:"text-foreground font-bold",children:title})})})]}),_jsxs(AlertDialogFooter,{children:[_jsx(AlertDialogCancel,{children:tGlobal("cancel")}),_jsx(AlertDialogAction,{onClick:async()=>{const mutation=await mutationApi(id);if(mutation?.error){toast.error(tGlobal("errors.title"),{description:tGlobal("errors.internal_server_error")});return}toast.success(t("success"),{description:title})},children:t("confirm")})]})]})]})};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mutation-api.d.ts","sourceRoot":"","sources":["../../../../../../../src/views/admin/categories/row-actions/delete/mutation-api.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,WAAW,GAAU,IAAI,MAAM;;cAoB3C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use server";import{fetcher}from"@vitnode/core/lib/fetcher";import{revalidatePath}from"next/cache";import{categoriesModule}from"../../../../../api/modules/categories/categories.module";export const mutationApi=async id=>{const res=await fetcher(categoriesModule,{method:"delete",path:"/{id}",module:"categories",args:{params:{id}}});if(!res.ok){return{error:await res.text()}}revalidatePath("/[locale]/admin/(auth)/(plugins)/(vitnode-blog)/blog/categories","page")};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
declare const CreateEditActionCategoriesAdmin: React.LazyExoticComponent<({ data, }: {
|
|
3
|
-
data?: import("zod").TypeOf<typeof import("../../../../api/modules/categories/routes/create.route").zodCreateCategorySchema> & {
|
|
4
|
-
id: number;
|
|
5
|
-
};
|
|
6
|
-
}) => import("react/jsx-runtime").JSX.Element>;
|
|
7
|
-
export declare const EditAction: (props: Required<React.ComponentProps<typeof CreateEditActionCategoriesAdmin>>) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=edit-action.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"edit-action.d.ts","sourceRoot":"","sources":["../../../../../../src/views/admin/categories/row-actions/edit-action.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,QAAA,MAAM,+BAA+B;QAEjB,CAAC;;;8CAEpB,CAAC;AAEF,eAAO,MAAM,UAAU,GACrB,OAAO,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,+BAA+B,CAAC,CAAC,4CA+B9E,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{Button}from"@vitnode/core/components/ui/button";import{Dialog,DialogContent,DialogDescription,DialogHeader,DialogTitle,DialogTrigger}from"@vitnode/core/components/ui/dialog";import{Loader}from"@vitnode/core/components/ui/loader";import{Tooltip,TooltipContent,TooltipProvider,TooltipTrigger}from"@vitnode/core/components/ui/tooltip";import{PencilIcon}from"lucide-react";import{useTranslations}from"next-intl";import React from"react";const CreateEditActionCategoriesAdmin=React.lazy(async()=>import("../actions/create-edit/create-edit").then(mod=>({default:mod.CreateEditActionCategoriesAdmin})));export const EditAction=props=>{const t=useTranslations("@vitnode/blog.admin.categories.edit");return _jsxs(Dialog,{children:[_jsx(TooltipProvider,{children:_jsxs(Tooltip,{children:[_jsx(TooltipTrigger,{asChild:true,children:_jsx(DialogTrigger,{asChild:true,children:_jsx(Button,{size:"icon",variant:"ghost",children:_jsx(PencilIcon,{})})})}),_jsx(TooltipContent,{children:t("title")})]})}),_jsxs(DialogContent,{children:[_jsxs(DialogHeader,{children:[_jsx(DialogTitle,{children:t("title")}),_jsx(DialogDescription,{children:props.data.title})]}),_jsx(React.Suspense,{fallback:_jsx(Loader,{}),children:_jsx(CreateEditActionCategoriesAdmin,{...props})})]})]})};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mutation-api.d.ts","sourceRoot":"","sources":["../../../../../../src/views/admin/categories/row-actions/mutation-api.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,WAAW,GAAU,IAAI,MAAM;;cAoB3C,CAAC"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { CreateEditActionCategoriesAdmin } from '../actions/create-edit/create-edit';
|
|
2
|
-
export declare const RowActions: ({ data, }: Required<React.ComponentProps<typeof CreateEditActionCategoriesAdmin>>) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
//# sourceMappingURL=row-actions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"row-actions.d.ts","sourceRoot":"","sources":["../../../../../../src/views/admin/categories/row-actions/row-actions.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,oCAAoC,CAAC;AAI1F,eAAO,MAAM,UAAU,GAAI,WAExB,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,+BAA+B,CAAC,CAAC,4CAOxE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"categories-admin-view.d.ts","sourceRoot":"","sources":["../../../../src/views/admin/categories-admin-view.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,mBAAmB,GAAU,mBAEvC;IACD,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC;CACtE,qDA4CA,CAAC"}
|