@akanjs/cli 0.0.38 → 0.0.39

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 (294) hide show
  1. package/index.js +1 -1
  2. package/package.json +1 -1
  3. package/assets/app/akan.config.ts.template +0 -5
  4. package/assets/app/app/[lang]/(__appName__)/(public)/forgotpassword/page.tsx.template +0 -16
  5. package/assets/app/app/[lang]/(__appName__)/(public)/page.tsx.template +0 -17
  6. package/assets/app/app/[lang]/(__appName__)/(public)/privacy/page.tsx.template +0 -10
  7. package/assets/app/app/[lang]/(__appName__)/(public)/signin/page.tsx.template +0 -19
  8. package/assets/app/app/[lang]/(__appName__)/(public)/termsofservice/page.tsx.template +0 -10
  9. package/assets/app/app/[lang]/(__appName__)/(user)/layout.tsx.template +0 -12
  10. package/assets/app/app/[lang]/(__appName__)/(user)/self/page.tsx.template +0 -29
  11. package/assets/app/app/[lang]/(__appName__)/layout.tsx.template +0 -21
  12. package/assets/app/app/[lang]/admin/layout.tsx.template +0 -22
  13. package/assets/app/app/[lang]/admin/page.tsx.template +0 -32
  14. package/assets/app/app/csr.tsx.template +0 -3
  15. package/assets/app/app/index.html.template +0 -13
  16. package/assets/app/app/layout.tsx.template +0 -7
  17. package/assets/app/app/robots.ts.template +0 -12
  18. package/assets/app/app/sitemap.ts.template +0 -8
  19. package/assets/app/base/baseLogic.ts.template +0 -7
  20. package/assets/app/base/index.ts.template +0 -1
  21. package/assets/app/capacitor.config.ts.template +0 -8
  22. package/assets/app/client.ts.template +0 -8
  23. package/assets/app/common/commonLogic.ts.template +0 -7
  24. package/assets/app/common/index.ts.template +0 -1
  25. package/assets/app/config.yaml.template +0 -19
  26. package/assets/app/env/env.client.ts.template +0 -10
  27. package/assets/app/env/env.client.type.ts.template +0 -7
  28. package/assets/app/env/env.server.ts.template +0 -10
  29. package/assets/app/jest.config.ts.template +0 -8
  30. package/assets/app/lib/___appName__/__appName__.constant.ts.template +0 -8
  31. package/assets/app/lib/___appName__/__appName__.dictionary.ts.template +0 -22
  32. package/assets/app/lib/___appName__/__appName__.document.ts.template +0 -6
  33. package/assets/app/lib/___appName__/__appName__.service.ts.template +0 -14
  34. package/assets/app/lib/___appName__/__appName__.store.ts.template +0 -8
  35. package/assets/app/lib/___appName__/_server.ts.template +0 -8
  36. package/assets/app/lib/cnst.ts.template +0 -4
  37. package/assets/app/lib/cnst_.ts.template +0 -38
  38. package/assets/app/lib/db.ts.template +0 -44
  39. package/assets/app/lib/dict.ts.template +0 -28
  40. package/assets/app/lib/fetch.ts.template +0 -18
  41. package/assets/app/lib/option.ts.template +0 -8
  42. package/assets/app/lib/setting/Setting.Template.tsx.template +0 -26
  43. package/assets/app/lib/setting/Setting.Unit.tsx.template +0 -7
  44. package/assets/app/lib/setting/Setting.Util.tsx.template +0 -3
  45. package/assets/app/lib/setting/Setting.View.tsx.template +0 -20
  46. package/assets/app/lib/setting/Setting.Zone.tsx.template +0 -49
  47. package/assets/app/lib/setting/_server.ts.template +0 -19
  48. package/assets/app/lib/setting/index.tsx.template +0 -30
  49. package/assets/app/lib/setting/setting.constant.ts.template +0 -17
  50. package/assets/app/lib/setting/setting.dictionary.ts.template +0 -18
  51. package/assets/app/lib/setting/setting.document.ts.template +0 -20
  52. package/assets/app/lib/setting/setting.service.ts.template +0 -12
  53. package/assets/app/lib/setting/setting.signal.ts.template +0 -6
  54. package/assets/app/lib/setting/setting.store.ts.template +0 -13
  55. package/assets/app/lib/sig.ts.template +0 -3
  56. package/assets/app/lib/srv.ts.template +0 -20
  57. package/assets/app/lib/st.ts.template +0 -6
  58. package/assets/app/lib/store.ts.template +0 -17
  59. package/assets/app/lib/summary/Summary.Template.tsx.template +0 -12
  60. package/assets/app/lib/summary/Summary.Unit.tsx.template +0 -7
  61. package/assets/app/lib/summary/Summary.Util.tsx.template +0 -2
  62. package/assets/app/lib/summary/Summary.View.tsx.template +0 -20
  63. package/assets/app/lib/summary/Summary.Zone.tsx.template +0 -31
  64. package/assets/app/lib/summary/_server.ts.template +0 -19
  65. package/assets/app/lib/summary/index.tsx.template +0 -36
  66. package/assets/app/lib/summary/summary.constant.ts.template +0 -16
  67. package/assets/app/lib/summary/summary.dictionary.ts.template +0 -21
  68. package/assets/app/lib/summary/summary.document.ts.template +0 -20
  69. package/assets/app/lib/summary/summary.service.ts.template +0 -26
  70. package/assets/app/lib/summary/summary.signal.ts.template +0 -6
  71. package/assets/app/lib/summary/summary.store.ts.template +0 -13
  72. package/assets/app/lib/usePage.ts.template +0 -5
  73. package/assets/app/lib/user/User.Template.tsx.template +0 -34
  74. package/assets/app/lib/user/User.Unit.tsx.template +0 -7
  75. package/assets/app/lib/user/User.Util.tsx.template +0 -63
  76. package/assets/app/lib/user/User.View.tsx.template +0 -35
  77. package/assets/app/lib/user/User.Zone.tsx.template +0 -43
  78. package/assets/app/lib/user/_server.ts.template +0 -19
  79. package/assets/app/lib/user/index.tsx.template +0 -30
  80. package/assets/app/lib/user/user.constant.ts.template +0 -31
  81. package/assets/app/lib/user/user.dictionary.ts.template +0 -24
  82. package/assets/app/lib/user/user.document.ts.template +0 -26
  83. package/assets/app/lib/user/user.service.ts.template +0 -14
  84. package/assets/app/lib/user/user.signal.spec.ts.template +0 -9
  85. package/assets/app/lib/user/user.signal.test.ts.template +0 -11
  86. package/assets/app/lib/user/user.signal.ts.template +0 -6
  87. package/assets/app/lib/user/user.store.ts.template +0 -11
  88. package/assets/app/main.ts.template +0 -12
  89. package/assets/app/middleware.ts.template +0 -4
  90. package/assets/app/nest/backendLogic.ts.template +0 -6
  91. package/assets/app/nest/index.ts.template +0 -1
  92. package/assets/app/next/frontendLogic.ts.template +0 -6
  93. package/assets/app/next/index.ts.template +0 -1
  94. package/assets/app/page.test.ts.template +0 -10
  95. package/assets/app/playwright.config.ts.template +0 -6
  96. package/assets/app/postcss.config.js.template +0 -10
  97. package/assets/app/public/favicon.ico +0 -0
  98. package/assets/app/public/icons/icon-128x128.png +0 -0
  99. package/assets/app/public/icons/icon-144x144.png +0 -0
  100. package/assets/app/public/icons/icon-152x152.png +0 -0
  101. package/assets/app/public/icons/icon-192x192.png +0 -0
  102. package/assets/app/public/icons/icon-256x256.png +0 -0
  103. package/assets/app/public/icons/icon-384x384.png +0 -0
  104. package/assets/app/public/icons/icon-48x48.png +0 -0
  105. package/assets/app/public/icons/icon-512x512.png +0 -0
  106. package/assets/app/public/icons/icon-72x72.png +0 -0
  107. package/assets/app/public/icons/icon-96x96.png +0 -0
  108. package/assets/app/public/logo.svg +0 -70
  109. package/assets/app/public/manifest.json.template +0 -67
  110. package/assets/app/server.ts.template +0 -30
  111. package/assets/app/tsconfig.json.template +0 -22
  112. package/assets/app/tsconfig.spec.json.template +0 -7
  113. package/assets/app/ui/Footer.tsx.template +0 -36
  114. package/assets/app/ui/MainHeader.tsx.template +0 -100
  115. package/assets/app/ui/index.ts.template +0 -2
  116. package/assets/assets/app/akan.config.ts.template +0 -5
  117. package/assets/assets/app/app/[lang]/(__appName__)/(public)/forgotpassword/page.tsx.template +0 -16
  118. package/assets/assets/app/app/[lang]/(__appName__)/(public)/page.tsx.template +0 -17
  119. package/assets/assets/app/app/[lang]/(__appName__)/(public)/privacy/page.tsx.template +0 -10
  120. package/assets/assets/app/app/[lang]/(__appName__)/(public)/signin/page.tsx.template +0 -19
  121. package/assets/assets/app/app/[lang]/(__appName__)/(public)/termsofservice/page.tsx.template +0 -10
  122. package/assets/assets/app/app/[lang]/(__appName__)/(user)/layout.tsx.template +0 -12
  123. package/assets/assets/app/app/[lang]/(__appName__)/(user)/self/page.tsx.template +0 -29
  124. package/assets/assets/app/app/[lang]/(__appName__)/layout.tsx.template +0 -21
  125. package/assets/assets/app/app/[lang]/admin/layout.tsx.template +0 -22
  126. package/assets/assets/app/app/[lang]/admin/page.tsx.template +0 -32
  127. package/assets/assets/app/app/csr.tsx.template +0 -3
  128. package/assets/assets/app/app/index.html.template +0 -13
  129. package/assets/assets/app/app/layout.tsx.template +0 -7
  130. package/assets/assets/app/app/robots.ts.template +0 -12
  131. package/assets/assets/app/app/sitemap.ts.template +0 -8
  132. package/assets/assets/app/base/baseLogic.ts.template +0 -7
  133. package/assets/assets/app/base/index.ts.template +0 -1
  134. package/assets/assets/app/capacitor.config.ts.template +0 -8
  135. package/assets/assets/app/client.ts.template +0 -8
  136. package/assets/assets/app/common/commonLogic.ts.template +0 -7
  137. package/assets/assets/app/common/index.ts.template +0 -1
  138. package/assets/assets/app/config.yaml.template +0 -19
  139. package/assets/assets/app/env/env.client.ts.template +0 -10
  140. package/assets/assets/app/env/env.client.type.ts.template +0 -7
  141. package/assets/assets/app/env/env.server.ts.template +0 -10
  142. package/assets/assets/app/jest.config.ts.template +0 -8
  143. package/assets/assets/app/lib/___appName__/__appName__.constant.ts.template +0 -8
  144. package/assets/assets/app/lib/___appName__/__appName__.dictionary.ts.template +0 -22
  145. package/assets/assets/app/lib/___appName__/__appName__.document.ts.template +0 -6
  146. package/assets/assets/app/lib/___appName__/__appName__.service.ts.template +0 -14
  147. package/assets/assets/app/lib/___appName__/__appName__.store.ts.template +0 -8
  148. package/assets/assets/app/lib/___appName__/_server.ts.template +0 -8
  149. package/assets/assets/app/lib/cnst.ts.template +0 -4
  150. package/assets/assets/app/lib/cnst_.ts.template +0 -38
  151. package/assets/assets/app/lib/db.ts.template +0 -44
  152. package/assets/assets/app/lib/dict.ts.template +0 -28
  153. package/assets/assets/app/lib/fetch.ts.template +0 -18
  154. package/assets/assets/app/lib/option.ts.template +0 -8
  155. package/assets/assets/app/lib/setting/Setting.Template.tsx.template +0 -26
  156. package/assets/assets/app/lib/setting/Setting.Unit.tsx.template +0 -7
  157. package/assets/assets/app/lib/setting/Setting.Util.tsx.template +0 -3
  158. package/assets/assets/app/lib/setting/Setting.View.tsx.template +0 -20
  159. package/assets/assets/app/lib/setting/Setting.Zone.tsx.template +0 -49
  160. package/assets/assets/app/lib/setting/_server.ts.template +0 -19
  161. package/assets/assets/app/lib/setting/index.tsx.template +0 -30
  162. package/assets/assets/app/lib/setting/setting.constant.ts.template +0 -17
  163. package/assets/assets/app/lib/setting/setting.dictionary.ts.template +0 -18
  164. package/assets/assets/app/lib/setting/setting.document.ts.template +0 -20
  165. package/assets/assets/app/lib/setting/setting.service.ts.template +0 -12
  166. package/assets/assets/app/lib/setting/setting.signal.ts.template +0 -6
  167. package/assets/assets/app/lib/setting/setting.store.ts.template +0 -13
  168. package/assets/assets/app/lib/sig.ts.template +0 -3
  169. package/assets/assets/app/lib/srv.ts.template +0 -20
  170. package/assets/assets/app/lib/st.ts.template +0 -6
  171. package/assets/assets/app/lib/store.ts.template +0 -17
  172. package/assets/assets/app/lib/summary/Summary.Template.tsx.template +0 -12
  173. package/assets/assets/app/lib/summary/Summary.Unit.tsx.template +0 -7
  174. package/assets/assets/app/lib/summary/Summary.Util.tsx.template +0 -2
  175. package/assets/assets/app/lib/summary/Summary.View.tsx.template +0 -20
  176. package/assets/assets/app/lib/summary/Summary.Zone.tsx.template +0 -31
  177. package/assets/assets/app/lib/summary/_server.ts.template +0 -19
  178. package/assets/assets/app/lib/summary/index.tsx.template +0 -36
  179. package/assets/assets/app/lib/summary/summary.constant.ts.template +0 -16
  180. package/assets/assets/app/lib/summary/summary.dictionary.ts.template +0 -21
  181. package/assets/assets/app/lib/summary/summary.document.ts.template +0 -20
  182. package/assets/assets/app/lib/summary/summary.service.ts.template +0 -26
  183. package/assets/assets/app/lib/summary/summary.signal.ts.template +0 -6
  184. package/assets/assets/app/lib/summary/summary.store.ts.template +0 -13
  185. package/assets/assets/app/lib/usePage.ts.template +0 -5
  186. package/assets/assets/app/lib/user/User.Template.tsx.template +0 -34
  187. package/assets/assets/app/lib/user/User.Unit.tsx.template +0 -7
  188. package/assets/assets/app/lib/user/User.Util.tsx.template +0 -63
  189. package/assets/assets/app/lib/user/User.View.tsx.template +0 -35
  190. package/assets/assets/app/lib/user/User.Zone.tsx.template +0 -43
  191. package/assets/assets/app/lib/user/_server.ts.template +0 -19
  192. package/assets/assets/app/lib/user/index.tsx.template +0 -30
  193. package/assets/assets/app/lib/user/user.constant.ts.template +0 -31
  194. package/assets/assets/app/lib/user/user.dictionary.ts.template +0 -24
  195. package/assets/assets/app/lib/user/user.document.ts.template +0 -26
  196. package/assets/assets/app/lib/user/user.service.ts.template +0 -14
  197. package/assets/assets/app/lib/user/user.signal.spec.ts.template +0 -9
  198. package/assets/assets/app/lib/user/user.signal.test.ts.template +0 -11
  199. package/assets/assets/app/lib/user/user.signal.ts.template +0 -6
  200. package/assets/assets/app/lib/user/user.store.ts.template +0 -11
  201. package/assets/assets/app/main.ts.template +0 -12
  202. package/assets/assets/app/middleware.ts.template +0 -4
  203. package/assets/assets/app/nest/backendLogic.ts.template +0 -6
  204. package/assets/assets/app/nest/index.ts.template +0 -1
  205. package/assets/assets/app/next/frontendLogic.ts.template +0 -6
  206. package/assets/assets/app/next/index.ts.template +0 -1
  207. package/assets/assets/app/page.test.ts.template +0 -10
  208. package/assets/assets/app/playwright.config.ts.template +0 -6
  209. package/assets/assets/app/postcss.config.js.template +0 -10
  210. package/assets/assets/app/public/favicon.ico +0 -0
  211. package/assets/assets/app/public/icons/icon-128x128.png +0 -0
  212. package/assets/assets/app/public/icons/icon-144x144.png +0 -0
  213. package/assets/assets/app/public/icons/icon-152x152.png +0 -0
  214. package/assets/assets/app/public/icons/icon-192x192.png +0 -0
  215. package/assets/assets/app/public/icons/icon-256x256.png +0 -0
  216. package/assets/assets/app/public/icons/icon-384x384.png +0 -0
  217. package/assets/assets/app/public/icons/icon-48x48.png +0 -0
  218. package/assets/assets/app/public/icons/icon-512x512.png +0 -0
  219. package/assets/assets/app/public/icons/icon-72x72.png +0 -0
  220. package/assets/assets/app/public/icons/icon-96x96.png +0 -0
  221. package/assets/assets/app/public/logo.svg +0 -70
  222. package/assets/assets/app/public/manifest.json.template +0 -67
  223. package/assets/assets/app/server.ts.template +0 -30
  224. package/assets/assets/app/tsconfig.json.template +0 -22
  225. package/assets/assets/app/tsconfig.spec.json.template +0 -7
  226. package/assets/assets/app/ui/Footer.tsx.template +0 -36
  227. package/assets/assets/app/ui/MainHeader.tsx.template +0 -100
  228. package/assets/assets/app/ui/index.ts.template +0 -2
  229. package/assets/assets/crudPages/[__model__Id]/edit/page.tsx.template +0 -42
  230. package/assets/assets/crudPages/[__model__Id]/page.tsx.template +0 -52
  231. package/assets/assets/crudPages/new/page.tsx.template +0 -39
  232. package/assets/assets/crudPages/page.tsx.template +0 -40
  233. package/assets/assets/lib/.gitignore.template +0 -15
  234. package/assets/assets/lib/jest.config.ts.template +0 -7
  235. package/assets/assets/lib/package.json.template +0 -5
  236. package/assets/assets/lib/project.json.template +0 -10
  237. package/assets/assets/lib/tsconfig.json.template +0 -11
  238. package/assets/assets/lib/tsconfig.spec.json.template +0 -7
  239. package/assets/assets/module/__Model__.Template.tsx.template +0 -23
  240. package/assets/assets/module/__Model__.Unit.tsx.template +0 -11
  241. package/assets/assets/module/__Model__.Util.tsx.template +0 -39
  242. package/assets/assets/module/__Model__.View.tsx.template +0 -17
  243. package/assets/assets/module/__Model__.Zone.tsx.template +0 -52
  244. package/assets/assets/module/__model__.constant.ts.template +0 -44
  245. package/assets/assets/module/__model__.dictionary.ts.template +0 -70
  246. package/assets/assets/module/__model__.document.ts.template +0 -25
  247. package/assets/assets/module/__model__.service.ts.template +0 -13
  248. package/assets/assets/module/__model__.signal.spec.ts.template +0 -11
  249. package/assets/assets/module/__model__.signal.test.ts.template +0 -20
  250. package/assets/assets/module/__model__.signal.ts.template +0 -30
  251. package/assets/assets/module/__model__.store.ts.template +0 -11
  252. package/assets/assets/module/_server.ts.template +0 -18
  253. package/assets/assets/module/index.tsx.template +0 -30
  254. package/assets/assets/pkg/tsconfig.json.template +0 -12
  255. package/assets/assets/workplace/.gitignore.template +0 -195
  256. package/assets/assets/workplace/.prettierignore.template +0 -10
  257. package/assets/assets/workplace/.prettierrc.json.template +0 -5
  258. package/assets/assets/workplace/.swcrc.template +0 -9
  259. package/assets/assets/workplace/README.md.template +0 -28
  260. package/assets/assets/workplace/eslint.config.js.template +0 -141
  261. package/assets/assets/workplace/tsconfig.json.template +0 -29
  262. package/assets/crudPages/[__model__Id]/edit/page.tsx.template +0 -42
  263. package/assets/crudPages/[__model__Id]/page.tsx.template +0 -52
  264. package/assets/crudPages/new/page.tsx.template +0 -39
  265. package/assets/crudPages/page.tsx.template +0 -40
  266. package/assets/lib/.gitignore.template +0 -15
  267. package/assets/lib/jest.config.ts.template +0 -7
  268. package/assets/lib/package.json.template +0 -5
  269. package/assets/lib/project.json.template +0 -10
  270. package/assets/lib/tsconfig.json.template +0 -11
  271. package/assets/lib/tsconfig.spec.json.template +0 -7
  272. package/assets/module/__Model__.Template.tsx.template +0 -23
  273. package/assets/module/__Model__.Unit.tsx.template +0 -11
  274. package/assets/module/__Model__.Util.tsx.template +0 -39
  275. package/assets/module/__Model__.View.tsx.template +0 -17
  276. package/assets/module/__Model__.Zone.tsx.template +0 -52
  277. package/assets/module/__model__.constant.ts.template +0 -44
  278. package/assets/module/__model__.dictionary.ts.template +0 -70
  279. package/assets/module/__model__.document.ts.template +0 -25
  280. package/assets/module/__model__.service.ts.template +0 -13
  281. package/assets/module/__model__.signal.spec.ts.template +0 -11
  282. package/assets/module/__model__.signal.test.ts.template +0 -20
  283. package/assets/module/__model__.signal.ts.template +0 -30
  284. package/assets/module/__model__.store.ts.template +0 -11
  285. package/assets/module/_server.ts.template +0 -18
  286. package/assets/module/index.tsx.template +0 -30
  287. package/assets/pkg/tsconfig.json.template +0 -12
  288. package/assets/workplace/.gitignore.template +0 -195
  289. package/assets/workplace/.prettierignore.template +0 -10
  290. package/assets/workplace/.prettierrc.json.template +0 -5
  291. package/assets/workplace/.swcrc.template +0 -9
  292. package/assets/workplace/README.md.template +0 -28
  293. package/assets/workplace/eslint.config.js.template +0 -141
  294. package/assets/workplace/tsconfig.json.template +0 -29
