@akanjs/cli 0.0.41 → 0.0.43
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/index.d.ts +1 -0
- package/index.js +34 -7
- package/package.json +1 -1
- package/src/templates/__scalar/__model__/__model__.constant.js +36 -0
- package/src/templates/__scalar/__model__/__model__.dictionary.js +47 -0
- package/src/templates/__scalar/__model__/__model__.document.js +34 -0
- package/src/templates/app/akan.config.ts.template +5 -0
- package/src/templates/app/app/[lang]/(__appName__)/(public)/forgotpassword/page.js +45 -0
- package/src/templates/app/app/[lang]/(__appName__)/(public)/page.js +46 -0
- package/src/templates/app/app/[lang]/(__appName__)/(public)/privacy/page.js +40 -0
- package/src/templates/app/app/[lang]/(__appName__)/(public)/signin/page.js +48 -0
- package/src/templates/app/app/[lang]/(__appName__)/(public)/termsofservice/page.js +39 -0
- package/src/templates/app/app/[lang]/(__appName__)/(user)/layout.js +41 -0
- package/src/templates/app/app/[lang]/(__appName__)/(user)/self/page.js +58 -0
- package/src/templates/app/app/[lang]/(__appName__)/layout.js +50 -0
- package/src/templates/app/app/[lang]/admin/layout.js +51 -0
- package/src/templates/app/app/[lang]/admin/page.js +61 -0
- package/src/templates/app/app/csr.js +32 -0
- package/src/templates/app/app/index.html.template +13 -0
- package/src/templates/app/app/layout.js +36 -0
- package/src/templates/app/app/robots.js +41 -0
- package/src/templates/app/app/sitemap.js +37 -0
- package/src/templates/app/base/baseLogic.js +36 -0
- package/src/templates/app/base/index.js +30 -0
- package/src/templates/app/capacitor.config.ts.template +8 -0
- package/src/templates/app/common/commonLogic.js +36 -0
- package/src/templates/app/common/index.js +30 -0
- package/src/templates/app/env/env.client.js +39 -0
- package/src/templates/app/env/env.client.type.js +36 -0
- package/src/templates/app/env/env.server.js +39 -0
- package/src/templates/app/jest.config.js +37 -0
- package/src/templates/app/lib/___appName__/__appName__.dictionary.js +32 -0
- package/src/templates/app/lib/___appName__/__appName__.service.js +43 -0
- package/src/templates/app/lib/___appName__/__appName__.store.js +37 -0
- package/src/templates/app/lib/___appName__/_server.js +35 -0
- package/src/templates/app/lib/option.js +43 -0
- package/src/templates/app/lib/setting/Setting.Template.js +55 -0
- package/src/templates/app/lib/setting/Setting.Unit.js +36 -0
- package/src/templates/app/lib/setting/Setting.Util.js +32 -0
- package/src/templates/app/lib/setting/Setting.View.js +49 -0
- package/src/templates/app/lib/setting/Setting.Zone.js +78 -0
- package/src/templates/app/lib/setting/_server.js +49 -0
- package/src/templates/app/lib/setting/index.js +59 -0
- package/src/templates/app/lib/setting/setting.constant.js +47 -0
- package/src/templates/app/lib/setting/setting.dictionary.js +47 -0
- package/src/templates/app/lib/setting/setting.document.js +49 -0
- package/src/templates/app/lib/setting/setting.service.js +38 -0
- package/src/templates/app/lib/setting/setting.signal.js +35 -0
- package/src/templates/app/lib/setting/setting.store.js +42 -0
- package/src/templates/app/lib/summary/Summary.Template.js +41 -0
- package/src/templates/app/lib/summary/Summary.Unit.js +36 -0
- package/src/templates/app/lib/summary/Summary.Util.js +31 -0
- package/src/templates/app/lib/summary/Summary.View.js +49 -0
- package/src/templates/app/lib/summary/Summary.Zone.js +60 -0
- package/src/templates/app/lib/summary/_server.js +49 -0
- package/src/templates/app/lib/summary/index.js +65 -0
- package/src/templates/app/lib/summary/summary.constant.js +45 -0
- package/src/templates/app/lib/summary/summary.dictionary.js +50 -0
- package/src/templates/app/lib/summary/summary.document.js +49 -0
- package/src/templates/app/lib/summary/summary.service.js +35 -0
- package/src/templates/app/lib/summary/summary.signal.js +35 -0
- package/src/templates/app/lib/summary/summary.store.js +42 -0
- package/src/templates/app/lib/user/User.Template.js +63 -0
- package/src/templates/app/lib/user/User.Unit.js +36 -0
- package/src/templates/app/lib/user/User.Util.js +92 -0
- package/src/templates/app/lib/user/User.View.js +64 -0
- package/src/templates/app/lib/user/User.Zone.js +72 -0
- package/src/templates/app/lib/user/_server.js +49 -0
- package/src/templates/app/lib/user/index.js +59 -0
- package/src/templates/app/lib/user/user.constant.js +68 -0
- package/src/templates/app/lib/user/user.dictionary.js +53 -0
- package/src/templates/app/lib/user/user.document.js +55 -0
- package/src/templates/app/lib/user/user.service.js +43 -0
- package/src/templates/app/lib/user/user.signal.js +35 -0
- package/src/templates/app/lib/user/user.signal.spec.js +38 -0
- package/src/templates/app/lib/user/user.signal.test.js +40 -0
- package/src/templates/app/lib/user/user.store.js +40 -0
- package/src/templates/app/main.js +41 -0
- package/src/templates/app/middleware.js +36 -0
- package/src/templates/app/nest/backendLogic.js +35 -0
- package/src/templates/app/nest/index.js +30 -0
- package/src/templates/app/next/frontendLogic.js +35 -0
- package/src/templates/app/next/index.js +30 -0
- package/src/templates/app/page.test.ts.template +10 -0
- package/src/templates/app/playwright.config.ts.template +6 -0
- package/src/templates/app/postcss.config.js.template +10 -0
- package/src/templates/app/public/favicon.ico +0 -0
- package/src/templates/app/public/icons/icon-128x128.png +0 -0
- package/src/templates/app/public/icons/icon-144x144.png +0 -0
- package/src/templates/app/public/icons/icon-152x152.png +0 -0
- package/src/templates/app/public/icons/icon-192x192.png +0 -0
- package/src/templates/app/public/icons/icon-256x256.png +0 -0
- package/src/templates/app/public/icons/icon-384x384.png +0 -0
- package/src/templates/app/public/icons/icon-48x48.png +0 -0
- package/src/templates/app/public/icons/icon-512x512.png +0 -0
- package/src/templates/app/public/icons/icon-72x72.png +0 -0
- package/src/templates/app/public/icons/icon-96x96.png +0 -0
- package/src/templates/app/public/logo.svg +70 -0
- package/src/templates/app/public/manifest.json.template +67 -0
- package/src/templates/app/tsconfig.json.template +22 -0
- package/src/templates/app/tsconfig.spec.json.template +7 -0
- package/src/templates/app/ui/Footer.js +65 -0
- package/src/templates/app/ui/MainHeader.js +129 -0
- package/src/templates/app/ui/index.js +31 -0
- package/src/templates/client.js +43 -0
- package/src/templates/crudPages/[__model__Id]/edit/page.js +71 -0
- package/src/templates/crudPages/[__model__Id]/page.js +81 -0
- package/src/templates/crudPages/new/page.js +68 -0
- package/src/templates/crudPages/page.js +69 -0
- package/src/templates/index.js +32 -0
- package/src/templates/lib/__lib/extends/summary.constant.js +44 -0
- package/src/templates/lib/__lib/lib.constant.js +54 -0
- package/src/templates/lib/__lib/lib.dictionary.js +43 -0
- package/src/templates/lib/__lib/lib.document.js +42 -0
- package/src/templates/lib/__lib/lib.service.js +84 -0
- package/src/templates/lib/__lib/lib.signal.js +37 -0
- package/src/templates/lib/__lib/lib.store.js +35 -0
- package/src/templates/lib/__scalar/_server.js +40 -0
- package/src/templates/lib/cnst.js +33 -0
- package/src/templates/lib/cnst_.js +52 -0
- package/src/templates/lib/db.js +54 -0
- package/src/templates/lib/dict.js +46 -0
- package/src/templates/lib/fetch.js +49 -0
- package/src/templates/lib/sig.js +38 -0
- package/src/templates/lib/srv.js +53 -0
- package/src/templates/lib/st.js +37 -0
- package/src/templates/lib/store.js +53 -0
- package/src/templates/lib/usePage.js +34 -0
- package/src/templates/libRoot/.gitignore.template +15 -0
- package/src/templates/libRoot/jest.config.js +37 -0
- package/src/templates/libRoot/package.json.template +5 -0
- package/src/templates/libRoot/tsconfig.json.template +11 -0
- package/src/templates/libRoot/tsconfig.spec.json.template +7 -0
- package/src/templates/module/__Model__.Template.js +52 -0
- package/src/templates/module/__Model__.Unit.js +40 -0
- package/src/templates/module/__Model__.Util.js +68 -0
- package/src/templates/module/__Model__.View.js +46 -0
- package/src/templates/module/__Model__.Zone.js +81 -0
- package/src/templates/module/__model__.constant.js +70 -0
- package/src/templates/module/__model__.dictionary.js +99 -0
- package/src/templates/module/__model__.document.js +54 -0
- package/src/templates/module/__model__.service.js +42 -0
- package/src/templates/module/__model__.signal.js +61 -0
- package/src/templates/module/__model__.signal.spec.js +40 -0
- package/src/templates/module/__model__.signal.test.js +49 -0
- package/src/templates/module/__model__.store.js +40 -0
- package/src/templates/module/_server.js +48 -0
- package/src/templates/module/index.js +59 -0
- package/src/templates/pkgRoot/tsconfig.json.template +12 -0
- package/src/templates/server.js +60 -0
- package/src/templates/workplaceRoot/.env.template +20 -0
- package/src/templates/workplaceRoot/.gitignore.template +195 -0
- package/src/templates/workplaceRoot/.prettierignore.template +10 -0
- package/src/templates/workplaceRoot/.prettierrc.json.template +5 -0
- package/src/templates/workplaceRoot/.swcrc.template +9 -0
- package/src/templates/workplaceRoot/README.md.template +37 -0
- package/src/templates/workplaceRoot/eslint.config.js.template +141 -0
- package/src/templates/workplaceRoot/tsconfig.json.template +29 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// pkgs/@akanjs/cli/src/templates/app/lib/user/User.Template.tsx
|
|
20
|
+
var User_Template_exports = {};
|
|
21
|
+
__export(User_Template_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(User_Template_exports);
|
|
25
|
+
function getContent(scanResult, dict) {
|
|
26
|
+
return `
|
|
27
|
+
"use client";
|
|
28
|
+
import { clsx } from "@akanjs/client";
|
|
29
|
+
import { Field } from "@shared/ui";
|
|
30
|
+
import { Layout } from "@util/ui";
|
|
31
|
+
import { st, usePage } from "@${dict.appName}/client";
|
|
32
|
+
|
|
33
|
+
interface UserEditProps {
|
|
34
|
+
className?: string;
|
|
35
|
+
userId?: string | null;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const General = ({ className, userId = undefined }: UserEditProps) => {
|
|
39
|
+
const userForm = st.use.userForm();
|
|
40
|
+
const { l } = usePage();
|
|
41
|
+
return (
|
|
42
|
+
<Layout.Template className={clsx("flex flex-col gap-4", className)}>
|
|
43
|
+
<div className="w-[150px] flex mt-10 md:mt-0">
|
|
44
|
+
<Field.Img
|
|
45
|
+
label={l.field("user", "image")}
|
|
46
|
+
desc={l.desc("user", "image")}
|
|
47
|
+
sliceName="user"
|
|
48
|
+
value={userForm.image}
|
|
49
|
+
onChange={st.do.setImageOnUser}
|
|
50
|
+
/>
|
|
51
|
+
</div>
|
|
52
|
+
<Field.Text
|
|
53
|
+
label={l.field("user", "nickname")}
|
|
54
|
+
desc={l.desc("user", "nickname")}
|
|
55
|
+
value={userForm.nickname}
|
|
56
|
+
onChange={st.do.setNicknameOnUser}
|
|
57
|
+
/>
|
|
58
|
+
</Layout.Template>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
`;
|
|
62
|
+
}
|
|
63
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// pkgs/@akanjs/cli/src/templates/app/lib/user/User.Unit.tsx
|
|
20
|
+
var User_Unit_exports = {};
|
|
21
|
+
__export(User_Unit_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(User_Unit_exports);
|
|
25
|
+
function getContent(scanResult, dict = {}) {
|
|
26
|
+
return `
|
|
27
|
+
import { ModelProps } from "@akanjs/client";
|
|
28
|
+
|
|
29
|
+
import { cnst } from "../cnst";
|
|
30
|
+
|
|
31
|
+
export const Card = ({ className, user }: ModelProps<"user", cnst.LightUser>) => {
|
|
32
|
+
return <div>{user.id}</div>;
|
|
33
|
+
};
|
|
34
|
+
`;
|
|
35
|
+
}
|
|
36
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// pkgs/@akanjs/cli/src/templates/app/lib/user/User.Util.tsx
|
|
20
|
+
var User_Util_exports = {};
|
|
21
|
+
__export(User_Util_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(User_Util_exports);
|
|
25
|
+
function getContent(scanResult, dict) {
|
|
26
|
+
return `
|
|
27
|
+
"use client";
|
|
28
|
+
import { ModelDashboardProps, ModelInsightProps } from "@akanjs/client";
|
|
29
|
+
import { getQueryMap } from "@akanjs/constant";
|
|
30
|
+
import { cnst, st } from "@${dict.appName}/client";
|
|
31
|
+
import { Data } from "@shared/ui";
|
|
32
|
+
import { AiOutlineEdit, AiOutlineLock, AiOutlineUnlock } from "react-icons/ai";
|
|
33
|
+
|
|
34
|
+
export const Stat = ({
|
|
35
|
+
className,
|
|
36
|
+
summary,
|
|
37
|
+
sliceName = "user",
|
|
38
|
+
queryMap = getQueryMap(cnst.UserSummary),
|
|
39
|
+
hidePresents,
|
|
40
|
+
}: ModelDashboardProps<cnst.Summary>) => {
|
|
41
|
+
return (
|
|
42
|
+
<Data.Dashboard
|
|
43
|
+
className={className}
|
|
44
|
+
summary={summary}
|
|
45
|
+
sliceName={sliceName}
|
|
46
|
+
queryMap={queryMap}
|
|
47
|
+
columns={["totalUser", "dau"]}
|
|
48
|
+
hidePresents={hidePresents}
|
|
49
|
+
/>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
export const Insight = ({ className, insight, sliceName = "user" }: ModelInsightProps<cnst.UserInsight>) => {
|
|
53
|
+
return <Data.Insight className={className} insight={insight} sliceName={sliceName} columns={["count"]} />;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
interface RestrictProps {
|
|
57
|
+
id: string;
|
|
58
|
+
}
|
|
59
|
+
export const Restrict = ({ id }: RestrictProps) => {
|
|
60
|
+
return (
|
|
61
|
+
<button className="gap-2 btn btn-sm" onClick={() => st.do.restrictUser(id, "Violated Community Guidelines")}>
|
|
62
|
+
<AiOutlineLock />
|
|
63
|
+
Restrict
|
|
64
|
+
</button>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
interface ReleaseProps {
|
|
69
|
+
id: string;
|
|
70
|
+
}
|
|
71
|
+
export const Release = ({ id }: ReleaseProps) => {
|
|
72
|
+
return (
|
|
73
|
+
<button className="gap-2 border-dashed btn btn-sm btn-outline" onClick={() => st.do.releaseUser(id)}>
|
|
74
|
+
<AiOutlineUnlock />
|
|
75
|
+
Release
|
|
76
|
+
</button>
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const EditSelf = () => {
|
|
81
|
+
const self = st.use.self();
|
|
82
|
+
const userModal = st.use.userModal();
|
|
83
|
+
return userModal !== "edit" ? (
|
|
84
|
+
<button className="gap-2 btn" onClick={() => st.do.editUser(self)}>
|
|
85
|
+
<AiOutlineEdit />
|
|
86
|
+
Edit
|
|
87
|
+
</button>
|
|
88
|
+
) : null;
|
|
89
|
+
};
|
|
90
|
+
`;
|
|
91
|
+
}
|
|
92
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// pkgs/@akanjs/cli/src/templates/app/lib/user/User.View.tsx
|
|
20
|
+
var User_View_exports = {};
|
|
21
|
+
__export(User_View_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(User_View_exports);
|
|
25
|
+
function getContent(scanResult, dict) {
|
|
26
|
+
return `
|
|
27
|
+
import { clsx } from "@akanjs/client";
|
|
28
|
+
import { usePage } from "@${dict.appName}/client";
|
|
29
|
+
import { Avatar } from "@util/ui";
|
|
30
|
+
import { AiOutlineUser } from "react-icons/ai";
|
|
31
|
+
|
|
32
|
+
import { cnst } from "../cnst";
|
|
33
|
+
|
|
34
|
+
interface UserViewProps {
|
|
35
|
+
className?: string;
|
|
36
|
+
user: cnst.User;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const General = ({ className, user }: UserViewProps) => {
|
|
40
|
+
const { l } = usePage();
|
|
41
|
+
return (
|
|
42
|
+
<div className={clsx("flex flex-col gap-4", className)}>
|
|
43
|
+
<div>
|
|
44
|
+
<div className="font-bold">Profile</div>
|
|
45
|
+
<div className="text-base">
|
|
46
|
+
<Avatar
|
|
47
|
+
className="flex items-center justify-center w-24 h-24"
|
|
48
|
+
icon={<AiOutlineUser className="text-4xl" />}
|
|
49
|
+
src={user.image?.url}
|
|
50
|
+
/>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
<div>
|
|
54
|
+
<div className="flex gap-2 items-center">
|
|
55
|
+
<div className="font-bold">Nickname</div>
|
|
56
|
+
</div>
|
|
57
|
+
<p className="text-base">{user.nickname}</p>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
);
|
|
61
|
+
};
|
|
62
|
+
`;
|
|
63
|
+
}
|
|
64
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// pkgs/@akanjs/cli/src/templates/app/lib/user/User.Zone.tsx
|
|
20
|
+
var User_Zone_exports = {};
|
|
21
|
+
__export(User_Zone_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(User_Zone_exports);
|
|
25
|
+
function getContent(scanResult, dict) {
|
|
26
|
+
return `
|
|
27
|
+
"use client";
|
|
28
|
+
import { ModelsProps } from "@akanjs/client";
|
|
29
|
+
import { DefaultOf } from "@akanjs/signal";
|
|
30
|
+
import { cnst, st, User } from "@${dict.appName}/client";
|
|
31
|
+
import { Data, Model } from "@shared/ui";
|
|
32
|
+
|
|
33
|
+
export const Admin = ({ sliceName = "user", init, query }: ModelsProps<cnst.User>) => {
|
|
34
|
+
return (
|
|
35
|
+
<Data.ListContainer
|
|
36
|
+
init={init}
|
|
37
|
+
query={query}
|
|
38
|
+
sliceName={sliceName}
|
|
39
|
+
renderItem={User.Unit.Card}
|
|
40
|
+
renderDashboard={User.Util.Stat}
|
|
41
|
+
renderInsight={User.Util.Insight}
|
|
42
|
+
renderTemplate={User.Template.General}
|
|
43
|
+
renderTitle={(user: DefaultOf<cnst.User>) => \`\${user.nickname}\`}
|
|
44
|
+
renderView={(user: cnst.User) => <User.View.General user={user} />}
|
|
45
|
+
type="list"
|
|
46
|
+
columns={["nickname", "status", "lastLoginAt", "createdAt"]}
|
|
47
|
+
actions={(user: cnst.LightUser, idx) => [
|
|
48
|
+
"remove",
|
|
49
|
+
"edit",
|
|
50
|
+
"view",
|
|
51
|
+
user.status === "active"
|
|
52
|
+
? { type: "restrict", render: () => <User.Util.Restrict id={user.id} /> }
|
|
53
|
+
: { type: "release", render: () => <User.Util.Release id={user.id} /> },
|
|
54
|
+
]}
|
|
55
|
+
/>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const Self = () => {
|
|
60
|
+
const self = st.use.self();
|
|
61
|
+
const userModal = st.use.userModal();
|
|
62
|
+
return userModal === "edit" ? (
|
|
63
|
+
<Model.EditModal type="form" sliceName="user" submitOption={{ path: "self" }}>
|
|
64
|
+
<User.Template.General />
|
|
65
|
+
</Model.EditModal>
|
|
66
|
+
) : (
|
|
67
|
+
<User.View.General user={self} />
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
`;
|
|
71
|
+
}
|
|
72
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// pkgs/@akanjs/cli/src/templates/app/lib/user/_server.ts
|
|
20
|
+
var server_exports = {};
|
|
21
|
+
__export(server_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(server_exports);
|
|
25
|
+
function getContent(scanResult, dict = {}) {
|
|
26
|
+
return `
|
|
27
|
+
import { databaseModuleOf } from "@akanjs/server";
|
|
28
|
+
|
|
29
|
+
import { cnst } from "../cnst";
|
|
30
|
+
import * as db from "../db";
|
|
31
|
+
import type { ModulesOptions } from "../option";
|
|
32
|
+
import { allSrvs } from "../srv";
|
|
33
|
+
import { UserService } from "./user.service";
|
|
34
|
+
import { UserSignal } from "./user.signal";
|
|
35
|
+
|
|
36
|
+
export const registerUserModule = (option: ModulesOptions) =>
|
|
37
|
+
databaseModuleOf(
|
|
38
|
+
{
|
|
39
|
+
constant: cnst.userCnst,
|
|
40
|
+
database: db.userDb,
|
|
41
|
+
signal: UserSignal,
|
|
42
|
+
service: UserService,
|
|
43
|
+
extended: true,
|
|
44
|
+
},
|
|
45
|
+
allSrvs
|
|
46
|
+
);
|
|
47
|
+
`;
|
|
48
|
+
}
|
|
49
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// pkgs/@akanjs/cli/src/templates/app/lib/user/index.tsx
|
|
20
|
+
var user_exports = {};
|
|
21
|
+
__export(user_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(user_exports);
|
|
25
|
+
function getContent(scanResult, dict = {}) {
|
|
26
|
+
return `
|
|
27
|
+
import { Signal } from "@util/ui";
|
|
28
|
+
import { AiOutlineUser } from "react-icons/ai";
|
|
29
|
+
|
|
30
|
+
import * as Template from "./User.Template";
|
|
31
|
+
import * as Unit from "./User.Unit";
|
|
32
|
+
import * as Util from "./User.Util";
|
|
33
|
+
import * as View from "./User.View";
|
|
34
|
+
import * as Zone from "./User.Zone";
|
|
35
|
+
|
|
36
|
+
export const User = {
|
|
37
|
+
Menu: {
|
|
38
|
+
Admin: {
|
|
39
|
+
key: "user",
|
|
40
|
+
label: "User",
|
|
41
|
+
icon: <AiOutlineUser />,
|
|
42
|
+
render: () => <Zone.Admin />,
|
|
43
|
+
},
|
|
44
|
+
Doc: {
|
|
45
|
+
key: "user",
|
|
46
|
+
label: "User",
|
|
47
|
+
icon: <AiOutlineUser />,
|
|
48
|
+
render: () => <Signal.Doc.Zone refName="user" />,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
Template,
|
|
52
|
+
Unit,
|
|
53
|
+
Util,
|
|
54
|
+
View,
|
|
55
|
+
Zone,
|
|
56
|
+
};
|
|
57
|
+
`;
|
|
58
|
+
}
|
|
59
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// pkgs/@akanjs/cli/src/templates/app/lib/user/user.constant.ts
|
|
20
|
+
var user_constant_exports = {};
|
|
21
|
+
__export(user_constant_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(user_constant_exports);
|
|
25
|
+
function getContent(scanResult, dict) {
|
|
26
|
+
return `
|
|
27
|
+
import { as, from, Model, sortOf, via } from "@akanjs/constant";
|
|
28
|
+
|
|
29
|
+
import {
|
|
30
|
+
libUserFilters,
|
|
31
|
+
libUserInputs,
|
|
32
|
+
libUserInsights,
|
|
33
|
+
libUsers,
|
|
34
|
+
libUserSummaries,
|
|
35
|
+
root,
|
|
36
|
+
} from "../__lib/lib.constant";
|
|
37
|
+
|
|
38
|
+
@Model.Input("${dict.AppName}UserInput")
|
|
39
|
+
export class ${dict.AppName}UserInput {}
|
|
40
|
+
|
|
41
|
+
@Model.Object("${dict.AppName}User")
|
|
42
|
+
export class ${dict.AppName}User extends as(${dict.AppName}UserInput) {}
|
|
43
|
+
|
|
44
|
+
@Model.Insight("${dict.AppName}UserInsight")
|
|
45
|
+
export class ${dict.AppName}UserInsight {}
|
|
46
|
+
|
|
47
|
+
@Model.Summary("${dict.AppName}UserSummary")
|
|
48
|
+
export class ${dict.AppName}UserSummary {}
|
|
49
|
+
|
|
50
|
+
@Model.Filter("${dict.AppName}UserFilter")
|
|
51
|
+
export class ${dict.AppName}UserFilter extends sortOf(root.User, {}) {}
|
|
52
|
+
|
|
53
|
+
export class UserInput extends from(...libUserInputs, ${dict.AppName}UserInput) {}
|
|
54
|
+
export class UserObject extends from(...libUsers, ${dict.AppName}User) {}
|
|
55
|
+
|
|
56
|
+
@Model.Light("LightUser")
|
|
57
|
+
export class LightUser extends via(UserObject, ["nickname", "image", "roles", "status"] as const) {}
|
|
58
|
+
|
|
59
|
+
@Model.Full("User")
|
|
60
|
+
export class User extends via(UserObject, LightUser, root.User, root.LightUser) {}
|
|
61
|
+
|
|
62
|
+
export class UserSummary extends from(...libUserSummaries, ${dict.AppName}UserSummary) {}
|
|
63
|
+
export class UserInsight extends from(...libUserInsights, ${dict.AppName}UserInsight) {}
|
|
64
|
+
|
|
65
|
+
export class UserFilter extends from(...libUserFilters, ${dict.AppName}UserFilter) {}
|
|
66
|
+
`;
|
|
67
|
+
}
|
|
68
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// pkgs/@akanjs/cli/src/templates/app/lib/user/user.dictionary.ts
|
|
20
|
+
var user_dictionary_exports = {};
|
|
21
|
+
__export(user_dictionary_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(user_dictionary_exports);
|
|
25
|
+
function getContent(scanResult, dict) {
|
|
26
|
+
return `
|
|
27
|
+
import { ExtendModelDictionary, SignalDictionary, SummaryDictionary } from "@akanjs/dictionary";
|
|
28
|
+
|
|
29
|
+
import type { ${dict.AppName}User, ${dict.AppName}UserFilter, ${dict.AppName}UserInsight, ${dict.AppName}UserSummary } from "./user.constant";
|
|
30
|
+
import type { UserSignal } from "./user.signal";
|
|
31
|
+
|
|
32
|
+
const modelDictionary = {
|
|
33
|
+
// * ==================== Model ==================== * //
|
|
34
|
+
// * ==================== Model ==================== * //
|
|
35
|
+
// * ==================== Insight ==================== * //
|
|
36
|
+
// * ==================== Insight ==================== * //
|
|
37
|
+
// * ==================== Filter ==================== * //
|
|
38
|
+
// * ==================== Filter ==================== * //
|
|
39
|
+
// * ==================== Etc ==================== * //
|
|
40
|
+
// * ==================== Etc ==================== * //
|
|
41
|
+
} satisfies ExtendModelDictionary<${dict.AppName}User, ${dict.AppName}UserInsight, ${dict.AppName}UserFilter>;
|
|
42
|
+
|
|
43
|
+
export const userSummaryDictionary = {} satisfies SummaryDictionary<${dict.AppName}UserSummary>;
|
|
44
|
+
|
|
45
|
+
const signalDictionary = {
|
|
46
|
+
// * ==================== Endpoint ==================== * //
|
|
47
|
+
// * ==================== Endpoint ==================== * //
|
|
48
|
+
} satisfies SignalDictionary<UserSignal, ${dict.AppName}User>;
|
|
49
|
+
|
|
50
|
+
export const userDictionary = { ...modelDictionary, ...signalDictionary };
|
|
51
|
+
`;
|
|
52
|
+
}
|
|
53
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// pkgs/@akanjs/cli/src/templates/app/lib/user/user.document.ts
|
|
20
|
+
var user_document_exports = {};
|
|
21
|
+
__export(user_document_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(user_document_exports);
|
|
25
|
+
function getContent(scanResult, dict) {
|
|
26
|
+
return `
|
|
27
|
+
import { beyond, by, Database, into, type SchemaOf } from "@akanjs/document";
|
|
28
|
+
|
|
29
|
+
import { rootUser } from "../__lib/lib.document";
|
|
30
|
+
import { cnst } from "../cnst";
|
|
31
|
+
|
|
32
|
+
@Database.Input(() => cnst.UserInput)
|
|
33
|
+
export class UserInput extends by(rootUser.Input, cnst.UserInput) {}
|
|
34
|
+
|
|
35
|
+
@Database.Document(() => cnst.User)
|
|
36
|
+
export class User extends by(rootUser.Doc, cnst.User) {}
|
|
37
|
+
|
|
38
|
+
@Database.Model(() => cnst.User)
|
|
39
|
+
export class UserModel extends into(User, cnst.userCnst) {
|
|
40
|
+
async getSummary(): Promise<cnst.UserSummary> {
|
|
41
|
+
return {
|
|
42
|
+
...(await this.getDefaultSummary()),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@Database.Middleware(() => cnst.User)
|
|
48
|
+
export class UserMiddleware extends beyond(UserModel, User) {
|
|
49
|
+
onSchema(schema: SchemaOf<UserModel, User>) {
|
|
50
|
+
//
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
}
|
|
55
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// pkgs/@akanjs/cli/src/templates/app/lib/user/user.service.ts
|
|
20
|
+
var user_service_exports = {};
|
|
21
|
+
__export(user_service_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(user_service_exports);
|
|
25
|
+
function getContent(scanResult, dict) {
|
|
26
|
+
return `
|
|
27
|
+
import { ExtendedUserService, Service } from "@akanjs/service";
|
|
28
|
+
|
|
29
|
+
import { LibUserService } from "../__lib/lib.service";
|
|
30
|
+
import { cnst } from "../cnst";
|
|
31
|
+
import * as db from "../db";
|
|
32
|
+
|
|
33
|
+
@Service("UserService")
|
|
34
|
+
export class UserService extends ExtendedUserService(db.userDb, LibUserService) {
|
|
35
|
+
async summarize${dict.AppName}(): Promise<cnst.${dict.AppName}UserSummary> {
|
|
36
|
+
return {
|
|
37
|
+
...(await this.userModel.getSummary()),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
42
|
+
}
|
|
43
|
+
module.exports = module.exports.default;
|