@oj-module/cli 0.2.2 → 0.2.6

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 (231) hide show
  1. package/devkit/README.md +14 -3
  2. package/devkit/SKILL.md +16 -4
  3. package/devkit/framework-dev.md +8 -6
  4. package/devkit/manual.md +243 -23
  5. package/package.json +2 -2
  6. package/shell-dist/assets/runtime.js +143 -8
  7. package/shell-dist/index.html +2 -2
  8. package/shell-dist/versions.json +3 -3
  9. package/src/args.ts +67 -0
  10. package/src/build.ts +11 -3
  11. package/src/bundle.ts +197 -0
  12. package/src/contract/__tests__/handler-scan.test.ts +82 -0
  13. package/src/contract/check.ts +2 -1
  14. package/src/contract/handler-scan.ts +32 -0
  15. package/src/deterministic-tar.ts +120 -0
  16. package/src/dev.ts +4 -2
  17. package/src/enable.ts +28 -0
  18. package/src/index.ts +63 -2
  19. package/src/info.ts +3 -2
  20. package/src/init.ts +189 -14
  21. package/src/install.ts +268 -0
  22. package/src/keygen.ts +88 -0
  23. package/src/layout.ts +31 -0
  24. package/src/lifecycle/__tests__/authoring.test.ts +109 -0
  25. package/src/lifecycle/__tests__/bundle.test.ts +150 -0
  26. package/src/lifecycle/__tests__/deterministic-tar.test.ts +145 -0
  27. package/src/lifecycle/__tests__/fixtures/README.md +59 -0
  28. package/src/lifecycle/__tests__/fixtures/fixture-invalid/EXPECTED-VIOLATIONS.md +27 -0
  29. package/src/lifecycle/__tests__/fixtures/fixture-invalid/api/src/Demo/manifest.yaml +6 -0
  30. package/src/lifecycle/__tests__/fixtures/fixture-invalid/manifest.yaml +40 -0
  31. package/src/lifecycle/__tests__/fixtures/fixture-invalid/web/src/Demo/entry.ts +14 -0
  32. package/src/lifecycle/__tests__/fixtures/fixture-invalid/web/src/Demo/locales/en-US.json +12 -0
  33. package/src/lifecycle/__tests__/fixtures/fixture-invalid/web/src/Demo/locales/zh-CN.json +12 -0
  34. package/src/lifecycle/__tests__/fixtures/fixture-valid/api/src/demo-solution/manifest.yaml +9 -0
  35. package/src/lifecycle/__tests__/fixtures/fixture-valid/api/src/demo-solution/migrations/0001__init.sql +6 -0
  36. package/src/lifecycle/__tests__/fixtures/fixture-valid/api/src/demo-solution/ping/api.ts +9 -0
  37. package/src/lifecycle/__tests__/fixtures/fixture-valid/api/src/demo-solution/schema.yaml +9 -0
  38. package/src/lifecycle/__tests__/fixtures/fixture-valid/manifest.yaml +96 -0
  39. package/src/lifecycle/__tests__/fixtures/fixture-valid/web/src/demo-solution/entry.ts +23 -0
  40. package/src/lifecycle/__tests__/fixtures/fixture-valid/web/src/demo-solution/locales/en-US.json +29 -0
  41. package/src/lifecycle/__tests__/fixtures/fixture-valid/web/src/demo-solution/locales/zh-CN.json +29 -0
  42. package/src/lifecycle/__tests__/fixtures/sig/demo-solution-0.2.0.tgz +0 -0
  43. package/src/lifecycle/__tests__/fixtures/sig/demo-solution-0.2.0.tgz.bad.sig +7 -0
  44. package/src/lifecycle/__tests__/fixtures/sig/demo-solution-0.2.0.tgz.sig +7 -0
  45. package/src/lifecycle/__tests__/fixtures/sig/demo-solution-0.2.0.tgz.unknown.sig +7 -0
  46. package/src/lifecycle/__tests__/fixtures/sig/gen-signed-fixtures.d.mts +21 -0
  47. package/src/lifecycle/__tests__/fixtures/sig/gen-signed-fixtures.mjs +196 -0
  48. package/src/lifecycle/__tests__/helpers.ts +78 -0
  49. package/src/lifecycle/__tests__/install.test.ts +514 -0
  50. package/src/lifecycle/__tests__/keygen.test.ts +61 -0
  51. package/src/lifecycle/__tests__/manifest-contract.test.ts +228 -0
  52. package/src/lifecycle/__tests__/publish.test.ts +80 -0
  53. package/src/lifecycle/__tests__/sig-fixtures.test.ts +100 -0
  54. package/src/lifecycle/__tests__/sign.test.ts +131 -0
  55. package/src/lifecycle/__tests__/smoke.test.ts +61 -0
  56. package/src/lifecycle/__tests__/trust.test.ts +177 -0
  57. package/src/lifecycle/__tests__/uninstall.test.ts +87 -0
  58. package/src/lifecycle/keygen.ts +40 -0
  59. package/src/lifecycle/sign.ts +74 -0
  60. package/src/manifest-contract.ts +696 -0
  61. package/src/oj-cert.ts +19 -0
  62. package/src/oj-cmd.ts +3 -3
  63. package/src/preview.ts +2 -2
  64. package/src/publish.ts +150 -0
  65. package/src/sign.ts +128 -0
  66. package/src/site.ts +146 -0
  67. package/src/trust.ts +116 -0
  68. package/src/uninstall.ts +29 -0
  69. package/src/usage.ts +35 -1
  70. package/templates/README.md +1 -1
  71. package/templates/api/config.yaml +47 -0
  72. package/templates/api/seed.mysql.sql +1 -1
  73. package/templates/api/seed.pg.sql +1 -1
  74. package/templates/api/src/_platform/_lifecycle/atomic.ts +98 -0
  75. package/templates/api/src/_platform/_lifecycle/history.ts +31 -0
  76. package/templates/api/src/_platform/_lifecycle/installer.ts +1080 -0
  77. package/templates/api/src/_platform/_lifecycle/lock.ts +148 -0
  78. package/templates/api/src/_platform/_lifecycle/semver.ts +61 -0
  79. package/templates/api/src/_platform/_lifecycle/sha384.ts +187 -0
  80. package/templates/api/src/_platform/_lifecycle/state.ts +256 -0
  81. package/templates/api/src/_platform/_lifecycle/steps/deploy-web.ts +182 -0
  82. package/templates/api/src/_platform/_lifecycle/steps/download.ts +90 -0
  83. package/templates/api/src/_platform/_lifecycle/steps/extract.ts +239 -0
  84. package/templates/api/src/_platform/_lifecycle/steps/migrate.ts +363 -0
  85. package/templates/api/src/_platform/_lifecycle/steps/preflight.ts +590 -0
  86. package/templates/api/src/_platform/_lifecycle/steps/register.ts +211 -0
  87. package/templates/api/src/_platform/_lifecycle/steps/reload.ts +81 -0
  88. package/templates/api/src/_platform/_lifecycle/steps/smoke.ts +216 -0
  89. package/templates/api/src/_platform/_lifecycle/steps/verify.ts +207 -0
  90. package/templates/api/src/_platform/_lifecycle/tasks.ts +119 -0
  91. package/templates/api/src/_platform/_lifecycle/text-edit.ts +110 -0
  92. package/templates/api/src/_platform/_lifecycle/tgz-guard.ts +41 -0
  93. package/templates/api/src/_platform/_lifecycle/trust.ts +229 -0
  94. package/templates/api/src/_platform/_lifecycle/types.ts +94 -0
  95. package/templates/api/src/_platform/_lifecycle/uninstall.ts +283 -0
  96. package/templates/api/src/_platform/_lifecycle/verify-checks.ts +228 -0
  97. package/templates/api/src/_platform/_lifecycle/verify-report.ts +92 -0
  98. package/templates/api/src/_platform/_shared/service/access.ts +2 -2
  99. package/templates/api/src/_platform/_shared/service/settings.ts +10 -1
  100. package/templates/api/src/_platform/_shared/service/solution-perms.ts +14 -7
  101. package/templates/api/src/_platform/_shared/site-facade.ts +44 -0
  102. package/templates/api/src/_platform/manifest.yaml +1 -0
  103. package/templates/api/src/_platform/market/api.ts +883 -0
  104. package/templates/api/src/_platform/market/bootstrap.ts +39 -0
  105. package/templates/api/src/_platform/migrations/0010__sys_solution_route.mysql.sql +17 -0
  106. package/templates/api/src/_platform/migrations/0010__sys_solution_route.pg.sql +16 -0
  107. package/templates/api/src/_platform/migrations/0010__sys_solution_route.sql +18 -0
  108. package/templates/api/src/_platform/migrations/0011__sys_setting_group_label.mysql.sql +2 -0
  109. package/templates/api/src/_platform/migrations/0011__sys_setting_group_label.sql +4 -0
  110. package/templates/api/src/_platform/migrations/0012__market_history.mysql.sql +13 -0
  111. package/templates/api/src/_platform/migrations/0012__market_history.pg.sql +12 -0
  112. package/templates/api/src/_platform/migrations/0012__market_history.sql +14 -0
  113. package/templates/api/src/_platform/schema.yaml +21 -4
  114. package/templates/api/src/_platform/seed.sql +2 -2
  115. package/templates/api/src/_platform/solutions/api.ts +212 -0
  116. package/templates/api/src/demo/manifest.yaml +5 -0
  117. package/templates/api/src/demo/migrations/0001__create_todos.sql +9 -0
  118. package/templates/api/src/demo/schema.yaml +11 -0
  119. package/templates/api/src/demo/seed.sql +5 -0
  120. package/templates/api/src/demo/todos/api.ts +59 -0
  121. package/templates/api/src/home/line/api.ts +57 -0
  122. package/templates/api/src/home/manifest.yaml +6 -0
  123. package/templates/api/src/home/migrations/0001__create_home_tables.sql +13 -0
  124. package/templates/api/src/home/pie/api.ts +40 -0
  125. package/templates/api/src/home/schema.yaml +14 -0
  126. package/templates/api/src/home/seed.sql +70 -0
  127. package/templates/api/src/system/oplog/api.ts +44 -2
  128. package/templates/api/tests/fixture.ts +16 -0
  129. package/templates/api/tests/lifecycle/atomic-state.spec.ts +183 -0
  130. package/templates/api/tests/lifecycle/bootstrap.spec.ts +116 -0
  131. package/templates/api/tests/lifecycle/deploy-smoke.spec.ts +492 -0
  132. package/templates/api/tests/lifecycle/installer.spec.ts +1218 -0
  133. package/templates/api/tests/lifecycle/market-api.spec.ts +971 -0
  134. package/templates/api/tests/lifecycle/migrate.spec.ts +575 -0
  135. package/templates/api/tests/lifecycle/preflight.spec.ts +255 -0
  136. package/templates/api/tests/lifecycle/register.spec.ts +194 -0
  137. package/templates/api/tests/lifecycle/semver.spec.ts +43 -0
  138. package/templates/api/tests/lifecycle/sha384.spec.ts +48 -0
  139. package/templates/api/tests/lifecycle/sig-fixtures.spec.ts +65 -0
  140. package/templates/api/tests/lifecycle/solutions-api.spec.ts +98 -0
  141. package/templates/api/tests/lifecycle/steps-fs.spec.ts +623 -0
  142. package/templates/api/tests/lifecycle/text-edit.spec.ts +177 -0
  143. package/templates/api/tests/lifecycle/tgz-guard.spec.ts +103 -0
  144. package/templates/api/tests/lifecycle/trust.spec.ts +310 -0
  145. package/templates/api/tests/lifecycle/uninstall.spec.ts +386 -0
  146. package/templates/api/tests/lifecycle/verify-checks.spec.ts +385 -0
  147. package/templates/api/tests/lifecycle/verify-report.spec.ts +290 -0
  148. package/templates/api/tests/rbac-settings.spec.ts +8 -0
  149. package/templates/init.include.yaml +62 -0
  150. package/templates/openapi.json +527 -0
  151. package/templates/package.json +52 -0
  152. package/templates/web/src/_platform/__client/api.schemas.ts +8 -0
  153. package/templates/web/src/_platform/__client/api.ts +335 -0
  154. package/templates/web/src/about/entry.ts +42 -0
  155. package/templates/web/src/about/locales/en-US.json +16 -0
  156. package/templates/web/src/about/locales/zh-CN.json +16 -0
  157. package/templates/web/src/about/pages/constants.ts +20 -0
  158. package/templates/web/src/about/pages/index.tsx +135 -0
  159. package/templates/web/src/access/entry.ts +74 -0
  160. package/templates/web/src/access/locales/en-US.json +46 -0
  161. package/templates/web/src/access/locales/zh-CN.json +46 -0
  162. package/templates/web/src/access/pages/access-mode/index.tsx +16 -0
  163. package/templates/web/src/access/pages/admin-visible/index.tsx +16 -0
  164. package/templates/web/src/access/pages/button-control/index.tsx +181 -0
  165. package/templates/web/src/access/pages/common-visible/index.tsx +16 -0
  166. package/templates/web/src/access/pages/page-control/index.tsx +142 -0
  167. package/templates/web/src/demo/__client/api.schemas.ts +20 -0
  168. package/templates/web/src/demo/__client/api.ts +89 -0
  169. package/templates/web/src/exception/entry.ts +80 -0
  170. package/templates/web/src/exception/locales/en-US.json +13 -0
  171. package/templates/web/src/exception/locales/zh-CN.json +13 -0
  172. package/templates/web/src/exception/pages/403/index.tsx +30 -0
  173. package/templates/web/src/exception/pages/404/index.tsx +30 -0
  174. package/templates/web/src/exception/pages/500/index.tsx +30 -0
  175. package/templates/web/src/exception/pages/unknown-component/index.tsx +38 -0
  176. package/templates/web/src/home/__client/api.schemas.ts +22 -0
  177. package/templates/web/src/home/__client/api.ts +113 -0
  178. package/templates/web/src/login/locales/en-US.json +6 -0
  179. package/templates/web/src/login/locales/zh-CN.json +6 -0
  180. package/templates/web/src/login/pages/login.tsx +67 -18
  181. package/templates/web/src/oj-market/__tests__/CardGrid.test.tsx +93 -0
  182. package/templates/web/src/oj-market/__tests__/HistoryDrawer.test.tsx +28 -0
  183. package/templates/web/src/oj-market/__tests__/InstallDialog.test.tsx +69 -0
  184. package/templates/web/src/oj-market/__tests__/RollbackDialog.test.tsx +43 -0
  185. package/templates/web/src/oj-market/__tests__/UninstallConfirm.test.tsx +30 -0
  186. package/templates/web/src/oj-market/__tests__/marketClient.fake.ts +70 -0
  187. package/templates/web/src/oj-market/__tests__/poll.test.ts +24 -0
  188. package/templates/web/src/oj-market/__tests__/render.tsx +14 -0
  189. package/templates/web/src/oj-market/__tests__/runtime-stub.ts +14 -0
  190. package/templates/web/src/oj-market/__tests__/semver.test.ts +26 -0
  191. package/templates/web/src/oj-market/api/MarketClientProvider.tsx +12 -0
  192. package/templates/web/src/oj-market/api/client.ts +135 -0
  193. package/templates/web/src/oj-market/api/context.ts +11 -0
  194. package/templates/web/src/oj-market/api/defaultClient.ts +7 -0
  195. package/templates/web/src/oj-market/components/CardGrid.tsx +76 -0
  196. package/templates/web/src/oj-market/components/CardItem.tsx +102 -0
  197. package/templates/web/src/oj-market/components/DetailDrawer.tsx +53 -0
  198. package/templates/web/src/oj-market/components/HistoryDrawer.tsx +75 -0
  199. package/templates/web/src/oj-market/components/InstallDialog.tsx +112 -0
  200. package/templates/web/src/oj-market/components/RollbackDialog.tsx +79 -0
  201. package/templates/web/src/oj-market/components/UninstallConfirm.tsx +74 -0
  202. package/templates/web/src/oj-market/entry.ts +27 -0
  203. package/templates/web/src/oj-market/hooks/useMarket.ts +91 -0
  204. package/templates/web/src/oj-market/locales/en-US.json +100 -0
  205. package/templates/web/src/oj-market/locales/zh-CN.json +100 -0
  206. package/templates/web/src/oj-market/pages/MarketApp.tsx +136 -0
  207. package/templates/web/src/oj-market/types.ts +84 -0
  208. package/templates/web/src/oj-market/utils/poll.ts +36 -0
  209. package/templates/web/src/oj-market/utils/semver.ts +14 -0
  210. package/templates/web/src/outside/entry.ts +80 -0
  211. package/templates/web/src/outside/locales/en-US.json +10 -0
  212. package/templates/web/src/outside/locales/zh-CN.json +10 -0
  213. package/templates/web/src/personal-center/entry.ts +1 -10
  214. package/templates/web/src/personal-center/locales/en-US.json +1 -5
  215. package/templates/web/src/personal-center/locales/zh-CN.json +1 -5
  216. package/templates/web/src/route-nest/entry.ts +73 -0
  217. package/templates/web/src/route-nest/locales/en-US.json +9 -0
  218. package/templates/web/src/route-nest/locales/zh-CN.json +9 -0
  219. package/templates/web/src/route-nest/pages/menu1/menu1-1/index.tsx +5 -0
  220. package/templates/web/src/route-nest/pages/menu1/menu1-2/index.tsx +5 -0
  221. package/templates/web/src/route-nest/pages/menu2/index.tsx +5 -0
  222. package/templates/web/src/system/__client/api.schemas.ts +12 -0
  223. package/templates/web/src/system/__client/api.ts +25 -1
  224. package/templates/web/src/system/pages/oplog/index.tsx +1 -1
  225. package/templates/web/src/system/pages/roles/index.tsx +1 -0
  226. package/templates/web/src/system/pages/settings/index.tsx +1 -1
  227. package/templates/web/src/system/pages/users/index.tsx +1 -1
  228. package/templates/web.config.ts +32 -40
  229. package/vendor/host-versions.json +3 -3
  230. package/templates/pnpm-workspace.yaml +0 -14
  231. package/templates/web/src/personal-center/pages/settings/index.tsx +0 -5
