@akanjs/cli 0.0.39 → 0.0.41

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 (181) hide show
  1. package/index.d.ts +1 -0
  2. package/index.js +75 -59
  3. package/package.json +2 -1
  4. package/src/application/application.command.d.ts +26 -0
  5. package/src/application/application.prompt.d.ts +2 -0
  6. package/src/application/application.runner.d.ts +35 -0
  7. package/src/application/application.script.d.ts +36 -0
  8. package/src/cloud/cloud.command.d.ts +8 -0
  9. package/src/cloud/cloud.runner.d.ts +7 -0
  10. package/src/cloud/cloud.script.d.ts +7 -0
  11. package/src/library/library.command.d.ts +8 -0
  12. package/src/library/library.runner.d.ts +4 -0
  13. package/src/library/library.script.d.ts +8 -0
  14. package/src/module/module.command.d.ts +13 -0
  15. package/src/module/module.prompt.d.ts +15 -0
  16. package/src/module/module.runner.d.ts +17 -0
  17. package/src/module/module.script.d.ts +11 -0
  18. package/src/package/package.command.d.ts +9 -0
  19. package/src/package/package.runner.d.ts +6 -0
  20. package/src/package/package.script.d.ts +7 -0
  21. package/src/package/page/page.command.d.ts +6 -0
  22. package/src/package/page/page.runner.d.ts +4 -0
  23. package/src/package/page/page.script.d.ts +5 -0
  24. package/src/workspace/workspace.command.d.ts +8 -0
  25. package/src/workspace/workspace.runner.d.ts +6 -0
  26. package/src/workspace/workspace.script.d.ts +7 -0
  27. package/templates/__scalar/__model__/__model__.constant.js +0 -34
  28. package/templates/__scalar/__model__/__model__.dictionary.js +0 -45
  29. package/templates/__scalar/__model__/__model__.document.js +0 -32
  30. package/templates/app/akan.config.ts.template +0 -5
  31. package/templates/app/app/[lang]/(__appName__)/(public)/forgotpassword/page.js +0 -43
  32. package/templates/app/app/[lang]/(__appName__)/(public)/page.js +0 -44
  33. package/templates/app/app/[lang]/(__appName__)/(public)/privacy/page.js +0 -38
  34. package/templates/app/app/[lang]/(__appName__)/(public)/signin/page.js +0 -46
  35. package/templates/app/app/[lang]/(__appName__)/(public)/termsofservice/page.js +0 -37
  36. package/templates/app/app/[lang]/(__appName__)/(user)/layout.js +0 -39
  37. package/templates/app/app/[lang]/(__appName__)/(user)/self/page.js +0 -56
  38. package/templates/app/app/[lang]/(__appName__)/layout.js +0 -48
  39. package/templates/app/app/[lang]/admin/layout.js +0 -49
  40. package/templates/app/app/[lang]/admin/page.js +0 -59
  41. package/templates/app/app/csr.js +0 -30
  42. package/templates/app/app/index.html.template +0 -13
  43. package/templates/app/app/layout.js +0 -34
  44. package/templates/app/app/robots.js +0 -39
  45. package/templates/app/app/sitemap.js +0 -35
  46. package/templates/app/base/baseLogic.js +0 -34
  47. package/templates/app/base/index.js +0 -28
  48. package/templates/app/capacitor.config.ts.template +0 -8
  49. package/templates/app/common/commonLogic.js +0 -34
  50. package/templates/app/common/index.js +0 -28
  51. package/templates/app/env/env.client.js +0 -37
  52. package/templates/app/env/env.client.type.js +0 -34
  53. package/templates/app/env/env.server.js +0 -37
  54. package/templates/app/jest.config.js +0 -35
  55. package/templates/app/lib/___appName__/__appName__.dictionary.js +0 -30
  56. package/templates/app/lib/___appName__/__appName__.service.js +0 -41
  57. package/templates/app/lib/___appName__/__appName__.store.js +0 -35
  58. package/templates/app/lib/___appName__/_server.js +0 -33
  59. package/templates/app/lib/option.js +0 -41
  60. package/templates/app/lib/setting/Setting.Template.js +0 -53
  61. package/templates/app/lib/setting/Setting.Unit.js +0 -34
  62. package/templates/app/lib/setting/Setting.Util.js +0 -30
  63. package/templates/app/lib/setting/Setting.View.js +0 -47
  64. package/templates/app/lib/setting/Setting.Zone.js +0 -76
  65. package/templates/app/lib/setting/_server.js +0 -47
  66. package/templates/app/lib/setting/index.js +0 -57
  67. package/templates/app/lib/setting/setting.constant.js +0 -45
  68. package/templates/app/lib/setting/setting.dictionary.js +0 -45
  69. package/templates/app/lib/setting/setting.document.js +0 -47
  70. package/templates/app/lib/setting/setting.service.js +0 -36
  71. package/templates/app/lib/setting/setting.signal.js +0 -33
  72. package/templates/app/lib/setting/setting.store.js +0 -40
  73. package/templates/app/lib/summary/Summary.Template.js +0 -39
  74. package/templates/app/lib/summary/Summary.Unit.js +0 -34
  75. package/templates/app/lib/summary/Summary.Util.js +0 -29
  76. package/templates/app/lib/summary/Summary.View.js +0 -47
  77. package/templates/app/lib/summary/Summary.Zone.js +0 -58
  78. package/templates/app/lib/summary/_server.js +0 -47
  79. package/templates/app/lib/summary/index.js +0 -63
  80. package/templates/app/lib/summary/summary.constant.js +0 -43
  81. package/templates/app/lib/summary/summary.dictionary.js +0 -48
  82. package/templates/app/lib/summary/summary.document.js +0 -47
  83. package/templates/app/lib/summary/summary.service.js +0 -33
  84. package/templates/app/lib/summary/summary.signal.js +0 -33
  85. package/templates/app/lib/summary/summary.store.js +0 -40
  86. package/templates/app/lib/user/User.Template.js +0 -61
  87. package/templates/app/lib/user/User.Unit.js +0 -34
  88. package/templates/app/lib/user/User.Util.js +0 -90
  89. package/templates/app/lib/user/User.View.js +0 -62
  90. package/templates/app/lib/user/User.Zone.js +0 -70
  91. package/templates/app/lib/user/_server.js +0 -47
  92. package/templates/app/lib/user/index.js +0 -57
  93. package/templates/app/lib/user/user.constant.js +0 -66
  94. package/templates/app/lib/user/user.dictionary.js +0 -51
  95. package/templates/app/lib/user/user.document.js +0 -53
  96. package/templates/app/lib/user/user.service.js +0 -41
  97. package/templates/app/lib/user/user.signal.js +0 -33
  98. package/templates/app/lib/user/user.signal.spec.js +0 -36
  99. package/templates/app/lib/user/user.signal.test.js +0 -38
  100. package/templates/app/lib/user/user.store.js +0 -38
  101. package/templates/app/main.js +0 -39
  102. package/templates/app/middleware.js +0 -34
  103. package/templates/app/nest/backendLogic.js +0 -33
  104. package/templates/app/nest/index.js +0 -28
  105. package/templates/app/next/frontendLogic.js +0 -33
  106. package/templates/app/next/index.js +0 -28
  107. package/templates/app/page.test.ts.template +0 -10
  108. package/templates/app/playwright.config.ts.template +0 -6
  109. package/templates/app/postcss.config.js.template +0 -10
  110. package/templates/app/public/favicon.ico +0 -0
  111. package/templates/app/public/icons/icon-128x128.png +0 -0
  112. package/templates/app/public/icons/icon-144x144.png +0 -0
  113. package/templates/app/public/icons/icon-152x152.png +0 -0
  114. package/templates/app/public/icons/icon-192x192.png +0 -0
  115. package/templates/app/public/icons/icon-256x256.png +0 -0
  116. package/templates/app/public/icons/icon-384x384.png +0 -0
  117. package/templates/app/public/icons/icon-48x48.png +0 -0
  118. package/templates/app/public/icons/icon-512x512.png +0 -0
  119. package/templates/app/public/icons/icon-72x72.png +0 -0
  120. package/templates/app/public/icons/icon-96x96.png +0 -0
  121. package/templates/app/public/logo.svg +0 -70
  122. package/templates/app/public/manifest.json.template +0 -67
  123. package/templates/app/tsconfig.json.template +0 -22
  124. package/templates/app/tsconfig.spec.json.template +0 -7
  125. package/templates/app/ui/Footer.js +0 -63
  126. package/templates/app/ui/MainHeader.js +0 -127
  127. package/templates/app/ui/index.js +0 -29
  128. package/templates/client.js +0 -41
  129. package/templates/crudPages/[__model__Id]/edit/page.js +0 -69
  130. package/templates/crudPages/[__model__Id]/page.js +0 -79
  131. package/templates/crudPages/new/page.js +0 -66
  132. package/templates/crudPages/page.js +0 -67
  133. package/templates/index.js +0 -30
  134. package/templates/lib/__lib/extends/summary.constant.js +0 -42
  135. package/templates/lib/__lib/lib.constant.js +0 -52
  136. package/templates/lib/__lib/lib.dictionary.js +0 -41
  137. package/templates/lib/__lib/lib.document.js +0 -40
  138. package/templates/lib/__lib/lib.service.js +0 -82
  139. package/templates/lib/__lib/lib.signal.js +0 -35
  140. package/templates/lib/__lib/lib.store.js +0 -33
  141. package/templates/lib/__scalar/_server.js +0 -38
  142. package/templates/lib/cnst.js +0 -31
  143. package/templates/lib/cnst_.js +0 -50
  144. package/templates/lib/db.js +0 -52
  145. package/templates/lib/dict.js +0 -44
  146. package/templates/lib/fetch.js +0 -47
  147. package/templates/lib/sig.js +0 -36
  148. package/templates/lib/srv.js +0 -51
  149. package/templates/lib/st.js +0 -35
  150. package/templates/lib/store.js +0 -51
  151. package/templates/lib/usePage.js +0 -32
  152. package/templates/libRoot/.gitignore.template +0 -15
  153. package/templates/libRoot/jest.config.js +0 -35
  154. package/templates/libRoot/package.json.template +0 -5
  155. package/templates/libRoot/tsconfig.json.template +0 -11
  156. package/templates/libRoot/tsconfig.spec.json.template +0 -7
  157. package/templates/module/__Model__.Template.js +0 -50
  158. package/templates/module/__Model__.Unit.js +0 -38
  159. package/templates/module/__Model__.Util.js +0 -66
  160. package/templates/module/__Model__.View.js +0 -44
  161. package/templates/module/__Model__.Zone.js +0 -79
  162. package/templates/module/__model__.constant.js +0 -68
  163. package/templates/module/__model__.dictionary.js +0 -97
  164. package/templates/module/__model__.document.js +0 -52
  165. package/templates/module/__model__.service.js +0 -40
  166. package/templates/module/__model__.signal.js +0 -59
  167. package/templates/module/__model__.signal.spec.js +0 -38
  168. package/templates/module/__model__.signal.test.js +0 -47
  169. package/templates/module/__model__.store.js +0 -38
  170. package/templates/module/_server.js +0 -46
  171. package/templates/module/index.js +0 -57
  172. package/templates/pkgRoot/tsconfig.json.template +0 -12
  173. package/templates/server.js +0 -58
  174. package/templates/workplaceRoot/.env.template +0 -20
  175. package/templates/workplaceRoot/.gitignore.template +0 -195
  176. package/templates/workplaceRoot/.prettierignore.template +0 -10
  177. package/templates/workplaceRoot/.prettierrc.json.template +0 -5
  178. package/templates/workplaceRoot/.swcrc.template +0 -9
  179. package/templates/workplaceRoot/README.md.template +0 -37
  180. package/templates/workplaceRoot/eslint.config.js.template +0 -141
  181. package/templates/workplaceRoot/tsconfig.json.template +0 -29
