@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,42 @@
|
|
|
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/setting/setting.store.ts
|
|
20
|
+
var setting_store_exports = {};
|
|
21
|
+
__export(setting_store_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(setting_store_exports);
|
|
25
|
+
function getContent(scanResult, dict = {}) {
|
|
26
|
+
return `
|
|
27
|
+
import { stateOf, Store } from "@akanjs/store";
|
|
28
|
+
|
|
29
|
+
import { cnst } from "../cnst";
|
|
30
|
+
import { fetch, settingGql } from "../fetch";
|
|
31
|
+
|
|
32
|
+
@Store(() => cnst.Setting)
|
|
33
|
+
export class SettingStore extends stateOf(settingGql, {
|
|
34
|
+
// state
|
|
35
|
+
}) {
|
|
36
|
+
async getActiveSetting() {
|
|
37
|
+
this.set({ setting: (await fetch.getActiveSetting()) as cnst.Setting, settingLoading: false });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
}
|
|
42
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,41 @@
|
|
|
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/summary/Summary.Template.tsx
|
|
20
|
+
var Summary_Template_exports = {};
|
|
21
|
+
__export(Summary_Template_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(Summary_Template_exports);
|
|
25
|
+
function getContent(scanResult, dict) {
|
|
26
|
+
return `
|
|
27
|
+
"use client";
|
|
28
|
+
import { st, usePage } from "@${dict.appName}/client";
|
|
29
|
+
|
|
30
|
+
interface SummaryEditProps {
|
|
31
|
+
summaryId?: string | null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const General = ({ summaryId = undefined }: SummaryEditProps) => {
|
|
35
|
+
const summaryForm = st.use.summaryForm();
|
|
36
|
+
const { l } = usePage();
|
|
37
|
+
return <div className="flex items-center mb-4"></div>;
|
|
38
|
+
};
|
|
39
|
+
`;
|
|
40
|
+
}
|
|
41
|
+
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/summary/Summary.Unit.tsx
|
|
20
|
+
var Summary_Unit_exports = {};
|
|
21
|
+
__export(Summary_Unit_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(Summary_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, summary }: ModelProps<"summary", cnst.LightSummary>) => {
|
|
32
|
+
return <div>{summary.id}</div>;
|
|
33
|
+
};
|
|
34
|
+
`;
|
|
35
|
+
}
|
|
36
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,31 @@
|
|
|
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/summary/Summary.Util.tsx
|
|
20
|
+
var Summary_Util_exports = {};
|
|
21
|
+
__export(Summary_Util_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(Summary_Util_exports);
|
|
25
|
+
function getContent(scanResult, dict = {}) {
|
|
26
|
+
return `
|
|
27
|
+
"use client";
|
|
28
|
+
export const noData = 1;
|
|
29
|
+
`;
|
|
30
|
+
}
|
|
31
|
+
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/summary/Summary.View.tsx
|
|
20
|
+
var Summary_View_exports = {};
|
|
21
|
+
__export(Summary_View_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(Summary_View_exports);
|
|
25
|
+
function getContent(scanResult, dict) {
|
|
26
|
+
return `
|
|
27
|
+
import { User, usePage } from "@${dict.appName}/client";
|
|
28
|
+
import { clsx } from "@akanjs/client";
|
|
29
|
+
|
|
30
|
+
import { cnst } from "../cnst";
|
|
31
|
+
|
|
32
|
+
interface SummaryViewProps {
|
|
33
|
+
className?: string;
|
|
34
|
+
summary: cnst.Summary;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const General = ({ className, summary }: SummaryViewProps) => {
|
|
38
|
+
const { l } = usePage();
|
|
39
|
+
return (
|
|
40
|
+
<div className={clsx(className, "mr-12")}>
|
|
41
|
+
<div className="grid grid-cols-5 gap-4">
|
|
42
|
+
<User.Util.Stat className="col-span-2 " summary={summary} />
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
`;
|
|
48
|
+
}
|
|
49
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,60 @@
|
|
|
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/summary/Summary.Zone.tsx
|
|
20
|
+
var Summary_Zone_exports = {};
|
|
21
|
+
__export(Summary_Zone_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(Summary_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 { st, Summary } from "@${dict.appName}/client";
|
|
31
|
+
import { Data } from "@shared/ui";
|
|
32
|
+
import { Loading } from "@util/ui";
|
|
33
|
+
|
|
34
|
+
import { cnst } from "../cnst";
|
|
35
|
+
|
|
36
|
+
export const Admin = ({ sliceName = "summary", init, query }: ModelsProps<cnst.Summary>) => {
|
|
37
|
+
return (
|
|
38
|
+
<Data.ListContainer
|
|
39
|
+
init={init}
|
|
40
|
+
query={query}
|
|
41
|
+
sliceName={sliceName}
|
|
42
|
+
renderItem={Summary.Unit.Card}
|
|
43
|
+
renderTemplate={Summary.Template.General}
|
|
44
|
+
renderTitle={(summary: DefaultOf<cnst.Summary>) => \`\${summary.at}\`}
|
|
45
|
+
renderView={(summary: cnst.Summary) => <Summary.View.General summary={summary} />}
|
|
46
|
+
type="list"
|
|
47
|
+
columns={["type", "status", "createdAt"]}
|
|
48
|
+
actions={(summary: cnst.LightSummary, idx) => ["remove", "edit"]}
|
|
49
|
+
/>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const Dashboard = () => {
|
|
54
|
+
const summary = st.use.summary();
|
|
55
|
+
if (!summary) return <Loading.Skeleton active />;
|
|
56
|
+
return <Summary.View.General summary={summary} />;
|
|
57
|
+
};
|
|
58
|
+
`;
|
|
59
|
+
}
|
|
60
|
+
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/summary/_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 { SummaryService } from "./summary.service";
|
|
34
|
+
import { SummarySignal } from "./summary.signal";
|
|
35
|
+
|
|
36
|
+
export const registerSummaryModule = (option: ModulesOptions) =>
|
|
37
|
+
databaseModuleOf(
|
|
38
|
+
{
|
|
39
|
+
constant: cnst.summaryCnst,
|
|
40
|
+
database: db.summaryDb,
|
|
41
|
+
signal: SummarySignal,
|
|
42
|
+
service: SummaryService,
|
|
43
|
+
extended: true,
|
|
44
|
+
},
|
|
45
|
+
allSrvs
|
|
46
|
+
);
|
|
47
|
+
`;
|
|
48
|
+
}
|
|
49
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,65 @@
|
|
|
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/summary/index.tsx
|
|
20
|
+
var summary_exports = {};
|
|
21
|
+
__export(summary_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(summary_exports);
|
|
25
|
+
function getContent(scanResult, dict = {}) {
|
|
26
|
+
return `
|
|
27
|
+
import { Signal } from "@util/ui";
|
|
28
|
+
import { AiOutlineLineChart } from "react-icons/ai";
|
|
29
|
+
|
|
30
|
+
import * as Template from "./Summary.Template";
|
|
31
|
+
import * as Unit from "./Summary.Unit";
|
|
32
|
+
import * as Util from "./Summary.Util";
|
|
33
|
+
import * as View from "./Summary.View";
|
|
34
|
+
import * as Zone from "./Summary.Zone";
|
|
35
|
+
|
|
36
|
+
export const Summary = {
|
|
37
|
+
Menu: {
|
|
38
|
+
Admin: {
|
|
39
|
+
key: "summary",
|
|
40
|
+
label: "Summary",
|
|
41
|
+
icon: <AiOutlineLineChart />,
|
|
42
|
+
render: () => <Zone.Admin />,
|
|
43
|
+
},
|
|
44
|
+
Doc: {
|
|
45
|
+
key: "summary",
|
|
46
|
+
label: "Summary",
|
|
47
|
+
icon: <AiOutlineLineChart />,
|
|
48
|
+
render: () => <Signal.Doc.Zone refName="summary" />,
|
|
49
|
+
},
|
|
50
|
+
Dashboard: {
|
|
51
|
+
key: "summary",
|
|
52
|
+
label: "Summary",
|
|
53
|
+
icon: <AiOutlineLineChart />,
|
|
54
|
+
render: () => <Zone.Dashboard />,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
Template,
|
|
58
|
+
Unit,
|
|
59
|
+
Util,
|
|
60
|
+
View,
|
|
61
|
+
Zone,
|
|
62
|
+
};
|
|
63
|
+
`;
|
|
64
|
+
}
|
|
65
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,45 @@
|
|
|
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/summary/summary.constant.ts
|
|
20
|
+
var summary_constant_exports = {};
|
|
21
|
+
__export(summary_constant_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(summary_constant_exports);
|
|
25
|
+
function getContent(scanResult, dict) {
|
|
26
|
+
return `
|
|
27
|
+
import { from, Model, over, via } from "@akanjs/constant";
|
|
28
|
+
|
|
29
|
+
import { modelSummaries } from "../__lib/extends/summary.constant";
|
|
30
|
+
import { libSummaries, root } from "../__lib/lib.constant";
|
|
31
|
+
|
|
32
|
+
@Model.Summary("${dict.AppName}Summary")
|
|
33
|
+
export class ${dict.AppName}Summary extends over(...modelSummaries) {}
|
|
34
|
+
|
|
35
|
+
export class SummaryObject extends from(...libSummaries, ${dict.AppName}Summary) {}
|
|
36
|
+
export class SummaryInput extends root.SummaryInput {}
|
|
37
|
+
|
|
38
|
+
@Model.Light("LightSummary")
|
|
39
|
+
export class LightSummary extends via(SummaryObject, ["at"] as const) {}
|
|
40
|
+
|
|
41
|
+
@Model.Full("Summary")
|
|
42
|
+
export class Summary extends via(SummaryObject, LightSummary, root.Summary, root.LightSummary) {}
|
|
43
|
+
`;
|
|
44
|
+
}
|
|
45
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,50 @@
|
|
|
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/summary/summary.dictionary.ts
|
|
20
|
+
var summary_dictionary_exports = {};
|
|
21
|
+
__export(summary_dictionary_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(summary_dictionary_exports);
|
|
25
|
+
function getContent(scanResult, dict) {
|
|
26
|
+
return `
|
|
27
|
+
import { ExtendModelDictionary, SignalDictionary } from "@akanjs/dictionary";
|
|
28
|
+
|
|
29
|
+
import { libSummaryDictionary } from "../__lib/lib.dictionary";
|
|
30
|
+
import type { ${dict.AppName}Summary } from "./summary.constant";
|
|
31
|
+
import type { SummarySignal } from "./summary.signal";
|
|
32
|
+
|
|
33
|
+
const modelDictionary = {
|
|
34
|
+
// * ==================== Model ==================== * //
|
|
35
|
+
...libSummaryDictionary,
|
|
36
|
+
// * ==================== Model ==================== * //
|
|
37
|
+
|
|
38
|
+
// * ==================== Etc ==================== * //
|
|
39
|
+
// * ==================== Etc ==================== * //
|
|
40
|
+
} satisfies ExtendModelDictionary<${dict.AppName}Summary>;
|
|
41
|
+
|
|
42
|
+
const signalDictionary = {
|
|
43
|
+
// * ==================== Endpoint ==================== * //
|
|
44
|
+
// * ==================== Endpoint ==================== * //
|
|
45
|
+
} satisfies SignalDictionary<SummarySignal, ${dict.AppName}Summary>;
|
|
46
|
+
|
|
47
|
+
export const summaryDictionary = { ...modelDictionary, ...signalDictionary };
|
|
48
|
+
`;
|
|
49
|
+
}
|
|
50
|
+
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/summary/summary.document.ts
|
|
20
|
+
var summary_document_exports = {};
|
|
21
|
+
__export(summary_document_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(summary_document_exports);
|
|
25
|
+
function getContent(scanResult, dict = {}) {
|
|
26
|
+
return `
|
|
27
|
+
import { beyond, by, Database, inside, type SchemaOf } from "@akanjs/document";
|
|
28
|
+
|
|
29
|
+
import { rootSummary } from "../__lib/lib.document";
|
|
30
|
+
import { cnst } from "../cnst";
|
|
31
|
+
|
|
32
|
+
@Database.Input(() => cnst.SummaryInput)
|
|
33
|
+
export class SummaryInput extends by(rootSummary.Input, cnst.SummaryInput) {}
|
|
34
|
+
|
|
35
|
+
@Database.Document(() => cnst.Summary)
|
|
36
|
+
export class Summary extends by(rootSummary.Doc, cnst.Summary) {}
|
|
37
|
+
|
|
38
|
+
@Database.Model(() => cnst.Summary)
|
|
39
|
+
export class SummaryModel extends inside(rootSummary.Model, cnst.summaryCnst) {}
|
|
40
|
+
|
|
41
|
+
@Database.Middleware(() => cnst.Summary)
|
|
42
|
+
export class SummaryMiddleware extends beyond(SummaryModel, Summary) {
|
|
43
|
+
onSchema(schema: SchemaOf<SummaryModel, Summary>) {
|
|
44
|
+
//
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
`;
|
|
48
|
+
}
|
|
49
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,35 @@
|
|
|
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/summary/summary.service.ts
|
|
20
|
+
var summary_service_exports = {};
|
|
21
|
+
__export(summary_service_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(summary_service_exports);
|
|
25
|
+
function getContent(scanResult, dict) {
|
|
26
|
+
return `
|
|
27
|
+
import { Service } from "@akanjs/service";
|
|
28
|
+
|
|
29
|
+
import { ProtoSummaryService } from "../__lib/lib.service";
|
|
30
|
+
|
|
31
|
+
@Service("SummaryService")
|
|
32
|
+
export class SummaryService extends ProtoSummaryService {}
|
|
33
|
+
`;
|
|
34
|
+
}
|
|
35
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,35 @@
|
|
|
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/summary/summary.signal.ts
|
|
20
|
+
var summary_signal_exports = {};
|
|
21
|
+
__export(summary_signal_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(summary_signal_exports);
|
|
25
|
+
function getContent(scanResult, dict = {}) {
|
|
26
|
+
return `
|
|
27
|
+
import { LogSignal, Signal } from "@akanjs/signal";
|
|
28
|
+
|
|
29
|
+
import { cnst, Srvs } from "../cnst";
|
|
30
|
+
|
|
31
|
+
@Signal(() => cnst.Summary)
|
|
32
|
+
export class SummarySignal extends LogSignal(Srvs) {}
|
|
33
|
+
`;
|
|
34
|
+
}
|
|
35
|
+
module.exports = module.exports.default;
|
|
@@ -0,0 +1,42 @@
|
|
|
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/summary/summary.store.ts
|
|
20
|
+
var summary_store_exports = {};
|
|
21
|
+
__export(summary_store_exports, {
|
|
22
|
+
default: () => getContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(summary_store_exports);
|
|
25
|
+
function getContent(scanResult, dict = {}) {
|
|
26
|
+
return `
|
|
27
|
+
import { stateOf, Store } from "@akanjs/store";
|
|
28
|
+
|
|
29
|
+
import { cnst } from "../cnst";
|
|
30
|
+
import { fetch, summaryGql } from "../fetch";
|
|
31
|
+
|
|
32
|
+
@Store(() => cnst.Summary)
|
|
33
|
+
export class SummaryStore extends stateOf(summaryGql, {
|
|
34
|
+
// state
|
|
35
|
+
}) {
|
|
36
|
+
async getActiveSummary() {
|
|
37
|
+
this.set({ summary: (await fetch.getActiveSummary()) as cnst.Summary, summaryLoading: false });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
}
|
|
42
|
+
module.exports = module.exports.default;
|