@@ -55,6 +55,14 @@ describe("PRD §4.3:系统设置", () => {
55
55
  expect(security?.items.find(i => i.key === "market.cdn_url")?.value).toBe("***");
56
56
  });
57
57
 
58
+ it("组标题回填(P2-15③):group_label_key 落库行 → 组面收敛出 label_key", async () => {
59
+ dbo.prepare("INSERT INTO sys_setting (key, module, \"group\", type, value, secret, update_time, group_label_key) VALUES ('demo-solution.display.theme', 'demo-solution', 'display', 'string', 'auto', 0, 0, 'demo-solution:settings.group.display')").run();
60
+ dbo.prepare("INSERT INTO sys_setting (key, module, \"group\", type, value, secret, update_time, group_label_key) VALUES ('demo-solution.display.size', 'demo-solution', 'display', 'int', '20', 0, 0, 'demo-solution:settings.group.display')").run();
61
+ const groups = await listSettings();
62
+ const display = groups.find(x => x.group === "display");
63
+ expect(display?.label_key).toBe("demo-solution:settings.group.display");
64
+ });
65
+
58
66
  it("更新写值 + update_time + 审计(market 安全项须 superadmin 操作者)", async () => {
59
67
  dbo.prepare("INSERT INTO sys_setting (key, module, \"group\", type, value, secret, update_time) VALUES ('framework.site_title', 'framework', 'general', 'string', 'ACME', 0, 0)").run();
60
68
  dbo.prepare("INSERT INTO sys_setting (key, module, \"group\", type, value, secret, update_time) VALUES ('market.cdn_url', 'market', 'security', 'string', 'x', 1, 0)").run();
@@ -0,0 +1,62 @@
1
+ # `ojm init` 拷入新工程的白名单(路径相对本 templates 根目录)。
2
+ #
3
+ # 与已废弃的 init.exclude.yaml 逻辑相反:模板里大部分文件是「模板自运行/
4
+ # demo/产物」,不该进用户工程——用排除清单会越列越长,故反转为白名单:
5
+ # 凡未列出的路径一律不拷,也不计入 init 报告的 created/skipped。四类不列入:
6
+ # 1. demo-only 演示模块——模板内置供演示,新工程默认不需要(文件缺失会崩)。
7
+ # 其 web.config.ts 条目由 `// #region demo-only` 标注,init 时整段剥离。
8
+ # 2. 模板自运行专属文件——templates 本身也是一个可 `pnpm dev` 的工程,
9
+ # 它的 package.json / node_modules / bin / lock 绝不能泄漏进用户工程;
10
+ # package.json 由 init 现场生成(钉死真实版本,不带 workspace:/catalog:)。
11
+ # 3. 构建与运行期产物——api/dist、web/dist、api/logs、签发的私钥与 sqlite;
12
+ # 模板跑过 build/dev 后会留在本地,既不进用户工程,更不该让所有工程
13
+ # 共享同一把私钥。
14
+ # 4. 模板自用元数据——本清单自身。
15
+ #
16
+ # 另有两类文件「故意不进清单」:package.json / pnpm-workspace.yaml / .gitignore
17
+ # 由 init 现场生成(见 init.ts)。其中 .gitignore 是硬约束:npm/pnpm pack 会
18
+ # 剥离 `.gitignore` 点文件,收录它只会让安装包缺文件、readInitInclude fail-fast
19
+ # 把整个 init 打挂(0.2.5 发布实测);本模板目录自带的 .gitignore 仅供模板自身
20
+ # `pnpm dev` 时忽略产物,不进发布包、也不进用户工程。守卫:
21
+ # tests/cli/release-manifest.test.ts 逐条核对清单条目落在 tarball 内。
22
+ #
23
+ # 注意 web/src/{demo,home}/__client 不在清单:其 api 模块(api/src/demo、
24
+ # api/src/home)是 demo-only 不进脚手架,client 生成物留着会指向不存在的端点,
25
+ # 故 demo/home 只列页面源码(entry/locales/pages),不列整棵模块目录。
26
+ include:
27
+ # —— 工程级文件 ——
28
+ - README.md
29
+ - tsconfig.json
30
+ - env.d.ts
31
+ - web.config.ts
32
+ - openapi.json
33
+ - web/src/styles.css
34
+ # —— api 后端:配置 / 种子 / 测试 / 默认模块 ——
35
+ - api/config.yaml
36
+ - api/.ojm-api-exempt.json
37
+ - api/seed.mysql.sql
38
+ - api/seed.pg.sql
39
+ - api/vitest.config.ts
40
+ - api/tests
41
+ - api/src/_platform
42
+ - api/src/auth
43
+ - api/src/notification
44
+ - api/src/notifications
45
+ - api/src/personal-center
46
+ - api/src/system
47
+ - api/src/web
48
+ # —— web 前端模块(demo/home 只列页面源码,__client 见顶部说明)——
49
+ - web/src/_platform
50
+ - web/src/auth
51
+ - web/src/demo/entry.ts
52
+ - web/src/demo/locales
53
+ - web/src/demo/pages
54
+ - web/src/home/entry.ts
55
+ - web/src/home/locales
56
+ - web/src/home/pages
57
+ - web/src/login
58
+ - web/src/notification
59
+ - web/src/notifications
60
+ - web/src/personal-center
61
+ - web/src/system
62
+ - web/src/web
@@ -35,6 +35,242 @@
35
35
  }
36
36
  }
