gavaengine 0.1.2 → 2.0.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 (36) hide show
  1. package/dist/DashboardSplashTrigger-CRpueuUi.d.ts +154 -0
  2. package/dist/auth/index.d.ts +42 -0
  3. package/dist/auth/index.js +12 -0
  4. package/dist/auth/index.js.map +1 -0
  5. package/dist/{chunk-D5PTZWTT.js → chunk-4LM22T36.js} +2 -2
  6. package/dist/chunk-MC3FBYWV.js +534 -0
  7. package/dist/chunk-MC3FBYWV.js.map +1 -0
  8. package/dist/chunk-QO42DDRU.js +113 -0
  9. package/dist/chunk-QO42DDRU.js.map +1 -0
  10. package/dist/{chunk-3C3AAR3S.js → chunk-YSVQQBBU.js} +474 -50
  11. package/dist/chunk-YSVQQBBU.js.map +1 -0
  12. package/dist/components/index.d.ts +64 -132
  13. package/dist/components/index.js +22 -2
  14. package/dist/content/index.d.ts +45 -0
  15. package/dist/content/index.js +38 -0
  16. package/dist/content/index.js.map +1 -0
  17. package/dist/handlers/index.d.ts +60 -3
  18. package/dist/handlers/index.js +477 -126
  19. package/dist/handlers/index.js.map +1 -1
  20. package/dist/i18n/index.d.ts +114 -0
  21. package/dist/i18n/index.js +249 -0
  22. package/dist/i18n/index.js.map +1 -0
  23. package/dist/{index-B1ZYC5TP.d.ts → index-CCsSC4nF.d.ts} +119 -2
  24. package/dist/index.d.ts +45 -7
  25. package/dist/index.js +226 -39
  26. package/dist/index.js.map +1 -1
  27. package/dist/providers/index.d.ts +3 -2
  28. package/dist/providers/index.js +2 -2
  29. package/dist/types-X07o_zKf.d.ts +198 -0
  30. package/dist/types-d8-k_4dN.d.ts +19 -0
  31. package/package.json +16 -1
  32. package/dist/chunk-3C3AAR3S.js.map +0 -1
  33. package/dist/chunk-BVLJYZ6T.js +0 -252
  34. package/dist/chunk-BVLJYZ6T.js.map +0 -1
  35. package/dist/types-BZgSeTU8.d.ts +0 -101
  36. /package/dist/{chunk-D5PTZWTT.js.map → chunk-4LM22T36.js.map} +0 -0