@@ -1,90 +0,0 @@
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
- var User_Util_exports = {};
19
- __export(User_Util_exports, {
20
- default: () => getContent
21
- });
22
- module.exports = __toCommonJS(User_Util_exports);
23
- function getContent(scanResult, dict) {
24
- return `
25
- "use client";
26
- import { ModelDashboardProps, ModelInsightProps } from "@akanjs/client";
27
- import { getQueryMap } from "@akanjs/constant";
28
- import { cnst, st } from "@${dict.appName}/client";
29
- import { Data } from "@shared/ui";
30
- import { AiOutlineEdit, AiOutlineLock, AiOutlineUnlock } from "react-icons/ai";
31
-
32
- export const Stat = ({
33
- className,
34
- summary,
35
- sliceName = "user",
36
- queryMap = getQueryMap(cnst.UserSummary),
37
- hidePresents,
38
- }: ModelDashboardProps<cnst.Summary>) => {
39
- return (
40
- <Data.Dashboard
41
- className={className}
42
- summary={summary}
43
- sliceName={sliceName}
44
- queryMap={queryMap}
45
- columns={["totalUser", "dau"]}
46
- hidePresents={hidePresents}
47
- />
48
- );
49
- };
50
- export const Insight = ({ className, insight, sliceName = "user" }: ModelInsightProps<cnst.UserInsight>) => {
51
- return <Data.Insight className={className} insight={insight} sliceName={sliceName} columns={["count"]} />;
52
- };
53
-
54
- interface RestrictProps {
55
- id: string;
56
- }
57
- export const Restrict = ({ id }: RestrictProps) => {
58
- return (
59
- <button className="gap-2 btn btn-sm" onClick={() => st.do.restrictUser(id, "Violated Community Guidelines")}>
60
- <AiOutlineLock />
61
- Restrict
62
- </button>
63
- );
64
- };
65
-
66
- interface ReleaseProps {
67
- id: string;
68
- }
69
- export const Release = ({ id }: ReleaseProps) => {
70
- return (
71
- <button className="gap-2 border-dashed btn btn-sm btn-outline" onClick={() => st.do.releaseUser(id)}>
72
- <AiOutlineUnlock />
73
- Release
74
- </button>
75
- );
76
- };
77
-
78
- export const EditSelf = () => {
79
- const self = st.use.self();
80
- const userModal = st.use.userModal();
81
- return userModal !== "edit" ? (
82
- <button className="gap-2 btn" onClick={() => st.do.editUser(self)}>
83
- <AiOutlineEdit />
84
- Edit
85
- </button>
86
- ) : null;
87
- };
88
- `;
89
- }
90
- module.exports = module.exports.default;
@@ -1,62 +0,0 @@
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
- var User_View_exports = {};
19
- __export(User_View_exports, {
20
- default: () => getContent
21
- });
22
- module.exports = __toCommonJS(User_View_exports);
23
- function getContent(scanResult, dict) {
24
- return `
25
- import { clsx } from "@akanjs/client";
26
- import { usePage } from "@${dict.appName}/client";
27
- import { Avatar } from "@util/ui";
28
- import { AiOutlineUser } from "react-icons/ai";
29
-
30
- import { cnst } from "../cnst";
31
-
32
- interface UserViewProps {
33
- className?: string;
34
- user: cnst.User;
35
- }
36
-
37
- export const General = ({ className, user }: UserViewProps) => {
38
- const { l } = usePage();
39
- return (
40
- <div className={clsx("flex flex-col gap-4", className)}>
41
- <div>
42
- <div className="font-bold">Profile</div>
43
- <div className="text-base">
44
- <Avatar
45
- className="flex items-center justify-center w-24 h-24"
46
- icon={<AiOutlineUser className="text-4xl" />}
47
- src={user.image?.url}
48
- />
49
- </div>
50
- </div>
51
- <div>
52
- <div className="flex gap-2 items-center">
53
- <div className="font-bold">Nickname</div>
54
- </div>
55
- <p className="text-base">{user.nickname}</p>
56
- </div>
57
- </div>
58
- );
59
- };
60
- `;
61
- }
62
- module.exports = module.exports.default;
@@ -1,70 +0,0 @@
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
- var User_Zone_exports = {};
19
- __export(User_Zone_exports, {
20
- default: () => getContent
21
- });
22
- module.exports = __toCommonJS(User_Zone_exports);
23
- function getContent(scanResult, dict) {
24
- return `
25
- "use client";
26
- import { ModelsProps } from "@akanjs/client";
27
- import { DefaultOf } from "@akanjs/signal";
28
- import { cnst, st, User } from "@${dict.appName}/client";
29
- import { Data, Model } from "@shared/ui";
30
-
31
- export const Admin = ({ sliceName = "user", init, query }: ModelsProps<cnst.User>) => {
32
- return (
33
- <Data.ListContainer
34
- init={init}
35
- query={query}
36
- sliceName={sliceName}
37
- renderItem={User.Unit.Card}
38
- renderDashboard={User.Util.Stat}
39
- renderInsight={User.Util.Insight}
40
- renderTemplate={User.Template.General}
41
- renderTitle={(user: DefaultOf<cnst.User>) => \`\${user.nickname}\`}
42
- renderView={(user: cnst.User) => <User.View.General user={user} />}
43
- type="list"
44
- columns={["nickname", "status", "lastLoginAt", "createdAt"]}
45
- actions={(user: cnst.LightUser, idx) => [
46
- "remove",
47
- "edit",
48
- "view",
49
- user.status === "active"
50
- ? { type: "restrict", render: () => <User.Util.Restrict id={user.id} /> }
51
- : { type: "release", render: () => <User.Util.Release id={user.id} /> },
52
- ]}
53
- />
54
- );
55
- };
56
-
57
- export const Self = () => {
58
- const self = st.use.self();
59
- const userModal = st.use.userModal();
60
- return userModal === "edit" ? (
61
- <Model.EditModal type="form" sliceName="user" submitOption={{ path: "self" }}>
62
- <User.Template.General />
63
- </Model.EditModal>
64
- ) : (
65
- <User.View.General user={self} />
66
- );
67
- };
68
- `;
69
- }
70
- module.exports = module.exports.default;
@@ -1,47 +0,0 @@
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
- var server_exports = {};
19
- __export(server_exports, {
20
- default: () => getContent
21
- });
22
- module.exports = __toCommonJS(server_exports);
23
- function getContent(scanResult, dict = {}) {
24
- return `
25
- import { databaseModuleOf } from "@akanjs/server";
26
-
27
- import { cnst } from "../cnst";
28
- import * as db from "../db";
29
- import type { ModulesOptions } from "../option";
30
- import { allSrvs } from "../srv";
31
- import { UserService } from "./user.service";
32
- import { UserSignal } from "./user.signal";
33
-
34
- export const registerUserModule = (option: ModulesOptions) =>
35
- databaseModuleOf(
36
- {
37
- constant: cnst.userCnst,
38
- database: db.userDb,
39
- signal: UserSignal,
40
- service: UserService,
41
- extended: true,
42
- },
43
- allSrvs
44
- );
45
- `;
46
- }
47
- module.exports = module.exports.default;
@@ -1,57 +0,0 @@
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
- var user_exports = {};
19
- __export(user_exports, {
20
- default: () => getContent
21
- });
22
- module.exports = __toCommonJS(user_exports);
23
- function getContent(scanResult, dict = {}) {
24
- return `
25
- import { Signal } from "@util/ui";
26
- import { AiOutlineUser } from "react-icons/ai";
27
-
28
- import * as Template from "./User.Template";
29
- import * as Unit from "./User.Unit";
30
- import * as Util from "./User.Util";
31
- import * as View from "./User.View";
32
- import * as Zone from "./User.Zone";
33
-
34
- export const User = {
35
- Menu: {
36
- Admin: {
37
- key: "user",
38
- label: "User",
39
- icon: <AiOutlineUser />,
40
- render: () => <Zone.Admin />,
41
- },
42
- Doc: {
43
- key: "user",
44
- label: "User",
45
- icon: <AiOutlineUser />,
46
- render: () => <Signal.Doc.Zone refName="user" />,
47
- },
48
- },
49
- Template,
50
- Unit,
51
- Util,
52
- View,
53
- Zone,
54
- };
55
- `;
56
- }
57
- module.exports = module.exports.default;
@@ -1,66 +0,0 @@
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
- var user_constant_exports = {};
19
- __export(user_constant_exports, {
20
- default: () => getContent
21
- });
22
- module.exports = __toCommonJS(user_constant_exports);
23
- function getContent(scanResult, dict) {
24
- return `
25
- import { as, from, Model, sortOf, via } from "@akanjs/constant";
26
-
27
- import {
28
- libUserFilters,
29
- libUserInputs,
30
- libUserInsights,
31
- libUsers,
32
- libUserSummaries,
33
- root,
34
- } from "../__lib/lib.constant";
35
-
36
- @Model.Input("${dict.AppName}UserInput")
37
- export class ${dict.AppName}UserInput {}
38
-
39
- @Model.Object("${dict.AppName}User")
40
- export class ${dict.AppName}User extends as(${dict.AppName}UserInput) {}
41
-
42
- @Model.Insight("${dict.AppName}UserInsight")
43
- export class ${dict.AppName}UserInsight {}
44
-
45
- @Model.Summary("${dict.AppName}UserSummary")
46
- export class ${dict.AppName}UserSummary {}
47
-
48
- @Model.Filter("${dict.AppName}UserFilter")
49
- export class ${dict.AppName}UserFilter extends sortOf(root.User, {}) {}
50
-
51
- export class UserInput extends from(...libUserInputs, ${dict.AppName}UserInput) {}
52
- export class UserObject extends from(...libUsers, ${dict.AppName}User) {}
53
-
54
- @Model.Light("LightUser")
55
- export class LightUser extends via(UserObject, ["nickname", "image", "roles", "status"] as const) {}
56
-
57
- @Model.Full("User")
58
- export class User extends via(UserObject, LightUser, root.User, root.LightUser) {}
59
-
60
- export class UserSummary extends from(...libUserSummaries, ${dict.AppName}UserSummary) {}
61
- export class UserInsight extends from(...libUserInsights, ${dict.AppName}UserInsight) {}
62
-
63
- export class UserFilter extends from(...libUserFilters, ${dict.AppName}UserFilter) {}
64
- `;
65
- }
66
- module.exports = module.exports.default;
@@ -1,51 +0,0 @@
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
- var user_dictionary_exports = {};
19
- __export(user_dictionary_exports, {
20
- default: () => getContent
21
- });
22
- module.exports = __toCommonJS(user_dictionary_exports);
23
- function getContent(scanResult, dict) {
24
- return `
25
- import { ExtendModelDictionary, SignalDictionary, SummaryDictionary } from "@akanjs/dictionary";
26
-
27
- import type { ${dict.AppName}User, ${dict.AppName}UserFilter, ${dict.AppName}UserInsight, ${dict.AppName}UserSummary } from "./user.constant";
28
- import type { UserSignal } from "./user.signal";
29
-
30
- const modelDictionary = {
31
- // * ==================== Model ==================== * //
32
- // * ==================== Model ==================== * //
33
- // * ==================== Insight ==================== * //
34
- // * ==================== Insight ==================== * //
35
- // * ==================== Filter ==================== * //
36
- // * ==================== Filter ==================== * //
37
- // * ==================== Etc ==================== * //
38
- // * ==================== Etc ==================== * //
39
- } satisfies ExtendModelDictionary<${dict.AppName}User, ${dict.AppName}UserInsight, ${dict.AppName}UserFilter>;
40
-
41
- export const userSummaryDictionary = {} satisfies SummaryDictionary<${dict.AppName}UserSummary>;
42
-
43
- const signalDictionary = {
44
- // * ==================== Endpoint ==================== * //
45
- // * ==================== Endpoint ==================== * //
46
- } satisfies SignalDictionary<UserSignal, ${dict.AppName}User>;
47
-
48
- export const userDictionary = { ...modelDictionary, ...signalDictionary };
49
- `;
50
- }
51
- module.exports = module.exports.default;
@@ -1,53 +0,0 @@
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
- var user_document_exports = {};
19
- __export(user_document_exports, {
20
- default: () => getContent
21
- });
22
- module.exports = __toCommonJS(user_document_exports);
23
- function getContent(scanResult, dict) {
24
- return `
25
- import { beyond, by, Database, into, type SchemaOf } from "@akanjs/document";
26
-
27
- import { rootUser } from "../__lib/lib.document";
28
- import { cnst } from "../cnst";
29
-
30
- @Database.Input(() => cnst.UserInput)
31
- export class UserInput extends by(rootUser.Input, cnst.UserInput) {}
32
-
33
- @Database.Document(() => cnst.User)
34
- export class User extends by(rootUser.Doc, cnst.User) {}
35
-
36
- @Database.Model(() => cnst.User)
37
- export class UserModel extends into(User, cnst.userCnst) {
38
- async getSummary(): Promise<cnst.UserSummary> {
39
- return {
40
- ...(await this.getDefaultSummary()),
41
- };
42
- }
43
- }
44
-
45
- @Database.Middleware(() => cnst.User)
46
- export class UserMiddleware extends beyond(UserModel, User) {
47
- onSchema(schema: SchemaOf<UserModel, User>) {
48
- //
49
- }
50
- }
51
- `;
52
- }
53
- module.exports = module.exports.default;
@@ -1,41 +0,0 @@
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
- var user_service_exports = {};
19
- __export(user_service_exports, {
20
- default: () => getContent
21
- });
22
- module.exports = __toCommonJS(user_service_exports);
23
- function getContent(scanResult, dict) {
24
- return `
25
- import { ExtendedUserService, Service } from "@akanjs/service";
26
-
27
- import { LibUserService } from "../__lib/lib.service";
28
- import { cnst } from "../cnst";
29
- import * as db from "../db";
30
-
31
- @Service("UserService")
32
- export class UserService extends ExtendedUserService(db.userDb, LibUserService) {
33
- async summarize${dict.AppName}(): Promise<cnst.${dict.AppName}UserSummary> {
34
- return {
35
- ...(await this.userModel.getSummary()),
36
- };
37
- }
38
- }
39
- `;
40
- }
41
- module.exports = module.exports.default;
@@ -1,33 +0,0 @@
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
- var user_signal_exports = {};
19
- __export(user_signal_exports, {
20
- default: () => getContent
21
- });
22
- module.exports = __toCommonJS(user_signal_exports);
23
- function getContent(scanResult, dict = {}) {
24
- return `
25
- import { LogSignal, Signal } from "@akanjs/signal";
26
-
27
- import { cnst, Srvs } from "../cnst";
28
-
29
- @Signal(() => cnst.User)
30
- export class UserSignal extends LogSignal(Srvs) {}
31
- `;
32
- }
33
- module.exports = module.exports.default;
@@ -1,36 +0,0 @@
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
- var user_signal_spec_exports = {};
19
- __export(user_signal_spec_exports, {
20
- default: () => getContent
21
- });
22
- module.exports = __toCommonJS(user_signal_spec_exports);
23
- function getContent(scanResult, dict = {}) {
24
- return `
25
- import * as adminSpec from "@shared/lib/admin/admin.signal.spec";
26
- import * as userSpec from "@shared/lib/user/user.signal.spec";
27
-
28
- import { cnst } from "../cnst";
29
- import { fetch } from "../fetch";
30
-
31
- export * from "@shared/lib/user/user.signal.spec";
32
- export type UserAgent = userSpec.UserAgent<typeof fetch, cnst.User, cnst.UserInput>;
33
- export type AdminAgent = adminSpec.AdminAgent<typeof fetch>;
34
- `;
35
- }
36
- module.exports = module.exports.default;
@@ -1,38 +0,0 @@
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
- var user_signal_test_exports = {};
19
- __export(user_signal_test_exports, {
20
- default: () => getContent
21
- });
22
- module.exports = __toCommonJS(user_signal_test_exports);
23
- function getContent(scanResult, dict) {
24
- return `
25
- import * as userSpec from "@${dict.appName}/lib/user/user.signal.spec";
26
-
27
- describe("User Signal", () => {
28
- describe("Sign", () => {
29
- let adminAgent: userSpec.AdminAgent;
30
- let userAgent: userSpec.UserAgent;
31
- it("can signup", async () => {
32
- //
33
- });
34
- });
35
- });
36
- `;
37
- }
38
- module.exports = module.exports.default;