37
37
  },
38
+ "/api/_platform/market/install": {
39
+ "post": {
40
+ "operationId": "_platform_market_install_post",
41
+ "summary": "POST api/_platform/market/install",
42
+ "x-oj-file": "_platform/market/api.ts",
43
+ "tags": [
44
+ "_platform"
45
+ ],
46
+ "responses": {
47
+ "200": {
48
+ "description": "OK"
49
+ }
50
+ }
51
+ }
52
+ },
53
+ "/api/_platform/market/install/cancel": {
54
+ "post": {
55
+ "operationId": "_platform_market_install_cancel_post",
56
+ "summary": "POST api/_platform/market/install/cancel",
57
+ "x-oj-file": "_platform/market/api.ts",
58
+ "tags": [
59
+ "_platform"
60
+ ],
61
+ "responses": {
62
+ "200": {
63
+ "description": "OK"
64
+ }
65
+ }
66
+ }
67
+ },
68
+ "/api/_platform/market/task": {
69
+ "get": {
70
+ "operationId": "_platform_market_task_get",
71
+ "summary": "GET api/_platform/market/task",
72
+ "x-oj-file": "_platform/market/api.ts",
73
+ "tags": [
74
+ "_platform"
75
+ ],
76
+ "responses": {
77
+ "200": {
78
+ "description": "OK"
79
+ }
80
+ }
81
+ }
82
+ },
83
+ "/api/_platform/market/enable": {
84
+ "post": {
85
+ "operationId": "_platform_market_enable_post",
86
+ "summary": "POST api/_platform/market/enable",
87
+ "x-oj-file": "_platform/market/api.ts",
88
+ "tags": [
89
+ "_platform"
90
+ ],
91
+ "responses": {
92
+ "200": {
93
+ "description": "OK"
94
+ }
95
+ }
96
+ }
97
+ },
98
+ "/api/_platform/market/meta": {
99
+ "get": {
100
+ "operationId": "_platform_market_meta_get",
101
+ "summary": "GET api/_platform/market/meta",
102
+ "x-oj-file": "_platform/market/api.ts",
103
+ "tags": [
104
+ "_platform"
105
+ ],
106
+ "responses": {
107
+ "200": {
108
+ "description": "OK"
109
+ }
110
+ }
111
+ }
112
+ },
113
+ "/api/_platform/market/trust": {
114
+ "get": {
115
+ "operationId": "_platform_market_trust_get",
116
+ "summary": "GET api/_platform/market/trust",
117
+ "x-oj-file": "_platform/market/api.ts",
118
+ "tags": [
119
+ "_platform"
120
+ ],
121
+ "responses": {
122
+ "200": {
123
+ "description": "OK"
124
+ }
125
+ }
126
+ },
127
+ "post": {
128
+ "operationId": "_platform_market_trust_post",
129
+ "summary": "POST api/_platform/market/trust",
130
+ "x-oj-file": "_platform/market/api.ts",
131
+ "tags": [
132
+ "_platform"
133
+ ],
134
+ "responses": {
135
+ "200": {
136
+ "description": "OK"
137
+ }
138
+ }
139
+ }
140
+ },
141
+ "/api/_platform/market/trust/key": {
142
+ "post": {
143
+ "operationId": "_platform_market_trust_key_post",
144
+ "summary": "POST api/_platform/market/trust/key",
145
+ "x-oj-file": "_platform/market/api.ts",
146
+ "tags": [
147
+ "_platform"
148
+ ],
149
+ "responses": {
150
+ "200": {
151
+ "description": "OK"
152
+ }
153
+ }
154
+ },
155
+ "delete": {
156
+ "operationId": "_platform_market_trust_key_delete",
157
+ "summary": "DELETE api/_platform/market/trust/key",
158
+ "x-oj-file": "_platform/market/api.ts",
159
+ "tags": [
160
+ "_platform"
161
+ ],
162
+ "responses": {
163
+ "200": {
164
+ "description": "OK"
165
+ }
166
+ }
167
+ }
168
+ },
169
+ "/api/_platform/market/index": {
170
+ "get": {
171
+ "operationId": "_platform_market_index_get",
172
+ "summary": "GET api/_platform/market/index",
173
+ "x-oj-file": "_platform/market/api.ts",
174
+ "tags": [
175
+ "_platform"
176
+ ],
177
+ "responses": {
178
+ "200": {
179
+ "description": "OK"
180
+ }
181
+ }
182
+ }
183
+ },
184
+ "/api/_platform/market/uninstall-impact": {
185
+ "get": {
186
+ "operationId": "_platform_market_uninstall_impact_get",
187
+ "summary": "GET api/_platform/market/uninstall-impact",
188
+ "x-oj-file": "_platform/market/api.ts",
189
+ "tags": [
190
+ "_platform"
191
+ ],
192
+ "responses": {
193
+ "200": {
194
+ "description": "OK"
195
+ }
196
+ }
197
+ }
198
+ },
199
+ "/api/_platform/market/uninstall": {
200
+ "post": {
201
+ "operationId": "_platform_market_uninstall_post",
202
+ "summary": "POST api/_platform/market/uninstall",
203
+ "x-oj-file": "_platform/market/api.ts",
204
+ "tags": [
205
+ "_platform"
206
+ ],
207
+ "responses": {
208
+ "200": {
209
+ "description": "OK"
210
+ }
211
+ }
212
+ }
213
+ },
214
+ "/api/_platform/market/history": {
215
+ "get": {
216
+ "operationId": "_platform_market_history_get",
217
+ "summary": "GET api/_platform/market/history",
218
+ "x-oj-file": "_platform/market/api.ts",
219
+ "tags": [
220
+ "_platform"
221
+ ],
222
+ "responses": {
223
+ "200": {
224
+ "description": "OK"
225
+ }
226
+ }
227
+ }
228
+ },
229
+ "/api/_platform/solutions/routes": {
230
+ "get": {
231
+ "operationId": "_platform_solutions_routes_get",
232
+ "summary": "GET api/_platform/solutions/routes",
233
+ "x-oj-file": "_platform/solutions/api.ts",
234
+ "tags": [
235
+ "_platform"
236
+ ],
237
+ "responses": {
238
+ "200": {
239
+ "description": "OK"
240
+ }
241
+ }
242
+ }
243
+ },
244
+ "/api/_platform/solutions/verify": {
245
+ "post": {
246
+ "operationId": "_platform_solutions_verify_post",
247
+ "summary": "POST api/_platform/solutions/verify",
248
+ "x-oj-file": "_platform/solutions/api.ts",
249
+ "tags": [
250
+ "_platform"
251
+ ],
252
+ "responses": {
253
+ "200": {
254
+ "description": "OK"
255
+ }
256
+ }
257
+ }
258
+ },
259
+ "/api/_platform/solutions/verify/last": {
260
+ "get": {
261
+ "operationId": "_platform_solutions_verify_last_get",
262
+ "summary": "GET api/_platform/solutions/verify/last",
263
+ "x-oj-file": "_platform/solutions/api.ts",
264
+ "tags": [
265
+ "_platform"
266
+ ],
267
+ "responses": {
268
+ "200": {
269
+ "description": "OK"
270
+ }
271
+ }
272
+ }
273
+ },
38
274
  "/api/auth/login": {
39
275
  "post": {
40
276
  "operationId": "auth_login_post",
@@ -134,6 +370,213 @@
134
370
  }
135
371
  }