@@ -1,4 +1,5 @@
1
- export { A as ActionsProvider, C as ConfigProvider, a as GavaEngineProvider, S as SessionProvider, b as SplashProvider, T as ThemeProvider, c as ThemeToggle, u as useGavaActions, e as useGavaConfig, f as useSplash } from '../index-B1ZYC5TP.js';
1
+ export { A as ActionsProvider, C as ConfigProvider, b as GavaEngineProvider, S as SessionProvider, c as SplashProvider, T as ThemeProvider, d as ThemeToggle, u as useGavaActions, f as useGavaConfig, g as useSplash } from '../index-CCsSC4nF.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
- import '../types-BZgSeTU8.js';
4
+ import '../types-d8-k_4dN.js';
5
+ import '../types-X07o_zKf.js';
@@ -4,7 +4,7 @@ import {
4
4
  SessionProvider,
5
5
  ThemeProvider,
6
6
  ThemeToggle
7
- } from "../chunk-D5PTZWTT.js";
7
+ } from "../chunk-4LM22T36.js";
8
8
  import {
9
9
  ActionsProvider,
10
10
  ConfigProvider,
@@ -12,7 +12,7 @@ import {
12
12
  useGavaActions,
13
13
  useGavaConfig,
14
14
  useSplash
15
- } from "../chunk-BVLJYZ6T.js";
15
+ } from "../chunk-MC3FBYWV.js";
16
16
  export {
17
17
  ActionsProvider,
18
18
  ConfigProvider,
@@ -0,0 +1,198 @@
1
+ type GEFieldType = "text" | "richtext" | "number" | "boolean" | "date" | "image" | "select" | "slug" | "relationship" | "json";
2
+ interface GEFieldDef {
3
+ name: string;
4
+ type: GEFieldType;
5
+ label: string;
6
+ required?: boolean;
7
+ defaultValue?: any;
8
+ placeholder?: string;
9
+ options?: string[];
10
+ generateFrom?: string;
11
+ relationTo?: string;
12
+ hidden?: boolean;
13
+ admin?: {
14
+ width?: "full" | "half";
15
+ position?: "main" | "sidebar";
16
+ };
17
+ }
18
+ interface GEContentType {
19
+ slug: string;
20
+ labels: {
21
+ singular: string;
22
+ plural: string;
23
+ };
24
+ fields: GEFieldDef[];
25
+ statuses?: string[];
26
+ defaultStatus?: string;
27
+ publishedStatus?: string;
28
+ features?: {
29
+ revisions?: boolean;
30
+ views?: boolean;
31
+ search?: boolean;
32
+ };
33
+ admin?: {
34
+ listColumns?: string[];
35
+ searchableFields?: string[];
36
+ defaultSort?: {
37
+ field: string;
38
+ direction: "asc" | "desc";
39
+ };
40
+ };
41
+ }
42
+ declare function defineContentType(contentType: GEContentType): GEContentType;
43
+ declare const articlesContentType: GEContentType;
44
+
45
+ interface GEArticle {
46
+ id: string;
47
+ title: string;
48
+ slug: string;
49
+ excerpt: string;
50
+ content: string;
51
+ coverImage: string;
52
+ category: string;
53
+ status: string;
54
+ authorName: string;
55
+ viewCount?: number;
56
+ createdAt: Date;
57
+ updatedAt: Date;
58
+ publishedAt: Date | null;
59
+ }
60
+ interface GEUser {
61
+ id: string;
62
+ name: string;
63
+ email: string;
64
+ role: string;
65
+ createdAt: Date;
66
+ }
67
+ interface GEMedia {
68
+ id: string;
69
+ filename: string;
70
+ path: string;
71
+ mimeType: string;
72
+ size: number;
73
+ createdAt: Date;
74
+ uploader: {
75
+ name: string;
76
+ };
77
+ }
78
+ interface GERevision {
79
+ id: string;
80
+ title: string;
81
+ content: string;
82
+ excerpt: string;
83
+ coverImage: string;
84
+ category: string;
85
+ note: string;
86
+ createdAt: Date;
87
+ editor: {
88
+ name: string;
89
+ };
90
+ }
91
+ interface GESession {
92
+ user: {
93
+ id: string;
94
+ name?: string | null;
95
+ email?: string | null;
96
+ role: string;
97
+ };
98
+ }
99
+ interface GEContentActions {
100
+ getAll(options?: {
101
+ search?: string;
102
+ status?: string;
103
+ }): Promise<any[]>;
104
+ getById(id: string): Promise<any | null>;
105
+ create(data?: Record<string, any>): Promise<string>;
106
+ update(id: string, data: Record<string, any>): Promise<{
107
+ success: boolean;
108
+ }>;
109
+ delete(id: string): Promise<{
110
+ success: boolean;
111
+ }>;
112
+ publish?(id: string): Promise<{
113
+ success: boolean;
114
+ }>;
115
+ unpublish?(id: string): Promise<{
116
+ success: boolean;
117
+ }>;
118
+ }
119
+ interface GEActionsV2 {
120
+ content: Record<string, GEContentActions>;
121
+ media: {
122
+ getMedia: (search?: string) => Promise<GEMedia[]>;
123
+ deleteMedia: (id: string) => Promise<{
124
+ success: boolean;
125
+ }>;
126
+ };
127
+ users: {
128
+ getUsers: () => Promise<GEUser[]>;
129
+ getUserById: (id: string) => Promise<GEUser | null>;
130
+ createUser: (formData: FormData) => Promise<{
131
+ error?: string;
132
+ } | void>;
133
+ updateUser: (id: string, formData: FormData) => Promise<{
134
+ error?: string;
135
+ } | void>;
136
+ deleteUser: (id: string) => Promise<{
137
+ error?: string;
138
+ } | void>;
139
+ };
140
+ revisions: {
141
+ getRevisions: (contentId: string) => Promise<GERevision[]>;
142
+ restoreRevision: (contentId: string, revisionId: string) => Promise<{
143
+ success: boolean;
144
+ }>;
145
+ };
146
+ uploadUrl: string;
147
+ }
148
+ interface GEActions {
149
+ getArticles: () => Promise<GEArticle[]>;
150
+ getArticleById: (id: string) => Promise<GEArticle | null>;
151
+ createArticle: () => Promise<string>;
152
+ updateArticle: (id: string, data: {
153
+ title?: string;
154
+ slug?: string;
155
+ excerpt?: string;
156
+ content?: string;
157
+ coverImage?: string;
158
+ category?: string;
159
+ authorName?: string;
160
+ }) => Promise<{
161
+ success: boolean;
162
+ }>;
163
+ deleteArticle: (id: string) => Promise<{
164
+ success: boolean;
165
+ }>;
166
+ publishArticle: (id: string) => Promise<{
167
+ success: boolean;
168
+ }>;
169
+ unpublishArticle: (id: string) => Promise<{
170
+ success: boolean;
171
+ }>;
172
+ getMedia: (search?: string) => Promise<GEMedia[]>;
173
+ deleteMedia: (id: string) => Promise<{
174
+ success: boolean;
175
+ }>;
176
+ uploadUrl: string;
177
+ getRevisions: (articleId: string) => Promise<GERevision[]>;
178
+ restoreRevision: (articleId: string, revisionId: string) => Promise<{
179
+ success: boolean;
180
+ }>;
181
+ getUsers: () => Promise<GEUser[]>;
182
+ getUserById: (id: string) => Promise<GEUser | null>;
183
+ createUser: (formData: FormData) => Promise<{
184
+ error?: string;
185
+ } | void>;
186
+ updateUser: (id: string, formData: FormData) => Promise<{
187
+ error?: string;
188
+ } | void>;
189
+ deleteUser: (id: string) => Promise<{
190
+ error?: string;
191
+ } | void>;
192
+ }
193
+ /**
194
+ * @deprecated Use GEActionsV2 instead. This helper maps v1.x flat actions to v2.x structure.
195
+ */
196
+ declare function createLegacyActions(v2Actions: GEActionsV2, contentSlug?: string): GEActions;
197
+
198
+ export { type GEContentType as G, type GEContentActions as a, type GEFieldDef as b, type GEActions as c, type GEActionsV2 as d, type GEArticle as e, type GEFieldType as f, type GEMedia as g, type GERevision as h, type GESession as i, type GEUser as j, articlesContentType as k, createLegacyActions as l, defineContentType as m };
@@ -0,0 +1,19 @@
1
+ interface GEUser {
2
+ id: string;
3
+ name?: string | null;
4
+ email?: string | null;
5
+ role: string;
6
+ }
7
+ interface GESession {
8
+ user: GEUser;
9
+ }
10
+ interface GEAuthAdapter {
11
+ getSession(): Promise<GESession | null>;
12
+ getCurrentUser(): Promise<GEUser | null>;
13
+ signIn?(credentials: Record<string, unknown>): Promise<{
14
+ error?: string;
15
+ } | void>;
16
+ signOut?(): Promise<void>;
17
+ }
18
+
19
+ export type { GEAuthAdapter as G, GESession as a, GEUser as b };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gavaengine",
3
- "version": "0.1.2",
3
+ "version": "2.0.0",
4
4
  "description": "Modular CMS engine — editor, auth, media & user management as React components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -22,6 +22,18 @@
22
22
  "import": "./dist/components/index.js",
23
23
  "types": "./dist/components/index.d.ts"
24
24
  },
25
+ "./i18n": {
26
+ "import": "./dist/i18n/index.js",
27
+ "types": "./dist/i18n/index.d.ts"
28
+ },
29
+ "./auth": {
30
+ "import": "./dist/auth/index.js",
31
+ "types": "./dist/auth/index.d.ts"
32
+ },
33
+ "./content": {
34
+ "import": "./dist/content/index.js",
35
+ "types": "./dist/content/index.d.ts"
36
+ },
25
37
  "./styles": "./dist/styles/gavaengine.css",
26
38
  "./styles/gavaengine.css": "./dist/styles/gavaengine.css"
27
39
  },
@@ -50,6 +62,9 @@
50
62
  "lucide-react": ">=0.300.0"
51
63
  },
52
64
  "peerDependenciesMeta": {
65
+ "next-auth": {
66
+ "optional": true
67
+ },
53
68
  "react-easy-crop": {
54
69
  "optional": true
55
70
  }