@nextjs-cms-plugins/cpanel-emails 0.1.1 → 0.1.3
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/dist/client/EmailsPage.d.ts +1 -62
- package/dist/client/EmailsPage.d.ts.map +1 -1
- package/dist/client/EmailsPage.js +3 -1
- package/dist/index.d.ts +1 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -7
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +11 -9
- package/dist/server.d.ts +2 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +12 -0
- package/package.json +5 -5
- package/dist/client.d.ts +0 -65
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -5
|
@@ -1,64 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
type TrpcEmails = {
|
|
3
|
-
cpanelEmails?: {
|
|
4
|
-
getEmails: {
|
|
5
|
-
useQuery: () => {
|
|
6
|
-
data?: {
|
|
7
|
-
emails: EmailItem[];
|
|
8
|
-
};
|
|
9
|
-
isLoading: boolean;
|
|
10
|
-
isError?: boolean;
|
|
11
|
-
error?: unknown;
|
|
12
|
-
refetch: () => Promise<unknown>;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
createEmail: {
|
|
16
|
-
useMutation: (opts: {
|
|
17
|
-
onSuccess: () => void;
|
|
18
|
-
}) => {
|
|
19
|
-
mutateAsync: (input: {
|
|
20
|
-
email: string;
|
|
21
|
-
password: string;
|
|
22
|
-
quota: string;
|
|
23
|
-
}) => Promise<unknown>;
|
|
24
|
-
isPending?: boolean;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
quotaChange: {
|
|
28
|
-
useMutation: (opts: {
|
|
29
|
-
onSuccess: () => void;
|
|
30
|
-
}) => {
|
|
31
|
-
mutateAsync: (input: {
|
|
32
|
-
email: string;
|
|
33
|
-
quota: string;
|
|
34
|
-
}) => Promise<unknown>;
|
|
35
|
-
isPending?: boolean;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
passwordChange: {
|
|
39
|
-
useMutation: (opts: {
|
|
40
|
-
onSuccess: () => void;
|
|
41
|
-
}) => {
|
|
42
|
-
mutateAsync: (input: {
|
|
43
|
-
email: string;
|
|
44
|
-
password: string;
|
|
45
|
-
passwordConfirm: string;
|
|
46
|
-
}) => Promise<unknown>;
|
|
47
|
-
isPending?: boolean;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
deleteEmail: {
|
|
51
|
-
useMutation: (opts: {
|
|
52
|
-
onSuccess: () => void;
|
|
53
|
-
}) => {
|
|
54
|
-
mutateAsync: (email: string) => Promise<unknown>;
|
|
55
|
-
isPending?: boolean;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
export declare const CpanelEmailsPage: ({ trpc }: {
|
|
61
|
-
trpc: TrpcEmails;
|
|
62
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export declare const CpanelEmailsPage: () => import("react/jsx-runtime").JSX.Element;
|
|
63
2
|
export default CpanelEmailsPage;
|
|
64
3
|
//# sourceMappingURL=EmailsPage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmailsPage.d.ts","sourceRoot":"","sources":["../../src/client/EmailsPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EmailsPage.d.ts","sourceRoot":"","sources":["../../src/client/EmailsPage.tsx"],"names":[],"mappings":"AA6CA,eAAO,MAAM,gBAAgB,+CAgD5B,CAAA;AA0ID,eAAe,gBAAgB,CAAA"}
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useState } from 'react';
|
|
4
4
|
import getString from 'nextjs-cms/translations';
|
|
5
|
-
|
|
5
|
+
import { trpc as trpcClient } from 'nextjs-cms/api/trpc/client';
|
|
6
|
+
export const CpanelEmailsPage = () => {
|
|
7
|
+
const trpc = trpcClient;
|
|
6
8
|
const query = trpc?.cpanelEmails?.getEmails.useQuery;
|
|
7
9
|
const { data, isLoading, isError, error, refetch } = query
|
|
8
10
|
? query()
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { cpanelEmailsRouter } from './router.js';
|
|
3
|
-
export declare function createPlugin(): CMSPlugin;
|
|
4
|
-
export { cpanelEmailsRouter };
|
|
1
|
+
export declare function createPlugin(): import("nextjs-cms/plugins").CMSPluginSingleRoute;
|
|
5
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,wBAAgB,YAAY,sDAc3B"}
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
+
import { definePlugin } from 'nextjs-cms/plugins';
|
|
1
2
|
import { cpanelEmailsRouter } from './router.js';
|
|
2
3
|
export function createPlugin() {
|
|
3
|
-
return {
|
|
4
|
-
|
|
4
|
+
return definePlugin({
|
|
5
|
+
title: 'cPanel Emails',
|
|
6
|
+
name: 'plugin_cpanel_emails',
|
|
7
|
+
registryName: 'cpanel-emails',
|
|
5
8
|
router: cpanelEmailsRouter,
|
|
6
9
|
routes: [
|
|
7
10
|
{
|
|
8
|
-
path: '/emails',
|
|
9
|
-
title: 'Emails',
|
|
11
|
+
path: '/cpanel-emails',
|
|
12
|
+
title: 'cPanel Emails',
|
|
10
13
|
icon: 'mail',
|
|
11
|
-
component: 'cpanelEmails',
|
|
12
14
|
},
|
|
13
15
|
],
|
|
14
|
-
};
|
|
16
|
+
});
|
|
15
17
|
}
|
|
16
|
-
export { cpanelEmailsRouter };
|
package/dist/router.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAKxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAKxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;gBAmDf,CAAR;iBACI,CADwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuHlC,CAAA"}
|
package/dist/router.js
CHANGED
|
@@ -2,9 +2,9 @@ import { TRPCError } from '@trpc/server';
|
|
|
2
2
|
import * as z from 'zod';
|
|
3
3
|
import getString from 'nextjs-cms/translations';
|
|
4
4
|
import { CpanelAPI } from 'nextjs-cms/utils';
|
|
5
|
-
import {
|
|
5
|
+
import { pluginProcedure, router } from 'nextjs-cms/api/trpc';
|
|
6
6
|
export const cpanelEmailsRouter = router({
|
|
7
|
-
getEmails:
|
|
7
|
+
getEmails: pluginProcedure('plugin_cpanel_emails').query(async ({ ctx }) => {
|
|
8
8
|
if (!process.env.CPANEL_USER || !process.env.CPANEL_PASSWORD || !process.env.CPANEL_DOMAIN) {
|
|
9
9
|
throw new TRPCError({
|
|
10
10
|
code: 'BAD_REQUEST',
|
|
@@ -24,13 +24,13 @@ export const cpanelEmailsRouter = router({
|
|
|
24
24
|
emails: data.data,
|
|
25
25
|
};
|
|
26
26
|
}),
|
|
27
|
-
createEmail:
|
|
27
|
+
createEmail: pluginProcedure('plugin_cpanel_emails', 'C')
|
|
28
28
|
.input(z.object({
|
|
29
29
|
email: z.string(),
|
|
30
30
|
password: z.string(),
|
|
31
31
|
quota: z.string(),
|
|
32
32
|
}))
|
|
33
|
-
.mutation(async ({ input }) => {
|
|
33
|
+
.mutation(async ({ input, ctx }) => {
|
|
34
34
|
if (!process.env.CPANEL_USER || !process.env.CPANEL_PASSWORD || !process.env.CPANEL_DOMAIN) {
|
|
35
35
|
throw new TRPCError({
|
|
36
36
|
code: 'BAD_REQUEST',
|
|
@@ -52,12 +52,12 @@ export const cpanelEmailsRouter = router({
|
|
|
52
52
|
}
|
|
53
53
|
return data;
|
|
54
54
|
}),
|
|
55
|
-
quotaChange:
|
|
55
|
+
quotaChange: pluginProcedure('plugin_cpanel_emails', 'U')
|
|
56
56
|
.input(z.object({
|
|
57
57
|
email: z.string(),
|
|
58
58
|
quota: z.string(),
|
|
59
59
|
}))
|
|
60
|
-
.mutation(async ({ input }) => {
|
|
60
|
+
.mutation(async ({ input, ctx }) => {
|
|
61
61
|
if (!process.env.CPANEL_USER || !process.env.CPANEL_PASSWORD || !process.env.CPANEL_DOMAIN) {
|
|
62
62
|
throw new TRPCError({
|
|
63
63
|
code: 'BAD_REQUEST',
|
|
@@ -78,13 +78,13 @@ export const cpanelEmailsRouter = router({
|
|
|
78
78
|
}
|
|
79
79
|
return data;
|
|
80
80
|
}),
|
|
81
|
-
passwordChange:
|
|
81
|
+
passwordChange: pluginProcedure('plugin_cpanel_emails', 'U')
|
|
82
82
|
.input(z.object({
|
|
83
83
|
email: z.string(),
|
|
84
84
|
password: z.string(),
|
|
85
85
|
passwordConfirm: z.string(),
|
|
86
86
|
}))
|
|
87
|
-
.mutation(async ({ input }) => {
|
|
87
|
+
.mutation(async ({ input, ctx }) => {
|
|
88
88
|
if (!process.env.CPANEL_USER || !process.env.CPANEL_PASSWORD || !process.env.CPANEL_DOMAIN) {
|
|
89
89
|
throw new TRPCError({
|
|
90
90
|
code: 'BAD_REQUEST',
|
|
@@ -111,7 +111,9 @@ export const cpanelEmailsRouter = router({
|
|
|
111
111
|
}
|
|
112
112
|
return data;
|
|
113
113
|
}),
|
|
114
|
-
deleteEmail:
|
|
114
|
+
deleteEmail: pluginProcedure('plugin_cpanel_emails', 'D')
|
|
115
|
+
.input(z.string())
|
|
116
|
+
.mutation(async ({ input, ctx }) => {
|
|
115
117
|
if (!process.env.CPANEL_USER || !process.env.CPANEL_PASSWORD || !process.env.CPANEL_DOMAIN) {
|
|
116
118
|
throw new TRPCError({
|
|
117
119
|
code: 'BAD_REQUEST',
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.tsx"],"names":[],"mappings":"AAGA,wBAA8B,kBAAkB,qDAkB/C"}
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { api, HydrateClient } from 'nextjs-cms/api/trpc/server';
|
|
3
|
+
import { CpanelEmailsPage } from './client/EmailsPage.js';
|
|
4
|
+
export default async function CpanelEmailsServer() {
|
|
5
|
+
const helpers = api;
|
|
6
|
+
const prefetch = helpers.cpanelEmails?.getEmails?.prefetch;
|
|
7
|
+
if (!prefetch) {
|
|
8
|
+
throw new Error('[cpanel-emails] Missing cpanelEmails.getEmails prefetch helper.');
|
|
9
|
+
}
|
|
10
|
+
await prefetch();
|
|
11
|
+
return (_jsx(HydrateClient, { children: _jsx(CpanelEmailsPage, {}) }));
|
|
12
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextjs-cms-plugins/cpanel-emails",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
10
|
"default": "./dist/index.js"
|
|
11
11
|
},
|
|
12
|
-
"./
|
|
13
|
-
"types": "./dist/
|
|
14
|
-
"default": "./dist/
|
|
12
|
+
"./server": {
|
|
13
|
+
"types": "./dist/server.d.ts",
|
|
14
|
+
"default": "./dist/server.js"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"react": "19.0.0",
|
|
28
28
|
"react-dom": "19.0.0",
|
|
29
|
-
"nextjs-cms": "0.5.
|
|
29
|
+
"nextjs-cms": "0.5.70"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/react": "~19.0.0",
|
package/dist/client.d.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { CpanelEmailsPage } from './client/EmailsPage.js';
|
|
2
|
-
export declare const components: {
|
|
3
|
-
cpanelEmails: ({ trpc }: {
|
|
4
|
-
trpc: {
|
|
5
|
-
cpanelEmails?: {
|
|
6
|
-
getEmails: {
|
|
7
|
-
useQuery: () => {
|
|
8
|
-
data?: {
|
|
9
|
-
emails: import("nextjs-cms/core/types").EmailItem[];
|
|
10
|
-
};
|
|
11
|
-
isLoading: boolean;
|
|
12
|
-
isError?: boolean;
|
|
13
|
-
error?: unknown;
|
|
14
|
-
refetch: () => Promise<unknown>;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
createEmail: {
|
|
18
|
-
useMutation: (opts: {
|
|
19
|
-
onSuccess: () => void;
|
|
20
|
-
}) => {
|
|
21
|
-
mutateAsync: (input: {
|
|
22
|
-
email: string;
|
|
23
|
-
password: string;
|
|
24
|
-
quota: string;
|
|
25
|
-
}) => Promise<unknown>;
|
|
26
|
-
isPending?: boolean;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
quotaChange: {
|
|
30
|
-
useMutation: (opts: {
|
|
31
|
-
onSuccess: () => void;
|
|
32
|
-
}) => {
|
|
33
|
-
mutateAsync: (input: {
|
|
34
|
-
email: string;
|
|
35
|
-
quota: string;
|
|
36
|
-
}) => Promise<unknown>;
|
|
37
|
-
isPending?: boolean;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
passwordChange: {
|
|
41
|
-
useMutation: (opts: {
|
|
42
|
-
onSuccess: () => void;
|
|
43
|
-
}) => {
|
|
44
|
-
mutateAsync: (input: {
|
|
45
|
-
email: string;
|
|
46
|
-
password: string;
|
|
47
|
-
passwordConfirm: string;
|
|
48
|
-
}) => Promise<unknown>;
|
|
49
|
-
isPending?: boolean;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
deleteEmail: {
|
|
53
|
-
useMutation: (opts: {
|
|
54
|
-
onSuccess: () => void;
|
|
55
|
-
}) => {
|
|
56
|
-
mutateAsync: (email: string) => Promise<unknown>;
|
|
57
|
-
isPending?: boolean;
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
63
|
-
};
|
|
64
|
-
export { CpanelEmailsPage };
|
|
65
|
-
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAEzD,eAAO,MAAM,UAAU;;;;;;4BAKmG,CAAC;;;;+BAAoF,CAAC;6BAA+B,CAAC;;;;;;;;;;;;;iCAA+S,CAAC;;;;;;;;;;;iCAA6O,CAAC;;;;;;;;;;;;iCAA4Q,CAAC;;;;;;;;iCAAmN,CAAC;;;;;;CAH9uC,CAAA;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
|