136
372
  },
373
+ "/api/demo/todos": {
374
+ "get": {
375
+ "operationId": "demo_todos_get",
376
+ "summary": "GET api/demo/todos",
377
+ "x-oj-file": "demo/todos/api.ts",
378
+ "tags": [
379
+ "demo"
380
+ ],
381
+ "parameters": [
382
+ {
383
+ "name": "keyword",
384
+ "in": "query",
385
+ "required": false,
386
+ "schema": {
387
+ "type": "string"
388
+ }
389
+ }
390
+ ],
391
+ "responses": {
392
+ "200": {
393
+ "description": "OK",
394
+ "x-oj-response-enforced": false,
395
+ "content": {
396
+ "application/json": {
397
+ "schema": {
398
+ "type": "object",
399
+ "required": [
400
+ "code",
401
+ "msg",
402
+ "data"
403
+ ],
404
+ "properties": {
405
+ "code": {
406
+ "type": "integer"
407
+ },
408
+ "msg": {
409
+ "type": "string"
410
+ },
411
+ "data": {
412
+ "type": "object",
413
+ "required": [
414
+ "list",
415
+ "total"
416
+ ],
417
+ "properties": {
418
+ "list": {
419
+ "type": "array",
420
+ "items": {
421
+ "type": "object",
422
+ "required": [
423
+ "id",
424
+ "title",
425
+ "done"
426
+ ],
427
+ "properties": {
428
+ "id": {
429
+ "type": "number"
430
+ },
431
+ "title": {
432
+ "type": "string"
433
+ },
434
+ "done": {
435
+ "type": "boolean"
436
+ }
437
+ }
438
+ }
439
+ },
440
+ "total": {
441
+ "type": "number"
442
+ }
443
+ }
444
+ }
445
+ }
446
+ }
447
+ }
448
+ }
449
+ }
450
+ }
451
+ }
452
+ },
453
+ "/api/home/line": {
454
+ "post": {
455
+ "operationId": "home_line_post",
456
+ "summary": "POST api/home/line",
457
+ "x-oj-file": "home/line/api.ts",
458
+ "tags": [
459
+ "home"
460
+ ],
461
+ "requestBody": {
462
+ "required": true,
463
+ "content": {
464
+ "application/json": {
465
+ "schema": {
466
+ "type": "object",
467
+ "required": [
468
+ "range"
469
+ ],
470
+ "properties": {
471
+ "range": {
472
+ "type": "string"
473
+ }
474
+ }
475
+ }
476
+ }
477
+ }
478
+ },
479
+ "responses": {
480
+ "200": {
481
+ "description": "OK",
482
+ "x-oj-response-enforced": false,
483
+ "content": {
484
+ "application/json": {
485
+ "schema": {
486
+ "type": "object",
487
+ "required": [
488
+ "code",
489
+ "msg",
490
+ "data"
491
+ ],
492
+ "properties": {
493
+ "code": {
494
+ "type": "integer"
495
+ },
496
+ "msg": {
497
+ "type": "string"
498
+ },
499
+ "data": {
500
+ "type": "array",
501
+ "items": {
502
+ "type": "number"
503
+ }
504
+ }
505
+ }
506
+ }
507
+ }
508
+ }
509
+ }
510
+ }
511
+ }
512
+ },
513
+ "/api/home/pie": {
514
+ "get": {
515
+ "operationId": "home_pie_get",
516
+ "summary": "GET api/home/pie",
517
+ "x-oj-file": "home/pie/api.ts",
518
+ "tags": [
519
+ "home"
520
+ ],
521
+ "parameters": [
522
+ {
523
+ "name": "by",
524
+ "in": "query",
525
+ "required": false,
526
+ "schema": {
527
+ "type": [
528
+ "string",
529
+ "number"
530
+ ]
531
+ }
532
+ }
533
+ ],
534
+ "responses": {
535
+ "200": {
536
+ "description": "OK",
537
+ "x-oj-response-enforced": false,
538
+ "content": {
539
+ "application/json": {
540
+ "schema": {
541
+ "type": "object",
542
+ "required": [
543
+ "code",
544
+ "msg",
545
+ "data"
546
+ ],
547
+ "properties": {
548
+ "code": {
549
+ "type": "integer"
550
+ },
551
+ "msg": {
552
+ "type": "string"
553
+ },
554
+ "data": {
555
+ "type": "array",
556
+ "items": {
557
+ "type": "object",
558
+ "required": [
559
+ "value",
560
+ "code"
561
+ ],
562
+ "properties": {
563
+ "value": {
564
+ "type": "number"
565
+ },
566
+ "code": {
567
+ "type": "string"
568
+ }
569
+ }
570
+ }
571
+ }
572
+ }
573
+ }
574
+ }
575
+ }
576
+ }
577
+ }
578
+ }
579
+ },
137
580
  "/api/notification/notifications": {
138
581
  "get": {
139
582
  "operationId": "notification_notifications_get",
@@ -684,6 +1127,84 @@
684
1127
  }
685
1128
  }