@@ -1,3 +0,0 @@
1
- "use client";
2
-
3
- export const aaa = 1;
@@ -1,20 +0,0 @@
1
- import { clsx } from "@akanjs/client";
2
- import { usePage } from "@<%= appName %>/client";
3
-
4
- import { cnst } from "../cnst";
5
-
6
- interface SettingViewProps {
7
- className?: string;
8
- setting: cnst.Setting;
9
- }
10
-
11
- export const General = ({ className, setting }: SettingViewProps) => {
12
- const { l } = usePage();
13
- return (
14
- <div className={clsx(className, `mr-12`)}>
15
- <div>
16
- {l("setting.resignupDays")}: {setting.resignupDays}
17
- </div>
18
- </div>
19
- );
20
- };
@@ -1,49 +0,0 @@
1
- "use client";
2
- import { ModelsProps } from "@akanjs/client";
3
- import { Setting, st, usePage } from "@<%= appName %>/client";
4
- import { Model } from "@shared/ui";
5
- import { Loading } from "@util/ui";
6
- import { useEffect } from "react";
7
- import { AiOutlineEdit } from "react-icons/ai";
8
-
9
- import { cnst } from "../cnst";
10
- import { msg } from "../dict";
11
-
12
- export const Admin = ({ sliceName = "setting" }: ModelsProps<cnst.Setting>) => {
13
- const { l } = usePage();
14
- const setting = st.use.setting();
15
- const settingModal = st.use.settingModal();
16
- useEffect(() => {
17
- void st.do.getActiveSetting();
18
- }, []);
19
- if (!setting) return <Loading.Skeleton active />;
20
-
21
- return (
22
- <div>
23
- <div className="my-2 flex items-center gap-4 text-3xl">
24
- {l("setting.modelName")}
25
- {settingModal ? null : (
26
- <button className="btn btn-sm" onClick={() => st.do.editSetting(setting.id)}>
27
- <AiOutlineEdit /> {l("shared.edit")}
28
- </button>
29
- )}
30
- </div>
31
- {settingModal === "edit" ? (
32
- <Model.EditModal
33
- sliceName="setting"
34
- type="form"
35
- onSubmit={() => {
36
- msg.success("setting.updateSuccessMsg");
37
- }}
38
- onCancel={() => {
39
- st.do.resetSetting(setting);
40
- }}
41
- >
42
- <Setting.Template.General />
43
- </Model.EditModal>
44
- ) : (
45
- <Setting.View.General setting={setting} />
46
- )}
47
- </div>
48
- );
49
- };
@@ -1,19 +0,0 @@
1
- import { databaseModuleOf } from "@akanjs/server";
2
-
3
- import { cnst } from "../cnst";
4
- import * as db from "../db";
5
- import { allSrvs } from "../srv";
6
- import { SettingService } from "./setting.service";
7
- import { SettingSignal } from "./setting.signal";
8
-
9
- export const registerSettingModule = () =>
10
- databaseModuleOf(
11
- {
12
- constant: cnst.settingCnst,
13
- database: db.settingDb,
14
- signal: SettingSignal,
15
- service: SettingService,
16
- extended: true,
17
- },
18
- allSrvs
19
- );
@@ -1,30 +0,0 @@
1
- import { Signal } from "@util/ui";
2
- import { AiOutlineSetting } from "react-icons/ai";
3
-
4
- import * as Template from "./Setting.Template";
5
- import * as Unit from "./Setting.Unit";
6
- import * as Util from "./Setting.Util";
7
- import * as View from "./Setting.View";
8
- import * as Zone from "./Setting.Zone";
9
-
10
- export const Setting = {
11
- Menu: {
12
- Admin: {
13
- key: "setting",
14
- label: "Setting",
15
- icon: <AiOutlineSetting />,
16
- render: () => <Zone.Admin />,
17
- },
18
- Doc: {
19
- key: "setting",
20
- label: "Setting",
21
- icon: <AiOutlineSetting />,
22
- render: () => <Signal.Doc.Zone refName="setting" />,
23
- },
24
- },
25
- Template,
26
- Unit,
27
- Util,
28
- View,
29
- Zone,
30
- };
@@ -1,17 +0,0 @@
1
- import { from, Model, via } from "@akanjs/constant";
2
- <%= importCnstAsLibsScript %>
3
-
4
- @Model.Input("<%= AppName %>SettingInput")
5
- export class <%= AppName %>SettingInput {}
6
-
7
- @Model.Input("SettingInput")
8
- export class SettingInput extends from(<%= libSettingInputs %>, <%= AppName %>SettingInput) {}
9
-
10
- @Model.Object("SettingObject")
11
- export class SettingObject extends from(<%= libSettings %>, SettingInput) {}
12
-
13
- @Model.Light("LightSetting")
14
- export class LightSetting extends via(SettingObject, ["status"] as const) {}
15
-
16
- @Model.Full("Setting")
17
- export class Setting extends via(SettingObject, LightSetting, shared.Setting, shared.LightSetting) {}
@@ -1,18 +0,0 @@
1
- import { ExtendModelDictionary, SignalDictionary } from "@akanjs/dictionary";
2
-
3
- import type { <%= AppName %>SettingInput } from "./setting.constant";
4
- import type { SettingSignal } from "./setting.signal";
5
-
6
- const modelDictionary = {
7
- // * ==================== Model ==================== * //
8
- // * ==================== Model ==================== * //
9
- // * ==================== Etc ==================== * //
10
- // * ==================== Etc ==================== * //
11
- } satisfies ExtendModelDictionary<<%= AppName %>SettingInput>;
12
-
13
- const signalDictionary = {
14
- // * ==================== Endpoint ==================== * //
15
- // * ==================== Endpoint ==================== * //
16
- } satisfies SignalDictionary<SettingSignal, <%= AppName %>SettingInput>;
17
-
18
- export const settingDictionary = { ...modelDictionary, ...signalDictionary };
@@ -1,20 +0,0 @@
1
- import { beyond, by, Database, into, type SchemaOf } from "@akanjs/document";
2
- import { db as shared } from "@shared/server";
3
-
4
- import { cnst } from "../cnst";
5
-
6
- @Database.Input(() => cnst.SettingInput)
7
- export class SettingInput extends by(shared.settingDb.Input, cnst.SettingInput) {}
8
-
9
- @Database.Document(() => cnst.Setting)
10
- export class Setting extends by(shared.settingDb.Doc, cnst.Setting) {}
11
-
12
- @Database.Model(() => cnst.Setting)
13
- export class SettingModel extends into(Setting, cnst.settingCnst) {}
14
-
15
- @Database.Middleware(() => cnst.Setting)
16
- export class SettingMiddleware extends beyond(SettingModel, Setting) {
17
- onSchema(schema: SchemaOf<SettingModel, Setting>) {
18
- //
19
- }
20
- }
@@ -1,12 +0,0 @@
1
- import { ExtendedSettingService, MixSrvs, Service } from "@akanjs/service";
2
- <%= importSrvAsLibsScript %>
3
-
4
- import * as db from "../db";
5
-
6
- @Service("SettingService")
7
- export class SettingService extends ExtendedSettingService(
8
- db.settingDb,
9
- MixSrvs(<%= libSettingServices %>)
10
- ) {
11
- //
12
- }
@@ -1,6 +0,0 @@
1
- import { LogSignal, Signal } from "@akanjs/signal";
2
-
3
- import { cnst, Srvs } from "../cnst";
4
-
5
- @Signal(() => cnst.Setting)
6
- export class SettingSignal extends LogSignal(Srvs) {}
@@ -1,13 +0,0 @@
1
- import { stateOf, Store } from "@akanjs/store";
2
-
3
- import { cnst } from "../cnst";
4
- import { fetch, settingGql } from "../fetch";
5
-
6
- @Store(() => cnst.Setting)
7
- export class SettingStore extends stateOf(settingGql, {
8
- // state
9
- }) {
10
- async getActiveSetting() {
11
- this.set({ setting: (await fetch.getActiveSetting()) as cnst.Setting, settingLoading: false });
12
- }
13
- }
@@ -1,3 +0,0 @@
1
- export { UserSignal } from "./user/user.signal";
2
- export { SummarySignal } from "./summary/summary.signal";
3
- export { SettingSignal } from "./setting/setting.signal";
@@ -1,20 +0,0 @@
1
- import { GetServices } from "@akanjs/service";
2
- <%= importSrvAsLibsScript %>
3
-
4
- import { SettingService } from "./setting/setting.service";
5
- import { SummaryService } from "./summary/summary.service";
6
- import { UserService } from "./user/user.service";
7
-
8
- <%= exportSrvAsLibsScript %>
9
- export { UserService } from "./user/user.service";
10
- export { SummaryService } from "./summary/summary.service";
11
- export { SettingService } from "./setting/setting.service";
12
-
13
- export const allSrvs = {
14
- <%= ...libAllSrvs %>,
15
- UserService,
16
- SummaryService,
17
- SettingService,
18
- };
19
-
20
- export type AllSrvs = GetServices<typeof allSrvs>;
@@ -1,6 +0,0 @@
1
- "use client";
2
- import { makeStore, st as baseSt } from "@akanjs/store";
3
-
4
- import { store } from "./store";
5
-
6
- export const st = makeStore(baseSt, store);
@@ -1,17 +0,0 @@
1
- "use client";
2
- import { MixStore, rootStoreOf } from "@akanjs/store";
3
- <%= importStoreAsLibsScript %>
4
-
5
- import { <%= AppName %>Store } from "./_<%= appName %>/<%= appName %>.store";
6
- import { SettingStore } from "./setting/setting.store";
7
- import { SummaryStore } from "./summary/summary.store";
8
- import { UserStore } from "./user/user.store";
9
-
10
- export class RootStore extends MixStore(
11
- <%= libs %>,
12
- <%= AppName %>Store,
13
- UserStore,
14
- SummaryStore,
15
- SettingStore,
16
- ) {}
17
- export const store = rootStoreOf(RootStore);
@@ -1,12 +0,0 @@
1
- "use client";
2
- import { st, usePage } from "@<%= appName %>/client";
3
-
4
- interface SummaryEditProps {
5
- summaryId?: string | null;
6
- }
7
-
8
- export const General = ({ summaryId = undefined }: SummaryEditProps) => {
9
- const summaryForm = st.use.summaryForm();
10
- const { l } = usePage();
11
- return <div className="flex items-center mb-4"></div>;
12
- };
@@ -1,7 +0,0 @@
1
- import { ModelProps } from "@akanjs/client";
2
-
3
- import { cnst } from "../cnst";
4
-
5
- export const Card = ({ className, summary }: ModelProps<"summary", cnst.LightSummary>) => {
6
- return <div>{summary.id}</div>;
7
- };
@@ -1,2 +0,0 @@
1
- "use client";
2
- export const aa = 1;
@@ -1,20 +0,0 @@
1
- import { User, usePage } from "@<%= appName %>/client";
2
- import { clsx } from "@akanjs/client";
3
-
4
- import { cnst } from "../cnst";
5
-
6
- interface SummaryViewProps {
7
- className?: string;
8
- summary: cnst.Summary;
9
- }
10
-
11
- export const General = ({ className, summary }: SummaryViewProps) => {
12
- const { l } = usePage();
13
- return (
14
- <div className={clsx(className, `mr-12`)}>
15
- <div className="grid grid-cols-5 gap-4">
16
- <User.Util.Stat className="col-span-2 " summary={summary} />
17
- </div>
18
- </div>
19
- );
20
- };
@@ -1,31 +0,0 @@
1
- "use client";
2
- import { ModelsProps } from "@akanjs/client";
3
- import { DefaultOf } from "@akanjs/signal";
4
- import { st, Summary } from "@<%= appName %>/client";
5
- import { Data } from "@shared/ui";
6
- import { Loading } from "@util/ui";
7
-
8
- import { cnst } from "../cnst";
9
-
10
- export const Admin = ({ sliceName = "summary", init, query }: ModelsProps<cnst.Summary>) => {
11
- return (
12
- <Data.ListContainer
13
- init={init}
14
- query={query}
15
- sliceName={sliceName}
16
- renderItem={Summary.Unit.Card}
17
- renderTemplate={Summary.Template.General}
18
- renderTitle={(summary: DefaultOf<cnst.Summary>) => `${summary.at}`}
19
- renderView={(summary: cnst.Summary) => <Summary.View.General summary={summary} />}
20
- type="list"
21
- columns={["type", "status", "createdAt"]}
22
- actions={(summary: cnst.LightSummary, idx) => ["remove", "edit"]}
23
- />
24
- );
25
- };
26
-
27
- export const Dashboard = () => {
28
- const summary = st.use.summary();
29
- if (!summary) return <Loading.Skeleton active />;
30
- return <Summary.View.General summary={summary} />;
31
- };
@@ -1,19 +0,0 @@
1
- import { databaseModuleOf } from "@akanjs/server";
2
-
3
- import { cnst } from "../cnst";
4
- import * as db from "../db";
5
- import { allSrvs } from "../srv";
6
- import { SummaryService } from "./summary.service";
7
- import { SummarySignal } from "./summary.signal";
8
-
9
- export const registerSummaryModule = () =>
10
- databaseModuleOf(
11
- {
12
- constant: cnst.summaryCnst,
13
- database: db.summaryDb,
14
- signal: SummarySignal,
15
- service: SummaryService,
16
- extended: true,
17
- },
18
- allSrvs
19
- );
@@ -1,36 +0,0 @@
1
- import { Signal } from "@util/ui";
2
- import { AiOutlineLineChart } from "react-icons/ai";
3
-
4
- import * as Template from "./Summary.Template";
5
- import * as Unit from "./Summary.Unit";
6
- import * as Util from "./Summary.Util";
7
- import * as View from "./Summary.View";
8
- import * as Zone from "./Summary.Zone";
9
-
10
- export const Summary = {
11
- Menu: {
12
- Admin: {
13
- key: "summary",
14
- label: "Summary",
15
- icon: <AiOutlineLineChart />,
16
- render: () => <Zone.Admin />,
17
- },
18
- Doc: {
19
- key: "summary",
20
- label: "Summary",
21
- icon: <AiOutlineLineChart />,
22
- render: () => <Signal.Doc.Zone refName="summary" />,
23
- },
24
- Dashboard: {
25
- key: "summary",
26
- label: "Summary",
27
- icon: <AiOutlineLineChart />,
28
- render: () => <Zone.Dashboard />,
29
- },
30
- },
31
- Template,
32
- Unit,
33
- Util,
34
- View,
35
- Zone,
36
- };
@@ -1,16 +0,0 @@
1
- import { from, Model, over, via } from "@akanjs/constant";
2
- <%= importCnstAsLibsScript %>
3
-
4
- import { <%= AppName %>UserSummary } from "../user/user.constant";
5
-
6
- @Model.Summary("<%= AppName %>Summary")
7
- export class <%= AppName %>Summary extends over(<%= AppName %>UserSummary, <%= AppName %>UserSummary) {}
8
-
9
- export class SummaryObject extends from(<%= libSummaries %>, <%= AppName %>Summary) {}
10
- export class SummaryInput extends shared.SummaryInput {}
11
-
12
- @Model.Light("LightSummary")
13
- export class LightSummary extends via(SummaryObject, ["at"] as const) {}
14
-
15
- @Model.Full("Summary")
16
- export class Summary extends via(SummaryObject, LightSummary, shared.Summary, shared.LightSummary) {}
@@ -1,21 +0,0 @@
1
- import { ExtendModelDictionary, SignalDictionary } from "@akanjs/dictionary";
2
-
3
- import { userSummaryDictionary } from "../user/user.dictionary";
4
- import type { <%= AppName %>Summary } from "./summary.constant";
5
- import type { SummarySignal } from "./summary.signal";
6
-
7
- const modelDictionary = {
8
- // * ==================== Model ==================== * //
9
- ...userSummaryDictionary,
10
- // * ==================== Model ==================== * //
11
-
12
- // * ==================== Etc ==================== * //
13
- // * ==================== Etc ==================== * //
14
- } satisfies ExtendModelDictionary<<%= AppName %>Summary>;
15
-
16
- const signalDictionary = {
17
- // * ==================== Endpoint ==================== * //
18
- // * ==================== Endpoint ==================== * //
19
- } satisfies SignalDictionary<SummarySignal, <%= AppName %>Summary>;
20
-
21
- export const summaryDictionary = { ...modelDictionary, ...signalDictionary };
@@ -1,20 +0,0 @@
1
- import { beyond, by, Database, inside, type SchemaOf } from "@akanjs/document";
2
- import { db as shared } from "@shared/server";
3
-
4
- import { cnst } from "../cnst";
5
-
6
- @Database.Input(() => cnst.SummaryInput)
7
- export class SummaryInput extends by(shared.summaryDb.Input, cnst.SummaryInput) {}
8
-
9
- @Database.Document(() => cnst.Summary)
10
- export class Summary extends by(shared.summaryDb.Doc, cnst.Summary) {}
11
-
12
- @Database.Model(() => cnst.Summary)
13
- export class SummaryModel extends inside(shared.summaryDb.Model, cnst.summaryCnst) {}
14
-
15
- @Database.Middleware(() => cnst.Summary)
16
- export class SummaryMiddleware extends beyond(SummaryModel, Summary) {
17
- onSchema(schema: SchemaOf<SummaryModel, Summary>) {
18
- //
19
- }
20
- }
@@ -1,26 +0,0 @@
1
- import { ExtendedSummaryService, MixSrvs, Service, Srv } from "@akanjs/server";
2
- <%= importSrvAsLibsScript %>
3
-
4
- import * as db from "../db";
5
- import type * as srv from "../srv";
6
-
7
- @Service("SummaryService")
8
- export class SummaryService extends ExtendedSummaryService(
9
- db.summaryDb,
10
- MixSrvs(<%= libSummaryServices %>)
11
- ) {
12
- @Srv() userService: srv.UserService;
13
-
14
- async get<%= AppName %>Summary() {
15
- return {
16
- ...(await this.userService.summarize<%= AppName %>()),
17
- };
18
- }
19
- async makeSummary(archiveType: "periodic" | "non-periodic" = "non-periodic"): Promise<db.Summary> {
20
- const summary = {
21
- <%= thisGetLibsSummary %>
22
- ...(await this.get<%= AppName %>Summary()),
23
- };
24
- return (await this.summaryModel.archive(archiveType, summary)) as db.Summary;
25
- }
26
- }
@@ -1,6 +0,0 @@
1
- import { LogSignal, Signal } from "@akanjs/signal";
2
-
3
- import { cnst, Srvs } from "../cnst";
4
-
5
- @Signal(() => cnst.Summary)
6
- export class SummarySignal extends LogSignal(Srvs) {}
@@ -1,13 +0,0 @@
1
- import { stateOf, Store } from "@akanjs/store";
2
-
3
- import { cnst } from "../cnst";
4
- import { fetch, summaryGql } from "../fetch";
5
-
6
- @Store(() => cnst.Summary)
7
- export class SummaryStore extends stateOf(summaryGql, {
8
- // state
9
- }) {
10
- async getActiveSummary() {
11
- this.set({ summary: (await fetch.getActiveSummary()) as cnst.Summary, summaryLoading: false });
12
- }
13
- }
@@ -1,5 +0,0 @@
1
- import { makePageProto } from "@akanjs/next";
2
-
3
- import { dictionary } from "./dict";
4
-
5
- export const usePage = makePageProto([dictionary]);
@@ -1,34 +0,0 @@
1
- "use client";
2
- import { clsx } from "@akanjs/client";
3
- import { Field } from "@shared/ui";
4
- import { Layout } from "@util/ui";
5
- import { st, usePage } from "@<%= appName %>/client";
6
-
7
- interface UserEditProps {
8
- className?: string;
9
- userId?: string | null;
10
- }
11
-
12
- export const General = ({ className, userId = undefined }: UserEditProps) => {
13
- const userForm = st.use.userForm();
14
- const { l } = usePage();
15
- return (
16
- <Layout.Template className={clsx(`flex flex-col gap-4`, className)}>
17
- <div className="w-[150px] flex mt-10 md:mt-0">
18
- <Field.Img
19
- label={l.field("user", "image")}
20
- desc={l.desc("user", "image")}
21
- sliceName="user"
22
- value={userForm.image}
23
- onChange={st.do.setImageOnUser}
24
- />
25
- </div>
26
- <Field.Text
27
- label={l.field("user", "nickname")}
28
- desc={l.desc("user", "nickname")}
29
- value={userForm.nickname}
30
- onChange={st.do.setNicknameOnUser}
31
- />
32
- </Layout.Template>
33
- );
34
- };
@@ -1,7 +0,0 @@
1
- import { ModelProps } from "@akanjs/client";
2
-
3
- import { cnst } from "../cnst";
4
-
5
- export const Card = ({ className, user }: ModelProps<"user", cnst.LightUser>) => {
6
- return <div>{user.id}</div>;
7
- };
@@ -1,63 +0,0 @@
1
- "use client";
2
- import { ModelDashboardProps, ModelInsightProps } from "@akanjs/client";
3
- import { getQueryMap } from "@akanjs/constant";
4
- import { cnst, st } from "@<%= appName %>/client";
5
- import { Data } from "@shared/ui";
6
- import { AiOutlineEdit, AiOutlineLock, AiOutlineUnlock } from "react-icons/ai";
7
-
8
- export const Stat = ({
9
- className,
10
- summary,
11
- sliceName = "user",
12
- queryMap = getQueryMap(cnst.UserSummary),
13
- hidePresents,
14
- }: ModelDashboardProps<cnst.Summary>) => {
15
- return (
16
- <Data.Dashboard
17
- className={className}
18
- summary={summary}
19
- sliceName={sliceName}
20
- queryMap={queryMap}
21
- columns={["totalUser", "dau"]}
22
- hidePresents={hidePresents}
23
- />
24
- );
25
- };
26
- export const Insight = ({ className, insight, sliceName = "user" }: ModelInsightProps<cnst.UserInsight>) => {
27
- return <Data.Insight className={className} insight={insight} sliceName={sliceName} columns={["count"]} />;
28
- };
29
-
30
- interface RestrictProps {
31
- id: string;
32
- }
33
- export const Restrict = ({ id }: RestrictProps) => {
34
- return (
35
- <button className="gap-2 btn btn-sm" onClick={() => st.do.restrictUser(id, "Violated Community Guidelines")}>
36
- <AiOutlineLock />
37
- Restrict
38
- </button>
39
- );
40
- };
41
-
42
- interface ReleaseProps {
43
- id: string;
44
- }
45
- export const Release = ({ id }: ReleaseProps) => {
46
- return (
47
- <button className="gap-2 border-dashed btn btn-sm btn-outline" onClick={() => st.do.releaseUser(id)}>
48
- <AiOutlineUnlock />
49
- Release
50
- </button>
51
- );
52
- };
53
-
54
- export const EditSelf = () => {
55
- const self = st.use.self();
56
- const userModal = st.use.userModal();
57
- return userModal !== "edit" ? (
58
- <button className="gap-2 btn" onClick={() => st.do.editUser(self)}>
59
- <AiOutlineEdit />
60
- Edit
61
- </button>
62
- ) : null;
63
- };