686
1129
  }
1130
+ },
1131
+ "post": {
1132
+ "operationId": "system_oplog_post",
1133
+ "summary": "POST api/system/oplog",
1134
+ "x-oj-file": "system/oplog/api.ts",
1135
+ "tags": [
1136
+ "system"
1137
+ ],
1138
+ "requestBody": {
1139
+ "required": true,
1140
+ "content": {
1141
+ "application/json": {
1142
+ "schema": {
1143
+ "type": "object",
1144
+ "required": [
1145
+ "action",
1146
+ "module"
1147
+ ],
1148
+ "properties": {
1149
+ "action": {
1150
+ "type": "string",
1151
+ "minLength": 1
1152
+ },
1153
+ "module": {
1154
+ "type": "string",
1155
+ "minLength": 1
1156
+ },
1157
+ "version": {
1158
+ "type": "string"
1159
+ },
1160
+ "target": {
1161
+ "type": "string"
1162
+ },
1163
+ "level": {
1164
+ "type": "number"
1165
+ }
1166
+ }
1167
+ }
1168
+ }
1169
+ }
1170
+ },
1171
+ "responses": {
1172
+ "200": {
1173
+ "description": "OK",
1174
+ "x-oj-response-enforced": false,
1175
+ "content": {
1176
+ "application/json": {
1177
+ "schema": {
1178
+ "type": "object",
1179
+ "required": [
1180
+ "code",
1181
+ "msg",
1182
+ "data"
1183
+ ],
1184
+ "properties": {
1185
+ "code": {
1186
+ "type": "integer"
1187
+ },
1188
+ "msg": {
1189
+ "type": "string"
1190
+ },
1191
+ "data": {
1192
+ "type": "object",
1193
+ "required": [
1194
+ "ok"
1195
+ ],
1196
+ "properties": {
1197
+ "ok": {
1198
+ "type": "boolean"
1199
+ }
1200
+ }
1201
+ }
1202
+ }
1203
+ }
1204
+ }
1205
+ }
1206
+ }
1207
+ }
687
1208
  }
688
1209
  },
689
1210
  "/api/system/permissions": {
@@ -1481,6 +2002,12 @@
1481
2002
  {
1482
2003
  "name": "auth"
1483
2004
  },
2005
+ {
2006
+ "name": "demo"
2007
+ },
2008
+ {
2009
+ "name": "home"
2010
+ },
1484
2011
  {
1485
2012
  "name": "notification"
1486
2013
  },
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@oj-module/template-demo",
3
+ "type": "module",
4
+ "version": "0.0.0",
5
+ "private": true,
6
+ "scripts": {
7
+ "dev": "ojm dev",
8
+ "build": "ojm build",
9
+ "preview": "ojm preview",
10
+ "info": "ojm info",
11
+ "typecheck": "tsc --noEmit -p tsconfig.json"
12
+ },
13
+ "devDependencies": {
14
+ "@ant-design/cssinjs": "catalog:",
15
+ "@ant-design/icons": "catalog:",
16
+ "@ant-design/pro-components": "catalog:",
17
+ "@dnd-kit/core": "catalog:",
18
+ "@dnd-kit/sortable": "catalog:",
19
+ "@dnd-kit/utilities": "catalog:",
20
+ "@oj-module/cli": "workspace:*",
21
+ "@oj-module/runtime": "workspace:*",
22
+ "@tanstack/react-query": "catalog:",
23
+ "@types/react": "catalog:",
24
+ "@vitejs/plugin-react": "catalog:",
25
+ "ahooks": "catalog:",
26
+ "antd": "catalog:",
27
+ "antd-img-crop": "catalog:",
28
+ "clsx": "catalog:",
29
+ "dayjs": "catalog:",
30
+ "echarts": "catalog:",
31
+ "echarts-for-react": "catalog:",
32
+ "i18next": "catalog:",
33
+ "keepalive-for-react": "catalog:",
34
+ "ky": "catalog:",
35
+ "motion": "catalog:",
36
+ "nprogress": "catalog:",
37
+ "pinyin-pro": "catalog:",
38
+ "react": "catalog:",
39
+ "react-countup": "catalog:",
40
+ "react-dom": "catalog:",
41
+ "react-error-boundary": "catalog:",
42
+ "react-i18next": "catalog:",
43
+ "react-jss": "catalog:",
44
+ "react-router": "catalog:",
45
+ "simplebar-react": "catalog:",
46
+ "spin-delay": "catalog:",
47
+ "tailwind-merge": "catalog:",
48
+ "use-sync-external-store": "catalog:",
49
+ "vditor": "catalog:",
50
+ "zustand": "catalog:"
51
+ }
52
+ }
@@ -0,0 +1,8 @@
1
+ /* eslint-disable */
2
+ // 生成物:ojm api 从契约生成,勿手改(改动请改契约文件后重跑 ojm api)
3
+ // AC-D15:仅供 DEV 校验动态 import,生产构建不进产物
4
+ import { z } from "@oj-module/runtime";
5
+
6
+ export const schemas = {
7
+
8
+ };